@ai-matrx/desktop-protocol 0.21.16 → 0.21.17

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/client.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BackoffOptions } from '@ai-matrx/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
3
3
  import { z } from 'zod';
4
- import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-BpZriuN2.cjs';
5
- export { i as isDesktopProtocolError } from './models-BpZriuN2.cjs';
4
+ import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-xHAz1vPQ.cjs';
5
+ export { i as isDesktopProtocolError } from './models-xHAz1vPQ.cjs';
6
6
  import { FrameHeader } from './frame.cjs';
7
7
 
8
8
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BackoffOptions } from '@ai-matrx/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
3
3
  import { z } from 'zod';
4
- import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-BpZriuN2.js';
5
- export { i as isDesktopProtocolError } from './models-BpZriuN2.js';
4
+ import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-xHAz1vPQ.js';
5
+ export { i as isDesktopProtocolError } from './models-xHAz1vPQ.js';
6
6
  import { FrameHeader } from './frame.js';
7
7
 
8
8
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.js CHANGED
@@ -112,7 +112,7 @@ import { z as z2 } from "zod";
112
112
  import { z } from "zod";
113
113
  import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
114
114
  var PROTOCOL_MAJOR = 1;
115
- var PROTOCOL_MINOR = 23;
115
+ var PROTOCOL_MINOR = 24;
116
116
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
117
117
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
118
118
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -416,6 +416,23 @@ var SysinfoGetResult = z5.strictObject({
416
416
  })
417
417
  )
418
418
  });
419
+ var SysinfoHardwareParams = z5.strictObject({});
420
+ var SysinfoHardwareResult = z5.strictObject({
421
+ /** "Mac Studio", "MacBook Pro", "ThinkPad X1 Carbon". */
422
+ model_name: z5.string().max(128).nullable(),
423
+ /** What tells two of that model apart: "M3 Ultra, 2025", "14-inch, Nov 2023". */
424
+ model_detail: z5.string().max(128).nullable(),
425
+ /** "Mac15,14", the vendor's model number. */
426
+ model_identifier: z5.string().max(128).nullable(),
427
+ /** "Apple M3 Ultra", "Intel Core i7-1185G7". */
428
+ chip: z5.string().max(128).nullable(),
429
+ serial_number: z5.string().max(128).nullable(),
430
+ /** The OS's own name with its release name: "macOS Tahoe", "Windows 11 Pro", "Ubuntu". */
431
+ os_name: z5.string().max(64).nullable(),
432
+ /** "26.6.2". */
433
+ os_version: z5.string().max(64).nullable(),
434
+ os_build: z5.string().max(64).nullable()
435
+ });
419
436
 
420
437
  // src/schema/fs.ts
421
438
  import { z as z6 } from "zod";
@@ -1093,6 +1110,21 @@ var SystemNotifyResult = z16.strictObject({
1093
1110
  /** False when this computer has no notification service to show it (a bare Linux box). */
1094
1111
  shown: z16.boolean()
1095
1112
  });
1113
+ var SystemSettingsPane = z16.enum([
1114
+ "displays",
1115
+ "night_shift",
1116
+ "sound",
1117
+ "keyboard",
1118
+ "keyboard_shortcuts",
1119
+ "text_input",
1120
+ "dictation",
1121
+ "energy",
1122
+ "about",
1123
+ "storage",
1124
+ "system_report"
1125
+ ]);
1126
+ var SystemOpenSettingsParams = z16.strictObject({ pane: SystemSettingsPane });
1127
+ var SystemOpenSettingsResult = z16.strictObject({ pane: SystemSettingsPane });
1096
1128
 
1097
1129
  // src/schema/screen.ts
1098
1130
  import { z as z17 } from "zod";
@@ -1107,7 +1139,13 @@ var ScreenDisplay = z17.strictObject({
1107
1139
  height: z17.int().min(1),
1108
1140
  /** Pixels per point (2 on a Retina display). */
1109
1141
  scale: z17.number().min(0.1).max(8),
1110
- primary: z17.boolean()
1142
+ primary: z17.boolean(),
1143
+ /** (1.24) Clockwise rotation in degrees (Displays' Rotation: 0 is Standard). */
1144
+ rotation: z17.int().min(0).max(359).optional(),
1145
+ /** (1.24) Refresh rate in hertz; absent where the OS does not say. */
1146
+ refresh_hz: z17.number().min(0).max(1e3).optional(),
1147
+ /** (1.24) The computer's own screen (a laptop's), not one plugged in. */
1148
+ builtin: z17.boolean().optional()
1111
1149
  });
