@agent-our/openclaw 2026.2.6-3
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 +1596 -0
- package/LICENSE +21 -0
- package/README-header.png +0 -0
- package/README.md +545 -0
- package/assets/avatar-placeholder.svg +19 -0
- package/assets/chrome-extension/README.md +22 -0
- package/assets/chrome-extension/background.js +438 -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/chrome-extension/manifest.json +25 -0
- package/assets/chrome-extension/options.html +196 -0
- package/assets/chrome-extension/options.js +59 -0
- package/assets/dmg-background-small.png +0 -0
- package/assets/dmg-background.png +0 -0
- package/dist/accounts-B9umzy_R.js +250 -0
- package/dist/accounts-DkUtJa-O.js +251 -0
- package/dist/acp-cli-BBglTQii.js +923 -0
- package/dist/acp-cli-DrYibaVx.js +926 -0
- package/dist/agent-CbM7AbvV.js +704 -0
- package/dist/agent-DlzdY95q.js +704 -0
- package/dist/agent-scope-CB4YNu1h.js +613 -0
- package/dist/agent-scope-jAWKj2TP.js +371 -0
- package/dist/agent-scope-sKVRNONG.js +371 -0
- package/dist/archive-Dy3Ezb-5.js +85 -0
- package/dist/archive-ccN9aDgq.js +85 -0
- package/dist/audit-B2D3VRh8.js +1853 -0
- package/dist/audit-BdNhDEyo.js +1853 -0
- package/dist/auth-CMKwNo-f.js +192 -0
- package/dist/auth-DuZNzAAH.js +192 -0
- package/dist/auth-health-BNW1lZ8k.js +149 -0
- package/dist/auth-health-C3HJKHJi.js +149 -0
- package/dist/auth-profiles-DYdLc1cj.js +2981 -0
- package/dist/boolean-BgXe2hyu.js +30 -0
- package/dist/brew-CAcErcKz.js +46 -0
- package/dist/brew-CcZV0dSS.js +46 -0
- package/dist/build-info.json +5 -0
- package/dist/call-YdaudqMl.js +280 -0
- package/dist/call-wfwuMJe-.js +280 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -0
- package/dist/canvas-host/a2ui/a2ui.bundle.js +17765 -0
- package/dist/canvas-host/a2ui/index.html +307 -0
- package/dist/channel-options-B-G7tzkB.js +32 -0
- package/dist/channel-options-jfcr7ChQ.js +62 -0
- package/dist/channel-selection-C5KQyVUF.js +51 -0
- package/dist/channel-selection-DXVHNo3U.js +51 -0
- package/dist/channel-summary-CFZImIiG.js +1120 -0
- package/dist/channel-summary-CoLmo1EU.js +1120 -0
- package/dist/channels-cli-Cc3MY52X.js +1413 -0
- package/dist/channels-cli-D2lTE59V.js +1415 -0
- package/dist/channels-status-issues-Dln8njuR.js +18 -0
- package/dist/channels-status-issues-ptsVdM7G.js +18 -0
- package/dist/chrome-B3IuUad-.js +1953 -0
- package/dist/chrome-BNSd7Bie.js +1973 -0
- package/dist/clack-prompter-B9yLhyOm.js +92 -0
- package/dist/clack-prompter-CEKDd_Vg.js +92 -0
- package/dist/cli/daemon-cli.js +2 -0
- package/dist/cli-Fq054ApO.js +89 -0
- package/dist/cli-rd9P_S1u.js +86 -0
- package/dist/cli-utils-BkRQdAoC.js +43 -0
- package/dist/cli-utils-DzrdzskQ.js +43 -0
- package/dist/client-DvWPgCi6.js +1815 -0
- package/dist/command-format-CFzL448l.js +52 -0
- package/dist/command-format-ChfKqObn.js +52 -0
- package/dist/command-format-ayFsmwwz.js +38 -0
- package/dist/command-options-qBrt237S.js +33 -0
- package/dist/commands-CQNsJDTA.js +230 -0
- package/dist/completion-cli-C5BH1XDk.js +773 -0
- package/dist/completion-cli-CNKrO4o0.js +434 -0
- package/dist/config-BEUgkMYH.js +4922 -0
- package/dist/config-BM_g3TBU.js +4921 -0
- package/dist/config-Ct91v0JZ.js +5662 -0
- package/dist/config-guard-C-ACw81n.js +5774 -0
- package/dist/configure-CcXcdOUM.js +896 -0
- package/dist/configure-DWMokcXD.js +895 -0
- package/dist/constants-CNTiY-ZN.js +65 -0
- package/dist/constants-HPrOsATF.js +65 -0
- package/dist/control-service-B3g4oucx.js +61 -0
- package/dist/control-service-Dh4DKu3S.js +61 -0
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/index-Dm8pMa9P.js +11534 -0
- package/dist/control-ui/assets/index-Dm8pMa9P.js.map +1 -0
- package/dist/control-ui/assets/index-eofFRbdc.css +1 -0
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.ico +0 -0
- package/dist/control-ui/favicon.svg +22 -0
- package/dist/control-ui/index.html +17 -0
- package/dist/cron-cli-Bx6joqjI.js +454 -0
- package/dist/cron-cli-C5k_pz71.js +457 -0
- package/dist/daemon-cli-D-Gm28gZ.js +758 -0
- package/dist/daemon-cli-DQ5dlrIR.js +757 -0
- package/dist/daemon-runtime-C648Lhju.js +517 -0
- package/dist/daemon-runtime-Chcfufn1.js +517 -0
- package/dist/deliver-DBiz1Usy.js +2557 -0
- package/dist/deliver-DmpRwa2w.js +2587 -0
- package/dist/deliver-X5yjr56P.js +2587 -0
- package/dist/deps-DlFoECb7.js +27 -0
- package/dist/deps-UZ0CMWoo.js +27 -0
- package/dist/devices-cli-CpGSCere.js +207 -0
- package/dist/devices-cli-DIZJXWIY.js +204 -0
- package/dist/directory-cli-DhC1uA2S.js +247 -0
- package/dist/directory-cli-ZDXb1dmk.js +244 -0
- package/dist/dispatcher-DLhpc7HC.js +160 -0
- package/dist/dns-cli-B7Xi-izZ.js +198 -0
- package/dist/dns-cli-BsvKw0iq.js +201 -0
- package/dist/docs-cli-Bi5BtLfY.js +161 -0
- package/dist/docs-cli-CkczsV22.js +159 -0
- package/dist/doctor-CN9WxbwV.js +2586 -0
- package/dist/doctor-ClCw8y0M.js +2588 -0
- package/dist/entry.js +1330 -0
- package/dist/env-0_mKbEWW.js +32 -0
- package/dist/errors-CZ9opC6L.js +1952 -0
- package/dist/exec-B8JKbXKW.js +246 -0
- package/dist/exec-BMnoMcZW.js +1099 -0
- package/dist/exec-HEWTMJ7j.js +246 -0
- package/dist/exec-approvals-D4ny1TmX.js +1043 -0
- package/dist/exec-approvals-DmzWB9Zy.js +1043 -0
- package/dist/exec-approvals-cli-DPD2Z2Cg.js +385 -0
- package/dist/exec-approvals-cli-Dl4Y4IqE.js +388 -0
- package/dist/extensionAPI.js +68146 -0
- package/dist/format-8citvr_1.js +34 -0
- package/dist/format-tlvh4-cQ.js +34 -0
- package/dist/gateway-cli-B_lqsPIR.js +18017 -0
- package/dist/gateway-cli-D1Jvi6Ab.js +18016 -0
- package/dist/gateway-rpc-CYPgf43u.js +28 -0
- package/dist/gateway-rpc-CzWTXOHS.js +28 -0
- package/dist/github-copilot-auth-BcnJgC7r.js +1256 -0
- package/dist/github-copilot-auth-OEOMPahq.js +1256 -0
- package/dist/github-copilot-token-B3SA95yo.js +103 -0
- package/dist/github-copilot-token-SLWintYd.js +103 -0
- package/dist/github-copilot-token-pGSmVaW-.js +103 -0
- package/dist/gmail-setup-utils-CwS9GsIM.js +428 -0
- package/dist/gmail-setup-utils-D3Wa2Tx_.js +428 -0
- package/dist/health-format-CbDB25L0.js +1388 -0
- package/dist/health-format-DIJjpCDL.js +1389 -0
- package/dist/help-format-BlaVZH29.js +17 -0
- package/dist/help-format-DuMTLWZ-.js +17 -0
- package/dist/helpers-BiyEksaK.js +25 -0
- package/dist/helpers-CSZtxHTa.js +10 -0
- package/dist/helpers-CxHtCvId.js +10 -0
- package/dist/helpers-azbX_hrI.js +25 -0
- package/dist/hooks/bundled/boot-md/HOOK.md +19 -0
- package/dist/hooks/bundled/command-logger/HOOK.md +122 -0
- package/dist/hooks/bundled/session-memory/HOOK.md +109 -0
- package/dist/hooks/bundled/soul-evil/HOOK.md +71 -0
- package/dist/hooks-cli-BuNzxQ-L.js +1058 -0
- package/dist/hooks-cli-D-QCmmC9.js +1061 -0
- package/dist/hooks-status-BvbcN-ho.js +443 -0
- package/dist/hooks-status-CH1ZdZs5.js +443 -0
- package/dist/image-BP1mAJzN.js +1421 -0
- package/dist/image-DMNGdVWb.js +629 -0
- package/dist/image-E_i8K6Vq.js +629 -0
- package/dist/index.js +5957 -0
- package/dist/installs-BcBaI60O.js +425 -0
- package/dist/installs-BhEjOqPy.js +425 -0
- package/dist/is-main-B6kCyqsv.js +25 -0
- package/dist/is-main-PYGa3tDA.js +25 -0
- package/dist/links-B4nk2iDf.js +15 -0
- package/dist/links-B5pRdmo1.js +15 -0
- package/dist/loader-DqiCudFO.js +64754 -0
- package/dist/logging-6zx7VGt-.js +15 -0
- package/dist/logging-BWRYHvLp.js +1 -0
- package/dist/logging-TXWhN8jG.js +15 -0
- package/dist/logging-pqyrk15z.js +1 -0
- package/dist/login-qr-Bo7zzLWd.js +478 -0
- package/dist/login-qr-CFw3hF2h.js +478 -0
- package/dist/login-qr-UmMP2m6M.js +475 -0
- package/dist/logs-cli-BBPaaFhF.js +230 -0
- package/dist/logs-cli-DTo-7DxM.js +227 -0
- package/dist/manager-B365Xcjg.js +3218 -0
- package/dist/manager-BtFI9Zdc.js +3216 -0
- package/dist/manager-Bwpep10z.js +3216 -0
- package/dist/manifest-registry-C69Z-I4v.js +668 -0
- package/dist/manifest-registry-DHaa1SJb.js +668 -0
- package/dist/message-channel-Bpfe5l5f.js +110 -0
- package/dist/message-channel-CQ6DgRUw.js +110 -0
- package/dist/model-selection-BXhwukLK.js +2734 -0
- package/dist/model-selection-CjiXwYEH.js +2983 -0
- package/dist/models-cli-DQKO_tWR.js +2542 -0
- package/dist/models-cli-k41kE3Yo.js +2545 -0
- package/dist/net-5DEH6AJK.js +1815 -0
- package/dist/node-cli-BXYXe5FE.js +1456 -0
- package/dist/node-cli-D7W69MZm.js +1459 -0
- package/dist/node-service-BTKxbzYo.js +67 -0
- package/dist/node-service-BoC2MKaK.js +67 -0
- package/dist/nodes-cli-MDb6jux3.js +1210 -0
- package/dist/nodes-cli-q-rHzVBz.js +1207 -0
- package/dist/nodes-screen-DT5HvhJV.js +157 -0
- package/dist/nodes-screen-DtXuFQdk.js +157 -0
- package/dist/note-B5HnoeZX.js +73 -0
- package/dist/note-_C44YfAQ.js +73 -0
- package/dist/onboard-channels-CKzF9fxT.js +671 -0
- package/dist/onboard-channels-Dr4FB1Sm.js +671 -0
- package/dist/onboard-skills-F6Kw1jrV.js +3452 -0
- package/dist/onboard-skills-aY4SkANg.js +3452 -0
- package/dist/onboarding-Do6ghpyS.js +3269 -0
- package/dist/openclaw-root-9ILYSmJ9.js +84 -0
- package/dist/openclaw-root-Cvotktkd.js +84 -0
- package/dist/pairing-cli-BUGQkncg.js +114 -0
- package/dist/pairing-cli-C63BXADO.js +117 -0
- package/dist/pairing-labels-DERlP-Wr.js +9 -0
- package/dist/pairing-labels-DhY2DQey.js +9 -0
- package/dist/pairing-store-D9vodPRR.js +391 -0
- package/dist/pairing-store-DWX2hYou.js +391 -0
- package/dist/parse-BZz5lHzQ.js +23 -0
- package/dist/parse-DqAvJRIf.js +23 -0
- package/dist/parse-log-line-BnB7770k.js +44 -0
- package/dist/parse-log-line-DSvJi17i.js +44 -0
- package/dist/parse-timeout-DV8NQQWk.js +16 -0
- package/dist/parse-timeout-Du-wHHNi.js +16 -0
- package/dist/path-env-DP3DsVge.js +77 -0
- package/dist/path-env-h3xp5PqO.js +77 -0
- package/dist/paths-B1kfl4h5.js +164 -0
- package/dist/paths-BT8VDsrj.js +43 -0
- package/dist/paths-BveE45t9.js +40 -0
- package/dist/paths-CR6bsrfc.js +43 -0
- package/dist/paths-scjhy7N2.js +180 -0
- package/dist/pi-embedded-helpers-BBIlv_VS.js +1303 -0
- package/dist/pi-embedded-helpers-CgGWSZV9.js +8480 -0
- package/dist/pi-embedded-helpers-CvujKXfr.js +1303 -0
- package/dist/pi-model-discovery-CV2V1HHz.js +20 -0
- package/dist/pi-model-discovery-DzEIEgHL.js +20 -0
- package/dist/pi-model-discovery-EhM2JAQo.js +20 -0
- package/dist/pi-tools.policy-JNsnW6cw.js +230 -0
- package/dist/plugin-auto-enable-CKBWhy8V.js +460 -0
- package/dist/plugin-auto-enable-D7FGzrWo.js +460 -0
- package/dist/plugin-sdk/agents/agent-paths.d.ts +2 -0
- package/dist/plugin-sdk/agents/agent-scope.d.ts +37 -0
- package/dist/plugin-sdk/agents/anthropic-payload-log.d.ts +16 -0
- package/dist/plugin-sdk/agents/apply-patch-update.d.ts +8 -0
- package/dist/plugin-sdk/agents/apply-patch.d.ts +24 -0
- package/dist/plugin-sdk/agents/auth-profiles/constants.d.ts +20 -0
- package/dist/plugin-sdk/agents/auth-profiles/display.d.ts +7 -0
- package/dist/plugin-sdk/agents/auth-profiles/doctor.d.ts +8 -0
- package/dist/plugin-sdk/agents/auth-profiles/external-cli-sync.d.ts +7 -0
- package/dist/plugin-sdk/agents/auth-profiles/oauth.d.ts +12 -0
- package/dist/plugin-sdk/agents/auth-profiles/order.d.ts +8 -0
- package/dist/plugin-sdk/agents/auth-profiles/paths.d.ts +4 -0
- package/dist/plugin-sdk/agents/auth-profiles/profiles.d.ts +18 -0
- package/dist/plugin-sdk/agents/auth-profiles/repair.d.ts +14 -0
- package/dist/plugin-sdk/agents/auth-profiles/session-override.d.ts +18 -0
- package/dist/plugin-sdk/agents/auth-profiles/store.d.ts +10 -0
- package/dist/plugin-sdk/agents/auth-profiles/types.d.ts +60 -0
- package/dist/plugin-sdk/agents/auth-profiles/usage.d.ts +47 -0
- package/dist/plugin-sdk/agents/auth-profiles.d.ts +11 -0
- package/dist/plugin-sdk/agents/bash-process-registry.d.ts +68 -0
- package/dist/plugin-sdk/agents/bash-tools.d.ts +4 -0
- package/dist/plugin-sdk/agents/bash-tools.exec.d.ts +54 -0
- package/dist/plugin-sdk/agents/bash-tools.process.d.ts +7 -0
- package/dist/plugin-sdk/agents/bash-tools.shared.d.ts +46 -0
- package/dist/plugin-sdk/agents/bedrock-discovery.d.ts +9 -0
- package/dist/plugin-sdk/agents/bootstrap-files.d.ts +25 -0
- package/dist/plugin-sdk/agents/bootstrap-hooks.d.ts +10 -0
- package/dist/plugin-sdk/agents/cache-trace.d.ts +51 -0
- package/dist/plugin-sdk/agents/channel-tools.d.ts +27 -0
- package/dist/plugin-sdk/agents/chutes-oauth.d.ts +46 -0
- package/dist/plugin-sdk/agents/cli-backends.d.ts +8 -0
- package/dist/plugin-sdk/agents/cli-credentials.d.ts +82 -0
- package/dist/plugin-sdk/agents/cli-runner/helpers.d.ts +76 -0
- package/dist/plugin-sdk/agents/cli-runner.d.ts +41 -0
- package/dist/plugin-sdk/agents/cli-session.d.ts +3 -0
- package/dist/plugin-sdk/agents/cloudflare-ai-gateway.d.ts +22 -0
- package/dist/plugin-sdk/agents/context-window-guard.d.ts +24 -0
- package/dist/plugin-sdk/agents/context.d.ts +1 -0
- package/dist/plugin-sdk/agents/date-time.d.ts +13 -0
- package/dist/plugin-sdk/agents/defaults.d.ts +3 -0
- package/dist/plugin-sdk/agents/docs-path.d.ts +6 -0
- package/dist/plugin-sdk/agents/failover-error.d.ts +33 -0
- package/dist/plugin-sdk/agents/identity.d.ts +25 -0
- package/dist/plugin-sdk/agents/lanes.d.ts +3 -0
- package/dist/plugin-sdk/agents/memory-search.d.ts +66 -0
- package/dist/plugin-sdk/agents/minimax-vlm.d.ts +7 -0
- package/dist/plugin-sdk/agents/model-auth.d.ts +36 -0
- package/dist/plugin-sdk/agents/model-catalog.d.ts +25 -0
- package/dist/plugin-sdk/agents/model-compat.d.ts +2 -0
- package/dist/plugin-sdk/agents/model-fallback.d.ts +49 -0
- package/dist/plugin-sdk/agents/model-selection.d.ts +93 -0
- package/dist/plugin-sdk/agents/models-config.d.ts +5 -0
- package/dist/plugin-sdk/agents/models-config.providers.d.ts +26 -0
- package/dist/plugin-sdk/agents/openclaw-tools.d.ts +44 -0
- package/dist/plugin-sdk/agents/pi-embedded-block-chunker.d.ts +19 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/bootstrap.d.ts +28 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/errors.d.ts +47 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/google.d.ts +8 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/images.d.ts +20 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/messaging-dedupe.d.ts +10 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/openai.d.ts +9 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/thinking.d.ts +5 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/turns.d.ts +20 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/types.d.ts +5 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers.d.ts +11 -0
- package/dist/plugin-sdk/agents/pi-embedded-messaging.d.ts +8 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/abort.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/cache-ttl.d.ts +9 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/compact.d.ts +50 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/extensions.d.ts +12 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/extra-params.d.ts +22 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/google.d.ts +39 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/history.d.ts +12 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/lanes.d.ts +3 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/logger.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/model.d.ts +22 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/attempt.d.ts +5 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/images.d.ts +83 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +116 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/payloads.d.ts +34 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/types.d.ts +133 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run.d.ts +3 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/runs.d.ts +14 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/sandbox-info.d.ts +4 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/session-manager-cache.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/session-manager-init.d.ts +17 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/system-prompt.d.ts +51 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/tool-result-truncation.d.ts +65 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/tool-split.d.ts +11 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/types.d.ts +70 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/utils.d.ts +8 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner.d.ts +12 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.d.ts +20 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.lifecycle.d.ts +8 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.messages.d.ts +12 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.tools.d.ts +18 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.types.d.ts +108 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.raw-stream.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.tools.d.ts +6 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.types.d.ts +44 -0
- package/dist/plugin-sdk/agents/pi-embedded-utils.d.ts +38 -0
- package/dist/plugin-sdk/agents/pi-embedded.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-extensions/compaction-safeguard-runtime.d.ts +6 -0
- package/dist/plugin-sdk/agents/pi-extensions/context-pruning/runtime.d.ts +9 -0
- package/dist/plugin-sdk/agents/pi-extensions/context-pruning/settings.d.ts +44 -0
- package/dist/plugin-sdk/agents/pi-extensions/context-pruning/tools.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-model-discovery.d.ts +4 -0
- package/dist/plugin-sdk/agents/pi-settings.d.ts +19 -0
- package/dist/plugin-sdk/agents/pi-tool-definition-adapter.d.ts +10 -0
- package/dist/plugin-sdk/agents/pi-tools.abort.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-tools.before-tool-call.d.ts +25 -0
- package/dist/plugin-sdk/agents/pi-tools.d.ts +69 -0
- package/dist/plugin-sdk/agents/pi-tools.policy.d.ts +37 -0
- package/dist/plugin-sdk/agents/pi-tools.read.d.ts +35 -0
- package/dist/plugin-sdk/agents/pi-tools.schema.d.ts +3 -0
- package/dist/plugin-sdk/agents/pi-tools.types.d.ts +2 -0
- package/dist/plugin-sdk/agents/pty-dsr.d.ts +5 -0
- package/dist/plugin-sdk/agents/pty-keys.d.ts +13 -0
- package/dist/plugin-sdk/agents/sandbox/browser-bridges.d.ts +5 -0
- package/dist/plugin-sdk/agents/sandbox/browser.d.ts +8 -0
- package/dist/plugin-sdk/agents/sandbox/config-hash.d.ts +9 -0
- package/dist/plugin-sdk/agents/sandbox/config.d.ts +22 -0
- package/dist/plugin-sdk/agents/sandbox/constants.d.ts +19 -0
- package/dist/plugin-sdk/agents/sandbox/context.d.ts +12 -0
- package/dist/plugin-sdk/agents/sandbox/docker.d.ts +28 -0
- package/dist/plugin-sdk/agents/sandbox/manage.d.ts +13 -0
- package/dist/plugin-sdk/agents/sandbox/prune.d.ts +3 -0
- package/dist/plugin-sdk/agents/sandbox/registry.d.ts +30 -0
- package/dist/plugin-sdk/agents/sandbox/runtime-status.d.ts +18 -0
- package/dist/plugin-sdk/agents/sandbox/shared.d.ts +4 -0
- package/dist/plugin-sdk/agents/sandbox/tool-policy.d.ts +4 -0
- package/dist/plugin-sdk/agents/sandbox/types.d.ts +73 -0
- package/dist/plugin-sdk/agents/sandbox/types.docker.d.ts +25 -0
- package/dist/plugin-sdk/agents/sandbox/workspace.d.ts +1 -0
- package/dist/plugin-sdk/agents/sandbox-paths.d.ts +21 -0
- package/dist/plugin-sdk/agents/sandbox.d.ts +8 -0
- package/dist/plugin-sdk/agents/schema/clean-for-gemini.d.ts +2 -0
- package/dist/plugin-sdk/agents/schema/typebox.d.ts +14 -0
- package/dist/plugin-sdk/agents/session-file-repair.d.ts +11 -0
- package/dist/plugin-sdk/agents/session-slug.d.ts +1 -0
- package/dist/plugin-sdk/agents/session-tool-result-guard-wrapper.d.ts +14 -0
- package/dist/plugin-sdk/agents/session-tool-result-guard.d.ts +21 -0
- package/dist/plugin-sdk/agents/session-transcript-repair.d.ts +26 -0
- package/dist/plugin-sdk/agents/session-write-lock.d.ts +21 -0
- package/dist/plugin-sdk/agents/shell-utils.d.ts +7 -0
- package/dist/plugin-sdk/agents/skills/bundled-dir.d.ts +7 -0
- package/dist/plugin-sdk/agents/skills/config.d.ts +14 -0
- package/dist/plugin-sdk/agents/skills/env-overrides.d.ts +10 -0
- package/dist/plugin-sdk/agents/skills/frontmatter.d.ts +6 -0
- package/dist/plugin-sdk/agents/skills/plugin-skills.d.ts +5 -0
- package/dist/plugin-sdk/agents/skills/refresh.d.ts +19 -0
- package/dist/plugin-sdk/agents/skills/serialize.d.ts +1 -0
- package/dist/plugin-sdk/agents/skills/types.d.ts +80 -0
- package/dist/plugin-sdk/agents/skills/workspace.d.ts +49 -0
- package/dist/plugin-sdk/agents/skills.d.ts +7 -0
- package/dist/plugin-sdk/agents/subagent-announce-queue.d.ts +22 -0
- package/dist/plugin-sdk/agents/subagent-announce.d.ts +30 -0
- package/dist/plugin-sdk/agents/subagent-registry.d.ts +35 -0
- package/dist/plugin-sdk/agents/subagent-registry.store.d.ts +5 -0
- package/dist/plugin-sdk/agents/synthetic-models.d.ts +153 -0
- package/dist/plugin-sdk/agents/system-prompt-params.d.ts +30 -0
- package/dist/plugin-sdk/agents/system-prompt-report.d.ts +20 -0
- package/dist/plugin-sdk/agents/system-prompt.d.ts +77 -0
- package/dist/plugin-sdk/agents/timeout.d.ts +8 -0
- package/dist/plugin-sdk/agents/tool-call-id.d.ts +17 -0
- package/dist/plugin-sdk/agents/tool-display.d.ts +15 -0
- package/dist/plugin-sdk/agents/tool-images.d.ts +19 -0
- package/dist/plugin-sdk/agents/tool-policy.d.ts +39 -0
- package/dist/plugin-sdk/agents/tool-summaries.d.ts +2 -0
- package/dist/plugin-sdk/agents/tools/agent-step.d.ts +12 -0
- package/dist/plugin-sdk/agents/tools/agents-list-tool.d.ts +6 -0
- package/dist/plugin-sdk/agents/tools/browser-tool.d.ts +5 -0
- package/dist/plugin-sdk/agents/tools/browser-tool.schema.d.ts +50 -0
- package/dist/plugin-sdk/agents/tools/canvas-tool.d.ts +2 -0
- package/dist/plugin-sdk/agents/tools/common.d.ts +52 -0
- package/dist/plugin-sdk/agents/tools/cron-tool.d.ts +6 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-guild.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-messaging.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-moderation.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-presence.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/discord-actions.d.ts +3 -0
- package/dist/plugin-sdk/agents/tools/gateway-tool.d.ts +6 -0
- package/dist/plugin-sdk/agents/tools/gateway.d.ts +14 -0
- package/dist/plugin-sdk/agents/tools/image-tool.d.ts +26 -0
- package/dist/plugin-sdk/agents/tools/image-tool.helpers.d.ts +21 -0
- package/dist/plugin-sdk/agents/tools/memory-tool.d.ts +10 -0
- package/dist/plugin-sdk/agents/tools/message-tool.d.ts +18 -0
- package/dist/plugin-sdk/agents/tools/nodes-tool.d.ts +6 -0
- package/dist/plugin-sdk/agents/tools/nodes-utils.d.ts +20 -0
- package/dist/plugin-sdk/agents/tools/session-status-tool.d.ts +6 -0
- package/dist/plugin-sdk/agents/tools/sessions-announce-target.d.ts +5 -0
- package/dist/plugin-sdk/agents/tools/sessions-helpers.d.ts +90 -0
- package/dist/plugin-sdk/agents/tools/sessions-history-tool.d.ts +5 -0
- package/dist/plugin-sdk/agents/tools/sessions-list-tool.d.ts +5 -0
- package/dist/plugin-sdk/agents/tools/sessions-send-helpers.d.ts +34 -0
- package/dist/plugin-sdk/agents/tools/sessions-send-tool.a2a.d.ts +12 -0
- package/dist/plugin-sdk/agents/tools/sessions-send-tool.d.ts +7 -0
- package/dist/plugin-sdk/agents/tools/sessions-spawn-tool.d.ts +15 -0
- package/dist/plugin-sdk/agents/tools/slack-actions.d.ts +15 -0
- package/dist/plugin-sdk/agents/tools/telegram-actions.d.ts +9 -0
- package/dist/plugin-sdk/agents/tools/tts-tool.d.ts +7 -0
- package/dist/plugin-sdk/agents/tools/web-fetch-utils.d.ts +18 -0
- package/dist/plugin-sdk/agents/tools/web-fetch.d.ts +25 -0
- package/dist/plugin-sdk/agents/tools/web-search.d.ts +22 -0
- package/dist/plugin-sdk/agents/tools/web-shared.d.ts +17 -0
- package/dist/plugin-sdk/agents/tools/web-tools.d.ts +2 -0
- package/dist/plugin-sdk/agents/tools/whatsapp-actions.d.ts +3 -0
- package/dist/plugin-sdk/agents/transcript-policy.d.ts +23 -0
- package/dist/plugin-sdk/agents/usage.d.ts +35 -0
- package/dist/plugin-sdk/agents/venice-models.d.ts +238 -0
- package/dist/plugin-sdk/agents/workspace-run.d.ts +18 -0
- package/dist/plugin-sdk/agents/workspace-templates.d.ts +6 -0
- package/dist/plugin-sdk/agents/workspace.d.ts +33 -0
- package/dist/plugin-sdk/auto-reply/chunk.d.ts +45 -0
- package/dist/plugin-sdk/auto-reply/command-auth.d.ts +17 -0
- package/dist/plugin-sdk/auto-reply/command-detection.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/commands-args.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/commands-registry.d.ts +54 -0
- package/dist/plugin-sdk/auto-reply/commands-registry.data.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/commands-registry.types.d.ts +66 -0
- package/dist/plugin-sdk/auto-reply/dispatch.d.ts +27 -0
- package/dist/plugin-sdk/auto-reply/envelope.d.ts +59 -0
- package/dist/plugin-sdk/auto-reply/group-activation.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/heartbeat.d.ts +26 -0
- package/dist/plugin-sdk/auto-reply/inbound-debounce.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/media-note.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/model.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/abort.d.ts +20 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +49 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-helpers.d.ts +17 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-memory.d.ts +20 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-payloads.d.ts +25 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +30 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner.d.ts +38 -0
- package/dist/plugin-sdk/auto-reply/reply/bash-command.d.ts +19 -0
- package/dist/plugin-sdk/auto-reply/reply/block-reply-coalescer.d.ts +15 -0
- package/dist/plugin-sdk/auto-reply/reply/block-reply-pipeline.d.ts +31 -0
- package/dist/plugin-sdk/auto-reply/reply/block-streaming.d.ts +22 -0
- package/dist/plugin-sdk/auto-reply/reply/body.d.ts +11 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-allowlist.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-approve.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-bash.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-compact.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-config.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-context-report.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-context.d.ts +12 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-core.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-info.d.ts +10 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-models.d.ts +23 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-plugin.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-session.d.ts +7 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +24 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-tts.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +60 -0
- package/dist/plugin-sdk/auto-reply/reply/commands.d.ts +4 -0
- package/dist/plugin-sdk/auto-reply/reply/config-commands.d.ts +15 -0
- package/dist/plugin-sdk/auto-reply/reply/config-value.d.ts +4 -0
- package/dist/plugin-sdk/auto-reply/reply/debug-commands.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.auth.d.ts +19 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.fast-lane.d.ts +47 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.impl.d.ts +36 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.model-picker.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.model.d.ts +42 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +62 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.persist.d.ts +37 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.queue-validation.d.ts +10 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +38 -0
- package/dist/plugin-sdk/auto-reply/reply/dispatch-from-config.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/exec/directive.d.ts +20 -0
- package/dist/plugin-sdk/auto-reply/reply/exec.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/followup-runner.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-apply.d.ts +64 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-utils.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +91 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +59 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +69 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply.d.ts +4 -0
- package/dist/plugin-sdk/auto-reply/reply/groups.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/history.d.ts +72 -0
- package/dist/plugin-sdk/auto-reply/reply/inbound-context.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/inbound-dedupe.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/inbound-sender-meta.d.ts +5 -0
- package/dist/plugin-sdk/auto-reply/reply/inbound-text.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/line-directives.d.ts +22 -0
- package/dist/plugin-sdk/auto-reply/reply/memory-flush.d.ts +23 -0
- package/dist/plugin-sdk/auto-reply/reply/mentions.d.ts +18 -0
- package/dist/plugin-sdk/auto-reply/reply/model-selection.d.ts +61 -0
- package/dist/plugin-sdk/auto-reply/reply/normalize-reply.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/reply/provider-dispatcher.d.ts +19 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/cleanup.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/directive.d.ts +15 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/drain.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/enqueue.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/normalize.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/settings.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/state.d.ts +19 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +84 -0
- package/dist/plugin-sdk/auto-reply/reply/queue.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-directives.d.ts +14 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-dispatcher.d.ts +51 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-elevated.d.ts +23 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-inline.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-payloads.d.ts +22 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-reference.d.ts +20 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-tags.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-threading.d.ts +9 -0
- package/dist/plugin-sdk/auto-reply/reply/response-prefix-template.d.ts +51 -0
- package/dist/plugin-sdk/auto-reply/reply/route-reply.d.ts +56 -0
- package/dist/plugin-sdk/auto-reply/reply/session-reset-model.d.ts +24 -0
- package/dist/plugin-sdk/auto-reply/reply/session-updates.d.ts +34 -0
- package/dist/plugin-sdk/auto-reply/reply/session-usage.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/reply/session.d.ts +26 -0
- package/dist/plugin-sdk/auto-reply/reply/stage-sandbox-media.d.ts +9 -0
- package/dist/plugin-sdk/auto-reply/reply/streaming-directives.d.ts +10 -0
- package/dist/plugin-sdk/auto-reply/reply/subagents-utils.d.ts +9 -0
- package/dist/plugin-sdk/auto-reply/reply/typing-mode.d.ts +27 -0
- package/dist/plugin-sdk/auto-reply/reply/typing.d.ts +18 -0
- package/dist/plugin-sdk/auto-reply/reply/untrusted-context.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/send-policy.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/skill-commands.d.ts +18 -0
- package/dist/plugin-sdk/auto-reply/status.d.ts +53 -0
- package/dist/plugin-sdk/auto-reply/templating.d.ts +140 -0
- package/dist/plugin-sdk/auto-reply/thinking.d.ts +22 -0
- package/dist/plugin-sdk/auto-reply/tokens.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/tool-meta.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/types.d.ts +57 -0
- package/dist/plugin-sdk/browser/bridge-server.d.ts +17 -0
- package/dist/plugin-sdk/browser/cdp.d.ts +123 -0
- package/dist/plugin-sdk/browser/cdp.helpers.d.ts +11 -0
- package/dist/plugin-sdk/browser/chrome.d.ts +20 -0
- package/dist/plugin-sdk/browser/chrome.executables.d.ts +9 -0
- package/dist/plugin-sdk/browser/chrome.profile-decoration.d.ts +10 -0
- package/dist/plugin-sdk/browser/client-actions-core.d.ts +143 -0
- package/dist/plugin-sdk/browser/client-actions-observe.d.ts +68 -0
- package/dist/plugin-sdk/browser/client-actions-state.d.ts +90 -0
- package/dist/plugin-sdk/browser/client-actions-types.d.ts +18 -0
- package/dist/plugin-sdk/browser/client-actions.d.ts +4 -0
- package/dist/plugin-sdk/browser/client-fetch.d.ts +3 -0
- package/dist/plugin-sdk/browser/client.d.ts +147 -0
- package/dist/plugin-sdk/browser/config.d.ts +39 -0
- package/dist/plugin-sdk/browser/constants.d.ts +8 -0
- package/dist/plugin-sdk/browser/control-service.d.ts +5 -0
- package/dist/plugin-sdk/browser/extension-relay.d.ts +15 -0
- package/dist/plugin-sdk/browser/profiles-service.d.ts +25 -0
- package/dist/plugin-sdk/browser/profiles.d.ts +30 -0
- package/dist/plugin-sdk/browser/pw-ai-module.d.ts +6 -0
- package/dist/plugin-sdk/browser/pw-ai.d.ts +2 -0
- package/dist/plugin-sdk/browser/pw-role-snapshot.d.ts +35 -0
- package/dist/plugin-sdk/browser/pw-session.d.ts +135 -0
- package/dist/plugin-sdk/browser/pw-tools-core.activity.d.ts +21 -0
- package/dist/plugin-sdk/browser/pw-tools-core.d.ts +8 -0
- package/dist/plugin-sdk/browser/pw-tools-core.downloads.d.ts +34 -0
- package/dist/plugin-sdk/browser/pw-tools-core.interactions.d.ts +112 -0
- package/dist/plugin-sdk/browser/pw-tools-core.responses.d.ts +13 -0
- package/dist/plugin-sdk/browser/pw-tools-core.shared.d.ts +6 -0
- package/dist/plugin-sdk/browser/pw-tools-core.snapshot.d.ts +64 -0
- package/dist/plugin-sdk/browser/pw-tools-core.state.d.ts +46 -0
- package/dist/plugin-sdk/browser/pw-tools-core.storage.d.ts +47 -0
- package/dist/plugin-sdk/browser/pw-tools-core.trace.d.ts +12 -0
- package/dist/plugin-sdk/browser/routes/agent.act.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/agent.act.shared.d.ts +10 -0
- package/dist/plugin-sdk/browser/routes/agent.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/agent.debug.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/agent.shared.d.ts +9 -0
- package/dist/plugin-sdk/browser/routes/agent.snapshot.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/agent.storage.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/basic.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/dispatcher.d.ts +15 -0
- package/dist/plugin-sdk/browser/routes/index.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/tabs.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/types.d.ts +15 -0
- package/dist/plugin-sdk/browser/routes/utils.d.ts +15 -0
- package/dist/plugin-sdk/browser/screenshot.d.ts +9 -0
- package/dist/plugin-sdk/browser/server-context.d.ts +3 -0
- package/dist/plugin-sdk/browser/server-context.types.d.ts +78 -0
- package/dist/plugin-sdk/browser/target-id.d.ts +11 -0
- package/dist/plugin-sdk/browser/trash.d.ts +1 -0
- package/dist/plugin-sdk/channel-web.d.ts +6 -0
- package/dist/plugin-sdk/channels/ack-reactions.d.ts +29 -0
- package/dist/plugin-sdk/channels/allowlist-match.d.ts +10 -0
- package/dist/plugin-sdk/channels/allowlists/resolve-utils.d.ts +6 -0
- package/dist/plugin-sdk/channels/channel-config.d.ts +39 -0
- package/dist/plugin-sdk/channels/chat-type.d.ts +2 -0
- package/dist/plugin-sdk/channels/command-gating.d.ts +20 -0
- package/dist/plugin-sdk/channels/conversation-label.d.ts +2 -0
- package/dist/plugin-sdk/channels/dock.d.ts +36 -0
- package/dist/plugin-sdk/channels/location.d.ts +21 -0
- package/dist/plugin-sdk/channels/logging.d.ts +20 -0
- package/dist/plugin-sdk/channels/mention-gating.d.ts +27 -0
- package/dist/plugin-sdk/channels/plugins/actions/discord/handle-action.d.ts +3 -0
- package/dist/plugin-sdk/channels/plugins/actions/discord/handle-action.guild-admin.d.ts +9 -0
- package/dist/plugin-sdk/channels/plugins/actions/discord.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/actions/signal.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/actions/telegram.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/agent-tools/whatsapp-login.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/allowlist-match.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/bluebubbles-actions.d.ts +48 -0
- package/dist/plugin-sdk/channels/plugins/channel-config.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/config-helpers.d.ts +14 -0
- package/dist/plugin-sdk/channels/plugins/config-schema.d.ts +3 -0
- package/dist/plugin-sdk/channels/plugins/config-writes.d.ts +7 -0
- package/dist/plugin-sdk/channels/plugins/directory-config.d.ts +16 -0
- package/dist/plugin-sdk/channels/plugins/group-mentions.d.ts +28 -0
- package/dist/plugin-sdk/channels/plugins/helpers.d.ts +8 -0
- package/dist/plugin-sdk/channels/plugins/index.d.ts +8 -0
- package/dist/plugin-sdk/channels/plugins/media-limits.d.ts +9 -0
- package/dist/plugin-sdk/channels/plugins/message-action-names.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/message-actions.d.ts +7 -0
- package/dist/plugin-sdk/channels/plugins/normalize/discord.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/imessage.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/signal.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/slack.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/telegram.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/whatsapp.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/channel-access.d.ts +31 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/discord.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/helpers.d.ts +3 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/imessage.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/signal.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/slack.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/telegram.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/whatsapp.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding-types.d.ts +77 -0
- package/dist/plugin-sdk/channels/plugins/outbound/load.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/pairing-message.d.ts +1 -0
- package/dist/plugin-sdk/channels/plugins/pairing.d.ts +16 -0
- package/dist/plugin-sdk/channels/plugins/setup-helpers.d.ts +13 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/bluebubbles.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/discord.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/shared.d.ts +10 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/telegram.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/whatsapp.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/types.adapters.d.ts +294 -0
- package/dist/plugin-sdk/channels/plugins/types.core.d.ts +311 -0
- package/dist/plugin-sdk/channels/plugins/types.d.ts +6 -0
- package/dist/plugin-sdk/channels/plugins/types.plugin.d.ts +53 -0
- package/dist/plugin-sdk/channels/plugins/whatsapp-heartbeat.d.ts +11 -0
- package/dist/plugin-sdk/channels/registry.d.ts +16 -0
- package/dist/plugin-sdk/channels/reply-prefix.d.ts +24 -0
- package/dist/plugin-sdk/channels/sender-label.d.ts +9 -0
- package/dist/plugin-sdk/channels/session.d.ts +18 -0
- package/dist/plugin-sdk/channels/targets.d.ts +25 -0
- package/dist/plugin-sdk/channels/typing.d.ts +12 -0
- package/dist/plugin-sdk/channels/web/index.d.ts +1 -0
- package/dist/plugin-sdk/cli/cli-name.d.ts +3 -0
- package/dist/plugin-sdk/cli/cli-utils.d.ts +18 -0
- package/dist/plugin-sdk/cli/command-format.d.ts +1 -0
- package/dist/plugin-sdk/cli/deps.d.ts +18 -0
- package/dist/plugin-sdk/cli/memory-cli.d.ts +12 -0
- package/dist/plugin-sdk/cli/nodes-camera.d.ts +26 -0
- package/dist/plugin-sdk/cli/nodes-canvas.d.ts +10 -0
- package/dist/plugin-sdk/cli/nodes-run.d.ts +3 -0
- package/dist/plugin-sdk/cli/nodes-screen.d.ts +18 -0
- package/dist/plugin-sdk/cli/parse-duration.d.ts +4 -0
- package/dist/plugin-sdk/cli/parse-timeout.d.ts +1 -0
- package/dist/plugin-sdk/cli/profile-utils.d.ts +2 -0
- package/dist/plugin-sdk/cli/progress.d.ts +24 -0
- package/dist/plugin-sdk/cli/wait.d.ts +1 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +75 -0
- package/dist/plugin-sdk/commands/daemon-runtime.d.ts +8 -0
- package/dist/plugin-sdk/commands/health.d.ts +63 -0
- package/dist/plugin-sdk/commands/oauth-flow.d.ts +21 -0
- package/dist/plugin-sdk/commands/onboard-helpers.d.ts +81 -0
- package/dist/plugin-sdk/commands/onboard-types.d.ts +67 -0
- package/dist/plugin-sdk/commands/signal-install.d.ts +8 -0
- package/dist/plugin-sdk/compat/legacy-names.d.ts +8 -0
- package/dist/plugin-sdk/config/agent-dirs.d.ts +14 -0
- package/dist/plugin-sdk/config/agent-limits.d.ts +5 -0
- package/dist/plugin-sdk/config/cache-utils.d.ts +6 -0
- package/dist/plugin-sdk/config/channel-capabilities.d.ts +6 -0
- package/dist/plugin-sdk/config/commands.d.ts +16 -0
- package/dist/plugin-sdk/config/config-paths.d.ts +10 -0
- package/dist/plugin-sdk/config/config.d.ts +7 -0
- package/dist/plugin-sdk/config/defaults.d.ts +18 -0
- package/dist/plugin-sdk/config/env-substitution.d.ts +35 -0
- package/dist/plugin-sdk/config/env-vars.d.ts +2 -0
- package/dist/plugin-sdk/config/group-policy.d.ts +44 -0
- package/dist/plugin-sdk/config/includes.d.ts +32 -0
- package/dist/plugin-sdk/config/io.d.ts +36 -0
- package/dist/plugin-sdk/config/legacy-migrate.d.ts +5 -0
- package/dist/plugin-sdk/config/legacy.d.ts +6 -0
- package/dist/plugin-sdk/config/legacy.migrations.d.ts +1 -0
- package/dist/plugin-sdk/config/legacy.migrations.part-1.d.ts +2 -0
- package/dist/plugin-sdk/config/legacy.migrations.part-2.d.ts +2 -0
- package/dist/plugin-sdk/config/legacy.migrations.part-3.d.ts +2 -0
- package/dist/plugin-sdk/config/legacy.rules.d.ts +2 -0
- package/dist/plugin-sdk/config/legacy.shared.d.ts +18 -0
- package/dist/plugin-sdk/config/markdown-tables.d.ts +7 -0
- package/dist/plugin-sdk/config/merge-config.d.ts +7 -0
- package/dist/plugin-sdk/config/normalize-paths.d.ts +8 -0
- package/dist/plugin-sdk/config/paths.d.ts +57 -0
- package/dist/plugin-sdk/config/port-defaults.d.ts +13 -0
- package/dist/plugin-sdk/config/runtime-overrides.d.ts +15 -0
- package/dist/plugin-sdk/config/sessions/group.d.ts +11 -0
- package/dist/plugin-sdk/config/sessions/main-session.d.ts +43 -0
- package/dist/plugin-sdk/config/sessions/metadata.d.ts +16 -0
- package/dist/plugin-sdk/config/sessions/paths.d.ts +11 -0
- package/dist/plugin-sdk/config/sessions/reset.d.ts +43 -0
- package/dist/plugin-sdk/config/sessions/session-key.d.ts +8 -0
- package/dist/plugin-sdk/config/sessions/store.d.ts +38 -0
- package/dist/plugin-sdk/config/sessions/transcript.d.ts +18 -0
- package/dist/plugin-sdk/config/sessions/types.d.ts +146 -0
- package/dist/plugin-sdk/config/sessions.d.ts +9 -0
- package/dist/plugin-sdk/config/talk.d.ts +11 -0
- package/dist/plugin-sdk/config/telegram-custom-commands.d.ts +24 -0
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +254 -0
- package/dist/plugin-sdk/config/types.agents.d.ts +77 -0
- package/dist/plugin-sdk/config/types.approvals.d.ts +26 -0
- package/dist/plugin-sdk/config/types.auth.d.ts +28 -0
- package/dist/plugin-sdk/config/types.base.d.ts +149 -0
- package/dist/plugin-sdk/config/types.browser.d.ts +41 -0
- package/dist/plugin-sdk/config/types.channels.d.ts +34 -0
- package/dist/plugin-sdk/config/types.cron.d.ts +5 -0
- package/dist/plugin-sdk/config/types.d.ts +29 -0
- package/dist/plugin-sdk/config/types.discord.d.ts +151 -0
- package/dist/plugin-sdk/config/types.gateway.d.ts +224 -0
- package/dist/plugin-sdk/config/types.googlechat.d.ts +100 -0
- package/dist/plugin-sdk/config/types.hooks.d.ts +106 -0
- package/dist/plugin-sdk/config/types.imessage.d.ts +71 -0
- package/dist/plugin-sdk/config/types.memory.d.ts +43 -0
- package/dist/plugin-sdk/config/types.messages.d.ts +106 -0
- package/dist/plugin-sdk/config/types.models.d.ts +47 -0
- package/dist/plugin-sdk/config/types.msteams.d.ts +101 -0
- package/dist/plugin-sdk/config/types.node-host.d.ts +10 -0
- package/dist/plugin-sdk/config/types.openclaw.d.ts +108 -0
- package/dist/plugin-sdk/config/types.plugins.d.ts +32 -0
- package/dist/plugin-sdk/config/types.queue.d.ts +13 -0
- package/dist/plugin-sdk/config/types.sandbox.d.ts +76 -0
- package/dist/plugin-sdk/config/types.signal.d.ts +86 -0
- package/dist/plugin-sdk/config/types.skills.d.ts +28 -0
- package/dist/plugin-sdk/config/types.slack.d.ts +138 -0
- package/dist/plugin-sdk/config/types.telegram.d.ts +160 -0
- package/dist/plugin-sdk/config/types.tools.d.ts +437 -0
- package/dist/plugin-sdk/config/types.tts.d.ts +78 -0
- package/dist/plugin-sdk/config/types.whatsapp.d.ts +157 -0
- package/dist/plugin-sdk/config/validation.d.ts +17 -0
- package/dist/plugin-sdk/config/version.d.ts +8 -0
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +245 -0
- package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +819 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +493 -0
- package/dist/plugin-sdk/config/zod-schema.approvals.d.ts +15 -0
- package/dist/plugin-sdk/config/zod-schema.channels.d.ts +6 -0
- package/dist/plugin-sdk/config/zod-schema.core.d.ts +647 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +3085 -0
- package/dist/plugin-sdk/config/zod-schema.hooks.d.ts +78 -0
- package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +2761 -0
- package/dist/plugin-sdk/config/zod-schema.providers-whatsapp.d.ts +231 -0
- package/dist/plugin-sdk/config/zod-schema.providers.d.ts +1662 -0
- package/dist/plugin-sdk/config/zod-schema.session.d.ts +183 -0
- package/dist/plugin-sdk/cron/delivery.d.ts +9 -0
- package/dist/plugin-sdk/cron/normalize.d.ts +9 -0
- package/dist/plugin-sdk/cron/parse.d.ts +1 -0
- package/dist/plugin-sdk/cron/payload-migration.d.ts +3 -0
- package/dist/plugin-sdk/cron/schedule.d.ts +2 -0
- package/dist/plugin-sdk/cron/service/jobs.d.ts +13 -0
- package/dist/plugin-sdk/cron/service/locked.d.ts +2 -0
- package/dist/plugin-sdk/cron/service/normalize.d.ts +17 -0
- package/dist/plugin-sdk/cron/service/ops.d.ts +43 -0
- package/dist/plugin-sdk/cron/service/state.d.ts +96 -0
- package/dist/plugin-sdk/cron/service/store.d.ts +9 -0
- package/dist/plugin-sdk/cron/service/timer.d.ts +23 -0
- package/dist/plugin-sdk/cron/service.d.ts +48 -0
- package/dist/plugin-sdk/cron/store.d.ts +6 -0
- package/dist/plugin-sdk/cron/types.d.ts +93 -0
- package/dist/plugin-sdk/daemon/constants.d.ts +30 -0
- package/dist/plugin-sdk/discord/accounts.d.ts +17 -0
- package/dist/plugin-sdk/discord/api.d.ts +11 -0
- package/dist/plugin-sdk/discord/audit.d.ts +29 -0
- package/dist/plugin-sdk/discord/chunk.d.ts +20 -0
- package/dist/plugin-sdk/discord/directory-live.d.ts +4 -0
- package/dist/plugin-sdk/discord/gateway-logging.d.ts +8 -0
- package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +137 -0
- package/dist/plugin-sdk/discord/monitor/exec-approvals.d.ts +70 -0
- package/dist/plugin-sdk/discord/monitor/format.d.ts +13 -0
- package/dist/plugin-sdk/discord/monitor/gateway-registry.d.ts +9 -0
- package/dist/plugin-sdk/discord/monitor/listeners.d.ts +49 -0
- package/dist/plugin-sdk/discord/monitor/message-handler.d.ts +26 -0
- package/dist/plugin-sdk/discord/monitor/message-handler.preflight.d.ts +3 -0
- package/dist/plugin-sdk/discord/monitor/message-handler.preflight.types.d.ts +86 -0
- package/dist/plugin-sdk/discord/monitor/message-handler.process.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/message-utils.d.ts +31 -0
- package/dist/plugin-sdk/discord/monitor/native-command.d.ts +20 -0
- package/dist/plugin-sdk/discord/monitor/presence-cache.d.ts +9 -0
- package/dist/plugin-sdk/discord/monitor/provider.d.ts +13 -0
- package/dist/plugin-sdk/discord/monitor/reply-context.d.ts +13 -0
- package/dist/plugin-sdk/discord/monitor/reply-delivery.d.ts +18 -0
- package/dist/plugin-sdk/discord/monitor/sender-identity.d.ts +31 -0
- package/dist/plugin-sdk/discord/monitor/system-events.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/threading.d.ts +101 -0
- package/dist/plugin-sdk/discord/monitor/typing.d.ts +5 -0
- package/dist/plugin-sdk/discord/monitor.d.ts +10 -0
- package/dist/plugin-sdk/discord/monitor.gateway.d.ts +12 -0
- package/dist/plugin-sdk/discord/pluralkit.d.ts +26 -0
- package/dist/plugin-sdk/discord/probe.d.ts +29 -0
- package/dist/plugin-sdk/discord/resolve-channels.d.ts +15 -0
- package/dist/plugin-sdk/discord/resolve-users.d.ts +14 -0
- package/dist/plugin-sdk/discord/send.channels.d.ts +17 -0
- package/dist/plugin-sdk/discord/send.d.ts +8 -0
- package/dist/plugin-sdk/discord/send.emojis-stickers.d.ts +4 -0
- package/dist/plugin-sdk/discord/send.guild.d.ts +24 -0
- package/dist/plugin-sdk/discord/send.messages.d.ts +18 -0
- package/dist/plugin-sdk/discord/send.outbound.d.ts +22 -0
- package/dist/plugin-sdk/discord/send.permissions.d.ts +4 -0
- package/dist/plugin-sdk/discord/send.reactions.d.ts +15 -0
- package/dist/plugin-sdk/discord/send.shared.d.ts +69 -0
- package/dist/plugin-sdk/discord/send.types.d.ts +130 -0
- package/dist/plugin-sdk/discord/targets.d.ts +18 -0
- package/dist/plugin-sdk/discord/token.d.ts +11 -0
- package/dist/plugin-sdk/gateway/call.d.ts +51 -0
- package/dist/plugin-sdk/gateway/chat-abort.d.ts +44 -0
- package/dist/plugin-sdk/gateway/chat-sanitize.d.ts +3 -0
- package/dist/plugin-sdk/gateway/client.d.ts +61 -0
- package/dist/plugin-sdk/gateway/control-ui-shared.d.ts +9 -0
- package/dist/plugin-sdk/gateway/device-auth.d.ts +12 -0
- package/dist/plugin-sdk/gateway/net.d.ts +40 -0
- package/dist/plugin-sdk/gateway/node-registry.d.ts +60 -0
- package/dist/plugin-sdk/gateway/protocol/client-info.d.ts +58 -0
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +654 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +72 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agents-models-skills.d.ts +152 -0
- package/dist/plugin-sdk/gateway/protocol/schema/channels.d.ts +105 -0
- package/dist/plugin-sdk/gateway/protocol/schema/config.d.ts +51 -0
- package/dist/plugin-sdk/gateway/protocol/schema/cron.d.ts +353 -0
- package/dist/plugin-sdk/gateway/protocol/schema/devices.d.ts +38 -0
- package/dist/plugin-sdk/gateway/protocol/schema/error-codes.d.ts +14 -0
- package/dist/plugin-sdk/gateway/protocol/schema/exec-approvals.d.ts +162 -0
- package/dist/plugin-sdk/gateway/protocol/schema/frames.d.ts +163 -0
- package/dist/plugin-sdk/gateway/protocol/schema/logs-chat.d.ts +45 -0
- package/dist/plugin-sdk/gateway/protocol/schema/nodes.d.ts +64 -0
- package/dist/plugin-sdk/gateway/protocol/schema/primitives.d.ts +4 -0
- package/dist/plugin-sdk/gateway/protocol/schema/protocol-schemas.d.ts +3 -0
- package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +74 -0
- package/dist/plugin-sdk/gateway/protocol/schema/snapshot.d.ts +63 -0
- package/dist/plugin-sdk/gateway/protocol/schema/types.d.ts +122 -0
- package/dist/plugin-sdk/gateway/protocol/schema/wizard.d.ts +86 -0
- package/dist/plugin-sdk/gateway/protocol/schema.d.ts +16 -0
- package/dist/plugin-sdk/gateway/server/ws-types.d.ts +9 -0
- package/dist/plugin-sdk/gateway/server-channels.d.ts +24 -0
- package/dist/plugin-sdk/gateway/server-methods/types.d.ts +96 -0
- package/dist/plugin-sdk/gateway/server-shared.d.ts +7 -0
- package/dist/plugin-sdk/gateway/session-utils.d.ts +53 -0
- package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +11 -0
- package/dist/plugin-sdk/gateway/session-utils.types.d.ts +83 -0
- package/dist/plugin-sdk/globals.d.ts +11 -0
- package/dist/plugin-sdk/hooks/internal-hooks.d.ts +95 -0
- package/dist/plugin-sdk/hooks/types.d.ts +62 -0
- package/dist/plugin-sdk/imessage/accounts.d.ts +16 -0
- package/dist/plugin-sdk/imessage/client.d.ts +46 -0
- package/dist/plugin-sdk/imessage/constants.d.ts +2 -0
- package/dist/plugin-sdk/imessage/monitor/deliver.d.ts +17 -0
- package/dist/plugin-sdk/imessage/monitor/monitor-provider.d.ts +2 -0
- package/dist/plugin-sdk/imessage/monitor/runtime.d.ts +4 -0
- package/dist/plugin-sdk/imessage/monitor/types.d.ts +37 -0
- package/dist/plugin-sdk/imessage/monitor.d.ts +2 -0
- package/dist/plugin-sdk/imessage/probe.d.ts +18 -0
- package/dist/plugin-sdk/imessage/send.d.ts +18 -0
- package/dist/plugin-sdk/imessage/targets.d.ts +39 -0
- package/dist/plugin-sdk/index.d.ts +1 -0
- package/dist/plugin-sdk/index.js +24446 -0
- package/dist/plugin-sdk/infra/agent-events.d.ts +21 -0
- package/dist/plugin-sdk/infra/backoff.d.ts +8 -0
- package/dist/plugin-sdk/infra/channel-activity.d.ts +18 -0
- package/dist/plugin-sdk/infra/channel-summary.d.ts +7 -0
- package/dist/plugin-sdk/infra/dedupe.d.ts +11 -0
- package/dist/plugin-sdk/infra/device-auth-store.d.ts +23 -0
- package/dist/plugin-sdk/infra/device-identity.d.ts +11 -0
- package/dist/plugin-sdk/infra/diagnostic-events.d.ts +121 -0
- package/dist/plugin-sdk/infra/diagnostic-flags.d.ts +4 -0
- package/dist/plugin-sdk/infra/env.d.ts +11 -0
- package/dist/plugin-sdk/infra/errors.d.ts +3 -0
- package/dist/plugin-sdk/infra/exec-approvals.d.ts +155 -0
- package/dist/plugin-sdk/infra/exec-safety.d.ts +1 -0
- package/dist/plugin-sdk/infra/fetch.d.ts +2 -0
- package/dist/plugin-sdk/infra/format-duration.d.ts +10 -0
- package/dist/plugin-sdk/infra/git-commit.d.ts +4 -0
- package/dist/plugin-sdk/infra/heartbeat-events.d.ts +21 -0
- package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +44 -0
- package/dist/plugin-sdk/infra/heartbeat-visibility.d.ts +17 -0
- package/dist/plugin-sdk/infra/heartbeat-wake.d.ts +20 -0
- package/dist/plugin-sdk/infra/json-file.d.ts +2 -0
- package/dist/plugin-sdk/infra/machine-name.d.ts +1 -0
- package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +20 -0
- package/dist/plugin-sdk/infra/net/ssrf.d.ts +31 -0
- package/dist/plugin-sdk/infra/node-pairing.d.ts +62 -0
- package/dist/plugin-sdk/infra/node-shell.d.ts +1 -0
- package/dist/plugin-sdk/infra/openclaw-root.d.ts +10 -0
- package/dist/plugin-sdk/infra/outbound/channel-adapters.d.ts +6 -0
- package/dist/plugin-sdk/infra/outbound/channel-selection.d.ts +11 -0
- package/dist/plugin-sdk/infra/outbound/channel-target.d.ts +6 -0
- package/dist/plugin-sdk/infra/outbound/deliver.d.ts +69 -0
- package/dist/plugin-sdk/infra/outbound/directory-cache.d.ts +21 -0
- package/dist/plugin-sdk/infra/outbound/message-action-runner.d.ts +74 -0
- package/dist/plugin-sdk/infra/outbound/message-action-spec.d.ts +5 -0
- package/dist/plugin-sdk/infra/outbound/message.d.ts +76 -0
- package/dist/plugin-sdk/infra/outbound/outbound-policy.d.ts +31 -0
- package/dist/plugin-sdk/infra/outbound/outbound-send-service.d.ts +58 -0
- package/dist/plugin-sdk/infra/outbound/outbound-session.d.ts +31 -0
- package/dist/plugin-sdk/infra/outbound/payloads.d.ts +16 -0
- package/dist/plugin-sdk/infra/outbound/target-errors.d.ts +6 -0
- package/dist/plugin-sdk/infra/outbound/target-normalization.d.ts +4 -0
- package/dist/plugin-sdk/infra/outbound/target-resolver.d.ts +53 -0
- package/dist/plugin-sdk/infra/outbound/targets.d.ts +65 -0
- package/dist/plugin-sdk/infra/ports-format.d.ts +5 -0
- package/dist/plugin-sdk/infra/ports-inspect.d.ts +2 -0
- package/dist/plugin-sdk/infra/ports-lsof.d.ts +2 -0
- package/dist/plugin-sdk/infra/ports-types.d.ts +17 -0
- package/dist/plugin-sdk/infra/ports.d.ts +14 -0
- package/dist/plugin-sdk/infra/provider-usage.auth.d.ts +11 -0
- package/dist/plugin-sdk/infra/provider-usage.d.ts +4 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.antigravity.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.claude.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.codex.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.copilot.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.d.ts +7 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.gemini.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.minimax.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.shared.d.ts +1 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.zai.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.format.d.ts +13 -0
- package/dist/plugin-sdk/infra/provider-usage.load.d.ts +12 -0
- package/dist/plugin-sdk/infra/provider-usage.shared.d.ts +8 -0
- package/dist/plugin-sdk/infra/provider-usage.types.d.ts +17 -0
- package/dist/plugin-sdk/infra/restart-sentinel.d.ts +50 -0
- package/dist/plugin-sdk/infra/restart.d.ts +28 -0
- package/dist/plugin-sdk/infra/retry-policy.d.ts +25 -0
- package/dist/plugin-sdk/infra/retry.d.ts +21 -0
- package/dist/plugin-sdk/infra/session-cost-usage.d.ts +160 -0
- package/dist/plugin-sdk/infra/shell-env.d.ts +33 -0
- package/dist/plugin-sdk/infra/skills-remote.d.ts +24 -0
- package/dist/plugin-sdk/infra/system-events.d.ts +16 -0
- package/dist/plugin-sdk/infra/tailnet.d.ts +7 -0
- package/dist/plugin-sdk/infra/tls/fingerprint.d.ts +1 -0
- package/dist/plugin-sdk/infra/tls/gateway.d.ts +16 -0
- package/dist/plugin-sdk/infra/transport-ready.d.ts +16 -0
- package/dist/plugin-sdk/infra/unhandled-rejections.d.ts +15 -0
- package/dist/plugin-sdk/infra/warnings.d.ts +1 -0
- package/dist/plugin-sdk/infra/ws.d.ts +2 -0
- package/dist/plugin-sdk/infra/wsl.d.ts +2 -0
- package/dist/plugin-sdk/line/accounts.d.ts +10 -0
- package/dist/plugin-sdk/line/auto-reply-delivery.d.ts +49 -0
- package/dist/plugin-sdk/line/bot-access.d.ts +15 -0
- package/dist/plugin-sdk/line/bot-handlers.d.ts +13 -0
- package/dist/plugin-sdk/line/bot-message-context.d.ts +102 -0
- package/dist/plugin-sdk/line/bot.d.ts +24 -0
- package/dist/plugin-sdk/line/config-schema.d.ts +64 -0
- package/dist/plugin-sdk/line/download.d.ts +7 -0
- package/dist/plugin-sdk/line/flex-templates.d.ts +195 -0
- package/dist/plugin-sdk/line/markdown-to-line.d.ts +72 -0
- package/dist/plugin-sdk/line/monitor.d.ts +28 -0
- package/dist/plugin-sdk/line/probe.d.ts +2 -0
- package/dist/plugin-sdk/line/reply-chunks.d.ts +24 -0
- package/dist/plugin-sdk/line/send.d.ts +118 -0
- package/dist/plugin-sdk/line/signature.d.ts +1 -0
- package/dist/plugin-sdk/line/template-messages.d.ts +119 -0
- package/dist/plugin-sdk/line/types.d.ts +125 -0
- package/dist/plugin-sdk/line/webhook.d.ts +19 -0
- package/dist/plugin-sdk/link-understanding/apply.d.ts +10 -0
- package/dist/plugin-sdk/link-understanding/defaults.d.ts +2 -0
- package/dist/plugin-sdk/link-understanding/detect.d.ts +3 -0
- package/dist/plugin-sdk/link-understanding/format.d.ts +4 -0
- package/dist/plugin-sdk/link-understanding/runner.d.ts +11 -0
- package/dist/plugin-sdk/logger.d.ts +6 -0
- package/dist/plugin-sdk/logging/config.d.ts +4 -0
- package/dist/plugin-sdk/logging/console.d.ts +19 -0
- package/dist/plugin-sdk/logging/diagnostic.d.ts +58 -0
- package/dist/plugin-sdk/logging/levels.d.ts +4 -0
- package/dist/plugin-sdk/logging/logger.d.ts +42 -0
- package/dist/plugin-sdk/logging/redact-identifier.d.ts +4 -0
- package/dist/plugin-sdk/logging/redact.d.ts +9 -0
- package/dist/plugin-sdk/logging/state.d.ts +17 -0
- package/dist/plugin-sdk/logging/subsystem.d.ts +16 -0
- package/dist/plugin-sdk/logging.d.ts +10 -0
- package/dist/plugin-sdk/markdown/code-spans.d.ts +10 -0
- package/dist/plugin-sdk/markdown/fences.d.ts +10 -0
- package/dist/plugin-sdk/markdown/frontmatter.d.ts +2 -0
- package/dist/plugin-sdk/markdown/ir.d.ts +32 -0
- package/dist/plugin-sdk/markdown/render.d.ts +18 -0
- package/dist/plugin-sdk/markdown/tables.d.ts +2 -0
- package/dist/plugin-sdk/media/audio-tags.d.ts +10 -0
- package/dist/plugin-sdk/media/audio.d.ts +4 -0
- package/dist/plugin-sdk/media/constants.d.ts +7 -0
- package/dist/plugin-sdk/media/fetch.d.ts +23 -0
- package/dist/plugin-sdk/media/image-ops.d.ts +39 -0
- package/dist/plugin-sdk/media/input-files.d.ts +76 -0
- package/dist/plugin-sdk/media/mime.d.ts +15 -0
- package/dist/plugin-sdk/media/parse.d.ts +8 -0
- package/dist/plugin-sdk/media/store.d.ts +18 -0
- package/dist/plugin-sdk/media-understanding/apply.d.ts +19 -0
- package/dist/plugin-sdk/media-understanding/attachments.d.ts +43 -0
- package/dist/plugin-sdk/media-understanding/concurrency.d.ts +1 -0
- package/dist/plugin-sdk/media-understanding/defaults.d.ts +10 -0
- package/dist/plugin-sdk/media-understanding/errors.d.ts +6 -0
- package/dist/plugin-sdk/media-understanding/format.d.ts +7 -0
- package/dist/plugin-sdk/media-understanding/providers/anthropic/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/deepgram/audio.d.ts +4 -0
- package/dist/plugin-sdk/media-understanding/providers/deepgram/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/google/audio.d.ts +3 -0
- package/dist/plugin-sdk/media-understanding/providers/google/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/google/video.d.ts +3 -0
- package/dist/plugin-sdk/media-understanding/providers/groq/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/image.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/index.d.ts +4 -0
- package/dist/plugin-sdk/media-understanding/providers/minimax/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/openai/audio.d.ts +3 -0
- package/dist/plugin-sdk/media-understanding/providers/openai/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/shared.d.ts +10 -0
- package/dist/plugin-sdk/media-understanding/resolve.d.ts +44 -0
- package/dist/plugin-sdk/media-understanding/runner.d.ts +34 -0
- package/dist/plugin-sdk/media-understanding/scope.d.ts +9 -0
- package/dist/plugin-sdk/media-understanding/types.d.ts +92 -0
- package/dist/plugin-sdk/media-understanding/video.d.ts +2 -0
- package/dist/plugin-sdk/memory/backend-config.d.ts +48 -0
- package/dist/plugin-sdk/memory/batch-gemini.d.ts +55 -0
- package/dist/plugin-sdk/memory/batch-openai.d.ts +45 -0
- package/dist/plugin-sdk/memory/batch-voyage.d.ts +46 -0
- package/dist/plugin-sdk/memory/embeddings-gemini.d.ts +13 -0
- package/dist/plugin-sdk/memory/embeddings-openai.d.ts +13 -0
- package/dist/plugin-sdk/memory/embeddings-voyage.d.ts +13 -0
- package/dist/plugin-sdk/memory/embeddings.d.ts +39 -0
- package/dist/plugin-sdk/memory/hybrid.d.ts +34 -0
- package/dist/plugin-sdk/memory/index.d.ts +3 -0
- package/dist/plugin-sdk/memory/internal.d.ts +27 -0
- package/dist/plugin-sdk/memory/manager-search.d.ts +60 -0
- package/dist/plugin-sdk/memory/manager.d.ts +136 -0
- package/dist/plugin-sdk/memory/memory-schema.d.ts +10 -0
- package/dist/plugin-sdk/memory/node-llama.d.ts +8 -0
- package/dist/plugin-sdk/memory/qmd-manager.d.ts +85 -0
- package/dist/plugin-sdk/memory/search-manager.d.ts +10 -0
- package/dist/plugin-sdk/memory/session-files.d.ts +12 -0
- package/dist/plugin-sdk/memory/sqlite-vec.d.ts +9 -0
- package/dist/plugin-sdk/memory/sqlite.d.ts +1 -0
- package/dist/plugin-sdk/memory/types.d.ts +94 -0
- package/dist/plugin-sdk/pairing/pairing-labels.d.ts +2 -0
- package/dist/plugin-sdk/pairing/pairing-messages.d.ts +6 -0
- package/dist/plugin-sdk/pairing/pairing-store.d.ts +46 -0
- package/dist/plugin-sdk/pi-model-discovery-Dw3A6oXH.js +37 -0
- package/dist/plugin-sdk/plugin-sdk/index.d.ts +100 -0
- package/dist/plugin-sdk/plugins/bundled-dir.d.ts +1 -0
- package/dist/plugin-sdk/plugins/commands.d.ts +78 -0
- package/dist/plugin-sdk/plugins/config-schema.d.ts +2 -0
- package/dist/plugin-sdk/plugins/config-state.d.ts +33 -0
- package/dist/plugin-sdk/plugins/discovery.d.ts +22 -0
- package/dist/plugin-sdk/plugins/hook-runner-global.d.ts +31 -0
- package/dist/plugin-sdk/plugins/hooks.d.ts +41 -0
- package/dist/plugin-sdk/plugins/http-path.d.ts +1 -0
- package/dist/plugin-sdk/plugins/http-registry.d.ts +13 -0
- package/dist/plugin-sdk/plugins/loader.d.ts +14 -0
- package/dist/plugin-sdk/plugins/manifest-registry.d.ts +33 -0
- package/dist/plugin-sdk/plugins/manifest.d.ts +64 -0
- package/dist/plugin-sdk/plugins/registry.d.ts +130 -0
- package/dist/plugin-sdk/plugins/runtime/index.d.ts +3 -0
- package/dist/plugin-sdk/plugins/runtime/native-deps.d.ts +8 -0
- package/dist/plugin-sdk/plugins/runtime/types.d.ts +314 -0
- package/dist/plugin-sdk/plugins/runtime.d.ts +5 -0
- package/dist/plugin-sdk/plugins/schema-validator.d.ts +10 -0
- package/dist/plugin-sdk/plugins/slots.d.ts +24 -0
- package/dist/plugin-sdk/plugins/tools.d.ts +13 -0
- package/dist/plugin-sdk/plugins/types.d.ts +381 -0
- package/dist/plugin-sdk/polls.d.ts +21 -0
- package/dist/plugin-sdk/process/command-queue.d.ts +12 -0
- package/dist/plugin-sdk/process/exec.d.ts +22 -0
- package/dist/plugin-sdk/process/lanes.d.ts +6 -0
- package/dist/plugin-sdk/process/spawn-utils.d.ts +26 -0
- package/dist/plugin-sdk/providers/github-copilot-token.d.ts +19 -0
- package/dist/plugin-sdk/providers/qwen-portal-oauth.d.ts +2 -0
- package/dist/plugin-sdk/routing/bindings.d.ts +11 -0
- package/dist/plugin-sdk/routing/resolve-route.d.ts +38 -0
- package/dist/plugin-sdk/routing/session-key.d.ts +47 -0
- package/dist/plugin-sdk/runtime.d.ts +6 -0
- package/dist/plugin-sdk/security/channel-metadata.d.ts +6 -0
- package/dist/plugin-sdk/security/external-content.d.ts +67 -0
- package/dist/plugin-sdk/sessions/level-overrides.d.ts +10 -0
- package/dist/plugin-sdk/sessions/model-overrides.d.ts +14 -0
- package/dist/plugin-sdk/sessions/send-policy.d.ts +11 -0
- package/dist/plugin-sdk/sessions/session-key-utils.d.ts +8 -0
- package/dist/plugin-sdk/sessions/session-label.d.ts +9 -0
- package/dist/plugin-sdk/sessions/transcript-events.d.ts +7 -0
- package/dist/plugin-sdk/shared/text/reasoning-tags.d.ts +6 -0
- package/dist/plugin-sdk/signal/accounts.d.ts +17 -0
- package/dist/plugin-sdk/signal/client.d.ts +32 -0
- package/dist/plugin-sdk/signal/daemon.d.ts +18 -0
- package/dist/plugin-sdk/signal/format.d.ts +17 -0
- package/dist/plugin-sdk/signal/identity.d.ts +23 -0
- package/dist/plugin-sdk/signal/index.d.ts +5 -0
- package/dist/plugin-sdk/signal/monitor/event-handler.d.ts +5 -0
- package/dist/plugin-sdk/signal/monitor/event-handler.types.d.ts +117 -0
- package/dist/plugin-sdk/signal/monitor.d.ts +23 -0
- package/dist/plugin-sdk/signal/probe.d.ts +8 -0
- package/dist/plugin-sdk/signal/reaction-level.d.ts +24 -0
- package/dist/plugin-sdk/signal/send-reactions.d.ts +32 -0
- package/dist/plugin-sdk/signal/send.d.ts +24 -0
- package/dist/plugin-sdk/signal/sse-reconnect.d.ts +13 -0
- package/dist/plugin-sdk/slack/accounts.d.ts +32 -0
- package/dist/plugin-sdk/slack/actions.d.ts +53 -0
- package/dist/plugin-sdk/slack/channel-migration.d.ts +20 -0
- package/dist/plugin-sdk/slack/client.d.ts +4 -0
- package/dist/plugin-sdk/slack/directory-live.d.ts +4 -0
- package/dist/plugin-sdk/slack/format.d.ts +7 -0
- package/dist/plugin-sdk/slack/http/index.d.ts +1 -0
- package/dist/plugin-sdk/slack/http/registry.d.ts +12 -0
- package/dist/plugin-sdk/slack/index.d.ts +6 -0
- package/dist/plugin-sdk/slack/monitor/allow-list.d.ts +20 -0
- package/dist/plugin-sdk/slack/monitor/auth.d.ts +10 -0
- package/dist/plugin-sdk/slack/monitor/channel-config.d.ts +40 -0
- package/dist/plugin-sdk/slack/monitor/commands.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/context.d.ts +109 -0
- package/dist/plugin-sdk/slack/monitor/events/channels.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events/members.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events/messages.d.ts +6 -0
- package/dist/plugin-sdk/slack/monitor/events/pins.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events/reactions.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events.d.ts +8 -0
- package/dist/plugin-sdk/slack/monitor/media.d.ts +29 -0
- package/dist/plugin-sdk/slack/monitor/message-handler/dispatch.d.ts +2 -0
- package/dist/plugin-sdk/slack/monitor/message-handler/prepare.d.ts +13 -0
- package/dist/plugin-sdk/slack/monitor/message-handler/types.d.ts +22 -0
- package/dist/plugin-sdk/slack/monitor/message-handler.d.ts +11 -0
- package/dist/plugin-sdk/slack/monitor/policy.d.ts +5 -0
- package/dist/plugin-sdk/slack/monitor/provider.d.ts +2 -0
- package/dist/plugin-sdk/slack/monitor/replies.d.ts +50 -0
- package/dist/plugin-sdk/slack/monitor/slash.d.ts +6 -0
- package/dist/plugin-sdk/slack/monitor/thread-resolution.d.ts +12 -0
- package/dist/plugin-sdk/slack/monitor/types.d.ts +97 -0
- package/dist/plugin-sdk/slack/monitor.d.ts +5 -0
- package/dist/plugin-sdk/slack/probe.d.ts +15 -0
- package/dist/plugin-sdk/slack/resolve-channels.d.ts +19 -0
- package/dist/plugin-sdk/slack/resolve-users.d.ts +26 -0
- package/dist/plugin-sdk/slack/send.d.ts +14 -0
- package/dist/plugin-sdk/slack/targets.d.ts +7 -0
- package/dist/plugin-sdk/slack/threading-tool-context.d.ts +10 -0
- package/dist/plugin-sdk/slack/threading.d.ts +20 -0
- package/dist/plugin-sdk/slack/token.d.ts +3 -0
- package/dist/plugin-sdk/slack/types.d.ts +36 -0
- package/dist/plugin-sdk/telegram/accounts.d.ts +17 -0
- package/dist/plugin-sdk/telegram/allowed-updates.d.ts +4 -0
- package/dist/plugin-sdk/telegram/api-logging.d.ts +11 -0
- package/dist/plugin-sdk/telegram/audit.d.ts +29 -0
- package/dist/plugin-sdk/telegram/bot/delivery.d.ts +34 -0
- package/dist/plugin-sdk/telegram/bot/helpers.d.ts +93 -0
- package/dist/plugin-sdk/telegram/bot/types.d.ts +28 -0
- package/dist/plugin-sdk/telegram/bot-access.d.ts +24 -0
- package/dist/plugin-sdk/telegram/bot-handlers.d.ts +2 -0
- package/dist/plugin-sdk/telegram/bot-message-context.d.ts +130 -0
- package/dist/plugin-sdk/telegram/bot-message-dispatch.d.ts +21 -0
- package/dist/plugin-sdk/telegram/bot-message.d.ts +21 -0
- package/dist/plugin-sdk/telegram/bot-native-commands.d.ts +59 -0
- package/dist/plugin-sdk/telegram/bot-updates.d.ts +27 -0
- package/dist/plugin-sdk/telegram/bot.d.ts +54 -0
- package/dist/plugin-sdk/telegram/caption.d.ts +5 -0
- package/dist/plugin-sdk/telegram/draft-chunking.d.ts +6 -0
- package/dist/plugin-sdk/telegram/draft-stream.d.ts +17 -0
- package/dist/plugin-sdk/telegram/fetch.d.ts +4 -0
- package/dist/plugin-sdk/telegram/format.d.ts +16 -0
- package/dist/plugin-sdk/telegram/group-migration.d.ts +20 -0
- package/dist/plugin-sdk/telegram/inline-buttons.d.ts +11 -0
- package/dist/plugin-sdk/telegram/model-buttons.d.ts +63 -0
- package/dist/plugin-sdk/telegram/monitor.d.ts +18 -0
- package/dist/plugin-sdk/telegram/network-config.d.ts +12 -0
- package/dist/plugin-sdk/telegram/network-errors.d.ts +5 -0
- package/dist/plugin-sdk/telegram/probe.d.ts +18 -0
- package/dist/plugin-sdk/telegram/proxy.d.ts +1 -0
- package/dist/plugin-sdk/telegram/reaction-level.d.ts +18 -0
- package/dist/plugin-sdk/telegram/send.d.ts +96 -0
- package/dist/plugin-sdk/telegram/sent-message-cache.d.ts +16 -0
- package/dist/plugin-sdk/telegram/sticker-cache.d.ts +46 -0
- package/dist/plugin-sdk/telegram/targets.d.ts +14 -0
- package/dist/plugin-sdk/telegram/token.d.ts +13 -0
- package/dist/plugin-sdk/telegram/update-offset-store.d.ts +9 -0
- package/dist/plugin-sdk/telegram/voice.d.ts +20 -0
- package/dist/plugin-sdk/telegram/webhook.d.ts +20 -0
- package/dist/plugin-sdk/terminal/ansi.d.ts +2 -0
- package/dist/plugin-sdk/terminal/links.d.ts +6 -0
- package/dist/plugin-sdk/terminal/palette.d.ts +10 -0
- package/dist/plugin-sdk/terminal/progress-line.d.ts +3 -0
- package/dist/plugin-sdk/terminal/prompt-style.d.ts +3 -0
- package/dist/plugin-sdk/terminal/restore.d.ts +1 -0
- package/dist/plugin-sdk/terminal/theme.d.ts +15 -0
- package/dist/plugin-sdk/tts/tts.d.ts +198 -0
- package/dist/plugin-sdk/tui/tui-formatters.d.ts +31 -0
- package/dist/plugin-sdk/utils/account-id.d.ts +1 -0
- package/dist/plugin-sdk/utils/boolean.d.ts +5 -0
- package/dist/plugin-sdk/utils/delivery-context.d.ts +29 -0
- package/dist/plugin-sdk/utils/directive-tags.d.ts +16 -0
- package/dist/plugin-sdk/utils/message-channel.d.ts +27 -0
- package/dist/plugin-sdk/utils/provider-utils.d.ts +9 -0
- package/dist/plugin-sdk/utils/queue-helpers.d.ts +41 -0
- package/dist/plugin-sdk/utils/shell-argv.d.ts +1 -0
- package/dist/plugin-sdk/utils/transcript-tools.d.ts +8 -0
- package/dist/plugin-sdk/utils/usage-format.d.ts +26 -0
- package/dist/plugin-sdk/utils.d.ts +43 -0
- package/dist/plugin-sdk/version.d.ts +4 -0
- package/dist/plugin-sdk/web/accounts.d.ts +39 -0
- package/dist/plugin-sdk/web/active-listener.d.ts +24 -0
- package/dist/plugin-sdk/web/auth-store.d.ts +25 -0
- package/dist/plugin-sdk/web/auto-reply/constants.d.ts +1 -0
- package/dist/plugin-sdk/web/auto-reply/deliver-reply.d.ts +18 -0
- package/dist/plugin-sdk/web/auto-reply/heartbeat-runner.d.ts +20 -0
- package/dist/plugin-sdk/web/auto-reply/loggers.d.ts +4 -0
- package/dist/plugin-sdk/web/auto-reply/mentions.d.ts +19 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/ack-reaction.d.ts +13 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/broadcast.d.ts +16 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/commands.d.ts +2 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/echo.d.ts +17 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/group-activation.d.ts +9 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/group-gating.d.ts +29 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/group-members.d.ts +6 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/last-route.d.ts +15 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/message-line.d.ts +11 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/on-message.d.ts +24 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/peer.d.ts +2 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/process-message.d.ts +40 -0
- package/dist/plugin-sdk/web/auto-reply/monitor.d.ts +5 -0
- package/dist/plugin-sdk/web/auto-reply/session-snapshot.d.ts +17 -0
- package/dist/plugin-sdk/web/auto-reply/types.d.ts +28 -0
- package/dist/plugin-sdk/web/auto-reply/util.d.ts +2 -0
- package/dist/plugin-sdk/web/auto-reply.d.ts +1 -0
- package/dist/plugin-sdk/web/auto-reply.impl.d.ts +6 -0
- package/dist/plugin-sdk/web/inbound/access-control.d.ts +24 -0
- package/dist/plugin-sdk/web/inbound/dedupe.d.ts +2 -0
- package/dist/plugin-sdk/web/inbound/extract.d.ts +13 -0
- package/dist/plugin-sdk/web/inbound/media.d.ts +6 -0
- package/dist/plugin-sdk/web/inbound/monitor.d.ts +30 -0
- package/dist/plugin-sdk/web/inbound/send-api.d.ts +22 -0
- package/dist/plugin-sdk/web/inbound/types.d.ts +40 -0
- package/dist/plugin-sdk/web/inbound.d.ts +4 -0
- package/dist/plugin-sdk/web/login-qr.d.ts +19 -0
- package/dist/plugin-sdk/web/login.d.ts +3 -0
- package/dist/plugin-sdk/web/media.d.ts +25 -0
- package/dist/plugin-sdk/web/outbound.d.ts +23 -0
- package/dist/plugin-sdk/web/qr-image.d.ts +4 -0
- package/dist/plugin-sdk/web/reconnect.d.ts +12 -0
- package/dist/plugin-sdk/web/session.d.ts +14 -0
- package/dist/plugin-sdk/web/vcard.d.ts +6 -0
- package/dist/plugin-sdk/whatsapp/normalize.d.ts +6 -0
- package/dist/plugin-sdk/wizard/prompts.d.ts +42 -0
- package/dist/plugin-sdk/wizard/session.d.ts +42 -0
- package/dist/plugins-DWuabtET.js +495 -0
- package/dist/plugins-DrjfSaQw.js +496 -0
- package/dist/plugins-cli-BEi_3gUD.js +444 -0
- package/dist/plugins-cli-DOE3sFNh.js +441 -0
- package/dist/ports-LFe1-ds4.js +96 -0
- package/dist/program-Mm9gwxgw.js +191 -0
- package/dist/progress-Bcjniu7m.js +133 -0
- package/dist/progress-xpLtQsNY.js +133 -0
- package/dist/prompt-style-CFsleyxV.js +9 -0
- package/dist/prompt-style-vzh0MGHs.js +9 -0
- package/dist/prompts-CudpZgTI.js +10 -0
- package/dist/prompts-FbZThK8w.js +10 -0
- package/dist/pw-ai-B7Fvw8DW.js +1649 -0
- package/dist/pw-ai-BpFK57Lc.js +1651 -0
- package/dist/pw-ai-tNPuRNn3.js +1649 -0
- package/dist/qmd-manager-CazydCuO.js +676 -0
- package/dist/qmd-manager-D13fgvkg.js +677 -0
- package/dist/qmd-manager-QixCK9Sh.js +674 -0
- package/dist/redact-BIMJ3ntQ.js +94 -0
- package/dist/redact-Bt-krp_b.js +97 -0
- package/dist/redact-DJCFY628.js +97 -0
- package/dist/register.subclis-DpdKOrqR.js +348 -0
- package/dist/reply-Nagr9G73.js +64757 -0
- package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
- package/dist/routes-B5LAoQFO.js +2411 -0
- package/dist/routes-B9mYGJET.js +2411 -0
- package/dist/rpc-70nwvcmj.js +95 -0
- package/dist/rpc-zvkrerfj.js +95 -0
- package/dist/run-main-Y7DVYcUu.js +194 -0
- package/dist/sandbox-BwaFbMul.js +2943 -0
- package/dist/sandbox-CFJ-0soL.js +2942 -0
- package/dist/sandbox-cli-35JWqRj-.js +460 -0
- package/dist/sandbox-cli-DcGwU3Oa.js +463 -0
- package/dist/security-cli-D-EgVOaA.js +505 -0
- package/dist/security-cli-VON7qTOf.js +508 -0
- package/dist/server-context-C8xKLc0L.js +740 -0
- package/dist/server-context-yKyxyxOJ.js +740 -0
- package/dist/server-node-events-CK-3iTzR.js +219 -0
- package/dist/server-node-events-D0VSL_HV.js +216 -0
- package/dist/service-DMUKaGTV.js +680 -0
- package/dist/service-W6pWyB7g.js +680 -0
- package/dist/service-audit-BTHjbAs2.js +542 -0
- package/dist/service-audit-GvE18NCt.js +542 -0
- package/dist/session-cost-usage-C5MMXOZi.js +692 -0
- package/dist/session-cost-usage-CTuGqn7n.js +692 -0
- package/dist/session-key-Dk6vSAOv.js +183 -0
- package/dist/session-key-ezJ78bLC.js +183 -0
- package/dist/shared-BG2E-mTe.js +74 -0
- package/dist/shared-Boip_I0l.js +152 -0
- package/dist/shared-C-yRLI1r.js +74 -0
- package/dist/shared-CF5YSjfr.js +152 -0
- package/dist/skill-scanner-BoGjHXUZ.js +255 -0
- package/dist/skill-scanner-COatt01v.js +255 -0
- package/dist/skills-B7bCWSck.js +693 -0
- package/dist/skills-D5JDj3TR.js +694 -0
- package/dist/skills-cli-D8i8lW-Y.js +290 -0
- package/dist/skills-cli-OwKnGglX.js +287 -0
- package/dist/skills-status-D83jBWaq.js +187 -0
- package/dist/skills-status-DPwsDMVS.js +187 -0
- package/dist/sqlite-BW8p11HW.js +239 -0
- package/dist/sqlite-BjhYBODp.js +221 -0
- package/dist/sqlite-D1XZ7Oej.js +239 -0
- package/dist/status-BF8IVV7c.js +21 -0
- package/dist/status-CWDof7Cn.js +21 -0
- package/dist/status-CgdwqWHT.js +3177 -0
- package/dist/status-DqF0Asv5.js +27 -0
- package/dist/status-Dqs6r0p6.js +27 -0
- package/dist/subsystem-CAq3uyo7.js +834 -0
- package/dist/system-cli-Bv347a4x.js +83 -0
- package/dist/system-cli-CV1yMDPJ.js +80 -0
- package/dist/systemd-D5s01yMo.js +438 -0
- package/dist/systemd-LmtH96vm.js +438 -0
- package/dist/systemd-hints-3-E4ndGf.js +19 -0
- package/dist/systemd-hints-D3nZ6-tA.js +19 -0
- package/dist/systemd-linger-D4Z0ePWs.js +75 -0
- package/dist/systemd-linger-DFHJcGck.js +75 -0
- package/dist/table-BGYjbJbA.js +279 -0
- package/dist/table-CM9lV0GA.js +279 -0
- package/dist/tailnet-Byp3obcc.js +42 -0
- package/dist/tailnet-DLDGNuH2.js +42 -0
- package/dist/tailscale-9MusRvOi.js +225 -0
- package/dist/tailscale-BVGD9gSD.js +252 -0
- package/dist/tool-display-BxZG0o1b.js +795 -0
- package/dist/tool-display-PgbqPY5M.js +795 -0
- package/dist/transcript-events-Bv_eRVym.js +17 -0
- package/dist/transcript-events-ChU6IQwp.js +17 -0
- package/dist/transcript-events-JLH5W4He.js +17 -0
- package/dist/tui-CSu3OIP_.js +2671 -0
- package/dist/tui-DhzN4YmH.js +2672 -0
- package/dist/tui-cli-Do9zFynn.js +55 -0
- package/dist/tui-cli-awwGCxKR.js +58 -0
- package/dist/update-DBMfgR7g.js +317 -0
- package/dist/update-Nc1UGXeU.js +317 -0
- package/dist/update-cli-DKJswr-w.js +1035 -0
- package/dist/update-cli-LmAKEOiJ.js +1033 -0
- package/dist/update-runner-DQwdSxkJ.js +1458 -0
- package/dist/update-runner-kfvB4_XO.js +1458 -0
- package/dist/usage-format-BcU1flOY.js +36 -0
- package/dist/usage-format-DvowRSs-.js +36 -0
- package/dist/utils-CKSrBNwq.js +192 -0
- package/dist/utils-DX85MiPR.js +188 -0
- package/dist/webhooks-cli--t1jf_uP.js +309 -0
- package/dist/webhooks-cli-DAMZGMPC.js +312 -0
- package/dist/widearea-dns-Bf5ongWC.js +127 -0
- package/dist/widearea-dns-DDNQMGyz.js +127 -0
- package/dist/ws-CEcdsnN9.js +13 -0
- package/dist/ws-D091yo4M.js +13 -0
- package/dist/ws-log-B0dVho23.js +267 -0
- package/dist/ws-log-CBrAJIdp.js +267 -0
- package/dist/wsl-D4fz-38s.js +160 -0
- package/docs/.i18n/README.md +31 -0
- package/docs/.i18n/glossary.zh-CN.json +210 -0
- package/docs/.i18n/zh-CN.tm.jsonl +1329 -0
- package/docs/CNAME +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.png +0 -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/automation/auth-monitoring.md +44 -0
- package/docs/automation/cron-jobs.md +478 -0
- package/docs/automation/cron-vs-heartbeat.md +282 -0
- package/docs/automation/gmail-pubsub.md +256 -0
- package/docs/automation/hooks.md +916 -0
- package/docs/automation/poll.md +69 -0
- package/docs/automation/troubleshooting.md +122 -0
- package/docs/automation/webhook.md +163 -0
- package/docs/brave-search.md +41 -0
- package/docs/channels/bluebubbles.md +340 -0
- package/docs/channels/broadcast-groups.md +442 -0
- package/docs/channels/channel-routing.md +114 -0
- package/docs/channels/discord.md +476 -0
- package/docs/channels/feishu.md +579 -0
- package/docs/channels/googlechat.md +252 -0
- package/docs/channels/grammy.md +31 -0
- package/docs/channels/group-messages.md +84 -0
- package/docs/channels/groups.md +374 -0
- package/docs/channels/imessage.md +321 -0
- package/docs/channels/index.md +46 -0
- package/docs/channels/line.md +186 -0
- package/docs/channels/location.md +56 -0
- package/docs/channels/matrix.md +259 -0
- package/docs/channels/mattermost.md +138 -0
- package/docs/channels/msteams.md +769 -0
- package/docs/channels/nextcloud-talk.md +138 -0
- package/docs/channels/nostr.md +233 -0
- package/docs/channels/pairing.md +86 -0
- package/docs/channels/signal.md +228 -0
- package/docs/channels/slack.md +574 -0
- package/docs/channels/telegram.md +770 -0
- package/docs/channels/tlon.md +132 -0
- package/docs/channels/troubleshooting.md +116 -0
- package/docs/channels/twitch.md +379 -0
- package/docs/channels/whatsapp.md +406 -0
- package/docs/channels/zalo.md +189 -0
- package/docs/channels/zalouser.md +140 -0
- package/docs/cli/acp.md +170 -0
- package/docs/cli/agent.md +24 -0
- package/docs/cli/agents.md +75 -0
- package/docs/cli/approvals.md +50 -0
- package/docs/cli/browser.md +107 -0
- package/docs/cli/channels.md +79 -0
- package/docs/cli/config.md +50 -0
- package/docs/cli/configure.md +33 -0
- package/docs/cli/cron.md +44 -0
- package/docs/cli/dashboard.md +16 -0
- package/docs/cli/devices.md +70 -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 +41 -0
- package/docs/cli/gateway.md +202 -0
- package/docs/cli/health.md +21 -0
- package/docs/cli/hooks.md +304 -0
- package/docs/cli/index.md +1031 -0
- package/docs/cli/logs.md +24 -0
- package/docs/cli/memory.md +45 -0
- package/docs/cli/message.md +239 -0
- package/docs/cli/models.md +79 -0
- package/docs/cli/node.md +112 -0
- package/docs/cli/nodes.md +73 -0
- package/docs/cli/onboard.md +43 -0
- package/docs/cli/pairing.md +21 -0
- package/docs/cli/plugins.md +62 -0
- package/docs/cli/reset.md +17 -0
- package/docs/cli/sandbox.md +152 -0
- package/docs/cli/security.md +26 -0
- package/docs/cli/sessions.md +16 -0
- package/docs/cli/setup.md +29 -0
- package/docs/cli/skills.md +26 -0
- package/docs/cli/status.md +26 -0
- package/docs/cli/system.md +60 -0
- package/docs/cli/tui.md +23 -0
- package/docs/cli/uninstall.md +17 -0
- package/docs/cli/update.md +98 -0
- package/docs/cli/voicecall.md +34 -0
- package/docs/cli/webhooks.md +25 -0
- package/docs/concepts/agent-loop.md +146 -0
- package/docs/concepts/agent-workspace.md +233 -0
- package/docs/concepts/agent.md +123 -0
- package/docs/concepts/architecture.md +131 -0
- package/docs/concepts/compaction.md +61 -0
- package/docs/concepts/context.md +161 -0
- package/docs/concepts/features.md +53 -0
- package/docs/concepts/markdown-formatting.md +130 -0
- package/docs/concepts/memory.md +556 -0
- package/docs/concepts/messages.md +154 -0
- package/docs/concepts/model-failover.md +149 -0
- package/docs/concepts/model-providers.md +316 -0
- package/docs/concepts/models.md +208 -0
- package/docs/concepts/multi-agent.md +376 -0
- package/docs/concepts/oauth.md +145 -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 +122 -0
- package/docs/concepts/session-tool.md +193 -0
- package/docs/concepts/session.md +204 -0
- package/docs/concepts/sessions.md +10 -0
- package/docs/concepts/streaming.md +135 -0
- package/docs/concepts/system-prompt.md +115 -0
- package/docs/concepts/timezone.md +91 -0
- package/docs/concepts/typebox.md +289 -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 +1802 -0
- package/docs/experiments/onboarding-config-protocol.md +40 -0
- package/docs/experiments/plans/cron-add-hardening.md +63 -0
- package/docs/experiments/plans/group-policy-hardening.md +40 -0
- package/docs/experiments/plans/openresponses-gateway.md +123 -0
- package/docs/experiments/proposals/model-config.md +36 -0
- package/docs/experiments/research/memory.md +228 -0
- package/docs/gateway/authentication.md +145 -0
- package/docs/gateway/background-process.md +93 -0
- package/docs/gateway/bonjour.md +170 -0
- package/docs/gateway/bridge-protocol.md +89 -0
- package/docs/gateway/cli-backends.md +225 -0
- package/docs/gateway/configuration-examples.md +606 -0
- package/docs/gateway/configuration.md +3416 -0
- package/docs/gateway/discovery.md +116 -0
- package/docs/gateway/doctor.md +282 -0
- package/docs/gateway/gateway-lock.md +34 -0
- package/docs/gateway/health.md +35 -0
- package/docs/gateway/heartbeat.md +364 -0
- package/docs/gateway/index.md +330 -0
- package/docs/gateway/local-models.md +150 -0
- package/docs/gateway/logging.md +113 -0
- package/docs/gateway/multiple-gateways.md +112 -0
- package/docs/gateway/network-model.md +17 -0
- package/docs/gateway/openai-http-api.md +118 -0
- package/docs/gateway/openresponses-http-api.md +317 -0
- package/docs/gateway/pairing.md +99 -0
- package/docs/gateway/protocol.md +221 -0
- package/docs/gateway/remote-gateway-readme.md +157 -0
- package/docs/gateway/remote.md +129 -0
- package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +128 -0
- package/docs/gateway/sandboxing.md +193 -0
- package/docs/gateway/security/index.md +829 -0
- package/docs/gateway/tailscale.md +127 -0
- package/docs/gateway/tools-invoke-http-api.md +85 -0
- package/docs/gateway/troubleshooting.md +318 -0
- package/docs/help/debugging.md +162 -0
- package/docs/help/environment.md +81 -0
- package/docs/help/faq.md +2848 -0
- package/docs/help/index.md +21 -0
- package/docs/help/scripts.md +28 -0
- package/docs/help/submitting-a-pr.md +398 -0
- package/docs/help/submitting-an-issue.md +152 -0
- package/docs/help/testing.md +368 -0
- package/docs/help/troubleshooting.md +265 -0
- package/docs/hooks/soul-evil.md +69 -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/groups-flow.svg +52 -0
- package/docs/images/mobile-ui-screenshot.png +0 -0
- package/docs/index.md +192 -0
- package/docs/install/ansible.md +208 -0
- package/docs/install/bun.md +59 -0
- package/docs/install/development-channels.md +75 -0
- package/docs/install/docker.md +567 -0
- package/docs/install/exe-dev.md +126 -0
- package/docs/install/fly.md +486 -0
- package/docs/install/gcp.md +504 -0
- package/docs/install/hetzner.md +330 -0
- package/docs/install/index.md +203 -0
- package/docs/install/installer.md +385 -0
- package/docs/install/macos-vm.md +281 -0
- package/docs/install/migrating.md +192 -0
- package/docs/install/nix.md +96 -0
- package/docs/install/node.md +138 -0
- package/docs/install/northflank.mdx +53 -0
- package/docs/install/railway.mdx +99 -0
- package/docs/install/render.mdx +159 -0
- package/docs/install/uninstall.md +128 -0
- package/docs/install/updating.md +231 -0
- package/docs/logging.md +350 -0
- package/docs/network.md +54 -0
- package/docs/nodes/audio.md +114 -0
- package/docs/nodes/camera.md +156 -0
- package/docs/nodes/images.md +72 -0
- package/docs/nodes/index.md +342 -0
- package/docs/nodes/location-command.md +113 -0
- package/docs/nodes/media-understanding.md +379 -0
- package/docs/nodes/talk.md +90 -0
- package/docs/nodes/troubleshooting.md +112 -0
- package/docs/nodes/voicewake.md +65 -0
- package/docs/perplexity.md +80 -0
- package/docs/pi-dev.md +70 -0
- package/docs/pi.md +612 -0
- package/docs/platforms/android.md +151 -0
- package/docs/platforms/digitalocean.md +262 -0
- package/docs/platforms/index.md +53 -0
- package/docs/platforms/ios.md +107 -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/release.md +85 -0
- package/docs/platforms/mac/remote.md +83 -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 +203 -0
- package/docs/platforms/oracle.md +303 -0
- package/docs/platforms/raspberry-pi.md +358 -0
- package/docs/platforms/windows.md +159 -0
- package/docs/plugins/agent-tools.md +99 -0
- package/docs/plugins/manifest.md +71 -0
- package/docs/plugins/voice-call.md +284 -0
- package/docs/plugins/zalouser.md +81 -0
- package/docs/prose.md +134 -0
- package/docs/providers/anthropic.md +152 -0
- package/docs/providers/bedrock.md +176 -0
- package/docs/providers/claude-max-api-proxy.md +148 -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 +33 -0
- package/docs/providers/index.md +64 -0
- package/docs/providers/minimax.md +208 -0
- package/docs/providers/models.md +52 -0
- package/docs/providers/moonshot.md +142 -0
- package/docs/providers/ollama.md +277 -0
- package/docs/providers/openai.md +62 -0
- package/docs/providers/opencode.md +36 -0
- package/docs/providers/openrouter.md +37 -0
- package/docs/providers/qianfan.md +38 -0
- package/docs/providers/qwen.md +53 -0
- package/docs/providers/synthetic.md +99 -0
- package/docs/providers/venice.md +267 -0
- package/docs/providers/vercel-ai-gateway.md +50 -0
- package/docs/providers/xiaomi.md +64 -0
- package/docs/providers/zai.md +36 -0
- package/docs/refactor/clawnet.md +417 -0
- package/docs/refactor/exec-host.md +316 -0
- package/docs/refactor/outbound-session-mirroring.md +85 -0
- package/docs/refactor/plugin-sdk.md +214 -0
- package/docs/refactor/strict-config.md +93 -0
- package/docs/reference/AGENTS.default.md +123 -0
- package/docs/reference/RELEASING.md +120 -0
- package/docs/reference/api-usage-costs.md +138 -0
- package/docs/reference/credits.md +27 -0
- package/docs/reference/device-models.md +47 -0
- package/docs/reference/rpc.md +43 -0
- package/docs/reference/session-management-compaction.md +285 -0
- package/docs/reference/templates/AGENTS.dev.md +83 -0
- package/docs/reference/templates/AGENTS.md +218 -0
- package/docs/reference/templates/BOOT.md +10 -0
- package/docs/reference/templates/BOOTSTRAP.md +61 -0
- package/docs/reference/templates/HEARTBEAT.md +11 -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 +42 -0
- package/docs/reference/templates/TOOLS.dev.md +24 -0
- package/docs/reference/templates/TOOLS.md +46 -0
- package/docs/reference/templates/USER.dev.md +18 -0
- package/docs/reference/templates/USER.md +23 -0
- package/docs/reference/test.md +50 -0
- package/docs/reference/token-use.md +112 -0
- package/docs/reference/transcript-hygiene.md +129 -0
- package/docs/reference/wizard.md +269 -0
- package/docs/security/formal-verification.md +164 -0
- package/docs/start/bootstrapping.md +41 -0
- package/docs/start/docs-directory.md +64 -0
- package/docs/start/getting-started.md +120 -0
- package/docs/start/hubs.md +197 -0
- package/docs/start/lore.md +219 -0
- package/docs/start/onboarding.md +80 -0
- package/docs/start/openclaw.md +224 -0
- package/docs/start/quickstart.md +22 -0
- package/docs/start/setup.md +162 -0
- package/docs/start/showcase.md +416 -0
- package/docs/start/wizard-cli-automation.md +141 -0
- package/docs/start/wizard-cli-reference.md +247 -0
- package/docs/start/wizard.md +108 -0
- package/docs/style.css +3 -0
- package/docs/tools/agent-send.md +53 -0
- package/docs/tools/apply-patch.md +50 -0
- package/docs/tools/browser-linux-troubleshooting.md +139 -0
- package/docs/tools/browser-login.md +67 -0
- package/docs/tools/browser.md +576 -0
- package/docs/tools/chrome-extension.md +178 -0
- package/docs/tools/clawhub.md +257 -0
- package/docs/tools/creating-skills.md +54 -0
- package/docs/tools/elevated.md +57 -0
- package/docs/tools/exec-approvals.md +246 -0
- package/docs/tools/exec.md +179 -0
- package/docs/tools/firecrawl.md +61 -0
- package/docs/tools/index.md +512 -0
- package/docs/tools/llm-task.md +115 -0
- package/docs/tools/lobster.md +342 -0
- package/docs/tools/multi-agent-sandbox-tools.md +396 -0
- package/docs/tools/plugin.md +664 -0
- package/docs/tools/reactions.md +22 -0
- package/docs/tools/skills-config.md +76 -0
- package/docs/tools/skills.md +300 -0
- package/docs/tools/slash-commands.md +198 -0
- package/docs/tools/subagents.md +151 -0
- package/docs/tools/thinking.md +74 -0
- package/docs/tools/web.md +261 -0
- package/docs/tts.md +396 -0
- package/docs/vps.md +43 -0
- package/docs/web/control-ui.md +223 -0
- package/docs/web/dashboard.md +46 -0
- package/docs/web/index.md +116 -0
- package/docs/web/tui.md +162 -0
- package/docs/web/webchat.md +49 -0
- package/docs/whatsapp-openclaw-ai-zh.jpg +0 -0
- package/docs/whatsapp-openclaw.jpg +0 -0
- package/docs/zh-CN/AGENTS.md +59 -0
- package/docs/zh-CN/automation/auth-monitoring.md +47 -0
- package/docs/zh-CN/automation/cron-jobs.md +424 -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 +919 -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 +48 -0
- package/docs/zh-CN/channels/bluebubbles.md +271 -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 +629 -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 +240 -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/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 +311 -0
- package/docs/zh-CN/cli/index.md +1032 -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 +36 -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 +320 -0
- package/docs/zh-CN/concepts/models.md +196 -0
- package/docs/zh-CN/concepts/multi-agent.md +372 -0
- package/docs/zh-CN/concepts/oauth.md +151 -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/sessions.md +17 -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/experiments/onboarding-config-protocol.md +47 -0
- package/docs/zh-CN/experiments/plans/cron-add-hardening.md +70 -0
- package/docs/zh-CN/experiments/plans/group-policy-hardening.md +45 -0
- package/docs/zh-CN/experiments/plans/openresponses-gateway.md +121 -0
- package/docs/zh-CN/experiments/proposals/model-config.md +42 -0
- package/docs/zh-CN/experiments/research/memory.md +235 -0
- package/docs/zh-CN/gateway/authentication.md +142 -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.md +3332 -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 +157 -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 +2628 -0
- package/docs/zh-CN/help/index.md +28 -0
- package/docs/zh-CN/help/scripts.md +35 -0
- package/docs/zh-CN/help/submitting-a-pr.md +8 -0
- package/docs/zh-CN/help/submitting-an-issue.md +8 -0
- package/docs/zh-CN/help/testing.md +375 -0
- package/docs/zh-CN/help/troubleshooting.md +104 -0
- package/docs/zh-CN/hooks/soul-evil.md +72 -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 +127 -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 +193 -0
- package/docs/zh-CN/install/installer.md +128 -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 +84 -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 +269 -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 +101 -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/release.md +92 -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 +365 -0
- package/docs/zh-CN/platforms/windows.md +156 -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 +159 -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/deepgram.md +97 -0
- package/docs/zh-CN/providers/github-copilot.md +67 -0
- package/docs/zh-CN/providers/glm.md +39 -0
- package/docs/zh-CN/providers/index.md +68 -0
- package/docs/zh-CN/providers/minimax.md +206 -0
- package/docs/zh-CN/providers/models.md +55 -0
- package/docs/zh-CN/providers/moonshot.md +145 -0
- package/docs/zh-CN/providers/ollama.md +230 -0
- package/docs/zh-CN/providers/openai.md +68 -0
- package/docs/zh-CN/providers/opencode.md +41 -0
- package/docs/zh-CN/providers/openrouter.md +43 -0
- package/docs/zh-CN/providers/qianfan.md +8 -0
- package/docs/zh-CN/providers/qwen.md +55 -0
- package/docs/zh-CN/providers/synthetic.md +102 -0
- package/docs/zh-CN/providers/venice.md +274 -0
- package/docs/zh-CN/providers/vercel-ai-gateway.md +57 -0
- package/docs/zh-CN/providers/xiaomi.md +68 -0
- package/docs/zh-CN/providers/zai.md +41 -0
- package/docs/zh-CN/refactor/clawnet.md +424 -0
- package/docs/zh-CN/refactor/exec-host.md +323 -0
- package/docs/zh-CN/refactor/outbound-session-mirroring.md +92 -0
- package/docs/zh-CN/refactor/plugin-sdk.md +221 -0
- package/docs/zh-CN/refactor/strict-config.md +100 -0
- package/docs/zh-CN/reference/AGENTS.default.md +131 -0
- package/docs/zh-CN/reference/RELEASING.md +123 -0
- package/docs/zh-CN/reference/api-usage-costs.md +136 -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 +9 -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 +206 -0
- package/docs/zh-CN/start/hubs.md +200 -0
- package/docs/zh-CN/start/lore.md +226 -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.md +331 -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 +639 -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 +156 -0
- package/docs/zh-CN/tools/thinking.md +80 -0
- package/docs/zh-CN/tools/web.md +257 -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/extensions/bluebubbles/README.md +45 -0
- package/extensions/bluebubbles/index.ts +19 -0
- package/extensions/bluebubbles/node_modules/.bin/openclaw +21 -0
- package/extensions/bluebubbles/openclaw.plugin.json +9 -0
- package/extensions/bluebubbles/package.json +36 -0
- package/extensions/bluebubbles/src/accounts.ts +88 -0
- package/extensions/bluebubbles/src/actions.test.ts +650 -0
- package/extensions/bluebubbles/src/actions.ts +438 -0
- package/extensions/bluebubbles/src/attachments.test.ts +345 -0
- package/extensions/bluebubbles/src/attachments.ts +302 -0
- package/extensions/bluebubbles/src/channel.ts +414 -0
- package/extensions/bluebubbles/src/chat.test.ts +461 -0
- package/extensions/bluebubbles/src/chat.ts +382 -0
- package/extensions/bluebubbles/src/config-schema.ts +51 -0
- package/extensions/bluebubbles/src/media-send.ts +174 -0
- package/extensions/bluebubbles/src/monitor.test.ts +2384 -0
- package/extensions/bluebubbles/src/monitor.ts +2517 -0
- package/extensions/bluebubbles/src/onboarding.ts +352 -0
- package/extensions/bluebubbles/src/probe.ts +144 -0
- package/extensions/bluebubbles/src/reactions.test.ts +392 -0
- package/extensions/bluebubbles/src/reactions.ts +188 -0
- package/extensions/bluebubbles/src/runtime.ts +14 -0
- package/extensions/bluebubbles/src/send.test.ts +889 -0
- package/extensions/bluebubbles/src/send.ts +474 -0
- package/extensions/bluebubbles/src/targets.test.ts +183 -0
- package/extensions/bluebubbles/src/targets.ts +422 -0
- package/extensions/bluebubbles/src/types.ts +127 -0
- package/extensions/copilot-proxy/README.md +24 -0
- package/extensions/copilot-proxy/index.ts +149 -0
- package/extensions/copilot-proxy/node_modules/.bin/openclaw +21 -0
- package/extensions/copilot-proxy/openclaw.plugin.json +9 -0
- package/extensions/copilot-proxy/package.json +14 -0
- package/extensions/diagnostics-otel/index.ts +15 -0
- package/extensions/diagnostics-otel/node_modules/.bin/acorn +21 -0
- package/extensions/diagnostics-otel/node_modules/.bin/openclaw +21 -0
- package/extensions/diagnostics-otel/openclaw.plugin.json +8 -0
- package/extensions/diagnostics-otel/package.json +27 -0
- package/extensions/diagnostics-otel/src/service.test.ts +226 -0
- package/extensions/diagnostics-otel/src/service.ts +635 -0
- package/extensions/discord/index.ts +17 -0
- package/extensions/discord/node_modules/.bin/openclaw +21 -0
- package/extensions/discord/openclaw.plugin.json +9 -0
- package/extensions/discord/package.json +14 -0
- package/extensions/discord/src/channel.ts +422 -0
- package/extensions/discord/src/runtime.ts +14 -0
- package/extensions/feishu/index.ts +63 -0
- package/extensions/feishu/node_modules/.bin/openclaw +21 -0
- package/extensions/feishu/openclaw.plugin.json +10 -0
- package/extensions/feishu/package.json +37 -0
- package/extensions/feishu/skills/feishu-doc/SKILL.md +105 -0
- package/extensions/feishu/skills/feishu-doc/references/block-types.md +103 -0
- package/extensions/feishu/skills/feishu-drive/SKILL.md +97 -0
- package/extensions/feishu/skills/feishu-perm/SKILL.md +119 -0
- package/extensions/feishu/skills/feishu-wiki/SKILL.md +111 -0
- package/extensions/feishu/src/accounts.ts +144 -0
- package/extensions/feishu/src/bitable.ts +459 -0
- package/extensions/feishu/src/bot.ts +871 -0
- package/extensions/feishu/src/channel.ts +341 -0
- package/extensions/feishu/src/client.ts +118 -0
- package/extensions/feishu/src/config-schema.ts +172 -0
- package/extensions/feishu/src/directory.ts +177 -0
- package/extensions/feishu/src/doc-schema.ts +47 -0
- package/extensions/feishu/src/docx.ts +521 -0
- package/extensions/feishu/src/drive-schema.ts +46 -0
- package/extensions/feishu/src/drive.ts +227 -0
- package/extensions/feishu/src/media.ts +527 -0
- package/extensions/feishu/src/mention.ts +126 -0
- package/extensions/feishu/src/monitor.ts +190 -0
- package/extensions/feishu/src/onboarding.ts +356 -0
- package/extensions/feishu/src/outbound.ts +40 -0
- package/extensions/feishu/src/perm-schema.ts +52 -0
- package/extensions/feishu/src/perm.ts +173 -0
- package/extensions/feishu/src/policy.ts +104 -0
- package/extensions/feishu/src/probe.ts +44 -0
- package/extensions/feishu/src/reactions.ts +160 -0
- package/extensions/feishu/src/reply-dispatcher.ts +184 -0
- package/extensions/feishu/src/runtime.ts +14 -0
- package/extensions/feishu/src/send.ts +358 -0
- package/extensions/feishu/src/targets.ts +78 -0
- package/extensions/feishu/src/tools-config.ts +21 -0
- package/extensions/feishu/src/types.ts +75 -0
- package/extensions/feishu/src/typing.ts +80 -0
- package/extensions/feishu/src/wiki-schema.ts +55 -0
- package/extensions/feishu/src/wiki.ts +232 -0
- package/extensions/google-antigravity-auth/README.md +24 -0
- package/extensions/google-antigravity-auth/index.ts +461 -0
- package/extensions/google-antigravity-auth/node_modules/.bin/openclaw +21 -0
- package/extensions/google-antigravity-auth/openclaw.plugin.json +9 -0
- package/extensions/google-antigravity-auth/package.json +14 -0
- package/extensions/google-gemini-cli-auth/README.md +35 -0
- package/extensions/google-gemini-cli-auth/index.ts +88 -0
- package/extensions/google-gemini-cli-auth/node_modules/.bin/openclaw +21 -0
- package/extensions/google-gemini-cli-auth/oauth.test.ts +240 -0
- package/extensions/google-gemini-cli-auth/oauth.ts +662 -0
- package/extensions/google-gemini-cli-auth/openclaw.plugin.json +9 -0
- package/extensions/google-gemini-cli-auth/package.json +14 -0
- package/extensions/googlechat/index.ts +19 -0
- package/extensions/googlechat/node_modules/.bin/openclaw +21 -0
- package/extensions/googlechat/openclaw.plugin.json +9 -0
- package/extensions/googlechat/package.json +39 -0
- package/extensions/googlechat/src/accounts.ts +147 -0
- package/extensions/googlechat/src/actions.ts +181 -0
- package/extensions/googlechat/src/api.test.ts +61 -0
- package/extensions/googlechat/src/api.ts +282 -0
- package/extensions/googlechat/src/auth.ts +137 -0
- package/extensions/googlechat/src/channel.ts +583 -0
- package/extensions/googlechat/src/monitor.test.ts +22 -0
- package/extensions/googlechat/src/monitor.ts +960 -0
- package/extensions/googlechat/src/onboarding.ts +269 -0
- package/extensions/googlechat/src/runtime.ts +14 -0
- package/extensions/googlechat/src/targets.test.ts +32 -0
- package/extensions/googlechat/src/targets.ts +65 -0
- package/extensions/googlechat/src/types.config.ts +3 -0
- package/extensions/googlechat/src/types.ts +73 -0
- package/extensions/imessage/index.ts +17 -0
- package/extensions/imessage/node_modules/.bin/openclaw +21 -0
- package/extensions/imessage/openclaw.plugin.json +9 -0
- package/extensions/imessage/package.json +14 -0
- package/extensions/imessage/src/channel.ts +294 -0
- package/extensions/imessage/src/runtime.ts +14 -0
- package/extensions/line/index.ts +19 -0
- package/extensions/line/node_modules/.bin/openclaw +21 -0
- package/extensions/line/openclaw.plugin.json +9 -0
- package/extensions/line/package.json +29 -0
- package/extensions/line/src/card-command.ts +344 -0
- package/extensions/line/src/channel.logout.test.ts +99 -0
- package/extensions/line/src/channel.sendPayload.test.ts +306 -0
- package/extensions/line/src/channel.ts +780 -0
- package/extensions/line/src/runtime.ts +14 -0
- package/extensions/llm-task/README.md +97 -0
- package/extensions/llm-task/index.ts +6 -0
- package/extensions/llm-task/node_modules/.bin/openclaw +21 -0
- package/extensions/llm-task/openclaw.plugin.json +21 -0
- package/extensions/llm-task/package.json +14 -0
- package/extensions/llm-task/src/llm-task-tool.test.ts +138 -0
- package/extensions/llm-task/src/llm-task-tool.ts +245 -0
- package/extensions/lobster/README.md +75 -0
- package/extensions/lobster/SKILL.md +97 -0
- package/extensions/lobster/index.ts +14 -0
- package/extensions/lobster/node_modules/.bin/openclaw +21 -0
- package/extensions/lobster/openclaw.plugin.json +10 -0
- package/extensions/lobster/package.json +14 -0
- package/extensions/lobster/src/lobster-tool.test.ts +247 -0
- package/extensions/lobster/src/lobster-tool.ts +328 -0
- package/extensions/matrix/CHANGELOG.md +111 -0
- package/extensions/matrix/index.ts +17 -0
- package/extensions/matrix/node_modules/.bin/markdown-it +21 -0
- package/extensions/matrix/node_modules/.bin/openclaw +21 -0
- package/extensions/matrix/openclaw.plugin.json +9 -0
- package/extensions/matrix/package.json +36 -0
- package/extensions/matrix/src/actions.ts +195 -0
- package/extensions/matrix/src/channel.directory.test.ts +64 -0
- package/extensions/matrix/src/channel.ts +439 -0
- package/extensions/matrix/src/config-schema.ts +63 -0
- package/extensions/matrix/src/directory-live.ts +188 -0
- package/extensions/matrix/src/group-mentions.ts +66 -0
- package/extensions/matrix/src/matrix/accounts.test.ts +82 -0
- package/extensions/matrix/src/matrix/accounts.ts +65 -0
- package/extensions/matrix/src/matrix/actions/client.ts +57 -0
- package/extensions/matrix/src/matrix/actions/messages.ts +128 -0
- package/extensions/matrix/src/matrix/actions/pins.ts +76 -0
- package/extensions/matrix/src/matrix/actions/reactions.ts +96 -0
- package/extensions/matrix/src/matrix/actions/room.ts +85 -0
- package/extensions/matrix/src/matrix/actions/summary.ts +75 -0
- package/extensions/matrix/src/matrix/actions/types.ts +84 -0
- package/extensions/matrix/src/matrix/actions.ts +15 -0
- package/extensions/matrix/src/matrix/active-client.ts +11 -0
- package/extensions/matrix/src/matrix/client/config.ts +160 -0
- package/extensions/matrix/src/matrix/client/create-client.ts +123 -0
- package/extensions/matrix/src/matrix/client/logging.ts +36 -0
- package/extensions/matrix/src/matrix/client/runtime.ts +4 -0
- package/extensions/matrix/src/matrix/client/shared.ts +170 -0
- package/extensions/matrix/src/matrix/client/storage.ts +131 -0
- package/extensions/matrix/src/matrix/client/types.ts +34 -0
- package/extensions/matrix/src/matrix/client.test.ts +56 -0
- package/extensions/matrix/src/matrix/client.ts +5 -0
- package/extensions/matrix/src/matrix/credentials.ts +105 -0
- package/extensions/matrix/src/matrix/deps.ts +60 -0
- package/extensions/matrix/src/matrix/format.test.ts +33 -0
- package/extensions/matrix/src/matrix/format.ts +22 -0
- package/extensions/matrix/src/matrix/index.ts +11 -0
- package/extensions/matrix/src/matrix/monitor/allowlist.test.ts +45 -0
- package/extensions/matrix/src/matrix/monitor/allowlist.ts +103 -0
- package/extensions/matrix/src/matrix/monitor/auto-join.ts +71 -0
- package/extensions/matrix/src/matrix/monitor/direct.ts +104 -0
- package/extensions/matrix/src/matrix/monitor/events.ts +101 -0
- package/extensions/matrix/src/matrix/monitor/handler.ts +665 -0
- package/extensions/matrix/src/matrix/monitor/index.ts +338 -0
- package/extensions/matrix/src/matrix/monitor/location.ts +100 -0
- package/extensions/matrix/src/matrix/monitor/media.test.ts +102 -0
- package/extensions/matrix/src/matrix/monitor/media.ts +113 -0
- package/extensions/matrix/src/matrix/monitor/mentions.ts +31 -0
- package/extensions/matrix/src/matrix/monitor/replies.ts +97 -0
- package/extensions/matrix/src/matrix/monitor/room-info.ts +55 -0
- package/extensions/matrix/src/matrix/monitor/rooms.test.ts +39 -0
- package/extensions/matrix/src/matrix/monitor/rooms.ts +47 -0
- package/extensions/matrix/src/matrix/monitor/threads.ts +68 -0
- package/extensions/matrix/src/matrix/monitor/types.ts +39 -0
- package/extensions/matrix/src/matrix/poll-types.test.ts +21 -0
- package/extensions/matrix/src/matrix/poll-types.ts +166 -0
- package/extensions/matrix/src/matrix/probe.ts +70 -0
- package/extensions/matrix/src/matrix/send/client.ts +66 -0
- package/extensions/matrix/src/matrix/send/formatting.ts +89 -0
- package/extensions/matrix/src/matrix/send/media.ts +229 -0
- package/extensions/matrix/src/matrix/send/targets.test.ts +98 -0
- package/extensions/matrix/src/matrix/send/targets.ts +147 -0
- package/extensions/matrix/src/matrix/send/types.ts +109 -0
- package/extensions/matrix/src/matrix/send.test.ts +171 -0
- package/extensions/matrix/src/matrix/send.ts +260 -0
- package/extensions/matrix/src/onboarding.ts +449 -0
- package/extensions/matrix/src/outbound.ts +52 -0
- package/extensions/matrix/src/resolve-targets.test.ts +48 -0
- package/extensions/matrix/src/resolve-targets.ts +135 -0
- package/extensions/matrix/src/runtime.ts +14 -0
- package/extensions/matrix/src/tool-actions.ts +164 -0
- package/extensions/matrix/src/types.ts +97 -0
- package/extensions/mattermost/index.ts +17 -0
- package/extensions/mattermost/node_modules/.bin/openclaw +21 -0
- package/extensions/mattermost/openclaw.plugin.json +9 -0
- package/extensions/mattermost/package.json +28 -0
- package/extensions/mattermost/src/channel.test.ts +72 -0
- package/extensions/mattermost/src/channel.ts +337 -0
- package/extensions/mattermost/src/config-schema.ts +56 -0
- package/extensions/mattermost/src/group-mentions.ts +15 -0
- package/extensions/mattermost/src/mattermost/accounts.ts +128 -0
- package/extensions/mattermost/src/mattermost/client.ts +220 -0
- package/extensions/mattermost/src/mattermost/index.ts +9 -0
- package/extensions/mattermost/src/mattermost/monitor-helpers.ts +166 -0
- package/extensions/mattermost/src/mattermost/monitor.ts +991 -0
- package/extensions/mattermost/src/mattermost/probe.ts +74 -0
- package/extensions/mattermost/src/mattermost/send.ts +231 -0
- package/extensions/mattermost/src/normalize.ts +46 -0
- package/extensions/mattermost/src/onboarding-helpers.ts +44 -0
- package/extensions/mattermost/src/onboarding.ts +186 -0
- package/extensions/mattermost/src/runtime.ts +14 -0
- package/extensions/mattermost/src/types.ts +52 -0
- package/extensions/memory-core/index.ts +38 -0
- package/extensions/memory-core/node_modules/.bin/openclaw +21 -0
- package/extensions/memory-core/openclaw.plugin.json +9 -0
- package/extensions/memory-core/package.json +17 -0
- package/extensions/memory-lancedb/config.ts +139 -0
- package/extensions/memory-lancedb/index.test.ts +253 -0
- package/extensions/memory-lancedb/index.ts +622 -0
- package/extensions/memory-lancedb/node_modules/.bin/arrow2csv +21 -0
- package/extensions/memory-lancedb/node_modules/.bin/openai +21 -0
- package/extensions/memory-lancedb/node_modules/.bin/openclaw +21 -0
- package/extensions/memory-lancedb/openclaw.plugin.json +60 -0
- package/extensions/memory-lancedb/package.json +19 -0
- package/extensions/minimax-portal-auth/README.md +33 -0
- package/extensions/minimax-portal-auth/index.ts +155 -0
- package/extensions/minimax-portal-auth/node_modules/.bin/openclaw +21 -0
- package/extensions/minimax-portal-auth/oauth.ts +247 -0
- package/extensions/minimax-portal-auth/openclaw.plugin.json +9 -0
- package/extensions/minimax-portal-auth/package.json +14 -0
- package/extensions/msteams/CHANGELOG.md +107 -0
- package/extensions/msteams/index.ts +17 -0
- package/extensions/msteams/node_modules/.bin/openclaw +21 -0
- package/extensions/msteams/openclaw.plugin.json +9 -0
- package/extensions/msteams/package.json +39 -0
- package/extensions/msteams/src/attachments/download.ts +283 -0
- package/extensions/msteams/src/attachments/graph.ts +353 -0
- package/extensions/msteams/src/attachments/html.ts +90 -0
- package/extensions/msteams/src/attachments/payload.ts +22 -0
- package/extensions/msteams/src/attachments/shared.ts +291 -0
- package/extensions/msteams/src/attachments/types.ts +37 -0
- package/extensions/msteams/src/attachments.test.ts +459 -0
- package/extensions/msteams/src/attachments.ts +18 -0
- package/extensions/msteams/src/channel.directory.test.ts +48 -0
- package/extensions/msteams/src/channel.ts +459 -0
- package/extensions/msteams/src/conversation-store-fs.test.ts +88 -0
- package/extensions/msteams/src/conversation-store-fs.ts +165 -0
- package/extensions/msteams/src/conversation-store-memory.ts +47 -0
- package/extensions/msteams/src/conversation-store.ts +41 -0
- package/extensions/msteams/src/directory-live.ts +205 -0
- package/extensions/msteams/src/errors.test.ts +45 -0
- package/extensions/msteams/src/errors.ts +190 -0
- package/extensions/msteams/src/file-consent-helpers.test.ts +243 -0
- package/extensions/msteams/src/file-consent-helpers.ts +73 -0
- package/extensions/msteams/src/file-consent.ts +126 -0
- package/extensions/msteams/src/graph-chat.ts +53 -0
- package/extensions/msteams/src/graph-upload.ts +453 -0
- package/extensions/msteams/src/inbound.test.ts +66 -0
- package/extensions/msteams/src/inbound.ts +48 -0
- package/extensions/msteams/src/index.ts +4 -0
- package/extensions/msteams/src/media-helpers.test.ts +189 -0
- package/extensions/msteams/src/media-helpers.ts +86 -0
- package/extensions/msteams/src/messenger.test.ts +248 -0
- package/extensions/msteams/src/messenger.ts +495 -0
- package/extensions/msteams/src/monitor-handler/inbound-media.ts +128 -0
- package/extensions/msteams/src/monitor-handler/message-handler.ts +641 -0
- package/extensions/msteams/src/monitor-handler.ts +162 -0
- package/extensions/msteams/src/monitor-types.ts +5 -0
- package/extensions/msteams/src/monitor.ts +295 -0
- package/extensions/msteams/src/onboarding.ts +431 -0
- package/extensions/msteams/src/outbound.ts +46 -0
- package/extensions/msteams/src/pending-uploads.ts +89 -0
- package/extensions/msteams/src/policy.test.ts +209 -0
- package/extensions/msteams/src/policy.ts +273 -0
- package/extensions/msteams/src/polls-store-memory.ts +32 -0
- package/extensions/msteams/src/polls-store.test.ts +38 -0
- package/extensions/msteams/src/polls.test.ts +72 -0
- package/extensions/msteams/src/polls.ts +315 -0
- package/extensions/msteams/src/probe.test.ts +58 -0
- package/extensions/msteams/src/probe.ts +107 -0
- package/extensions/msteams/src/reply-dispatcher.ts +132 -0
- package/extensions/msteams/src/resolve-allowlist.ts +297 -0
- package/extensions/msteams/src/runtime.ts +14 -0
- package/extensions/msteams/src/sdk-types.ts +19 -0
- package/extensions/msteams/src/sdk.ts +33 -0
- package/extensions/msteams/src/send-context.ts +164 -0
- package/extensions/msteams/src/send.ts +519 -0
- package/extensions/msteams/src/sent-message-cache.test.ts +15 -0
- package/extensions/msteams/src/sent-message-cache.ts +47 -0
- package/extensions/msteams/src/storage.ts +25 -0
- package/extensions/msteams/src/store-fs.ts +83 -0
- package/extensions/msteams/src/token.ts +19 -0
- package/extensions/nextcloud-talk/index.ts +17 -0
- package/extensions/nextcloud-talk/node_modules/.bin/openclaw +21 -0
- package/extensions/nextcloud-talk/openclaw.plugin.json +9 -0
- package/extensions/nextcloud-talk/package.json +33 -0
- package/extensions/nextcloud-talk/src/accounts.ts +174 -0
- package/extensions/nextcloud-talk/src/channel.ts +409 -0
- package/extensions/nextcloud-talk/src/config-schema.ts +79 -0
- package/extensions/nextcloud-talk/src/format.ts +79 -0
- package/extensions/nextcloud-talk/src/inbound.ts +327 -0
- package/extensions/nextcloud-talk/src/monitor.ts +246 -0
- package/extensions/nextcloud-talk/src/normalize.ts +39 -0
- package/extensions/nextcloud-talk/src/onboarding.ts +343 -0
- package/extensions/nextcloud-talk/src/policy.test.ts +33 -0
- package/extensions/nextcloud-talk/src/policy.ts +180 -0
- package/extensions/nextcloud-talk/src/room-info.ts +125 -0
- package/extensions/nextcloud-talk/src/runtime.ts +14 -0
- package/extensions/nextcloud-talk/src/send.ts +215 -0
- package/extensions/nextcloud-talk/src/signature.ts +72 -0
- package/extensions/nextcloud-talk/src/types.ts +181 -0
- package/extensions/nostr/CHANGELOG.md +98 -0
- package/extensions/nostr/README.md +136 -0
- package/extensions/nostr/index.ts +68 -0
- package/extensions/nostr/node_modules/.bin/openclaw +21 -0
- package/extensions/nostr/node_modules/.bin/tsc +21 -0
- package/extensions/nostr/node_modules/.bin/tsserver +21 -0
- package/extensions/nostr/openclaw.plugin.json +9 -0
- package/extensions/nostr/package.json +34 -0
- package/extensions/nostr/src/channel.test.ts +151 -0
- package/extensions/nostr/src/channel.ts +353 -0
- package/extensions/nostr/src/config-schema.ts +90 -0
- package/extensions/nostr/src/metrics.ts +478 -0
- package/extensions/nostr/src/nostr-bus.fuzz.test.ts +533 -0
- package/extensions/nostr/src/nostr-bus.integration.test.ts +448 -0
- package/extensions/nostr/src/nostr-bus.test.ts +199 -0
- package/extensions/nostr/src/nostr-bus.ts +715 -0
- package/extensions/nostr/src/nostr-profile-http.test.ts +378 -0
- package/extensions/nostr/src/nostr-profile-http.ts +546 -0
- package/extensions/nostr/src/nostr-profile-import.test.ts +119 -0
- package/extensions/nostr/src/nostr-profile-import.ts +262 -0
- package/extensions/nostr/src/nostr-profile.fuzz.test.ts +477 -0
- package/extensions/nostr/src/nostr-profile.test.ts +410 -0
- package/extensions/nostr/src/nostr-profile.ts +277 -0
- package/extensions/nostr/src/nostr-state-store.test.ts +131 -0
- package/extensions/nostr/src/nostr-state-store.ts +226 -0
- package/extensions/nostr/src/runtime.ts +14 -0
- package/extensions/nostr/src/seen-tracker.ts +303 -0
- package/extensions/nostr/src/types.test.ts +157 -0
- package/extensions/nostr/src/types.ts +101 -0
- package/extensions/nostr/test/setup.ts +5 -0
- package/extensions/open-prose/README.md +25 -0
- package/extensions/open-prose/index.ts +5 -0
- package/extensions/open-prose/node_modules/.bin/openclaw +21 -0
- package/extensions/open-prose/openclaw.plugin.json +11 -0
- package/extensions/open-prose/package.json +14 -0
- package/extensions/open-prose/skills/prose/LICENSE +21 -0
- package/extensions/open-prose/skills/prose/SKILL.md +323 -0
- package/extensions/open-prose/skills/prose/alt-borges.md +141 -0
- package/extensions/open-prose/skills/prose/alts/arabian-nights.md +358 -0
- package/extensions/open-prose/skills/prose/alts/borges.md +360 -0
- package/extensions/open-prose/skills/prose/alts/folk.md +322 -0
- package/extensions/open-prose/skills/prose/alts/homer.md +346 -0
- package/extensions/open-prose/skills/prose/alts/kafka.md +373 -0
- package/extensions/open-prose/skills/prose/compiler.md +2971 -0
- package/extensions/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
- package/extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
- package/extensions/open-prose/skills/prose/examples/03-code-review.prose +17 -0
- package/extensions/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
- package/extensions/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
- package/extensions/open-prose/skills/prose/examples/07-refactor.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
- package/extensions/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
- package/extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
- package/extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
- package/extensions/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
- package/extensions/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
- package/extensions/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
- package/extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
- package/extensions/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
- package/extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
- package/extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
- package/extensions/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
- package/extensions/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
- package/extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
- package/extensions/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
- package/extensions/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
- package/extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
- package/extensions/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
- package/extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
- package/extensions/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
- package/extensions/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
- package/extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
- package/extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
- package/extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
- package/extensions/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
- package/extensions/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
- package/extensions/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
- package/extensions/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
- package/extensions/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
- package/extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
- package/extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
- package/extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
- package/extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
- package/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
- package/extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
- package/extensions/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
- package/extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
- package/extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
- package/extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
- package/extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
- package/extensions/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
- package/extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
- package/extensions/open-prose/skills/prose/examples/README.md +391 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/README.md +22 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
- package/extensions/open-prose/skills/prose/guidance/antipatterns.md +951 -0
- package/extensions/open-prose/skills/prose/guidance/patterns.md +700 -0
- package/extensions/open-prose/skills/prose/guidance/system-prompt.md +180 -0
- package/extensions/open-prose/skills/prose/help.md +144 -0
- package/extensions/open-prose/skills/prose/lib/README.md +108 -0
- package/extensions/open-prose/skills/prose/lib/calibrator.prose +215 -0
- package/extensions/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
- package/extensions/open-prose/skills/prose/lib/error-forensics.prose +250 -0
- package/extensions/open-prose/skills/prose/lib/inspector.prose +196 -0
- package/extensions/open-prose/skills/prose/lib/profiler.prose +460 -0
- package/extensions/open-prose/skills/prose/lib/program-improver.prose +275 -0
- package/extensions/open-prose/skills/prose/lib/project-memory.prose +118 -0
- package/extensions/open-prose/skills/prose/lib/user-memory.prose +93 -0
- package/extensions/open-prose/skills/prose/lib/vm-improver.prose +243 -0
- package/extensions/open-prose/skills/prose/primitives/session.md +593 -0
- package/extensions/open-prose/skills/prose/prose.md +1237 -0
- package/extensions/open-prose/skills/prose/state/filesystem.md +498 -0
- package/extensions/open-prose/skills/prose/state/in-context.md +384 -0
- package/extensions/open-prose/skills/prose/state/postgres.md +880 -0
- package/extensions/open-prose/skills/prose/state/sqlite.md +574 -0
- package/extensions/qwen-portal-auth/README.md +24 -0
- package/extensions/qwen-portal-auth/index.ts +130 -0
- package/extensions/qwen-portal-auth/oauth.ts +190 -0
- package/extensions/qwen-portal-auth/openclaw.plugin.json +9 -0
- package/extensions/signal/index.ts +17 -0
- package/extensions/signal/node_modules/.bin/openclaw +21 -0
- package/extensions/signal/openclaw.plugin.json +9 -0
- package/extensions/signal/package.json +14 -0
- package/extensions/signal/src/channel.ts +315 -0
- package/extensions/signal/src/runtime.ts +14 -0
- package/extensions/slack/index.ts +17 -0
- package/extensions/slack/node_modules/.bin/openclaw +21 -0
- package/extensions/slack/openclaw.plugin.json +9 -0
- package/extensions/slack/package.json +14 -0
- package/extensions/slack/src/channel.ts +604 -0
- package/extensions/slack/src/runtime.ts +14 -0
- package/extensions/telegram/index.ts +17 -0
- package/extensions/telegram/node_modules/.bin/openclaw +21 -0
- package/extensions/telegram/openclaw.plugin.json +9 -0
- package/extensions/telegram/package.json +14 -0
- package/extensions/telegram/src/channel.ts +482 -0
- package/extensions/telegram/src/runtime.ts +14 -0
- package/extensions/tlon/README.md +5 -0
- package/extensions/tlon/index.ts +17 -0
- package/extensions/tlon/node_modules/.bin/openclaw +21 -0
- package/extensions/tlon/openclaw.plugin.json +9 -0
- package/extensions/tlon/package.json +33 -0
- package/extensions/tlon/src/channel.ts +392 -0
- package/extensions/tlon/src/config-schema.test.ts +31 -0
- package/extensions/tlon/src/config-schema.ts +45 -0
- package/extensions/tlon/src/monitor/discovery.ts +76 -0
- package/extensions/tlon/src/monitor/history.ts +90 -0
- package/extensions/tlon/src/monitor/index.ts +580 -0
- package/extensions/tlon/src/monitor/processed-messages.test.ts +23 -0
- package/extensions/tlon/src/monitor/processed-messages.ts +46 -0
- package/extensions/tlon/src/monitor/utils.ts +106 -0
- package/extensions/tlon/src/onboarding.ts +214 -0
- package/extensions/tlon/src/runtime.ts +14 -0
- package/extensions/tlon/src/targets.ts +89 -0
- package/extensions/tlon/src/types.ts +92 -0
- package/extensions/tlon/src/urbit/auth.ts +18 -0
- package/extensions/tlon/src/urbit/http-api.ts +38 -0
- package/extensions/tlon/src/urbit/send.test.ts +38 -0
- package/extensions/tlon/src/urbit/send.ts +131 -0
- package/extensions/tlon/src/urbit/sse-client.test.ts +40 -0
- package/extensions/tlon/src/urbit/sse-client.ts +395 -0
- package/extensions/twitch/CHANGELOG.md +69 -0
- package/extensions/twitch/README.md +89 -0
- package/extensions/twitch/index.ts +20 -0
- package/extensions/twitch/node_modules/.bin/openclaw +21 -0
- package/extensions/twitch/openclaw.plugin.json +9 -0
- package/extensions/twitch/package.json +20 -0
- package/extensions/twitch/src/access-control.test.ts +489 -0
- package/extensions/twitch/src/access-control.ts +166 -0
- package/extensions/twitch/src/actions.ts +173 -0
- package/extensions/twitch/src/client-manager-registry.ts +115 -0
- package/extensions/twitch/src/config-schema.ts +84 -0
- package/extensions/twitch/src/config.test.ts +87 -0
- package/extensions/twitch/src/config.ts +116 -0
- package/extensions/twitch/src/monitor.ts +272 -0
- package/extensions/twitch/src/onboarding.test.ts +311 -0
- package/extensions/twitch/src/onboarding.ts +417 -0
- package/extensions/twitch/src/outbound.test.ts +373 -0
- package/extensions/twitch/src/outbound.ts +184 -0
- package/extensions/twitch/src/plugin.test.ts +39 -0
- package/extensions/twitch/src/plugin.ts +274 -0
- package/extensions/twitch/src/probe.test.ts +195 -0
- package/extensions/twitch/src/probe.ts +120 -0
- package/extensions/twitch/src/resolver.ts +137 -0
- package/extensions/twitch/src/runtime.ts +14 -0
- package/extensions/twitch/src/send.test.ts +289 -0
- package/extensions/twitch/src/send.ts +136 -0
- package/extensions/twitch/src/status.test.ts +270 -0
- package/extensions/twitch/src/status.ts +178 -0
- package/extensions/twitch/src/token.test.ts +171 -0
- package/extensions/twitch/src/token.ts +91 -0
- package/extensions/twitch/src/twitch-client.test.ts +589 -0
- package/extensions/twitch/src/twitch-client.ts +277 -0
- package/extensions/twitch/src/types.ts +143 -0
- package/extensions/twitch/src/utils/markdown.ts +98 -0
- package/extensions/twitch/src/utils/twitch.ts +78 -0
- package/extensions/twitch/test/setup.ts +7 -0
- package/extensions/voice-call/CHANGELOG.md +133 -0
- package/extensions/voice-call/README.md +139 -0
- package/extensions/voice-call/index.ts +493 -0
- package/extensions/voice-call/node_modules/.bin/openclaw +21 -0
- package/extensions/voice-call/openclaw.plugin.json +559 -0
- package/extensions/voice-call/package.json +19 -0
- package/extensions/voice-call/src/allowlist.ts +19 -0
- package/extensions/voice-call/src/cli.ts +279 -0
- package/extensions/voice-call/src/config.test.ts +234 -0
- package/extensions/voice-call/src/config.ts +523 -0
- package/extensions/voice-call/src/core-bridge.ts +159 -0
- package/extensions/voice-call/src/manager/context.ts +21 -0
- package/extensions/voice-call/src/manager/events.ts +188 -0
- package/extensions/voice-call/src/manager/lookup.ts +35 -0
- package/extensions/voice-call/src/manager/outbound.ts +275 -0
- package/extensions/voice-call/src/manager/state.ts +48 -0
- package/extensions/voice-call/src/manager/store.ts +91 -0
- package/extensions/voice-call/src/manager/timers.ts +89 -0
- package/extensions/voice-call/src/manager/twiml.ts +9 -0
- package/extensions/voice-call/src/manager.test.ts +224 -0
- package/extensions/voice-call/src/manager.ts +887 -0
- package/extensions/voice-call/src/media-stream.test.ts +96 -0
- package/extensions/voice-call/src/media-stream.ts +411 -0
- package/extensions/voice-call/src/providers/base.ts +67 -0
- package/extensions/voice-call/src/providers/index.ts +10 -0
- package/extensions/voice-call/src/providers/mock.ts +165 -0
- package/extensions/voice-call/src/providers/plivo.test.ts +27 -0
- package/extensions/voice-call/src/providers/plivo.ts +515 -0
- package/extensions/voice-call/src/providers/stt-openai-realtime.ts +311 -0
- package/extensions/voice-call/src/providers/telnyx.ts +371 -0
- package/extensions/voice-call/src/providers/tts-openai.ts +259 -0
- package/extensions/voice-call/src/providers/twilio/api.ts +42 -0
- package/extensions/voice-call/src/providers/twilio/webhook.ts +32 -0
- package/extensions/voice-call/src/providers/twilio.test.ts +60 -0
- package/extensions/voice-call/src/providers/twilio.ts +626 -0
- package/extensions/voice-call/src/response-generator.ts +158 -0
- package/extensions/voice-call/src/runtime.ts +212 -0
- package/extensions/voice-call/src/telephony-audio.ts +90 -0
- package/extensions/voice-call/src/telephony-tts.ts +104 -0
- package/extensions/voice-call/src/tunnel.ts +314 -0
- package/extensions/voice-call/src/types.ts +272 -0
- package/extensions/voice-call/src/utils.ts +14 -0
- package/extensions/voice-call/src/voice-mapping.ts +67 -0
- package/extensions/voice-call/src/webhook-security.test.ts +377 -0
- package/extensions/voice-call/src/webhook-security.ts +689 -0
- package/extensions/voice-call/src/webhook.ts +516 -0
- package/extensions/whatsapp/index.ts +17 -0
- package/extensions/whatsapp/node_modules/.bin/openclaw +21 -0
- package/extensions/whatsapp/openclaw.plugin.json +9 -0
- package/extensions/whatsapp/package.json +14 -0
- package/extensions/whatsapp/src/channel.ts +508 -0
- package/extensions/whatsapp/src/runtime.ts +14 -0
- package/extensions/zalo/CHANGELOG.md +113 -0
- package/extensions/zalo/README.md +50 -0
- package/extensions/zalo/index.ts +19 -0
- package/extensions/zalo/node_modules/.bin/openclaw +21 -0
- package/extensions/zalo/openclaw.plugin.json +9 -0
- package/extensions/zalo/package.json +36 -0
- package/extensions/zalo/src/accounts.ts +80 -0
- package/extensions/zalo/src/actions.ts +67 -0
- package/extensions/zalo/src/api.ts +208 -0
- package/extensions/zalo/src/channel.directory.test.ts +43 -0
- package/extensions/zalo/src/channel.ts +414 -0
- package/extensions/zalo/src/config-schema.ts +25 -0
- package/extensions/zalo/src/monitor.ts +764 -0
- package/extensions/zalo/src/monitor.webhook.test.ts +73 -0
- package/extensions/zalo/src/onboarding.ts +401 -0
- package/extensions/zalo/src/probe.ts +46 -0
- package/extensions/zalo/src/proxy.ts +21 -0
- package/extensions/zalo/src/runtime.ts +14 -0
- package/extensions/zalo/src/send.ts +124 -0
- package/extensions/zalo/src/status-issues.ts +53 -0
- package/extensions/zalo/src/token.ts +63 -0
- package/extensions/zalo/src/types.ts +44 -0
- package/extensions/zalouser/CHANGELOG.md +85 -0
- package/extensions/zalouser/README.md +225 -0
- package/extensions/zalouser/index.ts +31 -0
- package/extensions/zalouser/node_modules/.bin/openclaw +21 -0
- package/extensions/zalouser/openclaw.plugin.json +9 -0
- package/extensions/zalouser/package.json +36 -0
- package/extensions/zalouser/src/accounts.ts +135 -0
- package/extensions/zalouser/src/channel.test.ts +18 -0
- package/extensions/zalouser/src/channel.ts +686 -0
- package/extensions/zalouser/src/config-schema.ts +28 -0
- package/extensions/zalouser/src/monitor.ts +601 -0
- package/extensions/zalouser/src/onboarding.ts +504 -0
- package/extensions/zalouser/src/probe.ts +28 -0
- package/extensions/zalouser/src/runtime.ts +14 -0
- package/extensions/zalouser/src/send.ts +160 -0
- package/extensions/zalouser/src/status-issues.test.ts +57 -0
- package/extensions/zalouser/src/status-issues.ts +89 -0
- package/extensions/zalouser/src/tool.ts +164 -0
- package/extensions/zalouser/src/types.ts +110 -0
- package/extensions/zalouser/src/zca.ts +202 -0
- package/openclaw.mjs +33 -0
- package/package.json +234 -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 +96 -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 +284 -0
- package/skills/discord/SKILL.md +578 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/food-order/SKILL.md +48 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +77 -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 +74 -0
- package/skills/local-places/SERVER_README.md +101 -0
- package/skills/local-places/SKILL.md +102 -0
- package/skills/local-places/pyproject.toml +21 -0
- package/skills/local-places/src/local_places/__init__.py +2 -0
- package/skills/local-places/src/local_places/google_places.py +314 -0
- package/skills/local-places/src/local_places/main.py +65 -0
- package/skills/local-places/src/local_places/schemas.py +107 -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 +310 -0
- package/skills/nano-banana-pro/SKILL.md +58 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/notion/SKILL.md +172 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +89 -0
- package/skills/openai-image-gen/scripts/gen.py +240 -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 +51 -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 +370 -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 +111 -0
- package/skills/skill-creator/scripts/quick_validate.py +101 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +46 -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 +135 -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 +54 -0
|
@@ -0,0 +1,2942 @@
|
|
|
1
|
+
import { L as STATE_DIR, Q as CHAT_CHANNEL_ORDER, Z as CHANNEL_IDS, ct as requireActivePluginRegistry, nt as getChatChannelMeta, p as defaultRuntime } from "./entry.js";
|
|
2
|
+
import { t as formatCliCommand } from "./command-format-ayFsmwwz.js";
|
|
3
|
+
import { c as normalizeAccountId$1, d as resolveAgentIdFromSessionKey, i as buildAgentMainSessionKey, l as normalizeAgentId, n as DEFAULT_AGENT_ID, t as DEFAULT_ACCOUNT_ID, u as normalizeMainKey } from "./session-key-Dk6vSAOv.js";
|
|
4
|
+
import { m as resolveUserPath, u as normalizeE164 } from "./utils-DX85MiPR.js";
|
|
5
|
+
import { b as DEFAULT_USER_FILENAME, d as DEFAULT_AGENTS_FILENAME, f as DEFAULT_AGENT_WORKSPACE_DIR, h as DEFAULT_IDENTITY_FILENAME, l as resolveSessionAgentId, m as DEFAULT_HEARTBEAT_FILENAME, n as resolveAgentConfig, p as DEFAULT_BOOTSTRAP_FILENAME, v as DEFAULT_SOUL_FILENAME, x as ensureAgentWorkspace, y as DEFAULT_TOOLS_FILENAME } from "./agent-scope-jAWKj2TP.js";
|
|
6
|
+
import { i as loadConfig } from "./config-BM_g3TBU.js";
|
|
7
|
+
import { o as resolveProfile, t as createBrowserRouteContext } from "./server-context-yKyxyxOJ.js";
|
|
8
|
+
import { O as DEFAULT_BROWSER_EVALUATE_ENABLED, j as DEFAULT_OPENCLAW_BROWSER_PROFILE_NAME, k as DEFAULT_OPENCLAW_BROWSER_COLOR } from "./errors-CZ9opC6L.js";
|
|
9
|
+
import { c as listDeliverableMessageChannels, l as normalizeMessageChannel } from "./message-channel-CQ6DgRUw.js";
|
|
10
|
+
import { _ as normalizeChatType, a as normalizeWhatsAppTarget, c as resolveTelegramAccount, m as resolveSlackReplyToMode, p as resolveSlackAccount, r as normalizeChannelId, y as resolveDiscordAccount } from "./plugins-DWuabtET.js";
|
|
11
|
+
import { n as resolveWhatsAppAccount } from "./accounts-B9umzy_R.js";
|
|
12
|
+
import { r as resolveSessionTranscriptPath, t as resolveDefaultSessionStorePath } from "./paths-BT8VDsrj.js";
|
|
13
|
+
import { t as emitSessionTranscriptUpdate } from "./transcript-events-Bv_eRVym.js";
|
|
14
|
+
import { t as registerBrowserRoutes } from "./routes-B5LAoQFO.js";
|
|
15
|
+
import { o as syncSkillsToWorkspace } from "./skills-B7bCWSck.js";
|
|
16
|
+
import { spawn } from "node:child_process";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
import fs from "node:fs";
|
|
19
|
+
import JSON5 from "json5";
|
|
20
|
+
import fs$1 from "node:fs/promises";
|
|
21
|
+
import crypto from "node:crypto";
|
|
22
|
+
import { CURRENT_SESSION_VERSION, SessionManager } from "@mariozechner/pi-coding-agent";
|
|
23
|
+
import express from "express";
|
|
24
|
+
|
|
25
|
+
//#region src/imessage/accounts.ts
|
|
26
|
+
function resolveAccountConfig$1(cfg, accountId) {
|
|
27
|
+
const accounts = cfg.channels?.imessage?.accounts;
|
|
28
|
+
if (!accounts || typeof accounts !== "object") return;
|
|
29
|
+
return accounts[accountId];
|
|
30
|
+
}
|
|
31
|
+
function mergeIMessageAccountConfig(cfg, accountId) {
|
|
32
|
+
const { accounts: _ignored, ...base } = cfg.channels?.imessage ?? {};
|
|
33
|
+
const account = resolveAccountConfig$1(cfg, accountId) ?? {};
|
|
34
|
+
return {
|
|
35
|
+
...base,
|
|
36
|
+
...account
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function resolveIMessageAccount(params) {
|
|
40
|
+
const accountId = normalizeAccountId$1(params.accountId);
|
|
41
|
+
const baseEnabled = params.cfg.channels?.imessage?.enabled !== false;
|
|
42
|
+
const merged = mergeIMessageAccountConfig(params.cfg, accountId);
|
|
43
|
+
const accountEnabled = merged.enabled !== false;
|
|
44
|
+
const configured = Boolean(merged.cliPath?.trim() || merged.dbPath?.trim() || merged.service || merged.region?.trim() || merged.allowFrom && merged.allowFrom.length > 0 || merged.groupAllowFrom && merged.groupAllowFrom.length > 0 || merged.dmPolicy || merged.groupPolicy || typeof merged.includeAttachments === "boolean" || typeof merged.mediaMaxMb === "number" || typeof merged.textChunkLimit === "number" || merged.groups && Object.keys(merged.groups).length > 0);
|
|
45
|
+
return {
|
|
46
|
+
accountId,
|
|
47
|
+
enabled: baseEnabled && accountEnabled,
|
|
48
|
+
name: merged.name?.trim() || void 0,
|
|
49
|
+
config: merged,
|
|
50
|
+
configured
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/signal/accounts.ts
|
|
56
|
+
function listConfiguredAccountIds(cfg) {
|
|
57
|
+
const accounts = cfg.channels?.signal?.accounts;
|
|
58
|
+
if (!accounts || typeof accounts !== "object") return [];
|
|
59
|
+
return Object.keys(accounts).filter(Boolean);
|
|
60
|
+
}
|
|
61
|
+
function listSignalAccountIds(cfg) {
|
|
62
|
+
const ids = listConfiguredAccountIds(cfg);
|
|
63
|
+
if (ids.length === 0) return [DEFAULT_ACCOUNT_ID];
|
|
64
|
+
return ids.toSorted((a, b) => a.localeCompare(b));
|
|
65
|
+
}
|
|
66
|
+
function resolveAccountConfig(cfg, accountId) {
|
|
67
|
+
const accounts = cfg.channels?.signal?.accounts;
|
|
68
|
+
if (!accounts || typeof accounts !== "object") return;
|
|
69
|
+
return accounts[accountId];
|
|
70
|
+
}
|
|
71
|
+
function mergeSignalAccountConfig(cfg, accountId) {
|
|
72
|
+
const { accounts: _ignored, ...base } = cfg.channels?.signal ?? {};
|
|
73
|
+
const account = resolveAccountConfig(cfg, accountId) ?? {};
|
|
74
|
+
return {
|
|
75
|
+
...base,
|
|
76
|
+
...account
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function resolveSignalAccount(params) {
|
|
80
|
+
const accountId = normalizeAccountId$1(params.accountId);
|
|
81
|
+
const baseEnabled = params.cfg.channels?.signal?.enabled !== false;
|
|
82
|
+
const merged = mergeSignalAccountConfig(params.cfg, accountId);
|
|
83
|
+
const accountEnabled = merged.enabled !== false;
|
|
84
|
+
const enabled = baseEnabled && accountEnabled;
|
|
85
|
+
const host = merged.httpHost?.trim() || "127.0.0.1";
|
|
86
|
+
const port = merged.httpPort ?? 8080;
|
|
87
|
+
const baseUrl = merged.httpUrl?.trim() || `http://${host}:${port}`;
|
|
88
|
+
const configured = Boolean(merged.account?.trim() || merged.httpUrl?.trim() || merged.cliPath?.trim() || merged.httpHost?.trim() || typeof merged.httpPort === "number" || typeof merged.autoStart === "boolean");
|
|
89
|
+
return {
|
|
90
|
+
accountId,
|
|
91
|
+
enabled,
|
|
92
|
+
name: merged.name?.trim() || void 0,
|
|
93
|
+
baseUrl,
|
|
94
|
+
configured,
|
|
95
|
+
config: merged
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function listEnabledSignalAccounts(cfg) {
|
|
99
|
+
return listSignalAccountIds(cfg).map((accountId) => resolveSignalAccount({
|
|
100
|
+
cfg,
|
|
101
|
+
accountId
|
|
102
|
+
})).filter((account) => account.enabled);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/slack/threading-tool-context.ts
|
|
107
|
+
function buildSlackThreadingToolContext(params) {
|
|
108
|
+
const configuredReplyToMode = resolveSlackReplyToMode(resolveSlackAccount({
|
|
109
|
+
cfg: params.cfg,
|
|
110
|
+
accountId: params.accountId
|
|
111
|
+
}), params.context.ChatType);
|
|
112
|
+
const effectiveReplyToMode = params.context.ThreadLabel ? "all" : configuredReplyToMode;
|
|
113
|
+
const threadId = params.context.MessageThreadId ?? params.context.ReplyToId;
|
|
114
|
+
return {
|
|
115
|
+
currentChannelId: params.context.To?.startsWith("channel:") ? params.context.To.slice(8) : void 0,
|
|
116
|
+
currentThreadTs: threadId != null ? String(threadId) : void 0,
|
|
117
|
+
replyToMode: effectiveReplyToMode,
|
|
118
|
+
hasRepliedRef: params.hasRepliedRef
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/config/group-policy.ts
|
|
124
|
+
function normalizeSenderKey(value) {
|
|
125
|
+
const trimmed = value.trim();
|
|
126
|
+
if (!trimmed) return "";
|
|
127
|
+
return (trimmed.startsWith("@") ? trimmed.slice(1) : trimmed).toLowerCase();
|
|
128
|
+
}
|
|
129
|
+
function resolveToolsBySender(params) {
|
|
130
|
+
const toolsBySender = params.toolsBySender;
|
|
131
|
+
if (!toolsBySender) return;
|
|
132
|
+
const entries = Object.entries(toolsBySender);
|
|
133
|
+
if (entries.length === 0) return;
|
|
134
|
+
const normalized = /* @__PURE__ */ new Map();
|
|
135
|
+
let wildcard;
|
|
136
|
+
for (const [rawKey, policy] of entries) {
|
|
137
|
+
if (!policy) continue;
|
|
138
|
+
const key = normalizeSenderKey(rawKey);
|
|
139
|
+
if (!key) continue;
|
|
140
|
+
if (key === "*") {
|
|
141
|
+
wildcard = policy;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (!normalized.has(key)) normalized.set(key, policy);
|
|
145
|
+
}
|
|
146
|
+
const candidates = [];
|
|
147
|
+
const pushCandidate = (value) => {
|
|
148
|
+
const trimmed = value?.trim();
|
|
149
|
+
if (!trimmed) return;
|
|
150
|
+
candidates.push(trimmed);
|
|
151
|
+
};
|
|
152
|
+
pushCandidate(params.senderId);
|
|
153
|
+
pushCandidate(params.senderE164);
|
|
154
|
+
pushCandidate(params.senderUsername);
|
|
155
|
+
pushCandidate(params.senderName);
|
|
156
|
+
for (const candidate of candidates) {
|
|
157
|
+
const key = normalizeSenderKey(candidate);
|
|
158
|
+
if (!key) continue;
|
|
159
|
+
const match = normalized.get(key);
|
|
160
|
+
if (match) return match;
|
|
161
|
+
}
|
|
162
|
+
return wildcard;
|
|
163
|
+
}
|
|
164
|
+
function resolveChannelGroups(cfg, channel, accountId) {
|
|
165
|
+
const normalizedAccountId = normalizeAccountId$1(accountId);
|
|
166
|
+
const channelConfig = cfg.channels?.[channel];
|
|
167
|
+
if (!channelConfig) return;
|
|
168
|
+
return channelConfig.accounts?.[normalizedAccountId]?.groups ?? channelConfig.accounts?.[Object.keys(channelConfig.accounts ?? {}).find((key) => key.toLowerCase() === normalizedAccountId.toLowerCase()) ?? ""]?.groups ?? channelConfig.groups;
|
|
169
|
+
}
|
|
170
|
+
function resolveChannelGroupPolicy(params) {
|
|
171
|
+
const { cfg, channel } = params;
|
|
172
|
+
const groups = resolveChannelGroups(cfg, channel, params.accountId);
|
|
173
|
+
const allowlistEnabled = Boolean(groups && Object.keys(groups).length > 0);
|
|
174
|
+
const normalizedId = params.groupId?.trim();
|
|
175
|
+
const groupConfig = normalizedId && groups ? groups[normalizedId] : void 0;
|
|
176
|
+
const defaultConfig = groups?.["*"];
|
|
177
|
+
return {
|
|
178
|
+
allowlistEnabled,
|
|
179
|
+
allowed: !allowlistEnabled || allowlistEnabled && Boolean(groups && Object.hasOwn(groups, "*")) || (normalizedId ? Boolean(groups && Object.hasOwn(groups, normalizedId)) : false),
|
|
180
|
+
groupConfig,
|
|
181
|
+
defaultConfig
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function resolveChannelGroupRequireMention(params) {
|
|
185
|
+
const { requireMentionOverride, overrideOrder = "after-config" } = params;
|
|
186
|
+
const { groupConfig, defaultConfig } = resolveChannelGroupPolicy(params);
|
|
187
|
+
const configMention = typeof groupConfig?.requireMention === "boolean" ? groupConfig.requireMention : typeof defaultConfig?.requireMention === "boolean" ? defaultConfig.requireMention : void 0;
|
|
188
|
+
if (overrideOrder === "before-config" && typeof requireMentionOverride === "boolean") return requireMentionOverride;
|
|
189
|
+
if (typeof configMention === "boolean") return configMention;
|
|
190
|
+
if (overrideOrder !== "before-config" && typeof requireMentionOverride === "boolean") return requireMentionOverride;
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
function resolveChannelGroupToolsPolicy(params) {
|
|
194
|
+
const { groupConfig, defaultConfig } = resolveChannelGroupPolicy(params);
|
|
195
|
+
const groupSenderPolicy = resolveToolsBySender({
|
|
196
|
+
toolsBySender: groupConfig?.toolsBySender,
|
|
197
|
+
senderId: params.senderId,
|
|
198
|
+
senderName: params.senderName,
|
|
199
|
+
senderUsername: params.senderUsername,
|
|
200
|
+
senderE164: params.senderE164
|
|
201
|
+
});
|
|
202
|
+
if (groupSenderPolicy) return groupSenderPolicy;
|
|
203
|
+
if (groupConfig?.tools) return groupConfig.tools;
|
|
204
|
+
const defaultSenderPolicy = resolveToolsBySender({
|
|
205
|
+
toolsBySender: defaultConfig?.toolsBySender,
|
|
206
|
+
senderId: params.senderId,
|
|
207
|
+
senderName: params.senderName,
|
|
208
|
+
senderUsername: params.senderUsername,
|
|
209
|
+
senderE164: params.senderE164
|
|
210
|
+
});
|
|
211
|
+
if (defaultSenderPolicy) return defaultSenderPolicy;
|
|
212
|
+
if (defaultConfig?.tools) return defaultConfig.tools;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/channels/plugins/group-mentions.ts
|
|
217
|
+
function normalizeDiscordSlug(value) {
|
|
218
|
+
if (!value) return "";
|
|
219
|
+
let text = value.trim().toLowerCase();
|
|
220
|
+
if (!text) return "";
|
|
221
|
+
text = text.replace(/^[@#]+/, "");
|
|
222
|
+
text = text.replace(/[\s_]+/g, "-");
|
|
223
|
+
text = text.replace(/[^a-z0-9-]+/g, "-");
|
|
224
|
+
text = text.replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
|
|
225
|
+
return text;
|
|
226
|
+
}
|
|
227
|
+
function normalizeSlackSlug(raw) {
|
|
228
|
+
const trimmed = raw?.trim().toLowerCase() ?? "";
|
|
229
|
+
if (!trimmed) return "";
|
|
230
|
+
return trimmed.replace(/\s+/g, "-").replace(/[^a-z0-9#@._+-]+/g, "-").replace(/-{2,}/g, "-").replace(/^[-.]+|[-.]+$/g, "");
|
|
231
|
+
}
|
|
232
|
+
function parseTelegramGroupId(value) {
|
|
233
|
+
const raw = value?.trim() ?? "";
|
|
234
|
+
if (!raw) return {
|
|
235
|
+
chatId: void 0,
|
|
236
|
+
topicId: void 0
|
|
237
|
+
};
|
|
238
|
+
const parts = raw.split(":").filter(Boolean);
|
|
239
|
+
if (parts.length >= 3 && parts[1] === "topic" && /^-?\d+$/.test(parts[0]) && /^\d+$/.test(parts[2])) return {
|
|
240
|
+
chatId: parts[0],
|
|
241
|
+
topicId: parts[2]
|
|
242
|
+
};
|
|
243
|
+
if (parts.length >= 2 && /^-?\d+$/.test(parts[0]) && /^\d+$/.test(parts[1])) return {
|
|
244
|
+
chatId: parts[0],
|
|
245
|
+
topicId: parts[1]
|
|
246
|
+
};
|
|
247
|
+
return {
|
|
248
|
+
chatId: raw,
|
|
249
|
+
topicId: void 0
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function resolveTelegramRequireMention(params) {
|
|
253
|
+
const { cfg, chatId, topicId } = params;
|
|
254
|
+
if (!chatId) return;
|
|
255
|
+
const groupConfig = cfg.channels?.telegram?.groups?.[chatId];
|
|
256
|
+
const groupDefault = cfg.channels?.telegram?.groups?.["*"];
|
|
257
|
+
const topicConfig = topicId && groupConfig?.topics ? groupConfig.topics[topicId] : void 0;
|
|
258
|
+
const defaultTopicConfig = topicId && groupDefault?.topics ? groupDefault.topics[topicId] : void 0;
|
|
259
|
+
if (typeof topicConfig?.requireMention === "boolean") return topicConfig.requireMention;
|
|
260
|
+
if (typeof defaultTopicConfig?.requireMention === "boolean") return defaultTopicConfig.requireMention;
|
|
261
|
+
if (typeof groupConfig?.requireMention === "boolean") return groupConfig.requireMention;
|
|
262
|
+
if (typeof groupDefault?.requireMention === "boolean") return groupDefault.requireMention;
|
|
263
|
+
}
|
|
264
|
+
function resolveDiscordGuildEntry(guilds, groupSpace) {
|
|
265
|
+
if (!guilds || Object.keys(guilds).length === 0) return null;
|
|
266
|
+
const space = groupSpace?.trim() ?? "";
|
|
267
|
+
if (space && guilds[space]) return guilds[space];
|
|
268
|
+
const normalized = normalizeDiscordSlug(space);
|
|
269
|
+
if (normalized && guilds[normalized]) return guilds[normalized];
|
|
270
|
+
if (normalized) {
|
|
271
|
+
const match = Object.values(guilds).find((entry) => normalizeDiscordSlug(entry?.slug ?? void 0) === normalized);
|
|
272
|
+
if (match) return match;
|
|
273
|
+
}
|
|
274
|
+
return guilds["*"] ?? null;
|
|
275
|
+
}
|
|
276
|
+
function resolveTelegramGroupRequireMention(params) {
|
|
277
|
+
const { chatId, topicId } = parseTelegramGroupId(params.groupId);
|
|
278
|
+
const requireMention = resolveTelegramRequireMention({
|
|
279
|
+
cfg: params.cfg,
|
|
280
|
+
chatId,
|
|
281
|
+
topicId
|
|
282
|
+
});
|
|
283
|
+
if (typeof requireMention === "boolean") return requireMention;
|
|
284
|
+
return resolveChannelGroupRequireMention({
|
|
285
|
+
cfg: params.cfg,
|
|
286
|
+
channel: "telegram",
|
|
287
|
+
groupId: chatId ?? params.groupId,
|
|
288
|
+
accountId: params.accountId
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
function resolveWhatsAppGroupRequireMention(params) {
|
|
292
|
+
return resolveChannelGroupRequireMention({
|
|
293
|
+
cfg: params.cfg,
|
|
294
|
+
channel: "whatsapp",
|
|
295
|
+
groupId: params.groupId,
|
|
296
|
+
accountId: params.accountId
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
function resolveIMessageGroupRequireMention(params) {
|
|
300
|
+
return resolveChannelGroupRequireMention({
|
|
301
|
+
cfg: params.cfg,
|
|
302
|
+
channel: "imessage",
|
|
303
|
+
groupId: params.groupId,
|
|
304
|
+
accountId: params.accountId
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
function resolveDiscordGroupRequireMention(params) {
|
|
308
|
+
const guildEntry = resolveDiscordGuildEntry(params.cfg.channels?.discord?.guilds, params.groupSpace);
|
|
309
|
+
const channelEntries = guildEntry?.channels;
|
|
310
|
+
if (channelEntries && Object.keys(channelEntries).length > 0) {
|
|
311
|
+
const groupChannel = params.groupChannel;
|
|
312
|
+
const channelSlug = normalizeDiscordSlug(groupChannel);
|
|
313
|
+
const entry = (params.groupId ? channelEntries[params.groupId] : void 0) ?? (channelSlug ? channelEntries[channelSlug] ?? channelEntries[`#${channelSlug}`] : void 0) ?? (groupChannel ? channelEntries[normalizeDiscordSlug(groupChannel)] : void 0);
|
|
314
|
+
if (entry && typeof entry.requireMention === "boolean") return entry.requireMention;
|
|
315
|
+
}
|
|
316
|
+
if (typeof guildEntry?.requireMention === "boolean") return guildEntry.requireMention;
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
function resolveGoogleChatGroupRequireMention(params) {
|
|
320
|
+
return resolveChannelGroupRequireMention({
|
|
321
|
+
cfg: params.cfg,
|
|
322
|
+
channel: "googlechat",
|
|
323
|
+
groupId: params.groupId,
|
|
324
|
+
accountId: params.accountId
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
function resolveGoogleChatGroupToolPolicy(params) {
|
|
328
|
+
return resolveChannelGroupToolsPolicy({
|
|
329
|
+
cfg: params.cfg,
|
|
330
|
+
channel: "googlechat",
|
|
331
|
+
groupId: params.groupId,
|
|
332
|
+
accountId: params.accountId,
|
|
333
|
+
senderId: params.senderId,
|
|
334
|
+
senderName: params.senderName,
|
|
335
|
+
senderUsername: params.senderUsername,
|
|
336
|
+
senderE164: params.senderE164
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
function resolveSlackGroupRequireMention(params) {
|
|
340
|
+
const channels = resolveSlackAccount({
|
|
341
|
+
cfg: params.cfg,
|
|
342
|
+
accountId: params.accountId
|
|
343
|
+
}).channels ?? {};
|
|
344
|
+
if (Object.keys(channels).length === 0) return true;
|
|
345
|
+
const channelId = params.groupId?.trim();
|
|
346
|
+
const channelName = params.groupChannel?.replace(/^#/, "");
|
|
347
|
+
const normalizedName = normalizeSlackSlug(channelName);
|
|
348
|
+
const candidates = [
|
|
349
|
+
channelId ?? "",
|
|
350
|
+
channelName ? `#${channelName}` : "",
|
|
351
|
+
channelName ?? "",
|
|
352
|
+
normalizedName
|
|
353
|
+
].filter(Boolean);
|
|
354
|
+
let matched;
|
|
355
|
+
for (const candidate of candidates) if (candidate && channels[candidate]) {
|
|
356
|
+
matched = channels[candidate];
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
const fallback = channels["*"];
|
|
360
|
+
const resolved = matched ?? fallback;
|
|
361
|
+
if (typeof resolved?.requireMention === "boolean") return resolved.requireMention;
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
function resolveTelegramGroupToolPolicy(params) {
|
|
365
|
+
const { chatId } = parseTelegramGroupId(params.groupId);
|
|
366
|
+
return resolveChannelGroupToolsPolicy({
|
|
367
|
+
cfg: params.cfg,
|
|
368
|
+
channel: "telegram",
|
|
369
|
+
groupId: chatId ?? params.groupId,
|
|
370
|
+
accountId: params.accountId,
|
|
371
|
+
senderId: params.senderId,
|
|
372
|
+
senderName: params.senderName,
|
|
373
|
+
senderUsername: params.senderUsername,
|
|
374
|
+
senderE164: params.senderE164
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function resolveWhatsAppGroupToolPolicy(params) {
|
|
378
|
+
return resolveChannelGroupToolsPolicy({
|
|
379
|
+
cfg: params.cfg,
|
|
380
|
+
channel: "whatsapp",
|
|
381
|
+
groupId: params.groupId,
|
|
382
|
+
accountId: params.accountId,
|
|
383
|
+
senderId: params.senderId,
|
|
384
|
+
senderName: params.senderName,
|
|
385
|
+
senderUsername: params.senderUsername,
|
|
386
|
+
senderE164: params.senderE164
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
function resolveIMessageGroupToolPolicy(params) {
|
|
390
|
+
return resolveChannelGroupToolsPolicy({
|
|
391
|
+
cfg: params.cfg,
|
|
392
|
+
channel: "imessage",
|
|
393
|
+
groupId: params.groupId,
|
|
394
|
+
accountId: params.accountId,
|
|
395
|
+
senderId: params.senderId,
|
|
396
|
+
senderName: params.senderName,
|
|
397
|
+
senderUsername: params.senderUsername,
|
|
398
|
+
senderE164: params.senderE164
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
function resolveDiscordGroupToolPolicy(params) {
|
|
402
|
+
const guildEntry = resolveDiscordGuildEntry(params.cfg.channels?.discord?.guilds, params.groupSpace);
|
|
403
|
+
const channelEntries = guildEntry?.channels;
|
|
404
|
+
if (channelEntries && Object.keys(channelEntries).length > 0) {
|
|
405
|
+
const groupChannel = params.groupChannel;
|
|
406
|
+
const channelSlug = normalizeDiscordSlug(groupChannel);
|
|
407
|
+
const entry = (params.groupId ? channelEntries[params.groupId] : void 0) ?? (channelSlug ? channelEntries[channelSlug] ?? channelEntries[`#${channelSlug}`] : void 0) ?? (groupChannel ? channelEntries[normalizeDiscordSlug(groupChannel)] : void 0);
|
|
408
|
+
const senderPolicy = resolveToolsBySender({
|
|
409
|
+
toolsBySender: entry?.toolsBySender,
|
|
410
|
+
senderId: params.senderId,
|
|
411
|
+
senderName: params.senderName,
|
|
412
|
+
senderUsername: params.senderUsername,
|
|
413
|
+
senderE164: params.senderE164
|
|
414
|
+
});
|
|
415
|
+
if (senderPolicy) return senderPolicy;
|
|
416
|
+
if (entry?.tools) return entry.tools;
|
|
417
|
+
}
|
|
418
|
+
const guildSenderPolicy = resolveToolsBySender({
|
|
419
|
+
toolsBySender: guildEntry?.toolsBySender,
|
|
420
|
+
senderId: params.senderId,
|
|
421
|
+
senderName: params.senderName,
|
|
422
|
+
senderUsername: params.senderUsername,
|
|
423
|
+
senderE164: params.senderE164
|
|
424
|
+
});
|
|
425
|
+
if (guildSenderPolicy) return guildSenderPolicy;
|
|
426
|
+
if (guildEntry?.tools) return guildEntry.tools;
|
|
427
|
+
}
|
|
428
|
+
function resolveSlackGroupToolPolicy(params) {
|
|
429
|
+
const channels = resolveSlackAccount({
|
|
430
|
+
cfg: params.cfg,
|
|
431
|
+
accountId: params.accountId
|
|
432
|
+
}).channels ?? {};
|
|
433
|
+
if (Object.keys(channels).length === 0) return;
|
|
434
|
+
const channelId = params.groupId?.trim();
|
|
435
|
+
const channelName = params.groupChannel?.replace(/^#/, "");
|
|
436
|
+
const normalizedName = normalizeSlackSlug(channelName);
|
|
437
|
+
const candidates = [
|
|
438
|
+
channelId ?? "",
|
|
439
|
+
channelName ? `#${channelName}` : "",
|
|
440
|
+
channelName ?? "",
|
|
441
|
+
normalizedName
|
|
442
|
+
].filter(Boolean);
|
|
443
|
+
let matched;
|
|
444
|
+
for (const candidate of candidates) if (candidate && channels[candidate]) {
|
|
445
|
+
matched = channels[candidate];
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
const resolved = matched ?? channels["*"];
|
|
449
|
+
const senderPolicy = resolveToolsBySender({
|
|
450
|
+
toolsBySender: resolved?.toolsBySender,
|
|
451
|
+
senderId: params.senderId,
|
|
452
|
+
senderName: params.senderName,
|
|
453
|
+
senderUsername: params.senderUsername,
|
|
454
|
+
senderE164: params.senderE164
|
|
455
|
+
});
|
|
456
|
+
if (senderPolicy) return senderPolicy;
|
|
457
|
+
if (resolved?.tools) return resolved.tools;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/channels/dock.ts
|
|
462
|
+
const formatLower = (allowFrom) => allowFrom.map((entry) => String(entry).trim()).filter(Boolean).map((entry) => entry.toLowerCase());
|
|
463
|
+
const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
464
|
+
const DOCKS = {
|
|
465
|
+
telegram: {
|
|
466
|
+
id: "telegram",
|
|
467
|
+
capabilities: {
|
|
468
|
+
chatTypes: [
|
|
469
|
+
"direct",
|
|
470
|
+
"group",
|
|
471
|
+
"channel",
|
|
472
|
+
"thread"
|
|
473
|
+
],
|
|
474
|
+
nativeCommands: true,
|
|
475
|
+
blockStreaming: true
|
|
476
|
+
},
|
|
477
|
+
outbound: { textChunkLimit: 4e3 },
|
|
478
|
+
config: {
|
|
479
|
+
resolveAllowFrom: ({ cfg, accountId }) => (resolveTelegramAccount({
|
|
480
|
+
cfg,
|
|
481
|
+
accountId
|
|
482
|
+
}).config.allowFrom ?? []).map((entry) => String(entry)),
|
|
483
|
+
formatAllowFrom: ({ allowFrom }) => allowFrom.map((entry) => String(entry).trim()).filter(Boolean).map((entry) => entry.replace(/^(telegram|tg):/i, "")).map((entry) => entry.toLowerCase())
|
|
484
|
+
},
|
|
485
|
+
groups: {
|
|
486
|
+
resolveRequireMention: resolveTelegramGroupRequireMention,
|
|
487
|
+
resolveToolPolicy: resolveTelegramGroupToolPolicy
|
|
488
|
+
},
|
|
489
|
+
threading: {
|
|
490
|
+
resolveReplyToMode: ({ cfg }) => cfg.channels?.telegram?.replyToMode ?? "first",
|
|
491
|
+
buildToolContext: ({ context, hasRepliedRef }) => {
|
|
492
|
+
const threadId = context.MessageThreadId ?? context.ReplyToId;
|
|
493
|
+
return {
|
|
494
|
+
currentChannelId: context.To?.trim() || void 0,
|
|
495
|
+
currentThreadTs: threadId != null ? String(threadId) : void 0,
|
|
496
|
+
hasRepliedRef
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
whatsapp: {
|
|
502
|
+
id: "whatsapp",
|
|
503
|
+
capabilities: {
|
|
504
|
+
chatTypes: ["direct", "group"],
|
|
505
|
+
polls: true,
|
|
506
|
+
reactions: true,
|
|
507
|
+
media: true
|
|
508
|
+
},
|
|
509
|
+
commands: {
|
|
510
|
+
enforceOwnerForCommands: true,
|
|
511
|
+
skipWhenConfigEmpty: true
|
|
512
|
+
},
|
|
513
|
+
outbound: { textChunkLimit: 4e3 },
|
|
514
|
+
config: {
|
|
515
|
+
resolveAllowFrom: ({ cfg, accountId }) => resolveWhatsAppAccount({
|
|
516
|
+
cfg,
|
|
517
|
+
accountId
|
|
518
|
+
}).allowFrom ?? [],
|
|
519
|
+
formatAllowFrom: ({ allowFrom }) => allowFrom.map((entry) => String(entry).trim()).filter((entry) => Boolean(entry)).map((entry) => entry === "*" ? entry : normalizeWhatsAppTarget(entry)).filter((entry) => Boolean(entry))
|
|
520
|
+
},
|
|
521
|
+
groups: {
|
|
522
|
+
resolveRequireMention: resolveWhatsAppGroupRequireMention,
|
|
523
|
+
resolveToolPolicy: resolveWhatsAppGroupToolPolicy,
|
|
524
|
+
resolveGroupIntroHint: () => "WhatsApp IDs: SenderId is the participant JID; [message_id: ...] is the message id for reactions (use SenderId as participant)."
|
|
525
|
+
},
|
|
526
|
+
mentions: { stripPatterns: ({ ctx }) => {
|
|
527
|
+
const selfE164 = (ctx.To ?? "").replace(/^whatsapp:/, "");
|
|
528
|
+
if (!selfE164) return [];
|
|
529
|
+
const escaped = escapeRegExp(selfE164);
|
|
530
|
+
return [escaped, `@${escaped}`];
|
|
531
|
+
} },
|
|
532
|
+
threading: { buildToolContext: ({ context, hasRepliedRef }) => {
|
|
533
|
+
return {
|
|
534
|
+
currentChannelId: context.From?.trim() || context.To?.trim() || void 0,
|
|
535
|
+
currentThreadTs: context.ReplyToId,
|
|
536
|
+
hasRepliedRef
|
|
537
|
+
};
|
|
538
|
+
} }
|
|
539
|
+
},
|
|
540
|
+
discord: {
|
|
541
|
+
id: "discord",
|
|
542
|
+
capabilities: {
|
|
543
|
+
chatTypes: [
|
|
544
|
+
"direct",
|
|
545
|
+
"channel",
|
|
546
|
+
"thread"
|
|
547
|
+
],
|
|
548
|
+
polls: true,
|
|
549
|
+
reactions: true,
|
|
550
|
+
media: true,
|
|
551
|
+
nativeCommands: true,
|
|
552
|
+
threads: true
|
|
553
|
+
},
|
|
554
|
+
outbound: { textChunkLimit: 2e3 },
|
|
555
|
+
streaming: { blockStreamingCoalesceDefaults: {
|
|
556
|
+
minChars: 1500,
|
|
557
|
+
idleMs: 1e3
|
|
558
|
+
} },
|
|
559
|
+
elevated: { allowFromFallback: ({ cfg }) => cfg.channels?.discord?.dm?.allowFrom },
|
|
560
|
+
config: {
|
|
561
|
+
resolveAllowFrom: ({ cfg, accountId }) => (resolveDiscordAccount({
|
|
562
|
+
cfg,
|
|
563
|
+
accountId
|
|
564
|
+
}).config.dm?.allowFrom ?? []).map((entry) => String(entry)),
|
|
565
|
+
formatAllowFrom: ({ allowFrom }) => formatLower(allowFrom)
|
|
566
|
+
},
|
|
567
|
+
groups: {
|
|
568
|
+
resolveRequireMention: resolveDiscordGroupRequireMention,
|
|
569
|
+
resolveToolPolicy: resolveDiscordGroupToolPolicy
|
|
570
|
+
},
|
|
571
|
+
mentions: { stripPatterns: () => ["<@!?\\d+>"] },
|
|
572
|
+
threading: {
|
|
573
|
+
resolveReplyToMode: ({ cfg }) => cfg.channels?.discord?.replyToMode ?? "off",
|
|
574
|
+
buildToolContext: ({ context, hasRepliedRef }) => ({
|
|
575
|
+
currentChannelId: context.To?.trim() || void 0,
|
|
576
|
+
currentThreadTs: context.ReplyToId,
|
|
577
|
+
hasRepliedRef
|
|
578
|
+
})
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
googlechat: {
|
|
582
|
+
id: "googlechat",
|
|
583
|
+
capabilities: {
|
|
584
|
+
chatTypes: [
|
|
585
|
+
"direct",
|
|
586
|
+
"group",
|
|
587
|
+
"thread"
|
|
588
|
+
],
|
|
589
|
+
reactions: true,
|
|
590
|
+
media: true,
|
|
591
|
+
threads: true,
|
|
592
|
+
blockStreaming: true
|
|
593
|
+
},
|
|
594
|
+
outbound: { textChunkLimit: 4e3 },
|
|
595
|
+
config: {
|
|
596
|
+
resolveAllowFrom: ({ cfg, accountId }) => {
|
|
597
|
+
const channel = cfg.channels?.googlechat;
|
|
598
|
+
const normalized = normalizeAccountId$1(accountId);
|
|
599
|
+
return ((channel?.accounts?.[normalized] ?? channel?.accounts?.[Object.keys(channel?.accounts ?? {}).find((key) => key.toLowerCase() === normalized.toLowerCase()) ?? ""])?.dm?.allowFrom ?? channel?.dm?.allowFrom ?? []).map((entry) => String(entry));
|
|
600
|
+
},
|
|
601
|
+
formatAllowFrom: ({ allowFrom }) => allowFrom.map((entry) => String(entry).trim()).filter(Boolean).map((entry) => entry.replace(/^(googlechat|google-chat|gchat):/i, "").replace(/^user:/i, "").replace(/^users\//i, "").toLowerCase())
|
|
602
|
+
},
|
|
603
|
+
groups: {
|
|
604
|
+
resolveRequireMention: resolveGoogleChatGroupRequireMention,
|
|
605
|
+
resolveToolPolicy: resolveGoogleChatGroupToolPolicy
|
|
606
|
+
},
|
|
607
|
+
threading: {
|
|
608
|
+
resolveReplyToMode: ({ cfg }) => cfg.channels?.googlechat?.replyToMode ?? "off",
|
|
609
|
+
buildToolContext: ({ context, hasRepliedRef }) => {
|
|
610
|
+
const threadId = context.MessageThreadId ?? context.ReplyToId;
|
|
611
|
+
return {
|
|
612
|
+
currentChannelId: context.To?.trim() || void 0,
|
|
613
|
+
currentThreadTs: threadId != null ? String(threadId) : void 0,
|
|
614
|
+
hasRepliedRef
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
slack: {
|
|
620
|
+
id: "slack",
|
|
621
|
+
capabilities: {
|
|
622
|
+
chatTypes: [
|
|
623
|
+
"direct",
|
|
624
|
+
"channel",
|
|
625
|
+
"thread"
|
|
626
|
+
],
|
|
627
|
+
reactions: true,
|
|
628
|
+
media: true,
|
|
629
|
+
nativeCommands: true,
|
|
630
|
+
threads: true
|
|
631
|
+
},
|
|
632
|
+
outbound: { textChunkLimit: 4e3 },
|
|
633
|
+
streaming: { blockStreamingCoalesceDefaults: {
|
|
634
|
+
minChars: 1500,
|
|
635
|
+
idleMs: 1e3
|
|
636
|
+
} },
|
|
637
|
+
config: {
|
|
638
|
+
resolveAllowFrom: ({ cfg, accountId }) => (resolveSlackAccount({
|
|
639
|
+
cfg,
|
|
640
|
+
accountId
|
|
641
|
+
}).dm?.allowFrom ?? []).map((entry) => String(entry)),
|
|
642
|
+
formatAllowFrom: ({ allowFrom }) => formatLower(allowFrom)
|
|
643
|
+
},
|
|
644
|
+
groups: {
|
|
645
|
+
resolveRequireMention: resolveSlackGroupRequireMention,
|
|
646
|
+
resolveToolPolicy: resolveSlackGroupToolPolicy
|
|
647
|
+
},
|
|
648
|
+
mentions: { stripPatterns: () => ["<@[^>]+>"] },
|
|
649
|
+
threading: {
|
|
650
|
+
resolveReplyToMode: ({ cfg, accountId, chatType }) => resolveSlackReplyToMode(resolveSlackAccount({
|
|
651
|
+
cfg,
|
|
652
|
+
accountId
|
|
653
|
+
}), chatType),
|
|
654
|
+
allowTagsWhenOff: true,
|
|
655
|
+
buildToolContext: (params) => buildSlackThreadingToolContext(params)
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
signal: {
|
|
659
|
+
id: "signal",
|
|
660
|
+
capabilities: {
|
|
661
|
+
chatTypes: ["direct", "group"],
|
|
662
|
+
reactions: true,
|
|
663
|
+
media: true
|
|
664
|
+
},
|
|
665
|
+
outbound: { textChunkLimit: 4e3 },
|
|
666
|
+
streaming: { blockStreamingCoalesceDefaults: {
|
|
667
|
+
minChars: 1500,
|
|
668
|
+
idleMs: 1e3
|
|
669
|
+
} },
|
|
670
|
+
config: {
|
|
671
|
+
resolveAllowFrom: ({ cfg, accountId }) => (resolveSignalAccount({
|
|
672
|
+
cfg,
|
|
673
|
+
accountId
|
|
674
|
+
}).config.allowFrom ?? []).map((entry) => String(entry)),
|
|
675
|
+
formatAllowFrom: ({ allowFrom }) => allowFrom.map((entry) => String(entry).trim()).filter(Boolean).map((entry) => entry === "*" ? "*" : normalizeE164(entry.replace(/^signal:/i, ""))).filter(Boolean)
|
|
676
|
+
},
|
|
677
|
+
threading: { buildToolContext: ({ context, hasRepliedRef }) => {
|
|
678
|
+
return {
|
|
679
|
+
currentChannelId: (context.ChatType?.toLowerCase() === "direct" ? context.From ?? context.To : context.To)?.trim() || void 0,
|
|
680
|
+
currentThreadTs: context.ReplyToId,
|
|
681
|
+
hasRepliedRef
|
|
682
|
+
};
|
|
683
|
+
} }
|
|
684
|
+
},
|
|
685
|
+
imessage: {
|
|
686
|
+
id: "imessage",
|
|
687
|
+
capabilities: {
|
|
688
|
+
chatTypes: ["direct", "group"],
|
|
689
|
+
reactions: true,
|
|
690
|
+
media: true
|
|
691
|
+
},
|
|
692
|
+
outbound: { textChunkLimit: 4e3 },
|
|
693
|
+
config: {
|
|
694
|
+
resolveAllowFrom: ({ cfg, accountId }) => (resolveIMessageAccount({
|
|
695
|
+
cfg,
|
|
696
|
+
accountId
|
|
697
|
+
}).config.allowFrom ?? []).map((entry) => String(entry)),
|
|
698
|
+
formatAllowFrom: ({ allowFrom }) => allowFrom.map((entry) => String(entry).trim()).filter(Boolean)
|
|
699
|
+
},
|
|
700
|
+
groups: {
|
|
701
|
+
resolveRequireMention: resolveIMessageGroupRequireMention,
|
|
702
|
+
resolveToolPolicy: resolveIMessageGroupToolPolicy
|
|
703
|
+
},
|
|
704
|
+
threading: { buildToolContext: ({ context, hasRepliedRef }) => {
|
|
705
|
+
return {
|
|
706
|
+
currentChannelId: (context.ChatType?.toLowerCase() === "direct" ? context.From ?? context.To : context.To)?.trim() || void 0,
|
|
707
|
+
currentThreadTs: context.ReplyToId,
|
|
708
|
+
hasRepliedRef
|
|
709
|
+
};
|
|
710
|
+
} }
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
function buildDockFromPlugin(plugin) {
|
|
714
|
+
return {
|
|
715
|
+
id: plugin.id,
|
|
716
|
+
capabilities: plugin.capabilities,
|
|
717
|
+
commands: plugin.commands,
|
|
718
|
+
outbound: plugin.outbound?.textChunkLimit ? { textChunkLimit: plugin.outbound.textChunkLimit } : void 0,
|
|
719
|
+
streaming: plugin.streaming ? { blockStreamingCoalesceDefaults: plugin.streaming.blockStreamingCoalesceDefaults } : void 0,
|
|
720
|
+
elevated: plugin.elevated,
|
|
721
|
+
config: plugin.config ? {
|
|
722
|
+
resolveAllowFrom: plugin.config.resolveAllowFrom,
|
|
723
|
+
formatAllowFrom: plugin.config.formatAllowFrom
|
|
724
|
+
} : void 0,
|
|
725
|
+
groups: plugin.groups,
|
|
726
|
+
mentions: plugin.mentions,
|
|
727
|
+
threading: plugin.threading,
|
|
728
|
+
agentPrompt: plugin.agentPrompt
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
function listPluginDockEntries() {
|
|
732
|
+
const registry = requireActivePluginRegistry();
|
|
733
|
+
const entries = [];
|
|
734
|
+
const seen = /* @__PURE__ */ new Set();
|
|
735
|
+
for (const entry of registry.channels) {
|
|
736
|
+
const plugin = entry.plugin;
|
|
737
|
+
const id = String(plugin.id).trim();
|
|
738
|
+
if (!id || seen.has(id)) continue;
|
|
739
|
+
seen.add(id);
|
|
740
|
+
if (CHAT_CHANNEL_ORDER.includes(plugin.id)) continue;
|
|
741
|
+
const dock = entry.dock ?? buildDockFromPlugin(plugin);
|
|
742
|
+
entries.push({
|
|
743
|
+
id: plugin.id,
|
|
744
|
+
dock,
|
|
745
|
+
order: plugin.meta.order
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
return entries;
|
|
749
|
+
}
|
|
750
|
+
function listChannelDocks() {
|
|
751
|
+
const baseEntries = CHAT_CHANNEL_ORDER.map((id) => ({
|
|
752
|
+
id,
|
|
753
|
+
dock: DOCKS[id],
|
|
754
|
+
order: getChatChannelMeta(id).order
|
|
755
|
+
}));
|
|
756
|
+
const pluginEntries = listPluginDockEntries();
|
|
757
|
+
const combined = [...baseEntries, ...pluginEntries];
|
|
758
|
+
combined.sort((a, b) => {
|
|
759
|
+
const indexA = CHAT_CHANNEL_ORDER.indexOf(a.id);
|
|
760
|
+
const indexB = CHAT_CHANNEL_ORDER.indexOf(b.id);
|
|
761
|
+
const orderA = a.order ?? (indexA === -1 ? 999 : indexA);
|
|
762
|
+
const orderB = b.order ?? (indexB === -1 ? 999 : indexB);
|
|
763
|
+
if (orderA !== orderB) return orderA - orderB;
|
|
764
|
+
return String(a.id).localeCompare(String(b.id));
|
|
765
|
+
});
|
|
766
|
+
return combined.map((entry) => entry.dock);
|
|
767
|
+
}
|
|
768
|
+
function getChannelDock(id) {
|
|
769
|
+
const core = DOCKS[id];
|
|
770
|
+
if (core) return core;
|
|
771
|
+
const pluginEntry = requireActivePluginRegistry().channels.find((entry) => entry.plugin.id === id);
|
|
772
|
+
if (!pluginEntry) return;
|
|
773
|
+
return pluginEntry.dock ?? buildDockFromPlugin(pluginEntry.plugin);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/agents/sandbox/constants.ts
|
|
778
|
+
const DEFAULT_SANDBOX_WORKSPACE_ROOT = path.join(STATE_DIR, "sandboxes");
|
|
779
|
+
const DEFAULT_SANDBOX_IMAGE = "openclaw-sandbox:bookworm-slim";
|
|
780
|
+
const DEFAULT_SANDBOX_CONTAINER_PREFIX = "openclaw-sbx-";
|
|
781
|
+
const DEFAULT_SANDBOX_WORKDIR = "/workspace";
|
|
782
|
+
const DEFAULT_SANDBOX_IDLE_HOURS = 24;
|
|
783
|
+
const DEFAULT_SANDBOX_MAX_AGE_DAYS = 7;
|
|
784
|
+
const DEFAULT_TOOL_ALLOW = [
|
|
785
|
+
"exec",
|
|
786
|
+
"process",
|
|
787
|
+
"read",
|
|
788
|
+
"write",
|
|
789
|
+
"edit",
|
|
790
|
+
"apply_patch",
|
|
791
|
+
"image",
|
|
792
|
+
"sessions_list",
|
|
793
|
+
"sessions_history",
|
|
794
|
+
"sessions_send",
|
|
795
|
+
"sessions_spawn",
|
|
796
|
+
"session_status"
|
|
797
|
+
];
|
|
798
|
+
const DEFAULT_TOOL_DENY = [
|
|
799
|
+
"browser",
|
|
800
|
+
"canvas",
|
|
801
|
+
"nodes",
|
|
802
|
+
"cron",
|
|
803
|
+
"gateway",
|
|
804
|
+
...CHANNEL_IDS
|
|
805
|
+
];
|
|
806
|
+
const DEFAULT_SANDBOX_BROWSER_IMAGE = "openclaw-sandbox-browser:bookworm-slim";
|
|
807
|
+
const DEFAULT_SANDBOX_COMMON_IMAGE = "openclaw-sandbox-common:bookworm-slim";
|
|
808
|
+
const DEFAULT_SANDBOX_BROWSER_PREFIX = "openclaw-sbx-browser-";
|
|
809
|
+
const DEFAULT_SANDBOX_BROWSER_CDP_PORT = 9222;
|
|
810
|
+
const DEFAULT_SANDBOX_BROWSER_VNC_PORT = 5900;
|
|
811
|
+
const DEFAULT_SANDBOX_BROWSER_NOVNC_PORT = 6080;
|
|
812
|
+
const DEFAULT_SANDBOX_BROWSER_AUTOSTART_TIMEOUT_MS = 12e3;
|
|
813
|
+
const SANDBOX_AGENT_WORKSPACE_MOUNT = "/agent";
|
|
814
|
+
const SANDBOX_STATE_DIR = path.join(STATE_DIR, "sandbox");
|
|
815
|
+
const SANDBOX_REGISTRY_PATH = path.join(SANDBOX_STATE_DIR, "containers.json");
|
|
816
|
+
const SANDBOX_BROWSER_REGISTRY_PATH = path.join(SANDBOX_STATE_DIR, "browsers.json");
|
|
817
|
+
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region src/agents/tool-policy.ts
|
|
820
|
+
const TOOL_NAME_ALIASES = {
|
|
821
|
+
bash: "exec",
|
|
822
|
+
"apply-patch": "apply_patch"
|
|
823
|
+
};
|
|
824
|
+
const TOOL_GROUPS = {
|
|
825
|
+
"group:memory": ["memory_search", "memory_get"],
|
|
826
|
+
"group:web": ["web_search", "web_fetch"],
|
|
827
|
+
"group:fs": [
|
|
828
|
+
"read",
|
|
829
|
+
"write",
|
|
830
|
+
"edit",
|
|
831
|
+
"apply_patch"
|
|
832
|
+
],
|
|
833
|
+
"group:runtime": ["exec", "process"],
|
|
834
|
+
"group:sessions": [
|
|
835
|
+
"sessions_list",
|
|
836
|
+
"sessions_history",
|
|
837
|
+
"sessions_send",
|
|
838
|
+
"sessions_spawn",
|
|
839
|
+
"session_status"
|
|
840
|
+
],
|
|
841
|
+
"group:ui": ["browser", "canvas"],
|
|
842
|
+
"group:automation": ["cron", "gateway"],
|
|
843
|
+
"group:messaging": ["message"],
|
|
844
|
+
"group:nodes": ["nodes"],
|
|
845
|
+
"group:openclaw": [
|
|
846
|
+
"browser",
|
|
847
|
+
"canvas",
|
|
848
|
+
"nodes",
|
|
849
|
+
"cron",
|
|
850
|
+
"message",
|
|
851
|
+
"gateway",
|
|
852
|
+
"agents_list",
|
|
853
|
+
"sessions_list",
|
|
854
|
+
"sessions_history",
|
|
855
|
+
"sessions_send",
|
|
856
|
+
"sessions_spawn",
|
|
857
|
+
"session_status",
|
|
858
|
+
"memory_search",
|
|
859
|
+
"memory_get",
|
|
860
|
+
"web_search",
|
|
861
|
+
"web_fetch",
|
|
862
|
+
"image"
|
|
863
|
+
]
|
|
864
|
+
};
|
|
865
|
+
const OWNER_ONLY_TOOL_NAMES = new Set(["whatsapp_login"]);
|
|
866
|
+
const TOOL_PROFILES = {
|
|
867
|
+
minimal: { allow: ["session_status"] },
|
|
868
|
+
coding: { allow: [
|
|
869
|
+
"group:fs",
|
|
870
|
+
"group:runtime",
|
|
871
|
+
"group:sessions",
|
|
872
|
+
"group:memory",
|
|
873
|
+
"image"
|
|
874
|
+
] },
|
|
875
|
+
messaging: { allow: [
|
|
876
|
+
"group:messaging",
|
|
877
|
+
"sessions_list",
|
|
878
|
+
"sessions_history",
|
|
879
|
+
"sessions_send",
|
|
880
|
+
"session_status"
|
|
881
|
+
] },
|
|
882
|
+
full: {}
|
|
883
|
+
};
|
|
884
|
+
function normalizeToolName(name) {
|
|
885
|
+
const normalized = name.trim().toLowerCase();
|
|
886
|
+
return TOOL_NAME_ALIASES[normalized] ?? normalized;
|
|
887
|
+
}
|
|
888
|
+
function isOwnerOnlyToolName(name) {
|
|
889
|
+
return OWNER_ONLY_TOOL_NAMES.has(normalizeToolName(name));
|
|
890
|
+
}
|
|
891
|
+
function applyOwnerOnlyToolPolicy(tools, senderIsOwner) {
|
|
892
|
+
const withGuard = tools.map((tool) => {
|
|
893
|
+
if (!isOwnerOnlyToolName(tool.name)) return tool;
|
|
894
|
+
if (senderIsOwner || !tool.execute) return tool;
|
|
895
|
+
return {
|
|
896
|
+
...tool,
|
|
897
|
+
execute: async () => {
|
|
898
|
+
throw new Error("Tool restricted to owner senders.");
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
});
|
|
902
|
+
if (senderIsOwner) return withGuard;
|
|
903
|
+
return withGuard.filter((tool) => !isOwnerOnlyToolName(tool.name));
|
|
904
|
+
}
|
|
905
|
+
function normalizeToolList(list) {
|
|
906
|
+
if (!list) return [];
|
|
907
|
+
return list.map(normalizeToolName).filter(Boolean);
|
|
908
|
+
}
|
|
909
|
+
function expandToolGroups(list) {
|
|
910
|
+
const normalized = normalizeToolList(list);
|
|
911
|
+
const expanded = [];
|
|
912
|
+
for (const value of normalized) {
|
|
913
|
+
const group = TOOL_GROUPS[value];
|
|
914
|
+
if (group) {
|
|
915
|
+
expanded.push(...group);
|
|
916
|
+
continue;
|
|
917
|
+
}
|
|
918
|
+
expanded.push(value);
|
|
919
|
+
}
|
|
920
|
+
return Array.from(new Set(expanded));
|
|
921
|
+
}
|
|
922
|
+
function collectExplicitAllowlist(policies) {
|
|
923
|
+
const entries = [];
|
|
924
|
+
for (const policy of policies) {
|
|
925
|
+
if (!policy?.allow) continue;
|
|
926
|
+
for (const value of policy.allow) {
|
|
927
|
+
if (typeof value !== "string") continue;
|
|
928
|
+
const trimmed = value.trim();
|
|
929
|
+
if (trimmed) entries.push(trimmed);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
return entries;
|
|
933
|
+
}
|
|
934
|
+
function buildPluginToolGroups(params) {
|
|
935
|
+
const all = [];
|
|
936
|
+
const byPlugin = /* @__PURE__ */ new Map();
|
|
937
|
+
for (const tool of params.tools) {
|
|
938
|
+
const meta = params.toolMeta(tool);
|
|
939
|
+
if (!meta) continue;
|
|
940
|
+
const name = normalizeToolName(tool.name);
|
|
941
|
+
all.push(name);
|
|
942
|
+
const pluginId = meta.pluginId.toLowerCase();
|
|
943
|
+
const list = byPlugin.get(pluginId) ?? [];
|
|
944
|
+
list.push(name);
|
|
945
|
+
byPlugin.set(pluginId, list);
|
|
946
|
+
}
|
|
947
|
+
return {
|
|
948
|
+
all,
|
|
949
|
+
byPlugin
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
function expandPluginGroups(list, groups) {
|
|
953
|
+
if (!list || list.length === 0) return list;
|
|
954
|
+
const expanded = [];
|
|
955
|
+
for (const entry of list) {
|
|
956
|
+
const normalized = normalizeToolName(entry);
|
|
957
|
+
if (normalized === "group:plugins") {
|
|
958
|
+
if (groups.all.length > 0) expanded.push(...groups.all);
|
|
959
|
+
else expanded.push(normalized);
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
const tools = groups.byPlugin.get(normalized);
|
|
963
|
+
if (tools && tools.length > 0) {
|
|
964
|
+
expanded.push(...tools);
|
|
965
|
+
continue;
|
|
966
|
+
}
|
|
967
|
+
expanded.push(normalized);
|
|
968
|
+
}
|
|
969
|
+
return Array.from(new Set(expanded));
|
|
970
|
+
}
|
|
971
|
+
function expandPolicyWithPluginGroups(policy, groups) {
|
|
972
|
+
if (!policy) return;
|
|
973
|
+
return {
|
|
974
|
+
allow: expandPluginGroups(policy.allow, groups),
|
|
975
|
+
deny: expandPluginGroups(policy.deny, groups)
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
function stripPluginOnlyAllowlist(policy, groups, coreTools) {
|
|
979
|
+
if (!policy?.allow || policy.allow.length === 0) return {
|
|
980
|
+
policy,
|
|
981
|
+
unknownAllowlist: [],
|
|
982
|
+
strippedAllowlist: false
|
|
983
|
+
};
|
|
984
|
+
const normalized = normalizeToolList(policy.allow);
|
|
985
|
+
if (normalized.length === 0) return {
|
|
986
|
+
policy,
|
|
987
|
+
unknownAllowlist: [],
|
|
988
|
+
strippedAllowlist: false
|
|
989
|
+
};
|
|
990
|
+
const pluginIds = new Set(groups.byPlugin.keys());
|
|
991
|
+
const pluginTools = new Set(groups.all);
|
|
992
|
+
const unknownAllowlist = [];
|
|
993
|
+
let hasCoreEntry = false;
|
|
994
|
+
for (const entry of normalized) {
|
|
995
|
+
if (entry === "*") {
|
|
996
|
+
hasCoreEntry = true;
|
|
997
|
+
continue;
|
|
998
|
+
}
|
|
999
|
+
const isPluginEntry = entry === "group:plugins" || pluginIds.has(entry) || pluginTools.has(entry);
|
|
1000
|
+
const isCoreEntry = expandToolGroups([entry]).some((tool) => coreTools.has(tool));
|
|
1001
|
+
if (isCoreEntry) hasCoreEntry = true;
|
|
1002
|
+
if (!isCoreEntry && !isPluginEntry) unknownAllowlist.push(entry);
|
|
1003
|
+
}
|
|
1004
|
+
const strippedAllowlist = !hasCoreEntry;
|
|
1005
|
+
if (strippedAllowlist) {}
|
|
1006
|
+
return {
|
|
1007
|
+
policy: strippedAllowlist ? {
|
|
1008
|
+
...policy,
|
|
1009
|
+
allow: void 0
|
|
1010
|
+
} : policy,
|
|
1011
|
+
unknownAllowlist: Array.from(new Set(unknownAllowlist)),
|
|
1012
|
+
strippedAllowlist
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
function resolveToolProfilePolicy(profile) {
|
|
1016
|
+
if (!profile) return;
|
|
1017
|
+
const resolved = TOOL_PROFILES[profile];
|
|
1018
|
+
if (!resolved) return;
|
|
1019
|
+
if (!resolved.allow && !resolved.deny) return;
|
|
1020
|
+
return {
|
|
1021
|
+
allow: resolved.allow ? [...resolved.allow] : void 0,
|
|
1022
|
+
deny: resolved.deny ? [...resolved.deny] : void 0
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
//#endregion
|
|
1027
|
+
//#region src/agents/sandbox/tool-policy.ts
|
|
1028
|
+
function compilePattern(pattern) {
|
|
1029
|
+
const normalized = pattern.trim().toLowerCase();
|
|
1030
|
+
if (!normalized) return {
|
|
1031
|
+
kind: "exact",
|
|
1032
|
+
value: ""
|
|
1033
|
+
};
|
|
1034
|
+
if (normalized === "*") return { kind: "all" };
|
|
1035
|
+
if (!normalized.includes("*")) return {
|
|
1036
|
+
kind: "exact",
|
|
1037
|
+
value: normalized
|
|
1038
|
+
};
|
|
1039
|
+
const escaped = normalized.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1040
|
+
return {
|
|
1041
|
+
kind: "regex",
|
|
1042
|
+
value: new RegExp(`^${escaped.replaceAll("\\*", ".*")}$`)
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
1045
|
+
function compilePatterns(patterns) {
|
|
1046
|
+
if (!Array.isArray(patterns)) return [];
|
|
1047
|
+
return expandToolGroups(patterns).map(compilePattern).filter((pattern) => pattern.kind !== "exact" || pattern.value);
|
|
1048
|
+
}
|
|
1049
|
+
function matchesAny(name, patterns) {
|
|
1050
|
+
for (const pattern of patterns) {
|
|
1051
|
+
if (pattern.kind === "all") return true;
|
|
1052
|
+
if (pattern.kind === "exact" && name === pattern.value) return true;
|
|
1053
|
+
if (pattern.kind === "regex" && pattern.value.test(name)) return true;
|
|
1054
|
+
}
|
|
1055
|
+
return false;
|
|
1056
|
+
}
|
|
1057
|
+
function isToolAllowed(policy, name) {
|
|
1058
|
+
const normalized = name.trim().toLowerCase();
|
|
1059
|
+
if (matchesAny(normalized, compilePatterns(policy.deny))) return false;
|
|
1060
|
+
const allow = compilePatterns(policy.allow);
|
|
1061
|
+
if (allow.length === 0) return true;
|
|
1062
|
+
return matchesAny(normalized, allow);
|
|
1063
|
+
}
|
|
1064
|
+
function resolveSandboxToolPolicyForAgent(cfg, agentId) {
|
|
1065
|
+
const agentConfig = cfg && agentId ? resolveAgentConfig(cfg, agentId) : void 0;
|
|
1066
|
+
const agentAllow = agentConfig?.tools?.sandbox?.tools?.allow;
|
|
1067
|
+
const agentDeny = agentConfig?.tools?.sandbox?.tools?.deny;
|
|
1068
|
+
const globalAllow = cfg?.tools?.sandbox?.tools?.allow;
|
|
1069
|
+
const globalDeny = cfg?.tools?.sandbox?.tools?.deny;
|
|
1070
|
+
const allowSource = Array.isArray(agentAllow) ? {
|
|
1071
|
+
source: "agent",
|
|
1072
|
+
key: "agents.list[].tools.sandbox.tools.allow"
|
|
1073
|
+
} : Array.isArray(globalAllow) ? {
|
|
1074
|
+
source: "global",
|
|
1075
|
+
key: "tools.sandbox.tools.allow"
|
|
1076
|
+
} : {
|
|
1077
|
+
source: "default",
|
|
1078
|
+
key: "tools.sandbox.tools.allow"
|
|
1079
|
+
};
|
|
1080
|
+
const denySource = Array.isArray(agentDeny) ? {
|
|
1081
|
+
source: "agent",
|
|
1082
|
+
key: "agents.list[].tools.sandbox.tools.deny"
|
|
1083
|
+
} : Array.isArray(globalDeny) ? {
|
|
1084
|
+
source: "global",
|
|
1085
|
+
key: "tools.sandbox.tools.deny"
|
|
1086
|
+
} : {
|
|
1087
|
+
source: "default",
|
|
1088
|
+
key: "tools.sandbox.tools.deny"
|
|
1089
|
+
};
|
|
1090
|
+
const deny = Array.isArray(agentDeny) ? agentDeny : Array.isArray(globalDeny) ? globalDeny : [...DEFAULT_TOOL_DENY];
|
|
1091
|
+
const allow = Array.isArray(agentAllow) ? agentAllow : Array.isArray(globalAllow) ? globalAllow : [...DEFAULT_TOOL_ALLOW];
|
|
1092
|
+
const expandedDeny = expandToolGroups(deny);
|
|
1093
|
+
let expandedAllow = expandToolGroups(allow);
|
|
1094
|
+
if (!expandedDeny.map((v) => v.toLowerCase()).includes("image") && !expandedAllow.map((v) => v.toLowerCase()).includes("image")) expandedAllow = [...expandedAllow, "image"];
|
|
1095
|
+
return {
|
|
1096
|
+
allow: expandedAllow,
|
|
1097
|
+
deny: expandedDeny,
|
|
1098
|
+
sources: {
|
|
1099
|
+
allow: allowSource,
|
|
1100
|
+
deny: denySource
|
|
1101
|
+
}
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
//#endregion
|
|
1106
|
+
//#region src/agents/sandbox/config.ts
|
|
1107
|
+
function resolveSandboxScope(params) {
|
|
1108
|
+
if (params.scope) return params.scope;
|
|
1109
|
+
if (typeof params.perSession === "boolean") return params.perSession ? "session" : "shared";
|
|
1110
|
+
return "agent";
|
|
1111
|
+
}
|
|
1112
|
+
function resolveSandboxDockerConfig(params) {
|
|
1113
|
+
const agentDocker = params.scope === "shared" ? void 0 : params.agentDocker;
|
|
1114
|
+
const globalDocker = params.globalDocker;
|
|
1115
|
+
const env = agentDocker?.env ? {
|
|
1116
|
+
...globalDocker?.env ?? { LANG: "C.UTF-8" },
|
|
1117
|
+
...agentDocker.env
|
|
1118
|
+
} : globalDocker?.env ?? { LANG: "C.UTF-8" };
|
|
1119
|
+
const ulimits = agentDocker?.ulimits ? {
|
|
1120
|
+
...globalDocker?.ulimits,
|
|
1121
|
+
...agentDocker.ulimits
|
|
1122
|
+
} : globalDocker?.ulimits;
|
|
1123
|
+
const binds = [...globalDocker?.binds ?? [], ...agentDocker?.binds ?? []];
|
|
1124
|
+
return {
|
|
1125
|
+
image: agentDocker?.image ?? globalDocker?.image ?? DEFAULT_SANDBOX_IMAGE,
|
|
1126
|
+
containerPrefix: agentDocker?.containerPrefix ?? globalDocker?.containerPrefix ?? DEFAULT_SANDBOX_CONTAINER_PREFIX,
|
|
1127
|
+
workdir: agentDocker?.workdir ?? globalDocker?.workdir ?? DEFAULT_SANDBOX_WORKDIR,
|
|
1128
|
+
readOnlyRoot: agentDocker?.readOnlyRoot ?? globalDocker?.readOnlyRoot ?? true,
|
|
1129
|
+
tmpfs: agentDocker?.tmpfs ?? globalDocker?.tmpfs ?? [
|
|
1130
|
+
"/tmp",
|
|
1131
|
+
"/var/tmp",
|
|
1132
|
+
"/run"
|
|
1133
|
+
],
|
|
1134
|
+
network: agentDocker?.network ?? globalDocker?.network ?? "none",
|
|
1135
|
+
user: agentDocker?.user ?? globalDocker?.user,
|
|
1136
|
+
capDrop: agentDocker?.capDrop ?? globalDocker?.capDrop ?? ["ALL"],
|
|
1137
|
+
env,
|
|
1138
|
+
setupCommand: agentDocker?.setupCommand ?? globalDocker?.setupCommand,
|
|
1139
|
+
pidsLimit: agentDocker?.pidsLimit ?? globalDocker?.pidsLimit,
|
|
1140
|
+
memory: agentDocker?.memory ?? globalDocker?.memory,
|
|
1141
|
+
memorySwap: agentDocker?.memorySwap ?? globalDocker?.memorySwap,
|
|
1142
|
+
cpus: agentDocker?.cpus ?? globalDocker?.cpus,
|
|
1143
|
+
ulimits,
|
|
1144
|
+
seccompProfile: agentDocker?.seccompProfile ?? globalDocker?.seccompProfile,
|
|
1145
|
+
apparmorProfile: agentDocker?.apparmorProfile ?? globalDocker?.apparmorProfile,
|
|
1146
|
+
dns: agentDocker?.dns ?? globalDocker?.dns,
|
|
1147
|
+
extraHosts: agentDocker?.extraHosts ?? globalDocker?.extraHosts,
|
|
1148
|
+
binds: binds.length ? binds : void 0
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
function resolveSandboxBrowserConfig(params) {
|
|
1152
|
+
const agentBrowser = params.scope === "shared" ? void 0 : params.agentBrowser;
|
|
1153
|
+
const globalBrowser = params.globalBrowser;
|
|
1154
|
+
return {
|
|
1155
|
+
enabled: agentBrowser?.enabled ?? globalBrowser?.enabled ?? false,
|
|
1156
|
+
image: agentBrowser?.image ?? globalBrowser?.image ?? DEFAULT_SANDBOX_BROWSER_IMAGE,
|
|
1157
|
+
containerPrefix: agentBrowser?.containerPrefix ?? globalBrowser?.containerPrefix ?? DEFAULT_SANDBOX_BROWSER_PREFIX,
|
|
1158
|
+
cdpPort: agentBrowser?.cdpPort ?? globalBrowser?.cdpPort ?? DEFAULT_SANDBOX_BROWSER_CDP_PORT,
|
|
1159
|
+
vncPort: agentBrowser?.vncPort ?? globalBrowser?.vncPort ?? DEFAULT_SANDBOX_BROWSER_VNC_PORT,
|
|
1160
|
+
noVncPort: agentBrowser?.noVncPort ?? globalBrowser?.noVncPort ?? DEFAULT_SANDBOX_BROWSER_NOVNC_PORT,
|
|
1161
|
+
headless: agentBrowser?.headless ?? globalBrowser?.headless ?? false,
|
|
1162
|
+
enableNoVnc: agentBrowser?.enableNoVnc ?? globalBrowser?.enableNoVnc ?? true,
|
|
1163
|
+
allowHostControl: agentBrowser?.allowHostControl ?? globalBrowser?.allowHostControl ?? false,
|
|
1164
|
+
autoStart: agentBrowser?.autoStart ?? globalBrowser?.autoStart ?? true,
|
|
1165
|
+
autoStartTimeoutMs: agentBrowser?.autoStartTimeoutMs ?? globalBrowser?.autoStartTimeoutMs ?? DEFAULT_SANDBOX_BROWSER_AUTOSTART_TIMEOUT_MS
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
function resolveSandboxPruneConfig(params) {
|
|
1169
|
+
const agentPrune = params.scope === "shared" ? void 0 : params.agentPrune;
|
|
1170
|
+
const globalPrune = params.globalPrune;
|
|
1171
|
+
return {
|
|
1172
|
+
idleHours: agentPrune?.idleHours ?? globalPrune?.idleHours ?? DEFAULT_SANDBOX_IDLE_HOURS,
|
|
1173
|
+
maxAgeDays: agentPrune?.maxAgeDays ?? globalPrune?.maxAgeDays ?? DEFAULT_SANDBOX_MAX_AGE_DAYS
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
function resolveSandboxConfigForAgent(cfg, agentId) {
|
|
1177
|
+
const agent = cfg?.agents?.defaults?.sandbox;
|
|
1178
|
+
let agentSandbox;
|
|
1179
|
+
const agentConfig = cfg && agentId ? resolveAgentConfig(cfg, agentId) : void 0;
|
|
1180
|
+
if (agentConfig?.sandbox) agentSandbox = agentConfig.sandbox;
|
|
1181
|
+
const scope = resolveSandboxScope({
|
|
1182
|
+
scope: agentSandbox?.scope ?? agent?.scope,
|
|
1183
|
+
perSession: agentSandbox?.perSession ?? agent?.perSession
|
|
1184
|
+
});
|
|
1185
|
+
const toolPolicy = resolveSandboxToolPolicyForAgent(cfg, agentId);
|
|
1186
|
+
return {
|
|
1187
|
+
mode: agentSandbox?.mode ?? agent?.mode ?? "off",
|
|
1188
|
+
scope,
|
|
1189
|
+
workspaceAccess: agentSandbox?.workspaceAccess ?? agent?.workspaceAccess ?? "none",
|
|
1190
|
+
workspaceRoot: agentSandbox?.workspaceRoot ?? agent?.workspaceRoot ?? DEFAULT_SANDBOX_WORKSPACE_ROOT,
|
|
1191
|
+
docker: resolveSandboxDockerConfig({
|
|
1192
|
+
scope,
|
|
1193
|
+
globalDocker: agent?.docker,
|
|
1194
|
+
agentDocker: agentSandbox?.docker
|
|
1195
|
+
}),
|
|
1196
|
+
browser: resolveSandboxBrowserConfig({
|
|
1197
|
+
scope,
|
|
1198
|
+
globalBrowser: agent?.browser,
|
|
1199
|
+
agentBrowser: agentSandbox?.browser
|
|
1200
|
+
}),
|
|
1201
|
+
tools: {
|
|
1202
|
+
allow: toolPolicy.allow,
|
|
1203
|
+
deny: toolPolicy.deny
|
|
1204
|
+
},
|
|
1205
|
+
prune: resolveSandboxPruneConfig({
|
|
1206
|
+
scope,
|
|
1207
|
+
globalPrune: agent?.prune,
|
|
1208
|
+
agentPrune: agentSandbox?.prune
|
|
1209
|
+
})
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
//#endregion
|
|
1214
|
+
//#region src/browser/bridge-server.ts
|
|
1215
|
+
async function startBrowserBridgeServer(params) {
|
|
1216
|
+
const host = params.host ?? "127.0.0.1";
|
|
1217
|
+
const port = params.port ?? 0;
|
|
1218
|
+
const app = express();
|
|
1219
|
+
app.use(express.json({ limit: "1mb" }));
|
|
1220
|
+
const authToken = params.authToken?.trim();
|
|
1221
|
+
if (authToken) app.use((req, res, next) => {
|
|
1222
|
+
if (String(req.headers.authorization ?? "").trim() === `Bearer ${authToken}`) return next();
|
|
1223
|
+
res.status(401).send("Unauthorized");
|
|
1224
|
+
});
|
|
1225
|
+
const state = {
|
|
1226
|
+
server: null,
|
|
1227
|
+
port,
|
|
1228
|
+
resolved: params.resolved,
|
|
1229
|
+
profiles: /* @__PURE__ */ new Map()
|
|
1230
|
+
};
|
|
1231
|
+
registerBrowserRoutes(app, createBrowserRouteContext({
|
|
1232
|
+
getState: () => state,
|
|
1233
|
+
onEnsureAttachTarget: params.onEnsureAttachTarget
|
|
1234
|
+
}));
|
|
1235
|
+
const server = await new Promise((resolve, reject) => {
|
|
1236
|
+
const s = app.listen(port, host, () => resolve(s));
|
|
1237
|
+
s.once("error", reject);
|
|
1238
|
+
});
|
|
1239
|
+
const resolvedPort = server.address()?.port ?? port;
|
|
1240
|
+
state.server = server;
|
|
1241
|
+
state.port = resolvedPort;
|
|
1242
|
+
state.resolved.controlPort = resolvedPort;
|
|
1243
|
+
return {
|
|
1244
|
+
server,
|
|
1245
|
+
port: resolvedPort,
|
|
1246
|
+
baseUrl: `http://${host}:${resolvedPort}`,
|
|
1247
|
+
state
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
async function stopBrowserBridgeServer(server) {
|
|
1251
|
+
await new Promise((resolve) => {
|
|
1252
|
+
server.close(() => resolve());
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
//#endregion
|
|
1257
|
+
//#region src/agents/sandbox/browser-bridges.ts
|
|
1258
|
+
const BROWSER_BRIDGES = /* @__PURE__ */ new Map();
|
|
1259
|
+
|
|
1260
|
+
//#endregion
|
|
1261
|
+
//#region src/agents/sandbox/config-hash.ts
|
|
1262
|
+
function isPrimitive(value) {
|
|
1263
|
+
return value === null || typeof value !== "object" && typeof value !== "function";
|
|
1264
|
+
}
|
|
1265
|
+
function normalizeForHash(value) {
|
|
1266
|
+
if (value === void 0) return;
|
|
1267
|
+
if (Array.isArray(value)) {
|
|
1268
|
+
const normalized = value.map(normalizeForHash).filter((item) => item !== void 0);
|
|
1269
|
+
const primitives = normalized.filter(isPrimitive);
|
|
1270
|
+
if (primitives.length === normalized.length) return [...primitives].toSorted((a, b) => primitiveToString(a).localeCompare(primitiveToString(b)));
|
|
1271
|
+
return normalized;
|
|
1272
|
+
}
|
|
1273
|
+
if (value && typeof value === "object") {
|
|
1274
|
+
const entries = Object.entries(value).toSorted(([a], [b]) => a.localeCompare(b));
|
|
1275
|
+
const normalized = {};
|
|
1276
|
+
for (const [key, entryValue] of entries) {
|
|
1277
|
+
const next = normalizeForHash(entryValue);
|
|
1278
|
+
if (next !== void 0) normalized[key] = next;
|
|
1279
|
+
}
|
|
1280
|
+
return normalized;
|
|
1281
|
+
}
|
|
1282
|
+
return value;
|
|
1283
|
+
}
|
|
1284
|
+
function primitiveToString(value) {
|
|
1285
|
+
if (value === null) return "null";
|
|
1286
|
+
if (typeof value === "string") return value;
|
|
1287
|
+
if (typeof value === "number") return String(value);
|
|
1288
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
1289
|
+
return JSON.stringify(value);
|
|
1290
|
+
}
|
|
1291
|
+
function computeSandboxConfigHash(input) {
|
|
1292
|
+
const payload = normalizeForHash(input);
|
|
1293
|
+
const raw = JSON.stringify(payload);
|
|
1294
|
+
return crypto.createHash("sha1").update(raw).digest("hex");
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
//#endregion
|
|
1298
|
+
//#region src/agents/sandbox/registry.ts
|
|
1299
|
+
async function readRegistry() {
|
|
1300
|
+
try {
|
|
1301
|
+
const raw = await fs$1.readFile(SANDBOX_REGISTRY_PATH, "utf-8");
|
|
1302
|
+
const parsed = JSON.parse(raw);
|
|
1303
|
+
if (parsed && Array.isArray(parsed.entries)) return parsed;
|
|
1304
|
+
} catch {}
|
|
1305
|
+
return { entries: [] };
|
|
1306
|
+
}
|
|
1307
|
+
async function writeRegistry(registry) {
|
|
1308
|
+
await fs$1.mkdir(SANDBOX_STATE_DIR, { recursive: true });
|
|
1309
|
+
await fs$1.writeFile(SANDBOX_REGISTRY_PATH, `${JSON.stringify(registry, null, 2)}\n`, "utf-8");
|
|
1310
|
+
}
|
|
1311
|
+
async function updateRegistry(entry) {
|
|
1312
|
+
const registry = await readRegistry();
|
|
1313
|
+
const existing = registry.entries.find((item) => item.containerName === entry.containerName);
|
|
1314
|
+
const next = registry.entries.filter((item) => item.containerName !== entry.containerName);
|
|
1315
|
+
next.push({
|
|
1316
|
+
...entry,
|
|
1317
|
+
createdAtMs: existing?.createdAtMs ?? entry.createdAtMs,
|
|
1318
|
+
image: existing?.image ?? entry.image,
|
|
1319
|
+
configHash: entry.configHash ?? existing?.configHash
|
|
1320
|
+
});
|
|
1321
|
+
await writeRegistry({ entries: next });
|
|
1322
|
+
}
|
|
1323
|
+
async function removeRegistryEntry(containerName) {
|
|
1324
|
+
const registry = await readRegistry();
|
|
1325
|
+
const next = registry.entries.filter((item) => item.containerName !== containerName);
|
|
1326
|
+
if (next.length === registry.entries.length) return;
|
|
1327
|
+
await writeRegistry({ entries: next });
|
|
1328
|
+
}
|
|
1329
|
+
async function readBrowserRegistry() {
|
|
1330
|
+
try {
|
|
1331
|
+
const raw = await fs$1.readFile(SANDBOX_BROWSER_REGISTRY_PATH, "utf-8");
|
|
1332
|
+
const parsed = JSON.parse(raw);
|
|
1333
|
+
if (parsed && Array.isArray(parsed.entries)) return parsed;
|
|
1334
|
+
} catch {}
|
|
1335
|
+
return { entries: [] };
|
|
1336
|
+
}
|
|
1337
|
+
async function writeBrowserRegistry(registry) {
|
|
1338
|
+
await fs$1.mkdir(SANDBOX_STATE_DIR, { recursive: true });
|
|
1339
|
+
await fs$1.writeFile(SANDBOX_BROWSER_REGISTRY_PATH, `${JSON.stringify(registry, null, 2)}\n`, "utf-8");
|
|
1340
|
+
}
|
|
1341
|
+
async function updateBrowserRegistry(entry) {
|
|
1342
|
+
const registry = await readBrowserRegistry();
|
|
1343
|
+
const existing = registry.entries.find((item) => item.containerName === entry.containerName);
|
|
1344
|
+
const next = registry.entries.filter((item) => item.containerName !== entry.containerName);
|
|
1345
|
+
next.push({
|
|
1346
|
+
...entry,
|
|
1347
|
+
createdAtMs: existing?.createdAtMs ?? entry.createdAtMs,
|
|
1348
|
+
image: existing?.image ?? entry.image
|
|
1349
|
+
});
|
|
1350
|
+
await writeBrowserRegistry({ entries: next });
|
|
1351
|
+
}
|
|
1352
|
+
async function removeBrowserRegistryEntry(containerName) {
|
|
1353
|
+
const registry = await readBrowserRegistry();
|
|
1354
|
+
const next = registry.entries.filter((item) => item.containerName !== containerName);
|
|
1355
|
+
if (next.length === registry.entries.length) return;
|
|
1356
|
+
await writeBrowserRegistry({ entries: next });
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
//#endregion
|
|
1360
|
+
//#region src/agents/sandbox/shared.ts
|
|
1361
|
+
function slugifySessionKey(value) {
|
|
1362
|
+
const trimmed = value.trim() || "session";
|
|
1363
|
+
const hash = crypto.createHash("sha1").update(trimmed).digest("hex").slice(0, 8);
|
|
1364
|
+
return `${trimmed.toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32) || "session"}-${hash}`;
|
|
1365
|
+
}
|
|
1366
|
+
function resolveSandboxWorkspaceDir(root, sessionKey) {
|
|
1367
|
+
const resolvedRoot = resolveUserPath(root);
|
|
1368
|
+
const slug = slugifySessionKey(sessionKey);
|
|
1369
|
+
return path.join(resolvedRoot, slug);
|
|
1370
|
+
}
|
|
1371
|
+
function resolveSandboxScopeKey(scope, sessionKey) {
|
|
1372
|
+
const trimmed = sessionKey.trim() || "main";
|
|
1373
|
+
if (scope === "shared") return "shared";
|
|
1374
|
+
if (scope === "session") return trimmed;
|
|
1375
|
+
return `agent:${resolveAgentIdFromSessionKey(trimmed)}`;
|
|
1376
|
+
}
|
|
1377
|
+
function resolveSandboxAgentId(scopeKey) {
|
|
1378
|
+
const trimmed = scopeKey.trim();
|
|
1379
|
+
if (!trimmed || trimmed === "shared") return;
|
|
1380
|
+
const parts = trimmed.split(":").filter(Boolean);
|
|
1381
|
+
if (parts[0] === "agent" && parts[1]) return normalizeAgentId(parts[1]);
|
|
1382
|
+
return resolveAgentIdFromSessionKey(trimmed);
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
//#endregion
|
|
1386
|
+
//#region src/agents/sandbox/docker.ts
|
|
1387
|
+
const HOT_CONTAINER_WINDOW_MS = 300 * 1e3;
|
|
1388
|
+
function execDocker(args, opts) {
|
|
1389
|
+
return new Promise((resolve, reject) => {
|
|
1390
|
+
const child = spawn("docker", args, { stdio: [
|
|
1391
|
+
"ignore",
|
|
1392
|
+
"pipe",
|
|
1393
|
+
"pipe"
|
|
1394
|
+
] });
|
|
1395
|
+
let stdout = "";
|
|
1396
|
+
let stderr = "";
|
|
1397
|
+
child.stdout?.on("data", (chunk) => {
|
|
1398
|
+
stdout += chunk.toString();
|
|
1399
|
+
});
|
|
1400
|
+
child.stderr?.on("data", (chunk) => {
|
|
1401
|
+
stderr += chunk.toString();
|
|
1402
|
+
});
|
|
1403
|
+
child.on("close", (code) => {
|
|
1404
|
+
const exitCode = code ?? 0;
|
|
1405
|
+
if (exitCode !== 0 && !opts?.allowFailure) {
|
|
1406
|
+
reject(new Error(stderr.trim() || `docker ${args.join(" ")} failed`));
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
resolve({
|
|
1410
|
+
stdout,
|
|
1411
|
+
stderr,
|
|
1412
|
+
code: exitCode
|
|
1413
|
+
});
|
|
1414
|
+
});
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
async function readDockerPort(containerName, port) {
|
|
1418
|
+
const result = await execDocker([
|
|
1419
|
+
"port",
|
|
1420
|
+
containerName,
|
|
1421
|
+
`${port}/tcp`
|
|
1422
|
+
], { allowFailure: true });
|
|
1423
|
+
if (result.code !== 0) return null;
|
|
1424
|
+
const match = (result.stdout.trim().split(/\r?\n/)[0] ?? "").match(/:(\d+)\s*$/);
|
|
1425
|
+
if (!match) return null;
|
|
1426
|
+
const mapped = Number.parseInt(match[1] ?? "", 10);
|
|
1427
|
+
return Number.isFinite(mapped) ? mapped : null;
|
|
1428
|
+
}
|
|
1429
|
+
async function dockerImageExists(image) {
|
|
1430
|
+
const result = await execDocker([
|
|
1431
|
+
"image",
|
|
1432
|
+
"inspect",
|
|
1433
|
+
image
|
|
1434
|
+
], { allowFailure: true });
|
|
1435
|
+
if (result.code === 0) return true;
|
|
1436
|
+
const stderr = result.stderr.trim();
|
|
1437
|
+
if (stderr.includes("No such image")) return false;
|
|
1438
|
+
throw new Error(`Failed to inspect sandbox image: ${stderr}`);
|
|
1439
|
+
}
|
|
1440
|
+
async function ensureDockerImage(image) {
|
|
1441
|
+
if (await dockerImageExists(image)) return;
|
|
1442
|
+
if (image === DEFAULT_SANDBOX_IMAGE) {
|
|
1443
|
+
await execDocker(["pull", "debian:bookworm-slim"]);
|
|
1444
|
+
await execDocker([
|
|
1445
|
+
"tag",
|
|
1446
|
+
"debian:bookworm-slim",
|
|
1447
|
+
DEFAULT_SANDBOX_IMAGE
|
|
1448
|
+
]);
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
throw new Error(`Sandbox image not found: ${image}. Build or pull it first.`);
|
|
1452
|
+
}
|
|
1453
|
+
async function dockerContainerState(name) {
|
|
1454
|
+
const result = await execDocker([
|
|
1455
|
+
"inspect",
|
|
1456
|
+
"-f",
|
|
1457
|
+
"{{.State.Running}}",
|
|
1458
|
+
name
|
|
1459
|
+
], { allowFailure: true });
|
|
1460
|
+
if (result.code !== 0) return {
|
|
1461
|
+
exists: false,
|
|
1462
|
+
running: false
|
|
1463
|
+
};
|
|
1464
|
+
return {
|
|
1465
|
+
exists: true,
|
|
1466
|
+
running: result.stdout.trim() === "true"
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
function normalizeDockerLimit(value) {
|
|
1470
|
+
if (value === void 0 || value === null) return;
|
|
1471
|
+
if (typeof value === "number") return Number.isFinite(value) ? String(value) : void 0;
|
|
1472
|
+
const trimmed = value.trim();
|
|
1473
|
+
return trimmed ? trimmed : void 0;
|
|
1474
|
+
}
|
|
1475
|
+
function formatUlimitValue(name, value) {
|
|
1476
|
+
if (!name.trim()) return null;
|
|
1477
|
+
if (typeof value === "number" || typeof value === "string") {
|
|
1478
|
+
const raw = String(value).trim();
|
|
1479
|
+
return raw ? `${name}=${raw}` : null;
|
|
1480
|
+
}
|
|
1481
|
+
const soft = typeof value.soft === "number" ? Math.max(0, value.soft) : void 0;
|
|
1482
|
+
const hard = typeof value.hard === "number" ? Math.max(0, value.hard) : void 0;
|
|
1483
|
+
if (soft === void 0 && hard === void 0) return null;
|
|
1484
|
+
if (soft === void 0) return `${name}=${hard}`;
|
|
1485
|
+
if (hard === void 0) return `${name}=${soft}`;
|
|
1486
|
+
return `${name}=${soft}:${hard}`;
|
|
1487
|
+
}
|
|
1488
|
+
function buildSandboxCreateArgs(params) {
|
|
1489
|
+
const createdAtMs = params.createdAtMs ?? Date.now();
|
|
1490
|
+
const args = [
|
|
1491
|
+
"create",
|
|
1492
|
+
"--name",
|
|
1493
|
+
params.name
|
|
1494
|
+
];
|
|
1495
|
+
args.push("--label", "openclaw.sandbox=1");
|
|
1496
|
+
args.push("--label", `openclaw.sessionKey=${params.scopeKey}`);
|
|
1497
|
+
args.push("--label", `openclaw.createdAtMs=${createdAtMs}`);
|
|
1498
|
+
if (params.configHash) args.push("--label", `openclaw.configHash=${params.configHash}`);
|
|
1499
|
+
for (const [key, value] of Object.entries(params.labels ?? {})) if (key && value) args.push("--label", `${key}=${value}`);
|
|
1500
|
+
if (params.cfg.readOnlyRoot) args.push("--read-only");
|
|
1501
|
+
for (const entry of params.cfg.tmpfs) args.push("--tmpfs", entry);
|
|
1502
|
+
if (params.cfg.network) args.push("--network", params.cfg.network);
|
|
1503
|
+
if (params.cfg.user) args.push("--user", params.cfg.user);
|
|
1504
|
+
for (const cap of params.cfg.capDrop) args.push("--cap-drop", cap);
|
|
1505
|
+
args.push("--security-opt", "no-new-privileges");
|
|
1506
|
+
if (params.cfg.seccompProfile) args.push("--security-opt", `seccomp=${params.cfg.seccompProfile}`);
|
|
1507
|
+
if (params.cfg.apparmorProfile) args.push("--security-opt", `apparmor=${params.cfg.apparmorProfile}`);
|
|
1508
|
+
for (const entry of params.cfg.dns ?? []) if (entry.trim()) args.push("--dns", entry);
|
|
1509
|
+
for (const entry of params.cfg.extraHosts ?? []) if (entry.trim()) args.push("--add-host", entry);
|
|
1510
|
+
if (typeof params.cfg.pidsLimit === "number" && params.cfg.pidsLimit > 0) args.push("--pids-limit", String(params.cfg.pidsLimit));
|
|
1511
|
+
const memory = normalizeDockerLimit(params.cfg.memory);
|
|
1512
|
+
if (memory) args.push("--memory", memory);
|
|
1513
|
+
const memorySwap = normalizeDockerLimit(params.cfg.memorySwap);
|
|
1514
|
+
if (memorySwap) args.push("--memory-swap", memorySwap);
|
|
1515
|
+
if (typeof params.cfg.cpus === "number" && params.cfg.cpus > 0) args.push("--cpus", String(params.cfg.cpus));
|
|
1516
|
+
for (const [name, value] of Object.entries(params.cfg.ulimits ?? {})) {
|
|
1517
|
+
const formatted = formatUlimitValue(name, value);
|
|
1518
|
+
if (formatted) args.push("--ulimit", formatted);
|
|
1519
|
+
}
|
|
1520
|
+
if (params.cfg.binds?.length) for (const bind of params.cfg.binds) args.push("-v", bind);
|
|
1521
|
+
return args;
|
|
1522
|
+
}
|
|
1523
|
+
async function createSandboxContainer(params) {
|
|
1524
|
+
const { name, cfg, workspaceDir, scopeKey } = params;
|
|
1525
|
+
await ensureDockerImage(cfg.image);
|
|
1526
|
+
const args = buildSandboxCreateArgs({
|
|
1527
|
+
name,
|
|
1528
|
+
cfg,
|
|
1529
|
+
scopeKey,
|
|
1530
|
+
configHash: params.configHash
|
|
1531
|
+
});
|
|
1532
|
+
args.push("--workdir", cfg.workdir);
|
|
1533
|
+
const mainMountSuffix = params.workspaceAccess === "ro" && workspaceDir === params.agentWorkspaceDir ? ":ro" : "";
|
|
1534
|
+
args.push("-v", `${workspaceDir}:${cfg.workdir}${mainMountSuffix}`);
|
|
1535
|
+
if (params.workspaceAccess !== "none" && workspaceDir !== params.agentWorkspaceDir) {
|
|
1536
|
+
const agentMountSuffix = params.workspaceAccess === "ro" ? ":ro" : "";
|
|
1537
|
+
args.push("-v", `${params.agentWorkspaceDir}:${SANDBOX_AGENT_WORKSPACE_MOUNT}${agentMountSuffix}`);
|
|
1538
|
+
}
|
|
1539
|
+
args.push(cfg.image, "sleep", "infinity");
|
|
1540
|
+
await execDocker(args);
|
|
1541
|
+
await execDocker(["start", name]);
|
|
1542
|
+
if (cfg.setupCommand?.trim()) await execDocker([
|
|
1543
|
+
"exec",
|
|
1544
|
+
"-i",
|
|
1545
|
+
name,
|
|
1546
|
+
"sh",
|
|
1547
|
+
"-lc",
|
|
1548
|
+
cfg.setupCommand
|
|
1549
|
+
]);
|
|
1550
|
+
}
|
|
1551
|
+
async function readContainerConfigHash(containerName) {
|
|
1552
|
+
const readLabel = async (label) => {
|
|
1553
|
+
const result = await execDocker([
|
|
1554
|
+
"inspect",
|
|
1555
|
+
"-f",
|
|
1556
|
+
`{{ index .Config.Labels "${label}" }}`,
|
|
1557
|
+
containerName
|
|
1558
|
+
], { allowFailure: true });
|
|
1559
|
+
if (result.code !== 0) return null;
|
|
1560
|
+
const raw = result.stdout.trim();
|
|
1561
|
+
if (!raw || raw === "<no value>") return null;
|
|
1562
|
+
return raw;
|
|
1563
|
+
};
|
|
1564
|
+
return await readLabel("openclaw.configHash");
|
|
1565
|
+
}
|
|
1566
|
+
function formatSandboxRecreateHint(params) {
|
|
1567
|
+
if (params.scope === "session") return formatCliCommand(`openclaw sandbox recreate --session ${params.sessionKey}`);
|
|
1568
|
+
if (params.scope === "agent") return formatCliCommand(`openclaw sandbox recreate --agent ${resolveSandboxAgentId(params.sessionKey) ?? "main"}`);
|
|
1569
|
+
return formatCliCommand("openclaw sandbox recreate --all");
|
|
1570
|
+
}
|
|
1571
|
+
async function ensureSandboxContainer(params) {
|
|
1572
|
+
const scopeKey = resolveSandboxScopeKey(params.cfg.scope, params.sessionKey);
|
|
1573
|
+
const slug = params.cfg.scope === "shared" ? "shared" : slugifySessionKey(scopeKey);
|
|
1574
|
+
const containerName = `${params.cfg.docker.containerPrefix}${slug}`.slice(0, 63);
|
|
1575
|
+
const expectedHash = computeSandboxConfigHash({
|
|
1576
|
+
docker: params.cfg.docker,
|
|
1577
|
+
workspaceAccess: params.cfg.workspaceAccess,
|
|
1578
|
+
workspaceDir: params.workspaceDir,
|
|
1579
|
+
agentWorkspaceDir: params.agentWorkspaceDir
|
|
1580
|
+
});
|
|
1581
|
+
const now = Date.now();
|
|
1582
|
+
const state = await dockerContainerState(containerName);
|
|
1583
|
+
let hasContainer = state.exists;
|
|
1584
|
+
let running = state.running;
|
|
1585
|
+
let currentHash = null;
|
|
1586
|
+
let hashMismatch = false;
|
|
1587
|
+
let registryEntry;
|
|
1588
|
+
if (hasContainer) {
|
|
1589
|
+
registryEntry = (await readRegistry()).entries.find((entry) => entry.containerName === containerName);
|
|
1590
|
+
currentHash = await readContainerConfigHash(containerName);
|
|
1591
|
+
if (!currentHash) currentHash = registryEntry?.configHash ?? null;
|
|
1592
|
+
hashMismatch = !currentHash || currentHash !== expectedHash;
|
|
1593
|
+
if (hashMismatch) {
|
|
1594
|
+
const lastUsedAtMs = registryEntry?.lastUsedAtMs;
|
|
1595
|
+
if (running && (typeof lastUsedAtMs !== "number" || now - lastUsedAtMs < HOT_CONTAINER_WINDOW_MS)) {
|
|
1596
|
+
const hint = formatSandboxRecreateHint({
|
|
1597
|
+
scope: params.cfg.scope,
|
|
1598
|
+
sessionKey: scopeKey
|
|
1599
|
+
});
|
|
1600
|
+
defaultRuntime.log(`Sandbox config changed for ${containerName} (recently used). Recreate to apply: ${hint}`);
|
|
1601
|
+
} else {
|
|
1602
|
+
await execDocker([
|
|
1603
|
+
"rm",
|
|
1604
|
+
"-f",
|
|
1605
|
+
containerName
|
|
1606
|
+
], { allowFailure: true });
|
|
1607
|
+
hasContainer = false;
|
|
1608
|
+
running = false;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
if (!hasContainer) await createSandboxContainer({
|
|
1613
|
+
name: containerName,
|
|
1614
|
+
cfg: params.cfg.docker,
|
|
1615
|
+
workspaceDir: params.workspaceDir,
|
|
1616
|
+
workspaceAccess: params.cfg.workspaceAccess,
|
|
1617
|
+
agentWorkspaceDir: params.agentWorkspaceDir,
|
|
1618
|
+
scopeKey,
|
|
1619
|
+
configHash: expectedHash
|
|
1620
|
+
});
|
|
1621
|
+
else if (!running) await execDocker(["start", containerName]);
|
|
1622
|
+
await updateRegistry({
|
|
1623
|
+
containerName,
|
|
1624
|
+
sessionKey: scopeKey,
|
|
1625
|
+
createdAtMs: now,
|
|
1626
|
+
lastUsedAtMs: now,
|
|
1627
|
+
image: params.cfg.docker.image,
|
|
1628
|
+
configHash: hashMismatch && running ? currentHash ?? void 0 : expectedHash
|
|
1629
|
+
});
|
|
1630
|
+
return containerName;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
//#endregion
|
|
1634
|
+
//#region src/agents/sandbox/browser.ts
|
|
1635
|
+
async function waitForSandboxCdp(params) {
|
|
1636
|
+
const deadline = Date.now() + Math.max(0, params.timeoutMs);
|
|
1637
|
+
const url = `http://127.0.0.1:${params.cdpPort}/json/version`;
|
|
1638
|
+
while (Date.now() < deadline) {
|
|
1639
|
+
try {
|
|
1640
|
+
const ctrl = new AbortController();
|
|
1641
|
+
const t = setTimeout(() => ctrl.abort(), 1e3);
|
|
1642
|
+
try {
|
|
1643
|
+
if ((await fetch(url, { signal: ctrl.signal })).ok) return true;
|
|
1644
|
+
} finally {
|
|
1645
|
+
clearTimeout(t);
|
|
1646
|
+
}
|
|
1647
|
+
} catch {}
|
|
1648
|
+
await new Promise((r) => setTimeout(r, 150));
|
|
1649
|
+
}
|
|
1650
|
+
return false;
|
|
1651
|
+
}
|
|
1652
|
+
function buildSandboxBrowserResolvedConfig(params) {
|
|
1653
|
+
return {
|
|
1654
|
+
enabled: true,
|
|
1655
|
+
evaluateEnabled: params.evaluateEnabled,
|
|
1656
|
+
controlPort: params.controlPort,
|
|
1657
|
+
cdpProtocol: "http",
|
|
1658
|
+
cdpHost: "127.0.0.1",
|
|
1659
|
+
cdpIsLoopback: true,
|
|
1660
|
+
remoteCdpTimeoutMs: 1500,
|
|
1661
|
+
remoteCdpHandshakeTimeoutMs: 3e3,
|
|
1662
|
+
color: DEFAULT_OPENCLAW_BROWSER_COLOR,
|
|
1663
|
+
executablePath: void 0,
|
|
1664
|
+
headless: params.headless,
|
|
1665
|
+
noSandbox: false,
|
|
1666
|
+
attachOnly: true,
|
|
1667
|
+
defaultProfile: DEFAULT_OPENCLAW_BROWSER_PROFILE_NAME,
|
|
1668
|
+
profiles: { [DEFAULT_OPENCLAW_BROWSER_PROFILE_NAME]: {
|
|
1669
|
+
cdpPort: params.cdpPort,
|
|
1670
|
+
color: DEFAULT_OPENCLAW_BROWSER_COLOR
|
|
1671
|
+
} }
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
async function ensureSandboxBrowserImage(image) {
|
|
1675
|
+
if ((await execDocker([
|
|
1676
|
+
"image",
|
|
1677
|
+
"inspect",
|
|
1678
|
+
image
|
|
1679
|
+
], { allowFailure: true })).code === 0) return;
|
|
1680
|
+
throw new Error(`Sandbox browser image not found: ${image}. Build it with scripts/sandbox-browser-setup.sh.`);
|
|
1681
|
+
}
|
|
1682
|
+
async function ensureSandboxBrowser(params) {
|
|
1683
|
+
if (!params.cfg.browser.enabled) return null;
|
|
1684
|
+
if (!isToolAllowed(params.cfg.tools, "browser")) return null;
|
|
1685
|
+
const slug = params.cfg.scope === "shared" ? "shared" : slugifySessionKey(params.scopeKey);
|
|
1686
|
+
const containerName = `${params.cfg.browser.containerPrefix}${slug}`.slice(0, 63);
|
|
1687
|
+
const state = await dockerContainerState(containerName);
|
|
1688
|
+
if (!state.exists) {
|
|
1689
|
+
await ensureSandboxBrowserImage(params.cfg.browser.image ?? DEFAULT_SANDBOX_BROWSER_IMAGE);
|
|
1690
|
+
const args = buildSandboxCreateArgs({
|
|
1691
|
+
name: containerName,
|
|
1692
|
+
cfg: params.cfg.docker,
|
|
1693
|
+
scopeKey: params.scopeKey,
|
|
1694
|
+
labels: { "openclaw.sandboxBrowser": "1" }
|
|
1695
|
+
});
|
|
1696
|
+
const mainMountSuffix = params.cfg.workspaceAccess === "ro" && params.workspaceDir === params.agentWorkspaceDir ? ":ro" : "";
|
|
1697
|
+
args.push("-v", `${params.workspaceDir}:${params.cfg.docker.workdir}${mainMountSuffix}`);
|
|
1698
|
+
if (params.cfg.workspaceAccess !== "none" && params.workspaceDir !== params.agentWorkspaceDir) {
|
|
1699
|
+
const agentMountSuffix = params.cfg.workspaceAccess === "ro" ? ":ro" : "";
|
|
1700
|
+
args.push("-v", `${params.agentWorkspaceDir}:${SANDBOX_AGENT_WORKSPACE_MOUNT}${agentMountSuffix}`);
|
|
1701
|
+
}
|
|
1702
|
+
args.push("-p", `127.0.0.1::${params.cfg.browser.cdpPort}`);
|
|
1703
|
+
if (params.cfg.browser.enableNoVnc && !params.cfg.browser.headless) args.push("-p", `127.0.0.1::${params.cfg.browser.noVncPort}`);
|
|
1704
|
+
args.push("-e", `OPENCLAW_BROWSER_HEADLESS=${params.cfg.browser.headless ? "1" : "0"}`);
|
|
1705
|
+
args.push("-e", `OPENCLAW_BROWSER_ENABLE_NOVNC=${params.cfg.browser.enableNoVnc ? "1" : "0"}`);
|
|
1706
|
+
args.push("-e", `OPENCLAW_BROWSER_CDP_PORT=${params.cfg.browser.cdpPort}`);
|
|
1707
|
+
args.push("-e", `OPENCLAW_BROWSER_VNC_PORT=${params.cfg.browser.vncPort}`);
|
|
1708
|
+
args.push("-e", `OPENCLAW_BROWSER_NOVNC_PORT=${params.cfg.browser.noVncPort}`);
|
|
1709
|
+
args.push(params.cfg.browser.image);
|
|
1710
|
+
await execDocker(args);
|
|
1711
|
+
await execDocker(["start", containerName]);
|
|
1712
|
+
} else if (!state.running) await execDocker(["start", containerName]);
|
|
1713
|
+
const mappedCdp = await readDockerPort(containerName, params.cfg.browser.cdpPort);
|
|
1714
|
+
if (!mappedCdp) throw new Error(`Failed to resolve CDP port mapping for ${containerName}.`);
|
|
1715
|
+
const mappedNoVnc = params.cfg.browser.enableNoVnc && !params.cfg.browser.headless ? await readDockerPort(containerName, params.cfg.browser.noVncPort) : null;
|
|
1716
|
+
const existing = BROWSER_BRIDGES.get(params.scopeKey);
|
|
1717
|
+
const existingProfile = existing ? resolveProfile(existing.bridge.state.resolved, DEFAULT_OPENCLAW_BROWSER_PROFILE_NAME) : null;
|
|
1718
|
+
const shouldReuse = existing && existing.containerName === containerName && existingProfile?.cdpPort === mappedCdp;
|
|
1719
|
+
if (existing && !shouldReuse) {
|
|
1720
|
+
await stopBrowserBridgeServer(existing.bridge.server).catch(() => void 0);
|
|
1721
|
+
BROWSER_BRIDGES.delete(params.scopeKey);
|
|
1722
|
+
}
|
|
1723
|
+
const bridge = (() => {
|
|
1724
|
+
if (shouldReuse && existing) return existing.bridge;
|
|
1725
|
+
return null;
|
|
1726
|
+
})();
|
|
1727
|
+
const ensureBridge = async () => {
|
|
1728
|
+
if (bridge) return bridge;
|
|
1729
|
+
const onEnsureAttachTarget = params.cfg.browser.autoStart ? async () => {
|
|
1730
|
+
const state = await dockerContainerState(containerName);
|
|
1731
|
+
if (state.exists && !state.running) await execDocker(["start", containerName]);
|
|
1732
|
+
if (!await waitForSandboxCdp({
|
|
1733
|
+
cdpPort: mappedCdp,
|
|
1734
|
+
timeoutMs: params.cfg.browser.autoStartTimeoutMs
|
|
1735
|
+
})) throw new Error(`Sandbox browser CDP did not become reachable on 127.0.0.1:${mappedCdp} within ${params.cfg.browser.autoStartTimeoutMs}ms.`);
|
|
1736
|
+
} : void 0;
|
|
1737
|
+
return await startBrowserBridgeServer({
|
|
1738
|
+
resolved: buildSandboxBrowserResolvedConfig({
|
|
1739
|
+
controlPort: 0,
|
|
1740
|
+
cdpPort: mappedCdp,
|
|
1741
|
+
headless: params.cfg.browser.headless,
|
|
1742
|
+
evaluateEnabled: params.evaluateEnabled ?? DEFAULT_BROWSER_EVALUATE_ENABLED
|
|
1743
|
+
}),
|
|
1744
|
+
onEnsureAttachTarget
|
|
1745
|
+
});
|
|
1746
|
+
};
|
|
1747
|
+
const resolvedBridge = await ensureBridge();
|
|
1748
|
+
if (!shouldReuse) BROWSER_BRIDGES.set(params.scopeKey, {
|
|
1749
|
+
bridge: resolvedBridge,
|
|
1750
|
+
containerName
|
|
1751
|
+
});
|
|
1752
|
+
const now = Date.now();
|
|
1753
|
+
await updateBrowserRegistry({
|
|
1754
|
+
containerName,
|
|
1755
|
+
sessionKey: params.scopeKey,
|
|
1756
|
+
createdAtMs: now,
|
|
1757
|
+
lastUsedAtMs: now,
|
|
1758
|
+
image: params.cfg.browser.image,
|
|
1759
|
+
cdpPort: mappedCdp,
|
|
1760
|
+
noVncPort: mappedNoVnc ?? void 0
|
|
1761
|
+
});
|
|
1762
|
+
const noVncUrl = mappedNoVnc && params.cfg.browser.enableNoVnc && !params.cfg.browser.headless ? `http://127.0.0.1:${mappedNoVnc}/vnc.html?autoconnect=1&resize=remote` : void 0;
|
|
1763
|
+
return {
|
|
1764
|
+
bridgeUrl: resolvedBridge.baseUrl,
|
|
1765
|
+
noVncUrl,
|
|
1766
|
+
containerName
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
//#endregion
|
|
1771
|
+
//#region src/agents/sandbox/prune.ts
|
|
1772
|
+
let lastPruneAtMs = 0;
|
|
1773
|
+
async function pruneSandboxContainers(cfg) {
|
|
1774
|
+
const now = Date.now();
|
|
1775
|
+
const idleHours = cfg.prune.idleHours;
|
|
1776
|
+
const maxAgeDays = cfg.prune.maxAgeDays;
|
|
1777
|
+
if (idleHours === 0 && maxAgeDays === 0) return;
|
|
1778
|
+
const registry = await readRegistry();
|
|
1779
|
+
for (const entry of registry.entries) {
|
|
1780
|
+
const idleMs = now - entry.lastUsedAtMs;
|
|
1781
|
+
const ageMs = now - entry.createdAtMs;
|
|
1782
|
+
if (idleHours > 0 && idleMs > idleHours * 60 * 60 * 1e3 || maxAgeDays > 0 && ageMs > maxAgeDays * 24 * 60 * 60 * 1e3) try {
|
|
1783
|
+
await execDocker([
|
|
1784
|
+
"rm",
|
|
1785
|
+
"-f",
|
|
1786
|
+
entry.containerName
|
|
1787
|
+
], { allowFailure: true });
|
|
1788
|
+
} catch {} finally {
|
|
1789
|
+
await removeRegistryEntry(entry.containerName);
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
async function pruneSandboxBrowsers(cfg) {
|
|
1794
|
+
const now = Date.now();
|
|
1795
|
+
const idleHours = cfg.prune.idleHours;
|
|
1796
|
+
const maxAgeDays = cfg.prune.maxAgeDays;
|
|
1797
|
+
if (idleHours === 0 && maxAgeDays === 0) return;
|
|
1798
|
+
const registry = await readBrowserRegistry();
|
|
1799
|
+
for (const entry of registry.entries) {
|
|
1800
|
+
const idleMs = now - entry.lastUsedAtMs;
|
|
1801
|
+
const ageMs = now - entry.createdAtMs;
|
|
1802
|
+
if (idleHours > 0 && idleMs > idleHours * 60 * 60 * 1e3 || maxAgeDays > 0 && ageMs > maxAgeDays * 24 * 60 * 60 * 1e3) try {
|
|
1803
|
+
await execDocker([
|
|
1804
|
+
"rm",
|
|
1805
|
+
"-f",
|
|
1806
|
+
entry.containerName
|
|
1807
|
+
], { allowFailure: true });
|
|
1808
|
+
} catch {} finally {
|
|
1809
|
+
await removeBrowserRegistryEntry(entry.containerName);
|
|
1810
|
+
const bridge = BROWSER_BRIDGES.get(entry.sessionKey);
|
|
1811
|
+
if (bridge?.containerName === entry.containerName) {
|
|
1812
|
+
await stopBrowserBridgeServer(bridge.bridge.server).catch(() => void 0);
|
|
1813
|
+
BROWSER_BRIDGES.delete(entry.sessionKey);
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
async function maybePruneSandboxes(cfg) {
|
|
1819
|
+
const now = Date.now();
|
|
1820
|
+
if (now - lastPruneAtMs < 300 * 1e3) return;
|
|
1821
|
+
lastPruneAtMs = now;
|
|
1822
|
+
try {
|
|
1823
|
+
await pruneSandboxContainers(cfg);
|
|
1824
|
+
await pruneSandboxBrowsers(cfg);
|
|
1825
|
+
} catch (error) {
|
|
1826
|
+
const message = error instanceof Error ? error.message : typeof error === "string" ? error : JSON.stringify(error);
|
|
1827
|
+
defaultRuntime.error?.(`Sandbox prune failed: ${message ?? "unknown error"}`);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
//#endregion
|
|
1832
|
+
//#region src/config/sessions/group.ts
|
|
1833
|
+
const getGroupSurfaces = () => new Set([...listDeliverableMessageChannels(), "webchat"]);
|
|
1834
|
+
function normalizeGroupLabel(raw) {
|
|
1835
|
+
const trimmed = raw?.trim().toLowerCase() ?? "";
|
|
1836
|
+
if (!trimmed) return "";
|
|
1837
|
+
return trimmed.replace(/\s+/g, "-").replace(/[^a-z0-9#@._+-]+/g, "-").replace(/-{2,}/g, "-").replace(/^[-.]+|[-.]+$/g, "");
|
|
1838
|
+
}
|
|
1839
|
+
function shortenGroupId(value) {
|
|
1840
|
+
const trimmed = value?.trim() ?? "";
|
|
1841
|
+
if (!trimmed) return "";
|
|
1842
|
+
if (trimmed.length <= 14) return trimmed;
|
|
1843
|
+
return `${trimmed.slice(0, 6)}...${trimmed.slice(-4)}`;
|
|
1844
|
+
}
|
|
1845
|
+
function buildGroupDisplayName(params) {
|
|
1846
|
+
const providerKey = (params.provider?.trim().toLowerCase() || "group").trim();
|
|
1847
|
+
const groupChannel = params.groupChannel?.trim();
|
|
1848
|
+
const space = params.space?.trim();
|
|
1849
|
+
const subject = params.subject?.trim();
|
|
1850
|
+
const detail = (groupChannel && space ? `${space}${groupChannel.startsWith("#") ? "" : "#"}${groupChannel}` : groupChannel || subject || space || "") || "";
|
|
1851
|
+
const fallbackId = params.id?.trim() || params.key;
|
|
1852
|
+
const rawLabel = detail || fallbackId;
|
|
1853
|
+
let token = normalizeGroupLabel(rawLabel);
|
|
1854
|
+
if (!token) token = normalizeGroupLabel(shortenGroupId(rawLabel));
|
|
1855
|
+
if (!params.groupChannel && token.startsWith("#")) token = token.replace(/^#+/, "");
|
|
1856
|
+
if (token && !/^[@#]/.test(token) && !token.startsWith("g-") && !token.includes("#")) token = `g-${token}`;
|
|
1857
|
+
return token ? `${providerKey}:${token}` : providerKey;
|
|
1858
|
+
}
|
|
1859
|
+
function resolveGroupSessionKey(ctx) {
|
|
1860
|
+
const from = typeof ctx.From === "string" ? ctx.From.trim() : "";
|
|
1861
|
+
const chatType = ctx.ChatType?.trim().toLowerCase();
|
|
1862
|
+
const normalizedChatType = chatType === "channel" ? "channel" : chatType === "group" ? "group" : void 0;
|
|
1863
|
+
const isWhatsAppGroupId = from.toLowerCase().endsWith("@g.us");
|
|
1864
|
+
if (!(normalizedChatType === "group" || normalizedChatType === "channel" || from.includes(":group:") || from.includes(":channel:") || isWhatsAppGroupId)) return null;
|
|
1865
|
+
const providerHint = ctx.Provider?.trim().toLowerCase();
|
|
1866
|
+
const parts = from.split(":").filter(Boolean);
|
|
1867
|
+
const head = parts[0]?.trim().toLowerCase() ?? "";
|
|
1868
|
+
const headIsSurface = head ? getGroupSurfaces().has(head) : false;
|
|
1869
|
+
const provider = headIsSurface ? head : providerHint ?? (isWhatsAppGroupId ? "whatsapp" : void 0);
|
|
1870
|
+
if (!provider) return null;
|
|
1871
|
+
const second = parts[1]?.trim().toLowerCase();
|
|
1872
|
+
const secondIsKind = second === "group" || second === "channel";
|
|
1873
|
+
const kind = secondIsKind ? second : from.includes(":channel:") || normalizedChatType === "channel" ? "channel" : "group";
|
|
1874
|
+
const finalId = (headIsSurface ? secondIsKind ? parts.slice(2).join(":") : parts.slice(1).join(":") : from).trim().toLowerCase();
|
|
1875
|
+
if (!finalId) return null;
|
|
1876
|
+
return {
|
|
1877
|
+
key: `${provider}:${kind}:${finalId}`,
|
|
1878
|
+
channel: provider,
|
|
1879
|
+
id: finalId,
|
|
1880
|
+
chatType: kind === "channel" ? "channel" : "group"
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
//#endregion
|
|
1885
|
+
//#region src/channels/conversation-label.ts
|
|
1886
|
+
function extractConversationId(from) {
|
|
1887
|
+
const trimmed = from?.trim();
|
|
1888
|
+
if (!trimmed) return;
|
|
1889
|
+
const parts = trimmed.split(":").filter(Boolean);
|
|
1890
|
+
return parts.length > 0 ? parts[parts.length - 1] : trimmed;
|
|
1891
|
+
}
|
|
1892
|
+
function shouldAppendId(id) {
|
|
1893
|
+
if (/^[0-9]+$/.test(id)) return true;
|
|
1894
|
+
if (id.includes("@g.us")) return true;
|
|
1895
|
+
return false;
|
|
1896
|
+
}
|
|
1897
|
+
function resolveConversationLabel(ctx) {
|
|
1898
|
+
const explicit = ctx.ConversationLabel?.trim();
|
|
1899
|
+
if (explicit) return explicit;
|
|
1900
|
+
const threadLabel = ctx.ThreadLabel?.trim();
|
|
1901
|
+
if (threadLabel) return threadLabel;
|
|
1902
|
+
if (normalizeChatType(ctx.ChatType) === "direct") return ctx.SenderName?.trim() || ctx.From?.trim() || void 0;
|
|
1903
|
+
const base = ctx.GroupChannel?.trim() || ctx.GroupSubject?.trim() || ctx.GroupSpace?.trim() || ctx.From?.trim() || "";
|
|
1904
|
+
if (!base) return;
|
|
1905
|
+
const id = extractConversationId(ctx.From);
|
|
1906
|
+
if (!id) return base;
|
|
1907
|
+
if (!shouldAppendId(id)) return base;
|
|
1908
|
+
if (base === id) return base;
|
|
1909
|
+
if (base.includes(id)) return base;
|
|
1910
|
+
if (base.toLowerCase().includes(" id:")) return base;
|
|
1911
|
+
if (base.startsWith("#") || base.startsWith("@")) return base;
|
|
1912
|
+
return `${base} id:${id}`;
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
//#endregion
|
|
1916
|
+
//#region src/config/sessions/metadata.ts
|
|
1917
|
+
const mergeOrigin = (existing, next) => {
|
|
1918
|
+
if (!existing && !next) return;
|
|
1919
|
+
const merged = existing ? { ...existing } : {};
|
|
1920
|
+
if (next?.label) merged.label = next.label;
|
|
1921
|
+
if (next?.provider) merged.provider = next.provider;
|
|
1922
|
+
if (next?.surface) merged.surface = next.surface;
|
|
1923
|
+
if (next?.chatType) merged.chatType = next.chatType;
|
|
1924
|
+
if (next?.from) merged.from = next.from;
|
|
1925
|
+
if (next?.to) merged.to = next.to;
|
|
1926
|
+
if (next?.accountId) merged.accountId = next.accountId;
|
|
1927
|
+
if (next?.threadId != null && next.threadId !== "") merged.threadId = next.threadId;
|
|
1928
|
+
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
1929
|
+
};
|
|
1930
|
+
function deriveSessionOrigin(ctx) {
|
|
1931
|
+
const label = resolveConversationLabel(ctx)?.trim();
|
|
1932
|
+
const provider = normalizeMessageChannel(typeof ctx.OriginatingChannel === "string" && ctx.OriginatingChannel || ctx.Surface || ctx.Provider);
|
|
1933
|
+
const surface = ctx.Surface?.trim().toLowerCase();
|
|
1934
|
+
const chatType = normalizeChatType(ctx.ChatType) ?? void 0;
|
|
1935
|
+
const from = ctx.From?.trim();
|
|
1936
|
+
const to = (typeof ctx.OriginatingTo === "string" ? ctx.OriginatingTo : ctx.To)?.trim() ?? void 0;
|
|
1937
|
+
const accountId = ctx.AccountId?.trim();
|
|
1938
|
+
const threadId = ctx.MessageThreadId ?? void 0;
|
|
1939
|
+
const origin = {};
|
|
1940
|
+
if (label) origin.label = label;
|
|
1941
|
+
if (provider) origin.provider = provider;
|
|
1942
|
+
if (surface) origin.surface = surface;
|
|
1943
|
+
if (chatType) origin.chatType = chatType;
|
|
1944
|
+
if (from) origin.from = from;
|
|
1945
|
+
if (to) origin.to = to;
|
|
1946
|
+
if (accountId) origin.accountId = accountId;
|
|
1947
|
+
if (threadId != null && threadId !== "") origin.threadId = threadId;
|
|
1948
|
+
return Object.keys(origin).length > 0 ? origin : void 0;
|
|
1949
|
+
}
|
|
1950
|
+
function snapshotSessionOrigin(entry) {
|
|
1951
|
+
if (!entry?.origin) return;
|
|
1952
|
+
return { ...entry.origin };
|
|
1953
|
+
}
|
|
1954
|
+
function deriveGroupSessionPatch(params) {
|
|
1955
|
+
const resolution = params.groupResolution ?? resolveGroupSessionKey(params.ctx);
|
|
1956
|
+
if (!resolution?.channel) return null;
|
|
1957
|
+
const channel = resolution.channel;
|
|
1958
|
+
const subject = params.ctx.GroupSubject?.trim();
|
|
1959
|
+
const space = params.ctx.GroupSpace?.trim();
|
|
1960
|
+
const explicitChannel = params.ctx.GroupChannel?.trim();
|
|
1961
|
+
const normalizedChannel = normalizeChannelId(channel);
|
|
1962
|
+
const isChannelProvider = Boolean(normalizedChannel && getChannelDock(normalizedChannel)?.capabilities.chatTypes.includes("channel"));
|
|
1963
|
+
const nextGroupChannel = explicitChannel ?? ((resolution.chatType === "channel" || isChannelProvider) && subject && subject.startsWith("#") ? subject : void 0);
|
|
1964
|
+
const nextSubject = nextGroupChannel ? void 0 : subject;
|
|
1965
|
+
const patch = {
|
|
1966
|
+
chatType: resolution.chatType ?? "group",
|
|
1967
|
+
channel,
|
|
1968
|
+
groupId: resolution.id
|
|
1969
|
+
};
|
|
1970
|
+
if (nextSubject) patch.subject = nextSubject;
|
|
1971
|
+
if (nextGroupChannel) patch.groupChannel = nextGroupChannel;
|
|
1972
|
+
if (space) patch.space = space;
|
|
1973
|
+
const displayName = buildGroupDisplayName({
|
|
1974
|
+
provider: channel,
|
|
1975
|
+
subject: nextSubject ?? params.existing?.subject,
|
|
1976
|
+
groupChannel: nextGroupChannel ?? params.existing?.groupChannel,
|
|
1977
|
+
space: space ?? params.existing?.space,
|
|
1978
|
+
id: resolution.id,
|
|
1979
|
+
key: params.sessionKey
|
|
1980
|
+
});
|
|
1981
|
+
if (displayName) patch.displayName = displayName;
|
|
1982
|
+
return patch;
|
|
1983
|
+
}
|
|
1984
|
+
function deriveSessionMetaPatch(params) {
|
|
1985
|
+
const groupPatch = deriveGroupSessionPatch(params);
|
|
1986
|
+
const origin = deriveSessionOrigin(params.ctx);
|
|
1987
|
+
if (!groupPatch && !origin) return null;
|
|
1988
|
+
const patch = groupPatch ? { ...groupPatch } : {};
|
|
1989
|
+
const mergedOrigin = mergeOrigin(params.existing?.origin, origin);
|
|
1990
|
+
if (mergedOrigin) patch.origin = mergedOrigin;
|
|
1991
|
+
return Object.keys(patch).length > 0 ? patch : null;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
//#endregion
|
|
1995
|
+
//#region src/config/sessions/main-session.ts
|
|
1996
|
+
function resolveMainSessionKey(cfg) {
|
|
1997
|
+
if (cfg?.session?.scope === "global") return "global";
|
|
1998
|
+
const agents = cfg?.agents?.list ?? [];
|
|
1999
|
+
return buildAgentMainSessionKey({
|
|
2000
|
+
agentId: normalizeAgentId(agents.find((agent) => agent?.default)?.id ?? agents[0]?.id ?? DEFAULT_AGENT_ID),
|
|
2001
|
+
mainKey: normalizeMainKey(cfg?.session?.mainKey)
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
2004
|
+
function resolveMainSessionKeyFromConfig() {
|
|
2005
|
+
return resolveMainSessionKey(loadConfig());
|
|
2006
|
+
}
|
|
2007
|
+
function resolveAgentMainSessionKey(params) {
|
|
2008
|
+
const mainKey = normalizeMainKey(params.cfg?.session?.mainKey);
|
|
2009
|
+
return buildAgentMainSessionKey({
|
|
2010
|
+
agentId: params.agentId,
|
|
2011
|
+
mainKey
|
|
2012
|
+
});
|
|
2013
|
+
}
|
|
2014
|
+
function resolveExplicitAgentSessionKey(params) {
|
|
2015
|
+
const agentId = params.agentId?.trim();
|
|
2016
|
+
if (!agentId) return;
|
|
2017
|
+
return resolveAgentMainSessionKey({
|
|
2018
|
+
cfg: params.cfg,
|
|
2019
|
+
agentId
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
function canonicalizeMainSessionAlias(params) {
|
|
2023
|
+
const raw = params.sessionKey.trim();
|
|
2024
|
+
if (!raw) return raw;
|
|
2025
|
+
const agentId = normalizeAgentId(params.agentId);
|
|
2026
|
+
const mainKey = normalizeMainKey(params.cfg?.session?.mainKey);
|
|
2027
|
+
const agentMainSessionKey = buildAgentMainSessionKey({
|
|
2028
|
+
agentId,
|
|
2029
|
+
mainKey
|
|
2030
|
+
});
|
|
2031
|
+
const agentMainAliasKey = buildAgentMainSessionKey({
|
|
2032
|
+
agentId,
|
|
2033
|
+
mainKey: "main"
|
|
2034
|
+
});
|
|
2035
|
+
const isMainAlias = raw === "main" || raw === mainKey || raw === agentMainSessionKey || raw === agentMainAliasKey;
|
|
2036
|
+
if (params.cfg?.session?.scope === "global" && isMainAlias) return "global";
|
|
2037
|
+
if (isMainAlias) return agentMainSessionKey;
|
|
2038
|
+
return raw;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
//#endregion
|
|
2042
|
+
//#region src/config/sessions/types.ts
|
|
2043
|
+
function mergeSessionEntry(existing, patch) {
|
|
2044
|
+
const sessionId = patch.sessionId ?? existing?.sessionId ?? crypto.randomUUID();
|
|
2045
|
+
const updatedAt = Math.max(existing?.updatedAt ?? 0, patch.updatedAt ?? 0, Date.now());
|
|
2046
|
+
if (!existing) return {
|
|
2047
|
+
...patch,
|
|
2048
|
+
sessionId,
|
|
2049
|
+
updatedAt
|
|
2050
|
+
};
|
|
2051
|
+
return {
|
|
2052
|
+
...existing,
|
|
2053
|
+
...patch,
|
|
2054
|
+
sessionId,
|
|
2055
|
+
updatedAt
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
const DEFAULT_RESET_TRIGGERS = ["/new", "/reset"];
|
|
2059
|
+
const DEFAULT_IDLE_MINUTES = 60;
|
|
2060
|
+
|
|
2061
|
+
//#endregion
|
|
2062
|
+
//#region src/config/sessions/reset.ts
|
|
2063
|
+
const DEFAULT_RESET_MODE = "daily";
|
|
2064
|
+
const DEFAULT_RESET_AT_HOUR = 4;
|
|
2065
|
+
const THREAD_SESSION_MARKERS = [":thread:", ":topic:"];
|
|
2066
|
+
const GROUP_SESSION_MARKERS = [":group:", ":channel:"];
|
|
2067
|
+
function isThreadSessionKey(sessionKey) {
|
|
2068
|
+
const normalized = (sessionKey ?? "").toLowerCase();
|
|
2069
|
+
if (!normalized) return false;
|
|
2070
|
+
return THREAD_SESSION_MARKERS.some((marker) => normalized.includes(marker));
|
|
2071
|
+
}
|
|
2072
|
+
function resolveSessionResetType(params) {
|
|
2073
|
+
if (params.isThread || isThreadSessionKey(params.sessionKey)) return "thread";
|
|
2074
|
+
if (params.isGroup) return "group";
|
|
2075
|
+
const normalized = (params.sessionKey ?? "").toLowerCase();
|
|
2076
|
+
if (GROUP_SESSION_MARKERS.some((marker) => normalized.includes(marker))) return "group";
|
|
2077
|
+
return "dm";
|
|
2078
|
+
}
|
|
2079
|
+
function resolveThreadFlag(params) {
|
|
2080
|
+
if (params.messageThreadId != null) return true;
|
|
2081
|
+
if (params.threadLabel?.trim()) return true;
|
|
2082
|
+
if (params.threadStarterBody?.trim()) return true;
|
|
2083
|
+
if (params.parentSessionKey?.trim()) return true;
|
|
2084
|
+
return isThreadSessionKey(params.sessionKey);
|
|
2085
|
+
}
|
|
2086
|
+
function resolveDailyResetAtMs(now, atHour) {
|
|
2087
|
+
const normalizedAtHour = normalizeResetAtHour(atHour);
|
|
2088
|
+
const resetAt = new Date(now);
|
|
2089
|
+
resetAt.setHours(normalizedAtHour, 0, 0, 0);
|
|
2090
|
+
if (now < resetAt.getTime()) resetAt.setDate(resetAt.getDate() - 1);
|
|
2091
|
+
return resetAt.getTime();
|
|
2092
|
+
}
|
|
2093
|
+
function resolveSessionResetPolicy(params) {
|
|
2094
|
+
const sessionCfg = params.sessionCfg;
|
|
2095
|
+
const baseReset = params.resetOverride ?? sessionCfg?.reset;
|
|
2096
|
+
const typeReset = params.resetOverride ? void 0 : sessionCfg?.resetByType?.[params.resetType];
|
|
2097
|
+
const hasExplicitReset = Boolean(baseReset || sessionCfg?.resetByType);
|
|
2098
|
+
const legacyIdleMinutes = params.resetOverride ? void 0 : sessionCfg?.idleMinutes;
|
|
2099
|
+
const mode = typeReset?.mode ?? baseReset?.mode ?? (!hasExplicitReset && legacyIdleMinutes != null ? "idle" : DEFAULT_RESET_MODE);
|
|
2100
|
+
const atHour = normalizeResetAtHour(typeReset?.atHour ?? baseReset?.atHour ?? DEFAULT_RESET_AT_HOUR);
|
|
2101
|
+
const idleMinutesRaw = typeReset?.idleMinutes ?? baseReset?.idleMinutes ?? legacyIdleMinutes;
|
|
2102
|
+
let idleMinutes;
|
|
2103
|
+
if (idleMinutesRaw != null) {
|
|
2104
|
+
const normalized = Math.floor(idleMinutesRaw);
|
|
2105
|
+
if (Number.isFinite(normalized)) idleMinutes = Math.max(normalized, 1);
|
|
2106
|
+
} else if (mode === "idle") idleMinutes = DEFAULT_IDLE_MINUTES;
|
|
2107
|
+
return {
|
|
2108
|
+
mode,
|
|
2109
|
+
atHour,
|
|
2110
|
+
idleMinutes
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
function resolveChannelResetConfig(params) {
|
|
2114
|
+
const resetByChannel = params.sessionCfg?.resetByChannel;
|
|
2115
|
+
if (!resetByChannel) return;
|
|
2116
|
+
const normalized = normalizeMessageChannel(params.channel);
|
|
2117
|
+
const fallback = params.channel?.trim().toLowerCase();
|
|
2118
|
+
const key = normalized ?? fallback;
|
|
2119
|
+
if (!key) return;
|
|
2120
|
+
return resetByChannel[key] ?? resetByChannel[key.toLowerCase()];
|
|
2121
|
+
}
|
|
2122
|
+
function evaluateSessionFreshness(params) {
|
|
2123
|
+
const dailyResetAt = params.policy.mode === "daily" ? resolveDailyResetAtMs(params.now, params.policy.atHour) : void 0;
|
|
2124
|
+
const idleExpiresAt = params.policy.idleMinutes != null ? params.updatedAt + params.policy.idleMinutes * 6e4 : void 0;
|
|
2125
|
+
const staleDaily = dailyResetAt != null && params.updatedAt < dailyResetAt;
|
|
2126
|
+
const staleIdle = idleExpiresAt != null && params.now > idleExpiresAt;
|
|
2127
|
+
return {
|
|
2128
|
+
fresh: !(staleDaily || staleIdle),
|
|
2129
|
+
dailyResetAt,
|
|
2130
|
+
idleExpiresAt
|
|
2131
|
+
};
|
|
2132
|
+
}
|
|
2133
|
+
function normalizeResetAtHour(value) {
|
|
2134
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return DEFAULT_RESET_AT_HOUR;
|
|
2135
|
+
const normalized = Math.floor(value);
|
|
2136
|
+
if (!Number.isFinite(normalized)) return DEFAULT_RESET_AT_HOUR;
|
|
2137
|
+
if (normalized < 0) return 0;
|
|
2138
|
+
if (normalized > 23) return 23;
|
|
2139
|
+
return normalized;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
//#endregion
|
|
2143
|
+
//#region src/config/sessions/session-key.ts
|
|
2144
|
+
function deriveSessionKey(scope, ctx) {
|
|
2145
|
+
if (scope === "global") return "global";
|
|
2146
|
+
const resolvedGroup = resolveGroupSessionKey(ctx);
|
|
2147
|
+
if (resolvedGroup) return resolvedGroup.key;
|
|
2148
|
+
return (ctx.From ? normalizeE164(ctx.From) : "") || "unknown";
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* Resolve the session key with a canonical direct-chat bucket (default: "main").
|
|
2152
|
+
* All non-group direct chats collapse to this bucket; groups stay isolated.
|
|
2153
|
+
*/
|
|
2154
|
+
function resolveSessionKey(scope, ctx, mainKey) {
|
|
2155
|
+
const explicit = ctx.SessionKey?.trim();
|
|
2156
|
+
if (explicit) return explicit.toLowerCase();
|
|
2157
|
+
const raw = deriveSessionKey(scope, ctx);
|
|
2158
|
+
if (scope === "global") return raw;
|
|
2159
|
+
const canonical = buildAgentMainSessionKey({
|
|
2160
|
+
agentId: DEFAULT_AGENT_ID,
|
|
2161
|
+
mainKey: normalizeMainKey(mainKey)
|
|
2162
|
+
});
|
|
2163
|
+
if (!(raw.includes(":group:") || raw.includes(":channel:"))) return canonical;
|
|
2164
|
+
return `agent:${DEFAULT_AGENT_ID}:${raw}`;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
//#endregion
|
|
2168
|
+
//#region src/utils/account-id.ts
|
|
2169
|
+
function normalizeAccountId(value) {
|
|
2170
|
+
if (typeof value !== "string") return;
|
|
2171
|
+
return value.trim() || void 0;
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
//#endregion
|
|
2175
|
+
//#region src/utils/delivery-context.ts
|
|
2176
|
+
function normalizeDeliveryContext(context) {
|
|
2177
|
+
if (!context) return;
|
|
2178
|
+
const channel = typeof context.channel === "string" ? normalizeMessageChannel(context.channel) ?? context.channel.trim() : void 0;
|
|
2179
|
+
const to = typeof context.to === "string" ? context.to.trim() : void 0;
|
|
2180
|
+
const accountId = normalizeAccountId(context.accountId);
|
|
2181
|
+
const threadId = typeof context.threadId === "number" && Number.isFinite(context.threadId) ? Math.trunc(context.threadId) : typeof context.threadId === "string" ? context.threadId.trim() : void 0;
|
|
2182
|
+
const normalizedThreadId = typeof threadId === "string" ? threadId ? threadId : void 0 : threadId;
|
|
2183
|
+
if (!channel && !to && !accountId && normalizedThreadId == null) return;
|
|
2184
|
+
const normalized = {
|
|
2185
|
+
channel: channel || void 0,
|
|
2186
|
+
to: to || void 0,
|
|
2187
|
+
accountId
|
|
2188
|
+
};
|
|
2189
|
+
if (normalizedThreadId != null) normalized.threadId = normalizedThreadId;
|
|
2190
|
+
return normalized;
|
|
2191
|
+
}
|
|
2192
|
+
function normalizeSessionDeliveryFields(source) {
|
|
2193
|
+
if (!source) return {
|
|
2194
|
+
deliveryContext: void 0,
|
|
2195
|
+
lastChannel: void 0,
|
|
2196
|
+
lastTo: void 0,
|
|
2197
|
+
lastAccountId: void 0,
|
|
2198
|
+
lastThreadId: void 0
|
|
2199
|
+
};
|
|
2200
|
+
const merged = mergeDeliveryContext(normalizeDeliveryContext({
|
|
2201
|
+
channel: source.lastChannel ?? source.channel,
|
|
2202
|
+
to: source.lastTo,
|
|
2203
|
+
accountId: source.lastAccountId,
|
|
2204
|
+
threadId: source.lastThreadId
|
|
2205
|
+
}), normalizeDeliveryContext(source.deliveryContext));
|
|
2206
|
+
if (!merged) return {
|
|
2207
|
+
deliveryContext: void 0,
|
|
2208
|
+
lastChannel: void 0,
|
|
2209
|
+
lastTo: void 0,
|
|
2210
|
+
lastAccountId: void 0,
|
|
2211
|
+
lastThreadId: void 0
|
|
2212
|
+
};
|
|
2213
|
+
return {
|
|
2214
|
+
deliveryContext: merged,
|
|
2215
|
+
lastChannel: merged.channel,
|
|
2216
|
+
lastTo: merged.to,
|
|
2217
|
+
lastAccountId: merged.accountId,
|
|
2218
|
+
lastThreadId: merged.threadId
|
|
2219
|
+
};
|
|
2220
|
+
}
|
|
2221
|
+
function deliveryContextFromSession(entry) {
|
|
2222
|
+
if (!entry) return;
|
|
2223
|
+
return normalizeSessionDeliveryFields({
|
|
2224
|
+
channel: entry.channel,
|
|
2225
|
+
lastChannel: entry.lastChannel,
|
|
2226
|
+
lastTo: entry.lastTo,
|
|
2227
|
+
lastAccountId: entry.lastAccountId,
|
|
2228
|
+
lastThreadId: entry.lastThreadId ?? entry.deliveryContext?.threadId ?? entry.origin?.threadId,
|
|
2229
|
+
deliveryContext: entry.deliveryContext
|
|
2230
|
+
}).deliveryContext;
|
|
2231
|
+
}
|
|
2232
|
+
function mergeDeliveryContext(primary, fallback) {
|
|
2233
|
+
const normalizedPrimary = normalizeDeliveryContext(primary);
|
|
2234
|
+
const normalizedFallback = normalizeDeliveryContext(fallback);
|
|
2235
|
+
if (!normalizedPrimary && !normalizedFallback) return;
|
|
2236
|
+
return normalizeDeliveryContext({
|
|
2237
|
+
channel: normalizedPrimary?.channel ?? normalizedFallback?.channel,
|
|
2238
|
+
to: normalizedPrimary?.to ?? normalizedFallback?.to,
|
|
2239
|
+
accountId: normalizedPrimary?.accountId ?? normalizedFallback?.accountId,
|
|
2240
|
+
threadId: normalizedPrimary?.threadId ?? normalizedFallback?.threadId
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
function deliveryContextKey(context) {
|
|
2244
|
+
const normalized = normalizeDeliveryContext(context);
|
|
2245
|
+
if (!normalized?.channel || !normalized?.to) return;
|
|
2246
|
+
const threadId = normalized.threadId != null && normalized.threadId !== "" ? String(normalized.threadId) : "";
|
|
2247
|
+
return `${normalized.channel}|${normalized.to}|${normalized.accountId ?? ""}|${threadId}`;
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
//#endregion
|
|
2251
|
+
//#region src/config/cache-utils.ts
|
|
2252
|
+
function resolveCacheTtlMs(params) {
|
|
2253
|
+
const { envValue, defaultTtlMs } = params;
|
|
2254
|
+
if (envValue) {
|
|
2255
|
+
const parsed = Number.parseInt(envValue, 10);
|
|
2256
|
+
if (Number.isFinite(parsed) && parsed >= 0) return parsed;
|
|
2257
|
+
}
|
|
2258
|
+
return defaultTtlMs;
|
|
2259
|
+
}
|
|
2260
|
+
function isCacheEnabled(ttlMs) {
|
|
2261
|
+
return ttlMs > 0;
|
|
2262
|
+
}
|
|
2263
|
+
function getFileMtimeMs(filePath) {
|
|
2264
|
+
try {
|
|
2265
|
+
return fs.statSync(filePath).mtimeMs;
|
|
2266
|
+
} catch {
|
|
2267
|
+
return;
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
//#endregion
|
|
2272
|
+
//#region src/config/sessions/store.ts
|
|
2273
|
+
const SESSION_STORE_CACHE = /* @__PURE__ */ new Map();
|
|
2274
|
+
const DEFAULT_SESSION_STORE_TTL_MS = 45e3;
|
|
2275
|
+
function isSessionStoreRecord(value) {
|
|
2276
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
2277
|
+
}
|
|
2278
|
+
function getSessionStoreTtl() {
|
|
2279
|
+
return resolveCacheTtlMs({
|
|
2280
|
+
envValue: process.env.OPENCLAW_SESSION_CACHE_TTL_MS,
|
|
2281
|
+
defaultTtlMs: DEFAULT_SESSION_STORE_TTL_MS
|
|
2282
|
+
});
|
|
2283
|
+
}
|
|
2284
|
+
function isSessionStoreCacheEnabled() {
|
|
2285
|
+
return isCacheEnabled(getSessionStoreTtl());
|
|
2286
|
+
}
|
|
2287
|
+
function isSessionStoreCacheValid(entry) {
|
|
2288
|
+
const now = Date.now();
|
|
2289
|
+
const ttl = getSessionStoreTtl();
|
|
2290
|
+
return now - entry.loadedAt <= ttl;
|
|
2291
|
+
}
|
|
2292
|
+
function invalidateSessionStoreCache(storePath) {
|
|
2293
|
+
SESSION_STORE_CACHE.delete(storePath);
|
|
2294
|
+
}
|
|
2295
|
+
function normalizeSessionEntryDelivery(entry) {
|
|
2296
|
+
const normalized = normalizeSessionDeliveryFields({
|
|
2297
|
+
channel: entry.channel,
|
|
2298
|
+
lastChannel: entry.lastChannel,
|
|
2299
|
+
lastTo: entry.lastTo,
|
|
2300
|
+
lastAccountId: entry.lastAccountId,
|
|
2301
|
+
lastThreadId: entry.lastThreadId ?? entry.deliveryContext?.threadId ?? entry.origin?.threadId,
|
|
2302
|
+
deliveryContext: entry.deliveryContext
|
|
2303
|
+
});
|
|
2304
|
+
const nextDelivery = normalized.deliveryContext;
|
|
2305
|
+
const sameDelivery = (entry.deliveryContext?.channel ?? void 0) === nextDelivery?.channel && (entry.deliveryContext?.to ?? void 0) === nextDelivery?.to && (entry.deliveryContext?.accountId ?? void 0) === nextDelivery?.accountId && (entry.deliveryContext?.threadId ?? void 0) === nextDelivery?.threadId;
|
|
2306
|
+
const sameLast = entry.lastChannel === normalized.lastChannel && entry.lastTo === normalized.lastTo && entry.lastAccountId === normalized.lastAccountId && entry.lastThreadId === normalized.lastThreadId;
|
|
2307
|
+
if (sameDelivery && sameLast) return entry;
|
|
2308
|
+
return {
|
|
2309
|
+
...entry,
|
|
2310
|
+
deliveryContext: nextDelivery,
|
|
2311
|
+
lastChannel: normalized.lastChannel,
|
|
2312
|
+
lastTo: normalized.lastTo,
|
|
2313
|
+
lastAccountId: normalized.lastAccountId,
|
|
2314
|
+
lastThreadId: normalized.lastThreadId
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
function normalizeSessionStore(store) {
|
|
2318
|
+
for (const [key, entry] of Object.entries(store)) {
|
|
2319
|
+
if (!entry) continue;
|
|
2320
|
+
const normalized = normalizeSessionEntryDelivery(entry);
|
|
2321
|
+
if (normalized !== entry) store[key] = normalized;
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
function loadSessionStore(storePath, opts = {}) {
|
|
2325
|
+
if (!opts.skipCache && isSessionStoreCacheEnabled()) {
|
|
2326
|
+
const cached = SESSION_STORE_CACHE.get(storePath);
|
|
2327
|
+
if (cached && isSessionStoreCacheValid(cached)) {
|
|
2328
|
+
if (getFileMtimeMs(storePath) === cached.mtimeMs) return structuredClone(cached.store);
|
|
2329
|
+
invalidateSessionStoreCache(storePath);
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
let store = {};
|
|
2333
|
+
let mtimeMs = getFileMtimeMs(storePath);
|
|
2334
|
+
try {
|
|
2335
|
+
const raw = fs.readFileSync(storePath, "utf-8");
|
|
2336
|
+
const parsed = JSON5.parse(raw);
|
|
2337
|
+
if (isSessionStoreRecord(parsed)) store = parsed;
|
|
2338
|
+
mtimeMs = getFileMtimeMs(storePath) ?? mtimeMs;
|
|
2339
|
+
} catch {}
|
|
2340
|
+
for (const entry of Object.values(store)) {
|
|
2341
|
+
if (!entry || typeof entry !== "object") continue;
|
|
2342
|
+
const rec = entry;
|
|
2343
|
+
if (typeof rec.channel !== "string" && typeof rec.provider === "string") {
|
|
2344
|
+
rec.channel = rec.provider;
|
|
2345
|
+
delete rec.provider;
|
|
2346
|
+
}
|
|
2347
|
+
if (typeof rec.lastChannel !== "string" && typeof rec.lastProvider === "string") {
|
|
2348
|
+
rec.lastChannel = rec.lastProvider;
|
|
2349
|
+
delete rec.lastProvider;
|
|
2350
|
+
}
|
|
2351
|
+
if (typeof rec.groupChannel !== "string" && typeof rec.room === "string") {
|
|
2352
|
+
rec.groupChannel = rec.room;
|
|
2353
|
+
delete rec.room;
|
|
2354
|
+
} else if ("room" in rec) delete rec.room;
|
|
2355
|
+
}
|
|
2356
|
+
if (!opts.skipCache && isSessionStoreCacheEnabled()) SESSION_STORE_CACHE.set(storePath, {
|
|
2357
|
+
store: structuredClone(store),
|
|
2358
|
+
loadedAt: Date.now(),
|
|
2359
|
+
storePath,
|
|
2360
|
+
mtimeMs
|
|
2361
|
+
});
|
|
2362
|
+
return structuredClone(store);
|
|
2363
|
+
}
|
|
2364
|
+
function readSessionUpdatedAt(params) {
|
|
2365
|
+
try {
|
|
2366
|
+
return loadSessionStore(params.storePath)[params.sessionKey]?.updatedAt;
|
|
2367
|
+
} catch {
|
|
2368
|
+
return;
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
async function saveSessionStoreUnlocked(storePath, store) {
|
|
2372
|
+
invalidateSessionStoreCache(storePath);
|
|
2373
|
+
normalizeSessionStore(store);
|
|
2374
|
+
await fs.promises.mkdir(path.dirname(storePath), { recursive: true });
|
|
2375
|
+
const json = JSON.stringify(store, null, 2);
|
|
2376
|
+
if (process.platform === "win32") {
|
|
2377
|
+
try {
|
|
2378
|
+
await fs.promises.writeFile(storePath, json, "utf-8");
|
|
2379
|
+
} catch (err) {
|
|
2380
|
+
if ((err && typeof err === "object" && "code" in err ? String(err.code) : null) === "ENOENT") return;
|
|
2381
|
+
throw err;
|
|
2382
|
+
}
|
|
2383
|
+
return;
|
|
2384
|
+
}
|
|
2385
|
+
const tmp = `${storePath}.${process.pid}.${crypto.randomUUID()}.tmp`;
|
|
2386
|
+
try {
|
|
2387
|
+
await fs.promises.writeFile(tmp, json, {
|
|
2388
|
+
mode: 384,
|
|
2389
|
+
encoding: "utf-8"
|
|
2390
|
+
});
|
|
2391
|
+
await fs.promises.rename(tmp, storePath);
|
|
2392
|
+
await fs.promises.chmod(storePath, 384);
|
|
2393
|
+
} catch (err) {
|
|
2394
|
+
if ((err && typeof err === "object" && "code" in err ? String(err.code) : null) === "ENOENT") {
|
|
2395
|
+
try {
|
|
2396
|
+
await fs.promises.mkdir(path.dirname(storePath), { recursive: true });
|
|
2397
|
+
await fs.promises.writeFile(storePath, json, {
|
|
2398
|
+
mode: 384,
|
|
2399
|
+
encoding: "utf-8"
|
|
2400
|
+
});
|
|
2401
|
+
await fs.promises.chmod(storePath, 384);
|
|
2402
|
+
} catch (err2) {
|
|
2403
|
+
if ((err2 && typeof err2 === "object" && "code" in err2 ? String(err2.code) : null) === "ENOENT") return;
|
|
2404
|
+
throw err2;
|
|
2405
|
+
}
|
|
2406
|
+
return;
|
|
2407
|
+
}
|
|
2408
|
+
throw err;
|
|
2409
|
+
} finally {
|
|
2410
|
+
await fs.promises.rm(tmp, { force: true });
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
async function saveSessionStore(storePath, store) {
|
|
2414
|
+
await withSessionStoreLock(storePath, async () => {
|
|
2415
|
+
await saveSessionStoreUnlocked(storePath, store);
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2418
|
+
async function updateSessionStore(storePath, mutator) {
|
|
2419
|
+
return await withSessionStoreLock(storePath, async () => {
|
|
2420
|
+
const store = loadSessionStore(storePath, { skipCache: true });
|
|
2421
|
+
const result = await mutator(store);
|
|
2422
|
+
await saveSessionStoreUnlocked(storePath, store);
|
|
2423
|
+
return result;
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2426
|
+
async function withSessionStoreLock(storePath, fn, opts = {}) {
|
|
2427
|
+
const timeoutMs = opts.timeoutMs ?? 1e4;
|
|
2428
|
+
const pollIntervalMs = opts.pollIntervalMs ?? 25;
|
|
2429
|
+
const staleMs = opts.staleMs ?? 3e4;
|
|
2430
|
+
const lockPath = `${storePath}.lock`;
|
|
2431
|
+
const startedAt = Date.now();
|
|
2432
|
+
await fs.promises.mkdir(path.dirname(storePath), { recursive: true });
|
|
2433
|
+
while (true) try {
|
|
2434
|
+
const handle = await fs.promises.open(lockPath, "wx");
|
|
2435
|
+
try {
|
|
2436
|
+
await handle.writeFile(JSON.stringify({
|
|
2437
|
+
pid: process.pid,
|
|
2438
|
+
startedAt: Date.now()
|
|
2439
|
+
}), "utf-8");
|
|
2440
|
+
} catch {}
|
|
2441
|
+
await handle.close();
|
|
2442
|
+
break;
|
|
2443
|
+
} catch (err) {
|
|
2444
|
+
const code = err && typeof err === "object" && "code" in err ? String(err.code) : null;
|
|
2445
|
+
if (code === "ENOENT") {
|
|
2446
|
+
await fs.promises.mkdir(path.dirname(storePath), { recursive: true }).catch(() => void 0);
|
|
2447
|
+
await new Promise((r) => setTimeout(r, pollIntervalMs));
|
|
2448
|
+
continue;
|
|
2449
|
+
}
|
|
2450
|
+
if (code !== "EEXIST") throw err;
|
|
2451
|
+
const now = Date.now();
|
|
2452
|
+
if (now - startedAt > timeoutMs) throw new Error(`timeout acquiring session store lock: ${lockPath}`, { cause: err });
|
|
2453
|
+
try {
|
|
2454
|
+
if (now - (await fs.promises.stat(lockPath)).mtimeMs > staleMs) {
|
|
2455
|
+
await fs.promises.unlink(lockPath);
|
|
2456
|
+
continue;
|
|
2457
|
+
}
|
|
2458
|
+
} catch {}
|
|
2459
|
+
await new Promise((r) => setTimeout(r, pollIntervalMs));
|
|
2460
|
+
}
|
|
2461
|
+
try {
|
|
2462
|
+
return await fn();
|
|
2463
|
+
} finally {
|
|
2464
|
+
await fs.promises.unlink(lockPath).catch(() => void 0);
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
async function updateSessionStoreEntry(params) {
|
|
2468
|
+
const { storePath, sessionKey, update } = params;
|
|
2469
|
+
return await withSessionStoreLock(storePath, async () => {
|
|
2470
|
+
const store = loadSessionStore(storePath);
|
|
2471
|
+
const existing = store[sessionKey];
|
|
2472
|
+
if (!existing) return null;
|
|
2473
|
+
const patch = await update(existing);
|
|
2474
|
+
if (!patch) return existing;
|
|
2475
|
+
const next = mergeSessionEntry(existing, patch);
|
|
2476
|
+
store[sessionKey] = next;
|
|
2477
|
+
await saveSessionStoreUnlocked(storePath, store);
|
|
2478
|
+
return next;
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2481
|
+
async function recordSessionMetaFromInbound(params) {
|
|
2482
|
+
const { storePath, sessionKey, ctx } = params;
|
|
2483
|
+
const createIfMissing = params.createIfMissing ?? true;
|
|
2484
|
+
return await updateSessionStore(storePath, (store) => {
|
|
2485
|
+
const existing = store[sessionKey];
|
|
2486
|
+
const patch = deriveSessionMetaPatch({
|
|
2487
|
+
ctx,
|
|
2488
|
+
sessionKey,
|
|
2489
|
+
existing,
|
|
2490
|
+
groupResolution: params.groupResolution
|
|
2491
|
+
});
|
|
2492
|
+
if (!patch) return existing ?? null;
|
|
2493
|
+
if (!existing && !createIfMissing) return null;
|
|
2494
|
+
const next = mergeSessionEntry(existing, patch);
|
|
2495
|
+
store[sessionKey] = next;
|
|
2496
|
+
return next;
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
async function updateLastRoute(params) {
|
|
2500
|
+
const { storePath, sessionKey, channel, to, accountId, threadId, ctx } = params;
|
|
2501
|
+
return await withSessionStoreLock(storePath, async () => {
|
|
2502
|
+
const store = loadSessionStore(storePath);
|
|
2503
|
+
const existing = store[sessionKey];
|
|
2504
|
+
const now = Date.now();
|
|
2505
|
+
const merged = mergeDeliveryContext(mergeDeliveryContext(normalizeDeliveryContext(params.deliveryContext), normalizeDeliveryContext({
|
|
2506
|
+
channel,
|
|
2507
|
+
to,
|
|
2508
|
+
accountId,
|
|
2509
|
+
threadId
|
|
2510
|
+
})), deliveryContextFromSession(existing));
|
|
2511
|
+
const normalized = normalizeSessionDeliveryFields({ deliveryContext: {
|
|
2512
|
+
channel: merged?.channel,
|
|
2513
|
+
to: merged?.to,
|
|
2514
|
+
accountId: merged?.accountId,
|
|
2515
|
+
threadId: merged?.threadId
|
|
2516
|
+
} });
|
|
2517
|
+
const metaPatch = ctx ? deriveSessionMetaPatch({
|
|
2518
|
+
ctx,
|
|
2519
|
+
sessionKey,
|
|
2520
|
+
existing,
|
|
2521
|
+
groupResolution: params.groupResolution
|
|
2522
|
+
}) : null;
|
|
2523
|
+
const basePatch = {
|
|
2524
|
+
updatedAt: Math.max(existing?.updatedAt ?? 0, now),
|
|
2525
|
+
deliveryContext: normalized.deliveryContext,
|
|
2526
|
+
lastChannel: normalized.lastChannel,
|
|
2527
|
+
lastTo: normalized.lastTo,
|
|
2528
|
+
lastAccountId: normalized.lastAccountId,
|
|
2529
|
+
lastThreadId: normalized.lastThreadId
|
|
2530
|
+
};
|
|
2531
|
+
const next = mergeSessionEntry(existing, metaPatch ? {
|
|
2532
|
+
...basePatch,
|
|
2533
|
+
...metaPatch
|
|
2534
|
+
} : basePatch);
|
|
2535
|
+
store[sessionKey] = next;
|
|
2536
|
+
await saveSessionStoreUnlocked(storePath, store);
|
|
2537
|
+
return next;
|
|
2538
|
+
});
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
//#endregion
|
|
2542
|
+
//#region src/config/sessions/transcript.ts
|
|
2543
|
+
function stripQuery(value) {
|
|
2544
|
+
const noHash = value.split("#")[0] ?? value;
|
|
2545
|
+
return noHash.split("?")[0] ?? noHash;
|
|
2546
|
+
}
|
|
2547
|
+
function extractFileNameFromMediaUrl(value) {
|
|
2548
|
+
const trimmed = value.trim();
|
|
2549
|
+
if (!trimmed) return null;
|
|
2550
|
+
const cleaned = stripQuery(trimmed);
|
|
2551
|
+
try {
|
|
2552
|
+
const parsed = new URL(cleaned);
|
|
2553
|
+
const base = path.basename(parsed.pathname);
|
|
2554
|
+
if (!base) return null;
|
|
2555
|
+
try {
|
|
2556
|
+
return decodeURIComponent(base);
|
|
2557
|
+
} catch {
|
|
2558
|
+
return base;
|
|
2559
|
+
}
|
|
2560
|
+
} catch {
|
|
2561
|
+
const base = path.basename(cleaned);
|
|
2562
|
+
if (!base || base === "/" || base === ".") return null;
|
|
2563
|
+
return base;
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
function resolveMirroredTranscriptText(params) {
|
|
2567
|
+
const mediaUrls = params.mediaUrls?.filter((url) => url && url.trim()) ?? [];
|
|
2568
|
+
if (mediaUrls.length > 0) {
|
|
2569
|
+
const names = mediaUrls.map((url) => extractFileNameFromMediaUrl(url)).filter((name) => Boolean(name && name.trim()));
|
|
2570
|
+
if (names.length > 0) return names.join(", ");
|
|
2571
|
+
return "media";
|
|
2572
|
+
}
|
|
2573
|
+
const trimmed = (params.text ?? "").trim();
|
|
2574
|
+
return trimmed ? trimmed : null;
|
|
2575
|
+
}
|
|
2576
|
+
async function ensureSessionHeader(params) {
|
|
2577
|
+
if (fs.existsSync(params.sessionFile)) return;
|
|
2578
|
+
await fs.promises.mkdir(path.dirname(params.sessionFile), { recursive: true });
|
|
2579
|
+
const header = {
|
|
2580
|
+
type: "session",
|
|
2581
|
+
version: CURRENT_SESSION_VERSION,
|
|
2582
|
+
id: params.sessionId,
|
|
2583
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2584
|
+
cwd: process.cwd()
|
|
2585
|
+
};
|
|
2586
|
+
await fs.promises.writeFile(params.sessionFile, `${JSON.stringify(header)}\n`, "utf-8");
|
|
2587
|
+
}
|
|
2588
|
+
async function appendAssistantMessageToSessionTranscript(params) {
|
|
2589
|
+
const sessionKey = params.sessionKey.trim();
|
|
2590
|
+
if (!sessionKey) return {
|
|
2591
|
+
ok: false,
|
|
2592
|
+
reason: "missing sessionKey"
|
|
2593
|
+
};
|
|
2594
|
+
const mirrorText = resolveMirroredTranscriptText({
|
|
2595
|
+
text: params.text,
|
|
2596
|
+
mediaUrls: params.mediaUrls
|
|
2597
|
+
});
|
|
2598
|
+
if (!mirrorText) return {
|
|
2599
|
+
ok: false,
|
|
2600
|
+
reason: "empty text"
|
|
2601
|
+
};
|
|
2602
|
+
const storePath = params.storePath ?? resolveDefaultSessionStorePath(params.agentId);
|
|
2603
|
+
const entry = loadSessionStore(storePath, { skipCache: true })[sessionKey];
|
|
2604
|
+
if (!entry?.sessionId) return {
|
|
2605
|
+
ok: false,
|
|
2606
|
+
reason: `unknown sessionKey: ${sessionKey}`
|
|
2607
|
+
};
|
|
2608
|
+
const sessionFile = entry.sessionFile?.trim() || resolveSessionTranscriptPath(entry.sessionId, params.agentId);
|
|
2609
|
+
await ensureSessionHeader({
|
|
2610
|
+
sessionFile,
|
|
2611
|
+
sessionId: entry.sessionId
|
|
2612
|
+
});
|
|
2613
|
+
SessionManager.open(sessionFile).appendMessage({
|
|
2614
|
+
role: "assistant",
|
|
2615
|
+
content: [{
|
|
2616
|
+
type: "text",
|
|
2617
|
+
text: mirrorText
|
|
2618
|
+
}],
|
|
2619
|
+
api: "openai-responses",
|
|
2620
|
+
provider: "openclaw",
|
|
2621
|
+
model: "delivery-mirror",
|
|
2622
|
+
usage: {
|
|
2623
|
+
input: 0,
|
|
2624
|
+
output: 0,
|
|
2625
|
+
cacheRead: 0,
|
|
2626
|
+
cacheWrite: 0,
|
|
2627
|
+
totalTokens: 0,
|
|
2628
|
+
cost: {
|
|
2629
|
+
input: 0,
|
|
2630
|
+
output: 0,
|
|
2631
|
+
cacheRead: 0,
|
|
2632
|
+
cacheWrite: 0,
|
|
2633
|
+
total: 0
|
|
2634
|
+
}
|
|
2635
|
+
},
|
|
2636
|
+
stopReason: "stop",
|
|
2637
|
+
timestamp: Date.now()
|
|
2638
|
+
});
|
|
2639
|
+
if (!entry.sessionFile || entry.sessionFile !== sessionFile) await updateSessionStore(storePath, (current) => {
|
|
2640
|
+
current[sessionKey] = {
|
|
2641
|
+
...entry,
|
|
2642
|
+
sessionFile
|
|
2643
|
+
};
|
|
2644
|
+
});
|
|
2645
|
+
emitSessionTranscriptUpdate(sessionFile);
|
|
2646
|
+
return {
|
|
2647
|
+
ok: true,
|
|
2648
|
+
sessionFile
|
|
2649
|
+
};
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
//#endregion
|
|
2653
|
+
//#region src/agents/sandbox/runtime-status.ts
|
|
2654
|
+
function shouldSandboxSession(cfg, sessionKey, mainSessionKey) {
|
|
2655
|
+
if (cfg.mode === "off") return false;
|
|
2656
|
+
if (cfg.mode === "all") return true;
|
|
2657
|
+
return sessionKey.trim() !== mainSessionKey.trim();
|
|
2658
|
+
}
|
|
2659
|
+
function resolveMainSessionKeyForSandbox(params) {
|
|
2660
|
+
if (params.cfg?.session?.scope === "global") return "global";
|
|
2661
|
+
return resolveAgentMainSessionKey({
|
|
2662
|
+
cfg: params.cfg,
|
|
2663
|
+
agentId: params.agentId
|
|
2664
|
+
});
|
|
2665
|
+
}
|
|
2666
|
+
function resolveComparableSessionKeyForSandbox(params) {
|
|
2667
|
+
return canonicalizeMainSessionAlias({
|
|
2668
|
+
cfg: params.cfg,
|
|
2669
|
+
agentId: params.agentId,
|
|
2670
|
+
sessionKey: params.sessionKey
|
|
2671
|
+
});
|
|
2672
|
+
}
|
|
2673
|
+
function resolveSandboxRuntimeStatus(params) {
|
|
2674
|
+
const sessionKey = params.sessionKey?.trim() ?? "";
|
|
2675
|
+
const agentId = resolveSessionAgentId({
|
|
2676
|
+
sessionKey,
|
|
2677
|
+
config: params.cfg
|
|
2678
|
+
});
|
|
2679
|
+
const cfg = params.cfg;
|
|
2680
|
+
const sandboxCfg = resolveSandboxConfigForAgent(cfg, agentId);
|
|
2681
|
+
const mainSessionKey = resolveMainSessionKeyForSandbox({
|
|
2682
|
+
cfg,
|
|
2683
|
+
agentId
|
|
2684
|
+
});
|
|
2685
|
+
const sandboxed = sessionKey ? shouldSandboxSession(sandboxCfg, resolveComparableSessionKeyForSandbox({
|
|
2686
|
+
cfg,
|
|
2687
|
+
agentId,
|
|
2688
|
+
sessionKey
|
|
2689
|
+
}), mainSessionKey) : false;
|
|
2690
|
+
return {
|
|
2691
|
+
agentId,
|
|
2692
|
+
sessionKey,
|
|
2693
|
+
mainSessionKey,
|
|
2694
|
+
mode: sandboxCfg.mode,
|
|
2695
|
+
sandboxed,
|
|
2696
|
+
toolPolicy: resolveSandboxToolPolicyForAgent(cfg, agentId)
|
|
2697
|
+
};
|
|
2698
|
+
}
|
|
2699
|
+
function formatSandboxToolPolicyBlockedMessage(params) {
|
|
2700
|
+
const tool = params.toolName.trim().toLowerCase();
|
|
2701
|
+
if (!tool) return;
|
|
2702
|
+
const runtime = resolveSandboxRuntimeStatus({
|
|
2703
|
+
cfg: params.cfg,
|
|
2704
|
+
sessionKey: params.sessionKey
|
|
2705
|
+
});
|
|
2706
|
+
if (!runtime.sandboxed) return;
|
|
2707
|
+
const deny = new Set(expandToolGroups(runtime.toolPolicy.deny));
|
|
2708
|
+
const allow = expandToolGroups(runtime.toolPolicy.allow);
|
|
2709
|
+
const allowSet = allow.length > 0 ? new Set(allow) : null;
|
|
2710
|
+
const blockedByDeny = deny.has(tool);
|
|
2711
|
+
const blockedByAllow = allowSet ? !allowSet.has(tool) : false;
|
|
2712
|
+
if (!blockedByDeny && !blockedByAllow) return;
|
|
2713
|
+
const reasons = [];
|
|
2714
|
+
const fixes = [];
|
|
2715
|
+
if (blockedByDeny) {
|
|
2716
|
+
reasons.push("deny list");
|
|
2717
|
+
fixes.push(`Remove "${tool}" from ${runtime.toolPolicy.sources.deny.key}.`);
|
|
2718
|
+
}
|
|
2719
|
+
if (blockedByAllow) {
|
|
2720
|
+
reasons.push("allow list");
|
|
2721
|
+
fixes.push(`Add "${tool}" to ${runtime.toolPolicy.sources.allow.key} (or set it to [] to allow all).`);
|
|
2722
|
+
}
|
|
2723
|
+
const lines = [];
|
|
2724
|
+
lines.push(`Tool "${tool}" blocked by sandbox tool policy (mode=${runtime.mode}).`);
|
|
2725
|
+
lines.push(`Session: ${runtime.sessionKey || "(unknown)"}`);
|
|
2726
|
+
lines.push(`Reason: ${reasons.join(" + ")}`);
|
|
2727
|
+
lines.push("Fix:");
|
|
2728
|
+
lines.push(`- agents.defaults.sandbox.mode=off (disable sandbox)`);
|
|
2729
|
+
for (const fix of fixes) lines.push(`- ${fix}`);
|
|
2730
|
+
if (runtime.mode === "non-main") lines.push(`- Use main session key (direct): ${runtime.mainSessionKey}`);
|
|
2731
|
+
lines.push(`- See: ${formatCliCommand(`openclaw sandbox explain --session ${runtime.sessionKey}`)}`);
|
|
2732
|
+
return lines.join("\n");
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
//#endregion
|
|
2736
|
+
//#region src/agents/sandbox/workspace.ts
|
|
2737
|
+
async function ensureSandboxWorkspace(workspaceDir, seedFrom, skipBootstrap) {
|
|
2738
|
+
await fs$1.mkdir(workspaceDir, { recursive: true });
|
|
2739
|
+
if (seedFrom) {
|
|
2740
|
+
const seed = resolveUserPath(seedFrom);
|
|
2741
|
+
const files = [
|
|
2742
|
+
DEFAULT_AGENTS_FILENAME,
|
|
2743
|
+
DEFAULT_SOUL_FILENAME,
|
|
2744
|
+
DEFAULT_TOOLS_FILENAME,
|
|
2745
|
+
DEFAULT_IDENTITY_FILENAME,
|
|
2746
|
+
DEFAULT_USER_FILENAME,
|
|
2747
|
+
DEFAULT_BOOTSTRAP_FILENAME,
|
|
2748
|
+
DEFAULT_HEARTBEAT_FILENAME
|
|
2749
|
+
];
|
|
2750
|
+
for (const name of files) {
|
|
2751
|
+
const src = path.join(seed, name);
|
|
2752
|
+
const dest = path.join(workspaceDir, name);
|
|
2753
|
+
try {
|
|
2754
|
+
await fs$1.access(dest);
|
|
2755
|
+
} catch {
|
|
2756
|
+
try {
|
|
2757
|
+
const content = await fs$1.readFile(src, "utf-8");
|
|
2758
|
+
await fs$1.writeFile(dest, content, {
|
|
2759
|
+
encoding: "utf-8",
|
|
2760
|
+
flag: "wx"
|
|
2761
|
+
});
|
|
2762
|
+
} catch {}
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
await ensureAgentWorkspace({
|
|
2767
|
+
dir: workspaceDir,
|
|
2768
|
+
ensureBootstrapFiles: !skipBootstrap
|
|
2769
|
+
});
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
//#endregion
|
|
2773
|
+
//#region src/agents/sandbox/context.ts
|
|
2774
|
+
async function resolveSandboxContext(params) {
|
|
2775
|
+
const rawSessionKey = params.sessionKey?.trim();
|
|
2776
|
+
if (!rawSessionKey) return null;
|
|
2777
|
+
const runtime = resolveSandboxRuntimeStatus({
|
|
2778
|
+
cfg: params.config,
|
|
2779
|
+
sessionKey: rawSessionKey
|
|
2780
|
+
});
|
|
2781
|
+
if (!runtime.sandboxed) return null;
|
|
2782
|
+
const cfg = resolveSandboxConfigForAgent(params.config, runtime.agentId);
|
|
2783
|
+
await maybePruneSandboxes(cfg);
|
|
2784
|
+
const agentWorkspaceDir = resolveUserPath(params.workspaceDir?.trim() || DEFAULT_AGENT_WORKSPACE_DIR);
|
|
2785
|
+
const workspaceRoot = resolveUserPath(cfg.workspaceRoot);
|
|
2786
|
+
const scopeKey = resolveSandboxScopeKey(cfg.scope, rawSessionKey);
|
|
2787
|
+
const sandboxWorkspaceDir = cfg.scope === "shared" ? workspaceRoot : resolveSandboxWorkspaceDir(workspaceRoot, scopeKey);
|
|
2788
|
+
const workspaceDir = cfg.workspaceAccess === "rw" ? agentWorkspaceDir : sandboxWorkspaceDir;
|
|
2789
|
+
if (workspaceDir === sandboxWorkspaceDir) {
|
|
2790
|
+
await ensureSandboxWorkspace(sandboxWorkspaceDir, agentWorkspaceDir, params.config?.agents?.defaults?.skipBootstrap);
|
|
2791
|
+
if (cfg.workspaceAccess !== "rw") try {
|
|
2792
|
+
await syncSkillsToWorkspace({
|
|
2793
|
+
sourceWorkspaceDir: agentWorkspaceDir,
|
|
2794
|
+
targetWorkspaceDir: sandboxWorkspaceDir,
|
|
2795
|
+
config: params.config
|
|
2796
|
+
});
|
|
2797
|
+
} catch (error) {
|
|
2798
|
+
const message = error instanceof Error ? error.message : JSON.stringify(error);
|
|
2799
|
+
defaultRuntime.error?.(`Sandbox skill sync failed: ${message}`);
|
|
2800
|
+
}
|
|
2801
|
+
} else await fs$1.mkdir(workspaceDir, { recursive: true });
|
|
2802
|
+
const containerName = await ensureSandboxContainer({
|
|
2803
|
+
sessionKey: rawSessionKey,
|
|
2804
|
+
workspaceDir,
|
|
2805
|
+
agentWorkspaceDir,
|
|
2806
|
+
cfg
|
|
2807
|
+
});
|
|
2808
|
+
const browser = await ensureSandboxBrowser({
|
|
2809
|
+
scopeKey,
|
|
2810
|
+
workspaceDir,
|
|
2811
|
+
agentWorkspaceDir,
|
|
2812
|
+
cfg,
|
|
2813
|
+
evaluateEnabled: params.config?.browser?.evaluateEnabled ?? DEFAULT_BROWSER_EVALUATE_ENABLED
|
|
2814
|
+
});
|
|
2815
|
+
return {
|
|
2816
|
+
enabled: true,
|
|
2817
|
+
sessionKey: rawSessionKey,
|
|
2818
|
+
workspaceDir,
|
|
2819
|
+
agentWorkspaceDir,
|
|
2820
|
+
workspaceAccess: cfg.workspaceAccess,
|
|
2821
|
+
containerName,
|
|
2822
|
+
containerWorkdir: cfg.docker.workdir,
|
|
2823
|
+
docker: cfg.docker,
|
|
2824
|
+
tools: cfg.tools,
|
|
2825
|
+
browserAllowHostControl: cfg.browser.allowHostControl,
|
|
2826
|
+
browser: browser ?? void 0
|
|
2827
|
+
};
|
|
2828
|
+
}
|
|
2829
|
+
async function ensureSandboxWorkspaceForSession(params) {
|
|
2830
|
+
const rawSessionKey = params.sessionKey?.trim();
|
|
2831
|
+
if (!rawSessionKey) return null;
|
|
2832
|
+
const runtime = resolveSandboxRuntimeStatus({
|
|
2833
|
+
cfg: params.config,
|
|
2834
|
+
sessionKey: rawSessionKey
|
|
2835
|
+
});
|
|
2836
|
+
if (!runtime.sandboxed) return null;
|
|
2837
|
+
const cfg = resolveSandboxConfigForAgent(params.config, runtime.agentId);
|
|
2838
|
+
const agentWorkspaceDir = resolveUserPath(params.workspaceDir?.trim() || DEFAULT_AGENT_WORKSPACE_DIR);
|
|
2839
|
+
const workspaceRoot = resolveUserPath(cfg.workspaceRoot);
|
|
2840
|
+
const scopeKey = resolveSandboxScopeKey(cfg.scope, rawSessionKey);
|
|
2841
|
+
const sandboxWorkspaceDir = cfg.scope === "shared" ? workspaceRoot : resolveSandboxWorkspaceDir(workspaceRoot, scopeKey);
|
|
2842
|
+
const workspaceDir = cfg.workspaceAccess === "rw" ? agentWorkspaceDir : sandboxWorkspaceDir;
|
|
2843
|
+
if (workspaceDir === sandboxWorkspaceDir) {
|
|
2844
|
+
await ensureSandboxWorkspace(sandboxWorkspaceDir, agentWorkspaceDir, params.config?.agents?.defaults?.skipBootstrap);
|
|
2845
|
+
if (cfg.workspaceAccess !== "rw") try {
|
|
2846
|
+
await syncSkillsToWorkspace({
|
|
2847
|
+
sourceWorkspaceDir: agentWorkspaceDir,
|
|
2848
|
+
targetWorkspaceDir: sandboxWorkspaceDir,
|
|
2849
|
+
config: params.config
|
|
2850
|
+
});
|
|
2851
|
+
} catch (error) {
|
|
2852
|
+
const message = error instanceof Error ? error.message : JSON.stringify(error);
|
|
2853
|
+
defaultRuntime.error?.(`Sandbox skill sync failed: ${message}`);
|
|
2854
|
+
}
|
|
2855
|
+
} else await fs$1.mkdir(workspaceDir, { recursive: true });
|
|
2856
|
+
return {
|
|
2857
|
+
workspaceDir,
|
|
2858
|
+
containerWorkdir: cfg.docker.workdir
|
|
2859
|
+
};
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
//#endregion
|
|
2863
|
+
//#region src/agents/sandbox/manage.ts
|
|
2864
|
+
async function listSandboxContainers() {
|
|
2865
|
+
const config = loadConfig();
|
|
2866
|
+
const registry = await readRegistry();
|
|
2867
|
+
const results = [];
|
|
2868
|
+
for (const entry of registry.entries) {
|
|
2869
|
+
const state = await dockerContainerState(entry.containerName);
|
|
2870
|
+
let actualImage = entry.image;
|
|
2871
|
+
if (state.exists) try {
|
|
2872
|
+
const result = await execDocker([
|
|
2873
|
+
"inspect",
|
|
2874
|
+
"-f",
|
|
2875
|
+
"{{.Config.Image}}",
|
|
2876
|
+
entry.containerName
|
|
2877
|
+
], { allowFailure: true });
|
|
2878
|
+
if (result.code === 0) actualImage = result.stdout.trim();
|
|
2879
|
+
} catch {}
|
|
2880
|
+
const configuredImage = resolveSandboxConfigForAgent(config, resolveSandboxAgentId(entry.sessionKey)).docker.image;
|
|
2881
|
+
results.push({
|
|
2882
|
+
...entry,
|
|
2883
|
+
image: actualImage,
|
|
2884
|
+
running: state.running,
|
|
2885
|
+
imageMatch: actualImage === configuredImage
|
|
2886
|
+
});
|
|
2887
|
+
}
|
|
2888
|
+
return results;
|
|
2889
|
+
}
|
|
2890
|
+
async function listSandboxBrowsers() {
|
|
2891
|
+
const config = loadConfig();
|
|
2892
|
+
const registry = await readBrowserRegistry();
|
|
2893
|
+
const results = [];
|
|
2894
|
+
for (const entry of registry.entries) {
|
|
2895
|
+
const state = await dockerContainerState(entry.containerName);
|
|
2896
|
+
let actualImage = entry.image;
|
|
2897
|
+
if (state.exists) try {
|
|
2898
|
+
const result = await execDocker([
|
|
2899
|
+
"inspect",
|
|
2900
|
+
"-f",
|
|
2901
|
+
"{{.Config.Image}}",
|
|
2902
|
+
entry.containerName
|
|
2903
|
+
], { allowFailure: true });
|
|
2904
|
+
if (result.code === 0) actualImage = result.stdout.trim();
|
|
2905
|
+
} catch {}
|
|
2906
|
+
const configuredImage = resolveSandboxConfigForAgent(config, resolveSandboxAgentId(entry.sessionKey)).browser.image;
|
|
2907
|
+
results.push({
|
|
2908
|
+
...entry,
|
|
2909
|
+
image: actualImage,
|
|
2910
|
+
running: state.running,
|
|
2911
|
+
imageMatch: actualImage === configuredImage
|
|
2912
|
+
});
|
|
2913
|
+
}
|
|
2914
|
+
return results;
|
|
2915
|
+
}
|
|
2916
|
+
async function removeSandboxContainer(containerName) {
|
|
2917
|
+
try {
|
|
2918
|
+
await execDocker([
|
|
2919
|
+
"rm",
|
|
2920
|
+
"-f",
|
|
2921
|
+
containerName
|
|
2922
|
+
], { allowFailure: true });
|
|
2923
|
+
} catch {}
|
|
2924
|
+
await removeRegistryEntry(containerName);
|
|
2925
|
+
}
|
|
2926
|
+
async function removeSandboxBrowserContainer(containerName) {
|
|
2927
|
+
try {
|
|
2928
|
+
await execDocker([
|
|
2929
|
+
"rm",
|
|
2930
|
+
"-f",
|
|
2931
|
+
containerName
|
|
2932
|
+
], { allowFailure: true });
|
|
2933
|
+
} catch {}
|
|
2934
|
+
await removeBrowserRegistryEntry(containerName);
|
|
2935
|
+
for (const [sessionKey, bridge] of BROWSER_BRIDGES.entries()) if (bridge.containerName === containerName) {
|
|
2936
|
+
await stopBrowserBridgeServer(bridge.bridge.server).catch(() => void 0);
|
|
2937
|
+
BROWSER_BRIDGES.delete(sessionKey);
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
//#endregion
|
|
2942
|
+
export { stripPluginOnlyAllowlist as $, resolveSessionResetType as A, resolveConversationLabel as B, normalizeDeliveryContext as C, evaluateSessionFreshness as D, resolveSessionKey as E, resolveExplicitAgentSessionKey as F, resolveSandboxToolPolicyForAgent as G, resolveGroupSessionKey as H, resolveMainSessionKey as I, collectExplicitAllowlist as J, applyOwnerOnlyToolPolicy as K, resolveMainSessionKeyFromConfig as L, DEFAULT_RESET_TRIGGERS as M, canonicalizeMainSessionAlias as N, resolveChannelResetConfig as O, resolveAgentMainSessionKey as P, resolveToolProfilePolicy as Q, deriveSessionMetaPatch as R, mergeDeliveryContext as S, normalizeAccountId as T, resolveSandboxConfigForAgent as U, buildGroupDisplayName as V, resolveSandboxScope as W, expandToolGroups as X, expandPolicyWithPluginGroups as Y, normalizeToolName as Z, updateSessionStoreEntry as _, ensureSandboxWorkspaceForSession as a, resolveChannelGroupPolicy as at, deliveryContextFromSession as b, resolveSandboxRuntimeStatus as c, listEnabledSignalAccounts as ct, loadSessionStore as d, DEFAULT_SANDBOX_BROWSER_IMAGE as et, readSessionUpdatedAt as f, updateSessionStore as g, updateLastRoute as h, removeSandboxContainer as i, listChannelDocks as it, resolveThreadFlag as j, resolveSessionResetPolicy as k, appendAssistantMessageToSessionTranscript as l, resolveSignalAccount as lt, saveSessionStore as m, listSandboxContainers as n, DEFAULT_SANDBOX_IMAGE as nt, resolveSandboxContext as o, resolveChannelGroupRequireMention as ot, recordSessionMetaFromInbound as p, buildPluginToolGroups as q, removeSandboxBrowserContainer as r, getChannelDock as rt, formatSandboxToolPolicyBlockedMessage as s, resolveChannelGroupToolsPolicy as st, listSandboxBrowsers as t, DEFAULT_SANDBOX_COMMON_IMAGE as tt, resolveMirroredTranscriptText as u, resolveIMessageAccount as ut, isCacheEnabled as v, normalizeSessionDeliveryFields as w, deliveryContextKey as x, resolveCacheTtlMs as y, snapshotSessionOrigin as z };
|