squidclaw 3.0.23 → 3.0.24

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 (412) hide show
  1. package/dist/{accounts-KzgPbLHP.js → accounts-B1RxFghM.js} +1 -1
  2. package/dist/{accounts-BK8I0Svb.js → accounts-BH9Qo1sQ.js} +7 -7
  3. package/dist/{accounts-s5e9zidf.js → accounts-C7pGQPcS.js} +2 -2
  4. package/dist/{accounts-DeqNOvBo.js → accounts-Cuwg9Tan.js} +1 -1
  5. package/dist/{accounts-Bkb-J8V6.js → accounts-DjhBQg_8.js} +2 -2
  6. package/dist/{accounts-B6F_XCgS.js → accounts-DwGoZKGm.js} +17 -17
  7. package/dist/{acp-cli-BwG98FYT.js → acp-cli-Ch55Vzud.js} +8 -8
  8. package/dist/{active-listener-6-Svu8Dx.js → active-listener-DPc_PGsA.js} +2 -2
  9. package/dist/{agent-scope-Cq4vDGrK.js → agent-scope-nEVgVklg.js} +17 -17
  10. package/dist/{agents-DXKtU4Il.js → agents-B-ig6ydU.js} +14 -14
  11. package/dist/{agents.config-BM-2SLCh.js → agents.config-w_Z6Fb4-.js} +2 -2
  12. package/dist/{api-key-rotation-TRwuCWbu.js → api-key-rotation-DVyYtQxC.js} +2 -2
  13. package/dist/{api-key-rotation-6i41mEc9.js → api-key-rotation-JPmjv-c0.js} +1 -1
  14. package/dist/{audio-preflight-1KULThhV.js → audio-preflight-BUCBED7N.js} +32 -32
  15. package/dist/{audio-preflight-C-JCwUKe.js → audio-preflight-CZ--cSZh.js} +34 -34
  16. package/dist/{audio-transcription-runner-C3N9eAGM.js → audio-transcription-runner-Cv0Q47cM.js} +12 -12
  17. package/dist/{audio-transcription-runner-DvQksGUE.js → audio-transcription-runner-D-uxpkbd.js} +23 -23
  18. package/dist/{audit-DLTgNDFw.js → audit-JLT1FqTt.js} +29 -29
  19. package/dist/{audit-membership-runtime-w23FnNAN.js → audit-membership-runtime-DyLj-uhz.js} +4 -4
  20. package/dist/{auth-CuObxnC4.js → auth-BlP9BwaD.js} +1 -1
  21. package/dist/{auth-choice-BVQQneHM.js → auth-choice-Czu7271G.js} +13 -13
  22. package/dist/{auth-choice-CXepQc7c.js → auth-choice-ORZHjbsv.js} +11 -11
  23. package/dist/{auth-choice.apply-helpers-p1y_DmDT.js → auth-choice.apply-helpers-CdoXMtxm.js} +1 -1
  24. package/dist/{auth-profiles-CX4YYu7Z.js → auth-profiles-9T4j6jMy.js} +16 -16
  25. package/dist/{auth-token-Dlk7MMsC.js → auth-token-BFc70pes.js} +1 -1
  26. package/dist/{banner-DMfuBV69.js → banner-CwNmI5G-.js} +2 -2
  27. package/dist/{bonjour-discovery-BHz2I6_W.js → bonjour-discovery-eqJcK09r.js} +1 -1
  28. package/dist/{browser-cli-Dvwk4zAD.js → browser-cli-DCDPC5sg.js} +12 -12
  29. package/dist/build-info.json +3 -3
  30. package/dist/bundled/boot-md/handler.js +51 -51
  31. package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
  32. package/dist/bundled/command-logger/handler.js +2 -2
  33. package/dist/bundled/session-memory/handler.js +59 -61
  34. package/dist/{call-BlWEBz99.js → call-D7jOWSFr.js} +10 -10
  35. package/dist/{channel-account-context-CQ6rCiGI.js → channel-account-context-DJ3rHgVO.js} +5 -5
  36. package/dist/{channel-activity-CxJbx4sD.js → channel-activity-CPpt4XaL.js} +3 -3
  37. package/dist/{channel-activity-BZKeZQH-.js → channel-activity-wuB3-cfR.js} +1 -1
  38. package/dist/{channel-options-CQ-gER0J.js → channel-options-BS7BSU_5.js} +3 -3
  39. package/dist/{channel-selection-BqwS1Rlq.js → channel-selection-CFWQq1nS.js} +1 -1
  40. package/dist/{channel-web-LLzBxZrT.js → channel-web-C1qYz-HK.js} +17 -17
  41. package/dist/{channels-cli-D4xUEYYC.js → channels-cli-CVNqp5q7.js} +93 -93
  42. package/dist/{channels-status-issues-Dz1_R7Ah.js → channels-status-issues-Erzzhl2e.js} +1 -1
  43. package/dist/{chrome-CoRiYsNu.js → chrome-DiktJpMU.js} +4 -4
  44. package/dist/{chrome-Qbvnl6so.js → chrome-OgCChbC_.js} +18 -18
  45. package/dist/{clawbot-cli-2Zlim_pH.js → clawbot-cli-C3bt-FEP.js} +11 -11
  46. package/dist/cli/daemon-cli.js +1 -1
  47. package/dist/{cli-CAID9zkL.js → cli-Jyqv2jm8.js} +73 -73
  48. package/dist/{client-G9E5HGM2.js → client-COy24r9W.js} +2 -2
  49. package/dist/{command-registry-AHS8_9da.js → command-registry-DCojicSG.js} +11 -11
  50. package/dist/{command-secret-targets-DAu5nw-j.js → command-secret-targets-CZjP-Bm5.js} +4 -4
  51. package/dist/{commands-CnX9I_l4.js → commands-DDHiW-As.js} +1 -1
  52. package/dist/{commands-registry-_r_JONI4.js → commands-registry--ITOJ-cM.js} +3 -3
  53. package/dist/{commands-registry-B44COZFz.js → commands-registry-BJjv8_oR.js} +4 -4
  54. package/dist/{completion-cli-BR1r9_h4.js → completion-cli-DCTv7Ejv.js} +13 -13
  55. package/dist/{config-cli-D0A8Awoo.js → config-cli-CSPSSP_R.js} +7 -7
  56. package/dist/{config-guard-BHy2f0hU.js → config-guard-CFauJm79.js} +3 -3
  57. package/dist/{config-validation-BkvDORAk.js → config-validation-Bt3LfFJ0.js} +3 -3
  58. package/dist/{configure-XmOqwwy9.js → configure-DAol2gT6.js} +17 -17
  59. package/dist/{control-ui-assets-BYEy341x.js → control-ui-assets-d6VtDSeo.js} +1 -1
  60. package/dist/{cron-cli-QwZcnjJc.js → cron-cli-yS1ww1k2.js} +11 -11
  61. package/dist/{daemon-cli-kJfDhzr8.js → daemon-cli-B-yZvTqZ.js} +15 -15
  62. package/dist/{daemon-install-Chxlu9Kv.js → daemon-install-CbPLNiIP.js} +4 -4
  63. package/dist/{daemon-install-helpers-CJtiW2RE.js → daemon-install-helpers-CZDVO_MU.js} +11 -11
  64. package/dist/{deliver-CL2RW5UB.js → deliver-D-IQEJ52.js} +7 -7
  65. package/dist/{deliver-BC5egJvm.js → deliver-DMTUTpTM.js} +21 -21
  66. package/dist/deliver-runtime-B80olQwJ.js +36 -0
  67. package/dist/deliver-runtime-zICm26tE.js +61 -0
  68. package/dist/deps-send-discord.runtime-C_9HZQko.js +36 -0
  69. package/dist/deps-send-discord.runtime-GIuvX7Xw.js +26 -0
  70. package/dist/deps-send-imessage.runtime-B3TC7G80.js +25 -0
  71. package/dist/deps-send-imessage.runtime-BMhGsWds.js +35 -0
  72. package/dist/deps-send-signal.runtime-BGhjYiu6.js +34 -0
  73. package/dist/deps-send-signal.runtime-CuVJyw7n.js +24 -0
  74. package/dist/deps-send-slack.runtime-DjBCu-RX.js +32 -0
  75. package/dist/deps-send-slack.runtime-cbfFoLZ4.js +22 -0
  76. package/dist/deps-send-telegram.runtime-CRyP-xDQ.js +27 -0
  77. package/dist/{deps-send-telegram.runtime-BHaZAs2h.js → deps-send-telegram.runtime-Irv0ky5l.js} +16 -16
  78. package/dist/deps-send-whatsapp.runtime-4aOUBP2J.js +60 -0
  79. package/dist/deps-send-whatsapp.runtime-CU257URT.js +119 -0
  80. package/dist/{devices-cli-DlQGTogF.js → devices-cli-CPgutgUT.js} +8 -8
  81. package/dist/{diagnostic-CLEtu0MC.js → diagnostic-B4w80e4D.js} +1 -1
  82. package/dist/{diagnostic-C2lklhkn.js → diagnostic-CnVwZNbm.js} +2 -2
  83. package/dist/{diagnostics--O6mo6KH.js → diagnostics-m7hHHbuE.js} +5 -5
  84. package/dist/{directory-cli-K9qIwxYa.js → directory-cli-DqObADBL.js} +7 -7
  85. package/dist/{dns-cli-qtX-WNMF.js → dns-cli-CKbwsWBv.js} +5 -5
  86. package/dist/{dock-DJJAj46v.js → dock-W3cGg46W.js} +4 -4
  87. package/dist/{docs-cli--gGxz79Z.js → docs-cli-BpZtes_j.js} +4 -4
  88. package/dist/{doctor-completion-CZoEdMS-.js → doctor-completion--7PR_Vqz.js} +2 -2
  89. package/dist/{doctor-config-flow-C-h3yV4z.js → doctor-config-flow-BDF7TR6O.js} +15 -15
  90. package/dist/{enable-C8FNY18p.js → enable--Q7yLTZm.js} +1 -1
  91. package/dist/entry.js +2 -2
  92. package/dist/{errors-DfgAh2Ml.js → errors-kkRuS2Cs.js} +1 -1
  93. package/dist/{exec-approvals-allowlist-CtSREgYh.js → exec-approvals-allowlist-B9bcJkGP.js} +1 -1
  94. package/dist/{exec-approvals-cli-BmM4RpVn.js → exec-approvals-cli-homtziYt.js} +16 -16
  95. package/dist/{exec-safe-bin-runtime-policy-CfQeDABF.js → exec-safe-bin-runtime-policy-DECo77U6.js} +2 -2
  96. package/dist/{fetch-b8tSR7_e.js → fetch-DP-JjB6Z.js} +5 -5
  97. package/dist/{fetch-guard-D16tjNsZ.js → fetch-guard-BDy975wP.js} +2 -2
  98. package/dist/{fetch-guard-Dvzi3MjK.js → fetch-guard-CbtWqa1E.js} +1 -1
  99. package/dist/{fetch-CtoC2wgs.js → fetch-lq0SDLLE.js} +3 -3
  100. package/dist/{frontmatter-CjKtFduT.js → frontmatter-Cq1TcIQ2.js} +3 -3
  101. package/dist/fs-safe-BPQ-per2.js +352 -0
  102. package/dist/{fs-safe-CwHbZdFH.js → fs-safe-BoB4X3GD.js} +4 -4
  103. package/dist/{gateway-cli-BJHBChfI.js → gateway-cli-B3oqskb4.js} +153 -153
  104. package/dist/{gateway-rpc-D0AmaBzR.js → gateway-rpc-BBBN9ZJk.js} +1 -1
  105. package/dist/{github-copilot-token-Cw3tAXM9.js → github-copilot-token-B5cPlwaz.js} +7 -7
  106. package/dist/{health-XFKFZ7ZJ.js → health-CjXrJkCb.js} +11 -11
  107. package/dist/{hooks-cli-CXsZK8H9.js → hooks-cli--aKmd8c9.js} +81 -81
  108. package/dist/{hooks-status-DMFBAUq8.js → hooks-status-BlgSVDvN.js} +1 -1
  109. package/dist/{image-DSWTfuxv.js → image-BcYt63Jx.js} +5 -5
  110. package/dist/{image-ByqExb8z.js → image-kKMG59st.js} +6 -6
  111. package/dist/{image-ops-BoN1E_WZ.js → image-ops-Dg8iraUV.js} +2 -2
  112. package/dist/{image-ops-B2uuLIGD.js → image-ops-LFsSCTyI.js} +10 -10
  113. package/dist/image-runtime-BqIv7p_K.js +29 -0
  114. package/dist/image-runtime-Cxoxcx04.js +55 -0
  115. package/dist/{inspect-4c1uL0x5.js → inspect-CzsXBsew.js} +4 -4
  116. package/dist/{install-safe-path-3muwy3fu.js → install-safe-path-DqI19VEv.js} +25 -25
  117. package/dist/{installs-BiQDtPF0.js → installs-P-pYAJm1.js} +9 -9
  118. package/dist/{ipv4-sHllwvAI.js → ipv4-B95173MB.js} +1 -1
  119. package/dist/{ir-BukzlgSp.js → ir-C7He5vmn.js} +8 -8
  120. package/dist/{ir-Dut0zXyS.js → ir-CKK03mBV.js} +8 -8
  121. package/dist/{issue-format-DCcINW-9.js → issue-format-CbTfB8Hy.js} +1 -1
  122. package/dist/{json-files-CuJjdF_0.js → json-files-rR19q30D.js} +8 -8
  123. package/dist/{legacy-names-B0wgIP0Q.js → legacy-names-aGJJuzM_.js} +1 -1
  124. package/dist/{lifecycle-core-CqFEhwHn.js → lifecycle-core-ChKClWdw.js} +5 -5
  125. package/dist/llm-slug-generator.js +51 -51
  126. package/dist/{logger-oGKcCLZ5.js → logger-CnTSBL7T.js} +7 -7
  127. package/dist/{login-DJ357UQV.js → login-CeKDrz6_.js} +5 -5
  128. package/dist/{login-zoeewfBu.js → login-CjzRATwO.js} +3 -3
  129. package/dist/{login-qr-B8P_EAd-.js → login-qr-CX0rs3A6.js} +6 -6
  130. package/dist/{login-qr-C0fDBnpM.js → login-qr-KbOpR0GQ.js} +10 -10
  131. package/dist/{logs-cli-D30BUN6y.js → logs-cli-DvHsw1WZ.js} +9 -9
  132. package/dist/{manager-5OzUkYLf.js → manager-BVfTfggO.js} +14 -14
  133. package/dist/{manager-BPGhs30n.js → manager-DINhLnMi.js} +13 -13
  134. package/dist/{manager-runtime-BxXpVt3x.js → manager-runtime-BXJJSlzC.js} +9 -9
  135. package/dist/manager-runtime-D6ckUNSs.js +18 -0
  136. package/dist/{manifest-registry-7kwtbCH-.js → manifest-registry-1ACGW3OR.js} +1 -1
  137. package/dist/{memory-cli-Dj8tyFtt.js → memory-cli-u8eyO3Ec.js} +12 -12
  138. package/dist/{model-B8p-EsdJ.js → model-D7hZpWTB.js} +2 -2
  139. package/dist/{model-catalog-BWuvEv1x.js → model-catalog-Drh9Rois.js} +3 -3
  140. package/dist/{model-picker-CLhaaagi.js → model-picker-DK_vvKCV.js} +4 -4
  141. package/dist/{model-selection-CHnojCCK.js → model-selection-DuNLFQPR.js} +43 -43
  142. package/dist/{models-5VXwJBU2.js → models-CFXLX9IF.js} +17 -17
  143. package/dist/{models-cli-Br56IHfy.js → models-cli-PHQyKESa.js} +78 -78
  144. package/dist/{models-config-poV-4Xlx.js → models-config-DAastTau.js} +6 -6
  145. package/dist/{net-CCnbGop3.js → net-CIh5ellr.js} +2 -2
  146. package/dist/{node-cli-C8hvYquX.js → node-cli-o9qcU9GJ.js} +33 -33
  147. package/dist/{node-command-policy-B_D5ucTj.js → node-command-policy-BeTSnoyk.js} +1 -1
  148. package/dist/{node-service-Z0JprJda.js → node-service-OVe0_CIs.js} +1 -1
  149. package/dist/{nodes-cli-IIc8fTKT.js → nodes-cli-kGx_Qa3c.js} +16 -16
  150. package/dist/{nodes-screen-DFFmbaXE.js → nodes-screen-BrMJzhot.js} +7 -7
  151. package/dist/{npm-pack-install-B887us7R.js → npm-pack-install-Dn3FiWXB.js} +18 -18
  152. package/dist/{npm-resolution-CKtyq4FH.js → npm-resolution-ky_uAlXE.js} +4 -4
  153. package/dist/{onboard-lFwpCpC3.js → onboard-D1Qy64JK.js} +6 -6
  154. package/dist/{onboard-channels-_kVo3Apf.js → onboard-channels-oJCC_sJX.js} +21 -21
  155. package/dist/{onboard-custom-CZtjqrY7.js → onboard-custom-CRpsaM3g.js} +4 -4
  156. package/dist/{onboard-helpers-BP429__H.js → onboard-helpers-DwEZeaoe.js} +10 -10
  157. package/dist/{onboard-hooks-CTbjgLDl.js → onboard-hooks-DyxckB2C.js} +4 -4
  158. package/dist/{onboard-remote-BlZB0AE9.js → onboard-remote-ZgpWNq9Z.js} +4 -4
  159. package/dist/{onboard-skills-BT2YOXeP.js → onboard-skills-DEijVfCg.js} +4 -4
  160. package/dist/{onboarding-EEd_g8Zg.js → onboarding-Mxqy4O1E.js} +14 -14
  161. package/dist/{onboarding.finalize-Cs1ukjFN.js → onboarding.finalize-DiOMx6A5.js} +90 -90
  162. package/dist/{onboarding.gateway-config-C6N8r5Is.js → onboarding.gateway-config-9wkBCzzO.js} +18 -18
  163. package/dist/{onboarding.secret-input-BTK1IG-J.js → onboarding.secret-input-DRnoQSlI.js} +1 -1
  164. package/dist/{openai-model-default-COzeuAI4.js → openai-model-default-DqE4bNtd.js} +2 -2
  165. package/dist/{outbound-qTioiTJg.js → outbound-C9svt6RH.js} +6 -6
  166. package/dist/{outbound-B7m9Vcd2.js → outbound-CwzUo-rx.js} +3 -3
  167. package/dist/{outbound-attachment-fdEhzyl9.js → outbound-attachment-Bedqixj2.js} +2 -2
  168. package/dist/{outbound-attachment-rlW7G5df.js → outbound-attachment-DwupUxYF.js} +2 -2
  169. package/dist/{pairing-cli-NhoRKes6.js → pairing-cli-CsYP0at7.js} +8 -8
  170. package/dist/{pairing-labels-CnTvFrUT.js → pairing-labels-CX4CtqRa.js} +1 -1
  171. package/dist/{pairing-store-D0eOXyby.js → pairing-store-BC4mnG9S.js} +3 -3
  172. package/dist/{path-alias-guards-Cpsiv2KL.js → path-alias-guards-DORgbZ1w.js} +1 -1
  173. package/dist/path-alias-guards-DeOVetT7.js +43 -0
  174. package/dist/{path-safety-C95DzArw.js → path-safety-D7CjFQvf.js} +1 -1
  175. package/dist/{paths-DfuVHiHu.js → paths-D6mnO6Ni.js} +9 -9
  176. package/dist/{paths-CSdAWKDO.js → paths-DA5srn0U.js} +5 -5
  177. package/dist/{paths-CXClY8zC.js → paths-DSd911Oe.js} +4 -4
  178. package/dist/{pi-embedded-DUtpCH0X.js → pi-embedded-BiC4tIJ8.js} +162 -162
  179. package/dist/{pi-embedded-helpers-CYR1UemI.js → pi-embedded-helpers-Di58J7Eh.js} +52 -52
  180. package/dist/{pi-embedded-helpers-qCAK_a65.js → pi-embedded-helpers-DtCOZSv-.js} +6 -6
  181. package/dist/{pi-model-discovery-CKUePiDc.js → pi-model-discovery-Cr1q2cJt.js} +1 -1
  182. package/dist/pi-model-discovery-V-InbjOM.js +134 -0
  183. package/dist/pi-model-discovery-runtime--t6tAlar.js +11 -0
  184. package/dist/{pi-model-discovery-runtime-CNLKih0w.js → pi-model-discovery-runtime-BHmdAKBK.js} +5 -5
  185. package/dist/{pi-tools.before-tool-call.runtime-B_LUttg1.js → pi-tools.before-tool-call.runtime-Bpk4qTgV.js} +9 -9
  186. package/dist/{pi-tools.before-tool-call.runtime-Bba7rXQq.js → pi-tools.before-tool-call.runtime-duKHqrMc.js} +5 -5
  187. package/dist/{pi-tools.policy-BwWnFLLV.js → pi-tools.policy-D3RA94WF.js} +5 -5
  188. package/dist/{plugin-auto-enable-DJkHW_LG.js → plugin-auto-enable-a3TK3OPT.js} +3 -3
  189. package/dist/{plugin-registry-D3PnPE1D.js → plugin-registry-CFqqDqQV.js} +3 -3
  190. package/dist/plugin-sdk/accounts-CUEuUR3C.js +46 -0
  191. package/dist/plugin-sdk/accounts-D0W2pELU.js +288 -0
  192. package/dist/plugin-sdk/accounts-ucj0odJq.js +35 -0
  193. package/dist/plugin-sdk/active-listener-BO7eBEG_.js +50 -0
  194. package/dist/plugin-sdk/api-key-rotation-C4C_mDsg.js +181 -0
  195. package/dist/plugin-sdk/audio-preflight-Cqdo0JKm.js +69 -0
  196. package/dist/plugin-sdk/audio-transcription-runner-DnEooIyE.js +2176 -0
  197. package/dist/plugin-sdk/audit-membership-runtime-B9b-zRwg.js +58 -0
  198. package/dist/plugin-sdk/channel-activity-BMWLw4o2.js +94 -0
  199. package/dist/plugin-sdk/channel-web-B8bj7MB9.js +2256 -0
  200. package/dist/plugin-sdk/chrome-CV-q0Lmc.js +2415 -0
  201. package/dist/plugin-sdk/commands-registry-e7YoqrbP.js +1125 -0
  202. package/dist/plugin-sdk/config-B2B64aX0.js +17911 -0
  203. package/dist/plugin-sdk/deliver-BkyBtcLR.js +1694 -0
  204. package/dist/plugin-sdk/deliver-runtime-O4lwAWMw.js +32 -0
  205. package/dist/plugin-sdk/deps-send-discord.runtime-BAeeBldY.js +23 -0
  206. package/dist/plugin-sdk/deps-send-imessage.runtime-EL-CfikZ.js +22 -0
  207. package/dist/plugin-sdk/deps-send-signal.runtime-BeemHeUu.js +21 -0
  208. package/dist/plugin-sdk/deps-send-slack.runtime-DTttkC0N.js +19 -0
  209. package/dist/plugin-sdk/deps-send-telegram.runtime-Dsf9Cnka.js +24 -0
  210. package/dist/plugin-sdk/deps-send-whatsapp.runtime-DvdFo6lj.js +57 -0
  211. package/dist/plugin-sdk/diagnostic-DPRVoKTk.js +319 -0
  212. package/dist/plugin-sdk/discord.js +6 -6
  213. package/dist/plugin-sdk/errors-B8oJXuCF.js +54 -0
  214. package/dist/plugin-sdk/fetch-guard-F0Fnqisy.js +156 -0
  215. package/dist/{fs-safe-DPYj7h8A.js → plugin-sdk/fs-safe-Dqmpk-Fr.js} +6 -6
  216. package/dist/plugin-sdk/image-cBW8L8pp.js +2310 -0
  217. package/dist/plugin-sdk/image-ops-BP8ix1GC.js +584 -0
  218. package/dist/plugin-sdk/image-runtime-9xkgSlNz.js +25 -0
  219. package/dist/plugin-sdk/index.js +50 -50
  220. package/dist/plugin-sdk/ir-DWEc6zOp.js +1296 -0
  221. package/dist/plugin-sdk/local-roots-BIPT8uAO.js +186 -0
  222. package/dist/plugin-sdk/logger-DDdrdbDu.js +1163 -0
  223. package/dist/plugin-sdk/login-BMTiGutN.js +57 -0
  224. package/dist/plugin-sdk/login-qr-BFxqYUkc.js +320 -0
  225. package/dist/plugin-sdk/manager-BD-aYaZ8.js +3917 -0
  226. package/dist/plugin-sdk/manager-runtime-C5bRwUlz.js +15 -0
  227. package/dist/plugin-sdk/outbound-Bm07xvO6.js +212 -0
  228. package/dist/plugin-sdk/outbound-attachment-DLsaxDsc.js +19 -0
  229. package/dist/{path-alias-guards-vfYYQFIg.js → plugin-sdk/path-alias-guards-gBhrAn14.js} +1 -1
  230. package/dist/plugin-sdk/paths-C6W4VHoa.js +166 -0
  231. package/dist/plugin-sdk/pi-embedded-helpers-BExwPvTh.js +9627 -0
  232. package/dist/{pi-model-discovery-o-WX5w2t.js → plugin-sdk/pi-model-discovery-DdctvBeX.js} +2 -2
  233. package/dist/plugin-sdk/pi-model-discovery-runtime-DrtpLJjk.js +8 -0
  234. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-rgTz3FBl.js +354 -0
  235. package/dist/plugin-sdk/plugins-BN64HHZA.js +864 -0
  236. package/dist/{proxy-fetch-C2v-Utgg.js → plugin-sdk/proxy-fetch-ZPEvp58f.js} +1 -1
  237. package/dist/plugin-sdk/pw-ai-DBm3RdBK.js +1938 -0
  238. package/dist/{qmd-manager-BkSWV1Q1.js → plugin-sdk/qmd-manager-6bozlfFg.js} +11 -17
  239. package/dist/plugin-sdk/query-expansion-eeVz_aEm.js +1011 -0
  240. package/dist/{redact-NmPEVjIo.js → plugin-sdk/redact-BoNEjbpF.js} +1 -1
  241. package/dist/plugin-sdk/reply-Bp49JV3f.js +98828 -0
  242. package/dist/plugin-sdk/resolve-outbound-target-DXfjGlZQ.js +40 -0
  243. package/dist/plugin-sdk/run-with-concurrency-5DMu9szx.js +1994 -0
  244. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-D2hkJBa-.js +10 -0
  245. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-C06I4adi.js +19 -0
  246. package/dist/plugin-sdk/send-B9xnwtQ-.js +540 -0
  247. package/dist/plugin-sdk/send-BxySs-Cu.js +2587 -0
  248. package/dist/plugin-sdk/send-D9THKp_J.js +414 -0
  249. package/dist/plugin-sdk/send-DCuaaP2w.js +503 -0
  250. package/dist/plugin-sdk/send-Dm_-_xje.js +3135 -0
  251. package/dist/plugin-sdk/session-DDzIZHxt.js +169 -0
  252. package/dist/plugin-sdk/signal.js +2 -2
  253. package/dist/plugin-sdk/skill-commands-DRvqtuFC.js +342 -0
  254. package/dist/plugin-sdk/skills-BWwlfbVj.js +1428 -0
  255. package/dist/plugin-sdk/slash-commands.runtime-BzYsaTST.js +13 -0
  256. package/dist/plugin-sdk/slash-dispatch.runtime-Cty8EAD9.js +52 -0
  257. package/dist/plugin-sdk/slash-skill-commands.runtime-sg98L8BK.js +16 -0
  258. package/dist/plugin-sdk/ssrf-DOBwjFow.js +202 -0
  259. package/dist/plugin-sdk/store-BKDR_-Qk.js +81 -0
  260. package/dist/plugin-sdk/subagent-registry-runtime-Dz50ieim.js +52 -0
  261. package/dist/plugin-sdk/tables-GIj79us5.js +55 -0
  262. package/dist/{target-errors-D0ZJUbbf.js → plugin-sdk/target-errors-jlLHihbX.js} +2 -2
  263. package/dist/plugin-sdk/thinking-BgdUnMZ2.js +1206 -0
  264. package/dist/{tokens-D2XhLqIz.js → plugin-sdk/tokens-CTIYTLWu.js} +1 -1
  265. package/dist/plugin-sdk/tool-images-GSlvf6RP.js +274 -0
  266. package/dist/plugin-sdk/web-BK9mCTAc.js +56 -0
  267. package/dist/plugin-sdk/whatsapp-actions-DQpK_5Ds.js +80 -0
  268. package/dist/{plugins-BDTkSIi7.js → plugins-Bc7YM9X-.js} +2 -2
  269. package/dist/{plugins-AqsVZZk3.js → plugins-DvejjZnJ.js} +11 -11
  270. package/dist/{plugins-cli-BA_2daJe.js → plugins-cli-vQi8tFye.js} +83 -83
  271. package/dist/{ports-Be82TlEg.js → ports-BzfeaNjw.js} +1 -1
  272. package/dist/{ports-0jLyYbvQ.js → ports-DMeUt80n.js} +2 -2
  273. package/dist/{program-D_xdLzmM.js → program-Nott_VTb.js} +81 -81
  274. package/dist/{prompt-select-styled-BsheNEnh.js → prompt-select-styled-7mnlZgrQ.js} +40 -40
  275. package/dist/{provider-auth-helpers-B5kD4Lt6.js → provider-auth-helpers-_77rN3Zc.js} +5 -5
  276. package/dist/{proxy-env-CQTuxZoS.js → proxy-env-BiKHVg2h.js} +1 -1
  277. package/dist/{proxy-env-DXXfs2WL.js → proxy-env-D-fike7s.js} +1 -1
  278. package/dist/proxy-fetch-lH6RsRTE.js +38 -0
  279. package/dist/{push-apns-BbenjEX4.js → push-apns-Ce1zzNYB.js} +5 -5
  280. package/dist/{pw-ai-1NQPuno2.js → pw-ai-B8ymIYub.js} +14 -14
  281. package/dist/{pw-ai-wo5t_KO_.js → pw-ai-CAhTwexx.js} +18 -18
  282. package/dist/{qmd-manager-CO-shcLU.js → qmd-manager-BN0siR2Z.js} +10 -10
  283. package/dist/qmd-manager-BsL_hcOB.js +1454 -0
  284. package/dist/{qr-cli-DSMYIp-D.js → qr-cli-DzjBpGix.js} +2 -2
  285. package/dist/{query-expansion-DI9INxTg.js → query-expansion-C0HUJbRn.js} +12 -12
  286. package/dist/{query-expansion-DlQOkf-g.js → query-expansion-Dzxt6kXo.js} +6 -6
  287. package/dist/redact-DvzicBMu.js +319 -0
  288. package/dist/{redact-snapshot-B2YFI3cO.js → redact-snapshot-C0McNGqh.js} +1 -1
  289. package/dist/{register.agent-Dk_5V5oA.js → register.agent-DtjNdvUh.js} +94 -94
  290. package/dist/register.configure-BkwbM-hb.js +165 -0
  291. package/dist/{register.maintenance-CluQOq8b.js → register.maintenance-DERKsSgi.js} +95 -95
  292. package/dist/{register.message-BCTXT5yK.js → register.message-DkYxt6gZ.js} +74 -74
  293. package/dist/{register.onboard-C64oXnvq.js → register.onboard-BtfW83M0.js} +18 -18
  294. package/dist/{register.setup-Dl3nk2Ui.js → register.setup-Ba9gMkRk.js} +21 -21
  295. package/dist/{register.status-health-sessions-BHtbPeCO.js → register.status-health-sessions-BILdpWJV.js} +88 -88
  296. package/dist/{register.subclis-CDMFyaKR.js → register.subclis-Dfm_Zu31.js} +31 -31
  297. package/dist/{rpc-DA9IhLVG.js → rpc-mau2U4RG.js} +1 -1
  298. package/dist/{run-main-BcA22Ipv.js → run-main-BF7ybLIy.js} +93 -93
  299. package/dist/{run-with-concurrency-FczpX8ng.js → run-with-concurrency-BFR3ReeF.js} +4 -4
  300. package/dist/{runtime-BnbzNRr6.js → runtime-Bcmv4Epp.js} +3 -3
  301. package/dist/{runtime-config-collectors-CXJdhHRo.js → runtime-config-collectors-Bsjz4isf.js} +1 -1
  302. package/dist/{runtime-whatsapp-login.runtime-DRoK8G8H.js → runtime-whatsapp-login.runtime-COUEKxmy.js} +7 -7
  303. package/dist/runtime-whatsapp-login.runtime-DxV9iv6l.js +13 -0
  304. package/dist/{runtime-whatsapp-outbound.runtime-C9OiwkWh.js → runtime-whatsapp-outbound.runtime-BaWH6-ns.js} +15 -15
  305. package/dist/runtime-whatsapp-outbound.runtime-DQqIlwhS.js +22 -0
  306. package/dist/{sandbox-cli-BwK2slfh.js → sandbox-cli-DOxm7fjR.js} +25 -25
  307. package/dist/{sandbox-C3TbYIHd.js → sandbox-ixDhkfHu.js} +18 -18
  308. package/dist/{secrets-cli-Beu2lcrf.js → secrets-cli-DvXznMUb.js} +11 -11
  309. package/dist/{security-cli-CcpKH_lC.js → security-cli-3WOXvJR-.js} +42 -42
  310. package/dist/{send-Bx9CqcZr.js → send-4nRsZJXH.js} +7 -7
  311. package/dist/{send-D5D0ZGht.js → send-BGlcHjUD.js} +26 -26
  312. package/dist/{send-EVcbFVqn.js → send-BPgrWmUX.js} +5 -5
  313. package/dist/{send-DtHQ7_6Z.js → send-BTUU1jWM.js} +8 -8
  314. package/dist/{send-RDqyJwZx.js → send-BVyLW1cn.js} +8 -8
  315. package/dist/{send-z-sMjqvX.js → send-BpkluEZ5.js} +4 -4
  316. package/dist/{send-CLI3CiQv.js → send-BuBTLRMz.js} +6 -6
  317. package/dist/{send-B9H0BkfO.js → send-DdBbRpTP.js} +6 -6
  318. package/dist/{send-DEs83M9V.js → send-Do2preUU.js} +11 -11
  319. package/dist/{send-B5QEmMJ4.js → send-dTQd-IyJ.js} +5 -5
  320. package/dist/{server-Bm-IxvZZ.js → server-DMAPnkgM.js} +20 -20
  321. package/dist/{server-context-Dw_4lGoI.js → server-context-Dd8UynDU.js} +12 -12
  322. package/dist/{server-lifecycle-DYgHYif9.js → server-lifecycle-BEZ2jsQ6.js} +2 -2
  323. package/dist/{server-middleware-BVAEuQs7.js → server-middleware-B_LyQkOL.js} +1 -1
  324. package/dist/{server-node-events-Q0cT2ifj.js → server-node-events-dr5CaM3M.js} +74 -74
  325. package/dist/{service-DSqxS6_D.js → service-B5T42CWZ.js} +15 -15
  326. package/dist/{session-DLTCuoUD.js → session-CnCwDJke.js} +8 -8
  327. package/dist/{session-D0jodcgT.js → session-eXSdl5mb.js} +1 -1
  328. package/dist/{session-utils-XY6JwRhT.js → session-utils-D12gSo5W.js} +6 -6
  329. package/dist/{sessions-CMqv9JEu.js → sessions-C16G7L5c.js} +4 -4
  330. package/dist/{sessions-BWptzMw0.js → sessions-DgnXAQCc.js} +15 -15
  331. package/dist/{shared-BbVxcRzb.js → shared-BYny1RCF.js} +3 -3
  332. package/dist/{shared-D5DTxBPH.js → shared-By6_qr_R.js} +1 -1
  333. package/dist/{skill-commands-fU-Mejn9.js → skill-commands-BcigmiOW.js} +5 -5
  334. package/dist/{skill-commands-BwTLQRR8.js → skill-commands-Cz45_nme.js} +9 -9
  335. package/dist/{skill-scanner-CvS725eQ.js → skill-scanner--QKHR8U0.js} +6 -6
  336. package/dist/{skills-B9N2bqKU.js → skills-CdCS1HeL.js} +22 -22
  337. package/dist/{skills-C85azDXm.js → skills-EwyaIyKC.js} +3 -3
  338. package/dist/{skills-cli-ZXx6BNar.js → skills-cli-CqEjN0Yj.js} +5 -5
  339. package/dist/{skills-install-KD6dzNoZ.js → skills-install-CXVKvhIE.js} +6 -6
  340. package/dist/{skills-status-DkO7rxE8.js → skills-status-Bv8Xt7Lc.js} +1 -1
  341. package/dist/{slash-commands.runtime-CPlXJtuM.js → slash-commands.runtime-Bi99B_EP.js} +11 -11
  342. package/dist/slash-commands.runtime-CZz6v6b3.js +16 -0
  343. package/dist/slash-dispatch.runtime-SO7HOe8q.js +56 -0
  344. package/dist/slash-dispatch.runtime-reuPLnse.js +114 -0
  345. package/dist/slash-skill-commands.runtime-Bawt7j0r.js +20 -0
  346. package/dist/{slash-skill-commands.runtime-Cnfq_5LN.js → slash-skill-commands.runtime-DOXmvOtU.js} +15 -15
  347. package/dist/{squidclaw-root-BQfLymzj.js → squidclaw-root-JXyRbQLJ.js} +8 -8
  348. package/dist/{status-cU9cJReo.js → status-Dnl-Um1D.js} +27 -27
  349. package/dist/{status.update-CiLU9RPF.js → status.update-BGIm6we4.js} +2 -2
  350. package/dist/{store-BEIcnlgx.js → store-BTkIx401.js} +5 -5
  351. package/dist/{store-CvQ41zCV.js → store-D9z0dn7D.js} +2 -2
  352. package/dist/{subagent-registry-CIgFD2oi.js → subagent-registry-CQA6P2FO.js} +149 -149
  353. package/dist/subagent-registry-runtime-CqgIWcSl.js +114 -0
  354. package/dist/subagent-registry-runtime-D2rUxU5J.js +56 -0
  355. package/dist/{subsystem-BaLYRf7D.js → subsystem-6v7sWnAD.js} +14 -14
  356. package/dist/{system-cli-i1FWZDjn.js → system-cli-CJAQxYHv.js} +9 -9
  357. package/dist/{system-run-command-COqCNIBg.js → system-run-command-BaSqmSwR.js} +1 -1
  358. package/dist/{systemd-Cj2cX_ZP.js → systemd-B86VePXs.js} +9 -9
  359. package/dist/{systemd-hints-46PqJfaq.js → systemd-hints-BmFWZu_j.js} +6 -6
  360. package/dist/{systemd-linger-6Jd9K5p2.js → systemd-linger-w7fvBU-1.js} +1 -1
  361. package/dist/{tables-BRYYxYs7.js → tables-BTFiZyRU.js} +1 -1
  362. package/dist/{tables-CIpKClDV.js → tables-CGh4CW_h.js} +1 -1
  363. package/dist/{tailnet-CZANZjq6.js → tailnet-DJq7Mi1o.js} +1 -1
  364. package/dist/target-errors-C_rnMuJ2.js +195 -0
  365. package/dist/{target-errors-CRQlPF1u.js → target-errors-DgNRx3Nr.js} +2 -2
  366. package/dist/{thinking-B-A99X3F.js → thinking-B75CXkTT.js} +7 -7
  367. package/dist/tokens-DfbMVF9y.js +52 -0
  368. package/dist/{tool-images-CyzWvDUu.js → tool-images-D6mmxuWS.js} +1 -1
  369. package/dist/{tool-images-Zn6jVmkX.js → tool-images-Dp5OiXeA.js} +2 -2
  370. package/dist/{tui-CC_AbfZr.js → tui-BbcmzKaA.js} +6 -6
  371. package/dist/{tui-cli-DiJ7zKUD.js → tui-cli-Dv3jSm3x.js} +32 -32
  372. package/dist/{update-1JhjCqjy.js → update-BhRrb6BI.js} +3 -3
  373. package/dist/{update-cli-DM_dUip_.js → update-cli-Oe0fP8x9.js} +104 -104
  374. package/dist/{update-runner-BBJZmfZ4.js → update-runner-DdA6xBa9.js} +16 -16
  375. package/dist/{web-CEdWU_u3.js → web-QsxgXbNK.js} +55 -55
  376. package/dist/web-w04Gvwqi.js +118 -0
  377. package/dist/{webhooks-cli-CzDd8ikc.js → webhooks-cli-CJLug1QH.js} +6 -6
  378. package/dist/{whatsapp-actions-Cuy0qeQK.js → whatsapp-actions-CzqsuSGx.js} +21 -21
  379. package/dist/{whatsapp-actions-MR_bBjXO.js → whatsapp-actions-_ca5OtHq.js} +17 -17
  380. package/dist/{with-timeout-BZ_Teugb.js → with-timeout-CFfRudNc.js} +3 -3
  381. package/dist/{workspace-D5vNjk5G.js → workspace-BbO-M3Jv.js} +1 -1
  382. package/dist/{workspace-dirs-CjMIsQti.js → workspace-dirs-D8D-Ghcl.js} +1 -1
  383. package/dist/{workspace-TqfVSQuO.js → workspace-kVMIaBrV.js} +20 -20
  384. package/dist/{wsl-CvQfS6aU.js → wsl-CsGe5QCP.js} +2 -2
  385. package/package.json +1 -1
  386. package/dist/deliver-runtime-B6NtHUuv.js +0 -36
  387. package/dist/deliver-runtime-C08pF1_3.js +0 -61
  388. package/dist/deps-send-discord.runtime-CUTAK2hy.js +0 -26
  389. package/dist/deps-send-discord.runtime-r80y9aXF.js +0 -36
  390. package/dist/deps-send-imessage.runtime-BmocBgPM.js +0 -35
  391. package/dist/deps-send-imessage.runtime-CQOiEIuA.js +0 -25
  392. package/dist/deps-send-signal.runtime-ByJt6qz-.js +0 -34
  393. package/dist/deps-send-signal.runtime-wN7MkzLw.js +0 -24
  394. package/dist/deps-send-slack.runtime-C3UUEG9J.js +0 -32
  395. package/dist/deps-send-slack.runtime-HEEwW4uU.js +0 -22
  396. package/dist/deps-send-telegram.runtime-DHlcnjQO.js +0 -27
  397. package/dist/deps-send-whatsapp.runtime-C2x2R2Ow.js +0 -60
  398. package/dist/deps-send-whatsapp.runtime-__ogpmJj.js +0 -119
  399. package/dist/image-runtime-BSVF52oe.js +0 -29
  400. package/dist/image-runtime-cza2NTiZ.js +0 -55
  401. package/dist/manager-runtime-BB9lcoFR.js +0 -18
  402. package/dist/pi-model-discovery-runtime-DBkQoIJw.js +0 -11
  403. package/dist/register.configure-C8OFfGln.js +0 -165
  404. package/dist/runtime-whatsapp-login.runtime-DumUjKRz.js +0 -13
  405. package/dist/runtime-whatsapp-outbound.runtime-Cgu2MfqR.js +0 -22
  406. package/dist/slash-commands.runtime-CjBXruwG.js +0 -16
  407. package/dist/slash-dispatch.runtime-BOMEVFk0.js +0 -114
  408. package/dist/slash-dispatch.runtime-CGd3HarH.js +0 -56
  409. package/dist/slash-skill-commands.runtime-DYK20Lxf.js +0 -20
  410. package/dist/subagent-registry-runtime-DGTjU9Lb.js +0 -114
  411. package/dist/subagent-registry-runtime-m9bFJFix.js +0 -56
  412. package/dist/web-CZhZC1EA.js +0 -118