1112
1150
  var ScreenListParams = z17.strictObject({});
1113
1151
  var ScreenListResult = z17.strictObject({ displays: z17.array(ScreenDisplay).max(32) });
@@ -1286,9 +1324,43 @@ var InputMouseClickResult = z19.strictObject({
1286
1324
  button: z19.enum(["left", "right", "middle"]),
1287
1325
  double: z19.boolean()
1288
1326
  });
1327
+ var InputKeyboardSettingsParams = z19.strictObject({});
1328
+ var InputKeyboardSettingsResult = z19.strictObject({
1329
+ /** Key repeat is off (a held key types once). */
1330
+ repeat_off: z19.boolean().nullable(),
1331
+ /** Time between repeats while a key is held (Key repeat rate: shorter is faster). */
1332
+ repeat_interval_ms: nonNegInt.nullable(),
1333
+ /** Time a key is held before it starts repeating (Delay until repeat). */
1334
+ repeat_delay_ms: nonNegInt.nullable(),
1335
+ /** What the fn / globe key does alone. */
1336
+ fn_key: z19.enum(["nothing", "input_source", "emoji", "dictation"]).nullable(),
1337
+ /** Tab moves focus between every control. */
1338
+ keyboard_navigation: z19.boolean().nullable(),
1339
+ /** The enabled input sources by name ("U.S.", "ABC – Extended"). */
1340
+ input_sources: z19.array(z19.string().max(128)).max(64),
1341
+ /** A key repeat change takes effect only after the person logs out and in again (macOS). */
1342
+ applies_after_login: z19.boolean()
1343
+ });
1344
+ var InputSetKeyboardSettingsParams = z19.strictObject({
1345
+ repeat_off: z19.boolean().optional(),
1346
+ repeat_interval_ms: z19.int().min(15).max(2e3).optional(),
1347
+ repeat_delay_ms: z19.int().min(150).max(2e3).optional(),
1348
+ keyboard_navigation: z19.boolean().optional()
1349
+ });
1289
1350
 
1290
1351
  // src/schema/power.ts
1291
1352
  import { z as z20 } from "zod";
1353
+ var PowerEnergy = z20.strictObject({
1354
+ display_sleep_minutes: nonNegInt.nullable(),
1355
+ /** The computer itself sleeps after this long idle; null = never (Prevent automatic sleeping). */
1356
+ sleep_minutes: nonNegInt.nullable(),
1357
+ /** Hard disks sleep after this long; null = never. */
1358
+ disk_sleep_minutes: nonNegInt.nullable(),
1359
+ wake_for_network: z20.boolean().nullable(),
1360
+ restart_after_power_failure: z20.boolean().nullable(),
1361
+ /** Low Power Mode (Energy Mode "Low Power"). */
1362
+ low_power_mode: z20.boolean().nullable()
1363
+ });
1292
1364
  var PowerStatusParams = z20.strictObject({});
