activeclaw 2026.2.11 → 2026.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +106 -0
- package/dist/{accounts-DbzMEfKN.js → accounts-DCDeFTra.js} +2 -2
- package/dist/{accounts-C2elk6PC.js → accounts-DeqIQjo1.js} +2 -2
- package/dist/{acp-cli-CVFTdsQY.js → acp-cli-CeYI4XRd.js} +15 -16
- package/dist/{acp-cli-BpJwIyLl.js → acp-cli-rNbGXICg.js} +14 -15
- package/dist/{agent-Bz1r5O8q.js → agent-BvNJF5QL.js} +19 -15
- package/dist/{agent-22-R4bNS.js → agent-CyMxTyrG.js} +20 -16
- package/dist/{agent-scope-D8miw9q_.js → agent-scope-BIEhVP4_.js} +172 -4
- package/dist/{agent-scope-CGmuusG9.js → agent-scope-CQCus0rI.js} +3 -3
- package/dist/{agent-scope-DQuy3dwI.js → agent-scope-CsRbLH4l.js} +4 -4
- package/dist/{agent-scope-BEf5crnU.js → agent-scope-DPIFau3f.js} +5 -1
- package/dist/audio-preflight-BU8W7uxc.js +60 -0
- package/dist/audio-preflight-CGsumMzb.js +60 -0
- package/dist/audio-preflight-SLmkJI6-.js +74 -0
- package/dist/audio-preflight-jZc5mFCZ.js +71 -0
- package/dist/{audit-C4wLaF0D.js → audit-Dmww_503.js} +71 -19
- package/dist/{audit-CY-yopxa.js → audit-wPu26VMb.js} +72 -20
- package/dist/{tailscale-DU6DgqVy.js → auth-9x3lqfIY.js} +208 -3
- package/dist/{tailscale-Cu-2HNvU.js → auth-CQNl_IaI.js} +190 -3
- package/dist/{auth-health-BFKUoCwJ.js → auth-health-C4L4FGBA.js} +1 -1
- package/dist/{auth-health-d7BMZlWG.js → auth-health-j6epgQbq.js} +1 -1
- package/dist/{auth-profiles-Bv1AEm-Y.js → auth-profiles-ByNs3eEm.js} +87 -31
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +28 -22
- package/dist/bundled/session-memory/handler.js +33 -22
- package/dist/{call-7yrB6v4I.js → call-DVYCIV8m.js} +5 -5
- package/dist/{call-Bek1xlgk.js → call-SolyGS1r.js} +6 -6
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-3mdYN0C_.js → channel-options-BwC2yQcR.js} +4 -4
- package/dist/{channel-options-DJ0b1m7B.js → channel-options-Cq9BVDkP.js} +12 -7
- package/dist/{channel-selection-RZimme3j.js → channel-selection-D4D6ImhN.js} +2 -2
- package/dist/{channel-selection-B9b7Kuit.js → channel-selection-MZAHm4U8.js} +2 -2
- package/dist/{channels-cli-CYbK2Dku.js → channels-cli-9Dsk9Qm7.js} +57 -53
- package/dist/{channels-cli-BFznbGOs.js → channels-cli-BJUppQll.js} +59 -55
- package/dist/{channels-status-issues-B3KkflfR.js → channels-status-issues-D7GSV1GS.js} +1 -1
- package/dist/{channels-status-issues-DQkRaZts.js → channels-status-issues-DDAWeT-6.js} +1 -1
- package/dist/{chrome-Db7w64LF.js → chrome-BfB6JdKF.js} +4 -4
- package/dist/{chrome-Dm-EgOjJ.js → chrome-Cvr-57lg.js} +6 -5
- package/dist/{chrome-CF16STk9.js → chrome-DL0avO8n.js} +2 -1
- package/dist/{chrome-yIKmOzCO.js → chrome-foEwx3lN.js} +5 -4
- package/dist/{clack-prompter-BCiBkJVr.js → clack-prompter-Bz3Mmcl-.js} +5 -5
- package/dist/{clack-prompter-DuBVnTKy.js → clack-prompter-ChCGXfyt.js} +4 -4
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-Cl3PdJei.js → cli-ZR9ugUBX.js} +42 -38
- package/dist/cli-miPe4Ujz.js +93 -0
- package/dist/{client-6xKrRC-1.js → client-BrYfyoDK.js} +54 -5
- package/dist/{client-DMloFP_O.js → client-CTwXnRl7.js} +54 -5
- package/dist/{command-format-ayFsmwwz.js → command-format-Bxe0mWee.js} +1 -1
- package/dist/{command-options-BTAzyqqb.js → command-options-BvgxzPbK.js} +9 -4
- package/dist/{commands-CjEGXOZ_.js → commands-BX_OIIVR.js} +4 -4
- package/dist/{completion-cli-DrJGfJGl.js → completion-cli-CR77-jyv.js} +3 -3
- package/dist/{completion-cli-DOec3E2Z.js → completion-cli-DnjpxAag.js} +30 -30
- package/dist/{config-B00lvFac.js → config-Bdhomfei.js} +21 -7
- package/dist/{config-XBdA0ciN.js → config-BvMsmctM.js} +83 -9
- package/dist/{config-BqGVMf1y.js → config-QYrbd7x7.js} +60 -6
- package/dist/{config--NUdpACy.js → config-aFQssWKX.js} +21 -7
- package/dist/{config-guard-4kCO_rnQ.js → config-guard-CljaSxJd.js} +160 -51
- package/dist/{configure-B69emwZv.js → configure-BXLiucXo.js} +28 -25
- package/dist/{configure-sMhpLzFf.js → configure-BYPqXzGZ.js} +28 -25
- package/dist/control-auth-8Cf4WXpR.js +54 -0
- package/dist/control-auth-DBCu3qyv.js +54 -0
- package/dist/{control-service-Db_1V-KY.js → control-service-B5KnPqGP.js} +11 -5
- package/dist/{control-service-IRAmbcbN.js → control-service-DKnttEus.js} +10 -4
- package/dist/control-ui/assets/{index-CnB9IO4a.js → index-B4LPvte9.js} +369 -369
- package/dist/control-ui/assets/index-B4LPvte9.js.map +1 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/{cron-cli-Cum2324v.js → cron-cli-D7BRjDv2.js} +20 -20
- package/dist/{cron-cli-DhUWcYdk.js → cron-cli-z1zk_FXQ.js} +19 -19
- package/dist/{daemon-cli-q7nkEF5-.js → daemon-cli-BDkU2ocb.js} +60 -21
- package/dist/{daemon-cli-CTC2CHci.js → daemon-cli-cNSF93-v.js} +59 -20
- package/dist/{daemon-runtime-c0uXH4Dl.js → daemon-runtime-B0tg_LsX.js} +3 -3
- package/dist/{daemon-runtime-UsK-tOty.js → daemon-runtime-Bsjeut6m.js} +3 -3
- package/dist/{deliver-hf-WKyWd.js → deliver-CIU9Npgs.js} +373 -281
- package/dist/{deliver-CT6KiDqO.js → deliver-DYYCo1G7.js} +369 -278
- package/dist/{deliver-T9d44OpZ.js → deliver-LsxKETro.js} +371 -279
- package/dist/{deliver-CPy8jYj9.js → deliver-xUU3mGHo.js} +369 -277
- package/dist/{deps-Bv1kLtwo.js → deps-QSwGcoNZ.js} +2 -2
- package/dist/{deps-DFQdAWQc.js → deps-lAAA2zYI.js} +2 -2
- package/dist/{devices-cli-Cm7U1py9.js → devices-cli-BG3-2oqt.js} +14 -14
- package/dist/{devices-cli-ZpjlfK-e.js → devices-cli-VIQtOvt_.js} +14 -14
- package/dist/{directory-cli-B14TUSJA.js → directory-cli-BCJwjVC0.js} +16 -16
- package/dist/{directory-cli-67kzd4I5.js → directory-cli-jYzZ02gk.js} +14 -14
- package/dist/{dispatcher-3ElQWGVI.js → dispatcher-DY51b-Zc.js} +2 -2
- package/dist/{dns-cli-CU-xfhTN.js → dns-cli-DHIiMJjS.js} +12 -12
- package/dist/{dns-cli-Dqj7O6Q_.js → dns-cli-pZlv87Ib.js} +11 -11
- package/dist/{docs-cli-CamBqzb5.js → docs-cli-2JDiwfzP.js} +8 -8
- package/dist/{docs-cli-Cj3L5oqB.js → docs-cli-BhkYqoIQ.js} +7 -7
- package/dist/{doctor-BV1kvbMm.js → doctor-Bf8EhNtA.js} +36 -35
- package/dist/{doctor-BJirShBi.js → doctor-sYG5V4Co.js} +34 -33
- package/dist/entry.js +56 -18
- package/dist/{env-BxRc6wWv.js → env-ONzUVAG2.js} +1 -1
- package/dist/{exec-CijMSZd9.js → exec-B8lXct-k.js} +503 -14
- package/dist/{exec-B8JKbXKW.js → exec-CACT5OAW.js} +1 -1
- package/dist/{exec-57A8Rlc8.js → exec-CJFFoM7H.js} +32 -13
- package/dist/{exec-Cv_Ofd1m.js → exec-YIosokWE.js} +1 -1
- package/dist/{exec-approvals-cli-DEzz9Iai.js → exec-approvals-cli-7LH0lwhO.js} +21 -21
- package/dist/{exec-approvals-cli-DhXj3hQX.js → exec-approvals-cli-apGnQbpj.js} +21 -21
- package/dist/extensionAPI.js +7733 -8746
- package/dist/fetch-DmiOpALK.js +274 -0
- package/dist/fetch-timeout-BEtUjM1S.js +274 -0
- package/dist/fetch-timeout-DEoXG_SF.js +274 -0
- package/dist/fetch-timeout-DTK9vxex.js +274 -0
- package/dist/{gateway-cli-D1EdIq8I.js → gateway-cli-DUdYxlZS.js} +491 -136
- package/dist/{gateway-cli-B_xDUDy2.js → gateway-cli-DbvWmE-9.js} +495 -140
- package/dist/{gateway-rpc-3B5y445n.js → gateway-rpc-BByb2Snz.js} +3 -3
- package/dist/{gateway-rpc-BoL2vinh.js → gateway-rpc-wXSCUZXj.js} +3 -3
- package/dist/{github-copilot-auth-Omqrto0J.js → github-copilot-auth-D7ewvpMd.js} +205 -17
- package/dist/{github-copilot-auth-CZxurvdz.js → github-copilot-auth-DDispnyz.js} +205 -17
- package/dist/{github-copilot-token-SLWintYd.js → github-copilot-token-Cfs0Wxr8.js} +1 -1
- package/dist/{gmail-setup-utils-BXQKsLtI.js → gmail-setup-utils-Cfns8TQx.js} +3 -3
- package/dist/{gmail-setup-utils-CHcssBOA.js → gmail-setup-utils-DJb-_5kO.js} +4 -4
- package/dist/{health-format-Dy1caGsq.js → health-format-KGPokKJH.js} +97 -42
- package/dist/{health-format-DrGFg8bx.js → health-format-LZDxu3rv.js} +95 -40
- package/dist/{help-format-DAj7l5uV.js → help-format-C48TXngO.js} +1 -1
- package/dist/{help-format-CUnac_bT.js → help-format-R5fLToDw.js} +1 -1
- package/dist/{hooks-cli-ptEf6TIM.js → hooks-cli-CT8JCRkH.js} +51 -46
- package/dist/{hooks-cli-Bhf5VRp1.js → hooks-cli-S1MKumJO.js} +49 -44
- package/dist/{hooks-status-Br-2bK2G.js → hooks-status-Cw0xD8Lt.js} +3 -3
- package/dist/{hooks-status-DNQJSa4B.js → hooks-status-D9MhwHRp.js} +3 -3
- package/dist/{image-rOFfK3PJ.js → image-Brk1sJbw.js} +10 -7
- package/dist/{image-fUwR7slg.js → image-C4Nn2p3e.js} +10 -7
- package/dist/{image-Ds4NLGPR.js → image-DgtfXMcX.js} +9 -6
- package/dist/{image-Dnnxt82I.js → image-RKwc3fsL.js} +8 -5
- package/dist/index.js +208 -97
- package/dist/{installs-CRSjQxbR.js → installs-CrLcWYHe.js} +8 -7
- package/dist/{installs-89zeUsVn.js → installs-DscWb9b9.js} +8 -7
- package/dist/{links-7M-j83As.js → links-B8LAzWwg.js} +1 -1
- package/dist/{links-C591fM9M.js → links-Eax1UO3w.js} +1 -1
- package/dist/llm-slug-generator.js +18 -19
- package/dist/{loader-wXwp4rZJ.js → loader-KjT074JR.js} +5722 -6888
- package/dist/{logging-MMRGFxGI.js → logging-BAyPwvdH.js} +1 -1
- package/dist/{logging-DuK6YXuK.js → logging-CRq4h04P.js} +2 -2
- package/dist/{login-qr-wM8BnKJh.js → login-qr-B6ZgAuIf.js} +5 -5
- package/dist/{login-qr-CPEsT6dN.js → login-qr-Bua-p0nG.js} +3 -4
- package/dist/{login-qr-CGEu5TU-.js → login-qr-CuvemJj4.js} +6 -6
- package/dist/{login-qr-DH150tTp.js → login-qr-Djr1JfIf.js} +2 -2
- package/dist/{logs-cli-ClgkHnfT.js → logs-cli-9IAV7rWY.js} +38 -22
- package/dist/{logs-cli-CmfINsOj.js → logs-cli-EiKzUFPa.js} +37 -21
- package/dist/{manager-DYo4PlVM.js → manager-BIMh_eSm.js} +7 -8
- package/dist/{manager-D6EbxDV4.js → manager-CwinWQoz.js} +5 -5
- package/dist/{manager-BbnHek5T.js → manager-DkqF1GiK.js} +9 -9
- package/dist/{manager-CcVYv0N5.js → manager-T1XfGchB.js} +8 -8
- package/dist/{manifest-registry-3It8Z8yN.js → manifest-registry-CQhdnDBZ.js} +40 -2
- package/dist/{manifest-registry-D5SiA3xq.js → manifest-registry-u0okVSkU.js} +40 -2
- package/dist/{message-channel-Cu61-7H6.js → message-channel-BLi2a6Yw.js} +1 -1
- package/dist/{message-channel-BlgPSDAh.js → message-channel-C_MmebBt.js} +1 -1
- package/dist/{model-auth-ioeR_zLX.js → model-auth-CabXIF6O.js} +116 -34
- package/dist/{model-selection-BK7DuyH8.js → model-selection-BLuqsGVB.js} +86 -30
- package/dist/{model-selection-CezC36lH.js → model-selection-C1GmkTAV.js} +84 -28
- package/dist/{models-cli-C3uGdOrd.js → models-cli-9jmDv-h3.js} +52 -48
- package/dist/{models-cli-CUIVPgXE.js → models-cli-zS9rtWz8.js} +53 -49
- package/dist/{node-cli-BxBGSuPE.js → node-cli-CrpTxTTs.js} +28 -26
- package/dist/{node-cli-CdYAsuQQ.js → node-cli-wemUMCg-.js} +28 -26
- package/dist/{node-service-u8g85nD3.js → node-service-C8DTHTMg.js} +2 -2
- package/dist/{node-service-CM5vkdIo.js → node-service-WQuEKz6W.js} +2 -2
- package/dist/{nodes-cli-By6yeCTB.js → nodes-cli-BaU2SIFw.js} +20 -20
- package/dist/{nodes-cli-BaVMTAPc.js → nodes-cli-Dx23D72n.js} +20 -20
- package/dist/{nodes-screen-Dvl_ohUY.js → nodes-screen-C0IuBqUL.js} +1 -1
- package/dist/{note-5WqioBRA.js → note-BhRSeNeu.js} +2 -2
- package/dist/{note-Ci08TSbV.js → note-hhtubr2j.js} +1 -1
- package/dist/{onboard-channels-DxXvp8og.js → onboard-channels-C501x8GI.js} +8 -8
- package/dist/{onboard-channels-CXhnVy4E.js → onboard-channels-Dxzroasd.js} +8 -8
- package/dist/{onboard-skills-CBxsRGyf.js → onboard-skills-DV0Qzvjj.js} +440 -136
- package/dist/{onboard-skills-DQwOQ6Ry.js → onboard-skills-rlBHcu3Q.js} +439 -135
- package/dist/{onboarding-Du_7qEng.js → onboarding-CN-EDLjd.js} +38 -38
- package/dist/{openclaw-root-JLDMp6ux.js → openclaw-root-1VeFrph_.js} +4 -0
- package/dist/{openclaw-root-Dw6gumSU.js → openclaw-root-BNlEap4i.js} +4 -0
- package/dist/{pairing-cli-CRQDpj8f.js → pairing-cli-CDHG4xuI.js} +15 -15
- package/dist/{pairing-cli-Cng1KFWw.js → pairing-cli-CQP34Dlx.js} +15 -15
- package/dist/{pairing-labels-Ciu3Zoxj.js → pairing-labels-B6CN0SNH.js} +1 -1
- package/dist/{pairing-labels-CWFEtSc3.js → pairing-labels-CgNHnjzT.js} +1 -1
- package/dist/{pairing-store-c-QQ2u8p.js → pairing-store-CmlRVqOz.js} +2 -2
- package/dist/{pairing-store-CgXR3ZWJ.js → pairing-store-Dp5_JGnG.js} +3 -3
- package/dist/{path-env-CXWUFfFv.js → path-env-CLvYNwtL.js} +1 -1
- package/dist/{path-env-BgLvMbz_.js → path-env-CaYUVIML.js} +2 -2
- package/dist/{paths-MnZaxqPw.js → paths-B0a4ywSO.js} +30 -5
- package/dist/{paths-Bkhd_qY8.js → paths-B49s6UZQ.js} +30 -5
- package/dist/{paths-DL6EIRTw.js → paths-D0O87MfH.js} +30 -5
- package/dist/{paths-IivnSNkP.js → paths-DLINmNFQ.js} +31 -6
- package/dist/{pi-embedded-CgPTEqlB.js → pi-embedded-Ctrt2kz0.js} +8759 -9600
- package/dist/{pi-embedded-helpers-DYH6OWft.js → pi-embedded-helpers-CMKLjW6X.js} +68 -9
- package/dist/{pi-embedded-helpers-y1_Se0yq.js → pi-embedded-helpers-CUzTc1v6.js} +241 -24
- package/dist/{pi-embedded-helpers-Bkpd4fTr.js → pi-embedded-helpers-DfwkwPYD.js} +67 -8
- package/dist/{pi-embedded-helpers-BbWRSUnc.js → pi-embedded-helpers-WDwx99UA.js} +347 -32
- package/dist/{pi-tools.policy-akYsGFiA.js → pi-tools.policy-BpsROZbz.js} +4 -4
- package/dist/{plugin-auto-enable-lZwe2yX5.js → plugin-auto-enable-Bqhc3w5n.js} +5 -5
- package/dist/{plugin-auto-enable-AOSOJ-v1.js → plugin-auto-enable-PW76g_PJ.js} +5 -5
- package/dist/plugin-sdk/agents/bash-process-registry.d.ts +1 -0
- package/dist/plugin-sdk/agents/models-config.providers.d.ts +10 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/errors.d.ts +5 -1
- package/dist/plugin-sdk/agents/pi-embedded-helpers.d.ts +1 -1
- package/dist/plugin-sdk/agents/pi-embedded-runner/google.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/payloads.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/types.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/types.d.ts +15 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.tools.d.ts +1 -1
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.types.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.types.d.ts +2 -0
- package/dist/plugin-sdk/agents/session-tool-result-guard-wrapper.d.ts +2 -0
- package/dist/plugin-sdk/agents/session-tool-result-guard.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/agent-step.d.ts +3 -0
- package/dist/plugin-sdk/agents/tools/browser-tool.schema.d.ts +1 -1
- package/dist/plugin-sdk/agents/tools/web-search.d.ts +10 -1
- package/dist/plugin-sdk/agents/usage.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/heartbeat.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/mentions.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/model-selection.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-reference.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +11 -0
- package/dist/plugin-sdk/auto-reply/reply/session-usage.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/types.d.ts +2 -0
- package/dist/plugin-sdk/browser/control-auth.d.ts +13 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/signal.d.ts +1 -0
- package/dist/plugin-sdk/cli/prompt.d.ts +1 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
- package/dist/plugin-sdk/commands/onboard-types.d.ts +7 -1
- package/dist/plugin-sdk/config/sessions/paths.d.ts +7 -2
- package/dist/plugin-sdk/config/types.agents.d.ts +2 -0
- package/dist/plugin-sdk/config/types.discord.d.ts +5 -0
- package/dist/plugin-sdk/config/types.gateway.d.ts +15 -0
- package/dist/plugin-sdk/config/types.hooks.d.ts +15 -0
- package/dist/plugin-sdk/config/types.memory.d.ts +2 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +1 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +13 -1
- package/dist/plugin-sdk/config/zod-schema.hooks.d.ts +1 -1
- package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +9 -0
- package/dist/plugin-sdk/config/zod-schema.providers.d.ts +4 -0
- package/dist/plugin-sdk/cron/service/jobs.d.ts +8 -0
- package/dist/plugin-sdk/cron/service/state.d.ts +1 -0
- package/dist/plugin-sdk/cron/types.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +15 -0
- package/dist/plugin-sdk/discord/send.types.d.ts +5 -0
- package/dist/plugin-sdk/gateway/auth.d.ts +36 -0
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +0 -3
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +7 -1
- package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +3 -1
- package/dist/plugin-sdk/index.js +935 -660
- package/dist/plugin-sdk/infra/binaries.d.ts +3 -0
- package/dist/plugin-sdk/infra/heartbeat-active-hours.d.ts +5 -0
- package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +1 -0
- package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +1 -0
- package/dist/plugin-sdk/infra/net/ssrf.d.ts +1 -0
- package/dist/plugin-sdk/infra/tailscale.d.ts +34 -0
- package/dist/plugin-sdk/infra/tmp-openclaw-dir.d.ts +10 -0
- package/dist/plugin-sdk/logging/console.d.ts +1 -0
- package/dist/plugin-sdk/logging/logger.d.ts +1 -1
- package/dist/plugin-sdk/logging/state.d.ts +1 -0
- package/dist/plugin-sdk/markdown/ir.d.ts +1 -1
- package/dist/plugin-sdk/markdown/whatsapp.d.ts +14 -0
- package/dist/plugin-sdk/media/input-files.d.ts +5 -0
- package/dist/plugin-sdk/media-understanding/audio-preflight.d.ts +16 -0
- package/dist/plugin-sdk/media-understanding/types.d.ts +1 -0
- package/dist/plugin-sdk/memory/backend-config.d.ts +2 -1
- package/dist/plugin-sdk/memory/qmd-manager.d.ts +2 -0
- package/dist/plugin-sdk/memory/qmd-query-parser.d.ts +8 -0
- package/dist/plugin-sdk/process/command-queue.d.ts +16 -0
- package/dist/plugin-sdk/routing/resolve-route.d.ts +3 -1
- package/dist/plugin-sdk/security/external-content.d.ts +1 -1
- package/dist/plugin-sdk/security/secret-equal.d.ts +1 -0
- package/dist/plugin-sdk/sessions/input-provenance.d.ts +16 -0
- package/dist/plugin-sdk/signal/monitor/event-handler.types.d.ts +8 -0
- package/dist/plugin-sdk/signal/monitor/mentions.d.ts +2 -0
- package/dist/plugin-sdk/slack/monitor/commands.d.ts +5 -0
- package/dist/plugin-sdk/telegram/bot-message-context.d.ts +2 -1
- package/dist/plugin-sdk/telegram/send.d.ts +3 -0
- package/dist/plugin-sdk/web/media.d.ts +2 -0
- package/dist/{plugins-Db5BiELK.js → plugins-4Hqd1WGf.js} +3 -3
- package/dist/{plugins-CNaHNND_.js → plugins-X7d_tfTE.js} +4 -4
- package/dist/{plugins-cli-8G-hQPCu.js → plugins-cli-Bgku3EGj.js} +253 -44
- package/dist/{plugins-cli-CDiocaDE.js → plugins-cli-CVToH3if.js} +257 -48
- package/dist/{ports-BeebfNCb.js → ports-qkt29rdC.js} +2 -2
- package/dist/{program-0Cj9YxRN.js → program-Cf7lkBur.js} +82 -80
- package/dist/{progress-DIQJt9Va.js → progress-C9kngsTD.js} +1 -1
- package/dist/{progress-Da1ehW-x.js → progress-DWqhRakV.js} +1 -1
- package/dist/{prompt-style-Dc0C5HC9.js → prompt-style-BFH5D5LN.js} +1 -1
- package/dist/{prompt-style-CjQRlDx4.js → prompt-style-CIbmaxSa.js} +1 -1
- package/dist/{pw-ai-C43wv1ZF.js → pw-ai-8mdv3h-d.js} +7 -6
- package/dist/{pw-ai-COWYvUfG.js → pw-ai-CM1IsSgZ.js} +6 -6
- package/dist/{pw-ai-BxJ-KCIy.js → pw-ai-FGoRVblI.js} +5 -6
- package/dist/{pw-ai-CsvaObGM.js → pw-ai-sS1fRKW_.js} +3 -3
- package/dist/{qmd-manager-CpsjQyaZ.js → qmd-manager-C67Fc8aN.js} +79 -26
- package/dist/{qmd-manager-C9YWFeG6.js → qmd-manager-CXVbfg99.js} +81 -26
- package/dist/{qmd-manager-C02E8ixK.js → qmd-manager-RMRE8Tqt.js} +81 -26
- package/dist/{qmd-manager-BzY2LQTT.js → qmd-manager-pyc_MTIe.js} +78 -23
- package/dist/{register.subclis-DUkirdHn.js → register.subclis-C02e4zuJ.js} +29 -29
- package/dist/{reply--b7BsXGP.js → reply-DICXkh_C.js} +7289 -8455
- package/dist/{routes-DUkEKAc1.js → routes-CmOI1hIH.js} +29 -11
- package/dist/{routes-B4QQiFju.js → routes-DewK5tq2.js} +29 -12
- package/dist/{rpc-CuMtxrRT.js → rpc-DHr30euf.js} +3 -3
- package/dist/{rpc-Blt6MJ4F.js → rpc-T300F8zI.js} +3 -3
- package/dist/{run-main-XZcPA23b.js → run-main-C5wpthq1.js} +84 -82
- package/dist/runner-CY0nmVme.js +1886 -0
- package/dist/runner-Cfm5nTMc.js +1785 -0
- package/dist/runner-D_dujMod.js +1886 -0
- package/dist/runner-DrGYLH5K.js +1785 -0
- package/dist/{sandbox-Aks-9EcZ.js → sandbox-BKYnhYQH.js} +24 -17
- package/dist/{sandbox-DqUO2K83.js → sandbox-Bhjnh1Xg.js} +23 -16
- package/dist/{sandbox-cli-C99Thxi8.js → sandbox-cli-DBsAjZJN.js} +21 -21
- package/dist/{sandbox-cli-CJqRM4V6.js → sandbox-cli-rV9LtFeu.js} +21 -21
- package/dist/{security-cli-iqYLMOz3.js → security-cli-BIwJM_rs.js} +27 -27
- package/dist/{security-cli-DW3lCz-o.js → security-cli-BRjny8Yu.js} +27 -27
- package/dist/{server-context-fX4xiYRh.js → server-context-BGpGs3qd.js} +7 -7
- package/dist/{server-context-8Qt35QdF.js → server-context-Cl0U0vE3.js} +7 -7
- package/dist/{server-node-events-CHWXfb_T.js → server-node-events-CBfTbiTA.js} +48 -44
- package/dist/{server-node-events-BzrEnKLX.js → server-node-events-QCvh8EgI.js} +45 -41
- package/dist/{service-Cd4BxKuo.js → service--nPk7DvT.js} +8 -4
- package/dist/{service-DDPRbf8a.js → service-99RDXwX4.js} +8 -4
- package/dist/{service-audit-CCFxuvKs.js → service-audit-DnLmRGQt.js} +4 -4
- package/dist/{service-audit-x6jCN-6a.js → service-audit-ckBaRCVC.js} +4 -4
- package/dist/{session-cost-usage-CcCEQNuc.js → session-cost-usage-D7HuoSSD.js} +12 -10
- package/dist/{session-cost-usage-PvyVZz-g.js → session-cost-usage-D9hHANWI.js} +12 -10
- package/dist/{shared-ILguacOr.js → shared-Bs4vduG4.js} +3 -3
- package/dist/{shared-CagUDdmp.js → shared-CEY5IkwG.js} +3 -3
- package/dist/{shared-gOyV38rM.js → shared-DRohONn_.js} +4 -4
- package/dist/{shared-BDk_zC9p.js → shared-ICqOZibV.js} +4 -4
- package/dist/{skill-scanner-C_fQzVDu.js → skill-scanner-CucvxYhu.js} +1 -1
- package/dist/{skill-scanner-DrVEHfC6.js → skill-scanner-rHMtUHtP.js} +1 -1
- package/dist/{skills-D5UZZZSY.js → skills-DRjfSQT3.js} +141 -6
- package/dist/{skills-ccAgQ3Ad.js → skills-DprQj9X2.js} +142 -7
- package/dist/{skills-cli-DQilTG3n.js → skills-cli-9WO-C55s.js} +12 -12
- package/dist/{skills-cli-ggyLBtAY.js → skills-cli-B9eej-EW.js} +13 -13
- package/dist/{skills-status-BosMnzIs.js → skills-status-5U3P3YfJ.js} +3 -3
- package/dist/{skills-status-DjtPPMnY.js → skills-status-TDIgVd1K.js} +2 -2
- package/dist/{sqlite-B7FPASCO.js → sqlite-BINzs1U0.js} +2 -2
- package/dist/{sqlite-Btrgi7-j.js → sqlite-D4w5TejA.js} +3 -3
- package/dist/{sqlite-BrQ9tw8B.js → sqlite-DRRHmlug.js} +3 -3
- package/dist/{sqlite-HepBVDoX.js → sqlite-F6PGkEm1.js} +2 -2
- package/dist/{status-BByCntWS.js → status-BKGkKC_v.js} +3 -3
- package/dist/{status-Dt7RE_Yy.js → status-CiHtHdaa.js} +4 -4
- package/dist/{status-zfL4Yej7.js → status-DDWoOpeB.js} +37 -37
- package/dist/{subsystem-Bh1Y_6Uv.js → subsystem-BoExtIHo.js} +52 -17
- package/dist/{system-cli-DwuUkdkH.js → system-cli-B6lr60Io.js} +14 -14
- package/dist/{system-cli-Clqsx8U5.js → system-cli-CprW9G3h.js} +14 -14
- package/dist/{systemd-BEWwfwn0.js → systemd-C0VZriGM.js} +3 -3
- package/dist/{systemd-D6wTPnHi.js → systemd-DrmBtJ5T.js} +3 -3
- package/dist/{systemd-hints-zi4ohCOY.js → systemd-hints-DZtXiVHa.js} +1 -1
- package/dist/{systemd-linger-CDo2UbHM.js → systemd-linger-NC2kl1SC.js} +2 -2
- package/dist/{systemd-linger-BxjTrgoH.js → systemd-linger-xdn3BdPh.js} +2 -2
- package/dist/{table-DEnmtvl5.js → table-B8dx3v4v.js} +2 -2
- package/dist/{table-cCoGqLsk.js → table-CwulTLQp.js} +1 -1
- package/dist/{tool-display-DskiU8Kt.js → tool-display-CZRIDMRm.js} +2 -2
- package/dist/{tool-display-o-dDAlqF.js → tool-display-ClRud3pg.js} +2 -2
- package/dist/{tui-BdJWZdto.js → tui-CVTQn-dC.js} +14 -13
- package/dist/{tui-Bc7XUQGP.js → tui-Lu8FdrlK.js} +13 -14
- package/dist/{tui-cli-BGYh0UL0.js → tui-cli-BLpTj1X9.js} +27 -27
- package/dist/{tui-cli-D3n-O9zB.js → tui-cli-BLx5kL2I.js} +26 -26
- package/dist/{tui-formatters-CA85v4U2.js → tui-formatters-CNySEfJN.js} +6 -6
- package/dist/{tui-formatters-C3NarH24.js → tui-formatters-DePhZK3J.js} +6 -6
- package/dist/{update-JB16aPIY.js → update-DHVxMTpQ.js} +3 -3
- package/dist/{update-Ct9sqJC_.js → update-DU1geolI.js} +3 -3
- package/dist/{update-cli-wWKDS3cm.js → update-cli-C0hUvJWK.js} +89 -71
- package/dist/{update-cli-DDXp_N9B.js → update-cli-Wb1GB3rL.js} +88 -70
- package/dist/{update-runner-ChTf6O6p.js → update-runner--ixK4J3W.js} +11 -11
- package/dist/{update-runner-CmE6cHdn.js → update-runner-7Qa1T9y6.js} +10 -10
- package/dist/{utils-Dk86IbEs.js → utils-BLJAc3ZV.js} +1 -1
- package/dist/{utils-es4ygvQ-.js → utils-Cd9QdCHh.js} +1 -1
- package/dist/{webhooks-cli-CVIE9TtX.js → webhooks-cli-DgcMy7RG.js} +12 -12
- package/dist/{webhooks-cli-BmKSiQQC.js → webhooks-cli-aVzUcJY9.js} +11 -11
- package/dist/{widearea-dns-2ah0bkAj.js → widearea-dns-BaIgNEhY.js} +3 -3
- package/dist/{widearea-dns-CMIG6-74.js → widearea-dns-DzuRdwk5.js} +3 -3
- package/dist/{ws-DtDKpbLR.js → ws-CHCQHs0F.js} +1 -1
- package/dist/{ws-log-BP3z_g6Z.js → ws-log-CIXbLCka.js} +1 -1
- package/dist/{ws-log-D7MkvKhg.js → ws-log-DcQFZByi.js} +2 -2
- package/dist/{wsl-Cwo7X0Un.js → wsl-BUOkxKJu.js} +2 -2
- package/docs/assets/install-script.svg +1 -0
- package/docs/automation/hooks.md +1 -38
- package/docs/automation/webhook.md +43 -2
- package/docs/channels/discord.md +389 -381
- package/docs/channels/imessage.md +229 -218
- package/docs/channels/slack.md +294 -415
- package/docs/channels/telegram.md +401 -505
- package/docs/channels/whatsapp.md +338 -310
- package/docs/ci.md +0 -12
- package/docs/cli/hooks.md +1 -14
- package/docs/cli/index.md +6 -1
- package/docs/cli/logs.md +4 -0
- package/docs/cli/onboard.md +30 -0
- package/docs/cli/plugins.md +20 -1
- package/docs/cli/security.md +1 -0
- package/docs/concepts/memory.md +7 -4
- package/docs/concepts/session-tool.md +1 -0
- package/docs/docs.json +11 -11
- package/docs/gateway/configuration-examples.md +9 -2
- package/docs/gateway/configuration-reference.md +2329 -0
- package/docs/gateway/configuration.md +338 -3304
- package/docs/gateway/index.md +162 -238
- package/docs/gateway/openresponses-http-api.md +15 -0
- package/docs/gateway/security/index.md +3 -0
- package/docs/help/faq.md +9 -0
- package/docs/install/hetzner.md +21 -0
- package/docs/install/installer.md +20 -0
- package/docs/nodes/audio.md +19 -0
- package/docs/platforms/mac/release.md +7 -7
- package/docs/providers/glm.md +3 -3
- package/docs/providers/index.md +1 -0
- package/docs/providers/litellm.md +153 -0
- package/docs/providers/zai.md +2 -2
- package/docs/reference/templates/AGENTS.md +26 -26
- package/docs/reference/templates/HEARTBEAT.md +31 -2
- package/docs/reference/templates/SOUL.md +14 -8
- package/docs/reference/transcript-hygiene.md +18 -0
- package/docs/start/getting-started.md +5 -0
- package/docs/start/wizard-cli-automation.md +17 -0
- package/docs/start/wizard-cli-reference.md +12 -0
- package/docs/tools/browser.md +6 -0
- package/docs/zh-CN/automation/hooks.md +1 -38
- package/docs/zh-CN/cli/hooks.md +1 -14
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/bluebubbles/src/monitor.test.ts +40 -28
- package/extensions/bluebubbles/src/monitor.ts +0 -4
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +10 -10
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +2 -5
- package/extensions/feishu/src/bot.checkBotMentioned.test.ts +64 -0
- package/extensions/feishu/src/bot.ts +1 -1
- package/extensions/feishu/src/channel.test.ts +48 -0
- package/extensions/feishu/src/channel.ts +1 -3
- package/extensions/feishu/src/config-schema.ts +6 -0
- package/extensions/feishu/src/docx.ts +14 -4
- package/extensions/feishu/src/media.test.ts +151 -0
- package/extensions/feishu/src/media.ts +27 -13
- package/extensions/feishu/src/reply-dispatcher.test.ts +116 -0
- package/extensions/feishu/src/reply-dispatcher.ts +124 -67
- package/extensions/feishu/src/streaming-card.ts +223 -0
- package/extensions/feishu/src/targets.test.ts +16 -0
- package/extensions/feishu/src/targets.ts +1 -1
- package/extensions/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/irc/src/client.ts +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 +6 -0
- package/extensions/matrix/package.json +2 -2
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/index.ts +6 -2
- package/extensions/memory-lancedb/package.json +2 -2
- package/extensions/minimax-portal-auth/index.ts +7 -5
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +2 -2
- package/extensions/open-prose/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/voice-call/src/media-stream.ts +7 -1
- package/extensions/voice-call/src/providers/twilio.test.ts +5 -3
- package/extensions/voice-call/src/providers/twilio.ts +12 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +26 -22
- package/dist/auth-BcNHFK-i.js +0 -184
- package/dist/auth-BvIPpm7G.js +0 -184
- package/dist/boolean-M-esQJt6.js +0 -30
- package/dist/bundled/soul-evil/HOOK.md +0 -71
- package/dist/bundled/soul-evil/handler.js +0 -194
- package/dist/cli-DJbWJ9aB.js +0 -89
- package/dist/config-CI7EpvlP.js +0 -15
- package/dist/control-ui/assets/index-CnB9IO4a.js.map +0 -1
- package/dist/date-time-c6HTX6IW.js +0 -187
- package/dist/frontmatter-xwTm0734.js +0 -105
- package/dist/parse-duration-De_tAQSe.js +0 -24
- package/dist/session-key-nXYQSv-a.js +0 -167
- package/dist/utils-dp_OM900.js +0 -476
- package/docs/hooks/soul-evil.md +0 -69
- package/docs/zh-CN/hooks/soul-evil.md +0 -72
- /package/dist/{archive-CXhvR9nU.js → archive-beaSfAzA.js} +0 -0
- /package/dist/{brew-BIrWdDps.js → brew-BUIxHEkn.js} +0 -0
- /package/dist/{brew-B7YK4ZoL.js → brew-ROHf0-Xp.js} +0 -0
- /package/dist/{cli-utils-PlLcDZlM.js → cli-utils-CRhVAaLV.js} +0 -0
- /package/dist/{cli-utils-R-ECs5cY.js → cli-utils-LcHOt63h.js} +0 -0
- /package/dist/{command-format-BUxhT1xL.js → command-format-qUVxzqYm.js} +0 -0
- /package/dist/{constants-CNTiY-ZN.js → constants-BvQ6S8j5.js} +0 -0
- /package/dist/{constants-DuoCkWRh.js → constants-JPeoOZnw.js} +0 -0
- /package/dist/{errors-D3tYRJWG.js → errors-B91HIDPD.js} +0 -0
- /package/dist/{errors-B0eT3jVv.js → errors-Bv81hF2P.js} +0 -0
- /package/dist/{errors-x4NYs-1P.js → errors-DjZBTJJ3.js} +0 -0
- /package/dist/{exec-approvals-DGPTjO0N.js → exec-approvals-Cb4ZLukq.js} +0 -0
- /package/dist/{exec-approvals-DhmKpiIo.js → exec-approvals-DQ8TVVmj.js} +0 -0
- /package/dist/{format-CaxeRcue.js → format-CNU-Zkrz.js} +0 -0
- /package/dist/{format-DLOJPZmo.js → format-DcfK-dwd.js} +0 -0
- /package/dist/{format-duration-Be5Z7JdJ.js → format-duration-84n6_DgO.js} +0 -0
- /package/dist/{format-duration-CEmFWLyX.js → format-duration-Bo9zNKwO.js} +0 -0
- /package/dist/{format-relative-79_Y1n2Y.js → format-relative-CZOlQ2pA.js} +0 -0
- /package/dist/{format-relative-Db7eqEu8.js → format-relative-cegC_FF5.js} +0 -0
- /package/dist/{github-copilot-token-C9IJh2Pn.js → github-copilot-token-DkiRbJdR.js} +0 -0
- /package/dist/{helpers-CQI-5xS9.js → helpers-8O7IVGO-.js} +0 -0
- /package/dist/{helpers-CRzoyyXS.js → helpers-D_jqdWkd.js} +0 -0
- /package/dist/{helpers-C89IG08W.js → helpers-HyeZXsnu.js} +0 -0
- /package/dist/{is-main-WWuz28Ip.js → is-main-BWoXGz7p.js} +0 -0
- /package/dist/{logging-BzvBIA3Y.js → logging-fywhKCmE.js} +0 -0
- /package/dist/{nodes-screen-lykd2cny.js → nodes-screen-CdCWeiwy.js} +0 -0
- /package/dist/{parse-Cjiudy6x.js → parse-Bw0oH-rT.js} +0 -0
- /package/dist/{parse-DqAvJRIf.js → parse-ioZhOtha.js} +0 -0
- /package/dist/{parse-log-line-CUrpqe1w.js → parse-log-line-BoDqomM4.js} +0 -0
- /package/dist/{parse-log-line-D2UGw0wR.js → parse-log-line-DPxH1XZx.js} +0 -0
- /package/dist/{parse-timeout-DFSPLxpY.js → parse-timeout-D1XX_zN_.js} +0 -0
- /package/dist/{parse-timeout-DV8NQQWk.js → parse-timeout-DMW-z4Iz.js} +0 -0
- /package/dist/{pi-model-discovery-CV2V1HHz.js → pi-model-discovery-DqgqUyAv.js} +0 -0
- /package/dist/{pi-model-discovery-DzFOAbQt.js → pi-model-discovery-EwKVHlZB.js} +0 -0
- /package/dist/{prompts--d-6l5Ln.js → prompts-Bg96reub.js} +0 -0
- /package/dist/{redact-DAKeu7PA.js → redact-BRsnXqwD.js} +0 -0
- /package/dist/{redact-DuEEf1p1.js → redact-Br9GfacZ.js} +0 -0
- /package/dist/{redact-BOIof271.js → redact-BrXLgslJ.js} +0 -0
- /package/dist/{status-Cv36yYdi.js → status-BRZfQbJ2.js} +0 -0
- /package/dist/{status-Drziap9H.js → status-CoAy6bEC.js} +0 -0
- /package/dist/{systemd-hints-CH4pbCFD.js → systemd-hints-CXNtLw9Q.js} +0 -0
- /package/dist/{tailnet-DGRSvYuQ.js → tailnet-DATIFSsY.js} +0 -0
- /package/dist/{transcript-events-BlIONGVn.js → transcript-events-BHS7QoRl.js} +0 -0
- /package/dist/{transcript-events-C1hdue6u.js → transcript-events-Bp7fGnwv.js} +0 -0
- /package/dist/{transcript-events-CZ8CG4ht.js → transcript-events-BtNd-j6q.js} +0 -0
- /package/dist/{usage-format-6Uar63S0.js → usage-format-C4JfTbSp.js} +0 -0
- /package/dist/{usage-format-hd37en6b.js → usage-format-CpORtVCG.js} +0 -0
|
@@ -1,10 +1,506 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as resolveOAuthDir, c as expandHomePrefix, l as resolveEffectiveHomeDir, n as resolveConfigPath, u as resolveRequiredHomeDir } from "./paths-BZtyHNCi.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
+
import os from "node:os";
|
|
3
4
|
import path from "node:path";
|
|
4
|
-
import
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import { Logger } from "tslog";
|
|
7
|
+
import JSON5 from "json5";
|
|
8
|
+
import chalk, { Chalk } from "chalk";
|
|
5
9
|
import { execFile, spawn } from "node:child_process";
|
|
6
10
|
import { promisify } from "node:util";
|
|
7
11
|
|
|
12
|
+
//#region src/infra/tmp-openclaw-dir.ts
|
|
13
|
+
const POSIX_OPENCLAW_TMP_DIR = "/tmp/openclaw";
|
|
14
|
+
function isNodeErrorWithCode(err, code) {
|
|
15
|
+
return typeof err === "object" && err !== null && "code" in err && err.code === code;
|
|
16
|
+
}
|
|
17
|
+
function resolvePreferredOpenClawTmpDir(options = {}) {
|
|
18
|
+
const accessSync = options.accessSync ?? fs.accessSync;
|
|
19
|
+
const statSync = options.statSync ?? fs.statSync;
|
|
20
|
+
const tmpdir = options.tmpdir ?? os.tmpdir;
|
|
21
|
+
try {
|
|
22
|
+
if (!statSync(POSIX_OPENCLAW_TMP_DIR).isDirectory()) return path.join(tmpdir(), "openclaw");
|
|
23
|
+
accessSync(POSIX_OPENCLAW_TMP_DIR, fs.constants.W_OK | fs.constants.X_OK);
|
|
24
|
+
return POSIX_OPENCLAW_TMP_DIR;
|
|
25
|
+
} catch (err) {
|
|
26
|
+
if (!isNodeErrorWithCode(err, "ENOENT")) return path.join(tmpdir(), "openclaw");
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
accessSync("/tmp", fs.constants.W_OK | fs.constants.X_OK);
|
|
30
|
+
return POSIX_OPENCLAW_TMP_DIR;
|
|
31
|
+
} catch {
|
|
32
|
+
return path.join(tmpdir(), "openclaw");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/logging/config.ts
|
|
38
|
+
function readLoggingConfig() {
|
|
39
|
+
const configPath = resolveConfigPath();
|
|
40
|
+
try {
|
|
41
|
+
if (!fs.existsSync(configPath)) return;
|
|
42
|
+
const raw = fs.readFileSync(configPath, "utf-8");
|
|
43
|
+
const logging = JSON5.parse(raw)?.logging;
|
|
44
|
+
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
|
|
45
|
+
return logging;
|
|
46
|
+
} catch {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/logging/levels.ts
|
|
53
|
+
const ALLOWED_LOG_LEVELS = [
|
|
54
|
+
"silent",
|
|
55
|
+
"fatal",
|
|
56
|
+
"error",
|
|
57
|
+
"warn",
|
|
58
|
+
"info",
|
|
59
|
+
"debug",
|
|
60
|
+
"trace"
|
|
61
|
+
];
|
|
62
|
+
function normalizeLogLevel(level, fallback = "info") {
|
|
63
|
+
const candidate = (level ?? fallback).trim();
|
|
64
|
+
return ALLOWED_LOG_LEVELS.includes(candidate) ? candidate : fallback;
|
|
65
|
+
}
|
|
66
|
+
function levelToMinLevel(level) {
|
|
67
|
+
return {
|
|
68
|
+
fatal: 0,
|
|
69
|
+
error: 1,
|
|
70
|
+
warn: 2,
|
|
71
|
+
info: 3,
|
|
72
|
+
debug: 4,
|
|
73
|
+
trace: 5,
|
|
74
|
+
silent: Number.POSITIVE_INFINITY
|
|
75
|
+
}[level];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/logging/state.ts
|
|
80
|
+
const loggingState = {
|
|
81
|
+
cachedLogger: null,
|
|
82
|
+
cachedSettings: null,
|
|
83
|
+
cachedConsoleSettings: null,
|
|
84
|
+
overrideSettings: null,
|
|
85
|
+
consolePatched: false,
|
|
86
|
+
forceConsoleToStderr: false,
|
|
87
|
+
consoleTimestampPrefix: false,
|
|
88
|
+
consoleSubsystemFilter: null,
|
|
89
|
+
resolvingConsoleSettings: false,
|
|
90
|
+
streamErrorHandlersInstalled: false,
|
|
91
|
+
rawConsole: null
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/logging/logger.ts
|
|
96
|
+
const DEFAULT_LOG_DIR = resolvePreferredOpenClawTmpDir();
|
|
97
|
+
const DEFAULT_LOG_FILE = path.join(DEFAULT_LOG_DIR, "openclaw.log");
|
|
98
|
+
const LOG_PREFIX = "openclaw";
|
|
99
|
+
const LOG_SUFFIX = ".log";
|
|
100
|
+
const MAX_LOG_AGE_MS = 1440 * 60 * 1e3;
|
|
101
|
+
const requireConfig$1 = createRequire(import.meta.url);
|
|
102
|
+
const externalTransports = /* @__PURE__ */ new Set();
|
|
103
|
+
function attachExternalTransport(logger, transport) {
|
|
104
|
+
logger.attachTransport((logObj) => {
|
|
105
|
+
if (!externalTransports.has(transport)) return;
|
|
106
|
+
try {
|
|
107
|
+
transport(logObj);
|
|
108
|
+
} catch {}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function resolveSettings() {
|
|
112
|
+
let cfg = loggingState.overrideSettings ?? readLoggingConfig();
|
|
113
|
+
if (!cfg) try {
|
|
114
|
+
cfg = requireConfig$1("../config/config.js").loadConfig?.().logging;
|
|
115
|
+
} catch {
|
|
116
|
+
cfg = void 0;
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
level: normalizeLogLevel(cfg?.level, "info"),
|
|
120
|
+
file: cfg?.file ?? defaultRollingPathForToday()
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function settingsChanged(a, b) {
|
|
124
|
+
if (!a) return true;
|
|
125
|
+
return a.level !== b.level || a.file !== b.file;
|
|
126
|
+
}
|
|
127
|
+
function isFileLogLevelEnabled(level) {
|
|
128
|
+
const settings = loggingState.cachedSettings ?? resolveSettings();
|
|
129
|
+
if (!loggingState.cachedSettings) loggingState.cachedSettings = settings;
|
|
130
|
+
if (settings.level === "silent") return false;
|
|
131
|
+
return levelToMinLevel(level) <= levelToMinLevel(settings.level);
|
|
132
|
+
}
|
|
133
|
+
function buildLogger(settings) {
|
|
134
|
+
fs.mkdirSync(path.dirname(settings.file), { recursive: true });
|
|
135
|
+
if (isRollingPath(settings.file)) pruneOldRollingLogs(path.dirname(settings.file));
|
|
136
|
+
const logger = new Logger({
|
|
137
|
+
name: "openclaw",
|
|
138
|
+
minLevel: levelToMinLevel(settings.level),
|
|
139
|
+
type: "hidden"
|
|
140
|
+
});
|
|
141
|
+
logger.attachTransport((logObj) => {
|
|
142
|
+
try {
|
|
143
|
+
const time = logObj.date?.toISOString?.() ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
144
|
+
const line = JSON.stringify({
|
|
145
|
+
...logObj,
|
|
146
|
+
time
|
|
147
|
+
});
|
|
148
|
+
fs.appendFileSync(settings.file, `${line}\n`, { encoding: "utf8" });
|
|
149
|
+
} catch {}
|
|
150
|
+
});
|
|
151
|
+
for (const transport of externalTransports) attachExternalTransport(logger, transport);
|
|
152
|
+
return logger;
|
|
153
|
+
}
|
|
154
|
+
function getLogger() {
|
|
155
|
+
const settings = resolveSettings();
|
|
156
|
+
const cachedLogger = loggingState.cachedLogger;
|
|
157
|
+
const cachedSettings = loggingState.cachedSettings;
|
|
158
|
+
if (!cachedLogger || settingsChanged(cachedSettings, settings)) {
|
|
159
|
+
loggingState.cachedLogger = buildLogger(settings);
|
|
160
|
+
loggingState.cachedSettings = settings;
|
|
161
|
+
}
|
|
162
|
+
return loggingState.cachedLogger;
|
|
163
|
+
}
|
|
164
|
+
function getChildLogger(bindings, opts) {
|
|
165
|
+
const base = getLogger();
|
|
166
|
+
const minLevel = opts?.level ? levelToMinLevel(opts.level) : void 0;
|
|
167
|
+
const name = bindings ? JSON.stringify(bindings) : void 0;
|
|
168
|
+
return base.getSubLogger({
|
|
169
|
+
name,
|
|
170
|
+
minLevel,
|
|
171
|
+
prefix: bindings ? [name ?? ""] : []
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function toPinoLikeLogger(logger, level) {
|
|
175
|
+
const buildChild = (bindings) => toPinoLikeLogger(logger.getSubLogger({ name: bindings ? JSON.stringify(bindings) : void 0 }), level);
|
|
176
|
+
return {
|
|
177
|
+
level,
|
|
178
|
+
child: buildChild,
|
|
179
|
+
trace: (...args) => logger.trace(...args),
|
|
180
|
+
debug: (...args) => logger.debug(...args),
|
|
181
|
+
info: (...args) => logger.info(...args),
|
|
182
|
+
warn: (...args) => logger.warn(...args),
|
|
183
|
+
error: (...args) => logger.error(...args),
|
|
184
|
+
fatal: (...args) => logger.fatal(...args)
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function formatLocalDate(date) {
|
|
188
|
+
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
189
|
+
}
|
|
190
|
+
function defaultRollingPathForToday() {
|
|
191
|
+
const today = formatLocalDate(/* @__PURE__ */ new Date());
|
|
192
|
+
return path.join(DEFAULT_LOG_DIR, `${LOG_PREFIX}-${today}${LOG_SUFFIX}`);
|
|
193
|
+
}
|
|
194
|
+
function isRollingPath(file) {
|
|
195
|
+
const base = path.basename(file);
|
|
196
|
+
return base.startsWith(`${LOG_PREFIX}-`) && base.endsWith(LOG_SUFFIX) && base.length === `${LOG_PREFIX}-YYYY-MM-DD${LOG_SUFFIX}`.length;
|
|
197
|
+
}
|
|
198
|
+
function pruneOldRollingLogs(dir) {
|
|
199
|
+
try {
|
|
200
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
201
|
+
const cutoff = Date.now() - MAX_LOG_AGE_MS;
|
|
202
|
+
for (const entry of entries) {
|
|
203
|
+
if (!entry.isFile()) continue;
|
|
204
|
+
if (!entry.name.startsWith(`${LOG_PREFIX}-`) || !entry.name.endsWith(LOG_SUFFIX)) continue;
|
|
205
|
+
const fullPath = path.join(dir, entry.name);
|
|
206
|
+
try {
|
|
207
|
+
if (fs.statSync(fullPath).mtimeMs < cutoff) fs.rmSync(fullPath, { force: true });
|
|
208
|
+
} catch {}
|
|
209
|
+
}
|
|
210
|
+
} catch {}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/terminal/palette.ts
|
|
215
|
+
const LOBSTER_PALETTE = {
|
|
216
|
+
accent: "#FF5A2D",
|
|
217
|
+
accentBright: "#FF7A3D",
|
|
218
|
+
accentDim: "#D14A22",
|
|
219
|
+
info: "#FF8A5B",
|
|
220
|
+
success: "#2FBF71",
|
|
221
|
+
warn: "#FFB020",
|
|
222
|
+
error: "#E23D2D",
|
|
223
|
+
muted: "#8B7F77"
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/terminal/theme.ts
|
|
228
|
+
const hasForceColor = typeof process.env.FORCE_COLOR === "string" && process.env.FORCE_COLOR.trim().length > 0 && process.env.FORCE_COLOR.trim() !== "0";
|
|
229
|
+
const baseChalk = process.env.NO_COLOR && !hasForceColor ? new Chalk({ level: 0 }) : chalk;
|
|
230
|
+
const hex = (value) => baseChalk.hex(value);
|
|
231
|
+
const theme = {
|
|
232
|
+
accent: hex(LOBSTER_PALETTE.accent),
|
|
233
|
+
accentBright: hex(LOBSTER_PALETTE.accentBright),
|
|
234
|
+
accentDim: hex(LOBSTER_PALETTE.accentDim),
|
|
235
|
+
info: hex(LOBSTER_PALETTE.info),
|
|
236
|
+
success: hex(LOBSTER_PALETTE.success),
|
|
237
|
+
warn: hex(LOBSTER_PALETTE.warn),
|
|
238
|
+
error: hex(LOBSTER_PALETTE.error),
|
|
239
|
+
muted: hex(LOBSTER_PALETTE.muted),
|
|
240
|
+
heading: baseChalk.bold.hex(LOBSTER_PALETTE.accent),
|
|
241
|
+
command: hex(LOBSTER_PALETTE.accentBright),
|
|
242
|
+
option: hex(LOBSTER_PALETTE.warn)
|
|
243
|
+
};
|
|
244
|
+
const isRich = () => Boolean(baseChalk.level > 0);
|
|
245
|
+
const colorize = (rich, color, value) => rich ? color(value) : value;
|
|
246
|
+
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/globals.ts
|
|
249
|
+
let globalVerbose = false;
|
|
250
|
+
function setVerbose(v) {
|
|
251
|
+
globalVerbose = v;
|
|
252
|
+
}
|
|
253
|
+
function isVerbose() {
|
|
254
|
+
return globalVerbose;
|
|
255
|
+
}
|
|
256
|
+
function shouldLogVerbose() {
|
|
257
|
+
return globalVerbose || isFileLogLevelEnabled("debug");
|
|
258
|
+
}
|
|
259
|
+
function logVerbose(message) {
|
|
260
|
+
if (!shouldLogVerbose()) return;
|
|
261
|
+
try {
|
|
262
|
+
getLogger().debug({ message }, "verbose");
|
|
263
|
+
} catch {}
|
|
264
|
+
if (!globalVerbose) return;
|
|
265
|
+
console.log(theme.muted(message));
|
|
266
|
+
}
|
|
267
|
+
function logVerboseConsole(message) {
|
|
268
|
+
if (!globalVerbose) return;
|
|
269
|
+
console.log(theme.muted(message));
|
|
270
|
+
}
|
|
271
|
+
const success = theme.success;
|
|
272
|
+
const warn = theme.warn;
|
|
273
|
+
const info = theme.info;
|
|
274
|
+
const danger = theme.error;
|
|
275
|
+
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/utils.ts
|
|
278
|
+
async function ensureDir(dir) {
|
|
279
|
+
await fs.promises.mkdir(dir, { recursive: true });
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Check if a file or directory exists at the given path.
|
|
283
|
+
*/
|
|
284
|
+
async function pathExists(targetPath) {
|
|
285
|
+
try {
|
|
286
|
+
await fs.promises.access(targetPath);
|
|
287
|
+
return true;
|
|
288
|
+
} catch {
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function clampNumber(value, min, max) {
|
|
293
|
+
return Math.max(min, Math.min(max, value));
|
|
294
|
+
}
|
|
295
|
+
function clampInt(value, min, max) {
|
|
296
|
+
return clampNumber(Math.floor(value), min, max);
|
|
297
|
+
}
|
|
298
|
+
/** Alias for clampNumber (shorter, more common name) */
|
|
299
|
+
const clamp = clampNumber;
|
|
300
|
+
/**
|
|
301
|
+
* Escapes special regex characters in a string so it can be used in a RegExp constructor.
|
|
302
|
+
*/
|
|
303
|
+
function escapeRegExp(value) {
|
|
304
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Safely parse JSON, returning null on error instead of throwing.
|
|
308
|
+
*/
|
|
309
|
+
function safeParseJson(raw) {
|
|
310
|
+
try {
|
|
311
|
+
return JSON.parse(raw);
|
|
312
|
+
} catch {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Type guard for plain objects (not arrays, null, Date, RegExp, etc.).
|
|
318
|
+
* Uses Object.prototype.toString for maximum safety.
|
|
319
|
+
*/
|
|
320
|
+
function isPlainObject(value) {
|
|
321
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value) === "[object Object]";
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Type guard for Record<string, unknown> (less strict than isPlainObject).
|
|
325
|
+
* Accepts any non-null object that isn't an array.
|
|
326
|
+
*/
|
|
327
|
+
function isRecord(value) {
|
|
328
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
329
|
+
}
|
|
330
|
+
function normalizeE164(number) {
|
|
331
|
+
const digits = number.replace(/^whatsapp:/, "").trim().replace(/[^\d+]/g, "");
|
|
332
|
+
if (digits.startsWith("+")) return `+${digits.slice(1)}`;
|
|
333
|
+
return `+${digits}`;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* "Self-chat mode" heuristic (single phone): the gateway is logged in as the owner's own WhatsApp account,
|
|
337
|
+
* and `channels.whatsapp.allowFrom` includes that same number. Used to avoid side-effects that make no sense when the
|
|
338
|
+
* "bot" and the human are the same WhatsApp identity (e.g. auto read receipts, @mention JID triggers).
|
|
339
|
+
*/
|
|
340
|
+
function isSelfChatMode(selfE164, allowFrom) {
|
|
341
|
+
if (!selfE164) return false;
|
|
342
|
+
if (!Array.isArray(allowFrom) || allowFrom.length === 0) return false;
|
|
343
|
+
const normalizedSelf = normalizeE164(selfE164);
|
|
344
|
+
return allowFrom.some((n) => {
|
|
345
|
+
if (n === "*") return false;
|
|
346
|
+
try {
|
|
347
|
+
return normalizeE164(String(n)) === normalizedSelf;
|
|
348
|
+
} catch {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
function toWhatsappJid(number) {
|
|
354
|
+
const withoutPrefix = number.replace(/^whatsapp:/, "").trim();
|
|
355
|
+
if (withoutPrefix.includes("@")) return withoutPrefix;
|
|
356
|
+
return `${normalizeE164(withoutPrefix).replace(/\D/g, "")}@s.whatsapp.net`;
|
|
357
|
+
}
|
|
358
|
+
function resolveLidMappingDirs(opts) {
|
|
359
|
+
const dirs = /* @__PURE__ */ new Set();
|
|
360
|
+
const addDir = (dir) => {
|
|
361
|
+
if (!dir) return;
|
|
362
|
+
dirs.add(resolveUserPath(dir));
|
|
363
|
+
};
|
|
364
|
+
addDir(opts?.authDir);
|
|
365
|
+
for (const dir of opts?.lidMappingDirs ?? []) addDir(dir);
|
|
366
|
+
addDir(resolveOAuthDir());
|
|
367
|
+
addDir(path.join(CONFIG_DIR, "credentials"));
|
|
368
|
+
return [...dirs];
|
|
369
|
+
}
|
|
370
|
+
function readLidReverseMapping(lid, opts) {
|
|
371
|
+
const mappingFilename = `lid-mapping-${lid}_reverse.json`;
|
|
372
|
+
const mappingDirs = resolveLidMappingDirs(opts);
|
|
373
|
+
for (const dir of mappingDirs) {
|
|
374
|
+
const mappingPath = path.join(dir, mappingFilename);
|
|
375
|
+
try {
|
|
376
|
+
const data = fs.readFileSync(mappingPath, "utf8");
|
|
377
|
+
const phone = JSON.parse(data);
|
|
378
|
+
if (phone === null || phone === void 0) continue;
|
|
379
|
+
return normalizeE164(String(phone));
|
|
380
|
+
} catch {}
|
|
381
|
+
}
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
function jidToE164(jid, opts) {
|
|
385
|
+
const match = jid.match(/^(\d+)(?::\d+)?@(s\.whatsapp\.net|hosted)$/);
|
|
386
|
+
if (match) return `+${match[1]}`;
|
|
387
|
+
const lidMatch = jid.match(/^(\d+)(?::\d+)?@(lid|hosted\.lid)$/);
|
|
388
|
+
if (lidMatch) {
|
|
389
|
+
const lid = lidMatch[1];
|
|
390
|
+
const phone = readLidReverseMapping(lid, opts);
|
|
391
|
+
if (phone) return phone;
|
|
392
|
+
if (opts?.logMissing ?? shouldLogVerbose()) logVerbose(`LID mapping not found for ${lid}; skipping inbound message`);
|
|
393
|
+
}
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
async function resolveJidToE164(jid, opts) {
|
|
397
|
+
if (!jid) return null;
|
|
398
|
+
const direct = jidToE164(jid, opts);
|
|
399
|
+
if (direct) return direct;
|
|
400
|
+
if (!/(@lid|@hosted\.lid)$/.test(jid)) return null;
|
|
401
|
+
if (!opts?.lidLookup?.getPNForLID) return null;
|
|
402
|
+
try {
|
|
403
|
+
const pnJid = await opts.lidLookup.getPNForLID(jid);
|
|
404
|
+
if (!pnJid) return null;
|
|
405
|
+
return jidToE164(pnJid, opts);
|
|
406
|
+
} catch (err) {
|
|
407
|
+
if (shouldLogVerbose()) logVerbose(`LID mapping lookup failed for ${jid}: ${String(err)}`);
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function sleep(ms) {
|
|
412
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
413
|
+
}
|
|
414
|
+
function isHighSurrogate(codeUnit) {
|
|
415
|
+
return codeUnit >= 55296 && codeUnit <= 56319;
|
|
416
|
+
}
|
|
417
|
+
function isLowSurrogate(codeUnit) {
|
|
418
|
+
return codeUnit >= 56320 && codeUnit <= 57343;
|
|
419
|
+
}
|
|
420
|
+
function sliceUtf16Safe(input, start, end) {
|
|
421
|
+
const len = input.length;
|
|
422
|
+
let from = start < 0 ? Math.max(len + start, 0) : Math.min(start, len);
|
|
423
|
+
let to = end === void 0 ? len : end < 0 ? Math.max(len + end, 0) : Math.min(end, len);
|
|
424
|
+
if (to < from) {
|
|
425
|
+
const tmp = from;
|
|
426
|
+
from = to;
|
|
427
|
+
to = tmp;
|
|
428
|
+
}
|
|
429
|
+
if (from > 0 && from < len) {
|
|
430
|
+
if (isLowSurrogate(input.charCodeAt(from)) && isHighSurrogate(input.charCodeAt(from - 1))) from += 1;
|
|
431
|
+
}
|
|
432
|
+
if (to > 0 && to < len) {
|
|
433
|
+
if (isHighSurrogate(input.charCodeAt(to - 1)) && isLowSurrogate(input.charCodeAt(to))) to -= 1;
|
|
434
|
+
}
|
|
435
|
+
return input.slice(from, to);
|
|
436
|
+
}
|
|
437
|
+
function truncateUtf16Safe(input, maxLen) {
|
|
438
|
+
const limit = Math.max(0, Math.floor(maxLen));
|
|
439
|
+
if (input.length <= limit) return input;
|
|
440
|
+
return sliceUtf16Safe(input, 0, limit);
|
|
441
|
+
}
|
|
442
|
+
function resolveUserPath(input) {
|
|
443
|
+
const trimmed = input.trim();
|
|
444
|
+
if (!trimmed) return trimmed;
|
|
445
|
+
if (trimmed.startsWith("~")) {
|
|
446
|
+
const expanded = expandHomePrefix(trimmed, {
|
|
447
|
+
home: resolveRequiredHomeDir(process.env, os.homedir),
|
|
448
|
+
env: process.env,
|
|
449
|
+
homedir: os.homedir
|
|
450
|
+
});
|
|
451
|
+
return path.resolve(expanded);
|
|
452
|
+
}
|
|
453
|
+
return path.resolve(trimmed);
|
|
454
|
+
}
|
|
455
|
+
function resolveConfigDir(env = process.env, homedir = os.homedir) {
|
|
456
|
+
const override = env.OPENCLAW_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
|
|
457
|
+
if (override) return resolveUserPath(override);
|
|
458
|
+
const newDir = path.join(resolveRequiredHomeDir(env, homedir), ".openclaw");
|
|
459
|
+
try {
|
|
460
|
+
if (fs.existsSync(newDir)) return newDir;
|
|
461
|
+
} catch {}
|
|
462
|
+
return newDir;
|
|
463
|
+
}
|
|
464
|
+
function resolveHomeDir() {
|
|
465
|
+
return resolveEffectiveHomeDir(process.env, os.homedir);
|
|
466
|
+
}
|
|
467
|
+
function resolveHomeDisplayPrefix() {
|
|
468
|
+
const home = resolveHomeDir();
|
|
469
|
+
if (!home) return;
|
|
470
|
+
if (process.env.OPENCLAW_HOME?.trim()) return {
|
|
471
|
+
home,
|
|
472
|
+
prefix: "$OPENCLAW_HOME"
|
|
473
|
+
};
|
|
474
|
+
return {
|
|
475
|
+
home,
|
|
476
|
+
prefix: "~"
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
function shortenHomePath(input) {
|
|
480
|
+
if (!input) return input;
|
|
481
|
+
const display = resolveHomeDisplayPrefix();
|
|
482
|
+
if (!display) return input;
|
|
483
|
+
const { home, prefix } = display;
|
|
484
|
+
if (input === home) return prefix;
|
|
485
|
+
if (input.startsWith(`${home}/`) || input.startsWith(`${home}\\`)) return `${prefix}${input.slice(home.length)}`;
|
|
486
|
+
return input;
|
|
487
|
+
}
|
|
488
|
+
function shortenHomeInString(input) {
|
|
489
|
+
if (!input) return input;
|
|
490
|
+
const display = resolveHomeDisplayPrefix();
|
|
491
|
+
if (!display) return input;
|
|
492
|
+
return input.split(display.home).join(display.prefix);
|
|
493
|
+
}
|
|
494
|
+
function formatTerminalLink(label, url, opts) {
|
|
495
|
+
const esc = "\x1B";
|
|
496
|
+
const safeLabel = label.replaceAll(esc, "");
|
|
497
|
+
const safeUrl = url.replaceAll(esc, "");
|
|
498
|
+
if (!(opts?.force === true ? true : opts?.force === false ? false : Boolean(process.stdout.isTTY))) return opts?.fallback ?? `${safeLabel} (${safeUrl})`;
|
|
499
|
+
return `\u001b]8;;${safeUrl}\u0007${safeLabel}\u001b]8;;\u0007`;
|
|
500
|
+
}
|
|
501
|
+
const CONFIG_DIR = resolveConfigDir();
|
|
502
|
+
|
|
503
|
+
//#endregion
|
|
8
504
|
//#region src/plugins/runtime.ts
|
|
9
505
|
const createEmptyRegistry = () => ({
|
|
10
506
|
plugins: [],
|
|
@@ -208,17 +704,10 @@ function restoreTerminalState(reason) {
|
|
|
208
704
|
reportRestoreFailure("progress line", err, reason);
|
|
209
705
|
}
|
|
210
706
|
const stdin = process.stdin;
|
|
211
|
-
if (stdin.isTTY && typeof stdin.setRawMode === "function") {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
reportRestoreFailure("raw mode", err, reason);
|
|
216
|
-
}
|
|
217
|
-
if (typeof stdin.isPaused === "function" && stdin.isPaused()) try {
|
|
218
|
-
stdin.resume();
|
|
219
|
-
} catch (err) {
|
|
220
|
-
reportRestoreFailure("stdin resume", err, reason);
|
|
221
|
-
}
|
|
707
|
+
if (stdin.isTTY && typeof stdin.setRawMode === "function") try {
|
|
708
|
+
stdin.setRawMode(false);
|
|
709
|
+
} catch (err) {
|
|
710
|
+
reportRestoreFailure("raw mode", err, reason);
|
|
222
711
|
}
|
|
223
712
|
if (process.stdout.isTTY) try {
|
|
224
713
|
process.stdout.write(RESET_SEQUENCE);
|
|
@@ -690,4 +1179,4 @@ async function runCommandWithTimeout(argv, optionsOrTimeout) {
|
|
|
690
1179
|
}
|
|
691
1180
|
|
|
692
1181
|
//#endregion
|
|
693
|
-
export { setActivePluginRegistry as C, requireActivePluginRegistry as S, getChatChannelMeta as _, logDebug as a, normalizeChatChannelId as b, logWarn as c, clearActiveProgressLine as d, registerActiveProgressLine as f, DEFAULT_CHAT_CHANNEL as g, CHAT_CHANNEL_ORDER as h, spawnWithFallback as i, createSubsystemLogger as l, CHANNEL_IDS as m, runExec as n, logError as o, unregisterActiveProgressLine as p, formatSpawnError as r, logInfo as s, runCommandWithTimeout as t, defaultRuntime as u, normalizeAnyChannelId as v, getActivePluginRegistry as x, normalizeChannelId as y };
|
|
1182
|
+
export { warn as $, formatTerminalLink as A, safeParseJson as B, setActivePluginRegistry as C, clampNumber as D, clampInt as E, normalizeE164 as F, toWhatsappJid as G, shortenHomePath as H, pathExists as I, info as J, truncateUtf16Safe as K, resolveConfigDir as L, isRecord as M, isSelfChatMode as N, ensureDir as O, jidToE164 as P, success as Q, resolveJidToE164 as R, requireActivePluginRegistry as S, clamp as T, sleep as U, shortenHomeInString as V, sliceUtf16Safe as W, setVerbose as X, logVerbose as Y, shouldLogVerbose as Z, getChatChannelMeta as _, logDebug as a, normalizeLogLevel as at, normalizeChatChannelId as b, logWarn as c, clearActiveProgressLine as d, colorize as et, registerActiveProgressLine as f, DEFAULT_CHAT_CHANNEL as g, CHAT_CHANNEL_ORDER as h, spawnWithFallback as i, toPinoLikeLogger as it, isPlainObject as j, escapeRegExp as k, createSubsystemLogger as l, CHANNEL_IDS as m, runExec as n, theme as nt, logError as o, resolvePreferredOpenClawTmpDir as ot, unregisterActiveProgressLine as p, danger as q, formatSpawnError as r, getChildLogger as rt, logInfo as s, runCommandWithTimeout as t, isRich as tt, defaultRuntime as u, normalizeAnyChannelId as v, CONFIG_DIR as w, getActivePluginRegistry as x, normalizeChannelId as y, resolveUserPath as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as logVerboseConsole, D as warn, M as getLogger, T as shouldLogVerbose, o as createSubsystemLogger, p as defaultRuntime, v as danger, y as info } from "./entry.js";
|
|
2
2
|
import { execFile, spawn } from "node:child_process";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
@@ -9,6 +9,31 @@ import chalk, { Chalk } from "chalk";
|
|
|
9
9
|
import { execFile, spawn } from "node:child_process";
|
|
10
10
|
import { promisify } from "node:util";
|
|
11
11
|
|
|
12
|
+
//#region src/infra/tmp-openclaw-dir.ts
|
|
13
|
+
const POSIX_OPENCLAW_TMP_DIR = "/tmp/openclaw";
|
|
14
|
+
function isNodeErrorWithCode(err, code) {
|
|
15
|
+
return typeof err === "object" && err !== null && "code" in err && err.code === code;
|
|
16
|
+
}
|
|
17
|
+
function resolvePreferredOpenClawTmpDir(options = {}) {
|
|
18
|
+
const accessSync = options.accessSync ?? fs.accessSync;
|
|
19
|
+
const statSync = options.statSync ?? fs.statSync;
|
|
20
|
+
const tmpdir = options.tmpdir ?? os.tmpdir;
|
|
21
|
+
try {
|
|
22
|
+
if (!statSync(POSIX_OPENCLAW_TMP_DIR).isDirectory()) return path.join(tmpdir(), "openclaw");
|
|
23
|
+
accessSync(POSIX_OPENCLAW_TMP_DIR, fs.constants.W_OK | fs.constants.X_OK);
|
|
24
|
+
return POSIX_OPENCLAW_TMP_DIR;
|
|
25
|
+
} catch (err) {
|
|
26
|
+
if (!isNodeErrorWithCode(err, "ENOENT")) return path.join(tmpdir(), "openclaw");
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
accessSync("/tmp", fs.constants.W_OK | fs.constants.X_OK);
|
|
30
|
+
return POSIX_OPENCLAW_TMP_DIR;
|
|
31
|
+
} catch {
|
|
32
|
+
return path.join(tmpdir(), "openclaw");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
12
37
|
//#region src/logging/config.ts
|
|
13
38
|
function readLoggingConfig() {
|
|
14
39
|
const configPath = resolveConfigPath();
|
|
@@ -62,12 +87,13 @@ const loggingState = {
|
|
|
62
87
|
consoleTimestampPrefix: false,
|
|
63
88
|
consoleSubsystemFilter: null,
|
|
64
89
|
resolvingConsoleSettings: false,
|
|
90
|
+
streamErrorHandlersInstalled: false,
|
|
65
91
|
rawConsole: null
|
|
66
92
|
};
|
|
67
93
|
|
|
68
94
|
//#endregion
|
|
69
95
|
//#region src/logging/logger.ts
|
|
70
|
-
const DEFAULT_LOG_DIR =
|
|
96
|
+
const DEFAULT_LOG_DIR = resolvePreferredOpenClawTmpDir();
|
|
71
97
|
const DEFAULT_LOG_FILE = path.join(DEFAULT_LOG_DIR, "openclaw.log");
|
|
72
98
|
const LOG_PREFIX = "openclaw";
|
|
73
99
|
const LOG_SUFFIX = ".log";
|
|
@@ -677,17 +703,10 @@ function restoreTerminalState(reason) {
|
|
|
677
703
|
reportRestoreFailure("progress line", err, reason);
|
|
678
704
|
}
|
|
679
705
|
const stdin = process.stdin;
|
|
680
|
-
if (stdin.isTTY && typeof stdin.setRawMode === "function") {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
reportRestoreFailure("raw mode", err, reason);
|
|
685
|
-
}
|
|
686
|
-
if (typeof stdin.isPaused === "function" && stdin.isPaused()) try {
|
|
687
|
-
stdin.resume();
|
|
688
|
-
} catch (err) {
|
|
689
|
-
reportRestoreFailure("stdin resume", err, reason);
|
|
690
|
-
}
|
|
706
|
+
if (stdin.isTTY && typeof stdin.setRawMode === "function") try {
|
|
707
|
+
stdin.setRawMode(false);
|
|
708
|
+
} catch (err) {
|
|
709
|
+
reportRestoreFailure("raw mode", err, reason);
|
|
691
710
|
}
|
|
692
711
|
if (process.stdout.isTTY) try {
|
|
693
712
|
process.stdout.write(RESET_SEQUENCE);
|
|
@@ -1159,4 +1178,4 @@ async function runCommandWithTimeout(argv, optionsOrTimeout) {
|
|
|
1159
1178
|
}
|
|
1160
1179
|
|
|
1161
1180
|
//#endregion
|
|
1162
|
-
export { colorize as $, isPlainObject as A, shortenHomeInString as B, CONFIG_DIR as C, ensureDir as D, clampNumber as E, pathExists as F, truncateUtf16Safe as G, sleep as H, resolveConfigDir as I, logVerbose as J, danger as K, resolveJidToE164 as L, isSelfChatMode as M, jidToE164 as N, escapeRegExp as O, normalizeE164 as P, warn as Q, resolveUserPath as R, setActivePluginRegistry as S, clampInt as T, sliceUtf16Safe as U, shortenHomePath as V, toWhatsappJid as W, shouldLogVerbose as X, setVerbose as Y, success as Z, normalizeAnyChannelId as _, logDebug as a, getActivePluginRegistry as b, logWarn as c, clearActiveProgressLine as d, isRich as et, registerActiveProgressLine as f, getChatChannelMeta as g, CHAT_CHANNEL_ORDER as h, spawnWithFallback as i, normalizeLogLevel as it, isRecord as j, formatTerminalLink as k, createSubsystemLogger as l, CHANNEL_IDS as m, runExec as n, getChildLogger as nt, logError as o, unregisterActiveProgressLine as p, info as q, formatSpawnError as r, toPinoLikeLogger as rt, logInfo as s, runCommandWithTimeout as t, theme as tt, defaultRuntime as u, normalizeChannelId as v, clamp as w, requireActivePluginRegistry as x, normalizeChatChannelId as y, safeParseJson as z };
|
|
1181
|
+
export { colorize as $, isPlainObject as A, shortenHomeInString as B, CONFIG_DIR as C, ensureDir as D, clampNumber as E, pathExists as F, truncateUtf16Safe as G, sleep as H, resolveConfigDir as I, logVerbose as J, danger as K, resolveJidToE164 as L, isSelfChatMode as M, jidToE164 as N, escapeRegExp as O, normalizeE164 as P, warn as Q, resolveUserPath as R, setActivePluginRegistry as S, clampInt as T, sliceUtf16Safe as U, shortenHomePath as V, toWhatsappJid as W, shouldLogVerbose as X, setVerbose as Y, success as Z, normalizeAnyChannelId as _, logDebug as a, resolvePreferredOpenClawTmpDir as at, getActivePluginRegistry as b, logWarn as c, clearActiveProgressLine as d, isRich as et, registerActiveProgressLine as f, getChatChannelMeta as g, CHAT_CHANNEL_ORDER as h, spawnWithFallback as i, normalizeLogLevel as it, isRecord as j, formatTerminalLink as k, createSubsystemLogger as l, CHANNEL_IDS as m, runExec as n, getChildLogger as nt, logError as o, unregisterActiveProgressLine as p, info as q, formatSpawnError as r, toPinoLikeLogger as rt, logInfo as s, runCommandWithTimeout as t, theme as tt, defaultRuntime as u, normalizeChannelId as v, clamp as w, requireActivePluginRegistry as x, normalizeChatChannelId as y, safeParseJson as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as getLogger, D as info, E as danger, F as warn, N as shouldLogVerbose, c as defaultRuntime, j as logVerboseConsole, t as createSubsystemLogger } from "./subsystem-
|
|
1
|
+
import { B as getLogger, D as info, E as danger, F as warn, N as shouldLogVerbose, c as defaultRuntime, j as logVerboseConsole, t as createSubsystemLogger } from "./subsystem-BoExtIHo.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { execFile, spawn } from "node:child_process";
|
|
4
4
|
import { promisify } from "node:util";
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import "./paths-DVBShlw6.js";
|
|
2
|
-
import { L as isRich, R as theme, c as defaultRuntime } from "./subsystem-
|
|
3
|
-
import "./utils-
|
|
4
|
-
import "./exec-
|
|
5
|
-
import "./agent-scope-
|
|
6
|
-
import "./model-selection-
|
|
2
|
+
import { L as isRich, R as theme, c as defaultRuntime } from "./subsystem-BoExtIHo.js";
|
|
3
|
+
import "./utils-Cd9QdCHh.js";
|
|
4
|
+
import "./exec-YIosokWE.js";
|
|
5
|
+
import "./agent-scope-CQCus0rI.js";
|
|
6
|
+
import "./model-selection-BLuqsGVB.js";
|
|
7
7
|
import "./github-copilot-token-BW-SEg7E.js";
|
|
8
8
|
import "./boolean-BgXe2hyu.js";
|
|
9
|
-
import "./env-
|
|
10
|
-
import "./config
|
|
11
|
-
import "./manifest-registry-
|
|
12
|
-
import "./message-channel-
|
|
13
|
-
import "./client-
|
|
14
|
-
import "./call-
|
|
15
|
-
import { n as formatTimeAgo } from "./format-relative-
|
|
16
|
-
import { t as formatDocsLink } from "./links-
|
|
17
|
-
import "./progress-
|
|
18
|
-
import { g as saveExecApprovals, l as readExecApprovalsSnapshot } from "./exec-approvals-
|
|
19
|
-
import { t as renderTable } from "./table-
|
|
20
|
-
import "./service
|
|
21
|
-
import "./systemd-
|
|
22
|
-
import { n as callGatewayFromCli } from "./gateway-rpc-
|
|
23
|
-
import { t as describeUnknownError } from "./shared-
|
|
24
|
-
import { n as nodesCallOpts, r as resolveNodeId } from "./rpc-
|
|
9
|
+
import "./env-ONzUVAG2.js";
|
|
10
|
+
import "./config-aFQssWKX.js";
|
|
11
|
+
import "./manifest-registry-CQhdnDBZ.js";
|
|
12
|
+
import "./message-channel-BLi2a6Yw.js";
|
|
13
|
+
import "./client-BrYfyoDK.js";
|
|
14
|
+
import "./call-SolyGS1r.js";
|
|
15
|
+
import { n as formatTimeAgo } from "./format-relative-cegC_FF5.js";
|
|
16
|
+
import { t as formatDocsLink } from "./links-Eax1UO3w.js";
|
|
17
|
+
import "./progress-C9kngsTD.js";
|
|
18
|
+
import { g as saveExecApprovals, l as readExecApprovalsSnapshot } from "./exec-approvals-Cb4ZLukq.js";
|
|
19
|
+
import { t as renderTable } from "./table-B8dx3v4v.js";
|
|
20
|
+
import "./service--nPk7DvT.js";
|
|
21
|
+
import "./systemd-DrmBtJ5T.js";
|
|
22
|
+
import { n as callGatewayFromCli } from "./gateway-rpc-wXSCUZXj.js";
|
|
23
|
+
import { t as describeUnknownError } from "./shared-Bs4vduG4.js";
|
|
24
|
+
import { n as nodesCallOpts, r as resolveNodeId } from "./rpc-T300F8zI.js";
|
|
25
25
|
import JSON5 from "json5";
|
|
26
26
|
import fs from "node:fs/promises";
|
|
27
27
|
|