@ai-matrx/desktop-protocol 0.21.62 → 0.21.65

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 CHANGED
@@ -1,16 +1,42 @@
1
1
  # Changelog
2
2
 
3
- ### Unreleased
3
+ ## 0.21.65
4
4
 
5
+ - **Protocol 1.66 — matrx-local's window and audio contracts on Matrx 2 (2026-10-21).** `window.list` takes `app` (owning app name substring, local_window's app_filter); `window.minimize` takes `mode` minimize / maximize / restore (local_window's window_action) and echoes it; `audio.record` takes `channels` and `sample_rate` and reports both; `audio.play` takes `device_id` (an output from audio.devices). Optional fields only, in FIELDS_SINCE; an older core refuses the new params as INVALID_PARAMS. Consumer action: none.
6
+ - **Protocol 1.65 — "Continued from <account>" is a transcript item (2026-10-21).** `CodingTranscriptItem` gains `continued` (`id`, `from`, `text`, `at`): the line across a coding chat where it moved from another account (@ai-matrx/coding-sessions emits it where it used to emit an info `notice`). `forPeer` sends a 1.64 peer's `coding.history` / `coding.transcript.read` each as that `notice`, so its strict union never refuses the whole transcript. Consumer action: draw it as a divider at its place (the coding-sessions screen does).
7
+ - **Protocol 1.64 — agent versions in Matrx 2 (2026-10-21).** New ops `account.agents.versions` (an agent's saved versions: number, age, note; the current version), `account.agents.version_diff` (one version and the current one as agent-definition records for `@ai-matrx/agents/versions/react` AgentDiffViewer) and `account.agents.restore_version` (`agx_promote_version`). New ops only; an older peer never sees them. Consumer action: none.
5
8
  - **Protocol 1.63 — a chat's instance, and what an instance record lacks (2026-10-21).** `ChatRow.home` (`ChatPlace`): the instance whose folder holds the chat, read only (Claude: the side window holding its newest record copy, else main; Codex: the home whose database holds it). `AppInstance.missing` (`InstanceGap[]`: account / email / version): what the record still lacks after Matrx filled what it remembered (Matrx 2 ledger D10). Optional; stripped for a 1.62 peer by `forPeer`. Consumer action: none.
6
9
  - **Protocol 1.62 — moves as records (2026-10-20).** `ChatRow.moved` (`ChatMove[]`, newest first: `kind` move / copy, `from`, `to`, `at_ms`, `back_at_ms`): every Move and Copy of a chat between instances as Matrx recorded it, so a screen reads where a chat went and whether it came back from the record, never from a project named "From X". Optional; stripped for a 1.61 peer by `forPeer`. Consumer action: none.
7
10
  - **Protocol 1.61 — where a chat's title shows (2026-10-20).** `ChatRow.title_sync` (`ChatTitleSync`: `state` synced / not_synced / unsupported, and a `note`): the title facet's sync state for the chat's app, so a screen can say honestly whether the app shows the person's name. Optional; stripped for a 1.60 peer by `forPeer`. Consumer action: none.
8
11
  - **Shared code ships once per side (2026-10-18).** Built `splitting: false`, the root, `/frame` and `/client` each carried their own copy of 44 shared modules. ESM now builds them in one split pass (`chunk-server-*.js`, no banner); `/react` builds alone, stamped. CJS unsplit; declarations per group. ESM JS 610,843 -> 398,722 bytes; root + `/client` together 597 KB -> 390 KB; `/frame` stays zod-free (6 KB); every entry's export names identical (ESM and CJS). Guard: `../scripts/check-ships-once.mjs`, run in `build`. Consumer action: none.
9
12
 
13
+ ## 0.21.64
14
+
15
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
16
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
17
+ Diff: `git diff 920791a7ff 8d4dfed0d7 -- apps/shared/desktop-protocol/src`
18
+
19
+ Changed shipped source files (6):
20
+ - `apps/shared/desktop-protocol/src/contract.ts`
21
+ - `apps/shared/desktop-protocol/src/schema/account.ts`
22
+ - `apps/shared/desktop-protocol/src/schema/coding-sessions.ts`
23
+ - `apps/shared/desktop-protocol/src/schema/primitives.ts`
24
+ - `apps/shared/desktop-protocol/src/schema/registry.ts`
25
+ - `apps/shared/desktop-protocol/src/versioning.ts`
26
+
10
27
  ## 0.21.62
11
28
 
12
- UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
13
- Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/desktop-protocol/src`.
29
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
30
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
31
+ Diff: `git diff e86170a22e 920791a7ff -- apps/shared/desktop-protocol/src`
32
+
33
+ Changed shipped source files (6):
34
+ - `apps/shared/desktop-protocol/src/contract.ts`
35
+ - `apps/shared/desktop-protocol/src/schema/apps-chats.ts`
36
+ - `apps/shared/desktop-protocol/src/schema/apps-instances.ts`
37
+ - `apps/shared/desktop-protocol/src/schema/primitives.ts`
38
+ - `apps/shared/desktop-protocol/src/schema/registry.ts`
39
+ - `apps/shared/desktop-protocol/src/versioning.ts`
14
40
 
15
41
  ## 0.21.61
16
42
 
@@ -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 = 63;
9
+ var PROTOCOL_MINOR = 66;
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_-]+$/);
@@ -1002,6 +1002,36 @@ var AccountAgentsRunsResult = z11.strictObject({
1002
1002
  });
1003
1003
  var AccountAgentsFavoriteParams = z11.strictObject({ agent_id: AccountRowId, favorite: z11.boolean() });
1004
1004
  var AccountAgentsFavoriteResult = z11.strictObject({ favorite: z11.boolean() });
1005
+ var AccountAgentVersion = z11.strictObject({
1006
+ version_id: AccountRowId,
1007
+ version_number: z11.int().min(1),
1008
+ changed_at_ms: epochMs,
1009
+ /** The change note the person wrote when saving, when they wrote one. */
1010
+ note: z11.string().max(1e3).nullable()
1011
+ });
1012
+ var AccountAgentsVersionsParams = z11.strictObject({
1013
+ agent_id: AccountRowId,
1014
+ offset: z11.int().min(0).max(1e5).optional(),
1015
+ limit: z11.int().min(1).max(200).optional()
1016
+ });
1017
+ var AccountAgentsVersionsResult = z11.strictObject({
1018
+ state: AccountReadState,
1019
+ problem: z11.string().max(300).nullable(),
1020
+ /** The version the agent is at now (null: no saved version yet). */
1021
+ current_version: z11.int().min(1).nullable(),
1022
+ rows: z11.array(AccountAgentVersion).max(200)
1023
+ });
1024
+ var AccountAgentsVersionDiffParams = z11.strictObject({ agent_id: AccountRowId, version_number: z11.int().min(1) });
1025
+ var AccountAgentsVersionDiffResult = z11.strictObject({
1026
+ state: AccountReadState,
1027
+ problem: z11.string().max(300).nullable(),
1028
+ version_number: z11.int().min(1),
1029
+ current_version: z11.int().min(1).nullable(),
1030
+ old: z11.record(z11.string().max(200), z11.unknown()).nullable(),
1031
+ current: z11.record(z11.string().max(200), z11.unknown()).nullable()
1032
+ });
1033
+ var AccountAgentsRestoreVersionParams = z11.strictObject({ agent_id: AccountRowId, version_number: z11.int().min(1) });
1034
+ var AccountAgentsRestoreVersionResult = z11.strictObject({ restored_version: z11.int().min(1) });
1005
1035
  var VaultItemKind = z11.enum(["login", "passkey", "key", "other"]);
1006
1036
  var VaultFieldSummary = z11.strictObject({
1007
1037
  key: z11.string().min(1).max(120),
@@ -2482,6 +2512,8 @@ var WindowInfo = z24.strictObject({
2482
2512
  var WindowListParams = z24.strictObject({
2483
2513
  /** Case-insensitive substring of the window title. */
2484
2514
  title: z24.string().min(1).max(256).optional(),
2515
+ /** (1.66) Case-insensitive substring of the owning application's name (matrx-local's app_filter). */
2516
+ app: z24.string().min(1).max(256).optional(),
2485
2517
  limit: z24.int().min(1).max(500).default(100)
2486
2518
  });
2487
2519
  var WindowListResult = z24.strictObject({
@@ -2501,8 +2533,17 @@ var WindowMoveParams = z24.strictObject({
2501
2533
  height: z24.int().min(50).max(16384).optional()
2502
2534
  });
2503
2535
  var WindowMoveResult = z24.strictObject({ window: WindowInfo });
2504
- var WindowMinimizeParams = z24.strictObject({ id: nonNegInt });
2505
- var WindowMinimizeResult = z24.strictObject({ id: nonNegInt });
2536
+ var WindowState = z24.enum(["minimize", "maximize", "restore"]);
2537
+ var WindowMinimizeParams = z24.strictObject({
2538
+ id: nonNegInt,
2539
+ /** (1.66) minimize (the default), maximize (fill its display), or restore (bring a minimized or maximized window back). */
2540
+ mode: WindowState.optional()
2541
+ });
2542
+ var WindowMinimizeResult = z24.strictObject({
2543
+ id: nonNegInt,
2544
+ /** (1.66) What was done. */
2545
+ mode: WindowState.optional()
2546
+ });
2506
2547
 
2507
2548
  // src/schema/input.ts
2508
2549
  import { z as z25 } from "zod";
@@ -3014,16 +3055,27 @@ var AudioRecordParams = z30.strictObject({
3014
3055
  /** The microphone (from audio.devices); the default input when absent. */
3015
3056
  device_id: z30.string().min(1).max(256).optional(),
3016
3057
  /** Where the WAV file goes; a new file in the temp folder when absent. */
3017
- path: AbsPath.optional()
3058
+ path: AbsPath.optional(),
3059
+ /** (1.66) 1 (mono, the default) or 2 (stereo). */
3060
+ channels: z30.int().min(1).max(2).optional(),
3061
+ /** (1.66) Samples per second; the device's own rate when absent. */
3062
+ sample_rate: z30.int().min(8e3).max(192e3).optional()
3018
3063
  });
3019
3064
  var AudioRecordResult = z30.strictObject({
3020
3065
  path: AbsPath,
3021
3066
  seconds: z30.number().min(0),
3022
3067
  bytes: nonNegInt,
3023
3068
  /** Loudest sample, 0–1: 0 means the device gave silence. */
3024
- peak: z30.number().min(0).max(1)
3069
+ peak: z30.number().min(0).max(1),
3070
+ /** (1.66) The file's channels and sample rate, as written. */
3071
+ channels: z30.int().min(1).max(8).optional(),
3072
+ sample_rate: z30.int().min(1).max(768e3).optional()
3073
+ });
3074
+ var AudioPlayParams = z30.strictObject({
3075
+ path: AbsPath,
3076
+ /** (1.66) The speaker or output (its id from audio.devices' outputs); the system's output when absent. */
3077
+ device_id: z30.string().min(1).max(256).optional()
3025
3078
  });
3026
- var AudioPlayParams = z30.strictObject({ path: AbsPath });
3027
3079
  var AudioPlayResult = z30.strictObject({ path: AbsPath, seconds: z30.number().min(0) });
3028
3080
  var AudioLevelsParams = z30.strictObject({});
3029
3081
  var AudioLevelsResult = z30.strictObject({
@@ -3311,6 +3363,8 @@ var CodingTranscriptItem = z34.discriminatedUnion("kind", [
3311
3363
  }),
3312
3364
  z34.strictObject({ kind: z34.literal("usage"), usage: CodingRunUsage, costUsd: z34.number().nullable() }),
3313
3365
  z34.strictObject({ kind: z34.literal("notice"), id: z34.string().max(200), level: z34.enum(["info", "warning"]), text: z34.string() }),
3366
+ /** "Continue on <account>": the line across the transcript where the chat moved from `from`. */
3367
+ z34.strictObject({ kind: z34.literal("continued"), id: z34.string().max(200), from: z34.string().max(300), text: z34.string(), at: IsoTime.nullable() }),
3314
3368
  z34.strictObject({ kind: z34.literal("error"), id: z34.string().max(200), text: z34.string() })
3315
3369
  ]);
3316
3370
  var CodingHistoryRecord = z34.strictObject({
@@ -4620,6 +4674,9 @@ var OPS = {
4620
4674
  "account.agents.get": { params: AccountAgentsGetParams, result: AccountAgentsGetResult, kind: "unary", since: "1.39", errors: ["INVALID_PARAMS", "INTERNAL"] },
4621
4675
  "account.agents.runs": { params: AccountAgentsRunsParams, result: AccountAgentsRunsResult, kind: "unary", since: "1.39", errors: ["INVALID_PARAMS", "INTERNAL"] },
4622
4676
  "account.agents.favorite": { params: AccountAgentsFavoriteParams, result: AccountAgentsFavoriteResult, kind: "unary", since: "1.39", errors: ["AUTH_REQUIRED", "NOT_FOUND", "INVALID_PARAMS", "DEVICE_OFFLINE", "INTERNAL"] },
4677
+ "account.agents.versions": { params: AccountAgentsVersionsParams, result: AccountAgentsVersionsResult, kind: "unary", since: "1.64", errors: ["INVALID_PARAMS", "INTERNAL"] },
4678
+ "account.agents.version_diff": { params: AccountAgentsVersionDiffParams, result: AccountAgentsVersionDiffResult, kind: "unary", since: "1.64", errors: ["INVALID_PARAMS", "INTERNAL"] },
4679
+ "account.agents.restore_version": { params: AccountAgentsRestoreVersionParams, result: AccountAgentsRestoreVersionResult, kind: "unary", since: "1.64", errors: ["AUTH_REQUIRED", "NOT_FOUND", "INVALID_PARAMS", "DEVICE_OFFLINE", "INTERNAL"] },
4623
4680
  // 1.26: the app's own update (it installs only once every window quit) and bringing the windows back.
4624
4681
  "apps.windows.update_state": { params: AppsWindowsUpdateStateParams, result: AppsWindowsUpdateStateResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4625
4682
  "apps.windows.reopen": { params: AppsWindowsReopenParams, result: AppsWindowsReopenResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -5071,6 +5128,7 @@ var NAMED_SCHEMAS = {
5071
5128
  WindowMoveResult,
5072
5129
  WindowMinimizeParams,
5073
5130
  WindowMinimizeResult,
5131
+ WindowState,
5074
5132
  InputKey,
5075
5133
  InputKeyboardSettingsParams,
5076
5134
  InputKeyboardSettingsResult,
@@ -5379,6 +5437,13 @@ var NAMED_SCHEMAS = {
5379
5437
  AccountAgentsRunsResult,
5380
5438
  AccountAgentsFavoriteParams,
5381
5439
  AccountAgentsFavoriteResult,
5440
+ AccountAgentVersion,
5441
+ AccountAgentsVersionsParams,
5442
+ AccountAgentsVersionsResult,
5443
+ AccountAgentsVersionDiffParams,
5444
+ AccountAgentsVersionDiffResult,
5445
+ AccountAgentsRestoreVersionParams,
5446
+ AccountAgentsRestoreVersionResult,
5382
5447
  AppsWindowsUpdateStateParams,
5383
5448
  AppsWindowsUpdateStateResult,
5384
5449
  AppsWindowsReopenParams,
@@ -5583,6 +5648,12 @@ var FIELDS_SINCE = {
5583
5648
  ResourcesDisk: { name: "1.17" },
5584
5649
  StackServer: { cpu_percent: "1.18", memory_bytes: "1.18" },
5585
5650
  AudioDevice: { kind: "1.24" },
5651
+ AudioRecordParams: { channels: "1.66", sample_rate: "1.66" },
5652
+ AudioRecordResult: { channels: "1.66", sample_rate: "1.66" },
5653
+ AudioPlayParams: { device_id: "1.66" },
5654
+ WindowListParams: { app: "1.66" },
5655
+ WindowMinimizeParams: { mode: "1.66" },
5656
+ WindowMinimizeResult: { mode: "1.66" },
5586
5657
  ScreenDisplay: { rotation: "1.24", refresh_hz: "1.24", builtin: "1.24" },
5587
5658
  PowerStatusResult: { energy: "1.24" },
5588
5659
  AppsSpendResult: { days: "1.24" },
@@ -5775,6 +5846,18 @@ function providersForPeer(value, version) {
5775
5846
  });
5776
5847
  return next.some((p, i) => p !== providers[i]) ? { ...body, providers: next } : value;
5777
5848
  }
5849
+ function transcriptItemsForPeer(value, version) {
5850
+ if (knows(version, "1.65") || value === null || typeof value !== "object") return value;
5851
+ const body = value;
5852
+ if (!Array.isArray(body.items)) return value;
5853
+ const items = body.items;
5854
+ const next = items.map((item) => {
5855
+ const it = item;
5856
+ if (it?.kind !== "continued") return item;
5857
+ return { kind: "notice", id: it.id, level: "info", text: it.text };
5858
+ });
5859
+ return next.some((it, i) => it !== items[i]) ? { ...body, items: next } : value;
5860
+ }
5778
5861
  var WINDOW_RESULTS = /* @__PURE__ */ new Map([
5779
5862
  ["window.list", "windows"],
5780
5863
  ["window.focus", "window"],
@@ -5803,6 +5886,7 @@ function forPeer(op, part, value, version) {
5803
5886
  const nested = op ? NESTED_RESULTS.get(op) : void 0;
5804
5887
  const stripped = nested ? stripNested(top, nested, version) : top;
5805
5888
  if (op === "coding.providers") return providersForPeer(stripped, version);
5889
+ if (op === "coding.history" || op === "coding.transcript.read") return transcriptItemsForPeer(stripped, version);
5806
5890
  return op === "apps.windows.list" ? windowListRemoteControlForPeer(stripped, version) : stripped;
5807
5891
  }
5808
5892
  if (value === null || typeof value !== "object") return value;
@@ -6033,6 +6117,13 @@ export {
6033
6117
  AccountAgentsRunsResult,
6034
6118
  AccountAgentsFavoriteParams,
6035
6119
  AccountAgentsFavoriteResult,
6120
+ AccountAgentVersion,
6121
+ AccountAgentsVersionsParams,
6122
+ AccountAgentsVersionsResult,
6123
+ AccountAgentsVersionDiffParams,
6124
+ AccountAgentsVersionDiffResult,
6125
+ AccountAgentsRestoreVersionParams,
6126
+ AccountAgentsRestoreVersionResult,
6036
6127
  VaultItemKind,
6037
6128
  VaultFieldSummary,
6038
6129
  VaultItemSummary,
@@ -6316,6 +6407,7 @@ export {
6316
6407
  WindowFocusResult,
6317
6408
  WindowMoveParams,
6318
6409
  WindowMoveResult,
6410
+ WindowState,
6319
6411
  WindowMinimizeParams,
6320
6412
  WindowMinimizeResult,
6321
6413
  InputKey,
@@ -6696,4 +6788,4 @@ export {
6696
6788
  closeRule,
6697
6789
  isTerminalClose
6698
6790
  };
6699
- //# sourceMappingURL=chunk-server-EQCCXWD7.js.map
6791
+ //# sourceMappingURL=chunk-server-K7IQDLLV.js.map