@@ -0,0 +1,352 @@
1
+ import { _ as expandHomePrefix } from "./paths-CHIu6D1E.js";
2
+ import { d as hasNodeErrorCode, f as isNotFoundPathError, m as isSymlinkOpenError, p as isPathInside, s as sameFileIdentity } from "./squidclaw-root-JXyRbQLJ.js";
3
+ import { i as logWarn } from "./logger-DL3N22PJ.js";
4
+ import { n as assertNoPathAliasEscape } from "./path-alias-guards-DeOVetT7.js";
5
+ import os from "node:os";
6
+ import path from "node:path";
7
+ import { constants } from "node:fs";
8
+ import fsPromises from "node:fs/promises";
9
+ import { randomUUID } from "node:crypto";
10
+ import { pipeline } from "node:stream/promises";
11
+
12
+ //#region src/infra/fs-safe.ts
13
+ var SafeOpenError = class extends Error {
14
+ constructor(code, message, options) {
15
+ super(message, options);
16
+ this.code = code;
17
+ this.name = "SafeOpenError";
18
+ }
19
+ };
20
+ const SUPPORTS_NOFOLLOW = process.platform !== "win32" && "O_NOFOLLOW" in constants;
21
+ const OPEN_READ_FLAGS = constants.O_RDONLY | (SUPPORTS_NOFOLLOW ? constants.O_NOFOLLOW : 0);
22
+ const OPEN_WRITE_EXISTING_FLAGS = constants.O_WRONLY | (SUPPORTS_NOFOLLOW ? constants.O_NOFOLLOW : 0);
23
+ const OPEN_WRITE_CREATE_FLAGS = constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | (SUPPORTS_NOFOLLOW ? constants.O_NOFOLLOW : 0);
24
+ const ensureTrailingSep = (value) => value.endsWith(path.sep) ? value : value + path.sep;
25
+ async function expandRelativePathWithHome(relativePath) {
26
+ let home = process.env.HOME || process.env.USERPROFILE || os.homedir();
27
+ try {
28
+ home = await fsPromises.realpath(home);
29
+ } catch {}
30
+ return expandHomePrefix(relativePath, { home });
31
+ }
32
+ async function openVerifiedLocalFile(filePath, options) {
33
+ try {
34
+ if ((await fsPromises.lstat(filePath)).isDirectory()) throw new SafeOpenError("not-file", "not a file");
35
+ } catch (err) {
36
+ if (err instanceof SafeOpenError) throw err;
37
+ }
38
+ let handle;
39
+ try {
40
+ handle = await fsPromises.open(filePath, OPEN_READ_FLAGS);
41
+ } catch (err) {
42
+ if (isNotFoundPathError(err)) throw new SafeOpenError("not-found", "file not found");
43
+ if (isSymlinkOpenError(err)) throw new SafeOpenError("symlink", "symlink open blocked", { cause: err });
44
+ if (hasNodeErrorCode(err, "EISDIR")) throw new SafeOpenError("not-file", "not a file");
45
+ throw err;
46
+ }
47
+ try {
48
+ const [stat, lstat] = await Promise.all([handle.stat(), fsPromises.lstat(filePath)]);
49
+ if (lstat.isSymbolicLink()) throw new SafeOpenError("symlink", "symlink not allowed");
50
+ if (!stat.isFile()) throw new SafeOpenError("not-file", "not a file");
51
+ if (options?.rejectHardlinks && stat.nlink > 1) throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
52
+ if (!sameFileIdentity(stat, lstat)) throw new SafeOpenError("path-mismatch", "path changed during read");
53
+ const realPath = await fsPromises.realpath(filePath);
54
+ const realStat = await fsPromises.stat(realPath);
55
+ if (options?.rejectHardlinks && realStat.nlink > 1) throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
56
+ if (!sameFileIdentity(stat, realStat)) throw new SafeOpenError("path-mismatch", "path mismatch");
57
+ return {
58
+ handle,
59
+ realPath,
60
+ stat
61
+ };
62
+ } catch (err) {
63
+ await handle.close().catch(() => {});
64
+ if (err instanceof SafeOpenError) throw err;
65
+ if (isNotFoundPathError(err)) throw new SafeOpenError("not-found", "file not found");
66
+ throw err;
67
+ }
68
+ }
69
+ async function resolvePathWithinRoot(params) {
70
+ let rootReal;
71
+ try {
72
+ rootReal = await fsPromises.realpath(params.rootDir);
73
+ } catch (err) {
74
+ if (isNotFoundPathError(err)) throw new SafeOpenError("not-found", "root dir not found");
75
+ throw err;
76
+ }
77
+ const rootWithSep = ensureTrailingSep(rootReal);
78
+ const expanded = await expandRelativePathWithHome(params.relativePath);
79
+ const resolved = path.resolve(rootWithSep, expanded);
80
+ if (!isPathInside(rootWithSep, resolved)) throw new SafeOpenError("outside-workspace", "file is outside workspace root");
81
+ return {
82
+ rootReal,
83
+ rootWithSep,
84
+ resolved
85
+ };
86
+ }
87
+ async function openFileWithinRoot(params) {
88
+ const { rootWithSep, resolved } = await resolvePathWithinRoot(params);
89
+ let opened;
90
+ try {
91
+ opened = await openVerifiedLocalFile(resolved);
92
+ } catch (err) {
93
+ if (err instanceof SafeOpenError) {
94
+ if (err.code === "not-found") throw err;
95
+ throw new SafeOpenError("invalid-path", "path is not a regular file under root", { cause: err });
96
+ }
97
+ throw err;
98
+ }
99
+ if (params.rejectHardlinks !== false && opened.stat.nlink > 1) {
100
+ await opened.handle.close().catch(() => {});
101
+ throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
102
+ }
103
+ if (!isPathInside(rootWithSep, opened.realPath)) {
104
+ await opened.handle.close().catch(() => {});
105
+ throw new SafeOpenError("outside-workspace", "file is outside workspace root");
106
+ }
107
+ return opened;
108
+ }
109
+ async function readFileWithinRoot(params) {
110
+ const opened = await openFileWithinRoot({
111
+ rootDir: params.rootDir,
112
+ relativePath: params.relativePath,
113
+ rejectHardlinks: params.rejectHardlinks
114
+ });
115
+ try {
116
+ return await readOpenedFileSafely({
117
+ opened,
118
+ maxBytes: params.maxBytes
119
+ });
120
+ } finally {
121
+ await opened.handle.close().catch(() => {});
122
+ }
123
+ }
124
+ async function readPathWithinRoot(params) {
125
+ const rootDir = path.resolve(params.rootDir);
126
+ const candidatePath = path.isAbsolute(params.filePath) ? path.resolve(params.filePath) : path.resolve(rootDir, params.filePath);
127
+ return await readFileWithinRoot({
128
+ rootDir,
129
+ relativePath: path.relative(rootDir, candidatePath),
130
+ rejectHardlinks: params.rejectHardlinks,
131
+ maxBytes: params.maxBytes
132
+ });
133
+ }
134
+ function createRootScopedReadFile(params) {
135
+ const rootDir = path.resolve(params.rootDir);
136
+ return async (filePath) => {
137
+ return (await readPathWithinRoot({
138
+ rootDir,
139
+ filePath,
140
+ rejectHardlinks: params.rejectHardlinks,
141
+ maxBytes: params.maxBytes
142
+ })).buffer;
143
+ };
144
+ }
145
+ async function readLocalFileSafely(params) {
146
+ const opened = await openVerifiedLocalFile(params.filePath);
147
+ try {
148
+ return await readOpenedFileSafely({
149
+ opened,
150
+ maxBytes: params.maxBytes
151
+ });
152
+ } finally {
153
+ await opened.handle.close().catch(() => {});
154
+ }
155
+ }
156
+ async function readOpenedFileSafely(params) {
157
+ if (params.maxBytes !== void 0 && params.opened.stat.size > params.maxBytes) throw new SafeOpenError("too-large", `file exceeds limit of ${params.maxBytes} bytes (got ${params.opened.stat.size})`);
158
+ return {
159
+ buffer: await params.opened.handle.readFile(),
160
+ realPath: params.opened.realPath,
161
+ stat: params.opened.stat
162
+ };
163
+ }
164
+ function emitWriteBoundaryWarning(reason) {
165
+ logWarn(`security: fs-safe write boundary warning (${reason})`);
166
+ }
167
+ function buildAtomicWriteTempPath(targetPath) {
168
+ const dir = path.dirname(targetPath);
169
+ const base = path.basename(targetPath);
170
+ return path.join(dir, `.${base}.${process.pid}.${randomUUID()}.tmp`);
171
+ }
172
+ async function writeTempFileForAtomicReplace(params) {
173
+ const tempHandle = await fsPromises.open(params.tempPath, OPEN_WRITE_CREATE_FLAGS, params.mode);
174
+ try {
175
+ if (typeof params.data === "string") await tempHandle.writeFile(params.data, params.encoding ?? "utf8");
176
+ else await tempHandle.writeFile(params.data);
177
+ return await tempHandle.stat();
178
+ } finally {
179
+ await tempHandle.close().catch(() => {});
180
+ }
181
+ }
182
+ async function verifyAtomicWriteResult(params) {
183
+ const rootWithSep = ensureTrailingSep(await fsPromises.realpath(params.rootDir));
184
+ const opened = await openVerifiedLocalFile(params.targetPath, { rejectHardlinks: true });
185
+ try {
186
+ if (!sameFileIdentity(opened.stat, params.expectedStat)) throw new SafeOpenError("path-mismatch", "path changed during write");
187
+ if (!isPathInside(rootWithSep, opened.realPath)) throw new SafeOpenError("outside-workspace", "file is outside workspace root");
188
+ } finally {
189
+ await opened.handle.close().catch(() => {});
190
+ }
191
+ }
192
+ async function resolveOpenedFileRealPathForHandle(handle, ioPath) {
193
+ try {
194
+ return await fsPromises.realpath(ioPath);
195
+ } catch (err) {
196
+ if (!isNotFoundPathError(err)) throw err;
197
+ }
198
+ const fdCandidates = process.platform === "linux" ? [`/proc/self/fd/${handle.fd}`, `/dev/fd/${handle.fd}`] : process.platform === "win32" ? [] : [`/dev/fd/${handle.fd}`];
199
+ for (const fdPath of fdCandidates) try {
200
+ return await fsPromises.realpath(fdPath);
201
+ } catch {}
202
+ throw new SafeOpenError("path-mismatch", "unable to resolve opened file path");
203
+ }
204
+ async function openWritableFileWithinRoot(params) {
205
+ const { rootReal, rootWithSep, resolved } = await resolvePathWithinRoot(params);
206
+ try {
207
+ await assertNoPathAliasEscape({
208
+ absolutePath: resolved,
209
+ rootPath: rootReal,
210
+ boundaryLabel: "root"
211
+ });
212
+ } catch (err) {
213
+ throw new SafeOpenError("invalid-path", "path alias escape blocked", { cause: err });
214
+ }
215
+ if (params.mkdir !== false) await fsPromises.mkdir(path.dirname(resolved), { recursive: true });
216
+ let ioPath = resolved;
217
+ try {
218
+ const resolvedRealPath = await fsPromises.realpath(resolved);
219
+ if (!isPathInside(rootWithSep, resolvedRealPath)) throw new SafeOpenError("outside-workspace", "file is outside workspace root");
220
+ ioPath = resolvedRealPath;
221
+ } catch (err) {
222
+ if (err instanceof SafeOpenError) throw err;
223
+ if (!isNotFoundPathError(err)) throw err;
224
+ }
225
+ const fileMode = params.mode ?? 384;
226
+ let handle;
227
+ let createdForWrite = false;
228
+ try {
229
+ try {
230
+ handle = await fsPromises.open(ioPath, OPEN_WRITE_EXISTING_FLAGS, fileMode);
231
+ } catch (err) {
232
+ if (!isNotFoundPathError(err)) throw err;
233
+ handle = await fsPromises.open(ioPath, OPEN_WRITE_CREATE_FLAGS, fileMode);
234
+ createdForWrite = true;
235
+ }
236
+ } catch (err) {
237
+ if (isNotFoundPathError(err)) throw new SafeOpenError("not-found", "file not found");
238
+ if (isSymlinkOpenError(err)) throw new SafeOpenError("invalid-path", "symlink open blocked", { cause: err });
239
+ throw err;
240
+ }
241
+ let openedRealPath = null;
242
+ try {
243
+ const stat = await handle.stat();
244
+ if (!stat.isFile()) throw new SafeOpenError("invalid-path", "path is not a regular file under root");
245
+ if (stat.nlink > 1) throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
246
+ try {
247
+ const lstat = await fsPromises.lstat(ioPath);
248
+ if (lstat.isSymbolicLink() || !lstat.isFile()) throw new SafeOpenError("invalid-path", "path is not a regular file under root");
249
+ if (!sameFileIdentity(stat, lstat)) throw new SafeOpenError("path-mismatch", "path changed during write");
250
+ } catch (err) {
251
+ if (!isNotFoundPathError(err)) throw err;
252
+ }
253
+ const realPath = await resolveOpenedFileRealPathForHandle(handle, ioPath);
254
+ openedRealPath = realPath;
255
+ const realStat = await fsPromises.stat(realPath);
256
+ if (!sameFileIdentity(stat, realStat)) throw new SafeOpenError("path-mismatch", "path mismatch");
257
+ if (realStat.nlink > 1) throw new SafeOpenError("invalid-path", "hardlinked path not allowed");
258
+ if (!isPathInside(rootWithSep, realPath)) throw new SafeOpenError("outside-workspace", "file is outside workspace root");
259
+ if (params.truncateExisting !== false && !createdForWrite) await handle.truncate(0);
260
+ return {
261
+ handle,
262
+ createdForWrite,
263
+ openedRealPath: realPath,
264
+ openedStat: stat
265
+ };
266
+ } catch (err) {
267
+ const cleanupCreatedPath = createdForWrite && err instanceof SafeOpenError;
268
+ const cleanupPath = openedRealPath ?? ioPath;
269
+ await handle.close().catch(() => {});
270
+ if (cleanupCreatedPath) await fsPromises.rm(cleanupPath, { force: true }).catch(() => {});
271
+ throw err;
272
+ }
273
+ }
274
+ async function writeFileWithinRoot(params) {
275
+ const target = await openWritableFileWithinRoot({
276
+ rootDir: params.rootDir,
277
+ relativePath: params.relativePath,
278
+ mkdir: params.mkdir,
279
+ truncateExisting: false
280
+ });
281
+ const destinationPath = target.openedRealPath;
282
+ const targetMode = target.openedStat.mode & 511;
283
+ await target.handle.close().catch(() => {});
284
+ let tempPath = null;
285
+ try {
286
+ tempPath = buildAtomicWriteTempPath(destinationPath);
287
+ const writtenStat = await writeTempFileForAtomicReplace({
288
+ tempPath,
289
+ data: params.data,
290
+ encoding: params.encoding,
291
+ mode: targetMode || 384
292
+ });
293
+ await fsPromises.rename(tempPath, destinationPath);
294
+ tempPath = null;
295
+ try {
296
+ await verifyAtomicWriteResult({
297
+ rootDir: params.rootDir,
298
+ targetPath: destinationPath,
299
+ expectedStat: writtenStat
300
+ });
301
+ } catch (err) {
302
+ emitWriteBoundaryWarning(`post-write verification failed: ${String(err)}`);
303
+ throw err;
304
+ }
305
+ } finally {
306
+ if (tempPath) await fsPromises.rm(tempPath, { force: true }).catch(() => {});
307
+ }
308
+ }
309
+ async function copyFileWithinRoot(params) {
310
+ const source = await openVerifiedLocalFile(params.sourcePath, { rejectHardlinks: params.rejectSourceHardlinks });
311
+ if (params.maxBytes !== void 0 && source.stat.size > params.maxBytes) {
312
+ await source.handle.close().catch(() => {});
313
+ throw new SafeOpenError("too-large", `file exceeds limit of ${params.maxBytes} bytes (got ${source.stat.size})`);
314
+ }
315
+ let target = null;
316
+ let sourceClosedByStream = false;
317
+ let targetClosedByStream = false;
318
+ try {
319
+ target = await openWritableFileWithinRoot({
320
+ rootDir: params.rootDir,
321
+ relativePath: params.relativePath,
322
+ mkdir: params.mkdir
323
+ });
324
+ const sourceStream = source.handle.createReadStream();
325
+ const targetStream = target.handle.createWriteStream();
326
+ sourceStream.once("close", () => {
327
+ sourceClosedByStream = true;
328
+ });
329
+ targetStream.once("close", () => {
330
+ targetClosedByStream = true;
331
+ });
332
+ await pipeline(sourceStream, targetStream);
333
+ } catch (err) {
334
+ if (target?.createdForWrite) await fsPromises.rm(target.openedRealPath, { force: true }).catch(() => {});
335
+ throw err;
336
+ } finally {
337
+ if (!sourceClosedByStream) await source.handle.close().catch(() => {});
338
+ if (target && !targetClosedByStream) await target.handle.close().catch(() => {});
339
+ }
340
+ }
341
+ async function writeFileFromPathWithinRoot(params) {
342
+ await copyFileWithinRoot({
343
+ sourcePath: params.sourcePath,
344
+ rootDir: params.rootDir,
345
+ relativePath: params.relativePath,
346
+ mkdir: params.mkdir,
347
+ rejectSourceHardlinks: true
348
+ });
349
+ }
350
+
351
+ //#endregion
352
+ export { openWritableFileWithinRoot as a, writeFileFromPathWithinRoot as c, openFileWithinRoot as i, writeFileWithinRoot as l, copyFileWithinRoot as n, readFileWithinRoot as o, createRootScopedReadFile as r, readLocalFileSafely as s, SafeOpenError as t };
@@ -1,7 +1,7 @@
1
- import { l as expandHomePrefix } from "./paths-CSdAWKDO.js";
2
- import { D as isNotFoundPathError, E as hasNodeErrorCode, O as isPathInside, S as sameFileIdentity, k as isSymlinkOpenError } from "./workspace-TqfVSQuO.js";
3
- import { i as logWarn } from "./logger-oGKcCLZ5.js";
4
- import { n as assertNoPathAliasEscape } from "./path-alias-guards-Cpsiv2KL.js";
1
+ import { l as expandHomePrefix } from "./paths-DA5srn0U.js";
2
+ import { D as isNotFoundPathError, E as hasNodeErrorCode, O as isPathInside, S as sameFileIdentity, k as isSymlinkOpenError } from "./workspace-kVMIaBrV.js";
3
+ import { i as logWarn } from "./logger-CnTSBL7T.js";
4
+ import { n as assertNoPathAliasEscape } from "./path-alias-guards-DORgbZ1w.js";
5
5
  import fs from "node:fs/promises";
6
6
  import os from "node:os";
7
7
  import path from "node:path";