@gguf/claw 2026.2.9 → 2026.2.13
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 +159 -0
- package/LICENSE +1 -1
- package/dist/{accounts-MyAvfCVH.js → accounts-54zZMYCo.js} +5 -2
- package/dist/{accounts-DbzMEfKN.js → accounts-Bvh0DFxS.js} +5 -2
- package/dist/{acp-cli-MZ3h1E1n.js → acp-cli-BslcOPdx.js} +146 -25
- package/dist/{acp-cli-DKJRTfwB.js → acp-cli-D6rk5cOh.js} +145 -24
- package/dist/{agent-whSJT2Lk.js → agent-C0yL70cy.js} +26 -20
- package/dist/{agent-c1QNeDmV.js → agent-DjZxytiC.js} +26 -20
- package/dist/{agent-scope-D3me2AZa.js → agent-scope-Bkr9fZtl.js} +31 -14
- package/dist/{agent-scope-Dp8sREli.js → agent-scope-DASgjz2_.js} +199 -14
- package/dist/{agent-scope-DnyDZ5RH.js → agent-scope-GYIs5dyU.js} +30 -13
- package/dist/{agent-scope-Dpav7C-i.js → agent-scope-okUOVjE5.js} +32 -11
- package/dist/audio-preflight-B0kLz-Ma.js +60 -0
- package/dist/audio-preflight-BCs_J33s.js +60 -0
- package/dist/audio-preflight-CTl2RCyF.js +71 -0
- package/dist/audio-preflight-MhF6YlAY.js +74 -0
- package/dist/{audit-BFYy1qSw.js → audit-BYfhZ7LA.js} +454 -31
- package/dist/{audit-Dn2cBl2x.js → audit-CfPZ_5Id.js} +452 -29
- package/dist/auth-9nTeB2Je.js +602 -0
- package/dist/auth-CLhyWwAU.js +593 -0
- package/dist/{auth-health-Cx5exPMV.js → auth-health-CWiLyzSr.js} +1 -1
- package/dist/{auth-health-DjT4fUpw.js → auth-health-qD4RND47.js} +1 -1
- package/dist/{auth-profiles-FJ3VY25a.js → auth-profiles-Cp9MtUdM.js} +353 -33
- package/dist/build-info.json +2 -2
- package/dist/bundled/boot-md/handler.js +33 -25
- package/dist/bundled/session-memory/handler.js +33 -22
- package/dist/{call-CD2IZCHT.js → call-CjEdFGAf.js} +7 -7
- package/dist/{call-CM25qgxz.js → call-DAfkvtVq.js} +6 -6
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/a2ui/a2ui.bundle.js +7 -1
- package/dist/{channel-options-CremuJyh.js → channel-options-B8dPzlyO.js} +4 -4
- package/dist/{channel-options-D-JnJ4Ft.js → channel-options-Bq5IC5Tv.js} +12 -7
- package/dist/{channel-selection-DAHCVAX4.js → channel-selection-BaW1xXEa.js} +2 -2
- package/dist/{channel-selection-DPV9hvY8.js → channel-selection-dR0jCgTn.js} +2 -2
- package/dist/{channels-cli-6deHFr9t.js → channels-cli-hPo28hWS.js} +61 -56
- package/dist/{channels-cli-D3tKmhlt.js → channels-cli-zi3rO0jq.js} +62 -57
- package/dist/{channels-status-issues-BN1ICfdy.js → channels-status-issues-kb-M2Fi0.js} +1 -1
- package/dist/{channels-status-issues-DFhI_u0p.js → channels-status-issues-ketdwZun.js} +1 -1
- package/dist/{chrome-B2UjqY-9.js → chrome--Fe8F5Kf.js} +24 -12
- package/dist/{chrome-COabMr6f.js → chrome-BWeMtFGf.js} +24 -12
- package/dist/{chrome-CQd_MVOA.js → chrome-Bx24uq7B.js} +27 -15
- package/dist/{chrome-CxRJz4ZD.js → chrome-n_3rtK2c.js} +22 -11
- package/dist/{clack-prompter-BkNZ4Xdw.js → clack-prompter-B-tJmODa.js} +5 -5
- package/dist/{clack-prompter-DuBVnTKy.js → clack-prompter-DpuKn_Uy.js} +5 -5
- package/dist/cli/daemon-cli.js +8 -1
- package/dist/cli-9lwO6Ttx.js +94 -0
- package/dist/cli-CNNdyxPO.js +91 -0
- package/dist/{client-DMloFP_O.js → client-BhZjzrH2.js} +73 -9
- package/dist/{client-C0gQ7hrj.js → client-DyAxKXKY.js} +73 -9
- package/dist/{command-format-ayFsmwwz.js → command-format-Bxe0mWee.js} +1 -1
- package/dist/{command-options-BQdH6qnK.js → command-options-BDV7Xgs-.js} +9 -4
- package/dist/{commands-BWHYcc83.js → commands-gOiRcfoU.js} +4 -4
- package/dist/{tui-formatters-BDP_71Xt.js → commands-registry-6NUFrejL.js} +6 -114
- package/dist/{tui-formatters-CIx4sCQO.js → commands-registry-DGgkLQ7A.js} +6 -114
- package/dist/{completion-cli-DEJia0V1.js → completion-cli-B1kHKJZX.js} +30 -30
- package/dist/{completion-cli-D_0fx2O6.js → completion-cli-Drks7xRK.js} +3 -3
- package/dist/{config-CQt4vGxI.js → config-7NCznPmF.js} +336 -97
- package/dist/{config-fCnPoWjU.js → config-B8v0zg48.js} +295 -99
- package/dist/{config-Bj2eDa02.js → config-CeWMHOiQ.js} +295 -99
- package/dist/{config-ethqi73X.js → config-D8pgDSNo.js} +358 -99
- package/dist/{config-guard-BJuqQvng.js → config-guard-RbHxYc9j.js} +212 -63
- package/dist/{configure-skrLiSwW.js → configure-DLp2Xz7L.js} +59 -40
- package/dist/{configure-C-pYuYg_.js → configure-Su1S0gi-.js} +58 -39
- package/dist/control-auth-BlWU-jBl.js +54 -0
- package/dist/control-auth-C8rIqEdA.js +54 -0
- package/dist/{control-service-BDgF-FZ0.js → control-service-BNDthc1N.js} +11 -5
- package/dist/{control-service-Djd_WI3_.js → control-service-COF59GQe.js} +10 -4
- package/dist/control-ui/assets/{index-CnB9IO4a.js → index-BECn2L1T.js} +369 -368
- package/dist/control-ui/assets/index-BECn2L1T.js.map +1 -0
- package/dist/control-ui/assets/index-DRPcd1Z4.css +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/{cron-cli-CB6CufAb.js → cron-cli-CSy4-JGS.js} +20 -20
- package/dist/{cron-cli-Db6fardJ.js → cron-cli-Db3uCDIT.js} +21 -21
- package/dist/{daemon-cli-Xe22v7lZ.js → daemon-cli-BLbzcTuD.js} +61 -22
- package/dist/{daemon-cli-BlHK0ly2.js → daemon-cli-DR0D35MO.js} +60 -21
- package/dist/{daemon-runtime-CMqH8BUE.js → daemon-runtime-ZWXvLDxx.js} +3 -3
- package/dist/{daemon-runtime-DwQFvDXZ.js → daemon-runtime-pVcZ2KDE.js} +3 -3
- package/dist/{deliver-CD7-BhYD.js → deliver-BHNoC9Yk.js} +396 -290
- package/dist/{deliver-BdGjIcTC.js → deliver-C_5eGQrX.js} +392 -286
- package/dist/{deliver-nTKaXF--.js → deliver-DPHZlWgr.js} +392 -287
- package/dist/{deliver-CDMGxRoW.js → deliver-geVWJ52I.js} +394 -288
- package/dist/{deps-BDQ_K8zf.js → deps-CP0dcOgD.js} +2 -2
- package/dist/{deps-D60FbgTP.js → deps-DW5r2IEk.js} +2 -2
- package/dist/{devices-cli-N559801X.js → devices-cli-BViqX5pl.js} +15 -15
- package/dist/{devices-cli-IxmPLIk8.js → devices-cli-DpYaY-iM.js} +14 -14
- package/dist/{directory-cli-Caq-OYk8.js → directory-cli-BWD1DdKf.js} +16 -16
- package/dist/{directory-cli-ClrdmQL-.js → directory-cli-BcvZfkfo.js} +17 -17
- package/dist/{dispatcher-BfXtm4Dl.js → dispatcher-4Qn951N3.js} +5 -3
- package/dist/{dns-cli-DgVO0Pkw.js → dns-cli-_Ych2tu9.js} +12 -12
- package/dist/{dns-cli-BTNZkWHs.js → dns-cli-gQCxUXgU.js} +13 -13
- package/dist/{docs-cli-9Xan7C6D.js → docs-cli-Bseiau7J.js} +7 -7
- package/dist/{docs-cli-DZULc91f.js → docs-cli-DzBTlWQE.js} +8 -8
- package/dist/{doctor-D39rZvNH.js → doctor-BNkYYahD.js} +37 -36
- package/dist/{doctor-Dq1YeYdH.js → doctor-DzIgdPx1.js} +37 -36
- package/dist/entry.js +77 -21
- package/dist/{env-B5YXooWp.js → env-BUuSkE19.js} +1 -1
- package/dist/{exec-DFOtZbI0.js → exec-BPQSKwGa.js} +5 -3
- package/dist/{exec-B8JKbXKW.js → exec-DqZFMawz.js} +5 -3
- package/dist/{exec-Bas1hoSJ.js → exec-EKUaAU91.js} +57 -18
- package/dist/{exec-CiH_vkWn.js → exec-_PSUrMP8.js} +528 -19
- package/dist/{exec-approvals-DGPTjO0N.js → exec-approvals-Bqk-tIxY.js} +134 -51
- package/dist/{exec-approvals-C9InMoAB.js → exec-approvals-C67V-ljH.js} +134 -51
- package/dist/{exec-approvals-cli-EASbqFd-.js → exec-approvals-cli-D6vfSqQu.js} +22 -22
- package/dist/{exec-approvals-cli-DPHItoxG.js → exec-approvals-cli-DAdoki_R.js} +21 -21
- package/dist/extensionAPI.js +8518 -9140
- package/dist/fetch-Bz1WxfzV.js +285 -0
- package/dist/fetch-D2O8s8I1.js +285 -0
- package/dist/fetch-Dm-nCwa_.js +285 -0
- package/dist/fetch-wuOZDzdT.js +285 -0
- package/dist/{gateway-cli-BFqUIif8.js → gateway-cli-C-k7JPlr.js} +1868 -1072
- package/dist/{gateway-cli-v4kSPsLE.js → gateway-cli-DIIJ9Z0Y.js} +1870 -1074
- package/dist/{gateway-rpc-D6LrkcSA.js → gateway-rpc-D6jLh81b.js} +3 -3
- package/dist/{gateway-rpc-dHFK02Kk.js → gateway-rpc-aqysUyf5.js} +3 -3
- package/dist/{github-copilot-auth-CQIWc0hC.js → github-copilot-auth-BUqfX7hG.js} +316 -52
- package/dist/{github-copilot-auth-D2jfnapd.js → github-copilot-auth-By-nyRb6.js} +316 -52
- package/dist/{github-copilot-token-SLWintYd.js → github-copilot-token-C9W4SY9o.js} +7 -4
- package/dist/{github-copilot-token-BW-SEg7E.js → github-copilot-token-CiF5Iyi2.js} +6 -3
- package/dist/{github-copilot-token-C9IJh2Pn.js → github-copilot-token-DatTe1w-.js} +6 -3
- package/dist/{github-copilot-token-wCk9Fg_E.js → github-copilot-token-c9Igt3ZH.js} +6 -3
- package/dist/{gmail-setup-utils-CVNgLkXL.js → gmail-setup-utils-HvKMdooP.js} +4 -4
- package/dist/{gmail-setup-utils-CAM1vbUS.js → gmail-setup-utils-c-iF00aL.js} +3 -3
- package/dist/{health-format-C77hrjEQ.js → health-format-BORnJOeS.js} +106 -44
- package/dist/{health-format-DDYtlkB9.js → health-format-Nd0jcoqM.js} +105 -43
- package/dist/{help-format-CUnac_bT.js → help-format-Cd5PLwXe.js} +1 -1
- package/dist/{help-format-aiW76js8.js → help-format-DYBEvMOX.js} +1 -1
- package/dist/{hooks-cli-DsflBRxX.js → hooks-cli-3KdsbdRi.js} +53 -47
- package/dist/{hooks-cli-C7kctMuZ.js → hooks-cli-BThja6wK.js} +53 -47
- package/dist/{hooks-status-DRAVHSPg.js → hooks-status-BbIz0zmm.js} +6 -5
- package/dist/{hooks-status-lHWrY64E.js → hooks-status-DPJORMB6.js} +6 -5
- package/dist/{image--gbzucyh.js → image-BaJKrmCs.js} +12 -8
- package/dist/{image-ORs4LLwg.js → image-D-5pUELC.js} +13 -9
- package/dist/{image-DMnjYGdA.js → image-TvL5YI_W.js} +13 -9
- package/dist/{image-BVNytEIn.js → image-bodq5cUH.js} +13 -9
- package/dist/index.js +261 -109
- package/dist/{installs-CXGV291R.js → installs-BrOMqREO.js} +7 -6
- package/dist/{installs-89zeUsVn.js → installs-z69au9Te.js} +7 -6
- package/dist/{links-Dg90NTyF.js → links-AVB88xxH.js} +1 -1
- package/dist/{links-7M-j83As.js → links-DpxpaKe1.js} +1 -1
- package/dist/llm-slug-generator.js +18 -19
- package/dist/{loader-BnzQyT31.js → loader-CS-5lMQa.js} +3694 -4531
- package/dist/{logging-DuK6YXuK.js → logging-B3KnAryz.js} +2 -2
- package/dist/{logging-CNq0UUgf.js → logging-DEPo2hji.js} +1 -1
- package/dist/{login-qr-CJ__cE3-.js → login-qr--28WL1TN.js} +11 -5
- package/dist/{login-qr-BVeOFfNW.js → login-qr-4o2aC2UE.js} +9 -4
- package/dist/{login-qr-BJChByHH.js → login-qr-BUdeu1Sl.js} +8 -2
- package/dist/{login-qr-KUOtNJaQ.js → login-qr-BsYM2E1y.js} +12 -6
- package/dist/{logs-cli-Cm7AiarR.js → logs-cli-DDMD5w5_.js} +38 -22
- package/dist/{logs-cli-BWmtAsjp.js → logs-cli-DvPoVKCN.js} +38 -22
- package/dist/{manager-C-jXr9ks.js → manager-CXo1uqmO.js} +102 -86
- package/dist/{manager-CMFBuvVd.js → manager-ChW0jk7T.js} +101 -85
- package/dist/{manager-D2Ndphg3.js → manager-DUOe7ud6.js} +100 -85
- package/dist/{manager-BsdlwsL5.js → manager-PoxUqdN_.js} +98 -82
- package/dist/{manifest-registry-D5SiA3xq.js → manifest-registry-CVsqjgX0.js} +40 -2
- package/dist/{manifest-registry-DyMRD3rY.js → manifest-registry-jeAPx6AW.js} +40 -2
- package/dist/{message-channel-CHRYQtAM.js → message-channel-CTtrEkmW.js} +1 -1
- package/dist/{message-channel-BlgPSDAh.js → message-channel-DWcu72r7.js} +1 -1
- package/dist/{model-auth-BqjMkNFs.js → model-auth-BvODRbV0.js} +362 -35
- package/dist/{model-selection-DbsbOAoh.js → model-selection-B53OvWCf.js} +353 -33
- package/dist/{model-selection-DlV6wnTr.js → model-selection-vC82fEiP.js} +331 -30
- package/dist/{models-cli-DIFBrK4W.js → models-cli-DqsKsOgd.js} +66 -55
- package/dist/{models-cli-0XhQQbMW.js → models-cli-NV0bnh8l.js} +66 -55
- package/dist/{node-cli-BMUfVCSq.js → node-cli-C7YleuBk.js} +54 -44
- package/dist/{node-cli-DY4lzhDA.js → node-cli-CxwoHnZ6.js} +54 -44
- package/dist/{node-service-DQ-tiSie.js → node-service-C7f_uvx9.js} +2 -2
- package/dist/{node-service-u8g85nD3.js → node-service-De_WkxJe.js} +2 -2
- package/dist/{nodes-cli-BX6oWnLC.js → nodes-cli-BxrMVI9V.js} +25 -23
- package/dist/{nodes-cli-CVHzcQo2.js → nodes-cli-Clb0ocwB.js} +24 -22
- package/dist/{nodes-screen-DGlNPbk4.js → nodes-screen-CVL9363A.js} +48 -6
- package/dist/{nodes-screen-lykd2cny.js → nodes-screen-DsHJIN2I.js} +47 -5
- package/dist/{note-Ci08TSbV.js → note-Duiadw1g.js} +1 -1
- package/dist/{note-DVO1KLaW.js → note-uC6iDp4y.js} +2 -2
- package/dist/{onboard-channels-DTkFFbzS.js → onboard-channels-C5Iaafwb.js} +10 -10
- package/dist/{onboard-channels-CtDnwaF5.js → onboard-channels-C5uL3i8d.js} +11 -11
- package/dist/{onboard-skills-BnAcpzfX.js → onboard-skills-BFxdI1Y1.js} +1143 -112
- package/dist/{onboard-skills-DuoDzEmI.js → onboard-skills-DUG8Y0se.js} +1142 -111
- package/dist/{onboarding-DvhiiHh0.js → onboarding-ClzElK4D.js} +56 -48
- package/dist/{openclaw-root-93W6UrUK.js → openclaw-root-BKsZvO6K.js} +6 -2
- package/dist/{openclaw-root-9ILYSmJ9.js → openclaw-root-CEnmuBUN.js} +6 -2
- package/dist/{pairing-cli-BKJHBxwT.js → pairing-cli-BWWFZF7Q.js} +16 -16
- package/dist/{pairing-cli-DJHjPBwu.js → pairing-cli-BrFLxnug.js} +16 -16
- package/dist/{pairing-labels-xImhiJax.js → pairing-labels-C8KULWNH.js} +1 -1
- package/dist/{pairing-labels-CHxlh3tT.js → pairing-labels-Dt2vXyI7.js} +1 -1
- package/dist/{pairing-store-CO6umWFP.js → pairing-store-Dz-ArTQS.js} +3 -3
- package/dist/{pairing-store-BpPUNzmB.js → pairing-store-gQdv7Ruh.js} +2 -2
- package/dist/{path-env-Nq83EHH9.js → path-env-BRKerjt1.js} +2 -2
- package/dist/{path-env-CXWUFfFv.js → path-env-OJAyUeWW.js} +1 -1
- package/dist/paths-BZK4Ct0I.js +81 -0
- package/dist/paths-DWYi0R_2.js +78 -0
- package/dist/{paths-Bkhd_qY8.js → paths-DdKf4lHp.js} +35 -5
- package/dist/paths-SFzVNGbc.js +78 -0
- package/dist/pi-auth-json-D7hGObyW.js +12 -0
- package/dist/pi-auth-json-DgvHjfJy.js +8 -0
- package/dist/pi-auth-json-la6lnAzY.js +79 -0
- package/dist/pi-auth-json-p3vsMR7W.js +79 -0
- package/dist/{pi-embedded-C1qKCgDT.js → pi-embedded-De6SeAPs.js} +9518 -9968
- package/dist/{pi-embedded-helpers-DtPn5RC8.js → pi-embedded-helpers-BrUBxrE2.js} +70 -10
- package/dist/{pi-embedded-helpers-DhEkdWB1.js → pi-embedded-helpers-D0mqOwwq.js} +821 -128
- package/dist/{pi-embedded-helpers-7AjuNiiJ.js → pi-embedded-helpers-DpJb0kUk.js} +69 -9
- package/dist/{pi-embedded-helpers-BTkXgwJ7.js → pi-embedded-helpers-ZI1UCSRM.js} +927 -136
- package/dist/{pi-tools.policy-gG96mWwA.js → pi-tools.policy-z5Wd_2WN.js} +4 -4
- package/dist/{plugin-auto-enable-D5ye7QnB.js → plugin-auto-enable-B8mX3rX3.js} +14 -5
- package/dist/{plugin-auto-enable-BROgMZcf.js → plugin-auto-enable-OO0eDINB.js} +14 -5
- package/dist/plugin-sdk/agents/apply-patch-update.d.ts +3 -1
- package/dist/plugin-sdk/agents/apply-patch.d.ts +11 -3
- package/dist/plugin-sdk/agents/auth-profiles/profiles.d.ts +5 -0
- package/dist/plugin-sdk/agents/auth-profiles.d.ts +1 -1
- package/dist/plugin-sdk/agents/bash-process-registry.d.ts +1 -0
- package/dist/plugin-sdk/agents/bash-tools.exec.d.ts +26 -0
- package/dist/plugin-sdk/agents/current-time.d.ts +17 -0
- package/dist/plugin-sdk/agents/huggingface-models.d.ts +17 -0
- package/dist/plugin-sdk/agents/models-config.providers.d.ts +10 -0
- package/dist/plugin-sdk/agents/openclaw-tools.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-auth-json.d.ts +14 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/errors.d.ts +5 -1
- package/dist/plugin-sdk/agents/pi-embedded-helpers.d.ts +1 -1
- package/dist/plugin-sdk/agents/pi-embedded-runner/google.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/images.d.ts +9 -4
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/payloads.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/types.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/types.d.ts +15 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.tools.d.ts +1 -1
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.types.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.types.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-tools.read.d.ts +8 -3
- package/dist/plugin-sdk/agents/sandbox/constants.d.ts +1 -1
- package/dist/plugin-sdk/agents/sandbox/docker.d.ts +14 -3
- package/dist/plugin-sdk/agents/sandbox/fs-bridge.d.ts +56 -0
- package/dist/plugin-sdk/agents/sandbox/types.d.ts +2 -0
- package/dist/plugin-sdk/agents/session-tool-result-guard-wrapper.d.ts +2 -0
- package/dist/plugin-sdk/agents/session-tool-result-guard.d.ts +4 -0
- package/dist/plugin-sdk/agents/subagent-registry.d.ts +3 -1
- package/dist/plugin-sdk/agents/tools/agent-step.d.ts +3 -0
- package/dist/plugin-sdk/agents/tools/browser-tool.schema.d.ts +2 -2
- package/dist/plugin-sdk/agents/tools/common.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/image-tool.d.ts +9 -1
- package/dist/plugin-sdk/agents/tools/web-search.d.ts +10 -1
- package/dist/plugin-sdk/agents/usage.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/memory-flush.d.ts +2 -2
- package/dist/plugin-sdk/auto-reply/reply/mentions.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/model-selection.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-reference.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +11 -0
- package/dist/plugin-sdk/auto-reply/reply/session-usage.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/status.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/templating.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/thinking.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/types.d.ts +2 -0
- package/dist/plugin-sdk/browser/cdp.helpers.d.ts +2 -1
- package/dist/plugin-sdk/browser/client-actions-core.d.ts +1 -0
- package/dist/plugin-sdk/browser/control-auth.d.ts +13 -0
- package/dist/plugin-sdk/browser/pw-ai.d.ts +1 -1
- package/dist/plugin-sdk/browser/pw-session.d.ts +25 -0
- package/dist/plugin-sdk/browser/pw-tools-core.interactions.d.ts +2 -0
- package/dist/plugin-sdk/browser/routes/dispatcher.d.ts +1 -0
- package/dist/plugin-sdk/browser/routes/types.d.ts +5 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/signal.d.ts +1 -0
- package/dist/plugin-sdk/channels/registry.d.ts +2 -2
- package/dist/plugin-sdk/cli/nodes-camera.d.ts +8 -2
- package/dist/plugin-sdk/cli/prompt.d.ts +1 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
- package/dist/plugin-sdk/commands/onboard-helpers.d.ts +1 -0
- package/dist/plugin-sdk/commands/onboard-types.d.ts +9 -1
- package/dist/plugin-sdk/commands/signal-install.d.ts +20 -0
- package/dist/plugin-sdk/config/config.d.ts +1 -1
- package/dist/plugin-sdk/config/group-policy.d.ts +3 -0
- package/dist/plugin-sdk/config/merge-patch.d.ts +1 -0
- package/dist/plugin-sdk/config/sessions/paths.d.ts +14 -4
- package/dist/plugin-sdk/config/sessions/store.d.ts +8 -0
- package/dist/plugin-sdk/config/sessions/types.d.ts +8 -0
- package/dist/plugin-sdk/config/types.agents.d.ts +2 -0
- package/dist/plugin-sdk/config/types.channels.d.ts +2 -0
- package/dist/plugin-sdk/config/types.d.ts +1 -0
- package/dist/plugin-sdk/config/types.discord.d.ts +5 -0
- package/dist/plugin-sdk/config/types.gateway.d.ts +35 -0
- package/dist/plugin-sdk/config/types.hooks.d.ts +23 -1
- package/dist/plugin-sdk/config/types.irc.d.ts +96 -0
- package/dist/plugin-sdk/config/types.memory.d.ts +2 -0
- package/dist/plugin-sdk/config/types.openclaw.d.ts +6 -0
- package/dist/plugin-sdk/config/types.queue.d.ts +1 -0
- package/dist/plugin-sdk/config/types.slack.d.ts +2 -0
- package/dist/plugin-sdk/config/types.telegram.d.ts +2 -0
- package/dist/plugin-sdk/config/validation.d.ts +20 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +1 -0
- package/dist/plugin-sdk/config/zod-schema.core.d.ts +2 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +193 -2
- package/dist/plugin-sdk/config/zod-schema.hooks.d.ts +3 -2
- package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +378 -0
- package/dist/plugin-sdk/config/zod-schema.providers.d.ts +176 -0
- package/dist/plugin-sdk/config/zod-schema.sensitive.d.ts +2 -0
- package/dist/plugin-sdk/config/zod-schema.session.d.ts +1 -0
- package/dist/plugin-sdk/cron/service/jobs.d.ts +8 -0
- package/dist/plugin-sdk/cron/service/state.d.ts +1 -0
- package/dist/plugin-sdk/cron/types.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +15 -0
- package/dist/plugin-sdk/discord/send.types.d.ts +5 -0
- package/dist/plugin-sdk/gateway/auth-rate-limit.d.ts +59 -0
- package/dist/plugin-sdk/gateway/auth.d.ts +47 -0
- package/dist/plugin-sdk/gateway/net.d.ts +5 -0
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +7 -7
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +7 -1
- package/dist/plugin-sdk/gateway/protocol/schema/channels.d.ts +21 -0
- package/dist/plugin-sdk/gateway/protocol/schema/types.d.ts +3 -1
- package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +3 -1
- package/dist/plugin-sdk/gateway/session-utils.types.d.ts +1 -0
- package/dist/plugin-sdk/imessage/send.d.ts +12 -0
- package/dist/plugin-sdk/index.js +2147 -900
- 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/heartbeat-active-hours.d.ts +5 -0
- package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +1 -0
- package/dist/plugin-sdk/infra/heartbeat-wake.d.ts +8 -1
- package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +1 -0
- package/dist/plugin-sdk/infra/net/ssrf.d.ts +1 -0
- package/dist/plugin-sdk/infra/outbound/message.d.ts +2 -0
- package/dist/plugin-sdk/infra/outbound/outbound-send-service.d.ts +2 -0
- package/dist/plugin-sdk/infra/session-cost-usage.d.ts +3 -0
- package/dist/plugin-sdk/infra/tailscale.d.ts +34 -0
- package/dist/plugin-sdk/infra/tmp-openclaw-dir.d.ts +10 -0
- package/dist/plugin-sdk/logging/console.d.ts +4 -0
- package/dist/plugin-sdk/logging/logger.d.ts +1 -1
- package/dist/plugin-sdk/logging/state.d.ts +1 -0
- package/dist/plugin-sdk/logging.d.ts +2 -2
- package/dist/plugin-sdk/markdown/ir.d.ts +1 -1
- package/dist/plugin-sdk/markdown/whatsapp.d.ts +14 -0
- package/dist/plugin-sdk/media/input-files.d.ts +5 -0
- package/dist/plugin-sdk/media/store.d.ts +10 -0
- package/dist/plugin-sdk/media-understanding/audio-preflight.d.ts +16 -0
- package/dist/plugin-sdk/media-understanding/types.d.ts +1 -0
- package/dist/plugin-sdk/memory/backend-config.d.ts +2 -1
- 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.d.ts +1 -0
- package/dist/plugin-sdk/memory/internal.d.ts +11 -0
- package/dist/plugin-sdk/memory/manager.d.ts +0 -6
- package/dist/plugin-sdk/memory/qmd-manager.d.ts +2 -0
- package/dist/plugin-sdk/memory/qmd-query-parser.d.ts +8 -0
- package/dist/plugin-sdk/memory/session-files.d.ts +2 -0
- package/dist/plugin-sdk/process/command-queue.d.ts +16 -0
- package/dist/plugin-sdk/providers/github-copilot-token.d.ts +3 -0
- package/dist/plugin-sdk/routing/resolve-route.d.ts +3 -1
- package/dist/plugin-sdk/security/external-content.d.ts +1 -1
- 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/signal/monitor/event-handler.types.d.ts +8 -0
- package/dist/plugin-sdk/signal/monitor/mentions.d.ts +2 -0
- package/dist/plugin-sdk/slack/monitor/commands.d.ts +5 -0
- package/dist/plugin-sdk/slack/monitor/media.d.ts +21 -0
- package/dist/plugin-sdk/slack/types.d.ts +1 -0
- package/dist/plugin-sdk/telegram/bot-message-context.d.ts +2 -1
- package/dist/plugin-sdk/telegram/fetch.d.ts +1 -0
- package/dist/plugin-sdk/telegram/monitor.d.ts +1 -0
- package/dist/plugin-sdk/telegram/send.d.ts +3 -0
- package/dist/plugin-sdk/tts/tts.d.ts +2 -2
- package/dist/plugin-sdk/utils/fetch-timeout.d.ts +2 -0
- package/dist/plugin-sdk/web/media.d.ts +12 -2
- package/dist/{plugins-CQw3z3Nw.js → plugins-CTjLu-z-.js} +4 -4
- package/dist/{plugins-B7F0Ly9G.js → plugins-CxrdL_IZ.js} +3 -3
- package/dist/{plugins-cli-CJ74eHvr.js → plugins-cli-CbX97Kvt.js} +259 -49
- package/dist/{plugins-cli-ubDwUAzK.js → plugins-cli-Dn9OeO53.js} +257 -47
- package/dist/{ports-kYsTYQdA.js → ports-C8YYHVlc.js} +2 -2
- package/dist/{program-1bQ15ivo.js → program-D-mNC0It.js} +86 -83
- package/dist/{progress-Da1ehW-x.js → progress-COHv-uNT.js} +1 -1
- package/dist/{progress-COzt9PNY.js → progress-DZb6yPcJ.js} +1 -1
- package/dist/{prompt-style-Dc0C5HC9.js → prompt-style-Cf1r1L6k.js} +1 -1
- package/dist/{prompt-style-DjZDxcFg.js → prompt-style-lSlXMhsd.js} +1 -1
- package/dist/{pw-ai-CQ4-gUNR.js → pw-ai-6GzTgK5g.js} +205 -32
- package/dist/{pw-ai-1NN0FrJb.js → pw-ai-C8YhJRaI.js} +207 -32
- package/dist/{pw-ai-qEMUq5Mt.js → pw-ai-CKGenizV.js} +203 -29
- package/dist/{pw-ai-IOqEXO1O.js → pw-ai-D7devT89.js} +206 -32
- package/dist/{qmd-manager-CEwp3el1.js → qmd-manager-CQzWovq-.js} +71 -90
- package/dist/{qmd-manager-D6N3qvQ5.js → qmd-manager-Cs8RJVQp.js} +73 -90
- package/dist/{qmd-manager-C48QzrRe.js → qmd-manager-DdgrQ2kc.js} +71 -88
- package/dist/{qmd-manager-DaUqCKB_.js → qmd-manager-dyIoOvKl.js} +73 -90
- package/dist/{register.subclis-Cm-VJ5nP.js → register.subclis-ifHtmF3e.js} +29 -29
- package/dist/{reply-CBs4e9Rm.js → reply-VIHqsQ-k.js} +7906 -8743
- package/dist/{routes-9ygR0GOk.js → routes-CaCvio4Q.js} +36 -15
- package/dist/{routes-BrWrBk2R.js → routes-Cpfxk96k.js} +36 -14
- package/dist/{rpc-Cjuz2Gv1.js → rpc-BhB01Bhj.js} +3 -3
- package/dist/{rpc-DhkLVY5H.js → rpc-C5WsS_Ne.js} +3 -3
- package/dist/{run-main-BlZ5l-X9.js → run-main-DVy6KJTe.js} +88 -85
- package/dist/runner-B7CKBC80.js +1800 -0
- package/dist/runner-BEy5ZGFv.js +1901 -0
- package/dist/runner-Bv0BmJPF.js +1800 -0
- package/dist/runner-ChqVEgPx.js +1901 -0
- package/dist/{sandbox-qt49csTr.js → sandbox-BAChxjC5.js} +627 -157
- package/dist/{sandbox-CPZiaKcS.js → sandbox-DNHDwHw8.js} +628 -158
- package/dist/{sandbox-cli-C6_iNuqO.js → sandbox-cli-9oq67QEg.js} +22 -22
- package/dist/{sandbox-cli-C_wK-KAE.js → sandbox-cli-BiNq9yUe.js} +22 -22
- package/dist/{security-cli-CTTD1vms.js → security-cli-CRg03hvq.js} +28 -28
- package/dist/{security-cli-DRpGF2Yc.js → security-cli-LmBBHnmh.js} +28 -28
- package/dist/{server-context-lyNcqJYD.js → server-context-FwqBRH3K.js} +10 -10
- package/dist/{server-context-39mkstUs.js → server-context-RY7lRaxl.js} +9 -9
- package/dist/{server-node-events-V_G9BRRw.js → server-node-events-BbHOZX3O.js} +48 -43
- package/dist/{server-node-events-o9G18PaE.js → server-node-events-CngNLVL-.js} +50 -45
- package/dist/{service-DOlJdIqe.js → service-BnqdBTAK.js} +8 -4
- package/dist/{service-DDPRbf8a.js → service-DZN7KRok.js} +8 -4
- package/dist/{service-audit-VDRrWefh.js → service-audit-0Eil3ISN.js} +4 -4
- package/dist/{service-audit-CVy00Ze_.js → service-audit-B8KIOe8A.js} +4 -4
- package/dist/{session-cost-usage-CcCEQNuc.js → session-cost-usage-B-tyjp76.js} +14 -14
- package/dist/{session-cost-usage-PvyVZz-g.js → session-cost-usage-BYUb7fov.js} +14 -14
- package/dist/{shared-BnpC3wMU.js → shared-BCdNboU1.js} +3 -3
- package/dist/{shared-CagUDdmp.js → shared-CsAwU6-q.js} +3 -3
- package/dist/{shared-BDk_zC9p.js → shared-Csn6DLBA.js} +5 -5
- package/dist/{shared-C92wo-6f.js → shared-DEanAgja.js} +4 -4
- package/dist/{skill-scanner-C_fQzVDu.js → skill-scanner-BrGkh5K7.js} +1 -1
- package/dist/{skill-scanner-DrVEHfC6.js → skill-scanner-CucvxYhu.js} +1 -1
- package/dist/{skills-Ccsv3IQq.js → skills-CE7by2IF.js} +151 -8
- package/dist/{skills-_eKGrw9z.js → skills-Dz15dAM4.js} +152 -9
- package/dist/{skills-cli-DqvLjooh.js → skills-cli-B5b75pDK.js} +13 -13
- package/dist/{skills-cli-DUncybht.js → skills-cli-CbCDrYwp.js} +13 -13
- package/dist/{skills-status-Cp2ZFhIx.js → skills-status-B99Us6yS.js} +2 -2
- package/dist/{skills-status-Ck0CCFZG.js → skills-status-ChM7JE47.js} +3 -3
- package/dist/{sqlite-DODNHWJb.js → sqlite-2UsPaJz5.js} +97 -2
- package/dist/{sqlite-cSdsHVEw.js → sqlite-CASnHrgX.js} +97 -1
- package/dist/{sqlite-Bwo2rASR.js → sqlite-CVWiMkGu.js} +97 -1
- package/dist/{sqlite-CpqIbY4-.js → sqlite-CcIWkGaM.js} +97 -1
- package/dist/{status-Bmx9_1C7.js → status-CKuX1-zb.js} +3 -3
- package/dist/{status-CBGgwlTW.js → status-Cm4q6o-I.js} +57 -49
- package/dist/{status-DkJgtvSz.js → status-DD2iqGc9.js} +4 -4
- package/dist/{subsystem-DPnkvS73.js → subsystem-DHfJG4gk.js} +73 -20
- package/dist/{system-cli-9fQ1uLiz.js → system-cli-BVJDR474.js} +87 -15
- package/dist/{system-cli-Gq8OWHFg.js → system-cli-C3Y_9VpI.js} +88 -16
- package/dist/{systemd-Pa7LURHB.js → systemd-DxddcFsa.js} +3 -3
- package/dist/{systemd-hints-zi4ohCOY.js → systemd-hints-BVLopJ9O.js} +1 -1
- package/dist/{systemd-linger-CDo2UbHM.js → systemd-linger-BThjV1Sr.js} +2 -2
- package/dist/{systemd-linger-6_naJcJp.js → systemd-linger-D3Va1Cv7.js} +2 -2
- package/dist/{systemd-BEWwfwn0.js → systemd-s3S2HVog.js} +3 -3
- package/dist/{table-Bb9gAVIp.js → table-BIk8Aan_.js} +2 -2
- package/dist/{table-cCoGqLsk.js → table-Bvka_vkc.js} +1 -1
- package/dist/{tool-display-DUVhO36P.js → tool-display-DbdMQFZx.js} +2 -2
- package/dist/{tool-display-DNOVCI6J.js → tool-display-kpW5Hg2z.js} +2 -2
- package/dist/{tui-DDVqLwqT.js → tui-B40Z2jMa.js} +120 -14
- package/dist/{tui-cli-CurbazQf.js → tui-cli-Bwa6K7xR.js} +28 -28
- package/dist/{tui-cli-BeN2K38I.js → tui-cli-DD6g7uZb.js} +27 -27
- package/dist/{tui-B9zLJxf6.js → tui-lFMZUnx6.js} +121 -13
- package/dist/{update-Ct9sqJC_.js → update-Bos8PPCG.js} +3 -3
- package/dist/{update--i077azM.js → update-Cg8MtrEr.js} +3 -3
- package/dist/{update-cli-CT5W0kpw.js → update-cli-CC-wTeje.js} +92 -73
- package/dist/{update-cli-C87lNK1S.js → update-cli-CULnXFL_.js} +91 -72
- package/dist/{update-runner-BIttRDyV.js → update-runner-BaLsla0c.js} +11 -11
- package/dist/{update-runner-xbeVkAD9.js → update-runner-Dbsdl5AU.js} +10 -10
- package/dist/{utils-Dk86IbEs.js → utils-BLJAc3ZV.js} +1 -1
- package/dist/{utils-BTaR--Ln.js → utils-BtIMES3N.js} +1 -1
- package/dist/{webhooks-cli-Db3zyJaw.js → webhooks-cli-ClHLUu_j.js} +21 -13
- package/dist/{webhooks-cli-DUUa8gVY.js → webhooks-cli-DVXr2uyN.js} +21 -13
- package/dist/{widearea-dns-BgYasW6m.js → widearea-dns-C4RnIR9O.js} +3 -3
- package/dist/{widearea-dns-CMIG6-74.js → widearea-dns-Ypwgjpsr.js} +3 -3
- package/dist/{ws-C0k_dhCP.js → ws-BcJt4pcg.js} +24 -2
- package/dist/{ws-DtDKpbLR.js → ws-MC-rTJLe.js} +24 -2
- package/dist/{ws-log-cMNgAyLy.js → ws-log-WrJ4QYu7.js} +1 -1
- package/dist/{ws-log-C6vm_XMA.js → ws-log-lip4ETlm.js} +2 -2
- package/dist/{wsl-rfIr_Sde.js → wsl-BvTIzy-8.js} +5 -3
- package/docs/assets/install-script.svg +1 -0
- package/docs/automation/hooks.md +1 -38
- package/docs/automation/webhook.md +52 -2
- package/docs/channels/discord.md +389 -381
- package/docs/channels/grammy.md +1 -1
- package/docs/channels/imessage.md +229 -218
- package/docs/channels/index.md +1 -0
- package/docs/channels/irc.md +234 -0
- package/docs/channels/msteams.md +2 -0
- package/docs/channels/pairing.md +1 -1
- package/docs/channels/slack.md +295 -415
- package/docs/channels/telegram.md +397 -460
- package/docs/channels/whatsapp.md +338 -310
- package/docs/ci.md +0 -12
- package/docs/cli/hooks.md +1 -14
- package/docs/cli/index.md +6 -1
- package/docs/cli/logs.md +4 -0
- package/docs/cli/onboard.md +33 -0
- package/docs/cli/plugins.md +20 -1
- package/docs/cli/security.md +2 -0
- package/docs/concepts/architecture.md +0 -16
- package/docs/concepts/memory.md +7 -4
- package/docs/concepts/model-providers.md +27 -0
- package/docs/concepts/session-tool.md +1 -0
- package/docs/concepts/system-prompt.md +13 -0
- package/docs/docs.json +18 -12
- package/docs/experiments/plans/browser-evaluate-cdp-refactor.md +229 -0
- package/docs/gateway/configuration-examples.md +9 -2
- package/docs/gateway/configuration-reference.md +2345 -0
- package/docs/gateway/configuration.md +338 -3297
- package/docs/gateway/index.md +162 -238
- package/docs/gateway/openai-http-api.md +1 -0
- package/docs/gateway/openresponses-http-api.md +16 -0
- package/docs/gateway/remote-gateway-readme.md +0 -16
- package/docs/gateway/security/index.md +4 -16
- package/docs/gateway/tools-invoke-http-api.md +26 -1
- package/docs/help/faq.md +9 -0
- package/docs/help/testing.md +11 -0
- package/docs/install/docker.md +18 -0
- package/docs/install/hetzner.md +21 -0
- package/docs/install/installer.md +20 -0
- package/docs/nodes/audio.md +19 -0
- package/docs/platforms/mac/release.md +7 -7
- package/docs/providers/glm.md +3 -3
- package/docs/providers/huggingface.md +209 -0
- package/docs/providers/index.md +3 -0
- package/docs/providers/litellm.md +153 -0
- package/docs/providers/together.md +2 -2
- package/docs/providers/vllm.md +92 -0
- package/docs/providers/zai.md +2 -2
- package/docs/reference/credits.md +4 -28
- package/docs/reference/test.md +2 -1
- package/docs/reference/token-use.md +1 -1
- package/docs/reference/transcript-hygiene.md +18 -0
- package/docs/start/getting-started.md +5 -0
- package/docs/start/onboarding-overview.md +51 -0
- package/docs/start/onboarding.md +1 -0
- package/docs/start/openclaw.md +0 -16
- package/docs/start/wizard-cli-automation.md +17 -0
- package/docs/start/wizard-cli-reference.md +12 -0
- package/docs/start/wizard.md +3 -1
- package/docs/tools/browser.md +6 -0
- package/docs/zh-CN/automation/hooks.md +1 -38
- package/docs/zh-CN/cli/hooks.md +1 -14
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/bluebubbles/src/monitor.test.ts +40 -28
- package/extensions/bluebubbles/src/monitor.ts +0 -4
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +10 -10
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +2 -5
- package/extensions/feishu/src/bot.checkBotMentioned.test.ts +64 -0
- package/extensions/feishu/src/bot.test.ts +265 -0
- package/extensions/feishu/src/bot.ts +73 -18
- package/extensions/feishu/src/channel.test.ts +48 -0
- package/extensions/feishu/src/channel.ts +1 -3
- package/extensions/feishu/src/config-schema.ts +6 -0
- package/extensions/feishu/src/docx.ts +14 -4
- package/extensions/feishu/src/media.test.ts +151 -0
- package/extensions/feishu/src/media.ts +27 -13
- package/extensions/feishu/src/reply-dispatcher.test.ts +116 -0
- package/extensions/feishu/src/reply-dispatcher.ts +124 -67
- package/extensions/feishu/src/streaming-card.ts +223 -0
- package/extensions/feishu/src/targets.test.ts +16 -0
- package/extensions/feishu/src/targets.ts +1 -1
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/oauth.test.ts +4 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/googlechat/src/channel.ts +3 -20
- package/extensions/googlechat/src/resolve-target.test.ts +138 -0
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/index.ts +17 -0
- package/extensions/irc/openclaw.plugin.json +9 -0
- package/extensions/irc/package.json +14 -0
- package/extensions/irc/src/accounts.ts +268 -0
- package/extensions/irc/src/channel.ts +367 -0
- package/extensions/irc/src/client.test.ts +43 -0
- package/extensions/irc/src/client.ts +439 -0
- package/extensions/irc/src/config-schema.test.ts +27 -0
- package/extensions/irc/src/config-schema.ts +97 -0
- package/extensions/irc/src/control-chars.ts +22 -0
- package/extensions/irc/src/inbound.ts +334 -0
- package/extensions/irc/src/monitor.test.ts +43 -0
- package/extensions/irc/src/monitor.ts +158 -0
- package/extensions/irc/src/normalize.test.ts +46 -0
- package/extensions/irc/src/normalize.ts +117 -0
- package/extensions/irc/src/onboarding.test.ts +118 -0
- package/extensions/irc/src/onboarding.ts +479 -0
- package/extensions/irc/src/policy.test.ts +132 -0
- package/extensions/irc/src/policy.ts +157 -0
- package/extensions/irc/src/probe.ts +64 -0
- package/extensions/irc/src/protocol.test.ts +44 -0
- package/extensions/irc/src/protocol.ts +169 -0
- package/extensions/irc/src/runtime.ts +14 -0
- package/extensions/irc/src/send.ts +99 -0
- package/extensions/irc/src/types.ts +94 -0
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- package/extensions/matrix/node_modules/.bin/markdown-it +2 -2
- package/extensions/matrix/node_modules/.bin/markdown-it.CMD +2 -2
- package/extensions/matrix/node_modules/.bin/markdown-it.ps1 +2 -2
- package/extensions/matrix/package.json +2 -2
- package/extensions/matrix/src/matrix/monitor/media.ts +4 -2
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/index.ts +6 -2
- package/extensions/memory-lancedb/node_modules/.bin/openai +2 -2
- package/extensions/memory-lancedb/node_modules/.bin/openai.CMD +2 -2
- package/extensions/memory-lancedb/node_modules/.bin/openai.ps1 +2 -2
- package/extensions/memory-lancedb/package.json +2 -2
- package/extensions/minimax-portal-auth/index.ts +7 -5
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/msteams/src/media-helpers.test.ts +9 -0
- package/extensions/msteams/src/media-helpers.ts +15 -1
- package/extensions/msteams/src/mentions.test.ts +235 -0
- package/extensions/msteams/src/mentions.ts +114 -0
- package/extensions/msteams/src/messenger.test.ts +81 -1
- package/extensions/msteams/src/messenger.ts +11 -2
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +2 -2
- package/extensions/open-prose/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/telegram/src/channel.ts +1 -0
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/twitch/src/onboarding.test.ts +5 -0
- package/extensions/twitch/src/outbound.test.ts +17 -6
- package/extensions/twitch/src/outbound.ts +12 -10
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/voice-call/src/media-stream.ts +7 -1
- package/extensions/voice-call/src/providers/twilio.test.ts +5 -3
- package/extensions/voice-call/src/providers/twilio.ts +12 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/whatsapp/src/channel.ts +6 -16
- package/extensions/whatsapp/src/resolve-target.test.ts +154 -0
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +26 -22
- package/dist/auth-BcNHFK-i.js +0 -184
- package/dist/auth-DkjJ3pm-.js +0 -184
- package/dist/boolean-M-esQJt6.js +0 -30
- package/dist/bundled/soul-evil/HOOK.md +0 -71
- package/dist/bundled/soul-evil/handler.js +0 -194
- package/dist/cli-B631__JU.js +0 -89
- package/dist/cli-DVhCVZZ6.js +0 -86
- package/dist/config-CI7EpvlP.js +0 -15
- package/dist/constants-DuoCkWRh.js +0 -65
- package/dist/control-ui/assets/index-CnB9IO4a.js.map +0 -1
- package/dist/control-ui/assets/index-DWhx-9JL.css +0 -1
- package/dist/date-time-c6HTX6IW.js +0 -187
- package/dist/frontmatter-xwTm0734.js +0 -105
- package/dist/parse-DqAvJRIf.js +0 -23
- package/dist/parse-duration-De_tAQSe.js +0 -24
- package/dist/parse-timeout-DV8NQQWk.js +0 -16
- package/dist/paths-IivnSNkP.js +0 -51
- package/dist/paths-MnZaxqPw.js +0 -48
- package/dist/paths-uoGO2aiO.js +0 -48
- package/dist/pi-model-discovery-DzFOAbQt.js +0 -20
- package/dist/plugin-sdk/tui/tui-formatters.d.ts +0 -31
- package/dist/session-key-nXYQSv-a.js +0 -167
- package/dist/tailscale-DU6DgqVy.js +0 -225
- package/dist/tailscale-DzJUWmKf.js +0 -252
- package/dist/utils-dp_OM900.js +0 -476
- package/docs/hooks/soul-evil.md +0 -69
- package/docs/zh-CN/hooks/soul-evil.md +0 -72
- package/skills/local-places/SERVER_README.md +0 -101
- package/skills/local-places/SKILL.md +0 -102
- package/skills/local-places/pyproject.toml +0 -21
- package/skills/local-places/src/local_places/__init__.py +0 -2
- package/skills/local-places/src/local_places/google_places.py +0 -314
- package/skills/local-places/src/local_places/main.py +0 -65
- package/skills/local-places/src/local_places/schemas.py +0 -107
- /package/dist/{archive-CXhvR9nU.js → archive-aSMUcOc6.js} +0 -0
- /package/dist/{archive-D0z3LZDK.js → archive-beaSfAzA.js} +0 -0
- /package/dist/{brew-BIrWdDps.js → brew-DlQQMJ3n.js} +0 -0
- /package/dist/{brew-B7YK4ZoL.js → brew-ROHf0-Xp.js} +0 -0
- /package/dist/{cli-utils-PlLcDZlM.js → cli-utils-CRhVAaLV.js} +0 -0
- /package/dist/{cli-utils-R-ECs5cY.js → cli-utils-CodyYLHe.js} +0 -0
- /package/dist/{command-format-BUxhT1xL.js → command-format-qUVxzqYm.js} +0 -0
- /package/dist/{constants-CNTiY-ZN.js → constants-BvQ6S8j5.js} +0 -0
- /package/dist/{errors-D3tYRJWG.js → errors-B91HIDPD.js} +0 -0
- /package/dist/{errors-B0eT3jVv.js → errors-Bv81hF2P.js} +0 -0
- /package/dist/{errors-x4NYs-1P.js → errors-Cojm0Kl7.js} +0 -0
- /package/dist/{format-CaxeRcue.js → format-CL8VOhxX.js} +0 -0
- /package/dist/{format-DLOJPZmo.js → format-DcfK-dwd.js} +0 -0
- /package/dist/{format-duration-CEmFWLyX.js → format-duration--hQihAvf.js} +0 -0
- /package/dist/{format-duration-DCXJx2ba.js → format-duration-84n6_DgO.js} +0 -0
- /package/dist/{format-relative-79_Y1n2Y.js → format-relative-Cywx6ldk.js} +0 -0
- /package/dist/{format-relative-Db7eqEu8.js → format-relative-cegC_FF5.js} +0 -0
- /package/dist/{helpers-CQI-5xS9.js → helpers-8O7IVGO-.js} +0 -0
- /package/dist/{helpers-DdwqKAAS.js → helpers-ByYj2Aq5.js} +0 -0
- /package/dist/{helpers-CRzoyyXS.js → helpers-CUVSCDJV.js} +0 -0
- /package/dist/{helpers-C89IG08W.js → helpers-HyeZXsnu.js} +0 -0
- /package/dist/{is-main-qJ675wPV.js → is-main-B9A8S9YC.js} +0 -0
- /package/dist/{is-main-WWuz28Ip.js → is-main-BWoXGz7p.js} +0 -0
- /package/dist/{logging-BzvBIA3Y.js → logging-D-Jq2wIo.js} +0 -0
- /package/dist/{logging-CfEk_PnX.js → logging-fywhKCmE.js} +0 -0
- /package/dist/{parse-Cjiudy6x.js → parse-Bw0oH-rT.js} +0 -0
- /package/dist/{parse-log-line-CUrpqe1w.js → parse-log-line-BuRiE-Ij.js} +0 -0
- /package/dist/{parse-log-line-D2UGw0wR.js → parse-log-line-CfVgwy6x.js} +0 -0
- /package/dist/{parse-timeout-DFSPLxpY.js → parse-timeout-D1XX_zN_.js} +0 -0
- /package/dist/{pi-model-discovery-CV2V1HHz.js → pi-model-discovery-DqgqUyAv.js} +0 -0
- /package/dist/{pi-model-discovery-DzEIEgHL.js → pi-model-discovery-EwKVHlZB.js} +0 -0
- /package/dist/{prompts--d-6l5Ln.js → prompts-Bg96reub.js} +0 -0
- /package/dist/{prompts-CXLLIBwP.js → prompts-Dszjy1n_.js} +0 -0
- /package/dist/{redact-BRmQPYDR.js → redact-BIMJ3ntQ.js} +0 -0
- /package/dist/{redact-BHmk44DI.js → redact-BRsnXqwD.js} +0 -0
- /package/dist/{redact-DAKeu7PA.js → redact-UvkXqguc.js} +0 -0
- /package/dist/{status-Cv36yYdi.js → status-C_dMhoE0.js} +0 -0
- /package/dist/{status-Drziap9H.js → status-DCkF_L3U.js} +0 -0
- /package/dist/{systemd-hints-CH4pbCFD.js → systemd-hints-CXNtLw9Q.js} +0 -0
- /package/dist/{tailnet-CL5GtL7t.js → tailnet-DATIFSsY.js} +0 -0
- /package/dist/{tailnet-DGRSvYuQ.js → tailnet-uoFvUSsw.js} +0 -0
- /package/dist/{transcript-events-BlIONGVn.js → transcript-events-BHS7QoRl.js} +0 -0
- /package/dist/{transcript-events-C1hdue6u.js → transcript-events-Bp7fGnwv.js} +0 -0
- /package/dist/{transcript-events-CZ8CG4ht.js → transcript-events-Ch7wLX-j.js} +0 -0
- /package/dist/{usage-format-6Uar63S0.js → usage-format-Bhl_WCWP.js} +0 -0
- /package/dist/{usage-format-hd37en6b.js → usage-format-CpORtVCG.js} +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/claw +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/claw.CMD +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/claw.ps1 +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/moltbot +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/moltbot.CMD +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/moltbot.ps1 +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/pigbot +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/pigbot.CMD +0 -0
- /package/extensions/{feishu → irc}/node_modules/.bin/pigbot.ps1 +0 -0
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as formatCliCommand } from "./command-format-
|
|
3
|
-
import { c as escapeRegExp, g as resolveConfigDir, s as ensureDir, t as CONFIG_DIR, y as resolveUserPath } from "./utils-
|
|
4
|
-
import { t as runCommandWithTimeout } from "./exec-
|
|
5
|
-
import { a as resolveAgentModelPrimary, c as resolveDefaultAgentId, r as resolveAgentDir, s as resolveAgentWorkspaceDir, w as resolveDefaultAgentWorkspaceDir } from "./agent-scope-
|
|
6
|
-
import { t as resolveBrewExecutable } from "./brew-
|
|
7
|
-
import {
|
|
8
|
-
import { a as enablePluginInConfig } from "./onboard-channels-
|
|
9
|
-
import { t as scanDirectoryWithSummary } from "./skill-scanner-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { t as
|
|
1
|
+
import { A as normalizeProviderId, At as DEFAULT_MODEL, C as resolveOpenClawAgentDir, E as buildModelAliasIndex, Et as CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_REF, N as resolveAllowlistModelKey, P as resolveConfiguredModelRef, Tt as isHuggingfacePolicyLocked, X as VENICE_DEFAULT_MODEL_REF, _ as upsertAuthProfileWithLock, c as CHUTES_AUTHORIZE_ENDPOINT, d as parseOAuthCallbackInput, dt as resolveEnvApiKey, g as upsertAuthProfile, jt as DEFAULT_PROVIDER, k as modelKey, l as exchangeChutesCodeForTokens, mt as normalizeSecretInput, n as resolveAuthProfileOrder, p as listProfilesForProvider, rt as SYNTHETIC_DEFAULT_MODEL_REF, st as getCustomProviderApiKey, u as generateChutesPkce, v as ensureAuthProfileStore, w as buildAllowedModelSet, wt as discoverHuggingfaceModels } from "./auth-profiles-Cp9MtUdM.js";
|
|
2
|
+
import { t as formatCliCommand } from "./command-format-Bxe0mWee.js";
|
|
3
|
+
import { c as escapeRegExp, g as resolveConfigDir, s as ensureDir, t as CONFIG_DIR, y as resolveUserPath } from "./utils-BLJAc3ZV.js";
|
|
4
|
+
import { t as runCommandWithTimeout } from "./exec-DqZFMawz.js";
|
|
5
|
+
import { a as resolveAgentModelPrimary, c as resolveDefaultAgentId, r as resolveAgentDir, s as resolveAgentWorkspaceDir, w as resolveDefaultAgentWorkspaceDir } from "./agent-scope-Bkr9fZtl.js";
|
|
6
|
+
import { t as resolveBrewExecutable } from "./brew-DlQQMJ3n.js";
|
|
7
|
+
import { m as openUrl, o as detectBinary, y as resolveNodeManagerOptions } from "./loader-CS-5lMQa.js";
|
|
8
|
+
import { a as enablePluginInConfig } from "./onboard-channels-C5uL3i8d.js";
|
|
9
|
+
import { t as scanDirectoryWithSummary } from "./skill-scanner-BrGkh5K7.js";
|
|
10
|
+
import { a as fetchWithTimeout, r as fetchWithSsrFGuard } from "./fetch-wuOZDzdT.js";
|
|
11
|
+
import { h as hasBinary, i as loadWorkspaceSkillEntries, t as resolveSkillsInstallPreferences, x as resolveSkillKey } from "./skills-CE7by2IF.js";
|
|
12
|
+
import { _ as loadModelCatalog } from "./runner-BEy5ZGFv.js";
|
|
13
|
+
import { n as resolveWideAreaDiscoveryDomain } from "./widearea-dns-C4RnIR9O.js";
|
|
14
|
+
import { $ as VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF, A as applyQianfanProviderConfig, At as validateAnthropicSetupToken, B as applyXiaomiProviderConfig, C as applyMoonshotConfig, Ct as QIANFAN_DEFAULT_MODEL_REF, D as applyOpenrouterConfig, Dt as ZAI_CODING_GLOBAL_BASE_URL, E as applyMoonshotProviderConfigCn, Et as ZAI_CODING_CN_BASE_URL, F as applyVeniceConfig, G as applyCloudflareAiGatewayConfig, H as applyZaiProviderConfig, I as applyVeniceProviderConfig, J as applyVercelAiGatewayProviderConfig, K as applyCloudflareAiGatewayProviderConfig, L as applyXaiConfig, M as applySyntheticProviderConfig, N as applyTogetherConfig, O as applyOpenrouterProviderConfig, Ot as ZAI_GLOBAL_BASE_URL, P as applyTogetherProviderConfig, Q as TOGETHER_DEFAULT_MODEL_REF, R as applyXaiProviderConfig, S as applyKimiCodeProviderConfig, St as MOONSHOT_DEFAULT_MODEL_REF, T as applyMoonshotProviderConfig, Tt as ZAI_CN_BASE_URL, U as applyLitellmConfig, V as applyZaiConfig, W as applyLitellmProviderConfig, X as LITELLM_DEFAULT_MODEL_REF, Y as HUGGINGFACE_DEFAULT_MODEL_REF, Z as OPENROUTER_DEFAULT_MODEL_REF, _ as applyMinimaxProviderConfig, _t as setXaiApiKey, a as normalizeAlias, at as setHuggingfaceApiKey, b as applyHuggingfaceProviderConfig, bt as writeOAuthCredentials, ct as setMinimaxApiKey, d as resolvePluginProviders, dt as setOpenrouterApiKey, et as XIAOMI_DEFAULT_MODEL_REF, f as applyOpencodeZenConfig, ft as setQianfanApiKey, g as applyMinimaxConfig, gt as setVercelAiGatewayApiKey, h as applyMinimaxApiProviderConfig, ht as setVeniceApiKey, i as formatTokenK, it as setGeminiApiKey, j as applySyntheticConfig, k as applyQianfanConfig, kt as buildTokenProfileId, l as createVpsAwareOAuthHandlers, lt as setMoonshotApiKey, m as applyMinimaxApiConfig, mt as setTogetherApiKey, nt as setAnthropicApiKey, ot as setKimiCodingApiKey, p as applyOpencodeZenProviderConfig, pt as setSyntheticApiKey, q as applyVercelAiGatewayConfig, rt as setCloudflareAiGatewayConfig, st as setLitellmApiKey, t as githubCopilotLoginCommand, tt as ZAI_DEFAULT_MODEL_REF, u as isRemoteEnvironment, ut as setOpencodeZenApiKey, v as applyAuthProfileConfig, vt as setXiaomiApiKey, w as applyMoonshotConfigCn, wt as XAI_DEFAULT_MODEL_REF, x as applyKimiCodeConfig, xt as KIMI_CODING_MODEL_REF, yt as setZaiApiKey, z as applyXiaomiConfig } from "./github-copilot-auth-BUqfX7hG.js";
|
|
15
|
+
import { t as buildWorkspaceSkillStatus } from "./skills-status-B99Us6yS.js";
|
|
15
16
|
import path from "node:path";
|
|
16
17
|
import fs from "node:fs";
|
|
17
18
|
import { loginOpenAICodex } from "@mariozechner/pi-ai";
|
|
@@ -415,10 +416,16 @@ const AUTH_CHOICE_GROUP_DEFS = [
|
|
|
415
416
|
hint: "setup-token + API key",
|
|
416
417
|
choices: ["token", "apiKey"]
|
|
417
418
|
},
|
|
419
|
+
{
|
|
420
|
+
value: "vllm",
|
|
421
|
+
label: "vLLM",
|
|
422
|
+
hint: "Local/self-hosted OpenAI-compatible",
|
|
423
|
+
choices: ["vllm"]
|
|
424
|
+
},
|
|
418
425
|
{
|
|
419
426
|
value: "minimax",
|
|
420
427
|
label: "MiniMax",
|
|
421
|
-
hint: "M2.
|
|
428
|
+
hint: "M2.5 (recommended)",
|
|
422
429
|
choices: [
|
|
423
430
|
"minimax-portal",
|
|
424
431
|
"minimax-api",
|
|
@@ -465,9 +472,14 @@ const AUTH_CHOICE_GROUP_DEFS = [
|
|
|
465
472
|
},
|
|
466
473
|
{
|
|
467
474
|
value: "zai",
|
|
468
|
-
label: "Z.AI
|
|
469
|
-
hint: "
|
|
470
|
-
choices: [
|
|
475
|
+
label: "Z.AI",
|
|
476
|
+
hint: "GLM Coding Plan / Global / CN",
|
|
477
|
+
choices: [
|
|
478
|
+
"zai-coding-global",
|
|
479
|
+
"zai-coding-cn",
|
|
480
|
+
"zai-global",
|
|
481
|
+
"zai-cn"
|
|
482
|
+
]
|
|
471
483
|
},
|
|
472
484
|
{
|
|
473
485
|
value: "qianfan",
|
|
@@ -511,17 +523,35 @@ const AUTH_CHOICE_GROUP_DEFS = [
|
|
|
511
523
|
hint: "API key",
|
|
512
524
|
choices: ["together-api-key"]
|
|
513
525
|
},
|
|
526
|
+
{
|
|
527
|
+
value: "huggingface",
|
|
528
|
+
label: "Hugging Face",
|
|
529
|
+
hint: "Inference API (HF token)",
|
|
530
|
+
choices: ["huggingface-api-key"]
|
|
531
|
+
},
|
|
514
532
|
{
|
|
515
533
|
value: "venice",
|
|
516
534
|
label: "Venice AI",
|
|
517
535
|
hint: "Privacy-focused (uncensored models)",
|
|
518
536
|
choices: ["venice-api-key"]
|
|
519
537
|
},
|
|
538
|
+
{
|
|
539
|
+
value: "litellm",
|
|
540
|
+
label: "LiteLLM",
|
|
541
|
+
hint: "Unified LLM gateway (100+ providers)",
|
|
542
|
+
choices: ["litellm-api-key"]
|
|
543
|
+
},
|
|
520
544
|
{
|
|
521
545
|
value: "cloudflare-ai-gateway",
|
|
522
546
|
label: "Cloudflare AI Gateway",
|
|
523
547
|
hint: "Account ID + Gateway ID + API key",
|
|
524
548
|
choices: ["cloudflare-ai-gateway-api-key"]
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
value: "custom",
|
|
552
|
+
label: "Custom Provider",
|
|
553
|
+
hint: "Any OpenAI or Anthropic compatible endpoint",
|
|
554
|
+
choices: ["custom-api-key"]
|
|
525
555
|
}
|
|
526
556
|
];
|
|
527
557
|
function buildAuthChoiceOptions(params) {
|
|
@@ -540,6 +570,11 @@ function buildAuthChoiceOptions(params) {
|
|
|
540
570
|
value: "chutes",
|
|
541
571
|
label: "Chutes (OAuth)"
|
|
542
572
|
});
|
|
573
|
+
options.push({
|
|
574
|
+
value: "vllm",
|
|
575
|
+
label: "vLLM (custom URL + model)",
|
|
576
|
+
hint: "Local/self-hosted OpenAI-compatible server"
|
|
577
|
+
});
|
|
543
578
|
options.push({
|
|
544
579
|
value: "openai-api-key",
|
|
545
580
|
label: "OpenAI API key"
|
|
@@ -556,6 +591,11 @@ function buildAuthChoiceOptions(params) {
|
|
|
556
591
|
value: "openrouter-api-key",
|
|
557
592
|
label: "OpenRouter API key"
|
|
558
593
|
});
|
|
594
|
+
options.push({
|
|
595
|
+
value: "litellm-api-key",
|
|
596
|
+
label: "LiteLLM API key",
|
|
597
|
+
hint: "Unified gateway for 100+ LLM providers"
|
|
598
|
+
});
|
|
559
599
|
options.push({
|
|
560
600
|
value: "ai-gateway-api-key",
|
|
561
601
|
label: "Vercel AI Gateway API key"
|
|
@@ -591,6 +631,11 @@ function buildAuthChoiceOptions(params) {
|
|
|
591
631
|
label: "Together AI API key",
|
|
592
632
|
hint: "Access to Llama, DeepSeek, Qwen, and more open models"
|
|
593
633
|
});
|
|
634
|
+
options.push({
|
|
635
|
+
value: "huggingface-api-key",
|
|
636
|
+
label: "Hugging Face API key (HF token)",
|
|
637
|
+
hint: "Inference Providers — OpenAI-compatible chat"
|
|
638
|
+
});
|
|
594
639
|
options.push({
|
|
595
640
|
value: "github-copilot",
|
|
596
641
|
label: "GitHub Copilot (GitHub device login)",
|
|
@@ -612,7 +657,27 @@ function buildAuthChoiceOptions(params) {
|
|
|
612
657
|
});
|
|
613
658
|
options.push({
|
|
614
659
|
value: "zai-api-key",
|
|
615
|
-
label: "Z.AI
|
|
660
|
+
label: "Z.AI API key"
|
|
661
|
+
});
|
|
662
|
+
options.push({
|
|
663
|
+
value: "zai-coding-global",
|
|
664
|
+
label: "Coding-Plan-Global",
|
|
665
|
+
hint: "GLM Coding Plan Global (api.z.ai)"
|
|
666
|
+
});
|
|
667
|
+
options.push({
|
|
668
|
+
value: "zai-coding-cn",
|
|
669
|
+
label: "Coding-Plan-CN",
|
|
670
|
+
hint: "GLM Coding Plan CN (open.bigmodel.cn)"
|
|
671
|
+
});
|
|
672
|
+
options.push({
|
|
673
|
+
value: "zai-global",
|
|
674
|
+
label: "Global",
|
|
675
|
+
hint: "Z.AI Global (api.z.ai)"
|
|
676
|
+
});
|
|
677
|
+
options.push({
|
|
678
|
+
value: "zai-cn",
|
|
679
|
+
label: "CN",
|
|
680
|
+
hint: "Z.AI CN (open.bigmodel.cn)"
|
|
616
681
|
});
|
|
617
682
|
options.push({
|
|
618
683
|
value: "xiaomi-api-key",
|
|
@@ -643,13 +708,17 @@ function buildAuthChoiceOptions(params) {
|
|
|
643
708
|
});
|
|
644
709
|
options.push({
|
|
645
710
|
value: "minimax-api",
|
|
646
|
-
label: "MiniMax M2.
|
|
711
|
+
label: "MiniMax M2.5"
|
|
647
712
|
});
|
|
648
713
|
options.push({
|
|
649
714
|
value: "minimax-api-lightning",
|
|
650
|
-
label: "MiniMax M2.
|
|
715
|
+
label: "MiniMax M2.5 Lightning",
|
|
651
716
|
hint: "Faster, higher output cost"
|
|
652
717
|
});
|
|
718
|
+
options.push({
|
|
719
|
+
value: "custom-api-key",
|
|
720
|
+
label: "Custom Provider"
|
|
721
|
+
});
|
|
653
722
|
if (params.includeSkip) options.push({
|
|
654
723
|
value: "skip",
|
|
655
724
|
label: "Skip for now"
|
|
@@ -696,6 +765,7 @@ async function promptAuthChoiceGrouped(params) {
|
|
|
696
765
|
await params.prompter.note("No auth methods available for that provider.", "Model/auth choice");
|
|
697
766
|
continue;
|
|
698
767
|
}
|
|
768
|
+
if (group.options.length === 1) return group.options[0].value;
|
|
699
769
|
const methodSelection = await params.prompter.select({
|
|
700
770
|
message: `${group.label} auth method`,
|
|
701
771
|
options: [...group.options, {
|
|
@@ -747,7 +817,7 @@ async function applyAuthChoiceAnthropic(params) {
|
|
|
747
817
|
message: "Paste Anthropic setup-token",
|
|
748
818
|
validate: (value) => validateAnthropicSetupToken(String(value ?? ""))
|
|
749
819
|
});
|
|
750
|
-
const token = String(tokenRaw).trim();
|
|
820
|
+
const token = String(tokenRaw ?? "").trim();
|
|
751
821
|
const profileNameRaw = await params.prompter.text({
|
|
752
822
|
message: "Token name (blank = default)",
|
|
753
823
|
placeholder: "default"
|
|
@@ -796,7 +866,7 @@ async function applyAuthChoiceAnthropic(params) {
|
|
|
796
866
|
message: "Enter Anthropic API key",
|
|
797
867
|
validate: validateApiKeyInput
|
|
798
868
|
});
|
|
799
|
-
await setAnthropicApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
869
|
+
await setAnthropicApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
800
870
|
}
|
|
801
871
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
802
872
|
profileId: "anthropic:default",
|
|
@@ -849,6 +919,189 @@ async function applyDefaultModelChoice(params) {
|
|
|
849
919
|
};
|
|
850
920
|
}
|
|
851
921
|
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region src/commands/auth-choice.apply.huggingface.ts
|
|
924
|
+
async function applyAuthChoiceHuggingface(params) {
|
|
925
|
+
if (params.authChoice !== "huggingface-api-key") return null;
|
|
926
|
+
let nextConfig = params.config;
|
|
927
|
+
let agentModelOverride;
|
|
928
|
+
const noteAgentModel = async (model) => {
|
|
929
|
+
if (!params.agentId) return;
|
|
930
|
+
await params.prompter.note(`Default model set to ${model} for agent "${params.agentId}".`, "Model configured");
|
|
931
|
+
};
|
|
932
|
+
let hasCredential = false;
|
|
933
|
+
let hfKey = "";
|
|
934
|
+
if (!hasCredential && params.opts?.token && params.opts.tokenProvider === "huggingface") {
|
|
935
|
+
hfKey = normalizeApiKeyInput(params.opts.token);
|
|
936
|
+
await setHuggingfaceApiKey(hfKey, params.agentDir);
|
|
937
|
+
hasCredential = true;
|
|
938
|
+
}
|
|
939
|
+
if (!hasCredential) await params.prompter.note(["Hugging Face Inference Providers offer OpenAI-compatible chat completions.", "Create a token at: https://huggingface.co/settings/tokens (fine-grained, 'Make calls to Inference Providers')."].join("\n"), "Hugging Face");
|
|
940
|
+
if (!hasCredential) {
|
|
941
|
+
const envKey = resolveEnvApiKey("huggingface");
|
|
942
|
+
if (envKey) {
|
|
943
|
+
if (await params.prompter.confirm({
|
|
944
|
+
message: `Use existing Hugging Face token (${envKey.source}, ${formatApiKeyPreview(envKey.apiKey)})?`,
|
|
945
|
+
initialValue: true
|
|
946
|
+
})) {
|
|
947
|
+
hfKey = envKey.apiKey;
|
|
948
|
+
await setHuggingfaceApiKey(hfKey, params.agentDir);
|
|
949
|
+
hasCredential = true;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
if (!hasCredential) {
|
|
954
|
+
const key = await params.prompter.text({
|
|
955
|
+
message: "Enter Hugging Face API key (HF token)",
|
|
956
|
+
validate: validateApiKeyInput
|
|
957
|
+
});
|
|
958
|
+
hfKey = normalizeApiKeyInput(String(key ?? ""));
|
|
959
|
+
await setHuggingfaceApiKey(hfKey, params.agentDir);
|
|
960
|
+
}
|
|
961
|
+
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
962
|
+
profileId: "huggingface:default",
|
|
963
|
+
provider: "huggingface",
|
|
964
|
+
mode: "api_key"
|
|
965
|
+
});
|
|
966
|
+
const models = await discoverHuggingfaceModels(hfKey);
|
|
967
|
+
const modelRefPrefix = "huggingface/";
|
|
968
|
+
const options = [];
|
|
969
|
+
for (const m of models) {
|
|
970
|
+
const baseRef = `${modelRefPrefix}${m.id}`;
|
|
971
|
+
const label = m.name ?? m.id;
|
|
972
|
+
options.push({
|
|
973
|
+
value: baseRef,
|
|
974
|
+
label
|
|
975
|
+
});
|
|
976
|
+
options.push({
|
|
977
|
+
value: `${baseRef}:cheapest`,
|
|
978
|
+
label: `${label} (cheapest)`
|
|
979
|
+
});
|
|
980
|
+
options.push({
|
|
981
|
+
value: `${baseRef}:fastest`,
|
|
982
|
+
label: `${label} (fastest)`
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
const defaultRef = HUGGINGFACE_DEFAULT_MODEL_REF;
|
|
986
|
+
options.sort((a, b) => {
|
|
987
|
+
if (a.value === defaultRef) return -1;
|
|
988
|
+
if (b.value === defaultRef) return 1;
|
|
989
|
+
return a.label.localeCompare(b.label, void 0, { sensitivity: "base" });
|
|
990
|
+
});
|
|
991
|
+
const selectedModelRef = options.length === 0 ? defaultRef : options.length === 1 ? options[0].value : await params.prompter.select({
|
|
992
|
+
message: "Default Hugging Face model",
|
|
993
|
+
options,
|
|
994
|
+
initialValue: options.some((o) => o.value === defaultRef) ? defaultRef : options[0].value
|
|
995
|
+
});
|
|
996
|
+
if (isHuggingfacePolicyLocked(selectedModelRef)) await params.prompter.note("Provider locked — router will choose backend by cost or speed.", "Hugging Face");
|
|
997
|
+
const applied = await applyDefaultModelChoice({
|
|
998
|
+
config: nextConfig,
|
|
999
|
+
setDefaultModel: params.setDefaultModel,
|
|
1000
|
+
defaultModel: selectedModelRef,
|
|
1001
|
+
applyDefaultConfig: (config) => {
|
|
1002
|
+
const withProvider = applyHuggingfaceProviderConfig(config);
|
|
1003
|
+
const existingModel = withProvider.agents?.defaults?.model;
|
|
1004
|
+
return ensureModelAllowlistEntry({
|
|
1005
|
+
cfg: {
|
|
1006
|
+
...withProvider,
|
|
1007
|
+
agents: {
|
|
1008
|
+
...withProvider.agents,
|
|
1009
|
+
defaults: {
|
|
1010
|
+
...withProvider.agents?.defaults,
|
|
1011
|
+
model: {
|
|
1012
|
+
...existingModel && typeof existingModel === "object" && "fallbacks" in existingModel ? { fallbacks: existingModel.fallbacks } : {},
|
|
1013
|
+
primary: selectedModelRef
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
},
|
|
1018
|
+
modelRef: selectedModelRef
|
|
1019
|
+
});
|
|
1020
|
+
},
|
|
1021
|
+
applyProviderConfig: applyHuggingfaceProviderConfig,
|
|
1022
|
+
noteDefault: selectedModelRef,
|
|
1023
|
+
noteAgentModel,
|
|
1024
|
+
prompter: params.prompter
|
|
1025
|
+
});
|
|
1026
|
+
nextConfig = applied.config;
|
|
1027
|
+
agentModelOverride = applied.agentModelOverride ?? agentModelOverride;
|
|
1028
|
+
return {
|
|
1029
|
+
config: nextConfig,
|
|
1030
|
+
agentModelOverride
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
//#endregion
|
|
1035
|
+
//#region src/commands/auth-choice.apply.openrouter.ts
|
|
1036
|
+
async function applyAuthChoiceOpenRouter(params) {
|
|
1037
|
+
let nextConfig = params.config;
|
|
1038
|
+
let agentModelOverride;
|
|
1039
|
+
const noteAgentModel = async (model) => {
|
|
1040
|
+
if (!params.agentId) return;
|
|
1041
|
+
await params.prompter.note(`Default model set to ${model} for agent "${params.agentId}".`, "Model configured");
|
|
1042
|
+
};
|
|
1043
|
+
const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
1044
|
+
const existingProfileId = resolveAuthProfileOrder({
|
|
1045
|
+
cfg: nextConfig,
|
|
1046
|
+
store,
|
|
1047
|
+
provider: "openrouter"
|
|
1048
|
+
}).find((profileId) => Boolean(store.profiles[profileId]));
|
|
1049
|
+
const existingCred = existingProfileId ? store.profiles[existingProfileId] : void 0;
|
|
1050
|
+
let profileId = "openrouter:default";
|
|
1051
|
+
let mode = "api_key";
|
|
1052
|
+
let hasCredential = false;
|
|
1053
|
+
if (existingProfileId && existingCred?.type) {
|
|
1054
|
+
profileId = existingProfileId;
|
|
1055
|
+
mode = existingCred.type === "oauth" ? "oauth" : existingCred.type === "token" ? "token" : "api_key";
|
|
1056
|
+
hasCredential = true;
|
|
1057
|
+
}
|
|
1058
|
+
if (!hasCredential && params.opts?.token && params.opts?.tokenProvider === "openrouter") {
|
|
1059
|
+
await setOpenrouterApiKey(normalizeApiKeyInput(params.opts.token), params.agentDir);
|
|
1060
|
+
hasCredential = true;
|
|
1061
|
+
}
|
|
1062
|
+
if (!hasCredential) {
|
|
1063
|
+
const envKey = resolveEnvApiKey("openrouter");
|
|
1064
|
+
if (envKey) {
|
|
1065
|
+
if (await params.prompter.confirm({
|
|
1066
|
+
message: `Use existing OPENROUTER_API_KEY (${envKey.source}, ${formatApiKeyPreview(envKey.apiKey)})?`,
|
|
1067
|
+
initialValue: true
|
|
1068
|
+
})) {
|
|
1069
|
+
await setOpenrouterApiKey(envKey.apiKey, params.agentDir);
|
|
1070
|
+
hasCredential = true;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
if (!hasCredential) {
|
|
1075
|
+
const key = await params.prompter.text({
|
|
1076
|
+
message: "Enter OpenRouter API key",
|
|
1077
|
+
validate: validateApiKeyInput
|
|
1078
|
+
});
|
|
1079
|
+
await setOpenrouterApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1080
|
+
hasCredential = true;
|
|
1081
|
+
}
|
|
1082
|
+
if (hasCredential) nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1083
|
+
profileId,
|
|
1084
|
+
provider: "openrouter",
|
|
1085
|
+
mode
|
|
1086
|
+
});
|
|
1087
|
+
const applied = await applyDefaultModelChoice({
|
|
1088
|
+
config: nextConfig,
|
|
1089
|
+
setDefaultModel: params.setDefaultModel,
|
|
1090
|
+
defaultModel: OPENROUTER_DEFAULT_MODEL_REF,
|
|
1091
|
+
applyDefaultConfig: applyOpenrouterConfig,
|
|
1092
|
+
applyProviderConfig: applyOpenrouterProviderConfig,
|
|
1093
|
+
noteDefault: OPENROUTER_DEFAULT_MODEL_REF,
|
|
1094
|
+
noteAgentModel,
|
|
1095
|
+
prompter: params.prompter
|
|
1096
|
+
});
|
|
1097
|
+
nextConfig = applied.config;
|
|
1098
|
+
agentModelOverride = applied.agentModelOverride ?? agentModelOverride;
|
|
1099
|
+
return {
|
|
1100
|
+
config: nextConfig,
|
|
1101
|
+
agentModelOverride
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
|
|
852
1105
|
//#endregion
|
|
853
1106
|
//#region src/commands/google-gemini-model-default.ts
|
|
854
1107
|
const GOOGLE_GEMINI_DEFAULT_MODEL = "google/gemini-3-pro-preview";
|
|
@@ -883,6 +1136,91 @@ function applyGoogleGeminiModelDefault(cfg) {
|
|
|
883
1136
|
//#region src/commands/opencode-zen-model-default.ts
|
|
884
1137
|
const OPENCODE_ZEN_DEFAULT_MODEL = "opencode/claude-opus-4-6";
|
|
885
1138
|
|
|
1139
|
+
//#endregion
|
|
1140
|
+
//#region src/commands/zai-endpoint-detect.ts
|
|
1141
|
+
async function probeZaiChatCompletions(params) {
|
|
1142
|
+
try {
|
|
1143
|
+
const res = await fetchWithTimeout(`${params.baseUrl}/chat/completions`, {
|
|
1144
|
+
method: "POST",
|
|
1145
|
+
headers: {
|
|
1146
|
+
authorization: `Bearer ${params.apiKey}`,
|
|
1147
|
+
"content-type": "application/json"
|
|
1148
|
+
},
|
|
1149
|
+
body: JSON.stringify({
|
|
1150
|
+
model: params.modelId,
|
|
1151
|
+
stream: false,
|
|
1152
|
+
max_tokens: 1,
|
|
1153
|
+
messages: [{
|
|
1154
|
+
role: "user",
|
|
1155
|
+
content: "ping"
|
|
1156
|
+
}]
|
|
1157
|
+
})
|
|
1158
|
+
}, params.timeoutMs, params.fetchFn);
|
|
1159
|
+
if (res.ok) return { ok: true };
|
|
1160
|
+
let errorCode;
|
|
1161
|
+
let errorMessage;
|
|
1162
|
+
try {
|
|
1163
|
+
const json = await res.json();
|
|
1164
|
+
const code = json?.error?.code;
|
|
1165
|
+
const msg = json?.error?.message ?? json?.msg ?? json?.message;
|
|
1166
|
+
if (typeof code === "string") errorCode = code;
|
|
1167
|
+
else if (typeof code === "number") errorCode = String(code);
|
|
1168
|
+
if (typeof msg === "string") errorMessage = msg;
|
|
1169
|
+
} catch {}
|
|
1170
|
+
return {
|
|
1171
|
+
ok: false,
|
|
1172
|
+
status: res.status,
|
|
1173
|
+
errorCode,
|
|
1174
|
+
errorMessage
|
|
1175
|
+
};
|
|
1176
|
+
} catch {
|
|
1177
|
+
return { ok: false };
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
async function detectZaiEndpoint(params) {
|
|
1181
|
+
if (process.env.VITEST && !params.fetchFn) return null;
|
|
1182
|
+
const timeoutMs = params.timeoutMs ?? 5e3;
|
|
1183
|
+
const glm5 = [{
|
|
1184
|
+
endpoint: "global",
|
|
1185
|
+
baseUrl: ZAI_GLOBAL_BASE_URL
|
|
1186
|
+
}, {
|
|
1187
|
+
endpoint: "cn",
|
|
1188
|
+
baseUrl: ZAI_CN_BASE_URL
|
|
1189
|
+
}];
|
|
1190
|
+
for (const candidate of glm5) if ((await probeZaiChatCompletions({
|
|
1191
|
+
baseUrl: candidate.baseUrl,
|
|
1192
|
+
apiKey: params.apiKey,
|
|
1193
|
+
modelId: "glm-5",
|
|
1194
|
+
timeoutMs,
|
|
1195
|
+
fetchFn: params.fetchFn
|
|
1196
|
+
})).ok) return {
|
|
1197
|
+
endpoint: candidate.endpoint,
|
|
1198
|
+
baseUrl: candidate.baseUrl,
|
|
1199
|
+
modelId: "glm-5",
|
|
1200
|
+
note: `Verified GLM-5 on ${candidate.endpoint} endpoint.`
|
|
1201
|
+
};
|
|
1202
|
+
const coding = [{
|
|
1203
|
+
endpoint: "coding-global",
|
|
1204
|
+
baseUrl: ZAI_CODING_GLOBAL_BASE_URL
|
|
1205
|
+
}, {
|
|
1206
|
+
endpoint: "coding-cn",
|
|
1207
|
+
baseUrl: ZAI_CODING_CN_BASE_URL
|
|
1208
|
+
}];
|
|
1209
|
+
for (const candidate of coding) if ((await probeZaiChatCompletions({
|
|
1210
|
+
baseUrl: candidate.baseUrl,
|
|
1211
|
+
apiKey: params.apiKey,
|
|
1212
|
+
modelId: "glm-4.7",
|
|
1213
|
+
timeoutMs,
|
|
1214
|
+
fetchFn: params.fetchFn
|
|
1215
|
+
})).ok) return {
|
|
1216
|
+
endpoint: candidate.endpoint,
|
|
1217
|
+
baseUrl: candidate.baseUrl,
|
|
1218
|
+
modelId: "glm-4.7",
|
|
1219
|
+
note: "Coding Plan endpoint detected; GLM-5 is not available there. Defaulting to GLM-4.7."
|
|
1220
|
+
};
|
|
1221
|
+
return null;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
886
1224
|
//#endregion
|
|
887
1225
|
//#region src/commands/auth-choice.apply.api-providers.ts
|
|
888
1226
|
async function applyAuthChoiceApiProviders(params) {
|
|
@@ -895,6 +1233,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
895
1233
|
let authChoice = params.authChoice;
|
|
896
1234
|
if (authChoice === "apiKey" && params.opts?.tokenProvider && params.opts.tokenProvider !== "anthropic" && params.opts.tokenProvider !== "openai") {
|
|
897
1235
|
if (params.opts.tokenProvider === "openrouter") authChoice = "openrouter-api-key";
|
|
1236
|
+
else if (params.opts.tokenProvider === "litellm") authChoice = "litellm-api-key";
|
|
898
1237
|
else if (params.opts.tokenProvider === "vercel-ai-gateway") authChoice = "ai-gateway-api-key";
|
|
899
1238
|
else if (params.opts.tokenProvider === "cloudflare-ai-gateway") authChoice = "cloudflare-ai-gateway-api-key";
|
|
900
1239
|
else if (params.opts.tokenProvider === "moonshot") authChoice = "moonshot-api-key";
|
|
@@ -905,68 +1244,67 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
905
1244
|
else if (params.opts.tokenProvider === "synthetic") authChoice = "synthetic-api-key";
|
|
906
1245
|
else if (params.opts.tokenProvider === "venice") authChoice = "venice-api-key";
|
|
907
1246
|
else if (params.opts.tokenProvider === "together") authChoice = "together-api-key";
|
|
1247
|
+
else if (params.opts.tokenProvider === "huggingface") authChoice = "huggingface-api-key";
|
|
908
1248
|
else if (params.opts.tokenProvider === "opencode") authChoice = "opencode-zen";
|
|
909
1249
|
else if (params.opts.tokenProvider === "qianfan") authChoice = "qianfan-api-key";
|
|
910
1250
|
}
|
|
911
|
-
if (authChoice === "openrouter-api-key")
|
|
1251
|
+
if (authChoice === "openrouter-api-key") return applyAuthChoiceOpenRouter(params);
|
|
1252
|
+
if (authChoice === "litellm-api-key") {
|
|
912
1253
|
const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
913
1254
|
const existingProfileId = resolveAuthProfileOrder({
|
|
914
1255
|
cfg: nextConfig,
|
|
915
1256
|
store,
|
|
916
|
-
provider: "
|
|
1257
|
+
provider: "litellm"
|
|
917
1258
|
}).find((profileId) => Boolean(store.profiles[profileId]));
|
|
918
1259
|
const existingCred = existingProfileId ? store.profiles[existingProfileId] : void 0;
|
|
919
|
-
let profileId = "
|
|
920
|
-
let mode = "api_key";
|
|
1260
|
+
let profileId = "litellm:default";
|
|
921
1261
|
let hasCredential = false;
|
|
922
|
-
if (existingProfileId && existingCred?.type) {
|
|
1262
|
+
if (existingProfileId && existingCred?.type === "api_key") {
|
|
923
1263
|
profileId = existingProfileId;
|
|
924
|
-
mode = existingCred.type === "oauth" ? "oauth" : existingCred.type === "token" ? "token" : "api_key";
|
|
925
1264
|
hasCredential = true;
|
|
926
1265
|
}
|
|
927
|
-
if (!hasCredential && params.opts?.token && params.opts?.tokenProvider === "
|
|
928
|
-
await
|
|
1266
|
+
if (!hasCredential && params.opts?.token && params.opts?.tokenProvider === "litellm") {
|
|
1267
|
+
await setLitellmApiKey(normalizeApiKeyInput(params.opts.token), params.agentDir);
|
|
929
1268
|
hasCredential = true;
|
|
930
1269
|
}
|
|
931
1270
|
if (!hasCredential) {
|
|
932
|
-
|
|
1271
|
+
await params.prompter.note("LiteLLM provides a unified API to 100+ LLM providers.\nGet your API key from your LiteLLM proxy or https://litellm.ai\nDefault proxy runs on http://localhost:4000", "LiteLLM");
|
|
1272
|
+
const envKey = resolveEnvApiKey("litellm");
|
|
933
1273
|
if (envKey) {
|
|
934
1274
|
if (await params.prompter.confirm({
|
|
935
|
-
message: `Use existing
|
|
1275
|
+
message: `Use existing LITELLM_API_KEY (${envKey.source}, ${formatApiKeyPreview(envKey.apiKey)})?`,
|
|
936
1276
|
initialValue: true
|
|
937
1277
|
})) {
|
|
938
|
-
await
|
|
1278
|
+
await setLitellmApiKey(envKey.apiKey, params.agentDir);
|
|
939
1279
|
hasCredential = true;
|
|
940
1280
|
}
|
|
941
1281
|
}
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1282
|
+
if (!hasCredential) {
|
|
1283
|
+
const key = await params.prompter.text({
|
|
1284
|
+
message: "Enter LiteLLM API key",
|
|
1285
|
+
validate: validateApiKeyInput
|
|
1286
|
+
});
|
|
1287
|
+
await setLitellmApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1288
|
+
hasCredential = true;
|
|
1289
|
+
}
|
|
950
1290
|
}
|
|
951
1291
|
if (hasCredential) nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
952
1292
|
profileId,
|
|
953
|
-
provider: "
|
|
954
|
-
mode
|
|
1293
|
+
provider: "litellm",
|
|
1294
|
+
mode: "api_key"
|
|
955
1295
|
});
|
|
956
|
-
{
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
agentModelOverride = applied.agentModelOverride ?? agentModelOverride;
|
|
969
|
-
}
|
|
1296
|
+
const applied = await applyDefaultModelChoice({
|
|
1297
|
+
config: nextConfig,
|
|
1298
|
+
setDefaultModel: params.setDefaultModel,
|
|
1299
|
+
defaultModel: LITELLM_DEFAULT_MODEL_REF,
|
|
1300
|
+
applyDefaultConfig: applyLitellmConfig,
|
|
1301
|
+
applyProviderConfig: applyLitellmProviderConfig,
|
|
1302
|
+
noteDefault: LITELLM_DEFAULT_MODEL_REF,
|
|
1303
|
+
noteAgentModel,
|
|
1304
|
+
prompter: params.prompter
|
|
1305
|
+
});
|
|
1306
|
+
nextConfig = applied.config;
|
|
1307
|
+
agentModelOverride = applied.agentModelOverride ?? agentModelOverride;
|
|
970
1308
|
return {
|
|
971
1309
|
config: nextConfig,
|
|
972
1310
|
agentModelOverride
|
|
@@ -993,7 +1331,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
993
1331
|
message: "Enter Vercel AI Gateway API key",
|
|
994
1332
|
validate: validateApiKeyInput
|
|
995
1333
|
});
|
|
996
|
-
await setVercelAiGatewayApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1334
|
+
await setVercelAiGatewayApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
997
1335
|
}
|
|
998
1336
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
999
1337
|
profileId: "vercel-ai-gateway:default",
|
|
@@ -1027,16 +1365,16 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1027
1365
|
if (!accountId) {
|
|
1028
1366
|
const value = await params.prompter.text({
|
|
1029
1367
|
message: "Enter Cloudflare Account ID",
|
|
1030
|
-
validate: (val) => String(val).trim() ? void 0 : "Account ID is required"
|
|
1368
|
+
validate: (val) => String(val ?? "").trim() ? void 0 : "Account ID is required"
|
|
1031
1369
|
});
|
|
1032
|
-
accountId = String(value).trim();
|
|
1370
|
+
accountId = String(value ?? "").trim();
|
|
1033
1371
|
}
|
|
1034
1372
|
if (!gatewayId) {
|
|
1035
1373
|
const value = await params.prompter.text({
|
|
1036
1374
|
message: "Enter Cloudflare AI Gateway ID",
|
|
1037
|
-
validate: (val) => String(val).trim() ? void 0 : "Gateway ID is required"
|
|
1375
|
+
validate: (val) => String(val ?? "").trim() ? void 0 : "Gateway ID is required"
|
|
1038
1376
|
});
|
|
1039
|
-
gatewayId = String(value).trim();
|
|
1377
|
+
gatewayId = String(value ?? "").trim();
|
|
1040
1378
|
}
|
|
1041
1379
|
};
|
|
1042
1380
|
const optsApiKey = normalizeApiKeyInput(params.opts?.cloudflareAiGatewayApiKey ?? "");
|
|
@@ -1066,7 +1404,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1066
1404
|
message: "Enter Cloudflare AI Gateway API key",
|
|
1067
1405
|
validate: validateApiKeyInput
|
|
1068
1406
|
});
|
|
1069
|
-
await setCloudflareAiGatewayConfig(accountId, gatewayId, normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1407
|
+
await setCloudflareAiGatewayConfig(accountId, gatewayId, normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1070
1408
|
hasCredential = true;
|
|
1071
1409
|
}
|
|
1072
1410
|
if (hasCredential) nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
@@ -1120,7 +1458,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1120
1458
|
message: "Enter Moonshot API key",
|
|
1121
1459
|
validate: validateApiKeyInput
|
|
1122
1460
|
});
|
|
1123
|
-
await setMoonshotApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1461
|
+
await setMoonshotApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1124
1462
|
}
|
|
1125
1463
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1126
1464
|
profileId: "moonshot:default",
|
|
@@ -1166,7 +1504,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1166
1504
|
message: "Enter Moonshot API key (.cn)",
|
|
1167
1505
|
validate: validateApiKeyInput
|
|
1168
1506
|
});
|
|
1169
|
-
await setMoonshotApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1507
|
+
await setMoonshotApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1170
1508
|
}
|
|
1171
1509
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1172
1510
|
profileId: "moonshot:default",
|
|
@@ -1214,7 +1552,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1214
1552
|
message: "Enter Kimi Coding API key",
|
|
1215
1553
|
validate: validateApiKeyInput
|
|
1216
1554
|
});
|
|
1217
|
-
await setKimiCodingApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1555
|
+
await setKimiCodingApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1218
1556
|
}
|
|
1219
1557
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1220
1558
|
profileId: "kimi-coding:default",
|
|
@@ -1261,7 +1599,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1261
1599
|
message: "Enter Gemini API key",
|
|
1262
1600
|
validate: validateApiKeyInput
|
|
1263
1601
|
});
|
|
1264
|
-
await setGeminiApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1602
|
+
await setGeminiApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1265
1603
|
}
|
|
1266
1604
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1267
1605
|
profileId: "google:default",
|
|
@@ -1281,10 +1619,17 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1281
1619
|
agentModelOverride
|
|
1282
1620
|
};
|
|
1283
1621
|
}
|
|
1284
|
-
if (authChoice === "zai-api-key") {
|
|
1622
|
+
if (authChoice === "zai-api-key" || authChoice === "zai-coding-global" || authChoice === "zai-coding-cn" || authChoice === "zai-global" || authChoice === "zai-cn") {
|
|
1623
|
+
let endpoint;
|
|
1624
|
+
if (authChoice === "zai-coding-global") endpoint = "coding-global";
|
|
1625
|
+
else if (authChoice === "zai-coding-cn") endpoint = "coding-cn";
|
|
1626
|
+
else if (authChoice === "zai-global") endpoint = "global";
|
|
1627
|
+
else if (authChoice === "zai-cn") endpoint = "cn";
|
|
1285
1628
|
let hasCredential = false;
|
|
1629
|
+
let apiKey = "";
|
|
1286
1630
|
if (!hasCredential && params.opts?.token && params.opts?.tokenProvider === "zai") {
|
|
1287
|
-
|
|
1631
|
+
apiKey = normalizeApiKeyInput(params.opts.token);
|
|
1632
|
+
await setZaiApiKey(apiKey, params.agentDir);
|
|
1288
1633
|
hasCredential = true;
|
|
1289
1634
|
}
|
|
1290
1635
|
const envKey = resolveEnvApiKey("zai");
|
|
@@ -1293,7 +1638,8 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1293
1638
|
message: `Use existing ZAI_API_KEY (${envKey.source}, ${formatApiKeyPreview(envKey.apiKey)})?`,
|
|
1294
1639
|
initialValue: true
|
|
1295
1640
|
})) {
|
|
1296
|
-
|
|
1641
|
+
apiKey = envKey.apiKey;
|
|
1642
|
+
await setZaiApiKey(apiKey, params.agentDir);
|
|
1297
1643
|
hasCredential = true;
|
|
1298
1644
|
}
|
|
1299
1645
|
}
|
|
@@ -1302,42 +1648,67 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1302
1648
|
message: "Enter Z.AI API key",
|
|
1303
1649
|
validate: validateApiKeyInput
|
|
1304
1650
|
});
|
|
1305
|
-
|
|
1651
|
+
apiKey = normalizeApiKeyInput(String(key ?? ""));
|
|
1652
|
+
await setZaiApiKey(apiKey, params.agentDir);
|
|
1653
|
+
}
|
|
1654
|
+
let modelIdOverride;
|
|
1655
|
+
if (!endpoint) {
|
|
1656
|
+
const detected = await detectZaiEndpoint({ apiKey });
|
|
1657
|
+
if (detected) {
|
|
1658
|
+
endpoint = detected.endpoint;
|
|
1659
|
+
modelIdOverride = detected.modelId;
|
|
1660
|
+
await params.prompter.note(detected.note, "Z.AI endpoint");
|
|
1661
|
+
} else endpoint = await params.prompter.select({
|
|
1662
|
+
message: "Select Z.AI endpoint",
|
|
1663
|
+
options: [
|
|
1664
|
+
{
|
|
1665
|
+
value: "coding-global",
|
|
1666
|
+
label: "Coding-Plan-Global",
|
|
1667
|
+
hint: "GLM Coding Plan Global (api.z.ai)"
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
value: "coding-cn",
|
|
1671
|
+
label: "Coding-Plan-CN",
|
|
1672
|
+
hint: "GLM Coding Plan CN (open.bigmodel.cn)"
|
|
1673
|
+
},
|
|
1674
|
+
{
|
|
1675
|
+
value: "global",
|
|
1676
|
+
label: "Global",
|
|
1677
|
+
hint: "Z.AI Global (api.z.ai)"
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
value: "cn",
|
|
1681
|
+
label: "CN",
|
|
1682
|
+
hint: "Z.AI CN (open.bigmodel.cn)"
|
|
1683
|
+
}
|
|
1684
|
+
],
|
|
1685
|
+
initialValue: "global"
|
|
1686
|
+
});
|
|
1306
1687
|
}
|
|
1307
1688
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1308
1689
|
profileId: "zai:default",
|
|
1309
1690
|
provider: "zai",
|
|
1310
1691
|
mode: "api_key"
|
|
1311
1692
|
});
|
|
1312
|
-
{
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
}),
|
|
1334
|
-
noteDefault: ZAI_DEFAULT_MODEL_REF,
|
|
1335
|
-
noteAgentModel,
|
|
1336
|
-
prompter: params.prompter
|
|
1337
|
-
});
|
|
1338
|
-
nextConfig = applied.config;
|
|
1339
|
-
agentModelOverride = applied.agentModelOverride ?? agentModelOverride;
|
|
1340
|
-
}
|
|
1693
|
+
const defaultModel = modelIdOverride ? `zai/${modelIdOverride}` : ZAI_DEFAULT_MODEL_REF;
|
|
1694
|
+
const applied = await applyDefaultModelChoice({
|
|
1695
|
+
config: nextConfig,
|
|
1696
|
+
setDefaultModel: params.setDefaultModel,
|
|
1697
|
+
defaultModel,
|
|
1698
|
+
applyDefaultConfig: (config) => applyZaiConfig(config, {
|
|
1699
|
+
endpoint,
|
|
1700
|
+
...modelIdOverride ? { modelId: modelIdOverride } : {}
|
|
1701
|
+
}),
|
|
1702
|
+
applyProviderConfig: (config) => applyZaiProviderConfig(config, {
|
|
1703
|
+
endpoint,
|
|
1704
|
+
...modelIdOverride ? { modelId: modelIdOverride } : {}
|
|
1705
|
+
}),
|
|
1706
|
+
noteDefault: defaultModel,
|
|
1707
|
+
noteAgentModel,
|
|
1708
|
+
prompter: params.prompter
|
|
1709
|
+
});
|
|
1710
|
+
nextConfig = applied.config;
|
|
1711
|
+
agentModelOverride = applied.agentModelOverride ?? agentModelOverride;
|
|
1341
1712
|
return {
|
|
1342
1713
|
config: nextConfig,
|
|
1343
1714
|
agentModelOverride
|
|
@@ -1364,7 +1735,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1364
1735
|
message: "Enter Xiaomi API key",
|
|
1365
1736
|
validate: validateApiKeyInput
|
|
1366
1737
|
});
|
|
1367
|
-
await setXiaomiApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1738
|
+
await setXiaomiApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1368
1739
|
}
|
|
1369
1740
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1370
1741
|
profileId: "xiaomi:default",
|
|
@@ -1391,13 +1762,13 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1391
1762
|
};
|
|
1392
1763
|
}
|
|
1393
1764
|
if (authChoice === "synthetic-api-key") {
|
|
1394
|
-
if (params.opts?.token && params.opts?.tokenProvider === "synthetic") await setSyntheticApiKey(String(params.opts.token).trim(), params.agentDir);
|
|
1765
|
+
if (params.opts?.token && params.opts?.tokenProvider === "synthetic") await setSyntheticApiKey(String(params.opts.token ?? "").trim(), params.agentDir);
|
|
1395
1766
|
else {
|
|
1396
1767
|
const key = await params.prompter.text({
|
|
1397
1768
|
message: "Enter Synthetic API key",
|
|
1398
1769
|
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
1399
1770
|
});
|
|
1400
|
-
await setSyntheticApiKey(String(key).trim(), params.agentDir);
|
|
1771
|
+
await setSyntheticApiKey(String(key ?? "").trim(), params.agentDir);
|
|
1401
1772
|
}
|
|
1402
1773
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1403
1774
|
profileId: "synthetic:default",
|
|
@@ -1449,7 +1820,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1449
1820
|
message: "Enter Venice AI API key",
|
|
1450
1821
|
validate: validateApiKeyInput
|
|
1451
1822
|
});
|
|
1452
|
-
await setVeniceApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1823
|
+
await setVeniceApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1453
1824
|
}
|
|
1454
1825
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1455
1826
|
profileId: "venice:default",
|
|
@@ -1501,7 +1872,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1501
1872
|
message: "Enter OpenCode Zen API key",
|
|
1502
1873
|
validate: validateApiKeyInput
|
|
1503
1874
|
});
|
|
1504
|
-
await setOpencodeZenApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1875
|
+
await setOpencodeZenApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1505
1876
|
}
|
|
1506
1877
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1507
1878
|
profileId: "opencode:default",
|
|
@@ -1549,7 +1920,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1549
1920
|
message: "Enter Together AI API key",
|
|
1550
1921
|
validate: validateApiKeyInput
|
|
1551
1922
|
});
|
|
1552
|
-
await setTogetherApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1923
|
+
await setTogetherApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1553
1924
|
}
|
|
1554
1925
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1555
1926
|
profileId: "together:default",
|
|
@@ -1575,6 +1946,10 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1575
1946
|
agentModelOverride
|
|
1576
1947
|
};
|
|
1577
1948
|
}
|
|
1949
|
+
if (authChoice === "huggingface-api-key") return applyAuthChoiceHuggingface({
|
|
1950
|
+
...params,
|
|
1951
|
+
authChoice
|
|
1952
|
+
});
|
|
1578
1953
|
if (authChoice === "qianfan-api-key") {
|
|
1579
1954
|
let hasCredential = false;
|
|
1580
1955
|
if (!hasCredential && params.opts?.token && params.opts?.tokenProvider === "qianfan") {
|
|
@@ -1597,7 +1972,7 @@ async function applyAuthChoiceApiProviders(params) {
|
|
|
1597
1972
|
message: "Enter QIANFAN API key",
|
|
1598
1973
|
validate: validateApiKeyInput
|
|
1599
1974
|
});
|
|
1600
|
-
setQianfanApiKey(normalizeApiKeyInput(String(key)), params.agentDir);
|
|
1975
|
+
setQianfanApiKey(normalizeApiKeyInput(String(key ?? "")), params.agentDir);
|
|
1601
1976
|
}
|
|
1602
1977
|
nextConfig = applyAuthProfileConfig(nextConfig, {
|
|
1603
1978
|
profileId: "qianfan:default",
|
|
@@ -1844,7 +2219,7 @@ async function applyAuthChoiceMiniMax(params) {
|
|
|
1844
2219
|
label: "MiniMax"
|
|
1845
2220
|
});
|
|
1846
2221
|
if (params.authChoice === "minimax-cloud" || params.authChoice === "minimax-api" || params.authChoice === "minimax-api-lightning") {
|
|
1847
|
-
const modelId = params.authChoice === "minimax-api-lightning" ? "MiniMax-M2.
|
|
2222
|
+
const modelId = params.authChoice === "minimax-api-lightning" ? "MiniMax-M2.5-Lightning" : "MiniMax-M2.5";
|
|
1848
2223
|
let hasCredential = false;
|
|
1849
2224
|
const envKey = resolveEnvApiKey("minimax");
|
|
1850
2225
|
if (envKey) {
|
|
@@ -2376,6 +2751,97 @@ async function applyAuthChoiceQwenPortal(params) {
|
|
|
2376
2751
|
});
|
|
2377
2752
|
}
|
|
2378
2753
|
|
|
2754
|
+
//#endregion
|
|
2755
|
+
//#region src/commands/auth-choice.apply.vllm.ts
|
|
2756
|
+
const VLLM_DEFAULT_BASE_URL$1 = "http://127.0.0.1:8000/v1";
|
|
2757
|
+
const VLLM_DEFAULT_CONTEXT_WINDOW$1 = 128e3;
|
|
2758
|
+
const VLLM_DEFAULT_MAX_TOKENS$1 = 8192;
|
|
2759
|
+
const VLLM_DEFAULT_COST$1 = {
|
|
2760
|
+
input: 0,
|
|
2761
|
+
output: 0,
|
|
2762
|
+
cacheRead: 0,
|
|
2763
|
+
cacheWrite: 0
|
|
2764
|
+
};
|
|
2765
|
+
function applyVllmDefaultModel(cfg, modelRef) {
|
|
2766
|
+
const existingModel = cfg.agents?.defaults?.model;
|
|
2767
|
+
const fallbacks = existingModel && typeof existingModel === "object" && "fallbacks" in existingModel ? existingModel.fallbacks : void 0;
|
|
2768
|
+
return {
|
|
2769
|
+
...cfg,
|
|
2770
|
+
agents: {
|
|
2771
|
+
...cfg.agents,
|
|
2772
|
+
defaults: {
|
|
2773
|
+
...cfg.agents?.defaults,
|
|
2774
|
+
model: {
|
|
2775
|
+
...fallbacks ? { fallbacks } : void 0,
|
|
2776
|
+
primary: modelRef
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
async function applyAuthChoiceVllm(params) {
|
|
2783
|
+
if (params.authChoice !== "vllm") return null;
|
|
2784
|
+
const baseUrlRaw = await params.prompter.text({
|
|
2785
|
+
message: "vLLM base URL",
|
|
2786
|
+
initialValue: VLLM_DEFAULT_BASE_URL$1,
|
|
2787
|
+
placeholder: VLLM_DEFAULT_BASE_URL$1,
|
|
2788
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
2789
|
+
});
|
|
2790
|
+
const apiKeyRaw = await params.prompter.text({
|
|
2791
|
+
message: "vLLM API key",
|
|
2792
|
+
placeholder: "sk-... (or any non-empty string)",
|
|
2793
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
2794
|
+
});
|
|
2795
|
+
const modelIdRaw = await params.prompter.text({
|
|
2796
|
+
message: "vLLM model",
|
|
2797
|
+
placeholder: "meta-llama/Meta-Llama-3-8B-Instruct",
|
|
2798
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
2799
|
+
});
|
|
2800
|
+
const baseUrl = String(baseUrlRaw ?? "").trim().replace(/\/+$/, "");
|
|
2801
|
+
const apiKey = String(apiKeyRaw ?? "").trim();
|
|
2802
|
+
const modelId = String(modelIdRaw ?? "").trim();
|
|
2803
|
+
const modelRef = `vllm/${modelId}`;
|
|
2804
|
+
await upsertAuthProfileWithLock({
|
|
2805
|
+
profileId: "vllm:default",
|
|
2806
|
+
credential: {
|
|
2807
|
+
type: "api_key",
|
|
2808
|
+
provider: "vllm",
|
|
2809
|
+
key: apiKey
|
|
2810
|
+
},
|
|
2811
|
+
agentDir: params.agentDir
|
|
2812
|
+
});
|
|
2813
|
+
const nextConfig = {
|
|
2814
|
+
...params.config,
|
|
2815
|
+
models: {
|
|
2816
|
+
...params.config.models,
|
|
2817
|
+
mode: params.config.models?.mode ?? "merge",
|
|
2818
|
+
providers: {
|
|
2819
|
+
...params.config.models?.providers,
|
|
2820
|
+
vllm: {
|
|
2821
|
+
baseUrl,
|
|
2822
|
+
api: "openai-completions",
|
|
2823
|
+
apiKey: "VLLM_API_KEY",
|
|
2824
|
+
models: [{
|
|
2825
|
+
id: modelId,
|
|
2826
|
+
name: modelId,
|
|
2827
|
+
reasoning: false,
|
|
2828
|
+
input: ["text"],
|
|
2829
|
+
cost: VLLM_DEFAULT_COST$1,
|
|
2830
|
+
contextWindow: VLLM_DEFAULT_CONTEXT_WINDOW$1,
|
|
2831
|
+
maxTokens: VLLM_DEFAULT_MAX_TOKENS$1
|
|
2832
|
+
}]
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
};
|
|
2837
|
+
if (!params.setDefaultModel) return {
|
|
2838
|
+
config: nextConfig,
|
|
2839
|
+
agentModelOverride: modelRef
|
|
2840
|
+
};
|
|
2841
|
+
await params.prompter.note(`Default model set to ${modelRef}`, "Model configured");
|
|
2842
|
+
return { config: applyVllmDefaultModel(nextConfig, modelRef) };
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2379
2845
|
//#endregion
|
|
2380
2846
|
//#region src/commands/auth-choice.apply.xai.ts
|
|
2381
2847
|
async function applyAuthChoiceXAI(params) {
|
|
@@ -2441,6 +2907,7 @@ async function applyAuthChoiceXAI(params) {
|
|
|
2441
2907
|
async function applyAuthChoice(params) {
|
|
2442
2908
|
const handlers = [
|
|
2443
2909
|
applyAuthChoiceAnthropic,
|
|
2910
|
+
applyAuthChoiceVllm,
|
|
2444
2911
|
applyAuthChoiceOpenAI,
|
|
2445
2912
|
applyAuthChoiceOAuth,
|
|
2446
2913
|
applyAuthChoiceApiProviders,
|
|
@@ -2508,6 +2975,7 @@ const PREFERRED_PROVIDER_BY_AUTH_CHOICE = {
|
|
|
2508
2975
|
"claude-cli": "anthropic",
|
|
2509
2976
|
token: "anthropic",
|
|
2510
2977
|
apiKey: "anthropic",
|
|
2978
|
+
vllm: "vllm",
|
|
2511
2979
|
"openai-codex": "openai-codex",
|
|
2512
2980
|
"codex-cli": "openai-codex",
|
|
2513
2981
|
chutes: "chutes",
|
|
@@ -2522,10 +2990,15 @@ const PREFERRED_PROVIDER_BY_AUTH_CHOICE = {
|
|
|
2522
2990
|
"google-antigravity": "google-antigravity",
|
|
2523
2991
|
"google-gemini-cli": "google-gemini-cli",
|
|
2524
2992
|
"zai-api-key": "zai",
|
|
2993
|
+
"zai-coding-global": "zai",
|
|
2994
|
+
"zai-coding-cn": "zai",
|
|
2995
|
+
"zai-global": "zai",
|
|
2996
|
+
"zai-cn": "zai",
|
|
2525
2997
|
"xiaomi-api-key": "xiaomi",
|
|
2526
2998
|
"synthetic-api-key": "synthetic",
|
|
2527
2999
|
"venice-api-key": "venice",
|
|
2528
3000
|
"together-api-key": "together",
|
|
3001
|
+
"huggingface-api-key": "huggingface",
|
|
2529
3002
|
"github-copilot": "github-copilot",
|
|
2530
3003
|
"copilot-proxy": "copilot-proxy",
|
|
2531
3004
|
"minimax-cloud": "minimax",
|
|
@@ -2534,9 +3007,11 @@ const PREFERRED_PROVIDER_BY_AUTH_CHOICE = {
|
|
|
2534
3007
|
minimax: "lmstudio",
|
|
2535
3008
|
"opencode-zen": "opencode",
|
|
2536
3009
|
"xai-api-key": "xai",
|
|
3010
|
+
"litellm-api-key": "litellm",
|
|
2537
3011
|
"qwen-portal": "qwen-portal",
|
|
2538
3012
|
"minimax-portal": "minimax-portal",
|
|
2539
|
-
"qianfan-api-key": "qianfan"
|
|
3013
|
+
"qianfan-api-key": "qianfan",
|
|
3014
|
+
"custom-api-key": "custom"
|
|
2540
3015
|
};
|
|
2541
3016
|
function resolvePreferredProviderForAuthChoice(choice) {
|
|
2542
3017
|
return PREFERRED_PROVIDER_BY_AUTH_CHOICE[choice];
|
|
@@ -2546,7 +3021,17 @@ function resolvePreferredProviderForAuthChoice(choice) {
|
|
|
2546
3021
|
//#region src/commands/model-picker.ts
|
|
2547
3022
|
const KEEP_VALUE = "__keep__";
|
|
2548
3023
|
const MANUAL_VALUE = "__manual__";
|
|
3024
|
+
const VLLM_VALUE = "__vllm__";
|
|
2549
3025
|
const PROVIDER_FILTER_THRESHOLD = 30;
|
|
3026
|
+
const VLLM_DEFAULT_BASE_URL = "http://127.0.0.1:8000/v1";
|
|
3027
|
+
const VLLM_DEFAULT_CONTEXT_WINDOW = 128e3;
|
|
3028
|
+
const VLLM_DEFAULT_MAX_TOKENS = 8192;
|
|
3029
|
+
const VLLM_DEFAULT_COST = {
|
|
3030
|
+
input: 0,
|
|
3031
|
+
output: 0,
|
|
3032
|
+
cacheRead: 0,
|
|
3033
|
+
cacheWrite: 0
|
|
3034
|
+
};
|
|
2550
3035
|
const HIDDEN_ROUTER_MODELS = new Set(["openrouter/auto"]);
|
|
2551
3036
|
function hasAuthForProvider(provider, cfg, store) {
|
|
2552
3037
|
if (listProfilesForProvider(store, provider).length > 0) return true;
|
|
@@ -2589,6 +3074,7 @@ async function promptDefaultModel(params) {
|
|
|
2589
3074
|
const cfg = params.config;
|
|
2590
3075
|
const allowKeep = params.allowKeep ?? true;
|
|
2591
3076
|
const includeManual = params.includeManual ?? true;
|
|
3077
|
+
const includeVllm = params.includeVllm ?? false;
|
|
2592
3078
|
const ignoreAllowlist = params.ignoreAllowlist ?? false;
|
|
2593
3079
|
const preferredProviderRaw = params.preferredProvider?.trim();
|
|
2594
3080
|
const preferredProvider = preferredProviderRaw ? normalizeProviderId(preferredProviderRaw) : void 0;
|
|
@@ -2647,7 +3133,8 @@ async function promptDefaultModel(params) {
|
|
|
2647
3133
|
if (selection !== "*") models = models.filter((entry) => entry.provider === selection);
|
|
2648
3134
|
}
|
|
2649
3135
|
if (hasPreferredProvider && preferredProvider) models = models.filter((entry) => entry.provider === preferredProvider);
|
|
2650
|
-
const
|
|
3136
|
+
const agentDir = params.agentDir;
|
|
3137
|
+
const authStore = ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false });
|
|
2651
3138
|
const authCache = /* @__PURE__ */ new Map();
|
|
2652
3139
|
const hasAuth = (provider) => {
|
|
2653
3140
|
const cached = authCache.get(provider);
|
|
@@ -2666,6 +3153,11 @@ async function promptDefaultModel(params) {
|
|
|
2666
3153
|
value: MANUAL_VALUE,
|
|
2667
3154
|
label: "Enter model manually"
|
|
2668
3155
|
});
|
|
3156
|
+
if (includeVllm && agentDir) options.push({
|
|
3157
|
+
value: VLLM_VALUE,
|
|
3158
|
+
label: "vLLM (custom)",
|
|
3159
|
+
hint: "Enter vLLM URL + API key + model"
|
|
3160
|
+
});
|
|
2669
3161
|
const seen = /* @__PURE__ */ new Set();
|
|
2670
3162
|
const addModelOption = (entry) => {
|
|
2671
3163
|
const key = modelKey(entry.provider, entry.id);
|
|
@@ -2707,6 +3199,68 @@ async function promptDefaultModel(params) {
|
|
|
2707
3199
|
allowBlank: false,
|
|
2708
3200
|
initialValue: configuredRaw || resolvedKey || void 0
|
|
2709
3201
|
});
|
|
3202
|
+
if (selection === VLLM_VALUE) {
|
|
3203
|
+
if (!agentDir) {
|
|
3204
|
+
await params.prompter.note("vLLM setup requires an agent directory context.", "vLLM not available");
|
|
3205
|
+
return {};
|
|
3206
|
+
}
|
|
3207
|
+
const baseUrlRaw = await params.prompter.text({
|
|
3208
|
+
message: "vLLM base URL",
|
|
3209
|
+
initialValue: VLLM_DEFAULT_BASE_URL,
|
|
3210
|
+
placeholder: VLLM_DEFAULT_BASE_URL,
|
|
3211
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
3212
|
+
});
|
|
3213
|
+
const apiKeyRaw = await params.prompter.text({
|
|
3214
|
+
message: "vLLM API key",
|
|
3215
|
+
placeholder: "sk-... (or any non-empty string)",
|
|
3216
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
3217
|
+
});
|
|
3218
|
+
const modelIdRaw = await params.prompter.text({
|
|
3219
|
+
message: "vLLM model",
|
|
3220
|
+
placeholder: "meta-llama/Meta-Llama-3-8B-Instruct",
|
|
3221
|
+
validate: (value) => value?.trim() ? void 0 : "Required"
|
|
3222
|
+
});
|
|
3223
|
+
const baseUrl = String(baseUrlRaw ?? "").trim().replace(/\/+$/, "");
|
|
3224
|
+
const apiKey = String(apiKeyRaw ?? "").trim();
|
|
3225
|
+
const modelId = String(modelIdRaw ?? "").trim();
|
|
3226
|
+
await upsertAuthProfileWithLock({
|
|
3227
|
+
profileId: "vllm:default",
|
|
3228
|
+
credential: {
|
|
3229
|
+
type: "api_key",
|
|
3230
|
+
provider: "vllm",
|
|
3231
|
+
key: apiKey
|
|
3232
|
+
},
|
|
3233
|
+
agentDir
|
|
3234
|
+
});
|
|
3235
|
+
const nextConfig = {
|
|
3236
|
+
...cfg,
|
|
3237
|
+
models: {
|
|
3238
|
+
...cfg.models,
|
|
3239
|
+
mode: cfg.models?.mode ?? "merge",
|
|
3240
|
+
providers: {
|
|
3241
|
+
...cfg.models?.providers,
|
|
3242
|
+
vllm: {
|
|
3243
|
+
baseUrl,
|
|
3244
|
+
api: "openai-completions",
|
|
3245
|
+
apiKey: "VLLM_API_KEY",
|
|
3246
|
+
models: [{
|
|
3247
|
+
id: modelId,
|
|
3248
|
+
name: modelId,
|
|
3249
|
+
reasoning: false,
|
|
3250
|
+
input: ["text"],
|
|
3251
|
+
cost: VLLM_DEFAULT_COST,
|
|
3252
|
+
contextWindow: VLLM_DEFAULT_CONTEXT_WINDOW,
|
|
3253
|
+
maxTokens: VLLM_DEFAULT_MAX_TOKENS
|
|
3254
|
+
}]
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
}
|
|
3258
|
+
};
|
|
3259
|
+
return {
|
|
3260
|
+
model: `vllm/${modelId}`,
|
|
3261
|
+
config: nextConfig
|
|
3262
|
+
};
|
|
3263
|
+
}
|
|
2710
3264
|
return { model: String(selection) };
|
|
2711
3265
|
}
|
|
2712
3266
|
async function promptModelAllowlist(params) {
|
|
@@ -2880,6 +3434,479 @@ function applyModelFallbacksFromSelection(cfg, selection) {
|
|
|
2880
3434
|
};
|
|
2881
3435
|
}
|
|
2882
3436
|
|
|
3437
|
+
//#endregion
|
|
3438
|
+
//#region src/commands/onboard-custom.ts
|
|
3439
|
+
const DEFAULT_OLLAMA_BASE_URL = "http://127.0.0.1:11434/v1";
|
|
3440
|
+
const DEFAULT_CONTEXT_WINDOW = 4096;
|
|
3441
|
+
const DEFAULT_MAX_TOKENS = 4096;
|
|
3442
|
+
const VERIFY_TIMEOUT_MS = 1e4;
|
|
3443
|
+
var CustomApiError = class extends Error {
|
|
3444
|
+
constructor(code, message) {
|
|
3445
|
+
super(message);
|
|
3446
|
+
this.name = "CustomApiError";
|
|
3447
|
+
this.code = code;
|
|
3448
|
+
}
|
|
3449
|
+
};
|
|
3450
|
+
const COMPATIBILITY_OPTIONS = [
|
|
3451
|
+
{
|
|
3452
|
+
value: "openai",
|
|
3453
|
+
label: "OpenAI-compatible",
|
|
3454
|
+
hint: "Uses /chat/completions"
|
|
3455
|
+
},
|
|
3456
|
+
{
|
|
3457
|
+
value: "anthropic",
|
|
3458
|
+
label: "Anthropic-compatible",
|
|
3459
|
+
hint: "Uses /messages"
|
|
3460
|
+
},
|
|
3461
|
+
{
|
|
3462
|
+
value: "unknown",
|
|
3463
|
+
label: "Unknown (detect automatically)",
|
|
3464
|
+
hint: "Probes OpenAI then Anthropic endpoints"
|
|
3465
|
+
}
|
|
3466
|
+
];
|
|
3467
|
+
function normalizeEndpointId(raw) {
|
|
3468
|
+
const trimmed = raw.trim().toLowerCase();
|
|
3469
|
+
if (!trimmed) return "";
|
|
3470
|
+
return trimmed.replace(/[^a-z0-9-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
3471
|
+
}
|
|
3472
|
+
function buildEndpointIdFromUrl(baseUrl) {
|
|
3473
|
+
try {
|
|
3474
|
+
const url = new URL(baseUrl);
|
|
3475
|
+
return normalizeEndpointId(`custom-${url.hostname.replace(/[^a-z0-9]+/gi, "-").toLowerCase()}${url.port ? `-${url.port}` : ""}`) || "custom";
|
|
3476
|
+
} catch {
|
|
3477
|
+
return "custom";
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
function resolveUniqueEndpointId(params) {
|
|
3481
|
+
const normalized = normalizeEndpointId(params.requestedId) || "custom";
|
|
3482
|
+
const existing = params.providers[normalized];
|
|
3483
|
+
if (!existing?.baseUrl || existing.baseUrl === params.baseUrl) return {
|
|
3484
|
+
providerId: normalized,
|
|
3485
|
+
renamed: false
|
|
3486
|
+
};
|
|
3487
|
+
let suffix = 2;
|
|
3488
|
+
let candidate = `${normalized}-${suffix}`;
|
|
3489
|
+
while (params.providers[candidate]) {
|
|
3490
|
+
suffix += 1;
|
|
3491
|
+
candidate = `${normalized}-${suffix}`;
|
|
3492
|
+
}
|
|
3493
|
+
return {
|
|
3494
|
+
providerId: candidate,
|
|
3495
|
+
renamed: true
|
|
3496
|
+
};
|
|
3497
|
+
}
|
|
3498
|
+
function resolveAliasError(params) {
|
|
3499
|
+
const trimmed = params.raw.trim();
|
|
3500
|
+
if (!trimmed) return;
|
|
3501
|
+
let normalized;
|
|
3502
|
+
try {
|
|
3503
|
+
normalized = normalizeAlias(trimmed);
|
|
3504
|
+
} catch (err) {
|
|
3505
|
+
return err instanceof Error ? err.message : "Alias is invalid.";
|
|
3506
|
+
}
|
|
3507
|
+
const aliasIndex = buildModelAliasIndex({
|
|
3508
|
+
cfg: params.cfg,
|
|
3509
|
+
defaultProvider: DEFAULT_PROVIDER
|
|
3510
|
+
});
|
|
3511
|
+
const aliasKey = normalized.toLowerCase();
|
|
3512
|
+
const existing = aliasIndex.byAlias.get(aliasKey);
|
|
3513
|
+
if (!existing) return;
|
|
3514
|
+
const existingKey = modelKey(existing.ref.provider, existing.ref.model);
|
|
3515
|
+
if (existingKey === params.modelRef) return;
|
|
3516
|
+
return `Alias ${normalized} already points to ${existingKey}.`;
|
|
3517
|
+
}
|
|
3518
|
+
function buildOpenAiHeaders(apiKey) {
|
|
3519
|
+
const headers = {};
|
|
3520
|
+
if (apiKey) headers.Authorization = `Bearer ${apiKey}`;
|
|
3521
|
+
return headers;
|
|
3522
|
+
}
|
|
3523
|
+
function buildAnthropicHeaders(apiKey) {
|
|
3524
|
+
const headers = { "anthropic-version": "2023-06-01" };
|
|
3525
|
+
if (apiKey) headers["x-api-key"] = apiKey;
|
|
3526
|
+
return headers;
|
|
3527
|
+
}
|
|
3528
|
+
function formatVerificationError(error) {
|
|
3529
|
+
if (!error) return "unknown error";
|
|
3530
|
+
if (error instanceof Error) return error.message;
|
|
3531
|
+
if (typeof error === "string") return error;
|
|
3532
|
+
try {
|
|
3533
|
+
return JSON.stringify(error);
|
|
3534
|
+
} catch {
|
|
3535
|
+
return "unknown error";
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
async function requestOpenAiVerification(params) {
|
|
3539
|
+
const endpoint = new URL("chat/completions", params.baseUrl.endsWith("/") ? params.baseUrl : `${params.baseUrl}/`).href;
|
|
3540
|
+
try {
|
|
3541
|
+
const res = await fetchWithTimeout(endpoint, {
|
|
3542
|
+
method: "POST",
|
|
3543
|
+
headers: {
|
|
3544
|
+
"Content-Type": "application/json",
|
|
3545
|
+
...buildOpenAiHeaders(params.apiKey)
|
|
3546
|
+
},
|
|
3547
|
+
body: JSON.stringify({
|
|
3548
|
+
model: params.modelId,
|
|
3549
|
+
messages: [{
|
|
3550
|
+
role: "user",
|
|
3551
|
+
content: "Hi"
|
|
3552
|
+
}],
|
|
3553
|
+
max_tokens: 5
|
|
3554
|
+
})
|
|
3555
|
+
}, VERIFY_TIMEOUT_MS);
|
|
3556
|
+
return {
|
|
3557
|
+
ok: res.ok,
|
|
3558
|
+
status: res.status
|
|
3559
|
+
};
|
|
3560
|
+
} catch (error) {
|
|
3561
|
+
return {
|
|
3562
|
+
ok: false,
|
|
3563
|
+
error
|
|
3564
|
+
};
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
async function requestAnthropicVerification(params) {
|
|
3568
|
+
const endpoint = new URL("messages", params.baseUrl.endsWith("/") ? params.baseUrl : `${params.baseUrl}/`).href;
|
|
3569
|
+
try {
|
|
3570
|
+
const res = await fetchWithTimeout(endpoint, {
|
|
3571
|
+
method: "POST",
|
|
3572
|
+
headers: {
|
|
3573
|
+
"Content-Type": "application/json",
|
|
3574
|
+
...buildAnthropicHeaders(params.apiKey)
|
|
3575
|
+
},
|
|
3576
|
+
body: JSON.stringify({
|
|
3577
|
+
model: params.modelId,
|
|
3578
|
+
max_tokens: 16,
|
|
3579
|
+
messages: [{
|
|
3580
|
+
role: "user",
|
|
3581
|
+
content: "Hi"
|
|
3582
|
+
}]
|
|
3583
|
+
})
|
|
3584
|
+
}, VERIFY_TIMEOUT_MS);
|
|
3585
|
+
return {
|
|
3586
|
+
ok: res.ok,
|
|
3587
|
+
status: res.status
|
|
3588
|
+
};
|
|
3589
|
+
} catch (error) {
|
|
3590
|
+
return {
|
|
3591
|
+
ok: false,
|
|
3592
|
+
error
|
|
3593
|
+
};
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
async function promptBaseUrlAndKey(params) {
|
|
3597
|
+
const baseUrlInput = await params.prompter.text({
|
|
3598
|
+
message: "API Base URL",
|
|
3599
|
+
initialValue: params.initialBaseUrl ?? DEFAULT_OLLAMA_BASE_URL,
|
|
3600
|
+
placeholder: "https://api.example.com/v1",
|
|
3601
|
+
validate: (val) => {
|
|
3602
|
+
try {
|
|
3603
|
+
new URL(val);
|
|
3604
|
+
return;
|
|
3605
|
+
} catch {
|
|
3606
|
+
return "Please enter a valid URL (e.g. http://...)";
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
3609
|
+
});
|
|
3610
|
+
const apiKeyInput = await params.prompter.text({
|
|
3611
|
+
message: "API Key (leave blank if not required)",
|
|
3612
|
+
placeholder: "sk-...",
|
|
3613
|
+
initialValue: ""
|
|
3614
|
+
});
|
|
3615
|
+
return {
|
|
3616
|
+
baseUrl: baseUrlInput.trim(),
|
|
3617
|
+
apiKey: apiKeyInput.trim()
|
|
3618
|
+
};
|
|
3619
|
+
}
|
|
3620
|
+
function resolveProviderApi(compatibility) {
|
|
3621
|
+
return compatibility === "anthropic" ? "anthropic-messages" : "openai-completions";
|
|
3622
|
+
}
|
|
3623
|
+
function parseCustomApiCompatibility(raw) {
|
|
3624
|
+
const compatibilityRaw = raw?.trim().toLowerCase();
|
|
3625
|
+
if (!compatibilityRaw) return "openai";
|
|
3626
|
+
if (compatibilityRaw !== "openai" && compatibilityRaw !== "anthropic") throw new CustomApiError("invalid_compatibility", "Invalid --custom-compatibility (use \"openai\" or \"anthropic\").");
|
|
3627
|
+
return compatibilityRaw;
|
|
3628
|
+
}
|
|
3629
|
+
function resolveCustomProviderId(params) {
|
|
3630
|
+
const providers = params.config.models?.providers ?? {};
|
|
3631
|
+
const baseUrl = params.baseUrl.trim();
|
|
3632
|
+
const explicitProviderId = params.providerId?.trim();
|
|
3633
|
+
if (explicitProviderId && !normalizeEndpointId(explicitProviderId)) throw new CustomApiError("invalid_provider_id", "Custom provider ID must include letters, numbers, or hyphens.");
|
|
3634
|
+
const requestedProviderId = explicitProviderId || buildEndpointIdFromUrl(baseUrl);
|
|
3635
|
+
const providerIdResult = resolveUniqueEndpointId({
|
|
3636
|
+
requestedId: requestedProviderId,
|
|
3637
|
+
baseUrl,
|
|
3638
|
+
providers
|
|
3639
|
+
});
|
|
3640
|
+
return {
|
|
3641
|
+
providerId: providerIdResult.providerId,
|
|
3642
|
+
...providerIdResult.renamed ? { providerIdRenamedFrom: normalizeEndpointId(requestedProviderId) || "custom" } : {}
|
|
3643
|
+
};
|
|
3644
|
+
}
|
|
3645
|
+
function parseNonInteractiveCustomApiFlags(params) {
|
|
3646
|
+
const baseUrl = params.baseUrl?.trim() ?? "";
|
|
3647
|
+
const modelId = params.modelId?.trim() ?? "";
|
|
3648
|
+
if (!baseUrl || !modelId) throw new CustomApiError("missing_required", ["Auth choice \"custom-api-key\" requires a base URL and model ID.", "Use --custom-base-url and --custom-model-id."].join("\n"));
|
|
3649
|
+
const apiKey = params.apiKey?.trim();
|
|
3650
|
+
const providerId = params.providerId?.trim();
|
|
3651
|
+
if (providerId && !normalizeEndpointId(providerId)) throw new CustomApiError("invalid_provider_id", "Custom provider ID must include letters, numbers, or hyphens.");
|
|
3652
|
+
return {
|
|
3653
|
+
baseUrl,
|
|
3654
|
+
modelId,
|
|
3655
|
+
compatibility: parseCustomApiCompatibility(params.compatibility),
|
|
3656
|
+
...apiKey ? { apiKey } : {},
|
|
3657
|
+
...providerId ? { providerId } : {}
|
|
3658
|
+
};
|
|
3659
|
+
}
|
|
3660
|
+
function applyCustomApiConfig(params) {
|
|
3661
|
+
const baseUrl = params.baseUrl.trim();
|
|
3662
|
+
try {
|
|
3663
|
+
new URL(baseUrl);
|
|
3664
|
+
} catch {
|
|
3665
|
+
throw new CustomApiError("invalid_base_url", "Custom provider base URL must be a valid URL.");
|
|
3666
|
+
}
|
|
3667
|
+
if (params.compatibility !== "openai" && params.compatibility !== "anthropic") throw new CustomApiError("invalid_compatibility", "Custom provider compatibility must be \"openai\" or \"anthropic\".");
|
|
3668
|
+
const modelId = params.modelId.trim();
|
|
3669
|
+
if (!modelId) throw new CustomApiError("invalid_model_id", "Custom provider model ID is required.");
|
|
3670
|
+
const providerIdResult = resolveCustomProviderId({
|
|
3671
|
+
config: params.config,
|
|
3672
|
+
baseUrl,
|
|
3673
|
+
providerId: params.providerId
|
|
3674
|
+
});
|
|
3675
|
+
const providerId = providerIdResult.providerId;
|
|
3676
|
+
const providers = params.config.models?.providers ?? {};
|
|
3677
|
+
const modelRef = modelKey(providerId, modelId);
|
|
3678
|
+
const alias = params.alias?.trim() ?? "";
|
|
3679
|
+
const aliasError = resolveAliasError({
|
|
3680
|
+
raw: alias,
|
|
3681
|
+
cfg: params.config,
|
|
3682
|
+
modelRef
|
|
3683
|
+
});
|
|
3684
|
+
if (aliasError) throw new CustomApiError("invalid_alias", aliasError);
|
|
3685
|
+
const existingProvider = providers[providerId];
|
|
3686
|
+
const existingModels = Array.isArray(existingProvider?.models) ? existingProvider.models : [];
|
|
3687
|
+
const hasModel = existingModels.some((model) => model.id === modelId);
|
|
3688
|
+
const nextModel = {
|
|
3689
|
+
id: modelId,
|
|
3690
|
+
name: `${modelId} (Custom Provider)`,
|
|
3691
|
+
contextWindow: DEFAULT_CONTEXT_WINDOW,
|
|
3692
|
+
maxTokens: DEFAULT_MAX_TOKENS,
|
|
3693
|
+
input: ["text"],
|
|
3694
|
+
cost: {
|
|
3695
|
+
input: 0,
|
|
3696
|
+
output: 0,
|
|
3697
|
+
cacheRead: 0,
|
|
3698
|
+
cacheWrite: 0
|
|
3699
|
+
},
|
|
3700
|
+
reasoning: false
|
|
3701
|
+
};
|
|
3702
|
+
const mergedModels = hasModel ? existingModels : [...existingModels, nextModel];
|
|
3703
|
+
const { apiKey: existingApiKey, ...existingProviderRest } = existingProvider ?? {};
|
|
3704
|
+
const normalizedApiKey = params.apiKey?.trim() || (existingApiKey ? existingApiKey.trim() : void 0);
|
|
3705
|
+
let config = {
|
|
3706
|
+
...params.config,
|
|
3707
|
+
models: {
|
|
3708
|
+
...params.config.models,
|
|
3709
|
+
mode: params.config.models?.mode ?? "merge",
|
|
3710
|
+
providers: {
|
|
3711
|
+
...providers,
|
|
3712
|
+
[providerId]: {
|
|
3713
|
+
...existingProviderRest,
|
|
3714
|
+
baseUrl,
|
|
3715
|
+
api: resolveProviderApi(params.compatibility),
|
|
3716
|
+
...normalizedApiKey ? { apiKey: normalizedApiKey } : {},
|
|
3717
|
+
models: mergedModels.length > 0 ? mergedModels : [nextModel]
|
|
3718
|
+
}
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
};
|
|
3722
|
+
config = applyPrimaryModel(config, modelRef);
|
|
3723
|
+
if (alias) config = {
|
|
3724
|
+
...config,
|
|
3725
|
+
agents: {
|
|
3726
|
+
...config.agents,
|
|
3727
|
+
defaults: {
|
|
3728
|
+
...config.agents?.defaults,
|
|
3729
|
+
models: {
|
|
3730
|
+
...config.agents?.defaults?.models,
|
|
3731
|
+
[modelRef]: {
|
|
3732
|
+
...config.agents?.defaults?.models?.[modelRef],
|
|
3733
|
+
alias
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
};
|
|
3739
|
+
return {
|
|
3740
|
+
config,
|
|
3741
|
+
providerId,
|
|
3742
|
+
modelId,
|
|
3743
|
+
...providerIdResult.providerIdRenamedFrom ? { providerIdRenamedFrom: providerIdResult.providerIdRenamedFrom } : {}
|
|
3744
|
+
};
|
|
3745
|
+
}
|
|
3746
|
+
async function promptCustomApiConfig(params) {
|
|
3747
|
+
const { prompter, runtime, config } = params;
|
|
3748
|
+
const baseInput = await promptBaseUrlAndKey({ prompter });
|
|
3749
|
+
let baseUrl = baseInput.baseUrl;
|
|
3750
|
+
let apiKey = baseInput.apiKey;
|
|
3751
|
+
const compatibilityChoice = await prompter.select({
|
|
3752
|
+
message: "Endpoint compatibility",
|
|
3753
|
+
options: COMPATIBILITY_OPTIONS.map((option) => ({
|
|
3754
|
+
value: option.value,
|
|
3755
|
+
label: option.label,
|
|
3756
|
+
hint: option.hint
|
|
3757
|
+
}))
|
|
3758
|
+
});
|
|
3759
|
+
let modelId = (await prompter.text({
|
|
3760
|
+
message: "Model ID",
|
|
3761
|
+
placeholder: "e.g. llama3, claude-3-7-sonnet",
|
|
3762
|
+
validate: (val) => val.trim() ? void 0 : "Model ID is required"
|
|
3763
|
+
})).trim();
|
|
3764
|
+
let compatibility = compatibilityChoice === "unknown" ? null : compatibilityChoice;
|
|
3765
|
+
while (true) {
|
|
3766
|
+
let verifiedFromProbe = false;
|
|
3767
|
+
if (!compatibility) {
|
|
3768
|
+
const probeSpinner = prompter.progress("Detecting endpoint type...");
|
|
3769
|
+
if ((await requestOpenAiVerification({
|
|
3770
|
+
baseUrl,
|
|
3771
|
+
apiKey,
|
|
3772
|
+
modelId
|
|
3773
|
+
})).ok) {
|
|
3774
|
+
probeSpinner.stop("Detected OpenAI-compatible endpoint.");
|
|
3775
|
+
compatibility = "openai";
|
|
3776
|
+
verifiedFromProbe = true;
|
|
3777
|
+
} else if ((await requestAnthropicVerification({
|
|
3778
|
+
baseUrl,
|
|
3779
|
+
apiKey,
|
|
3780
|
+
modelId
|
|
3781
|
+
})).ok) {
|
|
3782
|
+
probeSpinner.stop("Detected Anthropic-compatible endpoint.");
|
|
3783
|
+
compatibility = "anthropic";
|
|
3784
|
+
verifiedFromProbe = true;
|
|
3785
|
+
} else {
|
|
3786
|
+
probeSpinner.stop("Could not detect endpoint type.");
|
|
3787
|
+
await prompter.note("This endpoint did not respond to OpenAI or Anthropic style requests.", "Endpoint detection");
|
|
3788
|
+
const retryChoice = await prompter.select({
|
|
3789
|
+
message: "What would you like to change?",
|
|
3790
|
+
options: [
|
|
3791
|
+
{
|
|
3792
|
+
value: "baseUrl",
|
|
3793
|
+
label: "Change base URL"
|
|
3794
|
+
},
|
|
3795
|
+
{
|
|
3796
|
+
value: "model",
|
|
3797
|
+
label: "Change model"
|
|
3798
|
+
},
|
|
3799
|
+
{
|
|
3800
|
+
value: "both",
|
|
3801
|
+
label: "Change base URL and model"
|
|
3802
|
+
}
|
|
3803
|
+
]
|
|
3804
|
+
});
|
|
3805
|
+
if (retryChoice === "baseUrl" || retryChoice === "both") {
|
|
3806
|
+
const retryInput = await promptBaseUrlAndKey({
|
|
3807
|
+
prompter,
|
|
3808
|
+
initialBaseUrl: baseUrl
|
|
3809
|
+
});
|
|
3810
|
+
baseUrl = retryInput.baseUrl;
|
|
3811
|
+
apiKey = retryInput.apiKey;
|
|
3812
|
+
}
|
|
3813
|
+
if (retryChoice === "model" || retryChoice === "both") modelId = (await prompter.text({
|
|
3814
|
+
message: "Model ID",
|
|
3815
|
+
placeholder: "e.g. llama3, claude-3-7-sonnet",
|
|
3816
|
+
validate: (val) => val.trim() ? void 0 : "Model ID is required"
|
|
3817
|
+
})).trim();
|
|
3818
|
+
continue;
|
|
3819
|
+
}
|
|
3820
|
+
}
|
|
3821
|
+
if (verifiedFromProbe) break;
|
|
3822
|
+
const verifySpinner = prompter.progress("Verifying...");
|
|
3823
|
+
const result = compatibility === "anthropic" ? await requestAnthropicVerification({
|
|
3824
|
+
baseUrl,
|
|
3825
|
+
apiKey,
|
|
3826
|
+
modelId
|
|
3827
|
+
}) : await requestOpenAiVerification({
|
|
3828
|
+
baseUrl,
|
|
3829
|
+
apiKey,
|
|
3830
|
+
modelId
|
|
3831
|
+
});
|
|
3832
|
+
if (result.ok) {
|
|
3833
|
+
verifySpinner.stop("Verification successful.");
|
|
3834
|
+
break;
|
|
3835
|
+
}
|
|
3836
|
+
if (result.status !== void 0) verifySpinner.stop(`Verification failed: status ${result.status}`);
|
|
3837
|
+
else verifySpinner.stop(`Verification failed: ${formatVerificationError(result.error)}`);
|
|
3838
|
+
const retryChoice = await prompter.select({
|
|
3839
|
+
message: "What would you like to change?",
|
|
3840
|
+
options: [
|
|
3841
|
+
{
|
|
3842
|
+
value: "baseUrl",
|
|
3843
|
+
label: "Change base URL"
|
|
3844
|
+
},
|
|
3845
|
+
{
|
|
3846
|
+
value: "model",
|
|
3847
|
+
label: "Change model"
|
|
3848
|
+
},
|
|
3849
|
+
{
|
|
3850
|
+
value: "both",
|
|
3851
|
+
label: "Change base URL and model"
|
|
3852
|
+
}
|
|
3853
|
+
]
|
|
3854
|
+
});
|
|
3855
|
+
if (retryChoice === "baseUrl" || retryChoice === "both") {
|
|
3856
|
+
const retryInput = await promptBaseUrlAndKey({
|
|
3857
|
+
prompter,
|
|
3858
|
+
initialBaseUrl: baseUrl
|
|
3859
|
+
});
|
|
3860
|
+
baseUrl = retryInput.baseUrl;
|
|
3861
|
+
apiKey = retryInput.apiKey;
|
|
3862
|
+
}
|
|
3863
|
+
if (retryChoice === "model" || retryChoice === "both") modelId = (await prompter.text({
|
|
3864
|
+
message: "Model ID",
|
|
3865
|
+
placeholder: "e.g. llama3, claude-3-7-sonnet",
|
|
3866
|
+
validate: (val) => val.trim() ? void 0 : "Model ID is required"
|
|
3867
|
+
})).trim();
|
|
3868
|
+
if (compatibilityChoice === "unknown") compatibility = null;
|
|
3869
|
+
}
|
|
3870
|
+
const providers = config.models?.providers ?? {};
|
|
3871
|
+
const suggestedId = buildEndpointIdFromUrl(baseUrl);
|
|
3872
|
+
const providerIdInput = await prompter.text({
|
|
3873
|
+
message: "Endpoint ID",
|
|
3874
|
+
initialValue: suggestedId,
|
|
3875
|
+
placeholder: "custom",
|
|
3876
|
+
validate: (value) => {
|
|
3877
|
+
if (!normalizeEndpointId(value)) return "Endpoint ID is required.";
|
|
3878
|
+
}
|
|
3879
|
+
});
|
|
3880
|
+
const aliasInput = await prompter.text({
|
|
3881
|
+
message: "Model alias (optional)",
|
|
3882
|
+
placeholder: "e.g. local, ollama",
|
|
3883
|
+
initialValue: "",
|
|
3884
|
+
validate: (value) => {
|
|
3885
|
+
return resolveAliasError({
|
|
3886
|
+
raw: value,
|
|
3887
|
+
cfg: config,
|
|
3888
|
+
modelRef: modelKey(resolveUniqueEndpointId({
|
|
3889
|
+
requestedId: normalizeEndpointId(providerIdInput) || "custom",
|
|
3890
|
+
baseUrl,
|
|
3891
|
+
providers
|
|
3892
|
+
}).providerId, modelId)
|
|
3893
|
+
});
|
|
3894
|
+
}
|
|
3895
|
+
});
|
|
3896
|
+
const result = applyCustomApiConfig({
|
|
3897
|
+
config,
|
|
3898
|
+
baseUrl,
|
|
3899
|
+
modelId,
|
|
3900
|
+
compatibility: compatibility ?? "openai",
|
|
3901
|
+
apiKey,
|
|
3902
|
+
providerId: providerIdInput,
|
|
3903
|
+
alias: aliasInput
|
|
3904
|
+
});
|
|
3905
|
+
if (result.providerIdRenamedFrom && result.providerId) await prompter.note(`Endpoint ID "${result.providerIdRenamedFrom}" already exists for a different base URL. Using "${result.providerId}".`, "Endpoint ID");
|
|
3906
|
+
runtime.log(`Configured custom provider: ${result.providerId}/${result.modelId}`);
|
|
3907
|
+
return result;
|
|
3908
|
+
}
|
|
3909
|
+
|
|
2883
3910
|
//#endregion
|
|
2884
3911
|
//#region src/commands/onboard-remote.ts
|
|
2885
3912
|
const DEFAULT_GATEWAY_URL = "ws://127.0.0.1:18789";
|
|
@@ -3050,24 +4077,28 @@ function buildNodeInstallCommand(packageName, prefs) {
|
|
|
3050
4077
|
"pnpm",
|
|
3051
4078
|
"add",
|
|
3052
4079
|
"-g",
|
|
4080
|
+
"--ignore-scripts",
|
|
3053
4081
|
packageName
|
|
3054
4082
|
];
|
|
3055
4083
|
case "yarn": return [
|
|
3056
4084
|
"yarn",
|
|
3057
4085
|
"global",
|
|
3058
4086
|
"add",
|
|
4087
|
+
"--ignore-scripts",
|
|
3059
4088
|
packageName
|
|
3060
4089
|
];
|
|
3061
4090
|
case "bun": return [
|
|
3062
4091
|
"bun",
|
|
3063
4092
|
"add",
|
|
3064
4093
|
"-g",
|
|
4094
|
+
"--ignore-scripts",
|
|
3065
4095
|
packageName
|
|
3066
4096
|
];
|
|
3067
4097
|
default: return [
|
|
3068
4098
|
"npm",
|
|
3069
4099
|
"install",
|
|
3070
4100
|
"-g",
|
|
4101
|
+
"--ignore-scripts",
|
|
3071
4102
|
packageName
|
|
3072
4103
|
];
|
|
3073
4104
|
}
|
|
@@ -3512,4 +4543,4 @@ async function setupSkills(cfg, workspaceDir, runtime, prompter) {
|
|
|
3512
4543
|
}
|
|
3513
4544
|
|
|
3514
4545
|
//#endregion
|
|
3515
|
-
export {
|
|
4546
|
+
export { discoverGatewayBeacons as S, applyOpenAIConfig as _, applyCustomApiConfig as a, applyGoogleGeminiModelDefault as b, resolveCustomProviderId as c, applyPrimaryModel as d, promptDefaultModel as f, applyAuthChoice as g, warnIfModelConfigLooksOff as h, CustomApiError as i, applyModelAllowlist as l, resolvePreferredProviderForAuthChoice as m, installSkill as n, parseNonInteractiveCustomApiFlags as o, promptModelAllowlist as p, promptRemoteGatewayConfig as r, promptCustomApiConfig as s, setupSkills as t, applyModelFallbacksFromSelection as u, upsertSharedEnvVar as v, promptAuthChoiceGrouped as x, detectZaiEndpoint as y };
|