@noxsoft/anima 2.0.0
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 +2065 -0
- package/LICENSE +23 -0
- package/README.md +47 -0
- package/anima.mjs +56 -0
- package/dist/accounts-Cc5E4IDO.js +260 -0
- package/dist/accounts-CcVrwKqv.js +259 -0
- package/dist/acp-cli-BbvR4dNz.js +1081 -0
- package/dist/acp-cli-CePIi7gD.js +1084 -0
- package/dist/agent-CSrGrAg1.js +725 -0
- package/dist/agent-NgeWEcBM.js +725 -0
- package/dist/agent-events-UF0DxwKS.js +182 -0
- package/dist/agent-scope-BVf4aSwY.js +112 -0
- package/dist/agent-scope-OZi7lb8S.js +452 -0
- package/dist/agent-scope-V1bi9OYL.js +452 -0
- package/dist/agents-Bw06WthM.js +809 -0
- package/dist/agents.config-Dvo2ULxs.js +182 -0
- package/dist/agents.config-d6H0_3oj.js +182 -0
- package/dist/argv-DqUHKf0o.js +73 -0
- package/dist/audit-Buja3mbS.js +2401 -0
- package/dist/audit-CWIz6mM7.js +2401 -0
- package/dist/auth-91o2YM96.js +648 -0
- package/dist/auth-choice-7dFCqblU.js +2681 -0
- package/dist/auth-choice-S_0K9gpl.js +2681 -0
- package/dist/auth-health-CctpRTdC.js +149 -0
- package/dist/auth-health-DoHai4eD.js +149 -0
- package/dist/auth-lZ26wsbN.js +639 -0
- package/dist/auth-profiles-Cz2rxrav.js +2690 -0
- package/dist/auth-profiles-_5BsNObq.js +1565 -0
- package/dist/banner-ieAUufx9.js +294 -0
- package/dist/boolean-Ce2-qkSB.js +30 -0
- package/dist/boolean-Wzu0-e0P.js +30 -0
- package/dist/brew-CVZkr0GU.js +46 -0
- package/dist/brew-DAdyX1_1.js +46 -0
- package/dist/browser-cli-D_qgYDik.js +1679 -0
- package/dist/browser-cli-DldrdaCW.js +1676 -0
- package/dist/budget-ChKARYPY.js +132 -0
- package/dist/budget-Dspr6N_e.js +132 -0
- package/dist/build-info.json +5 -0
- package/dist/bundled/boot-md/HOOK.md +19 -0
- package/dist/bundled/boot-md/handler.js +861 -0
- package/dist/bundled/bootstrap-extra-files/HOOK.md +53 -0
- package/dist/bundled/bootstrap-extra-files/handler.js +39 -0
- package/dist/bundled/command-logger/HOOK.md +122 -0
- package/dist/bundled/command-logger/handler.js +55 -0
- package/dist/bundled/session-memory/HOOK.md +109 -0
- package/dist/bundled/session-memory/handler.js +128 -0
- package/dist/call-DPzNR_Qi.js +282 -0
- package/dist/call-ktoEhkOQ.js +282 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -0
- package/dist/canvas-host/a2ui/a2ui.bundle.js +19040 -0
- package/dist/canvas-host/a2ui/index.html +307 -0
- package/dist/catalog-BAayBt1L.js +185 -0
- package/dist/catalog-BNsf97BM.js +185 -0
- package/dist/channel-options-C3GV4Fgg.js +33 -0
- package/dist/channel-options-DJ4GNfwk.js +32 -0
- package/dist/channel-selection-CujyiWGM.js +51 -0
- package/dist/channel-selection-DfGpCyh2.js +51 -0
- package/dist/channel-web-D42mzlCJ.js +2162 -0
- package/dist/channels-cli-BAtARz4A.js +1306 -0
- package/dist/channels-cli-Ddo_tIRR.js +1304 -0
- package/dist/channels-status-issues-DBc1pU_R.js +18 -0
- package/dist/channels-status-issues-DjO9MHIG.js +18 -0
- package/dist/chrome-Bi6iZ5sG.js +1601 -0
- package/dist/chrome-DNSv7Cpy.js +1629 -0
- package/dist/chrome-DScZx4Lk.js +1601 -0
- package/dist/chunk-mxPVo000.js +348 -0
- package/dist/clack-prompter-B0kl7shw.js +92 -0
- package/dist/clack-prompter-B1YxZdRy.js +92 -0
- package/dist/cli/daemon-cli.js +9 -0
- package/dist/cli-D3hUnL_G.js +101 -0
- package/dist/cli-DDwD6VgH.js +99 -0
- package/dist/cli-session-CP7ZH2-6.js +5463 -0
- package/dist/cli-session-oXJQpenl.js +5408 -0
- package/dist/cli-utils-BTBABPX9.js +40 -0
- package/dist/cli-utils-DtAxdCte.js +40 -0
- package/dist/client-C1avc0vD.js +1692 -0
- package/dist/client-CC94YZrT.js +1692 -0
- package/dist/clipboard-B2fBy8tG.js +31 -0
- package/dist/clipboard-BbGnZskJ.js +31 -0
- package/dist/command-format-Clp46jkj.js +38 -0
- package/dist/command-format-DELazozB.js +52 -0
- package/dist/command-format-SkzzRqR1.js +52 -0
- package/dist/command-options-CSbuuqHr.js +8 -0
- package/dist/command-options-Cp1tf96a.js +8 -0
- package/dist/command-registry-DDGudZEQ.js +248 -0
- package/dist/commands-CRcFD5MO.js +509 -0
- package/dist/commands-Dh40OpQL.js +509 -0
- package/dist/commands-registry-Bd0xbvwG.js +766 -0
- package/dist/commands-registry-DYfRSVF3.js +766 -0
- package/dist/common-D6bu0zHC.js +287 -0
- package/dist/common-zW9Y2P1B.js +287 -0
- package/dist/completion-cli-B9Cn374l.js +431 -0
- package/dist/completion-cli-BEHghUFx.js +432 -0
- package/dist/config-Bmm8tmZF.js +6523 -0
- package/dist/config-CHc5qzaI.js +5704 -0
- package/dist/config-Co6UXXF5.js +11 -0
- package/dist/config-Xm0j9LUa.js +5705 -0
- package/dist/config-cli-9ZbCHoV8.js +247 -0
- package/dist/config-cli-sxuGl29N.js +244 -0
- package/dist/config-guard-BwRD-b9Z.js +93 -0
- package/dist/config-guard-Dy7wyhAX.js +76 -0
- package/dist/config-sync-Bllc1TJ4.js +89 -0
- package/dist/config-sync-mfuOoGHl.js +89 -0
- package/dist/configure-CCyVzQZ7.js +1006 -0
- package/dist/configure-Nntbxt4t.js +1008 -0
- package/dist/constants-BwBn5CGe.js +65 -0
- package/dist/constants-O8yBqCBv.js +65 -0
- package/dist/context-DKaQYnCH.js +60 -0
- package/dist/control-service-BeOtZCCS.js +72 -0
- package/dist/control-service-vyKJ-XUp.js +72 -0
- package/dist/cron-cli-BasqtsJ0.js +451 -0
- package/dist/cron-cli-C8XzIpyX.js +448 -0
- package/dist/daemon-cli-cwL2GI5i.js +565 -0
- package/dist/daemon-cli-sjDh2xbf.js +566 -0
- package/dist/daemon-cli.js +13117 -0
- package/dist/daemon-runtime-BuMT6nck.js +460 -0
- package/dist/daemon-runtime-CTvi3m4D.js +460 -0
- package/dist/dangerous-tools-5ObDWy1N.js +32 -0
- package/dist/dangerous-tools-Jwr7jqNw.js +32 -0
- package/dist/deliver-D6cdhg5m.js +1097 -0
- package/dist/deliver-DlNDKlA4.js +1162 -0
- package/dist/deliver-bC6iI_rv.js +1097 -0
- package/dist/delivery-queue-B6IHz4Ry.js +220 -0
- package/dist/delivery-queue-TnQykYsg.js +220 -0
- package/dist/deps-C9kDG-Ru.js +42 -0
- package/dist/devices-cli-BE-Nib4Y.js +198 -0
- package/dist/devices-cli-GyPlNRyd.js +195 -0
- package/dist/diagnostics-Dj75aEHN.js +35 -0
- package/dist/diagnostics-DlIw6fqD.js +35 -0
- package/dist/directory-cli-BEaIvWkc.js +246 -0
- package/dist/directory-cli-CZ_-DP5Z.js +243 -0
- package/dist/dispatcher-Bkcui7jz.js +100 -0
- package/dist/dispatcher-C1B6cT_7.js +100 -0
- package/dist/display-A8k-mxv8.js +171 -0
- package/dist/display-BDOsXu8F.js +171 -0
- package/dist/dns-cli-BUzpVoMv.js +200 -0
- package/dist/dns-cli-DstQOMQt.js +197 -0
- package/dist/dock-DbxBBv30.js +753 -0
- package/dist/dock-cPBY4qGl.js +753 -0
- package/dist/docs-cli-BWp6p-Tq.js +161 -0
- package/dist/docs-cli-x22FnZfL.js +159 -0
- package/dist/doctor-B5HFw-nC.js +1813 -0
- package/dist/doctor-DnEyqGcQ.js +1815 -0
- package/dist/doctor-completion-BMEPXgVg.js +92 -0
- package/dist/doctor-completion-usPeH2ol.js +92 -0
- package/dist/doctor-config-flow-CS0WFnjL.js +1232 -0
- package/dist/doctor-config-flow-Cs4O_Kmq.js +1232 -0
- package/dist/engine-DgK9s3lk.js +561 -0
- package/dist/engine-ZSd5I5JN.js +561 -0
- package/dist/entry.js +1560 -0
- package/dist/env-0lJfCPsw.js +32 -0
- package/dist/errors-A_GqUU6B.js +26 -0
- package/dist/errors-CHow2wtt.js +37 -0
- package/dist/errors-Cojm0Kl7.js +37 -0
- package/dist/exec-BenD3A5l.js +1167 -0
- package/dist/exec-BizYYQgP.js +255 -0
- package/dist/exec-Bv3pyjeM.js +255 -0
- package/dist/exec-approvals-BP9AhCSw.js +1221 -0
- package/dist/exec-approvals-CdLmKX2R.js +1221 -0
- package/dist/exec-approvals-cli-25CGlFNw.js +368 -0
- package/dist/exec-approvals-cli-BXZ-hOlT.js +371 -0
- package/dist/extensionAPI.js +8542 -0
- package/dist/format-CjKG6raZ.js +20 -0
- package/dist/format-Mq6iU0_5.js +20 -0
- package/dist/format-duration-Cm3xh8xz.js +58 -0
- package/dist/format-duration-DhWzz_5b.js +58 -0
- package/dist/format-relative-C6kUHuOj.js +55 -0
- package/dist/format-relative-sy9iviQN.js +55 -0
- package/dist/frontmatter-YijVi0FQ.js +204 -0
- package/dist/gateway-cli-B9uc0RCI.js +19971 -0
- package/dist/gateway-cli-D8Qz7kCf.js +19972 -0
- package/dist/gateway-rpc-Ch9mCYEB.js +28 -0
- package/dist/gateway-rpc-DBhcdLFs.js +28 -0
- package/dist/github-copilot-auth-D6ZErYqa.js +1418 -0
- package/dist/github-copilot-auth-DGmyWJms.js +1418 -0
- package/dist/gmail-setup-utils-BPo_LkKI.js +428 -0
- package/dist/gmail-setup-utils-D3Yqgor7.js +428 -0
- package/dist/health-DsTZaAzV.js +1258 -0
- package/dist/health-V6dGthLA.js +1253 -0
- package/dist/health-format-CdP99j3Y.js +208 -0
- package/dist/health-format-JEChH08S.js +208 -0
- package/dist/heartbeat-visibility-CkL00WRR.js +98 -0
- package/dist/heartbeat-visibility-Cmni9671.js +98 -0
- package/dist/help-format-DUBI91Ti.js +17 -0
- package/dist/help-format-Dl4bsrLI.js +17 -0
- package/dist/helpers-9N2Q5aZj.js +25 -0
- package/dist/helpers-DLgbkcEn.js +25 -0
- package/dist/helpers-ZKNRexvX.js +10 -0
- package/dist/helpers-eJFa4K6r.js +10 -0
- package/dist/hooks-cli-Cu0D0fPS.js +993 -0
- package/dist/hooks-cli-E63uffR6.js +991 -0
- package/dist/hooks-status-B-e96dZj.js +356 -0
- package/dist/hooks-status-C_9sE0ox.js +356 -0
- package/dist/image-ops-Dlt3T7th.js +541 -0
- package/dist/image-ops-omlvdfah.js +541 -0
- package/dist/index.js +499 -0
- package/dist/init-Bm04RagW.js +122 -0
- package/dist/init-CaJBf4p1.js +122 -0
- package/dist/input-provenance-BgwBljRz.js +35 -0
- package/dist/input-provenance-DJBdpeKk.js +35 -0
- package/dist/input-provenance-iu26y0GH.js +35 -0
- package/dist/installs-C2iMRBVz.js +383 -0
- package/dist/installs-D-cPGdCw.js +383 -0
- package/dist/internal-hooks-DFTIurVM.js +77 -0
- package/dist/ipv4-C5QxzriV.js +1964 -0
- package/dist/ipv4-TxR9wQCQ.js +1964 -0
- package/dist/is-main-Dt9DTcH1.js +25 -0
- package/dist/is-main-cB3p7uob.js +25 -0
- package/dist/lanes-CNxj3tit.js +232 -0
- package/dist/legacy-names-CKU7tKQR.js +8 -0
- package/dist/lifecycle-core-B_7XRcvF.js +388 -0
- package/dist/lifecycle-core-By83PVAK.js +387 -0
- package/dist/links-BfjHVTB_.js +15 -0
- package/dist/links-DPGe0OHw.js +15 -0
- package/dist/llm-slug-generator.js +62 -0
- package/dist/loader-6Qkyybg1.js +87 -0
- package/dist/loader-Dmc0KyQK.js +87 -0
- package/dist/logging-54nXj81z.js +1 -0
- package/dist/logging-BdnOSVPD.js +1 -0
- package/dist/logging-DB6BQmhi.js +15 -0
- package/dist/logging-mcb66J0p.js +15 -0
- package/dist/login--8D8kyRy.js +61 -0
- package/dist/login-C-ugYHKt.js +61 -0
- package/dist/login-CX5Q2fYl.js +59 -0
- package/dist/login-qr-BLmGvITg.js +321 -0
- package/dist/login-qr-BNtuXLKL.js +323 -0
- package/dist/login-qr-PcyTC7Ra.js +326 -0
- package/dist/logs-cli-BEQVkiXp.js +245 -0
- package/dist/logs-cli-CIqiVMkY.js +242 -0
- package/dist/manager-Bsy9ifug.js +3244 -0
- package/dist/manager-CDgcZ51c.js +3246 -0
- package/dist/manager-D7QQ5XrE.js +3244 -0
- package/dist/manifest-registry-CW1zCyRF.js +748 -0
- package/dist/manifest-registry-D4lM2RdV.js +748 -0
- package/dist/markdown-tables-BT1X6jqH.js +347 -0
- package/dist/markdown-tables-DHgOK2vI.js +348 -0
- package/dist/media-THyainiE.js +1342 -0
- package/dist/memory-cli-BmIyAOZm.js +869 -0
- package/dist/memory-cli-BoXdfCLT.js +868 -0
- package/dist/message-channel-dSTVVCyX.js +110 -0
- package/dist/message-channel-w4F2b2F6.js +110 -0
- package/dist/migrate-BR6iAIjO.js +157 -0
- package/dist/migrate-D0EcMs0f.js +157 -0
- package/dist/mime-B1ZoR53M.js +145 -0
- package/dist/mime-Bm1xTtpY.js +145 -0
- package/dist/mime-C1RlpUSs.js +145 -0
- package/dist/model-param-b-C4BL7w0Z.js +16 -0
- package/dist/model-param-b-DPwyNGn8.js +16 -0
- package/dist/model-selection-BnEobs_z.js +2692 -0
- package/dist/models-KLd8Evmq.js +2545 -0
- package/dist/models-cli-D4UFQLid.js +258 -0
- package/dist/models-cli-DJHs5rJF.js +2739 -0
- package/dist/net-B5lXhYLV.js +218 -0
- package/dist/net-CDi_lJMH.js +88 -0
- package/dist/node-cli-BNCJUkgA.js +1319 -0
- package/dist/node-cli-C7S0vk0_.js +1322 -0
- package/dist/node-match-8XZnaid6.js +34 -0
- package/dist/node-match-B3Osv-5C.js +34 -0
- package/dist/node-service-BFxHJsno.js +67 -0
- package/dist/node-service-DUnan4uK.js +67 -0
- package/dist/nodes-cli-DOXhYgc8.js +1200 -0
- package/dist/nodes-cli-wvPZ3HwH.js +1197 -0
- package/dist/nodes-screen-1YiLkqr5.js +234 -0
- package/dist/nodes-screen-DZeD8hE5.js +234 -0
- package/dist/normalize-Dlcj9D3K.js +52 -0
- package/dist/normalize-GDK8JTNW.js +52 -0
- package/dist/note-Bi8Wb8DV.js +73 -0
- package/dist/note-uiuPxhyX.js +73 -0
- package/dist/npm-registry-spec-B-XIShkB.js +351 -0
- package/dist/npm-registry-spec-za3itb5Y.js +351 -0
- package/dist/onboard-DiTRW6CH.js +1165 -0
- package/dist/onboard-channels-BgruIpyg.js +672 -0
- package/dist/onboard-channels-gyq0VHHp.js +672 -0
- package/dist/onboard-helpers-BEaUind0.js +365 -0
- package/dist/onboard-helpers-f5Zprayl.js +365 -0
- package/dist/onboard-lH3XPWAK.js +1166 -0
- package/dist/onboarding-D0FOkXGt.js +910 -0
- package/dist/onboarding-kQVgbiIR.js +911 -0
- package/dist/openclaw-root-0yHXtO35.js +88 -0
- package/dist/openclaw-root-C85WMnVV.js +88 -0
- package/dist/orchestrator-CYTk7mq6.js +355 -0
- package/dist/orchestrator-J6ELnJXl.js +355 -0
- package/dist/outbound-BEq0qbPR.js +214 -0
- package/dist/outbound-BSVD-rjk.js +2062 -0
- package/dist/outbound-DXijk0db.js +214 -0
- package/dist/outbound-send-deps-ANnAhImn.js +14 -0
- package/dist/outbound-send-deps-BNGPU7jV.js +55 -0
- package/dist/pairing-cli-DKUyb6eK.js +118 -0
- package/dist/pairing-cli-ET2p_mXH.js +121 -0
- package/dist/pairing-store-CGYSwICJ.js +388 -0
- package/dist/pairing-store-DqQPqRMe.js +388 -0
- package/dist/parse-6-2MDhdT.js +23 -0
- package/dist/parse-CpunmTOS.js +23 -0
- package/dist/parse-log-line-Bqh1SSzC.js +44 -0
- package/dist/parse-log-line-DUZCjXbl.js +44 -0
- package/dist/parse-port-BKB9Exlg.js +12 -0
- package/dist/parse-port-DrfvwwiL.js +12 -0
- package/dist/parse-timeout-Di_tcEmi.js +16 -0
- package/dist/parse-timeout-vVlESvju.js +16 -0
- package/dist/path-env-Bu6k0jDQ.js +89 -0
- package/dist/path-env-C0zQSjw8.js +89 -0
- package/dist/paths-BTc4nk-6.js +126 -0
- package/dist/paths-BgUi2Z2G.js +54 -0
- package/dist/paths-C6VCWKo3.js +238 -0
- package/dist/paths-CCxa0o9c.js +222 -0
- package/dist/paths-CxRf2rBG.js +129 -0
- package/dist/paths-DcVEkYX5.js +54 -0
- package/dist/paths-hcX1Gqg5.js +129 -0
- package/dist/pi-auth-json-BzX-qyRo.js +82 -0
- package/dist/pi-auth-json-eesA38iW.js +78 -0
- package/dist/pi-auth-json-uEDdgg8K.js +80 -0
- package/dist/pi-embedded-C1Nl7L89.js +22 -0
- package/dist/pi-model-discovery-BkqhoPls.js +20 -0
- package/dist/pi-model-discovery-CQOWUAmK.js +3 -0
- package/dist/pi-model-discovery-DsRqYJLy.js +20 -0
- package/dist/pi-tools.policy-D9AUlreI.js +200 -0
- package/dist/pi-tools.policy-DRDm3v-2.js +200 -0
- package/dist/plugin-auto-enable-C-JwYMlZ.js +282 -0
- package/dist/plugin-auto-enable-DLIDBBfi.js +282 -0
- package/dist/plugin-registry-Bp8mivr-.js +32 -0
- package/dist/plugin-registry-CP7KgCvC.js +32 -0
- package/dist/plugin-sdk/account-id.d.ts +1 -0
- package/dist/plugin-sdk/account-id.js +15 -0
- package/dist/plugin-sdk/agents/agent-paths.d.ts +6 -0
- package/dist/plugin-sdk/agents/agent-scope.d.ts +37 -0
- package/dist/plugin-sdk/agents/anima-tools.d.ts +1 -0
- package/dist/plugin-sdk/agents/apply-patch-update.d.ts +10 -0
- package/dist/plugin-sdk/agents/apply-patch.d.ts +35 -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 +23 -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 +70 -0
- package/dist/plugin-sdk/agents/bash-tools.d.ts +4 -0
- package/dist/plugin-sdk/agents/bash-tools.exec-runtime.d.ts +73 -0
- package/dist/plugin-sdk/agents/bash-tools.exec.d.ts +55 -0
- package/dist/plugin-sdk/agents/bash-tools.process.d.ts +7 -0
- package/dist/plugin-sdk/agents/bash-tools.shared.d.ts +48 -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/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 +83 -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.d.ts +1 -0
- package/dist/plugin-sdk/agents/current-time.d.ts +17 -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/glob-pattern.d.ts +18 -0
- package/dist/plugin-sdk/agents/huggingface-models.d.ts +17 -0
- package/dist/plugin-sdk/agents/identity-avatar.d.ts +15 -0
- package/dist/plugin-sdk/agents/identity-file.d.ts +12 -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-alias-lines.d.ts +2 -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-fallback.d.ts +40 -0
- package/dist/plugin-sdk/agents/model-selection.d.ts +94 -0
- package/dist/plugin-sdk/agents/models-config.d.ts +13 -0
- package/dist/plugin-sdk/agents/models-config.providers.d.ts +37 -0
- package/dist/plugin-sdk/agents/ollama-stream.d.ts +45 -0
- package/dist/plugin-sdk/agents/openclaw-tools.d.ts +46 -0
- package/dist/plugin-sdk/agents/pi-auth-json.d.ts +14 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers.d.ts +7 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/model.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +5 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner.d.ts +25 -0
- package/dist/plugin-sdk/agents/pi-embedded-utils.d.ts +7 -0
- package/dist/plugin-sdk/agents/pi-embedded.d.ts +25 -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-tools.abort.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-tools.before-tool-call.d.ts +29 -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 +44 -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 +7 -0
- package/dist/plugin-sdk/agents/sandbox/browser.d.ts +12 -0
- package/dist/plugin-sdk/agents/sandbox/config-hash.d.ts +17 -0
- package/dist/plugin-sdk/agents/sandbox/config.d.ts +26 -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 +40 -0
- package/dist/plugin-sdk/agents/sandbox/fs-bridge.d.ts +56 -0
- package/dist/plugin-sdk/agents/sandbox/fs-paths.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 +31 -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 +76 -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 +23 -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-slug.d.ts +1 -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 +13 -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 +23 -0
- package/dist/plugin-sdk/agents/subagent-announce.d.ts +34 -0
- package/dist/plugin-sdk/agents/subagent-depth.d.ts +11 -0
- package/dist/plugin-sdk/agents/subagent-registry.d.ts +62 -0
- package/dist/plugin-sdk/agents/subagent-registry.store.d.ts +5 -0
- package/dist/plugin-sdk/agents/synthetic-models.d.ts +160 -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 +78 -0
- package/dist/plugin-sdk/agents/timeout.d.ts +8 -0
- package/dist/plugin-sdk/agents/together-models.d.ts +4 -0
- package/dist/plugin-sdk/agents/tool-images.d.ts +19 -0
- package/dist/plugin-sdk/agents/tool-policy-pipeline.d.ts +27 -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 +15 -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 +56 -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 +35 -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/subagents-tool.d.ts +4 -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 +71 -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/usage.d.ts +45 -0
- package/dist/plugin-sdk/agents/venice-models.d.ts +238 -0
- package/dist/plugin-sdk/agents/workspace-dir.d.ts +2 -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 +34 -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 +32 -0
- package/dist/plugin-sdk/auto-reply/envelope.d.ts +58 -0
- package/dist/plugin-sdk/auto-reply/group-activation.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/heartbeat-reply-payload.d.ts +2 -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 +22 -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 +10 -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 +25 -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 +7 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.impl.d.ts +3 -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.params.d.ts +51 -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/directive-parsing.d.ts +5 -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/dispatcher-registry.d.ts +24 -0
- package/dist/plugin-sdk/auto-reply/reply/elevated-unavailable.d.ts +8 -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 +92 -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 +26 -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-meta.d.ts +3 -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 +19 -0
- package/dist/plugin-sdk/auto-reply/reply/model-selection.d.ts +64 -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-delivery.d.ts +27 -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 +52 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-elevated.d.ts +16 -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-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-reset-prompt.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +11 -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 +21 -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/subagents-utils.d.ts +7 -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 +55 -0
- package/dist/plugin-sdk/auto-reply/templating.d.ts +152 -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/types.d.ts +61 -0
- package/dist/plugin-sdk/browser/bridge-auth-registry.d.ts +8 -0
- package/dist/plugin-sdk/browser/bridge-server.d.ts +18 -0
- package/dist/plugin-sdk/browser/cdp.d.ts +123 -0
- package/dist/plugin-sdk/browser/cdp.helpers.d.ts +13 -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 +144 -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 +20 -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-auth.d.ts +13 -0
- package/dist/plugin-sdk/browser/control-service.d.ts +5 -0
- package/dist/plugin-sdk/browser/csrf.d.ts +8 -0
- package/dist/plugin-sdk/browser/extension-relay.d.ts +15 -0
- package/dist/plugin-sdk/browser/http-auth.d.ts +5 -0
- package/dist/plugin-sdk/browser/paths.d.ts +27 -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/proxy-files.d.ts +7 -0
- package/dist/plugin-sdk/browser/pw-ai-module.d.ts +6 -0
- package/dist/plugin-sdk/browser/pw-ai-state.d.ts +2 -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 +160 -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 +114 -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/resolved-config-refresh.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 +16 -0
- package/dist/plugin-sdk/browser/routes/index.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/path-output.d.ts +1 -0
- package/dist/plugin-sdk/browser/routes/tabs.d.ts +3 -0
- package/dist/plugin-sdk/browser/routes/types.d.ts +20 -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 +4 -0
- package/dist/plugin-sdk/browser/server-context.types.d.ts +79 -0
- package/dist/plugin-sdk/browser/server-middleware.d.ts +6 -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/account-summary.d.ts +17 -0
- package/dist/plugin-sdk/channels/ack-reactions.d.ts +29 -0
- package/dist/plugin-sdk/channels/allowlist-match.d.ts +15 -0
- package/dist/plugin-sdk/channels/allowlists/resolve-utils.d.ts +20 -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 +3 -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 +11 -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 +297 -0
- package/dist/plugin-sdk/channels/plugins/types.core.d.ts +329 -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/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 +19 -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 +32 -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-bytes.d.ts +4 -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/prompt.d.ts +1 -0
- package/dist/plugin-sdk/cli/wait.d.ts +1 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +77 -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 +82 -0
- package/dist/plugin-sdk/commands/onboard-types.d.ts +76 -0
- package/dist/plugin-sdk/commands/signal-install.d.ts +30 -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/backup-rotation.d.ts +5 -0
- package/dist/plugin-sdk/config/cache-utils.d.ts +6 -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-preserve.d.ts +25 -0
- package/dist/plugin-sdk/config/env-substitution.d.ts +36 -0
- package/dist/plugin-sdk/config/env-vars.d.ts +3 -0
- package/dist/plugin-sdk/config/group-policy.d.ts +47 -0
- package/dist/plugin-sdk/config/includes.d.ts +32 -0
- package/dist/plugin-sdk/config/io.d.ts +55 -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 +19 -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/merge-patch.d.ts +5 -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/delivery-info.d.ts +12 -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 +21 -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 +99 -0
- package/dist/plugin-sdk/config/sessions/transcript.d.ts +18 -0
- package/dist/plugin-sdk/config/sessions/types.d.ts +156 -0
- package/dist/plugin-sdk/config/sessions.d.ts +10 -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 +260 -0
- package/dist/plugin-sdk/config/types.agents.d.ts +80 -0
- package/dist/plugin-sdk/config/types.anima.d.ts +1 -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 +172 -0
- package/dist/plugin-sdk/config/types.browser.d.ts +41 -0
- package/dist/plugin-sdk/config/types.channels.d.ts +48 -0
- package/dist/plugin-sdk/config/types.cron.d.ts +11 -0
- package/dist/plugin-sdk/config/types.d.ts +30 -0
- package/dist/plugin-sdk/config/types.discord.d.ts +188 -0
- package/dist/plugin-sdk/config/types.gateway.d.ts +288 -0
- package/dist/plugin-sdk/config/types.googlechat.d.ts +100 -0
- package/dist/plugin-sdk/config/types.hooks.d.ts +128 -0
- package/dist/plugin-sdk/config/types.imessage.d.ts +71 -0
- package/dist/plugin-sdk/config/types.irc.d.ts +96 -0
- package/dist/plugin-sdk/config/types.memory.d.ts +45 -0
- package/dist/plugin-sdk/config/types.messages.d.ts +121 -0
- package/dist/plugin-sdk/config/types.models.d.ts +54 -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 +114 -0
- package/dist/plugin-sdk/config/types.plugins.d.ts +32 -0
- package/dist/plugin-sdk/config/types.queue.d.ts +14 -0
- package/dist/plugin-sdk/config/types.sandbox.d.ts +78 -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 +150 -0
- package/dist/plugin-sdk/config/types.telegram.d.ts +163 -0
- package/dist/plugin-sdk/config/types.tools.d.ts +467 -0
- package/dist/plugin-sdk/config/types.tts.d.ts +78 -0
- package/dist/plugin-sdk/config/types.whatsapp.d.ts +142 -0
- package/dist/plugin-sdk/config/validation.d.ts +37 -0
- package/dist/plugin-sdk/config/version.d.ts +8 -0
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +249 -0
- package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +856 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +504 -0
- package/dist/plugin-sdk/config/zod-schema.allowdeny.d.ts +13 -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 +683 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +3401 -0
- package/dist/plugin-sdk/config/zod-schema.hooks.d.ts +79 -0
- package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +3233 -0
- package/dist/plugin-sdk/config/zod-schema.providers-whatsapp.d.ts +231 -0
- package/dist/plugin-sdk/config/zod-schema.providers.d.ts +1900 -0
- package/dist/plugin-sdk/config/zod-schema.sensitive.d.ts +2 -0
- package/dist/plugin-sdk/config/zod-schema.session.d.ts +203 -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 +21 -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 +121 -0
- package/dist/plugin-sdk/cron/service/store.d.ts +9 -0
- package/dist/plugin-sdk/cron/service/timer.d.ts +25 -0
- package/dist/plugin-sdk/cron/service.d.ts +48 -0
- package/dist/plugin-sdk/cron/session-reaper.d.ts +35 -0
- package/dist/plugin-sdk/cron/store.d.ts +6 -0
- package/dist/plugin-sdk/cron/types.d.ts +95 -0
- package/dist/plugin-sdk/daemon/constants.d.ts +30 -0
- package/dist/plugin-sdk/discord/accounts.d.ts +9 -0
- package/dist/plugin-sdk/discord/audit.d.ts +2 -0
- package/dist/plugin-sdk/discord/directory-live.d.ts +4 -0
- package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +1 -0
- package/dist/plugin-sdk/discord/monitor/gateway-registry.d.ts +3 -0
- package/dist/plugin-sdk/discord/monitor/presence-cache.d.ts +1 -0
- package/dist/plugin-sdk/discord/monitor.d.ts +3 -0
- package/dist/plugin-sdk/discord/pluralkit.d.ts +1 -0
- package/dist/plugin-sdk/discord/probe.d.ts +3 -0
- package/dist/plugin-sdk/discord/resolve-channels.d.ts +1 -0
- package/dist/plugin-sdk/discord/resolve-users.d.ts +1 -0
- package/dist/plugin-sdk/discord/send.d.ts +6 -0
- package/dist/plugin-sdk/discord/targets.d.ts +2 -0
- package/dist/plugin-sdk/gateway/auth-rate-limit.d.ts +59 -0
- package/dist/plugin-sdk/gateway/auth.d.ts +48 -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 +4 -0
- package/dist/plugin-sdk/gateway/client.d.ts +63 -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/exec-approval-manager.d.ts +44 -0
- package/dist/plugin-sdk/gateway/net.d.ts +57 -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 +661 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +86 -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 +126 -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 +163 -0
- package/dist/plugin-sdk/gateway/protocol/schema/frames.d.ts +164 -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 +76 -0
- package/dist/plugin-sdk/gateway/protocol/schema/snapshot.d.ts +64 -0
- package/dist/plugin-sdk/gateway/protocol/schema/types.d.ts +124 -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 +98 -0
- package/dist/plugin-sdk/gateway/server-shared.d.ts +7 -0
- package/dist/plugin-sdk/gateway/session-utils.d.ts +71 -0
- package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +33 -0
- package/dist/plugin-sdk/gateway/session-utils.types.d.ts +84 -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 +8 -0
- package/dist/plugin-sdk/imessage/monitor.d.ts +3 -0
- package/dist/plugin-sdk/imessage/probe.d.ts +3 -0
- package/dist/plugin-sdk/imessage/send.d.ts +1 -0
- package/dist/plugin-sdk/imessage/target-parsing-helpers.d.ts +4 -0
- package/dist/plugin-sdk/imessage/targets.d.ts +2 -0
- package/dist/plugin-sdk/index.d.ts +1 -0
- package/dist/plugin-sdk/index.js +27570 -0
- package/dist/plugin-sdk/infra/agent-events.d.ts +21 -0
- package/dist/plugin-sdk/infra/anima-root.d.ts +1 -0
- package/dist/plugin-sdk/infra/archive.d.ts +41 -0
- package/dist/plugin-sdk/infra/backoff.d.ts +8 -0
- package/dist/plugin-sdk/infra/binaries.d.ts +3 -0
- package/dist/plugin-sdk/infra/brew.d.ts +8 -0
- package/dist/plugin-sdk/infra/channel-activity.d.ts +18 -0
- package/dist/plugin-sdk/infra/channel-summary.d.ts +6 -0
- package/dist/plugin-sdk/infra/dedupe.d.ts +11 -0
- package/dist/plugin-sdk/infra/device-auth-store.d.ts +18 -0
- package/dist/plugin-sdk/infra/device-identity.d.ts +11 -0
- package/dist/plugin-sdk/infra/device-pairing.d.ts +96 -0
- package/dist/plugin-sdk/infra/diagnostic-events.d.ts +121 -0
- package/dist/plugin-sdk/infra/dotenv.d.ts +3 -0
- package/dist/plugin-sdk/infra/env.d.ts +11 -0
- package/dist/plugin-sdk/infra/errors.d.ts +11 -0
- package/dist/plugin-sdk/infra/exec-approvals-allowlist.d.ts +45 -0
- package/dist/plugin-sdk/infra/exec-approvals-analysis.d.ts +78 -0
- package/dist/plugin-sdk/infra/exec-approvals.d.ts +107 -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/file-lock.d.ts +2 -0
- package/dist/plugin-sdk/infra/format-time/format-datetime.d.ts +35 -0
- package/dist/plugin-sdk/infra/format-time/format-duration.d.ts +23 -0
- package/dist/plugin-sdk/infra/format-time/format-relative.d.ts +39 -0
- package/dist/plugin-sdk/infra/git-commit.d.ts +4 -0
- package/dist/plugin-sdk/infra/heartbeat-active-hours.d.ts +5 -0
- package/dist/plugin-sdk/infra/heartbeat-events-filter.d.ts +3 -0
- package/dist/plugin-sdk/infra/heartbeat-events.d.ts +21 -0
- package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +45 -0
- package/dist/plugin-sdk/infra/heartbeat-visibility.d.ts +17 -0
- package/dist/plugin-sdk/infra/heartbeat-wake.d.ts +27 -0
- package/dist/plugin-sdk/infra/home-dir.d.ts +7 -0
- package/dist/plugin-sdk/infra/http-body.d.ts +46 -0
- package/dist/plugin-sdk/infra/json-file.d.ts +2 -0
- package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +21 -0
- package/dist/plugin-sdk/infra/net/ssrf.d.ts +32 -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/abort.d.ts +8 -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 +77 -0
- package/dist/plugin-sdk/infra/outbound/delivery-queue.d.ts +103 -0
- package/dist/plugin-sdk/infra/outbound/directory-cache.d.ts +24 -0
- package/dist/plugin-sdk/infra/outbound/identity.d.ts +8 -0
- package/dist/plugin-sdk/infra/outbound/message-action-params.d.ts +47 -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 +85 -0
- package/dist/plugin-sdk/infra/outbound/outbound-policy.d.ts +31 -0
- package/dist/plugin-sdk/infra/outbound/outbound-send-service.d.ts +64 -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/outbound/tool-payload.d.ts +2 -0
- package/dist/plugin-sdk/infra/pairing-files.d.ts +11 -0
- package/dist/plugin-sdk/infra/pairing-token.d.ts +3 -0
- package/dist/plugin-sdk/infra/path-prepend.d.ts +5 -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 +61 -0
- package/dist/plugin-sdk/infra/retry.d.ts +21 -0
- package/dist/plugin-sdk/infra/session-cost-usage.d.ts +45 -0
- package/dist/plugin-sdk/infra/session-cost-usage.types.d.ts +153 -0
- package/dist/plugin-sdk/infra/session-maintenance-warning.d.ts +10 -0
- package/dist/plugin-sdk/infra/shell-env.d.ts +33 -0
- package/dist/plugin-sdk/infra/skills-remote.d.ts +25 -0
- package/dist/plugin-sdk/infra/system-events.d.ts +18 -0
- package/dist/plugin-sdk/infra/tailnet.d.ts +7 -0
- package/dist/plugin-sdk/infra/tailscale.d.ts +34 -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/tmp-anima-dir.d.ts +1 -0
- package/dist/plugin-sdk/infra/tmp-openclaw-dir.d.ts +18 -0
- package/dist/plugin-sdk/infra/unhandled-rejections.d.ts +15 -0
- package/dist/plugin-sdk/infra/warning-filter.d.ts +7 -0
- package/dist/plugin-sdk/infra/ws.d.ts +2 -0
- package/dist/plugin-sdk/infra/wsl.d.ts +11 -0
- package/dist/plugin-sdk/line/accounts.d.ts +9 -0
- package/dist/plugin-sdk/line/config-schema.d.ts +1 -0
- package/dist/plugin-sdk/line/flex-templates.d.ts +14 -0
- package/dist/plugin-sdk/line/markdown-to-line.d.ts +6 -0
- package/dist/plugin-sdk/line/monitor.d.ts +3 -0
- package/dist/plugin-sdk/line/probe.d.ts +3 -0
- package/dist/plugin-sdk/line/send.d.ts +14 -0
- package/dist/plugin-sdk/line/template-messages.d.ts +1 -0
- package/dist/plugin-sdk/line/types.d.ts +6 -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 +23 -0
- package/dist/plugin-sdk/logging/diagnostic-session-state.d.ts +17 -0
- package/dist/plugin-sdk/logging/diagnostic.d.ts +56 -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 +18 -0
- package/dist/plugin-sdk/logging/subsystem.d.ts +18 -0
- package/dist/plugin-sdk/logging.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/markdown/whatsapp.d.ts +14 -0
- package/dist/plugin-sdk/media/audio-tags.d.ts +10 -0
- package/dist/plugin-sdk/media/audio.d.ts +19 -0
- package/dist/plugin-sdk/media/base64.d.ts +1 -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 +81 -0
- package/dist/plugin-sdk/media/mime.d.ts +16 -0
- package/dist/plugin-sdk/media/parse.d.ts +8 -0
- package/dist/plugin-sdk/media/png-encode.d.ts +8 -0
- package/dist/plugin-sdk/media/read-response-with-limit.d.ts +7 -0
- package/dist/plugin-sdk/media/sniff-mime-from-base64.d.ts +1 -0
- package/dist/plugin-sdk/media/store.d.ts +28 -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 +14 -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/output-extract.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/image.d.ts +1 -0
- package/dist/plugin-sdk/media-understanding/providers/index.d.ts +8 -0
- package/dist/plugin-sdk/media-understanding/providers/shared.d.ts +4 -0
- package/dist/plugin-sdk/media-understanding/resolve.d.ts +44 -0
- package/dist/plugin-sdk/media-understanding/runner.d.ts +35 -0
- package/dist/plugin-sdk/media-understanding/runner.entries.d.ts +33 -0
- package/dist/plugin-sdk/media-understanding/scope.d.ts +9 -0
- package/dist/plugin-sdk/media-understanding/types.d.ts +93 -0
- package/dist/plugin-sdk/media-understanding/video.d.ts +2 -0
- package/dist/plugin-sdk/memory/backend-config.d.ts +49 -0
- package/dist/plugin-sdk/memory/batch-gemini.d.ts +55 -0
- package/dist/plugin-sdk/memory/batch-http.d.ts +6 -0
- package/dist/plugin-sdk/memory/batch-openai.d.ts +45 -0
- package/dist/plugin-sdk/memory/batch-output.d.ts +23 -0
- package/dist/plugin-sdk/memory/batch-voyage.d.ts +46 -0
- package/dist/plugin-sdk/memory/embedding-chunk-limits.d.ts +3 -0
- package/dist/plugin-sdk/memory/embedding-input-limits.d.ts +2 -0
- package/dist/plugin-sdk/memory/embedding-model-limits.d.ts +2 -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 +44 -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 +38 -0
- package/dist/plugin-sdk/memory/manager-embedding-ops.d.ts +32 -0
- package/dist/plugin-sdk/memory/manager-search.d.ts +60 -0
- package/dist/plugin-sdk/memory/manager-sync-ops.d.ts +40 -0
- package/dist/plugin-sdk/memory/manager.d.ts +75 -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 +109 -0
- package/dist/plugin-sdk/memory/qmd-query-parser.d.ts +8 -0
- package/dist/plugin-sdk/memory/qmd-scope.d.ts +4 -0
- package/dist/plugin-sdk/memory/search-manager.d.ts +11 -0
- package/dist/plugin-sdk/memory/session-files.d.ts +14 -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-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/account-id.d.ts +1 -0
- package/dist/plugin-sdk/plugin-sdk/allow-from.d.ts +4 -0
- package/dist/plugin-sdk/plugin-sdk/config-paths.d.ts +6 -0
- package/dist/plugin-sdk/plugin-sdk/file-lock.d.ts +16 -0
- package/dist/plugin-sdk/plugin-sdk/index.d.ts +123 -0
- package/dist/plugin-sdk/plugin-sdk/onboarding.d.ts +11 -0
- package/dist/plugin-sdk/plugin-sdk/text-chunking.d.ts +1 -0
- package/dist/plugin-sdk/plugins/bundled-dir.d.ts +1 -0
- package/dist/plugin-sdk/plugins/commands.d.ts +83 -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 +37 -0
- package/dist/plugin-sdk/plugins/hooks.d.ts +42 -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 +317 -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 +411 -0
- package/dist/plugin-sdk/polls.d.ts +31 -0
- package/dist/plugin-sdk/process/command-queue.d.ts +51 -0
- package/dist/plugin-sdk/process/exec.d.ts +26 -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 +8 -0
- package/dist/plugin-sdk/providers/qwen-portal-oauth.d.ts +8 -0
- package/dist/plugin-sdk/routing/bindings.d.ts +11 -0
- package/dist/plugin-sdk/routing/resolve-route.d.ts +42 -0
- package/dist/plugin-sdk/routing/session-key.d.ts +48 -0
- package/dist/plugin-sdk/runtime.d.ts +7 -0
- package/dist/plugin-sdk/security/external-content.d.ts +67 -0
- package/dist/plugin-sdk/security/secret-equal.d.ts +1 -0
- package/dist/plugin-sdk/sessions/input-provenance.d.ts +16 -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 +11 -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/chat-envelope.d.ts +2 -0
- package/dist/plugin-sdk/shared/config-eval.d.ts +5 -0
- package/dist/plugin-sdk/shared/device-auth.d.ts +13 -0
- package/dist/plugin-sdk/shared/frontmatter.d.ts +7 -0
- package/dist/plugin-sdk/shared/node-match.d.ts +8 -0
- package/dist/plugin-sdk/shared/subagents-format.d.ts +15 -0
- package/dist/plugin-sdk/shared/text/reasoning-tags.d.ts +6 -0
- package/dist/plugin-sdk/signal/accounts.d.ts +9 -0
- package/dist/plugin-sdk/signal/format.d.ts +9 -0
- package/dist/plugin-sdk/signal/identity.d.ts +3 -0
- package/dist/plugin-sdk/signal/index.d.ts +3 -0
- package/dist/plugin-sdk/signal/probe.d.ts +3 -0
- package/dist/plugin-sdk/signal/reaction-level.d.ts +1 -0
- package/dist/plugin-sdk/signal/send-reactions.d.ts +2 -0
- package/dist/plugin-sdk/signal/send.d.ts +1 -0
- package/dist/plugin-sdk/slack/accounts.d.ts +11 -0
- package/dist/plugin-sdk/slack/actions.d.ts +17 -0
- package/dist/plugin-sdk/slack/client.d.ts +1 -0
- package/dist/plugin-sdk/slack/directory-live.d.ts +4 -0
- package/dist/plugin-sdk/slack/index.d.ts +3 -0
- package/dist/plugin-sdk/slack/message-actions.d.ts +2 -0
- package/dist/plugin-sdk/slack/monitor/allow-list.d.ts +1 -0
- package/dist/plugin-sdk/slack/probe.d.ts +3 -0
- package/dist/plugin-sdk/slack/resolve-channels.d.ts +1 -0
- package/dist/plugin-sdk/slack/resolve-users.d.ts +1 -0
- package/dist/plugin-sdk/slack/send.d.ts +5 -0
- package/dist/plugin-sdk/slack/targets.d.ts +2 -0
- package/dist/plugin-sdk/slack/threading-tool-context.d.ts +1 -0
- package/dist/plugin-sdk/telegram/accounts.d.ts +9 -0
- package/dist/plugin-sdk/telegram/audit.d.ts +4 -0
- package/dist/plugin-sdk/telegram/bot/helpers.d.ts +1 -0
- package/dist/plugin-sdk/telegram/bot/types.d.ts +5 -0
- package/dist/plugin-sdk/telegram/inline-buttons.d.ts +2 -0
- package/dist/plugin-sdk/telegram/model-buttons.d.ts +5 -0
- package/dist/plugin-sdk/telegram/monitor.d.ts +3 -0
- package/dist/plugin-sdk/telegram/outbound-params.d.ts +2 -0
- package/dist/plugin-sdk/telegram/probe.d.ts +6 -0
- package/dist/plugin-sdk/telegram/reaction-level.d.ts +1 -0
- package/dist/plugin-sdk/telegram/send.d.ts +10 -0
- package/dist/plugin-sdk/telegram/sticker-cache.d.ts +2 -0
- package/dist/plugin-sdk/telegram/targets.d.ts +1 -0
- package/dist/plugin-sdk/telegram/token.d.ts +1 -0
- package/dist/plugin-sdk/terminal/ansi.d.ts +2 -0
- package/dist/plugin-sdk/terminal/health-style.d.ts +1 -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 +17 -0
- package/dist/plugin-sdk/terminal/theme.d.ts +15 -0
- package/dist/plugin-sdk/tts/tts-core.d.ts +52 -0
- package/dist/plugin-sdk/tts/tts.d.ts +179 -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/fetch-timeout.d.ts +13 -0
- package/dist/plugin-sdk/utils/message-channel.d.ts +27 -0
- package/dist/plugin-sdk/utils/normalize-secret-input.d.ts +11 -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 +67 -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 +25 -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 +7 -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 +41 -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 +38 -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 +2 -0
- package/dist/plugin-sdk/whatsapp/resolve-outbound-target.d.ts +1 -0
- package/dist/plugin-sdk/wizard/prompts.d.ts +42 -0
- package/dist/plugin-sdk/wizard/session.d.ts +42 -0
- package/dist/plugins-B362e77G.js +168 -0
- package/dist/plugins-CDJw924T.js +38 -0
- package/dist/plugins-CmSUIUNi.js +38 -0
- package/dist/plugins-cli-CtFRTC2I.js +734 -0
- package/dist/plugins-cli-D1lvqLG9.js +736 -0
- package/dist/polls-CItfB1H8.js +1343 -0
- package/dist/ports-BVLMN1Sr.js +96 -0
- package/dist/ports-CqLSlU6Z.js +317 -0
- package/dist/ports-D94CwCrv.js +344 -0
- package/dist/ports-D_NHthOz.js +96 -0
- package/dist/program-Bve7k4jO.js +176 -0
- package/dist/program-context-8lqacY-M.js +496 -0
- package/dist/program-context-Bvn8046-.js +17 -0
- package/dist/progress-Bek_GyWS.js +133 -0
- package/dist/progress-CbZ2D53A.js +133 -0
- package/dist/prompt-style-DKy6qQxR.js +9 -0
- package/dist/prompt-style-lu0clOOE.js +9 -0
- package/dist/prompts-BI__va99.js +10 -0
- package/dist/prompts-_dDWkCAz.js +10 -0
- package/dist/pw-ai-BLVMuSLv.js +1867 -0
- package/dist/pw-ai-DZJWEF_f.js +1865 -0
- package/dist/pw-ai-dzf-ptcn.js +1868 -0
- package/dist/qmd-manager-B0FWDi1x.js +938 -0
- package/dist/qmd-manager-CrDrpgh3.js +937 -0
- package/dist/qmd-manager-DepEoASu.js +935 -0
- package/dist/queue-2CW7pnm1.js +209 -0
- package/dist/queue-DhjMEG_Q.js +209 -0
- package/dist/redact-BHmk44DI.js +97 -0
- package/dist/redact-ClVwO7Nn.js +97 -0
- package/dist/register.agent-CE_8JbTE.js +265 -0
- package/dist/register.agent-CGRdcftb.js +1003 -0
- package/dist/register.anima-B4NPeesF.js +167 -0
- package/dist/register.anima-hNCtQ_jl.js +167 -0
- package/dist/register.configure-3prVPXwx.js +101 -0
- package/dist/register.configure-Dqm2IveL.js +103 -0
- package/dist/register.maintenance-BSIx4eNS.js +543 -0
- package/dist/register.maintenance-DDeG6CHa.js +543 -0
- package/dist/register.message-DcYPDzYr.js +657 -0
- package/dist/register.message-RbFrjbch.js +660 -0
- package/dist/register.onboard-BBJK_0_C.js +170 -0
- package/dist/register.onboard-BrcWHC9j.js +170 -0
- package/dist/register.setup-ByvEHxYQ.js +175 -0
- package/dist/register.setup-CNwO5Yq3.js +175 -0
- package/dist/register.status-health-sessions-CGT7bn4C.js +142 -0
- package/dist/register.status-health-sessions-QK6iQSJc.js +313 -0
- package/dist/register.subclis-Bd8eE94r.js +255 -0
- package/dist/registry-BiekeB9q.js +116 -0
- package/dist/registry-qI6V4gqU.js +116 -0
- package/dist/reply-Clj5jcM5.js +32212 -0
- package/dist/reply-DnH1Ueoz.js +32212 -0
- package/dist/reply-prefix-D2NxVzGZ.js +100 -0
- package/dist/reply-prefix-DPpz_mEi.js +100 -0
- package/dist/requirements-BzZxj2Wu.js +107 -0
- package/dist/requirements-DIW1svgA.js +107 -0
- package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
- package/dist/routes-CXpne1-p.js +1820 -0
- package/dist/routes-DtRwwTy6.js +1820 -0
- package/dist/rpc-BBB_Fbes.js +70 -0
- package/dist/rpc-CMEWfcci.js +70 -0
- package/dist/run-main-DOXNrnL2.js +371 -0
- package/dist/runtime-guard-BSUFiAQV.js +60 -0
- package/dist/runtime-guard-DeOXA_86.js +60 -0
- package/dist/sandbox-Bk0ZXcag.js +859 -0
- package/dist/sandbox-D3CFkNeF.js +858 -0
- package/dist/sandbox-cli-BCnnmQ03.js +458 -0
- package/dist/sandbox-cli-Ctpa2Isy.js +461 -0
- package/dist/secret-equal-B268kALC.js +13 -0
- package/dist/secret-equal-Dghy3xsA.js +13 -0
- package/dist/security-cli-BiiLLcQV.js +462 -0
- package/dist/security-cli-DOZmLENS.js +465 -0
- package/dist/send-BTA6qupx.js +10 -0
- package/dist/send-BhAfdGII.js +10 -0
- package/dist/send-C2t9xpXI.js +10 -0
- package/dist/send-C6ccOW_U.js +10 -0
- package/dist/send-CP74DxzJ.js +28 -0
- package/dist/send-CS3G_YWr.js +10 -0
- package/dist/send-D5JnqErc.js +10 -0
- package/dist/send-DEMhcauI.js +32 -0
- package/dist/send-DF8KJImx.js +28 -0
- package/dist/send-DVW0CcHX.js +32 -0
- package/dist/send-DigO-i9j.js +28 -0
- package/dist/send-DqMLjD9Z.js +10 -0
- package/dist/send-Dz2BDHll.js +32 -0
- package/dist/send-ga9udK1_.js +10 -0
- package/dist/send-oDz9NATu.js +10 -0
- package/dist/server-context-BznDS2td.js +824 -0
- package/dist/server-context-CXnE2F7d.js +824 -0
- package/dist/server-node-events-Cu6Qkjor.js +231 -0
- package/dist/server-node-events-Cv8MuF1g.js +233 -0
- package/dist/service-BNVpYcQe.js +642 -0
- package/dist/service-D56aMXUB.js +642 -0
- package/dist/service-audit-DBsygs7y.js +488 -0
- package/dist/service-audit-DKWJcTu4.js +488 -0
- package/dist/session-CXcl3Xrp.js +181 -0
- package/dist/session-DUFuU29j.js +179 -0
- package/dist/session-M_uCxF0U.js +181 -0
- package/dist/session-cost-usage-BwiTZuKl.js +600 -0
- package/dist/session-cost-usage-DT9YNXTJ.js +600 -0
- package/dist/session-key-BGiG_JcT.js +198 -0
- package/dist/session-key-DxcgHezu.js +198 -0
- package/dist/sessions-B8GUAiF6.js +1296 -0
- package/dist/sessions-D0Zd1CND.js +1296 -0
- package/dist/sessions-D0spLCm7.js +187 -0
- package/dist/sessions-XvkHLXt4.js +2038 -0
- package/dist/shared-CEHU0exQ.js +77 -0
- package/dist/shared-Cgly1vPb.js +66 -0
- package/dist/shared-DAHxpviD.js +77 -0
- package/dist/shared-JOo05hST.js +66 -0
- package/dist/shell-argv-CAq1mLa2.js +72 -0
- package/dist/shell-argv-Ce41guJv.js +72 -0
- package/dist/skill-scanner-CkaVLABv.js +263 -0
- package/dist/skill-scanner-Coo4QoCd.js +263 -0
- package/dist/skills-B-G7UHOa.js +808 -0
- package/dist/skills-B5LQx4lT.js +807 -0
- package/dist/skills-cli-DF9XJ2_0.js +286 -0
- package/dist/skills-cli-eLBluVoD.js +289 -0
- package/dist/skills-status-Clq9ZnYu.js +166 -0
- package/dist/skills-status-JQluhU-P.js +166 -0
- package/dist/sqlite-BukcjdJa.js +321 -0
- package/dist/sqlite-CGcOZZ0C.js +368 -0
- package/dist/sqlite-Ck6f9KWc.js +453 -0
- package/dist/start-BvsoGNHJ.js +354 -0
- package/dist/start-CF_Cp6YC.js +353 -0
- package/dist/status-BKGJ7VPQ.js +27 -0
- package/dist/status-BZip7mx9.js +27 -0
- package/dist/status-BqYq_J5J.js +2132 -0
- package/dist/status-CMnlcBVc.js +21 -0
- package/dist/status-CXQrTLri.js +2137 -0
- package/dist/status-tDZPwewW.js +21 -0
- package/dist/status.update-CWiod7o_.js +79 -0
- package/dist/status.update-D1PyrhoB.js +79 -0
- package/dist/subagent-registry-CpSZ2RSO.js +2760 -0
- package/dist/subagent-registry-DkCXRdwf.js +2759 -0
- package/dist/subagent-registry-MPrTYaEB.js +14 -0
- package/dist/subsystem-Dowf8fSU.js +860 -0
- package/dist/system-cli-4Urk9KV1.js +79 -0
- package/dist/system-cli-CgMzkg8R.js +82 -0
- package/dist/system-run-command-DGk7dwQP.js +93 -0
- package/dist/system-run-command-X9lDJIy0.js +93 -0
- package/dist/systemd-BSrHDyeU.js +452 -0
- package/dist/systemd-By5xdSB4.js +452 -0
- package/dist/systemd-hints-BtjL_5Rh.js +36 -0
- package/dist/systemd-hints-sJmr6cjb.js +36 -0
- package/dist/systemd-linger-BNz8PXPF.js +75 -0
- package/dist/systemd-linger-D5vLilKH.js +75 -0
- package/dist/table-BL0lJzsm.js +279 -0
- package/dist/table-DoiRPsn0.js +279 -0
- package/dist/tailnet-CuiNECdL.js +42 -0
- package/dist/tailnet-__ODlBOT.js +42 -0
- package/dist/templates-DJ0ii6X2.js +47 -0
- package/dist/templates-DPTs18po.js +47 -0
- package/dist/thinking-BLU0jXR8.js +204 -0
- package/dist/thinking-BXEswx1X.js +204 -0
- package/dist/timeout-CswI_K-U.js +232 -0
- package/dist/tokens-C-X7wDKj.js +14 -0
- package/dist/tokens-DkvqA72p.js +14 -0
- package/dist/transcript-events-C1hdue6u.js +17 -0
- package/dist/transcript-events-C8Tqw4td.js +17 -0
- package/dist/transcript-events-DW_H__a1.js +17 -0
- package/dist/transcript-tools-DtE5di1q.js +108 -0
- package/dist/transcript-tools-DuyYOkUq.js +108 -0
- package/dist/trash-BJLK1vMn.js +23 -0
- package/dist/trash-_x5UZ94k.js +23 -0
- package/dist/tui-Cj25a9wc.js +3894 -0
- package/dist/tui-Iv4T-9gg.js +3894 -0
- package/dist/tui-cli-BkJxFa_n.js +50 -0
- package/dist/tui-cli-DeFmBtZ7.js +47 -0
- package/dist/update-DZRKbMjq.js +317 -0
- package/dist/update-LFgxHHPd.js +317 -0
- package/dist/update-check-CWc7YXmc.js +400 -0
- package/dist/update-check-IhlWaui6.js +400 -0
- package/dist/update-cli-qGGlL5Lg.js +1105 -0
- package/dist/update-cli-rMqhSUMc.js +1105 -0
- package/dist/update-runner-BT77y3bz.js +894 -0
- package/dist/update-runner-DvzFqFJf.js +894 -0
- package/dist/usage-BeZuVAY4.js +4516 -0
- package/dist/usage-format-BAirWUSO.js +36 -0
- package/dist/usage-format-CpORtVCG.js +36 -0
- package/dist/utils-Bsw__U-F.js +243 -0
- package/dist/utils-C9sj30YY.js +239 -0
- package/dist/warning-filter.js +48 -0
- package/dist/web-DEx7MMYq.js +2203 -0
- package/dist/web-DHSoj6bL.js +46842 -0
- package/dist/web-DI0g5K4c.js +63 -0
- package/dist/webhooks-cli-sfLRE89X.js +319 -0
- package/dist/webhooks-cli-xtZBlaD1.js +316 -0
- package/dist/whatsapp-actions-DIREhxrq.js +49 -0
- package/dist/whatsapp-actions-TGHl9p4i.js +45 -0
- package/dist/whatsapp-actions-dBHozeuk.js +53 -0
- package/dist/widearea-dns-B6ocX23x.js +127 -0
- package/dist/widearea-dns-NsEUNYwz.js +127 -0
- package/dist/workspace-Dcfoy5JJ.js +649 -0
- package/dist/ws-COSqlEPx.js +218 -0
- package/dist/ws-log-N8R5MvGE.js +267 -0
- package/dist/ws-log-gwFxPxj5.js +267 -0
- package/dist/wsl-CqyuRvtM.js +26 -0
- package/dist/wsl-ymJYvc9Q.js +26 -0
- package/package.json +209 -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/animahub/SKILL.md +77 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +96 -0
- package/skills/audit/SKILL.md +68 -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/coding-agent/SKILL.md +284 -0
- package/skills/deploy/SKILL.md +45 -0
- package/skills/discord/SKILL.md +160 -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/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/review/SKILL.md +58 -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
- package/templates/BRAIN.md +65 -0
- package/templates/GUT.md +44 -0
- package/templates/HEART.md +51 -0
- package/templates/MEMORY.md +66 -0
- package/templates/SHADOW.md +68 -0
- package/templates/SOUL.md +38 -0
- package/templates/SPIRIT.md +43 -0
|
@@ -0,0 +1,2545 @@
|
|
|
1
|
+
import { A as colorize, M as theme, R as CONFIG_PATH, j as isRich$1 } from "./entry.js";
|
|
2
|
+
import { Dt as DEFAULT_PROVIDER, E as buildModelAliasIndex, Et as DEFAULT_MODEL, F as resolveConfiguredModelRef, I as resolveDefaultModelForAgent, M as parseModelRef, Ot as resolveAuthProfileDisplayLabel, R as resolveModelRefFromString, Tt as DEFAULT_CONTEXT_TOKENS, at as resolveApiKeyForProvider, b as resolveAnimaAgentDir, d as listProfilesForProvider, dt as getShellEnvAppliedKeys, f as setAuthProfileOrder, gt as shouldEnableShellEnvFallback, h as ensureAuthProfileStore, i as resolveProfileUnusableUntilForDisplay, j as normalizeProviderId, k as modelKey, n as resolveAuthProfileOrder, ot as resolveAwsSdkEnvVarName, p as upsertAuthProfile, rt as getCustomProviderApiKey, st as resolveEnvApiKey, y as resolveAuthStorePathForDisplay } from "./auth-profiles-Cz2rxrav.js";
|
|
3
|
+
import { t as formatCliCommand } from "./command-format-Clp46jkj.js";
|
|
4
|
+
import { S as shortenHomePath } from "./utils-C9sj30YY.js";
|
|
5
|
+
import "./exec-BizYYQgP.js";
|
|
6
|
+
import { a as resolveAgentModelPrimary, c as resolveDefaultAgentId, i as resolveAgentModelFallbacksOverride, r as resolveAgentDir, s as resolveAgentWorkspaceDir, w as resolveDefaultAgentWorkspaceDir } from "./agent-scope-OZi7lb8S.js";
|
|
7
|
+
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-DsRqYJLy.js";
|
|
8
|
+
import "./skills-B5LQx4lT.js";
|
|
9
|
+
import "./manifest-registry-D4lM2RdV.js";
|
|
10
|
+
import { i as loadConfig, m as parseDurationMs, o as readConfigFileSnapshot } from "./config-CHc5qzaI.js";
|
|
11
|
+
import "./client-C1avc0vD.js";
|
|
12
|
+
import "./call-ktoEhkOQ.js";
|
|
13
|
+
import "./message-channel-w4F2b2F6.js";
|
|
14
|
+
import { g as runEmbeddedPiAgent } from "./timeout-CswI_K-U.js";
|
|
15
|
+
import "./sessions-D0Zd1CND.js";
|
|
16
|
+
import "./subagent-registry-DkCXRdwf.js";
|
|
17
|
+
import "./logging-BdnOSVPD.js";
|
|
18
|
+
import "./accounts-CcVrwKqv.js";
|
|
19
|
+
import { c as loadProviderUsageSummary, d as resolveUsageProviderId, u as formatUsageWindowSummary } from "./reply-Clj5jcM5.js";
|
|
20
|
+
import "./plugins-CDJw924T.js";
|
|
21
|
+
import "./tokens-C-X7wDKj.js";
|
|
22
|
+
import "./dock-DbxBBv30.js";
|
|
23
|
+
import { i as resolveSessionTranscriptPath, s as resolveSessionTranscriptsDirForAgent } from "./paths-CxRf2rBG.js";
|
|
24
|
+
import "./chunk-mxPVo000.js";
|
|
25
|
+
import "./media-THyainiE.js";
|
|
26
|
+
import "./mime-B1ZoR53M.js";
|
|
27
|
+
import "./image-ops-Dlt3T7th.js";
|
|
28
|
+
import "./common-D6bu0zHC.js";
|
|
29
|
+
import "./server-context-BznDS2td.js";
|
|
30
|
+
import "./chrome-Bi6iZ5sG.js";
|
|
31
|
+
import "./auth-lZ26wsbN.js";
|
|
32
|
+
import "./ports-CqLSlU6Z.js";
|
|
33
|
+
import "./trash-BJLK1vMn.js";
|
|
34
|
+
import "./control-service-vyKJ-XUp.js";
|
|
35
|
+
import { A as describeFailoverError, Yt as loadModelCatalog, tt as resolveModel } from "./cli-session-oXJQpenl.js";
|
|
36
|
+
import "./thinking-BXEswx1X.js";
|
|
37
|
+
import { n as ensureAnimaModelsJson } from "./context-DKaQYnCH.js";
|
|
38
|
+
import "./sandbox-D3CFkNeF.js";
|
|
39
|
+
import "./routes-CXpne1-p.js";
|
|
40
|
+
import "./paths-DcVEkYX5.js";
|
|
41
|
+
import "./commands-registry-Bd0xbvwG.js";
|
|
42
|
+
import "./deliver-bC6iI_rv.js";
|
|
43
|
+
import "./pairing-store-DqQPqRMe.js";
|
|
44
|
+
import "./nodes-screen-DZeD8hE5.js";
|
|
45
|
+
import "./memory-cli-BoXdfCLT.js";
|
|
46
|
+
import "./manager-Bsy9ifug.js";
|
|
47
|
+
import "./sqlite-BukcjdJa.js";
|
|
48
|
+
import "./redact-ClVwO7Nn.js";
|
|
49
|
+
import "./links-BfjHVTB_.js";
|
|
50
|
+
import { r as withProgressTotals } from "./progress-CbZ2D53A.js";
|
|
51
|
+
import "./dispatcher-Bkcui7jz.js";
|
|
52
|
+
import "./channel-selection-DfGpCyh2.js";
|
|
53
|
+
import "./delivery-queue-B6IHz4Ry.js";
|
|
54
|
+
import "./pi-tools.policy-DRDm3v-2.js";
|
|
55
|
+
import "./session-cost-usage-BwiTZuKl.js";
|
|
56
|
+
import { n as stylePromptMessage, r as stylePromptTitle, t as stylePromptHint } from "./prompt-style-DKy6qQxR.js";
|
|
57
|
+
import "./note-uiuPxhyX.js";
|
|
58
|
+
import { t as createClackPrompter } from "./clack-prompter-B0kl7shw.js";
|
|
59
|
+
import { d as openUrl } from "./onboard-helpers-f5Zprayl.js";
|
|
60
|
+
import { t as renderTable } from "./table-DoiRPsn0.js";
|
|
61
|
+
import { _ as applyAuthProfileConfig, a as resolveProviderMatch, c as resolvePluginProviders, i as pickAuthMethod, kt as validateAnthropicSetupToken, n as applyDefaultModel, o as createVpsAwareOAuthHandlers, r as mergeConfigPatch, s as isRemoteEnvironment, t as githubCopilotLoginCommand } from "./github-copilot-auth-D6ZErYqa.js";
|
|
62
|
+
import { a as normalizeAlias, c as updateConfig, i as isLocalBaseUrl, n as formatMs, o as resolveKnownAgentId, r as formatTokenK, s as resolveModelTarget, t as ensureFlagCompatibility } from "./shared-DAHxpviD.js";
|
|
63
|
+
import { n as logConfigUpdated } from "./logging-DB6BQmhi.js";
|
|
64
|
+
import { t as inferParamBFromIdOrName } from "./model-param-b-DPwyNGn8.js";
|
|
65
|
+
import { n as redactSecrets } from "./format-Mq6iU0_5.js";
|
|
66
|
+
import { n as buildAuthHealthSummary, r as formatRemainingShort, t as DEFAULT_OAUTH_WARN_MS } from "./auth-health-DoHai4eD.js";
|
|
67
|
+
import path from "node:path";
|
|
68
|
+
import fs from "node:fs/promises";
|
|
69
|
+
import { complete, getEnvApiKey, getModel } from "@mariozechner/pi-ai";
|
|
70
|
+
import crypto from "node:crypto";
|
|
71
|
+
import { Type } from "@sinclair/typebox";
|
|
72
|
+
import { cancel, confirm, isCancel, multiselect, select, text } from "@clack/prompts";
|
|
73
|
+
|
|
74
|
+
//#region src/commands/models/aliases.ts
|
|
75
|
+
async function modelsAliasesListCommand(opts, runtime) {
|
|
76
|
+
ensureFlagCompatibility(opts);
|
|
77
|
+
const models = loadConfig().agents?.defaults?.models ?? {};
|
|
78
|
+
const aliases = Object.entries(models).reduce((acc, [modelKey, entry]) => {
|
|
79
|
+
const alias = entry?.alias?.trim();
|
|
80
|
+
if (alias) acc[alias] = modelKey;
|
|
81
|
+
return acc;
|
|
82
|
+
}, {});
|
|
83
|
+
if (opts.json) {
|
|
84
|
+
runtime.log(JSON.stringify({ aliases }, null, 2));
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (opts.plain) {
|
|
88
|
+
for (const [alias, target] of Object.entries(aliases)) runtime.log(`${alias} ${target}`);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
runtime.log(`Aliases (${Object.keys(aliases).length}):`);
|
|
92
|
+
if (Object.keys(aliases).length === 0) {
|
|
93
|
+
runtime.log("- none");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
for (const [alias, target] of Object.entries(aliases)) runtime.log(`- ${alias} -> ${target}`);
|
|
97
|
+
}
|
|
98
|
+
async function modelsAliasesAddCommand(aliasRaw, modelRaw, runtime) {
|
|
99
|
+
const alias = normalizeAlias(aliasRaw);
|
|
100
|
+
const resolved = resolveModelTarget({
|
|
101
|
+
raw: modelRaw,
|
|
102
|
+
cfg: loadConfig()
|
|
103
|
+
});
|
|
104
|
+
await updateConfig((cfg) => {
|
|
105
|
+
const modelKey = `${resolved.provider}/${resolved.model}`;
|
|
106
|
+
const nextModels = { ...cfg.agents?.defaults?.models };
|
|
107
|
+
for (const [key, entry] of Object.entries(nextModels)) {
|
|
108
|
+
const existing = entry?.alias?.trim();
|
|
109
|
+
if (existing && existing === alias && key !== modelKey) throw new Error(`Alias ${alias} already points to ${key}.`);
|
|
110
|
+
}
|
|
111
|
+
nextModels[modelKey] = {
|
|
112
|
+
...nextModels[modelKey] ?? {},
|
|
113
|
+
alias
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
...cfg,
|
|
117
|
+
agents: {
|
|
118
|
+
...cfg.agents,
|
|
119
|
+
defaults: {
|
|
120
|
+
...cfg.agents?.defaults,
|
|
121
|
+
models: nextModels
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
logConfigUpdated(runtime);
|
|
127
|
+
runtime.log(`Alias ${alias} -> ${resolved.provider}/${resolved.model}`);
|
|
128
|
+
}
|
|
129
|
+
async function modelsAliasesRemoveCommand(aliasRaw, runtime) {
|
|
130
|
+
const alias = normalizeAlias(aliasRaw);
|
|
131
|
+
const updated = await updateConfig((cfg) => {
|
|
132
|
+
const nextModels = { ...cfg.agents?.defaults?.models };
|
|
133
|
+
let found = false;
|
|
134
|
+
for (const [key, entry] of Object.entries(nextModels)) if (entry?.alias?.trim() === alias) {
|
|
135
|
+
nextModels[key] = {
|
|
136
|
+
...entry,
|
|
137
|
+
alias: void 0
|
|
138
|
+
};
|
|
139
|
+
found = true;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
if (!found) throw new Error(`Alias not found: ${alias}`);
|
|
143
|
+
return {
|
|
144
|
+
...cfg,
|
|
145
|
+
agents: {
|
|
146
|
+
...cfg.agents,
|
|
147
|
+
defaults: {
|
|
148
|
+
...cfg.agents?.defaults,
|
|
149
|
+
models: nextModels
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
logConfigUpdated(runtime);
|
|
155
|
+
if (!updated.agents?.defaults?.models || Object.values(updated.agents.defaults.models).every((entry) => !entry?.alias?.trim())) runtime.log("No aliases configured.");
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/commands/models/auth.ts
|
|
160
|
+
const confirm$1 = (params) => confirm({
|
|
161
|
+
...params,
|
|
162
|
+
message: stylePromptMessage(params.message)
|
|
163
|
+
});
|
|
164
|
+
const text$1 = (params) => text({
|
|
165
|
+
...params,
|
|
166
|
+
message: stylePromptMessage(params.message)
|
|
167
|
+
});
|
|
168
|
+
const select$1 = (params) => select({
|
|
169
|
+
...params,
|
|
170
|
+
message: stylePromptMessage(params.message),
|
|
171
|
+
options: params.options.map((opt) => opt.hint === void 0 ? opt : {
|
|
172
|
+
...opt,
|
|
173
|
+
hint: stylePromptHint(opt.hint)
|
|
174
|
+
})
|
|
175
|
+
});
|
|
176
|
+
function resolveTokenProvider(raw) {
|
|
177
|
+
const trimmed = raw?.trim();
|
|
178
|
+
if (!trimmed) return null;
|
|
179
|
+
if (normalizeProviderId(trimmed) === "anthropic") return "anthropic";
|
|
180
|
+
return "custom";
|
|
181
|
+
}
|
|
182
|
+
function resolveDefaultTokenProfileId(provider) {
|
|
183
|
+
return `${normalizeProviderId(provider)}:manual`;
|
|
184
|
+
}
|
|
185
|
+
async function modelsAuthSetupTokenCommand(opts, runtime) {
|
|
186
|
+
const provider = resolveTokenProvider(opts.provider ?? "anthropic");
|
|
187
|
+
if (provider !== "anthropic") throw new Error("Only --provider anthropic is supported for setup-token.");
|
|
188
|
+
if (!process.stdin.isTTY) throw new Error("setup-token requires an interactive TTY.");
|
|
189
|
+
if (!opts.yes) {
|
|
190
|
+
if (!await confirm$1({
|
|
191
|
+
message: "Have you run `claude setup-token` and copied the token?",
|
|
192
|
+
initialValue: true
|
|
193
|
+
})) return;
|
|
194
|
+
}
|
|
195
|
+
const tokenInput = await text$1({
|
|
196
|
+
message: "Paste Anthropic setup-token",
|
|
197
|
+
validate: (value) => validateAnthropicSetupToken(String(value ?? ""))
|
|
198
|
+
});
|
|
199
|
+
const token = String(tokenInput ?? "").trim();
|
|
200
|
+
const profileId = resolveDefaultTokenProfileId(provider);
|
|
201
|
+
upsertAuthProfile({
|
|
202
|
+
profileId,
|
|
203
|
+
credential: {
|
|
204
|
+
type: "token",
|
|
205
|
+
provider,
|
|
206
|
+
token
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
await updateConfig((cfg) => applyAuthProfileConfig(cfg, {
|
|
210
|
+
profileId,
|
|
211
|
+
provider,
|
|
212
|
+
mode: "token"
|
|
213
|
+
}));
|
|
214
|
+
logConfigUpdated(runtime);
|
|
215
|
+
runtime.log(`Auth profile: ${profileId} (${provider}/token)`);
|
|
216
|
+
}
|
|
217
|
+
async function modelsAuthPasteTokenCommand(opts, runtime) {
|
|
218
|
+
const rawProvider = opts.provider?.trim();
|
|
219
|
+
if (!rawProvider) throw new Error("Missing --provider.");
|
|
220
|
+
const provider = normalizeProviderId(rawProvider);
|
|
221
|
+
const profileId = opts.profileId?.trim() || resolveDefaultTokenProfileId(provider);
|
|
222
|
+
const tokenInput = await text$1({
|
|
223
|
+
message: `Paste token for ${provider}`,
|
|
224
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
225
|
+
});
|
|
226
|
+
const token = String(tokenInput ?? "").trim();
|
|
227
|
+
const expires = opts.expiresIn?.trim() && opts.expiresIn.trim().length > 0 ? Date.now() + parseDurationMs(String(opts.expiresIn ?? "").trim(), { defaultUnit: "d" }) : void 0;
|
|
228
|
+
upsertAuthProfile({
|
|
229
|
+
profileId,
|
|
230
|
+
credential: {
|
|
231
|
+
type: "token",
|
|
232
|
+
provider,
|
|
233
|
+
token,
|
|
234
|
+
...expires ? { expires } : {}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
await updateConfig((cfg) => applyAuthProfileConfig(cfg, {
|
|
238
|
+
profileId,
|
|
239
|
+
provider,
|
|
240
|
+
mode: "token"
|
|
241
|
+
}));
|
|
242
|
+
logConfigUpdated(runtime);
|
|
243
|
+
runtime.log(`Auth profile: ${profileId} (${provider}/token)`);
|
|
244
|
+
}
|
|
245
|
+
async function modelsAuthAddCommand(_opts, runtime) {
|
|
246
|
+
const provider = await select$1({
|
|
247
|
+
message: "Token provider",
|
|
248
|
+
options: [{
|
|
249
|
+
value: "anthropic",
|
|
250
|
+
label: "anthropic"
|
|
251
|
+
}, {
|
|
252
|
+
value: "custom",
|
|
253
|
+
label: "custom (type provider id)"
|
|
254
|
+
}]
|
|
255
|
+
});
|
|
256
|
+
const providerId = provider === "custom" ? normalizeProviderId(String(await text$1({
|
|
257
|
+
message: "Provider id",
|
|
258
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
259
|
+
}))) : provider;
|
|
260
|
+
if (await select$1({
|
|
261
|
+
message: "Token method",
|
|
262
|
+
options: [...providerId === "anthropic" ? [{
|
|
263
|
+
value: "setup-token",
|
|
264
|
+
label: "setup-token (claude)",
|
|
265
|
+
hint: "Paste a setup-token from `claude setup-token`"
|
|
266
|
+
}] : [], {
|
|
267
|
+
value: "paste",
|
|
268
|
+
label: "paste token"
|
|
269
|
+
}]
|
|
270
|
+
}) === "setup-token") {
|
|
271
|
+
await modelsAuthSetupTokenCommand({ provider: providerId }, runtime);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const profileIdDefault = resolveDefaultTokenProfileId(providerId);
|
|
275
|
+
await modelsAuthPasteTokenCommand({
|
|
276
|
+
provider: providerId,
|
|
277
|
+
profileId: String(await text$1({
|
|
278
|
+
message: "Profile id",
|
|
279
|
+
initialValue: profileIdDefault,
|
|
280
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
281
|
+
})).trim(),
|
|
282
|
+
expiresIn: await confirm$1({
|
|
283
|
+
message: "Does this token expire?",
|
|
284
|
+
initialValue: false
|
|
285
|
+
}) ? String(await text$1({
|
|
286
|
+
message: "Expires in (duration)",
|
|
287
|
+
initialValue: "365d",
|
|
288
|
+
validate: (value) => {
|
|
289
|
+
try {
|
|
290
|
+
parseDurationMs(String(value ?? ""), { defaultUnit: "d" });
|
|
291
|
+
return;
|
|
292
|
+
} catch {
|
|
293
|
+
return "Invalid duration (e.g. 365d, 12h, 30m)";
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
})).trim() : void 0
|
|
297
|
+
}, runtime);
|
|
298
|
+
}
|
|
299
|
+
function resolveRequestedLoginProviderOrThrow(providers, rawProvider) {
|
|
300
|
+
const requested = rawProvider?.trim();
|
|
301
|
+
if (!requested) return null;
|
|
302
|
+
const matched = resolveProviderMatch(providers, requested);
|
|
303
|
+
if (matched) return matched;
|
|
304
|
+
const available = providers.map((provider) => provider.id).filter(Boolean).toSorted((a, b) => a.localeCompare(b));
|
|
305
|
+
const availableText = available.length > 0 ? available.join(", ") : "(none)";
|
|
306
|
+
throw new Error(`Unknown provider "${requested}". Loaded providers: ${availableText}. Verify plugins via \`${formatCliCommand("anima plugins list --json")}\`.`);
|
|
307
|
+
}
|
|
308
|
+
function credentialMode(credential) {
|
|
309
|
+
if (credential.type === "api_key") return "api_key";
|
|
310
|
+
if (credential.type === "token") return "token";
|
|
311
|
+
return "oauth";
|
|
312
|
+
}
|
|
313
|
+
async function modelsAuthLoginCommand(opts, runtime) {
|
|
314
|
+
if (!process.stdin.isTTY) throw new Error("models auth login requires an interactive TTY.");
|
|
315
|
+
const snapshot = await readConfigFileSnapshot();
|
|
316
|
+
if (!snapshot.valid) {
|
|
317
|
+
const issues = snapshot.issues.map((issue) => `- ${issue.path}: ${issue.message}`).join("\n");
|
|
318
|
+
throw new Error(`Invalid config at ${snapshot.path}\n${issues}`);
|
|
319
|
+
}
|
|
320
|
+
const config = snapshot.config;
|
|
321
|
+
const defaultAgentId = resolveDefaultAgentId(config);
|
|
322
|
+
const agentDir = resolveAgentDir(config, defaultAgentId);
|
|
323
|
+
const workspaceDir = resolveAgentWorkspaceDir(config, defaultAgentId) ?? resolveDefaultAgentWorkspaceDir();
|
|
324
|
+
const providers = resolvePluginProviders({
|
|
325
|
+
config,
|
|
326
|
+
workspaceDir
|
|
327
|
+
});
|
|
328
|
+
if (providers.length === 0) throw new Error(`No provider plugins found. Install one via \`${formatCliCommand("anima plugins install")}\`.`);
|
|
329
|
+
const prompter = createClackPrompter();
|
|
330
|
+
const selectedProvider = resolveRequestedLoginProviderOrThrow(providers, opts.provider) ?? await prompter.select({
|
|
331
|
+
message: "Select a provider",
|
|
332
|
+
options: providers.map((provider) => ({
|
|
333
|
+
value: provider.id,
|
|
334
|
+
label: provider.label,
|
|
335
|
+
hint: provider.docsPath ? `Docs: ${provider.docsPath}` : void 0
|
|
336
|
+
}))
|
|
337
|
+
}).then((id) => resolveProviderMatch(providers, String(id)));
|
|
338
|
+
if (!selectedProvider) throw new Error("Unknown provider. Use --provider <id> to pick a provider plugin.");
|
|
339
|
+
const chosenMethod = pickAuthMethod(selectedProvider, opts.method) ?? (selectedProvider.auth.length === 1 ? selectedProvider.auth[0] : await prompter.select({
|
|
340
|
+
message: `Auth method for ${selectedProvider.label}`,
|
|
341
|
+
options: selectedProvider.auth.map((method) => ({
|
|
342
|
+
value: method.id,
|
|
343
|
+
label: method.label,
|
|
344
|
+
hint: method.hint
|
|
345
|
+
}))
|
|
346
|
+
}).then((id) => selectedProvider.auth.find((method) => method.id === String(id))));
|
|
347
|
+
if (!chosenMethod) throw new Error("Unknown auth method. Use --method <id> to select one.");
|
|
348
|
+
const isRemote = isRemoteEnvironment();
|
|
349
|
+
const result = await chosenMethod.run({
|
|
350
|
+
config,
|
|
351
|
+
agentDir,
|
|
352
|
+
workspaceDir,
|
|
353
|
+
prompter,
|
|
354
|
+
runtime,
|
|
355
|
+
isRemote,
|
|
356
|
+
openUrl: async (url) => {
|
|
357
|
+
await openUrl(url);
|
|
358
|
+
},
|
|
359
|
+
oauth: { createVpsAwareHandlers: (params) => createVpsAwareOAuthHandlers(params) }
|
|
360
|
+
});
|
|
361
|
+
for (const profile of result.profiles) upsertAuthProfile({
|
|
362
|
+
profileId: profile.profileId,
|
|
363
|
+
credential: profile.credential,
|
|
364
|
+
agentDir
|
|
365
|
+
});
|
|
366
|
+
await updateConfig((cfg) => {
|
|
367
|
+
let next = cfg;
|
|
368
|
+
if (result.configPatch) next = mergeConfigPatch(next, result.configPatch);
|
|
369
|
+
for (const profile of result.profiles) next = applyAuthProfileConfig(next, {
|
|
370
|
+
profileId: profile.profileId,
|
|
371
|
+
provider: profile.credential.provider,
|
|
372
|
+
mode: credentialMode(profile.credential)
|
|
373
|
+
});
|
|
374
|
+
if (opts.setDefault && result.defaultModel) next = applyDefaultModel(next, result.defaultModel);
|
|
375
|
+
return next;
|
|
376
|
+
});
|
|
377
|
+
logConfigUpdated(runtime);
|
|
378
|
+
for (const profile of result.profiles) runtime.log(`Auth profile: ${profile.profileId} (${profile.credential.provider}/${credentialMode(profile.credential)})`);
|
|
379
|
+
if (result.defaultModel) runtime.log(opts.setDefault ? `Default model set to ${result.defaultModel}` : `Default model available: ${result.defaultModel} (use --set-default to apply)`);
|
|
380
|
+
if (result.notes && result.notes.length > 0) await prompter.note(result.notes.join("\n"), "Provider notes");
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region src/commands/models/auth-order.ts
|
|
385
|
+
function resolveTargetAgent(cfg, raw) {
|
|
386
|
+
const agentId = resolveKnownAgentId({
|
|
387
|
+
cfg,
|
|
388
|
+
rawAgentId: raw
|
|
389
|
+
}) ?? resolveDefaultAgentId(cfg);
|
|
390
|
+
return {
|
|
391
|
+
agentId,
|
|
392
|
+
agentDir: resolveAgentDir(cfg, agentId)
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
function describeOrder(store, provider) {
|
|
396
|
+
const providerKey = normalizeProviderId(provider);
|
|
397
|
+
const order = store.order?.[providerKey];
|
|
398
|
+
return Array.isArray(order) ? order : [];
|
|
399
|
+
}
|
|
400
|
+
async function modelsAuthOrderGetCommand(opts, runtime) {
|
|
401
|
+
const rawProvider = opts.provider?.trim();
|
|
402
|
+
if (!rawProvider) throw new Error("Missing --provider.");
|
|
403
|
+
const provider = normalizeProviderId(rawProvider);
|
|
404
|
+
const { agentId, agentDir } = resolveTargetAgent(loadConfig(), opts.agent);
|
|
405
|
+
const order = describeOrder(ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false }), provider);
|
|
406
|
+
if (opts.json) {
|
|
407
|
+
runtime.log(JSON.stringify({
|
|
408
|
+
agentId,
|
|
409
|
+
agentDir,
|
|
410
|
+
provider,
|
|
411
|
+
authStorePath: shortenHomePath(`${agentDir}/auth-profiles.json`),
|
|
412
|
+
order: order.length > 0 ? order : null
|
|
413
|
+
}, null, 2));
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
runtime.log(`Agent: ${agentId}`);
|
|
417
|
+
runtime.log(`Provider: ${provider}`);
|
|
418
|
+
runtime.log(`Auth file: ${shortenHomePath(`${agentDir}/auth-profiles.json`)}`);
|
|
419
|
+
runtime.log(order.length > 0 ? `Order override: ${order.join(", ")}` : "Order override: (none)");
|
|
420
|
+
}
|
|
421
|
+
async function modelsAuthOrderClearCommand(opts, runtime) {
|
|
422
|
+
const rawProvider = opts.provider?.trim();
|
|
423
|
+
if (!rawProvider) throw new Error("Missing --provider.");
|
|
424
|
+
const provider = normalizeProviderId(rawProvider);
|
|
425
|
+
const { agentId, agentDir } = resolveTargetAgent(loadConfig(), opts.agent);
|
|
426
|
+
if (!await setAuthProfileOrder({
|
|
427
|
+
agentDir,
|
|
428
|
+
provider,
|
|
429
|
+
order: null
|
|
430
|
+
})) throw new Error("Failed to update auth-profiles.json (lock busy?).");
|
|
431
|
+
runtime.log(`Agent: ${agentId}`);
|
|
432
|
+
runtime.log(`Provider: ${provider}`);
|
|
433
|
+
runtime.log("Cleared per-agent order override.");
|
|
434
|
+
}
|
|
435
|
+
async function modelsAuthOrderSetCommand(opts, runtime) {
|
|
436
|
+
const rawProvider = opts.provider?.trim();
|
|
437
|
+
if (!rawProvider) throw new Error("Missing --provider.");
|
|
438
|
+
const provider = normalizeProviderId(rawProvider);
|
|
439
|
+
const { agentId, agentDir } = resolveTargetAgent(loadConfig(), opts.agent);
|
|
440
|
+
const store = ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false });
|
|
441
|
+
const providerKey = normalizeProviderId(provider);
|
|
442
|
+
const requested = (opts.order ?? []).map((entry) => String(entry).trim()).filter(Boolean);
|
|
443
|
+
if (requested.length === 0) throw new Error("Missing profile ids. Provide one or more profile ids.");
|
|
444
|
+
for (const profileId of requested) {
|
|
445
|
+
const cred = store.profiles[profileId];
|
|
446
|
+
if (!cred) throw new Error(`Auth profile "${profileId}" not found in ${agentDir}.`);
|
|
447
|
+
if (normalizeProviderId(cred.provider) !== providerKey) throw new Error(`Auth profile "${profileId}" is for ${cred.provider}, not ${provider}.`);
|
|
448
|
+
}
|
|
449
|
+
const updated = await setAuthProfileOrder({
|
|
450
|
+
agentDir,
|
|
451
|
+
provider,
|
|
452
|
+
order: requested
|
|
453
|
+
});
|
|
454
|
+
if (!updated) throw new Error("Failed to update auth-profiles.json (lock busy?).");
|
|
455
|
+
runtime.log(`Agent: ${agentId}`);
|
|
456
|
+
runtime.log(`Provider: ${provider}`);
|
|
457
|
+
runtime.log(`Order override: ${describeOrder(updated, provider).join(", ")}`);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region src/commands/models/fallbacks.ts
|
|
462
|
+
async function modelsFallbacksListCommand(opts, runtime) {
|
|
463
|
+
ensureFlagCompatibility(opts);
|
|
464
|
+
const fallbacks = loadConfig().agents?.defaults?.model?.fallbacks ?? [];
|
|
465
|
+
if (opts.json) {
|
|
466
|
+
runtime.log(JSON.stringify({ fallbacks }, null, 2));
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (opts.plain) {
|
|
470
|
+
for (const entry of fallbacks) runtime.log(entry);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
runtime.log(`Fallbacks (${fallbacks.length}):`);
|
|
474
|
+
if (fallbacks.length === 0) {
|
|
475
|
+
runtime.log("- none");
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
for (const entry of fallbacks) runtime.log(`- ${entry}`);
|
|
479
|
+
}
|
|
480
|
+
async function modelsFallbacksAddCommand(modelRaw, runtime) {
|
|
481
|
+
const updated = await updateConfig((cfg) => {
|
|
482
|
+
const resolved = resolveModelTarget({
|
|
483
|
+
raw: modelRaw,
|
|
484
|
+
cfg
|
|
485
|
+
});
|
|
486
|
+
const targetKey = modelKey(resolved.provider, resolved.model);
|
|
487
|
+
const nextModels = { ...cfg.agents?.defaults?.models };
|
|
488
|
+
if (!nextModels[targetKey]) nextModels[targetKey] = {};
|
|
489
|
+
const aliasIndex = buildModelAliasIndex({
|
|
490
|
+
cfg,
|
|
491
|
+
defaultProvider: DEFAULT_PROVIDER
|
|
492
|
+
});
|
|
493
|
+
const existing = cfg.agents?.defaults?.model?.fallbacks ?? [];
|
|
494
|
+
if (existing.map((entry) => resolveModelRefFromString({
|
|
495
|
+
raw: String(entry ?? ""),
|
|
496
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
497
|
+
aliasIndex
|
|
498
|
+
})).filter((entry) => Boolean(entry)).map((entry) => modelKey(entry.ref.provider, entry.ref.model)).includes(targetKey)) return cfg;
|
|
499
|
+
const existingModel = cfg.agents?.defaults?.model;
|
|
500
|
+
return {
|
|
501
|
+
...cfg,
|
|
502
|
+
agents: {
|
|
503
|
+
...cfg.agents,
|
|
504
|
+
defaults: {
|
|
505
|
+
...cfg.agents?.defaults,
|
|
506
|
+
model: {
|
|
507
|
+
...existingModel?.primary ? { primary: existingModel.primary } : void 0,
|
|
508
|
+
fallbacks: [...existing, targetKey]
|
|
509
|
+
},
|
|
510
|
+
models: nextModels
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
});
|
|
515
|
+
logConfigUpdated(runtime);
|
|
516
|
+
runtime.log(`Fallbacks: ${(updated.agents?.defaults?.model?.fallbacks ?? []).join(", ")}`);
|
|
517
|
+
}
|
|
518
|
+
async function modelsFallbacksRemoveCommand(modelRaw, runtime) {
|
|
519
|
+
const updated = await updateConfig((cfg) => {
|
|
520
|
+
const resolved = resolveModelTarget({
|
|
521
|
+
raw: modelRaw,
|
|
522
|
+
cfg
|
|
523
|
+
});
|
|
524
|
+
const targetKey = modelKey(resolved.provider, resolved.model);
|
|
525
|
+
const aliasIndex = buildModelAliasIndex({
|
|
526
|
+
cfg,
|
|
527
|
+
defaultProvider: DEFAULT_PROVIDER
|
|
528
|
+
});
|
|
529
|
+
const existing = cfg.agents?.defaults?.model?.fallbacks ?? [];
|
|
530
|
+
const filtered = existing.filter((entry) => {
|
|
531
|
+
const resolvedEntry = resolveModelRefFromString({
|
|
532
|
+
raw: String(entry ?? ""),
|
|
533
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
534
|
+
aliasIndex
|
|
535
|
+
});
|
|
536
|
+
if (!resolvedEntry) return true;
|
|
537
|
+
return modelKey(resolvedEntry.ref.provider, resolvedEntry.ref.model) !== targetKey;
|
|
538
|
+
});
|
|
539
|
+
if (filtered.length === existing.length) throw new Error(`Fallback not found: ${targetKey}`);
|
|
540
|
+
const existingModel = cfg.agents?.defaults?.model;
|
|
541
|
+
return {
|
|
542
|
+
...cfg,
|
|
543
|
+
agents: {
|
|
544
|
+
...cfg.agents,
|
|
545
|
+
defaults: {
|
|
546
|
+
...cfg.agents?.defaults,
|
|
547
|
+
model: {
|
|
548
|
+
...existingModel?.primary ? { primary: existingModel.primary } : void 0,
|
|
549
|
+
fallbacks: filtered
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
});
|
|
555
|
+
logConfigUpdated(runtime);
|
|
556
|
+
runtime.log(`Fallbacks: ${(updated.agents?.defaults?.model?.fallbacks ?? []).join(", ")}`);
|
|
557
|
+
}
|
|
558
|
+
async function modelsFallbacksClearCommand(runtime) {
|
|
559
|
+
await updateConfig((cfg) => {
|
|
560
|
+
const existingModel = cfg.agents?.defaults?.model;
|
|
561
|
+
return {
|
|
562
|
+
...cfg,
|
|
563
|
+
agents: {
|
|
564
|
+
...cfg.agents,
|
|
565
|
+
defaults: {
|
|
566
|
+
...cfg.agents?.defaults,
|
|
567
|
+
model: {
|
|
568
|
+
...existingModel?.primary ? { primary: existingModel.primary } : void 0,
|
|
569
|
+
fallbacks: []
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
});
|
|
575
|
+
logConfigUpdated(runtime);
|
|
576
|
+
runtime.log("Fallback list cleared.");
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/commands/models/image-fallbacks.ts
|
|
581
|
+
async function modelsImageFallbacksListCommand(opts, runtime) {
|
|
582
|
+
ensureFlagCompatibility(opts);
|
|
583
|
+
const fallbacks = loadConfig().agents?.defaults?.imageModel?.fallbacks ?? [];
|
|
584
|
+
if (opts.json) {
|
|
585
|
+
runtime.log(JSON.stringify({ fallbacks }, null, 2));
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
if (opts.plain) {
|
|
589
|
+
for (const entry of fallbacks) runtime.log(entry);
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
runtime.log(`Image fallbacks (${fallbacks.length}):`);
|
|
593
|
+
if (fallbacks.length === 0) {
|
|
594
|
+
runtime.log("- none");
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
for (const entry of fallbacks) runtime.log(`- ${entry}`);
|
|
598
|
+
}
|
|
599
|
+
async function modelsImageFallbacksAddCommand(modelRaw, runtime) {
|
|
600
|
+
const updated = await updateConfig((cfg) => {
|
|
601
|
+
const resolved = resolveModelTarget({
|
|
602
|
+
raw: modelRaw,
|
|
603
|
+
cfg
|
|
604
|
+
});
|
|
605
|
+
const targetKey = modelKey(resolved.provider, resolved.model);
|
|
606
|
+
const nextModels = { ...cfg.agents?.defaults?.models };
|
|
607
|
+
if (!nextModels[targetKey]) nextModels[targetKey] = {};
|
|
608
|
+
const aliasIndex = buildModelAliasIndex({
|
|
609
|
+
cfg,
|
|
610
|
+
defaultProvider: DEFAULT_PROVIDER
|
|
611
|
+
});
|
|
612
|
+
const existing = cfg.agents?.defaults?.imageModel?.fallbacks ?? [];
|
|
613
|
+
if (existing.map((entry) => resolveModelRefFromString({
|
|
614
|
+
raw: String(entry ?? ""),
|
|
615
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
616
|
+
aliasIndex
|
|
617
|
+
})).filter((entry) => Boolean(entry)).map((entry) => modelKey(entry.ref.provider, entry.ref.model)).includes(targetKey)) return cfg;
|
|
618
|
+
const existingModel = cfg.agents?.defaults?.imageModel;
|
|
619
|
+
return {
|
|
620
|
+
...cfg,
|
|
621
|
+
agents: {
|
|
622
|
+
...cfg.agents,
|
|
623
|
+
defaults: {
|
|
624
|
+
...cfg.agents?.defaults,
|
|
625
|
+
imageModel: {
|
|
626
|
+
...existingModel?.primary ? { primary: existingModel.primary } : void 0,
|
|
627
|
+
fallbacks: [...existing, targetKey]
|
|
628
|
+
},
|
|
629
|
+
models: nextModels
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
});
|
|
634
|
+
logConfigUpdated(runtime);
|
|
635
|
+
runtime.log(`Image fallbacks: ${(updated.agents?.defaults?.imageModel?.fallbacks ?? []).join(", ")}`);
|
|
636
|
+
}
|
|
637
|
+
async function modelsImageFallbacksRemoveCommand(modelRaw, runtime) {
|
|
638
|
+
const updated = await updateConfig((cfg) => {
|
|
639
|
+
const resolved = resolveModelTarget({
|
|
640
|
+
raw: modelRaw,
|
|
641
|
+
cfg
|
|
642
|
+
});
|
|
643
|
+
const targetKey = modelKey(resolved.provider, resolved.model);
|
|
644
|
+
const aliasIndex = buildModelAliasIndex({
|
|
645
|
+
cfg,
|
|
646
|
+
defaultProvider: DEFAULT_PROVIDER
|
|
647
|
+
});
|
|
648
|
+
const existing = cfg.agents?.defaults?.imageModel?.fallbacks ?? [];
|
|
649
|
+
const filtered = existing.filter((entry) => {
|
|
650
|
+
const resolvedEntry = resolveModelRefFromString({
|
|
651
|
+
raw: String(entry ?? ""),
|
|
652
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
653
|
+
aliasIndex
|
|
654
|
+
});
|
|
655
|
+
if (!resolvedEntry) return true;
|
|
656
|
+
return modelKey(resolvedEntry.ref.provider, resolvedEntry.ref.model) !== targetKey;
|
|
657
|
+
});
|
|
658
|
+
if (filtered.length === existing.length) throw new Error(`Image fallback not found: ${targetKey}`);
|
|
659
|
+
const existingModel = cfg.agents?.defaults?.imageModel;
|
|
660
|
+
return {
|
|
661
|
+
...cfg,
|
|
662
|
+
agents: {
|
|
663
|
+
...cfg.agents,
|
|
664
|
+
defaults: {
|
|
665
|
+
...cfg.agents?.defaults,
|
|
666
|
+
imageModel: {
|
|
667
|
+
...existingModel?.primary ? { primary: existingModel.primary } : void 0,
|
|
668
|
+
fallbacks: filtered
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
});
|
|
674
|
+
logConfigUpdated(runtime);
|
|
675
|
+
runtime.log(`Image fallbacks: ${(updated.agents?.defaults?.imageModel?.fallbacks ?? []).join(", ")}`);
|
|
676
|
+
}
|
|
677
|
+
async function modelsImageFallbacksClearCommand(runtime) {
|
|
678
|
+
await updateConfig((cfg) => {
|
|
679
|
+
const existingModel = cfg.agents?.defaults?.imageModel;
|
|
680
|
+
return {
|
|
681
|
+
...cfg,
|
|
682
|
+
agents: {
|
|
683
|
+
...cfg.agents,
|
|
684
|
+
defaults: {
|
|
685
|
+
...cfg.agents?.defaults,
|
|
686
|
+
imageModel: {
|
|
687
|
+
...existingModel?.primary ? { primary: existingModel.primary } : void 0,
|
|
688
|
+
fallbacks: []
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
});
|
|
694
|
+
logConfigUpdated(runtime);
|
|
695
|
+
runtime.log("Image fallback list cleared.");
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
//#endregion
|
|
699
|
+
//#region src/agents/model-compat.ts
|
|
700
|
+
function isOpenAiCompletionsModel(model) {
|
|
701
|
+
return model.api === "openai-completions";
|
|
702
|
+
}
|
|
703
|
+
function normalizeModelCompat(model) {
|
|
704
|
+
const baseUrl = model.baseUrl ?? "";
|
|
705
|
+
if (!(model.provider === "zai" || baseUrl.includes("api.z.ai")) || !isOpenAiCompletionsModel(model)) return model;
|
|
706
|
+
const openaiModel = model;
|
|
707
|
+
const compat = openaiModel.compat ?? void 0;
|
|
708
|
+
if (compat?.supportsDeveloperRole === false) return model;
|
|
709
|
+
openaiModel.compat = compat ? {
|
|
710
|
+
...compat,
|
|
711
|
+
supportsDeveloperRole: false
|
|
712
|
+
} : { supportsDeveloperRole: false };
|
|
713
|
+
return openaiModel;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/agents/model-forward-compat.ts
|
|
718
|
+
const OPENAI_CODEX_GPT_53_MODEL_ID = "gpt-5.3-codex";
|
|
719
|
+
const OPENAI_CODEX_TEMPLATE_MODEL_IDS = ["gpt-5.2-codex"];
|
|
720
|
+
const ANTHROPIC_OPUS_46_MODEL_ID = "claude-opus-4-6";
|
|
721
|
+
const ANTHROPIC_OPUS_46_DOT_MODEL_ID = "claude-opus-4.6";
|
|
722
|
+
const ANTHROPIC_OPUS_TEMPLATE_MODEL_IDS = ["claude-opus-4-5", "claude-opus-4.5"];
|
|
723
|
+
const ZAI_GLM5_MODEL_ID = "glm-5";
|
|
724
|
+
const ZAI_GLM5_TEMPLATE_MODEL_IDS = ["glm-4.7"];
|
|
725
|
+
const ANTIGRAVITY_OPUS_46_MODEL_ID = "claude-opus-4-6";
|
|
726
|
+
const ANTIGRAVITY_OPUS_46_DOT_MODEL_ID = "claude-opus-4.6";
|
|
727
|
+
const ANTIGRAVITY_OPUS_TEMPLATE_MODEL_IDS = ["claude-opus-4-5", "claude-opus-4.5"];
|
|
728
|
+
const ANTIGRAVITY_OPUS_46_THINKING_MODEL_ID = "claude-opus-4-6-thinking";
|
|
729
|
+
const ANTIGRAVITY_OPUS_46_DOT_THINKING_MODEL_ID = "claude-opus-4.6-thinking";
|
|
730
|
+
const ANTIGRAVITY_OPUS_THINKING_TEMPLATE_MODEL_IDS = ["claude-opus-4-5-thinking", "claude-opus-4.5-thinking"];
|
|
731
|
+
const ANTIGRAVITY_OPUS_46_FORWARD_COMPAT_CANDIDATES = [{
|
|
732
|
+
id: ANTIGRAVITY_OPUS_46_THINKING_MODEL_ID,
|
|
733
|
+
templatePrefixes: ["google-antigravity/claude-opus-4-5-thinking", "google-antigravity/claude-opus-4.5-thinking"]
|
|
734
|
+
}, {
|
|
735
|
+
id: ANTIGRAVITY_OPUS_46_MODEL_ID,
|
|
736
|
+
templatePrefixes: ["google-antigravity/claude-opus-4-5", "google-antigravity/claude-opus-4.5"]
|
|
737
|
+
}];
|
|
738
|
+
function resolveOpenAICodexGpt53FallbackModel(provider, modelId, modelRegistry) {
|
|
739
|
+
const normalizedProvider = normalizeProviderId(provider);
|
|
740
|
+
const trimmedModelId = modelId.trim();
|
|
741
|
+
if (normalizedProvider !== "openai-codex") return;
|
|
742
|
+
if (trimmedModelId.toLowerCase() !== OPENAI_CODEX_GPT_53_MODEL_ID) return;
|
|
743
|
+
for (const templateId of OPENAI_CODEX_TEMPLATE_MODEL_IDS) {
|
|
744
|
+
const template = modelRegistry.find(normalizedProvider, templateId);
|
|
745
|
+
if (!template) continue;
|
|
746
|
+
return normalizeModelCompat({
|
|
747
|
+
...template,
|
|
748
|
+
id: trimmedModelId,
|
|
749
|
+
name: trimmedModelId
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
return normalizeModelCompat({
|
|
753
|
+
id: trimmedModelId,
|
|
754
|
+
name: trimmedModelId,
|
|
755
|
+
api: "openai-codex-responses",
|
|
756
|
+
provider: normalizedProvider,
|
|
757
|
+
baseUrl: "https://chatgpt.com/backend-api",
|
|
758
|
+
reasoning: true,
|
|
759
|
+
input: ["text", "image"],
|
|
760
|
+
cost: {
|
|
761
|
+
input: 0,
|
|
762
|
+
output: 0,
|
|
763
|
+
cacheRead: 0,
|
|
764
|
+
cacheWrite: 0
|
|
765
|
+
},
|
|
766
|
+
contextWindow: DEFAULT_CONTEXT_TOKENS,
|
|
767
|
+
maxTokens: DEFAULT_CONTEXT_TOKENS
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
function resolveAnthropicOpus46ForwardCompatModel(provider, modelId, modelRegistry) {
|
|
771
|
+
const normalizedProvider = normalizeProviderId(provider);
|
|
772
|
+
if (normalizedProvider !== "anthropic") return;
|
|
773
|
+
const trimmedModelId = modelId.trim();
|
|
774
|
+
const lower = trimmedModelId.toLowerCase();
|
|
775
|
+
if (!(lower === ANTHROPIC_OPUS_46_MODEL_ID || lower === ANTHROPIC_OPUS_46_DOT_MODEL_ID || lower.startsWith(`${ANTHROPIC_OPUS_46_MODEL_ID}-`) || lower.startsWith(`${ANTHROPIC_OPUS_46_DOT_MODEL_ID}-`))) return;
|
|
776
|
+
const templateIds = [];
|
|
777
|
+
if (lower.startsWith(ANTHROPIC_OPUS_46_MODEL_ID)) templateIds.push(lower.replace(ANTHROPIC_OPUS_46_MODEL_ID, "claude-opus-4-5"));
|
|
778
|
+
if (lower.startsWith(ANTHROPIC_OPUS_46_DOT_MODEL_ID)) templateIds.push(lower.replace(ANTHROPIC_OPUS_46_DOT_MODEL_ID, "claude-opus-4.5"));
|
|
779
|
+
templateIds.push(...ANTHROPIC_OPUS_TEMPLATE_MODEL_IDS);
|
|
780
|
+
for (const templateId of [...new Set(templateIds)].filter(Boolean)) {
|
|
781
|
+
const template = modelRegistry.find(normalizedProvider, templateId);
|
|
782
|
+
if (!template) continue;
|
|
783
|
+
return normalizeModelCompat({
|
|
784
|
+
...template,
|
|
785
|
+
id: trimmedModelId,
|
|
786
|
+
name: trimmedModelId
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
function resolveZaiGlm5ForwardCompatModel(provider, modelId, modelRegistry) {
|
|
791
|
+
if (normalizeProviderId(provider) !== "zai") return;
|
|
792
|
+
const trimmed = modelId.trim();
|
|
793
|
+
const lower = trimmed.toLowerCase();
|
|
794
|
+
if (lower !== ZAI_GLM5_MODEL_ID && !lower.startsWith(`${ZAI_GLM5_MODEL_ID}-`)) return;
|
|
795
|
+
for (const templateId of ZAI_GLM5_TEMPLATE_MODEL_IDS) {
|
|
796
|
+
const template = modelRegistry.find("zai", templateId);
|
|
797
|
+
if (!template) continue;
|
|
798
|
+
return normalizeModelCompat({
|
|
799
|
+
...template,
|
|
800
|
+
id: trimmed,
|
|
801
|
+
name: trimmed,
|
|
802
|
+
reasoning: true
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
return normalizeModelCompat({
|
|
806
|
+
id: trimmed,
|
|
807
|
+
name: trimmed,
|
|
808
|
+
api: "openai-completions",
|
|
809
|
+
provider: "zai",
|
|
810
|
+
reasoning: true,
|
|
811
|
+
input: ["text"],
|
|
812
|
+
cost: {
|
|
813
|
+
input: 0,
|
|
814
|
+
output: 0,
|
|
815
|
+
cacheRead: 0,
|
|
816
|
+
cacheWrite: 0
|
|
817
|
+
},
|
|
818
|
+
contextWindow: DEFAULT_CONTEXT_TOKENS,
|
|
819
|
+
maxTokens: DEFAULT_CONTEXT_TOKENS
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
function resolveAntigravityOpus46ForwardCompatModel(provider, modelId, modelRegistry) {
|
|
823
|
+
const normalizedProvider = normalizeProviderId(provider);
|
|
824
|
+
if (normalizedProvider !== "google-antigravity") return;
|
|
825
|
+
const trimmedModelId = modelId.trim();
|
|
826
|
+
const lower = trimmedModelId.toLowerCase();
|
|
827
|
+
const isOpus46 = lower === ANTIGRAVITY_OPUS_46_MODEL_ID || lower === ANTIGRAVITY_OPUS_46_DOT_MODEL_ID || lower.startsWith(`${ANTIGRAVITY_OPUS_46_MODEL_ID}-`) || lower.startsWith(`${ANTIGRAVITY_OPUS_46_DOT_MODEL_ID}-`);
|
|
828
|
+
const isOpus46Thinking = lower === ANTIGRAVITY_OPUS_46_THINKING_MODEL_ID || lower === ANTIGRAVITY_OPUS_46_DOT_THINKING_MODEL_ID || lower.startsWith(`${ANTIGRAVITY_OPUS_46_THINKING_MODEL_ID}-`) || lower.startsWith(`${ANTIGRAVITY_OPUS_46_DOT_THINKING_MODEL_ID}-`);
|
|
829
|
+
if (!isOpus46 && !isOpus46Thinking) return;
|
|
830
|
+
const templateIds = [];
|
|
831
|
+
if (lower.startsWith(ANTIGRAVITY_OPUS_46_MODEL_ID)) templateIds.push(lower.replace(ANTIGRAVITY_OPUS_46_MODEL_ID, "claude-opus-4-5"));
|
|
832
|
+
if (lower.startsWith(ANTIGRAVITY_OPUS_46_DOT_MODEL_ID)) templateIds.push(lower.replace(ANTIGRAVITY_OPUS_46_DOT_MODEL_ID, "claude-opus-4.5"));
|
|
833
|
+
if (lower.startsWith(ANTIGRAVITY_OPUS_46_THINKING_MODEL_ID)) templateIds.push(lower.replace(ANTIGRAVITY_OPUS_46_THINKING_MODEL_ID, "claude-opus-4-5-thinking"));
|
|
834
|
+
if (lower.startsWith(ANTIGRAVITY_OPUS_46_DOT_THINKING_MODEL_ID)) templateIds.push(lower.replace(ANTIGRAVITY_OPUS_46_DOT_THINKING_MODEL_ID, "claude-opus-4.5-thinking"));
|
|
835
|
+
templateIds.push(...ANTIGRAVITY_OPUS_TEMPLATE_MODEL_IDS);
|
|
836
|
+
templateIds.push(...ANTIGRAVITY_OPUS_THINKING_TEMPLATE_MODEL_IDS);
|
|
837
|
+
for (const templateId of [...new Set(templateIds)].filter(Boolean)) {
|
|
838
|
+
const template = modelRegistry.find(normalizedProvider, templateId);
|
|
839
|
+
if (!template) continue;
|
|
840
|
+
return normalizeModelCompat({
|
|
841
|
+
...template,
|
|
842
|
+
id: trimmedModelId,
|
|
843
|
+
name: trimmedModelId
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
function resolveForwardCompatModel(provider, modelId, modelRegistry) {
|
|
848
|
+
return resolveOpenAICodexGpt53FallbackModel(provider, modelId, modelRegistry) ?? resolveAnthropicOpus46ForwardCompatModel(provider, modelId, modelRegistry) ?? resolveZaiGlm5ForwardCompatModel(provider, modelId, modelRegistry) ?? resolveAntigravityOpus46ForwardCompatModel(provider, modelId, modelRegistry);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
//#endregion
|
|
852
|
+
//#region src/commands/models/list.configured.ts
|
|
853
|
+
function resolveConfiguredEntries(cfg) {
|
|
854
|
+
const resolvedDefault = resolveConfiguredModelRef({
|
|
855
|
+
cfg,
|
|
856
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
857
|
+
defaultModel: DEFAULT_MODEL
|
|
858
|
+
});
|
|
859
|
+
const aliasIndex = buildModelAliasIndex({
|
|
860
|
+
cfg,
|
|
861
|
+
defaultProvider: DEFAULT_PROVIDER
|
|
862
|
+
});
|
|
863
|
+
const order = [];
|
|
864
|
+
const tagsByKey = /* @__PURE__ */ new Map();
|
|
865
|
+
const aliasesByKey = /* @__PURE__ */ new Map();
|
|
866
|
+
for (const [key, aliases] of aliasIndex.byKey.entries()) aliasesByKey.set(key, aliases);
|
|
867
|
+
const addEntry = (ref, tag) => {
|
|
868
|
+
const key = modelKey(ref.provider, ref.model);
|
|
869
|
+
if (!tagsByKey.has(key)) {
|
|
870
|
+
tagsByKey.set(key, /* @__PURE__ */ new Set());
|
|
871
|
+
order.push(key);
|
|
872
|
+
}
|
|
873
|
+
tagsByKey.get(key)?.add(tag);
|
|
874
|
+
};
|
|
875
|
+
addEntry(resolvedDefault, "default");
|
|
876
|
+
const modelConfig = cfg.agents?.defaults?.model;
|
|
877
|
+
const imageModelConfig = cfg.agents?.defaults?.imageModel;
|
|
878
|
+
const modelFallbacks = typeof modelConfig === "object" ? modelConfig?.fallbacks ?? [] : [];
|
|
879
|
+
const imageFallbacks = typeof imageModelConfig === "object" ? imageModelConfig?.fallbacks ?? [] : [];
|
|
880
|
+
const imagePrimary = imageModelConfig?.primary?.trim() ?? "";
|
|
881
|
+
modelFallbacks.forEach((raw, idx) => {
|
|
882
|
+
const resolved = resolveModelRefFromString({
|
|
883
|
+
raw: String(raw ?? ""),
|
|
884
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
885
|
+
aliasIndex
|
|
886
|
+
});
|
|
887
|
+
if (!resolved) return;
|
|
888
|
+
addEntry(resolved.ref, `fallback#${idx + 1}`);
|
|
889
|
+
});
|
|
890
|
+
if (imagePrimary) {
|
|
891
|
+
const resolved = resolveModelRefFromString({
|
|
892
|
+
raw: imagePrimary,
|
|
893
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
894
|
+
aliasIndex
|
|
895
|
+
});
|
|
896
|
+
if (resolved) addEntry(resolved.ref, "image");
|
|
897
|
+
}
|
|
898
|
+
imageFallbacks.forEach((raw, idx) => {
|
|
899
|
+
const resolved = resolveModelRefFromString({
|
|
900
|
+
raw: String(raw ?? ""),
|
|
901
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
902
|
+
aliasIndex
|
|
903
|
+
});
|
|
904
|
+
if (!resolved) return;
|
|
905
|
+
addEntry(resolved.ref, `img-fallback#${idx + 1}`);
|
|
906
|
+
});
|
|
907
|
+
for (const key of Object.keys(cfg.agents?.defaults?.models ?? {})) {
|
|
908
|
+
const parsed = parseModelRef(String(key ?? ""), DEFAULT_PROVIDER);
|
|
909
|
+
if (!parsed) continue;
|
|
910
|
+
addEntry(parsed, "configured");
|
|
911
|
+
}
|
|
912
|
+
return { entries: order.map((key) => {
|
|
913
|
+
const slash = key.indexOf("/");
|
|
914
|
+
return {
|
|
915
|
+
key,
|
|
916
|
+
ref: {
|
|
917
|
+
provider: slash === -1 ? key : key.slice(0, slash),
|
|
918
|
+
model: slash === -1 ? "" : key.slice(slash + 1)
|
|
919
|
+
},
|
|
920
|
+
tags: tagsByKey.get(key) ?? /* @__PURE__ */ new Set(),
|
|
921
|
+
aliases: aliasesByKey.get(key) ?? []
|
|
922
|
+
};
|
|
923
|
+
}) };
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
//#endregion
|
|
927
|
+
//#region src/commands/models/list.errors.ts
|
|
928
|
+
const MODEL_AVAILABILITY_UNAVAILABLE_CODE = "MODEL_AVAILABILITY_UNAVAILABLE";
|
|
929
|
+
function formatErrorWithStack(err) {
|
|
930
|
+
if (err instanceof Error) return err.stack ?? `${err.name}: ${err.message}`;
|
|
931
|
+
return String(err);
|
|
932
|
+
}
|
|
933
|
+
function shouldFallbackToAuthHeuristics(err) {
|
|
934
|
+
if (!(err instanceof Error)) return false;
|
|
935
|
+
return err.code === MODEL_AVAILABILITY_UNAVAILABLE_CODE;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
//#endregion
|
|
939
|
+
//#region src/commands/models/list.registry.ts
|
|
940
|
+
const hasAuthForProvider = (provider, cfg, authStore) => {
|
|
941
|
+
if (!cfg || !authStore) return false;
|
|
942
|
+
if (listProfilesForProvider(authStore, provider).length > 0) return true;
|
|
943
|
+
if (provider === "amazon-bedrock" && resolveAwsSdkEnvVarName()) return true;
|
|
944
|
+
if (resolveEnvApiKey(provider)) return true;
|
|
945
|
+
if (getCustomProviderApiKey(cfg, provider)) return true;
|
|
946
|
+
return false;
|
|
947
|
+
};
|
|
948
|
+
function createAvailabilityUnavailableError(message) {
|
|
949
|
+
const err = new Error(message);
|
|
950
|
+
err.code = MODEL_AVAILABILITY_UNAVAILABLE_CODE;
|
|
951
|
+
return err;
|
|
952
|
+
}
|
|
953
|
+
function normalizeAvailabilityError(err) {
|
|
954
|
+
if (shouldFallbackToAuthHeuristics(err) && err instanceof Error) return err;
|
|
955
|
+
return createAvailabilityUnavailableError(`Model availability unavailable: getAvailable() failed.\n${formatErrorWithStack(err)}`);
|
|
956
|
+
}
|
|
957
|
+
function validateAvailableModels(availableModels) {
|
|
958
|
+
if (!Array.isArray(availableModels)) throw createAvailabilityUnavailableError("Model availability unavailable: getAvailable() returned a non-array value.");
|
|
959
|
+
for (const model of availableModels) if (!model || typeof model !== "object" || typeof model.provider !== "string" || typeof model.id !== "string") throw createAvailabilityUnavailableError("Model availability unavailable: getAvailable() returned invalid model entries.");
|
|
960
|
+
return availableModels;
|
|
961
|
+
}
|
|
962
|
+
function loadAvailableModels(registry) {
|
|
963
|
+
let availableModels;
|
|
964
|
+
try {
|
|
965
|
+
availableModels = registry.getAvailable();
|
|
966
|
+
} catch (err) {
|
|
967
|
+
throw normalizeAvailabilityError(err);
|
|
968
|
+
}
|
|
969
|
+
try {
|
|
970
|
+
return validateAvailableModels(availableModels);
|
|
971
|
+
} catch (err) {
|
|
972
|
+
throw normalizeAvailabilityError(err);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
async function loadModelRegistry(cfg) {
|
|
976
|
+
await ensureAnimaModelsJson(cfg);
|
|
977
|
+
const agentDir = resolveAnimaAgentDir();
|
|
978
|
+
const registry = discoverModels(discoverAuthStorage(agentDir), agentDir);
|
|
979
|
+
const appended = appendAntigravityForwardCompatModels(registry.getAll(), registry);
|
|
980
|
+
const models = appended.models;
|
|
981
|
+
const synthesizedForwardCompat = appended.synthesizedForwardCompat;
|
|
982
|
+
let availableKeys;
|
|
983
|
+
let availabilityErrorMessage;
|
|
984
|
+
try {
|
|
985
|
+
const availableModels = loadAvailableModels(registry);
|
|
986
|
+
availableKeys = new Set(availableModels.map((model) => modelKey(model.provider, model.id)));
|
|
987
|
+
for (const synthesized of synthesizedForwardCompat) if (hasAvailableTemplate(availableKeys, synthesized.templatePrefixes)) availableKeys.add(synthesized.key);
|
|
988
|
+
} catch (err) {
|
|
989
|
+
if (!shouldFallbackToAuthHeuristics(err)) throw err;
|
|
990
|
+
availableKeys = void 0;
|
|
991
|
+
if (!availabilityErrorMessage) availabilityErrorMessage = formatErrorWithStack(err);
|
|
992
|
+
}
|
|
993
|
+
return {
|
|
994
|
+
registry,
|
|
995
|
+
models,
|
|
996
|
+
availableKeys,
|
|
997
|
+
availabilityErrorMessage
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
function appendAntigravityForwardCompatModels(models, modelRegistry) {
|
|
1001
|
+
const nextModels = [...models];
|
|
1002
|
+
const synthesizedForwardCompat = [];
|
|
1003
|
+
for (const candidate of ANTIGRAVITY_OPUS_46_FORWARD_COMPAT_CANDIDATES) {
|
|
1004
|
+
const key = modelKey("google-antigravity", candidate.id);
|
|
1005
|
+
if (nextModels.some((model) => modelKey(model.provider, model.id) === key)) continue;
|
|
1006
|
+
const fallback = resolveForwardCompatModel("google-antigravity", candidate.id, modelRegistry);
|
|
1007
|
+
if (!fallback) continue;
|
|
1008
|
+
nextModels.push(fallback);
|
|
1009
|
+
synthesizedForwardCompat.push({
|
|
1010
|
+
key,
|
|
1011
|
+
templatePrefixes: candidate.templatePrefixes
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
return {
|
|
1015
|
+
models: nextModels,
|
|
1016
|
+
synthesizedForwardCompat
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
function hasAvailableTemplate(availableKeys, templatePrefixes) {
|
|
1020
|
+
for (const key of availableKeys) if (templatePrefixes.some((prefix) => key.startsWith(prefix))) return true;
|
|
1021
|
+
return false;
|
|
1022
|
+
}
|
|
1023
|
+
function toModelRow(params) {
|
|
1024
|
+
const { model, key, tags, aliases = [], availableKeys, cfg, authStore } = params;
|
|
1025
|
+
if (!model) return {
|
|
1026
|
+
key,
|
|
1027
|
+
name: key,
|
|
1028
|
+
input: "-",
|
|
1029
|
+
contextWindow: null,
|
|
1030
|
+
local: null,
|
|
1031
|
+
available: null,
|
|
1032
|
+
tags: [...tags, "missing"],
|
|
1033
|
+
missing: true
|
|
1034
|
+
};
|
|
1035
|
+
const input = model.input.join("+") || "text";
|
|
1036
|
+
const local = isLocalBaseUrl(model.baseUrl);
|
|
1037
|
+
const available = availableKeys !== void 0 ? availableKeys.has(modelKey(model.provider, model.id)) : cfg && authStore ? hasAuthForProvider(model.provider, cfg, authStore) : false;
|
|
1038
|
+
const aliasTags = aliases.length > 0 ? [`alias:${aliases.join(",")}`] : [];
|
|
1039
|
+
const mergedTags = new Set(tags);
|
|
1040
|
+
if (aliasTags.length > 0) {
|
|
1041
|
+
for (const tag of mergedTags) if (tag === "alias" || tag.startsWith("alias:")) mergedTags.delete(tag);
|
|
1042
|
+
for (const tag of aliasTags) mergedTags.add(tag);
|
|
1043
|
+
}
|
|
1044
|
+
return {
|
|
1045
|
+
key,
|
|
1046
|
+
name: model.name || model.id,
|
|
1047
|
+
input,
|
|
1048
|
+
contextWindow: model.contextWindow ?? null,
|
|
1049
|
+
local,
|
|
1050
|
+
available,
|
|
1051
|
+
tags: Array.from(mergedTags),
|
|
1052
|
+
missing: false
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
//#endregion
|
|
1057
|
+
//#region src/commands/models/list.format.ts
|
|
1058
|
+
const isRich = (opts) => Boolean(isRich$1() && !opts?.json && !opts?.plain);
|
|
1059
|
+
const pad$1 = (value, size) => value.padEnd(size);
|
|
1060
|
+
const formatTag = (tag, rich) => {
|
|
1061
|
+
if (!rich) return tag;
|
|
1062
|
+
if (tag === "default") return theme.success(tag);
|
|
1063
|
+
if (tag === "image") return theme.accentBright(tag);
|
|
1064
|
+
if (tag === "configured") return theme.accent(tag);
|
|
1065
|
+
if (tag === "missing") return theme.error(tag);
|
|
1066
|
+
if (tag.startsWith("fallback#")) return theme.warn(tag);
|
|
1067
|
+
if (tag.startsWith("img-fallback#")) return theme.warn(tag);
|
|
1068
|
+
if (tag.startsWith("alias:")) return theme.accentDim(tag);
|
|
1069
|
+
return theme.muted(tag);
|
|
1070
|
+
};
|
|
1071
|
+
const truncate$1 = (value, max) => {
|
|
1072
|
+
if (value.length <= max) return value;
|
|
1073
|
+
if (max <= 3) return value.slice(0, max);
|
|
1074
|
+
return `${value.slice(0, max - 3)}...`;
|
|
1075
|
+
};
|
|
1076
|
+
const maskApiKey = (value) => {
|
|
1077
|
+
const trimmed = value.trim();
|
|
1078
|
+
if (!trimmed) return "missing";
|
|
1079
|
+
if (trimmed.length <= 16) return trimmed;
|
|
1080
|
+
return `${trimmed.slice(0, 8)}...${trimmed.slice(-8)}`;
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region src/commands/models/list.table.ts
|
|
1085
|
+
const MODEL_PAD$1 = 42;
|
|
1086
|
+
const INPUT_PAD = 10;
|
|
1087
|
+
const CTX_PAD$1 = 8;
|
|
1088
|
+
const LOCAL_PAD = 5;
|
|
1089
|
+
const AUTH_PAD = 5;
|
|
1090
|
+
function printModelTable(rows, runtime, opts = {}) {
|
|
1091
|
+
if (opts.json) {
|
|
1092
|
+
runtime.log(JSON.stringify({
|
|
1093
|
+
count: rows.length,
|
|
1094
|
+
models: rows
|
|
1095
|
+
}, null, 2));
|
|
1096
|
+
return;
|
|
1097
|
+
}
|
|
1098
|
+
if (opts.plain) {
|
|
1099
|
+
for (const row of rows) runtime.log(row.key);
|
|
1100
|
+
return;
|
|
1101
|
+
}
|
|
1102
|
+
const rich = isRich(opts);
|
|
1103
|
+
const header = [
|
|
1104
|
+
pad$1("Model", MODEL_PAD$1),
|
|
1105
|
+
pad$1("Input", INPUT_PAD),
|
|
1106
|
+
pad$1("Ctx", CTX_PAD$1),
|
|
1107
|
+
pad$1("Local", LOCAL_PAD),
|
|
1108
|
+
pad$1("Auth", AUTH_PAD),
|
|
1109
|
+
"Tags"
|
|
1110
|
+
].join(" ");
|
|
1111
|
+
runtime.log(rich ? theme.heading(header) : header);
|
|
1112
|
+
for (const row of rows) {
|
|
1113
|
+
const keyLabel = pad$1(truncate$1(row.key, MODEL_PAD$1), MODEL_PAD$1);
|
|
1114
|
+
const inputLabel = pad$1(row.input || "-", INPUT_PAD);
|
|
1115
|
+
const ctxLabel = pad$1(formatTokenK(row.contextWindow), CTX_PAD$1);
|
|
1116
|
+
const localLabel = pad$1(row.local === null ? "-" : row.local ? "yes" : "no", LOCAL_PAD);
|
|
1117
|
+
const authLabel = pad$1(row.available === null ? "-" : row.available ? "yes" : "no", AUTH_PAD);
|
|
1118
|
+
const tagsLabel = row.tags.length > 0 ? rich ? row.tags.map((tag) => formatTag(tag, rich)).join(",") : row.tags.join(",") : "";
|
|
1119
|
+
const coloredInput = colorize(rich, row.input.includes("image") ? theme.accentBright : theme.info, inputLabel);
|
|
1120
|
+
const coloredLocal = colorize(rich, row.local === null ? theme.muted : row.local ? theme.success : theme.muted, localLabel);
|
|
1121
|
+
const coloredAuth = colorize(rich, row.available === null ? theme.muted : row.available ? theme.success : theme.error, authLabel);
|
|
1122
|
+
const line = [
|
|
1123
|
+
rich ? theme.accent(keyLabel) : keyLabel,
|
|
1124
|
+
coloredInput,
|
|
1125
|
+
ctxLabel,
|
|
1126
|
+
coloredLocal,
|
|
1127
|
+
coloredAuth,
|
|
1128
|
+
tagsLabel
|
|
1129
|
+
].join(" ");
|
|
1130
|
+
runtime.log(line);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
//#endregion
|
|
1135
|
+
//#region src/commands/models/list.list-command.ts
|
|
1136
|
+
async function modelsListCommand(opts, runtime) {
|
|
1137
|
+
ensureFlagCompatibility(opts);
|
|
1138
|
+
const cfg = loadConfig();
|
|
1139
|
+
const authStore = ensureAuthProfileStore();
|
|
1140
|
+
const providerFilter = (() => {
|
|
1141
|
+
const raw = opts.provider?.trim();
|
|
1142
|
+
if (!raw) return;
|
|
1143
|
+
return parseModelRef(`${raw}/_`, DEFAULT_PROVIDER)?.provider ?? raw.toLowerCase();
|
|
1144
|
+
})();
|
|
1145
|
+
let models = [];
|
|
1146
|
+
let modelRegistry;
|
|
1147
|
+
let availableKeys;
|
|
1148
|
+
let availabilityErrorMessage;
|
|
1149
|
+
try {
|
|
1150
|
+
const loaded = await loadModelRegistry(cfg);
|
|
1151
|
+
modelRegistry = loaded.registry;
|
|
1152
|
+
models = loaded.models;
|
|
1153
|
+
availableKeys = loaded.availableKeys;
|
|
1154
|
+
availabilityErrorMessage = loaded.availabilityErrorMessage;
|
|
1155
|
+
} catch (err) {
|
|
1156
|
+
runtime.error(`Model registry unavailable:\n${formatErrorWithStack(err)}`);
|
|
1157
|
+
process.exitCode = 1;
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
if (availabilityErrorMessage !== void 0) runtime.error(`Model availability lookup failed; falling back to auth heuristics for discovered models: ${availabilityErrorMessage}`);
|
|
1161
|
+
const modelByKey = new Map(models.map((model) => [modelKey(model.provider, model.id), model]));
|
|
1162
|
+
const { entries } = resolveConfiguredEntries(cfg);
|
|
1163
|
+
const configuredByKey = new Map(entries.map((entry) => [entry.key, entry]));
|
|
1164
|
+
const rows = [];
|
|
1165
|
+
if (opts.all) {
|
|
1166
|
+
const sorted = [...models].toSorted((a, b) => {
|
|
1167
|
+
const p = a.provider.localeCompare(b.provider);
|
|
1168
|
+
if (p !== 0) return p;
|
|
1169
|
+
return a.id.localeCompare(b.id);
|
|
1170
|
+
});
|
|
1171
|
+
for (const model of sorted) {
|
|
1172
|
+
if (providerFilter && model.provider.toLowerCase() !== providerFilter) continue;
|
|
1173
|
+
if (opts.local && !isLocalBaseUrl(model.baseUrl)) continue;
|
|
1174
|
+
const key = modelKey(model.provider, model.id);
|
|
1175
|
+
const configured = configuredByKey.get(key);
|
|
1176
|
+
rows.push(toModelRow({
|
|
1177
|
+
model,
|
|
1178
|
+
key,
|
|
1179
|
+
tags: configured ? Array.from(configured.tags) : [],
|
|
1180
|
+
aliases: configured?.aliases ?? [],
|
|
1181
|
+
availableKeys,
|
|
1182
|
+
cfg,
|
|
1183
|
+
authStore
|
|
1184
|
+
}));
|
|
1185
|
+
}
|
|
1186
|
+
} else for (const entry of entries) {
|
|
1187
|
+
if (providerFilter && entry.ref.provider.toLowerCase() !== providerFilter) continue;
|
|
1188
|
+
let model = modelByKey.get(entry.key);
|
|
1189
|
+
if (!model && modelRegistry) {
|
|
1190
|
+
const forwardCompat = resolveForwardCompatModel(entry.ref.provider, entry.ref.model, modelRegistry);
|
|
1191
|
+
if (forwardCompat) {
|
|
1192
|
+
model = forwardCompat;
|
|
1193
|
+
modelByKey.set(entry.key, forwardCompat);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
if (!model) model = resolveModel(entry.ref.provider, entry.ref.model, void 0, cfg).model;
|
|
1197
|
+
if (opts.local && model && !isLocalBaseUrl(model.baseUrl)) continue;
|
|
1198
|
+
if (opts.local && !model) continue;
|
|
1199
|
+
rows.push(toModelRow({
|
|
1200
|
+
model,
|
|
1201
|
+
key: entry.key,
|
|
1202
|
+
tags: Array.from(entry.tags),
|
|
1203
|
+
aliases: entry.aliases,
|
|
1204
|
+
availableKeys,
|
|
1205
|
+
cfg,
|
|
1206
|
+
authStore
|
|
1207
|
+
}));
|
|
1208
|
+
}
|
|
1209
|
+
if (rows.length === 0) {
|
|
1210
|
+
runtime.log("No models found.");
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
printModelTable(rows, runtime, opts);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
//#endregion
|
|
1217
|
+
//#region src/commands/models/list.auth-overview.ts
|
|
1218
|
+
function resolveProviderAuthOverview(params) {
|
|
1219
|
+
const { provider, cfg, store } = params;
|
|
1220
|
+
const now = Date.now();
|
|
1221
|
+
const profiles = listProfilesForProvider(store, provider);
|
|
1222
|
+
const withUnusableSuffix = (base, profileId) => {
|
|
1223
|
+
const unusableUntil = resolveProfileUnusableUntilForDisplay(store, profileId);
|
|
1224
|
+
if (!unusableUntil || now >= unusableUntil) return base;
|
|
1225
|
+
const stats = store.usageStats?.[profileId];
|
|
1226
|
+
return `${base} [${typeof stats?.disabledUntil === "number" && now < stats.disabledUntil ? `disabled${stats.disabledReason ? `:${stats.disabledReason}` : ""}` : "cooldown"} ${formatRemainingShort(unusableUntil - now)}]`;
|
|
1227
|
+
};
|
|
1228
|
+
const labels = profiles.map((profileId) => {
|
|
1229
|
+
const profile = store.profiles[profileId];
|
|
1230
|
+
if (!profile) return `${profileId}=missing`;
|
|
1231
|
+
if (profile.type === "api_key") return withUnusableSuffix(`${profileId}=${maskApiKey(profile.key ?? "")}`, profileId);
|
|
1232
|
+
if (profile.type === "token") return withUnusableSuffix(`${profileId}=token:${maskApiKey(profile.token)}`, profileId);
|
|
1233
|
+
const display = resolveAuthProfileDisplayLabel({
|
|
1234
|
+
cfg,
|
|
1235
|
+
store,
|
|
1236
|
+
profileId
|
|
1237
|
+
});
|
|
1238
|
+
const suffix = display === profileId ? "" : display.startsWith(profileId) ? display.slice(profileId.length).trim() : `(${display})`;
|
|
1239
|
+
return withUnusableSuffix(`${profileId}=OAuth${suffix ? ` ${suffix}` : ""}`, profileId);
|
|
1240
|
+
});
|
|
1241
|
+
const oauthCount = profiles.filter((id) => store.profiles[id]?.type === "oauth").length;
|
|
1242
|
+
const tokenCount = profiles.filter((id) => store.profiles[id]?.type === "token").length;
|
|
1243
|
+
const apiKeyCount = profiles.filter((id) => store.profiles[id]?.type === "api_key").length;
|
|
1244
|
+
const envKey = resolveEnvApiKey(provider);
|
|
1245
|
+
const customKey = getCustomProviderApiKey(cfg, provider);
|
|
1246
|
+
return {
|
|
1247
|
+
provider,
|
|
1248
|
+
effective: (() => {
|
|
1249
|
+
if (profiles.length > 0) return {
|
|
1250
|
+
kind: "profiles",
|
|
1251
|
+
detail: shortenHomePath(resolveAuthStorePathForDisplay())
|
|
1252
|
+
};
|
|
1253
|
+
if (envKey) return {
|
|
1254
|
+
kind: "env",
|
|
1255
|
+
detail: envKey.source.includes("OAUTH_TOKEN") || envKey.source.toLowerCase().includes("oauth") ? "OAuth (env)" : maskApiKey(envKey.apiKey)
|
|
1256
|
+
};
|
|
1257
|
+
if (customKey) return {
|
|
1258
|
+
kind: "models.json",
|
|
1259
|
+
detail: maskApiKey(customKey)
|
|
1260
|
+
};
|
|
1261
|
+
return {
|
|
1262
|
+
kind: "missing",
|
|
1263
|
+
detail: "missing"
|
|
1264
|
+
};
|
|
1265
|
+
})(),
|
|
1266
|
+
profiles: {
|
|
1267
|
+
count: profiles.length,
|
|
1268
|
+
oauth: oauthCount,
|
|
1269
|
+
token: tokenCount,
|
|
1270
|
+
apiKey: apiKeyCount,
|
|
1271
|
+
labels
|
|
1272
|
+
},
|
|
1273
|
+
...envKey ? { env: {
|
|
1274
|
+
value: envKey.source.includes("OAUTH_TOKEN") || envKey.source.toLowerCase().includes("oauth") ? "OAuth (env)" : maskApiKey(envKey.apiKey),
|
|
1275
|
+
source: envKey.source
|
|
1276
|
+
} } : {},
|
|
1277
|
+
...customKey ? { modelsJson: {
|
|
1278
|
+
value: maskApiKey(customKey),
|
|
1279
|
+
source: `models.json: ${shortenHomePath(params.modelsPath)}`
|
|
1280
|
+
} } : {}
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
//#endregion
|
|
1285
|
+
//#region src/commands/models/list.probe.ts
|
|
1286
|
+
const PROBE_PROMPT = "Reply with OK. Do not use tools.";
|
|
1287
|
+
const toStatus = (reason) => {
|
|
1288
|
+
if (!reason) return "unknown";
|
|
1289
|
+
if (reason === "auth") return "auth";
|
|
1290
|
+
if (reason === "rate_limit") return "rate_limit";
|
|
1291
|
+
if (reason === "billing") return "billing";
|
|
1292
|
+
if (reason === "timeout") return "timeout";
|
|
1293
|
+
if (reason === "format") return "format";
|
|
1294
|
+
return "unknown";
|
|
1295
|
+
};
|
|
1296
|
+
function buildCandidateMap(modelCandidates) {
|
|
1297
|
+
const map = /* @__PURE__ */ new Map();
|
|
1298
|
+
for (const raw of modelCandidates) {
|
|
1299
|
+
const parsed = parseModelRef(String(raw ?? ""), DEFAULT_PROVIDER);
|
|
1300
|
+
if (!parsed) continue;
|
|
1301
|
+
const list = map.get(parsed.provider) ?? [];
|
|
1302
|
+
if (!list.includes(parsed.model)) list.push(parsed.model);
|
|
1303
|
+
map.set(parsed.provider, list);
|
|
1304
|
+
}
|
|
1305
|
+
return map;
|
|
1306
|
+
}
|
|
1307
|
+
function selectProbeModel(params) {
|
|
1308
|
+
const { provider, candidates, catalog } = params;
|
|
1309
|
+
const direct = candidates.get(provider);
|
|
1310
|
+
if (direct && direct.length > 0) return {
|
|
1311
|
+
provider,
|
|
1312
|
+
model: direct[0]
|
|
1313
|
+
};
|
|
1314
|
+
const fromCatalog = catalog.find((entry) => entry.provider === provider);
|
|
1315
|
+
if (fromCatalog) return {
|
|
1316
|
+
provider: fromCatalog.provider,
|
|
1317
|
+
model: fromCatalog.id
|
|
1318
|
+
};
|
|
1319
|
+
return null;
|
|
1320
|
+
}
|
|
1321
|
+
function buildProbeTargets(params) {
|
|
1322
|
+
const { cfg, providers, modelCandidates, options } = params;
|
|
1323
|
+
const store = ensureAuthProfileStore();
|
|
1324
|
+
const providerFilter = options.provider?.trim();
|
|
1325
|
+
const providerFilterKey = providerFilter ? normalizeProviderId(providerFilter) : null;
|
|
1326
|
+
const profileFilter = new Set((options.profileIds ?? []).map((id) => id.trim()).filter(Boolean));
|
|
1327
|
+
return loadModelCatalog({ config: cfg }).then((catalog) => {
|
|
1328
|
+
const candidates = buildCandidateMap(modelCandidates);
|
|
1329
|
+
const targets = [];
|
|
1330
|
+
const results = [];
|
|
1331
|
+
for (const provider of providers) {
|
|
1332
|
+
const providerKey = normalizeProviderId(provider);
|
|
1333
|
+
if (providerFilterKey && providerKey !== providerFilterKey) continue;
|
|
1334
|
+
const model = selectProbeModel({
|
|
1335
|
+
provider: providerKey,
|
|
1336
|
+
candidates,
|
|
1337
|
+
catalog
|
|
1338
|
+
});
|
|
1339
|
+
const profileIds = listProfilesForProvider(store, providerKey);
|
|
1340
|
+
const explicitOrder = (() => {
|
|
1341
|
+
const order = store.order;
|
|
1342
|
+
if (order) {
|
|
1343
|
+
for (const [key, value] of Object.entries(order)) if (normalizeProviderId(key) === providerKey) return value;
|
|
1344
|
+
}
|
|
1345
|
+
const cfgOrder = cfg?.auth?.order;
|
|
1346
|
+
if (cfgOrder) {
|
|
1347
|
+
for (const [key, value] of Object.entries(cfgOrder)) if (normalizeProviderId(key) === providerKey) return value;
|
|
1348
|
+
}
|
|
1349
|
+
})();
|
|
1350
|
+
const allowedProfiles = explicitOrder && explicitOrder.length > 0 ? new Set(resolveAuthProfileOrder({
|
|
1351
|
+
cfg,
|
|
1352
|
+
store,
|
|
1353
|
+
provider: providerKey
|
|
1354
|
+
})) : null;
|
|
1355
|
+
const filteredProfiles = profileFilter.size ? profileIds.filter((id) => profileFilter.has(id)) : profileIds;
|
|
1356
|
+
if (filteredProfiles.length > 0) {
|
|
1357
|
+
for (const profileId of filteredProfiles) {
|
|
1358
|
+
const mode = store.profiles[profileId]?.type;
|
|
1359
|
+
const label = resolveAuthProfileDisplayLabel({
|
|
1360
|
+
cfg,
|
|
1361
|
+
store,
|
|
1362
|
+
profileId
|
|
1363
|
+
});
|
|
1364
|
+
if (explicitOrder && !explicitOrder.includes(profileId)) {
|
|
1365
|
+
results.push({
|
|
1366
|
+
provider: providerKey,
|
|
1367
|
+
model: model ? `${model.provider}/${model.model}` : void 0,
|
|
1368
|
+
profileId,
|
|
1369
|
+
label,
|
|
1370
|
+
source: "profile",
|
|
1371
|
+
mode,
|
|
1372
|
+
status: "unknown",
|
|
1373
|
+
error: "Excluded by auth.order for this provider."
|
|
1374
|
+
});
|
|
1375
|
+
continue;
|
|
1376
|
+
}
|
|
1377
|
+
if (allowedProfiles && !allowedProfiles.has(profileId)) {
|
|
1378
|
+
results.push({
|
|
1379
|
+
provider: providerKey,
|
|
1380
|
+
model: model ? `${model.provider}/${model.model}` : void 0,
|
|
1381
|
+
profileId,
|
|
1382
|
+
label,
|
|
1383
|
+
source: "profile",
|
|
1384
|
+
mode,
|
|
1385
|
+
status: "unknown",
|
|
1386
|
+
error: "Auth profile credentials are missing or expired."
|
|
1387
|
+
});
|
|
1388
|
+
continue;
|
|
1389
|
+
}
|
|
1390
|
+
if (!model) {
|
|
1391
|
+
results.push({
|
|
1392
|
+
provider: providerKey,
|
|
1393
|
+
model: void 0,
|
|
1394
|
+
profileId,
|
|
1395
|
+
label,
|
|
1396
|
+
source: "profile",
|
|
1397
|
+
mode,
|
|
1398
|
+
status: "no_model",
|
|
1399
|
+
error: "No model available for probe"
|
|
1400
|
+
});
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
targets.push({
|
|
1404
|
+
provider: providerKey,
|
|
1405
|
+
model,
|
|
1406
|
+
profileId,
|
|
1407
|
+
label,
|
|
1408
|
+
source: "profile",
|
|
1409
|
+
mode
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
continue;
|
|
1413
|
+
}
|
|
1414
|
+
if (profileFilter.size > 0) continue;
|
|
1415
|
+
const envKey = resolveEnvApiKey(providerKey);
|
|
1416
|
+
const customKey = getCustomProviderApiKey(cfg, providerKey);
|
|
1417
|
+
if (!envKey && !customKey) continue;
|
|
1418
|
+
const label = envKey ? "env" : "models.json";
|
|
1419
|
+
const source = envKey ? "env" : "models.json";
|
|
1420
|
+
const mode = envKey?.source.includes("OAUTH_TOKEN") ? "oauth" : "api_key";
|
|
1421
|
+
if (!model) {
|
|
1422
|
+
results.push({
|
|
1423
|
+
provider: providerKey,
|
|
1424
|
+
model: void 0,
|
|
1425
|
+
label,
|
|
1426
|
+
source,
|
|
1427
|
+
mode,
|
|
1428
|
+
status: "no_model",
|
|
1429
|
+
error: "No model available for probe"
|
|
1430
|
+
});
|
|
1431
|
+
continue;
|
|
1432
|
+
}
|
|
1433
|
+
targets.push({
|
|
1434
|
+
provider: providerKey,
|
|
1435
|
+
model,
|
|
1436
|
+
label,
|
|
1437
|
+
source,
|
|
1438
|
+
mode
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
return {
|
|
1442
|
+
targets,
|
|
1443
|
+
results
|
|
1444
|
+
};
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
async function probeTarget(params) {
|
|
1448
|
+
const { cfg, agentId, agentDir, workspaceDir, sessionDir, target, timeoutMs, maxTokens } = params;
|
|
1449
|
+
if (!target.model) return {
|
|
1450
|
+
provider: target.provider,
|
|
1451
|
+
model: void 0,
|
|
1452
|
+
profileId: target.profileId,
|
|
1453
|
+
label: target.label,
|
|
1454
|
+
source: target.source,
|
|
1455
|
+
mode: target.mode,
|
|
1456
|
+
status: "no_model",
|
|
1457
|
+
error: "No model available for probe"
|
|
1458
|
+
};
|
|
1459
|
+
const sessionId = `probe-${target.provider}-${crypto.randomUUID()}`;
|
|
1460
|
+
const sessionFile = resolveSessionTranscriptPath(sessionId, agentId);
|
|
1461
|
+
await fs.mkdir(sessionDir, { recursive: true });
|
|
1462
|
+
const start = Date.now();
|
|
1463
|
+
try {
|
|
1464
|
+
await runEmbeddedPiAgent({
|
|
1465
|
+
sessionId,
|
|
1466
|
+
sessionFile,
|
|
1467
|
+
agentId,
|
|
1468
|
+
workspaceDir,
|
|
1469
|
+
agentDir,
|
|
1470
|
+
config: cfg,
|
|
1471
|
+
prompt: PROBE_PROMPT,
|
|
1472
|
+
provider: target.model.provider,
|
|
1473
|
+
model: target.model.model,
|
|
1474
|
+
authProfileId: target.profileId,
|
|
1475
|
+
authProfileIdSource: target.profileId ? "user" : void 0,
|
|
1476
|
+
timeoutMs,
|
|
1477
|
+
runId: `probe-${crypto.randomUUID()}`,
|
|
1478
|
+
lane: `auth-probe:${target.provider}:${target.profileId ?? target.source}`,
|
|
1479
|
+
thinkLevel: "off",
|
|
1480
|
+
reasoningLevel: "off",
|
|
1481
|
+
verboseLevel: "off",
|
|
1482
|
+
streamParams: { maxTokens }
|
|
1483
|
+
});
|
|
1484
|
+
return {
|
|
1485
|
+
provider: target.provider,
|
|
1486
|
+
model: `${target.model.provider}/${target.model.model}`,
|
|
1487
|
+
profileId: target.profileId,
|
|
1488
|
+
label: target.label,
|
|
1489
|
+
source: target.source,
|
|
1490
|
+
mode: target.mode,
|
|
1491
|
+
status: "ok",
|
|
1492
|
+
latencyMs: Date.now() - start
|
|
1493
|
+
};
|
|
1494
|
+
} catch (err) {
|
|
1495
|
+
const described = describeFailoverError(err);
|
|
1496
|
+
return {
|
|
1497
|
+
provider: target.provider,
|
|
1498
|
+
model: `${target.model.provider}/${target.model.model}`,
|
|
1499
|
+
profileId: target.profileId,
|
|
1500
|
+
label: target.label,
|
|
1501
|
+
source: target.source,
|
|
1502
|
+
mode: target.mode,
|
|
1503
|
+
status: toStatus(described.reason),
|
|
1504
|
+
error: redactSecrets(described.message),
|
|
1505
|
+
latencyMs: Date.now() - start
|
|
1506
|
+
};
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
async function runTargetsWithConcurrency(params) {
|
|
1510
|
+
const { cfg, targets, timeoutMs, maxTokens, onProgress } = params;
|
|
1511
|
+
const concurrency = Math.max(1, Math.min(targets.length || 1, params.concurrency));
|
|
1512
|
+
const agentId = resolveDefaultAgentId(cfg);
|
|
1513
|
+
const agentDir = resolveAnimaAgentDir();
|
|
1514
|
+
const workspaceDir = resolveAgentWorkspaceDir(cfg, agentId) ?? resolveDefaultAgentWorkspaceDir();
|
|
1515
|
+
const sessionDir = resolveSessionTranscriptsDirForAgent(agentId);
|
|
1516
|
+
await fs.mkdir(workspaceDir, { recursive: true });
|
|
1517
|
+
let completed = 0;
|
|
1518
|
+
const results = Array.from({ length: targets.length });
|
|
1519
|
+
let cursor = 0;
|
|
1520
|
+
const worker = async () => {
|
|
1521
|
+
while (true) {
|
|
1522
|
+
const index = cursor;
|
|
1523
|
+
cursor += 1;
|
|
1524
|
+
if (index >= targets.length) return;
|
|
1525
|
+
const target = targets[index];
|
|
1526
|
+
onProgress?.({
|
|
1527
|
+
completed,
|
|
1528
|
+
total: targets.length,
|
|
1529
|
+
label: `Probing ${target.provider}${target.profileId ? ` (${target.label})` : ""}`
|
|
1530
|
+
});
|
|
1531
|
+
results[index] = await probeTarget({
|
|
1532
|
+
cfg,
|
|
1533
|
+
agentId,
|
|
1534
|
+
agentDir,
|
|
1535
|
+
workspaceDir,
|
|
1536
|
+
sessionDir,
|
|
1537
|
+
target,
|
|
1538
|
+
timeoutMs,
|
|
1539
|
+
maxTokens
|
|
1540
|
+
});
|
|
1541
|
+
completed += 1;
|
|
1542
|
+
onProgress?.({
|
|
1543
|
+
completed,
|
|
1544
|
+
total: targets.length
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
await Promise.all(Array.from({ length: concurrency }, () => worker()));
|
|
1549
|
+
return results.filter((entry) => Boolean(entry));
|
|
1550
|
+
}
|
|
1551
|
+
async function runAuthProbes(params) {
|
|
1552
|
+
const startedAt = Date.now();
|
|
1553
|
+
const plan = await buildProbeTargets({
|
|
1554
|
+
cfg: params.cfg,
|
|
1555
|
+
providers: params.providers,
|
|
1556
|
+
modelCandidates: params.modelCandidates,
|
|
1557
|
+
options: params.options
|
|
1558
|
+
});
|
|
1559
|
+
const totalTargets = plan.targets.length;
|
|
1560
|
+
params.onProgress?.({
|
|
1561
|
+
completed: 0,
|
|
1562
|
+
total: totalTargets
|
|
1563
|
+
});
|
|
1564
|
+
const results = totalTargets ? await runTargetsWithConcurrency({
|
|
1565
|
+
cfg: params.cfg,
|
|
1566
|
+
targets: plan.targets,
|
|
1567
|
+
timeoutMs: params.options.timeoutMs,
|
|
1568
|
+
maxTokens: params.options.maxTokens,
|
|
1569
|
+
concurrency: params.options.concurrency,
|
|
1570
|
+
onProgress: params.onProgress
|
|
1571
|
+
}) : [];
|
|
1572
|
+
const finishedAt = Date.now();
|
|
1573
|
+
return {
|
|
1574
|
+
startedAt,
|
|
1575
|
+
finishedAt,
|
|
1576
|
+
durationMs: finishedAt - startedAt,
|
|
1577
|
+
totalTargets,
|
|
1578
|
+
options: params.options,
|
|
1579
|
+
results: [...plan.results, ...results]
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
function formatProbeLatency(latencyMs) {
|
|
1583
|
+
if (!latencyMs && latencyMs !== 0) return "-";
|
|
1584
|
+
return formatMs(latencyMs);
|
|
1585
|
+
}
|
|
1586
|
+
function sortProbeResults(results) {
|
|
1587
|
+
return results.slice().toSorted((a, b) => {
|
|
1588
|
+
const provider = a.provider.localeCompare(b.provider);
|
|
1589
|
+
if (provider !== 0) return provider;
|
|
1590
|
+
const aLabel = a.label || a.profileId || "";
|
|
1591
|
+
const bLabel = b.label || b.profileId || "";
|
|
1592
|
+
return aLabel.localeCompare(bLabel);
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
function describeProbeSummary(summary) {
|
|
1596
|
+
if (summary.totalTargets === 0) return "No probe targets.";
|
|
1597
|
+
return `Probed ${summary.totalTargets} target${summary.totalTargets === 1 ? "" : "s"} in ${formatMs(summary.durationMs)}`;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
//#endregion
|
|
1601
|
+
//#region src/commands/models/list.status-command.ts
|
|
1602
|
+
async function modelsStatusCommand(opts, runtime) {
|
|
1603
|
+
ensureFlagCompatibility(opts);
|
|
1604
|
+
if (opts.plain && opts.probe) throw new Error("--probe cannot be used with --plain output.");
|
|
1605
|
+
const cfg = loadConfig();
|
|
1606
|
+
const agentId = resolveKnownAgentId({
|
|
1607
|
+
cfg,
|
|
1608
|
+
rawAgentId: opts.agent
|
|
1609
|
+
});
|
|
1610
|
+
const agentDir = agentId ? resolveAgentDir(cfg, agentId) : resolveAnimaAgentDir();
|
|
1611
|
+
const agentModelPrimary = agentId ? resolveAgentModelPrimary(cfg, agentId) : void 0;
|
|
1612
|
+
const agentFallbacksOverride = agentId ? resolveAgentModelFallbacksOverride(cfg, agentId) : void 0;
|
|
1613
|
+
const resolved = agentId ? resolveDefaultModelForAgent({
|
|
1614
|
+
cfg,
|
|
1615
|
+
agentId
|
|
1616
|
+
}) : resolveConfiguredModelRef({
|
|
1617
|
+
cfg,
|
|
1618
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
1619
|
+
defaultModel: DEFAULT_MODEL
|
|
1620
|
+
});
|
|
1621
|
+
const modelConfig = cfg.agents?.defaults?.model;
|
|
1622
|
+
const imageConfig = cfg.agents?.defaults?.imageModel;
|
|
1623
|
+
const rawDefaultsModel = typeof modelConfig === "string" ? modelConfig.trim() : modelConfig?.primary?.trim() ?? "";
|
|
1624
|
+
const rawModel = agentModelPrimary ?? rawDefaultsModel;
|
|
1625
|
+
const resolvedLabel = `${resolved.provider}/${resolved.model}`;
|
|
1626
|
+
const defaultLabel = rawModel || resolvedLabel;
|
|
1627
|
+
const defaultsFallbacks = typeof modelConfig === "object" ? modelConfig?.fallbacks ?? [] : [];
|
|
1628
|
+
const fallbacks = agentFallbacksOverride ?? defaultsFallbacks;
|
|
1629
|
+
const imageModel = typeof imageConfig === "string" ? imageConfig.trim() : imageConfig?.primary?.trim() ?? "";
|
|
1630
|
+
const imageFallbacks = typeof imageConfig === "object" ? imageConfig?.fallbacks ?? [] : [];
|
|
1631
|
+
const aliases = Object.entries(cfg.agents?.defaults?.models ?? {}).reduce((acc, [key, entry]) => {
|
|
1632
|
+
const alias = typeof entry?.alias === "string" ? entry.alias.trim() : void 0;
|
|
1633
|
+
if (alias) acc[alias] = key;
|
|
1634
|
+
return acc;
|
|
1635
|
+
}, {});
|
|
1636
|
+
const allowed = Object.keys(cfg.agents?.defaults?.models ?? {});
|
|
1637
|
+
const store = ensureAuthProfileStore(agentDir);
|
|
1638
|
+
const modelsPath = path.join(agentDir, "models.json");
|
|
1639
|
+
const providersFromStore = new Set(Object.values(store.profiles).map((profile) => profile.provider).filter((p) => Boolean(p)));
|
|
1640
|
+
const providersFromConfig = new Set(Object.keys(cfg.models?.providers ?? {}).map((p) => typeof p === "string" ? p.trim() : "").filter(Boolean));
|
|
1641
|
+
const providersFromModels = /* @__PURE__ */ new Set();
|
|
1642
|
+
const providersInUse = /* @__PURE__ */ new Set();
|
|
1643
|
+
for (const raw of [
|
|
1644
|
+
defaultLabel,
|
|
1645
|
+
...fallbacks,
|
|
1646
|
+
imageModel,
|
|
1647
|
+
...imageFallbacks,
|
|
1648
|
+
...allowed
|
|
1649
|
+
]) {
|
|
1650
|
+
const parsed = parseModelRef(String(raw ?? ""), DEFAULT_PROVIDER);
|
|
1651
|
+
if (parsed?.provider) providersFromModels.add(parsed.provider);
|
|
1652
|
+
}
|
|
1653
|
+
for (const raw of [
|
|
1654
|
+
defaultLabel,
|
|
1655
|
+
...fallbacks,
|
|
1656
|
+
imageModel,
|
|
1657
|
+
...imageFallbacks
|
|
1658
|
+
]) {
|
|
1659
|
+
const parsed = parseModelRef(String(raw ?? ""), DEFAULT_PROVIDER);
|
|
1660
|
+
if (parsed?.provider) providersInUse.add(parsed.provider);
|
|
1661
|
+
}
|
|
1662
|
+
const providersFromEnv = /* @__PURE__ */ new Set();
|
|
1663
|
+
for (const provider of [
|
|
1664
|
+
"anthropic",
|
|
1665
|
+
"github-copilot",
|
|
1666
|
+
"google-vertex",
|
|
1667
|
+
"openai",
|
|
1668
|
+
"google",
|
|
1669
|
+
"groq",
|
|
1670
|
+
"cerebras",
|
|
1671
|
+
"xai",
|
|
1672
|
+
"openrouter",
|
|
1673
|
+
"zai",
|
|
1674
|
+
"mistral",
|
|
1675
|
+
"synthetic"
|
|
1676
|
+
]) if (resolveEnvApiKey(provider)) providersFromEnv.add(provider);
|
|
1677
|
+
const providers = Array.from(new Set([
|
|
1678
|
+
...providersFromStore,
|
|
1679
|
+
...providersFromConfig,
|
|
1680
|
+
...providersFromModels,
|
|
1681
|
+
...providersFromEnv
|
|
1682
|
+
])).map((p) => typeof p === "string" ? p.trim() : "").filter(Boolean).toSorted((a, b) => a.localeCompare(b));
|
|
1683
|
+
const applied = getShellEnvAppliedKeys();
|
|
1684
|
+
const shellFallbackEnabled = shouldEnableShellEnvFallback(process.env) || cfg.env?.shellEnv?.enabled === true;
|
|
1685
|
+
const providerAuth = providers.map((provider) => resolveProviderAuthOverview({
|
|
1686
|
+
provider,
|
|
1687
|
+
cfg,
|
|
1688
|
+
store,
|
|
1689
|
+
modelsPath
|
|
1690
|
+
})).filter((entry) => {
|
|
1691
|
+
return entry.profiles.count > 0 || Boolean(entry.env) || Boolean(entry.modelsJson);
|
|
1692
|
+
});
|
|
1693
|
+
const providerAuthMap = new Map(providerAuth.map((entry) => [entry.provider, entry]));
|
|
1694
|
+
const missingProvidersInUse = Array.from(providersInUse).filter((provider) => !providerAuthMap.has(provider)).toSorted((a, b) => a.localeCompare(b));
|
|
1695
|
+
const probeProfileIds = (() => {
|
|
1696
|
+
if (!opts.probeProfile) return [];
|
|
1697
|
+
return (Array.isArray(opts.probeProfile) ? opts.probeProfile : [opts.probeProfile]).flatMap((value) => String(value ?? "").split(",")).map((value) => value.trim()).filter(Boolean);
|
|
1698
|
+
})();
|
|
1699
|
+
const probeTimeoutMs = opts.probeTimeout ? Number(opts.probeTimeout) : 8e3;
|
|
1700
|
+
if (!Number.isFinite(probeTimeoutMs) || probeTimeoutMs <= 0) throw new Error("--probe-timeout must be a positive number (ms).");
|
|
1701
|
+
const probeConcurrency = opts.probeConcurrency ? Number(opts.probeConcurrency) : 2;
|
|
1702
|
+
if (!Number.isFinite(probeConcurrency) || probeConcurrency <= 0) throw new Error("--probe-concurrency must be > 0.");
|
|
1703
|
+
const probeMaxTokens = opts.probeMaxTokens ? Number(opts.probeMaxTokens) : 8;
|
|
1704
|
+
if (!Number.isFinite(probeMaxTokens) || probeMaxTokens <= 0) throw new Error("--probe-max-tokens must be > 0.");
|
|
1705
|
+
const aliasIndex = buildModelAliasIndex({
|
|
1706
|
+
cfg,
|
|
1707
|
+
defaultProvider: DEFAULT_PROVIDER
|
|
1708
|
+
});
|
|
1709
|
+
const modelCandidates = [
|
|
1710
|
+
rawModel || resolvedLabel,
|
|
1711
|
+
...fallbacks,
|
|
1712
|
+
imageModel,
|
|
1713
|
+
...imageFallbacks,
|
|
1714
|
+
...allowed
|
|
1715
|
+
].filter(Boolean).map((raw) => resolveModelRefFromString({
|
|
1716
|
+
raw: String(raw ?? ""),
|
|
1717
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
1718
|
+
aliasIndex
|
|
1719
|
+
})?.ref).filter((ref) => Boolean(ref)).map((ref) => `${ref.provider}/${ref.model}`);
|
|
1720
|
+
let probeSummary;
|
|
1721
|
+
if (opts.probe) probeSummary = await withProgressTotals({
|
|
1722
|
+
label: "Probing auth profiles…",
|
|
1723
|
+
total: 1
|
|
1724
|
+
}, async (update) => {
|
|
1725
|
+
return await runAuthProbes({
|
|
1726
|
+
cfg,
|
|
1727
|
+
providers,
|
|
1728
|
+
modelCandidates,
|
|
1729
|
+
options: {
|
|
1730
|
+
provider: opts.probeProvider,
|
|
1731
|
+
profileIds: probeProfileIds,
|
|
1732
|
+
timeoutMs: probeTimeoutMs,
|
|
1733
|
+
concurrency: probeConcurrency,
|
|
1734
|
+
maxTokens: probeMaxTokens
|
|
1735
|
+
},
|
|
1736
|
+
onProgress: update
|
|
1737
|
+
});
|
|
1738
|
+
});
|
|
1739
|
+
const providersWithOauth = providerAuth.filter((entry) => entry.profiles.oauth > 0 || entry.profiles.token > 0 || entry.env?.value === "OAuth (env)").map((entry) => {
|
|
1740
|
+
const count = entry.profiles.oauth + entry.profiles.token + (entry.env?.value === "OAuth (env)" ? 1 : 0);
|
|
1741
|
+
return `${entry.provider} (${count})`;
|
|
1742
|
+
});
|
|
1743
|
+
const authHealth = buildAuthHealthSummary({
|
|
1744
|
+
store,
|
|
1745
|
+
cfg,
|
|
1746
|
+
warnAfterMs: DEFAULT_OAUTH_WARN_MS,
|
|
1747
|
+
providers
|
|
1748
|
+
});
|
|
1749
|
+
const oauthProfiles = authHealth.profiles.filter((profile) => profile.type === "oauth" || profile.type === "token");
|
|
1750
|
+
const unusableProfiles = (() => {
|
|
1751
|
+
const now = Date.now();
|
|
1752
|
+
const out = [];
|
|
1753
|
+
for (const profileId of Object.keys(store.usageStats ?? {})) {
|
|
1754
|
+
const unusableUntil = resolveProfileUnusableUntilForDisplay(store, profileId);
|
|
1755
|
+
if (!unusableUntil || now >= unusableUntil) continue;
|
|
1756
|
+
const stats = store.usageStats?.[profileId];
|
|
1757
|
+
const kind = typeof stats?.disabledUntil === "number" && now < stats.disabledUntil ? "disabled" : "cooldown";
|
|
1758
|
+
out.push({
|
|
1759
|
+
profileId,
|
|
1760
|
+
provider: store.profiles[profileId]?.provider,
|
|
1761
|
+
kind,
|
|
1762
|
+
reason: stats?.disabledReason,
|
|
1763
|
+
until: unusableUntil,
|
|
1764
|
+
remainingMs: unusableUntil - now
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
return out.toSorted((a, b) => a.remainingMs - b.remainingMs);
|
|
1768
|
+
})();
|
|
1769
|
+
const checkStatus = (() => {
|
|
1770
|
+
const hasExpiredOrMissing = oauthProfiles.some((profile) => ["expired", "missing"].includes(profile.status)) || missingProvidersInUse.length > 0;
|
|
1771
|
+
const hasExpiring = oauthProfiles.some((profile) => profile.status === "expiring");
|
|
1772
|
+
if (hasExpiredOrMissing) return 1;
|
|
1773
|
+
if (hasExpiring) return 2;
|
|
1774
|
+
return 0;
|
|
1775
|
+
})();
|
|
1776
|
+
if (opts.json) {
|
|
1777
|
+
runtime.log(JSON.stringify({
|
|
1778
|
+
configPath: CONFIG_PATH,
|
|
1779
|
+
...agentId ? { agentId } : {},
|
|
1780
|
+
agentDir,
|
|
1781
|
+
defaultModel: defaultLabel,
|
|
1782
|
+
resolvedDefault: resolvedLabel,
|
|
1783
|
+
fallbacks,
|
|
1784
|
+
imageModel: imageModel || null,
|
|
1785
|
+
imageFallbacks,
|
|
1786
|
+
...agentId ? { modelConfig: {
|
|
1787
|
+
defaultSource: agentModelPrimary ? "agent" : "defaults",
|
|
1788
|
+
fallbacksSource: agentFallbacksOverride !== void 0 ? "agent" : "defaults"
|
|
1789
|
+
} } : {},
|
|
1790
|
+
aliases,
|
|
1791
|
+
allowed,
|
|
1792
|
+
auth: {
|
|
1793
|
+
storePath: resolveAuthStorePathForDisplay(agentDir),
|
|
1794
|
+
shellEnvFallback: {
|
|
1795
|
+
enabled: shellFallbackEnabled,
|
|
1796
|
+
appliedKeys: applied
|
|
1797
|
+
},
|
|
1798
|
+
providersWithOAuth: providersWithOauth,
|
|
1799
|
+
missingProvidersInUse,
|
|
1800
|
+
providers: providerAuth,
|
|
1801
|
+
unusableProfiles,
|
|
1802
|
+
oauth: {
|
|
1803
|
+
warnAfterMs: authHealth.warnAfterMs,
|
|
1804
|
+
profiles: authHealth.profiles,
|
|
1805
|
+
providers: authHealth.providers
|
|
1806
|
+
},
|
|
1807
|
+
probes: probeSummary
|
|
1808
|
+
}
|
|
1809
|
+
}, null, 2));
|
|
1810
|
+
if (opts.check) runtime.exit(checkStatus);
|
|
1811
|
+
return;
|
|
1812
|
+
}
|
|
1813
|
+
if (opts.plain) {
|
|
1814
|
+
runtime.log(resolvedLabel);
|
|
1815
|
+
if (opts.check) runtime.exit(checkStatus);
|
|
1816
|
+
return;
|
|
1817
|
+
}
|
|
1818
|
+
const rich = isRich(opts);
|
|
1819
|
+
const label = (value) => colorize(rich, theme.accent, value.padEnd(14));
|
|
1820
|
+
const labelWithSource = (value, source) => label(source ? `${value} (${source})` : value);
|
|
1821
|
+
const displayDefault = rawModel && rawModel !== resolvedLabel ? `${resolvedLabel} (from ${rawModel})` : resolvedLabel;
|
|
1822
|
+
runtime.log(`${label("Config")}${colorize(rich, theme.muted, ":")} ${colorize(rich, theme.info, shortenHomePath(CONFIG_PATH))}`);
|
|
1823
|
+
runtime.log(`${label("Agent dir")}${colorize(rich, theme.muted, ":")} ${colorize(rich, theme.info, shortenHomePath(agentDir))}`);
|
|
1824
|
+
runtime.log(`${labelWithSource("Default", agentId ? agentModelPrimary ? "agent" : "defaults" : void 0)}${colorize(rich, theme.muted, ":")} ${colorize(rich, theme.success, displayDefault)}`);
|
|
1825
|
+
runtime.log(`${labelWithSource(`Fallbacks (${fallbacks.length || 0})`, agentId ? agentFallbacksOverride !== void 0 ? "agent" : "defaults" : void 0)}${colorize(rich, theme.muted, ":")} ${colorize(rich, fallbacks.length ? theme.warn : theme.muted, fallbacks.length ? fallbacks.join(", ") : "-")}`);
|
|
1826
|
+
runtime.log(`${labelWithSource("Image model", agentId ? "defaults" : void 0)}${colorize(rich, theme.muted, ":")} ${colorize(rich, imageModel ? theme.accentBright : theme.muted, imageModel || "-")}`);
|
|
1827
|
+
runtime.log(`${labelWithSource(`Image fallbacks (${imageFallbacks.length || 0})`, agentId ? "defaults" : void 0)}${colorize(rich, theme.muted, ":")} ${colorize(rich, imageFallbacks.length ? theme.accentBright : theme.muted, imageFallbacks.length ? imageFallbacks.join(", ") : "-")}`);
|
|
1828
|
+
runtime.log(`${label(`Aliases (${Object.keys(aliases).length || 0})`)}${colorize(rich, theme.muted, ":")} ${colorize(rich, Object.keys(aliases).length ? theme.accent : theme.muted, Object.keys(aliases).length ? Object.entries(aliases).map(([alias, target]) => rich ? `${theme.accentDim(alias)} ${theme.muted("->")} ${theme.info(target)}` : `${alias} -> ${target}`).join(", ") : "-")}`);
|
|
1829
|
+
runtime.log(`${label(`Configured models (${allowed.length || 0})`)}${colorize(rich, theme.muted, ":")} ${colorize(rich, allowed.length ? theme.info : theme.muted, allowed.length ? allowed.join(", ") : "all")}`);
|
|
1830
|
+
runtime.log("");
|
|
1831
|
+
runtime.log(colorize(rich, theme.heading, "Auth overview"));
|
|
1832
|
+
runtime.log(`${label("Auth store")}${colorize(rich, theme.muted, ":")} ${colorize(rich, theme.info, shortenHomePath(resolveAuthStorePathForDisplay(agentDir)))}`);
|
|
1833
|
+
runtime.log(`${label("Shell env")}${colorize(rich, theme.muted, ":")} ${colorize(rich, shellFallbackEnabled ? theme.success : theme.muted, shellFallbackEnabled ? "on" : "off")}${applied.length ? colorize(rich, theme.muted, ` (applied: ${applied.join(", ")})`) : ""}`);
|
|
1834
|
+
runtime.log(`${label(`Providers w/ OAuth/tokens (${providersWithOauth.length || 0})`)}${colorize(rich, theme.muted, ":")} ${colorize(rich, providersWithOauth.length ? theme.info : theme.muted, providersWithOauth.length ? providersWithOauth.join(", ") : "-")}`);
|
|
1835
|
+
const formatKey = (key) => colorize(rich, theme.warn, key);
|
|
1836
|
+
const formatKeyValue = (key, value) => `${formatKey(key)}=${colorize(rich, theme.info, value)}`;
|
|
1837
|
+
const formatSeparator = () => colorize(rich, theme.muted, " | ");
|
|
1838
|
+
for (const entry of providerAuth) {
|
|
1839
|
+
const separator = formatSeparator();
|
|
1840
|
+
const bits = [];
|
|
1841
|
+
bits.push(formatKeyValue("effective", `${colorize(rich, theme.accentBright, entry.effective.kind)}:${colorize(rich, theme.muted, entry.effective.detail)}`));
|
|
1842
|
+
if (entry.profiles.count > 0) {
|
|
1843
|
+
bits.push(formatKeyValue("profiles", `${entry.profiles.count} (oauth=${entry.profiles.oauth}, token=${entry.profiles.token}, api_key=${entry.profiles.apiKey})`));
|
|
1844
|
+
if (entry.profiles.labels.length > 0) bits.push(colorize(rich, theme.info, entry.profiles.labels.join(", ")));
|
|
1845
|
+
}
|
|
1846
|
+
if (entry.env) bits.push(formatKeyValue("env", `${entry.env.value}${separator}${formatKeyValue("source", entry.env.source)}`));
|
|
1847
|
+
if (entry.modelsJson) bits.push(formatKeyValue("models.json", `${entry.modelsJson.value}${separator}${formatKeyValue("source", entry.modelsJson.source)}`));
|
|
1848
|
+
runtime.log(`- ${theme.heading(entry.provider)} ${bits.join(separator)}`);
|
|
1849
|
+
}
|
|
1850
|
+
if (missingProvidersInUse.length > 0) {
|
|
1851
|
+
runtime.log("");
|
|
1852
|
+
runtime.log(colorize(rich, theme.heading, "Missing auth"));
|
|
1853
|
+
for (const provider of missingProvidersInUse) {
|
|
1854
|
+
const hint = provider === "anthropic" ? `Run \`claude setup-token\`, then \`${formatCliCommand("anima models auth setup-token")}\` or \`${formatCliCommand("anima configure")}\`.` : `Run \`${formatCliCommand("anima configure")}\` or set an API key env var.`;
|
|
1855
|
+
runtime.log(`- ${theme.heading(provider)} ${hint}`);
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
runtime.log("");
|
|
1859
|
+
runtime.log(colorize(rich, theme.heading, "OAuth/token status"));
|
|
1860
|
+
if (oauthProfiles.length === 0) runtime.log(colorize(rich, theme.muted, "- none"));
|
|
1861
|
+
else {
|
|
1862
|
+
const usageByProvider = /* @__PURE__ */ new Map();
|
|
1863
|
+
const usageProviders = Array.from(new Set(oauthProfiles.map((profile) => resolveUsageProviderId(profile.provider)).filter((provider) => Boolean(provider))));
|
|
1864
|
+
if (usageProviders.length > 0) try {
|
|
1865
|
+
const usageSummary = await loadProviderUsageSummary({
|
|
1866
|
+
providers: usageProviders,
|
|
1867
|
+
agentDir,
|
|
1868
|
+
timeoutMs: 3500
|
|
1869
|
+
});
|
|
1870
|
+
for (const snapshot of usageSummary.providers) {
|
|
1871
|
+
const formatted = formatUsageWindowSummary(snapshot, {
|
|
1872
|
+
now: Date.now(),
|
|
1873
|
+
maxWindows: 2,
|
|
1874
|
+
includeResets: true
|
|
1875
|
+
});
|
|
1876
|
+
if (formatted) usageByProvider.set(snapshot.provider, formatted);
|
|
1877
|
+
}
|
|
1878
|
+
} catch {}
|
|
1879
|
+
const formatStatus = (status) => {
|
|
1880
|
+
if (status === "ok") return colorize(rich, theme.success, "ok");
|
|
1881
|
+
if (status === "static") return colorize(rich, theme.muted, "static");
|
|
1882
|
+
if (status === "expiring") return colorize(rich, theme.warn, "expiring");
|
|
1883
|
+
if (status === "missing") return colorize(rich, theme.warn, "unknown");
|
|
1884
|
+
return colorize(rich, theme.error, "expired");
|
|
1885
|
+
};
|
|
1886
|
+
const profilesByProvider = /* @__PURE__ */ new Map();
|
|
1887
|
+
for (const profile of oauthProfiles) {
|
|
1888
|
+
const current = profilesByProvider.get(profile.provider);
|
|
1889
|
+
if (current) current.push(profile);
|
|
1890
|
+
else profilesByProvider.set(profile.provider, [profile]);
|
|
1891
|
+
}
|
|
1892
|
+
for (const [provider, profiles] of profilesByProvider) {
|
|
1893
|
+
const usageKey = resolveUsageProviderId(provider);
|
|
1894
|
+
const usage = usageKey ? usageByProvider.get(usageKey) : void 0;
|
|
1895
|
+
const usageSuffix = usage ? colorize(rich, theme.muted, ` usage: ${usage}`) : "";
|
|
1896
|
+
runtime.log(`- ${colorize(rich, theme.heading, provider)}${usageSuffix}`);
|
|
1897
|
+
for (const profile of profiles) {
|
|
1898
|
+
const labelText = profile.label || profile.profileId;
|
|
1899
|
+
const label = colorize(rich, theme.accent, labelText);
|
|
1900
|
+
const status = formatStatus(profile.status);
|
|
1901
|
+
const expiry = profile.status === "static" ? "" : profile.expiresAt ? ` expires in ${formatRemainingShort(profile.remainingMs)}` : " expires unknown";
|
|
1902
|
+
runtime.log(` - ${label} ${status}${expiry}`);
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
if (probeSummary) {
|
|
1907
|
+
runtime.log("");
|
|
1908
|
+
runtime.log(colorize(rich, theme.heading, "Auth probes"));
|
|
1909
|
+
if (probeSummary.results.length === 0) runtime.log(colorize(rich, theme.muted, "- none"));
|
|
1910
|
+
else {
|
|
1911
|
+
const tableWidth = Math.max(60, (process.stdout.columns ?? 120) - 1);
|
|
1912
|
+
const sorted = sortProbeResults(probeSummary.results);
|
|
1913
|
+
const statusColor = (status) => {
|
|
1914
|
+
if (status === "ok") return theme.success;
|
|
1915
|
+
if (status === "rate_limit") return theme.warn;
|
|
1916
|
+
if (status === "timeout" || status === "billing") return theme.warn;
|
|
1917
|
+
if (status === "auth" || status === "format") return theme.error;
|
|
1918
|
+
if (status === "no_model") return theme.muted;
|
|
1919
|
+
return theme.muted;
|
|
1920
|
+
};
|
|
1921
|
+
const rows = sorted.map((result) => {
|
|
1922
|
+
const status = colorize(rich, statusColor(result.status), result.status);
|
|
1923
|
+
const latency = formatProbeLatency(result.latencyMs);
|
|
1924
|
+
const modelLabel = result.model ?? `${result.provider}/-`;
|
|
1925
|
+
const modeLabel = result.mode ? ` ${colorize(rich, theme.muted, `(${result.mode})`)}` : "";
|
|
1926
|
+
const profile = `${colorize(rich, theme.accent, result.label)}${modeLabel}`;
|
|
1927
|
+
const detail = result.error?.trim();
|
|
1928
|
+
const detailLabel = detail ? `\n${colorize(rich, theme.muted, `↳ ${detail}`)}` : "";
|
|
1929
|
+
const statusLabel = `${status}${colorize(rich, theme.muted, ` · ${latency}`)}${detailLabel}`;
|
|
1930
|
+
return {
|
|
1931
|
+
Model: colorize(rich, theme.heading, modelLabel),
|
|
1932
|
+
Profile: profile,
|
|
1933
|
+
Status: statusLabel
|
|
1934
|
+
};
|
|
1935
|
+
});
|
|
1936
|
+
runtime.log(renderTable({
|
|
1937
|
+
width: tableWidth,
|
|
1938
|
+
columns: [
|
|
1939
|
+
{
|
|
1940
|
+
key: "Model",
|
|
1941
|
+
header: "Model",
|
|
1942
|
+
minWidth: 18
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
key: "Profile",
|
|
1946
|
+
header: "Profile",
|
|
1947
|
+
minWidth: 24
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
key: "Status",
|
|
1951
|
+
header: "Status",
|
|
1952
|
+
minWidth: 12
|
|
1953
|
+
}
|
|
1954
|
+
],
|
|
1955
|
+
rows
|
|
1956
|
+
}).trimEnd());
|
|
1957
|
+
runtime.log(colorize(rich, theme.muted, describeProbeSummary(probeSummary)));
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
if (opts.check) runtime.exit(checkStatus);
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
//#endregion
|
|
1964
|
+
//#region src/agents/model-scan.ts
|
|
1965
|
+
const OPENROUTER_MODELS_URL = "https://openrouter.ai/api/v1/models";
|
|
1966
|
+
const DEFAULT_TIMEOUT_MS = 12e3;
|
|
1967
|
+
const DEFAULT_CONCURRENCY = 3;
|
|
1968
|
+
const BASE_IMAGE_PNG = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+X3mIAAAAASUVORK5CYII=";
|
|
1969
|
+
const TOOL_PING = {
|
|
1970
|
+
name: "ping",
|
|
1971
|
+
description: "Return OK.",
|
|
1972
|
+
parameters: Type.Object({})
|
|
1973
|
+
};
|
|
1974
|
+
function normalizeCreatedAtMs(value) {
|
|
1975
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
1976
|
+
if (value <= 0) return null;
|
|
1977
|
+
if (value > 0xe8d4a51000) return Math.round(value);
|
|
1978
|
+
return Math.round(value * 1e3);
|
|
1979
|
+
}
|
|
1980
|
+
function parseModality(modality) {
|
|
1981
|
+
if (!modality) return ["text"];
|
|
1982
|
+
return modality.toLowerCase().split(/[^a-z]+/).filter(Boolean).includes("image") ? ["text", "image"] : ["text"];
|
|
1983
|
+
}
|
|
1984
|
+
function parseNumberString(value) {
|
|
1985
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
1986
|
+
if (typeof value !== "string") return null;
|
|
1987
|
+
const trimmed = value.trim();
|
|
1988
|
+
if (!trimmed) return null;
|
|
1989
|
+
const num = Number(trimmed);
|
|
1990
|
+
if (!Number.isFinite(num)) return null;
|
|
1991
|
+
return num;
|
|
1992
|
+
}
|
|
1993
|
+
function parseOpenRouterPricing(value) {
|
|
1994
|
+
if (!value || typeof value !== "object") return null;
|
|
1995
|
+
const obj = value;
|
|
1996
|
+
const prompt = parseNumberString(obj.prompt);
|
|
1997
|
+
const completion = parseNumberString(obj.completion);
|
|
1998
|
+
const request = parseNumberString(obj.request) ?? 0;
|
|
1999
|
+
const image = parseNumberString(obj.image) ?? 0;
|
|
2000
|
+
const webSearch = parseNumberString(obj.web_search) ?? 0;
|
|
2001
|
+
const internalReasoning = parseNumberString(obj.internal_reasoning) ?? 0;
|
|
2002
|
+
if (prompt === null || completion === null) return null;
|
|
2003
|
+
return {
|
|
2004
|
+
prompt,
|
|
2005
|
+
completion,
|
|
2006
|
+
request,
|
|
2007
|
+
image,
|
|
2008
|
+
webSearch,
|
|
2009
|
+
internalReasoning
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
function isFreeOpenRouterModel(entry) {
|
|
2013
|
+
if (entry.id.endsWith(":free")) return true;
|
|
2014
|
+
if (!entry.pricing) return false;
|
|
2015
|
+
return entry.pricing.prompt === 0 && entry.pricing.completion === 0;
|
|
2016
|
+
}
|
|
2017
|
+
async function withTimeout(timeoutMs, fn) {
|
|
2018
|
+
const controller = new AbortController();
|
|
2019
|
+
const timer = setTimeout(controller.abort.bind(controller), timeoutMs);
|
|
2020
|
+
try {
|
|
2021
|
+
return await fn(controller.signal);
|
|
2022
|
+
} finally {
|
|
2023
|
+
clearTimeout(timer);
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
async function fetchOpenRouterModels(fetchImpl) {
|
|
2027
|
+
const res = await fetchImpl(OPENROUTER_MODELS_URL, { headers: { Accept: "application/json" } });
|
|
2028
|
+
if (!res.ok) throw new Error(`OpenRouter /models failed: HTTP ${res.status}`);
|
|
2029
|
+
const payload = await res.json();
|
|
2030
|
+
return (Array.isArray(payload.data) ? payload.data : []).map((entry) => {
|
|
2031
|
+
if (!entry || typeof entry !== "object") return null;
|
|
2032
|
+
const obj = entry;
|
|
2033
|
+
const id = typeof obj.id === "string" ? obj.id.trim() : "";
|
|
2034
|
+
if (!id) return null;
|
|
2035
|
+
const name = typeof obj.name === "string" && obj.name.trim() ? obj.name.trim() : id;
|
|
2036
|
+
const contextLength = typeof obj.context_length === "number" && Number.isFinite(obj.context_length) ? obj.context_length : null;
|
|
2037
|
+
const maxCompletionTokens = typeof obj.max_completion_tokens === "number" && Number.isFinite(obj.max_completion_tokens) ? obj.max_completion_tokens : typeof obj.max_output_tokens === "number" && Number.isFinite(obj.max_output_tokens) ? obj.max_output_tokens : null;
|
|
2038
|
+
const supportedParameters = Array.isArray(obj.supported_parameters) ? obj.supported_parameters.filter((value) => typeof value === "string").map((value) => value.trim()).filter(Boolean) : [];
|
|
2039
|
+
return {
|
|
2040
|
+
id,
|
|
2041
|
+
name,
|
|
2042
|
+
contextLength,
|
|
2043
|
+
maxCompletionTokens,
|
|
2044
|
+
supportedParameters,
|
|
2045
|
+
supportedParametersCount: supportedParameters.length,
|
|
2046
|
+
supportsToolsMeta: supportedParameters.includes("tools"),
|
|
2047
|
+
modality: typeof obj.modality === "string" && obj.modality.trim() ? obj.modality.trim() : null,
|
|
2048
|
+
inferredParamB: inferParamBFromIdOrName(`${id} ${name}`),
|
|
2049
|
+
createdAtMs: normalizeCreatedAtMs(obj.created_at),
|
|
2050
|
+
pricing: parseOpenRouterPricing(obj.pricing)
|
|
2051
|
+
};
|
|
2052
|
+
}).filter((entry) => Boolean(entry));
|
|
2053
|
+
}
|
|
2054
|
+
async function probeTool(model, apiKey, timeoutMs) {
|
|
2055
|
+
const context = {
|
|
2056
|
+
messages: [{
|
|
2057
|
+
role: "user",
|
|
2058
|
+
content: "Call the ping tool with {} and nothing else.",
|
|
2059
|
+
timestamp: Date.now()
|
|
2060
|
+
}],
|
|
2061
|
+
tools: [TOOL_PING]
|
|
2062
|
+
};
|
|
2063
|
+
const startedAt = Date.now();
|
|
2064
|
+
try {
|
|
2065
|
+
if (!(await withTimeout(timeoutMs, (signal) => complete(model, context, {
|
|
2066
|
+
apiKey,
|
|
2067
|
+
maxTokens: 32,
|
|
2068
|
+
temperature: 0,
|
|
2069
|
+
toolChoice: "required",
|
|
2070
|
+
signal
|
|
2071
|
+
}))).content.some((block) => block.type === "toolCall")) return {
|
|
2072
|
+
ok: false,
|
|
2073
|
+
latencyMs: Date.now() - startedAt,
|
|
2074
|
+
error: "No tool call returned"
|
|
2075
|
+
};
|
|
2076
|
+
return {
|
|
2077
|
+
ok: true,
|
|
2078
|
+
latencyMs: Date.now() - startedAt
|
|
2079
|
+
};
|
|
2080
|
+
} catch (err) {
|
|
2081
|
+
return {
|
|
2082
|
+
ok: false,
|
|
2083
|
+
latencyMs: Date.now() - startedAt,
|
|
2084
|
+
error: err instanceof Error ? err.message : String(err)
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
async function probeImage(model, apiKey, timeoutMs) {
|
|
2089
|
+
const context = { messages: [{
|
|
2090
|
+
role: "user",
|
|
2091
|
+
content: [{
|
|
2092
|
+
type: "text",
|
|
2093
|
+
text: "Reply with OK."
|
|
2094
|
+
}, {
|
|
2095
|
+
type: "image",
|
|
2096
|
+
data: BASE_IMAGE_PNG,
|
|
2097
|
+
mimeType: "image/png"
|
|
2098
|
+
}],
|
|
2099
|
+
timestamp: Date.now()
|
|
2100
|
+
}] };
|
|
2101
|
+
const startedAt = Date.now();
|
|
2102
|
+
try {
|
|
2103
|
+
await withTimeout(timeoutMs, (signal) => complete(model, context, {
|
|
2104
|
+
apiKey,
|
|
2105
|
+
maxTokens: 16,
|
|
2106
|
+
temperature: 0,
|
|
2107
|
+
signal
|
|
2108
|
+
}));
|
|
2109
|
+
return {
|
|
2110
|
+
ok: true,
|
|
2111
|
+
latencyMs: Date.now() - startedAt
|
|
2112
|
+
};
|
|
2113
|
+
} catch (err) {
|
|
2114
|
+
return {
|
|
2115
|
+
ok: false,
|
|
2116
|
+
latencyMs: Date.now() - startedAt,
|
|
2117
|
+
error: err instanceof Error ? err.message : String(err)
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
function ensureImageInput(model) {
|
|
2122
|
+
if (model.input.includes("image")) return model;
|
|
2123
|
+
return {
|
|
2124
|
+
...model,
|
|
2125
|
+
input: Array.from(new Set([...model.input, "image"]))
|
|
2126
|
+
};
|
|
2127
|
+
}
|
|
2128
|
+
async function mapWithConcurrency(items, concurrency, fn, opts) {
|
|
2129
|
+
const limit = Math.max(1, Math.floor(concurrency));
|
|
2130
|
+
const results = Array.from({ length: items.length }, () => void 0);
|
|
2131
|
+
let nextIndex = 0;
|
|
2132
|
+
let completed = 0;
|
|
2133
|
+
const worker = async () => {
|
|
2134
|
+
while (true) {
|
|
2135
|
+
const current = nextIndex;
|
|
2136
|
+
nextIndex += 1;
|
|
2137
|
+
if (current >= items.length) return;
|
|
2138
|
+
results[current] = await fn(items[current], current);
|
|
2139
|
+
completed += 1;
|
|
2140
|
+
opts?.onProgress?.(completed, items.length);
|
|
2141
|
+
}
|
|
2142
|
+
};
|
|
2143
|
+
if (items.length === 0) {
|
|
2144
|
+
opts?.onProgress?.(0, 0);
|
|
2145
|
+
return results;
|
|
2146
|
+
}
|
|
2147
|
+
await Promise.all(Array.from({ length: Math.min(limit, items.length) }, () => worker()));
|
|
2148
|
+
return results;
|
|
2149
|
+
}
|
|
2150
|
+
async function scanOpenRouterModels(options = {}) {
|
|
2151
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
2152
|
+
const probe = options.probe ?? true;
|
|
2153
|
+
const apiKey = options.apiKey?.trim() || getEnvApiKey("openrouter") || "";
|
|
2154
|
+
if (probe && !apiKey) throw new Error("Missing OpenRouter API key. Set OPENROUTER_API_KEY to run models scan.");
|
|
2155
|
+
const timeoutMs = Math.max(1, Math.floor(options.timeoutMs ?? DEFAULT_TIMEOUT_MS));
|
|
2156
|
+
const concurrency = Math.max(1, Math.floor(options.concurrency ?? DEFAULT_CONCURRENCY));
|
|
2157
|
+
const minParamB = Math.max(0, Math.floor(options.minParamB ?? 0));
|
|
2158
|
+
const maxAgeDays = Math.max(0, Math.floor(options.maxAgeDays ?? 0));
|
|
2159
|
+
const providerFilter = options.providerFilter?.trim().toLowerCase() ?? "";
|
|
2160
|
+
const catalog = await fetchOpenRouterModels(fetchImpl);
|
|
2161
|
+
const now = Date.now();
|
|
2162
|
+
const filtered = catalog.filter((entry) => {
|
|
2163
|
+
if (!isFreeOpenRouterModel(entry)) return false;
|
|
2164
|
+
if (providerFilter) {
|
|
2165
|
+
if ((entry.id.split("/")[0]?.toLowerCase() ?? "") !== providerFilter) return false;
|
|
2166
|
+
}
|
|
2167
|
+
if (minParamB > 0) {
|
|
2168
|
+
if ((entry.inferredParamB ?? 0) < minParamB) return false;
|
|
2169
|
+
}
|
|
2170
|
+
if (maxAgeDays > 0 && entry.createdAtMs) {
|
|
2171
|
+
if ((now - entry.createdAtMs) / (1440 * 60 * 1e3) > maxAgeDays) return false;
|
|
2172
|
+
}
|
|
2173
|
+
return true;
|
|
2174
|
+
});
|
|
2175
|
+
const baseModel = getModel("openrouter", "openrouter/auto");
|
|
2176
|
+
options.onProgress?.({
|
|
2177
|
+
phase: "probe",
|
|
2178
|
+
completed: 0,
|
|
2179
|
+
total: filtered.length
|
|
2180
|
+
});
|
|
2181
|
+
return mapWithConcurrency(filtered, concurrency, async (entry) => {
|
|
2182
|
+
const isFree = isFreeOpenRouterModel(entry);
|
|
2183
|
+
if (!probe) return {
|
|
2184
|
+
id: entry.id,
|
|
2185
|
+
name: entry.name,
|
|
2186
|
+
provider: "openrouter",
|
|
2187
|
+
modelRef: `openrouter/${entry.id}`,
|
|
2188
|
+
contextLength: entry.contextLength,
|
|
2189
|
+
maxCompletionTokens: entry.maxCompletionTokens,
|
|
2190
|
+
supportedParametersCount: entry.supportedParametersCount,
|
|
2191
|
+
supportsToolsMeta: entry.supportsToolsMeta,
|
|
2192
|
+
modality: entry.modality,
|
|
2193
|
+
inferredParamB: entry.inferredParamB,
|
|
2194
|
+
createdAtMs: entry.createdAtMs,
|
|
2195
|
+
pricing: entry.pricing,
|
|
2196
|
+
isFree,
|
|
2197
|
+
tool: {
|
|
2198
|
+
ok: false,
|
|
2199
|
+
latencyMs: null,
|
|
2200
|
+
skipped: true
|
|
2201
|
+
},
|
|
2202
|
+
image: {
|
|
2203
|
+
ok: false,
|
|
2204
|
+
latencyMs: null,
|
|
2205
|
+
skipped: true
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
const model = {
|
|
2209
|
+
...baseModel,
|
|
2210
|
+
id: entry.id,
|
|
2211
|
+
name: entry.name || entry.id,
|
|
2212
|
+
contextWindow: entry.contextLength ?? baseModel.contextWindow,
|
|
2213
|
+
maxTokens: entry.maxCompletionTokens ?? baseModel.maxTokens,
|
|
2214
|
+
input: parseModality(entry.modality),
|
|
2215
|
+
reasoning: baseModel.reasoning
|
|
2216
|
+
};
|
|
2217
|
+
const toolResult = await probeTool(model, apiKey, timeoutMs);
|
|
2218
|
+
const imageResult = model.input.includes("image") ? await probeImage(ensureImageInput(model), apiKey, timeoutMs) : {
|
|
2219
|
+
ok: false,
|
|
2220
|
+
latencyMs: null,
|
|
2221
|
+
skipped: true
|
|
2222
|
+
};
|
|
2223
|
+
return {
|
|
2224
|
+
id: entry.id,
|
|
2225
|
+
name: entry.name,
|
|
2226
|
+
provider: "openrouter",
|
|
2227
|
+
modelRef: `openrouter/${entry.id}`,
|
|
2228
|
+
contextLength: entry.contextLength,
|
|
2229
|
+
maxCompletionTokens: entry.maxCompletionTokens,
|
|
2230
|
+
supportedParametersCount: entry.supportedParametersCount,
|
|
2231
|
+
supportsToolsMeta: entry.supportsToolsMeta,
|
|
2232
|
+
modality: entry.modality,
|
|
2233
|
+
inferredParamB: entry.inferredParamB,
|
|
2234
|
+
createdAtMs: entry.createdAtMs,
|
|
2235
|
+
pricing: entry.pricing,
|
|
2236
|
+
isFree,
|
|
2237
|
+
tool: toolResult,
|
|
2238
|
+
image: imageResult
|
|
2239
|
+
};
|
|
2240
|
+
}, { onProgress: (completed, total) => options.onProgress?.({
|
|
2241
|
+
phase: "probe",
|
|
2242
|
+
completed,
|
|
2243
|
+
total
|
|
2244
|
+
}) });
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
//#endregion
|
|
2248
|
+
//#region src/commands/models/scan.ts
|
|
2249
|
+
const MODEL_PAD = 42;
|
|
2250
|
+
const CTX_PAD = 8;
|
|
2251
|
+
const multiselect$1 = (params) => multiselect({
|
|
2252
|
+
...params,
|
|
2253
|
+
message: stylePromptMessage(params.message),
|
|
2254
|
+
options: params.options.map((opt) => opt.hint === void 0 ? opt : {
|
|
2255
|
+
...opt,
|
|
2256
|
+
hint: stylePromptHint(opt.hint)
|
|
2257
|
+
})
|
|
2258
|
+
});
|
|
2259
|
+
const pad = (value, size) => value.padEnd(size);
|
|
2260
|
+
const truncate = (value, max) => {
|
|
2261
|
+
if (value.length <= max) return value;
|
|
2262
|
+
if (max <= 3) return value.slice(0, max);
|
|
2263
|
+
return `${value.slice(0, max - 3)}...`;
|
|
2264
|
+
};
|
|
2265
|
+
function sortScanResults(results) {
|
|
2266
|
+
return results.slice().toSorted((a, b) => {
|
|
2267
|
+
const aImage = a.image.ok ? 1 : 0;
|
|
2268
|
+
const bImage = b.image.ok ? 1 : 0;
|
|
2269
|
+
if (aImage !== bImage) return bImage - aImage;
|
|
2270
|
+
const aToolLatency = a.tool.latencyMs ?? Number.POSITIVE_INFINITY;
|
|
2271
|
+
const bToolLatency = b.tool.latencyMs ?? Number.POSITIVE_INFINITY;
|
|
2272
|
+
if (aToolLatency !== bToolLatency) return aToolLatency - bToolLatency;
|
|
2273
|
+
return compareScanMetadata(a, b);
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
function sortImageResults(results) {
|
|
2277
|
+
return results.slice().toSorted((a, b) => {
|
|
2278
|
+
const aLatency = a.image.latencyMs ?? Number.POSITIVE_INFINITY;
|
|
2279
|
+
const bLatency = b.image.latencyMs ?? Number.POSITIVE_INFINITY;
|
|
2280
|
+
if (aLatency !== bLatency) return aLatency - bLatency;
|
|
2281
|
+
return compareScanMetadata(a, b);
|
|
2282
|
+
});
|
|
2283
|
+
}
|
|
2284
|
+
function compareScanMetadata(a, b) {
|
|
2285
|
+
const aCtx = a.contextLength ?? 0;
|
|
2286
|
+
const bCtx = b.contextLength ?? 0;
|
|
2287
|
+
if (aCtx !== bCtx) return bCtx - aCtx;
|
|
2288
|
+
const aParams = a.inferredParamB ?? 0;
|
|
2289
|
+
const bParams = b.inferredParamB ?? 0;
|
|
2290
|
+
if (aParams !== bParams) return bParams - aParams;
|
|
2291
|
+
return a.modelRef.localeCompare(b.modelRef);
|
|
2292
|
+
}
|
|
2293
|
+
function buildScanHint(result) {
|
|
2294
|
+
return [
|
|
2295
|
+
result.tool.ok ? `tool ${formatMs(result.tool.latencyMs)}` : "tool fail",
|
|
2296
|
+
result.image.skipped ? "img skip" : result.image.ok ? `img ${formatMs(result.image.latencyMs)}` : "img fail",
|
|
2297
|
+
result.contextLength ? `ctx ${formatTokenK(result.contextLength)}` : "ctx ?",
|
|
2298
|
+
result.inferredParamB ? `${result.inferredParamB}b` : null
|
|
2299
|
+
].filter(Boolean).join(" | ");
|
|
2300
|
+
}
|
|
2301
|
+
function printScanSummary(results, runtime) {
|
|
2302
|
+
const toolOk = results.filter((r) => r.tool.ok);
|
|
2303
|
+
const imageOk = results.filter((r) => r.image.ok);
|
|
2304
|
+
const toolImageOk = results.filter((r) => r.tool.ok && r.image.ok);
|
|
2305
|
+
const imageOnly = imageOk.filter((r) => !r.tool.ok);
|
|
2306
|
+
runtime.log(`Scan results: tested ${results.length}, tool ok ${toolOk.length}, image ok ${imageOk.length}, tool+image ok ${toolImageOk.length}, image only ${imageOnly.length}`);
|
|
2307
|
+
}
|
|
2308
|
+
function printScanTable(results, runtime) {
|
|
2309
|
+
const header = [
|
|
2310
|
+
pad("Model", MODEL_PAD),
|
|
2311
|
+
pad("Tool", 10),
|
|
2312
|
+
pad("Image", 10),
|
|
2313
|
+
pad("Ctx", CTX_PAD),
|
|
2314
|
+
pad("Params", 8),
|
|
2315
|
+
"Notes"
|
|
2316
|
+
].join(" ");
|
|
2317
|
+
runtime.log(header);
|
|
2318
|
+
for (const entry of results) {
|
|
2319
|
+
const modelLabel = pad(truncate(entry.modelRef, MODEL_PAD), MODEL_PAD);
|
|
2320
|
+
const toolLabel = pad(entry.tool.ok ? formatMs(entry.tool.latencyMs) : "fail", 10);
|
|
2321
|
+
const imageLabel = pad(entry.image.ok ? formatMs(entry.image.latencyMs) : entry.image.skipped ? "skip" : "fail", 10);
|
|
2322
|
+
const ctxLabel = pad(formatTokenK(entry.contextLength), CTX_PAD);
|
|
2323
|
+
const paramsLabel = pad(entry.inferredParamB ? `${entry.inferredParamB}b` : "-", 8);
|
|
2324
|
+
const notes = entry.modality ? `modality:${entry.modality}` : "";
|
|
2325
|
+
runtime.log([
|
|
2326
|
+
modelLabel,
|
|
2327
|
+
toolLabel,
|
|
2328
|
+
imageLabel,
|
|
2329
|
+
ctxLabel,
|
|
2330
|
+
paramsLabel,
|
|
2331
|
+
notes
|
|
2332
|
+
].join(" "));
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
async function modelsScanCommand(opts, runtime) {
|
|
2336
|
+
const minParams = opts.minParams ? Number(opts.minParams) : void 0;
|
|
2337
|
+
if (minParams !== void 0 && (!Number.isFinite(minParams) || minParams < 0)) throw new Error("--min-params must be >= 0");
|
|
2338
|
+
const maxAgeDays = opts.maxAgeDays ? Number(opts.maxAgeDays) : void 0;
|
|
2339
|
+
if (maxAgeDays !== void 0 && (!Number.isFinite(maxAgeDays) || maxAgeDays < 0)) throw new Error("--max-age-days must be >= 0");
|
|
2340
|
+
const maxCandidates = opts.maxCandidates ? Number(opts.maxCandidates) : 6;
|
|
2341
|
+
if (!Number.isFinite(maxCandidates) || maxCandidates <= 0) throw new Error("--max-candidates must be > 0");
|
|
2342
|
+
const timeout = opts.timeout ? Number(opts.timeout) : void 0;
|
|
2343
|
+
if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout <= 0)) throw new Error("--timeout must be > 0");
|
|
2344
|
+
const concurrency = opts.concurrency ? Number(opts.concurrency) : void 0;
|
|
2345
|
+
if (concurrency !== void 0 && (!Number.isFinite(concurrency) || concurrency <= 0)) throw new Error("--concurrency must be > 0");
|
|
2346
|
+
const cfg = loadConfig();
|
|
2347
|
+
const probe = opts.probe ?? true;
|
|
2348
|
+
let storedKey;
|
|
2349
|
+
if (probe) try {
|
|
2350
|
+
storedKey = (await resolveApiKeyForProvider({
|
|
2351
|
+
provider: "openrouter",
|
|
2352
|
+
cfg
|
|
2353
|
+
})).apiKey;
|
|
2354
|
+
} catch {
|
|
2355
|
+
storedKey = void 0;
|
|
2356
|
+
}
|
|
2357
|
+
const results = await withProgressTotals({
|
|
2358
|
+
label: "Scanning OpenRouter models...",
|
|
2359
|
+
indeterminate: false,
|
|
2360
|
+
enabled: opts.json !== true
|
|
2361
|
+
}, async (update) => await scanOpenRouterModels({
|
|
2362
|
+
apiKey: storedKey ?? void 0,
|
|
2363
|
+
minParamB: minParams,
|
|
2364
|
+
maxAgeDays,
|
|
2365
|
+
providerFilter: opts.provider,
|
|
2366
|
+
timeoutMs: timeout,
|
|
2367
|
+
concurrency,
|
|
2368
|
+
probe,
|
|
2369
|
+
onProgress: ({ phase, completed, total }) => {
|
|
2370
|
+
if (phase !== "probe") return;
|
|
2371
|
+
update({
|
|
2372
|
+
completed,
|
|
2373
|
+
total,
|
|
2374
|
+
label: `${probe ? "Probing models" : "Scanning models"} (${completed}/${total})`
|
|
2375
|
+
});
|
|
2376
|
+
}
|
|
2377
|
+
}));
|
|
2378
|
+
if (!probe) {
|
|
2379
|
+
if (!opts.json) {
|
|
2380
|
+
runtime.log(`Found ${results.length} OpenRouter free models (metadata only; pass --probe to test tools/images).`);
|
|
2381
|
+
printScanTable(sortScanResults(results), runtime);
|
|
2382
|
+
} else runtime.log(JSON.stringify(results, null, 2));
|
|
2383
|
+
return;
|
|
2384
|
+
}
|
|
2385
|
+
const toolOk = results.filter((entry) => entry.tool.ok);
|
|
2386
|
+
if (toolOk.length === 0) throw new Error("No tool-capable OpenRouter free models found.");
|
|
2387
|
+
const sorted = sortScanResults(results);
|
|
2388
|
+
const toolSorted = sortScanResults(toolOk);
|
|
2389
|
+
const imageSorted = sortImageResults(results.filter((entry) => entry.image.ok));
|
|
2390
|
+
const imagePreferred = toolSorted.filter((entry) => entry.image.ok);
|
|
2391
|
+
const preselected = (imagePreferred.length > 0 ? imagePreferred : toolSorted).slice(0, Math.floor(maxCandidates)).map((entry) => entry.modelRef);
|
|
2392
|
+
const imagePreselected = imageSorted.slice(0, Math.floor(maxCandidates)).map((entry) => entry.modelRef);
|
|
2393
|
+
if (!opts.json) {
|
|
2394
|
+
printScanSummary(results, runtime);
|
|
2395
|
+
printScanTable(sorted, runtime);
|
|
2396
|
+
}
|
|
2397
|
+
const noInput = opts.input === false;
|
|
2398
|
+
const canPrompt = process.stdin.isTTY && !opts.yes && !noInput && !opts.json;
|
|
2399
|
+
let selected = preselected;
|
|
2400
|
+
let selectedImages = imagePreselected;
|
|
2401
|
+
if (canPrompt) {
|
|
2402
|
+
const selection = await multiselect$1({
|
|
2403
|
+
message: "Select fallback models (ordered)",
|
|
2404
|
+
options: toolSorted.map((entry) => ({
|
|
2405
|
+
value: entry.modelRef,
|
|
2406
|
+
label: entry.modelRef,
|
|
2407
|
+
hint: buildScanHint(entry)
|
|
2408
|
+
})),
|
|
2409
|
+
initialValues: preselected
|
|
2410
|
+
});
|
|
2411
|
+
if (isCancel(selection)) {
|
|
2412
|
+
cancel(stylePromptTitle("Model scan cancelled.") ?? "Model scan cancelled.");
|
|
2413
|
+
runtime.exit(0);
|
|
2414
|
+
}
|
|
2415
|
+
selected = selection;
|
|
2416
|
+
if (imageSorted.length > 0) {
|
|
2417
|
+
const imageSelection = await multiselect$1({
|
|
2418
|
+
message: "Select image fallback models (ordered)",
|
|
2419
|
+
options: imageSorted.map((entry) => ({
|
|
2420
|
+
value: entry.modelRef,
|
|
2421
|
+
label: entry.modelRef,
|
|
2422
|
+
hint: buildScanHint(entry)
|
|
2423
|
+
})),
|
|
2424
|
+
initialValues: imagePreselected
|
|
2425
|
+
});
|
|
2426
|
+
if (isCancel(imageSelection)) {
|
|
2427
|
+
cancel(stylePromptTitle("Model scan cancelled.") ?? "Model scan cancelled.");
|
|
2428
|
+
runtime.exit(0);
|
|
2429
|
+
}
|
|
2430
|
+
selectedImages = imageSelection;
|
|
2431
|
+
}
|
|
2432
|
+
} else if (!process.stdin.isTTY && !opts.yes && !noInput && !opts.json) throw new Error("Non-interactive scan: pass --yes to apply defaults.");
|
|
2433
|
+
if (selected.length === 0) throw new Error("No models selected for fallbacks.");
|
|
2434
|
+
if (opts.setImage && selectedImages.length === 0) throw new Error("No image-capable models selected for image model.");
|
|
2435
|
+
await updateConfig((cfg) => {
|
|
2436
|
+
const nextModels = { ...cfg.agents?.defaults?.models };
|
|
2437
|
+
for (const entry of selected) if (!nextModels[entry]) nextModels[entry] = {};
|
|
2438
|
+
for (const entry of selectedImages) if (!nextModels[entry]) nextModels[entry] = {};
|
|
2439
|
+
const existingImageModel = cfg.agents?.defaults?.imageModel;
|
|
2440
|
+
const nextImageModel = selectedImages.length > 0 ? {
|
|
2441
|
+
...existingImageModel?.primary ? { primary: existingImageModel.primary } : void 0,
|
|
2442
|
+
fallbacks: selectedImages,
|
|
2443
|
+
...opts.setImage ? { primary: selectedImages[0] } : {}
|
|
2444
|
+
} : cfg.agents?.defaults?.imageModel;
|
|
2445
|
+
const existingModel = cfg.agents?.defaults?.model;
|
|
2446
|
+
const defaults = {
|
|
2447
|
+
...cfg.agents?.defaults,
|
|
2448
|
+
model: {
|
|
2449
|
+
...existingModel?.primary ? { primary: existingModel.primary } : void 0,
|
|
2450
|
+
fallbacks: selected,
|
|
2451
|
+
...opts.setDefault ? { primary: selected[0] } : {}
|
|
2452
|
+
},
|
|
2453
|
+
...nextImageModel ? { imageModel: nextImageModel } : {},
|
|
2454
|
+
models: nextModels
|
|
2455
|
+
};
|
|
2456
|
+
return {
|
|
2457
|
+
...cfg,
|
|
2458
|
+
agents: {
|
|
2459
|
+
...cfg.agents,
|
|
2460
|
+
defaults
|
|
2461
|
+
}
|
|
2462
|
+
};
|
|
2463
|
+
});
|
|
2464
|
+
if (opts.json) {
|
|
2465
|
+
runtime.log(JSON.stringify({
|
|
2466
|
+
selected,
|
|
2467
|
+
selectedImages,
|
|
2468
|
+
setDefault: Boolean(opts.setDefault),
|
|
2469
|
+
setImage: Boolean(opts.setImage),
|
|
2470
|
+
results,
|
|
2471
|
+
warnings: []
|
|
2472
|
+
}, null, 2));
|
|
2473
|
+
return;
|
|
2474
|
+
}
|
|
2475
|
+
logConfigUpdated(runtime);
|
|
2476
|
+
runtime.log(`Fallbacks: ${selected.join(", ")}`);
|
|
2477
|
+
if (selectedImages.length > 0) runtime.log(`Image fallbacks: ${selectedImages.join(", ")}`);
|
|
2478
|
+
if (opts.setDefault) runtime.log(`Default model: ${selected[0]}`);
|
|
2479
|
+
if (opts.setImage && selectedImages.length > 0) runtime.log(`Image model: ${selectedImages[0]}`);
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
//#endregion
|
|
2483
|
+
//#region src/commands/models/set.ts
|
|
2484
|
+
async function modelsSetCommand(modelRaw, runtime) {
|
|
2485
|
+
const updated = await updateConfig((cfg) => {
|
|
2486
|
+
const resolved = resolveModelTarget({
|
|
2487
|
+
raw: modelRaw,
|
|
2488
|
+
cfg
|
|
2489
|
+
});
|
|
2490
|
+
const key = `${resolved.provider}/${resolved.model}`;
|
|
2491
|
+
const nextModels = { ...cfg.agents?.defaults?.models };
|
|
2492
|
+
if (!nextModels[key]) nextModels[key] = {};
|
|
2493
|
+
const existingModel = cfg.agents?.defaults?.model;
|
|
2494
|
+
return {
|
|
2495
|
+
...cfg,
|
|
2496
|
+
agents: {
|
|
2497
|
+
...cfg.agents,
|
|
2498
|
+
defaults: {
|
|
2499
|
+
...cfg.agents?.defaults,
|
|
2500
|
+
model: {
|
|
2501
|
+
...existingModel?.fallbacks ? { fallbacks: existingModel.fallbacks } : void 0,
|
|
2502
|
+
primary: key
|
|
2503
|
+
},
|
|
2504
|
+
models: nextModels
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
};
|
|
2508
|
+
});
|
|
2509
|
+
logConfigUpdated(runtime);
|
|
2510
|
+
runtime.log(`Default model: ${updated.agents?.defaults?.model?.primary ?? modelRaw}`);
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
//#endregion
|
|
2514
|
+
//#region src/commands/models/set-image.ts
|
|
2515
|
+
async function modelsSetImageCommand(modelRaw, runtime) {
|
|
2516
|
+
const updated = await updateConfig((cfg) => {
|
|
2517
|
+
const resolved = resolveModelTarget({
|
|
2518
|
+
raw: modelRaw,
|
|
2519
|
+
cfg
|
|
2520
|
+
});
|
|
2521
|
+
const key = `${resolved.provider}/${resolved.model}`;
|
|
2522
|
+
const nextModels = { ...cfg.agents?.defaults?.models };
|
|
2523
|
+
if (!nextModels[key]) nextModels[key] = {};
|
|
2524
|
+
const existingModel = cfg.agents?.defaults?.imageModel;
|
|
2525
|
+
return {
|
|
2526
|
+
...cfg,
|
|
2527
|
+
agents: {
|
|
2528
|
+
...cfg.agents,
|
|
2529
|
+
defaults: {
|
|
2530
|
+
...cfg.agents?.defaults,
|
|
2531
|
+
imageModel: {
|
|
2532
|
+
...existingModel?.fallbacks ? { fallbacks: existingModel.fallbacks } : void 0,
|
|
2533
|
+
primary: key
|
|
2534
|
+
},
|
|
2535
|
+
models: nextModels
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
};
|
|
2539
|
+
});
|
|
2540
|
+
logConfigUpdated(runtime);
|
|
2541
|
+
runtime.log(`Image model: ${updated.agents?.defaults?.imageModel?.primary ?? modelRaw}`);
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
//#endregion
|
|
2545
|
+
export { modelsAuthPasteTokenCommand as _, modelsImageFallbacksClearCommand as a, modelsAliasesListCommand as b, modelsFallbacksAddCommand as c, modelsFallbacksRemoveCommand as d, modelsAuthOrderClearCommand as f, modelsAuthLoginCommand as g, modelsAuthAddCommand as h, modelsImageFallbacksAddCommand as i, modelsFallbacksClearCommand as l, modelsAuthOrderSetCommand as m, modelsListCommand, modelsStatusCommand, modelsSetCommand as n, modelsImageFallbacksListCommand as o, modelsAuthOrderGetCommand as p, modelsScanCommand as r, modelsImageFallbacksRemoveCommand as s, modelsSetImageCommand as t, modelsFallbacksListCommand as u, modelsAuthSetupTokenCommand as v, modelsAliasesRemoveCommand as x, modelsAliasesAddCommand as y };
|