@ai-matrx/desktop-protocol 0.12.0 → 0.14.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.cjs CHANGED
@@ -46,6 +46,10 @@ __export(src_exports, {
46
46
  CancelMsg: () => CancelMsg,
47
47
  ClientToCoreMsg: () => ClientToCoreMsg,
48
48
  ClientType: () => ClientType,
49
+ ClipboardReadParams: () => ClipboardReadParams,
50
+ ClipboardReadResult: () => ClipboardReadResult,
51
+ ClipboardWriteParams: () => ClipboardWriteParams,
52
+ ClipboardWriteResult: () => ClipboardWriteResult,
49
53
  CloseCode: () => CloseCode,
50
54
  CloseCodeValue: () => CloseCodeValue,
51
55
  ContractHash: () => ContractHash,
@@ -58,6 +62,7 @@ __export(src_exports, {
58
62
  DesktopProtocolError: () => DesktopProtocolError,
59
63
  DeviceId: () => DeviceId,
60
64
  EVENTS: () => EVENTS,
65
+ EXCLUDED_TOOLS: () => EXCLUDED_TOOLS,
61
66
  EndMsg: () => EndMsg,
62
67
  EndReason: () => EndReason,
63
68
  ErrorCode: () => ErrorCode,
@@ -148,6 +153,15 @@ __export(src_exports, {
148
153
  PROTOCOL_MAJOR: () => PROTOCOL_MAJOR,
149
154
  PROTOCOL_MINOR: () => PROTOCOL_MINOR,
150
155
  PROTOCOL_VERSION: () => PROTOCOL_VERSION,
156
+ ProcInfo: () => ProcInfo,
157
+ ProcKillParams: () => ProcKillParams,
158
+ ProcKillResult: () => ProcKillResult,
159
+ ProcListParams: () => ProcListParams,
160
+ ProcListResult: () => ProcListResult,
161
+ ProcPort: () => ProcPort,
162
+ ProcPortsParams: () => ProcPortsParams,
163
+ ProcPortsResult: () => ProcPortsResult,
164
+ ProcSort: () => ProcSort,
151
165
  ProtocolErrorBody: () => ProtocolErrorBody,
152
166
  ProtocolVersion: () => ProtocolVersion,
153
167
  PtyInfo: () => PtyInfo,
@@ -246,7 +260,7 @@ module.exports = __toCommonJS(src_exports);
246
260
  // src/schema/primitives.ts
247
261
  var import_zod = require("zod");
248
262
  var PROTOCOL_MAJOR = 1;
249
- var PROTOCOL_MINOR = 2;
263
+ var PROTOCOL_MINOR = 3;
250
264
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
251
265
  var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
252
266
  var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -1194,6 +1208,69 @@ var ToolResultsFile = import_zod13.z.strictObject({
1194
1208
  results: import_zod13.z.array(ToolLevelResult).max(1e4)
1195
1209
  });
1196
1210
 
1211
+ // src/schema/proc.ts
1212
+ var import_zod14 = require("zod");
1213
+ var ProcSort = import_zod14.z.enum(["cpu", "memory", "pid", "name"]);
1214
+ var ProcListParams = import_zod14.z.strictObject({
1215
+ /** Case-insensitive substring of the process name or its command line. */
1216
+ name: import_zod14.z.string().min(1).max(128).optional(),
1217
+ sort: ProcSort.default("cpu"),
1218
+ limit: import_zod14.z.int().min(1).max(500).default(50)
1219
+ });
1220
+ var ProcInfo = import_zod14.z.strictObject({
1221
+ pid: import_zod14.z.int().min(0),
1222
+ /** Parent process id; null where the OS does not report it. */
1223
+ ppid: import_zod14.z.int().min(0).nullable(),
1224
+ name: import_zod14.z.string().max(256),
1225
+ /** The command line, cut to 1024 characters. */
1226
+ command: import_zod14.z.string().max(1024),
1227
+ /** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
1228
+ cpu_percent: import_zod14.z.number().min(0).nullable(),
1229
+ memory_bytes: nonNegInt.nullable(),
1230
+ user: import_zod14.z.string().max(128).nullable()
1231
+ });
1232
+ var ProcListResult = import_zod14.z.strictObject({
1233
+ processes: import_zod14.z.array(ProcInfo).max(500),
1234
+ /** Processes that matched before `limit`. */
1235
+ total: nonNegInt,
1236
+ truncated: import_zod14.z.boolean()
1237
+ });
1238
+ var ProcPortsParams = import_zod14.z.strictObject({
1239
+ /** Only this port. */
1240
+ port: import_zod14.z.int().min(1).max(65535).optional()
1241
+ });
1242
+ var ProcPort = import_zod14.z.strictObject({
1243
+ port: import_zod14.z.int().min(1).max(65535),
1244
+ protocol: import_zod14.z.enum(["tcp", "udp"]),
1245
+ /** The local address it listens on ("127.0.0.1", "*", "::"). */
1246
+ address: import_zod14.z.string().max(64),
1247
+ pid: import_zod14.z.int().min(0).nullable(),
1248
+ process: import_zod14.z.string().max(256).nullable()
1249
+ });
1250
+ var ProcPortsResult = import_zod14.z.strictObject({ ports: import_zod14.z.array(ProcPort).max(4e3) });
1251
+ var ProcKillParams = import_zod14.z.strictObject({
1252
+ pid: import_zod14.z.int().min(1),
1253
+ /** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
1254
+ force: import_zod14.z.boolean().default(false)
1255
+ });
1256
+ var ProcKillResult = import_zod14.z.strictObject({
1257
+ pid: import_zod14.z.int().min(1),
1258
+ signal: import_zod14.z.enum(["SIGTERM", "SIGKILL"]),
1259
+ /** True when the process was gone within 3 s. */
1260
+ exited: import_zod14.z.boolean()
1261
+ });
1262
+
1263
+ // src/schema/clipboard.ts
1264
+ var import_zod15 = require("zod");
1265
+ var ClipboardReadParams = import_zod15.z.strictObject({});
1266
+ var ClipboardReadResult = import_zod15.z.strictObject({
1267
+ /** The clipboard's text ("" when it holds none), cut to 1 MiB. */
1268
+ text: import_zod15.z.string().max(1048576),
1269
+ truncated: import_zod15.z.boolean()
1270
+ });
1271
+ var ClipboardWriteParams = import_zod15.z.strictObject({ text: import_zod15.z.string().max(1048576) });
1272
+ var ClipboardWriteResult = import_zod15.z.strictObject({ bytes: nonNegInt });
1273
+
1197
1274
  // src/schema/registry.ts
1198
1275
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
1199
1276
  var OPS = {
@@ -1230,7 +1307,12 @@ var OPS = {
1230
1307
  "apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
1231
1308
  "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"] },
1232
1309
  "apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
1233
- "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] }
1310
+ "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] },
1311
+ "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1312
+ "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1313
+ "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
1314
+ "clipboard.read": { params: ClipboardReadParams, result: ClipboardReadResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
1315
+ "clipboard.write": { params: ClipboardWriteParams, result: ClipboardWriteResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] }
1234
1316
  };
1235
1317
  var EVENTS = {
1236
1318
  "fs.changed": FsChangedEvent,
@@ -1382,6 +1464,19 @@ var NAMED_SCHEMAS = {
1382
1464
  RelayHopEnvelopeHeader,
1383
1465
  RelayHopConnectionEnd,
1384
1466
  CloseCodeValue,
1467
+ ProcSort,
1468
+ ProcListParams,
1469
+ ProcInfo,
1470
+ ProcListResult,
1471
+ ProcPortsParams,
1472
+ ProcPort,
1473
+ ProcPortsResult,
1474
+ ProcKillParams,
1475
+ ProcKillResult,
1476
+ ClipboardReadParams,
1477
+ ClipboardReadResult,
1478
+ ClipboardWriteParams,
1479
+ ClipboardWriteResult,
1385
1480
  ToolLevel,
1386
1481
  ToolOutcome,
1387
1482
  ToolPlatform,
@@ -1487,7 +1582,7 @@ function forPeer(op, part, value, version) {
1487
1582
  var VERSIONED_RESULT_OPS = [...RESULT_PATH.keys()];
1488
1583
 
1489
1584
  // src/contract.ts
1490
- var CONTRACT_SHA256 = "ef9fd8c8ab611bf450730452a6cf48a4ebd566218b6e17e2834ef030fc2044cb";
1585
+ var CONTRACT_SHA256 = "0354e634fd50ffdc4c83b7ede7f9c31f3b2c877c4574557a6b264d2998470fd6";
1491
1586
 
1492
1587
  // src/close-policy.ts
1493
1588
  var CLOSE_RULES = {
@@ -1534,23 +1629,14 @@ var TOOL_CATALOG = [
1534
1629
  { name: "fs_list", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["fs.list"], platforms: ALL, summary: "List a folder" },
1535
1630
  { name: "fs_mkdir", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["fs.mkdir"], platforms: ALL, summary: "Create a folder" },
1536
1631
  { 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" },
1537
- { name: "shell_execute", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["exec.run"], platforms: ALL, summary: "Run a command in a folder" },
1632
+ { name: "shell_execute", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["exec.run"], platforms: ALL, summary: "Run a command; cd carries over" },
1538
1633
  { name: "shell_python", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["exec.run"], platforms: ALL, summary: "Run a Python script" },
1539
- {
1540
- name: "git_ingest",
1541
- group: "files_shell",
1542
- state: "broken",
1543
- path: "server",
1544
- ops: [],
1545
- platforms: ALL,
1546
- summary: "Digest a repository",
1547
- note: "Armed with the files tools, but a local path is read on the server, not the bound device"
1548
- },
1549
1634
  { 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" },
1550
1635
  // ── 2. Computer control (TS owners) ──────────────────────────────────────────────────────────
1551
- { 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" },
1636
+ { 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" },
1637
+ { name: "desktop_apps", group: "os_control", state: "planned", path: "device_op", ops: ["apps.list", "apps.open"], platforms: ALL, summary: "Installed apps; open or bring one forward" },
1552
1638
  { 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" },
1553
- { name: "desktop_clipboard", group: "os_control", state: "planned", path: "device_op", ops: ["clipboard.read", "clipboard.write"], platforms: ALL, summary: "Read and write the clipboard" },
1639
+ { 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" },
1554
1640
  { name: "desktop_screen", group: "os_control", state: "planned", path: "device_op", ops: ["screen.list", "screen.capture"], platforms: ALL, summary: "Displays and screenshots" },
1555
1641
  { 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" },
1556
1642
  { 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" },
@@ -1577,6 +1663,9 @@ var TOOL_CATALOG = [
1577
1663
  // ── 6. Windows administration ────────────────────────────────────────────────────────────────
1578
1664
  { name: "desktop_windows_admin", group: "windows_admin", state: "planned", path: "device_op", ops: ["windows.registry_read", "windows.registry_write", "windows.services", "windows.service_control", "windows.event_log", "windows.features"], platforms: ["win32"], summary: "Registry, services, event log" }
1579
1665
  ];
1666
+ var EXCLUDED_TOOLS = {
1667
+ git_ingest: "Runs on the server: it ingests repository URLs. A local path on a bound computer or sandbox is refused with the fs_* and shell remedy, since the server cannot see it"
1668
+ };
1580
1669
  var tool = (name) => ({ kind: "tool", tool: name });
1581
1670
  var dropped = (reason) => ({ kind: "dropped", reason });
1582
1671
  var SHELL_COVERS = "Done with shell_execute (mv, cp, rm, tar), as every coding agent does";
@@ -1605,12 +1694,12 @@ var LEGACY_ACTIONS = {
1605
1694
  "local_window.minimize": tool("desktop_window"),
1606
1695
  "local_process.list": tool("desktop_process"),
1607
1696
  "local_process.ports": tool("desktop_process"),
1608
- "local_process.launch_app": tool("desktop_process"),
1697
+ "local_process.launch_app": tool("desktop_apps"),
1609
1698
  "local_process.kill": tool("desktop_process"),
1610
- "local_process.focus_app": tool("desktop_process"),
1699
+ "local_process.focus_app": tool("desktop_apps"),
1611
1700
  "local_process.terminals": dropped("Matrx 2 terminals are exec sessions; the person's own terminal windows are not the agent's"),
1612
1701
  "local_process.tail_terminal": dropped("Matrx 2 terminals are exec sessions; the person's own terminal windows are not the agent's"),
1613
- "local_process.installed_apps": tool("desktop_process"),
1702
+ "local_process.installed_apps": tool("desktop_apps"),
1614
1703
  "local_input.type_text": tool("desktop_input"),
1615
1704
  "local_input.hotkey": tool("desktop_input"),
1616
1705
  "local_input.mouse_click": tool("desktop_input"),
@@ -1826,6 +1915,10 @@ function renderToolStatusMarkdown(status) {
1826
1915
  }
1827
1916
  lines.push("");
1828
1917
  }
1918
+ const excluded = Object.entries(EXCLUDED_TOOLS);
1919
+ if (excluded.length > 0) {
1920
+ lines.push("## Not device tools", "", "| Tool | Why |", "|---|---|", ...excluded.map(([name, why]) => `| ${name} | ${why} |`), "");
1921
+ }
1829
1922
  return lines.join("\n");
1830
1923
  }
1831
1924
  //# sourceMappingURL=index.cjs.map