@ai-matrx/desktop-protocol 0.21.45 → 0.21.47

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
@@ -130,6 +130,8 @@ __export(src_exports, {
130
130
  AppsWindowsReopenResult: () => AppsWindowsReopenResult,
131
131
  AppsWindowsRestartParams: () => AppsWindowsRestartParams,
132
132
  AppsWindowsSaveNamesParams: () => AppsWindowsSaveNamesParams,
133
+ AppsWindowsSetRemoteControlParams: () => AppsWindowsSetRemoteControlParams,
134
+ AppsWindowsSetRemoteControlResult: () => AppsWindowsSetRemoteControlResult,
133
135
  AppsWindowsShownParams: () => AppsWindowsShownParams,
134
136
  AppsWindowsShownResult: () => AppsWindowsShownResult,
135
137
  AppsWindowsUpdateAndReopenParams: () => AppsWindowsUpdateAndReopenParams,
@@ -833,6 +835,7 @@ __export(src_exports, {
833
835
  WindowMinimizeResult: () => WindowMinimizeResult,
834
836
  WindowMoveParams: () => WindowMoveParams,
835
837
  WindowMoveResult: () => WindowMoveResult,
838
+ WindowRemoteControl: () => WindowRemoteControl,
836
839
  WindowsEvent: () => WindowsEvent,
837
840
  WindowsEventLogParams: () => WindowsEventLogParams,
838
841
  WindowsEventLogResult: () => WindowsEventLogResult,
@@ -883,7 +886,7 @@ module.exports = __toCommonJS(src_exports);
883
886
  var import_zod = require("zod");
884
887
  var import_uuid = require("@ai-matrx/kit/uuid");
885
888
  var PROTOCOL_MAJOR = 1;
886
- var PROTOCOL_MINOR = 49;
889
+ var PROTOCOL_MINOR = 52;
887
890
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
888
891
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
889
892
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -2302,6 +2305,23 @@ var AppsChatsStarResult = import_zod13.z.strictObject({ chat: ChatRow });
2302
2305
 
2303
2306
  // src/schema/apps-accounts.ts
2304
2307
  var import_zod14 = require("zod");
2308
+ var WindowRemoteControl = import_zod14.z.strictObject({
2309
+ /**
2310
+ * As the window's settings file holds it: on, off, or never set (the app's default). 1.52:
2311
+ * "unreadable" = the file is there but damaged, so the setting is not known (`problem` says why).
2312
+ */
2313
+ setting: import_zod14.z.enum(["on", "off", "default", "unreadable"]),
2314
+ /** The window serves Remote Control now (its live state says "on"); null: not known (closed, or no state file). */
2315
+ serving: import_zod14.z.boolean().nullable(),
2316
+ /** A change queued until the window next closes (or restarts); null: none. */
2317
+ pending: import_zod14.z.enum(["on", "off"]).nullable(),
2318
+ /**
2319
+ * 1.52: why the setting cannot be trusted, as a plain sentence for the person: the settings file is
2320
+ * damaged ("unreadable"), or a queued change failed to land (it stays queued; asking again retries).
2321
+ * Absent: nothing wrong. An older core omits it.
2322
+ */
2323
+ problem: import_zod14.z.string().max(300).optional()
2324
+ });
2305
2325
  var AppWindowInfo = import_zod14.z.strictObject({
2306
2326
  key: ChatPlace,
2307
2327
  /** The app's default profile (Claude: main, which may sign into any account). */
@@ -2318,7 +2338,9 @@ var AppWindowInfo = import_zod14.z.strictObject({
2318
2338
  /** Open now. */
2319
2339
  running: import_zod14.z.boolean(),
2320
2340
  /** Chats open in it now (a process resuming each one). */
2321
- open_chats: nonNegInt
2341
+ open_chats: nonNegInt,
2342
+ /** 1.50: its Remote Control (phone) setting; absent from an older core, or an app without one. */
2343
+ remote_control: WindowRemoteControl.optional()
2322
2344
  });
2323
2345
  var AccountUsage = import_zod14.z.strictObject({
2324
2346
  /** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
@@ -2398,6 +2420,13 @@ var AppsWindowsShownResult = import_zod14.z.strictObject({
2398
2420
  sections: import_zod14.z.array(ShownSection).max(200),
2399
2421
  problem: import_zod14.z.string().max(400).nullable()
2400
2422
  });
2423
+ var AppsWindowsSetRemoteControlParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace, enabled: import_zod14.z.boolean() });
2424
+ var AppsWindowsSetRemoteControlResult = import_zod14.z.strictObject({
2425
+ message: import_zod14.z.string().max(400),
2426
+ /** "now" = written into the closed window; "next_close" = queued until it closes. */
2427
+ when: import_zod14.z.enum(["now", "next_close"]),
2428
+ remote_control: WindowRemoteControl
2429
+ });
2401
2430
  var AppsWindowsRestartParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace, force: import_zod14.z.boolean().default(false) });
2402
2431
  var AppsWindowsRefreshUsageParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace });
2403
2432
  var AppsProjectsMoveParams = import_zod14.z.strictObject({
@@ -2741,19 +2770,23 @@ var AppAccount = import_zod15.z.strictObject({
2741
2770
  last_seen_ms: epochMs.nullable(),
2742
2771
  missing: import_zod15.z.array(AccountGap).max(3)
2743
2772
  });
2744
- var AppsInstancesListParams = import_zod15.z.strictObject({ app_key: AppKey });
2773
+ var AppsInstancesListParams = import_zod15.z.strictObject({ app_key: AppKey, fresh: import_zod15.z.boolean().optional() });
2745
2774
  var AppsInstancesListResult = import_zod15.z.strictObject({
2746
2775
  app_key: AppKey,
2747
2776
  install: AppInstall.nullable(),
2748
2777
  instances: import_zod15.z.array(AppInstance).max(200),
2749
2778
  /** The rows are right but something around them failed; shown, never hidden. */
2750
- problem: import_zod15.z.string().max(400).optional()
2779
+ problem: import_zod15.z.string().max(400).optional(),
2780
+ as_of_ms: epochMs.optional(),
2781
+ refreshing: import_zod15.z.boolean().optional()
2751
2782
  });
2752
- var AppsAccountsListParams = import_zod15.z.strictObject({ app_key: AppKey });
2783
+ var AppsAccountsListParams = import_zod15.z.strictObject({ app_key: AppKey, fresh: import_zod15.z.boolean().optional() });
2753
2784
  var AppsAccountsListResult = import_zod15.z.strictObject({
2754
2785
  app_key: AppKey,
2755
2786
  accounts: import_zod15.z.array(AppAccount).max(500),
2756
- problem: import_zod15.z.string().max(400).optional()
2787
+ problem: import_zod15.z.string().max(400).optional(),
2788
+ as_of_ms: epochMs.optional(),
2789
+ refreshing: import_zod15.z.boolean().optional()
2757
2790
  });
2758
2791
 
2759
2792
  // src/schema/service.ts
@@ -5270,6 +5303,8 @@ var OPS = {
5270
5303
  "apps.windows.open": { params: AppsWindowsOpenParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5271
5304
  "apps.windows.reload": { params: AppsWindowsReloadParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5272
5305
  "apps.windows.restart": { params: AppsWindowsRestartParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5306
+ // 1.50: a window's Remote Control (phone) setting, written while closed or queued for its next close.
5307
+ "apps.windows.set_remote_control": { params: AppsWindowsSetRemoteControlParams, result: AppsWindowsSetRemoteControlResult, kind: "unary", since: "1.50", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5273
5308
  "apps.windows.refresh_usage": { params: AppsWindowsRefreshUsageParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5274
5309
  "apps.accounts.usage": { params: AppsAccountsUsageParams, result: AppsAccountsUsageResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
5275
5310
  "apps.accounts.resets": { params: AppsAccountsResetsParams, result: AppsAccountsResetsResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -5990,6 +6025,9 @@ var NAMED_SCHEMAS = {
5990
6025
  AppsProjectsCopyResult,
5991
6026
  ChatFamily,
5992
6027
  AppWindowInfo,
6028
+ WindowRemoteControl,
6029
+ AppsWindowsSetRemoteControlParams,
6030
+ AppsWindowsSetRemoteControlResult,
5993
6031
  AccountUsage,
5994
6032
  AccountReset,
5995
6033
  AppsWindowsListParams,
@@ -6326,6 +6364,12 @@ var FIELDS_SINCE = {
6326
6364
  "RelayCallResponse|0": { protocol_version: "1.1" },
6327
6365
  "RelayCallResponse|1": { protocol_version: "1.1" },
6328
6366
  WindowInfo: { app: "1.7", pid: "1.7" },
6367
+ AppWindowInfo: { remote_control: "1.50" },
6368
+ WindowRemoteControl: { problem: "1.52" },
6369
+ AppsInstancesListParams: { fresh: "1.51" },
6370
+ AppsInstancesListResult: { as_of_ms: "1.51", refreshing: "1.51" },
6371
+ AppsAccountsListParams: { fresh: "1.51" },
6372
+ AppsAccountsListResult: { as_of_ms: "1.51", refreshing: "1.51" },
6329
6373
  AppsChatsListResult: { updating: "1.9", live: "1.9", families: "1.10" },
6330
6374
  AppsAccountsUsageResult: { problem: "1.12" },
6331
6375
  AppsAccountsResetsResult: { problem: "1.12" },
@@ -6455,7 +6499,9 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
6455
6499
  ["web.scrape", [["pages", "WebScrapePage"]]],
6456
6500
  ["sysinfo.get", [["permissions", "SysinfoGetResult.permissions[]"]]],
6457
6501
  ["models.downloads.list", [["downloads", "DownloadRow"]]],
6458
- ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]]
6502
+ ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]],
6503
+ ["apps.windows.list", [["windows", "AppWindowInfo"]]],
6504
+ ["apps.windows.set_remote_control", [["remote_control", "WindowRemoteControl"]]]
6459
6505
  ]);
6460
6506
  function stripNested(value, nested, version) {
6461
6507
  if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
@@ -6474,6 +6520,23 @@ function stripNested(value, nested, version) {
6474
6520
  }
6475
6521
  return body;
6476
6522
  }
6523
+ function windowListRemoteControlForPeer(value, version) {
6524
+ if (knows(version, "1.52") || value === null || typeof value !== "object") return value;
6525
+ const body = value;
6526
+ if (!Array.isArray(body.windows)) return value;
6527
+ const windows = body.windows;
6528
+ const next = windows.map((w) => {
6529
+ const rc = w?.remote_control;
6530
+ if (rc === null || typeof rc !== "object") return w;
6531
+ if (rc.setting === "unreadable") {
6532
+ const { remote_control: _dropped, ...rest } = w;
6533
+ return rest;
6534
+ }
6535
+ const kept = strip(rc, FIELDS_SINCE.WindowRemoteControl, version);
6536
+ return kept === rc ? w : { ...w, remote_control: kept };
6537
+ });
6538
+ return next.some((w, i) => w !== windows[i]) ? { ...body, windows: next } : value;
6539
+ }
6477
6540
  var WINDOW_RESULTS = /* @__PURE__ */ new Map([
6478
6541
  ["window.list", "windows"],
6479
6542
  ["window.focus", "window"],
@@ -6500,7 +6563,8 @@ function forPeer(op, part, value, version) {
6500
6563
  const known = op === "sysinfo.get" ? permissionsForPeer(value, version) : value;
6501
6564
  const top = path ? strip(known, FIELDS_SINCE[path], version) : known;
6502
6565
  const nested = op ? NESTED_RESULTS.get(op) : void 0;
6503
- return nested ? stripNested(top, nested, version) : top;
6566
+ const stripped = nested ? stripNested(top, nested, version) : top;
6567
+ return op === "apps.windows.list" ? windowListRemoteControlForPeer(stripped, version) : stripped;
6504
6568
  }
6505
6569
  if (value === null || typeof value !== "object") return value;
6506
6570
  const body = value;
@@ -6517,7 +6581,7 @@ function forPeer(op, part, value, version) {
6517
6581
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
6518
6582
 
6519
6583
  // src/contract.ts
6520
- var CONTRACT_SHA256 = "ac576512b0292490d7aa8b1561ccbf2dde677d94150c52d473f58b0d381ba150";
6584
+ var CONTRACT_SHA256 = "e9eba8289b9f07b90d920f5a44b038473fae8597e5b43c1f37a2bbda391edcbd";
6521
6585
 
6522
6586
  // src/close-policy.ts
6523
6587
  var CLOSE_RULES = {