@aria-cli/tools 1.0.19 → 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/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-v49pd2a0.js → index-45qvfjbf.js} +2 -2
- package/dist/index.js +71 -372
- package/dist/local-control-http-auth.js +3 -0
- 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/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.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-cf6pmvx6.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/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,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OUTLOOK_TOOL_DEFINITIONS = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const node_os_1 = require("node:os");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const OUTLOOK_PY = (0, node_path_1.join)((0, node_os_1.homedir)(), ".aria", "tools", "outlook.py");
|
|
8
|
+
function runOutlook(args) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
(0, node_child_process_1.execFile)(OUTLOOK_PY, args, { timeout: 30_000 }, (err, stdout, stderr) => {
|
|
11
|
+
if (err) {
|
|
12
|
+
reject(new Error(stderr?.trim() || err.message));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
resolve(stdout);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function parseJson(raw) {
|
|
21
|
+
try {
|
|
22
|
+
return JSON.parse(raw);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return { raw };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// PascalCase → camelCase field mapper for Outlook REST v2 responses
|
|
29
|
+
function normalizeMessage(msg) {
|
|
30
|
+
const from = msg.From;
|
|
31
|
+
const emailAddr = from?.EmailAddress;
|
|
32
|
+
const toRaw = msg.ToRecipients;
|
|
33
|
+
const ccRaw = msg.CcRecipients;
|
|
34
|
+
const body = msg.Body;
|
|
35
|
+
const mapRecipient = (r) => {
|
|
36
|
+
const ea = r.EmailAddress;
|
|
37
|
+
return { name: ea?.Name ?? "", email: ea?.Address ?? "" };
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
id: msg.Id ?? msg.id ?? "",
|
|
41
|
+
subject: msg.Subject ?? msg.subject ?? "",
|
|
42
|
+
from: emailAddr
|
|
43
|
+
? { name: emailAddr.Name ?? "", email: emailAddr.Address ?? "" }
|
|
44
|
+
: { name: "", email: "" },
|
|
45
|
+
toRecipients: toRaw?.map(mapRecipient) ?? [],
|
|
46
|
+
receivedDateTime: msg.ReceivedDateTime ?? msg.receivedDateTime ?? "",
|
|
47
|
+
isRead: msg.IsRead ?? msg.isRead ?? false,
|
|
48
|
+
hasAttachments: msg.HasAttachments ?? msg.hasAttachments ?? false,
|
|
49
|
+
bodyPreview: msg.BodyPreview ?? msg.bodyPreview ?? "",
|
|
50
|
+
conversationId: msg.ConversationId ?? msg.conversationId ?? "",
|
|
51
|
+
...(body
|
|
52
|
+
? {
|
|
53
|
+
body: {
|
|
54
|
+
contentType: body.ContentType ?? body.contentType ?? "text",
|
|
55
|
+
content: body.Content ?? body.content ?? "",
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
: {}),
|
|
59
|
+
...(ccRaw ? { ccRecipients: ccRaw.map(mapRecipient) } : {}),
|
|
60
|
+
importance: msg.Importance ?? msg.importance ?? "normal",
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const check_outlook_messages = {
|
|
64
|
+
name: "check_outlook_messages",
|
|
65
|
+
description: "Read or search Outlook emails using the local Microsoft Office desktop session on this machine. " +
|
|
66
|
+
"Can list inbox messages, filter by read status, search by keyword, or retrieve a specific message by ID.",
|
|
67
|
+
category: "messaging",
|
|
68
|
+
parameters: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
folder: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: 'Mail folder to read from (default "inbox"). Common values: inbox, drafts, sentitems, deleteditems.',
|
|
74
|
+
default: "inbox",
|
|
75
|
+
},
|
|
76
|
+
limit: {
|
|
77
|
+
type: "number",
|
|
78
|
+
description: "Maximum number of messages to return (default 20, max 50).",
|
|
79
|
+
default: 20,
|
|
80
|
+
},
|
|
81
|
+
filter: {
|
|
82
|
+
type: "string",
|
|
83
|
+
description: 'OData filter expression, e.g. "isRead eq false" or "from/emailAddress/address eq \'alice@example.com\'".',
|
|
84
|
+
},
|
|
85
|
+
search: {
|
|
86
|
+
type: "string",
|
|
87
|
+
description: "KQL search query to find messages by keyword across subject, body, and participants.",
|
|
88
|
+
},
|
|
89
|
+
messageId: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "Optional message ID. When provided, returns the full message detail instead of a list.",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
required: [],
|
|
95
|
+
},
|
|
96
|
+
riskLevel: "safe",
|
|
97
|
+
isReadOnly: true,
|
|
98
|
+
loadingTier: "always",
|
|
99
|
+
execute: async (input) => {
|
|
100
|
+
const typedInput = input;
|
|
101
|
+
try {
|
|
102
|
+
if (typeof typedInput.messageId === "string" && typedInput.messageId) {
|
|
103
|
+
const raw = await runOutlook(["read", typedInput.messageId]);
|
|
104
|
+
const msg = normalizeMessage(parseJson(raw));
|
|
105
|
+
return {
|
|
106
|
+
success: true,
|
|
107
|
+
message: `Fetched Outlook message: ${msg.subject}`,
|
|
108
|
+
data: msg,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const args = ["check"];
|
|
112
|
+
const folder = typeof typedInput.folder === "string" ? typedInput.folder : "inbox";
|
|
113
|
+
args.push("--folder", folder);
|
|
114
|
+
args.push("--limit", String(typeof typedInput.limit === "number" ? typedInput.limit : 20));
|
|
115
|
+
if (typeof typedInput.filter === "string")
|
|
116
|
+
args.push("--filter", typedInput.filter);
|
|
117
|
+
if (typeof typedInput.search === "string")
|
|
118
|
+
args.push("--search", typedInput.search);
|
|
119
|
+
const raw = await runOutlook(args);
|
|
120
|
+
const json = parseJson(raw);
|
|
121
|
+
const rawMessages = Array.isArray(json.value) ? json.value : [];
|
|
122
|
+
const messages = rawMessages
|
|
123
|
+
.filter((m) => !!m && typeof m === "object")
|
|
124
|
+
.map(normalizeMessage);
|
|
125
|
+
return {
|
|
126
|
+
success: true,
|
|
127
|
+
message: `Fetched ${messages.length} Outlook messages from ${folder}.`,
|
|
128
|
+
data: { accountEmail: "hole@axon.com", folder, messages, totalCount: messages.length },
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
return {
|
|
133
|
+
success: false,
|
|
134
|
+
message: error instanceof Error ? error.message : "Outlook read failed.",
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
const send_outlook_message = {
|
|
140
|
+
name: "send_outlook_message",
|
|
141
|
+
description: "Send an email through the local Microsoft Office desktop session on this machine. " +
|
|
142
|
+
"Requires confirmation because it sends externally.",
|
|
143
|
+
category: "messaging",
|
|
144
|
+
parameters: {
|
|
145
|
+
type: "object",
|
|
146
|
+
properties: {
|
|
147
|
+
to: {
|
|
148
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
|
|
149
|
+
description: "Recipient email address(es).",
|
|
150
|
+
},
|
|
151
|
+
cc: {
|
|
152
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
|
|
153
|
+
description: "CC email address(es).",
|
|
154
|
+
},
|
|
155
|
+
subject: {
|
|
156
|
+
type: "string",
|
|
157
|
+
description: "Email subject line.",
|
|
158
|
+
},
|
|
159
|
+
body: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "Email body content.",
|
|
162
|
+
},
|
|
163
|
+
bodyType: {
|
|
164
|
+
type: "string",
|
|
165
|
+
enum: ["text", "html"],
|
|
166
|
+
description: 'Body content type (default "text").',
|
|
167
|
+
default: "text",
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
required: ["to", "subject", "body"],
|
|
171
|
+
},
|
|
172
|
+
riskLevel: "dangerous",
|
|
173
|
+
requiresConfirmation: true,
|
|
174
|
+
isReadOnly: false,
|
|
175
|
+
loadingTier: "always",
|
|
176
|
+
execute: async (input) => {
|
|
177
|
+
const typedInput = input;
|
|
178
|
+
try {
|
|
179
|
+
const toArray = Array.isArray(typedInput.to)
|
|
180
|
+
? typedInput.to
|
|
181
|
+
: typeof typedInput.to === "string"
|
|
182
|
+
? [typedInput.to]
|
|
183
|
+
: [];
|
|
184
|
+
const args = [
|
|
185
|
+
"send",
|
|
186
|
+
"--to",
|
|
187
|
+
toArray.join(","),
|
|
188
|
+
"--subject",
|
|
189
|
+
String(typedInput.subject ?? ""),
|
|
190
|
+
"--body",
|
|
191
|
+
String(typedInput.body ?? ""),
|
|
192
|
+
];
|
|
193
|
+
if (typedInput.cc) {
|
|
194
|
+
const ccArray = Array.isArray(typedInput.cc) ? typedInput.cc : [typedInput.cc];
|
|
195
|
+
args.push("--cc", ccArray.join(","));
|
|
196
|
+
}
|
|
197
|
+
if (typedInput.bodyType === "html")
|
|
198
|
+
args.push("--html");
|
|
199
|
+
await runOutlook(args);
|
|
200
|
+
return {
|
|
201
|
+
success: true,
|
|
202
|
+
message: `Sent email to ${toArray.join(", ")}.`,
|
|
203
|
+
data: { status: "sent" },
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
return {
|
|
208
|
+
success: false,
|
|
209
|
+
message: error instanceof Error ? error.message : "Outlook send failed.",
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
const reply_outlook_message = {
|
|
215
|
+
name: "reply_outlook_message",
|
|
216
|
+
description: "Reply to an Outlook email thread using the local Microsoft Office desktop session on this machine. " +
|
|
217
|
+
"Requires confirmation because it sends externally.",
|
|
218
|
+
category: "messaging",
|
|
219
|
+
parameters: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
messageId: {
|
|
223
|
+
type: "string",
|
|
224
|
+
description: "The ID of the message to reply to.",
|
|
225
|
+
},
|
|
226
|
+
body: {
|
|
227
|
+
type: "string",
|
|
228
|
+
description: "Reply body content.",
|
|
229
|
+
},
|
|
230
|
+
bodyType: {
|
|
231
|
+
type: "string",
|
|
232
|
+
enum: ["text", "html"],
|
|
233
|
+
description: 'Body content type (default "text").',
|
|
234
|
+
default: "text",
|
|
235
|
+
},
|
|
236
|
+
replyAll: {
|
|
237
|
+
type: "boolean",
|
|
238
|
+
description: "Whether to reply to all recipients (default false — reply to sender only).",
|
|
239
|
+
default: false,
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
required: ["messageId", "body"],
|
|
243
|
+
},
|
|
244
|
+
riskLevel: "dangerous",
|
|
245
|
+
requiresConfirmation: true,
|
|
246
|
+
isReadOnly: false,
|
|
247
|
+
loadingTier: "always",
|
|
248
|
+
execute: async (input) => {
|
|
249
|
+
const typedInput = input;
|
|
250
|
+
try {
|
|
251
|
+
const args = [
|
|
252
|
+
"reply",
|
|
253
|
+
String(typedInput.messageId ?? ""),
|
|
254
|
+
"--body",
|
|
255
|
+
String(typedInput.body ?? ""),
|
|
256
|
+
];
|
|
257
|
+
if (typedInput.replyAll)
|
|
258
|
+
args.push("--reply-all");
|
|
259
|
+
if (typedInput.bodyType === "html")
|
|
260
|
+
args.push("--html");
|
|
261
|
+
await runOutlook(args);
|
|
262
|
+
return {
|
|
263
|
+
success: true,
|
|
264
|
+
message: "Replied to message.",
|
|
265
|
+
data: { status: "sent" },
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
return {
|
|
270
|
+
success: false,
|
|
271
|
+
message: error instanceof Error ? error.message : "Outlook reply failed.",
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
exports.OUTLOOK_TOOL_DEFINITIONS = [
|
|
277
|
+
check_outlook_messages,
|
|
278
|
+
send_outlook_message,
|
|
279
|
+
reply_outlook_message,
|
|
280
|
+
];
|
|
281
|
+
//# sourceMappingURL=outlook.js.map
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Originally from OpenClaw (MIT License, Copyright 2025 Peter Steinberger)
|
|
3
|
+
// https://github.com/openclaw/openclaw
|
|
4
|
+
// Modified for ARIA — stripped OpenClaw runtime, rewired to ARIA Tool interface
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.applyPatchTool = void 0;
|
|
10
|
+
exports.applyPatch = applyPatch;
|
|
11
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
12
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
13
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
14
|
+
const patch_parser_js_1 = require("./patch-parser.js");
|
|
15
|
+
const fuzzy_match_js_1 = require("./fuzzy-match.js");
|
|
16
|
+
const sandbox_paths_js_1 = require("./sandbox-paths.js");
|
|
17
|
+
// ── Path Helpers ───────────────────────────────────────────────────
|
|
18
|
+
function expandPath(filePath) {
|
|
19
|
+
const normalized = (0, patch_parser_js_1.normalizeUnicodeSpaces)(filePath);
|
|
20
|
+
if (normalized === "~") {
|
|
21
|
+
return node_os_1.default.homedir();
|
|
22
|
+
}
|
|
23
|
+
if (normalized.startsWith("~/")) {
|
|
24
|
+
return node_os_1.default.homedir() + normalized.slice(1);
|
|
25
|
+
}
|
|
26
|
+
return normalized;
|
|
27
|
+
}
|
|
28
|
+
function resolvePathFromCwd(filePath, cwd) {
|
|
29
|
+
const expanded = expandPath(filePath);
|
|
30
|
+
if (node_path_1.default.isAbsolute(expanded)) {
|
|
31
|
+
return node_path_1.default.normalize(expanded);
|
|
32
|
+
}
|
|
33
|
+
return node_path_1.default.resolve(cwd, expanded);
|
|
34
|
+
}
|
|
35
|
+
function toDisplayPath(resolved, cwd) {
|
|
36
|
+
const relative = node_path_1.default.relative(cwd, resolved);
|
|
37
|
+
if (!relative || relative === "") {
|
|
38
|
+
return node_path_1.default.basename(resolved);
|
|
39
|
+
}
|
|
40
|
+
if (relative.startsWith("..") || node_path_1.default.isAbsolute(relative)) {
|
|
41
|
+
return resolved;
|
|
42
|
+
}
|
|
43
|
+
return relative;
|
|
44
|
+
}
|
|
45
|
+
// ── Path Resolution with Sandbox Validation ────────────────────────
|
|
46
|
+
async function resolvePatchPath(filePath, cwd, purpose = "readWrite") {
|
|
47
|
+
const resolved = (await (0, sandbox_paths_js_1.assertSandboxPath)({
|
|
48
|
+
filePath,
|
|
49
|
+
cwd,
|
|
50
|
+
root: cwd,
|
|
51
|
+
allowFinalSymlink: purpose === "unlink",
|
|
52
|
+
})).resolved;
|
|
53
|
+
return {
|
|
54
|
+
resolved,
|
|
55
|
+
display: toDisplayPath(resolved, cwd),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// ── Summary Helpers ────────────────────────────────────────────────
|
|
59
|
+
function recordSummary(summary, seen, bucket, value) {
|
|
60
|
+
if (seen[bucket].has(value)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
seen[bucket].add(value);
|
|
64
|
+
summary[bucket].push(value);
|
|
65
|
+
}
|
|
66
|
+
function formatSummary(summary) {
|
|
67
|
+
const lines = ["Success. Updated the following files:"];
|
|
68
|
+
for (const file of summary.added) {
|
|
69
|
+
lines.push(`A ${file}`);
|
|
70
|
+
}
|
|
71
|
+
for (const file of summary.modified) {
|
|
72
|
+
lines.push(`M ${file}`);
|
|
73
|
+
}
|
|
74
|
+
for (const file of summary.deleted) {
|
|
75
|
+
lines.push(`D ${file}`);
|
|
76
|
+
}
|
|
77
|
+
return lines.join("\n");
|
|
78
|
+
}
|
|
79
|
+
// ── Directory Helper ───────────────────────────────────────────────
|
|
80
|
+
async function ensureDir(filePath) {
|
|
81
|
+
const parent = node_path_1.default.dirname(filePath);
|
|
82
|
+
if (!parent || parent === ".") {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
await promises_1.default.mkdir(parent, { recursive: true });
|
|
86
|
+
}
|
|
87
|
+
async function applyPatch(input, options) {
|
|
88
|
+
const parsed = (0, patch_parser_js_1.parsePatchText)(input);
|
|
89
|
+
if (parsed.hunks.length === 0) {
|
|
90
|
+
return {
|
|
91
|
+
success: false,
|
|
92
|
+
summary: { added: [], modified: [], deleted: [] },
|
|
93
|
+
text: "No files were modified.",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const summary = {
|
|
97
|
+
added: [],
|
|
98
|
+
modified: [],
|
|
99
|
+
deleted: [],
|
|
100
|
+
};
|
|
101
|
+
const seen = {
|
|
102
|
+
added: new Set(),
|
|
103
|
+
modified: new Set(),
|
|
104
|
+
deleted: new Set(),
|
|
105
|
+
};
|
|
106
|
+
for (const hunk of parsed.hunks) {
|
|
107
|
+
if (hunk.kind === "add") {
|
|
108
|
+
const target = await resolvePatchPath(hunk.path, options.cwd);
|
|
109
|
+
await ensureDir(target.resolved);
|
|
110
|
+
await promises_1.default.writeFile(target.resolved, hunk.contents, "utf8");
|
|
111
|
+
recordSummary(summary, seen, "added", target.display);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (hunk.kind === "delete") {
|
|
115
|
+
const target = await resolvePatchPath(hunk.path, options.cwd, "unlink");
|
|
116
|
+
await promises_1.default.rm(target.resolved);
|
|
117
|
+
recordSummary(summary, seen, "deleted", target.display);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
// hunk.kind === "update"
|
|
121
|
+
const target = await resolvePatchPath(hunk.path, options.cwd);
|
|
122
|
+
const applied = await (0, fuzzy_match_js_1.applyUpdateHunk)(target.resolved, hunk.chunks, {
|
|
123
|
+
readFile: (p) => promises_1.default.readFile(p, "utf8"),
|
|
124
|
+
});
|
|
125
|
+
if (hunk.movePath) {
|
|
126
|
+
const moveTarget = await resolvePatchPath(hunk.movePath, options.cwd);
|
|
127
|
+
await ensureDir(moveTarget.resolved);
|
|
128
|
+
await promises_1.default.writeFile(moveTarget.resolved, applied, "utf8");
|
|
129
|
+
await promises_1.default.rm(target.resolved);
|
|
130
|
+
recordSummary(summary, seen, "modified", moveTarget.display);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
await promises_1.default.writeFile(target.resolved, applied, "utf8");
|
|
134
|
+
recordSummary(summary, seen, "modified", target.display);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
success: true,
|
|
139
|
+
summary,
|
|
140
|
+
text: formatSummary(summary),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
// ── ARIA Tool Definition ───────────────────────────────────────────
|
|
144
|
+
exports.applyPatchTool = {
|
|
145
|
+
name: "apply_patch",
|
|
146
|
+
description: "Apply a patch to files using a structured format. Supports adding, deleting, updating, and renaming files with fuzzy line matching for resilient text replacement.",
|
|
147
|
+
category: "filesystem",
|
|
148
|
+
parameters: {
|
|
149
|
+
type: "object",
|
|
150
|
+
properties: {
|
|
151
|
+
patch: {
|
|
152
|
+
type: "string",
|
|
153
|
+
description: "The patch text in *** Begin Patch / *** End Patch format",
|
|
154
|
+
},
|
|
155
|
+
cwd: {
|
|
156
|
+
type: "string",
|
|
157
|
+
description: "Working directory for relative paths (defaults to process.cwd())",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
required: ["patch"],
|
|
161
|
+
},
|
|
162
|
+
riskLevel: "dangerous",
|
|
163
|
+
requiresConfirmation: true,
|
|
164
|
+
isReadOnly: false,
|
|
165
|
+
loadingTier: "always",
|
|
166
|
+
async execute(input, _context) {
|
|
167
|
+
const { patch, cwd } = input;
|
|
168
|
+
if (!patch || patch.trim() === "") {
|
|
169
|
+
return {
|
|
170
|
+
success: false,
|
|
171
|
+
message: "Patch content is empty.",
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
try {
|
|
175
|
+
const result = await applyPatch(patch, {
|
|
176
|
+
cwd: cwd ?? process.cwd(),
|
|
177
|
+
});
|
|
178
|
+
return {
|
|
179
|
+
success: result.success,
|
|
180
|
+
message: result.text,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
185
|
+
return {
|
|
186
|
+
success: false,
|
|
187
|
+
message: `apply_patch failed: ${message}`,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=apply-patch.js.map
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Originally from OpenClaw (MIT License, Copyright 2025 Peter Steinberger)
|
|
3
|
+
// https://github.com/openclaw/openclaw
|
|
4
|
+
// Modified for ARIA — stripped OpenClaw runtime, rewired to ARIA Tool interface
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.applyUpdateHunk = applyUpdateHunk;
|
|
10
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
11
|
+
async function defaultReadFile(filePath) {
|
|
12
|
+
return promises_1.default.readFile(filePath, "utf8");
|
|
13
|
+
}
|
|
14
|
+
async function applyUpdateHunk(filePath, chunks, options) {
|
|
15
|
+
const reader = options?.readFile ?? defaultReadFile;
|
|
16
|
+
const originalContents = await reader(filePath).catch((err) => {
|
|
17
|
+
throw new Error(`Failed to read file to update ${filePath}: ${err}`);
|
|
18
|
+
});
|
|
19
|
+
const originalLines = originalContents.split("\n");
|
|
20
|
+
if (originalLines.length > 0 && originalLines[originalLines.length - 1] === "") {
|
|
21
|
+
originalLines.pop();
|
|
22
|
+
}
|
|
23
|
+
const replacements = computeReplacements(originalLines, filePath, chunks);
|
|
24
|
+
let newLines = applyReplacements(originalLines, replacements);
|
|
25
|
+
if (newLines.length === 0 || newLines[newLines.length - 1] !== "") {
|
|
26
|
+
newLines = [...newLines, ""];
|
|
27
|
+
}
|
|
28
|
+
return newLines.join("\n");
|
|
29
|
+
}
|
|
30
|
+
function computeReplacements(originalLines, filePath, chunks) {
|
|
31
|
+
const replacements = [];
|
|
32
|
+
let lineIndex = 0;
|
|
33
|
+
for (const chunk of chunks) {
|
|
34
|
+
if (chunk.changeContext) {
|
|
35
|
+
const ctxIndex = seekSequence(originalLines, [chunk.changeContext], lineIndex, false);
|
|
36
|
+
if (ctxIndex === null) {
|
|
37
|
+
throw new Error(`Failed to find context '${chunk.changeContext}' in ${filePath}`);
|
|
38
|
+
}
|
|
39
|
+
lineIndex = ctxIndex + 1;
|
|
40
|
+
}
|
|
41
|
+
if (chunk.oldLines.length === 0) {
|
|
42
|
+
const insertionIndex = originalLines.length > 0 && originalLines[originalLines.length - 1] === ""
|
|
43
|
+
? originalLines.length - 1
|
|
44
|
+
: originalLines.length;
|
|
45
|
+
replacements.push([insertionIndex, 0, chunk.newLines]);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
let pattern = chunk.oldLines;
|
|
49
|
+
let newSlice = chunk.newLines;
|
|
50
|
+
let found = seekSequence(originalLines, pattern, lineIndex, chunk.isEndOfFile);
|
|
51
|
+
if (found === null && pattern[pattern.length - 1] === "") {
|
|
52
|
+
pattern = pattern.slice(0, -1);
|
|
53
|
+
if (newSlice.length > 0 && newSlice[newSlice.length - 1] === "") {
|
|
54
|
+
newSlice = newSlice.slice(0, -1);
|
|
55
|
+
}
|
|
56
|
+
found = seekSequence(originalLines, pattern, lineIndex, chunk.isEndOfFile);
|
|
57
|
+
}
|
|
58
|
+
if (found === null) {
|
|
59
|
+
throw new Error(`Failed to find expected lines in ${filePath}:\n${chunk.oldLines.join("\n")}`);
|
|
60
|
+
}
|
|
61
|
+
replacements.push([found, pattern.length, newSlice]);
|
|
62
|
+
lineIndex = found + pattern.length;
|
|
63
|
+
}
|
|
64
|
+
replacements.sort((a, b) => a[0] - b[0]);
|
|
65
|
+
return replacements;
|
|
66
|
+
}
|
|
67
|
+
function applyReplacements(lines, replacements) {
|
|
68
|
+
const result = [...lines];
|
|
69
|
+
for (let rIdx = replacements.length - 1; rIdx >= 0; rIdx -= 1) {
|
|
70
|
+
const entry = replacements[rIdx];
|
|
71
|
+
const startIndex = entry[0];
|
|
72
|
+
const oldLen = entry[1];
|
|
73
|
+
const newLines = entry[2];
|
|
74
|
+
for (let i = 0; i < oldLen; i += 1) {
|
|
75
|
+
if (startIndex < result.length) {
|
|
76
|
+
result.splice(startIndex, 1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
for (let i = 0; i < newLines.length; i += 1) {
|
|
80
|
+
result.splice(startIndex + i, 0, newLines[i]);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
function seekSequence(lines, pattern, start, eof) {
|
|
86
|
+
if (pattern.length === 0) {
|
|
87
|
+
return start;
|
|
88
|
+
}
|
|
89
|
+
if (pattern.length > lines.length) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
const maxStart = lines.length - pattern.length;
|
|
93
|
+
const searchStart = eof && lines.length >= pattern.length ? maxStart : start;
|
|
94
|
+
if (searchStart > maxStart) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
// Pass 1: exact match
|
|
98
|
+
for (let i = searchStart; i <= maxStart; i += 1) {
|
|
99
|
+
if (linesMatch(lines, pattern, i, (value) => value)) {
|
|
100
|
+
return i;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Pass 2: trim trailing whitespace
|
|
104
|
+
for (let i = searchStart; i <= maxStart; i += 1) {
|
|
105
|
+
if (linesMatch(lines, pattern, i, (value) => value.trimEnd())) {
|
|
106
|
+
return i;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Pass 3: trim all whitespace
|
|
110
|
+
for (let i = searchStart; i <= maxStart; i += 1) {
|
|
111
|
+
if (linesMatch(lines, pattern, i, (value) => value.trim())) {
|
|
112
|
+
return i;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Pass 4: normalize punctuation + trim
|
|
116
|
+
for (let i = searchStart; i <= maxStart; i += 1) {
|
|
117
|
+
if (linesMatch(lines, pattern, i, (value) => normalizePunctuation(value.trim()))) {
|
|
118
|
+
return i;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
function linesMatch(lines, pattern, start, normalize) {
|
|
124
|
+
for (let idx = 0; idx < pattern.length; idx += 1) {
|
|
125
|
+
if (normalize(lines[start + idx]) !== normalize(pattern[idx])) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
function normalizePunctuation(value) {
|
|
132
|
+
return Array.from(value)
|
|
133
|
+
.map((char) => {
|
|
134
|
+
switch (char) {
|
|
135
|
+
case "\u2010":
|
|
136
|
+
case "\u2011":
|
|
137
|
+
case "\u2012":
|
|
138
|
+
case "\u2013":
|
|
139
|
+
case "\u2014":
|
|
140
|
+
case "\u2015":
|
|
141
|
+
case "\u2212":
|
|
142
|
+
return "-";
|
|
143
|
+
case "\u2018":
|
|
144
|
+
case "\u2019":
|
|
145
|
+
case "\u201A":
|
|
146
|
+
case "\u201B":
|
|
147
|
+
return "'";
|
|
148
|
+
case "\u201C":
|
|
149
|
+
case "\u201D":
|
|
150
|
+
case "\u201E":
|
|
151
|
+
case "\u201F":
|
|
152
|
+
return '"';
|
|
153
|
+
case "\u00A0":
|
|
154
|
+
case "\u2002":
|
|
155
|
+
case "\u2003":
|
|
156
|
+
case "\u2004":
|
|
157
|
+
case "\u2005":
|
|
158
|
+
case "\u2006":
|
|
159
|
+
case "\u2007":
|
|
160
|
+
case "\u2008":
|
|
161
|
+
case "\u2009":
|
|
162
|
+
case "\u200A":
|
|
163
|
+
case "\u202F":
|
|
164
|
+
case "\u205F":
|
|
165
|
+
case "\u3000":
|
|
166
|
+
return " ";
|
|
167
|
+
default:
|
|
168
|
+
return char;
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
.join("");
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=fuzzy-match.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyPatchTool = void 0;
|
|
4
|
+
var apply_patch_js_1 = require("./apply-patch.js");
|
|
5
|
+
Object.defineProperty(exports, "applyPatchTool", { enumerable: true, get: function () { return apply_patch_js_1.applyPatchTool; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|