@ai-matrx/desktop-protocol 0.21.50 → 0.21.52

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/index.cjs CHANGED
@@ -73,6 +73,8 @@ __export(src_exports, {
73
73
  AppsChatsOpenParams: () => AppsChatsOpenParams,
74
74
  AppsChatsPlaceParams: () => AppsChatsPlaceParams,
75
75
  AppsChatsPlaceResult: () => AppsChatsPlaceResult,
76
+ AppsChatsProbeParams: () => AppsChatsProbeParams,
77
+ AppsChatsProbeResult: () => AppsChatsProbeResult,
76
78
  AppsChatsStarParams: () => AppsChatsStarParams,
77
79
  AppsChatsStarResult: () => AppsChatsStarResult,
78
80
  AppsChatsTitlesCheckParams: () => AppsChatsTitlesCheckParams,
@@ -119,6 +121,7 @@ __export(src_exports, {
119
121
  AppsSyncStatusResult: () => AppsSyncStatusResult,
120
122
  AppsWindowActionResult: () => AppsWindowActionResult,
121
123
  AppsWindowsAddParams: () => AppsWindowsAddParams,
124
+ AppsWindowsForgetParams: () => AppsWindowsForgetParams,
122
125
  AppsWindowsGroupsParams: () => AppsWindowsGroupsParams,
123
126
  AppsWindowsGroupsResult: () => AppsWindowsGroupsResult,
124
127
  AppsWindowsListParams: () => AppsWindowsListParams,
@@ -132,6 +135,7 @@ __export(src_exports, {
132
135
  AppsWindowsReopenResult: () => AppsWindowsReopenResult,
133
136
  AppsWindowsRestartParams: () => AppsWindowsRestartParams,
134
137
  AppsWindowsSaveNamesParams: () => AppsWindowsSaveNamesParams,
138
+ AppsWindowsSetAccountParams: () => AppsWindowsSetAccountParams,
135
139
  AppsWindowsSetRemoteControlParams: () => AppsWindowsSetRemoteControlParams,
136
140
  AppsWindowsSetRemoteControlResult: () => AppsWindowsSetRemoteControlResult,
137
141
  AppsWindowsShownParams: () => AppsWindowsShownParams,
@@ -220,6 +224,9 @@ __export(src_exports, {
220
224
  ClipboardWriteResult: () => ClipboardWriteResult,
221
225
  CloseCode: () => CloseCode,
222
226
  CloseCodeValue: () => CloseCodeValue,
227
+ CodingAccountContinueParams: () => CodingAccountContinueParams,
228
+ CodingAccountContinueResult: () => CodingAccountContinueResult,
229
+ CodingAccountUsage: () => CodingAccountUsage,
223
230
  CodingActiveElsewhere: () => CodingActiveElsewhere,
224
231
  CodingActivityParams: () => CodingActivityParams,
225
232
  CodingActivityResult: () => CodingActivityResult,
@@ -231,6 +238,7 @@ __export(src_exports, {
231
238
  CodingChangedEvent: () => CodingChangedEvent,
232
239
  CodingChatPreference: () => CodingChatPreference,
233
240
  CodingClientRequestId: () => CodingClientRequestId,
241
+ CodingContinueTarget: () => CodingContinueTarget,
234
242
  CodingDiscoverParams: () => CodingDiscoverParams,
235
243
  CodingDiscoverResult: () => CodingDiscoverResult,
236
244
  CodingDiscoveredChat: () => CodingDiscoveredChat,
@@ -263,6 +271,7 @@ __export(src_exports, {
263
271
  CodingPrefsListResult: () => CodingPrefsListResult,
264
272
  CodingPrefsSetParams: () => CodingPrefsSetParams,
265
273
  CodingPrefsSetResult: () => CodingPrefsSetResult,
274
+ CodingProviderAccount: () => CodingProviderAccount,
266
275
  CodingProviderBinary: () => CodingProviderBinary,
267
276
  CodingProviderName: () => CodingProviderName,
268
277
  CodingProviderProblem: () => CodingProviderProblem,
@@ -281,6 +290,7 @@ __export(src_exports, {
281
290
  CodingRunUsage: () => CodingRunUsage,
282
291
  CodingRunsListParams: () => CodingRunsListParams,
283
292
  CodingRunsListResult: () => CodingRunsListResult,
293
+ CodingSearchHit: () => CodingSearchHit,
284
294
  CodingSearchParams: () => CodingSearchParams,
285
295
  CodingSearchResult: () => CodingSearchResult,
286
296
  CodingSendParams: () => CodingSendParams,
@@ -608,6 +618,8 @@ __export(src_exports, {
608
618
  PowerPreventSleepResult: () => PowerPreventSleepResult,
609
619
  PowerStatusParams: () => PowerStatusParams,
610
620
  PowerStatusResult: () => PowerStatusResult,
621
+ ProbeFact: () => ProbeFact,
622
+ ProbeSource: () => ProbeSource,
611
623
  ProcInfo: () => ProcInfo,
612
624
  ProcKillParams: () => ProcKillParams,
613
625
  ProcKillResult: () => ProcKillResult,
@@ -889,7 +901,7 @@ module.exports = __toCommonJS(src_exports);
889
901
  var import_zod = require("zod");
890
902
  var import_uuid = require("@ai-matrx/kit/uuid");
891
903
  var PROTOCOL_MAJOR = 1;
892
- var PROTOCOL_MINOR = 55;
904
+ var PROTOCOL_MINOR = 57;
893
905
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
894
906
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
895
907
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -2835,6 +2847,12 @@ var AppsAccountsListResult = import_zod15.z.strictObject({
2835
2847
  as_of_ms: epochMs.optional(),
2836
2848
  refreshing: import_zod15.z.boolean().optional()
2837
2849
  });
2850
+ var AppsWindowsSetAccountParams = import_zod15.z.strictObject({ app_key: AppKey, window: ChatPlace, email: import_zod15.z.string().min(3).max(320) });
2851
+ var AppsWindowsForgetParams = import_zod15.z.strictObject({ app_key: AppKey, window: ChatPlace });
2852
+ var ProbeFact = import_zod15.z.strictObject({ key: import_zod15.z.string().max(200), value: import_zod15.z.string().max(2e3) });
2853
+ var ProbeSource = import_zod15.z.strictObject({ source: import_zod15.z.string().max(120), instance: import_zod15.z.string().max(64).nullable(), facts: import_zod15.z.array(ProbeFact).max(500) });
2854
+ var AppsChatsProbeParams = import_zod15.z.strictObject({ app_key: AppKey, chat_id: import_zod15.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/) });
2855
+ var AppsChatsProbeResult = import_zod15.z.strictObject({ app_key: AppKey, chat_id: import_zod15.z.string().max(128), sources: import_zod15.z.array(ProbeSource).max(200) });
2838
2856
 
2839
2857
  // src/schema/service.ts
2840
2858
  var import_zod16 = require("zod");
@@ -4212,7 +4230,12 @@ var CodingSessionRecord = import_zod34.z.strictObject({
4212
4230
  lastRunStatus: CodingRunStatus.nullable(),
4213
4231
  queued: import_zod34.z.array(import_zod34.z.string().max(1048576)).max(100),
4214
4232
  agent: CodingSessionAgent.nullable(),
4215
- agentRemovedDue: import_zod34.z.boolean()
4233
+ agentRemovedDue: import_zod34.z.boolean(),
4234
+ /**
4235
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
4236
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
4237
+ */
4238
+ accountId: import_zod34.z.string().min(1).max(64).optional()
4216
4239
  });
4217
4240
  var CodingActiveElsewhere = import_zod34.z.strictObject({
4218
4241
  reason: import_zod34.z.enum(["process", "recent-write", "open-tool-call", "open"]),
@@ -4234,7 +4257,12 @@ var CodingDiscoveredChat = import_zod34.z.strictObject({
4234
4257
  unavailable: ShortText.nullable(),
4235
4258
  updatedAt: IsoTime,
4236
4259
  source: import_zod34.z.string().max(60).nullable(),
4237
- activeElsewhere: CodingActiveElsewhere.nullable()
4260
+ activeElsewhere: CodingActiveElsewhere.nullable(),
4261
+ /**
4262
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
4263
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
4264
+ */
4265
+ accountId: import_zod34.z.string().min(1).max(64).optional()
4238
4266
  });
4239
4267
  var CodingTranscriptItem = import_zod34.z.discriminatedUnion("kind", [
4240
4268
  import_zod34.z.strictObject({ kind: import_zod34.z.literal("user"), id: import_zod34.z.string().max(200), text: import_zod34.z.string(), at: IsoTime.nullable() }),
@@ -4274,6 +4302,31 @@ var CodingProviderProblem = import_zod34.z.strictObject({
4274
4302
  until: import_zod34.z.string().max(120).nullable(),
4275
4303
  at: IsoTime
4276
4304
  });
4305
+ var CodingAccountUsage = import_zod34.z.strictObject({
4306
+ windows: import_zod34.z.array(CodingQuotaWindow).max(20),
4307
+ /** The provider's own status word ("allowed", "allowed_warning", "rejected"...), when it gives one. */
4308
+ status: import_zod34.z.string().max(60).nullable(),
4309
+ /** When a rejected status lifts (ISO), when the provider says. */
4310
+ resetsAt: import_zod34.z.string().max(80).nullable(),
4311
+ at: IsoTime
4312
+ });
4313
+ var CodingContinueTarget = import_zod34.z.strictObject({
4314
+ accountId: import_zod34.z.string().min(1).max(64).nullable(),
4315
+ label: import_zod34.z.string().max(200)
4316
+ });
4317
+ var CodingProviderAccount = import_zod34.z.strictObject({
4318
+ id: import_zod34.z.string().min(1).max(64),
4319
+ label: import_zod34.z.string().max(200),
4320
+ /** (1.57) No known usage limit or expired sign-in on this account. Absent: not read. */
4321
+ ready: import_zod34.z.boolean().optional(),
4322
+ lastProblem: CodingProviderProblem.optional(),
4323
+ problem: ShortText.optional(),
4324
+ fix: ShortText.optional(),
4325
+ /** (1.57) Absent: never seen ("No usage data yet"). */
4326
+ usage: CodingAccountUsage.optional(),
4327
+ /** (1.57) This account is limited and that other one is not: "Continue on <label>". */
4328
+ continueOn: CodingContinueTarget.optional()
4329
+ });
4277
4330
  var CodingProviderBinary = import_zod34.z.strictObject({
4278
4331
  path: LocalPath,
4279
4332
  version: import_zod34.z.string().max(80).nullable(),
@@ -4310,9 +4363,13 @@ var CodingProviderStatus = import_zod34.z.strictObject({
4310
4363
  * can use, as the computer's engine lists them; New session offers them beside the default sign-in.
4311
4364
  * Absent: only the default sign-in (or a computer older than 1.53).
4312
4365
  */
4313
- accounts: import_zod34.z.array(import_zod34.z.strictObject({ id: import_zod34.z.string().min(1).max(64), label: import_zod34.z.string().max(200) })).max(100).optional(),
4366
+ accounts: import_zod34.z.array(CodingProviderAccount).max(100).optional(),
4314
4367
  /** (1.53) The computer tried to list `accounts` and could not: a short sentence the form shows with a retry. */
4315
- accountsProblem: ShortText.optional()
4368
+ accountsProblem: ShortText.optional(),
4369
+ /** (1.57) The default sign-in's usage as last seen. Absent: never seen ("No usage data yet"). */
4370
+ usage: CodingAccountUsage.optional(),
4371
+ /** (1.57) The default sign-in is limited and this other account is not: "Continue on <label>". */
4372
+ continueOn: CodingContinueTarget.optional()
4316
4373
  });
4317
4374
  var CodingChatPreference = import_zod34.z.strictObject({
4318
4375
  title: import_zod34.z.string().max(500).nullable(),
@@ -4339,7 +4396,12 @@ var CodingRecentRow = import_zod34.z.strictObject({
4339
4396
  state: import_zod34.z.enum(["running", "needs_attention", "new_output", "elsewhere", "idle"]),
4340
4397
  stateLabel: import_zod34.z.string().max(120).nullable(),
4341
4398
  pinned: import_zod34.z.boolean(),
4342
- startedBy: CodingStartedBy.nullable()
4399
+ startedBy: CodingStartedBy.nullable(),
4400
+ /**
4401
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
4402
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
4403
+ */
4404
+ accountId: import_zod34.z.string().min(1).max(64).optional()
4343
4405
  });
4344
4406
  var CodingFolderCheck = import_zod34.z.strictObject({
4345
4407
  path: import_zod34.z.string().max(4096),
@@ -4434,6 +4496,16 @@ var CodingOptionsSetParams = import_zod34.z.strictObject({
4434
4496
  effort: import_zod34.z.string().max(40).optional()
4435
4497
  });
4436
4498
  var CodingOptionsSetResult = import_zod34.z.strictObject({ session: CodingSessionRecord });
4499
+ var CodingAccountContinueParams = import_zod34.z.strictObject({
4500
+ session_id: SessionKey,
4501
+ account_profile_id: import_zod34.z.string().min(1).max(64).optional(),
4502
+ client_request_id: CodingClientRequestId
4503
+ });
4504
+ var CodingAccountContinueResult = import_zod34.z.strictObject({
4505
+ session: CodingSessionRecord,
4506
+ run: CodingRunRecord.nullable(),
4507
+ how: import_zod34.z.enum(["moved", "fresh"])
4508
+ });
4437
4509
  var CodingAgentSetParams = import_zod34.z.strictObject({ session_id: SessionKey, agent: CodingAgentSelectionParams.optional() });
4438
4510
  var CodingAgentSetResult = import_zod34.z.strictObject({ session: CodingSessionRecord });
4439
4511
  var CodingAgentsAccessParams = import_zod34.z.strictObject({});
@@ -4462,19 +4534,23 @@ var CodingSearchParams = import_zod34.z.strictObject({
4462
4534
  cursor: nonNegInt.optional(),
4463
4535
  limit: import_zod34.z.int().min(1).max(100).optional()
4464
4536
  });
4537
+ var CodingSearchHit = import_zod34.z.strictObject({
4538
+ provider: CodingProviderName,
4539
+ providerSessionId: SessionKey,
4540
+ title: import_zod34.z.string().max(500),
4541
+ cwd: LocalPath.nullable(),
4542
+ updatedAt: IsoTime,
4543
+ where: import_zod34.z.enum(["title", "content"]),
4544
+ snippet: import_zod34.z.string().max(2e3).nullable(),
4545
+ /**
4546
+ * (1.57) Claude Code: the account the record belongs to (Accounts' profile id): the one a session
4547
+ * runs as, or whose config directory holds the chat. Absent: the default sign-in.
4548
+ */
4549
+ accountId: import_zod34.z.string().min(1).max(64).optional()
4550
+ });
4465
4551
  var CodingSearchResult = import_zod34.z.strictObject({
4466
4552
  query: import_zod34.z.string().max(500),
4467
- hits: import_zod34.z.array(
4468
- import_zod34.z.strictObject({
4469
- provider: CodingProviderName,
4470
- providerSessionId: SessionKey,
4471
- title: import_zod34.z.string().max(500),
4472
- cwd: LocalPath.nullable(),
4473
- updatedAt: IsoTime,
4474
- where: import_zod34.z.enum(["title", "content"]),
4475
- snippet: import_zod34.z.string().max(2e3).nullable()
4476
- })
4477
- ),
4553
+ hits: import_zod34.z.array(CodingSearchHit),
4478
4554
  scanned: nonNegInt,
4479
4555
  total: nonNegInt,
4480
4556
  nextCursor: nonNegInt.nullable()
@@ -5371,6 +5447,10 @@ var OPS = {
5371
5447
  // 1.47: instances and accounts kept apart — an account's usage is the account's, every instance shows it by id.
5372
5448
  "apps.instances.list": { params: AppsInstancesListParams, result: AppsInstancesListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5373
5449
  "apps.accounts.list": { params: AppsAccountsListParams, result: AppsAccountsListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5450
+ // 1.56: an instance's kept-for account and forgetting it (the app's own tool writes both); every raw fact about one chat.
5451
+ "apps.windows.set_account": { params: AppsWindowsSetAccountParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5452
+ "apps.windows.forget": { params: AppsWindowsForgetParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5453
+ "apps.chats.probe": { params: AppsChatsProbeParams, result: AppsChatsProbeResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5374
5454
  "apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5375
5455
  "apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5376
5456
  "apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -5461,6 +5541,8 @@ var OPS = {
5461
5541
  "coding.stop": { params: CodingStopParams, result: CodingStopResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "INTERNAL"] },
5462
5542
  "coding.stop_elsewhere": { params: CodingStopElsewhereParams, result: CodingStopElsewhereResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "INTERNAL"] },
5463
5543
  "coding.options.set": { params: CodingOptionsSetParams, result: CodingOptionsSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
5544
+ // 1.56: "Continue on <account>" — the session moves to another account and its stopped turn is sent again, exactly once.
5545
+ "coding.account.continue": { params: CodingAccountContinueParams, result: CodingAccountContinueResult, kind: "unary", since: "1.56", errors: ["INVALID_PARAMS", "NOT_FOUND", "RESOURCE_BUSY", "AUTH_FORBIDDEN", "INTERNAL"] },
5464
5546
  "coding.agent.set": { params: CodingAgentSetParams, result: CodingAgentSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "AUTH_FORBIDDEN", "INTERNAL"] },
5465
5547
  "coding.agents.access": { params: CodingAgentsAccessParams, result: CodingAgentsAccessResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
5466
5548
  "coding.titles.status": { params: CodingTitlesStatusParams, result: CodingTitlesStatusResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
@@ -5634,6 +5716,12 @@ var SERVICES = {
5634
5716
  }
5635
5717
  };
5636
5718
  var NAMED_SCHEMAS = {
5719
+ AppsWindowsSetAccountParams,
5720
+ AppsWindowsForgetParams,
5721
+ ProbeFact,
5722
+ ProbeSource,
5723
+ AppsChatsProbeParams,
5724
+ AppsChatsProbeResult,
5637
5725
  InstanceStatus,
5638
5726
  AppInstall,
5639
5727
  AppInstance,
@@ -5812,6 +5900,9 @@ var NAMED_SCHEMAS = {
5812
5900
  CodingQuotaWindow,
5813
5901
  CodingProviderProblem,
5814
5902
  CodingProviderBinary,
5903
+ CodingAccountUsage,
5904
+ CodingContinueTarget,
5905
+ CodingProviderAccount,
5815
5906
  CodingProviderStatus,
5816
5907
  CodingChatPreference,
5817
5908
  CodingTitleStatus,
@@ -5853,6 +5944,8 @@ var NAMED_SCHEMAS = {
5853
5944
  CodingStopElsewhereResult,
5854
5945
  CodingOptionsSetParams,
5855
5946
  CodingOptionsSetResult,
5947
+ CodingAccountContinueParams,
5948
+ CodingAccountContinueResult,
5856
5949
  CodingAgentSetParams,
5857
5950
  CodingAgentSetResult,
5858
5951
  CodingAgentsAccessParams,
@@ -5866,6 +5959,7 @@ var NAMED_SCHEMAS = {
5866
5959
  CodingRecentSeenParams,
5867
5960
  CodingRecentSeenResult,
5868
5961
  CodingSearchParams,
5962
+ CodingSearchHit,
5869
5963
  CodingSearchResult,
5870
5964
  CodingReconcileParams,
5871
5965
  CodingReconcileResult,
@@ -6431,7 +6525,12 @@ var FIELDS_SINCE = {
6431
6525
  WindowInfo: { app: "1.7", pid: "1.7" },
6432
6526
  AppWindowInfo: { remote_control: "1.50" },
6433
6527
  WindowRemoteControl: { problem: "1.52" },
6434
- CodingProviderStatus: { accounts: "1.53", accountsProblem: "1.53" },
6528
+ CodingProviderStatus: { accounts: "1.53", accountsProblem: "1.53", usage: "1.57", continueOn: "1.57" },
6529
+ CodingProviderAccount: { ready: "1.57", lastProblem: "1.57", problem: "1.57", fix: "1.57", usage: "1.57", continueOn: "1.57" },
6530
+ CodingSessionRecord: { accountId: "1.57" },
6531
+ CodingDiscoveredChat: { accountId: "1.57" },
6532
+ CodingRecentRow: { accountId: "1.57" },
6533
+ CodingSearchHit: { accountId: "1.57" },
6435
6534
  AppsInstancesListParams: { fresh: "1.51" },
6436
6535
  AppsInstancesListResult: { as_of_ms: "1.51", refreshing: "1.51" },
6437
6536
  AppsAccountsListParams: { fresh: "1.51" },
@@ -6568,7 +6667,18 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
6568
6667
  ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]],
6569
6668
  ["apps.windows.list", [["windows", "AppWindowInfo"]]],
6570
6669
  ["apps.windows.set_remote_control", [["remote_control", "WindowRemoteControl"]]],
6571
- ["coding.providers", [["providers", "CodingProviderStatus"]]]
6670
+ ["coding.providers", [["providers", "CodingProviderStatus"]]],
6671
+ // 1.57: the account a coding record belongs to.
6672
+ ["coding.sessions.list", [["sessions", "CodingSessionRecord"], ["recent", "CodingRecentRow"]]],
6673
+ ["coding.recent.seen", [["recent", "CodingRecentRow"]]],
6674
+ ["coding.discover", [["chats", "CodingDiscoveredChat"]]],
6675
+ ["coding.search", [["hits", "CodingSearchHit"]]],
6676
+ ["coding.start", [["session", "CodingSessionRecord"]]],
6677
+ ["coding.send", [["session", "CodingSessionRecord"]]],
6678
+ ["coding.takeover", [["session", "CodingSessionRecord"]]],
6679
+ ["coding.options.set", [["session", "CodingSessionRecord"]]],
6680
+ ["coding.agent.set", [["session", "CodingSessionRecord"]]],
6681
+ ["coding.account.continue", [["session", "CodingSessionRecord"]]]
6572
6682
  ]);
6573
6683
  function stripNested(value, nested, version) {
6574
6684
  if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
@@ -6604,15 +6714,24 @@ function windowListRemoteControlForPeer(value, version) {
6604
6714
  });
6605
6715
  return next.some((w, i) => w !== windows[i]) ? { ...body, windows: next } : value;
6606
6716
  }
6607
- function providersDefaultSourceForPeer(value, version) {
6608
- if (knows(version, "1.54") || value === null || typeof value !== "object") return value;
6717
+ function providersForPeer(value, version) {
6718
+ if (knows(version, "1.57") || value === null || typeof value !== "object") return value;
6609
6719
  const body = value;
6610
6720
  if (!Array.isArray(body.providers)) return value;
6611
6721
  const providers = body.providers;
6612
6722
  const next = providers.map((p) => {
6613
- const dm = p?.defaultModel;
6614
- if (dm === null || typeof dm !== "object" || dm.source !== "account") return p;
6615
- return { ...p, defaultModel: { ...dm, source: "driver" } };
6723
+ if (p === null || typeof p !== "object") return p;
6724
+ let out = p;
6725
+ const dm = out.defaultModel;
6726
+ if (!knows(version, "1.54") && dm !== null && typeof dm === "object" && dm.source === "account") {
6727
+ out = { ...out, defaultModel: { ...dm, source: "driver" } };
6728
+ }
6729
+ const accounts = out.accounts;
6730
+ if (Array.isArray(accounts)) {
6731
+ const kept = accounts.map((a) => strip(a, FIELDS_SINCE.CodingProviderAccount, version));
6732
+ if (kept.some((a, i) => a !== accounts[i])) out = { ...out, accounts: kept };
6733
+ }
6734
+ return out;
6616
6735
  });
6617
6736
  return next.some((p, i) => p !== providers[i]) ? { ...body, providers: next } : value;
6618
6737
  }
@@ -6643,7 +6762,7 @@ function forPeer(op, part, value, version) {
6643
6762
  const top = path ? strip(known, FIELDS_SINCE[path], version) : known;
6644
6763
  const nested = op ? NESTED_RESULTS.get(op) : void 0;
6645
6764
  const stripped = nested ? stripNested(top, nested, version) : top;
6646
- if (op === "coding.providers") return providersDefaultSourceForPeer(stripped, version);
6765
+ if (op === "coding.providers") return providersForPeer(stripped, version);
6647
6766
  return op === "apps.windows.list" ? windowListRemoteControlForPeer(stripped, version) : stripped;
6648
6767
  }
6649
6768
  if (value === null || typeof value !== "object") return value;
@@ -6661,7 +6780,7 @@ function forPeer(op, part, value, version) {
6661
6780
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
6662
6781
 
6663
6782
  // src/contract.ts
6664
- var CONTRACT_SHA256 = "aeb1f5dd5ec4290d9ff8871fa39dd9be9605d25a40fec3c681f888c7f2a1954f";
6783
+ var CONTRACT_SHA256 = "ee1d6d3d83bb18a2ed020dbaf3c611b982699f9a9db8d728c38f2c6b8fbf0815";
6665
6784
 
6666
6785
  // src/close-policy.ts
6667
6786
  var CLOSE_RULES = {
@@ -6741,7 +6860,7 @@ var TOOL_CATALOG = [
6741
6860
  // 1.38, code from anywhere: the person's Claude Code and Codex sessions on this computer. Turning
6742
6861
  // either off in Agents › Tools refuses its ops on every relay connection (the existing switch).
6743
6862
  { name: "coding_sessions_read", group: "personal_automation", state: "built", path: "device_op", ops: ["coding.providers", "coding.sessions.list", "coding.discover", "coding.runs.list", "coding.history", "coding.transcript.read", "coding.item.full", "coding.activity", "coding.folders.recent", "coding.folders.check", "coding.agents.access", "coding.titles.status", "coding.prefs.list", "coding.recent.seen", "coding.search", "coding.transcript.raw", "coding.watch", "coding.session.watch"], platforms: ALL, summary: "Claude Code and Codex sessions: list, read live, search, download" },
6744
- { name: "coding_sessions_drive", group: "personal_automation", state: "built", path: "device_op", ops: ["coding.start", "coding.takeover", "coding.send", "coding.stop", "coding.stop_elsewhere", "coding.options.set", "coding.agent.set", "coding.folders.create", "coding.prefs.set", "coding.reconcile"], platforms: ALL, summary: "Claude Code and Codex sessions: start, send, stop, take over, rename" },
6863
+ { name: "coding_sessions_drive", group: "personal_automation", state: "built", path: "device_op", ops: ["coding.start", "coding.takeover", "coding.send", "coding.stop", "coding.stop_elsewhere", "coding.options.set", "coding.account.continue", "coding.agent.set", "coding.folders.create", "coding.prefs.set", "coding.reconcile"], platforms: ALL, summary: "Claude Code and Codex sessions: start, send, stop, take over, rename" },
6745
6864
  // ── 4. Documents, notes and entities (1.37: the core's `documents` and `notes` owners; desktop_web is the `tools` service) ──
6746
6865
  { name: "desktop_documents", group: "tools_service", state: "built", path: "device_op", ops: ["documents.pdf_text", "documents.ocr", "documents.image_resize", "documents.office_generate"], platforms: ALL, summary: "PDF text, OCR, images, Word and Excel files" },
6747
6866
  { name: "desktop_web", group: "tools_service", state: "built", path: "device_op", ops: ["web.fetch", "web.scrape", "web.search", "web.fetch_with_browser"], platforms: ALL, summary: "Fetch, scrape and search the web from this computer's own connection" },