activeclaw 2026.2.12 → 2026.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/{accounts-DbzMEfKN.js → accounts-DCDeFTra.js} +2 -2
  3. package/dist/{accounts-DimKrt7j.js → accounts-DeqIQjo1.js} +2 -2
  4. package/dist/{acp-cli-Cs1ai4XO.js → acp-cli-CeYI4XRd.js} +15 -16
  5. package/dist/{acp-cli-oV2dodPg.js → acp-cli-rNbGXICg.js} +14 -15
  6. package/dist/{agent-BndgzkUe.js → agent-BvNJF5QL.js} +19 -16
  7. package/dist/{agent-DZvDwqnd.js → agent-CyMxTyrG.js} +20 -17
  8. package/dist/{agent-scope-rXQ7WARN.js → agent-scope-BIEhVP4_.js} +1 -1
  9. package/dist/{agent-scope---6LLHj0.js → agent-scope-CQCus0rI.js} +2 -2
  10. package/dist/{agent-scope-RCSw6gHy.js → agent-scope-CsRbLH4l.js} +3 -3
  11. package/dist/{agent-scope-CN8DM4Xb.js → agent-scope-DPIFau3f.js} +1 -1
  12. package/dist/{audio-preflight-SZRntkxo.js → audio-preflight-BU8W7uxc.js} +10 -10
  13. package/dist/{audio-preflight-ClVNINDs.js → audio-preflight-CGsumMzb.js} +10 -10
  14. package/dist/{audio-preflight-txAP3v-C.js → audio-preflight-SLmkJI6-.js} +22 -22
  15. package/dist/{audio-preflight-BP6s-UPp.js → audio-preflight-jZc5mFCZ.js} +23 -23
  16. package/dist/{audit-CQzrm61N.js → audit-Dmww_503.js} +70 -18
  17. package/dist/{audit-DMH3CSXY.js → audit-wPu26VMb.js} +72 -20
  18. package/dist/{tailscale-DU6DgqVy.js → auth-9x3lqfIY.js} +208 -3
  19. package/dist/{tailscale-DHfcfRCx.js → auth-CQNl_IaI.js} +190 -3
  20. package/dist/{auth-health-BB3e3OmN.js → auth-health-C4L4FGBA.js} +1 -1
  21. package/dist/{auth-health-zZ9dnQGC.js → auth-health-j6epgQbq.js} +1 -1
  22. package/dist/{auth-profiles-CcJ3hrog.js → auth-profiles-ByNs3eEm.js} +60 -22
  23. package/dist/build-info.json +3 -3
  24. package/dist/bundled/boot-md/handler.js +19 -16
  25. package/dist/bundled/session-memory/handler.js +16 -15
  26. package/dist/{call-Yxns4CVq.js → call-DVYCIV8m.js} +5 -5
  27. package/dist/{call-C9az806y.js → call-SolyGS1r.js} +4 -4
  28. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  29. package/dist/{channel-options-CjXPwMWu.js → channel-options-BwC2yQcR.js} +4 -4
  30. package/dist/{channel-options-CX4iYQfR.js → channel-options-Cq9BVDkP.js} +7 -7
  31. package/dist/{channel-selection-BoQ7GurB.js → channel-selection-D4D6ImhN.js} +2 -2
  32. package/dist/{channel-selection-C78IwbD-.js → channel-selection-MZAHm4U8.js} +2 -2
  33. package/dist/{channels-cli-DUHsmX3q.js → channels-cli-9Dsk9Qm7.js} +53 -51
  34. package/dist/{channels-cli-BXMQPB4x.js → channels-cli-BJUppQll.js} +52 -50
  35. package/dist/{channels-status-issues-Ca9--azp.js → channels-status-issues-D7GSV1GS.js} +1 -1
  36. package/dist/{channels-status-issues-CbULFg2X.js → channels-status-issues-DDAWeT-6.js} +1 -1
  37. package/dist/{chrome-svgmQ8T_.js → chrome-BfB6JdKF.js} +2 -1
  38. package/dist/{chrome-juQxt0zf.js → chrome-Cvr-57lg.js} +4 -3
  39. package/dist/{chrome-BCPPeLQ6.js → chrome-DL0avO8n.js} +2 -1
  40. package/dist/{chrome-yIKmOzCO.js → chrome-foEwx3lN.js} +5 -4
  41. package/dist/{clack-prompter-Dmvcu3gn.js → clack-prompter-Bz3Mmcl-.js} +5 -5
  42. package/dist/{clack-prompter-DuBVnTKy.js → clack-prompter-ChCGXfyt.js} +4 -4
  43. package/dist/cli/daemon-cli.js +1 -1
  44. package/dist/{cli-FdxAcu_y.js → cli-ZR9ugUBX.js} +42 -40
  45. package/dist/{cli-By331Q9f.js → cli-miPe4Ujz.js} +42 -40
  46. package/dist/{client-B0_GiCjB.js → client-BrYfyoDK.js} +52 -3
  47. package/dist/{client-D7wrC1Ug.js → client-CTwXnRl7.js} +53 -4
  48. package/dist/{command-format-ayFsmwwz.js → command-format-Bxe0mWee.js} +1 -1
  49. package/dist/{command-options-BSDiKuyX.js → command-options-BvgxzPbK.js} +4 -4
  50. package/dist/{commands-BG25qku5.js → commands-BX_OIIVR.js} +4 -4
  51. package/dist/{completion-cli-C4zxjkC1.js → completion-cli-CR77-jyv.js} +3 -3
  52. package/dist/{completion-cli-DECEgBWR.js → completion-cli-DnjpxAag.js} +29 -29
  53. package/dist/{config-B7sno9eI.js → config-Bdhomfei.js} +15 -6
  54. package/dist/{config-BuF7vm-v.js → config-BvMsmctM.js} +13 -4
  55. package/dist/{config-D50SQVar.js → config-QYrbd7x7.js} +13 -4
  56. package/dist/{config-DH9TLUNc.js → config-aFQssWKX.js} +15 -6
  57. package/dist/{config-guard-DPxxY1iw.js → config-guard-CljaSxJd.js} +39 -39
  58. package/dist/{configure-BZQ9uSVX.js → configure-BXLiucXo.js} +19 -19
  59. package/dist/{configure-Cg5IKSUy.js → configure-BYPqXzGZ.js} +19 -19
  60. package/dist/control-auth-8Cf4WXpR.js +54 -0
  61. package/dist/control-auth-DBCu3qyv.js +54 -0
  62. package/dist/{control-service-CBlMVTRu.js → control-service-B5KnPqGP.js} +11 -5
  63. package/dist/{control-service-B2er20Ke.js → control-service-DKnttEus.js} +10 -4
  64. package/dist/{cron-cli-B2Zwhy_r.js → cron-cli-D7BRjDv2.js} +17 -17
  65. package/dist/{cron-cli-EaRUVd0p.js → cron-cli-z1zk_FXQ.js} +16 -16
  66. package/dist/{daemon-cli-CVNzObIF.js → daemon-cli-BDkU2ocb.js} +18 -18
  67. package/dist/{daemon-cli-DF6Rxjy6.js → daemon-cli-cNSF93-v.js} +19 -19
  68. package/dist/{daemon-runtime-BHF5NjQ7.js → daemon-runtime-B0tg_LsX.js} +2 -2
  69. package/dist/{daemon-runtime-B05PME1z.js → daemon-runtime-Bsjeut6m.js} +3 -3
  70. package/dist/{deliver-DzcxEcza.js → deliver-CIU9Npgs.js} +306 -12
  71. package/dist/{deliver-COf5XFo_.js → deliver-DYYCo1G7.js} +302 -8
  72. package/dist/{deliver-B1jsU2r7.js → deliver-LsxKETro.js} +306 -12
  73. package/dist/{deliver-CLwC284e.js → deliver-xUU3mGHo.js} +302 -8
  74. package/dist/{deps-Cva7QM_t.js → deps-QSwGcoNZ.js} +2 -2
  75. package/dist/{deps-B6602Wid.js → deps-lAAA2zYI.js} +2 -2
  76. package/dist/{devices-cli-DPg_4aW8.js → devices-cli-BG3-2oqt.js} +13 -13
  77. package/dist/{devices-cli-D8K3hZR5.js → devices-cli-VIQtOvt_.js} +13 -13
  78. package/dist/{directory-cli-OGBSVKAZ.js → directory-cli-BCJwjVC0.js} +15 -15
  79. package/dist/{directory-cli-Bn47fFX7.js → directory-cli-jYzZ02gk.js} +14 -14
  80. package/dist/{dispatcher-BHsNwFe-.js → dispatcher-DY51b-Zc.js} +2 -2
  81. package/dist/{dns-cli-DmTHXgwU.js → dns-cli-DHIiMJjS.js} +11 -11
  82. package/dist/{dns-cli-kk2rysJh.js → dns-cli-pZlv87Ib.js} +11 -11
  83. package/dist/{docs-cli-CB77CeM4.js → docs-cli-2JDiwfzP.js} +7 -7
  84. package/dist/{docs-cli-DUcyw0X0.js → docs-cli-BhkYqoIQ.js} +6 -6
  85. package/dist/{doctor-DwqdkfPa.js → doctor-Bf8EhNtA.js} +33 -33
  86. package/dist/{doctor-BZfxDGUg.js → doctor-sYG5V4Co.js} +32 -32
  87. package/dist/entry.js +36 -14
  88. package/dist/{env-DE9xvYOL.js → env-ONzUVAG2.js} +1 -1
  89. package/dist/{exec-4WHuOniw.js → exec-B8lXct-k.js} +31 -13
  90. package/dist/{exec-B8JKbXKW.js → exec-CACT5OAW.js} +1 -1
  91. package/dist/{exec-D12IZYtJ.js → exec-CJFFoM7H.js} +31 -13
  92. package/dist/{exec-DXtR2fhb.js → exec-YIosokWE.js} +1 -1
  93. package/dist/{exec-approvals-cli-GizapOX5.js → exec-approvals-cli-7LH0lwhO.js} +19 -19
  94. package/dist/{exec-approvals-cli-BWO0Rs-a.js → exec-approvals-cli-apGnQbpj.js} +19 -19
  95. package/dist/extensionAPI.js +1108 -661
  96. package/dist/{fetch-CqZP8jwB.js → fetch-DmiOpALK.js} +5 -3
  97. package/dist/{fetch-timeout-B2KlHXi3.js → fetch-timeout-BEtUjM1S.js} +5 -3
  98. package/dist/{fetch-timeout-ohY5QmsW.js → fetch-timeout-DEoXG_SF.js} +5 -3
  99. package/dist/{fetch-timeout-4UKsdtE1.js → fetch-timeout-DTK9vxex.js} +5 -3
  100. package/dist/{gateway-cli-Bbd1Xbsc.js → gateway-cli-DUdYxlZS.js} +315 -103
  101. package/dist/{gateway-cli-PR1S0BTe.js → gateway-cli-DbvWmE-9.js} +314 -102
  102. package/dist/{gateway-rpc-8gue7Qjt.js → gateway-rpc-BByb2Snz.js} +3 -3
  103. package/dist/{gateway-rpc-DjuxyOm-.js → gateway-rpc-wXSCUZXj.js} +3 -3
  104. package/dist/{github-copilot-auth-B3chCDfc.js → github-copilot-auth-D7ewvpMd.js} +16 -8
  105. package/dist/{github-copilot-auth-Cm2SB8Qf.js → github-copilot-auth-DDispnyz.js} +16 -8
  106. package/dist/{github-copilot-token-SLWintYd.js → github-copilot-token-Cfs0Wxr8.js} +1 -1
  107. package/dist/{gmail-setup-utils-Cgh0ptgA.js → gmail-setup-utils-Cfns8TQx.js} +3 -3
  108. package/dist/{gmail-setup-utils-WDyf1gTU.js → gmail-setup-utils-DJb-_5kO.js} +4 -4
  109. package/dist/{health-format-C0C_Apce.js → health-format-KGPokKJH.js} +68 -28
  110. package/dist/{health-format-gLMfE2wf.js → health-format-LZDxu3rv.js} +67 -27
  111. package/dist/{help-format-5iAL_46a.js → help-format-C48TXngO.js} +1 -1
  112. package/dist/{help-format-DUy1KRxq.js → help-format-R5fLToDw.js} +1 -1
  113. package/dist/{hooks-cli-CEN1h1ya.js → hooks-cli-CT8JCRkH.js} +46 -44
  114. package/dist/{hooks-cli-DrchIqSi.js → hooks-cli-S1MKumJO.js} +47 -45
  115. package/dist/{hooks-status-Cgy6AtQk.js → hooks-status-Cw0xD8Lt.js} +3 -3
  116. package/dist/{hooks-status--xVLpAXz.js → hooks-status-D9MhwHRp.js} +3 -3
  117. package/dist/{image-Dkawt9Kg.js → image-Brk1sJbw.js} +4 -4
  118. package/dist/{image-DI9s9eEx.js → image-C4Nn2p3e.js} +5 -5
  119. package/dist/{image-LxFvu0wL.js → image-DgtfXMcX.js} +5 -5
  120. package/dist/{image-B4mDPdyz.js → image-RKwc3fsL.js} +4 -4
  121. package/dist/index.js +83 -83
  122. package/dist/{installs-NS0VMPN7.js → installs-CrLcWYHe.js} +4 -4
  123. package/dist/{installs-DA-eSN1B.js → installs-DscWb9b9.js} +5 -5
  124. package/dist/{links-CV4oki2u.js → links-B8LAzWwg.js} +1 -1
  125. package/dist/{links-7M-j83As.js → links-Eax1UO3w.js} +1 -1
  126. package/dist/llm-slug-generator.js +15 -15
  127. package/dist/{loader-Caow9TPA.js → loader-KjT074JR.js} +1105 -762
  128. package/dist/{logging-CeHn2itV.js → logging-BAyPwvdH.js} +1 -1
  129. package/dist/{logging-D0MyqUlV.js → logging-CRq4h04P.js} +2 -2
  130. package/dist/{login-qr-Xx8yJrSc.js → login-qr-B6ZgAuIf.js} +5 -5
  131. package/dist/{login-qr-CoskdtvN.js → login-qr-Bua-p0nG.js} +2 -2
  132. package/dist/{login-qr-CAk9D-FM.js → login-qr-CuvemJj4.js} +6 -6
  133. package/dist/{login-qr-kUyMWXV1.js → login-qr-Djr1JfIf.js} +2 -2
  134. package/dist/{logs-cli-B476pzJS.js → logs-cli-9IAV7rWY.js} +15 -15
  135. package/dist/{logs-cli-BQRUI_PO.js → logs-cli-EiKzUFPa.js} +14 -14
  136. package/dist/{manager-CBApH7eR.js → manager-BIMh_eSm.js} +5 -5
  137. package/dist/{manager-CyJH6WMg.js → manager-CwinWQoz.js} +5 -5
  138. package/dist/{manager-DScY_ZTT.js → manager-DkqF1GiK.js} +7 -7
  139. package/dist/{manager-DseK7RWj.js → manager-T1XfGchB.js} +8 -8
  140. package/dist/{manifest-registry-DFckk-L8.js → manifest-registry-CQhdnDBZ.js} +2 -2
  141. package/dist/{manifest-registry-BTgLN_W2.js → manifest-registry-u0okVSkU.js} +2 -2
  142. package/dist/{message-channel-0717wOz-.js → message-channel-BLi2a6Yw.js} +1 -1
  143. package/dist/{message-channel-BlgPSDAh.js → message-channel-C_MmebBt.js} +1 -1
  144. package/dist/{model-auth-CbqRVYRp.js → model-auth-CabXIF6O.js} +57 -19
  145. package/dist/{model-selection-unMJyUIE.js → model-selection-BLuqsGVB.js} +59 -21
  146. package/dist/{model-selection-B9Y7dKQd.js → model-selection-C1GmkTAV.js} +57 -19
  147. package/dist/{models-cli-B1cLGcRz.js → models-cli-9jmDv-h3.js} +50 -48
  148. package/dist/{models-cli-D7sChCi6.js → models-cli-zS9rtWz8.js} +48 -46
  149. package/dist/{node-cli-ic2C1xs2.js → node-cli-CrpTxTTs.js} +26 -24
  150. package/dist/{node-cli-CS3KwBh1.js → node-cli-wemUMCg-.js} +25 -23
  151. package/dist/{node-service-D_Cdq1JI.js → node-service-C8DTHTMg.js} +2 -2
  152. package/dist/{node-service-_vgO5xR-.js → node-service-WQuEKz6W.js} +1 -1
  153. package/dist/{nodes-cli-CipcvVMc.js → nodes-cli-BaU2SIFw.js} +16 -16
  154. package/dist/{nodes-cli-B1meaW7S.js → nodes-cli-Dx23D72n.js} +16 -16
  155. package/dist/{nodes-screen-N-4_0VIu.js → nodes-screen-C0IuBqUL.js} +1 -1
  156. package/dist/{note-CAM9PbSJ.js → note-BhRSeNeu.js} +2 -2
  157. package/dist/{note-Ci08TSbV.js → note-hhtubr2j.js} +1 -1
  158. package/dist/{onboard-channels-DMcOT0dj.js → onboard-channels-C501x8GI.js} +8 -8
  159. package/dist/{onboard-channels-CsT3E4bT.js → onboard-channels-Dxzroasd.js} +8 -8
  160. package/dist/{onboard-skills-DoxkpnEU.js → onboard-skills-DV0Qzvjj.js} +19 -19
  161. package/dist/{onboard-skills-D-BrCoRN.js → onboard-skills-rlBHcu3Q.js} +18 -18
  162. package/dist/{onboarding-B92952fz.js → onboarding-CN-EDLjd.js} +34 -34
  163. package/dist/{pairing-cli-BDUJ5VoX.js → pairing-cli-CDHG4xuI.js} +15 -15
  164. package/dist/{pairing-cli-0wbU1u8d.js → pairing-cli-CQP34Dlx.js} +14 -14
  165. package/dist/{pairing-labels-3o3QO3Qn.js → pairing-labels-B6CN0SNH.js} +1 -1
  166. package/dist/{pairing-labels-Bin1K7_f.js → pairing-labels-CgNHnjzT.js} +1 -1
  167. package/dist/{pairing-store-CL4rJ7m7.js → pairing-store-CmlRVqOz.js} +2 -2
  168. package/dist/{pairing-store-fIWI3pXG.js → pairing-store-Dp5_JGnG.js} +3 -3
  169. package/dist/{path-env-CXWUFfFv.js → path-env-CLvYNwtL.js} +1 -1
  170. package/dist/{path-env-C5FR_Eay.js → path-env-CaYUVIML.js} +2 -2
  171. package/dist/{paths-DwKNqk_S.js → paths-B0a4ywSO.js} +30 -5
  172. package/dist/{paths-RITJT4UY.js → paths-B49s6UZQ.js} +30 -5
  173. package/dist/{paths-CB2fqqbX.js → paths-D0O87MfH.js} +30 -5
  174. package/dist/{paths-IivnSNkP.js → paths-DLINmNFQ.js} +31 -6
  175. package/dist/{pi-embedded-DhYItk8O.js → pi-embedded-Ctrt2kz0.js} +1109 -662
  176. package/dist/{pi-embedded-helpers-CmftU5Zj.js → pi-embedded-helpers-CMKLjW6X.js} +8 -5
  177. package/dist/{pi-embedded-helpers-CfXnSIFx.js → pi-embedded-helpers-CUzTc1v6.js} +170 -19
  178. package/dist/{pi-embedded-helpers-Uan-3N1T.js → pi-embedded-helpers-DfwkwPYD.js} +7 -4
  179. package/dist/{pi-embedded-helpers-Bri9tk9g.js → pi-embedded-helpers-WDwx99UA.js} +170 -19
  180. package/dist/{pi-tools.policy-CJFi1sny.js → pi-tools.policy-BpsROZbz.js} +4 -4
  181. package/dist/{plugin-auto-enable-BY4CqJbD.js → plugin-auto-enable-Bqhc3w5n.js} +5 -5
  182. package/dist/{plugin-auto-enable-DbQrtQjL.js → plugin-auto-enable-PW76g_PJ.js} +5 -5
  183. package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +2 -0
  184. package/dist/plugin-sdk/agents/pi-embedded-runner/run/types.d.ts +2 -0
  185. package/dist/plugin-sdk/agents/pi-embedded-runner/types.d.ts +15 -0
  186. package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.tools.d.ts +1 -1
  187. package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.types.d.ts +2 -0
  188. package/dist/plugin-sdk/agents/pi-embedded-subscribe.types.d.ts +2 -0
  189. package/dist/plugin-sdk/agents/session-tool-result-guard-wrapper.d.ts +2 -0
  190. package/dist/plugin-sdk/agents/session-tool-result-guard.d.ts +4 -0
  191. package/dist/plugin-sdk/agents/tools/agent-step.d.ts +3 -0
  192. package/dist/plugin-sdk/agents/usage.d.ts +1 -0
  193. package/dist/plugin-sdk/auto-reply/reply/reply-reference.d.ts +1 -1
  194. package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +11 -0
  195. package/dist/plugin-sdk/auto-reply/reply/session-usage.d.ts +8 -0
  196. package/dist/plugin-sdk/browser/control-auth.d.ts +13 -0
  197. package/dist/plugin-sdk/channels/plugins/onboarding/signal.d.ts +1 -0
  198. package/dist/plugin-sdk/cli/prompt.d.ts +1 -0
  199. package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
  200. package/dist/plugin-sdk/config/sessions/paths.d.ts +7 -2
  201. package/dist/plugin-sdk/config/types.agents.d.ts +2 -0
  202. package/dist/plugin-sdk/config/types.discord.d.ts +5 -0
  203. package/dist/plugin-sdk/config/types.gateway.d.ts +15 -0
  204. package/dist/plugin-sdk/config/types.hooks.d.ts +15 -0
  205. package/dist/plugin-sdk/config/zod-schema.agents.d.ts +1 -0
  206. package/dist/plugin-sdk/config/zod-schema.d.ts +11 -0
  207. package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +9 -0
  208. package/dist/plugin-sdk/config/zod-schema.providers.d.ts +4 -0
  209. package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +15 -0
  210. package/dist/plugin-sdk/discord/send.types.d.ts +3 -0
  211. package/dist/plugin-sdk/gateway/auth.d.ts +36 -0
  212. package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +6 -0
  213. package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +3 -1
  214. package/dist/plugin-sdk/index.js +295 -99
  215. package/dist/plugin-sdk/infra/binaries.d.ts +3 -0
  216. package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +1 -0
  217. package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +1 -0
  218. package/dist/plugin-sdk/infra/net/ssrf.d.ts +1 -0
  219. package/dist/plugin-sdk/infra/tailscale.d.ts +34 -0
  220. package/dist/plugin-sdk/infra/tmp-openclaw-dir.d.ts +10 -0
  221. package/dist/plugin-sdk/logging/logger.d.ts +1 -1
  222. package/dist/plugin-sdk/media/input-files.d.ts +5 -0
  223. package/dist/plugin-sdk/routing/resolve-route.d.ts +3 -1
  224. package/dist/plugin-sdk/security/external-content.d.ts +1 -1
  225. package/dist/plugin-sdk/security/secret-equal.d.ts +1 -0
  226. package/dist/plugin-sdk/sessions/input-provenance.d.ts +16 -0
  227. package/dist/plugin-sdk/signal/monitor/event-handler.types.d.ts +8 -0
  228. package/dist/plugin-sdk/signal/monitor/mentions.d.ts +2 -0
  229. package/dist/{plugins-3GyCj5KL.js → plugins-4Hqd1WGf.js} +3 -3
  230. package/dist/{plugins-BL9lIXSA.js → plugins-X7d_tfTE.js} +4 -4
  231. package/dist/{plugins-cli-Ce7VsvZh.js → plugins-cli-Bgku3EGj.js} +253 -46
  232. package/dist/{plugins-cli-e9gUebMd.js → plugins-cli-CVToH3if.js} +254 -47
  233. package/dist/{ports-DupIRXQ0.js → ports-qkt29rdC.js} +2 -2
  234. package/dist/{program-u22vbFpH.js → program-Cf7lkBur.js} +82 -82
  235. package/dist/{progress-g9R--HZD.js → progress-C9kngsTD.js} +1 -1
  236. package/dist/{progress-Da1ehW-x.js → progress-DWqhRakV.js} +1 -1
  237. package/dist/{prompt-style-Dc0C5HC9.js → prompt-style-BFH5D5LN.js} +1 -1
  238. package/dist/{prompt-style-lmJDcgtA.js → prompt-style-CIbmaxSa.js} +1 -1
  239. package/dist/{pw-ai-C43wv1ZF.js → pw-ai-8mdv3h-d.js} +7 -6
  240. package/dist/{pw-ai-DTZVjndL.js → pw-ai-CM1IsSgZ.js} +5 -5
  241. package/dist/{pw-ai-zVebjrSG.js → pw-ai-FGoRVblI.js} +3 -3
  242. package/dist/{pw-ai-CWrnJ98b.js → pw-ai-sS1fRKW_.js} +3 -3
  243. package/dist/{qmd-manager-NPD5Yh_4.js → qmd-manager-C67Fc8aN.js} +4 -4
  244. package/dist/{qmd-manager-ozZ933qc.js → qmd-manager-CXVbfg99.js} +7 -7
  245. package/dist/{qmd-manager-DBCZ1sio.js → qmd-manager-RMRE8Tqt.js} +6 -6
  246. package/dist/{qmd-manager-a9Bt0405.js → qmd-manager-pyc_MTIe.js} +4 -4
  247. package/dist/{register.subclis-BpX3ulH1.js → register.subclis-C02e4zuJ.js} +28 -28
  248. package/dist/{reply-m467_fOC.js → reply-DICXkh_C.js} +911 -568
  249. package/dist/{routes-82Ywfho6.js → routes-CmOI1hIH.js} +29 -11
  250. package/dist/{routes-BqxA3ZYr.js → routes-DewK5tq2.js} +29 -12
  251. package/dist/{rpc-DcGBG-Fp.js → rpc-DHr30euf.js} +3 -3
  252. package/dist/{rpc-CfdBHlnp.js → rpc-T300F8zI.js} +3 -3
  253. package/dist/{run-main-aolvSfj3.js → run-main-C5wpthq1.js} +84 -84
  254. package/dist/{runner-C1G8RFWl.js → runner-CY0nmVme.js} +9 -9
  255. package/dist/{runner-BCBs8JKA.js → runner-Cfm5nTMc.js} +6 -6
  256. package/dist/{runner-CInKPsiP.js → runner-D_dujMod.js} +8 -8
  257. package/dist/{runner-Cwfn-VOM.js → runner-DrGYLH5K.js} +6 -6
  258. package/dist/{sandbox-B0K9e6Fw.js → sandbox-BKYnhYQH.js} +23 -15
  259. package/dist/{sandbox-BW8Xnkw1.js → sandbox-Bhjnh1Xg.js} +21 -13
  260. package/dist/{sandbox-cli-mKCs2J0i.js → sandbox-cli-DBsAjZJN.js} +20 -20
  261. package/dist/{sandbox-cli-BD5LkZ0B.js → sandbox-cli-rV9LtFeu.js} +19 -19
  262. package/dist/{security-cli-kgI4soGy.js → security-cli-BIwJM_rs.js} +27 -27
  263. package/dist/{security-cli-kz8TiyqU.js → security-cli-BRjny8Yu.js} +26 -26
  264. package/dist/{server-context-fX4xiYRh.js → server-context-BGpGs3qd.js} +7 -7
  265. package/dist/{server-context-Lb-eUZG_.js → server-context-Cl0U0vE3.js} +5 -5
  266. package/dist/{server-node-events-Dx18uVrH.js → server-node-events-CBfTbiTA.js} +45 -43
  267. package/dist/{server-node-events-KqZMN30F.js → server-node-events-QCvh8EgI.js} +45 -43
  268. package/dist/{service-DZMXgMra.js → service--nPk7DvT.js} +3 -3
  269. package/dist/{service-DNcIZ5Kp.js → service-99RDXwX4.js} +2 -2
  270. package/dist/{service-audit-0WLGnoNT.js → service-audit-DnLmRGQt.js} +4 -4
  271. package/dist/{service-audit-uhZSlxeb.js → service-audit-ckBaRCVC.js} +3 -3
  272. package/dist/{session-cost-usage-HU4OeRgw.js → session-cost-usage-D7HuoSSD.js} +10 -8
  273. package/dist/{session-cost-usage-CL8gnHRN.js → session-cost-usage-D9hHANWI.js} +10 -8
  274. package/dist/{shared-j4Qtr475.js → shared-Bs4vduG4.js} +3 -3
  275. package/dist/{shared-BBw6F-YC.js → shared-CEY5IkwG.js} +2 -2
  276. package/dist/{shared-DOZs2SoH.js → shared-DRohONn_.js} +3 -3
  277. package/dist/{shared-CtP9K-o2.js → shared-ICqOZibV.js} +3 -3
  278. package/dist/{skill-scanner-C_fQzVDu.js → skill-scanner-rHMtUHtP.js} +1 -1
  279. package/dist/{skills-BvPUNjxo.js → skills-DRjfSQT3.js} +128 -4
  280. package/dist/{skills-aFOsriMP.js → skills-DprQj9X2.js} +129 -5
  281. package/dist/{skills-cli-oWaTJzZd.js → skills-cli-9WO-C55s.js} +12 -12
  282. package/dist/{skills-cli-E6shXpdd.js → skills-cli-B9eej-EW.js} +13 -13
  283. package/dist/{skills-status-D4vbIMnz.js → skills-status-5U3P3YfJ.js} +3 -3
  284. package/dist/{skills-status-DJDaA2Ur.js → skills-status-TDIgVd1K.js} +2 -2
  285. package/dist/{sqlite-B7FPASCO.js → sqlite-BINzs1U0.js} +2 -2
  286. package/dist/{sqlite-B4Z1_Ioc.js → sqlite-D4w5TejA.js} +2 -2
  287. package/dist/{sqlite-BkYnxkQO.js → sqlite-DRRHmlug.js} +2 -2
  288. package/dist/{sqlite-EuQPVXvn.js → sqlite-F6PGkEm1.js} +2 -2
  289. package/dist/{status-B2Yr-2J5.js → status-BKGkKC_v.js} +3 -3
  290. package/dist/{status-DW7m5xUN.js → status-CiHtHdaa.js} +4 -4
  291. package/dist/{status-CxhnUa5J.js → status-DDWoOpeB.js} +33 -33
  292. package/dist/{subsystem-Bv7dGhES.js → subsystem-BoExtIHo.js} +32 -13
  293. package/dist/{system-cli-0JXhJNWm.js → system-cli-B6lr60Io.js} +14 -14
  294. package/dist/{system-cli-D-0OaMtH.js → system-cli-CprW9G3h.js} +14 -14
  295. package/dist/{systemd-CNTodvCO.js → systemd-C0VZriGM.js} +2 -2
  296. package/dist/{systemd-CUJJHgHa.js → systemd-DrmBtJ5T.js} +3 -3
  297. package/dist/{systemd-hints-cmHtrXUl.js → systemd-hints-DZtXiVHa.js} +1 -1
  298. package/dist/{systemd-linger-CArPbmvv.js → systemd-linger-NC2kl1SC.js} +2 -2
  299. package/dist/{systemd-linger-XvT9Y9sb.js → systemd-linger-xdn3BdPh.js} +2 -2
  300. package/dist/{table-DzBBIqHO.js → table-B8dx3v4v.js} +2 -2
  301. package/dist/{table-oJQPTUL6.js → table-CwulTLQp.js} +1 -1
  302. package/dist/{tool-display-Na-EVL83.js → tool-display-CZRIDMRm.js} +1 -1
  303. package/dist/{tool-display-sHJa3kRs.js → tool-display-ClRud3pg.js} +2 -2
  304. package/dist/{tui-nGp8ltQK.js → tui-CVTQn-dC.js} +9 -9
  305. package/dist/{tui-Biw7aqPj.js → tui-Lu8FdrlK.js} +9 -9
  306. package/dist/{tui-cli-C9FEfG7C.js → tui-cli-BLpTj1X9.js} +25 -25
  307. package/dist/{tui-cli-Dxnu5JGl.js → tui-cli-BLx5kL2I.js} +25 -25
  308. package/dist/{tui-formatters-BiNTNGwg.js → tui-formatters-CNySEfJN.js} +5 -5
  309. package/dist/{tui-formatters-C_baVYUz.js → tui-formatters-DePhZK3J.js} +5 -5
  310. package/dist/{update-C4rsLj2F.js → update-DHVxMTpQ.js} +3 -3
  311. package/dist/{update-uwUWrKFu.js → update-DU1geolI.js} +3 -3
  312. package/dist/{update-cli-cNd_G9E6.js → update-cli-C0hUvJWK.js} +66 -66
  313. package/dist/{update-cli-CBXp-c4C.js → update-cli-Wb1GB3rL.js} +68 -68
  314. package/dist/{update-runner-BLsqC24J.js → update-runner--ixK4J3W.js} +10 -10
  315. package/dist/{update-runner-C_FDpmA3.js → update-runner-7Qa1T9y6.js} +9 -9
  316. package/dist/{utils-Dk86IbEs.js → utils-BLJAc3ZV.js} +1 -1
  317. package/dist/{utils-BHPdZE4h.js → utils-Cd9QdCHh.js} +1 -1
  318. package/dist/{webhooks-cli-BpBKXL7W.js → webhooks-cli-DgcMy7RG.js} +12 -12
  319. package/dist/{webhooks-cli-wNfhfKqm.js → webhooks-cli-aVzUcJY9.js} +11 -11
  320. package/dist/{widearea-dns-WVCWJTEb.js → widearea-dns-BaIgNEhY.js} +1 -1
  321. package/dist/{widearea-dns-BWYPcfby.js → widearea-dns-DzuRdwk5.js} +1 -1
  322. package/dist/{ws-log-Cafylho7.js → ws-log-CIXbLCka.js} +1 -1
  323. package/dist/{ws-log-DTUOUVgR.js → ws-log-DcQFZByi.js} +1 -1
  324. package/dist/{wsl-B-H6Z5wp.js → wsl-BUOkxKJu.js} +2 -2
  325. package/docs/automation/webhook.md +43 -2
  326. package/docs/channels/discord.md +29 -1
  327. package/docs/cli/plugins.md +20 -1
  328. package/docs/cli/security.md +1 -0
  329. package/docs/concepts/session-tool.md +1 -0
  330. package/docs/gateway/configuration-reference.md +11 -0
  331. package/docs/gateway/configuration.md +3 -0
  332. package/docs/gateway/openresponses-http-api.md +15 -0
  333. package/docs/gateway/security/index.md +3 -0
  334. package/docs/help/faq.md +9 -0
  335. package/docs/install/installer.md +20 -0
  336. package/docs/reference/transcript-hygiene.md +18 -0
  337. package/docs/tools/browser.md +6 -0
  338. package/extensions/diagnostics-otel/package.json +9 -9
  339. package/extensions/feishu/package.json +1 -1
  340. package/extensions/feishu/src/config-schema.ts +6 -0
  341. package/extensions/feishu/src/reply-dispatcher.test.ts +116 -0
  342. package/extensions/feishu/src/reply-dispatcher.ts +124 -67
  343. package/extensions/feishu/src/streaming-card.ts +223 -0
  344. package/extensions/feishu/src/targets.test.ts +16 -0
  345. package/extensions/feishu/src/targets.ts +1 -1
  346. package/extensions/irc/src/client.ts +1 -1
  347. package/extensions/minimax-portal-auth/index.ts +7 -5
  348. package/extensions/nostr/package.json +1 -1
  349. package/package.json +13 -13
  350. package/dist/auth-BcNHFK-i.js +0 -184
  351. package/dist/auth-jrfLXze7.js +0 -184
  352. /package/dist/{archive-DqNr5i8b.js → archive-beaSfAzA.js} +0 -0
  353. /package/dist/{brew-BIrWdDps.js → brew-BUIxHEkn.js} +0 -0
  354. /package/dist/{brew-6UyogeLe.js → brew-ROHf0-Xp.js} +0 -0
  355. /package/dist/{constants-DuoCkWRh.js → constants-BvQ6S8j5.js} +0 -0
  356. /package/dist/{errors-x4NYs-1P.js → errors-DjZBTJJ3.js} +0 -0
  357. /package/dist/{helpers-BDvtkJjw.js → helpers-HyeZXsnu.js} +0 -0
  358. /package/dist/{is-main-CE1eOBYb.js → is-main-BWoXGz7p.js} +0 -0
  359. /package/dist/{parse-Cjiudy6x.js → parse-Bw0oH-rT.js} +0 -0
  360. /package/dist/{parse-timeout-DFSPLxpY.js → parse-timeout-D1XX_zN_.js} +0 -0
  361. /package/dist/{prompts-BOz5176z.js → prompts-Bg96reub.js} +0 -0
  362. /package/dist/{redact-DuEEf1p1.js → redact-Br9GfacZ.js} +0 -0
  363. /package/dist/{skill-scanner-CprFkZib.js → skill-scanner-CucvxYhu.js} +0 -0
  364. /package/dist/{transcript-events-CZ8CG4ht.js → transcript-events-BtNd-j6q.js} +0 -0
