@hanzo/bot 2026.3.7 → 2026.3.8
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/dist/{accounts-D-CXitCL.js → accounts-BVV0eCmx.js} +2 -2
- package/dist/{accounts-Da-TWEIc.js → accounts-C04lw_uh.js} +4 -4
- package/dist/{accounts-DRUpcCkN.js → accounts-CtzU1wJb.js} +2 -2
- package/dist/{acp-cli-DYkqqqaJ.js → acp-cli-CDUVvPjD.js} +28 -24
- package/dist/{active-listener-DlziGqIg.js → active-listener-NprMzFx6.js} +2 -2
- package/dist/{agent-scope-C5bklqr1.js → agent-scope-BcruZHHR.js} +5 -5
- package/dist/{agents-CH9da9zi.js → agents-D8rH1P3g.js} +20 -19
- package/dist/{agents.config-BQ8I8wuY.js → agents.config-OuZqDEe6.js} +4 -4
- package/dist/{api-0IJLBHQk.js → api-Bgrt1pfd.js} +1 -1
- package/dist/{api-key-rotation-DuxfwUin.js → api-key-rotation-C0toONXd.js} +2 -2
- package/dist/{audio-preflight-CpAXC_Ct.js → audio-preflight-BEc8i-bS.js} +4 -4
- package/dist/{audio-preflight-BnfuyvxO.js → audio-preflight-D_s-peid.js} +4 -4
- package/dist/audio-preflight-d9iZknwY.js +102 -0
- package/dist/{audio-transcription-runner-GcMnO6sT.js → audio-transcription-runner-BePCnZfw.js} +1 -1
- package/dist/{audio-transcription-runner-CAOjjGxN.js → audio-transcription-runner-X1KzI7dF.js} +1 -1
- package/dist/{audio-transcription-runner-DCsEpXgz.js → audio-transcription-runner-bvBQs8UB.js} +13 -13
- package/dist/{audit-DCJbont3.js → audit-BWNRwu8g.js} +28 -28
- package/dist/{audit-membership-runtime-BIZ4bigJ.js → audit-membership-runtime-Bki8LzkA.js} +7 -6
- package/dist/{auth-CqlFkBrB.js → auth-CWHo884l.js} +5 -5
- package/dist/{auth-choice-9obtL17m.js → auth-choice-DUtpqOiw.js} +25 -22
- package/dist/{auth-choice-w2mL3d_M.js → auth-choice-n72qSpix.js} +15 -14
- package/dist/{auth-choice-options-DMoNPDm6.js → auth-choice-options-D13GahL8.js} +1 -1
- package/dist/{auth-choice-prompt-Btp8AqFI.js → auth-choice-prompt-8z7z_AUr.js} +1 -1
- package/dist/{auth-choice.apply-helpers-JU7nAiWC.js → auth-choice.apply-helpers-DMhFdoYH.js} +3 -3
- package/dist/{auth-mode-policy-slU2Nkgr.js → auth-mode-policy-BopOhrK8.js} +1 -1
- package/dist/{auth-profiles-BCHBDrea.js → auth-profiles-BtxyXCZY.js} +48 -925
- package/dist/{auth-token-BfzDARSk.js → auth-token-zcumGtdt.js} +3 -3
- package/dist/{banner-C4sx0Vaf.js → banner-C1G_GtAz.js} +3 -3
- package/dist/{bonjour-discovery-CzNIGZ7K.js → bonjour-discovery-C1SH2QqR.js} +3 -3
- package/dist/{browser-cli-qPNZkfDX.js → browser-cli-Bd81bwqM.js} +36 -32
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +6 -6
- package/dist/bundled/session-memory/handler.js +6 -6
- package/dist/{call-C4z2LJrI.js → call-DL23sPxF.js} +9 -8
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-account-context-DyLW8OD1.js → channel-account-context-DGbGZhGz.js} +3 -3
- package/dist/{channel-activity-Bch3Rz78.js → channel-activity-DItBzFyQ.js} +3 -3
- package/dist/{channel-options-ChtPFPQx.js → channel-options-DU65sVdF.js} +4 -4
- package/dist/{channel-selection-CXz2aSCs.js → channel-selection-BnXQH0vV.js} +2 -2
- package/dist/{channel-web-Bok0lFvq.js → channel-web-BbWnfun7.js} +25 -24
- package/dist/{channels-cli-B5oDUpEB.js → channels-cli-B8LCe0vu.js} +142 -135
- package/dist/{channels-status-issues-BAy-21Cb.js → channels-status-issues-DXNaEL8i.js} +1 -1
- package/dist/{chrome--CFg5C_H.js → chrome-B24-8NDM.js} +8 -8
- package/dist/{chrome-jCt9JCU8.js → chrome-C7OwLtx9.js} +8 -8
- package/dist/{chrome-TWq_09_a.js → chrome-D4EfbMKb.js} +7 -7
- package/dist/{clack-prompter-0Rux0QKP.js → clack-prompter-CNKAp_jq.js} +5 -5
- package/dist/clawbot-cli-Bv8oZgvA.js +36 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-DXbYdTNH.js +162 -0
- package/dist/{client-DWdu7Vc_.js → client-Bvvecv3V.js} +25 -142
- package/dist/{clipboard-Bfhk9cp3.js → clipboard-DwO9zZBK.js} +1 -1
- package/dist/{cloud-connect-BERMG0cQ.js → cloud-connect-CknfBF39.js} +89 -52
- package/dist/cloud-launch-7mm4ZKXy.js +172 -0
- package/dist/{command-poll-backoff.runtime-COz7plyi.js → command-poll-backoff.runtime-ClRAZFDL.js} +1 -1
- package/dist/{command-registry-DTMuq-Fw.js → command-registry-CTaJSsqV.js} +11 -11
- package/dist/{command-secret-targets-B2OuvZQf.js → command-secret-targets-C382v6Qd.js} +6 -6
- package/dist/{commands-BAjCW6P6.js → commands-BoGUirwW.js} +2 -2
- package/dist/{commands-registry-bwa5zMJ1.js → commands-registry-Dn_5_JYs.js} +6 -6
- package/dist/{compact-CenE94cW.js → compact-CuLMew-8.js} +141 -910
- package/dist/{completion-cli-spiS5-xU.js → completion-cli-CixfDHo4.js} +6 -6
- package/dist/{config-cli-w-RlQ3jB.js → config-cli-Bu2Eakz-.js} +22 -19
- package/dist/{config-guard-rlTIXCSD.js → config-guard-Bt2BdsMd.js} +5 -5
- package/dist/{config-validation-B3rr-h3d.js → config-validation-WdHwRX05.js} +6 -6
- package/dist/{configure-YxPFskRy.js → configure-ClIJiVqS.js} +32 -31
- package/dist/{control-ui-assets-CvLJNwEr.js → control-ui-assets-Co9rmXkB.js} +3 -3
- package/dist/{credentials-DVX7Krq5.js → credentials-SIFZMlmo.js} +1 -1
- package/dist/{cron-cli-DI9DN0vu.js → cron-cli-DR13ajr7.js} +32 -28
- package/dist/{daemon-cli-OBRBnIhu.js → daemon-cli-C6ZVajFI.js} +28 -28
- package/dist/{daemon-install-CGk2QyeB.js → daemon-install-DsDcMh2v.js} +43 -39
- package/dist/{daemon-install-helpers-C1QLEGFF.js → daemon-install-helpers-BtOiCRD1.js} +7 -35
- package/dist/{deliver-DPkEY6xb.js → deliver-Bge0HwrF.js} +13 -13
- package/dist/{deliver-BVtVDxwX.js → deliver-D8dBbzpu.js} +1 -1
- package/dist/{deliver-DmfS4khs.js → deliver-DudaV86i.js} +1 -1
- package/dist/{deliver-runtime-G0G5orrZ.js → deliver-runtime-C76IMU4W.js} +3 -3
- package/dist/{deliver-runtime-PxJvVUhh.js → deliver-runtime-qDmQqiF-.js} +3 -3
- package/dist/deliver-runtime-s0eLCemL.js +63 -0
- package/dist/{delivery-queue-DgdE_Ifa.js → delivery-queue-BVKd_xSI.js} +1 -1
- package/dist/deps-send-discord.runtime-C8HKp3uO.js +37 -0
- package/dist/deps-send-imessage.runtime-ECy162Cs.js +36 -0
- package/dist/deps-send-signal.runtime-XbioSg-_.js +35 -0
- package/dist/deps-send-slack.runtime-BM7Vp8vX.js +33 -0
- package/dist/deps-send-telegram.runtime-IFD4dAk7.js +39 -0
- package/dist/deps-send-whatsapp.runtime-BHuShWkA.js +124 -0
- package/dist/{deps-send-whatsapp.runtime-CrzuaVhC.js → deps-send-whatsapp.runtime-Cq-TLsJw.js} +7 -7
- package/dist/{deps-send-whatsapp.runtime-8bLqjmui.js → deps-send-whatsapp.runtime-Cv_awFtm.js} +7 -7
- package/dist/device-identity-DtdLP7QQ.js +148 -0
- package/dist/{devices-cli-C7xKmiR9.js → devices-cli-DZRtpqol.js} +25 -21
- package/dist/{diagnostic-DCevSIi3.js → diagnostic-CXxZq_XY.js} +3 -3
- package/dist/{diagnostics-vhe8iPOe.js → diagnostics-GQuagqCt.js} +1 -1
- package/dist/{directory-cli-BrLvL2oD.js → directory-cli-Tqim_rB9.js} +24 -21
- package/dist/{dns-cli-Dcytc0em.js → dns-cli-AcAZnW-T.js} +19 -16
- package/dist/{dock-D1Nz-RwP.js → dock-nMBfeGKa.js} +7 -7
- package/dist/{docs-cli-CjnLrTzs.js → docs-cli-C6mNYtxD.js} +17 -16
- package/dist/{doctor-completion-BKaFgAAN.js → doctor-completion-Dg6AJY6Q.js} +4 -4
- package/dist/{doctor-config-flow-Bp3eehAS.js → doctor-config-flow-CKY6Mr3X.js} +19 -19
- package/dist/{enable-pUSco1cm.js → enable-BWraNcrd.js} +2 -2
- package/dist/entry.js +6 -5
- package/dist/{errors-Dh5KARaE.js → errors-ClLWB67m.js} +1 -1
- package/dist/{exec-B45rafWZ.js → exec-B8Hv4Nkd.js} +1 -1
- package/dist/{exec-approvals-B5leCM6K.js → exec-approvals-Bh1osORd.js} +1 -1
- package/dist/{exec-approvals-allowlist-CSlk-iUy.js → exec-approvals-allowlist-dlIMsRq0.js} +1 -1
- package/dist/{exec-approvals-cli-B722kWhJ.js → exec-approvals-cli-B2V935Or.js} +33 -29
- package/dist/{exec-safe-bin-runtime-policy-C4OXhXIe.js → exec-safe-bin-runtime-policy-Ds-cMyOt.js} +2 -2
- package/dist/extensionAPI.js +6 -6
- package/dist/{fetch-COQIeEVX.js → fetch-BPh3R9xH.js} +3 -3
- package/dist/{fetch-TlhZeXdg.js → fetch-DyJnPUwL.js} +1 -1
- package/dist/{fetch-guard-BiNciKHu.js → fetch-guard-hL-C2yQz.js} +3 -3
- package/dist/{frontmatter-BIwJR052.js → frontmatter-B0viix_h.js} +2 -2
- package/dist/{fs-safe-DtMJsayp.js → fs-safe-CFIinCN2.js} +3 -3
- package/dist/gateway-cli-DjWebqxe.js +1436 -0
- package/dist/{gateway-install-token-tifgQqTq.js → gateway-install-token-olAkdWwV.js} +6 -6
- package/dist/gateway-lock-DNpln_70.js +192 -0
- package/dist/{gateway-rpc--AYNXZQF.js → gateway-rpc-B37zbuoK.js} +3 -3
- package/dist/{github-copilot-token-Byc_YVYE.js → github-copilot-token-BKQ4nXAw.js} +2 -23
- package/dist/{gmail-setup-utils-B1wEc-nz.js → gmail-setup-utils-DuoBM8ed.js} +3 -3
- package/dist/{health-DTtmaQPz.js → health-Cs-k6kLT.js} +18 -16
- package/dist/{helpers-CIEbwEWl.js → helpers-DDBxLojl.js} +1 -1
- package/dist/{hooks-cli-DJDBpL-Z.js → hooks-cli-Zqdxhm6M.js} +123 -116
- package/dist/{hooks-status-CFT0VML6.js → hooks-status-DqCwY9M6.js} +4 -4
- package/dist/{image-DSK1hSSV.js → image-BOybyCis.js} +1 -1
- package/dist/{image-DFnt4Uwg.js → image-m1GU1uco.js} +7 -7
- package/dist/{image-BdZcUz8M.js → image-nUHQF6BX.js} +1 -1
- package/dist/{image-ops-DBPCaLYI.js → image-ops-Bnk-bI_x.js} +1 -1
- package/dist/{image-runtime-ueqmfx1a.js → image-runtime-B5M_-diF.js} +3 -3
- package/dist/image-runtime-CesErRak.js +57 -0
- package/dist/{image-runtime-xqxW2PQA.js → image-runtime-y4msd5bn.js} +3 -3
- package/dist/{inspect-BVm4U2OP.js → inspect-CMuOPXUf.js} +2 -2
- package/dist/{install-safe-path-Df97RWiJ.js → install-safe-path-BxdyoAni.js} +3 -3
- package/dist/{installs-BGMsioU1.js → installs-c4kWJSG4.js} +8 -8
- package/dist/ip-C7WWCRN7.js +204 -0
- package/dist/{ipv4-Difv_P0_.js → ipv4-DcjwXncJ.js} +2 -2
- package/dist/{ir-CaGizvli.js → ir-BjnGKA2N.js} +8 -8
- package/dist/{issue-format-DjqrcimU.js → issue-format-BMPYbT1P.js} +1 -1
- package/dist/json-file-CNp4GTiH.js +25 -0
- package/dist/{lifecycle-core-BXWGDU3R.js → lifecycle-core-fN_BonzB.js} +10 -10
- package/dist/{links-C7eMwu1P.js → links-DZZ9QxWA.js} +1 -1
- package/dist/llm-slug-generator.js +6 -6
- package/dist/local-launch-C2RER-G3.js +126 -0
- package/dist/{logger-DB-PHqB2.js → logger-DyQjakwH.js} +2 -1
- package/dist/{logging-CS4C9VwV.js → logging--bXnY6uw.js} +1 -1
- package/dist/{login-B8HwtO61.js → login-DTK-M8Is.js} +6 -6
- package/dist/{login-qr-amd1X6Dw.js → login-qr-CmnyPjTv.js} +29 -16
- package/dist/{logs-cli-BH8DNgo2.js → logs-cli-BSlzurlM.js} +27 -23
- package/dist/machine-name-BWZ0tBHk.js +41 -0
- package/dist/{manager-BYSXh-I3.js → manager-BVqjeGyT.js} +11 -11
- package/dist/manager-runtime-CBdUM6c8.js +27 -0
- package/dist/{manifest-registry-9oWnIuht.js → manifest-registry-m_hXBIk-.js} +4 -4
- package/dist/{memory-cli-C6ocXZHW.js → memory-cli-yvsbLFgi.js} +15 -14
- package/dist/{message-channel-7mpcAPwa.js → message-channel-DOpIvru6.js} +34 -2
- package/dist/{model-catalog-B3fDLVsV.js → model-catalog-DtjVcDuN.js} +11 -5
- package/dist/{model-picker-V0gt2kzq.js → model-picker-oa-NsQXX.js} +5 -4
- package/dist/{models-D9CovevI.js → models-Bi78FQeE.js} +26 -25
- package/dist/{models-cli-CQBq_lri.js → models-cli-DUkH_80R.js} +126 -119
- package/dist/{models-config-Tnpb1ctj.js → models-config-D_IvpQGa.js} +3 -2
- package/dist/{node-cli-Cy9sSHy5.js → node-cli-B1iGQlR9.js} +61 -54
- package/dist/{node-command-policy-C9mK2tft.js → node-command-policy-CeKPGmlP.js} +2 -2
- package/dist/node-commands-sMomb3e1.js +20 -0
- package/dist/{node-service-DB36GYv5.js → node-service-BLMp6VWJ.js} +2 -2
- package/dist/{nodes-cli-DEtlooE3.js → nodes-cli-CD9qv7k5.js} +39 -35
- package/dist/{nodes-screen-DmJ2G431.js → nodes-screen-X8daVm8e.js} +5 -5
- package/dist/{note-DI9vedAF.js → note-C3wyXRP2.js} +2 -2
- package/dist/{npm-pack-install-_OjtFm2J.js → npm-pack-install-B0X6q-Co.js} +3 -3
- package/dist/{npm-resolution-DzmQqopk.js → npm-resolution-CavQ2ST5.js} +5 -5
- package/dist/{oauth-env-DKoO0B8-.js → oauth-env-9SRuwpTK.js} +1 -1
- package/dist/{oauth-tls-preflight-Dzh0FiLy.js → oauth-tls-preflight-C_9v9ytQ.js} +2 -2
- package/dist/{onboard-B_1mmscr.js → onboard-Dgav6iT6.js} +17 -17
- package/dist/{onboard-auth.credentials-CtuA7DuT.js → onboard-auth.credentials-CMsut-0h.js} +4 -3
- package/dist/{onboard-channels-C1ZeD4r3.js → onboard-channels-oAN4ja4v.js} +26 -25
- package/dist/{onboard-custom-BU2l3aiF.js → onboard-custom-B3RIFmaw.js} +7 -7
- package/dist/{onboard-helpers-Dtu3-e93.js → onboard-helpers-BkwNJPNU.js} +12 -12
- package/dist/{onboard-hooks-w-a3FVVK.js → onboard-hooks-BRCGmt7Q.js} +12 -11
- package/dist/{onboard-remote-C-HD7hQU.js → onboard-remote-CE5v5J2R.js} +5 -5
- package/dist/{onboard-skills-DvgdlwqH.js → onboard-skills-DD5L2MsA.js} +5 -5
- package/dist/{onboarding-DozRyXTe.js → onboarding-gbgi-zx9.js} +23 -23
- package/dist/{onboarding.finalize-BfSNnhpS.js → onboarding.finalize-dk1j3ozb.js} +135 -128
- package/dist/{onboarding.gateway-config-C02W81hD.js → onboarding.gateway-config-DNQfWDVc.js} +39 -34
- package/dist/{onboarding.secret-input-BO32ZliB.js → onboarding.secret-input-BDId1_5K.js} +2 -2
- package/dist/{openai-codex-model-default-gJryyHmS.js → openai-codex-model-default-EWrFsdir.js} +5 -5
- package/dist/{openai-model-default-D2LuX7D-.js → openai-model-default-CcOzYsIQ.js} +3 -3
- package/dist/{outbound-CXQEMm6n.js → outbound-DCuHHD3G.js} +8 -8
- package/dist/{outbound-attachment-D7sOzAQn.js → outbound-attachment-Bm82Qbyl.js} +3 -3
- package/dist/{pairing-cli-BkbpM3Mt.js → pairing-cli-dXCvRk1U.js} +23 -20
- package/dist/{pairing-labels-CjKrz2C9.js → pairing-labels-B_3GjgjR.js} +1 -1
- package/dist/{pairing-store-nyK6CFoT.js → pairing-store-CXFEv3Gr.js} +5 -5
- package/dist/{pairing-token-Tb0YsOGr.js → pairing-token-BIAdQuAM.js} +1 -1
- package/dist/{path-alias-guards-CUaIvLOE.js → path-alias-guards-Bz8AnRb7.js} +1 -1
- package/dist/{path-env-LTMy-Xkk.js → path-env-CgmdxEc7.js} +1 -1
- package/dist/{path-safety-DwIbN_B2.js → path-safety-EkGa1GqP.js} +1 -1
- package/dist/{paths-Dr0uMr7v.js → paths-BBXgPm_n.js} +2 -2
- package/dist/{paths-0GcCtgXm.js → paths-gTdorMgW.js} +1 -1
- package/dist/{pi-embedded-DBn841N-.js → pi-embedded-BHXPs-Ix.js} +24 -24
- package/dist/{pi-embedded-DYc6emwb.js → pi-embedded-DvWHP6Nn.js} +24 -24
- package/dist/{pi-embedded-helpers-BMC2HFyB.js → pi-embedded-helpers-CCkKNz_h.js} +5 -5
- package/dist/{pi-embedded-helpers-DLm1Mtr2.js → pi-embedded-helpers-Ck1qEeMH.js} +3 -3
- package/dist/{pi-embedded-helpers-BtnBVL-4.js → pi-embedded-helpers-xIXwvwuE.js} +3 -3
- package/dist/{pi-model-discovery-BUP6uy2Q.js → pi-model-discovery-6_opNECD.js} +2 -1
- package/dist/pi-model-discovery-runtime-8K2F-Fkl.js +20 -0
- package/dist/{pi-tools.before-tool-call.runtime-r5_UoU-W.js → pi-tools.before-tool-call.runtime-BrFKAhWX.js} +16 -13
- package/dist/{pi-tools.policy-C_cbrlt5.js → pi-tools.policy-U1G3dAzL.js} +9 -9
- package/dist/{plugin-auto-enable-DdGdWKDo.js → plugin-auto-enable-3v7X3qMK.js} +6 -6
- package/dist/{plugin-registry-FdOZQF3c.js → plugin-registry-Brz1ypl9.js} +5 -5
- package/dist/{plugins-D3Wuignn.js → plugins-CCkC0dRo.js} +7 -6
- package/dist/{plugins-cli-CV4ilsn4.js → plugins-cli-DGfFRLeo.js} +123 -116
- package/dist/{ports-BZsa4E0e.js → ports-BG0KrTF5.js} +3 -2
- package/dist/{ports-B8DmvnDT.js → ports-BxwhTkI2.js} +5 -29
- package/dist/ports-lsof-C-KFQ3hh.js +27 -0
- package/dist/{probe-D23qt8BT.js → probe-AK77B0YW.js} +4 -4
- package/dist/{program-GusnXq4M.js → program-DfJJCEJW.js} +125 -118
- package/dist/{progress-DLHMb9Nz.js → progress-DB5E2Y0L.js} +1 -1
- package/dist/{prompt-select-styled-B8L90ha2.js → prompt-select-styled-Cm8h3ln5.js} +50 -49
- package/dist/{provider-auth-helpers-DCzPHYBh.js → provider-auth-helpers-BWFf-ICH.js} +9 -8
- package/dist/{proxy-env-CKBWNd19.js → proxy-env-a_fwG5uV.js} +1 -1
- package/dist/{proxy-fetch-CuomJeW8.js → proxy-fetch-B-9MM6tH.js} +1 -1
- package/dist/{push-apns-BNjpWCK5.js → push-apns-D7Kl5IlU.js} +6 -6
- package/dist/{pw-ai-DbzNFC8m.js → pw-ai-BuJLXHSR.js} +28 -24
- package/dist/{pw-ai-pJMhS79V.js → pw-ai-DsYmOxCp.js} +1 -1
- package/dist/{pw-ai-C-Sy12jT.js → pw-ai-DweqbnMJ.js} +1 -1
- package/dist/{qmd-manager-BuqPkrhL.js → qmd-manager-ChOTfdZQ.js} +14 -13
- package/dist/{qr-cli-DCqr6_WR.js → qr-cli-CNV3ou88.js} +8 -7
- package/dist/{redact-snapshot-COg8NLLO.js → redact-snapshot-DDgxiqE4.js} +3 -3
- package/dist/{register.agent-yjg7wijd.js → register.agent-B6lw56u_.js} +147 -140
- package/dist/register.configure-A26LOYA5.js +173 -0
- package/dist/{register.maintenance-B1tKJXP8.js → register.maintenance-Bv41DKCC.js} +144 -136
- package/dist/{register.message-BJm9UQ1U.js → register.message-BTZUaOa_.js} +119 -112
- package/dist/{register.onboard-Si5PW3Ke.js → register.onboard-Cla_XQtJ.js} +47 -43
- package/dist/{register.setup-Dgd21xa5.js → register.setup-BO3qmf_4.js} +46 -42
- package/dist/{register.status-health-sessions-DijNX4q2.js → register.status-health-sessions-DQxR8MS5.js} +134 -127
- package/dist/{register.subclis-RfmNwdNw.js → register.subclis-CasWzZR5.js} +32 -32
- package/dist/{registry-CxLUHPLp.js → registry-DnJ84ILp.js} +6 -83
- package/dist/{resolve-configured-secret-input-string-ySbc3h26.js → resolve-configured-secret-input-string-D9uWNIsN.js} +2 -2
- package/dist/restart-D97MOP8K.js +782 -0
- package/dist/{rpc-DaYUgLOy.js → rpc-DyZoASXQ.js} +4 -4
- package/dist/run-loop-Zvh_699t.js +224 -0
- package/dist/{run-main-t3x2kkjY.js → run-main-CgFUs81l.js} +148 -133
- package/dist/{runtime-BkR9qMZk.js → runtime-BBknab-X.js} +6 -5
- package/dist/runtime-CvdZtNmJ.js +100 -0
- package/dist/{runtime-config-collectors-CCkqshyY.js → runtime-config-collectors-CML7zUqZ.js} +2 -2
- package/dist/{runtime-guard-BMUPc-7K.js → runtime-guard-jpG1v0SY.js} +1 -1
- package/dist/runtime-whatsapp-login.runtime-COI7KRKp.js +23 -0
- package/dist/runtime-whatsapp-outbound.runtime-la1XDkPQ.js +33 -0
- package/dist/{sandbox-DN9CY7lp.js → sandbox-DKscghPx.js} +19 -18
- package/dist/{sandbox-cli-BoXV0LgP.js → sandbox-cli-CPwPZJBq.js} +52 -48
- package/dist/{secrets-cli-CyF7PIF1.js → secrets-cli-BY0IyBZM.js} +31 -26
- package/dist/{security-cli-Dyvx1GHA.js → security-cli-CG6OlQ29.js} +66 -61
- package/dist/{send-7T5wUQDt.js → send-BSbPEzn5.js} +7 -7
- package/dist/{send-Ge3BmrKO.js → send-C2xEPjDg.js} +8 -8
- package/dist/{send-DGbx1H-1.js → send-CFNNbHEA.js} +11 -11
- package/dist/{send-rLuC3ZNP.js → send-CIW-foVz.js} +7 -7
- package/dist/{send-CGAq-Ure.js → send-CZtdjq0Y.js} +20 -20
- package/dist/{gateway-cli-D7jJhAZQ.js → server-CG9eco0N.js} +122 -1835
- package/dist/{server-BM8Bplbe.js → server-DfSS2w17.js} +36 -32
- package/dist/{server-context-B1j20KiF.js → server-context-CcW_Z5sB.js} +15 -15
- package/dist/{server-lifecycle-D8uRbSiN.js → server-lifecycle-DWK8vMXD.js} +2 -2
- package/dist/{server-middleware-C0e-wReR.js → server-middleware-BtyTo4hI.js} +2 -2
- package/dist/{server-node-events-C876mSJD.js → server-node-events-Ck1bPPa5.js} +117 -110
- package/dist/{service-BJxGQl0h.js → service-DnXLOpYd.js} +2 -2
- package/dist/{session-1LXasKCO.js → session-Dnt2qKJU.js} +4 -4
- package/dist/{session-cost-usage-BKD6u4HD.js → session-cost-usage-CBHvFXhD.js} +3 -3
- package/dist/{session-utils-CigqosOc.js → session-utils-t4ZmEDMj.js} +9 -8
- package/dist/{sessions-Db2DF_68.js → sessions-BkKVGWHa.js} +13 -12
- package/dist/{sessions-CwRdJvxU.js → sessions-D6VEpJTN.js} +7 -7
- package/dist/{shared-DcKZdze7.js → shared-DKj9yygb.js} +4 -4
- package/dist/{skill-commands-BFUWbeCU.js → skill-commands-Dyi0nIIE.js} +8 -8
- package/dist/{skill-scanner-B5APVdka.js → skill-scanner-C6efDeWr.js} +2 -2
- package/dist/{skills-DjMDgmlj.js → skills-Cp-zTGor.js} +8 -8
- package/dist/{skills-cli-CvDeA9Mz.js → skills-cli-BcLVYbwo.js} +19 -16
- package/dist/{skills-install-jLz2vwvm.js → skills-install-LXdiRh5j.js} +10 -10
- package/dist/{skills-status-CeHRbTXe.js → skills-status-NIhVZfqm.js} +5 -5
- package/dist/slash-commands.runtime-Bq0XWi2w.js +28 -0
- package/dist/slash-dispatch.runtime-7RhcnuYY.js +119 -0
- package/dist/{slash-dispatch.runtime-DLP2IeNv.js → slash-dispatch.runtime-D28-UnsO.js} +6 -6
- package/dist/{slash-dispatch.runtime-Vp6IDoCc.js → slash-dispatch.runtime-DzpJjr3K.js} +6 -6
- package/dist/slash-skill-commands.runtime-HWFM7WtA.js +34 -0
- package/dist/{sqlite-C0jSdAfK.js → sqlite-BOrw_KhN.js} +4 -4
- package/dist/stable-node-path-BghYt81T.js +32 -0
- package/dist/{status-D3cIxG_a.js → status-DN8lRmcz.js} +40 -40
- package/dist/{status-pXeXDUup.js → status-DNPn0STZ.js} +1 -1
- package/dist/{status.update-DeJopD-c.js → status.update-Cd4sMxYz.js} +4 -4
- package/dist/store-D8F_4CRR.js +701 -0
- package/dist/{store-BgCLFtxS.js → store-DCoVH3mG.js} +2 -2
- package/dist/{subagent-registry-runtime-COKZwsHd.js → subagent-registry-runtime-Bt-LYyrB.js} +6 -6
- package/dist/subagent-registry-runtime-DVd9wO_D.js +119 -0
- package/dist/{subagent-registry-runtime-BlAI3eqU.js → subagent-registry-runtime-a7xfwPB8.js} +6 -6
- package/dist/{subsystem-Cfn2Pryx.js → subsystem-C6poMade.js} +2 -94
- package/dist/{system-cli-GQBIKMxE.js → system-cli-Zu5LiJFn.js} +25 -21
- package/dist/{system-run-command-ZDr-0-G2.js → system-run-command-Kw0jxir0.js} +1 -1
- package/dist/{systemd-hints-CLH4_-IK.js → systemd-hints-Da4Q7Orc.js} +5 -5
- package/dist/{systemd-linger-PnO8ebUK.js → systemd-linger-NLcFYPEu.js} +2 -2
- package/dist/{systemd-tpTWQ79a.js → systemd-tjVNbfBk.js} +2 -2
- package/dist/{table-D9z5aFl9.js → table-BP6N5EYA.js} +2 -2
- package/dist/{tables-Bb1hkkgV.js → tables-D4LxfXpk.js} +2 -2
- package/dist/{tailnet-B-wq8YXh.js → tailnet-CInGXmk9.js} +1 -1
- package/dist/{tailscale-DOG3cjSj.js → tailscale-DRFhBuh-.js} +1 -1
- package/dist/{target-errors-D41KLMCY.js → target-errors-CkcKdefZ.js} +2 -2
- package/dist/{tokens-g3GBx2U9.js → tokens-C3eENCf9.js} +1 -1
- package/dist/{tool-display-CpQNRadF.js → tool-display-qTfeZx-b.js} +2 -2
- package/dist/{tool-images-Bkv3er-8.js → tool-images-BwtNIRsT.js} +2 -2
- package/dist/{trash-ChZlaria.js → trash-DHZNy01S.js} +2 -2
- package/dist/{tui-BdX0dbMg.js → tui-CW9for1h.js} +18 -18
- package/dist/tui-cli-ChrtbCqc.js +91 -0
- package/dist/types.secrets-CpVqMFti.js +81 -0
- package/dist/{update-BLXj6ysD.js → update-Bb-g7rqr.js} +4 -4
- package/dist/{update-cli-lYpdoDyw.js → update-cli-DHGCFiKY.js} +155 -148
- package/dist/{update-runner-DtN1XGSv.js → update-runner-BDHtvoca.js} +6 -6
- package/dist/web-CCim-JL4.js +123 -0
- package/dist/{web-BEuMJbx-.js → web-CREcqhe9.js} +6 -6
- package/dist/{web-BvId86u4.js → web-IBqHOVI2.js} +6 -6
- package/dist/{webhooks-cli-CvPAdGDn.js → webhooks-cli-C32h-6dI.js} +21 -18
- package/dist/{whatsapp-actions-DSjBUB00.js → whatsapp-actions-BZRxKavO.js} +31 -28
- package/dist/{widearea-dns-Blh7W-0q.js → widearea-dns-9PZLZ6zk.js} +1 -1
- package/dist/{with-timeout-BVwCWUvY.js → with-timeout-DKgjtZv2.js} +6 -43
- package/dist/{workspace-BrC46nbq.js → workspace-CedZZfvJ.js} +5 -5
- package/dist/{workspace-dirs-Cb43onAl.js → workspace-dirs-BgwJ2Axm.js} +1 -1
- package/dist/{ws-ChEZbUss.js → ws-BwH2d97O.js} +2 -2
- package/docs/es/concepts/sessions.md +1 -1
- package/docs/pt-BR/concepts/sessions.md +1 -1
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/ci-fix-loop/package.json +1 -1
- package/extensions/continuous-learning/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/diffs/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/flow/package.json +1 -1
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/node_modules/.bin/openclaw +2 -2
- package/extensions/googlechat/package.json +2 -2
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- 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 +5 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/node_modules/.bin/openclaw +2 -2
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +5 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +5 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/self-improvement/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +5 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +5 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +5 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +5 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +2 -2
- package/dist/audio-preflight-Bk3KZQei.js +0 -98
- package/dist/clawbot-cli-DpO-ZwmI.js +0 -32
- package/dist/cli-1p9b3pE_.js +0 -155
- package/dist/deliver-runtime-CESEQ4NM.js +0 -59
- package/dist/deps-send-discord.runtime-dTfY4NLn.js +0 -34
- package/dist/deps-send-imessage.runtime-Cm_XDGKz.js +0 -33
- package/dist/deps-send-signal.runtime-9WH9ir2Z.js +0 -32
- package/dist/deps-send-slack.runtime-Cx_x379p.js +0 -30
- package/dist/deps-send-telegram.runtime-BFHbiOeI.js +0 -36
- package/dist/deps-send-whatsapp.runtime-BeJLvpI1.js +0 -117
- package/dist/image-runtime-Bq51vNRb.js +0 -53
- package/dist/manager-runtime-D2MqM9iK.js +0 -24
- package/dist/node-commands-DYz_oQFz.js +0 -12
- package/dist/pi-model-discovery-runtime-IFYIuVfT.js +0 -17
- package/dist/register.configure-a0uTvfCu.js +0 -166
- package/dist/runtime-whatsapp-login.runtime-CQLsSWjA.js +0 -20
- package/dist/runtime-whatsapp-outbound.runtime-DoZi3gnM.js +0 -40
- package/dist/slash-commands.runtime-Ckcj6TnD.js +0 -25
- package/dist/slash-dispatch.runtime-B5ykjP8B.js +0 -112
- package/dist/slash-skill-commands.runtime-DbzbD-ZQ.js +0 -31
- package/dist/subagent-registry-runtime-Bjh1H1uK.js +0 -112
- package/dist/tui-cli-C9UujwTv.js +0 -86
- package/dist/web-C14E8nHS.js +0 -116
- /package/dist/{allow-from-Do0aB7F6.js → allow-from-D5r7UcQr.js} +0 -0
- /package/dist/{boolean-DtWR5bt3.js → boolean-ydSOedIP.js} +0 -0
- /package/dist/{brew-sUdeII-D.js → brew-Djs-Lc5s.js} +0 -0
- /package/dist/{chat-envelope-CrWMMV_a.js → chat-envelope-DVKDDTSu.js} +0 -0
- /package/dist/{cli-utils-DK6017OO.js → cli-utils-CCaEbxAz.js} +0 -0
- /package/dist/{command-format-CLEQe4bk.js → command-format-MESnUO9S.js} +0 -0
- /package/dist/{command-options-j8s8APBQ.js → command-options-ZvhOayEd.js} +0 -0
- /package/dist/{command-poll-backoff-Cse56OCv.js → command-poll-backoff-Dal4OaUV.js} +0 -0
- /package/dist/{constants-BgSj-mRP.js → constants-CkIxhEvX.js} +0 -0
- /package/dist/{context-window-guard-BgcfPYTd.js → context-window-guard-BUJ2pfYi.js} +0 -0
- /package/dist/{daemon-runtime-VfkpXuRu.js → daemon-runtime-CbyS9Xgu.js} +0 -0
- /package/dist/{dangerous-name-matching-BAJAZtyB.js → dangerous-name-matching-PRkNIyQj.js} +0 -0
- /package/dist/{dangerous-tools-DjOwyW3J.js → dangerous-tools-B9LIt3MU.js} +0 -0
- /package/dist/{entry-status-DVwZos2N.js → entry-status-4cDL0OcK.js} +0 -0
- /package/dist/{fetch-timeout-BL0dTnkh.js → fetch-timeout-EpWPz-Eu.js} +0 -0
- /package/dist/{format-C-890_pY.js → format-DVLB9DNB.js} +0 -0
- /package/dist/{format-duration-BvkrOKhT.js → format-duration-CrBESKOT.js} +0 -0
- /package/dist/{format-relative-8cNYQsqb.js → format-relative-BsYuWm-Q.js} +0 -0
- /package/dist/{health-format-CqfOHMzL.js → health-format-BIotQmMH.js} +0 -0
- /package/dist/{heartbeat-visibility-_K4bnQDH.js → heartbeat-visibility-C_P1yurK.js} +0 -0
- /package/dist/{help-format-ncfKj8zq.js → help-format-Ce4Xueed.js} +0 -0
- /package/dist/{helpers-5EH85AYF.js → helpers-CpIyUra4.js} +0 -0
- /package/dist/{input-provenance-ByYWugDu.js → input-provenance-qgaZGYuK.js} +0 -0
- /package/dist/{json-files-UKlMS7yU.js → json-files-BH1UBATr.js} +0 -0
- /package/dist/{kill-tree-CeEi7v61.js → kill-tree-W9BwtYuE.js} +0 -0
- /package/dist/{legacy-names-D3aIn6ij.js → legacy-names-DV-6rguu.js} +0 -0
- /package/dist/{load-options-CLMiD1a9.js → load-options-BuY2PXsl.js} +0 -0
- /package/dist/{logging-DRwtiLIS.js → logging-kuFzZMsG.js} +0 -0
- /package/dist/{model-param-b-NJsgH2EF.js → model-param-b-4PN786ZX.js} +0 -0
- /package/dist/{mutable-allowlist-detectors-DiZDtmlZ.js → mutable-allowlist-detectors-TCG6mnbz.js} +0 -0
- /package/dist/{node-resolve-C8bjtxQk.js → node-resolve-DSu0lzHd.js} +0 -0
- /package/dist/{onboard-config-DFLATNN1.js → onboard-config-YMJ1PLAF.js} +0 -0
- /package/dist/{onboard-provider-auth-flags-CpVNpwzI.js → onboard-provider-auth-flags-DHzbi9kj.js} +0 -0
- /package/dist/{openclaw-root-BFfBQ6FD.js → openclaw-root-T5G2ldGE.js} +0 -0
- /package/dist/{parse-log-line-DxFrnzNo.js → parse-log-line-BrrE4onI.js} +0 -0
- /package/dist/{parse-port-CboE2EQm.js → parse-port-DjjWDROB.js} +0 -0
- /package/dist/{parse-timeout-uTDpUWKR.js → parse-timeout-BS3EWcf6.js} +0 -0
- /package/dist/{polls-D86s6oEI.js → polls-QrTzhQf5.js} +0 -0
- /package/dist/{program-context-DQD9Uf8U.js → program-context-BqyLhTGk.js} +0 -0
- /package/dist/{prompt-style-C1jf_-k5.js → prompt-style-DB_OyH4q.js} +0 -0
- /package/dist/{prompts-GoDC3iAV.js → prompts-DomsZukd.js} +0 -0
- /package/dist/{provider-env-vars-D3-Jf8PX.js → provider-env-vars-DYZiYet-.js} +0 -0
- /package/dist/{proxy-BNFyBgvu.js → proxy-CUsDSClP.js} +0 -0
- /package/dist/{redact-BsCSVGmT.js → redact-B1GVGbib.js} +0 -0
- /package/dist/{render-scQFEkLe.js → render-CUAKPmvZ.js} +0 -0
- /package/dist/{run-with-concurrency-CzLnwXXV.js → run-with-concurrency-CLARJMM7.js} +0 -0
- /package/dist/{runtime-status-CL_bKfj_.js → runtime-status-Fmu5gNYW.js} +0 -0
- /package/dist/{secret-equal-DxKrAcRs.js → secret-equal-BN0idTaZ.js} +0 -0
- /package/dist/{secure-random-CruxVpoI.js → secure-random-B2UrD2xa.js} +0 -0
- /package/dist/{session-key-k6urs9r-.js → session-key-CC77ya0a.js} +0 -0
- /package/dist/{stagger-DW-U0kcV.js → stagger-Cek4Eizw.js} +0 -0
- /package/dist/{targets-CwCifSLG.js → targets-CD5AQXRB.js} +0 -0
- /package/dist/{targets-xSi-e-_L.js → targets-DPUt073v.js} +0 -0
- /package/dist/{text-format-CFm4X8Ze.js → text-format-DarxU3JH.js} +0 -0
- /package/dist/{thinking-RV_E8HFV.js → thinking-C0gzzPsv.js} +0 -0
- /package/dist/{timeouts-G9Yto-nj.js → timeouts-DEnpCqGd.js} +0 -0
- /package/dist/{tool-catalog-omkiks3D.js → tool-catalog-3w4XiWhy.js} +0 -0
- /package/dist/{transcript-events-CtWhopMu.js → transcript-events-CdWLIofg.js} +0 -0
- /package/dist/{usage-format-BMWvYDjj.js → usage-format-zuuFSdkg.js} +0 -0
- /package/dist/{utils-cwpAMi-t.js → utils-BnC3HGtm.js} +0 -0
- /package/dist/{version-DdJhsIqk.js → version-DT-JIO28.js} +0 -0
- /package/dist/{windows-spawn-CsdZOQMr.js → windows-spawn-CVnPunjY.js} +0 -0
- /package/dist/{wsl-Cx5T6MYb.js → wsl-DLw4LET-.js} +0 -0
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
2
|
import { _ as expandHomePrefix, a as resolveCanonicalConfigPath, c as resolveDefaultConfigCandidates, d as resolveIsNixMode, f as resolveLegacyStateDirs, g as resolveStateDir, h as resolveOAuthPath, i as isNixMode, l as resolveGatewayLockDir, m as resolveOAuthDir, n as DEFAULT_GATEWAY_PORT, o as resolveConfigPath, p as resolveNewStateDir, r as STATE_DIR, s as resolveConfigPathCandidate, t as CONFIG_PATH, u as resolveGatewayPort, y as resolveRequiredHomeDir } from "./paths-BMo6kTge.js";
|
|
3
|
-
import { c as stripAnsi, t as createSubsystemLogger } from "./subsystem-
|
|
3
|
+
import { c as stripAnsi, t as createSubsystemLogger } from "./subsystem-C6poMade.js";
|
|
4
4
|
import { r as isTruthyEnvValue } from "./entry.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { a as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
5
|
+
import { _ as AUTH_STORE_LOCK_OPTIONS, c as updateAuthProfileStoreWithLock, d as resolveAuthStorePathForDisplay, l as ensureAuthStoreFile, n as ensureAuthProfileStore, o as saveAuthProfileStore, p as withFileLock, u as resolveAuthStorePath, x as log$6 } from "./store-D8F_4CRR.js";
|
|
6
|
+
import { t as formatCliCommand } from "./command-format-MESnUO9S.js";
|
|
7
|
+
import { N as resolveAgentModelPrimaryValue, P as toAgentModelListLike, d as resolveDefaultAgentId, i as resolveAgentConfig, o as resolveAgentEffectiveModelPrimary, u as resolveAgentWorkspaceDir } from "./agent-scope-BcruZHHR.js";
|
|
8
|
+
import { c as normalizeAgentId, t as DEFAULT_AGENT_ID, y as isBlockedObjectKey } from "./session-key-CC77ya0a.js";
|
|
9
|
+
import { E as isPlainObject$2, S as sleep, h as resolveConfigDir, u as isRecord$2, v as resolveUserPath } from "./utils-BnC3HGtm.js";
|
|
10
|
+
import { a as openBoundaryFileSync, r as canUseBoundaryFileOpen } from "./openclaw-root-T5G2ldGE.js";
|
|
11
|
+
import { n as runExec } from "./exec-B8Hv4Nkd.js";
|
|
12
|
+
import { a as hasConfiguredSecretInput, c as normalizeResolvedSecretInputString, d as resolveSecretInputRef, i as coerceSecretRef, l as normalizeSecretInputString, n as ENV_SECRET_REF_ID_RE, o as isSecretRef, r as assertSecretInputResolved, s as isValidEnvSecretRefId, t as DEFAULT_SECRET_PROVIDER_ALIAS, u as parseEnvTemplateSecretRef } from "./types.secrets-CpVqMFti.js";
|
|
13
|
+
import { r as resolveCopilotApiToken, t as DEFAULT_COPILOT_API_BASE_URL } from "./github-copilot-token-BKQ4nXAw.js";
|
|
14
|
+
import { _ as sanitizeHostExecEnv, d as normalizePluginsConfig, f as resolveEffectiveEnableState, g as normalizeEnvVarKey, h as isDangerousHostEnvVarName, m as isDangerousHostEnvOverrideVarName, n as loadPluginManifestRegistry, p as resolveMemorySlotDecision } from "./manifest-registry-m_hXBIk-.js";
|
|
15
|
+
import { t as VERSION } from "./version-DT-JIO28.js";
|
|
16
|
+
import { i as isPathInside } from "./legacy-names-DV-6rguu.js";
|
|
17
|
+
import { t as CHANNEL_IDS, u as normalizeChatChannelId } from "./registry-DnJ84ILp.js";
|
|
18
|
+
import { i as isCanonicalDottedDecimalIPv4, u as isLoopbackIpAddress } from "./ip-C7WWCRN7.js";
|
|
19
|
+
import { d as TOOLS_BY_SENDER_KEY_TYPES, f as parseToolsBySenderTypedKey } from "./dock-nMBfeGKa.js";
|
|
20
|
+
import { t as runTasksWithConcurrency } from "./run-with-concurrency-CLARJMM7.js";
|
|
18
21
|
import { createRequire } from "node:module";
|
|
19
22
|
import { execFileSync, spawn } from "node:child_process";
|
|
20
23
|
import os from "node:os";
|
|
@@ -27,32 +30,8 @@ import { BedrockClient, ListFoundationModelsCommand } from "@aws-sdk/client-bedr
|
|
|
27
30
|
import { createAssistantMessageEventStream, getEnvApiKey, getOAuthApiKey, getOAuthProviders } from "@mariozechner/pi-ai";
|
|
28
31
|
import crypto, { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
29
32
|
import dotenv from "dotenv";
|
|
30
|
-
import ipaddr from "ipaddr.js";
|
|
31
33
|
import { z } from "zod";
|
|
32
34
|
|
|
33
|
-
//#region src/agents/auth-profiles/constants.ts
|
|
34
|
-
const AUTH_STORE_VERSION = 1;
|
|
35
|
-
const AUTH_PROFILE_FILENAME = "auth-profiles.json";
|
|
36
|
-
const LEGACY_AUTH_FILENAME = "auth.json";
|
|
37
|
-
const CLAUDE_CLI_PROFILE_ID = "anthropic:claude-cli";
|
|
38
|
-
const CODEX_CLI_PROFILE_ID = "openai-codex:codex-cli";
|
|
39
|
-
const QWEN_CLI_PROFILE_ID = "qwen-portal:qwen-cli";
|
|
40
|
-
const MINIMAX_CLI_PROFILE_ID = "minimax-portal:minimax-cli";
|
|
41
|
-
const AUTH_STORE_LOCK_OPTIONS = {
|
|
42
|
-
retries: {
|
|
43
|
-
retries: 10,
|
|
44
|
-
factor: 2,
|
|
45
|
-
minTimeout: 100,
|
|
46
|
-
maxTimeout: 1e4,
|
|
47
|
-
randomize: true
|
|
48
|
-
},
|
|
49
|
-
stale: 3e4
|
|
50
|
-
};
|
|
51
|
-
const EXTERNAL_CLI_SYNC_TTL_MS = 900 * 1e3;
|
|
52
|
-
const EXTERNAL_CLI_NEAR_EXPIRY_MS = 600 * 1e3;
|
|
53
|
-
const log$7 = createSubsystemLogger("agents/auth-profiles");
|
|
54
|
-
|
|
55
|
-
//#endregion
|
|
56
35
|
//#region src/agents/auth-profiles/display.ts
|
|
57
36
|
function resolveAuthProfileDisplayLabel(params) {
|
|
58
37
|
const { cfg, store, profileId } = params;
|
|
@@ -208,7 +187,7 @@ function normalizeOptionalSecretInput(value) {
|
|
|
208
187
|
|
|
209
188
|
//#endregion
|
|
210
189
|
//#region src/agents/bedrock-discovery.ts
|
|
211
|
-
const log$
|
|
190
|
+
const log$5 = createSubsystemLogger("bedrock-discovery");
|
|
212
191
|
const DEFAULT_REFRESH_INTERVAL_SECONDS = 3600;
|
|
213
192
|
const DEFAULT_CONTEXT_WINDOW = 32e3;
|
|
214
193
|
const DEFAULT_MAX_TOKENS = 4096;
|
|
@@ -330,7 +309,7 @@ async function discoverBedrockModels(params) {
|
|
|
330
309
|
if (refreshIntervalSeconds > 0) discoveryCache.delete(cacheKey);
|
|
331
310
|
if (!hasLoggedBedrockError) {
|
|
332
311
|
hasLoggedBedrockError = true;
|
|
333
|
-
log$
|
|
312
|
+
log$5.warn(`Failed to list models: ${String(error)}`);
|
|
334
313
|
}
|
|
335
314
|
return [];
|
|
336
315
|
}
|
|
@@ -534,7 +513,7 @@ const DOUBAO_CODING_MODEL_CATALOG = [...VOLC_SHARED_CODING_MODEL_CATALOG, {
|
|
|
534
513
|
|
|
535
514
|
//#endregion
|
|
536
515
|
//#region src/agents/huggingface-models.ts
|
|
537
|
-
const log$
|
|
516
|
+
const log$4 = createSubsystemLogger("huggingface-models");
|
|
538
517
|
/** Hugging Face Inference Providers (router) — OpenAI-compatible chat completions. */
|
|
539
518
|
const HUGGINGFACE_BASE_URL = "https://router.huggingface.co/v1";
|
|
540
519
|
/** Router policy suffixes: router picks backend by cost or speed; no specific provider selection. */
|
|
@@ -664,12 +643,12 @@ async function discoverHuggingfaceModels(apiKey) {
|
|
|
664
643
|
}
|
|
665
644
|
});
|
|
666
645
|
if (!response.ok) {
|
|
667
|
-
log$
|
|
646
|
+
log$4.warn(`GET /v1/models failed: HTTP ${response.status}, using static catalog`);
|
|
668
647
|
return HUGGINGFACE_MODEL_CATALOG.map(buildHuggingfaceModelDefinition);
|
|
669
648
|
}
|
|
670
649
|
const data = (await response.json())?.data;
|
|
671
650
|
if (!Array.isArray(data) || data.length === 0) {
|
|
672
|
-
log$
|
|
651
|
+
log$4.warn("No models in response, using static catalog");
|
|
673
652
|
return HUGGINGFACE_MODEL_CATALOG.map(buildHuggingfaceModelDefinition);
|
|
674
653
|
}
|
|
675
654
|
const catalogById = new Map(HUGGINGFACE_MODEL_CATALOG.map((m) => [m.id, m]));
|
|
@@ -700,7 +679,7 @@ async function discoverHuggingfaceModels(apiKey) {
|
|
|
700
679
|
}
|
|
701
680
|
return models.length > 0 ? models : HUGGINGFACE_MODEL_CATALOG.map(buildHuggingfaceModelDefinition);
|
|
702
681
|
} catch (error) {
|
|
703
|
-
log$
|
|
682
|
+
log$4.warn(`Discovery failed: ${String(error)}, using static catalog`);
|
|
704
683
|
return HUGGINGFACE_MODEL_CATALOG.map(buildHuggingfaceModelDefinition);
|
|
705
684
|
}
|
|
706
685
|
}
|
|
@@ -1196,7 +1175,7 @@ function buildStreamErrorAssistantMessage(params) {
|
|
|
1196
1175
|
|
|
1197
1176
|
//#endregion
|
|
1198
1177
|
//#region src/agents/ollama-stream.ts
|
|
1199
|
-
const log$
|
|
1178
|
+
const log$3 = createSubsystemLogger("ollama-stream");
|
|
1200
1179
|
const OLLAMA_NATIVE_BASE_URL = "http://127.0.0.1:11434";
|
|
1201
1180
|
const MAX_SAFE_INTEGER_ABS_STR = String(Number.MAX_SAFE_INTEGER);
|
|
1202
1181
|
function isAsciiDigit(ch) {
|
|
@@ -1387,14 +1366,14 @@ async function* parseNdjsonStream(reader) {
|
|
|
1387
1366
|
try {
|
|
1388
1367
|
yield parseJsonPreservingUnsafeIntegers(trimmed);
|
|
1389
1368
|
} catch {
|
|
1390
|
-
log$
|
|
1369
|
+
log$3.warn(`Skipping malformed NDJSON line: ${trimmed.slice(0, 120)}`);
|
|
1391
1370
|
}
|
|
1392
1371
|
}
|
|
1393
1372
|
}
|
|
1394
1373
|
if (buffer.trim()) try {
|
|
1395
1374
|
yield parseJsonPreservingUnsafeIntegers(buffer.trim());
|
|
1396
1375
|
} catch {
|
|
1397
|
-
log$
|
|
1376
|
+
log$3.warn(`Skipping malformed trailing data: ${buffer.trim().slice(0, 120)}`);
|
|
1398
1377
|
}
|
|
1399
1378
|
}
|
|
1400
1379
|
function resolveOllamaChatUrl(baseUrl) {
|
|
@@ -1880,7 +1859,7 @@ async function retryAsync(fn, attemptsOrOptions = 3, initialDelayMs = 300) {
|
|
|
1880
1859
|
|
|
1881
1860
|
//#endregion
|
|
1882
1861
|
//#region src/agents/venice-models.ts
|
|
1883
|
-
const log$
|
|
1862
|
+
const log$2 = createSubsystemLogger("venice-models");
|
|
1884
1863
|
const VENICE_BASE_URL = "https://api.venice.ai/api/v1";
|
|
1885
1864
|
const VENICE_DEFAULT_MODEL_ID = "llama-3.3-70b";
|
|
1886
1865
|
const VENICE_DEFAULT_MODEL_REF = `venice/${VENICE_DEFAULT_MODEL_ID}`;
|
|
@@ -2228,12 +2207,12 @@ async function discoverVeniceModels() {
|
|
|
2228
2207
|
shouldRetry: isRetryableVeniceDiscoveryError
|
|
2229
2208
|
});
|
|
2230
2209
|
if (!response.ok) {
|
|
2231
|
-
log$
|
|
2210
|
+
log$2.warn(`Failed to discover models: HTTP ${response.status}, using static catalog`);
|
|
2232
2211
|
return staticVeniceModelDefinitions();
|
|
2233
2212
|
}
|
|
2234
2213
|
const data = await response.json();
|
|
2235
2214
|
if (!Array.isArray(data.data) || data.data.length === 0) {
|
|
2236
|
-
log$
|
|
2215
|
+
log$2.warn("No models found from API, using static catalog");
|
|
2237
2216
|
return staticVeniceModelDefinitions();
|
|
2238
2217
|
}
|
|
2239
2218
|
const catalogById = new Map(VENICE_MODEL_CATALOG.map((m) => [m.id, m]));
|
|
@@ -2259,10 +2238,10 @@ async function discoverVeniceModels() {
|
|
|
2259
2238
|
return models.length > 0 ? models : staticVeniceModelDefinitions();
|
|
2260
2239
|
} catch (error) {
|
|
2261
2240
|
if (error instanceof VeniceDiscoveryHttpError) {
|
|
2262
|
-
log$
|
|
2241
|
+
log$2.warn(`Failed to discover models: HTTP ${error.status}, using static catalog`);
|
|
2263
2242
|
return staticVeniceModelDefinitions();
|
|
2264
2243
|
}
|
|
2265
|
-
log$
|
|
2244
|
+
log$2.warn(`Discovery failed: ${String(error)}, using static catalog`);
|
|
2266
2245
|
return staticVeniceModelDefinitions();
|
|
2267
2246
|
}
|
|
2268
2247
|
}
|
|
@@ -2388,7 +2367,7 @@ const NVIDIA_DEFAULT_COST = {
|
|
|
2388
2367
|
cacheRead: 0,
|
|
2389
2368
|
cacheWrite: 0
|
|
2390
2369
|
};
|
|
2391
|
-
const log$
|
|
2370
|
+
const log$1 = createSubsystemLogger("agents/model-providers");
|
|
2392
2371
|
/**
|
|
2393
2372
|
* Derive the Ollama native API base URL from a configured base URL.
|
|
2394
2373
|
*
|
|
@@ -2427,16 +2406,16 @@ async function discoverOllamaModels(baseUrl, opts) {
|
|
|
2427
2406
|
const apiBase = resolveOllamaApiBase(baseUrl);
|
|
2428
2407
|
const response = await fetch(`${apiBase}/api/tags`, { signal: AbortSignal.timeout(5e3) });
|
|
2429
2408
|
if (!response.ok) {
|
|
2430
|
-
if (!opts?.quiet) log$
|
|
2409
|
+
if (!opts?.quiet) log$1.warn(`Failed to discover Ollama models: ${response.status}`);
|
|
2431
2410
|
return [];
|
|
2432
2411
|
}
|
|
2433
2412
|
const data = await response.json();
|
|
2434
2413
|
if (!data.models || data.models.length === 0) {
|
|
2435
|
-
log$
|
|
2414
|
+
log$1.debug("No Ollama models found on local instance");
|
|
2436
2415
|
return [];
|
|
2437
2416
|
}
|
|
2438
2417
|
const modelsToInspect = data.models.slice(0, OLLAMA_SHOW_MAX_MODELS);
|
|
2439
|
-
if (modelsToInspect.length < data.models.length && !opts?.quiet) log$
|
|
2418
|
+
if (modelsToInspect.length < data.models.length && !opts?.quiet) log$1.warn(`Capping Ollama /api/show inspection to ${OLLAMA_SHOW_MAX_MODELS} models (received ${data.models.length})`);
|
|
2440
2419
|
const discovered = [];
|
|
2441
2420
|
for (let index = 0; index < modelsToInspect.length; index += OLLAMA_SHOW_CONCURRENCY) {
|
|
2442
2421
|
const batch = modelsToInspect.slice(index, index + OLLAMA_SHOW_CONCURRENCY);
|
|
@@ -2457,7 +2436,7 @@ async function discoverOllamaModels(baseUrl, opts) {
|
|
|
2457
2436
|
}
|
|
2458
2437
|
return discovered;
|
|
2459
2438
|
} catch (error) {
|
|
2460
|
-
if (!opts?.quiet) log$
|
|
2439
|
+
if (!opts?.quiet) log$1.warn(`Failed to discover Ollama models: ${String(error)}`);
|
|
2461
2440
|
return [];
|
|
2462
2441
|
}
|
|
2463
2442
|
}
|
|
@@ -2471,12 +2450,12 @@ async function discoverVllmModels(baseUrl, apiKey) {
|
|
|
2471
2450
|
signal: AbortSignal.timeout(5e3)
|
|
2472
2451
|
});
|
|
2473
2452
|
if (!response.ok) {
|
|
2474
|
-
log$
|
|
2453
|
+
log$1.warn(`Failed to discover vLLM models: ${response.status}`);
|
|
2475
2454
|
return [];
|
|
2476
2455
|
}
|
|
2477
2456
|
const models = (await response.json()).data ?? [];
|
|
2478
2457
|
if (models.length === 0) {
|
|
2479
|
-
log$
|
|
2458
|
+
log$1.warn("No vLLM models found on local instance");
|
|
2480
2459
|
return [];
|
|
2481
2460
|
}
|
|
2482
2461
|
return models.map((m) => ({ id: typeof m.id === "string" ? m.id.trim() : "" })).filter((m) => Boolean(m.id)).map((m) => {
|
|
@@ -2493,7 +2472,7 @@ async function discoverVllmModels(baseUrl, apiKey) {
|
|
|
2493
2472
|
};
|
|
2494
2473
|
});
|
|
2495
2474
|
} catch (error) {
|
|
2496
|
-
log$
|
|
2475
|
+
log$1.warn(`Failed to discover vLLM models: ${String(error)}`);
|
|
2497
2476
|
return [];
|
|
2498
2477
|
}
|
|
2499
2478
|
}
|
|
@@ -3164,7 +3143,7 @@ async function resolveImplicitBedrockProvider(params) {
|
|
|
3164
3143
|
|
|
3165
3144
|
//#endregion
|
|
3166
3145
|
//#region src/agents/model-selection.ts
|
|
3167
|
-
const log
|
|
3146
|
+
const log = createSubsystemLogger("model-selection");
|
|
3168
3147
|
const ANTHROPIC_MODEL_ALIASES = {
|
|
3169
3148
|
"opus-4.6": "claude-opus-4-6",
|
|
3170
3149
|
"opus-4.5": "claude-opus-4-5",
|
|
@@ -3330,7 +3309,7 @@ function resolveConfiguredModelRef(params) {
|
|
|
3330
3309
|
const aliasKey = normalizeAliasKey(trimmed);
|
|
3331
3310
|
const aliasMatch = aliasIndex.byAlias.get(aliasKey);
|
|
3332
3311
|
if (aliasMatch) return aliasMatch.ref;
|
|
3333
|
-
log
|
|
3312
|
+
log.warn(`Model "${trimmed}" specified without provider. Falling back to "anthropic/${trimmed}". Please use "anthropic/${trimmed}" in your config.`);
|
|
3334
3313
|
return {
|
|
3335
3314
|
provider: "anthropic",
|
|
3336
3315
|
model: trimmed
|
|
@@ -3515,661 +3494,6 @@ function normalizeModelSelection(value) {
|
|
|
3515
3494
|
if (typeof primary === "string" && primary.trim()) return primary.trim();
|
|
3516
3495
|
}
|
|
3517
3496
|
|
|
3518
|
-
//#endregion
|
|
3519
|
-
//#region src/shared/pid-alive.ts
|
|
3520
|
-
function isValidPid(pid) {
|
|
3521
|
-
return Number.isInteger(pid) && pid > 0;
|
|
3522
|
-
}
|
|
3523
|
-
/**
|
|
3524
|
-
* Check if a process is a zombie on Linux by reading /proc/<pid>/status.
|
|
3525
|
-
* Returns false on non-Linux platforms or if the proc file can't be read.
|
|
3526
|
-
*/
|
|
3527
|
-
function isZombieProcess(pid) {
|
|
3528
|
-
if (process.platform !== "linux") return false;
|
|
3529
|
-
try {
|
|
3530
|
-
return fs.readFileSync(`/proc/${pid}/status`, "utf8").match(/^State:\s+(\S)/m)?.[1] === "Z";
|
|
3531
|
-
} catch {
|
|
3532
|
-
return false;
|
|
3533
|
-
}
|
|
3534
|
-
}
|
|
3535
|
-
function isPidAlive(pid) {
|
|
3536
|
-
if (!isValidPid(pid)) return false;
|
|
3537
|
-
try {
|
|
3538
|
-
process.kill(pid, 0);
|
|
3539
|
-
} catch {
|
|
3540
|
-
return false;
|
|
3541
|
-
}
|
|
3542
|
-
if (isZombieProcess(pid)) return false;
|
|
3543
|
-
return true;
|
|
3544
|
-
}
|
|
3545
|
-
/**
|
|
3546
|
-
* Read the process start time (field 22 "starttime") from /proc/<pid>/stat.
|
|
3547
|
-
* Returns the value in clock ticks since system boot, or null on non-Linux
|
|
3548
|
-
* platforms or if the proc file can't be read.
|
|
3549
|
-
*
|
|
3550
|
-
* This is used to detect PID recycling: if two readings for the same PID
|
|
3551
|
-
* return different starttimes, the PID has been reused by a different process.
|
|
3552
|
-
*/
|
|
3553
|
-
function getProcessStartTime(pid) {
|
|
3554
|
-
if (process.platform !== "linux") return null;
|
|
3555
|
-
if (!isValidPid(pid)) return null;
|
|
3556
|
-
try {
|
|
3557
|
-
const stat = fs.readFileSync(`/proc/${pid}/stat`, "utf8");
|
|
3558
|
-
const commEndIndex = stat.lastIndexOf(")");
|
|
3559
|
-
if (commEndIndex < 0) return null;
|
|
3560
|
-
const fields = stat.slice(commEndIndex + 1).trimStart().split(/\s+/);
|
|
3561
|
-
const starttime = Number(fields[19]);
|
|
3562
|
-
return Number.isInteger(starttime) && starttime >= 0 ? starttime : null;
|
|
3563
|
-
} catch {
|
|
3564
|
-
return null;
|
|
3565
|
-
}
|
|
3566
|
-
}
|
|
3567
|
-
|
|
3568
|
-
//#endregion
|
|
3569
|
-
//#region src/shared/process-scoped-map.ts
|
|
3570
|
-
function resolveProcessScopedMap(key) {
|
|
3571
|
-
const proc = process;
|
|
3572
|
-
const existing = proc[key];
|
|
3573
|
-
if (existing) return existing;
|
|
3574
|
-
const created = /* @__PURE__ */ new Map();
|
|
3575
|
-
proc[key] = created;
|
|
3576
|
-
return created;
|
|
3577
|
-
}
|
|
3578
|
-
|
|
3579
|
-
//#endregion
|
|
3580
|
-
//#region src/plugin-sdk/file-lock.ts
|
|
3581
|
-
const HELD_LOCKS = resolveProcessScopedMap(Symbol.for("openclaw.fileLockHeldLocks"));
|
|
3582
|
-
function computeDelayMs(retries, attempt) {
|
|
3583
|
-
const base = Math.min(retries.maxTimeout, Math.max(retries.minTimeout, retries.minTimeout * retries.factor ** attempt));
|
|
3584
|
-
const jitter = retries.randomize ? 1 + Math.random() : 1;
|
|
3585
|
-
return Math.min(retries.maxTimeout, Math.round(base * jitter));
|
|
3586
|
-
}
|
|
3587
|
-
async function readLockPayload(lockPath) {
|
|
3588
|
-
try {
|
|
3589
|
-
const raw = await fs$1.readFile(lockPath, "utf8");
|
|
3590
|
-
const parsed = JSON.parse(raw);
|
|
3591
|
-
if (typeof parsed.pid !== "number" || typeof parsed.createdAt !== "string") return null;
|
|
3592
|
-
return {
|
|
3593
|
-
pid: parsed.pid,
|
|
3594
|
-
createdAt: parsed.createdAt
|
|
3595
|
-
};
|
|
3596
|
-
} catch {
|
|
3597
|
-
return null;
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
|
-
async function resolveNormalizedFilePath(filePath) {
|
|
3601
|
-
const resolved = path.resolve(filePath);
|
|
3602
|
-
const dir = path.dirname(resolved);
|
|
3603
|
-
await fs$1.mkdir(dir, { recursive: true });
|
|
3604
|
-
try {
|
|
3605
|
-
const realDir = await fs$1.realpath(dir);
|
|
3606
|
-
return path.join(realDir, path.basename(resolved));
|
|
3607
|
-
} catch {
|
|
3608
|
-
return resolved;
|
|
3609
|
-
}
|
|
3610
|
-
}
|
|
3611
|
-
async function isStaleLock(lockPath, staleMs) {
|
|
3612
|
-
const payload = await readLockPayload(lockPath);
|
|
3613
|
-
if (payload?.pid && !isPidAlive(payload.pid)) return true;
|
|
3614
|
-
if (payload?.createdAt) {
|
|
3615
|
-
const createdAt = Date.parse(payload.createdAt);
|
|
3616
|
-
if (!Number.isFinite(createdAt) || Date.now() - createdAt > staleMs) return true;
|
|
3617
|
-
}
|
|
3618
|
-
try {
|
|
3619
|
-
const stat = await fs$1.stat(lockPath);
|
|
3620
|
-
return Date.now() - stat.mtimeMs > staleMs;
|
|
3621
|
-
} catch {
|
|
3622
|
-
return true;
|
|
3623
|
-
}
|
|
3624
|
-
}
|
|
3625
|
-
async function releaseHeldLock(normalizedFile) {
|
|
3626
|
-
const current = HELD_LOCKS.get(normalizedFile);
|
|
3627
|
-
if (!current) return;
|
|
3628
|
-
current.count -= 1;
|
|
3629
|
-
if (current.count > 0) return;
|
|
3630
|
-
HELD_LOCKS.delete(normalizedFile);
|
|
3631
|
-
await current.handle.close().catch(() => void 0);
|
|
3632
|
-
await fs$1.rm(current.lockPath, { force: true }).catch(() => void 0);
|
|
3633
|
-
}
|
|
3634
|
-
async function acquireFileLock(filePath, options) {
|
|
3635
|
-
const normalizedFile = await resolveNormalizedFilePath(filePath);
|
|
3636
|
-
const lockPath = `${normalizedFile}.lock`;
|
|
3637
|
-
const held = HELD_LOCKS.get(normalizedFile);
|
|
3638
|
-
if (held) {
|
|
3639
|
-
held.count += 1;
|
|
3640
|
-
return {
|
|
3641
|
-
lockPath,
|
|
3642
|
-
release: () => releaseHeldLock(normalizedFile)
|
|
3643
|
-
};
|
|
3644
|
-
}
|
|
3645
|
-
const attempts = Math.max(1, options.retries.retries + 1);
|
|
3646
|
-
for (let attempt = 0; attempt < attempts; attempt += 1) try {
|
|
3647
|
-
const handle = await fs$1.open(lockPath, "wx");
|
|
3648
|
-
await handle.writeFile(JSON.stringify({
|
|
3649
|
-
pid: process.pid,
|
|
3650
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3651
|
-
}, null, 2), "utf8");
|
|
3652
|
-
HELD_LOCKS.set(normalizedFile, {
|
|
3653
|
-
count: 1,
|
|
3654
|
-
handle,
|
|
3655
|
-
lockPath
|
|
3656
|
-
});
|
|
3657
|
-
return {
|
|
3658
|
-
lockPath,
|
|
3659
|
-
release: () => releaseHeldLock(normalizedFile)
|
|
3660
|
-
};
|
|
3661
|
-
} catch (err) {
|
|
3662
|
-
if (err.code !== "EEXIST") throw err;
|
|
3663
|
-
if (await isStaleLock(lockPath, options.stale)) {
|
|
3664
|
-
await fs$1.rm(lockPath, { force: true }).catch(() => void 0);
|
|
3665
|
-
continue;
|
|
3666
|
-
}
|
|
3667
|
-
if (attempt >= attempts - 1) break;
|
|
3668
|
-
await new Promise((resolve) => setTimeout(resolve, computeDelayMs(options.retries, attempt)));
|
|
3669
|
-
}
|
|
3670
|
-
throw new Error(`file lock timeout for ${normalizedFile}`);
|
|
3671
|
-
}
|
|
3672
|
-
async function withFileLock(filePath, options, fn) {
|
|
3673
|
-
const lock = await acquireFileLock(filePath, options);
|
|
3674
|
-
try {
|
|
3675
|
-
return await fn();
|
|
3676
|
-
} finally {
|
|
3677
|
-
await lock.release();
|
|
3678
|
-
}
|
|
3679
|
-
}
|
|
3680
|
-
|
|
3681
|
-
//#endregion
|
|
3682
|
-
//#region src/agents/cli-credentials.ts
|
|
3683
|
-
const log = createSubsystemLogger("agents/auth-profiles");
|
|
3684
|
-
const QWEN_CLI_CREDENTIALS_RELATIVE_PATH = ".qwen/oauth_creds.json";
|
|
3685
|
-
const MINIMAX_CLI_CREDENTIALS_RELATIVE_PATH = ".minimax/oauth_creds.json";
|
|
3686
|
-
let qwenCliCache = null;
|
|
3687
|
-
let minimaxCliCache = null;
|
|
3688
|
-
function resolveQwenCliCredentialsPath(homeDir) {
|
|
3689
|
-
const baseDir = homeDir ?? resolveUserPath("~");
|
|
3690
|
-
return path.join(baseDir, QWEN_CLI_CREDENTIALS_RELATIVE_PATH);
|
|
3691
|
-
}
|
|
3692
|
-
function resolveMiniMaxCliCredentialsPath(homeDir) {
|
|
3693
|
-
const baseDir = homeDir ?? resolveUserPath("~");
|
|
3694
|
-
return path.join(baseDir, MINIMAX_CLI_CREDENTIALS_RELATIVE_PATH);
|
|
3695
|
-
}
|
|
3696
|
-
function readQwenCliCredentials(options) {
|
|
3697
|
-
return readPortalCliOauthCredentials(resolveQwenCliCredentialsPath(options?.homeDir), "qwen-portal");
|
|
3698
|
-
}
|
|
3699
|
-
function readPortalCliOauthCredentials(credPath, provider) {
|
|
3700
|
-
const raw = loadJsonFile(credPath);
|
|
3701
|
-
if (!raw || typeof raw !== "object") return null;
|
|
3702
|
-
const data = raw;
|
|
3703
|
-
const accessToken = data.access_token;
|
|
3704
|
-
const refreshToken = data.refresh_token;
|
|
3705
|
-
const expiresAt = data.expiry_date;
|
|
3706
|
-
if (typeof accessToken !== "string" || !accessToken) return null;
|
|
3707
|
-
if (typeof refreshToken !== "string" || !refreshToken) return null;
|
|
3708
|
-
if (typeof expiresAt !== "number" || !Number.isFinite(expiresAt)) return null;
|
|
3709
|
-
return {
|
|
3710
|
-
type: "oauth",
|
|
3711
|
-
provider,
|
|
3712
|
-
access: accessToken,
|
|
3713
|
-
refresh: refreshToken,
|
|
3714
|
-
expires: expiresAt
|
|
3715
|
-
};
|
|
3716
|
-
}
|
|
3717
|
-
function readMiniMaxCliCredentials(options) {
|
|
3718
|
-
return readPortalCliOauthCredentials(resolveMiniMaxCliCredentialsPath(options?.homeDir), "minimax-portal");
|
|
3719
|
-
}
|
|
3720
|
-
function readQwenCliCredentialsCached(options) {
|
|
3721
|
-
const ttlMs = options?.ttlMs ?? 0;
|
|
3722
|
-
const now = Date.now();
|
|
3723
|
-
const cacheKey = resolveQwenCliCredentialsPath(options?.homeDir);
|
|
3724
|
-
if (ttlMs > 0 && qwenCliCache && qwenCliCache.cacheKey === cacheKey && now - qwenCliCache.readAt < ttlMs) return qwenCliCache.value;
|
|
3725
|
-
const value = readQwenCliCredentials({ homeDir: options?.homeDir });
|
|
3726
|
-
if (ttlMs > 0) qwenCliCache = {
|
|
3727
|
-
value,
|
|
3728
|
-
readAt: now,
|
|
3729
|
-
cacheKey
|
|
3730
|
-
};
|
|
3731
|
-
return value;
|
|
3732
|
-
}
|
|
3733
|
-
function readMiniMaxCliCredentialsCached(options) {
|
|
3734
|
-
const ttlMs = options?.ttlMs ?? 0;
|
|
3735
|
-
const now = Date.now();
|
|
3736
|
-
const cacheKey = resolveMiniMaxCliCredentialsPath(options?.homeDir);
|
|
3737
|
-
if (ttlMs > 0 && minimaxCliCache && minimaxCliCache.cacheKey === cacheKey && now - minimaxCliCache.readAt < ttlMs) return minimaxCliCache.value;
|
|
3738
|
-
const value = readMiniMaxCliCredentials({ homeDir: options?.homeDir });
|
|
3739
|
-
if (ttlMs > 0) minimaxCliCache = {
|
|
3740
|
-
value,
|
|
3741
|
-
readAt: now,
|
|
3742
|
-
cacheKey
|
|
3743
|
-
};
|
|
3744
|
-
return value;
|
|
3745
|
-
}
|
|
3746
|
-
|
|
3747
|
-
//#endregion
|
|
3748
|
-
//#region src/agents/auth-profiles/external-cli-sync.ts
|
|
3749
|
-
function shallowEqualOAuthCredentials(a, b) {
|
|
3750
|
-
if (!a) return false;
|
|
3751
|
-
if (a.type !== "oauth") return false;
|
|
3752
|
-
return a.provider === b.provider && a.access === b.access && a.refresh === b.refresh && a.expires === b.expires && a.email === b.email && a.enterpriseUrl === b.enterpriseUrl && a.projectId === b.projectId && a.accountId === b.accountId;
|
|
3753
|
-
}
|
|
3754
|
-
function isExternalProfileFresh(cred, now) {
|
|
3755
|
-
if (!cred) return false;
|
|
3756
|
-
if (cred.type !== "oauth" && cred.type !== "token") return false;
|
|
3757
|
-
if (cred.provider !== "qwen-portal" && cred.provider !== "minimax-portal") return false;
|
|
3758
|
-
if (typeof cred.expires !== "number") return true;
|
|
3759
|
-
return cred.expires > now + EXTERNAL_CLI_NEAR_EXPIRY_MS;
|
|
3760
|
-
}
|
|
3761
|
-
/** Sync external CLI credentials into the store for a given provider. */
|
|
3762
|
-
function syncExternalCliCredentialsForProvider(store, profileId, provider, readCredentials, now) {
|
|
3763
|
-
const existing = store.profiles[profileId];
|
|
3764
|
-
const creds = !existing || existing.provider !== provider || !isExternalProfileFresh(existing, now) ? readCredentials() : null;
|
|
3765
|
-
if (!creds) return false;
|
|
3766
|
-
const existingOAuth = existing?.type === "oauth" ? existing : void 0;
|
|
3767
|
-
if ((!existingOAuth || existingOAuth.provider !== provider || existingOAuth.expires <= now || creds.expires > existingOAuth.expires) && !shallowEqualOAuthCredentials(existingOAuth, creds)) {
|
|
3768
|
-
store.profiles[profileId] = creds;
|
|
3769
|
-
log$7.info(`synced ${provider} credentials from external cli`, {
|
|
3770
|
-
profileId,
|
|
3771
|
-
expires: new Date(creds.expires).toISOString()
|
|
3772
|
-
});
|
|
3773
|
-
return true;
|
|
3774
|
-
}
|
|
3775
|
-
return false;
|
|
3776
|
-
}
|
|
3777
|
-
/**
|
|
3778
|
-
* Sync OAuth credentials from external CLI tools (Qwen Code CLI, MiniMax CLI) into the store.
|
|
3779
|
-
*
|
|
3780
|
-
* Returns true if any credentials were updated.
|
|
3781
|
-
*/
|
|
3782
|
-
function syncExternalCliCredentials(store) {
|
|
3783
|
-
let mutated = false;
|
|
3784
|
-
const now = Date.now();
|
|
3785
|
-
const existingQwen = store.profiles[QWEN_CLI_PROFILE_ID];
|
|
3786
|
-
const qwenCreds = !existingQwen || existingQwen.provider !== "qwen-portal" || !isExternalProfileFresh(existingQwen, now) ? readQwenCliCredentialsCached({ ttlMs: EXTERNAL_CLI_SYNC_TTL_MS }) : null;
|
|
3787
|
-
if (qwenCreds) {
|
|
3788
|
-
const existing = store.profiles[QWEN_CLI_PROFILE_ID];
|
|
3789
|
-
const existingOAuth = existing?.type === "oauth" ? existing : void 0;
|
|
3790
|
-
if ((!existingOAuth || existingOAuth.provider !== "qwen-portal" || existingOAuth.expires <= now || qwenCreds.expires > existingOAuth.expires) && !shallowEqualOAuthCredentials(existingOAuth, qwenCreds)) {
|
|
3791
|
-
store.profiles[QWEN_CLI_PROFILE_ID] = qwenCreds;
|
|
3792
|
-
mutated = true;
|
|
3793
|
-
log$7.info("synced qwen credentials from qwen cli", {
|
|
3794
|
-
profileId: QWEN_CLI_PROFILE_ID,
|
|
3795
|
-
expires: new Date(qwenCreds.expires).toISOString()
|
|
3796
|
-
});
|
|
3797
|
-
}
|
|
3798
|
-
}
|
|
3799
|
-
if (syncExternalCliCredentialsForProvider(store, MINIMAX_CLI_PROFILE_ID, "minimax-portal", () => readMiniMaxCliCredentialsCached({ ttlMs: EXTERNAL_CLI_SYNC_TTL_MS }), now)) mutated = true;
|
|
3800
|
-
return mutated;
|
|
3801
|
-
}
|
|
3802
|
-
|
|
3803
|
-
//#endregion
|
|
3804
|
-
//#region src/agents/agent-paths.ts
|
|
3805
|
-
function resolveOpenClawAgentDir() {
|
|
3806
|
-
const override = process.env.OPENCLAW_AGENT_DIR?.trim() || process.env.PI_CODING_AGENT_DIR?.trim();
|
|
3807
|
-
if (override) return resolveUserPath(override);
|
|
3808
|
-
return resolveUserPath(path.join(resolveStateDir(), "agents", DEFAULT_AGENT_ID, "agent"));
|
|
3809
|
-
}
|
|
3810
|
-
|
|
3811
|
-
//#endregion
|
|
3812
|
-
//#region src/agents/auth-profiles/paths.ts
|
|
3813
|
-
function resolveAuthStorePath(agentDir) {
|
|
3814
|
-
const resolved = resolveUserPath(agentDir ?? resolveOpenClawAgentDir());
|
|
3815
|
-
return path.join(resolved, AUTH_PROFILE_FILENAME);
|
|
3816
|
-
}
|
|
3817
|
-
function resolveLegacyAuthStorePath(agentDir) {
|
|
3818
|
-
const resolved = resolveUserPath(agentDir ?? resolveOpenClawAgentDir());
|
|
3819
|
-
return path.join(resolved, LEGACY_AUTH_FILENAME);
|
|
3820
|
-
}
|
|
3821
|
-
function resolveAuthStorePathForDisplay(agentDir) {
|
|
3822
|
-
const pathname = resolveAuthStorePath(agentDir);
|
|
3823
|
-
return pathname.startsWith("~") ? pathname : resolveUserPath(pathname);
|
|
3824
|
-
}
|
|
3825
|
-
function ensureAuthStoreFile(pathname) {
|
|
3826
|
-
if (fs.existsSync(pathname)) return;
|
|
3827
|
-
saveJsonFile(pathname, {
|
|
3828
|
-
version: AUTH_STORE_VERSION,
|
|
3829
|
-
profiles: {}
|
|
3830
|
-
});
|
|
3831
|
-
}
|
|
3832
|
-
|
|
3833
|
-
//#endregion
|
|
3834
|
-
//#region src/agents/auth-profiles/store.ts
|
|
3835
|
-
const AUTH_PROFILE_TYPES = new Set([
|
|
3836
|
-
"api_key",
|
|
3837
|
-
"oauth",
|
|
3838
|
-
"token"
|
|
3839
|
-
]);
|
|
3840
|
-
const runtimeAuthStoreSnapshots = /* @__PURE__ */ new Map();
|
|
3841
|
-
function resolveRuntimeStoreKey(agentDir) {
|
|
3842
|
-
return resolveAuthStorePath(agentDir);
|
|
3843
|
-
}
|
|
3844
|
-
function cloneAuthProfileStore(store) {
|
|
3845
|
-
return structuredClone(store);
|
|
3846
|
-
}
|
|
3847
|
-
function resolveRuntimeAuthProfileStore(agentDir) {
|
|
3848
|
-
if (runtimeAuthStoreSnapshots.size === 0) return null;
|
|
3849
|
-
const mainKey = resolveRuntimeStoreKey(void 0);
|
|
3850
|
-
const requestedKey = resolveRuntimeStoreKey(agentDir);
|
|
3851
|
-
const mainStore = runtimeAuthStoreSnapshots.get(mainKey);
|
|
3852
|
-
const requestedStore = runtimeAuthStoreSnapshots.get(requestedKey);
|
|
3853
|
-
if (!agentDir || requestedKey === mainKey) {
|
|
3854
|
-
if (!mainStore) return null;
|
|
3855
|
-
return cloneAuthProfileStore(mainStore);
|
|
3856
|
-
}
|
|
3857
|
-
if (mainStore && requestedStore) return mergeAuthProfileStores(cloneAuthProfileStore(mainStore), cloneAuthProfileStore(requestedStore));
|
|
3858
|
-
if (requestedStore) return cloneAuthProfileStore(requestedStore);
|
|
3859
|
-
if (mainStore) return cloneAuthProfileStore(mainStore);
|
|
3860
|
-
return null;
|
|
3861
|
-
}
|
|
3862
|
-
function replaceRuntimeAuthProfileStoreSnapshots(entries) {
|
|
3863
|
-
runtimeAuthStoreSnapshots.clear();
|
|
3864
|
-
for (const entry of entries) runtimeAuthStoreSnapshots.set(resolveRuntimeStoreKey(entry.agentDir), cloneAuthProfileStore(entry.store));
|
|
3865
|
-
}
|
|
3866
|
-
function clearRuntimeAuthProfileStoreSnapshots() {
|
|
3867
|
-
runtimeAuthStoreSnapshots.clear();
|
|
3868
|
-
}
|
|
3869
|
-
async function updateAuthProfileStoreWithLock(params) {
|
|
3870
|
-
const authPath = resolveAuthStorePath(params.agentDir);
|
|
3871
|
-
ensureAuthStoreFile(authPath);
|
|
3872
|
-
try {
|
|
3873
|
-
return await withFileLock(authPath, AUTH_STORE_LOCK_OPTIONS, async () => {
|
|
3874
|
-
const store = ensureAuthProfileStore(params.agentDir);
|
|
3875
|
-
if (params.updater(store)) saveAuthProfileStore(store, params.agentDir);
|
|
3876
|
-
return store;
|
|
3877
|
-
});
|
|
3878
|
-
} catch {
|
|
3879
|
-
return null;
|
|
3880
|
-
}
|
|
3881
|
-
}
|
|
3882
|
-
/**
|
|
3883
|
-
* Normalise a raw auth-profiles.json credential entry.
|
|
3884
|
-
*
|
|
3885
|
-
* The official format uses `type` and (for api_key credentials) `key`.
|
|
3886
|
-
* A common mistake — caused by the similarity with the `openclaw.json`
|
|
3887
|
-
* `auth.profiles` section which uses `mode` — is to write `mode` instead of
|
|
3888
|
-
* `type` and `apiKey` instead of `key`. Accept both spellings so users don't
|
|
3889
|
-
* silently lose their credentials.
|
|
3890
|
-
*/
|
|
3891
|
-
function normalizeRawCredentialEntry(raw) {
|
|
3892
|
-
const entry = { ...raw };
|
|
3893
|
-
if (!("type" in entry) && typeof entry["mode"] === "string") entry["type"] = entry["mode"];
|
|
3894
|
-
if (!("key" in entry) && typeof entry["apiKey"] === "string") entry["key"] = entry["apiKey"];
|
|
3895
|
-
return entry;
|
|
3896
|
-
}
|
|
3897
|
-
function parseCredentialEntry(raw, fallbackProvider) {
|
|
3898
|
-
if (!raw || typeof raw !== "object") return {
|
|
3899
|
-
ok: false,
|
|
3900
|
-
reason: "non_object"
|
|
3901
|
-
};
|
|
3902
|
-
const typed = normalizeRawCredentialEntry(raw);
|
|
3903
|
-
if (!AUTH_PROFILE_TYPES.has(typed.type)) return {
|
|
3904
|
-
ok: false,
|
|
3905
|
-
reason: "invalid_type"
|
|
3906
|
-
};
|
|
3907
|
-
const provider = typed.provider ?? fallbackProvider;
|
|
3908
|
-
if (typeof provider !== "string" || provider.trim().length === 0) return {
|
|
3909
|
-
ok: false,
|
|
3910
|
-
reason: "missing_provider"
|
|
3911
|
-
};
|
|
3912
|
-
return {
|
|
3913
|
-
ok: true,
|
|
3914
|
-
credential: {
|
|
3915
|
-
...typed,
|
|
3916
|
-
provider
|
|
3917
|
-
}
|
|
3918
|
-
};
|
|
3919
|
-
}
|
|
3920
|
-
function warnRejectedCredentialEntries(source, rejected) {
|
|
3921
|
-
if (rejected.length === 0) return;
|
|
3922
|
-
const reasons = rejected.reduce((acc, current) => {
|
|
3923
|
-
acc[current.reason] = (acc[current.reason] ?? 0) + 1;
|
|
3924
|
-
return acc;
|
|
3925
|
-
}, {});
|
|
3926
|
-
log$7.warn("ignored invalid auth profile entries during store load", {
|
|
3927
|
-
source,
|
|
3928
|
-
dropped: rejected.length,
|
|
3929
|
-
reasons,
|
|
3930
|
-
keys: rejected.slice(0, 10).map((entry) => entry.key)
|
|
3931
|
-
});
|
|
3932
|
-
}
|
|
3933
|
-
function coerceLegacyStore(raw) {
|
|
3934
|
-
if (!raw || typeof raw !== "object") return null;
|
|
3935
|
-
const record = raw;
|
|
3936
|
-
if ("profiles" in record) return null;
|
|
3937
|
-
const entries = {};
|
|
3938
|
-
const rejected = [];
|
|
3939
|
-
for (const [key, value] of Object.entries(record)) {
|
|
3940
|
-
const parsed = parseCredentialEntry(value, key);
|
|
3941
|
-
if (!parsed.ok) {
|
|
3942
|
-
rejected.push({
|
|
3943
|
-
key,
|
|
3944
|
-
reason: parsed.reason
|
|
3945
|
-
});
|
|
3946
|
-
continue;
|
|
3947
|
-
}
|
|
3948
|
-
entries[key] = parsed.credential;
|
|
3949
|
-
}
|
|
3950
|
-
warnRejectedCredentialEntries("auth.json", rejected);
|
|
3951
|
-
return Object.keys(entries).length > 0 ? entries : null;
|
|
3952
|
-
}
|
|
3953
|
-
function coerceAuthStore(raw) {
|
|
3954
|
-
if (!raw || typeof raw !== "object") return null;
|
|
3955
|
-
const record = raw;
|
|
3956
|
-
if (!record.profiles || typeof record.profiles !== "object") return null;
|
|
3957
|
-
const profiles = record.profiles;
|
|
3958
|
-
const normalized = {};
|
|
3959
|
-
const rejected = [];
|
|
3960
|
-
for (const [key, value] of Object.entries(profiles)) {
|
|
3961
|
-
const parsed = parseCredentialEntry(value);
|
|
3962
|
-
if (!parsed.ok) {
|
|
3963
|
-
rejected.push({
|
|
3964
|
-
key,
|
|
3965
|
-
reason: parsed.reason
|
|
3966
|
-
});
|
|
3967
|
-
continue;
|
|
3968
|
-
}
|
|
3969
|
-
normalized[key] = parsed.credential;
|
|
3970
|
-
}
|
|
3971
|
-
warnRejectedCredentialEntries("auth-profiles.json", rejected);
|
|
3972
|
-
const order = record.order && typeof record.order === "object" ? Object.entries(record.order).reduce((acc, [provider, value]) => {
|
|
3973
|
-
if (!Array.isArray(value)) return acc;
|
|
3974
|
-
const list = value.map((entry) => typeof entry === "string" ? entry.trim() : "").filter(Boolean);
|
|
3975
|
-
if (list.length === 0) return acc;
|
|
3976
|
-
acc[provider] = list;
|
|
3977
|
-
return acc;
|
|
3978
|
-
}, {}) : void 0;
|
|
3979
|
-
return {
|
|
3980
|
-
version: Number(record.version ?? AUTH_STORE_VERSION),
|
|
3981
|
-
profiles: normalized,
|
|
3982
|
-
order,
|
|
3983
|
-
lastGood: record.lastGood && typeof record.lastGood === "object" ? record.lastGood : void 0,
|
|
3984
|
-
usageStats: record.usageStats && typeof record.usageStats === "object" ? record.usageStats : void 0
|
|
3985
|
-
};
|
|
3986
|
-
}
|
|
3987
|
-
function mergeRecord(base, override) {
|
|
3988
|
-
if (!base && !override) return;
|
|
3989
|
-
if (!base) return { ...override };
|
|
3990
|
-
if (!override) return { ...base };
|
|
3991
|
-
return {
|
|
3992
|
-
...base,
|
|
3993
|
-
...override
|
|
3994
|
-
};
|
|
3995
|
-
}
|
|
3996
|
-
function mergeAuthProfileStores(base, override) {
|
|
3997
|
-
if (Object.keys(override.profiles).length === 0 && !override.order && !override.lastGood && !override.usageStats) return base;
|
|
3998
|
-
return {
|
|
3999
|
-
version: Math.max(base.version, override.version ?? base.version),
|
|
4000
|
-
profiles: {
|
|
4001
|
-
...base.profiles,
|
|
4002
|
-
...override.profiles
|
|
4003
|
-
},
|
|
4004
|
-
order: mergeRecord(base.order, override.order),
|
|
4005
|
-
lastGood: mergeRecord(base.lastGood, override.lastGood),
|
|
4006
|
-
usageStats: mergeRecord(base.usageStats, override.usageStats)
|
|
4007
|
-
};
|
|
4008
|
-
}
|
|
4009
|
-
function mergeOAuthFileIntoStore(store) {
|
|
4010
|
-
const oauthRaw = loadJsonFile(resolveOAuthPath());
|
|
4011
|
-
if (!oauthRaw || typeof oauthRaw !== "object") return false;
|
|
4012
|
-
const oauthEntries = oauthRaw;
|
|
4013
|
-
let mutated = false;
|
|
4014
|
-
for (const [provider, creds] of Object.entries(oauthEntries)) {
|
|
4015
|
-
if (!creds || typeof creds !== "object") continue;
|
|
4016
|
-
const profileId = `${provider}:default`;
|
|
4017
|
-
if (store.profiles[profileId]) continue;
|
|
4018
|
-
store.profiles[profileId] = {
|
|
4019
|
-
type: "oauth",
|
|
4020
|
-
provider,
|
|
4021
|
-
...creds
|
|
4022
|
-
};
|
|
4023
|
-
mutated = true;
|
|
4024
|
-
}
|
|
4025
|
-
return mutated;
|
|
4026
|
-
}
|
|
4027
|
-
function applyLegacyStore(store, legacy) {
|
|
4028
|
-
for (const [provider, cred] of Object.entries(legacy)) {
|
|
4029
|
-
const profileId = `${provider}:default`;
|
|
4030
|
-
if (cred.type === "api_key") {
|
|
4031
|
-
store.profiles[profileId] = {
|
|
4032
|
-
type: "api_key",
|
|
4033
|
-
provider: String(cred.provider ?? provider),
|
|
4034
|
-
key: cred.key,
|
|
4035
|
-
...cred.email ? { email: cred.email } : {}
|
|
4036
|
-
};
|
|
4037
|
-
continue;
|
|
4038
|
-
}
|
|
4039
|
-
if (cred.type === "token") {
|
|
4040
|
-
store.profiles[profileId] = {
|
|
4041
|
-
type: "token",
|
|
4042
|
-
provider: String(cred.provider ?? provider),
|
|
4043
|
-
token: cred.token,
|
|
4044
|
-
...typeof cred.expires === "number" ? { expires: cred.expires } : {},
|
|
4045
|
-
...cred.email ? { email: cred.email } : {}
|
|
4046
|
-
};
|
|
4047
|
-
continue;
|
|
4048
|
-
}
|
|
4049
|
-
store.profiles[profileId] = {
|
|
4050
|
-
type: "oauth",
|
|
4051
|
-
provider: String(cred.provider ?? provider),
|
|
4052
|
-
access: cred.access,
|
|
4053
|
-
refresh: cred.refresh,
|
|
4054
|
-
expires: cred.expires,
|
|
4055
|
-
...cred.enterpriseUrl ? { enterpriseUrl: cred.enterpriseUrl } : {},
|
|
4056
|
-
...cred.projectId ? { projectId: cred.projectId } : {},
|
|
4057
|
-
...cred.accountId ? { accountId: cred.accountId } : {},
|
|
4058
|
-
...cred.email ? { email: cred.email } : {}
|
|
4059
|
-
};
|
|
4060
|
-
}
|
|
4061
|
-
}
|
|
4062
|
-
function loadCoercedStore(authPath) {
|
|
4063
|
-
return coerceAuthStore(loadJsonFile(authPath));
|
|
4064
|
-
}
|
|
4065
|
-
function loadAuthProfileStore() {
|
|
4066
|
-
const authPath = resolveAuthStorePath();
|
|
4067
|
-
const asStore = loadCoercedStore(authPath);
|
|
4068
|
-
if (asStore) {
|
|
4069
|
-
if (syncExternalCliCredentials(asStore)) saveJsonFile(authPath, asStore);
|
|
4070
|
-
return asStore;
|
|
4071
|
-
}
|
|
4072
|
-
const legacy = coerceLegacyStore(loadJsonFile(resolveLegacyAuthStorePath()));
|
|
4073
|
-
if (legacy) {
|
|
4074
|
-
const store = {
|
|
4075
|
-
version: AUTH_STORE_VERSION,
|
|
4076
|
-
profiles: {}
|
|
4077
|
-
};
|
|
4078
|
-
applyLegacyStore(store, legacy);
|
|
4079
|
-
syncExternalCliCredentials(store);
|
|
4080
|
-
return store;
|
|
4081
|
-
}
|
|
4082
|
-
const store = {
|
|
4083
|
-
version: AUTH_STORE_VERSION,
|
|
4084
|
-
profiles: {}
|
|
4085
|
-
};
|
|
4086
|
-
syncExternalCliCredentials(store);
|
|
4087
|
-
return store;
|
|
4088
|
-
}
|
|
4089
|
-
function loadAuthProfileStoreForAgent(agentDir, options) {
|
|
4090
|
-
const readOnly = options?.readOnly === true;
|
|
4091
|
-
const authPath = resolveAuthStorePath(agentDir);
|
|
4092
|
-
const asStore = loadCoercedStore(authPath);
|
|
4093
|
-
if (asStore) {
|
|
4094
|
-
if (syncExternalCliCredentials(asStore) && !readOnly) saveJsonFile(authPath, asStore);
|
|
4095
|
-
return asStore;
|
|
4096
|
-
}
|
|
4097
|
-
if (agentDir && !readOnly) {
|
|
4098
|
-
const mainStore = coerceAuthStore(loadJsonFile(resolveAuthStorePath()));
|
|
4099
|
-
if (mainStore && Object.keys(mainStore.profiles).length > 0) {
|
|
4100
|
-
saveJsonFile(authPath, mainStore);
|
|
4101
|
-
log$7.info("inherited auth-profiles from main agent", { agentDir });
|
|
4102
|
-
return mainStore;
|
|
4103
|
-
}
|
|
4104
|
-
}
|
|
4105
|
-
const legacy = coerceLegacyStore(loadJsonFile(resolveLegacyAuthStorePath(agentDir)));
|
|
4106
|
-
const store = {
|
|
4107
|
-
version: AUTH_STORE_VERSION,
|
|
4108
|
-
profiles: {}
|
|
4109
|
-
};
|
|
4110
|
-
if (legacy) applyLegacyStore(store, legacy);
|
|
4111
|
-
const mergedOAuth = mergeOAuthFileIntoStore(store);
|
|
4112
|
-
const syncedCli = syncExternalCliCredentials(store);
|
|
4113
|
-
const forceReadOnly = process.env.OPENCLAW_AUTH_STORE_READONLY === "1";
|
|
4114
|
-
const shouldWrite = !readOnly && !forceReadOnly && (legacy !== null || mergedOAuth || syncedCli);
|
|
4115
|
-
if (shouldWrite) saveJsonFile(authPath, store);
|
|
4116
|
-
if (shouldWrite && legacy !== null) {
|
|
4117
|
-
const legacyPath = resolveLegacyAuthStorePath(agentDir);
|
|
4118
|
-
try {
|
|
4119
|
-
fs.unlinkSync(legacyPath);
|
|
4120
|
-
} catch (err) {
|
|
4121
|
-
if (err?.code !== "ENOENT") log$7.warn("failed to delete legacy auth.json after migration", {
|
|
4122
|
-
err,
|
|
4123
|
-
legacyPath
|
|
4124
|
-
});
|
|
4125
|
-
}
|
|
4126
|
-
}
|
|
4127
|
-
return store;
|
|
4128
|
-
}
|
|
4129
|
-
function loadAuthProfileStoreForRuntime(agentDir, options) {
|
|
4130
|
-
const store = loadAuthProfileStoreForAgent(agentDir, options);
|
|
4131
|
-
const authPath = resolveAuthStorePath(agentDir);
|
|
4132
|
-
const mainAuthPath = resolveAuthStorePath();
|
|
4133
|
-
if (!agentDir || authPath === mainAuthPath) return store;
|
|
4134
|
-
return mergeAuthProfileStores(loadAuthProfileStoreForAgent(void 0, options), store);
|
|
4135
|
-
}
|
|
4136
|
-
function loadAuthProfileStoreForSecretsRuntime(agentDir) {
|
|
4137
|
-
return loadAuthProfileStoreForRuntime(agentDir, {
|
|
4138
|
-
readOnly: true,
|
|
4139
|
-
allowKeychainPrompt: false
|
|
4140
|
-
});
|
|
4141
|
-
}
|
|
4142
|
-
function ensureAuthProfileStore(agentDir, options) {
|
|
4143
|
-
const runtimeStore = resolveRuntimeAuthProfileStore(agentDir);
|
|
4144
|
-
if (runtimeStore) return runtimeStore;
|
|
4145
|
-
const store = loadAuthProfileStoreForAgent(agentDir, options);
|
|
4146
|
-
const authPath = resolveAuthStorePath(agentDir);
|
|
4147
|
-
const mainAuthPath = resolveAuthStorePath();
|
|
4148
|
-
if (!agentDir || authPath === mainAuthPath) return store;
|
|
4149
|
-
return mergeAuthProfileStores(loadAuthProfileStoreForAgent(void 0, options), store);
|
|
4150
|
-
}
|
|
4151
|
-
function saveAuthProfileStore(store, agentDir) {
|
|
4152
|
-
saveJsonFile(resolveAuthStorePath(agentDir), {
|
|
4153
|
-
version: AUTH_STORE_VERSION,
|
|
4154
|
-
profiles: Object.fromEntries(Object.entries(store.profiles).map(([profileId, credential]) => {
|
|
4155
|
-
if (credential.type === "api_key" && credential.keyRef && credential.key !== void 0) {
|
|
4156
|
-
const sanitized = { ...credential };
|
|
4157
|
-
delete sanitized.key;
|
|
4158
|
-
return [profileId, sanitized];
|
|
4159
|
-
}
|
|
4160
|
-
if (credential.type === "token" && credential.tokenRef && credential.token !== void 0) {
|
|
4161
|
-
const sanitized = { ...credential };
|
|
4162
|
-
delete sanitized.token;
|
|
4163
|
-
return [profileId, sanitized];
|
|
4164
|
-
}
|
|
4165
|
-
return [profileId, credential];
|
|
4166
|
-
})),
|
|
4167
|
-
order: store.order ?? void 0,
|
|
4168
|
-
lastGood: store.lastGood ?? void 0,
|
|
4169
|
-
usageStats: store.usageStats ?? void 0
|
|
4170
|
-
});
|
|
4171
|
-
}
|
|
4172
|
-
|
|
4173
3497
|
//#endregion
|
|
4174
3498
|
//#region src/agents/auth-profiles/profiles.ts
|
|
4175
3499
|
function dedupeProfileIds(profileIds) {
|
|
@@ -9186,207 +8510,6 @@ function isSupportedLocalAvatarExtension(filePath) {
|
|
|
9186
8510
|
return LOCAL_AVATAR_EXTENSIONS.has(ext);
|
|
9187
8511
|
}
|
|
9188
8512
|
|
|
9189
|
-
//#endregion
|
|
9190
|
-
//#region src/shared/net/ip.ts
|
|
9191
|
-
const BLOCKED_IPV4_SPECIAL_USE_RANGES = new Set([
|
|
9192
|
-
"unspecified",
|
|
9193
|
-
"broadcast",
|
|
9194
|
-
"multicast",
|
|
9195
|
-
"linkLocal",
|
|
9196
|
-
"loopback",
|
|
9197
|
-
"carrierGradeNat",
|
|
9198
|
-
"private",
|
|
9199
|
-
"reserved"
|
|
9200
|
-
]);
|
|
9201
|
-
const PRIVATE_OR_LOOPBACK_IPV4_RANGES = new Set([
|
|
9202
|
-
"loopback",
|
|
9203
|
-
"private",
|
|
9204
|
-
"linkLocal",
|
|
9205
|
-
"carrierGradeNat"
|
|
9206
|
-
]);
|
|
9207
|
-
const BLOCKED_IPV6_SPECIAL_USE_RANGES = new Set([
|
|
9208
|
-
"unspecified",
|
|
9209
|
-
"loopback",
|
|
9210
|
-
"linkLocal",
|
|
9211
|
-
"uniqueLocal",
|
|
9212
|
-
"multicast"
|
|
9213
|
-
]);
|
|
9214
|
-
const RFC2544_BENCHMARK_PREFIX = [ipaddr.IPv4.parse("198.18.0.0"), 15];
|
|
9215
|
-
const EMBEDDED_IPV4_SENTINEL_RULES = [
|
|
9216
|
-
{
|
|
9217
|
-
matches: (parts) => parts[0] === 0 && parts[1] === 0 && parts[2] === 0 && parts[3] === 0 && parts[4] === 0 && parts[5] === 0,
|
|
9218
|
-
toHextets: (parts) => [parts[6], parts[7]]
|
|
9219
|
-
},
|
|
9220
|
-
{
|
|
9221
|
-
matches: (parts) => parts[0] === 100 && parts[1] === 65435 && parts[2] === 1 && parts[3] === 0 && parts[4] === 0 && parts[5] === 0,
|
|
9222
|
-
toHextets: (parts) => [parts[6], parts[7]]
|
|
9223
|
-
},
|
|
9224
|
-
{
|
|
9225
|
-
matches: (parts) => parts[0] === 8194,
|
|
9226
|
-
toHextets: (parts) => [parts[1], parts[2]]
|
|
9227
|
-
},
|
|
9228
|
-
{
|
|
9229
|
-
matches: (parts) => parts[0] === 8193 && parts[1] === 0,
|
|
9230
|
-
toHextets: (parts) => [parts[6] ^ 65535, parts[7] ^ 65535]
|
|
9231
|
-
},
|
|
9232
|
-
{
|
|
9233
|
-
matches: (parts) => (parts[4] & 64767) === 0 && parts[5] === 24318,
|
|
9234
|
-
toHextets: (parts) => [parts[6], parts[7]]
|
|
9235
|
-
}
|
|
9236
|
-
];
|
|
9237
|
-
function stripIpv6Brackets(value) {
|
|
9238
|
-
if (value.startsWith("[") && value.endsWith("]")) return value.slice(1, -1);
|
|
9239
|
-
return value;
|
|
9240
|
-
}
|
|
9241
|
-
function isNumericIpv4LiteralPart(value) {
|
|
9242
|
-
return /^[0-9]+$/.test(value) || /^0x[0-9a-f]+$/i.test(value);
|
|
9243
|
-
}
|
|
9244
|
-
function parseIpv6WithEmbeddedIpv4(raw) {
|
|
9245
|
-
if (!raw.includes(":") || !raw.includes(".")) return;
|
|
9246
|
-
const match = /^(.*:)([^:%]+(?:\.[^:%]+){3})(%[0-9A-Za-z]+)?$/i.exec(raw);
|
|
9247
|
-
if (!match) return;
|
|
9248
|
-
const [, prefix, embeddedIpv4, zoneSuffix = ""] = match;
|
|
9249
|
-
if (!ipaddr.IPv4.isValidFourPartDecimal(embeddedIpv4)) return;
|
|
9250
|
-
const octets = embeddedIpv4.split(".").map((part) => Number.parseInt(part, 10));
|
|
9251
|
-
const normalizedIpv6 = `${prefix}${(octets[0] << 8 | octets[1]).toString(16)}:${(octets[2] << 8 | octets[3]).toString(16)}${zoneSuffix}`;
|
|
9252
|
-
if (!ipaddr.IPv6.isValid(normalizedIpv6)) return;
|
|
9253
|
-
return ipaddr.IPv6.parse(normalizedIpv6);
|
|
9254
|
-
}
|
|
9255
|
-
function isIpv4Address(address) {
|
|
9256
|
-
return address.kind() === "ipv4";
|
|
9257
|
-
}
|
|
9258
|
-
function isIpv6Address(address) {
|
|
9259
|
-
return address.kind() === "ipv6";
|
|
9260
|
-
}
|
|
9261
|
-
function normalizeIpv4MappedAddress(address) {
|
|
9262
|
-
if (!isIpv6Address(address)) return address;
|
|
9263
|
-
if (!address.isIPv4MappedAddress()) return address;
|
|
9264
|
-
return address.toIPv4Address();
|
|
9265
|
-
}
|
|
9266
|
-
function parseCanonicalIpAddress(raw) {
|
|
9267
|
-
const trimmed = raw?.trim();
|
|
9268
|
-
if (!trimmed) return;
|
|
9269
|
-
const normalized = stripIpv6Brackets(trimmed);
|
|
9270
|
-
if (!normalized) return;
|
|
9271
|
-
if (ipaddr.IPv4.isValid(normalized)) {
|
|
9272
|
-
if (!ipaddr.IPv4.isValidFourPartDecimal(normalized)) return;
|
|
9273
|
-
return ipaddr.IPv4.parse(normalized);
|
|
9274
|
-
}
|
|
9275
|
-
if (ipaddr.IPv6.isValid(normalized)) return ipaddr.IPv6.parse(normalized);
|
|
9276
|
-
return parseIpv6WithEmbeddedIpv4(normalized);
|
|
9277
|
-
}
|
|
9278
|
-
function parseLooseIpAddress(raw) {
|
|
9279
|
-
const trimmed = raw?.trim();
|
|
9280
|
-
if (!trimmed) return;
|
|
9281
|
-
const normalized = stripIpv6Brackets(trimmed);
|
|
9282
|
-
if (!normalized) return;
|
|
9283
|
-
if (ipaddr.isValid(normalized)) return ipaddr.parse(normalized);
|
|
9284
|
-
return parseIpv6WithEmbeddedIpv4(normalized);
|
|
9285
|
-
}
|
|
9286
|
-
function normalizeIpAddress(raw) {
|
|
9287
|
-
const parsed = parseCanonicalIpAddress(raw);
|
|
9288
|
-
if (!parsed) return;
|
|
9289
|
-
return normalizeIpv4MappedAddress(parsed).toString().toLowerCase();
|
|
9290
|
-
}
|
|
9291
|
-
function isCanonicalDottedDecimalIPv4(raw) {
|
|
9292
|
-
const trimmed = raw?.trim();
|
|
9293
|
-
if (!trimmed) return false;
|
|
9294
|
-
const normalized = stripIpv6Brackets(trimmed);
|
|
9295
|
-
if (!normalized) return false;
|
|
9296
|
-
return ipaddr.IPv4.isValidFourPartDecimal(normalized);
|
|
9297
|
-
}
|
|
9298
|
-
function isLegacyIpv4Literal(raw) {
|
|
9299
|
-
const trimmed = raw?.trim();
|
|
9300
|
-
if (!trimmed) return false;
|
|
9301
|
-
const normalized = stripIpv6Brackets(trimmed);
|
|
9302
|
-
if (!normalized || normalized.includes(":")) return false;
|
|
9303
|
-
if (isCanonicalDottedDecimalIPv4(normalized)) return false;
|
|
9304
|
-
const parts = normalized.split(".");
|
|
9305
|
-
if (parts.length === 0 || parts.length > 4) return false;
|
|
9306
|
-
if (parts.some((part) => part.length === 0)) return false;
|
|
9307
|
-
if (!parts.every((part) => isNumericIpv4LiteralPart(part))) return false;
|
|
9308
|
-
return true;
|
|
9309
|
-
}
|
|
9310
|
-
function isLoopbackIpAddress(raw) {
|
|
9311
|
-
const parsed = parseCanonicalIpAddress(raw);
|
|
9312
|
-
if (!parsed) return false;
|
|
9313
|
-
return normalizeIpv4MappedAddress(parsed).range() === "loopback";
|
|
9314
|
-
}
|
|
9315
|
-
function isPrivateOrLoopbackIpAddress(raw) {
|
|
9316
|
-
const parsed = parseCanonicalIpAddress(raw);
|
|
9317
|
-
if (!parsed) return false;
|
|
9318
|
-
const normalized = normalizeIpv4MappedAddress(parsed);
|
|
9319
|
-
if (isIpv4Address(normalized)) return PRIVATE_OR_LOOPBACK_IPV4_RANGES.has(normalized.range());
|
|
9320
|
-
return isBlockedSpecialUseIpv6Address(normalized);
|
|
9321
|
-
}
|
|
9322
|
-
function isBlockedSpecialUseIpv6Address(address) {
|
|
9323
|
-
if (BLOCKED_IPV6_SPECIAL_USE_RANGES.has(address.range())) return true;
|
|
9324
|
-
return (address.parts[0] & 65472) === 65216;
|
|
9325
|
-
}
|
|
9326
|
-
function isRfc1918Ipv4Address(raw) {
|
|
9327
|
-
const parsed = parseCanonicalIpAddress(raw);
|
|
9328
|
-
if (!parsed || !isIpv4Address(parsed)) return false;
|
|
9329
|
-
return parsed.range() === "private";
|
|
9330
|
-
}
|
|
9331
|
-
function isCarrierGradeNatIpv4Address(raw) {
|
|
9332
|
-
const parsed = parseCanonicalIpAddress(raw);
|
|
9333
|
-
if (!parsed || !isIpv4Address(parsed)) return false;
|
|
9334
|
-
return parsed.range() === "carrierGradeNat";
|
|
9335
|
-
}
|
|
9336
|
-
function isBlockedSpecialUseIpv4Address(address, options = {}) {
|
|
9337
|
-
const inRfc2544BenchmarkRange = address.match(RFC2544_BENCHMARK_PREFIX);
|
|
9338
|
-
if (inRfc2544BenchmarkRange && options.allowRfc2544BenchmarkRange === true) return false;
|
|
9339
|
-
return BLOCKED_IPV4_SPECIAL_USE_RANGES.has(address.range()) || inRfc2544BenchmarkRange;
|
|
9340
|
-
}
|
|
9341
|
-
function decodeIpv4FromHextets(high, low) {
|
|
9342
|
-
const octets = [
|
|
9343
|
-
high >>> 8 & 255,
|
|
9344
|
-
high & 255,
|
|
9345
|
-
low >>> 8 & 255,
|
|
9346
|
-
low & 255
|
|
9347
|
-
];
|
|
9348
|
-
return ipaddr.IPv4.parse(octets.join("."));
|
|
9349
|
-
}
|
|
9350
|
-
function extractEmbeddedIpv4FromIpv6(address) {
|
|
9351
|
-
if (address.isIPv4MappedAddress()) return address.toIPv4Address();
|
|
9352
|
-
if (address.range() === "rfc6145") return decodeIpv4FromHextets(address.parts[6], address.parts[7]);
|
|
9353
|
-
if (address.range() === "rfc6052") return decodeIpv4FromHextets(address.parts[6], address.parts[7]);
|
|
9354
|
-
for (const rule of EMBEDDED_IPV4_SENTINEL_RULES) {
|
|
9355
|
-
if (!rule.matches(address.parts)) continue;
|
|
9356
|
-
const [high, low] = rule.toHextets(address.parts);
|
|
9357
|
-
return decodeIpv4FromHextets(high, low);
|
|
9358
|
-
}
|
|
9359
|
-
}
|
|
9360
|
-
function isIpInCidr(ip, cidr) {
|
|
9361
|
-
const normalizedIp = parseCanonicalIpAddress(ip);
|
|
9362
|
-
if (!normalizedIp) return false;
|
|
9363
|
-
const candidate = cidr.trim();
|
|
9364
|
-
if (!candidate) return false;
|
|
9365
|
-
const comparableIp = normalizeIpv4MappedAddress(normalizedIp);
|
|
9366
|
-
if (!candidate.includes("/")) {
|
|
9367
|
-
const exact = parseCanonicalIpAddress(candidate);
|
|
9368
|
-
if (!exact) return false;
|
|
9369
|
-
const comparableExact = normalizeIpv4MappedAddress(exact);
|
|
9370
|
-
return comparableIp.kind() === comparableExact.kind() && comparableIp.toString() === comparableExact.toString();
|
|
9371
|
-
}
|
|
9372
|
-
let parsedCidr;
|
|
9373
|
-
try {
|
|
9374
|
-
parsedCidr = ipaddr.parseCIDR(candidate);
|
|
9375
|
-
} catch {
|
|
9376
|
-
return false;
|
|
9377
|
-
}
|
|
9378
|
-
const [baseAddress, prefixLength] = parsedCidr;
|
|
9379
|
-
const comparableBase = normalizeIpv4MappedAddress(baseAddress);
|
|
9380
|
-
if (comparableIp.kind() !== comparableBase.kind()) return false;
|
|
9381
|
-
try {
|
|
9382
|
-
if (isIpv4Address(comparableIp) && isIpv4Address(comparableBase)) return comparableIp.match([comparableBase, prefixLength]);
|
|
9383
|
-
if (isIpv6Address(comparableIp) && isIpv6Address(comparableBase)) return comparableIp.match([comparableBase, prefixLength]);
|
|
9384
|
-
return false;
|
|
9385
|
-
} catch {
|
|
9386
|
-
return false;
|
|
9387
|
-
}
|
|
9388
|
-
}
|
|
9389
|
-
|
|
9390
8513
|
//#endregion
|
|
9391
8514
|
//#region src/cli/parse-bytes.ts
|
|
9392
8515
|
const UNIT_MULTIPLIERS = {
|
|
@@ -16022,7 +15145,7 @@ function adoptNewerMainOAuthCredential(params) {
|
|
|
16022
15145
|
if (mainCred?.type === "oauth" && mainCred.provider === params.cred.provider && Number.isFinite(mainCred.expires) && (!Number.isFinite(params.cred.expires) || mainCred.expires > params.cred.expires)) {
|
|
16023
15146
|
params.store.profiles[params.profileId] = { ...mainCred };
|
|
16024
15147
|
saveAuthProfileStore(params.store, params.agentDir);
|
|
16025
|
-
log$
|
|
15148
|
+
log$6.info("adopted newer OAuth credentials from main agent", {
|
|
16026
15149
|
profileId: params.profileId,
|
|
16027
15150
|
agentDir: params.agentDir,
|
|
16028
15151
|
expires: new Date(mainCred.expires).toISOString()
|
|
@@ -16030,7 +15153,7 @@ function adoptNewerMainOAuthCredential(params) {
|
|
|
16030
15153
|
return mainCred;
|
|
16031
15154
|
}
|
|
16032
15155
|
} catch (err) {
|
|
16033
|
-
log$
|
|
15156
|
+
log$6.debug("adoptNewerMainOAuthCredential failed", {
|
|
16034
15157
|
profileId: params.profileId,
|
|
16035
15158
|
error: err instanceof Error ? err.message : String(err)
|
|
16036
15159
|
});
|
|
@@ -16113,7 +15236,7 @@ async function resolveProfileSecretString(params) {
|
|
|
16113
15236
|
cache: params.cache
|
|
16114
15237
|
});
|
|
16115
15238
|
} catch (err) {
|
|
16116
|
-
log$
|
|
15239
|
+
log$6.debug(params.inlineFailureMessage, {
|
|
16117
15240
|
profileId: params.profileId,
|
|
16118
15241
|
provider: params.provider,
|
|
16119
15242
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -16128,7 +15251,7 @@ async function resolveProfileSecretString(params) {
|
|
|
16128
15251
|
cache: params.cache
|
|
16129
15252
|
});
|
|
16130
15253
|
} catch (err) {
|
|
16131
|
-
log$
|
|
15254
|
+
log$6.debug(params.refFailureMessage, {
|
|
16132
15255
|
profileId: params.profileId,
|
|
16133
15256
|
provider: params.provider,
|
|
16134
15257
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -16240,7 +15363,7 @@ async function resolveApiKeyForProfile(params) {
|
|
|
16240
15363
|
if (mainCred?.type === "oauth" && Date.now() < mainCred.expires) {
|
|
16241
15364
|
refreshedStore.profiles[profileId] = { ...mainCred };
|
|
16242
15365
|
saveAuthProfileStore(refreshedStore, params.agentDir);
|
|
16243
|
-
log$
|
|
15366
|
+
log$6.info("inherited fresh OAuth credentials from main agent", {
|
|
16244
15367
|
profileId,
|
|
16245
15368
|
agentDir: params.agentDir,
|
|
16246
15369
|
expires: new Date(mainCred.expires).toISOString()
|
|
@@ -16257,7 +15380,7 @@ async function resolveApiKeyForProfile(params) {
|
|
|
16257
15380
|
credentials: cred,
|
|
16258
15381
|
error
|
|
16259
15382
|
})) {
|
|
16260
|
-
log$
|
|
15383
|
+
log$6.warn("openai-codex oauth refresh failed; using cached access token fallback", {
|
|
16261
15384
|
profileId,
|
|
16262
15385
|
provider: cred.provider
|
|
16263
15386
|
});
|
|
@@ -16690,4 +15813,4 @@ function orderProfilesByMode(order, store) {
|
|
|
16690
15813
|
var auth_profiles_exports = /* @__PURE__ */ __exportAll({ ensureAuthProfileStore: () => ensureAuthProfileStore });
|
|
16691
15814
|
|
|
16692
15815
|
//#endregion
|
|
16693
|
-
export { mergeInboundPathRoots as $,
|
|
15816
|
+
export { mergeInboundPathRoots as $, resolveAllowlistModelKey as $n, discoverHuggingfaceModels as $r, isDispatchWrapperExecutable as $t, formatPermissionRemediation as A, resolveSubagentMaxConcurrent as An, SYNTHETIC_DEFAULT_MODEL_REF as Ar, getConfigValueAtPath as At, parseConfigJson5 as B, buildAllowedModelSet as Bn, getCustomProviderApiKey as Br, analyzeShellCommand as Bt, isNonEmptyString as C, INCLUDE_KEY as Cn, buildVeniceModelDefinition as Cr, resolveAvatarMime as Ct, writeTextFileAtomic as D, buildTalkConfigResponse as Dn, TOGETHER_MODEL_CATALOG as Dr, resetConfigOverrides as Dt, toDotPath as E, collectConfigServiceEnvVars as En, TOGETHER_BASE_URL as Er, getConfigOverrides as Et, config_exports as F, listProfilesForProvider as Fn, buildAssistantMessage$1 as Fr, isTrustedSafeBinPath as Ft, writeConfigFile as G, inferUniqueProviderFromConfiguredModels as Gn, resolveModelAuthMode as Gr, DEFAULT_SAFE_BINS as Gt, readConfigFileSnapshotForWrite as H, buildModelAliasIndex as Hn, resolveApiKeyForProvider as Hr, isWindowsPlatform as Ht, migrateLegacyConfig as I, markAuthProfileGood as In, buildAssistantMessageWithZeroUsage as Ir, listWritableExplicitTrustedSafeBinDirs as It, TELEGRAM_COMMAND_NAME_PATTERN as J, normalizeModelRef as Jn, resolveShellEnvFallbackTimeoutMs as Jr, resolveCommandResolutionFromArgv as Jt, validateConfigObjectWithPlugins as K, isCliProvider as Kn, getShellEnvAppliedKeys as Kr, matchAllowlist as Kt, clearRuntimeConfigSnapshot as L, setAuthProfileOrder as Ln, buildStreamErrorAssistantMessage as Lr, normalizeTrustedSafeBinDirs as Lt, safeStat as M, resolveOwnerDisplaySetting as Mn, buildSyntheticModelDefinition as Mr, setConfigValueAtPath as Mt, createIcaclsResetCommand as N, repairOAuthProfileIdMismatch as Nn, OLLAMA_NATIVE_BASE_URL as Nr, unsetConfigValueAtPath as Nt, encodeJsonPointerToken as O, DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH as On, buildTogetherModelDefinition as Or, setConfigOverride as Ot, formatIcaclsResetCommand as P, dedupeProfileIds as Pn, createOllamaStreamFn as Pr, getTrustedSafeBinDirs as Pt, isInboundPathAllowed as Q, resolveAllowedModelRef as Qn, buildHuggingfaceModelDefinition as Qr, hasEnvManipulationBeforeShellWrapper as Qt, createConfigIO as R, upsertAuthProfile as Rn, buildUsageWithNoCost as Rr, validateSafeBinArgv as Rt, describeUnknownError as S, resolveTelegramPreviewStreamMode as Sn, VENICE_MODEL_CATALOG as Sr, looksLikeAvatarPath as St, parseDotPath as T, applyConfigEnvVars as Tn, retryAsync as Tr, sanitizeTerminalText as Tt, resolveConfigSnapshotHash as U, findNormalizedProviderValue as Un, resolveAwsSdkEnvVarName as Ur, resolvePlannedSegmentArgv as Ut, readConfigFileSnapshot as V, buildConfiguredAllowlistKeys as Vn, requireApiKey as Vr, buildEnforcedShellCommand as Vt, setRuntimeConfigSnapshot as W, getModelRefStatus as Wn, resolveEnvApiKey as Wr, splitCommandChain as Wt, resolveTelegramCustomCommands as X, normalizeProviderId as Xn, HUGGINGFACE_BASE_URL as Xr, extractShellWrapperCommand as Xt, normalizeTelegramCommandName as Y, normalizeModelSelection as Yn, shouldEnableShellEnvFallback as Yr, resolveExecutableFromPathEnv as Yt, DEFAULT_IMESSAGE_ATTACHMENT_ROOTS as Z, parseModelRef as Zn, HUGGINGFACE_MODEL_CATALOG as Zr, extractShellWrapperInlineCommand as Zt, parseOAuthCallbackInput as _, formatSlackStreamingBooleanMigrationMessage as _n, resolveImplicitBedrockProvider as _r, isAvatarHttpUrl as _t, getSoonestCooldownExpiry as a, normalizeSecretInput as ai, POSIX_INLINE_COMMAND_FLAGS as an, resolveSubagentConfiguredModelSelection as ar, sensitive as at, resolveSecretRefValue as b, resolveSlackNativeStreaming as bn, VENICE_BASE_URL as br, isSupportedLocalAvatarExtension as bt, markAuthProfileUsed as c, splitTrailingAuthProfile as ci, splitShellArgs as cn, QIANFAN_BASE_URL as cr, resolveDefaultSecretProviderAlias as ct, resolveApiKeyForProfile as d, DEFAULT_PROVIDER as di, resolveSafeBinProfiles as dn, buildKilocodeProvider as dr, isDangerousNetworkMode as dt, isHuggingfacePolicyLocked as ei, isShellWrapperExecutable as en, resolveConfiguredModelRef as er, resolveIMessageAttachmentRoots as et, evaluateStoredCredentialEligibility as f, resolveAuthProfileDisplayLabel as fi, applyMergePatch as fn, buildKimiCodingProvider as fr, normalizeNetworkMode as ft, generateChutesPkce as g, formatSlackStreamModeMigrationMessage as gn, normalizeProviders as gr, isAvatarDataUrl as gt, exchangeChutesCodeForTokens as h, isSafeExecutableValue as hn, normalizeGoogleModelId as hr, AVATAR_MAX_BYTES as ht, clearExpiredCooldowns as i, normalizeOptionalSecretInput as ii, unwrapKnownShellMultiplexerInvocation as in, resolveReasoningDefault as ir, SecretProviderSchema as it, inspectPathPermissions as j, loadDotEnv as jn, SYNTHETIC_MODEL_CATALOG as jr, parseConfigPath as jt, formatPermissionDetail as k, resolveAgentMaxConcurrent as kn, SYNTHETIC_BASE_URL as kr, unsetConfigOverride as kt, resolveProfileUnusableUntilForDisplay as l, DEFAULT_CONTEXT_TOKENS as li, SAFE_BIN_PROFILES as ln, QIANFAN_DEFAULT_MODEL_ID as lr, secretRefKey as lt, CHUTES_AUTHORIZE_ENDPOINT as m, ensureControlUiAllowedOriginsForNonLoopbackBind as mn, buildXiaomiProvider as mr, parseByteSize as mt, resolveAuthProfileEligibility as n, buildCloudflareAiGatewayModelDefinition as ni, unwrapDispatchWrappersForResolution as nn, resolveHooksGmailModel as nr, normalizeScpRemoteHost as nt, isProfileInCooldown as o, KILOCODE_BASE_URL as oi, POWERSHELL_INLINE_COMMAND_FLAGS as on, resolveSubagentSpawnModelSelection as or, isValidFileSecretRefId as ot, resolveTokenExpiryState as p, applyLegacyMigrations as pn, buildQianfanProvider as pr, parseDurationMs as pt, BotSchema as q, modelKey as qn, getShellPathFromLoginShell as qr, resolveAllowlistCandidatePath as qt, resolveAuthProfileOrder as r, resolveCloudflareAiGatewayBaseUrl as ri, unwrapKnownDispatchWrapperInvocation as rn, resolveModelRefFromString as rr, parseNonNegativeByteSize as rt, markAuthProfileFailure as s, KILOCODE_DEFAULT_MODEL_REF as si, resolveInlineCommandMatch as sn, resolveThinkingDefault as sr, isValidSecretProviderAlias as st, auth_profiles_exports as t, CLOUDFLARE_AI_GATEWAY_DEFAULT_MODEL_REF as ti, normalizeExecutableToken as tn, resolveDefaultModelForAgent as tr, resolveIMessageRemoteAttachmentRoots as tt, resolveProfilesUnavailableReason as u, DEFAULT_MODEL as ui, normalizeSafeBinProfileFixtures as un, XIAOMI_DEFAULT_MODEL_ID as ur, getBlockedNetworkModeReason as ut, isProviderScopedSecretResolutionError as v, mapStreamingModeToSlackLegacyDraftStreamMode as vn, resolveImplicitCopilotProvider as vr, isAvatarImageDataUrl as vt, isRecord as w, MAX_INCLUDE_DEPTH as wn, resolveRetryConfig as wr, validateJsonSchemaValue as wt, resolveSecretRefValues as x, resolveSlackStreamingMode as xn, VENICE_DEFAULT_MODEL_REF as xr, isWorkspaceRelativeAvatarPath as xt, resolveSecretRefString as y, resolveDiscordPreviewStreamMode as yn, resolveImplicitProviders as yr, isPathWithinRoot as yt, loadConfig as z, upsertAuthProfileWithLock as zn, getApiKeyForModel as zr, analyzeArgvCommand as zt };
|