silentlake 2026.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4587 -0
- package/LICENSE +21 -0
- package/README.md +248 -0
- package/assets/avatar-placeholder.svg +19 -0
- package/assets/chrome-extension/icons/icon128.png +0 -0
- package/assets/chrome-extension/icons/icon16.png +0 -0
- package/assets/chrome-extension/icons/icon32.png +0 -0
- package/assets/chrome-extension/icons/icon48.png +0 -0
- package/assets/dmg-background-small.png +0 -0
- package/assets/dmg-background.png +0 -0
- package/assets/silentlake-banner.png +0 -0
- package/dist/APEv2Parser-BZv_dP9t.js +269 -0
- package/dist/APEv2Parser-CPzxFNBB.js +5 -0
- package/dist/AbstractID3Parser-mvDFcjYV.js +47 -0
- package/dist/AiffParser-BXQ9SRZk.js +145 -0
- package/dist/AsfParser-CmBDUlZE.js +631 -0
- package/dist/BasicParser-DhmXREDo.js +853 -0
- package/dist/DsdiffParser-CTKKGyZg.js +150 -0
- package/dist/DsfParser-Ds-YQe4Z.js +101 -0
- package/dist/FlacParser-B1XVPgXF.js +5 -0
- package/dist/FlacParser-DMPyL1y4.js +367 -0
- package/dist/ID3v1Parser-BICWWVDG.js +289 -0
- package/dist/ID3v2Parser-BmZHSUqs.js +650 -0
- package/dist/ID3v2Token-DeJf4tYQ.js +145 -0
- package/dist/MP4Parser-Cjf-Zs8T.js +1061 -0
- package/dist/MatroskaParser-DgBzBe8t.js +909 -0
- package/dist/MpegParser-D5swTpA1.js +744 -0
- package/dist/MusepackParser-D8EQXnpK.js +285 -0
- package/dist/OggParser-BcIYPHwP.js +390 -0
- package/dist/Util-D_zGsr97.js +170 -0
- package/dist/WavPackParser-hosU8gfo.js +166 -0
- package/dist/WaveParser-CA00FZrC.js +273 -0
- package/dist/abort-cutoff-CERmtgZI.js +56 -0
- package/dist/abort-cutoff.runtime-DZkGKKzv.js +61 -0
- package/dist/abort-signal-CsrBEr94.js +13 -0
- package/dist/account-helpers-D3c_eI7c.js +37 -0
- package/dist/account-helpers-ru3jdZSV.js +12 -0
- package/dist/account-id-DZnNZg8x.js +1 -0
- package/dist/account-id-ZCrgXl7Z.js +44 -0
- package/dist/account-lookup-nkoa-foB.js +10 -0
- package/dist/account-snapshot-fields-Cvq7803C.js +116 -0
- package/dist/account-summary-B5Xzvntm.js +36 -0
- package/dist/accounts-43SvCDEA.js +212 -0
- package/dist/accounts-CYgFhv2o.js +105 -0
- package/dist/accounts-ChlyF7cx.js +112 -0
- package/dist/ack-reactions-CNVwfOBj.js +43 -0
- package/dist/acp-cli-B4Rv7-xU.js +2033 -0
- package/dist/acp-runtime-BdLdT-QY.js +1 -0
- package/dist/actions.runtime-CqnQssoB.js +217 -0
- package/dist/actions.runtime-FLmCvVRd.js +236 -0
- package/dist/agent-CBOdzEvR.js +1 -0
- package/dist/agent-scope-BLhzf-o0.js +17 -0
- package/dist/agent-scope-DPP4Z_UU.js +193 -0
- package/dist/agents-D8pBK0II.js +855 -0
- package/dist/agents-Dihz1Ihx.js +323 -0
- package/dist/agents.config-C_lrnc9J.js +18 -0
- package/dist/agents.config-D1VqC78r.js +121 -0
- package/dist/allow-from-BPSBITdd.js +9 -0
- package/dist/allow-from-BwTLpvhp.js +20 -0
- package/dist/allow-from-C4iBpqFI.js +62 -0
- package/dist/allowlist-config-edit-CKbnMmwS.js +279 -0
- package/dist/allowlist-match-CYmPgg1K.js +63 -0
- package/dist/ansi-BEJF8NKS.js +54 -0
- package/dist/anthropic-vertex-provider-Dd5agCN9.js +60 -0
- package/dist/apply.runtime-DhKxNSJE.js +370 -0
- package/dist/apply.runtime-ghlh-P6X.js +211 -0
- package/dist/archive-Tr0wIUO-.js +532 -0
- package/dist/arg-split-Dtda0YDl.js +38 -0
- package/dist/artifacts-C_4LekPC.js +39 -0
- package/dist/audit-BOPSQQtd.js +54 -0
- package/dist/audit-C5kdrCi_.js +788 -0
- package/dist/audit-channel.allow-from.runtime-B7BHNblL.js +17 -0
- package/dist/audit-channel.collect.runtime-CjAbXFBV.js +521 -0
- package/dist/audit-channel.discord.runtime-BBY6S9lg.js +5 -0
- package/dist/audit-channel.telegram.runtime-SJnxOJH2.js +8 -0
- package/dist/audit-channel.zalouser.runtime-SGRWvHxT.js +5 -0
- package/dist/audit-extra.async-DY8v7LXH.js +817 -0
- package/dist/audit-fs-oDMUa5N_.js +375 -0
- package/dist/audit-membership-runtime-BPjFryEx.js +261 -0
- package/dist/audit.deep.runtime-WFf-TpsD.js +31 -0
- package/dist/audit.nondeep.runtime-B4BaEaRU.js +842 -0
- package/dist/audit.runtime-rFjCrods.js +74 -0
- package/dist/auth-O6LQFLHJ.js +416 -0
- package/dist/auth-choice-DIBaxmAQ.js +219 -0
- package/dist/auth-choice-PrbpIjyg.js +610 -0
- package/dist/auth-choice-legacy-Clyw2lVc.js +17 -0
- package/dist/auth-choice-options-ohUw8QR-.js +127 -0
- package/dist/auth-choice-prompt-Cm0s-9Du.js +215 -0
- package/dist/auth-choice-prompt-DI-Xl1Nv.js +36 -0
- package/dist/auth-choice-rKBOd02a.js +64 -0
- package/dist/auth-choice.apply-helpers-BibBSEl9.js +66 -0
- package/dist/auth-choice.plugin-providers.runtime-gqF9NO7_.js +219 -0
- package/dist/auth-health-TWboMYA5.js +166 -0
- package/dist/auth-mode-policy-DywddkT-.js +18 -0
- package/dist/auth-profiles-CWEIQV77.js +1047 -0
- package/dist/auth-profiles.runtime-B98lwopF.js +48 -0
- package/dist/avatar-policy-Ds9e6uHI.js +67 -0
- package/dist/axios-xDDnM0KG.js +12831 -0
- package/dist/backup-create-B6JAR6jJ.js +461 -0
- package/dist/banner-bez5CpOK.js +351 -0
- package/dist/base-session-key-Cf2rkwag.js +14 -0
- package/dist/bindings-BV4AtNSY.js +21 -0
- package/dist/bindings-kjwuC11Q.js +69 -0
- package/dist/bluebubbles-C1M3Geg0.js +87 -0
- package/dist/bluebubbles-DRW3JdOY.js +603 -0
- package/dist/bluebubbles-dEl4QpYz.js +37 -0
- package/dist/bonjour-discovery-C2oY96BG.js +376 -0
- package/dist/boolean-DKtCJu_W.js +29 -0
- package/dist/boolean-param-xAGXUSSN.js +13 -0
- package/dist/boundary-file-read-BP6VMpqH.js +106 -0
- package/dist/boundary-path-B3FFLYNx.js +557 -0
- package/dist/brave-CkimJe4j.js +405 -0
- package/dist/brew-DSwWqzLd.js +44 -0
- package/dist/browser-cli-D3kBUBNc.js +1502 -0
- package/dist/bundled/boot-md/handler.js +381 -0
- package/dist/bundled/bootstrap-extra-files/handler.js +56 -0
- package/dist/bundled/command-logger/handler.js +62 -0
- package/dist/bundled/session-memory/handler.js +401 -0
- package/dist/call-BDvaXe4i.js +44 -0
- package/dist/call-BmLt3xO1.js +639 -0
- package/dist/catalog-BwAYUfL7.js +240 -0
- package/dist/channel-BBCuV5OT.js +4945 -0
- package/dist/channel-BDBXuqeg.js +321 -0
- package/dist/channel-C8h1Irxm.js +1284 -0
- package/dist/channel-CbGpFzo4.js +1602 -0
- package/dist/channel-Ci3K8fI9.js +1006 -0
- package/dist/channel-DGT5N1v7.js +1077 -0
- package/dist/channel-account-context-Bwa-YH_o.js +104 -0
- package/dist/channel-actions-DU2CR3xW.js +37 -0
- package/dist/channel-activity-B8aReQoE.js +35 -0
- package/dist/channel-config-3Uv6ve2_.js +115 -0
- package/dist/channel-config-helpers-CieQWILI.js +377 -0
- package/dist/channel-config-schema-DEVsCZpj.js +1 -0
- package/dist/channel-feedback-G6zh8efr.js +245 -0
- package/dist/channel-inbound-DwzVf2PK.js +395 -0
- package/dist/channel-lifecycle-CpU1dRbh.js +354 -0
- package/dist/channel-options-DJaIP4Dv.js +38 -0
- package/dist/channel-pairing-D54mn51y.js +66 -0
- package/dist/channel-plugin-common-BhTxCE5t.js +1 -0
- package/dist/channel-plugin-ids-CFeS3qir.js +26 -0
- package/dist/channel-plugin-resolution-DUngfdFj.js +112 -0
- package/dist/channel-policy-C4GKHvhz.js +1 -0
- package/dist/channel-reply-pipeline-CPTuaW8n.js +15 -0
- package/dist/channel-send-result-By8EpCPw.js +40 -0
- package/dist/channel-setup-Ck35g7zI.js +49 -0
- package/dist/channel-shared-LkXtTPXk.js +308 -0
- package/dist/channel-summary-CdYLGMVt.js +137 -0
- package/dist/channel-summary-D33z52ft.js +41 -0
- package/dist/channel-targets-DfnKGXez.js +87 -0
- package/dist/channel.runtime-DAyBR2A5.js +324 -0
- package/dist/channel.runtime-DVq5tC2D.js +35 -0
- package/dist/channel.runtime-DaLTDGtF.js +288 -0
- package/dist/channel.runtime-FKfTev2g.js +512 -0
- package/dist/channel.runtime-owqedh1t.js +268 -0
- package/dist/channel.runtime-wOTeiifp.js +230 -0
- package/dist/channels-CIHgkPea.js +408 -0
- package/dist/channels-ZXK6Jiuk.js +1393 -0
- package/dist/channels-cli-Bj6qSlkE.js +412 -0
- package/dist/channels-status-issues-C_U44M8Y.js +16 -0
- package/dist/chat-type-C-n03mQY.js +10 -0
- package/dist/clack-prompter-DuzDnaLi.js +112 -0
- package/dist/clawbot-cli-YNPuwmTB.js +218 -0
- package/dist/cli/daemon-cli.js +88 -0
- package/dist/cli-CW46WAZn.js +254 -0
- package/dist/cli-name-Daok7A7-.js +25 -0
- package/dist/cli-runtime-aAVwbEYy.js +7 -0
- package/dist/cli-utils-Np4NAAtt.js +39 -0
- package/dist/command-format-CYK9XiUC.js +16 -0
- package/dist/command-format-g8YUHNir.js +2 -0
- package/dist/command-gating-BQXGSqc9.js +40 -0
- package/dist/command-options-5coRiipK.js +25 -0
- package/dist/command-poll-backoff-CpkSns-6.js +56 -0
- package/dist/command-poll-backoff.runtime-YT6EGcLN.js +7 -0
- package/dist/command-registry-BI2MOs89.js +242 -0
- package/dist/command-registry-BMsxnuoC.js +14 -0
- package/dist/command-secret-gateway-ChXyZwos.js +211 -0
- package/dist/command-secret-targets-COcwhn-D.js +88 -0
- package/dist/command-secret-targets-CQJT3viO.js +3 -0
- package/dist/commands-Bb9xUwz9.js +42 -0
- package/dist/commands-core-C1usZXC2.js +4923 -0
- package/dist/commands-core.runtime-OTZivlO2.js +232 -0
- package/dist/commands-registry-ChCep1KJ.js +295 -0
- package/dist/commands-registry.data-XyUTELK9.js +904 -0
- package/dist/commands-registry.runtime-m5WTxFtv.js +25 -0
- package/dist/commands-status.runtime-C8_hpNgj.js +211 -0
- package/dist/commands.runtime-BZPnQKcW.js +232 -0
- package/dist/common-CUBlLRXB.js +457 -0
- package/dist/compact.runtime-Djmzpbn6.js +216 -0
- package/dist/completion-cli-D8tLgE5W.js +445 -0
- package/dist/completion-cli-Dz89naVA.js +17 -0
- package/dist/config-6sZwvXJD.js +88 -0
- package/dist/config-B7tPwoHZ.js +38 -0
- package/dist/config-DdDLrP_v.js +273 -0
- package/dist/config-cli-C10R8azD.js +945 -0
- package/dist/config-guard-B1c73BYQ.js +126 -0
- package/dist/config-helpers-3u5wfLBu.js +117 -0
- package/dist/config-pn7LKJdW.js +23 -0
- package/dist/config-presence-BmUF_5K9.js +79 -0
- package/dist/config-regex-CvZFnWkO.js +39 -0
- package/dist/config-runtime-CstET7fq.js +142 -0
- package/dist/config-schema-5YkIW1xw.js +270 -0
- package/dist/config-schema-B1UGMwZ8.js +31 -0
- package/dist/config-schema-DzlnsY3D.js +33 -0
- package/dist/config-state-CE0CGjey.js +288 -0
- package/dist/config-validation-CkVqgkHr.js +272 -0
- package/dist/config-value-DgJrpclm.js +25 -0
- package/dist/configure-DMkp7Sr4.js +1126 -0
- package/dist/configure-DOrQthLy.js +344 -0
- package/dist/connection-auth-BSQJeDOU.js +30 -0
- package/dist/constants-C_Scc680.js +71 -0
- package/dist/control-ui-assets-DjqeIg6A.js +232 -0
- package/dist/control-ui-shared-DP000Pxd.js +29 -0
- package/dist/conversation-runtime-1O0Aaolb.js +1458 -0
- package/dist/core-C7aHA4Aq.js +187 -0
- package/dist/core-command-descriptors-DCUYAEZd.js +96 -0
- package/dist/credentials-BPwBlm1X.js +265 -0
- package/dist/cron-cli-N2Hw_02d.js +579 -0
- package/dist/daemon-cli-DgfaF9xx.js +354 -0
- package/dist/daemon-install-CbclJo5M.js +134 -0
- package/dist/daemon-install-plan.shared-DK6BHlWI.js +222 -0
- package/dist/daemon-runtime-CbClrCwc.js +12 -0
- package/dist/dangerous-config-flags-BJtLWIk7.js +15 -0
- package/dist/dangerous-name-matching-DZa_t0RM.js +44 -0
- package/dist/dangerous-tools-yGPDFTHh.js +27 -0
- package/dist/date-time-DCAyaBop.js +118 -0
- package/dist/dedupe-Cgnk5BbX.js +55 -0
- package/dist/defaults-CEdZhIIb.js +6 -0
- package/dist/delegate-D4ql5N70.js +43 -0
- package/dist/deliver-B004w1Mv.js +212 -0
- package/dist/deliver-runtime-IYvc0giI.js +211 -0
- package/dist/delivery-queue-B19wDCjT.js +3 -0
- package/dist/delivery-queue-DrrqB4Hi.js +299 -0
- package/dist/device-auth-GEXe9vqR.js +15 -0
- package/dist/device-bootstrap-CwwokLEY.js +96 -0
- package/dist/device-bootstrap-Dbhe6oe8.js +1 -0
- package/dist/device-metadata-normalization-BDSQ_eA7.js +21 -0
- package/dist/device-pairing-cFWbBray.js +553 -0
- package/dist/devices-cli-DzycjFzS.js +366 -0
- package/dist/diagnostic-DqJXx_4Q.js +310 -0
- package/dist/diagnostic-events-ktCoG8Br.js +48 -0
- package/dist/diagnostics-CMhyGsPu.js +33 -0
- package/dist/diagnostics-DpLHpQ9c.js +14 -0
- package/dist/directive-handling.fast-lane-toP_ri_H.js +273 -0
- package/dist/directive-handling.impl-BRARyrsT.js +638 -0
- package/dist/directive-handling.impl-CUB4MOnK.js +214 -0
- package/dist/directive-handling.levels-8vnMeuGX.js +2 -0
- package/dist/directive-handling.levels-CoruY1AA.js +13 -0
- package/dist/directive-handling.persist.runtime-78Du6PgL.js +170 -0
- package/dist/directive-handling.shared-DCGUCHjn.js +147 -0
- package/dist/directory-cli-DVsDcgIU.js +437 -0
- package/dist/directory-config-helpers-CURJ8mj7.js +129 -0
- package/dist/directory-runtime-DhC8QkMq.js +19 -0
- package/dist/directory.static-DQaG9ohH.js +44 -0
- package/dist/discord-CYj8s73O.js +214 -0
- package/dist/discord-L9zvSHVn.js +635 -0
- package/dist/discord-core-5tkl-BzP.js +1 -0
- package/dist/dm-policy-shared-6bCJzHOS.js +188 -0
- package/dist/dns-cli-BMvHy265.js +223 -0
- package/dist/docker-XFNiArwM.js +1254 -0
- package/dist/docs-cli-BTaH94wD.js +176 -0
- package/dist/doctor-completion-DKx5m2UC.js +90 -0
- package/dist/doctor-config-preflight-BzQgc3_t.js +40 -0
- package/dist/doctor-config-preflight-DxVCut8L.js +150 -0
- package/dist/doctor-state-migrations-CTF66iAy.js +732 -0
- package/dist/doctor-state-migrations-D0VP4dUh.js +212 -0
- package/dist/entry-status-B2OWAf0s.js +172 -0
- package/dist/entry.js +210 -0
- package/dist/env-BP70DGuy.js +30 -0
- package/dist/env-overrides-JneV60sd.js +434 -0
- package/dist/env-overrides.runtime-DLrwions.js +18 -0
- package/dist/env-substitution-D6t_sLS_.js +136 -0
- package/dist/errors-BxyFnvP3.js +58 -0
- package/dist/exec-Dmex2w_d.js +310 -0
- package/dist/exec-approvals-BJhuySBz.js +386 -0
- package/dist/exec-approvals-allowlist-B_wPddCb.js +384 -0
- package/dist/exec-approvals-cli-C2dwhSkX.js +427 -0
- package/dist/exec-safe-bin-runtime-policy-BZkObC8r.js +89 -0
- package/dist/exec-safety-CaaBy-Zw.js +24 -0
- package/dist/extension-shared-5txN7IXK.js +74 -0
- package/dist/extensionAPI.js +218 -0
- package/dist/extensions/amazon-bedrock/index.js +231 -0
- package/dist/extensions/anthropic/index.js +330 -0
- package/dist/extensions/bluebubbles/index.js +224 -0
- package/dist/extensions/bluebubbles/setup-entry.js +289 -0
- package/dist/extensions/brave/index.js +23 -0
- package/dist/extensions/byteplus/index.js +112 -0
- package/dist/extensions/chutes/index.js +221 -0
- package/dist/extensions/cloudflare-ai-gateway/index.js +218 -0
- package/dist/extensions/copilot-proxy/index.js +125 -0
- package/dist/extensions/device-pair/index.js +1040 -0
- package/dist/extensions/discord/index.js +215 -0
- package/dist/extensions/discord/setup-entry.js +215 -0
- package/dist/extensions/elevenlabs/index.js +223 -0
- package/dist/extensions/fal/index.js +112 -0
- package/dist/extensions/feishu/index.js +227 -0
- package/dist/extensions/feishu/setup-entry.js +112 -0
- package/dist/extensions/firecrawl/index.js +211 -0
- package/dist/extensions/github-copilot/index.js +490 -0
- package/dist/extensions/google/index.js +211 -0
- package/dist/extensions/huggingface/index.js +108 -0
- package/dist/extensions/imessage/index.js +223 -0
- package/dist/extensions/imessage/setup-entry.js +220 -0
- package/dist/extensions/irc/index.js +220 -0
- package/dist/extensions/irc/setup-entry.js +222 -0
- package/dist/extensions/kilocode/index.js +282 -0
- package/dist/extensions/kimi-coding/index.js +148 -0
- package/dist/extensions/line/index.js +57 -0
- package/dist/extensions/line/setup-entry.js +49 -0
- package/dist/extensions/llm-task/index.js +157 -0
- package/dist/extensions/lobster/index.js +261 -0
- package/dist/extensions/mattermost/index.js +220 -0
- package/dist/extensions/mattermost/setup-entry.js +222 -0
- package/dist/extensions/memory-core/index.js +36 -0
- package/dist/extensions/microsoft/index.js +223 -0
- package/dist/extensions/minimax/index.js +437 -0
- package/dist/extensions/mistral/index.js +149 -0
- package/dist/extensions/modelstudio/index.js +144 -0
- package/dist/extensions/moonshot/index.js +211 -0
- package/dist/extensions/nextcloud-talk/index.js +221 -0
- package/dist/extensions/nextcloud-talk/setup-entry.js +223 -0
- package/dist/extensions/nvidia/index.js +29 -0
- package/dist/extensions/ollama/index.js +118 -0
- package/dist/extensions/open-prose/index.js +10 -0
- package/dist/extensions/openai/index.js +677 -0
- package/dist/extensions/opencode/index.js +116 -0
- package/dist/extensions/opencode-go/index.js +114 -0
- package/dist/extensions/openrouter/index.js +398 -0
- package/dist/extensions/openshell/index.js +923 -0
- package/dist/extensions/perplexity/index.js +23 -0
- package/dist/extensions/phone-control/index.js +276 -0
- package/dist/extensions/qianfan/index.js +114 -0
- package/dist/extensions/qwen-portal-auth/index.js +350 -0
- package/dist/extensions/sglang/index.js +285 -0
- package/dist/extensions/signal/index.js +218 -0
- package/dist/extensions/signal/setup-entry.js +218 -0
- package/dist/extensions/slack/index.js +222 -0
- package/dist/extensions/slack/setup-entry.js +220 -0
- package/dist/extensions/synology-chat/index.js +56 -0
- package/dist/extensions/synology-chat/setup-entry.js +58 -0
- package/dist/extensions/synthetic/index.js +112 -0
- package/dist/extensions/talk-voice/index.js +197 -0
- package/dist/extensions/tavily/index.js +211 -0
- package/dist/extensions/telegram/index.js +221 -0
- package/dist/extensions/telegram/setup-entry.js +221 -0
- package/dist/extensions/thread-ownership/index.js +70 -0
- package/dist/extensions/together/index.js +113 -0
- package/dist/extensions/venice/index.js +132 -0
- package/dist/extensions/vercel-ai-gateway/index.js +86 -0
- package/dist/extensions/vllm/index.js +285 -0
- package/dist/extensions/voice-call/index.js +5715 -0
- package/dist/extensions/volcengine/index.js +112 -0
- package/dist/extensions/xai/index.js +211 -0
- package/dist/extensions/xiaomi/index.js +115 -0
- package/dist/extensions/zai/index.js +559 -0
- package/dist/extensions/zalo/index.js +225 -0
- package/dist/extensions/zalo/setup-entry.js +226 -0
- package/dist/external-content-BUdUOqkv.js +238 -0
- package/dist/feishu-CgbwAF0e.js +2664 -0
- package/dist/feishu-Dh5fEbh5.js +59127 -0
- package/dist/fetch-guard-DIyN1HW5.js +165 -0
- package/dist/fetch-timeout-C5xpMuGd.js +36 -0
- package/dist/file-identity-Cw0fQxYY.js +11 -0
- package/dist/file-lock-WbEmczmY.js +107 -0
- package/dist/filter-oMGaNOM1.js +20 -0
- package/dist/format-DH8ysi7s.js +19 -0
- package/dist/format-datetime-BGS6tLDE.js +73 -0
- package/dist/format-duration-CO0BGWB0.js +57 -0
- package/dist/format-relative-C3nDxnXz.js +54 -0
- package/dist/frontmatter-S5vS-I4a.js +309 -0
- package/dist/fs-safe-D3qzH-ab.js +731 -0
- package/dist/gateway-cli-PQNp7o0j.js +28378 -0
- package/dist/gateway-install-token-DV5KjD4F.js +164 -0
- package/dist/gateway-rpc-C0Ey-rik.js +26 -0
- package/dist/gateway-runtime-ih2e7a2K.js +42 -0
- package/dist/gaxios-fetch-compat-KX6bsqFm.js +165 -0
- package/dist/gemini-auth-B5ljg7jr.js +29 -0
- package/dist/git-commit-BIdLubm5.js +2 -0
- package/dist/git-commit-OvUvjri2.js +177 -0
- package/dist/github-copilot-auth-Ccm-cBwy.js +104 -0
- package/dist/global-singleton-4KwY5RvX.js +13 -0
- package/dist/globals-41sdSaKv.js +38 -0
- package/dist/gmail-setup-utils-BX68dZla.js +419 -0
- package/dist/group-access-DJZrYPx1.js +113 -0
- package/dist/group-keys-BD_IYSMs.js +44 -0
- package/dist/group-policy-CWFxv3iB.js +201 -0
- package/dist/group-policy-warnings-Ddu6lBkh.js +175 -0
- package/dist/health-Bu1sbyYy.js +573 -0
- package/dist/health-Cbxc9Bn3.js +59 -0
- package/dist/health-format-B5XfOTuJ.js +26 -0
- package/dist/heartbeat-7aHh0m3d.js +169 -0
- package/dist/heartbeat-summary-Das49TYq.js +57 -0
- package/dist/help-CcbF7-ha.js +81 -0
- package/dist/help-format-Dv45FpYu.js +15 -0
- package/dist/helpers-DJ-5HEbE.js +24 -0
- package/dist/helpers-MxyaLZUk.js +32 -0
- package/dist/history-CHjo8B5W.js +102 -0
- package/dist/hook-runtime-BnNBi_q4.js +1 -0
- package/dist/hooks-cli-DUYK4RM1.js +1102 -0
- package/dist/hooks-policy-BL6HDLUn.js +20 -0
- package/dist/hooks-status-gzNmo3li.js +78 -0
- package/dist/host-env-security-BogNN146.js +223 -0
- package/dist/http-body-CCiSfloA.js +237 -0
- package/dist/http-registry-WFFbLYRd.js +153 -0
- package/dist/identity-DovQV4zD.js +112 -0
- package/dist/identity-cyBYcoXS.js +84 -0
- package/dist/identity-file-EndG1nfc.js +60 -0
- package/dist/image-generation-CNKc-mFK.js +441 -0
- package/dist/image-kJ7Tbov4.js +211 -0
- package/dist/image-ops-j01UkxEv.js +371 -0
- package/dist/imessage-B5pSMT47.js +219 -0
- package/dist/imessage-CoIuY1Ro.js +1451 -0
- package/dist/imessage-Cqjsq4VW.js +190 -0
- package/dist/imessage-core-CsYJuaRZ.js +1 -0
- package/dist/inbound-envelope-4P3IIJc3.js +61 -0
- package/dist/inbound-reply-dispatch-i2Vekqyy.js +72 -0
- package/dist/includes-7XyL3p1c.js +188 -0
- package/dist/includes-scan-y-rS6tTw.js +55 -0
- package/dist/index.js +57 -0
- package/dist/infra/warning-filter.js +2 -0
- package/dist/inspect-CcxlJ1ba.js +279 -0
- package/dist/install-safe-path-Rwbw1XCZ.js +62 -0
- package/dist/installs-iHi2aSjM.js +532 -0
- package/dist/interactive-F7iY0yED.js +8 -0
- package/dist/interactive-runtime-OweOj_Vv.js +90 -0
- package/dist/internal-hooks-0uipqzRY.js +156 -0
- package/dist/io-BX49DsSJ.js +35 -0
- package/dist/io-jOnQRia2.js +7178 -0
- package/dist/ip-C8vmzVu0.js +203 -0
- package/dist/ipv4-DAmsJVOV.js +82 -0
- package/dist/irc-AZ-Ec8be.js +12 -0
- package/dist/irc-CCSRuEC2.js +660 -0
- package/dist/is-main-YViS6wOn.js +27 -0
- package/dist/issue-format-CBEXVico.js +31 -0
- package/dist/issue-format-D3HehoKZ.js +4 -0
- package/dist/json-file-C2zjA0Gv.js +23 -0
- package/dist/json-files-WW-H_psG.js +60 -0
- package/dist/json-pointer-f9dEnBoR.js +43 -0
- package/dist/json-store-O1LwpnBH.js +37 -0
- package/dist/kb-cli-DMZs6PCu.js +65 -0
- package/dist/keyed-async-queue-CPUWV5Pm.js +32 -0
- package/dist/kill-tree-CbjXBw3z.js +149 -0
- package/dist/kilocode-shared-DS7_0IMs.js +29 -0
- package/dist/launchd-tyqGVx9U.js +491 -0
- package/dist/lazy-runtime-BcXbyAaC.js +1 -0
- package/dist/lazy-runtime-bWkd2cs3.js +29 -0
- package/dist/legacy-names-CUNZ4vHN.js +7 -0
- package/dist/legacy-web-search-BgZjNG2h.js +222 -0
- package/dist/lib-CERS7N4b.js +503 -0
- package/dist/lib-PPICrHv1.js +1938 -0
- package/dist/library-CZ461krl.js +211 -0
- package/dist/lifecycle-core-Dnxnw0oy.js +382 -0
- package/dist/line/accounts.js +10 -0
- package/dist/line/send.js +39 -0
- package/dist/line/template-messages.js +2 -0
- package/dist/line-CJSvwApm.js +1 -0
- package/dist/line-N9vL-2JB.js +688 -0
- package/dist/line-core-BOIxkjgu.js +1 -0
- package/dist/links-Bilm-v0z.js +13 -0
- package/dist/llm-slug-generator-BuAuQ5Ft.js +68 -0
- package/dist/llm-slug-generator.js +212 -0
- package/dist/llm-task-Dx8ymRFr.js +1 -0
- package/dist/local-roots-DAzCjWbC.js +34 -0
- package/dist/location-DefAH9WS.js +42 -0
- package/dist/logger-CoEtkjhn.js +550 -0
- package/dist/logger-Cqy7-Maj.js +70 -0
- package/dist/logging-B2wMcpWV.js +13 -0
- package/dist/logging-Bz1qZDPg.js +16 -0
- package/dist/logging-CArEWRgI.js +36 -0
- package/dist/logging-CbTTfADU.js +1 -0
- package/dist/logs-cli-BSjKwaur.js +261 -0
- package/dist/magic-string.es-DJPWMt-n.js +1011 -0
- package/dist/main-session-DKr0lBVk.js +36 -0
- package/dist/manager-ChTGDe87.js +2005 -0
- package/dist/manager-DuwFn87U.js +4226 -0
- package/dist/manager-runtime-E16jsvRe.js +59 -0
- package/dist/manager.runtime-F9F1eFiB.js +827 -0
- package/dist/manifest-registry-B90TyTWl.js +1350 -0
- package/dist/map-size-CMTQVKUV.js +15 -0
- package/dist/markdown-to-line-BWwaRx5F.js +640 -0
- package/dist/mask-api-key-CprzEe7l.js +10 -0
- package/dist/matrix-DzvdUw97.js +228 -0
- package/dist/matrix-migration-snapshot-adoDbNii.js +702 -0
- package/dist/mattermost-DO0BCfF3.js +1 -0
- package/dist/mattermost-SjOt4QDb.js +15 -0
- package/dist/mcp-cli-BC_VPl_o.js +94 -0
- package/dist/mcp-config-Coky4zS4.js +108 -0
- package/dist/media-limits-Cuvmmhop.js +14 -0
- package/dist/media-understanding-DD2uMjK8.js +48 -0
- package/dist/media-understanding.runtime-Kbb2bRmk.js +216 -0
- package/dist/memory-DBjQ0TPd.js +1 -0
- package/dist/memory-cli-Cm4Df0hJ.js +215 -0
- package/dist/memory-cli-yzqneSF8.js +541 -0
- package/dist/memory-search-Das1tiuB.js +204 -0
- package/dist/memory-search-DxmSTjHq.js +18 -0
- package/dist/mention-gating-B_q-EHFx.js +25 -0
- package/dist/mentions-Bxys_va0.js +154 -0
- package/dist/message-channel-Cy-gN4K2.js +106 -0
- package/dist/message-hook-mappers-BBTV3JRQ.js +249 -0
- package/dist/method-scopes-DgypDW23.js +2649 -0
- package/dist/mime-C4vVTBso.js +150 -0
- package/dist/minimal-C5yUxtHy.js +2120 -0
- package/dist/model-auth-B__TJTPw.js +309 -0
- package/dist/model-auth-env-CF9ts7Th.js +111 -0
- package/dist/model-catalog.runtime-CWh17vcc.js +211 -0
- package/dist/model-id-normalization-Y-MIsyK_.js +16 -0
- package/dist/model-input-BB2wSAHb.js +20 -0
- package/dist/model-overrides-sIzKU2wo.js +84 -0
- package/dist/model-param-b-DIFEhICm.js +15 -0
- package/dist/model-picker-CAPjetT3.js +400 -0
- package/dist/model-picker-DEw9viWc.js +215 -0
- package/dist/model-picker.runtime-ixYl7lB5.js +224 -0
- package/dist/model-selection-BTpJnslv.js +437 -0
- package/dist/model-selection-Ci9cPkL2.js +765 -0
- package/dist/model-suppression.runtime-D8cIb6Y5.js +216 -0
- package/dist/models-BQtc3khN.js +226 -0
- package/dist/models-CQgBV5dW.js +2536 -0
- package/dist/models-cli-DbQ-QpQk.js +418 -0
- package/dist/models-config-D2xK-G6c.js +211 -0
- package/dist/models-config.providers.discovery-BaIk1NKL.js +141 -0
- package/dist/models-config.runtime-Cf7q9uAQ.js +211 -0
- package/dist/monitor-B5QmKaD7.js +3272 -0
- package/dist/monitor-CL5OYLih.js +878 -0
- package/dist/monitor-CNZxrM4d.js +3145 -0
- package/dist/monitor-CyQVZdDh.js +223 -0
- package/dist/multimodal-DC43jYNv.js +75 -0
- package/dist/mutable-allowlist-detectors-C6EAzWYE.js +62 -0
- package/dist/net-DlJFp95v.js +270 -0
- package/dist/network-mode-DOgvmom4.js +17 -0
- package/dist/nextcloud-talk-ChMP88s-.js +12 -0
- package/dist/nextcloud-talk-CwnkUy8E.js +1 -0
- package/dist/node-cli-BZDC7rXg.js +2484 -0
- package/dist/node-command-policy-Bg2g6Xjp.js +192 -0
- package/dist/node-commands-B6W6Eo0b.js +11 -0
- package/dist/node-require-BgDD9bTi.js +14 -0
- package/dist/node-resolve-BunMro3f.js +69 -0
- package/dist/node-service-CEZZaqba.js +65 -0
- package/dist/node-startup-env-Gz8ZQniA.js +50 -0
- package/dist/nodes-cli-B4Jr9vct.js +1330 -0
- package/dist/nodes-screen-CQ7IvP62.js +401 -0
- package/dist/normalize-secret-input-_PgpexOG.js +32 -0
- package/dist/note-dfjacCV8.js +109 -0
- package/dist/npm-pack-install-CYNRv-vM.js +574 -0
- package/dist/npm-resolution-Ml2aA6Nu.js +60 -0
- package/dist/oauth.runtime-DA_48MPQ.js +687 -0
- package/dist/oauth.runtime-DS1ry5__.js +318 -0
- package/dist/oauth.runtime-qCkidk8J.js +180 -0
- package/dist/ollama-defaults-asNuGW4_.js +4 -0
- package/dist/onboard-BM6gO6Uw.js +589 -0
- package/dist/onboard-D9IU-7uw.js +48 -0
- package/dist/onboard-DQaHGPRm.js +25 -0
- package/dist/onboard-channels-BdQtLjYb.js +300 -0
- package/dist/onboard-channels-DIVUygs5.js +1257 -0
- package/dist/onboard-config-DFKb-0sE.js +29 -0
- package/dist/onboard-config-DYykzJhx.js +2 -0
- package/dist/onboard-custom-CDP4w1AT.js +216 -0
- package/dist/onboard-custom-DhJN13UV.js +644 -0
- package/dist/onboard-helpers-B7XTd4Pw.js +335 -0
- package/dist/onboard-helpers-BUKtx5Bq.js +54 -0
- package/dist/onboard-hooks-BHSSLAhI.js +73 -0
- package/dist/onboard-remote-BOzEPdHA.js +59 -0
- package/dist/onboard-remote-DVza19_k.js +182 -0
- package/dist/onboard-search-CrS-n9_3.js +446 -0
- package/dist/onboard-skills-BojzIPvk.js +133 -0
- package/dist/onboard-skills-D7HyCVjz.js +69 -0
- package/dist/openai-codex-provider.runtime-BFsopDHI.js +2 -0
- package/dist/openai-defaults-B7FUywsh.js +10 -0
- package/dist/openclaw-exec-env-AcZ9we1N.js +14 -0
- package/dist/openclaw-root-TUHYdr9B.js +88 -0
- package/dist/openclaw-tools.runtime-draZJo5r.js +211 -0
- package/dist/outbound-media-69yrWRDt.js +11 -0
- package/dist/outbound-runtime-ic_7ulJJ.js +1 -0
- package/dist/pairing-challenge-CNrPmmi9.js +48 -0
- package/dist/pairing-cli-BohXW2BK.js +150 -0
- package/dist/pairing-labels-CNKCSmBK.js +7 -0
- package/dist/pairing-message-CBv2njJT.js +4 -0
- package/dist/pairing-store-C4lsd4pO.js +590 -0
- package/dist/pairing-token-gKj4SNFJ.js +55 -0
- package/dist/parse-duration-BBGYkY0S.js +41 -0
- package/dist/parse-finite-number-CP4MQF_w.js +30 -0
- package/dist/parse-log-line-CVh9zu3Q.js +43 -0
- package/dist/parse-port-COyt3COn.js +8 -0
- package/dist/path-alias-guards-ZTKqurNH.js +40 -0
- package/dist/path-env-CPkz6U0Y.js +87 -0
- package/dist/paths-CTjJI9l0.js +179 -0
- package/dist/paths-GHJ97ebE.js +268 -0
- package/dist/paths-nCHyK08H.js +56 -0
- package/dist/perplexity-Beshd9zu.js +422 -0
- package/dist/persistent-dedupe-bjKjVI5u.js +116 -0
- package/dist/pi-embedded-CSQySvOV.js +168518 -0
- package/dist/pi-model-discovery-CuX5CDyZ.js +125 -0
- package/dist/pi-model-discovery-runtime-DNsMrX1n.js +44 -0
- package/dist/pi-tools.before-tool-call.runtime-DxVqzMVf.js +387 -0
- package/dist/platform-launcher-CqGy6UhP.js +83 -0
- package/dist/plugin-entry-CwuwM1jC.js +17 -0
- package/dist/plugin-install-JJwfOXtg.js +216 -0
- package/dist/plugin-install-plan-cixz1_W4.js +49 -0
- package/dist/plugin-install-vkpI1UNd.js +184 -0
- package/dist/plugin-registry-C3j_DUnj.js +51 -0
- package/dist/plugin-registry-DB_yxabS.js +213 -0
- package/dist/plugin-sdk/account-helpers.js +3 -0
- package/dist/plugin-sdk/account-id.js +2 -0
- package/dist/plugin-sdk/account-resolution.js +216 -0
- package/dist/plugin-sdk/acp-runtime.js +46 -0
- package/dist/plugin-sdk/agent-runtime.js +215 -0
- package/dist/plugin-sdk/allow-from.js +17 -0
- package/dist/plugin-sdk/allowlist-config-edit.js +2 -0
- package/dist/plugin-sdk/bluebubbles.js +232 -0
- package/dist/plugin-sdk/boolean-param.js +2 -0
- package/dist/plugin-sdk/channel-actions.js +16 -0
- package/dist/plugin-sdk/channel-config-helpers.js +15 -0
- package/dist/plugin-sdk/channel-config-schema.js +5 -0
- package/dist/plugin-sdk/channel-contract.js +1 -0
- package/dist/plugin-sdk/channel-feedback.js +4 -0
- package/dist/plugin-sdk/channel-inbound.js +53 -0
- package/dist/plugin-sdk/channel-lifecycle.js +2 -0
- package/dist/plugin-sdk/channel-pairing.js +2 -0
- package/dist/plugin-sdk/channel-policy.js +19 -0
- package/dist/plugin-sdk/channel-reply-pipeline.js +23 -0
- package/dist/plugin-sdk/channel-runtime.js +33 -0
- package/dist/plugin-sdk/channel-send-result.js +2 -0
- package/dist/plugin-sdk/channel-setup.js +24 -0
- package/dist/plugin-sdk/channel-targets.js +3 -0
- package/dist/plugin-sdk/cli-runtime.js +5 -0
- package/dist/plugin-sdk/command-auth.js +212 -0
- package/dist/plugin-sdk/compat.js +59 -0
- package/dist/plugin-sdk/config-runtime.js +51 -0
- package/dist/plugin-sdk/conversation-runtime.js +55 -0
- package/dist/plugin-sdk/core.js +40 -0
- package/dist/plugin-sdk/device-bootstrap.js +6 -0
- package/dist/plugin-sdk/diagnostics-otel.js +7 -0
- package/dist/plugin-sdk/diffs.js +3 -0
- package/dist/plugin-sdk/directory-runtime.js +5 -0
- package/dist/plugin-sdk/discord-core.js +26 -0
- package/dist/plugin-sdk/discord.js +219 -0
- package/dist/plugin-sdk/extension-shared.js +15 -0
- package/dist/plugin-sdk/feishu.js +101 -0
- package/dist/plugin-sdk/gateway-runtime.js +46 -0
- package/dist/plugin-sdk/googlechat.js +93 -0
- package/dist/plugin-sdk/group-access.js +2 -0
- package/dist/plugin-sdk/hook-runtime.js +12 -0
- package/dist/plugin-sdk/image-generation.js +51 -0
- package/dist/plugin-sdk/imessage-core.js +214 -0
- package/dist/plugin-sdk/imessage.js +223 -0
- package/dist/plugin-sdk/index.js +55 -0
- package/dist/plugin-sdk/infra-runtime.js +223 -0
- package/dist/plugin-sdk/interactive-runtime.js +3 -0
- package/dist/plugin-sdk/irc.js +232 -0
- package/dist/plugin-sdk/json-store.js +9 -0
- package/dist/plugin-sdk/keyed-async-queue.js +2 -0
- package/dist/plugin-sdk/lazy-runtime.js +2 -0
- package/dist/plugin-sdk/line-core.js +29 -0
- package/dist/plugin-sdk/line.js +22 -0
- package/dist/plugin-sdk/llm-task.js +7 -0
- package/dist/plugin-sdk/matrix-runtime-heavy.js +223 -0
- package/dist/plugin-sdk/matrix-runtime-shared.js +2 -0
- package/dist/plugin-sdk/matrix.js +84 -0
- package/dist/plugin-sdk/mattermost.js +233 -0
- package/dist/plugin-sdk/media-runtime.js +212 -0
- package/dist/plugin-sdk/media-understanding-runtime.js +211 -0
- package/dist/plugin-sdk/media-understanding.js +15 -0
- package/dist/plugin-sdk/memory-core.js +2 -0
- package/dist/plugin-sdk/memory-lancedb.js +2 -0
- package/dist/plugin-sdk/msteams.js +244 -0
- package/dist/plugin-sdk/nextcloud-talk.js +231 -0
- package/dist/plugin-sdk/nostr.js +50 -0
- package/dist/plugin-sdk/ollama-setup.js +33 -0
- package/dist/plugin-sdk/outbound-runtime.js +23 -0
- package/dist/plugin-sdk/plugin-entry.js +3 -0
- package/dist/plugin-sdk/plugin-runtime.js +211 -0
- package/dist/plugin-sdk/process-runtime.js +12 -0
- package/dist/plugin-sdk/provider-auth-api-key.js +53 -0
- package/dist/plugin-sdk/provider-auth-login.js +2 -0
- package/dist/plugin-sdk/provider-auth.js +37 -0
- package/dist/plugin-sdk/provider-catalog.js +2 -0
- package/dist/plugin-sdk/provider-env-vars.js +2 -0
- package/dist/plugin-sdk/provider-google.js +3 -0
- package/dist/plugin-sdk/provider-models.js +27 -0
- package/dist/plugin-sdk/provider-onboard.js +20 -0
- package/dist/plugin-sdk/provider-setup.js +58 -0
- package/dist/plugin-sdk/provider-stream.js +211 -0
- package/dist/plugin-sdk/provider-usage.js +18 -0
- package/dist/plugin-sdk/provider-web-search.js +23 -0
- package/dist/plugin-sdk/provider-zai-endpoint.js +3 -0
- package/dist/plugin-sdk/reply-history.js +23 -0
- package/dist/plugin-sdk/reply-payload.js +2 -0
- package/dist/plugin-sdk/reply-runtime.js +211 -0
- package/dist/plugin-sdk/request-url.js +2 -0
- package/dist/plugin-sdk/routing.js +25 -0
- package/dist/plugin-sdk/runtime-env.js +15 -0
- package/dist/plugin-sdk/runtime-store.js +2 -0
- package/dist/plugin-sdk/runtime.js +15 -0
- package/dist/plugin-sdk/sandbox.js +66 -0
- package/dist/plugin-sdk/secret-input.js +3 -0
- package/dist/plugin-sdk/security-runtime.js +18 -0
- package/dist/plugin-sdk/self-hosted-provider-setup.js +33 -0
- package/dist/plugin-sdk/setup-adapter-runtime.js +2 -0
- package/dist/plugin-sdk/setup-runtime.js +17 -0
- package/dist/plugin-sdk/setup-tools.js +21 -0
- package/dist/plugin-sdk/setup.js +26 -0
- package/dist/plugin-sdk/signal.js +220 -0
- package/dist/plugin-sdk/slack-core.js +22 -0
- package/dist/plugin-sdk/slack.js +223 -0
- package/dist/plugin-sdk/speech-runtime.js +213 -0
- package/dist/plugin-sdk/speech.js +212 -0
- package/dist/plugin-sdk/ssrf-runtime.js +5 -0
- package/dist/plugin-sdk/state-paths.js +3 -0
- package/dist/plugin-sdk/status-helpers.js +9 -0
- package/dist/plugin-sdk/telegram-core.js +23 -0
- package/dist/plugin-sdk/telegram.js +224 -0
- package/dist/plugin-sdk/testing.js +13174 -0
- package/dist/plugin-sdk/text-runtime.js +45 -0
- package/dist/plugin-sdk/thread-bindings-runtime.js +2 -0
- package/dist/plugin-sdk/thread-ownership.js +2 -0
- package/dist/plugin-sdk/tlon.js +57 -0
- package/dist/plugin-sdk/tool-send.js +2 -0
- package/dist/plugin-sdk/twitch.js +46 -0
- package/dist/plugin-sdk/voice-call.js +213 -0
- package/dist/plugin-sdk/web-media.js +28 -0
- package/dist/plugin-sdk/webhook-ingress.js +7 -0
- package/dist/plugin-sdk/webhook-path.js +2 -0
- package/dist/plugin-sdk/whatsapp-core.js +219 -0
- package/dist/plugin-sdk/whatsapp-shared.js +18 -0
- package/dist/plugin-sdk/windows-spawn.js +2 -0
- package/dist/plugin-sdk/zalo.js +239 -0
- package/dist/plugin-sdk/zalouser.js +240 -0
- package/dist/plugins/build-smoke-entry.js +211 -0
- package/dist/plugins/runtime/index.js +229 -0
- package/dist/plugins-1Z50ecJ6.js +1 -0
- package/dist/plugins-C6fKmNuA.js +7 -0
- package/dist/plugins-cli-BkgQkGaU.js +1192 -0
- package/dist/policy-CpkbSAfm.js +60 -0
- package/dist/polls-B2VH7SN9.js +35 -0
- package/dist/ports-BjWuIIQw.js +262 -0
- package/dist/ports-DFiK_Jc-.js +385 -0
- package/dist/ports-lsof-DtJqhFOr.js +25 -0
- package/dist/ports-probe-BQqp8l8E.js +14 -0
- package/dist/preflight-audio.runtime-Fi9mofpp.js +216 -0
- package/dist/probe-BM9sbCgS.js +20 -0
- package/dist/probe-DLBOZftS.js +134 -0
- package/dist/probe-auth-Bjp3G4CI.js +48 -0
- package/dist/probe-auth-DMSPTRRk.js +45 -0
- package/dist/process-runtime-C7el-Ri4.js +1 -0
- package/dist/process-scoped-map-C4gOa-gv.js +61 -0
- package/dist/profile-utils-BcMYGFPT.js +15 -0
- package/dist/profiles-D17eMKQZ.js +683 -0
- package/dist/program-Ch-76sgl.js +155 -0
- package/dist/program-context-BMWNUfqL.js +10 -0
- package/dist/program-context-CD_RvRYh.js +2 -0
- package/dist/progress-D1r9bZU1.js +132 -0
- package/dist/prompt-select-styled-NUKYS9QR.js +4879 -0
- package/dist/prompt-style-BvciNCqy.js +7 -0
- package/dist/prompts-NtuylUyl.js +9 -0
- package/dist/prototype-keys-Cm_8mWvq.js +11 -0
- package/dist/provider-api-key-auth-BE0taXiB.js +108 -0
- package/dist/provider-api-key-auth.runtime-jDZZUAMX.js +34 -0
- package/dist/provider-auth-Bw8x1a3o.js +58 -0
- package/dist/provider-auth-api-key-BrQYvdxi.js +1 -0
- package/dist/provider-auth-choice-BYbPq0eC.js +128 -0
- package/dist/provider-auth-choice-helpers-Bj1GkOSn.js +48 -0
- package/dist/provider-auth-choice-preference-tKq5gaJL.js +192 -0
- package/dist/provider-auth-choice.runtime-DegPpvRJ.js +223 -0
- package/dist/provider-auth-choices-QSilukI1.js +58 -0
- package/dist/provider-auth-guidance-gninjjq8.js +34 -0
- package/dist/provider-auth-helpers-B0dS-1WK.js +86 -0
- package/dist/provider-auth-input-BftBdgvW.js +112 -0
- package/dist/provider-auth-login-D0n0lMuc.js +8 -0
- package/dist/provider-auth-login.runtime-LvuBkQrc.js +243 -0
- package/dist/provider-auth-mode-sTdccIKL.js +20 -0
- package/dist/provider-auth-ref-BS3gwrNr.js +168 -0
- package/dist/provider-auth-ref-BmEcEN7K.js +3 -0
- package/dist/provider-catalog--18-pW5t.js +11 -0
- package/dist/provider-catalog-2P2hel74.js +48 -0
- package/dist/provider-catalog-B0FqWSwe.js +48 -0
- package/dist/provider-catalog-BvORKzzD.js +91 -0
- package/dist/provider-catalog-C34j1_or.js +26 -0
- package/dist/provider-catalog-C5vmXjmb.js +11 -0
- package/dist/provider-catalog-CBufm2Dr.js +36 -0
- package/dist/provider-catalog-D7QvsUXS.js +12 -0
- package/dist/provider-catalog-DKy_dzQZ.js +41 -0
- package/dist/provider-env-vars-CsQlY7bF.js +110 -0
- package/dist/provider-id-BpXo5t6v.js +31 -0
- package/dist/provider-model-allowlist-4HSOnlX-.js +24 -0
- package/dist/provider-model-primary-NJ-xlhec.js +53 -0
- package/dist/provider-models-C2EjYMwW.js +2416 -0
- package/dist/provider-oauth-flow-BQN6F6EC.js +33 -0
- package/dist/provider-ollama-setup-DhQvDwAj.js +309 -0
- package/dist/provider-onboard-CjOfyeQG.js +1 -0
- package/dist/provider-onboarding-config-DOZ3pFA6.js +165 -0
- package/dist/provider-openai-codex-oauth-tls-Bo8U4D3E.js +101 -0
- package/dist/provider-runtime.runtime-DnP2jpoM.js +211 -0
- package/dist/provider-self-hosted-setup-CUrmsugW.js +182 -0
- package/dist/provider-usage-ClDVmkhl.js +633 -0
- package/dist/provider-usage-DIC6cn-3.js +211 -0
- package/dist/provider-web-search-NzK8ep1E.js +507 -0
- package/dist/provider-wizard-C6jCuyQe.js +236 -0
- package/dist/provider-zai-endpoint-DeDABzT4.js +106 -0
- package/dist/proxy-H5O2p6AP.js +121 -0
- package/dist/proxy-env-DG2u55RW.js +40 -0
- package/dist/push-apns-D4zD2tmP.js +1050 -0
- package/dist/pw-ai-BuPUVeUK.js +1876 -0
- package/dist/qmd-manager-BpygGMW9.js +1571 -0
- package/dist/qr-cli-DnWHXcxh.js +370 -0
- package/dist/qr-cli-yaZ0FZ6z.js +213 -0
- package/dist/query-expansion-Do45hILP.js +1114 -0
- package/dist/reactions-BcC_XZqD.js +281 -0
- package/dist/read-only-account-inspect-DPJzadPo.js +42 -0
- package/dist/read-only-account-inspect.discord.runtime-CW9DDKH8.js +216 -0
- package/dist/read-only-account-inspect.slack.runtime-BcXBPyh3.js +216 -0
- package/dist/read-only-account-inspect.telegram.runtime-Y7h0Jbdj.js +216 -0
- package/dist/redact-BDinS1q9.js +102 -0
- package/dist/redact-identifier-FUiWQxv5.js +13 -0
- package/dist/redact-snapshot-DBPmeYy2.js +2654 -0
- package/dist/ref-contract-CCBBbf1r.js +53 -0
- package/dist/register-CppP7Ddc.js +43 -0
- package/dist/register.agent-BOD5ROGQ.js +546 -0
- package/dist/register.backup-Y2VGqcRu.js +269 -0
- package/dist/register.configure-1qiTINph.js +354 -0
- package/dist/register.maintenance-shn-zigv.js +694 -0
- package/dist/register.message-mR4CLSoo.js +812 -0
- package/dist/register.onboard-CkDryVid.js +298 -0
- package/dist/register.setup-B0xW5olD.js +318 -0
- package/dist/register.status-health-sessions-CuhWc03j.js +604 -0
- package/dist/register.subclis-BazXM5TW.js +315 -0
- package/dist/register.subclis-C2d8UDhH.js +13 -0
- package/dist/registry-C3q59Qj0.js +55 -0
- package/dist/registry-CPsHw6xU.js +219 -0
- package/dist/registry-CxgtJ09C.js +28 -0
- package/dist/registry-rgYi7KoO.js +160 -0
- package/dist/repair-qXnOAvDy.js +105 -0
- package/dist/replies-EiwmmZ_W.js +122 -0
- package/dist/reply-history-CVCD5oE9.js +1 -0
- package/dist/reply-payload-DBGc074f.js +232 -0
- package/dist/report-cli-DB1jQx32.js +42 -0
- package/dist/request-url-BKfWAQx8.js +10 -0
- package/dist/resolve-Ckjd8TAk.js +14 -0
- package/dist/resolve-T2q_0ARF.js +619 -0
- package/dist/resolve-route-vEY3ONZ2.js +466 -0
- package/dist/resolve-utils-CbqJY2bs.js +102 -0
- package/dist/response-generator-VdoCcQ3y.js +153 -0
- package/dist/restart-stale-pids-CLGiqU2E.js +187 -0
- package/dist/retry-D15TD1S3.js +168 -0
- package/dist/root-help-B9Aou4ho.js +32 -0
- package/dist/routes-TpLEcKO8.js +7084 -0
- package/dist/routing-Y3m0o-kB.js +26 -0
- package/dist/rpc-C6MN-nVc.js +67 -0
- package/dist/run-command-DRKv5Lj6.js +32 -0
- package/dist/run-main-YZSMdx0B.js +424 -0
- package/dist/run-with-concurrency-BrSjWzpg.js +41 -0
- package/dist/runtime-B66W9flm.js +43 -0
- package/dist/runtime-C9VaVKYZ.js +2338 -0
- package/dist/runtime-CT2LIJZu.js +91 -0
- package/dist/runtime-CqDQ81eY.js +143 -0
- package/dist/runtime-CuvWMN7E.js +89 -0
- package/dist/runtime-D4_OpzA1.js +5 -0
- package/dist/runtime-DP-4DZja.js +5 -0
- package/dist/runtime-Dl17x_cV.js +1 -0
- package/dist/runtime-Z35JoYPC.js +30 -0
- package/dist/runtime-api-D79M0lQN.js +1 -0
- package/dist/runtime-api-y3zfnQGK.js +39 -0
- package/dist/runtime-discord-ops.runtime-Bg5h5v9-.js +234 -0
- package/dist/runtime-env-a_iwdJIv.js +1 -0
- package/dist/runtime-forwarders-DtMc8rBP.js +44 -0
- package/dist/runtime-group-policy-B7irU4eu.js +59 -0
- package/dist/runtime-guard-y62lPDGY.js +58 -0
- package/dist/runtime-parse-CeqXmZHJ.js +84 -0
- package/dist/runtime-paths-CstaCCMi.js +334 -0
- package/dist/runtime-slack-ops.runtime-BumgKDhS.js +226 -0
- package/dist/runtime-status-CgL02wYX.js +15 -0
- package/dist/runtime-store-Bt3Sdbrn.js +22 -0
- package/dist/runtime-telegram-ops.runtime-rSLQ3KrE.js +233 -0
- package/dist/runtime-whatsapp-boundary-xZem0NyQ.js +364 -0
- package/dist/safe-open-sync-Bt9R1Mnf.js +83 -0
- package/dist/safe-regex-tLlDZYfM.js +244 -0
- package/dist/safe-text-B_CQuica.js +16 -0
- package/dist/sandbox-CUUouiKs.js +2795 -0
- package/dist/sandbox-cli-BN8y0Get.js +499 -0
- package/dist/sandbox-paths-fqp_TZdO.js +144 -0
- package/dist/sandbox-qSs4h3sk.js +1 -0
- package/dist/sanitize-env-vars-vNSNqm0y.js +74 -0
- package/dist/scan-paths-BJmvUZ1E.js +28 -0
- package/dist/search-manager-DWhFgwyp.js +17 -0
- package/dist/search-manager-r8Cw4ZRv.js +392 -0
- package/dist/secret-equal-ObQfyZGa.js +9 -0
- package/dist/secret-file-Ch0yuOXR.js +11 -0
- package/dist/secret-file-DYJtH6kf.js +92 -0
- package/dist/secret-input-4REZ4sHo.js +35 -0
- package/dist/secrets-cli-D1df8b0o.js +2304 -0
- package/dist/secure-random-Cs8tw_HQ.js +10 -0
- package/dist/security-cli-V66ESmdT.js +676 -0
- package/dist/security-runtime-BuEhpJVE.js +23 -0
- package/dist/send-3tabvle6.js +100 -0
- package/dist/send-CC5J3tyW.js +1026 -0
- package/dist/send-deps-CrFMNvqO.js +19 -0
- package/dist/send-i2-mdtiE.js +250 -0
- package/dist/server-BTOjmlyi.js +116 -0
- package/dist/server-middleware-CCqKhKUb.js +106 -0
- package/dist/server-node-events-D6y22Tt8.js +611 -0
- package/dist/server-startup-matrix-migration-DHWSoS73.js +1595 -0
- package/dist/service-Bxc9uL2e.js +774 -0
- package/dist/service-CBLajPZL.js +21 -0
- package/dist/session-cost-usage-BmbaBvk4.js +212 -0
- package/dist/session-cost-usage-C30Jl2SI.js +615 -0
- package/dist/session-fork.runtime-BZfcC1Nc.js +51 -0
- package/dist/session-key-gFFk3uv9.js +216 -0
- package/dist/session-write-lock-DNKvpjKf.js +324 -0
- package/dist/sessions-BIH_j_XS.js +222 -0
- package/dist/sessions-D5dWcxC_.js +212 -0
- package/dist/sessions-DaSBVNwD.js +669 -0
- package/dist/setup-C2XF1YH3.js +397 -0
- package/dist/setup-CN-teRpz.js +8 -0
- package/dist/setup-adapter-runtime-Bjv2adwG.js +1 -0
- package/dist/setup-binary-BOJA7zdN.js +30 -0
- package/dist/setup-browser-BhNPCUtK.js +71 -0
- package/dist/setup-core-BsG09DZH.js +149 -0
- package/dist/setup-core-D-O1GQax.js +162 -0
- package/dist/setup-core-Dtm54Rcq.js +510 -0
- package/dist/setup-entry-B1mTa7bU.js +10 -0
- package/dist/setup-entry-CTMgw-K5.js +13 -0
- package/dist/setup-entry-Cmd_cufO.js +13 -0
- package/dist/setup-entry-CybgA3zP.js +12 -0
- package/dist/setup-entry-DED_hL6i.js +12 -0
- package/dist/setup-entry-WCq9VMWx.js +14 -0
- package/dist/setup-group-access-BtPApRvE.js +70 -0
- package/dist/setup-helpers-B62Ecg9r.js +362 -0
- package/dist/setup-surface-B7A7qowY.js +452 -0
- package/dist/setup-surface-BBYJVRXc.js +380 -0
- package/dist/setup-surface-CFUz_BJi.js +298 -0
- package/dist/setup-tools-BPiMjAN7.js +1 -0
- package/dist/setup-wizard-helpers-COZ1UAdX.js +770 -0
- package/dist/setup-wizard-proxy-Slwi-1gX.js +116 -0
- package/dist/setup.finalize-B8O01nge.js +633 -0
- package/dist/setup.gateway-config-BPDIFk__.js +288 -0
- package/dist/setup.secret-input-BL-bqJpt.js +25 -0
- package/dist/shared-AygSbeCK.js +50 -0
- package/dist/shared-BHqDLkMG.js +127 -0
- package/dist/shared-BPtG8PgB.js +70 -0
- package/dist/shared-BU0QgVMZ.js +36 -0
- package/dist/shared-Bzr2UyEm.js +351 -0
- package/dist/shared-C_XXbGIF.js +87 -0
- package/dist/shared-Diw3KzwZ.js +82 -0
- package/dist/shared-DngjQumT.js +196 -0
- package/dist/shared-DzH3zmAy.js +64 -0
- package/dist/shared-LeP8iUTz.js +54 -0
- package/dist/shell-argv-DWV43Vya.js +72 -0
- package/dist/shell-env-cD92jEyV.js +181 -0
- package/dist/signal-BQd9f9dF.js +315 -0
- package/dist/signal-Ca7y47bM.js +46 -0
- package/dist/signal-Did9U_fa.js +214 -0
- package/dist/signal-cli-install-DxoL8CgF.js +188 -0
- package/dist/skill-commands-CiSwTFBQ.js +652 -0
- package/dist/skill-commands.runtime-CEwlWT4j.js +34 -0
- package/dist/skill-scanner-DG7MT7pu.js +354 -0
- package/dist/skills-BC8GJ9Rp.js +22 -0
- package/dist/skills-CCgKs_NJ.js +863 -0
- package/dist/skills-cli-dhYXJCuL.js +339 -0
- package/dist/skills-install-DiriUXJd.js +763 -0
- package/dist/skills-status-BmQTn4jL.js +23 -0
- package/dist/skills-status-a9b899Y3.js +169 -0
- package/dist/slack-CXgv7nu7.js +730 -0
- package/dist/slack-CcSByPzI.js +217 -0
- package/dist/slack-CtcCh0Lj.js +24537 -0
- package/dist/slack-core-DcsbATUs.js +1 -0
- package/dist/slash-commands.runtime-kO8EUKYW.js +228 -0
- package/dist/slash-dispatch.runtime-Bu2yMeFy.js +238 -0
- package/dist/slash-skill-commands.runtime-wwX3tF84.js +216 -0
- package/dist/speech-bSreRuDH.js +1 -0
- package/dist/speech-runtime-y1FcnGVA.js +1 -0
- package/dist/src-CmXHIz5f.js +846 -0
- package/dist/ssh-config-ChqR6ijV.js +77 -0
- package/dist/ssh-tunnel-Cz51VBAt.js +159 -0
- package/dist/ssh-tunnel-DWze2IQS.js +16 -0
- package/dist/ssrf-Dk9XaoKN.js +220 -0
- package/dist/ssrf-policy-Dk6oMa20.js +69 -0
- package/dist/ssrf-runtime-C-mAQLVA.js +1 -0
- package/dist/stagger-DU7FjHYo.js +54 -0
- package/dist/state-paths-DJIGEFq_.js +1 -0
- package/dist/status-69r8-Zey.js +75 -0
- package/dist/status-BdLTvZOL.js +44 -0
- package/dist/status-Bt7DQmRI.js +1665 -0
- package/dist/status-CoUFSBgt.js +202 -0
- package/dist/status-DbI3Kbh5.js +235 -0
- package/dist/status-DeKlzu_o.js +212 -0
- package/dist/status-Haie42Fc.js +606 -0
- package/dist/status-helpers-Cda-rGLX.js +101 -0
- package/dist/status-json-DS1M_MWJ.js +322 -0
- package/dist/status.link-channel-Cb8bZ_Od.js +40 -0
- package/dist/status.scan.deps.runtime-7_6VUs50.js +77 -0
- package/dist/status.scan.runtime-DtR8BIE9.js +14 -0
- package/dist/status.summary-l_Bi1buR.js +600 -0
- package/dist/status.summary.runtime-Cng6MzRU.js +151 -0
- package/dist/status.update-DtbnnPKx.js +79 -0
- package/dist/store-CvL8MPei.js +1446 -0
- package/dist/store.runtime-hgnvmZgO.js +43 -0
- package/dist/string-normalization-CvzuCAZv.js +19 -0
- package/dist/string-sample-BOLqzr4Y.js +11 -0
- package/dist/subagent-orphan-recovery-si1z2iBu.js +407 -0
- package/dist/subagent-registry-runtime-CXUDI8gL.js +211 -0
- package/dist/subcli-descriptors-CY_nHzpZ.js +151 -0
- package/dist/subsystem-CUp-6QQf.js +421 -0
- package/dist/synology-chat-CdejNfs0.js +12 -0
- package/dist/system-cli-DkOaXHkQ.js +99 -0
- package/dist/system-events-mAu6Ap6K.js +75 -0
- package/dist/system-message-DA9eUYzB.js +16 -0
- package/dist/system-run-command-Cxq2F1MB.js +258 -0
- package/dist/systemd-CrxZBFae.js +557 -0
- package/dist/systemd-hints-y-zJ9aTm.js +315 -0
- package/dist/systemd-linger-BdklDcLg.js +16 -0
- package/dist/systemd-linger-DLrbG9_d.js +68 -0
- package/dist/table-DFMOhmNZ.js +305 -0
- package/dist/tailnet-ofqBrXzu.js +38 -0
- package/dist/tailscale-Cbsx-2HB.js +254 -0
- package/dist/target-errors-ksphhzJg.js +26 -0
- package/dist/target-registry-krAVlXi_.js +1321 -0
- package/dist/telegram/audit.js +2 -0
- package/dist/telegram/token.js +211 -0
- package/dist/telegram-BjDUP22F.js +10910 -0
- package/dist/telegram-DMiNSGAJ.js +575 -0
- package/dist/telegram-Dt11B3JL.js +218 -0
- package/dist/telegram-core-B4Jo-uko.js +1 -0
- package/dist/template-messages-kh7VfgOb.js +214 -0
- package/dist/text-chunking-CUf5WgqG.js +19 -0
- package/dist/text-format-sFXlJfHH.js +8 -0
- package/dist/text-runtime-C_Roi_Je.js +1418 -0
- package/dist/theme-B5HDbQfl.js +2 -0
- package/dist/theme-CdOoMzRk.js +34 -0
- package/dist/thinking-BBD_0HSp.js +68 -0
- package/dist/thinking.shared-CncvRHts.js +246 -0
- package/dist/thread-bindings-messages-Cdo8jSa9.js +229 -0
- package/dist/thread-bindings-policy-DMjOaNyR.js +119 -0
- package/dist/thread-bindings-runtime-Ckwk3Uuz.js +1 -0
- package/dist/threading-helpers-Cq55SUtb.js +14 -0
- package/dist/timeouts-BwR1sGom.js +72 -0
- package/dist/tmp-openclaw-dir-idKIOMmb.js +102 -0
- package/dist/token-Bgv8XEsC.js +50 -0
- package/dist/tool-catalog-BV6FcEWS.js +337 -0
- package/dist/tool-policy-match-CHqTCSdK.js +46 -0
- package/dist/tool-send-9LXKcrda.js +16 -0
- package/dist/topology-cli-BhUXVViF.js +43 -0
- package/dist/transcript-events-B1V6z5ct.js +29 -0
- package/dist/tui-DDJMGCFK.js +3838 -0
- package/dist/tui-cli-ByN-ZH6y.js +237 -0
- package/dist/typebox-D0SHDJST.js +175 -0
- package/dist/types-BCKGVVld.js +83 -0
- package/dist/types-CtpUGsDP.js +30 -0
- package/dist/types.secrets-BWSeXrF4.js +80 -0
- package/dist/types.tools-BBO8HCi6.js +22 -0
- package/dist/typing-DG_YqWJ7.js +224 -0
- package/dist/unhandled-rejections-CDJ8dOVP.js +170 -0
- package/dist/unhandled-rejections-O6cVOz2D.js +4 -0
- package/dist/update-Br8U-txJ.js +1039 -0
- package/dist/update-check-C3TeQaWg.js +464 -0
- package/dist/update-cli-XHfIntD0.js +1625 -0
- package/dist/update-offset-store-36vzzZXw.js +211 -0
- package/dist/upsert-with-lock-Bb96JHpb.js +34 -0
- package/dist/url-userinfo-Db63ng4y.js +14 -0
- package/dist/utils-Bxk6BLTg.js +236 -0
- package/dist/utils-vDeUf98G.js +7 -0
- package/dist/version-DCY9_obP.js +64 -0
- package/dist/version-DRF-wKTV.js +2 -0
- package/dist/voice-call-D4fgwZNO.js +1 -0
- package/dist/warning-filter-CgvLQB4Y.js +56 -0
- package/dist/web-media-BfBb8i48.js +1 -0
- package/dist/web-media-CtU6jM5V.js +498 -0
- package/dist/webhook-ingress-CupqYpKM.js +338 -0
- package/dist/webhook-memory-guards-BHrFZ4yq.js +129 -0
- package/dist/webhook-path-BGFZ55ML.js +22 -0
- package/dist/webhook-shared-Cvk3b0ac.js +349 -0
- package/dist/webhooks-cli-vOAoBF9b.js +357 -0
- package/dist/whatsapp-D5nD0rGG.js +58 -0
- package/dist/whatsapp-DXbWlm3A.js +82 -0
- package/dist/whatsapp-core-C2WGMsaY.js +89451 -0
- package/dist/whatsapp-heartbeat-CSWnPQ7q.js +84 -0
- package/dist/whatsapp-shared-BmHKqTtR.js +95 -0
- package/dist/widearea-dns-CXimgJzu.js +125 -0
- package/dist/windows-argv-IXrdWrJj.js +145 -0
- package/dist/windows-spawn-vMJGZo89.js +154 -0
- package/dist/with-timeout-2AKTISee.js +58 -0
- package/dist/workspace-BH7CXmrr.js +479 -0
- package/dist/workspace-dirs-_O4V3xCR.js +13 -0
- package/dist/workspace-v5XppK5M.js +302 -0
- package/dist/ws-By-QcLjg.js +11 -0
- package/dist/wsl-BV3Cb66X.js +57 -0
- package/dist/zalo-CHQzsLhE.js +301 -0
- package/dist/zalo-CcJ3J9f2.js +13 -0
- package/dist/zod-schema.agent-runtime-T_EC_6fg.js +600 -0
- package/dist/zod-schema.core-BdgRr-F1.js +545 -0
- package/dist/zod-schema.providers-core-Dgq7MTqU.js +1613 -0
- package/docs/.i18n/README.md +31 -0
- package/docs/.i18n/glossary.ja-JP.json +14 -0
- package/docs/.i18n/glossary.zh-CN.json +242 -0
- package/docs/.i18n/ja-JP.tm.jsonl +0 -0
- package/docs/assets/install-script.svg +1 -0
- package/docs/assets/macos-onboarding/01-macos-warning.jpeg +0 -0
- package/docs/assets/macos-onboarding/02-local-networks.jpeg +0 -0
- package/docs/assets/macos-onboarding/03-security-notice.png +0 -0
- package/docs/assets/macos-onboarding/04-choose-gateway.png +0 -0
- package/docs/assets/macos-onboarding/05-permissions.png +0 -0
- package/docs/assets/openclaw-logo-text-dark.png +0 -0
- package/docs/assets/openclaw-logo-text-dark.svg +418 -0
- package/docs/assets/openclaw-logo-text.png +0 -0
- package/docs/assets/openclaw-logo-text.svg +418 -0
- package/docs/assets/pixel-lobster.svg +60 -0
- package/docs/assets/showcase/agents-ui.jpg +0 -0
- package/docs/assets/showcase/bambu-cli.png +0 -0
- package/docs/assets/showcase/codexmonitor.png +0 -0
- package/docs/assets/showcase/gohome-grafana.png +0 -0
- package/docs/assets/showcase/ios-testflight.jpg +0 -0
- package/docs/assets/showcase/oura-health.png +0 -0
- package/docs/assets/showcase/padel-cli.svg +11 -0
- package/docs/assets/showcase/padel-screenshot.jpg +0 -0
- package/docs/assets/showcase/papla-tts.jpg +0 -0
- package/docs/assets/showcase/pr-review-telegram.jpg +0 -0
- package/docs/assets/showcase/roborock-screenshot.jpg +0 -0
- package/docs/assets/showcase/roborock-status.svg +13 -0
- package/docs/assets/showcase/roof-camera-sky.jpg +0 -0
- package/docs/assets/showcase/snag.png +0 -0
- package/docs/assets/showcase/tesco-shop.jpg +0 -0
- package/docs/assets/showcase/wienerlinien.png +0 -0
- package/docs/assets/showcase/wine-cellar-skill.jpg +0 -0
- package/docs/assets/showcase/winix-air-purifier.jpg +0 -0
- package/docs/assets/showcase/xuezh-pronunciation.jpeg +0 -0
- package/docs/assets/sponsors/blacksmith.svg +14 -0
- package/docs/assets/sponsors/convex.svg +16 -0
- package/docs/assets/sponsors/openai.svg +3 -0
- package/docs/assets/sponsors/vercel.svg +5 -0
- package/docs/auth-credential-semantics.md +53 -0
- package/docs/automation/auth-monitoring.md +44 -0
- package/docs/automation/cron-jobs.md +727 -0
- package/docs/automation/cron-vs-heartbeat.md +286 -0
- package/docs/automation/gmail-pubsub.md +256 -0
- package/docs/automation/hooks.md +1049 -0
- package/docs/automation/poll.md +86 -0
- package/docs/automation/standing-orders.md +251 -0
- package/docs/automation/troubleshooting.md +122 -0
- package/docs/automation/webhook.md +217 -0
- package/docs/brave-search.md +93 -0
- package/docs/channels/bluebubbles.md +347 -0
- package/docs/channels/broadcast-groups.md +442 -0
- package/docs/channels/channel-routing.md +139 -0
- package/docs/channels/discord.md +1229 -0
- package/docs/channels/feishu.md +747 -0
- package/docs/channels/googlechat.md +261 -0
- package/docs/channels/group-messages.md +84 -0
- package/docs/channels/groups.md +379 -0
- package/docs/channels/imessage.md +367 -0
- package/docs/channels/index.md +47 -0
- package/docs/channels/irc.md +242 -0
- package/docs/channels/line.md +194 -0
- package/docs/channels/location.md +56 -0
- package/docs/channels/matrix.md +677 -0
- package/docs/channels/mattermost.md +427 -0
- package/docs/channels/msteams.md +780 -0
- package/docs/channels/nextcloud-talk.md +138 -0
- package/docs/channels/nostr.md +242 -0
- package/docs/channels/pairing.md +114 -0
- package/docs/channels/signal.md +329 -0
- package/docs/channels/slack.md +603 -0
- package/docs/channels/synology-chat.md +132 -0
- package/docs/channels/telegram.md +987 -0
- package/docs/channels/tlon.md +276 -0
- package/docs/channels/troubleshooting.md +118 -0
- package/docs/channels/twitch.md +379 -0
- package/docs/channels/whatsapp.md +460 -0
- package/docs/channels/zalo.md +243 -0
- package/docs/channels/zalouser.md +181 -0
- package/docs/ci.md +55 -0
- package/docs/cli/acp.md +288 -0
- package/docs/cli/agent.md +29 -0
- package/docs/cli/agents.md +123 -0
- package/docs/cli/approvals.md +50 -0
- package/docs/cli/backup.md +76 -0
- package/docs/cli/browser.md +106 -0
- package/docs/cli/channels.md +102 -0
- package/docs/cli/clawbot.md +21 -0
- package/docs/cli/completion.md +35 -0
- package/docs/cli/config.md +295 -0
- package/docs/cli/configure.md +36 -0
- package/docs/cli/cron.md +77 -0
- package/docs/cli/daemon.md +53 -0
- package/docs/cli/dashboard.md +22 -0
- package/docs/cli/devices.md +139 -0
- package/docs/cli/directory.md +63 -0
- package/docs/cli/dns.md +23 -0
- package/docs/cli/docs.md +15 -0
- package/docs/cli/doctor.md +48 -0
- package/docs/cli/gateway.md +235 -0
- package/docs/cli/health.md +21 -0
- package/docs/cli/hooks.md +318 -0
- package/docs/cli/index.md +1147 -0
- package/docs/cli/logs.md +28 -0
- package/docs/cli/memory.md +66 -0
- package/docs/cli/message.md +278 -0
- package/docs/cli/models.md +81 -0
- package/docs/cli/node.md +127 -0
- package/docs/cli/nodes.md +75 -0
- package/docs/cli/onboard.md +157 -0
- package/docs/cli/pairing.md +32 -0
- package/docs/cli/plugins.md +186 -0
- package/docs/cli/qr.md +46 -0
- package/docs/cli/reset.md +20 -0
- package/docs/cli/sandbox.md +197 -0
- package/docs/cli/secrets.md +188 -0
- package/docs/cli/security.md +79 -0
- package/docs/cli/sessions.md +110 -0
- package/docs/cli/setup.md +29 -0
- package/docs/cli/skills.md +26 -0
- package/docs/cli/status.md +30 -0
- package/docs/cli/system.md +60 -0
- package/docs/cli/tui.md +30 -0
- package/docs/cli/uninstall.md +20 -0
- package/docs/cli/update.md +103 -0
- package/docs/cli/voicecall.md +34 -0
- package/docs/cli/webhooks.md +25 -0
- package/docs/concepts/agent-loop.md +148 -0
- package/docs/concepts/agent-workspace.md +236 -0
- package/docs/concepts/agent.md +122 -0
- package/docs/concepts/architecture.md +137 -0
- package/docs/concepts/compaction.md +123 -0
- package/docs/concepts/context-engine.md +268 -0
- package/docs/concepts/context.md +172 -0
- package/docs/concepts/delegate-architecture.md +296 -0
- package/docs/concepts/features.md +73 -0
- package/docs/concepts/markdown-formatting.md +130 -0
- package/docs/concepts/memory.md +108 -0
- package/docs/concepts/messages.md +154 -0
- package/docs/concepts/model-failover.md +152 -0
- package/docs/concepts/model-providers.md +607 -0
- package/docs/concepts/models.md +225 -0
- package/docs/concepts/multi-agent.md +552 -0
- package/docs/concepts/oauth.md +158 -0
- package/docs/concepts/presence.md +102 -0
- package/docs/concepts/queue.md +89 -0
- package/docs/concepts/retry.md +69 -0
- package/docs/concepts/session-pruning.md +121 -0
- package/docs/concepts/session-tool.md +242 -0
- package/docs/concepts/session.md +310 -0
- package/docs/concepts/streaming.md +155 -0
- package/docs/concepts/system-prompt.md +132 -0
- package/docs/concepts/timezone.md +91 -0
- package/docs/concepts/typebox.md +291 -0
- package/docs/concepts/typing-indicators.md +68 -0
- package/docs/concepts/usage-tracking.md +35 -0
- package/docs/date-time.md +128 -0
- package/docs/debug/node-issue.md +85 -0
- package/docs/diagnostics/flags.md +91 -0
- package/docs/docs.json +2061 -0
- package/docs/gateway/authentication.md +179 -0
- package/docs/gateway/background-process.md +97 -0
- package/docs/gateway/bonjour.md +177 -0
- package/docs/gateway/bridge-protocol.md +91 -0
- package/docs/gateway/cli-backends.md +225 -0
- package/docs/gateway/configuration-examples.md +651 -0
- package/docs/gateway/configuration-reference.md +3123 -0
- package/docs/gateway/configuration.md +633 -0
- package/docs/gateway/discovery.md +123 -0
- package/docs/gateway/doctor.md +362 -0
- package/docs/gateway/gateway-lock.md +34 -0
- package/docs/gateway/health.md +44 -0
- package/docs/gateway/heartbeat.md +393 -0
- package/docs/gateway/index.md +261 -0
- package/docs/gateway/local-models.md +152 -0
- package/docs/gateway/logging.md +113 -0
- package/docs/gateway/multiple-gateways.md +112 -0
- package/docs/gateway/network-model.md +22 -0
- package/docs/gateway/openai-http-api.md +132 -0
- package/docs/gateway/openresponses-http-api.md +295 -0
- package/docs/gateway/openshell.md +307 -0
- package/docs/gateway/pairing.md +99 -0
- package/docs/gateway/protocol.md +267 -0
- package/docs/gateway/remote-gateway-readme.md +158 -0
- package/docs/gateway/remote.md +153 -0
- package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +134 -0
- package/docs/gateway/sandboxing.md +469 -0
- package/docs/gateway/secrets-plan-contract.md +116 -0
- package/docs/gateway/secrets.md +503 -0
- package/docs/gateway/security/index.md +1213 -0
- package/docs/gateway/tailscale.md +132 -0
- package/docs/gateway/tools-invoke-http-api.md +110 -0
- package/docs/gateway/troubleshooting.md +378 -0
- package/docs/gateway/trusted-proxy-auth.md +330 -0
- package/docs/help/debugging.md +168 -0
- package/docs/help/environment.md +163 -0
- package/docs/help/faq.md +2999 -0
- package/docs/help/index.md +28 -0
- package/docs/help/scripts.md +28 -0
- package/docs/help/testing.md +524 -0
- package/docs/help/troubleshooting.md +297 -0
- package/docs/images/configure-model-picker-unsearchable.png +0 -0
- package/docs/images/feishu-step2-create-app.png +0 -0
- package/docs/images/feishu-step3-credentials.png +0 -0
- package/docs/images/feishu-step4-permissions.png +0 -0
- package/docs/images/feishu-step5-bot-capability.png +0 -0
- package/docs/images/feishu-step6-event-subscription.png +0 -0
- package/docs/images/feishu-verification-token.png +0 -0
- package/docs/images/groups-flow.svg +52 -0
- package/docs/images/mobile-ui-screenshot.png +0 -0
- package/docs/index.md +196 -0
- package/docs/install/ansible.md +230 -0
- package/docs/install/azure.md +311 -0
- package/docs/install/bun.md +55 -0
- package/docs/install/development-channels.md +120 -0
- package/docs/install/digitalocean.md +129 -0
- package/docs/install/docker-vm-runtime.md +142 -0
- package/docs/install/docker.md +375 -0
- package/docs/install/exe-dev.md +126 -0
- package/docs/install/fly.md +501 -0
- package/docs/install/gcp.md +402 -0
- package/docs/install/hetzner.md +251 -0
- package/docs/install/index.md +183 -0
- package/docs/install/installer.md +415 -0
- package/docs/install/kubernetes.md +191 -0
- package/docs/install/macos-vm.md +281 -0
- package/docs/install/migrating-matrix.md +346 -0
- package/docs/install/migrating.md +110 -0
- package/docs/install/nix.md +89 -0
- package/docs/install/node.md +138 -0
- package/docs/install/northflank.mdx +54 -0
- package/docs/install/oracle.md +156 -0
- package/docs/install/podman.md +133 -0
- package/docs/install/railway.mdx +100 -0
- package/docs/install/raspberry-pi.md +159 -0
- package/docs/install/render.mdx +169 -0
- package/docs/install/uninstall.md +128 -0
- package/docs/install/updating.md +128 -0
- package/docs/ja-JP/index.md +186 -0
- package/docs/ja-JP/start/getting-started.md +125 -0
- package/docs/ja-JP/start/wizard.md +77 -0
- package/docs/logging.md +352 -0
- package/docs/nav-tabs-underline.js +100 -0
- package/docs/network.md +54 -0
- package/docs/nodes/audio.md +187 -0
- package/docs/nodes/camera.md +162 -0
- package/docs/nodes/images.md +72 -0
- package/docs/nodes/index.md +393 -0
- package/docs/nodes/location-command.md +98 -0
- package/docs/nodes/media-understanding.md +394 -0
- package/docs/nodes/talk.md +92 -0
- package/docs/nodes/troubleshooting.md +114 -0
- package/docs/nodes/voicewake.md +66 -0
- package/docs/perplexity.md +174 -0
- package/docs/pi-dev.md +80 -0
- package/docs/pi.md +567 -0
- package/docs/platforms/android.md +168 -0
- package/docs/platforms/digitalocean.md +266 -0
- package/docs/platforms/index.md +54 -0
- package/docs/platforms/ios.md +220 -0
- package/docs/platforms/linux.md +94 -0
- package/docs/platforms/mac/bundled-gateway.md +73 -0
- package/docs/platforms/mac/canvas.md +125 -0
- package/docs/platforms/mac/child-process.md +69 -0
- package/docs/platforms/mac/dev-setup.md +104 -0
- package/docs/platforms/mac/health.md +34 -0
- package/docs/platforms/mac/icon.md +31 -0
- package/docs/platforms/mac/logging.md +57 -0
- package/docs/platforms/mac/menu-bar.md +81 -0
- package/docs/platforms/mac/peekaboo.md +65 -0
- package/docs/platforms/mac/permissions.md +50 -0
- package/docs/platforms/mac/remote.md +84 -0
- package/docs/platforms/mac/signing.md +47 -0
- package/docs/platforms/mac/skills.md +33 -0
- package/docs/platforms/mac/voice-overlay.md +60 -0
- package/docs/platforms/mac/voicewake.md +67 -0
- package/docs/platforms/mac/webchat.md +43 -0
- package/docs/platforms/mac/xpc.md +61 -0
- package/docs/platforms/macos.md +226 -0
- package/docs/platforms/oracle.md +303 -0
- package/docs/platforms/raspberry-pi.md +412 -0
- package/docs/platforms/windows.md +241 -0
- package/docs/plugins/agent-tools.md +10 -0
- package/docs/plugins/architecture.md +1363 -0
- package/docs/plugins/building-extensions.md +10 -0
- package/docs/plugins/building-plugins.md +376 -0
- package/docs/plugins/bundles.md +181 -0
- package/docs/plugins/community.md +141 -0
- package/docs/plugins/manifest.md +145 -0
- package/docs/plugins/sdk-migration.md +169 -0
- package/docs/plugins/voice-call.md +380 -0
- package/docs/plugins/zalouser.md +77 -0
- package/docs/prose.md +134 -0
- package/docs/providers/anthropic.md +259 -0
- package/docs/providers/bedrock.md +176 -0
- package/docs/providers/claude-max-api-proxy.md +154 -0
- package/docs/providers/cloudflare-ai-gateway.md +71 -0
- package/docs/providers/deepgram.md +93 -0
- package/docs/providers/github-copilot.md +72 -0
- package/docs/providers/glm.md +43 -0
- package/docs/providers/google.md +78 -0
- package/docs/providers/groq.md +96 -0
- package/docs/providers/huggingface.md +209 -0
- package/docs/providers/index.md +69 -0
- package/docs/providers/kilocode.md +74 -0
- package/docs/providers/litellm.md +154 -0
- package/docs/providers/minimax.md +224 -0
- package/docs/providers/mistral.md +54 -0
- package/docs/providers/models.md +45 -0
- package/docs/providers/modelstudio.md +66 -0
- package/docs/providers/moonshot.md +175 -0
- package/docs/providers/nvidia.md +55 -0
- package/docs/providers/ollama.md +352 -0
- package/docs/providers/openai.md +303 -0
- package/docs/providers/opencode-go.md +45 -0
- package/docs/providers/opencode.md +64 -0
- package/docs/providers/openrouter.md +37 -0
- package/docs/providers/perplexity-provider.md +62 -0
- package/docs/providers/qianfan.md +38 -0
- package/docs/providers/qwen.md +53 -0
- package/docs/providers/sglang.md +104 -0
- package/docs/providers/synthetic.md +99 -0
- package/docs/providers/together.md +66 -0
- package/docs/providers/venice.md +282 -0
- package/docs/providers/vercel-ai-gateway.md +60 -0
- package/docs/providers/vllm.md +92 -0
- package/docs/providers/volcengine.md +74 -0
- package/docs/providers/xai.md +60 -0
- package/docs/providers/xiaomi.md +86 -0
- package/docs/providers/zai.md +46 -0
- package/docs/reference/AGENTS.default.md +126 -0
- package/docs/reference/RELEASING.md +42 -0
- package/docs/reference/api-usage-costs.md +144 -0
- package/docs/reference/credits.md +30 -0
- package/docs/reference/device-models.md +47 -0
- package/docs/reference/memory-config.md +711 -0
- package/docs/reference/prompt-caching.md +185 -0
- package/docs/reference/rpc.md +43 -0
- package/docs/reference/secretref-credential-surface.md +140 -0
- package/docs/reference/secretref-user-supplied-credentials-matrix.json +563 -0
- package/docs/reference/session-management-compaction.md +324 -0
- package/docs/reference/templates/AGENTS.dev.md +83 -0
- package/docs/reference/templates/AGENTS.md +219 -0
- package/docs/reference/templates/BOOT.md +11 -0
- package/docs/reference/templates/BOOTSTRAP.md +62 -0
- package/docs/reference/templates/HEARTBEAT.md +14 -0
- package/docs/reference/templates/IDENTITY.dev.md +47 -0
- package/docs/reference/templates/IDENTITY.md +29 -0
- package/docs/reference/templates/SOUL.dev.md +76 -0
- package/docs/reference/templates/SOUL.md +43 -0
- package/docs/reference/templates/TOOLS.dev.md +24 -0
- package/docs/reference/templates/TOOLS.md +47 -0
- package/docs/reference/templates/USER.dev.md +18 -0
- package/docs/reference/templates/USER.md +23 -0
- package/docs/reference/test.md +90 -0
- package/docs/reference/token-use.md +175 -0
- package/docs/reference/transcript-hygiene.md +151 -0
- package/docs/reference/wizard.md +235 -0
- package/docs/security/CONTRIBUTING-THREAT-MODEL.md +98 -0
- package/docs/security/THREAT-MODEL-ATLAS.md +611 -0
- package/docs/security/formal-verification.md +167 -0
- package/docs/start/bootstrapping.md +41 -0
- package/docs/start/docs-directory.md +66 -0
- package/docs/start/getting-started.md +116 -0
- package/docs/start/hubs.md +198 -0
- package/docs/start/lore.md +219 -0
- package/docs/start/onboarding-overview.md +67 -0
- package/docs/start/onboarding.md +91 -0
- package/docs/start/openclaw.md +216 -0
- package/docs/start/quickstart.md +22 -0
- package/docs/start/setup.md +164 -0
- package/docs/start/showcase.md +418 -0
- package/docs/start/wizard-cli-automation.md +215 -0
- package/docs/start/wizard-cli-reference.md +299 -0
- package/docs/start/wizard.md +125 -0
- package/docs/style.css +37 -0
- package/docs/tools/acp-agents.md +623 -0
- package/docs/tools/agent-send.md +100 -0
- package/docs/tools/apply-patch.md +51 -0
- package/docs/tools/brave-search.md +93 -0
- package/docs/tools/browser-linux-troubleshooting.md +138 -0
- package/docs/tools/browser-login.md +73 -0
- package/docs/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md +211 -0
- package/docs/tools/browser.md +731 -0
- package/docs/tools/btw.md +142 -0
- package/docs/tools/capability-cookbook.md +119 -0
- package/docs/tools/clawhub.md +257 -0
- package/docs/tools/creating-skills.md +117 -0
- package/docs/tools/diffs.md +386 -0
- package/docs/tools/elevated.md +114 -0
- package/docs/tools/exec-approvals.md +400 -0
- package/docs/tools/exec.md +204 -0
- package/docs/tools/firecrawl.md +140 -0
- package/docs/tools/index.md +137 -0
- package/docs/tools/llm-task.md +119 -0
- package/docs/tools/lobster.md +340 -0
- package/docs/tools/loop-detection.md +100 -0
- package/docs/tools/multi-agent-sandbox-tools.md +364 -0
- package/docs/tools/pdf.md +156 -0
- package/docs/tools/perplexity-search.md +174 -0
- package/docs/tools/plugin.md +251 -0
- package/docs/tools/reactions.md +64 -0
- package/docs/tools/skills-config.md +86 -0
- package/docs/tools/skills.md +306 -0
- package/docs/tools/slash-commands.md +294 -0
- package/docs/tools/subagents.md +295 -0
- package/docs/tools/tavily.md +125 -0
- package/docs/tools/thinking.md +96 -0
- package/docs/tools/tts.md +406 -0
- package/docs/tools/web.md +516 -0
- package/docs/tts.md +406 -0
- package/docs/vps.md +112 -0
- package/docs/web/control-ui.md +275 -0
- package/docs/web/dashboard.md +54 -0
- package/docs/web/index.md +120 -0
- package/docs/web/tui.md +170 -0
- package/docs/web/webchat.md +61 -0
- package/docs/whatsapp-openclaw-ai-zh.jpg +0 -0
- package/docs/whatsapp-openclaw.jpg +0 -0
- package/docs/zh-CN/AGENTS.md +61 -0
- package/docs/zh-CN/automation/auth-monitoring.md +47 -0
- package/docs/zh-CN/automation/cron-jobs.md +435 -0
- package/docs/zh-CN/automation/cron-vs-heartbeat.md +286 -0
- package/docs/zh-CN/automation/gmail-pubsub.md +249 -0
- package/docs/zh-CN/automation/hooks.md +1051 -0
- package/docs/zh-CN/automation/poll.md +76 -0
- package/docs/zh-CN/automation/troubleshooting.md +8 -0
- package/docs/zh-CN/automation/webhook.md +163 -0
- package/docs/zh-CN/brave-search.md +60 -0
- package/docs/zh-CN/channels/bluebubbles.md +354 -0
- package/docs/zh-CN/channels/broadcast-groups.md +449 -0
- package/docs/zh-CN/channels/channel-routing.md +117 -0
- package/docs/zh-CN/channels/discord.md +468 -0
- package/docs/zh-CN/channels/feishu.md +728 -0
- package/docs/zh-CN/channels/googlechat.md +257 -0
- package/docs/zh-CN/channels/grammy.md +38 -0
- package/docs/zh-CN/channels/group-messages.md +91 -0
- package/docs/zh-CN/channels/groups.md +379 -0
- package/docs/zh-CN/channels/imessage.md +302 -0
- package/docs/zh-CN/channels/index.md +53 -0
- package/docs/zh-CN/channels/line.md +180 -0
- package/docs/zh-CN/channels/location.md +63 -0
- package/docs/zh-CN/channels/matrix.md +221 -0
- package/docs/zh-CN/channels/mattermost.md +144 -0
- package/docs/zh-CN/channels/msteams.md +775 -0
- package/docs/zh-CN/channels/nextcloud-talk.md +142 -0
- package/docs/zh-CN/channels/nostr.md +249 -0
- package/docs/zh-CN/channels/pairing.md +89 -0
- package/docs/zh-CN/channels/signal.md +209 -0
- package/docs/zh-CN/channels/slack.md +531 -0
- package/docs/zh-CN/channels/synology-chat.md +138 -0
- package/docs/zh-CN/channels/telegram.md +751 -0
- package/docs/zh-CN/channels/tlon.md +136 -0
- package/docs/zh-CN/channels/troubleshooting.md +36 -0
- package/docs/zh-CN/channels/twitch.md +385 -0
- package/docs/zh-CN/channels/whatsapp.md +411 -0
- package/docs/zh-CN/channels/zalo.md +196 -0
- package/docs/zh-CN/channels/zalouser.md +147 -0
- package/docs/zh-CN/cli/acp.md +173 -0
- package/docs/zh-CN/cli/agent.md +30 -0
- package/docs/zh-CN/cli/agents.md +82 -0
- package/docs/zh-CN/cli/approvals.md +57 -0
- package/docs/zh-CN/cli/browser.md +114 -0
- package/docs/zh-CN/cli/channels.md +86 -0
- package/docs/zh-CN/cli/config.md +57 -0
- package/docs/zh-CN/cli/configure.md +38 -0
- package/docs/zh-CN/cli/cron.md +43 -0
- package/docs/zh-CN/cli/dashboard.md +23 -0
- package/docs/zh-CN/cli/devices.md +74 -0
- package/docs/zh-CN/cli/directory.md +70 -0
- package/docs/zh-CN/cli/dns.md +30 -0
- package/docs/zh-CN/cli/docs.md +22 -0
- package/docs/zh-CN/cli/doctor.md +48 -0
- package/docs/zh-CN/cli/gateway.md +206 -0
- package/docs/zh-CN/cli/health.md +28 -0
- package/docs/zh-CN/cli/hooks.md +298 -0
- package/docs/zh-CN/cli/index.md +1143 -0
- package/docs/zh-CN/cli/logs.md +31 -0
- package/docs/zh-CN/cli/memory.md +52 -0
- package/docs/zh-CN/cli/message.md +246 -0
- package/docs/zh-CN/cli/models.md +85 -0
- package/docs/zh-CN/cli/node.md +115 -0
- package/docs/zh-CN/cli/nodes.md +80 -0
- package/docs/zh-CN/cli/onboard.md +164 -0
- package/docs/zh-CN/cli/pairing.md +28 -0
- package/docs/zh-CN/cli/plugins.md +66 -0
- package/docs/zh-CN/cli/reset.md +24 -0
- package/docs/zh-CN/cli/sandbox.md +158 -0
- package/docs/zh-CN/cli/security.md +33 -0
- package/docs/zh-CN/cli/sessions.md +23 -0
- package/docs/zh-CN/cli/setup.md +36 -0
- package/docs/zh-CN/cli/skills.md +33 -0
- package/docs/zh-CN/cli/status.md +33 -0
- package/docs/zh-CN/cli/system.md +63 -0
- package/docs/zh-CN/cli/tui.md +30 -0
- package/docs/zh-CN/cli/uninstall.md +24 -0
- package/docs/zh-CN/cli/update.md +101 -0
- package/docs/zh-CN/cli/voicecall.md +41 -0
- package/docs/zh-CN/cli/webhooks.md +32 -0
- package/docs/zh-CN/concepts/agent-loop.md +146 -0
- package/docs/zh-CN/concepts/agent-workspace.md +219 -0
- package/docs/zh-CN/concepts/agent.md +115 -0
- package/docs/zh-CN/concepts/architecture.md +123 -0
- package/docs/zh-CN/concepts/compaction.md +67 -0
- package/docs/zh-CN/concepts/context.md +168 -0
- package/docs/zh-CN/concepts/features.md +59 -0
- package/docs/zh-CN/concepts/markdown-formatting.md +117 -0
- package/docs/zh-CN/concepts/memory.md +412 -0
- package/docs/zh-CN/concepts/messages.md +141 -0
- package/docs/zh-CN/concepts/model-failover.md +145 -0
- package/docs/zh-CN/concepts/model-providers.md +606 -0
- package/docs/zh-CN/concepts/models.md +225 -0
- package/docs/zh-CN/concepts/multi-agent.md +372 -0
- package/docs/zh-CN/concepts/oauth.md +164 -0
- package/docs/zh-CN/concepts/presence.md +99 -0
- package/docs/zh-CN/concepts/queue.md +94 -0
- package/docs/zh-CN/concepts/retry.md +76 -0
- package/docs/zh-CN/concepts/session-pruning.md +129 -0
- package/docs/zh-CN/concepts/session-tool.md +200 -0
- package/docs/zh-CN/concepts/session.md +166 -0
- package/docs/zh-CN/concepts/streaming.md +133 -0
- package/docs/zh-CN/concepts/system-prompt.md +101 -0
- package/docs/zh-CN/concepts/timezone.md +96 -0
- package/docs/zh-CN/concepts/typebox.md +284 -0
- package/docs/zh-CN/concepts/typing-indicators.md +74 -0
- package/docs/zh-CN/concepts/usage-tracking.md +42 -0
- package/docs/zh-CN/date-time.md +129 -0
- package/docs/zh-CN/debug/node-issue.md +90 -0
- package/docs/zh-CN/diagnostics/flags.md +98 -0
- package/docs/zh-CN/gateway/authentication.md +184 -0
- package/docs/zh-CN/gateway/background-process.md +100 -0
- package/docs/zh-CN/gateway/bonjour.md +174 -0
- package/docs/zh-CN/gateway/bridge-protocol.md +86 -0
- package/docs/zh-CN/gateway/cli-backends.md +213 -0
- package/docs/zh-CN/gateway/configuration-examples.md +587 -0
- package/docs/zh-CN/gateway/configuration-reference.md +3103 -0
- package/docs/zh-CN/gateway/configuration.md +640 -0
- package/docs/zh-CN/gateway/discovery.md +123 -0
- package/docs/zh-CN/gateway/doctor.md +238 -0
- package/docs/zh-CN/gateway/gateway-lock.md +41 -0
- package/docs/zh-CN/gateway/health.md +42 -0
- package/docs/zh-CN/gateway/heartbeat.md +274 -0
- package/docs/zh-CN/gateway/index.md +335 -0
- package/docs/zh-CN/gateway/local-models.md +159 -0
- package/docs/zh-CN/gateway/logging.md +114 -0
- package/docs/zh-CN/gateway/multiple-gateways.md +119 -0
- package/docs/zh-CN/gateway/network-model.md +23 -0
- package/docs/zh-CN/gateway/openai-http-api.md +125 -0
- package/docs/zh-CN/gateway/openresponses-http-api.md +317 -0
- package/docs/zh-CN/gateway/pairing.md +99 -0
- package/docs/zh-CN/gateway/protocol.md +220 -0
- package/docs/zh-CN/gateway/remote-gateway-readme.md +164 -0
- package/docs/zh-CN/gateway/remote.md +133 -0
- package/docs/zh-CN/gateway/sandbox-vs-tool-policy-vs-elevated.md +135 -0
- package/docs/zh-CN/gateway/sandboxing.md +188 -0
- package/docs/zh-CN/gateway/security/index.md +777 -0
- package/docs/zh-CN/gateway/tailscale.md +124 -0
- package/docs/zh-CN/gateway/tools-invoke-http-api.md +92 -0
- package/docs/zh-CN/gateway/troubleshooting.md +771 -0
- package/docs/zh-CN/help/debugging.md +160 -0
- package/docs/zh-CN/help/environment.md +88 -0
- package/docs/zh-CN/help/faq.md +2640 -0
- package/docs/zh-CN/help/index.md +28 -0
- package/docs/zh-CN/help/scripts.md +35 -0
- package/docs/zh-CN/help/testing.md +375 -0
- package/docs/zh-CN/help/troubleshooting.md +104 -0
- package/docs/zh-CN/index.md +186 -0
- package/docs/zh-CN/install/ansible.md +215 -0
- package/docs/zh-CN/install/bun.md +65 -0
- package/docs/zh-CN/install/development-channels.md +81 -0
- package/docs/zh-CN/install/docker.md +532 -0
- package/docs/zh-CN/install/exe-dev.md +133 -0
- package/docs/zh-CN/install/fly.md +490 -0
- package/docs/zh-CN/install/gcp.md +510 -0
- package/docs/zh-CN/install/hetzner.md +337 -0
- package/docs/zh-CN/install/index.md +235 -0
- package/docs/zh-CN/install/installer.md +422 -0
- package/docs/zh-CN/install/macos-vm.md +288 -0
- package/docs/zh-CN/install/migrating.md +199 -0
- package/docs/zh-CN/install/nix.md +99 -0
- package/docs/zh-CN/install/node.md +8 -0
- package/docs/zh-CN/install/northflank.mdx +60 -0
- package/docs/zh-CN/install/railway.mdx +106 -0
- package/docs/zh-CN/install/render.mdx +169 -0
- package/docs/zh-CN/install/uninstall.md +135 -0
- package/docs/zh-CN/install/updating.md +233 -0
- package/docs/zh-CN/logging.md +329 -0
- package/docs/zh-CN/network.md +59 -0
- package/docs/zh-CN/nodes/audio.md +120 -0
- package/docs/zh-CN/nodes/camera.md +162 -0
- package/docs/zh-CN/nodes/images.md +79 -0
- package/docs/zh-CN/nodes/index.md +348 -0
- package/docs/zh-CN/nodes/location-command.md +120 -0
- package/docs/zh-CN/nodes/media-understanding.md +380 -0
- package/docs/zh-CN/nodes/talk.md +97 -0
- package/docs/zh-CN/nodes/troubleshooting.md +8 -0
- package/docs/zh-CN/nodes/voicewake.md +72 -0
- package/docs/zh-CN/perplexity.md +102 -0
- package/docs/zh-CN/pi-dev.md +77 -0
- package/docs/zh-CN/pi.md +619 -0
- package/docs/zh-CN/platforms/android.md +155 -0
- package/docs/zh-CN/platforms/digitalocean.md +273 -0
- package/docs/zh-CN/platforms/index.md +60 -0
- package/docs/zh-CN/platforms/ios.md +114 -0
- package/docs/zh-CN/platforms/linux.md +100 -0
- package/docs/zh-CN/platforms/mac/bundled-gateway.md +75 -0
- package/docs/zh-CN/platforms/mac/canvas.md +128 -0
- package/docs/zh-CN/platforms/mac/child-process.md +73 -0
- package/docs/zh-CN/platforms/mac/dev-setup.md +109 -0
- package/docs/zh-CN/platforms/mac/health.md +41 -0
- package/docs/zh-CN/platforms/mac/icon.md +38 -0
- package/docs/zh-CN/platforms/mac/logging.md +64 -0
- package/docs/zh-CN/platforms/mac/menu-bar.md +88 -0
- package/docs/zh-CN/platforms/mac/peekaboo.md +62 -0
- package/docs/zh-CN/platforms/mac/permissions.md +46 -0
- package/docs/zh-CN/platforms/mac/remote.md +90 -0
- package/docs/zh-CN/platforms/mac/signing.md +54 -0
- package/docs/zh-CN/platforms/mac/skills.md +40 -0
- package/docs/zh-CN/platforms/mac/voice-overlay.md +67 -0
- package/docs/zh-CN/platforms/mac/voicewake.md +74 -0
- package/docs/zh-CN/platforms/mac/webchat.md +43 -0
- package/docs/zh-CN/platforms/mac/xpc.md +68 -0
- package/docs/zh-CN/platforms/macos.md +193 -0
- package/docs/zh-CN/platforms/oracle.md +310 -0
- package/docs/zh-CN/platforms/raspberry-pi.md +416 -0
- package/docs/zh-CN/platforms/windows.md +247 -0
- package/docs/zh-CN/plugins/agent-tools.md +99 -0
- package/docs/zh-CN/plugins/manifest.md +68 -0
- package/docs/zh-CN/plugins/voice-call.md +250 -0
- package/docs/zh-CN/plugins/zalouser.md +88 -0
- package/docs/zh-CN/prose.md +141 -0
- package/docs/zh-CN/providers/anthropic.md +265 -0
- package/docs/zh-CN/providers/bedrock.md +170 -0
- package/docs/zh-CN/providers/claude-max-api-proxy.md +155 -0
- package/docs/zh-CN/providers/cloudflare-ai-gateway.md +78 -0
- package/docs/zh-CN/providers/deepgram.md +97 -0
- package/docs/zh-CN/providers/github-copilot.md +67 -0
- package/docs/zh-CN/providers/glm.md +50 -0
- package/docs/zh-CN/providers/huggingface.md +216 -0
- package/docs/zh-CN/providers/index.md +69 -0
- package/docs/zh-CN/providers/kilocode.md +80 -0
- package/docs/zh-CN/providers/litellm.md +160 -0
- package/docs/zh-CN/providers/minimax.md +222 -0
- package/docs/zh-CN/providers/mistral.md +61 -0
- package/docs/zh-CN/providers/models.md +51 -0
- package/docs/zh-CN/providers/moonshot.md +182 -0
- package/docs/zh-CN/providers/nvidia.md +62 -0
- package/docs/zh-CN/providers/ollama.md +359 -0
- package/docs/zh-CN/providers/openai.md +308 -0
- package/docs/zh-CN/providers/opencode-go.md +52 -0
- package/docs/zh-CN/providers/opencode.md +71 -0
- package/docs/zh-CN/providers/openrouter.md +44 -0
- package/docs/zh-CN/providers/qianfan.md +45 -0
- package/docs/zh-CN/providers/qwen.md +55 -0
- package/docs/zh-CN/providers/sglang.md +111 -0
- package/docs/zh-CN/providers/synthetic.md +106 -0
- package/docs/zh-CN/providers/together.md +72 -0
- package/docs/zh-CN/providers/venice.md +289 -0
- package/docs/zh-CN/providers/vercel-ai-gateway.md +66 -0
- package/docs/zh-CN/providers/xiaomi.md +93 -0
- package/docs/zh-CN/providers/zai.md +53 -0
- package/docs/zh-CN/reference/AGENTS.default.md +131 -0
- package/docs/zh-CN/reference/RELEASING.md +48 -0
- package/docs/zh-CN/reference/api-usage-costs.md +141 -0
- package/docs/zh-CN/reference/credits.md +34 -0
- package/docs/zh-CN/reference/device-models.md +54 -0
- package/docs/zh-CN/reference/rpc.md +48 -0
- package/docs/zh-CN/reference/session-management-compaction.md +287 -0
- package/docs/zh-CN/reference/templates/AGENTS.dev.md +89 -0
- package/docs/zh-CN/reference/templates/AGENTS.md +225 -0
- package/docs/zh-CN/reference/templates/BOOT.md +17 -0
- package/docs/zh-CN/reference/templates/BOOTSTRAP.md +68 -0
- package/docs/zh-CN/reference/templates/HEARTBEAT.md +18 -0
- package/docs/zh-CN/reference/templates/IDENTITY.dev.md +54 -0
- package/docs/zh-CN/reference/templates/IDENTITY.md +36 -0
- package/docs/zh-CN/reference/templates/SOUL.dev.md +83 -0
- package/docs/zh-CN/reference/templates/SOUL.md +49 -0
- package/docs/zh-CN/reference/templates/TOOLS.dev.md +31 -0
- package/docs/zh-CN/reference/templates/TOOLS.md +53 -0
- package/docs/zh-CN/reference/templates/USER.dev.md +25 -0
- package/docs/zh-CN/reference/templates/USER.md +30 -0
- package/docs/zh-CN/reference/test.md +57 -0
- package/docs/zh-CN/reference/token-use.md +119 -0
- package/docs/zh-CN/reference/transcript-hygiene.md +109 -0
- package/docs/zh-CN/reference/wizard.md +242 -0
- package/docs/zh-CN/security/formal-verification.md +171 -0
- package/docs/zh-CN/start/bootstrapping.md +9 -0
- package/docs/zh-CN/start/docs-directory.md +70 -0
- package/docs/zh-CN/start/getting-started.md +143 -0
- package/docs/zh-CN/start/hubs.md +194 -0
- package/docs/zh-CN/start/lore.md +226 -0
- package/docs/zh-CN/start/onboarding-overview.md +58 -0
- package/docs/zh-CN/start/onboarding.md +105 -0
- package/docs/zh-CN/start/openclaw.md +248 -0
- package/docs/zh-CN/start/quickstart.md +88 -0
- package/docs/zh-CN/start/setup.md +153 -0
- package/docs/zh-CN/start/showcase.md +423 -0
- package/docs/zh-CN/start/wizard-cli-automation.md +222 -0
- package/docs/zh-CN/start/wizard-cli-reference.md +306 -0
- package/docs/zh-CN/start/wizard.md +132 -0
- package/docs/zh-CN/tools/agent-send.md +59 -0
- package/docs/zh-CN/tools/apply-patch.md +57 -0
- package/docs/zh-CN/tools/browser-linux-troubleshooting.md +144 -0
- package/docs/zh-CN/tools/browser-login.md +75 -0
- package/docs/zh-CN/tools/browser.md +553 -0
- package/docs/zh-CN/tools/chrome-extension.md +183 -0
- package/docs/zh-CN/tools/clawhub.md +209 -0
- package/docs/zh-CN/tools/creating-skills.md +61 -0
- package/docs/zh-CN/tools/elevated.md +64 -0
- package/docs/zh-CN/tools/exec-approvals.md +234 -0
- package/docs/zh-CN/tools/exec.md +169 -0
- package/docs/zh-CN/tools/firecrawl.md +68 -0
- package/docs/zh-CN/tools/index.md +515 -0
- package/docs/zh-CN/tools/llm-task.md +117 -0
- package/docs/zh-CN/tools/lobster.md +349 -0
- package/docs/zh-CN/tools/multi-agent-sandbox-tools.md +401 -0
- package/docs/zh-CN/tools/plugin.md +1612 -0
- package/docs/zh-CN/tools/reactions.md +29 -0
- package/docs/zh-CN/tools/skills-config.md +78 -0
- package/docs/zh-CN/tools/skills.md +279 -0
- package/docs/zh-CN/tools/slash-commands.md +205 -0
- package/docs/zh-CN/tools/subagents.md +167 -0
- package/docs/zh-CN/tools/thinking.md +80 -0
- package/docs/zh-CN/tools/web.md +289 -0
- package/docs/zh-CN/tts.md +375 -0
- package/docs/zh-CN/vps.md +47 -0
- package/docs/zh-CN/web/control-ui.md +191 -0
- package/docs/zh-CN/web/dashboard.md +53 -0
- package/docs/zh-CN/web/index.md +118 -0
- package/docs/zh-CN/web/tui.md +166 -0
- package/docs/zh-CN/web/webchat.md +56 -0
- package/openclaw.mjs +135 -0
- package/package.json +835 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +118 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +198 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +295 -0
- package/skills/discord/SKILL.md +197 -0
- package/skills/doubao-code/SKILL.md +43 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gh-issues/SKILL.md +865 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +163 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +122 -0
- package/skills/kimi-code/SKILL.md +42 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +320 -0
- package/skills/model-usage/scripts/test_model_usage.py +40 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/node-connect/SKILL.md +142 -0
- package/skills/notion/SKILL.md +174 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +92 -0
- package/skills/openai-image-gen/scripts/gen.py +328 -0
- package/skills/openai-image-gen/scripts/test_gen.py +140 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +112 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +372 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +139 -0
- package/skills/skill-creator/scripts/quick_validate.py +159 -0
- package/skills/skill-creator/scripts/test_package_skill.py +160 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +72 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +65 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +153 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +112 -0
- package/skills/xurl/SKILL.md +461 -0
|
@@ -0,0 +1,2033 @@
|
|
|
1
|
+
import { t as isMainModule } from "./is-main-YViS6wOn.js";
|
|
2
|
+
import "./logger-CoEtkjhn.js";
|
|
3
|
+
import "./paths-GHJ97ebE.js";
|
|
4
|
+
import "./tmp-openclaw-dir-idKIOMmb.js";
|
|
5
|
+
import { r as theme } from "./theme-CdOoMzRk.js";
|
|
6
|
+
import "./globals-41sdSaKv.js";
|
|
7
|
+
import { n as defaultRuntime } from "./runtime-CT2LIJZu.js";
|
|
8
|
+
import "./ansi-BEJF8NKS.js";
|
|
9
|
+
import "./subsystem-CUp-6QQf.js";
|
|
10
|
+
import "./boolean-DKtCJu_W.js";
|
|
11
|
+
import "./env-BP70DGuy.js";
|
|
12
|
+
import { S as shortenHomePath } from "./utils-Bxk6BLTg.js";
|
|
13
|
+
import { t as formatDocsLink } from "./links-Bilm-v0z.js";
|
|
14
|
+
import { n as inheritOptionFromParent } from "./command-options-5coRiipK.js";
|
|
15
|
+
import "./boundary-path-B3FFLYNx.js";
|
|
16
|
+
import "./boundary-file-read-BP6VMpqH.js";
|
|
17
|
+
import "./logger-Cqy7-Maj.js";
|
|
18
|
+
import "./exec-Dmex2w_d.js";
|
|
19
|
+
import "./workspace-BH7CXmrr.js";
|
|
20
|
+
import "./agent-scope-DPP4Z_UU.js";
|
|
21
|
+
import "./model-selection-BTpJnslv.js";
|
|
22
|
+
import { s as loadConfig } from "./io-jOnQRia2.js";
|
|
23
|
+
import "./host-env-security-BogNN146.js";
|
|
24
|
+
import "./shell-env-cD92jEyV.js";
|
|
25
|
+
import "./safe-text-B_CQuica.js";
|
|
26
|
+
import { n as VERSION } from "./version-DCY9_obP.js";
|
|
27
|
+
import "./env-substitution-D6t_sLS_.js";
|
|
28
|
+
import "./includes-7XyL3p1c.js";
|
|
29
|
+
import "./zod-schema.providers-core-Dgq7MTqU.js";
|
|
30
|
+
import "./legacy-web-search-BgZjNG2h.js";
|
|
31
|
+
import "./registry-rgYi7KoO.js";
|
|
32
|
+
import "./config-state-CE0CGjey.js";
|
|
33
|
+
import "./manifest-registry-B90TyTWl.js";
|
|
34
|
+
import "./avatar-policy-Ds9e6uHI.js";
|
|
35
|
+
import "./ip-C8vmzVu0.js";
|
|
36
|
+
import "./zod-schema.agent-runtime-T_EC_6fg.js";
|
|
37
|
+
import "./zod-schema.core-BdgRr-F1.js";
|
|
38
|
+
import "./config-pn7LKJdW.js";
|
|
39
|
+
import "./audit-fs-oDMUa5N_.js";
|
|
40
|
+
import "./resolve-T2q_0ARF.js";
|
|
41
|
+
import "./tailnet-ofqBrXzu.js";
|
|
42
|
+
import "./net-DlJFp95v.js";
|
|
43
|
+
import "./credentials-BPwBlm1X.js";
|
|
44
|
+
import { h as GATEWAY_CLIENT_NAMES, m as GATEWAY_CLIENT_MODES } from "./message-channel-Cy-gN4K2.js";
|
|
45
|
+
import "./runtime-CuvWMN7E.js";
|
|
46
|
+
import { u as GatewayClient } from "./method-scopes-DgypDW23.js";
|
|
47
|
+
import { t as buildGatewayConnectionDetails } from "./call-BmLt3xO1.js";
|
|
48
|
+
import { a as omitEnvKeysCaseInsensitive, r as listKnownProviderAuthEnvVarNames } from "./provider-env-vars-CsQlY7bF.js";
|
|
49
|
+
import { r as isKnownCoreToolId } from "./tool-catalog-BV6FcEWS.js";
|
|
50
|
+
import { r as listThinkingLevels } from "./thinking-BBD_0HSp.js";
|
|
51
|
+
import "./secret-file-DYJtH6kf.js";
|
|
52
|
+
import { i as resolveWindowsSpawnProgram, n as materializeWindowsSpawnProgram } from "./windows-spawn-vMJGZo89.js";
|
|
53
|
+
import { t as resolveGatewayConnectionAuth } from "./connection-auth-BSQJeDOU.js";
|
|
54
|
+
import { t as ensureOpenClawCliOnPath } from "./path-env-CPkz6U0Y.js";
|
|
55
|
+
import { t as DANGEROUS_ACP_TOOLS } from "./dangerous-tools-yGPDFTHh.js";
|
|
56
|
+
import { t as readSecretFromFile } from "./secret-file-Ch0yuOXR.js";
|
|
57
|
+
import { fileURLToPath } from "node:url";
|
|
58
|
+
import fs from "node:fs";
|
|
59
|
+
import path from "node:path";
|
|
60
|
+
import { spawn } from "node:child_process";
|
|
61
|
+
import os, { homedir } from "node:os";
|
|
62
|
+
import { randomUUID } from "node:crypto";
|
|
63
|
+
import { Readable, Writable } from "node:stream";
|
|
64
|
+
import * as readline$1 from "node:readline";
|
|
65
|
+
import { AgentSideConnection, ClientSideConnection, PROTOCOL_VERSION, ndJsonStream } from "@agentclientprotocol/sdk";
|
|
66
|
+
//#region src/acp/client.ts
|
|
67
|
+
const SAFE_AUTO_APPROVE_TOOL_IDS = new Set([
|
|
68
|
+
"read",
|
|
69
|
+
"search",
|
|
70
|
+
"web_search",
|
|
71
|
+
"memory_search"
|
|
72
|
+
]);
|
|
73
|
+
const TRUSTED_SAFE_TOOL_ALIASES = new Set(["search"]);
|
|
74
|
+
const READ_TOOL_PATH_KEYS = [
|
|
75
|
+
"path",
|
|
76
|
+
"file_path",
|
|
77
|
+
"filePath"
|
|
78
|
+
];
|
|
79
|
+
const TOOL_NAME_MAX_LENGTH = 128;
|
|
80
|
+
const TOOL_NAME_PATTERN = /^[a-z0-9._-]+$/;
|
|
81
|
+
const TOOL_KIND_BY_ID = new Map([
|
|
82
|
+
["read", "read"],
|
|
83
|
+
["search", "search"],
|
|
84
|
+
["web_search", "search"],
|
|
85
|
+
["memory_search", "search"]
|
|
86
|
+
]);
|
|
87
|
+
function asRecord$1(value) {
|
|
88
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
89
|
+
}
|
|
90
|
+
function readFirstStringValue(source, keys) {
|
|
91
|
+
if (!source) return;
|
|
92
|
+
for (const key of keys) {
|
|
93
|
+
const value = source[key];
|
|
94
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function normalizeToolName(value) {
|
|
98
|
+
const normalized = value.trim().toLowerCase();
|
|
99
|
+
if (!normalized || normalized.length > TOOL_NAME_MAX_LENGTH) return;
|
|
100
|
+
if (!TOOL_NAME_PATTERN.test(normalized)) return;
|
|
101
|
+
return normalized;
|
|
102
|
+
}
|
|
103
|
+
function parseToolNameFromTitle(title) {
|
|
104
|
+
if (!title) return;
|
|
105
|
+
const head = title.split(":", 1)[0]?.trim();
|
|
106
|
+
if (!head) return;
|
|
107
|
+
return normalizeToolName(head);
|
|
108
|
+
}
|
|
109
|
+
function resolveToolKindForPermission(toolName) {
|
|
110
|
+
if (!toolName) return;
|
|
111
|
+
return TOOL_KIND_BY_ID.get(toolName) ?? "other";
|
|
112
|
+
}
|
|
113
|
+
function resolveToolNameForPermission(params) {
|
|
114
|
+
const toolCall = params.toolCall;
|
|
115
|
+
const toolMeta = asRecord$1(toolCall?._meta);
|
|
116
|
+
const rawInput = asRecord$1(toolCall?.rawInput);
|
|
117
|
+
const fromMeta = readFirstStringValue(toolMeta, [
|
|
118
|
+
"toolName",
|
|
119
|
+
"tool_name",
|
|
120
|
+
"name"
|
|
121
|
+
]);
|
|
122
|
+
const fromRawInput = readFirstStringValue(rawInput, [
|
|
123
|
+
"tool",
|
|
124
|
+
"toolName",
|
|
125
|
+
"tool_name",
|
|
126
|
+
"name"
|
|
127
|
+
]);
|
|
128
|
+
const fromTitle = parseToolNameFromTitle(toolCall?.title);
|
|
129
|
+
const metaName = fromMeta ? normalizeToolName(fromMeta) : void 0;
|
|
130
|
+
const rawInputName = fromRawInput ? normalizeToolName(fromRawInput) : void 0;
|
|
131
|
+
const titleName = fromTitle;
|
|
132
|
+
if (fromMeta && !metaName || fromRawInput && !rawInputName) return;
|
|
133
|
+
if (metaName && titleName && metaName !== titleName) return;
|
|
134
|
+
if (rawInputName && metaName && rawInputName !== metaName) return;
|
|
135
|
+
if (rawInputName && titleName && rawInputName !== titleName) return;
|
|
136
|
+
return metaName ?? titleName ?? rawInputName;
|
|
137
|
+
}
|
|
138
|
+
function extractPathFromToolTitle(toolTitle, toolName) {
|
|
139
|
+
if (!toolTitle) return;
|
|
140
|
+
const separator = toolTitle.indexOf(":");
|
|
141
|
+
if (separator < 0) return;
|
|
142
|
+
const tail = toolTitle.slice(separator + 1).trim();
|
|
143
|
+
if (!tail) return;
|
|
144
|
+
const keyedMatch = tail.match(/(?:^|,\s*)(?:path|file_path|filePath)\s*:\s*([^,]+)/);
|
|
145
|
+
if (keyedMatch?.[1]) return keyedMatch[1].trim();
|
|
146
|
+
if (toolName === "read") return tail;
|
|
147
|
+
}
|
|
148
|
+
function resolveToolPathCandidate(params, toolName, toolTitle) {
|
|
149
|
+
const fromRawInput = readFirstStringValue(asRecord$1(params.toolCall?.rawInput), READ_TOOL_PATH_KEYS);
|
|
150
|
+
const fromTitle = extractPathFromToolTitle(toolTitle, toolName);
|
|
151
|
+
return fromRawInput ?? fromTitle;
|
|
152
|
+
}
|
|
153
|
+
function resolveAbsoluteScopedPath(value, cwd) {
|
|
154
|
+
let candidate = value.trim();
|
|
155
|
+
if (!candidate) return;
|
|
156
|
+
if (candidate.startsWith("file://")) try {
|
|
157
|
+
const parsed = new URL(candidate);
|
|
158
|
+
candidate = decodeURIComponent(parsed.pathname || "");
|
|
159
|
+
} catch {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (candidate === "~") candidate = homedir();
|
|
163
|
+
else if (candidate.startsWith("~/")) candidate = path.join(homedir(), candidate.slice(2));
|
|
164
|
+
return path.isAbsolute(candidate) ? path.normalize(candidate) : path.resolve(cwd, candidate);
|
|
165
|
+
}
|
|
166
|
+
function isPathWithinRoot(candidatePath, root) {
|
|
167
|
+
const relative = path.relative(root, candidatePath);
|
|
168
|
+
return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
169
|
+
}
|
|
170
|
+
function isReadToolCallScopedToCwd(params, toolName, toolTitle, cwd) {
|
|
171
|
+
if (toolName !== "read") return false;
|
|
172
|
+
const rawPath = resolveToolPathCandidate(params, toolName, toolTitle);
|
|
173
|
+
if (!rawPath) return false;
|
|
174
|
+
const absolutePath = resolveAbsoluteScopedPath(rawPath, cwd);
|
|
175
|
+
if (!absolutePath) return false;
|
|
176
|
+
return isPathWithinRoot(absolutePath, path.resolve(cwd));
|
|
177
|
+
}
|
|
178
|
+
function shouldAutoApproveToolCall(params, toolName, toolTitle, cwd) {
|
|
179
|
+
const isTrustedToolId = typeof toolName === "string" && (isKnownCoreToolId(toolName) || TRUSTED_SAFE_TOOL_ALIASES.has(toolName));
|
|
180
|
+
if (!toolName || !isTrustedToolId || !SAFE_AUTO_APPROVE_TOOL_IDS.has(toolName)) return false;
|
|
181
|
+
if (toolName === "read") return isReadToolCallScopedToCwd(params, toolName, toolTitle, cwd);
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
function pickOption(options, kinds) {
|
|
185
|
+
for (const kind of kinds) {
|
|
186
|
+
const match = options.find((option) => option.kind === kind);
|
|
187
|
+
if (match) return match;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function selectedPermission(optionId) {
|
|
191
|
+
return { outcome: {
|
|
192
|
+
outcome: "selected",
|
|
193
|
+
optionId
|
|
194
|
+
} };
|
|
195
|
+
}
|
|
196
|
+
function cancelledPermission() {
|
|
197
|
+
return { outcome: { outcome: "cancelled" } };
|
|
198
|
+
}
|
|
199
|
+
function promptUserPermission(toolName, toolTitle) {
|
|
200
|
+
if (!process.stdin.isTTY || !process.stderr.isTTY) {
|
|
201
|
+
console.error(`[permission denied] ${toolName ?? "unknown"}: non-interactive terminal`);
|
|
202
|
+
return Promise.resolve(false);
|
|
203
|
+
}
|
|
204
|
+
return new Promise((resolve) => {
|
|
205
|
+
let settled = false;
|
|
206
|
+
const rl = readline$1.createInterface({
|
|
207
|
+
input: process.stdin,
|
|
208
|
+
output: process.stderr
|
|
209
|
+
});
|
|
210
|
+
const finish = (approved) => {
|
|
211
|
+
if (settled) return;
|
|
212
|
+
settled = true;
|
|
213
|
+
clearTimeout(timeout);
|
|
214
|
+
rl.close();
|
|
215
|
+
resolve(approved);
|
|
216
|
+
};
|
|
217
|
+
const timeout = setTimeout(() => {
|
|
218
|
+
console.error(`\n[permission timeout] denied: ${toolName ?? "unknown"}`);
|
|
219
|
+
finish(false);
|
|
220
|
+
}, 3e4);
|
|
221
|
+
const label = toolTitle ? toolName ? `${toolTitle} (${toolName})` : toolTitle : toolName ?? "unknown tool";
|
|
222
|
+
rl.question(`\n[permission] Allow "${label}"? (y/N) `, (answer) => {
|
|
223
|
+
const approved = answer.trim().toLowerCase() === "y";
|
|
224
|
+
console.error(`[permission ${approved ? "approved" : "denied"}] ${toolName ?? "unknown"}`);
|
|
225
|
+
finish(approved);
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
async function resolvePermissionRequest(params, deps = {}) {
|
|
230
|
+
const log = deps.log ?? ((line) => console.error(line));
|
|
231
|
+
const prompt = deps.prompt ?? promptUserPermission;
|
|
232
|
+
const cwd = deps.cwd ?? process.cwd();
|
|
233
|
+
const options = params.options ?? [];
|
|
234
|
+
const toolTitle = params.toolCall?.title ?? "tool";
|
|
235
|
+
const toolName = resolveToolNameForPermission(params);
|
|
236
|
+
const toolKind = resolveToolKindForPermission(toolName);
|
|
237
|
+
if (options.length === 0) {
|
|
238
|
+
log(`[permission cancelled] ${toolName ?? "unknown"}: no options available`);
|
|
239
|
+
return cancelledPermission();
|
|
240
|
+
}
|
|
241
|
+
const allowOption = pickOption(options, ["allow_once", "allow_always"]);
|
|
242
|
+
const rejectOption = pickOption(options, ["reject_once", "reject_always"]);
|
|
243
|
+
const autoApproveAllowed = shouldAutoApproveToolCall(params, toolName, toolTitle, cwd);
|
|
244
|
+
if (!(!toolName || !autoApproveAllowed || DANGEROUS_ACP_TOOLS.has(toolName))) {
|
|
245
|
+
const option = allowOption ?? options[0];
|
|
246
|
+
if (!option) {
|
|
247
|
+
log(`[permission cancelled] ${toolName}: no selectable options`);
|
|
248
|
+
return cancelledPermission();
|
|
249
|
+
}
|
|
250
|
+
log(`[permission auto-approved] ${toolName} (${toolKind ?? "unknown"})`);
|
|
251
|
+
return selectedPermission(option.optionId);
|
|
252
|
+
}
|
|
253
|
+
log(`\n[permission requested] ${toolTitle}${toolName ? ` (${toolName})` : ""}${toolKind ? ` [${toolKind}]` : ""}`);
|
|
254
|
+
const approved = await prompt(toolName, toolTitle);
|
|
255
|
+
if (approved && allowOption) return selectedPermission(allowOption.optionId);
|
|
256
|
+
if (!approved && rejectOption) return selectedPermission(rejectOption.optionId);
|
|
257
|
+
log(`[permission cancelled] ${toolName ?? "unknown"}: missing ${approved ? "allow" : "reject"} option`);
|
|
258
|
+
return cancelledPermission();
|
|
259
|
+
}
|
|
260
|
+
function toArgs(value) {
|
|
261
|
+
if (!value) return [];
|
|
262
|
+
return Array.isArray(value) ? value : [value];
|
|
263
|
+
}
|
|
264
|
+
function buildServerArgs(opts) {
|
|
265
|
+
const args = ["acp", ...toArgs(opts.serverArgs)];
|
|
266
|
+
if (opts.serverVerbose && !args.includes("--verbose") && !args.includes("-v")) args.push("--verbose");
|
|
267
|
+
return args;
|
|
268
|
+
}
|
|
269
|
+
function resolveAcpClientSpawnEnv(baseEnv = process.env, options = {}) {
|
|
270
|
+
const env = omitEnvKeysCaseInsensitive(baseEnv, options.stripKeys ?? []);
|
|
271
|
+
env.OPENCLAW_SHELL = "acp-client";
|
|
272
|
+
return env;
|
|
273
|
+
}
|
|
274
|
+
function shouldStripProviderAuthEnvVarsForAcpServer(params = {}) {
|
|
275
|
+
const serverCommand = params.serverCommand?.trim();
|
|
276
|
+
if (!serverCommand) return true;
|
|
277
|
+
const defaultServerCommand = params.defaultServerCommand?.trim();
|
|
278
|
+
if (!defaultServerCommand || serverCommand !== defaultServerCommand) return false;
|
|
279
|
+
const serverArgs = params.serverArgs ?? [];
|
|
280
|
+
const defaultServerArgs = params.defaultServerArgs ?? [];
|
|
281
|
+
return serverArgs.length === defaultServerArgs.length && serverArgs.every((arg, index) => arg === defaultServerArgs[index]);
|
|
282
|
+
}
|
|
283
|
+
function buildAcpClientStripKeys(params) {
|
|
284
|
+
const stripKeys = new Set(params.activeSkillEnvKeys ?? []);
|
|
285
|
+
if (params.stripProviderAuthEnvVars) for (const key of listKnownProviderAuthEnvVarNames()) stripKeys.add(key);
|
|
286
|
+
return stripKeys;
|
|
287
|
+
}
|
|
288
|
+
const DEFAULT_ACP_SPAWN_RUNTIME = {
|
|
289
|
+
platform: process.platform,
|
|
290
|
+
env: process.env,
|
|
291
|
+
execPath: process.execPath
|
|
292
|
+
};
|
|
293
|
+
function resolveAcpClientSpawnInvocation(params, runtime = DEFAULT_ACP_SPAWN_RUNTIME) {
|
|
294
|
+
const resolved = materializeWindowsSpawnProgram(resolveWindowsSpawnProgram({
|
|
295
|
+
command: params.serverCommand,
|
|
296
|
+
platform: runtime.platform,
|
|
297
|
+
env: runtime.env,
|
|
298
|
+
execPath: runtime.execPath,
|
|
299
|
+
packageName: "openclaw",
|
|
300
|
+
allowShellFallback: true
|
|
301
|
+
}), params.serverArgs);
|
|
302
|
+
return {
|
|
303
|
+
command: resolved.command,
|
|
304
|
+
args: resolved.argv,
|
|
305
|
+
shell: resolved.shell,
|
|
306
|
+
windowsHide: resolved.windowsHide
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function resolveSelfEntryPath() {
|
|
310
|
+
try {
|
|
311
|
+
const here = fileURLToPath(import.meta.url);
|
|
312
|
+
const candidate = path.resolve(path.dirname(here), "..", "entry.js");
|
|
313
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
314
|
+
} catch {}
|
|
315
|
+
const argv1 = process.argv[1]?.trim();
|
|
316
|
+
if (argv1) return path.isAbsolute(argv1) ? argv1 : path.resolve(process.cwd(), argv1);
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
function printSessionUpdate(notification) {
|
|
320
|
+
const update = notification.update;
|
|
321
|
+
if (!("sessionUpdate" in update)) return;
|
|
322
|
+
switch (update.sessionUpdate) {
|
|
323
|
+
case "agent_message_chunk":
|
|
324
|
+
if (update.content?.type === "text") process.stdout.write(update.content.text);
|
|
325
|
+
return;
|
|
326
|
+
case "tool_call":
|
|
327
|
+
console.log(`\n[tool] ${update.title} (${update.status})`);
|
|
328
|
+
return;
|
|
329
|
+
case "tool_call_update":
|
|
330
|
+
if (update.status) console.log(`[tool update] ${update.toolCallId}: ${update.status}`);
|
|
331
|
+
return;
|
|
332
|
+
case "available_commands_update": {
|
|
333
|
+
const names = update.availableCommands?.map((cmd) => `/${cmd.name}`).join(" ");
|
|
334
|
+
if (names) console.log(`\n[commands] ${names}`);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
default: return;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
async function createAcpClient(opts = {}) {
|
|
341
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
342
|
+
const log = Boolean(opts.verbose) ? (msg) => console.error(`[acp-client] ${msg}`) : () => {};
|
|
343
|
+
ensureOpenClawCliOnPath();
|
|
344
|
+
const serverArgs = buildServerArgs(opts);
|
|
345
|
+
const entryPath = resolveSelfEntryPath();
|
|
346
|
+
const defaultServerCommand = entryPath ? process.execPath : "openclaw";
|
|
347
|
+
const defaultServerArgs = entryPath ? [entryPath, ...serverArgs] : serverArgs;
|
|
348
|
+
const serverCommand = opts.serverCommand ?? defaultServerCommand;
|
|
349
|
+
const effectiveArgs = opts.serverCommand || !entryPath ? serverArgs : defaultServerArgs;
|
|
350
|
+
const { getActiveSkillEnvKeys } = await import("./env-overrides.runtime-DLrwions.js");
|
|
351
|
+
const stripKeys = buildAcpClientStripKeys({
|
|
352
|
+
stripProviderAuthEnvVars: shouldStripProviderAuthEnvVarsForAcpServer({
|
|
353
|
+
serverCommand,
|
|
354
|
+
serverArgs: effectiveArgs,
|
|
355
|
+
defaultServerCommand,
|
|
356
|
+
defaultServerArgs
|
|
357
|
+
}),
|
|
358
|
+
activeSkillEnvKeys: getActiveSkillEnvKeys()
|
|
359
|
+
});
|
|
360
|
+
const spawnEnv = resolveAcpClientSpawnEnv(process.env, { stripKeys });
|
|
361
|
+
const spawnInvocation = resolveAcpClientSpawnInvocation({
|
|
362
|
+
serverCommand,
|
|
363
|
+
serverArgs: effectiveArgs
|
|
364
|
+
}, {
|
|
365
|
+
platform: process.platform,
|
|
366
|
+
env: spawnEnv,
|
|
367
|
+
execPath: process.execPath
|
|
368
|
+
});
|
|
369
|
+
log(`spawning: ${spawnInvocation.command} ${spawnInvocation.args.join(" ")}`);
|
|
370
|
+
const agent = spawn(spawnInvocation.command, spawnInvocation.args, {
|
|
371
|
+
stdio: [
|
|
372
|
+
"pipe",
|
|
373
|
+
"pipe",
|
|
374
|
+
"inherit"
|
|
375
|
+
],
|
|
376
|
+
cwd,
|
|
377
|
+
env: spawnEnv,
|
|
378
|
+
shell: spawnInvocation.shell,
|
|
379
|
+
windowsHide: spawnInvocation.windowsHide
|
|
380
|
+
});
|
|
381
|
+
if (!agent.stdin || !agent.stdout) throw new Error("Failed to create ACP stdio pipes");
|
|
382
|
+
const client = new ClientSideConnection(() => ({
|
|
383
|
+
sessionUpdate: async (params) => {
|
|
384
|
+
printSessionUpdate(params);
|
|
385
|
+
},
|
|
386
|
+
requestPermission: async (params) => {
|
|
387
|
+
return resolvePermissionRequest(params, { cwd });
|
|
388
|
+
}
|
|
389
|
+
}), ndJsonStream(Writable.toWeb(agent.stdin), Readable.toWeb(agent.stdout)));
|
|
390
|
+
log("initializing");
|
|
391
|
+
await client.initialize({
|
|
392
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
393
|
+
clientCapabilities: {
|
|
394
|
+
fs: {
|
|
395
|
+
readTextFile: true,
|
|
396
|
+
writeTextFile: true
|
|
397
|
+
},
|
|
398
|
+
terminal: true
|
|
399
|
+
},
|
|
400
|
+
clientInfo: {
|
|
401
|
+
name: "openclaw-acp-client",
|
|
402
|
+
version: "1.0.0"
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
log("creating session");
|
|
406
|
+
return {
|
|
407
|
+
client,
|
|
408
|
+
agent,
|
|
409
|
+
sessionId: (await client.newSession({
|
|
410
|
+
cwd,
|
|
411
|
+
mcpServers: []
|
|
412
|
+
})).sessionId
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
async function runAcpClientInteractive(opts = {}) {
|
|
416
|
+
const { client, agent, sessionId } = await createAcpClient(opts);
|
|
417
|
+
const rl = readline$1.createInterface({
|
|
418
|
+
input: process.stdin,
|
|
419
|
+
output: process.stdout
|
|
420
|
+
});
|
|
421
|
+
console.log("OpenClaw ACP client");
|
|
422
|
+
console.log(`Session: ${sessionId}`);
|
|
423
|
+
console.log("Type a prompt, or \"exit\" to quit.\n");
|
|
424
|
+
const prompt = () => {
|
|
425
|
+
rl.question("> ", async (input) => {
|
|
426
|
+
const text = input.trim();
|
|
427
|
+
if (!text) {
|
|
428
|
+
prompt();
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
if (text === "exit" || text === "quit") {
|
|
432
|
+
agent.kill();
|
|
433
|
+
rl.close();
|
|
434
|
+
process.exit(0);
|
|
435
|
+
}
|
|
436
|
+
try {
|
|
437
|
+
const response = await client.prompt({
|
|
438
|
+
sessionId,
|
|
439
|
+
prompt: [{
|
|
440
|
+
type: "text",
|
|
441
|
+
text
|
|
442
|
+
}]
|
|
443
|
+
});
|
|
444
|
+
console.log(`\n[${response.stopReason}]\n`);
|
|
445
|
+
} catch (err) {
|
|
446
|
+
console.error(`\n[error] ${String(err)}\n`);
|
|
447
|
+
}
|
|
448
|
+
prompt();
|
|
449
|
+
});
|
|
450
|
+
};
|
|
451
|
+
prompt();
|
|
452
|
+
agent.on("exit", (code) => {
|
|
453
|
+
console.log(`\nAgent exited with code ${code ?? 0}`);
|
|
454
|
+
rl.close();
|
|
455
|
+
process.exit(code ?? 0);
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/infra/fixed-window-rate-limit.ts
|
|
460
|
+
function createFixedWindowRateLimiter(params) {
|
|
461
|
+
const maxRequests = Math.max(1, Math.floor(params.maxRequests));
|
|
462
|
+
const windowMs = Math.max(1, Math.floor(params.windowMs));
|
|
463
|
+
const now = params.now ?? Date.now;
|
|
464
|
+
let count = 0;
|
|
465
|
+
let windowStartMs = 0;
|
|
466
|
+
return {
|
|
467
|
+
consume() {
|
|
468
|
+
const nowMs = now();
|
|
469
|
+
if (nowMs - windowStartMs >= windowMs) {
|
|
470
|
+
windowStartMs = nowMs;
|
|
471
|
+
count = 0;
|
|
472
|
+
}
|
|
473
|
+
if (count >= maxRequests) return {
|
|
474
|
+
allowed: false,
|
|
475
|
+
retryAfterMs: Math.max(0, windowStartMs + windowMs - nowMs),
|
|
476
|
+
remaining: 0
|
|
477
|
+
};
|
|
478
|
+
count += 1;
|
|
479
|
+
return {
|
|
480
|
+
allowed: true,
|
|
481
|
+
retryAfterMs: 0,
|
|
482
|
+
remaining: Math.max(0, maxRequests - count)
|
|
483
|
+
};
|
|
484
|
+
},
|
|
485
|
+
reset() {
|
|
486
|
+
count = 0;
|
|
487
|
+
windowStartMs = 0;
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/acp/commands.ts
|
|
493
|
+
function getAvailableCommands() {
|
|
494
|
+
return [
|
|
495
|
+
{
|
|
496
|
+
name: "help",
|
|
497
|
+
description: "Show help and common commands."
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
name: "commands",
|
|
501
|
+
description: "List available commands."
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: "status",
|
|
505
|
+
description: "Show current status."
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: "context",
|
|
509
|
+
description: "Explain context usage (list|detail|json).",
|
|
510
|
+
input: { hint: "list | detail | json" }
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
name: "whoami",
|
|
514
|
+
description: "Show sender id (alias: /id)."
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
name: "id",
|
|
518
|
+
description: "Alias for /whoami."
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
name: "subagents",
|
|
522
|
+
description: "List or manage sub-agents."
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
name: "config",
|
|
526
|
+
description: "Read or write config (owner-only)."
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
name: "debug",
|
|
530
|
+
description: "Set runtime-only overrides (owner-only)."
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: "usage",
|
|
534
|
+
description: "Toggle usage footer (off|tokens|full)."
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
name: "stop",
|
|
538
|
+
description: "Stop the current run."
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
name: "restart",
|
|
542
|
+
description: "Restart the gateway (if enabled)."
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
name: "dock-telegram",
|
|
546
|
+
description: "Route replies to Telegram."
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
name: "dock-discord",
|
|
550
|
+
description: "Route replies to Discord."
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
name: "dock-slack",
|
|
554
|
+
description: "Route replies to Slack."
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
name: "activation",
|
|
558
|
+
description: "Set group activation (mention|always)."
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
name: "send",
|
|
562
|
+
description: "Set send mode (on|off|inherit)."
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
name: "reset",
|
|
566
|
+
description: "Reset the session (/new)."
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: "new",
|
|
570
|
+
description: "Reset the session (/reset)."
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
name: "think",
|
|
574
|
+
description: "Set thinking level (off|minimal|low|medium|high|xhigh)."
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
name: "verbose",
|
|
578
|
+
description: "Set verbose mode (on|full|off)."
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
name: "reasoning",
|
|
582
|
+
description: "Toggle reasoning output (on|off|stream)."
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
name: "elevated",
|
|
586
|
+
description: "Toggle elevated mode (on|off)."
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: "model",
|
|
590
|
+
description: "Select a model (list|status|<name>)."
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
name: "queue",
|
|
594
|
+
description: "Adjust queue mode and options."
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
name: "bash",
|
|
598
|
+
description: "Run a host command (if enabled)."
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
name: "compact",
|
|
602
|
+
description: "Compact the session history."
|
|
603
|
+
}
|
|
604
|
+
];
|
|
605
|
+
}
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region src/acp/event-mapper.ts
|
|
608
|
+
const TOOL_LOCATION_PATH_KEYS = [
|
|
609
|
+
"path",
|
|
610
|
+
"filePath",
|
|
611
|
+
"file_path",
|
|
612
|
+
"targetPath",
|
|
613
|
+
"target_path",
|
|
614
|
+
"targetFile",
|
|
615
|
+
"target_file",
|
|
616
|
+
"sourcePath",
|
|
617
|
+
"source_path",
|
|
618
|
+
"destinationPath",
|
|
619
|
+
"destination_path",
|
|
620
|
+
"oldPath",
|
|
621
|
+
"old_path",
|
|
622
|
+
"newPath",
|
|
623
|
+
"new_path",
|
|
624
|
+
"outputPath",
|
|
625
|
+
"output_path",
|
|
626
|
+
"inputPath",
|
|
627
|
+
"input_path"
|
|
628
|
+
];
|
|
629
|
+
const TOOL_LOCATION_LINE_KEYS = [
|
|
630
|
+
"line",
|
|
631
|
+
"lineNumber",
|
|
632
|
+
"line_number",
|
|
633
|
+
"startLine",
|
|
634
|
+
"start_line"
|
|
635
|
+
];
|
|
636
|
+
const TOOL_RESULT_PATH_MARKER_RE = /^(?:FILE|MEDIA):(.+)$/gm;
|
|
637
|
+
const TOOL_LOCATION_MAX_DEPTH = 4;
|
|
638
|
+
const TOOL_LOCATION_MAX_NODES = 100;
|
|
639
|
+
const INLINE_CONTROL_ESCAPE_MAP = {
|
|
640
|
+
"\0": "\\0",
|
|
641
|
+
"\r": "\\r",
|
|
642
|
+
"\n": "\\n",
|
|
643
|
+
" ": "\\t",
|
|
644
|
+
"\v": "\\v",
|
|
645
|
+
"\f": "\\f",
|
|
646
|
+
"\u2028": "\\u2028",
|
|
647
|
+
"\u2029": "\\u2029"
|
|
648
|
+
};
|
|
649
|
+
function escapeInlineControlChars(value) {
|
|
650
|
+
let escaped = "";
|
|
651
|
+
for (const char of value) {
|
|
652
|
+
const codePoint = char.codePointAt(0);
|
|
653
|
+
if (codePoint === void 0) {
|
|
654
|
+
escaped += char;
|
|
655
|
+
continue;
|
|
656
|
+
}
|
|
657
|
+
if (!(codePoint <= 31 || codePoint >= 127 && codePoint <= 159 || codePoint === 8232 || codePoint === 8233)) {
|
|
658
|
+
escaped += char;
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
const mapped = INLINE_CONTROL_ESCAPE_MAP[char];
|
|
662
|
+
if (mapped) {
|
|
663
|
+
escaped += mapped;
|
|
664
|
+
continue;
|
|
665
|
+
}
|
|
666
|
+
escaped += codePoint <= 255 ? `\\x${codePoint.toString(16).padStart(2, "0")}` : `\\u${codePoint.toString(16).padStart(4, "0")}`;
|
|
667
|
+
}
|
|
668
|
+
return escaped;
|
|
669
|
+
}
|
|
670
|
+
function escapeResourceTitle(value) {
|
|
671
|
+
return escapeInlineControlChars(value).replace(/[()[\]]/g, (char) => `\\${char}`);
|
|
672
|
+
}
|
|
673
|
+
function asRecord(value) {
|
|
674
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
675
|
+
}
|
|
676
|
+
function normalizeToolLocationPath(value) {
|
|
677
|
+
const trimmed = value.trim();
|
|
678
|
+
if (!trimmed || trimmed.length > 4096 || trimmed.includes("\0") || trimmed.includes("\r") || trimmed.includes("\n")) return;
|
|
679
|
+
if (/^https?:\/\//i.test(trimmed)) return;
|
|
680
|
+
if (/^file:\/\//i.test(trimmed)) try {
|
|
681
|
+
const parsed = new URL(trimmed);
|
|
682
|
+
return decodeURIComponent(parsed.pathname || "") || void 0;
|
|
683
|
+
} catch {
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
return trimmed;
|
|
687
|
+
}
|
|
688
|
+
function normalizeToolLocationLine(value) {
|
|
689
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return;
|
|
690
|
+
const line = Math.floor(value);
|
|
691
|
+
return line > 0 ? line : void 0;
|
|
692
|
+
}
|
|
693
|
+
function extractToolLocationLine(record) {
|
|
694
|
+
for (const key of TOOL_LOCATION_LINE_KEYS) {
|
|
695
|
+
const line = normalizeToolLocationLine(record[key]);
|
|
696
|
+
if (line !== void 0) return line;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function addToolLocation(locations, rawPath, line) {
|
|
700
|
+
const path = normalizeToolLocationPath(rawPath);
|
|
701
|
+
if (!path) return;
|
|
702
|
+
for (const [existingKey, existing] of locations.entries()) {
|
|
703
|
+
if (existing.path !== path) continue;
|
|
704
|
+
if (line === void 0 || existing.line === line) return;
|
|
705
|
+
if (existing.line === void 0) locations.delete(existingKey);
|
|
706
|
+
}
|
|
707
|
+
const locationKey = `${path}:${line ?? ""}`;
|
|
708
|
+
if (locations.has(locationKey)) return;
|
|
709
|
+
locations.set(locationKey, line ? {
|
|
710
|
+
path,
|
|
711
|
+
line
|
|
712
|
+
} : { path });
|
|
713
|
+
}
|
|
714
|
+
function collectLocationsFromTextMarkers(text, locations) {
|
|
715
|
+
for (const match of text.matchAll(TOOL_RESULT_PATH_MARKER_RE)) {
|
|
716
|
+
const candidate = match[1]?.trim();
|
|
717
|
+
if (candidate) addToolLocation(locations, candidate);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
function collectToolLocations(value, locations, state, depth) {
|
|
721
|
+
if (state.visited >= TOOL_LOCATION_MAX_NODES || depth > TOOL_LOCATION_MAX_DEPTH) return;
|
|
722
|
+
state.visited += 1;
|
|
723
|
+
if (typeof value === "string") {
|
|
724
|
+
collectLocationsFromTextMarkers(value, locations);
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
if (!value || typeof value !== "object") return;
|
|
728
|
+
if (Array.isArray(value)) {
|
|
729
|
+
for (const item of value) {
|
|
730
|
+
collectToolLocations(item, locations, state, depth + 1);
|
|
731
|
+
if (state.visited >= TOOL_LOCATION_MAX_NODES) return;
|
|
732
|
+
}
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
const record = value;
|
|
736
|
+
const line = extractToolLocationLine(record);
|
|
737
|
+
for (const key of TOOL_LOCATION_PATH_KEYS) {
|
|
738
|
+
const rawPath = record[key];
|
|
739
|
+
if (typeof rawPath === "string") addToolLocation(locations, rawPath, line);
|
|
740
|
+
}
|
|
741
|
+
const content = Array.isArray(record.content) ? record.content : void 0;
|
|
742
|
+
if (content) for (const block of content) {
|
|
743
|
+
const entry = asRecord(block);
|
|
744
|
+
if (entry?.type === "text" && typeof entry.text === "string") collectLocationsFromTextMarkers(entry.text, locations);
|
|
745
|
+
}
|
|
746
|
+
for (const [key, nested] of Object.entries(record)) {
|
|
747
|
+
if (key === "content") continue;
|
|
748
|
+
collectToolLocations(nested, locations, state, depth + 1);
|
|
749
|
+
if (state.visited >= TOOL_LOCATION_MAX_NODES) return;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
function extractTextFromPrompt(prompt, maxBytes) {
|
|
753
|
+
const parts = [];
|
|
754
|
+
let totalBytes = 0;
|
|
755
|
+
for (const block of prompt) {
|
|
756
|
+
let blockText;
|
|
757
|
+
if (block.type === "text") blockText = block.text;
|
|
758
|
+
else if (block.type === "resource") {
|
|
759
|
+
const resource = block.resource;
|
|
760
|
+
if (resource?.text) blockText = resource.text;
|
|
761
|
+
} else if (block.type === "resource_link") {
|
|
762
|
+
const title = block.title ? ` (${escapeResourceTitle(block.title)})` : "";
|
|
763
|
+
const uri = block.uri ? escapeInlineControlChars(block.uri) : "";
|
|
764
|
+
blockText = uri ? `[Resource link${title}] ${uri}` : `[Resource link${title}]`;
|
|
765
|
+
}
|
|
766
|
+
if (blockText !== void 0) {
|
|
767
|
+
if (maxBytes !== void 0) {
|
|
768
|
+
const separatorBytes = parts.length > 0 ? 1 : 0;
|
|
769
|
+
totalBytes += separatorBytes + Buffer.byteLength(blockText, "utf-8");
|
|
770
|
+
if (totalBytes > maxBytes) throw new Error(`Prompt exceeds maximum allowed size of ${maxBytes} bytes`);
|
|
771
|
+
}
|
|
772
|
+
parts.push(blockText);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
return parts.join("\n");
|
|
776
|
+
}
|
|
777
|
+
function extractAttachmentsFromPrompt(prompt) {
|
|
778
|
+
const attachments = [];
|
|
779
|
+
for (const block of prompt) {
|
|
780
|
+
if (block.type !== "image") continue;
|
|
781
|
+
const image = block;
|
|
782
|
+
if (!image.data || !image.mimeType) continue;
|
|
783
|
+
attachments.push({
|
|
784
|
+
type: "image",
|
|
785
|
+
mimeType: image.mimeType,
|
|
786
|
+
content: image.data
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
return attachments;
|
|
790
|
+
}
|
|
791
|
+
function formatToolTitle(name, args) {
|
|
792
|
+
const base = name ?? "tool";
|
|
793
|
+
if (!args || Object.keys(args).length === 0) return base;
|
|
794
|
+
return `${base}: ${Object.entries(args).map(([key, value]) => {
|
|
795
|
+
const raw = typeof value === "string" ? value : JSON.stringify(value);
|
|
796
|
+
return `${key}: ${raw.length > 100 ? `${raw.slice(0, 100)}...` : raw}`;
|
|
797
|
+
}).join(", ")}`;
|
|
798
|
+
}
|
|
799
|
+
function inferToolKind(name) {
|
|
800
|
+
if (!name) return "other";
|
|
801
|
+
const normalized = name.toLowerCase();
|
|
802
|
+
if (normalized.includes("read")) return "read";
|
|
803
|
+
if (normalized.includes("write") || normalized.includes("edit")) return "edit";
|
|
804
|
+
if (normalized.includes("delete") || normalized.includes("remove")) return "delete";
|
|
805
|
+
if (normalized.includes("move") || normalized.includes("rename")) return "move";
|
|
806
|
+
if (normalized.includes("search") || normalized.includes("find")) return "search";
|
|
807
|
+
if (normalized.includes("exec") || normalized.includes("run") || normalized.includes("bash")) return "execute";
|
|
808
|
+
if (normalized.includes("fetch") || normalized.includes("http")) return "fetch";
|
|
809
|
+
return "other";
|
|
810
|
+
}
|
|
811
|
+
function extractToolCallContent(value) {
|
|
812
|
+
if (typeof value === "string") return value.trim() ? [{
|
|
813
|
+
type: "content",
|
|
814
|
+
content: {
|
|
815
|
+
type: "text",
|
|
816
|
+
text: value
|
|
817
|
+
}
|
|
818
|
+
}] : void 0;
|
|
819
|
+
const record = asRecord(value);
|
|
820
|
+
if (!record) return;
|
|
821
|
+
const contents = [];
|
|
822
|
+
const blocks = Array.isArray(record.content) ? record.content : [];
|
|
823
|
+
for (const block of blocks) {
|
|
824
|
+
const entry = asRecord(block);
|
|
825
|
+
if (entry?.type === "text" && typeof entry.text === "string" && entry.text.trim()) contents.push({
|
|
826
|
+
type: "content",
|
|
827
|
+
content: {
|
|
828
|
+
type: "text",
|
|
829
|
+
text: entry.text
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
if (contents.length > 0) return contents;
|
|
834
|
+
const fallbackText = typeof record.text === "string" ? record.text : typeof record.message === "string" ? record.message : typeof record.error === "string" ? record.error : void 0;
|
|
835
|
+
if (!fallbackText?.trim()) return;
|
|
836
|
+
return [{
|
|
837
|
+
type: "content",
|
|
838
|
+
content: {
|
|
839
|
+
type: "text",
|
|
840
|
+
text: fallbackText
|
|
841
|
+
}
|
|
842
|
+
}];
|
|
843
|
+
}
|
|
844
|
+
function extractToolCallLocations(...values) {
|
|
845
|
+
const locations = /* @__PURE__ */ new Map();
|
|
846
|
+
for (const value of values) collectToolLocations(value, locations, { visited: 0 }, 0);
|
|
847
|
+
return locations.size > 0 ? [...locations.values()] : void 0;
|
|
848
|
+
}
|
|
849
|
+
//#endregion
|
|
850
|
+
//#region src/acp/meta.ts
|
|
851
|
+
function readString(meta, keys) {
|
|
852
|
+
if (!meta) return;
|
|
853
|
+
for (const key of keys) {
|
|
854
|
+
const value = meta[key];
|
|
855
|
+
if (typeof value === "string" && value.trim()) return value.trim();
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
function readBool(meta, keys) {
|
|
859
|
+
if (!meta) return;
|
|
860
|
+
for (const key of keys) {
|
|
861
|
+
const value = meta[key];
|
|
862
|
+
if (typeof value === "boolean") return value;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
function readNumber(meta, keys) {
|
|
866
|
+
if (!meta) return;
|
|
867
|
+
for (const key of keys) {
|
|
868
|
+
const value = meta[key];
|
|
869
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region src/acp/session-mapper.ts
|
|
874
|
+
function parseSessionMeta(meta) {
|
|
875
|
+
if (!meta || typeof meta !== "object") return {};
|
|
876
|
+
const record = meta;
|
|
877
|
+
return {
|
|
878
|
+
sessionKey: readString(record, [
|
|
879
|
+
"sessionKey",
|
|
880
|
+
"session",
|
|
881
|
+
"key"
|
|
882
|
+
]),
|
|
883
|
+
sessionLabel: readString(record, ["sessionLabel", "label"]),
|
|
884
|
+
resetSession: readBool(record, ["resetSession", "reset"]),
|
|
885
|
+
requireExisting: readBool(record, ["requireExistingSession", "requireExisting"]),
|
|
886
|
+
prefixCwd: readBool(record, ["prefixCwd"])
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
async function resolveSessionKey(params) {
|
|
890
|
+
const requestedLabel = params.meta.sessionLabel ?? params.opts.defaultSessionLabel;
|
|
891
|
+
const requestedKey = params.meta.sessionKey ?? params.opts.defaultSessionKey;
|
|
892
|
+
const requireExisting = params.meta.requireExisting ?? params.opts.requireExistingSession ?? false;
|
|
893
|
+
if (params.meta.sessionLabel) {
|
|
894
|
+
const resolved = await params.gateway.request("sessions.resolve", { label: params.meta.sessionLabel });
|
|
895
|
+
if (!resolved?.key) throw new Error(`Unable to resolve session label: ${params.meta.sessionLabel}`);
|
|
896
|
+
return resolved.key;
|
|
897
|
+
}
|
|
898
|
+
if (params.meta.sessionKey) {
|
|
899
|
+
if (!requireExisting) return params.meta.sessionKey;
|
|
900
|
+
const resolved = await params.gateway.request("sessions.resolve", { key: params.meta.sessionKey });
|
|
901
|
+
if (!resolved?.key) throw new Error(`Session key not found: ${params.meta.sessionKey}`);
|
|
902
|
+
return resolved.key;
|
|
903
|
+
}
|
|
904
|
+
if (requestedLabel) {
|
|
905
|
+
const resolved = await params.gateway.request("sessions.resolve", { label: requestedLabel });
|
|
906
|
+
if (!resolved?.key) throw new Error(`Unable to resolve session label: ${requestedLabel}`);
|
|
907
|
+
return resolved.key;
|
|
908
|
+
}
|
|
909
|
+
if (requestedKey) {
|
|
910
|
+
if (!requireExisting) return requestedKey;
|
|
911
|
+
const resolved = await params.gateway.request("sessions.resolve", { key: requestedKey });
|
|
912
|
+
if (!resolved?.key) throw new Error(`Session key not found: ${requestedKey}`);
|
|
913
|
+
return resolved.key;
|
|
914
|
+
}
|
|
915
|
+
return params.fallbackKey;
|
|
916
|
+
}
|
|
917
|
+
async function resetSessionIfNeeded(params) {
|
|
918
|
+
if (!(params.meta.resetSession ?? params.opts.resetSession ?? false)) return;
|
|
919
|
+
await params.gateway.request("sessions.reset", { key: params.sessionKey });
|
|
920
|
+
}
|
|
921
|
+
//#endregion
|
|
922
|
+
//#region src/acp/session.ts
|
|
923
|
+
const DEFAULT_MAX_SESSIONS = 5e3;
|
|
924
|
+
const DEFAULT_IDLE_TTL_MS = 1440 * 60 * 1e3;
|
|
925
|
+
function createInMemorySessionStore(options = {}) {
|
|
926
|
+
const maxSessions = Math.max(1, options.maxSessions ?? DEFAULT_MAX_SESSIONS);
|
|
927
|
+
const idleTtlMs = Math.max(1e3, options.idleTtlMs ?? DEFAULT_IDLE_TTL_MS);
|
|
928
|
+
const now = options.now ?? Date.now;
|
|
929
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
930
|
+
const runIdToSessionId = /* @__PURE__ */ new Map();
|
|
931
|
+
const touchSession = (session, nowMs) => {
|
|
932
|
+
session.lastTouchedAt = nowMs;
|
|
933
|
+
};
|
|
934
|
+
const removeSession = (sessionId) => {
|
|
935
|
+
const session = sessions.get(sessionId);
|
|
936
|
+
if (!session) return false;
|
|
937
|
+
if (session.activeRunId) runIdToSessionId.delete(session.activeRunId);
|
|
938
|
+
session.abortController?.abort();
|
|
939
|
+
sessions.delete(sessionId);
|
|
940
|
+
return true;
|
|
941
|
+
};
|
|
942
|
+
const reapIdleSessions = (nowMs) => {
|
|
943
|
+
const idleBefore = nowMs - idleTtlMs;
|
|
944
|
+
for (const [sessionId, session] of sessions.entries()) {
|
|
945
|
+
if (session.activeRunId || session.abortController) continue;
|
|
946
|
+
if (session.lastTouchedAt > idleBefore) continue;
|
|
947
|
+
removeSession(sessionId);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
const evictOldestIdleSession = () => {
|
|
951
|
+
let oldestSessionId = null;
|
|
952
|
+
let oldestLastTouchedAt = Number.POSITIVE_INFINITY;
|
|
953
|
+
for (const [sessionId, session] of sessions.entries()) {
|
|
954
|
+
if (session.activeRunId || session.abortController) continue;
|
|
955
|
+
if (session.lastTouchedAt >= oldestLastTouchedAt) continue;
|
|
956
|
+
oldestLastTouchedAt = session.lastTouchedAt;
|
|
957
|
+
oldestSessionId = sessionId;
|
|
958
|
+
}
|
|
959
|
+
if (!oldestSessionId) return false;
|
|
960
|
+
return removeSession(oldestSessionId);
|
|
961
|
+
};
|
|
962
|
+
const createSession = (params) => {
|
|
963
|
+
const nowMs = now();
|
|
964
|
+
const sessionId = params.sessionId ?? randomUUID();
|
|
965
|
+
const existingSession = sessions.get(sessionId);
|
|
966
|
+
if (existingSession) {
|
|
967
|
+
existingSession.sessionKey = params.sessionKey;
|
|
968
|
+
existingSession.cwd = params.cwd;
|
|
969
|
+
touchSession(existingSession, nowMs);
|
|
970
|
+
return existingSession;
|
|
971
|
+
}
|
|
972
|
+
reapIdleSessions(nowMs);
|
|
973
|
+
if (sessions.size >= maxSessions && !evictOldestIdleSession()) throw new Error(`ACP session limit reached (max ${maxSessions}). Close idle ACP clients and retry.`);
|
|
974
|
+
const session = {
|
|
975
|
+
sessionId,
|
|
976
|
+
sessionKey: params.sessionKey,
|
|
977
|
+
cwd: params.cwd,
|
|
978
|
+
createdAt: nowMs,
|
|
979
|
+
lastTouchedAt: nowMs,
|
|
980
|
+
abortController: null,
|
|
981
|
+
activeRunId: null
|
|
982
|
+
};
|
|
983
|
+
sessions.set(sessionId, session);
|
|
984
|
+
return session;
|
|
985
|
+
};
|
|
986
|
+
const hasSession = (sessionId) => sessions.has(sessionId);
|
|
987
|
+
const getSession = (sessionId) => {
|
|
988
|
+
const session = sessions.get(sessionId);
|
|
989
|
+
if (session) touchSession(session, now());
|
|
990
|
+
return session;
|
|
991
|
+
};
|
|
992
|
+
const getSessionByRunId = (runId) => {
|
|
993
|
+
const sessionId = runIdToSessionId.get(runId);
|
|
994
|
+
if (!sessionId) return;
|
|
995
|
+
const session = sessions.get(sessionId);
|
|
996
|
+
if (session) touchSession(session, now());
|
|
997
|
+
return session;
|
|
998
|
+
};
|
|
999
|
+
const setActiveRun = (sessionId, runId, abortController) => {
|
|
1000
|
+
const session = sessions.get(sessionId);
|
|
1001
|
+
if (!session) return;
|
|
1002
|
+
session.activeRunId = runId;
|
|
1003
|
+
session.abortController = abortController;
|
|
1004
|
+
runIdToSessionId.set(runId, sessionId);
|
|
1005
|
+
touchSession(session, now());
|
|
1006
|
+
};
|
|
1007
|
+
const clearActiveRun = (sessionId) => {
|
|
1008
|
+
const session = sessions.get(sessionId);
|
|
1009
|
+
if (!session) return;
|
|
1010
|
+
if (session.activeRunId) runIdToSessionId.delete(session.activeRunId);
|
|
1011
|
+
session.activeRunId = null;
|
|
1012
|
+
session.abortController = null;
|
|
1013
|
+
touchSession(session, now());
|
|
1014
|
+
};
|
|
1015
|
+
const cancelActiveRun = (sessionId) => {
|
|
1016
|
+
const session = sessions.get(sessionId);
|
|
1017
|
+
if (!session?.abortController) return false;
|
|
1018
|
+
session.abortController.abort();
|
|
1019
|
+
if (session.activeRunId) runIdToSessionId.delete(session.activeRunId);
|
|
1020
|
+
session.abortController = null;
|
|
1021
|
+
session.activeRunId = null;
|
|
1022
|
+
touchSession(session, now());
|
|
1023
|
+
return true;
|
|
1024
|
+
};
|
|
1025
|
+
const clearAllSessionsForTest = () => {
|
|
1026
|
+
for (const session of sessions.values()) session.abortController?.abort();
|
|
1027
|
+
sessions.clear();
|
|
1028
|
+
runIdToSessionId.clear();
|
|
1029
|
+
};
|
|
1030
|
+
return {
|
|
1031
|
+
createSession,
|
|
1032
|
+
hasSession,
|
|
1033
|
+
getSession,
|
|
1034
|
+
getSessionByRunId,
|
|
1035
|
+
setActiveRun,
|
|
1036
|
+
clearActiveRun,
|
|
1037
|
+
cancelActiveRun,
|
|
1038
|
+
clearAllSessionsForTest
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
const defaultAcpSessionStore = createInMemorySessionStore();
|
|
1042
|
+
//#endregion
|
|
1043
|
+
//#region src/acp/types.ts
|
|
1044
|
+
const ACP_PROVENANCE_MODE_VALUES = [
|
|
1045
|
+
"off",
|
|
1046
|
+
"meta",
|
|
1047
|
+
"meta+receipt"
|
|
1048
|
+
];
|
|
1049
|
+
function normalizeAcpProvenanceMode(value) {
|
|
1050
|
+
if (!value) return;
|
|
1051
|
+
const normalized = value.trim().toLowerCase();
|
|
1052
|
+
return ACP_PROVENANCE_MODE_VALUES.includes(normalized) ? normalized : void 0;
|
|
1053
|
+
}
|
|
1054
|
+
const ACP_AGENT_INFO = {
|
|
1055
|
+
name: "openclaw-acp",
|
|
1056
|
+
title: "OpenClaw ACP Gateway",
|
|
1057
|
+
version: VERSION
|
|
1058
|
+
};
|
|
1059
|
+
//#endregion
|
|
1060
|
+
//#region src/acp/translator.ts
|
|
1061
|
+
const MAX_PROMPT_BYTES = 2 * 1024 * 1024;
|
|
1062
|
+
const ACP_THOUGHT_LEVEL_CONFIG_ID = "thought_level";
|
|
1063
|
+
const ACP_FAST_MODE_CONFIG_ID = "fast_mode";
|
|
1064
|
+
const ACP_VERBOSE_LEVEL_CONFIG_ID = "verbose_level";
|
|
1065
|
+
const ACP_REASONING_LEVEL_CONFIG_ID = "reasoning_level";
|
|
1066
|
+
const ACP_RESPONSE_USAGE_CONFIG_ID = "response_usage";
|
|
1067
|
+
const ACP_ELEVATED_LEVEL_CONFIG_ID = "elevated_level";
|
|
1068
|
+
const ACP_LOAD_SESSION_REPLAY_LIMIT = 1e6;
|
|
1069
|
+
const SESSION_CREATE_RATE_LIMIT_DEFAULT_MAX_REQUESTS = 120;
|
|
1070
|
+
const SESSION_CREATE_RATE_LIMIT_DEFAULT_WINDOW_MS = 1e4;
|
|
1071
|
+
function formatThinkingLevelName(level) {
|
|
1072
|
+
switch (level) {
|
|
1073
|
+
case "xhigh": return "Extra High";
|
|
1074
|
+
case "adaptive": return "Adaptive";
|
|
1075
|
+
default: return level.length > 0 ? `${level[0].toUpperCase()}${level.slice(1)}` : "Unknown";
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
function buildThinkingModeDescription(level) {
|
|
1079
|
+
if (level === "adaptive") return "Use the Gateway session default thought level.";
|
|
1080
|
+
}
|
|
1081
|
+
function formatConfigValueName(value) {
|
|
1082
|
+
switch (value) {
|
|
1083
|
+
case "xhigh": return "Extra High";
|
|
1084
|
+
default: return value.length > 0 ? `${value[0].toUpperCase()}${value.slice(1)}` : "Unknown";
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
function buildSelectConfigOption(params) {
|
|
1088
|
+
return {
|
|
1089
|
+
type: "select",
|
|
1090
|
+
id: params.id,
|
|
1091
|
+
name: params.name,
|
|
1092
|
+
category: params.category,
|
|
1093
|
+
description: params.description,
|
|
1094
|
+
currentValue: params.currentValue,
|
|
1095
|
+
options: params.values.map((value) => ({
|
|
1096
|
+
value,
|
|
1097
|
+
name: formatConfigValueName(value)
|
|
1098
|
+
}))
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
function buildSessionPresentation(params) {
|
|
1102
|
+
const row = {
|
|
1103
|
+
...params.row,
|
|
1104
|
+
...params.overrides
|
|
1105
|
+
};
|
|
1106
|
+
const availableLevelIds = [...listThinkingLevels(row.modelProvider, row.model)];
|
|
1107
|
+
const currentModeId = row.thinkingLevel?.trim() || "adaptive";
|
|
1108
|
+
if (!availableLevelIds.includes(currentModeId)) availableLevelIds.push(currentModeId);
|
|
1109
|
+
const modes = {
|
|
1110
|
+
currentModeId,
|
|
1111
|
+
availableModes: availableLevelIds.map((level) => ({
|
|
1112
|
+
id: level,
|
|
1113
|
+
name: formatThinkingLevelName(level),
|
|
1114
|
+
description: buildThinkingModeDescription(level)
|
|
1115
|
+
}))
|
|
1116
|
+
};
|
|
1117
|
+
return {
|
|
1118
|
+
configOptions: [
|
|
1119
|
+
buildSelectConfigOption({
|
|
1120
|
+
id: ACP_THOUGHT_LEVEL_CONFIG_ID,
|
|
1121
|
+
name: "Thought level",
|
|
1122
|
+
category: "thought_level",
|
|
1123
|
+
description: "Controls how much deliberate reasoning OpenClaw requests from the Gateway model.",
|
|
1124
|
+
currentValue: currentModeId,
|
|
1125
|
+
values: availableLevelIds
|
|
1126
|
+
}),
|
|
1127
|
+
buildSelectConfigOption({
|
|
1128
|
+
id: ACP_FAST_MODE_CONFIG_ID,
|
|
1129
|
+
name: "Fast mode",
|
|
1130
|
+
description: "Controls whether OpenAI sessions use the Gateway fast-mode profile.",
|
|
1131
|
+
currentValue: row.fastMode ? "on" : "off",
|
|
1132
|
+
values: ["off", "on"]
|
|
1133
|
+
}),
|
|
1134
|
+
buildSelectConfigOption({
|
|
1135
|
+
id: ACP_VERBOSE_LEVEL_CONFIG_ID,
|
|
1136
|
+
name: "Tool verbosity",
|
|
1137
|
+
description: "Controls how much tool progress and output detail OpenClaw keeps enabled for the session.",
|
|
1138
|
+
currentValue: row.verboseLevel?.trim() || "off",
|
|
1139
|
+
values: [
|
|
1140
|
+
"off",
|
|
1141
|
+
"on",
|
|
1142
|
+
"full"
|
|
1143
|
+
]
|
|
1144
|
+
}),
|
|
1145
|
+
buildSelectConfigOption({
|
|
1146
|
+
id: ACP_REASONING_LEVEL_CONFIG_ID,
|
|
1147
|
+
name: "Reasoning stream",
|
|
1148
|
+
description: "Controls whether reasoning-capable models emit reasoning text for the session.",
|
|
1149
|
+
currentValue: row.reasoningLevel?.trim() || "off",
|
|
1150
|
+
values: [
|
|
1151
|
+
"off",
|
|
1152
|
+
"on",
|
|
1153
|
+
"stream"
|
|
1154
|
+
]
|
|
1155
|
+
}),
|
|
1156
|
+
buildSelectConfigOption({
|
|
1157
|
+
id: ACP_RESPONSE_USAGE_CONFIG_ID,
|
|
1158
|
+
name: "Usage detail",
|
|
1159
|
+
description: "Controls how much usage information OpenClaw attaches to responses for the session.",
|
|
1160
|
+
currentValue: row.responseUsage?.trim() || "off",
|
|
1161
|
+
values: [
|
|
1162
|
+
"off",
|
|
1163
|
+
"tokens",
|
|
1164
|
+
"full"
|
|
1165
|
+
]
|
|
1166
|
+
}),
|
|
1167
|
+
buildSelectConfigOption({
|
|
1168
|
+
id: ACP_ELEVATED_LEVEL_CONFIG_ID,
|
|
1169
|
+
name: "Elevated actions",
|
|
1170
|
+
description: "Controls how aggressively the session allows elevated execution behavior.",
|
|
1171
|
+
currentValue: row.elevatedLevel?.trim() || "off",
|
|
1172
|
+
values: [
|
|
1173
|
+
"off",
|
|
1174
|
+
"on",
|
|
1175
|
+
"ask",
|
|
1176
|
+
"full"
|
|
1177
|
+
]
|
|
1178
|
+
})
|
|
1179
|
+
],
|
|
1180
|
+
modes
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
function extractReplayText(content) {
|
|
1184
|
+
if (typeof content === "string") return content.length > 0 ? content : void 0;
|
|
1185
|
+
if (!Array.isArray(content)) return;
|
|
1186
|
+
const text = content.map((block) => {
|
|
1187
|
+
if (!block || typeof block !== "object" || Array.isArray(block)) return "";
|
|
1188
|
+
const typedBlock = block;
|
|
1189
|
+
return typedBlock.type === "text" && typeof typedBlock.text === "string" ? typedBlock.text : "";
|
|
1190
|
+
}).join("");
|
|
1191
|
+
return text.length > 0 ? text : void 0;
|
|
1192
|
+
}
|
|
1193
|
+
function buildSessionMetadata(params) {
|
|
1194
|
+
return {
|
|
1195
|
+
title: params.row?.derivedTitle?.trim() || params.row?.displayName?.trim() || params.row?.label?.trim() || params.sessionKey,
|
|
1196
|
+
updatedAt: typeof params.row?.updatedAt === "number" && Number.isFinite(params.row.updatedAt) ? new Date(params.row.updatedAt).toISOString() : null
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
function buildSessionUsageSnapshot(row) {
|
|
1200
|
+
const totalTokens = row?.totalTokens;
|
|
1201
|
+
const contextTokens = row?.contextTokens;
|
|
1202
|
+
if (row?.totalTokensFresh !== true || typeof totalTokens !== "number" || !Number.isFinite(totalTokens) || typeof contextTokens !== "number" || !Number.isFinite(contextTokens) || contextTokens <= 0) return;
|
|
1203
|
+
const size = Math.max(0, Math.floor(contextTokens));
|
|
1204
|
+
return {
|
|
1205
|
+
size,
|
|
1206
|
+
used: Math.max(0, Math.min(Math.floor(totalTokens), size))
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
function buildSystemInputProvenance(originSessionId) {
|
|
1210
|
+
return {
|
|
1211
|
+
kind: "external_user",
|
|
1212
|
+
originSessionId,
|
|
1213
|
+
sourceChannel: "acp",
|
|
1214
|
+
sourceTool: "openclaw_acp"
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
function buildSystemProvenanceReceipt(params) {
|
|
1218
|
+
return [
|
|
1219
|
+
"[Source Receipt]",
|
|
1220
|
+
"bridge=openclaw-acp",
|
|
1221
|
+
`originHost=${os.hostname()}`,
|
|
1222
|
+
`originCwd=${shortenHomePath(params.cwd)}`,
|
|
1223
|
+
`acpSessionId=${params.sessionId}`,
|
|
1224
|
+
`originSessionId=${params.sessionId}`,
|
|
1225
|
+
`targetSession=${params.sessionKey}`,
|
|
1226
|
+
"[/Source Receipt]"
|
|
1227
|
+
].join("\n");
|
|
1228
|
+
}
|
|
1229
|
+
var AcpGatewayAgent = class {
|
|
1230
|
+
constructor(connection, gateway, opts = {}) {
|
|
1231
|
+
this.pendingPrompts = /* @__PURE__ */ new Map();
|
|
1232
|
+
this.connection = connection;
|
|
1233
|
+
this.gateway = gateway;
|
|
1234
|
+
this.opts = opts;
|
|
1235
|
+
this.log = opts.verbose ? (msg) => process.stderr.write(`[acp] ${msg}\n`) : () => {};
|
|
1236
|
+
this.sessionStore = opts.sessionStore ?? defaultAcpSessionStore;
|
|
1237
|
+
this.sessionCreateRateLimiter = createFixedWindowRateLimiter({
|
|
1238
|
+
maxRequests: Math.max(1, opts.sessionCreateRateLimit?.maxRequests ?? SESSION_CREATE_RATE_LIMIT_DEFAULT_MAX_REQUESTS),
|
|
1239
|
+
windowMs: Math.max(1e3, opts.sessionCreateRateLimit?.windowMs ?? SESSION_CREATE_RATE_LIMIT_DEFAULT_WINDOW_MS)
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
start() {
|
|
1243
|
+
this.log("ready");
|
|
1244
|
+
}
|
|
1245
|
+
handleGatewayReconnect() {
|
|
1246
|
+
this.log("gateway reconnected");
|
|
1247
|
+
}
|
|
1248
|
+
handleGatewayDisconnect(reason) {
|
|
1249
|
+
this.log(`gateway disconnected: ${reason}`);
|
|
1250
|
+
for (const pending of this.pendingPrompts.values()) {
|
|
1251
|
+
pending.reject(/* @__PURE__ */ new Error(`Gateway disconnected: ${reason}`));
|
|
1252
|
+
this.sessionStore.clearActiveRun(pending.sessionId);
|
|
1253
|
+
}
|
|
1254
|
+
this.pendingPrompts.clear();
|
|
1255
|
+
}
|
|
1256
|
+
async handleGatewayEvent(evt) {
|
|
1257
|
+
if (evt.event === "chat") {
|
|
1258
|
+
await this.handleChatEvent(evt);
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
if (evt.event === "agent") await this.handleAgentEvent(evt);
|
|
1262
|
+
}
|
|
1263
|
+
async initialize(_params) {
|
|
1264
|
+
return {
|
|
1265
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
1266
|
+
agentCapabilities: {
|
|
1267
|
+
loadSession: true,
|
|
1268
|
+
promptCapabilities: {
|
|
1269
|
+
image: true,
|
|
1270
|
+
audio: false,
|
|
1271
|
+
embeddedContext: true
|
|
1272
|
+
},
|
|
1273
|
+
mcpCapabilities: {
|
|
1274
|
+
http: false,
|
|
1275
|
+
sse: false
|
|
1276
|
+
},
|
|
1277
|
+
sessionCapabilities: { list: {} }
|
|
1278
|
+
},
|
|
1279
|
+
agentInfo: ACP_AGENT_INFO,
|
|
1280
|
+
authMethods: []
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
async newSession(params) {
|
|
1284
|
+
this.assertSupportedSessionSetup(params.mcpServers);
|
|
1285
|
+
this.enforceSessionCreateRateLimit("newSession");
|
|
1286
|
+
const sessionId = randomUUID();
|
|
1287
|
+
const meta = parseSessionMeta(params._meta);
|
|
1288
|
+
const sessionKey = await this.resolveSessionKeyFromMeta({
|
|
1289
|
+
meta,
|
|
1290
|
+
fallbackKey: `acp:${sessionId}`
|
|
1291
|
+
});
|
|
1292
|
+
const session = this.sessionStore.createSession({
|
|
1293
|
+
sessionId,
|
|
1294
|
+
sessionKey,
|
|
1295
|
+
cwd: params.cwd
|
|
1296
|
+
});
|
|
1297
|
+
this.log(`newSession: ${session.sessionId} -> ${session.sessionKey}`);
|
|
1298
|
+
const sessionSnapshot = await this.getSessionSnapshot(session.sessionKey);
|
|
1299
|
+
await this.sendSessionSnapshotUpdate(session.sessionId, sessionSnapshot, { includeControls: false });
|
|
1300
|
+
await this.sendAvailableCommands(session.sessionId);
|
|
1301
|
+
const { configOptions, modes } = sessionSnapshot;
|
|
1302
|
+
return {
|
|
1303
|
+
sessionId: session.sessionId,
|
|
1304
|
+
configOptions,
|
|
1305
|
+
modes
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
async loadSession(params) {
|
|
1309
|
+
this.assertSupportedSessionSetup(params.mcpServers);
|
|
1310
|
+
if (!this.sessionStore.hasSession(params.sessionId)) this.enforceSessionCreateRateLimit("loadSession");
|
|
1311
|
+
const meta = parseSessionMeta(params._meta);
|
|
1312
|
+
const sessionKey = await this.resolveSessionKeyFromMeta({
|
|
1313
|
+
meta,
|
|
1314
|
+
fallbackKey: params.sessionId
|
|
1315
|
+
});
|
|
1316
|
+
const session = this.sessionStore.createSession({
|
|
1317
|
+
sessionId: params.sessionId,
|
|
1318
|
+
sessionKey,
|
|
1319
|
+
cwd: params.cwd
|
|
1320
|
+
});
|
|
1321
|
+
this.log(`loadSession: ${session.sessionId} -> ${session.sessionKey}`);
|
|
1322
|
+
const [sessionSnapshot, transcript] = await Promise.all([this.getSessionSnapshot(session.sessionKey), this.getSessionTranscript(session.sessionKey).catch((err) => {
|
|
1323
|
+
this.log(`session transcript fallback for ${session.sessionKey}: ${String(err)}`);
|
|
1324
|
+
return [];
|
|
1325
|
+
})]);
|
|
1326
|
+
await this.replaySessionTranscript(session.sessionId, transcript);
|
|
1327
|
+
await this.sendSessionSnapshotUpdate(session.sessionId, sessionSnapshot, { includeControls: false });
|
|
1328
|
+
await this.sendAvailableCommands(session.sessionId);
|
|
1329
|
+
const { configOptions, modes } = sessionSnapshot;
|
|
1330
|
+
return {
|
|
1331
|
+
configOptions,
|
|
1332
|
+
modes
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
async unstable_listSessions(params) {
|
|
1336
|
+
const limit = readNumber(params._meta, ["limit"]) ?? 100;
|
|
1337
|
+
const result = await this.gateway.request("sessions.list", { limit });
|
|
1338
|
+
const cwd = params.cwd ?? process.cwd();
|
|
1339
|
+
return {
|
|
1340
|
+
sessions: result.sessions.map((session) => ({
|
|
1341
|
+
sessionId: session.key,
|
|
1342
|
+
cwd,
|
|
1343
|
+
title: session.displayName ?? session.label ?? session.key,
|
|
1344
|
+
updatedAt: session.updatedAt ? new Date(session.updatedAt).toISOString() : void 0,
|
|
1345
|
+
_meta: {
|
|
1346
|
+
sessionKey: session.key,
|
|
1347
|
+
kind: session.kind,
|
|
1348
|
+
channel: session.channel
|
|
1349
|
+
}
|
|
1350
|
+
})),
|
|
1351
|
+
nextCursor: null
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1354
|
+
async authenticate(_params) {
|
|
1355
|
+
return {};
|
|
1356
|
+
}
|
|
1357
|
+
async setSessionMode(params) {
|
|
1358
|
+
const session = this.sessionStore.getSession(params.sessionId);
|
|
1359
|
+
if (!session) throw new Error(`Session ${params.sessionId} not found`);
|
|
1360
|
+
if (!params.modeId) return {};
|
|
1361
|
+
try {
|
|
1362
|
+
await this.gateway.request("sessions.patch", {
|
|
1363
|
+
key: session.sessionKey,
|
|
1364
|
+
thinkingLevel: params.modeId
|
|
1365
|
+
});
|
|
1366
|
+
this.log(`setSessionMode: ${session.sessionId} -> ${params.modeId}`);
|
|
1367
|
+
const sessionSnapshot = await this.getSessionSnapshot(session.sessionKey, { thinkingLevel: params.modeId });
|
|
1368
|
+
await this.sendSessionSnapshotUpdate(session.sessionId, sessionSnapshot, { includeControls: true });
|
|
1369
|
+
} catch (err) {
|
|
1370
|
+
this.log(`setSessionMode error: ${String(err)}`);
|
|
1371
|
+
throw err instanceof Error ? err : new Error(String(err));
|
|
1372
|
+
}
|
|
1373
|
+
return {};
|
|
1374
|
+
}
|
|
1375
|
+
async setSessionConfigOption(params) {
|
|
1376
|
+
const session = this.sessionStore.getSession(params.sessionId);
|
|
1377
|
+
if (!session) throw new Error(`Session ${params.sessionId} not found`);
|
|
1378
|
+
const sessionPatch = this.resolveSessionConfigPatch(params.configId, params.value);
|
|
1379
|
+
try {
|
|
1380
|
+
await this.gateway.request("sessions.patch", {
|
|
1381
|
+
key: session.sessionKey,
|
|
1382
|
+
...sessionPatch.patch
|
|
1383
|
+
});
|
|
1384
|
+
this.log(`setSessionConfigOption: ${session.sessionId} -> ${params.configId}=${params.value}`);
|
|
1385
|
+
const sessionSnapshot = await this.getSessionSnapshot(session.sessionKey, sessionPatch.overrides);
|
|
1386
|
+
await this.sendSessionSnapshotUpdate(session.sessionId, sessionSnapshot, { includeControls: true });
|
|
1387
|
+
return { configOptions: sessionSnapshot.configOptions };
|
|
1388
|
+
} catch (err) {
|
|
1389
|
+
this.log(`setSessionConfigOption error: ${String(err)}`);
|
|
1390
|
+
throw err instanceof Error ? err : new Error(String(err));
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
async prompt(params) {
|
|
1394
|
+
const session = this.sessionStore.getSession(params.sessionId);
|
|
1395
|
+
if (!session) throw new Error(`Session ${params.sessionId} not found`);
|
|
1396
|
+
if (session.abortController) this.sessionStore.cancelActiveRun(params.sessionId);
|
|
1397
|
+
const meta = parseSessionMeta(params._meta);
|
|
1398
|
+
const userText = extractTextFromPrompt(params.prompt, MAX_PROMPT_BYTES);
|
|
1399
|
+
const attachments = extractAttachmentsFromPrompt(params.prompt);
|
|
1400
|
+
const prefixCwd = meta.prefixCwd ?? this.opts.prefixCwd ?? true;
|
|
1401
|
+
const displayCwd = shortenHomePath(session.cwd);
|
|
1402
|
+
const message = prefixCwd ? `[Working directory: ${displayCwd}]\n\n${userText}` : userText;
|
|
1403
|
+
const provenanceMode = this.opts.provenanceMode ?? "off";
|
|
1404
|
+
const systemInputProvenance = provenanceMode === "off" ? void 0 : buildSystemInputProvenance(params.sessionId);
|
|
1405
|
+
const systemProvenanceReceipt = provenanceMode === "meta+receipt" ? buildSystemProvenanceReceipt({
|
|
1406
|
+
cwd: session.cwd,
|
|
1407
|
+
sessionId: params.sessionId,
|
|
1408
|
+
sessionKey: session.sessionKey
|
|
1409
|
+
}) : void 0;
|
|
1410
|
+
if (Buffer.byteLength(message, "utf-8") > MAX_PROMPT_BYTES) throw new Error(`Prompt exceeds maximum allowed size of ${MAX_PROMPT_BYTES} bytes`);
|
|
1411
|
+
const abortController = new AbortController();
|
|
1412
|
+
const runId = randomUUID();
|
|
1413
|
+
this.sessionStore.setActiveRun(params.sessionId, runId, abortController);
|
|
1414
|
+
return new Promise((resolve, reject) => {
|
|
1415
|
+
this.pendingPrompts.set(params.sessionId, {
|
|
1416
|
+
sessionId: params.sessionId,
|
|
1417
|
+
sessionKey: session.sessionKey,
|
|
1418
|
+
idempotencyKey: runId,
|
|
1419
|
+
resolve,
|
|
1420
|
+
reject
|
|
1421
|
+
});
|
|
1422
|
+
this.gateway.request("chat.send", {
|
|
1423
|
+
sessionKey: session.sessionKey,
|
|
1424
|
+
message,
|
|
1425
|
+
attachments: attachments.length > 0 ? attachments : void 0,
|
|
1426
|
+
idempotencyKey: runId,
|
|
1427
|
+
thinking: readString(params._meta, ["thinking", "thinkingLevel"]),
|
|
1428
|
+
deliver: readBool(params._meta, ["deliver"]),
|
|
1429
|
+
timeoutMs: readNumber(params._meta, ["timeoutMs"]),
|
|
1430
|
+
systemInputProvenance,
|
|
1431
|
+
systemProvenanceReceipt
|
|
1432
|
+
}, { expectFinal: true }).catch((err) => {
|
|
1433
|
+
this.pendingPrompts.delete(params.sessionId);
|
|
1434
|
+
this.sessionStore.clearActiveRun(params.sessionId);
|
|
1435
|
+
reject(err instanceof Error ? err : new Error(String(err)));
|
|
1436
|
+
});
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
async cancel(params) {
|
|
1440
|
+
const session = this.sessionStore.getSession(params.sessionId);
|
|
1441
|
+
if (!session) return;
|
|
1442
|
+
const activeRunId = session.activeRunId;
|
|
1443
|
+
this.sessionStore.cancelActiveRun(params.sessionId);
|
|
1444
|
+
const pending = this.pendingPrompts.get(params.sessionId);
|
|
1445
|
+
const scopedRunId = activeRunId ?? pending?.idempotencyKey;
|
|
1446
|
+
if (!scopedRunId) return;
|
|
1447
|
+
try {
|
|
1448
|
+
await this.gateway.request("chat.abort", {
|
|
1449
|
+
sessionKey: session.sessionKey,
|
|
1450
|
+
runId: scopedRunId
|
|
1451
|
+
});
|
|
1452
|
+
} catch (err) {
|
|
1453
|
+
this.log(`cancel error: ${String(err)}`);
|
|
1454
|
+
}
|
|
1455
|
+
if (pending) {
|
|
1456
|
+
this.pendingPrompts.delete(params.sessionId);
|
|
1457
|
+
pending.resolve({ stopReason: "cancelled" });
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
async resolveSessionKeyFromMeta(params) {
|
|
1461
|
+
const sessionKey = await resolveSessionKey({
|
|
1462
|
+
meta: params.meta,
|
|
1463
|
+
fallbackKey: params.fallbackKey,
|
|
1464
|
+
gateway: this.gateway,
|
|
1465
|
+
opts: this.opts
|
|
1466
|
+
});
|
|
1467
|
+
await resetSessionIfNeeded({
|
|
1468
|
+
meta: params.meta,
|
|
1469
|
+
sessionKey,
|
|
1470
|
+
gateway: this.gateway,
|
|
1471
|
+
opts: this.opts
|
|
1472
|
+
});
|
|
1473
|
+
return sessionKey;
|
|
1474
|
+
}
|
|
1475
|
+
async handleAgentEvent(evt) {
|
|
1476
|
+
const payload = evt.payload;
|
|
1477
|
+
if (!payload) return;
|
|
1478
|
+
const stream = payload.stream;
|
|
1479
|
+
const runId = payload.runId;
|
|
1480
|
+
const data = payload.data;
|
|
1481
|
+
const sessionKey = payload.sessionKey;
|
|
1482
|
+
if (!stream || !data || !sessionKey) return;
|
|
1483
|
+
if (stream !== "tool") return;
|
|
1484
|
+
const phase = data.phase;
|
|
1485
|
+
const name = data.name;
|
|
1486
|
+
const toolCallId = data.toolCallId;
|
|
1487
|
+
if (!toolCallId) return;
|
|
1488
|
+
const pending = this.findPendingBySessionKey(sessionKey, runId);
|
|
1489
|
+
if (!pending) return;
|
|
1490
|
+
if (phase === "start") {
|
|
1491
|
+
if (!pending.toolCalls) pending.toolCalls = /* @__PURE__ */ new Map();
|
|
1492
|
+
if (pending.toolCalls.has(toolCallId)) return;
|
|
1493
|
+
const args = data.args;
|
|
1494
|
+
const title = formatToolTitle(name, args);
|
|
1495
|
+
const kind = inferToolKind(name);
|
|
1496
|
+
const locations = extractToolCallLocations(args);
|
|
1497
|
+
pending.toolCalls.set(toolCallId, {
|
|
1498
|
+
title,
|
|
1499
|
+
kind,
|
|
1500
|
+
rawInput: args,
|
|
1501
|
+
locations
|
|
1502
|
+
});
|
|
1503
|
+
await this.connection.sessionUpdate({
|
|
1504
|
+
sessionId: pending.sessionId,
|
|
1505
|
+
update: {
|
|
1506
|
+
sessionUpdate: "tool_call",
|
|
1507
|
+
toolCallId,
|
|
1508
|
+
title,
|
|
1509
|
+
status: "in_progress",
|
|
1510
|
+
rawInput: args,
|
|
1511
|
+
kind,
|
|
1512
|
+
locations
|
|
1513
|
+
}
|
|
1514
|
+
});
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
if (phase === "update") {
|
|
1518
|
+
const toolState = pending.toolCalls?.get(toolCallId);
|
|
1519
|
+
const partialResult = data.partialResult;
|
|
1520
|
+
await this.connection.sessionUpdate({
|
|
1521
|
+
sessionId: pending.sessionId,
|
|
1522
|
+
update: {
|
|
1523
|
+
sessionUpdate: "tool_call_update",
|
|
1524
|
+
toolCallId,
|
|
1525
|
+
status: "in_progress",
|
|
1526
|
+
rawOutput: partialResult,
|
|
1527
|
+
content: extractToolCallContent(partialResult),
|
|
1528
|
+
locations: extractToolCallLocations(toolState?.locations, partialResult)
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
if (phase === "result") {
|
|
1534
|
+
const isError = Boolean(data.isError);
|
|
1535
|
+
const toolState = pending.toolCalls?.get(toolCallId);
|
|
1536
|
+
pending.toolCalls?.delete(toolCallId);
|
|
1537
|
+
await this.connection.sessionUpdate({
|
|
1538
|
+
sessionId: pending.sessionId,
|
|
1539
|
+
update: {
|
|
1540
|
+
sessionUpdate: "tool_call_update",
|
|
1541
|
+
toolCallId,
|
|
1542
|
+
status: isError ? "failed" : "completed",
|
|
1543
|
+
rawOutput: data.result,
|
|
1544
|
+
content: extractToolCallContent(data.result),
|
|
1545
|
+
locations: extractToolCallLocations(toolState?.locations, data.result)
|
|
1546
|
+
}
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
async handleChatEvent(evt) {
|
|
1551
|
+
const payload = evt.payload;
|
|
1552
|
+
if (!payload) return;
|
|
1553
|
+
const sessionKey = payload.sessionKey;
|
|
1554
|
+
const state = payload.state;
|
|
1555
|
+
const runId = payload.runId;
|
|
1556
|
+
const messageData = payload.message;
|
|
1557
|
+
if (!sessionKey || !state) return;
|
|
1558
|
+
const pending = this.findPendingBySessionKey(sessionKey, runId);
|
|
1559
|
+
if (!pending) return;
|
|
1560
|
+
if (messageData && (state === "delta" || state === "final")) {
|
|
1561
|
+
await this.handleDeltaEvent(pending.sessionId, messageData);
|
|
1562
|
+
if (state === "delta") return;
|
|
1563
|
+
}
|
|
1564
|
+
if (state === "final") {
|
|
1565
|
+
const stopReason = payload.stopReason === "max_tokens" ? "max_tokens" : "end_turn";
|
|
1566
|
+
await this.finishPrompt(pending.sessionId, pending, stopReason);
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
if (state === "aborted") {
|
|
1570
|
+
await this.finishPrompt(pending.sessionId, pending, "cancelled");
|
|
1571
|
+
return;
|
|
1572
|
+
}
|
|
1573
|
+
if (state === "error") this.finishPrompt(pending.sessionId, pending, "end_turn");
|
|
1574
|
+
}
|
|
1575
|
+
async handleDeltaEvent(sessionId, messageData) {
|
|
1576
|
+
const fullText = messageData.content?.find((c) => c.type === "text")?.text ?? "";
|
|
1577
|
+
const pending = this.pendingPrompts.get(sessionId);
|
|
1578
|
+
if (!pending) return;
|
|
1579
|
+
const sentSoFar = pending.sentTextLength ?? 0;
|
|
1580
|
+
if (fullText.length <= sentSoFar) return;
|
|
1581
|
+
const newText = fullText.slice(sentSoFar);
|
|
1582
|
+
pending.sentTextLength = fullText.length;
|
|
1583
|
+
pending.sentText = fullText;
|
|
1584
|
+
await this.connection.sessionUpdate({
|
|
1585
|
+
sessionId,
|
|
1586
|
+
update: {
|
|
1587
|
+
sessionUpdate: "agent_message_chunk",
|
|
1588
|
+
content: {
|
|
1589
|
+
type: "text",
|
|
1590
|
+
text: newText
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
async finishPrompt(sessionId, pending, stopReason) {
|
|
1596
|
+
this.pendingPrompts.delete(sessionId);
|
|
1597
|
+
this.sessionStore.clearActiveRun(sessionId);
|
|
1598
|
+
const sessionSnapshot = await this.getSessionSnapshot(pending.sessionKey);
|
|
1599
|
+
try {
|
|
1600
|
+
await this.sendSessionSnapshotUpdate(sessionId, sessionSnapshot, { includeControls: false });
|
|
1601
|
+
} catch (err) {
|
|
1602
|
+
this.log(`session snapshot update failed for ${sessionId}: ${String(err)}`);
|
|
1603
|
+
}
|
|
1604
|
+
pending.resolve({ stopReason });
|
|
1605
|
+
}
|
|
1606
|
+
findPendingBySessionKey(sessionKey, runId) {
|
|
1607
|
+
for (const pending of this.pendingPrompts.values()) {
|
|
1608
|
+
if (pending.sessionKey !== sessionKey) continue;
|
|
1609
|
+
if (runId && pending.idempotencyKey !== runId) continue;
|
|
1610
|
+
return pending;
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
async sendAvailableCommands(sessionId) {
|
|
1614
|
+
await this.connection.sessionUpdate({
|
|
1615
|
+
sessionId,
|
|
1616
|
+
update: {
|
|
1617
|
+
sessionUpdate: "available_commands_update",
|
|
1618
|
+
availableCommands: getAvailableCommands()
|
|
1619
|
+
}
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
async getSessionSnapshot(sessionKey, overrides) {
|
|
1623
|
+
try {
|
|
1624
|
+
const row = await this.getGatewaySessionRow(sessionKey);
|
|
1625
|
+
return {
|
|
1626
|
+
...buildSessionPresentation({
|
|
1627
|
+
row,
|
|
1628
|
+
overrides
|
|
1629
|
+
}),
|
|
1630
|
+
metadata: buildSessionMetadata({
|
|
1631
|
+
row,
|
|
1632
|
+
sessionKey
|
|
1633
|
+
}),
|
|
1634
|
+
usage: buildSessionUsageSnapshot(row)
|
|
1635
|
+
};
|
|
1636
|
+
} catch (err) {
|
|
1637
|
+
this.log(`session presentation fallback for ${sessionKey}: ${String(err)}`);
|
|
1638
|
+
return {
|
|
1639
|
+
...buildSessionPresentation({ overrides }),
|
|
1640
|
+
metadata: buildSessionMetadata({ sessionKey })
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
async getGatewaySessionRow(sessionKey) {
|
|
1645
|
+
const session = (await this.gateway.request("sessions.list", {
|
|
1646
|
+
limit: 200,
|
|
1647
|
+
search: sessionKey,
|
|
1648
|
+
includeDerivedTitles: true
|
|
1649
|
+
})).sessions.find((entry) => entry.key === sessionKey);
|
|
1650
|
+
if (!session) return;
|
|
1651
|
+
return {
|
|
1652
|
+
displayName: session.displayName,
|
|
1653
|
+
label: session.label,
|
|
1654
|
+
derivedTitle: session.derivedTitle,
|
|
1655
|
+
updatedAt: session.updatedAt,
|
|
1656
|
+
thinkingLevel: session.thinkingLevel,
|
|
1657
|
+
modelProvider: session.modelProvider,
|
|
1658
|
+
model: session.model,
|
|
1659
|
+
fastMode: session.fastMode,
|
|
1660
|
+
verboseLevel: session.verboseLevel,
|
|
1661
|
+
reasoningLevel: session.reasoningLevel,
|
|
1662
|
+
responseUsage: session.responseUsage,
|
|
1663
|
+
elevatedLevel: session.elevatedLevel,
|
|
1664
|
+
totalTokens: session.totalTokens,
|
|
1665
|
+
totalTokensFresh: session.totalTokensFresh,
|
|
1666
|
+
contextTokens: session.contextTokens
|
|
1667
|
+
};
|
|
1668
|
+
}
|
|
1669
|
+
resolveSessionConfigPatch(configId, value) {
|
|
1670
|
+
if (typeof value !== "string") throw new Error(`ACP bridge does not support non-string session config option values for "${configId}".`);
|
|
1671
|
+
switch (configId) {
|
|
1672
|
+
case ACP_THOUGHT_LEVEL_CONFIG_ID: return {
|
|
1673
|
+
patch: { thinkingLevel: value },
|
|
1674
|
+
overrides: { thinkingLevel: value }
|
|
1675
|
+
};
|
|
1676
|
+
case ACP_FAST_MODE_CONFIG_ID: return {
|
|
1677
|
+
patch: { fastMode: value === "on" },
|
|
1678
|
+
overrides: { fastMode: value === "on" }
|
|
1679
|
+
};
|
|
1680
|
+
case ACP_VERBOSE_LEVEL_CONFIG_ID: return {
|
|
1681
|
+
patch: { verboseLevel: value },
|
|
1682
|
+
overrides: { verboseLevel: value }
|
|
1683
|
+
};
|
|
1684
|
+
case ACP_REASONING_LEVEL_CONFIG_ID: return {
|
|
1685
|
+
patch: { reasoningLevel: value },
|
|
1686
|
+
overrides: { reasoningLevel: value }
|
|
1687
|
+
};
|
|
1688
|
+
case ACP_RESPONSE_USAGE_CONFIG_ID: return {
|
|
1689
|
+
patch: { responseUsage: value },
|
|
1690
|
+
overrides: { responseUsage: value }
|
|
1691
|
+
};
|
|
1692
|
+
case ACP_ELEVATED_LEVEL_CONFIG_ID: return {
|
|
1693
|
+
patch: { elevatedLevel: value },
|
|
1694
|
+
overrides: { elevatedLevel: value }
|
|
1695
|
+
};
|
|
1696
|
+
default: throw new Error(`ACP bridge mode does not support session config option "${configId}".`);
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
async getSessionTranscript(sessionKey) {
|
|
1700
|
+
const result = await this.gateway.request("sessions.get", {
|
|
1701
|
+
key: sessionKey,
|
|
1702
|
+
limit: ACP_LOAD_SESSION_REPLAY_LIMIT
|
|
1703
|
+
});
|
|
1704
|
+
if (!Array.isArray(result.messages)) return [];
|
|
1705
|
+
return result.messages;
|
|
1706
|
+
}
|
|
1707
|
+
async replaySessionTranscript(sessionId, transcript) {
|
|
1708
|
+
for (const message of transcript) {
|
|
1709
|
+
const role = typeof message.role === "string" ? message.role : "";
|
|
1710
|
+
if (role !== "user" && role !== "assistant") continue;
|
|
1711
|
+
const text = extractReplayText(message.content);
|
|
1712
|
+
if (!text) continue;
|
|
1713
|
+
await this.connection.sessionUpdate({
|
|
1714
|
+
sessionId,
|
|
1715
|
+
update: {
|
|
1716
|
+
sessionUpdate: role === "user" ? "user_message_chunk" : "agent_message_chunk",
|
|
1717
|
+
content: {
|
|
1718
|
+
type: "text",
|
|
1719
|
+
text
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
async sendSessionSnapshotUpdate(sessionId, sessionSnapshot, options) {
|
|
1726
|
+
if (options.includeControls) {
|
|
1727
|
+
await this.connection.sessionUpdate({
|
|
1728
|
+
sessionId,
|
|
1729
|
+
update: {
|
|
1730
|
+
sessionUpdate: "current_mode_update",
|
|
1731
|
+
currentModeId: sessionSnapshot.modes.currentModeId
|
|
1732
|
+
}
|
|
1733
|
+
});
|
|
1734
|
+
await this.connection.sessionUpdate({
|
|
1735
|
+
sessionId,
|
|
1736
|
+
update: {
|
|
1737
|
+
sessionUpdate: "config_option_update",
|
|
1738
|
+
configOptions: sessionSnapshot.configOptions
|
|
1739
|
+
}
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
if (sessionSnapshot.metadata) await this.connection.sessionUpdate({
|
|
1743
|
+
sessionId,
|
|
1744
|
+
update: {
|
|
1745
|
+
sessionUpdate: "session_info_update",
|
|
1746
|
+
...sessionSnapshot.metadata
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
if (sessionSnapshot.usage) await this.connection.sessionUpdate({
|
|
1750
|
+
sessionId,
|
|
1751
|
+
update: {
|
|
1752
|
+
sessionUpdate: "usage_update",
|
|
1753
|
+
used: sessionSnapshot.usage.used,
|
|
1754
|
+
size: sessionSnapshot.usage.size,
|
|
1755
|
+
_meta: {
|
|
1756
|
+
source: "gateway-session-store",
|
|
1757
|
+
approximate: true
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
assertSupportedSessionSetup(mcpServers) {
|
|
1763
|
+
if (mcpServers.length === 0) return;
|
|
1764
|
+
throw new Error("ACP bridge mode does not support per-session MCP servers. Configure MCP on the OpenClaw gateway or agent instead.");
|
|
1765
|
+
}
|
|
1766
|
+
enforceSessionCreateRateLimit(method) {
|
|
1767
|
+
const budget = this.sessionCreateRateLimiter.consume();
|
|
1768
|
+
if (budget.allowed) return;
|
|
1769
|
+
throw new Error(`ACP session creation rate limit exceeded for ${method}; retry after ${Math.ceil(budget.retryAfterMs / 1e3)}s.`);
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
//#endregion
|
|
1773
|
+
//#region src/acp/server.ts
|
|
1774
|
+
async function serveAcpGateway(opts = {}) {
|
|
1775
|
+
const cfg = loadConfig();
|
|
1776
|
+
const connection = buildGatewayConnectionDetails({
|
|
1777
|
+
config: cfg,
|
|
1778
|
+
url: opts.gatewayUrl
|
|
1779
|
+
});
|
|
1780
|
+
const gatewayUrlOverrideSource = connection.urlSource === "cli --url" ? "cli" : connection.urlSource === "env OPENCLAW_GATEWAY_URL" ? "env" : void 0;
|
|
1781
|
+
const creds = await resolveGatewayConnectionAuth({
|
|
1782
|
+
config: cfg,
|
|
1783
|
+
explicitAuth: {
|
|
1784
|
+
token: opts.gatewayToken,
|
|
1785
|
+
password: opts.gatewayPassword
|
|
1786
|
+
},
|
|
1787
|
+
env: process.env,
|
|
1788
|
+
urlOverride: gatewayUrlOverrideSource ? connection.url : void 0,
|
|
1789
|
+
urlOverrideSource: gatewayUrlOverrideSource
|
|
1790
|
+
});
|
|
1791
|
+
let agent = null;
|
|
1792
|
+
let onClosed;
|
|
1793
|
+
const closed = new Promise((resolve) => {
|
|
1794
|
+
onClosed = resolve;
|
|
1795
|
+
});
|
|
1796
|
+
let stopped = false;
|
|
1797
|
+
let onGatewayReadyResolve;
|
|
1798
|
+
let onGatewayReadyReject;
|
|
1799
|
+
let gatewayReadySettled = false;
|
|
1800
|
+
const gatewayReady = new Promise((resolve, reject) => {
|
|
1801
|
+
onGatewayReadyResolve = resolve;
|
|
1802
|
+
onGatewayReadyReject = reject;
|
|
1803
|
+
});
|
|
1804
|
+
const resolveGatewayReady = () => {
|
|
1805
|
+
if (gatewayReadySettled) return;
|
|
1806
|
+
gatewayReadySettled = true;
|
|
1807
|
+
onGatewayReadyResolve();
|
|
1808
|
+
};
|
|
1809
|
+
const rejectGatewayReady = (err) => {
|
|
1810
|
+
if (gatewayReadySettled) return;
|
|
1811
|
+
gatewayReadySettled = true;
|
|
1812
|
+
onGatewayReadyReject(err instanceof Error ? err : new Error(String(err)));
|
|
1813
|
+
};
|
|
1814
|
+
const gateway = new GatewayClient({
|
|
1815
|
+
url: connection.url,
|
|
1816
|
+
token: creds.token,
|
|
1817
|
+
password: creds.password,
|
|
1818
|
+
clientName: GATEWAY_CLIENT_NAMES.CLI,
|
|
1819
|
+
clientDisplayName: "ACP",
|
|
1820
|
+
clientVersion: "acp",
|
|
1821
|
+
mode: GATEWAY_CLIENT_MODES.CLI,
|
|
1822
|
+
onEvent: (evt) => {
|
|
1823
|
+
agent?.handleGatewayEvent(evt);
|
|
1824
|
+
},
|
|
1825
|
+
onHelloOk: () => {
|
|
1826
|
+
resolveGatewayReady();
|
|
1827
|
+
agent?.handleGatewayReconnect();
|
|
1828
|
+
},
|
|
1829
|
+
onConnectError: (err) => {
|
|
1830
|
+
rejectGatewayReady(err);
|
|
1831
|
+
},
|
|
1832
|
+
onClose: (code, reason) => {
|
|
1833
|
+
if (!stopped) rejectGatewayReady(/* @__PURE__ */ new Error(`gateway closed before ready (${code}): ${reason}`));
|
|
1834
|
+
agent?.handleGatewayDisconnect(`${code}: ${reason}`);
|
|
1835
|
+
if (stopped) onClosed();
|
|
1836
|
+
}
|
|
1837
|
+
});
|
|
1838
|
+
const shutdown = () => {
|
|
1839
|
+
if (stopped) return;
|
|
1840
|
+
stopped = true;
|
|
1841
|
+
resolveGatewayReady();
|
|
1842
|
+
gateway.stop();
|
|
1843
|
+
onClosed();
|
|
1844
|
+
};
|
|
1845
|
+
process.once("SIGINT", shutdown);
|
|
1846
|
+
process.once("SIGTERM", shutdown);
|
|
1847
|
+
gateway.start();
|
|
1848
|
+
await gatewayReady.catch((err) => {
|
|
1849
|
+
shutdown();
|
|
1850
|
+
throw err;
|
|
1851
|
+
});
|
|
1852
|
+
if (stopped) return closed;
|
|
1853
|
+
new AgentSideConnection((conn) => {
|
|
1854
|
+
agent = new AcpGatewayAgent(conn, gateway, opts);
|
|
1855
|
+
agent.start();
|
|
1856
|
+
return agent;
|
|
1857
|
+
}, ndJsonStream(Writable.toWeb(process.stdout), Readable.toWeb(process.stdin)));
|
|
1858
|
+
return closed;
|
|
1859
|
+
}
|
|
1860
|
+
function parseArgs(args) {
|
|
1861
|
+
const opts = {};
|
|
1862
|
+
let tokenFile;
|
|
1863
|
+
let passwordFile;
|
|
1864
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
1865
|
+
const arg = args[i];
|
|
1866
|
+
if (arg === "--url" || arg === "--gateway-url") {
|
|
1867
|
+
opts.gatewayUrl = args[i + 1];
|
|
1868
|
+
i += 1;
|
|
1869
|
+
continue;
|
|
1870
|
+
}
|
|
1871
|
+
if (arg === "--token" || arg === "--gateway-token") {
|
|
1872
|
+
opts.gatewayToken = args[i + 1];
|
|
1873
|
+
i += 1;
|
|
1874
|
+
continue;
|
|
1875
|
+
}
|
|
1876
|
+
if (arg === "--token-file" || arg === "--gateway-token-file") {
|
|
1877
|
+
tokenFile = args[i + 1];
|
|
1878
|
+
i += 1;
|
|
1879
|
+
continue;
|
|
1880
|
+
}
|
|
1881
|
+
if (arg === "--password" || arg === "--gateway-password") {
|
|
1882
|
+
opts.gatewayPassword = args[i + 1];
|
|
1883
|
+
i += 1;
|
|
1884
|
+
continue;
|
|
1885
|
+
}
|
|
1886
|
+
if (arg === "--password-file" || arg === "--gateway-password-file") {
|
|
1887
|
+
passwordFile = args[i + 1];
|
|
1888
|
+
i += 1;
|
|
1889
|
+
continue;
|
|
1890
|
+
}
|
|
1891
|
+
if (arg === "--session") {
|
|
1892
|
+
opts.defaultSessionKey = args[i + 1];
|
|
1893
|
+
i += 1;
|
|
1894
|
+
continue;
|
|
1895
|
+
}
|
|
1896
|
+
if (arg === "--session-label") {
|
|
1897
|
+
opts.defaultSessionLabel = args[i + 1];
|
|
1898
|
+
i += 1;
|
|
1899
|
+
continue;
|
|
1900
|
+
}
|
|
1901
|
+
if (arg === "--require-existing") {
|
|
1902
|
+
opts.requireExistingSession = true;
|
|
1903
|
+
continue;
|
|
1904
|
+
}
|
|
1905
|
+
if (arg === "--reset-session") {
|
|
1906
|
+
opts.resetSession = true;
|
|
1907
|
+
continue;
|
|
1908
|
+
}
|
|
1909
|
+
if (arg === "--no-prefix-cwd") {
|
|
1910
|
+
opts.prefixCwd = false;
|
|
1911
|
+
continue;
|
|
1912
|
+
}
|
|
1913
|
+
if (arg === "--provenance") {
|
|
1914
|
+
const provenanceMode = normalizeAcpProvenanceMode(args[i + 1]);
|
|
1915
|
+
if (!provenanceMode) throw new Error("Invalid --provenance value. Use off, meta, or meta+receipt.");
|
|
1916
|
+
opts.provenanceMode = provenanceMode;
|
|
1917
|
+
i += 1;
|
|
1918
|
+
continue;
|
|
1919
|
+
}
|
|
1920
|
+
if (arg === "--verbose" || arg === "-v") {
|
|
1921
|
+
opts.verbose = true;
|
|
1922
|
+
continue;
|
|
1923
|
+
}
|
|
1924
|
+
if (arg === "--help" || arg === "-h") {
|
|
1925
|
+
printHelp();
|
|
1926
|
+
process.exit(0);
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
if (opts.gatewayToken?.trim() && tokenFile?.trim()) throw new Error("Use either --token or --token-file.");
|
|
1930
|
+
if (opts.gatewayPassword?.trim() && passwordFile?.trim()) throw new Error("Use either --password or --password-file.");
|
|
1931
|
+
if (tokenFile?.trim()) opts.gatewayToken = readSecretFromFile(tokenFile, "Gateway token");
|
|
1932
|
+
if (passwordFile?.trim()) opts.gatewayPassword = readSecretFromFile(passwordFile, "Gateway password");
|
|
1933
|
+
return opts;
|
|
1934
|
+
}
|
|
1935
|
+
function printHelp() {
|
|
1936
|
+
console.log(`Usage: openclaw acp [options]
|
|
1937
|
+
|
|
1938
|
+
Gateway-backed ACP server for IDE integration.
|
|
1939
|
+
|
|
1940
|
+
Options:
|
|
1941
|
+
--url <url> Gateway WebSocket URL
|
|
1942
|
+
--token <token> Gateway auth token
|
|
1943
|
+
--token-file <path> Read gateway auth token from file
|
|
1944
|
+
--password <password> Gateway auth password
|
|
1945
|
+
--password-file <path> Read gateway auth password from file
|
|
1946
|
+
--session <key> Default session key (e.g. "agent:main:main")
|
|
1947
|
+
--session-label <label> Default session label to resolve
|
|
1948
|
+
--require-existing Fail if the session key/label does not exist
|
|
1949
|
+
--reset-session Reset the session key before first use
|
|
1950
|
+
--no-prefix-cwd Do not prefix prompts with the working directory
|
|
1951
|
+
--provenance <mode> ACP provenance mode: off, meta, or meta+receipt
|
|
1952
|
+
--verbose, -v Verbose logging to stderr
|
|
1953
|
+
--help, -h Show this help message
|
|
1954
|
+
`);
|
|
1955
|
+
}
|
|
1956
|
+
if (isMainModule({ currentFile: fileURLToPath(import.meta.url) })) {
|
|
1957
|
+
const argv = process.argv.slice(2);
|
|
1958
|
+
if (argv.includes("--token") || argv.includes("--gateway-token")) console.error("Warning: --token can be exposed via process listings. Prefer --token-file or OPENCLAW_GATEWAY_TOKEN.");
|
|
1959
|
+
if (argv.includes("--password") || argv.includes("--gateway-password")) console.error("Warning: --password can be exposed via process listings. Prefer --password-file or OPENCLAW_GATEWAY_PASSWORD.");
|
|
1960
|
+
serveAcpGateway(parseArgs(argv)).catch((err) => {
|
|
1961
|
+
console.error(String(err));
|
|
1962
|
+
process.exit(1);
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
//#endregion
|
|
1966
|
+
//#region src/cli/acp-cli.ts
|
|
1967
|
+
function resolveSecretOption(params) {
|
|
1968
|
+
const direct = params.direct?.trim();
|
|
1969
|
+
const file = params.file?.trim();
|
|
1970
|
+
if (direct && file) throw new Error(`Use either ${params.directFlag} or ${params.fileFlag} for ${params.label}.`);
|
|
1971
|
+
if (file) return readSecretFromFile(file, params.label);
|
|
1972
|
+
return direct || void 0;
|
|
1973
|
+
}
|
|
1974
|
+
function warnSecretCliFlag(flag) {
|
|
1975
|
+
defaultRuntime.error(`Warning: ${flag} can be exposed via process listings. Prefer ${flag}-file or environment variables.`);
|
|
1976
|
+
}
|
|
1977
|
+
function registerAcpCli(program) {
|
|
1978
|
+
const acp = program.command("acp").description("Run an ACP bridge backed by the Gateway");
|
|
1979
|
+
acp.option("--url <url>", "Gateway WebSocket URL (defaults to gateway.remote.url when configured)").option("--token <token>", "Gateway token (if required)").option("--token-file <path>", "Read gateway token from file").option("--password <password>", "Gateway password (if required)").option("--password-file <path>", "Read gateway password from file").option("--session <key>", "Default session key (e.g. agent:main:main)").option("--session-label <label>", "Default session label to resolve").option("--require-existing", "Fail if the session key/label does not exist", false).option("--reset-session", "Reset the session key before first use", false).option("--no-prefix-cwd", "Do not prefix prompts with the working directory", false).option("--provenance <mode>", "ACP provenance mode: off, meta, or meta+receipt").option("-v, --verbose", "Verbose logging to stderr", false).addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/acp", "docs.openclaw.ai/cli/acp")}\n`).action(async (opts) => {
|
|
1980
|
+
try {
|
|
1981
|
+
const gatewayToken = resolveSecretOption({
|
|
1982
|
+
direct: opts.token,
|
|
1983
|
+
file: opts.tokenFile,
|
|
1984
|
+
directFlag: "--token",
|
|
1985
|
+
fileFlag: "--token-file",
|
|
1986
|
+
label: "Gateway token"
|
|
1987
|
+
});
|
|
1988
|
+
const gatewayPassword = resolveSecretOption({
|
|
1989
|
+
direct: opts.password,
|
|
1990
|
+
file: opts.passwordFile,
|
|
1991
|
+
directFlag: "--password",
|
|
1992
|
+
fileFlag: "--password-file",
|
|
1993
|
+
label: "Gateway password"
|
|
1994
|
+
});
|
|
1995
|
+
if (opts.token) warnSecretCliFlag("--token");
|
|
1996
|
+
if (opts.password) warnSecretCliFlag("--password");
|
|
1997
|
+
const provenanceMode = normalizeAcpProvenanceMode(opts.provenance);
|
|
1998
|
+
if (opts.provenance && !provenanceMode) throw new Error("Invalid --provenance value. Use off, meta, or meta+receipt.");
|
|
1999
|
+
await serveAcpGateway({
|
|
2000
|
+
gatewayUrl: opts.url,
|
|
2001
|
+
gatewayToken,
|
|
2002
|
+
gatewayPassword,
|
|
2003
|
+
defaultSessionKey: opts.session,
|
|
2004
|
+
defaultSessionLabel: opts.sessionLabel,
|
|
2005
|
+
requireExistingSession: Boolean(opts.requireExisting),
|
|
2006
|
+
resetSession: Boolean(opts.resetSession),
|
|
2007
|
+
prefixCwd: !opts.noPrefixCwd,
|
|
2008
|
+
provenanceMode,
|
|
2009
|
+
verbose: Boolean(opts.verbose)
|
|
2010
|
+
});
|
|
2011
|
+
} catch (err) {
|
|
2012
|
+
defaultRuntime.error(String(err));
|
|
2013
|
+
defaultRuntime.exit(1);
|
|
2014
|
+
}
|
|
2015
|
+
});
|
|
2016
|
+
acp.command("client").description("Run an interactive ACP client against the local ACP bridge").option("--cwd <dir>", "Working directory for the ACP session").option("--server <command>", "ACP server command (default: openclaw)").option("--server-args <args...>", "Extra arguments for the ACP server").option("--server-verbose", "Enable verbose logging on the ACP server", false).option("-v, --verbose", "Verbose client logging", false).action(async (opts, command) => {
|
|
2017
|
+
const inheritedVerbose = inheritOptionFromParent(command, "verbose");
|
|
2018
|
+
try {
|
|
2019
|
+
await runAcpClientInteractive({
|
|
2020
|
+
cwd: opts.cwd,
|
|
2021
|
+
serverCommand: opts.server,
|
|
2022
|
+
serverArgs: opts.serverArgs,
|
|
2023
|
+
serverVerbose: Boolean(opts.serverVerbose),
|
|
2024
|
+
verbose: Boolean(opts.verbose || inheritedVerbose)
|
|
2025
|
+
});
|
|
2026
|
+
} catch (err) {
|
|
2027
|
+
defaultRuntime.error(String(err));
|
|
2028
|
+
defaultRuntime.exit(1);
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
}
|
|
2032
|
+
//#endregion
|
|
2033
|
+
export { registerAcpCli };
|