squidclaw 3.0.4 → 3.0.5

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 (372) hide show
  1. package/dist/{accounts-CkF7YwoF.js → accounts-B3tweNWP.js} +4 -4
  2. package/dist/{accounts-CK_sHUyT.js → accounts-C_l8KCRi.js} +2 -2
  3. package/dist/{accounts-DbloMfwT.js → accounts-ZiDDa9KJ.js} +2 -2
  4. package/dist/{active-listener-AepfNSUY.js → active-listener-Ccd2xBZE.js} +2 -2
  5. package/dist/{agents-JnnOlm2G.js → agents-IDAdnabb.js} +5 -5
  6. package/dist/{agents.config-BeGeS2jv.js → agents.config-DF51cWyU.js} +1 -1
  7. package/dist/{agents.config-DHJBQ7uA.js → agents.config-iIxcfoac.js} +1 -1
  8. package/dist/{plugin-sdk/api-key-rotation-DE4gr5YM.js → api-key-rotation-C-dRYWuo.js} +2 -2
  9. package/dist/{audio-preflight-BKgdc7dS.js → audio-preflight-BYOECG4f.js} +30 -30
  10. package/dist/{audio-transcription-runner-BnbdYMDl.js → audio-transcription-runner-CPEhpuLO.js} +12 -12
  11. package/dist/{audit-membership-runtime-DyLj-uhz.js → audit-membership-runtime-CPJnbh0Q.js} +3 -3
  12. package/dist/{auth-choice-xwYK6txn.js → auth-choice-BnBwCCXv.js} +2 -2
  13. package/dist/{auth-choice-DQbCl-4F.js → auth-choice-Da4gjROu.js} +2 -2
  14. package/dist/{banner-BxibaqUz.js → banner-BBId5XNb.js} +1 -1
  15. package/dist/build-info.json +3 -3
  16. package/dist/bundled/boot-md/handler.js +49 -49
  17. package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
  18. package/dist/bundled/command-logger/handler.js +1 -1
  19. package/dist/bundled/session-memory/handler.js +49 -49
  20. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  21. package/dist/{channel-activity-C5kTj83_.js → channel-activity-Dmu5wZZC.js} +3 -3
  22. package/dist/{channel-options-FdCN4cFo.js → channel-options-BTUJmt49.js} +1 -1
  23. package/dist/{channel-options-BKsCYdHu.js → channel-options-C5QMYKJH.js} +1 -1
  24. package/dist/{channel-web-BkYtM8H5.js → channel-web-BDBaYap6.js} +1 -1
  25. package/dist/{channel-web-BFUPrpIe.js → channel-web-DXQukfrw.js} +1 -1
  26. package/dist/{channels-cli-CZzGaGvG.js → channels-cli-CodE2_4U.js} +7 -7
  27. package/dist/{channels-cli-BxhfVD-R.js → channels-cli-nZFTWJm3.js} +7 -7
  28. package/dist/{chrome-CjxCwFA9.js → chrome-BuS4b_BB.js} +15 -15
  29. package/dist/cli/daemon-cli.js +1 -1
  30. package/dist/{cli-bXiYaLre.js → cli-cvjr3PJM.js} +2 -2
  31. package/dist/{cli-GSev2Q95.js → cli-xa7nfGYO.js} +2 -2
  32. package/dist/{command-registry-CxiSVXru.js → command-registry-De6cz7-E.js} +9 -9
  33. package/dist/{commands-registry-D6ZOTo1C.js → commands-registry-BjVOLvf0.js} +4 -4
  34. package/dist/{completion-cli-s0fxD0OE.js → completion-cli-D-XlEj2O.js} +2 -2
  35. package/dist/{completion-cli-slzdOlRV.js → completion-cli-DFItGNcw.js} +1 -1
  36. package/dist/{config-cli-C0mk9eRl.js → config-cli-CiS7hyXQ.js} +1 -1
  37. package/dist/{config-cli-DhHEA_Nc.js → config-cli-DIU6V325.js} +1 -1
  38. package/dist/{configure-FRd92XZ8.js → configure-BMXU0of9.js} +6 -6
  39. package/dist/{configure-CeLdVVyh.js → configure-COgj88fo.js} +6 -6
  40. package/dist/{daemon-cli-DN2TnjHQ.js → daemon-cli-CE2oMOil.js} +1 -1
  41. package/dist/{daemon-cli-CNi-QjEX.js → daemon-cli-Doz3CsCY.js} +1 -1
  42. package/dist/{deliver-D-f6Wa3i.js → deliver-C8FulfkW.js} +11 -11
  43. package/dist/deliver-runtime-DAHX6Egt.js +36 -0
  44. package/dist/deps-send-discord.runtime-6_M_KIhD.js +26 -0
  45. package/dist/deps-send-imessage.runtime-KQo4sl7j.js +25 -0
  46. package/dist/deps-send-signal.runtime-_JnikN9v.js +24 -0
  47. package/dist/deps-send-slack.runtime-AAGitgm1.js +22 -0
  48. package/dist/deps-send-telegram.runtime-CVNYJjEt.js +27 -0
  49. package/dist/deps-send-whatsapp.runtime-5oLdo69Y.js +60 -0
  50. package/dist/{deps-send-whatsapp.runtime-BcxCalPD.js → deps-send-whatsapp.runtime-Bk0MRFLz.js} +4 -4
  51. package/dist/{deps-send-whatsapp.runtime-Dl4ro-Df.js → deps-send-whatsapp.runtime-DSZbuJSf.js} +4 -4
  52. package/dist/{diagnostic-ySwZga6c.js → diagnostic-D2vYK6Fg.js} +2 -2
  53. package/dist/{doctor-completion-I-WDZUs1.js → doctor-completion-8rS5Omw7.js} +1 -1
  54. package/dist/{doctor-completion-mnJOkoQ_.js → doctor-completion-BiDcNo6Q.js} +1 -1
  55. package/dist/entry.js +2 -2
  56. package/dist/{plugin-sdk/errors-9oVz7reJ.js → errors-KKxnQK8G.js} +1 -1
  57. package/dist/{fetch-BLS7EMnx.js → fetch-DCLFwngk.js} +4 -4
  58. package/dist/{fetch-guard-D0fXNJls.js → fetch-guard-bk7uDnb8.js} +2 -2
  59. package/dist/{frontmatter-Cq1TcIQ2.js → frontmatter-EuNpTTq9.js} +3 -3
  60. package/dist/{fs-safe-BoB4X3GD.js → fs-safe-DdANjYLv.js} +3 -3
  61. package/dist/{gateway-cli-B5rTNvd7.js → gateway-cli-COXjaMFJ.js} +10 -10
  62. package/dist/{gateway-cli-BHfkbI0u.js → gateway-cli-CVV2dd-0.js} +10 -10
  63. package/dist/{health-CJgEuWuG.js → health-CHe6jetL.js} +1 -1
  64. package/dist/{health-dZqyhpdR.js → health-CODYcJkj.js} +1 -1
  65. package/dist/{hooks-cli-BD4Ww1dF.js → hooks-cli-Cd9srSlj.js} +3 -3
  66. package/dist/{hooks-cli-C0wWJOBW.js → hooks-cli-f3VAZszh.js} +3 -3
  67. package/dist/{image-C-C7hQ26.js → image-DYXL4Dt_.js} +6 -6
  68. package/dist/{image-ops-CdgypS_g.js → image-ops-Dly8SSF7.js} +2 -2
  69. package/dist/image-runtime-DsgEYYCB.js +29 -0
  70. package/dist/index.js +7 -7
  71. package/dist/{ir-BvisJWXv.js → ir-BxAD7czj.js} +8 -8
  72. package/dist/{legacy-names-aGJJuzM_.js → legacy-names-CrhimhR4.js} +1 -1
  73. package/dist/llm-slug-generator.js +49 -49
  74. package/dist/{logger-CnTSBL7T.js → logger-CNkhF83z.js} +1 -1
  75. package/dist/{login-BMeLPUiO.js → login-BfH1AL2k.js} +5 -5
  76. package/dist/{login-qr-B2B67qqQ.js → login-qr-c2E295av.js} +8 -8
  77. package/dist/{manager-DdxMYEDd.js → manager-Bw9MibiQ.js} +9 -9
  78. package/dist/manager-runtime-BaiUrBAz.js +18 -0
  79. package/dist/{model-selection-ag9BmVct.js → model-selection-aT08Cbr0.js} +10 -10
  80. package/dist/{models-BXT0s4KJ.js → models-BtRE9AsP.js} +3 -3
  81. package/dist/{models-cli-BwPFxWK2.js → models-cli-Dj4eTFQ6.js} +4 -4
  82. package/dist/{models-cli-BtLc9uPC.js → models-cli-Vn7VG0Mg.js} +3 -3
  83. package/dist/{npm-resolution-DWpNPsBF.js → npm-resolution-DEbLpq7-.js} +1 -1
  84. package/dist/{npm-resolution-Djbuzx6o.js → npm-resolution-DRj9EZYQ.js} +1 -1
  85. package/dist/{onboard-BP2Cr_Xy.js → onboard-DRyS50DA.js} +3 -3
  86. package/dist/{onboard-CCJCvPgf.js → onboard-Dzozp7bp.js} +3 -3
  87. package/dist/{onboard-channels-CXjnFvP1.js → onboard-channels-CZ5_aWYh.js} +2 -2
  88. package/dist/{onboard-channels-CHrtFmhi.js → onboard-channels-HPa4NzTv.js} +2 -2
  89. package/dist/{onboard-helpers-ByttGRIZ.js → onboard-helpers-PXSBTzql.js} +10 -6
  90. package/dist/{onboard-helpers-Bvpkyuwm.js → onboard-helpers-R4b3Kr01.js} +10 -6
  91. package/dist/{onboard-remote-Cfx2v9OI.js → onboard-remote-9ShnuysR.js} +1 -1
  92. package/dist/{onboard-remote-DxBaaS6o.js → onboard-remote-xgST1KeC.js} +1 -1
  93. package/dist/{onboard-skills-B7pHg1lN.js → onboard-skills-B7Q69fhO.js} +1 -1
  94. package/dist/{onboard-skills-PCnCZ6Od.js → onboard-skills-DOaiUlDS.js} +1 -1
  95. package/dist/{onboarding-D7CIbxzd.js → onboarding-D8yzBiwp.js} +7 -7
  96. package/dist/{onboarding-D5G87dvM.js → onboarding-DpKLGw-P.js} +7 -7
  97. package/dist/{onboarding.finalize-B1MmYTFV.js → onboarding.finalize-Blks6x4H.js} +7 -7
  98. package/dist/{onboarding.finalize-Cxzl-fYU.js → onboarding.finalize-YFmR3rfz.js} +6 -6
  99. package/dist/{onboarding.gateway-config-DDdX0W74.js → onboarding.gateway-config-4L8AnL42.js} +1 -1
  100. package/dist/{onboarding.gateway-config-DNUJ0seU.js → onboarding.gateway-config-BLIUBAtE.js} +1 -1
  101. package/dist/{outbound-DHDBvGLA.js → outbound-BJNHKrk8.js} +6 -6
  102. package/dist/{outbound-attachment-CqXiWbKN.js → outbound-attachment-qvD-NbIp.js} +2 -2
  103. package/dist/{path-alias-guards-DORgbZ1w.js → path-alias-guards-VI6pee_i.js} +1 -1
  104. package/dist/{paths-DSd911Oe.js → paths-DH4hVuGM.js} +1 -1
  105. package/dist/{pi-embedded-CHzwPt6X.js → pi-embedded-CZFbSZlb.js} +85 -85
  106. package/dist/{pi-embedded-helpers-Bse_QhEf.js → pi-embedded-helpers-CSG6fsiY.js} +19 -19
  107. package/dist/{pi-model-discovery-DAzuqPoG.js → pi-model-discovery-BbP0l7V0.js} +1 -1
  108. package/dist/pi-model-discovery-runtime-DHUCh3qR.js +11 -0
  109. package/dist/{pi-tools.before-tool-call.runtime-2Sp1jmlg.js → pi-tools.before-tool-call.runtime-CS0hOgiM.js} +7 -7
  110. package/dist/{plugin-registry-CLEhrKYA.js → plugin-registry-8GqJnXZm.js} +1 -1
  111. package/dist/{plugin-registry-DtuxmgWx.js → plugin-registry-DURw0MYp.js} +1 -1
  112. package/dist/plugin-sdk/{accounts-kr-Gz1hk.js → accounts-DghIDNk2.js} +2 -2
  113. package/dist/plugin-sdk/{accounts-CxUSDHsT.js → accounts-YTdQYQFr.js} +3 -3
  114. package/dist/plugin-sdk/{accounts-PSzw-z3S.js → accounts-h__dTrLK.js} +2 -2
  115. package/dist/plugin-sdk/{active-listener-CTsLn1AX.js → active-listener-_PRYjtJv.js} +2 -2
  116. package/dist/plugin-sdk/{api-key-rotation-Bhck7wki.js → api-key-rotation-mVDSAkKQ.js} +2 -2
  117. package/dist/plugin-sdk/{audio-preflight-_xgGaeho.js → audio-preflight-BZlQM-qX.js} +26 -26
  118. package/dist/plugin-sdk/{audio-transcription-runner-Dwc0Eh-B.js → audio-transcription-runner-CrYTX8py.js} +11 -11
  119. package/dist/plugin-sdk/{audit-membership-runtime-DHQDvH4u.js → audit-membership-runtime-Xl20kCBe.js} +2 -2
  120. package/dist/plugin-sdk/{channel-activity-XajEg_DL.js → channel-activity-gwxRn4wF.js} +3 -3
  121. package/dist/plugin-sdk/{channel-web-KtqCp4mz.js → channel-web-1WF-Nabe.js} +18 -18
  122. package/dist/plugin-sdk/{chrome-diV5m81I.js → chrome-BXbYwXRH.js} +6 -6
  123. package/dist/plugin-sdk/{commands-registry-DwZAJuut.js → commands-registry-0w-aZenK.js} +4 -4
  124. package/dist/plugin-sdk/{common-CqnO92P8.js → common-DBOCt6Yv.js} +2 -2
  125. package/dist/plugin-sdk/{config-DYbtdrsT.js → config-pRtEoVyZ.js} +7 -7
  126. package/dist/plugin-sdk/{deliver-DG_7Uagn.js → deliver-FjlJrtZk.js} +10 -10
  127. package/dist/plugin-sdk/deliver-runtime-DEzvpBW1.js +32 -0
  128. package/dist/plugin-sdk/deps-send-discord.runtime-Bhusa_Hi.js +23 -0
  129. package/dist/plugin-sdk/deps-send-imessage.runtime-bmakPm5f.js +22 -0
  130. package/dist/plugin-sdk/deps-send-signal.runtime-n00sfFto.js +21 -0
  131. package/dist/plugin-sdk/deps-send-slack.runtime-BvM3Z-Mr.js +19 -0
  132. package/dist/plugin-sdk/deps-send-telegram.runtime-CPuMkcmo.js +24 -0
  133. package/dist/plugin-sdk/deps-send-whatsapp.runtime-BzO6S-KX.js +57 -0
  134. package/dist/plugin-sdk/{diagnostic-CT7v_kM2.js → diagnostic-Dt2i3afe.js} +2 -2
  135. package/dist/plugin-sdk/{errors-B8oJXuCF.js → errors-CgRPdp3o.js} +1 -1
  136. package/dist/plugin-sdk/{fetch-guard-Or5BCq0E.js → fetch-guard-DyPZh8r2.js} +2 -2
  137. package/dist/plugin-sdk/{fs-safe-DFbwq9CS.js → fs-safe-DqCO1D4C.js} +3 -3
  138. package/dist/plugin-sdk/{image-rycGCqJO.js → image-CQ9TZ9vq.js} +6 -6
  139. package/dist/plugin-sdk/{image-ops-CMsocOob.js → image-ops-sw0uZ0GN.js} +2 -2
  140. package/dist/plugin-sdk/image-runtime-17_mTqsy.js +25 -0
  141. package/dist/plugin-sdk/index.js +50 -50
  142. package/dist/plugin-sdk/{ir-DihI2SIz.js → ir-BVZ5kUMb.js} +7 -7
  143. package/dist/plugin-sdk/{local-roots-1xVosTZ4.js → local-roots-fO3ZgW3G.js} +4 -4
  144. package/dist/plugin-sdk/{logger-Bg4vIUJn.js → logger-DIb2cGHp.js} +2 -2
  145. package/dist/plugin-sdk/{login-YhFrVUWo.js → login-Dg5cxB_3.js} +4 -4
  146. package/dist/plugin-sdk/{login-qr-SpUTuwYv.js → login-qr-C3Vn30cq.js} +5 -5
  147. package/dist/plugin-sdk/{manager-DrzOPeMD.js → manager-BR-TwWTH.js} +8 -8
  148. package/dist/plugin-sdk/manager-runtime-CvI9wF8N.js +15 -0
  149. package/dist/plugin-sdk/mattermost.js +3 -3
  150. package/dist/plugin-sdk/{outbound-Cc4cUn9K.js → outbound-1a3Z_QJ2.js} +5 -5
  151. package/dist/plugin-sdk/{outbound-attachment-Dtp3hQgc.js → outbound-attachment-BTQjD4YE.js} +2 -2
  152. package/dist/plugin-sdk/{path-alias-guards-gBhrAn14.js → path-alias-guards-TnxupPQC.js} +1 -1
  153. package/dist/plugin-sdk/{paths-CP67O8eN.js → paths-B7_75Pdr.js} +1 -1
  154. package/dist/plugin-sdk/{pi-embedded-helpers-BDJ_4Plh.js → pi-embedded-helpers-DZRNadD8.js} +16 -16
  155. package/dist/plugin-sdk/{pi-model-discovery-Mk0GTDJl.js → pi-model-discovery-DGh6xekX.js} +1 -1
  156. package/dist/plugin-sdk/pi-model-discovery-runtime-DjjBdPYt.js +8 -0
  157. package/dist/plugin-sdk/{pi-tools.before-tool-call.runtime-DV72wTDb.js → pi-tools.before-tool-call.runtime-BZ9XgG_x.js} +4 -4
  158. package/dist/plugin-sdk/{plugins-DSs2-fnK.js → plugins-B8pWVYug.js} +4 -4
  159. package/dist/plugin-sdk/{proxy-env-Ib4-LUh-.js → proxy-env-BOlkiW1-.js} +1 -1
  160. package/dist/plugin-sdk/{proxy-fetch-ZPEvp58f.js → proxy-fetch-Dt5BedH8.js} +1 -1
  161. package/dist/plugin-sdk/{pw-ai-DIx2wpkY.js → pw-ai-C17A1o4w.js} +9 -9
  162. package/dist/plugin-sdk/{qmd-manager-Ov9ElEfG.js → qmd-manager-Bei6TaFq.js} +7 -7
  163. package/dist/plugin-sdk/{query-expansion-CzjwW461.js → query-expansion-POz2za8a.js} +4 -4
  164. package/dist/plugin-sdk/{redact-DfACyt0X.js → redact-9WsNyb7S.js} +1 -1
  165. package/dist/plugin-sdk/{reply-CWWUd_JS.js → reply-BFbijn6_.js} +73 -73
  166. package/dist/plugin-sdk/{resolve-outbound-target-BOkvxZtM.js → resolve-outbound-target-B9iFEh0y.js} +2 -2
  167. package/dist/plugin-sdk/{run-with-concurrency-kVooFCVo.js → run-with-concurrency-DmTrN5JG.js} +1 -1
  168. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DzhkSmLi.js +10 -0
  169. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DyILWezU.js +19 -0
  170. package/dist/plugin-sdk/{send-BP1fSEBR.js → send-BGZo6HW1.js} +5 -5
  171. package/dist/plugin-sdk/{send-D9CSOGul.js → send-BisREGBZ.js} +6 -6
  172. package/dist/plugin-sdk/{send-BeLBlAsQ.js → send-BqkUDZed.js} +13 -13
  173. package/dist/plugin-sdk/{send-DLKxJJYV.js → send-D6_nNvi0.js} +8 -8
  174. package/dist/plugin-sdk/{send-XZ6IXCtL.js → send-Dj7XEcZN.js} +7 -7
  175. package/dist/plugin-sdk/{session-DtLUYWvY.js → session-D4KDs7Hq.js} +3 -3
  176. package/dist/plugin-sdk/{skill-commands-Bv7EZypt.js → skill-commands-D_xeseiI.js} +4 -4
  177. package/dist/plugin-sdk/{skills-BzXN4uev.js → skills-Bs2b3JfV.js} +6 -6
  178. package/dist/plugin-sdk/slash-commands.runtime-CUb5sqqf.js +13 -0
  179. package/dist/plugin-sdk/slash-dispatch.runtime-DCB6bGjB.js +52 -0
  180. package/dist/plugin-sdk/slash-skill-commands.runtime-BqEweE4K.js +16 -0
  181. package/dist/plugin-sdk/{store-DnJhFFW5.js → store-B7ESm9_L.js} +2 -2
  182. package/dist/plugin-sdk/subagent-registry-runtime-CCUW4SbM.js +52 -0
  183. package/dist/plugin-sdk/{tables-CpmqssLF.js → tables-1vhBJPK_.js} +1 -1
  184. package/dist/plugin-sdk/{thinking-1UCPuD9d.js → thinking-DjaClmzi.js} +7 -7
  185. package/dist/plugin-sdk/{tokens-DAL_5WHL.js → tokens-CLE20fRI.js} +1 -1
  186. package/dist/plugin-sdk/{tool-images-RX4QTMnt.js → tool-images-B95xcwiR.js} +2 -2
  187. package/dist/plugin-sdk/web-DeRmHQ4_.js +56 -0
  188. package/dist/plugin-sdk/{whatsapp-actions-BF6ih4Gi.js → whatsapp-actions-BYpcWkTN.js} +17 -17
  189. package/dist/plugin-sdk/whatsapp.js +50 -50
  190. package/dist/{plugins-DXkm70nK.js → plugins-Cg99ej4a.js} +6 -6
  191. package/dist/{plugins-cli-Cs3UUJew.js → plugins-cli-DmTsD71d.js} +3 -3
  192. package/dist/{plugins-cli-KPz6APX0.js → plugins-cli-DpZYmju3.js} +3 -3
  193. package/dist/{program-2J-jgdfk.js → program-DSb6ocNC.js} +8 -8
  194. package/dist/{program-context-SjYSWx_N.js → program-context-ooZUt2gS.js} +18 -18
  195. package/dist/{prompt-select-styled-Baiu3mAU.js → prompt-select-styled-BflFyz9P.js} +5 -5
  196. package/dist/{prompt-select-styled-DPnVmH8f.js → prompt-select-styled-Dt-WhnQ0.js} +5 -5
  197. package/dist/{provider-auth-helpers-CxUWqt95.js → provider-auth-helpers-DVomEnsq.js} +1 -1
  198. package/dist/{provider-auth-helpers-hhFVhZdv.js → provider-auth-helpers-o8UcxFzE.js} +1 -1
  199. package/dist/{proxy-env-D75CWSOo.js → proxy-env-BNo93HMb.js} +1 -1
  200. package/dist/{plugin-sdk/proxy-fetch-Cf3IUSDw.js → proxy-fetch-xYMu9mkn.js} +1 -1
  201. package/dist/{push-apns-BBkpZyNR.js → push-apns-ByOCwUIb.js} +1 -1
  202. package/dist/{push-apns-BQjV_93G.js → push-apns-C7qyD1SB.js} +1 -1
  203. package/dist/{pw-ai-BwRP3TWc.js → pw-ai-DGILOk_h.js} +12 -12
  204. package/dist/{qmd-manager-BN0siR2Z.js → qmd-manager-BWffUeZv.js} +9 -9
  205. package/dist/{query-expansion-Dzxt6kXo.js → query-expansion-yY0Xn9Kw.js} +4 -4
  206. package/dist/{plugin-sdk/redact-BoNEjbpF.js → redact-CNCiJdri.js} +1 -1
  207. package/dist/{register.agent-reU63wQ5.js → register.agent-CqJmJqZY.js} +7 -7
  208. package/dist/{register.agent-DYq06QHS.js → register.agent-fGunIm89.js} +8 -8
  209. package/dist/{register.configure-CCkfhF-7.js → register.configure-BSC7QkD7.js} +10 -10
  210. package/dist/{register.configure-Ao1K2uze.js → register.configure-BYOtTrkD.js} +10 -10
  211. package/dist/{register.maintenance-pLpE2oF-.js → register.maintenance-BvrntMJ0.js} +9 -9
  212. package/dist/{register.maintenance-DMbs8w2m.js → register.maintenance-q9TelW4m.js} +8 -8
  213. package/dist/{register.message-BmsovYS6.js → register.message-CIpJNwpb.js} +3 -3
  214. package/dist/{register.message-Bp4SDXWk.js → register.message-gTJNayB2.js} +3 -3
  215. package/dist/{register.onboard-IMrHOeW_.js → register.onboard-CWYauTOU.js} +3 -3
  216. package/dist/{register.onboard-Cb8xLIye.js → register.onboard-CdLxC6e6.js} +3 -3
  217. package/dist/{register.setup-DU7IDzAv.js → register.setup-BCWevQ6z.js} +3 -3
  218. package/dist/{register.setup-CX8IUmew.js → register.setup-BVQjSCo7.js} +3 -3
  219. package/dist/{register.status-health-sessions-N6SFc-UY.js → register.status-health-sessions-7J5qMNiH.js} +4 -4
  220. package/dist/{register.status-health-sessions-CBPZoj51.js → register.status-health-sessions-D6Z0cWR2.js} +4 -4
  221. package/dist/{register.subclis-BIbL6FBV.js → register.subclis-CaQKvJ0R.js} +10 -10
  222. package/dist/{reply-CB1p166g.js → reply-lnANjYYy.js} +5 -5
  223. package/dist/{run-main-CpDZPsC_.js → run-main-fZjFwk8-.js} +15 -15
  224. package/dist/{run-with-concurrency-BFR3ReeF.js → run-with-concurrency-D05zyBvx.js} +3 -3
  225. package/dist/runtime-whatsapp-login.runtime-B4wlBpXd.js +13 -0
  226. package/dist/runtime-whatsapp-outbound.runtime-Bw-aS4TH.js +22 -0
  227. package/dist/{send-Do7hKDL9.js → send-CVe_wjZr.js} +7 -7
  228. package/dist/{send-bW7jDv8D.js → send-DTmXRnXD.js} +14 -14
  229. package/dist/{send-DjL7KlMV.js → send-Dg2OQTBD.js} +8 -8
  230. package/dist/{send-C98RfcAb.js → send-Ds2QFFHB.js} +5 -5
  231. package/dist/{send-Co5Bqwuo.js → send-rtczuBFr.js} +6 -6
  232. package/dist/{server-node-events-Ctjzvlem.js → server-node-events-ByTGIHN6.js} +3 -3
  233. package/dist/{server-node-events-DrCKK0J4.js → server-node-events-CZSHLRjW.js} +3 -3
  234. package/dist/{session-QSn69XeJ.js → session-B-spPtFw.js} +4 -4
  235. package/dist/{skill-commands-Bi_jchJn.js → skill-commands-BU_EPKGI.js} +5 -5
  236. package/dist/{skills-CTV78w4q.js → skills-BMJJ-o7Q.js} +7 -7
  237. package/dist/slash-commands.runtime-BVe8kFs6.js +16 -0
  238. package/dist/slash-dispatch.runtime--zkPOYs8.js +56 -0
  239. package/dist/{slash-dispatch.runtime-uqWhoI6q.js → slash-dispatch.runtime-aOd34tJL.js} +2 -2
  240. package/dist/{slash-dispatch.runtime-DRGqAgwa.js → slash-dispatch.runtime-oqezzRLs.js} +2 -2
  241. package/dist/slash-skill-commands.runtime-DWkdPFic.js +20 -0
  242. package/dist/{status-BkfSGlOi.js → status-CLisA75R.js} +3 -3
  243. package/dist/{status-DdW571-j.js → status-DWG2unIb.js} +3 -3
  244. package/dist/{store-B89Hj8Ub.js → store-BZJ7k8zI.js} +2 -2
  245. package/dist/{subagent-registry-DGrfQVN3.js → subagent-registry-DIG5cv0C.js} +5 -5
  246. package/dist/{subagent-registry-runtime-Dsrz3yIh.js → subagent-registry-runtime-Cwu64xxS.js} +2 -2
  247. package/dist/subagent-registry-runtime-DcF6pbCz.js +56 -0
  248. package/dist/{subagent-registry-runtime-DatTO2LD.js → subagent-registry-runtime-Dn9NdIkG.js} +2 -2
  249. package/dist/{subsystem-6v7sWnAD.js → subsystem-DwbSi7gL.js} +2 -2
  250. package/dist/{tables-DGHzaXQz.js → tables-DCs7kcl5.js} +1 -1
  251. package/dist/{plugin-sdk/target-errors-aOwE-MIU.js → target-errors-p185Iwir.js} +2 -2
  252. package/dist/{thinking-SdNGqtJE.js → thinking-C7-zgrYU.js} +7 -7
  253. package/dist/{tokens-DfbMVF9y.js → tokens-B9Gk6Ss5.js} +1 -1
  254. package/dist/{tool-images-8BKrL7Bn.js → tool-images-gH3TaDhx.js} +2 -2
  255. package/dist/{update-cli-TQEfxhWF.js → update-cli-BOA7uNXd.js} +9 -9
  256. package/dist/{update-cli-BwhvSo1R.js → update-cli-CxWkuyMh.js} +10 -10
  257. package/dist/{update-runner-CT9YRLtn.js → update-runner-4xWzr8_S.js} +1 -1
  258. package/dist/{update-runner-CqVLeGYA.js → update-runner-CBzd_nJ6.js} +1 -1
  259. package/dist/{web-FqoNMI-k.js → web-B4plqfoT.js} +3 -3
  260. package/dist/{web-B2qXyOb9.js → web-COBpRjL9.js} +3 -3
  261. package/dist/{web-DyCuTR9b.js → web-DNTMnpXn.js} +53 -53
  262. package/dist/{whatsapp-actions-BDkbnZVH.js → whatsapp-actions-BcYHedDV.js} +19 -19
  263. package/dist/{workspace-kVMIaBrV.js → workspace-C1XiGBnY.js} +2 -2
  264. package/package.json +1 -1
  265. package/dist/api-key-rotation-BHFJiYbw.js +0 -181
  266. package/dist/deliver-runtime-_egya0QZ.js +0 -36
  267. package/dist/deps-send-discord.runtime-BRE0s2nz.js +0 -26
  268. package/dist/deps-send-imessage.runtime-DbIRBnmD.js +0 -25
  269. package/dist/deps-send-signal.runtime-B4h6X3o4.js +0 -24
  270. package/dist/deps-send-slack.runtime-BWXOnOxS.js +0 -22
  271. package/dist/deps-send-telegram.runtime-YvauJtgv.js +0 -27
  272. package/dist/deps-send-whatsapp.runtime-CiG6xd2e.js +0 -60
  273. package/dist/errors-kkRuS2Cs.js +0 -54
  274. package/dist/image-runtime-D7n4dID4.js +0 -29
  275. package/dist/manager-runtime-BMygJEz3.js +0 -18
  276. package/dist/pi-model-discovery-runtime-Dpu7Jm2L.js +0 -11
  277. package/dist/plugin-sdk/accounts-BNuRM3rG.js +0 -288
  278. package/dist/plugin-sdk/accounts-CGTYP7Rh.js +0 -46
  279. package/dist/plugin-sdk/accounts-CcS9IAhD.js +0 -35
  280. package/dist/plugin-sdk/active-listener-BQNrTcR3.js +0 -50
  281. package/dist/plugin-sdk/audio-preflight-CRGLqp-g.js +0 -69
  282. package/dist/plugin-sdk/audio-transcription-runner-RXsskMMk.js +0 -2176
  283. package/dist/plugin-sdk/audit-membership-runtime-B9b-zRwg.js +0 -58
  284. package/dist/plugin-sdk/channel-activity-gPvD1D7S.js +0 -94
  285. package/dist/plugin-sdk/channel-web-LGl1zPJt.js +0 -2256
  286. package/dist/plugin-sdk/chrome-9Y_LcUg1.js +0 -2415
  287. package/dist/plugin-sdk/commands-registry-CcdEPxVg.js +0 -1125
  288. package/dist/plugin-sdk/config-CrQ5bCrw.js +0 -17912
  289. package/dist/plugin-sdk/deliver-D3xr5AkB.js +0 -1694
  290. package/dist/plugin-sdk/deliver-runtime-B79ZQu69.js +0 -32
  291. package/dist/plugin-sdk/deliver-runtime-BdTC7uKE.js +0 -32
  292. package/dist/plugin-sdk/deps-send-discord.runtime-BOQZIqC8.js +0 -23
  293. package/dist/plugin-sdk/deps-send-discord.runtime-CObCNMt3.js +0 -23
  294. package/dist/plugin-sdk/deps-send-imessage.runtime-CuHOc9Ka.js +0 -22
  295. package/dist/plugin-sdk/deps-send-imessage.runtime-DlWgi2DH.js +0 -22
  296. package/dist/plugin-sdk/deps-send-signal.runtime-Cz7FT8J8.js +0 -21
  297. package/dist/plugin-sdk/deps-send-signal.runtime-iPynghkE.js +0 -21
  298. package/dist/plugin-sdk/deps-send-slack.runtime-D4vDoRsg.js +0 -19
  299. package/dist/plugin-sdk/deps-send-slack.runtime-DNTbE5jS.js +0 -19
  300. package/dist/plugin-sdk/deps-send-telegram.runtime-7CR-xtCF.js +0 -24
  301. package/dist/plugin-sdk/deps-send-telegram.runtime-DjTVED_m.js +0 -24
  302. package/dist/plugin-sdk/deps-send-whatsapp.runtime-CRWOIKRC.js +0 -57
  303. package/dist/plugin-sdk/deps-send-whatsapp.runtime-bUi8kghi.js +0 -57
  304. package/dist/plugin-sdk/diagnostic-BXkLYs_9.js +0 -319
  305. package/dist/plugin-sdk/fetch-guard-C55uvn27.js +0 -156
  306. package/dist/plugin-sdk/fs-safe-Dqmpk-Fr.js +0 -352
  307. package/dist/plugin-sdk/image-3xW7IJdq.js +0 -2310
  308. package/dist/plugin-sdk/image-ops-BjK2qZZn.js +0 -584
  309. package/dist/plugin-sdk/image-runtime-CZZJJqcW.js +0 -25
  310. package/dist/plugin-sdk/image-runtime-Cjz368oj.js +0 -25
  311. package/dist/plugin-sdk/ir-CS7uuQhN.js +0 -1296
  312. package/dist/plugin-sdk/local-roots-DmOKwiNW.js +0 -186
  313. package/dist/plugin-sdk/logger-DDdrdbDu.js +0 -1163
  314. package/dist/plugin-sdk/login-BSEeU27Y.js +0 -57
  315. package/dist/plugin-sdk/login-qr-BwWJsDSj.js +0 -320
  316. package/dist/plugin-sdk/manager-DiXPCubI.js +0 -3917
  317. package/dist/plugin-sdk/manager-runtime-CF55pBNe.js +0 -15
  318. package/dist/plugin-sdk/manager-runtime-Ct0m9UJC.js +0 -15
  319. package/dist/plugin-sdk/outbound-attachment-BoFx05zw.js +0 -19
  320. package/dist/plugin-sdk/outbound-cpqK1GFe.js +0 -212
  321. package/dist/plugin-sdk/path-alias-guards-DA0MhfkG.js +0 -43
  322. package/dist/plugin-sdk/paths-C6W4VHoa.js +0 -166
  323. package/dist/plugin-sdk/pi-embedded-helpers-C-B9B6Sp.js +0 -9627
  324. package/dist/plugin-sdk/pi-model-discovery-BGEeoPzN.js +0 -134
  325. package/dist/plugin-sdk/pi-model-discovery-runtime-BHZ_Htob.js +0 -8
  326. package/dist/plugin-sdk/pi-model-discovery-runtime-BrwtJHPU.js +0 -8
  327. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-ByN_xThw.js +0 -354
  328. package/dist/plugin-sdk/plugins-D5cdn70e.js +0 -864
  329. package/dist/plugin-sdk/pw-ai-C_QOIuin.js +0 -1938
  330. package/dist/plugin-sdk/qmd-manager-6bozlfFg.js +0 -1448
  331. package/dist/plugin-sdk/query-expansion-eeVz_aEm.js +0 -1011
  332. package/dist/plugin-sdk/reply-CQUX_haM.js +0 -98828
  333. package/dist/plugin-sdk/resolve-outbound-target-Dbz0O8cR.js +0 -40
  334. package/dist/plugin-sdk/run-with-concurrency-5DMu9szx.js +0 -1994
  335. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DitS0I1z.js +0 -10
  336. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-OthrtsLL.js +0 -10
  337. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-CYCr6A3v.js +0 -19
  338. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-Q2HL0zL3.js +0 -19
  339. package/dist/plugin-sdk/send-BACEu1Un.js +0 -414
  340. package/dist/plugin-sdk/send-BU4OoR7u.js +0 -2587
  341. package/dist/plugin-sdk/send-DbxOJ_BC.js +0 -3135
  342. package/dist/plugin-sdk/send-n932vjT5.js +0 -540
  343. package/dist/plugin-sdk/send-uCPS53j8.js +0 -503
  344. package/dist/plugin-sdk/session-DenDKR_-.js +0 -169
  345. package/dist/plugin-sdk/skill-commands-BK1KDKmS.js +0 -342
  346. package/dist/plugin-sdk/skills-D4am-zkO.js +0 -1428
  347. package/dist/plugin-sdk/slash-commands.runtime-Bx1K1iqP.js +0 -13
  348. package/dist/plugin-sdk/slash-commands.runtime-DWfFqMZw.js +0 -13
  349. package/dist/plugin-sdk/slash-dispatch.runtime-DVn338JI.js +0 -52
  350. package/dist/plugin-sdk/slash-dispatch.runtime-pnWH5AjM.js +0 -52
  351. package/dist/plugin-sdk/slash-skill-commands.runtime-Dbi_YzPO.js +0 -16
  352. package/dist/plugin-sdk/slash-skill-commands.runtime-DxvNWv_E.js +0 -16
  353. package/dist/plugin-sdk/ssrf-2WBi1Tzx.js +0 -202
  354. package/dist/plugin-sdk/store-BKDMuvyn.js +0 -81
  355. package/dist/plugin-sdk/subagent-registry-runtime-FhP0l-Rw.js +0 -52
  356. package/dist/plugin-sdk/subagent-registry-runtime-hH9ADku1.js +0 -52
  357. package/dist/plugin-sdk/tables-CrDYcv_b.js +0 -55
  358. package/dist/plugin-sdk/thinking-D41FMh9T.js +0 -1206
  359. package/dist/plugin-sdk/tokens-CTIYTLWu.js +0 -52
  360. package/dist/plugin-sdk/tool-images-CWc54lpI.js +0 -274
  361. package/dist/plugin-sdk/web-AtEy-48y.js +0 -56
  362. package/dist/plugin-sdk/web-DjKONHqF.js +0 -56
  363. package/dist/plugin-sdk/whatsapp-actions-DEZcm_CZ.js +0 -80
  364. package/dist/proxy-fetch-lH6RsRTE.js +0 -38
  365. package/dist/redact-DvzicBMu.js +0 -319
  366. package/dist/runtime-whatsapp-login.runtime-DSR-m0FW.js +0 -13
  367. package/dist/runtime-whatsapp-outbound.runtime-Blywd_bv.js +0 -22
  368. package/dist/slash-commands.runtime-63MUmCBt.js +0 -16
  369. package/dist/slash-dispatch.runtime-DuJRl-LD.js +0 -56
  370. package/dist/slash-skill-commands.runtime-B3MSSAQ-.js +0 -20
  371. package/dist/subagent-registry-runtime-COygB9b1.js +0 -56
  372. package/dist/target-errors-CweAa7L9.js +0 -195
