Commit Graph
100 Commits
Author SHA1 Message Date
rune 7f5d858b2a Add multi-select + bulk move-to-folder to both conversation lists
ConversationListView (advanced list, ⌘L): ⌘-click toggles a row,
Shift-click selects a contiguous range, and a "Move to Folder"
toolbar button/context-menu entry moves every selected conversation
at once. Confirmed working live.

SidebarView: same capability, adapted to the sidebar's own click
model since opening a chat there previously required only a single
click. Single-click now selects only (replacing the prior selection),
⌘/Shift-click work the same as the advanced list, and double-click
opens a chat (clearing the selection). Selected rows get a distinct
neutral tint from the existing accent highlight used for the
currently-open conversation. Dragging a row that's part of a
multi-selection now bundles every selected conversation's ID into the
drag payload, so dropping on a folder moves the whole selection
instead of just the dragged row.

Range-selection math (idsInRange) is defined once on
ConversationListView and reused directly by SidebarView rather than
duplicated — it's `internal`, not `private`, specifically so both
views can share it.
2026-08-02 16:54:05 +02:00
rune 0e4389d272 Add live code formatting in the chat input
Inline single-backtick spans and multi-line fenced ```blocks``` now
render with monospace styling as you type, plus real per-language
syntax highlighting for fenced blocks (reusing the existing
SyntaxHighlighter utility). Only complete, closed spans/fences light
up — an unterminated backtick or fence is left as plain text until
closed.

Pure regex/range logic extracted into testable static functions
(inlineCodeRanges, fencedCodeBlocks, fencedCodeBlockRanges) rather
than living inline in the NSTextView coordinator.
2026-08-02 15:22:21 +02:00
rune 40c03108c9 Bump version to 2.5.0
A full rebrand (oAI -> Confab) warrants a minor version bump rather
than a patch release. Branch renamed from 2.4.4 to 2.5.0 to match the
project's per-version branch convention (old branch deleted from the
remote after the new one was pushed and tracked).
2026-08-02 15:16:30 +02:00
rune 1f6a62d2d7 Fix rename commit composition: drop unrelated test files, finish entitlements rename
Untrack ConversationListViewPureLogicTests.swift and
NativeTextEditorPureLogicTests.swift — these belong to two other
unrelated, unfinished features (conversation multi-select and input
code formatting) and got swept in by an overly broad glob in the
previous commit. Files remain on disk, just untracked again.

Also stage the deletion of the old oAI.entitlements path — the
earlier git mv to Confab.entitlements had its staged rename undone by
an intermediate git reset, so the previous commit added the new file
without ever removing the old one from tracking.
2026-08-02 14:59:25 +02:00
rune 76b58e6fdc Rename app from oAI to Confab
"oAI" reads as easily confused with OpenAI, both visually and in
casual conversation. Renamed to "Confab" throughout: Xcode
target/scheme/bundle ID (com.oai.Confab), Info.plist and Help Book
identity, all user-facing UI text, internal Log subsystem and color
identifiers, localization catalogs (6 languages, including a proper
reworded/retranslated Intel-deprecation notice), Help Book HTML
content, and docs (README/DEVELOPMENT/PRIVACY/SECURITY).

Deliberately cosmetic-only: the on-disk data folder
(~/Library/Application Support/oAI/), database/backup filenames,
Keychain service identifiers, and EncryptionService's key-derivation
inputs are all left untouched so existing conversations, settings,
and stored API keys survive the update with zero migration and no
re-entering credentials. Verified live: a real signed build
successfully decrypted a stored API key and loaded an existing
conversation database after the bundle ID change.

Also includes a small already-completed, previously uncommitted
model-release-date feature (ModelInfo/OpenRouterModels/
OpenRouterProvider/ModelInfoView) that happened to share several
files with this rename.

Gitignored on this branch and updated on disk but not part of this
commit: CLAUDE.md, RELEASE_NOTES.md, and the build*.sh scripts.
2026-08-02 14:58:14 +02:00
rune ae3de3d927 Fix Git Sync wiping the entire repo when a fresh clone's DB is empty
exportAllConversations()'s orphan-cleanup treated "zero local
conversations" as "every synced conversation was deleted," so a
just-cloned repo on a new machine could get emptied and pushed before
the post-clone import ever ran. orphanedExportFilenames() now returns
no orphans when the local ID set is empty, and cloneRepository()
imports immediately after cloning to close the window entirely.
2026-08-01 10:50:46 +02:00
rune 77223536e9 Fix docs: Crash Recovery setting is in Settings → General, not Advanced
Corrected README and Help book — the toggle actually lives in
SettingsView.generalTab, not the Advanced tab.
2026-07-31 08:15:02 +02:00
rune e3557a87df Add unsaved-changes save prompt and crash-recovery draft
Replaces heuristic auto-save (goodbye-phrase detection, idle timeout,
min-message count, on-model-switch) with a standard macOS unsaved-changes
gate (Save/Don't Save/Cancel) on New Chat, Clear Chat, Load Conversation,
and Quit. The Save dialog gained a folder picker with inline "New Folder…"
creation.

Separately, the in-progress conversation is periodically mirrored to disk
(DraftRecoveryService, configurable interval in Settings, default 10s) and
offered back on next launch if oAI crashes or is force-quit, including the
model that was selected.

Two real bugs found via ObjectIdentifier/log-based diagnosis before this
worked correctly:
- oAIApp.init() wired AppDelegate.chatViewModel from its own @State read,
  which returned a throwaway ChatViewModel instance distinct from the one
  ContentView actually renders. Wiring moved to ContentView.onAppear.
- NSApplication.shared.delegate as? AppDelegate always failed silently:
  @NSApplicationDelegateAdaptor registers an internal SwiftUI.AppDelegate
  wrapper as the real NSApp.delegate (same name, different type in a
  different module), which forwards protocol methods but isn't castable
  to our type. AppDelegate now tracks itself via a static `shared`.

Also guards checkForCrashRecoveryDraft() against running under
XCTestConfigurationFilePath — oAITests is app-hosted, so xcodebuild test
launches this same app, and a leftover draft file on disk would otherwise
hang the entire test run on a blocking NSAlert with no one to click it.
2026-07-31 08:11:12 +02:00
rune a306aaef9a Bump displayed version to 2.4.4 2026-07-30 09:45:30 +02:00
rune 8db7820de2 Replace Jarvis API key hint with an oAI-Web blurb and Gitea link 2026-07-30 09:43:57 +02:00
rune b0f3049d6b Make PDF export actually dark
Two things were fighting the previous dark-PDF attempt, both
confirmed by direct experimentation:

- prefers-color-scheme is ignored entirely by the print pipeline —
  identical CSS printed light even with the webview's appearance
  forced to dark. Screen dark-mode media queries just don't apply to
  NSPrintOperation rendering.
- Even with dark colors set unconditionally (no media query), the
  print pipeline still dropped every background color and printed
  white — browsers/WebKit strip background-color/background-image by
  default when printing, to save ink, unless told otherwise via
  print-color-adjust: exact.

PDF now has its own always-dark stylesheet (pdfCss) instead of the
prefers-color-scheme-driven one HTML export still uses, plus
`* { print-color-adjust: exact }` so the dark backgrounds actually
survive the print pass. html(name:messages:) takes a new
forceDarkCSS parameter (default false, unchanged for HTML/other
callers); pdfData passes true. Dropped the now-pointless
webView.appearance forcing, since dark is unconditional now.

Verified with the same standalone repro-script + Read-the-PDF method:
dark page background, colored message boxes, dark code block, all
correctly surviving the real A4 print pipeline.
2026-07-29 12:37:18 +02:00
rune 879739b32c Switch PDF export page size from US Letter to A4 2026-07-29 12:08:22 +02:00
rune 7f5374dce0 Switch PDF export from createPDF() to real print pagination
Rune compared our PDF against a normal reference PDF and the
difference was structural, not just a font-size tweak: the reference
was 6 standard A4 pages (595x842pt); ours was ONE continuous page
850x6886pt — nearly 8 feet tall. That's what createPDF() actually
does when content overflows its frame (confirmed in the prior commit)
— it auto-grows to fit everything as a single non-standard-sized
page, never paginating. There was no page of a familiar size to judge
the "normal" font size against, which is what actually read as "huge"
even after the sizing fixes.

Replaced with WKWebView's real print pipeline: build an NSPrintInfo
for US Letter (612x792pt) with normal margins, get a print operation
via webView.printOperation(with:), and run it silently (no panel) to
a temp file, dispatched off the main actor since NSPrintOperation.run()
blocks synchronously. This is genuine multi-page pagination — same
mechanism any app's real print-to-PDF uses.

Also added break-inside/page-break-inside: avoid on .message so a
single message doesn't get split awkwardly across a page boundary.

Verified with a standalone reproduction script (same method as the
prior fix) using the actual exported CSS and realistic multi-message
content: clean 2-page US Letter output, message boundaries respected
across the page break, normal-looking document proportions.
2026-07-29 12:05:36 +02:00
rune 2219aceda6 Fix oversized nested headers in exported HTML/PDF
The remaining "text still looks large" complaint after the page-
geometry fix was real: .message h1-h6 only ever set margin, never
font-size, so any markdown header inside an AI response (very common
in formatted answers — "## Reality Check on Capacity" etc) fell back
to the browser's default heading sizes (h2 ≈ 22px+ against a 15px
body). Gave headers an explicit, compact scale (19/17/15.5/14px) and
trimmed the base body size from 15px to 14px and the outer title from
24px to 22px for a tighter, more document-like feel overall.

