Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat: call a bot's skills with "/" and turn on analytics by default
leepokaia1322bf42453
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.ymlindex d4a4afdd..f25c5475 100644--- a/.github/workflows/release-desktop.yml+++ b/.github/workflows/release-desktop.yml@@ -83,7 +83,6 @@ jobs:cp "$(swift build -c release --arch arm64 --arch x86_64 --package-path apps/desktop/native/speech-macos --show-bin-path)/codync-speech" \apps/desktop/build/native/codync-speech# Codync Screen is built by `npm run dist:mac:main` (tools/native-screen.mjs).- xcodebuild -downloadComponent MetalToolchain || truecommand -v xcodegen >/dev/null || brew install xcodegenxcodegen generate --spec apps/project.ymlswift packaging/dmg/background.swift apps/desktop/build/dmg-background.tiff@@ -243,7 +242,6 @@ jobs:cache: npmcache-dependency-path: apps/desktop/package-lock.json# The Linux app uses the installed codync-host (codync-host-linux-*.tar.gz, host.yml).- - run: sudo apt-get update && sudo apt-get install -y rpm- name: Buildworking-directory: apps/desktoprun: |diff --git a/AGENTS.md b/AGENTS.mdindex e754b068..84deb97d 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -24,10 +24,14 @@ Run from the repository root unless a command changes directories:## Installing a new build: kill the old one first-Always stop the old desktop app, host and iPhone process for the variant being rebuilt before running a new build (old host = old protocol, old app = old UI); commands in [docs/guides/development.md](docs/guides/development.md#apple-apps).+Always stop the old desktop app, host and iPhone process for the variant being rebuilt before running a new build (old host = old protocol, old app = old UI); commands in [development: desktop app](docs/guides/development.md#desktop-app) and [iOS app](docs/guides/development.md#ios-app).Keep only the latest build: in this checkout, Apple builds go to `build/dd` only (no other `-derivedDataPath`, no copies in scratchpads, `/tmp` or Xcode's DerivedData); delete any older Codync build right away, so macOS never launches a stale copy. A git worktree may keep its own single build inside that worktree.+## End-to-end test every change++After every change, test it end to end on the real apps, not just builds and unit tests: install the new build (old one stopped first) and walk through the changed flow. Drive the desktop app with Computer Use, and the iPhone app on an iOS Simulator through Device Hub (Xcode's `DeviceHub.app`). Report any check that could not run and why.+## Versioning & releases- **Every source change ships as a release.** A version bump on `main` is the only release trigger (Auto Tag → desktop app for macOS, Linux and Windows, host, Homebrew, in-app update), so any change to shipped code (`apps/`, `host/`, `packaging/`) bumps the version before it reaches `main`, without being asked. Docs, `web/`, `cloud/`, `relay/` and CI-only changes don't bump.diff --git a/CLAUDE.md b/CLAUDE.mdindex fa8c8f08..ed6ba1f4 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -33,7 +33,7 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess- Environments: `iOS Dev` / desktop `dist:*:dev` use the isolated Codync Dev app; `iOS` / `dist:*:main` retain production identities. Stop only the variant being rebuilt. Resource map, signing and diagnostics: [Dev app isolation](docs/guides/dev-app.md).- Push: iOS registers its APNs token with `relay/` → gets an AES-GCM ticket → gives it (plus its X25519 push key) to the host; the host seals title/body to that key and a Notification Service Extension opens it, so `relay/` sees only generic text. Alert kinds: *needs you*, *done*, and *failed*, suppressed while the iOS app is connected. Delivery and lifecycle: [notification design](docs/design/push-and-live-activity.md).- Voice call (iPhone, desktop): on-device speech (macOS desktop: the `codync-speech` helper), or OpenAI / Gemini realtime on the user's own key (kept in the host's vault, which mints per-call credentials; audio goes device ↔ provider); the host sees plain messages. Grok-style call bar: [docs/features/voice-call.md](docs/features/voice-call.md).-- Analytics: opt-in PostHog, asked once per device, feature use only (never content); host events come from `api::dispatch`: [docs/features/analytics.md](docs/features/analytics.md).+- Analytics: PostHog, on by default (off in each device's Settings), feature use only (never content); host events come from `api::dispatch`: [docs/features/analytics.md](docs/features/analytics.md).- Usage: local only — `claude -p /usage --no-session-persistence`, the Claude status line (`codync-host statusline`, wrapping any existing one), Claude ACP `usage_update` rate-limit meta, Codex rollout files. Never call provider APIs with agent credentials.- The desktop app is thin: the Mac build bundles `codync-host` in `Contents/Resources` (Linux uses the installed host) and installs it as a launchd/systemd agent via `codync-host install`; the menu bar/tray shows status/pairing/usage and opens the chat window. Not sandboxed, not Mac App Store (the host must spawn CLIs).@@ -53,10 +53,14 @@ Bot-based remote for coding agents: persistent named bots on your computer, mess## Installing a new build: kill the old one first-Always stop the old desktop app, host and iPhone process before running a new build (old host = old protocol, old app = old UI); commands in [docs/guides/development.md](docs/guides/development.md#apple-apps).+Always stop the old desktop app, host and iPhone process before running a new build (old host = old protocol, old app = old UI); commands in [development: desktop app](docs/guides/development.md#desktop-app) and [iOS app](docs/guides/development.md#ios-app).Keep only the latest build: in this checkout, Apple builds go to `build/dd` only (no other `-derivedDataPath`, no copies in scratchpads, `/tmp` or Xcode's DerivedData); delete any older Codync build right away, so macOS never launches a stale copy. A git worktree may keep its own single build inside that worktree.+## End-to-end test every change++After every change, test it end to end on the real apps, not just builds and unit tests: install the new build (old one stopped first) and walk through the changed flow. Drive the desktop app with Computer Use, and the iPhone app on an iOS Simulator through Device Hub (Xcode's `DeviceHub.app`). Report any check that could not run and why.+## Project generation- `apps/project.yml` + `xcodegen generate --spec apps/project.yml` produce `apps/Codync.xcodeproj`. Edit `project.yml`, not the pbxproj.diff --git a/apps/Codync.xcodeproj/project.pbxproj b/apps/Codync.xcodeproj/project.pbxprojindex 73785ef7..b2bc8856 100644--- a/apps/Codync.xcodeproj/project.pbxproj+++ b/apps/Codync.xcodeproj/project.pbxproj@@ -780,7 +780,7 @@GCC_WARN_UNUSED_VARIABLE = YES;IPHONEOS_DEPLOYMENT_TARGET = 18.0;MACOSX_DEPLOYMENT_TARGET = 14.0;- MARKETING_VERSION = 2.14.0;+ MARKETING_VERSION = 2.14.1;MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;MTL_FAST_MATH = YES;ONLY_ACTIVE_ARCH = YES;@@ -878,7 +878,7 @@GCC_WARN_UNUSED_VARIABLE = YES;IPHONEOS_DEPLOYMENT_TARGET = 18.0;MACOSX_DEPLOYMENT_TARGET = 14.0;- MARKETING_VERSION = 2.14.0;+ MARKETING_VERSION = 2.14.1;MTL_ENABLE_DEBUG_INFO = NO;MTL_FAST_MATH = YES;PRODUCT_NAME = "$(TARGET_NAME)";@@ -1137,7 +1137,7 @@GCC_WARN_UNUSED_VARIABLE = YES;IPHONEOS_DEPLOYMENT_TARGET = 18.0;MACOSX_DEPLOYMENT_TARGET = 14.0;- MARKETING_VERSION = 2.14.0;+ MARKETING_VERSION = 2.14.1;MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;MTL_FAST_MATH = YES;ONLY_ACTIVE_ARCH = YES;@@ -1287,7 +1287,7 @@GCC_WARN_UNUSED_VARIABLE = YES;IPHONEOS_DEPLOYMENT_TARGET = 18.0;MACOSX_DEPLOYMENT_TARGET = 14.0;- MARKETING_VERSION = 2.14.0;+ MARKETING_VERSION = 2.14.1;MTL_ENABLE_DEBUG_INFO = NO;MTL_FAST_MATH = YES;PRODUCT_NAME = "$(TARGET_NAME)";diff --git a/apps/desktop/electron.vite.config.ts b/apps/desktop/electron.vite.config.tsindex d17efd58..7a10d931 100644--- a/apps/desktop/electron.vite.config.ts+++ b/apps/desktop/electron.vite.config.ts@@ -1,7 +1,7 @@import { execFileSync } from 'node:child_process'import { resolve } from 'node:path'import react from '@vitejs/plugin-react'-import { defineConfig, externalizeDepsPlugin } from 'electron-vite'+import { defineConfig } from 'electron-vite'// Fresh macOS checkouts must include SF Symbols without a separate manual icons step.if (process.platform === 'darwin') {@@ -9,8 +9,8 @@ if (process.platform === 'darwin') {}export default defineConfig({- main: { plugins: [externalizeDepsPlugin()] },- preload: { plugins: [externalizeDepsPlugin()] },+ main: {},+ preload: {},renderer: {resolve: { alias: { '@shared': resolve('src/shared') } },plugins: [react()],diff --git a/apps/desktop/package-lock.json b/apps/desktop/package-lock.jsonindex db77cca5..596507a1 100644--- a/apps/desktop/package-lock.json+++ b/apps/desktop/package-lock.json@@ -1,13 +1,13 @@{"name": "codync-desktop",- "version": "2.14.0",+ "version": "2.14.1","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "codync-desktop",- "version": "2.14.0",- "license": "UNLICENSED",+ "version": "2.14.1",+ "license": "Apache-2.0","dependencies": {"electron-updater": "^6.8.9"},diff --git a/apps/desktop/package.json b/apps/desktop/package.jsonindex 52154da5..c85bdcb5 100644--- a/apps/desktop/package.json+++ b/apps/desktop/package.json@@ -1,14 +1,14 @@{"name": "codync-desktop","productName": "Codync",- "version": "2.14.0",+ "version": "2.14.1","description": "Codync for macOS, Linux and Windows: your coding agents as teammates.","author": {"name": "leepokai","email": "[email protected]"},"homepage": "https://www.codync.dev",- "license": "UNLICENSED",+ "license": "Apache-2.0","private": true,"main": "out/main/index.js","scripts": {diff --git a/apps/desktop/src/main/auth.ts b/apps/desktop/src/main/auth.tsindex f77593a1..9eb23eeb 100644--- a/apps/desktop/src/main/auth.ts+++ b/apps/desktop/src/main/auth.ts@@ -2,7 +2,7 @@ import { app, ipcMain, shell } from 'electron'import { identity } from './environment'// Browser sign-ins that come back to this app on a custom scheme (ASWebAuthenticationSession's-// job on the native apps): connector OAuth (`codync://oauth`) and the account (`com.pokai.Codync://callback`).+// job on the iPhone): connector OAuth (`codync://oauth`) and the account (`com.pokai.Codync://callback`).export const SCHEMES = [identity.scheme, identity.appId]diff --git a/apps/desktop/src/main/cloud.ts b/apps/desktop/src/main/cloud.tsindex 30a60402..a6459c72 100644--- a/apps/desktop/src/main/cloud.ts+++ b/apps/desktop/src/main/cloud.ts@@ -94,5 +94,4 @@ export function registerCloud(account: AccountService) {return { ok: false, error: { status: 0, code: 'unreachable', message: "Can't reach the Codync cloud. Check your connection." } }}})- ipcMain.handle('cloud:deviceKey', async () => (account.state.user ? (await identity(account.state.user.userId)).publicKey : null))}diff --git a/apps/desktop/src/main/host-controller.ts b/apps/desktop/src/main/host-controller.tsindex 8c9765e3..68bb4a13 100644--- a/apps/desktop/src/main/host-controller.ts+++ b/apps/desktop/src/main/host-controller.ts@@ -72,8 +72,8 @@ function serviceDefinition(): string | null {const serviceInstalled = () => serviceDefinition() !== null/**- * Manages the local codync-host (binary, background service, health) the way the native- * apps did: bundled next to the app, else a Homebrew / cargo install.+ * Manages the local codync-host (binary, background service, health): bundled with the app,+ * else a Homebrew / cargo install.*/export class HostController extends EventEmitter {state: HostState = { kind: 'starting' }diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.tsindex 445562e2..c43a3e12 100644--- a/apps/desktop/src/main/index.ts+++ b/apps/desktop/src/main/index.ts@@ -4,7 +4,7 @@ import { hostname } from 'node:os'import { join } from 'node:path'import { app, autoUpdater, BrowserWindow, clipboard, dialog, ipcMain, Menu, nativeTheme, session, shell } from 'electron'import type { HostSnapshot, WindowCommand } from '../shared/ipc'-import { devPort, fetchHealth, HostController } from './host-controller'+import { devPort, HostController } from './host-controller'import { registerFileSaves } from './file-saves'import { registerHostProxy } from './host-proxy'import { readClipboardFiles, readFiles } from './files'@@ -145,11 +145,8 @@ function registerIPC(tray: Tray) {ipcMain.on('app:computerName', (e) => (e.returnValue = computerName()))ipcMain.on('app:debugOpen', (e) => (e.returnValue = app.isPackaged ? null : (process.env.CODYNC_DEBUG_OPEN ?? null)))ipcMain.handle('host:snapshot', () => snapshot())- ipcMain.handle('host:health', (_e, url: string) => fetchHealth(url))ipcMain.on('host:install', () => void host.install())ipcMain.on('host:restart', () => host.restart())- ipcMain.on('host:uninstall', () => void host.uninstall())- ipcMain.on('host:openLog', () => void shell.openPath(host.logPath))ipcMain.on('app:openExternal', (_e, url: string) => {if (/^(https?|mailto|x-apple\.systempreferences):/.test(url)) void shell.openExternal(url)})@@ -166,8 +163,6 @@ function registerIPC(tray: Tray) {})ipcMain.handle('app:clipboardFiles', () => readClipboardFiles())ipcMain.on('app:traySummary', (_e, summary) => tray.update(summary))- ipcMain.on('app:openPairing', () => openPairing())- ipcMain.on('app:quit', () => app.quit())ipcMain.handle('app:showInDock', () => showInDock())ipcMain.handle('app:setShowInDock', (_e, on: boolean) => {const visible = setShowInDock(on)diff --git a/apps/desktop/src/main/ssh-command.ts b/apps/desktop/src/main/ssh-command.tsindex 9f9c36ab..77d01d9e 100644--- a/apps/desktop/src/main/ssh-command.ts+++ b/apps/desktop/src/main/ssh-command.ts@@ -1,8 +1,7 @@import type { SSHProfile } from '../shared/ssh.ts'-// Preserve the login shell's PATH, then try the supported installers and Mac app layouts.-// Resources is the Electron bundle; MacOS keeps older native app installs reachable.-const REMOTE_PATH = '$PATH:/opt/homebrew/bin:/usr/local/bin:/home/linuxbrew/.linuxbrew/bin:$HOME/.local/bin:/Applications/Codync.app/Contents/Resources:/Applications/Codync.app/Contents/MacOS'+// Preserve the login shell's PATH, then try the supported installers and the Mac app bundle.+const REMOTE_PATH = '$PATH:/opt/homebrew/bin:/usr/local/bin:/home/linuxbrew/.linuxbrew/bin:$HOME/.local/bin:/Applications/Codync.app/Contents/Resources'/** The caller validates the port before constructing the remote shell command. */export const remoteInfoCommand = (port: number, folder = '.codync') => {diff --git a/apps/desktop/src/main/ssh.ts b/apps/desktop/src/main/ssh.tsindex 384c3cd1..7d5927c4 100644--- a/apps/desktop/src/main/ssh.ts+++ b/apps/desktop/src/main/ssh.ts@@ -9,7 +9,7 @@ import { app, dialog, ipcMain, type BrowserWindow } from 'electron'import type { SSHAttachment, SSHProfile, SSHState, SSHStatus } from '../shared/ssh'import { infoArguments, knownHostsFiles, resolveArguments, tunnelArguments } from './ssh-command'-// SSH computers (port of the Mac app's SSHTunnel.swift): profiles, host key checks and one+// SSH computers: profiles, host key checks and one// OpenSSH tunnel per connected profile. Arguments are always an argv array, never a shell string.const SSH = '/usr/bin/ssh'diff --git a/apps/desktop/src/main/tray.ts b/apps/desktop/src/main/tray.tsindex 25d16cfd..e31287a9 100644--- a/apps/desktop/src/main/tray.ts+++ b/apps/desktop/src/main/tray.ts@@ -156,7 +156,7 @@ export class Tray {const { updates } = this.depsconst u = updates.stateconst items: Electron.MenuItemConstructorOptions[] = [- { label: u.availableVersion ? `Update to ${u.availableVersion}…` : 'Check for Updates…', enabled: u.canCheck || u.staged, click: () => updates.check() },+ { label: u.availableVersion ? `Update to ${u.availableVersion}…` : 'Check for Updates…', enabled: u.supported || u.staged, click: () => updates.check() },]// The release waits until paired iPhones can get the app it needs.if (u.waitingForApp) items.push({ label: `Waiting for iPhone app ${u.waitingForApp} to pass App Store review`, enabled: false })diff --git a/apps/desktop/src/main/updates.ts b/apps/desktop/src/main/updates.tsindex 9953c900..6d9a7fd4 100644--- a/apps/desktop/src/main/updates.ts+++ b/apps/desktop/src/main/updates.ts@@ -19,7 +19,6 @@ const enabled = app.isPackaged && isMainEnvironment()export class Updates extends EventEmitter {state: UpdateState = {supported: enabled,- canCheck: enabled,checking: false,availableVersion: null,staged: false,diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.tsindex 0fb9f3b9..ff212591 100644--- a/apps/desktop/src/preload/index.ts+++ b/apps/desktop/src/preload/index.ts@@ -31,8 +31,6 @@ const bridge: CodyncBridge = {onChange: (cb) => listen('host:change', cb),install: () => ipcRenderer.send('host:install'),restart: () => ipcRenderer.send('host:restart'),- uninstall: () => ipcRenderer.send('host:uninstall'),- openLog: () => ipcRenderer.send('host:openLog'),async call(baseURL, token, method, body, timeoutMs) {const result = (await ipcRenderer.invoke('host:call', baseURL, token, method, body, timeoutMs)) as| { ok: true; value: unknown }@@ -49,7 +47,6 @@ const bridge: CodyncBridge = {ipcRenderer.send('host:stream:close', id)}},- health: (baseURL) => ipcRenderer.invoke('host:health', baseURL),},account: {state: () => ipcRenderer.invoke('account:state'),@@ -89,8 +86,6 @@ const bridge: CodyncBridge = {readClipboardFiles: () => ipcRenderer.invoke('app:clipboardFiles'),setTraySummary: (summary: TraySummary) => ipcRenderer.send('app:traySummary', summary),onCommand: (cb: (c: WindowCommand) => void) => listen('app:command', cb),- openPairing: () => ipcRenderer.send('app:openPairing'),- quit: () => ipcRenderer.send('app:quit'),resetAllData: () => ipcRenderer.invoke('app:resetAllData'),setLaunchAtLogin: (on) => ipcRenderer.invoke('app:setLaunchAtLogin', on),showInDock: () => ipcRenderer.invoke('app:showInDock'),diff --git a/apps/desktop/src/renderer/components/overlay.css b/apps/desktop/src/renderer/components/overlay.cssindex 9979efb0..44d80369 100644--- a/apps/desktop/src/renderer/components/overlay.css+++ b/apps/desktop/src/renderer/components/overlay.css@@ -32,6 +32,12 @@opacity: 1;transform: none;}+/* A layer fading away stays mounted until its exit timer fires (late in a background window):+ it must never take the clicks meant for what's under it. */+.modal-card:not(.shown),+.dialog:not(.shown) {+ pointer-events: none;+}.modal-header {display: flex;@@ -229,7 +235,7 @@opacity: 0.35;}-/* SwiftUI centers modals below the hidden title bar (28 pt on macOS). */+/* Modals center below the hidden title bar (28 pt on macOS). */html[data-platform="darwin"] .modal-card,html[data-platform="darwin"] .dialog {padding-top: 28px;diff --git a/apps/desktop/src/renderer/demo/bridge.ts b/apps/desktop/src/renderer/demo/bridge.tsindex 7529b231..184a2615 100644--- a/apps/desktop/src/renderer/demo/bridge.ts+++ b/apps/desktop/src/renderer/demo/bridge.ts@@ -18,7 +18,7 @@ const snapshot: HostSnapshot = {}const account: AccountState = { ready: true, configured: false, busy: false, error: null, user: null, cloudURL: null }const updates: UpdateState = {- supported: false, canCheck: false, checking: false, availableVersion: null, staged: false,+ supported: false, checking: false, availableVersion: null, staged: false,autoCheck: false, autoDownload: false, lastCheck: null, error: null, waitingForApp: null,}@@ -36,8 +36,6 @@ const bridge: CodyncBridge = {onChange: none,install() {},restart() {},- uninstall() {},- openLog() {},async call(_baseURL, _token, method, body) {await new Promise((r) => setTimeout(r, 30))try {@@ -50,7 +48,6 @@ const bridge: CodyncBridge = {const since = Number(new URL(url).searchParams.get('since') ?? 0)return host.subscribe(since, onData)},- health: async () => ({ computerId: COMPUTER_ID, busy: false }),},account: {state: async () => account,@@ -80,8 +77,6 @@ const bridge: CodyncBridge = {readClipboardFiles: async () => [],setTraySummary() {},onCommand: none,- openPairing() {},- quit() {},resetAllData: async () => {},setLaunchAtLogin: async () => false,showInDock: async () => true,diff --git a/apps/desktop/src/renderer/demo/fake-host.ts b/apps/desktop/src/renderer/demo/fake-host.tsindex 75479dc1..fa2e7b7c 100644--- a/apps/desktop/src/renderer/demo/fake-host.ts+++ b/apps/desktop/src/renderer/demo/fake-host.ts@@ -20,7 +20,7 @@ export class FakeHost {private turns = new Map<string, number>()private nextReply = new Map<string, number>()/** Already chosen, so the demo never asks for consent. */- private analytics = false+ private analytics = trueconstructor(readonly version: string,diff --git a/apps/desktop/src/renderer/store/app-model.ts b/apps/desktop/src/renderer/store/app-model.tsindex 086e7781..b934ce35 100644--- a/apps/desktop/src/renderer/store/app-model.ts+++ b/apps/desktop/src/renderer/store/app-model.ts@@ -37,8 +37,7 @@ export interface Approval {/*** The window's model: this computer's own host (from the main process), one `BotStore` per- * computer, the selection, and what the menu bar shows. Ports the Mac app's `HostController`- * (renderer side) and kit's `AccountStore`.+ * computer, the selection, and what the menu bar shows. Mirrors kit's `AccountStore`.*/export class AppModel extends Observable {host: HostSnapshot = { state: { kind: 'starting' }, local: null, dev: false, logPath: '' }diff --git a/apps/desktop/src/renderer/store/bot-mirror.ts b/apps/desktop/src/renderer/store/bot-mirror.tsindex c7885043..267adb2c 100644--- a/apps/desktop/src/renderer/store/bot-mirror.ts+++ b/apps/desktop/src/renderer/store/bot-mirror.ts@@ -63,7 +63,6 @@ export class BotMirror extends Observable {computer: Computer,readonly isLoopback: boolean,protected makeTransport: () => HostTransport,- protected clientKind = 'mac',protected appVersion = window.codync.appVersion,readonly contextId = 'local',) {diff --git a/apps/desktop/src/renderer/store/bot-store.ts b/apps/desktop/src/renderer/store/bot-store.tsindex cf3ccfad..0d02cf98 100644--- a/apps/desktop/src/renderer/store/bot-store.ts+++ b/apps/desktop/src/renderer/store/bot-store.ts@@ -94,10 +94,6 @@ export class BotStore extends BotSync {this.scheduleSave()}- cancelQueued(_entry: Entry) {- // Loopback never queues in a relay mailbox.- }-private markLocal(nonce: string, botId: string, status: string) {const list = this.entries.get(botId)const i = list?.findIndex((e) => e.id === `local-${nonce}`) ?? -1@@ -149,7 +145,7 @@ export class BotStore extends BotSync {this.changed()}- /** Product analytics consent: null until the owner chose, undefined before hello or on older hosts. */+ /** Product analytics on this computer; undefined before hello. */get analytics() {return this.hello?.analytics}diff --git a/apps/desktop/src/renderer/store/bot-sync.ts b/apps/desktop/src/renderer/store/bot-sync.tsindex a04320a5..1ea493de 100644--- a/apps/desktop/src/renderer/store/bot-sync.ts+++ b/apps/desktop/src/renderer/store/bot-sync.ts@@ -133,7 +133,7 @@ export class BotSync extends BotMirror {this.floors = new Map()this.closeEvents = client.events(this.requestedSince,- this.clientKind,+ 'desktop',(event) => {if (!alive()) returnthis.setConnection({ kind: 'online' })diff --git a/apps/desktop/src/renderer/store/cloud.ts b/apps/desktop/src/renderer/store/cloud.tsindex 450a080f..d990b041 100644--- a/apps/desktop/src/renderer/store/cloud.ts+++ b/apps/desktop/src/renderer/store/cloud.ts@@ -75,8 +75,7 @@ const claimedComputerIds = pref<string[]>('claimedComputerIds', [])const keptOut = (userId: string) => pref<string[]>(`keptOutOfAccount.${userId}`, [])/**- * The signed-in account's side of this computer (ports of the Mac `HostController` account code- * and kit `CloudClient`): registering this device, the account's computers, claiming this+ * The signed-in account's side of this computer (mirrors kit's `CloudClient`): registering this device, the account's computers, claiming this* computer's host, and turning its cloud on by default.*/export class CloudModel extends Observable {diff --git a/apps/desktop/src/renderer/views/AnalyticsPrompt.tsx b/apps/desktop/src/renderer/views/AnalyticsPrompt.tsxdeleted file mode 100644index 15959733..00000000--- a/apps/desktop/src/renderer/views/AnalyticsPrompt.tsx+++ /dev/null@@ -1,66 +0,0 @@-import { useState } from 'react'-import { Button } from '../components/Controls'-import { Icon } from '../components/Icon'-import { ModalHeader, Sheet } from '../components/Overlay'-import { font } from '../lib/fonts'-import { useModel } from '../lib/observable'-import { prefs, usePref } from '../lib/prefs'-import { useApp } from '../store/context'-import { errorText } from './settings/parts'--const device = window.codync.platform === 'darwin' ? 'Mac' : 'computer'-/** What the answer covers; same points as the iPhone's and the terminal's question. */-const points: [icon: string, text: string][] = [- ['eye.slash', 'Never your messages, code, files, prompts or bot names'],- ['lock.shield', "Never sold or used for ads. Linked to your Codync account when you're signed in"],- ['gearshape', 'Turn it off anytime in Settings'],-]-/**- * Asks this computer's owner once whether to share product analytics: after the welcome screen,- * or on the first launch after updating. Closing without choosing asks again next launch.- */-export function AnalyticsPrompt() {- const app = useApp()- const local = useModel(app.local)- const [onboarded] = usePref(prefs.onboardingDone)- const [closed, setClosed] = useState(false)- const open = onboarded && !closed && local !== null && local.connection.kind === 'online' && local.analytics === null-- const choose = async (share: boolean) => {- setClosed(true)- if (!local) return- try {- await local.setAnalytics(share)- } catch (e) {- app.setError(errorText(e))- }- }-- return (- <Sheet open={open} onClose={() => setClosed(true)}>- <div style={{ width: 420, display: 'flex', flexDirection: 'column' }}>- <ModalHeader title="Help improve Codync" />- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16, padding: '0 24px 24px' }}>- <Icon name="chart.bar" size={36} weight="light" color="var(--secondary)" />- <div style={{ ...font('callout'), color: 'var(--secondary)', textAlign: 'center' }}>- Codync can record which features you use on this {device}, like creating a bot or sending a message.- </div>- <div style={{ alignSelf: 'stretch', display: 'flex', flexDirection: 'column', gap: 10, padding: 14, borderRadius: 16, background: 'var(--surface)' }}>- {points.map(([icon, text]) => (- <div key={icon} style={{ display: 'flex', alignItems: 'center', gap: 10 }}>- <Icon name={icon} size={13} color="var(--tertiary)" style={{ width: 18, flexShrink: 0 }} />- <div style={{ ...font('callout'), color: 'var(--secondary)' }}>{text}</div>- </div>- ))}- </div>- <div style={{ display: 'flex', gap: 12 }}>- <Button kind="secondary" onClick={() => void choose(false)}>- Don't share- </Button>- <Button onClick={() => void choose(true)}>Share usage</Button>- </div>- </div>- </div>- </Sheet>- )-}diff --git a/apps/desktop/src/renderer/views/ChatWindow.tsx b/apps/desktop/src/renderer/views/ChatWindow.tsxindex 3ec092ed..497c62e3 100644--- a/apps/desktop/src/renderer/views/ChatWindow.tsx+++ b/apps/desktop/src/renderer/views/ChatWindow.tsx@@ -27,7 +27,6 @@ import { ComputerAccessView } from './computer-access/ComputerAccessView'import { HostStateView } from './HostStateView'import { StartupRecovery } from './StartupRecovery'export { EmptyState } from './HostStateView'-import { AnalyticsPrompt } from './AnalyticsPrompt'import { StarPrompt } from './StarPrompt'import { OpenVoiceSettings } from './call/CallView'import { AccountPanelLayer, DesktopActionMenu, ProfileAvatar } from './PanelMenus'@@ -103,7 +102,7 @@ export function ChatWindow() {}}/>)}- {onboarded && accessSetup !== null ? <><AnalyticsPrompt /><StarPrompt /></> : null}+ {onboarded && accessSetup !== null ? <StarPrompt /> : null}<Sheet open={showAccess} onClose={() => setShowAccess(false)} width={660} height={Math.min(820, window.innerHeight - 80)}><ModalHeader title="Computer access" /><ComputerAccessView onContinue={(ready) => { setAccessSetup(ready ? 'ready' : 'later'); setShowAccess(false) }} />diff --git a/apps/desktop/src/renderer/views/StarPrompt.tsx b/apps/desktop/src/renderer/views/StarPrompt.tsxindex b6d535a5..f547766e 100644--- a/apps/desktop/src/renderer/views/StarPrompt.tsx+++ b/apps/desktop/src/renderer/views/StarPrompt.tsx@@ -22,8 +22,8 @@ const copy = {}/**- * Asks for a GitHub star twice at most: once after setup (after the analytics question, so the- * two never stack), and once more a week later. Starring ends it.+ * Asks for a GitHub star twice at most: once after setup, and once more a week later.+ * Starring ends it.*/export function StarPrompt() {const app = useApp()@@ -32,7 +32,7 @@ export function StarPrompt() {const [state, setState] = usePref(prefs.starAsk)const [closed, setClosed] = useState(false)const due = dueStarAsk(state, Date.now())- const open = due !== null && onboarded && !closed && local?.connection.kind === 'online' && local.analytics !== null+ const open = due !== null && onboarded && !closed && local?.connection.kind === 'online'const finish = (starred: boolean) => {if (closed) returndiff --git a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx b/apps/desktop/src/renderer/views/bots/BotEditorView.tsxindex 764f64c0..94dccf14 100644--- a/apps/desktop/src/renderer/views/bots/BotEditorView.tsx+++ b/apps/desktop/src/renderer/views/bots/BotEditorView.tsx@@ -9,6 +9,8 @@ import { AVATAR_COLORS, AVATAR_SHAPES } from '../../lib/theme'import { useStore } from '../../store/context'import { AgentModelPicker } from './AgentModelPicker'import { errorText, fillDefaults, isValid, lastPathComponent, normalized, usePlugins, type Plugins } from './drafts'+import { FormSheet } from '../marketplace/pieces'+import { SkillSheet, type SkillRef } from '../marketplace/SkillSheet'import { MemoryCard } from './MemoryView'import { AnchoredPanel, AutoTextArea, Field, SwitchRow } from './parts'import './bots.css'@@ -19,14 +21,14 @@ export function BotEditorView({ draft: initial }: { draft: BotDraft }) {const dismiss = useDismiss()const plugins = usePlugins(store)const isNew = !initial.id- const [draft, setDraft] = useState(() => (isNew ? fillDefaults(store, initial, []) : initial))+ const [draft, setDraft] = useState(() => (isNew ? fillDefaults(store, initial, { connectors: [], skills: [] }) : initial))const [saving, setSaving] = useState(false)const [error, setError] = useState<string | null>(null)const online = store.connection.kind === 'online'- // A new bot's connectors start on once the computer has listed them.+ // A new bot's connectors and skills start on once the computer has listed them.useEffect(() => {- if (isNew && plugins) setDraft((d) => fillDefaults(store, d, plugins.connectors))+ if (isNew && plugins) setDraft((d) => fillDefaults(store, d, plugins))}, [isNew, plugins, store])const save = () => {@@ -96,6 +98,7 @@ function BotSettingsForm({ draft, onChange, error, plugins }: {const store = useStore()const [pickingAvatar, setPickingAvatar] = useState(false)const [pickingFolder, setPickingFolder] = useState(false)+ const [viewingSkill, setViewingSkill] = useState<SkillRef | null>(null)const avatarRef = useRef<HTMLButtonElement>(null)const set = <K extends keyof BotDraft>(key: K, value: BotDraft[K]) => onChange((d) => ({ ...d, [key]: value }))const setModel = useCallback((model: string | null) => onChange((d) => ({ ...d, model })), [onChange])@@ -229,11 +232,15 @@ function BotSettingsForm({ draft, onChange, error, plugins }: {items={skills.map((s) => ({ id: s.id, name: s.name, detail: s.description }))}selection={draft.skills ?? []}onChange={(ids) => set('skills', ids)}+ onInfo={(s) => setViewingSkill({ id: s.id, name: s.name, description: s.detail })}/>{draft.id ? <MemoryCard botId={draft.id} /> : null}{error ? <span className="fade-in" style={{ ...font('footnote'), color: 'var(--danger)' }}>{error}</span> : null}</div>+ <FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>+ {viewingSkill ? <SkillSheet key={viewingSkill.name} skill={viewingSkill} /> : null}+ </FormSheet><Sheet open={pickingFolder} onClose={() => setPickingFolder(false)} width={460} height={520}><FolderPickerstart={draft.cwd || store.hello?.home || null}@@ -248,25 +255,35 @@ function BotSettingsForm({ draft, onChange, error, plugins }: {}/** A card of on/off switches for the connectors or skills installed on the computer. */-function PluginToggles({ title, empty, items, selection, onChange }: {+function PluginToggles({ title, empty, items, selection, onChange, onInfo }: {title: stringempty: stringitems: { id: string; name: string; detail: string }[]selection: string[]onChange: (ids: string[]) => void+ /** Shows an item's details from an info button beside its switch. */+ onInfo?: (item: { id: string; name: string; detail: string }) => void}) {return (<CardSection title={title}>{items.length ? null : <span style={{ color: 'var(--secondary)' }}>{empty}</span>}- {items.map((item) => (- <SwitchRow- key={item.id}- title={item.name}- detail={item.detail || null}- on={selection.includes(item.id)}- onChange={(on) => onChange([...selection.filter((id) => id !== item.id), ...(on ? [item.id] : [])])}- />- ))}+ {items.map((item) => {+ const row = (+ <SwitchRow+ key={item.id}+ title={item.name}+ detail={item.detail || null}+ on={selection.includes(item.id)}+ onChange={(on) => onChange([...selection.filter((id) => id !== item.id), ...(on ? [item.id] : [])])}+ />+ )+ return onInfo ? (+ <div key={item.id} style={{ display: 'flex', alignItems: 'center', gap: 4 }}>+ <div style={{ flex: 1, minWidth: 0 }}>{row}</div>+ <IconButton title={`About ${item.name}`} icon="info.circle" onClick={() => onInfo(item)} />+ </div>+ ) : row+ })}</CardSection>)}diff --git a/apps/desktop/src/renderer/views/bots/drafts.ts b/apps/desktop/src/renderer/views/bots/drafts.tsindex 52686be1..eb2deb13 100644--- a/apps/desktop/src/renderer/views/bots/drafts.ts+++ b/apps/desktop/src/renderer/views/bots/drafts.ts@@ -42,13 +42,14 @@ export const normalized = (d: BotDraft): BotDraft => (d.backend === 'custom' ? d* Picks an installed agent we know (a registry agent nobody chose is never the default);* empty cwd requests a personal workspace from the host.*/-export function fillDefaults(store: BotStore, draft: BotDraft, connectors: InstalledConnector[]): BotDraft {+export function fillDefaults(store: BotStore, draft: BotDraft, plugins: Plugins): BotDraft {const next = { ...draft }const backends = store.hello?.backends ?? []const first = backends.find((b) => b.available && b.curated === true)if (backends.find((b) => b.id === next.backend)?.available !== true && first) next.backend = first.id- // Connectors start on; left unset, the host turns on every one.- if (next.connectors === undefined && connectors.length) next.connectors = connectors.map((c) => c.id)+ // Connectors and skills start on; left unset, the host turns on every one.+ if (next.connectors === undefined && plugins.connectors.length) next.connectors = plugins.connectors.map((c) => c.id)+ if (next.skills === undefined && plugins.skills.length) next.skills = plugins.skills.map((s) => s.id)return next}@@ -78,8 +79,7 @@ export function usePlugins(store: BotStore): Plugins | null {/** Creates an unnamed bot with sensible defaults and opens it (desktop compose flow). */export async function createDefaultBot(store: BotStore): Promise<Bot> {- const { connectors } = await loadPlugins(store)- const bot = await store.save(fillDefaults(store, newDraft(), connectors))+ const bot = await store.save(fillDefaults(store, newDraft(), await loadPlugins(store)))store.setSelection(bot.id)return bot}diff --git a/apps/desktop/src/renderer/views/call/voice.ts b/apps/desktop/src/renderer/views/call/voice.tsindex 3906e557..fcb0b3ce 100644--- a/apps/desktop/src/renderer/views/call/voice.ts+++ b/apps/desktop/src/renderer/views/call/voice.ts@@ -14,8 +14,7 @@ import {type VoiceProvider,} from '../settings/voice-settings'-// Calls use the voice settings the settings view keeps (views/settings/voice-settings.ts: the-// same keys as the Mac's UserDefaults, kit VoiceSettings).+// Calls use the voice settings the settings view keeps (views/settings/voice-settings.ts).export type { VoiceProvider, VoiceStatus } from '../settings/voice-settings'diff --git a/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx b/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsxindex 3e00bd32..4280f7bf 100644--- a/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx+++ b/apps/desktop/src/renderer/views/marketplace/MarketplaceView.tsx@@ -10,6 +10,7 @@ import { AgentSheet, AgentTile } from './AgentSheet'import { ComposioSection } from './ComposioViews'import { CredentialsView } from './CredentialsView'import { CustomConnectorSheet, InstallConnectorSheet, NewSkillSheet } from './ConnectorSheets'+import { SkillSheet, type SkillRef } from './SkillSheet'import {appendPage, emptyPage, errorText, hasHiddenItems, market, needsSignIn, replacePage, revealMore, visible,type MarketConnector, type MarketSkill,@@ -44,6 +45,7 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = fconst [busySkill, setBusySkill] = useState<string | null>(null)const [addingConnector, setAddingConnector] = useState(false)const [writingSkill, setWritingSkill] = useState(false)+ const [viewingSkill, setViewingSkill] = useState<SkillRef | null>(null)const [agent, setAgent] = useState<Backend | null>(null)/** Agents shown before "Load more agents" (two rows of the grid). */const [agentLimit, setAgentLimit] = useState(10)@@ -267,6 +269,7 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = fbusy={busySkill === s.source}icon={<SkillGlyph />}onAdd={() => void installSkill(s)}+ onOpen={() => setViewingSkill(s)}/>))}</ItemGrid>@@ -317,6 +320,9 @@ export function MarketplaceView({ computers, computer, onComputer, appsFirst = f<FormSheet open={writingSkill} onClose={() => setWritingSkill(false)}><NewSkillSheet /></FormSheet>+ <FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>+ {viewingSkill ? <SkillSheet key={viewingSkill.name} skill={viewingSkill} /> : null}+ </FormSheet><FormSheet open={agent !== null} onClose={() => setAgent(null)} width={560} height={560}>{agent ? <AgentSheet key={agent.id} initial={agent} /> : null}</FormSheet>@@ -348,6 +354,7 @@ function InstalledView({ back }: { back: () => void }) {const plugins = usePlugins(store)const [removing, setRemoving] = useState<{ id: string; name: string; isSkill: boolean } | null>(null)const [signingIn, setSigningIn] = useState<string | null>(null)+ const [viewingSkill, setViewingSkill] = useState<SkillRef | null>(null)const empty = plugins.installedConnectors.length === 0 && plugins.installedSkills.length === 0const signIn = async (id: string) => {@@ -397,6 +404,7 @@ function InstalledView({ back }: { back: () => void }) {title={s.name}subtitle={s.description}icon={<SkillGlyph size={32} />}+ onOpen={() => setViewingSkill({ id: s.id, name: s.name, description: s.description })}onRemove={() => setRemoving({ id: s.id, name: s.name, isSkill: true })}/>))}@@ -411,6 +419,9 @@ function InstalledView({ back }: { back: () => void }) {actions={removing ? [{ title: 'Remove', destructive: true, action: () => void remove(removing) }] : []}onClose={() => setRemoving(null)}/>+ <FormSheet open={viewingSkill !== null} onClose={() => setViewingSkill(null)}>+ {viewingSkill ? <SkillSheet key={viewingSkill.name} skill={viewingSkill} /> : null}+ </FormSheet></div>)}@@ -426,14 +437,28 @@ function EmptyState({ icon, title, detail }: { icon: string; title: string; deta)}-function InstalledRow({ title, subtitle, icon, accessory, onRemove }: { title: string; subtitle: string; icon: ReactNode; accessory?: ReactNode; onRemove: () => void }) {- return (- <div style={{ display: 'flex', alignItems: 'center', gap: 12 }} title={subtitle}>+function InstalledRow({ title, subtitle, icon, accessory, onOpen, onRemove }: {+ title: string; subtitle: string; icon: ReactNode; accessory?: ReactNode+ /** Opens the item's details from its name. */+ onOpen?: () => void+ onRemove: () => void+}) {+ const label = (+ <>{icon}- <div style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1, minWidth: 0 }}>+ <div style={{ display: 'flex', flexDirection: 'column', gap: 2, flex: 1, minWidth: 0, textAlign: 'left' }}><span style={{ color: 'var(--text)', ...ellipsis }}>{title}</span><span style={{ ...font('caption'), color: 'var(--secondary)', ...ellipsis }}>{subtitle}</span></div>+ </>+ )+ return (+ <div style={{ display: 'flex', alignItems: 'center', gap: 12 }} title={subtitle}>+ {onOpen ? (+ <button className="press" style={{ display: 'flex', alignItems: 'center', gap: 12, flex: 1, minWidth: 0 }} onClick={onOpen}>+ {label}+ </button>+ ) : label}<span style={{ minWidth: 12 }} />{accessory}<buttondiff --git a/apps/desktop/src/renderer/views/marketplace/SkillSheet.tsx b/apps/desktop/src/renderer/views/marketplace/SkillSheet.tsxnew file mode 100644index 00000000..4e1e1325--- /dev/null+++ b/apps/desktop/src/renderer/views/marketplace/SkillSheet.tsx@@ -0,0 +1,78 @@+import { useEffect, useState } from 'react'+import { isBelow } from '@shared/compat'+import { CardForm, CardSection, IconButton, Spinner } from '../../components/Controls'+import { Icon } from '../../components/Icon'+import { ModalHeader } from '../../components/Overlay'+import { font } from '../../lib/fonts'+import { useStore } from '../../store/context'+import { MarkdownText } from '../thread/Markdown'+import { SKILLS_HOST } from '../thread/skill-command'+import { errorText, market } from './market-models'+import { ErrorText } from './pieces'+import { usePlugins } from './plugins'++/** The skill a details sheet shows: an installed one (`id`) or one from the catalog (`source`). */+export type SkillRef = { name: string; description: string } & ({ id: string; source?: never; installed?: never } | { source: string; installed?: boolean; id?: never })++/** A skill's details (kit `SkillSheet`): what it tells the bot, its `SKILL.md`, with Add while it isn't installed. */+export function SkillSheet({ skill }: { skill: SkillRef }) {+ const store = useStore()+ const plugins = usePlugins(store)+ const [markdown, setMarkdown] = useState<string | null>(null)+ const [error, setError] = useState<string | null>(null)+ const [adding, setAdding] = useState(false)+ const which = skill.source !== undefined ? { source: skill.source } : { id: skill.id }+ const source = skill.source ?? null+ const added = source === null || skill.installed === true || plugins.installedSkills.some((s) => s.id === source.toLowerCase())+ // Older hosts list skills but can't show what's in them.+ const readable = !isBelow(store.hello?.version ?? '', SKILLS_HOST)++ useEffect(() => {+ if (!readable) return+ let live = true+ void store+ .ready()+ .then((c) => market.skillDetails(c, which))+ .then((m) => live && setMarkdown(m), (e: unknown) => live && setError(errorText(e)))+ return () => {+ live = false+ }+ }, [])++ const add = async () => {+ if (!source) return+ setAdding(true)+ setError(null)+ try {+ await plugins.installSkill(source)+ } catch (e) {+ setError(errorText(e))+ }+ setAdding(false)+ }++ const trailing = added ? (+ <span title="Added" aria-label="Added" style={{ width: 32, display: 'grid', placeItems: 'center', color: 'var(--secondary)' }}>+ <Icon name="checkmark" size={13} weight="semibold" />+ </span>+ ) : adding ? <Spinner /> : <IconButton title="Add" icon="plus" onClick={() => void add()} />++ return (+ <div style={{ display: 'flex', flexDirection: 'column', height: '100%', background: 'var(--background)' }}>+ <ModalHeader title={skill.name} trailing={trailing} />+ <CardForm>+ {skill.description ? (+ <CardSection>+ <span style={{ ...font('subheadline'), color: 'var(--secondary)' }}>{skill.description}</span>+ </CardSection>+ ) : null}+ {readable ? (+ <CardSection title="Instructions" footer={added ? 'Bots read these before using the skill.' : 'Add it to let bots use these instructions.'}>+ {markdown ? <MarkdownText text={markdown} /> : markdown === '' ? <span style={{ color: 'var(--secondary)' }}>No instructions.</span> : error ? null : <Spinner />}+ </CardSection>+ ) : null}+ {error ? <CardSection><ErrorText text={error} /></CardSection> : null}+ </CardForm>+ </div>+ )+}diff --git a/apps/desktop/src/renderer/views/marketplace/market-models.ts b/apps/desktop/src/renderer/views/marketplace/market-models.tsindex c68d6a05..1a2347f3 100644--- a/apps/desktop/src/renderer/views/marketplace/market-models.ts+++ b/apps/desktop/src/renderer/views/marketplace/market-models.ts@@ -207,6 +207,8 @@ export const market = {installSkill: (c: HostClient, source: string) => c.call('installSkill', { source }, s(60)),addSkill: (c: HostClient, name: string, description: string, instructions: string) => c.call('installSkill', { name, description, instructions }),removeSkill: (c: HostClient, id: string) => c.call('removeSkill', { id }),+ /** A skill's `SKILL.md` without its front matter: an installed one by `id`, a catalog one by `source`. */+ skillDetails: async (c: HostClient, which: { id: string } | { source: string }) => (await c.call<{ markdown: string }>('skillDetails', which, s(60))).markdown,connectorInfo: (c: HostClient, registryName: string) => c.call<MarketConnector>('connectorInfo', { registryName }, s(60)),verifyConnector: (c: HostClient, id: string) => c.call<{ status: string }>('connectorVerify', { id }, s(120)),finishConnectionRequest: (c: HostClient, entryId: string, opts: { connectorId?: string; value?: string; username?: string; cancel?: boolean } = {}) =>diff --git a/apps/desktop/src/renderer/views/marketplace/marketplace.css b/apps/desktop/src/renderer/views/marketplace/marketplace.cssindex 7ea33687..6e665f82 100644--- a/apps/desktop/src/renderer/views/marketplace/marketplace.css+++ b/apps/desktop/src/renderer/views/marketplace/marketplace.css@@ -106,7 +106,7 @@min-width: 0;transition: background-color var(--hover);}-.market-row:hover {+.market-row.openable:hover {background: color-mix(in srgb, var(--bubble-agent) 60%, transparent);}diff --git a/apps/desktop/src/renderer/views/marketplace/pieces.tsx b/apps/desktop/src/renderer/views/marketplace/pieces.tsxindex 24b4fcf1..0061fb18 100644--- a/apps/desktop/src/renderer/views/marketplace/pieces.tsx+++ b/apps/desktop/src/renderer/views/marketplace/pieces.tsx@@ -25,7 +25,7 @@ export function ItemGrid({ children }: { children: ReactNode }) {const oneLine: CSSProperties = { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }export const lineClamp = (n: number): CSSProperties => ({ display: '-webkit-box', WebkitLineClamp: n, WebkitBoxOrient: 'vertical', overflow: 'hidden' })-export function MarketRow({ title, subtitle, added, busy = false, addLabel = 'Add', icon, onAdd }: {+export function MarketRow({ title, subtitle, added, busy = false, addLabel = 'Add', icon, onAdd, onOpen }: {title: stringsubtitle: stringadded: boolean@@ -33,9 +33,23 @@ export function MarketRow({ title, subtitle, added, busy = false, addLabel = 'AdaddLabel?: stringicon: ReactNodeonAdd: () => void+ /** The whole row opens the item's details; without it the row does what its button does. */+ onOpen?: () => void}) {+ const open = onOpen ?? (added || busy ? undefined : onAdd)return (- <div className="market-row">+ <div+ className={`market-row ${open ? 'openable' : ''}`}+ role={open ? 'button' : undefined}+ tabIndex={open ? 0 : undefined}+ onClick={open}+ onKeyDown={(e) => {+ if (open && e.target === e.currentTarget && (e.key === 'Enter' || e.key === ' ')) {+ e.preventDefault()+ open()+ }+ }}+ ><div style={{ width: 46, height: 46, flex: 'none', display: 'grid' }}>{icon}</div><div style={{ display: 'flex', flexDirection: 'column', gap: 2, minWidth: 0, flex: 1 }}><span style={{ ...font('body', 'medium'), color: 'var(--text)', ...oneLine }} title={title}>{title}</span>@@ -50,7 +64,14 @@ export function MarketRow({ title, subtitle, added, busy = false, addLabel = 'Ad<Icon name="checkmark" size={11} weight="semibold" /></span>) : (- <button className="capsule-action" style={font('subheadline', 'semibold')} onClick={onAdd}>+ <button+ className="capsule-action"+ style={font('subheadline', 'semibold')}+ onClick={(e) => {+ e.stopPropagation()+ onAdd()+ }}+ >{addLabel}</button>)}@@ -243,7 +264,7 @@ export function useWindowHeight() {return height}-/** A Marketplace form in its own modal card (`.codyncSheet`), sized like the Mac's. */+/** A Marketplace form in its own modal card (`.codyncSheet`). */export function FormSheet({ open, onClose, width = 520, height = 600, children }: { open: boolean; onClose: () => void; width?: number; height?: number; children: ReactNode }) {const windowHeight = useWindowHeight()return (diff --git a/apps/desktop/src/renderer/views/settings/ComputersView.tsx b/apps/desktop/src/renderer/views/settings/ComputersView.tsxindex 49d90c65..b8d44232 100644--- a/apps/desktop/src/renderer/views/settings/ComputersView.tsx+++ b/apps/desktop/src/renderer/views/settings/ComputersView.tsx@@ -12,7 +12,7 @@ import type { BotStore } from '../../store/bot-store'import { StoreContext, useApp } from '../../store/context'import { ComputerBadge } from '../ComputerBadge'import { deviceIcon, errorText, liveClient, relativeDay, Reveal, SectionHeader, statusText, thisMac } from './parts'-import { sshBridge, useSSH } from './ssh-model'+import { useSSH } from './ssh-model'import { SSHRow } from './SSHRow'import { VoiceChatSettingsView } from './VoiceChatSettingsView'@@ -40,7 +40,7 @@ export function ComputersView() {<div><SectionHeader title="Over SSH">- {sshBridge() ? <IconButton title="Add SSH computer" icon="plus" onClick={() => setEditing({ profile: newSSHProfile(window.codync.hostPort), isNew: true })} /> : null}+ <IconButton title="Add SSH computer" icon="plus" onClick={() => setEditing({ profile: newSSHProfile(window.codync.hostPort), isNew: true })} /></SectionHeader><Reveal show={sshState.state.profiles.length === 0}><div style={{ ...font('callout'), color: 'var(--secondary)' }}>@@ -390,7 +390,7 @@ function SSHProfileEditor({ profile: initial, isNew }: { profile: SSHProfile; isconst [remotePort, setRemotePort] = useState(String(initial.remotePort))const [user, setUser] = useState(initial.user ?? '')const [problem, setProblem] = useState<string | null>(null)- const bridge = sshBridge()+ const bridge = window.codync.sshconst save = async () => {const isInt = (s: string) => /^-?\d+$/.test(s)@@ -407,7 +407,7 @@ function SSHProfileEditor({ profile: initial, isNew }: { profile: SSHProfile; isport: portText ? Number(portText) : null,remotePort: Number(remote),}- const found = bridge ? await bridge.save(p) : 'SSH computers need a newer build of Codync.'+ const found = await bridge.save(p)if (found) return setProblem(found)dismiss()}@@ -436,7 +436,7 @@ function SSHProfileEditor({ profile: initial, isNew }: { profile: SSHProfile; is<IconButtontitle="Choose key file"icon="key"- onClick={() => void bridge?.chooseKey().then((path) => path && setProfile((p) => ({ ...p, identityFile: path })))}+ onClick={() => void bridge.chooseKey().then((path) => path && setProfile((p) => ({ ...p, identityFile: path })))}/>{profile.identityFile ? (<span className="settings-appear" style={{ display: 'flex' }}>diff --git a/apps/desktop/src/renderer/views/settings/SSHRow.tsx b/apps/desktop/src/renderer/views/settings/SSHRow.tsxindex 87a30c11..cc023d92 100644--- a/apps/desktop/src/renderer/views/settings/SSHRow.tsx+++ b/apps/desktop/src/renderer/views/settings/SSHRow.tsx@@ -4,10 +4,9 @@ import { Icon } from '../../components/Icon'import { font } from '../../lib/fonts'import { Reveal } from './parts'import { sshStatusDetail } from '@shared/ssh-startup'-import { sshBridge } from './ssh-model'export function SSHRow({ profile, status, edit, attached = true }: { profile: SSHProfile; status: SSHStatus; attached?: boolean; edit: () => void }) {- const bridge = sshBridge()+ const bridge = window.codync.sshconst dev = window.codync.appScheme === 'codync-dev'const target = `${profile.user ? `${profile.user}@` : ''}${profile.host}${profile.port !== null ? `:${profile.port}` : ''}`const line = (() => {@@ -41,12 +40,12 @@ export function SSHRow({ profile, status, edit, attached = true }: { profile: SS<span style={{ ...font('caption'), color: problem ? 'var(--warning)' : 'var(--secondary)' }}>{line}</span></div>{active ? (- <IconButton title="Disconnect" icon="stop.circle" onClick={() => bridge?.disconnect(profile.id)} />+ <IconButton title="Disconnect" icon="stop.circle" onClick={() => bridge.disconnect(profile.id)} />) : (- <IconButton title="Connect" icon="arrow.clockwise" onClick={() => bridge?.connect(profile.id)} />+ <IconButton title="Connect" icon="arrow.clockwise" onClick={() => bridge.connect(profile.id)} />)}<IconButton title="Edit" icon="pencil" onClick={edit} />- <IconButton title="Remove" icon="trash" onClick={() => bridge?.remove(profile.id)} />+ <IconButton title="Remove" icon="trash" onClick={() => bridge.remove(profile.id)} /></div><Reveal show={status.kind === 'confirmHostKey'}>{status.kind === 'confirmHostKey' ? (@@ -59,8 +58,8 @@ export function SSHRow({ profile, status, edit, attached = true }: { profile: SS<span key={f} className="selectable" style={font('caption', undefined, 'monospaced')}>{f}</span>))}<div style={{ display: 'flex', gap: 8 }}>- <Button onClick={() => bridge?.trustHostKey(profile.id)}>Trust and connect</Button>- <Button kind="secondary" onClick={() => bridge?.disconnect(profile.id)}>Cancel</Button>+ <Button onClick={() => bridge.trustHostKey(profile.id)}>Trust and connect</Button>+ <Button kind="secondary" onClick={() => bridge.disconnect(profile.id)}>Cancel</Button></div></div>) : null}diff --git a/apps/desktop/src/renderer/views/settings/SettingsView.tsx b/apps/desktop/src/renderer/views/settings/SettingsView.tsxindex 803bbee2..f248cd9c 100644--- a/apps/desktop/src/renderer/views/settings/SettingsView.tsx+++ b/apps/desktop/src/renderer/views/settings/SettingsView.tsx@@ -171,7 +171,7 @@ function PrivacySettings() {const running = local !== null && local.connection.kind === 'online'const setShared = (on: boolean) => void local?.setAnalytics(on).catch((e: unknown) => app.setError(errorText(e)))return (- <CardSection title="Privacy" footer="Which features you use, never your messages, code or files. Private, used only to improve Codync.">+ <CardSection title="Privacy" footer="Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you."><Switch on={local?.analytics === true} onChange={setShared} disabled={!running}>Share usage analytics</Switch>@@ -223,7 +223,7 @@ function UpdateSettings() {<ValueRow key="version" label="Version" detail={lastChecked}><span style={{ display: 'flex', alignItems: 'center', gap: 10 }}><span>{window.codync.appVersion}</span>- <Button kind="secondary" onClick={() => window.codync.updates.check()} disabled={!updates.canCheck && !updates.staged}>+ <Button kind="secondary" onClick={() => window.codync.updates.check()} disabled={!updates.supported && !updates.staged}>{updates.availableVersion ? `Update to ${updates.availableVersion}` : 'Check for updates'}</Button></span>diff --git a/apps/desktop/src/renderer/views/settings/parts.tsx b/apps/desktop/src/renderer/views/settings/parts.tsxindex dfcc3bbc..1340244c 100644--- a/apps/desktop/src/renderer/views/settings/parts.tsx+++ b/apps/desktop/src/renderer/views/settings/parts.tsx@@ -5,7 +5,7 @@ import type { BotStore } from '../../store/bot-store'import './settings.css'export const isMac = window.codync.platform === 'darwin'-/** "Mac" in the Mac app's copy; "computer" elsewhere. */+/** "this Mac" on macOS; "this computer" elsewhere. */export const thisMac = isMac ? 'this Mac' : 'this computer'/** The icon for a device by its account platform: phones, Macs, and other desktops. */diff --git a/apps/desktop/src/renderer/views/settings/ssh-model.ts b/apps/desktop/src/renderer/views/settings/ssh-model.tsindex a972e46a..d216ebee 100644--- a/apps/desktop/src/renderer/views/settings/ssh-model.ts+++ b/apps/desktop/src/renderer/views/settings/ssh-model.ts@@ -1,25 +1,21 @@import { useEffect } from 'react'import type { Computer } from '@shared/models'-import type { SSHBridge, SSHState } from '@shared/ssh'+import type { SSHState } from '@shared/ssh'import { LoopbackTransport } from '../../client/host-client'import { Observable, useModel } from '../../lib/observable'import type { AppModel } from '../../store/app-model'import { BotStore } from '../../store/bot-store'-/** `window.codync.ssh` (preload/ssh.ts); missing in a build that doesn't wire it. */-export const sshBridge = (): SSHBridge | null => window.codync.ssh ?? null-/** The main process's SSH computers, mirrored for views. */class SSHModel extends Observable {state: SSHState = { profiles: [], status: {}, attachments: [] }private started = falsestart() {- const bridge = sshBridge()- if (this.started || !bridge) return+ if (this.started) returnthis.started = true- bridge.onChange((s) => this.apply(s))- void bridge.state().then((s) => this.apply(s))+ window.codync.ssh.onChange((s) => this.apply(s))+ void window.codync.ssh.state().then((s) => this.apply(s))}private apply(s: SSHState) {@@ -45,7 +41,7 @@ export function useSSH() {/*** Attaches each connected SSH computer to the window's model as a loopback store, and detaches- * it when its tunnel ends (the Mac app's `ssh.onAttach` / `onDetach`). Call once, from ChatWindow.+ * it when its tunnel ends. Call once, from ChatWindow.*/export function useSSHAttachments(app: AppModel) {useEffect(() => {diff --git a/apps/desktop/src/renderer/views/settings/voice-settings.ts b/apps/desktop/src/renderer/views/settings/voice-settings.tsindex fb7937d6..5bf5faed 100644--- a/apps/desktop/src/renderer/views/settings/voice-settings.ts+++ b/apps/desktop/src/renderer/views/settings/voice-settings.ts@@ -2,8 +2,7 @@ import type { HostClient } from '../../client/host-client'import { pref, type Pref } from '../../lib/prefs'// Realtime voice on the user's own provider keys (host/src/voice.rs, kit Voice.swift +-// VoiceSettings). The keys stay on the computer; these are this device's choices, under the-// same keys as the Swift apps.+// VoiceSettings). The keys stay on the computer; these are this device's choices.export type VoiceProvider = 'openai' | 'gemini'export const VOICE_PROVIDERS: VoiceProvider[] = ['openai', 'gemini']diff --git a/apps/desktop/src/renderer/views/thread/ChatRows.tsx b/apps/desktop/src/renderer/views/thread/ChatRows.tsxindex 086c2541..e5ee1344 100644--- a/apps/desktop/src/renderer/views/thread/ChatRows.tsx+++ b/apps/desktop/src/renderer/views/thread/ChatRows.tsx@@ -185,17 +185,6 @@ function UserStatus({ entry, botWorking, hovering }: { entry: Entry; botWorking:)case 'cancelled':return <span style={caption}>Not sent — stopped</span>- case 'waiting':- return (- <span style={{ display: 'flex', alignItems: 'center', gap: 10, ...font('caption2') }}>- <span style={{ color: 'var(--tertiary)' }}>Waiting for the computer to come online</span>- <button title="Don't send" aria-label="Don't send" style={{ display: 'flex' }} onClick={() => store.cancelQueued(entry)}>- <Icon name="xmark.circle" size={10} />- </button>- </span>- )- case 'delivering':- return <span style={caption}>Delivered to the computer</span>default:return <span style={{ ...font(10), color: 'var(--tertiary)', opacity: hovering ? 1 : 0, transition: 'opacity var(--hover)' }}>{relativeTime.time(entry.createdAt)}</span>}diff --git a/apps/desktop/src/renderer/views/thread/Composer.tsx b/apps/desktop/src/renderer/views/thread/Composer.tsxindex ce3014d5..3da4cac7 100644--- a/apps/desktop/src/renderer/views/thread/Composer.tsx+++ b/apps/desktop/src/renderer/views/thread/Composer.tsx@@ -1,19 +1,23 @@import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore, type ReactNode } from 'react'+import { isBelow } from '@shared/compat'import { isGroup, isWorkingIn, type Bot } from '@shared/models'import { BotAvatar } from '../../components/Avatar'import { Icon } from '../../components/Icon'import { usePresence } from '../../components/Overlay'import { font } from '../../lib/fonts'+import { useModel } from '../../lib/observable'import { useStore } from '../../store/context'import { MAX_FILE_SIZE, type OutgoingFile } from '../../store/bot-store'+import { pluginsFor } from '../marketplace/plugins'import { composerEnter } from './composer-keyboard'import { ComposerAttachment } from './ComposerAttachment'+import { matchingSkills, SKILLS_HOST, skillQuery } from './skill-command'type Trailing = 'interrupt' | 'stop' | 'call' | 'send'/*** The message box under a chat or a thread: send, or stop while the bot (or the group) is- * working there. In a group, typing `@` suggests its bots.+ * working there. In a group, typing `@` suggests its bots; with one bot, a leading `/` suggests its skills.*/export function Composer({ botId, thread = null, onCall, onInterrupt }: {botId: string@@ -33,6 +37,7 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {botId: string; thread: string | null; onCall?: (() => void) | null; onInterrupt?: (() => void) | null}) {const store = useStore()+ const plugins = useModel(pluginsFor(store))const bot = store.bots.get(botId) ?? nullconst drafts = store.composerDraftsconst draft = useSyncExternalStore(drafts.subscribe, () => drafts.get(botId, thread))@@ -96,6 +101,16 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {field.current?.focus()}+ // Not in a group: each member has its own skills.+ const skillsShown = !!bot && !isGroup(bot) && !isBelow(store.hello?.version ?? '', SKILLS_HOST)+ const typedSkill = skillsShown ? skillQuery(draft) : null+ const skills = typedSkill === null || !bot ? [] : matchingSkills(plugins.installedSkills, bot.skills, typedSkill)++ const pickSkill = (id: string) => {+ setDraft(`/${id} `)+ field.current?.focus()+ }+const append = (incoming: { name: string; data: Uint8Array }[]) => {if (!canAttach) returnconst accepted: OutgoingFile[] = []@@ -130,7 +145,7 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {return (<div style={{ display: 'flex', flexDirection: 'column' }}>- <ComposerReveal open={suggestions.length > 0}>+ <ComposerReveal open={suggestions.length > 0 || skills.length > 0}><div className="mentions">{suggestions.map((m) => (<button key={m.id} className="press mention" onClick={() => mention(m)}>@@ -138,6 +153,12 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {<span style={{ ...font('subheadline'), color: 'var(--text)' }}>{m.name}</span></button>))}+ {skills.map((s) => (+ <button key={s.id} className="press mention" title={s.description || s.name} onClick={() => pickSkill(s.id)}>+ <Icon name="book.pages" size={12} color="var(--secondary)" />+ <span style={{ ...font('subheadline'), color: 'var(--text)' }}>{s.name}</span>+ </button>+ ))}</div></ComposerReveal><div@@ -178,7 +199,11 @@ function DestinationComposer({ botId, thread, onCall, onInterrupt }: {aria-keyshortcuts="Enter Shift+Enter"onCompositionStart={() => { composing.current = true }}onCompositionEnd={() => { composing.current = false }}- onChange={(e) => setDraft(e.target.value)}+ onChange={(e) => {+ setDraft(e.target.value)+ // Starting a skill name: list the computer's skills again.+ if (skillsShown && e.target.value === '/') void plugins.refresh()+ }}onKeyDown={(e) => {// Return sends, Shift-Return adds a line; an input method's Return picks its candidate.const action = composerEnter({ key: e.key, shiftKey: e.shiftKey, altKey: e.altKey, repeat: e.repeat, isComposing: composing.current || e.nativeEvent.isComposing, keyCode: e.keyCode })diff --git a/apps/desktop/src/renderer/views/thread/skill-command.test.ts b/apps/desktop/src/renderer/views/thread/skill-command.test.tsnew file mode 100644index 00000000..7938ab17--- /dev/null+++ b/apps/desktop/src/renderer/views/thread/skill-command.test.ts@@ -0,0 +1,17 @@+import assert from 'node:assert/strict'+import { test } from 'node:test'+import { matchingSkills, skillQuery } from './skill-command.ts'++test('a leading slash opens the skill menu until the name ends', () => {+ assert.equal(skillQuery('/'), '')+ assert.equal(skillQuery('/pd'), 'pd')+ assert.equal(skillQuery('/pdf merge'), null)+ assert.equal(skillQuery('hi /pdf'), null)+})++test('only the bot\'s own skills match, by id or name', () => {+ const installed = [{ id: 'pdf', name: 'PDF' }, { id: 'code-review', name: 'Code Review' }, { id: 'xlsx', name: 'xlsx' }]+ assert.deepEqual(matchingSkills(installed, ['pdf', 'code-review'], '').map((s) => s.id), ['pdf', 'code-review'])+ assert.deepEqual(matchingSkills(installed, ['pdf', 'code-review'], 'review').map((s) => s.id), ['code-review'])+ assert.deepEqual(matchingSkills(installed, ['pdf'], 'xl'), [])+})diff --git a/apps/desktop/src/renderer/views/thread/skill-command.ts b/apps/desktop/src/renderer/views/thread/skill-command.tsnew file mode 100644index 00000000..55215655--- /dev/null+++ b/apps/desktop/src/renderer/views/thread/skill-command.ts@@ -0,0 +1,17 @@+// `/skill` in the composer: while the draft is just `/partial`, the bot's skills are offered.+// The host turns a message starting with `/<skill id>` into "read this skill first"+// (host/src/market/skills.rs `expand_command`).++/** The first host with `/skill` messages and skill details; older ones get the text as typed. */+export const SKILLS_HOST = '2.14.1'++/** The skill name being typed after a leading `/`, before any space; otherwise null. */+export function skillQuery(draft: string): string | null {+ return /^\/\S*$/.test(draft) ? draft.slice(1) : null+}++/** The bot's skills (ids in `enabled`) whose id or name holds `query`. */+export function matchingSkills<T extends { id: string; name: string }>(installed: T[], enabled: string[], query: string): T[] {+ const q = query.toLowerCase()+ return installed.filter((s) => enabled.includes(s.id) && (s.id.includes(q) || s.name.toLowerCase().includes(q)))+}diff --git a/apps/desktop/src/renderer/views/thread/thread.css b/apps/desktop/src/renderer/views/thread/thread.cssindex 31b264fa..68940a93 100644--- a/apps/desktop/src/renderer/views/thread/thread.css+++ b/apps/desktop/src/renderer/views/thread/thread.css@@ -47,7 +47,7 @@.top-fade {/* Placed in grid area 1/1 its box would start inside the chrome's padding and leave hardedges; auto placement makes it cover the whole chrome. It fades out 24px below the- chrome, as the Mac app did. */+ chrome. */grid-area: auto !important;position: absolute;inset: 0 0 -24px;diff --git a/apps/desktop/src/renderer/views/tray-summary.ts b/apps/desktop/src/renderer/views/tray-summary.tsindex 5d3b4ad5..25b6da9f 100644--- a/apps/desktop/src/renderer/views/tray-summary.ts+++ b/apps/desktop/src/renderer/views/tray-summary.ts@@ -112,9 +112,6 @@ export function useTraySummary(app: AppModel) {? {enabled: screen.enabled,subtitle: screenSubtitle(app),- needsLoginItem: app.screenNeedsApproval,- needsCapture: screen.enabled && screen.connected && !screen.capture,- needsInput: screen.enabled && screen.connected && !screen.input,error: app.screenError,}: null,diff --git a/apps/desktop/src/shared/ipc.ts b/apps/desktop/src/shared/ipc.tsindex 25eb1149..ede3155f 100644--- a/apps/desktop/src/shared/ipc.ts+++ b/apps/desktop/src/shared/ipc.ts@@ -42,9 +42,6 @@ export interface TraySummary {screen: {enabled: booleansubtitle: string- needsLoginItem: boolean- needsCapture: boolean- needsInput: booleanerror: string | null} | nullversion: string | null@@ -72,7 +69,6 @@ export type WindowCommand =/** The app's own updates (electron-updater, release builds only). */export interface UpdateState {supported: boolean- canCheck: booleanchecking: booleanavailableVersion: string | null/** Downloaded and ready: installs on restart. */@@ -118,13 +114,10 @@ export interface CodyncBridge {onChange(cb: (s: HostSnapshot) => void): () => voidinstall(): voidrestart(): void- uninstall(): void- openLog(): void/** POST /api/<method> on a loopback host. Rejects with a `CallError`. */call(baseURL: string, token: string, method: string, body: unknown, timeoutMs: number): Promise<unknown>/** SSE on a loopback host: each `data:` line, then `onEnd` (with an error when it failed). */stream(url: string, token: string, onData: (line: string) => void, onEnd: (error: CallError | null) => void): () => void- health(baseURL: string): Promise<{ computerId?: string; busy?: boolean } | null>}account: {state(): Promise<AccountState>@@ -170,8 +163,6 @@ export interface CodyncBridge {readClipboardFiles(): Promise<{ name: string; data: Uint8Array }[]>setTraySummary(summary: TraySummary): voidonCommand(cb: (command: WindowCommand) => void): () => void- openPairing(): void- quit(): voidresetAllData(): Promise<void>setLaunchAtLogin(on: boolean): Promise<boolean>showInDock(): Promise<boolean>diff --git a/apps/desktop/src/shared/models.ts b/apps/desktop/src/shared/models.tsindex 12088583..54e9e116 100644--- a/apps/desktop/src/shared/models.ts+++ b/apps/desktop/src/shared/models.ts@@ -276,7 +276,7 @@ export function normalizeScreen(raw: Partial<ScreenState> | undefined | null): Sdisplays: raw.displays ?? [],userControl: raw.userControl ?? false,agentBot: raw.agentBot ?? null,- computerUse: raw.computerUse ?? raw.enabled ?? false,+ computerUse: raw.computerUse ?? false,viewers: raw.viewers ?? 0,}}@@ -297,8 +297,8 @@ export interface Hello {boxKey?: stringminApp?: stringcloud?: string | null- /** Product analytics on this computer; null until its owner chose (absent on older hosts). */- analytics?: boolean | null+ /** Product analytics on this computer: on unless its owner turned it off. */+ analytics?: boolean}/** Events only the desktop app knows about; the host records everything else from API calls. */@@ -307,7 +307,6 @@ export type AnalyticsEvent = 'app_opened' | 'onboarding_completed' | 'signed_in'export interface PairingInfo {pairingUrl: stringurls: string[]- svg?: stringexpiresAt?: number}diff --git a/apps/desktop/src/shared/ssh-command.test.ts b/apps/desktop/src/shared/ssh-command.test.tsindex 111e65f3..e9e25e1a 100644--- a/apps/desktop/src/shared/ssh-command.test.ts+++ b/apps/desktop/src/shared/ssh-command.test.ts@@ -16,7 +16,6 @@ const locations = ['/home/linuxbrew/.linuxbrew/bin','/user home/.local/bin','/Applications/Codync.app/Contents/Resources',- '/Applications/Codync.app/Contents/MacOS',]function probe(installed: string[]) {@@ -168,7 +167,6 @@ for (const kind of ['info', 'tunnel', 'resolve'] as const) {for (const [preferred, fallback] of [['/opt/homebrew/bin', '/Applications/Codync.app/Contents/Resources'],- ['/Applications/Codync.app/Contents/Resources', '/Applications/Codync.app/Contents/MacOS'],]) {test(`SSH prefers ${preferred} over ${fallback}`, { skip: process.platform === 'win32' }, () => {const result = probe([preferred, fallback])diff --git a/apps/desktop/src/shared/updates.test.ts b/apps/desktop/src/shared/updates.test.tsindex 8db22ada..365a65d5 100644--- a/apps/desktop/src/shared/updates.test.ts+++ b/apps/desktop/src/shared/updates.test.ts@@ -13,7 +13,6 @@ for (const options of [{ packaged: false }, { main: false }]) {f.updates.check()await f.emit('update-downloaded', release)assert.equal(f.updates.state.supported, false)- assert.equal(f.updates.state.canCheck, false)assert.equal(f.calls.check + f.calls.download + f.calls.install, 0)assert.equal(f.timers.size, 0)})diff --git a/apps/desktop/tsconfig.json b/apps/desktop/tsconfig.jsonindex 0b0d66da..12a4d45f 100644--- a/apps/desktop/tsconfig.json+++ b/apps/desktop/tsconfig.json@@ -14,9 +14,7 @@"allowImportingTsExtensions": true,"noEmit": true,"types": ["node"],- "ignoreDeprecations": "6.0",- "baseUrl": ".",- "paths": { "@shared/*": ["src/shared/*"] }+ "paths": { "@shared/*": ["./src/shared/*"] }},"include": ["src", "electron.vite.config.ts", "vite.demo.config.ts"]}diff --git a/apps/ios/App/CodyncApp.swift b/apps/ios/App/CodyncApp.swiftindex 7eb1b295..b9edfd67 100644--- a/apps/ios/App/CodyncApp.swift+++ b/apps/ios/App/CodyncApp.swift@@ -15,8 +15,6 @@ struct CodyncApp: App {@AppStorage("onboardingCompleted") private var onboardingCompleted = false/// Cold launch with a computer to reach: the splash covers its connect and catch-up.@State private var launching = !AppStore.shared.accounts.computers.isEmpty- /// nil until this iPhone answers "Help improve Codync".- @AppStorage(Analytics.enabledKey) private var analyticsEnabled: Bool?init() {// A tapped widget bot arrives as an intent, not a URL.OpenBotIntent.open = { AppStore.shared.open($0) }@@ -46,20 +44,6 @@ struct CodyncApp: App {.environment(app.account).tint(Palette.accent)}- // Asked once per iPhone after setup, once the splash and the account sheet are gone.- .codyncDialog("Help improve Codync", isPresented: Binding(- get: { onboardingCompleted && analyticsEnabled == nil && !launching && !app.account.showSwitcher },- // Closing without choosing is a no. The dialog closes before a button's action- // runs, so this waits for it: a yes must not first drop the waiting events.- set: { shown in- guard !shown else { return }- Task { @MainActor in if Analytics.shared.isEnabled == nil { Analytics.shared.setEnabled(false) } }- }- ), message: Self.analyticsQuestion, cancel: "Don't share", inPlace: true) {- [DialogAction("Share usage") {- Analytics.shared.setEnabled(true)- }]- }.onChange(of: app.account.userID, initial: true) { _, userID inapp.switchAccount(to: userID)}@@ -71,7 +55,6 @@ struct CodyncApp: App {}}.onOpenURL { url in app.open(url) }- // Waits for the analytics answer, which is asked right after setup..onChange(of: onboardingCompleted) { _, done in if done { Analytics.shared.capture(.onboardingCompleted) } }.onChange(of: scenePhase, initial: true) { _, phase inswitch phase {@@ -112,16 +95,6 @@ struct CodyncApp: App {}}-extension CodyncApp {- static let analyticsQuestion = """- Codync can record which features you use on this iPhone, like creating a bot or sending a message.-- Never your messages, code, files, prompts or bot names.- Never sold or used for ads. Linked to your Codync account when you're signed in.- Turn it off anytime in Settings.- """-}-enum AppTab: Hashable { case bots, state }/// One `AccountStore` per account context: switching accounts retires the old one so@@ -204,7 +177,6 @@ final class AppStore {storage.bots = []SharedStore.activeAccountID = nilUserDefaults.standard.set(false, forKey: "onboardingCompleted")- Analytics.shared.setEnabled(nil)showComputers = falseaccount.showSwitcher = falsemarketplace = nil@@ -261,8 +233,7 @@ final class AppStore {private static func makeAccounts(_ storage: SharedStore.Context, session: AccountSession) -> (AccountStore, CloudClient?) {let identity = storage.accountID == nil ? nil : try? DeviceIdentity.load(context: storage)let cloud = session.cloudClient(for: storage.accountID, identity: identity)- let accounts = AccountStore(storage: storage, clientKind: "ios", cloud: cloud)- accounts.asksForAccess = true+ let accounts = AccountStore(storage: storage, cloud: cloud)accounts.onConnected = { store inPushRegistrar.shared.syncDevice(with: store)store.onUsageChanged = { _, _ in WidgetCenter.shared.reloadTimelines(ofKind: "CodyncUsage") }diff --git a/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift b/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swiftindex eb0bc163..2afca206 100644--- a/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift@@ -11,8 +11,8 @@ public enum AnalyticsEvent: String, Sendable {case voiceCallStarted = "voice_call_started"}-/// Opt-in product analytics: batches events to PostHog. Nothing is recorded until this iPhone-/// says yes. Only the app calls it; widgets and the notification extension never do.+/// Product analytics: batches events to PostHog, on unless turned off in Settings.+/// Only the app calls it; widgets and the notification extension never do.@MainActorpublic final class Analytics {public static let shared = Analytics()@@ -45,7 +45,7 @@ public final class Analytics {nonisolated static let endpoint = URL(string: "https://us.i.posthog.com/batch/")!static let apiKey = "phc_rQHvxdSFKnMquPfMjmiMhXhM4tqJ5qCYsWuVEoFxCCWX"- /// `Bool?`: nil until asked.+ /// `Bool`, absent = on.public static let enabledKey = "analyticsEnabled"private static let installKey = "analyticsInstallID"private static let identifiedKey = "analyticsIdentifiedUsers"@@ -67,27 +67,24 @@ public final class Analytics {self.upload = upload}- /// nil until this iPhone answers the question.- public var isEnabled: Bool? { defaults.object(forKey: Self.enabledKey) as? Bool }+ public var isEnabled: Bool { defaults.object(forKey: Self.enabledKey) as? Bool ?? true }- /// A yes sends what waited for the answer; turning it off (or back to "not asked") drops- /// everything not yet sent.- public func setEnabled(_ enabled: Bool?) {+ /// Turning it off drops everything not yet sent.+ public func setEnabled(_ enabled: Bool) {defaults.set(enabled, forKey: Self.enabledKey)- guard enabled != true else { return flush() }+ guard !enabled else { return flush() }pending = []timer?.cancel()timer = nil}- /// Until this iPhone answers, events wait in memory (setup and pairing come before the- /// question) and leave only after a yes. `properties` are public names, never content.+ /// `properties` are public names, never content.public func capture(_ event: AnalyticsEvent, _ properties: [String: String] = [:]) {- guard isEnabled != false else { return }+ guard isEnabled else { return }let extra = properties.mapValues(Value.string)if let user = userID() {var identified = defaults.stringArray(forKey: Self.identifiedKey) ?? []- if isEnabled == true, !identified.contains(user) {+ if !identified.contains(user) {enqueue("$identify", user, ["$anon_distinct_id": .string(installID)])identified.append(user)defaults.set(identified, forKey: Self.identifiedKey)@@ -119,7 +116,7 @@ public final class Analytics {func flush() {timer?.cancel()timer = nil- guard !sending, !pending.isEmpty, isEnabled == true,+ guard !sending, !pending.isEmpty, isEnabled,let body = try? JSONEncoder().encode(Batch(api_key: Self.apiKey, batch: pending)) else { return }let sent = Set(pending.map(\.uuid))sending = true@@ -140,7 +137,7 @@ public final class Analytics {private func enqueue(_ name: String, _ distinctID: String, _ extra: [String: Value]) {var properties = Self.common.merging(extra) { $1 }- properties["$process_person_profile"] = .bool(distinctID != installID)+ properties["$process_person_profile"] = .bool(true)pending.append(Event(event: name, distinct_id: distinctID,timestamp: Date.now.ISO8601Format(), properties: properties))if pending.count > Self.maxPending { pending.removeFirst(pending.count - Self.maxPending) }diff --git a/apps/ios/Kit/Sources/CodyncKit/Client/AppEnvironment.swift b/apps/ios/Kit/Sources/CodyncKit/Client/AppEnvironment.swiftindex 62d28a3c..5579f098 100644--- a/apps/ios/Kit/Sources/CodyncKit/Client/AppEnvironment.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Client/AppEnvironment.swift@@ -11,7 +11,6 @@ public enum AppEnvironment: String, Sendable {public var appGroup: String { self == .dev ? "group.com.pokai.Codync.dev" : "group.com.pokai.Codync" }public var urlScheme: String { self == .dev ? "codync-dev" : "codync" }- public var appName: String { self == .dev ? "Codync Dev" : "Codync" }public func link(_ destination: String) -> URL {// All callers supply a fixed app route.diff --git a/apps/ios/Kit/Sources/CodyncKit/Client/CloudClient.swift b/apps/ios/Kit/Sources/CodyncKit/Client/CloudClient.swiftindex c13ddec4..0cc38d40 100644--- a/apps/ios/Kit/Sources/CodyncKit/Client/CloudClient.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Client/CloudClient.swift@@ -50,7 +50,6 @@ public struct CloudClient: Sendable {// MARK: account and devices- public func me() async throws -> CloudAccount { try await request("GET", "v1/me") }/// Registers this device key with the account (Clerk + proof of the key).public func registerDevice(name: String, platform: String) async throws {diff --git a/apps/ios/Kit/Sources/CodyncKit/Client/DeviceIdentity.swift b/apps/ios/Kit/Sources/CodyncKit/Client/DeviceIdentity.swiftindex fc9b2a9f..0eb7288a 100644--- a/apps/ios/Kit/Sources/CodyncKit/Client/DeviceIdentity.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Client/DeviceIdentity.swift@@ -82,8 +82,7 @@ public struct DeviceIdentity: Sendable {}/// Generic-password items holding 32-byte raw keys (§3.2): this device only, never synced,-/// readable after first unlock (pushes arrive while locked). macOS uses the login keychain:-/// the Mac app has no entitlements, so the data protection keychain would fail with -34018.+/// readable after first unlock (pushes arrive while locked).enum Keychain {struct Failure: LocalizedError {let status: OSStatusdiff --git a/apps/ios/Kit/Sources/CodyncKit/Client/HostClient.swift b/apps/ios/Kit/Sources/CodyncKit/Client/HostClient.swiftindex c1ea9838..b5234605 100644--- a/apps/ios/Kit/Sources/CodyncKit/Client/HostClient.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Client/HostClient.swift@@ -7,10 +7,6 @@ public enum HostEvent: Sendable {case entry(Entry)case usage(Usage)case screen(ScreenState)- /// Loopback only: devices asking this computer for access.- case accessRequests([AccessRequest])- /// Loopback only: the host's cloud connection.- case cloud(CloudStatus)case resync/// An event this app version couldn't decode (host newer/older than the app).case undecodable(type: String)@@ -100,8 +96,6 @@ public struct HostClient: Sendable {struct EntryWrap: Decodable { var entry: Entry }struct UsageWrap: Decodable { var usage: Usage }struct ScreenWrap: Decodable { var screen: ScreenState }- struct RequestsWrap: Decodable { var requests: [AccessRequest] }- struct CloudWrap: Decodable { var cloud: CloudStatus }let d = decoderguard let env = try? d.decode(Envelope.self, from: data) else { return nil }switch env.type {@@ -120,10 +114,6 @@ public struct HostClient: Sendable {return (try? d.decode(UsageWrap.self, from: data)).map { .usage($0.usage) }case "screen":return (try? d.decode(ScreenWrap.self, from: data)).map { .screen($0.screen) }- case "accessRequests":- return (try? d.decode(RequestsWrap.self, from: data)).map { .accessRequests($0.requests) }- case "cloud":- return (try? d.decode(CloudWrap.self, from: data)).map { .cloud($0.cloud) }case "resync":return .resyncdefault:@@ -137,10 +127,6 @@ public struct HostClient: Sendable {public extension HostClient {func hello() async throws -> Hello { try await call("hello") }- func sync(since: Int64) async throws -> SyncResponse {- try await call("sync", ["since": since])- }-func history(botId: String, beforeSeq: Int64, limit: Int = 100) async throws -> [Entry] {struct Body: Encodable { var botId: String; var beforeSeq: Int64; var limit: Int }struct Res: Decodable { var entries: [Entry] }diff --git a/apps/ios/Kit/Sources/CodyncKit/Client/Tailscale.swift b/apps/ios/Kit/Sources/CodyncKit/Client/Tailscale.swiftindex 91e72ea4..1f0eb706 100644--- a/apps/ios/Kit/Sources/CodyncKit/Client/Tailscale.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Client/Tailscale.swift@@ -5,14 +5,6 @@ import Foundationpublic enum Tailscale {public static let downloadURL = URL(string: "https://tailscale.com/download")!- /// A host address that only works over Tailscale (its IP range or MagicDNS name).- public static func isAddress(_ url: String) -> Bool {- guard let host = URL(string: url)?.host() else { return false }- if host.hasSuffix(".ts.net") { return true }- let o = host.split(separator: ".").compactMap { UInt8($0) }- return o.count == 4 && isRange(o[0], o[1])- }-/// Tailscale is connected on this device right now.public static var isConnected: Bool {var head: UnsafeMutablePointer<ifaddrs>?diff --git a/apps/ios/Kit/Sources/CodyncKit/Design/Motion.swift b/apps/ios/Kit/Sources/CodyncKit/Design/Motion.swiftindex 3cbc09a8..0211f7cc 100644--- a/apps/ios/Kit/Sources/CodyncKit/Design/Motion.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Design/Motion.swift@@ -17,8 +17,6 @@ public enum Motion {public static let layout = Animation.spring(duration: 0.3, bounce: 0)/// A slightly slower, critically damped spring for a new chat message and its scroll.public static let conversation = Animation.spring(duration: 0.42, bounce: 0)- /// Tiles moving into place: `{type: "spring", stiffness: 1000, damping: 63}`.- public static let tile = Animation.interpolatingSpring(mass: 1, stiffness: 1000, damping: 63)/// A Live Activity's phase change (working → needs you → done): a soft spring that/// finishes well inside the 2 s iOS gives activity updates.diff --git a/apps/ios/Kit/Sources/CodyncKit/Design/UsageBar.swift b/apps/ios/Kit/Sources/CodyncKit/Design/ProviderMascot.swiftsimilarity index 100%rename from apps/ios/Kit/Sources/CodyncKit/Design/UsageBar.swiftrename to apps/ios/Kit/Sources/CodyncKit/Design/ProviderMascot.swiftdiff --git a/apps/ios/Kit/Sources/CodyncKit/Design/Theme.swift b/apps/ios/Kit/Sources/CodyncKit/Design/Theme.swiftindex 7cdc427e..b52342fe 100644--- a/apps/ios/Kit/Sources/CodyncKit/Design/Theme.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Design/Theme.swift@@ -1,9 +1,7 @@import SwiftUIimport UIKit-private typealias PlatformColor = UIColor--private extension PlatformColor {+private extension UIColor {convenience init(hex: UInt32, alpha: CGFloat = 1) {self.init(red: CGFloat((hex >> 16) & 0xFF) / 255,diff --git a/apps/ios/Kit/Sources/CodyncKit/Models/Cloud.swift b/apps/ios/Kit/Sources/CodyncKit/Models/Cloud.swiftindex 604f829a..f13f0dbb 100644--- a/apps/ios/Kit/Sources/CodyncKit/Models/Cloud.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Models/Cloud.swift@@ -1,16 +1,8 @@import Foundation-// Wire types for the Codync cloud (`/v1`, cloud/src/api.ts), the host's loopback-only-// account methods (host/src/api/) and the relay mailbox. Times are epoch milliseconds.+// Wire types for the Codync cloud (`/v1`, cloud/src/api.ts) and the relay mailbox. Times are epoch milliseconds.// Decoding is lenient: unknown fields are ignored and anything the server may omit is optional.-/// `GET /v1/me`.-public struct CloudAccount: Codable, Hashable, Sendable {- public var userId: String- public var email: String?- public var createdAt: Int64?-}-/// A computer in the account (`GET /v1/computers`). Its `boxKey` is for display only.public struct CloudComputer: Codable, Hashable, Sendable, Identifiable {public var computerId: ComputerID@@ -70,49 +62,6 @@ public struct AccessStatus: Codable, Hashable, Sendable {public var grantId: String?}-/// A pending request as the computer shows it (loopback `accessRequests`).-public struct AccessRequest: Codable, Hashable, Sendable, Identifiable {- public var requestId: String- public var deviceKey: String- public var deviceName: String- public var platform: String?- public var email: String?- /// The SAS; nil until the phone revealed its nonce (Approve stays disabled).- public var code: String?- public var createdAt: Int64?- public var expiresAt: Int64?- public var id: String { requestId }-}--public struct CloudOwner: Codable, Hashable, Sendable {- public var userId: String- public var email: String?-}--/// The host's cloud connection (loopback `cloudStatus`, `setCloud`, `cloud` events).-public struct CloudStatus: Codable, Hashable, Sendable {- public var enabled: Bool- public var url: String?- public var registered: Bool?- public var connected: Bool?- public var owner: CloudOwner?- public var lastError: String?- /// Missing from older hosts: they always ask for the code.- public var approval: AccountApproval?-}--/// How devices on the computer's account get in (loopback `setApproval`).-public enum AccountApproval: String, Codable, Hashable, Sendable {- /// Compare the 6-digit code and approve each device at the computer.- case code- /// Let them in without anyone comparing the code.- case auto-- public init(from decoder: any Decoder) throws {- self = Self(rawValue: try decoder.singleValueContainer().decode(String.self)) ?? .code- }-}-/// `GET /v1/devices`.public struct CloudDevice: Codable, Hashable, Sendable, Identifiable {public var deviceId: Stringdiff --git a/apps/ios/Kit/Sources/CodyncKit/Models/Market.swift b/apps/ios/Kit/Sources/CodyncKit/Models/Market.swiftindex 13bf3126..acec260d 100644--- a/apps/ios/Kit/Sources/CodyncKit/Models/Market.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Models/Market.swift@@ -224,6 +224,14 @@ public extension HostClient {func removeSkill(_ id: String) async throws {let _: Empty = try await call("removeSkill", ["id": id])}++ /// A skill's `SKILL.md` without its front matter. `which` is `["id": …]` for an installed+ /// skill or `["source": …]` for one from the catalog.+ func skillDetails(_ which: [String: String]) async throws -> String {+ struct Details: Decodable { var markdown: String }+ let res: Details = try await call("skillDetails", which, timeout: 60)+ return res.markdown+ }}public struct ConnectionRequest: Codable, Hashable, Sendable {diff --git a/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift b/apps/ios/Kit/Sources/CodyncKit/Models/Models.swiftindex 5c30cad4..c36786af 100644--- a/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift@@ -281,14 +281,6 @@ public struct Hello: Codable, Sendable {public var cloud: String?}-public struct SyncResponse: Codable, Sendable {- public var hostId: String- public var rev: Int64- public var bots: [Bot]- public var entries: [Entry]- public var usage: Usage-}-public struct DirListing: Codable, Sendable {public var path: Stringpublic var parent: String?diff --git a/apps/ios/Kit/Sources/CodyncKit/Models/ScreenState.swift b/apps/ios/Kit/Sources/CodyncKit/Models/ScreenState.swiftindex 61a1a4ac..ed321511 100644--- a/apps/ios/Kit/Sources/CodyncKit/Models/ScreenState.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Models/ScreenState.swift@@ -38,7 +38,7 @@ public struct ScreenState: Codable, Equatable, Sendable {displays = try c.decodeIfPresent([ScreenDisplay].self, forKey: .displays) ?? []userControl = try c.decodeIfPresent(Bool.self, forKey: .userControl) ?? falseagentBot = try c.decodeIfPresent(String.self, forKey: .agentBot)- computerUse = try c.decodeIfPresent(Bool.self, forKey: .computerUse) ?? enabled+ computerUse = try c.decodeIfPresent(Bool.self, forKey: .computerUse) ?? falseviewers = try c.decodeIfPresent(Int.self, forKey: .viewers) ?? 0}}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swiftindex 6a1f0752..bd7678b8 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotEditorView.swift@@ -41,6 +41,10 @@ public struct BotEditorView: View {}.background(Palette.background).onAppear { if isNew { model.fillDefaults(&draft) } }+ // A new bot's connectors and skills start on once the computer has listed them.+ .onChange(of: model.installedConnectors.map(\.id) + model.installedSkills.map(\.id)) {+ if isNew { model.fillDefaults(&draft) }+ }.onChange(of: model.computer.id) {// Folders, models and connectors belong to the old computer.draft.cwd = ""@@ -77,6 +81,7 @@ struct BotSettingsForm: View {@Environment(BotStore.self) private var model@Environment(\.accessibilityReduceMotion) private var reduceMotion@State private var pickingFolder = false+ @State private var viewingSkill: SkillRef?var body: some View {ScrollView {@@ -189,7 +194,8 @@ struct BotSettingsForm: View {title: "Skills",empty: "No skills yet. Get some from Plugins, or write your own.",items: model.installedSkills.map { ($0.id, $0.name, $0.description) },- selection: Binding(get: { draft.skills ?? [] }, set: { draft.skills = $0 })+ selection: Binding(get: { draft.skills ?? [] }, set: { draft.skills = $0 }),+ info: { id in viewingSkill = model.installedSkills.first { $0.id == id }.map(SkillRef.init) })if let id = draft.id {MemoryCard(botId: id)@@ -205,6 +211,7 @@ struct BotSettingsForm: View {.scrollDismissesKeyboard(.interactively).background(Palette.background).task { await model.refreshPlugins() }+ .codyncSheet(item: $viewingSkill) { SkillSheet(skill: $0) }.codyncSheet(isPresented: $pickingFolder) {FolderPicker(start: draft.cwd.isEmpty ? model.hello?.home : draft.cwd) {draft.cwd = $0@@ -266,31 +273,6 @@ struct SwitchRow: View {}}-/// A card of on/off switches for the connectors or skills installed on the computer.-private struct PluginToggles: View {- let title: String- let empty: String- let items: [(id: String, name: String, detail: String)]- @Binding var selection: [String]-- var body: some View {- CardSection(title) {- if items.isEmpty {- Text(empty).foregroundStyle(Palette.secondary)- }- ForEach(items, id: \.id) { item in- SwitchRow(item.name, detail: item.detail.isEmpty ? nil : item.detail, isOn: Binding(- get: { selection.contains(item.id) },- set: { on in- selection.removeAll { $0 == item.id }- if on { selection.append(item.id) }- }- ))- }- }- }-}-extension View {/// A rounded input box.func fieldBox(fill: Color = Palette.background) -> some View {@@ -321,10 +303,13 @@ public extension BotStore {let first = hello?.backends.first(where: { $0.available && $0.curated == true }) {draft.backend = first.id}- // Connectors start on; left unset, the host turns on every one.+ // Connectors and skills start on; left unset, the host turns on every one.if draft.connectors == nil, !installedConnectors.isEmpty {draft.connectors = installedConnectors.map(\.id)}+ if draft.skills == nil, !installedSkills.isEmpty {+ draft.skills = installedSkills.map(\.id)+ }}}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/PluginToggles.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/PluginToggles.swiftnew file mode 100644index 00000000..fd85faee--- /dev/null+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/PluginToggles.swift@@ -0,0 +1,34 @@+import CodyncKit+import SwiftUI++/// A card of on/off switches for the connectors or skills installed on the computer.+struct PluginToggles: View {+ let title: String+ let empty: String+ let items: [(id: String, name: String, detail: String)]+ @Binding var selection: [String]+ /// Shows an item's details from an info button beside its switch.+ var info: ((_ id: String) -> Void)?++ var body: some View {+ CardSection(title) {+ if items.isEmpty {+ Text(empty).foregroundStyle(Palette.secondary)+ }+ ForEach(items, id: \.id) { item in+ HStack(spacing: 4) {+ SwitchRow(item.name, detail: item.detail.isEmpty ? nil : item.detail, isOn: Binding(+ get: { selection.contains(item.id) },+ set: { on in+ selection.removeAll { $0 == item.id }+ if on { selection.append(item.id) }+ }+ ))+ if let info {+ IconButton("About \(item.name)", systemImage: "info.circle") { info(item.id) }+ }+ }+ }+ }+ }+}diff --git a/apps/ios/Kit/Sources/CodyncUI/Chrome.swift b/apps/ios/Kit/Sources/CodyncUI/Chrome.swiftindex eb168b99..b753c4b0 100644--- a/apps/ios/Kit/Sources/CodyncUI/Chrome.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Chrome.swift@@ -2,7 +2,7 @@ import CodyncKitimport SwiftUIimport UIKit-// Codync's own screen chrome: modals, headers, icon buttons and the iPhone tab bar.+// Codync's own screen chrome: modals, headers and icon buttons.// Present with `.codyncSheet`, title with `ModalHeader` / `ScreenHeader`.// The iPhone bot list and conversation use the native navigation toolbar for Liquid Glass.// Every transition animates (Motion.layout / Motion.fade), honoring Reduce Motion.@@ -13,40 +13,33 @@ import UIKitpublic struct IconButton: View {let title: Stringlet systemImage: String- var selected: Boollet action: () -> Void- public init(_ title: String, systemImage: String, selected: Bool = false, action: @escaping () -> Void) {+ public init(_ title: String, systemImage: String, action: @escaping () -> Void) {self.title = titleself.systemImage = systemImage- self.selected = selectedself.action = action}public var body: some View {Button(title, systemImage: systemImage, action: action).labelStyle(.iconOnly)- .buttonStyle(IconButtonStyle(selected: selected))+ .buttonStyle(IconButtonStyle()).help(title)}}public struct IconButtonStyle: ButtonStyle {- var selected: Bool- var size: CGFloat+ private let size: CGFloat = 36- public init(selected: Bool = false, size: CGFloat? = nil) {- self.selected = selected- self.size = size ?? 36- }+ public init() {}public func makeBody(configuration: Configuration) -> some View {- IconButtonBody(configuration: configuration, selected: selected, size: size)+ IconButtonBody(configuration: configuration, size: size)}private struct IconButtonBody: View {let configuration: Configuration- let selected: Boollet size: CGFloat@State private var hovering = false@Environment(\.isEnabled) private var isEnabled@@ -54,17 +47,16 @@ public struct IconButtonStyle: ButtonStyle {var body: some View {configuration.label.font(.system(size: size / 2, weight: .medium))- .foregroundStyle(selected ? Palette.onAccent : hovering ? Palette.text : Palette.secondary)+ .foregroundStyle(hovering ? Palette.text : Palette.secondary).frame(width: size, height: size).background(- selected ? Palette.accentFill : Palette.text.opacity(configuration.isPressed ? 0.14 : hovering ? 0.08 : 0),+ Palette.text.opacity(configuration.isPressed ? 0.14 : hovering ? 0.08 : 0),in: RoundedRectangle(cornerRadius: size * 0.28, style: .continuous)).opacity(isEnabled ? 1 : 0.35).scaleEffect(configuration.isPressed ? Motion.pressScale : 1).animation(Motion.press, value: configuration.isPressed).animation(Motion.hover, value: hovering)- .animation(Motion.hover, value: selected).contentShape(Rectangle()).onHover { hovering = $0 }}@@ -180,7 +172,7 @@ public extension View {modifier(CodyncItemSheet(item: item, sheet: content))}- /// Presents a full-window layer the content draws itself (menus, dialogs), fading in and out.+ /// Presents a full-window layer the content draws itself (dialogs, the remote screen), fading in and out./// `close` animates it away.func codyncOverlay<Layer: View>(isPresented: Binding<Bool>, @ViewBuilder content: @escaping (_ close: @escaping () -> Void) -> Layer) -> some View {modifier(CodyncOverlay(isPresented: isPresented, layer: content))diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/InstalledView.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/InstalledView.swiftindex a77d5b24..bc1eda36 100644--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/InstalledView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/InstalledView.swift@@ -9,6 +9,7 @@ struct InstalledView: View {@Environment(\.openURL) private var openURL@State private var removing: Removal?@State private var signingIn: String?+ @State private var viewingSkill: SkillRef?private struct Removal: Identifiable {let id: String@@ -28,6 +29,7 @@ struct InstalledView: View {list}.background(Palette.background)+ .codyncSheet(item: $viewingSkill) { SkillSheet(skill: $0) }}private var list: some View {@@ -61,7 +63,7 @@ struct InstalledView: View {if !model.installedSkills.isEmpty {CardSection("Skills") {ForEach(model.installedSkills) { s in- InstalledRow(title: s.name, subtitle: s.description) {+ InstalledRow(title: s.name, subtitle: s.description, open: { viewingSkill = SkillRef(s) }) {SkillGlyph().frame(width: 32, height: 32)} accessory: {EmptyView()@@ -123,16 +125,18 @@ private struct EmptyState: View {private struct InstalledRow<Icon: View, Accessory: View>: View {let title: Stringlet subtitle: String+ /// Opens the item's details from its name.+ var open: (() -> Void)?@ViewBuilder let icon: Icon@ViewBuilder let accessory: Accessorylet remove: () -> Voidvar body: some View {HStack(spacing: 12) {- icon- VStack(alignment: .leading, spacing: 2) {- Text(title).foregroundStyle(Palette.text).lineLimit(1)- Text(subtitle).font(.caption).foregroundStyle(Palette.secondary).lineLimit(1)+ if let open {+ Button(action: open) { label }.buttonStyle(.plain)+ } else {+ label}Spacer(minLength: 12)accessory@@ -146,4 +150,15 @@ private struct InstalledRow<Icon: View, Accessory: View>: View {}.help(subtitle)}++ private var label: some View {+ HStack(spacing: 12) {+ icon+ VStack(alignment: .leading, spacing: 2) {+ Text(title).foregroundStyle(Palette.text).lineLimit(1)+ Text(subtitle).font(.caption).foregroundStyle(Palette.secondary).lineLimit(1)+ }+ }+ .contentShape(Rectangle())+ }}diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketRows.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketRows.swiftindex 8fa448e8..ed2a599a 100644--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketRows.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketRows.swift@@ -67,10 +67,14 @@ struct MarketRow<Icon: View>: View {let added: Boolvar busy = falsevar addLabel = "Add"+ /// The whole row opens the item's details; without it the row does what its button does.+ var open: (() -> Void)?@ViewBuilder let icon: Iconlet add: () -> Void@State private var hovering = false+ private var rowAction: (() -> Void)? { open ?? (added || busy ? nil : add) }+var body: some View {HStack(spacing: 14) {icon.frame(width: 46, height: 46)@@ -100,7 +104,10 @@ struct MarketRow<Icon: View>: View {}.padding(.horizontal, 12).padding(.vertical, 10)- .background(hovering ? Palette.bubbleAgent.opacity(0.6) : .clear, in: RoundedRectangle(cornerRadius: 16, style: .continuous))+ .background(hovering && rowAction != nil ? Palette.bubbleAgent.opacity(0.6) : .clear, in: RoundedRectangle(cornerRadius: 16, style: .continuous))+ .contentShape(RoundedRectangle(cornerRadius: 16, style: .continuous))+ .onTapGesture { rowAction?() }+ .accessibilityAddTraits(rowAction == nil ? [] : .isButton).onHover { h in withAnimation(Motion.hover) { hovering = h } }}}diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swiftindex dd8cbeb3..68494442 100644--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift@@ -23,6 +23,7 @@ public struct MarketplaceView: View {@State private var busySkill: String?@State private var addingConnector = false@State private var writingSkill = false+ @State private var viewingSkill: SkillRef?@State private var agent: Backend?/// Agents shown before "Load more agents".@State private var agentLimit = 10@@ -78,6 +79,7 @@ public struct MarketplaceView: View {}.codyncSheet(isPresented: $showCredentials) { CredentialsView() }.codyncSheet(isPresented: $addingConnector) { CustomConnectorSheet() }+ .codyncSheet(item: $viewingSkill) { SkillSheet(skill: $0) }.codyncSheet(isPresented: $writingSkill) { NewSkillSheet() }.codyncSheet(item: $agent) { b in AgentSheet(initial: b) }}@@ -137,7 +139,8 @@ public struct MarketplaceView: View {ItemGrid {ForEach(shownSkills) { s inlet added = s.installed || model.installedSkills.contains { $0.id == s.source.lowercased() }- MarketRow(title: s.name, subtitle: s.description, added: added, busy: busySkill == s.source) {+ MarketRow(title: s.name, subtitle: s.description, added: added, busy: busySkill == s.source,+ open: { viewingSkill = SkillRef(s, installed: added) }) {SkillGlyph()} add: {busySkill = s.sourcediff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/SkillSheet.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/SkillSheet.swiftnew file mode 100644index 00000000..b8e08b93--- /dev/null+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/SkillSheet.swift@@ -0,0 +1,107 @@+import CodyncKit+import SwiftUI++/// The skill a details sheet shows: an installed one, or one from the catalog.+struct SkillRef: Identifiable {+ let id: String+ let name: String+ let description: String+ /// A catalog skill's folder in anthropics/skills; `nil` for an installed skill.+ var source: String?+ var installed = true++ init(_ skill: InstalledSkill) {+ (id, name, description) = (skill.id, skill.name, skill.description)+ }++ init(_ skill: MarketSkill, installed: Bool) {+ (id, name, description, source, self.installed) = ("catalog/\(skill.source)", skill.name, skill.description, skill.source, installed)+ }++ /// What the host's `skillDetails` looks it up by.+ var request: [String: String] { source.map { ["source": $0] } ?? ["id": id] }+}++/// A skill's details (desktop `SkillSheet`): what it tells the bot, its `SKILL.md`, with Add+/// while it isn't installed.+struct SkillSheet: View {+ let skill: SkillRef+ @Environment(BotStore.self) private var model+ @State private var markdown: String?+ @State private var error: String?+ @State private var adding = false++ private var added: Bool {+ guard let source = skill.source else { return true }+ return skill.installed || model.installedSkills.contains { $0.id == source.lowercased() }+ }++ /// Older hosts list skills but can't show what's in them.+ private var readable: Bool { !AppVersion.isBelow(model.hello?.version ?? "", SkillCommand.minHost) }++ var body: some View {+ VStack(spacing: 0) {+ ModalHeader(skill.name) {+ if added {+ Image(systemName: "checkmark")+ .font(.subheadline.weight(.semibold))+ .foregroundStyle(Palette.secondary)+ .frame(width: 32)+ .accessibilityLabel("Added")+ } else if adding {+ Spinner()+ } else {+ IconButton("Add", systemImage: "plus") { add() }+ }+ }+ CardForm {+ if !skill.description.isEmpty {+ CardSection {+ Text(skill.description).font(.subheadline).foregroundStyle(Palette.secondary)+ }+ }+ if readable {+ CardSection("Instructions", footer: added ? "Bots read these before using the skill." : "Add it to let bots use these instructions.") {+ if let markdown {+ if markdown.isEmpty {+ Text("No instructions.").foregroundStyle(Palette.secondary)+ } else {+ MarkdownText(markdown)+ }+ } else if error == nil {+ Spinner()+ }+ }+ }+ if let error {+ CardSection {+ Text(error).font(.footnote).foregroundStyle(Palette.danger)+ }+ }+ }+ }+ .background(Palette.background)+ .task {+ guard readable else { return }+ do {+ markdown = try await model.skillDetails(skill)+ } catch {+ self.error = error.localizedDescription+ }+ }+ }++ private func add() {+ guard let source = skill.source else { return }+ adding = true+ error = nil+ Task {+ do {+ try await model.installSkill(source: source)+ } catch {+ self.error = error.localizedDescription+ }+ adding = false+ }+ }+}diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swiftindex f712f303..99b32dce 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift@@ -32,9 +32,6 @@ public final class AccountStore {/// Access requests waiting for approval on the computer, with the SAS to show.public private(set) var pendingAccess: [ComputerID: AccessTicket] = [:]public var lastError: String?- /// Signed in, ask every account computer this device can't use yet for access, without a tap.- /// Computers set to auto-approve let it straight in; the others show the code to check.- public var asksForAccess = falsepublic var selection: BotReference? {didSet { if let id = selection?.computerId, !retired { storage.lastComputerId = id } }}@@ -45,7 +42,6 @@ public final class AccountStore {/// The combined roster changed: a bot came, changed or went, or a computer did.public var onRosterChanged: (@MainActor ([RosterItem]) -> Void)?- private let clientKind: Stringprivate let cloud: CloudClient?private let computerOrder: ComputerOrderStoreprivate let makeStore: @MainActor (Computer) -> BotStore@@ -57,16 +53,15 @@ public final class AccountStore {/// Asked once per launch: a denied or cancelled request isn't repeated behind the user's back.private var asked: Set<ComputerID> = []- public convenience init(storage: SharedStore.Context, clientKind: String, cloud: CloudClient?) {- self.init(storage: storage, clientKind: clientKind, cloud: cloud) { computer in- BotStore(computer: computer, clientKind: clientKind, storage: storage)+ public convenience init(storage: SharedStore.Context, cloud: CloudClient?) {+ self.init(storage: storage, cloud: cloud) { computer in+ BotStore(computer: computer, storage: storage)}}- init(storage: SharedStore.Context, clientKind: String, cloud: CloudClient?,+ init(storage: SharedStore.Context, cloud: CloudClient?,makeStore: @escaping @MainActor (Computer) -> BotStore) {self.storage = storage- self.clientKind = clientKindself.cloud = cloudcomputerOrder = ComputerOrderStore(storage: storage)self.makeStore = makeStore@@ -147,7 +142,9 @@ public final class AccountStore {let list = try await cloud.computers()guard !retired else { return }if list != cloudComputers { Motion.animate { cloudComputers = list } }- if asksForAccess { await askForAccess() }+ // Signed in, ask every account computer this device can't use yet for access, without+ // a tap. Computers set to auto-approve let it straight in; the others show the code.+ await askForAccess()} catch let error as CloudError where !error.isTransient {lastError = error.localizedDescription} catch {diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Connection.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Connection.swiftindex 0546cef6..118ce206 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Connection.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Connection.swift@@ -22,8 +22,6 @@ extension BotStore {client = nilselection = nilscreenRequest = nil- showProfile = false- showPlugins = false}public func setActive(_ active: Bool) {diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Plugins.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Plugins.swiftindex b706613f..f4b2a5c7 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Plugins.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Plugins.swift@@ -76,6 +76,10 @@ extension BotStore {await refreshPlugins()}+ func skillDetails(_ skill: SkillRef) async throws -> String {+ try await ready().skillDetails(skill.request)+ }+/// Re-detects agents on the computer (after an install or sign-in).public func refreshBackends() async {guard let client, let backends = try? await client.refreshBackends() else { return }diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Sync.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Sync.swiftindex 42cd2d16..68cb755d 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Sync.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+Sync.swift@@ -21,7 +21,7 @@ extension BotStore {}requestedSince = revwindowFloors = [:]- for try await event in client.events(since: requestedSince, client: clientKind) {+ for try await event in client.events(since: requestedSince, client: "ios") {guard !Task.isCancelled, !retired else { return }setConnection(.online)backoff = 1@@ -133,8 +133,6 @@ extension BotStore {setUsage(u)case let .screen(s):screen = s- case .accessRequests, .cloud:- break // The computer's own screens only (loopback).case .resync:restartEvents()case let .undecodable(type):diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore.swiftindex 78b86dfd..20870199 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore.swift@@ -73,12 +73,8 @@ public final class BotStore {public var routineDrafts: [String: String] = [:]public let fileDownloads = FileDownloads()public var lastError: String?- /// The open conversation (iOS navigation path / Mac sidebar selection).+ /// The open conversation (navigation path).public var selection: String?- /// The phone's profile sheet (computers, usage); `codync://computers` opens it.- public var showProfile = false- /// The Plugins screen on its own; `codync://plugins` opens it.- public var showPlugins = false/// The remote screen viewer (iPhone); `codync://screen` opens it.public var screenRequest: ScreenRequest?@@ -94,8 +90,6 @@ public final class BotStore {/// The computer's addresses or keys changed (merged from its `hello`); persist it.var onComputerChanged: (@MainActor (Computer) -> Void)?- /// `ios` clients suppress pushes while connected; others don't.- let clientKind: Stringpublic let storage: SharedStore.Contextlet makeTransport: @MainActor () async throws -> any HostTransportvar transport: (any HostTransport)?@@ -135,18 +129,17 @@ public final class BotStore {var cacheStamp: String?/// Loads this context's `DeviceIdentity` itself.- public convenience init(computer: Computer, clientKind: String, storage: SharedStore.Context) {- self.init(computer: computer, clientKind: clientKind, storage: storage) {+ public convenience init(computer: Computer, storage: SharedStore.Context) {+ self.init(computer: computer, storage: storage) {try await HostConnector.connect(computer, identity: try DeviceIdentity.load(context: storage))}}- init(computer: Computer, clientKind: String, storage: SharedStore.Context,+ init(computer: Computer, storage: SharedStore.Context,appVersion: String = AppVersion.current,transport: @escaping @MainActor () async throws -> any HostTransport) {self.appVersion = appVersionself.computer = computer- self.clientKind = clientKindself.storage = storagemakeTransport = transportusage = storage.usage[computer.id] ?? Usage()diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swiftindex 952272d6..4e124296 100644--- a/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift@@ -4,7 +4,8 @@ import SwiftUIimport UniformTypeIdentifiers/// The message box under a chat or a thread: send, or stop while the bot (or the-/// group) is working there. In a group, typing `@` suggests its bots.+/// group) is working there. In a group, typing `@` suggests its bots; with one bot, a+/// leading `/` suggests its skills.struct Composer: View {let botId: String/// Replies go to the thread on this message.@@ -61,22 +62,34 @@ struct Composer: View {}}+ /// The bot's skills while the draft is `/partial`; not in a group, where each member has its own.+ private var skillSuggestions: [InstalledSkill] {+ guard let bot, !bot.isGroup, !AppVersion.isBelow(model.hello?.version ?? "", SkillCommand.minHost),+ let query = SkillCommand.query(draft) else { return [] }+ return SkillCommand.matches(model.installedSkills, enabled: bot.skills, query: query)+ }+var body: some View {VStack(alignment: .leading, spacing: 6) {- if !suggestions.isEmpty {+ if !suggestions.isEmpty || !skillSuggestions.isEmpty {ScrollView(.horizontal, showsIndicators: false) {HStack(spacing: 6) {ForEach(suggestions) { member in- Button { mention(member) } label: {- HStack(spacing: 6) {- CharacterAvatar(bot: member, size: 18, animated: false)- Text(member.name).font(.subheadline).foregroundStyle(Palette.text)- }- .padding(.horizontal, 10)- .padding(.vertical, 6)- .background(Palette.surface, in: Capsule())+ SuggestionChip(title: member.name) {+ CharacterAvatar(bot: member, size: 18, animated: false)+ } action: {+ mention(member)+ }+ }+ ForEach(skillSuggestions) { skill in+ SuggestionChip(title: skill.name) {+ Image(systemName: "book.pages").font(.caption).foregroundStyle(Palette.secondary)+ } action: {+ draft = "/\(skill.id) "+ focused = true}- .buttonStyle(PressScale())+ .help(skill.description)+ .accessibilityHint(skill.description)}}.padding(.horizontal, 16)@@ -86,6 +99,7 @@ struct Composer: View {field}.animation(Motion.layout, value: suggestions.map(\.id))+ .animation(Motion.layout, value: skillSuggestions.map(\.id))}private var fieldPadding: CGFloat { 10 }@@ -204,7 +218,11 @@ struct Composer: View {.onChange(of: [botId, thread], initial: true) {draft = model.composerDraft(for: botId, thread: thread)}- .onChange(of: draft) { _, value in model.setComposerDraft(value, for: botId, thread: thread) }+ .onChange(of: draft) { _, value in+ model.setComposerDraft(value, for: botId, thread: thread)+ // Starting a skill name: list the computer's skills again.+ if value == "/", bot?.isGroup == false { Task { await model.refreshPlugins() } }+ }.onChange(of: model.routineDrafts[botId]) { _, value inguard thread == nil, let value else { return }draft = draft.isEmpty ? value : draft + "\n" + value@@ -303,3 +321,23 @@ struct Composer: View {}}}++/// One suggestion above the box: a bot to @mention or a skill to start with.+private struct SuggestionChip<Icon: View>: View {+ let title: String+ @ViewBuilder let icon: Icon+ let action: () -> Void++ var body: some View {+ Button(action: action) {+ HStack(spacing: 6) {+ icon+ Text(title).font(.subheadline).foregroundStyle(Palette.text)+ }+ .padding(.horizontal, 10)+ .padding(.vertical, 6)+ .background(Palette.surface, in: Capsule())+ }+ .buttonStyle(PressScale())+ }+}diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/ConversationList.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/ConversationList.swiftindex 35fc238a..244c0c92 100644--- a/apps/ios/Kit/Sources/CodyncUI/Thread/ConversationList.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/ConversationList.swift@@ -198,8 +198,8 @@ private struct ConversationCollection: UIViewRepresentable {}private func animate(_ animation: Animation?, _ changes: @escaping () -> Void) {- if #available(iOS 18, *), animation != nil, !reduceMotion {- UIView.animate(animation ?? .default, changes: changes)+ if let animation, !reduceMotion {+ UIView.animate(animation, changes: changes)} else {changes()}diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/SkillCommand.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/SkillCommand.swiftnew file mode 100644index 00000000..75da4cd1--- /dev/null+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/SkillCommand.swift@@ -0,0 +1,23 @@+import CodyncKit++/// `/skill` in the composer: while the draft is just `/partial`, the bot's skills are offered.+/// The host turns a message starting with `/<skill id>` into "read this skill first"+/// (`host/src/market/skills.rs` `expand_command`).+enum SkillCommand {+ /// The first host that understands `/skill` messages; older ones get the text as typed.+ static let minHost = "2.14.1"++ /// The skill name being typed after a leading `/`, before any space.+ static func query(_ draft: String) -> String? {+ guard draft.hasPrefix("/"), !draft.contains(where: \.isWhitespace) else { return nil }+ return String(draft.dropFirst())+ }++ /// The bot's skills (ids in `enabled`) whose id or name holds `query`.+ static func matches(_ installed: [InstalledSkill], enabled: [String], query: String) -> [InstalledSkill] {+ installed.filter {+ enabled.contains($0.id)+ && (query.isEmpty || $0.id.localizedCaseInsensitiveContains(query) || $0.name.localizedCaseInsensitiveContains(query))+ }+ }+}diff --git a/apps/ios/Kit/Sources/CodyncUI/Usage/UsageViews.swift b/apps/ios/Kit/Sources/CodyncUI/Usage/UsageViews.swiftdeleted file mode 100644index 518b40d7..00000000--- a/apps/ios/Kit/Sources/CodyncUI/Usage/UsageViews.swift+++ /dev/null@@ -1,2 +0,0 @@-import CodyncKit-import SwiftUIdiff --git a/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swiftindex 101c8b02..88df790f 100644--- a/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift+++ b/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift@@ -3,24 +3,25 @@ import Testing@testable import CodyncKit@MainActor-@Test func analyticsRecordsOnlyWhenEnabledAndIdentifiesAccountsOnce() throws {+@Test func analyticsIsOnByDefaultAndIdentifiesAccountsOnce() throws {let defaults = try #require(UserDefaults(suiteName: "AnalyticsTests-\(UUID())"))let analytics = Analytics(defaults: defaults) { _ in false }- // Not asked yet: held until the answer. Declined: dropped, and nothing more recorded.+ // On until turned off; off drops what's queued and records nothing more.+ #expect(analytics.isEnabled)analytics.capture(.appOpened)#expect(analytics.pending.map(\.event) == ["app_opened"])analytics.setEnabled(false)analytics.capture(.appOpened)#expect(analytics.pending.isEmpty)- // Anonymous: the install ID, no person profile, the common properties.+ // Signed out: the install ID with its own person profile, the common properties.analytics.setEnabled(true)analytics.capture(.computerPaired, ["via": "qr"])let anon = try #require(analytics.pending.first)#expect(anon.event == "computer_paired")#expect(anon.properties["via"] == .string("qr"))- #expect(anon.properties["$process_person_profile"] == .bool(false))+ #expect(anon.properties["$process_person_profile"] == .bool(true))#expect(anon.properties["$lib"] == .string("codync-ios"))#expect(anon.properties["$os"] == .string("iOS"))#expect(anon.properties["$geoip_disable"] == .bool(true))diff --git a/apps/ios/Kit/Tests/CodyncKitTests/AppFontTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/AppFontTests.swiftdeleted file mode 100644index 167b2c53..00000000--- a/apps/ios/Kit/Tests/CodyncKitTests/AppFontTests.swift+++ /dev/null@@ -1,4 +0,0 @@-import SwiftUI-import Testing-@testable import CodyncKit-diff --git a/apps/ios/Kit/Tests/CodyncKitTests/ChannelTransportTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/ChannelTransportTests.swiftindex 54c0d614..391d59e7 100644--- a/apps/ios/Kit/Tests/CodyncKitTests/ChannelTransportTests.swift+++ b/apps/ios/Kit/Tests/CodyncKitTests/ChannelTransportTests.swift@@ -130,7 +130,7 @@ private func fakeDialer() -> (Dialer, AsyncStream<FakeSocket>) {private func helloBody() -> [String: Any] { ["hostId": "h1", "name": "Studio", "version": "3.0.0", "os": "macos", "backends": [], "rev": 0,"computerId": v.str("keys", "computerId"), "signKey": v.str("keys", "hostSignPub"), "boxKey": v.str("keys", "hostBoxPub"),- "urls": ["http://10.0.0.2:19222"], "cloud": "https://cloud.example.dev", "device": "macstudio", "protocol": 1,+ "urls": ["http://10.0.0.2:19222"], "cloud": "https://cloud.example.dev", "device": "macstudio",] }private func waitFor(_ states: AsyncStream<LinkState>, _ match: (LinkState) -> Bool) async -> LinkState? {diff --git a/apps/ios/Kit/Tests/CodyncKitTests/CodyncKitTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/CodyncKitTests.swiftindex 617abf22..3a54499c 100644--- a/apps/ios/Kit/Tests/CodyncKitTests/CodyncKitTests.swift+++ b/apps/ios/Kit/Tests/CodyncKitTests/CodyncKitTests.swift@@ -62,13 +62,6 @@ import Testing#expect(v.zoom == v.maxZoom && v.scale == 4)}-@Test func tailscaleAddresses() {- #expect(Tailscale.isAddress("http://100.101.2.3:19222"))- #expect(Tailscale.isAddress("http://mac.tail1234.ts.net:19222"))- #expect(!Tailscale.isAddress("http://100.200.2.3:19222"))- #expect(!Tailscale.isAddress("http://192.168.1.5:19222"))-}-@Test func parsesClaudeResetText() throws {let taipei = try #require(TimeZone(identifier: "Asia/Taipei"))var cal = Calendar(identifier: .gregorian)diff --git a/apps/ios/Kit/Tests/CodyncUITests/BotDeletionSyncTests.swift b/apps/ios/Kit/Tests/CodyncUITests/BotDeletionSyncTests.swiftindex dba2af8c..e7a0cb96 100644--- a/apps/ios/Kit/Tests/CodyncUITests/BotDeletionSyncTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/BotDeletionSyncTests.swift@@ -10,7 +10,7 @@ import Testinglet computer = Computer(id: UUID().uuidString, name: "Mac", signKey: "test")let fake = FakeRemote(.ready(.direct))await fake.setHello(#"{"hostId":"h1","name":"Mac","version":"\#(VersionMismatch.minHost)","os":"macos","backends":[],"rev":10}"#)- let store = BotStore(computer: computer, clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: computer, storage: storage) { fake }defer { store.retire() }let bot = try JSONDecoder().decode(Bot.self, from: Data(#"{"id":"gone","name":"Deleted while offline","rev":9}"#.utf8))let entry = try JSONDecoder().decode(Entry.self, from: Data(#"{"id":"e1","botId":"gone","seq":1,"rev":8,"kind":"user","turn":1,"data":{"text":"cached"},"createdAt":1,"updatedAt":1}"#.utf8))@@ -43,7 +43,7 @@ import Testing#expect(store.composerDraft(for: bot.id).isEmpty)#expect(store.composerDraft(for: bot.id, thread: "root").isEmpty)store.saveCache()- let restored = BotStore(computer: computer, clientKind: "ios", storage: storage) { fake }+ let restored = BotStore(computer: computer, storage: storage) { fake }defer { restored.retire() }#expect(restored.bots[bot.id] == nil)#expect(restored.chat(bot.id).isEmpty)diff --git a/apps/ios/Kit/Tests/CodyncUITests/ComputerAccessIsolationTests.swift b/apps/ios/Kit/Tests/CodyncUITests/ComputerAccessIsolationTests.swiftindex 4ebb2d10..37df4004 100644--- a/apps/ios/Kit/Tests/CodyncUITests/ComputerAccessIsolationTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/ComputerAccessIsolationTests.swift@@ -24,9 +24,9 @@ func phoneRosterUsesItsOwnPairingsNotUnavailableOrderEntries(hasIndependentAccesstorage.computerOrder = ComputerOrder(ids: [b.id, a.id])var opened: [ComputerID] = []let bot = try JSONDecoder().decode(Bot.self, from: Data(#"{"id":"same-bot-id","name":"Local bot","rev":1}"#.utf8))- let accounts = AccountStore(storage: storage, clientKind: "ios", cloud: nil) { computer in+ let accounts = AccountStore(storage: storage, cloud: nil) { computer inopened.append(computer.id)- let store = BotStore(computer: computer, clientKind: "ios", storage: storage) { FakeRemote(.connecting) }+ let store = BotStore(computer: computer, storage: storage) { FakeRemote(.connecting) }store.bots[bot.id] = botreturn store}@@ -50,8 +50,8 @@ func phoneRosterUsesItsOwnPairingsNotUnavailableOrderEntries(hasIndependentAcceslet b = isolationComputer("B", keyByte: 2)storage.computers = [a, b]storage.computerOrder = ComputerOrder(ids: [b.id, a.id])- let accounts = AccountStore(storage: storage, clientKind: "ios", cloud: nil) { computer in- BotStore(computer: computer, clientKind: "ios", storage: storage) { FakeRemote(.connecting) }+ let accounts = AccountStore(storage: storage, cloud: nil) { computer in+ BotStore(computer: computer, storage: storage) { FakeRemote(.connecting) }}defer { accounts.retire() }accounts.setActive(false)diff --git a/apps/ios/Kit/Tests/CodyncUITests/FileDownloadTests.swift b/apps/ios/Kit/Tests/CodyncUITests/FileDownloadTests.swiftindex b5a1eb97..28fbae21 100644--- a/apps/ios/Kit/Tests/CodyncUITests/FileDownloadTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/FileDownloadTests.swift@@ -40,7 +40,7 @@ private actor DelayedFileTransport: HostTransport {guard let directory = ProcessInfo.processInfo.environment["CODYNC_RENDER_DIR"] else { return }let suite = "CodyncFileCardRender.\(UUID().uuidString)"defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }- let store = BotStore(computer: Computer(id: "render", name: "Computer", signKey: "", boxKey: "", cloud: nil), clientKind: "ios", storage: SharedStore.Context(accountID: "render", suite: suite)) { FakeRemote(.connecting) }+ let store = BotStore(computer: Computer(id: "render", name: "Computer", signKey: "", boxKey: "", cloud: nil), storage: SharedStore.Context(accountID: "render", suite: suite)) { FakeRemote(.connecting) }defer { store.retire() }func entry(_ name: String, size: Int64) -> Entry {var data = EntryData(text: "\(name) (\(size) bytes)")diff --git a/apps/ios/Kit/Tests/CodyncUITests/HistoryPagingTests.swift b/apps/ios/Kit/Tests/CodyncUITests/HistoryPagingTests.swiftindex 8d45b084..daf4be5e 100644--- a/apps/ios/Kit/Tests/CodyncUITests/HistoryPagingTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/HistoryPagingTests.swift@@ -8,7 +8,7 @@ import Testinglet storage = SharedStore.Context(accountID: UUID().uuidString, suite: suite)defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let computer = Computer(id: "history", name: "Test", signKey: "")- let store = BotStore(computer: computer, clientKind: "ios", storage: storage) { throw HostError.unreachable }+ let store = BotStore(computer: computer, storage: storage) { throw HostError.unreachable }defer { store.retire() }store.entries["b"] = (0..<200).map { index inEntry(id: "e\(index)", seq: Int64(index + 100), botId: "b", threadId: index < 6 ? nil : "root",@@ -28,7 +28,7 @@ import Testinglet storage = SharedStore.Context(accountID: UUID().uuidString, suite: suite)defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let computer = Computer(id: "history", name: "Test", signKey: "")- let store = BotStore(computer: computer, clientKind: "ios", storage: storage) { throw HostError.unreachable }+ let store = BotStore(computer: computer, storage: storage) { throw HostError.unreachable }defer { store.retire() }#expect(!store.canLoadOlder("b"))store.entries["b"] = [Entry(id: "local-draft", seq: Int64.max, botId: "b", rev: 1, kind: "user", turn: 0,diff --git a/apps/ios/Kit/Tests/CodyncUITests/RosterOrderTests.swift b/apps/ios/Kit/Tests/CodyncUITests/RosterOrderTests.swiftindex ed713ab9..edd9d3ef 100644--- a/apps/ios/Kit/Tests/CodyncUITests/RosterOrderTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/RosterOrderTests.swift@@ -7,7 +7,7 @@ import Testinglet suite = "RosterOrderTests.\(UUID().uuidString)"defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let storage = SharedStore.Context(accountID: UUID().uuidString, suite: suite)- let store = BotStore(computer: Computer(id: UUID().uuidString, name: "Mac", signKey: "test"), clientKind: "ios", storage: storage) {+ let store = BotStore(computer: Computer(id: UUID().uuidString, name: "Mac", signKey: "test"), storage: storage) {FakeRemote(.connecting)}defer { store.retire() }diff --git a/apps/ios/Kit/Tests/CodyncUITests/SkillCommandTests.swift b/apps/ios/Kit/Tests/CodyncUITests/SkillCommandTests.swiftnew file mode 100644index 00000000..6662765a--- /dev/null+++ b/apps/ios/Kit/Tests/CodyncUITests/SkillCommandTests.swift@@ -0,0 +1,16 @@+import Testing+@testable import CodyncKit+@testable import CodyncUI++@Test func aLeadingSlashOffersTheBotsSkills() {+ #expect(SkillCommand.query("/") == "")+ #expect(SkillCommand.query("/pd") == "pd")+ #expect(SkillCommand.query("/pdf merge") == nil)+ #expect(SkillCommand.query("hi /pdf") == nil)+ let installed = [("pdf", "PDF"), ("code-review", "Code Review"), ("xlsx", "xlsx")].map {+ InstalledSkill(id: $0.0, name: $0.1, description: "", source: "custom", path: "")+ }+ #expect(SkillCommand.matches(installed, enabled: ["pdf", "code-review"], query: "").map(\.id) == ["pdf", "code-review"])+ #expect(SkillCommand.matches(installed, enabled: ["pdf", "code-review"], query: "review").map(\.id) == ["code-review"])+ #expect(SkillCommand.matches(installed, enabled: ["pdf"], query: "xl").isEmpty)+}diff --git a/apps/ios/Kit/Tests/CodyncUITests/StoreTests.swift b/apps/ios/Kit/Tests/CodyncUITests/StoreTests.swiftindex 36066893..634f4da9 100644--- a/apps/ios/Kit/Tests/CodyncUITests/StoreTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/StoreTests.swift@@ -148,7 +148,7 @@ private func botEvent(_ id: String, name: String, rev: Int) -> String {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -187,7 +187,7 @@ private func botEvent(_ id: String, name: String, rev: Int) -> String {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.relay))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -208,7 +208,7 @@ private func botEvent(_ id: String, name: String, rev: Int) -> String {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }store.setActive(true)#expect(await until { await fake.subscribed })await fake.emit(botEvent("b1", name: "Bot", rev: 1))@@ -230,7 +230,7 @@ private func botEvent(_ id: String, name: String, rev: Int) -> String {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.hostOffline(lastSeen: nil))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }store.setActive(true)#expect(await until { store.connection == .computerOffline(lastSeen: nil) })#expect(store.canQueue && store.isOffline)@@ -278,8 +278,8 @@ private func botEvent(_ id: String, name: String, rev: Int) -> String {let c2 = randomComputer("Linux box")storage.computers = [c1, c2]let fakes = [c1.id: FakeRemote(.ready(.direct)), c2.id: FakeRemote(.ready(.relay))]- let account = AccountStore(storage: storage, clientKind: "ios", cloud: nil) { computer in- BotStore(computer: computer, clientKind: "ios", storage: storage) { fakes[computer.id]! }+ let account = AccountStore(storage: storage, cloud: nil) { computer in+ BotStore(computer: computer, storage: storage) { fakes[computer.id]! }}var updates: [BotReference] = []account.onBotUpdated = { ref, _ in updates.append(ref) }@@ -318,8 +318,8 @@ private func botEvent(_ id: String, name: String, rev: Int) -> String {defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let a = randomComputer("A"), b = randomComputer("B"), c = randomComputer("C")storage.computers = [a, b, c]- let account = AccountStore(storage: storage, clientKind: "ios", cloud: nil) { computer in- BotStore(computer: computer, clientKind: "ios", storage: storage) { FakeRemote(.ready(.direct)) }+ let account = AccountStore(storage: storage, cloud: nil) { computer in+ BotStore(computer: computer, storage: storage) { FakeRemote(.ready(.direct)) }}account.move(a.id, to: c.id)#expect(account.computers.map(\.id) == [b.id, c.id, a.id])@@ -335,8 +335,8 @@ private func botEvent(_ id: String, name: String, rev: Int) -> String {defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let saved = randomComputer("Saved")storage.computers = [saved]- let account = AccountStore(storage: storage, clientKind: "ios", cloud: nil) { _ in- BotStore(computer: saved, clientKind: "ios", storage: storage) { FakeRemote(.ready(.direct)) }+ let account = AccountStore(storage: storage, cloud: nil) { _ in+ BotStore(computer: saved, storage: storage) { FakeRemote(.ready(.direct)) }}account.setColor(saved.id, "red")#expect(storage.computers.first?.color == "red")@@ -354,7 +354,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }store.setActive(true)defer { store.setActive(false) }#expect(await until { await fake.subscribed })@@ -387,7 +387,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "mac", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }store.setActive(true)defer { store.setActive(false) }#expect(await until { await fake.subscribed })@@ -413,7 +413,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.hostOffline(lastSeen: nil))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)try await Task.sleep(for: .milliseconds(200))@@ -431,7 +431,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.failed("Can't reach"))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)try await Task.sleep(for: .milliseconds(200))@@ -444,7 +444,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -472,7 +472,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -496,7 +496,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -520,7 +520,7 @@ extension FakeRemote {let down = FakeRemote(.failed("Can't reach"))let up = FakeRemote(.ready(.relay))var made = 0- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) {+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) {made += 1return made == 1 ? down : up}@@ -538,7 +538,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -561,7 +561,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -597,7 +597,7 @@ extension FakeRemote {let (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -623,7 +623,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: Stringdefer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.relay))await fake.setHello(helloJSON(version: "2.6.0", minApp: "2.5.0"))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage, appVersion: "2.4.0") { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage, appVersion: "2.4.0") { fake }defer { store.retire() }store.setActive(true)#expect(await until { store.mismatch == .updateApp(minimum: "2.5.0") })@@ -638,7 +638,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: Stringdefer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.relay))await fake.setHello(helloJSON(version: "2.2.0"))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage, appVersion: "2.12.0") { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage, appVersion: "2.12.0") { fake }defer { store.retire() }store.setActive(true)#expect(await until { store.mismatch == .updateHost(version: "2.2.0", minimum: VersionMismatch.minHost) })@@ -658,7 +658,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: Stringfor minApp in ["2.14.0", "2.0.0"] {let fake = FakeRemote(.ready(.relay))await fake.setHello(helloJSON(version: "2.14.0", minApp: minApp, backends: #""changed shape""#))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage, appVersion: "2.12.0") { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage, appVersion: "2.12.0") { fake }store.setActive(true)#expect(await until { store.mismatch == .updateApp(minimum: "2.14.0") }, "minApp \(minApp)")#expect(store.hello == nil)@@ -672,7 +672,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: Stringfor (hostVersion, appIsBehind) in [("2.14.0", true), ("2.12.0", false)] {let fake = FakeRemote(.ready(.relay))await fake.setHello(helloJSON(version: hostVersion, minApp: "2.3.0"))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage, appVersion: "2.12.0") { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage, appVersion: "2.12.0") { fake }store.setActive(true)let broken = #"{"type":"bot","bot":{"id":"b1","name":7}}"##expect(await until { await fake.eventSubscriptionCount == 1 })@@ -694,7 +694,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: Stringlet (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let computer = randomComputer("Mac")- let store = BotStore(computer: computer, clientKind: "ios", storage: storage) { FakeRemote(.connecting) }+ let store = BotStore(computer: computer, storage: storage) { FakeRemote(.connecting) }let text = " 中文\nunfinished 🐱\n"store.setComposerDraft(text, for: "first")store.setComposerDraft("Other draft", for: "second")@@ -703,7 +703,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: String#expect(store.composerDraft(for: "first") == text)store.retire()store.setComposerDraft("late edit", for: "first")- let reopened = BotStore(computer: computer, clientKind: "ios", storage: storage) { FakeRemote(.connecting) }+ let reopened = BotStore(computer: computer, storage: storage) { FakeRemote(.connecting) }defer { reopened.retire() }#expect(reopened.composerDraft(for: "first") == text)#expect(reopened.composerDraft(for: "first", thread: "root") == "Reply")@@ -711,7 +711,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: String#expect(reopened.composerDraft(for: "first").isEmpty)#expect(reopened.composerDraft(for: "second") == "Other draft")#expect(reopened.composerDraft(for: "first", thread: "root") == "Reply")- let other = BotStore(computer: randomComputer("Other"), clientKind: "ios", storage: storage) { FakeRemote(.connecting) }+ let other = BotStore(computer: randomComputer("Other"), storage: storage) { FakeRemote(.connecting) }defer { other.retire() }#expect(other.composerDraft(for: "first").isEmpty)storage.erase()@@ -722,7 +722,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: Stringlet (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.setActive(true)#expect(await until { await fake.subscribed })@@ -757,7 +757,7 @@ private func helloJSON(version: String, minApp: String? = nil, backends: String]}"""#try Data(cached.utf8).write(to: url)- let store = BotStore(computer: computer, clientKind: "ios", storage: storage) { FakeRemote(.ready(.direct)) }+ let store = BotStore(computer: computer, storage: storage) { FakeRemote(.ready(.direct)) }defer { store.retire() }// Adding conversation metadata does not invalidate the existing base cache.#expect(store.allEntries("dex").map(\.id) == ["notice", "local-pending"])@@ -793,7 +793,7 @@ private func windowEntry(_ id: String, seq: Int64, rev: Int64 = 1, threadId: Strlet (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.upsert(windowEntry("e100", seq: 100))store.upsert(windowEntry("local-1", seq: 0)) // optimistic: not a floor@@ -821,7 +821,7 @@ private func windowEntry(_ id: String, seq: Int64, rev: Int64 = 1, threadId: Strlet (storage, suite) = context()defer { UserDefaults(suiteName: suite)?.removePersistentDomain(forName: suite) }let fake = FakeRemote(.ready(.direct))- let store = BotStore(computer: randomComputer("Mac"), clientKind: "ios", storage: storage) { fake }+ let store = BotStore(computer: randomComputer("Mac"), storage: storage) { fake }defer { store.retire() }store.upsert(windowEntry("sent", seq: 100)) // RPC response before the catch-upstore.setActive(true)diff --git a/apps/ios/Kit/Tests/CodyncUITests/VoiceSettingsTests.swift b/apps/ios/Kit/Tests/CodyncUITests/VoiceSettingsTests.swiftindex a365ddbe..0e912a62 100644--- a/apps/ios/Kit/Tests/CodyncUITests/VoiceSettingsTests.swift+++ b/apps/ios/Kit/Tests/CodyncUITests/VoiceSettingsTests.swift@@ -14,7 +14,7 @@ import Testing#expect(VoiceSettings.transcribeModel(p) == p.transcribeModel)let status = try JSONDecoder().decode(VoiceStatus.self, from: Data("""- {"providers":[{"provider":"gemini","configured":true,"defaultModel":"gemini-9-live",+ {"providers":[{"provider":"gemini","configured":true,"defaults":{"realtime":"gemini-9-live","transcribe":"gemini-9-flash","speech":"gemini-9-flash-tts"}}]}""".utf8))VoiceSettings.remember(status)diff --git a/apps/ios/Resources/PrivacyInfo.xcprivacy b/apps/ios/Resources/PrivacyInfo.xcprivacyindex 09509655..71f760b9 100644--- a/apps/ios/Resources/PrivacyInfo.xcprivacy+++ b/apps/ios/Resources/PrivacyInfo.xcprivacy@@ -8,7 +8,7 @@<array/><key>NSPrivacyCollectedDataTypes</key><array>- <!-- Opt-in usage analytics (Settings → Share usage analytics), linked to the Codync account when signed in. -->+ <!-- Usage analytics, on unless turned off (Settings → Share usage analytics), linked to the Codync account when signed in. --><dict><key>NSPrivacyCollectedDataType</key><string>NSPrivacyCollectedDataTypeProductInteraction</string>diff --git a/apps/ios/Views/SettingsView.swift b/apps/ios/Views/SettingsView.swiftindex f02e56d4..d39f4395 100644--- a/apps/ios/Views/SettingsView.swift+++ b/apps/ios/Views/SettingsView.swift@@ -13,7 +13,7 @@ struct SettingsView: View {@Environment(\.openURL) private var openURL@State private var notificationsAllowed: Bool?@AppStorage("notificationsEnabled") private var notificationsEnabled = true- @AppStorage(Analytics.enabledKey) private var analyticsEnabled: Bool?+ @AppStorage(Analytics.enabledKey) private var analyticsEnabled = true@State private var addingComputer = false@State private var confirmForget: Computer?@State private var confirmRevoke: CloudComputer?@@ -77,8 +77,8 @@ struct SettingsView: View {notificationsRow}- CardSection(footer: "Which features you use, never your messages, code or files. Private, used only to improve Codync.") {- Toggle("Share usage analytics", isOn: Binding(get: { analyticsEnabled == true },+ CardSection(footer: "Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.") {+ Toggle("Share usage analytics", isOn: Binding(get: { analyticsEnabled },set: { Analytics.shared.setEnabled($0) })).toggleStyle(.codync)}diff --git a/apps/ios/Views/WidgetGalleryView.swift b/apps/ios/Views/WidgetGalleryView.swiftindex 81ec8ebf..dab89ad8 100644--- a/apps/ios/Views/WidgetGalleryView.swift+++ b/apps/ios/Views/WidgetGalleryView.swift@@ -120,7 +120,7 @@ struct WidgetGalleryView: View {get: { usageIconStyle },set: { usageIconStyle = $0; WidgetCenter.shared.reloadTimelines(ofKind: "CodyncProviderUsage") }), options: [(UsageIconStyle.character.rawValue, "Character"), (UsageIconStyle.original.rawValue, "Original icon")])- Text("Applies to Usage on iPhone and in the Mac menu bar.")+ Text("Applies to Usage in the app and in widgets.").font(.caption).foregroundStyle(Palette.secondary)}diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.mdindex 38f70244..58252092 100644--- a/apps/ios/WhatsNew.md+++ b/apps/ios/WhatsNew.md@@ -5,14 +5,22 @@ listing what iPhone users notice. tools/asc-submit.py reads the released versiona version without one gets a generic "Bug fixes and improvements" line. Delete old sections.-->-## 2.14.0+## 2.14.1### zh-Hant-- 同一台電腦上的 bot 可以自己排順序:按住一列再拖到想要的位置。釘選的 bot 仍在最上面,排好的順序會同步到你的每台裝置。-- 新增 bot 時,預設會選電腦上已安裝、Codync 認得的 agent,不再挑到沒聽過的 agent。+- 修正小工具頁面上圖示樣式的說明文字。+- 使用情況分析改為預設開啟,幫助我們更快發現 bug、把服務做得更好:只記錄用了哪些功能,從不包含你的訊息、程式碼或檔案。可隨時在「設定」關閉。+- 安裝的技能會自動在每個 bot 開啟,新 bot 也預設全開;不需要的可以在 bot 設定關掉。+- 在訊息開頭輸入「/」可以選這個 bot 的技能,讓它照那個技能做事。+- 點一下技能就能看完整說明,再決定要不要加入。+- 其他小幅改進。### en-US-- Arrange the bots on a computer your way: touch and hold a row, then drag it where you want it. Pinned bots stay on top, and the order syncs to all your devices.-- A new bot now starts with an agent that's installed on your computer and that Codync knows, instead of an unfamiliar one.+- Fixed the description of the icon style on the Widgets page.+- Usage analytics are now on by default, to help us spot bugs sooner and serve you better: only which features you use, never your messages, code or files. Turn them off anytime in Settings.+- Skills you install are now on for every bot, and new bots start with all of them; turn one off in a bot's settings.+- Type "/" at the start of a message to pick one of the bot's skills for that request.+- Tap a skill to read its full instructions before you add it.+- Other small improvements.diff --git a/apps/project.yml b/apps/project.ymlindex 2d973616..35017a0b 100644--- a/apps/project.yml+++ b/apps/project.yml@@ -25,7 +25,7 @@ configs:DevRelease: releasesettings:base:- MARKETING_VERSION: 2.14.0+ MARKETING_VERSION: 2.14.1CURRENT_PROJECT_VERSION: 24SWIFT_VERSION: "6.0"SWIFT_STRICT_CONCURRENCY: completediff --git a/apps/screen-linux/Cargo.lock b/apps/screen-linux/Cargo.lockindex 59b417fa..aff12e2a 100644--- a/apps/screen-linux/Cargo.lock+++ b/apps/screen-linux/Cargo.lock@@ -299,7 +299,6 @@ dependencies = ["gstreamer-app","gstreamer-sdp","gstreamer-webrtc",- "serde","serde_json","tokio","tracing",diff --git a/apps/screen-linux/Cargo.toml b/apps/screen-linux/Cargo.tomlindex d948fcea..d166d43c 100644--- a/apps/screen-linux/Cargo.toml+++ b/apps/screen-linux/Cargo.toml@@ -16,7 +16,6 @@ gst = { package = "gstreamer", version = "0.25" }gst-app = { package = "gstreamer-app", version = "0.25" }gst-sdp = { package = "gstreamer-sdp", version = "0.25" }gst-webrtc = { package = "gstreamer-webrtc", version = "0.25", features = ["v1_22"] }-serde = { version = "1", features = ["derive"] }serde_json = "1"tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "io-util", "sync", "time", "process"] }tracing = "0.1"diff --git a/apps/screen-linux/src/portal.rs b/apps/screen-linux/src/portal.rsindex 931ef4a4..11d2aff4 100644--- a/apps/screen-linux/src/portal.rs+++ b/apps/screen-linux/src/portal.rs@@ -136,7 +136,6 @@ impl Portal {json!({"platform": "linux","permissionApp": "Codync Screen",- "version": env!("CARGO_PKG_VERSION"),"capture": self.is_active(),"input": self.has_input(),"displays": self.0.displays.iter().map(|d| json!({diff --git a/apps/screen-macos/ScreenHelper.swift b/apps/screen-macos/ScreenHelper.swiftindex ab9ab09a..2f32269f 100644--- a/apps/screen-macos/ScreenHelper.swift+++ b/apps/screen-macos/ScreenHelper.swift@@ -141,7 +141,6 @@ final class ScreenHelper {let status: [String: AnyHashable] = ["platform": "macos","permissionApp": Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String ?? "Codync Screen",- "version": Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "","displays": displays,"capture": CGPreflightScreenCaptureAccess(),"input": AXIsProcessTrusted(),diff --git a/cloud/README.md b/cloud/README.mdindex 658cc196..d77244a0 100644--- a/cloud/README.md+++ b/cloud/README.md@@ -5,7 +5,7 @@ Cloudflare Worker for accounts and the off-LAN relay (spec: [docs/reference/remo- **`/v1` API** (`src/api.ts`, route groups in `src/routes/`): Clerk-authenticated account routes (devices, claims, computers, accessrequests, grants), `Codync-Sig`-authenticated host routes (`/v1/host/*`), the Clerk webhook, and a15-minute cron that expires requests and prunes nonces, and the public routine webhook route- `POST /v1/hooks/:computerId/:routineId` (spec §7.8). D1 schema: `migrations/0001_init.sql`.+ `POST /v1/hooks/:computerId/:routineId` (spec §7.8). D1 schema: `migrations/` (later files rebuild some tables).- **`ComputerRelay`** (`src/relay.ts`): one Durable Object per computer (SQLite storage, WebSocketHibernation). It admits device sockets against the host-signed ACL, forwards channel frames it can'tread, reports presence, holds the offline mailbox, and queues routine webhook deliveries (`hookbox`,diff --git a/cloud/migrations/0004_computer_order.sql b/cloud/migrations/0004_computer_order.sqldeleted file mode 100644index 596ed64e..00000000--- a/cloud/migrations/0004_computer_order.sql+++ /dev/null@@ -1,2 +0,0 @@--- Historical migration, already deployed. Ordering is now device-local; this column is unused.-ALTER TABLE accounts ADD COLUMN computer_order TEXT;diff --git a/cloud/test/computer-order.test.ts b/cloud/test/computer-order.test.tsdeleted file mode 100644index 826f676f..00000000--- a/cloud/test/computer-order.test.ts+++ /dev/null@@ -1,12 +0,0 @@-import { describe, expect, it } from "vitest";-import { call, clerkToken } from "./helpers";--describe("device-local computer order", () => {- it("does not expose account-wide ordering endpoints", async () => {- const id = `user_${crypto.randomUUID()}`;- const token = await clerkToken(id);- const path = `/v1/accounts/${id}/computer-order`;- expect((await call("GET", path, { token })).status).toBe(404);- expect((await call("PUT", path, { token, body: { computerIds: ["mini", "ssh"] } })).status).toBe(404);- });-});diff --git a/docs/README.md b/docs/README.mdindex 1f136613..b797a203 100644--- a/docs/README.md+++ b/docs/README.md@@ -31,6 +31,7 @@ Source review, a passing build, local integration tests and production acceptanc- [Remote screen](features/remote-screen.md)- [Marketplace and agent setup](features/marketplace.md)- [Connector setup and credentials](features/connector-credentials.md)+- [Routines](features/routines.md)- [Widgets, Live Activities and onboarding](design/mobile-widgets.md)- [Notifications and background Live Activity updates](design/push-and-live-activity.md)@@ -60,13 +61,3 @@ Service-local entry points remain in [cloud/README.md](../cloud/README.md) and [6. Record verification scope and limitations. Do not turn an old test report or historical audit into a current passing status.[Archived plans and audits](archive/README.md) retain earlier decisions and review context. Their original dates, line numbers and proposed APIs are historical.--## Documentation validation — 2026-09-26--- Checked 27 Markdown files and 112 local link targets; none were missing.-- Shared fixture SHA-256 is unchanged; the Python generator reproduced it byte for byte.-- Focused fixture/crypto checks passed: Swift 14 tests; Rust 12 tests across library/binary targets; Cloudflare vectors/relay 43 tests.-- `git diff --check` passed. These checks validate the documentation move and its executable consumers, not the deployed Cloudflare path.-- Wrangler reported a production route placement warning; see [environment readiness](guides/environments-and-deployment.md). Deployed-device acceptance remains separate.--- [Routines](features/routines.md): scheduled and webhook-triggered bot work, Apple UI, execution history and reference parity.diff --git a/docs/architecture/desktop-app.md b/docs/architecture/desktop-app.mdindex 545eec60..9d24ca95 100644--- a/docs/architecture/desktop-app.md+++ b/docs/architecture/desktop-app.md@@ -16,7 +16,7 @@ determines when there are no earlier messages.as it streams needed an AppKit scroll view with hand-managed row hosting to stay usable. Abrowser engine lays out and scrolls long text natively.- **Two desktop apps were too much to keep in step.** Every UI change had to land in SwiftUI- and in GTK. One TypeScript app now covers both platforms (and Windows later, if wanted).+ and in GTK. One TypeScript app now covers macOS, Linux and Windows.- The iPhone app has no such alternative and keeps SwiftUI, so `kit/` lost its secondplatform and became the iPhone app's own package.@@ -153,22 +153,7 @@ a certificate is still trusted: verify its exported public certificate withIf Gatekeeper reports `CSSMERR_TP_CERT_REVOKED`, fix the signing identity rather thandisabling security checks. Distributed builds still require Developer ID signing and notarization.-## Parity with the SwiftUI app--The port follows the Swift sources view by view (metrics, fonts, colors, motion), including the-Mac chat redesign that was in progress at the time (larger chat text, actions beside messages,-one composer capsule, circular chat controls, Jump to latest). It was checked side by side with-the SwiftUI build against the same host using screenshots from Computer Use.+## Composer checksComposer keyboard behavior, animation and durable draft storage, with a host-freeregression fixture: [composer checks](../guides/composer.md).--## The SwiftUI apps in the history--`apps/macos/`, `apps/linux/` and the Mac code paths in `kit/` are in Git. The commit that-removed them is `git log --oneline -1 -- apps/macos`; its parent is the last SwiftUI version:--```sh-git show <commit>^:apps/macos/Views/ChatWindow.swift-git worktree add ../codync-swiftui <commit>^-```diff --git a/docs/architecture/file-structure.md b/docs/architecture/file-structure.mdindex 4a9c3fb1..3c9c0c3b 100644--- a/docs/architecture/file-structure.md+++ b/docs/architecture/file-structure.md@@ -10,7 +10,7 @@ Codync/│ ├── src/│ │ ├── main.rs # CLI entry, shared helpers (LockExt, http)│ │ ├── hub.rs, store/ # Shared state + event fan-out / SQLite persistence (schema, model, bots, entries, devices)-│ │ ├── service.rs # Data dir, launchd/systemd install, keep-awake+│ │ ├── service/ # Data dir, launchd/systemd/Windows install, keep-awake│ │ ├── usage.rs, mcp.rs│ │ ├── screen/ # Remote screen: helper protocol, helper socket, phone viewers, bot computer use (cua-driver)│ │ ├── api/ # Dispatch (mod.rs), HTTP/SSE routes (http.rs, events.rs), method groups (bots.rs, host.rs, marketplace.rs, remote.rs), caller permissions (devices.rs)@@ -56,7 +56,7 @@ Codync/│ └── test/ # workerd tests; e2e/ runs against a real test host├── relay/ # Separate APNs push Worker; src/ and test/├── docs/ # Architecture, guides, reference, features, design, archive-├── tools/ # Widget rendering utilities+├── tools/ # Release, App Store submission and font scripts├── packaging/ # Distribution templates├── marketing/app-store-screenshots/ # App Store screenshot editor (bun dev; Export bundle → out/)├── web/ # Website (Next.js static export)@@ -78,7 +78,7 @@ Codync/| Responsibility | Source entry points ||---|---|-| CLI and background service | `host/src/main.rs`, `service.rs` |+| CLI and background service | `host/src/main.rs`, `service/` || API, caller permissions, event ordering | `host/src/api/`, `hub.rs` || SQLite transcript, bots, lanes and sessions | `host/src/store/` (`entries.rs`, `bots.rs`, `model.rs`, `devices.rs`, `schema.rs`) || Agent process, ACP, queue and session lifecycle | `host/src/agent/bot/` (`queue.rs`, `session.rs`, `turn.rs`, `updates.rs`), `acp.rs` |diff --git a/docs/architecture/overview.md b/docs/architecture/overview.mdindex d05e5e9d..a322235d 100644--- a/docs/architecture/overview.md+++ b/docs/architecture/overview.md@@ -64,4 +64,4 @@ Remote screen uses the channel for signaling and WebRTC for media/input. CloudflClient/host compatibility uses mutual minimum versions (`minApp` / `minHost`, see [compatibility](../reference/compatibility.md)). The channel wire version (`v=1`), pairing URL version (`v=3`) and the cloud health endpoint's service version are separate values.-Debug iOS builds use `apps/shared/Config/dev.plist`; Release uses `main.plist`. The desktop app takes the same values through `apps/desktop/tools/account-config.mjs`. The host compiles in its cloud from `CODYNC_ENV` (`main`, else dev), set by the same packaging script (`dist:mac:dev` / `dist:mac:main`). Production fields are currently incomplete in checked-in configuration, so a successful Debug install is not production readiness. See [environments](../guides/environments-and-deployment.md).+The `iOS Dev` scheme (`DevDebug` / `DevRelease`) uses `apps/shared/Config/dev.plist`; `iOS` (`Debug` / `Release`) uses `main.plist`. The desktop app takes the same values through `apps/desktop/tools/account-config.mjs`. The host compiles in its cloud from `CODYNC_ENV` (`main`, else dev), set by the same packaging script (`dist:<platform>:dev` / `dist:<platform>:main`). See [environments](../guides/environments-and-deployment.md).diff --git a/docs/archive/README.md b/docs/archive/README.mdindex 035cee89..989f21bd 100644--- a/docs/archive/README.md+++ b/docs/archive/README.md@@ -7,6 +7,7 @@ These documents retain decisions and observations from before the current refact| [Cloudflare account/device plan](cloudflare-account-device-plan-2026-09-25.md) | 2026-09-25 | [Architecture](../architecture/overview.md), [protocol](../reference/remote-relay.md), [environments](../guides/environments-and-deployment.md) || [Bot/computer/SSH plan](bot-computer-ssh-plan-2026-09-25.md) | 2026-09-25 | [Accounts and SSH](../guides/accounts-and-ssh.md), [file structure](../architecture/file-structure.md) || [UI audit](ui-audit-2026-09-25.md) | 2026-09-25 | [UI conventions](../design/ui-conventions.md), [widgets](../design/mobile-widgets.md) |+| [SwiftUI Mac chat](macos-chat-swiftui.md) | 2026-10-05 | [Desktop app](../architecture/desktop-app.md) |Do not interpret old “not implemented” statements, delegation assignments, version numbers or test reports as the state of the current checkout. Reassess an audit finding against source before turning it into work.diff --git a/docs/design/push-and-live-activity.md b/docs/design/push-and-live-activity.mdindex 31faca1d..e36de3e5 100644--- a/docs/design/push-and-live-activity.md+++ b/docs/design/push-and-live-activity.md@@ -128,34 +128,10 @@ Deployment order: Worker → host → iOS. The optional encrypted subtitle remai| Provider credentials expire | Device ticket is retained for credential repair || Worker receives private activity text / oversized alert | Rejected before APNs |-Local tests cover payload generation, error classification, request validation, ticket replacement, Swift payload decoding and crypto vectors. The signed device checks below cover extension execution and background ActivityKit delivery. Focus behavior, pre-first-unlock behavior, action navigation and OS-driven token rotation still need separate acceptance scenarios.--### Local verification — 2026-09-27--- Host: `cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, and all 148 unit/integration tests passed.-- Swift: `swift test --package-path kit` passed, 51 tests including encrypted push vectors and the optional notification subtitle.-- Relay: `npm test` and `npm run typecheck` passed, including malformed requests and activity payload checks.-- iOS: Debug simulator build passed with both extensions embedded. The built notification extension has the expected service entry point. Signing and device Keychain access were not verified by this unsigned build.-- Design document relative links and `git diff --check` passed. This initial check preceded deployment; see the device verification below.---### Deployment and device verification — 2026-09-27--- Deployed `codync-relay`, version `2ba1d27c-116c-423d-87e4-2a7749575bd3`; `/health` returned HTTP 200.-- Built and restarted the signed Mac app and its launchd host. The running host includes the new notification implementation; its health endpoint returned success.-- Built and installed the signed Debug iOS app on the paired iPhone 16 Pro Max. App and notification extension both resolve their shared Keychain group to `7FUM8A8H72.com.pokai.Codync`, with the matching App Group. The app uses the development APNs environment.-- The live host contained 191 tickets across five device identities. The active phone's group shrank from ten rows to one on reconnect. Added regression coverage ensures older groups also send through only their newest stored ticket.-- Two encrypted test alerts returned HTTP 200 from the deployed Worker/APNs path. Device logs confirm the notification service extension executed, with no recorded decryption failure for those tests.-- Debug device diagnostics read iOS-delivered notifications for the temporary verification bot and confirmed the decrypted title `Push verification`, subtitle `Task complete`, and final result body. The same inspection identified the four obsolete-identity fallbacks, leading to physical-destination deduplication in the Worker.-- A task started from the iPhone created a real Live Activity. While the app was on the Home Screen, an APNs needs-input update changed the Dynamic Island indicator to amber. Releasing the controlled host task ended the activity and removed its host ticket. The stale-date payload passed automated checks, but its delayed visual transition was not conclusively observed on the device.+Local tests cover payload generation, error classification, request validation, ticket replacement, Swift payload decoding and crypto vectors. The Debug diagnostics below check extension execution and background ActivityKit delivery on a device. Focus behavior, pre-first-unlock behavior, action navigation and OS-driven token rotation still need separate acceptance scenarios.+### Debug push diagnosticsFor repeatable Debug-only acceptance, launch the app with `CODYNC_PUSH_VERIFY_BOT` set to the temporary test bot ID. The console's `CODYNC_PUSH_VERIFICATION` line reports only that bot's delivered notifications, current activities and authorization state. It does not expose keys, tickets, account IDs or other bots' notifications. Release builds do not include this diagnostic.-- The deployed batch endpoint received five tickets for one physical phone and returned four superseded results plus one successful delivery. Device diagnostics confirmed exactly one new decrypted notification and no additional generic fallbacks. The user also confirmed the complete title and body were visible.-- The updated running host executed controlled failure and success tasks. Its next delivery automatically removed obsolete identity rows, leaving one valid alert ticket in the live database.-- Final signed iOS and macOS Debug builds passed after the batch fix.-Set `CODYNC_PUSH_CLEAR_TEST_NOTIFICATIONS=1` alongside the Debug verification bot ID to remove only that bot's delivered test notifications after reporting them.--- Final device diagnostics confirmed one decrypted failure (`Push verification / Task failed / The agent failed.`), one additional decrypted success, no new generic fallback, and no remaining test activity. The temporary bot was deleted and its delivered notifications were cleared.diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.mdindex a8e0edd2..c12c2015 100644--- a/docs/design/ui-conventions.md+++ b/docs/design/ui-conventions.md@@ -107,8 +107,7 @@ The iPhone conversation navigation title includes a compact second line with theUI changes apply to iOS SwiftUI (`apps/ios/`, `apps/ios/Kit/Sources/CodyncUI/`), thedesktop app (`apps/desktop/src/renderer/`) and the terminal client (`host/src/tui/`)together. Use each platform's controls while preserving the same actions, information-and states. The desktop app was ported view by view from the SwiftUI Mac app and-carries its behavior; the October 2026 parity changes brought the TUI up to it.+and states.- Chat and threads show the latest non-final agent segment only while that lane isworking and connected. Earlier narration, tools, empty text and `(pass)` stay outdiff --git a/docs/features/analytics.md b/docs/features/analytics.mdindex 68a52475..842c6a58 100644--- a/docs/features/analytics.md+++ b/docs/features/analytics.md@@ -1,21 +1,23 @@# Usage analytics-Opt-in product analytics in PostHog (US Cloud, project "Codync App", id 649427). Every-device asks once and sends nothing until the user agrees; the answer can be changed in-Settings anytime. The public promise lives in `web/app/privacy/page.tsx`: keep it true.+Product analytics in PostHog (US Cloud, project "Codync App", id 649427), on by default on+every device; *Share usage analytics* in Settings turns it off. It exists to spot bugs sooner+(failed or stopped turns per agent and platform) and to serve users better. The public promise+lives in `web/app/privacy/page.tsx`: keep it true.## Rules- **Only feature use, never content.** No message text, prompts, code, file names, paths,bot names, credentials or agent output. Properties are counts, booleans and publiccatalog names (agent, model, connector catalog name; a custom connector is just `custom`).-- **Consent per device.** The computer's owner decides for that computer (host kv- `analytics_enabled`, `null` until asked); each iPhone decides for itself- (`UserDefaults` `analyticsEnabled`). Turning it off drops anything still queued.-- **Identity.** Signed in to a Codync account: the Clerk user id, with a person profile.- Otherwise a random install id (the host id on a computer, a UUID on the iPhone) and no- person profile. The first signed-in event sends `$identify` with `$anon_distinct_id` so- earlier events join the account.+- **Setting per device.** The computer's owner decides for that computer (host kv+ `analytics_enabled`, on unless `0`); each iPhone decides for itself (`UserDefaults`+ `analyticsEnabled`, on unless `false`). Turning it off drops anything still queued. A+ device that said no to the earlier opt-in question stays off.+- **Identity.** Every device gets a person profile. Signed in to a Codync account: the Clerk+ user id. Otherwise a random install id (the host id on a computer, a UUID on the iPhone).+ The first signed-in event sends `$identify` with `$anon_distinct_id` so earlier events join+ the account.- **No IP or location**: the project discards client IPs and every event sets `$geoip_disable`.- `env` is `main` or `dev`; filter dev out in PostHog.@@ -33,14 +35,11 @@ Settings anytime. The public promise lives in `web/app/privacy/page.tsx`: keep ihost stops.- **Desktop** reports app-level events through the loopback-only `track` method(`app_opened`, `onboarding_completed` when the welcome screen is finished, `signed_in`,- `signed_out`) and sets consent with `setAnalytics`; `hello` carries `analytics: true | false | null`.+ `signed_out`) and turns sharing on or off with `setAnalytics`; `hello` carries `analytics: true | false`.The **terminal UI** reports only `app_opened` (it has no welcome screen or sign-in).- **iPhone** (`CodyncKit` analytics client, no SDK) sends its own app-level events(`app_opened`, `onboarding_completed`, `computer_paired`, `signed_in`, `signed_out`,`voice_call_started`) straight to PostHog. Widgets and the notification extension never send.-- **Before the answer**: setup and pairing come before the question, so every client holds- events in memory until the device answers; a yes sends them, a no drops them. Nothing leaves- the device before a yes.## Event properties@@ -68,7 +67,7 @@ join an iPhone's `computer_paired` to the computer's events on `computer` in SQL| Metric | Definition ||---|---|| Active user (DAU/WAU/MAU) | Sent ≥1 `message_sent` in the period. Any event at all counts as *present*, not active (`app_opened` on the iPhone fires on every return to the foreground). |-| New user | First event of any kind in the period (the first event after the device said yes, not the install). |+| New user | First event of any kind in the period. || Activated | Sent ≥1 message from a phone (`message_sent`, `client = remote`) within 7 days of first seen. In the first week of data, 4 of 5 such users came back after 24 h and none of the 6 computer-only ones did. || Successful turn rate | `turn_finished` with `outcome = done` ÷ all `turn_finished` with `source = user`, per agent and per `$os`. || Frustration rate | (`turn_stopped` + `session_reset`) ÷ `message_sent`, per `$os`. |@@ -77,9 +76,8 @@ join an iPhone's `computer_paired` to the computer's events on `computer` in SQL| Feature adoption | Share of WAU with ≥1 of: `voice_call_finished`, `remote_screen_opened`, `connector_installed`, `routine_saved`, `bot_created` with `kind = group`. || Up to date | Share of computers active in the period whose last `app_version` is the latest release. |-## Asking+## Turning it off-All clients show the same prompt ("Help improve Codync", *Share usage* / *Don't share*)-when onboarding is done and the device hasn't answered, which covers new users right after-the welcome screen and existing users once after updating. The App Store privacy label-declares *Product Interaction*, linked to the user, not used for tracking.+No client asks: sharing starts with the first launch. Every client has the same switch,+*Share usage analytics* (iPhone and desktop Settings → Privacy, terminal UI `^k`). The App+Store privacy label declares *Product Interaction*, linked to the user, not used for tracking.diff --git a/docs/features/computer-order.md b/docs/features/computer-order.mdindex a1e57228..17c8786c 100644--- a/docs/features/computer-order.md+++ b/docs/features/computer-order.md@@ -32,11 +32,7 @@ the section; Move up/down accessibility actions are also available. The desktopapp supports heading drags and Alt+Up/Down on macOS, Linux and Windows.The terminal UI connects to one host, so it has no cross-computer ordering.-The account computer-order API has been removed. Migration-`0004_computer_order.sql` remains as already-deployed schema history; its column is-unused. Updating clients stops them from reading or writing remote order immediately,-without requiring a cloud deployment. Removing the endpoint from an existing Worker-requires deploying the updated cloud code separately.+The order never leaves the device: the cloud stores no computer order.## Bot orderdiff --git a/docs/features/groups-and-threads.md b/docs/features/groups-and-threads.mdindex 2e671750..9fed9df5 100644--- a/docs/features/groups-and-threads.md+++ b/docs/features/groups-and-threads.md@@ -25,7 +25,7 @@ replies itself.- Read state (Slack's): the main chat and each thread are read separately. A bot's `unread`badge is the sum. Reading the main chat leaves a thread's new replies unread; opening thethread (or replying in it) reads them. A root doesn't turn unread when its summary changes.-- `sync` / `events` catch-up carries recent entries of chats *and* threads. Paging:+- The `events` catch-up carries recent entries of chats *and* threads. Paging:`history` (main chat only), `thread` (a whole thread).## Methods (`POST /api/<method>`, same on the E2E channel)diff --git a/docs/features/marketplace.md b/docs/features/marketplace.mdindex 65857a17..e8072a87 100644--- a/docs/features/marketplace.md+++ b/docs/features/marketplace.md@@ -7,7 +7,7 @@ The Plugins screen configures capabilities installed on the selected computer. A| Agents | `host/src/agent/backends.rs`, `host/src/agent/registry.rs` | Detect installed harnesses and resolve ACP registry adapters || Connectors | `host/src/market/mod.rs`, `registry.rs`, `install.rs` | Discover MCP servers or add one manually; install per computer; on for every bot unless a bot turns it off || Connected apps | `host/src/market/composio.rs` | Expose connected Composio apps as connectors |-| Skills | `host/src/market/skills.rs` | Instruction folders containing `SKILL.md`, stored under `~/.codync/skills/<id>` |+| Skills | `host/src/market/skills.rs` | Instruction folders containing `SKILL.md`, stored under `~/.codync/skills/<id>`; on for every bot unless a bot turns it off |The Connectors shelf opens with a short featured list, then pages through the whole MCP Registry (`marketConnectors {search, cursor}` → `{items, nextCursor}`, 60 metadata records per API page; the UI initially shows 12 and reveals another 12 only when *Load more connectors* is pressed). Apps through Composio use the same 12-at-a-time display with *Load more apps*. Searching resets the visible batch; late responses from an older search are ignored. Scrolling never triggers another catalog fetch. Listed: stdio npm/PyPI/OCI/NuGet packages (the registry's runtime and package arguments become inputs) and streamable-HTTP or SSE remotes (URL `{variables}` become inputs). Not listed: MCPB bundles and packages that serve HTTP locally; add those as a custom connector.@@ -17,11 +17,17 @@ A custom connector is a command line (split like a shell), a URL, or a pasted MCA connector installed on the computer (or an app connected through Composio) is turned on for every existing bot, and a new bot starts with all of them on; each bot can turn one off in its settings. An enabled connector is passed to the agent as an MCP server when its session starts or resumes. Local connectors are spawned by the agent; remote ones always go through the host's stdio proxy (`codync-host mcp remote`, `host/src/mcp.rs`), so they work with agents that only speak stdio and always carry a fresh token. The proxy speaks streamable HTTP and falls back to the older HTTP+SSE transport when the first POST fails with 400/404/405, as the MCP spec suggests.+Skills follow the same rule: an installed or hand-written skill is turned on for every existing bot, a new bot starts with all of them on, and each bot can turn one off. An enabled skill reaches the agent as a line in its profile (name, description, path to `SKILL.md`). Skills installed before this rule were turned on for every bot once, at host start (kv `skillsOnForEveryBot`).++Clicking a skill (a Marketplace row, an installed skill, or the info button beside a skill's switch in bot settings; in the terminal, ↵ on a skill, or `i` on the bot form's Skills field) opens its details: the description and its instructions, with Add while it isn't installed. `skillDetails {id}` (installed) or `{source}` (catalog) returns `{markdown}`: the `SKILL.md` body without its front matter, at most 256 KB. The host looks names up in the installed list or the catalog cache, never as a path; the catalog fetch already downloads every `SKILL.md`, so the bodies stay in that cache. A Marketplace row opens its details, or does what its button does when it has none (connectors open their install sheet).++Typing `/` at the start of a message to a bot (desktop, iPhone, terminal; not in a group, where each member has its own skills) lists that bot's skills; picking one fills in `/<skill id> `. The host sees a message starting with `/<id of a skill the bot has on>` and hands the agent `[Codync: the user picked the "<name>" skill for this message. Read <path> first and follow it.]` followed by the rest of the message; the chat keeps the text as typed. Any other `/command` reaches the agent unchanged, so its own commands keep working. Clients show the menu and load skill instructions only from hosts 2.14.1 and newer.+Registry-backed package connectors follow their upstream release. The host checks the Registry periodically after credentials are unlocked and checks again immediately before a package process starts. If a newer pinned npm, PyPI, OCI or NuGet reference is available, only that package/image argument is replaced; the running process is not interrupted, and the new version applies on its next launch. Network failures, missing packages and attempted downgrades leave the installed reference unchanged. Custom command connectors are never updated automatically.## Sign-in for remote connectors (`host/src/market/oauth.rs`)-Installing a remote connector probes it; a 401 marks it `signedOut` and bots don't get it until someone signs in. Sign-in follows the MCP authorization spec: protected-resource metadata → authorization-server metadata → dynamic client registration (both redirect URIs at once) → PKCE. Tokens stay on the computer and are refreshed on use (or after a 401).+Installing a remote connector probes it: a 401 to `initialize`, or (with no headers given) protected-resource metadata naming an authorization server, for servers like Call2Me that only refuse tool calls, marks it `signedOut`, and bots don't get it until someone signs in. Sign-in follows the MCP authorization spec: protected-resource metadata → authorization-server metadata → dynamic client registration (both redirect URIs at once) → PKCE. Tokens stay on the computer and are refreshed on use (or after a 401).| Where the user signs in | Redirect URI | Who finishes || --- | --- | --- |diff --git a/docs/guides/accounts-and-ssh.md b/docs/guides/accounts-and-ssh.mdindex f72c106d..19be532a 100644--- a/docs/guides/accounts-and-ssh.md+++ b/docs/guides/accounts-and-ssh.md@@ -6,7 +6,7 @@ a device token kept encrypted with Electron `safeStorage`, OAuth in the system b## Configuration-The iOS app uses `apps/ios/App/AccountSession.swift`. Public keys and cloud URLs come from `apps/shared/Config/<env>.plist`, copied into the bundle as `AccountConfig.plist` by `project.yml`; Debug selects dev and Release selects main. The desktop app reads the same plist through `node apps/desktop/tools/account-config.mjs <env>` (run by `npm run dev` and `npm run dist:*:<env>`), which writes `resources/account-config.json` (`CODYNC_CLERK_PUBLISHABLE_KEY` / `CODYNC_CLOUD_URL` override it). See [environments](environments-and-deployment.md).+The iOS app uses `apps/ios/App/AccountSession.swift`. Public keys and cloud URLs come from `apps/shared/Config/<env>.plist`, copied into the bundle as `AccountConfig.plist` by `project.yml`; `iOS Dev` (`DevDebug` / `DevRelease`) selects dev and `iOS` (`Debug` / `Release`) selects main. The desktop app reads the same plist through `node apps/desktop/tools/account-config.mjs <env>` (run by `npm run dev` and `npm run dist:*:<env>`), which writes `resources/account-config.json` (`CODYNC_CLERK_PUBLISHABLE_KEY` / `CODYNC_CLOUD_URL` override it). See [environments](environments-and-deployment.md).Confirm Apple and Google sign-in, Native API and the native app registrations in the intended Clerk instance. The desktop app uses `com.pokai.Codync`, iOS uses `com.pokai.Codync.ios`, with their matching `://callback` URLs. Dashboard configuration and actual OAuth consent must be verified independently of the checked-in plist. Do not bundle Clerk secret keys.@@ -37,15 +37,13 @@ the computer's web sign-in and the iPhone's native sign-in got different Apple uand became two Clerk users; don't switch development back to shared credentials.To check cross-device discovery, sign in with the same Apple Account on both-devices of one environment (Debug ↔ Debug, Release ↔ Release) and verify that+devices of one environment (Dev ↔ Dev, production ↔ production) and verify thatClerk has one user ID. Then verify that the computer joins the account and the phonerequests access with the existing approval flow. Hide My Email does not change thedevice approval requirement.-Verified on 2026-09-30 with the SwiftUI Mac app that preceded the desktop app:-Apple OAuth completed and showed the signed-in private relay address. The desktop-app's Apple sign-in and production cross-device identity matching still need to be-checked on a release build.+The desktop app's Apple sign-in and production cross-device identity matching+still need to be checked on a release build.### iOS Sign in with Applediff --git a/docs/guides/cloudflare-testing.md b/docs/guides/cloudflare-testing.mdindex 2784a4fc..9839cec3 100644--- a/docs/guides/cloudflare-testing.md+++ b/docs/guides/cloudflare-testing.md@@ -1,11 +1,11 @@# Testing the Cloudflare path-The remote channel, account approval and relay implementation exist. You can begin testing the **development** path after the prerequisites below. A successful iOS build/install is not an end-to-end relay result. Production configuration remains incomplete; see [environments](environments-and-deployment.md).+The remote channel, account approval and relay implementation exist. You can begin testing the **development** path after the prerequisites below. A successful iOS build/install is not an end-to-end relay result. See [environments](environments-and-deployment.md).## Prerequisites- Run app/host versions within each other's `minApp` / `minHost` floors ([compatibility](../reference/compatibility.md)) and replace old running processes after installation ([development](development.md)).-- Point both app and host at the intended cloud. Debug app configuration uses `https://dev-api.codync.dev`; check `codync-host cloud` on the computer. Enable/configure it through **Reach from anywhere** or the CLI when needed.+- Point both app and host at the intended cloud. `iOS Dev` and `dist:*:dev` builds use `https://dev-api.codync.dev`; check `codync-host cloud` on the computer. Enable/configure it through **Reach from anywhere** or the CLI when needed.- Keep the computer awake, online, and its host running. Ensure the selected agent works locally first.- Pair through a fresh QR, or sign in and approve device access by comparing the six-digit code on the computer. A Google login alone does not authorize access.diff --git a/docs/guides/environments-and-deployment.md b/docs/guides/environments-and-deployment.mdindex 4aacf4d3..577280a4 100644--- a/docs/guides/environments-and-deployment.md+++ b/docs/guides/environments-and-deployment.md@@ -9,12 +9,12 @@ See [side-by-side Dev and production apps](dev-app.md) for schemes, identifiers,| Layer | Source | Selection || --- | --- | --- || Apple app | `apps/shared/Config/dev.plist`, `main.plist` | `project.yml` copies the selected file to bundled `AccountConfig.plist`; `iOS Dev` uses dev; `iOS` uses main |-| Account SDK | `apps/shared/AccountSession.swift` | Public Clerk configuration; development environment overrides are supported |+| Account SDK | `apps/ios/App/AccountSession.swift` | Public Clerk configuration; development environment overrides are supported || Host | `host/src/remote/cloud.rs` | `CODYNC_CLOUD=off` or stored disable wins; then `CODYNC_CLOUD_URL`, then the build's cloud (`CODYNC_ENV` at compile time) || Cloud Worker / D1 / DO | `cloud/wrangler.toml` | Root production, `dev`, or `local` environment || APNs Worker | `relay/wrangler.toml` | Separate deployment and secrets; see [relay README](../../relay/README.md) |-The environment is chosen when building, never stored: the host compiles in its cloud from `CODYNC_ENV` (`main` → `https://api.codync.dev`, unset or anything else → `https://dev-api.codync.dev`, debug or release alike), and the only cloud setting a host saves is on/off (**Reach from anywhere**, `codync-host cloud --enable|--disable`). `CODYNC_CLOUD_URL` points a host at a cloud you're developing (https, or http to this computer). `npm run dist:mac:dev` / `dist:mac:main` build the bundled host for the app's environment, so the script name picks the environment of a whole desktop build ([desktop app](../architecture/desktop-app.md#development)); the release workflows set `CODYNC_ENV=main`.+The environment is chosen when building, never stored: the host compiles in its cloud from `CODYNC_ENV` (`main` → `https://api.codync.dev`, unset or anything else → `https://dev-api.codync.dev`, debug or release alike), and the only cloud setting a host saves is on/off (**Reach from anywhere**, `codync-host cloud --enable|--disable`). `CODYNC_CLOUD_URL` points a host at a cloud you're developing (https, or http to this computer). `npm run dist:<platform>:dev` / `dist:<platform>:main` build the bundled host for the app's environment, so the script name picks the environment of a whole desktop build ([desktop app](../architecture/desktop-app.md#development)); the release workflows set `CODYNC_ENV=main`.## Checked-in readiness@@ -28,7 +28,7 @@ Check the environment before resetting keys, pairing again, or removing an accouObserved on 2026-10-09: MacBook-Pro-3 ran a local development build connected to `dev-api.codync.dev`, while the Mac mini ran a production build connected to `api.codync.dev`. Both hosts reported `registered: true` and `connected: true`. The MacBook's same `computerId` was online in development D1 and offline in production D1. The Mac mini's account list therefore correctly showed the old production record as **Offline**. This was an environment mismatch, not evidence of a stopped host or a duplicate identity.-Before testing account discovery, access approval, or cross-device computer order:+Before testing account discovery or access approval:1. Run `codync-host cloud` on each computer and compare `url`, `registered`, `connected`, and `last error`. Use the installed app's bundled executable if the shell's host binary is not the one being tested.2. Check `http://127.0.0.1:19222/health` (or the configured development port) for the running binary path, version and `computerId`.@@ -62,9 +62,9 @@ A migration that changes what the database accepts goes out before the Worker coThe repository is public, so its whole history counts as published. Last scan: 2026-10-07 (`gitleaks git .` plus pattern grep over `git log -p --all`).-- **Rotated:** the `codync-push` Worker (`codync-push.kevin2005ha.workers.dev`) bearer secret, hard-coded in `Codync-macOS/Services/APNsPushService.swift` from 2026-03-19 (`96f7118`) until 2026-03-25 (`72837e2`). The value in history is dead; rotated by the owner before 2026-10-07.+- **Rotated:** a push Worker bearer secret committed from 2026-03-19 (`96f7118`) until 2026-03-25 (`72837e2`). The value in history is dead; rotated by the owner before 2026-10-07.- **Public by design:** the PostHog project key (`phc_…`, ingest only) and Clerk publishable keys (`pk_test_…`, `pk_live_…`).-- **Not secrets:** test vectors in `docs/remote-relay-vectors.json` and keys in test fixtures.+- **Not secrets:** test vectors in `docs/reference/fixtures/remote-relay-vectors.json` and keys in test fixtures.- No PostHog personal keys (`phx_…`), Clerk secret keys, cloud provider keys or private key files were ever committed.## Migration log@@ -77,10 +77,12 @@ The repository is public, so its whole history counts as published. Last scan: 2`0002` lets `computers.platform` be `windows` (Windows hosts register with `std::env::consts::OS`). SQLite can't change a CHECK, so it rebuilds `computers` together with `access_requests` and `grants`, the tables that reference it: dropping a referenced table while foreign keys are enforced would count every referencing row as a violation. Live schemas matched `0001` beforehand; row counts were unchanged afterwards (dev 24 computers, 8 grants, 14 access requests; main 101, 38, 48) with no orphaned rows. A signed `POST /v1/host/register` with `platform: "windows"` returned 200 on both (the probe rows were deleted). Main's Worker answered with the previous version for about 20 seconds after `deploy`.-The Worker accepting `windows` was deployed to both environments from the `windows` branch on 2026-10-07, ahead of its merge; its cloud code differed from `main` only in that platform list. Until the branch reaches `main`, deploying cloud from `main` turns Windows registration off again (the database keeps accepting it).+The Worker accepting `windows` was deployed to both environments from the `windows` branch on 2026-10-07, ahead of its merge; its cloud code differed from `main` only in that platform list.`0003` lets `devices.platform` be `linux` or `windows`. Accounts were built when only the iPhone and the SwiftUI Mac app signed in; the Electron app brought sign-in to Linux (and later Windows), whose device registration the cloud rejected (`400 Invalid platform`), so main held no Linux devices at all. It rebuilds `devices` with `access_requests` and `grants` the same way as `0002`. Row counts were unchanged (dev 14 devices, 8 grants, 14 access requests; main 128, 41, 53) with no orphaned rows; a `windows` device row inserted on dev was accepted and removed. The Worker accepting both platforms was deployed to dev and main the same day from the `device-platforms` branch, which differed from `main` only there. Windows apps up to 2.9.0 register as `linux`; later ones send `windows`.+A `0004_computer_order.sql` (an account-wide computer order) reached only dev before ordering became device-local. On 2026-10-11 its column was dropped from `codync-dev` and its row deleted from `d1_migrations` (restore point `00001447-00000002-00005101-ce9dbb4b6e3847fef79f63887a5d89af`), and the file was removed, so both environments match `0001`–`0003`.+Rolling back a migration restores the whole database to that point, losing every write since: `wrangler d1 time-travel restore <db> --bookmark=<restore point>`.A healthy HTTP endpoint proves Worker reachability only. It does not prove host registration, encrypted channel traffic, account approval, notification delivery or background reconnection.diff --git a/docs/guides/updates.md b/docs/guides/updates.mdindex c6d35acd..14198706 100644--- a/docs/guides/updates.md+++ b/docs/guides/updates.md@@ -123,8 +123,9 @@ move to the desktop app; 2.7.1 is the first release they accept. Support endsneed a manual download of the desktop app. Remove together:- the Sparkle part of **Update feeds** in `.github/workflows/release-desktop.yml`- (`generate_appcast`, `annotate-appcast.py`, `verify-appcast.py`) and `appcast.xml`- in **Publish**+ (`generate_appcast`, `annotate-appcast.py`, `verify-appcast.py`) and `build/appcast.xml`+ in the macOS artifact upload and in **Publish** (keep the step's `minApp` line for+ `latest-mac.yml`, electron-updater reads it)- `SUPublicEDKey` in `apps/desktop/electron-builder.yml`- `packaging/updates/annotate-appcast.py`, `verify-appcast.py`, `macos-public-key.txt`- the `SPARKLE_PRIVATE_KEY` secret (row below) and the appcast mentions indiff --git a/docs/reference/compatibility.md b/docs/reference/compatibility.mdindex 96f9caae..a63d2d97 100644--- a/docs/reference/compatibility.md+++ b/docs/reference/compatibility.md@@ -24,8 +24,7 @@ On every (re)connect the client reads `hello` and decides, in this order:Versions compare as `major.minor.patch` (a leading `v` and any `-pre`/`+build` suffix areignored). An unreadable version, or a `hello` without one, never blocks: an unknown is not a-reason to lock someone out. Hosts from before 2.4.0 send no `minApp`; only the client's-floor applies to them.+reason to lock someone out.## What each client doesdiff --git a/docs/reference/remote-relay.md b/docs/reference/remote-relay.mdindex 4016fc5c..2eae4e05 100644--- a/docs/reference/remote-relay.md+++ b/docs/reference/remote-relay.md@@ -61,7 +61,7 @@ Shared deterministic [vectors](fixtures/remote-relay-vectors.json) and their [ge| Host cloud / relay | `host/src/remote/cloud.rs`, `relay.rs` || Swift transports / identity | `apps/ios/Kit/Sources/CodyncKit/Client/` || Account and per-computer state | `apps/ios/Kit/Sources/CodyncUI/` |-| iOS account integration | `apps/shared/AccountSession.swift` |+| iOS account integration | `apps/ios/App/AccountSession.swift` || Desktop account, device key, cloud API | `apps/desktop/src/main/account.ts`, `cloud.ts` |See [architecture](../architecture/overview.md) and [file structure](../architecture/file-structure.md). Application/host compatibility follows mutual minimum versions ([compatibility](compatibility.md)); channel `v`, QR version and Worker package version are separate values.@@ -313,7 +313,7 @@ blob = epk(32) ‖ sig(64) ‖ ct| loopback 專用 | `setScreenEnabled`, `pairing`, `computerCall`, `teamCall`, `claimSign`, `unclaim`, `devices`, `revokeDevice`, `accessRequests`, `decideAccessRequest`, `cloudStatus`, `setCloud` | `Caller::Local`(loopback + token) || 配對中 | `pair` | 只在 pairing 狀態的 channel;配對完成後不可再呼叫 || screen scope | `screenPrepare`, `screenOffer`, `screenClose`, `screenTakeover` | Local,或 scopes 含 `screen` 的裝置 |-| control scope | 其餘所有既有方法(`hello`, `sync`, `history`, `createBot`, `updateBot`, `deleteBot`, `markRead`, `send`, `stop`, `newSession`, `respondPermission`, `registerDevice`, `unregisterDevice`, `registerActivity`, `refreshBackends`, `usage`, `listDirs`, market/skills/connectors、`agentSetup`, `agentAuth`, `agentAuthenticate`, `setAgentEnv`, `termInput`, `termResize`, `termClose`, `screenStatus`) | Local,或 scopes 含 `control` 的裝置 |+| control scope | 其餘所有既有方法(`hello`, `history`, `createBot`, `updateBot`, `deleteBot`, `markRead`, `send`, `stop`, `newSession`, `respondPermission`, `registerDevice`, `unregisterDevice`, `registerActivity`, `refreshBackends`, `usage`, `listDirs`, market/skills/connectors、`agentSetup`, `agentAuth`, `agentAuthenticate`, `setAgentEnv`, `termInput`, `termResize`, `termClose`, `screenStatus`) | Local,或 scopes 含 `control` 的裝置 |v1 發出的 grant 一律 `["control","screen"]`。@@ -534,7 +534,7 @@ Verify pairing and approval, same-computer direct/relay connectivity, encrypted## 14. Environments and deployment-See [environments and deployment](../guides/environments-and-deployment.md) and [cloud setup](../../cloud/README.md). Debug builds target development (`dev-api.codync.dev`); Release builds target production (`api.codync.dev`).+See [environments and deployment](../guides/environments-and-deployment.md) and [cloud setup](../../cloud/README.md). `iOS Dev` / `dist:*:dev` builds target development (`dev-api.codync.dev`); `iOS` / `dist:*:main` builds target production (`api.codync.dev`).## Implementation clarificationsdiff --git a/docs/screenshots/apps-settings.png b/docs/screenshots/apps-settings.pngdeleted file mode 100644index 4010c776..00000000Binary files a/docs/screenshots/apps-settings.png and /dev/null differdiff --git a/docs/screenshots/computer-access-2.12.0.png b/docs/screenshots/computer-access-2.12.0.pngdeleted file mode 100644index d7863fdd..00000000Binary files a/docs/screenshots/computer-access-2.12.0.png and /dev/null differdiff --git a/docs/screenshots/dialog-2.12.0.png b/docs/screenshots/dialog-2.12.0.pngdeleted file mode 100644index f2b25996..00000000Binary files a/docs/screenshots/dialog-2.12.0.png and /dev/null differdiff --git a/host/Cargo.lock b/host/Cargo.lockindex 2237aaa1..191ca78c 100644--- a/host/Cargo.lock+++ b/host/Cargo.lock@@ -586,7 +586,7 @@ checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"[[package]]name = "codync-host"-version = "2.14.0"+version = "2.14.1"dependencies = ["anyhow","axum",diff --git a/host/Cargo.toml b/host/Cargo.tomlindex af751a05..0b5a6222 100644--- a/host/Cargo.toml+++ b/host/Cargo.toml@@ -1,6 +1,6 @@[package]name = "codync-host"-version = "2.14.0"+version = "2.14.1"edition = "2024"# let-chains (`if let … && let …`) need 1.88.rust-version = "1.88"@@ -29,7 +29,7 @@ getrandom = "0.4"hkdf = "0.13.0"if-addrs = "0.15.0"portable-pty = "0.9.0"-qrcode = { version = "0.14.1", default-features = false, features = ["svg"] }+qrcode = { version = "0.14.1", default-features = false }ratatui = { version = "0.30", default-features = false, features = ["crossterm"] }reqwest = { version = "0.13.5", default-features = false, features = ["rustls", "json", "stream"] }rusqlite = { version = "0.40.2", features = ["bundled"] }diff --git a/host/src/analytics.rs b/host/src/analytics.rsindex 6b51636d..527c3d96 100644--- a/host/src/analytics.rs+++ b/host/src/analytics.rs@@ -1,6 +1,6 @@-//! Opt-in product analytics (`PostHog`), decided once per computer by its owner-//! (`setAnalytics`; nothing is sent until then). Events name the feature that was used-//! and never carry content: no message text, prompts, file names, paths or bot names.+//! Product analytics (`PostHog`), on unless the computer's owner turned it off+//! (`setAnalytics`). Events name the feature that was used and never carry content:+//! no message text, prompts, file names, paths or bot names.//! What is collected and why: docs/features/analytics.md.use crate::LockExt as _;@@ -83,8 +83,7 @@ impl Event {}pub struct Analytics {- /// `None` until the owner has chosen.- enabled: Mutex<Option<bool>>,+ enabled: Mutex<bool>,tx: mpsc::UnboundedSender<Msg>,rx: Mutex<Option<mpsc::UnboundedReceiver<Msg>>>,}@@ -97,23 +96,18 @@ enum Msg {impl Analytics {pub fn load(store: &Store) -> Self {- let enabled = match store.kv_get(KV_ENABLED).as_deref() {- Some("1") => Some(true),- Some("0") => Some(false),- _ => None,- };+ let enabled = store.kv_get(KV_ENABLED).as_deref() != Some("0");let (tx, rx) = mpsc::unbounded_channel();Self { enabled: Mutex::new(enabled), tx, rx: Mutex::new(Some(rx)) }}- /// `null` until asked, which is when the computer's apps ask.- pub fn state(&self) -> Option<bool> {+ pub fn state(&self) -> bool {*self.enabled.locked()}pub fn set_enabled(&self, store: &Store, on: bool) -> Result<()> {store.kv_set(KV_ENABLED, if on { "1" } else { "0" })?;- *self.enabled.locked() = Some(on);+ *self.enabled.locked() = on;Ok(())}}@@ -245,17 +239,15 @@ pub fn observe_call(hub: &Hub, caller: &Caller, method: &str, b: &Value) -> OptiSome((event, p))}-/// Queues one event unless the owner said no. Until they answer, events wait in memory-/// and leave only after a yes (see `start`). Signed in to a Codync account, events are-/// linked to that account; otherwise to this install's random id, with no person profile.+/// Queues one event unless the owner turned analytics off. Signed in to a Codync account,+/// events are linked to that account; otherwise to this install's random id. Both get a+/// person profile.pub fn capture(hub: &Hub, event: Event, mut properties: Map<String, Value>) {- let consent = hub.analytics.state();- if consent == Some(false) {+ if !hub.analytics.state() {return;}let account = hub.cloud.status().owner.map(|o| o.user_id);- if consent == Some(true)- && let Some(user) = &account+ if let Some(user) = &account&& hub.store.kv_get(KV_IDENTIFIED).as_deref() != Some(user.as_str()){// Merges this install's earlier, anonymous events into the account.@@ -265,7 +257,7 @@ pub fn capture(hub: &Hub, event: Event, mut properties: Map<String, Value>) {tracing::warn!(error = format!("{e:#}"), "couldn't save the analytics identity");}}- properties.insert("$process_person_profile".into(), account.is_some().into());+ properties.insert("$process_person_profile".into(), true.into());queue(hub, event.name(), account.as_deref().unwrap_or(&hub.host_id), properties);}@@ -302,8 +294,7 @@ pub fn computer_tag(computer_id: &str) -> String {})}-/// Sends queued events in batches every `FLUSH_EVERY`; until the owner answers they wait,-/// and a no drops them.+/// Sends queued events in batches every `FLUSH_EVERY`; turning analytics off drops them.pub fn start(hub: &Arc<Hub>) {let Some(mut rx) = hub.analytics.rx.locked().take() else { return };let hub = hub.clone();@@ -330,9 +321,9 @@ pub fn start(hub: &Arc<Hub>) {}async fn flush(hub: &Hub, pending: &mut Vec<Value>) {- let consent = hub.analytics.state();- let sent = consent == Some(true) && !pending.is_empty() && send(pending).await;- if sent || consent == Some(false) {+ let on = hub.analytics.state();+ let sent = on && !pending.is_empty() && send(pending).await;+ if sent || !on {pending.clear();}}@@ -405,6 +396,14 @@ mod tests {std::fs::remove_dir_all(&dir).unwrap();}+ #[test]+ fn on_until_the_owner_turns_it_off() {+ let store = Store::open(std::path::Path::new(":memory:")).unwrap();+ assert!(Analytics::load(&store).state());+ Analytics::load(&store).set_enabled(&store, false).unwrap();+ assert!(!Analytics::load(&store).state(), "an off stays off");+ }+#[test]fn computer_tag_matches_the_iphone() {// Same vector as the iPhone's AnalyticsTests.diff --git a/host/src/api/bots.rs b/host/src/api/bots.rsindex 192afa55..21a9d4b2 100644--- a/host/src/api/bots.rs+++ b/host/src/api/bots.rs@@ -85,6 +85,10 @@ pub(super) async fn call(hub: &Arc<Hub>, method: &str, b: Value) -> Result<Contr}};}+ // Skills too: every installed one is on unless the client picked them.+ if b["skills"].is_null() && b["kind"] != "group" {+ b["skills"] = json!(market::skills(&hub.store).into_iter().map(|s| s.id).collect::<Vec<_>>());+ }let cfg: BotConfig = serde_json::from_value(b).context("invalid bot")?;let hub = hub.clone();json!({"bot": tokio::task::spawn_blocking(move || hub.create_bot(cfg)).await??})@@ -177,10 +181,13 @@ pub(super) async fn call(hub: &Arc<Hub>, method: &str, b: Value) -> Result<Contrattachments.push(meta);}}+ // `/skill …` reaches the agent as "read this skill first"; the chat keeps what was typed.+ let asked = market::expand_command(&hub.store, &row.config.skills, text);+ let asked = asked.as_deref().unwrap_or(text);let prompt = if paths.is_empty() {- text.to_owned()+ asked.to_owned()} else {- format!("{text}{}", crate::chat::uploads::prompt_suffix(&paths))+ format!("{asked}{}", crate::chat::uploads::prompt_suffix(&paths))};let turn = hub.store.max_turn(bot) + 1;// A group has no agent of its own to queue behind: its message is simply sent.diff --git a/host/src/api/events.rs b/host/src/api/events.rsindex 8f646b9b..36673b28 100644--- a/host/src/api/events.rs+++ b/host/src/api/events.rs@@ -11,7 +11,7 @@ use std::sync::atomic::Ordering;use tokio_stream::wrappers::BroadcastStream;/// Entries a fresh client receives per bot before paging with `history`.-pub(super) const CATCH_UP_PER_BOT: i64 = 200;+const CATCH_UP_PER_BOT: i64 = 200;/// A setup terminal's output: everything so far, then live, ending after `exit`.pub fn term_events(hub: &Hub, id: &str) -> Option<impl Stream<Item = Value> + Send + use<>> {diff --git a/host/src/api/host.rs b/host/src/api/host.rsindex 72c98559..e4df59df 100644--- a/host/src/api/host.rs+++ b/host/src/api/host.rs@@ -2,7 +2,6 @@//! terminals, usage, folders, voice and the remote screen.use super::devices::Caller;-use super::events::CATCH_UP_PER_BOT;use super::str_arg;use crate::LockExt;use crate::agent::backends;@@ -79,16 +78,6 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value"urls": tokio::task::spawn_blocking(move || crate::service::addresses(port)).await?,})}- "sync" => {- let since = b["since"].as_i64().unwrap_or(0);- json!({- "hostId": hub.host_id,- "rev": hub.store.current_rev(),- "bots": hub.bots_json(since)?,- "entries": hub.store.entries_since(since, CATCH_UP_PER_BOT)?,- "usage": hub.usage.locked().clone(),- })- }"refreshBackends" => {tokio::task::spawn_blocking(backends::hydrate_path).await?;backends::refresh_sign_in().await;@@ -150,13 +139,7 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value}"screenOffer" => {let display = b["display"].as_u64().and_then(|d| u32::try_from(d).ok());- let result =- hub.screen.offer(caller.device_key(), str_arg(&b, "sdp")?, b["session"].as_str(), display).await?;- if b["session"].as_str().is_none() {- let session = result["session"].as_str().context("missing screen session")?.to_owned();- tokio::spawn(crate::screen::watch_viewer(hub.clone(), session, caller.device_key().to_owned()));- }- result+ hub.screen.offer(caller.device_key(), str_arg(&b, "sdp")?, str_arg(&b, "session")?, display).await?}"screenClose" => {let session = str_arg(&b, "session")?;diff --git a/host/src/api/marketplace.rs b/host/src/api/marketplace.rsindex e33942d2..6d73c609 100644--- a/host/src/api/marketplace.rs+++ b/host/src/api/marketplace.rs@@ -20,9 +20,25 @@ pub(super) fn connector_ids(store: &crate::store::Store) -> Result<Vec<String>>.collect())}-/// A connector installed on the computer is on for every bot; each bot can turn it off.-fn enable_new_connectors(hub: &Hub, before: &[String]) -> Result<()> {- let new: Vec<String> = connector_ids(&hub.store)?.into_iter().filter(|id| !before.contains(id)).collect();+/// What the computer installs for its bots.+#[derive(Clone, Copy)]+enum Installed {+ Connectors,+ Skills,+}++impl Installed {+ fn ids(self, store: &crate::store::Store) -> Result<Vec<String>> {+ match self {+ Self::Connectors => connector_ids(store),+ Self::Skills => Ok(market::skills(store).into_iter().map(|s| s.id).collect()),+ }+ }+}++/// A connector or skill installed on the computer is on for every bot; each bot can turn it off.+fn enable_new(hub: &Hub, kind: Installed, before: &[String]) -> Result<()> {+ let new: Vec<String> = kind.ids(&hub.store)?.into_iter().filter(|id| !before.contains(id)).collect();if new.is_empty() {return Ok(());}@@ -30,13 +46,16 @@ fn enable_new_connectors(hub: &Hub, before: &[String]) -> Result<()> {if row.deleted || row.config.is_group() {continue;}- let mut on = row.config.connectors;+ let (key, mut on) = match kind {+ Installed::Connectors => ("connectors", row.config.connectors),+ Installed::Skills => ("skills", row.config.skills),+ };for id in &new {if !on.contains(id) {on.push(id.clone());}}- hub.update_bot(&json!({"id": row.config.id, "connectors": on}))?;+ hub.update_bot(&json!({"id": row.config.id, key: on}))?;}Ok(())}@@ -132,13 +151,13 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Valuefields,).await?;- enable_new_connectors(hub, &before)?;+ enable_new(hub, Installed::Connectors, &before)?;r}"composioConnection" => {let before = connector_ids(&hub.store)?;let r = market::composio::connection(&hub.store, str_arg(&b, "id")?).await?;- enable_new_connectors(hub, &before)?;+ enable_new(hub, Installed::Connectors, &before)?;r}"marketConnectors" => {@@ -154,7 +173,7 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value"importConnectors" => {let before = connector_ids(&hub.store)?;let added = market::import_connectors(&hub.store, str_arg(&b, "config")?).await?;- enable_new_connectors(hub, &before)?;+ enable_new(hub, Installed::Connectors, &before)?;added}"installConnector" => {@@ -170,7 +189,7 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value} else {market::add_custom_connector(&hub.store, &b).await?};- enable_new_connectors(hub, &before)?;+ enable_new(hub, Installed::Connectors, &before)?;json!({"connector": c})}"connectorSignIn" => {@@ -187,7 +206,6 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value.await?;json!({"connector": c.public()})}- "connectorSignOut" => json!({"connector": market::oauth::sign_out(&hub.store, str_arg(&b, "id")?)?.public()}),"connectorTarget" => {market::oauth::target(&hub.store, str_arg(&b, "id")?, b["stale"].as_bool().unwrap_or(false)).await?}@@ -200,12 +218,15 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Valuejson!({})}"skills" => market::list_skills(&hub.store),+ "skillDetails" => market::skill_details(&hub.store, &b).await?,"installSkill" => {+ let before = Installed::Skills.ids(&hub.store)?;let s = if b["source"].is_string() {market::install_skill(&hub.store, str_arg(&b, "source")?).await?} else {market::add_custom_skill(&hub.store, &b)?};+ enable_new(hub, Installed::Skills, &before)?;json!({"skill": s})}"removeSkill" => {@@ -222,7 +243,7 @@ mod tests {use crate::store::BotConfig;#[tokio::test]- async fn new_connectors_turn_on_for_every_bot() {+ async fn new_installs_turn_on_for_every_bot() {let dir = std::env::temp_dir().join(format!("codync-connectors-{}", uuid::Uuid::new_v4()));std::fs::create_dir_all(&dir).expect("temp dir");let store = crate::store::Store::open(std::path::Path::new(":memory:")).expect("memory store");@@ -247,10 +268,14 @@ mod tests {hub.start().expect("start");let before = connector_ids(&hub.store).expect("ids");market::save_connectors(&hub.store, &[connector("old"), connector("linear")]).expect("save");- enable_new_connectors(&hub, &before).expect("enable");+ enable_new(&hub, Installed::Connectors, &before).expect("enable");let on = |id: &str| hub.store.bot(id).expect("read").expect("bot").config.connectors;assert_eq!(on("a"), ["linear"], "the new connector is on; one turned off stays off");assert_eq!(on("b"), ["old", "linear"]);+ hub.store.kv_set("skills", r#"[{"id":"pdf","name":"PDF"}]"#).expect("install a skill");+ enable_new(&hub, Installed::Skills, &[]).expect("enable");+ let skills = |id: &str| hub.store.bot(id).expect("read").expect("bot").config.skills;+ assert_eq!((skills("a"), skills("b")), (vec!["pdf".to_owned()], vec!["pdf".to_owned()]), "new skills too");let _ = std::fs::remove_dir_all(dir);}}diff --git a/host/src/api/remote.rs b/host/src/api/remote.rsindex 2b8d7338..c4ed55c8 100644--- a/host/src/api/remote.rs+++ b/host/src/api/remote.rs@@ -127,15 +127,10 @@ async fn pairing(hub: &Arc<Hub>) -> Result<Value> {urls: &urls,cloud: cloud.as_deref(),});- let svg = qrcode::QrCode::new(url.as_bytes())?- .render::<qrcode::render::svg::Color>()- .quiet_zone(false)- .min_dimensions(200, 200)- .build();- Ok(json!({"pairingUrl": url, "urls": urls, "svg": svg, "expiresAt": issued.expires_at}))+ Ok(json!({"pairingUrl": url, "urls": urls, "expiresAt": issued.expires_at}))}-/// Signs this computer into an account claim (§4.2 A) for the signed-in Mac app to complete.+/// Signs this computer into an account claim (§4.2 A) for the signed-in desktop app to complete.async fn claim_sign(hub: &Arc<Hub>, b: &Value) -> Result<Value> {let field = |k: &str| -> Result<&str> {let v = str_arg(b, k)?;diff --git a/host/src/compat.rs b/host/src/compat.rsindex 7743cfc3..d3f7df7d 100644--- a/host/src/compat.rs+++ b/host/src/compat.rs@@ -4,7 +4,7 @@use serde_json::Value;-/// The oldest client (iPhone, Mac, Linux app, terminal client) this host still serves correctly.+/// The oldest client (iPhone, desktop app, terminal client) this host still serves correctly./// Raise it only after that client version is out (App Store included), and only when this/// host stops sending or accepting something older clients depend on.pub const MIN_APP: &str = "2.3.0";diff --git a/host/src/hub.rs b/host/src/hub.rsindex 9a73f550..2538eabd 100644--- a/host/src/hub.rs+++ b/host/src/hub.rs@@ -118,6 +118,7 @@ impl Hub {// Approval cards and queued sends from a previous run can't be honored anymore.self.store.expire_pending()?;self.routines.restore(&self.store)?;+ crate::market::turn_on_installed_once(&self.store)?;for row in self.store.bots()? {if row.deleted {self.routines.disable_bot(&self.store, &row.config.id)?;diff --git a/host/src/market/mod.rs b/host/src/market/mod.rsindex 9f2d141c..4695bff4 100644--- a/host/src/market/mod.rs+++ b/host/src/market/mod.rs@@ -31,7 +31,10 @@ mod updates;pub use install::{add_custom_connector, import_connectors, install_connector, list_connectors, remove_connector};pub use registry::{browse_connectors, connector_info, refresh_first_page};-pub use skills::{add_custom_skill, browse_skills, install_skill, list_skills, remove_skill, skills_brief};+pub use skills::{+ add_custom_skill, browse_skills, expand_command, install_skill, list_skills, remove_skill, skill_details,+ skills_brief, slash_command, turn_on_installed_once,+};pub use updates::{automatic_loop, refresh_connector};diff --git a/host/src/market/oauth.rs b/host/src/market/oauth.rsindex 2eaa7f23..2eee5cb3 100644--- a/host/src/market/oauth.rs+++ b/host/src/market/oauth.rs@@ -3,7 +3,7 @@//!//! The tokens live on this computer. The sign-in page redirects to one of two places://! - `http://127.0.0.1:<port>/oauth/callback`, served by this host, when the user signs-//! in on this computer (Mac app, TUI);+//! in on this computer (desktop app, TUI);//! - `<cloud>/v1/oauth/callback`, a stateless page that bounces to `codync://oauth?…`,//! which the phone's sign-in sheet catches and hands back with `connectorSignInFinish`.//!@@ -101,7 +101,8 @@ async fn get_json(url: &str) -> Result<Value> {Ok(res.json().await?)}-/// `true` when the server answers an unauthenticated `initialize` with 401 (it wants sign-in).+/// `true` when the server wants sign-in: an unauthenticated `initialize` gets 401, or the server+/// lets `initialize` through, refuses only tool calls, and says so in its resource metadata.pub async fn required(url: &str, headers: &std::collections::BTreeMap<String, String>) -> bool {let mut req = crate::http().post(url)@@ -115,8 +116,16 @@ pub async fn required(url: &str, headers: &std::collections::BTreeMap<String, Streq = req.header(k, v);}let Ok(res) = req.send().await else { return false };+ if res.status() == reqwest::StatusCode::UNAUTHORIZED {+ return true;+ }+ if res.status().is_success() {+ // Headers the user gave (an API key) are their way in; don't ask for sign-in on top.+ return headers.is_empty()+ && resource_metadata(url).await["authorization_servers"].as_array().is_some_and(|a| !a.is_empty());+ }if !matches!(res.status().as_u16(), 400 | 404 | 405) {- return res.status() == reqwest::StatusCode::UNAUTHORIZED;+ return false;}// Not streamable HTTP: ask the older SSE endpoint instead (the stream is dropped unread).let mut req = crate::http().get(url).header("accept", "text/event-stream").timeout(TIMEOUT);@@ -353,7 +362,7 @@ fn store_tokens(c: &mut Connector, v: &Value) {}/// Forgets a connector's tokens (keeps its registration).-pub fn sign_out(store: &Store, id: &str) -> Result<Connector> {+fn sign_out(store: &Store, id: &str) -> Result<Connector> {update(store, id, |c| {if let Some(o) = &mut c.oauth {o.access_token.clear();@@ -432,6 +441,35 @@ mod tests {assert_eq!(split("https://a.b").unwrap(), ("https://a.b".into(), String::new()));}+ /// Serves `initialize` with `status`, and protected resource metadata when `metadata`.+ async fn server(status: u16, metadata: bool) -> String {+ use axum::{Json, Router, http::StatusCode, routing};+ let code = StatusCode::from_u16(status).unwrap();+ let mut router = Router::new().route("/mcp", routing::post(move || async move { (code, Json(json!({}))) }));+ if metadata {+ router = router.route(+ "/.well-known/oauth-protected-resource",+ routing::get(|| async { Json(json!({"authorization_servers": ["https://auth.example"]})) }),+ );+ }+ let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();+ let url = format!("http://{}/mcp", listener.local_addr().unwrap());+ tokio::spawn(async move { axum::serve(listener, router).await.unwrap() });+ url+ }++ #[tokio::test]+ async fn sign_in_is_required_when_the_server_asks_for_it() {+ let none = std::collections::BTreeMap::new();+ assert!(required(&server(401, false).await, &none).await);+ assert!(!required(&server(200, false).await, &none).await);+ // Lets `initialize` through, refuses tool calls, and publishes its metadata.+ let lazy = server(200, true).await;+ assert!(required(&lazy, &none).await);+ let key = std::collections::BTreeMap::from([("x-api-key".to_owned(), "k".to_owned())]);+ assert!(!required(&lazy, &key).await);+ }+#[test]fn form_values_are_encoded() {assert_eq!(encode("a b&c=d/+"), "a+b%26c%3Dd%2F%2B");diff --git a/host/src/market/skills.rs b/host/src/market/skills.rsindex 34f6e2db..4eaf2b42 100644--- a/host/src/market/skills.rs+++ b/host/src/market/skills.rs@@ -36,9 +36,24 @@ fn front_matter(md: &str) -> (Option<String>, Option<String>) {(name, description)}-/// Skills published in anthropics/skills (cached for an hour).-pub async fn browse_skills(store: &crate::store::Store) -> Result<Value> {- let installed: Vec<String> = skills(store).into_iter().map(|s| s.id).collect();+/// `SKILL.md` without its front matter: what a skill tells the agent to do.+fn body(md: &str) -> &str {+ let mut lines = md.split_inclusive('\n');+ if lines.next().map(str::trim) != Some("---") {+ return md.trim();+ }+ let mut at = md.find('\n').map_or(md.len(), |i| i + 1);+ for line in lines {+ at += line.len();+ if line.trim() == "---" {+ return md[at..].trim();+ }+ }+ ""+}++/// Skills published in anthropics/skills, with their `SKILL.md` body (cached for an hour).+async fn catalog() -> Result<Value> {let cached = SKILL_CATALOG.locked().as_ref()@@ -61,18 +76,28 @@ pub async fn browse_skills(store: &crate::store::Store) -> Result<Value> {let url = format!("https://raw.githubusercontent.com/{SKILLS_REPO}/main/skills/{dir}/SKILL.md");let md = crate::http().get(&url).header("user-agent", UA).timeout(TIMEOUT).send().await.ok()?.text().await.ok()?;let (name, description) = front_matter(&md);- Some(json!({"source": dir, "name": name.unwrap_or_else(|| dir.clone()), "description": description.unwrap_or_default()}))+ Some(json!({"source": dir, "name": name.unwrap_or_else(|| dir.clone()), "description": description.unwrap_or_default(), "body": body(&md)}))});let v = Value::Array(futures::future::join_all(fetches).await.into_iter().flatten().collect());*SKILL_CATALOG.locked() = Some((Instant::now(), v.clone()));v};- let items: Vec<Value> = catalog+ Ok(catalog)+}++/// The anthropics/skills catalog for the Marketplace (bodies come one at a time from `skill_details`).+pub async fn browse_skills(store: &crate::store::Store) -> Result<Value> {+ let installed: Vec<String> = skills(store).into_iter().map(|s| s.id).collect();+ let items: Vec<Value> = catalog()+ .await?.as_array().into_iter().flatten().map(|s| {let mut s = s.clone();+ if let Some(o) = s.as_object_mut() {+ o.remove("body");+ }s["installed"] = json!(installed.contains(&slug(s["source"].as_str().unwrap_or_default())));s})@@ -80,6 +105,31 @@ pub async fn browse_skills(store: &crate::store::Store) -> Result<Value> {Ok(json!({"items": items}))}+/// A skill's instructions for its details sheet: an installed one by `id` (read from disk),+/// a catalog one by `source`. Only names from those lists are looked up, never a path.+pub async fn skill_details(store: &crate::store::Store, b: &Value) -> Result<Value> {+ const MAX: usize = 256 * 1024;+ let mut markdown = if let Some(id) = b["id"].as_str() {+ let s = skills(store).into_iter().find(|s| s.id == id).ok_or_else(|| anyhow!("Unknown skill"))?;+ let md = tokio::fs::read_to_string(s.dir().join("SKILL.md")).await.context("reading the skill")?;+ body(&md).to_owned()+ } else {+ let source = b["source"].as_str().ok_or_else(|| anyhow!("`id` or `source` is required"))?;+ let catalog = catalog().await?;+ let s = catalog.as_array().into_iter().flatten().find(|s| s["source"] == source);+ s.ok_or_else(|| anyhow!("Unknown skill"))?["body"].as_str().unwrap_or_default().to_owned()+ };+ if markdown.len() > MAX {+ let mut end = MAX;+ while !markdown.is_char_boundary(end) {+ end -= 1;+ }+ markdown.truncate(end);+ markdown.push_str("\n\n…");+ }+ Ok(json!({"markdown": markdown}))+}+/// Downloads a skill folder from anthropics/skills (files up to 1 MB, two levels deep).async fn download_dir(repo_path: &str, dest: &std::path::Path, depth: u8) -> Result<()> {let listing = get_json(&format!("https://api.github.com/repos/{SKILLS_REPO}/contents/{repo_path}")).await?;@@ -163,6 +213,57 @@ pub fn remove_skill(store: &crate::store::Store, id: &str) -> Result<()> {save(store, "skills", &all)}+/// `/name rest` → `name` and the rest; the rest is `None` while the name is still being typed.+pub fn slash_command(text: &str) -> Option<(&str, Option<&str>)> {+ let body = text.strip_prefix('/')?;+ Some(match body.split_once(char::is_whitespace) {+ Some((name, rest)) => (name, Some(rest)),+ None => (body, None),+ })+}++/// A message that starts with `/<skill id>`, for a skill the bot has on, asks for that skill:+/// the agent gets told to read it first. `None` sends the message as written.+pub fn expand_command(store: &crate::store::Store, enabled: &[String], text: &str) -> Option<String> {+ let (id, rest) = slash_command(text)?;+ if !enabled.iter().any(|e| e == id) {+ return None;+ }+ let s = skills(store).into_iter().find(|s| s.id == id)?;+ let note = format!(+ "[Codync: the user picked the \"{}\" skill for this message. Read {} first and follow it.]",+ s.name,+ s.dir().join("SKILL.md").display()+ );+ Some(match rest.map(str::trim).filter(|r| !r.is_empty()) {+ Some(task) => format!("{note}\n\n{task}"),+ None => note,+ })+}++/// Skills used to start off for every bot; installs now turn them on everywhere, so the ones+/// installed before that are turned on once too.+pub fn turn_on_installed_once(store: &crate::store::Store) -> Result<()> {+ const DONE: &str = "skillsOnForEveryBot";+ if store.kv_get(DONE).is_some() {+ return Ok(());+ }+ let ids: Vec<String> = skills(store).into_iter().map(|s| s.id).collect();+ for row in store.bots()? {+ let mut cfg = row.config;+ if row.deleted || cfg.is_group() || ids.iter().all(|id| cfg.skills.contains(id)) {+ continue;+ }+ for id in &ids {+ if !cfg.skills.contains(id) {+ cfg.skills.push(id.clone());+ }+ }+ store.save_bot(&cfg)?;+ }+ store.kv_set(DONE, "1")+}+/// The skills block of a bot's profile: what each is for and where to read it.pub fn skills_brief(store: &crate::store::Store, enabled: &[String]) -> Option<String> {let lines: Vec<String> = skills(store)@@ -187,4 +288,50 @@ mod tests {let folded = "---\nname: guide\ndescription: >\n Walks you\n through it.\nlicense: MIT\n---\n";assert_eq!(front_matter(folded), (Some("guide".into()), Some("Walks you through it.".into())));}++ #[test]+ fn the_body_leaves_out_the_front_matter() {+ assert_eq!(body("---\nname: pdf\ndescription: x\n---\n\n# PDF\nUse it.\n"), "# PDF\nUse it.");+ assert_eq!(body("# No front matter\n"), "# No front matter");+ assert_eq!(body("---\nname: open\n"), "", "an unclosed front matter has no body");+ }++ #[test]+ fn slash_commands_name_an_enabled_skill() {+ assert_eq!(slash_command("/pd"), Some(("pd", None)));+ assert_eq!(slash_command("/pdf merge\nthese"), Some(("pdf", Some("merge\nthese"))));+ assert_eq!(slash_command("hi /pdf"), None);++ let store = crate::store::Store::open(std::path::Path::new(":memory:")).expect("memory store");+ let pdf = Skill { id: "pdf".into(), name: "PDF".into(), description: String::new(), source: "custom".into() };+ save(&store, "skills", std::slice::from_ref(&pdf)).expect("save skills");+ let on = ["pdf".to_owned()];+ let asked = expand_command(&store, &on, "/pdf merge these ").expect("an enabled skill");+ assert!(asked.starts_with("[Codync: the user picked the \"PDF\" skill"), "{asked}");+ assert!(asked.contains(&pdf.dir().join("SKILL.md").display().to_string()));+ assert!(asked.ends_with("]\n\nmerge these"), "{asked}");+ assert!(expand_command(&store, &on, "/pdf").expect("no task").ends_with("follow it.]"));+ assert_eq!(expand_command(&store, &[], "/pdf merge"), None, "a skill the bot has off");+ assert_eq!(expand_command(&store, &on, "/compact"), None, "the agent's own commands pass through");+ assert_eq!(expand_command(&store, &on, "/pdfx"), None);+ }++ #[test]+ fn installed_skills_turn_on_once() {+ let store = crate::store::Store::open(std::path::Path::new(":memory:")).expect("memory store");+ let pdf = Skill { id: "pdf".into(), name: "PDF".into(), description: String::new(), source: "custom".into() };+ save(&store, "skills", &[pdf]).expect("save skills");+ let mut cfg: crate::store::BotConfig = serde_json::from_value(+ json!({"id": "a", "name": "a", "backend": "fixture", "command": "true", "cwd": "/tmp", "notify": false}),+ )+ .expect("bot config");+ store.save_bot(&cfg).expect("save bot");+ let skills_of = |store: &crate::store::Store| store.bot("a").expect("read").expect("bot").config.skills;+ turn_on_installed_once(&store).expect("turn on");+ assert_eq!(skills_of(&store), ["pdf"]);+ cfg.skills.clear();+ store.save_bot(&cfg).expect("save bot");+ turn_on_installed_once(&store).expect("second run");+ assert!(skills_of(&store).is_empty(), "a skill turned off afterwards stays off");+ }}diff --git a/host/src/screen/helper.rs b/host/src/screen/helper.rsindex 0f07d61d..122c4868 100644--- a/host/src/screen/helper.rs+++ b/host/src/screen/helper.rs@@ -244,7 +244,8 @@ mod tests {}tokio::time::sleep(Duration::from_millis(10)).await;}- let res = screen.offer("local", "offer", None, None).await.unwrap();+ let local = screen.prepare("local", IceConfig::default()).unwrap();+ let res = screen.offer("local", "offer", local["session"].as_str().unwrap(), None).await.unwrap();assert_eq!(res["sdp"], "answer to offer");assert_eq!(screen.state()["viewers"], 1);assert_eq!(screen.state()["displays"][0]["name"], "Built-in");@@ -264,13 +265,13 @@ mod tests {screen.session_closed(res["session"].as_str().unwrap());assert_eq!(screen.state()["userControl"], true, "renewal keeps takeover while the replacement is pending");let id = prepared["session"].as_str().unwrap();- assert!(screen.offer("other", "offer", Some(id), None).await.is_err());- screen.offer("phone", "offer", Some(id), None).await.unwrap();+ assert!(screen.offer("other", "offer", id, None).await.is_err());+ screen.offer("phone", "offer", id, None).await.unwrap();let remote = observed_rx.recv().await.unwrap();assert_eq!(remote["params"]["iceServers"], prepared["iceServers"]);assert_eq!(remote["params"]["maxBitrateBps"], 4_000_000);assert_eq!(remote["params"]["maxFramerate"], 30);screen.sessions.locked().get_mut(id).unwrap().ice.expires_at = 0;- assert!(screen.offer("phone", "offer", Some(id), None).await.is_err());+ assert!(screen.offer("phone", "offer", id, None).await.is_err());}}diff --git a/host/src/screen/protocol.rs b/host/src/screen/protocol.rsindex e287ebb2..365015dc 100644--- a/host/src/screen/protocol.rs+++ b/host/src/screen/protocol.rs@@ -21,8 +21,6 @@ pub struct Display {pub struct HelperStatus {#[serde(default)]pub platform: String,- #[serde(default)]- pub version: String,/// Name to look for in the operating system's permission settings.#[serde(default)]pub permission_app: String,diff --git a/host/src/screen/viewer.rs b/host/src/screen/viewer.rsindex 2ffbf83b..946e2714 100644--- a/host/src/screen/viewer.rs+++ b/host/src/screen/viewer.rs@@ -52,22 +52,15 @@ impl Screen {self.sessions.locked().get(session).is_some_and(|v| v.owner == owner)}- /// Answers a prepared session or a direct offer from an older client.- pub async fn offer(&self, owner: &str, sdp: &str, session: Option<&str>, display: Option<u32>) -> Result<Value> {+ /// Answers an offer on a session `prepare` reserved.+ pub async fn offer(&self, owner: &str, sdp: &str, session: &str, display: Option<u32>) -> Result<Value> {let link = self.link()?;if !self.status.locked().capture {bail!("Codync isn't allowed to record this computer's screen yet. Allow it in System Settings there.");}- let session = match session {- Some(id) => id.to_owned(),- None => self.prepare(owner, IceConfig::default())?["session"]- .as_str()- .context("missing screen session")?- .to_owned(),- };let ice = {let sessions = self.sessions.locked();- let viewer = sessions.get(&session).filter(|v| v.owner == owner).context("unknown screen session")?;+ let viewer = sessions.get(session).filter(|v| v.owner == owner).context("unknown screen session")?;let now = crate::store::now_ms();if viewer.ice.expires_at <= now || (!viewer.started && viewer.pending_until <= now) {bail!("screen connection expired; reconnect to continue");@@ -89,10 +82,10 @@ impl Screen {Ok(res) => res,Err(error) => {// A helper can finish after the RPC times out. Keep retrying close until it acknowledges.- if let Some(viewer) = self.sessions.locked().get_mut(&session) {+ if let Some(viewer) = self.sessions.locked().get_mut(session) {viewer.ice.expires_at = 0;}- if let Err(close_error) = self.close(&session).await {+ if let Err(close_error) = self.close(session).await {tracing::warn!(error = format!("{close_error:#}"), "couldn't close failed screen session");}return Err(error);@@ -101,7 +94,7 @@ impl Screen {let answer = res["sdp"].as_str().ok_or_else(|| anyhow!("the screen helper sent no answer"))?;let accepted = {let mut sessions = self.sessions.locked();- if let Some(viewer) = sessions.get_mut(&session) {+ if let Some(viewer) = sessions.get_mut(session) {viewer.started = true;true} else {@@ -109,7 +102,7 @@ impl Screen {}};if !accepted || !self.enabled() {- self.close(&session).await?;+ self.close(session).await?;bail!("screen session closed while connecting");}self.emit();diff --git a/host/src/tui/app/analytics.rs b/host/src/tui/app/analytics.rsindex 799548dc..e30a128d 100644--- a/host/src/tui/app/analytics.rs+++ b/host/src/tui/app/analytics.rs@@ -1,38 +1,12 @@-//! Opt-in usage analytics: the one-time question, the ^k toggle and `app_opened`.+//! Usage analytics: the ^k toggle and `app_opened`. Sharing is on unless turned off.//! The TUI only talks to the host over its loopback API, so it can always decide for this computer.-use crossterm::event::{KeyCode, KeyEvent};use serde_json::{Value, json};-use super::{After, App, Overlay};--/// What a key does in the question.-#[derive(Debug, PartialEq, Eq)]-enum Pick {- /// Share (`true`) or don't.- Choose(bool),- /// Highlight this answer (`true` = Share usage).- Highlight(bool),- /// Close without answering: asked again next time.- Later,-}--fn pick(share: bool, code: KeyCode) -> Pick {- match code {- KeyCode::Char('y') => Pick::Choose(true),- KeyCode::Char('n') => Pick::Choose(false),- KeyCode::Enter => Pick::Choose(share),- KeyCode::Esc => Pick::Later,- KeyCode::Left | KeyCode::Char('h') => Pick::Highlight(true),- KeyCode::Right | KeyCode::Char('l') => Pick::Highlight(false),- KeyCode::Tab | KeyCode::BackTab => Pick::Highlight(!share),- _ => Pick::Highlight(share),- }-}+use super::{After, App};impl App {- /// Every `hello`: keep the setting; the first one of this run also reports the launch- /// and asks once when nobody has decided (a host without analytics has no such key).+ /// Every `hello`: keep the setting; the first one of this run also reports the launch.pub(super) fn analytics_hello(&mut self, v: &Value) {self.analytics = v["analytics"].as_bool();if self.opened {@@ -40,34 +14,15 @@ impl App {}self.opened = true;self.call("track", json!({"event": "app_opened"}), After::Tracked);- if v.get("analytics").is_some_and(Value::is_null) {- self.overlays.push(Overlay::Consent(true));- }}- pub(super) fn consent_key(&mut self, share: bool, k: KeyEvent) -> Option<Overlay> {- match pick(share, k.code) {- Pick::Choose(on) => {- self.set_analytics(on);- None- }- Pick::Highlight(share) => Some(Overlay::Consent(share)),- Pick::Later => None,- }- }-- /// ^k → Share usage analytics: flips it, or asks first when it was never decided.+ /// ^k → Share usage analytics: flips it.pub(super) fn toggle_analytics(&mut self) {- match self.analytics {- Some(on) => self.set_analytics(!on),- None => self.overlays.push(Overlay::Consent(true)),+ if let Some(on) = self.analytics {+ self.call("setAnalytics", json!({"enabled": !on}), After::Analytics);}}- fn set_analytics(&self, on: bool) {- self.call("setAnalytics", json!({"enabled": on}), After::Analytics);- }-pub(super) fn analytics_set(&mut self, v: &Value) {self.analytics = v["enabled"].as_bool();self.flash(if self.analytics == Some(true) {@@ -77,20 +32,3 @@ impl App {});}}--#[cfg(test)]-mod tests {- use super::*;-- #[test]- fn keys_choose_move_or_close() {- assert_eq!(pick(true, KeyCode::Char('n')), Pick::Choose(false));- assert_eq!(pick(false, KeyCode::Char('y')), Pick::Choose(true));- assert_eq!(pick(false, KeyCode::Enter), Pick::Choose(false));- assert_eq!(pick(true, KeyCode::Tab), Pick::Highlight(false));- assert_eq!(pick(true, KeyCode::Right), Pick::Highlight(false));- assert_eq!(pick(false, KeyCode::Left), Pick::Highlight(true));- assert_eq!(pick(false, KeyCode::Char('x')), Pick::Highlight(false));- assert_eq!(pick(true, KeyCode::Esc), Pick::Later);- }-}diff --git a/host/src/tui/app/events.rs b/host/src/tui/app/events.rsindex 1a673230..56578414 100644--- a/host/src/tui/app/events.rs+++ b/host/src/tui/app/events.rs@@ -296,11 +296,11 @@ impl App {}for o in &mut self.overlays {if let Overlay::Form(f) = o {+ // Connectors and skills start on for a new bot.if connectors {- // Connectors start on for a new bot.merge_toggles(&mut f.connectors, &self.market.0, f.bot_id.is_none());} else {- merge_toggles(&mut f.skills, &self.market.1, false);+ merge_toggles(&mut f.skills, &self.market.1, f.bot_id.is_none());}}}diff --git a/host/src/tui/app/forms.rs b/host/src/tui/app/forms.rsindex f78ec8a5..69537689 100644--- a/host/src/tui/app/forms.rs+++ b/host/src/tui/app/forms.rs@@ -173,12 +173,7 @@ impl App {.iter().map(|t| Toggle { id: t.id.clone(), name: t.name.clone(), on: true }).collect(),- skills: self- .market- .1- .iter()- .map(|t| Toggle { id: t.id.clone(), name: t.name.clone(), on: false })- .collect(),+ skills: self.market.1.iter().map(|t| Toggle { id: t.id.clone(), name: t.name.clone(), on: true }).collect(),field: 0,sub: 0,error: None,@@ -225,6 +220,15 @@ impl App {self.open_agent(&backend);return None;}+ KeyCode::Char('i') if field == Field::Skills => {+ let id = f.skills.get(f.sub).map(|t| t.id.clone());+ let skill = self.plugins.1.iter().find(|v| v["id"].as_str() == id.as_deref()).cloned();+ self.overlays.push(Overlay::Form(f));+ if let Some(v) = skill {+ self.open_skill(&v, false);+ }+ return None;+ }KeyCode::Left | KeyCode::Right if field == Field::Model => {let d: isize = if k.code == KeyCode::Left { -1 } else { 1 };self.want_models(&f.backend);diff --git a/host/src/tui/app/input.rs b/host/src/tui/app/input.rsindex 0f80c044..45627380 100644--- a/host/src/tui/app/input.rs+++ b/host/src/tui/app/input.rs@@ -89,6 +89,9 @@ impl App {self.typing = false;return;};+ if self.complete_skill(k) {+ return;+ }let ctrl = k.modifiers.contains(KeyModifiers::CONTROL);let newline = k.modifiers.intersects(KeyModifiers::SHIFT | KeyModifiers::ALT);let thread = self.thread.clone();@@ -157,6 +160,7 @@ impl App {draft.key(k);}}+ self.slash_typed();}pub(super) fn scroll_chat(&mut self, delta: isize) {diff --git a/host/src/tui/app/mod.rs b/host/src/tui/app/mod.rsindex 566c3c50..4e804dd6 100644--- a/host/src/tui/app/mod.rs+++ b/host/src/tui/app/mod.rs@@ -9,6 +9,7 @@ mod input;mod model;mod navigate;mod overlay_keys;+mod slash;mod ui;pub use editor::Editor;@@ -102,9 +103,9 @@ pub struct App {/// (empty when it asked for everything): unknown entries below it are rewrites of old ones.floors: HashMap<String, i64>,pub hint: Option<(String, Instant)>,- /// Whether this computer shares usage analytics (`None`: nobody decided yet).+ /// Whether this computer shares usage analytics (`None`: before the first `hello`).pub analytics: Option<bool>,- /// The first `hello` of this run was handled (`app_opened`, the analytics question).+ /// The first `hello` of this run was handled (`app_opened`).opened: bool,}diff --git a/host/src/tui/app/model.rs b/host/src/tui/app/model.rsindex d127fe57..007e0c20 100644--- a/host/src/tui/app/model.rs+++ b/host/src/tui/app/model.rs@@ -33,7 +33,7 @@ pub enum After {Sent(String),Connection(String, super::super::connections::Step),Hello,- /// `track`: fire and forget (an older host doesn't know it).+ /// `track`: fire and forget; analytics never surfaces an error.Tracked,Analytics,History(String),diff --git a/host/src/tui/app/overlay_keys.rs b/host/src/tui/app/overlay_keys.rsindex 9f228e16..ffb664e6 100644--- a/host/src/tui/app/overlay_keys.rs+++ b/host/src/tui/app/overlay_keys.rs@@ -108,7 +108,7 @@ impl App {Overlay::Market(m) => self.market_key(m, k),Overlay::Agent(a) => self.agent_key(a, k),Overlay::Fields(f) => self.fields_key(f, k),- Overlay::Consent(share) => self.consent_key(share, k),+ Overlay::Skill(s) => self.skill_key(s, k),o @ (Overlay::Usage | Overlay::Pair(_)) => {if matches!(k.code, KeyCode::Esc | KeyCode::Enter | KeyCode::Char('q' | 'U' | 'P')) {Nonediff --git a/host/src/tui/app/slash.rs b/host/src/tui/app/slash.rsnew file mode 100644index 00000000..de47fb8d--- /dev/null+++ b/host/src/tui/app/slash.rs@@ -0,0 +1,93 @@+//! The composer's `/` menu: the bot's skills, offered while the draft is just `/partial`.++use crossterm::event::{KeyCode, KeyEvent};+use serde_json::json;++use super::{After, App, Editor};++/// A skill the menu offers.+pub struct SkillMatch {+ pub id: String,+ pub name: String,+ pub description: String,+}++impl App {+ /// The selected bot's skills whose id or name holds the `/partial` being typed (none in a group).+ pub fn skill_matches(&self) -> Vec<SkillMatch> {+ let Some(bot) = self.bot().filter(|b| !b.group) else { return vec![] };+ let draft = self.draft();+ let Some((query, None)) = crate::market::slash_command(&draft.text) else { return vec![] };+ let query = query.to_lowercase();+ self.plugins+ .1+ .iter()+ .filter_map(|s| {+ let id = s["id"].as_str()?;+ let name = s["name"].as_str().unwrap_or(id);+ let hit = id.contains(&query) || name.to_lowercase().contains(&query);+ (hit && bot.skills.iter().any(|on| on == id)).then(|| SkillMatch {+ id: id.to_owned(),+ name: name.to_owned(),+ description: s["description"].as_str().unwrap_or_default().to_owned(),+ })+ })+ .collect()+ }++ /// Tab, or Return before the name is complete, fills in the first match. Returns whether it did.+ pub(super) fn complete_skill(&mut self, k: KeyEvent) -> bool {+ if !k.modifiers.is_empty() || !matches!(k.code, KeyCode::Tab | KeyCode::Enter) {+ return false;+ }+ let matches = self.skill_matches();+ let Some(first) = matches.first() else { return false };+ let typed = self.draft().text;+ // `/pdf` already names a skill: Return sends it.+ if k.code == KeyCode::Enter && matches.iter().any(|m| typed[1..] == m.id) {+ return false;+ }+ let Some(key) = self.draft_key() else { return false };+ self.drafts.insert(key, Editor::with(&format!("/{} ", first.id)));+ true+ }++ /// Starting a draft with `/` loads the computer's skills again, so the menu is current.+ pub(super) fn slash_typed(&self) {+ if self.bot().is_some_and(|b| !b.group) && self.draft().text == "/" {+ self.call("skills", json!({}), After::Skills);+ }+ }+}++#[cfg(test)]+mod tests {+ use super::super::{Bot, test_app};+ use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};+ use serde_json::json;++ #[tokio::test]+ async fn the_menu_offers_and_fills_in_the_bots_skills() {+ let mut app = test_app();+ let bot = Bot::parse(&json!({"id": "b", "name": "Bot", "skills": ["pdf", "docx"]})).expect("a bot parses");+ app.bots.insert("b".into(), bot);+ app.selected = Some("b".into());+ app.plugins.1 = vec![+ json!({"id": "pdf", "name": "pdf", "description": "PDFs"}),+ json!({"id": "docx", "name": "docx"}),+ json!({"id": "xlsx", "name": "xlsx"}),+ ];+ let ids = |app: &super::App| app.skill_matches().into_iter().map(|m| m.id).collect::<Vec<_>>();+ let key = |code| KeyEvent::new(code, KeyModifiers::NONE);+ app.drafts.insert("b".into(), super::Editor::with("/"));+ assert_eq!(ids(&app), ["pdf", "docx"], "only skills the bot has on");+ app.drafts.insert("b".into(), super::Editor::with("/pd"));+ assert_eq!(ids(&app), ["pdf"]);+ assert!(app.complete_skill(key(KeyCode::Enter)), "Return fills in an unfinished name");+ assert_eq!(app.draft().text, "/pdf ");+ assert!(ids(&app).is_empty(), "the menu closes once the name is done");+ app.drafts.insert("b".into(), super::Editor::with("/pdf"));+ assert!(!app.complete_skill(key(KeyCode::Enter)), "a full name sends");+ assert!(app.complete_skill(key(KeyCode::Tab)));+ }+}diff --git a/host/src/tui/app/ui.rs b/host/src/tui/app/ui.rsindex 3e5da1ce..1abe2d7c 100644--- a/host/src/tui/app/ui.rs+++ b/host/src/tui/app/ui.rs@@ -3,7 +3,9 @@use ratatui::layout::Rect;use std::time::Instant;-use super::super::manage::{AgentSetup, BotChatSheet, Fields, Market, MemorySheet, RoutineForm, RoutineList};+use super::super::manage::{+ AgentSetup, BotChatSheet, Fields, Market, MemorySheet, RoutineForm, RoutineList, SkillSheet,+};use super::{Editor, Mark};#[derive(Clone, Copy, PartialEq, Eq, Debug)]@@ -245,8 +247,7 @@ pub enum Overlay {Market(Box<Market>),Agent(AgentSetup),Fields(Box<Fields>),- /// The one-time analytics question; `true` highlights Share usage.- Consent(bool),+ Skill(SkillSheet),}pub struct Toast {diff --git a/host/src/tui/manage/market.rs b/host/src/tui/manage/market.rsindex 5eb1e5a7..9ef22025 100644--- a/host/src/tui/manage/market.rs+++ b/host/src/tui/manage/market.rs@@ -145,7 +145,7 @@ impl App {Custom,Install(Value),More,- Skill(String),+ Skill(Value, bool),None,}let act = match self.market_rows(&m).get(m.cursor) {@@ -154,7 +154,8 @@ impl App {Some(Row::Custom) => Act::Custom,Some(Row::Registry(c)) => Act::Install((*c).clone()),Some(Row::More) => Act::More,- Some(Row::Skill(v)) => Act::Skill(s(v, "source")),+ Some(Row::Skill(v)) => Act::Skill((*v).clone(), true),+ Some(Row::OwnSkill(v)) => Act::Skill((*v).clone(), false),_ => Act::None,};match act {@@ -238,9 +239,10 @@ impl App {Reply::Registry { more: true },);}- Act::Skill(source) => {- self.flash("Installing the skill…");- self.sheet("installSkill", json!({"source": source}), Reply::FieldsSaved);+ Act::Skill(v, catalog) => {+ self.overlays.push(Overlay::Market(m));+ self.open_skill(&v, catalog);+ return None;}Act::None => {}}diff --git a/host/src/tui/manage/mod.rs b/host/src/tui/manage/mod.rsindex db161237..703aba2e 100644--- a/host/src/tui/manage/mod.rs+++ b/host/src/tui/manage/mod.rs@@ -12,9 +12,11 @@ mod market;mod memory;mod replies;mod routines;+mod skill;pub use memory::{MemoryMode, MemorySheet};pub use routines::local_zone;+pub use skill::SkillSheet;use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};use serde_json::{Value, json};@@ -46,6 +48,8 @@ pub enum Reply {more: bool,},Skills,+ /// A skill's instructions, for the details sheet with that id.+ SkillDetails(String),Auth(String),Setup,FieldsSaved,diff --git a/host/src/tui/manage/replies.rs b/host/src/tui/manage/replies.rsindex cb7d3ac1..9606a2f6 100644--- a/host/src/tui/manage/replies.rs+++ b/host/src/tui/manage/replies.rs@@ -74,6 +74,15 @@ impl App {}}}+ Reply::SkillDetails(id) => {+ for o in &mut self.overlays {+ if let Overlay::Skill(s) = o+ && s.id == id+ {+ s.markdown = Some(v["markdown"].as_str().unwrap_or_default().to_owned());+ }+ }+ }Reply::BotChat { bot, peer } => {let entries: Vec<Entry> =v["entries"].as_array().into_iter().flatten().filter_map(Entry::parse).map(|(_, e)| e).collect();@@ -262,6 +271,15 @@ impl App {}self.flash(&e);}+ Reply::SkillDetails(id) => {+ for o in &mut self.overlays {+ if let Overlay::Skill(s) = o+ && s.id == *id+ {+ s.error = Some(e.clone());+ }+ }+ }Reply::Memory(_)| Reply::MemorySaved(_)| Reply::MemoryDetail(_)diff --git a/host/src/tui/manage/skill.rs b/host/src/tui/manage/skill.rsnew file mode 100644index 00000000..c98a0a53--- /dev/null+++ b/host/src/tui/manage/skill.rs@@ -0,0 +1,102 @@+//! A skill's details sheet: its instructions (`SKILL.md`), with ↵ to install one from the catalog.++use std::cell::Cell;++use crossterm::event::{KeyCode, KeyEvent};+use serde_json::{Value, json};++use super::super::app::{App, Overlay};+use super::{Reply, ctrl};++pub struct SkillSheet {+ /// The installed skill's id, or `catalog/<source>`.+ pub id: String,+ pub name: String,+ pub description: String,+ /// A catalog skill's folder in anthropics/skills; `None` for an installed one.+ pub source: Option<String>,+ /// The instructions; `None` while they load.+ pub markdown: Option<String>,+ pub error: Option<String>,+ /// Lines down from the top.+ pub scroll: usize,+ /// Set by the last draw, for clamping the scroll and paging.+ pub max_scroll: Cell<usize>,+ pub page: Cell<usize>,+}++impl App {+ /// Opens the details of an installed skill (`v` from `skills`) or, with `catalog`, of one+ /// from `marketSkills`.+ pub(in crate::tui) fn open_skill(&mut self, v: &Value, catalog: bool) {+ let text = |k: &str| v[k].as_str().unwrap_or_default().to_owned();+ let source = catalog.then(|| text("source"));+ let id = source.as_ref().map_or_else(|| text("id"), |s| format!("catalog/{s}"));+ let body = source.as_ref().map_or_else(|| json!({"id": id}), |s| json!({"source": s}));+ self.sheet("skillDetails", body, Reply::SkillDetails(id.clone()));+ self.overlays.push(Overlay::Skill(SkillSheet {+ id,+ name: text("name"),+ description: text("description"),+ source,+ markdown: None,+ error: None,+ scroll: 0,+ max_scroll: Cell::default(),+ page: Cell::default(),+ }));+ }++ /// Whether the sheet's skill is on this computer (a catalog one after it was installed).+ pub(in crate::tui) fn skill_installed(&self, s: &SkillSheet) -> bool {+ s.source.as_deref().is_none_or(|source| {+ let id = crate::market::slug(source);+ self.plugins.1.iter().any(|v| v["id"] == id.as_str())+ })+ }++ pub(in crate::tui) fn skill_key(&mut self, mut s: SkillSheet, k: KeyEvent) -> Option<Overlay> {+ let max = s.max_scroll.get();+ let half = (s.page.get() / 2).max(1);+ match k.code {+ KeyCode::Esc | KeyCode::Char('q') => return None,+ KeyCode::Enter => match s.source.clone().filter(|_| !self.skill_installed(&s)) {+ Some(source) => {+ self.flash("Installing the skill…");+ self.sheet("installSkill", json!({"source": source}), Reply::FieldsSaved);+ }+ None => return None,+ },+ KeyCode::Down | KeyCode::Char('j') => s.scroll = (s.scroll + 1).min(max),+ KeyCode::Up | KeyCode::Char('k') => s.scroll = s.scroll.saturating_sub(1),+ KeyCode::PageDown => s.scroll = (s.scroll + half).min(max),+ KeyCode::PageUp => s.scroll = s.scroll.saturating_sub(half),+ KeyCode::Char('d') if ctrl(k) => s.scroll = (s.scroll + half).min(max),+ KeyCode::Char('u') if ctrl(k) => s.scroll = s.scroll.saturating_sub(half),+ _ => {}+ }+ Some(Overlay::Skill(s))+ }+}++#[cfg(test)]+mod tests {+ use super::super::super::app::{App, Overlay};+ use super::super::super::net::Client;+ use serde_json::json;++ #[tokio::test]+ async fn a_catalog_skill_counts_as_installed_once_the_computer_has_it() {+ let (tx, _rx) = tokio::sync::mpsc::unbounded_channel();+ let mut app = App::new(Client::new("http://127.0.0.1:1", None), tx, String::new());+ app.open_skill(&json!({"source": "Doc-Coauthoring", "name": "doc", "description": "Docs"}), true);+ let Some(Overlay::Skill(s)) = app.overlays.pop() else { unreachable!("open_skill shows its sheet") };+ assert_eq!((s.id.as_str(), s.source.as_deref()), ("catalog/Doc-Coauthoring", Some("Doc-Coauthoring")));+ assert!(!app.skill_installed(&s));+ app.plugins.1 = vec![json!({"id": "doc-coauthoring"})];+ assert!(app.skill_installed(&s), "installed under its slug");+ app.open_skill(&json!({"id": "mine", "name": "Mine", "source": "custom"}), false);+ let Some(Overlay::Skill(own)) = app.overlays.pop() else { unreachable!("open_skill shows its sheet") };+ assert_eq!((own.id.as_str(), own.source), ("mine", None), "an installed skill is looked up by id");+ }+}diff --git a/host/src/tui/sheets.rs b/host/src/tui/sheets.rsindex f70687d8..69f3760d 100644--- a/host/src/tui/sheets.rs+++ b/host/src/tui/sheets.rs@@ -239,7 +239,7 @@ pub fn market(buf: &mut Buffer, area: Rect, app: &App, m: &Market) {let keys = match m.tab {Tab::Agents => "tab switch · ↵ install / sign in · ^r refresh · esc close",Tab::Connectors => "tab switch · ↵ add / sign in · ^x remove · ^r refresh · esc",- Tab::Skills => "tab switch · ↵ install · ^x remove · esc close",+ Tab::Skills => "tab switch · ↵ details · ^x remove · esc close",};let loading = m.loading && m.tab == Tab::Connectors && !rows.is_empty();footer(buf, inner, m.error.as_deref().or(loading.then_some("Loading the registry…")), keys);diff --git a/host/src/tui/view/chat.rs b/host/src/tui/view/chat.rsindex 47a60751..453d41e4 100644--- a/host/src/tui/view/chat.rs+++ b/host/src/tui/view/chat.rs@@ -186,6 +186,27 @@ pub(super) fn chat(buf: &mut Buffer, r: Rect, app: &mut App, narrow: bool) {let s = format!(" ↓ {} more ", app.chat_scroll);rput(buf, r.right() - 1, box_top.saturating_sub(1), &s, t.btn);}+ if typing {+ skill_menu(buf, body, app);+ }+}++/// The `/` menu over the bottom of the transcript: the bot's skills matching what's typed.+fn skill_menu(buf: &mut Buffer, body: Rect, app: &App) {+ let t = theme();+ let matches = app.skill_matches();+ let n = u(matches.len().min(5)).min(body.height);+ for (i, m) in matches.iter().take(usize::from(n)).enumerate() {+ let y = body.bottom() - n + u(i);+ fill(buf, Rect::new(body.x, y, body.width, 1), t.panel);+ let name = if i == 0 { t.bold } else { t.text };+ let x = put(buf, body.x + 3, y, 26, &truncate(&format!("/{}", m.id), 26), name.patch(t.panel)) + 2;+ let hint = if i == 0 { "tab fills in" } else { "" };+ let rx = rput(buf, body.right() - 1, y, hint, t.dim.patch(t.panel));+ let about = if m.description.is_empty() { &m.name } else { &m.description };+ let room = usize::from(rx.saturating_sub(x + 1));+ put(buf, x, y, u(room), &truncate(&about.replace('\n', " "), room), t.secondary.patch(t.panel));+ }}/// Wraps the draft; returns display lines and the cursor's (column, line).diff --git a/host/src/tui/view/consent.rs b/host/src/tui/view/consent.rsdeleted file mode 100644index 6771beed..00000000--- a/host/src/tui/view/consent.rs+++ /dev/null@@ -1,41 +0,0 @@-//! The one-time usage analytics question (same copy as the phone and desktop apps).--use ratatui::buffer::Buffer;-use ratatui::layout::Rect;-use ratatui::style::Modifier;-use ratatui::text::{Line, Span};--use super::super::md::wrap;-use super::buffer::{centered, frame_box, put, put_line, u};-use super::style::theme;--const LEAD: &str =- "Codync can record which features you use on this computer, like creating a bot or sending a message.";-const POINTS: [&str; 3] = [- "Never your messages, code, files, prompts or bot names.",- "Never sold or used for ads. Linked to your Codync account when you're signed in.",- "Turn it off anytime: ^k → Share usage analytics.",-];--pub(super) fn consent(buf: &mut Buffer, area: Rect, share: bool) {- let t = theme();- let width: u16 = 66;- let text = t.text.patch(t.panel);- let w = usize::from(width - 4);- let mut lines = wrap(&[Span::styled(LEAD, text)], w, &[], &[]);- lines.push(Line::default());- for point in POINTS {- lines.extend(wrap(&[Span::styled("· ", t.dim.patch(t.panel)), Span::styled(point, text)], w, &[], &[]));- }- let r = centered(area, width, u(lines.len() + 6));- let inner = frame_box(buf, r, t.text, t.panel, Some(("Help improve Codync", t.text)));- let mut y = inner.y;- for l in &lines {- put_line(buf, inner.x, y, inner.width, l);- y += 1;- }- let style = |on: bool| if on { t.sel } else { t.text.patch(t.btn) }.add_modifier(Modifier::BOLD);- let x = put(buf, inner.x, y + 1, 20, " y Share usage ", style(share)) + 1;- let x = put(buf, x, y + 1, 20, " n Don't share ", style(!share)) + 2;- put(buf, x, y + 1, inner.right().saturating_sub(x), "esc later", t.dim.patch(t.panel));-}diff --git a/host/src/tui/view/forms.rs b/host/src/tui/view/forms.rsindex 00cf3ca0..6d6ac6f1 100644--- a/host/src/tui/view/forms.rs+++ b/host/src/tui/view/forms.rs@@ -194,7 +194,8 @@ pub(super) fn form_view(buf: &mut Buffer, area: Rect, app: &App, f: &Form) {put(buf, x, by, 12, " esc Cancel ", t.text.patch(t.btn).add_modifier(Modifier::BOLD));let hint = match f.current() {Field::Folder => "↵ project folder · backspace personal · tab next field",- Field::Connectors | Field::Skills => "←→ move · space toggle · tab next",+ Field::Connectors => "←→ move · space toggle · tab next",+ Field::Skills => "←→ move · space toggle · i details · tab next",Field::Agent => "←→ change · ↵ install / sign in · tab next",Field::Model => "←→ pick a model · or type its id",Field::Color | Field::Shape | Field::Approvals | Field::Notify | Field::Computer => {diff --git a/host/src/tui/view/goto.rs b/host/src/tui/view/goto.rsindex 768f05ac..daef43ee 100644--- a/host/src/tui/view/goto.rs+++ b/host/src/tui/view/goto.rs@@ -86,7 +86,7 @@ pub(super) fn goto(buf: &mut Buffer, area: Rect, app: &mut App, g: &super::superlet hint = match (a, app.analytics) {(Action::Analytics, Some(true)) => "on",(Action::Analytics, Some(false)) => "off",- (Action::Analytics, None) => "not set",+ (Action::Analytics, None) => "",_ => key,};rput(buf, inner.right(), y, hint, t.dim.patch(base));diff --git a/host/src/tui/view/mod.rs b/host/src/tui/view/mod.rsindex e48938a2..5b4fd137 100644--- a/host/src/tui/view/mod.rs+++ b/host/src/tui/view/mod.rs@@ -10,7 +10,6 @@ mod bot_chat;mod buffer;mod chat;mod computer_access;-mod consent;mod forms;mod goto;mod help;@@ -18,6 +17,7 @@ mod overlay;mod pair;mod permission;mod roster;+mod skill;mod style;mod time;mod trace;diff --git a/host/src/tui/view/overlay.rs b/host/src/tui/view/overlay.rsindex 5d3c16fe..892a9cdd 100644--- a/host/src/tui/view/overlay.rs+++ b/host/src/tui/view/overlay.rs@@ -8,7 +8,6 @@ use ratatui::style::{Modifier, Style};use super::super::app::{App, Editor, NEW_GROUP, Overlay, tilde};use super::super::md::{truncate, width as w};use super::buffer::{centered, dim_all, frame_box, put, restyle, rput, u};-use super::consent::consent;use super::forms::{form_view, group_view};use super::goto::goto;use super::help::help;@@ -196,7 +195,7 @@ pub(super) fn overlay(buf: &mut Buffer, area: Rect, app: &mut App, top: &OverlayOverlay::Market(m) => super::super::sheets::market(buf, area, app, m),Overlay::Agent(a) => super::super::sheets::agent(buf, area, app, a),Overlay::Fields(f) => super::super::sheets::fields(buf, area, f),- Overlay::Consent(share) => consent(buf, area, *share),+ Overlay::Skill(s) => super::skill::skill(buf, area, app, s),}}diff --git a/host/src/tui/view/skill.rs b/host/src/tui/view/skill.rsnew file mode 100644index 00000000..c22ecbf8--- /dev/null+++ b/host/src/tui/view/skill.rs@@ -0,0 +1,46 @@+//! A skill's details sheet: its description and instructions.++use ratatui::buffer::Buffer;+use ratatui::layout::Rect;+use ratatui::text::{Line, Span};++use super::super::app::App;+use super::super::manage::SkillSheet;+use super::super::md;+use super::buffer::{centered, frame_box, hline, put, put_line, u};+use super::style::theme;++pub(super) fn skill(buf: &mut Buffer, area: Rect, app: &App, s: &SkillSheet) {+ let t = theme();+ let r = centered(area, 84, area.height.saturating_sub(4));+ let inner = frame_box(buf, r, t.text, t.panel, Some((&s.name, t.text)));+ if inner.height < 5 {+ return;+ }+ let keys = if app.skill_installed(s) {+ " installed · ↑↓ scroll · esc close"+ } else {+ " ↵ install · ↑↓ scroll · esc close"+ };+ hline(buf, inner.x, inner.bottom() - 2, inner.width, t.dim.patch(t.panel));+ put(buf, inner.x, inner.bottom() - 1, inner.width, keys, t.dim.patch(t.panel));++ let body = Rect::new(inner.x, inner.y, inner.width, inner.height - 2);+ let width = usize::from(body.width);+ let mut lines =+ md::wrap(&[Span::styled(s.description.clone(), t.secondary)], width, &[Span::raw(" ")], &[Span::raw(" ")]);+ lines.push(Line::default());+ match (&s.markdown, &s.error) {+ (_, Some(e)) => lines.push(Line::from(Span::styled(format!(" {e}"), t.red))),+ (None, None) => lines.push(Line::from(Span::styled(" Loading…", t.dim))),+ (Some(m), None) if m.is_empty() => lines.push(Line::from(Span::styled(" No instructions.", t.dim))),+ (Some(m), None) => lines.extend(md::render(m, width, 1)),+ }+ let h = usize::from(body.height);+ let max = lines.len().saturating_sub(h);+ s.max_scroll.set(max);+ s.page.set(h);+ for (i, l) in lines.iter().skip(s.scroll.min(max)).take(h).enumerate() {+ put_line(buf, body.x, body.y + u(i), body.width, l);+ }+}diff --git a/host/src/update/install.rs b/host/src/update/install.rsindex 8a58e52d..722e00fe 100644--- a/host/src/update/install.rs+++ b/host/src/update/install.rs@@ -14,7 +14,7 @@ pub enum Method {pub fn method(executable: &Path) -> Method {let path = executable.to_string_lossy();- // The Mac app's bundle, or the Windows app's `resources` folder.+ // The desktop app's macOS bundle, or its Windows `resources` folder.if path.contains(".app/Contents/") || (cfg!(windows) && path.contains("\\resources\\")) {Method::AppBundle} else if path.contains("/Cellar/") || path.contains("/linuxbrew/") {diff --git a/host/src/update/tests.rs b/host/src/update/tests.rsindex 33ccfd13..a860e71d 100644--- a/host/src/update/tests.rs+++ b/host/src/update/tests.rs@@ -189,7 +189,7 @@ async fn a_healthy_update_replaces_the_binary_and_removes_its_backup() {#[test]fn app_and_homebrew_binaries_keep_their_installation_owner() {assert_eq!(- install::method(std::path::Path::new("/Applications/Codync.app/Contents/MacOS/codync-host")),+ install::method(std::path::Path::new("/Applications/Codync.app/Contents/Resources/codync-host")),install::Method::AppBundle);assert_eq!(diff --git a/host/src/voice.rs b/host/src/voice.rsindex aa93c1cc..11d213c2 100644--- a/host/src/voice.rs+++ b/host/src/voice.rs@@ -206,7 +206,7 @@ pub fn status(store: &Store) -> Result<Value> {.iter().map(|&p| {let defaults = defaults(store, p);- json!({"provider": p.id(), "configured": !keys.get(p).is_empty(), "defaultModel": defaults.realtime, "defaults": defaults})+ json!({"provider": p.id(), "configured": !keys.get(p).is_empty(), "defaults": defaults})}).collect();Ok(json!({"providers": providers}))diff --git a/host/tests/common/mod.rs b/host/tests/common/mod.rsindex 4462d8e8..d31800c0 100644--- a/host/tests/common/mod.rs+++ b/host/tests/common/mod.rs@@ -44,3 +44,43 @@ pub fn python_agent(script: &std::path::Path) -> String {format!("{} -u '{}'", python(), path.replace('\'', "'\\''"))}}++/// What a client holds after the event stream's catch-up: `{"rev", "bots": [...], "entries": [...]}`,+/// the newest row per id. Reads until the stream goes quiet.+pub async fn snapshot(base: &str, token: &str) -> serde_json::Value {+ use futures::StreamExt as _;+ let res = reqwest::Client::new()+ .get(format!("{base}/events?since=0&client=test"))+ .bearer_auth(token)+ .send()+ .await+ .expect("open the event stream");+ let mut body = res.bytes_stream();+ let mut buf = String::new();+ let (mut rev, mut bots, mut entries) = (serde_json::Value::Null, Vec::<serde_json::Value>::new(), Vec::new());+ while let Ok(Some(Ok(chunk))) = tokio::time::timeout(Duration::from_millis(300), body.next()).await {+ buf.push_str(&String::from_utf8_lossy(&chunk));+ while let Some(i) = buf.find('\n') {+ let line: String = buf.drain(..=i).collect();+ let Some(event) = line+ .trim_end()+ .strip_prefix("data:")+ .and_then(|data| serde_json::from_str::<serde_json::Value>(data.trim_start()).ok())+ else {+ continue;+ };+ let (rows, row) = match event["type"].as_str() {+ Some("hello") => {+ rev = event["rev"].clone();+ continue;+ }+ Some("bot") => (&mut bots, event["bot"].clone()),+ Some("entry") => (&mut entries, event["entry"].clone()),+ _ => continue,+ };+ rows.retain(|r| r["id"] != row["id"]);+ rows.push(row);+ }+ }+ serde_json::json!({"rev": rev, "bots": bots, "entries": entries})+}diff --git a/host/tests/e2e.rs b/host/tests/e2e.rsindex 765165f7..f4e90f40 100644--- a/host/tests/e2e.rs+++ b/host/tests/e2e.rs@@ -146,7 +146,7 @@ async fn turn_with_approval_reaches_a_final_reply() {let card = host.wait_for(&bot, |e| e["kind"] == "permission" && e["data"]["status"] == "pending").await;assert_eq!(card["data"]["title"], "Edit a.txt");- let bots = host.call("sync", json!({"since": 0})).await;+ let bots = common::snapshot(&host.base, &host.token).await;assert_eq!(bots["bots"][0]["status"], "needsInput");host.call("respondPermission", json!({"entryId": card["id"], "optionId": "allow"})).await;@@ -163,7 +163,7 @@ async fn turn_with_approval_reaches_a_final_reply() {assert_eq!(tool["data"]["status"], "completed");assert_eq!(tool["data"]["diffs"][0]["added"], 1);- let synced = host.call("sync", json!({"since": 0})).await;+ let synced = common::snapshot(&host.base, &host.token).await;assert_eq!(synced["bots"][0]["status"], "idle");assert_eq!(synced["bots"][0]["unread"], 1);}@@ -210,7 +210,7 @@ async fn sent_messages_are_the_reply() {host.call("respondPermission", json!({"entryId": card["id"], "optionId": "allow"})).await;let deadline = Instant::now() + Duration::from_secs(20);- while host.call("sync", json!({"since": 0})).await["bots"][0]["status"] != "idle" {+ while common::snapshot(&host.base, &host.token).await["bots"][0]["status"] != "idle" {assert!(Instant::now() < deadline, "turn didn't finish");tokio::time::sleep(Duration::from_millis(100)).await;}diff --git a/host/tests/files_e2e.rs b/host/tests/files_e2e.rsindex b21a08ef..e61040c5 100644--- a/host/tests/files_e2e.rs+++ b/host/tests/files_e2e.rs@@ -307,7 +307,7 @@ async fn files_only_turns_finish_without_duplicate_text_and_input_uploads_still_.iter().filter(|e| e["kind"] == "agent" && e["data"]["final"] == true).collect();- let sync = host.call("sync", json!({"since":0})).await;+ let sync = common::snapshot(&host.base, &host.token).await;if final_entries.len() == 4&& sync["bots"].as_array().unwrap().iter().any(|b| b["id"] == bot && b["status"] == "idle"){diff --git a/host/tests/routines_e2e.rs b/host/tests/routines_e2e.rsindex f70ad8ed..4deb8187 100644--- a/host/tests/routines_e2e.rs+++ b/host/tests/routines_e2e.rs@@ -3,6 +3,7 @@#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]+#[allow(dead_code)]mod common;use serde_json::{Value, json};diff --git a/host/tests/team_e2e.rs b/host/tests/team_e2e.rsindex b3fc8d9e..77191c30 100644--- a/host/tests/team_e2e.rs+++ b/host/tests/team_e2e.rs@@ -98,7 +98,7 @@ impl Host {async fn wait_finished(&self) -> Value {let completed = tokio::time::timeout(Duration::from_secs(20), async {loop {- let sync = self.call("sync", json!({"since": 0})).await;+ let sync = common::snapshot(&self.base, &self.token).await;let mut notices =sync["entries"].as_array().unwrap().iter().filter(|e| e["data"]["delegationId"].is_string());if sync["bots"].as_array().unwrap().iter().all(|b| b["status"] == "idle")@@ -134,7 +134,7 @@ async fn agent_uses_team_mcp_and_returns_the_reviewers_answer() {host.call("respondPermission", json!({"entryId": permission["id"], "optionId": "allow"})).await;let final_reply = host.wait_for(&lead, |e| e["kind"] == "agent" && e["data"]["final"] == true).await;assert_eq!(final_reply["data"]["text"], "Team reply: reply: PERMISSION review the changes");- let sync = host.call("sync", json!({"since": 0})).await;+ let sync = common::snapshot(&host.base, &host.token).await;let requests: Vec<_> =sync["entries"].as_array().unwrap().iter().filter(|e| e["data"]["delegationId"].is_string()).collect();assert_eq!(requests.len(), 2);@@ -175,7 +175,7 @@ async fn agent_messages_another_bot_then_finishes_before_recipient_approval() {let report = host.wait_for(&reviewer, |e| e["kind"] == "agent" && e["data"]["final"] == true).await;assert_eq!(report["data"]["text"], "reply: PERMISSION review the changes");host.wait_for(&reviewer, |e| e["kind"] == "notice" && e["data"]["status"] == "completed").await;- let sync = host.call("sync", json!({"since": 0})).await;+ let sync = common::snapshot(&host.base, &host.token).await;let notices: Vec<_> =sync["entries"].as_array().unwrap().iter().filter(|e| e["data"]["delegationId"].is_string()).collect();assert_eq!(notices.len(), 2);diff --git a/host/tests/turns_e2e.rs b/host/tests/turns_e2e.rsindex ec2d648d..132b6b86 100644--- a/host/tests/turns_e2e.rs+++ b/host/tests/turns_e2e.rs@@ -111,7 +111,7 @@ async fn stop_ends_a_turn_whose_agent_ignores_the_cancel() {host.call("stop", json!({"botId": bot})).await;// The agent never answers: after the grace period its process is stopped and the turn ends.host.wait_for(&bot, Duration::from_secs(40), |e| e["kind"] == "notice" && e["data"]["text"] == "Stopped.").await;- let sync = host.call("sync", json!({"since": 0})).await;+ let sync = common::snapshot(&host.base, &host.token).await;assert_eq!(sync["bots"][0]["status"], "idle");}diff --git a/metadata/version/en-US.json b/metadata/version/en-US.jsonindex 7c267d54..6b8fdc6e 100644--- a/metadata/version/en-US.json+++ b/metadata/version/en-US.json@@ -1,7 +1,6 @@{- "description": "Message your coding agents like teammates.\n\nCodync turns the coding agents on your computer — Claude Code, Codex, Cursor, Pi, OpenCode, Grok Build, Gemini, GitHub Copilot and dozens more — into persistent bots you delegate to from your iPhone. Pick who, say what, put the phone away.\n\nBOTS, NOT SESSIONS\nGive each bot a name, a character, standing instructions, an agent and a project folder. Each bot is one ongoing conversation, so there's no hunting for the right session or setting up an environment every time — just open the chat and type.\n\nAPPROVE FROM ANYWHERE\nWhen an agent wants to run a command or change files, an approval card arrives in the chat: Allow once, Always allow or Deny. You get a notification only when a bot needs you or finishes.\n\nA CALM CHAT\nThe conversation shows your messages and each final reply. Every command, file change, plan and thought is one tap away in Full conversation. While a bot works, you see what it's doing right now.\n\nUSAGE AT A GLANCE\nSee your Claude and Codex subscription limits in the app, in widgets and on the Lock Screen. Follow a working bot in a Live Activity and the Dynamic Island.\n\nYOUR COMPUTER, YOUR CODE\nAgents run on your Mac or Linux machine with your own logins. Away from home, the free built-in relay connects your phone end-to-end encrypted, so it only ever forwards ciphertext; on the same Wi-Fi or Tailscale the phone connects directly. Your code and conversations stay on your computer.\n\nGET STARTED\nInstall Codync on your Mac (brew install --cask leepokai/codync/codync) or the host on Linux, then scan the pairing code. Open source: github.com/leepokai/Codync",+ "description": "Message your coding agents like teammates.\n\nCodync turns the coding agents on your computer — Claude Code, Codex, Cursor, Pi, OpenCode, Grok Build, Gemini, GitHub Copilot and dozens more — into persistent bots you delegate to from your iPhone. Pick who, say what, put the phone away.\n\nBOTS, NOT SESSIONS\nGive each bot a name, a character, standing instructions, an agent and a project folder. Each bot is one ongoing conversation, so there's no hunting for the right session or setting up an environment every time — just open the chat and type.\n\nAPPROVE FROM ANYWHERE\nWhen an agent wants to run a command or change files, an approval card arrives in the chat: Allow once, Always allow or Deny. You get a notification only when a bot needs you or finishes.\n\nA CALM CHAT\nThe conversation shows your messages and each final reply. Every command, file change, plan and thought is one tap away in Full conversation. While a bot works, you see what it's doing right now.\n\nUSAGE AT A GLANCE\nSee your Claude and Codex subscription limits in the app, in widgets and on the Lock Screen. Follow a working bot in a Live Activity and the Dynamic Island.\n\nYOUR COMPUTER, YOUR CODE\nAgents run on your Mac, Windows PC or Linux machine with your own logins. Away from home, the free built-in relay connects your phone end-to-end encrypted, so it only ever forwards ciphertext; on the same Wi-Fi or Tailscale the phone connects directly. Your code and conversations stay on your computer.\n\nGET STARTED\nInstall Codync on your Mac (brew install --cask leepokai/codync/codync), or download it for Windows or Linux from codync.dev, then scan the pairing code. Open source: github.com/leepokai/Codync","keywords": "claude code,codex,cursor,coding agent,ai,bot,remote,developer,approval,opencode","promotionalText": "Delegate to Claude Code, Codex, Cursor and more from your iPhone. Each agent is a bot you message; approve actions and get notified when it's done.",- "supportUrl": "https://github.com/leepokai/Codync/issues",- "whatsNew": "Codync 2.2: persistent bots for every coding agent on your computer, group chats and threads, approvals from your phone, remote screen, voice calls, a native Mac window and a Linux app."+ "supportUrl": "https://github.com/leepokai/Codync/issues"}diff --git a/metadata/version/zh-Hant.json b/metadata/version/zh-Hant.jsonindex a0fccd33..1b23e159 100644--- a/metadata/version/zh-Hant.json+++ b/metadata/version/zh-Hant.json@@ -1,7 +1,6 @@{- "description": "像傳訊息給隊友一樣,指派工作給你的程式 AI。\n\nCodync 把你電腦上的程式開發 agent——Claude Code、Codex、Cursor、Pi、OpenCode、Grok Build、Gemini、GitHub Copilot 等數十種——變成可以從 iPhone 指派任務的常駐 bot。選好對象、交代工作、把手機收起來就好。\n\n是 bot,不是工作階段\n每個 bot 都有自己的名字、角色造型、長期指示、使用的 agent 和專案資料夾。每個 bot 就是一段持續的對話,不用再找哪個工作階段、也不用每次重設環境——打開聊天直接說。\n\n隨時隨地核准\nagent 要執行指令或修改檔案時,聊天裡會出現核准卡片:允許一次、一律允許或拒絕。只有在 bot 需要你、或完成工作時才會通知你。\n\n乾淨的對話\n對話只顯示你的訊息和每次的最終回覆。每個指令、檔案變更、計畫和思考過程,點一下就能在「完整對話」查看。bot 工作時,你能看到它當下在做什麼。\n\n用量一目了然\n在 app、小工具和鎖定畫面查看 Claude 與 Codex 的訂閱用量。透過即時動態和動態島追蹤正在工作的 bot。\n\n你的電腦、你的程式碼\nagent 在你的 Mac 或 Linux 電腦上執行,使用你自己的登入。出門在外時,免費內建的中繼伺服器以端對端加密連線,只轉送加密後的資料;在同一個 Wi-Fi 或 Tailscale 上則直接連線。程式碼和對話都留在你的電腦。\n\n開始使用\n在 Mac 安裝 Codync(brew install --cask leepokai/codync/codync),或在 Linux 安裝 host,再掃描配對碼即可。開放原始碼:github.com/leepokai/Codync",+ "description": "像傳訊息給隊友一樣,指派工作給你的程式 AI。\n\nCodync 把你電腦上的程式開發 agent——Claude Code、Codex、Cursor、Pi、OpenCode、Grok Build、Gemini、GitHub Copilot 等數十種——變成可以從 iPhone 指派任務的常駐 bot。選好對象、交代工作、把手機收起來就好。\n\n是 bot,不是工作階段\n每個 bot 都有自己的名字、角色造型、長期指示、使用的 agent 和專案資料夾。每個 bot 就是一段持續的對話,不用再找哪個工作階段、也不用每次重設環境——打開聊天直接說。\n\n隨時隨地核准\nagent 要執行指令或修改檔案時,聊天裡會出現核准卡片:允許一次、一律允許或拒絕。只有在 bot 需要你、或完成工作時才會通知你。\n\n乾淨的對話\n對話只顯示你的訊息和每次的最終回覆。每個指令、檔案變更、計畫和思考過程,點一下就能在「完整對話」查看。bot 工作時,你能看到它當下在做什麼。\n\n用量一目了然\n在 app、小工具和鎖定畫面查看 Claude 與 Codex 的訂閱用量。透過即時動態和動態島追蹤正在工作的 bot。\n\n你的電腦、你的程式碼\nagent 在你的 Mac、Windows 或 Linux 電腦上執行,使用你自己的登入。出門在外時,免費內建的中繼伺服器以端對端加密連線,只轉送加密後的資料;在同一個 Wi-Fi 或 Tailscale 上則直接連線。程式碼和對話都留在你的電腦。\n\n開始使用\n在 Mac 安裝 Codync(brew install --cask leepokai/codync/codync),或到 codync.dev 下載 Windows 或 Linux 版,再掃描配對碼即可。開放原始碼:github.com/leepokai/Codync","keywords": "claude code,codex,cursor,程式,ai,agent,bot,遠端,開發者,核准","promotionalText": "從 iPhone 指派工作給 Claude Code、Codex、Cursor 等程式 AI。每個 agent 都是可以傳訊息的 bot,隨時核准動作,完成時通知你。",- "supportUrl": "https://github.com/leepokai/Codync/issues",- "whatsNew": "Codync 2.2:為電腦上的每個程式 agent 建立常駐 bot、群組聊天與討論串、從手機核准動作、遠端畫面、語音通話、原生 Mac 視窗與 Linux app。"+ "supportUrl": "https://github.com/leepokai/Codync/issues"}diff --git a/rust-toolchain.toml b/rust-toolchain.tomlindex 04c997f1..3918a38d 100644--- a/rust-toolchain.toml+++ b/rust-toolchain.toml@@ -1,4 +1,4 @@-# One Rust for every crate here (host, apps/linux, apps/screen-linux) and CI,+# One Rust for every crate here (host, apps/screen-linux) and CI,# so a new stable release can't break clippy -D warnings overnight.# Bump deliberately: change the version, run clippy on every crate, commit.[toolchain]diff --git a/web/README.md b/web/README.mdindex 55db9aee..7faf0a60 100644--- a/web/README.md+++ b/web/README.md@@ -1,33 +1,6 @@-This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).+# Codync website-## Getting Started--First, run the development server:--```bash-npm run dev-# or-yarn dev-# or-pnpm dev-# or-bun dev-```--Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.--You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.--This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.--## Learn More--To learn more about Next.js, take a look at the following resources:--- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.-- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.--You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!+Next.js static export. `npm run dev` serves it at http://localhost:3000.## Deploy on Vercel@@ -41,7 +14,3 @@ Existing PR checks are not removed; PR branches need to include thisconfiguration for subsequent events to use it.See [Vercel Git configuration](https://vercel.com/docs/project-configuration/git-configuration).--The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.--Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.diff --git a/web/app/components/features.tsx b/web/app/components/features.tsxindex 339155d1..1305f893 100644--- a/web/app/components/features.tsx+++ b/web/app/components/features.tsx@@ -8,7 +8,7 @@ import Reveal from "./reveal";const agents = ["Claude Code", "Codex", "Cursor", "Gemini", "Copilot", "OpenCode", "Pi", "Grok Build"];const platforms = [- { icon: AppleLogo, title: "Mac", body: "A menu bar app with a native chat window. Pairs your phone and installs the host itself." },+ { icon: AppleLogo, title: "Mac", body: "A menu bar app with a chat window. Pairs your phone and installs the host itself." },{ icon: WindowsLogo, title: "Windows", body: "The same desktop app, with a tray icon. It runs the host for you; Remote screen isn't there yet." },{ icon: LinuxLogo, title: "Linux", body: "The same desktop app as the Mac (AppImage or deb), or just the host on a headless server or cloud VM." },{ icon: Terminal, title: "Terminal", body: "A full terminal UI in the same binary, for SSH sessions and machines with no display." },diff --git a/web/app/privacy/page.tsx b/web/app/privacy/page.tsxindex 2ba3ec92..53a350ca 100644--- a/web/app/privacy/page.tsx+++ b/web/app/privacy/page.tsx@@ -8,7 +8,7 @@ export default function Privacy() {<main className="flex-1 flex flex-col items-center px-6 py-16"><article className="max-w-2xl w-full space-y-6"><h1 className="text-3xl font-bold text-white">Privacy Policy</h1>- <p className="text-neutral-400 text-sm">Last updated: October 8, 2026</p>+ <p className="text-neutral-400 text-sm">Last updated: October 12, 2026</p><Section title="Overview">Codync lets you message the AI agents that run on your own computer. It is built so that your files, conversations and credentials stay on your devices.@@ -29,13 +29,13 @@ export default function Privacy() {<Section title="Data we collect"><p className="mb-2">- Only usage analytics, and only if you say yes. Each iPhone and each computer asks once; you can change your answer anytime in Settings. Until you agree, nothing is sent.+ Only usage analytics. They are on by default; turn them off on each iPhone and each computer in Settings (Share usage analytics), and that device stops sending right away.</p><ul className="list-disc pl-5 space-y-2"><li><strong>What we record:</strong> which features you use, such as opening the app, creating or deleting a bot, sending a message (with the number of attachments, not the files), starting a routine or a voice call, and installing a connector from the catalog. Each event carries the app version, the platform and the agent and model a bot uses.</li><li><strong>What we never record:</strong> your messages, prompts, code, files, file names or paths, bot names, credentials or anything your agents produce. We don't store your IP address or location.</li><li><strong>Who it's linked to:</strong> your Codync account when you're signed in; otherwise a random ID created on that device.</li>- <li><strong>Why:</strong> only to understand how people use Codync and improve it. It is never sold, never shared for advertising and never used to track you across other apps or websites.</li>+ <li><strong>Why:</strong> to spot bugs sooner and serve you better, by seeing which features work and where people get stuck. It is never sold, never shared for advertising and never used to track you across other apps or websites.</li></ul><p className="mt-2">Codync has no advertising identifiers.</p></Section>@@ -44,7 +44,7 @@ export default function Privacy() {<ul className="list-disc pl-5 space-y-2"><li><strong>Apple Push Notification service</strong>: delivers notifications and Live Activity updates.</li><li><strong>Cloudflare Workers</strong>: runs the push relay (nothing stored).</li>- <li><strong>PostHog (US)</strong>: stores the usage analytics described above, only if you agreed to share them.</li>+ <li><strong>PostHog (US)</strong>: stores the usage analytics described above, unless you turned them off.</li><li><strong>The AI agents you choose</strong>: they run on your computer under their own terms and privacy policies.</li><li><strong>OpenAI or Google (optional, voice calls)</strong>: only if you add your own OpenAI or Gemini API key in a call's settings. Your voice then goes from your iPhone or Mac directly to that provider, under your account and its privacy policy, together with the bot's name and description and the chat messages it asks for during the call. The key is stored encrypted on your computer, which uses it only to start calls and list models. Without a key, voice calls use Apple speech recognition on your device.</li></ul>diff --git a/web/public/CNAME b/web/public/CNAMEdeleted file mode 100644index 94f303af..00000000--- a/web/public/CNAME+++ /dev/null@@ -1 +0,0 @@-codync.devdiff --git a/web/public/file.svg b/web/public/file.svgdeleted file mode 100644index 004145cd..00000000--- a/web/public/file.svg+++ /dev/null@@ -1 +0,0 @@-<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>\ No newline at end of filediff --git a/web/public/globe.svg b/web/public/globe.svgdeleted file mode 100644index 567f17b0..00000000--- a/web/public/globe.svg+++ /dev/null@@ -1 +0,0 @@-<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>\ No newline at end of filediff --git a/web/public/next.svg b/web/public/next.svgdeleted file mode 100644index 5174b28c..00000000--- a/web/public/next.svg+++ /dev/null@@ -1 +0,0 @@-<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>\ No newline at end of filediff --git a/web/public/vercel.svg b/web/public/vercel.svgdeleted file mode 100644index 77053960..00000000--- a/web/public/vercel.svg+++ /dev/null@@ -1 +0,0 @@-<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>\ No newline at end of filediff --git a/web/public/window.svg b/web/public/window.svgdeleted file mode 100644index b2b2a44f..00000000--- a/web/public/window.svg+++ /dev/null@@ -1 +0,0 @@-<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>\ No newline at end of file