@ai-matrx/desktop-protocol 0.21.96 → 0.21.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -1
- package/dist/{chunk-server-UNRE6WGX.js → chunk-server-4H74IJI4.js} +3 -3
- package/dist/{chunk-server-46JNNDT7.js → chunk-server-ATU4VUHA.js} +6 -4
- package/dist/chunk-server-ATU4VUHA.js.map +1 -0
- package/dist/{chunk-server-HU5BCBEF.js → chunk-server-I5MQ4EET.js} +4 -2
- package/dist/{chunk-server-HU5BCBEF.js.map → chunk-server-I5MQ4EET.js.map} +1 -1
- package/dist/{chunk-server-IHK7SYRO.js → chunk-server-M4ZZLI5M.js} +8 -3
- package/dist/chunk-server-M4ZZLI5M.js.map +1 -0
- package/dist/client.cjs +9 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +3 -3
- package/dist/index.cjs +14 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +269 -253
- package/dist/index.d.ts +269 -253
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/{models-CW7-r8m4.d.cts → models-DDuVPiOe.d.cts} +493 -469
- package/dist/{models-CW7-r8m4.d.ts → models-DDuVPiOe.d.ts} +493 -469
- package/dist/react.d.cts +3 -1
- package/dist/react.d.ts +3 -1
- package/fixtures/device-model-contract.json +37 -0
- package/generated/desktop-protocol.schema.json +16 -3
- package/package.json +3 -2
- package/dist/chunk-server-46JNNDT7.js.map +0 -1
- package/dist/chunk-server-IHK7SYRO.js.map +0 -1
- /package/dist/{chunk-server-UNRE6WGX.js.map → chunk-server-4H74IJI4.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
|
|
8
8
|
var PROTOCOL_MAJOR = 1;
|
|
9
|
-
var PROTOCOL_MINOR =
|
|
9
|
+
var PROTOCOL_MINOR = 92;
|
|
10
10
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
11
11
|
var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
12
12
|
var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -98,8 +98,11 @@ var ErrorReason = z2.enum([
|
|
|
98
98
|
// 1.76 (REASONS_SINCE): models.llm.chat (1.88: models.embed names the same two)
|
|
99
99
|
"model_not_running",
|
|
100
100
|
// NOT_FOUND (nothing runs) or RESOURCE_BUSY (another model runs): start this model first
|
|
101
|
-
"model_server_unreachable"
|
|
101
|
+
"model_server_unreachable",
|
|
102
102
|
// RESOURCE_GONE (retryable): llama-server did not answer on this computer
|
|
103
|
+
// 1.91 (REASONS_SINCE): models.llm.chat with start_if_stopped when another model answers a live chat
|
|
104
|
+
"busy_with_another_chat"
|
|
105
|
+
// RESOURCE_BUSY (retryable): the loaded model is answering another chat now; data.chat_title names it
|
|
103
106
|
]);
|
|
104
107
|
var FsPatchEditFailure = z2.strictObject({ edit_index: nonNegInt, reason: z2.string().max(300) });
|
|
105
108
|
var ProtocolErrorBody = z2.strictObject({
|
|
@@ -115,6 +118,8 @@ var ProtocolErrorBody = z2.strictObject({
|
|
|
115
118
|
settings_url: z2.string().max(512).optional(),
|
|
116
119
|
// PERMISSION_DENIED_OS deep link
|
|
117
120
|
retry_after_ms: nonNegInt.optional(),
|
|
121
|
+
/** (1.91) busy_with_another_chat: the title of the chat the loaded model is answering now, in words a person reads. */
|
|
122
|
+
chat_title: z2.string().max(200).optional(),
|
|
118
123
|
limit_bytes: nonNegInt.optional(),
|
|
119
124
|
/** fs.patch when every edit failed (CONFLICT, patch_no_match / patch_ambiguous): the daemon's 422 `failures`. */
|
|
120
125
|
edits_failed: z2.array(FsPatchEditFailure).max(256).optional(),
|
|
@@ -308,4 +313,4 @@ export {
|
|
|
308
313
|
CloseCode,
|
|
309
314
|
CloseCodeValue
|
|
310
315
|
};
|
|
311
|
-
//# sourceMappingURL=chunk-server-
|
|
316
|
+
//# sourceMappingURL=chunk-server-M4ZZLI5M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema/primitives.ts","../src/schema/errors.ts","../src/schema/frame.ts","../src/schema/envelope.ts"],"sourcesContent":["/** @ai-matrx/desktop-protocol — version and primitive schemas. Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */\nimport { z } from \"zod\";\nimport { UUID_SHAPE_PATTERN } from \"@ai-matrx/kit/uuid\";\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Version\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const PROTOCOL_MAJOR = 1 as const;\n/**\n * Minor history (same major = compatible; see src/versioning.ts for the rule and FIELDS_SINCE):\n * 1.0 — the first contract.\n * 1.1 — fs.patch per-edit results; /call reports the negotiated version;\n * device status since_ms is null for a device that never connected.\n * 1.2 — the `models` capability (local transcription) and its error reasons (REASONS_SINCE);\n * the `apps` capability (desktop apps, their profiles and usage).\n * 1.3 — the `proc` capability (processes, listening ports, stopping one) and `clipboard`.\n * 1.4 — computer control: `system`, `screen`, `window`, `input`, `power`, `resources`; polled\n * folder watches (fs.watch.start/events/stop) and background jobs (exec.job.*).\n * 1.5 — `coding.history.import_missing`: Claude Code history the platform lacks, imported by the\n * `coding` Python service.\n * 1.6 — the `audio` capability: devices, record a clip to a WAV file, play a file.\n * 1.7 — a window names its owning application and process (WindowInfo `app`, `pid`).\n * 1.8 — `apps.chats.*` / `apps.projects.*`: a coding app's chats, windows, pins and projects, live.\n * 1.9 — chats placed in windows / held, several filed at once, projects renamed / archived / copied;\n * the list says when it is a saved copy being re-read (`updating`) and when it is not live.\n * 1.14 — a chat row carries its original title, where it came from, and the person's rename.\n * 1.15 — a chat row says when the app archived it (typed), and its title source is a closed set.\n * 1.16 — the `stack` capability: the local AI Matrx servers, their logs, errors and history.\n * 1.17 — what is using the computer: resources.activity (jobs, heaviest processes, strain, the\n * last hour), resources.stop_job (a job's whole tree), resources.incidents (slowdown log);\n * a disk names its volume (ResourcesDisk `name`).\n * 1.18 — a local server says what it is using (StackServer `cpu_percent`, `memory_bytes`).\n * 1.19 — apps.projects.to_window: every chat of a project into one window (plan first), taking\n * them off other side windows where safe, optionally grouped in that window's sidebar.\n * 1.20 — the device's error ledger: diag.errors.list, diag.errors.report, event diag.errors.changed.\n * 1.21 — apps.windows.shown: what a window's sidebar draws right now (read-only), e.g. a project's group.\n * 1.22 — git for agents (git.status/diff/log/add/commit/push/pull/branch/stash/clone, core `git`);\n * the web from this computer (web.fetch/scrape/search/fetch_with_browser, the `tools` service).\n * 1.23 — the signed-in person's own agents and Vault (account.agents.list, account.vault.list,\n * account.vault.copy: one field onto this computer's clipboard, never its value on the wire).\n * 1.24 — the System Settings panes' own facts: sysinfo.hardware (model, chip, serial, the OS's\n * name), audio.levels/set_levels (volumes, Mute) and each device's kind, the displays'\n * rotation and refresh rate, power's energy settings and power.history, the keyboard's\n * repeat, fn key and input sources (input.keyboard_settings/set_keyboard_settings),\n * system.open_settings (the OS's own settings page), Spend's last 7 days.\n * 1.25 — each coding account's 5-hour reset (AccountUsage.five_hour_resets_by_ms), so Accounts\n * sorts and filters by when an account is usable again.\n * 1.26 — the coding app's own update: apps.windows.update_state (pending, which windows closed),\n * apps.windows.reopen and apps.windows.update_and_reopen (quit all, install, reopen all).\n * 1.27 — AppsWindowsUpdateStateResult.closed_by_update: the closed windows the update itself quit\n * (the app's log says it went down for the update), apart from ones a person closed.\n * 1.28 — the `browser` capability: the AI Matrx extension as a client (browser.register, result,\n * progress), the Browsers screen (browser.sessions, disconnect, set_enabled, pair_code,\n * pair_reset), agents' browser.call, events browser.invoke / sessions_changed / progress,\n * and the browser_* / awaiting_confirmation error reasons (REASONS_SINCE).\n * 1.29 — one name per chat in every window: apps.chats.titles_check (each chat's right name and\n * the windows where it differs) and apps.chats.titles_push (write it into every copy).\n * 1.30 — Finder's file commands: fs.copy (Duplicate, Copy and Paste), fs.search_index (search\n * \"This Mac\" through the OS's index) and fs.info (Get Info's created, owner, size on disk,\n * item count and flags).\n * 1.31 — language models on this computer (Confidential Chat's engine): models.llm.status,\n * models.llm.install, models.llm.start and models.llm.stop (llama-server, one model at a\n * time; status names the loopback port, never a URL).\n * 1.32 — apps.projects.to_window `pin`: pin the moved chats in the target window, now when it is\n * closed, else queued for its next close (result `pin`: when, pinned, already, queued).\n * 1.33 — apps.chats.titles_check `stale_windows`: windows that keep writing replaced chat names\n * back from memory (rewritten each pass; reloading the window stops it).\n * 1.34 — error reason `tool_disabled_on_device` (AUTH_FORBIDDEN): the person turned the tool\n * that sends this op off for agents on this computer (the per-device tool policy,\n * src/tools/policy.ts). An older peer gets the code and message without the reason.\n * 1.35 — system.open_settings pane `microphone` (Privacy & Security › Microphone; Windows'\n * microphone privacy page): the one place the person allows the microphone. A 1.34 core\n * refuses the pane as INVALID_PARAMS, so a client asks only a 1.35 core for it.\n * 1.36 — apps.projects.to_window `chat_ids` (a batch: exactly these chats of the project, no\n * other) and `take_off_from` (take them off that one side window only, never main). A\n * 1.35 core refuses them as INVALID_PARAMS, so a client sends them only to a 1.36 core.\n * 1.37 — Matrx Local's remaining sidecar tools, served by the core: net.* (interfaces, Wi-Fi,\n * Bluetooth, local devices, mDNS, port scan, download), automation.script, mail.*,\n * messages.* (chats, list, send), contacts.*, calendar.*, reminders.*, photos.*, location.get, windows.*\n * (registry, services, event log, features), schedule.* (an op on an interval),\n * notes.* (Documents/Matrx/Notes), documents.* (PDF text, OCR, image resize, Office files)\n * and entities.* (names, private data); browser.tool_metrics, browser.reset_counters and\n * browser.log (the bridge's diagnostics for every one of the owner's clients). A 1.36 core\n * answers UNKNOWN_OPERATION.\n * 1.38 — code from anywhere: coding.* (the coding engine's sessions, runs, transcripts, preferences\n * and recent rows; start, send, stop, take over, stop elsewhere, Full Download, reconcile;\n * live watches coding.watch / coding.session.watch with events coding.changed,\n * coding.watch_state, coding.item, coding.gap) and session.identify (a client's label,\n * e.g. \"iPhone\", for \"Started from iPhone\"). A 1.37 core answers UNKNOWN_OPERATION.\n * 1.39 — Agents in the desktop app: account.agents.get (one agent's inputs and what it uses),\n * account.agents.runs (one agent's runs, mandate.run_history) and account.agents.favorite\n * (the catalogue's one star write); AccountAgent gains the catalogue's own fields (tags,\n * model_id, access_level, organization_id, origin, is_archived, orchestra), optional. A\n * 1.38 core answers UNKNOWN_OPERATION.\n * 1.40 — the web from this computer becomes Sources: web.scrape `engine` (auto, browser, server)\n * and `land`, web.fetch_with_browser `land`; WebScrapePage and WebBrowserFetchResult\n * `source` (saved, or waiting in this computer's outbox); web.search answers through AI\n * Matrx's own search (never a key on the computer); web.runtime.state/install/remove\n * (the browser), web.outbox.list/retry/discard, web.log.list/clear and the web.log.entry\n * event (never page text), web.research.queue/fetch and the web.progress event. The\n * tools service's web_scrape and web_browser_fetch take their own params (knobs, a spool\n * folder) and hand back each page's parse as a file. A 1.39 core answers\n * UNKNOWN_OPERATION for the new ops and refuses `engine`/`land` as INVALID_PARAMS.\n * 1.41 — Permissions and privacy on every OS: sysinfo.get's permissions gain Matrx Local's\n * remaining kinds (reminders, speech_recognition, messages, mail, wifi) and a `detail`\n * line, and the result gains `requirements` (secret storage, tray, display server, helper\n * programs, Smart App Control, path length); system.open_settings opens each grant's own\n * page by its name. A 1.40 peer is sent neither the new rows nor the new fields; a 1.40\n * core refuses the new panes as INVALID_PARAMS.\n * 1.43 — moving chats to another window says what it did and groups where the person picks:\n * apps.windows.groups (a window's own sidebar groups with their counts, read only);\n * apps.projects.to_window `group_id` / `group_name` (an existing group, or a name) and,\n * for an open window, the grouping queued for its next close (group `when`, `group_id`);\n * result `chats` (one row per chat: copied, moved, already, skipped, its pin and group).\n * A 1.42 core answers UNKNOWN_OPERATION and refuses the new params as INVALID_PARAMS.\n * 1.44 — the person's own Microsoft Outlook, with no Microsoft consent: outlook.status (which\n * Outlook is here and whether it can be scripted), outlook.draft (a draft with recipients,\n * subject, body and attachments, saved to Drafts, never sent), outlook.list, outlook.read.\n * Classic Outlook for Windows only; elsewhere status explains and the rest answer\n * PLATFORM_UNSUPPORTED. A 1.43 core answers UNKNOWN_OPERATION.\n * 1.45 — what this computer can run, and its downloads: sysinfo.hardware `graphics` (each\n * adapter's name, vendor, memory and whether it shares the computer's memory);\n * models.downloads.list (every running model download and every half-done one) and\n * models.downloads.cancel. A 1.44 core omits graphics and answers UNKNOWN_OPERATION.\n * 1.46 — a failed download stays listed with why: DownloadRow `error`. A 1.45 core omits it.\n * 1.49 — local models come from the platform catalog: TextModelId and TranscriptionModelId are\n * string keys (`ModelKey`; every 1.48 id stays valid), and the service op ml.catalog_set\n * hands the ml service the selected files to fetch (URL + SHA-256 each) and the\n * llama-server build. A 1.48 peer still refuses keys outside its enum; the catalog's\n * min_app_version keeps new keys away from it.\n * 1.50 — a window's Remote Control (phone) setting: AppWindowInfo `remote_control` (setting,\n * serving, pending) and apps.windows.set_remote_control (written while the window is\n * closed, else queued for its next close). A 1.49 core omits the field and answers\n * UNKNOWN_OPERATION.\n * 1.52 — Remote Control says when it is wrong: WindowRemoteControl `problem` (a damaged settings\n * file, or why a queued change failed to land) and setting \"unreadable\". A 1.51 peer is\n * never sent `problem`, and a window whose file is damaged simply has no remote_control\n * for it (it would refuse the unknown setting).\n * 1.53 — one account list: CodingProviderStatus `accounts` (the person's saved accounts a run can\n * use, from the computer's engine) and `accountsProblem` (why they could not be listed).\n * A 1.52 peer is never sent either; a 1.52 core omits them (its screen offers the\n * default sign-in alone).\n * 1.54 — CodingProviderStatus `defaultModel.source` \"account\" (the signed-in account's default\n * model, e.g. Codex's). A 1.53 peer is sent \"driver\" instead (its strict enum would refuse\n * the whole coding.providers answer).\n * 1.55 — apps.chats.copy_to_account: chats copied (or moved) to another account in one engine\n * pass with their sidebar groups mirrored by name, pins following, the origin grouped\n * \"Copied to <target>\", and every chat read back (verified, queued, failed); restart\n * \"restart_verify\" closes both windows, applies, verifies and reopens them. A 1.54 core\n * answers UNKNOWN_OPERATION.\n * 1.56 — apps.windows.set_account, apps.windows.forget, apps.chats.probe; and\n * coding.account.continue: a coding session moves to another of the person's accounts\n * (Continue on <account>) and the turn a limit or the person stopped is sent again there,\n * exactly once per client_request_id. A 1.55 core answers UNKNOWN_OPERATION; the remote\n * screen says that computer needs an update.\n * 1.57 — the account a coding record belongs to: `accountId` on a session, a discovered chat, a\n * Recent row and a search hit (absent: the default sign-in); and each sign-in's usage and\n * \"Continue on <account>\" in coding.providers (`usage`, `continueOn` on a provider and on\n * each of its `accounts`, with the account's own `ready`/`lastProblem`/`problem`/`fix`).\n * Optional and stripped for an older peer by forPeer.\n * 1.58 — a person's own model downloaded from a link (Matrx 2 › Models › Find models):\n * `models.llm.install` takes the person's Hugging Face token for that one download\n * (`hf_token`, sent only to Hugging Face hosts); a catalog file's `sha256` may be null (its\n * source publishes none) and the first download hashes it (`hashed` in the result). The app\n * and its ml service ship together, so no peer stripping is needed.\n * 1.59 — the one chat record: ChatRow `session_id`, `app_groups`, `parent`, `prior_sessions`.\n * 1.60 — apps.chats.copy_to_account `restart.reopened`: for each window \"restart_verify\" closed,\n * whether it came back (`ok`) and why not. Optional and stripped for an older peer by\n * forPeer; a 1.59 core omits it (its screen reads the reason text).\n * 1.61 — ChatRow `title_sync`: where the chat's one title shows (synced / not_synced / unsupported,\n * and a note). Optional and stripped for an older peer by forPeer.\n * 1.62 — ChatRow `moved`: the chat's move records (kind move/copy, from, to, at_ms, back_at_ms),\n * ours, never a project name. Optional and stripped for an older peer by forPeer.\n * 1.63 — ChatRow `home` (the instance whose folder holds the chat) and AppInstance `missing`\n * (what an instance record still lacks: account / email / version). Optional and stripped\n * for an older peer by forPeer.\n * 1.64 — an agent's saved versions in the desktop app: account.agents.versions (list, note, age),\n * account.agents.version_diff (one version and the current one, as THE agent diff compares\n * them) and account.agents.restore_version (agx_promote_version). New ops only.\n * 1.65 — CodingTranscriptItem `continued` (\"Continue on <account>\": the line across the transcript\n * where a chat moved from another account). A 1.64 peer's coding.history /\n * coding.transcript.read is sent each as the `notice` it used to be (forPeer).\n * 1.66 — matrx-local's local_window and local_audio contracts on desktop_window and desktop_audio:\n * window.list `app`, window.minimize `mode` (minimize, maximize, restore), audio.record\n * `channels` and `sample_rate` (and both in its result), audio.play `device_id`. Optional\n * fields only.\n * 1.67 — Matrx Local's local_mac_apps and local_windows_ps contracts carried whole: mail.send bcc,\n * mail.accounts mailboxes, messages.list contact / unread_only (+ read, service, chat_name),\n * messages.chats last_message, contacts.search without a query, calendar.list calendars\n * (+ url), reminders.list lists (+ priority, completed_at_ms), photos.search media_type\n * (+ media_type, duration_s), photos.get thumbnail_size, location.get altitude / speed /\n * course, windows.services status, windows.service_control pause / resume,\n * windows.event_log source, windows.features installed_only. Optional fields only.\n * 1.68 — account.agents.restore_version answers `new_version` (the version row the restore saved,\n * agx_promote_version since aidream migration 20261021233500) and `unchanged` (it already\n * matched; nothing saved). Optional fields only.\n * 1.69 — every local language model is listed: models.llm.status `models` carries `title` and\n * `problem` (on this computer but cannot run here, in one line with its fix), lists the\n * models on this computer first, and is bounded at 1024 (was 64); ml.catalog_set `unusable`\n * hands those models to the service. Optional fields only.\n * 1.70 — our Hide for chats: ChatRow `hidden` (the person hid it from Matrx's lists; kept by\n * Matrx, never written into the app) and apps.chats.hide (hide or show one or many chats).\n * An optional field and a new op only.\n * 1.71 — coding-app accounts and instances in the database: apps.instances.list carries `computer`\n * (this computer's name), `elsewhere` (ElsewhereInstance: the person's instances on their\n * other computers, read only) and `shared_problem`; apps.accounts.list carries\n * `shared_problem`. Optional fields only.\n * 1.72 — ours pushed into the apps: ChatRow `pin_sync` (whether our star is the app's pin, per\n * chat), apps.chats.bring_back (one chat home from its move records) and apps.chats.tidy_up\n * (push titles and pins where proven; Claude windows quit and reopened only when asked).\n * An optional field and new ops only.\n * 1.73 — what each coding app keeps besides chats (ledger D9): AppAccount `profile` (plan details,\n * role, tiers, Cursor's subscription: allow-listed fields, never a token), `read_source` and\n * `session_cost_usd` (Claude Code's live-usage file as a no-network reading; AccountUsage\n * `read_source` too), and apps.setup.list (each app's settings, models, plugins, extensions\n * and MCP servers: names, transport and URL or command only). Optional fields and a new op.\n * 1.74 — the models on this computer: models.local.list (every model the ml service holds, text\n * and speech, with its size, folder, what Remove frees and whether it is used in place) and\n * models.local.remove (deletes only files Matrx 2 holds; a link to the person's own file is\n * unlinked, never the file; the running model stops first). Service ops ml.local_list and\n * ml.local_remove. New ops only.\n * 1.75 — no models list is bounded any more: ModelsLlmStatusResult.models (was 1024),\n * MlStatusResult.models (16), MlCatalogSetParams text/transcription/unusable (512/64/512) and\n * ModelsDownloadsListResult.downloads (64), ModelsLocalListResult.models\n * (1024). A bound silently cut off a person's models; every\n * one now arrives. Constraints loosened only.\n * 1.76 — models.llm.chat (stream): an OpenAI chat-completions body in, llama-server's server-sent\n * events out (tool-call deltas included), served by the core's one llama-server home. Error\n * reasons model_not_running and model_server_unreachable. New op and reasons only.\n * 1.77 — CodingServiceCredentials.organization_id (optional): the active organization the coding\n * service sends as X-Organization-Id on every AI Matrx request. New optional field only.\n * 1.78 — our Hide on Going cold and Spend: ColdChat, SpendChat, SpendLive and SpendIdle carry\n * `hidden` (the person hid the chat from Matrx's lists, as ChatRow.hidden). Optional only.\n * 1.79 — AppAccount.readings (optional): the usage readings Matrx kept of the account on this\n * computer (how many, since when, weekly use per day). Optional only.\n * 1.80 — apps.setup.list: SetupItemKind \"skill\" (a Claude Code skill installed). An older peer's\n * strict enum would refuse the whole answer, so forPeer leaves those items out for it.\n * 1.82 — apps.weight: Code › Performance, the claude-accounts engine's session weight (old and\n * heavy sessions, duplicates, orphaned agent processes, machine load and the machine\n * guard). New op only.\n * 1.83 — action_needed.*: Action needed, what agents on this computer wait on the person for (list,\n * raise, get, wait, answer one or several, cancel, dismiss) and the action_needed.changed\n * event. New ops and event only.\n * 1.84 — diag.activity.list / diag.activity.clear and event diag.activity.lines: Computer ›\n * Activity, the live log of the core, the Python services, the model server, clients,\n * HTTP requests and tool calls, from capped per-source buffers. New ops and event only.\n * 1.85 — coding.assets.list / coding.assets.get: Code › the coding agents' own files (memories,\n * instructions, skills, automations, settings shape only), read only. New ops only.\n * 1.86 — SERVICES.agent (agent.status / agent.install / agent.start): Matrx 2's on-device agent\n * service, internal to the core. No Router op changes.\n * 1.87 — fs.search_semantic / fs.semantic_status / fs.semantic_configure: semantic find, files\n * found by meaning from this computer's own index of the folders a person chooses. New ops only.\n * 1.88 — the model service's embeddings slot: models.embed (unary: text in, OpenAI-shaped vectors\n * out, from the embedding model llama-server runs with --embeddings beside the chat model);\n * models.llm.start / stop `slot` (\"chat\" default, \"embed\"); models.llm.status `embedding`\n * (the slot's state, models, running, starting, error); ml.catalog_set `embedding` (the\n * embedding models for this computer). New op and optional fields only.\n * 1.89 — wake word on this computer: models.wake.status / install / detect / close (an openWakeWord\n * ONNX model, or a phrase heard by the smallest Whisper; 16 kHz PCM in, a decision out);\n * ml.catalog_set `wake` (the wake-word models). New ops and an optional field only.\n * 1.90 — web.home_fetch / web.home.status: the home connection (residential egress, from Matrx\n * Local): AI Matrx's servers fetch a page their own address was blocked from through the\n * person's computer, opted in, limited, queued and retried crash-safely. New ops only.\n * 1.91 — error reason busy_with_another_chat and `data.chat_title`: models.llm.chat (start_if_stopped)\n * refused because the loaded model is answering another chat now. New reason and an\n * optional field only.\n * 1.92 — models.llm.chat `chat_title`: the title of the chat a completion belongs to, so a busy refusal\n * can name it. An optional field only.\n */\nexport const PROTOCOL_MINOR = 92 as const;\n/** This package's version as the wire spells it (\"major.minor\"): hello, welcome, relay status. */\nexport const PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}` as const;\n/** \"major.minor\". Same major = compatible (minor adds optional fields/ops only). */\nexport const ProtocolVersion = z\n .string()\n .regex(/^[1-9][0-9]{0,2}\\.[0-9]{1,3}$/);\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Primitives\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Client-generated request id, unique per session. */\nexport const RequestId = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[A-Za-z0-9_-]+$/);\n\n/** Long-lived resource handle minted by the core: \"<kind>_<base62>\" (pty_…, watch_…). */\nexport const ResourceId = z\n .string()\n .regex(/^(pty|watch)_[A-Za-z0-9]{16,40}$/);\n\n/**\n * = app_instances.id. A plain pattern, NOT z.uuid(): z.uuid() emits `format: uuid` + `pattern`,\n * which datamodel-codegen renders as `Annotated[UUID, Field(pattern=...)]` — a model Pydantic can\n * never validate (\"Unable to apply constraint 'pattern' … of type 'uuid'\"). generate.ts now\n * refuses format+pattern on one node so this class cannot come back.\n */\nexport const DeviceId = z\n .string()\n .regex(UUID_SHAPE_PATTERN);\n\n/**\n * Absolute, normalized path: forward slashes on every OS, NFC. POSIX \"/...\" or Windows \"C:/...\".\n * Normalization happens once, in the fs owner (SPEC §9); the wire never carries backslashes.\n */\nexport const AbsPath = z\n .string()\n .min(1)\n .max(4096)\n .regex(/^(\\/|[A-Za-z]:\\/)[^\\\\\\u0000]*$/);\n\n/** Internal building blocks — deliberately unnamed in $defs (inlined wherever used). */\nexport const u32 = z.int().min(0).max(4_294_967_295);\nexport const nonNegInt = z.int().min(0);\n/** Unix epoch milliseconds. */\nexport const epochMs = z.int().min(0);\n\n// Inferred (output) types — same name as the schema, so `FsEntry` is both the validator and its type.\nexport type ProtocolVersion = z.output<typeof ProtocolVersion>;\nexport type RequestId = z.output<typeof RequestId>;\nexport type ResourceId = z.output<typeof ResourceId>;\nexport type DeviceId = z.output<typeof DeviceId>;\nexport type AbsPath = z.output<typeof AbsPath>;\n","/** @ai-matrx/desktop-protocol — error model (SPEC §5). Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */\nimport { z } from \"zod\";\nimport type { ErrorCodeName, ErrorData, ErrorReasonName } from \"../types\";\nimport { AbsPath, ProtocolVersion, nonNegInt } from \"./primitives\";\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Errors (SPEC §5, plus the five additions marked NEW)\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const ErrorCode = z\n .enum([\n \"AUTH_REQUIRED\",\n \"AUTH_INVALID\",\n \"AUTH_EXPIRED\",\n \"AUTH_FORBIDDEN\", // signed in, but not this device's owner\n \"AUTH_DEVICE_REVOKED\", // kill switch\n \"PERMISSION_DENIED_OS\",\n \"NOT_FOUND\",\n \"CONFLICT\",\n \"INVALID_PARAMS\",\n \"RESOURCE_BUSY\",\n \"RESOURCE_GONE\",\n \"CANCELLED\",\n \"TIMEOUT\",\n \"PLATFORM_UNSUPPORTED\",\n \"RATE_LIMITED\",\n \"INTERNAL\",\n \"PROTOCOL_VERSION_UNSUPPORTED\", // NEW: hello refused, carries data.upgrade\n \"PROTOCOL_ERROR\", // NEW: malformed envelope/frame, credit overrun, unknown sid\n \"UNKNOWN_OPERATION\", // NEW: cap.op not served by this core version\n \"DEVICE_OFFLINE\", // NEW: relay has no live device socket (retryable)\n \"PAYLOAD_TOO_LARGE\", // NEW: message or frame above limits.max_*_bytes\n ]);\n\n/** Machine reason under a code, so clients branch without parsing messages. */\nexport const ErrorReason = z\n .enum([\n \"not_a_directory\",\n \"is_a_directory\",\n \"directory_not_empty\",\n \"already_exists\",\n \"stale_write\", // fs.write if_match_mtime_ms mismatch → CONFLICT\n \"binary_content\", // utf8 read of non-UTF-8 bytes → INVALID_PARAMS\n \"not_utf8_boundary\",\n \"patch_no_match\",\n \"patch_ambiguous\",\n \"resource_exited\",\n \"resource_expired\",\n \"control_taken\", // another client of the same user took control\n \"window_exhausted\",\n // 1.2 (REASONS_SINCE): the `models` capability and its supervised Python service\n \"runtime_not_installed\", // NOT_FOUND: install the inference runtime first (models.install)\n \"model_not_installed\", // NOT_FOUND: that model's weights are not on the device\n \"unsupported_media\", // INVALID_PARAMS: the file is not audio or video the decoder reads\n \"download_failed\", // install could not fetch a package or model file\n \"service_starting\", // RESOURCE_BUSY (retryable): the service is starting or restarting\n \"service_restarted\", // RESOURCE_GONE: the service died while this request ran\n \"service_failed\", // INTERNAL: the service could not be started (see models.status)\n // 1.28 (REASONS_SINCE): the `browser` capability (the AI Matrx extension as Matrx 2's client)\n \"browser_not_connected\", // NOT_FOUND: no browser with the extension is connected (or none routable)\n \"browser_ambiguous\", // CONFLICT: several browsers are connected and none was named\n \"browser_account_mismatch\", // AUTH_FORBIDDEN: the named browser is signed in to another account\n \"browser_connection_off\", // AUTH_FORBIDDEN: the person turned Browser connection off\n \"awaiting_confirmation\", // TIMEOUT: the person did not answer the browser's confirmation in time\n // 1.34 (REASONS_SINCE): the per-device tool policy (src/tools/policy.ts)\n \"tool_disabled_on_device\", // AUTH_FORBIDDEN: the person turned this tool off for agents on this computer (Agents › Tools)\n // 1.76 (REASONS_SINCE): models.llm.chat (1.88: models.embed names the same two)\n \"model_not_running\", // NOT_FOUND (nothing runs) or RESOURCE_BUSY (another model runs): start this model first\n \"model_server_unreachable\", // RESOURCE_GONE (retryable): llama-server did not answer on this computer\n // 1.91 (REASONS_SINCE): models.llm.chat with start_if_stopped when another model answers a live chat\n \"busy_with_another_chat\", // RESOURCE_BUSY (retryable): the loaded model is answering another chat now; data.chat_title names it\n ]);\n\n/**\n * One edit fs.patch could not apply — the daemon's `edits_failed[]` entry, verbatim: the edit's\n * index and the daemon's own reason text (\"old_text not found\", or \"old_text matches N locations —\n * add context or set replace_all=True\").\n */\nexport const FsPatchEditFailure = z.strictObject({ edit_index: nonNegInt, reason: z.string().max(300) });\n\nexport const ProtocolErrorBody = z\n .strictObject({\n code: ErrorCode,\n message: z.string().max(300), // short, human, never a stack trace or a token\n retryable: z.boolean(),\n data: z\n .strictObject({\n reason: ErrorReason.optional(),\n cap: z.string().max(32).optional(),\n op: z.string().max(64).optional(),\n path: AbsPath.optional(),\n settings_url: z.string().max(512).optional(), // PERMISSION_DENIED_OS deep link\n retry_after_ms: nonNegInt.optional(),\n /** (1.91) busy_with_another_chat: the title of the chat the loaded model is answering now, in words a person reads. */\n chat_title: z.string().max(200).optional(),\n limit_bytes: nonNegInt.optional(),\n /** fs.patch when every edit failed (CONFLICT, patch_no_match / patch_ambiguous): the daemon's 422 `failures`. */\n edits_failed: z.array(FsPatchEditFailure).max(256).optional(),\n upgrade: z\n .strictObject({\n min_version: ProtocolVersion,\n max_version: ProtocolVersion,\n download_url: z.url().optional(),\n })\n .optional(),\n })\n .optional(),\n });\n\n\n// Compile-time proof the zod-free twins in ../types.ts equal these schemas.\ntype Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;\ntype AssertTrue<T extends true> = T;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype ErrorTwinCheck = [\n AssertTrue<Same<z.infer<typeof ErrorCode>, ErrorCodeName>>,\n AssertTrue<Same<z.infer<typeof ErrorReason>, ErrorReasonName>>,\n AssertTrue<Same<NonNullable<z.input<typeof ProtocolErrorBody>[\"data\"]>, ErrorData>>,\n];\n\n// Inferred (output) types — same name as the schema, so `FsEntry` is both the validator and its type.\nexport type ErrorCode = z.output<typeof ErrorCode>;\nexport type ErrorReason = z.output<typeof ErrorReason>;\nexport type ProtocolErrorBody = z.output<typeof ProtocolErrorBody>;\nexport type FsPatchEditFailure = z.output<typeof FsPatchEditFailure>;\n","/** @ai-matrx/desktop-protocol — binary frame header and flow-control constants. Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */\nimport { z } from \"zod\";\nimport { FRAME_VERSION } from \"../frame\";\nimport type { FrameHeader as FrameHeaderShape } from \"../frame\";\nimport { u32 } from \"./primitives\";\n\n/** Zod twin of the codec's FrameHeader (layout documented in src/frame.ts) — for $defs and Pydantic. */\nexport const FrameHeader = z\n .strictObject({\n version: z.literal(FRAME_VERSION),\n flags: z.int().min(0).max(3),\n channel: z.union([z.literal(0), z.literal(1), z.literal(2), z.literal(3), z.literal(255)]),\n cid: u32,\n sid: u32,\n seq: u32,\n });\nexport type FrameHeader = z.infer<typeof FrameHeader>;\n\n/** Relay ↔ device hop: the header of a frame carrying one JSON envelope. cid 0 = broadcast (device → relay). */\nexport const RelayHopEnvelopeHeader = z\n .strictObject({\n version: z.literal(FRAME_VERSION),\n flags: z.literal(0),\n channel: z.literal(255),\n cid: u32,\n sid: z.literal(0),\n seq: z.literal(0),\n });\nexport type RelayHopEnvelopeHeader = z.infer<typeof RelayHopEnvelopeHeader>;\n\n/** Relay ↔ device hop: the header of a connection-end frame (FIN, empty payload; see connectionEndFrame). */\nexport const RelayHopConnectionEnd = z\n .strictObject({\n version: z.literal(FRAME_VERSION),\n flags: z.literal(1),\n channel: z.literal(255),\n cid: z.int().min(1).max(4_294_967_295),\n sid: z.literal(0),\n seq: z.literal(0),\n });\nexport type RelayHopConnectionEnd = z.infer<typeof RelayHopConnectionEnd>;\n\n// Compile-time proof the zod twin and the zod-free codec type are the same shape.\ntype Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;\ntype AssertTrue<T extends true> = T;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype FrameHeaderTwinCheck = AssertTrue<Same<z.infer<typeof FrameHeader>, FrameHeaderShape>>;\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Flow control (credits)\n//\n// The RECEIVER of a byte stream grants the SENDER a window in payload bytes. The sender may have at\n// most `window` un-credited payload bytes in flight per sid; it pauses its source (node-pty\n// pause(), file read loop) at zero and resumes on credit. Initial window = request's\n// `window_bytes` or limits.default_window_bytes. The receiver sends credit{n} after it has\n// CONSUMED n bytes (xterm write callback fired, file chunk persisted). Overrun → PROTOCOL_ERROR\n// and the stream is ended. Credits are end-to-end (client↔core), so the relay holds at most\n// sum(windows) per device and never buffers without bound. Unary JSON ops are not credited.\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const DEFAULT_WINDOW_BYTES = 262_144 as const; // 256 KiB\nexport const DEFAULT_MAX_FRAME_PAYLOAD_BYTES = 65_536 as const; // 64 KiB\nexport const DEFAULT_MAX_MESSAGE_BYTES = 8_388_608 as const; // 8 MiB JSON message cap\n\n","/** @ai-matrx/desktop-protocol — the JSON envelope (SPEC §4). Schema source: lint-enforced rules in scripts/check-schema-source.mjs. */\nimport { z } from \"zod\";\nimport { ProtocolErrorBody } from \"./errors\";\nimport { DeviceId, ProtocolVersion, RequestId, ResourceId, epochMs, u32 } from \"./primitives\";\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Client types and hello\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const ClientType = z\n .enum([\"screen\", \"web\", \"extension\", \"server\", \"test\"]);\n\nexport const Limits = z\n .strictObject({\n max_message_bytes: z.int().min(65_536),\n max_frame_payload_bytes: z.int().min(4096),\n default_window_bytes: z.int().min(4096),\n max_streams_per_client: z.int().min(1),\n max_resources_per_user: z.int().min(1),\n });\n\nexport const OpDescriptor = z\n .strictObject({ cap: z.string().max(32), op: z.string().max(64), since: ProtocolVersion });\n\nexport const Welcome = z\n .strictObject({\n protocol_version: ProtocolVersion, // negotiated = min(client, core) within the same major\n session_id: z.string().min(8).max(64),\n client_id: z.string().min(8).max(64), // this connection's identity in the Session Manager\n device_id: DeviceId,\n device_name: z.string().max(128),\n app_version: z.string().max(32),\n platform: z.enum([\"darwin\", \"win32\", \"linux\"]),\n ops: z.array(OpDescriptor),\n limits: Limits,\n server_time_ms: epochMs,\n });\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Envelope (SPEC §4). Text WS messages carry exactly one of these as JSON.\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const HelloMsg = z\n .strictObject({\n type: z.literal(\"hello\"),\n id: RequestId, // answered by response{id, result: Welcome} or error{id}\n protocolVersion: ProtocolVersion,\n clientType: ClientType,\n clientVersion: z.string().min(1).max(32),\n });\n\nexport const RequestMsg = z\n .strictObject({\n id: RequestId,\n type: z.literal(\"request\"),\n cap: z.string().min(1).max(32),\n op: z.string().min(1).max(64),\n params: z.unknown(), // validated by the Router against OPS[cap.op].params — once, there\n });\n\nexport const ResponseMsg = z\n .strictObject({ id: RequestId, type: z.literal(\"response\"), result: z.unknown() });\n\nexport const ErrorMsg = z\n .strictObject({ id: RequestId, type: z.literal(\"error\"), error: ProtocolErrorBody });\n\nexport const StreamMeta = z\n .discriminatedUnion(\"kind\", [\n /** Binds request id → numeric sid; binary frames for this stream follow. */\n z.strictObject({\n kind: z.literal(\"open\"),\n sid: u32,\n window_bytes: z.int().min(4096),\n resource_id: ResourceId.optional(),\n }),\n /** Frames after this (channel SNAPSHOT) are a serialized screen; live DATA resumes after. */\n z.strictObject({ kind: z.literal(\"snapshot\"), cols: z.int().min(1), rows: z.int().min(1) }),\n /** Frames [from_seq, to_seq] are gone from the ring; a snapshot follows. */\n z.strictObject({ kind: z.literal(\"gap\"), from_seq: u32, to_seq: u32 }),\n ]);\n\nexport const StreamMsg = z\n .strictObject({ id: RequestId, type: z.literal(\"stream\"), seq: u32, meta: StreamMeta });\n\nexport const EndReason = z\n .enum([\"completed\", \"cancelled\", \"detached\", \"resource_exited\", \"error\"]);\n\nexport const EndMsg = z\n .strictObject({ id: RequestId, type: z.literal(\"end\"), seq: u32, reason: EndReason.optional() });\n\nexport const CancelMsg = z\n .strictObject({ id: RequestId, type: z.literal(\"cancel\") });\n\n/** Grant n more payload bytes for the stream opened by request `id` (either direction). */\nexport const CreditMsg = z\n .strictObject({ id: RequestId, type: z.literal(\"credit\"), n: z.int().min(1).max(2_147_483_647) });\n\nexport const EventMsg = z\n .strictObject({\n type: z.literal(\"event\"),\n cap: z.string().min(1).max(32),\n name: z.string().min(1).max(64),\n payload: z.unknown(), // validated against EVENTS[cap.name]\n resourceId: ResourceId.optional(),\n });\n\n/** Client↔relay only; the relay consumes these and never forwards them to the core. */\nexport const RelayMsg = z\n .discriminatedUnion(\"op\", [\n /** Fresh access token before the current one expires (relay closes 4008 at exp + 60 s). */\n z.strictObject({ type: z.literal(\"relay\"), op: z.literal(\"reauth\"), token: z.string().min(16).max(8192) }),\n ]);\n\n/**\n * Heartbeat. Sent as these EXACT bytes; the relay answers via the Durable Object\n * setWebSocketAutoResponse pair, so a heartbeat never wakes a hibernated object.\n * Interval 25 s (device and clients); 2 missed pongs = reconnect.\n */\nexport const PING_TEXT = '{\"type\":\"ping\"}' as const;\nexport const PONG_TEXT = '{\"type\":\"pong\"}' as const;\n\n/**\n * Every WebSocket (device, phone, browser, localhost) offers this subprotocol; the access token\n * rides beside it as `${BEARER_PREFIX}<token>`, never in the URL. The server echoes only SUBPROTOCOL.\n */\nexport const SUBPROTOCOL = \"matrx.v1\" as const;\nexport const BEARER_PREFIX = \"bearer.\" as const;\n\nexport const ClientToCoreMsg = z\n .discriminatedUnion(\"type\", [HelloMsg, RequestMsg, CancelMsg, CreditMsg]);\n\nexport const CoreToClientMsg = z\n .discriminatedUnion(\"type\", [ResponseMsg, ErrorMsg, StreamMsg, EndMsg, CreditMsg, EventMsg]);\n\n// ─────────────────────────────────────────────────────────────────────────────\n// WebSocket close codes (relay and localhost transport alike)\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const CloseCode = {\n NORMAL: 1000,\n GOING_AWAY: 1001, // app quit; relay: the device was silent for 75 s — reconnect\n /** Never sent by anyone: what a socket reports when it drops without a close frame. A relay\n * deploy (every Durable Object restarts) arrives as this — reconnect immediately. */\n ABNORMAL: 1006,\n /** Relay → clients: the device (re)connected, so the core session they spoke to is gone —\n * reconnect, hello, and reattach with since_seq. */\n DEVICE_RECONNECTED: 1012,\n TRY_AGAIN_LATER: 1013, // relay: signing keys or the device registry unreachable — retry\n AUTH_INVALID: 4001,\n AUTH_FORBIDDEN: 4003,\n DEVICE_NOT_FOUND: 4004,\n AUTH_EXPIRED: 4008, // no reauth before exp + 60 s\n REPLACED: 4009, // a newer device socket for the same device took over\n DEVICE_REVOKED: 4010, // kill switch — do NOT reconnect\n PROTOCOL_ERROR: 4400,\n UPGRADE_REQUIRED: 4426,\n} as const;\n\n/** Every close code above, as a schema (so Python sees the same table). */\nexport const CloseCodeValue = z.literal([1000, 1001, 1006, 1012, 1013, 4001, 4003, 4004, 4008, 4009, 4010, 4400, 4426]);\nexport type CloseCodeValue = z.output<typeof CloseCodeValue>;\n\n// Compile-time proof the schema lists exactly the CloseCode table.\ntype SameCodes<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;\ntype AssertCodes<T extends true> = T;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype CloseCodeTableCheck = AssertCodes<SameCodes<CloseCodeValue, (typeof CloseCode)[keyof typeof CloseCode]>>;\n\n// Inferred (output) types — same name as the schema, so `FsEntry` is both the validator and its type.\nexport type ClientType = z.output<typeof ClientType>;\nexport type Limits = z.output<typeof Limits>;\nexport type OpDescriptor = z.output<typeof OpDescriptor>;\nexport type Welcome = z.output<typeof Welcome>;\nexport type HelloMsg = z.output<typeof HelloMsg>;\nexport type RequestMsg = z.output<typeof RequestMsg>;\nexport type ResponseMsg = z.output<typeof ResponseMsg>;\nexport type ErrorMsg = z.output<typeof ErrorMsg>;\nexport type StreamMeta = z.output<typeof StreamMeta>;\nexport type StreamMsg = z.output<typeof StreamMsg>;\nexport type EndReason = z.output<typeof EndReason>;\nexport type EndMsg = z.output<typeof EndMsg>;\nexport type CancelMsg = z.output<typeof CancelMsg>;\nexport type CreditMsg = z.output<typeof CreditMsg>;\nexport type EventMsg = z.output<typeof EventMsg>;\nexport type RelayMsg = z.output<typeof RelayMsg>;\nexport type ClientToCoreMsg = z.output<typeof ClientToCoreMsg>;\nexport type CoreToClientMsg = z.output<typeof CoreToClientMsg>;\n"],"mappings":";;;;;AACA,SAAS,SAAS;AAClB,SAAS,0BAA0B;AAM5B,IAAM,iBAAiB;AAsQvB,IAAM,iBAAiB;AAEvB,IAAM,mBAAmB,GAAG,cAAc,IAAI,cAAc;AAE5D,IAAM,kBAAkB,EAC5B,OAAO,EACP,MAAM,+BAA+B;AAOjC,IAAM,YAAY,EACtB,OAAO,EACP,IAAI,CAAC,EACL,IAAI,EAAE,EACN,MAAM,kBAAkB;AAGpB,IAAM,aAAa,EACvB,OAAO,EACP,M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AAC;AAGI,IAAM,WAAWA,GACrB,mBAAmB,MAAM;AAAA;AAAA,EAExBA,GAAE,aAAa,EAAE,MAAMA,GAAE,QAAQ,OAAO,GAAG,IAAIA,GAAE,QAAQ,QAAQ,GAAG,OAAOA,GAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC;AAC3G,CAAC;AAOI,IAAM,YAAY;AAClB,IAAM,YAAY;AAMlB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AAEtB,IAAM,kBAAkBA,GAC5B,mBAAmB,QAAQ,CAAC,UAAU,YAAY,WAAW,SAAS,CAAC;AAEnE,IAAM,kBAAkBA,GAC5B,mBAAmB,QAAQ,CAAC,aAAa,UAAU,WAAW,QAAQ,WAAW,QAAQ,CAAC;AAMtF,IAAM,YAAY;AAAA,EACvB,QAAQ;AAAA,EACR,YAAY;AAAA;AAAA;AAAA;AAAA,EAGZ,UAAU;AAAA;AAAA;AAAA,EAGV,oBAAoB;AAAA,EACpB,iBAAiB;AAAA;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,cAAc;AAAA;AAAA,EACd,UAAU;AAAA;AAAA,EACV,gBAAgB;AAAA;AAAA,EAChB,gBAAgB;AAAA,EAChB,kBAAkB;AACpB;AAGO,IAAM,iBAAiBA,GAAE,QAAQ,CAAC,KAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI,CAAC;","names":["z","z","z","z","z","z"]}
|
package/dist/client.cjs
CHANGED
|
@@ -147,7 +147,7 @@ var init_primitives = __esm({
|
|
|
147
147
|
import_zod = require("zod");
|
|
148
148
|
import_uuid = require("@ai-matrx/kit/uuid");
|
|
149
149
|
PROTOCOL_MAJOR = 1;
|
|
150
|
-
PROTOCOL_MINOR =
|
|
150
|
+
PROTOCOL_MINOR = 92;
|
|
151
151
|
PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
152
152
|
ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
153
153
|
RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -246,8 +246,11 @@ var init_errors = __esm({
|
|
|
246
246
|
// 1.76 (REASONS_SINCE): models.llm.chat (1.88: models.embed names the same two)
|
|
247
247
|
"model_not_running",
|
|
248
248
|
// NOT_FOUND (nothing runs) or RESOURCE_BUSY (another model runs): start this model first
|
|
249
|
-
"model_server_unreachable"
|
|
249
|
+
"model_server_unreachable",
|
|
250
250
|
// RESOURCE_GONE (retryable): llama-server did not answer on this computer
|
|
251
|
+
// 1.91 (REASONS_SINCE): models.llm.chat with start_if_stopped when another model answers a live chat
|
|
252
|
+
"busy_with_another_chat"
|
|
253
|
+
// RESOURCE_BUSY (retryable): the loaded model is answering another chat now; data.chat_title names it
|
|
251
254
|
]);
|
|
252
255
|
FsPatchEditFailure = import_zod2.z.strictObject({ edit_index: nonNegInt, reason: import_zod2.z.string().max(300) });
|
|
253
256
|
ProtocolErrorBody = import_zod2.z.strictObject({
|
|
@@ -263,6 +266,8 @@ var init_errors = __esm({
|
|
|
263
266
|
settings_url: import_zod2.z.string().max(512).optional(),
|
|
264
267
|
// PERMISSION_DENIED_OS deep link
|
|
265
268
|
retry_after_ms: nonNegInt.optional(),
|
|
269
|
+
/** (1.91) busy_with_another_chat: the title of the chat the loaded model is answering now, in words a person reads. */
|
|
270
|
+
chat_title: import_zod2.z.string().max(200).optional(),
|
|
266
271
|
limit_bytes: nonNegInt.optional(),
|
|
267
272
|
/** fs.patch when every edit failed (CONFLICT, patch_no_match / patch_ambiguous): the daemon's 422 `failures`. */
|
|
268
273
|
edits_failed: import_zod2.z.array(FsPatchEditFailure).max(256).optional(),
|
|
@@ -1169,6 +1174,8 @@ var init_models = __esm({
|
|
|
1169
1174
|
body: import_zod10.z.record(import_zod10.z.string().max(200), import_zod10.z.unknown()),
|
|
1170
1175
|
/** Start the model first when nothing runs (a `models` progress event says so); a different model running is never stopped. */
|
|
1171
1176
|
start_if_stopped: import_zod10.z.boolean().optional(),
|
|
1177
|
+
/** (1.92) The title of the chat this completion belongs to: named in the busy refusal to another chat that finds this model answering it. */
|
|
1178
|
+
chat_title: import_zod10.z.string().max(200).optional(),
|
|
1172
1179
|
window_bytes: import_zod10.z.int().min(4096).max(16777216).optional()
|
|
1173
1180
|
});
|
|
1174
1181
|
ModelsLlmChatResult = import_zod10.z.strictObject({ model: TextModelId, content_type: import_zod10.z.string().max(128) });
|