Verified by reproducing the exact content from the reported screenshot
(the M1 AI Setup conversation with its "Reality Check on Capacity"
h2 and bolded list items) through the same standalone WKWebView/
createPDF harness used for the previous fix, and visually confirming
the heading now renders proportionately instead of oversized.
2026-07-29 11:51:53 +02:00
rune 3a30db1d15 Actually fix oversized PDF text — root cause was the previous fix
Empirically reproduced this outside the app (standalone WKWebView +
createPDF script, inspecting real PDF page bounds via PDFKit) instead
of guessing again. Findings:

- WKPDFConfiguration.rect left at default captures the webview's
  frame size verbatim when content fits within it, and auto-grows to
  a single tall page matching full scrollable content when it
  overflows. It does not paginate, and setting rect explicitly just
  clips to that one rect instead.
- The scrollHeight-based frame resize added last round (to "fix" this
  same bug) was itself the problem: resizing the frame before calling
  createPDF produced a page that didn't match the resized frame at
  all (e.g. resized to 816x295, captured page came out 799x375) — a
  small, badly-proportioned page that made ordinarily-sized text look
  enormous relative to it. Removed entirely.
- A visible scrollbar during capture shaves ~17pt off the captured
  page width. Added ::-webkit-scrollbar { display: none } to prevent
  that.

Verified against a 12-message realistic conversation: clean single
page, correct proportions, readable text, matches the intended CSS
layout. The text-size-adjust/viewport-meta fix from last round turned
out to be unnecessary (computed font-size was correct all along) but
is harmless, so left in place.
2026-07-29 09:13:10 +02:00
rune a3fd2c0eab Fix extremely oversized text in PDF export
Three defensive fixes for WKWebView.createPDF() rendering text far
larger than the source HTML's actual font sizes specify:

- Added a viewport meta tag and explicit -webkit-text-size-adjust:
  100% — WebKit's shared engine has a text-autosizing heuristic
  (normally associated with mobile Safari, but can trigger in WKWebView
  contexts too, especially for content loaded via loadHTMLString with
  no base URL) that boosts font sizes for perceived readability; this
  disables it explicitly rather than relying on it not firing.
- Explicit body font-size (was previously unset, relying on WebKit's
  default) and webView.pageZoom = 1.0.
- Resize the webview to the actual rendered content height
  (via document.body.scrollHeight) before calling createPDF, instead
  of relying on its undocumented auto-sizing against the arbitrary
  initial frame — a bounds mismatch here is a known cause of
  blown-up/rescaled PDF output.
2026-07-29 09:01:12 +02:00
rune 6fb49083d8 Let File > Export as HTML/PDF/Markdown choose name and location
Previously always silently wrote to Downloads with a fixed name — no
way to pick where it goes or rename it. Added
exportConversationWithSavePanel(format:defaultFilename:), which shows
a native NSSavePanel (defaulting to Downloads + the same filename as
before) before writing. Wired into all three File menu export buttons.

The /export slash command and the conversation list's per-row Export
submenu are unchanged (still write straight to Downloads) — the slash
command already takes an explicit filename argument inline, and the
row export is meant as a quick one-click action rather than a
save-as workflow.
2026-07-29 08:49:36 +02:00
rune 53736d4c42 Add dark mode and GFM table support to HTML/PDF export
Dark: added a prefers-color-scheme: dark CSS block, so HTML export
adapts to the browser/OS theme it's later viewed in. PDF is baked at
export time so it can't respond live — instead the offscreen WKWebView
used for PDF rendering has its appearance explicitly set to
NSApp.effectiveAppearance, matching whatever mode the app is in right
now at export time.

