@particle-academy/agent-integrations 0.45.0 → 0.47.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +835 -0
  2. package/LICENSE +21 -0
  3. package/README.md +54 -6
  4. package/dist/bridges/artboard.d.cts +3 -3
  5. package/dist/bridges/artboard.d.ts +3 -3
  6. package/dist/bridges/catalog.d.cts +3 -3
  7. package/dist/bridges/catalog.d.ts +3 -3
  8. package/dist/bridges/charts.d.cts +3 -3
  9. package/dist/bridges/charts.d.ts +3 -3
  10. package/dist/bridges/cms.d.cts +3 -3
  11. package/dist/bridges/cms.d.ts +3 -3
  12. package/dist/bridges/code.d.cts +3 -3
  13. package/dist/bridges/code.d.ts +3 -3
  14. package/dist/bridges/doc.d.cts +3 -3
  15. package/dist/bridges/doc.d.ts +3 -3
  16. package/dist/bridges/features.d.cts +3 -3
  17. package/dist/bridges/features.d.ts +3 -3
  18. package/dist/bridges/files.d.cts +3 -3
  19. package/dist/bridges/files.d.ts +3 -3
  20. package/dist/bridges/flow.d.cts +3 -3
  21. package/dist/bridges/flow.d.ts +3 -3
  22. package/dist/bridges/forms.d.cts +3 -3
  23. package/dist/bridges/forms.d.ts +3 -3
  24. package/dist/bridges/git.d.cts +3 -3
  25. package/dist/bridges/git.d.ts +3 -3
  26. package/dist/bridges/grid.d.cts +3 -3
  27. package/dist/bridges/grid.d.ts +3 -3
  28. package/dist/bridges/map.d.cts +3 -3
  29. package/dist/bridges/map.d.ts +3 -3
  30. package/dist/bridges/navigation.d.cts +127 -0
  31. package/dist/bridges/navigation.d.ts +127 -0
  32. package/dist/bridges/passkeys.d.cts +4 -4
  33. package/dist/bridges/passkeys.d.ts +4 -4
  34. package/dist/bridges/scene.d.cts +3 -3
  35. package/dist/bridges/scene.d.ts +3 -3
  36. package/dist/bridges/screens.d.cts +3 -3
  37. package/dist/bridges/screens.d.ts +3 -3
  38. package/dist/bridges/sheets.d.cts +3 -3
  39. package/dist/bridges/sheets.d.ts +3 -3
  40. package/dist/bridges/slides.d.cts +3 -3
  41. package/dist/bridges/slides.d.ts +3 -3
  42. package/dist/bridges/terminal.d.cts +3 -3
  43. package/dist/bridges/terminal.d.ts +3 -3
  44. package/dist/bridges/tui.d.cts +2 -2
  45. package/dist/bridges/tui.d.ts +2 -2
  46. package/dist/bridges/whiteboard.d.cts +3 -3
  47. package/dist/bridges/whiteboard.d.ts +3 -3
  48. package/dist/bridges-navigation.cjs +391 -0
  49. package/dist/bridges-navigation.cjs.map +1 -0
  50. package/dist/bridges-navigation.js +7 -0
  51. package/dist/bridges-navigation.js.map +1 -0
  52. package/dist/bridges-passkeys.cjs.map +1 -1
  53. package/dist/bridges-passkeys.js +1 -1
  54. package/dist/{chunk-OZBUPO4K.js → chunk-5W34X4EY.js} +263 -58
  55. package/dist/chunk-5W34X4EY.js.map +1 -0
  56. package/dist/{chunk-PWYEW6NL.js → chunk-G6CRHFWU.js} +2 -2
  57. package/dist/{chunk-PWYEW6NL.js.map → chunk-G6CRHFWU.js.map} +1 -1
  58. package/dist/chunk-JGJHPH65.js +271 -0
  59. package/dist/chunk-JGJHPH65.js.map +1 -0
  60. package/dist/dom-navigation/index.d.cts +164 -0
  61. package/dist/dom-navigation/index.d.ts +164 -0
  62. package/dist/dom-navigation/script.d.cts +3 -0
  63. package/dist/dom-navigation/script.d.ts +3 -0
  64. package/dist/dom-navigation-script.cjs +11 -0
  65. package/dist/dom-navigation-script.cjs.map +1 -0
  66. package/dist/dom-navigation-script.js +9 -0
  67. package/dist/dom-navigation-script.js.map +1 -0
  68. package/dist/dom-navigation.cjs +387 -0
  69. package/dist/dom-navigation.cjs.map +1 -0
  70. package/dist/dom-navigation.js +370 -0
  71. package/dist/dom-navigation.js.map +1 -0
  72. package/dist/index.cjs +31 -31
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.d.cts +10 -125
  75. package/dist/index.d.ts +10 -125
  76. package/dist/index.js +12 -275
  77. package/dist/index.js.map +1 -1
  78. package/dist/mcp/index.d.cts +5 -5
  79. package/dist/mcp/index.d.ts +5 -5
  80. package/dist/mcp/stdio.d.cts +3 -3
  81. package/dist/mcp/stdio.d.ts +3 -3
  82. package/dist/presence/index.d.cts +1 -1
  83. package/dist/presence/index.d.ts +1 -1
  84. package/dist/relay-server/index.d.cts +110 -26
  85. package/dist/relay-server/index.d.ts +110 -26
  86. package/dist/relay-server-cli.cjs +374 -89
  87. package/dist/relay-server-cli.cjs.map +1 -1
  88. package/dist/relay-server-cli.js +120 -38
  89. package/dist/relay-server-cli.js.map +1 -1
  90. package/dist/relay-server.cjs +255 -51
  91. package/dist/relay-server.cjs.map +1 -1
  92. package/dist/relay-server.js +1 -1
  93. package/dist/{server-BIcA3ZtK.d.cts → server-1y0n61R5.d.cts} +2 -2
  94. package/dist/{server-DnUyeavY.d.ts → server-vq6qVl3T.d.ts} +2 -2
  95. package/dist/sharing/index.d.cts +3 -3
  96. package/dist/sharing/index.d.ts +3 -3
  97. package/dist/sheets-adapter.d.cts +3 -3
  98. package/dist/sheets-adapter.d.ts +3 -3
  99. package/dist/{tool-host-LVBgCN5m.d.cts → tool-host-D67N2a2h.d.cts} +1 -1
  100. package/dist/{tool-host-Wo0pkY83.d.ts → tool-host-LYfdPE8u.d.ts} +1 -1
  101. package/dist/{types-EcElKOlk.d.cts → types-DP5yQZQU.d.cts} +1 -1
  102. package/dist/{types-BxNRKSVd.d.ts → types-VX_9je7w.d.ts} +1 -1
  103. package/dist/{types-C2DtnHIn.d.cts → types-gzIpsUDE.d.cts} +1 -1
  104. package/dist/{types-C2DtnHIn.d.ts → types-gzIpsUDE.d.ts} +1 -1
  105. package/dist/undo/index.d.cts +2 -2
  106. package/dist/undo/index.d.ts +2 -2
  107. package/docs/relay-protocol.md +41 -5
  108. package/docs/relay-server.md +102 -15
  109. package/package.json +41 -3
  110. package/dist/chunk-OZBUPO4K.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Particle Academy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -20,15 +20,15 @@ import "@particle-academy/agent-integrations/styles.css";