@@ -1,12 +1,12 @@
1
1
  import { i as resolveGatewayPort, t as STATE_DIR } from "./paths-BZtyHNCi.js";
2
- import { C as resolveOpenClawPackageRootSync, D as buildAgentMainSessionKey, M as normalizeAgentId, N as normalizeMainKey, P as resolveAgentIdFromSessionKey, T as DEFAULT_AGENT_ID, _ as DEFAULT_TOOLS_FILENAME, c as resolveDefaultAgentId, d as DEFAULT_AGENTS_FILENAME, f as DEFAULT_AGENT_WORKSPACE_DIR, g as DEFAULT_SOUL_FILENAME, h as DEFAULT_IDENTITY_FILENAME, j as normalizeAccountId$1, l as resolveSessionAgentId, m as DEFAULT_HEARTBEAT_FILENAME, n as resolveAgentConfig, p as DEFAULT_BOOTSTRAP_FILENAME, v as DEFAULT_USER_FILENAME, w as DEFAULT_ACCOUNT_ID, y as ensureAgentWorkspace } from "./agent-scope-rXQ7WARN.js";
3
- import { F as normalizeE164, L as resolveConfigDir, S as requireActivePluginRegistry, _ as getChatChannelMeta, b as normalizeChatChannelId, h as CHAT_CHANNEL_ORDER, k as escapeRegExp, l as createSubsystemLogger, m as CHANNEL_IDS, n as runExec, u as defaultRuntime, v as normalizeAnyChannelId, w as CONFIG_DIR, x as getActivePluginRegistry, z as resolveUserPath } from "./exec-4WHuOniw.js";
4
- import { G as parseBooleanValue, W as isTruthyEnvValue } from "./model-auth-CbqRVYRp.js";
2
+ import { C as resolveOpenClawPackageRootSync, D as buildAgentMainSessionKey, M as normalizeAgentId, N as normalizeMainKey, P as resolveAgentIdFromSessionKey, T as DEFAULT_AGENT_ID, _ as DEFAULT_TOOLS_FILENAME, c as resolveDefaultAgentId, d as DEFAULT_AGENTS_FILENAME, f as DEFAULT_AGENT_WORKSPACE_DIR, g as DEFAULT_SOUL_FILENAME, h as DEFAULT_IDENTITY_FILENAME, j as normalizeAccountId$1, l as resolveSessionAgentId, m as DEFAULT_HEARTBEAT_FILENAME, n as resolveAgentConfig, p as DEFAULT_BOOTSTRAP_FILENAME, v as DEFAULT_USER_FILENAME, w as DEFAULT_ACCOUNT_ID, y as ensureAgentWorkspace } from "./agent-scope-BIEhVP4_.js";
3
+ import { F as normalizeE164, L as resolveConfigDir, S as requireActivePluginRegistry, _ as getChatChannelMeta, b as normalizeChatChannelId, h as CHAT_CHANNEL_ORDER, k as escapeRegExp, l as createSubsystemLogger, m as CHANNEL_IDS, n as runExec, ot as resolvePreferredOpenClawTmpDir, u as defaultRuntime, v as normalizeAnyChannelId, w as CONFIG_DIR, x as getActivePluginRegistry, z as resolveUserPath } from "./exec-B8lXct-k.js";
4
+ import { G as parseBooleanValue, W as isTruthyEnvValue } from "./model-auth-CabXIF6O.js";
5
5
  import { t as formatCliCommand } from "./command-format-qUVxzqYm.js";
