@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,2981 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
+
import { X as resolveStateDir, Y as resolveOAuthPath, n as isTruthyEnvValue, o as createSubsystemLogger } from "./entry.js";
|
|
3
|
+
import { t as formatCliCommand } from "./command-format-ayFsmwwz.js";
|
|
4
|
+
import { n as DEFAULT_AGENT_ID } from "./session-key-Dk6vSAOv.js";
|
|
5
|
+
import { m as resolveUserPath } from "./utils-DX85MiPR.js";
|
|
6
|
+
import { a as resolveAgentModelPrimary } from "./agent-scope-jAWKj2TP.js";
|
|
7
|
+
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken, t as DEFAULT_COPILOT_API_BASE_URL } from "./github-copilot-token-SLWintYd.js";
|
|
8
|
+
import { execFileSync, execSync } from "node:child_process";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import { BedrockClient, ListFoundationModelsCommand } from "@aws-sdk/client-bedrock";
|
|
12
|
+
import { getEnvApiKey, getOAuthApiKey, getOAuthProviders } from "@mariozechner/pi-ai";
|
|
13
|
+
import lockfile from "proper-lockfile";
|
|
14
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
15
|
+
|
|
16
|
+
//#region src/agents/auth-profiles/constants.ts
|
|
17
|
+
const AUTH_STORE_VERSION = 1;
|
|
18
|
+
const AUTH_PROFILE_FILENAME = "auth-profiles.json";
|
|
19
|
+
const LEGACY_AUTH_FILENAME = "auth.json";
|
|
20
|
+
const CLAUDE_CLI_PROFILE_ID = "anthropic:claude-cli";
|
|
21
|
+
const CODEX_CLI_PROFILE_ID = "openai-codex:codex-cli";
|
|
22
|
+
const QWEN_CLI_PROFILE_ID = "qwen-portal:qwen-cli";
|
|
23
|
+
const MINIMAX_CLI_PROFILE_ID = "minimax-portal:minimax-cli";
|
|
24
|
+
const AUTH_STORE_LOCK_OPTIONS = {
|
|
25
|
+
retries: {
|
|
26
|
+
retries: 10,
|
|
27
|
+
factor: 2,
|
|
28
|
+
minTimeout: 100,
|
|
29
|
+
maxTimeout: 1e4,
|
|
30
|
+
randomize: true
|
|
31
|
+
},
|
|
32
|
+
stale: 3e4
|
|
33
|
+
};
|
|
34
|
+
const EXTERNAL_CLI_SYNC_TTL_MS = 900 * 1e3;
|
|
35
|
+
const EXTERNAL_CLI_NEAR_EXPIRY_MS = 600 * 1e3;
|
|
36
|
+
const log$1 = createSubsystemLogger("agents/auth-profiles");
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/agents/auth-profiles/display.ts
|
|
40
|
+
function resolveAuthProfileDisplayLabel(params) {
|
|
41
|
+
const { cfg, store, profileId } = params;
|
|
42
|
+
const profile = store.profiles[profileId];
|
|
43
|
+
const email = cfg?.auth?.profiles?.[profileId]?.email?.trim() || (profile && "email" in profile ? profile.email?.trim() : void 0);
|
|
44
|
+
if (email) return `${profileId} (${email})`;
|
|
45
|
+
return profileId;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/agents/defaults.ts
|
|
50
|
+
const DEFAULT_PROVIDER = "anthropic";
|
|
51
|
+
const DEFAULT_MODEL = "claude-opus-4-6";
|
|
52
|
+
const DEFAULT_CONTEXT_TOKENS = 2e5;
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/agents/bedrock-discovery.ts
|
|
56
|
+
const DEFAULT_REFRESH_INTERVAL_SECONDS = 3600;
|
|
57
|
+
const DEFAULT_CONTEXT_WINDOW = 32e3;
|
|
58
|
+
const DEFAULT_MAX_TOKENS = 4096;
|
|
59
|
+
const DEFAULT_COST = {
|
|
60
|
+
input: 0,
|
|
61
|
+
output: 0,
|
|
62
|
+
cacheRead: 0,
|
|
63
|
+
cacheWrite: 0
|
|
64
|
+
};
|
|
65
|
+
const discoveryCache = /* @__PURE__ */ new Map();
|
|
66
|
+
let hasLoggedBedrockError = false;
|
|
67
|
+
function normalizeProviderFilter(filter) {
|
|
68
|
+
if (!filter || filter.length === 0) return [];
|
|
69
|
+
const normalized = new Set(filter.map((entry) => entry.trim().toLowerCase()).filter((entry) => entry.length > 0));
|
|
70
|
+
return Array.from(normalized).toSorted();
|
|
71
|
+
}
|
|
72
|
+
function buildCacheKey(params) {
|
|
73
|
+
return JSON.stringify(params);
|
|
74
|
+
}
|
|
75
|
+
function includesTextModalities(modalities) {
|
|
76
|
+
return (modalities ?? []).some((entry) => entry.toLowerCase() === "text");
|
|
77
|
+
}
|
|
78
|
+
function isActive(summary) {
|
|
79
|
+
const status = summary.modelLifecycle?.status;
|
|
80
|
+
return typeof status === "string" ? status.toUpperCase() === "ACTIVE" : false;
|
|
81
|
+
}
|
|
82
|
+
function mapInputModalities(summary) {
|
|
83
|
+
const inputs = summary.inputModalities ?? [];
|
|
84
|
+
const mapped = /* @__PURE__ */ new Set();
|
|
85
|
+
for (const modality of inputs) {
|
|
86
|
+
const lower = modality.toLowerCase();
|
|
87
|
+
if (lower === "text") mapped.add("text");
|
|
88
|
+
if (lower === "image") mapped.add("image");
|
|
89
|
+
}
|
|
90
|
+
if (mapped.size === 0) mapped.add("text");
|
|
91
|
+
return Array.from(mapped);
|
|
92
|
+
}
|
|
93
|
+
function inferReasoningSupport(summary) {
|
|
94
|
+
const haystack = `${summary.modelId ?? ""} ${summary.modelName ?? ""}`.toLowerCase();
|
|
95
|
+
return haystack.includes("reasoning") || haystack.includes("thinking");
|
|
96
|
+
}
|
|
97
|
+
function resolveDefaultContextWindow(config) {
|
|
98
|
+
const value = Math.floor(config?.defaultContextWindow ?? DEFAULT_CONTEXT_WINDOW);
|
|
99
|
+
return value > 0 ? value : DEFAULT_CONTEXT_WINDOW;
|
|
100
|
+
}
|
|
101
|
+
function resolveDefaultMaxTokens(config) {
|
|
102
|
+
const value = Math.floor(config?.defaultMaxTokens ?? DEFAULT_MAX_TOKENS);
|
|
103
|
+
return value > 0 ? value : DEFAULT_MAX_TOKENS;
|
|
104
|
+
}
|
|
105
|
+
function matchesProviderFilter(summary, filter) {
|
|
106
|
+
if (filter.length === 0) return true;
|
|
107
|
+
const normalized = (summary.providerName ?? (typeof summary.modelId === "string" ? summary.modelId.split(".")[0] : void 0))?.trim().toLowerCase();
|
|
108
|
+
if (!normalized) return false;
|
|
109
|
+
return filter.includes(normalized);
|
|
110
|
+
}
|
|
111
|
+
function shouldIncludeSummary(summary, filter) {
|
|
112
|
+
if (!summary.modelId?.trim()) return false;
|
|
113
|
+
if (!matchesProviderFilter(summary, filter)) return false;
|
|
114
|
+
if (summary.responseStreamingSupported !== true) return false;
|
|
115
|
+
if (!includesTextModalities(summary.outputModalities)) return false;
|
|
116
|
+
if (!isActive(summary)) return false;
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
function toModelDefinition(summary, defaults) {
|
|
120
|
+
const id = summary.modelId?.trim() ?? "";
|
|
121
|
+
return {
|
|
122
|
+
id,
|
|
123
|
+
name: summary.modelName?.trim() || id,
|
|
124
|
+
reasoning: inferReasoningSupport(summary),
|
|
125
|
+
input: mapInputModalities(summary),
|
|
126
|
+
cost: DEFAULT_COST,
|
|
127
|
+
contextWindow: defaults.contextWindow,
|
|
128
|
+
maxTokens: defaults.maxTokens
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
async function discoverBedrockModels(params) {
|
|
132
|
+
const refreshIntervalSeconds = Math.max(0, Math.floor(params.config?.refreshInterval ?? DEFAULT_REFRESH_INTERVAL_SECONDS));
|
|
133
|
+
const providerFilter = normalizeProviderFilter(params.config?.providerFilter);
|
|
134
|
+
const defaultContextWindow = resolveDefaultContextWindow(params.config);
|
|
135
|
+
const defaultMaxTokens = resolveDefaultMaxTokens(params.config);
|
|
136
|
+
const cacheKey = buildCacheKey({
|
|
137
|
+
region: params.region,
|
|
138
|
+
providerFilter,
|
|
139
|
+
refreshIntervalSeconds,
|
|
140
|
+
defaultContextWindow,
|
|
141
|
+
defaultMaxTokens
|
|
142
|
+
});
|
|
143
|
+
const now = params.now?.() ?? Date.now();
|
|
144
|
+
if (refreshIntervalSeconds > 0) {
|
|
145
|
+
const cached = discoveryCache.get(cacheKey);
|
|
146
|
+
if (cached?.value && cached.expiresAt > now) return cached.value;
|
|
147
|
+
if (cached?.inFlight) return cached.inFlight;
|
|
148
|
+
}
|
|
149
|
+
const client = (params.clientFactory ?? ((region) => new BedrockClient({ region })))(params.region);
|
|
150
|
+
const discoveryPromise = (async () => {
|
|
151
|
+
const response = await client.send(new ListFoundationModelsCommand({}));
|
|
152
|
+
const discovered = [];
|
|
153
|
+
for (const summary of response.modelSummaries ?? []) {
|
|
154
|
+
if (!shouldIncludeSummary(summary, providerFilter)) continue;
|
|
155
|
+
discovered.push(toModelDefinition(summary, {
|
|
156
|
+
contextWindow: defaultContextWindow,
|
|
157
|
+
maxTokens: defaultMaxTokens
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
return discovered.toSorted((a, b) => a.name.localeCompare(b.name));
|
|
161
|
+
})();
|
|
162
|
+
if (refreshIntervalSeconds > 0) discoveryCache.set(cacheKey, {
|
|
163
|
+
expiresAt: now + refreshIntervalSeconds * 1e3,
|
|
164
|
+
inFlight: discoveryPromise
|
|
165
|
+
});
|
|
166
|
+
try {
|
|
167
|
+
const value = await discoveryPromise;
|
|
168
|
+
if (refreshIntervalSeconds > 0) discoveryCache.set(cacheKey, {
|
|
169
|
+
expiresAt: now + refreshIntervalSeconds * 1e3,
|
|
170
|
+
value
|
|
171
|
+
});
|
|
172
|
+
return value;
|
|
173
|
+
} catch (error) {
|
|
174
|
+
if (refreshIntervalSeconds > 0) discoveryCache.delete(cacheKey);
|
|
175
|
+
if (!hasLoggedBedrockError) {
|
|
176
|
+
hasLoggedBedrockError = true;
|
|
177
|
+
console.warn(`[bedrock-discovery] Failed to list models: ${String(error)}`);
|
|
178
|
+
}
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/agents/cloudflare-ai-gateway.ts
|
|
185
|
+
const CLOUDFLARE_AI_GATEWAY_PROVIDER_ID = "cloudflare-ai-gateway";
|
|
186
|
+
const CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID = "claude-sonnet-4-5";
|
|
187
|
+
const CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_REF = `${CLOUDFLARE_AI_GATEWAY_PROVIDER_ID}/${CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID}`;
|
|
188
|
+
const CLOUDFLARE_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW = 2e5;
|
|
189
|
+
const CLOUDFLARE_AI_GATEWAY_DEFAULT_MAX_TOKENS = 64e3;
|
|
190
|
+
const CLOUDFLARE_AI_GATEWAY_DEFAULT_COST = {
|
|
191
|
+
input: 3,
|
|
192
|
+
output: 15,
|
|
193
|
+
cacheRead: .3,
|
|
194
|
+
cacheWrite: 3.75
|
|
195
|
+
};
|
|
196
|
+
function buildCloudflareAiGatewayModelDefinition(params) {
|
|
197
|
+
return {
|
|
198
|
+
id: params?.id?.trim() || CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_ID,
|
|
199
|
+
name: params?.name ?? "Claude Sonnet 4.5",
|
|
200
|
+
reasoning: params?.reasoning ?? true,
|
|
201
|
+
input: params?.input ?? ["text", "image"],
|
|
202
|
+
cost: CLOUDFLARE_AI_GATEWAY_DEFAULT_COST,
|
|
203
|
+
contextWindow: CLOUDFLARE_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW,
|
|
204
|
+
maxTokens: CLOUDFLARE_AI_GATEWAY_DEFAULT_MAX_TOKENS
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function resolveCloudflareAiGatewayBaseUrl(params) {
|
|
208
|
+
const accountId = params.accountId.trim();
|
|
209
|
+
const gatewayId = params.gatewayId.trim();
|
|
210
|
+
if (!accountId || !gatewayId) return "";
|
|
211
|
+
return `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/anthropic`;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/infra/shell-env.ts
|
|
216
|
+
const DEFAULT_TIMEOUT_MS = 15e3;
|
|
217
|
+
const DEFAULT_MAX_BUFFER_BYTES = 2 * 1024 * 1024;
|
|
218
|
+
let lastAppliedKeys = [];
|
|
219
|
+
let cachedShellPath;
|
|
220
|
+
function resolveShell(env) {
|
|
221
|
+
const shell = env.SHELL?.trim();
|
|
222
|
+
return shell && shell.length > 0 ? shell : "/bin/sh";
|
|
223
|
+
}
|
|
224
|
+
function parseShellEnv(stdout) {
|
|
225
|
+
const shellEnv = /* @__PURE__ */ new Map();
|
|
226
|
+
const parts = stdout.toString("utf8").split("\0");
|
|
227
|
+
for (const part of parts) {
|
|
228
|
+
if (!part) continue;
|
|
229
|
+
const eq = part.indexOf("=");
|
|
230
|
+
if (eq <= 0) continue;
|
|
231
|
+
const key = part.slice(0, eq);
|
|
232
|
+
const value = part.slice(eq + 1);
|
|
233
|
+
if (!key) continue;
|
|
234
|
+
shellEnv.set(key, value);
|
|
235
|
+
}
|
|
236
|
+
return shellEnv;
|
|
237
|
+
}
|
|
238
|
+
function loadShellEnvFallback(opts) {
|
|
239
|
+
const logger = opts.logger ?? console;
|
|
240
|
+
const exec = opts.exec ?? execFileSync;
|
|
241
|
+
if (!opts.enabled) {
|
|
242
|
+
lastAppliedKeys = [];
|
|
243
|
+
return {
|
|
244
|
+
ok: true,
|
|
245
|
+
applied: [],
|
|
246
|
+
skippedReason: "disabled"
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
if (opts.expectedKeys.some((key) => Boolean(opts.env[key]?.trim()))) {
|
|
250
|
+
lastAppliedKeys = [];
|
|
251
|
+
return {
|
|
252
|
+
ok: true,
|
|
253
|
+
applied: [],
|
|
254
|
+
skippedReason: "already-has-keys"
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
const timeoutMs = typeof opts.timeoutMs === "number" && Number.isFinite(opts.timeoutMs) ? Math.max(0, opts.timeoutMs) : DEFAULT_TIMEOUT_MS;
|
|
258
|
+
const shell = resolveShell(opts.env);
|
|
259
|
+
let stdout;
|
|
260
|
+
try {
|
|
261
|
+
stdout = exec(shell, [
|
|
262
|
+
"-l",
|
|
263
|
+
"-c",
|
|
264
|
+
"env -0"
|
|
265
|
+
], {
|
|
266
|
+
encoding: "buffer",
|
|
267
|
+
timeout: timeoutMs,
|
|
268
|
+
maxBuffer: DEFAULT_MAX_BUFFER_BYTES,
|
|
269
|
+
env: opts.env,
|
|
270
|
+
stdio: [
|
|
271
|
+
"ignore",
|
|
272
|
+
"pipe",
|
|
273
|
+
"pipe"
|
|
274
|
+
]
|
|
275
|
+
});
|
|
276
|
+
} catch (err) {
|
|
277
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
278
|
+
logger.warn(`[openclaw] shell env fallback failed: ${msg}`);
|
|
279
|
+
lastAppliedKeys = [];
|
|
280
|
+
return {
|
|
281
|
+
ok: false,
|
|
282
|
+
error: msg,
|
|
283
|
+
applied: []
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
const shellEnv = parseShellEnv(stdout);
|
|
287
|
+
const applied = [];
|
|
288
|
+
for (const key of opts.expectedKeys) {
|
|
289
|
+
if (opts.env[key]?.trim()) continue;
|
|
290
|
+
const value = shellEnv.get(key);
|
|
291
|
+
if (!value?.trim()) continue;
|
|
292
|
+
opts.env[key] = value;
|
|
293
|
+
applied.push(key);
|
|
294
|
+
}
|
|
295
|
+
lastAppliedKeys = applied;
|
|
296
|
+
return {
|
|
297
|
+
ok: true,
|
|
298
|
+
applied
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function shouldEnableShellEnvFallback(env) {
|
|
302
|
+
return isTruthyEnvValue(env.OPENCLAW_LOAD_SHELL_ENV);
|
|
303
|
+
}
|
|
304
|
+
function shouldDeferShellEnvFallback(env) {
|
|
305
|
+
return isTruthyEnvValue(env.OPENCLAW_DEFER_SHELL_ENV_FALLBACK);
|
|
306
|
+
}
|
|
307
|
+
function resolveShellEnvFallbackTimeoutMs(env) {
|
|
308
|
+
const raw = env.OPENCLAW_SHELL_ENV_TIMEOUT_MS?.trim();
|
|
309
|
+
if (!raw) return DEFAULT_TIMEOUT_MS;
|
|
310
|
+
const parsed = Number.parseInt(raw, 10);
|
|
311
|
+
if (!Number.isFinite(parsed)) return DEFAULT_TIMEOUT_MS;
|
|
312
|
+
return Math.max(0, parsed);
|
|
313
|
+
}
|
|
314
|
+
function getShellPathFromLoginShell(opts) {
|
|
315
|
+
if (cachedShellPath !== void 0) return cachedShellPath;
|
|
316
|
+
if (process.platform === "win32") {
|
|
317
|
+
cachedShellPath = null;
|
|
318
|
+
return cachedShellPath;
|
|
319
|
+
}
|
|
320
|
+
const exec = opts.exec ?? execFileSync;
|
|
321
|
+
const timeoutMs = typeof opts.timeoutMs === "number" && Number.isFinite(opts.timeoutMs) ? Math.max(0, opts.timeoutMs) : DEFAULT_TIMEOUT_MS;
|
|
322
|
+
const shell = resolveShell(opts.env);
|
|
323
|
+
let stdout;
|
|
324
|
+
try {
|
|
325
|
+
stdout = exec(shell, [
|
|
326
|
+
"-l",
|
|
327
|
+
"-c",
|
|
328
|
+
"env -0"
|
|
329
|
+
], {
|
|
330
|
+
encoding: "buffer",
|
|
331
|
+
timeout: timeoutMs,
|
|
332
|
+
maxBuffer: DEFAULT_MAX_BUFFER_BYTES,
|
|
333
|
+
env: opts.env,
|
|
334
|
+
stdio: [
|
|
335
|
+
"ignore",
|
|
336
|
+
"pipe",
|
|
337
|
+
"pipe"
|
|
338
|
+
]
|
|
339
|
+
});
|
|
340
|
+
} catch {
|
|
341
|
+
cachedShellPath = null;
|
|
342
|
+
return cachedShellPath;
|
|
343
|
+
}
|
|
344
|
+
const shellPath = parseShellEnv(stdout).get("PATH")?.trim();
|
|
345
|
+
cachedShellPath = shellPath && shellPath.length > 0 ? shellPath : null;
|
|
346
|
+
return cachedShellPath;
|
|
347
|
+
}
|
|
348
|
+
function getShellEnvAppliedKeys() {
|
|
349
|
+
return [...lastAppliedKeys];
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/agents/model-auth.ts
|
|
354
|
+
const AWS_BEARER_ENV = "AWS_BEARER_TOKEN_BEDROCK";
|
|
355
|
+
const AWS_ACCESS_KEY_ENV = "AWS_ACCESS_KEY_ID";
|
|
356
|
+
const AWS_SECRET_KEY_ENV = "AWS_SECRET_ACCESS_KEY";
|
|
357
|
+
const AWS_PROFILE_ENV = "AWS_PROFILE";
|
|
358
|
+
function resolveProviderConfig(cfg, provider) {
|
|
359
|
+
const providers = cfg?.models?.providers ?? {};
|
|
360
|
+
const direct = providers[provider];
|
|
361
|
+
if (direct) return direct;
|
|
362
|
+
const normalized = normalizeProviderId(provider);
|
|
363
|
+
if (normalized === provider) return Object.entries(providers).find(([key]) => normalizeProviderId(key) === normalized)?.[1];
|
|
364
|
+
return providers[normalized] ?? Object.entries(providers).find(([key]) => normalizeProviderId(key) === normalized)?.[1];
|
|
365
|
+
}
|
|
366
|
+
function getCustomProviderApiKey(cfg, provider) {
|
|
367
|
+
return resolveProviderConfig(cfg, provider)?.apiKey?.trim() || void 0;
|
|
368
|
+
}
|
|
369
|
+
function resolveProviderAuthOverride(cfg, provider) {
|
|
370
|
+
const auth = resolveProviderConfig(cfg, provider)?.auth;
|
|
371
|
+
if (auth === "api-key" || auth === "aws-sdk" || auth === "oauth" || auth === "token") return auth;
|
|
372
|
+
}
|
|
373
|
+
function resolveEnvSourceLabel(params) {
|
|
374
|
+
return `${params.envVars.some((envVar) => params.applied.has(envVar)) ? "shell env: " : "env: "}${params.label}`;
|
|
375
|
+
}
|
|
376
|
+
function resolveAwsSdkEnvVarName(env = process.env) {
|
|
377
|
+
if (env[AWS_BEARER_ENV]?.trim()) return AWS_BEARER_ENV;
|
|
378
|
+
if (env[AWS_ACCESS_KEY_ENV]?.trim() && env[AWS_SECRET_KEY_ENV]?.trim()) return AWS_ACCESS_KEY_ENV;
|
|
379
|
+
if (env[AWS_PROFILE_ENV]?.trim()) return AWS_PROFILE_ENV;
|
|
380
|
+
}
|
|
381
|
+
function resolveAwsSdkAuthInfo() {
|
|
382
|
+
const applied = new Set(getShellEnvAppliedKeys());
|
|
383
|
+
if (process.env[AWS_BEARER_ENV]?.trim()) return {
|
|
384
|
+
mode: "aws-sdk",
|
|
385
|
+
source: resolveEnvSourceLabel({
|
|
386
|
+
applied,
|
|
387
|
+
envVars: [AWS_BEARER_ENV],
|
|
388
|
+
label: AWS_BEARER_ENV
|
|
389
|
+
})
|
|
390
|
+
};
|
|
391
|
+
if (process.env[AWS_ACCESS_KEY_ENV]?.trim() && process.env[AWS_SECRET_KEY_ENV]?.trim()) return {
|
|
392
|
+
mode: "aws-sdk",
|
|
393
|
+
source: resolveEnvSourceLabel({
|
|
394
|
+
applied,
|
|
395
|
+
envVars: [AWS_ACCESS_KEY_ENV, AWS_SECRET_KEY_ENV],
|
|
396
|
+
label: `${AWS_ACCESS_KEY_ENV} + ${AWS_SECRET_KEY_ENV}`
|
|
397
|
+
})
|
|
398
|
+
};
|
|
399
|
+
if (process.env[AWS_PROFILE_ENV]?.trim()) return {
|
|
400
|
+
mode: "aws-sdk",
|
|
401
|
+
source: resolveEnvSourceLabel({
|
|
402
|
+
applied,
|
|
403
|
+
envVars: [AWS_PROFILE_ENV],
|
|
404
|
+
label: AWS_PROFILE_ENV
|
|
405
|
+
})
|
|
406
|
+
};
|
|
407
|
+
return {
|
|
408
|
+
mode: "aws-sdk",
|
|
409
|
+
source: "aws-sdk default chain"
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
async function resolveApiKeyForProvider(params) {
|
|
413
|
+
const { provider, cfg, profileId, preferredProfile } = params;
|
|
414
|
+
const store = params.store ?? ensureAuthProfileStore(params.agentDir);
|
|
415
|
+
if (profileId) {
|
|
416
|
+
const resolved = await resolveApiKeyForProfile({
|
|
417
|
+
cfg,
|
|
418
|
+
store,
|
|
419
|
+
profileId,
|
|
420
|
+
agentDir: params.agentDir
|
|
421
|
+
});
|
|
422
|
+
if (!resolved) throw new Error(`No credentials found for profile "${profileId}".`);
|
|
423
|
+
const mode = store.profiles[profileId]?.type;
|
|
424
|
+
return {
|
|
425
|
+
apiKey: resolved.apiKey,
|
|
426
|
+
profileId,
|
|
427
|
+
source: `profile:${profileId}`,
|
|
428
|
+
mode: mode === "oauth" ? "oauth" : mode === "token" ? "token" : "api-key"
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
const authOverride = resolveProviderAuthOverride(cfg, provider);
|
|
432
|
+
if (authOverride === "aws-sdk") return resolveAwsSdkAuthInfo();
|
|
433
|
+
const order = resolveAuthProfileOrder({
|
|
434
|
+
cfg,
|
|
435
|
+
store,
|
|
436
|
+
provider,
|
|
437
|
+
preferredProfile
|
|
438
|
+
});
|
|
439
|
+
for (const candidate of order) try {
|
|
440
|
+
const resolved = await resolveApiKeyForProfile({
|
|
441
|
+
cfg,
|
|
442
|
+
store,
|
|
443
|
+
profileId: candidate,
|
|
444
|
+
agentDir: params.agentDir
|
|
445
|
+
});
|
|
446
|
+
if (resolved) {
|
|
447
|
+
const mode = store.profiles[candidate]?.type;
|
|
448
|
+
return {
|
|
449
|
+
apiKey: resolved.apiKey,
|
|
450
|
+
profileId: candidate,
|
|
451
|
+
source: `profile:${candidate}`,
|
|
452
|
+
mode: mode === "oauth" ? "oauth" : mode === "token" ? "token" : "api-key"
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
} catch {}
|
|
456
|
+
const envResolved = resolveEnvApiKey(provider);
|
|
457
|
+
if (envResolved) return {
|
|
458
|
+
apiKey: envResolved.apiKey,
|
|
459
|
+
source: envResolved.source,
|
|
460
|
+
mode: envResolved.source.includes("OAUTH_TOKEN") ? "oauth" : "api-key"
|
|
461
|
+
};
|
|
462
|
+
const customKey = getCustomProviderApiKey(cfg, provider);
|
|
463
|
+
if (customKey) return {
|
|
464
|
+
apiKey: customKey,
|
|
465
|
+
source: "models.json",
|
|
466
|
+
mode: "api-key"
|
|
467
|
+
};
|
|
468
|
+
const normalized = normalizeProviderId(provider);
|
|
469
|
+
if (authOverride === void 0 && normalized === "amazon-bedrock") return resolveAwsSdkAuthInfo();
|
|
470
|
+
if (provider === "openai") {
|
|
471
|
+
if (listProfilesForProvider(store, "openai-codex").length > 0) throw new Error("No API key found for provider \"openai\". You are authenticated with OpenAI Codex OAuth. Use openai-codex/gpt-5.3-codex (OAuth) or set OPENAI_API_KEY to use openai/gpt-5.1-codex.");
|
|
472
|
+
}
|
|
473
|
+
const authStorePath = resolveAuthStorePathForDisplay(params.agentDir);
|
|
474
|
+
const resolvedAgentDir = path.dirname(authStorePath);
|
|
475
|
+
throw new Error([
|
|
476
|
+
`No API key found for provider "${provider}".`,
|
|
477
|
+
`Auth store: ${authStorePath} (agentDir: ${resolvedAgentDir}).`,
|
|
478
|
+
`Configure auth for this agent (${formatCliCommand("openclaw agents add <id>")}) or copy auth-profiles.json from the main agentDir.`
|
|
479
|
+
].join(" "));
|
|
480
|
+
}
|
|
481
|
+
function resolveEnvApiKey(provider) {
|
|
482
|
+
const normalized = normalizeProviderId(provider);
|
|
483
|
+
const applied = new Set(getShellEnvAppliedKeys());
|
|
484
|
+
const pick = (envVar) => {
|
|
485
|
+
const value = process.env[envVar]?.trim();
|
|
486
|
+
if (!value) return null;
|
|
487
|
+
return {
|
|
488
|
+
apiKey: value,
|
|
489
|
+
source: applied.has(envVar) ? `shell env: ${envVar}` : `env: ${envVar}`
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
if (normalized === "github-copilot") return pick("COPILOT_GITHUB_TOKEN") ?? pick("GH_TOKEN") ?? pick("GITHUB_TOKEN");
|
|
493
|
+
if (normalized === "anthropic") return pick("ANTHROPIC_OAUTH_TOKEN") ?? pick("ANTHROPIC_API_KEY");
|
|
494
|
+
if (normalized === "chutes") return pick("CHUTES_OAUTH_TOKEN") ?? pick("CHUTES_API_KEY");
|
|
495
|
+
if (normalized === "zai") return pick("ZAI_API_KEY") ?? pick("Z_AI_API_KEY");
|
|
496
|
+
if (normalized === "google-vertex") {
|
|
497
|
+
const envKey = getEnvApiKey(normalized);
|
|
498
|
+
if (!envKey) return null;
|
|
499
|
+
return {
|
|
500
|
+
apiKey: envKey,
|
|
501
|
+
source: "gcloud adc"
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
if (normalized === "opencode") return pick("OPENCODE_API_KEY") ?? pick("OPENCODE_ZEN_API_KEY");
|
|
505
|
+
if (normalized === "qwen-portal") return pick("QWEN_OAUTH_TOKEN") ?? pick("QWEN_PORTAL_API_KEY");
|
|
506
|
+
if (normalized === "minimax-portal") return pick("MINIMAX_OAUTH_TOKEN") ?? pick("MINIMAX_API_KEY");
|
|
507
|
+
if (normalized === "kimi-coding") return pick("KIMI_API_KEY") ?? pick("KIMICODE_API_KEY");
|
|
508
|
+
const envVar = {
|
|
509
|
+
openai: "OPENAI_API_KEY",
|
|
510
|
+
google: "GEMINI_API_KEY",
|
|
511
|
+
voyage: "VOYAGE_API_KEY",
|
|
512
|
+
groq: "GROQ_API_KEY",
|
|
513
|
+
deepgram: "DEEPGRAM_API_KEY",
|
|
514
|
+
cerebras: "CEREBRAS_API_KEY",
|
|
515
|
+
xai: "XAI_API_KEY",
|
|
516
|
+
openrouter: "OPENROUTER_API_KEY",
|
|
517
|
+
"vercel-ai-gateway": "AI_GATEWAY_API_KEY",
|
|
518
|
+
"cloudflare-ai-gateway": "CLOUDFLARE_AI_GATEWAY_API_KEY",
|
|
519
|
+
moonshot: "MOONSHOT_API_KEY",
|
|
520
|
+
minimax: "MINIMAX_API_KEY",
|
|
521
|
+
xiaomi: "XIAOMI_API_KEY",
|
|
522
|
+
synthetic: "SYNTHETIC_API_KEY",
|
|
523
|
+
venice: "VENICE_API_KEY",
|
|
524
|
+
mistral: "MISTRAL_API_KEY",
|
|
525
|
+
opencode: "OPENCODE_API_KEY",
|
|
526
|
+
qianfan: "QIANFAN_API_KEY",
|
|
527
|
+
ollama: "OLLAMA_API_KEY"
|
|
528
|
+
}[normalized];
|
|
529
|
+
if (!envVar) return null;
|
|
530
|
+
return pick(envVar);
|
|
531
|
+
}
|
|
532
|
+
function resolveModelAuthMode(provider, cfg, store) {
|
|
533
|
+
const resolved = provider?.trim();
|
|
534
|
+
if (!resolved) return;
|
|
535
|
+
const authOverride = resolveProviderAuthOverride(cfg, resolved);
|
|
536
|
+
if (authOverride === "aws-sdk") return "aws-sdk";
|
|
537
|
+
const authStore = store ?? ensureAuthProfileStore();
|
|
538
|
+
const profiles = listProfilesForProvider(authStore, resolved);
|
|
539
|
+
if (profiles.length > 0) {
|
|
540
|
+
const modes = new Set(profiles.map((id) => authStore.profiles[id]?.type).filter((mode) => Boolean(mode)));
|
|
541
|
+
if ([
|
|
542
|
+
"oauth",
|
|
543
|
+
"token",
|
|
544
|
+
"api_key"
|
|
545
|
+
].filter((k) => modes.has(k)).length >= 2) return "mixed";
|
|
546
|
+
if (modes.has("oauth")) return "oauth";
|
|
547
|
+
if (modes.has("token")) return "token";
|
|
548
|
+
if (modes.has("api_key")) return "api-key";
|
|
549
|
+
}
|
|
550
|
+
if (authOverride === void 0 && normalizeProviderId(resolved) === "amazon-bedrock") return "aws-sdk";
|
|
551
|
+
const envKey = resolveEnvApiKey(resolved);
|
|
552
|
+
if (envKey?.apiKey) return envKey.source.includes("OAUTH_TOKEN") ? "oauth" : "api-key";
|
|
553
|
+
if (getCustomProviderApiKey(cfg, resolved)) return "api-key";
|
|
554
|
+
return "unknown";
|
|
555
|
+
}
|
|
556
|
+
async function getApiKeyForModel(params) {
|
|
557
|
+
return resolveApiKeyForProvider({
|
|
558
|
+
provider: params.model.provider,
|
|
559
|
+
cfg: params.cfg,
|
|
560
|
+
profileId: params.profileId,
|
|
561
|
+
preferredProfile: params.preferredProfile,
|
|
562
|
+
store: params.store,
|
|
563
|
+
agentDir: params.agentDir
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
function requireApiKey(auth, provider) {
|
|
567
|
+
const key = auth.apiKey?.trim();
|
|
568
|
+
if (key) return key;
|
|
569
|
+
throw new Error(`No API key resolved for provider "${provider}" (auth mode: ${auth.mode}).`);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region src/agents/synthetic-models.ts
|
|
574
|
+
const SYNTHETIC_BASE_URL = "https://api.synthetic.new/anthropic";
|
|
575
|
+
const SYNTHETIC_DEFAULT_MODEL_ID = "hf:MiniMaxAI/MiniMax-M2.1";
|
|
576
|
+
const SYNTHETIC_DEFAULT_MODEL_REF = `synthetic/${SYNTHETIC_DEFAULT_MODEL_ID}`;
|
|
577
|
+
const SYNTHETIC_DEFAULT_COST = {
|
|
578
|
+
input: 0,
|
|
579
|
+
output: 0,
|
|
580
|
+
cacheRead: 0,
|
|
581
|
+
cacheWrite: 0
|
|
582
|
+
};
|
|
583
|
+
const SYNTHETIC_MODEL_CATALOG = [
|
|
584
|
+
{
|
|
585
|
+
id: SYNTHETIC_DEFAULT_MODEL_ID,
|
|
586
|
+
name: "MiniMax M2.1",
|
|
587
|
+
reasoning: false,
|
|
588
|
+
input: ["text"],
|
|
589
|
+
contextWindow: 192e3,
|
|
590
|
+
maxTokens: 65536
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
id: "hf:moonshotai/Kimi-K2-Thinking",
|
|
594
|
+
name: "Kimi K2 Thinking",
|
|
595
|
+
reasoning: true,
|
|
596
|
+
input: ["text"],
|
|
597
|
+
contextWindow: 256e3,
|
|
598
|
+
maxTokens: 8192
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
id: "hf:zai-org/GLM-4.7",
|
|
602
|
+
name: "GLM-4.7",
|
|
603
|
+
reasoning: false,
|
|
604
|
+
input: ["text"],
|
|
605
|
+
contextWindow: 198e3,
|
|
606
|
+
maxTokens: 128e3
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
id: "hf:deepseek-ai/DeepSeek-R1-0528",
|
|
610
|
+
name: "DeepSeek R1 0528",
|
|
611
|
+
reasoning: false,
|
|
612
|
+
input: ["text"],
|
|
613
|
+
contextWindow: 128e3,
|
|
614
|
+
maxTokens: 8192
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
id: "hf:deepseek-ai/DeepSeek-V3-0324",
|
|
618
|
+
name: "DeepSeek V3 0324",
|
|
619
|
+
reasoning: false,
|
|
620
|
+
input: ["text"],
|
|
621
|
+
contextWindow: 128e3,
|
|
622
|
+
maxTokens: 8192
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
id: "hf:deepseek-ai/DeepSeek-V3.1",
|
|
626
|
+
name: "DeepSeek V3.1",
|
|
627
|
+
reasoning: false,
|
|
628
|
+
input: ["text"],
|
|
629
|
+
contextWindow: 128e3,
|
|
630
|
+
maxTokens: 8192
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
id: "hf:deepseek-ai/DeepSeek-V3.1-Terminus",
|
|
634
|
+
name: "DeepSeek V3.1 Terminus",
|
|
635
|
+
reasoning: false,
|
|
636
|
+
input: ["text"],
|
|
637
|
+
contextWindow: 128e3,
|
|
638
|
+
maxTokens: 8192
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
id: "hf:deepseek-ai/DeepSeek-V3.2",
|
|
642
|
+
name: "DeepSeek V3.2",
|
|
643
|
+
reasoning: false,
|
|
644
|
+
input: ["text"],
|
|
645
|
+
contextWindow: 159e3,
|
|
646
|
+
maxTokens: 8192
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
id: "hf:meta-llama/Llama-3.3-70B-Instruct",
|
|
650
|
+
name: "Llama 3.3 70B Instruct",
|
|
651
|
+
reasoning: false,
|
|
652
|
+
input: ["text"],
|
|
653
|
+
contextWindow: 128e3,
|
|
654
|
+
maxTokens: 8192
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
id: "hf:meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",
|
|
658
|
+
name: "Llama 4 Maverick 17B 128E Instruct FP8",
|
|
659
|
+
reasoning: false,
|
|
660
|
+
input: ["text"],
|
|
661
|
+
contextWindow: 524e3,
|
|
662
|
+
maxTokens: 8192
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
id: "hf:moonshotai/Kimi-K2-Instruct-0905",
|
|
666
|
+
name: "Kimi K2 Instruct 0905",
|
|
667
|
+
reasoning: false,
|
|
668
|
+
input: ["text"],
|
|
669
|
+
contextWindow: 256e3,
|
|
670
|
+
maxTokens: 8192
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
id: "hf:moonshotai/Kimi-K2.5",
|
|
674
|
+
name: "Kimi K2.5",
|
|
675
|
+
reasoning: true,
|
|
676
|
+
input: ["text"],
|
|
677
|
+
contextWindow: 256e3,
|
|
678
|
+
maxTokens: 8192
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
id: "hf:openai/gpt-oss-120b",
|
|
682
|
+
name: "GPT OSS 120B",
|
|
683
|
+
reasoning: false,
|
|
684
|
+
input: ["text"],
|
|
685
|
+
contextWindow: 128e3,
|
|
686
|
+
maxTokens: 8192
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
id: "hf:Qwen/Qwen3-235B-A22B-Instruct-2507",
|
|
690
|
+
name: "Qwen3 235B A22B Instruct 2507",
|
|
691
|
+
reasoning: false,
|
|
692
|
+
input: ["text"],
|
|
693
|
+
contextWindow: 256e3,
|
|
694
|
+
maxTokens: 8192
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
id: "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
698
|
+
name: "Qwen3 Coder 480B A35B Instruct",
|
|
699
|
+
reasoning: false,
|
|
700
|
+
input: ["text"],
|
|
701
|
+
contextWindow: 256e3,
|
|
702
|
+
maxTokens: 8192
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
id: "hf:Qwen/Qwen3-VL-235B-A22B-Instruct",
|
|
706
|
+
name: "Qwen3 VL 235B A22B Instruct",
|
|
707
|
+
reasoning: false,
|
|
708
|
+
input: ["text", "image"],
|
|
709
|
+
contextWindow: 25e4,
|
|
710
|
+
maxTokens: 8192
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
id: "hf:zai-org/GLM-4.5",
|
|
714
|
+
name: "GLM-4.5",
|
|
715
|
+
reasoning: false,
|
|
716
|
+
input: ["text"],
|
|
717
|
+
contextWindow: 128e3,
|
|
718
|
+
maxTokens: 128e3
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
id: "hf:zai-org/GLM-4.6",
|
|
722
|
+
name: "GLM-4.6",
|
|
723
|
+
reasoning: false,
|
|
724
|
+
input: ["text"],
|
|
725
|
+
contextWindow: 198e3,
|
|
726
|
+
maxTokens: 128e3
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
id: "hf:deepseek-ai/DeepSeek-V3",
|
|
730
|
+
name: "DeepSeek V3",
|
|
731
|
+
reasoning: false,
|
|
732
|
+
input: ["text"],
|
|
733
|
+
contextWindow: 128e3,
|
|
734
|
+
maxTokens: 8192
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
id: "hf:Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
738
|
+
name: "Qwen3 235B A22B Thinking 2507",
|
|
739
|
+
reasoning: true,
|
|
740
|
+
input: ["text"],
|
|
741
|
+
contextWindow: 256e3,
|
|
742
|
+
maxTokens: 8192
|
|
743
|
+
}
|
|
744
|
+
];
|
|
745
|
+
function buildSyntheticModelDefinition(entry) {
|
|
746
|
+
return {
|
|
747
|
+
id: entry.id,
|
|
748
|
+
name: entry.name,
|
|
749
|
+
reasoning: entry.reasoning,
|
|
750
|
+
input: [...entry.input],
|
|
751
|
+
cost: SYNTHETIC_DEFAULT_COST,
|
|
752
|
+
contextWindow: entry.contextWindow,
|
|
753
|
+
maxTokens: entry.maxTokens
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region src/agents/venice-models.ts
|
|
759
|
+
const VENICE_BASE_URL = "https://api.venice.ai/api/v1";
|
|
760
|
+
const VENICE_DEFAULT_MODEL_ID = "llama-3.3-70b";
|
|
761
|
+
const VENICE_DEFAULT_MODEL_REF = `venice/${VENICE_DEFAULT_MODEL_ID}`;
|
|
762
|
+
const VENICE_DEFAULT_COST = {
|
|
763
|
+
input: 0,
|
|
764
|
+
output: 0,
|
|
765
|
+
cacheRead: 0,
|
|
766
|
+
cacheWrite: 0
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* Complete catalog of Venice AI models.
|
|
770
|
+
*
|
|
771
|
+
* Venice provides two privacy modes:
|
|
772
|
+
* - "private": Fully private inference, no logging, ephemeral
|
|
773
|
+
* - "anonymized": Proxied through Venice with metadata stripped (for proprietary models)
|
|
774
|
+
*
|
|
775
|
+
* Note: The `privacy` field is included for documentation purposes but is not
|
|
776
|
+
* propagated to ModelDefinitionConfig as it's not part of the core model schema.
|
|
777
|
+
* Privacy mode is determined by the model itself, not configurable at runtime.
|
|
778
|
+
*
|
|
779
|
+
* This catalog serves as a fallback when the Venice API is unreachable.
|
|
780
|
+
*/
|
|
781
|
+
const VENICE_MODEL_CATALOG = [
|
|
782
|
+
{
|
|
783
|
+
id: "llama-3.3-70b",
|
|
784
|
+
name: "Llama 3.3 70B",
|
|
785
|
+
reasoning: false,
|
|
786
|
+
input: ["text"],
|
|
787
|
+
contextWindow: 131072,
|
|
788
|
+
maxTokens: 8192,
|
|
789
|
+
privacy: "private"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
id: "llama-3.2-3b",
|
|
793
|
+
name: "Llama 3.2 3B",
|
|
794
|
+
reasoning: false,
|
|
795
|
+
input: ["text"],
|
|
796
|
+
contextWindow: 131072,
|
|
797
|
+
maxTokens: 8192,
|
|
798
|
+
privacy: "private"
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
id: "hermes-3-llama-3.1-405b",
|
|
802
|
+
name: "Hermes 3 Llama 3.1 405B",
|
|
803
|
+
reasoning: false,
|
|
804
|
+
input: ["text"],
|
|
805
|
+
contextWindow: 131072,
|
|
806
|
+
maxTokens: 8192,
|
|
807
|
+
privacy: "private"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
id: "qwen3-235b-a22b-thinking-2507",
|
|
811
|
+
name: "Qwen3 235B Thinking",
|
|
812
|
+
reasoning: true,
|
|
813
|
+
input: ["text"],
|
|
814
|
+
contextWindow: 131072,
|
|
815
|
+
maxTokens: 8192,
|
|
816
|
+
privacy: "private"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
id: "qwen3-235b-a22b-instruct-2507",
|
|
820
|
+
name: "Qwen3 235B Instruct",
|
|
821
|
+
reasoning: false,
|
|
822
|
+
input: ["text"],
|
|
823
|
+
contextWindow: 131072,
|
|
824
|
+
maxTokens: 8192,
|
|
825
|
+
privacy: "private"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
id: "qwen3-coder-480b-a35b-instruct",
|
|
829
|
+
name: "Qwen3 Coder 480B",
|
|
830
|
+
reasoning: false,
|
|
831
|
+
input: ["text"],
|
|
832
|
+
contextWindow: 262144,
|
|
833
|
+
maxTokens: 8192,
|
|
834
|
+
privacy: "private"
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
id: "qwen3-next-80b",
|
|
838
|
+
name: "Qwen3 Next 80B",
|
|
839
|
+
reasoning: false,
|
|
840
|
+
input: ["text"],
|
|
841
|
+
contextWindow: 262144,
|
|
842
|
+
maxTokens: 8192,
|
|
843
|
+
privacy: "private"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
id: "qwen3-vl-235b-a22b",
|
|
847
|
+
name: "Qwen3 VL 235B (Vision)",
|
|
848
|
+
reasoning: false,
|
|
849
|
+
input: ["text", "image"],
|
|
850
|
+
contextWindow: 262144,
|
|
851
|
+
maxTokens: 8192,
|
|
852
|
+
privacy: "private"
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
id: "qwen3-4b",
|
|
856
|
+
name: "Venice Small (Qwen3 4B)",
|
|
857
|
+
reasoning: true,
|
|
858
|
+
input: ["text"],
|
|
859
|
+
contextWindow: 32768,
|
|
860
|
+
maxTokens: 8192,
|
|
861
|
+
privacy: "private"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
id: "deepseek-v3.2",
|
|
865
|
+
name: "DeepSeek V3.2",
|
|
866
|
+
reasoning: true,
|
|
867
|
+
input: ["text"],
|
|
868
|
+
contextWindow: 163840,
|
|
869
|
+
maxTokens: 8192,
|
|
870
|
+
privacy: "private"
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
id: "venice-uncensored",
|
|
874
|
+
name: "Venice Uncensored (Dolphin-Mistral)",
|
|
875
|
+
reasoning: false,
|
|
876
|
+
input: ["text"],
|
|
877
|
+
contextWindow: 32768,
|
|
878
|
+
maxTokens: 8192,
|
|
879
|
+
privacy: "private"
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
id: "mistral-31-24b",
|
|
883
|
+
name: "Venice Medium (Mistral)",
|
|
884
|
+
reasoning: false,
|
|
885
|
+
input: ["text", "image"],
|
|
886
|
+
contextWindow: 131072,
|
|
887
|
+
maxTokens: 8192,
|
|
888
|
+
privacy: "private"
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
id: "google-gemma-3-27b-it",
|
|
892
|
+
name: "Google Gemma 3 27B Instruct",
|
|
893
|
+
reasoning: false,
|
|
894
|
+
input: ["text", "image"],
|
|
895
|
+
contextWindow: 202752,
|
|
896
|
+
maxTokens: 8192,
|
|
897
|
+
privacy: "private"
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
id: "openai-gpt-oss-120b",
|
|
901
|
+
name: "OpenAI GPT OSS 120B",
|
|
902
|
+
reasoning: false,
|
|
903
|
+
input: ["text"],
|
|
904
|
+
contextWindow: 131072,
|
|
905
|
+
maxTokens: 8192,
|
|
906
|
+
privacy: "private"
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
id: "zai-org-glm-4.7",
|
|
910
|
+
name: "GLM 4.7",
|
|
911
|
+
reasoning: true,
|
|
912
|
+
input: ["text"],
|
|
913
|
+
contextWindow: 202752,
|
|
914
|
+
maxTokens: 8192,
|
|
915
|
+
privacy: "private"
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
id: "claude-opus-45",
|
|
919
|
+
name: "Claude Opus 4.5 (via Venice)",
|
|
920
|
+
reasoning: true,
|
|
921
|
+
input: ["text", "image"],
|
|
922
|
+
contextWindow: 202752,
|
|
923
|
+
maxTokens: 8192,
|
|
924
|
+
privacy: "anonymized"
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
id: "claude-sonnet-45",
|
|
928
|
+
name: "Claude Sonnet 4.5 (via Venice)",
|
|
929
|
+
reasoning: true,
|
|
930
|
+
input: ["text", "image"],
|
|
931
|
+
contextWindow: 202752,
|
|
932
|
+
maxTokens: 8192,
|
|
933
|
+
privacy: "anonymized"
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
id: "openai-gpt-52",
|
|
937
|
+
name: "GPT-5.2 (via Venice)",
|
|
938
|
+
reasoning: true,
|
|
939
|
+
input: ["text"],
|
|
940
|
+
contextWindow: 262144,
|
|
941
|
+
maxTokens: 8192,
|
|
942
|
+
privacy: "anonymized"
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
id: "openai-gpt-52-codex",
|
|
946
|
+
name: "GPT-5.2 Codex (via Venice)",
|
|
947
|
+
reasoning: true,
|
|
948
|
+
input: ["text", "image"],
|
|
949
|
+
contextWindow: 262144,
|
|
950
|
+
maxTokens: 8192,
|
|
951
|
+
privacy: "anonymized"
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
id: "gemini-3-pro-preview",
|
|
955
|
+
name: "Gemini 3 Pro (via Venice)",
|
|
956
|
+
reasoning: true,
|
|
957
|
+
input: ["text", "image"],
|
|
958
|
+
contextWindow: 202752,
|
|
959
|
+
maxTokens: 8192,
|
|
960
|
+
privacy: "anonymized"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
id: "gemini-3-flash-preview",
|
|
964
|
+
name: "Gemini 3 Flash (via Venice)",
|
|
965
|
+
reasoning: true,
|
|
966
|
+
input: ["text", "image"],
|
|
967
|
+
contextWindow: 262144,
|
|
968
|
+
maxTokens: 8192,
|
|
969
|
+
privacy: "anonymized"
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
id: "grok-41-fast",
|
|
973
|
+
name: "Grok 4.1 Fast (via Venice)",
|
|
974
|
+
reasoning: true,
|
|
975
|
+
input: ["text", "image"],
|
|
976
|
+
contextWindow: 262144,
|
|
977
|
+
maxTokens: 8192,
|
|
978
|
+
privacy: "anonymized"
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
id: "grok-code-fast-1",
|
|
982
|
+
name: "Grok Code Fast 1 (via Venice)",
|
|
983
|
+
reasoning: true,
|
|
984
|
+
input: ["text"],
|
|
985
|
+
contextWindow: 262144,
|
|
986
|
+
maxTokens: 8192,
|
|
987
|
+
privacy: "anonymized"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
id: "kimi-k2-thinking",
|
|
991
|
+
name: "Kimi K2 Thinking (via Venice)",
|
|
992
|
+
reasoning: true,
|
|
993
|
+
input: ["text"],
|
|
994
|
+
contextWindow: 262144,
|
|
995
|
+
maxTokens: 8192,
|
|
996
|
+
privacy: "anonymized"
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
id: "minimax-m21",
|
|
1000
|
+
name: "MiniMax M2.1 (via Venice)",
|
|
1001
|
+
reasoning: true,
|
|
1002
|
+
input: ["text"],
|
|
1003
|
+
contextWindow: 202752,
|
|
1004
|
+
maxTokens: 8192,
|
|
1005
|
+
privacy: "anonymized"
|
|
1006
|
+
}
|
|
1007
|
+
];
|
|
1008
|
+
/**
|
|
1009
|
+
* Build a ModelDefinitionConfig from a Venice catalog entry.
|
|
1010
|
+
*
|
|
1011
|
+
* Note: The `privacy` field from the catalog is not included in the output
|
|
1012
|
+
* as ModelDefinitionConfig doesn't support custom metadata fields. Privacy
|
|
1013
|
+
* mode is inherent to each model and documented in the catalog/docs.
|
|
1014
|
+
*/
|
|
1015
|
+
function buildVeniceModelDefinition(entry) {
|
|
1016
|
+
return {
|
|
1017
|
+
id: entry.id,
|
|
1018
|
+
name: entry.name,
|
|
1019
|
+
reasoning: entry.reasoning,
|
|
1020
|
+
input: [...entry.input],
|
|
1021
|
+
cost: VENICE_DEFAULT_COST,
|
|
1022
|
+
contextWindow: entry.contextWindow,
|
|
1023
|
+
maxTokens: entry.maxTokens
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Discover models from Venice API with fallback to static catalog.
|
|
1028
|
+
* The /models endpoint is public and doesn't require authentication.
|
|
1029
|
+
*/
|
|
1030
|
+
async function discoverVeniceModels() {
|
|
1031
|
+
if (process.env.VITEST) return VENICE_MODEL_CATALOG.map(buildVeniceModelDefinition);
|
|
1032
|
+
try {
|
|
1033
|
+
const response = await fetch(`${VENICE_BASE_URL}/models`, { signal: AbortSignal.timeout(5e3) });
|
|
1034
|
+
if (!response.ok) {
|
|
1035
|
+
console.warn(`[venice-models] Failed to discover models: HTTP ${response.status}, using static catalog`);
|
|
1036
|
+
return VENICE_MODEL_CATALOG.map(buildVeniceModelDefinition);
|
|
1037
|
+
}
|
|
1038
|
+
const data = await response.json();
|
|
1039
|
+
if (!Array.isArray(data.data) || data.data.length === 0) {
|
|
1040
|
+
console.warn("[venice-models] No models found from API, using static catalog");
|
|
1041
|
+
return VENICE_MODEL_CATALOG.map(buildVeniceModelDefinition);
|
|
1042
|
+
}
|
|
1043
|
+
const catalogById = new Map(VENICE_MODEL_CATALOG.map((m) => [m.id, m]));
|
|
1044
|
+
const models = [];
|
|
1045
|
+
for (const apiModel of data.data) {
|
|
1046
|
+
const catalogEntry = catalogById.get(apiModel.id);
|
|
1047
|
+
if (catalogEntry) models.push(buildVeniceModelDefinition(catalogEntry));
|
|
1048
|
+
else {
|
|
1049
|
+
const isReasoning = apiModel.model_spec.capabilities.supportsReasoning || apiModel.id.toLowerCase().includes("thinking") || apiModel.id.toLowerCase().includes("reason") || apiModel.id.toLowerCase().includes("r1");
|
|
1050
|
+
const hasVision = apiModel.model_spec.capabilities.supportsVision;
|
|
1051
|
+
models.push({
|
|
1052
|
+
id: apiModel.id,
|
|
1053
|
+
name: apiModel.model_spec.name || apiModel.id,
|
|
1054
|
+
reasoning: isReasoning,
|
|
1055
|
+
input: hasVision ? ["text", "image"] : ["text"],
|
|
1056
|
+
cost: VENICE_DEFAULT_COST,
|
|
1057
|
+
contextWindow: apiModel.model_spec.availableContextTokens || 128e3,
|
|
1058
|
+
maxTokens: 8192
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
return models.length > 0 ? models : VENICE_MODEL_CATALOG.map(buildVeniceModelDefinition);
|
|
1063
|
+
} catch (error) {
|
|
1064
|
+
console.warn(`[venice-models] Discovery failed: ${String(error)}, using static catalog`);
|
|
1065
|
+
return VENICE_MODEL_CATALOG.map(buildVeniceModelDefinition);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
//#endregion
|
|
1070
|
+
//#region src/agents/models-config.providers.ts
|
|
1071
|
+
const MINIMAX_API_BASE_URL = "https://api.minimax.chat/v1";
|
|
1072
|
+
const MINIMAX_PORTAL_BASE_URL = "https://api.minimax.io/anthropic";
|
|
1073
|
+
const MINIMAX_DEFAULT_MODEL_ID = "MiniMax-M2.1";
|
|
1074
|
+
const MINIMAX_DEFAULT_VISION_MODEL_ID = "MiniMax-VL-01";
|
|
1075
|
+
const MINIMAX_DEFAULT_CONTEXT_WINDOW = 2e5;
|
|
1076
|
+
const MINIMAX_DEFAULT_MAX_TOKENS = 8192;
|
|
1077
|
+
const MINIMAX_OAUTH_PLACEHOLDER = "minimax-oauth";
|
|
1078
|
+
const MINIMAX_API_COST = {
|
|
1079
|
+
input: 15,
|
|
1080
|
+
output: 60,
|
|
1081
|
+
cacheRead: 2,
|
|
1082
|
+
cacheWrite: 10
|
|
1083
|
+
};
|
|
1084
|
+
const XIAOMI_BASE_URL = "https://api.xiaomimimo.com/anthropic";
|
|
1085
|
+
const XIAOMI_DEFAULT_MODEL_ID = "mimo-v2-flash";
|
|
1086
|
+
const XIAOMI_DEFAULT_CONTEXT_WINDOW = 262144;
|
|
1087
|
+
const XIAOMI_DEFAULT_MAX_TOKENS = 8192;
|
|
1088
|
+
const XIAOMI_DEFAULT_COST = {
|
|
1089
|
+
input: 0,
|
|
1090
|
+
output: 0,
|
|
1091
|
+
cacheRead: 0,
|
|
1092
|
+
cacheWrite: 0
|
|
1093
|
+
};
|
|
1094
|
+
const MOONSHOT_BASE_URL = "https://api.moonshot.ai/v1";
|
|
1095
|
+
const MOONSHOT_DEFAULT_MODEL_ID = "kimi-k2.5";
|
|
1096
|
+
const MOONSHOT_DEFAULT_CONTEXT_WINDOW = 256e3;
|
|
1097
|
+
const MOONSHOT_DEFAULT_MAX_TOKENS = 8192;
|
|
1098
|
+
const MOONSHOT_DEFAULT_COST = {
|
|
1099
|
+
input: 0,
|
|
1100
|
+
output: 0,
|
|
1101
|
+
cacheRead: 0,
|
|
1102
|
+
cacheWrite: 0
|
|
1103
|
+
};
|
|
1104
|
+
const QWEN_PORTAL_BASE_URL = "https://portal.qwen.ai/v1";
|
|
1105
|
+
const QWEN_PORTAL_OAUTH_PLACEHOLDER = "qwen-oauth";
|
|
1106
|
+
const QWEN_PORTAL_DEFAULT_CONTEXT_WINDOW = 128e3;
|
|
1107
|
+
const QWEN_PORTAL_DEFAULT_MAX_TOKENS = 8192;
|
|
1108
|
+
const QWEN_PORTAL_DEFAULT_COST = {
|
|
1109
|
+
input: 0,
|
|
1110
|
+
output: 0,
|
|
1111
|
+
cacheRead: 0,
|
|
1112
|
+
cacheWrite: 0
|
|
1113
|
+
};
|
|
1114
|
+
const OLLAMA_BASE_URL = "http://127.0.0.1:11434/v1";
|
|
1115
|
+
const OLLAMA_API_BASE_URL = "http://127.0.0.1:11434";
|
|
1116
|
+
const OLLAMA_DEFAULT_CONTEXT_WINDOW = 128e3;
|
|
1117
|
+
const OLLAMA_DEFAULT_MAX_TOKENS = 8192;
|
|
1118
|
+
const OLLAMA_DEFAULT_COST = {
|
|
1119
|
+
input: 0,
|
|
1120
|
+
output: 0,
|
|
1121
|
+
cacheRead: 0,
|
|
1122
|
+
cacheWrite: 0
|
|
1123
|
+
};
|
|
1124
|
+
const QIANFAN_BASE_URL = "https://qianfan.baidubce.com/v2";
|
|
1125
|
+
const QIANFAN_DEFAULT_MODEL_ID = "deepseek-v3.2";
|
|
1126
|
+
const QIANFAN_DEFAULT_CONTEXT_WINDOW = 98304;
|
|
1127
|
+
const QIANFAN_DEFAULT_MAX_TOKENS = 32768;
|
|
1128
|
+
const QIANFAN_DEFAULT_COST = {
|
|
1129
|
+
input: 0,
|
|
1130
|
+
output: 0,
|
|
1131
|
+
cacheRead: 0,
|
|
1132
|
+
cacheWrite: 0
|
|
1133
|
+
};
|
|
1134
|
+
async function discoverOllamaModels() {
|
|
1135
|
+
if (process.env.VITEST || false) return [];
|
|
1136
|
+
try {
|
|
1137
|
+
const response = await fetch(`${OLLAMA_API_BASE_URL}/api/tags`, { signal: AbortSignal.timeout(5e3) });
|
|
1138
|
+
if (!response.ok) {
|
|
1139
|
+
console.warn(`Failed to discover Ollama models: ${response.status}`);
|
|
1140
|
+
return [];
|
|
1141
|
+
}
|
|
1142
|
+
const data = await response.json();
|
|
1143
|
+
if (!data.models || data.models.length === 0) {
|
|
1144
|
+
console.warn("No Ollama models found on local instance");
|
|
1145
|
+
return [];
|
|
1146
|
+
}
|
|
1147
|
+
return data.models.map((model) => {
|
|
1148
|
+
const modelId = model.name;
|
|
1149
|
+
return {
|
|
1150
|
+
id: modelId,
|
|
1151
|
+
name: modelId,
|
|
1152
|
+
reasoning: modelId.toLowerCase().includes("r1") || modelId.toLowerCase().includes("reasoning"),
|
|
1153
|
+
input: ["text"],
|
|
1154
|
+
cost: OLLAMA_DEFAULT_COST,
|
|
1155
|
+
contextWindow: OLLAMA_DEFAULT_CONTEXT_WINDOW,
|
|
1156
|
+
maxTokens: OLLAMA_DEFAULT_MAX_TOKENS,
|
|
1157
|
+
params: { streaming: false }
|
|
1158
|
+
};
|
|
1159
|
+
});
|
|
1160
|
+
} catch (error) {
|
|
1161
|
+
console.warn(`Failed to discover Ollama models: ${String(error)}`);
|
|
1162
|
+
return [];
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
function normalizeApiKeyConfig(value) {
|
|
1166
|
+
const trimmed = value.trim();
|
|
1167
|
+
return /^\$\{([A-Z0-9_]+)\}$/.exec(trimmed)?.[1] ?? trimmed;
|
|
1168
|
+
}
|
|
1169
|
+
function resolveEnvApiKeyVarName(provider) {
|
|
1170
|
+
const resolved = resolveEnvApiKey(provider);
|
|
1171
|
+
if (!resolved) return;
|
|
1172
|
+
const match = /^(?:env: |shell env: )([A-Z0-9_]+)$/.exec(resolved.source);
|
|
1173
|
+
return match ? match[1] : void 0;
|
|
1174
|
+
}
|
|
1175
|
+
function resolveAwsSdkApiKeyVarName() {
|
|
1176
|
+
return resolveAwsSdkEnvVarName() ?? "AWS_PROFILE";
|
|
1177
|
+
}
|
|
1178
|
+
function resolveApiKeyFromProfiles(params) {
|
|
1179
|
+
const ids = listProfilesForProvider(params.store, params.provider);
|
|
1180
|
+
for (const id of ids) {
|
|
1181
|
+
const cred = params.store.profiles[id];
|
|
1182
|
+
if (!cred) continue;
|
|
1183
|
+
if (cred.type === "api_key") return cred.key;
|
|
1184
|
+
if (cred.type === "token") return cred.token;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
function normalizeGoogleModelId(id) {
|
|
1188
|
+
if (id === "gemini-3-pro") return "gemini-3-pro-preview";
|
|
1189
|
+
if (id === "gemini-3-flash") return "gemini-3-flash-preview";
|
|
1190
|
+
return id;
|
|
1191
|
+
}
|
|
1192
|
+
function normalizeGoogleProvider(provider) {
|
|
1193
|
+
let mutated = false;
|
|
1194
|
+
const models = provider.models.map((model) => {
|
|
1195
|
+
const nextId = normalizeGoogleModelId(model.id);
|
|
1196
|
+
if (nextId === model.id) return model;
|
|
1197
|
+
mutated = true;
|
|
1198
|
+
return {
|
|
1199
|
+
...model,
|
|
1200
|
+
id: nextId
|
|
1201
|
+
};
|
|
1202
|
+
});
|
|
1203
|
+
return mutated ? {
|
|
1204
|
+
...provider,
|
|
1205
|
+
models
|
|
1206
|
+
} : provider;
|
|
1207
|
+
}
|
|
1208
|
+
function normalizeProviders(params) {
|
|
1209
|
+
const { providers } = params;
|
|
1210
|
+
if (!providers) return providers;
|
|
1211
|
+
const authStore = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
1212
|
+
let mutated = false;
|
|
1213
|
+
const next = {};
|
|
1214
|
+
for (const [key, provider] of Object.entries(providers)) {
|
|
1215
|
+
const normalizedKey = key.trim();
|
|
1216
|
+
let normalizedProvider = provider;
|
|
1217
|
+
if (normalizedProvider.apiKey && normalizeApiKeyConfig(normalizedProvider.apiKey) !== normalizedProvider.apiKey) {
|
|
1218
|
+
mutated = true;
|
|
1219
|
+
normalizedProvider = {
|
|
1220
|
+
...normalizedProvider,
|
|
1221
|
+
apiKey: normalizeApiKeyConfig(normalizedProvider.apiKey)
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
if (Array.isArray(normalizedProvider.models) && normalizedProvider.models.length > 0 && !normalizedProvider.apiKey?.trim()) if ((normalizedProvider.auth ?? (normalizedKey === "amazon-bedrock" ? "aws-sdk" : void 0)) === "aws-sdk") {
|
|
1225
|
+
const apiKey = resolveAwsSdkApiKeyVarName();
|
|
1226
|
+
mutated = true;
|
|
1227
|
+
normalizedProvider = {
|
|
1228
|
+
...normalizedProvider,
|
|
1229
|
+
apiKey
|
|
1230
|
+
};
|
|
1231
|
+
} else {
|
|
1232
|
+
const fromEnv = resolveEnvApiKeyVarName(normalizedKey);
|
|
1233
|
+
const fromProfiles = resolveApiKeyFromProfiles({
|
|
1234
|
+
provider: normalizedKey,
|
|
1235
|
+
store: authStore
|
|
1236
|
+
});
|
|
1237
|
+
const apiKey = fromEnv ?? fromProfiles;
|
|
1238
|
+
if (apiKey?.trim()) {
|
|
1239
|
+
mutated = true;
|
|
1240
|
+
normalizedProvider = {
|
|
1241
|
+
...normalizedProvider,
|
|
1242
|
+
apiKey
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
if (normalizedKey === "google") {
|
|
1247
|
+
const googleNormalized = normalizeGoogleProvider(normalizedProvider);
|
|
1248
|
+
if (googleNormalized !== normalizedProvider) mutated = true;
|
|
1249
|
+
normalizedProvider = googleNormalized;
|
|
1250
|
+
}
|
|
1251
|
+
next[key] = normalizedProvider;
|
|
1252
|
+
}
|
|
1253
|
+
return mutated ? next : providers;
|
|
1254
|
+
}
|
|
1255
|
+
function buildMinimaxProvider() {
|
|
1256
|
+
return {
|
|
1257
|
+
baseUrl: MINIMAX_API_BASE_URL,
|
|
1258
|
+
api: "openai-completions",
|
|
1259
|
+
models: [{
|
|
1260
|
+
id: MINIMAX_DEFAULT_MODEL_ID,
|
|
1261
|
+
name: "MiniMax M2.1",
|
|
1262
|
+
reasoning: false,
|
|
1263
|
+
input: ["text"],
|
|
1264
|
+
cost: MINIMAX_API_COST,
|
|
1265
|
+
contextWindow: MINIMAX_DEFAULT_CONTEXT_WINDOW,
|
|
1266
|
+
maxTokens: MINIMAX_DEFAULT_MAX_TOKENS
|
|
1267
|
+
}, {
|
|
1268
|
+
id: MINIMAX_DEFAULT_VISION_MODEL_ID,
|
|
1269
|
+
name: "MiniMax VL 01",
|
|
1270
|
+
reasoning: false,
|
|
1271
|
+
input: ["text", "image"],
|
|
1272
|
+
cost: MINIMAX_API_COST,
|
|
1273
|
+
contextWindow: MINIMAX_DEFAULT_CONTEXT_WINDOW,
|
|
1274
|
+
maxTokens: MINIMAX_DEFAULT_MAX_TOKENS
|
|
1275
|
+
}]
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
function buildMinimaxPortalProvider() {
|
|
1279
|
+
return {
|
|
1280
|
+
baseUrl: MINIMAX_PORTAL_BASE_URL,
|
|
1281
|
+
api: "anthropic-messages",
|
|
1282
|
+
models: [{
|
|
1283
|
+
id: MINIMAX_DEFAULT_MODEL_ID,
|
|
1284
|
+
name: "MiniMax M2.1",
|
|
1285
|
+
reasoning: false,
|
|
1286
|
+
input: ["text"],
|
|
1287
|
+
cost: MINIMAX_API_COST,
|
|
1288
|
+
contextWindow: MINIMAX_DEFAULT_CONTEXT_WINDOW,
|
|
1289
|
+
maxTokens: MINIMAX_DEFAULT_MAX_TOKENS
|
|
1290
|
+
}]
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
function buildMoonshotProvider() {
|
|
1294
|
+
return {
|
|
1295
|
+
baseUrl: MOONSHOT_BASE_URL,
|
|
1296
|
+
api: "openai-completions",
|
|
1297
|
+
models: [{
|
|
1298
|
+
id: MOONSHOT_DEFAULT_MODEL_ID,
|
|
1299
|
+
name: "Kimi K2.5",
|
|
1300
|
+
reasoning: false,
|
|
1301
|
+
input: ["text"],
|
|
1302
|
+
cost: MOONSHOT_DEFAULT_COST,
|
|
1303
|
+
contextWindow: MOONSHOT_DEFAULT_CONTEXT_WINDOW,
|
|
1304
|
+
maxTokens: MOONSHOT_DEFAULT_MAX_TOKENS
|
|
1305
|
+
}]
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
function buildQwenPortalProvider() {
|
|
1309
|
+
return {
|
|
1310
|
+
baseUrl: QWEN_PORTAL_BASE_URL,
|
|
1311
|
+
api: "openai-completions",
|
|
1312
|
+
models: [{
|
|
1313
|
+
id: "coder-model",
|
|
1314
|
+
name: "Qwen Coder",
|
|
1315
|
+
reasoning: false,
|
|
1316
|
+
input: ["text"],
|
|
1317
|
+
cost: QWEN_PORTAL_DEFAULT_COST,
|
|
1318
|
+
contextWindow: QWEN_PORTAL_DEFAULT_CONTEXT_WINDOW,
|
|
1319
|
+
maxTokens: QWEN_PORTAL_DEFAULT_MAX_TOKENS
|
|
1320
|
+
}, {
|
|
1321
|
+
id: "vision-model",
|
|
1322
|
+
name: "Qwen Vision",
|
|
1323
|
+
reasoning: false,
|
|
1324
|
+
input: ["text", "image"],
|
|
1325
|
+
cost: QWEN_PORTAL_DEFAULT_COST,
|
|
1326
|
+
contextWindow: QWEN_PORTAL_DEFAULT_CONTEXT_WINDOW,
|
|
1327
|
+
maxTokens: QWEN_PORTAL_DEFAULT_MAX_TOKENS
|
|
1328
|
+
}]
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
function buildSyntheticProvider() {
|
|
1332
|
+
return {
|
|
1333
|
+
baseUrl: SYNTHETIC_BASE_URL,
|
|
1334
|
+
api: "anthropic-messages",
|
|
1335
|
+
models: SYNTHETIC_MODEL_CATALOG.map(buildSyntheticModelDefinition)
|
|
1336
|
+
};
|
|
1337
|
+
}
|
|
1338
|
+
function buildXiaomiProvider() {
|
|
1339
|
+
return {
|
|
1340
|
+
baseUrl: XIAOMI_BASE_URL,
|
|
1341
|
+
api: "anthropic-messages",
|
|
1342
|
+
models: [{
|
|
1343
|
+
id: XIAOMI_DEFAULT_MODEL_ID,
|
|
1344
|
+
name: "Xiaomi MiMo V2 Flash",
|
|
1345
|
+
reasoning: false,
|
|
1346
|
+
input: ["text"],
|
|
1347
|
+
cost: XIAOMI_DEFAULT_COST,
|
|
1348
|
+
contextWindow: XIAOMI_DEFAULT_CONTEXT_WINDOW,
|
|
1349
|
+
maxTokens: XIAOMI_DEFAULT_MAX_TOKENS
|
|
1350
|
+
}]
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
async function buildVeniceProvider() {
|
|
1354
|
+
return {
|
|
1355
|
+
baseUrl: VENICE_BASE_URL,
|
|
1356
|
+
api: "openai-completions",
|
|
1357
|
+
models: await discoverVeniceModels()
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
async function buildOllamaProvider() {
|
|
1361
|
+
return {
|
|
1362
|
+
baseUrl: OLLAMA_BASE_URL,
|
|
1363
|
+
api: "openai-completions",
|
|
1364
|
+
models: await discoverOllamaModels()
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
function buildQianfanProvider() {
|
|
1368
|
+
return {
|
|
1369
|
+
baseUrl: QIANFAN_BASE_URL,
|
|
1370
|
+
api: "openai-completions",
|
|
1371
|
+
models: [{
|
|
1372
|
+
id: QIANFAN_DEFAULT_MODEL_ID,
|
|
1373
|
+
name: "DEEPSEEK V3.2",
|
|
1374
|
+
reasoning: true,
|
|
1375
|
+
input: ["text"],
|
|
1376
|
+
cost: QIANFAN_DEFAULT_COST,
|
|
1377
|
+
contextWindow: QIANFAN_DEFAULT_CONTEXT_WINDOW,
|
|
1378
|
+
maxTokens: QIANFAN_DEFAULT_MAX_TOKENS
|
|
1379
|
+
}, {
|
|
1380
|
+
id: "ernie-5.0-thinking-preview",
|
|
1381
|
+
name: "ERNIE-5.0-Thinking-Preview",
|
|
1382
|
+
reasoning: true,
|
|
1383
|
+
input: ["text", "image"],
|
|
1384
|
+
cost: QIANFAN_DEFAULT_COST,
|
|
1385
|
+
contextWindow: 119e3,
|
|
1386
|
+
maxTokens: 64e3
|
|
1387
|
+
}]
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
async function resolveImplicitProviders(params) {
|
|
1391
|
+
const providers = {};
|
|
1392
|
+
const authStore = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
1393
|
+
const minimaxKey = resolveEnvApiKeyVarName("minimax") ?? resolveApiKeyFromProfiles({
|
|
1394
|
+
provider: "minimax",
|
|
1395
|
+
store: authStore
|
|
1396
|
+
});
|
|
1397
|
+
if (minimaxKey) providers.minimax = {
|
|
1398
|
+
...buildMinimaxProvider(),
|
|
1399
|
+
apiKey: minimaxKey
|
|
1400
|
+
};
|
|
1401
|
+
if (listProfilesForProvider(authStore, "minimax-portal").length > 0) providers["minimax-portal"] = {
|
|
1402
|
+
...buildMinimaxPortalProvider(),
|
|
1403
|
+
apiKey: MINIMAX_OAUTH_PLACEHOLDER
|
|
1404
|
+
};
|
|
1405
|
+
const moonshotKey = resolveEnvApiKeyVarName("moonshot") ?? resolveApiKeyFromProfiles({
|
|
1406
|
+
provider: "moonshot",
|
|
1407
|
+
store: authStore
|
|
1408
|
+
});
|
|
1409
|
+
if (moonshotKey) providers.moonshot = {
|
|
1410
|
+
...buildMoonshotProvider(),
|
|
1411
|
+
apiKey: moonshotKey
|
|
1412
|
+
};
|
|
1413
|
+
const syntheticKey = resolveEnvApiKeyVarName("synthetic") ?? resolveApiKeyFromProfiles({
|
|
1414
|
+
provider: "synthetic",
|
|
1415
|
+
store: authStore
|
|
1416
|
+
});
|
|
1417
|
+
if (syntheticKey) providers.synthetic = {
|
|
1418
|
+
...buildSyntheticProvider(),
|
|
1419
|
+
apiKey: syntheticKey
|
|
1420
|
+
};
|
|
1421
|
+
const veniceKey = resolveEnvApiKeyVarName("venice") ?? resolveApiKeyFromProfiles({
|
|
1422
|
+
provider: "venice",
|
|
1423
|
+
store: authStore
|
|
1424
|
+
});
|
|
1425
|
+
if (veniceKey) providers.venice = {
|
|
1426
|
+
...await buildVeniceProvider(),
|
|
1427
|
+
apiKey: veniceKey
|
|
1428
|
+
};
|
|
1429
|
+
if (listProfilesForProvider(authStore, "qwen-portal").length > 0) providers["qwen-portal"] = {
|
|
1430
|
+
...buildQwenPortalProvider(),
|
|
1431
|
+
apiKey: QWEN_PORTAL_OAUTH_PLACEHOLDER
|
|
1432
|
+
};
|
|
1433
|
+
const xiaomiKey = resolveEnvApiKeyVarName("xiaomi") ?? resolveApiKeyFromProfiles({
|
|
1434
|
+
provider: "xiaomi",
|
|
1435
|
+
store: authStore
|
|
1436
|
+
});
|
|
1437
|
+
if (xiaomiKey) providers.xiaomi = {
|
|
1438
|
+
...buildXiaomiProvider(),
|
|
1439
|
+
apiKey: xiaomiKey
|
|
1440
|
+
};
|
|
1441
|
+
const cloudflareProfiles = listProfilesForProvider(authStore, "cloudflare-ai-gateway");
|
|
1442
|
+
for (const profileId of cloudflareProfiles) {
|
|
1443
|
+
const cred = authStore.profiles[profileId];
|
|
1444
|
+
if (cred?.type !== "api_key") continue;
|
|
1445
|
+
const accountId = cred.metadata?.accountId?.trim();
|
|
1446
|
+
const gatewayId = cred.metadata?.gatewayId?.trim();
|
|
1447
|
+
if (!accountId || !gatewayId) continue;
|
|
1448
|
+
const baseUrl = resolveCloudflareAiGatewayBaseUrl({
|
|
1449
|
+
accountId,
|
|
1450
|
+
gatewayId
|
|
1451
|
+
});
|
|
1452
|
+
if (!baseUrl) continue;
|
|
1453
|
+
const apiKey = resolveEnvApiKeyVarName("cloudflare-ai-gateway") ?? cred.key?.trim() ?? "";
|
|
1454
|
+
if (!apiKey) continue;
|
|
1455
|
+
providers["cloudflare-ai-gateway"] = {
|
|
1456
|
+
baseUrl,
|
|
1457
|
+
api: "anthropic-messages",
|
|
1458
|
+
apiKey,
|
|
1459
|
+
models: [buildCloudflareAiGatewayModelDefinition()]
|
|
1460
|
+
};
|
|
1461
|
+
break;
|
|
1462
|
+
}
|
|
1463
|
+
const ollamaKey = resolveEnvApiKeyVarName("ollama") ?? resolveApiKeyFromProfiles({
|
|
1464
|
+
provider: "ollama",
|
|
1465
|
+
store: authStore
|
|
1466
|
+
});
|
|
1467
|
+
if (ollamaKey) providers.ollama = {
|
|
1468
|
+
...await buildOllamaProvider(),
|
|
1469
|
+
apiKey: ollamaKey
|
|
1470
|
+
};
|
|
1471
|
+
const qianfanKey = resolveEnvApiKeyVarName("qianfan") ?? resolveApiKeyFromProfiles({
|
|
1472
|
+
provider: "qianfan",
|
|
1473
|
+
store: authStore
|
|
1474
|
+
});
|
|
1475
|
+
if (qianfanKey) providers.qianfan = {
|
|
1476
|
+
...buildQianfanProvider(),
|
|
1477
|
+
apiKey: qianfanKey
|
|
1478
|
+
};
|
|
1479
|
+
return providers;
|
|
1480
|
+
}
|
|
1481
|
+
async function resolveImplicitCopilotProvider(params) {
|
|
1482
|
+
const env = params.env ?? process.env;
|
|
1483
|
+
const authStore = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
1484
|
+
const hasProfile = listProfilesForProvider(authStore, "github-copilot").length > 0;
|
|
1485
|
+
const githubToken = (env.COPILOT_GITHUB_TOKEN ?? env.GH_TOKEN ?? env.GITHUB_TOKEN ?? "").trim();
|
|
1486
|
+
if (!hasProfile && !githubToken) return null;
|
|
1487
|
+
let selectedGithubToken = githubToken;
|
|
1488
|
+
if (!selectedGithubToken && hasProfile) {
|
|
1489
|
+
const profileId = listProfilesForProvider(authStore, "github-copilot")[0];
|
|
1490
|
+
const profile = profileId ? authStore.profiles[profileId] : void 0;
|
|
1491
|
+
if (profile && profile.type === "token") selectedGithubToken = profile.token;
|
|
1492
|
+
}
|
|
1493
|
+
let baseUrl = DEFAULT_COPILOT_API_BASE_URL;
|
|
1494
|
+
if (selectedGithubToken) try {
|
|
1495
|
+
baseUrl = (await resolveCopilotApiToken({
|
|
1496
|
+
githubToken: selectedGithubToken,
|
|
1497
|
+
env
|
|
1498
|
+
})).baseUrl;
|
|
1499
|
+
} catch {
|
|
1500
|
+
baseUrl = DEFAULT_COPILOT_API_BASE_URL;
|
|
1501
|
+
}
|
|
1502
|
+
return {
|
|
1503
|
+
baseUrl,
|
|
1504
|
+
models: []
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
async function resolveImplicitBedrockProvider(params) {
|
|
1508
|
+
const env = params.env ?? process.env;
|
|
1509
|
+
const discoveryConfig = params.config?.models?.bedrockDiscovery;
|
|
1510
|
+
const enabled = discoveryConfig?.enabled;
|
|
1511
|
+
const hasAwsCreds = resolveAwsSdkEnvVarName(env) !== void 0;
|
|
1512
|
+
if (enabled === false) return null;
|
|
1513
|
+
if (enabled !== true && !hasAwsCreds) return null;
|
|
1514
|
+
const region = discoveryConfig?.region ?? env.AWS_REGION ?? env.AWS_DEFAULT_REGION ?? "us-east-1";
|
|
1515
|
+
const models = await discoverBedrockModels({
|
|
1516
|
+
region,
|
|
1517
|
+
config: discoveryConfig
|
|
1518
|
+
});
|
|
1519
|
+
if (models.length === 0) return null;
|
|
1520
|
+
return {
|
|
1521
|
+
baseUrl: `https://bedrock-runtime.${region}.amazonaws.com`,
|
|
1522
|
+
api: "bedrock-converse-stream",
|
|
1523
|
+
auth: "aws-sdk",
|
|
1524
|
+
models
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
//#endregion
|
|
1529
|
+
//#region src/agents/model-selection.ts
|
|
1530
|
+
const ANTHROPIC_MODEL_ALIASES = {
|
|
1531
|
+
"opus-4.6": "claude-opus-4-6",
|
|
1532
|
+
"opus-4.5": "claude-opus-4-5",
|
|
1533
|
+
"sonnet-4.5": "claude-sonnet-4-5"
|
|
1534
|
+
};
|
|
1535
|
+
function normalizeAliasKey(value) {
|
|
1536
|
+
return value.trim().toLowerCase();
|
|
1537
|
+
}
|
|
1538
|
+
function modelKey(provider, model) {
|
|
1539
|
+
return `${provider}/${model}`;
|
|
1540
|
+
}
|
|
1541
|
+
function normalizeProviderId(provider) {
|
|
1542
|
+
const normalized = provider.trim().toLowerCase();
|
|
1543
|
+
if (normalized === "z.ai" || normalized === "z-ai") return "zai";
|
|
1544
|
+
if (normalized === "opencode-zen") return "opencode";
|
|
1545
|
+
if (normalized === "qwen") return "qwen-portal";
|
|
1546
|
+
if (normalized === "kimi-code") return "kimi-coding";
|
|
1547
|
+
return normalized;
|
|
1548
|
+
}
|
|
1549
|
+
function isCliProvider(provider, cfg) {
|
|
1550
|
+
const normalized = normalizeProviderId(provider);
|
|
1551
|
+
if (normalized === "claude-cli") return true;
|
|
1552
|
+
if (normalized === "codex-cli") return true;
|
|
1553
|
+
const backends = cfg?.agents?.defaults?.cliBackends ?? {};
|
|
1554
|
+
return Object.keys(backends).some((key) => normalizeProviderId(key) === normalized);
|
|
1555
|
+
}
|
|
1556
|
+
function normalizeAnthropicModelId(model) {
|
|
1557
|
+
const trimmed = model.trim();
|
|
1558
|
+
if (!trimmed) return trimmed;
|
|
1559
|
+
return ANTHROPIC_MODEL_ALIASES[trimmed.toLowerCase()] ?? trimmed;
|
|
1560
|
+
}
|
|
1561
|
+
function normalizeProviderModelId(provider, model) {
|
|
1562
|
+
if (provider === "anthropic") return normalizeAnthropicModelId(model);
|
|
1563
|
+
if (provider === "google") return normalizeGoogleModelId(model);
|
|
1564
|
+
return model;
|
|
1565
|
+
}
|
|
1566
|
+
function parseModelRef(raw, defaultProvider) {
|
|
1567
|
+
const trimmed = raw.trim();
|
|
1568
|
+
if (!trimmed) return null;
|
|
1569
|
+
const slash = trimmed.indexOf("/");
|
|
1570
|
+
if (slash === -1) {
|
|
1571
|
+
const provider = normalizeProviderId(defaultProvider);
|
|
1572
|
+
return {
|
|
1573
|
+
provider,
|
|
1574
|
+
model: normalizeProviderModelId(provider, trimmed)
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
const provider = normalizeProviderId(trimmed.slice(0, slash).trim());
|
|
1578
|
+
const model = trimmed.slice(slash + 1).trim();
|
|
1579
|
+
if (!provider || !model) return null;
|
|
1580
|
+
return {
|
|
1581
|
+
provider,
|
|
1582
|
+
model: normalizeProviderModelId(provider, model)
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
function resolveAllowlistModelKey(raw, defaultProvider) {
|
|
1586
|
+
const parsed = parseModelRef(raw, defaultProvider);
|
|
1587
|
+
if (!parsed) return null;
|
|
1588
|
+
return modelKey(parsed.provider, parsed.model);
|
|
1589
|
+
}
|
|
1590
|
+
function buildConfiguredAllowlistKeys(params) {
|
|
1591
|
+
const rawAllowlist = Object.keys(params.cfg?.agents?.defaults?.models ?? {});
|
|
1592
|
+
if (rawAllowlist.length === 0) return null;
|
|
1593
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1594
|
+
for (const raw of rawAllowlist) {
|
|
1595
|
+
const key = resolveAllowlistModelKey(String(raw ?? ""), params.defaultProvider);
|
|
1596
|
+
if (key) keys.add(key);
|
|
1597
|
+
}
|
|
1598
|
+
return keys.size > 0 ? keys : null;
|
|
1599
|
+
}
|
|
1600
|
+
function buildModelAliasIndex(params) {
|
|
1601
|
+
const byAlias = /* @__PURE__ */ new Map();
|
|
1602
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
1603
|
+
const rawModels = params.cfg.agents?.defaults?.models ?? {};
|
|
1604
|
+
for (const [keyRaw, entryRaw] of Object.entries(rawModels)) {
|
|
1605
|
+
const parsed = parseModelRef(String(keyRaw ?? ""), params.defaultProvider);
|
|
1606
|
+
if (!parsed) continue;
|
|
1607
|
+
const alias = String(entryRaw?.alias ?? "").trim();
|
|
1608
|
+
if (!alias) continue;
|
|
1609
|
+
const aliasKey = normalizeAliasKey(alias);
|
|
1610
|
+
byAlias.set(aliasKey, {
|
|
1611
|
+
alias,
|
|
1612
|
+
ref: parsed
|
|
1613
|
+
});
|
|
1614
|
+
const key = modelKey(parsed.provider, parsed.model);
|
|
1615
|
+
const existing = byKey.get(key) ?? [];
|
|
1616
|
+
existing.push(alias);
|
|
1617
|
+
byKey.set(key, existing);
|
|
1618
|
+
}
|
|
1619
|
+
return {
|
|
1620
|
+
byAlias,
|
|
1621
|
+
byKey
|
|
1622
|
+
};
|
|
1623
|
+
}
|
|
1624
|
+
function resolveModelRefFromString(params) {
|
|
1625
|
+
const trimmed = params.raw.trim();
|
|
1626
|
+
if (!trimmed) return null;
|
|
1627
|
+
if (!trimmed.includes("/")) {
|
|
1628
|
+
const aliasKey = normalizeAliasKey(trimmed);
|
|
1629
|
+
const aliasMatch = params.aliasIndex?.byAlias.get(aliasKey);
|
|
1630
|
+
if (aliasMatch) return {
|
|
1631
|
+
ref: aliasMatch.ref,
|
|
1632
|
+
alias: aliasMatch.alias
|
|
1633
|
+
};
|
|
1634
|
+
}
|
|
1635
|
+
const parsed = parseModelRef(trimmed, params.defaultProvider);
|
|
1636
|
+
if (!parsed) return null;
|
|
1637
|
+
return { ref: parsed };
|
|
1638
|
+
}
|
|
1639
|
+
function resolveConfiguredModelRef(params) {
|
|
1640
|
+
const rawModel = (() => {
|
|
1641
|
+
const raw = params.cfg.agents?.defaults?.model;
|
|
1642
|
+
if (typeof raw === "string") return raw.trim();
|
|
1643
|
+
return raw?.primary?.trim() ?? "";
|
|
1644
|
+
})();
|
|
1645
|
+
if (rawModel) {
|
|
1646
|
+
const trimmed = rawModel.trim();
|
|
1647
|
+
const aliasIndex = buildModelAliasIndex({
|
|
1648
|
+
cfg: params.cfg,
|
|
1649
|
+
defaultProvider: params.defaultProvider
|
|
1650
|
+
});
|
|
1651
|
+
if (!trimmed.includes("/")) {
|
|
1652
|
+
const aliasKey = normalizeAliasKey(trimmed);
|
|
1653
|
+
const aliasMatch = aliasIndex.byAlias.get(aliasKey);
|
|
1654
|
+
if (aliasMatch) return aliasMatch.ref;
|
|
1655
|
+
console.warn(`[openclaw] Model "${trimmed}" specified without provider. Falling back to "anthropic/${trimmed}". Please use "anthropic/${trimmed}" in your config.`);
|
|
1656
|
+
return {
|
|
1657
|
+
provider: "anthropic",
|
|
1658
|
+
model: trimmed
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
const resolved = resolveModelRefFromString({
|
|
1662
|
+
raw: trimmed,
|
|
1663
|
+
defaultProvider: params.defaultProvider,
|
|
1664
|
+
aliasIndex
|
|
1665
|
+
});
|
|
1666
|
+
if (resolved) return resolved.ref;
|
|
1667
|
+
}
|
|
1668
|
+
return {
|
|
1669
|
+
provider: params.defaultProvider,
|
|
1670
|
+
model: params.defaultModel
|
|
1671
|
+
};
|
|
1672
|
+
}
|
|
1673
|
+
function resolveDefaultModelForAgent(params) {
|
|
1674
|
+
const agentModelOverride = params.agentId ? resolveAgentModelPrimary(params.cfg, params.agentId) : void 0;
|
|
1675
|
+
return resolveConfiguredModelRef({
|
|
1676
|
+
cfg: agentModelOverride && agentModelOverride.length > 0 ? {
|
|
1677
|
+
...params.cfg,
|
|
1678
|
+
agents: {
|
|
1679
|
+
...params.cfg.agents,
|
|
1680
|
+
defaults: {
|
|
1681
|
+
...params.cfg.agents?.defaults,
|
|
1682
|
+
model: {
|
|
1683
|
+
...typeof params.cfg.agents?.defaults?.model === "object" ? params.cfg.agents.defaults.model : void 0,
|
|
1684
|
+
primary: agentModelOverride
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
} : params.cfg,
|
|
1689
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
1690
|
+
defaultModel: DEFAULT_MODEL
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
function buildAllowedModelSet(params) {
|
|
1694
|
+
const rawAllowlist = (() => {
|
|
1695
|
+
const modelMap = params.cfg.agents?.defaults?.models ?? {};
|
|
1696
|
+
return Object.keys(modelMap);
|
|
1697
|
+
})();
|
|
1698
|
+
const allowAny = rawAllowlist.length === 0;
|
|
1699
|
+
const defaultModel = params.defaultModel?.trim();
|
|
1700
|
+
const defaultKey = defaultModel && params.defaultProvider ? modelKey(params.defaultProvider, defaultModel) : void 0;
|
|
1701
|
+
const catalogKeys = new Set(params.catalog.map((entry) => modelKey(entry.provider, entry.id)));
|
|
1702
|
+
if (allowAny) {
|
|
1703
|
+
if (defaultKey) catalogKeys.add(defaultKey);
|
|
1704
|
+
return {
|
|
1705
|
+
allowAny: true,
|
|
1706
|
+
allowedCatalog: params.catalog,
|
|
1707
|
+
allowedKeys: catalogKeys
|
|
1708
|
+
};
|
|
1709
|
+
}
|
|
1710
|
+
const allowedKeys = /* @__PURE__ */ new Set();
|
|
1711
|
+
const configuredProviders = params.cfg.models?.providers ?? {};
|
|
1712
|
+
for (const raw of rawAllowlist) {
|
|
1713
|
+
const parsed = parseModelRef(String(raw), params.defaultProvider);
|
|
1714
|
+
if (!parsed) continue;
|
|
1715
|
+
const key = modelKey(parsed.provider, parsed.model);
|
|
1716
|
+
const providerKey = normalizeProviderId(parsed.provider);
|
|
1717
|
+
if (isCliProvider(parsed.provider, params.cfg)) allowedKeys.add(key);
|
|
1718
|
+
else if (catalogKeys.has(key)) allowedKeys.add(key);
|
|
1719
|
+
else if (configuredProviders[providerKey] != null) allowedKeys.add(key);
|
|
1720
|
+
}
|
|
1721
|
+
if (defaultKey) allowedKeys.add(defaultKey);
|
|
1722
|
+
const allowedCatalog = params.catalog.filter((entry) => allowedKeys.has(modelKey(entry.provider, entry.id)));
|
|
1723
|
+
if (allowedCatalog.length === 0 && allowedKeys.size === 0) {
|
|
1724
|
+
if (defaultKey) catalogKeys.add(defaultKey);
|
|
1725
|
+
return {
|
|
1726
|
+
allowAny: true,
|
|
1727
|
+
allowedCatalog: params.catalog,
|
|
1728
|
+
allowedKeys: catalogKeys
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
return {
|
|
1732
|
+
allowAny: false,
|
|
1733
|
+
allowedCatalog,
|
|
1734
|
+
allowedKeys
|
|
1735
|
+
};
|
|
1736
|
+
}
|
|
1737
|
+
function getModelRefStatus(params) {
|
|
1738
|
+
const allowed = buildAllowedModelSet({
|
|
1739
|
+
cfg: params.cfg,
|
|
1740
|
+
catalog: params.catalog,
|
|
1741
|
+
defaultProvider: params.defaultProvider,
|
|
1742
|
+
defaultModel: params.defaultModel
|
|
1743
|
+
});
|
|
1744
|
+
const key = modelKey(params.ref.provider, params.ref.model);
|
|
1745
|
+
return {
|
|
1746
|
+
key,
|
|
1747
|
+
inCatalog: params.catalog.some((entry) => modelKey(entry.provider, entry.id) === key),
|
|
1748
|
+
allowAny: allowed.allowAny,
|
|
1749
|
+
allowed: allowed.allowAny || allowed.allowedKeys.has(key)
|
|
1750
|
+
};
|
|
1751
|
+
}
|
|
1752
|
+
function resolveAllowedModelRef(params) {
|
|
1753
|
+
const trimmed = params.raw.trim();
|
|
1754
|
+
if (!trimmed) return { error: "invalid model: empty" };
|
|
1755
|
+
const aliasIndex = buildModelAliasIndex({
|
|
1756
|
+
cfg: params.cfg,
|
|
1757
|
+
defaultProvider: params.defaultProvider
|
|
1758
|
+
});
|
|
1759
|
+
const resolved = resolveModelRefFromString({
|
|
1760
|
+
raw: trimmed,
|
|
1761
|
+
defaultProvider: params.defaultProvider,
|
|
1762
|
+
aliasIndex
|
|
1763
|
+
});
|
|
1764
|
+
if (!resolved) return { error: `invalid model: ${trimmed}` };
|
|
1765
|
+
const status = getModelRefStatus({
|
|
1766
|
+
cfg: params.cfg,
|
|
1767
|
+
catalog: params.catalog,
|
|
1768
|
+
ref: resolved.ref,
|
|
1769
|
+
defaultProvider: params.defaultProvider,
|
|
1770
|
+
defaultModel: params.defaultModel
|
|
1771
|
+
});
|
|
1772
|
+
if (!status.allowed) return { error: `model not allowed: ${status.key}` };
|
|
1773
|
+
return {
|
|
1774
|
+
ref: resolved.ref,
|
|
1775
|
+
key: status.key
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
function resolveThinkingDefault(params) {
|
|
1779
|
+
const configured = params.cfg.agents?.defaults?.thinkingDefault;
|
|
1780
|
+
if (configured) return configured;
|
|
1781
|
+
if ((params.catalog?.find((entry) => entry.provider === params.provider && entry.id === params.model))?.reasoning) return "low";
|
|
1782
|
+
return "off";
|
|
1783
|
+
}
|
|
1784
|
+
/**
|
|
1785
|
+
* Resolve the model configured for Gmail hook processing.
|
|
1786
|
+
* Returns null if hooks.gmail.model is not set.
|
|
1787
|
+
*/
|
|
1788
|
+
function resolveHooksGmailModel(params) {
|
|
1789
|
+
const hooksModel = params.cfg.hooks?.gmail?.model;
|
|
1790
|
+
if (!hooksModel?.trim()) return null;
|
|
1791
|
+
const aliasIndex = buildModelAliasIndex({
|
|
1792
|
+
cfg: params.cfg,
|
|
1793
|
+
defaultProvider: params.defaultProvider
|
|
1794
|
+
});
|
|
1795
|
+
return resolveModelRefFromString({
|
|
1796
|
+
raw: hooksModel,
|
|
1797
|
+
defaultProvider: params.defaultProvider,
|
|
1798
|
+
aliasIndex
|
|
1799
|
+
})?.ref ?? null;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
//#endregion
|
|
1803
|
+
//#region src/agents/cli-credentials.ts
|
|
1804
|
+
const log = createSubsystemLogger("agents/auth-profiles");
|
|
1805
|
+
const QWEN_CLI_CREDENTIALS_RELATIVE_PATH = ".qwen/oauth_creds.json";
|
|
1806
|
+
const MINIMAX_CLI_CREDENTIALS_RELATIVE_PATH = ".minimax/oauth_creds.json";
|
|
1807
|
+
let qwenCliCache = null;
|
|
1808
|
+
let minimaxCliCache = null;
|
|
1809
|
+
function resolveQwenCliCredentialsPath(homeDir) {
|
|
1810
|
+
const baseDir = homeDir ?? resolveUserPath("~");
|
|
1811
|
+
return path.join(baseDir, QWEN_CLI_CREDENTIALS_RELATIVE_PATH);
|
|
1812
|
+
}
|
|
1813
|
+
function resolveMiniMaxCliCredentialsPath(homeDir) {
|
|
1814
|
+
const baseDir = homeDir ?? resolveUserPath("~");
|
|
1815
|
+
return path.join(baseDir, MINIMAX_CLI_CREDENTIALS_RELATIVE_PATH);
|
|
1816
|
+
}
|
|
1817
|
+
function readQwenCliCredentials(options) {
|
|
1818
|
+
const raw = loadJsonFile(resolveQwenCliCredentialsPath(options?.homeDir));
|
|
1819
|
+
if (!raw || typeof raw !== "object") return null;
|
|
1820
|
+
const data = raw;
|
|
1821
|
+
const accessToken = data.access_token;
|
|
1822
|
+
const refreshToken = data.refresh_token;
|
|
1823
|
+
const expiresAt = data.expiry_date;
|
|
1824
|
+
if (typeof accessToken !== "string" || !accessToken) return null;
|
|
1825
|
+
if (typeof refreshToken !== "string" || !refreshToken) return null;
|
|
1826
|
+
if (typeof expiresAt !== "number" || !Number.isFinite(expiresAt)) return null;
|
|
1827
|
+
return {
|
|
1828
|
+
type: "oauth",
|
|
1829
|
+
provider: "qwen-portal",
|
|
1830
|
+
access: accessToken,
|
|
1831
|
+
refresh: refreshToken,
|
|
1832
|
+
expires: expiresAt
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
function readMiniMaxCliCredentials(options) {
|
|
1836
|
+
const raw = loadJsonFile(resolveMiniMaxCliCredentialsPath(options?.homeDir));
|
|
1837
|
+
if (!raw || typeof raw !== "object") return null;
|
|
1838
|
+
const data = raw;
|
|
1839
|
+
const accessToken = data.access_token;
|
|
1840
|
+
const refreshToken = data.refresh_token;
|
|
1841
|
+
const expiresAt = data.expiry_date;
|
|
1842
|
+
if (typeof accessToken !== "string" || !accessToken) return null;
|
|
1843
|
+
if (typeof refreshToken !== "string" || !refreshToken) return null;
|
|
1844
|
+
if (typeof expiresAt !== "number" || !Number.isFinite(expiresAt)) return null;
|
|
1845
|
+
return {
|
|
1846
|
+
type: "oauth",
|
|
1847
|
+
provider: "minimax-portal",
|
|
1848
|
+
access: accessToken,
|
|
1849
|
+
refresh: refreshToken,
|
|
1850
|
+
expires: expiresAt
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
function readQwenCliCredentialsCached(options) {
|
|
1854
|
+
const ttlMs = options?.ttlMs ?? 0;
|
|
1855
|
+
const now = Date.now();
|
|
1856
|
+
const cacheKey = resolveQwenCliCredentialsPath(options?.homeDir);
|
|
1857
|
+
if (ttlMs > 0 && qwenCliCache && qwenCliCache.cacheKey === cacheKey && now - qwenCliCache.readAt < ttlMs) return qwenCliCache.value;
|
|
1858
|
+
const value = readQwenCliCredentials({ homeDir: options?.homeDir });
|
|
1859
|
+
if (ttlMs > 0) qwenCliCache = {
|
|
1860
|
+
value,
|
|
1861
|
+
readAt: now,
|
|
1862
|
+
cacheKey
|
|
1863
|
+
};
|
|
1864
|
+
return value;
|
|
1865
|
+
}
|
|
1866
|
+
function readMiniMaxCliCredentialsCached(options) {
|
|
1867
|
+
const ttlMs = options?.ttlMs ?? 0;
|
|
1868
|
+
const now = Date.now();
|
|
1869
|
+
const cacheKey = resolveMiniMaxCliCredentialsPath(options?.homeDir);
|
|
1870
|
+
if (ttlMs > 0 && minimaxCliCache && minimaxCliCache.cacheKey === cacheKey && now - minimaxCliCache.readAt < ttlMs) return minimaxCliCache.value;
|
|
1871
|
+
const value = readMiniMaxCliCredentials({ homeDir: options?.homeDir });
|
|
1872
|
+
if (ttlMs > 0) minimaxCliCache = {
|
|
1873
|
+
value,
|
|
1874
|
+
readAt: now,
|
|
1875
|
+
cacheKey
|
|
1876
|
+
};
|
|
1877
|
+
return value;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
//#endregion
|
|
1881
|
+
//#region src/agents/auth-profiles/external-cli-sync.ts
|
|
1882
|
+
function shallowEqualOAuthCredentials(a, b) {
|
|
1883
|
+
if (!a) return false;
|
|
1884
|
+
if (a.type !== "oauth") return false;
|
|
1885
|
+
return a.provider === b.provider && a.access === b.access && a.refresh === b.refresh && a.expires === b.expires && a.email === b.email && a.enterpriseUrl === b.enterpriseUrl && a.projectId === b.projectId && a.accountId === b.accountId;
|
|
1886
|
+
}
|
|
1887
|
+
function isExternalProfileFresh(cred, now) {
|
|
1888
|
+
if (!cred) return false;
|
|
1889
|
+
if (cred.type !== "oauth" && cred.type !== "token") return false;
|
|
1890
|
+
if (cred.provider !== "qwen-portal" && cred.provider !== "minimax-portal") return false;
|
|
1891
|
+
if (typeof cred.expires !== "number") return true;
|
|
1892
|
+
return cred.expires > now + EXTERNAL_CLI_NEAR_EXPIRY_MS;
|
|
1893
|
+
}
|
|
1894
|
+
/** Sync external CLI credentials into the store for a given provider. */
|
|
1895
|
+
function syncExternalCliCredentialsForProvider(store, profileId, provider, readCredentials, now) {
|
|
1896
|
+
const existing = store.profiles[profileId];
|
|
1897
|
+
const creds = !existing || existing.provider !== provider || !isExternalProfileFresh(existing, now) ? readCredentials() : null;
|
|
1898
|
+
if (!creds) return false;
|
|
1899
|
+
const existingOAuth = existing?.type === "oauth" ? existing : void 0;
|
|
1900
|
+
if ((!existingOAuth || existingOAuth.provider !== provider || existingOAuth.expires <= now || creds.expires > existingOAuth.expires) && !shallowEqualOAuthCredentials(existingOAuth, creds)) {
|
|
1901
|
+
store.profiles[profileId] = creds;
|
|
1902
|
+
log$1.info(`synced ${provider} credentials from external cli`, {
|
|
1903
|
+
profileId,
|
|
1904
|
+
expires: new Date(creds.expires).toISOString()
|
|
1905
|
+
});
|
|
1906
|
+
return true;
|
|
1907
|
+
}
|
|
1908
|
+
return false;
|
|
1909
|
+
}
|
|
1910
|
+
/**
|
|
1911
|
+
* Sync OAuth credentials from external CLI tools (Qwen Code CLI, MiniMax CLI) into the store.
|
|
1912
|
+
*
|
|
1913
|
+
* Returns true if any credentials were updated.
|
|
1914
|
+
*/
|
|
1915
|
+
function syncExternalCliCredentials(store) {
|
|
1916
|
+
let mutated = false;
|
|
1917
|
+
const now = Date.now();
|
|
1918
|
+
const existingQwen = store.profiles[QWEN_CLI_PROFILE_ID];
|
|
1919
|
+
const qwenCreds = !existingQwen || existingQwen.provider !== "qwen-portal" || !isExternalProfileFresh(existingQwen, now) ? readQwenCliCredentialsCached({ ttlMs: EXTERNAL_CLI_SYNC_TTL_MS }) : null;
|
|
1920
|
+
if (qwenCreds) {
|
|
1921
|
+
const existing = store.profiles[QWEN_CLI_PROFILE_ID];
|
|
1922
|
+
const existingOAuth = existing?.type === "oauth" ? existing : void 0;
|
|
1923
|
+
if ((!existingOAuth || existingOAuth.provider !== "qwen-portal" || existingOAuth.expires <= now || qwenCreds.expires > existingOAuth.expires) && !shallowEqualOAuthCredentials(existingOAuth, qwenCreds)) {
|
|
1924
|
+
store.profiles[QWEN_CLI_PROFILE_ID] = qwenCreds;
|
|
1925
|
+
mutated = true;
|
|
1926
|
+
log$1.info("synced qwen credentials from qwen cli", {
|
|
1927
|
+
profileId: QWEN_CLI_PROFILE_ID,
|
|
1928
|
+
expires: new Date(qwenCreds.expires).toISOString()
|
|
1929
|
+
});
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
if (syncExternalCliCredentialsForProvider(store, MINIMAX_CLI_PROFILE_ID, "minimax-portal", () => readMiniMaxCliCredentialsCached({ ttlMs: EXTERNAL_CLI_SYNC_TTL_MS }), now)) mutated = true;
|
|
1933
|
+
return mutated;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
//#endregion
|
|
1937
|
+
//#region src/agents/agent-paths.ts
|
|
1938
|
+
function resolveOpenClawAgentDir() {
|
|
1939
|
+
const override = process.env.OPENCLAW_AGENT_DIR?.trim() || process.env.PI_CODING_AGENT_DIR?.trim();
|
|
1940
|
+
if (override) return resolveUserPath(override);
|
|
1941
|
+
return resolveUserPath(path.join(resolveStateDir(), "agents", DEFAULT_AGENT_ID, "agent"));
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
//#endregion
|
|
1945
|
+
//#region src/agents/auth-profiles/paths.ts
|
|
1946
|
+
function resolveAuthStorePath(agentDir) {
|
|
1947
|
+
const resolved = resolveUserPath(agentDir ?? resolveOpenClawAgentDir());
|
|
1948
|
+
return path.join(resolved, AUTH_PROFILE_FILENAME);
|
|
1949
|
+
}
|
|
1950
|
+
function resolveLegacyAuthStorePath(agentDir) {
|
|
1951
|
+
const resolved = resolveUserPath(agentDir ?? resolveOpenClawAgentDir());
|
|
1952
|
+
return path.join(resolved, LEGACY_AUTH_FILENAME);
|
|
1953
|
+
}
|
|
1954
|
+
function resolveAuthStorePathForDisplay(agentDir) {
|
|
1955
|
+
const pathname = resolveAuthStorePath(agentDir);
|
|
1956
|
+
return pathname.startsWith("~") ? pathname : resolveUserPath(pathname);
|
|
1957
|
+
}
|
|
1958
|
+
function ensureAuthStoreFile(pathname) {
|
|
1959
|
+
if (fs.existsSync(pathname)) return;
|
|
1960
|
+
saveJsonFile(pathname, {
|
|
1961
|
+
version: AUTH_STORE_VERSION,
|
|
1962
|
+
profiles: {}
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
//#endregion
|
|
1967
|
+
//#region src/agents/auth-profiles/store.ts
|
|
1968
|
+
async function updateAuthProfileStoreWithLock(params) {
|
|
1969
|
+
const authPath = resolveAuthStorePath(params.agentDir);
|
|
1970
|
+
ensureAuthStoreFile(authPath);
|
|
1971
|
+
let release;
|
|
1972
|
+
try {
|
|
1973
|
+
release = await lockfile.lock(authPath, AUTH_STORE_LOCK_OPTIONS);
|
|
1974
|
+
const store = ensureAuthProfileStore(params.agentDir);
|
|
1975
|
+
if (params.updater(store)) saveAuthProfileStore(store, params.agentDir);
|
|
1976
|
+
return store;
|
|
1977
|
+
} catch {
|
|
1978
|
+
return null;
|
|
1979
|
+
} finally {
|
|
1980
|
+
if (release) try {
|
|
1981
|
+
await release();
|
|
1982
|
+
} catch {}
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
function coerceLegacyStore(raw) {
|
|
1986
|
+
if (!raw || typeof raw !== "object") return null;
|
|
1987
|
+
const record = raw;
|
|
1988
|
+
if ("profiles" in record) return null;
|
|
1989
|
+
const entries = {};
|
|
1990
|
+
for (const [key, value] of Object.entries(record)) {
|
|
1991
|
+
if (!value || typeof value !== "object") continue;
|
|
1992
|
+
const typed = value;
|
|
1993
|
+
if (typed.type !== "api_key" && typed.type !== "oauth" && typed.type !== "token") continue;
|
|
1994
|
+
entries[key] = {
|
|
1995
|
+
...typed,
|
|
1996
|
+
provider: String(typed.provider ?? key)
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
return Object.keys(entries).length > 0 ? entries : null;
|
|
2000
|
+
}
|
|
2001
|
+
function coerceAuthStore(raw) {
|
|
2002
|
+
if (!raw || typeof raw !== "object") return null;
|
|
2003
|
+
const record = raw;
|
|
2004
|
+
if (!record.profiles || typeof record.profiles !== "object") return null;
|
|
2005
|
+
const profiles = record.profiles;
|
|
2006
|
+
const normalized = {};
|
|
2007
|
+
for (const [key, value] of Object.entries(profiles)) {
|
|
2008
|
+
if (!value || typeof value !== "object") continue;
|
|
2009
|
+
const typed = value;
|
|
2010
|
+
if (typed.type !== "api_key" && typed.type !== "oauth" && typed.type !== "token") continue;
|
|
2011
|
+
if (!typed.provider) continue;
|
|
2012
|
+
normalized[key] = typed;
|
|
2013
|
+
}
|
|
2014
|
+
const order = record.order && typeof record.order === "object" ? Object.entries(record.order).reduce((acc, [provider, value]) => {
|
|
2015
|
+
if (!Array.isArray(value)) return acc;
|
|
2016
|
+
const list = value.map((entry) => typeof entry === "string" ? entry.trim() : "").filter(Boolean);
|
|
2017
|
+
if (list.length === 0) return acc;
|
|
2018
|
+
acc[provider] = list;
|
|
2019
|
+
return acc;
|
|
2020
|
+
}, {}) : void 0;
|
|
2021
|
+
return {
|
|
2022
|
+
version: Number(record.version ?? AUTH_STORE_VERSION),
|
|
2023
|
+
profiles: normalized,
|
|
2024
|
+
order,
|
|
2025
|
+
lastGood: record.lastGood && typeof record.lastGood === "object" ? record.lastGood : void 0,
|
|
2026
|
+
usageStats: record.usageStats && typeof record.usageStats === "object" ? record.usageStats : void 0
|
|
2027
|
+
};
|
|
2028
|
+
}
|
|
2029
|
+
function mergeRecord(base, override) {
|
|
2030
|
+
if (!base && !override) return;
|
|
2031
|
+
if (!base) return { ...override };
|
|
2032
|
+
if (!override) return { ...base };
|
|
2033
|
+
return {
|
|
2034
|
+
...base,
|
|
2035
|
+
...override
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
function mergeAuthProfileStores(base, override) {
|
|
2039
|
+
if (Object.keys(override.profiles).length === 0 && !override.order && !override.lastGood && !override.usageStats) return base;
|
|
2040
|
+
return {
|
|
2041
|
+
version: Math.max(base.version, override.version ?? base.version),
|
|
2042
|
+
profiles: {
|
|
2043
|
+
...base.profiles,
|
|
2044
|
+
...override.profiles
|
|
2045
|
+
},
|
|
2046
|
+
order: mergeRecord(base.order, override.order),
|
|
2047
|
+
lastGood: mergeRecord(base.lastGood, override.lastGood),
|
|
2048
|
+
usageStats: mergeRecord(base.usageStats, override.usageStats)
|
|
2049
|
+
};
|
|
2050
|
+
}
|
|
2051
|
+
function mergeOAuthFileIntoStore(store) {
|
|
2052
|
+
const oauthRaw = loadJsonFile(resolveOAuthPath());
|
|
2053
|
+
if (!oauthRaw || typeof oauthRaw !== "object") return false;
|
|
2054
|
+
const oauthEntries = oauthRaw;
|
|
2055
|
+
let mutated = false;
|
|
2056
|
+
for (const [provider, creds] of Object.entries(oauthEntries)) {
|
|
2057
|
+
if (!creds || typeof creds !== "object") continue;
|
|
2058
|
+
const profileId = `${provider}:default`;
|
|
2059
|
+
if (store.profiles[profileId]) continue;
|
|
2060
|
+
store.profiles[profileId] = {
|
|
2061
|
+
type: "oauth",
|
|
2062
|
+
provider,
|
|
2063
|
+
...creds
|
|
2064
|
+
};
|
|
2065
|
+
mutated = true;
|
|
2066
|
+
}
|
|
2067
|
+
return mutated;
|
|
2068
|
+
}
|
|
2069
|
+
function loadAuthProfileStore() {
|
|
2070
|
+
const authPath = resolveAuthStorePath();
|
|
2071
|
+
const asStore = coerceAuthStore(loadJsonFile(authPath));
|
|
2072
|
+
if (asStore) {
|
|
2073
|
+
if (syncExternalCliCredentials(asStore)) saveJsonFile(authPath, asStore);
|
|
2074
|
+
return asStore;
|
|
2075
|
+
}
|
|
2076
|
+
const legacy = coerceLegacyStore(loadJsonFile(resolveLegacyAuthStorePath()));
|
|
2077
|
+
if (legacy) {
|
|
2078
|
+
const store = {
|
|
2079
|
+
version: AUTH_STORE_VERSION,
|
|
2080
|
+
profiles: {}
|
|
2081
|
+
};
|
|
2082
|
+
for (const [provider, cred] of Object.entries(legacy)) {
|
|
2083
|
+
const profileId = `${provider}:default`;
|
|
2084
|
+
if (cred.type === "api_key") store.profiles[profileId] = {
|
|
2085
|
+
type: "api_key",
|
|
2086
|
+
provider: String(cred.provider ?? provider),
|
|
2087
|
+
key: cred.key,
|
|
2088
|
+
...cred.email ? { email: cred.email } : {}
|
|
2089
|
+
};
|
|
2090
|
+
else if (cred.type === "token") store.profiles[profileId] = {
|
|
2091
|
+
type: "token",
|
|
2092
|
+
provider: String(cred.provider ?? provider),
|
|
2093
|
+
token: cred.token,
|
|
2094
|
+
...typeof cred.expires === "number" ? { expires: cred.expires } : {},
|
|
2095
|
+
...cred.email ? { email: cred.email } : {}
|
|
2096
|
+
};
|
|
2097
|
+
else store.profiles[profileId] = {
|
|
2098
|
+
type: "oauth",
|
|
2099
|
+
provider: String(cred.provider ?? provider),
|
|
2100
|
+
access: cred.access,
|
|
2101
|
+
refresh: cred.refresh,
|
|
2102
|
+
expires: cred.expires,
|
|
2103
|
+
...cred.enterpriseUrl ? { enterpriseUrl: cred.enterpriseUrl } : {},
|
|
2104
|
+
...cred.projectId ? { projectId: cred.projectId } : {},
|
|
2105
|
+
...cred.accountId ? { accountId: cred.accountId } : {},
|
|
2106
|
+
...cred.email ? { email: cred.email } : {}
|
|
2107
|
+
};
|
|
2108
|
+
}
|
|
2109
|
+
syncExternalCliCredentials(store);
|
|
2110
|
+
return store;
|
|
2111
|
+
}
|
|
2112
|
+
const store = {
|
|
2113
|
+
version: AUTH_STORE_VERSION,
|
|
2114
|
+
profiles: {}
|
|
2115
|
+
};
|
|
2116
|
+
syncExternalCliCredentials(store);
|
|
2117
|
+
return store;
|
|
2118
|
+
}
|
|
2119
|
+
function loadAuthProfileStoreForAgent(agentDir, _options) {
|
|
2120
|
+
const authPath = resolveAuthStorePath(agentDir);
|
|
2121
|
+
const asStore = coerceAuthStore(loadJsonFile(authPath));
|
|
2122
|
+
if (asStore) {
|
|
2123
|
+
if (syncExternalCliCredentials(asStore)) saveJsonFile(authPath, asStore);
|
|
2124
|
+
return asStore;
|
|
2125
|
+
}
|
|
2126
|
+
if (agentDir) {
|
|
2127
|
+
const mainStore = coerceAuthStore(loadJsonFile(resolveAuthStorePath()));
|
|
2128
|
+
if (mainStore && Object.keys(mainStore.profiles).length > 0) {
|
|
2129
|
+
saveJsonFile(authPath, mainStore);
|
|
2130
|
+
log$1.info("inherited auth-profiles from main agent", { agentDir });
|
|
2131
|
+
return mainStore;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
const legacy = coerceLegacyStore(loadJsonFile(resolveLegacyAuthStorePath(agentDir)));
|
|
2135
|
+
const store = {
|
|
2136
|
+
version: AUTH_STORE_VERSION,
|
|
2137
|
+
profiles: {}
|
|
2138
|
+
};
|
|
2139
|
+
if (legacy) for (const [provider, cred] of Object.entries(legacy)) {
|
|
2140
|
+
const profileId = `${provider}:default`;
|
|
2141
|
+
if (cred.type === "api_key") store.profiles[profileId] = {
|
|
2142
|
+
type: "api_key",
|
|
2143
|
+
provider: String(cred.provider ?? provider),
|
|
2144
|
+
key: cred.key,
|
|
2145
|
+
...cred.email ? { email: cred.email } : {}
|
|
2146
|
+
};
|
|
2147
|
+
else if (cred.type === "token") store.profiles[profileId] = {
|
|
2148
|
+
type: "token",
|
|
2149
|
+
provider: String(cred.provider ?? provider),
|
|
2150
|
+
token: cred.token,
|
|
2151
|
+
...typeof cred.expires === "number" ? { expires: cred.expires } : {},
|
|
2152
|
+
...cred.email ? { email: cred.email } : {}
|
|
2153
|
+
};
|
|
2154
|
+
else store.profiles[profileId] = {
|
|
2155
|
+
type: "oauth",
|
|
2156
|
+
provider: String(cred.provider ?? provider),
|
|
2157
|
+
access: cred.access,
|
|
2158
|
+
refresh: cred.refresh,
|
|
2159
|
+
expires: cred.expires,
|
|
2160
|
+
...cred.enterpriseUrl ? { enterpriseUrl: cred.enterpriseUrl } : {},
|
|
2161
|
+
...cred.projectId ? { projectId: cred.projectId } : {},
|
|
2162
|
+
...cred.accountId ? { accountId: cred.accountId } : {},
|
|
2163
|
+
...cred.email ? { email: cred.email } : {}
|
|
2164
|
+
};
|
|
2165
|
+
}
|
|
2166
|
+
const mergedOAuth = mergeOAuthFileIntoStore(store);
|
|
2167
|
+
const syncedCli = syncExternalCliCredentials(store);
|
|
2168
|
+
const shouldWrite = legacy !== null || mergedOAuth || syncedCli;
|
|
2169
|
+
if (shouldWrite) saveJsonFile(authPath, store);
|
|
2170
|
+
if (shouldWrite && legacy !== null) {
|
|
2171
|
+
const legacyPath = resolveLegacyAuthStorePath(agentDir);
|
|
2172
|
+
try {
|
|
2173
|
+
fs.unlinkSync(legacyPath);
|
|
2174
|
+
} catch (err) {
|
|
2175
|
+
if (err?.code !== "ENOENT") log$1.warn("failed to delete legacy auth.json after migration", {
|
|
2176
|
+
err,
|
|
2177
|
+
legacyPath
|
|
2178
|
+
});
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
return store;
|
|
2182
|
+
}
|
|
2183
|
+
function ensureAuthProfileStore(agentDir, options) {
|
|
2184
|
+
const store = loadAuthProfileStoreForAgent(agentDir, options);
|
|
2185
|
+
const authPath = resolveAuthStorePath(agentDir);
|
|
2186
|
+
const mainAuthPath = resolveAuthStorePath();
|
|
2187
|
+
if (!agentDir || authPath === mainAuthPath) return store;
|
|
2188
|
+
return mergeAuthProfileStores(loadAuthProfileStoreForAgent(void 0, options), store);
|
|
2189
|
+
}
|
|
2190
|
+
function saveAuthProfileStore(store, agentDir) {
|
|
2191
|
+
saveJsonFile(resolveAuthStorePath(agentDir), {
|
|
2192
|
+
version: AUTH_STORE_VERSION,
|
|
2193
|
+
profiles: store.profiles,
|
|
2194
|
+
order: store.order ?? void 0,
|
|
2195
|
+
lastGood: store.lastGood ?? void 0,
|
|
2196
|
+
usageStats: store.usageStats ?? void 0
|
|
2197
|
+
});
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
//#endregion
|
|
2201
|
+
//#region src/agents/auth-profiles/profiles.ts
|
|
2202
|
+
async function setAuthProfileOrder(params) {
|
|
2203
|
+
const providerKey = normalizeProviderId(params.provider);
|
|
2204
|
+
const sanitized = params.order && Array.isArray(params.order) ? params.order.map((entry) => String(entry).trim()).filter(Boolean) : [];
|
|
2205
|
+
const deduped = [];
|
|
2206
|
+
for (const entry of sanitized) if (!deduped.includes(entry)) deduped.push(entry);
|
|
2207
|
+
return await updateAuthProfileStoreWithLock({
|
|
2208
|
+
agentDir: params.agentDir,
|
|
2209
|
+
updater: (store) => {
|
|
2210
|
+
store.order = store.order ?? {};
|
|
2211
|
+
if (deduped.length === 0) {
|
|
2212
|
+
if (!store.order[providerKey]) return false;
|
|
2213
|
+
delete store.order[providerKey];
|
|
2214
|
+
if (Object.keys(store.order).length === 0) store.order = void 0;
|
|
2215
|
+
return true;
|
|
2216
|
+
}
|
|
2217
|
+
store.order[providerKey] = deduped;
|
|
2218
|
+
return true;
|
|
2219
|
+
}
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
function upsertAuthProfile(params) {
|
|
2223
|
+
const store = ensureAuthProfileStore(params.agentDir);
|
|
2224
|
+
store.profiles[params.profileId] = params.credential;
|
|
2225
|
+
saveAuthProfileStore(store, params.agentDir);
|
|
2226
|
+
}
|
|
2227
|
+
function listProfilesForProvider(store, provider) {
|
|
2228
|
+
const providerKey = normalizeProviderId(provider);
|
|
2229
|
+
return Object.entries(store.profiles).filter(([, cred]) => normalizeProviderId(cred.provider) === providerKey).map(([id]) => id);
|
|
2230
|
+
}
|
|
2231
|
+
async function markAuthProfileGood(params) {
|
|
2232
|
+
const { store, provider, profileId, agentDir } = params;
|
|
2233
|
+
const updated = await updateAuthProfileStoreWithLock({
|
|
2234
|
+
agentDir,
|
|
2235
|
+
updater: (freshStore) => {
|
|
2236
|
+
const profile = freshStore.profiles[profileId];
|
|
2237
|
+
if (!profile || profile.provider !== provider) return false;
|
|
2238
|
+
freshStore.lastGood = {
|
|
2239
|
+
...freshStore.lastGood,
|
|
2240
|
+
[provider]: profileId
|
|
2241
|
+
};
|
|
2242
|
+
return true;
|
|
2243
|
+
}
|
|
2244
|
+
});
|
|
2245
|
+
if (updated) {
|
|
2246
|
+
store.lastGood = updated.lastGood;
|
|
2247
|
+
return;
|
|
2248
|
+
}
|
|
2249
|
+
const profile = store.profiles[profileId];
|
|
2250
|
+
if (!profile || profile.provider !== provider) return;
|
|
2251
|
+
store.lastGood = {
|
|
2252
|
+
...store.lastGood,
|
|
2253
|
+
[provider]: profileId
|
|
2254
|
+
};
|
|
2255
|
+
saveAuthProfileStore(store, agentDir);
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
//#endregion
|
|
2259
|
+
//#region src/agents/auth-profiles/repair.ts
|
|
2260
|
+
function getProfileSuffix(profileId) {
|
|
2261
|
+
const idx = profileId.indexOf(":");
|
|
2262
|
+
if (idx < 0) return "";
|
|
2263
|
+
return profileId.slice(idx + 1);
|
|
2264
|
+
}
|
|
2265
|
+
function isEmailLike(value) {
|
|
2266
|
+
const trimmed = value.trim();
|
|
2267
|
+
if (!trimmed) return false;
|
|
2268
|
+
return trimmed.includes("@") && trimmed.includes(".");
|
|
2269
|
+
}
|
|
2270
|
+
function suggestOAuthProfileIdForLegacyDefault(params) {
|
|
2271
|
+
const providerKey = normalizeProviderId(params.provider);
|
|
2272
|
+
if (getProfileSuffix(params.legacyProfileId) !== "default") return null;
|
|
2273
|
+
const legacyCfg = params.cfg?.auth?.profiles?.[params.legacyProfileId];
|
|
2274
|
+
if (legacyCfg && normalizeProviderId(legacyCfg.provider) === providerKey && legacyCfg.mode !== "oauth") return null;
|
|
2275
|
+
const oauthProfiles = listProfilesForProvider(params.store, providerKey).filter((id) => params.store.profiles[id]?.type === "oauth");
|
|
2276
|
+
if (oauthProfiles.length === 0) return null;
|
|
2277
|
+
const configuredEmail = legacyCfg?.email?.trim();
|
|
2278
|
+
if (configuredEmail) {
|
|
2279
|
+
const byEmail = oauthProfiles.find((id) => {
|
|
2280
|
+
const cred = params.store.profiles[id];
|
|
2281
|
+
if (!cred || cred.type !== "oauth") return false;
|
|
2282
|
+
return cred.email?.trim() === configuredEmail || id === `${providerKey}:${configuredEmail}`;
|
|
2283
|
+
});
|
|
2284
|
+
if (byEmail) return byEmail;
|
|
2285
|
+
}
|
|
2286
|
+
const lastGood = params.store.lastGood?.[providerKey] ?? params.store.lastGood?.[params.provider];
|
|
2287
|
+
if (lastGood && oauthProfiles.includes(lastGood)) return lastGood;
|
|
2288
|
+
const nonLegacy = oauthProfiles.filter((id) => id !== params.legacyProfileId);
|
|
2289
|
+
if (nonLegacy.length === 1) return nonLegacy[0] ?? null;
|
|
2290
|
+
const emailLike = nonLegacy.filter((id) => isEmailLike(getProfileSuffix(id)));
|
|
2291
|
+
if (emailLike.length === 1) return emailLike[0] ?? null;
|
|
2292
|
+
return null;
|
|
2293
|
+
}
|
|
2294
|
+
function repairOAuthProfileIdMismatch(params) {
|
|
2295
|
+
const legacyProfileId = params.legacyProfileId ?? `${normalizeProviderId(params.provider)}:default`;
|
|
2296
|
+
const legacyCfg = params.cfg.auth?.profiles?.[legacyProfileId];
|
|
2297
|
+
if (!legacyCfg) return {
|
|
2298
|
+
config: params.cfg,
|
|
2299
|
+
changes: [],
|
|
2300
|
+
migrated: false
|
|
2301
|
+
};
|
|
2302
|
+
if (legacyCfg.mode !== "oauth") return {
|
|
2303
|
+
config: params.cfg,
|
|
2304
|
+
changes: [],
|
|
2305
|
+
migrated: false
|
|
2306
|
+
};
|
|
2307
|
+
if (normalizeProviderId(legacyCfg.provider) !== normalizeProviderId(params.provider)) return {
|
|
2308
|
+
config: params.cfg,
|
|
2309
|
+
changes: [],
|
|
2310
|
+
migrated: false
|
|
2311
|
+
};
|
|
2312
|
+
const toProfileId = suggestOAuthProfileIdForLegacyDefault({
|
|
2313
|
+
cfg: params.cfg,
|
|
2314
|
+
store: params.store,
|
|
2315
|
+
provider: params.provider,
|
|
2316
|
+
legacyProfileId
|
|
2317
|
+
});
|
|
2318
|
+
if (!toProfileId || toProfileId === legacyProfileId) return {
|
|
2319
|
+
config: params.cfg,
|
|
2320
|
+
changes: [],
|
|
2321
|
+
migrated: false
|
|
2322
|
+
};
|
|
2323
|
+
const toCred = params.store.profiles[toProfileId];
|
|
2324
|
+
const toEmail = toCred?.type === "oauth" ? toCred.email?.trim() : void 0;
|
|
2325
|
+
const nextProfiles = { ...params.cfg.auth?.profiles };
|
|
2326
|
+
delete nextProfiles[legacyProfileId];
|
|
2327
|
+
nextProfiles[toProfileId] = {
|
|
2328
|
+
...legacyCfg,
|
|
2329
|
+
...toEmail ? { email: toEmail } : {}
|
|
2330
|
+
};
|
|
2331
|
+
const providerKey = normalizeProviderId(params.provider);
|
|
2332
|
+
const nextOrder = (() => {
|
|
2333
|
+
const order = params.cfg.auth?.order;
|
|
2334
|
+
if (!order) return;
|
|
2335
|
+
const resolvedKey = Object.keys(order).find((key) => normalizeProviderId(key) === providerKey);
|
|
2336
|
+
if (!resolvedKey) return order;
|
|
2337
|
+
const existing = order[resolvedKey];
|
|
2338
|
+
if (!Array.isArray(existing)) return order;
|
|
2339
|
+
const replaced = existing.map((id) => id === legacyProfileId ? toProfileId : id).filter((id) => typeof id === "string" && id.trim().length > 0);
|
|
2340
|
+
const deduped = [];
|
|
2341
|
+
for (const entry of replaced) if (!deduped.includes(entry)) deduped.push(entry);
|
|
2342
|
+
return {
|
|
2343
|
+
...order,
|
|
2344
|
+
[resolvedKey]: deduped
|
|
2345
|
+
};
|
|
2346
|
+
})();
|
|
2347
|
+
return {
|
|
2348
|
+
config: {
|
|
2349
|
+
...params.cfg,
|
|
2350
|
+
auth: {
|
|
2351
|
+
...params.cfg.auth,
|
|
2352
|
+
profiles: nextProfiles,
|
|
2353
|
+
...nextOrder ? { order: nextOrder } : {}
|
|
2354
|
+
}
|
|
2355
|
+
},
|
|
2356
|
+
changes: [`Auth: migrate ${legacyProfileId} → ${toProfileId} (OAuth profile id)`],
|
|
2357
|
+
migrated: true,
|
|
2358
|
+
fromProfileId: legacyProfileId,
|
|
2359
|
+
toProfileId
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2363
|
+
//#endregion
|
|
2364
|
+
//#region src/agents/auth-profiles/doctor.ts
|
|
2365
|
+
function formatAuthDoctorHint(params) {
|
|
2366
|
+
const providerKey = normalizeProviderId(params.provider);
|
|
2367
|
+
if (providerKey !== "anthropic") return "";
|
|
2368
|
+
const legacyProfileId = params.profileId ?? "anthropic:default";
|
|
2369
|
+
const suggested = suggestOAuthProfileIdForLegacyDefault({
|
|
2370
|
+
cfg: params.cfg,
|
|
2371
|
+
store: params.store,
|
|
2372
|
+
provider: providerKey,
|
|
2373
|
+
legacyProfileId
|
|
2374
|
+
});
|
|
2375
|
+
if (!suggested || suggested === legacyProfileId) return "";
|
|
2376
|
+
const storeOauthProfiles = listProfilesForProvider(params.store, providerKey).filter((id) => params.store.profiles[id]?.type === "oauth").join(", ");
|
|
2377
|
+
const cfgMode = params.cfg?.auth?.profiles?.[legacyProfileId]?.mode;
|
|
2378
|
+
const cfgProvider = params.cfg?.auth?.profiles?.[legacyProfileId]?.provider;
|
|
2379
|
+
return [
|
|
2380
|
+
"Doctor hint (for GitHub issue):",
|
|
2381
|
+
`- provider: ${providerKey}`,
|
|
2382
|
+
`- config: ${legacyProfileId}${cfgProvider || cfgMode ? ` (provider=${cfgProvider ?? "?"}, mode=${cfgMode ?? "?"})` : ""}`,
|
|
2383
|
+
`- auth store oauth profiles: ${storeOauthProfiles || "(none)"}`,
|
|
2384
|
+
`- suggested profile: ${suggested}`,
|
|
2385
|
+
`Fix: run "${formatCliCommand("openclaw doctor --yes")}"`
|
|
2386
|
+
].join("\n");
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
//#endregion
|
|
2390
|
+
//#region src/providers/qwen-portal-oauth.ts
|
|
2391
|
+
const QWEN_OAUTH_TOKEN_ENDPOINT = `https://chat.qwen.ai/api/v1/oauth2/token`;
|
|
2392
|
+
const QWEN_OAUTH_CLIENT_ID = "f0304373b74a44d2b584a3fb70ca9e56";
|
|
2393
|
+
async function refreshQwenPortalCredentials(credentials) {
|
|
2394
|
+
if (!credentials.refresh?.trim()) throw new Error("Qwen OAuth refresh token missing; re-authenticate.");
|
|
2395
|
+
const response = await fetch(QWEN_OAUTH_TOKEN_ENDPOINT, {
|
|
2396
|
+
method: "POST",
|
|
2397
|
+
headers: {
|
|
2398
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
2399
|
+
Accept: "application/json"
|
|
2400
|
+
},
|
|
2401
|
+
body: new URLSearchParams({
|
|
2402
|
+
grant_type: "refresh_token",
|
|
2403
|
+
refresh_token: credentials.refresh,
|
|
2404
|
+
client_id: QWEN_OAUTH_CLIENT_ID
|
|
2405
|
+
})
|
|
2406
|
+
});
|
|
2407
|
+
if (!response.ok) {
|
|
2408
|
+
const text = await response.text();
|
|
2409
|
+
if (response.status === 400) throw new Error(`Qwen OAuth refresh token expired or invalid. Re-authenticate with \`${formatCliCommand("openclaw models auth login --provider qwen-portal")}\`.`);
|
|
2410
|
+
throw new Error(`Qwen OAuth refresh failed: ${text || response.statusText}`);
|
|
2411
|
+
}
|
|
2412
|
+
const payload = await response.json();
|
|
2413
|
+
if (!payload.access_token || !payload.expires_in) throw new Error("Qwen OAuth refresh response missing access token.");
|
|
2414
|
+
return {
|
|
2415
|
+
...credentials,
|
|
2416
|
+
access: payload.access_token,
|
|
2417
|
+
refresh: payload.refresh_token || credentials.refresh,
|
|
2418
|
+
expires: Date.now() + payload.expires_in * 1e3
|
|
2419
|
+
};
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
//#endregion
|
|
2423
|
+
//#region src/agents/chutes-oauth.ts
|
|
2424
|
+
const CHUTES_OAUTH_ISSUER = "https://api.chutes.ai";
|
|
2425
|
+
const CHUTES_AUTHORIZE_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/authorize`;
|
|
2426
|
+
const CHUTES_TOKEN_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/token`;
|
|
2427
|
+
const CHUTES_USERINFO_ENDPOINT = `${CHUTES_OAUTH_ISSUER}/idp/userinfo`;
|
|
2428
|
+
const DEFAULT_EXPIRES_BUFFER_MS = 300 * 1e3;
|
|
2429
|
+
function generateChutesPkce() {
|
|
2430
|
+
const verifier = randomBytes(32).toString("hex");
|
|
2431
|
+
return {
|
|
2432
|
+
verifier,
|
|
2433
|
+
challenge: createHash("sha256").update(verifier).digest("base64url")
|
|
2434
|
+
};
|
|
2435
|
+
}
|
|
2436
|
+
function parseOAuthCallbackInput(input, expectedState) {
|
|
2437
|
+
const trimmed = input.trim();
|
|
2438
|
+
if (!trimmed) return { error: "No input provided" };
|
|
2439
|
+
try {
|
|
2440
|
+
const url = new URL(trimmed);
|
|
2441
|
+
const code = url.searchParams.get("code");
|
|
2442
|
+
const state = url.searchParams.get("state");
|
|
2443
|
+
if (!code) return { error: "Missing 'code' parameter in URL" };
|
|
2444
|
+
if (!state) return { error: "Missing 'state' parameter. Paste the full URL." };
|
|
2445
|
+
return {
|
|
2446
|
+
code,
|
|
2447
|
+
state
|
|
2448
|
+
};
|
|
2449
|
+
} catch {
|
|
2450
|
+
if (!expectedState) return { error: "Paste the full redirect URL, not just the code." };
|
|
2451
|
+
return {
|
|
2452
|
+
code: trimmed,
|
|
2453
|
+
state: expectedState
|
|
2454
|
+
};
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
function coerceExpiresAt(expiresInSeconds, now) {
|
|
2458
|
+
const value = now + Math.max(0, Math.floor(expiresInSeconds)) * 1e3 - DEFAULT_EXPIRES_BUFFER_MS;
|
|
2459
|
+
return Math.max(value, now + 3e4);
|
|
2460
|
+
}
|
|
2461
|
+
async function fetchChutesUserInfo(params) {
|
|
2462
|
+
const response = await (params.fetchFn ?? fetch)(CHUTES_USERINFO_ENDPOINT, { headers: { Authorization: `Bearer ${params.accessToken}` } });
|
|
2463
|
+
if (!response.ok) return null;
|
|
2464
|
+
const data = await response.json();
|
|
2465
|
+
if (!data || typeof data !== "object") return null;
|
|
2466
|
+
return data;
|
|
2467
|
+
}
|
|
2468
|
+
async function exchangeChutesCodeForTokens(params) {
|
|
2469
|
+
const fetchFn = params.fetchFn ?? fetch;
|
|
2470
|
+
const now = params.now ?? Date.now();
|
|
2471
|
+
const body = new URLSearchParams({
|
|
2472
|
+
grant_type: "authorization_code",
|
|
2473
|
+
client_id: params.app.clientId,
|
|
2474
|
+
code: params.code,
|
|
2475
|
+
redirect_uri: params.app.redirectUri,
|
|
2476
|
+
code_verifier: params.codeVerifier
|
|
2477
|
+
});
|
|
2478
|
+
if (params.app.clientSecret) body.set("client_secret", params.app.clientSecret);
|
|
2479
|
+
const response = await fetchFn(CHUTES_TOKEN_ENDPOINT, {
|
|
2480
|
+
method: "POST",
|
|
2481
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
2482
|
+
body
|
|
2483
|
+
});
|
|
2484
|
+
if (!response.ok) {
|
|
2485
|
+
const text = await response.text();
|
|
2486
|
+
throw new Error(`Chutes token exchange failed: ${text}`);
|
|
2487
|
+
}
|
|
2488
|
+
const data = await response.json();
|
|
2489
|
+
const access = data.access_token?.trim();
|
|
2490
|
+
const refresh = data.refresh_token?.trim();
|
|
2491
|
+
const expiresIn = data.expires_in ?? 0;
|
|
2492
|
+
if (!access) throw new Error("Chutes token exchange returned no access_token");
|
|
2493
|
+
if (!refresh) throw new Error("Chutes token exchange returned no refresh_token");
|
|
2494
|
+
const info = await fetchChutesUserInfo({
|
|
2495
|
+
accessToken: access,
|
|
2496
|
+
fetchFn
|
|
2497
|
+
});
|
|
2498
|
+
return {
|
|
2499
|
+
access,
|
|
2500
|
+
refresh,
|
|
2501
|
+
expires: coerceExpiresAt(expiresIn, now),
|
|
2502
|
+
email: info?.username,
|
|
2503
|
+
accountId: info?.sub,
|
|
2504
|
+
clientId: params.app.clientId
|
|
2505
|
+
};
|
|
2506
|
+
}
|
|
2507
|
+
async function refreshChutesTokens(params) {
|
|
2508
|
+
const fetchFn = params.fetchFn ?? fetch;
|
|
2509
|
+
const now = params.now ?? Date.now();
|
|
2510
|
+
const refreshToken = params.credential.refresh?.trim();
|
|
2511
|
+
if (!refreshToken) throw new Error("Chutes OAuth credential is missing refresh token");
|
|
2512
|
+
const clientId = params.credential.clientId?.trim() ?? process.env.CHUTES_CLIENT_ID?.trim();
|
|
2513
|
+
if (!clientId) throw new Error("Missing CHUTES_CLIENT_ID for Chutes OAuth refresh (set env var or re-auth).");
|
|
2514
|
+
const clientSecret = process.env.CHUTES_CLIENT_SECRET?.trim() || void 0;
|
|
2515
|
+
const body = new URLSearchParams({
|
|
2516
|
+
grant_type: "refresh_token",
|
|
2517
|
+
client_id: clientId,
|
|
2518
|
+
refresh_token: refreshToken
|
|
2519
|
+
});
|
|
2520
|
+
if (clientSecret) body.set("client_secret", clientSecret);
|
|
2521
|
+
const response = await fetchFn(CHUTES_TOKEN_ENDPOINT, {
|
|
2522
|
+
method: "POST",
|
|
2523
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
2524
|
+
body
|
|
2525
|
+
});
|
|
2526
|
+
if (!response.ok) {
|
|
2527
|
+
const text = await response.text();
|
|
2528
|
+
throw new Error(`Chutes token refresh failed: ${text}`);
|
|
2529
|
+
}
|
|
2530
|
+
const data = await response.json();
|
|
2531
|
+
const access = data.access_token?.trim();
|
|
2532
|
+
const newRefresh = data.refresh_token?.trim();
|
|
2533
|
+
const expiresIn = data.expires_in ?? 0;
|
|
2534
|
+
if (!access) throw new Error("Chutes token refresh returned no access_token");
|
|
2535
|
+
return {
|
|
2536
|
+
...params.credential,
|
|
2537
|
+
access,
|
|
2538
|
+
refresh: newRefresh || refreshToken,
|
|
2539
|
+
expires: coerceExpiresAt(expiresIn, now),
|
|
2540
|
+
clientId
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
//#endregion
|
|
2545
|
+
//#region src/agents/auth-profiles/oauth.ts
|
|
2546
|
+
const OAUTH_PROVIDER_IDS = new Set(getOAuthProviders().map((provider) => provider.id));
|
|
2547
|
+
const isOAuthProvider = (provider) => OAUTH_PROVIDER_IDS.has(provider);
|
|
2548
|
+
const resolveOAuthProvider = (provider) => isOAuthProvider(provider) ? provider : null;
|
|
2549
|
+
function buildOAuthApiKey(provider, credentials) {
|
|
2550
|
+
return provider === "google-gemini-cli" || provider === "google-antigravity" ? JSON.stringify({
|
|
2551
|
+
token: credentials.access,
|
|
2552
|
+
projectId: credentials.projectId
|
|
2553
|
+
}) : credentials.access;
|
|
2554
|
+
}
|
|
2555
|
+
async function refreshOAuthTokenWithLock(params) {
|
|
2556
|
+
const authPath = resolveAuthStorePath(params.agentDir);
|
|
2557
|
+
ensureAuthStoreFile(authPath);
|
|
2558
|
+
let release;
|
|
2559
|
+
try {
|
|
2560
|
+
release = await lockfile.lock(authPath, { ...AUTH_STORE_LOCK_OPTIONS });
|
|
2561
|
+
const store = ensureAuthProfileStore(params.agentDir);
|
|
2562
|
+
const cred = store.profiles[params.profileId];
|
|
2563
|
+
if (!cred || cred.type !== "oauth") return null;
|
|
2564
|
+
if (Date.now() < cred.expires) return {
|
|
2565
|
+
apiKey: buildOAuthApiKey(cred.provider, cred),
|
|
2566
|
+
newCredentials: cred
|
|
2567
|
+
};
|
|
2568
|
+
const oauthCreds = { [cred.provider]: cred };
|
|
2569
|
+
const result = String(cred.provider) === "chutes" ? await (async () => {
|
|
2570
|
+
const newCredentials = await refreshChutesTokens({ credential: cred });
|
|
2571
|
+
return {
|
|
2572
|
+
apiKey: newCredentials.access,
|
|
2573
|
+
newCredentials
|
|
2574
|
+
};
|
|
2575
|
+
})() : String(cred.provider) === "qwen-portal" ? await (async () => {
|
|
2576
|
+
const newCredentials = await refreshQwenPortalCredentials(cred);
|
|
2577
|
+
return {
|
|
2578
|
+
apiKey: newCredentials.access,
|
|
2579
|
+
newCredentials
|
|
2580
|
+
};
|
|
2581
|
+
})() : await (async () => {
|
|
2582
|
+
const oauthProvider = resolveOAuthProvider(cred.provider);
|
|
2583
|
+
if (!oauthProvider) return null;
|
|
2584
|
+
return await getOAuthApiKey(oauthProvider, oauthCreds);
|
|
2585
|
+
})();
|
|
2586
|
+
if (!result) return null;
|
|
2587
|
+
store.profiles[params.profileId] = {
|
|
2588
|
+
...cred,
|
|
2589
|
+
...result.newCredentials,
|
|
2590
|
+
type: "oauth"
|
|
2591
|
+
};
|
|
2592
|
+
saveAuthProfileStore(store, params.agentDir);
|
|
2593
|
+
return result;
|
|
2594
|
+
} finally {
|
|
2595
|
+
if (release) try {
|
|
2596
|
+
await release();
|
|
2597
|
+
} catch {}
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
async function tryResolveOAuthProfile(params) {
|
|
2601
|
+
const { cfg, store, profileId } = params;
|
|
2602
|
+
const cred = store.profiles[profileId];
|
|
2603
|
+
if (!cred || cred.type !== "oauth") return null;
|
|
2604
|
+
const profileConfig = cfg?.auth?.profiles?.[profileId];
|
|
2605
|
+
if (profileConfig && profileConfig.provider !== cred.provider) return null;
|
|
2606
|
+
if (profileConfig && profileConfig.mode !== cred.type) return null;
|
|
2607
|
+
if (Date.now() < cred.expires) return {
|
|
2608
|
+
apiKey: buildOAuthApiKey(cred.provider, cred),
|
|
2609
|
+
provider: cred.provider,
|
|
2610
|
+
email: cred.email
|
|
2611
|
+
};
|
|
2612
|
+
const refreshed = await refreshOAuthTokenWithLock({
|
|
2613
|
+
profileId,
|
|
2614
|
+
agentDir: params.agentDir
|
|
2615
|
+
});
|
|
2616
|
+
if (!refreshed) return null;
|
|
2617
|
+
return {
|
|
2618
|
+
apiKey: refreshed.apiKey,
|
|
2619
|
+
provider: cred.provider,
|
|
2620
|
+
email: cred.email
|
|
2621
|
+
};
|
|
2622
|
+
}
|
|
2623
|
+
async function resolveApiKeyForProfile(params) {
|
|
2624
|
+
const { cfg, store, profileId } = params;
|
|
2625
|
+
const cred = store.profiles[profileId];
|
|
2626
|
+
if (!cred) return null;
|
|
2627
|
+
const profileConfig = cfg?.auth?.profiles?.[profileId];
|
|
2628
|
+
if (profileConfig && profileConfig.provider !== cred.provider) return null;
|
|
2629
|
+
if (profileConfig && profileConfig.mode !== cred.type) {
|
|
2630
|
+
if (!(profileConfig.mode === "oauth" && cred.type === "token")) return null;
|
|
2631
|
+
}
|
|
2632
|
+
if (cred.type === "api_key") {
|
|
2633
|
+
const key = cred.key?.trim();
|
|
2634
|
+
if (!key) return null;
|
|
2635
|
+
return {
|
|
2636
|
+
apiKey: key,
|
|
2637
|
+
provider: cred.provider,
|
|
2638
|
+
email: cred.email
|
|
2639
|
+
};
|
|
2640
|
+
}
|
|
2641
|
+
if (cred.type === "token") {
|
|
2642
|
+
const token = cred.token?.trim();
|
|
2643
|
+
if (!token) return null;
|
|
2644
|
+
if (typeof cred.expires === "number" && Number.isFinite(cred.expires) && cred.expires > 0 && Date.now() >= cred.expires) return null;
|
|
2645
|
+
return {
|
|
2646
|
+
apiKey: token,
|
|
2647
|
+
provider: cred.provider,
|
|
2648
|
+
email: cred.email
|
|
2649
|
+
};
|
|
2650
|
+
}
|
|
2651
|
+
if (Date.now() < cred.expires) return {
|
|
2652
|
+
apiKey: buildOAuthApiKey(cred.provider, cred),
|
|
2653
|
+
provider: cred.provider,
|
|
2654
|
+
email: cred.email
|
|
2655
|
+
};
|
|
2656
|
+
try {
|
|
2657
|
+
const result = await refreshOAuthTokenWithLock({
|
|
2658
|
+
profileId,
|
|
2659
|
+
agentDir: params.agentDir
|
|
2660
|
+
});
|
|
2661
|
+
if (!result) return null;
|
|
2662
|
+
return {
|
|
2663
|
+
apiKey: result.apiKey,
|
|
2664
|
+
provider: cred.provider,
|
|
2665
|
+
email: cred.email
|
|
2666
|
+
};
|
|
2667
|
+
} catch (error) {
|
|
2668
|
+
const refreshedStore = ensureAuthProfileStore(params.agentDir);
|
|
2669
|
+
const refreshed = refreshedStore.profiles[profileId];
|
|
2670
|
+
if (refreshed?.type === "oauth" && Date.now() < refreshed.expires) return {
|
|
2671
|
+
apiKey: buildOAuthApiKey(refreshed.provider, refreshed),
|
|
2672
|
+
provider: refreshed.provider,
|
|
2673
|
+
email: refreshed.email ?? cred.email
|
|
2674
|
+
};
|
|
2675
|
+
const fallbackProfileId = suggestOAuthProfileIdForLegacyDefault({
|
|
2676
|
+
cfg,
|
|
2677
|
+
store: refreshedStore,
|
|
2678
|
+
provider: cred.provider,
|
|
2679
|
+
legacyProfileId: profileId
|
|
2680
|
+
});
|
|
2681
|
+
if (fallbackProfileId && fallbackProfileId !== profileId) try {
|
|
2682
|
+
const fallbackResolved = await tryResolveOAuthProfile({
|
|
2683
|
+
cfg,
|
|
2684
|
+
store: refreshedStore,
|
|
2685
|
+
profileId: fallbackProfileId,
|
|
2686
|
+
agentDir: params.agentDir
|
|
2687
|
+
});
|
|
2688
|
+
if (fallbackResolved) return fallbackResolved;
|
|
2689
|
+
} catch {}
|
|
2690
|
+
if (params.agentDir) try {
|
|
2691
|
+
const mainCred = ensureAuthProfileStore(void 0).profiles[profileId];
|
|
2692
|
+
if (mainCred?.type === "oauth" && Date.now() < mainCred.expires) {
|
|
2693
|
+
refreshedStore.profiles[profileId] = { ...mainCred };
|
|
2694
|
+
saveAuthProfileStore(refreshedStore, params.agentDir);
|
|
2695
|
+
log$1.info("inherited fresh OAuth credentials from main agent", {
|
|
2696
|
+
profileId,
|
|
2697
|
+
agentDir: params.agentDir,
|
|
2698
|
+
expires: new Date(mainCred.expires).toISOString()
|
|
2699
|
+
});
|
|
2700
|
+
return {
|
|
2701
|
+
apiKey: buildOAuthApiKey(mainCred.provider, mainCred),
|
|
2702
|
+
provider: mainCred.provider,
|
|
2703
|
+
email: mainCred.email
|
|
2704
|
+
};
|
|
2705
|
+
}
|
|
2706
|
+
} catch {}
|
|
2707
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2708
|
+
const hint = formatAuthDoctorHint({
|
|
2709
|
+
cfg,
|
|
2710
|
+
store: refreshedStore,
|
|
2711
|
+
provider: cred.provider,
|
|
2712
|
+
profileId
|
|
2713
|
+
});
|
|
2714
|
+
throw new Error(`OAuth token refresh failed for ${cred.provider}: ${message}. Please try again or re-authenticate.` + (hint ? `\n\n${hint}` : ""), { cause: error });
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
|
|
2718
|
+
//#endregion
|
|
2719
|
+
//#region src/agents/auth-profiles/usage.ts
|
|
2720
|
+
function resolveProfileUnusableUntil$1(stats) {
|
|
2721
|
+
const values = [stats.cooldownUntil, stats.disabledUntil].filter((value) => typeof value === "number").filter((value) => Number.isFinite(value) && value > 0);
|
|
2722
|
+
if (values.length === 0) return null;
|
|
2723
|
+
return Math.max(...values);
|
|
2724
|
+
}
|
|
2725
|
+
/**
|
|
2726
|
+
* Check if a profile is currently in cooldown (due to rate limiting or errors).
|
|
2727
|
+
*/
|
|
2728
|
+
function isProfileInCooldown(store, profileId) {
|
|
2729
|
+
const stats = store.usageStats?.[profileId];
|
|
2730
|
+
if (!stats) return false;
|
|
2731
|
+
const unusableUntil = resolveProfileUnusableUntil$1(stats);
|
|
2732
|
+
return unusableUntil ? Date.now() < unusableUntil : false;
|
|
2733
|
+
}
|
|
2734
|
+
/**
|
|
2735
|
+
* Mark a profile as successfully used. Resets error count and updates lastUsed.
|
|
2736
|
+
* Uses store lock to avoid overwriting concurrent usage updates.
|
|
2737
|
+
*/
|
|
2738
|
+
async function markAuthProfileUsed(params) {
|
|
2739
|
+
const { store, profileId, agentDir } = params;
|
|
2740
|
+
const updated = await updateAuthProfileStoreWithLock({
|
|
2741
|
+
agentDir,
|
|
2742
|
+
updater: (freshStore) => {
|
|
2743
|
+
if (!freshStore.profiles[profileId]) return false;
|
|
2744
|
+
freshStore.usageStats = freshStore.usageStats ?? {};
|
|
2745
|
+
freshStore.usageStats[profileId] = {
|
|
2746
|
+
...freshStore.usageStats[profileId],
|
|
2747
|
+
lastUsed: Date.now(),
|
|
2748
|
+
errorCount: 0,
|
|
2749
|
+
cooldownUntil: void 0,
|
|
2750
|
+
disabledUntil: void 0,
|
|
2751
|
+
disabledReason: void 0,
|
|
2752
|
+
failureCounts: void 0
|
|
2753
|
+
};
|
|
2754
|
+
return true;
|
|
2755
|
+
}
|
|
2756
|
+
});
|
|
2757
|
+
if (updated) {
|
|
2758
|
+
store.usageStats = updated.usageStats;
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2761
|
+
if (!store.profiles[profileId]) return;
|
|
2762
|
+
store.usageStats = store.usageStats ?? {};
|
|
2763
|
+
store.usageStats[profileId] = {
|
|
2764
|
+
...store.usageStats[profileId],
|
|
2765
|
+
lastUsed: Date.now(),
|
|
2766
|
+
errorCount: 0,
|
|
2767
|
+
cooldownUntil: void 0,
|
|
2768
|
+
disabledUntil: void 0,
|
|
2769
|
+
disabledReason: void 0,
|
|
2770
|
+
failureCounts: void 0
|
|
2771
|
+
};
|
|
2772
|
+
saveAuthProfileStore(store, agentDir);
|
|
2773
|
+
}
|
|
2774
|
+
function calculateAuthProfileCooldownMs(errorCount) {
|
|
2775
|
+
const normalized = Math.max(1, errorCount);
|
|
2776
|
+
return Math.min(3600 * 1e3, 60 * 1e3 * 5 ** Math.min(normalized - 1, 3));
|
|
2777
|
+
}
|
|
2778
|
+
function resolveAuthCooldownConfig(params) {
|
|
2779
|
+
const defaults = {
|
|
2780
|
+
billingBackoffHours: 5,
|
|
2781
|
+
billingMaxHours: 24,
|
|
2782
|
+
failureWindowHours: 24
|
|
2783
|
+
};
|
|
2784
|
+
const resolveHours = (value, fallback) => typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
2785
|
+
const cooldowns = params.cfg?.auth?.cooldowns;
|
|
2786
|
+
const billingBackoffHours = resolveHours((() => {
|
|
2787
|
+
const map = cooldowns?.billingBackoffHoursByProvider;
|
|
2788
|
+
if (!map) return;
|
|
2789
|
+
for (const [key, value] of Object.entries(map)) if (normalizeProviderId(key) === params.providerId) return value;
|
|
2790
|
+
})() ?? cooldowns?.billingBackoffHours, defaults.billingBackoffHours);
|
|
2791
|
+
const billingMaxHours = resolveHours(cooldowns?.billingMaxHours, defaults.billingMaxHours);
|
|
2792
|
+
const failureWindowHours = resolveHours(cooldowns?.failureWindowHours, defaults.failureWindowHours);
|
|
2793
|
+
return {
|
|
2794
|
+
billingBackoffMs: billingBackoffHours * 60 * 60 * 1e3,
|
|
2795
|
+
billingMaxMs: billingMaxHours * 60 * 60 * 1e3,
|
|
2796
|
+
failureWindowMs: failureWindowHours * 60 * 60 * 1e3
|
|
2797
|
+
};
|
|
2798
|
+
}
|
|
2799
|
+
function calculateAuthProfileBillingDisableMsWithConfig(params) {
|
|
2800
|
+
const normalized = Math.max(1, params.errorCount);
|
|
2801
|
+
const baseMs = Math.max(6e4, params.baseMs);
|
|
2802
|
+
const maxMs = Math.max(baseMs, params.maxMs);
|
|
2803
|
+
const raw = baseMs * 2 ** Math.min(normalized - 1, 10);
|
|
2804
|
+
return Math.min(maxMs, raw);
|
|
2805
|
+
}
|
|
2806
|
+
function resolveProfileUnusableUntilForDisplay(store, profileId) {
|
|
2807
|
+
const stats = store.usageStats?.[profileId];
|
|
2808
|
+
if (!stats) return null;
|
|
2809
|
+
return resolveProfileUnusableUntil$1(stats);
|
|
2810
|
+
}
|
|
2811
|
+
function computeNextProfileUsageStats(params) {
|
|
2812
|
+
const windowMs = params.cfgResolved.failureWindowMs;
|
|
2813
|
+
const windowExpired = typeof params.existing.lastFailureAt === "number" && params.existing.lastFailureAt > 0 && params.now - params.existing.lastFailureAt > windowMs;
|
|
2814
|
+
const nextErrorCount = (windowExpired ? 0 : params.existing.errorCount ?? 0) + 1;
|
|
2815
|
+
const failureCounts = windowExpired ? {} : { ...params.existing.failureCounts };
|
|
2816
|
+
failureCounts[params.reason] = (failureCounts[params.reason] ?? 0) + 1;
|
|
2817
|
+
const updatedStats = {
|
|
2818
|
+
...params.existing,
|
|
2819
|
+
errorCount: nextErrorCount,
|
|
2820
|
+
failureCounts,
|
|
2821
|
+
lastFailureAt: params.now
|
|
2822
|
+
};
|
|
2823
|
+
if (params.reason === "billing") {
|
|
2824
|
+
const backoffMs = calculateAuthProfileBillingDisableMsWithConfig({
|
|
2825
|
+
errorCount: failureCounts.billing ?? 1,
|
|
2826
|
+
baseMs: params.cfgResolved.billingBackoffMs,
|
|
2827
|
+
maxMs: params.cfgResolved.billingMaxMs
|
|
2828
|
+
});
|
|
2829
|
+
updatedStats.disabledUntil = params.now + backoffMs;
|
|
2830
|
+
updatedStats.disabledReason = "billing";
|
|
2831
|
+
} else {
|
|
2832
|
+
const backoffMs = calculateAuthProfileCooldownMs(nextErrorCount);
|
|
2833
|
+
updatedStats.cooldownUntil = params.now + backoffMs;
|
|
2834
|
+
}
|
|
2835
|
+
return updatedStats;
|
|
2836
|
+
}
|
|
2837
|
+
/**
|
|
2838
|
+
* Mark a profile as failed for a specific reason. Billing failures are treated
|
|
2839
|
+
* as "disabled" (longer backoff) vs the regular cooldown window.
|
|
2840
|
+
*/
|
|
2841
|
+
async function markAuthProfileFailure(params) {
|
|
2842
|
+
const { store, profileId, reason, agentDir, cfg } = params;
|
|
2843
|
+
const updated = await updateAuthProfileStoreWithLock({
|
|
2844
|
+
agentDir,
|
|
2845
|
+
updater: (freshStore) => {
|
|
2846
|
+
const profile = freshStore.profiles[profileId];
|
|
2847
|
+
if (!profile) return false;
|
|
2848
|
+
freshStore.usageStats = freshStore.usageStats ?? {};
|
|
2849
|
+
const existing = freshStore.usageStats[profileId] ?? {};
|
|
2850
|
+
const now = Date.now();
|
|
2851
|
+
const cfgResolved = resolveAuthCooldownConfig({
|
|
2852
|
+
cfg,
|
|
2853
|
+
providerId: normalizeProviderId(profile.provider)
|
|
2854
|
+
});
|
|
2855
|
+
freshStore.usageStats[profileId] = computeNextProfileUsageStats({
|
|
2856
|
+
existing,
|
|
2857
|
+
now,
|
|
2858
|
+
reason,
|
|
2859
|
+
cfgResolved
|
|
2860
|
+
});
|
|
2861
|
+
return true;
|
|
2862
|
+
}
|
|
2863
|
+
});
|
|
2864
|
+
if (updated) {
|
|
2865
|
+
store.usageStats = updated.usageStats;
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
if (!store.profiles[profileId]) return;
|
|
2869
|
+
store.usageStats = store.usageStats ?? {};
|
|
2870
|
+
const existing = store.usageStats[profileId] ?? {};
|
|
2871
|
+
const now = Date.now();
|
|
2872
|
+
const cfgResolved = resolveAuthCooldownConfig({
|
|
2873
|
+
cfg,
|
|
2874
|
+
providerId: normalizeProviderId(store.profiles[profileId]?.provider ?? "")
|
|
2875
|
+
});
|
|
2876
|
+
store.usageStats[profileId] = computeNextProfileUsageStats({
|
|
2877
|
+
existing,
|
|
2878
|
+
now,
|
|
2879
|
+
reason,
|
|
2880
|
+
cfgResolved
|
|
2881
|
+
});
|
|
2882
|
+
saveAuthProfileStore(store, agentDir);
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
//#endregion
|
|
2886
|
+
//#region src/agents/auth-profiles/order.ts
|
|
2887
|
+
function resolveProfileUnusableUntil(stats) {
|
|
2888
|
+
const values = [stats.cooldownUntil, stats.disabledUntil].filter((value) => typeof value === "number").filter((value) => Number.isFinite(value) && value > 0);
|
|
2889
|
+
if (values.length === 0) return null;
|
|
2890
|
+
return Math.max(...values);
|
|
2891
|
+
}
|
|
2892
|
+
function resolveAuthProfileOrder(params) {
|
|
2893
|
+
const { cfg, store, provider, preferredProfile } = params;
|
|
2894
|
+
const providerKey = normalizeProviderId(provider);
|
|
2895
|
+
const now = Date.now();
|
|
2896
|
+
const storedOrder = (() => {
|
|
2897
|
+
const order = store.order;
|
|
2898
|
+
if (!order) return;
|
|
2899
|
+
for (const [key, value] of Object.entries(order)) if (normalizeProviderId(key) === providerKey) return value;
|
|
2900
|
+
})();
|
|
2901
|
+
const configuredOrder = (() => {
|
|
2902
|
+
const order = cfg?.auth?.order;
|
|
2903
|
+
if (!order) return;
|
|
2904
|
+
for (const [key, value] of Object.entries(order)) if (normalizeProviderId(key) === providerKey) return value;
|
|
2905
|
+
})();
|
|
2906
|
+
const explicitOrder = storedOrder ?? configuredOrder;
|
|
2907
|
+
const explicitProfiles = cfg?.auth?.profiles ? Object.entries(cfg.auth.profiles).filter(([, profile]) => normalizeProviderId(profile.provider) === providerKey).map(([profileId]) => profileId) : [];
|
|
2908
|
+
const baseOrder = explicitOrder ?? (explicitProfiles.length > 0 ? explicitProfiles : listProfilesForProvider(store, providerKey));
|
|
2909
|
+
if (baseOrder.length === 0) return [];
|
|
2910
|
+
const filtered = baseOrder.filter((profileId) => {
|
|
2911
|
+
const cred = store.profiles[profileId];
|
|
2912
|
+
if (!cred) return false;
|
|
2913
|
+
if (normalizeProviderId(cred.provider) !== providerKey) return false;
|
|
2914
|
+
const profileConfig = cfg?.auth?.profiles?.[profileId];
|
|
2915
|
+
if (profileConfig) {
|
|
2916
|
+
if (normalizeProviderId(profileConfig.provider) !== providerKey) return false;
|
|
2917
|
+
if (profileConfig.mode !== cred.type) {
|
|
2918
|
+
if (!(profileConfig.mode === "oauth" && cred.type === "token")) return false;
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
if (cred.type === "api_key") return Boolean(cred.key?.trim());
|
|
2922
|
+
if (cred.type === "token") {
|
|
2923
|
+
if (!cred.token?.trim()) return false;
|
|
2924
|
+
if (typeof cred.expires === "number" && Number.isFinite(cred.expires) && cred.expires > 0 && now >= cred.expires) return false;
|
|
2925
|
+
return true;
|
|
2926
|
+
}
|
|
2927
|
+
if (cred.type === "oauth") return Boolean(cred.access?.trim() || cred.refresh?.trim());
|
|
2928
|
+
return false;
|
|
2929
|
+
});
|
|
2930
|
+
const deduped = [];
|
|
2931
|
+
for (const entry of filtered) if (!deduped.includes(entry)) deduped.push(entry);
|
|
2932
|
+
if (explicitOrder && explicitOrder.length > 0) {
|
|
2933
|
+
const available = [];
|
|
2934
|
+
const inCooldown = [];
|
|
2935
|
+
for (const profileId of deduped) {
|
|
2936
|
+
const cooldownUntil = resolveProfileUnusableUntil(store.usageStats?.[profileId] ?? {}) ?? 0;
|
|
2937
|
+
if (typeof cooldownUntil === "number" && Number.isFinite(cooldownUntil) && cooldownUntil > 0 && now < cooldownUntil) inCooldown.push({
|
|
2938
|
+
profileId,
|
|
2939
|
+
cooldownUntil
|
|
2940
|
+
});
|
|
2941
|
+
else available.push(profileId);
|
|
2942
|
+
}
|
|
2943
|
+
const cooldownSorted = inCooldown.toSorted((a, b) => a.cooldownUntil - b.cooldownUntil).map((entry) => entry.profileId);
|
|
2944
|
+
const ordered = [...available, ...cooldownSorted];
|
|
2945
|
+
if (preferredProfile && ordered.includes(preferredProfile)) return [preferredProfile, ...ordered.filter((e) => e !== preferredProfile)];
|
|
2946
|
+
return ordered;
|
|
2947
|
+
}
|
|
2948
|
+
const sorted = orderProfilesByMode(deduped, store);
|
|
2949
|
+
if (preferredProfile && sorted.includes(preferredProfile)) return [preferredProfile, ...sorted.filter((e) => e !== preferredProfile)];
|
|
2950
|
+
return sorted;
|
|
2951
|
+
}
|
|
2952
|
+
function orderProfilesByMode(order, store) {
|
|
2953
|
+
const now = Date.now();
|
|
2954
|
+
const available = [];
|
|
2955
|
+
const inCooldown = [];
|
|
2956
|
+
for (const profileId of order) if (isProfileInCooldown(store, profileId)) inCooldown.push(profileId);
|
|
2957
|
+
else available.push(profileId);
|
|
2958
|
+
const sorted = available.map((profileId) => {
|
|
2959
|
+
const type = store.profiles[profileId]?.type;
|
|
2960
|
+
return {
|
|
2961
|
+
profileId,
|
|
2962
|
+
typeScore: type === "oauth" ? 0 : type === "token" ? 1 : type === "api_key" ? 2 : 3,
|
|
2963
|
+
lastUsed: store.usageStats?.[profileId]?.lastUsed ?? 0
|
|
2964
|
+
};
|
|
2965
|
+
}).toSorted((a, b) => {
|
|
2966
|
+
if (a.typeScore !== b.typeScore) return a.typeScore - b.typeScore;
|
|
2967
|
+
return a.lastUsed - b.lastUsed;
|
|
2968
|
+
}).map((entry) => entry.profileId);
|
|
2969
|
+
const cooldownSorted = inCooldown.map((profileId) => ({
|
|
2970
|
+
profileId,
|
|
2971
|
+
cooldownUntil: resolveProfileUnusableUntil(store.usageStats?.[profileId] ?? {}) ?? now
|
|
2972
|
+
})).toSorted((a, b) => a.cooldownUntil - b.cooldownUntil).map((entry) => entry.profileId);
|
|
2973
|
+
return [...sorted, ...cooldownSorted];
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
//#endregion
|
|
2977
|
+
//#region src/agents/auth-profiles.ts
|
|
2978
|
+
var auth_profiles_exports = /* @__PURE__ */ __exportAll({ ensureAuthProfileStore: () => ensureAuthProfileStore });
|
|
2979
|
+
|
|
2980
|
+
//#endregion
|
|
2981
|
+
export { SYNTHETIC_DEFAULT_MODEL_REF as $, parseModelRef as A, XIAOMI_DEFAULT_MODEL_ID as B, buildAllowedModelSet as C, CODEX_CLI_PROFILE_ID as Ct, isCliProvider as D, getModelRefStatus as E, resolveHooksGmailModel as F, resolveImplicitBedrockProvider as G, buildXiaomiProvider as H, resolveModelRefFromString as I, VENICE_BASE_URL as J, resolveImplicitCopilotProvider as K, resolveThinkingDefault as L, resolveAllowlistModelKey as M, resolveConfiguredModelRef as N, modelKey as O, resolveDefaultModelForAgent as P, SYNTHETIC_BASE_URL as Q, QIANFAN_BASE_URL as R, resolveOpenClawAgentDir as S, CLAUDE_CLI_PROFILE_ID as St, buildModelAliasIndex as T, normalizeGoogleModelId as U, buildQianfanProvider as V, normalizeProviders as W, VENICE_MODEL_CATALOG as X, VENICE_DEFAULT_MODEL_REF as Y, buildVeniceModelDefinition as Z, ensureAuthProfileStore as _, resolveCloudflareAiGatewayBaseUrl as _t, markAuthProfileUsed as a, resolveApiKeyForProvider as at, resolveAuthStorePath as b, DEFAULT_PROVIDER as bt, CHUTES_AUTHORIZE_ENDPOINT as c, resolveModelAuthMode as ct, parseOAuthCallbackInput as d, loadShellEnvFallback as dt, SYNTHETIC_MODEL_CATALOG as et, repairOAuthProfileIdMismatch as f, resolveShellEnvFallbackTimeoutMs as ft, upsertAuthProfile as g, buildCloudflareAiGatewayModelDefinition as gt, setAuthProfileOrder as h, CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_REF as ht, markAuthProfileFailure as i, requireApiKey as it, resolveAllowedModelRef as j, normalizeProviderId as k, exchangeChutesCodeForTokens as l, getShellEnvAppliedKeys as lt, markAuthProfileGood as m, shouldEnableShellEnvFallback as mt, resolveAuthProfileOrder as n, getApiKeyForModel as nt, resolveProfileUnusableUntilForDisplay as o, resolveAwsSdkEnvVarName as ot, listProfilesForProvider as p, shouldDeferShellEnvFallback as pt, resolveImplicitProviders as q, isProfileInCooldown as r, getCustomProviderApiKey as rt, resolveApiKeyForProfile as s, resolveEnvApiKey as st, auth_profiles_exports as t, buildSyntheticModelDefinition as tt, generateChutesPkce as u, getShellPathFromLoginShell as ut, loadAuthProfileStore as v, DEFAULT_CONTEXT_TOKENS as vt, buildConfiguredAllowlistKeys as w, resolveAuthStorePathForDisplay as x, resolveAuthProfileDisplayLabel as xt, updateAuthProfileStoreWithLock as y, DEFAULT_MODEL as yt, QIANFAN_DEFAULT_MODEL_ID as z };
|