@ai-matrx/desktop-protocol 0.21.49 → 0.21.51

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,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.51
4
+ ### Unreleased
5
+ ### Protocol 1.56 — Continue on another account, from anywhere
6
+
7
+ - New op `coding.account.continue` ({session_id, account_profile_id?, client_request_id}) →
8
+ {session, run, how: "moved" | "fresh"}: the session moves to another of the person's accounts for
9
+ its app (absent `account_profile_id`: the default sign-in) and the turn a limit or the person
10
+ stopped is sent again there, exactly once per request id. In `coding_sessions_drive`.
11
+ Consumer action: a 1.55 core answers UNKNOWN_OPERATION; say that computer needs an update.
12
+
13
+ ### Protocol 1.55 — copy chats to another account with their organisation
14
+
15
+ - New op `apps.chats.copy_to_account` ({origin, target, chat_ids, mode, restart, mirror_groups,
16
+ pins_follow, source_group}): one engine pass; each chat lands in the target group named as its
17
+ origin group (made when missing), pins follow, a copy groups them in the origin as `source_group`,
18
+ and every chat is read back (`state` verified | queued | failed, with `reason`). `restart:
19
+ "restart_verify"` closes both windows, applies, verifies and reopens them; a window with chats
20
+ running falls back to queued and says why (`restart.reason`).
21
+ Consumer action: call it once for the whole selection; a 1.54 core answers UNKNOWN_OPERATION.
22
+
3
23
  ## 0.21.49
4
24
  ### Unreleased
5
25
  ### Protocol 1.54 — a default model can come from the account
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 = 54;
147
+ var PROTOCOL_MINOR = 56;
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_-]+$/);
@@ -2703,6 +2703,16 @@ var CodingOptionsSetParams = import_zod28.z.strictObject({
2703
2703
  effort: import_zod28.z.string().max(40).optional()
2704
2704
  });
2705
2705
  var CodingOptionsSetResult = import_zod28.z.strictObject({ session: CodingSessionRecord });
2706
+ var CodingAccountContinueParams = import_zod28.z.strictObject({
2707
+ session_id: SessionKey,
2708
+ account_profile_id: import_zod28.z.string().min(1).max(64).optional(),
2709
+ client_request_id: CodingClientRequestId
2710
+ });
2711
+ var CodingAccountContinueResult = import_zod28.z.strictObject({
2712
+ session: CodingSessionRecord,
2713
+ run: CodingRunRecord.nullable(),
2714
+ how: import_zod28.z.enum(["moved", "fresh"])
2715
+ });
2706
2716
  var CodingAgentSetParams = import_zod28.z.strictObject({ session_id: SessionKey, agent: CodingAgentSelectionParams.optional() });
2707
2717
  var CodingAgentSetResult = import_zod28.z.strictObject({ session: CodingSessionRecord });
2708
2718
  var CodingAgentsAccessParams = import_zod28.z.strictObject({});
@@ -3453,6 +3463,50 @@ var AppsWindowsUpdateAndReopenResult = import_zod31.z.strictObject({
3453
3463
  /** The version installed, null when the install did not happen (or dry_run). */
3454
3464
  installed_version: import_zod31.z.string().max(64).nullable()
3455
3465
  });
