@ai-matrx/desktop-protocol 0.13.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/CHANGELOG.md +10 -0
- package/dist/client.cjs +106 -38
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +106 -38
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +103 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -6
- package/dist/index.d.ts +117 -6
- package/dist/index.js +103 -8
- package/dist/index.js.map +1 -1
- package/dist/{models-CxAHZMAM.d.cts → models-DqFPqtNS.d.cts} +173 -1
- package/dist/{models-CxAHZMAM.d.ts → models-DqFPqtNS.d.ts} +173 -1
- package/dist/react.d.cts +86 -0
- package/dist/react.d.ts +86 -0
- package/generated/desktop-protocol.schema.json +360 -1
- package/package.json +1 -1
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,
|
|
@@ -149,6 +153,15 @@ __export(src_exports, {
|
|
|
149
153
|
PROTOCOL_MAJOR: () => PROTOCOL_MAJOR,
|
|
150
154
|
PROTOCOL_MINOR: () => PROTOCOL_MINOR,
|
|
151
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,
|
|
152
165
|
ProtocolErrorBody: () => ProtocolErrorBody,
|
|
153
166
|
ProtocolVersion: () => ProtocolVersion,
|
|
154
167
|
PtyInfo: () => PtyInfo,
|
|
@@ -247,7 +260,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
247
260
|
// src/schema/primitives.ts
|
|
248
261
|
var import_zod = require("zod");
|
|
249
262
|
var PROTOCOL_MAJOR = 1;
|
|
250
|
-
var PROTOCOL_MINOR =
|
|
263
|
+
var PROTOCOL_MINOR = 3;
|
|
251
264
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
252
265
|
var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
253
266
|
var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -1195,6 +1208,69 @@ var ToolResultsFile = import_zod13.z.strictObject({
|
|
|
1195
1208
|
results: import_zod13.z.array(ToolLevelResult).max(1e4)
|
|
1196
1209
|
});
|
|
1197
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
|
+
|
|
1198
1274
|
// src/schema/registry.ts
|
|
1199
1275
|
var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
|
|
1200
1276
|
var OPS = {
|
|
@@ -1231,7 +1307,12 @@ var OPS = {
|
|
|
1231
1307
|
"apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
|
|
1232
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"] },
|
|
1233
1309
|
"apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
|
|
1234
|
-
"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"] }
|
|
1235
1316
|
};
|
|
1236
1317
|
var EVENTS = {
|
|
1237
1318
|
"fs.changed": FsChangedEvent,
|
|
@@ -1383,6 +1464,19 @@ var NAMED_SCHEMAS = {
|
|
|
1383
1464
|
RelayHopEnvelopeHeader,
|
|
1384
1465
|
RelayHopConnectionEnd,
|
|
1385
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,
|
|
1386
1480
|
ToolLevel,
|
|
1387
1481
|
ToolOutcome,
|
|
1388
1482
|
ToolPlatform,
|
|
@@ -1488,7 +1582,7 @@ function forPeer(op, part, value, version) {
|
|
|
1488
1582
|
var VERSIONED_RESULT_OPS = [...RESULT_PATH.keys()];
|
|
1489
1583
|
|
|
1490
1584
|
// src/contract.ts
|
|
1491
|
-
var CONTRACT_SHA256 = "
|
|
1585
|
+
var CONTRACT_SHA256 = "0354e634fd50ffdc4c83b7ede7f9c31f3b2c877c4574557a6b264d2998470fd6";
|
|
1492
1586
|
|
|
1493
1587
|
// src/close-policy.ts
|
|
1494
1588
|
var CLOSE_RULES = {
|
|
@@ -1539,9 +1633,10 @@ var TOOL_CATALOG = [
|
|
|
1539
1633
|
{ name: "shell_python", group: "files_shell", state: "built", path: "sandbox_proxy", ops: ["exec.run"], platforms: ALL, summary: "Run a Python script" },
|
|
1540
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" },
|
|
1541
1635
|
// ── 2. Computer control (TS owners) ──────────────────────────────────────────────────────────
|
|
1542
|
-
{ name: "desktop_process", group: "os_control", state: "
|
|
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" },
|
|
1543
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" },
|
|
1544
|
-
{ name: "desktop_clipboard", group: "os_control", state: "
|
|
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" },
|
|
1545
1640
|
{ name: "desktop_screen", group: "os_control", state: "planned", path: "device_op", ops: ["screen.list", "screen.capture"], platforms: ALL, summary: "Displays and screenshots" },
|
|
1546
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" },
|
|
1547
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" },
|
|
@@ -1599,12 +1694,12 @@ var LEGACY_ACTIONS = {
|
|
|
1599
1694
|
"local_window.minimize": tool("desktop_window"),
|
|
1600
1695
|
"local_process.list": tool("desktop_process"),
|
|
1601
1696
|
"local_process.ports": tool("desktop_process"),
|
|
1602
|
-
"local_process.launch_app": tool("
|
|
1697
|
+
"local_process.launch_app": tool("desktop_apps"),
|
|
1603
1698
|
"local_process.kill": tool("desktop_process"),
|
|
1604
|
-
"local_process.focus_app": tool("
|
|
1699
|
+
"local_process.focus_app": tool("desktop_apps"),
|
|
1605
1700
|
"local_process.terminals": dropped("Matrx 2 terminals are exec sessions; the person's own terminal windows are not the agent's"),
|
|
1606
1701
|
"local_process.tail_terminal": dropped("Matrx 2 terminals are exec sessions; the person's own terminal windows are not the agent's"),
|
|
1607
|
-
"local_process.installed_apps": tool("
|
|
1702
|
+
"local_process.installed_apps": tool("desktop_apps"),
|
|
1608
1703
|
"local_input.type_text": tool("desktop_input"),
|
|
1609
1704
|
"local_input.hotkey": tool("desktop_input"),
|
|
1610
1705
|
"local_input.mouse_click": tool("desktop_input"),
|