Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ All notable changes to Tarn are documented in this file. The format is based on

### Added

- Assistant chats are kept: each profile lists its chats to search, open, rename and delete, and
Settings › AI deletes them all. An answer can be copied and retried and its question edited;
code blocks get Copy; `/` lists the commands; the chat header picks the provider and Claude
model. On macOS and Windows, Insert into Page types an answer into the page's focused field, as
Insert Snippet does. Never in a private space, a burner tab or under Lockdown.
- Settings and the assistant are redesigned on every client: each pane has a short summary,
row actions are icon buttons with tooltips, editors open from an Add button, and empty lists say
what to do. The assistant's header names the chat and its model, the composer holds attachments
and Send or Stop, and `/` opens a command menu you can move through with the arrow keys on macOS
and Windows.
- Settings › AI: choose the Claude model (Opus 5.5, Sonnet 5.5, Haiku 5.5) and write your own
commands with `{page}`, `{selection}` and `{question}`.
- Settings › Snippets: search, and a switch for `;name` expansion in the address and command bar.
- Settings › Notes: sort by last edited or title, Ask the assistant about a note, and export all
notes as one Markdown file.

- Install with one command: `brew install --cask quavon-dev/tarn/tarn` on macOS (the cask follows
each release; Tarn keeps updating itself), and on Windows
`irm https://github.com/Quavon-dev/tarn-browser/releases/latest/download/install.ps1 | iex`,
Expand Down
4 changes: 2 additions & 2 deletions PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ is at https://tarnbrowser.com/privacy.

History (and, only if you turn on Settings › Search › Search the text of visited pages, up to 4 KB
of each visited page's text), cookies, cache, open tabs, permissions, downloads, favicons, settings,
how often and when each shortcut tip was shown, your snippets, your notes, and the Shield card's counters (tracking parameters removed, pages upgraded to HTTPS, local-network
how often and when each shortcut tip was shown, your snippets, your notes, the assistant chats you had (your questions, its answers and the addresses of the pages you attached, without query, fragment or sign-in parts, kept so content from a site you later put in Lockdown can be removed), and the Shield card's counters (tracking parameters removed, pages upgraded to HTTPS, local-network
visits blocked, pages on block lists stopped, pop-ups blocked and requests blocked by the Chromium
engine's filter; in total, per day for the last seven days and per site for the sites protected
most) with its design value are stored only on your Mac, separately for each profile, in
Expand Down Expand Up @@ -77,7 +77,7 @@ Settings › Privacy › Connections Tarn makes on macOS and Windows.
| Theme catalog and downloads | GitHub (the repository you name, or the official catalog in `Quavon-dev/tarn-themes`, not offered yet because its signing key is not set) | Your IP address and which repository or theme you install or check | Only when you click Install, Check for Updates or Show Official Themes in Settings › Appearance, on every client; on macOS and Windows switch off with the same Settings › Privacy switch as extensions; Linux, iOS and Android have no such switch yet (themes from a file or the clipboard keep working) |
| Site icon | The site you are on, or a server it already loaded from (such as its CDN, without cookies), through the tab's web engine with your Shield rules | Same as visiting the site | After a page loads over https; never under Lockdown; cleared with history |
| Translation (builds with the `translation` feature) | Nobody: Apple's Translation framework runs on your Mac | Nothing. Only language packs you installed in System Settings › General › Language & Region › Translation Languages are used; Tarn never downloads one | Only when you click Translate on the banner; never under Lockdown |
| AI request (only if you enable AI) | Anthropic, or Ollama on your own computer (loopback only, never one of Ollama's cloud models) | Your question, the earlier turns of that chat and only what you attach: a page's address without query or fragment, its title and text, or a note; when you ask it to sort tabs, the host name and title of each loose web tab in the space (never a path, a local file or a home-network page) | Only when you press Send, a command or Group with Assistant, in a profile whose switch in Settings › AI is on; never from a private space, a burner tab or a Lockdown page. On macOS, Windows, Linux, iOS and Android (Ollama on macOS, Windows and Linux only) |
| AI request (only if you enable AI) | Anthropic, or Ollama on your own computer (loopback only, never one of Ollama's cloud models) | Your question, the earlier turns of that chat and only what you attach: a page's address without query or fragment, its title and text, or a note; when you ask it to sort tabs, the host name and title of each loose web tab in the space (never a path, a local file or a home-network page) | Only when you press Send, Retry, a command or Group with Assistant, in a profile whose switch in Settings › AI is on; never from a private space, a burner tab or a Lockdown page. On macOS, Windows, Linux, iOS and Android (Ollama on macOS, Windows and Linux only) |

A local model makes no connection beyond your own device. "Local" means Apple's on-device model
(builds with the `foundation-models` feature, on macOS and iOS; only the system's on-device model,
Expand Down
18 changes: 18 additions & 0 deletions crates/ai/src/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

use pulldown_cmark::{Event, Options, Parser, Tag, TagEnd};

/// The most blocks an answer draws, so output steered into thousands of tiny items cannot stall
/// the window that lays them out.
pub const MAX_BLOCKS: usize = 2_000;
const CUT: &str = "The rest of this answer is not shown.";

#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub struct Style {
pub bold: bool,
Expand Down Expand Up @@ -156,11 +161,24 @@ pub fn parse(markdown: &str) -> Vec<Block> {
}
}
b.flush();
if b.blocks.len() > MAX_BLOCKS {
b.blocks.truncate(MAX_BLOCKS);
b.blocks.push(Block::Paragraph(vec![Span { text: CUT.to_owned(), style: Style::default(), link: None }]));
}
b.blocks
}

#[cfg(test)]
mod tests {

#[test]
fn a_long_answer_draws_its_first_blocks_and_says_the_rest_is_cut() {
let blocks = parse(&"- x\n".repeat(MAX_BLOCKS * 2));
assert_eq!(blocks.len(), MAX_BLOCKS + 1);
assert!(matches!(&blocks[MAX_BLOCKS], Block::Paragraph(spans) if spans[0].text == CUT));
assert_eq!(parse("a\n\nb").len(), 2);
}

use super::*;

fn all_spans(blocks: &[Block]) -> Vec<Span> {
Expand Down
1 change: 1 addition & 0 deletions crates/ai/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ mod ureq_transport {
)
.http_status_as_error(false)
.timeout_connect(Some(Duration::from_secs(10)))
.timeout_recv_response(Some(Duration::from_secs(60)))
.timeout_global(Some(timeout))
.build()
.into()
Expand Down
Loading
Loading