3466
+ var AppsChatsCopyToAccountParams = import_zod31.z.strictObject({
3467
+ app_key: AppKey,
3468
+ origin: ChatPlace,
3469
+ target: ChatPlace,
3470
+ chat_ids: import_zod31.z.array(ChatId).min(1).max(500),
3471
+ mode: import_zod31.z.enum(["copy", "move"]).default("copy"),
3472
+ restart: import_zod31.z.enum(["queued", "restart_verify"]).default("queued"),
3473
+ /** Put each chat in the target group named as its origin group (default true). */
3474
+ mirror_groups: import_zod31.z.boolean().default(true),
3475
+ /** Pin in the target the chats pinned in the origin (default true). */
3476
+ pins_follow: import_zod31.z.boolean().default(true),
3477
+ /** A copy: group them in the origin under this name ("Copied to <target>"). */
3478
+ source_group: import_zod31.z.string().trim().min(1).max(200).optional()
3479
+ });
3480
+ var CopiedChat = import_zod31.z.strictObject({
3481
+ chat_id: ChatId,
3482
+ title: import_zod31.z.string().max(500),
3483
+ outcome: import_zod31.z.enum(["copied", "moved", "already", "skipped"]),
3484
+ /** The target group it was put in (its origin group's name), or null. */
3485
+ group: import_zod31.z.string().max(200).nullable(),
3486
+ group_state: import_zod31.z.enum(["now", "next_close", "failed"]).nullable(),
3487
+ pinned: import_zod31.z.boolean(),
3488
+ pin_state: import_zod31.z.enum(["now", "next_close", "failed"]).nullable(),
3489
+ /** The read-back: verified, waiting for a window to close (queued), or failed. */
3490
+ state: import_zod31.z.enum(["verified", "queued", "failed"]),
3491
+ reason: import_zod31.z.string().max(400).nullable()
3492
+ });
3493
+ var AppsChatsCopyToAccountResult = import_zod31.z.strictObject({
3494
+ message: import_zod31.z.string().max(400),
3495
+ origin: ChatPlace,
3496
+ target: ChatPlace,
3497
+ mode: import_zod31.z.enum(["copy", "move"]),
3498
+ /** The marker the chats are filed under ("From <origin>"), for Bring back. */
3499
+ project: import_zod31.z.strictObject({ id: ChatProjectId, name: import_zod31.z.string().max(200) }),
3500
+ /** The target groups used, by name: made or reused, now or at the next close. */
3501
+ groups: import_zod31.z.array(import_zod31.z.strictObject({ name: import_zod31.z.string().max(200), chats: import_zod31.z.number().int().nonnegative(), ok: import_zod31.z.boolean(), when: import_zod31.z.enum(["now", "next_close"]).nullable(), reason: import_zod31.z.string().max(400).nullable() })).max(500),
3502
+ source_group: import_zod31.z.strictObject({ name: import_zod31.z.string().max(200), ok: import_zod31.z.boolean(), when: import_zod31.z.enum(["now", "next_close"]).nullable(), reason: import_zod31.z.string().max(400).nullable() }).nullable(),
3503
+ chats: import_zod31.z.array(CopiedChat).max(500),
3504
+ verified: import_zod31.z.number().int().nonnegative(),
3505
+ queued: import_zod31.z.number().int().nonnegative(),
3506
+ failed: import_zod31.z.number().int().nonnegative(),
3507
+ /** What the restart choice did: "restart_verify" closed and reopened `windows`; a fall back to "queued" says why. */
3508
+ restart: import_zod31.z.strictObject({ asked: import_zod31.z.enum(["queued", "restart_verify"]), done: import_zod31.z.enum(["queued", "restart_verify"]), windows: import_zod31.z.array(ChatPlace).max(2), reason: import_zod31.z.string().max(400).nullable() })
3509
+ });
3456
3510
 
3457
3511
  // src/schema/apps-instances.ts
3458
3512
  var import_zod32 = require("zod");
@@ -3539,6 +3593,12 @@ var AppsAccountsListResult = import_zod32.z.strictObject({
3539
3593
  as_of_ms: epochMs.optional(),
3540
3594
  refreshing: import_zod32.z.boolean().optional()
3541
3595
  });