20
20
 
21
21
  ## Which version range to depend on
22
22
 
23
- **Use a caret. `^0.42.0` is correct here, and it is deliberate.**
23
+ **Use a caret. `^0.46.0` is correct here, and it is deliberate.**
24
24
 
25
25
  ```jsonc
26
- "@particle-academy/agent-integrations": "^0.42.0"
26
+ "@particle-academy/agent-integrations": "^0.46.0"
27
27
  ```
28
28
 
29
29
  This package is **pre-1.0, and breaking changes land in MINOR releases** — see
30
30
  the note at the top of [`CHANGELOG.md`](./CHANGELOG.md). A caret on a `0.x` locks
31
- the minor (npm reads `^0.42.0` as `>=0.42.0 <0.43.0`), so it gives you patches and
31
+ the minor (npm reads `^0.46.0` as `>=0.46.0 <0.47.0`), so it gives you patches and
32
32
  holds you at a surface you have already integrated against. That is the right
33
33
  default when the next minor may change something under you.
34
34
 
@@ -275,6 +275,47 @@ channel.listenForWhisper("mcp", (frame) => transport.deliverFromRemote(frame));
275
275
 
276
276
  Agents (Claude Desktop, Cline, custom) connect to the same channel via your auth bridge.
277
277
 
278
+ ## Drive a page you don't own — `./dom-navigation`
279
+
280
+ `registerNavigationBridge` (`page_describe`, `page_read`, `page_click`,
281
+ `page_set_field`, `nav_visit`, …) needs an adapter that walks the page's DOM.
282
+ `./dom-navigation` ships that walker framework-free, in two halves:
283
+
284
+ - **In the page:** `createDomNavigationAgent()` — stable handles
285
+ (`data-co-handle` → `name` → `id` → `role#index`), ARIA names, masking of
286
+ sensitive values (password, `cc-*`, `one-time-code`, `data-private`), field
287
+ writes that React-controlled inputs see, and rects. When your code does not
288
+ run in the page, inject `DOM_NAVIGATION_SCRIPT` from `./dom-navigation/script`
289
+ instead: a self-contained IIFE (no module system) that installs
290
+ `globalThis.__fancyDomNavigation`. Re-injecting is a no-op.
291
+ - **In the host:** `createRemoteNavigationAdapter({ transport })` — a
292
+ `NavigationBridgeAdapter` over any `{ call(method, args): Promise<unknown> }`.
293
+ Results from the page are coerced to the declared shapes; the page is hostile.
294
+
295
+ Electron, with the walker in an isolated world so the page cannot reach it:
296
+
297
+ ```ts
298
+ import { DOM_NAVIGATION_SCRIPT } from "@particle-academy/agent-integrations/dom-navigation/script";
299
+ import { createRemoteNavigationAdapter, domNavigationCallScript } from "@particle-academy/agent-integrations/dom-navigation";
300
+ import { registerNavigationBridge } from "@particle-academy/agent-integrations/bridges/navigation";
301
+
302
+ const WORLD = 1001;
303
+ const wc = view.webContents;
304
+ const inject = () => wc.executeJavaScriptInIsolatedWorld(WORLD, [{ code: DOM_NAVIGATION_SCRIPT }]);
305
+ wc.on("dom-ready", inject); // every document needs its own copy
306
+
307
+ const adapter = createRemoteNavigationAdapter({
308
+ transport: {
309
+ call: (method, args) =>
310
+ wc.executeJavaScriptInIsolatedWorld(WORLD, [{ code: domNavigationCallScript(method, args) }]),
311
+ },
312
+ confirm: (req) => askTheHuman(req), // without this, submits + destructive clicks are NOT staged
313
+ });
314
+ registerNavigationBridge(server, { adapter });
315
+ ```
316
+
317
+ Adapter methods may now return promises; the bridge awaits every call.
318
+
278
319
  ## Tools shipped (whiteboard bridge)
