@ai-matrx/desktop-protocol 0.13.0 → 0.15.0

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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/schema/primitives.ts
2
2
  import { z } from "zod";
3
3
  var PROTOCOL_MAJOR = 1;
4
- var PROTOCOL_MINOR = 2;
4
+ var PROTOCOL_MINOR = 4;
5
5
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
6
6
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
7
7
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -949,6 +949,404 @@ var ToolResultsFile = z13.strictObject({
949
949
  results: z13.array(ToolLevelResult).max(1e4)
950
950
  });
951
951
 
952
+ // src/schema/proc.ts
953
+ import { z as z14 } from "zod";
954
+ var ProcSort = z14.enum(["cpu", "memory", "pid", "name"]);
955
+ var ProcListParams = z14.strictObject({
956
+ /** Case-insensitive substring of the process name or its command line. */
957
+ name: z14.string().min(1).max(128).optional(),
958
+ sort: ProcSort.default("cpu"),
959
+ limit: z14.int().min(1).max(500).default(50)
960
+ });
961
+ var ProcInfo = z14.strictObject({
962
+ pid: z14.int().min(0),
963
+ /** Parent process id; null where the OS does not report it. */
964
+ ppid: z14.int().min(0).nullable(),
965
+ name: z14.string().max(256),
966
+ /** The command line, cut to 1024 characters. */
967
+ command: z14.string().max(1024),
968
+ /** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
969
+ cpu_percent: z14.number().min(0).nullable(),
970
+ memory_bytes: nonNegInt.nullable(),
971
+ user: z14.string().max(128).nullable()
972
+ });
973
+ var ProcListResult = z14.strictObject({
974
+ processes: z14.array(ProcInfo).max(500),
975
+ /** Processes that matched before `limit`. */
976
+ total: nonNegInt,
977
+ truncated: z14.boolean()
978
+ });
979
+ var ProcPortsParams = z14.strictObject({
980
+ /** Only this port. */
981
+ port: z14.int().min(1).max(65535).optional()
982
+ });
983
+ var ProcPort = z14.strictObject({
984
+ port: z14.int().min(1).max(65535),
985
+ protocol: z14.enum(["tcp", "udp"]),
986
+ /** The local address it listens on ("127.0.0.1", "*", "::"). */
987
+ address: z14.string().max(64),
988
+ pid: z14.int().min(0).nullable(),
989
+ process: z14.string().max(256).nullable()
990
+ });
991
+ var ProcPortsResult = z14.strictObject({ ports: z14.array(ProcPort).max(4e3) });
992
+ var ProcKillParams = z14.strictObject({
993
+ pid: z14.int().min(1),
994
+ /** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
995
+ force: z14.boolean().default(false)
996
+ });
997
+ var ProcKillResult = z14.strictObject({
998
+ pid: z14.int().min(1),
999
+ signal: z14.enum(["SIGTERM", "SIGKILL"]),
1000
+ /** True when the process was gone within 3 s. */
1001
+ exited: z14.boolean()
1002
+ });
1003
+
1004
+ // src/schema/clipboard.ts
1005
+ import { z as z15 } from "zod";
1006
+ var ClipboardReadParams = z15.strictObject({});
1007
+ var ClipboardReadResult = z15.strictObject({
1008
+ /** The clipboard's text ("" when it holds none), cut to 1 MiB. */
1009
+ text: z15.string().max(1048576),
1010
+ truncated: z15.boolean()
1011
+ });
1012
+ var ClipboardWriteParams = z15.strictObject({ text: z15.string().max(1048576) });
1013
+ var ClipboardWriteResult = z15.strictObject({ bytes: nonNegInt });
1014
+
1015
+ // src/schema/system.ts
1016
+ import { z as z16 } from "zod";
1017
+ var SystemOpenUrlParams = z16.strictObject({
1018
+ /** http, https or mailto; opened in the person's default app for it. */
1019
+ url: z16.string().min(1).max(4096)
1020
+ });
1021
+ var SystemOpenUrlResult = z16.strictObject({ url: z16.string().max(4096) });
1022
+ var SystemOpenPathParams = z16.strictObject({
1023
+ path: AbsPath,
1024
+ /** Show it in the file manager (Finder, Explorer) instead of opening it. */
1025
+ reveal: z16.boolean().default(false)
1026
+ });
1027
+ var SystemOpenPathResult = z16.strictObject({ path: AbsPath, revealed: z16.boolean() });
1028
+ var SystemNotifyParams = z16.strictObject({
1029
+ title: z16.string().min(1).max(128),
1030
+ body: z16.string().max(1024).default("")
1031
+ });
1032
+ var SystemNotifyResult = z16.strictObject({
1033
+ /** False when this computer has no notification service to show it (a bare Linux box). */
1034
+ shown: z16.boolean()
1035
+ });
1036
+
1037
+ // src/schema/screen.ts
1038
+ import { z as z17 } from "zod";
1039
+ var ScreenDisplay = z17.strictObject({
1040
+ /** The OS's display id; pass it to screen.capture. */
1041
+ id: nonNegInt,
1042
+ name: z17.string().max(128),
1043
+ /** Position and size in the OS's logical points (x and y may be negative left of or above the main display). */
1044
+ x: z17.int(),
1045
+ y: z17.int(),
1046
+ width: z17.int().min(1),
1047
+ height: z17.int().min(1),
1048
+ /** Pixels per point (2 on a Retina display). */
1049
+ scale: z17.number().min(0.1).max(8),
1050
+ primary: z17.boolean()
1051
+ });
1052
+ var ScreenListParams = z17.strictObject({});
1053
+ var ScreenListResult = z17.strictObject({ displays: z17.array(ScreenDisplay).max(32) });
1054
+ var ScreenCaptureParams = z17.strictObject({
1055
+ /** The display (from screen.list); the primary display when absent. */
1056
+ display_id: nonNegInt.optional(),
1057
+ format: z17.enum(["jpeg", "png"]).default("jpeg"),
1058
+ /** Scale the picture down to at most this width in pixels (kept when already smaller). */
1059
+ max_width: z17.int().min(160).max(7680).default(1600)
1060
+ });
1061
+ var ScreenCaptureResult = z17.strictObject({
1062
+ display_id: nonNegInt,
1063
+ mime_type: z17.enum(["image/jpeg", "image/png"]),
1064
+ width: z17.int().min(1),
1065
+ height: z17.int().min(1),
1066
+ /** The display's full resolution in pixels, before scaling. */
1067
+ source_width: z17.int().min(1),
1068
+ source_height: z17.int().min(1),
1069
+ /** The image, base64 (at most 6 MiB of text). */
1070
+ data_base64: z17.string().max(6291456)
1071
+ });
1072
+
1073
+ // src/schema/window.ts
1074
+ import { z as z18 } from "zod";
1075
+ var WindowInfo = z18.strictObject({
1076
+ /** The OS's window handle (macOS window number, Windows HWND, X11 window id). */
1077
+ id: nonNegInt,
1078
+ title: z18.string().max(512),
1079
+ /** Position and size in logical points. */
1080
+ x: z18.int(),
1081
+ y: z18.int(),
1082
+ width: z18.int().min(0),
1083
+ height: z18.int().min(0)
1084
+ });
1085
+ var WindowListParams = z18.strictObject({
1086
+ /** Case-insensitive substring of the window title. */
1087
+ title: z18.string().min(1).max(256).optional(),
1088
+ limit: z18.int().min(1).max(500).default(100)
1089
+ });
1090
+ var WindowListResult = z18.strictObject({
1091
+ windows: z18.array(WindowInfo).max(500),
1092
+ total: nonNegInt,
1093
+ truncated: z18.boolean()
1094
+ });
1095
+ var WindowFocusParams = z18.strictObject({ id: nonNegInt });
1096
+ var WindowFocusResult = z18.strictObject({ window: WindowInfo });
1097
+ var WindowMoveParams = z18.strictObject({
1098
+ id: nonNegInt,
1099
+ /** New top-left corner; unchanged when absent. */
1100
+ x: z18.int().optional(),
1101
+ y: z18.int().optional(),
1102
+ /** New size; unchanged when absent. */
1103
+ width: z18.int().min(50).max(16384).optional(),
1104
+ height: z18.int().min(50).max(16384).optional()
1105
+ });
1106
+ var WindowMoveResult = z18.strictObject({ window: WindowInfo });
1107
+ var WindowMinimizeParams = z18.strictObject({ id: nonNegInt });
1108
+ var WindowMinimizeResult = z18.strictObject({ id: nonNegInt });
1109
+
1110
+ // src/schema/input.ts
1111
+ import { z as z19 } from "zod";
1112
+ var InputKey = z19.enum([
1113
+ "cmd",
1114
+ "ctrl",
1115
+ "alt",
1116
+ "shift",
1117
+ "meta",
1118
+ "a",
1119
+ "b",
1120
+ "c",
1121
+ "d",
1122
+ "e",
1123
+ "f",
1124
+ "g",
1125
+ "h",
1126
+ "i",
1127
+ "j",
1128
+ "k",
1129
+ "l",
1130
+ "m",
1131
+ "n",
1132
+ "o",
1133
+ "p",
1134
+ "q",
1135
+ "r",
1136
+ "s",
1137
+ "t",
1138
+ "u",
1139
+ "v",
1140
+ "w",
1141
+ "x",
1142
+ "y",
1143
+ "z",
1144
+ "0",
1145
+ "1",
1146
+ "2",
1147
+ "3",
1148
+ "4",
1149
+ "5",
1150
+ "6",
1151
+ "7",
1152
+ "8",
1153
+ "9",
1154
+ "f1",
1155
+ "f2",
1156
+ "f3",
1157
+ "f4",
1158
+ "f5",
1159
+ "f6",
1160
+ "f7",
1161
+ "f8",
1162
+ "f9",
1163
+ "f10",
1164
+ "f11",
1165
+ "f12",
1166
+ "enter",
1167
+ "tab",
1168
+ "escape",
1169
+ "space",
1170
+ "backspace",
1171
+ "delete",
1172
+ "up",
1173
+ "down",
1174
+ "left",
1175
+ "right",
1176
+ "home",
1177
+ "end",
1178
+ "pageup",
1179
+ "pagedown",
1180
+ "minus",
1181
+ "equal",
1182
+ "comma",
1183
+ "period",
1184
+ "slash",
1185
+ "semicolon",
1186
+ "quote",
1187
+ "bracketleft",
1188
+ "bracketright",
1189
+ "backslash",
1190
+ "grave"
1191
+ ]);
1192
+ var InputTypeTextParams = z19.strictObject({ text: z19.string().min(1).max(1e4) });
1193
+ var InputTypeTextResult = z19.strictObject({ characters: z19.int().min(1) });
1194
+ var InputHotkeyParams = z19.strictObject({
1195
+ /** Pressed together in order and released in reverse: ["cmd", "shift", "t"]. */
1196
+ keys: z19.array(InputKey).min(1).max(6)
1197
+ });
1198
+ var InputHotkeyResult = z19.strictObject({ keys: z19.array(InputKey) });
1199
+ var InputPoint = z19.strictObject({ x: z19.int(), y: z19.int() });
1200
+ var InputMouseMoveParams = z19.strictObject({
1201
+ /** Screen position in logical points (the coordinates screen.list and window.list report). */
1202
+ x: z19.int(),
1203
+ y: z19.int()
1204
+ });
1205
+ var InputMouseMoveResult = z19.strictObject({
1206
+ /** Where the pointer is now, read back from the OS. */
1207
+ position: InputPoint
1208
+ });
1209
+ var InputMouseClickParams = z19.strictObject({
1210
+ /** Move here first; clicks where the pointer is when absent. */
1211
+ x: z19.int().optional(),
1212
+ y: z19.int().optional(),
1213
+ button: z19.enum(["left", "right", "middle"]).default("left"),
1214
+ double: z19.boolean().default(false)
1215
+ });
1216
+ var InputMouseClickResult = z19.strictObject({
1217
+ position: InputPoint,
1218
+ button: z19.enum(["left", "right", "middle"]),
1219
+ double: z19.boolean()
1220
+ });
1221
+
1222
+ // src/schema/power.ts
1223
+ import { z as z20 } from "zod";
1224
+ var PowerStatusParams = z20.strictObject({});
1225
+ var PowerStatusResult = z20.strictObject({
1226
+ has_battery: z20.boolean(),
1227
+ /** 0–100; null without a battery. */
1228
+ percent: z20.number().min(0).max(100).nullable(),
1229
+ charging: z20.boolean().nullable(),
1230
+ /** On wall power; null where the OS does not say. */
1231
+ plugged_in: z20.boolean().nullable(),
1232
+ /** Minutes of battery left; null when charging, unknown or without a battery. */
1233
+ minutes_left: nonNegInt.nullable(),
1234
+ /** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
1235
+ awake_until_ms: epochMs.nullable()
1236
+ });
1237
+ var PowerPreventSleepParams = z20.strictObject({
1238
+ /** Keep the computer awake this long; 0 lets it sleep again now. */
1239
+ seconds: z20.int().min(0).max(86400),
1240
+ /** Shown where the OS lists what keeps it awake. */
1241
+ reason: z20.string().min(1).max(128).default("Matrx 2 is working")
1242
+ });
1243
+ var PowerPreventSleepResult = z20.strictObject({
1244
+ /** When it may sleep again; null after seconds 0. */
1245
+ awake_until_ms: epochMs.nullable()
1246
+ });
1247
+
1248
+ // src/schema/resources.ts
1249
+ import { z as z21 } from "zod";
1250
+ var ResourcesDisk = z21.strictObject({
1251
+ /** Where it is mounted ("/", "C:"). */
1252
+ mount: z21.string().max(512),
1253
+ /** The file system ("apfs", "NTFS", "ext4"). */
1254
+ fs: z21.string().max(64),
1255
+ size_bytes: nonNegInt,
1256
+ used_bytes: nonNegInt,
1257
+ available_bytes: nonNegInt
1258
+ });
1259
+ var ResourcesSnapshotParams = z21.strictObject({});
1260
+ var ResourcesSnapshotResult = z21.strictObject({
1261
+ cpu: z21.strictObject({
1262
+ /** Busy share of all cores, 0–100, measured now. */
1263
+ percent: z21.number().min(0).max(100),
1264
+ cores: z21.int().min(1),
1265
+ /** 1, 5 and 15 minute load averages; null on Windows. */
1266
+ load: z21.array(z21.number().min(0)).length(3).nullable()
1267
+ }),
1268
+ memory: z21.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
1269
+ swap: z21.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
1270
+ disks: z21.array(ResourcesDisk).max(64),
1271
+ uptime_seconds: nonNegInt
1272
+ });
1273
+
1274
+ // src/schema/fs-watch.ts
1275
+ import { z as z22 } from "zod";
1276
+ var FsWatchId = z22.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1277
+ var FsWatchStartParams = z22.strictObject({
1278
+ path: AbsPath,
1279
+ recursive: z22.boolean().default(true),
1280
+ /** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
1281
+ ignore: z22.array(z22.string().max(256)).max(64).default([])
1282
+ });
1283
+ var FsWatchStartResult = z22.strictObject({
1284
+ watch_id: FsWatchId,
1285
+ path: AbsPath,
1286
+ /** The watch ends by itself if nobody reads it for 30 minutes. */
1287
+ expires_at_ms: epochMs
1288
+ });
1289
+ var FsWatchEventsParams = z22.strictObject({
1290
+ watch_id: FsWatchId,
1291
+ /** Wait up to this long for a first change when none is waiting (0 answers at once). */
1292
+ wait_ms: z22.int().min(0).max(25e3).default(0)
1293
+ });
1294
+ var FsWatchEventsResult = z22.strictObject({
1295
+ /** What changed since the last read, oldest first; re-checked against the disk when read. */
1296
+ changes: z22.array(FsChange).max(1e3),
1297
+ /** Changes were dropped (more than 1000 waited): list the folder again. */
1298
+ overflow: z22.boolean(),
1299
+ expires_at_ms: epochMs
1300
+ });
1301
+ var FsWatchStopParams = z22.strictObject({ watch_id: FsWatchId });
1302
+ var FsWatchStopResult = z22.strictObject({ watch_id: FsWatchId });
1303
+
1304
+ // src/schema/exec-job.ts
1305
+ import { z as z23 } from "zod";
1306
+ var ExecJobId = z23.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1307
+ var ExecJobStartParams = z23.strictObject({
1308
+ command: z23.string().min(1).max(131072),
1309
+ /** The folder it runs in; the home folder when absent. */
1310
+ cwd: AbsPath.optional(),
1311
+ env: z23.record(z23.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z23.string().max(32768)).optional()
1312
+ });
1313
+ var ExecJobStartResult = z23.strictObject({ job_id: ExecJobId, pid: z23.int().min(1), cwd: AbsPath });
1314
+ var ExecJobOutputParams = z23.strictObject({
1315
+ job_id: ExecJobId,
1316
+ /** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
1317
+ offset: nonNegInt.default(0),
1318
+ /** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
1319
+ wait_ms: z23.int().min(0).max(25e3).default(0),
1320
+ max_bytes: z23.int().min(1024).max(1048576).default(65536)
1321
+ });
1322
+ var ExecJobOutputResult = z23.strictObject({
1323
+ /** stdout and stderr interleaved as they arrived (UTF-8). */
1324
+ output: z23.string(),
1325
+ next_offset: nonNegInt,
1326
+ /** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
1327
+ dropped_bytes: nonNegInt,
1328
+ running: z23.boolean(),
1329
+ exit_code: z23.int().nullable()
1330
+ });
1331
+ var ExecJobStopParams = z23.strictObject({
1332
+ job_id: ExecJobId,
1333
+ /** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
1334
+ force: z23.boolean().default(false)
1335
+ });
1336
+ var ExecJobStopResult = z23.strictObject({ job_id: ExecJobId, exited: z23.boolean(), exit_code: z23.int().nullable() });
1337
+ var ExecJobInfo = z23.strictObject({
1338
+ job_id: ExecJobId,
1339
+ command: z23.string().max(1024),
1340
+ pid: z23.int().min(1),
1341
+ cwd: AbsPath,
1342
+ running: z23.boolean(),
1343
+ exit_code: z23.int().nullable(),
1344
+ started_at_ms: epochMs,
1345
+ output_bytes: nonNegInt
1346
+ });
1347
+ var ExecJobListParams = z23.strictObject({});
1348
+ var ExecJobListResult = z23.strictObject({ jobs: z23.array(ExecJobInfo).max(64) });
1349
+
952
1350
  // src/schema/registry.ts
953
1351
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
954
1352
  var OPS = {
@@ -985,7 +1383,35 @@ var OPS = {
985
1383
  "apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
986
1384
  "apps.profiles.save": { params: AppsProfilesSaveParams, result: AppsProfilesSaveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "DEVICE_OFFLINE", "INTERNAL"] },
987
1385
  "apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
988
- "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] }
1386
+ "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] },
1387
+ "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1388
+ "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1389
+ "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
1390
+ "clipboard.read": { params: ClipboardReadParams, result: ClipboardReadResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
1391
+ "clipboard.write": { params: ClipboardWriteParams, result: ClipboardWriteResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
1392
+ "fs.watch.start": { params: FsWatchStartParams, result: FsWatchStartResult, kind: "unary", since: "1.4", errors: [...FS_ERR, "RATE_LIMITED"] },
1393
+ "fs.watch.events": { params: FsWatchEventsParams, result: FsWatchEventsResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS", "INTERNAL"] },
1394
+ "fs.watch.stop": { params: FsWatchStopParams, result: FsWatchStopResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS"] },
1395
+ "exec.job.start": { params: ExecJobStartParams, result: ExecJobStartResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "NOT_FOUND", "RATE_LIMITED", "INTERNAL"] },
1396
+ "exec.job.output": { params: ExecJobOutputParams, result: ExecJobOutputResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS"] },
1397
+ "exec.job.stop": { params: ExecJobStopParams, result: ExecJobStopResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS", "INTERNAL"] },
1398
+ "exec.job.list": { params: ExecJobListParams, result: ExecJobListResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
1399
+ "system.open_url": { params: SystemOpenUrlParams, result: SystemOpenUrlResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1400
+ "system.open_path": { params: SystemOpenPathParams, result: SystemOpenPathResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1401
+ "system.notify": { params: SystemNotifyParams, result: SystemNotifyResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "INTERNAL"] },
1402
+ "screen.list": { params: ScreenListParams, result: ScreenListResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1403
+ "screen.capture": { params: ScreenCaptureParams, result: ScreenCaptureResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
1404
+ "window.list": { params: WindowListParams, result: WindowListResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1405
+ "window.focus": { params: WindowFocusParams, result: WindowFocusResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1406
+ "window.move": { params: WindowMoveParams, result: WindowMoveResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1407
+ "window.minimize": { params: WindowMinimizeParams, result: WindowMinimizeResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1408
+ "input.type_text": { params: InputTypeTextParams, result: InputTypeTextResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1409
+ "input.hotkey": { params: InputHotkeyParams, result: InputHotkeyResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1410
+ "input.mouse_move": { params: InputMouseMoveParams, result: InputMouseMoveResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1411
+ "input.mouse_click": { params: InputMouseClickParams, result: InputMouseClickResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1412
+ "power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
1413
+ "power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1414
+ "resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] }
989
1415
  };
990
1416
  var EVENTS = {
991
1417
  "fs.changed": FsChangedEvent,
@@ -1137,6 +1563,73 @@ var NAMED_SCHEMAS = {
1137
1563
  RelayHopEnvelopeHeader,
1138
1564
  RelayHopConnectionEnd,
1139
1565
  CloseCodeValue,
1566
+ ProcSort,
1567
+ ProcListParams,
1568
+ ProcInfo,
1569
+ ProcListResult,
1570
+ ProcPortsParams,
1571
+ ProcPort,
1572
+ ProcPortsResult,
1573
+ ProcKillParams,
1574
+ ProcKillResult,
1575
+ ClipboardReadParams,
1576
+ ClipboardReadResult,
1577
+ ClipboardWriteParams,
1578
+ ClipboardWriteResult,
1579
+ SystemOpenUrlParams,
1580
+ SystemOpenUrlResult,
1581
+ SystemOpenPathParams,
1582
+ SystemOpenPathResult,
1583
+ SystemNotifyParams,
1584
+ SystemNotifyResult,
1585
+ ScreenDisplay,
1586
+ ScreenListParams,
1587
+ ScreenListResult,
1588
+ ScreenCaptureParams,
1589
+ ScreenCaptureResult,
1590
+ WindowInfo,
1591
+ WindowListParams,
1592
+ WindowListResult,
1593
+ WindowFocusParams,
1594
+ WindowFocusResult,
1595
+ WindowMoveParams,
1596
+ WindowMoveResult,
1597
+ WindowMinimizeParams,
1598
+ WindowMinimizeResult,
1599
+ InputKey,
1600
+ InputPoint,
1601
+ InputTypeTextParams,
1602
+ InputTypeTextResult,
1603
+ InputHotkeyParams,
1604
+ InputHotkeyResult,
1605
+ InputMouseMoveParams,
1606
+ InputMouseMoveResult,
1607
+ InputMouseClickParams,
1608
+ InputMouseClickResult,
1609
+ PowerStatusParams,
1610
+ PowerStatusResult,
1611
+ PowerPreventSleepParams,
1612
+ PowerPreventSleepResult,
1613
+ ResourcesDisk,
1614
+ ResourcesSnapshotParams,
1615
+ ResourcesSnapshotResult,
1616
+ FsWatchId,
1617
+ FsWatchStartParams,
1618
+ FsWatchStartResult,
1619
+ FsWatchEventsParams,
1620
+ FsWatchEventsResult,
1621
+ FsWatchStopParams,
1622
+ FsWatchStopResult,
1623
+ ExecJobId,
1624
+ ExecJobStartParams,
1625
+ ExecJobStartResult,
1626
+ ExecJobOutputParams,
1627
+ ExecJobOutputResult,
1628
+ ExecJobStopParams,
1629
+ ExecJobStopResult,
1630
+ ExecJobInfo,
1631
+ ExecJobListParams,
1632
+ ExecJobListResult,
1140
1633
  ToolLevel,
1141
1634
  ToolOutcome,
1142
1635
  ToolPlatform,
@@ -1242,7 +1735,7 @@ function forPeer(op, part, value, version) {
1242
1735
  var VERSIONED_RESULT_OPS = [...RESULT_PATH.keys()];
1243
1736
 
1244
1737
  // src/contract.ts
1245
- var CONTRACT_SHA256 = "ef9fd8c8ab611bf450730452a6cf48a4ebd566218b6e17e2834ef030fc2044cb";
1738
+ var CONTRACT_SHA256 = "a5378bb523cbf52619f16e2accc788931ffb443e762052db4ca42c598792c181";
1246
1739
 
1247
1740
  // src/close-policy.ts
1248
1741
  var CLOSE_RULES = {
@@ -1291,18 +1784,19 @@ var TOOL_CATALOG = [
1291
1784
  { name: "fs_search", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["fs.search_paths", "fs.search_content"], platforms: ALL, summary: "Find files by name or content" },
1292
1785
  { name: "shell_execute", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["exec.run"], platforms: ALL, summary: "Run a command; cd carries over" },
1293
1786
  { name: "shell_python", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["exec.run"], platforms: ALL, summary: "Run a Python script" },
1294
- { name: "shell_job", group: "files_shell", state: "planned", path: "device_op", ops: ["exec.job.start", "exec.job.output", "exec.job.stop"], platforms: ALL, summary: "Background commands: start, read output, stop" },
1787
+ { name: "shell_job", group: "files_shell", state: "built", path: "device_op", ops: ["exec.job.start", "exec.job.output", "exec.job.stop", "exec.job.list"], platforms: ALL, summary: "Background commands: start, read output, stop" },
1295
1788
  // ── 2. Computer control (TS owners) ──────────────────────────────────────────────────────────
1296
- { name: "desktop_process", group: "os_control", state: "planned", path: "device_op", ops: ["proc.list", "proc.ports", "proc.kill", "proc.launch_app", "proc.focus_app", "proc.installed_apps"], platforms: ALL, summary: "Processes, ports and apps" },
1297
- { name: "desktop_system", group: "os_control", state: "planned", path: "device_op", ops: ["sysinfo.get", "system.open_url", "system.open_path", "system.notify"], platforms: ALL, summary: "System facts, open, notify" },
1298
- { name: "desktop_clipboard", group: "os_control", state: "planned", path: "device_op", ops: ["clipboard.read", "clipboard.write"], platforms: ALL, summary: "Read and write the clipboard" },
1299
- { name: "desktop_screen", group: "os_control", state: "planned", path: "device_op", ops: ["screen.list", "screen.capture"], platforms: ALL, summary: "Displays and screenshots" },
1300
- { name: "desktop_window", group: "os_control", state: "planned", path: "device_op", ops: ["window.list", "window.focus", "window.move", "window.minimize"], platforms: ALL, summary: "Find, focus and arrange windows" },
1301
- { name: "desktop_input", group: "os_control", state: "planned", path: "device_op", ops: ["input.type_text", "input.hotkey", "input.mouse_click", "input.mouse_move"], platforms: ALL, summary: "Keyboard and mouse" },
1789
+ { name: "desktop_process", group: "os_control", state: "built", path: "device_op", ops: ["proc.list", "proc.ports", "proc.kill"], platforms: ALL, summary: "Running processes and ports; stop one" },
1790
+ { name: "desktop_apps", group: "os_control", state: "built", path: "device_op", ops: ["apps.list", "apps.open"], platforms: ALL, summary: "Installed apps; open or bring one forward" },
1791
+ { name: "desktop_system", group: "os_control", state: "built", path: "device_op", ops: ["sysinfo.get", "system.open_url", "system.open_path", "system.notify"], platforms: ALL, summary: "System facts, open, notify" },
1792
+ { name: "desktop_clipboard", group: "os_control", state: "built", path: "device_op", ops: ["clipboard.read", "clipboard.write"], platforms: ALL, summary: "Read and write the clipboard's text" },
1793
+ { name: "desktop_screen", group: "os_control", state: "built", path: "device_op", ops: ["screen.list", "screen.capture"], platforms: ALL, summary: "Displays and screenshots" },
1794
+ { name: "desktop_window", group: "os_control", state: "built", path: "device_op", ops: ["window.list", "window.focus", "window.move", "window.minimize"], platforms: ALL, summary: "Find, focus and arrange windows" },
1795
+ { name: "desktop_input", group: "os_control", state: "built", path: "device_op", ops: ["input.type_text", "input.hotkey", "input.mouse_click", "input.mouse_move"], platforms: ALL, summary: "Keyboard and mouse" },
1302
1796
  { name: "desktop_audio", group: "os_control", state: "planned", path: "device_op", ops: ["audio.devices", "audio.record", "audio.play"], platforms: ALL, summary: "Audio devices, record, play" },
1303
- { name: "desktop_power", group: "os_control", state: "planned", path: "device_op", ops: ["power.status", "power.prevent_sleep"], platforms: ALL, summary: "Battery and keep awake" },
1304
- { name: "desktop_resources", group: "os_control", state: "planned", path: "device_op", ops: ["resources.snapshot", "resources.top"], platforms: ALL, summary: "CPU, memory and disk use" },
1305
- { name: "fs_watch", group: "os_control", state: "planned", path: "device_op", ops: ["fs.watch"], platforms: ALL, summary: "Watch a folder for changes" },
1797
+ { name: "desktop_power", group: "os_control", state: "built", path: "device_op", ops: ["power.status", "power.prevent_sleep"], platforms: ALL, summary: "Battery and keep awake" },
1798
+ { name: "desktop_resources", group: "os_control", state: "built", path: "device_op", ops: ["resources.snapshot"], platforms: ALL, summary: "CPU, memory and disk use" },
1799
+ { name: "fs_watch", group: "os_control", state: "built", path: "device_op", ops: ["fs.watch.start", "fs.watch.events", "fs.watch.stop"], platforms: ALL, summary: "Watch a folder; read what changed" },
1306
1800
  // ── 3. Personal apps and automation ──────────────────────────────────────────────────────────
1307
1801
  { name: "desktop_automation", group: "personal_automation", state: "planned", path: "device_op", ops: ["automation.script"], platforms: ["darwin", "win32"], summary: "AppleScript on a Mac, PowerShell on Windows" },
1308
1802
  { name: "desktop_mail", group: "personal_automation", state: "planned", path: "device_op", ops: ["mail.accounts", "mail.list", "mail.send"], platforms: ["darwin"], summary: "The Mail app" },
@@ -1353,12 +1847,12 @@ var LEGACY_ACTIONS = {
1353
1847
  "local_window.minimize": tool("desktop_window"),
1354
1848
  "local_process.list": tool("desktop_process"),
1355
1849
  "local_process.ports": tool("desktop_process"),
1356
- "local_process.launch_app": tool("desktop_process"),
1850
+ "local_process.launch_app": tool("desktop_apps"),
1357
1851
  "local_process.kill": tool("desktop_process"),
1358
- "local_process.focus_app": tool("desktop_process"),
1852
+ "local_process.focus_app": tool("desktop_apps"),
1359
1853
  "local_process.terminals": dropped("Matrx 2 terminals are exec sessions; the person's own terminal windows are not the agent's"),
1360
1854
  "local_process.tail_terminal": dropped("Matrx 2 terminals are exec sessions; the person's own terminal windows are not the agent's"),
1361
- "local_process.installed_apps": tool("desktop_process"),
1855
+ "local_process.installed_apps": tool("desktop_apps"),
1362
1856
  "local_input.type_text": tool("desktop_input"),
1363
1857
  "local_input.hotkey": tool("desktop_input"),
1364
1858
  "local_input.mouse_click": tool("desktop_input"),
@@ -1403,7 +1897,7 @@ var LEGACY_ACTIONS = {
1403
1897
  "local_monitor.resources": tool("desktop_resources"),
1404
1898
  "local_monitor.battery": tool("desktop_power"),
1405
1899
  "local_monitor.disk_usage": tool("desktop_resources"),
1406
- "local_monitor.top_processes": tool("desktop_resources"),
1900
+ "local_monitor.top_processes": tool("desktop_process"),
1407
1901
  "local_monitor.watch_directory": tool("fs_watch"),
1408
1902
  "local_monitor.watch_events": tool("fs_watch"),
1409
1903
  "local_monitor.stop_watch": tool("fs_watch"),
@@ -1607,6 +2101,10 @@ export {
1607
2101
  CancelMsg,
1608
2102
  ClientToCoreMsg,
1609
2103
  ClientType,
2104
+ ClipboardReadParams,
2105
+ ClipboardReadResult,
2106
+ ClipboardWriteParams,
2107
+ ClipboardWriteResult,
1610
2108
  CloseCode,
1611
2109
  CloseCodeValue,
1612
2110
  ContractHash,
@@ -1628,6 +2126,16 @@ export {
1628
2126
  EventMsg,
1629
2127
  ExecCwdEvent,
1630
2128
  ExecExitedEvent,
2129
+ ExecJobId,
2130
+ ExecJobInfo,
2131
+ ExecJobListParams,
2132
+ ExecJobListResult,
2133
+ ExecJobOutputParams,
2134
+ ExecJobOutputResult,
2135
+ ExecJobStartParams,
2136
+ ExecJobStartResult,
2137
+ ExecJobStopParams,
2138
+ ExecJobStopResult,
1631
2139
  ExecListParams,
1632
2140
  ExecListResult,
1633
2141
  ExecPtyKillParams,
@@ -1677,11 +2185,28 @@ export {
1677
2185
  FsSearchPathsResult,
1678
2186
  FsStatParams,
1679
2187
  FsStatResult,
2188
+ FsWatchEventsParams,
2189
+ FsWatchEventsResult,
2190
+ FsWatchId,
1680
2191
  FsWatchParams,
1681
2192
  FsWatchResult,
2193
+ FsWatchStartParams,
2194
+ FsWatchStartResult,
2195
+ FsWatchStopParams,
2196
+ FsWatchStopResult,
1682
2197
  FsWriteParams,
1683
2198
  FsWriteResult,
1684
2199
  HelloMsg,
2200
+ InputHotkeyParams,
2201
+ InputHotkeyResult,
2202
+ InputKey,
2203
+ InputMouseClickParams,
2204
+ InputMouseClickResult,
2205
+ InputMouseMoveParams,
2206
+ InputMouseMoveResult,
2207
+ InputPoint,
2208
+ InputTypeTextParams,
2209
+ InputTypeTextResult,
1685
2210
  LEGACY_ACTIONS,
1686
2211
  LEGACY_DISPATCHERS,
1687
2212
  Limits,
@@ -1710,6 +2235,19 @@ export {
1710
2235
  PROTOCOL_MAJOR,
1711
2236
  PROTOCOL_MINOR,
1712
2237
  PROTOCOL_VERSION,
2238
+ PowerPreventSleepParams,
2239
+ PowerPreventSleepResult,
2240
+ PowerStatusParams,
2241
+ PowerStatusResult,
2242
+ ProcInfo,
2243
+ ProcKillParams,
2244
+ ProcKillResult,
2245
+ ProcListParams,
2246
+ ProcListResult,
2247
+ ProcPort,
2248
+ ProcPortsParams,
2249
+ ProcPortsResult,
2250
+ ProcSort,
1713
2251
  ProtocolErrorBody,
1714
2252
  ProtocolVersion,
1715
2253
  PtyInfo,
@@ -1731,10 +2269,18 @@ export {
1731
2269
  RequestMsg,
1732
2270
  ResourceId,
1733
2271
  ResourceInfo,
2272
+ ResourcesDisk,
2273
+ ResourcesSnapshotParams,
2274
+ ResourcesSnapshotResult,
1734
2275
  ResponseMsg,
1735
2276
  SERVICES,
1736
2277
  SERVICE_MAX_FRAME_BYTES,
1737
2278
  SUBPROTOCOL,
2279
+ ScreenCaptureParams,
2280
+ ScreenCaptureResult,
2281
+ ScreenDisplay,
2282
+ ScreenListParams,
2283
+ ScreenListResult,
1738
2284
  ServiceCancel,
1739
2285
  ServiceErrorMsg,
1740
2286
  ServiceHello,
@@ -1762,6 +2308,12 @@ export {
1762
2308
  StreamMsg,
1763
2309
  SysinfoGetParams,
1764
2310
  SysinfoGetResult,
2311
+ SystemNotifyParams,
2312
+ SystemNotifyResult,
2313
+ SystemOpenPathParams,
2314
+ SystemOpenPathResult,
2315
+ SystemOpenUrlParams,
2316
+ SystemOpenUrlResult,
1765
2317
  TOOL_CATALOG,
1766
2318
  TOOL_GROUPS,
1767
2319
  TOOL_LEVELS,
@@ -1778,6 +2330,15 @@ export {
1778
2330
  TranscriptionModelInfo,
1779
2331
  VERSIONED_RESULT_OPS,
1780
2332
  Welcome,
2333
+ WindowFocusParams,
2334
+ WindowFocusResult,
2335
+ WindowInfo,
2336
+ WindowListParams,
2337
+ WindowListResult,
2338
+ WindowMinimizeParams,
2339
+ WindowMinimizeResult,
2340
+ WindowMoveParams,
2341
+ WindowMoveResult,
1781
2342
  announcedVersion,
1782
2343
  assertFrameHeader,
1783
2344
  buildToolStatus,