@@ -1,503 +0,0 @@
1
- import { n as loadConfig } from "./config-CrQ5bCrw.js";
2
- import { E as resolveUserPath, S as normalizeE164 } from "./logger-DDdrdbDu.js";
3
- import { m as kindFromMime } from "./image-ops-BjK2qZZn.js";
4
- import { r as resolveIMessageAccount } from "./accounts-CcS9IAhD.js";
5
- import { i as resolveMarkdownTableMode } from "./ir-CS7uuQhN.js";
6
- import { t as convertMarkdownTables } from "./tables-CrDYcv_b.js";
7
- import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-BoFx05zw.js";
8
- import { spawn } from "node:child_process";
9
- import { createInterface } from "node:readline";
10
-
11
- //#region src/plugin-sdk/allow-from.ts
12
- function formatAllowFromLowercase(params) {
13
- return params.allowFrom.map((entry) => String(entry).trim()).filter(Boolean).map((entry) => params.stripPrefixRe ? entry.replace(params.stripPrefixRe, "") : entry).map((entry) => entry.toLowerCase());
14
- }
15
- function isNormalizedSenderAllowed(params) {
16
- const normalizedAllow = formatAllowFromLowercase({
17
- allowFrom: params.allowFrom,
18
- stripPrefixRe: params.stripPrefixRe
19
- });
20
- if (normalizedAllow.length === 0) return false;
21
- if (normalizedAllow.includes("*")) return true;
22
- const sender = String(params.senderId).trim().toLowerCase();
23
- return normalizedAllow.includes(sender);
24
- }
25
- function isAllowedParsedChatSender(params) {
26
- const allowFrom = params.allowFrom.map((entry) => String(entry).trim());
27
- if (allowFrom.length === 0) return false;
28
- if (allowFrom.includes("*")) return true;
29
- const senderNormalized = params.normalizeSender(params.sender);
30
- const chatId = params.chatId ?? void 0;
31
- const chatGuid = params.chatGuid?.trim();
32
- const chatIdentifier = params.chatIdentifier?.trim();
33
- for (const entry of allowFrom) {
34
- if (!entry) continue;
35
- const parsed = params.parseAllowTarget(entry);
36
- if (parsed.kind === "chat_id" && chatId !== void 0) {
37
- if (parsed.chatId === chatId) return true;
38
- } else if (parsed.kind === "chat_guid" && chatGuid) {
39
- if (parsed.chatGuid === chatGuid) return true;
40
- } else if (parsed.kind === "chat_identifier" && chatIdentifier) {
41
- if (parsed.chatIdentifier === chatIdentifier) return true;
42
- } else if (parsed.kind === "handle" && senderNormalized) {
43
- if (parsed.handle === senderNormalized) return true;
44
- }
45
- }
46
- return false;
47
- }
48
-
49
- //#endregion
50
- //#region src/imessage/target-parsing-helpers.ts
51
- function stripPrefix(value, prefix) {
52
- return value.slice(prefix.length).trim();
53
- }
54
- function resolveServicePrefixedTarget(params) {
55
- for (const { prefix, service } of params.servicePrefixes) {
56
- if (!params.lower.startsWith(prefix)) continue;
57
- const remainder = stripPrefix(params.trimmed, prefix);
58
- if (!remainder) throw new Error(`${prefix} target is required`);
59
- const remainderLower = remainder.toLowerCase();
60
- if (params.isChatTarget(remainderLower)) return params.parseTarget(remainder);
61
- return {
62
- kind: "handle",
63
- to: remainder,
64
- service
65
- };
66
- }
67
- return null;
68
- }
69
- function parseChatTargetPrefixesOrThrow(params) {
70
- for (const prefix of params.chatIdPrefixes) if (params.lower.startsWith(prefix)) {
71
- const value = stripPrefix(params.trimmed, prefix);
72
- const chatId = Number.parseInt(value, 10);
73
- if (!Number.isFinite(chatId)) throw new Error(`Invalid chat_id: ${value}`);
74
- return {
75
- kind: "chat_id",
76
- chatId
77
- };
78
- }
79
- for (const prefix of params.chatGuidPrefixes) if (params.lower.startsWith(prefix)) {
80
- const value = stripPrefix(params.trimmed, prefix);
81
- if (!value) throw new Error("chat_guid is required");
82
- return {
83
- kind: "chat_guid",
84
- chatGuid: value
85
- };
86
- }
87
- for (const prefix of params.chatIdentifierPrefixes) if (params.lower.startsWith(prefix)) {
88
- const value = stripPrefix(params.trimmed, prefix);
89
- if (!value) throw new Error("chat_identifier is required");
90
- return {
91
- kind: "chat_identifier",
92
- chatIdentifier: value
93
- };
94
- }
95
- return null;
96
- }
97
- function resolveServicePrefixedAllowTarget(params) {
98
- for (const { prefix } of params.servicePrefixes) {
99
- if (!params.lower.startsWith(prefix)) continue;
100
- const remainder = stripPrefix(params.trimmed, prefix);
101
- if (!remainder) return {
102
- kind: "handle",
103
- handle: ""
104
- };
105
- return params.parseAllowTarget(remainder);
106
- }
107
- return null;
108
- }
109
- function parseChatAllowTargetPrefixes(params) {
110
- for (const prefix of params.chatIdPrefixes) if (params.lower.startsWith(prefix)) {
111
- const value = stripPrefix(params.trimmed, prefix);
112
- const chatId = Number.parseInt(value, 10);
113
- if (Number.isFinite(chatId)) return {
114
- kind: "chat_id",
115
- chatId
116
- };
117
- }
118
- for (const prefix of params.chatGuidPrefixes) if (params.lower.startsWith(prefix)) {
119
- const value = stripPrefix(params.trimmed, prefix);
120
- if (value) return {
121
- kind: "chat_guid",
122
- chatGuid: value
123
- };
124
- }
125
- for (const prefix of params.chatIdentifierPrefixes) if (params.lower.startsWith(prefix)) {
126
- const value = stripPrefix(params.trimmed, prefix);
127
- if (value) return {
128
- kind: "chat_identifier",
129
- chatIdentifier: value
130
- };
131
- }
132
- return null;
133
- }
134
-
135
- //#endregion
136
- //#region src/imessage/targets.ts
137
- const CHAT_ID_PREFIXES = [
138
- "chat_id:",
139
- "chatid:",
140
- "chat:"
141
- ];
142
- const CHAT_GUID_PREFIXES = [
143
- "chat_guid:",
144
- "chatguid:",
145
- "guid:"
146
- ];
147
- const CHAT_IDENTIFIER_PREFIXES = [
148
- "chat_identifier:",
149
- "chatidentifier:",
150
- "chatident:"
151
- ];
152
- const SERVICE_PREFIXES = [
153
- {
154
- prefix: "imessage:",
155
- service: "imessage"
156
- },
157
- {
158
- prefix: "sms:",
159
- service: "sms"
160
- },
161
- {
162
- prefix: "auto:",
163
- service: "auto"
164
- }
165
- ];
166
- function normalizeIMessageHandle(raw) {
167
- const trimmed = raw.trim();
168
- if (!trimmed) return "";
169
- const lowered = trimmed.toLowerCase();
170
- if (lowered.startsWith("imessage:")) return normalizeIMessageHandle(trimmed.slice(9));
171
- if (lowered.startsWith("sms:")) return normalizeIMessageHandle(trimmed.slice(4));
172
- if (lowered.startsWith("auto:")) return normalizeIMessageHandle(trimmed.slice(5));
173
- for (const prefix of CHAT_ID_PREFIXES) if (lowered.startsWith(prefix)) return `chat_id:${trimmed.slice(prefix.length).trim()}`;
174
- for (const prefix of CHAT_GUID_PREFIXES) if (lowered.startsWith(prefix)) return `chat_guid:${trimmed.slice(prefix.length).trim()}`;
175
- for (const prefix of CHAT_IDENTIFIER_PREFIXES) if (lowered.startsWith(prefix)) return `chat_identifier:${trimmed.slice(prefix.length).trim()}`;
176
- if (trimmed.includes("@")) return trimmed.toLowerCase();
177
- const normalized = normalizeE164(trimmed);
178
- if (normalized) return normalized;
179
- return trimmed.replace(/\s+/g, "");
180
- }
181
- function parseIMessageTarget(raw) {
182
- const trimmed = raw.trim();
183
- if (!trimmed) throw new Error("iMessage target is required");
184
- const lower = trimmed.toLowerCase();
185
- const servicePrefixed = resolveServicePrefixedTarget({
186
- trimmed,
187
- lower,
188
- servicePrefixes: SERVICE_PREFIXES,
189
- isChatTarget: (remainderLower) => CHAT_ID_PREFIXES.some((p) => remainderLower.startsWith(p)) || CHAT_GUID_PREFIXES.some((p) => remainderLower.startsWith(p)) || CHAT_IDENTIFIER_PREFIXES.some((p) => remainderLower.startsWith(p)),
190
- parseTarget: parseIMessageTarget
191
- });
192
- if (servicePrefixed) return servicePrefixed;
193
- const chatTarget = parseChatTargetPrefixesOrThrow({
194
- trimmed,
195
- lower,
196
- chatIdPrefixes: CHAT_ID_PREFIXES,
197
- chatGuidPrefixes: CHAT_GUID_PREFIXES,
198
- chatIdentifierPrefixes: CHAT_IDENTIFIER_PREFIXES
199
- });
200
- if (chatTarget) return chatTarget;
201
- return {
202
- kind: "handle",
203
- to: trimmed,
204
- service: "auto"
205
- };
206
- }
207
- function parseIMessageAllowTarget(raw) {
208
- const trimmed = raw.trim();
209
- if (!trimmed) return {
210
- kind: "handle",
211
- handle: ""
212
- };
213
- const lower = trimmed.toLowerCase();
214
- const servicePrefixed = resolveServicePrefixedAllowTarget({
215
- trimmed,
216
- lower,
217
- servicePrefixes: SERVICE_PREFIXES,
218
- parseAllowTarget: parseIMessageAllowTarget
219
- });
220
- if (servicePrefixed) return servicePrefixed;
221
- const chatTarget = parseChatAllowTargetPrefixes({
222
- trimmed,
223
- lower,
224
- chatIdPrefixes: CHAT_ID_PREFIXES,
225
- chatGuidPrefixes: CHAT_GUID_PREFIXES,
226
- chatIdentifierPrefixes: CHAT_IDENTIFIER_PREFIXES
227
- });
228
- if (chatTarget) return chatTarget;
229
- return {
230
- kind: "handle",
231
- handle: normalizeIMessageHandle(trimmed)
232
- };
233
- }
234
- function isAllowedIMessageSender(params) {
235
- return isAllowedParsedChatSender({
236
- allowFrom: params.allowFrom,
237
- sender: params.sender,
238
- chatId: params.chatId,
239
- chatGuid: params.chatGuid,
240
- chatIdentifier: params.chatIdentifier,
241
- normalizeSender: normalizeIMessageHandle,
242
- parseAllowTarget: parseIMessageAllowTarget
243
- });
244
- }
245
- function formatIMessageChatTarget(chatId) {
246
- if (!chatId || !Number.isFinite(chatId)) return "";
247
- return `chat_id:${chatId}`;
248
- }
249
-
250
- //#endregion
251
- //#region src/imessage/constants.ts
252
- /** Default timeout for iMessage probe/RPC operations (10 seconds). */
253
- const DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS = 1e4;
254
-
255
- //#endregion
256
- //#region src/imessage/client.ts
257
- function isTestEnv() {
258
- const vitest = process.env.VITEST?.trim().toLowerCase();
259
- return Boolean(vitest);
260
- }
261
- var IMessageRpcClient = class {
262
- constructor(opts = {}) {
263
- this.pending = /* @__PURE__ */ new Map();
264
- this.closedResolve = null;
265
- this.child = null;
266
- this.reader = null;
267
- this.nextId = 1;
268
- this.cliPath = opts.cliPath?.trim() || "imsg";
269
- this.dbPath = opts.dbPath?.trim() ? resolveUserPath(opts.dbPath) : void 0;
270
- this.runtime = opts.runtime;
271
- this.onNotification = opts.onNotification;
272
- this.closed = new Promise((resolve) => {
273
- this.closedResolve = resolve;
274
- });
275
- }
276
- async start() {
277
- if (this.child) return;
278
- if (isTestEnv()) throw new Error("Refusing to start imsg rpc in test environment; mock iMessage RPC client");
279
- const args = ["rpc"];
280
- if (this.dbPath) args.push("--db", this.dbPath);
281
- const child = spawn(this.cliPath, args, { stdio: [
282
- "pipe",
283
- "pipe",
284
- "pipe"
285
- ] });
286
- this.child = child;
287
- this.reader = createInterface({ input: child.stdout });
288
- this.reader.on("line", (line) => {
289
- const trimmed = line.trim();
290
- if (!trimmed) return;
291
- this.handleLine(trimmed);
292
- });
293
- child.stderr?.on("data", (chunk) => {
294
- const lines = chunk.toString().split(/\r?\n/);
295
- for (const line of lines) {
296
- if (!line.trim()) continue;
297
- this.runtime?.error?.(`imsg rpc: ${line.trim()}`);
298
- }
299
- });
300
- child.on("error", (err) => {
301
- this.failAll(err instanceof Error ? err : new Error(String(err)));
302
- this.closedResolve?.();
303
- });
304
- child.on("close", (code, signal) => {
305
- if (code !== 0 && code !== null) {
306
- const reason = signal ? `signal ${signal}` : `code ${code}`;
307
- this.failAll(/* @__PURE__ */ new Error(`imsg rpc exited (${reason})`));
308
- } else this.failAll(/* @__PURE__ */ new Error("imsg rpc closed"));
309
- this.closedResolve?.();
310
- });
311
- }
312
- async stop() {
313
- if (!this.child) return;
314
- this.reader?.close();
315
- this.reader = null;
316
- this.child.stdin?.end();
317
- const child = this.child;
318
- this.child = null;
319
- await Promise.race([this.closed, new Promise((resolve) => {
320
- setTimeout(() => {
321
- if (!child.killed) child.kill("SIGTERM");
322
- resolve();
323
- }, 500);
324
- })]);
325
- }
326
- async waitForClose() {
327
- await this.closed;
328
- }
329
- async request(method, params, opts) {
330
- if (!this.child || !this.child.stdin) throw new Error("imsg rpc not running");
331
- const id = this.nextId++;
332
- const payload = {
333
- jsonrpc: "2.0",
334
- id,
335
- method,
336
- params: params ?? {}
337
- };
338
- const line = `${JSON.stringify(payload)}\n`;
339
- const timeoutMs = opts?.timeoutMs ?? DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS;
340
- const response = new Promise((resolve, reject) => {
341
- const key = String(id);
342
- const timer = timeoutMs > 0 ? setTimeout(() => {
343
- this.pending.delete(key);
344
- reject(/* @__PURE__ */ new Error(`imsg rpc timeout (${method})`));
345
- }, timeoutMs) : void 0;
346
- this.pending.set(key, {
347
- resolve: (value) => resolve(value),
348
- reject,
349
- timer
350
- });
351
- });
352
- this.child.stdin.write(line);
353
- return await response;
354
- }
355
- handleLine(line) {
356
- let parsed;
357
- try {
358
- parsed = JSON.parse(line);
359
- } catch (err) {
360
- const detail = err instanceof Error ? err.message : String(err);
361
- this.runtime?.error?.(`imsg rpc: failed to parse ${line}: ${detail}`);
362
- return;
363
- }
364
- if (parsed.id !== void 0 && parsed.id !== null) {
365
- const key = String(parsed.id);
366
- const pending = this.pending.get(key);
367
- if (!pending) return;
368
- if (pending.timer) clearTimeout(pending.timer);
369
- this.pending.delete(key);
370
- if (parsed.error) {
371
- const baseMessage = parsed.error.message ?? "imsg rpc error";
372
- const details = parsed.error.data;
373
- const code = parsed.error.code;
374
- const suffixes = [];
375
- if (typeof code === "number") suffixes.push(`code=${code}`);
376
- if (details !== void 0) {
377
- const detailText = typeof details === "string" ? details : JSON.stringify(details, null, 2);
378
- if (detailText) suffixes.push(detailText);
379
- }
380
- const msg = suffixes.length > 0 ? `${baseMessage}: ${suffixes.join(" ")}` : baseMessage;
381
- pending.reject(new Error(msg));
382
- return;
383
- }
384
- pending.resolve(parsed.result);
385
- return;
386
- }
387
- if (parsed.method) this.onNotification?.({
388
- method: parsed.method,
389
- params: parsed.params
390
- });
391
- }
392
- failAll(err) {
393
- for (const [key, pending] of this.pending.entries()) {
394
- if (pending.timer) clearTimeout(pending.timer);
395
- pending.reject(err);
396
- this.pending.delete(key);
397
- }
398
- }
399
- };
400
- async function createIMessageRpcClient(opts = {}) {
401
- const client = new IMessageRpcClient(opts);
402
- await client.start();
403
- return client;
404
- }
405
-
406
- //#endregion
407
- //#region src/imessage/send.ts
408
- const LEADING_REPLY_TAG_RE = /^\s*\[\[\s*reply_to\s*:\s*([^\]\n]+)\s*\]\]\s*/i;
409
- const MAX_REPLY_TO_ID_LENGTH = 256;
410
- function stripUnsafeReplyTagChars(value) {
411
- let next = "";
412
- for (const ch of value) {
413
- const code = ch.charCodeAt(0);
414
- if (code >= 0 && code <= 31 || code === 127 || ch === "[" || ch === "]") continue;
415
- next += ch;
416
- }
417
- return next;
418
- }
419
- function sanitizeReplyToId(rawReplyToId) {
420
- const trimmed = rawReplyToId?.trim();
421
- if (!trimmed) return;
422
- const sanitized = stripUnsafeReplyTagChars(trimmed).trim();
423
- if (!sanitized) return;
424
- if (sanitized.length > MAX_REPLY_TO_ID_LENGTH) return sanitized.slice(0, MAX_REPLY_TO_ID_LENGTH);
425
- return sanitized;
426
- }
427
- function prependReplyTagIfNeeded(message, replyToId) {
428
- const resolvedReplyToId = sanitizeReplyToId(replyToId);
429
- if (!resolvedReplyToId) return message;
430
- const replyTag = `[[reply_to:${resolvedReplyToId}]]`;
431
- const existingLeadingTag = message.match(LEADING_REPLY_TAG_RE);
432
- if (existingLeadingTag) {
433
- const remainder = message.slice(existingLeadingTag[0].length).trimStart();
434
- return remainder ? `${replyTag} ${remainder}` : replyTag;
435
- }
436
- const trimmedMessage = message.trimStart();
437
- return trimmedMessage ? `${replyTag} ${trimmedMessage}` : replyTag;
438
- }
439
- function resolveMessageId(result) {
440
- if (!result) return null;
441
- const raw = typeof result.messageId === "string" && result.messageId.trim() || typeof result.message_id === "string" && result.message_id.trim() || typeof result.id === "string" && result.id.trim() || typeof result.guid === "string" && result.guid.trim() || (typeof result.message_id === "number" ? String(result.message_id) : null) || (typeof result.id === "number" ? String(result.id) : null);
442
- return raw ? String(raw).trim() : null;
443
- }
444
- async function sendMessageIMessage(to, text, opts = {}) {
445
- const cfg = opts.config ?? loadConfig();
446
- const account = opts.account ?? resolveIMessageAccount({
447
- cfg,
448
- accountId: opts.accountId
449
- });
450
- const cliPath = opts.cliPath?.trim() || account.config.cliPath?.trim() || "imsg";
451
- const dbPath = opts.dbPath?.trim() || account.config.dbPath?.trim();
452
- const target = parseIMessageTarget(opts.chatId ? formatIMessageChatTarget(opts.chatId) : to);
453
- const service = opts.service ?? (target.kind === "handle" ? target.service : void 0) ?? account.config.service;
454
- const region = opts.region?.trim() || account.config.region?.trim() || "US";
455
- const maxBytes = typeof opts.maxBytes === "number" ? opts.maxBytes : typeof account.config.mediaMaxMb === "number" ? account.config.mediaMaxMb * 1024 * 1024 : 16 * 1024 * 1024;
456
- let message = text ?? "";
457
- let filePath;
458
- if (opts.mediaUrl?.trim()) {
459
- const resolved = await (opts.resolveAttachmentImpl ?? resolveOutboundAttachmentFromUrl)(opts.mediaUrl.trim(), maxBytes, { localRoots: opts.mediaLocalRoots });
460
- filePath = resolved.path;
461
- if (!message.trim()) {
462
- const kind = kindFromMime(resolved.contentType ?? void 0);
463
- if (kind) message = kind === "image" ? "<media:image>" : `<media:${kind}>`;
464
- }
465
- }
466
- if (!message.trim() && !filePath) throw new Error("iMessage send requires text or media");
467
- if (message.trim()) {
468
- const tableMode = resolveMarkdownTableMode({
469
- cfg,
470
- channel: "imessage",
471
- accountId: account.accountId
472
- });
473
- message = convertMarkdownTables(message, tableMode);
474
- }
475
- message = prependReplyTagIfNeeded(message, opts.replyToId);
476
- const params = {
477
- text: message,
478
- service: service || "auto",
479
- region
480
- };
481
- if (filePath) params.file = filePath;
482
- if (target.kind === "chat_id") params.chat_id = target.chatId;
483
- else if (target.kind === "chat_guid") params.chat_guid = target.chatGuid;
484
- else if (target.kind === "chat_identifier") params.chat_identifier = target.chatIdentifier;
485
- else params.to = target.to;
486
- const client = opts.client ?? (opts.createClient ? await opts.createClient({
487
- cliPath,
488
- dbPath
489
- }) : await createIMessageRpcClient({
490
- cliPath,
491
- dbPath
492
- }));
493
- const shouldClose = !opts.client;
494
- try {
495
- const result = await client.request("send", params, { timeoutMs: opts.timeoutMs });
496
- return { messageId: resolveMessageId(result) ?? (result?.ok ? "ok" : "unknown") };
497
- } finally {
498
- if (shouldClose) await client.stop();
499
- }
500
- }
501
-
502
- //#endregion
503
- export { isAllowedIMessageSender as a, parseChatAllowTargetPrefixes as c, resolveServicePrefixedTarget as d, formatAllowFromLowercase as f, formatIMessageChatTarget as i, parseChatTargetPrefixesOrThrow as l, isNormalizedSenderAllowed as m, createIMessageRpcClient as n, normalizeIMessageHandle as o, isAllowedParsedChatSender as p, DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS as r, parseIMessageTarget as s, sendMessageIMessage as t, resolveServicePrefixedAllowTarget as u };
@@ -1,169 +0,0 @@
1
- import { f as readCredsJsonRaw, g as resolveWebCredsPath, h as resolveWebCredsBackupPath, m as resolveDefaultWebAuthDir, u as maybeRestoreCredsFromBackup } from "./accounts-BNuRM3rG.js";
2
- import { Pr as formatCliCommand, Xr as VERSION } from "./config-CrQ5bCrw.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 };