279
320
 
280
321
  | Tool | Purpose |
@@ -323,9 +364,16 @@ to you:
323
364
  `confirm` argument that would apply it (revoking the last passkey is a lockout).
324
365
  `passkey_list` re-projects onto the public summary fields, so handing it your
325
366
  ORM model cannot leak a public key, a user handle, or a signature counter.
326
- - **The relay fans tool results + activity to all peers.** The terminal bridge
327
- redacts raw command bytes from broadcast meta, but any `structuredContent` you
328
- return is visible to every connected peer — don't return secrets.
367
+ - **Activity reaches every peer; tool results reach the caller only if clients
368
+ label themselves.** Since 0.44.0 a reply goes only to the client that asked
369
+ when clients send a `client` query parameter; unlabelled clients still get
370
+ every frame. Notifications are always broadcast. The terminal bridge redacts
371
+ raw command bytes from broadcast meta, but treat anything you return as
372
+ visible to every holder of the token — don't return secrets.
373
+ - **The relay serves SSE and long-poll.** Behind Cloudflare (whose HTTP/3 edge
374
+ resets long SSE streams) install `@particle-academy/fancy-cf-relay` so the
375
+ browser polls; see `docs/relay-server.md`. Pass `--cors` a list of your
376
+ sites' origins rather than leaving `*` on a public relay.
329
377
 
330
378
  ## Status
