@ai-matrx/desktop-protocol 0.21.46 → 0.21.48

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
@@ -886,7 +886,7 @@ module.exports = __toCommonJS(src_exports);
886
886
  var import_zod = require("zod");
887
887
  var import_uuid = require("@ai-matrx/kit/uuid");
888
888
  var PROTOCOL_MAJOR = 1;
889
- var PROTOCOL_MINOR = 51;
889
+ var PROTOCOL_MINOR = 53;
890
890
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
891
891
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
892
892
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -2306,12 +2306,21 @@ var AppsChatsStarResult = import_zod13.z.strictObject({ chat: ChatRow });
2306
2306
  // src/schema/apps-accounts.ts
2307
2307
  var import_zod14 = require("zod");
2308
2308
  var WindowRemoteControl = import_zod14.z.strictObject({
2309
- /** As the window's settings file holds it: on, off, or never set (the app's default). */
2310
- setting: import_zod14.z.enum(["on", "off", "default"]),
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"]),
2311
2314
  /** The window serves Remote Control now (its live state says "on"); null: not known (closed, or no state file). */
2312
2315
  serving: import_zod14.z.boolean().nullable(),
2313
2316
  /** A change queued until the window next closes (or restarts); null: none. */
2314
- pending: import_zod14.z.enum(["on", "off"]).nullable()
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()
2315
2324
  });
2316
2325
  var AppWindowInfo = import_zod14.z.strictObject({
2317
2326
  key: ChatPlace,
@@ -4243,7 +4252,15 @@ var CodingProviderStatus = import_zod34.z.strictObject({
4243
4252
  efforts: import_zod34.z.array(import_zod34.z.string().max(40)).max(20),
4244
4253
  defaultModel: import_zod34.z.strictObject({ id: import_zod34.z.string().max(200), source: import_zod34.z.enum(["settings", "driver"]) }).nullable(),
4245
4254
  defaultEffort: import_zod34.z.string().max(40).nullable(),
4246
- binary: CodingProviderBinary.nullable()
4255
+ binary: CodingProviderBinary.nullable(),
4256
+ /**
4257
+ * (1.53) The person's other accounts for this app on the computer (Matrx 2's Accounts) that a run
4258
+ * can use, as the computer's engine lists them; New session offers them beside the default sign-in.
4259
+ * Absent: only the default sign-in (or a computer older than 1.53).
4260
+ */
4261
+ 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(),
4262
+ /** (1.53) The computer tried to list `accounts` and could not: a short sentence the form shows with a retry. */
4263
+ accountsProblem: ShortText.optional()
4247
4264
  });
4248
4265
  var CodingChatPreference = import_zod34.z.strictObject({
4249
4266
  title: import_zod34.z.string().max(500).nullable(),
@@ -6356,6 +6373,8 @@ var FIELDS_SINCE = {
6356
6373
  "RelayCallResponse|1": { protocol_version: "1.1" },
6357
6374
  WindowInfo: { app: "1.7", pid: "1.7" },
6358
6375
  AppWindowInfo: { remote_control: "1.50" },
6376
+ WindowRemoteControl: { problem: "1.52" },
6377
+ CodingProviderStatus: { accounts: "1.53", accountsProblem: "1.53" },
6359
6378
  AppsInstancesListParams: { fresh: "1.51" },
6360
6379
  AppsInstancesListResult: { as_of_ms: "1.51", refreshing: "1.51" },
6361
6380
  AppsAccountsListParams: { fresh: "1.51" },
@@ -6489,7 +6508,10 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
6489
6508
  ["web.scrape", [["pages", "WebScrapePage"]]],
6490
6509
  ["sysinfo.get", [["permissions", "SysinfoGetResult.permissions[]"]]],
6491
6510
  ["models.downloads.list", [["downloads", "DownloadRow"]]],
6492
- ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]]
6511
+ ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]],
6512
+ ["apps.windows.list", [["windows", "AppWindowInfo"]]],
6513
+ ["apps.windows.set_remote_control", [["remote_control", "WindowRemoteControl"]]],
6514
+ ["coding.providers", [["providers", "CodingProviderStatus"]]]
6493
6515
  ]);
6494
6516
  function stripNested(value, nested, version) {
6495
6517
  if (value === null || typeof value !== "object" || Array.isArray(value)) return value;
@@ -6508,6 +6530,23 @@ function stripNested(value, nested, version) {
6508
6530
  }
6509
6531
  return body;
6510
6532
  }
6533
+ function windowListRemoteControlForPeer(value, version) {
6534
+ if (knows(version, "1.52") || value === null || typeof value !== "object") return value;
6535
+ const body = value;
6536
+ if (!Array.isArray(body.windows)) return value;
6537
+ const windows = body.windows;
6538
+ const next = windows.map((w) => {
6539
+ const rc = w?.remote_control;
6540
+ if (rc === null || typeof rc !== "object") return w;
6541
+ if (rc.setting === "unreadable") {
6542
+ const { remote_control: _dropped, ...rest } = w;
6543
+ return rest;
6544
+ }
6545
+ const kept = strip(rc, FIELDS_SINCE.WindowRemoteControl, version);
6546
+ return kept === rc ? w : { ...w, remote_control: kept };
6547
+ });
6548
+ return next.some((w, i) => w !== windows[i]) ? { ...body, windows: next } : value;
6549
+ }
6511
6550
  var WINDOW_RESULTS = /* @__PURE__ */ new Map([
6512
6551
  ["window.list", "windows"],
6513
6552
  ["window.focus", "window"],
@@ -6534,7 +6573,8 @@ function forPeer(op, part, value, version) {
6534
6573
  const known = op === "sysinfo.get" ? permissionsForPeer(value, version) : value;
6535
6574
  const top = path ? strip(known, FIELDS_SINCE[path], version) : known;
6536
6575
  const nested = op ? NESTED_RESULTS.get(op) : void 0;
6537
- return nested ? stripNested(top, nested, version) : top;
6576
+ const stripped = nested ? stripNested(top, nested, version) : top;
6577
+ return op === "apps.windows.list" ? windowListRemoteControlForPeer(stripped, version) : stripped;
6538
6578
  }
6539
6579
  if (value === null || typeof value !== "object") return value;
6540
6580
  const body = value;
@@ -6551,7 +6591,7 @@ function forPeer(op, part, value, version) {
6551
6591
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
6552
6592
 
6553
6593
  // src/contract.ts
6554
- var CONTRACT_SHA256 = "17a170d7662db6a201d4787ac19ce9bbd34696faba04cabedb9d26ba14d15ff4";
6594
+ var CONTRACT_SHA256 = "3a1cc0cf335111a353238b9673b5764e7f3657f2c216f05f0895886f5c0d1db8";
6555
6595
 
6556
6596
  // src/close-policy.ts
6557
6597
  var CLOSE_RULES = {