3596
+ var AppsWindowsSetAccountParams = import_zod32.z.strictObject({ app_key: AppKey, window: ChatPlace, email: import_zod32.z.string().min(3).max(320) });
3597
+ var AppsWindowsForgetParams = import_zod32.z.strictObject({ app_key: AppKey, window: ChatPlace });
3598
+ var ProbeFact = import_zod32.z.strictObject({ key: import_zod32.z.string().max(200), value: import_zod32.z.string().max(2e3) });
3599
+ var ProbeSource = import_zod32.z.strictObject({ source: import_zod32.z.string().max(120), instance: import_zod32.z.string().max(64).nullable(), facts: import_zod32.z.array(ProbeFact).max(500) });
3600
+ var AppsChatsProbeParams = import_zod32.z.strictObject({ app_key: AppKey, chat_id: import_zod32.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/) });
3601
+ var AppsChatsProbeResult = import_zod32.z.strictObject({ app_key: AppKey, chat_id: import_zod32.z.string().max(128), sources: import_zod32.z.array(ProbeSource).max(200) });
3542
3602
 
3543
3603
  // src/schema/browser.ts
3544
3604
  var import_zod33 = require("zod");
@@ -4385,9 +4445,15 @@ var OPS = {
4385
4445
  // 1.47: instances and accounts kept apart — an account's usage is the account's, every instance shows it by id.
4386
4446
  "apps.instances.list": { params: AppsInstancesListParams, result: AppsInstancesListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4387
4447
  "apps.accounts.list": { params: AppsAccountsListParams, result: AppsAccountsListResult, kind: "unary", since: "1.47", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4448
+ // 1.56: an instance's kept-for account and forgetting it (the app's own tool writes both); every raw fact about one chat.
4449
+ "apps.windows.set_account": { params: AppsWindowsSetAccountParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4450
+ "apps.windows.forget": { params: AppsWindowsForgetParams, result: AppsWindowActionResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4451
+ "apps.chats.probe": { params: AppsChatsProbeParams, result: AppsChatsProbeResult, kind: "unary", since: "1.56", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4388
4452
  "apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4389
4453
  "apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4390
4454
  "apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4455
+ // 1.55: copy (or move) chats to another account with their groups and pins, in one engine pass, read back.
4456
+ "apps.chats.copy_to_account": { params: AppsChatsCopyToAccountParams, result: AppsChatsCopyToAccountResult, kind: "unary", since: "1.55", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4391
4457
  "apps.projects.to_window": { params: AppsProjectsToWindowParams, result: AppsProjectsToWindowResult, kind: "unary", since: "1.19", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4392
4458
  // 1.11: Going cold, Spend, sync health, windows upkeep.
4393
4459
  "apps.chats.cold": { params: AppsChatsColdParams, result: AppsChatsColdResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -4473,6 +4539,8 @@ var OPS = {
4473
4539
  "coding.stop": { params: CodingStopParams, result: CodingStopResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "INTERNAL"] },
4474
4540
  "coding.stop_elsewhere": { params: CodingStopElsewhereParams, result: CodingStopElsewhereResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "INTERNAL"] },
4475
4541
  "coding.options.set": { params: CodingOptionsSetParams, result: CodingOptionsSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "INTERNAL"] },
4542
+ // 1.56: "Continue on <account>" — the session moves to another account and its stopped turn is sent again, exactly once.
4543
+ "coding.account.continue": { params: CodingAccountContinueParams, result: CodingAccountContinueResult, kind: "unary", since: "1.56", errors: ["INVALID_PARAMS", "NOT_FOUND", "RESOURCE_BUSY", "AUTH_FORBIDDEN", "INTERNAL"] },
4476
4544
  "coding.agent.set": { params: CodingAgentSetParams, result: CodingAgentSetResult, kind: "unary", since: "1.38", errors: ["INVALID_PARAMS", "NOT_FOUND", "AUTH_FORBIDDEN", "INTERNAL"] },
4477
4545
  "coding.agents.access": { params: CodingAgentsAccessParams, result: CodingAgentsAccessResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },
4478
4546
  "coding.titles.status": { params: CodingTitlesStatusParams, result: CodingTitlesStatusResult, kind: "unary", since: "1.38", errors: ["INTERNAL"] },