331
379
 
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  /**
6
6
  * Transport-level JSON shapes. These intentionally mirror fancy-artboard's
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  /**
6
6
  * Transport-level JSON shapes. These intentionally mirror fancy-artboard's
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  /**
6
6
  * Headless bridge for `@particle-academy/fancy-catalog` — a Stripe catalog with
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  /**
6
6
  * Headless bridge for `@particle-academy/fancy-catalog` — a Stripe catalog with
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  /**
6
6
  * Adapter wires a single fancy-echarts chart to the bridge. Charts are
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  /**
6
6
  * Adapter wires a single fancy-echarts chart to the bridge. Charts are
@@ -1,8 +1,8 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
3
  import { DocAdapter } from './doc.cjs';
4
4
  import { StyledNode, StagePolicy, TreeOp, StyleProps, LayoutMode, DocReducer, DocTree } from '@particle-academy/fancy-doc-commons';
5
- import '../types-C2DtnHIn.cjs';
5
+ import '../types-gzIpsUDE.cjs';
6
6
 
7
7
  /**
8
8
  * registerCmsBridge — the greenfield CMS agent bridge, built entirely on
@@ -1,8 +1,8 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
3
  import { DocAdapter } from './doc.js';
4
4
  import { StyledNode, StagePolicy, TreeOp, StyleProps, LayoutMode, DocReducer, DocTree } from '@particle-academy/fancy-doc-commons';
5
- import '../types-C2DtnHIn.js';
5
+ import '../types-gzIpsUDE.js';
6
6
 
7
7
  /**
8
8
  * registerCmsBridge — the greenfield CMS agent bridge, built entirely on
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  /**
6
6
  * Adapter the host wires to a fancy-code CodeEditor (typically via the
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  /**
6
6
  * Adapter the host wires to a fancy-code CodeEditor (typically via the
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { J as JsonObject } from '../types-C2DtnHIn.cjs';
3
- import { B as Bridge } from '../types-EcElKOlk.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { J as JsonObject } from '../types-gzIpsUDE.cjs';
3
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
4
4
  import { DocNode, DocTree, TreeOp, DocReducer, StagePolicy } from '@particle-academy/fancy-doc-commons';
5
5
 
6
6
  /** Host-provided access to the document tree. */
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { J as JsonObject } from '../types-C2DtnHIn.js';
3
- import { B as Bridge } from '../types-BxNRKSVd.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { J as JsonObject } from '../types-gzIpsUDE.js';
3
+ import { B as Bridge } from '../types-VX_9je7w.js';
4
4
  import { DocNode, DocTree, TreeOp, DocReducer, StagePolicy } from '@particle-academy/fancy-doc-commons';
5
5
 
