squidclaw 3.0.13 → 3.0.14

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 (307) hide show
  1. package/dist/{accounts-PhtBJ8mA.js → accounts-BjEXPlGc.js} +1 -1
  2. package/dist/{accounts-Xp5W2xrR.js → accounts-CyBVeR-N.js} +1 -1
  3. package/dist/{accounts-BFC1okn9.js → accounts-D095MOmG.js} +7 -7
  4. package/dist/{acp-cli-Dt95OPXW.js → acp-cli-Dd2joFFS.js} +8 -8
  5. package/dist/{agent-scope-tUxfsPYq.js → agent-scope-C1XMay0T.js} +17 -17
  6. package/dist/{agents.config-DNPisWCH.js → agents.config-CRKsD30n.js} +2 -2
  7. package/dist/{api-key-rotation-Y59kKrr0.js → api-key-rotation-BcKKu9kK.js} +1 -1
  8. package/dist/{audio-preflight-DeBM0nTy.js → audio-preflight-g9rsstMv.js} +34 -34
  9. package/dist/{audio-transcription-runner-B7oPsr3U.js → audio-transcription-runner-Bnl3Ubjo.js} +23 -23
  10. package/dist/{audit-Bq3iosCf.js → audit-B4s_5Gn1.js} +29 -29
  11. package/dist/{auth-HYiP0mxx.js → auth-DHSeaNcB.js} +1 -1
  12. package/dist/{auth-choice-Du_pIfBh.js → auth-choice-C-7c5Td_.js} +13 -13
  13. package/dist/{auth-choice-CX8TDXmp.js → auth-choice-D7LiN5Ju.js} +11 -11
  14. package/dist/{auth-choice.apply-helpers-DRfHu1d8.js → auth-choice.apply-helpers-CxO2Wbq-.js} +1 -1
  15. package/dist/{auth-token-BQRI3c6e.js → auth-token-BxYYHBlc.js} +1 -1
  16. package/dist/{bonjour-discovery-BenDpM0y.js → bonjour-discovery-mtNewKSx.js} +1 -1
  17. package/dist/{browser-cli-Et8PyJjA.js → browser-cli-I1fzIVmS.js} +12 -12
  18. package/dist/build-info.json +2 -2
  19. package/dist/{call-DbkLm3eP.js → call-DkR5OGhh.js} +10 -10
  20. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  21. package/dist/{channel-account-context-C_WQRa6U.js → channel-account-context-e4ysObLI.js} +5 -5
  22. package/dist/{channel-activity-7kixHIgY.js → channel-activity-CCjlTlcN.js} +1 -1
  23. package/dist/{channel-options-D0TjqxeO.js → channel-options-BL5mHe-R.js} +3 -3
  24. package/dist/{channel-selection-BwbXcgj2.js → channel-selection-D_20zq3H.js} +1 -1
  25. package/dist/{channel-web-lfZ3VOOl.js → channel-web-C7Iij0H0.js} +16 -16
  26. package/dist/{channels-cli-Hr4vekE6.js → channels-cli-BMiEn81Y.js} +92 -92
  27. package/dist/{channels-status-issues-DeoqSoo-.js → channels-status-issues-N9kzQrD8.js} +1 -1
  28. package/dist/{chrome-gIqO4t7T.js → chrome-BNfSmFAM.js} +4 -4
  29. package/dist/{clawbot-cli-C-jGxnTq.js → clawbot-cli-B6-68gsT.js} +11 -11
  30. package/dist/cli/daemon-cli.js +1 -1
  31. package/dist/{cli-BH62lCfL.js → cli-ByaubO_B.js} +72 -72
  32. package/dist/{client-CeaUCJtL.js → client-BURktNyH.js} +2 -2
  33. package/dist/{command-secret-targets-BF4WzaME.js → command-secret-targets-WwcPUFAf.js} +4 -4
  34. package/dist/{commands-CD6EMOiw.js → commands-CiY9HjRt.js} +1 -1
  35. package/dist/{commands-registry-DCUj1QOi.js → commands-registry-0bpX7A_Q.js} +3 -3
  36. package/dist/{completion-cli-BIY_jjYY.js → completion-cli-8PdK97J-.js} +12 -12
  37. package/dist/{config-cli-DvNViMXW.js → config-cli-ClomIMw7.js} +7 -7
  38. package/dist/{config-guard-DwgnWjmj.js → config-guard-rLrk7eSS.js} +16 -16
  39. package/dist/{config-validation-CcqZ--gE.js → config-validation-BQEaXMk7.js} +3 -3
  40. package/dist/{configure-B5Zuhebc.js → configure-CoXGul3l.js} +17 -17
  41. package/dist/{control-ui-assets-x69xyZH-.js → control-ui-assets-Bz7TCLpb.js} +1 -1
  42. package/dist/{cron-cli-Bv-X4msQ.js → cron-cli-C3iKBccc.js} +11 -11
  43. package/dist/{daemon-cli-B-8-rGND.js → daemon-cli-BVcrlw5o.js} +15 -15
  44. package/dist/{daemon-install-2y4HHhYl.js → daemon-install-CXDWHEEO.js} +4 -4
  45. package/dist/{daemon-install-helpers-Cdo6Pryw.js → daemon-install-helpers-a4pGEsbA.js} +11 -11
  46. package/dist/{deliver-CVl43oM1.js → deliver-B1sllFkh.js} +7 -7
  47. package/dist/deliver-runtime-CaV7seKv.js +61 -0
  48. package/dist/deps-send-discord.runtime-DbS5pxta.js +36 -0
  49. package/dist/deps-send-imessage.runtime-Ji753_F7.js +35 -0
  50. package/dist/deps-send-signal.runtime-DLJqvPLf.js +34 -0
  51. package/dist/deps-send-slack.runtime-DrFxeZ1I.js +32 -0
  52. package/dist/{deps-send-telegram.runtime-C9lz8bf0.js → deps-send-telegram.runtime-CF-Ylrvr.js} +16 -16
  53. package/dist/deps-send-whatsapp.runtime-BOE0Ke6v.js +118 -0
  54. package/dist/{devices-cli-BT8K0hdG.js → devices-cli-Dn_norz3.js} +8 -8
  55. package/dist/{diagnostic-5bqrhGEp.js → diagnostic-CNl71AzW.js} +1 -1
  56. package/dist/{diagnostics-C0CazfQM.js → diagnostics-DZ99A0EW.js} +5 -5
  57. package/dist/{directory-cli-BZcT9ie1.js → directory-cli-ZzwXkW89.js} +7 -7
  58. package/dist/{dns-cli-CPYaeASu.js → dns-cli-DipYQjtY.js} +5 -5
  59. package/dist/{dock-CVTqzMqE.js → dock-C7N1CmcP.js} +4 -4
  60. package/dist/{docs-cli-C50vGyDh.js → docs-cli-C-Izm9Tb.js} +4 -4
  61. package/dist/{doctor-completion-Emprau8v.js → doctor-completion-CGmYWy0n.js} +2 -2
  62. package/dist/{doctor-config-flow-DSA-JE3n.js → doctor-config-flow-DDWA3Z2D.js} +15 -15
  63. package/dist/{enable-CAYj5OhY.js → enable-RJyJVP_B.js} +1 -1
  64. package/dist/{exec-approvals-allowlist-BO4EEQUI.js → exec-approvals-allowlist-Bu_oaDJC.js} +1 -1
  65. package/dist/{exec-approvals-cli-DSOHdWJR.js → exec-approvals-cli-Csducy9L.js} +16 -16
  66. package/dist/{exec-safe-bin-runtime-policy-CSnpe1AT.js → exec-safe-bin-runtime-policy-DRQwt8kj.js} +2 -2
  67. package/dist/{fetch-guard-VcWeni3c.js → fetch-guard-DNykKlIv.js} +1 -1
  68. package/dist/{fs-safe-CjHYKGbt.js → fs-safe-CKHYu4Vz.js} +24 -24
  69. package/dist/{gateway-cli-B2fScwuY.js → gateway-cli-CUph5Eqo.js} +152 -152
  70. package/dist/{gateway-rpc-DpqZnhyz.js → gateway-rpc-DoKw40aG.js} +1 -1
  71. package/dist/{health-BZcB9SMe.js → health-Cia3g9r1.js} +11 -11
  72. package/dist/{hooks-cli-BylHgZ52.js → hooks-cli-LDbU3XMU.js} +80 -80
  73. package/dist/{hooks-status-DqGd74DG.js → hooks-status-Dd_iWcBZ.js} +1 -1
  74. package/dist/{image-CulZw1up.js → image-D2a7rcK1.js} +5 -5
  75. package/dist/{image-ops-BpsIdA2j.js → image-ops-BIWika4g.js} +10 -10
  76. package/dist/image-runtime-DTxVPe7Z.js +55 -0
  77. package/dist/index.js +82 -82
  78. package/dist/{inspect-D5T8Bbzl.js → inspect-C3PHuODr.js} +4 -4
  79. package/dist/{install-safe-path-BoN-MLvX.js → install-safe-path-iCmVuopp.js} +25 -25
  80. package/dist/{installs-CPHMcmNj.js → installs-CyjlehlR.js} +9 -9
  81. package/dist/{ipv4-Bwl9ruCP.js → ipv4-CWVOQw5T.js} +1 -1
  82. package/dist/{ir-xnftdkOo.js → ir-BPM7rQYq.js} +8 -8
  83. package/dist/{issue-format-8t_ncgFx.js → issue-format-sA05c-6t.js} +1 -1
  84. package/dist/{json-files-DIEpaxUj.js → json-files-D6M304Qd.js} +8 -8
  85. package/dist/{lifecycle-core-DKiBjZdv.js → lifecycle-core-DsfZ6965.js} +5 -5
  86. package/dist/{local-roots-BrxGyJnb.js → local-roots-CMxJ8L4w.js} +3 -3
  87. package/dist/{login-CxDYXbgx.js → login-BjtBaVVG.js} +3 -3
  88. package/dist/{login-qr-zf4B1lpU.js → login-qr-JfRlpd7I.js} +6 -6
  89. package/dist/{logs-cli-CJAe1_dv.js → logs-cli-gv2Ql7GE.js} +9 -9
  90. package/dist/{manager-DBgRFvYb.js → manager-XeZQ6ws7.js} +14 -14
  91. package/dist/{manager-runtime-Dl31cGh-.js → manager-runtime-BvGqzQIY.js} +9 -9
  92. package/dist/{manifest-registry-Cx3mB9zS.js → manifest-registry-BaUPjNKb.js} +1 -1
  93. package/dist/{memory-cli-Bhoc-n_1.js → memory-cli-BUJHSsW6.js} +12 -12
  94. package/dist/{model-DYzjrxpA.js → model-Jy6fO59G.js} +2 -2
  95. package/dist/{model-catalog-kpDOW8eY.js → model-catalog-BfoWgIDd.js} +3 -3
  96. package/dist/{model-picker-BZwK54QT.js → model-picker-CxmHVCE1.js} +4 -4
  97. package/dist/{model-selection-ZV3PuYVR.js → model-selection-QgM_TOjC.js} +16 -16
  98. package/dist/{models-cli-BIxlIOFr.js → models-cli-DlbNL6it.js} +81 -81
  99. package/dist/{models-config-BLdDYoxi.js → models-config-DOD5jluc.js} +6 -6
  100. package/dist/{node-cli-6uYJccbd.js → node-cli-uJ5lFzxj.js} +33 -33
  101. package/dist/{node-command-policy-CKTXVa3D.js → node-command-policy-CwVo8Z1X.js} +1 -1
  102. package/dist/{node-service-DGPVb5ri.js → node-service-xGYkt3vb.js} +1 -1
  103. package/dist/{nodes-cli-CXLRfAYx.js → nodes-cli-eauCMbSr.js} +16 -16
  104. package/dist/{nodes-screen-C-tuRhA1.js → nodes-screen-iR_FzGNs.js} +7 -7
  105. package/dist/{npm-pack-install-DgSn7djE.js → npm-pack-install-s-mP9K0z.js} +18 -18
  106. package/dist/{npm-resolution-gw3vFNTB.js → npm-resolution-Ck7yFIM2.js} +4 -4
  107. package/dist/{onboard-CCaYDSO2.js → onboard-aISMp4Kt.js} +6 -6
  108. package/dist/{onboard-channels-DQnP5d3Y.js → onboard-channels-CELkEQUS.js} +21 -21
  109. package/dist/{onboard-custom-CJohrPzT.js → onboard-custom-BmAzWYbD.js} +4 -4
  110. package/dist/{onboard-helpers-Bcs_1b81.js → onboard-helpers-DRk4Y5uA.js} +10 -10
  111. package/dist/{onboard-hooks-A23nqe_3.js → onboard-hooks-lk1sMnDf.js} +4 -4
  112. package/dist/{onboard-remote-Hf9sTDHl.js → onboard-remote-Bj9cR8kF.js} +4 -4
  113. package/dist/{onboard-skills-Cpc8o6sG.js → onboard-skills-eRpyQ1la.js} +4 -4
  114. package/dist/{onboarding-wx00blu5.js → onboarding-Bl4RDn6W.js} +14 -14
  115. package/dist/{onboarding.finalize-B8wqvggG.js → onboarding.finalize-Bm7_INHb.js} +85 -85
  116. package/dist/{onboarding.gateway-config-CvWq5i_X.js → onboarding.gateway-config-BPyk6gwr.js} +18 -18
  117. package/dist/{onboarding.secret-input-CIN4p8mg.js → onboarding.secret-input-DlDt-I2O.js} +1 -1
  118. package/dist/{openai-model-default-BYfJa19m.js → openai-model-default-DnYP1Em1.js} +2 -2
  119. package/dist/{outbound-B3RZI-ai.js → outbound-BQtnr_z2.js} +3 -3
  120. package/dist/{outbound-attachment-BATDqOuj.js → outbound-attachment-WnXMTJC4.js} +2 -2
  121. package/dist/{pairing-cli-FMIw0yL6.js → pairing-cli-BsU-YnVT.js} +8 -8
  122. package/dist/{pairing-labels-MH31IXn_.js → pairing-labels-BXfoinTP.js} +1 -1
  123. package/dist/{pairing-store-KII9MIZX.js → pairing-store-C1FvWpDK.js} +3 -3
  124. package/dist/{path-alias-guards-B7H6jIIw.js → path-alias-guards-CCRXJArp.js} +3 -3
  125. package/dist/{path-safety-3wUzDqI9.js → path-safety-BWiXz6D4.js} +1 -1
  126. package/dist/{paths-BguvT84s.js → paths-Bg6h1q3v.js} +9 -9
  127. package/dist/{pi-embedded-helpers-D8WkqLZt.js → pi-embedded-helpers-DctimJJI.js} +6 -6
  128. package/dist/{pi-model-discovery-Bfyzj3Lq.js → pi-model-discovery-D63dINOn.js} +1 -1
  129. package/dist/{pi-model-discovery-runtime-nh-zh_Bp.js → pi-model-discovery-runtime-CcXGQcru.js} +5 -5
  130. package/dist/{pi-tools.before-tool-call.runtime-D4V6gUzq.js → pi-tools.before-tool-call.runtime-BMb_b90y.js} +5 -5
  131. package/dist/{pi-tools.policy-DCE9mhtw.js → pi-tools.policy-CXvZtJB7.js} +5 -5
  132. package/dist/{plugin-auto-enable-BJw5Rcbx.js → plugin-auto-enable-DMABTEO-.js} +3 -3
  133. package/dist/{plugin-registry-V0H8DaZf.js → plugin-registry-BSlUIHKX.js} +3 -3
  134. package/dist/plugin-sdk/accounts-B6gye1Jd.js +46 -0
  135. package/dist/plugin-sdk/accounts-C-BT6Po7.js +288 -0
  136. package/dist/plugin-sdk/accounts-DQDXV8eB.js +35 -0
  137. package/dist/plugin-sdk/active-listener-DZCohPuZ.js +50 -0
  138. package/dist/plugin-sdk/api-key-rotation-CrX0fvDj.js +181 -0
  139. package/dist/plugin-sdk/audio-preflight-xnWAFqH-.js +69 -0
  140. package/dist/plugin-sdk/audio-transcription-runner-BDmtq7-q.js +2176 -0
  141. package/dist/plugin-sdk/audit-membership-runtime-B9b-zRwg.js +58 -0
  142. package/dist/plugin-sdk/channel-activity-JjLRpUa_.js +94 -0
  143. package/dist/plugin-sdk/channel-web-DNWsxhYh.js +2256 -0
  144. package/dist/plugin-sdk/chrome-B5PWOUbr.js +2415 -0
  145. package/dist/plugin-sdk/commands-registry-BKeyJUxK.js +1125 -0
  146. package/dist/plugin-sdk/config-FhBFLsNm.js +17911 -0
  147. package/dist/plugin-sdk/deliver-DEbTlzFy.js +1694 -0
  148. package/dist/plugin-sdk/deliver-runtime-CO2uP-r9.js +32 -0
  149. package/dist/plugin-sdk/deps-send-discord.runtime-DIPW0tR4.js +23 -0
  150. package/dist/plugin-sdk/deps-send-imessage.runtime-ByGjRa1H.js +22 -0
  151. package/dist/plugin-sdk/deps-send-signal.runtime-Ca1awu4L.js +21 -0
  152. package/dist/plugin-sdk/deps-send-slack.runtime-CRzWCVkC.js +19 -0
  153. package/dist/plugin-sdk/deps-send-telegram.runtime-BWyavKp9.js +24 -0
  154. package/dist/plugin-sdk/deps-send-whatsapp.runtime-cC_XvHV8.js +57 -0
  155. package/dist/plugin-sdk/diagnostic-Dv9S12vm.js +319 -0
  156. package/dist/plugin-sdk/errors-B8oJXuCF.js +54 -0
  157. package/dist/plugin-sdk/fetch-guard-W_A4uSz2.js +156 -0
  158. package/dist/plugin-sdk/fs-safe-Dqmpk-Fr.js +352 -0
  159. package/dist/plugin-sdk/image-BSFy8d1M.js +2310 -0
  160. package/dist/plugin-sdk/image-ops-DN17S88I.js +584 -0
  161. package/dist/plugin-sdk/image-runtime-5YO31sjU.js +25 -0
  162. package/dist/plugin-sdk/imessage.js +2 -2
  163. package/dist/plugin-sdk/index.js +50 -50
  164. package/dist/plugin-sdk/ir-JaPZ0yKH.js +1296 -0
  165. package/dist/plugin-sdk/local-roots-BTW3ifco.js +186 -0
  166. package/dist/plugin-sdk/logger-DDdrdbDu.js +1163 -0
  167. package/dist/plugin-sdk/login-BXGRny-S.js +57 -0
  168. package/dist/plugin-sdk/login-qr-DTs92ap8.js +320 -0
  169. package/dist/plugin-sdk/manager-DzFj9oHX.js +3917 -0
  170. package/dist/plugin-sdk/manager-runtime-DrpyZvO0.js +15 -0
  171. package/dist/plugin-sdk/mattermost.js +3 -3
  172. package/dist/plugin-sdk/outbound-CQ7uBBML.js +212 -0
  173. package/dist/plugin-sdk/outbound-attachment-dTE6EVdX.js +19 -0
  174. package/dist/plugin-sdk/path-alias-guards-gBhrAn14.js +43 -0
  175. package/dist/plugin-sdk/paths-C6W4VHoa.js +166 -0
  176. package/dist/plugin-sdk/pi-embedded-helpers-CfzQPXDC.js +9627 -0
  177. package/dist/plugin-sdk/pi-model-discovery-Bt6B0MAj.js +134 -0
  178. package/dist/plugin-sdk/pi-model-discovery-runtime-BcgXpTmL.js +8 -0
  179. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-DYJQxhuo.js +354 -0
  180. package/dist/plugin-sdk/plugins-6NxPd6TS.js +864 -0
  181. package/dist/plugin-sdk/proxy-fetch-ZPEvp58f.js +38 -0
  182. package/dist/plugin-sdk/pw-ai-BFK39pwE.js +1938 -0
  183. package/dist/plugin-sdk/qmd-manager-6bozlfFg.js +1448 -0
  184. package/dist/plugin-sdk/query-expansion-eeVz_aEm.js +1011 -0
  185. package/dist/plugin-sdk/redact-BoNEjbpF.js +319 -0
  186. package/dist/plugin-sdk/reply-DgcrQBKL.js +98828 -0
  187. package/dist/plugin-sdk/resolve-outbound-target-CbaJ-kc2.js +40 -0
  188. package/dist/plugin-sdk/run-with-concurrency-5DMu9szx.js +1994 -0
  189. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-jkgyeVsN.js +10 -0
  190. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DdLJJ1YC.js +19 -0
  191. package/dist/plugin-sdk/send-BSoMbeqA.js +3135 -0
  192. package/dist/plugin-sdk/send-Byyfc20_.js +503 -0
  193. package/dist/plugin-sdk/send-CI-xWEs7.js +2587 -0
  194. package/dist/plugin-sdk/send-DzP9EJqK.js +540 -0
  195. package/dist/plugin-sdk/send-MlSZ82sA.js +414 -0
  196. package/dist/plugin-sdk/session-DFy97tfW.js +169 -0
  197. package/dist/plugin-sdk/signal.js +2 -2
  198. package/dist/plugin-sdk/skill-commands-yum46YuA.js +342 -0
  199. package/dist/plugin-sdk/skills-DUphJGKn.js +1428 -0
  200. package/dist/plugin-sdk/slash-commands.runtime-5UW5KLyR.js +13 -0
  201. package/dist/plugin-sdk/slash-dispatch.runtime-4oQ2P_qo.js +52 -0
  202. package/dist/plugin-sdk/slash-skill-commands.runtime-y_mOLyS7.js +16 -0
  203. package/dist/plugin-sdk/ssrf-B3XRWBsP.js +202 -0
  204. package/dist/plugin-sdk/store-DFvIhzWZ.js +81 -0
  205. package/dist/plugin-sdk/subagent-registry-runtime-DtKXhKtl.js +52 -0
  206. package/dist/plugin-sdk/tables-bDM_jlLP.js +55 -0
  207. package/dist/{target-errors-DlzVutaL.js → plugin-sdk/target-errors-BVBW25Y3.js} +4 -4
  208. package/dist/plugin-sdk/thinking-Bu-w5mW5.js +1206 -0
  209. package/dist/plugin-sdk/tokens-CTIYTLWu.js +52 -0
  210. package/dist/plugin-sdk/tool-images-D0G_giwP.js +274 -0
  211. package/dist/plugin-sdk/web-DSXk7XCb.js +56 -0
  212. package/dist/plugin-sdk/whatsapp-actions-BOyA0Uuj.js +80 -0
  213. package/dist/{plugins-Cl_3OCyK.js → plugins-H53_4Gxb.js} +2 -2
  214. package/dist/{plugins-cli-CN2fty5U.js → plugins-cli-CQkxWdnt.js} +82 -82
  215. package/dist/{ports-Bop51hz6.js → ports-CKXuQJST.js} +2 -2
  216. package/dist/{ports-6i8smH3e.js → ports-CXjhFS7T.js} +1 -1
  217. package/dist/{program-context-ehHvCw9L.js → program-context-tphS7xu7.js} +41 -41
  218. package/dist/{prompt-select-styled-CSMviLJY.js → prompt-select-styled-DL2p1pfi.js} +40 -40
  219. package/dist/{provider-auth-helpers-CgNWlsqs.js → provider-auth-helpers-BqWiy-r-.js} +5 -5
  220. package/dist/{proxy-env-CRD7fbqp.js → proxy-env-D1tz4Z6a.js} +1 -1
  221. package/dist/{push-apns-DoYzx3tH.js → push-apns-C-YdARdy.js} +5 -5
  222. package/dist/{pw-ai-yKJj32B4.js → pw-ai-SVeR5d2o.js} +18 -18
  223. package/dist/{qmd-manager-AYDUTXmc.js → qmd-manager-B-XXhWVw.js} +20 -20
  224. package/dist/{qr-cli-cikAHfYn.js → qr-cli-B4fjHvn1.js} +2 -2
  225. package/dist/{query-expansion-CV2Z4_mS.js → query-expansion-Bf60ekMj.js} +12 -12
  226. package/dist/{redact-snapshot-C9T1079O.js → redact-snapshot-DRqM8Vla.js} +1 -1
  227. package/dist/{register.agent-BlxoyQt0.js → register.agent-BdiM0qkl.js} +97 -97
  228. package/dist/register.configure-wANXDbzQ.js +164 -0
  229. package/dist/{register.maintenance-C-Yv2mHK.js → register.maintenance-CMAt3Nl8.js} +93 -93
  230. package/dist/{register.message-CUNXtFOj.js → register.message-CbxQ5lgi.js} +73 -73
  231. package/dist/{register.onboard-BKXm1mL7.js → register.onboard-CbiTdKQX.js} +18 -18
  232. package/dist/{register.setup-DaT9AIAz.js → register.setup-KhsHMx2v.js} +21 -21
  233. package/dist/{register.status-health-sessions-7yZmSvUL.js → register.status-health-sessions-Bw5YDa_s.js} +86 -86
  234. package/dist/{reply-CeUYZhWu.js → reply-BWXzPVSJ.js} +149 -149
  235. package/dist/{rpc-BDpuIniF.js → rpc-DlN_W_L1.js} +1 -1
  236. package/dist/{runtime-Dw7Yw4OJ.js → runtime-Ci7mtLvH.js} +3 -3
  237. package/dist/{runtime-config-collectors-jhc1wDBg.js → runtime-config-collectors-CKmGmTQ5.js} +1 -1
  238. package/dist/{runtime-whatsapp-login.runtime-f293Z_er.js → runtime-whatsapp-login.runtime-Bxqt5jiO.js} +7 -7
  239. package/dist/runtime-whatsapp-outbound.runtime-B-UsXwvb.js +32 -0
  240. package/dist/{sandbox-BgsD1lf7.js → sandbox-Cuk1IWYT.js} +18 -18
  241. package/dist/{sandbox-cli-BnvmhiN9.js → sandbox-cli-BxgFeoAD.js} +25 -25
  242. package/dist/{secrets-cli-D7-K7P82.js → secrets-cli-DODLX29x.js} +11 -11
  243. package/dist/{security-cli-BFJAgNYH.js → security-cli-Ch83VrLP.js} +42 -42
  244. package/dist/{send-BvlkshC1.js → send-BfVgGHK6.js} +6 -6
  245. package/dist/{send-tK0H9nwq.js → send-Bw8LNCit.js} +5 -5
  246. package/dist/{send-CDms2FQA.js → send-C9UJKBSM.js} +4 -4
  247. package/dist/{send-CPFNtAP8.js → send-DX_fR45p.js} +11 -11
  248. package/dist/{send-C3Aeswif.js → send-FTQaNJPj.js} +8 -8
  249. package/dist/{server-OfKJG6Bo.js → server-Q9nnn04D.js} +20 -20
  250. package/dist/{server-context-B-0KzcZE.js → server-context-CX28l04l.js} +12 -12
  251. package/dist/{server-lifecycle-D6VNKVvQ.js → server-lifecycle-yAUMTJhv.js} +2 -2
  252. package/dist/{server-middleware-7cXowO4W.js → server-middleware-DIc4WJOS.js} +1 -1
  253. package/dist/{server-node-events-DWQhNK-0.js → server-node-events-qU3NTncQ.js} +73 -73
  254. package/dist/{service-Dk-UMipf.js → service-D4y0_Q5Z.js} +15 -15
  255. package/dist/{session-Da18ilJ0.js → session-CZJ5Ux6-.js} +1 -1
  256. package/dist/{sessions-CmjcNTJ3.js → sessions-C5H_BZSr.js} +15 -15
  257. package/dist/{shared-BzY0v0tS.js → shared-CxdBWgym.js} +3 -3
  258. package/dist/{shared-BcB-feC8.js → shared-DwNtcoQg.js} +1 -1
  259. package/dist/{skill-commands-BEWkEml_.js → skill-commands-BSRPnzXp.js} +5 -5
  260. package/dist/{skill-scanner-Bb5SMbCz.js → skill-scanner-rdr9cQew.js} +6 -6
  261. package/dist/{skills-Rnr7zPen.js → skills-BnBOxX1c.js} +3 -3
  262. package/dist/{skills-cli-BowIIIzH.js → skills-cli-CUgeYV1y.js} +5 -5
  263. package/dist/{skills-install-BLNCKuex.js → skills-install-BE04CZ6e.js} +6 -6
  264. package/dist/{skills-status-BCU-5otB.js → skills-status-DQw98BkG.js} +1 -1
  265. package/dist/{slash-commands.runtime-BgVgQ-Eh.js → slash-commands.runtime-BPtL2Qev.js} +11 -11
  266. package/dist/slash-dispatch.runtime-Cf9dq1k6.js +113 -0
  267. package/dist/{slash-skill-commands.runtime-4dOiU6U0.js → slash-skill-commands.runtime-9BYoANpd.js} +15 -15
  268. package/dist/{squidclaw-root-BcB7vo9M.js → squidclaw-root-CnE19yKj.js} +8 -8
  269. package/dist/{status-COTRBaam.js → status-rb5Jz-VU.js} +26 -26
  270. package/dist/{status.update-BUql4yz-.js → status.update-BNODJGA9.js} +2 -2
  271. package/dist/{store-aa15VM42.js → store-PDMRmC5Z.js} +5 -5
  272. package/dist/subagent-registry-runtime-CTiA365B.js +113 -0
  273. package/dist/{system-cli-CgCUbH_M.js → system-cli-DJYyTO07.js} +9 -9
  274. package/dist/{system-run-command-Ny1SbbOD.js → system-run-command-BgnCyvrj.js} +1 -1
  275. package/dist/{systemd-zbKl2Q3E.js → systemd-fP8tz4aL.js} +9 -9
  276. package/dist/{systemd-hints-C9_7ouv7.js → systemd-hints-BG_t__ZD.js} +6 -6
  277. package/dist/{systemd-linger-BM6JyzAr.js → systemd-linger-DgK8uuKY.js} +1 -1
  278. package/dist/{tables-jZMI8hLl.js → tables-DUSFF9-W.js} +1 -1
  279. package/dist/{tailnet-gTCqUBfJ.js → tailnet-CLkKVwDq.js} +1 -1
  280. package/dist/target-errors-BxwxgIDk.js +195 -0
  281. package/dist/{tool-images-DTl_LHMa.js → tool-images-FhSCiY-o.js} +1 -1
  282. package/dist/{tui-kDK-MAOc.js → tui-BMOMT-ma.js} +6 -6
  283. package/dist/{tui-cli-Dxy6fKkU.js → tui-cli-kqZ_-2Mz.js} +32 -32
  284. package/dist/{update-ZUTn6Jsu.js → update-blK9j2ag.js} +3 -3
  285. package/dist/{update-cli-D_QEiKyz.js → update-cli-gLKrP8UQ.js} +102 -102
  286. package/dist/{update-runner-DOXPSA_-.js → update-runner-C2UrF4oZ.js} +16 -16
  287. package/dist/web-VmjeceHS.js +117 -0
  288. package/dist/{webhooks-cli-D1iehjkP.js → webhooks-cli-BEXPBILa.js} +6 -6
  289. package/dist/{whatsapp-actions-hN5bwjWU.js → whatsapp-actions-DhiV181U.js} +17 -17
  290. package/dist/{with-timeout-BjaANd4G.js → with-timeout-BCAfkt03.js} +3 -3
  291. package/dist/{workspace-BITWyKG4.js → workspace-B-k5DNiQ.js} +1 -1
  292. package/dist/{workspace-dirs-B7O9BAHp.js → workspace-dirs-B2dNahfe.js} +1 -1
  293. package/dist/{ws-Bx8lpC1N.js → ws-DKt5HoA5.js} +2 -2
  294. package/dist/{wsl-wYxPJ8EO.js → wsl-CgxzAzRe.js} +2 -2
  295. package/package.json +1 -1
  296. package/dist/deliver-runtime-uwleBPlq.js +0 -61
  297. package/dist/deps-send-discord.runtime-CuZGpA7H.js +0 -36
  298. package/dist/deps-send-imessage.runtime-ByVW2alP.js +0 -35
  299. package/dist/deps-send-signal.runtime-Dl4GaCbQ.js +0 -34
  300. package/dist/deps-send-slack.runtime-BEV10FHj.js +0 -32
  301. package/dist/deps-send-whatsapp.runtime-Di0SEPNK.js +0 -118
  302. package/dist/image-runtime-B5Q4J9w2.js +0 -55
  303. package/dist/register.configure-CGptmTVZ.js +0 -164
  304. package/dist/runtime-whatsapp-outbound.runtime-uDhEmWe1.js +0 -32
  305. package/dist/slash-dispatch.runtime-D83FVeU7.js +0 -113
  306. package/dist/subagent-registry-runtime-CrT5RSO9.js +0 -113
  307. package/dist/web-DtSq_aUB.js +0 -117
