winclaw 2026.3.21 → 2026.3.22

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 (338) hide show
  1. package/dist/{accounts-CTJXIABG.js → accounts-8qwgz384.js} +1 -1
  2. package/dist/{accounts-CLKFSM00.js → accounts-BpS-Awr5.js} +1 -1
  3. package/dist/{accounts-cYG8442L.js → accounts-BrWJjaKS.js} +7 -7
  4. package/dist/{acp-cli-BbN2vTHD.js → acp-cli-BMM5ssNE.js} +8 -8
  5. package/dist/{agent-scope-D-i-vMLS.js → agent-scope-Dany4R2i.js} +17 -17
  6. package/dist/{agents-_gcdm-kb.js → agents-AMH_Bmb6.js} +14 -14
  7. package/dist/{agents.config-BkgsJJng.js → agents.config-6n_jmCMa.js} +2 -2
  8. package/dist/{api-key-rotation-D_JdsLIl.js → api-key-rotation-C9ywPLG3.js} +1 -1
  9. package/dist/{audio-preflight-CdgtLVh2.js → audio-preflight-D7UvXGlQ.js} +34 -34
  10. package/dist/{audio-preflight-CBWXmKyj.js → audio-preflight-DHeEYciJ.js} +4 -4
  11. package/dist/{audio-transcription-runner-DpvjaNmr.js → audio-transcription-runner-1-9PFrzh.js} +1 -1
  12. package/dist/{audio-transcription-runner-DGZYB2Wq.js → audio-transcription-runner-nnwJufig.js} +23 -23
  13. package/dist/{audit-DdcsBl_-.js → audit-DV_kf1sd.js} +29 -29
  14. package/dist/{auth-CU4HqNch.js → auth-Ahj-1B5R.js} +1 -1
  15. package/dist/{auth-choice-CtzD_rrW.js → auth-choice-NjkwJsBG.js} +13 -13
  16. package/dist/{auth-choice-i771W71t.js → auth-choice-dFTD1hLR.js} +11 -11
  17. package/dist/{auth-choice.apply-helpers-Bmj9LZnO.js → auth-choice.apply-helpers-ClzwLPaB.js} +1 -1
  18. package/dist/{auth-profiles-CmoHF97e.js → auth-profiles-DF0cLC20.js} +16 -16
  19. package/dist/{auth-token-C_S_Uszj.js → auth-token-BXCBtI3p.js} +1 -1
  20. package/dist/{banner-C-01b-if.js → banner-BB4DFL8E.js} +2 -2
  21. package/dist/{bonjour-discovery-BxCVyJLG.js → bonjour-discovery-BVSpbdjs.js} +1 -1
  22. package/dist/{browser-cli-Rt_P1-M1.js → browser-cli-DAcccrxR.js} +12 -12
  23. package/dist/build-info.json +2 -2
  24. package/dist/bundled/boot-md/handler.js +6 -6
  25. package/dist/bundled/session-memory/handler.js +6 -6
  26. package/dist/{call-BLyRfBMl.js → call-DEKH5GO9.js} +10 -10
  27. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  28. package/dist/{channel-account-context-B4ofKr9t.js → channel-account-context-D4Yftz20.js} +5 -5
  29. package/dist/{channel-activity-CPWF8YR5.js → channel-activity-D03SwGPA.js} +1 -1
  30. package/dist/{channel-options-it9Z3dNk.js → channel-options-C7dYNZsy.js} +3 -3
  31. package/dist/{channel-selection-5G2iw3CB.js → channel-selection-Bke39fer.js} +1 -1
  32. package/dist/{channel-web-CJ_jcZSw.js → channel-web-BOrAGcza.js} +17 -17
  33. package/dist/{channels-cli-miFqkj2-.js → channels-cli-4YLI7Ar_.js} +93 -93
  34. package/dist/{channels-status-issues-DpfEWI4l.js → channels-status-issues-wCgCdUDu.js} +1 -1
  35. package/dist/{chrome-RAfAR4xV.js → chrome-BDFA9lPV.js} +4 -4
  36. package/dist/{chrome-GsaZ074n.js → chrome-Cr8R7xl_.js} +8 -8
  37. package/dist/{clawbot-cli-HvFYYAc6.js → clawbot-cli-B96xAtzs.js} +11 -11
  38. package/dist/cli/daemon-cli.js +1 -1
  39. package/dist/cli-BozE7JCS.js +154 -0
  40. package/dist/{client-DCxDsURZ.js → client-jNFqrgw6.js} +2 -2
  41. package/dist/{command-registry-m8nfRV-J.js → command-registry-qDpes5Yr.js} +11 -11
  42. package/dist/{command-secret-targets-BfqkoJyp.js → command-secret-targets-Dd4qCPSg.js} +4 -4
  43. package/dist/{commands-4mnxaSoA.js → commands-DmBkhPD-.js} +1 -1
  44. package/dist/{commands-registry-h5KiQe_S.js → commands-registry-BB289Bg8.js} +3 -3
  45. package/dist/{completion-cli-B-8mTxbh.js → completion-cli-DzZieT3i.js} +13 -13
  46. package/dist/{config-cli-1ecjxVfC.js → config-cli-Dk1yc6M9.js} +7 -7
  47. package/dist/{config-guard-DlzKrdcR.js → config-guard-3fwTO4Mb.js} +3 -3
  48. package/dist/{config-validation-E-3Wz4C4.js → config-validation-5pIaju5U.js} +3 -3
  49. package/dist/{configure-B-tOY-wa.js → configure-CuqZCxTb.js} +17 -17
  50. package/dist/{control-ui-assets-B0DdamQU.js → control-ui-assets-5F0FEjfM.js} +1 -1
  51. package/dist/{cron-cli-DpVGzupl.js → cron-cli-BIa0VxDk.js} +11 -11
  52. package/dist/{daemon-cli-CqwUFobu.js → daemon-cli-BE11O7QX.js} +16 -16
  53. package/dist/{daemon-install-C029NlXk.js → daemon-install-DNhR8NtL.js} +4 -4
  54. package/dist/{daemon-install-helpers-D1YQ03lO.js → daemon-install-helpers-DWmF3oFP.js} +11 -11
  55. package/dist/{deliver-BX-UVg7x.js → deliver-CqiBzHnh.js} +7 -7
  56. package/dist/{deliver-CtyrAYix.js → deliver-r4_Yp7-C.js} +1 -1
  57. package/dist/{deliver-runtime-Bvh4te8E.js → deliver-runtime-CIXUsI5k.js} +3 -3
  58. package/dist/deliver-runtime-DJsAB9LW.js +57 -0
  59. package/dist/deps-send-discord.runtime-M8Cl0fms.js +32 -0
  60. package/dist/deps-send-imessage.runtime-Bing_Bvm.js +31 -0
  61. package/dist/deps-send-signal.runtime-CEnhoskG.js +30 -0
  62. package/dist/deps-send-slack.runtime-DeKWrOdA.js +28 -0
  63. package/dist/deps-send-telegram.runtime-K5LxxPog.js +34 -0
  64. package/dist/{deps-send-whatsapp.runtime-BJV7VcRP.js → deps-send-whatsapp.runtime-BXDQiU2D.js} +7 -7
  65. package/dist/deps-send-whatsapp.runtime-Cie2nrT8.js +115 -0
  66. package/dist/{devices-cli-Cpq_Gt1l.js → devices-cli-BJgUG9fc.js} +8 -8
  67. package/dist/{diagnostic-DIPYflOJ.js → diagnostic-BCcd-_zI.js} +1 -1
  68. package/dist/{diagnostics-KfpqzhsS.js → diagnostics-BDjbQJxP.js} +5 -5
  69. package/dist/{directory-cli-CPBPE8N1.js → directory-cli-CJ_l_BnF.js} +7 -7
  70. package/dist/{dns-cli-CI7HzCVI.js → dns-cli-CFau82Y7.js} +5 -5
  71. package/dist/{dock-ClcGZ0LV.js → dock-C-w5XvOS.js} +4 -4
  72. package/dist/{docs-cli-DkQBHXw-.js → docs-cli-BRob5CHm.js} +4 -4
  73. package/dist/{doctor-completion-DEdT-_9v.js → doctor-completion-DB39JNV7.js} +2 -2
  74. package/dist/{doctor-config-flow-D6rEqOwb.js → doctor-config-flow-BzYwmYwv.js} +15 -15
  75. package/dist/{enable-sRe0nI5a.js → enable-Qw-mz6ta.js} +1 -1
  76. package/dist/entry.js +2 -2
  77. package/dist/{exec-approvals-allowlist-B5ZdMbz6.js → exec-approvals-allowlist-BkdJCc3F.js} +1 -1
  78. package/dist/{exec-approvals-cli-BFxdGk9c.js → exec-approvals-cli-DsDGgzyV.js} +16 -16
  79. package/dist/{exec-safe-bin-runtime-policy-CB8atBLm.js → exec-safe-bin-runtime-policy-C5pAgyiz.js} +2 -2
  80. package/dist/{fetch-CdvuNDFE.js → fetch-BwrGQrFL.js} +3 -3
  81. package/dist/{fetch-guard-D-W6TRJN.js → fetch-guard-CHht1LfT.js} +1 -1
  82. package/dist/{plugin-sdk/fs-safe-DRACrdwg.js → fs-safe-B8J4dv27.js} +6 -6
  83. package/dist/{gateway-cli-C_4mlmOW.js → gateway-cli-BdyXCC2C.js} +154 -154
  84. package/dist/{gateway-rpc-Dg3CGljP.js → gateway-rpc-ICMh7-Qs.js} +1 -1
  85. package/dist/{health-C5a0wlfE.js → health-Boe965-L.js} +11 -11
  86. package/dist/{hooks-cli-C79J_WG7.js → hooks-cli-DI0sn396.js} +81 -81
  87. package/dist/{hooks-status-Cjg5SLpX.js → hooks-status-CQjtRM1s.js} +1 -1
  88. package/dist/{image-7s8Q2r40.js → image-DoOVDHql.js} +1 -1
  89. package/dist/{image-EjGWXbei.js → image-Dpt9TurJ.js} +5 -5
  90. package/dist/{image-ops-eFMqXMDE.js → image-ops-DWGnyTvC.js} +10 -10
  91. package/dist/image-runtime-HfAsK5X3.js +51 -0
  92. package/dist/{image-runtime-QNP_uABR.js → image-runtime-Wym8Keh3.js} +3 -3
  93. package/dist/{inspect-XmcWN97u.js → inspect-DbVcDDi7.js} +4 -4
  94. package/dist/{install-safe-path-DNotGe9T.js → install-safe-path-FR9r9Dmi.js} +25 -25
  95. package/dist/{installs-zKF10nZF.js → installs-7zsfIb7P.js} +9 -9
  96. package/dist/{ipv4-DIKCnoyz.js → ipv4-CfrDjvjo.js} +1 -1
  97. package/dist/{ir-CJPPU4LU.js → ir-B-FffSKU.js} +8 -8
  98. package/dist/{issue-format-DCF2SXK_.js → issue-format-NmLUfbBT.js} +1 -1
  99. package/dist/{json-files-kWpauJWO.js → json-files-D9ZHO8Ud.js} +8 -8
  100. package/dist/{lifecycle-core-BLhI5nRz.js → lifecycle-core-Di83_FGS.js} +5 -5
  101. package/dist/llm-slug-generator.js +6 -6
  102. package/dist/{login-D26qK4NQ.js → login-BrdFlfV0.js} +3 -3
  103. package/dist/{login-qr-CMgMlRCI.js → login-qr-Ci3FVgS9.js} +6 -6
  104. package/dist/{logs-cli-Cn7bGSc7.js → logs-cli-DUl4D14l.js} +9 -9
  105. package/dist/{manager-f6tniCBN.js → manager-2Wice7pq.js} +14 -14
  106. package/dist/manager-runtime-BrpO8pJp.js +22 -0
  107. package/dist/{manifest-registry-CI-UuKUO.js → manifest-registry-_liSV_Vx.js} +1 -1
  108. package/dist/{memory-cli-C2Yq9ryD.js → memory-cli-BgZK6A-T.js} +12 -12
  109. package/dist/{model-CXGHDOeN.js → model-C4J88Gi3.js} +2 -2
  110. package/dist/{model-catalog-08ftNXDk.js → model-catalog-BYxSwIkt.js} +3 -3
  111. package/dist/{model-picker-CTRi5Yhj.js → model-picker-DAr8DpKu.js} +4 -4
  112. package/dist/{models-Do96D4zT.js → models-DqwqcGxg.js} +17 -17
  113. package/dist/{models-cli-pblTciC_.js → models-cli-BFfUYhHp.js} +78 -78
  114. package/dist/{models-config-DYJ-p9kt.js → models-config-CJq2ywhf.js} +6 -6
  115. package/dist/{net-DQYHvbkN.js → net-C7TXXUto.js} +2 -2
  116. package/dist/{node-cli-CsQwAHzH.js → node-cli-DMpZsjse.js} +33 -33
  117. package/dist/{node-command-policy-BHdicfMO.js → node-command-policy-DGMJi4xw.js} +1 -1
  118. package/dist/{node-service-CLtiUeNO.js → node-service-L9-L8-7x.js} +1 -1
  119. package/dist/{nodes-cli-Dlilj-Pf.js → nodes-cli-BcyY77Cc.js} +16 -16
  120. package/dist/{nodes-screen-CL-8raxt.js → nodes-screen-B6QVlwKO.js} +7 -7
  121. package/dist/{npm-pack-install-DZvYhRnM.js → npm-pack-install-B3VCcNWC.js} +18 -18
  122. package/dist/{npm-resolution-DE7xcGkg.js → npm-resolution-0-Scs5nn.js} +4 -4
  123. package/dist/{onboard-CReGZ3G9.js → onboard-C9gtA3_b.js} +6 -6
  124. package/dist/{onboard-channels-ljMkIe7O.js → onboard-channels-NBqfiIc3.js} +21 -21
  125. package/dist/{onboard-custom-DoJDTzAW.js → onboard-custom-Cv61U_sa.js} +4 -4
  126. package/dist/{onboard-helpers-7lOdCHhD.js → onboard-helpers-Djj9SkyR.js} +10 -10
  127. package/dist/{onboard-hooks-BTD0YhRI.js → onboard-hooks-DRkLf5gL.js} +4 -4
  128. package/dist/{onboard-remote-Bj9uk3zW.js → onboard-remote-o8XtWCa_.js} +4 -4
  129. package/dist/{onboard-skills-1KAA9UrK.js → onboard-skills-TATKa-gc.js} +4 -4
  130. package/dist/{onboarding-CoH1hPY0.js → onboarding-C_LQ6doG.js} +14 -14
  131. package/dist/{onboarding.finalize-DzRWtkmA.js → onboarding.finalize-uHWzNBrm.js} +87 -87
  132. package/dist/{onboarding.gateway-config-s11ZLxLE.js → onboarding.gateway-config-ByvXJY2k.js} +18 -18
  133. package/dist/{onboarding.secret-input-D5VKqHdN.js → onboarding.secret-input-Cw4uIgyl.js} +1 -1
  134. package/dist/{openai-model-default-sYh2slgj.js → openai-model-default-Db9joqm4.js} +2 -2
  135. package/dist/{outbound-D0KF3CHY.js → outbound-DgsIsXfj.js} +3 -3
  136. package/dist/{outbound-attachment-CEC4H3tX.js → outbound-attachment-CjhkSZBR.js} +2 -2
  137. package/dist/{pairing-cli-4Nrc-V_v.js → pairing-cli-D0KKynjI.js} +8 -8
  138. package/dist/{pairing-labels-e3Pnen1C.js → pairing-labels-Ev8O2qBX.js} +1 -1
  139. package/dist/{pairing-store-Kslw_Wa0.js → pairing-store-CI0hWzZk.js} +3 -3
  140. package/dist/{plugin-sdk/path-alias-guards-CaCBZRHc.js → path-alias-guards-BoydiaPL.js} +1 -1
  141. package/dist/{path-safety-Cq9rwfZN.js → path-safety-CSCsbd-j.js} +1 -1
  142. package/dist/{paths-C5mR1YC-.js → paths-BVQ0udwc.js} +9 -9
  143. package/dist/{pi-embedded-DUO1eQ_J.js → pi-embedded-CD3oPGOP.js} +24 -24
  144. package/dist/{pi-embedded-helpers-BWpzwT6B.js → pi-embedded-helpers-Be8qWeKb.js} +6 -6
  145. package/dist/{pi-embedded-helpers-BMGRFCuV.js → pi-embedded-helpers-BthBxPYi.js} +3 -3
  146. package/dist/{pi-model-discovery-CibSv4gC.js → pi-model-discovery-CgxnCHvU.js} +1 -1
  147. package/dist/{pi-model-discovery-runtime-DhBE8w94.js → pi-model-discovery-runtime-CqYOz48r.js} +5 -5
  148. package/dist/{pi-tools.before-tool-call.runtime-D6h4CmLs.js → pi-tools.before-tool-call.runtime-CPnt06zM.js} +5 -5
  149. package/dist/{pi-tools.policy-BqpmC_c4.js → pi-tools.policy-DGbCC2Ji.js} +5 -5
  150. package/dist/{plugin-auto-enable-DnSZLbIH.js → plugin-auto-enable-Crpu18wt.js} +3 -3
  151. package/dist/{plugin-registry-DckyegZB.js → plugin-registry-Dbu4pN4B.js} +3 -3
  152. package/dist/plugin-sdk/imessage.js +2 -2
  153. package/dist/plugin-sdk/index.js +50 -50
  154. package/dist/plugin-sdk/mattermost.js +3 -3
  155. package/dist/plugin-sdk/signal.js +2 -2
  156. package/dist/plugin-sdk/telegram.js +2 -2
  157. package/dist/{plugins-C1OgLvb4.js → plugins-IFacUN_Q.js} +2 -2
  158. package/dist/{plugins-cli-C6Oo9R6E.js → plugins-cli-CCpaWcyg.js} +83 -83
  159. package/dist/{ports-CfOim1GC.js → ports-DqZBwUsy.js} +2 -2
  160. package/dist/{ports-Dw-3Gxsb.js → ports-FLn4cVl7.js} +1 -1
  161. package/dist/{probe-D3f6QMfy.js → probe-CHRXpP2F.js} +2 -2
  162. package/dist/{program-CEJ6CsoR.js → program-Br4Re78f.js} +81 -81
  163. package/dist/{prompt-select-styled-D-f3R2mt.js → prompt-select-styled-w-CGGgrT.js} +40 -40
  164. package/dist/{provider-auth-helpers-CN4iPBfs.js → provider-auth-helpers-BVCos07y.js} +5 -5
  165. package/dist/{proxy-env-B7GwrH5p.js → proxy-env-Bx8OhutV.js} +1 -1
  166. package/dist/{push-apns-BEZdCQsM.js → push-apns-Cdl2nskU.js} +5 -5
  167. package/dist/{pw-ai-Ckb-165q.js → pw-ai-BpQw305H.js} +18 -18
  168. package/dist/{pw-ai-D6e8FGb0.js → pw-ai-CJfoHUhH.js} +1 -1
  169. package/dist/{plugin-sdk/qmd-manager-JiY1T3wh.js → qmd-manager-COHJs6wn.js} +15 -11
  170. package/dist/{qr-cli-BI54tdt3.js → qr-cli-Bzo00_vR.js} +2 -2
  171. package/dist/{query-expansion-Cja4xprw.js → query-expansion-IQFdQdeu.js} +12 -12
  172. package/dist/{redact-snapshot-YrAxVxTI.js → redact-snapshot-Bfefch_D.js} +1 -1
  173. package/dist/{register.agent-BjxrirHi.js → register.agent-CVpohSrc.js} +94 -94
  174. package/dist/register.configure-CiIuig3f.js +162 -0
  175. package/dist/{register.maintenance-BfdiJ7KX.js → register.maintenance-CpVfbR8z.js} +95 -95
  176. package/dist/{register.message-BszoJEBm.js → register.message-CJErVRcL.js} +74 -74
  177. package/dist/{register.onboard-CbJU4Y-3.js → register.onboard-Cm5fn9dF.js} +18 -18
  178. package/dist/{register.setup-BTTBsCT0.js → register.setup-DIBDbMN8.js} +21 -21
  179. package/dist/{register.status-health-sessions-C3Ji8sqv.js → register.status-health-sessions-Bu3abDYw.js} +89 -89
  180. package/dist/{register.subclis-2iN-TxPh.js → register.subclis-DTiQUgvr.js} +31 -31
  181. package/dist/{rpc-4GcuaLHq.js → rpc-CkwrblZ9.js} +1 -1
  182. package/dist/{run-main-BEtPk_9z.js → run-main-4p7ridqP.js} +92 -92
  183. package/dist/{runtime-4RU4PT-H.js → runtime-C-9xWVep.js} +3 -3
  184. package/dist/{runtime-config-collectors-Ca2llf68.js → runtime-config-collectors-vw9ITu9W.js} +1 -1
  185. package/dist/{runtime-whatsapp-login.runtime-DOTrH3Wz.js → runtime-whatsapp-login.runtime-CrytFUOh.js} +7 -7
  186. package/dist/runtime-whatsapp-outbound.runtime-DOHkvY0R.js +28 -0
  187. package/dist/{sandbox-D19lOCVP.js → sandbox-CDjV0Crv.js} +18 -18
  188. package/dist/{sandbox-cli-DAZxiFQz.js → sandbox-cli-CyS9Kzp1.js} +25 -25
  189. package/dist/{secrets-cli-Bd2eDDOJ.js → secrets-cli-BPXW13bC.js} +11 -11
  190. package/dist/{security-cli-C6oO69to.js → security-cli-DfuX1PAw.js} +43 -43
  191. package/dist/{send-DR5zNR-6.js → send-BTQQeOIu.js} +6 -6
  192. package/dist/{send-3vnK2por.js → send-CFsJh6px.js} +11 -11
  193. package/dist/{send-DTvtOsK3.js → send-CM55Cnqy.js} +4 -4
  194. package/dist/{send-Bz5LPBFx.js → send-D7wKzeqg.js} +8 -8
  195. package/dist/{send-CEgqE2b1.js → send-DUJqLDEQ.js} +5 -5
  196. package/dist/{server-vPpafyBR.js → server-57rjxu9J.js} +20 -20
  197. package/dist/{server-context-FT_S05Zu.js → server-context-DdGwcBos.js} +12 -12
  198. package/dist/{server-lifecycle-YV61YmRr.js → server-lifecycle-TD7uRUJM.js} +2 -2
  199. package/dist/{server-middleware-BPI-0Duw.js → server-middleware-Dqzu_N47.js} +1 -1
  200. package/dist/{server-node-events-BozhXo6J.js → server-node-events-CstHr-4q.js} +74 -74
  201. package/dist/{service-Aratsspm.js → service-B45ntxm9.js} +15 -15
  202. package/dist/{session-C4iQQHfw.js → session-BO7rj_9P.js} +1 -1
  203. package/dist/{session-utils-CTpXGSxL.js → session-utils-DqzU9P2d.js} +6 -6
  204. package/dist/{sessions-CZvR93mC.js → sessions-BPbCt7hk.js} +4 -4
  205. package/dist/{sessions-Cvvux3S6.js → sessions-BUNwVEqF.js} +15 -15
  206. package/dist/{shared-ByZODVse.js → shared-CeHWQzSU.js} +3 -3
  207. package/dist/{shared-Cj-SPh02.js → shared-CpqkgNHp.js} +1 -1
  208. package/dist/{skill-commands-CzaT61kL.js → skill-commands-BlmjGaIe.js} +5 -5
  209. package/dist/{skill-scanner-DqqhF5of.js → skill-scanner-DOOfjrYo.js} +6 -6
  210. package/dist/{skills-BpN5EUZU.js → skills-CFYm0xdh.js} +3 -3
  211. package/dist/{skills-cli-Bk2WM5gn.js → skills-cli-Dmbm2-L8.js} +5 -5
  212. package/dist/{skills-install-0pjIZu1-.js → skills-install-DSB3T8VY.js} +6 -6
  213. package/dist/{skills-status-Bu28FGtt.js → skills-status-CmWpjTMz.js} +1 -1
  214. package/dist/{slash-commands.runtime-CU--cvcd.js → slash-commands.runtime-CTVGYo20.js} +11 -11
  215. package/dist/{slash-dispatch.runtime-DDLolsGY.js → slash-dispatch.runtime-CQmhrE1-.js} +6 -6
  216. package/dist/slash-dispatch.runtime-yKnwVCI5.js +110 -0
  217. package/dist/slash-skill-commands.runtime-BCG9eUm1.js +29 -0
  218. package/dist/{status-B5hylgEQ.js → status-DPFQHdBI.js} +28 -28
  219. package/dist/{status.update-CdaaXiD4.js → status.update-ZhDibzTU.js} +2 -2
  220. package/dist/{store-LSg8jeyh.js → store-Dgl-neCe.js} +5 -5
  221. package/dist/{subagent-registry-iD-ynHA9.js → subagent-registry-DPqc72Pw.js} +149 -149
  222. package/dist/{subagent-registry-runtime-DfMDVaOY.js → subagent-registry-runtime-BYxLgcCY.js} +6 -6
  223. package/dist/subagent-registry-runtime-DE-5902Y.js +110 -0
  224. package/dist/{system-cli-B8wmT3y0.js → system-cli-BiiO_z6k.js} +9 -9
  225. package/dist/{system-run-command-Ft0meR8i.js → system-run-command-CUMrwy8H.js} +1 -1
  226. package/dist/{systemd-CVY4-XuL.js → systemd-BNMfPHLS.js} +9 -9
  227. package/dist/{systemd-hints-GPX9Y1X7.js → systemd-hints-O9SJa5Ku.js} +6 -6
  228. package/dist/{systemd-linger-CyioH9ho.js → systemd-linger-CDgtOmPf.js} +1 -1
  229. package/dist/{tables-B6p8P9wY.js → tables-Bjpb4vEC.js} +1 -1
  230. package/dist/{tailnet-yScEfa2T.js → tailnet-C4yxhmDk.js} +1 -1
  231. package/dist/{plugin-sdk/target-errors-Hoj2qirZ.js → target-errors-Bd8kj4z9.js} +2 -2
  232. package/dist/{tool-images-Cp3hNFNZ.js → tool-images-DbchBdq5.js} +1 -1
  233. package/dist/{tui-BPqNtl51.js → tui-BVOPPCMP.js} +6 -6
  234. package/dist/{tui-cli-BZE2zssw.js → tui-cli-B2jmEXCo.js} +32 -32
  235. package/dist/{update-u6OtnABh.js → update-DF240Zd0.js} +3 -3
  236. package/dist/{update-cli-C1nysDmM.js → update-cli-PDG-KYWB.js} +105 -105
  237. package/dist/{update-runner-BpzbDTnQ.js → update-runner-BkpGT3AA.js} +16 -16
  238. package/dist/{web-CodV11ZY.js → web-0SOsmYmI.js} +6 -6
  239. package/dist/web-20qjCzeI.js +114 -0
  240. package/dist/{webhooks-cli-D4O_OfXU.js → webhooks-cli-N_vV0iXR.js} +6 -6
  241. package/dist/{whatsapp-actions-By2rV868.js → whatsapp-actions-X768ziyc.js} +17 -17
  242. package/dist/{winclaw-root-D0OUuGl7.js → winclaw-root-DEqOOeOw.js} +8 -8
  243. package/dist/{with-timeout-Cng0KnPd.js → with-timeout-DJb5ULbL.js} +3 -3
  244. package/dist/{workspace-vYy4qLQz.js → workspace-Cx-f7PO5.js} +1 -1
  245. package/dist/{workspace-dirs-C13vnqQQ.js → workspace-dirs-C5erYAob.js} +1 -1
  246. package/dist/{wsl-C9d12M7y.js → wsl-BisEqrSr.js} +2 -2
  247. package/package.json +1 -1
  248. package/dist/cli-Da0pNyXg.js +0 -154
  249. package/dist/deliver-runtime-Co5o7uv0.js +0 -57
  250. package/dist/deps-send-discord.runtime-D0BtA9iO.js +0 -32
  251. package/dist/deps-send-imessage.runtime-89fweiea.js +0 -31
  252. package/dist/deps-send-signal.runtime-BA3mNq_v.js +0 -30
  253. package/dist/deps-send-slack.runtime-DiA-Ieod.js +0 -28
  254. package/dist/deps-send-telegram.runtime-C9bLOnbt.js +0 -34
  255. package/dist/deps-send-whatsapp.runtime-Dflrvnq-.js +0 -115
  256. package/dist/fs-safe-Dha0DfFC.js +0 -352
  257. package/dist/image-runtime-CGAobfgI.js +0 -51
  258. package/dist/manager-runtime-BifbXCuI.js +0 -22
  259. package/dist/path-alias-guards-9OJ1UBCd.js +0 -43
  260. package/dist/plugin-sdk/accounts-B9lBByhz.js +0 -35
  261. package/dist/plugin-sdk/accounts-Bl6fp04N.js +0 -288
  262. package/dist/plugin-sdk/accounts-CQWq_42g.js +0 -46
  263. package/dist/plugin-sdk/active-listener-Dc-P7jeX.js +0 -50
  264. package/dist/plugin-sdk/api-key-rotation-DSOB99GV.js +0 -181
  265. package/dist/plugin-sdk/audio-preflight-DYTxAG0v.js +0 -69
  266. package/dist/plugin-sdk/audio-transcription-runner-Bndij5Q1.js +0 -2176
  267. package/dist/plugin-sdk/audit-membership-runtime-ZTTIhQhs.js +0 -58
  268. package/dist/plugin-sdk/channel-activity-ChRCQNSc.js +0 -94
  269. package/dist/plugin-sdk/channel-web-CfZNFYCV.js +0 -2256
  270. package/dist/plugin-sdk/chrome-DNpRdbZ1.js +0 -2415
  271. package/dist/plugin-sdk/commands-registry-Bq1HqcJU.js +0 -1125
  272. package/dist/plugin-sdk/config-Cyo0rHBx.js +0 -17959
  273. package/dist/plugin-sdk/deliver-mBruQPRt.js +0 -1719
  274. package/dist/plugin-sdk/deliver-runtime-ByVt0evu.js +0 -32
  275. package/dist/plugin-sdk/deps-send-discord.runtime-C2fc3t93.js +0 -23
  276. package/dist/plugin-sdk/deps-send-imessage.runtime-D4m7X6j4.js +0 -22
  277. package/dist/plugin-sdk/deps-send-signal.runtime-DwGJRjyX.js +0 -21
  278. package/dist/plugin-sdk/deps-send-slack.runtime-7J491hID.js +0 -19
  279. package/dist/plugin-sdk/deps-send-telegram.runtime-DAKGyd6b.js +0 -24
  280. package/dist/plugin-sdk/deps-send-whatsapp.runtime-BxQ5tZO2.js +0 -57
  281. package/dist/plugin-sdk/diagnostic-B3ZoSFoM.js +0 -319
  282. package/dist/plugin-sdk/errors-DdSHGcgi.js +0 -54
  283. package/dist/plugin-sdk/fetch-guard-Uhk4tySC.js +0 -156
  284. package/dist/plugin-sdk/image-CEBZ8sRh.js +0 -2314
  285. package/dist/plugin-sdk/image-ops-Dye2ozSZ.js +0 -584
  286. package/dist/plugin-sdk/image-runtime-CabQkSZn.js +0 -25
  287. package/dist/plugin-sdk/ir-CruONUHn.js +0 -1296
  288. package/dist/plugin-sdk/local-roots-BYSlR-at.js +0 -186
  289. package/dist/plugin-sdk/logger-C_vnHQg2.js +0 -1163
  290. package/dist/plugin-sdk/login-bdsdinOj.js +0 -57
  291. package/dist/plugin-sdk/login-qr-BYAvyop9.js +0 -320
  292. package/dist/plugin-sdk/manager-AOQxrU7P.js +0 -3929
  293. package/dist/plugin-sdk/manager-runtime-CijO5giX.js +0 -15
  294. package/dist/plugin-sdk/outbound-FdiP5J7H.js +0 -212
  295. package/dist/plugin-sdk/outbound-attachment-DZphVgq7.js +0 -19
  296. package/dist/plugin-sdk/paths-ICLB349I.js +0 -166
  297. package/dist/plugin-sdk/pi-embedded-helpers-tHjfJzH4.js +0 -9627
  298. package/dist/plugin-sdk/pi-model-discovery-DQV-B6bn.js +0 -134
  299. package/dist/plugin-sdk/pi-model-discovery-runtime-MJmZTIax.js +0 -8
  300. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-7DPjo7Ey.js +0 -354
  301. package/dist/plugin-sdk/plugins-BQHnLb2v.js +0 -864
  302. package/dist/plugin-sdk/proxy-fetch-BpMu-RpD.js +0 -38
  303. package/dist/plugin-sdk/pw-ai-DAMRoo8O.js +0 -1938
  304. package/dist/plugin-sdk/query-expansion-CuaTloKx.js +0 -1011
  305. package/dist/plugin-sdk/redact-BznLQ6I5.js +0 -319
  306. package/dist/plugin-sdk/reply-Cx_4UtvJ.js +0 -100211
  307. package/dist/plugin-sdk/resolve-outbound-target-BDjhohcf.js +0 -40
  308. package/dist/plugin-sdk/run-with-concurrency-BcPenaKJ.js +0 -1994
  309. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DqezqoLI.js +0 -10
  310. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-Dgnv_x4o.js +0 -19
  311. package/dist/plugin-sdk/send-BWz-g7wE.js +0 -540
  312. package/dist/plugin-sdk/send-DB9pUM0k.js +0 -414
  313. package/dist/plugin-sdk/send-QPap4wBN.js +0 -503
  314. package/dist/plugin-sdk/send-gz4Lq5tL.js +0 -2587
  315. package/dist/plugin-sdk/send-tyEtWeMX.js +0 -3135
  316. package/dist/plugin-sdk/session-88GgvJcW.js +0 -169
  317. package/dist/plugin-sdk/skill-commands-ClwX3DoE.js +0 -353
  318. package/dist/plugin-sdk/skills-B2FPl9ca.js +0 -1428
  319. package/dist/plugin-sdk/slash-commands.runtime-CGAfyDkY.js +0 -13
  320. package/dist/plugin-sdk/slash-dispatch.runtime-DN7TWAWh.js +0 -52
  321. package/dist/plugin-sdk/slash-skill-commands.runtime-C4i9B-79.js +0 -16
  322. package/dist/plugin-sdk/ssrf-D3NQgatK.js +0 -202
  323. package/dist/plugin-sdk/store-CDmdRGxP.js +0 -81
  324. package/dist/plugin-sdk/subagent-registry-runtime-CprGCjIU.js +0 -52
  325. package/dist/plugin-sdk/tables-j2CMtAoX.js +0 -55
  326. package/dist/plugin-sdk/thinking-Dh6B0ZhB.js +0 -1206
  327. package/dist/plugin-sdk/tokens-PExiD061.js +0 -52
  328. package/dist/plugin-sdk/tool-images-D7ah30xm.js +0 -274
  329. package/dist/plugin-sdk/web-D9wJfMr_.js +0 -56
  330. package/dist/plugin-sdk/whatsapp-actions-BjarJorO.js +0 -80
  331. package/dist/qmd-manager-oU4X85hj.js +0 -1452
  332. package/dist/register.configure-MduIRRMt.js +0 -162
  333. package/dist/runtime-whatsapp-outbound.runtime-CNnM5MdE.js +0 -28
  334. package/dist/slash-dispatch.runtime-D5Cl7j1v.js +0 -110
  335. package/dist/slash-skill-commands.runtime-DnvHGcVS.js +0 -29
  336. package/dist/subagent-registry-runtime-LH0OBaWN.js +0 -110
  337. package/dist/target-errors-HJQQHC3B.js +0 -195
  338. package/dist/web-DxHq9RWt.js +0 -114