6
- import { b as resolveMemorySlotDecision, d as parseDurationMs, g as MANIFEST_KEY, h as LEGACY_MANIFEST_KEYS, i as writeConfigFile, j as resolveWhatsAppAccount, o as parseByteSize, p as loadPluginManifestRegistry, t as loadConfig, v as normalizePluginsConfig, y as resolveEnableState } from "./config-BuF7vm-v.js";
7
- import { A as DEFAULT_OPENCLAW_BROWSER_PROFILE_NAME, C as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, D as DEFAULT_BROWSER_EVALUATE_ENABLED, E as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, O as DEFAULT_OPENCLAW_BROWSER_COLOR, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, a as resolveOpenClawUserDataDir, b as isLoopbackHost, c as captureScreenshot, d as normalizeCdpWsUrl, f as snapshotAria, h as getHeadersWithAuth, i as launchOpenClawChrome, k as DEFAULT_OPENCLAW_BROWSER_ENABLED, l as createTargetViaCdp, n as isChromeCdpReady, o as stopOpenClawChrome, p as appendCdpPath, r as isChromeReachable, s as resolveBrowserExecutableForPlatform, v as stopChromeExtensionRelayServer, w as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS } from "./chrome-svgmQ8T_.js";
6
+ import { b as resolveMemorySlotDecision, d as parseDurationMs, g as MANIFEST_KEY, h as LEGACY_MANIFEST_KEYS, i as writeConfigFile, j as resolveWhatsAppAccount, o as parseByteSize, p as loadPluginManifestRegistry, t as loadConfig, v as normalizePluginsConfig, y as resolveEnableState } from "./config-BvMsmctM.js";
7
+ import { A as DEFAULT_OPENCLAW_BROWSER_PROFILE_NAME, C as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, D as DEFAULT_BROWSER_EVALUATE_ENABLED, E as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, O as DEFAULT_OPENCLAW_BROWSER_COLOR, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, a as resolveOpenClawUserDataDir, b as isLoopbackHost, c as captureScreenshot, d as normalizeCdpWsUrl, f as snapshotAria, h as getHeadersWithAuth, i as launchOpenClawChrome, k as DEFAULT_OPENCLAW_BROWSER_ENABLED, l as createTargetViaCdp, n as isChromeCdpReady, o as stopOpenClawChrome, p as appendCdpPath, r as isChromeReachable, s as resolveBrowserExecutableForPlatform, v as stopChromeExtensionRelayServer, w as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS } from "./chrome-BfB6JdKF.js";
8
8
  import { n as formatErrorMessage, t as extractErrorCode } from "./errors-B91HIDPD.js";
