@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/dist/client.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BackoffOptions } from '@ai-matrx/data/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/data/realtime';
3
3
  import { z } from 'zod';
4
- import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-pdHTZ3YT.cjs';
5
- export { i as isDesktopProtocolError } from './models-pdHTZ3YT.cjs';
4
+ import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-qM7u4hzm.cjs';
5
+ export { i as isDesktopProtocolError } from './models-qM7u4hzm.cjs';
6
6
  import { FrameHeader } from './frame.cjs';
7
7
 
8
8
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BackoffOptions } from '@ai-matrx/data/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/data/realtime';
3
3
  import { z } from 'zod';
4
- import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-pdHTZ3YT.js';
5
- export { i as isDesktopProtocolError } from './models-pdHTZ3YT.js';
4
+ import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-qM7u4hzm.js';
5
+ export { i as isDesktopProtocolError } from './models-qM7u4hzm.js';
6
6
  import { FrameHeader } from './frame.js';
7
7
 
8
8
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.js CHANGED
@@ -112,7 +112,7 @@ import { z as z2 } from "zod";
112
112
  import { z } from "zod";
113
113
  import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
114
114
  var PROTOCOL_MAJOR = 1;
115
- var PROTOCOL_MINOR = 56;
115
+ var PROTOCOL_MINOR = 58;
116
116
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
117
117
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
118
118
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -854,8 +854,17 @@ var ModelsLlmStatusResult = z9.strictObject({
854
854
  /** Why the last start or download failed, one human line; null otherwise. */
855
855
  error: z9.string().max(300).nullable()
856
856
  });