@@ -1,15 +0,0 @@
1
- import "./run-with-concurrency-BcPenaKJ.js";
2
- import "./paths-BEfQqXwE.js";
3
- import "./github-copilot-token-BCc3snHh.js";
4
- import "./config-Cyo0rHBx.js";
5
- import "./logger-C_vnHQg2.js";
6
- import "./paths-ICLB349I.js";
7
- import "./redact-BznLQ6I5.js";
8
- import "./errors-DdSHGcgi.js";
9
- import "./ssrf-D3NQgatK.js";
10
- import "./fetch-guard-Uhk4tySC.js";
11
- import "./api-key-rotation-DSOB99GV.js";
12
- import { t as MemoryIndexManager } from "./manager-AOQxrU7P.js";
13
- import "./query-expansion-CuaTloKx.js";
14
-
15
- export { MemoryIndexManager };
@@ -1,212 +0,0 @@
1
- import { n as loadConfig } from "./config-Cyo0rHBx.js";
2
- import { G as getChildLogger, M as toWhatsappJid, _ as escapeRegExp, a as createSubsystemLogger } from "./logger-C_vnHQg2.js";
3
- import { n as normalizePollInput } from "./polls-D1LcLXEy.js";
4
- import { i as resolveMarkdownTableMode, v as loadWebMedia } from "./ir-CruONUHn.js";
5
- import { t as convertMarkdownTables } from "./tables-j2CMtAoX.js";
6
- import { n as generateSecureUuid } from "./secure-random-18hq3O1a.js";
7
- import { i as redactIdentifier, n as requireActiveWebListener } from "./active-listener-Dc-P7jeX.js";
8
-
9
- //#region src/markdown/whatsapp.ts
10
- /**
11
- * Convert standard Markdown formatting to WhatsApp-compatible markup.
12
- *
13
- * WhatsApp uses its own formatting syntax:
14
- * bold: *text*
15
- * italic: _text_
16
- * strikethrough: ~text~
17
- * monospace: ```text```
18
- *
19
- * Standard Markdown uses:
20
- * bold: **text** or __text__
21
- * italic: *text* or _text_
22
- * strikethrough: ~~text~~
23
- * code: `text` (inline) or ```text``` (block)
24
- *
25
- * The conversion preserves fenced code blocks and inline code,
26
- * then converts bold and strikethrough markers.
27
- */
28
- /** Placeholder tokens used during conversion to protect code spans. */
29
- const FENCE_PLACEHOLDER = "\0FENCE";
30
- const INLINE_CODE_PLACEHOLDER = "\0CODE";
31
- /**
32
- * Convert standard Markdown bold/italic/strikethrough to WhatsApp formatting.
33
- *
34
- * Order of operations matters:
35
- * 1. Protect fenced code blocks (```...```) — already WhatsApp-compatible
36
- * 2. Protect inline code (`...`) — leave as-is
37
- * 3. Convert **bold** → *bold* and __bold__ → *bold*
38
- * 4. Convert ~~strike~~ → ~strike~
39
- * 5. Restore protected spans
40
- *
41
- * Italic *text* and _text_ are left alone since WhatsApp uses _text_ for italic
42
- * and single * is already WhatsApp bold — no conversion needed for single markers.
43
- */
44
- function markdownToWhatsApp(text) {
45
- if (!text) return text;
46
- const fences = [];
47
- let result = text.replace(/```[\s\S]*?```/g, (match) => {
48
- fences.push(match);
49
- return `${FENCE_PLACEHOLDER}${fences.length - 1}`;
50
- });
51
- const inlineCodes = [];
52
- result = result.replace(/`[^`\n]+`/g, (match) => {
53
- inlineCodes.push(match);
54
- return `${INLINE_CODE_PLACEHOLDER}${inlineCodes.length - 1}`;
55
- });
56
- result = result.replace(/\*\*(.+?)\*\*/g, "*$1*");
57
- result = result.replace(/__(.+?)__/g, "*$1*");
58
- result = result.replace(/~~(.+?)~~/g, "~$1~");
59
- result = result.replace(new RegExp(`${escapeRegExp(INLINE_CODE_PLACEHOLDER)}(\\d+)`, "g"), (_, idx) => inlineCodes[Number(idx)] ?? "");
60
- result = result.replace(new RegExp(`${escapeRegExp(FENCE_PLACEHOLDER)}(\\d+)`, "g"), (_, idx) => fences[Number(idx)] ?? "");
61
- return result;
62
- }
63
-
64
- //#endregion
65
- //#region src/web/outbound.ts
66
- const outboundLog = createSubsystemLogger("gateway/channels/whatsapp").child("outbound");
67
- async function sendMessageWhatsApp(to, body, options) {
68
- let text = body;
69
- const correlationId = generateSecureUuid();
70
- const startedAt = Date.now();
71
- const { listener: active, accountId: resolvedAccountId } = requireActiveWebListener(options.accountId);
72
- const tableMode = resolveMarkdownTableMode({
73
- cfg: options.cfg ?? loadConfig(),
74
- channel: "whatsapp",
75
- accountId: resolvedAccountId ?? options.accountId
76
- });
77
- text = convertMarkdownTables(text ?? "", tableMode);
78
- text = markdownToWhatsApp(text);
79
- const redactedTo = redactIdentifier(to);
80
- const logger = getChildLogger({
81
- module: "web-outbound",
82
- correlationId,
83
- to: redactedTo
84
- });
85
- try {
86
- const jid = toWhatsappJid(to);
87
- const redactedJid = redactIdentifier(jid);
88
- let mediaBuffer;
89
- let mediaType;
90
- let documentFileName;
91
- if (options.mediaUrl) {
92
- const media = await loadWebMedia(options.mediaUrl, { localRoots: options.mediaLocalRoots });
93
- const caption = text || void 0;
94
- mediaBuffer = media.buffer;
95
- mediaType = media.contentType;
96
- if (media.kind === "audio") mediaType = media.contentType === "audio/ogg" ? "audio/ogg; codecs=opus" : media.contentType ?? "application/octet-stream";
97
- else if (media.kind === "video") text = caption ?? "";
98
- else if (media.kind === "image") text = caption ?? "";
99
- else {
100
- text = caption ?? "";
101
- documentFileName = media.fileName;
102
- }
103
- }
104
- outboundLog.info(`Sending message -> ${redactedJid}${options.mediaUrl ? " (media)" : ""}`);
105
- logger.info({
106
- jid: redactedJid,
107
- hasMedia: Boolean(options.mediaUrl)
108
- }, "sending message");
109
- await active.sendComposingTo(to);
110
- const accountId = Boolean(options.accountId?.trim()) ? resolvedAccountId : void 0;
111
- const sendOptions = options.gifPlayback || accountId || documentFileName ? {
112
- ...options.gifPlayback ? { gifPlayback: true } : {},
113
- ...documentFileName ? { fileName: documentFileName } : {},
114
- accountId
115
- } : void 0;
116
- const messageId = (sendOptions ? await active.sendMessage(to, text, mediaBuffer, mediaType, sendOptions) : await active.sendMessage(to, text, mediaBuffer, mediaType))?.messageId ?? "unknown";
117
- const durationMs = Date.now() - startedAt;
118
- outboundLog.info(`Sent message ${messageId} -> ${redactedJid}${options.mediaUrl ? " (media)" : ""} (${durationMs}ms)`);
119
- logger.info({
120
- jid: redactedJid,
121
- messageId
122
- }, "sent message");
123
- return {
124
- messageId,
125
- toJid: jid
126
- };
127
- } catch (err) {
128
- logger.error({
129
- err: String(err),
130
- to: redactedTo,
131
- hasMedia: Boolean(options.mediaUrl)
132
- }, "failed to send via web session");
133
- throw err;
134
- }
135
- }
136
- async function sendReactionWhatsApp(chatJid, messageId, emoji, options) {
137
- const correlationId = generateSecureUuid();
138
- const { listener: active } = requireActiveWebListener(options.accountId);
139
- const redactedChatJid = redactIdentifier(chatJid);
140
- const logger = getChildLogger({
141
- module: "web-outbound",
142
- correlationId,
143
- chatJid: redactedChatJid,
144
- messageId
145
- });
146
- try {
147
- const redactedJid = redactIdentifier(toWhatsappJid(chatJid));
148
- outboundLog.info(`Sending reaction "${emoji}" -> message ${messageId}`);
149
- logger.info({
150
- chatJid: redactedJid,
151
- messageId,
152
- emoji
153
- }, "sending reaction");
154
- await active.sendReaction(chatJid, messageId, emoji, options.fromMe ?? false, options.participant);
155
- outboundLog.info(`Sent reaction "${emoji}" -> message ${messageId}`);
156
- logger.info({
157
- chatJid: redactedJid,
158
- messageId,
159
- emoji
160
- }, "sent reaction");
161
- } catch (err) {
162
- logger.error({
163
- err: String(err),
164
- chatJid: redactedChatJid,
165
- messageId,
166
- emoji
167
- }, "failed to send reaction via web session");
168
- throw err;
169
- }
170
- }
171
- async function sendPollWhatsApp(to, poll, options) {
172
- const correlationId = generateSecureUuid();
173
- const startedAt = Date.now();
174
- const { listener: active } = requireActiveWebListener(options.accountId);
175
- const redactedTo = redactIdentifier(to);
176
- const logger = getChildLogger({
177
- module: "web-outbound",
178
- correlationId,
179
- to: redactedTo
180
- });
181
- try {
182
- const jid = toWhatsappJid(to);
183
- const redactedJid = redactIdentifier(jid);
184
- const normalized = normalizePollInput(poll, { maxOptions: 12 });
185
- outboundLog.info(`Sending poll -> ${redactedJid}`);
186
- logger.info({
187
- jid: redactedJid,
188
- optionCount: normalized.options.length,
189
- maxSelections: normalized.maxSelections
190
- }, "sending poll");
191
- const messageId = (await active.sendPoll(to, normalized))?.messageId ?? "unknown";
192
- const durationMs = Date.now() - startedAt;
193
- outboundLog.info(`Sent poll ${messageId} -> ${redactedJid} (${durationMs}ms)`);
194
- logger.info({
195
- jid: redactedJid,
196
- messageId
197
- }, "sent poll");
198
- return {
199
- messageId,
200
- toJid: jid
201
- };
202
- } catch (err) {
203
- logger.error({
204
- err: String(err),
205
- to: redactedTo
206
- }, "failed to send poll via web session");
207
- throw err;
208
- }
209
- }
210
-
211
- //#endregion
212
- export { markdownToWhatsApp as i, sendPollWhatsApp as n, sendReactionWhatsApp as r, sendMessageWhatsApp as t };
@@ -1,19 +0,0 @@
1
- import { t as buildOutboundMediaLoadOptions } from "./load-options-CeAdSFX_.js";
2
- import { v as loadWebMedia } from "./ir-CruONUHn.js";
3
- import { a as saveMediaBuffer } from "./store-CDmdRGxP.js";
4
-
5
- //#region src/media/outbound-attachment.ts
6
- async function resolveOutboundAttachmentFromUrl(mediaUrl, maxBytes, options) {
7
- const media = await loadWebMedia(mediaUrl, buildOutboundMediaLoadOptions({
8
- maxBytes,
9
- mediaLocalRoots: options?.localRoots
10
- }));
11
- const saved = await saveMediaBuffer(media.buffer, media.contentType ?? void 0, "outbound", maxBytes);
12
- return {
13
- path: saved.path,
14
- contentType: saved.contentType
15
- };
16
- }
17
-
18
- //#endregion
19
- export { resolveOutboundAttachmentFromUrl as t };
@@ -1,166 +0,0 @@
1
- import { $ as normalizeAgentId, K as DEFAULT_AGENT_ID } from "./run-with-concurrency-BcPenaKJ.js";
2
- import { c as resolveStateDir, d as resolveRequiredHomeDir, l as expandHomePrefix } from "./paths-BEfQqXwE.js";
3
- import fs from "node:fs";
4
- import path from "node:path";
5
- import os from "node:os";
6
-
7
- //#region src/config/sessions/paths.ts
8
- function resolveAgentSessionsDir(agentId, env = process.env, homedir = () => resolveRequiredHomeDir(env, os.homedir)) {
9
- const root = resolveStateDir(env, homedir);
10
- const id = normalizeAgentId(agentId ?? DEFAULT_AGENT_ID);
11
- return path.join(root, "agents", id, "sessions");
12
- }
13
- function resolveSessionTranscriptsDirForAgent(agentId, env = process.env, homedir = () => resolveRequiredHomeDir(env, os.homedir)) {
14
- return resolveAgentSessionsDir(agentId, env, homedir);
15
- }
16
- function resolveDefaultSessionStorePath(agentId) {
17
- return path.join(resolveAgentSessionsDir(agentId), "sessions.json");
18
- }
19
- const MULTI_STORE_PATH_SENTINEL = "(multiple)";
20
- function resolveSessionFilePathOptions(params) {
21
- const agentId = params.agentId?.trim();
22
- const storePath = params.storePath?.trim();
23
- if (storePath && storePath !== MULTI_STORE_PATH_SENTINEL) {
24
- const sessionsDir = path.dirname(path.resolve(storePath));
25
- return agentId ? {
26
- sessionsDir,
27
- agentId
28
- } : { sessionsDir };
29
- }
30
- if (agentId) return { agentId };
31
- }
32
- const SAFE_SESSION_ID_RE = /^[a-z0-9][a-z0-9._-]{0,127}$/i;
33
- function validateSessionId(sessionId) {
34
- const trimmed = sessionId.trim();
35
- if (!SAFE_SESSION_ID_RE.test(trimmed)) throw new Error(`Invalid session ID: ${sessionId}`);
36
- return trimmed;
37
- }
38
- function resolveSessionsDir(opts) {
39
- const sessionsDir = opts?.sessionsDir?.trim();
40
- if (sessionsDir) return path.resolve(sessionsDir);
41
- return resolveAgentSessionsDir(opts?.agentId);
42
- }
43
- function resolvePathFromAgentSessionsDir(agentSessionsDir, candidateAbsPath) {
44
- const agentBase = safeRealpathSync(path.resolve(agentSessionsDir)) ?? path.resolve(agentSessionsDir);
45
- const realCandidate = safeRealpathSync(candidateAbsPath) ?? candidateAbsPath;
46
- const relative = path.relative(agentBase, realCandidate);
47
- if (!relative || relative.startsWith("..") || path.isAbsolute(relative)) return;
48
- return path.resolve(agentBase, relative);
49
- }
50
- function resolveSiblingAgentSessionsDir(baseSessionsDir, agentId) {
51
- const resolvedBase = path.resolve(baseSessionsDir);
52
- if (path.basename(resolvedBase) !== "sessions") return;
53
- const baseAgentDir = path.dirname(resolvedBase);
54
- const baseAgentsDir = path.dirname(baseAgentDir);
55
- if (path.basename(baseAgentsDir) !== "agents") return;
56
- const rootDir = path.dirname(baseAgentsDir);
57
- return path.join(rootDir, "agents", normalizeAgentId(agentId), "sessions");
58
- }
59
- function resolveAgentSessionsPathParts(candidateAbsPath) {
60
- const parts = path.normalize(path.resolve(candidateAbsPath)).split(path.sep).filter(Boolean);
61
- const sessionsIndex = parts.lastIndexOf("sessions");
62
- if (sessionsIndex < 2 || parts[sessionsIndex - 2] !== "agents") return null;
63
- return {
64
- parts,
65
- sessionsIndex
66
- };
67
- }
68
- function extractAgentIdFromAbsoluteSessionPath(candidateAbsPath) {
69
- const parsed = resolveAgentSessionsPathParts(candidateAbsPath);
70
- if (!parsed) return;
71
- const { parts, sessionsIndex } = parsed;
72
- return parts[sessionsIndex - 1] || void 0;
73
- }
74
- function resolveStructuralSessionFallbackPath(candidateAbsPath, expectedAgentId) {
75
- const parsed = resolveAgentSessionsPathParts(candidateAbsPath);
76
- if (!parsed) return;
77
- const { parts, sessionsIndex } = parsed;
78
- const agentIdPart = parts[sessionsIndex - 1];
79
- if (!agentIdPart) return;
80
- const normalizedAgentId = normalizeAgentId(agentIdPart);
81
- if (normalizedAgentId !== agentIdPart.toLowerCase()) return;
82
- if (normalizedAgentId !== normalizeAgentId(expectedAgentId)) return;
83
- const relativeSegments = parts.slice(sessionsIndex + 1);
84
- if (relativeSegments.length !== 1) return;
85
- const fileName = relativeSegments[0];
86
- if (!fileName || fileName === "." || fileName === "..") return;
87
- return path.normalize(path.resolve(candidateAbsPath));
88
- }
89
- function safeRealpathSync(filePath) {
90
- try {
91
- return fs.realpathSync(filePath);
92
- } catch {
93
- return;
94
- }
95
- }
96
- function resolvePathWithinSessionsDir(sessionsDir, candidate, opts) {
97
- const trimmed = candidate.trim();
98
- if (!trimmed) throw new Error("Session file path must not be empty");
99
- const resolvedBase = path.resolve(sessionsDir);
100
- const realBase = safeRealpathSync(resolvedBase) ?? resolvedBase;
101
- const realTrimmed = path.isAbsolute(trimmed) ? safeRealpathSync(trimmed) ?? trimmed : trimmed;
102
- const normalized = path.isAbsolute(realTrimmed) ? path.relative(realBase, realTrimmed) : realTrimmed;
103
- if (normalized.startsWith("..") && path.isAbsolute(realTrimmed)) {
104
- const tryAgentFallback = (agentId) => {
105
- const normalizedAgentId = normalizeAgentId(agentId);
106
- const siblingSessionsDir = resolveSiblingAgentSessionsDir(realBase, normalizedAgentId);
107
- if (siblingSessionsDir) {
108
- const siblingResolved = resolvePathFromAgentSessionsDir(siblingSessionsDir, realTrimmed);
109
- if (siblingResolved) return siblingResolved;
110
- }
111
- return resolvePathFromAgentSessionsDir(resolveAgentSessionsDir(normalizedAgentId), realTrimmed);
112
- };
113
- const explicitAgentId = opts?.agentId?.trim();
114
- if (explicitAgentId) {
115
- const resolvedFromAgent = tryAgentFallback(explicitAgentId);
116
- if (resolvedFromAgent) return resolvedFromAgent;
117
- }
118
- const extractedAgentId = extractAgentIdFromAbsoluteSessionPath(realTrimmed);
119
- if (extractedAgentId) {
120
- const resolvedFromPath = tryAgentFallback(extractedAgentId);
121
- if (resolvedFromPath) return resolvedFromPath;
122
- const structuralFallback = resolveStructuralSessionFallbackPath(realTrimmed, extractedAgentId);
123
- if (structuralFallback) return structuralFallback;
124
- }
125
- }
126
- if (!normalized || normalized.startsWith("..") || path.isAbsolute(normalized)) throw new Error("Session file path must be within sessions directory");
127
- return path.resolve(realBase, normalized);
128
- }
129
- function resolveSessionTranscriptPathInDir(sessionId, sessionsDir, topicId) {
130
- const safeSessionId = validateSessionId(sessionId);
131
- const safeTopicId = typeof topicId === "string" ? encodeURIComponent(topicId) : typeof topicId === "number" ? String(topicId) : void 0;
132
- return resolvePathWithinSessionsDir(sessionsDir, safeTopicId !== void 0 ? `${safeSessionId}-topic-${safeTopicId}.jsonl` : `${safeSessionId}.jsonl`);
133
- }
134
- function resolveSessionTranscriptPath(sessionId, agentId, topicId) {
135
- return resolveSessionTranscriptPathInDir(sessionId, resolveAgentSessionsDir(agentId), topicId);
136
- }
137
- function resolveSessionFilePath(sessionId, entry, opts) {
138
- const sessionsDir = resolveSessionsDir(opts);
139
- const candidate = entry?.sessionFile?.trim();
140
- if (candidate) try {
141
- return resolvePathWithinSessionsDir(sessionsDir, candidate, { agentId: opts?.agentId });
142
- } catch {}
143
- return resolveSessionTranscriptPathInDir(sessionId, sessionsDir);
144
- }
145
- function resolveStorePath(store, opts) {
146
- const agentId = normalizeAgentId(opts?.agentId ?? DEFAULT_AGENT_ID);
147
- if (!store) return resolveDefaultSessionStorePath(agentId);
148
- if (store.includes("{agentId}")) {
149
- const expanded = store.replaceAll("{agentId}", agentId);
150
- if (expanded.startsWith("~")) return path.resolve(expandHomePrefix(expanded, {
151
- home: resolveRequiredHomeDir(process.env, os.homedir),
152
- env: process.env,
153
- homedir: os.homedir
154
- }));
155
- return path.resolve(expanded);
156
- }
157
- if (store.startsWith("~")) return path.resolve(expandHomePrefix(store, {
158
- home: resolveRequiredHomeDir(process.env, os.homedir),
159
- env: process.env,
160
- homedir: os.homedir
161
- }));
162
- return path.resolve(store);
163
- }
164
-
165
- //#endregion
166
- export { resolveSessionTranscriptPathInDir as a, resolveSessionTranscriptPath as i, resolveSessionFilePath as n, resolveSessionTranscriptsDirForAgent as o, resolveSessionFilePathOptions as r, resolveStorePath as s, resolveDefaultSessionStorePath as t };