@ai-matrx/desktop-protocol 0.21.18 → 0.21.20

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
@@ -100,10 +100,16 @@ __export(src_exports, {
100
100
  AppsWindowsProcessesResult: () => AppsWindowsProcessesResult,
101
101
  AppsWindowsRefreshUsageParams: () => AppsWindowsRefreshUsageParams,
102
102
  AppsWindowsReloadParams: () => AppsWindowsReloadParams,
103
+ AppsWindowsReopenParams: () => AppsWindowsReopenParams,
104
+ AppsWindowsReopenResult: () => AppsWindowsReopenResult,
103
105
  AppsWindowsRestartParams: () => AppsWindowsRestartParams,
104
106
  AppsWindowsSaveNamesParams: () => AppsWindowsSaveNamesParams,
105
107
  AppsWindowsShownParams: () => AppsWindowsShownParams,
106
108
  AppsWindowsShownResult: () => AppsWindowsShownResult,
109
+ AppsWindowsUpdateAndReopenParams: () => AppsWindowsUpdateAndReopenParams,
110
+ AppsWindowsUpdateAndReopenResult: () => AppsWindowsUpdateAndReopenResult,
111
+ AppsWindowsUpdateStateParams: () => AppsWindowsUpdateStateParams,
112
+ AppsWindowsUpdateStateResult: () => AppsWindowsUpdateStateResult,
107
113
  AudioDevice: () => AudioDevice,
108
114
  AudioDevicesParams: () => AudioDevicesParams,
109
115
  AudioDevicesResult: () => AudioDevicesResult,
@@ -516,7 +522,7 @@ module.exports = __toCommonJS(src_exports);
516
522
  var import_zod = require("zod");
517
523
  var import_uuid = require("@ai-matrx/kit/uuid");
518
524
  var PROTOCOL_MAJOR = 1;
519
- var PROTOCOL_MINOR = 24;
525
+ var PROTOCOL_MINOR = 26;
520
526
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
521
527
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
522
528
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -1714,7 +1720,13 @@ var AccountUsage = import_zod14.z.strictObject({
1714
1720
  /** 1.13: the account's plan as the app names it (Codex: "pro", "prolite"), when recorded. */
1715
1721
  plan: import_zod14.z.string().max(80).optional(),
1716
1722
  /** 1.13: the account's credit balance as the app records it (Codex), when recorded. */
1717
- credits: import_zod14.z.string().max(40).optional()
1723
+ credits: import_zod14.z.string().max(40).optional(),
1724
+ /**
1725
+ * 1.25: the latest the account's 5-hour window can reset: 5 hours after the first reading of this
1726
+ * window's use (its usage history), so the real reset is at or before it. Absent when no 5-hour
1727
+ * window is running (no use in the last reading, or the reading is over 5 hours old).
1728
+ */
1729
+ five_hour_resets_by_ms: epochMs.optional()
1718
1730
  });
1719
1731
  var AccountReset = import_zod14.z.strictObject({
1720
1732
  window: ChatPlace,
@@ -1913,6 +1925,29 @@ var AppsWindowsProcessesParams = import_zod14.z.strictObject({ app_key: AppKey }
1913
1925
  var AppsWindowsProcessesResult = import_zod14.z.strictObject({ processes: import_zod14.z.array(import_zod14.z.string().max(2e3)).max(2e3) });
1914
1926
  var AppsWindowsAddParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace, email: import_zod14.z.string().min(3).max(320) });
1915
1927
  var AppsWindowsSaveNamesParams = import_zod14.z.strictObject({ app_key: AppKey });
1928
+ var AppsWindowsUpdateStateParams = import_zod14.z.strictObject({ app_key: AppKey });
1929
+ var AppsWindowsUpdateStateResult = import_zod14.z.strictObject({
1930
+ app_key: AppKey,
1931
+ pending: import_zod14.z.boolean(),
1932
+ /** The downloaded release's name (Claude: "Claude 2.31226.1"), when the app's log names it. */
1933
+ version: import_zod14.z.string().max(120).nullable(),
1934
+ /** When the update became pending (the download's time), when known. */
1935
+ since_ms: epochMs.nullable(),
1936
+ /** Windows open when the update became pending (or last seen open) that are closed now. */
1937
+ closed: import_zod14.z.array(ChatPlace).max(200)
1938
+ });
1939
+ var AppsWindowsReopenParams = import_zod14.z.strictObject({ app_key: AppKey, windows: import_zod14.z.array(ChatPlace).min(1).max(200) });
1940
+ var AppsWindowsReopenResult = import_zod14.z.strictObject({ message: import_zod14.z.string().max(400), opened: import_zod14.z.array(ChatPlace).max(200) });
1941
+ var AppsWindowsUpdateAndReopenParams = import_zod14.z.strictObject({ app_key: AppKey, force: import_zod14.z.boolean().default(false), dry_run: import_zod14.z.boolean().default(false) });
1942
+ var AppsWindowsUpdateAndReopenResult = import_zod14.z.strictObject({
1943
+ message: import_zod14.z.string().max(400),
1944
+ /** Windows quit (with dry_run: to be quit). */
1945
+ quit: import_zod14.z.array(ChatPlace).max(200),
1946
+ /** Windows reopened (with dry_run: to be reopened), main first. */
1947
+ reopened: import_zod14.z.array(ChatPlace).max(200),
1948
+ /** The version installed, null when the install did not happen (or dry_run). */
1949
+ installed_version: import_zod14.z.string().max(64).nullable()
1950
+ });
1916
1951
 
1917
1952
  // src/schema/service.ts
1918
1953
  var import_zod15 = require("zod");
@@ -3143,7 +3178,11 @@ var OPS = {
3143
3178
  // 1.23: the signed-in person's own agents and Vault, read as them (the desktop's Agents library and Vault).
3144
3179
  "account.agents.list": { params: AccountAgentsListParams, result: AccountAgentsListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
3145
3180
  "account.vault.list": { params: AccountVaultListParams, result: AccountVaultListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
3146
- "account.vault.copy": { params: AccountVaultCopyParams, result: AccountVaultCopyResult, kind: "unary", since: "1.23", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "DEVICE_OFFLINE", "INTERNAL"] }
3181
+ "account.vault.copy": { params: AccountVaultCopyParams, result: AccountVaultCopyResult, kind: "unary", since: "1.23", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "DEVICE_OFFLINE", "INTERNAL"] },
3182
+ // 1.26: the app's own update (it installs only once every window quit) and bringing the windows back.
3183
+ "apps.windows.update_state": { params: AppsWindowsUpdateStateParams, result: AppsWindowsUpdateStateResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
3184
+ "apps.windows.reopen": { params: AppsWindowsReopenParams, result: AppsWindowsReopenResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
3185
+ "apps.windows.update_and_reopen": { params: AppsWindowsUpdateAndReopenParams, result: AppsWindowsUpdateAndReopenResult, kind: "unary", since: "1.26", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] }
3147
3186
  };
3148
3187
  var EVENTS = {
3149
3188
  "fs.changed": FsChangedEvent,
@@ -3604,7 +3643,13 @@ var NAMED_SCHEMAS = {
3604
3643
  AccountVaultListParams,
3605
3644
  AccountVaultListResult,
3606
3645
  AccountVaultCopyParams,
3607
- AccountVaultCopyResult
3646
+ AccountVaultCopyResult,
3647
+ AppsWindowsUpdateStateParams,
3648
+ AppsWindowsUpdateStateResult,
3649
+ AppsWindowsReopenParams,
3650
+ AppsWindowsReopenResult,
3651
+ AppsWindowsUpdateAndReopenParams,
3652
+ AppsWindowsUpdateAndReopenResult
3608
3653
  };
3609
3654
 
3610
3655
  // src/versioning.ts
@@ -3618,7 +3663,7 @@ var FIELDS_SINCE = {
3618
3663
  AppsAccountsUsageResult: { problem: "1.12" },
3619
3664
  AppsAccountsResetsResult: { problem: "1.12" },
3620
3665
  ChatRow: { app_project: "1.13", tokens: "1.13", original_title: "1.14", title_source: "1.14", title_override: "1.14", archived: "1.15" },
3621
- AccountUsage: { plan: "1.13", credits: "1.13" },
3666
+ AccountUsage: { plan: "1.13", credits: "1.13", five_hour_resets_by_ms: "1.25" },
3622
3667
  ResourcesDisk: { name: "1.17" },
3623
3668
  StackServer: { cpu_percent: "1.18", memory_bytes: "1.18" },
3624
3669
  AudioDevice: { kind: "1.24" },
@@ -3754,7 +3799,7 @@ function forPeer(op, part, value, version) {
3754
3799
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
3755
3800
 
3756
3801
  // src/contract.ts
3757
- var CONTRACT_SHA256 = "89943d5297e89b0ae7433b24c3076be1f65ca39a5edc3f338620597b24009226";
3802
+ var CONTRACT_SHA256 = "42d314c6051a4dde86faa4b606bb9b8dcc7b2638d8b0cfb25852e8924920f44b";
3758
3803
 
3759
3804
  // src/close-policy.ts
3760
3805
  var CLOSE_RULES = {