@@ -0,0 +1,414 @@
1
+ import { n as loadConfig } from "./config-FhBFLsNm.js";
2
+ import { L as logVerbose } from "./logger-DDdrdbDu.js";
3
+ import { F as resolveSlackBotToken, M as resolveSlackAccount, m as parseSlackTarget } from "./plugins-6NxPd6TS.js";
4
+ import { r as withTrustedEnvProxyGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-W_A4uSz2.js";
5
+ import { c as chunkMarkdownTextWithMode, d as resolveChunkMode, f as resolveTextChunkLimit, i as resolveMarkdownTableMode, n as markdownToIR, t as chunkMarkdownIR, v as loadWebMedia } from "./ir-JaPZ0yKH.js";
6
+ import { t as renderMarkdownWithMarkers } from "./render-HmipMDlP.js";
7
+ import { i as isSilentReplyText } from "./tokens-CTIYTLWu.js";
8
+ import { WebClient } from "@slack/web-api";
9
+
10
+ //#region src/slack/blocks-input.ts
11
+ const SLACK_MAX_BLOCKS = 50;
12
+ function parseBlocksJson(raw) {
13
+ try {
14
+ return JSON.parse(raw);
15
+ } catch {
16
+ throw new Error("blocks must be valid JSON");
17
+ }
18
+ }
19
+ function assertBlocksArray(raw) {
20
+ if (!Array.isArray(raw)) throw new Error("blocks must be an array");
21
+ if (raw.length === 0) throw new Error("blocks must contain at least one block");
22
+ if (raw.length > SLACK_MAX_BLOCKS) throw new Error(`blocks cannot exceed ${SLACK_MAX_BLOCKS} items`);
23
+ for (const block of raw) {
24
+ if (!block || typeof block !== "object" || Array.isArray(block)) throw new Error("each block must be an object");
25
+ const type = block.type;
26
+ if (typeof type !== "string" || type.trim().length === 0) throw new Error("each block must include a non-empty string type");
27
+ }
28
+ }
29
+ function validateSlackBlocksArray(raw) {
30
+ assertBlocksArray(raw);
31
+ return raw;
32
+ }
33
+ function parseSlackBlocksInput(raw) {
34
+ if (raw == null) return;
35
+ return validateSlackBlocksArray(typeof raw === "string" ? parseBlocksJson(raw) : raw);
36
+ }
37
+
38
+ //#endregion
39
+ //#region src/slack/client.ts
40
+ const SLACK_DEFAULT_RETRY_OPTIONS = {
41
+ retries: 2,
42
+ factor: 2,
43
+ minTimeout: 500,
44
+ maxTimeout: 3e3,
45
+ randomize: true
46
+ };
47
+ function resolveSlackWebClientOptions(options = {}) {
48
+ return {
49
+ ...options,
50
+ retryConfig: options.retryConfig ?? SLACK_DEFAULT_RETRY_OPTIONS
51
+ };
52
+ }
53
+ function createSlackWebClient(token, options = {}) {
54
+ return new WebClient(token, resolveSlackWebClientOptions(options));
55
+ }
56
+
57
+ //#endregion
58
+ //#region src/slack/blocks-fallback.ts
59
+ function cleanCandidate(value) {
60
+ if (typeof value !== "string") return;
61
+ const normalized = value.replace(/\s+/g, " ").trim();
62
+ return normalized.length > 0 ? normalized : void 0;
63
+ }
64
+ function readSectionText(block) {
65
+ return cleanCandidate(block.text?.text);
66
+ }
67
+ function readHeaderText(block) {
68
+ return cleanCandidate(block.text?.text);
69
+ }
70
+ function readImageText(block) {
71
+ return cleanCandidate(block.alt_text) ?? cleanCandidate(block.title?.text);
72
+ }
73
+ function readVideoText(block) {
74
+ return cleanCandidate(block.title?.text) ?? cleanCandidate(block.alt_text);
75
+ }
76
+ function readContextText(block) {
77
+ if (!Array.isArray(block.elements)) return;
78
+ const textParts = block.elements.map((element) => cleanCandidate(element.text)).filter((value) => Boolean(value));
79
+ return textParts.length > 0 ? textParts.join(" ") : void 0;
80
+ }
81
+ function buildSlackBlocksFallbackText(blocks) {
82
+ for (const raw of blocks) {
83
+ const block = raw;
84
+ switch (block.type) {
85
+ case "header": {
86
+ const text = readHeaderText(block);
87
+ if (text) return text;
88
+ break;
89
+ }
90
+ case "section": {
91
+ const text = readSectionText(block);
92
+ if (text) return text;
93
+ break;
94
+ }
95
+ case "image": {
96
+ const text = readImageText(block);
97
+ if (text) return text;
98
+ return "Shared an image";
99
+ }
100
+ case "video": {
101
+ const text = readVideoText(block);
102
+ if (text) return text;
103
+ return "Shared a video";
104
+ }
105
+ case "file": return "Shared a file";
106
+ case "context": {
107
+ const text = readContextText(block);
108
+ if (text) return text;
109
+ break;
110
+ }
111
+ default: break;
112
+ }
113
+ }
114
+ return "Shared a Block Kit message";
115
+ }
116
+
117
+ //#endregion
118
+ //#region src/slack/format.ts
119
+ function escapeSlackMrkdwnSegment(text) {
120
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
121
+ }
122
+ const SLACK_ANGLE_TOKEN_RE = /<[^>\n]+>/g;
123
+ function isAllowedSlackAngleToken(token) {
124
+ if (!token.startsWith("<") || !token.endsWith(">")) return false;
125
+ const inner = token.slice(1, -1);
126
+ return inner.startsWith("@") || inner.startsWith("#") || inner.startsWith("!") || inner.startsWith("mailto:") || inner.startsWith("tel:") || inner.startsWith("http://") || inner.startsWith("https://") || inner.startsWith("slack://");
127
+ }
128
+ function escapeSlackMrkdwnContent(text) {
129
+ if (!text) return "";
130
+ if (!text.includes("&") && !text.includes("<") && !text.includes(">")) return text;
131
+ SLACK_ANGLE_TOKEN_RE.lastIndex = 0;
132
+ const out = [];
133
+ let lastIndex = 0;
134
+ for (let match = SLACK_ANGLE_TOKEN_RE.exec(text); match; match = SLACK_ANGLE_TOKEN_RE.exec(text)) {
135
+ const matchIndex = match.index ?? 0;
136
+ out.push(escapeSlackMrkdwnSegment(text.slice(lastIndex, matchIndex)));
137
+ const token = match[0] ?? "";
138
+ out.push(isAllowedSlackAngleToken(token) ? token : escapeSlackMrkdwnSegment(token));
139
+ lastIndex = matchIndex + token.length;
140
+ }
141
+ out.push(escapeSlackMrkdwnSegment(text.slice(lastIndex)));
142
+ return out.join("");
143
+ }
144
+ function escapeSlackMrkdwnText(text) {
145
+ if (!text) return "";
146
+ if (!text.includes("&") && !text.includes("<") && !text.includes(">")) return text;
147
+ return text.split("\n").map((line) => {
148
+ if (line.startsWith("> ")) return `> ${escapeSlackMrkdwnContent(line.slice(2))}`;
149
+ return escapeSlackMrkdwnContent(line);
150
+ }).join("\n");
151
+ }
152
+ function buildSlackLink(link, text) {
153
+ const href = link.href.trim();
154
+ if (!href) return null;
155
+ const trimmedLabel = text.slice(link.start, link.end).trim();
156
+ const comparableHref = href.startsWith("mailto:") ? href.slice(7) : href;
157
+ if (!(trimmedLabel.length > 0 && trimmedLabel !== href && trimmedLabel !== comparableHref)) return null;
158
+ const safeHref = escapeSlackMrkdwnSegment(href);
159
+ return {
160
+ start: link.start,
161
+ end: link.end,
162
+ open: `<${safeHref}|`,
163
+ close: ">"
164
+ };
165
+ }
166
+ function buildSlackRenderOptions() {
167
+ return {
168
+ styleMarkers: {
169
+ bold: {
170
+ open: "*",
171
+ close: "*"
172
+ },
173
+ italic: {
174
+ open: "_",
175
+ close: "_"
176
+ },
177
+ strikethrough: {
178
+ open: "~",
179
+ close: "~"
180
+ },
181
+ code: {
182
+ open: "`",
183
+ close: "`"
184
+ },
185
+ code_block: {
186
+ open: "```\n",
187
+ close: "```"
188
+ }
189
+ },
190
+ escapeText: escapeSlackMrkdwnText,
191
+ buildLink: buildSlackLink
192
+ };
193
+ }
194
+ function markdownToSlackMrkdwn(markdown, options = {}) {
195
+ return renderMarkdownWithMarkers(markdownToIR(markdown ?? "", {
196
+ linkify: false,
197
+ autolink: false,
198
+ headingStyle: "bold",
199
+ blockquotePrefix: "> ",
200
+ tableMode: options.tableMode
201
+ }), buildSlackRenderOptions());
202
+ }
203
+ function normalizeSlackOutboundText(markdown) {
204
+ return markdownToSlackMrkdwn(markdown ?? "");
205
+ }
206
+ function markdownToSlackMrkdwnChunks(markdown, limit, options = {}) {
207
+ const chunks = chunkMarkdownIR(markdownToIR(markdown ?? "", {
208
+ linkify: false,
209
+ autolink: false,
210
+ headingStyle: "bold",
211
+ blockquotePrefix: "> ",
212
+ tableMode: options.tableMode
213
+ }), limit);
214
+ const renderOptions = buildSlackRenderOptions();
215
+ return chunks.map((chunk) => renderMarkdownWithMarkers(chunk, renderOptions));
216
+ }
217
+
218
+ //#endregion
219
+ //#region src/slack/send.ts
220
+ const SLACK_TEXT_LIMIT = 4e3;
221
+ const SLACK_UPLOAD_SSRF_POLICY = {
222
+ allowedHostnames: [
223
+ "*.slack.com",
224
+ "*.slack-edge.com",
225
+ "*.slack-files.com"
226
+ ],
227
+ allowRfc2544BenchmarkRange: true
228
+ };
229
+ function hasCustomIdentity(identity) {
230
+ return Boolean(identity?.username || identity?.iconUrl || identity?.iconEmoji);
231
+ }
232
+ function isSlackCustomizeScopeError(err) {
233
+ if (!(err instanceof Error)) return false;
234
+ const maybeData = err;
235
+ if (maybeData.data?.error?.toLowerCase() !== "missing_scope") return false;
236
+ if ((maybeData.data?.needed?.toLowerCase())?.includes("chat:write.customize")) return true;
237
+ return [...maybeData.data?.response_metadata?.scopes ?? [], ...maybeData.data?.response_metadata?.acceptedScopes ?? []].map((scope) => scope.toLowerCase()).includes("chat:write.customize");
238
+ }
239
+ async function postSlackMessageBestEffort(params) {
240
+ const basePayload = {
241
+ channel: params.channelId,
242
+ text: params.text,
243
+ thread_ts: params.threadTs,
244
+ ...params.blocks?.length ? { blocks: params.blocks } : {}
245
+ };
246
+ try {
247
+ if (params.identity?.iconUrl) return await params.client.chat.postMessage({
248
+ ...basePayload,
249
+ ...params.identity.username ? { username: params.identity.username } : {},
250
+ icon_url: params.identity.iconUrl
251
+ });
252
+ if (params.identity?.iconEmoji) return await params.client.chat.postMessage({
253
+ ...basePayload,
254
+ ...params.identity.username ? { username: params.identity.username } : {},
255
+ icon_emoji: params.identity.iconEmoji
256
+ });
257
+ return await params.client.chat.postMessage({
258
+ ...basePayload,
259
+ ...params.identity?.username ? { username: params.identity.username } : {}
260
+ });
261
+ } catch (err) {
262
+ if (!hasCustomIdentity(params.identity) || !isSlackCustomizeScopeError(err)) throw err;
263
+ logVerbose("slack send: missing chat:write.customize, retrying without custom identity");
264
+ return params.client.chat.postMessage(basePayload);
265
+ }
266
+ }
267
+ function resolveToken(params) {
268
+ const explicit = resolveSlackBotToken(params.explicit);
269
+ if (explicit) return explicit;
270
+ const fallback = resolveSlackBotToken(params.fallbackToken);
271
+ if (!fallback) {
272
+ logVerbose(`slack send: missing bot token for account=${params.accountId} explicit=${Boolean(params.explicit)} source=${params.fallbackSource ?? "unknown"}`);
273
+ throw new Error(`Slack bot token missing for account "${params.accountId}" (set channels.slack.accounts.${params.accountId}.botToken or SLACK_BOT_TOKEN for default).`);
274
+ }
275
+ return fallback;
276
+ }
277
+ function parseRecipient(raw) {
278
+ const target = parseSlackTarget(raw);
279
+ if (!target) throw new Error("Recipient is required for Slack sends");
280
+ return {
281
+ kind: target.kind,
282
+ id: target.id
283
+ };
284
+ }
285
+ async function resolveChannelId(client, recipient) {
286
+ if (!(recipient.kind === "user" || /^U[A-Z0-9]+$/i.test(recipient.id))) return { channelId: recipient.id };
287
+ const channelId = (await client.conversations.open({ users: recipient.id })).channel?.id;
288
+ if (!channelId) throw new Error("Failed to open Slack DM channel");
289
+ return {
290
+ channelId,
291
+ isDm: true
292
+ };
293
+ }
294
+ async function uploadSlackFile(params) {
295
+ const { buffer, contentType, fileName } = await loadWebMedia(params.mediaUrl, {
296
+ maxBytes: params.maxBytes,
297
+ localRoots: params.mediaLocalRoots
298
+ });
299
+ const uploadUrlResp = await params.client.files.getUploadURLExternal({
300
+ filename: fileName ?? "upload",
301
+ length: buffer.length
302
+ });
303
+ if (!uploadUrlResp.ok || !uploadUrlResp.upload_url || !uploadUrlResp.file_id) throw new Error(`Failed to get upload URL: ${uploadUrlResp.error ?? "unknown error"}`);
304
+ const uploadBody = new Uint8Array(buffer);
305
+ const { response: uploadResp, release } = await fetchWithSsrFGuard(withTrustedEnvProxyGuardedFetchMode({
306
+ url: uploadUrlResp.upload_url,
307
+ init: {
308
+ method: "POST",
309
+ ...contentType ? { headers: { "Content-Type": contentType } } : {},
310
+ body: uploadBody
311
+ },
312
+ policy: SLACK_UPLOAD_SSRF_POLICY,
313
+ auditContext: "slack-upload-file"
314
+ }));
315
+ try {
316
+ if (!uploadResp.ok) throw new Error(`Failed to upload file: HTTP ${uploadResp.status}`);
317
+ } finally {
318
+ await release();
319
+ }
320
+ const completeResp = await params.client.files.completeUploadExternal({
321
+ files: [{
322
+ id: uploadUrlResp.file_id,
323
+ title: fileName ?? "upload"
324
+ }],
325
+ channel_id: params.channelId,
326
+ ...params.caption ? { initial_comment: params.caption } : {},
327
+ ...params.threadTs ? { thread_ts: params.threadTs } : {}
328
+ });
329
+ if (!completeResp.ok) throw new Error(`Failed to complete upload: ${completeResp.error ?? "unknown error"}`);
330
+ return uploadUrlResp.file_id;
331
+ }
332
+ async function sendMessageSlack(to, message, opts = {}) {
333
+ const trimmedMessage = message?.trim() ?? "";
334
+ if (isSilentReplyText(trimmedMessage) && !opts.mediaUrl && !opts.blocks) {
335
+ logVerbose("slack send: suppressed NO_REPLY token before API call");
336
+ return {
337
+ messageId: "suppressed",
338
+ channelId: ""
339
+ };
340
+ }
341
+ const blocks = opts.blocks == null ? void 0 : validateSlackBlocksArray(opts.blocks);
342
+ if (!trimmedMessage && !opts.mediaUrl && !blocks) throw new Error("Slack send requires text, blocks, or media");
343
+ const cfg = opts.cfg ?? loadConfig();
344
+ const account = resolveSlackAccount({
345
+ cfg,
346
+ accountId: opts.accountId
347
+ });
348
+ const token = resolveToken({
349
+ explicit: opts.token,
350
+ accountId: account.accountId,
351
+ fallbackToken: account.botToken,
352
+ fallbackSource: account.botTokenSource
353
+ });
354
+ const client = opts.client ?? createSlackWebClient(token);
355
+ const { channelId } = await resolveChannelId(client, parseRecipient(to));
356
+ if (blocks) {
357
+ if (opts.mediaUrl) throw new Error("Slack send does not support blocks with mediaUrl");
358
+ return {
359
+ messageId: (await postSlackMessageBestEffort({
360
+ client,
361
+ channelId,
362
+ text: trimmedMessage || buildSlackBlocksFallbackText(blocks),
363
+ threadTs: opts.threadTs,
364
+ identity: opts.identity,
365
+ blocks
366
+ })).ts ?? "unknown",
367
+ channelId
368
+ };
369
+ }
370
+ const textLimit = resolveTextChunkLimit(cfg, "slack", account.accountId);
371
+ const chunkLimit = Math.min(textLimit, SLACK_TEXT_LIMIT);
372
+ const tableMode = resolveMarkdownTableMode({
373
+ cfg,
374
+ channel: "slack",
375
+ accountId: account.accountId
376
+ });
377
+ const chunkMode = resolveChunkMode(cfg, "slack", account.accountId);
378
+ const chunks = (chunkMode === "newline" ? chunkMarkdownTextWithMode(trimmedMessage, chunkLimit, chunkMode) : [trimmedMessage]).flatMap((markdown) => markdownToSlackMrkdwnChunks(markdown, chunkLimit, { tableMode }));
379
+ if (!chunks.length && trimmedMessage) chunks.push(trimmedMessage);
380
+ const mediaMaxBytes = typeof account.config.mediaMaxMb === "number" ? account.config.mediaMaxMb * 1024 * 1024 : void 0;
381
+ let lastMessageId = "";
382
+ if (opts.mediaUrl) {
383
+ const [firstChunk, ...rest] = chunks;
384
+ lastMessageId = await uploadSlackFile({
385
+ client,
386
+ channelId,
387
+ mediaUrl: opts.mediaUrl,
388
+ mediaLocalRoots: opts.mediaLocalRoots,
389
+ caption: firstChunk,
390
+ threadTs: opts.threadTs,
391
+ maxBytes: mediaMaxBytes
392
+ });
393
+ for (const chunk of rest) lastMessageId = (await postSlackMessageBestEffort({
394
+ client,
395
+ channelId,
396
+ text: chunk,
397
+ threadTs: opts.threadTs,
398
+ identity: opts.identity
399
+ })).ts ?? lastMessageId;
400
+ } else for (const chunk of chunks.length ? chunks : [""]) lastMessageId = (await postSlackMessageBestEffort({
401
+ client,
402
+ channelId,
403
+ text: chunk,
404
+ threadTs: opts.threadTs,
405
+ identity: opts.identity
406
+ })).ts ?? lastMessageId;
407
+ return {
408
+ messageId: lastMessageId || "unknown",
409
+ channelId
410
+ };
411
+ }
412
+
413
+ //#endregion
414
+ export { createSlackWebClient as a, validateSlackBlocksArray as c, buildSlackBlocksFallbackText as i, markdownToSlackMrkdwnChunks as n, resolveSlackWebClientOptions as o, normalizeSlackOutboundText as r, parseSlackBlocksInput as s, sendMessageSlack as t };
@@ -0,0 +1,169 @@
1
+ import { f as readCredsJsonRaw, g as resolveWebCredsPath, h as resolveWebCredsBackupPath, m as resolveDefaultWebAuthDir, u as maybeRestoreCredsFromBackup } from "./accounts-C-BT6Po7.js";
2
+ import { Pr as formatCliCommand, Xr as VERSION } from "./config-FhBFLsNm.js";
3
+ import { B as success, E as resolveUserPath, F as danger, G as getChildLogger, g as ensureDir, q as toPinoLikeLogger } from "./logger-DDdrdbDu.js";
4
+ import fs from "node:fs";
5
+ import { randomUUID } from "node:crypto";
6
+ import { DisconnectReason, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "@whiskeysockets/baileys";
7
+ import qrcode from "qrcode-terminal";
8
+
9
+ //#region src/web/session.ts
10
+ let credsSaveQueue = Promise.resolve();
11
+ function enqueueSaveCreds(authDir, saveCreds, logger) {
12
+ credsSaveQueue = credsSaveQueue.then(() => safeSaveCreds(authDir, saveCreds, logger)).catch((err) => {
13
+ logger.warn({ error: String(err) }, "WhatsApp creds save queue error");
14
+ });
15
+ }
16
+ async function safeSaveCreds(authDir, saveCreds, logger) {
17
+ try {
18
+ const credsPath = resolveWebCredsPath(authDir);
19
+ const backupPath = resolveWebCredsBackupPath(authDir);
20
+ const raw = readCredsJsonRaw(credsPath);
21
+ if (raw) try {
22
+ JSON.parse(raw);
23
+ fs.copyFileSync(credsPath, backupPath);
24
+ try {
25
+ fs.chmodSync(backupPath, 384);
26
+ } catch {}
27
+ } catch {}
28
+ } catch {}
29
+ try {
30
+ await Promise.resolve(saveCreds());
31
+ try {
32
+ fs.chmodSync(resolveWebCredsPath(authDir), 384);
33
+ } catch {}
34
+ } catch (err) {
35
+ logger.warn({ error: String(err) }, "failed saving WhatsApp creds");
36
+ }
37
+ }
38
+ /**
39
+ * Create a Baileys socket backed by the multi-file auth store we keep on disk.
40
+ * Consumers can opt into QR printing for interactive login flows.
41
+ */
42
+ async function createWaSocket(printQr, verbose, opts = {}) {
43
+ const logger = toPinoLikeLogger(getChildLogger({ module: "baileys" }, { level: verbose ? "info" : "silent" }), verbose ? "info" : "silent");
44
+ const authDir = resolveUserPath(opts.authDir ?? resolveDefaultWebAuthDir());
45
+ await ensureDir(authDir);
46
+ const sessionLogger = getChildLogger({ module: "web-session" });
47
+ maybeRestoreCredsFromBackup(authDir);
48
+ const { state, saveCreds } = await useMultiFileAuthState(authDir);
49
+ const { version } = await fetchLatestBaileysVersion();
50
+ const sock = makeWASocket({
51
+ auth: {
52
+ creds: state.creds,
53
+ keys: makeCacheableSignalKeyStore(state.keys, logger)
54
+ },
55
+ version,
56
+ logger,
57
+ printQRInTerminal: false,
58
+ browser: [
59
+ "squidclaw",
60
+ "cli",
61
+ VERSION
62
+ ],
63
+ syncFullHistory: false,
64
+ markOnlineOnConnect: false
65
+ });
66
+ sock.ev.on("creds.update", () => enqueueSaveCreds(authDir, saveCreds, sessionLogger));
67
+ sock.ev.on("connection.update", (update) => {
68
+ try {
69
+ const { connection, lastDisconnect, qr } = update;
70
+ if (qr) {
71
+ opts.onQr?.(qr);
72
+ if (printQr) {
73
+ console.log("Scan this QR in WhatsApp (Linked Devices):");
74
+ qrcode.generate(qr, { small: true });
75
+ }
76
+ }
77
+ if (connection === "close") {
78
+ if (getStatusCode(lastDisconnect?.error) === DisconnectReason.loggedOut) console.error(danger(`WhatsApp session logged out. Run: ${formatCliCommand("squidclaw channels login")}`));
79
+ }
80
+ if (connection === "open" && verbose) console.log(success("WhatsApp Web connected."));
81
+ } catch (err) {
82
+ sessionLogger.error({ error: String(err) }, "connection.update handler error");
83
+ }
84
+ });
85
+ if (sock.ws && typeof sock.ws.on === "function") sock.ws.on("error", (err) => {
86
+ sessionLogger.error({ error: String(err) }, "WebSocket error");
87
+ });
88
+ return sock;
89
+ }
90
+ async function waitForWaConnection(sock) {
91
+ return new Promise((resolve, reject) => {
92
+ const evWithOff = sock.ev;
93
+ const handler = (...args) => {
94
+ const update = args[0] ?? {};
95
+ if (update.connection === "open") {
96
+ evWithOff.off?.("connection.update", handler);
97
+ resolve();
98
+ }
99
+ if (update.connection === "close") {
100
+ evWithOff.off?.("connection.update", handler);
101
+ reject(update.lastDisconnect ?? /* @__PURE__ */ new Error("Connection closed"));
102
+ }
103
+ };
104
+ sock.ev.on("connection.update", handler);
105
+ });
106
+ }
107
+ function getStatusCode(err) {
108
+ return err?.output?.statusCode ?? err?.status;
109
+ }
110
+ function safeStringify(value, limit = 800) {
111
+ try {
112
+ const seen = /* @__PURE__ */ new WeakSet();
113
+ const raw = JSON.stringify(value, (_key, v) => {
114
+ if (typeof v === "bigint") return v.toString();
115
+ if (typeof v === "function") {
116
+ const maybeName = v.name;
117
+ return `[Function ${typeof maybeName === "string" && maybeName.length > 0 ? maybeName : "anonymous"}]`;
118
+ }
119
+ if (typeof v === "object" && v) {
120
+ if (seen.has(v)) return "[Circular]";
121
+ seen.add(v);
122
+ }
123
+ return v;
124
+ }, 2);
125
+ if (!raw) return String(value);
126
+ return raw.length > limit ? `${raw.slice(0, limit)}…` : raw;
127
+ } catch {
128
+ return String(value);
129
+ }
130
+ }
131
+ function extractBoomDetails(err) {
132
+ if (!err || typeof err !== "object") return null;
133
+ const output = err?.output;
134
+ if (!output || typeof output !== "object") return null;
135
+ const payload = output.payload;
136
+ const statusCode = typeof output.statusCode === "number" ? output.statusCode : typeof payload?.statusCode === "number" ? payload.statusCode : void 0;
137
+ const error = typeof payload?.error === "string" ? payload.error : void 0;
138
+ const message = typeof payload?.message === "string" ? payload.message : void 0;
139
+ if (!statusCode && !error && !message) return null;
140
+ return {
141
+ statusCode,
142
+ error,
143
+ message
144
+ };
145
+ }
146
+ function formatError(err) {
147
+ if (err instanceof Error) return err.message;
148
+ if (typeof err === "string") return err;
149
+ if (!err || typeof err !== "object") return String(err);
150
+ const boom = extractBoomDetails(err) ?? extractBoomDetails(err?.error) ?? extractBoomDetails(err?.lastDisconnect?.error);
151
+ const status = boom?.statusCode ?? getStatusCode(err);
152
+ const code = err?.code;
153
+ const codeText = typeof code === "string" || typeof code === "number" ? String(code) : void 0;
154
+ const message = [
155
+ boom?.message,
156
+ typeof err?.message === "string" ? err.message : void 0,
157
+ typeof err?.error?.message === "string" ? err.error?.message : void 0
158
+ ].filter((v) => Boolean(v && v.trim().length > 0))[0];
159
+ const pieces = [];
160
+ if (typeof status === "number") pieces.push(`status=${status}`);
161
+ if (boom?.error) pieces.push(boom.error);
162
+ if (message) pieces.push(message);
163
+ if (codeText) pieces.push(`code=${codeText}`);
164
+ if (pieces.length > 0) return pieces.join(" ");
165
+ return safeStringify(err);
166
+ }
167
+
168
+ //#endregion
169
+ export { waitForWaConnection as i, formatError as n, getStatusCode as r, createWaSocket as t };
@@ -4,7 +4,7 @@ import chalk, { Chalk } from "chalk";
4
4
  import fs, { constants, createWriteStream } from "node:fs";
5
5
  import { Logger } from "tslog";
6
6
  import os from "node:os";
7
- import JSON5 from "json5";
7
+ import json5 from "json5";
8
8
  import { promisify } from "node:util";
9
9
  import fs$1 from "node:fs/promises";
10
10
  import "@clack/prompts";
@@ -766,7 +766,7 @@ function readLoggingConfig() {
766
766
  try {
767
767
  if (!fs.existsSync(configPath)) return;
768
768
  const raw = fs.readFileSync(configPath, "utf-8");
769
- const logging = JSON5.parse(raw)?.logging;
769
+ const logging = json5.parse(raw)?.logging;
770
770
  if (!logging || typeof logging !== "object" || Array.isArray(logging)) return;
771
771
  return logging;
772
772
  } catch {