9
- import { r as resolveSessionTranscriptPath, t as resolveDefaultSessionStorePath } from "./paths-DwKNqk_S.js";
9
+ import { n as resolveSessionFilePath, t as resolveDefaultSessionStorePath } from "./paths-B0a4ywSO.js";
10
10
  import { t as emitSessionTranscriptUpdate } from "./transcript-events-BHS7QoRl.js";
11
11
  import fs from "node:fs/promises";
12
12
  import os from "node:os";
@@ -1679,6 +1679,83 @@ function applySkillEnvOverridesFromSnapshot(params) {
1679
1679
  };
1680
1680
  }
1681
1681
 
1682
+ //#endregion
1683
+ //#region src/agents/sandbox-paths.ts
1684
+ const UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;
1685
+ const HTTP_URL_RE = /^https?:\/\//i;
1686
+ const DATA_URL_RE = /^data:/i;
1687
+ function normalizeUnicodeSpaces(str) {
1688
+ return str.replace(UNICODE_SPACES, " ");
1689
+ }
1690
+ function expandPath(filePath) {
1691
+ const normalized = normalizeUnicodeSpaces(filePath);
1692
+ if (normalized === "~") return os.homedir();
1693
+ if (normalized.startsWith("~/")) return os.homedir() + normalized.slice(1);
1694
+ return normalized;
1695
+ }
1696
+ function resolveToCwd(filePath, cwd) {
1697
+ const expanded = expandPath(filePath);
1698
+ if (path.isAbsolute(expanded)) return expanded;
1699
+ return path.resolve(cwd, expanded);
1700
+ }
1701
+ function resolveSandboxPath(params) {
1702
+ const resolved = resolveToCwd(params.filePath, params.cwd);
1703
+ const rootResolved = path.resolve(params.root);
1704
+ const relative = path.relative(rootResolved, resolved);
1705
+ if (!relative || relative === "") return {
1706
+ resolved,
1707
+ relative: ""
1708
+ };
1709
+ if (relative.startsWith("..") || path.isAbsolute(relative)) throw new Error(`Path escapes sandbox root (${shortPath(rootResolved)}): ${params.filePath}`);
1710
+ return {
1711
+ resolved,
1712
+ relative
1713
+ };
1714
+ }
1715
+ async function assertSandboxPath(params) {
1716
+ const resolved = resolveSandboxPath(params);
1717
+ await assertNoSymlink(resolved.relative, path.resolve(params.root));
1718
+ return resolved;
1719
+ }
1720
+ function assertMediaNotDataUrl(media) {
1721
+ const raw = media.trim();
1722
+ if (DATA_URL_RE.test(raw)) throw new Error("data: URLs are not supported for media. Use buffer instead.");
1723
+ }
1724
+ async function resolveSandboxedMediaSource(params) {
1725
+ const raw = params.media.trim();
1726
+ if (!raw) return raw;
1727
+ if (HTTP_URL_RE.test(raw)) return raw;
1728
+ let candidate = raw;
1729
+ if (/^file:\/\//i.test(candidate)) try {
1730
+ candidate = fileURLToPath(candidate);
1731
+ } catch {
1732
+ throw new Error(`Invalid file:// URL for sandboxed media: ${raw}`);
1733
+ }
1734
+ return (await assertSandboxPath({
1735
+ filePath: candidate,
1736
+ cwd: params.sandboxRoot,
1737
+ root: params.sandboxRoot
1738
+ })).resolved;
1739
+ }
1740
+ async function assertNoSymlink(relative, root) {
1741
+ if (!relative) return;
1742
+ const parts = relative.split(path.sep).filter(Boolean);
1743
+ let current = root;
1744
+ for (const part of parts) {
1745
+ current = path.join(current, part);
1746
+ try {
1747
+ if ((await fs.lstat(current)).isSymbolicLink()) throw new Error(`Symlink not allowed in sandbox path: ${current}`);
1748
+ } catch (err) {
1749
+ if (err.code === "ENOENT") return;
1750
+ throw err;
1751
+ }
1752
+ }
1753
+ }
1754
+ function shortPath(value) {
1755
+ if (value.startsWith(os.homedir())) return `~${value.slice(os.homedir().length)}`;
1756
+ return value;
1757
+ }
1758
+
1682
1759
  //#endregion
