@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/CHANGELOG.md CHANGED
@@ -1,10 +1,36 @@
1
1
  # Changelog
2
2
 
3
- ## 0.21.45
3
+ ## 0.21.47
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/desktop-protocol/src`.
7
7
 
8
+ ## 0.21.46
9
+ ### Unreleased
10
+
11
+ - **Protocol 1.52 — Remote Control says when it is wrong.** `WindowRemoteControl` gains optional
12
+ `problem` (a plain sentence: the settings file is damaged, or why a queued change failed to land) and
13
+ `setting` gains `"unreadable"` (a damaged file, not the app's default). `forPeer` never sends a 1.50/1.51
14
+ peer `problem`, and gives a window with a damaged file no `remote_control` (apps.windows.list and
15
+ apps.windows.set_remote_control are now wired into it, which 1.50 missed). Consumer action: none; show
16
+ `problem` as a warning and disable the switch for "unreadable".
17
+ - **Protocol 1.50 — a window's Remote Control (phone) setting.** `AppWindowInfo` gains optional
18
+ `remote_control` (`WindowRemoteControl`: `setting` on/off/default as the window's settings file holds
19
+ it, `serving` from its live state, `pending` a change queued for its next close). New op
20
+ `apps.windows.set_remote_control` (`{app_key, window, enabled}` → `{message, when, remote_control}`):
21
+ a closed window is written now, an open one is queued and written on its next close or Restart.
22
+ Consumer action: none; a 1.49 core omits the field and answers UNKNOWN_OPERATION.
23
+
24
+ ## 0.21.45
25
+
26
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
27
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
28
+ Diff: `git diff de1c78033b 8a91ee5592 -- apps/shared/desktop-protocol/src`
29
+
30
+ Changed shipped source files (2):
31
+ - `apps/shared/desktop-protocol/src/contract.ts`
32
+ - `apps/shared/desktop-protocol/src/schema/models.ts`
33
+
8
34
  ## 0.21.44
9
35
  ### Unreleased
10
36
 
package/README.md CHANGED
@@ -51,7 +51,7 @@ term.write("ls\n");
51
51
  those, never on messages. A dropped socket rejects unary work with `DEVICE_OFFLINE` (retryable).
52
52
  - **Terminal closes** (`4010` revoked, `4003` forbidden, `4004` not found, `4009` replaced, `4426`
53
53
  upgrade) end the client for good; everything else reconnects with the shared
54
- `@ai-matrx/realtime` backoff (stability reset + jitter) — including `1006` (a relay deploy drops
54
+ `@ai-matrx/data/realtime` backoff (stability reset + jitter) — including `1006` (a relay deploy drops
55
55
  every socket without a close frame) and `1012` (the relay's "the device reconnected": hello and
56
56
  reattach against the new core session).
57
57
  - **Coming back:** `client.wake()` (or `bindDesktopWake(client)` / `useDesktopWake()`, which call it
package/dist/client.cjs CHANGED
@@ -31,7 +31,7 @@ __export(client_exports, {
31
31
  module.exports = __toCommonJS(client_exports);
32
32
 
33
33
  // src/client/client.ts
34
- var import_realtime = require("@ai-matrx/realtime");
34
+ var import_realtime = require("@ai-matrx/data/realtime");
35
35
 
36
36
  // src/error.ts
37
37
  var DesktopProtocolError = class _DesktopProtocolError extends Error {
@@ -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 = 49;
147
+ var PROTOCOL_MINOR = 52;
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_-]+$/);
@@ -3043,6 +3043,23 @@ var AppsChatsStarResult = import_zod30.z.strictObject({ chat: ChatRow });
3043
3043
 
3044
3044
  // src/schema/apps-accounts.ts
3045
3045
  var import_zod31 = require("zod");
3046
+ var WindowRemoteControl = import_zod31.z.strictObject({
3047
+ /**
3048
+ * As the window's settings file holds it: on, off, or never set (the app's default). 1.52:
3049
+ * "unreadable" = the file is there but damaged, so the setting is not known (`problem` says why).
3050
+ */
3051
+ setting: import_zod31.z.enum(["on", "off", "default", "unreadable"]),
3052
+ /** The window serves Remote Control now (its live state says "on"); null: not known (closed, or no state file). */
3053
+ serving: import_zod31.z.boolean().nullable(),
3054
+ /** A change queued until the window next closes (or restarts); null: none. */
3055
+ pending: import_zod31.z.enum(["on", "off"]).nullable(),
3056
+ /**
3057
+ * 1.52: why the setting cannot be trusted, as a plain sentence for the person: the settings file is
3058
+ * damaged ("unreadable"), or a queued change failed to land (it stays queued; asking again retries).
3059
+ * Absent: nothing wrong. An older core omits it.
3060
+ */
3061
+ problem: import_zod31.z.string().max(300).optional()
3062
+ });
3046
3063
  var AppWindowInfo = import_zod31.z.strictObject({
3047
3064
  key: ChatPlace,
3048
3065
  /** The app's default profile (Claude: main, which may sign into any account). */
@@ -3059,7 +3076,9 @@ var AppWindowInfo = import_zod31.z.strictObject({
3059
3076
  /** Open now. */
3060
3077
  running: import_zod31.z.boolean(),
3061
3078
  /** Chats open in it now (a process resuming each one). */
3062
- open_chats: nonNegInt
3079
+ open_chats: nonNegInt,
3080
+ /** 1.50: its Remote Control (phone) setting; absent from an older core, or an app without one. */
3081
+ remote_control: WindowRemoteControl.optional()
3063
3082
  });
3064
3083
  var AccountUsage = import_zod31.z.strictObject({
3065
3084
  /** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
@@ -3139,6 +3158,13 @@ var AppsWindowsShownResult = import_zod31.z.strictObject({
3139
3158
  sections: import_zod31.z.array(ShownSection).max(200),
3140
3159
  problem: import_zod31.z.string().max(400).nullable()
3141
3160
  });
3161
+ var AppsWindowsSetRemoteControlParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace, enabled: import_zod31.z.boolean() });
3162
+ var AppsWindowsSetRemoteControlResult = import_zod31.z.strictObject({
3163
+ message: import_zod31.z.string().max(400),
3164
+ /** "now" = written into the closed window; "next_close" = queued until it closes. */
3165
+ when: import_zod31.z.enum(["now", "next_close"]),
3166
+ remote_control: WindowRemoteControl
3167
+ });
3142
3168
  var AppsWindowsRestartParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace, force: import_zod31.z.boolean().default(false) });
3143
3169
  var AppsWindowsRefreshUsageParams = import_zod31.z.strictObject({ app_key: AppKey, window: ChatPlace });
3144
3170
  var AppsProjectsMoveParams = import_zod31.z.strictObject({
@@ -3482,19 +3508,23 @@ var AppAccount = import_zod32.z.strictObject({
3482
3508
  last_seen_ms: epochMs.nullable(),
3483
3509
  missing: import_zod32.z.array(AccountGap).max(3)
3484
3510
  });
3485
- var AppsInstancesListParams = import_zod32.z.strictObject({ app_key: AppKey });
3511
+ var AppsInstancesListParams = import_zod32.z.strictObject({ app_key: AppKey, fresh: import_zod32.z.boolean().optional() });
3486
3512
  var AppsInstancesListResult = import_zod32.z.strictObject({
3487
3513
  app_key: AppKey,
3488
3514
  install: AppInstall.nullable(),
3489
3515
  instances: import_zod32.z.array(AppInstance).max(200),
3490
3516
  /** The rows are right but something around them failed; shown, never hidden. */
3491
- problem: import_zod32.z.string().max(400).optional()
3517
+ problem: import_zod32.z.string().max(400).optional(),
3518
+ as_of_ms: epochMs.optional(),
3519
+ refreshing: import_zod32.z.boolean().optional()
3492
3520
  });
3493
- var AppsAccountsListParams = import_zod32.z.strictObject({ app_key: AppKey });
3521
+ var AppsAccountsListParams = import_zod32.z.strictObject({ app_key: AppKey, fresh: import_zod32.z.boolean().optional() });
3494
3522
  var AppsAccountsListResult = import_zod32.z.strictObject({
3495
3523
  app_key: AppKey,
3496
3524
  accounts: import_zod32.z.array(AppAccount).max(500),
3497
- problem: import_zod32.z.string().max(400).optional()
3525
+ problem: import_zod32.z.string().max(400).optional(),
3526
+ as_of_ms: epochMs.optional(),
3527
+ refreshing: import_zod32.z.boolean().optional()
3498
3528
  });
3499
3529
 
3500
3530
  // src/schema/browser.ts
@@ -4334,6 +4364,8 @@ var OPS = {
4334
4364
  "apps.windows.open": { params: AppsWindowsOpenParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4335
4365
  "apps.windows.reload": { params: AppsWindowsReloadParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "CONFLICT", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4336
4366
  "apps.windows.restart": { params: AppsWindowsRestartParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4367
+ // 1.50: a window's Remote Control (phone) setting, written while closed or queued for its next close.
4368
+ "apps.windows.set_remote_control": { params: AppsWindowsSetRemoteControlParams, result: AppsWindowsSetRemoteControlResult, kind: "unary", since: "1.50", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4337
4369
  "apps.windows.refresh_usage": { params: AppsWindowsRefreshUsageParams, result: AppsWindowActionResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4338
4370
  "apps.accounts.usage": { params: AppsAccountsUsageParams, result: AppsAccountsUsageResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
4339
4371
  "apps.accounts.resets": { params: AppsAccountsResetsParams, result: AppsAccountsResetsResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -4600,7 +4632,9 @@ var NESTED_RESULTS = /* @__PURE__ */ new Map([
4600
4632
  ["web.scrape", [["pages", "WebScrapePage"]]],
4601
4633
  ["sysinfo.get", [["permissions", "SysinfoGetResult.permissions[]"]]],
4602
4634
  ["models.downloads.list", [["downloads", "DownloadRow"]]],
4603
- ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]]
4635
+ ["apps.projects.to_window", [["group", "ProjectMoveGroup"]]],
4636
+ ["apps.windows.list", [["windows", "AppWindowInfo"]]],
4637
+ ["apps.windows.set_remote_control", [["remote_control", "WindowRemoteControl"]]]
4604
4638
  ]);
4605
4639
  var WINDOW_RESULTS = /* @__PURE__ */ new Map([
4606
4640
  ["window.list", "windows"],