wednesdayai 0.6.1-dev.32 → 0.6.1-dev.33
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/README.md +1 -1
- package/dist/{agent-3FzVgs63.js → agent-2N9tEN3b.js} +26 -26
- package/dist/{agent-BRCd10MY.js → agent-B9sehkTT.js} +33 -33
- package/dist/{agent-DWnmq11O.js → agent-C31FKy1u.js} +11 -11
- package/dist/{agent-turn-execute-BFxbgU1N.js → agent-turn-execute-VfgfznZ9.js} +46 -46
- package/dist/{agent-turn-runner-T5NCMyJ_.js → agent-turn-runner-BUl_5WBC.js} +5 -5
- package/dist/{agent-turn-runner-CSA2LtLh.js → agent-turn-runner-D6au_ann.js} +6 -6
- package/dist/{agent-turn-runner-B4cl3TsM.js → agent-turn-runner-Pc5bI_FG.js} +6 -6
- package/dist/{auth-5so61ncT.js → auth-kjIpJLfy.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +32 -32
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-journal/handler.js +31 -31
- package/dist/bundled/session-memory/handler.js +32 -32
- package/dist/{call-DVys4c4T.js → call-CrRxRh7U.js} +4 -4
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{plugin-sdk/chrome-BqXrH3aN.js → chrome-B_WMQAhO.js} +32 -32
- package/dist/{chrome-CQUZm4YB.js → chrome-Dhi-l6wT.js} +6 -6
- package/dist/{chrome-DqTgSmFm.js → chrome-DnhfF77Z.js} +6 -6
- package/dist/{command-queue-BSbitNdP.js → command-queue-AIWqKnVD.js} +1 -1
- package/dist/{command-queue-DogAVmq_.js → command-queue-CYUdNrXN.js} +1 -1
- package/dist/{command-queue-D3kWdijx.js → command-queue-Ctuw0Dti.js} +1 -1
- package/dist/control-ui-v2/assets/{AgentsView-BHoDo1L_.js → AgentsView-BykJAM_R.js} +1 -1
- package/dist/control-ui-v2/assets/{AutomationsView-CkkUCwky.js → AutomationsView-DC7X5Cuq.js} +1 -1
- package/dist/control-ui-v2/assets/Badge-BThfbCAq.js +1 -0
- package/dist/control-ui-v2/assets/{Button-CAmVftjk.js → Button-sKbvzDVv.js} +1 -1
- package/dist/control-ui-v2/assets/{ChannelsView-C9mkTqc6.js → ChannelsView-HkWy9hsS.js} +1 -1
- package/dist/control-ui-v2/assets/{ConfigForm-LRLk4KUb.js → ConfigForm-BJ2kFOXh.js} +1 -1
- package/dist/control-ui-v2/assets/{ConfirmDialog-F2xUWFqq.js → ConfirmDialog-CdyUa20w.js} +1 -1
- package/dist/control-ui-v2/assets/{DataTable-DOMUEHUS.js → DataTable-DYjiiFEO.js} +1 -1
- package/dist/control-ui-v2/assets/{DebugView-Brby9otE.js → DebugView-BBnZon9I.js} +1 -1
- package/dist/control-ui-v2/assets/{Dialog-GhMZjPwr.js → Dialog-C3D58UYL.js} +1 -1
- package/dist/control-ui-v2/assets/{DreamsView-DY7ted1D.js → DreamsView-DrwwXxFE.js} +1 -1
- package/dist/control-ui-v2/assets/{EntityLink-CrtCt-Qs.js → EntityLink-Z9K13Z04.js} +1 -1
- package/dist/control-ui-v2/assets/{FilterPills-CkHzGD5G.js → FilterPills-KLG4v-tl.js} +1 -1
- package/dist/control-ui-v2/assets/{InstancesView-CFs-ov6N.js → InstancesView-LuIMblfp.js} +1 -1
- package/dist/control-ui-v2/assets/{LearningView-BTIvp31K.js → LearningView-C2puhMj4.js} +1 -1
- package/dist/control-ui-v2/assets/{LogsView-BuFHneew.js → LogsView-Dy215edw.js} +1 -1
- package/dist/control-ui-v2/assets/{NodesView-7y8z5Q_T.js → NodesView-B71zmfhs.js} +1 -1
- package/dist/control-ui-v2/assets/{OverviewView-CIhAnOeN.js → OverviewView-JLhTfCru.js} +1 -1
- package/dist/control-ui-v2/assets/{Panel-BSfoMFU-.js → Panel-D78gp_RZ.js} +1 -1
- package/dist/control-ui-v2/assets/{PluginMount-Cr2vPF1o.js → PluginMount-DYlgGaMj.js} +1 -1
- package/dist/control-ui-v2/assets/{PluginPageView-BM2wjaCs.js → PluginPageView-Bg02Y5T6.js} +1 -1
- package/dist/control-ui-v2/assets/{PluginPanels-CrZnLVxd.js → PluginPanels-BleAmjiK.js} +1 -1
- package/dist/control-ui-v2/assets/{RunsView-B3eXHaoR.js → RunsView-BSGqEHKy.js} +1 -1
- package/dist/control-ui-v2/assets/{SessionsView-Bg4wx4lK.js → SessionsView-CMPY9Hgt.js} +1 -1
- package/dist/control-ui-v2/assets/{SettingsView-DGF7hzQG.js → SettingsView-D4QcuA0E.js} +1 -1
- package/dist/control-ui-v2/assets/{SkillsView-Cg7pJC7c.js → SkillsView-BWwsXZqF.js} +1 -1
- package/dist/control-ui-v2/assets/{Stat-lXrvX_LU.js → Stat-CXVUEU8q.js} +1 -1
- package/dist/control-ui-v2/assets/{StatusDot-mq9dIxHu.js → StatusDot-BOn9P0HR.js} +1 -1
- package/dist/control-ui-v2/assets/{StorageView-DwpkJ4z3.js → StorageView-Bn5jFxV6.js} +1 -1
- package/dist/control-ui-v2/assets/{UpdatedAgo-C4M24VEo.js → UpdatedAgo-CGh7wGn5.js} +1 -1
- package/dist/control-ui-v2/assets/{UsageView-Chdv6FaY.js → UsageView-D8N9_FXE.js} +1 -1
- package/dist/control-ui-v2/assets/{config-store-Cl6ZDEWe.js → config-store-CvkpUhCj.js} +1 -1
- package/dist/control-ui-v2/assets/{format-B5-CxWkB.js → format-CDdlmhUx.js} +1 -1
- package/dist/control-ui-v2/assets/{gateway-features-cO4oPTtR.js → gateway-features-BO759ssE.js} +1 -1
- package/dist/control-ui-v2/assets/{index-CJgogGns.js → index-DbvFKOkE.js} +1 -1
- package/dist/control-ui-v2/assets/{links-Cc4kr7jc.js → links-CQf0Dstl.js} +2 -2
- package/dist/control-ui-v2/assets/{run-rows-B5xQqo0g.js → run-rows-B7a70RYo.js} +1 -1
- package/dist/control-ui-v2/assets/runs-store-CBxmiHic.js +1 -0
- package/dist/control-ui-v2/assets/{use-gateway-query-DkXhPwE7.js → use-gateway-query-Dd6G1xB1.js} +1 -1
- package/dist/control-ui-v2/index.html +7 -7
- package/dist/{credentials-BwbcjFrG.js → credentials-By3Y4AcL.js} +3 -3
- package/dist/daemon-cli.js +10 -10
- package/dist/{deliver-D5-592ul.js → deliver-BNwRhCqc.js} +28 -28
- package/dist/{deliver-uol2d4WF.js → deliver-CZ0gpdcA.js} +6 -6
- package/dist/{deliver-DI3pbsEG.js → deliver-lAcWrtsj.js} +8 -8
- package/dist/{diagnostic-BZYYYnMx.js → diagnostic-DJ11ZJIJ.js} +3 -3
- package/dist/{diagnostic-CjNtSJJy.js → diagnostic-Dlx1Uind.js} +3 -3
- package/dist/{diagnostic-DutvZ2o1.js → diagnostic-dKeDyhIs.js} +1 -1
- package/dist/{plugin-sdk/errors-CVfTQSbb.js → errors-0-at0aYV.js} +1 -1
- package/dist/{errors-BRYMqzPb.js → errors-7NHaEHOi.js} +1 -1
- package/dist/extensionAPI.js +24 -24
- package/dist/{fences-DdMLzXvz.js → fences-BXndK9rN.js} +2 -2
- package/dist/{fences-Dtk43Q2a.js → fences-Z8d1dj8p.js} +16 -16
- package/dist/{fences-DxsYNv6D.js → fences-qAryzYhN.js} +1 -1
- package/dist/{fetch-guard-CIElogmD.js → fetch-guard-C1e2uLCm.js} +2 -2
- package/dist/{fetch-guard-huDqYgcZ.js → fetch-guard-DVq681NM.js} +2 -2
- package/dist/{fetch-guard-BfFAgAdL.js → fetch-guard-jXOgaL7k.js} +2 -2
- package/dist/{frontmatter-DHBTRDiB.js → frontmatter-CzhUc9Ri.js} +5 -5
- package/dist/{fs-safe-BXAFIPNF.js → fs-safe-B9UKPVRL.js} +2 -2
- package/dist/{fs-safe-QppbBgli.js → fs-safe-BFMvT9d3.js} +1 -1
- package/dist/{fs-safe-CyG0wflg.js → fs-safe-DMWtsz4J.js} +26 -26
- package/dist/{group-DNWpfMve.js → group-Dvl8dfJ2.js} +6 -6
- package/dist/{legacy-names-6uH6aLhq.js → legacy-names-chsmo2vs.js} +26 -26
- package/dist/llm-slug-generator.js +31 -31
- package/dist/{manager-DEELDila.js → manager-CIl1uCF4.js} +5 -5
- package/dist/{manager-Dv0046Wp.js → manager-Cd7Dgpw3.js} +16 -16
- package/dist/{manager-BNDUt5V7.js → manager-Edt-T8Bi.js} +3 -3
- package/dist/{model-selection-DfBJgjil.js → model-selection-BkyEkRcd.js} +1 -1
- package/dist/{model-selection-BKz1FEg5.js → model-selection-ik2bHbgK.js} +82 -82
- package/dist/{net-B0Jtxfrs.js → net-DJsykMK1.js} +1 -1
- package/dist/{nudge-D6njZF1b.js → nudge-D3beOdMV.js} +6 -6
- package/dist/{nudge-iXg_oCkW.js → nudge-Dg8Pe_sD.js} +9 -9
- package/dist/{nudge-D6LqS1z9.js → nudge-DyQYIOed.js} +32 -32
- package/dist/{outbound-attachment-DkplciK0.js → outbound-attachment-C3f9uSt-.js} +4 -4
- package/dist/{outbound-attachment-6hHA3eSm.js → outbound-attachment-DQtDt9Ne.js} +9 -9
- package/dist/{outbound-attachment-DFE9e7Dz.js → outbound-attachment-DwgRvpkl.js} +7 -7
- package/dist/{pi-embedded-CM4cbQEb.js → pi-embedded-BUj1tpxL.js} +40 -40
- package/dist/{pi-embedded-BJeshpuP.js → pi-embedded-DRpnAuxu.js} +229 -229
- package/dist/{pi-model-discovery-CEEWv-kw.js → pi-model-discovery-DnTVd1y8.js} +1 -1
- package/dist/{pi-model-discovery-Dy1iZEn3.js → pi-model-discovery-MJKT8QcH.js} +1 -1
- package/dist/{pi-model-discovery-BzUe_TlM.js → pi-model-discovery-ihTZFn93.js} +7 -7
- package/dist/plugin-sdk/{agent-CUhnjg2h.js → agent-CACbclxE.js} +33 -33
- package/dist/plugin-sdk/{agent-turn-execute-0wNK8kb-.js → agent-turn-execute-BKMaKZMH.js} +52 -52
- package/dist/plugin-sdk/{agent-turn-runner-Bc1Wdfjl.js → agent-turn-runner-Dfbuq8sa.js} +6 -6
- package/dist/{chrome-D5VU16Pm.js → plugin-sdk/chrome-CRKazKtD.js} +7 -7
- package/dist/plugin-sdk/{command-queue-BuyhMwmf.js → command-queue-CYthkMHd.js} +1 -1
- package/dist/plugin-sdk/{deliver-BbYD9jbj.js → deliver-Bh_zU4gN.js} +10 -10
- package/dist/plugin-sdk/{diagnostic-YH_V803S.js → diagnostic-DUBIUJLy.js} +3 -3
- package/dist/{errors-CK3mNfUZ.js → plugin-sdk/errors-BYlk21G9.js} +1 -1
- package/dist/plugin-sdk/{fetch-guard-BiQARj-q.js → fetch-guard-tC95Od8D.js} +2 -2
- package/dist/plugin-sdk/{fs-safe-CGzRyGpY.js → fs-safe-DkRYPO9h.js} +2 -2
- package/dist/plugin-sdk/{image-ops-BrERoy-B.js → image-ops-BwFCJNka.js} +2 -2
- package/dist/plugin-sdk/{manager-DPJBcR4V.js → manager-BFK04-sl.js} +5 -5
- package/dist/plugin-sdk/{model-auth-BtSCt2Us.js → model-auth-5dizn5pk.js} +6 -6
- package/dist/plugin-sdk/{models-config-GBg5F8hJ.js → models-config-Q1RpJb2l.js} +2 -2
- package/dist/plugin-sdk/{nudge-DRCem0PL.js → nudge-RygJmKvJ.js} +10 -10
- package/dist/plugin-sdk/{openai-compatible-video-5WcKNGBU.js → openai-compatible-video-Dcy2Li9N.js} +6 -6
- package/dist/plugin-sdk/{outbound-attachment-DTKZLRZQ.js → outbound-attachment-BzyByi-v.js} +7 -7
- package/dist/plugin-sdk/{pi-embedded-helpers-CuwPxkvz.js → pi-embedded-helpers-BFhpUeAU.js} +13 -13
- package/dist/plugin-sdk/{pi-embedded-utils-C8Mld73X.js → pi-embedded-utils-DwU_Dm_t.js} +3 -3
- package/dist/plugin-sdk/{pi-model-discovery-DF78NwCY.js → pi-model-discovery-JhPOgHc2.js} +1 -1
- package/dist/plugin-sdk/provider-media-understanding.js +16 -16
- package/dist/plugin-sdk/{pw-ai-DE9_F3UT.js → pw-ai-CetM9Gvn.js} +8 -8
- package/dist/plugin-sdk/{qmd-manager-Be0AD8g6.js → qmd-manager-D-4-ofwq.js} +6 -6
- package/dist/plugin-sdk/{qmd-scope-ChYVD8_V.js → qmd-scope-C2Q-gYkx.js} +1 -1
- package/dist/plugin-sdk/{query-expansion-D7KVLAEI.js → query-expansion-WqJIYjMY.js} +2 -2
- package/dist/plugin-sdk/{recorder-CYbCMbkp.js → recorder-Buet60MM.js} +2 -2
- package/dist/{redact-DU9QXIsh.js → plugin-sdk/redact-BsmP2_ML.js} +1 -1
- package/dist/plugin-sdk/{reply-directives-C8nS86oo.js → reply-directives-vq-0__VY.js} +2 -2
- package/dist/plugin-sdk/{runs-DaXWESgL.js → runs-Bo9ZU_tS.js} +7 -7
- package/dist/plugin-sdk/{send-DNtB7RqD.js → send-C7mdLoxn.js} +5 -5
- package/dist/plugin-sdk/{send-A18Yldb9.js → send-O0_QKrFT.js} +4 -4
- package/dist/plugin-sdk/{sessions-CaOQHLR9.js → sessions-DBkZJFck.js} +3 -3
- package/dist/plugin-sdk/{ssrf-BUsxUAWv.js → ssrf-DwUheH8N.js} +1 -1
- package/dist/{subsystem-DoQFckDJ.js → plugin-sdk/subsystem-DGPv0F8I.js} +5 -5
- package/dist/plugin-sdk/{tool-loop-detection-CofD0zz1.js → tool-loop-detection-CJnz5pAZ.js} +1 -1
- package/dist/plugin-sdk/{user-run-recording-BHcbX_ct.js → user-run-recording-CcRIjxcn.js} +2 -2
- package/dist/plugin-sdk/{ws-fpqheALb.js → ws-BmHfUkZI.js} +1 -1
- package/dist/{ports-B3BTfmE-.js → ports-af3jAFGh.js} +2 -2
- package/dist/{progress-CuNmfDlK.js → progress-CmedxTqJ.js} +3 -3
- package/dist/{proxy-env-CHdvLB3R.js → proxy-env-B9kcG28B.js} +1 -1
- package/dist/{proxy-env-E2mZELS1.js → proxy-env-Catj9Viz.js} +1 -1
- package/dist/{proxy-env-Dayk9Sh-.js → proxy-env-DQFy-pBt.js} +1 -1
- package/dist/{pw-ai-mN-uQx62.js → pw-ai-BWm3mCae.js} +9 -9
- package/dist/{pw-ai-BV3I_k2z.js → pw-ai-CDg9EuQp.js} +5 -5
- package/dist/{pw-ai--9RsLl-I.js → pw-ai-DoQ300T0.js} +11 -11
- package/dist/{qmd-manager-IBVkRbDA.js → qmd-manager-DFBcLXne.js} +6 -6
- package/dist/{qmd-manager-B4bmSWg6.js → qmd-manager-DbHyIFsT.js} +4 -4
- package/dist/{qmd-manager-pXzVcStZ.js → qmd-manager-jGcc2exw.js} +9 -9
- package/dist/{qmd-scope-C-qiTyK0.js → qmd-scope-D25aU1jR.js} +1 -1
- package/dist/{qmd-scope-CyWbQgiS.js → qmd-scope-DMUA3Vq9.js} +1 -1
- package/dist/{qmd-scope-C3LDIy_f.js → qmd-scope-DxmwIijL.js} +1 -1
- package/dist/{query-expansion-DUYY60_G.js → query-expansion-BC9pRVpQ.js} +1 -1
- package/dist/{query-expansion-BfJwCH-1.js → query-expansion-DJ7rNitK.js} +2 -2
- package/dist/{query-expansion-DOdiE1jh.js → query-expansion-Dji7d64T.js} +13 -13
- package/dist/{recorder-BaUTigy-.js → recorder-CBd8Sa3f.js} +2 -2
- package/dist/{recorder-DbOS8cq-.js → recorder-ciEoXXwJ.js} +2 -2
- package/dist/{recorder-tm_DPmVq.js → recorder-jtfym7ix.js} +1 -1
- package/dist/{plugin-sdk/redact-SduMExGO.js → redact-BvO7EAk7.js} +1 -1
- package/dist/{redact-C4XKILzo.js → redact-LOuk7TRy.js} +1 -1
- package/dist/{reply-directives-lb54XxBO.js → reply-directives-BZPLXOax.js} +14 -14
- package/dist/{reply-directives-Cjv6usSI.js → reply-directives-CD8SVo0d.js} +49 -49
- package/dist/{reply-directives-DQdLCsf7.js → reply-directives-CzQd7ai4.js} +9 -9
- package/dist/{runs-C6ZLA3dQ.js → runs-CKVgIXbm.js} +7 -7
- package/dist/{runs-Bfh4gXhE.js → runs-CW-qjeWY.js} +8 -8
- package/dist/{runs-CRfwfxl9.js → runs-CX5t6UjO.js} +5 -5
- package/dist/{send-DhxoS0EQ.js → send-BClohEtC.js} +5 -5
- package/dist/{send-x0brK-7B.js → send-Bb4J4QPH.js} +4 -4
- package/dist/{send-DdufVWN0.js → send-Bn1WCNeb.js} +4 -4
- package/dist/{send-CQXAcrXk.js → send-C9EWa4Gn.js} +3 -3
- package/dist/{send-DgX5MIBr.js → send-CpXb_hwQ.js} +5 -5
- package/dist/{send-CDE-Y46D.js → send-DkfdQWGD.js} +4 -4
- package/dist/{sessions-DFfMZLkJ.js → sessions-C98njXHy.js} +1 -1
- package/dist/{sessions-CoqAntnj.js → sessions-Dwd5H-eS.js} +5 -5
- package/dist/{subsystem-DY5Ww-lX.js → subsystem-BntNuBAj.js} +4 -4
- package/dist/{plugin-sdk/subsystem-Btq0amiz.js → subsystem-cFv2jJm-.js} +70 -70
- package/dist/{tool-loop-detection-CtOkwPJY.js → tool-loop-detection-9fAxiikd.js} +2 -2
- package/dist/{tool-loop-detection-C8jnlLQJ.js → tool-loop-detection-BMpeJ2DE.js} +1 -1
- package/dist/{user-run-recording-Dw1uyV3d.js → user-run-recording-BsWiQH6f.js} +1 -1
- package/dist/{user-run-recording-D-qMoYVy.js → user-run-recording-CisdKSzW.js} +2 -2
- package/dist/{user-run-recording-UvvXT13r.js → user-run-recording-DBqvoOPn.js} +2 -2
- package/dist/web-client/assets/{hast-util-from-dom-SbSARCyf.js → hast-util-from-dom-CUZ3hAh_.js} +1 -1
- package/dist/web-client/assets/{hast-util-to-mdast-C1n0gLxk.js → hast-util-to-mdast-DsCIyZ_Y.js} +1 -1
- package/dist/web-client/assets/{index-UZef_CpP.js → index-BvHk50NK.js} +2 -2
- package/dist/web-client/index.html +1 -1
- package/dist/{ws-kGFg1v4B.js → ws-B4SUb9f_.js} +1 -1
- package/dist/{ws-BJ7VU-8f.js → ws-BOnegOZK.js} +1 -1
- package/extensions/a2a/package.json +1 -1
- package/extensions/acpx/package.json +1 -1
- package/extensions/anthropic/package.json +1 -1
- package/extensions/bifrost/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/deepgram/package.json +1 -1
- package/extensions/deepinfra/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/dream-cycle/package.json +1 -1
- package/extensions/elevenlabs/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/gemini-search/package.json +1 -1
- package/extensions/google/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/grok-search/package.json +1 -1
- package/extensions/groq/package.json +1 -1
- package/extensions/identity-oidc/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/kimi-search/package.json +1 -1
- package/extensions/kokoro/package.json +1 -1
- package/extensions/learning-core/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 +1 -1
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/mistral/package.json +1 -1
- package/extensions/moonshot/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +1 -1
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +1 -1
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/openai/package.json +1 -1
- package/extensions/openai-realtime/package.json +1 -1
- package/extensions/openrouter/package.json +1 -1
- package/extensions/perplexity-search/package.json +1 -1
- package/extensions/searxng-search/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 +1 -1
- package/extensions/twitch/package.json +1 -1
- package/extensions/ui-surfaces/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +1 -1
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zai/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +1 -1
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +1 -1
- package/extensions/zalouser/package.json +1 -1
- package/package.json +3 -1
- package/dist/control-ui-v2/assets/Badge-Ckq3aEJa.js +0 -1
- package/dist/control-ui-v2/assets/runs-store-D8Ckq4AP.js +0 -1
- package/dist/github-copilot-token-Bm6yG6tw.js +0 -106
- package/dist/paths-BIDPYPVC.js +0 -233
- package/docs/reference/templates/BOOT.md +0 -11
- /package/dist/{config-1om7Pwz0.js → config-CM9p9U7m.js} +0 -0
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { $ as setConfigValueAtPath, $i as withFileLock$1, $r as stringEnum, $t as addRegisteredPluginApi, A as resolveApiKeyForProvider, Ai as isSafeExecutableValue, An as loadSessionStoreFromDisk, Ar as normalizeSessionDeliveryFields, At as BUNDLED_ENABLED_BY_DEFAULT, B as resolveProfilesUnavailableReason, Bi as getShellPathFromLoginShell, Bn as SESSION_RUN_STORE_FILE_NAME, Br as GATEWAY_CLIENT_IDS, Bt as CHAT_CHANNEL_ORDER, C as buildAssistantMessage, Ca as resolveAgentSkillsFilter, Ci as isShellWrapperExecutable, Cn as updateSessionStoreEntry, Cr as resolveAccountEntry, D as getApiKeyForModel, Da as resolveRunModelFallbacksOverride, Di as SAFE_BIN_PROFILES, Dn as prepareConfiguredSessionStorageRuntimeActivation, Dr as deliveryContextKey, Dt as loadPluginManifestRegistry, E as buildUsageWithNoCost, Ei as splitShellArgs, En as commitPreparedConfiguredSessionStorageRuntimeActivation, Er as deliveryContextFromSession, Et as validateJsonSchemaValue, F as resolveAuthProfileOrder, Fi as parseDotPath, Fn as parseSessionIndexRecordKey, Fr as isMarkdownCapableMessageChannel, Ft as resolveMemorySlotDecision, G as writeConfigFile, Gi as getRuntimeConfigSnapshot, Gr as readTaskWorkStates, Gt as normalizeChatChannelId, H as loadConfig, Hi as isTruthyEnvValue, Hn as resolveSessionFilePath, Hr as GATEWAY_CLIENT_NAMES, Ht as listChatChannels, I as getSoonestCooldownExpiry, Ii as secretRefKey, Ir as listDeliverableMessageChannels, It as discoverOpenClawPlugins, J as resetConfigOverrides, Ji as listProfilesForProvider, Jn as resolveSessionLockMaxHoldFromTimeout, Jt as getActivePluginRegistry, K as createConfigIO, Ki as applyMergePatch, Kn as resolveStorePath, Kt as resolveChannelConfigId, L as isProfileInCooldown, Li as runTasksWithConcurrency, Lr as normalizeMessageChannel, Lt as isPathInside, M as resolveModelAuthMode, Ma as resolveAgentModelPrimaryValue, Mi as describeUnknownError$1, Mn as parseDurationMs, Mr as isDeliverableMessageChannel, Mt as isBundledChannelEnabledByChannelConfig, N as resolveModelProviderConfig, Na as toAgentModelListLike, Ni as isNonEmptyString, Nn as getConfiguredSessionStorageRuntime, Nt as normalizePluginsConfig, O as getCustomProviderApiKey, Oa as resolveSessionAgentId, Oi as normalizeSafeBinProfileFixtures, On as refreshConfiguredSessionBindingEntry, Or as mergeDeliveryContext, Ot as DOCS_SITE_URL, Pi as isRecord$1, Pr as isInternalMessageChannel, Pt as resolveEffectiveEnableState, Q as parseConfigPath, Qi as resolveOpenClawAgentDir, Qn as resolveFreshSessionTotalTokens, Qr as optionalStringEnum, Qt as setActivePluginRegistry, R as markAuthProfileFailure, Ri as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Rr as resolveGatewayMessageChannel, Rt as safeStatSync, S as createOllamaStreamFn, Si as isDispatchWrapperExecutable, Sn as updateSessionStore, Sr as resolveChannelGroupToolsPolicy, T as buildStreamErrorAssistantMessage, Ta as resolveDefaultAgentId, Ti as unwrapKnownShellMultiplexerInvocation, Tn as closeReplacedConfiguredSessionStorageRuntime, Tr as normalizeChatType, Tt as listBindings, U as readConfigFileSnapshot, Ui as resolveOwnerDisplaySetting, Un as resolveSessionFilePathOptions, Ut as normalizeAnyChannelId, V as resolveApiKeyForProfile, Vi as resolveShellEnvFallbackTimeoutMs, Vr as GATEWAY_CLIENT_MODES, Vt as getChatChannelMeta, W as readConfigFileSnapshotForWrite, Wi as advanceRuntimeConfigSnapshot, Wn as resolveSessionTranscriptPath, Wr as CtxProjectionCorruptionError, Wt as normalizeChannelId$2, X as unsetConfigOverride, Xi as ensureAuthProfileStore, Xn as DEFAULT_RESET_TRIGGERS, Xr as channelTargetSchema, Y as setConfigOverride, Yi as markAuthProfileGood, Yt as getActivePluginRegistryKey, Z as getConfigValueAtPath, Zi as resolveAuthStorePathForDisplay, Zn as mergeSessionEntry, Zr as channelTargetsSchema, Zt as requireActivePluginRegistry, _i as DEFAULT_SAFE_BINS, _n as getConversationReadQuery, _r as formatCliCommand, a as isCliProvider, aa as coerceSecretRef, ai as listBufferedPluginTaskPasses, an as executePluginCommand, ar as getChannelDock, at as resolveIMessageAttachmentRoots, b as retryAsync, ba as resolveAgentDir, bi as resolveCommandResolutionFromArgv, bn as recordSessionMetaFromInbound, br as resolveChannelGroupPolicy, c as normalizeProviderId, ca as resolveSecretInputRef, ci as getTrustedSafeBinDirs, cn as registerPluginCommand, cr as getChannelPlugin, ct as parseNonNegativeByteSize, d as resolveDefaultModelForAgent, da as DEFAULT_MODEL, di as normalizeTrustedSafeBinDirs, dn as getSpeechProvider, dr as listEnabledSignalAccounts, ea as isPidAlive, ei as applyTargetToParams, en as clearRegisteredPluginApis, er as deriveSessionMetaPatch, et as unsetConfigValueAtPath, f as resolveModelRefFromString, fa as DEFAULT_PROVIDER, fi as validateSafeBinArgv, fn as isBuiltinTtsProvider, fr as resolveSignalAccount, ga as isInternalAgentSessionKey, gi as splitCommandChain, gn as createConversationReadQuery, gr as resolveWhatsAppAccount, h as resolveThinkingDefault, ha as isAgentUserFacing, hi as isWindowsPlatform, hn as StorageReadAccessError, hr as hasAnyWhatsAppAuth, i as findNormalizedProviderValue, ia as normalizeSecretInput, ii as discardBufferedPluginTaskPasses, in as clearPluginCommands, ir as normalizeStringEntries, it as mergeInboundPathRoots, j as resolveEnvApiKey, ja as resolveAgentModelFallbackValues, ji as resolveSecretRefValues, jn as readSessionUpdatedAt, jr as INTERNAL_MESSAGE_CHANNEL, jt as applyTestPluginDefaults, k as requireApiKey, ka as resolveSessionAgentIds, ki as resolveSafeBinProfiles, kn as loadSessionStore, kr as normalizeDeliveryContext, kt as docsSiteUrl, l as parseModelRef, la as splitTrailingAuthProfile, li as isTrustedSafeBinPath, ln as BUILTIN_TTS_PROVIDER_IDS, lr as listChannelPlugins, m as resolveSubagentSpawnModelSelection, ma as hasConfiguredModelFallbacks, mi as buildEnforcedShellCommand, mn as normalizeProviderId$1, mr as normalizeWhatsAppTarget, n as buildConfiguredAllowlistKeys, na as resolveAuthProfileDisplayLabel, ni as actionRequiresTarget, nn as normalizePluginHttpPath, nr as resolveParentSessionGroupId, nt as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, o as modelKey, oa as hasConfiguredSecretInput, oi as replaceBufferedPluginTaskPasses, on as listPluginCommands, or as listChannelDocks, ot as resolveIMessageRemoteAttachmentRoots, p as resolveReasoningDefault, pa as acceptsInheritedIdentity, pi as analyzeShellCommand, pn as replaceSpeechProviders, pr as isWhatsAppGroupJid, q as getConfigOverrides, qi as dedupeProfileIds, qn as acquireSessionWriteLock, qt as getActiveGatewayPluginRegistry, r as buildModelAliasIndex, rn as buildPluginHealthReport, rr as normalizeAtHashSlug, rt as isInboundPathAllowed, s as normalizeModelRef$1, sa as normalizeResolvedSecretInputString, si as RecoveryAdmissionError, sn as matchPluginCommand, sr as normalizeSignalMessagingTarget, st as normalizeScpRemoteHost, t as buildAllowedModelSet, ta as readProcessElapsedSeconds, ti as actionHasTarget, tn as createPluginRegistry, tr as resolveGroupSessionKey, tt as validateConfigObjectWithPlugins, u as resolveConfiguredModelRef, ua as DEFAULT_CONTEXT_TOKENS, ui as listWritableExplicitTrustedSafeBinDirs, un as getRegisteredSpeechProviders, ur as normalizeChannelId$1, ut as resolveExecPolicyPreset, va as listAgentIds, vi as matchAllowlist, vr as resolveCliName, w as buildAssistantMessageWithZeroUsage, wa as resolveAgentWorkspaceDir, wi as unwrapKnownDispatchWrapperInvocation, wn as closeConfiguredSessionStorageRuntime, wr as resolveConversationLabel, wt as buildChannelAccountBindings, x as OLLAMA_NATIVE_BASE_URL, xi as extractShellWrapperInlineCommand, xn as updateLastRoute, xr as resolveChannelGroupRequireMention, ya as resolveAgentConfig, yi as resolveAllowlistCandidatePath, yn as requireSessionStorageRuntime, yr as resolveIMessageAccount, z as markAuthProfileUsed, zi as VERSION, zn as SAFE_SESSION_ID_RE, zr as resolveMessageChannel } from "./model-selection-
|
|
3
|
-
import { a as resolveGatewayLockDir, f as resolveRequiredHomeDir, l as resolveStateDir, o as resolveGatewayPort, r as resolveConfigPath, s as resolveOAuthDir, u as expandHomePrefix } from "./paths-
|
|
4
|
-
import { C as appendFileLog, F as openBoundaryFileSync, K as isDangerousHostEnvVarName, O as INCLUDE_KEY, P as openBoundaryFile, Q as clampInt, T as normalizeLogLevel, U as isSymlinkOpenError, V as isNotFoundPathError, W as normalizeWindowsPathForComparison, Z as CONFIG_DIR, _ as colorize, a as createNonExitingRuntime, b as getChildLogger, c as registerActiveProgressLine, ct as safeParseJson, dt as sleep$2, f as logVerbose, ft as sliceUtf16Safe, g as warn, h as shouldLogVerbose, it as normalizeE164, j as isBlockedObjectKey, l as unregisterActiveProgressLine, lt as shortenHomeInString, m as setVerbose, mt as resolvePreferredOpenClawTmpDir, nt as formatTerminalLink, o as defaultRuntime, pt as truncateUtf16Safe, rt as isRecord$2, s as clearActiveProgressLine, st as resolveUserPath, t as createSubsystemLogger, tt as escapeRegExp, u as danger, ut as shortenHomePath, v as isRich, y as theme } from "./subsystem-
|
|
2
|
+
import { $ as setConfigValueAtPath, $i as withFileLock$1, $r as stringEnum, $t as addRegisteredPluginApi, A as resolveApiKeyForProvider, Ai as isSafeExecutableValue, An as loadSessionStoreFromDisk, Ar as normalizeSessionDeliveryFields, At as BUNDLED_ENABLED_BY_DEFAULT, B as resolveProfilesUnavailableReason, Bi as getShellPathFromLoginShell, Bn as SESSION_RUN_STORE_FILE_NAME, Br as GATEWAY_CLIENT_IDS, Bt as CHAT_CHANNEL_ORDER, C as buildAssistantMessage, Ca as resolveAgentSkillsFilter, Ci as isShellWrapperExecutable, Cn as updateSessionStoreEntry, Cr as resolveAccountEntry, D as getApiKeyForModel, Da as resolveRunModelFallbacksOverride, Di as SAFE_BIN_PROFILES, Dn as prepareConfiguredSessionStorageRuntimeActivation, Dr as deliveryContextKey, Dt as loadPluginManifestRegistry, E as buildUsageWithNoCost, Ei as splitShellArgs, En as commitPreparedConfiguredSessionStorageRuntimeActivation, Er as deliveryContextFromSession, Et as validateJsonSchemaValue, F as resolveAuthProfileOrder, Fi as parseDotPath, Fn as parseSessionIndexRecordKey, Fr as isMarkdownCapableMessageChannel, Ft as resolveMemorySlotDecision, G as writeConfigFile, Gi as getRuntimeConfigSnapshot, Gr as readTaskWorkStates, Gt as normalizeChatChannelId, H as loadConfig, Hi as isTruthyEnvValue, Hn as resolveSessionFilePath, Hr as GATEWAY_CLIENT_NAMES, Ht as listChatChannels, I as getSoonestCooldownExpiry, Ii as secretRefKey, Ir as listDeliverableMessageChannels, It as discoverOpenClawPlugins, J as resetConfigOverrides, Ji as listProfilesForProvider, Jn as resolveSessionLockMaxHoldFromTimeout, Jt as getActivePluginRegistry, K as createConfigIO, Ki as applyMergePatch, Kn as resolveStorePath, Kt as resolveChannelConfigId, L as isProfileInCooldown, Li as runTasksWithConcurrency, Lr as normalizeMessageChannel, Lt as isPathInside, M as resolveModelAuthMode, Ma as resolveAgentModelPrimaryValue, Mi as describeUnknownError$1, Mn as parseDurationMs, Mr as isDeliverableMessageChannel, Mt as isBundledChannelEnabledByChannelConfig, N as resolveModelProviderConfig, Na as toAgentModelListLike, Ni as isNonEmptyString, Nn as getConfiguredSessionStorageRuntime, Nt as normalizePluginsConfig, O as getCustomProviderApiKey, Oa as resolveSessionAgentId, Oi as normalizeSafeBinProfileFixtures, On as refreshConfiguredSessionBindingEntry, Or as mergeDeliveryContext, Ot as DOCS_SITE_URL, Pi as isRecord$1, Pr as isInternalMessageChannel, Pt as resolveEffectiveEnableState, Q as parseConfigPath, Qi as resolveOpenClawAgentDir, Qn as resolveFreshSessionTotalTokens, Qr as optionalStringEnum, Qt as setActivePluginRegistry, R as markAuthProfileFailure, Ri as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Rr as resolveGatewayMessageChannel, Rt as safeStatSync, S as createOllamaStreamFn, Si as isDispatchWrapperExecutable, Sn as updateSessionStore, Sr as resolveChannelGroupToolsPolicy, T as buildStreamErrorAssistantMessage, Ta as resolveDefaultAgentId, Ti as unwrapKnownShellMultiplexerInvocation, Tn as closeReplacedConfiguredSessionStorageRuntime, Tr as normalizeChatType, Tt as listBindings, U as readConfigFileSnapshot, Ui as resolveOwnerDisplaySetting, Un as resolveSessionFilePathOptions, Ut as normalizeAnyChannelId, V as resolveApiKeyForProfile, Vi as resolveShellEnvFallbackTimeoutMs, Vr as GATEWAY_CLIENT_MODES, Vt as getChatChannelMeta, W as readConfigFileSnapshotForWrite, Wi as advanceRuntimeConfigSnapshot, Wn as resolveSessionTranscriptPath, Wr as CtxProjectionCorruptionError, Wt as normalizeChannelId$2, X as unsetConfigOverride, Xi as ensureAuthProfileStore, Xn as DEFAULT_RESET_TRIGGERS, Xr as channelTargetSchema, Y as setConfigOverride, Yi as markAuthProfileGood, Yt as getActivePluginRegistryKey, Z as getConfigValueAtPath, Zi as resolveAuthStorePathForDisplay, Zn as mergeSessionEntry, Zr as channelTargetsSchema, Zt as requireActivePluginRegistry, _i as DEFAULT_SAFE_BINS, _n as getConversationReadQuery, _r as formatCliCommand, a as isCliProvider, aa as coerceSecretRef, ai as listBufferedPluginTaskPasses, an as executePluginCommand, ar as getChannelDock, at as resolveIMessageAttachmentRoots, b as retryAsync, ba as resolveAgentDir, bi as resolveCommandResolutionFromArgv, bn as recordSessionMetaFromInbound, br as resolveChannelGroupPolicy, c as normalizeProviderId, ca as resolveSecretInputRef, ci as getTrustedSafeBinDirs, cn as registerPluginCommand, cr as getChannelPlugin, ct as parseNonNegativeByteSize, d as resolveDefaultModelForAgent, da as DEFAULT_MODEL, di as normalizeTrustedSafeBinDirs, dn as getSpeechProvider, dr as listEnabledSignalAccounts, ea as isPidAlive, ei as applyTargetToParams, en as clearRegisteredPluginApis, er as deriveSessionMetaPatch, et as unsetConfigValueAtPath, f as resolveModelRefFromString, fa as DEFAULT_PROVIDER, fi as validateSafeBinArgv, fn as isBuiltinTtsProvider, fr as resolveSignalAccount, ga as isInternalAgentSessionKey, gi as splitCommandChain, gn as createConversationReadQuery, gr as resolveWhatsAppAccount, h as resolveThinkingDefault, ha as isAgentUserFacing, hi as isWindowsPlatform, hn as StorageReadAccessError, hr as hasAnyWhatsAppAuth, i as findNormalizedProviderValue, ia as normalizeSecretInput, ii as discardBufferedPluginTaskPasses, in as clearPluginCommands, ir as normalizeStringEntries, it as mergeInboundPathRoots, j as resolveEnvApiKey, ja as resolveAgentModelFallbackValues, ji as resolveSecretRefValues, jn as readSessionUpdatedAt, jr as INTERNAL_MESSAGE_CHANNEL, jt as applyTestPluginDefaults, k as requireApiKey, ka as resolveSessionAgentIds, ki as resolveSafeBinProfiles, kn as loadSessionStore, kr as normalizeDeliveryContext, kt as docsSiteUrl, l as parseModelRef, la as splitTrailingAuthProfile, li as isTrustedSafeBinPath, ln as BUILTIN_TTS_PROVIDER_IDS, lr as listChannelPlugins, m as resolveSubagentSpawnModelSelection, ma as hasConfiguredModelFallbacks, mi as buildEnforcedShellCommand, mn as normalizeProviderId$1, mr as normalizeWhatsAppTarget, n as buildConfiguredAllowlistKeys, na as resolveAuthProfileDisplayLabel, ni as actionRequiresTarget, nn as normalizePluginHttpPath, nr as resolveParentSessionGroupId, nt as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, o as modelKey, oa as hasConfiguredSecretInput, oi as replaceBufferedPluginTaskPasses, on as listPluginCommands, or as listChannelDocks, ot as resolveIMessageRemoteAttachmentRoots, p as resolveReasoningDefault, pa as acceptsInheritedIdentity, pi as analyzeShellCommand, pn as replaceSpeechProviders, pr as isWhatsAppGroupJid, q as getConfigOverrides, qi as dedupeProfileIds, qn as acquireSessionWriteLock, qt as getActiveGatewayPluginRegistry, r as buildModelAliasIndex, rn as buildPluginHealthReport, rr as normalizeAtHashSlug, rt as isInboundPathAllowed, s as normalizeModelRef$1, sa as normalizeResolvedSecretInputString, si as RecoveryAdmissionError, sn as matchPluginCommand, sr as normalizeSignalMessagingTarget, st as normalizeScpRemoteHost, t as buildAllowedModelSet, ta as readProcessElapsedSeconds, ti as actionHasTarget, tn as createPluginRegistry, tr as resolveGroupSessionKey, tt as validateConfigObjectWithPlugins, u as resolveConfiguredModelRef, ua as DEFAULT_CONTEXT_TOKENS, ui as listWritableExplicitTrustedSafeBinDirs, un as getRegisteredSpeechProviders, ur as normalizeChannelId$1, ut as resolveExecPolicyPreset, va as listAgentIds, vi as matchAllowlist, vr as resolveCliName, w as buildAssistantMessageWithZeroUsage, wa as resolveAgentWorkspaceDir, wi as unwrapKnownDispatchWrapperInvocation, wn as closeConfiguredSessionStorageRuntime, wr as resolveConversationLabel, wt as buildChannelAccountBindings, x as OLLAMA_NATIVE_BASE_URL, xi as extractShellWrapperInlineCommand, xn as updateLastRoute, xr as resolveChannelGroupRequireMention, ya as resolveAgentConfig, yi as resolveAllowlistCandidatePath, yn as requireSessionStorageRuntime, yr as resolveIMessageAccount, z as markAuthProfileUsed, zi as VERSION, zn as SAFE_SESSION_ID_RE, zr as resolveMessageChannel } from "./model-selection-ik2bHbgK.js";
|
|
3
|
+
import { a as resolveGatewayLockDir, f as resolveRequiredHomeDir, l as resolveStateDir, o as resolveGatewayPort, r as resolveConfigPath, s as resolveOAuthDir, u as expandHomePrefix } from "./paths-B_gs59ga.js";
|
|
4
|
+
import { C as appendFileLog, F as openBoundaryFileSync, K as isDangerousHostEnvVarName, O as INCLUDE_KEY, P as openBoundaryFile, Q as clampInt, T as normalizeLogLevel, U as isSymlinkOpenError, V as isNotFoundPathError, W as normalizeWindowsPathForComparison, Z as CONFIG_DIR, _ as colorize, a as createNonExitingRuntime, b as getChildLogger, c as registerActiveProgressLine, ct as safeParseJson, dt as sleep$2, f as logVerbose, ft as sliceUtf16Safe, g as warn, h as shouldLogVerbose, it as normalizeE164, j as isBlockedObjectKey, l as unregisterActiveProgressLine, lt as shortenHomeInString, m as setVerbose, mt as resolvePreferredOpenClawTmpDir, nt as formatTerminalLink, o as defaultRuntime, pt as truncateUtf16Safe, rt as isRecord$2, s as clearActiveProgressLine, st as resolveUserPath, t as createSubsystemLogger, tt as escapeRegExp, u as danger, ut as shortenHomePath, v as isRich, y as theme } from "./subsystem-cFv2jJm-.js";
|
|
5
5
|
import { n as resolveProcessScopedMap, t as isPlainObject } from "./plain-object-Doc_YkH1.js";
|
|
6
|
-
import { $ as normalizeAccountId$1, A as DEFAULT_AGENT_ID, B as isKnownAgentMainSessionKey, C as runCommandWithTimeout, D as logError, E as logDebug, F as buildAgentPeerSessionKey, G as resolveAgentIdFromSessionKey, H as normalizeAgentId, I as classifySessionKeyShape, J as resolveThreadSessionKeys, K as resolveCanonicalIdentity, M as DEVICE_SENDER_PREFIX, O as logInfo, P as buildAgentMainSessionKey, Q as DEFAULT_ACCOUNT_ID, T as spawnWithFallback, U as normalizeMainKey, V as isValidAgentId, W as normalizeToken$1, X as sessionKeyAgentMatches, Y as sanitizeAgentId, Z as toAgentStoreSessionKey, _ as filterBootstrapFilesForSession, at as isAcpSessionKey, ct as isSubagentSessionKey, d as DEFAULT_HEARTBEAT_FILENAME, dt as stripAgentSessionKeyPrefix, et as normalizeOptionalAccountId, g as ensureAgentWorkspace, it as getSubagentDepth, j as DEFAULT_MAIN_KEY, k as logWarn, l as DEFAULT_AGENT_WORKSPACE_DIR, lt as parseAgentSessionKey, n as createInternalHookEvent, o as triggerInternalHook, ot as isCronSessionKey, q as resolveConfiguredCanonicalIdentity, rt as WAKE_GATE_SESSION_KEY_SEGMENT, s as parseBooleanValue$1, t as readManifestNamespace, u as DEFAULT_BOOTSTRAP_FILENAME, ut as resolveThreadParentSessionKey, w as runExec, x as resolveOpenClawPackageRoot, y as loadWorkspaceBootstrapFiles } from "./legacy-names-
|
|
7
|
-
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken } from "./github-copilot-token-
|
|
8
|
-
import { $ as resolveSandboxRuntimeStatus, A as classifyFailoverReason, At as listCoreToolIds, B as isFailoverAssistantError, Bt as isSilentReplyText, C as resolveImageSanitizationLimits, Ct as collectExplicitAllowlist, D as downgradeOpenAIReasoningBlocks, Dt as expandToolGroups, E as downgradeOpenAIFunctionCallReasoningPairs, Et as stripPluginOnlyAllowlist, F as isAuthAssistantError, Ft as resolveBootstrapTotalMaxChars, G as isTransientHttpError, H as isLikelyContextOverflowError, I as isBillingAssistantError, It as sanitizeGoogleTurnOrdering, J as sanitizeUserFacingText, K as parseImageDimensionError, L as isCloudCodeAssistFormatError, Lt as HEARTBEAT_TOKEN, M as formatBillingErrorMessage, Mt as matchesAnyGlobPattern, N as formatRawAssistantErrorForUi, Nt as buildBootstrapContextFiles, O as isGoogleModelApi, Ot as normalizeToolName, P as getApiErrorPayloadFingerprint, Pt as resolveBootstrapMaxChars, Q as resolveSandboxContext, R as isCompactionFailureError, Rt as SILENT_REPLY_TOKEN, S as sanitizeToolResultImages, St as buildPluginToolGroups, T as estimateBase64DecodedBytes, Tt as mergeAlsoAllowPolicy, U as isRateLimitAssistantError, V as isFailoverErrorMessage, Vt as stripSilentToken, W as isRawApiErrorPayload, X as isTimeoutErrorMessage, Y as isAuthPermanentErrorMessage, Z as ensureSandboxWorkspaceForSession, _t as applySkillEnvOverridesFromSnapshot, a as validateGeminiTurns, at as buildWorkspaceSkillCommandSpecs, b as sanitizeSessionMessagesImages, bt as resolveSandboxConfigForAgent, c as formatXHighModelHint, ct as resolveManagedSkillsDir, d as normalizeReasoningLevel, dt as resolvePluginSkillDirs, et as createBrowserRouteContext, f as normalizeThinkLevel, ft as assertMediaNotDataUrl, g as supportsXHighThinking, gt as applySkillEnvOverrides, h as resolveResponseUsageMode, ht as resolveSandboxedMediaSource, i as validateAnthropicTurns, it as getBridgeAuthForPort, j as formatAssistantErrorText, jt as compileGlobPatterns, k as BILLING_ERROR_USER_MESSAGE, kt as resolveToolProfilePolicy, l as listThinkingLevels, lt as resolveSkillsPromptForRun, m as normalizeVerboseLevel, mt as resolveSandboxInputPath, n as splitMediaFromOutput, nt as resolveBrowserConfig, o as pickFallbackThinkingLevel, ot as buildWorkspaceSkillSnapshot, p as normalizeUsageDisplay, pt as assertSandboxPath, q as parseImageSizeError, r as extractTextFromChatContent, rt as resolveProfile, s as formatThinkingLevels, st as loadWorkspaceSkillEntries, t as parseReplyDirectives, tt as registerBrowserRoutes, u as normalizeElevatedLevel, ut as skillsSnapshotSourceDiffers, v as isMessagingToolDuplicateNormalized, vt as ensureBrowserControlAuth, w as canonicalizeBase64, wt as expandPolicyWithPluginGroups, x as sanitizeImageBlocks, xt as applyOwnerOnlyToolPolicy, y as normalizeTextForComparison, yt as resolveBrowserControlAuth, z as isContextOverflowError, zt as isSilentReplyPrefixText } from "./reply-directives-
|
|
6
|
+
import { $ as normalizeAccountId$1, A as DEFAULT_AGENT_ID, B as isKnownAgentMainSessionKey, C as runCommandWithTimeout, D as logError, E as logDebug, F as buildAgentPeerSessionKey, G as resolveAgentIdFromSessionKey, H as normalizeAgentId, I as classifySessionKeyShape, J as resolveThreadSessionKeys, K as resolveCanonicalIdentity, M as DEVICE_SENDER_PREFIX, O as logInfo, P as buildAgentMainSessionKey, Q as DEFAULT_ACCOUNT_ID, T as spawnWithFallback, U as normalizeMainKey, V as isValidAgentId, W as normalizeToken$1, X as sessionKeyAgentMatches, Y as sanitizeAgentId, Z as toAgentStoreSessionKey, _ as filterBootstrapFilesForSession, at as isAcpSessionKey, ct as isSubagentSessionKey, d as DEFAULT_HEARTBEAT_FILENAME, dt as stripAgentSessionKeyPrefix, et as normalizeOptionalAccountId, g as ensureAgentWorkspace, it as getSubagentDepth, j as DEFAULT_MAIN_KEY, k as logWarn, l as DEFAULT_AGENT_WORKSPACE_DIR, lt as parseAgentSessionKey, n as createInternalHookEvent, o as triggerInternalHook, ot as isCronSessionKey, q as resolveConfiguredCanonicalIdentity, rt as WAKE_GATE_SESSION_KEY_SEGMENT, s as parseBooleanValue$1, t as readManifestNamespace, u as DEFAULT_BOOTSTRAP_FILENAME, ut as resolveThreadParentSessionKey, w as runExec, x as resolveOpenClawPackageRoot, y as loadWorkspaceBootstrapFiles } from "./legacy-names-chsmo2vs.js";
|
|
7
|
+
import { a as saveJsonFile, i as loadJsonFile, r as resolveCopilotApiToken } from "./github-copilot-token-C-29TbW-.js";
|
|
8
|
+
import { $ as resolveSandboxRuntimeStatus, A as classifyFailoverReason, At as listCoreToolIds, B as isFailoverAssistantError, Bt as isSilentReplyText, C as resolveImageSanitizationLimits, Ct as collectExplicitAllowlist, D as downgradeOpenAIReasoningBlocks, Dt as expandToolGroups, E as downgradeOpenAIFunctionCallReasoningPairs, Et as stripPluginOnlyAllowlist, F as isAuthAssistantError, Ft as resolveBootstrapTotalMaxChars, G as isTransientHttpError, H as isLikelyContextOverflowError, I as isBillingAssistantError, It as sanitizeGoogleTurnOrdering, J as sanitizeUserFacingText, K as parseImageDimensionError, L as isCloudCodeAssistFormatError, Lt as HEARTBEAT_TOKEN, M as formatBillingErrorMessage, Mt as matchesAnyGlobPattern, N as formatRawAssistantErrorForUi, Nt as buildBootstrapContextFiles, O as isGoogleModelApi, Ot as normalizeToolName, P as getApiErrorPayloadFingerprint, Pt as resolveBootstrapMaxChars, Q as resolveSandboxContext, R as isCompactionFailureError, Rt as SILENT_REPLY_TOKEN, S as sanitizeToolResultImages, St as buildPluginToolGroups, T as estimateBase64DecodedBytes, Tt as mergeAlsoAllowPolicy, U as isRateLimitAssistantError, V as isFailoverErrorMessage, Vt as stripSilentToken, W as isRawApiErrorPayload, X as isTimeoutErrorMessage, Y as isAuthPermanentErrorMessage, Z as ensureSandboxWorkspaceForSession, _t as applySkillEnvOverridesFromSnapshot, a as validateGeminiTurns, at as buildWorkspaceSkillCommandSpecs, b as sanitizeSessionMessagesImages, bt as resolveSandboxConfigForAgent, c as formatXHighModelHint, ct as resolveManagedSkillsDir, d as normalizeReasoningLevel, dt as resolvePluginSkillDirs, et as createBrowserRouteContext, f as normalizeThinkLevel, ft as assertMediaNotDataUrl, g as supportsXHighThinking, gt as applySkillEnvOverrides, h as resolveResponseUsageMode, ht as resolveSandboxedMediaSource, i as validateAnthropicTurns, it as getBridgeAuthForPort, j as formatAssistantErrorText, jt as compileGlobPatterns, k as BILLING_ERROR_USER_MESSAGE, kt as resolveToolProfilePolicy, l as listThinkingLevels, lt as resolveSkillsPromptForRun, m as normalizeVerboseLevel, mt as resolveSandboxInputPath, n as splitMediaFromOutput, nt as resolveBrowserConfig, o as pickFallbackThinkingLevel, ot as buildWorkspaceSkillSnapshot, p as normalizeUsageDisplay, pt as assertSandboxPath, q as parseImageSizeError, r as extractTextFromChatContent, rt as resolveProfile, s as formatThinkingLevels, st as loadWorkspaceSkillEntries, t as parseReplyDirectives, tt as registerBrowserRoutes, u as normalizeElevatedLevel, ut as skillsSnapshotSourceDiffers, v as isMessagingToolDuplicateNormalized, vt as ensureBrowserControlAuth, w as canonicalizeBase64, wt as expandPolicyWithPluginGroups, x as sanitizeImageBlocks, xt as applyOwnerOnlyToolPolicy, y as normalizeTextForComparison, yt as resolveBrowserControlAuth, z as isContextOverflowError, zt as isSilentReplyPrefixText } from "./reply-directives-CD8SVo0d.js";
|
|
9
9
|
import { n as isDiagnosticsEnabled, t as emitDiagnosticEvent } from "./diagnostic-events-RfJYFlJM.js";
|
|
10
|
-
import { $ as buildInboundMetaSystemPrompt, A as evaluateSessionFreshness, At as openRawToolResultStash, B as isSessionArchiveArtifactName, Bt as getGlobalHookRunner, C as normalizeHttpWebhookUrl, Ct as TOOL_RESULT_CHARS_PER_TOKEN_ESTIMATE, D as SESSION_RUN_CONTEXT_MAX_NAMES, Dt as getToolResultText$1, E as parseAbsoluteTimeMs, Et as estimateMessageCharsCached, F as canonicalizeMainSessionAlias, Ft as canonicalToolCallIdBase, Gt as createCurrentUserPromptEnvelope, Ht as initializeGlobalHookRunner, I as resolveAgentMainSessionKey, It as sanitizeToolCallIdsForCloudCodeAssist, J as runSerializedBySession, Jt as buildPluginRuntimeIdentity, K as trimToUndefined, Kt as mergePromptContributions, M as resolveSessionResetPolicy, Mt as sanitizeToolCallInputs, N as resolveSessionResetType, Nt as sanitizeToolUseResultPairing, Ot as isToolResultMessage, P as resolveThreadFlag, Pt as stripToolResultDetails, Q as sha256, R as resolveMainSessionKey, Rt as hasInterSessionUserProvenance, S as inferLegacyName, St as CHARS_PER_TOKEN_ESTIMATE$2, T as resolveDefaultCronStaggerMs, Tt as estimateContextChars$1, U as writeJsonAtomic, Ut as hasHookForPlugin, V as createAsyncLock, Vt as getGlobalPluginRegistry, W as resolveGatewayCredentialsFromConfig, Wt as promptBuildResultToContribution, X as extractLegacyTranscriptEntryFields, Xt as resolveProviderPromptCacheKey, Y as drainPendingPrimaryWrites, Yt as buildPluginTurnIdentity, Z as sanitizeJsonb, Zt as resolveProviderRuntimeIdentity, _ as derivePromptTokens, _t as sessionLikelyHasOversizedToolResults, a as resolveMirroredTranscriptText, at as messageTime, b as makeZeroUsageSnapshot, bt as truncateTextHeadTail, c as createSessionStorageRuntimeFromConfig, ct as formatZonedTimestamp, d as buildEqualityProjection, dt as DB_SESSION_HYDRATION_LIMIT, et as collectInboundUserContext, ft as eventOrder, g as sanitizeAppendEntry, gt as HARD_MAX_TOOL_RESULT_CHARS, h as CREATE_CTX_STORAGE_OWNER_SQL, ht as capToolResultContent, i as appendAssistantMessageToSessionTranscript, it as isRepresentableEpochMs, j as resolveChannelResetConfig, jt as repairToolUseResultPairing, k as resolveSessionKey, kt as guardSessionManager, l as resolveSessionStorageConfig, lt as resolveTimezone, m as deriveLegacyActorIdentity, mt as HIDDEN_HEARTBEAT_CUSTOM_TYPE, n as parseSessionThreadInfo, nt as attachMessageIngress, o as parseInlineDirectives$1, ot as stripMessageCarriers, pt as pickLeaf, q as openDbSessionManager, qt as toJsonValue$1, r as resolveAndPersistSessionFile, rt as getMessageIngress, s as attachPgPoolErrorListeners, st as formatMessageStamp, t as extractDeliveryInfo, tt as renderInboundUserContext, u as validateCtxStorage, ut as resolveSenderLabel, v as deriveSessionTotalTokens, vt as PREEMPTIVE_TOOL_RESULT_COMPACTION_PLACEHOLDER, w as normalizeCronStaggerMs, wt as createMessageCharEstimateCache, x as normalizeUsage, xt as truncateToolResultToChars, y as hasNonzeroUsage, yt as TOOL_RESULT_TEXT_WEIGHT, z as isPrimarySessionTranscriptFileName, zt as normalizeInputProvenance } from "./sessions-
|
|
10
|
+
import { $ as buildInboundMetaSystemPrompt, A as evaluateSessionFreshness, At as openRawToolResultStash, B as isSessionArchiveArtifactName, Bt as getGlobalHookRunner, C as normalizeHttpWebhookUrl, Ct as TOOL_RESULT_CHARS_PER_TOKEN_ESTIMATE, D as SESSION_RUN_CONTEXT_MAX_NAMES, Dt as getToolResultText$1, E as parseAbsoluteTimeMs, Et as estimateMessageCharsCached, F as canonicalizeMainSessionAlias, Ft as canonicalToolCallIdBase, Gt as createCurrentUserPromptEnvelope, Ht as initializeGlobalHookRunner, I as resolveAgentMainSessionKey, It as sanitizeToolCallIdsForCloudCodeAssist, J as runSerializedBySession, Jt as buildPluginRuntimeIdentity, K as trimToUndefined, Kt as mergePromptContributions, M as resolveSessionResetPolicy, Mt as sanitizeToolCallInputs, N as resolveSessionResetType, Nt as sanitizeToolUseResultPairing, Ot as isToolResultMessage, P as resolveThreadFlag, Pt as stripToolResultDetails, Q as sha256, R as resolveMainSessionKey, Rt as hasInterSessionUserProvenance, S as inferLegacyName, St as CHARS_PER_TOKEN_ESTIMATE$2, T as resolveDefaultCronStaggerMs, Tt as estimateContextChars$1, U as writeJsonAtomic, Ut as hasHookForPlugin, V as createAsyncLock, Vt as getGlobalPluginRegistry, W as resolveGatewayCredentialsFromConfig, Wt as promptBuildResultToContribution, X as extractLegacyTranscriptEntryFields, Xt as resolveProviderPromptCacheKey, Y as drainPendingPrimaryWrites, Yt as buildPluginTurnIdentity, Z as sanitizeJsonb, Zt as resolveProviderRuntimeIdentity, _ as derivePromptTokens, _t as sessionLikelyHasOversizedToolResults, a as resolveMirroredTranscriptText, at as messageTime, b as makeZeroUsageSnapshot, bt as truncateTextHeadTail, c as createSessionStorageRuntimeFromConfig, ct as formatZonedTimestamp, d as buildEqualityProjection, dt as DB_SESSION_HYDRATION_LIMIT, et as collectInboundUserContext, ft as eventOrder, g as sanitizeAppendEntry, gt as HARD_MAX_TOOL_RESULT_CHARS, h as CREATE_CTX_STORAGE_OWNER_SQL, ht as capToolResultContent, i as appendAssistantMessageToSessionTranscript, it as isRepresentableEpochMs, j as resolveChannelResetConfig, jt as repairToolUseResultPairing, k as resolveSessionKey, kt as guardSessionManager, l as resolveSessionStorageConfig, lt as resolveTimezone, m as deriveLegacyActorIdentity, mt as HIDDEN_HEARTBEAT_CUSTOM_TYPE, n as parseSessionThreadInfo, nt as attachMessageIngress, o as parseInlineDirectives$1, ot as stripMessageCarriers, pt as pickLeaf, q as openDbSessionManager, qt as toJsonValue$1, r as resolveAndPersistSessionFile, rt as getMessageIngress, s as attachPgPoolErrorListeners, st as formatMessageStamp, t as extractDeliveryInfo, tt as renderInboundUserContext, u as validateCtxStorage, ut as resolveSenderLabel, v as deriveSessionTotalTokens, vt as PREEMPTIVE_TOOL_RESULT_COMPACTION_PLACEHOLDER, w as normalizeCronStaggerMs, wt as createMessageCharEstimateCache, x as normalizeUsage, xt as truncateToolResultToChars, y as hasNonzeroUsage, yt as TOOL_RESULT_TEXT_WEIGHT, z as isPrimarySessionTranscriptFileName, zt as normalizeInputProvenance } from "./sessions-Dwd5H-eS.js";
|
|
11
11
|
import { n as onSessionTranscriptUpdate } from "./transcript-events-k21fdARq.js";
|
|
12
12
|
import { n as generateSecureUuid, t as generateSecureToken } from "./secure-random-CSsVRTTy.js";
|
|
13
|
-
import { _ as recordSystemPromptHashComparison, b as recordCommandPoll, d as logRunCompleted, f as logRunStarted, g as logToolExecutionStarted, h as logToolExecutionCompleted, l as logModelCallError, m as logToolExecutionBlocked, o as logMessageProcessed, p as logSessionStateChange, s as logMessageQueued, v as refreshRunProgress, x as resetCommandPollCount, y as boundDiagnosticContent } from "./diagnostic-
|
|
13
|
+
import { _ as recordSystemPromptHashComparison, b as recordCommandPoll, d as logRunCompleted, f as logRunStarted, g as logToolExecutionStarted, h as logToolExecutionCompleted, l as logModelCallError, m as logToolExecutionBlocked, o as logMessageProcessed, p as logSessionStateChange, s as logMessageQueued, v as refreshRunProgress, x as resetCommandPollCount, y as boundDiagnosticContent } from "./diagnostic-DJ11ZJIJ.js";
|
|
14
14
|
import { o as redactChannelCorrelation, r as getDiagnosticSessionState } from "./diagnostic-session-state-Di8oqY0E.js";
|
|
15
15
|
import { t as redactIdentifier } from "./redact-identifier-bNChjxxW.js";
|
|
16
|
-
import { t as redactSensitiveText } from "./redact-
|
|
16
|
+
import { t as redactSensitiveText } from "./redact-LOuk7TRy.js";
|
|
17
17
|
import { t as CommandLane } from "./lanes-D1Q3LLIs.js";
|
|
18
|
-
import { a as getCommandLaneSnapshots, c as isQueuedCommandCancellation, i as enqueueCommandInLane, n as clearCommandLane, o as getQueueSize, s as isGatewayDraining, t as CommandLaneAbortedError } from "./command-queue-
|
|
19
|
-
import { S as MAX_IMAGE_BYTES, _ as getFileExtension, b as kindFromMime, d as MEDIA_MAX_BYTES, g as extensionForMime, h as detectMime, m as saveMediaBuffer, n as isSafeFenceBreak, p as getMediaDir, r as parseFenceSpans, s as getImageMetadata, t as findFenceSpanAt, u as resizeToJpeg, v as imageMimeFromFormat, w as mediaKindFromMime, x as normalizeMimeType$1, y as isAudioFileName } from "./fences-
|
|
20
|
-
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-
|
|
21
|
-
import { A as transcriptEntriesToMessages, B as resolveReplyToMode, C as extractToolCallNames, D as sleepWithAbort, E as computeBackoff, F as filterMessagingToolMediaDuplicates, G as resolveOutboundSessionId, H as normalizeChannelTargetInput, I as isRenderablePayload, J as resolveTeamRoster, K as ensureOpenClawModelsJson, L as shouldSuppressMessagingToolReplies, M as applyReplyTagsToPayload, N as applyReplyThreading, P as filterMessagingToolDuplicates, R as shouldSuppressReasoningPayload, S as countToolResults, T as resolveContextTokensForModel, U as normalizeTargetForProvider, V as buildTargetResolverSignature, W as buildOutboundSessionContext, _ as loadCombinedSessionStoreForGateway, b as throwIfAborted$1, c as createMessageSentEmitter, d as toInternalMessageReceivedContext, f as toInternalMessageTranscribedContext, g as stampReplyActivity, h as fireAndForgetHook, j as stripLeadingInboundMetadata, k as readFullTranscriptEntriesFromBackend, l as deriveInboundMessageHookContext, m as toPluginMessageReceivedEvent, o as normalizeReplyPayloadsForDelivery, p as toPluginMessageContext, q as resolveLedTeam, s as applyMessageSendingHook, t as deliverOutboundPayloads, u as toInternalMessagePreprocessedContext, v as capArrayByJsonBytes, w as lookupContextTokens, x as loadChannelOutboundAdapter, y as jsonUtf8Bytes, z as createReplyToModeFilterForChannel } from "./deliver-
|
|
22
|
-
import { B as DEFAULT_AI_SNAPSHOT_MAX_CHARS, C as ensureChromeExtensionRelayServer, M as DEFAULT_UPLOAD_DIR, N as resolveExistingPathsWithinRoot, s as resolveLsofCommandSync } from "./chrome-
|
|
23
|
-
import { r as isLoopbackHost } from "./ws-
|
|
24
|
-
import { a as readFileWithinRoot, c as writeFileWithinRoot, i as openFileWithinRoot, l as PATH_ALIAS_POLICIES, n as copyFileWithinRoot, r as createRootScopedReadFile, t as SafeOpenError } from "./fs-safe-
|
|
25
|
-
import { i as hasErrnoCode, o as readErrorName, r as formatErrorMessage } from "./errors-
|
|
26
|
-
import { a as isBlockedHostnameOrIp, l as normalizeHostname, n as SsrFBlockedError } from "./proxy-env-
|
|
18
|
+
import { a as getCommandLaneSnapshots, c as isQueuedCommandCancellation, i as enqueueCommandInLane, n as clearCommandLane, o as getQueueSize, s as isGatewayDraining, t as CommandLaneAbortedError } from "./command-queue-AIWqKnVD.js";
|
|
19
|
+
import { S as MAX_IMAGE_BYTES, _ as getFileExtension, b as kindFromMime, d as MEDIA_MAX_BYTES, g as extensionForMime, h as detectMime, m as saveMediaBuffer, n as isSafeFenceBreak, p as getMediaDir, r as parseFenceSpans, s as getImageMetadata, t as findFenceSpanAt, u as resizeToJpeg, v as imageMimeFromFormat, w as mediaKindFromMime, x as normalizeMimeType$1, y as isAudioFileName } from "./fences-Z8d1dj8p.js";
|
|
20
|
+
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-ihTZFn93.js";
|
|
21
|
+
import { A as transcriptEntriesToMessages, B as resolveReplyToMode, C as extractToolCallNames, D as sleepWithAbort, E as computeBackoff, F as filterMessagingToolMediaDuplicates, G as resolveOutboundSessionId, H as normalizeChannelTargetInput, I as isRenderablePayload, J as resolveTeamRoster, K as ensureOpenClawModelsJson, L as shouldSuppressMessagingToolReplies, M as applyReplyTagsToPayload, N as applyReplyThreading, P as filterMessagingToolDuplicates, R as shouldSuppressReasoningPayload, S as countToolResults, T as resolveContextTokensForModel, U as normalizeTargetForProvider, V as buildTargetResolverSignature, W as buildOutboundSessionContext, _ as loadCombinedSessionStoreForGateway, b as throwIfAborted$1, c as createMessageSentEmitter, d as toInternalMessageReceivedContext, f as toInternalMessageTranscribedContext, g as stampReplyActivity, h as fireAndForgetHook, j as stripLeadingInboundMetadata, k as readFullTranscriptEntriesFromBackend, l as deriveInboundMessageHookContext, m as toPluginMessageReceivedEvent, o as normalizeReplyPayloadsForDelivery, p as toPluginMessageContext, q as resolveLedTeam, s as applyMessageSendingHook, t as deliverOutboundPayloads, u as toInternalMessagePreprocessedContext, v as capArrayByJsonBytes, w as lookupContextTokens, x as loadChannelOutboundAdapter, y as jsonUtf8Bytes, z as createReplyToModeFilterForChannel } from "./deliver-BNwRhCqc.js";
|
|
22
|
+
import { B as DEFAULT_AI_SNAPSHOT_MAX_CHARS, C as ensureChromeExtensionRelayServer, M as DEFAULT_UPLOAD_DIR, N as resolveExistingPathsWithinRoot, s as resolveLsofCommandSync } from "./chrome-Dhi-l6wT.js";
|
|
23
|
+
import { r as isLoopbackHost } from "./ws-BOnegOZK.js";
|
|
24
|
+
import { a as readFileWithinRoot, c as writeFileWithinRoot, i as openFileWithinRoot, l as PATH_ALIAS_POLICIES, n as copyFileWithinRoot, r as createRootScopedReadFile, t as SafeOpenError } from "./fs-safe-DMWtsz4J.js";
|
|
25
|
+
import { i as hasErrnoCode, o as readErrorName, r as formatErrorMessage } from "./errors-0-at0aYV.js";
|
|
26
|
+
import { a as isBlockedHostnameOrIp, l as normalizeHostname, n as SsrFBlockedError } from "./proxy-env-Catj9Viz.js";
|
|
27
27
|
import { t as resolveNetworkSsrFPolicy } from "./ssrf-config-CIKAlvUL.js";
|
|
28
|
-
import { A as issueDeviceBootstrapToken, C as callGatewayLeastPrivilege, D as gatewayErrorShapeOf, E as gatewayErrorReason, O as validateSecretsResolveResult, S as callGateway, T as resolveLeastPrivilegeOperatorScopesForMethod, _ as resolveSessionReference, a as buildAgentToAgentReplyContext, b as clearActiveCoordinationDepth, c as resolvePingPongTurns, d as createSessionVisibilityGuard, f as resolveEffectiveSessionToolsVisibility, g as resolveMainSessionAlias, h as resolveInternalSessionKey, i as buildAgentToAgentMessageContext, k as SESSION_LABEL_MAX_LENGTH, l as AuthorizationError, m as resolveDisplaySessionKey, n as requestAuthorizedNudge, o as isAnnounceSkip, p as resolveSandboxedSessionToolContext, r as buildAgentToAgentAnnounceContext, s as isReplySkip, u as createAgentToAgentPolicy, v as resolveVisibleSessionReference, w as randomIdempotencyKey, x as setActiveCoordinationDepth, y as shouldResolveSessionIdInput } from "./nudge-
|
|
29
|
-
import { A as formatToolSummary, C as extractAssistantThinking, D as stripDowngradedToolCallText, E as isAssistantMessage, M as stripReasoningTagsFromText, O as stripMinimaxToolCallXml, S as extractAssistantText$1, T as inferToolMetaFromArgs, _ as createInlineCodeState, a as isEmbeddedPiRunActive, b as onAgentEvent, d as handleMessageEnd, f as handleMessageStart, g as buildCodeSpanIndex, h as emitEmbeddedAgentEvent, i as endInFlightEmbeddedAttempt, j as resolveToolDisplay, k as stripThinkingTagsFromText, l as setActiveEmbeddedRun, m as endModelCall, n as beginInFlightEmbeddedAttempt, o as isEmbeddedPiRunStreaming, p as handleMessageUpdate, r as clearActiveEmbeddedRun, s as queueEmbeddedPiMessage, t as abortEmbeddedPiRun, u as waitForEmbeddedPiRunEnd, w as formatReasoningMessage, x as registerAgentRunContext, y as emitAgentEvent } from "./runs-
|
|
30
|
-
import { C as getDefaultMediaLocalRoots, S as getAgentScopedMediaLocalRoots, _ as resolveChunkNewlinePacking, a as resolveMarkdownTableMode, b as fetchRemoteMedia, c as loadWebMediaRaw, d as chunkMarkdownText, f as chunkMarkdownTextWithMode, g as resolveChunkMode, h as resolveChunkDelivery, l as chunkByNewline, m as chunkTextWithMode, o as getDefaultLocalRoots, p as chunkText, s as loadWebMedia, v as resolveTextChunkLimit, x as readResponseWithLimit, y as MediaFetchError } from "./outbound-attachment-
|
|
31
|
-
import { a as bindAbortRelay, i as resolveProxyFetchFromEnv, n as withStrictGuardedFetchMode, o as fetchWithTimeout, r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
32
|
-
import { i as executeWithApiKeyRotation, n as resolveMemorySearchConfig, r as collectProviderApiKeysForExecution } from "./manager-
|
|
33
|
-
import { i as AGENT_LANE_SUBAGENT, r as AGENT_LANE_NESTED, t as startUserSessionRun } from "./user-run-recording-
|
|
34
|
-
import { a as getGatewayInstanceId, n as deriveSessionRunId, o as resolveSessionRunStore, r as inferSessionRunKind, t as createSessionRunRecorder } from "./recorder-
|
|
35
|
-
import { c as enqueueAgentTurn, d as peekDelayedAgentTurn, f as setDelayedReleaseHold, i as AGENT_TURN_TOPIC, l as isClaimableAgentTurnWorkId, m as KeyedAsyncQueue, p as WORKSPACE_LANE_DENIED_REASON, r as tryGetAgentTurnRuntime, s as clearDelayedReleaseHold, u as mergeDelayedAgentTurn } from "./agent-turn-runner-
|
|
36
|
-
import { a as resolveSignalRpcContext, c as streamSignalEvents, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal, u as resolveFetch } from "./send-
|
|
37
|
-
import { a as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, c as normalizeIMessageHandle, i as createIMessageRpcClient, l as parseIMessageTarget, o as formatIMessageChatTarget, r as convertMarkdownTables, s as isAllowedIMessageSender, t as sendMessageIMessage } from "./send-
|
|
38
|
-
import { m as normalizeExtraMemoryPaths, p as listMemoryFiles } from "./query-expansion-
|
|
39
|
-
import { t as isQmdScopeAllowed } from "./qmd-scope-
|
|
28
|
+
import { A as issueDeviceBootstrapToken, C as callGatewayLeastPrivilege, D as gatewayErrorShapeOf, E as gatewayErrorReason, O as validateSecretsResolveResult, S as callGateway, T as resolveLeastPrivilegeOperatorScopesForMethod, _ as resolveSessionReference, a as buildAgentToAgentReplyContext, b as clearActiveCoordinationDepth, c as resolvePingPongTurns, d as createSessionVisibilityGuard, f as resolveEffectiveSessionToolsVisibility, g as resolveMainSessionAlias, h as resolveInternalSessionKey, i as buildAgentToAgentMessageContext, k as SESSION_LABEL_MAX_LENGTH, l as AuthorizationError, m as resolveDisplaySessionKey, n as requestAuthorizedNudge, o as isAnnounceSkip, p as resolveSandboxedSessionToolContext, r as buildAgentToAgentAnnounceContext, s as isReplySkip, u as createAgentToAgentPolicy, v as resolveVisibleSessionReference, w as randomIdempotencyKey, x as setActiveCoordinationDepth, y as shouldResolveSessionIdInput } from "./nudge-DyQYIOed.js";
|
|
29
|
+
import { A as formatToolSummary, C as extractAssistantThinking, D as stripDowngradedToolCallText, E as isAssistantMessage, M as stripReasoningTagsFromText, O as stripMinimaxToolCallXml, S as extractAssistantText$1, T as inferToolMetaFromArgs, _ as createInlineCodeState, a as isEmbeddedPiRunActive, b as onAgentEvent, d as handleMessageEnd, f as handleMessageStart, g as buildCodeSpanIndex, h as emitEmbeddedAgentEvent, i as endInFlightEmbeddedAttempt, j as resolveToolDisplay, k as stripThinkingTagsFromText, l as setActiveEmbeddedRun, m as endModelCall, n as beginInFlightEmbeddedAttempt, o as isEmbeddedPiRunStreaming, p as handleMessageUpdate, r as clearActiveEmbeddedRun, s as queueEmbeddedPiMessage, t as abortEmbeddedPiRun, u as waitForEmbeddedPiRunEnd, w as formatReasoningMessage, x as registerAgentRunContext, y as emitAgentEvent } from "./runs-CW-qjeWY.js";
|
|
30
|
+
import { C as getDefaultMediaLocalRoots, S as getAgentScopedMediaLocalRoots, _ as resolveChunkNewlinePacking, a as resolveMarkdownTableMode, b as fetchRemoteMedia, c as loadWebMediaRaw, d as chunkMarkdownText, f as chunkMarkdownTextWithMode, g as resolveChunkMode, h as resolveChunkDelivery, l as chunkByNewline, m as chunkTextWithMode, o as getDefaultLocalRoots, p as chunkText, s as loadWebMedia, v as resolveTextChunkLimit, x as readResponseWithLimit, y as MediaFetchError } from "./outbound-attachment-DQtDt9Ne.js";
|
|
31
|
+
import { a as bindAbortRelay, i as resolveProxyFetchFromEnv, n as withStrictGuardedFetchMode, o as fetchWithTimeout, r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-jXOgaL7k.js";
|
|
32
|
+
import { i as executeWithApiKeyRotation, n as resolveMemorySearchConfig, r as collectProviderApiKeysForExecution } from "./manager-Cd7Dgpw3.js";
|
|
33
|
+
import { i as AGENT_LANE_SUBAGENT, r as AGENT_LANE_NESTED, t as startUserSessionRun } from "./user-run-recording-DBqvoOPn.js";
|
|
34
|
+
import { a as getGatewayInstanceId, n as deriveSessionRunId, o as resolveSessionRunStore, r as inferSessionRunKind, t as createSessionRunRecorder } from "./recorder-ciEoXXwJ.js";
|
|
35
|
+
import { c as enqueueAgentTurn, d as peekDelayedAgentTurn, f as setDelayedReleaseHold, i as AGENT_TURN_TOPIC, l as isClaimableAgentTurnWorkId, m as KeyedAsyncQueue, p as WORKSPACE_LANE_DENIED_REASON, r as tryGetAgentTurnRuntime, s as clearDelayedReleaseHold, u as mergeDelayedAgentTurn } from "./agent-turn-runner-Pc5bI_FG.js";
|
|
36
|
+
import { a as resolveSignalRpcContext, c as streamSignalEvents, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal, u as resolveFetch } from "./send-BClohEtC.js";
|
|
37
|
+
import { a as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, c as normalizeIMessageHandle, i as createIMessageRpcClient, l as parseIMessageTarget, o as formatIMessageChatTarget, r as convertMarkdownTables, s as isAllowedIMessageSender, t as sendMessageIMessage } from "./send-DkfdQWGD.js";
|
|
38
|
+
import { m as normalizeExtraMemoryPaths, p as listMemoryFiles } from "./query-expansion-Dji7d64T.js";
|
|
39
|
+
import { t as isQmdScopeAllowed } from "./qmd-scope-DMUA3Vq9.js";
|
|
40
40
|
import { createRequire } from "node:module";
|
|
41
41
|
import * as path$1 from "node:path";
|
|
42
42
|
import path, { basename, isAbsolute, join } from "node:path";
|
|
43
|
-
import
|
|
43
|
+
import syncFs, { constants, existsSync, mkdirSync, mkdtempSync, promises, readFileSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
44
44
|
import os, { homedir } from "node:os";
|
|
45
|
-
import
|
|
46
|
-
import * as fs$
|
|
47
|
-
import fs
|
|
45
|
+
import json5 from "json5";
|
|
46
|
+
import * as fs$1 from "node:fs/promises";
|
|
47
|
+
import fs, { open } from "node:fs/promises";
|
|
48
48
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
49
49
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
50
50
|
import process$1 from "node:process";
|
|
@@ -57,7 +57,7 @@ import { DefaultResourceLoader, SessionManager, SettingsManager, convertToLlm, c
|
|
|
57
57
|
import { EdgeTTS } from "node-edge-tts";
|
|
58
58
|
import MarkdownIt from "markdown-it";
|
|
59
59
|
import net from "node:net";
|
|
60
|
-
import WebSocket
|
|
60
|
+
import WebSocket from "ws";
|
|
61
61
|
import { Worker } from "node:worker_threads";
|
|
62
62
|
import { createJiti } from "jiti";
|
|
63
63
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -2742,7 +2742,7 @@ function setPromptSourceCacheEntry(key, entry) {
|
|
|
2742
2742
|
}
|
|
2743
2743
|
function readOpenFileUtf8(fd) {
|
|
2744
2744
|
return new Promise((resolve, reject) => {
|
|
2745
|
-
|
|
2745
|
+
syncFs.readFile(fd, "utf-8", (error, data) => {
|
|
2746
2746
|
if (error) {
|
|
2747
2747
|
reject(error);
|
|
2748
2748
|
return;
|
|
@@ -2753,7 +2753,7 @@ function readOpenFileUtf8(fd) {
|
|
|
2753
2753
|
}
|
|
2754
2754
|
function closeOpenFile(fd) {
|
|
2755
2755
|
return new Promise((resolve, reject) => {
|
|
2756
|
-
|
|
2756
|
+
syncFs.close(fd, (error) => {
|
|
2757
2757
|
if (error) {
|
|
2758
2758
|
reject(error);
|
|
2759
2759
|
return;
|
|
@@ -3162,7 +3162,7 @@ function resolveWorkspaceLane(params) {
|
|
|
3162
3162
|
}
|
|
3163
3163
|
async function pathExists(targetPath) {
|
|
3164
3164
|
try {
|
|
3165
|
-
await fs
|
|
3165
|
+
await fs.access(targetPath);
|
|
3166
3166
|
return true;
|
|
3167
3167
|
} catch {
|
|
3168
3168
|
return false;
|
|
@@ -3170,7 +3170,7 @@ async function pathExists(targetPath) {
|
|
|
3170
3170
|
}
|
|
3171
3171
|
async function getExistingPathState(targetPath) {
|
|
3172
3172
|
try {
|
|
3173
|
-
const stats = await fs
|
|
3173
|
+
const stats = await fs.lstat(targetPath);
|
|
3174
3174
|
if (stats.isSymbolicLink()) return "other";
|
|
3175
3175
|
return stats.isDirectory() ? "directory" : "other";
|
|
3176
3176
|
} catch {
|
|
@@ -3179,7 +3179,7 @@ async function getExistingPathState(targetPath) {
|
|
|
3179
3179
|
}
|
|
3180
3180
|
async function pathLexicallyExists(targetPath) {
|
|
3181
3181
|
try {
|
|
3182
|
-
await fs
|
|
3182
|
+
await fs.lstat(targetPath);
|
|
3183
3183
|
return true;
|
|
3184
3184
|
} catch {
|
|
3185
3185
|
return false;
|
|
@@ -3200,9 +3200,9 @@ async function copyIfMissing(params) {
|
|
|
3200
3200
|
if (!opened.ok) return opened.reason === "path" ? "missing-source" : "invalid";
|
|
3201
3201
|
let content;
|
|
3202
3202
|
try {
|
|
3203
|
-
content =
|
|
3203
|
+
content = syncFs.readFileSync(opened.fd);
|
|
3204
3204
|
} finally {
|
|
3205
|
-
|
|
3205
|
+
syncFs.closeSync(opened.fd);
|
|
3206
3206
|
}
|
|
3207
3207
|
await writeFileWithinRoot({
|
|
3208
3208
|
rootDir: params.targetRoot,
|
|
@@ -3244,9 +3244,9 @@ async function resolveWorkspaceLaneForTurn(params) {
|
|
|
3244
3244
|
const existed = pathState === "directory";
|
|
3245
3245
|
if (!existed) {
|
|
3246
3246
|
const parentDir = path.dirname(resolution.effectiveWorkspaceDir);
|
|
3247
|
-
await fs
|
|
3247
|
+
await fs.mkdir(parentDir, { recursive: true });
|
|
3248
3248
|
const tempDir = path.join(parentDir, `.${path.basename(resolution.effectiveWorkspaceDir)}.creating-${randomUUID()}`);
|
|
3249
|
-
await fs
|
|
3249
|
+
await fs.mkdir(tempDir);
|
|
3250
3250
|
try {
|
|
3251
3251
|
for (const file of config?.copiedOnCreate ?? DEFAULT_COPIED_ON_CREATE_FILES) {
|
|
3252
3252
|
const decision = await copyIfMissing({
|
|
@@ -3262,7 +3262,7 @@ async function resolveWorkspaceLaneForTurn(params) {
|
|
|
3262
3262
|
decision
|
|
3263
3263
|
});
|
|
3264
3264
|
}
|
|
3265
|
-
if (!await fs
|
|
3265
|
+
if (!await fs.rename(tempDir, resolution.effectiveWorkspaceDir).then(() => true, (err) => {
|
|
3266
3266
|
if (err.code === "EEXIST" || err.code === "ENOTEMPTY") return false;
|
|
3267
3267
|
throw err;
|
|
3268
3268
|
})) return {
|
|
@@ -3270,7 +3270,7 @@ async function resolveWorkspaceLaneForTurn(params) {
|
|
|
3270
3270
|
created: false
|
|
3271
3271
|
};
|
|
3272
3272
|
} finally {
|
|
3273
|
-
await fs
|
|
3273
|
+
await fs.rm(tempDir, {
|
|
3274
3274
|
recursive: true,
|
|
3275
3275
|
force: true
|
|
3276
3276
|
});
|
|
@@ -3545,7 +3545,7 @@ async function resolveOpenClawDocsPath(params) {
|
|
|
3545
3545
|
const workspaceDir = params.workspaceDir?.trim();
|
|
3546
3546
|
if (workspaceDir) {
|
|
3547
3547
|
const workspaceDocs = path.join(workspaceDir, "docs");
|
|
3548
|
-
if (
|
|
3548
|
+
if (syncFs.existsSync(workspaceDocs)) return workspaceDocs;
|
|
3549
3549
|
}
|
|
3550
3550
|
const packageRoot = await resolveOpenClawPackageRoot({
|
|
3551
3551
|
cwd: params.cwd,
|
|
@@ -3554,7 +3554,7 @@ async function resolveOpenClawDocsPath(params) {
|
|
|
3554
3554
|
});
|
|
3555
3555
|
if (packageRoot) {
|
|
3556
3556
|
const packageDocs = path.join(packageRoot, "docs");
|
|
3557
|
-
if (
|
|
3557
|
+
if (syncFs.existsSync(path.join(packageDocs, "docs.json"))) return packageDocs;
|
|
3558
3558
|
}
|
|
3559
3559
|
return DOCS_SITE_URL;
|
|
3560
3560
|
}
|
|
@@ -4414,7 +4414,7 @@ async function linkIdentity(params) {
|
|
|
4414
4414
|
const log$69 = createSubsystemLogger("model-catalog");
|
|
4415
4415
|
const modelCatalogPromiseState = resolveProcessScopedMap(Symbol.for("openclaw.agents.model-catalog.modelCatalogPromise"));
|
|
4416
4416
|
const hasLoggedModelCatalogErrorState = resolveProcessScopedMap(Symbol.for("openclaw.agents.model-catalog.hasLoggedModelCatalogError"));
|
|
4417
|
-
const defaultImportPiSdk = () => import("./pi-model-discovery-
|
|
4417
|
+
const defaultImportPiSdk = () => import("./pi-model-discovery-ihTZFn93.js").then((n) => n.r);
|
|
4418
4418
|
let importPiSdk = defaultImportPiSdk;
|
|
4419
4419
|
function getModelCatalogPromise() {
|
|
4420
4420
|
return modelCatalogPromiseState.get("value") ?? null;
|
|
@@ -4893,7 +4893,7 @@ var MediaAttachmentCache = class {
|
|
|
4893
4893
|
const size = await this.ensureLocalStat(entry);
|
|
4894
4894
|
if (entry.resolvedPath) {
|
|
4895
4895
|
if (size !== void 0 && size > params.maxBytes) throw new MediaUnderstandingSkipError("maxBytes", `Attachment ${params.attachmentIndex + 1} exceeds maxBytes ${params.maxBytes}`);
|
|
4896
|
-
const buffer = await fs
|
|
4896
|
+
const buffer = await fs.readFile(entry.resolvedPath);
|
|
4897
4897
|
entry.buffer = buffer;
|
|
4898
4898
|
entry.bufferMime = entry.bufferMime ?? entry.attachment.mime ?? await detectMime({
|
|
4899
4899
|
buffer,
|
|
@@ -4962,10 +4962,10 @@ var MediaAttachmentCache = class {
|
|
|
4962
4962
|
prefix: "openclaw-media",
|
|
4963
4963
|
extension: path.extname(bufferResult.fileName || "") || ""
|
|
4964
4964
|
});
|
|
4965
|
-
await fs
|
|
4965
|
+
await fs.writeFile(tmpPath, bufferResult.buffer);
|
|
4966
4966
|
entry.tempPath = tmpPath;
|
|
4967
4967
|
entry.tempCleanup = async () => {
|
|
4968
|
-
await fs
|
|
4968
|
+
await fs.unlink(tmpPath).catch(() => {});
|
|
4969
4969
|
};
|
|
4970
4970
|
return {
|
|
4971
4971
|
path: tmpPath,
|
|
@@ -5013,13 +5013,13 @@ var MediaAttachmentCache = class {
|
|
|
5013
5013
|
if (entry.statSize !== void 0) return entry.statSize;
|
|
5014
5014
|
try {
|
|
5015
5015
|
const currentPath = entry.resolvedPath;
|
|
5016
|
-
const stat = await fs
|
|
5016
|
+
const stat = await fs.stat(currentPath);
|
|
5017
5017
|
if (!stat.isFile()) {
|
|
5018
5018
|
entry.resolvedPath = void 0;
|
|
5019
5019
|
entry.localPathSecurityRejected = true;
|
|
5020
5020
|
return;
|
|
5021
5021
|
}
|
|
5022
|
-
const canonicalPath = await fs
|
|
5022
|
+
const canonicalPath = await fs.realpath(currentPath);
|
|
5023
5023
|
if (!isInboundPathAllowed({
|
|
5024
5024
|
filePath: canonicalPath,
|
|
5025
5025
|
roots: await this.getCanonicalLocalPathRoots()
|
|
@@ -5043,7 +5043,7 @@ var MediaAttachmentCache = class {
|
|
|
5043
5043
|
if (this.canonicalLocalPathRoots) return await this.canonicalLocalPathRoots;
|
|
5044
5044
|
this.canonicalLocalPathRoots = (async () => mergeInboundPathRoots(this.localPathRoots, await Promise.all(this.localPathRoots.map(async (root) => {
|
|
5045
5045
|
if (root.includes("*")) return root;
|
|
5046
|
-
return await fs
|
|
5046
|
+
return await fs.realpath(root).catch(() => root);
|
|
5047
5047
|
}))))();
|
|
5048
5048
|
return await this.canonicalLocalPathRoots;
|
|
5049
5049
|
}
|
|
@@ -5447,7 +5447,7 @@ function describeAutoSelectionExhausted(capability, providerRegistry, cfg) {
|
|
|
5447
5447
|
async function fileExists(filePath) {
|
|
5448
5448
|
if (!filePath) return false;
|
|
5449
5449
|
try {
|
|
5450
|
-
await fs
|
|
5450
|
+
await fs.stat(filePath);
|
|
5451
5451
|
return true;
|
|
5452
5452
|
} catch {
|
|
5453
5453
|
return false;
|
|
@@ -5497,9 +5497,9 @@ function candidateBinaryNames(name) {
|
|
|
5497
5497
|
}
|
|
5498
5498
|
async function isExecutable(filePath) {
|
|
5499
5499
|
try {
|
|
5500
|
-
if (!(await fs
|
|
5500
|
+
if (!(await fs.stat(filePath)).isFile()) return false;
|
|
5501
5501
|
if (process.platform === "win32") return true;
|
|
5502
|
-
await fs
|
|
5502
|
+
await fs.access(filePath, constants.X_OK);
|
|
5503
5503
|
return true;
|
|
5504
5504
|
} catch {
|
|
5505
5505
|
return false;
|
|
@@ -5986,7 +5986,7 @@ async function resolveCliOutput(params) {
|
|
|
5986
5986
|
const commandId = commandBase(params.command);
|
|
5987
5987
|
const fileOutput = commandId === "whisper-cli" ? resolveWhisperCppOutputPath(params.args) : commandId === "whisper" ? resolveWhisperOutputPath(params.args, params.mediaPath) : commandId === "parakeet-mlx" ? resolveParakeetOutputPath(params.args, params.mediaPath) : null;
|
|
5988
5988
|
if (fileOutput && await fileExists(fileOutput)) try {
|
|
5989
|
-
const content = await fs
|
|
5989
|
+
const content = await fs.readFile(fileOutput, "utf8");
|
|
5990
5990
|
if (content.trim()) return content.trim();
|
|
5991
5991
|
} catch {}
|
|
5992
5992
|
if (commandId === "gemini") {
|
|
@@ -6331,10 +6331,10 @@ async function runCliEntry$1(params) {
|
|
|
6331
6331
|
timeoutMs
|
|
6332
6332
|
});
|
|
6333
6333
|
if (capability === "audio") assertMinAudioSize({
|
|
6334
|
-
size: (await fs
|
|
6334
|
+
size: (await fs.stat(pathResult.path)).size,
|
|
6335
6335
|
attachmentIndex: params.attachmentIndex
|
|
6336
6336
|
});
|
|
6337
|
-
const outputDir = await fs
|
|
6337
|
+
const outputDir = await fs.mkdtemp(path.join(resolvePreferredOpenClawTmpDir(), "openclaw-media-cli-"));
|
|
6338
6338
|
const mediaPath = pathResult.path;
|
|
6339
6339
|
const outputBase = path.join(outputDir, path.parse(mediaPath).name);
|
|
6340
6340
|
const templCtx = {
|
|
@@ -6368,7 +6368,7 @@ async function runCliEntry$1(params) {
|
|
|
6368
6368
|
model: command
|
|
6369
6369
|
};
|
|
6370
6370
|
} finally {
|
|
6371
|
-
await fs
|
|
6371
|
+
await fs.rm(outputDir, {
|
|
6372
6372
|
recursive: true,
|
|
6373
6373
|
force: true
|
|
6374
6374
|
}).catch(() => {});
|
|
@@ -9365,7 +9365,7 @@ async function resolveAgentSessionDirs(stateDir) {
|
|
|
9365
9365
|
const agentsDir = path.join(stateDir, "agents");
|
|
9366
9366
|
let entries = [];
|
|
9367
9367
|
try {
|
|
9368
|
-
entries = await fs
|
|
9368
|
+
entries = await fs.readdir(agentsDir, { withFileTypes: true });
|
|
9369
9369
|
} catch (err) {
|
|
9370
9370
|
if (err.code === "ENOENT") return [];
|
|
9371
9371
|
throw err;
|
|
@@ -12848,7 +12848,7 @@ async function routeReply(params) {
|
|
|
12848
12848
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
12849
12849
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
12850
12850
|
try {
|
|
12851
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
12851
|
+
const { deliverOutboundPayloads } = await import("./deliver-BNwRhCqc.js").then((n) => n.n);
|
|
12852
12852
|
const outboundSession = buildOutboundSessionContext({
|
|
12853
12853
|
cfg,
|
|
12854
12854
|
agentId: resolvedAgentId,
|
|
@@ -14893,7 +14893,7 @@ async function sendTranscriptEcho(params) {
|
|
|
14893
14893
|
}
|
|
14894
14894
|
const text = formatEchoTranscript(transcript, params.format ?? DEFAULT_ECHO_TRANSCRIPT_FORMAT);
|
|
14895
14895
|
try {
|
|
14896
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
14896
|
+
const { deliverOutboundPayloads } = await import("./deliver-BNwRhCqc.js").then((n) => n.n);
|
|
14897
14897
|
await deliverOutboundPayloads({
|
|
14898
14898
|
cfg,
|
|
14899
14899
|
channel: normalizedChannel,
|
|
@@ -17595,7 +17595,7 @@ function getPairingAdapter(channelId) {
|
|
|
17595
17595
|
//#region src/plugin-sdk/json-store.ts
|
|
17596
17596
|
async function readJsonFileWithFallback(filePath, fallback) {
|
|
17597
17597
|
try {
|
|
17598
|
-
const parsed = safeParseJson(await
|
|
17598
|
+
const parsed = safeParseJson(await syncFs.promises.readFile(filePath, "utf-8"));
|
|
17599
17599
|
if (parsed == null) return {
|
|
17600
17600
|
value: fallback,
|
|
17601
17601
|
exists: true
|
|
@@ -17682,7 +17682,7 @@ async function readPairingRequests(filePath) {
|
|
|
17682
17682
|
}
|
|
17683
17683
|
async function ensureJsonFile(filePath, fallback) {
|
|
17684
17684
|
try {
|
|
17685
|
-
await
|
|
17685
|
+
await syncFs.promises.access(filePath);
|
|
17686
17686
|
} catch {
|
|
17687
17687
|
await writeJsonFile(filePath, fallback);
|
|
17688
17688
|
}
|
|
@@ -17838,7 +17838,7 @@ function resolveAllowFromReadCacheOrMissing(filePath, stat) {
|
|
|
17838
17838
|
async function readAllowFromStateForPathWithExists(channel, filePath) {
|
|
17839
17839
|
let stat = null;
|
|
17840
17840
|
try {
|
|
17841
|
-
stat = await
|
|
17841
|
+
stat = await syncFs.promises.stat(filePath);
|
|
17842
17842
|
} catch (err) {
|
|
17843
17843
|
if (err.code !== "ENOENT") throw err;
|
|
17844
17844
|
}
|
|
@@ -17881,7 +17881,7 @@ async function writeAllowFromState(filePath, allowFrom) {
|
|
|
17881
17881
|
});
|
|
17882
17882
|
let stat = null;
|
|
17883
17883
|
try {
|
|
17884
|
-
stat = await
|
|
17884
|
+
stat = await syncFs.promises.stat(filePath);
|
|
17885
17885
|
} catch {}
|
|
17886
17886
|
setAllowFromReadCache(filePath, {
|
|
17887
17887
|
exists: true,
|
|
@@ -19048,7 +19048,7 @@ function mergeLegacyAgent(current, legacy) {
|
|
|
19048
19048
|
}
|
|
19049
19049
|
function ensureDir$1(filePath) {
|
|
19050
19050
|
const dir = path.dirname(filePath);
|
|
19051
|
-
|
|
19051
|
+
syncFs.mkdirSync(dir, { recursive: true });
|
|
19052
19052
|
}
|
|
19053
19053
|
function coerceAllowlistEntries(allowlist) {
|
|
19054
19054
|
if (!Array.isArray(allowlist) || allowlist.length === 0) return Array.isArray(allowlist) ? allowlist : void 0;
|
|
@@ -19118,11 +19118,11 @@ function generateToken() {
|
|
|
19118
19118
|
function loadExecApprovals() {
|
|
19119
19119
|
const filePath = resolveExecApprovalsPath();
|
|
19120
19120
|
try {
|
|
19121
|
-
if (!
|
|
19121
|
+
if (!syncFs.existsSync(filePath)) return normalizeExecApprovals({
|
|
19122
19122
|
version: 1,
|
|
19123
19123
|
agents: {}
|
|
19124
19124
|
});
|
|
19125
|
-
const raw =
|
|
19125
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
19126
19126
|
const parsed = JSON.parse(raw);
|
|
19127
19127
|
if (parsed?.version !== 1) return normalizeExecApprovals({
|
|
19128
19128
|
version: 1,
|
|
@@ -19139,9 +19139,9 @@ function loadExecApprovals() {
|
|
|
19139
19139
|
function saveExecApprovals(file) {
|
|
19140
19140
|
const filePath = resolveExecApprovalsPath();
|
|
19141
19141
|
ensureDir$1(filePath);
|
|
19142
|
-
|
|
19142
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, { mode: 384 });
|
|
19143
19143
|
try {
|
|
19144
|
-
|
|
19144
|
+
syncFs.chmodSync(filePath, 384);
|
|
19145
19145
|
} catch {}
|
|
19146
19146
|
}
|
|
19147
19147
|
function ensureExecApprovals() {
|
|
@@ -19605,18 +19605,18 @@ function applyPathPrepend(env, prepend, options) {
|
|
|
19605
19605
|
function resolvePowerShellPath() {
|
|
19606
19606
|
const programFiles = process.env.ProgramFiles || process.env.PROGRAMFILES || "C:\\Program Files";
|
|
19607
19607
|
const pwsh7 = path.join(programFiles, "PowerShell", "7", "pwsh.exe");
|
|
19608
|
-
if (
|
|
19608
|
+
if (syncFs.existsSync(pwsh7)) return pwsh7;
|
|
19609
19609
|
const programW6432 = process.env.ProgramW6432;
|
|
19610
19610
|
if (programW6432 && programW6432 !== programFiles) {
|
|
19611
19611
|
const pwsh7Alt = path.join(programW6432, "PowerShell", "7", "pwsh.exe");
|
|
19612
|
-
if (
|
|
19612
|
+
if (syncFs.existsSync(pwsh7Alt)) return pwsh7Alt;
|
|
19613
19613
|
}
|
|
19614
19614
|
const pwshInPath = resolveShellFromPath("pwsh");
|
|
19615
19615
|
if (pwshInPath) return pwshInPath;
|
|
19616
19616
|
const systemRoot = process.env.SystemRoot || process.env.WINDIR;
|
|
19617
19617
|
if (systemRoot) {
|
|
19618
19618
|
const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
19619
|
-
if (
|
|
19619
|
+
if (syncFs.existsSync(candidate)) return candidate;
|
|
19620
19620
|
}
|
|
19621
19621
|
return "powershell.exe";
|
|
19622
19622
|
}
|
|
@@ -19654,7 +19654,7 @@ function resolveShellFromPath(name) {
|
|
|
19654
19654
|
for (const entry of entries) {
|
|
19655
19655
|
const candidate = path.join(entry, name);
|
|
19656
19656
|
try {
|
|
19657
|
-
|
|
19657
|
+
syncFs.accessSync(candidate, syncFs.constants.X_OK);
|
|
19658
19658
|
return candidate;
|
|
19659
19659
|
} catch {}
|
|
19660
19660
|
}
|
|
@@ -20592,7 +20592,7 @@ async function resolveSandboxWorkdir(params) {
|
|
|
20592
20592
|
cwd: process.cwd(),
|
|
20593
20593
|
root: params.sandbox.workspaceDir
|
|
20594
20594
|
});
|
|
20595
|
-
if (!(await fs
|
|
20595
|
+
if (!(await fs.stat(resolved.resolved)).isDirectory()) throw new Error("workdir is not a directory");
|
|
20596
20596
|
const relative = resolved.relative ? resolved.relative.split(path.sep).join(path.posix.sep) : "";
|
|
20597
20597
|
const containerWorkdir = relative ? path.posix.join(params.sandbox.containerWorkdir, relative) : params.sandbox.containerWorkdir;
|
|
20598
20598
|
return {
|
|
@@ -21177,7 +21177,7 @@ async function imageResult(params) {
|
|
|
21177
21177
|
}, params.label, params.imageSanitization);
|
|
21178
21178
|
}
|
|
21179
21179
|
async function imageResultFromFile(params) {
|
|
21180
|
-
const buf = await fs
|
|
21180
|
+
const buf = await fs.readFile(params.path);
|
|
21181
21181
|
const mimeType = await detectMime({ buffer: buf.slice(0, 256) }) ?? "image/png";
|
|
21182
21182
|
return await imageResult({
|
|
21183
21183
|
label: params.label,
|
|
@@ -22112,13 +22112,13 @@ async function validateScriptFileForShellBleed(params) {
|
|
|
22112
22112
|
cwd: params.workdir,
|
|
22113
22113
|
root: params.workdir
|
|
22114
22114
|
});
|
|
22115
|
-
stat = await fs
|
|
22115
|
+
stat = await fs.stat(absPath);
|
|
22116
22116
|
} catch {
|
|
22117
22117
|
return;
|
|
22118
22118
|
}
|
|
22119
22119
|
if (!stat.isFile()) return;
|
|
22120
22120
|
if (stat.size > 512 * 1024) return;
|
|
22121
|
-
const content = await fs
|
|
22121
|
+
const content = await fs.readFile(absPath, "utf-8");
|
|
22122
22122
|
const first = /\$[A-Z_][A-Z0-9_]{1,}/g.exec(content);
|
|
22123
22123
|
if (first) {
|
|
22124
22124
|
const idx = first.index;
|
|
@@ -23538,7 +23538,7 @@ function walkUpFrom(startDir, opts, resolveAtDir) {
|
|
|
23538
23538
|
function hasGitMarker(repoRoot) {
|
|
23539
23539
|
const gitPath = path.join(repoRoot, ".git");
|
|
23540
23540
|
try {
|
|
23541
|
-
const stat =
|
|
23541
|
+
const stat = syncFs.statSync(gitPath);
|
|
23542
23542
|
return stat.isDirectory() || stat.isFile();
|
|
23543
23543
|
} catch {
|
|
23544
23544
|
return false;
|
|
@@ -23550,10 +23550,10 @@ function findGitRoot(startDir, opts = {}) {
|
|
|
23550
23550
|
function resolveGitDirFromMarker(repoRoot) {
|
|
23551
23551
|
const gitPath = path.join(repoRoot, ".git");
|
|
23552
23552
|
try {
|
|
23553
|
-
const stat =
|
|
23553
|
+
const stat = syncFs.statSync(gitPath);
|
|
23554
23554
|
if (stat.isDirectory()) return gitPath;
|
|
23555
23555
|
if (!stat.isFile()) return null;
|
|
23556
|
-
const match =
|
|
23556
|
+
const match = syncFs.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
|
|
23557
23557
|
if (!match?.[1]) return null;
|
|
23558
23558
|
return path.resolve(repoRoot, match[1].trim());
|
|
23559
23559
|
} catch {
|
|
@@ -23620,7 +23620,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
23620
23620
|
cachedCommit = null;
|
|
23621
23621
|
return cachedCommit;
|
|
23622
23622
|
}
|
|
23623
|
-
const head =
|
|
23623
|
+
const head = syncFs.readFileSync(headPath, "utf-8").trim();
|
|
23624
23624
|
if (!head) {
|
|
23625
23625
|
cachedCommit = null;
|
|
23626
23626
|
return cachedCommit;
|
|
@@ -23628,7 +23628,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
23628
23628
|
if (head.startsWith("ref:")) {
|
|
23629
23629
|
const ref = head.replace(/^ref:\s*/i, "").trim();
|
|
23630
23630
|
const refPath = path.resolve(path.dirname(headPath), ref);
|
|
23631
|
-
cachedCommit = formatCommit(
|
|
23631
|
+
cachedCommit = formatCommit(syncFs.readFileSync(refPath, "utf-8").trim());
|
|
23632
23632
|
return cachedCommit;
|
|
23633
23633
|
}
|
|
23634
23634
|
cachedCommit = formatCommit(head);
|
|
@@ -27470,13 +27470,13 @@ function listSkillCommandsForAgents(params) {
|
|
|
27470
27470
|
const workspaceFilters = /* @__PURE__ */ new Map();
|
|
27471
27471
|
for (const agentId of agentIds) {
|
|
27472
27472
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, agentId);
|
|
27473
|
-
if (!
|
|
27473
|
+
if (!syncFs.existsSync(workspaceDir)) {
|
|
27474
27474
|
logVerbose(`Skipping agent "${agentId}": workspace does not exist: ${workspaceDir}`);
|
|
27475
27475
|
continue;
|
|
27476
27476
|
}
|
|
27477
27477
|
let canonicalDir;
|
|
27478
27478
|
try {
|
|
27479
|
-
canonicalDir =
|
|
27479
|
+
canonicalDir = syncFs.realpathSync(workspaceDir);
|
|
27480
27480
|
} catch {
|
|
27481
27481
|
logVerbose(`Skipping agent "${agentId}": cannot resolve workspace: ${workspaceDir}`);
|
|
27482
27482
|
continue;
|
|
@@ -28666,7 +28666,7 @@ function resolveRepoRoot(params) {
|
|
|
28666
28666
|
const configured = params.config?.agents?.defaults?.repoRoot?.trim();
|
|
28667
28667
|
if (configured) try {
|
|
28668
28668
|
const resolved = path.resolve(configured);
|
|
28669
|
-
if (
|
|
28669
|
+
if (syncFs.statSync(resolved).isDirectory()) return resolved;
|
|
28670
28670
|
} catch {}
|
|
28671
28671
|
const candidates = [params.workspaceDir, params.cwd].map((value) => value?.trim()).filter(Boolean);
|
|
28672
28672
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -29185,7 +29185,7 @@ async function readForwardAndSort(query, sessionId) {
|
|
|
29185
29185
|
//#region src/auto-reply/reply/commands-export-session.ts
|
|
29186
29186
|
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
|
29187
29187
|
function loadTemplate(fileName) {
|
|
29188
|
-
return
|
|
29188
|
+
return syncFs.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
|
|
29189
29189
|
}
|
|
29190
29190
|
function generateHtml(sessionData) {
|
|
29191
29191
|
const template = loadTemplate("template.html");
|
|
@@ -29288,8 +29288,8 @@ async function buildExportSessionReply(params) {
|
|
|
29288
29288
|
const defaultFileName = `openclaw-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
|
|
29289
29289
|
const outputPath = args.outputPath ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) : path.join(params.workspaceDir, defaultFileName);
|
|
29290
29290
|
const outputDir = path.dirname(outputPath);
|
|
29291
|
-
if (!
|
|
29292
|
-
|
|
29291
|
+
if (!syncFs.existsSync(outputDir)) syncFs.mkdirSync(outputDir, { recursive: true });
|
|
29292
|
+
syncFs.writeFileSync(outputPath, html, "utf-8");
|
|
29293
29293
|
const relativePath = path.relative(params.workspaceDir, outputPath);
|
|
29294
29294
|
return { text: [
|
|
29295
29295
|
"✅ Session exported!",
|
|
@@ -29464,8 +29464,8 @@ function resolveZaiApiKey() {
|
|
|
29464
29464
|
}
|
|
29465
29465
|
try {
|
|
29466
29466
|
const authPath = path.join(resolveRequiredHomeDir(process.env, os.homedir), ".pi", "agent", "auth.json");
|
|
29467
|
-
if (!
|
|
29468
|
-
const data = JSON.parse(
|
|
29467
|
+
if (!syncFs.existsSync(authPath)) return;
|
|
29468
|
+
const data = JSON.parse(syncFs.readFileSync(authPath, "utf-8"));
|
|
29469
29469
|
return data["z-ai"]?.access || data.zai?.access;
|
|
29470
29470
|
} catch {
|
|
29471
29471
|
return;
|
|
@@ -32884,8 +32884,8 @@ function normalizeSessionKey(value) {
|
|
|
32884
32884
|
}
|
|
32885
32885
|
function readSessionStore(storePath) {
|
|
32886
32886
|
try {
|
|
32887
|
-
const raw =
|
|
32888
|
-
const parsed =
|
|
32887
|
+
const raw = syncFs.readFileSync(storePath, "utf-8");
|
|
32888
|
+
const parsed = json5.parse(raw);
|
|
32889
32889
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
|
|
32890
32890
|
} catch {}
|
|
32891
32891
|
return {};
|
|
@@ -34597,7 +34597,7 @@ async function createModelSelectionState(params) {
|
|
|
34597
34597
|
}
|
|
34598
34598
|
}
|
|
34599
34599
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
34600
|
-
const { ensureAuthProfileStore } = await import("./model-selection-
|
|
34600
|
+
const { ensureAuthProfileStore } = await import("./model-selection-ik2bHbgK.js").then((n) => n.P);
|
|
34601
34601
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
34602
34602
|
const providerKey = normalizeProviderId(provider);
|
|
34603
34603
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -38195,7 +38195,7 @@ function asBoolean(value) {
|
|
|
38195
38195
|
}
|
|
38196
38196
|
function resolveTempPathParts(opts) {
|
|
38197
38197
|
const tmpDir = opts.tmpDir ?? resolvePreferredOpenClawTmpDir();
|
|
38198
|
-
if (!opts.tmpDir)
|
|
38198
|
+
if (!opts.tmpDir) syncFs.mkdirSync(tmpDir, {
|
|
38199
38199
|
recursive: true,
|
|
38200
38200
|
mode: 448
|
|
38201
38201
|
});
|
|
@@ -38281,7 +38281,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38281
38281
|
if (typeof contentLength === "number" && Number.isFinite(contentLength) && contentLength > MAX_CAMERA_URL_DOWNLOAD_BYTES) throw new Error(`writeUrlToFile: content-length ${contentLength} exceeds max ${MAX_CAMERA_URL_DOWNLOAD_BYTES}`);
|
|
38282
38282
|
const body = res.body;
|
|
38283
38283
|
if (!body) throw new Error(`failed to download ${url}: empty response body`);
|
|
38284
|
-
const fileHandle = await fs$
|
|
38284
|
+
const fileHandle = await fs$1.open(filePath, "w");
|
|
38285
38285
|
let thrown;
|
|
38286
38286
|
try {
|
|
38287
38287
|
const reader = body.getReader();
|
|
@@ -38299,7 +38299,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38299
38299
|
await fileHandle.close();
|
|
38300
38300
|
}
|
|
38301
38301
|
if (thrown) {
|
|
38302
|
-
await fs$
|
|
38302
|
+
await fs$1.unlink(filePath).catch(() => {});
|
|
38303
38303
|
throw thrown;
|
|
38304
38304
|
}
|
|
38305
38305
|
} finally {
|
|
@@ -38312,7 +38312,7 @@ async function writeUrlToFile(filePath, url, opts) {
|
|
|
38312
38312
|
}
|
|
38313
38313
|
async function writeBase64ToFile(filePath, base64) {
|
|
38314
38314
|
const buf = Buffer.from(base64, "base64");
|
|
38315
|
-
await fs$
|
|
38315
|
+
await fs$1.writeFile(filePath, buf);
|
|
38316
38316
|
return {
|
|
38317
38317
|
path: filePath,
|
|
38318
38318
|
bytes: buf.length
|
|
@@ -38397,7 +38397,7 @@ async function readJsonlFromPath(jsonlPath) {
|
|
|
38397
38397
|
if (shouldLogVerbose()) logVerbose(`Blocked canvas jsonlPath outside allowed roots: ${resolved}`);
|
|
38398
38398
|
throw new Error("jsonlPath outside allowed roots");
|
|
38399
38399
|
}
|
|
38400
|
-
const canonical = await fs
|
|
38400
|
+
const canonical = await fs.realpath(resolved).catch(() => resolved);
|
|
38401
38401
|
if (!isInboundPathAllowed({
|
|
38402
38402
|
filePath: canonical,
|
|
38403
38403
|
roots
|
|
@@ -38405,7 +38405,7 @@ async function readJsonlFromPath(jsonlPath) {
|
|
|
38405
38405
|
if (shouldLogVerbose()) logVerbose(`Blocked canvas jsonlPath outside allowed roots: ${canonical}`);
|
|
38406
38406
|
throw new Error("jsonlPath outside allowed roots");
|
|
38407
38407
|
}
|
|
38408
|
-
return await fs
|
|
38408
|
+
return await fs.readFile(canonical, "utf8");
|
|
38409
38409
|
}
|
|
38410
38410
|
const CanvasToolSchema = Type.Object({
|
|
38411
38411
|
action: stringEnum(CANVAS_ACTIONS),
|
|
@@ -39260,12 +39260,12 @@ function resolveRestartSentinelPath(env = process.env) {
|
|
|
39260
39260
|
}
|
|
39261
39261
|
async function writeRestartSentinel(payload, env = process.env) {
|
|
39262
39262
|
const filePath = resolveRestartSentinelPath(env);
|
|
39263
|
-
await fs
|
|
39263
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
39264
39264
|
const data = {
|
|
39265
39265
|
version: 1,
|
|
39266
39266
|
payload
|
|
39267
39267
|
};
|
|
39268
|
-
await fs
|
|
39268
|
+
await fs.writeFile(filePath, `${JSON.stringify(data, null, 2)}\n`, "utf-8");
|
|
39269
39269
|
return filePath;
|
|
39270
39270
|
}
|
|
39271
39271
|
|
|
@@ -41628,9 +41628,9 @@ function loadExternalCatalogEntries(options) {
|
|
|
41628
41628
|
const entries = [];
|
|
41629
41629
|
for (const rawPath of paths) {
|
|
41630
41630
|
const resolved = resolveUserPath(rawPath);
|
|
41631
|
-
if (!
|
|
41631
|
+
if (!syncFs.existsSync(resolved)) continue;
|
|
41632
41632
|
try {
|
|
41633
|
-
const payload = JSON.parse(
|
|
41633
|
+
const payload = JSON.parse(syncFs.readFileSync(resolved, "utf-8"));
|
|
41634
41634
|
entries.push(...parseCatalogEntries(payload));
|
|
41635
41635
|
} catch {}
|
|
41636
41636
|
}
|
|
@@ -50857,18 +50857,18 @@ function appendImagePathsToPrompt(prompt, paths) {
|
|
|
50857
50857
|
return `${trimmed}${trimmed ? "\n\n" : ""}${paths.join("\n")}`;
|
|
50858
50858
|
}
|
|
50859
50859
|
async function writeCliImages(images) {
|
|
50860
|
-
const tempDir = await fs
|
|
50860
|
+
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-cli-images-"));
|
|
50861
50861
|
const paths = [];
|
|
50862
50862
|
for (let i = 0; i < images.length; i += 1) {
|
|
50863
50863
|
const image = images[i];
|
|
50864
50864
|
const ext = resolveImageExtension(image.mimeType);
|
|
50865
50865
|
const filePath = path.join(tempDir, `image-${i + 1}.${ext}`);
|
|
50866
50866
|
const buffer = Buffer.from(image.data, "base64");
|
|
50867
|
-
await fs
|
|
50867
|
+
await fs.writeFile(filePath, buffer, { mode: 384 });
|
|
50868
50868
|
paths.push(filePath);
|
|
50869
50869
|
}
|
|
50870
50870
|
const cleanup = async () => {
|
|
50871
|
-
await fs
|
|
50871
|
+
await fs.rm(tempDir, {
|
|
50872
50872
|
recursive: true,
|
|
50873
50873
|
force: true
|
|
50874
50874
|
});
|
|
@@ -52830,10 +52830,10 @@ function resolveCronStorePath(storePath) {
|
|
|
52830
52830
|
}
|
|
52831
52831
|
async function loadCronStore(storePath) {
|
|
52832
52832
|
try {
|
|
52833
|
-
const raw = await
|
|
52833
|
+
const raw = await syncFs.promises.readFile(storePath, "utf-8");
|
|
52834
52834
|
let parsed;
|
|
52835
52835
|
try {
|
|
52836
|
-
parsed =
|
|
52836
|
+
parsed = json5.parse(raw);
|
|
52837
52837
|
} catch (err) {
|
|
52838
52838
|
throw new Error(`Failed to parse cron store at ${storePath}: ${String(err)}`, { cause: err });
|
|
52839
52839
|
}
|
|
@@ -53409,9 +53409,9 @@ async function readPostCompactionContext(workspaceDir) {
|
|
|
53409
53409
|
if (!opened.ok) return null;
|
|
53410
53410
|
const sections = extractSections((() => {
|
|
53411
53411
|
try {
|
|
53412
|
-
return
|
|
53412
|
+
return syncFs.readFileSync(opened.fd, "utf-8");
|
|
53413
53413
|
} finally {
|
|
53414
|
-
|
|
53414
|
+
syncFs.closeSync(opened.fd);
|
|
53415
53415
|
}
|
|
53416
53416
|
})(), ["Session Startup", "Red Lines"]);
|
|
53417
53417
|
if (sections.length === 0) return null;
|
|
@@ -54460,7 +54460,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
54460
54460
|
return;
|
|
54461
54461
|
}
|
|
54462
54462
|
try {
|
|
54463
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
54463
|
+
const { deliverOutboundPayloads } = await import("./deliver-BNwRhCqc.js").then((n) => n.n);
|
|
54464
54464
|
const outboundSession = buildOutboundSessionContext({
|
|
54465
54465
|
cfg: params.cfg,
|
|
54466
54466
|
sessionKey: params.sessionKey
|
|
@@ -55409,7 +55409,7 @@ async function stageSandboxMedia(params) {
|
|
|
55409
55409
|
const remoteMediaCacheDir = ctx.MediaRemoteHost ? path.join(workspaceDir, ".openclaw", "media", "remote-cache", sessionKey) : null;
|
|
55410
55410
|
const effectiveWorkspaceDir = sandbox?.workspaceDir ?? remoteMediaCacheDir;
|
|
55411
55411
|
if (!effectiveWorkspaceDir) return;
|
|
55412
|
-
await fs
|
|
55412
|
+
await fs.mkdir(effectiveWorkspaceDir, { recursive: true });
|
|
55413
55413
|
const remoteAttachmentRoots = resolveIMessageRemoteAttachmentRoots({
|
|
55414
55414
|
cfg,
|
|
55415
55415
|
accountId: ctx.AccountId
|
|
@@ -55468,8 +55468,8 @@ async function stageLocalFileIntoRoot(params) {
|
|
|
55468
55468
|
}
|
|
55469
55469
|
async function stageRemoteFileIntoRoot(params) {
|
|
55470
55470
|
const tmpRoot = resolvePreferredOpenClawTmpDir();
|
|
55471
|
-
await fs
|
|
55472
|
-
const tmpDir = await fs
|
|
55471
|
+
await fs.mkdir(tmpRoot, { recursive: true });
|
|
55472
|
+
const tmpDir = await fs.mkdtemp(path.join(tmpRoot, "stage-sandbox-media-"));
|
|
55473
55473
|
const tmpPath = path.join(tmpDir, "download");
|
|
55474
55474
|
try {
|
|
55475
55475
|
await scpFile(params.remoteHost, params.remotePath, tmpPath);
|
|
@@ -55480,7 +55480,7 @@ async function stageRemoteFileIntoRoot(params) {
|
|
|
55480
55480
|
maxBytes: params.maxBytes
|
|
55481
55481
|
});
|
|
55482
55482
|
} finally {
|
|
55483
|
-
await fs
|
|
55483
|
+
await fs.rm(tmpDir, {
|
|
55484
55484
|
recursive: true,
|
|
55485
55485
|
force: true
|
|
55486
55486
|
}).catch(() => {});
|
|
@@ -56498,7 +56498,7 @@ async function resolveHeartbeatPreflight(params) {
|
|
|
56498
56498
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, params.agentId);
|
|
56499
56499
|
const heartbeatFilePath = path.join(workspaceDir, DEFAULT_HEARTBEAT_FILENAME);
|
|
56500
56500
|
try {
|
|
56501
|
-
if (isHeartbeatContentEffectivelyEmpty(await fs
|
|
56501
|
+
if (isHeartbeatContentEffectivelyEmpty(await fs.readFile(heartbeatFilePath, "utf-8"))) return {
|
|
56502
56502
|
...basePreflight,
|
|
56503
56503
|
skipReason: "empty-heartbeat-file"
|
|
56504
56504
|
};
|
|
@@ -56774,7 +56774,7 @@ async function runModelGate(spec, ctx) {
|
|
|
56774
56774
|
const isolatedSessionId = randomNonce;
|
|
56775
56775
|
const isolatedRunId = randomNonce;
|
|
56776
56776
|
const tmpBaseDir = resolvePreferredOpenClawTmpDir();
|
|
56777
|
-
tmpDir = await fs
|
|
56777
|
+
tmpDir = await fs.mkdtemp(path.join(tmpBaseDir, "wake-gate-"));
|
|
56778
56778
|
const workspaceDir = tmpDir;
|
|
56779
56779
|
const prompt = spec.prompt ?? DEFAULT_MODEL_PROMPT;
|
|
56780
56780
|
const timeoutMs = spec.timeoutMs ?? DEFAULT_MODEL_TIMEOUT_MS;
|
|
@@ -56832,7 +56832,7 @@ async function runModelGate(spec, ctx) {
|
|
|
56832
56832
|
log$35.warn("model gate error", { error: err instanceof Error ? err.message : String(err) });
|
|
56833
56833
|
return { wake: false };
|
|
56834
56834
|
} finally {
|
|
56835
|
-
if (tmpDir) await fs
|
|
56835
|
+
if (tmpDir) await fs.rm(tmpDir, {
|
|
56836
56836
|
recursive: true,
|
|
56837
56837
|
force: true
|
|
56838
56838
|
}).catch(() => void 0);
|
|
@@ -63153,7 +63153,7 @@ async function detectBinary(name) {
|
|
|
63153
63153
|
if (!isSafeExecutableValue(name)) return false;
|
|
63154
63154
|
const resolved = name.startsWith("~") ? resolveUserPath(name) : name;
|
|
63155
63155
|
if (path.isAbsolute(resolved) || resolved.startsWith(".") || resolved.includes("/") || resolved.includes("\\")) try {
|
|
63156
|
-
await fs
|
|
63156
|
+
await fs.access(resolved);
|
|
63157
63157
|
return true;
|
|
63158
63158
|
} catch {
|
|
63159
63159
|
return false;
|
|
@@ -63829,7 +63829,7 @@ function normalizeAllowList$1(list) {
|
|
|
63829
63829
|
async function detectRemoteHostFromCliPath(cliPath) {
|
|
63830
63830
|
try {
|
|
63831
63831
|
const expanded = cliPath.startsWith("~") ? cliPath.replace(/^~/, process.env.HOME ?? "") : cliPath;
|
|
63832
|
-
const content = await fs
|
|
63832
|
+
const content = await fs.readFile(expanded, "utf8");
|
|
63833
63833
|
const userHostMatch = content.match(/\bssh\b[^\n]*?\s+([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/);
|
|
63834
63834
|
if (userHostMatch) return userHostMatch[1];
|
|
63835
63835
|
return content.match(/\bssh\b[^\n]*?\s+([a-zA-Z][a-zA-Z0-9._-]*)\s+\S*\bimsg\b/)?.[1];
|
|
@@ -64197,7 +64197,7 @@ function getChannelActivity(params) {
|
|
|
64197
64197
|
function readFileIfExists(filePath) {
|
|
64198
64198
|
if (!filePath) return;
|
|
64199
64199
|
try {
|
|
64200
|
-
return
|
|
64200
|
+
return syncFs.readFileSync(filePath, "utf-8").trim();
|
|
64201
64201
|
} catch {
|
|
64202
64202
|
return;
|
|
64203
64203
|
}
|
|
@@ -64860,7 +64860,7 @@ async function downloadLineMedia(messageId, channelAccessToken, maxBytes = 10 *
|
|
|
64860
64860
|
prefix: "line-media",
|
|
64861
64861
|
extension: getExtensionForContentType(contentType)
|
|
64862
64862
|
});
|
|
64863
|
-
await
|
|
64863
|
+
await syncFs.promises.writeFile(filePath, buffer);
|
|
64864
64864
|
logVerbose(`line: downloaded media ${messageId} to ${filePath} (${buffer.length} bytes)`);
|
|
64865
64865
|
return {
|
|
64866
64866
|
path: filePath,
|
|
@@ -67735,7 +67735,7 @@ function createRuntimeChannel() {
|
|
|
67735
67735
|
reply: {
|
|
67736
67736
|
dispatchReplyWithBufferedBlockDispatcher,
|
|
67737
67737
|
dispatchInboundMessage,
|
|
67738
|
-
agentCommandFromIngress: async (...args) => (await import("./agent-
|
|
67738
|
+
agentCommandFromIngress: async (...args) => (await import("./agent-C31FKy1u.js").then((n) => n.n)).agentCommandFromIngress(...args),
|
|
67739
67739
|
dispatchReplyWithDispatcher,
|
|
67740
67740
|
createReplyDispatcherWithTyping,
|
|
67741
67741
|
resolveEffectiveMessagesConfig,
|
|
@@ -68164,7 +68164,7 @@ async function getMemorySearchManager(params) {
|
|
|
68164
68164
|
if (cached) return { manager: cached };
|
|
68165
68165
|
}
|
|
68166
68166
|
try {
|
|
68167
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
68167
|
+
const { QmdMemoryManager } = await import("./qmd-manager-jGcc2exw.js");
|
|
68168
68168
|
const primary = await QmdMemoryManager.create({
|
|
68169
68169
|
cfg: params.cfg,
|
|
68170
68170
|
agentId: params.agentId,
|
|
@@ -68176,7 +68176,7 @@ async function getMemorySearchManager(params) {
|
|
|
68176
68176
|
const wrapper = new FallbackMemoryManager({
|
|
68177
68177
|
primary,
|
|
68178
68178
|
fallbackFactory: async () => {
|
|
68179
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
68179
|
+
const { MemoryIndexManager } = await import("./manager-Cd7Dgpw3.js").then((n) => n.t);
|
|
68180
68180
|
return await MemoryIndexManager.get(params);
|
|
68181
68181
|
}
|
|
68182
68182
|
}, () => {
|
|
@@ -68191,7 +68191,7 @@ async function getMemorySearchManager(params) {
|
|
|
68191
68191
|
}
|
|
68192
68192
|
}
|
|
68193
68193
|
try {
|
|
68194
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
68194
|
+
const { MemoryIndexManager } = await import("./manager-Cd7Dgpw3.js").then((n) => n.t);
|
|
68195
68195
|
return { manager: await MemoryIndexManager.get(params) };
|
|
68196
68196
|
} catch (err) {
|
|
68197
68197
|
return {
|
|
@@ -68541,7 +68541,7 @@ const LEGACY_ARCHIVE_DEFAULT_RETENTION_MS = 720 * 60 * 60 * 1e3;
|
|
|
68541
68541
|
const log$25 = createSubsystemLogger("config/sessions/legacy-import/archive");
|
|
68542
68542
|
/** SHA-256 over the file's bytes; null when the file is gone (ENOENT). Other errors propagate. */
|
|
68543
68543
|
async function sourceIdentity(filePath) {
|
|
68544
|
-
const handle = await fs
|
|
68544
|
+
const handle = await fs.open(filePath, "r").catch((error) => {
|
|
68545
68545
|
if (error.code === "ENOENT") return null;
|
|
68546
68546
|
throw error;
|
|
68547
68547
|
});
|
|
@@ -68594,9 +68594,9 @@ function fallbackArchiveDest(source, archiveRoot) {
|
|
|
68594
68594
|
async function copyVerifiedTo(sourcePath, dest, expected) {
|
|
68595
68595
|
const tmp = `${dest}.tmp-${randomUUID()}`;
|
|
68596
68596
|
try {
|
|
68597
|
-
const handle = await fs
|
|
68597
|
+
const handle = await fs.open(tmp, "wx", 384);
|
|
68598
68598
|
try {
|
|
68599
|
-
const sourceHandle = await fs
|
|
68599
|
+
const sourceHandle = await fs.open(sourcePath, "r");
|
|
68600
68600
|
try {
|
|
68601
68601
|
const chunk = Buffer.allocUnsafe(256 * 1024);
|
|
68602
68602
|
let size = 0;
|
|
@@ -68613,18 +68613,18 @@ async function copyVerifiedTo(sourcePath, dest, expected) {
|
|
|
68613
68613
|
} finally {
|
|
68614
68614
|
await handle.close();
|
|
68615
68615
|
}
|
|
68616
|
-
await fs
|
|
68616
|
+
await fs.chmod(tmp, 384);
|
|
68617
68617
|
const copied = await identityOf(tmp);
|
|
68618
68618
|
if (!copied || copied.fingerprint !== expected.fingerprint) throw new Error(`legacy archive cross-device copy diverged from the imported bytes: ${dest}`);
|
|
68619
68619
|
try {
|
|
68620
|
-
await fs
|
|
68620
|
+
await fs.link(tmp, dest);
|
|
68621
68621
|
} catch (error) {
|
|
68622
68622
|
if (error.code !== "EEXIST") throw error;
|
|
68623
68623
|
const existing = await identityOf(dest);
|
|
68624
68624
|
if (!existing || existing.fingerprint !== expected.fingerprint) throw new Error(`legacy archive destination exists with different content: ${dest}`, { cause: error });
|
|
68625
68625
|
}
|
|
68626
68626
|
} finally {
|
|
68627
|
-
await fs
|
|
68627
|
+
await fs.rm(tmp, { force: true });
|
|
68628
68628
|
}
|
|
68629
68629
|
}
|
|
68630
68630
|
/**
|
|
@@ -68640,7 +68640,7 @@ async function planLegacyArchiveDest(source, archiveRoot, expected) {
|
|
|
68640
68640
|
const resolvedRoot = path.resolve(archiveRoot);
|
|
68641
68641
|
const { dir, dest } = archivePathsFor(source, resolvedRoot);
|
|
68642
68642
|
try {
|
|
68643
|
-
await fs
|
|
68643
|
+
await fs.mkdir(dir, {
|
|
68644
68644
|
recursive: true,
|
|
68645
68645
|
mode: 448
|
|
68646
68646
|
});
|
|
@@ -68680,7 +68680,7 @@ async function archiveLegacySource(source, archiveRoot, expected) {
|
|
|
68680
68680
|
*/
|
|
68681
68681
|
async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
68682
68682
|
const resolvedRoot = path.resolve(archiveRoot);
|
|
68683
|
-
await fs
|
|
68683
|
+
await fs.mkdir(path.dirname(dest), {
|
|
68684
68684
|
recursive: true,
|
|
68685
68685
|
mode: 448
|
|
68686
68686
|
});
|
|
@@ -68690,14 +68690,14 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
68690
68690
|
const expectedIdentity = expected ?? sourceIdentityValue;
|
|
68691
68691
|
if (sourceIdentityValue.fingerprint !== expectedIdentity.fingerprint) throw new Error(`legacy source changed after import; failing closed: ${source.path}`);
|
|
68692
68692
|
const destInodeVerified = async (destPath) => {
|
|
68693
|
-
const [sourceStat, destStat] = await Promise.all([fs
|
|
68693
|
+
const [sourceStat, destStat] = await Promise.all([fs.stat(source.path), fs.stat(destPath).catch(() => void 0)]);
|
|
68694
68694
|
return destStat !== void 0 && destStat.dev === sourceStat.dev && destStat.ino === sourceStat.ino;
|
|
68695
68695
|
};
|
|
68696
68696
|
const moveInto = async (destPath) => {
|
|
68697
68697
|
let moved = false;
|
|
68698
68698
|
let independentArchive = false;
|
|
68699
68699
|
try {
|
|
68700
|
-
await fs
|
|
68700
|
+
await fs.link(source.path, destPath);
|
|
68701
68701
|
moved = true;
|
|
68702
68702
|
} catch (error) {
|
|
68703
68703
|
const code = error.code;
|
|
@@ -68705,7 +68705,7 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
68705
68705
|
const existing = await identityOf(destPath);
|
|
68706
68706
|
if (existing && existing.fingerprint === expectedIdentity.fingerprint) {
|
|
68707
68707
|
moved = true;
|
|
68708
|
-
const [sourceStat, destStat] = await Promise.all([fs
|
|
68708
|
+
const [sourceStat, destStat] = await Promise.all([fs.stat(source.path), fs.stat(destPath)]);
|
|
68709
68709
|
independentArchive = sourceStat.dev !== destStat.dev || sourceStat.ino !== destStat.ino;
|
|
68710
68710
|
} else return {
|
|
68711
68711
|
moved: false,
|
|
@@ -68726,13 +68726,13 @@ async function archiveLegacySourceTo(source, dest, archiveRoot, expected) {
|
|
|
68726
68726
|
};
|
|
68727
68727
|
const outcome = await moveInto(dest);
|
|
68728
68728
|
if (outcome.divergent) throw new Error(`legacy archive destination exists with different content: ${dest}`);
|
|
68729
|
-
await fs
|
|
68729
|
+
await fs.chmod(dest, 384);
|
|
68730
68730
|
if (!await destInodeVerified(dest)) {
|
|
68731
68731
|
const archived = await identityOf(dest);
|
|
68732
68732
|
if (!archived || archived.fingerprint !== expectedIdentity.fingerprint) throw new Error(`legacy archive verification failed: ${dest}`);
|
|
68733
68733
|
}
|
|
68734
68734
|
if (outcome.moved) if (outcome.independentArchive) await unlinkSourceIfUnchanged(source.path, expectedIdentity);
|
|
68735
|
-
else await fs
|
|
68735
|
+
else await fs.unlink(source.path);
|
|
68736
68736
|
return dest;
|
|
68737
68737
|
}
|
|
68738
68738
|
/**
|
|
@@ -68746,12 +68746,12 @@ async function unlinkSourceIfUnchanged(sourcePath, expected) {
|
|
|
68746
68746
|
const current = await sourceIdentity(sourcePath);
|
|
68747
68747
|
if (!current) return;
|
|
68748
68748
|
if (current.fingerprint !== expected.fingerprint) throw new Error(`legacy source changed before removal; failing closed: ${sourcePath}`);
|
|
68749
|
-
await fs
|
|
68749
|
+
await fs.unlink(sourcePath);
|
|
68750
68750
|
}
|
|
68751
68751
|
async function chmodDirs(dir, stopAt) {
|
|
68752
68752
|
let current = dir;
|
|
68753
68753
|
while (current.startsWith(stopAt) && current !== stopAt) {
|
|
68754
|
-
await fs
|
|
68754
|
+
await fs.chmod(current, 448).catch(() => void 0);
|
|
68755
68755
|
const parent = path.dirname(current);
|
|
68756
68756
|
if (parent === current) return;
|
|
68757
68757
|
current = parent;
|
|
@@ -68780,11 +68780,11 @@ async function purgeExpiredLegacyArchives(runtime, opts) {
|
|
|
68780
68780
|
log$25.warn("skipping legacy archive outside the archive root", { sourcePath: receipt.sourcePath });
|
|
68781
68781
|
continue;
|
|
68782
68782
|
}
|
|
68783
|
-
if (!await fs
|
|
68783
|
+
if (!await fs.stat(archivePath).then(() => true).catch((error) => {
|
|
68784
68784
|
if (error.code === "ENOENT") return false;
|
|
68785
68785
|
throw error;
|
|
68786
68786
|
})) continue;
|
|
68787
|
-
await fs
|
|
68787
|
+
await fs.rm(archivePath, { force: true });
|
|
68788
68788
|
purged += 1;
|
|
68789
68789
|
await pruneEmptyArchiveDirs(path.dirname(archivePath), archiveRoot);
|
|
68790
68790
|
}
|
|
@@ -68795,12 +68795,12 @@ async function pruneEmptyArchiveDirs(dir, stopAt) {
|
|
|
68795
68795
|
while (current.startsWith(stopAt + path.sep)) {
|
|
68796
68796
|
let entries;
|
|
68797
68797
|
try {
|
|
68798
|
-
entries = await fs
|
|
68798
|
+
entries = await fs.readdir(current);
|
|
68799
68799
|
} catch {
|
|
68800
68800
|
return;
|
|
68801
68801
|
}
|
|
68802
68802
|
if (entries.length > 0) return;
|
|
68803
|
-
await fs
|
|
68803
|
+
await fs.rmdir(current).catch(() => void 0);
|
|
68804
68804
|
current = path.dirname(current);
|
|
68805
68805
|
}
|
|
68806
68806
|
}
|
|
@@ -69083,7 +69083,7 @@ function byPath(a, b) {
|
|
|
69083
69083
|
}
|
|
69084
69084
|
function readDirents(dirPath) {
|
|
69085
69085
|
try {
|
|
69086
|
-
return
|
|
69086
|
+
return syncFs.readdirSync(dirPath, { withFileTypes: true });
|
|
69087
69087
|
} catch {
|
|
69088
69088
|
return [];
|
|
69089
69089
|
}
|
|
@@ -69096,7 +69096,7 @@ function isUnderQuarantine(rootDir, candidatePath) {
|
|
|
69096
69096
|
}
|
|
69097
69097
|
function statSource(filePath) {
|
|
69098
69098
|
try {
|
|
69099
|
-
const stats =
|
|
69099
|
+
const stats = syncFs.statSync(filePath);
|
|
69100
69100
|
if (!stats.isFile()) return;
|
|
69101
69101
|
return {
|
|
69102
69102
|
mtimeMs: stats.mtimeMs,
|
|
@@ -69287,12 +69287,12 @@ async function censusLegacySources(cfg, env) {
|
|
|
69287
69287
|
for (const agentDir of readDirents(agentsRoot).filter((entry) => entry.isDirectory()).toSorted((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
69288
69288
|
const agentId = normalizeAgentId(agentDir.name);
|
|
69289
69289
|
const sessionsDir = path.join(agentsRoot, agentDir.name, LEGACY_SESSIONS_DIR_NAME);
|
|
69290
|
-
if (
|
|
69290
|
+
if (syncFs.existsSync(sessionsDir)) censusAgentDir(sessionsDir, agentId);
|
|
69291
69291
|
}
|
|
69292
69292
|
const legacyRoot = path.join(stateDir, LEGACY_SESSIONS_DIR_NAME);
|
|
69293
|
-
if (
|
|
69293
|
+
if (syncFs.existsSync(legacyRoot)) censusAgentDir(legacyRoot, defaultAgent);
|
|
69294
69294
|
const recoveryDir = path.join(stateDir, RECOVERY_DIR_NAME);
|
|
69295
|
-
if (
|
|
69295
|
+
if (syncFs.existsSync(recoveryDir)) censusRecoveryTree(sources, recoveryDir);
|
|
69296
69296
|
return sources.values();
|
|
69297
69297
|
}
|
|
69298
69298
|
/**
|
|
@@ -69376,7 +69376,7 @@ async function admitDurableKeyMappings(registry, listKeys, opts) {
|
|
|
69376
69376
|
await opts?.clearMappingSourcePath?.(mapping.agentId, mapping.sessionId).catch(() => void 0);
|
|
69377
69377
|
continue;
|
|
69378
69378
|
}
|
|
69379
|
-
const stats = await fs
|
|
69379
|
+
const stats = await fs.stat(mapping.sourcePath).catch(() => void 0);
|
|
69380
69380
|
if (!stats?.isFile()) continue;
|
|
69381
69381
|
registry.admit({
|
|
69382
69382
|
path: mapping.sourcePath,
|
|
@@ -69576,7 +69576,7 @@ function createLegacySourceRegistry() {
|
|
|
69576
69576
|
if (!isSettledReceipt(receipt, source.sizeBytes)) trackPendingPath(key, source);
|
|
69577
69577
|
return;
|
|
69578
69578
|
}
|
|
69579
|
-
const stats = await fs
|
|
69579
|
+
const stats = await fs.stat(key).catch(() => void 0);
|
|
69580
69580
|
if (!stats?.isFile() && receipt.status !== "imported") return;
|
|
69581
69581
|
admit({
|
|
69582
69582
|
path: key,
|
|
@@ -69816,12 +69816,12 @@ function canonicalSqliteIdentityPathSync(sqlitePath) {
|
|
|
69816
69816
|
for (let hops = 0; hops < MAX_SYMLINK_HOPS; hops += 1) {
|
|
69817
69817
|
let stats;
|
|
69818
69818
|
try {
|
|
69819
|
-
stats =
|
|
69819
|
+
stats = syncFs.lstatSync(current);
|
|
69820
69820
|
} catch {
|
|
69821
69821
|
return canonicalPathSync(current);
|
|
69822
69822
|
}
|
|
69823
69823
|
if (!stats.isSymbolicLink()) return canonicalPathSync(current);
|
|
69824
|
-
current = path.resolve(canonicalPathSync(path.dirname(current)),
|
|
69824
|
+
current = path.resolve(canonicalPathSync(path.dirname(current)), syncFs.readlinkSync(current));
|
|
69825
69825
|
}
|
|
69826
69826
|
return canonicalPathSync(sqlitePath);
|
|
69827
69827
|
}
|
|
@@ -69835,12 +69835,12 @@ function sleep$1(ms) {
|
|
|
69835
69835
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
69836
69836
|
}
|
|
69837
69837
|
function acquireKernelOwnerLock(lock) {
|
|
69838
|
-
|
|
69838
|
+
syncFs.mkdirSync(path.dirname(lock.lockPath), {
|
|
69839
69839
|
recursive: true,
|
|
69840
69840
|
mode: 448
|
|
69841
69841
|
});
|
|
69842
69842
|
try {
|
|
69843
|
-
|
|
69843
|
+
syncFs.closeSync(syncFs.openSync(lock.lockPath, "wx", 384));
|
|
69844
69844
|
} catch (err) {
|
|
69845
69845
|
if (err.code !== "EEXIST") throw err;
|
|
69846
69846
|
}
|
|
@@ -69874,7 +69874,7 @@ function closeSqliteQuietly(db) {
|
|
|
69874
69874
|
function releaseKernelOwnerLock(lock, db, info) {
|
|
69875
69875
|
try {
|
|
69876
69876
|
const current = readHolderSidecar(lock.sidecarPath);
|
|
69877
|
-
if (current !== void 0 && current.pid === info.pid && current.startedAt === info.startedAt)
|
|
69877
|
+
if (current !== void 0 && current.pid === info.pid && current.startedAt === info.startedAt) syncFs.rmSync(lock.sidecarPath, { force: true });
|
|
69878
69878
|
} finally {
|
|
69879
69879
|
closeSqliteQuietly(db);
|
|
69880
69880
|
}
|
|
@@ -69882,17 +69882,17 @@ function releaseKernelOwnerLock(lock, db, info) {
|
|
|
69882
69882
|
function writeHolderSidecar(sidecarPath, info) {
|
|
69883
69883
|
const temp = `${sidecarPath}.${process.pid}.tmp`;
|
|
69884
69884
|
try {
|
|
69885
|
-
const fd =
|
|
69885
|
+
const fd = syncFs.openSync(temp, "w", 384);
|
|
69886
69886
|
try {
|
|
69887
|
-
|
|
69888
|
-
|
|
69887
|
+
syncFs.writeFileSync(fd, `${JSON.stringify(info)}\n`);
|
|
69888
|
+
syncFs.fsyncSync(fd);
|
|
69889
69889
|
} finally {
|
|
69890
|
-
|
|
69890
|
+
syncFs.closeSync(fd);
|
|
69891
69891
|
}
|
|
69892
|
-
|
|
69892
|
+
syncFs.renameSync(temp, sidecarPath);
|
|
69893
69893
|
} catch (err) {
|
|
69894
69894
|
try {
|
|
69895
|
-
|
|
69895
|
+
syncFs.rmSync(temp, { force: true });
|
|
69896
69896
|
} catch {}
|
|
69897
69897
|
throw err;
|
|
69898
69898
|
}
|
|
@@ -69917,7 +69917,7 @@ function parseHolderSidecar(raw) {
|
|
|
69917
69917
|
function readHolderSidecar(sidecarPath) {
|
|
69918
69918
|
let raw;
|
|
69919
69919
|
try {
|
|
69920
|
-
raw =
|
|
69920
|
+
raw = syncFs.readFileSync(sidecarPath, "utf8");
|
|
69921
69921
|
} catch {
|
|
69922
69922
|
return;
|
|
69923
69923
|
}
|
|
@@ -69928,7 +69928,7 @@ async function readHolderSidecarBriefly(sidecarPath, timeoutMs = 1e3) {
|
|
|
69928
69928
|
for (;;) {
|
|
69929
69929
|
let raw;
|
|
69930
69930
|
try {
|
|
69931
|
-
raw =
|
|
69931
|
+
raw = syncFs.readFileSync(sidecarPath, "utf8");
|
|
69932
69932
|
} catch {
|
|
69933
69933
|
raw = void 0;
|
|
69934
69934
|
}
|
|
@@ -70092,7 +70092,7 @@ async function claimExclusivePartial(destPath) {
|
|
|
70092
70092
|
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
70093
70093
|
const candidate = `${destPath}.${process.pid}.${randomBytes(8).toString("hex")}.partial`;
|
|
70094
70094
|
try {
|
|
70095
|
-
await (await fs
|
|
70095
|
+
await (await fs.open(candidate, "wx", 384)).close();
|
|
70096
70096
|
return candidate;
|
|
70097
70097
|
} catch (err) {
|
|
70098
70098
|
if (err.code !== "EEXIST") throw err;
|
|
@@ -70111,7 +70111,7 @@ async function backupSqliteSessionDatabase(params) {
|
|
|
70111
70111
|
const dbPath = path.resolve(params.dbPath);
|
|
70112
70112
|
const destPath = path.resolve(params.destPath);
|
|
70113
70113
|
for (const guarded of protectedLivePaths(dbPath)) if (sameFile$1(destPath, guarded)) throw new Error("backup destination must not be the live database or its owner lock, holder sidecar, or journal files");
|
|
70114
|
-
await fs
|
|
70114
|
+
await fs.mkdir(path.dirname(destPath), {
|
|
70115
70115
|
recursive: true,
|
|
70116
70116
|
mode: 448
|
|
70117
70117
|
});
|
|
@@ -70123,14 +70123,14 @@ async function backupSqliteSessionDatabase(params) {
|
|
|
70123
70123
|
gated: sqliteBackupTestHooks.holdWorkerAtGate === true,
|
|
70124
70124
|
writableSource: false
|
|
70125
70125
|
});
|
|
70126
|
-
await fs
|
|
70126
|
+
await fs.rename(partialPath, destPath);
|
|
70127
70127
|
} catch (err) {
|
|
70128
|
-
await fs
|
|
70128
|
+
await fs.rm(partialPath, { force: true }).catch(() => {});
|
|
70129
70129
|
throw err;
|
|
70130
70130
|
}
|
|
70131
70131
|
return {
|
|
70132
70132
|
path: destPath,
|
|
70133
|
-
bytes: (await fs
|
|
70133
|
+
bytes: (await fs.stat(destPath)).size
|
|
70134
70134
|
};
|
|
70135
70135
|
}
|
|
70136
70136
|
|
|
@@ -70152,7 +70152,7 @@ const INCARNATION_SELECT_SQL = "SELECT id FROM ctx_legacy_import_incarnation LIM
|
|
|
70152
70152
|
async function readDbIncarnationId(dbPath) {
|
|
70153
70153
|
let db;
|
|
70154
70154
|
try {
|
|
70155
|
-
await fs
|
|
70155
|
+
await fs.stat(dbPath);
|
|
70156
70156
|
db = new DatabaseSync(dbPath);
|
|
70157
70157
|
const row = db.prepare(INCARNATION_SELECT_SQL).get();
|
|
70158
70158
|
return typeof row?.id === "string" ? row.id : void 0;
|
|
@@ -70204,7 +70204,7 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
70204
70204
|
const marked = await readSnapshotMarker(backupsDir, canonicalDbPath);
|
|
70205
70205
|
if (marked) return marked;
|
|
70206
70206
|
if ((await params.listReceipts()).length > 0) return;
|
|
70207
|
-
await fs
|
|
70207
|
+
await fs.mkdir(backupsDir, {
|
|
70208
70208
|
recursive: true,
|
|
70209
70209
|
mode: 448
|
|
70210
70210
|
});
|
|
@@ -70215,7 +70215,7 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
70215
70215
|
dbPath,
|
|
70216
70216
|
destPath
|
|
70217
70217
|
});
|
|
70218
|
-
if (dbId !== void 0) await fs
|
|
70218
|
+
if (dbId !== void 0) await fs.writeFile(path.join(backupsDir, snapshotMarkerFile(canonicalDbPath)), `${JSON.stringify({
|
|
70219
70219
|
path: backup.path,
|
|
70220
70220
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
70221
70221
|
canonicalDbPath,
|
|
@@ -70233,17 +70233,17 @@ async function takePreImportLegacySnapshot(params) {
|
|
|
70233
70233
|
*/
|
|
70234
70234
|
async function cleanupPartialLegacyBackups(stateDir) {
|
|
70235
70235
|
const backupsDir = path.join(stateDir, "backups");
|
|
70236
|
-
const names = await fs
|
|
70236
|
+
const names = await fs.readdir(backupsDir).catch(() => []);
|
|
70237
70237
|
for (const name of names) {
|
|
70238
70238
|
if (!name.endsWith(".partial")) continue;
|
|
70239
|
-
await fs
|
|
70239
|
+
await fs.rm(path.join(backupsDir, name), { force: true }).catch(() => void 0);
|
|
70240
70240
|
}
|
|
70241
70241
|
}
|
|
70242
70242
|
async function readSnapshotMarker(backupsDir, canonicalDbPath) {
|
|
70243
70243
|
const currentIncarnationId = await readDbIncarnationId(canonicalDbPath);
|
|
70244
70244
|
const keyed = await readMarkerFile(path.join(backupsDir, snapshotMarkerFile(canonicalDbPath)), canonicalDbPath, currentIncarnationId);
|
|
70245
70245
|
if (keyed !== void 0) return keyed;
|
|
70246
|
-
const names = await fs
|
|
70246
|
+
const names = await fs.readdir(backupsDir).catch(() => []);
|
|
70247
70247
|
for (const name of names) {
|
|
70248
70248
|
if (!name.startsWith(SNAPSHOT_MARKER_PREFIX) || !name.endsWith(".json")) continue;
|
|
70249
70249
|
const found = await readMarkerFile(path.join(backupsDir, name), canonicalDbPath, currentIncarnationId);
|
|
@@ -70252,7 +70252,7 @@ async function readSnapshotMarker(backupsDir, canonicalDbPath) {
|
|
|
70252
70252
|
return readMarkerFile(path.join(backupsDir, SNAPSHOT_MARKER_FILE), canonicalDbPath, currentIncarnationId);
|
|
70253
70253
|
}
|
|
70254
70254
|
async function readMarkerFile(markerFile, canonicalDbPath, currentIncarnationId) {
|
|
70255
|
-
const raw = await fs
|
|
70255
|
+
const raw = await fs.readFile(markerFile, "utf8").catch(() => void 0);
|
|
70256
70256
|
if (!raw) return;
|
|
70257
70257
|
try {
|
|
70258
70258
|
const parsed = JSON.parse(raw);
|
|
@@ -70264,7 +70264,7 @@ async function readMarkerFile(markerFile, canonicalDbPath, currentIncarnationId)
|
|
|
70264
70264
|
if (currentIncarnationId !== void 0 && currentIncarnationId === markerId) return markerPath;
|
|
70265
70265
|
return;
|
|
70266
70266
|
}
|
|
70267
|
-
const [markerStat, dbStat] = await Promise.all([fs
|
|
70267
|
+
const [markerStat, dbStat] = await Promise.all([fs.stat(markerDbPath).catch(() => void 0), fs.stat(canonicalDbPath).catch(() => void 0)]);
|
|
70268
70268
|
if (markerStat !== void 0 && dbStat !== void 0 ? markerStat.dev === dbStat.dev && markerStat.ino === dbStat.ino : markerDbPath === canonicalDbPath) return markerPath;
|
|
70269
70269
|
}
|
|
70270
70270
|
} catch {}
|
|
@@ -70530,7 +70530,7 @@ const log$17 = createSubsystemLogger("config/sessions/legacy-import/index-import
|
|
|
70530
70530
|
async function readLegacyIndexStore(storePath) {
|
|
70531
70531
|
let raw;
|
|
70532
70532
|
try {
|
|
70533
|
-
raw = await fs
|
|
70533
|
+
raw = await fs.readFile(storePath, "utf8");
|
|
70534
70534
|
} catch (error) {
|
|
70535
70535
|
throw new Error(`legacy index source unreadable: ${storePath}`, { cause: error });
|
|
70536
70536
|
}
|
|
@@ -70769,7 +70769,7 @@ async function importLegacyIndex(runtime, source, opts = {}) {
|
|
|
70769
70769
|
actorExplicit: entry.actor !== void 0
|
|
70770
70770
|
}), opts.signal);
|
|
70771
70771
|
if (transcriptPath && opts.discoveredTranscripts && path.resolve(transcriptPath) !== path.resolve(source.path)) try {
|
|
70772
|
-
const stats = await fs
|
|
70772
|
+
const stats = await fs.stat(transcriptPath);
|
|
70773
70773
|
if (stats.isFile()) opts.discoveredTranscripts.push({
|
|
70774
70774
|
path: transcriptPath,
|
|
70775
70775
|
kind: "transcript",
|
|
@@ -70885,7 +70885,7 @@ async function loadSessionKeyOverrides(stateDir) {
|
|
|
70885
70885
|
const filePath = path.join(stateDir, "recovery", SESSION_KEY_OVERRIDES_FILENAME);
|
|
70886
70886
|
let raw;
|
|
70887
70887
|
try {
|
|
70888
|
-
raw = await fs
|
|
70888
|
+
raw = await fs.readFile(filePath, "utf8");
|
|
70889
70889
|
} catch (error) {
|
|
70890
70890
|
if (error.code !== "ENOENT") log$15.warn("session key overrides unreadable; ignoring", { error });
|
|
70891
70891
|
return /* @__PURE__ */ new Map();
|
|
@@ -72362,14 +72362,14 @@ function isGatewayArgv(args) {
|
|
|
72362
72362
|
}
|
|
72363
72363
|
function readLinuxCmdline(pid) {
|
|
72364
72364
|
try {
|
|
72365
|
-
return parseProcCmdline(
|
|
72365
|
+
return parseProcCmdline(syncFs.readFileSync(`/proc/${pid}/cmdline`, "utf8"));
|
|
72366
72366
|
} catch {
|
|
72367
72367
|
return null;
|
|
72368
72368
|
}
|
|
72369
72369
|
}
|
|
72370
72370
|
function readLinuxStartTime(pid) {
|
|
72371
72371
|
try {
|
|
72372
|
-
const raw =
|
|
72372
|
+
const raw = syncFs.readFileSync(`/proc/${pid}/stat`, "utf8").trim();
|
|
72373
72373
|
const closeParen = raw.lastIndexOf(")");
|
|
72374
72374
|
if (closeParen < 0) return null;
|
|
72375
72375
|
const fields = raw.slice(closeParen + 1).trim().split(/\s+/);
|
|
@@ -72423,7 +72423,7 @@ async function resolveGatewayOwnerStatus(pid, payload, platform, port) {
|
|
|
72423
72423
|
}
|
|
72424
72424
|
async function readLockPayload(lockPath) {
|
|
72425
72425
|
try {
|
|
72426
|
-
const raw = await fs
|
|
72426
|
+
const raw = await fs.readFile(lockPath, "utf8");
|
|
72427
72427
|
const parsed = JSON.parse(raw);
|
|
72428
72428
|
if (typeof parsed.pid !== "number") return null;
|
|
72429
72429
|
if (typeof parsed.createdAt !== "string") return null;
|
|
@@ -75356,7 +75356,7 @@ async function withMemoryManagerForAgent(params) {
|
|
|
75356
75356
|
}
|
|
75357
75357
|
async function checkReadableFile(pathname) {
|
|
75358
75358
|
try {
|
|
75359
|
-
await fs
|
|
75359
|
+
await fs.access(pathname, syncFs.constants.R_OK);
|
|
75360
75360
|
return { exists: true };
|
|
75361
75361
|
} catch (err) {
|
|
75362
75362
|
const code = err.code;
|
|
@@ -75391,7 +75391,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
75391
75391
|
if (alt.issue) issues.push(alt.issue);
|
|
75392
75392
|
const resolvedExtraPaths = normalizeExtraMemoryPaths(workspaceDir, extraPaths);
|
|
75393
75393
|
for (const extraPath of resolvedExtraPaths) try {
|
|
75394
|
-
if ((await fs
|
|
75394
|
+
if ((await fs.lstat(extraPath)).isSymbolicLink()) continue;
|
|
75395
75395
|
const extraCheck = await checkReadableFile(extraPath);
|
|
75396
75396
|
if (extraCheck.issue) issues.push(extraCheck.issue);
|
|
75397
75397
|
} catch (err) {
|
|
@@ -75401,7 +75401,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
75401
75401
|
}
|
|
75402
75402
|
let dirReadable = null;
|
|
75403
75403
|
try {
|
|
75404
|
-
await fs
|
|
75404
|
+
await fs.access(memoryDir, syncFs.constants.R_OK);
|
|
75405
75405
|
dirReadable = true;
|
|
75406
75406
|
} catch (err) {
|
|
75407
75407
|
const code = err.code;
|
|
@@ -75449,7 +75449,7 @@ async function summarizeQmdIndexArtifact(manager) {
|
|
|
75449
75449
|
if (!dbPath) return null;
|
|
75450
75450
|
let stat;
|
|
75451
75451
|
try {
|
|
75452
|
-
stat = await fs
|
|
75452
|
+
stat = await fs.stat(dbPath);
|
|
75453
75453
|
} catch (err) {
|
|
75454
75454
|
const code = err.code;
|
|
75455
75455
|
if (code === "ENOENT") throw new Error(`QMD index file not found: ${shortenHomePath(dbPath)}`, { cause: err });
|
|
@@ -75969,7 +75969,7 @@ function createPluginRuntime(options = {}) {
|
|
|
75969
75969
|
workStates: readTaskWorkStates
|
|
75970
75970
|
},
|
|
75971
75971
|
resolveLearningWorkspaceDir: (agentId) => resolveLearningWorkspaceDir(loadConfig(), agentId),
|
|
75972
|
-
sessions: { startUserRun: async (params) => (await import("./user-run-recording-
|
|
75972
|
+
sessions: { startUserRun: async (params) => (await import("./user-run-recording-DBqvoOPn.js").then((n) => n.n)).startUserSessionRun(params) }
|
|
75973
75973
|
};
|
|
75974
75974
|
Object.defineProperty(runtime, "analysis", {
|
|
75975
75975
|
enumerable: true,
|
|
@@ -75993,7 +75993,7 @@ const resolvePluginSdkAliasFile = (params) => {
|
|
|
75993
75993
|
const srcCandidate = path.join(cursor, "src", "plugin-sdk", params.srcFile);
|
|
75994
75994
|
const distCandidate = path.join(cursor, "dist", "plugin-sdk", params.distFile);
|
|
75995
75995
|
const orderedCandidates = isDistRuntime ? [distCandidate, srcCandidate] : isTest ? [distCandidate, srcCandidate] : [distCandidate];
|
|
75996
|
-
for (const candidate of orderedCandidates) if (
|
|
75996
|
+
for (const candidate of orderedCandidates) if (syncFs.existsSync(candidate)) return candidate;
|
|
75997
75997
|
const parent = path.dirname(cursor);
|
|
75998
75998
|
if (parent === cursor) break;
|
|
75999
75999
|
cursor = parent;
|
|
@@ -76549,7 +76549,7 @@ function loadOpenClawPlugins(options = {}) {
|
|
|
76549
76549
|
continue;
|
|
76550
76550
|
}
|
|
76551
76551
|
const safeSource = opened.path;
|
|
76552
|
-
|
|
76552
|
+
syncFs.closeSync(opened.fd);
|
|
76553
76553
|
let mod = null;
|
|
76554
76554
|
try {
|
|
76555
76555
|
mod = getJiti()(safeSource);
|
|
@@ -76717,7 +76717,7 @@ function loadOpenClawPlugins(options = {}) {
|
|
|
76717
76717
|
}
|
|
76718
76718
|
function safeRealpathOrResolve(value) {
|
|
76719
76719
|
try {
|
|
76720
|
-
return
|
|
76720
|
+
return syncFs.realpathSync(value);
|
|
76721
76721
|
} catch {
|
|
76722
76722
|
return path.resolve(value);
|
|
76723
76723
|
}
|
|
@@ -76875,7 +76875,7 @@ function resolvePluginWebSearchProviders(params) {
|
|
|
76875
76875
|
//#endregion
|
|
76876
76876
|
//#region src/agents/apply-patch-update.ts
|
|
76877
76877
|
async function defaultReadFile(filePath) {
|
|
76878
|
-
return fs
|
|
76878
|
+
return fs.readFile(filePath, "utf8");
|
|
76879
76879
|
}
|
|
76880
76880
|
async function applyUpdateHunk(filePath, chunks, options) {
|
|
76881
76881
|
const originalLines = (await (options?.readFile ?? defaultReadFile)(filePath).catch((err) => {
|
|
@@ -77196,7 +77196,7 @@ function resolvePatchFileOps(options) {
|
|
|
77196
77196
|
const workspaceOnly = options.workspaceOnly !== false;
|
|
77197
77197
|
return {
|
|
77198
77198
|
readFile: async (filePath) => {
|
|
77199
|
-
if (!workspaceOnly) return await fs
|
|
77199
|
+
if (!workspaceOnly) return await fs.readFile(filePath, "utf8");
|
|
77200
77200
|
const opened = await openBoundaryFile({
|
|
77201
77201
|
absolutePath: filePath,
|
|
77202
77202
|
rootPath: options.cwd,
|
|
@@ -77204,14 +77204,14 @@ function resolvePatchFileOps(options) {
|
|
|
77204
77204
|
});
|
|
77205
77205
|
assertBoundaryRead(opened, filePath);
|
|
77206
77206
|
try {
|
|
77207
|
-
return
|
|
77207
|
+
return syncFs.readFileSync(opened.fd, "utf8");
|
|
77208
77208
|
} finally {
|
|
77209
|
-
|
|
77209
|
+
syncFs.closeSync(opened.fd);
|
|
77210
77210
|
}
|
|
77211
77211
|
},
|
|
77212
77212
|
writeFile: async (filePath, content) => {
|
|
77213
77213
|
if (!workspaceOnly) {
|
|
77214
|
-
await fs
|
|
77214
|
+
await fs.writeFile(filePath, content, "utf8");
|
|
77215
77215
|
return;
|
|
77216
77216
|
}
|
|
77217
77217
|
const relative = toRelativeSandboxPath(options.cwd, filePath);
|
|
@@ -77222,8 +77222,8 @@ function resolvePatchFileOps(options) {
|
|
|
77222
77222
|
encoding: "utf8"
|
|
77223
77223
|
});
|
|
77224
77224
|
},
|
|
77225
|
-
remove: (filePath) => fs
|
|
77226
|
-
mkdirp: (dir) => fs
|
|
77225
|
+
remove: (filePath) => fs.rm(filePath),
|
|
77226
|
+
mkdirp: (dir) => fs.mkdir(dir, { recursive: true }).then(() => {})
|
|
77227
77227
|
};
|
|
77228
77228
|
}
|
|
77229
77229
|
async function ensureDir(filePath, ops) {
|
|
@@ -77502,7 +77502,7 @@ async function recordLoopOutcome(args) {
|
|
|
77502
77502
|
if (!args.ctx?.sessionKey) return;
|
|
77503
77503
|
try {
|
|
77504
77504
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Di8oqY0E.js").then((n) => n.n);
|
|
77505
|
-
const { recordToolCallOutcome } = await import("./tool-loop-detection-
|
|
77505
|
+
const { recordToolCallOutcome } = await import("./tool-loop-detection-9fAxiikd.js");
|
|
77506
77506
|
recordToolCallOutcome(getDiagnosticSessionState({
|
|
77507
77507
|
sessionKey: args.ctx.sessionKey,
|
|
77508
77508
|
sessionId: args.ctx?.agentId
|
|
@@ -77529,8 +77529,8 @@ async function runBeforeToolCallHook(args) {
|
|
|
77529
77529
|
const params = args.params;
|
|
77530
77530
|
if (args.ctx?.sessionKey) {
|
|
77531
77531
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Di8oqY0E.js").then((n) => n.n);
|
|
77532
|
-
const { logToolLoopAction } = await import("./diagnostic-
|
|
77533
|
-
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-
|
|
77532
|
+
const { logToolLoopAction } = await import("./diagnostic-DJ11ZJIJ.js").then((n) => n.n);
|
|
77533
|
+
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-9fAxiikd.js");
|
|
77534
77534
|
const sessionState = getDiagnosticSessionState({
|
|
77535
77535
|
sessionKey: args.ctx.sessionKey,
|
|
77536
77536
|
sessionId: args.ctx?.agentId
|
|
@@ -77872,10 +77872,10 @@ function createWorkspaceDeleteTool(params) {
|
|
|
77872
77872
|
containWithinHostRoot: root
|
|
77873
77873
|
}).catch(async (error) => {
|
|
77874
77874
|
if (String(error).includes("No such file or directory")) throw Object.assign(/* @__PURE__ */ new Error(`Sandbox FS error (ENOENT): ${display}`), { code: "ENOENT" });
|
|
77875
|
-
if (await fs
|
|
77875
|
+
if (await fs.lstat(contained.resolved).then((stats) => stats.isDirectory() ? stats : null, () => null)) throw Object.assign(/* @__PURE__ */ new Error(`Sandbox FS error (EISDIR): ${display}`), { code: "EISDIR" });
|
|
77876
77876
|
throw error;
|
|
77877
77877
|
});
|
|
77878
|
-
else await fs
|
|
77878
|
+
else await fs.unlink(contained.resolved);
|
|
77879
77879
|
return {
|
|
77880
77880
|
content: [{
|
|
77881
77881
|
type: "text",
|
|
@@ -78270,14 +78270,14 @@ function createSandboxEditOperations(params) {
|
|
|
78270
78270
|
}
|
|
78271
78271
|
async function writeHostFile(absolutePath, content) {
|
|
78272
78272
|
const resolved = path.resolve(absolutePath);
|
|
78273
|
-
await fs
|
|
78274
|
-
await fs
|
|
78273
|
+
await fs.mkdir(path.dirname(resolved), { recursive: true });
|
|
78274
|
+
await fs.writeFile(resolved, content, "utf-8");
|
|
78275
78275
|
}
|
|
78276
78276
|
function createHostWriteOperations(root, options) {
|
|
78277
78277
|
if (!(options?.workspaceOnly ?? false)) return {
|
|
78278
78278
|
mkdir: async (dir) => {
|
|
78279
78279
|
const resolved = path.resolve(dir);
|
|
78280
|
-
await fs
|
|
78280
|
+
await fs.mkdir(resolved, { recursive: true });
|
|
78281
78281
|
},
|
|
78282
78282
|
writeFile: writeHostFile
|
|
78283
78283
|
};
|
|
@@ -78290,7 +78290,7 @@ function createHostWriteOperations(root, options) {
|
|
|
78290
78290
|
cwd: root,
|
|
78291
78291
|
root
|
|
78292
78292
|
});
|
|
78293
|
-
await fs
|
|
78293
|
+
await fs.mkdir(resolved, { recursive: true });
|
|
78294
78294
|
},
|
|
78295
78295
|
writeFile: async (absolutePath, content) => {
|
|
78296
78296
|
await writeFileWithinRoot({
|
|
@@ -78306,12 +78306,12 @@ function createHostEditOperations(root, options) {
|
|
|
78306
78306
|
if (!(options?.workspaceOnly ?? false)) return {
|
|
78307
78307
|
readFile: async (absolutePath) => {
|
|
78308
78308
|
const resolved = path.resolve(absolutePath);
|
|
78309
|
-
return await fs
|
|
78309
|
+
return await fs.readFile(resolved);
|
|
78310
78310
|
},
|
|
78311
78311
|
writeFile: writeHostFile,
|
|
78312
78312
|
access: async (absolutePath) => {
|
|
78313
78313
|
const resolved = path.resolve(absolutePath);
|
|
78314
|
-
await fs
|
|
78314
|
+
await fs.access(resolved);
|
|
78315
78315
|
}
|
|
78316
78316
|
};
|
|
78317
78317
|
return {
|
|
@@ -79490,9 +79490,9 @@ async function readWorkspaceContextForSummary() {
|
|
|
79490
79490
|
if (!opened.ok) return "";
|
|
79491
79491
|
const sections = extractSections((() => {
|
|
79492
79492
|
try {
|
|
79493
|
-
return
|
|
79493
|
+
return syncFs.readFileSync(opened.fd, "utf-8");
|
|
79494
79494
|
} finally {
|
|
79495
|
-
|
|
79495
|
+
syncFs.closeSync(opened.fd);
|
|
79496
79496
|
}
|
|
79497
79497
|
})(), ["Session Startup", "Red Lines"]);
|
|
79498
79498
|
if (sections.length === 0) return "";
|
|
@@ -81125,14 +81125,14 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
81125
81125
|
if (!apiKeyInfo.apiKey) {
|
|
81126
81126
|
if (apiKeyInfo.mode !== "aws-sdk") throw new Error(`No API key resolved for provider "${model.provider}" (auth mode: ${apiKeyInfo.mode}).`);
|
|
81127
81127
|
} else if (model.provider === "github-copilot") {
|
|
81128
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
81128
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-C-29TbW-.js").then((n) => n.n);
|
|
81129
81129
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
81130
81130
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
81131
81131
|
} else authStorage.setRuntimeApiKey(model.provider, apiKeyInfo.apiKey);
|
|
81132
81132
|
} catch (err) {
|
|
81133
81133
|
return fail(describeUnknownError(err));
|
|
81134
81134
|
}
|
|
81135
|
-
await fs
|
|
81135
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
81136
81136
|
const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
|
|
81137
81137
|
const sandbox = await resolveSandboxContext({
|
|
81138
81138
|
config: params.config,
|
|
@@ -81141,7 +81141,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
81141
81141
|
workspaceLane: params.workspaceLane
|
|
81142
81142
|
});
|
|
81143
81143
|
const effectiveWorkspace = sandbox?.enabled ? sandbox.workspaceAccess === "rw" ? resolvedWorkspace : sandbox.workspaceDir : resolvedWorkspace;
|
|
81144
|
-
await fs
|
|
81144
|
+
await fs.mkdir(effectiveWorkspace, { recursive: true });
|
|
81145
81145
|
let restoreSkillEnv;
|
|
81146
81146
|
const releaseWorkspaceCwd = acquireWorkspaceCwd(effectiveWorkspace);
|
|
81147
81147
|
try {
|
|
@@ -82377,7 +82377,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
82377
82377
|
* Throws if the connection is not open.
|
|
82378
82378
|
*/
|
|
82379
82379
|
send(event) {
|
|
82380
|
-
if (!this.ws || this.ws.readyState !== WebSocket
|
|
82380
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error(`OpenAIWebSocketManager: cannot send — connection is not open (readyState=${this.ws?.readyState ?? "no socket"})`);
|
|
82381
82381
|
this.ws.send(JSON.stringify(event));
|
|
82382
82382
|
}
|
|
82383
82383
|
/**
|
|
@@ -82394,7 +82394,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
82394
82394
|
* Returns true if the WebSocket is currently open and ready to send.
|
|
82395
82395
|
*/
|
|
82396
82396
|
isConnected() {
|
|
82397
|
-
return this.ws !== null && this.ws.readyState === WebSocket
|
|
82397
|
+
return this.ws !== null && this.ws.readyState === WebSocket.OPEN;
|
|
82398
82398
|
}
|
|
82399
82399
|
/**
|
|
82400
82400
|
* Permanently closes the WebSocket connection and disables auto-reconnect.
|
|
@@ -82404,7 +82404,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
82404
82404
|
this._cancelRetryTimer();
|
|
82405
82405
|
if (this.ws) {
|
|
82406
82406
|
this.ws.removeAllListeners();
|
|
82407
|
-
if (this.ws.readyState === WebSocket
|
|
82407
|
+
if (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING) this.ws.close(1e3, "Client closed");
|
|
82408
82408
|
this.ws = null;
|
|
82409
82409
|
}
|
|
82410
82410
|
}
|
|
@@ -82414,7 +82414,7 @@ var OpenAIWebSocketManager = class extends EventEmitter {
|
|
|
82414
82414
|
reject(/* @__PURE__ */ new Error("OpenAIWebSocketManager: apiKey is required before connecting."));
|
|
82415
82415
|
return;
|
|
82416
82416
|
}
|
|
82417
|
-
const socket = new WebSocket
|
|
82417
|
+
const socket = new WebSocket(this.wsUrl, { headers: {
|
|
82418
82418
|
Authorization: `Bearer ${this.apiKey}`,
|
|
82419
82419
|
"OpenAI-Beta": "responses-websocket=v1"
|
|
82420
82420
|
} });
|
|
@@ -88666,7 +88666,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
88666
88666
|
let embeddedAttemptBegun = false;
|
|
88667
88667
|
const runAbortController = new AbortController();
|
|
88668
88668
|
log$51.debug(`embedded run start: runId=${params.runId} sessionId=${params.sessionId} provider=${params.provider} model=${params.modelId} thinking=${params.thinkLevel} messageChannel=${params.messageChannel ?? params.messageProvider ?? "unknown"}`);
|
|
88669
|
-
await fs
|
|
88669
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
88670
88670
|
const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
|
|
88671
88671
|
const toolSessionKey = params.toolSessionKey?.trim() || sandboxSessionKey;
|
|
88672
88672
|
const sandbox = params.skipSandbox ? null : await resolveSandboxContext({
|
|
@@ -88676,7 +88676,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
88676
88676
|
workspaceLane: params.workspaceLane
|
|
88677
88677
|
});
|
|
88678
88678
|
const effectiveWorkspace = sandbox?.enabled ? sandbox.workspaceAccess === "rw" ? resolvedWorkspace : sandbox.workspaceDir : resolvedWorkspace;
|
|
88679
|
-
await fs
|
|
88679
|
+
await fs.mkdir(effectiveWorkspace, { recursive: true });
|
|
88680
88680
|
let restoreSkillEnv;
|
|
88681
88681
|
const releaseWorkspaceCwd = params.skipCwdChange ? void 0 : acquireWorkspaceCwd(effectiveWorkspace);
|
|
88682
88682
|
const rawToolResultStash = openRawToolResultStash(params.sessionId);
|
|
@@ -89571,7 +89571,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
89571
89571
|
await copilotTokenState.refreshInFlight;
|
|
89572
89572
|
return;
|
|
89573
89573
|
}
|
|
89574
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
89574
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-C-29TbW-.js").then((n) => n.n);
|
|
89575
89575
|
copilotTokenState.refreshInFlight = (async () => {
|
|
89576
89576
|
const githubToken = copilotTokenState.githubToken.trim();
|
|
89577
89577
|
if (!githubToken) throw new Error("Copilot refresh requires a GitHub token.");
|
|
@@ -89663,7 +89663,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
89663
89663
|
return;
|
|
89664
89664
|
}
|
|
89665
89665
|
if (model.provider === "github-copilot") {
|
|
89666
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
89666
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-C-29TbW-.js").then((n) => n.n);
|
|
89667
89667
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
89668
89668
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
89669
89669
|
if (copilotTokenState) {
|
|
@@ -89787,7 +89787,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
89787
89787
|
const copilotAuthRetry = authRetryPending;
|
|
89788
89788
|
authRetryPending = false;
|
|
89789
89789
|
attemptedThinking.add(thinkLevel);
|
|
89790
|
-
await fs
|
|
89790
|
+
await fs.mkdir(resolvedWorkspace, { recursive: true });
|
|
89791
89791
|
const prompt = provider === "anthropic" ? scrubAnthropicRefusalMagic(params.prompt) : params.prompt;
|
|
89792
89792
|
const attempt = await runEmbeddedAttempt({
|
|
89793
89793
|
sessionId: params.sessionId,
|