winclaw 2026.3.21 → 2026.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/{accounts-CTJXIABG.js → accounts-8qwgz384.js} +1 -1
  2. package/dist/{accounts-CLKFSM00.js → accounts-BpS-Awr5.js} +1 -1
  3. package/dist/{accounts-cYG8442L.js → accounts-BrWJjaKS.js} +7 -7
  4. package/dist/{acp-cli-BbN2vTHD.js → acp-cli-BMM5ssNE.js} +8 -8
  5. package/dist/{agent-scope-D-i-vMLS.js → agent-scope-Dany4R2i.js} +17 -17
  6. package/dist/{agents-_gcdm-kb.js → agents-AMH_Bmb6.js} +14 -14
  7. package/dist/{agents.config-BkgsJJng.js → agents.config-6n_jmCMa.js} +2 -2
  8. package/dist/{api-key-rotation-D_JdsLIl.js → api-key-rotation-C9ywPLG3.js} +1 -1
  9. package/dist/{audio-preflight-CdgtLVh2.js → audio-preflight-D7UvXGlQ.js} +34 -34
  10. package/dist/{audio-preflight-CBWXmKyj.js → audio-preflight-DHeEYciJ.js} +4 -4
  11. package/dist/{audio-transcription-runner-DpvjaNmr.js → audio-transcription-runner-1-9PFrzh.js} +1 -1
  12. package/dist/{audio-transcription-runner-DGZYB2Wq.js → audio-transcription-runner-nnwJufig.js} +23 -23
  13. package/dist/{audit-DdcsBl_-.js → audit-DV_kf1sd.js} +29 -29
  14. package/dist/{auth-CU4HqNch.js → auth-Ahj-1B5R.js} +1 -1
  15. package/dist/{auth-choice-CtzD_rrW.js → auth-choice-NjkwJsBG.js} +13 -13
  16. package/dist/{auth-choice-i771W71t.js → auth-choice-dFTD1hLR.js} +11 -11
  17. package/dist/{auth-choice.apply-helpers-Bmj9LZnO.js → auth-choice.apply-helpers-ClzwLPaB.js} +1 -1
  18. package/dist/{auth-profiles-CmoHF97e.js → auth-profiles-DF0cLC20.js} +16 -16
  19. package/dist/{auth-token-C_S_Uszj.js → auth-token-BXCBtI3p.js} +1 -1
  20. package/dist/{banner-C-01b-if.js → banner-BB4DFL8E.js} +2 -2
  21. package/dist/{bonjour-discovery-BxCVyJLG.js → bonjour-discovery-BVSpbdjs.js} +1 -1
  22. package/dist/{browser-cli-Rt_P1-M1.js → browser-cli-DAcccrxR.js} +12 -12
  23. package/dist/build-info.json +2 -2
  24. package/dist/bundled/boot-md/handler.js +6 -6
  25. package/dist/bundled/session-memory/handler.js +6 -6
  26. package/dist/{call-BLyRfBMl.js → call-DEKH5GO9.js} +10 -10
  27. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  28. package/dist/{channel-account-context-B4ofKr9t.js → channel-account-context-D4Yftz20.js} +5 -5
  29. package/dist/{channel-activity-CPWF8YR5.js → channel-activity-D03SwGPA.js} +1 -1
  30. package/dist/{channel-options-it9Z3dNk.js → channel-options-C7dYNZsy.js} +3 -3
  31. package/dist/{channel-selection-5G2iw3CB.js → channel-selection-Bke39fer.js} +1 -1
  32. package/dist/{channel-web-CJ_jcZSw.js → channel-web-BOrAGcza.js} +17 -17
  33. package/dist/{channels-cli-miFqkj2-.js → channels-cli-4YLI7Ar_.js} +93 -93
  34. package/dist/{channels-status-issues-DpfEWI4l.js → channels-status-issues-wCgCdUDu.js} +1 -1
  35. package/dist/{chrome-RAfAR4xV.js → chrome-BDFA9lPV.js} +4 -4
  36. package/dist/{chrome-GsaZ074n.js → chrome-Cr8R7xl_.js} +8 -8
  37. package/dist/{clawbot-cli-HvFYYAc6.js → clawbot-cli-B96xAtzs.js} +11 -11
  38. package/dist/cli/daemon-cli.js +1 -1
  39. package/dist/cli-BozE7JCS.js +154 -0
  40. package/dist/{client-DCxDsURZ.js → client-jNFqrgw6.js} +2 -2
  41. package/dist/{command-registry-m8nfRV-J.js → command-registry-qDpes5Yr.js} +11 -11
  42. package/dist/{command-secret-targets-BfqkoJyp.js → command-secret-targets-Dd4qCPSg.js} +4 -4
  43. package/dist/{commands-4mnxaSoA.js → commands-DmBkhPD-.js} +1 -1
  44. package/dist/{commands-registry-h5KiQe_S.js → commands-registry-BB289Bg8.js} +3 -3
  45. package/dist/{completion-cli-B-8mTxbh.js → completion-cli-DzZieT3i.js} +13 -13
  46. package/dist/{config-cli-1ecjxVfC.js → config-cli-Dk1yc6M9.js} +7 -7
  47. package/dist/{config-guard-DlzKrdcR.js → config-guard-3fwTO4Mb.js} +3 -3
  48. package/dist/{config-validation-E-3Wz4C4.js → config-validation-5pIaju5U.js} +3 -3
  49. package/dist/{configure-B-tOY-wa.js → configure-CuqZCxTb.js} +17 -17
  50. package/dist/{control-ui-assets-B0DdamQU.js → control-ui-assets-5F0FEjfM.js} +1 -1
  51. package/dist/{cron-cli-DpVGzupl.js → cron-cli-BIa0VxDk.js} +11 -11
  52. package/dist/{daemon-cli-CqwUFobu.js → daemon-cli-BE11O7QX.js} +16 -16
  53. package/dist/{daemon-install-C029NlXk.js → daemon-install-DNhR8NtL.js} +4 -4
  54. package/dist/{daemon-install-helpers-D1YQ03lO.js → daemon-install-helpers-DWmF3oFP.js} +11 -11
  55. package/dist/{deliver-BX-UVg7x.js → deliver-CqiBzHnh.js} +7 -7
  56. package/dist/{deliver-CtyrAYix.js → deliver-r4_Yp7-C.js} +1 -1
  57. package/dist/{deliver-runtime-Bvh4te8E.js → deliver-runtime-CIXUsI5k.js} +3 -3
  58. package/dist/deliver-runtime-DJsAB9LW.js +57 -0
  59. package/dist/deps-send-discord.runtime-M8Cl0fms.js +32 -0
  60. package/dist/deps-send-imessage.runtime-Bing_Bvm.js +31 -0
  61. package/dist/deps-send-signal.runtime-CEnhoskG.js +30 -0
  62. package/dist/deps-send-slack.runtime-DeKWrOdA.js +28 -0
  63. package/dist/deps-send-telegram.runtime-K5LxxPog.js +34 -0
  64. package/dist/{deps-send-whatsapp.runtime-BJV7VcRP.js → deps-send-whatsapp.runtime-BXDQiU2D.js} +7 -7
  65. package/dist/deps-send-whatsapp.runtime-Cie2nrT8.js +115 -0
  66. package/dist/{devices-cli-Cpq_Gt1l.js → devices-cli-BJgUG9fc.js} +8 -8
  67. package/dist/{diagnostic-DIPYflOJ.js → diagnostic-BCcd-_zI.js} +1 -1
  68. package/dist/{diagnostics-KfpqzhsS.js → diagnostics-BDjbQJxP.js} +5 -5
  69. package/dist/{directory-cli-CPBPE8N1.js → directory-cli-CJ_l_BnF.js} +7 -7
  70. package/dist/{dns-cli-CI7HzCVI.js → dns-cli-CFau82Y7.js} +5 -5
  71. package/dist/{dock-ClcGZ0LV.js → dock-C-w5XvOS.js} +4 -4
  72. package/dist/{docs-cli-DkQBHXw-.js → docs-cli-BRob5CHm.js} +4 -4
  73. package/dist/{doctor-completion-DEdT-_9v.js → doctor-completion-DB39JNV7.js} +2 -2
  74. package/dist/{doctor-config-flow-D6rEqOwb.js → doctor-config-flow-BzYwmYwv.js} +15 -15
  75. package/dist/{enable-sRe0nI5a.js → enable-Qw-mz6ta.js} +1 -1
  76. package/dist/entry.js +2 -2
  77. package/dist/{exec-approvals-allowlist-B5ZdMbz6.js → exec-approvals-allowlist-BkdJCc3F.js} +1 -1
  78. package/dist/{exec-approvals-cli-BFxdGk9c.js → exec-approvals-cli-DsDGgzyV.js} +16 -16
  79. package/dist/{exec-safe-bin-runtime-policy-CB8atBLm.js → exec-safe-bin-runtime-policy-C5pAgyiz.js} +2 -2
  80. package/dist/{fetch-CdvuNDFE.js → fetch-BwrGQrFL.js} +3 -3
  81. package/dist/{fetch-guard-D-W6TRJN.js → fetch-guard-CHht1LfT.js} +1 -1
  82. package/dist/{plugin-sdk/fs-safe-DRACrdwg.js → fs-safe-B8J4dv27.js} +6 -6
  83. package/dist/{gateway-cli-C_4mlmOW.js → gateway-cli-BdyXCC2C.js} +154 -154
  84. package/dist/{gateway-rpc-Dg3CGljP.js → gateway-rpc-ICMh7-Qs.js} +1 -1
  85. package/dist/{health-C5a0wlfE.js → health-Boe965-L.js} +11 -11
  86. package/dist/{hooks-cli-C79J_WG7.js → hooks-cli-DI0sn396.js} +81 -81
  87. package/dist/{hooks-status-Cjg5SLpX.js → hooks-status-CQjtRM1s.js} +1 -1
  88. package/dist/{image-7s8Q2r40.js → image-DoOVDHql.js} +1 -1
  89. package/dist/{image-EjGWXbei.js → image-Dpt9TurJ.js} +5 -5
  90. package/dist/{image-ops-eFMqXMDE.js → image-ops-DWGnyTvC.js} +10 -10
  91. package/dist/image-runtime-HfAsK5X3.js +51 -0
  92. package/dist/{image-runtime-QNP_uABR.js → image-runtime-Wym8Keh3.js} +3 -3
  93. package/dist/{inspect-XmcWN97u.js → inspect-DbVcDDi7.js} +4 -4
  94. package/dist/{install-safe-path-DNotGe9T.js → install-safe-path-FR9r9Dmi.js} +25 -25
  95. package/dist/{installs-zKF10nZF.js → installs-7zsfIb7P.js} +9 -9
  96. package/dist/{ipv4-DIKCnoyz.js → ipv4-CfrDjvjo.js} +1 -1
  97. package/dist/{ir-CJPPU4LU.js → ir-B-FffSKU.js} +8 -8
  98. package/dist/{issue-format-DCF2SXK_.js → issue-format-NmLUfbBT.js} +1 -1
  99. package/dist/{json-files-kWpauJWO.js → json-files-D9ZHO8Ud.js} +8 -8
  100. package/dist/{lifecycle-core-BLhI5nRz.js → lifecycle-core-Di83_FGS.js} +5 -5
  101. package/dist/llm-slug-generator.js +6 -6
  102. package/dist/{login-D26qK4NQ.js → login-BrdFlfV0.js} +3 -3
  103. package/dist/{login-qr-CMgMlRCI.js → login-qr-Ci3FVgS9.js} +6 -6
  104. package/dist/{logs-cli-Cn7bGSc7.js → logs-cli-DUl4D14l.js} +9 -9
  105. package/dist/{manager-f6tniCBN.js → manager-2Wice7pq.js} +14 -14
  106. package/dist/manager-runtime-BrpO8pJp.js +22 -0
  107. package/dist/{manifest-registry-CI-UuKUO.js → manifest-registry-_liSV_Vx.js} +1 -1
  108. package/dist/{memory-cli-C2Yq9ryD.js → memory-cli-BgZK6A-T.js} +12 -12
  109. package/dist/{model-CXGHDOeN.js → model-C4J88Gi3.js} +2 -2
  110. package/dist/{model-catalog-08ftNXDk.js → model-catalog-BYxSwIkt.js} +3 -3
  111. package/dist/{model-picker-CTRi5Yhj.js → model-picker-DAr8DpKu.js} +4 -4
  112. package/dist/{models-Do96D4zT.js → models-DqwqcGxg.js} +17 -17
  113. package/dist/{models-cli-pblTciC_.js → models-cli-BFfUYhHp.js} +78 -78
  114. package/dist/{models-config-DYJ-p9kt.js → models-config-CJq2ywhf.js} +6 -6
  115. package/dist/{net-DQYHvbkN.js → net-C7TXXUto.js} +2 -2
  116. package/dist/{node-cli-CsQwAHzH.js → node-cli-DMpZsjse.js} +33 -33
  117. package/dist/{node-command-policy-BHdicfMO.js → node-command-policy-DGMJi4xw.js} +1 -1
  118. package/dist/{node-service-CLtiUeNO.js → node-service-L9-L8-7x.js} +1 -1
  119. package/dist/{nodes-cli-Dlilj-Pf.js → nodes-cli-BcyY77Cc.js} +16 -16
  120. package/dist/{nodes-screen-CL-8raxt.js → nodes-screen-B6QVlwKO.js} +7 -7
  121. package/dist/{npm-pack-install-DZvYhRnM.js → npm-pack-install-B3VCcNWC.js} +18 -18
  122. package/dist/{npm-resolution-DE7xcGkg.js → npm-resolution-0-Scs5nn.js} +4 -4
  123. package/dist/{onboard-CReGZ3G9.js → onboard-C9gtA3_b.js} +6 -6
  124. package/dist/{onboard-channels-ljMkIe7O.js → onboard-channels-NBqfiIc3.js} +21 -21
  125. package/dist/{onboard-custom-DoJDTzAW.js → onboard-custom-Cv61U_sa.js} +4 -4
  126. package/dist/{onboard-helpers-7lOdCHhD.js → onboard-helpers-Djj9SkyR.js} +10 -10
  127. package/dist/{onboard-hooks-BTD0YhRI.js → onboard-hooks-DRkLf5gL.js} +4 -4
  128. package/dist/{onboard-remote-Bj9uk3zW.js → onboard-remote-o8XtWCa_.js} +4 -4
  129. package/dist/{onboard-skills-1KAA9UrK.js → onboard-skills-TATKa-gc.js} +4 -4
  130. package/dist/{onboarding-CoH1hPY0.js → onboarding-C_LQ6doG.js} +14 -14
  131. package/dist/{onboarding.finalize-DzRWtkmA.js → onboarding.finalize-uHWzNBrm.js} +87 -87
  132. package/dist/{onboarding.gateway-config-s11ZLxLE.js → onboarding.gateway-config-ByvXJY2k.js} +18 -18
  133. package/dist/{onboarding.secret-input-D5VKqHdN.js → onboarding.secret-input-Cw4uIgyl.js} +1 -1
  134. package/dist/{openai-model-default-sYh2slgj.js → openai-model-default-Db9joqm4.js} +2 -2
  135. package/dist/{outbound-D0KF3CHY.js → outbound-DgsIsXfj.js} +3 -3
  136. package/dist/{outbound-attachment-CEC4H3tX.js → outbound-attachment-CjhkSZBR.js} +2 -2
  137. package/dist/{pairing-cli-4Nrc-V_v.js → pairing-cli-D0KKynjI.js} +8 -8
  138. package/dist/{pairing-labels-e3Pnen1C.js → pairing-labels-Ev8O2qBX.js} +1 -1
  139. package/dist/{pairing-store-Kslw_Wa0.js → pairing-store-CI0hWzZk.js} +3 -3
  140. package/dist/{plugin-sdk/path-alias-guards-CaCBZRHc.js → path-alias-guards-BoydiaPL.js} +1 -1
  141. package/dist/{path-safety-Cq9rwfZN.js → path-safety-CSCsbd-j.js} +1 -1
  142. package/dist/{paths-C5mR1YC-.js → paths-BVQ0udwc.js} +9 -9
  143. package/dist/{pi-embedded-DUO1eQ_J.js → pi-embedded-CD3oPGOP.js} +24 -24
  144. package/dist/{pi-embedded-helpers-BWpzwT6B.js → pi-embedded-helpers-Be8qWeKb.js} +6 -6
  145. package/dist/{pi-embedded-helpers-BMGRFCuV.js → pi-embedded-helpers-BthBxPYi.js} +3 -3
  146. package/dist/{pi-model-discovery-CibSv4gC.js → pi-model-discovery-CgxnCHvU.js} +1 -1
  147. package/dist/{pi-model-discovery-runtime-DhBE8w94.js → pi-model-discovery-runtime-CqYOz48r.js} +5 -5
  148. package/dist/{pi-tools.before-tool-call.runtime-D6h4CmLs.js → pi-tools.before-tool-call.runtime-CPnt06zM.js} +5 -5
  149. package/dist/{pi-tools.policy-BqpmC_c4.js → pi-tools.policy-DGbCC2Ji.js} +5 -5
  150. package/dist/{plugin-auto-enable-DnSZLbIH.js → plugin-auto-enable-Crpu18wt.js} +3 -3
  151. package/dist/{plugin-registry-DckyegZB.js → plugin-registry-Dbu4pN4B.js} +3 -3
  152. package/dist/plugin-sdk/imessage.js +2 -2
  153. package/dist/plugin-sdk/index.js +50 -50
  154. package/dist/plugin-sdk/mattermost.js +3 -3
  155. package/dist/plugin-sdk/signal.js +2 -2
  156. package/dist/plugin-sdk/telegram.js +2 -2
  157. package/dist/{plugins-C1OgLvb4.js → plugins-IFacUN_Q.js} +2 -2
  158. package/dist/{plugins-cli-C6Oo9R6E.js → plugins-cli-CCpaWcyg.js} +83 -83
  159. package/dist/{ports-CfOim1GC.js → ports-DqZBwUsy.js} +2 -2
  160. package/dist/{ports-Dw-3Gxsb.js → ports-FLn4cVl7.js} +1 -1
  161. package/dist/{probe-D3f6QMfy.js → probe-CHRXpP2F.js} +2 -2
  162. package/dist/{program-CEJ6CsoR.js → program-Br4Re78f.js} +81 -81
  163. package/dist/{prompt-select-styled-D-f3R2mt.js → prompt-select-styled-w-CGGgrT.js} +40 -40
  164. package/dist/{provider-auth-helpers-CN4iPBfs.js → provider-auth-helpers-BVCos07y.js} +5 -5
  165. package/dist/{proxy-env-B7GwrH5p.js → proxy-env-Bx8OhutV.js} +1 -1
  166. package/dist/{push-apns-BEZdCQsM.js → push-apns-Cdl2nskU.js} +5 -5
  167. package/dist/{pw-ai-Ckb-165q.js → pw-ai-BpQw305H.js} +18 -18
  168. package/dist/{pw-ai-D6e8FGb0.js → pw-ai-CJfoHUhH.js} +1 -1
  169. package/dist/{plugin-sdk/qmd-manager-JiY1T3wh.js → qmd-manager-COHJs6wn.js} +15 -11
  170. package/dist/{qr-cli-BI54tdt3.js → qr-cli-Bzo00_vR.js} +2 -2
  171. package/dist/{query-expansion-Cja4xprw.js → query-expansion-IQFdQdeu.js} +12 -12
  172. package/dist/{redact-snapshot-YrAxVxTI.js → redact-snapshot-Bfefch_D.js} +1 -1
  173. package/dist/{register.agent-BjxrirHi.js → register.agent-CVpohSrc.js} +94 -94
  174. package/dist/register.configure-CiIuig3f.js +162 -0
  175. package/dist/{register.maintenance-BfdiJ7KX.js → register.maintenance-CpVfbR8z.js} +95 -95
  176. package/dist/{register.message-BszoJEBm.js → register.message-CJErVRcL.js} +74 -74
  177. package/dist/{register.onboard-CbJU4Y-3.js → register.onboard-Cm5fn9dF.js} +18 -18
  178. package/dist/{register.setup-BTTBsCT0.js → register.setup-DIBDbMN8.js} +21 -21
  179. package/dist/{register.status-health-sessions-C3Ji8sqv.js → register.status-health-sessions-Bu3abDYw.js} +89 -89
  180. package/dist/{register.subclis-2iN-TxPh.js → register.subclis-DTiQUgvr.js} +31 -31
  181. package/dist/{rpc-4GcuaLHq.js → rpc-CkwrblZ9.js} +1 -1
  182. package/dist/{run-main-BEtPk_9z.js → run-main-4p7ridqP.js} +92 -92
  183. package/dist/{runtime-4RU4PT-H.js → runtime-C-9xWVep.js} +3 -3
  184. package/dist/{runtime-config-collectors-Ca2llf68.js → runtime-config-collectors-vw9ITu9W.js} +1 -1
  185. package/dist/{runtime-whatsapp-login.runtime-DOTrH3Wz.js → runtime-whatsapp-login.runtime-CrytFUOh.js} +7 -7
  186. package/dist/runtime-whatsapp-outbound.runtime-DOHkvY0R.js +28 -0
  187. package/dist/{sandbox-D19lOCVP.js → sandbox-CDjV0Crv.js} +18 -18
  188. package/dist/{sandbox-cli-DAZxiFQz.js → sandbox-cli-CyS9Kzp1.js} +25 -25
  189. package/dist/{secrets-cli-Bd2eDDOJ.js → secrets-cli-BPXW13bC.js} +11 -11
  190. package/dist/{security-cli-C6oO69to.js → security-cli-DfuX1PAw.js} +43 -43
  191. package/dist/{send-DR5zNR-6.js → send-BTQQeOIu.js} +6 -6
  192. package/dist/{send-3vnK2por.js → send-CFsJh6px.js} +11 -11
  193. package/dist/{send-DTvtOsK3.js → send-CM55Cnqy.js} +4 -4
  194. package/dist/{send-Bz5LPBFx.js → send-D7wKzeqg.js} +8 -8
  195. package/dist/{send-CEgqE2b1.js → send-DUJqLDEQ.js} +5 -5
  196. package/dist/{server-vPpafyBR.js → server-57rjxu9J.js} +20 -20
  197. package/dist/{server-context-FT_S05Zu.js → server-context-DdGwcBos.js} +12 -12
  198. package/dist/{server-lifecycle-YV61YmRr.js → server-lifecycle-TD7uRUJM.js} +2 -2
  199. package/dist/{server-middleware-BPI-0Duw.js → server-middleware-Dqzu_N47.js} +1 -1
  200. package/dist/{server-node-events-BozhXo6J.js → server-node-events-CstHr-4q.js} +74 -74
  201. package/dist/{service-Aratsspm.js → service-B45ntxm9.js} +15 -15
  202. package/dist/{session-C4iQQHfw.js → session-BO7rj_9P.js} +1 -1
  203. package/dist/{session-utils-CTpXGSxL.js → session-utils-DqzU9P2d.js} +6 -6
  204. package/dist/{sessions-CZvR93mC.js → sessions-BPbCt7hk.js} +4 -4
  205. package/dist/{sessions-Cvvux3S6.js → sessions-BUNwVEqF.js} +15 -15
  206. package/dist/{shared-ByZODVse.js → shared-CeHWQzSU.js} +3 -3
  207. package/dist/{shared-Cj-SPh02.js → shared-CpqkgNHp.js} +1 -1
  208. package/dist/{skill-commands-CzaT61kL.js → skill-commands-BlmjGaIe.js} +5 -5
  209. package/dist/{skill-scanner-DqqhF5of.js → skill-scanner-DOOfjrYo.js} +6 -6
  210. package/dist/{skills-BpN5EUZU.js → skills-CFYm0xdh.js} +3 -3
  211. package/dist/{skills-cli-Bk2WM5gn.js → skills-cli-Dmbm2-L8.js} +5 -5
  212. package/dist/{skills-install-0pjIZu1-.js → skills-install-DSB3T8VY.js} +6 -6
  213. package/dist/{skills-status-Bu28FGtt.js → skills-status-CmWpjTMz.js} +1 -1
  214. package/dist/{slash-commands.runtime-CU--cvcd.js → slash-commands.runtime-CTVGYo20.js} +11 -11
  215. package/dist/{slash-dispatch.runtime-DDLolsGY.js → slash-dispatch.runtime-CQmhrE1-.js} +6 -6
  216. package/dist/slash-dispatch.runtime-yKnwVCI5.js +110 -0
  217. package/dist/slash-skill-commands.runtime-BCG9eUm1.js +29 -0
  218. package/dist/{status-B5hylgEQ.js → status-DPFQHdBI.js} +28 -28
  219. package/dist/{status.update-CdaaXiD4.js → status.update-ZhDibzTU.js} +2 -2
  220. package/dist/{store-LSg8jeyh.js → store-Dgl-neCe.js} +5 -5
  221. package/dist/{subagent-registry-iD-ynHA9.js → subagent-registry-DPqc72Pw.js} +149 -149
  222. package/dist/{subagent-registry-runtime-DfMDVaOY.js → subagent-registry-runtime-BYxLgcCY.js} +6 -6
  223. package/dist/subagent-registry-runtime-DE-5902Y.js +110 -0
  224. package/dist/{system-cli-B8wmT3y0.js → system-cli-BiiO_z6k.js} +9 -9
  225. package/dist/{system-run-command-Ft0meR8i.js → system-run-command-CUMrwy8H.js} +1 -1
  226. package/dist/{systemd-CVY4-XuL.js → systemd-BNMfPHLS.js} +9 -9
  227. package/dist/{systemd-hints-GPX9Y1X7.js → systemd-hints-O9SJa5Ku.js} +6 -6
  228. package/dist/{systemd-linger-CyioH9ho.js → systemd-linger-CDgtOmPf.js} +1 -1
  229. package/dist/{tables-B6p8P9wY.js → tables-Bjpb4vEC.js} +1 -1
  230. package/dist/{tailnet-yScEfa2T.js → tailnet-C4yxhmDk.js} +1 -1
  231. package/dist/{plugin-sdk/target-errors-Hoj2qirZ.js → target-errors-Bd8kj4z9.js} +2 -2
  232. package/dist/{tool-images-Cp3hNFNZ.js → tool-images-DbchBdq5.js} +1 -1
  233. package/dist/{tui-BPqNtl51.js → tui-BVOPPCMP.js} +6 -6
  234. package/dist/{tui-cli-BZE2zssw.js → tui-cli-B2jmEXCo.js} +32 -32
  235. package/dist/{update-u6OtnABh.js → update-DF240Zd0.js} +3 -3
  236. package/dist/{update-cli-C1nysDmM.js → update-cli-PDG-KYWB.js} +105 -105
  237. package/dist/{update-runner-BpzbDTnQ.js → update-runner-BkpGT3AA.js} +16 -16
  238. package/dist/{web-CodV11ZY.js → web-0SOsmYmI.js} +6 -6
  239. package/dist/web-20qjCzeI.js +114 -0
  240. package/dist/{webhooks-cli-D4O_OfXU.js → webhooks-cli-N_vV0iXR.js} +6 -6
  241. package/dist/{whatsapp-actions-By2rV868.js → whatsapp-actions-X768ziyc.js} +17 -17
  242. package/dist/{winclaw-root-D0OUuGl7.js → winclaw-root-DEqOOeOw.js} +8 -8
  243. package/dist/{with-timeout-Cng0KnPd.js → with-timeout-DJb5ULbL.js} +3 -3
  244. package/dist/{workspace-vYy4qLQz.js → workspace-Cx-f7PO5.js} +1 -1
  245. package/dist/{workspace-dirs-C13vnqQQ.js → workspace-dirs-C5erYAob.js} +1 -1
  246. package/dist/{wsl-C9d12M7y.js → wsl-BisEqrSr.js} +2 -2
  247. package/package.json +1 -1
  248. package/dist/cli-Da0pNyXg.js +0 -154
  249. package/dist/deliver-runtime-Co5o7uv0.js +0 -57
  250. package/dist/deps-send-discord.runtime-D0BtA9iO.js +0 -32
  251. package/dist/deps-send-imessage.runtime-89fweiea.js +0 -31
  252. package/dist/deps-send-signal.runtime-BA3mNq_v.js +0 -30
  253. package/dist/deps-send-slack.runtime-DiA-Ieod.js +0 -28
  254. package/dist/deps-send-telegram.runtime-C9bLOnbt.js +0 -34
  255. package/dist/deps-send-whatsapp.runtime-Dflrvnq-.js +0 -115
  256. package/dist/fs-safe-Dha0DfFC.js +0 -352
  257. package/dist/image-runtime-CGAobfgI.js +0 -51
  258. package/dist/manager-runtime-BifbXCuI.js +0 -22
  259. package/dist/path-alias-guards-9OJ1UBCd.js +0 -43
  260. package/dist/plugin-sdk/accounts-B9lBByhz.js +0 -35
  261. package/dist/plugin-sdk/accounts-Bl6fp04N.js +0 -288
  262. package/dist/plugin-sdk/accounts-CQWq_42g.js +0 -46
  263. package/dist/plugin-sdk/active-listener-Dc-P7jeX.js +0 -50
  264. package/dist/plugin-sdk/api-key-rotation-DSOB99GV.js +0 -181
  265. package/dist/plugin-sdk/audio-preflight-DYTxAG0v.js +0 -69
  266. package/dist/plugin-sdk/audio-transcription-runner-Bndij5Q1.js +0 -2176
  267. package/dist/plugin-sdk/audit-membership-runtime-ZTTIhQhs.js +0 -58
  268. package/dist/plugin-sdk/channel-activity-ChRCQNSc.js +0 -94
  269. package/dist/plugin-sdk/channel-web-CfZNFYCV.js +0 -2256
  270. package/dist/plugin-sdk/chrome-DNpRdbZ1.js +0 -2415
  271. package/dist/plugin-sdk/commands-registry-Bq1HqcJU.js +0 -1125
  272. package/dist/plugin-sdk/config-Cyo0rHBx.js +0 -17959
  273. package/dist/plugin-sdk/deliver-mBruQPRt.js +0 -1719
  274. package/dist/plugin-sdk/deliver-runtime-ByVt0evu.js +0 -32
  275. package/dist/plugin-sdk/deps-send-discord.runtime-C2fc3t93.js +0 -23
  276. package/dist/plugin-sdk/deps-send-imessage.runtime-D4m7X6j4.js +0 -22
  277. package/dist/plugin-sdk/deps-send-signal.runtime-DwGJRjyX.js +0 -21
  278. package/dist/plugin-sdk/deps-send-slack.runtime-7J491hID.js +0 -19
  279. package/dist/plugin-sdk/deps-send-telegram.runtime-DAKGyd6b.js +0 -24
  280. package/dist/plugin-sdk/deps-send-whatsapp.runtime-BxQ5tZO2.js +0 -57
  281. package/dist/plugin-sdk/diagnostic-B3ZoSFoM.js +0 -319
  282. package/dist/plugin-sdk/errors-DdSHGcgi.js +0 -54
  283. package/dist/plugin-sdk/fetch-guard-Uhk4tySC.js +0 -156
  284. package/dist/plugin-sdk/image-CEBZ8sRh.js +0 -2314
  285. package/dist/plugin-sdk/image-ops-Dye2ozSZ.js +0 -584
  286. package/dist/plugin-sdk/image-runtime-CabQkSZn.js +0 -25
  287. package/dist/plugin-sdk/ir-CruONUHn.js +0 -1296
  288. package/dist/plugin-sdk/local-roots-BYSlR-at.js +0 -186
  289. package/dist/plugin-sdk/logger-C_vnHQg2.js +0 -1163
  290. package/dist/plugin-sdk/login-bdsdinOj.js +0 -57
  291. package/dist/plugin-sdk/login-qr-BYAvyop9.js +0 -320
  292. package/dist/plugin-sdk/manager-AOQxrU7P.js +0 -3929
  293. package/dist/plugin-sdk/manager-runtime-CijO5giX.js +0 -15
  294. package/dist/plugin-sdk/outbound-FdiP5J7H.js +0 -212
  295. package/dist/plugin-sdk/outbound-attachment-DZphVgq7.js +0 -19
  296. package/dist/plugin-sdk/paths-ICLB349I.js +0 -166
  297. package/dist/plugin-sdk/pi-embedded-helpers-tHjfJzH4.js +0 -9627
  298. package/dist/plugin-sdk/pi-model-discovery-DQV-B6bn.js +0 -134
  299. package/dist/plugin-sdk/pi-model-discovery-runtime-MJmZTIax.js +0 -8
  300. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-7DPjo7Ey.js +0 -354
  301. package/dist/plugin-sdk/plugins-BQHnLb2v.js +0 -864
  302. package/dist/plugin-sdk/proxy-fetch-BpMu-RpD.js +0 -38
  303. package/dist/plugin-sdk/pw-ai-DAMRoo8O.js +0 -1938
  304. package/dist/plugin-sdk/query-expansion-CuaTloKx.js +0 -1011
  305. package/dist/plugin-sdk/redact-BznLQ6I5.js +0 -319
  306. package/dist/plugin-sdk/reply-Cx_4UtvJ.js +0 -100211
  307. package/dist/plugin-sdk/resolve-outbound-target-BDjhohcf.js +0 -40
  308. package/dist/plugin-sdk/run-with-concurrency-BcPenaKJ.js +0 -1994
  309. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DqezqoLI.js +0 -10
  310. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-Dgnv_x4o.js +0 -19
  311. package/dist/plugin-sdk/send-BWz-g7wE.js +0 -540
  312. package/dist/plugin-sdk/send-DB9pUM0k.js +0 -414
  313. package/dist/plugin-sdk/send-QPap4wBN.js +0 -503
  314. package/dist/plugin-sdk/send-gz4Lq5tL.js +0 -2587
  315. package/dist/plugin-sdk/send-tyEtWeMX.js +0 -3135
  316. package/dist/plugin-sdk/session-88GgvJcW.js +0 -169
  317. package/dist/plugin-sdk/skill-commands-ClwX3DoE.js +0 -353
  318. package/dist/plugin-sdk/skills-B2FPl9ca.js +0 -1428
  319. package/dist/plugin-sdk/slash-commands.runtime-CGAfyDkY.js +0 -13
  320. package/dist/plugin-sdk/slash-dispatch.runtime-DN7TWAWh.js +0 -52
  321. package/dist/plugin-sdk/slash-skill-commands.runtime-C4i9B-79.js +0 -16
  322. package/dist/plugin-sdk/ssrf-D3NQgatK.js +0 -202
  323. package/dist/plugin-sdk/store-CDmdRGxP.js +0 -81
  324. package/dist/plugin-sdk/subagent-registry-runtime-CprGCjIU.js +0 -52
  325. package/dist/plugin-sdk/tables-j2CMtAoX.js +0 -55
  326. package/dist/plugin-sdk/thinking-Dh6B0ZhB.js +0 -1206
  327. package/dist/plugin-sdk/tokens-PExiD061.js +0 -52
  328. package/dist/plugin-sdk/tool-images-D7ah30xm.js +0 -274
  329. package/dist/plugin-sdk/web-D9wJfMr_.js +0 -56
  330. package/dist/plugin-sdk/whatsapp-actions-BjarJorO.js +0 -80
  331. package/dist/qmd-manager-oU4X85hj.js +0 -1452
  332. package/dist/register.configure-MduIRRMt.js +0 -162
  333. package/dist/runtime-whatsapp-outbound.runtime-CNnM5MdE.js +0 -28
  334. package/dist/slash-dispatch.runtime-D5Cl7j1v.js +0 -110
  335. package/dist/slash-skill-commands.runtime-DnvHGcVS.js +0 -29
  336. package/dist/subagent-registry-runtime-LH0OBaWN.js +0 -110
  337. package/dist/target-errors-HJQQHC3B.js +0 -195
  338. package/dist/web-DxHq9RWt.js +0 -114
