@aria-cli/tools 1.0.18 → 1.0.31
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/.aria-build-stamp.json +1 -1
- package/dist/ask-user-interaction.js +23 -0
- package/dist/cache/web-cache.js +67 -0
- package/dist/definitions/arion.js +105 -0
- package/dist/definitions/browser/browser.js +419 -0
- package/dist/definitions/browser/index.js +5 -0
- package/dist/definitions/browser/pw-downloads.js +115 -0
- package/dist/definitions/browser/pw-interactions.js +200 -0
- package/dist/definitions/browser/pw-responses.js +77 -0
- package/dist/definitions/browser/pw-session.js +311 -0
- package/dist/definitions/browser/pw-shared.js +67 -0
- package/dist/definitions/browser/pw-snapshot.js +302 -0
- package/dist/definitions/browser/pw-state.js +63 -0
- package/dist/definitions/browser/types.js +5 -0
- package/dist/definitions/code-intelligence.js +471 -0
- package/dist/definitions/core.js +110 -0
- package/dist/definitions/delegation.js +513 -0
- package/dist/definitions/deploy.js +66 -0
- package/dist/definitions/filesystem.js +197 -0
- package/dist/definitions/frg.js +64 -0
- package/{dist-cjs/definitions/index.d.ts → dist/definitions/index.js} +2 -0
- package/dist/definitions/memory.js +124 -0
- package/dist/definitions/messaging.js +626 -0
- package/dist/definitions/meta.js +350 -0
- package/dist/definitions/network.js +160 -0
- package/dist/definitions/outlook.js +278 -0
- package/dist/definitions/patch/apply-patch.js +185 -0
- package/dist/definitions/patch/fuzzy-match.js +167 -0
- package/{dist-cjs/definitions/patch/index.d.ts → dist/definitions/patch/index.js} +1 -0
- package/dist/definitions/patch/patch-parser.js +208 -0
- package/dist/definitions/patch/sandbox-paths.js +106 -0
- package/dist/definitions/process/index.js +5 -0
- package/dist/definitions/process/process-registry.js +214 -0
- package/dist/definitions/process/process.js +387 -0
- package/dist/definitions/process/pty-keys.js +255 -0
- package/dist/definitions/process/session-slug.js +143 -0
- package/dist/definitions/quip.js +196 -0
- package/dist/definitions/search.js +61 -0
- package/dist/definitions/session-history.js +70 -0
- package/dist/definitions/shell.js +182 -0
- package/dist/definitions/slack.js +181 -0
- package/dist/definitions/web.js +110 -0
- package/dist/{dns-pinning-vc0r0vpx.js → dns-pinning-7szqhtmq.js} +1 -1
- package/dist/executors/apply-patch.js +902 -0
- package/dist/executors/arion.js +120 -0
- package/dist/executors/code-intelligence.js +883 -0
- package/dist/executors/deploy.js +849 -0
- package/dist/executors/filesystem.js +1119 -0
- package/dist/executors/frg-freshness.js +577 -0
- package/dist/executors/frg.js +299 -0
- package/{dist-cjs/executors/index.d.ts → dist/executors/index.js} +22 -19
- package/dist/executors/learning-meta.js +1147 -0
- package/dist/executors/lsp-client.js +297 -0
- package/dist/executors/memory.js +751 -0
- package/dist/executors/meta.js +221 -0
- package/dist/executors/process-registry.js +466 -0
- package/dist/executors/pty-session-store.js +31 -0
- package/dist/executors/pty.js +281 -0
- package/dist/executors/restart.js +120 -0
- package/dist/executors/search-freshness.js +196 -0
- package/dist/executors/search-types.js +53 -0
- package/dist/executors/search.js +67 -0
- package/dist/executors/self-diagnose.js +399 -0
- package/dist/executors/session-history.js +284 -0
- package/dist/executors/shell-safety.js +474 -0
- package/dist/executors/shell.js +955 -0
- package/dist/executors/utils.js +34 -0
- package/dist/executors/web.js +543 -0
- package/dist/extraction/content-extraction.js +248 -0
- package/dist/extraction/index.js +5 -0
- package/dist/headless-control-contract.js +968 -0
- package/dist/{index-x52t2mbj.js → index-45qvfjbf.js} +2 -2
- package/dist/{index-8xap0se3.js → index-b3sdwzh5.js} +1 -1
- package/dist/index-tvryzx00.js +2 -0
- package/dist/index.js +71 -372
- package/dist/local-control-http-auth.js +3 -0
- package/dist/{lsp-client-msnj763y.js → lsp-client-3qxptwyw.js} +1 -1
- package/dist/mcp/client.js +182 -0
- package/dist/mcp/connection.js +484 -0
- package/dist/mcp/index.js +11 -0
- package/dist/mcp/jsonrpc.js +145 -0
- package/dist/mcp/types.js +8 -0
- package/dist/network-control-adapter.js +73 -0
- package/dist/network-runtime/address-types.js +166 -0
- package/dist/network-runtime/db-owner-fencing.js +70 -0
- package/dist/network-runtime/delivery-receipts.js +270 -0
- package/dist/network-runtime/direct-endpoint-authority.js +26 -0
- package/dist/network-runtime/index.js +13 -1
- package/dist/network-runtime/local-control-contract.js +628 -0
- package/dist/network-runtime/node-store-contract.js +35 -0
- package/dist/network-runtime/pair-route-contract.js +78 -0
- package/dist/network-runtime/peer-capabilities.js +29 -0
- package/dist/network-runtime/peer-principal-ref.js +13 -0
- package/dist/network-runtime/peer-state-machine.js +122 -0
- package/dist/network-runtime/protocol-schemas.js +206 -0
- package/dist/network-runtime/runtime-bootstrap-contract.js +61 -0
- package/dist/outlook/desktop-session.js +280 -0
- package/dist/policy.js +150 -0
- package/dist/providers/brave.js +63 -0
- package/dist/providers/duckduckgo.js +177 -0
- package/dist/providers/exa.js +64 -0
- package/dist/providers/firecrawl.js +56 -0
- package/{dist-cjs/providers/index.d.ts → dist/providers/index.js} +1 -1
- package/dist/providers/jina.js +50 -0
- package/dist/providers/router.js +97 -0
- package/dist/providers/search-provider.js +33 -0
- package/dist/providers/tavily.js +55 -0
- package/dist/pty-w5c9dv33.js +1 -0
- package/dist/quip/desktop-session.js +318 -0
- package/{dist-cjs/registry/index.d.ts → dist/registry/index.js} +1 -0
- package/dist/registry/registry.js +757 -0
- package/dist/runtime-socket-local-control-client.js +331 -0
- package/dist/security/dns-normalization.js +20 -0
- package/dist/security/dns-pinning.js +124 -0
- package/dist/security/external-content.js +92 -0
- package/dist/security/ssrf.js +182 -0
- package/dist/session-history-gk75e3ta.js +1 -0
- package/dist/slack/desktop-session.js +325 -0
- package/dist/tool-factory.js +48 -0
- package/dist/types.js +8 -0
- package/dist/utils/retry.js +133 -0
- package/dist/utils/safe-parse-json.js +161 -0
- package/dist/utils/url.js +20 -0
- package/dist-cjs/ask-user-interaction.js +28 -0
- package/dist-cjs/cache/web-cache.js +71 -0
- package/dist-cjs/definitions/arion.js +108 -0
- package/dist-cjs/definitions/browser/browser.js +422 -0
- package/dist-cjs/definitions/browser/index.js +9 -0
- package/dist-cjs/definitions/browser/pw-downloads.js +118 -0
- package/dist-cjs/definitions/browser/pw-interactions.js +214 -0
- package/dist-cjs/definitions/browser/pw-responses.js +85 -0
- package/dist-cjs/definitions/browser/pw-session.js +327 -0
- package/dist-cjs/definitions/browser/pw-shared.js +73 -0
- package/dist-cjs/definitions/browser/pw-snapshot.js +308 -0
- package/dist-cjs/definitions/browser/pw-state.js +71 -0
- package/dist-cjs/definitions/browser/types.js +6 -0
- package/dist-cjs/definitions/code-intelligence.js +474 -0
- package/dist-cjs/definitions/core.js +134 -0
- package/dist-cjs/definitions/delegation.js +516 -0
- package/dist-cjs/definitions/deploy.js +69 -0
- package/dist-cjs/definitions/filesystem.js +200 -0
- package/dist-cjs/definitions/frg.js +67 -0
- package/dist-cjs/definitions/index.js +44 -0
- package/dist-cjs/definitions/memory.js +127 -0
- package/dist-cjs/definitions/messaging.js +632 -0
- package/dist-cjs/definitions/meta.js +353 -0
- package/dist-cjs/definitions/network.js +163 -0
- package/dist-cjs/definitions/outlook.js +281 -0
- package/dist-cjs/definitions/patch/apply-patch.js +192 -0
- package/dist-cjs/definitions/patch/fuzzy-match.js +173 -0
- package/dist-cjs/definitions/patch/index.js +6 -0
- package/dist-cjs/definitions/patch/patch-parser.js +216 -0
- package/dist-cjs/definitions/patch/sandbox-paths.js +114 -0
- package/dist-cjs/definitions/process/index.js +9 -0
- package/dist-cjs/definitions/process/process-registry.js +232 -0
- package/dist-cjs/definitions/process/process.js +390 -0
- package/dist-cjs/definitions/process/pty-keys.js +260 -0
- package/dist-cjs/definitions/process/session-slug.js +146 -0
- package/dist-cjs/definitions/quip.js +199 -0
- package/dist-cjs/definitions/search.js +64 -0
- package/dist-cjs/definitions/session-history.js +73 -0
- package/dist-cjs/definitions/shell.js +185 -0
- package/dist-cjs/definitions/slack.js +184 -0
- package/dist-cjs/definitions/web.js +113 -0
- package/dist-cjs/executors/apply-patch.js +939 -0
- package/dist-cjs/executors/arion.js +126 -0
- package/dist-cjs/executors/code-intelligence.js +926 -0
- package/dist-cjs/executors/deploy.js +870 -0
- package/dist-cjs/executors/filesystem.js +1164 -0
- package/dist-cjs/executors/frg-freshness.js +628 -0
- package/dist-cjs/executors/frg.js +335 -0
- package/dist-cjs/executors/index.js +144 -0
- package/dist-cjs/executors/learning-meta.js +1166 -0
- package/dist-cjs/executors/memory.js +797 -0
- package/dist-cjs/executors/meta.js +227 -0
- package/dist-cjs/executors/process-registry.js +470 -0
- package/dist-cjs/executors/pty-session-store.js +35 -0
- package/dist-cjs/executors/pty.js +289 -0
- package/dist-cjs/executors/restart.js +156 -0
- package/dist-cjs/executors/search-freshness.js +235 -0
- package/dist-cjs/executors/search-types.js +57 -0
- package/dist-cjs/executors/search.js +103 -0
- package/dist-cjs/executors/self-diagnose.js +435 -0
- package/dist-cjs/executors/session-history.js +321 -0
- package/dist-cjs/executors/shell-safety.js +479 -0
- package/dist-cjs/executors/shell.js +1002 -0
- package/dist-cjs/executors/utils.js +74 -0
- package/dist-cjs/executors/web.js +548 -0
- package/dist-cjs/extraction/content-extraction.js +289 -0
- package/dist-cjs/extraction/index.js +9 -0
- package/dist-cjs/headless-control-contract.js +973 -0
- package/dist-cjs/index.js +436 -385
- package/dist-cjs/local-control-http-auth.js +6 -0
- package/dist-cjs/mcp/client.js +186 -0
- package/dist-cjs/mcp/connection.js +488 -0
- package/dist-cjs/mcp/index.js +31 -0
- package/dist-cjs/mcp/jsonrpc.js +149 -0
- package/dist-cjs/mcp/types.js +9 -0
- package/dist-cjs/network-control-adapter.js +78 -0
- package/dist-cjs/network-runtime/address-types.js +169 -0
- package/dist-cjs/network-runtime/db-owner-fencing.js +77 -0
- package/dist-cjs/network-runtime/delivery-receipts.js +279 -0
- package/dist-cjs/network-runtime/direct-endpoint-authority.js +30 -0
- package/dist-cjs/network-runtime/index.js +173 -8
- package/dist-cjs/network-runtime/local-control-contract.js +634 -0
- package/dist-cjs/network-runtime/node-store-contract.js +39 -0
- package/dist-cjs/network-runtime/pair-route-contract.js +81 -0
- package/dist-cjs/network-runtime/peer-capabilities.js +38 -0
- package/dist-cjs/network-runtime/peer-principal-ref.js +16 -0
- package/dist-cjs/network-runtime/peer-state-machine.js +130 -0
- package/dist-cjs/network-runtime/protocol-schemas.js +213 -0
- package/dist-cjs/network-runtime/runtime-bootstrap-contract.js +64 -0
- package/dist-cjs/outlook/desktop-session.js +319 -0
- package/dist-cjs/policy.js +156 -0
- package/dist-cjs/providers/brave.js +67 -0
- package/dist-cjs/providers/duckduckgo.js +181 -0
- package/dist-cjs/providers/exa.js +68 -0
- package/dist-cjs/providers/firecrawl.js +60 -0
- package/dist-cjs/providers/index.js +18 -0
- package/dist-cjs/providers/jina.js +54 -0
- package/dist-cjs/providers/router.js +101 -0
- package/dist-cjs/providers/search-provider.js +37 -0
- package/dist-cjs/providers/tavily.js +59 -0
- package/dist-cjs/quip/desktop-session.js +354 -0
- package/dist-cjs/registry/index.js +7 -0
- package/dist-cjs/registry/registry.js +762 -0
- package/dist-cjs/runtime-socket-local-control-client.js +368 -0
- package/dist-cjs/security/dns-normalization.js +23 -0
- package/dist-cjs/security/dns-pinning.js +161 -0
- package/dist-cjs/security/external-content.js +96 -0
- package/dist-cjs/security/ssrf.js +222 -0
- package/dist-cjs/slack/desktop-session.js +367 -0
- package/dist-cjs/tool-factory.js +51 -0
- package/dist-cjs/types.js +9 -0
- package/dist-cjs/utils/retry.js +170 -0
- package/dist-cjs/utils/safe-parse-json.js +165 -0
- package/dist-cjs/utils/url.js +24 -0
- package/package.json +11 -10
- package/dist/ask-user-interaction.d.ts +0 -10
- package/dist/cache/web-cache.d.ts +0 -52
- package/dist/definitions/arion.d.ts +0 -8
- package/dist/definitions/browser/browser.d.ts +0 -2
- package/dist/definitions/browser/index.d.ts +0 -1
- package/dist/definitions/browser/pw-downloads.d.ts +0 -13
- package/dist/definitions/browser/pw-interactions.d.ts +0 -78
- package/dist/definitions/browser/pw-responses.d.ts +0 -28
- package/dist/definitions/browser/pw-session.d.ts +0 -65
- package/dist/definitions/browser/pw-shared.d.ts +0 -22
- package/dist/definitions/browser/pw-snapshot.d.ts +0 -34
- package/dist/definitions/browser/pw-state.d.ts +0 -22
- package/dist/definitions/browser/types.d.ts +0 -277
- package/dist/definitions/code-intelligence.d.ts +0 -8
- package/dist/definitions/core.d.ts +0 -47
- package/dist/definitions/delegation.d.ts +0 -11
- package/dist/definitions/deploy.d.ts +0 -15
- package/dist/definitions/filesystem.d.ts +0 -9
- package/dist/definitions/frg.d.ts +0 -3
- package/dist/definitions/index.d.ts +0 -19
- package/dist/definitions/memory.d.ts +0 -8
- package/dist/definitions/messaging.d.ts +0 -11
- package/dist/definitions/meta.d.ts +0 -11
- package/dist/definitions/network.d.ts +0 -11
- package/dist/definitions/outlook.d.ts +0 -2
- package/dist/definitions/patch/apply-patch.d.ts +0 -11
- package/dist/definitions/patch/fuzzy-match.d.ts +0 -10
- package/dist/definitions/patch/index.d.ts +0 -1
- package/dist/definitions/patch/patch-parser.d.ts +0 -50
- package/dist/definitions/patch/sandbox-paths.d.ts +0 -18
- package/dist/definitions/process/index.d.ts +0 -1
- package/dist/definitions/process/process-registry.d.ts +0 -67
- package/dist/definitions/process/process.d.ts +0 -9
- package/dist/definitions/process/pty-keys.d.ts +0 -13
- package/dist/definitions/process/session-slug.d.ts +0 -1
- package/dist/definitions/quip.d.ts +0 -2
- package/dist/definitions/search.d.ts +0 -9
- package/dist/definitions/session-history.d.ts +0 -11
- package/dist/definitions/shell.d.ts +0 -8
- package/dist/definitions/slack.d.ts +0 -2
- package/dist/definitions/web.d.ts +0 -8
- package/dist/executors/apply-patch.d.ts +0 -51
- package/dist/executors/arion.d.ts +0 -50
- package/dist/executors/code-intelligence.d.ts +0 -138
- package/dist/executors/deploy.d.ts +0 -169
- package/dist/executors/filesystem.d.ts +0 -150
- package/dist/executors/frg-freshness.d.ts +0 -93
- package/dist/executors/frg.d.ts +0 -27
- package/dist/executors/index.d.ts +0 -44
- package/dist/executors/learning-meta.d.ts +0 -87
- package/dist/executors/lsp-client.d.ts +0 -38
- package/dist/executors/memory.d.ts +0 -203
- package/dist/executors/meta.d.ts +0 -73
- package/dist/executors/process-registry.d.ts +0 -98
- package/dist/executors/pty-session-store.d.ts +0 -14
- package/dist/executors/pty.d.ts +0 -133
- package/dist/executors/restart.d.ts +0 -13
- package/dist/executors/search-freshness.d.ts +0 -50
- package/dist/executors/search-types.d.ts +0 -52
- package/dist/executors/search.d.ts +0 -11
- package/dist/executors/self-diagnose.d.ts +0 -89
- package/dist/executors/session-history.d.ts +0 -75
- package/dist/executors/shell-safety.d.ts +0 -27
- package/dist/executors/shell.d.ts +0 -168
- package/dist/executors/utils.d.ts +0 -20
- package/dist/executors/web.d.ts +0 -89
- package/dist/extraction/content-extraction.d.ts +0 -48
- package/dist/extraction/index.d.ts +0 -4
- package/dist/headless-control-contract.d.ts +0 -3182
- package/dist/index-a2fr1b3x.js +0 -2
- package/dist/index.d.ts +0 -62
- package/dist/local-control-http-auth.d.ts +0 -2
- package/dist/mcp/client.d.ts +0 -68
- package/dist/mcp/connection.d.ts +0 -54
- package/dist/mcp/index.d.ts +0 -10
- package/dist/mcp/jsonrpc.d.ts +0 -36
- package/dist/mcp/types.d.ts +0 -178
- package/dist/network-control-adapter.d.ts +0 -4
- package/dist/network-runtime/address-types.d.ts +0 -201
- package/dist/network-runtime/db-owner-fencing.d.ts +0 -43
- package/dist/network-runtime/delivery-receipts.d.ts +0 -117
- package/dist/network-runtime/direct-endpoint-authority.d.ts +0 -8
- package/dist/network-runtime/index.d.ts +0 -24
- package/dist/network-runtime/local-control-contract.d.ts +0 -758
- package/dist/network-runtime/node-store-contract.d.ts +0 -49
- package/dist/network-runtime/pair-route-contract.d.ts +0 -100
- package/dist/network-runtime/peer-capabilities.d.ts +0 -10
- package/dist/network-runtime/peer-principal-ref.d.ts +0 -9
- package/dist/network-runtime/peer-state-machine.d.ts +0 -70
- package/dist/network-runtime/protocol-schemas.d.ts +0 -328
- package/dist/network-runtime/runtime-bootstrap-contract.d.ts +0 -81
- package/dist/outlook/desktop-session.d.ts +0 -68
- package/dist/policy.d.ts +0 -43
- package/dist/providers/brave.d.ts +0 -10
- package/dist/providers/duckduckgo.d.ts +0 -18
- package/dist/providers/exa.d.ts +0 -10
- package/dist/providers/firecrawl.d.ts +0 -10
- package/dist/providers/index.d.ts +0 -8
- package/dist/providers/jina.d.ts +0 -10
- package/dist/providers/router.d.ts +0 -21
- package/dist/providers/search-provider.d.ts +0 -35
- package/dist/providers/tavily.d.ts +0 -10
- package/dist/pty-ff59hy75.js +0 -1
- package/dist/quip/desktop-session.d.ts +0 -69
- package/dist/registry/index.d.ts +0 -1
- package/dist/registry/registry.d.ts +0 -156
- package/dist/runtime-socket-local-control-client.d.ts +0 -10
- package/dist/security/dns-normalization.d.ts +0 -6
- package/dist/security/dns-pinning.d.ts +0 -27
- package/dist/security/external-content.d.ts +0 -40
- package/dist/security/ssrf.d.ts +0 -40
- package/dist/session-history-6gn52xhp.js +0 -1
- package/dist/slack/desktop-session.d.ts +0 -69
- package/dist/tool-factory.d.ts +0 -46
- package/dist/types.d.ts +0 -1192
- package/dist/utils/retry.d.ts +0 -11
- package/dist/utils/safe-parse-json.d.ts +0 -26
- package/dist/utils/url.d.ts +0 -10
- package/dist-cjs/ask-user-interaction.d.ts +0 -10
- package/dist-cjs/cache/web-cache.d.ts +0 -52
- package/dist-cjs/definitions/arion.d.ts +0 -8
- package/dist-cjs/definitions/browser/browser.d.ts +0 -2
- package/dist-cjs/definitions/browser/index.d.ts +0 -1
- package/dist-cjs/definitions/browser/pw-downloads.d.ts +0 -13
- package/dist-cjs/definitions/browser/pw-interactions.d.ts +0 -78
- package/dist-cjs/definitions/browser/pw-responses.d.ts +0 -28
- package/dist-cjs/definitions/browser/pw-session.d.ts +0 -65
- package/dist-cjs/definitions/browser/pw-shared.d.ts +0 -22
- package/dist-cjs/definitions/browser/pw-snapshot.d.ts +0 -34
- package/dist-cjs/definitions/browser/pw-state.d.ts +0 -22
- package/dist-cjs/definitions/browser/types.d.ts +0 -277
- package/dist-cjs/definitions/code-intelligence.d.ts +0 -8
- package/dist-cjs/definitions/core.d.ts +0 -47
- package/dist-cjs/definitions/delegation.d.ts +0 -11
- package/dist-cjs/definitions/deploy.d.ts +0 -15
- package/dist-cjs/definitions/filesystem.d.ts +0 -9
- package/dist-cjs/definitions/frg.d.ts +0 -3
- package/dist-cjs/definitions/memory.d.ts +0 -8
- package/dist-cjs/definitions/messaging.d.ts +0 -11
- package/dist-cjs/definitions/meta.d.ts +0 -11
- package/dist-cjs/definitions/network.d.ts +0 -11
- package/dist-cjs/definitions/outlook.d.ts +0 -2
- package/dist-cjs/definitions/patch/apply-patch.d.ts +0 -11
- package/dist-cjs/definitions/patch/fuzzy-match.d.ts +0 -10
- package/dist-cjs/definitions/patch/patch-parser.d.ts +0 -50
- package/dist-cjs/definitions/patch/sandbox-paths.d.ts +0 -18
- package/dist-cjs/definitions/process/index.d.ts +0 -1
- package/dist-cjs/definitions/process/process-registry.d.ts +0 -67
- package/dist-cjs/definitions/process/process.d.ts +0 -9
- package/dist-cjs/definitions/process/pty-keys.d.ts +0 -13
- package/dist-cjs/definitions/process/session-slug.d.ts +0 -1
- package/dist-cjs/definitions/quip.d.ts +0 -2
- package/dist-cjs/definitions/search.d.ts +0 -9
- package/dist-cjs/definitions/session-history.d.ts +0 -11
- package/dist-cjs/definitions/shell.d.ts +0 -8
- package/dist-cjs/definitions/slack.d.ts +0 -2
- package/dist-cjs/definitions/web.d.ts +0 -8
- package/dist-cjs/executors/apply-patch.d.ts +0 -51
- package/dist-cjs/executors/arion.d.ts +0 -50
- package/dist-cjs/executors/code-intelligence.d.ts +0 -138
- package/dist-cjs/executors/deploy.d.ts +0 -169
- package/dist-cjs/executors/filesystem.d.ts +0 -150
- package/dist-cjs/executors/frg-freshness.d.ts +0 -93
- package/dist-cjs/executors/frg.d.ts +0 -27
- package/dist-cjs/executors/learning-meta.d.ts +0 -87
- package/dist-cjs/executors/lsp-client.d.ts +0 -38
- package/dist-cjs/executors/memory.d.ts +0 -203
- package/dist-cjs/executors/meta.d.ts +0 -73
- package/dist-cjs/executors/process-registry.d.ts +0 -98
- package/dist-cjs/executors/pty-session-store.d.ts +0 -14
- package/dist-cjs/executors/pty.d.ts +0 -133
- package/dist-cjs/executors/restart.d.ts +0 -13
- package/dist-cjs/executors/search-freshness.d.ts +0 -50
- package/dist-cjs/executors/search-types.d.ts +0 -52
- package/dist-cjs/executors/search.d.ts +0 -11
- package/dist-cjs/executors/self-diagnose.d.ts +0 -89
- package/dist-cjs/executors/session-history.d.ts +0 -75
- package/dist-cjs/executors/shell-safety.d.ts +0 -27
- package/dist-cjs/executors/shell.d.ts +0 -168
- package/dist-cjs/executors/utils.d.ts +0 -20
- package/dist-cjs/executors/web.d.ts +0 -89
- package/dist-cjs/extraction/content-extraction.d.ts +0 -48
- package/dist-cjs/extraction/index.d.ts +0 -4
- package/dist-cjs/headless-control-contract.d.ts +0 -3182
- package/dist-cjs/index.d.ts +0 -62
- package/dist-cjs/local-control-http-auth.d.ts +0 -2
- package/dist-cjs/mcp/client.d.ts +0 -68
- package/dist-cjs/mcp/connection.d.ts +0 -54
- package/dist-cjs/mcp/index.d.ts +0 -10
- package/dist-cjs/mcp/jsonrpc.d.ts +0 -36
- package/dist-cjs/mcp/types.d.ts +0 -178
- package/dist-cjs/network-control-adapter.d.ts +0 -4
- package/dist-cjs/network-runtime/address-types.d.ts +0 -201
- package/dist-cjs/network-runtime/db-owner-fencing.d.ts +0 -43
- package/dist-cjs/network-runtime/delivery-receipts.d.ts +0 -117
- package/dist-cjs/network-runtime/direct-endpoint-authority.d.ts +0 -8
- package/dist-cjs/network-runtime/index.d.ts +0 -24
- package/dist-cjs/network-runtime/local-control-contract.d.ts +0 -758
- package/dist-cjs/network-runtime/node-store-contract.d.ts +0 -49
- package/dist-cjs/network-runtime/pair-route-contract.d.ts +0 -100
- package/dist-cjs/network-runtime/peer-capabilities.d.ts +0 -10
- package/dist-cjs/network-runtime/peer-principal-ref.d.ts +0 -9
- package/dist-cjs/network-runtime/peer-state-machine.d.ts +0 -70
- package/dist-cjs/network-runtime/protocol-schemas.d.ts +0 -328
- package/dist-cjs/network-runtime/runtime-bootstrap-contract.d.ts +0 -81
- package/dist-cjs/outlook/desktop-session.d.ts +0 -68
- package/dist-cjs/policy.d.ts +0 -43
- package/dist-cjs/providers/brave.d.ts +0 -10
- package/dist-cjs/providers/duckduckgo.d.ts +0 -18
- package/dist-cjs/providers/exa.d.ts +0 -10
- package/dist-cjs/providers/firecrawl.d.ts +0 -10
- package/dist-cjs/providers/jina.d.ts +0 -10
- package/dist-cjs/providers/router.d.ts +0 -21
- package/dist-cjs/providers/search-provider.d.ts +0 -35
- package/dist-cjs/providers/tavily.d.ts +0 -10
- package/dist-cjs/quip/desktop-session.d.ts +0 -69
- package/dist-cjs/registry/registry.d.ts +0 -156
- package/dist-cjs/runtime-socket-local-control-client.d.ts +0 -10
- package/dist-cjs/security/dns-normalization.d.ts +0 -6
- package/dist-cjs/security/dns-pinning.d.ts +0 -27
- package/dist-cjs/security/external-content.d.ts +0 -40
- package/dist-cjs/security/ssrf.d.ts +0 -40
- package/dist-cjs/slack/desktop-session.d.ts +0 -69
- package/dist-cjs/tool-factory.d.ts +0 -46
- package/dist-cjs/types.d.ts +0 -1192
- package/dist-cjs/utils/retry.d.ts +0 -11
- package/dist-cjs/utils/safe-parse-json.d.ts +0 -26
- package/dist-cjs/utils/url.d.ts +0 -10
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const ASK_USER_PAUSE_REQUIRED_CODE = "ASK_USER_PAUSE_REQUIRED";
|
|
2
|
+
export class AskUserPauseRequiredError extends Error {
|
|
3
|
+
code = ASK_USER_PAUSE_REQUIRED_CODE;
|
|
4
|
+
questions;
|
|
5
|
+
constructor(questions, message = "ask_user requires additional answers before this run can continue.") {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "AskUserPauseRequiredError";
|
|
8
|
+
this.questions = questions.map((question) => ({
|
|
9
|
+
question: question.question,
|
|
10
|
+
...(Array.isArray(question.options) ? { options: [...question.options] } : {}),
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function isAskUserPauseRequiredError(error) {
|
|
15
|
+
if (error instanceof AskUserPauseRequiredError)
|
|
16
|
+
return true;
|
|
17
|
+
if (!error || typeof error !== "object")
|
|
18
|
+
return false;
|
|
19
|
+
const candidate = error;
|
|
20
|
+
return (candidate.code === ASK_USER_PAUSE_REQUIRED_CODE ||
|
|
21
|
+
(candidate.name === "AskUserPauseRequiredError" && Array.isArray(candidate.questions)));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ask-user-interaction.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export class WebCache {
|
|
2
|
+
maxEntries;
|
|
3
|
+
ttlMs;
|
|
4
|
+
cache = new Map();
|
|
5
|
+
setCallCount = 0;
|
|
6
|
+
/** How often to run proactive eviction (every N set() calls) */
|
|
7
|
+
static EVICTION_INTERVAL = 100;
|
|
8
|
+
constructor(maxEntries = 100, ttlMs = 15 * 60 * 1000) {
|
|
9
|
+
this.maxEntries = maxEntries;
|
|
10
|
+
this.ttlMs = ttlMs;
|
|
11
|
+
}
|
|
12
|
+
get(key) {
|
|
13
|
+
const entry = this.cache.get(key);
|
|
14
|
+
if (!entry || Date.now() > entry.expiresAt) {
|
|
15
|
+
if (entry)
|
|
16
|
+
this.cache.delete(key);
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
// Touch for true LRU semantics (recently read becomes most-recent)
|
|
20
|
+
this.cache.delete(key);
|
|
21
|
+
this.cache.set(key, entry);
|
|
22
|
+
return entry.value;
|
|
23
|
+
}
|
|
24
|
+
set(key, value) {
|
|
25
|
+
// Update-in-place should also refresh recency
|
|
26
|
+
if (this.cache.has(key)) {
|
|
27
|
+
this.cache.delete(key);
|
|
28
|
+
}
|
|
29
|
+
// Proactive eviction: sweep expired entries periodically to prevent memory bloat
|
|
30
|
+
this.setCallCount++;
|
|
31
|
+
if (this.setCallCount % WebCache.EVICTION_INTERVAL === 0) {
|
|
32
|
+
this.evictExpired();
|
|
33
|
+
}
|
|
34
|
+
if (this.cache.size >= this.maxEntries) {
|
|
35
|
+
// Evict least recently used (oldest key in Map iteration order)
|
|
36
|
+
const lruKey = this.cache.keys().next().value;
|
|
37
|
+
if (lruKey)
|
|
38
|
+
this.cache.delete(lruKey);
|
|
39
|
+
}
|
|
40
|
+
this.cache.set(key, { value, expiresAt: Date.now() + this.ttlMs });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Proactively remove all expired entries from the cache.
|
|
44
|
+
* Called periodically from set() to prevent expired entries from
|
|
45
|
+
* consuming memory until they are accessed or evicted by LRU.
|
|
46
|
+
*/
|
|
47
|
+
evictExpired() {
|
|
48
|
+
const now = Date.now();
|
|
49
|
+
for (const [key, entry] of this.cache) {
|
|
50
|
+
if (entry.expiresAt <= now) {
|
|
51
|
+
this.cache.delete(key);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Remove all entries from the cache */
|
|
56
|
+
clear() {
|
|
57
|
+
this.cache.clear();
|
|
58
|
+
}
|
|
59
|
+
/** Current number of entries in the cache */
|
|
60
|
+
get size() {
|
|
61
|
+
return this.cache.size;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export const searchCache = new WebCache(100);
|
|
65
|
+
export const fetchCache = new WebCache(50);
|
|
66
|
+
export const browseCache = new WebCache(50);
|
|
67
|
+
//# sourceMappingURL=web-cache.js.map
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arion tool definitions
|
|
3
|
+
*
|
|
4
|
+
* Tools: hatch_arion, rest_arion, wake_arion, retire_arion (4 tools)
|
|
5
|
+
*/
|
|
6
|
+
import { executeHatchArion, executeRestArion, executeWakeArion, executeRetireArion, } from "../executors/index.js";
|
|
7
|
+
const hatch_arion = {
|
|
8
|
+
name: "hatch_arion",
|
|
9
|
+
description: "Create a new arion persona with specified personality, traits, and beliefs. Requires user confirmation.",
|
|
10
|
+
category: "arion",
|
|
11
|
+
parameters: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
name: { type: "string", description: "The arion's unique name" },
|
|
15
|
+
emoji: { type: "string", description: "Visual emoji identifier" },
|
|
16
|
+
traits: {
|
|
17
|
+
type: "array",
|
|
18
|
+
items: { type: "string" },
|
|
19
|
+
description: "Core personality traits",
|
|
20
|
+
},
|
|
21
|
+
style: {
|
|
22
|
+
type: "string",
|
|
23
|
+
enum: ["formal", "casual", "technical", "friendly"],
|
|
24
|
+
description: "Communication style",
|
|
25
|
+
},
|
|
26
|
+
beliefs: {
|
|
27
|
+
type: "array",
|
|
28
|
+
items: { type: "string" },
|
|
29
|
+
description: "Core beliefs to seed into memory",
|
|
30
|
+
},
|
|
31
|
+
background: { type: "string", description: "Brief backstory or context" },
|
|
32
|
+
quirks: {
|
|
33
|
+
type: "array",
|
|
34
|
+
items: { type: "string" },
|
|
35
|
+
description: "Unique behavioral quirks",
|
|
36
|
+
},
|
|
37
|
+
strengths: {
|
|
38
|
+
type: "array",
|
|
39
|
+
items: { type: "string" },
|
|
40
|
+
description: "Areas of particular strength",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
required: ["name", "traits", "style"],
|
|
44
|
+
},
|
|
45
|
+
riskLevel: "dangerous",
|
|
46
|
+
requiresConfirmation: true,
|
|
47
|
+
isReadOnly: false,
|
|
48
|
+
loadingTier: "always",
|
|
49
|
+
execute: executeHatchArion,
|
|
50
|
+
};
|
|
51
|
+
const rest_arion = {
|
|
52
|
+
name: "rest_arion",
|
|
53
|
+
description: "Put an arion persona to rest. Triggers deep memory consolidation before resting.",
|
|
54
|
+
category: "arion",
|
|
55
|
+
parameters: {
|
|
56
|
+
type: "object",
|
|
57
|
+
properties: {
|
|
58
|
+
name: { type: "string", description: "Name of the arion to rest" },
|
|
59
|
+
},
|
|
60
|
+
required: ["name"],
|
|
61
|
+
},
|
|
62
|
+
riskLevel: "moderate",
|
|
63
|
+
isReadOnly: false,
|
|
64
|
+
loadingTier: "always",
|
|
65
|
+
execute: executeRestArion,
|
|
66
|
+
};
|
|
67
|
+
const wake_arion = {
|
|
68
|
+
name: "wake_arion",
|
|
69
|
+
description: "Wake a resting arion persona, making it available for use.",
|
|
70
|
+
category: "arion",
|
|
71
|
+
parameters: {
|
|
72
|
+
type: "object",
|
|
73
|
+
properties: {
|
|
74
|
+
name: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Name of the resting arion to wake",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ["name"],
|
|
80
|
+
},
|
|
81
|
+
riskLevel: "moderate",
|
|
82
|
+
isReadOnly: false,
|
|
83
|
+
loadingTier: "always",
|
|
84
|
+
execute: executeWakeArion,
|
|
85
|
+
};
|
|
86
|
+
const retire_arion = {
|
|
87
|
+
name: "retire_arion",
|
|
88
|
+
description: "Permanently retire an arion persona. This action cannot be undone.",
|
|
89
|
+
category: "arion",
|
|
90
|
+
parameters: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {
|
|
93
|
+
name: { type: "string", description: "Name of the arion to retire" },
|
|
94
|
+
},
|
|
95
|
+
required: ["name"],
|
|
96
|
+
},
|
|
97
|
+
riskLevel: "dangerous",
|
|
98
|
+
requiresConfirmation: true,
|
|
99
|
+
isReadOnly: false,
|
|
100
|
+
loadingTier: "always",
|
|
101
|
+
execute: executeRetireArion,
|
|
102
|
+
};
|
|
103
|
+
/** Arion tool definitions (4) */
|
|
104
|
+
export const ARION_TOOL_DEFINITIONS = [hatch_arion, rest_arion, wake_arion, retire_arion];
|
|
105
|
+
//# sourceMappingURL=arion.js.map
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
// Originally from OpenClaw (MIT License, Copyright 2025 Peter Steinberger)
|
|
2
|
+
// https://github.com/openclaw/openclaw
|
|
3
|
+
// Modified for ARIA — stripped OpenClaw runtime, rewired to ARIA Tool interface
|
|
4
|
+
import { launchBrowser, closeBrowser, getSession, getRefs, setRefs, getConsoleMessages, getNetworkRequests, listTabs, newTab, selectTab, closeTab, } from "./pw-session.js";
|
|
5
|
+
import { snapshotPage, navigatePage } from "./pw-snapshot.js";
|
|
6
|
+
import { clickViaPlaywright, hoverViaPlaywright, dragViaPlaywright, typeViaPlaywright, selectOptionViaPlaywright, pressKeyViaPlaywright, evaluateViaPlaywright, takeScreenshot, scrollPage, waitForCondition, uploadFiles, } from "./pw-interactions.js";
|
|
7
|
+
import { cookiesGet, cookiesSet, cookiesClear } from "./pw-state.js";
|
|
8
|
+
import { filterConsoleMessages, filterNetworkRequests, formatConsoleMessages, formatNetworkRequests, } from "./pw-responses.js";
|
|
9
|
+
// ── JSON Schema for the action parameter ──────────────────────────────
|
|
10
|
+
const browserParameterSchema = {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
action: {
|
|
14
|
+
type: "string",
|
|
15
|
+
enum: [
|
|
16
|
+
"launch",
|
|
17
|
+
"close",
|
|
18
|
+
"navigate",
|
|
19
|
+
"snapshot",
|
|
20
|
+
"click",
|
|
21
|
+
"type",
|
|
22
|
+
"hover",
|
|
23
|
+
"drag",
|
|
24
|
+
"select_option",
|
|
25
|
+
"press_key",
|
|
26
|
+
"scroll",
|
|
27
|
+
"evaluate",
|
|
28
|
+
"screenshot",
|
|
29
|
+
"get_console",
|
|
30
|
+
"get_network",
|
|
31
|
+
"wait",
|
|
32
|
+
"tab_list",
|
|
33
|
+
"tab_new",
|
|
34
|
+
"tab_select",
|
|
35
|
+
"tab_close",
|
|
36
|
+
"cookies_get",
|
|
37
|
+
"cookies_set",
|
|
38
|
+
"cookies_clear",
|
|
39
|
+
"upload",
|
|
40
|
+
],
|
|
41
|
+
description: "The browser action to perform. 'launch' is optional; actions auto-start a session when needed. Use 'snapshot' to read page content, refs like [e1] with 'click'/'type'.",
|
|
42
|
+
},
|
|
43
|
+
// launch
|
|
44
|
+
url: { type: "string", description: "URL to navigate to (for launch/navigate/tab_new)" },
|
|
45
|
+
headless: {
|
|
46
|
+
type: "boolean",
|
|
47
|
+
description: "Run browser without visible window (default: true)",
|
|
48
|
+
},
|
|
49
|
+
// snapshot
|
|
50
|
+
interactive: {
|
|
51
|
+
type: "boolean",
|
|
52
|
+
description: "Only show interactive elements in snapshot (buttons, links, inputs)",
|
|
53
|
+
},
|
|
54
|
+
// click/type/hover/drag/select_option/upload
|
|
55
|
+
ref: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Element ref from snapshot (e.g. 'e1', 'e5')",
|
|
58
|
+
},
|
|
59
|
+
text: { type: "string", description: "Text to type (for 'type' action)" },
|
|
60
|
+
submit: {
|
|
61
|
+
type: "boolean",
|
|
62
|
+
description: "Press Enter after typing (for 'type' action)",
|
|
63
|
+
},
|
|
64
|
+
slowly: {
|
|
65
|
+
type: "boolean",
|
|
66
|
+
description: "Type character by character instead of filling (for 'type' action)",
|
|
67
|
+
},
|
|
68
|
+
button: {
|
|
69
|
+
type: "string",
|
|
70
|
+
enum: ["left", "right", "middle"],
|
|
71
|
+
description: "Mouse button (for 'click' action)",
|
|
72
|
+
},
|
|
73
|
+
modifiers: {
|
|
74
|
+
type: "array",
|
|
75
|
+
items: { type: "string" },
|
|
76
|
+
description: "Keyboard modifiers (for 'click': Alt, Control, Meta, Shift)",
|
|
77
|
+
},
|
|
78
|
+
doubleClick: {
|
|
79
|
+
type: "boolean",
|
|
80
|
+
description: "Double-click instead of single click",
|
|
81
|
+
},
|
|
82
|
+
startRef: {
|
|
83
|
+
type: "string",
|
|
84
|
+
description: "Source element ref (for 'drag' action)",
|
|
85
|
+
},
|
|
86
|
+
endRef: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "Target element ref (for 'drag' action)",
|
|
89
|
+
},
|
|
90
|
+
values: {
|
|
91
|
+
type: "array",
|
|
92
|
+
items: { type: "string" },
|
|
93
|
+
description: "Values to select (for 'select_option' action)",
|
|
94
|
+
},
|
|
95
|
+
// press_key
|
|
96
|
+
key: {
|
|
97
|
+
type: "string",
|
|
98
|
+
description: "Key to press (for 'press_key': Enter, Tab, Escape, ArrowDown, etc.)",
|
|
99
|
+
},
|
|
100
|
+
// scroll
|
|
101
|
+
direction: {
|
|
102
|
+
type: "string",
|
|
103
|
+
enum: ["up", "down"],
|
|
104
|
+
description: "Scroll direction",
|
|
105
|
+
},
|
|
106
|
+
amount: {
|
|
107
|
+
type: "number",
|
|
108
|
+
description: "Scroll amount in pixels (default: 500)",
|
|
109
|
+
},
|
|
110
|
+
// evaluate
|
|
111
|
+
script: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "JavaScript to evaluate in browser context (for 'evaluate' action)",
|
|
114
|
+
},
|
|
115
|
+
// get_console
|
|
116
|
+
level: {
|
|
117
|
+
type: "string",
|
|
118
|
+
description: "Minimum console level filter (debug/info/warning/error)",
|
|
119
|
+
},
|
|
120
|
+
// get_network
|
|
121
|
+
filter: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "URL substring filter for network requests",
|
|
124
|
+
},
|
|
125
|
+
// wait
|
|
126
|
+
selector: {
|
|
127
|
+
type: "string",
|
|
128
|
+
description: "CSS selector to wait for (for 'wait' action)",
|
|
129
|
+
},
|
|
130
|
+
timeout: {
|
|
131
|
+
type: "number",
|
|
132
|
+
description: "Timeout in milliseconds (for 'wait' action)",
|
|
133
|
+
},
|
|
134
|
+
// tab_select
|
|
135
|
+
index: {
|
|
136
|
+
type: "number",
|
|
137
|
+
description: "Tab index (for 'tab_select'/'tab_close')",
|
|
138
|
+
},
|
|
139
|
+
// cookies_set
|
|
140
|
+
cookies: {
|
|
141
|
+
type: "array",
|
|
142
|
+
items: {
|
|
143
|
+
type: "object",
|
|
144
|
+
properties: {
|
|
145
|
+
name: { type: "string" },
|
|
146
|
+
value: { type: "string" },
|
|
147
|
+
domain: { type: "string" },
|
|
148
|
+
path: { type: "string" },
|
|
149
|
+
},
|
|
150
|
+
required: ["name", "value", "domain"],
|
|
151
|
+
},
|
|
152
|
+
description: "Cookies to set (for 'cookies_set' action)",
|
|
153
|
+
},
|
|
154
|
+
// upload
|
|
155
|
+
paths: {
|
|
156
|
+
type: "array",
|
|
157
|
+
items: { type: "string" },
|
|
158
|
+
description: "File paths to upload (for 'upload' action)",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
required: ["action"],
|
|
162
|
+
};
|
|
163
|
+
// ── Helpers ───────────────────────────────────────────────────────────
|
|
164
|
+
function ok(message, data) {
|
|
165
|
+
return { success: true, message, data };
|
|
166
|
+
}
|
|
167
|
+
function fail(message) {
|
|
168
|
+
return { success: false, message };
|
|
169
|
+
}
|
|
170
|
+
async function requireSession() {
|
|
171
|
+
const session = getSession();
|
|
172
|
+
if (session) {
|
|
173
|
+
return session;
|
|
174
|
+
}
|
|
175
|
+
return launchBrowser();
|
|
176
|
+
}
|
|
177
|
+
// ── Action dispatcher ─────────────────────────────────────────────────
|
|
178
|
+
async function executeBrowserAction(input) {
|
|
179
|
+
const action = input;
|
|
180
|
+
try {
|
|
181
|
+
switch (action.action) {
|
|
182
|
+
// ── Lifecycle ─────────────────────────────────────────────────
|
|
183
|
+
case "launch": {
|
|
184
|
+
const session = await launchBrowser({
|
|
185
|
+
headless: action.headless,
|
|
186
|
+
url: action.url,
|
|
187
|
+
});
|
|
188
|
+
const url = session.page.url();
|
|
189
|
+
return ok(`Browser launched.${action.url ? ` Navigated to ${url}` : ""}\nUse 'snapshot' to see page content.`, { url });
|
|
190
|
+
}
|
|
191
|
+
case "close": {
|
|
192
|
+
await closeBrowser();
|
|
193
|
+
return ok("Browser closed.");
|
|
194
|
+
}
|
|
195
|
+
// ── Navigation ────────────────────────────────────────────────
|
|
196
|
+
case "navigate": {
|
|
197
|
+
const session = await requireSession();
|
|
198
|
+
const result = await navigatePage(session.page, action.url);
|
|
199
|
+
setRefs({}); // Refs are stale after navigation
|
|
200
|
+
return ok(`Navigated to ${result.url}. Use 'snapshot' to see page content.`, result);
|
|
201
|
+
}
|
|
202
|
+
// ── Snapshot ──────────────────────────────────────────────────
|
|
203
|
+
case "snapshot": {
|
|
204
|
+
const session = await requireSession();
|
|
205
|
+
const result = await snapshotPage(session.page, {
|
|
206
|
+
interactive: action.interactive,
|
|
207
|
+
});
|
|
208
|
+
setRefs(result.refs);
|
|
209
|
+
const header = `Page: ${result.title}\nURL: ${result.url}\n` +
|
|
210
|
+
`Elements: ${result.stats.refs} total, ${result.stats.interactive} interactive\n\n`;
|
|
211
|
+
return ok(header + result.snapshot, {
|
|
212
|
+
url: result.url,
|
|
213
|
+
title: result.title,
|
|
214
|
+
stats: result.stats,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
// ── Click ─────────────────────────────────────────────────────
|
|
218
|
+
case "click": {
|
|
219
|
+
const session = await requireSession();
|
|
220
|
+
await clickViaPlaywright({
|
|
221
|
+
page: session.page,
|
|
222
|
+
refs: getRefs(),
|
|
223
|
+
ref: action.ref,
|
|
224
|
+
doubleClick: action.doubleClick,
|
|
225
|
+
button: action.button,
|
|
226
|
+
modifiers: action.modifiers,
|
|
227
|
+
});
|
|
228
|
+
return ok(`Clicked ${action.ref}. Use 'snapshot' to see updated page.`);
|
|
229
|
+
}
|
|
230
|
+
// ── Type ──────────────────────────────────────────────────────
|
|
231
|
+
case "type": {
|
|
232
|
+
const session = await requireSession();
|
|
233
|
+
await typeViaPlaywright({
|
|
234
|
+
page: session.page,
|
|
235
|
+
refs: getRefs(),
|
|
236
|
+
ref: action.ref,
|
|
237
|
+
text: action.text,
|
|
238
|
+
submit: action.submit,
|
|
239
|
+
slowly: action.slowly,
|
|
240
|
+
});
|
|
241
|
+
return ok(`Typed "${action.text.length > 50 ? action.text.slice(0, 50) + "..." : action.text}" into ${action.ref}.${action.submit ? " Submitted with Enter." : ""}`);
|
|
242
|
+
}
|
|
243
|
+
// ── Hover ─────────────────────────────────────────────────────
|
|
244
|
+
case "hover": {
|
|
245
|
+
const session = await requireSession();
|
|
246
|
+
await hoverViaPlaywright({
|
|
247
|
+
page: session.page,
|
|
248
|
+
refs: getRefs(),
|
|
249
|
+
ref: action.ref,
|
|
250
|
+
});
|
|
251
|
+
return ok(`Hovered over ${action.ref}.`);
|
|
252
|
+
}
|
|
253
|
+
// ── Drag ──────────────────────────────────────────────────────
|
|
254
|
+
case "drag": {
|
|
255
|
+
const session = await requireSession();
|
|
256
|
+
await dragViaPlaywright({
|
|
257
|
+
page: session.page,
|
|
258
|
+
refs: getRefs(),
|
|
259
|
+
startRef: action.startRef,
|
|
260
|
+
endRef: action.endRef,
|
|
261
|
+
});
|
|
262
|
+
return ok(`Dragged ${action.startRef} to ${action.endRef}.`);
|
|
263
|
+
}
|
|
264
|
+
// ── Select option ─────────────────────────────────────────────
|
|
265
|
+
case "select_option": {
|
|
266
|
+
const session = await requireSession();
|
|
267
|
+
await selectOptionViaPlaywright({
|
|
268
|
+
page: session.page,
|
|
269
|
+
refs: getRefs(),
|
|
270
|
+
ref: action.ref,
|
|
271
|
+
values: action.values,
|
|
272
|
+
});
|
|
273
|
+
return ok(`Selected [${action.values.join(", ")}] in ${action.ref}.`);
|
|
274
|
+
}
|
|
275
|
+
// ── Key press ─────────────────────────────────────────────────
|
|
276
|
+
case "press_key": {
|
|
277
|
+
const session = await requireSession();
|
|
278
|
+
await pressKeyViaPlaywright({
|
|
279
|
+
page: session.page,
|
|
280
|
+
key: action.key,
|
|
281
|
+
});
|
|
282
|
+
return ok(`Pressed key: ${action.key}`);
|
|
283
|
+
}
|
|
284
|
+
// ── Scroll ────────────────────────────────────────────────────
|
|
285
|
+
case "scroll": {
|
|
286
|
+
const session = await requireSession();
|
|
287
|
+
await scrollPage({
|
|
288
|
+
page: session.page,
|
|
289
|
+
direction: action.direction,
|
|
290
|
+
amount: action.amount,
|
|
291
|
+
});
|
|
292
|
+
return ok(`Scrolled ${action.direction} ${action.amount ?? 500}px. Use 'snapshot' to see updated content.`);
|
|
293
|
+
}
|
|
294
|
+
// ── Evaluate ──────────────────────────────────────────────────
|
|
295
|
+
case "evaluate": {
|
|
296
|
+
const session = await requireSession();
|
|
297
|
+
const result = await evaluateViaPlaywright({
|
|
298
|
+
page: session.page,
|
|
299
|
+
script: action.script,
|
|
300
|
+
});
|
|
301
|
+
const output = result === undefined
|
|
302
|
+
? "undefined"
|
|
303
|
+
: typeof result === "string"
|
|
304
|
+
? result
|
|
305
|
+
: JSON.stringify(result, null, 2);
|
|
306
|
+
return ok(output, { result });
|
|
307
|
+
}
|
|
308
|
+
// ── Screenshot ────────────────────────────────────────────────
|
|
309
|
+
case "screenshot": {
|
|
310
|
+
const session = await requireSession();
|
|
311
|
+
const buffer = await takeScreenshot({ page: session.page });
|
|
312
|
+
const base64 = buffer.toString("base64");
|
|
313
|
+
return ok(`Screenshot taken (${buffer.length} bytes, base64-encoded).`, {
|
|
314
|
+
base64,
|
|
315
|
+
mimeType: "image/png",
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
// ── Console ───────────────────────────────────────────────────
|
|
319
|
+
case "get_console": {
|
|
320
|
+
await requireSession();
|
|
321
|
+
const messages = filterConsoleMessages(getConsoleMessages(), action.level);
|
|
322
|
+
return ok(formatConsoleMessages(messages), { count: messages.length });
|
|
323
|
+
}
|
|
324
|
+
// ── Network ───────────────────────────────────────────────────
|
|
325
|
+
case "get_network": {
|
|
326
|
+
await requireSession();
|
|
327
|
+
const requests = filterNetworkRequests(getNetworkRequests(), action.filter);
|
|
328
|
+
return ok(formatNetworkRequests(requests), { count: requests.length });
|
|
329
|
+
}
|
|
330
|
+
// ── Wait ──────────────────────────────────────────────────────
|
|
331
|
+
case "wait": {
|
|
332
|
+
const session = await requireSession();
|
|
333
|
+
await waitForCondition({
|
|
334
|
+
page: session.page,
|
|
335
|
+
selector: action.selector,
|
|
336
|
+
text: action.text,
|
|
337
|
+
timeout: action.timeout,
|
|
338
|
+
});
|
|
339
|
+
return ok("Wait condition satisfied. Use 'snapshot' to see current page.");
|
|
340
|
+
}
|
|
341
|
+
// ── Tab management ────────────────────────────────────────────
|
|
342
|
+
case "tab_list": {
|
|
343
|
+
const tabs = listTabs();
|
|
344
|
+
const desc = tabs
|
|
345
|
+
.map((t) => `[${t.index}]${t.active ? " (active)" : ""} ${t.url}`)
|
|
346
|
+
.join("\n");
|
|
347
|
+
return ok(desc || "No tabs open.", { tabs });
|
|
348
|
+
}
|
|
349
|
+
case "tab_new": {
|
|
350
|
+
const result = await newTab(action.url);
|
|
351
|
+
return ok(`Opened new tab [${result.index}]: ${result.url}`, result);
|
|
352
|
+
}
|
|
353
|
+
case "tab_select": {
|
|
354
|
+
await requireSession();
|
|
355
|
+
const result = await selectTab(action.index);
|
|
356
|
+
return ok(`Switched to tab ${action.index}: ${result.url}`, result);
|
|
357
|
+
}
|
|
358
|
+
case "tab_close": {
|
|
359
|
+
await closeTab(action.index);
|
|
360
|
+
return ok(`Tab closed.${action.index !== undefined ? ` (index ${action.index})` : ""}`);
|
|
361
|
+
}
|
|
362
|
+
// ── Cookies ───────────────────────────────────────────────────
|
|
363
|
+
case "cookies_get": {
|
|
364
|
+
const session = await requireSession();
|
|
365
|
+
const result = await cookiesGet(session.context);
|
|
366
|
+
const desc = result.cookies.length
|
|
367
|
+
? result.cookies.map((c) => `${c.name}=${c.value} (${c.domain})`).join("\n")
|
|
368
|
+
: "No cookies.";
|
|
369
|
+
return ok(desc, result);
|
|
370
|
+
}
|
|
371
|
+
case "cookies_set": {
|
|
372
|
+
const session = await requireSession();
|
|
373
|
+
await cookiesSet(session.context, action.cookies);
|
|
374
|
+
return ok(`Set ${action.cookies.length} cookie(s).`);
|
|
375
|
+
}
|
|
376
|
+
case "cookies_clear": {
|
|
377
|
+
const session = await requireSession();
|
|
378
|
+
await cookiesClear(session.context);
|
|
379
|
+
return ok("All cookies cleared.");
|
|
380
|
+
}
|
|
381
|
+
// ── Upload ────────────────────────────────────────────────────
|
|
382
|
+
case "upload": {
|
|
383
|
+
const session = await requireSession();
|
|
384
|
+
await uploadFiles({
|
|
385
|
+
page: session.page,
|
|
386
|
+
refs: getRefs(),
|
|
387
|
+
ref: action.ref,
|
|
388
|
+
paths: action.paths,
|
|
389
|
+
});
|
|
390
|
+
return ok(`Uploaded ${action.paths.length} file(s) to ${action.ref}.`);
|
|
391
|
+
}
|
|
392
|
+
default: {
|
|
393
|
+
const exhaustive = action;
|
|
394
|
+
return fail(`Unknown browser action: ${exhaustive.action}`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
catch (err) {
|
|
399
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
400
|
+
return fail(message);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
// ── Tool definition ───────────────────────────────────────────────────
|
|
404
|
+
export const browserTool = {
|
|
405
|
+
name: "browser",
|
|
406
|
+
description: "Control a web browser via Playwright. Supports navigation, clicking, typing, taking snapshots of page content, and more. " +
|
|
407
|
+
"Actions auto-start a browser session; use 'launch' only when you want explicit startup control. Use 'snapshot' to see the current page state as an accessibility tree with element refs like [e1], [e2]. " +
|
|
408
|
+
"Use those refs with 'click', 'type', 'hover', etc. to interact with elements. " +
|
|
409
|
+
"Use 'evaluate' to run JavaScript in the page context. Use 'screenshot' to capture the page visually.",
|
|
410
|
+
category: "web",
|
|
411
|
+
parameters: browserParameterSchema,
|
|
412
|
+
riskLevel: "moderate",
|
|
413
|
+
isReadOnly: false,
|
|
414
|
+
loadingTier: "always",
|
|
415
|
+
async execute(input, _context) {
|
|
416
|
+
return executeBrowserAction(input);
|
|
417
|
+
},
|
|
418
|
+
};
|
|
419
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Originally from OpenClaw (MIT License, Copyright 2025 Peter Steinberger)
|
|
2
|
+
// https://github.com/openclaw/openclaw
|
|
3
|
+
// Modified for ARIA — stripped OpenClaw runtime, rewired to ARIA Tool interface
|
|
4
|
+
export { browserTool } from "./browser.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|