@ai-matrx/desktop-protocol 0.21.51 → 0.21.53

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,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.53
4
+
5
+ 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.
6
+ Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/desktop-protocol/src`.
7
+
8
+ ## 0.21.52
9
+ ### Unreleased
10
+ ### Protocol 1.57 — the account a coding record belongs to, and each sign-in's usage
11
+
12
+ - `accountId` (optional) on `CodingSessionRecord`, `CodingDiscoveredChat`, `CodingRecentRow` and
13
+ the new named `CodingSearchHit`: the account a session runs as, or whose config directory holds
14
+ the chat; absent = the default sign-in. Before this, the engine's `accountId` on Recent rows and
15
+ search hits made `coding.sessions.list` and `coding.search` fail "did not match its schema".
16
+ - `coding.providers`: `usage` (`CodingAccountUsage`) and `continueOn` (`CodingContinueTarget`) on a
17
+ provider and on each of its `accounts` (now the named `CodingProviderAccount`, with its own
18
+ `ready`, `lastProblem`, `problem`, `fix`).
19
+ - All optional, in FIELDS_SINCE, stripped by `forPeer` for a 1.56 peer (accounts' fields one level
20
+ below the providers). Consumer action: none for an older client; a 1.57 client can show the
21
+ account and "Continue on <account>" remotely.
22
+ - coding-sessions now parses every engine answer with these strict schemas (its wire-contract test).
23
+
3
24
  ## 0.21.51
4
25
  ### Unreleased
5
26
  ### Protocol 1.56 — Continue on another account, from anywhere
package/dist/client.cjs CHANGED
@@ -144,7 +144,7 @@ var import_zod2 = require("zod");
144
144
  var import_zod = require("zod");
145
145
  var import_uuid = require("@ai-matrx/kit/uuid");
146
146
  var PROTOCOL_MAJOR = 1;
147
- var PROTOCOL_MINOR = 56;
147
+ var PROTOCOL_MINOR = 58;
148
148
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
149
149
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
150
150
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -886,8 +886,17 @@ var ModelsLlmStatusResult = import_zod9.z.strictObject({
886
886
  /** Why the last start or download failed, one human line; null otherwise. */
887
887
  error: import_zod9.z.string().max(300).nullable()
888
888
  });
889
- var ModelsLlmInstallParams = import_zod9.z.strictObject({ model: TextModelId });
890
- var ModelsLlmInstallResult = import_zod9.z.strictObject({ model: TextModelId, elapsed_ms: nonNegInt });
889
+ var ModelsLlmInstallParams = import_zod9.z.strictObject({
890
+ model: TextModelId,
891
+ /** (1.58) The person's own Hugging Face token for this download (gated/private files): sent only to Hugging Face hosts, never stored or logged. */
892
+ hf_token: import_zod9.z.string().min(8).max(512).optional()
893
+ });
894
+ var ModelsLlmInstallResult = import_zod9.z.strictObject({
895
+ model: TextModelId,
896
+ elapsed_ms: nonNegInt,
897
+ /** (1.58) path -> SHA-256 of every file whose catalog sha256 was null, hashed on this first download. */
898
+ hashed: import_zod9.z.record(import_zod9.z.string().max(512), import_zod9.z.string().regex(/^[0-9a-f]{64}$/)).optional()
899
+ });
891
900
  var ModelsLlmStartParams = import_zod9.z.strictObject({
892
901
  model: TextModelId,
893
902
  /** Tokens of context, from the knob desktop.models/context_length. Omitted today means the service's fixed 4096 (optional until callers send it). */
@@ -909,7 +918,11 @@ var CatalogFile = import_zod9.z.strictObject({
909
918
  /** The pinned https URL it is downloaded from. */
910
919
  url: import_zod9.z.string().url().max(2048),
911
920
  size_bytes: nonNegInt,
912
- sha256: Sha256Hex,
921
+ /**
922
+ * The file's SHA-256; (1.58) null when its source publishes none (a small non-LFS file on Hugging
923
+ * Face): the first download hashes it and reports it in `models.llm.install`'s `hashed`.
924
+ */
925
+ sha256: Sha256Hex.nullable(),
913
926
  /** weights, weights_shard, mmproj, config, tokenizer, … (ai.model_artifact.role). */
914
927
  role: import_zod9.z.string().max(32)
915
928
  });
@@ -2481,7 +2494,12 @@ var CodingSessionRecord = import_zod28.z.strictObject({
2481
2494
  lastRunStatus: CodingRunStatus.nullable(),
2482
2495
  queued: import_zod28.z.array(import_zod28.z.string().max(1048576)).max(100),
2483
2496
  agent: CodingSessionAgent.nullable(),
2484
- agentRemovedDue: import_zod28.z.boolean()
2497
+ agentRemovedDue: import_zod28.z.boolean(),
2498
+ /**
2499
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
2500
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
2501
+ */
2502
+ accountId: import_zod28.z.string().min(1).max(64).optional()
2485
2503
  });
2486
2504
  var CodingActiveElsewhere = import_zod28.z.strictObject({
2487
2505
  reason: import_zod28.z.enum(["process", "recent-write", "open-tool-call", "open"]),
@@ -2503,7 +2521,12 @@ var CodingDiscoveredChat = import_zod28.z.strictObject({
2503
2521
  unavailable: ShortText.nullable(),
2504
2522
  updatedAt: IsoTime,
2505
2523
  source: import_zod28.z.string().max(60).nullable(),
2506
- activeElsewhere: CodingActiveElsewhere.nullable()
2524
+ activeElsewhere: CodingActiveElsewhere.nullable(),
2525
+ /**
2526
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
2527
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
2528
+ */
2529
+ accountId: import_zod28.z.string().min(1).max(64).optional()
2507
2530
  });
2508
2531
  var CodingTranscriptItem = import_zod28.z.discriminatedUnion("kind", [
2509
2532
  import_zod28.z.strictObject({ kind: import_zod28.z.literal("user"), id: import_zod28.z.string().max(200), text: import_zod28.z.string(), at: IsoTime.nullable() }),
@@ -2543,6 +2566,31 @@ var CodingProviderProblem = import_zod28.z.strictObject({
2543
2566
  until: import_zod28.z.string().max(120).nullable(),
2544
2567
  at: IsoTime
2545
2568
  });
2569
+ var CodingAccountUsage = import_zod28.z.strictObject({
2570
+ windows: import_zod28.z.array(CodingQuotaWindow).max(20),
2571
+ /** The provider's own status word ("allowed", "allowed_warning", "rejected"...), when it gives one. */
2572
+ status: import_zod28.z.string().max(60).nullable(),
2573
+ /** When a rejected status lifts (ISO), when the provider says. */
2574
+ resetsAt: import_zod28.z.string().max(80).nullable(),
2575
+ at: IsoTime
2576
+ });
2577
+ var CodingContinueTarget = import_zod28.z.strictObject({
2578
+ accountId: import_zod28.z.string().min(1).max(64).nullable(),
2579
+ label: import_zod28.z.string().max(200)
2580
+ });
2581
+ var CodingProviderAccount = import_zod28.z.strictObject({
2582
+ id: import_zod28.z.string().min(1).max(64),
2583
+ label: import_zod28.z.string().max(200),
2584
+ /** (1.57) No known usage limit or expired sign-in on this account. Absent: not read. */
2585
+ ready: import_zod28.z.boolean().optional(),
2586
+ lastProblem: CodingProviderProblem.optional(),
2587
+ problem: ShortText.optional(),
2588
+ fix: ShortText.optional(),
2589
+ /** (1.57) Absent: never seen ("No usage data yet"). */
2590
+ usage: CodingAccountUsage.optional(),
2591
+ /** (1.57) This account is limited and that other one is not: "Continue on <label>". */
2592
+ continueOn: CodingContinueTarget.optional()
2593
+ });
2546
2594
  var CodingProviderBinary = import_zod28.z.strictObject({
2547
2595
  path: LocalPath,
2548
2596
  version: import_zod28.z.string().max(80).nullable(),
@@ -2579,9 +2627,13 @@ var CodingProviderStatus = import_zod28.z.strictObject({
2579
2627
  * can use, as the computer's engine lists them; New session offers them beside the default sign-in.
2580
2628
  * Absent: only the default sign-in (or a computer older than 1.53).
2581
2629
  */
2582
- accounts: import_zod28.z.array(import_zod28.z.strictObject({ id: import_zod28.z.string().min(1).max(64), label: import_zod28.z.string().max(200) })).max(100).optional(),
2630
+ accounts: import_zod28.z.array(CodingProviderAccount).max(100).optional(),
2583
2631
  /** (1.53) The computer tried to list `accounts` and could not: a short sentence the form shows with a retry. */
2584
- accountsProblem: ShortText.optional()
2632
+ accountsProblem: ShortText.optional(),
2633
+ /** (1.57) The default sign-in's usage as last seen. Absent: never seen ("No usage data yet"). */
2634
+ usage: CodingAccountUsage.optional(),
2635
+ /** (1.57) The default sign-in is limited and this other account is not: "Continue on <label>". */
2636
+ continueOn: CodingContinueTarget.optional()
2585
2637
  });
2586
2638
  var CodingChatPreference = import_zod28.z.strictObject({
2587
2639
  title: import_zod28.z.string().max(500).nullable(),
@@ -2608,7 +2660,12 @@ var CodingRecentRow = import_zod28.z.strictObject({
2608
2660
  state: import_zod28.z.enum(["running", "needs_attention", "new_output", "elsewhere", "idle"]),
2609
2661
  stateLabel: import_zod28.z.string().max(120).nullable(),
2610
2662
  pinned: import_zod28.z.boolean(),
2611
- startedBy: CodingStartedBy.nullable()
2663
+ startedBy: CodingStartedBy.nullable(),
2664
+ /**
2665
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
2666
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
2667
+ */
2668
+ accountId: import_zod28.z.string().min(1).max(64).optional()
2612
2669
  });
2613
2670
  var CodingFolderCheck = import_zod28.z.strictObject({
2614
2671
  path: import_zod28.z.string().max(4096),
@@ -2741,19 +2798,23 @@ var CodingSearchParams = import_zod28.z.strictObject({
2741
2798
  cursor: nonNegInt.optional(),
2742
2799
  limit: import_zod28.z.int().min(1).max(100).optional()
2743
2800
  });
2801
+ var CodingSearchHit = import_zod28.z.strictObject({
2802
+ provider: CodingProviderName,
2803
+ providerSessionId: SessionKey,
2804
+ title: import_zod28.z.string().max(500),
2805
+ cwd: LocalPath.nullable(),
2806
+ updatedAt: IsoTime,
2807
+ where: import_zod28.z.enum(["title", "content"]),
2808
+ snippet: import_zod28.z.string().max(2e3).nullable(),
2809
+ /**
2810
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
2811
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
2812
+ */
2813
+ accountId: import_zod28.z.string().min(1).max(64).optional()
2814
+ });
2744
2815
  var CodingSearchResult = import_zod28.z.strictObject({
2745
2816
  query: import_zod28.z.string().max(500),
2746
- hits: import_zod28.z.array(
2747
- import_zod28.z.strictObject({
2748
- provider: CodingProviderName,
2749
- providerSessionId: SessionKey,
2750
- title: import_zod28.z.string().max(500),
2751
- cwd: LocalPath.nullable(),
2752
- updatedAt: IsoTime,
2753
- where: import_zod28.z.enum(["title", "content"]),
2754
- snippet: import_zod28.z.string().max(2e3).nullable()
2755
- })
2756
- ),
2817
+ hits: import_zod28.z.array(CodingSearchHit),
2757
2818
  scanned: nonNegInt,
2758
2819
  total: nonNegInt,
2759
2820
  nextCursor: nonNegInt.nullable()
@@ -4716,7 +4777,18 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
4716
4777
  ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]],
4717
4778
  ["apps.windows.list", [["windows", "AppWindowInfo"]]],
4718
4779
  ["apps.windows.set_remote_control", [["remote_control", "WindowRemoteControl"]]],
4719
- ["coding.providers", [["providers", "CodingProviderStatus"]]]
4780
+ ["coding.providers", [["providers", "CodingProviderStatus"]]],
4781
+ // 1.57: the account a coding record belongs to.
4782
+ ["coding.sessions.list", [["sessions", "CodingSessionRecord"], ["recent", "CodingRecentRow"]]],
4783
+ ["coding.recent.seen", [["recent", "CodingRecentRow"]]],
4784
+ ["coding.discover", [["chats", "CodingDiscoveredChat"]]],
4785
+ ["coding.search", [["hits", "CodingSearchHit"]]],
4786
+ ["coding.start", [["session", "CodingSessionRecord"]]],
4787
+ ["coding.send", [["session", "CodingSessionRecord"]]],
4788
+ ["coding.takeover", [["session", "CodingSessionRecord"]]],
4789
+ ["coding.options.set", [["session", "CodingSessionRecord"]]],
4790
+ ["coding.agent.set", [["session", "CodingSessionRecord"]]],
4791
+ ["coding.account.continue", [["session", "CodingSessionRecord"]]]
4720
4792
  ]);
4721
4793
  var WINDOW_RESULTS = /* @__PURE__ */ new Map([
4722
4794
  ["window.list", "windows"],