@ai-matrx/desktop-protocol 0.21.26 → 0.21.27

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
@@ -566,9 +566,12 @@ __export(src_exports, {
566
566
  negotiate: () => negotiate,
567
567
  nonNegInt: () => nonNegInt,
568
568
  readCid: () => readCid,
569
+ refusedOps: () => refusedOps,
569
570
  renderToolStatusMarkdown: () => renderToolStatusMarkdown,
571
+ sharedOpsBlocking: () => sharedOpsBlocking,
570
572
  stampCid: () => stampCid,
571
573
  statusForPeer: () => statusForPeer,
574
+ toolsSending: () => toolsSending,
572
575
  u32: () => u32,
573
576
  versionSubprotocol: () => versionSubprotocol
574
577
  });
@@ -4255,6 +4258,7 @@ var TOOL_CATALOG = [
4255
4258
  { name: "desktop_system", group: "os_control", state: "built", path: "device_op", ops: ["sysinfo.get", "sysinfo.hardware", "system.open_url", "system.open_path", "system.open_settings", "system.notify"], platforms: ALL, summary: "System facts, open, notify" },
4256
4259
  { 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" },
4257
4260
  { name: "desktop_screen", group: "os_control", state: "built", path: "device_op", ops: ["screen.list", "screen.capture"], platforms: ALL, summary: "Displays and screenshots" },
4261
+ { name: "desktop_browser", group: "os_control", state: "built", path: "device_op", ops: ["browser.sessions", "browser.call"], platforms: ALL, summary: "The person's own browser through the AI Matrx extension: tabs, read, screenshot, navigate, click, type" },
4258
4262
  { 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" },
4259
4263
  { name: "desktop_input", group: "os_control", state: "built", path: "device_op", ops: ["input.type_text", "input.hotkey", "input.mouse_click", "input.mouse_move", "input.keyboard_settings", "input.set_keyboard_settings"], platforms: ALL, summary: "Keyboard and mouse" },
4260
4264
  { name: "desktop_audio", group: "os_control", state: "built", path: "device_op", ops: ["audio.devices", "audio.levels", "audio.set_levels", "audio.record", "audio.play"], platforms: ALL, summary: "Audio devices, record, play" },
@@ -4337,14 +4341,15 @@ var LEGACY_ACTIONS = {
4337
4341
  "local_system.open_url": tool("desktop_system"),
4338
4342
  "local_system.open_path": tool("desktop_system"),
4339
4343
  "local_system.notify": tool("desktop_system"),
4340
- "local_browser.navigate": dropped("The browser agent is the extension (matrx-extend) and the cloud browser; a second Playwright on the device duplicates it"),
4341
- "local_browser.click": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
4342
- "local_browser.type_text": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
4343
- "local_browser.extract": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
4344
- "local_browser.screenshot": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
4345
- "local_browser.eval": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
4346
- "local_browser.tabs": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
4347
- "local_browser.close": dropped("The browser agent is the extension (matrx-extend) and the cloud browser"),
4344
+ // The person's own browser is the AI Matrx extension paired with Matrx 2 (cap browser).
4345
+ "local_browser.navigate": tool("desktop_browser"),
4346
+ "local_browser.click": tool("desktop_browser"),
4347
+ "local_browser.type_text": tool("desktop_browser"),
4348
+ "local_browser.extract": tool("desktop_browser"),
4349
+ "local_browser.screenshot": tool("desktop_browser"),
4350
+ "local_browser.eval": dropped("The extension runs no page script for Matrx 2: its script and cdp tools are privileged and refused over the desktop path; read, click and type cover what eval was used for"),
4351
+ "local_browser.tabs": tool("desktop_browser"),
4352
+ "local_browser.close": tool("desktop_browser"),
4348
4353
  "local_web.fetch": tool("desktop_web"),
4349
4354
  "local_web.fetch_with_browser": tool("desktop_web"),
4350
4355
  "local_web.scrape": tool("desktop_web"),
@@ -4540,4 +4545,27 @@ function renderToolStatusMarkdown(status) {
4540
4545
  }
4541
4546
  return lines.join("\n");
4542
4547
  }
4548
+
4549
+ // src/tools/policy.ts
4550
+ function refusedOps(disabledTools) {
4551
+ const off = new Set(disabledTools);
4552
+ const senders = /* @__PURE__ */ new Map();
4553
+ for (const tool2 of TOOL_CATALOG) for (const op of tool2.ops) senders.set(op, [...senders.get(op) ?? [], tool2.name]);
4554
+ const refused = /* @__PURE__ */ new Set();
4555
+ for (const [op, tools] of senders) if (tools.every((t) => off.has(t))) refused.add(op);
4556
+ return refused;
4557
+ }
4558
+ function toolsSending(op) {
4559
+ return TOOL_CATALOG.filter((t) => t.ops.includes(op)).map((t) => t.name);
4560
+ }
4561
+ function sharedOpsBlocking(tool2, disabledTools) {
4562
+ const entry = TOOL_CATALOG.find((t) => t.name === tool2);
4563
+ if (!entry || entry.ops.length === 0) return [];
4564
+ const off = /* @__PURE__ */ new Set([...disabledTools, tool2]);
4565
+ const refused = refusedOps([...off]);
4566
+ if (entry.ops.some((op) => refused.has(op))) return [];
4567
+ const keepers = /* @__PURE__ */ new Set();
4568
+ for (const op of entry.ops) for (const other of TOOL_CATALOG) if (other.name !== tool2 && !off.has(other.name) && other.ops.includes(op)) keepers.add(other.name);
4569
+ return [...keepers].sort();
4570
+ }
4543
4571
  //# sourceMappingURL=index.cjs.map