Tables: the renderer had no table support at all (previously
documented as an intentional scope cut), so GFM pipe tables were
falling through to the plain-paragraph path and showing up as literal
"| --- | --- |" text. Added detection (a row line immediately followed
by a valid dashes/colons separator row) plus alignment parsing from
the separator's colons.
2026-07-29 08:08:16 +02:00
rune 634b83f284 Add HTML and PDF conversation export
Top item on the roadmap ranking from 2026-07-27 — multi-modal export
alongside the existing Markdown/JSON. New ConversationExportService
consolidates the two previously-duplicated Markdown builders
(ChatViewModel and ConversationListView had separate copies of the
same **User**/**Assistant** + --- format) and adds:

- A hand-rolled Markdown->HTML renderer scoped to what actually shows
  up in chat messages (headers, bold/italic, inline code, fenced code
  blocks, lists, blockquotes, links, horizontal rules) rather than
  full CommonMark/GFM — no existing markdown-to-HTML utility existed
  in the codebase, and swift-markdown-ui is SwiftUI-view-only with no
  HTML-string export API. Content is HTML-escaped before any markdown
  substitution so example code containing "<div>" etc renders as
  visible text, not live markup.
- PDF via an offscreen WKWebView loading that same HTML and calling
  the official createPDF(configuration:) API (macOS 11+) — no new
  project/framework linkage needed, WebKit is a system framework.

Wired into every place Markdown export already existed: File menu
(Export as HTML.../PDF...), /export slash command (now md|html|pdf|json),
and a new Export submenu (Markdown/HTML/PDF) on each conversation row's
context menu in the advanced conversation list, replacing the old
single-format swipe-only export. Help docs and InputBar autocomplete
updated to match.
2026-07-29 07:47:57 +02:00
rune 727fc7d6af Refresh sidebar folders when the advanced conversation list closes
Creating/renaming/deleting a folder in ConversationListView only ever
updated its own local @State — the sidebar has a separate folders
array that was only refreshed by onAppear or conversation-change
triggers, so a folder created in the modal didn't show up in the
sidebar until the next app launch. Sidebar now reloads when
showConversations transitions to false (the modal closing).
2026-07-29 07:19:27 +02:00
rune 72540305ad Fix deletions not sticking (git sync resurrection), persist folder
collapse state, make merge provider picker visibly clickable

Deleted conversations coming back: exportAllConversations() only ever
wrote files for conversations that currently exist — it never removed
the exported markdown file for a conversation that had been deleted
locally. That file just sits in the sync repo forever, so every
future pull+import (including on every app startup) silently
resurrects it, since importAllConversations() only skips an import
when a matching local ID already exists. Fixed by having export also
delete orphaned files (conversation ID no longer present locally), and
added GitSyncService.syncAfterDeletion() — a debounced export+push
triggered right after any delete/bulk-delete/merge-cleanup, so the
removal reaches the remote promptly instead of waiting on an
unrelated future auto-save. Existing duplicates need one more manual
delete to clear, but they'll stay gone after that.

Folder collapse state now persists (SettingsService.collapsedFolderIds,
JSON-encoded like favoriteModelIds) and is restored on app launch, in
both the sidebar and the advanced conversation list.

Merge model picker: the provider switcher was legitimate (it does load
each provider's own catalog independently) but looked like plain
text — no chevron, no button styling — so it wasn't obviously
clickable. Restyled to match HeaderView's provider menu affordance
(icon + label + chevron on a colored pill).
2026-07-28 15:21:11 +02:00
rune 37734232f5 Decouple merge model picker from the main chat's active provider
The merge model picker was reusing chatViewModel.availableModels,
which only ever holds whichever provider the main chat window
currently has active — fine for the main chat's own switcher (where
provider and model change together via the header), wrong for an
independent one-off picker like this. If your active chat was on
Anthropic, that's all you could pick from here regardless of what
other providers you have configured.

Added its own provider menu (mirroring HeaderView's) and an
independent model list fetched via ProviderRegistry for whichever
provider is selected, so OpenRouter, Anthropic, OpenAI, etc. are all
genuinely selectable regardless of what the main chat is doing.
2026-07-28 14:57:19 +02:00
rune e898d4b6db Sort folders alphabetically; let users pick the merge model directly
Folders now list alphabetically (case-insensitive) everywhere they're
shown — sidebar, advanced conversation list, and the "Move to Folder"
menu — rather than creation order. listFolders() does the sort at the
DB layer; in-memory folder arrays are re-sorted after local
create/rename so newly added or renamed folders don't fall out of
order until the next reload.

Combine Conversations' AI-Assisted Merge no longer silently assumes
settings.defaultModel — added a model picker (reusing ModelSelectorView,
defaulting to the current default model/provider) so users can pick
which model performs the merge per-combine. ConversationMergeService.merge
takes optional mergeModelId/mergeProvider overrides.
2026-07-28 14:39:18 +02:00
rune 8dee77541f Use non-chat-like delimiters for merge transcripts, log truncation
Rune retested after the previous merge fix (bigger token budget,
stronger instruction) with the exact same DDNS Docker debugging
conversations and got the identical failure — same error text,
same models. Logs showed a single ~86s request with a large prompt
(31k tokens cached) and no truncation signal available to check.

The remaining suspect: the transcript was formatted as "**User:**" /
"**Assistant:**" markdown, which closely mimics a live chat turn
format. Over a long, noisy transcript that includes something reading
like a directive ("no more editing", etc), the model can lose track of
"this is data to merge" and slip into continuing/replying to it
instead — matching exactly what was observed. Replaced the transcript
markers with synthetic, non-chat-like tokens (<<<USER_TURN>>> etc) and
added an explicit "this is not a live conversation" framing both
before and after the transcript block, not just once at the top.

Also: log OpenRouter's finishReason when it's "length" (i.e. the
response was actually cut off) so a future failure like this is
distinguishable from a formatting/instruction-following miss without
guessing from the log lines Rune already has available.
2026-07-28 14:11:11 +02:00
rune c6daae6c10 Fix AI-Assisted merge failing to parse the model's response
Three changes, all aimed at the same failure: merges of large
conversations (e.g. long debugging sessions) were reliably failing to
parse on both Haiku 4.5 and GLM 5.2.

- maxTokens was a flat 4000 regardless of input size — a merge of two
  long conversations needs a much larger completion budget than that,
  so the model's JSON array output was getting cut off mid-generation.
  Now scaled with transcript size (8000-16000).
- Strengthened the prompt: explicitly tell the model not to respond to
  or continue anything found inside the transcripts (a real observed
  failure mode was the model echoing/continuing transcript content
  instead of merging it), and to emit nothing but the JSON array.
- parseTurns now falls back to scanning for a bracket-balanced JSON
  array anywhere in the response (respecting quoted strings) if the
  model still wraps the array in commentary despite instructions not
  to, instead of failing outright on the first non-JSON response.
2026-07-28 13:49:43 +02:00
rune 03f84ebe01 Fix black text in drag preview when moving a chat to a folder
.draggable()'s default drag-preview snapshot wasn't inheriting the
app's dark appearance, rendering the conversation name in black on a
transparent background while dragging. Supply an explicit preview
view instead — white text on the accent color pill — so it stays
legible for the duration of the drag, independent of the row's own
(already-correct) rendering before and after the move.
2026-07-28 13:30:53 +02:00
rune 7fbac5e809 Fix black row text after moving to a folder, remove duplicate chevron
Pin conversation row title text to .foregroundStyle(.primary) instead
of the implicit default — under List's sidebar/source-list style,
AppKit's row highlighting could resolve default text to black on a
just-interacted-with row (e.g. right after a drag/context-menu move),
making it unreadable. Also drop Section(isExpanded:), which was
rendering its own native disclosure chevron on the right in addition
to the custom one already in the header on the left; folder collapse
now works purely off the existing collapsedFolders state with a plain
Section, so only the intended left-side chevron remains.
2026-07-28 13:25:40 +02:00
rune 8c0cfb87f5 Fix unused-result warning on dropDestination handlers
SwiftUI's dropDestination(for:action:) action closure is Void-
returning, not Bool, so handleDrop's Bool return was being silently
discarded — made the discard explicit with _ =.
2026-07-28 13:15:11 +02:00
rune 24847762c4 Make folders collapsible, draggable, bold, and add New Folder button
Folder sections now collapse via an explicit chevron/tap header
(rather than relying on platform-dependent native disclosure, which
didn't render/click reliably) — same collapsed-state binding also
backs Section(isExpanded:) so content visibility stays in sync.
Conversations are draggable onto folder/Unfiled headers to file/unfile
them. Folder names render bold. "New Folder" is now a dedicated button
next to "New Chat" in the sidebar, and next to "Select" in the
advanced conversation list, instead of a small icon buried in the
search row.
2026-07-28 13:11:02 +02:00
rune bf328c2629 Fix Swift 6 warnings in usage stats and folder deletion
UsageStats/ModelUsageStat/ConversationUsageStat need explicit
nonisolated inits under this project's SWIFT_DEFAULT_ACTOR_ISOLATION =
MainActor setting, same as Message/Conversation. deleteFolder also
discarded FolderRecord.deleteOne's Bool result implicitly via the
write closure's return value.
2026-07-28 12:56:37 +02:00
rune 376fff4939 Add folders for organizing saved conversations
Conversations can now be filed into flat (non-nested) folders, shown
as collapsible sections in both the sidebar and the advanced
conversation list. New folders migration (v9) adds a folders table
and conversations.folderId with ON DELETE SET NULL, so deleting a
folder unfiles its conversations rather than losing them. Move/rename/
delete via context menu; conversation lists with no folders fall back
to the existing flat view unchanged.
2026-07-28 12:43:05 +02:00
rune 0642f3746f Add all-time usage statistics tab
Extends the existing Stats sheet (⌘⇧S) with a Session/All-Time segmented
picker. All-Time aggregates tokens, cost, and message counts across every
saved conversation, broken down by model and by conversation, using the
modelId already stored per message — no schema change needed.
2026-07-28 12:35:45 +02:00
runeandClaude Sonnet 5 71e8a49d77 Audit and fix README content errors and gaps
Real errors found and fixed:
- Disclaimer referenced a nonexistent Telegram feature and called the
  app "oAI-Web" (leftover from a different project's README)
- Git Sync goodbye-phrase example listed "thanks" as a trigger, which
  was deliberately excluded from the actual phrase list (fires on
  every polite message)
- UI/UX section still described status pills (MCP/Online/Sync) as
  living in the header; they moved to the footer in the v2.4 sidebar
  redesign

Missing shipped features added: Apple Intelligence provider, Personal
Data Tools (Calendar/Reminders/Contacts/Location), Research Agents,
External MCP Servers, MCP PDF text extraction, and the /shortcuts,
/skills, /jarvis, // slash commands.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 10:24:40 +02:00
runeandClaude Sonnet 5 d700b348cc Remove stale Gatekeeper warning from README
DMGs are notarized and stapled automatically now, so the workaround
steps no longer apply. Also corrected the minimum macOS requirement
to match the actual deployment target (26.2, not 14.0).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 10:19:26 +02:00
runeandClaude Sonnet 5 983c75f325 Update README screenshots
Replace the old 4 screenshots with 7 current ones covering chat,
General/Apple Intelligence settings, MCP + Personal Data settings,
Agent Skills (list + edit), Advanced settings, and iCloud Backup —
placed next to the sections they illustrate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 10:16:04 +02:00
runeandClaude Sonnet 5 f1665a3a57 Remove Roadmap section from README
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 09:31:53 +02:00
runeandClaude Sonnet 5 3712078a74 Link Privacy and Security policies from README
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 09:25:27 +02:00
runeandClaude Sonnet 5 7219bfdb72 Add PRIVACY.md
Local-first policy: no telemetry/analytics/crash reporting, API keys
in Keychain, data flow documented for every opt-in feature that
touches personal data or talks to third-party AI providers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 09:21:39 +02:00
runeandClaude Sonnet 5 d0b3feb171 Bump version to 2.4.3
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 08:17:34 +02:00
runeandClaude Sonnet 5 69dbf17f5e Add PDF text extraction to MCP read_file and search_files
MCP's read_file previously hard-required UTF-8 text decoding, so any
PDF in an allowed folder failed with "Cannot read file as UTF-8
text" — chat attachments already supported PDFs (raw bytes to
vision-capable models), but the AI couldn't read one on its own
during agentic file-tool use. search_files' content_search had the
same gap, silently skipping PDFs.

Adds MCPService.extractPDFText(atPath:) using PDFKit (built into
macOS, no new dependency) to pull text from a PDF's text layer.
Wired into both read_file and search_files' content search. Returns
a clear error for scanned/image-only PDFs with no text layer.
Automatically covers the Research Agents sub-agent tool loop too,
since it shares the same executeTool dispatcher.

Verified live: asked the AI to read a real PDF containing "The
secret code is PINEAPPLE-42." via read_file — it extracted the text
correctly through the MCP tool-call path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-25 11:44:27 +02:00
runeandClaude Sonnet 5 377e783a17 Mark Apple Intelligence provider as Beta throughout the UI
Apple's Foundation Models framework is still under active development
(built against macOS 27 beta) and likely to stay rough for a while —
small 4K context window, occasional generation errors, no tool
support yet. Surface that clearly wherever it appears:
- Model name: "Apple On-Device (Beta)" (shows in header/model picker)
- Model description: notes the beta status and what to expect
- Settings -> General: "⚠️ Beta — ..." disclaimer under the Apple
  Intelligence section, same style as the existing Paperless-NGX beta
  note
- Credits panel: same disclaimer for the Apple Intelligence entry

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 10:21:41 +02:00
runeandClaude Sonnet 5 30d0500323 Skip tool guidance, custom prompt, and Agent Skills for tool-incapable models
effectiveSystemPrompt now gates tool-usage guidelines, the user's
custom system prompt, and active Agent Skills behind whether the
selected model actually supports tools (ModelInfo.capabilities.tools).
All three assume tool/file/web access and can easily blow past small
context windows.

Confirmed live against Apple Intelligence: the default system prompt
dropped from 16,377 to ~250 tokens (well under the 4K on-device
limit), fully resolving the context-exceeded error from the initial
Phase 1 rollout. Verified end-to-end with a real successful generation
in the app after the fix.

Also: .gitignore now excludes *.profraw (stray code-coverage artifact
picked up while testing).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 10:12:39 +02:00
runeandClaude Sonnet 5 30fbb4162e Revive Apple Intelligence provider (Phase 1 — on-device)
Apple Intelligence / Foundation Models is now genuinely available on
this machine (macOS 27 beta 4) — it was reverted back in June
(f63226b) when it wasn't. Ports the reverted AppleFoundationProvider
forward onto 2.4.3, adapted for everything that's changed since:
PolyForm license headers, current AIProvider protocol shape, current
Settings.Provider/ProviderRegistry/CreditsView/SettingsView structure.

Fixes a real bug found via live testing: LanguageModelSession.
GenerationError was deprecated in macOS 27.0 in favor of a new
LanguageModelError type. On a macOS 27+ runtime, generation failures
now throw LanguageModelError, not GenerationError, so the original
error-mapping catch never matched and Apple's raw error text leaked
to the user instead of oAI's friendly message. Now dispatches to
whichever type the runtime actually throws, gated with
@available(macOS 27.0, *), keeping the old GenerationError path as
a fallback for macOS 26.x (the app's actual deployment target).

Confirmed end-to-end in the live app: provider selectable, Settings
shows a live "Available" badge, chat header shows correct branding,
and — a real, expected Phase 1 limitation — oAI's default system
prompt (active Agent Skills + MCP tool guidance, ~16K tokens on this
machine) exceeds the on-device model's 4K context window on the
very first message. The friendly error message now correctly reports
this instead of Apple's raw string. Tool calling remains out of scope
until Phase 3.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 09:46:17 +02:00
rune f3c6271c9e Phase 4 tests: DatabaseService migrations + ContextSelectionService DB paths
17 tests against throwaway in-memory DatabaseService instances: all
v1-v8 tables/columns exist post-migration, settings CRUD, conversation
save/load round-trip, instance isolation between separate in-memory
queues, and ContextSelectionService's DB-coupled paths (starring,
excluded-range summaries, smartSelection end to end) that were
previously untestable.
2026-07-24 09:16:46 +02:00
rune c6a7439648 Phase 4 seam: in-memory DatabaseService + DB injection for ContextSelectionService
DatabaseService gains a testable init(dbQueue:) plus a makeInMemory()
convenience and schema-introspection helpers (tableExists/columnNames),
so migration tests don't need the test target to import GRDB directly.
ContextSelectionService now takes an injected DatabaseService (defaults
to .shared) and its DB-coupled methods (smartSelection,
getSummariesForExcludedRange, isMessageStarred) are bumped to internal.
No logic changes to existing call sites.
2026-07-24 09:16:42 +02:00
rune 02bf73fec6 Actually commit the oAITests target wiring in project.pbxproj
The oAITests PBXNativeTarget (PBXContainerItemProxy, PBXTargetDependency,
XCBuildConfiguration with TEST_HOST/BUNDLE_LOADER, the "recommended
settings" changes accepted when the target was created -- DEAD_CODE_STRIPPING,
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, STRING_CATALOG_GENERATE_SYMBOLS,
DEVELOPMENT_TEAM moved to project-level inheritance) was somehow never
actually staged in the very first "Add real oAITests target" commit
(8c7fb59) despite every xcodebuild test run since then depending on it
being present on disk. Every subsequent commit this session only staged
specific file paths (never oAI.xcodeproj again), so the gap went
unnoticed until a full `git status` review here.

Without this, anyone else pulling the branch (or a truly clean checkout
on this machine) would have all the .swift test files but no target to
compile them into -- xcodebuild test would fail to find oAITests at all.
Confirmed the diff is exactly the expected target-wiring content, nothing
unrelated or corrupted, before committing.
2026-07-23 14:19:53 +02:00
rune a053d4a983 Phase 2: tests for the provider layer and other exposed pure helpers
66 new tests across 8 files (93 total in the suite now):

- GitSyncServiceTests: convertToSSH/injectCredentials/sanitizeFilename/
  detectSecretsInText, including a below-threshold false-positive check
  on the secret regex.
- ChatViewModelPureLogicTests: detectGoodbyePhrase, inferProvider,
  calculateCost -- including the cache-read (0.1x) / cache-write (1.25x)
  pricing multipliers, which is real billing-affecting logic.
- EmbeddingServiceTests / ContextSelectionServiceTests: embedding
  (de)serialization round-trip, importance-score weighting, and the
  token-estimate fallback (content.count / 4) when no real count exists.
- OpenRouterProviderTests / OllamaProviderTests / OpenAIProviderTests /
  AnthropicProviderTests: request-building (attachments, online mode,
  cache_control breakpoints, o1/o3 temperature omission, tool schema
  conversion) and response-parsing (text, tool_use blocks, empty-choices
  fallback behavior) for all four providers, with no network involved.

Also marks calculateCost/inferProvider/detectGoodbyePhrase (ChatViewModel)
and serializeEmbedding/deserializeEmbedding (EmbeddingService) as
`nonisolated` -- discovered via the actual test failures, not
speculation: the project's `SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor`
setting isolates the classes that carry an explicit `@MainActor`
(ChatViewModel), so calling their static members from a plain
synchronous @Test needs the pure ones marked `nonisolated`. Matches
the existing convention already used elsewhere in EmbeddingService
(cosineSimilarity was already nonisolated before this change).

Phase 2 of the test-suite rollout plan (peaceful-baking-kurzweil).
2026-07-23 14:11:50 +02:00
rune f39527b1d8 Phase 2 seam: expose pure helpers for testing (no logic changes)
Every change here is either dropping `private` (still invisible
outside the module, @testable import just needs internal-or-wider)
or converting a self-independent instance method to `static func`
(ChatViewModel.inferProvider/calculateCost/detectGoodbyePhrase --
none of the three ever touched `self`, and constructing a real
ChatViewModel triggers a real network call in init, so static-ifying
them sidesteps that entirely rather than fighting it). Call sites
updated to `Self.foo(...)` where the static conversion required it.

Touches: GitSyncService's URL/secret-scanning helpers,
EmbeddingService's embedding (de)serialization, ContextSelectionService's
importance scoring, and the request-building/response-parsing helpers
on all four providers (OpenRouter, Ollama, OpenAI, Anthropic) -- the
core AI request/response layer, previously 100% untested.

Verified: full existing test suite (27 tests) still green, no
regressions. Tests for these functions land in the next commit.
Phase 2 of the test-suite rollout plan (peaceful-baking-kurzweil).
2026-07-23 13:48:41 +02:00
rune 1f4a2caf67 Phase 1: pure-logic tests requiring zero production code changes
27 tests across 4 files, all targeting code that was already testable
the moment the target existed -- no visibility bumps, no refactors:

- GitignoreParserTests: MCPService.GitignoreParser's glob-to-regex
  matching (wildcards, **, directory anchors, negation, comments).
- OpenRouterModelsTests: the string-vs-content-block-array decoders
  on both the request side (APIMessage.MessageContent/ContentItem)
  and response side (Choice.MessageContent, StreamChoice.Delta),
  including image extraction from content blocks.
- AIProviderTests: ChatResponse/Usage decoding, with an explicit
  regression guard that Usage.rawCostUSD always decodes to nil (it's
  only ever set programmatically, never from API JSON).
- MessageCodableTests: confirms Message's transient fields
  (isStreaming, isStarred, generatedImages, toolCalls,
  thinkingContent) don't survive an encode/decode round-trip, and
  documents that its custom == deliberately ignores role/timestamp/
  attachments/modelId -- a real but non-obvious behavior worth
  locking in with a test.

Removed the placeholder oAITests.swift example test now that there's
real coverage. Phase 1 of the test-suite rollout plan
(peaceful-baking-kurzweil).
2026-07-23 13:37:49 +02:00
rune 8c7fb59d41 Add real oAITests target; remove disconnected SPM test scaffold
The old Tests/oAITests/oAITests.swift + root Package.swift/Sources/
were a swift package init stub that @testable imported a fake empty
oAI module, completely disconnected from the real ~31K-line app
(built only via oAI.xcodeproj). Running `swift test` there would
have silently "passed" while testing nothing.

oAITests is a proper Unit Testing Bundle target added via Xcode's
target editor, wired into the app's scheme (TestAction references
oAITests.xctest). Verified with `xcodebuild test` before and after
removing the dead scaffold.

First phase of the test-suite rollout plan (peaceful-baking-kurzweil).
2026-07-23 13:30:45 +02:00
rune 4fe3bde7e9 Merge 2.4.2 into 2.4.3 (bring in favorites sync, Contacts entitlement fix, Help search, DMG notarization, etc.) 2026-07-22 16:07:20 +02:00
rune 854fd02fad Add live search to the Help Book's table of contents
A search box above the Contents list filters TOC entries by each
linked section's full text content (not just the link title), so
e.g. searching "european" surfaces "Slash Commands" via its command
history date-format note. Pure vanilla JS/CSS, no dependencies --
the page is a static file opened directly in the default browser.

Tested interactively in Safari Technology Preview: filtering,
no-results state, reset, and click-through navigation all verified
working, in both the matched and empty-query cases.
2026-07-22 15:21:30 +02:00
rune e9aceca4e7 Remove now-dead isContactsHiddenPendingAppleFix kill switch
Contacts was never actually broken by an Apple/OS bug -- it was a
wrong entitlement key in oAI.entitlements, now fixed (abf25bd). No
functional change here: the flag was already false in both places
this session, so behavior is identical; this just removes the
now-pointless beta-badge/conditional-row scaffolding built around it.
2026-07-21 15:01:19 +02:00
rune abf25bd897 Fix Contacts TCC entitlement key: contacts -> addressbook
Confirmed root cause via tccd's own log output: the hardened-runtime
hardened-runtime prompting policy checks for
com.apple.security.personal-information.addressbook (the Contacts
framework's TCC service is still internally named kTCCServiceAddressBook,
a holdover from the old AddressBook framework), not
com.apple.security.personal-information.contacts as the entitlements
file had. With the correct key, tccd allows the prompt and access is
now granted correctly on both macOS 27 beta and 26.5.1 stable — this
was never an OS bug, notarization requirement, or beta-only issue.

Also keeps the fuller CNError domain/code/userInfo logging added while
diagnosing this, in case Contacts TCC issues resurface.
2026-07-21 14:59:39 +02:00
rune 77cc646ee0 Re-enable Contacts row to retest on macOS 27 beta 4
isContactsHiddenPendingAppleFix was flipped true on beta 2 after
CNContactStore.requestAccess returned instant "Access Denied" under
hardened runtime, while Calendar/Reminders/Location worked fine.
Rune just installed beta 4 and wants to retest.
2026-07-21 14:16:03 +02:00
rune 57f407ea50 Bump version to 2.4.2 2026-07-21 14:07:22 +02:00
rune 5db1b40552 Union favorites on tied timestamps instead of dropping one side
Two machines that already had favorites before this sync feature
shipped will both have an empty favoriteModelsUpdatedAt, so the
first sync between them ties. Previously that meant the second
machine silently kept only its own set; now tied timestamps merge
via union and re-push, so no pre-existing favorites are lost.
2026-07-21 14:06:05 +02:00
rune fc786d48f8 Sync starred models across machines; add automatic backup scheduling
Favorites now push/pull through a small oai_favorites.json file in the
same iCloud Drive folder used by Settings > Backup, reconciled by
last-write-wins timestamp on launch and app-become-active. Also adds
an Off/Daily/Weekly frequency picker so the full settings backup can
run itself (checked at launch and hourly) instead of requiring a
manual "Back Up Now" click every time.
2026-07-21 13:19:50 +02:00
rune 86027001c7 Roll back native Help Viewer integration; fix duplicate View menu
Per Rune: the NSHelpManager-based Cmd+? fix from the last few commits
technically worked (registration was correct) but opened Apple's
broken generic Tips landing page instead of oAI's own content on the
macOS 27 beta this is built against — worse than the original
browser-tab behavior. Revisit at macOS 27 RC1 (see CLAUDE.md).

- openHelp() reverts to NSWorkspace.open() on index.html directly.
- Removed the "In-App Help" Ctrl+Cmd+H menu item entirely — HelpView's
  panel (search already fully working) is reachable only via /help
  from the input field now, by design.
- Renamed the custom CommandMenu("View") to CommandMenu("Chat") — it
  was colliding with the "View" menu macOS auto-adds for
  NavigationSplitView (Enter Full Screen, etc.), producing two
  identically-titled top-level menus in the menu bar.
2026-07-20 08:17:33 +02:00
rune 98979584fb Fix dead Cmd+/ shortcut for In-App Help; rebind to Ctrl+Cmd+H
Cmd+/ was never reaching the "In-App Help" menu item — AppKit
auto-reserves Cmd+/ to open/focus the app's own Help menu (same
mechanism as Cmd+?), silently pre-empting any custom binding on that
combo, exactly like the earlier Cmd+H (Hide Application) conflict.

Verified live with computer-use before landing on Ctrl+Cmd+H:
Option+Cmd+/ has unpredictable menu-glyph rendering and didn't fire;
Option+Cmd+H is macOS's reserved "Hide Others" shortcut (visibly hid
other app windows when tested). Ctrl+Cmd+H showed no OS-level effect
and correctly opens the panel.

HelpView's search bar was already fully implemented and working —
this was purely a matter of the shortcut never reaching it.
2026-07-20 08:00:25 +02:00
rune 333e288418 Fix Help Book keys missing from the built Info.plist
GENERATE_INFOPLIST_FILE = YES with no INFOPLIST_FILE meant Xcode
synthesized Info.plist purely from INFOPLIST_KEY_* build settings and
silently ignored oAI/Info.plist on disk — so CFBundleHelpBookName/
CFBundleHelpBookFolder never made it into the built app. NSHelpManager
therefore couldn't resolve the book and macOS showed the generic Help
Center instead of oAI's help content (previous commit 74c8be8 fixed
openHelp() to call NSHelpManager, but that call had nothing to find).

Fix: point INFOPLIST_FILE at oAI/Info.plist so Xcode merges its extra
keys into the generated Info.plist, and add a synchronized-group
membership exception so Info.plist isn't also copied into Resources
(would otherwise produce a duplicate-file build warning).
2026-07-20 07:33:51 +02:00
rune 74c8be8f94 Fix Cmd+? opening Help Book in the default browser instead of Help Viewer
openHelp() always found the bundled oAI.help folder, so it always took
the NSWorkspace.open(index.html) branch — handing the page to the
default web browser. The NSHelpManager branch, which launches the
native Help Viewer (with its built-in full-text search), was
unreachable dead code. Now always routes through NSHelpManager.
2026-07-20 07:24:20 +02:00
rune 75e5b40f45 Persist sidebar visibility; add language-matching rule to default prompt
- ContentView now reads/writes SettingsService.sidebarVisible so the
  NavigationSplitView sidebar's shown/hidden state survives relaunch,
  matching the existing window size/position persistence.
- Default system prompt gains a rule: always reply in the user's
  language, even for requests (e.g. translation) targeting another one.
2026-07-19 16:01:04 +02:00
runeandClaude Sonnet 5 6d7f11d705 Clarify that only the latest release is supported for security fixes
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 09:07:39 +02:00
runeandClaude Sonnet 5 d38b5442ed Clarify that only the latest release is supported for security fixes
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 09:07:37 +02:00
runeandClaude Sonnet 5 e3fae25198 Add SECURITY.md with vulnerability reporting policy
Points reporters to the contact form at oai.pm instead of public issues.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 09:05:25 +02:00
runeandClaude Sonnet 5 b9c3c97dc0 Add SECURITY.md with vulnerability reporting policy
Points reporters to the contact form at oai.pm instead of public issues.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 09:05:18 +02:00
runeandClaude Sonnet 5 bd686873c4 Update commercial licensing contact URL to oai.pm
Consolidates the mac.oai.pm subdomain references (introduced in the
PolyForm Noncommercial relicense) to the root oai.pm domain, across
the LICENSE file, README, and all Swift source file headers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 11:33:53 +02:00
rune e0ab4041a2 Merge PolyForm Noncommercial relicense from 2.4.1 into main 2026-07-15 11:17:58 +02:00
runeandClaude Sonnet 5 cf3f4ebfe4 Relicense oAI from AGPL-3.0-or-later to PolyForm Noncommercial 1.0.0
Switches the project from AGPL to a source-available license that
restricts commercial use — selling oAI or any part of it, standalone
or bundled into another product/service, now requires a separate
commercial license from the copyright holder. Noncommercial use,
study, modification, and sharing remain fully permitted.

Updates: LICENSE (canonical PolyForm Noncommercial 1.0.0 text +
commercial licensing contact note), SPDX headers and file-header
boilerplate across all Swift source files, the in-app About dialog's
license link (+ its localization catalog entry), README.md and
DEVELOPMENT.md license sections.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 11:16:09 +02:00
rune 5031dceff8 Merge remote-tracking branch 'origin/main' into 2.4.1
# Conflicts:
#	oAI.xcodeproj/project.pbxproj
2026-07-14 11:00:16 +02:00
runeandClaude Sonnet 5 0cefef16e4 Change Command History shortcut from ⌘H to ⇧⌘H
⌘H is reserved by macOS for "Hide Application" and pre-empts app-level
menu bindings before they ever fire, so the Command History shortcut
never actually worked. Moved to ⇧⌘H and updated all references (in-app
help, macOS Help Book, README).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 10:46:53 +02:00
runeandClaude Sonnet 5 8cba92d768 Document External MCP Servers, Personal Data Tools, and Research Agents in Help
Adds three new Help sections covering the 2.4.1 features: connecting
external stdio MCP servers, Calendar/Reminders/Location access with
its approval flow, and parallel read-only research sub-agents. Also
notes French as a supported language and that OpenRouter's dedicated
image models are merged into the model picker automatically. Cleans
up a stray misplaced HTML comment above the Anytype section.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 10:33:50 +02:00
runeandClaude Sonnet 5 bfcdd0164c Fix assistant message text truncating with "…" instead of wrapping
Two contributing layout issues in the chat message bubble:

1. MessageRow's content VStack (icon + text HStack) had no
   .frame(maxWidth: .infinity), so it sized to its content's ideal
   width instead of the space actually available.

2. swift-markdown-ui renders paragraphs with mixed inline styling
   (bold/italic runs next to plain text) as concatenated Text(+)
   segments, which on macOS report their ideal unwrapped single-line
   size for height purposes instead of wrapping — truncating with "…"
   regardless of window width. Plain single-style paragraphs (a single
   Text) weren't affected, which is why some lines wrapped fine and
   others didn't.

Fixed by adding .frame(maxWidth: .infinity, alignment: .leading) to
the MessageRow content stack, and .fixedSize(horizontal: false,
vertical: true) to the markdown paragraph label so height is
recomputed for the width actually given instead of the ideal width.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 08:38:39 +02:00
runeandClaude Sonnet 5 7119cd1d06 Silence placeholder/continuing messages in the tool-call auto-retry path
The tool loop's max-iterations and empty-response fallbacks were showing
placeholder assistant bubbles ("[Tool loop reached maximum iterations]",
"[No response from the model — retrying]") followed by a "↩ Continuing…"
system message before silently re-running. None of that added anything
for the user, so the auto-continue now happens without any visible
message when there's no real content to show; genuine partial content
is still displayed as before, and usage/cost tracking is unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 08:05:07 +02:00
runeandClaude Sonnet 5 e6f965ff19 Add external MCP server support (stdio JSON-RPC)
Lets the AI connect to any external stdio MCP server (e.g. safaridriver
--mcp) configured in Settings, with tools auto-discovered and prefixed
by server slug. Includes crash detection with backoff restart (5s/15s/30s)
and a Settings UI to add/enable/disable/remove servers.

Fixes the temp-dir allowlist in MCPService.isPathAllowed to also match
/tmp and /private/tmp (not just NSTemporaryDirectory(), which resolves
to a different per-user Darwin temp dir) so the MCP file tools can
actually read files external servers and image generation write there.
Also switches the Add Server sheet's argument parsing to a quote-aware
tokenizer so args containing spaces survive intact.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 08:01:00 +02:00
runeandClaude Sonnet 4.6 f2949cea3b Add OpenRouter dedicated images API support
Fetches /api/v1/images/models in parallel with /models and merges results
into the model picker. Image-only models (e.g. Sourceful, Seedream, Flux
via this endpoint) were previously invisible since they don't appear in the
standard /models endpoint.

Models from the images API get usesImagesAPI=true and route through a new
generateImageAPIResponse() path in ChatViewModel that POSTs to /api/v1/images
with {model, prompt} instead of the chat completions endpoint. The response's
b64_json data is decoded and displayed via the existing GeneratedImagesView.

Cost is taken directly from the usage.cost field in the images API response
(USD per image) via a new rawCostUSD field on ChatResponse.Usage, bypassing
the token-based calculateCost() path used for chat models.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 14:34:56 +02:00
runeandClaude Sonnet 4.6 40c5f25517 Add personal data tools, 2nd Brain trust toggle, and research agents
Personal Data Tools: native Calendar, Reminders, Contacts (hidden pending
Apple TCC fix in beta), and Location & Maps access via EventKit, Contacts
framework, and MapKit. Write actions (create event/reminder, complete
reminder) gate through an approval sheet. Four hardened-runtime entitlements
added to oAI.entitlements; Info.plist usage strings added for all services.
Personal Data section shows a β badge while Contacts is hidden.

2nd Brain always-trust: inline toggle on the Agent Skills row for the skill
named "2nd Brain" skips the bash approval dialog when the command contains
.brain_helper.py, gated by three runtime checks in MCPService.

Research agents: spawn_research_agents tool runs up to 5 concurrent read-only
sub-agents (read_file, list_directory, search_files, web_search — no write,
no bash, no nesting). Bounded by maxConcurrentAgents setting (default 3) and
a hard ceiling of 8 tasks. Added items field to Tool.Function.Parameters.Property
for JSON Schema array support; wired into AnthropicProvider.convertParametersToDict.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 14:04:47 +02:00
runeandClaude Sonnet 4.6 454cef4193 Update AppLogo imageset
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 14:04:27 +02:00
rune 66c9054bd5 Update README with i18n disclosure and newly added features
Document Jarvis integration, Combine Conversations, model category
filter, sidebar navigation, prompt caching, and the 2nd Brain trust
toggle. Clarify that localization is AI/machine-translated rather than
reviewed by native speakers. Normalize all em-dashes to plain hyphens.
2026-06-22 11:14:34 +02:00
rune 56099c079c Fix accidental macOS 27 deployment target bump
MACOSX_DEPLOYMENT_TARGET was silently bumped 26.2 -> 27.0 in commit
8451db1, most likely by Xcode beta auto-updating it when the project
was opened/built with the macOS 27 beta SDK. This shipped in the public
v2.4 release, meaning the app refused to launch on anything older than
macOS 27 beta. No code in the project actually requires macOS 27 APIs.
2026-06-22 11:06:29 +02:00
runeandClaude Sonnet 4.6 20121981a0 Add French localization and catch up nb/sv/da/de translations
French (fr) added as a 5th supported language; full catalog translated.
Also caught up nb/sv/da/de for ~300 strings added since the last
localization pass (Jarvis, Anytype, model categories, reasoning effort,
Combine Conversations) plus Button/Toggle/Menu/CommandMenu titles and
custom sectionHeader/row helpers in Settings that were never extracted
by prior tooling, leaving Settings and the View menu English-only
regardless of locale.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 11:17:36 +02:00
runeandClaude Sonnet 4.6 5b99a6f81c Add Anthropic prompt caching (direct + via OpenRouter)
Caches the system prompt/tools and growing conversation history via
cache_control breakpoints, cutting cost and latency on repeated turns.
Covers both the regular chat path and the tool-calling loop
(chatWithToolMessages), which has its own request-building code and was
initially missed. Cost calculation now accounts for cache write/read
pricing instead of treating all input tokens as full price. Verified
live: cache reads grow turn-over-turn in oAI.log.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 12:43:32 +02:00
rune a793fdacc4 Changes... 2026-06-18 11:29:34 +02:00
runeandClaude Sonnet 4.6 414cf8cb8c Add missing AccentColor asset
Build settings referenced ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
= AccentColor but no such color set existed in Assets.xcassets, causing
a build warning. Added it using the app's existing blue accent (#0a7aca,
same as Color.oaiAccent) for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 11:59:11 +02:00
runeandClaude Sonnet 4.6 e7c7b9b5c6 Fix combined conversation's model to reflect sources, not the merge model
primaryModel was being set to the model that performed the merge (or,
in AI mode, stamped onto every synthesized message). It should instead
be the most recently used model among the source conversations being
combined.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 11:54:28 +02:00
runeandClaude Sonnet 4.6 87535dc2ad Ignore Xcode shared scheme data
Auto-generated by Xcode/xcodebuild when no shared scheme exists yet;
not meant to be tracked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 11:48:15 +02:00
runeandClaude Sonnet 4.6 3dff8a8c8e Add combine saved conversations feature (simple + AI-assisted merge)
Lets users multi-select 2+ saved conversations and merge them into one,
either by chronological concatenation or by having the default model
synthesize a single coherent conversation from the source transcripts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 11:45:56 +02:00
rune 00dccd648c README.md edits 2026-06-17 11:00:55 +02:00
runeandClaude Sonnet 4.6 92e393ab03 Fix Swift 6 actor-isolation warnings in model inits and services
- Message, Conversation, EmailLog: add nonisolated to inits — plain value
  types have no actor isolation, but the macOS 27 SDK was inferring it
- EncryptionService: replace lazy var encryptionKey (which mutates self and
  gets inferred as @MainActor) with an eagerly-initialized let in init()
- FileLogger: add nonisolated to shared, write, and minimumLevel so they
  are callable from nonisolated AppLogger methods without warnings
- LogLevel.<: add nonisolated to the Comparable conformance method

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 14:59:07 +02:00
runeandClaude Sonnet 4.6 22f745762f Move conversation name to header (macOS document-title style)
The save indicator was sitting in the bottom-right corner of the footer.
Moved it to the center of the header bar, where macOS apps conventionally
show the document/conversation title. An orange dot appears when there are
unsaved changes; clicking saves. Removed the indicator from the footer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 14:44:32 +02:00
runeandClaude Sonnet 4.6 b3bb7c4a59 Fix Enter key semantics and add expandable model descriptions
- Replace TextEditor with NativeTextEditor (NSViewRepresentable) so plain
  Enter sends the message and Shift/Cmd+Enter inserts a newline. The old
  TextEditor passed bare Return directly to NSTextView before SwiftUI's
  onKeyPress could intercept it, accidentally making Cmd+Enter send instead.
- Add More…/Less toggle in ModelInfoView for descriptions longer than 250
  characters, with smooth expand/collapse animation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 14:39:53 +02:00
runeandClaude Sonnet 4.6 ef1c05c13b Add Claude Fable 5 pricing ($10/$50 per 1M tokens)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 11:56:05 +02:00
rune f63226b2cc Revert "Add Apple Intelligence provider (Phase 1 — on-device)"
This reverts commit f3a0c45331.
2026-06-16 11:42:51 +02:00
runeandClaude Sonnet 4.6 f3a0c45331 Add Apple Intelligence provider (Phase 1 — on-device)
- New AppleFoundationProvider using FoundationModels framework (macOS 27+)
- Streaming via streamResponse(to:) → ResponseStream<String> snapshot deltas
- Session built with system prompt + conversation history injected as instructions text
- Full error mapping: context exceeded, guardrail violation, rate limit, availability states
- Settings.Provider.appleOnDevice case wired through ProviderRegistry, Color+Extensions, CreditsView
- inferProvider() detects "apple-" prefix model IDs
- Settings → General: Apple Intelligence section with live availability badge and deep link to System Settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 11:36:55 +02:00
runeandClaude Sonnet 4.6 8451db1142 UI redesign Phase 1: NavigationSplitView with collapsible sidebar
- Replace root VStack with NavigationSplitView (2-column, collapsible sidebar)
- Add SidebarView: new chat button, conversation search, list with swipe actions
- Slim HeaderView to text-only (provider + model + star); remove all icon rows
- Move status pills (Online, MCP, Synced) to footer right side
- Remove version number and shortcut hints from footer
- Add resizable InputBar with drag handle (persisted height) and globe/network.slash online toggle
- Fix Norwegian menu appearing on English systems (CFBundleLocalizations in Info.plist)
- Add View menu (Model Info, History, Stats, Credits, Online Mode toggle ⌘⇧O)
- Add ⌘L as alias for Search Conversations (muscle memory for /load users)
- Add Check for Updates to Help menu with download URL from Gitea API
- Add one-time Intel/Rosetta deprecation warning on first launch
- Swift 6: fix self.Self.isoString() call sites in DatabaseService

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 11:18:48 +02:00
runeandClaude Sonnet 4.6 13699864d8 New release v2.3.9
- Jarvis integration: manage oAI-Web agents and usage from inside the app (/jarvis command, Settings tab 11)
- Model category filter: keyword-based categorisation with popover picker in model selector
- Categories shown in ModelInfoView with coloured chips; dot indicators on model rows

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 11:05:47 +02:00
rune c2010e272e Updated README.md 2026-04-15 09:00:40 +02:00
rune 3d6ac578db Update README.md 2026-04-15 07:24:48 +02:00
rune 3f9b30bfa1 New release v2.3.8 2026-03-05 13:17:53 +01:00