857
- var ModelsLlmInstallParams = z9.strictObject({ model: TextModelId });
858
- var ModelsLlmInstallResult = z9.strictObject({ model: TextModelId, elapsed_ms: nonNegInt });
857
+ var ModelsLlmInstallParams = z9.strictObject({
858
+ model: TextModelId,
859
+ /** (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. */
860
+ hf_token: z9.string().min(8).max(512).optional()
861
+ });
862
+ var ModelsLlmInstallResult = z9.strictObject({
863
+ model: TextModelId,
864
+ elapsed_ms: nonNegInt,
865
+ /** (1.58) path -> SHA-256 of every file whose catalog sha256 was null, hashed on this first download. */
866
+ hashed: z9.record(z9.string().max(512), z9.string().regex(/^[0-9a-f]{64}$/)).optional()
867
+ });
859
868
  var ModelsLlmStartParams = z9.strictObject({
860
869
  model: TextModelId,
861
870
  /** Tokens of context, from the knob desktop.models/context_length. Omitted today means the service's fixed 4096 (optional until callers send it). */
@@ -877,7 +886,11 @@ var CatalogFile = z9.strictObject({
877
886
  /** The pinned https URL it is downloaded from. */
878
887
  url: z9.string().url().max(2048),
879
888
  size_bytes: nonNegInt,
880
- sha256: Sha256Hex,
889
+ /**
890
+ * The file's SHA-256; (1.58) null when its source publishes none (a small non-LFS file on Hugging
891
+ * Face): the first download hashes it and reports it in `models.llm.install`'s `hashed`.
892
+ */
893
+ sha256: Sha256Hex.nullable(),
881
894
  /** weights, weights_shard, mmproj, config, tokenizer, … (ai.model_artifact.role). */
882
895
  role: z9.string().max(32)
883
896
  });
@@ -2449,7 +2462,12 @@ var CodingSessionRecord = z28.strictObject({
2449
2462
  lastRunStatus: CodingRunStatus.nullable(),
2450
2463
  queued: z28.array(z28.string().max(1048576)).max(100),
2451
2464
  agent: CodingSessionAgent.nullable(),
2452
- agentRemovedDue: z28.boolean()
2465
+ agentRemovedDue: z28.boolean(),
2466
+ /**
2467
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
2468
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
2469
+ */
2470
+ accountId: z28.string().min(1).max(64).optional()
2453
2471
  });
2454
2472
  var CodingActiveElsewhere = z28.strictObject({
2455
2473
  reason: z28.enum(["process", "recent-write", "open-tool-call", "open"]),
@@ -2471,7 +2489,12 @@ var CodingDiscoveredChat = z28.strictObject({
2471
2489
  unavailable: ShortText.nullable(),
2472
2490
  updatedAt: IsoTime,
2473
2491
  source: z28.string().max(60).nullable(),
2474
- activeElsewhere: CodingActiveElsewhere.nullable()
2492
+ activeElsewhere: CodingActiveElsewhere.nullable(),
2493
+ /**
2494
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
2495
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
2496
+ */
2497
+ accountId: z28.string().min(1).max(64).optional()
2475
2498
  });
2476
2499
  var CodingTranscriptItem = z28.discriminatedUnion("kind", [
2477
2500
  z28.strictObject({ kind: z28.literal("user"), id: z28.string().max(200), text: z28.string(), at: IsoTime.nullable() }),
@@ -2511,6 +2534,31 @@ var CodingProviderProblem = z28.strictObject({
2511
2534
  until: z28.string().max(120).nullable(),
2512
2535
  at: IsoTime
2513
2536
  });
2537
+ var CodingAccountUsage = z28.strictObject({
2538
+ windows: z28.array(CodingQuotaWindow).max(20),
2539
+ /** The provider's own status word ("allowed", "allowed_warning", "rejected"...), when it gives one. */
2540
+ status: z28.string().max(60).nullable(),
2541
+ /** When a rejected status lifts (ISO), when the provider says. */
2542
+ resetsAt: z28.string().max(80).nullable(),
2543
+ at: IsoTime
2544
+ });
2545
+ var CodingContinueTarget = z28.strictObject({
2546
+ accountId: z28.string().min(1).max(64).nullable(),
2547
+ label: z28.string().max(200)
2548
+ });
2549
+ var CodingProviderAccount = z28.strictObject({
2550
+ id: z28.string().min(1).max(64),
2551
+ label: z28.string().max(200),
2552
+ /** (1.57) No known usage limit or expired sign-in on this account. Absent: not read. */
2553
+ ready: z28.boolean().optional(),
2554
+ lastProblem: CodingProviderProblem.optional(),
2555
+ problem: ShortText.optional(),
2556
+ fix: ShortText.optional(),
2557
+ /** (1.57) Absent: never seen ("No usage data yet"). */
2558
+ usage: CodingAccountUsage.optional(),
2559
+ /** (1.57) This account is limited and that other one is not: "Continue on <label>". */
2560
+ continueOn: CodingContinueTarget.optional()
2561
+ });
2514
2562
  var CodingProviderBinary = z28.strictObject({
2515
2563
  path: LocalPath,
2516
2564
  version: z28.string().max(80).nullable(),
@@ -2547,9 +2595,13 @@ var CodingProviderStatus = z28.strictObject({
2547
2595
  * can use, as the computer's engine lists them; New session offers them beside the default sign-in.
2548
2596
  * Absent: only the default sign-in (or a computer older than 1.53).
2549
2597
  */
2550
- accounts: z28.array(z28.strictObject({ id: z28.string().min(1).max(64), label: z28.string().max(200) })).max(100).optional(),
2598
+ accounts: z28.array(CodingProviderAccount).max(100).optional(),
2551
2599
  /** (1.53) The computer tried to list `accounts` and could not: a short sentence the form shows with a retry. */
2552
- accountsProblem: ShortText.optional()
2600
+ accountsProblem: ShortText.optional(),
2601
+ /** (1.57) The default sign-in's usage as last seen. Absent: never seen ("No usage data yet"). */
2602
+ usage: CodingAccountUsage.optional(),
2603
+ /** (1.57) The default sign-in is limited and this other account is not: "Continue on <label>". */
2604
+ continueOn: CodingContinueTarget.optional()
2553
2605
  });
2554
2606
  var CodingChatPreference = z28.strictObject({
2555
2607
  title: z28.string().max(500).nullable(),
@@ -2576,7 +2628,12 @@ var CodingRecentRow = z28.strictObject({
2576
2628
  state: z28.enum(["running", "needs_attention", "new_output", "elsewhere", "idle"]),
2577
2629
  stateLabel: z28.string().max(120).nullable(),
2578
2630
  pinned: z28.boolean(),
2579
- startedBy: CodingStartedBy.nullable()
2631
+ startedBy: CodingStartedBy.nullable(),
2632
+ /**
2633
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
2634
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
2635
+ */
2636
+ accountId: z28.string().min(1).max(64).optional()
2580
2637
  });
2581
2638
  var CodingFolderCheck = z28.strictObject({
2582
2639
  path: z28.string().max(4096),
@@ -2709,19 +2766,23 @@ var CodingSearchParams = z28.strictObject({
2709
2766
  cursor: nonNegInt.optional(),
2710
2767
  limit: z28.int().min(1).max(100).optional()
2711
2768
  });
2769
+ var CodingSearchHit = z28.strictObject({
2770
+ provider: CodingProviderName,
2771
+ providerSessionId: SessionKey,
2772
+ title: z28.string().max(500),
2773
+ cwd: LocalPath.nullable(),
2774
+ updatedAt: IsoTime,
2775
+ where: z28.enum(["title", "content"]),
2776
+ snippet: z28.string().max(2e3).nullable(),
2777
+ /**
2778
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
2779
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
2780
+ */
2781
+ accountId: z28.string().min(1).max(64).optional()
2782
+ });
2712
2783
  var CodingSearchResult = z28.strictObject({
2713
2784
  query: z28.string().max(500),
2714
- hits: z28.array(
2715
- z28.strictObject({
2716
- provider: CodingProviderName,
2717
- providerSessionId: SessionKey,
2718
- title: z28.string().max(500),
2719
- cwd: LocalPath.nullable(),
2720
- updatedAt: IsoTime,
2721
- where: z28.enum(["title", "content"]),
2722
- snippet: z28.string().max(2e3).nullable()
2723
- })
2724
- ),
2785
+ hits: z28.array(CodingSearchHit),
2725
2786
  scanned: nonNegInt,
2726
2787
  total: nonNegInt,
2727
2788
  nextCursor: nonNegInt.nullable()
@@ -4684,7 +4745,18 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
4684
4745
  ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]],
4685
4746
  ["apps.windows.list", [["windows", "AppWindowInfo"]]],
4686
4747
  ["apps.windows.set_remote_control", [["remote_control", "WindowRemoteControl"]]],
4687
- ["coding.providers", [["providers", "CodingProviderStatus"]]]
4748
+ ["coding.providers", [["providers", "CodingProviderStatus"]]],
4749
+ // 1.57: the account a coding record belongs to.
4750
+ ["coding.sessions.list", [["sessions", "CodingSessionRecord"], ["recent", "CodingRecentRow"]]],
4751
+ ["coding.recent.seen", [["recent", "CodingRecentRow"]]],
4752
+ ["coding.discover", [["chats", "CodingDiscoveredChat"]]],
4753
+ ["coding.search", [["hits", "CodingSearchHit"]]],
4754
+ ["coding.start", [["session", "CodingSessionRecord"]]],
4755
+ ["coding.send", [["session", "CodingSessionRecord"]]],
4756
+ ["coding.takeover", [["session", "CodingSessionRecord"]]],
4757
+ ["coding.options.set", [["session", "CodingSessionRecord"]]],
4758
+ ["coding.agent.set", [["session", "CodingSessionRecord"]]],
4759
+ ["coding.account.continue", [["session", "CodingSessionRecord"]]]
4688
4760
  ]);
4689
4761
  var WINDOW_RESULTS = /* @__PURE__ */ new Map([
4690
4762
  ["window.list", "windows"],