@ai-matrx/desktop-protocol 0.21.49 → 0.21.50

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.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { z } from "zod";
3
3
  import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
4
4
  var PROTOCOL_MAJOR = 1;
5
- var PROTOCOL_MINOR = 54;
5
+ var PROTOCOL_MINOR = 55;
6
6
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
7
7
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
8
8
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -1818,6 +1818,50 @@ var AppsWindowsUpdateAndReopenResult = z14.strictObject({
1818
1818
  /** The version installed, null when the install did not happen (or dry_run). */
1819
1819
  installed_version: z14.string().max(64).nullable()
1820
1820
  });
1821
+ var AppsChatsCopyToAccountParams = z14.strictObject({
1822
+ app_key: AppKey,
1823
+ origin: ChatPlace,
1824
+ target: ChatPlace,
1825
+ chat_ids: z14.array(ChatId).min(1).max(500),
1826
+ mode: z14.enum(["copy", "move"]).default("copy"),
1827
+ restart: z14.enum(["queued", "restart_verify"]).default("queued"),
1828
+ /** Put each chat in the target group named as its origin group (default true). */
1829
+ mirror_groups: z14.boolean().default(true),
1830
+ /** Pin in the target the chats pinned in the origin (default true). */
1831
+ pins_follow: z14.boolean().default(true),
1832
+ /** A copy: group them in the origin under this name ("Copied to <target>"). */
1833
+ source_group: z14.string().trim().min(1).max(200).optional()
1834
+ });
1835
+ var CopiedChat = z14.strictObject({
1836
+ chat_id: ChatId,
1837
+ title: z14.string().max(500),
1838
+ outcome: z14.enum(["copied", "moved", "already", "skipped"]),
1839
+ /** The target group it was put in (its origin group's name), or null. */
1840
+ group: z14.string().max(200).nullable(),
1841
+ group_state: z14.enum(["now", "next_close", "failed"]).nullable(),
1842
+ pinned: z14.boolean(),
1843
+ pin_state: z14.enum(["now", "next_close", "failed"]).nullable(),
1844
+ /** The read-back: verified, waiting for a window to close (queued), or failed. */
1845
+ state: z14.enum(["verified", "queued", "failed"]),
1846
+ reason: z14.string().max(400).nullable()
1847
+ });
1848
+ var AppsChatsCopyToAccountResult = z14.strictObject({
1849
+ message: z14.string().max(400),
1850
+ origin: ChatPlace,
1851
+ target: ChatPlace,
1852
+ mode: z14.enum(["copy", "move"]),
1853
+ /** The marker the chats are filed under ("From <origin>"), for Bring back. */
1854
+ project: z14.strictObject({ id: ChatProjectId, name: z14.string().max(200) }),
1855
+ /** The target groups used, by name: made or reused, now or at the next close. */
1856
+ groups: z14.array(z14.strictObject({ name: z14.string().max(200), chats: z14.number().int().nonnegative(), ok: z14.boolean(), when: z14.enum(["now", "next_close"]).nullable(), reason: z14.string().max(400).nullable() })).max(500),
1857
+ source_group: z14.strictObject({ name: z14.string().max(200), ok: z14.boolean(), when: z14.enum(["now", "next_close"]).nullable(), reason: z14.string().max(400).nullable() }).nullable(),
1858
+ chats: z14.array(CopiedChat).max(500),
1859
+ verified: z14.number().int().nonnegative(),
1860
+ queued: z14.number().int().nonnegative(),
1861
+ failed: z14.number().int().nonnegative(),
1862
+ /** What the restart choice did: "restart_verify" closed and reopened `windows`; a fall back to "queued" says why. */
1863
+ restart: z14.strictObject({ asked: z14.enum(["queued", "restart_verify"]), done: z14.enum(["queued", "restart_verify"]), windows: z14.array(ChatPlace).max(2), reason: z14.string().max(400).nullable() })
1864
+ });
1821
1865
 
1822
1866
  // src/schema/apps-instances.ts
1823
1867
  import { z as z15 } from "zod";
@@ -4443,6 +4487,8 @@ var OPS = {
4443
4487
  "apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4444
4488
  "apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4445
4489
  "apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4490
+ // 1.55: copy (or move) chats to another account with their groups and pins, in one engine pass, read back.
4491
+ "apps.chats.copy_to_account": { params: AppsChatsCopyToAccountParams, result: AppsChatsCopyToAccountResult, kind: "unary", since: "1.55", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4446
4492
  "apps.projects.to_window": { params: AppsProjectsToWindowParams, result: AppsProjectsToWindowResult, kind: "unary", since: "1.19", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4447
4493
  // 1.11: Going cold, Spend, sync health, windows upkeep.
4448
4494
  "apps.chats.cold": { params: AppsChatsColdParams, result: AppsChatsColdResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -5157,6 +5203,9 @@ var NAMED_SCHEMAS = {
5157
5203
  WindowRemoteControl,
5158
5204
  AppsWindowsSetRemoteControlParams,
5159
5205
  AppsWindowsSetRemoteControlResult,
5206
+ AppsChatsCopyToAccountParams,
5207
+ CopiedChat,
5208
+ AppsChatsCopyToAccountResult,
5160
5209
  AccountUsage,
5161
5210
  AccountReset,
5162
5211
  AppsWindowsListParams,
@@ -5725,7 +5774,7 @@ function forPeer(op, part, value, version) {
5725
5774
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
5726
5775
 
5727
5776
  // src/contract.ts
5728
- var CONTRACT_SHA256 = "5408ddb0e04daf99badca47b8f47b4b9bc6f30227dd488356854d85b17b3a9d4";
5777
+ var CONTRACT_SHA256 = "aeb1f5dd5ec4290d9ff8871fa39dd9be9605d25a40fec3c681f888c7f2a1954f";
5729
5778
 
5730
5779
  // src/close-policy.ts
5731
5780
  var CLOSE_RULES = {
@@ -6167,6 +6216,8 @@ export {
6167
6216
  AppsChatsChangedEvent,
6168
6217
  AppsChatsColdParams,
6169
6218
  AppsChatsColdResult,
6219
+ AppsChatsCopyToAccountParams,
6220
+ AppsChatsCopyToAccountResult,
6170
6221
  AppsChatsListParams,
6171
6222
  AppsChatsListResult,
6172
6223
  AppsChatsOpenParams,
@@ -6422,6 +6473,7 @@ export {
6422
6473
  ContactsSearchParams,
6423
6474
  ContactsSearchResult,
6424
6475
  ContractHash,
6476
+ CopiedChat,
6425
6477
  CoreToClientMsg,
6426
6478
  CoreToServiceMsg,
6427
6479
  CreditMsg,