1683
1760
  //#region src/agents/skills/bundled-dir.ts
1684
1761
  function looksLikeSkillsDir(dir) {
@@ -1922,6 +1999,36 @@ function resolveSkillsPromptForRun(params) {
1922
1999
  function loadWorkspaceSkillEntries(workspaceDir, opts) {
1923
2000
  return loadSkillEntries(workspaceDir, opts);
1924
2001
  }
2002
+ function resolveUniqueSyncedSkillDirName(base, used) {
2003
+ if (!used.has(base)) {
2004
+ used.add(base);
2005
+ return base;
2006
+ }
2007
+ for (let index = 2; index < 1e4; index += 1) {
2008
+ const candidate = `${base}-${index}`;
2009
+ if (!used.has(candidate)) {
2010
+ used.add(candidate);
2011
+ return candidate;
2012
+ }
2013
+ }
2014
+ let fallbackIndex = 1e4;
2015
+ let fallback = `${base}-${fallbackIndex}`;
2016
+ while (used.has(fallback)) {
2017
+ fallbackIndex += 1;
2018
+ fallback = `${base}-${fallbackIndex}`;
2019
+ }
2020
+ used.add(fallback);
2021
+ return fallback;
2022
+ }
2023
+ function resolveSyncedSkillDestinationPath(params) {
2024
+ const sourceDirName = path.basename(params.entry.skill.baseDir).trim();
2025
+ if (!sourceDirName || sourceDirName === "." || sourceDirName === "..") return null;
2026
+ return resolveSandboxPath({
2027
+ filePath: resolveUniqueSyncedSkillDirName(sourceDirName, params.usedDirNames),
2028
+ cwd: params.targetSkillsDir,
2029
+ root: params.targetSkillsDir
2030
+ }).resolved;
2031
+ }
1925
2032
  async function syncSkillsToWorkspace(params) {
1926
2033
  const sourceDir = resolveUserPath(params.sourceWorkspaceDir);
1927
2034
  const targetDir = resolveUserPath(params.targetWorkspaceDir);
@@ -1938,8 +2045,24 @@ async function syncSkillsToWorkspace(params) {
1938
2045
  force: true
1939
2046
  });
1940
2047
  await fsp.mkdir(targetSkillsDir, { recursive: true });
2048
+ const usedDirNames = /* @__PURE__ */ new Set();
1941
2049
  for (const entry of entries) {
1942
- const dest = path.join(targetSkillsDir, entry.skill.name);
2050
+ let dest = null;
2051
+ try {
2052
+ dest = resolveSyncedSkillDestinationPath({
2053
+ targetSkillsDir,
2054
+ entry,
2055
+ usedDirNames
2056
+ });
2057
+ } catch (error) {
2058
+ const message = error instanceof Error ? error.message : JSON.stringify(error);
2059
+ console.warn(`[skills] Failed to resolve safe destination for ${entry.skill.name}: ${message}`);
2060
+ continue;
2061
+ }
2062
+ if (!dest) {
2063
+ console.warn(`[skills] Failed to resolve safe destination for ${entry.skill.name}: invalid source directory name`);
2064
+ continue;
2065
+ }
1943
2066
  try {
1944
2067
  await fsp.cp(entry.skill.baseDir, dest, {
1945
2068
  recursive: true,
@@ -2052,7 +2175,7 @@ function isModuleNotFoundError(err) {
2052
2175
  }
2053
2176
  async function loadPwAiModule(mode) {
2054
2177
  try {
2055
- return await import("./pw-ai-zVebjrSG.js");
2178
+ return await import("./pw-ai-FGoRVblI.js");
2056
2179
  } catch (err) {
2057
2180
  if (mode === "soft") return null;
2058
2181
  if (isModuleNotFoundError(err)) return null;
@@ -2609,6 +2732,7 @@ function registerBrowserAgentActRoutes(app, ctx) {
2609
2732
 
2610
2733
  //#endregion
2611
2734
  //#region src/browser/routes/agent.debug.ts
2735
+ const DEFAULT_TRACE_DIR = resolvePreferredOpenClawTmpDir();
2612
2736
  function registerBrowserAgentDebugRoutes(app, ctx) {
2613
2737
  app.get("/console", async (req, res) => {
2614
2738
  const profileCtx = resolveProfileContext(req, res, ctx);
@@ -2719,7 +2843,7 @@ function registerBrowserAgentDebugRoutes(app, ctx) {
2719
2843
  const pw = await requirePwAi(res, "trace stop");
2720
2844
  if (!pw) return;
2721
2845
  const id = crypto.randomUUID();
2722
- const dir = "/tmp/openclaw";
2846
+ const dir = DEFAULT_TRACE_DIR;
2723
2847
  await fs.mkdir(dir, { recursive: true });
2724
2848
  const tracePath = out.trim() || path.join(dir, `browser-trace-${id}.zip`);
2725
2849
  await pw.traceStopViaPlaywright({
@@ -2762,6 +2886,22 @@ function normalizeHostnameSet(values) {
2762
2886
  if (!values || values.length === 0) return /* @__PURE__ */ new Set();
2763
2887
  return new Set(values.map((value) => normalizeHostname(value)).filter(Boolean));
2764
2888
  }
2889
+ function normalizeHostnameAllowlist(values) {
2890
+ if (!values || values.length === 0) return [];
2891
+ return Array.from(new Set(values.map((value) => normalizeHostname(value)).filter((value) => value !== "*" && value !== "*." && value.length > 0)));
2892
+ }
2893
+ function isHostnameAllowedByPattern(hostname, pattern) {
2894
+ if (pattern.startsWith("*.")) {
2895
+ const suffix = pattern.slice(2);
2896
+ if (!suffix || hostname === suffix) return false;
2897
+ return hostname.endsWith(`.${suffix}`);
2898
+ }
2899
+ return hostname === pattern;
2900
+ }
2901
+ function matchesHostnameAllowlist(hostname, allowlist) {
2902
+ if (allowlist.length === 0) return true;
2903
+ return allowlist.some((pattern) => isHostnameAllowedByPattern(hostname, pattern));
2904
+ }
2765
2905
  function parseIpv4(address) {
2766
2906
  const parts = address.split(".");
2767
2907
  if (parts.length !== 4) return null;
@@ -2862,7 +3002,10 @@ async function resolvePinnedHostnameWithPolicy(hostname, params = {}) {
2862
3002
  const normalized = normalizeHostname(hostname);
2863
3003
  if (!normalized) throw new Error("Invalid hostname");
2864
3004
  const allowPrivateNetwork = Boolean(params.policy?.allowPrivateNetwork);
2865
- const isExplicitAllowed = normalizeHostnameSet(params.policy?.allowedHostnames).has(normalized);
3005
+ const allowedHostnames = normalizeHostnameSet(params.policy?.allowedHostnames);
3006
+ const hostnameAllowlist = normalizeHostnameAllowlist(params.policy?.hostnameAllowlist);
3007
+ const isExplicitAllowed = allowedHostnames.has(normalized);
3008
+ if (!matchesHostnameAllowlist(normalized, hostnameAllowlist)) throw new SsrFBlockedError(`Blocked hostname (not in allowlist): ${hostname}`);
2866
3009
  if (!allowPrivateNetwork && !isExplicitAllowed) {
2867
3010
  if (isBlockedHostname(normalized)) throw new SsrFBlockedError(`Blocked hostname: ${hostname}`);
2868
3011
  if (isPrivateIpAddress(normalized)) throw new SsrFBlockedError("Blocked: private/internal IP address");
@@ -2883,9 +3026,6 @@ async function resolvePinnedHostnameWithPolicy(hostname, params = {}) {
2883
3026
  })
2884
3027
  };
2885
3028
  }
2886
- async function resolvePinnedHostname(hostname, lookupFn = lookup$1) {
2887
- return await resolvePinnedHostnameWithPolicy(hostname, { lookupFn });
2888
- }
2889
3029
  function createPinnedDispatcher(pinned) {
2890
3030
  return new Agent({ connect: { lookup: pinned.lookup } });
2891
3031
  }
@@ -4874,11 +5014,11 @@ function createProfileContext(opts, profile) {
4874
5014
  const userDataDir = resolveOpenClawUserDataDir(profile.name);
4875
5015
  const profileState = getProfileState();
4876
5016
  if (await isHttpReachable(300) && !profileState.running) try {
4877
- await (await import("./pw-ai-zVebjrSG.js")).closePlaywrightBrowserConnection();
5017
+ await (await import("./pw-ai-FGoRVblI.js")).closePlaywrightBrowserConnection();
4878
5018
  } catch {}
4879
5019
  if (profileState.running) await stopRunningBrowser();
4880
5020
  try {
4881
- await (await import("./pw-ai-zVebjrSG.js")).closePlaywrightBrowserConnection();
5021
+ await (await import("./pw-ai-FGoRVblI.js")).closePlaywrightBrowserConnection();
4882
5022
  } catch {}
4883
5023
  if (!fs$1.existsSync(userDataDir)) return {
4884
5024
  moved: false,
@@ -7317,7 +7457,15 @@ async function appendAssistantMessageToSessionTranscript(params) {
7317
7457
  ok: false,
7318
7458
  reason: `unknown sessionKey: ${sessionKey}`
7319
7459
  };
7320
- const sessionFile = entry.sessionFile?.trim() || resolveSessionTranscriptPath(entry.sessionId, params.agentId);
7460
+ let sessionFile;
7461
+ try {
7462
+ sessionFile = resolveSessionFilePath(entry.sessionId, entry, { sessionsDir: path.dirname(storePath) });
7463
+ } catch (err) {
7464
+ return {
7465
+ ok: false,
7466
+ reason: err instanceof Error ? err.message : String(err)
7467
+ };
7468
+ }
7321
7469
  await ensureSessionHeader({
7322
7470
  sessionFile,
7323
7471
  sessionId: entry.sessionId
@@ -7587,19 +7735,22 @@ function isContextOverflowError(errorMessage) {
7587
7735
  return lower.includes("request_too_large") || lower.includes("request exceeds the maximum size") || lower.includes("context length exceeded") || lower.includes("maximum context length") || lower.includes("prompt is too long") || lower.includes("exceeds model context window") || hasRequestSizeExceeds && hasContextWindow || lower.includes("context overflow:") || lower.includes("413") && lower.includes("too large");
7588
7736
  }
7589
7737
  const CONTEXT_WINDOW_TOO_SMALL_RE = /context window.*(too small|minimum is)/i;
7590
- const CONTEXT_OVERFLOW_HINT_RE = /context.*overflow|context window.*(too (?:large|long)|exceed|over|limit|max(?:imum)?|requested|sent|tokens)|(?:prompt|request|input).*(too (?:large|long)|exceed|over|limit|max(?:imum)?)/i;
7738
+ const CONTEXT_OVERFLOW_HINT_RE = /context.*overflow|context window.*(too (?:large|long)|exceed|over|limit|max(?:imum)?|requested|sent|tokens)|prompt.*(too (?:large|long)|exceed|over|limit|max(?:imum)?)|(?:request|input).*(?:context|window|length|token).*(too (?:large|long)|exceed|over|limit|max(?:imum)?)/i;
7739
+ const RATE_LIMIT_HINT_RE = /rate limit|too many requests|requests per (?:minute|hour|day)|quota|throttl|429\b/i;
7591
7740
  function isLikelyContextOverflowError(errorMessage) {
7592
7741
  if (!errorMessage) return false;
7593
7742
  if (CONTEXT_WINDOW_TOO_SMALL_RE.test(errorMessage)) return false;
7594
7743
  if (isRateLimitErrorMessage(errorMessage)) return false;
7595
7744
  if (isContextOverflowError(errorMessage)) return true;
7745
+ if (RATE_LIMIT_HINT_RE.test(errorMessage)) return false;
7596
7746
  return CONTEXT_OVERFLOW_HINT_RE.test(errorMessage);
7597
7747
  }
7598
7748
  function isCompactionFailureError(errorMessage) {
7599
7749
  if (!errorMessage) return false;
7600
7750
  const lower = errorMessage.toLowerCase();
7601
7751
  if (!(lower.includes("summarization failed") || lower.includes("auto-compaction") || lower.includes("compaction failed") || lower.includes("compaction"))) return false;
7602
- return isContextOverflowError(errorMessage) || lower.includes("context overflow");
7752
+ if (isLikelyContextOverflowError(errorMessage)) return true;
7753
+ return lower.includes("context overflow");
7603
7754
  }
7604
7755
  const ERROR_PAYLOAD_PREFIX_RE = /^(?:error|api\s*error|apierror|openai\s*error|anthropic\s*error|gateway\s*error)[:\s-]+/i;
7605
7756
  const FINAL_TAG_RE = /<\s*\/?\s*final\s*>/gi;
@@ -8797,4 +8948,4 @@ function validateAnthropicTurns(messages) {
8797
8948
  }
8798
8949
 
8799
8950
  //#endregion
8800
- export { updateSessionStore as $, collectExplicitAllowlist as $t, isBillingAssistantError as A, mediaKindFromMime as An, resolveProfile as At, isTransientHttpError as B, resolveTelegramAccount as Bn, createPinnedDispatcher as Bt, BILLING_ERROR_USER_MESSAGE as C, getFileExtension as Cn, resolveChannelGroupRequireMention as Ct, formatRawAssistantErrorForUi as D, kindFromMime as Dn, createBrowserRouteContext as Dt, formatBillingErrorMessage as E, isGifMedia as En, resolveGroupSessionKey as Et, isFailoverErrorMessage as F, normalizeChannelId as Fn, resizeToJpeg as Ft, resolveSandboxContext as G, resolveSlackBotToken as Gn, loadWorkspaceSkillEntries as Gt, parseImageSizeError as H, listBindings as Hn, resolvePinnedHostnameWithPolicy as Ht, isLikelyContextOverflowError as I, isWhatsAppGroupJid as In, getMediaDir as It, resolveMirroredTranscriptText as J, resolveDiscordAccount as Jn, applySkillEnvOverrides as Jt, resolveSandboxRuntimeStatus as K, normalizeChatType as Kn, resolveSkillsPromptForRun as Kt, isRateLimitAssistantError as L, normalizeWhatsAppTarget as Ln, saveMediaBuffer as Lt, isCompactionFailureError as M, resolveSignalAccount as Mn, getImageMetadata as Mt, isContextOverflowError as N, getChannelPlugin as Nn, hasAlphaChannel as Nt, getApiErrorPayloadFingerprint as O, MAX_IMAGE_BYTES$1 as On, registerBrowserRoutes as Ot, isFailoverAssistantError as P, listChannelPlugins as Pn, optimizeImageToPng as Pt, updateLastRoute as Q, buildPluginToolGroups as Qt, isRawApiErrorPayload as R, listEnabledTelegramAccounts as Rn, SsrFBlockedError as Rt, isGoogleModelApi as S, extensionForMime as Sn, resolveChannelGroupPolicy as St, formatAssistantErrorText as T, isAudioFileName as Tn, resolveConversationLabel as Tt, sanitizeUserFacingText as U, resolveSlackAccount as Un, buildWorkspaceSkillCommandSpecs as Ut, parseImageDimensionError as V, resolveTelegramToken as Vn, resolvePinnedHostname as Vt, ensureSandboxWorkspaceForSession as W, resolveSlackAppToken as Wn, buildWorkspaceSkillSnapshot as Wt, readSessionUpdatedAt as X, resolveSandboxConfigForAgent as Xt, loadSessionStore as Y, normalizeDiscordToken as Yn, applySkillEnvOverridesFromSnapshot as Yt, recordSessionMetaFromInbound as Z, applyOwnerOnlyToolPolicy as Zt, sanitizeSessionMessagesImages as _, resolveMessageChannel as _n, resolveMainSessionKey as _t, formatXHighModelHint as a, buildBootstrapContextFiles as an, mergeDeliveryContext as at, downgradeOpenAIReasoningBlocks as b, GATEWAY_CLIENT_NAMES as bn, listChannelDocks as bt, normalizeReasoningLevel as c, sanitizeGoogleTurnOrdering as cn, normalizeAccountId as ct, normalizeVerboseLevel as d, isGatewayMessageChannel as dn, resolveChannelResetConfig as dt, expandPolicyWithPluginGroups as en, updateSessionStoreEntry as et, resolveResponseUsageMode as f, isInternalMessageChannel as fn, resolveSessionResetPolicy as ft, normalizeTextForComparison as g, resolveGatewayMessageChannel as gn, resolveExplicitAgentSessionKey as gt, isMessagingToolDuplicateNormalized as h, normalizeMessageChannel as hn, DEFAULT_RESET_TRIGGERS as ht, formatThinkingLevels as i, stripPluginOnlyAllowlist as in, deliveryContextKey as it, isCloudCodeAssistFormatError as j, listEnabledSignalAccounts as jn, convertHeicToJpeg as jt, isAuthAssistantError as k, maxBytesForKind as kn, resolveBrowserConfig as kt, normalizeThinkLevel as l, INTERNAL_MESSAGE_CHANNEL as ln, resolveSessionKey as lt, isMessagingToolDuplicate as m, listDeliverableMessageChannels as mn, resolveThreadFlag as mt, validateGeminiTurns as n, normalizeToolName as nn, resolveCacheTtlMs as nt, listThinkingLevels as o, ensureSessionHeader$1 as on, normalizeDeliveryContext as ot, supportsXHighThinking as p, isMarkdownCapableMessageChannel as pn, resolveSessionResetType as pt, appendAssistantMessageToSessionTranscript as q, listEnabledDiscordAccounts as qn, resolvePluginSkillDirs as qt, pickFallbackThinkingLevel as r, resolveToolProfilePolicy as rn, deliveryContextFromSession as rt, normalizeElevatedLevel as s, resolveBootstrapMaxChars as sn, normalizeSessionDeliveryFields as st, validateAnthropicTurns as t, expandToolGroups as tn, isCacheEnabled as tt, normalizeUsageDisplay as u, isDeliverableMessageChannel as un, evaluateSessionFreshness as ut, sanitizeImageBlocks as v, GATEWAY_CLIENT_IDS as vn, deriveSessionMetaPatch as vt, classifyFailoverReason as w, imageMimeFromFormat as wn, resolveChannelGroupToolsPolicy as wt, isAntigravityClaude as x, detectMime as xn, resolveIMessageAccount as xt, sanitizeToolResultImages as y, GATEWAY_CLIENT_MODES as yn, getChannelDock as yt, isTimeoutErrorMessage as z, listTelegramAccountIds as zn, closeDispatcher as zt };
8951
+ export { updateSessionStore as $, applyOwnerOnlyToolPolicy as $t, isBillingAssistantError as A, MAX_IMAGE_BYTES$1 as An, resolveProfile as At, isTransientHttpError as B, listEnabledTelegramAccounts as Bn, createPinnedDispatcher as Bt, BILLING_ERROR_USER_MESSAGE as C, detectMime as Cn, resolveChannelGroupRequireMention as Ct, formatRawAssistantErrorForUi as D, isAudioFileName as Dn, createBrowserRouteContext as Dt, formatBillingErrorMessage as E, imageMimeFromFormat as En, resolveGroupSessionKey as Et, isFailoverErrorMessage as F, getChannelPlugin as Fn, resizeToJpeg as Ft, resolveSandboxContext as G, resolveSlackAccount as Gn, resolveSkillsPromptForRun as Gt, parseImageSizeError as H, resolveTelegramAccount as Hn, buildWorkspaceSkillCommandSpecs as Ht, isLikelyContextOverflowError as I, listChannelPlugins as In, getMediaDir as It, resolveMirroredTranscriptText as J, normalizeChatType as Jn, assertSandboxPath as Jt, resolveSandboxRuntimeStatus as K, resolveSlackAppToken as Kn, resolvePluginSkillDirs as Kt, isRateLimitAssistantError as L, normalizeChannelId as Ln, saveMediaBuffer as Lt, isCompactionFailureError as M, mediaKindFromMime as Mn, getImageMetadata as Mt, isContextOverflowError as N, listEnabledSignalAccounts as Nn, hasAlphaChannel as Nt, getApiErrorPayloadFingerprint as O, isGifMedia as On, registerBrowserRoutes as Ot, isFailoverAssistantError as P, resolveSignalAccount as Pn, optimizeImageToPng as Pt, updateLastRoute as Q, resolveSandboxConfigForAgent as Qt, isRawApiErrorPayload as R, isWhatsAppGroupJid as Rn, SsrFBlockedError as Rt, isGoogleModelApi as S, GATEWAY_CLIENT_NAMES as Sn, resolveChannelGroupPolicy as St, formatAssistantErrorText as T, getFileExtension as Tn, resolveConversationLabel as Tt, sanitizeUserFacingText as U, resolveTelegramToken as Un, buildWorkspaceSkillSnapshot as Ut, parseImageDimensionError as V, listTelegramAccountIds as Vn, resolvePinnedHostnameWithPolicy as Vt, ensureSandboxWorkspaceForSession as W, listBindings as Wn, loadWorkspaceSkillEntries as Wt, readSessionUpdatedAt as X, resolveDiscordAccount as Xn, applySkillEnvOverrides as Xt, loadSessionStore as Y, listEnabledDiscordAccounts as Yn, resolveSandboxedMediaSource as Yt, recordSessionMetaFromInbound as Z, normalizeDiscordToken as Zn, applySkillEnvOverridesFromSnapshot as Zt, sanitizeSessionMessagesImages as _, normalizeMessageChannel as _n, resolveMainSessionKey as _t, formatXHighModelHint as a, resolveToolProfilePolicy as an, mergeDeliveryContext as at, downgradeOpenAIReasoningBlocks as b, GATEWAY_CLIENT_IDS as bn, listChannelDocks as bt, normalizeReasoningLevel as c, ensureSessionHeader$1 as cn, normalizeAccountId as ct, normalizeVerboseLevel as d, INTERNAL_MESSAGE_CHANNEL as dn, resolveChannelResetConfig as dt, buildPluginToolGroups as en, updateSessionStoreEntry as et, resolveResponseUsageMode as f, isDeliverableMessageChannel as fn, resolveSessionResetPolicy as ft, normalizeTextForComparison as g, listDeliverableMessageChannels as gn, resolveExplicitAgentSessionKey as gt, isMessagingToolDuplicateNormalized as h, isMarkdownCapableMessageChannel as hn, DEFAULT_RESET_TRIGGERS as ht, formatThinkingLevels as i, normalizeToolName as in, deliveryContextKey as it, isCloudCodeAssistFormatError as j, maxBytesForKind as jn, convertHeicToJpeg as jt, isAuthAssistantError as k, kindFromMime as kn, resolveBrowserConfig as kt, normalizeThinkLevel as l, resolveBootstrapMaxChars as ln, resolveSessionKey as lt, isMessagingToolDuplicate as m, isInternalMessageChannel as mn, resolveThreadFlag as mt, validateGeminiTurns as n, expandPolicyWithPluginGroups as nn, resolveCacheTtlMs as nt, listThinkingLevels as o, stripPluginOnlyAllowlist as on, normalizeDeliveryContext as ot, supportsXHighThinking as p, isGatewayMessageChannel as pn, resolveSessionResetType as pt, appendAssistantMessageToSessionTranscript as q, resolveSlackBotToken as qn, assertMediaNotDataUrl as qt, pickFallbackThinkingLevel as r, expandToolGroups as rn, deliveryContextFromSession as rt, normalizeElevatedLevel as s, buildBootstrapContextFiles as sn, normalizeSessionDeliveryFields as st, validateAnthropicTurns as t, collectExplicitAllowlist as tn, isCacheEnabled as tt, normalizeUsageDisplay as u, sanitizeGoogleTurnOrdering as un, evaluateSessionFreshness as ut, sanitizeImageBlocks as v, resolveGatewayMessageChannel as vn, deriveSessionMetaPatch as vt, classifyFailoverReason as w, extensionForMime as wn, resolveChannelGroupToolsPolicy as wt, isAntigravityClaude as x, GATEWAY_CLIENT_MODES as xn, resolveIMessageAccount as xt, sanitizeToolResultImages as y, resolveMessageChannel as yn, getChannelDock as yt, isTimeoutErrorMessage as z, normalizeWhatsAppTarget as zn, closeDispatcher as zt };
@@ -1,8 +1,8 @@
1
1
  import { b as resolveThreadParentSessionKey, d as resolveAgentIdFromSessionKey } from "./session-key-BWxPj0z_.js";
2
- import { n as resolveAgentConfig } from "./agent-scope---6LLHj0.js";
3
- import { r as normalizeChannelId } from "./plugins-BL9lIXSA.js";
4
- import { J as resolveChannelGroupToolsPolicy, V as getChannelDock, at as normalizeToolName, it as expandToolGroups } from "./sandbox-BW8Xnkw1.js";
5
- import { l as normalizeMessageChannel } from "./message-channel-0717wOz-.js";
2
+ import { n as resolveAgentConfig } from "./agent-scope-CQCus0rI.js";
3
+ import { r as normalizeChannelId } from "./plugins-X7d_tfTE.js";
4
+ import { J as resolveChannelGroupToolsPolicy, V as getChannelDock, at as normalizeToolName, it as expandToolGroups } from "./sandbox-Bhjnh1Xg.js";
5
+ import { l as normalizeMessageChannel } from "./message-channel-BLi2a6Yw.js";
6
6
 
7
7
  //#region src/config/commands.ts
8
8
  function resolveAutoDefault(providerId) {
@@ -1,8 +1,8 @@
1
- import { nt as getChatChannelMeta, ot as normalizeChatChannelId, rt as listChatChannels } from "./entry.js";
2
- import { k as normalizeProviderId } from "./auth-profiles-CcJ3hrog.js";
3
- import { d as isRecord, t as CONFIG_DIR, y as resolveUserPath } from "./utils-Dk86IbEs.js";
4
- import { a as MANIFEST_KEY, n as discoverOpenClawPlugins } from "./manifest-registry-BTgLN_W2.js";
5
- import { t as hasAnyWhatsAppAuth } from "./accounts-DbzMEfKN.js";
1
+ import { at as listChatChannels, ct as normalizeChatChannelId, it as getChatChannelMeta } from "./entry.js";
2
+ import { k as normalizeProviderId } from "./auth-profiles-ByNs3eEm.js";
3
+ import { d as isRecord, t as CONFIG_DIR, y as resolveUserPath } from "./utils-BLJAc3ZV.js";
4
+ import { a as MANIFEST_KEY, n as discoverOpenClawPlugins } from "./manifest-registry-u0okVSkU.js";
5
+ import { t as hasAnyWhatsAppAuth } from "./accounts-DCDeFTra.js";
6
6
  import path from "node:path";
7
7
  import fs from "node:fs";
8
8
 
@@ -1,8 +1,8 @@
1
- import { S as normalizeChatChannelId, v as getChatChannelMeta, y as listChatChannels } from "./subsystem-Bv7dGhES.js";
2
- import { b as resolveUserPath, f as isRecord, t as CONFIG_DIR } from "./utils-BHPdZE4h.js";
3
- import { s as normalizeProviderId } from "./model-selection-unMJyUIE.js";
4
- import { a as MANIFEST_KEY, n as discoverOpenClawPlugins } from "./manifest-registry-DFckk-L8.js";
5
- import { t as hasAnyWhatsAppAuth } from "./accounts-DimKrt7j.js";
1
+ import { S as normalizeChatChannelId, v as getChatChannelMeta, y as listChatChannels } from "./subsystem-BoExtIHo.js";
2
+ import { b as resolveUserPath, f as isRecord, t as CONFIG_DIR } from "./utils-Cd9QdCHh.js";
3
+ import { s as normalizeProviderId } from "./model-selection-BLuqsGVB.js";
4
+ import { a as MANIFEST_KEY, n as discoverOpenClawPlugins } from "./manifest-registry-CQhdnDBZ.js";
5
+ import { t as hasAnyWhatsAppAuth } from "./accounts-DeqIQjo1.js";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
8
8
 
@@ -3,6 +3,7 @@ import type { ReasoningLevel, ThinkLevel, VerboseLevel } from "../../../auto-rep
3
3
  import type { AgentStreamParams } from "../../../commands/agent/types.js";
4
4
  import type { OpenClawConfig } from "../../../config/config.js";
5
5
  import type { enqueueCommand } from "../../../process/command-queue.js";
6
+ import type { InputProvenance } from "../../../sessions/input-provenance.js";
6
7
  import type { ExecElevatedDefaults, ExecToolDefaults } from "../../bash-tools.js";
7
8
  import type { BlockReplyChunking, ToolResultFormat } from "../../pi-embedded-subscribe.js";
8
9
  import type { SkillSnapshot } from "../../skills.js";
@@ -110,6 +111,7 @@ export type RunEmbeddedPiAgentParams = {
110
111
  lane?: string;
111
112
  enqueue?: typeof enqueueCommand;
112
113
  extraSystemPrompt?: string;
114
+ inputProvenance?: InputProvenance;
113
115
  streamParams?: AgentStreamParams;
114
116
  ownerNumbers?: string[];
115
117
  enforceFinalTag?: boolean;
@@ -4,6 +4,7 @@ import type { ReasoningLevel, ThinkLevel, VerboseLevel } from "../../../auto-rep
4
4
  import type { AgentStreamParams } from "../../../commands/agent/types.js";
5
5
  import type { OpenClawConfig } from "../../../config/config.js";
6
6
  import type { SessionSystemPromptReport } from "../../../config/sessions/types.js";
7
+ import type { InputProvenance } from "../../../sessions/input-provenance.js";
7
8
  import type { ExecElevatedDefaults, ExecToolDefaults } from "../../bash-tools.js";
8
9
  import type { MessagingToolSend } from "../../pi-embedded-messaging.js";
9
10
  import type { BlockReplyChunking, ToolResultFormat } from "../../pi-embedded-subscribe.js";
@@ -100,6 +101,7 @@ export type EmbeddedRunAttemptParams = {
100
101
  /** If true, omit the message tool from the tool list. */
101
102
  disableMessageTool?: boolean;
102
103
  extraSystemPrompt?: string;
104
+ inputProvenance?: InputProvenance;
103
105
  streamParams?: AgentStreamParams;
104
106
  ownerNumbers?: string[];
105
107
  enforceFinalTag?: boolean;
@@ -5,6 +5,7 @@ export type EmbeddedPiAgentMeta = {
5
5
  provider: string;
6
6
  model: string;
7
7
  compactionCount?: number;
8
+ promptTokens?: number;
8
9
  usage?: {
9
10
  input?: number;
10
11
  output?: number;
@@ -12,6 +13,20 @@ export type EmbeddedPiAgentMeta = {
12
13
  cacheWrite?: number;
13
14
  total?: number;
14
15
  };
16
+ /**
17
+ * Usage from the last individual API call (not accumulated across tool-use
18
+ * loops or compaction retries). Used for context-window utilization display
19
+ * (`totalTokens` in sessions.json) because the accumulated `usage.input`
20
+ * sums input tokens from every API call in the run, which overstates the
21
+ * actual context size.
22
+ */
23
+ lastCallUsage?: {
24
+ input?: number;
25
+ output?: number;
26
+ cacheRead?: number;
27
+ cacheWrite?: number;
28
+ total?: number;
29
+ };
15
30
  };
16
31
  export type EmbeddedPiRunMeta = {
17
32
  durationMs: number;
@@ -15,4 +15,4 @@ export declare function handleToolExecutionEnd(ctx: EmbeddedPiSubscribeContext,
15
15
  toolCallId: string;
16
16
  isError: boolean;
17
17
  result?: unknown;
18
- }): void;
18
+ }): Promise<void>;
@@ -2,6 +2,7 @@ import type { AgentEvent, AgentMessage } from "@mariozechner/pi-agent-core";
2
2
  import type { ReplyDirectiveParseResult } from "../auto-reply/reply/reply-directives.js";
3
3
  import type { ReasoningLevel } from "../auto-reply/thinking.js";
4
4
  import type { InlineCodeState } from "../markdown/code-spans.js";
5
+ import type { HookRunner } from "../plugins/hooks.js";
5
6
  import type { EmbeddedBlockChunker } from "./pi-embedded-block-chunker.js";
6
7
  import type { MessagingToolSend } from "./pi-embedded-messaging.js";
7
8
  import type { BlockReplyChunking, SubscribeEmbeddedPiSessionParams } from "./pi-embedded-subscribe.types.js";
@@ -69,6 +70,7 @@ export type EmbeddedPiSubscribeContext = {
69
70
  log: EmbeddedSubscribeLogger;
70
71
  blockChunking?: BlockReplyChunking;
71
72
  blockChunker: EmbeddedBlockChunker | null;
73
+ hookRunner?: HookRunner;
72
74
  shouldEmitToolResult: () => boolean;
73
75
  shouldEmitToolOutput: () => boolean;
74
76
  emitToolSummary: (toolName?: string, meta?: string) => void;
@@ -1,10 +1,12 @@
1
1
  import type { AgentSession } from "@mariozechner/pi-coding-agent";
2
2
  import type { ReasoningLevel, VerboseLevel } from "../auto-reply/thinking.js";
3
+ import type { HookRunner } from "../plugins/hooks.js";
3
4
  import type { BlockReplyChunking } from "./pi-embedded-block-chunker.js";
4
5
  export type ToolResultFormat = "markdown" | "plain";
5
6
  export type SubscribeEmbeddedPiSessionParams = {
6
7
  session: AgentSession;
7
8
  runId: string;
9
+ hookRunner?: HookRunner;
8
10
  verboseLevel?: VerboseLevel;
9
11
  reasoningMode?: ReasoningLevel;
10
12
  toolResultFormat?: ToolResultFormat;
@@ -1,4 +1,5 @@
1
1
  import type { SessionManager } from "@mariozechner/pi-coding-agent";
2
+ import { type InputProvenance } from "../sessions/input-provenance.js";
2
3
  export type GuardedSessionManager = SessionManager & {
3
4
  /** Flush any synthetic tool results for pending tool calls. Idempotent. */
4
5
  flushPendingToolResults?: () => void;
@@ -10,5 +11,6 @@ export type GuardedSessionManager = SessionManager & {
10
11
  export declare function guardSessionManager(sessionManager: SessionManager, opts?: {
11
12
  agentId?: string;
12
13
  sessionKey?: string;
14
+ inputProvenance?: InputProvenance;
13
15
  allowSyntheticToolResults?: boolean;
14
16
  }): GuardedSessionManager;
@@ -1,6 +1,10 @@
1
1
  import type { AgentMessage } from "@mariozechner/pi-agent-core";
2
2
  import type { SessionManager } from "@mariozechner/pi-coding-agent";
3
3
  export declare function installSessionToolResultGuard(sessionManager: SessionManager, opts?: {
4
+ /**
5
+ * Optional transform applied to any message before persistence.
6
+ */
7
+ transformMessageForPersistence?: (message: AgentMessage) => AgentMessage;
4
8
  /**
5
9
  * Optional, synchronous transform applied to toolResult messages *before* they are
6
10
  * persisted to the session transcript.
@@ -9,4 +9,7 @@ export declare function runAgentStep(params: {
9
9
  timeoutMs: number;
10
10
  channel?: string;
11
11
  lane?: string;
12
+ sourceSessionKey?: string;
13
+ sourceChannel?: string;
14
+ sourceTool?: string;
12
15
  }): Promise<string | undefined>;
@@ -41,4 +41,5 @@ export declare function deriveSessionTotalTokens(params: {
41
41
  cacheWrite?: number;
42
42
  };
43
43
  contextTokens?: number;
44
+ promptTokens?: number;
44
45
  }): number | undefined;
@@ -9,7 +9,7 @@ export type ReplyReferencePlanner = {
9
9
  };
10
10
  export declare function createReplyReferencePlanner(options: {
11
11
  replyToMode: ReplyToMode;
12
- /** Existing thread/reference id (always used when present). */
12
+ /** Existing thread/reference id (preferred when allowed by replyToMode). */
13
13
  existingId?: string;
14
14
  /** Id to start a new thread/reference when allowed (e.g., parent message id). */
15
15
  startId?: string;
@@ -0,0 +1,11 @@
1
+ import { type NormalizedUsage } from "../../agents/usage.js";
2
+ import { incrementCompactionCount } from "./session-updates.js";
3
+ import { persistSessionUsageUpdate } from "./session-usage.js";
4
+ type PersistRunSessionUsageParams = Parameters<typeof persistSessionUsageUpdate>[0];
5
+ type IncrementRunCompactionCountParams = Omit<Parameters<typeof incrementCompactionCount>[0], "tokensAfter"> & {
6
+ lastCallUsage?: NormalizedUsage;
7
+ contextTokensUsed?: number;
8
+ };
9
+ export declare function persistRunSessionUsage(params: PersistRunSessionUsageParams): Promise<void>;
10
+ export declare function incrementRunCompactionCount(params: IncrementRunCompactionCountParams): Promise<number | undefined>;
11
+ export {};
@@ -4,9 +4,17 @@ export declare function persistSessionUsageUpdate(params: {
4
4
  storePath?: string;
5
5
  sessionKey?: string;
6
6
  usage?: NormalizedUsage;
7
+ /**
8
+ * Usage from the last individual API call (not accumulated). When provided,
9
+ * this is used for `totalTokens` instead of the accumulated `usage` so that
10
+ * context-window utilization reflects the actual current context size rather
11
+ * than the sum of input tokens across all API calls in the run.
12
+ */
13
+ lastCallUsage?: NormalizedUsage;
7
14
  modelUsed?: string;
8
15
  providerUsed?: string;
9
16
  contextTokensUsed?: number;
17
+ promptTokens?: number;
10
18
  systemPromptReport?: SessionSystemPromptReport;
11
19
  cliSessionId?: string;
12
20
  logLabel?: string;
@@ -0,0 +1,13 @@
1
+ import type { OpenClawConfig } from "../config/config.js";
2
+ export type BrowserControlAuth = {
3
+ token?: string;
4
+ password?: string;
5
+ };
6
+ export declare function resolveBrowserControlAuth(cfg: OpenClawConfig | undefined, env?: NodeJS.ProcessEnv): BrowserControlAuth;
7
+ export declare function ensureBrowserControlAuth(params: {
8
+ cfg: OpenClawConfig;
9
+ env?: NodeJS.ProcessEnv;
10
+ }): Promise<{
11
+ auth: BrowserControlAuth;
12
+ generatedToken?: string;
13
+ }>;
@@ -1,2 +1,3 @@
1
1
  import type { ChannelOnboardingAdapter } from "../onboarding-types.js";
2
+ export declare function normalizeSignalAccountInput(value: string | null | undefined): string | null;
2
3
  export declare const signalOnboardingAdapter: ChannelOnboardingAdapter;
@@ -0,0 +1 @@
1
+ export declare function promptYesNo(question: string, defaultYes?: boolean): Promise<boolean>;
@@ -1,5 +1,6 @@
1
1
  import type { ClientToolDefinition } from "../../agents/pi-embedded-runner/run/params.js";
2
2
  import type { ChannelOutboundTargetMode } from "../../channels/plugins/types.js";
3
+ import type { InputProvenance } from "../../sessions/input-provenance.js";
3
4
  /** Image content block for Claude API multimodal messages. */
4
5
  export type ImageContent = {
5
6
  type: "image";
@@ -70,6 +71,7 @@ export type AgentCommandOpts = {
70
71
  lane?: string;
71
72
  runId?: string;
72
73
  extraSystemPrompt?: string;
74
+ inputProvenance?: InputProvenance;
73
75
  /** Per-call stream param overrides (best-effort). */
74
76
  streamParams?: AgentStreamParams;
75
77
  };
@@ -1,10 +1,15 @@
1
- import type { SessionEntry } from "./types.js";
2
1
  export declare function resolveSessionTranscriptsDir(env?: NodeJS.ProcessEnv, homedir?: () => string): string;
3
2
  export declare function resolveSessionTranscriptsDirForAgent(agentId?: string, env?: NodeJS.ProcessEnv, homedir?: () => string): string;
4
3
  export declare function resolveDefaultSessionStorePath(agentId?: string): string;
4
+ export declare const SAFE_SESSION_ID_RE: RegExp;
5
+ export declare function validateSessionId(sessionId: string): string;
6
+ export declare function resolveSessionTranscriptPathInDir(sessionId: string, sessionsDir: string, topicId?: string | number): string;
5
7
  export declare function resolveSessionTranscriptPath(sessionId: string, agentId?: string, topicId?: string | number): string;
6
- export declare function resolveSessionFilePath(sessionId: string, entry?: SessionEntry, opts?: {
8
+ export declare function resolveSessionFilePath(sessionId: string, entry?: {
9
+ sessionFile?: string;
10
+ }, opts?: {
7
11
  agentId?: string;
12
+ sessionsDir?: string;
8
13
  }): string;
9
14
  export declare function resolveStorePath(store?: string, opts?: {
10
15
  agentId?: string;
@@ -74,5 +74,7 @@ export type AgentBinding = {
74
74
  };
75
75
  guildId?: string;
76
76
  teamId?: string;
77
+ /** Discord role IDs used for role-based routing. */
78
+ roles?: string[];
77
79
  };
78
80
  };
@@ -27,6 +27,8 @@ export type DiscordGuildChannelConfig = {
27
27
  enabled?: boolean;
28
28
  /** Optional allowlist for channel senders (ids or names). */
29
29
  users?: Array<string | number>;
30
+ /** Optional allowlist for channel senders by role ID. */
31
+ roles?: Array<string | number>;
30
32
  /** Optional system prompt snippet for this channel. */
31
33
  systemPrompt?: string;
32
34
  /** If false, omit thread starter context for this channel (default: true). */
@@ -41,7 +43,10 @@ export type DiscordGuildEntry = {
41
43
  toolsBySender?: GroupToolPolicyBySenderConfig;
42
44
  /** Reaction notification mode (off|own|all|allowlist). Default: own. */
43
45
  reactionNotifications?: DiscordReactionNotificationMode;
46
+ /** Optional allowlist for guild senders (ids or names). */
44
47
  users?: Array<string | number>;
48
+ /** Optional allowlist for guild senders by role ID. */
49
+ roles?: Array<string | number>;
45
50
  channels?: Record<string, DiscordGuildChannelConfig>;
46
51
  };
47
52
  export type DiscordActionConfig = {