1293
1365
  var PowerStatusResult = z20.strictObject({
1294
1366
  has_battery: z20.boolean(),
@@ -1300,7 +1372,15 @@ var PowerStatusResult = z20.strictObject({
1300
1372
  /** Minutes of battery left; null when charging, unknown or without a battery. */
1301
1373
  minutes_left: nonNegInt.nullable(),
1302
1374
  /** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
1303
- awake_until_ms: epochMs.nullable()
1375
+ awake_until_ms: epochMs.nullable(),
1376
+ /** (1.24) The OS's own energy settings; absent where it keeps none Matrx 2 can read. */
1377
+ energy: PowerEnergy.optional()
1378
+ });
1379
+ var PowerHistoryParams = z20.strictObject({});
1380
+ var PowerHistoryPoint = z20.strictObject({ at_ms: epochMs, percent: z20.number().min(0).max(100), plugged_in: z20.boolean() });
1381
+ var PowerHistoryResult = z20.strictObject({
1382
+ /** Oldest first; empty without a battery or where the OS keeps no log. */
1383
+ points: z20.array(PowerHistoryPoint).max(5e3)
1304
1384
  });
1305
1385
  var PowerPreventSleepParams = z20.strictObject({
1306
1386
  /** Keep the computer awake this long; 0 lets it sleep again now. */
@@ -1319,7 +1399,10 @@ var AudioDevice = z21.strictObject({
1319
1399
  /** The OS's name for it, as audio.record takes it. */
1320
1400
  id: z21.string().min(1).max(256),
1321
1401
  name: z21.string().max(256),
1322
- default: z21.boolean()
1402
+ default: z21.boolean(),
1403
+ /** (1.24) How it is connected, as Sound's Type column says it: "Built-in", "USB", "Bluetooth",
1404
+ * "DisplayPort", "HDMI", "AirPlay", "Virtual". Absent where the OS does not say. */
1405
+ kind: z21.string().max(64).optional()
1323
1406
  });
1324
1407
  var AudioDevicesParams = z21.strictObject({});
1325
1408
  var AudioDevicesResult = z21.strictObject({
@@ -1342,6 +1425,20 @@ var AudioRecordResult = z21.strictObject({
1342
1425
  });
1343
1426
  var AudioPlayParams = z21.strictObject({ path: AbsPath });
1344
1427
  var AudioPlayResult = z21.strictObject({ path: AbsPath, seconds: z21.number().min(0) });
1428
+ var AudioLevelsParams = z21.strictObject({});
1429
+ var AudioLevelsResult = z21.strictObject({
1430
+ output_volume: z21.number().min(0).max(100).nullable(),
1431
+ output_muted: z21.boolean().nullable(),
1432
+ input_volume: z21.number().min(0).max(100).nullable(),
1433
+ /** The alert (beep) volume, a share of the output volume. */
1434
+ alert_volume: z21.number().min(0).max(100).nullable()
1435
+ });
1436
+ var AudioSetLevelsParams = z21.strictObject({
1437
+ output_volume: z21.number().min(0).max(100).optional(),
1438
+ output_muted: z21.boolean().optional(),
1439
+ input_volume: z21.number().min(0).max(100).optional(),
1440
+ alert_volume: z21.number().min(0).max(100).optional()
1441
+ });
1345
1442
 
1346
1443
  // src/schema/resources.ts
1347
1444
  import { z as z22 } from "zod";
@@ -2275,6 +2372,7 @@ var SpendLive = z30.strictObject({ id: ChatId, title: z30.string().max(1e3), win
2275
2372
  var SpendIdleScope = z30.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z30.number(), avoidable: z30.number() });
2276
2373
  var SpendIdle = z30.strictObject({ id: ChatId, chat: z30.string().max(1e3), who: z30.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
2277
2374
  var SpendStart = z30.strictObject({ repo: z30.string().max(200), count: nonNegInt, median: nonNegInt, latest: z30.array(nonNegInt).max(20), alarm: z30.string().max(400).nullable() });
2375
+ var SpendDay = z30.strictObject({ date: z30.string().regex(/^\d{4}-\d{2}-\d{2}$/), main: z30.number(), helpers: z30.number() });
2278
2376
  var AppsSpendParams = z30.strictObject({ app_key: AppKey });
2279
2377
  var AppsSpendResult = z30.strictObject({
2280
2378
  app_key: AppKey,
@@ -2291,6 +2389,8 @@ var AppsSpendResult = z30.strictObject({
2291
2389
  live: z30.array(SpendLive).max(200),
2292
2390
  accounts: z30.array(SpendAccount).max(200),
2293
2391
  models: z30.array(SpendModel).max(100),
2392
+ /** (1.24) The last 7 days, oldest first (today last). */
2393
+ days: z30.array(SpendDay).max(14).optional(),
2294
2394
  chats: z30.array(SpendChat).max(500),
2295
2395
  idle: z30.array(SpendIdle).max(500),
2296
2396
  starts: z30.array(SpendStart).max(200)
@@ -2316,6 +2416,7 @@ var AppsWindowsSaveNamesParams = z30.strictObject({ app_key: AppKey });
2316
2416
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
2317
2417
  var OPS = {
2318
2418
  "sysinfo.get": { params: SysinfoGetParams, result: SysinfoGetResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] },
2419
+ "sysinfo.hardware": { params: SysinfoHardwareParams, result: SysinfoHardwareResult, kind: "unary", since: "1.24", errors: ["INTERNAL"] },
2319
2420
  "fs.list": { params: FsListParams, result: FsListResult, kind: "unary", since: "1.0", errors: FS_ERR },
2320
2421
  "fs.stat": { params: FsStatParams, result: FsStatResult, kind: "unary", since: "1.0", errors: FS_ERR },
2321
2422
  "fs.read": { params: FsReadParams, result: FsReadResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "PAYLOAD_TOO_LARGE"] },
@@ -2392,6 +2493,7 @@ var OPS = {
2392
2493
  "exec.job.stop": { params: ExecJobStopParams, result: ExecJobStopResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS", "INTERNAL"] },
2393
2494
  "exec.job.list": { params: ExecJobListParams, result: ExecJobListResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
2394
2495
  "system.open_url": { params: SystemOpenUrlParams, result: SystemOpenUrlResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2496
+ "system.open_settings": { params: SystemOpenSettingsParams, result: SystemOpenSettingsResult, kind: "unary", since: "1.24", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2395
2497
  "system.open_path": { params: SystemOpenPathParams, result: SystemOpenPathResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2396
2498
  "system.notify": { params: SystemNotifyParams, result: SystemNotifyResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "INTERNAL"] },
2397
2499
  "screen.list": { params: ScreenListParams, result: ScreenListResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -2401,16 +2503,21 @@ var OPS = {
2401
2503
  "window.move": { params: WindowMoveParams, result: WindowMoveResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2402
2504
  "window.minimize": { params: WindowMinimizeParams, result: WindowMinimizeResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2403
2505
  "input.type_text": { params: InputTypeTextParams, result: InputTypeTextResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2506
+ "input.keyboard_settings": { params: InputKeyboardSettingsParams, result: InputKeyboardSettingsResult, kind: "unary", since: "1.24", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2507
+ "input.set_keyboard_settings": { params: InputSetKeyboardSettingsParams, result: InputKeyboardSettingsResult, kind: "unary", since: "1.24", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2404
2508
  "input.hotkey": { params: InputHotkeyParams, result: InputHotkeyResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2405
2509
  "input.mouse_move": { params: InputMouseMoveParams, result: InputMouseMoveResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2406
2510
  "input.mouse_click": { params: InputMouseClickParams, result: InputMouseClickResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2407
2511
  "power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
2512
+ "power.history": { params: PowerHistoryParams, result: PowerHistoryResult, kind: "unary", since: "1.24", errors: ["INTERNAL"] },
2408
2513
  "power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2409
2514
  "resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
2410
2515
  "resources.activity": { params: ResourcesActivityParams, result: ResourcesActivityResult, kind: "unary", since: "1.17", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2411
2516
  "resources.stop_job": { params: ResourcesStopJobParams, result: ResourcesStopJobResult, kind: "unary", since: "1.17", errors: ["NOT_FOUND", "CONFLICT", "AUTH_FORBIDDEN", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2412
2517
  "resources.incidents": { params: ResourcesIncidentsParams, result: ResourcesIncidentsResult, kind: "unary", since: "1.17", errors: ["INTERNAL"] },
2413
2518
  "audio.devices": { params: AudioDevicesParams, result: AudioDevicesResult, kind: "unary", since: "1.6", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2519
+ "audio.levels": { params: AudioLevelsParams, result: AudioLevelsResult, kind: "unary", since: "1.24", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2520
+ "audio.set_levels": { params: AudioSetLevelsParams, result: AudioLevelsResult, kind: "unary", since: "1.24", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2414
2521
  "audio.record": { params: AudioRecordParams, result: AudioRecordResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "RESOURCE_BUSY", "INTERNAL"] },
2415
2522
  "audio.play": { params: AudioPlayParams, result: AudioPlayResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2416
2523
  // The local AI Matrx servers (aidream's process-compose stack), supervised from Matrx 2's core.