6
6
  /** Host-provided access to the document tree. */
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  /**
6
6
  * Headless bridge for `@particle-academy/fancy-features` — feature management
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  /**
6
6
  * Headless bridge for `@particle-academy/fancy-features` — feature management
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  type FileKind = "file" | "dir";
6
6
  type FileEntry = {
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  type FileKind = "file" | "dir";
6
6
  type FileEntry = {
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  type FlowNode = {
6
6
  id: string;
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  type FlowNode = {
6
6
  id: string;
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  /**
6
6
  * Field descriptor — what the host says about each form field. Mirrors the
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  /**
6
6
  * Field descriptor — what the host says about each form field. Mirrors the
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  type GitProposal = {
6
6
  operation: string;
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  type GitProposal = {
6
6
  operation: string;
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  /**
6
6
  * Loose grid types — the public state shape of `@particle-academy/fancy-grid`,
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  /**
6
6
  * Loose grid types — the public state shape of `@particle-academy/fancy-grid`,
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-LVBgCN5m.cjs';
2
- import { B as Bridge } from '../types-EcElKOlk.cjs';
3
- import '../types-C2DtnHIn.cjs';
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
4
 
5
5
  type LatLng = {
6
6
  lat: number;
@@ -1,6 +1,6 @@
1
- import { T as ToolHost } from '../tool-host-Wo0pkY83.js';
2
- import { B as Bridge } from '../types-BxNRKSVd.js';
3
- import '../types-C2DtnHIn.js';
1
+ import { T as ToolHost } from '../tool-host-LYfdPE8u.js';
2
+ import { B as Bridge } from '../types-VX_9je7w.js';
3
+ import '../types-gzIpsUDE.js';
4
4
 
5
5
  type LatLng = {
6
6
  lat: number;
@@ -0,0 +1,127 @@
1
+ import { T as ToolHost } from '../tool-host-D67N2a2h.cjs';
2
+ import { B as Bridge } from '../types-DP5yQZQU.cjs';
3
+ import '../types-gzIpsUDE.cjs';
4
+
5
+ /**
6
+ * One interactive element the agent can act on, addressed by a STABLE handle
7
+ * (not a CSS selector) so the agent drives the page the Human+ way — never DOM
8
+ * scraping. The host builds these in `describe()` (data-co-handle → name/id →
9
+ * ARIA role + accessible name).
10
+ */
11
+ type PageAction = {
12
+ /** Stable, opaque handle the agent passes back to act on this element. */
13
+ handle: string;
14
+ /** ARIA-ish role: "link" | "button" | "textbox" | "checkbox" | "select" | … */
15
+ role: string;
16
+ /** Accessible name / label. */
17
+ label: string;
18
+ /** Current value for inputs (omitted/masked for sensitive fields). */
19
+ value?: unknown;
20
+ /** True when activating this is destructive / submits (agent should stage). */
21
+ destructive?: boolean;
22
+ };
23
+ /** The page as the agent sees it: where it is + what it can do. */
24
+ type PageSnapshot = {
25
+ url: string;
26
+ title: string;
27
+ actions: PageAction[];
28
+ /** Monotonic host revision. Human input advances it and invalidates stale agent intent. */
29
+ revision?: number;
30
+ };
31
+ /** A write the host may want the human to confirm (trust-but-verify). */
32
+ type NavigationConfirmRequest = {
33
+ action: "submit" | "click";
34
+ handle: string;
35
+ label: string;
36
+ };
37
+ type MaybePromise<T> = T | Promise<T>;
38
+ /**
39
+ * Host-provided adapter. In the sandbox this is backed by Inertia's `router` +
40
+ * the DOM walker from `@particle-academy/agent-integrations/dom-navigation`.
41
+ * Every method works on stable handles, never raw selectors.
42
+ *
43
+ * Any method may return a Promise: a host driving a page it does not run in
44
+ * (an Electron WebContentsView, via `createRemoteNavigationAdapter`) can only
45
+ * answer asynchronously. The bridge awaits every call.
46
+ */
47
+ type NavigationBridgeAdapter = {
48
+ /** Optional fancy-screens screen id for presence targeting. */
49
+ screenId?: string;
50
+ /** Current location. */
51
+ getLocation: () => MaybePromise<{
52
+ url: string;
53
+ title: string;
54
+ }>;
55
+ /** Current human-control revision. Omit to disable stale-intent protection. */
56
+ getRevision?: () => MaybePromise<number>;
57
+ /** Snapshot of the page's actionable elements (stable handles + labels). */
58
+ describe: () => MaybePromise<PageSnapshot>;
59
+ /** Visible text / heading outline for grounding (optional). */
60
+ read?: () => MaybePromise<string>;
61
+ /** Navigate to a URL (host wires to router.visit). */
62
+ visit: (url: string) => void | Promise<void>;
63
+ back?: () => void | Promise<void>;
64
+ forward?: () => void | Promise<void>;
65
+ /** Scroll to coords or to a handle's element. */
66
+ scrollTo: (opts: {
67
+ x?: number;
68
+ y?: number;
69
+ handle?: string;
70
+ }) => void | Promise<void>;
71
+ scrollBy: (dy: number) => void | Promise<void>;
72
+ /** Set a field's value by handle (host dispatches input/change for React). */
73
+ setField: (handle: string, value: unknown) => MaybePromise<{
74
+ ok: boolean;
75
+ error?: string;
76
+ }>;
77
+ /** Activate an element by handle. */
78
+ click: (handle: string) => MaybePromise<{
79
+ ok: boolean;
80
+ error?: string;
81
+ }>;
82
+ /** Submit a form by handle. */
83
+ submit: (handle: string) => Promise<{
84
+ ok: boolean;
85
+ error?: string;
86
+ }> | {
87
+ ok: boolean;
88
+ error?: string;
89
+ };
90
+ /**
91
+ * Viewport rect of a handle's element, for agent-presence rendering (cursor +
92
+ * highlight). Returned in tool `meta.rect` so `<CoBrowseCursorLayer>` can show
93
+ * the agent acting on the page. Optional — omit and there's just no cursor.
94
+ */
95
+ rectFor?: (handle: string) => MaybePromise<{
96
+ x: number;
97
+ y: number;
98
+ width: number;
99
+ height: number;
100
+ } | null>;
101
+ /**
102
+ * Trust-but-verify hook. When `pendingMode` is on, `page_submit` and
103
+ * destructive `page_click` route through this; the host shows a prompt and
104
+ * resolves true (proceed) / false (declined).
105
+ */
106
+ confirm?: (req: NavigationConfirmRequest) => Promise<boolean>;
107
+ };
108
+ type NavigationBridgeOptions = {
109
+ adapter: NavigationBridgeAdapter;
110
+ /** Identity tagged into activity events (so the human sees who's driving). */
111
+ agent?: {
112
+ id: string;
113
+ name?: string;
114
+ color?: string;
115
+ };
116
+ /** Route submit + destructive clicks through `adapter.confirm`. Default true. */
117
+ pendingMode?: boolean;
118
+ };
119
+ /**
120
+ * registerNavigationBridge — site-wide co-browsing. Lets a connected agent
121
+ * navigate, scroll, and (with staged confirm) fill + click any page, addressed
122
+ * by stable handles. Pairs with `useCoBrowseSession` (server + relay) and
123
+ * `<CoBrowsePresence>` (the human's view of the agent). The 12th Fancy bridge.
124
+ */
125
+ declare function registerNavigationBridge(host: ToolHost, options: NavigationBridgeOptions): Bridge;
126
+
127
+ export { type NavigationBridgeAdapter, type NavigationBridgeOptions, type NavigationConfirmRequest, type PageAction, type PageSnapshot, registerNavigationBridge };