@@ -1,10 +0,0 @@
1
- import "./run-with-concurrency-BcPenaKJ.js";
2
- import "./accounts-Bl6fp04N.js";
3
- import "./paths-BEfQqXwE.js";
4
- import "./github-copilot-token-BCc3snHh.js";
5
- import "./config-Cyo0rHBx.js";
6
- import "./logger-C_vnHQg2.js";
7
- import "./session-88GgvJcW.js";
8
- import { t as loginWeb } from "./login-bdsdinOj.js";
9
-
10
- export { loginWeb };
@@ -1,19 +0,0 @@
1
- import "./run-with-concurrency-BcPenaKJ.js";
2
- import "./accounts-Bl6fp04N.js";
3
- import "./paths-BEfQqXwE.js";
4
- import "./github-copilot-token-BCc3snHh.js";
5
- import "./config-Cyo0rHBx.js";
6
- import "./logger-C_vnHQg2.js";
7
- import "./image-ops-Dye2ozSZ.js";
8
- import "./plugins-BQHnLb2v.js";
9
- import "./path-alias-guards-CaCBZRHc.js";
10
- import "./fs-safe-DRACrdwg.js";
11
- import "./ssrf-D3NQgatK.js";
12
- import "./fetch-guard-Uhk4tySC.js";
13
- import "./local-roots-BYSlR-at.js";
14
- import "./ir-CruONUHn.js";
15
- import "./render-A563BsDG.js";
16
- import "./tables-j2CMtAoX.js";
17
- import { n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./outbound-FdiP5J7H.js";
18
-
19
- export { sendMessageWhatsApp, sendPollWhatsApp };
@@ -1,540 +0,0 @@
1
- import { n as loadConfig } from "./config-Cyo0rHBx.js";
2
- import { m as kindFromMime } from "./image-ops-Dye2ozSZ.js";
3
- import { i as resolveSignalAccount } from "./accounts-CQWq_42g.js";
4
- import { n as fetchWithTimeout } from "./fetch-timeout-BZzAoyap.js";
5
- import { t as resolveFetch } from "./fetch-J9xZaNrT.js";
6
- import { i as resolveMarkdownTableMode, n as markdownToIR, t as chunkMarkdownIR } from "./ir-CruONUHn.js";
7
- import { n as generateSecureUuid } from "./secure-random-18hq3O1a.js";
8
- import { t as resolveOutboundAttachmentFromUrl } from "./outbound-attachment-DZphVgq7.js";
9
-
10
- //#region src/signal/format.ts
11
- function normalizeUrlForComparison(url) {
12
- let normalized = url.toLowerCase();
13
- normalized = normalized.replace(/^https?:\/\//, "");
14
- normalized = normalized.replace(/^www\./, "");
15
- normalized = normalized.replace(/\/+$/, "");
16
- return normalized;
17
- }
18
- function mapStyle(style) {
19
- switch (style) {
20
- case "bold": return "BOLD";
21
- case "italic": return "ITALIC";
22
- case "strikethrough": return "STRIKETHROUGH";
23
- case "code":
24
- case "code_block": return "MONOSPACE";
25
- case "spoiler": return "SPOILER";
26
- default: return null;
27
- }
28
- }
29
- function mergeStyles(styles) {
30
- const sorted = [...styles].toSorted((a, b) => {
31
- if (a.start !== b.start) return a.start - b.start;
32
- if (a.length !== b.length) return a.length - b.length;
33
- return a.style.localeCompare(b.style);
34
- });
35
- const merged = [];
36
- for (const style of sorted) {
37
- const prev = merged[merged.length - 1];
38
- if (prev && prev.style === style.style && style.start <= prev.start + prev.length) {
39
- const prevEnd = prev.start + prev.length;
40
- prev.length = Math.max(prevEnd, style.start + style.length) - prev.start;
41
- continue;
42
- }
43
- merged.push({ ...style });
44
- }
45
- return merged;
46
- }
47
- function clampStyles(styles, maxLength) {
48
- const clamped = [];
49
- for (const style of styles) {
50
- const start = Math.max(0, Math.min(style.start, maxLength));
51
- const length = Math.min(style.start + style.length, maxLength) - start;
52
- if (length > 0) clamped.push({
53
- start,
54
- length,
55
- style: style.style
56
- });
57
- }
58
- return clamped;
59
- }
60
- function applyInsertionsToStyles(spans, insertions) {
61
- if (insertions.length === 0) return spans;
62
- const sortedInsertions = [...insertions].toSorted((a, b) => a.pos - b.pos);
63
- let updated = spans;
64
- let cumulativeShift = 0;
65
- for (const insertion of sortedInsertions) {
66
- const insertionPos = insertion.pos + cumulativeShift;
67
- const next = [];
68
- for (const span of updated) {
69
- if (span.end <= insertionPos) {
70
- next.push(span);
71
- continue;
72
- }
73
- if (span.start >= insertionPos) {
74
- next.push({
75
- start: span.start + insertion.length,
76
- end: span.end + insertion.length,
77
- style: span.style
78
- });
79
- continue;
80
- }
81
- if (span.start < insertionPos && span.end > insertionPos) {
82
- if (insertionPos > span.start) next.push({
83
- start: span.start,
84
- end: insertionPos,
85
- style: span.style
86
- });
87
- const shiftedStart = insertionPos + insertion.length;
88
- const shiftedEnd = span.end + insertion.length;
89
- if (shiftedEnd > shiftedStart) next.push({
90
- start: shiftedStart,
91
- end: shiftedEnd,
92
- style: span.style
93
- });
94
- }
95
- }
96
- updated = next;
97
- cumulativeShift += insertion.length;
98
- }
99
- return updated;
100
- }
101
- function renderSignalText(ir) {
102
- const text = ir.text ?? "";
103
- if (!text) return {
104
- text: "",
105
- styles: []
106
- };
107
- const sortedLinks = [...ir.links].toSorted((a, b) => a.start - b.start);
108
- let out = "";
109
- let cursor = 0;
110
- const insertions = [];
111
- for (const link of sortedLinks) {
112
- if (link.start < cursor) continue;
113
- out += text.slice(cursor, link.end);
114
- const href = link.href.trim();
115
- const trimmedLabel = text.slice(link.start, link.end).trim();
116
- if (href) if (!trimmedLabel) {
117
- out += href;
118
- insertions.push({
119
- pos: link.end,
120
- length: href.length
121
- });
122
- } else {
123
- const normalizedLabel = normalizeUrlForComparison(trimmedLabel);
124
- let comparableHref = href;
125
- if (href.startsWith("mailto:")) comparableHref = href.slice(7);
126
- if (normalizedLabel !== normalizeUrlForComparison(comparableHref)) {
127
- const addition = ` (${href})`;
128
- out += addition;
129
- insertions.push({
130
- pos: link.end,
131
- length: addition.length
132
- });
133
- }
134
- }
135
- cursor = link.end;
136
- }
137
- out += text.slice(cursor);
138
- const adjusted = applyInsertionsToStyles(ir.styles.map((span) => {
139
- const mapped = mapStyle(span.style);
140
- if (!mapped) return null;
141
- return {
142
- start: span.start,
143
- end: span.end,
144
- style: mapped
145
- };
146
- }).filter((span) => span !== null), insertions);
147
- const trimmedText = out.trimEnd();
148
- const trimmedLength = trimmedText.length;
149
- return {
150
- text: trimmedText,
151
- styles: mergeStyles(clampStyles(adjusted.map((span) => ({
152
- start: span.start,
153
- length: span.end - span.start,
154
- style: span.style
155
- })), trimmedLength))
156
- };
157
- }
158
- function markdownToSignalText(markdown, options = {}) {
159
- return renderSignalText(markdownToIR(markdown ?? "", {
160
- linkify: true,
161
- enableSpoilers: true,
162
- headingStyle: "bold",
163
- blockquotePrefix: "> ",
164
- tableMode: options.tableMode
165
- }));
166
- }
167
- function sliceSignalStyles(styles, start, end) {
168
- const sliced = [];
169
- for (const style of styles) {
170
- const styleEnd = style.start + style.length;
171
- const sliceStart = Math.max(style.start, start);
172
- const sliceEnd = Math.min(styleEnd, end);
173
- if (sliceEnd > sliceStart) sliced.push({
174
- start: sliceStart - start,
175
- length: sliceEnd - sliceStart,
176
- style: style.style
177
- });
178
- }
179
- return sliced;
180
- }
181
- /**
182
- * Split Signal formatted text into chunks under the limit while preserving styles.
183
- *
184
- * This implementation deterministically tracks cursor position without using indexOf,
185
- * which is fragile when chunks are trimmed or when duplicate substrings exist.
186
- * Styles spanning chunk boundaries are split into separate ranges for each chunk.
187
- */
188
- function splitSignalFormattedText(formatted, limit) {
189
- const { text, styles } = formatted;
190
- if (text.length <= limit) return [formatted];
191
- const results = [];
192
- let remaining = text;
193
- let offset = 0;
194
- while (remaining.length > 0) {
195
- if (remaining.length <= limit) {
196
- const trimmed = remaining.trimEnd();
197
- if (trimmed.length > 0) results.push({
198
- text: trimmed,
199
- styles: mergeStyles(sliceSignalStyles(styles, offset, offset + trimmed.length))
200
- });
201
- break;
202
- }
203
- let breakIdx = findBreakIndex(remaining.slice(0, limit));
204
- if (breakIdx <= 0) breakIdx = limit;
205
- const chunk = remaining.slice(0, breakIdx).trimEnd();
206
- if (chunk.length > 0) results.push({
207
- text: chunk,
208
- styles: mergeStyles(sliceSignalStyles(styles, offset, offset + chunk.length))
209
- });
210
- const brokeOnWhitespace = breakIdx < remaining.length && /\s/.test(remaining[breakIdx]);
211
- const nextStart = Math.min(remaining.length, breakIdx + (brokeOnWhitespace ? 1 : 0));
212
- remaining = remaining.slice(nextStart).trimStart();
213
- offset = text.length - remaining.length;
214
- }
215
- return results;
216
- }
217
- /**
218
- * Find the best break index within a text window.
219
- * Prefers newlines over whitespace, avoids breaking inside parentheses.
220
- */
221
- function findBreakIndex(window) {
222
- let lastNewline = -1;
223
- let lastWhitespace = -1;
224
- let parenDepth = 0;
225
- for (let i = 0; i < window.length; i++) {
226
- const char = window[i];
227
- if (char === "(") {
228
- parenDepth++;
229
- continue;
230
- }
231
- if (char === ")" && parenDepth > 0) {
232
- parenDepth--;
233
- continue;
234
- }
235
- if (parenDepth === 0) {
236
- if (char === "\n") lastNewline = i;
237
- else if (/\s/.test(char)) lastWhitespace = i;
238
- }
239
- }
240
- return lastNewline > 0 ? lastNewline : lastWhitespace;
241
- }
242
- function markdownToSignalTextChunks(markdown, limit, options = {}) {
243
- const chunks = chunkMarkdownIR(markdownToIR(markdown ?? "", {
244
- linkify: true,
245
- enableSpoilers: true,
246
- headingStyle: "bold",
247
- blockquotePrefix: "> ",
248
- tableMode: options.tableMode
249
- }), limit);
250
- const results = [];
251
- for (const chunk of chunks) {
252
- const rendered = renderSignalText(chunk);
253
- if (rendered.text.length > limit) results.push(...splitSignalFormattedText(rendered, limit));
254
- else results.push(rendered);
255
- }
256
- return results;
257
- }
258
-
259
- //#endregion
260
- //#region src/signal/client.ts
261
- const DEFAULT_TIMEOUT_MS = 1e4;
262
- function normalizeBaseUrl(url) {
263
- const trimmed = url.trim();
264
- if (!trimmed) throw new Error("Signal base URL is required");
265
- if (/^https?:\/\//i.test(trimmed)) return trimmed.replace(/\/+$/, "");
266
- return `http://${trimmed}`.replace(/\/+$/, "");
267
- }
268
- function getRequiredFetch() {
269
- const fetchImpl = resolveFetch();
270
- if (!fetchImpl) throw new Error("fetch is not available");
271
- return fetchImpl;
272
- }
273
- function parseSignalRpcResponse(text, status) {
274
- let parsed;
275
- try {
276
- parsed = JSON.parse(text);
277
- } catch (err) {
278
- throw new Error(`Signal RPC returned malformed JSON (status ${status})`, { cause: err });
279
- }
280
- if (!parsed || typeof parsed !== "object") throw new Error(`Signal RPC returned invalid response envelope (status ${status})`);
281
- const rpc = parsed;
282
- const hasResult = Object.hasOwn(rpc, "result");
283
- if (!rpc.error && !hasResult) throw new Error(`Signal RPC returned invalid response envelope (status ${status})`);
284
- return rpc;
285
- }
286
- async function signalRpcRequest(method, params, opts) {
287
- const baseUrl = normalizeBaseUrl(opts.baseUrl);
288
- const id = generateSecureUuid();
289
- const body = JSON.stringify({
290
- jsonrpc: "2.0",
291
- method,
292
- params,
293
- id
294
- });
295
- const res = await fetchWithTimeout(`${baseUrl}/api/v1/rpc`, {
296
- method: "POST",
297
- headers: { "Content-Type": "application/json" },
298
- body
299
- }, opts.timeoutMs ?? DEFAULT_TIMEOUT_MS, getRequiredFetch());
300
- if (res.status === 201) return;
301
- const text = await res.text();
302
- if (!text) throw new Error(`Signal RPC empty response (status ${res.status})`);
303
- const parsed = parseSignalRpcResponse(text, res.status);
304
- if (parsed.error) {
305
- const code = parsed.error.code ?? "unknown";
306
- const msg = parsed.error.message ?? "Signal RPC error";
307
- throw new Error(`Signal RPC ${code}: ${msg}`);
308
- }
309
- return parsed.result;
310
- }
311
- async function signalCheck(baseUrl, timeoutMs = DEFAULT_TIMEOUT_MS) {
312
- const normalized = normalizeBaseUrl(baseUrl);
313
- try {
314
- const res = await fetchWithTimeout(`${normalized}/api/v1/check`, { method: "GET" }, timeoutMs, getRequiredFetch());
315
- if (!res.ok) return {
316
- ok: false,
317
- status: res.status,
318
- error: `HTTP ${res.status}`
319
- };
320
- return {
321
- ok: true,
322
- status: res.status,
323
- error: null
324
- };
325
- } catch (err) {
326
- return {
327
- ok: false,
328
- status: null,
329
- error: err instanceof Error ? err.message : String(err)
330
- };
331
- }
332
- }
333
- async function streamSignalEvents(params) {
334
- const baseUrl = normalizeBaseUrl(params.baseUrl);
335
- const url = new URL(`${baseUrl}/api/v1/events`);
336
- if (params.account) url.searchParams.set("account", params.account);
337
- const fetchImpl = resolveFetch();
338
- if (!fetchImpl) throw new Error("fetch is not available");
339
- const res = await fetchImpl(url, {
340
- method: "GET",
341
- headers: { Accept: "text/event-stream" },
342
- signal: params.abortSignal
343
- });
344
- if (!res.ok || !res.body) throw new Error(`Signal SSE failed (${res.status} ${res.statusText || "error"})`);
345
- const reader = res.body.getReader();
346
- const decoder = new TextDecoder();
347
- let buffer = "";
348
- let currentEvent = {};
349
- const flushEvent = () => {
350
- if (!currentEvent.data && !currentEvent.event && !currentEvent.id) return;
351
- params.onEvent({
352
- event: currentEvent.event,
353
- data: currentEvent.data,
354
- id: currentEvent.id
355
- });
356
- currentEvent = {};
357
- };
358
- while (true) {
359
- const { value, done } = await reader.read();
360
- if (done) break;
361
- buffer += decoder.decode(value, { stream: true });
362
- let lineEnd = buffer.indexOf("\n");
363
- while (lineEnd !== -1) {
364
- let line = buffer.slice(0, lineEnd);
365
- buffer = buffer.slice(lineEnd + 1);
366
- if (line.endsWith("\r")) line = line.slice(0, -1);
367
- if (line === "") {
368
- flushEvent();
369
- lineEnd = buffer.indexOf("\n");
370
- continue;
371
- }
372
- if (line.startsWith(":")) {
373
- lineEnd = buffer.indexOf("\n");
374
- continue;
375
- }
376
- const [rawField, ...rest] = line.split(":");
377
- const field = rawField.trim();
378
- const rawValue = rest.join(":");
379
- const value = rawValue.startsWith(" ") ? rawValue.slice(1) : rawValue;
380
- if (field === "event") currentEvent.event = value;
381
- else if (field === "data") currentEvent.data = currentEvent.data ? `${currentEvent.data}\n${value}` : value;
382
- else if (field === "id") currentEvent.id = value;
383
- lineEnd = buffer.indexOf("\n");
384
- }
385
- }
386
- flushEvent();
387
- }
388
-
389
- //#endregion
390
- //#region src/signal/rpc-context.ts
391
- function resolveSignalRpcContext(opts, accountInfo) {
392
- const hasBaseUrl = Boolean(opts.baseUrl?.trim());
393
- const hasAccount = Boolean(opts.account?.trim());
394
- const resolvedAccount = accountInfo || (!hasBaseUrl || !hasAccount ? resolveSignalAccount({
395
- cfg: loadConfig(),
396
- accountId: opts.accountId
397
- }) : void 0);
398
- const baseUrl = opts.baseUrl?.trim() || resolvedAccount?.baseUrl;
399
- if (!baseUrl) throw new Error("Signal base URL is required");
400
- return {
401
- baseUrl,
402
- account: opts.account?.trim() || resolvedAccount?.config.account?.trim()
403
- };
404
- }
405
-
406
- //#endregion
407
- //#region src/signal/send.ts
408
- function parseTarget(raw) {
409
- let value = raw.trim();
410
- if (!value) throw new Error("Signal recipient is required");
411
- if (value.toLowerCase().startsWith("signal:")) value = value.slice(7).trim();
412
- const normalized = value.toLowerCase();
413
- if (normalized.startsWith("group:")) return {
414
- type: "group",
415
- groupId: value.slice(6).trim()
416
- };
417
- if (normalized.startsWith("username:")) return {
418
- type: "username",
419
- username: value.slice(9).trim()
420
- };
421
- if (normalized.startsWith("u:")) return {
422
- type: "username",
423
- username: value.trim()
424
- };
425
- return {
426
- type: "recipient",
427
- recipient: value
428
- };
429
- }
430
- function buildTargetParams(target, allow) {
431
- if (target.type === "recipient") {
432
- if (!allow.recipient) return null;
433
- return { recipient: [target.recipient] };
434
- }
435
- if (target.type === "group") {
436
- if (!allow.group) return null;
437
- return { groupId: target.groupId };
438
- }
439
- if (target.type === "username") {
440
- if (!allow.username) return null;
441
- return { username: [target.username] };
442
- }
443
- return null;
444
- }
445
- async function sendMessageSignal(to, text, opts = {}) {
446
- const cfg = opts.cfg ?? loadConfig();
447
- const accountInfo = resolveSignalAccount({
448
- cfg,
449
- accountId: opts.accountId
450
- });
451
- const { baseUrl, account } = resolveSignalRpcContext(opts, accountInfo);
452
- const target = parseTarget(to);
453
- let message = text ?? "";
454
- let messageFromPlaceholder = false;
455
- let textStyles = [];
456
- const textMode = opts.textMode ?? "markdown";
457
- const maxBytes = (() => {
458
- if (typeof opts.maxBytes === "number") return opts.maxBytes;
459
- if (typeof accountInfo.config.mediaMaxMb === "number") return accountInfo.config.mediaMaxMb * 1024 * 1024;
460
- if (typeof cfg.agents?.defaults?.mediaMaxMb === "number") return cfg.agents.defaults.mediaMaxMb * 1024 * 1024;
461
- return 8 * 1024 * 1024;
462
- })();
463
- let attachments;
464
- if (opts.mediaUrl?.trim()) {
465
- const resolved = await resolveOutboundAttachmentFromUrl(opts.mediaUrl.trim(), maxBytes, { localRoots: opts.mediaLocalRoots });
466
- attachments = [resolved.path];
467
- const kind = kindFromMime(resolved.contentType ?? void 0);
468
- if (!message && kind) {
469
- message = kind === "image" ? "<media:image>" : `<media:${kind}>`;
470
- messageFromPlaceholder = true;
471
- }
472
- }
473
- if (message.trim() && !messageFromPlaceholder) if (textMode === "plain") textStyles = opts.textStyles ?? [];
474
- else {
475
- const tableMode = resolveMarkdownTableMode({
476
- cfg,
477
- channel: "signal",
478
- accountId: accountInfo.accountId
479
- });
480
- const formatted = markdownToSignalText(message, { tableMode });
481
- message = formatted.text;
482
- textStyles = formatted.styles;
483
- }
484
- if (!message.trim() && (!attachments || attachments.length === 0)) throw new Error("Signal send requires text or media");
485
- const params = { message };
486
- if (textStyles.length > 0) params["text-style"] = textStyles.map((style) => `${style.start}:${style.length}:${style.style}`);
487
- if (account) params.account = account;
488
- if (attachments && attachments.length > 0) params.attachments = attachments;
489
- const targetParams = buildTargetParams(target, {
490
- recipient: true,
491
- group: true,
492
- username: true
493
- });
494
- if (!targetParams) throw new Error("Signal recipient is required");
495
- Object.assign(params, targetParams);
496
- const timestamp = (await signalRpcRequest("send", params, {
497
- baseUrl,
498
- timeoutMs: opts.timeoutMs
499
- }))?.timestamp;
500
- return {
501
- messageId: timestamp ? String(timestamp) : "unknown",
502
- timestamp
503
- };
504
- }
505
- async function sendTypingSignal(to, opts = {}) {
506
- const { baseUrl, account } = resolveSignalRpcContext(opts);
507
- const targetParams = buildTargetParams(parseTarget(to), {
508
- recipient: true,
509
- group: true
510
- });
511
- if (!targetParams) return false;
512
- const params = { ...targetParams };
513
- if (account) params.account = account;
514
- if (opts.stop) params.stop = true;
515
- await signalRpcRequest("sendTyping", params, {
516
- baseUrl,
517
- timeoutMs: opts.timeoutMs
518
- });
519
- return true;
520
- }
521
- async function sendReadReceiptSignal(to, targetTimestamp, opts = {}) {
522
- if (!Number.isFinite(targetTimestamp) || targetTimestamp <= 0) return false;
523
- const { baseUrl, account } = resolveSignalRpcContext(opts);
524
- const targetParams = buildTargetParams(parseTarget(to), { recipient: true });
525
- if (!targetParams) return false;
526
- const params = {
527
- ...targetParams,
528
- targetTimestamp,
529
- type: opts.type ?? "read"
530
- };
531
- if (account) params.account = account;
532
- await signalRpcRequest("sendReceipt", params, {
533
- baseUrl,
534
- timeoutMs: opts.timeoutMs
535
- });
536
- return true;
537
- }
538
-
539
- //#endregion
540
- export { signalCheck as a, markdownToSignalTextChunks as c, resolveSignalRpcContext as i, sendReadReceiptSignal as n, signalRpcRequest as o, sendTypingSignal as r, streamSignalEvents as s, sendMessageSignal as t };