remoteclaw 0.1.0-next.2abd2fa → 0.1.0-next.2b10b69

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 (1048) hide show
  1. package/README.md +9 -7
  2. package/dist/accounts-A8jZK_v9.js +272 -0
  3. package/dist/accounts-BegPt5VR.js +36 -0
  4. package/dist/accounts-BmiimLpP.js +47 -0
  5. package/dist/accounts-Bpk-loA6.js +47 -0
  6. package/dist/accounts-DAdUdbPk.js +36 -0
  7. package/dist/accounts-WYyfAiie.js +270 -0
  8. package/dist/accounts-eGF8pbZH.js +32 -0
  9. package/dist/ack-reactions-CLsQr2VU.js +446 -0
  10. package/dist/ack-reactions-WOCO-wyP.js +446 -0
  11. package/dist/acp-cli-BfgCKAg2.js +1323 -0
  12. package/dist/acp-cli-CfuPALms.js +1317 -0
  13. package/dist/active-listener--FT8ewxl.js +37 -0
  14. package/dist/active-listener-C1StcdIA.js +37 -0
  15. package/dist/agent-BIc_SJut.js +703 -0
  16. package/dist/agent-CM-5cfkt.js +704 -0
  17. package/dist/agent-helpers-CK3Obbsi.js +400 -0
  18. package/dist/agent-helpers-KHUla1K7.js +400 -0
  19. package/dist/agent-scope-BV-Hg1l_.js +102 -0
  20. package/dist/agent-scope-zFv4opB7.js +100 -0
  21. package/dist/agents-CJaVvFzW.js +788 -0
  22. package/dist/agents.config-BUL6coCe.js +116 -0
  23. package/dist/agents.config-Dh1oX7-1.js +116 -0
  24. package/dist/audio-B85HoT7E.js +43 -0
  25. package/dist/audio-BbCUzndz.js +43 -0
  26. package/dist/audio-preflight-BkmfUwW2.js +69 -0
  27. package/dist/audio-preflight-DV15Iosz.js +64 -0
  28. package/dist/audit-DaDkfdqO.js +3149 -0
  29. package/dist/audit-Do3T75cI.js +3149 -0
  30. package/dist/auth-Bq44qPUd.js +448 -0
  31. package/dist/auth-CVfoI--S.js +281 -0
  32. package/dist/auth-DTWpZJ1a.js +279 -0
  33. package/dist/auth-VItd2pwK.js +448 -0
  34. package/dist/banner-COLdejNZ.js +294 -0
  35. package/dist/binaries-DbgLoSWv.js +13 -0
  36. package/dist/bindings-17cTGP6h.js +69 -0
  37. package/dist/bindings-ByBgLgDQ.js +69 -0
  38. package/dist/bonjour-discovery-CQU4QbLK.js +378 -0
  39. package/dist/bonjour-discovery-D8aOnk3M.js +378 -0
  40. package/dist/boot/handler.js +31 -58
  41. package/dist/browser-cli-BLKuIsbO.js +1693 -0
  42. package/dist/browser-cli-CB4a1TuE.js +1688 -0
  43. package/dist/build-info.json +3 -3
  44. package/dist/call-7n49ecJq.js +2827 -0
  45. package/dist/call-BlTHYxiR.js +2826 -0
  46. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  47. package/dist/catalog-Bsy0ou-7.js +185 -0
  48. package/dist/catalog-DkHDHmE3.js +185 -0
  49. package/dist/channel-account-context-CA2m93Kt.js +550 -0
  50. package/dist/channel-account-context-Las-t6RP.js +550 -0
  51. package/dist/channel-activity-BD603ehL.js +94 -0
  52. package/dist/channel-activity-BZtWpdKA.js +292 -0
  53. package/dist/channel-activity-CwiF_QMr.js +94 -0
  54. package/dist/channel-options-6tsHMs0E.js +33 -0
  55. package/dist/channel-options-eBdabbFP.js +32 -0
  56. package/dist/channel-selection-4B0amBiC.js +51 -0
  57. package/dist/channel-selection-C7-xETm-.js +51 -0
  58. package/dist/channel-web-BPSUxfTB.js +2136 -0
  59. package/dist/channel-web-DZtZoJua.js +2134 -0
  60. package/dist/channels-cli-B_bL2GGF.js +1427 -0
  61. package/dist/channels-cli-DMPktfYA.js +1422 -0
  62. package/dist/channels-status-issues-COhXr19z.js +18 -0
  63. package/dist/channels-status-issues-EXZjUvNx.js +18 -0
  64. package/dist/chat-envelope-BEDutlnF.js +248 -0
  65. package/dist/chat-envelope-vJJUdDE7.js +248 -0
  66. package/dist/chrome-DhIX5ZXR.js +1732 -0
  67. package/dist/chrome-QGS_nPol.js +1733 -0
  68. package/dist/chunk-C1mQSjas.js +341 -0
  69. package/dist/chunk-D7VX4pmT.js +341 -0
  70. package/dist/clack-prompter-BX8SVxtP.js +122 -0
  71. package/dist/clack-prompter-D6HhVlZW.js +121 -0
  72. package/dist/cleanup-utils-DNd0wdKZ.js +94 -0
  73. package/dist/cli/daemon-cli.js +1 -1
  74. package/dist/cli-CDJBozOk.js +126 -0
  75. package/dist/cli-DjK3rbeL.js +131 -0
  76. package/dist/clipboard-Cbj3McM_.js +31 -0
  77. package/dist/clipboard-Ne8gaWea.js +31 -0
  78. package/dist/command-format-D0vKipG9.js +32 -0
  79. package/dist/command-format-KkslAzwV.js +18 -0
  80. package/dist/command-logger/handler.js +1 -1
  81. package/dist/command-registry-C_ZDcDdA.js +215 -0
  82. package/dist/commands-B8CnFl2l.js +41 -0
  83. package/dist/commands-D8dOiIMW.js +41 -0
  84. package/dist/commands-registry-Bfk_i3kU.js +891 -0
  85. package/dist/commands-registry-d86t1JRf.js +892 -0
  86. package/dist/common-DHHHAcmR.js +156 -0
  87. package/dist/common-De-Lakuh.js +156 -0
  88. package/dist/completion-cli-D7rs6itS.js +452 -0
  89. package/dist/completion-cli-DtovlPDc.js +452 -0
  90. package/dist/config-BUG2-b_c.js +4225 -0
  91. package/dist/config-Dn-AOs9C.js +4223 -0
  92. package/dist/config-cli-CH3kQ5po.js +242 -0
  93. package/dist/config-cli-DzOPMRUS.js +247 -0
  94. package/dist/config-guard-Bxmnh90A.js +75 -0
  95. package/dist/config-guard-D7ZwSyVq.js +98 -0
  96. package/dist/config-validation-BTmMmGZ0.js +18 -0
  97. package/dist/config-validation-HBwpuXhW.js +18 -0
  98. package/dist/configure-BzbCd2PA.js +891 -0
  99. package/dist/configure-dfVJ3zfJ.js +889 -0
  100. package/dist/constants-BbAEYzFC.js +70 -0
  101. package/dist/constants-tLOgmZZ1.js +70 -0
  102. package/dist/control-auth-Bx4kGbyS.js +397 -0
  103. package/dist/control-auth-Cue2WyeN.js +397 -0
  104. package/dist/control-ui/assets/index-CuY3pfh1.js +7716 -0
  105. package/dist/control-ui/assets/index-CuY3pfh1.js.map +1 -0
  106. package/dist/control-ui/assets/index-D_fjkN3g.css +1 -0
  107. package/dist/control-ui/index.html +2 -2
  108. package/dist/control-ui-assets-BlpSXjlT.js +186 -0
  109. package/dist/control-ui-assets-eJU2-yvs.js +186 -0
  110. package/dist/conversation-label-Bn5j3lUT.js +36 -0
  111. package/dist/conversation-label-L0QTtKji.js +36 -0
  112. package/dist/cron-cli-DXhBQPiE.js +491 -0
  113. package/dist/cron-cli-xmCCq5u0.js +496 -0
  114. package/dist/daemon-cli-5LdpTqZh.js +1199 -0
  115. package/dist/daemon-cli-CQ1lo3k0.js +1197 -0
  116. package/dist/daemon-cli.js +53 -97
  117. package/dist/daemon-install-BMEnzWwq.js +60 -0
  118. package/dist/daemon-install-BkUJbdPC.js +55 -0
  119. package/dist/daemon-install-helpers-B9kMxC1v.js +462 -0
  120. package/dist/daemon-install-helpers-DoYR5z4H.js +462 -0
  121. package/dist/deliver-B5_s8OJS.js +481 -0
  122. package/dist/deliver-B_Z_1kNY.js +481 -0
  123. package/dist/delivery-queue-B6TuHppj.js +244 -0
  124. package/dist/delivery-queue-BZc3AiGu.js +244 -0
  125. package/dist/devices-cli-85CwoD14.js +322 -0
  126. package/dist/devices-cli-Cq8T9xJ6.js +317 -0
  127. package/dist/diagnostics-CK2HGAFw.js +46 -0
  128. package/dist/diagnostics-G-C-IuxO.js +46 -0
  129. package/dist/directory-cli-6yrkngVv.js +218 -0
  130. package/dist/directory-cli-DM_-11Uh.js +223 -0
  131. package/dist/dm-policy-shared-COlYMxtM.js +22 -0
  132. package/dist/dm-policy-shared-CwF5vseI.js +22 -0
  133. package/dist/dns-cli-BWO3224U.js +203 -0
  134. package/dist/dns-cli-C2PQTe4l.js +198 -0
  135. package/dist/dock-BXOeNbue.js +929 -0
  136. package/dist/dock-C2JY6fLh.js +928 -0
  137. package/dist/doctor-completion-B4zKiuEl.js +92 -0
  138. package/dist/doctor-completion-BdBvF459.js +92 -0
  139. package/dist/doctor-config-flow-BeAhXtHc.js +1934 -0
  140. package/dist/doctor-config-flow-CE8H42FZ.js +1935 -0
  141. package/dist/enable-B5dIjgnm.js +59 -0
  142. package/dist/enable-FmiEY4ng.js +59 -0
  143. package/dist/entry.js +14 -16
  144. package/dist/env-DUb5GiQe.js +60 -0
  145. package/dist/env-vars-C8WMB8Ix.js +93 -0
  146. package/dist/errors-CdmXrBic.js +35 -0
  147. package/dist/errors-DdLfwEVi.js +35 -0
  148. package/dist/exec-BhkXWg7V.js +164 -0
  149. package/dist/exec-ClUTXFZ9.js +164 -0
  150. package/dist/export-html/template.css +0 -36
  151. package/dist/export-html/template.js +1 -32
  152. package/dist/extensionAPI.js +914 -103
  153. package/dist/fetch-CCuD0LYV.js +67 -0
  154. package/dist/fetch-DIsxaqeZ.js +67 -0
  155. package/dist/fetch-JBWLkOpL.js +67 -0
  156. package/dist/file-lock-6NXMPZTT.js +107 -0
  157. package/dist/file-lock-Ks-RPU6W.js +107 -0
  158. package/dist/fs-safe-93aDW4mH.js +98 -0
  159. package/dist/fs-safe-ACrBwOF5.js +88 -0
  160. package/dist/gateway-cli-8HoG2k87.js +23725 -0
  161. package/dist/gateway-cli-CvrV19cN.js +23730 -0
  162. package/dist/gateway-rpc-Cx5SmFxe.js +28 -0
  163. package/dist/gateway-rpc-Dsw9rTFn.js +28 -0
  164. package/dist/gmail-setup-utils-DNZEf6T0.js +422 -0
  165. package/dist/gmail-setup-utils-KPAKWwGy.js +423 -0
  166. package/dist/health-BuBWWW2q.js +1417 -0
  167. package/dist/health-CVeDiSQZ.js +1414 -0
  168. package/dist/health-format-DOhfU1rY.js +28 -0
  169. package/dist/heartbeat-visibility-CjR7WIvw.js +125 -0
  170. package/dist/heartbeat-visibility-DUbt8Gap.js +125 -0
  171. package/dist/help-format-Ch0EWh7N.js +17 -0
  172. package/dist/helpers-B4NWktS8.js +10 -0
  173. package/dist/hook-runner-global-0V6n-Vf7.js +527 -0
  174. package/dist/hooks-cli-CRxy3Nz7.js +1218 -0
  175. package/dist/hooks-cli-DF3F4B8J.js +1223 -0
  176. package/dist/image-ops-DMl7j7f4.js +354 -0
  177. package/dist/image-ops-DpkTOzhI.js +354 -0
  178. package/dist/import-DNGJD1o2.js +320 -0
  179. package/dist/import-VapgNLeq.js +318 -0
  180. package/dist/inbound-context-CmmmT8IP.js +68 -0
  181. package/dist/inbound-context-oxIWzEgc.js +68 -0
  182. package/dist/inbound-path-policy-BdmTOUka.js +90 -0
  183. package/dist/inbound-path-policy-DYTLjca8.js +90 -0
  184. package/dist/index.js +106 -105
  185. package/dist/inspect-C9d1V-lI.js +559 -0
  186. package/dist/inspect-rHjRqr3W.js +559 -0
  187. package/dist/installs-Cksm6vsG.js +325 -0
  188. package/dist/installs-Cmb4NT-T.js +325 -0
  189. package/dist/ipv4-DdcyK1aU.js +46 -0
  190. package/dist/ipv4-OHvujh00.js +46 -0
  191. package/dist/ir-BU0QMAQ-.js +940 -0
  192. package/dist/json-files-BiA_B-xm.js +46 -0
  193. package/dist/links-CIHbVNO_.js +15 -0
  194. package/dist/loader-Cg92Q5wa.js +22404 -0
  195. package/dist/loader-D9yzzfmH.js +22401 -0
  196. package/dist/local-roots-BSqSH6vu.js +313 -0
  197. package/dist/local-roots-CcApw3bD.js +314 -0
  198. package/dist/logger-BtwpYD7c.js +49 -0
  199. package/dist/logging-CLc3Umm0.js +20 -0
  200. package/dist/login-BA-Cg_v7.js +61 -0
  201. package/dist/login-DH651f21.js +62 -0
  202. package/dist/login-qr-CEM_OfsQ.js +328 -0
  203. package/dist/login-qr-DDkN_xFG.js +323 -0
  204. package/dist/logs-cli-DZ2ZJ2sP.js +234 -0
  205. package/dist/logs-cli-e0RtYvYw.js +239 -0
  206. package/dist/markdown-tables-BSwaLSWE.js +29 -0
  207. package/dist/markdown-tables-CDbWkshn.js +29 -0
  208. package/dist/media-CtQ6OwEk.js +10453 -0
  209. package/dist/media-CuA9inrP.js +940 -0
  210. package/dist/message-action-names-C077VyVA.js +2521 -0
  211. package/dist/message-action-names-DYTRKMO6.js +2521 -0
  212. package/dist/message-channel-DF4I2vOK.js +91 -0
  213. package/dist/net-COL170MG.js +225 -0
  214. package/dist/net-QZ8IHNXc.js +225 -0
  215. package/dist/node-cli-CW8jOcHO.js +24 -0
  216. package/dist/nodes-cli-BLAf02N9.js +1344 -0
  217. package/dist/nodes-cli-tng63KM_.js +1349 -0
  218. package/dist/nodes-screen-CZCXHrWB.js +250 -0
  219. package/dist/nodes-screen-C_K1vcS5.js +250 -0
  220. package/dist/note-BVerR3D5.js +92 -0
  221. package/dist/note-Dk8-EaJg.js +92 -0
  222. package/dist/npm-registry-spec-Dma0KHft.js +786 -0
  223. package/dist/npm-registry-spec-vYkxZb6u.js +786 -0
  224. package/dist/npm-resolution-BFy5tI_7.js +86 -0
  225. package/dist/npm-resolution-C0xUKTXh.js +86 -0
  226. package/dist/onboard-BAsuFdGV.js +436 -0
  227. package/dist/onboard-DVfn-Zo7.js +438 -0
  228. package/dist/onboard-channels-D4d74rez.js +2547 -0
  229. package/dist/onboard-channels-LUucMhAH.js +2548 -0
  230. package/dist/onboard-config-CcPV3Cqz.js +39 -0
  231. package/dist/onboard-config-DcTaxmuf.js +39 -0
  232. package/dist/onboard-helpers-C-4xNq93.js +363 -0
  233. package/dist/onboard-helpers-CG1N1AbD.js +364 -0
  234. package/dist/onboard-remote-B6hVF0-x.js +127 -0
  235. package/dist/onboard-remote-JH1tZaJ2.js +127 -0
  236. package/dist/onboarding-C6yVyhil.js +588 -0
  237. package/dist/onboarding-D4w2qffr.js +586 -0
  238. package/dist/onboarding.finalize-BQZbcQ_B.js +399 -0
  239. package/dist/onboarding.finalize-CWVwXTLy.js +402 -0
  240. package/dist/onboarding.gateway-config-C4DVSd0T.js +192 -0
  241. package/dist/onboarding.gateway-config-CKVOMTs6.js +199 -0
  242. package/dist/outbound-BakpK4QQ.js +220 -0
  243. package/dist/outbound-BvYF_0gT.js +221 -0
  244. package/dist/outbound-attachment-B3mkrvPX.js +18 -0
  245. package/dist/outbound-attachment-CfqBeITy.js +18 -0
  246. package/dist/outbound-attachment-EaNtc-Nr.js +18 -0
  247. package/dist/pairing-cli-C7hQWQOq.js +123 -0
  248. package/dist/pairing-cli-RV0Hf5iL.js +128 -0
  249. package/dist/pairing-labels-BjIme5ml.js +9 -0
  250. package/dist/pairing-labels-YB3ZrGiK.js +9 -0
  251. package/dist/pairing-store-Cya-CfOl.js +459 -0
  252. package/dist/pairing-store-v3Gkfqei.js +460 -0
  253. package/dist/path-env-D7VB7sOO.js +89 -0
  254. package/dist/path-env-DFiYvvI-.js +89 -0
  255. package/dist/path-safety-BshBsw4P.js +14 -0
  256. package/dist/path-safety-CZbhQciI.js +14 -0
  257. package/dist/plugin-auto-enable-3jbKb_W_.js +302 -0
  258. package/dist/plugin-auto-enable-BvMj37DE.js +301 -0
  259. package/dist/plugin-registry-7W2jEfhq.js +33 -0
  260. package/dist/plugin-registry-Dj5pZmtW.js +33 -0
  261. package/dist/plugin-sdk/agents/agent-helpers.d.ts +0 -1
  262. package/dist/plugin-sdk/agents/agent-scope.d.ts +10 -0
  263. package/dist/plugin-sdk/agents/agent-types.d.ts +1 -6
  264. package/dist/plugin-sdk/agents/agent-utils.d.ts +0 -14
  265. package/dist/plugin-sdk/agents/provider-utils.d.ts +0 -1
  266. package/dist/plugin-sdk/agents/subagent-spawn.d.ts +0 -1
  267. package/dist/plugin-sdk/agents/tools/sessions-helpers.d.ts +0 -1
  268. package/dist/plugin-sdk/auth/constants.d.ts +16 -0
  269. package/dist/plugin-sdk/auth/display.d.ts +7 -0
  270. package/dist/plugin-sdk/auth/doctor.d.ts +8 -0
  271. package/dist/plugin-sdk/auth/index.d.ts +8 -0
  272. package/dist/plugin-sdk/auth/oauth.d.ts +14 -0
  273. package/dist/plugin-sdk/auth/provider-auth.d.ts +40 -0
  274. package/dist/plugin-sdk/auth/session-override.d.ts +18 -0
  275. package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +0 -1
  276. package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +0 -2
  277. package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +1 -4
  278. package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +1 -4
  279. package/dist/plugin-sdk/auto-reply/reply/directive-handling.levels.d.ts +1 -7
  280. package/dist/plugin-sdk/auto-reply/reply/directive-handling.params.d.ts +1 -4
  281. package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +1 -7
  282. package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +1 -4
  283. package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +3 -15
  284. package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +1 -5
  285. package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +1 -5
  286. package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +1 -5
  287. package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +1 -3
  288. package/dist/plugin-sdk/auto-reply/reply/response-prefix-template.d.ts +4 -6
  289. package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +0 -7
  290. package/dist/plugin-sdk/auto-reply/reply/session-updates.d.ts +0 -10
  291. package/dist/plugin-sdk/auto-reply/reply.d.ts +1 -1
  292. package/dist/plugin-sdk/auto-reply/status.d.ts +2 -6
  293. package/dist/plugin-sdk/auto-reply/thinking.d.ts +0 -11
  294. package/dist/plugin-sdk/auto-reply/types.d.ts +1 -2
  295. package/dist/plugin-sdk/commands/agent/session.d.ts +1 -2
  296. package/dist/plugin-sdk/config/defaults.d.ts +0 -1
  297. package/dist/plugin-sdk/config/sessions/types.d.ts +0 -8
  298. package/dist/plugin-sdk/config/types.agent-defaults.d.ts +28 -112
  299. package/dist/plugin-sdk/config/types.agents.d.ts +8 -0
  300. package/dist/plugin-sdk/config/types.messages.d.ts +1 -2
  301. package/dist/plugin-sdk/config/types.tools.d.ts +1 -1
  302. package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +9 -66
  303. package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +5 -13
  304. package/dist/plugin-sdk/config/zod-schema.agents.d.ts +12 -76
  305. package/dist/plugin-sdk/config/zod-schema.d.ts +12 -76
  306. package/dist/plugin-sdk/daemon/constants.d.ts +2 -2
  307. package/dist/plugin-sdk/gateway/protocol/index.d.ts +1 -3
  308. package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +0 -2
  309. package/dist/plugin-sdk/gateway/session-utils.types.d.ts +0 -2
  310. package/dist/plugin-sdk/index.js +65 -112
  311. package/dist/plugin-sdk/middleware/channel-bridge.d.ts +4 -0
  312. package/dist/plugin-sdk/middleware/media-resolver.d.ts +12 -0
  313. package/dist/plugin-sdk/middleware/runtime-factory.d.ts +42 -0
  314. package/dist/plugin-sdk/middleware/types.d.ts +33 -1
  315. package/dist/plugin-sdk/plugins/types.d.ts +1 -1
  316. package/dist/plugin-sdk/terminal/palette.d.ts +2 -2
  317. package/dist/plugins-B2BD3_FH.js +455 -0
  318. package/dist/plugins-JyKGZ4vK.js +453 -0
  319. package/dist/plugins-cli-BfehDKSg.js +794 -0
  320. package/dist/plugins-cli-c01nlnom.js +799 -0
  321. package/dist/ports-BcTKFlWl.js +96 -0
  322. package/dist/ports-DAc2AlZE.js +316 -0
  323. package/dist/ports-HiuYk3bt.js +96 -0
  324. package/dist/ports-dEePqmCq.js +370 -0
  325. package/dist/program-BnOZ9_tc.js +245 -0
  326. package/dist/program-context-CLIohpL6.js +474 -0
  327. package/dist/progress-DQ1drugY.js +124 -0
  328. package/dist/prompt-edYTUtju.js +21 -0
  329. package/dist/prompt-select-styled-DDJe9DdT.js +1650 -0
  330. package/dist/prompt-select-styled-Keh8rIhr.js +1647 -0
  331. package/dist/prompt-style-CYEpbwXH.js +9 -0
  332. package/dist/provider-dispatcher-Cn6FP2P6.js +659 -0
  333. package/dist/provider-dispatcher-XyTjyKAC.js +660 -0
  334. package/dist/push-apns-DQwR-i4_.js +713 -0
  335. package/dist/push-apns-Dj5RApCY.js +711 -0
  336. package/dist/pw-ai-CoqJfRWB.js +1911 -0
  337. package/dist/pw-ai-IaJZZ3hC.js +1907 -0
  338. package/dist/qr-cli-BW0LYR3W.js +348 -0
  339. package/dist/qr-cli-CmoVibfU.js +353 -0
  340. package/dist/redact-gXuh8MFk.js +191 -0
  341. package/dist/redact-snapshot-B-2V56Yb.js +2016 -0
  342. package/dist/redact-snapshot-CD36XSYE.js +2016 -0
  343. package/dist/register.agent-CErgmhLM.js +287 -0
  344. package/dist/register.agent-CGe-oDLF.js +1044 -0
  345. package/dist/register.configure-CRQ0HUjL.js +125 -0
  346. package/dist/register.configure-c1Gr25OX.js +131 -0
  347. package/dist/register.import-Cx0y8YCl.js +28 -0
  348. package/dist/register.import-uoLzzezU.js +31 -0
  349. package/dist/register.maintenance-BCOR2-L5.js +498 -0
  350. package/dist/register.maintenance-D6wpayrD.js +495 -0
  351. package/dist/register.message-BvnvbkOW.js +682 -0
  352. package/dist/register.message-IE7nxjjZ.js +687 -0
  353. package/dist/register.onboard-CPz3KvRa.js +258 -0
  354. package/dist/register.onboard-GdHLVMEt.js +263 -0
  355. package/dist/register.setup-DAd41OGt.js +110 -0
  356. package/dist/register.setup-kgRP89sw.js +115 -0
  357. package/dist/register.status-health-sessions-BZAQj7ug.js +665 -0
  358. package/dist/register.status-health-sessions-tO2kCw9b.js +424 -0
  359. package/dist/register.subclis-B06nywBa.js +267 -0
  360. package/dist/replies-CZfNjVWx.js +136 -0
  361. package/dist/replies-Dhu5vvS7.js +136 -0
  362. package/dist/reply-BaiBy5TB.js +13509 -0
  363. package/dist/reply-CNbfMQYt.js +13512 -0
  364. package/dist/reply-directives-DjJb7OMz.js +182 -0
  365. package/dist/reply-directives-xAXbScZL.js +182 -0
  366. package/dist/reply-payloads-B36nopEQ.js +527 -0
  367. package/dist/reply-prefix-BMPgiidY.js +37 -0
  368. package/dist/reply-prefix-Cloz8gO5.js +37 -0
  369. package/dist/resolve-route-B331K2uj.js +249 -0
  370. package/dist/resolve-route-HR0-JPvG.js +249 -0
  371. package/dist/response-prefix-template-CFep0aLY.js +134 -0
  372. package/dist/response-prefix-template-CHYkGv-O.js +134 -0
  373. package/dist/retry-BcZuGfnV.js +77 -0
  374. package/dist/retry-bFj4k6Ii.js +77 -0
  375. package/dist/run-main-DTCaxqR3.js +303 -0
  376. package/dist/runner-BJwspNxs.js +2295 -0
  377. package/dist/runner-LlWW71Od.js +2295 -0
  378. package/dist/runtime-guard-CXt4yzo-.js +60 -0
  379. package/dist/secure-random-ecLqbmqo.js +44 -0
  380. package/dist/security-cli-Clcfo3Gy.js +485 -0
  381. package/dist/security-cli-DXAoDc-w.js +479 -0
  382. package/dist/send-B35b12JJ.js +2245 -0
  383. package/dist/send-BAggoIc2.js +492 -0
  384. package/dist/send-BBYecFpQ.js +547 -0
  385. package/dist/send-BCtNQNvS.js +374 -0
  386. package/dist/send-BuHoT4O3.js +547 -0
  387. package/dist/send-BwtjoN7o.js +349 -0
  388. package/dist/send-C8JNU6CY.js +1776 -0
  389. package/dist/send-CHP1Ej9r.js +11 -0
  390. package/dist/send-CMXAg994.js +492 -0
  391. package/dist/send-CjxVcEWA.js +1174 -0
  392. package/dist/send-D27AVHmm.js +332 -0
  393. package/dist/send-DAVkGLr8.js +29 -0
  394. package/dist/send-DBPUUgmV.js +426 -0
  395. package/dist/send-DgZ_TEXm.js +349 -0
  396. package/dist/send-Urg1FQav.js +2245 -0
  397. package/dist/send-XfivIUZ5.js +1779 -0
  398. package/dist/server-Cf6Af-yT.js +206 -0
  399. package/dist/server-DeDULwdO.js +201 -0
  400. package/dist/server-lifecycle-B-nBTkRz.js +2437 -0
  401. package/dist/server-lifecycle-D1EOPVh_.js +2437 -0
  402. package/dist/server-node-events-BfCISQxc.js +390 -0
  403. package/dist/server-node-events-c754FA18.js +395 -0
  404. package/dist/service-BDt-zUvV.js +670 -0
  405. package/dist/service-Os7W1F2S.js +670 -0
  406. package/dist/session-B9KGKVrY.js +170 -0
  407. package/dist/session-DzAupDyj.js +170 -0
  408. package/dist/session-cost-usage-BYCI739a.js +627 -0
  409. package/dist/session-cost-usage-DGsPcuMj.js +627 -0
  410. package/dist/session-dirs-BIg5RHAh.js +947 -0
  411. package/dist/session-dirs-DwDxjK1p.js +947 -0
  412. package/dist/session-utils-CJ4_W4fg.js +622 -0
  413. package/dist/session-utils-Kf4o4FnD.js +622 -0
  414. package/dist/sessions-DvrUtbf6.js +247 -0
  415. package/dist/sessions-Zt7H2aAB.js +2569 -0
  416. package/dist/shell-env-CsV_IkJj.js +163 -0
  417. package/dist/shell-env-hZW9j-Uc.js +163 -0
  418. package/dist/ssrf-B-rF_tZB.js +183 -0
  419. package/dist/ssrf-D6fl_7ww.js +183 -0
  420. package/dist/status-CWFMc1iO.js +2065 -0
  421. package/dist/status-CbH2Cq7P.js +2061 -0
  422. package/dist/status.update-DbO7izip.js +79 -0
  423. package/dist/status.update-wXyvcztI.js +79 -0
  424. package/dist/store-BLGrRL_E.js +64 -0
  425. package/dist/store-BYhcsOLr.js +64 -0
  426. package/dist/store-DDu7FqWo.js +53 -0
  427. package/dist/store-EaFaTdkI.js +2571 -0
  428. package/dist/subagent-registry-IgAXh_T2.js +4854 -0
  429. package/dist/subagent-registry-g9xCAAKe.js +4856 -0
  430. package/dist/subsystem-BgxIzx7w.js +1137 -0
  431. package/dist/subsystem-rxNDBm7l.js +1079 -0
  432. package/dist/system-cli-CT7YogPi.js +71 -0
  433. package/dist/system-cli-CkJjY9Dp.js +76 -0
  434. package/dist/systemd-BlbIQ1PV.js +547 -0
  435. package/dist/systemd-DzXePo7r.js +547 -0
  436. package/dist/systemd-linger-mLbBF4pa.js +75 -0
  437. package/dist/systemd-linger-qlGGW2JB.js +75 -0
  438. package/dist/table-V_9n7CjP.js +279 -0
  439. package/dist/tables-CZVG7S4H.js +55 -0
  440. package/dist/tables-CzHK57t9.js +55 -0
  441. package/dist/tables-omygWbJB.js +55 -0
  442. package/dist/tailnet-BoTa0e2q.js +40 -0
  443. package/dist/tailnet-Cy0Q27lj.js +40 -0
  444. package/dist/tailscale-CiWkh0vS.js +230 -0
  445. package/dist/tailscale-Driw3j8E.js +230 -0
  446. package/dist/targets-BPN0DvHP.js +2328 -0
  447. package/dist/targets-C-L5fGBe.js +220 -0
  448. package/dist/targets-Clj7l2Nn.js +650 -0
  449. package/dist/targets-DKriCISG.js +53 -0
  450. package/dist/targets-DhhaK2xG.js +53 -0
  451. package/dist/targets-ahUn6mlN.js +2329 -0
  452. package/dist/targets-pBytVUFu.js +650 -0
  453. package/dist/targets-tDrl_ioQ.js +46 -0
  454. package/dist/thinking-XA5P_zFw.js +88 -0
  455. package/dist/thinking-l-rrvZwu.js +88 -0
  456. package/dist/tokens-7ZtWRjA3.js +21 -0
  457. package/dist/tool-display-AxpSXZVq.js +785 -0
  458. package/dist/tool-display-D6GD-41Y.js +785 -0
  459. package/dist/tool-images-D16vIWPg.js +263 -0
  460. package/dist/tool-images-IVIZ29ID.js +263 -0
  461. package/dist/trash--8b4GDyV.js +125 -0
  462. package/dist/trash-ivbG2QWV.js +125 -0
  463. package/dist/tui-B3luE_3h.js +3319 -0
  464. package/dist/tui-Re3x9FR4.js +3319 -0
  465. package/dist/tui-cli-BC2KZKAF.js +64 -0
  466. package/dist/tui-cli-CBqhGmSQ.js +59 -0
  467. package/dist/update-BMbqeL2I.js +349 -0
  468. package/dist/update-XA444Io6.js +349 -0
  469. package/dist/update-cli-Dh5YH99C.js +1374 -0
  470. package/dist/update-cli-DpSM6b_j.js +1371 -0
  471. package/dist/usage-D0YekYqR.js +5330 -0
  472. package/dist/utils-C5daYcFn.js +631 -0
  473. package/dist/web-C3MEt14b.js +77 -0
  474. package/dist/web-DOqxASa3.js +3063 -0
  475. package/dist/web-TsKHBSJW.js +71 -0
  476. package/dist/webhooks-cli-BBSfGM3_.js +334 -0
  477. package/dist/webhooks-cli-DBPl8Qox.js +329 -0
  478. package/dist/whatsapp-actions-BAvGY5o8.js +129 -0
  479. package/dist/whatsapp-actions-Bms2wcXx.js +123 -0
  480. package/dist/widearea-dns-fHQt5-Q3.js +127 -0
  481. package/dist/workspace-DGMxt6vS.js +447 -0
  482. package/dist/workspace-DoiuJC1a.js +449 -0
  483. package/dist/zod-schema-B9RGngMW.js +2696 -0
  484. package/dist/zod-schema-D3hQ5SKe.js +2696 -0
  485. package/extensions/matrix/src/matrix/monitor/replies.ts +0 -24
  486. package/extensions/mattermost/src/mattermost/monitor-helpers.ts +0 -1
  487. package/package.json +3 -3
  488. package/dist/accounts-BFy_Z3od.js +0 -272
  489. package/dist/accounts-BTXSfPWi.js +0 -270
  490. package/dist/accounts-BxGS70Do.js +0 -36
  491. package/dist/accounts-CNY1TGj1.js +0 -47
  492. package/dist/accounts-DBohBlww.js +0 -32
  493. package/dist/accounts-DqRQ75w3.js +0 -36
  494. package/dist/accounts-iODF3SK2.js +0 -47
  495. package/dist/ack-reactions-B11TAC2D.js +0 -446
  496. package/dist/ack-reactions-BWVjL4H6.js +0 -446
  497. package/dist/acp-cli-CA1xMmVo.js +0 -1320
  498. package/dist/acp-cli-CGo6fJVZ.js +0 -1326
  499. package/dist/active-listener-VzhWW8W6.js +0 -37
  500. package/dist/active-listener-z0qVEcom.js +0 -37
  501. package/dist/agent-CTizRPIJ.js +0 -732
  502. package/dist/agent-D2RVoS5g.js +0 -731
  503. package/dist/agent-helpers-B6VfZ9_u.js +0 -606
  504. package/dist/agent-helpers-CTx5KKJu.js +0 -606
  505. package/dist/agent-scope-BGYzhtWQ.js +0 -121
  506. package/dist/agent-scope-C50VuLKh.js +0 -119
  507. package/dist/agents-BuYn-obw.js +0 -788
  508. package/dist/agents.config-BSTxuTVd.js +0 -116
  509. package/dist/agents.config-p3V3b9u6.js +0 -116
  510. package/dist/audio-DPOuhNq7.js +0 -43
  511. package/dist/audio-VBcVDa08.js +0 -43
  512. package/dist/audio-preflight-BwmCYeuM.js +0 -64
  513. package/dist/audio-preflight-co8gjlPX.js +0 -69
  514. package/dist/audit-oH4urD3G.js +0 -3138
  515. package/dist/audit-qgtCT3ik.js +0 -3138
  516. package/dist/auth-CAczFgAO.js +0 -448
  517. package/dist/auth-Deh9i9Eg.js +0 -448
  518. package/dist/auth-profiles-BquJGKLC.js +0 -279
  519. package/dist/auth-profiles-D8vKiBPq.js +0 -281
  520. package/dist/banner-Cf978khN.js +0 -294
  521. package/dist/binaries-DXW6oATV.js +0 -13
  522. package/dist/bindings-CRU_udk8.js +0 -69
  523. package/dist/bindings-DQZAu8Wv.js +0 -69
  524. package/dist/bonjour-discovery-DdAk1VyO.js +0 -378
  525. package/dist/bonjour-discovery-DuhiIZZx.js +0 -378
  526. package/dist/browser-cli-CZC4h5V4.js +0 -1687
  527. package/dist/browser-cli-DAgi_aQk.js +0 -1692
  528. package/dist/call-BbwtB9Y-.js +0 -2828
  529. package/dist/call-PivL7Uex.js +0 -2829
  530. package/dist/catalog-BqO6yem_.js +0 -185
  531. package/dist/catalog-DFmaYwfk.js +0 -185
  532. package/dist/channel-account-context-CvIDAtHS.js +0 -550
  533. package/dist/channel-account-context-q-o0pG1A.js +0 -550
  534. package/dist/channel-activity-BaCNOZpP.js +0 -94
  535. package/dist/channel-activity-C-G4n9BK.js +0 -292
  536. package/dist/channel-activity-DTKGf3j5.js +0 -94
  537. package/dist/channel-options-Cyappik_.js +0 -32
  538. package/dist/channel-options-DFnypY5S.js +0 -33
  539. package/dist/channel-selection-BGl53D5K.js +0 -51
  540. package/dist/channel-selection-NNPbxnyZ.js +0 -51
  541. package/dist/channel-web-DmhVkWbP.js +0 -2134
  542. package/dist/channel-web-kRC3UYBJ.js +0 -2136
  543. package/dist/channels-cli-C5XRkPJl.js +0 -1421
  544. package/dist/channels-cli-D6TqCI0m.js +0 -1426
  545. package/dist/channels-status-issues-CUc9mpeW.js +0 -18
  546. package/dist/channels-status-issues-DwRDzwrV.js +0 -18
  547. package/dist/chat-envelope-DEZ-5RY8.js +0 -248
  548. package/dist/chat-envelope-el7Uo-Fe.js +0 -248
  549. package/dist/chrome-0QaGKb3L.js +0 -1732
  550. package/dist/chrome-CFeWdP0Y.js +0 -1733
  551. package/dist/chunk-CSQfUhgF.js +0 -341
  552. package/dist/chunk-D0Y_w4oX.js +0 -341
  553. package/dist/clack-prompter-B7tOxhJd.js +0 -122
  554. package/dist/clack-prompter-CCFnKP_1.js +0 -121
  555. package/dist/cleanup-utils-CqAVZz2b.js +0 -94
  556. package/dist/cli-BR2J3c4l.js +0 -125
  557. package/dist/cli-C1q1vSmN.js +0 -130
  558. package/dist/clipboard-D7_SKHPK.js +0 -31
  559. package/dist/clipboard-Dzkx6Q2K.js +0 -31
  560. package/dist/command-format-CVfo8I5f.js +0 -18
  561. package/dist/command-format-DgXcqxBt.js +0 -32
  562. package/dist/command-registry-CYjvOp8W.js +0 -215
  563. package/dist/commands-CDonBOrw.js +0 -41
  564. package/dist/commands-D_-bgTlO.js +0 -41
  565. package/dist/commands-registry-CWJv6xe2.js +0 -892
  566. package/dist/commands-registry-Ci8_cFk9.js +0 -893
  567. package/dist/common-CMI-qsF8.js +0 -156
  568. package/dist/common-DSVmydhm.js +0 -156
  569. package/dist/completion-cli-8iZJqfmX.js +0 -452
  570. package/dist/completion-cli-CYDjEZSt.js +0 -452
  571. package/dist/config-D5XU45KD.js +0 -6953
  572. package/dist/config-FHu9Bn4R.js +0 -6951
  573. package/dist/config-cli-Gehy4sav.js +0 -241
  574. package/dist/config-cli-RC9qMgJq.js +0 -246
  575. package/dist/config-guard-J-Q_DFWk.js +0 -97
  576. package/dist/config-guard-cB5a_ANg.js +0 -75
  577. package/dist/config-validation-BPNyd9_3.js +0 -18
  578. package/dist/config-validation-BPWuvhVe.js +0 -18
  579. package/dist/configure-CC2XdRRm.js +0 -891
  580. package/dist/configure-DxFBJuhZ.js +0 -889
  581. package/dist/constants-BmRFoHl0.js +0 -67
  582. package/dist/constants-C9WPAluB.js +0 -67
  583. package/dist/control-auth-D0tpV3ts.js +0 -397
  584. package/dist/control-auth-_-0PGRUs.js +0 -397
  585. package/dist/control-ui/assets/index-B4ZM1lW1.js +0 -7738
  586. package/dist/control-ui/assets/index-B4ZM1lW1.js.map +0 -1
  587. package/dist/control-ui/assets/index-PED72sKF.css +0 -1
  588. package/dist/control-ui-assets-Cx_mw4D0.js +0 -186
  589. package/dist/control-ui-assets-W1AUuGrO.js +0 -186
  590. package/dist/conversation-label-C4SDz4sT.js +0 -36
  591. package/dist/conversation-label-D1frnvYe.js +0 -36
  592. package/dist/cron-cli-BzERxhr5.js +0 -495
  593. package/dist/cron-cli-C8j_uslU.js +0 -490
  594. package/dist/daemon-cli-C95XNbX0.js +0 -1199
  595. package/dist/daemon-cli-e6sURMqd.js +0 -1197
  596. package/dist/daemon-install-CcohRvKV.js +0 -55
  597. package/dist/daemon-install-DDshfT0J.js +0 -60
  598. package/dist/daemon-install-helpers-CFGAfRlj.js +0 -462
  599. package/dist/daemon-install-helpers-DIUzSFG1.js +0 -462
  600. package/dist/defaults-B5KStIBg.js +0 -7
  601. package/dist/defaults-xUAL2Z-F.js +0 -7
  602. package/dist/deliver-912khjLK.js +0 -481
  603. package/dist/deliver-D56J4-1F.js +0 -481
  604. package/dist/delivery-queue-Cfa9Wmxp.js +0 -244
  605. package/dist/delivery-queue-CxVRi4tw.js +0 -244
  606. package/dist/devices-cli-0qDhTgZR.js +0 -316
  607. package/dist/devices-cli-6SKMR2bV.js +0 -321
  608. package/dist/diagnostics-99iCgBUh.js +0 -46
  609. package/dist/diagnostics-VC0cz7kX.js +0 -46
  610. package/dist/directory-cli-5YXdoVdn.js +0 -217
  611. package/dist/directory-cli-D3IKCHmn.js +0 -222
  612. package/dist/dm-policy-shared-4rkjhcrM.js +0 -22
  613. package/dist/dm-policy-shared-D8lgnmrC.js +0 -22
  614. package/dist/dns-cli-11CtErVU.js +0 -197
  615. package/dist/dns-cli-SiEd_1Lq.js +0 -202
  616. package/dist/dock-BqNINg7k.js +0 -928
  617. package/dist/dock-CQuu41bw.js +0 -929
  618. package/dist/doctor-completion-BR1SlAT3.js +0 -92
  619. package/dist/doctor-completion-CZwpEhIK.js +0 -92
  620. package/dist/doctor-config-flow-BVkHcvoj.js +0 -1933
  621. package/dist/doctor-config-flow-DVYRn0An.js +0 -1934
  622. package/dist/enable-DcJnkzfz.js +0 -59
  623. package/dist/enable-ibNq4UWy.js +0 -59
  624. package/dist/env-DeF64iu0.js +0 -60
  625. package/dist/env-vars-7aZqKPhk.js +0 -93
  626. package/dist/errors-8F-77i6m.js +0 -35
  627. package/dist/errors-DZ199hOo.js +0 -35
  628. package/dist/exec-DbKuYyM1.js +0 -164
  629. package/dist/exec-DkFE7lqU.js +0 -164
  630. package/dist/fetch-BFSBLBkA.js +0 -67
  631. package/dist/fetch-C6XKGA11.js +0 -67
  632. package/dist/fetch-CEDsOiql.js +0 -67
  633. package/dist/file-lock-CIvloidc.js +0 -107
  634. package/dist/file-lock-CzBL_VIx.js +0 -107
  635. package/dist/fs-safe-DSwT85uK.js +0 -88
  636. package/dist/fs-safe-DkBhNAc3.js +0 -98
  637. package/dist/gateway-cli-BEEZhCHv.js +0 -23747
  638. package/dist/gateway-cli-Nob0g_4y.js +0 -23742
  639. package/dist/gateway-rpc-CksB-N83.js +0 -28
  640. package/dist/gateway-rpc-Dq44SkOv.js +0 -28
  641. package/dist/gmail-setup-utils-Cnx8A5pW.js +0 -422
  642. package/dist/gmail-setup-utils-nkabbKOE.js +0 -423
  643. package/dist/health-RT-F3hzT.js +0 -1423
  644. package/dist/health-SOuaKNRa.js +0 -1420
  645. package/dist/health-format-BG95OE6N.js +0 -28
  646. package/dist/heartbeat-visibility-BxkZjE5m.js +0 -125
  647. package/dist/heartbeat-visibility-CGG-G7px.js +0 -125
  648. package/dist/help-format-DAxf0l_h.js +0 -17
  649. package/dist/helpers-kkeXif0Q.js +0 -10
  650. package/dist/hook-runner-global-DJ14gXFP.js +0 -527
  651. package/dist/hooks-cli-DyEKryW8.js +0 -1217
  652. package/dist/hooks-cli-RuEn0-oy.js +0 -1222
  653. package/dist/image-ops-Bi6JPSkD.js +0 -354
  654. package/dist/image-ops-DWytvdh_.js +0 -354
  655. package/dist/import-D8BBZQgl.js +0 -170
  656. package/dist/import-DQ6NI4Fz.js +0 -168
  657. package/dist/inbound-context-CPkkQW0i.js +0 -68
  658. package/dist/inbound-context-DS_kpIYI.js +0 -68
  659. package/dist/inbound-path-policy-Bg4gZBx-.js +0 -250
  660. package/dist/inbound-path-policy-sdr5Ji0k.js +0 -250
  661. package/dist/inspect-Dt8hogS3.js +0 -559
  662. package/dist/inspect-vYIL1oA0.js +0 -559
  663. package/dist/installs-aM5dWAyn.js +0 -325
  664. package/dist/installs-pWdqG8HL.js +0 -325
  665. package/dist/ipv4--2WXMVtE.js +0 -46
  666. package/dist/ipv4-CDQpx1A7.js +0 -46
  667. package/dist/ir-BpaAMTfW.js +0 -940
  668. package/dist/json-files-DzpTak5i.js +0 -46
  669. package/dist/links-C3soDNDH.js +0 -15
  670. package/dist/loader-Ccwsh8Sh.js +0 -22624
  671. package/dist/loader-y9MhJewT.js +0 -22621
  672. package/dist/local-roots-BrH0Q63K.js +0 -313
  673. package/dist/local-roots-nImrw2WR.js +0 -314
  674. package/dist/logger-Bw3cFE5t.js +0 -49
  675. package/dist/logging-C-nxX2fn.js +0 -20
  676. package/dist/login-C_Kt57nO.js +0 -62
  677. package/dist/login-DOmWDMeP.js +0 -61
  678. package/dist/login-qr-CXU0wC5K.js +0 -322
  679. package/dist/login-qr-D0u6fdeO.js +0 -327
  680. package/dist/logs-cli-CschwP4d.js +0 -238
  681. package/dist/logs-cli-D7ayUvz_.js +0 -233
  682. package/dist/markdown-tables-CrmghPAr.js +0 -29
  683. package/dist/markdown-tables-jrnSPvZ6.js +0 -29
  684. package/dist/media-CojxZ45J.js +0 -10492
  685. package/dist/media-DN7yRfrH.js +0 -940
  686. package/dist/message-action-names-CtEZcmlU.js +0 -2521
  687. package/dist/message-action-names-WglOO_DT.js +0 -2521
  688. package/dist/message-channel-DzJqHVZD.js +0 -91
  689. package/dist/net-Cg8AQeke.js +0 -225
  690. package/dist/net-D6D0wgcF.js +0 -225
  691. package/dist/node-cli-Q2-n3Fgv.js +0 -24
  692. package/dist/nodes-cli-C2SoKfCv.js +0 -1343
  693. package/dist/nodes-cli-CQmlfx0K.js +0 -1348
  694. package/dist/nodes-screen-BR9sYoPa.js +0 -250
  695. package/dist/nodes-screen-Cw7Hv7M2.js +0 -250
  696. package/dist/note-Dlv4NmlQ.js +0 -92
  697. package/dist/note-kvWV4xtw.js +0 -92
  698. package/dist/npm-registry-spec-0qiKawvv.js +0 -786
  699. package/dist/npm-registry-spec-COvUzy5J.js +0 -786
  700. package/dist/npm-resolution-6v_Zm-9G.js +0 -86
  701. package/dist/npm-resolution-BFz7LeoN.js +0 -86
  702. package/dist/onboard-CgyU-mDL.js +0 -407
  703. package/dist/onboard-RI4vNTZd.js +0 -405
  704. package/dist/onboard-channels-DN5JoKPd.js +0 -2548
  705. package/dist/onboard-channels-DyAd1OZr.js +0 -2547
  706. package/dist/onboard-config-BCTthQ7J.js +0 -24
  707. package/dist/onboard-config-y-2cgT0V.js +0 -24
  708. package/dist/onboard-helpers-BCzZUD0z.js +0 -363
  709. package/dist/onboard-helpers-sDc2Ky6H.js +0 -362
  710. package/dist/onboard-remote-CJrMtttl.js +0 -127
  711. package/dist/onboard-remote-hyQIBguz.js +0 -127
  712. package/dist/onboarding-DCu1iBTV.js +0 -541
  713. package/dist/onboarding-zKMitzpb.js +0 -543
  714. package/dist/onboarding.finalize-ClHhYE2E.js +0 -401
  715. package/dist/onboarding.finalize-D5JkVJgg.js +0 -398
  716. package/dist/onboarding.gateway-config-DFh71Ndn.js +0 -198
  717. package/dist/onboarding.gateway-config-VBk6AP9U.js +0 -191
  718. package/dist/outbound-BYlZshIw.js +0 -221
  719. package/dist/outbound-CFfJC1j5.js +0 -220
  720. package/dist/outbound-attachment-BCNs1u1F.js +0 -18
  721. package/dist/outbound-attachment-B_0D60Yr.js +0 -18
  722. package/dist/outbound-attachment-o0seS0CP.js +0 -18
  723. package/dist/pairing-cli-BeydfoF9.js +0 -122
  724. package/dist/pairing-cli-DWzX866x.js +0 -127
  725. package/dist/pairing-labels-B-N8S5Fc.js +0 -9
  726. package/dist/pairing-labels-B_53dY5L.js +0 -9
  727. package/dist/pairing-store-BxdqFZGK.js +0 -460
  728. package/dist/pairing-store-CTkD51uW.js +0 -459
  729. package/dist/path-env-DR5vn3QL.js +0 -89
  730. package/dist/path-env-qRJbjJzj.js +0 -89
  731. package/dist/path-safety-DkT9RmTG.js +0 -14
  732. package/dist/path-safety-juI2XbO1.js +0 -14
  733. package/dist/plugin-auto-enable-D23gv7Aw.js +0 -302
  734. package/dist/plugin-auto-enable-DuPS9XiJ.js +0 -301
  735. package/dist/plugin-registry-CNu_1KZz.js +0 -33
  736. package/dist/plugin-registry-DeHwd2jk.js +0 -33
  737. package/dist/plugin-sdk/agents/agent-helpers/thinking.d.ts +0 -5
  738. package/dist/plugin-sdk/agents/auth-profiles/constants.d.ts +0 -16
  739. package/dist/plugin-sdk/agents/auth-profiles/display.d.ts +0 -7
  740. package/dist/plugin-sdk/agents/auth-profiles/doctor.d.ts +0 -8
  741. package/dist/plugin-sdk/agents/auth-profiles/oauth.d.ts +0 -14
  742. package/dist/plugin-sdk/agents/auth-profiles/session-override.d.ts +0 -18
  743. package/dist/plugin-sdk/agents/auth-profiles.d.ts +0 -8
  744. package/dist/plugin-sdk/agents/defaults.d.ts +0 -3
  745. package/dist/plugin-sdk/agents/provider-auth.d.ts +0 -40
  746. package/dist/plugin-sdk/auto-reply/model-runtime.d.ts +0 -17
  747. package/dist/plugin-sdk/config/model-input.d.ts +0 -9
  748. package/dist/plugin-sdk/config/zod-schema.agent-model.d.ts +0 -5
  749. package/dist/plugin-sdk/sessions/model-overrides.d.ts +0 -14
  750. package/dist/plugin-sdk/telegram/reasoning-lane-coordinator.d.ts +0 -18
  751. package/dist/plugins-BflZz0sp.js +0 -453
  752. package/dist/plugins-cli-DV82scUw.js +0 -798
  753. package/dist/plugins-cli-Qj1UyIZO.js +0 -793
  754. package/dist/plugins-woGRXMzU.js +0 -455
  755. package/dist/ports-DrruB2fK.js +0 -370
  756. package/dist/ports-GT1yV-Tg.js +0 -96
  757. package/dist/ports-NPqtlfp0.js +0 -316
  758. package/dist/ports-QMI4-F9m.js +0 -96
  759. package/dist/program-CQmIaRUI.js +0 -244
  760. package/dist/program-context-DEU6ACnL.js +0 -474
  761. package/dist/progress-CBkSaM6z.js +0 -124
  762. package/dist/prompt-Bllj1dhc.js +0 -21
  763. package/dist/prompt-select-styled-BhTN6zE2.js +0 -1650
  764. package/dist/prompt-select-styled-WopXnjIy.js +0 -1647
  765. package/dist/prompt-style-DVEm3BZW.js +0 -9
  766. package/dist/provider-dispatcher-B4QMe-I6.js +0 -659
  767. package/dist/provider-dispatcher-Bfauw6zz.js +0 -660
  768. package/dist/push-apns-C0LyG-WB.js +0 -713
  769. package/dist/push-apns-DuG95AKC.js +0 -711
  770. package/dist/pw-ai-D9n6-Wa6.js +0 -1906
  771. package/dist/pw-ai-T280E6Mn.js +0 -1910
  772. package/dist/qr-cli-DVECWTHN.js +0 -352
  773. package/dist/qr-cli-hSLixZCe.js +0 -347
  774. package/dist/redact-eZq1uwNK.js +0 -191
  775. package/dist/redact-snapshot-BZYLIqe-.js +0 -2028
  776. package/dist/redact-snapshot-C6hVx_9I.js +0 -2028
  777. package/dist/register.agent-Dmj-sgEl.js +0 -1043
  778. package/dist/register.agent-IspcBFeD.js +0 -286
  779. package/dist/register.configure-BqJEqyGL.js +0 -130
  780. package/dist/register.configure-PPkU_4Ea.js +0 -124
  781. package/dist/register.import-Bs-UkOs-.js +0 -27
  782. package/dist/register.import-DLng8g-e.js +0 -30
  783. package/dist/register.maintenance-BbpkJil3.js +0 -497
  784. package/dist/register.maintenance-C5nkOQxa.js +0 -494
  785. package/dist/register.message-C83Hi1b3.js +0 -681
  786. package/dist/register.message-D16isu4u.js +0 -686
  787. package/dist/register.onboard-B8EzX3wY.js +0 -257
  788. package/dist/register.onboard-CyRbr_0V.js +0 -262
  789. package/dist/register.setup-DWyoowAz.js +0 -109
  790. package/dist/register.setup-Dz6GwMnu.js +0 -114
  791. package/dist/register.status-health-sessions-CbQOfycz.js +0 -423
  792. package/dist/register.status-health-sessions-DXIWG47y.js +0 -669
  793. package/dist/register.subclis-DeGP5UPU.js +0 -267
  794. package/dist/replies-BKrzM0QI.js +0 -136
  795. package/dist/replies-Cl2gYBVt.js +0 -136
  796. package/dist/reply-CCu_DY64.js +0 -13900
  797. package/dist/reply-DSKC8kyS.js +0 -13897
  798. package/dist/reply-directives-BHJKp1Du.js +0 -182
  799. package/dist/reply-directives-CD2WycBM.js +0 -182
  800. package/dist/reply-payloads-D_BM1Anb.js +0 -527
  801. package/dist/reply-prefix-DBLCYiup.js +0 -38
  802. package/dist/reply-prefix-Q4DOJSn_.js +0 -38
  803. package/dist/resolve-route-CBVbY0xS.js +0 -249
  804. package/dist/resolve-route-DGEgTEif.js +0 -249
  805. package/dist/response-prefix-template-rVZQOViK.js +0 -136
  806. package/dist/response-prefix-template-up4REfuR.js +0 -136
  807. package/dist/retry-BhuXOEVR.js +0 -77
  808. package/dist/retry-DUjAzOBy.js +0 -77
  809. package/dist/run-main-Um5xhxla.js +0 -320
  810. package/dist/runner-yVJ4HB2K.js +0 -2294
  811. package/dist/runner-z92MWZ3m.js +0 -2294
  812. package/dist/runtime-guard-DZ_xuCc4.js +0 -60
  813. package/dist/secure-random-Pl9rPl0l.js +0 -44
  814. package/dist/security-cli-CdwbWZUj.js +0 -484
  815. package/dist/security-cli-DP5QJpa5.js +0 -478
  816. package/dist/send-B1_Ymjb9.js +0 -1778
  817. package/dist/send-B84axiIa.js +0 -29
  818. package/dist/send-BN_zYVlx.js +0 -547
  819. package/dist/send-BqVOxAmK.js +0 -1174
  820. package/dist/send-Bx9bUGav.js +0 -492
  821. package/dist/send-C3pdJ6p-.js +0 -2245
  822. package/dist/send-CBGSXjfD.js +0 -2245
  823. package/dist/send-CGXyTF22.js +0 -426
  824. package/dist/send-CKavrhXj.js +0 -11
  825. package/dist/send-D08Je6DL.js +0 -374
  826. package/dist/send-D1aYEG-k.js +0 -332
  827. package/dist/send-DHldI3gf.js +0 -492
  828. package/dist/send-D_DUQJ6H.js +0 -349
  829. package/dist/send-Ds63eF4a.js +0 -349
  830. package/dist/send-YRVDWfSs.js +0 -547
  831. package/dist/send-xnwty9cY.js +0 -1775
  832. package/dist/server-BQFoyCRR.js +0 -200
  833. package/dist/server-DhXw25Jq.js +0 -205
  834. package/dist/server-lifecycle-BjCCyD3w.js +0 -2437
  835. package/dist/server-lifecycle-Coyr6Lda.js +0 -2437
  836. package/dist/server-node-events-De4WZQQD.js +0 -393
  837. package/dist/server-node-events-dXXayuqY.js +0 -398
  838. package/dist/service-Bjqii5nW.js +0 -670
  839. package/dist/service-fp29z5Ww.js +0 -670
  840. package/dist/session-DBL5nHDy.js +0 -170
  841. package/dist/session-cost-usage-DX09eTPU.js +0 -627
  842. package/dist/session-cost-usage-yYi525j3.js +0 -627
  843. package/dist/session-dirs-Cj5xi7zX.js +0 -947
  844. package/dist/session-dirs-DdF6TDsE.js +0 -947
  845. package/dist/session-utils-CEtEq6bi.js +0 -625
  846. package/dist/session-utils-WmlWAs1r.js +0 -625
  847. package/dist/session-xKIW6gL2.js +0 -170
  848. package/dist/sessions--PykPynp.js +0 -2593
  849. package/dist/sessions-Bw4LRnSr.js +0 -252
  850. package/dist/ssrf-Ck9HDZpv.js +0 -183
  851. package/dist/ssrf-m7kFIobZ.js +0 -183
  852. package/dist/status-CtzYFLLF.js +0 -2072
  853. package/dist/status-DiN1cq2p.js +0 -2068
  854. package/dist/status.update-C55QM2xs.js +0 -79
  855. package/dist/status.update-CBmPXwYN.js +0 -79
  856. package/dist/store-C3tOpizT.js +0 -64
  857. package/dist/store-CPJXuhvQ.js +0 -53
  858. package/dist/store-SusmIfz7.js +0 -2595
  859. package/dist/store-v3P-OWhi.js +0 -64
  860. package/dist/subagent-registry-Db4Ho_2Y.js +0 -4858
  861. package/dist/subagent-registry-Du_j0Fnt.js +0 -4860
  862. package/dist/subsystem-BUXAJwPD.js +0 -1079
  863. package/dist/subsystem-COd61u0P.js +0 -1139
  864. package/dist/system-cli-DYCpLO3T.js +0 -75
  865. package/dist/system-cli-eAk5wVbP.js +0 -70
  866. package/dist/systemd-DSnlM3jX.js +0 -547
  867. package/dist/systemd-TfK8GuTx.js +0 -547
  868. package/dist/systemd-linger-Axnc1xCb.js +0 -75
  869. package/dist/systemd-linger-_0_-RY4v.js +0 -75
  870. package/dist/table-DPTzZyhu.js +0 -279
  871. package/dist/tables-DI5LGEr1.js +0 -55
  872. package/dist/tables-PxcSPSO0.js +0 -55
  873. package/dist/tables-TWiml6b1.js +0 -55
  874. package/dist/tailnet-CEudzG0i.js +0 -40
  875. package/dist/tailnet-PnMrjwGT.js +0 -40
  876. package/dist/tailscale-DTATQxAG.js +0 -230
  877. package/dist/tailscale-Dbyahx0J.js +0 -230
  878. package/dist/targets-C1NeMn2J.js +0 -220
  879. package/dist/targets-CcTME3bp.js +0 -46
  880. package/dist/targets-CmC5m7Ey.js +0 -53
  881. package/dist/targets-D-u6Kyio.js +0 -650
  882. package/dist/targets-D7OKVXMI.js +0 -650
  883. package/dist/targets-DB4vBpIQ.js +0 -2172
  884. package/dist/targets-DfqPGOmM.js +0 -2173
  885. package/dist/targets-DyybKefq.js +0 -53
  886. package/dist/tokens-DzFOtLlW.js +0 -21
  887. package/dist/tool-display-Br6mwaJc.js +0 -785
  888. package/dist/tool-display-sgNwLOBj.js +0 -785
  889. package/dist/tool-images-BNfIJ_Kj.js +0 -263
  890. package/dist/tool-images-kloBqxqK.js +0 -263
  891. package/dist/trash-DPi0aCCQ.js +0 -125
  892. package/dist/trash-D_Jd_yQZ.js +0 -125
  893. package/dist/tui-CHc0EfJO.js +0 -3392
  894. package/dist/tui-CyHwc2uX.js +0 -3392
  895. package/dist/tui-cli-BvwbrIYO.js +0 -63
  896. package/dist/tui-cli-C9I18SfW.js +0 -58
  897. package/dist/update-DxyjwCL2.js +0 -349
  898. package/dist/update-IX7vdqA8.js +0 -349
  899. package/dist/update-cli-CBeXUSzq.js +0 -1373
  900. package/dist/update-cli-DkAWmUrp.js +0 -1370
  901. package/dist/usage-CYlQW4M2.js +0 -5279
  902. package/dist/utils-LBKvDoPx.js +0 -631
  903. package/dist/web-BUYUdnRH.js +0 -3065
  904. package/dist/web-Dquzwqf4.js +0 -70
  905. package/dist/web-tS8diboh.js +0 -76
  906. package/dist/webhooks-cli-B7Vw3CMz.js +0 -333
  907. package/dist/webhooks-cli-BpZHQlVd.js +0 -328
  908. package/dist/whatsapp-actions-D5HXezjp.js +0 -128
  909. package/dist/whatsapp-actions-DaA291Ya.js +0 -122
  910. package/dist/widearea-dns-DSoaA-eH.js +0 -127
  911. package/dist/workspace-B4ZvVYT9.js +0 -447
  912. package/dist/workspace-B8PA8oxJ.js +0 -449
  913. /package/dist/{account-lookup-0KDSp5Mj.js → account-lookup-BOCzCnir.js} +0 -0
  914. /package/dist/{account-lookup-zvANGr2x.js → account-lookup-DGscKBsr.js} +0 -0
  915. /package/dist/{ansi-D04X81yq.js → ansi-aRwLYlzD.js} +0 -0
  916. /package/dist/{api-BeQMq2iS.js → api-BDff51CS.js} +0 -0
  917. /package/dist/{api-CxX8-gGz.js → api-qWSMsT8m.js} +0 -0
  918. /package/dist/{argv-Co-b9Zsc.js → argv-neJY_Hxm.js} +0 -0
  919. /package/dist/{brew-C4zKZsHX.js → brew-ByYl36Mt.js} +0 -0
  920. /package/dist/{brew-DbSbN8sD.js → brew-CMSQ5Fek.js} +0 -0
  921. /package/dist/{chat-type-CYPyHAj-.js → chat-type-BKe459rw.js} +0 -0
  922. /package/dist/{chat-type-DKb2TlGZ.js → chat-type-DyovJwCt.js} +0 -0
  923. /package/dist/{cleanup-utils-CwQvD73q.js → cleanup-utils-S_P5Jebv.js} +0 -0
  924. /package/dist/{cli-name-BicfmwQX.js → cli-name-CRLBidNP.js} +0 -0
  925. /package/dist/{cli-name-C6rJGl18.js → cli-name-Yv30OygA.js} +0 -0
  926. /package/dist/{cli-utils-BhXbz2UF.js → cli-utils-C5nQDfa6.js} +0 -0
  927. /package/dist/{cli-utils-DZe_rVkZ.js → cli-utils-KcEwAsuZ.js} +0 -0
  928. /package/dist/{client-C61M8zI3.js → client-C7B0uFB0.js} +0 -0
  929. /package/dist/{client-DdpmATKq.js → client-Cd2HNUX0.js} +0 -0
  930. /package/dist/{command-options-C4paWSGf.js → command-options-1bi44p_B.js} +0 -0
  931. /package/dist/{command-options-CA30lfLK.js → command-options-7y5Zrv4M.js} +0 -0
  932. /package/dist/{config-eval-CjGZtLwx.js → config-eval-CJtk3Msr.js} +0 -0
  933. /package/dist/{config-eval-H_wlEYIG.js → config-eval-DQIwdWg7.js} +0 -0
  934. /package/dist/{constants-ChptG3d7.js → constants--3PuQVaS.js} +0 -0
  935. /package/dist/{constants-DY6b-_Wl.js → constants-DNWjlxZ5.js} +0 -0
  936. /package/dist/{credentials-BHWUBHMd.js → credentials-BhnauW0K.js} +0 -0
  937. /package/dist/{credentials-DFsi1_e8.js → credentials-eZcqWNG_.js} +0 -0
  938. /package/dist/{daemon-runtime-CMnbwryP.js → daemon-runtime-99xh1fGv.js} +0 -0
  939. /package/dist/{daemon-runtime-CvqE4ysg.js → daemon-runtime-BOcdJaFy.js} +0 -0
  940. /package/dist/{dangerous-name-matching-BzmiLXmA.js → dangerous-name-matching-YeatnYIA.js} +0 -0
  941. /package/dist/{dangerous-name-matching-DaVRgwer.js → dangerous-name-matching-oVb1EqYT.js} +0 -0
  942. /package/dist/{dangerous-tools-BOLoCRv4.js → dangerous-tools-BMt8-6jE.js} +0 -0
  943. /package/dist/{dangerous-tools-Baq7Q-i6.js → dangerous-tools-CripTfYv.js} +0 -0
  944. /package/dist/{fetch-timeout-DTIN7CGM.js → fetch-timeout-Db3da8yR.js} +0 -0
  945. /package/dist/{fetch-timeout-DoySHqfO.js → fetch-timeout-l_6RdoMw.js} +0 -0
  946. /package/dist/{file-identity-BxlKD8Ys.js → file-identity-Bs9zZOi2.js} +0 -0
  947. /package/dist/{format-duration-CqUERz51.js → format-duration-Bo-Mxi3E.js} +0 -0
  948. /package/dist/{format-duration-Ct-yiwkS.js → format-duration-CfrJ5T8k.js} +0 -0
  949. /package/dist/{format-relative-79_Y1n2Y.js → format-relative-8cNYQsqb.js} +0 -0
  950. /package/dist/{format-relative-CxLpEQOX.js → format-relative-CZOlQ2pA.js} +0 -0
  951. /package/dist/{health-format-B_QRD8Si.js → health-format-WMRp1BbP.js} +0 -0
  952. /package/dist/{heartbeat-wake-LGEgcXjs.js → heartbeat-wake-BtRrOB-t.js} +0 -0
  953. /package/dist/{heartbeat-wake-Y97geucO.js → heartbeat-wake-eRINROYK.js} +0 -0
  954. /package/dist/{help-format-NNm_Ov4H.js → help-format-BEb0SPHF.js} +0 -0
  955. /package/dist/{helpers-BAsMXprO.js → helpers-BJtPtu_2.js} +0 -0
  956. /package/dist/{helpers-DLgbkcEn.js → helpers-Cj6f8SPZ.js} +0 -0
  957. /package/dist/{helpers-R7bU5IBz.js → helpers-ryxLx-aM.js} +0 -0
  958. /package/dist/{host-env-security-szwfmhC4.js → host-env-security-CbiODGvQ.js} +0 -0
  959. /package/dist/{input-provenance-Bn6thJNm.js → input-provenance-CPhdY-0F.js} +0 -0
  960. /package/dist/{input-provenance-xUsSMOsz.js → input-provenance-DUNEQoFM.js} +0 -0
  961. /package/dist/{ip-C9q3Oq20.js → ip-BAhS4rY2.js} +0 -0
  962. /package/dist/{ip-D0zgNmBV.js → ip-BcdPcLiP.js} +0 -0
  963. /package/dist/{is-main-DN8-sNR5.js → is-main-KcWqINzy.js} +0 -0
  964. /package/dist/{json-file-ChO_R9yh.js → json-file-BVvmrQG3.js} +0 -0
  965. /package/dist/{json-file-B7l5-Xhr.js → json-file-Dbg7nZg1.js} +0 -0
  966. /package/dist/{json-files-CmpYSF4G.js → json-files-DSKEdz7x.js} +0 -0
  967. /package/dist/{lanes-ByWMUgrz.js → lanes-Brd-nf-Z.js} +0 -0
  968. /package/dist/{lanes-cHJ5arWg.js → lanes-COs3zODW.js} +0 -0
  969. /package/dist/{links-Bz4V7R_p.js → links-gse8sWn-.js} +0 -0
  970. /package/dist/{location-DBWCGNLq.js → location-D1FM_C63.js} +0 -0
  971. /package/dist/{location-GbZ0bBRU.js → location-LuzkqHGi.js} +0 -0
  972. /package/dist/{logger-DyL5G2DO.js → logger-BMP_j_Lx.js} +0 -0
  973. /package/dist/{logger-BWMPnILd.js → logger-DWbwXLjl.js} +0 -0
  974. /package/dist/{logger-GvipVDfh.js → logger-DXCDb7qu.js} +0 -0
  975. /package/dist/{logging-D8-Kozjc.js → logging-CAgCb3n3.js} +0 -0
  976. /package/dist/{message-channel-uWMAiywE.js → message-channel-D72Bc6Tb.js} +0 -0
  977. /package/dist/{mime-BS3jhcZE.js → mime-Cqg1jjia.js} +0 -0
  978. /package/dist/{mime-Cxh_64P6.js → mime-D4bQLMJL.js} +0 -0
  979. /package/dist/{mutable-allowlist-detectors-DiZDtmlZ.js → mutable-allowlist-detectors-NtI6s4TE.js} +0 -0
  980. /package/dist/{mutable-allowlist-detectors-U5ThQr9V.js → mutable-allowlist-detectors-nAmo9v5u.js} +0 -0
  981. /package/dist/{node-cli-Uf6lAntf.js → node-cli-bNJbha3z.js} +0 -0
  982. /package/dist/{parse-log-line-enq8pduH.js → parse-log-line-BY9Vz72K.js} +0 -0
  983. /package/dist/{parse-log-line-mz9TG6ig.js → parse-log-line-BrrE4onI.js} +0 -0
  984. /package/dist/{parse-timeout-BMP8a0_a.js → parse-timeout-Dfyln-4M.js} +0 -0
  985. /package/dist/{path-guards-CIx4hURU.js → path-guards-D9LU0y9L.js} +0 -0
  986. /package/dist/{path-guards-CrQOUlsq.js → path-guards-crZaTVvq.js} +0 -0
  987. /package/dist/plugin-sdk/{agents → auth}/api-key-rotation.d.ts +0 -0
  988. /package/dist/plugin-sdk/{agents/auth-profiles → auth}/paths.d.ts +0 -0
  989. /package/dist/plugin-sdk/{agents/auth-profiles → auth}/profiles.d.ts +0 -0
  990. /package/dist/plugin-sdk/{agents/auth-profiles → auth}/store.d.ts +0 -0
  991. /package/dist/plugin-sdk/{agents/auth-profiles → auth}/types.d.ts +0 -0
  992. /package/dist/{plugins-allowlist-BbTQ5Z2k.js → plugins-allowlist-CD4oIJNk.js} +0 -0
  993. /package/dist/{plugins-allowlist-C20oaESO.js → plugins-allowlist-CUhk3GDh.js} +0 -0
  994. /package/dist/{polls-B0CCBDeR.js → polls-ChvH1OIW.js} +0 -0
  995. /package/dist/{polls-CwwHzYBM.js → polls-Dn1C2d1-.js} +0 -0
  996. /package/dist/{ports-lsof-Wteul3ju.js → ports-lsof-BDQWExpn.js} +0 -0
  997. /package/dist/{process-scoped-map-CV9kDvfG.js → process-scoped-map-BwUkYFQV.js} +0 -0
  998. /package/dist/{process-scoped-map-PEvnG75N.js → process-scoped-map-CBWcUvTa.js} +0 -0
  999. /package/dist/{program-context-jqeI5alP.js → program-context-DtsEOsdM.js} +0 -0
  1000. /package/dist/{progress-C1kUfYL-.js → progress-BjGCAXH7.js} +0 -0
  1001. /package/dist/{prompt-Yn2yClg1.js → prompt-FIISMuNm.js} +0 -0
  1002. /package/dist/{prompt-style-DjEYC_s-.js → prompt-style-DL64_X-p.js} +0 -0
  1003. /package/dist/{provider-utils-3JTMJroG.js → provider-utils-DiLhkKQp.js} +0 -0
  1004. /package/dist/{proxy-DL3MD6-P.js → proxy-DUTF0OYE.js} +0 -0
  1005. /package/dist/{proxy-DpNv2cSV.js → proxy-Dv0sbx6A.js} +0 -0
  1006. /package/dist/{pw-ai-state-CGfLv6nV.js → pw-ai-state-DKhOTqDv.js} +0 -0
  1007. /package/dist/{pw-ai-state-Dynx20hr.js → pw-ai-state-kkp06zyZ.js} +0 -0
  1008. /package/dist/{redact-Dx1Fue21.js → redact-BTeK8lMZ.js} +0 -0
  1009. /package/dist/{redact-identifier-BTIWtaa-.js → redact-identifier-F6t5pklx.js} +0 -0
  1010. /package/dist/{redact-identifier-CAagcfWA.js → redact-identifier-VdOrq-IK.js} +0 -0
  1011. /package/dist/{remoteclaw-root-C2HV2VeC.js → remoteclaw-root-DF8m3X4C.js} +0 -0
  1012. /package/dist/{remoteclaw-root-DybYl8PL.js → remoteclaw-root-rJHOCwzo.js} +0 -0
  1013. /package/dist/{render-CCLsW6Lz.js → render-e7fENCYH.js} +0 -0
  1014. /package/dist/{render-uf6PvGMV.js → render-qcqmrHse.js} +0 -0
  1015. /package/dist/{retry-DnqPAqWp.js → retry-CwZiwLDN.js} +0 -0
  1016. /package/dist/{runtime-DJNp29jv.js → runtime-Ds3E9SqF.js} +0 -0
  1017. /package/dist/{runtime-guard-U-ewY_QH.js → runtime-guard-CdJVmJc0.js} +0 -0
  1018. /package/dist/{secret-equal-BbHdTtqY.js → secret-equal-CDUVxXmp.js} +0 -0
  1019. /package/dist/{secret-equal-CXJEZiWb.js → secret-equal-d3sEnK98.js} +0 -0
  1020. /package/dist/{secure-random-CS2mSdTn.js → secure-random-CJtykx_p.js} +0 -0
  1021. /package/dist/{secure-random-_dzDDlFo.js → secure-random-y6N6Gted.js} +0 -0
  1022. /package/dist/{session-key-5YLnn_qf.js → session-key-BF-9YzxC.js} +0 -0
  1023. /package/dist/{stagger-BXv_apuy.js → stagger-B-_Wnofy.js} +0 -0
  1024. /package/dist/{stagger-MI9gd2rQ.js → stagger-CjkdqPuN.js} +0 -0
  1025. /package/dist/{status-BmtCS3T1.js → status-BFmH9Uge.js} +0 -0
  1026. /package/dist/{status-BrwHRn2B.js → status-BIupzBh9.js} +0 -0
  1027. /package/dist/{strip-inbound-meta-DjKcSFaW.js → strip-inbound-meta-BNXRYvmY.js} +0 -0
  1028. /package/dist/{strip-inbound-meta-jy3bkUab.js → strip-inbound-meta-BtNFmc6V.js} +0 -0
  1029. /package/dist/{table-C1rdyYl9.js → table-Au5EeKD6.js} +0 -0
  1030. /package/dist/{target-errors-BDpPcwh5.js → target-errors-B6YON-5k.js} +0 -0
  1031. /package/dist/{target-errors-DdIAPcMM.js → target-errors-sPHoHj73.js} +0 -0
  1032. /package/dist/{targets-D-qLBpTA.js → targets-BtGRUQMa.js} +0 -0
  1033. /package/dist/{targets-JCISV-hS.js → targets-D3WkRcT8.js} +0 -0
  1034. /package/dist/{targets-BMenhVHg.js → targets-D3r6Zgic.js} +0 -0
  1035. /package/dist/{targets-C-2xwh9f.js → targets-DDdPVd12.js} +0 -0
  1036. /package/dist/{targets-UncQvCVs.js → targets-Ds5eT_RZ.js} +0 -0
  1037. /package/dist/{targets-D7PT_rdO.js → targets-DtvPW-B8.js} +0 -0
  1038. /package/dist/{text-format-BQ3z_OXA.js → text-format-CFm4X8Ze.js} +0 -0
  1039. /package/dist/{text-format-oWqzVmah.js → text-format-KHU3KzvQ.js} +0 -0
  1040. /package/dist/{tokens-B-jmvNR9.js → tokens-BGw4xHhW.js} +0 -0
  1041. /package/dist/{usage-BdhBT0Vz.js → usage-BEjWlD9A.js} +0 -0
  1042. /package/dist/{usage-format-C3mNLfhI.js → usage-format-Cx3JveFn.js} +0 -0
  1043. /package/dist/{usage-format-DAaPzr_z.js → usage-format-D-ZaYT_e.js} +0 -0
  1044. /package/dist/{usage-BtQcAnf6.js → usage-o8O_TxA-.js} +0 -0
  1045. /package/dist/{widearea-dns-CsmBVbez.js → widearea-dns-DUDYT3z2.js} +0 -0
  1046. /package/dist/{workspace-BzPeZDew.js → workspace-9__vtmnA.js} +0 -0
  1047. /package/dist/{wsl-B_sPlzWw.js → wsl-BLrG__iS.js} +0 -0
  1048. /package/dist/{wsl-BCnYV9O0.js → wsl-C2dudsWt.js} +0 -0
@@ -0,0 +1,2547 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
+ import { $ as pathExists, D as listChatChannels, H as CONFIG_DIR, Q as normalizeE164, T as formatChannelSelectionLine, o as createSubsystemLogger, w as formatChannelPrimerLine } from "./entry.js";
3
+ import { h as normalizeAccountId, m as DEFAULT_ACCOUNT_ID } from "./session-key-BF-9YzxC.js";
4
+ import { a as resolveAgentWorkspaceDir, s as resolveDefaultAgentId } from "./agent-scope-zFv4opB7.js";
5
+ import { C as resolveDiscordAccount, S as resolveDefaultDiscordAccountId, b as listDiscordAccountIds, d as resolveTelegramAccount, h as resolveSlackAccount, l as listTelegramAccountIds, m as resolveDefaultSlackAccountId, n as listChannelPlugins, p as listSlackAccountIds, t as getChannelPlugin, u as resolveDefaultTelegramAccountId } from "./plugins-JyKGZ4vK.js";
6
+ import { a as resolveWhatsAppAuthDir, n as listWhatsAppAccountIds, r as resolveDefaultWhatsAppAccountId } from "./accounts-WYyfAiie.js";
7
+ import { n as resolveDefaultIMessageAccountId, r as resolveIMessageAccount, t as listIMessageAccountIds } from "./accounts-DAdUdbPk.js";
8
+ import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId } from "./accounts-Bpk-loA6.js";
9
+ import { t as formatCliCommand } from "./command-format-KkslAzwV.js";
10
+ import { l as normalizeDiscordSlug } from "./targets-pBytVUFu.js";
11
+ import { d as resolveDiscordChannelAllowlist, r as resolveSlackChannelAllowlist, t as loadRemoteClawPlugins } from "./loader-D9yzzfmH.js";
12
+ import { t as runCommandWithTimeout } from "./exec-ClUTXFZ9.js";
13
+ import { at as resolveSlackUserAllowlist, ot as resolveDiscordUserAllowlist } from "./reply-BaiBy5TB.js";
14
+ import { t as loginWeb } from "./login-BA-Cg_v7.js";
15
+ import { t as resolveBrewExecutable } from "./brew-ByYl36Mt.js";
16
+ import { t as formatDocsLink } from "./links-gse8sWn-.js";
17
+ import { r as listChannelPluginCatalogEntries } from "./catalog-DkHDHmE3.js";
18
+ import { t as resolveChannelDefaultAccountId } from "./helpers-B4NWktS8.js";
19
+ import { n as isChannelConfigured } from "./plugin-auto-enable-BvMj37DE.js";
20
+ import { t as enablePluginInConfig } from "./enable-B5dIjgnm.js";
21
+ import { p as extractArchive } from "./npm-registry-spec-Dma0KHft.js";
22
+ import { n as recordPluginInstall, r as installPluginFromNpmSpec, t as buildNpmResolutionInstallFields } from "./installs-Cksm6vsG.js";
23
+ import { a as normalizeIMessageHandle } from "./send-CMXAg994.js";
24
+ import { n as detectBinary } from "./onboard-helpers-C-4xNq93.js";
25
+ import { t as createPluginLoaderLogger } from "./logger-DXCDb7qu.js";
26
+ import { t as fetchTelegramChatId } from "./api-BDff51CS.js";
27
+ import os from "node:os";
28
+ import path from "node:path";
29
+ import fs, { createWriteStream } from "node:fs";
30
+ import fsp from "node:fs/promises";
31
+ import { request } from "node:https";
32
+ import { pipeline } from "node:stream/promises";
33
+
34
+ //#region src/commands/onboarding/plugin-install.ts
35
+ function hasGitWorkspace(workspaceDir) {
36
+ const candidates = /* @__PURE__ */ new Set();
37
+ candidates.add(path.join(process.cwd(), ".git"));
38
+ if (workspaceDir && workspaceDir !== process.cwd()) candidates.add(path.join(workspaceDir, ".git"));
39
+ for (const candidate of candidates) if (fs.existsSync(candidate)) return true;
40
+ return false;
41
+ }
42
+ function resolveLocalPath(entry, workspaceDir, allowLocal) {
43
+ if (!allowLocal) return null;
44
+ const raw = entry.install.localPath?.trim();
45
+ if (!raw) return null;
46
+ const candidates = /* @__PURE__ */ new Set();
47
+ candidates.add(path.resolve(process.cwd(), raw));
48
+ if (workspaceDir && workspaceDir !== process.cwd()) candidates.add(path.resolve(workspaceDir, raw));
49
+ for (const candidate of candidates) if (fs.existsSync(candidate)) return candidate;
50
+ return null;
51
+ }
52
+ function addPluginLoadPath(cfg, pluginPath) {
53
+ const existing = cfg.plugins?.load?.paths ?? [];
54
+ const merged = Array.from(new Set([...existing, pluginPath]));
55
+ return {
56
+ ...cfg,
57
+ plugins: {
58
+ ...cfg.plugins,
59
+ load: {
60
+ ...cfg.plugins?.load,
61
+ paths: merged
62
+ }
63
+ }
64
+ };
65
+ }
66
+ async function promptInstallChoice(params) {
67
+ const { entry, localPath, prompter, defaultChoice } = params;
68
+ const localOptions = localPath ? [{
69
+ value: "local",
70
+ label: "Use local plugin path",
71
+ hint: localPath
72
+ }] : [];
73
+ const options = [
74
+ {
75
+ value: "npm",
76
+ label: `Download from npm (${entry.install.npmSpec})`
77
+ },
78
+ ...localOptions,
79
+ {
80
+ value: "skip",
81
+ label: "Skip for now"
82
+ }
83
+ ];
84
+ const initialValue = defaultChoice === "local" && !localPath ? "npm" : defaultChoice;
85
+ return await prompter.select({
86
+ message: `Install ${entry.meta.label} plugin?`,
87
+ options,
88
+ initialValue
89
+ });
90
+ }
91
+ function resolveInstallDefaultChoice(params) {
92
+ const { cfg, entry, localPath } = params;
93
+ const updateChannel = cfg.update?.channel;
94
+ if (updateChannel === "dev") return localPath ? "local" : "npm";
95
+ if (updateChannel === "stable" || updateChannel === "beta") return "npm";
96
+ const entryDefault = entry.install.defaultChoice;
97
+ if (entryDefault === "local") return localPath ? "local" : "npm";
98
+ if (entryDefault === "npm") return "npm";
99
+ return localPath ? "local" : "npm";
100
+ }
101
+ async function ensureOnboardingPluginInstalled(params) {
102
+ const { entry, prompter, runtime, workspaceDir } = params;
103
+ let next = params.cfg;
104
+ const localPath = resolveLocalPath(entry, workspaceDir, hasGitWorkspace(workspaceDir));
105
+ const choice = await promptInstallChoice({
106
+ entry,
107
+ localPath,
108
+ defaultChoice: resolveInstallDefaultChoice({
109
+ cfg: next,
110
+ entry,
111
+ localPath
112
+ }),
113
+ prompter
114
+ });
115
+ if (choice === "skip") return {
116
+ cfg: next,
117
+ installed: false
118
+ };
119
+ if (choice === "local" && localPath) {
120
+ next = addPluginLoadPath(next, localPath);
121
+ next = enablePluginInConfig(next, entry.id).config;
122
+ return {
123
+ cfg: next,
124
+ installed: true
125
+ };
126
+ }
127
+ const result = await installPluginFromNpmSpec({
128
+ spec: entry.install.npmSpec,
129
+ logger: {
130
+ info: (msg) => runtime.log?.(msg),
131
+ warn: (msg) => runtime.log?.(msg)
132
+ }
133
+ });
134
+ if (result.ok) {
135
+ next = enablePluginInConfig(next, result.pluginId).config;
136
+ next = recordPluginInstall(next, {
137
+ pluginId: result.pluginId,
138
+ source: "npm",
139
+ spec: entry.install.npmSpec,
140
+ installPath: result.targetDir,
141
+ version: result.version,
142
+ ...buildNpmResolutionInstallFields(result.npmResolution)
143
+ });
144
+ return {
145
+ cfg: next,
146
+ installed: true
147
+ };
148
+ }
149
+ await prompter.note(`Failed to install ${entry.install.npmSpec}: ${result.error}`, "Plugin install");
150
+ if (localPath) {
151
+ if (await prompter.confirm({
152
+ message: `Use local plugin path instead? (${localPath})`,
153
+ initialValue: true
154
+ })) {
155
+ next = addPluginLoadPath(next, localPath);
156
+ next = enablePluginInConfig(next, entry.id).config;
157
+ return {
158
+ cfg: next,
159
+ installed: true
160
+ };
161
+ }
162
+ }
163
+ runtime.error?.(`Plugin install failed: ${result.error}`);
164
+ return {
165
+ cfg: next,
166
+ installed: false
167
+ };
168
+ }
169
+ function reloadOnboardingPluginRegistry(params) {
170
+ const workspaceDir = params.workspaceDir ?? resolveAgentWorkspaceDir(params.cfg, resolveDefaultAgentId(params.cfg));
171
+ const log = createSubsystemLogger("plugins");
172
+ loadRemoteClawPlugins({
173
+ config: params.cfg,
174
+ workspaceDir,
175
+ cache: false,
176
+ logger: createPluginLoaderLogger(log)
177
+ });
178
+ }
179
+
180
+ //#endregion
181
+ //#region src/plugin-sdk/onboarding.ts
182
+ async function promptAccountId$1(params) {
183
+ const existingIds = params.listAccountIds(params.cfg);
184
+ const initial = params.currentId?.trim() || params.defaultAccountId || DEFAULT_ACCOUNT_ID;
185
+ const choice = await params.prompter.select({
186
+ message: `${params.label} account`,
187
+ options: [...existingIds.map((id) => ({
188
+ value: id,
189
+ label: id === DEFAULT_ACCOUNT_ID ? "default (primary)" : id
190
+ })), {
191
+ value: "__new__",
192
+ label: "Add a new account"
193
+ }],
194
+ initialValue: initial
195
+ });
196
+ if (choice !== "__new__") return normalizeAccountId(choice);
197
+ const entered = await params.prompter.text({
198
+ message: `New ${params.label} account id`,
199
+ validate: (value) => value?.trim() ? void 0 : "Required"
200
+ });
201
+ const normalized = normalizeAccountId(String(entered));
202
+ if (String(entered).trim() !== normalized) await params.prompter.note(`Normalized account id to "${normalized}".`, `${params.label} account`);
203
+ return normalized;
204
+ }
205
+
206
+ //#endregion
207
+ //#region src/channels/plugins/onboarding/helpers.ts
208
+ const promptAccountId = async (params) => {
209
+ return await promptAccountId$1(params);
210
+ };
211
+ function addWildcardAllowFrom(allowFrom) {
212
+ const next = (allowFrom ?? []).map((v) => String(v).trim()).filter(Boolean);
213
+ if (!next.includes("*")) next.push("*");
214
+ return next;
215
+ }
216
+ function mergeAllowFromEntries(current, additions) {
217
+ const merged = [...current ?? [], ...additions].map((v) => String(v).trim()).filter(Boolean);
218
+ return [...new Set(merged)];
219
+ }
220
+ function splitOnboardingEntries(raw) {
221
+ return raw.split(/[\n,;]+/g).map((entry) => entry.trim()).filter(Boolean);
222
+ }
223
+ function parseOnboardingEntriesWithParser(raw, parseEntry) {
224
+ const parts = splitOnboardingEntries(String(raw ?? ""));
225
+ const entries = [];
226
+ for (const part of parts) {
227
+ const parsed = parseEntry(part);
228
+ if ("error" in parsed) return {
229
+ entries: [],
230
+ error: parsed.error
231
+ };
232
+ entries.push(parsed.value);
233
+ }
234
+ return { entries: normalizeAllowFromEntries(entries) };
235
+ }
236
+ function parseOnboardingEntriesAllowingWildcard(raw, parseEntry) {
237
+ return parseOnboardingEntriesWithParser(raw, (entry) => {
238
+ if (entry === "*") return { value: "*" };
239
+ return parseEntry(entry);
240
+ });
241
+ }
242
+ function parseMentionOrPrefixedId(params) {
243
+ const trimmed = params.value.trim();
244
+ if (!trimmed) return null;
245
+ const mentionMatch = trimmed.match(params.mentionPattern);
246
+ if (mentionMatch?.[1]) return params.normalizeId ? params.normalizeId(mentionMatch[1]) : mentionMatch[1];
247
+ const stripped = params.prefixPattern ? trimmed.replace(params.prefixPattern, "") : trimmed;
248
+ if (!params.idPattern.test(stripped)) return null;
249
+ return params.normalizeId ? params.normalizeId(stripped) : stripped;
250
+ }
251
+ function normalizeAllowFromEntries(entries, normalizeEntry) {
252
+ const normalized = entries.map((entry) => String(entry).trim()).filter(Boolean).map((entry) => {
253
+ if (entry === "*") return "*";
254
+ if (!normalizeEntry) return entry;
255
+ const value = normalizeEntry(entry);
256
+ return typeof value === "string" ? value.trim() : "";
257
+ }).filter(Boolean);
258
+ return [...new Set(normalized)];
259
+ }
260
+ function resolveOnboardingAccountId(params) {
261
+ return params.accountId?.trim() ? normalizeAccountId(params.accountId) : params.defaultAccountId;
262
+ }
263
+ async function resolveAccountIdForConfigure(params) {
264
+ const override = params.accountOverride?.trim();
265
+ let accountId = override ? normalizeAccountId(override) : params.defaultAccountId;
266
+ if (params.shouldPromptAccountIds && !override) accountId = await promptAccountId({
267
+ cfg: params.cfg,
268
+ prompter: params.prompter,
269
+ label: params.label,
270
+ currentId: accountId,
271
+ listAccountIds: params.listAccountIds,
272
+ defaultAccountId: params.defaultAccountId
273
+ });
274
+ return accountId;
275
+ }
276
+ function setAccountAllowFromForChannel(params) {
277
+ const { cfg, channel, accountId, allowFrom } = params;
278
+ return patchConfigForScopedAccount({
279
+ cfg,
280
+ channel,
281
+ accountId,
282
+ patch: { allowFrom },
283
+ ensureEnabled: false
284
+ });
285
+ }
286
+ function setChannelDmPolicyWithAllowFrom(params) {
287
+ const { cfg, channel, dmPolicy } = params;
288
+ const allowFrom = dmPolicy === "open" ? addWildcardAllowFrom(cfg.channels?.[channel]?.allowFrom) : void 0;
289
+ return {
290
+ ...cfg,
291
+ channels: {
292
+ ...cfg.channels,
293
+ [channel]: {
294
+ ...cfg.channels?.[channel],
295
+ dmPolicy,
296
+ ...allowFrom ? { allowFrom } : {}
297
+ }
298
+ }
299
+ };
300
+ }
301
+ function setLegacyChannelDmPolicyWithAllowFrom(params) {
302
+ const channelConfig = params.cfg.channels?.[params.channel] ?? {
303
+ allowFrom: void 0,
304
+ dm: void 0
305
+ };
306
+ const existingAllowFrom = channelConfig.allowFrom ?? channelConfig.dm?.allowFrom;
307
+ const allowFrom = params.dmPolicy === "open" ? addWildcardAllowFrom(existingAllowFrom) : void 0;
308
+ return patchLegacyDmChannelConfig({
309
+ cfg: params.cfg,
310
+ channel: params.channel,
311
+ patch: {
312
+ dmPolicy: params.dmPolicy,
313
+ ...allowFrom ? { allowFrom } : {}
314
+ }
315
+ });
316
+ }
317
+ function setLegacyChannelAllowFrom(params) {
318
+ return patchLegacyDmChannelConfig({
319
+ cfg: params.cfg,
320
+ channel: params.channel,
321
+ patch: { allowFrom: params.allowFrom }
322
+ });
323
+ }
324
+ function setAccountGroupPolicyForChannel(params) {
325
+ return patchChannelConfigForAccount({
326
+ cfg: params.cfg,
327
+ channel: params.channel,
328
+ accountId: params.accountId,
329
+ patch: { groupPolicy: params.groupPolicy }
330
+ });
331
+ }
332
+ function patchLegacyDmChannelConfig(params) {
333
+ const { cfg, channel, patch } = params;
334
+ const channelConfig = cfg.channels?.[channel] ?? {};
335
+ const dmConfig = channelConfig.dm ?? {};
336
+ return {
337
+ ...cfg,
338
+ channels: {
339
+ ...cfg.channels,
340
+ [channel]: {
341
+ ...channelConfig,
342
+ ...patch,
343
+ dm: {
344
+ ...dmConfig,
345
+ enabled: typeof dmConfig.enabled === "boolean" ? dmConfig.enabled : true
346
+ }
347
+ }
348
+ }
349
+ };
350
+ }
351
+ function setOnboardingChannelEnabled(cfg, channel, enabled) {
352
+ const channelConfig = cfg.channels?.[channel] ?? {};
353
+ return {
354
+ ...cfg,
355
+ channels: {
356
+ ...cfg.channels,
357
+ [channel]: {
358
+ ...channelConfig,
359
+ enabled
360
+ }
361
+ }
362
+ };
363
+ }
364
+ function patchConfigForScopedAccount(params) {
365
+ const { cfg, channel, accountId, patch, ensureEnabled } = params;
366
+ const channelConfig = cfg.channels?.[channel] ?? {};
367
+ if (accountId === DEFAULT_ACCOUNT_ID) return {
368
+ ...cfg,
369
+ channels: {
370
+ ...cfg.channels,
371
+ [channel]: {
372
+ ...channelConfig,
373
+ ...ensureEnabled ? { enabled: true } : {},
374
+ ...patch
375
+ }
376
+ }
377
+ };
378
+ const accounts = channelConfig.accounts ?? {};
379
+ const existingAccount = accounts[accountId] ?? {};
380
+ return {
381
+ ...cfg,
382
+ channels: {
383
+ ...cfg.channels,
384
+ [channel]: {
385
+ ...channelConfig,
386
+ ...ensureEnabled ? { enabled: true } : {},
387
+ accounts: {
388
+ ...accounts,
389
+ [accountId]: {
390
+ ...existingAccount,
391
+ ...ensureEnabled ? { enabled: typeof existingAccount.enabled === "boolean" ? existingAccount.enabled : true } : {},
392
+ ...patch
393
+ }
394
+ }
395
+ }
396
+ }
397
+ };
398
+ }
399
+ function patchChannelConfigForAccount(params) {
400
+ return patchConfigForScopedAccount({
401
+ ...params,
402
+ ensureEnabled: true
403
+ });
404
+ }
405
+ function applySingleTokenPromptResult(params) {
406
+ let next = params.cfg;
407
+ if (params.tokenResult.useEnv) next = patchChannelConfigForAccount({
408
+ cfg: next,
409
+ channel: params.channel,
410
+ accountId: params.accountId,
411
+ patch: {}
412
+ });
413
+ if (params.tokenResult.token) next = patchChannelConfigForAccount({
414
+ cfg: next,
415
+ channel: params.channel,
416
+ accountId: params.accountId,
417
+ patch: { [params.tokenPatchKey]: params.tokenResult.token }
418
+ });
419
+ return next;
420
+ }
421
+ async function promptSingleChannelToken(params) {
422
+ const promptToken = async () => String(await params.prompter.text({
423
+ message: params.inputPrompt,
424
+ validate: (value) => value?.trim() ? void 0 : "Required"
425
+ })).trim();
426
+ if (params.canUseEnv) {
427
+ if (await params.prompter.confirm({
428
+ message: params.envPrompt,
429
+ initialValue: true
430
+ })) return {
431
+ useEnv: true,
432
+ token: null
433
+ };
434
+ return {
435
+ useEnv: false,
436
+ token: await promptToken()
437
+ };
438
+ }
439
+ if (params.hasConfigToken && params.accountConfigured) {
440
+ if (await params.prompter.confirm({
441
+ message: params.keepPrompt,
442
+ initialValue: true
443
+ })) return {
444
+ useEnv: false,
445
+ token: null
446
+ };
447
+ }
448
+ return {
449
+ useEnv: false,
450
+ token: await promptToken()
451
+ };
452
+ }
453
+ async function promptParsedAllowFromForScopedChannel(params) {
454
+ const accountId = resolveOnboardingAccountId({
455
+ accountId: params.accountId,
456
+ defaultAccountId: params.defaultAccountId
457
+ });
458
+ const existing = params.getExistingAllowFrom({
459
+ cfg: params.cfg,
460
+ accountId
461
+ });
462
+ await params.prompter.note(params.noteLines.join("\n"), params.noteTitle);
463
+ const entry = await params.prompter.text({
464
+ message: params.message,
465
+ placeholder: params.placeholder,
466
+ initialValue: existing[0] ? String(existing[0]) : void 0,
467
+ validate: (value) => {
468
+ const raw = String(value ?? "").trim();
469
+ if (!raw) return "Required";
470
+ return params.parseEntries(raw).error;
471
+ }
472
+ });
473
+ const unique = mergeAllowFromEntries(void 0, params.parseEntries(String(entry)).entries);
474
+ return setAccountAllowFromForChannel({
475
+ cfg: params.cfg,
476
+ channel: params.channel,
477
+ accountId,
478
+ allowFrom: unique
479
+ });
480
+ }
481
+ async function noteChannelLookupSummary(params) {
482
+ const lines = [];
483
+ for (const section of params.resolvedSections) {
484
+ if (section.values.length === 0) continue;
485
+ lines.push(`${section.title}: ${section.values.join(", ")}`);
486
+ }
487
+ if (params.unresolved && params.unresolved.length > 0) lines.push(`Unresolved (kept as typed): ${params.unresolved.join(", ")}`);
488
+ if (lines.length > 0) await params.prompter.note(lines.join("\n"), params.label);
489
+ }
490
+ async function noteChannelLookupFailure(params) {
491
+ await params.prompter.note(`Channel lookup failed; keeping entries as typed. ${String(params.error)}`, params.label);
492
+ }
493
+ async function promptResolvedAllowFrom(params) {
494
+ while (true) {
495
+ const entry = await params.prompter.text({
496
+ message: params.message,
497
+ placeholder: params.placeholder,
498
+ initialValue: params.existing[0] ? String(params.existing[0]) : void 0,
499
+ validate: (value) => String(value ?? "").trim() ? void 0 : "Required"
500
+ });
501
+ const parts = params.parseInputs(String(entry));
502
+ if (!params.token) {
503
+ const ids = parts.map(params.parseId).filter(Boolean);
504
+ if (ids.length !== parts.length) {
505
+ await params.prompter.note(params.invalidWithoutTokenNote, params.label);
506
+ continue;
507
+ }
508
+ return mergeAllowFromEntries(params.existing, ids);
509
+ }
510
+ const results = await params.resolveEntries({
511
+ token: params.token,
512
+ entries: parts
513
+ }).catch(() => null);
514
+ if (!results) {
515
+ await params.prompter.note("Failed to resolve usernames. Try again.", params.label);
516
+ continue;
517
+ }
518
+ const unresolved = results.filter((res) => !res.resolved || !res.id);
519
+ if (unresolved.length > 0) {
520
+ await params.prompter.note(`Could not resolve: ${unresolved.map((res) => res.input).join(", ")}`, params.label);
521
+ continue;
522
+ }
523
+ const ids = results.map((res) => res.id);
524
+ return mergeAllowFromEntries(params.existing, ids);
525
+ }
526
+ }
527
+ async function promptLegacyChannelAllowFrom(params) {
528
+ await params.prompter.note(params.noteLines.join("\n"), params.noteTitle);
529
+ const unique = await promptResolvedAllowFrom({
530
+ prompter: params.prompter,
531
+ existing: params.existing,
532
+ token: params.token,
533
+ message: params.message,
534
+ placeholder: params.placeholder,
535
+ label: params.noteTitle,
536
+ parseInputs: splitOnboardingEntries,
537
+ parseId: params.parseId,
538
+ invalidWithoutTokenNote: params.invalidWithoutTokenNote,
539
+ resolveEntries: params.resolveEntries
540
+ });
541
+ return setLegacyChannelAllowFrom({
542
+ cfg: params.cfg,
543
+ channel: params.channel,
544
+ allowFrom: unique
545
+ });
546
+ }
547
+
548
+ //#endregion
549
+ //#region src/channels/plugins/onboarding/channel-access.ts
550
+ function parseAllowlistEntries(raw) {
551
+ return splitOnboardingEntries(String(raw ?? ""));
552
+ }
553
+ function formatAllowlistEntries(entries) {
554
+ return entries.map((entry) => entry.trim()).filter(Boolean).join(", ");
555
+ }
556
+ async function promptChannelAccessPolicy(params) {
557
+ const options = [{
558
+ value: "allowlist",
559
+ label: "Allowlist (recommended)"
560
+ }];
561
+ if (params.allowOpen !== false) options.push({
562
+ value: "open",
563
+ label: "Open (allow all channels)"
564
+ });
565
+ if (params.allowDisabled !== false) options.push({
566
+ value: "disabled",
567
+ label: "Disabled (block all channels)"
568
+ });
569
+ const initialValue = params.currentPolicy ?? "allowlist";
570
+ return await params.prompter.select({
571
+ message: `${params.label} access`,
572
+ options,
573
+ initialValue
574
+ });
575
+ }
576
+ async function promptChannelAllowlist(params) {
577
+ const initialValue = params.currentEntries && params.currentEntries.length > 0 ? formatAllowlistEntries(params.currentEntries) : void 0;
578
+ return parseAllowlistEntries(await params.prompter.text({
579
+ message: `${params.label} allowlist (comma-separated)`,
580
+ placeholder: params.placeholder,
581
+ initialValue
582
+ }));
583
+ }
584
+ async function promptChannelAccessConfig(params) {
585
+ const hasEntries = (params.currentEntries ?? []).length > 0;
586
+ const shouldPrompt = params.defaultPrompt ?? !hasEntries;
587
+ if (!await params.prompter.confirm({
588
+ message: params.updatePrompt ? `Update ${params.label} access?` : `Configure ${params.label} access?`,
589
+ initialValue: shouldPrompt
590
+ })) return null;
591
+ const policy = await promptChannelAccessPolicy({
592
+ prompter: params.prompter,
593
+ label: params.label,
594
+ currentPolicy: params.currentPolicy,
595
+ allowOpen: params.allowOpen,
596
+ allowDisabled: params.allowDisabled
597
+ });
598
+ if (policy !== "allowlist") return {
599
+ policy,
600
+ entries: []
601
+ };
602
+ return {
603
+ policy,
604
+ entries: await promptChannelAllowlist({
605
+ prompter: params.prompter,
606
+ label: params.label,
607
+ currentEntries: params.currentEntries,
608
+ placeholder: params.placeholder
609
+ })
610
+ };
611
+ }
612
+
613
+ //#endregion
614
+ //#region src/channels/plugins/onboarding/channel-access-configure.ts
615
+ async function configureChannelAccessWithAllowlist(params) {
616
+ let next = params.cfg;
617
+ const accessConfig = await promptChannelAccessConfig({
618
+ prompter: params.prompter,
619
+ label: params.label,
620
+ currentPolicy: params.currentPolicy,
621
+ currentEntries: params.currentEntries,
622
+ placeholder: params.placeholder,
623
+ updatePrompt: params.updatePrompt
624
+ });
625
+ if (!accessConfig) return next;
626
+ if (accessConfig.policy !== "allowlist") return params.setPolicy(next, accessConfig.policy);
627
+ const resolved = await params.resolveAllowlist({
628
+ cfg: next,
629
+ entries: accessConfig.entries
630
+ });
631
+ next = params.setPolicy(next, "allowlist");
632
+ return params.applyAllowlist({
633
+ cfg: next,
634
+ resolved
635
+ });
636
+ }
637
+
638
+ //#endregion
639
+ //#region src/channels/plugins/onboarding/discord.ts
640
+ const channel$5 = "discord";
641
+ async function noteDiscordTokenHelp(prompter) {
642
+ await prompter.note([
643
+ "1) Discord Developer Portal → Applications → New Application",
644
+ "2) Bot → Add Bot → Reset Token → copy token",
645
+ "3) OAuth2 → URL Generator → scope 'bot' → invite to your server",
646
+ "Tip: enable Message Content Intent if you need message text. (Bot → Privileged Gateway Intents → Message Content Intent)",
647
+ `Docs: ${formatDocsLink("/discord", "discord")}`
648
+ ].join("\n"), "Discord bot token");
649
+ }
650
+ function setDiscordGuildChannelAllowlist(cfg, accountId, entries) {
651
+ const guilds = { ...accountId === DEFAULT_ACCOUNT_ID ? cfg.channels?.discord?.guilds ?? {} : cfg.channels?.discord?.accounts?.[accountId]?.guilds ?? {} };
652
+ for (const entry of entries) {
653
+ const guildKey = entry.guildKey || "*";
654
+ const existing = guilds[guildKey] ?? {};
655
+ if (entry.channelKey) {
656
+ const channels = { ...existing.channels };
657
+ channels[entry.channelKey] = { allow: true };
658
+ guilds[guildKey] = {
659
+ ...existing,
660
+ channels
661
+ };
662
+ } else guilds[guildKey] = existing;
663
+ }
664
+ return patchChannelConfigForAccount({
665
+ cfg,
666
+ channel: "discord",
667
+ accountId,
668
+ patch: { guilds }
669
+ });
670
+ }
671
+ async function promptDiscordAllowFrom(params) {
672
+ const accountId = resolveOnboardingAccountId({
673
+ accountId: params.accountId,
674
+ defaultAccountId: resolveDefaultDiscordAccountId(params.cfg)
675
+ });
676
+ const token = resolveDiscordAccount({
677
+ cfg: params.cfg,
678
+ accountId
679
+ }).token;
680
+ const existing = params.cfg.channels?.discord?.allowFrom ?? params.cfg.channels?.discord?.dm?.allowFrom ?? [];
681
+ const parseId = (value) => parseMentionOrPrefixedId({
682
+ value,
683
+ mentionPattern: /^<@!?(\d+)>$/,
684
+ prefixPattern: /^(user:|discord:)/i,
685
+ idPattern: /^\d+$/
686
+ });
687
+ return promptLegacyChannelAllowFrom({
688
+ cfg: params.cfg,
689
+ channel: "discord",
690
+ prompter: params.prompter,
691
+ existing,
692
+ token,
693
+ noteTitle: "Discord allowlist",
694
+ noteLines: [
695
+ "Allowlist Discord DMs by username (we resolve to user ids).",
696
+ "Examples:",
697
+ "- 123456789012345678",
698
+ "- @alice",
699
+ "- alice#1234",
700
+ "Multiple entries: comma-separated.",
701
+ `Docs: ${formatDocsLink("/discord", "discord")}`
702
+ ],
703
+ message: "Discord allowFrom (usernames or ids)",
704
+ placeholder: "@alice, 123456789012345678",
705
+ parseId,
706
+ invalidWithoutTokenNote: "Bot token missing; use numeric user ids (or mention form) only.",
707
+ resolveEntries: ({ token, entries }) => resolveDiscordUserAllowlist({
708
+ token,
709
+ entries
710
+ })
711
+ });
712
+ }
713
+ const dmPolicy$4 = {
714
+ label: "Discord",
715
+ channel: channel$5,
716
+ policyKey: "channels.discord.dmPolicy",
717
+ allowFromKey: "channels.discord.allowFrom",
718
+ getCurrent: (cfg) => cfg.channels?.discord?.dmPolicy ?? cfg.channels?.discord?.dm?.policy ?? "pairing",
719
+ setPolicy: (cfg, policy) => setLegacyChannelDmPolicyWithAllowFrom({
720
+ cfg,
721
+ channel: "discord",
722
+ dmPolicy: policy
723
+ }),
724
+ promptAllowFrom: promptDiscordAllowFrom
725
+ };
726
+ const discordOnboardingAdapter = {
727
+ channel: channel$5,
728
+ getStatus: async ({ cfg }) => {
729
+ const configured = listDiscordAccountIds(cfg).some((accountId) => Boolean(resolveDiscordAccount({
730
+ cfg,
731
+ accountId
732
+ }).token));
733
+ return {
734
+ channel: channel$5,
735
+ configured,
736
+ statusLines: [`Discord: ${configured ? "configured" : "needs token"}`],
737
+ selectionHint: configured ? "configured" : "needs token",
738
+ quickstartScore: configured ? 2 : 1
739
+ };
740
+ },
741
+ configure: async ({ cfg, prompter, accountOverrides, shouldPromptAccountIds }) => {
742
+ const defaultDiscordAccountId = resolveDefaultDiscordAccountId(cfg);
743
+ const discordAccountId = await resolveAccountIdForConfigure({
744
+ cfg,
745
+ prompter,
746
+ label: "Discord",
747
+ accountOverride: accountOverrides.discord,
748
+ shouldPromptAccountIds,
749
+ listAccountIds: listDiscordAccountIds,
750
+ defaultAccountId: defaultDiscordAccountId
751
+ });
752
+ let next = cfg;
753
+ const resolvedAccount = resolveDiscordAccount({
754
+ cfg: next,
755
+ accountId: discordAccountId
756
+ });
757
+ const accountConfigured = Boolean(resolvedAccount.token);
758
+ const canUseEnv = discordAccountId === DEFAULT_ACCOUNT_ID && !resolvedAccount.config.token && Boolean(process.env.DISCORD_BOT_TOKEN?.trim());
759
+ const hasConfigToken = Boolean(resolvedAccount.config.token);
760
+ if (!accountConfigured) await noteDiscordTokenHelp(prompter);
761
+ const tokenResult = await promptSingleChannelToken({
762
+ prompter,
763
+ accountConfigured,
764
+ canUseEnv,
765
+ hasConfigToken,
766
+ envPrompt: "DISCORD_BOT_TOKEN detected. Use env var?",
767
+ keepPrompt: "Discord token already configured. Keep it?",
768
+ inputPrompt: "Enter Discord bot token"
769
+ });
770
+ next = applySingleTokenPromptResult({
771
+ cfg: next,
772
+ channel: "discord",
773
+ accountId: discordAccountId,
774
+ tokenPatchKey: "token",
775
+ tokenResult
776
+ });
777
+ const currentEntries = Object.entries(resolvedAccount.config.guilds ?? {}).flatMap(([guildKey, value]) => {
778
+ const channels = value?.channels ?? {};
779
+ const channelKeys = Object.keys(channels);
780
+ if (channelKeys.length === 0) return [/^\d+$/.test(guildKey) ? `guild:${guildKey}` : guildKey];
781
+ return channelKeys.map((channelKey) => `${guildKey}/${channelKey}`);
782
+ });
783
+ next = await configureChannelAccessWithAllowlist({
784
+ cfg: next,
785
+ prompter,
786
+ label: "Discord channels",
787
+ currentPolicy: resolvedAccount.config.groupPolicy ?? "allowlist",
788
+ currentEntries,
789
+ placeholder: "My Server/#general, guildId/channelId, #support",
790
+ updatePrompt: Boolean(resolvedAccount.config.guilds),
791
+ setPolicy: (cfg, policy) => setAccountGroupPolicyForChannel({
792
+ cfg,
793
+ channel: "discord",
794
+ accountId: discordAccountId,
795
+ groupPolicy: policy
796
+ }),
797
+ resolveAllowlist: async ({ cfg, entries }) => {
798
+ const accountWithTokens = resolveDiscordAccount({
799
+ cfg,
800
+ accountId: discordAccountId
801
+ });
802
+ let resolved = entries.map((input) => ({
803
+ input,
804
+ resolved: false
805
+ }));
806
+ if (accountWithTokens.token && entries.length > 0) try {
807
+ resolved = await resolveDiscordChannelAllowlist({
808
+ token: accountWithTokens.token,
809
+ entries
810
+ });
811
+ const resolvedChannels = resolved.filter((entry) => entry.resolved && entry.channelId);
812
+ const resolvedGuilds = resolved.filter((entry) => entry.resolved && entry.guildId && !entry.channelId);
813
+ const unresolved = resolved.filter((entry) => !entry.resolved).map((entry) => entry.input);
814
+ await noteChannelLookupSummary({
815
+ prompter,
816
+ label: "Discord channels",
817
+ resolvedSections: [{
818
+ title: "Resolved channels",
819
+ values: resolvedChannels.map((entry) => entry.channelId).filter((value) => Boolean(value))
820
+ }, {
821
+ title: "Resolved guilds",
822
+ values: resolvedGuilds.map((entry) => entry.guildId).filter((value) => Boolean(value))
823
+ }],
824
+ unresolved
825
+ });
826
+ } catch (err) {
827
+ await noteChannelLookupFailure({
828
+ prompter,
829
+ label: "Discord channels",
830
+ error: err
831
+ });
832
+ }
833
+ return resolved;
834
+ },
835
+ applyAllowlist: ({ cfg, resolved }) => {
836
+ const allowlistEntries = [];
837
+ for (const entry of resolved) {
838
+ const guildKey = entry.guildId ?? (entry.guildName ? normalizeDiscordSlug(entry.guildName) : void 0) ?? "*";
839
+ const channelKey = entry.channelId ?? (entry.channelName ? normalizeDiscordSlug(entry.channelName) : void 0);
840
+ if (!channelKey && guildKey === "*") continue;
841
+ allowlistEntries.push({
842
+ guildKey,
843
+ ...channelKey ? { channelKey } : {}
844
+ });
845
+ }
846
+ return setDiscordGuildChannelAllowlist(cfg, discordAccountId, allowlistEntries);
847
+ }
848
+ });
849
+ return {
850
+ cfg: next,
851
+ accountId: discordAccountId
852
+ };
853
+ },
854
+ dmPolicy: dmPolicy$4,
855
+ disable: (cfg) => setOnboardingChannelEnabled(cfg, channel$5, false)
856
+ };
857
+
858
+ //#endregion
859
+ //#region src/channels/plugins/onboarding/imessage.ts
860
+ const channel$4 = "imessage";
861
+ function parseIMessageAllowFromEntries(raw) {
862
+ return parseOnboardingEntriesAllowingWildcard(raw, (entry) => {
863
+ const lower = entry.toLowerCase();
864
+ if (lower.startsWith("chat_id:")) {
865
+ const id = entry.slice(8).trim();
866
+ if (!/^\d+$/.test(id)) return { error: `Invalid chat_id: ${entry}` };
867
+ return { value: entry };
868
+ }
869
+ if (lower.startsWith("chat_guid:")) {
870
+ if (!entry.slice(10).trim()) return { error: "Invalid chat_guid entry" };
871
+ return { value: entry };
872
+ }
873
+ if (lower.startsWith("chat_identifier:")) {
874
+ if (!entry.slice(16).trim()) return { error: "Invalid chat_identifier entry" };
875
+ return { value: entry };
876
+ }
877
+ if (!normalizeIMessageHandle(entry)) return { error: `Invalid handle: ${entry}` };
878
+ return { value: entry };
879
+ });
880
+ }
881
+ async function promptIMessageAllowFrom(params) {
882
+ return promptParsedAllowFromForScopedChannel({
883
+ cfg: params.cfg,
884
+ channel: "imessage",
885
+ accountId: params.accountId,
886
+ defaultAccountId: resolveDefaultIMessageAccountId(params.cfg),
887
+ prompter: params.prompter,
888
+ noteTitle: "iMessage allowlist",
889
+ noteLines: [
890
+ "Allowlist iMessage DMs by handle or chat target.",
891
+ "Examples:",
892
+ "- +15555550123",
893
+ "- user@example.com",
894
+ "- chat_id:123",
895
+ "- chat_guid:... or chat_identifier:...",
896
+ "Multiple entries: comma-separated.",
897
+ `Docs: ${formatDocsLink("/imessage", "imessage")}`
898
+ ],
899
+ message: "iMessage allowFrom (handle or chat_id)",
900
+ placeholder: "+15555550123, user@example.com, chat_id:123",
901
+ parseEntries: parseIMessageAllowFromEntries,
902
+ getExistingAllowFrom: ({ cfg, accountId }) => {
903
+ return resolveIMessageAccount({
904
+ cfg,
905
+ accountId
906
+ }).config.allowFrom ?? [];
907
+ }
908
+ });
909
+ }
910
+ const dmPolicy$3 = {
911
+ label: "iMessage",
912
+ channel: channel$4,
913
+ policyKey: "channels.imessage.dmPolicy",
914
+ allowFromKey: "channels.imessage.allowFrom",
915
+ getCurrent: (cfg) => cfg.channels?.imessage?.dmPolicy ?? "pairing",
916
+ setPolicy: (cfg, policy) => setChannelDmPolicyWithAllowFrom({
917
+ cfg,
918
+ channel: "imessage",
919
+ dmPolicy: policy
920
+ }),
921
+ promptAllowFrom: promptIMessageAllowFrom
922
+ };
923
+ const imessageOnboardingAdapter = {
924
+ channel: channel$4,
925
+ getStatus: async ({ cfg }) => {
926
+ const configured = listIMessageAccountIds(cfg).some((accountId) => {
927
+ const account = resolveIMessageAccount({
928
+ cfg,
929
+ accountId
930
+ });
931
+ return Boolean(account.config.cliPath || account.config.dbPath || account.config.allowFrom || account.config.service || account.config.region);
932
+ });
933
+ const imessageCliPath = cfg.channels?.imessage?.cliPath ?? "imsg";
934
+ const imessageCliDetected = await detectBinary(imessageCliPath);
935
+ return {
936
+ channel: channel$4,
937
+ configured,
938
+ statusLines: [`iMessage: ${configured ? "configured" : "needs setup"}`, `imsg: ${imessageCliDetected ? "found" : "missing"} (${imessageCliPath})`],
939
+ selectionHint: imessageCliDetected ? "imsg found" : "imsg missing",
940
+ quickstartScore: imessageCliDetected ? 1 : 0
941
+ };
942
+ },
943
+ configure: async ({ cfg, prompter, accountOverrides, shouldPromptAccountIds }) => {
944
+ const defaultIMessageAccountId = resolveDefaultIMessageAccountId(cfg);
945
+ const imessageAccountId = await resolveAccountIdForConfigure({
946
+ cfg,
947
+ prompter,
948
+ label: "iMessage",
949
+ accountOverride: accountOverrides.imessage,
950
+ shouldPromptAccountIds,
951
+ listAccountIds: listIMessageAccountIds,
952
+ defaultAccountId: defaultIMessageAccountId
953
+ });
954
+ let next = cfg;
955
+ let resolvedCliPath = resolveIMessageAccount({
956
+ cfg: next,
957
+ accountId: imessageAccountId
958
+ }).config.cliPath ?? "imsg";
959
+ if (!await detectBinary(resolvedCliPath)) {
960
+ const entered = await prompter.text({
961
+ message: "imsg CLI path",
962
+ initialValue: resolvedCliPath,
963
+ validate: (value) => value?.trim() ? void 0 : "Required"
964
+ });
965
+ resolvedCliPath = String(entered).trim();
966
+ if (!resolvedCliPath) await prompter.note("imsg CLI path required to enable iMessage.", "iMessage");
967
+ }
968
+ if (resolvedCliPath) next = patchChannelConfigForAccount({
969
+ cfg: next,
970
+ channel: "imessage",
971
+ accountId: imessageAccountId,
972
+ patch: { cliPath: resolvedCliPath }
973
+ });
974
+ await prompter.note([
975
+ "This is still a work in progress.",
976
+ "Ensure RemoteClaw has Full Disk Access to Messages DB.",
977
+ "Grant Automation permission for Messages when prompted.",
978
+ "List chats with: imsg chats --limit 20",
979
+ `Docs: ${formatDocsLink("/imessage", "imessage")}`
980
+ ].join("\n"), "iMessage next steps");
981
+ return {
982
+ cfg: next,
983
+ accountId: imessageAccountId
984
+ };
985
+ },
986
+ dmPolicy: dmPolicy$3,
987
+ disable: (cfg) => setOnboardingChannelEnabled(cfg, channel$4, false)
988
+ };
989
+
990
+ //#endregion
991
+ //#region src/commands/signal-install.ts
992
+ /** @internal Exported for testing. */
993
+ async function extractSignalCliArchive(archivePath, installRoot, timeoutMs) {
994
+ await extractArchive({
995
+ archivePath,
996
+ destDir: installRoot,
997
+ timeoutMs
998
+ });
999
+ }
1000
+ /** @internal Exported for testing. */
1001
+ function looksLikeArchive(name) {
1002
+ return name.endsWith(".tar.gz") || name.endsWith(".tgz") || name.endsWith(".zip");
1003
+ }
1004
+ /**
1005
+ * Pick a native release asset from the official GitHub releases.
1006
+ *
1007
+ * The official signal-cli releases only publish native (GraalVM) binaries for
1008
+ * x86-64 Linux. On architectures where no native asset is available this
1009
+ * returns `undefined` so the caller can fall back to a different install
1010
+ * strategy (e.g. Homebrew).
1011
+ */
1012
+ /** @internal Exported for testing. */
1013
+ function pickAsset(assets, platform, arch) {
1014
+ const archives = assets.filter((asset) => Boolean(asset.name && asset.browser_download_url)).filter((a) => looksLikeArchive(a.name.toLowerCase()));
1015
+ const byName = (pattern) => archives.find((asset) => pattern.test(asset.name.toLowerCase()));
1016
+ if (platform === "linux") {
1017
+ if (arch === "x64") return byName(/linux-native/) || byName(/linux/) || archives[0];
1018
+ return;
1019
+ }
1020
+ if (platform === "darwin") return byName(/macos|osx|darwin/) || archives[0];
1021
+ if (platform === "win32") return byName(/windows|win/) || archives[0];
1022
+ return archives[0];
1023
+ }
1024
+ async function downloadToFile(url, dest, maxRedirects = 5) {
1025
+ await new Promise((resolve, reject) => {
1026
+ const req = request(url, (res) => {
1027
+ if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400) {
1028
+ const location = res.headers.location;
1029
+ if (!location || maxRedirects <= 0) {
1030
+ reject(/* @__PURE__ */ new Error("Redirect loop or missing Location header"));
1031
+ return;
1032
+ }
1033
+ const redirectUrl = new URL(location, url).href;
1034
+ resolve(downloadToFile(redirectUrl, dest, maxRedirects - 1));
1035
+ return;
1036
+ }
1037
+ if (!res.statusCode || res.statusCode >= 400) {
1038
+ reject(/* @__PURE__ */ new Error(`HTTP ${res.statusCode ?? "?"} downloading file`));
1039
+ return;
1040
+ }
1041
+ pipeline(res, createWriteStream(dest)).then(resolve).catch(reject);
1042
+ });
1043
+ req.on("error", reject);
1044
+ req.end();
1045
+ });
1046
+ }
1047
+ async function findSignalCliBinary(root) {
1048
+ const candidates = [];
1049
+ const enqueue = async (dir, depth) => {
1050
+ if (depth > 3) return;
1051
+ const entries = await fsp.readdir(dir, { withFileTypes: true }).catch(() => []);
1052
+ for (const entry of entries) {
1053
+ const full = path.join(dir, entry.name);
1054
+ if (entry.isDirectory()) await enqueue(full, depth + 1);
1055
+ else if (entry.isFile() && entry.name === "signal-cli") candidates.push(full);
1056
+ }
1057
+ };
1058
+ await enqueue(root, 0);
1059
+ return candidates[0] ?? null;
1060
+ }
1061
+ async function resolveBrewSignalCliPath(brewExe) {
1062
+ try {
1063
+ const result = await runCommandWithTimeout([
1064
+ brewExe,
1065
+ "--prefix",
1066
+ "signal-cli"
1067
+ ], { timeoutMs: 1e4 });
1068
+ if (result.code === 0 && result.stdout.trim()) {
1069
+ const prefix = result.stdout.trim();
1070
+ const candidate = path.join(prefix, "bin", "signal-cli");
1071
+ try {
1072
+ await fsp.access(candidate);
1073
+ return candidate;
1074
+ } catch {
1075
+ return findSignalCliBinary(prefix);
1076
+ }
1077
+ }
1078
+ } catch {}
1079
+ return null;
1080
+ }
1081
+ async function installSignalCliViaBrew(runtime) {
1082
+ const brewExe = resolveBrewExecutable();
1083
+ if (!brewExe) return {
1084
+ ok: false,
1085
+ error: `No native signal-cli build is available for ${process.arch}. Install Homebrew (https://brew.sh) and try again, or install signal-cli manually.`
1086
+ };
1087
+ runtime.log(`Installing signal-cli via Homebrew (${brewExe})…`);
1088
+ const result = await runCommandWithTimeout([
1089
+ brewExe,
1090
+ "install",
1091
+ "signal-cli"
1092
+ ], { timeoutMs: 15 * 6e4 });
1093
+ if (result.code !== 0) return {
1094
+ ok: false,
1095
+ error: `brew install signal-cli failed (exit ${result.code}): ${result.stderr.trim().slice(0, 200)}`
1096
+ };
1097
+ const cliPath = await resolveBrewSignalCliPath(brewExe);
1098
+ if (!cliPath) return {
1099
+ ok: false,
1100
+ error: "brew install succeeded but signal-cli binary was not found."
1101
+ };
1102
+ let version;
1103
+ try {
1104
+ version = (await runCommandWithTimeout([cliPath, "--version"], { timeoutMs: 1e4 })).stdout.trim().replace(/^signal-cli\s+/, "") || void 0;
1105
+ } catch {}
1106
+ return {
1107
+ ok: true,
1108
+ cliPath,
1109
+ version
1110
+ };
1111
+ }
1112
+ async function installSignalCliFromRelease(runtime) {
1113
+ const response = await fetch("https://api.github.com/repos/AsamK/signal-cli/releases/latest", { headers: {
1114
+ "User-Agent": "remoteclaw",
1115
+ Accept: "application/vnd.github+json"
1116
+ } });
1117
+ if (!response.ok) return {
1118
+ ok: false,
1119
+ error: `Failed to fetch release info (${response.status})`
1120
+ };
1121
+ const payload = await response.json();
1122
+ const version = payload.tag_name?.replace(/^v/, "") ?? "unknown";
1123
+ const asset = pickAsset(payload.assets ?? [], process.platform, process.arch);
1124
+ if (!asset) return {
1125
+ ok: false,
1126
+ error: "No compatible release asset found for this platform."
1127
+ };
1128
+ const tmpDir = await fsp.mkdtemp(path.join(os.tmpdir(), "remoteclaw-signal-"));
1129
+ const archivePath = path.join(tmpDir, asset.name);
1130
+ runtime.log(`Downloading signal-cli ${version} (${asset.name})…`);
1131
+ await downloadToFile(asset.browser_download_url, archivePath);
1132
+ const installRoot = path.join(CONFIG_DIR, "tools", "signal-cli", version);
1133
+ await fsp.mkdir(installRoot, { recursive: true });
1134
+ if (!looksLikeArchive(asset.name.toLowerCase())) return {
1135
+ ok: false,
1136
+ error: `Unsupported archive type: ${asset.name}`
1137
+ };
1138
+ try {
1139
+ await extractSignalCliArchive(archivePath, installRoot, 6e4);
1140
+ } catch (err) {
1141
+ const message = err instanceof Error ? err.message : String(err);
1142
+ return {
1143
+ ok: false,
1144
+ error: `Failed to extract ${asset.name}: ${message}`
1145
+ };
1146
+ }
1147
+ const cliPath = await findSignalCliBinary(installRoot);
1148
+ if (!cliPath) return {
1149
+ ok: false,
1150
+ error: `signal-cli binary not found after extracting ${asset.name}`
1151
+ };
1152
+ await fsp.chmod(cliPath, 493).catch(() => {});
1153
+ return {
1154
+ ok: true,
1155
+ cliPath,
1156
+ version
1157
+ };
1158
+ }
1159
+ async function installSignalCli(runtime) {
1160
+ if (process.platform === "win32") return {
1161
+ ok: false,
1162
+ error: "Signal CLI auto-install is not supported on Windows yet."
1163
+ };
1164
+ if (process.platform !== "linux" || process.arch === "x64") return installSignalCliFromRelease(runtime);
1165
+ return installSignalCliViaBrew(runtime);
1166
+ }
1167
+
1168
+ //#endregion
1169
+ //#region src/channels/plugins/onboarding/signal.ts
1170
+ const channel$3 = "signal";
1171
+ const MIN_E164_DIGITS = 5;
1172
+ const MAX_E164_DIGITS = 15;
1173
+ const DIGITS_ONLY = /^\d+$/;
1174
+ const INVALID_SIGNAL_ACCOUNT_ERROR = "Invalid E.164 phone number (must start with + and country code, e.g. +15555550123)";
1175
+ function normalizeSignalAccountInput(value) {
1176
+ const trimmed = value?.trim();
1177
+ if (!trimmed) return null;
1178
+ const digits = normalizeE164(trimmed).slice(1);
1179
+ if (!DIGITS_ONLY.test(digits)) return null;
1180
+ if (digits.length < MIN_E164_DIGITS || digits.length > MAX_E164_DIGITS) return null;
1181
+ return `+${digits}`;
1182
+ }
1183
+ function isUuidLike(value) {
1184
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
1185
+ }
1186
+ function parseSignalAllowFromEntries(raw) {
1187
+ return parseOnboardingEntriesAllowingWildcard(raw, (entry) => {
1188
+ if (entry.toLowerCase().startsWith("uuid:")) {
1189
+ const id = entry.slice(5).trim();
1190
+ if (!id) return { error: "Invalid uuid entry" };
1191
+ return { value: `uuid:${id}` };
1192
+ }
1193
+ if (isUuidLike(entry)) return { value: `uuid:${entry}` };
1194
+ const normalized = normalizeSignalAccountInput(entry);
1195
+ if (!normalized) return { error: `Invalid entry: ${entry}` };
1196
+ return { value: normalized };
1197
+ });
1198
+ }
1199
+ async function promptSignalAllowFrom(params) {
1200
+ return promptParsedAllowFromForScopedChannel({
1201
+ cfg: params.cfg,
1202
+ channel: "signal",
1203
+ accountId: params.accountId,
1204
+ defaultAccountId: resolveDefaultSignalAccountId(params.cfg),
1205
+ prompter: params.prompter,
1206
+ noteTitle: "Signal allowlist",
1207
+ noteLines: [
1208
+ "Allowlist Signal DMs by sender id.",
1209
+ "Examples:",
1210
+ "- +15555550123",
1211
+ "- uuid:123e4567-e89b-12d3-a456-426614174000",
1212
+ "Multiple entries: comma-separated.",
1213
+ `Docs: ${formatDocsLink("/signal", "signal")}`
1214
+ ],
1215
+ message: "Signal allowFrom (E.164 or uuid)",
1216
+ placeholder: "+15555550123, uuid:123e4567-e89b-12d3-a456-426614174000",
1217
+ parseEntries: parseSignalAllowFromEntries,
1218
+ getExistingAllowFrom: ({ cfg, accountId }) => {
1219
+ return resolveSignalAccount({
1220
+ cfg,
1221
+ accountId
1222
+ }).config.allowFrom ?? [];
1223
+ }
1224
+ });
1225
+ }
1226
+ const dmPolicy$2 = {
1227
+ label: "Signal",
1228
+ channel: channel$3,
1229
+ policyKey: "channels.signal.dmPolicy",
1230
+ allowFromKey: "channels.signal.allowFrom",
1231
+ getCurrent: (cfg) => cfg.channels?.signal?.dmPolicy ?? "pairing",
1232
+ setPolicy: (cfg, policy) => setChannelDmPolicyWithAllowFrom({
1233
+ cfg,
1234
+ channel: "signal",
1235
+ dmPolicy: policy
1236
+ }),
1237
+ promptAllowFrom: promptSignalAllowFrom
1238
+ };
1239
+ const signalOnboardingAdapter = {
1240
+ channel: channel$3,
1241
+ getStatus: async ({ cfg }) => {
1242
+ const configured = listSignalAccountIds(cfg).some((accountId) => resolveSignalAccount({
1243
+ cfg,
1244
+ accountId
1245
+ }).configured);
1246
+ const signalCliPath = cfg.channels?.signal?.cliPath ?? "signal-cli";
1247
+ const signalCliDetected = await detectBinary(signalCliPath);
1248
+ return {
1249
+ channel: channel$3,
1250
+ configured,
1251
+ statusLines: [`Signal: ${configured ? "configured" : "needs setup"}`, `signal-cli: ${signalCliDetected ? "found" : "missing"} (${signalCliPath})`],
1252
+ selectionHint: signalCliDetected ? "signal-cli found" : "signal-cli missing",
1253
+ quickstartScore: signalCliDetected ? 1 : 0
1254
+ };
1255
+ },
1256
+ configure: async ({ cfg, runtime, prompter, accountOverrides, shouldPromptAccountIds, options }) => {
1257
+ const defaultSignalAccountId = resolveDefaultSignalAccountId(cfg);
1258
+ const signalAccountId = await resolveAccountIdForConfigure({
1259
+ cfg,
1260
+ prompter,
1261
+ label: "Signal",
1262
+ accountOverride: accountOverrides.signal,
1263
+ shouldPromptAccountIds,
1264
+ listAccountIds: listSignalAccountIds,
1265
+ defaultAccountId: defaultSignalAccountId
1266
+ });
1267
+ let next = cfg;
1268
+ const accountConfig = resolveSignalAccount({
1269
+ cfg: next,
1270
+ accountId: signalAccountId
1271
+ }).config;
1272
+ let resolvedCliPath = accountConfig.cliPath ?? "signal-cli";
1273
+ let cliDetected = await detectBinary(resolvedCliPath);
1274
+ if (options?.allowSignalInstall) {
1275
+ if (await prompter.confirm({
1276
+ message: cliDetected ? "signal-cli detected. Reinstall/update now?" : "signal-cli not found. Install now?",
1277
+ initialValue: !cliDetected
1278
+ })) try {
1279
+ const result = await installSignalCli(runtime);
1280
+ if (result.ok && result.cliPath) {
1281
+ cliDetected = true;
1282
+ resolvedCliPath = result.cliPath;
1283
+ await prompter.note(`Installed signal-cli at ${result.cliPath}`, "Signal");
1284
+ } else if (!result.ok) await prompter.note(result.error ?? "signal-cli install failed.", "Signal");
1285
+ } catch (err) {
1286
+ await prompter.note(`signal-cli install failed: ${String(err)}`, "Signal");
1287
+ }
1288
+ }
1289
+ if (!cliDetected) await prompter.note("signal-cli not found. Install it, then rerun this step or set channels.signal.cliPath.", "Signal");
1290
+ let account = accountConfig.account ?? "";
1291
+ if (account) {
1292
+ const normalizedExisting = normalizeSignalAccountInput(account);
1293
+ if (!normalizedExisting) {
1294
+ await prompter.note("Existing Signal account isn't a valid E.164 number. Please enter it again.", "Signal");
1295
+ account = "";
1296
+ } else {
1297
+ account = normalizedExisting;
1298
+ if (!await prompter.confirm({
1299
+ message: `Signal account set (${account}). Keep it?`,
1300
+ initialValue: true
1301
+ })) account = "";
1302
+ }
1303
+ }
1304
+ if (!account) account = normalizeSignalAccountInput(String(await prompter.text({
1305
+ message: "Signal bot number (E.164)",
1306
+ validate: (value) => normalizeSignalAccountInput(String(value ?? "")) ? void 0 : INVALID_SIGNAL_ACCOUNT_ERROR
1307
+ }))) ?? "";
1308
+ if (account) next = patchChannelConfigForAccount({
1309
+ cfg: next,
1310
+ channel: "signal",
1311
+ accountId: signalAccountId,
1312
+ patch: {
1313
+ account,
1314
+ cliPath: resolvedCliPath ?? "signal-cli"
1315
+ }
1316
+ });
1317
+ await prompter.note([
1318
+ "Link device with: signal-cli link -n \"RemoteClaw\"",
1319
+ "Scan QR in Signal → Linked Devices",
1320
+ `Then run: ${formatCliCommand("remoteclaw gateway call channels.status --params '{\"probe\":true}'")}`,
1321
+ `Docs: ${formatDocsLink("/signal", "signal")}`
1322
+ ].join("\n"), "Signal next steps");
1323
+ return {
1324
+ cfg: next,
1325
+ accountId: signalAccountId
1326
+ };
1327
+ },
1328
+ dmPolicy: dmPolicy$2,
1329
+ disable: (cfg) => setOnboardingChannelEnabled(cfg, channel$3, false)
1330
+ };
1331
+
1332
+ //#endregion
1333
+ //#region src/channels/plugins/onboarding/slack.ts
1334
+ const channel$2 = "slack";
1335
+ function buildSlackManifest(botName) {
1336
+ const safeName = botName.trim() || "RemoteClaw";
1337
+ const manifest = {
1338
+ display_information: {
1339
+ name: safeName,
1340
+ description: `${safeName} connector for RemoteClaw`
1341
+ },
1342
+ features: {
1343
+ bot_user: {
1344
+ display_name: safeName,
1345
+ always_online: false
1346
+ },
1347
+ app_home: {
1348
+ messages_tab_enabled: true,
1349
+ messages_tab_read_only_enabled: false
1350
+ },
1351
+ slash_commands: [{
1352
+ command: "/remoteclaw",
1353
+ description: "Send a message to RemoteClaw",
1354
+ should_escape: false
1355
+ }]
1356
+ },
1357
+ oauth_config: { scopes: { bot: [
1358
+ "chat:write",
1359
+ "channels:history",
1360
+ "channels:read",
1361
+ "groups:history",
1362
+ "im:history",
1363
+ "mpim:history",
1364
+ "users:read",
1365
+ "app_mentions:read",
1366
+ "reactions:read",
1367
+ "reactions:write",
1368
+ "pins:read",
1369
+ "pins:write",
1370
+ "emoji:read",
1371
+ "commands",
1372
+ "files:read",
1373
+ "files:write"
1374
+ ] } },
1375
+ settings: {
1376
+ socket_mode_enabled: true,
1377
+ event_subscriptions: { bot_events: [
1378
+ "app_mention",
1379
+ "message.channels",
1380
+ "message.groups",
1381
+ "message.im",
1382
+ "message.mpim",
1383
+ "reaction_added",
1384
+ "reaction_removed",
1385
+ "member_joined_channel",
1386
+ "member_left_channel",
1387
+ "channel_rename",
1388
+ "pin_added",
1389
+ "pin_removed"
1390
+ ] }
1391
+ }
1392
+ };
1393
+ return JSON.stringify(manifest, null, 2);
1394
+ }
1395
+ async function noteSlackTokenHelp(prompter, botName) {
1396
+ const manifest = buildSlackManifest(botName);
1397
+ await prompter.note([
1398
+ "1) Slack API → Create App → From scratch",
1399
+ "2) Add Socket Mode + enable it to get the app-level token (xapp-...)",
1400
+ "3) OAuth & Permissions → install app to workspace (xoxb- bot token)",
1401
+ "4) Enable Event Subscriptions (socket) for message events",
1402
+ "5) App Home → enable the Messages tab for DMs",
1403
+ "Tip: set SLACK_BOT_TOKEN + SLACK_APP_TOKEN in your env.",
1404
+ `Docs: ${formatDocsLink("/slack", "slack")}`,
1405
+ "",
1406
+ "Manifest (JSON):",
1407
+ manifest
1408
+ ].join("\n"), "Slack socket mode tokens");
1409
+ }
1410
+ async function promptSlackTokens(prompter) {
1411
+ return {
1412
+ botToken: String(await prompter.text({
1413
+ message: "Enter Slack bot token (xoxb-...)",
1414
+ validate: (value) => value?.trim() ? void 0 : "Required"
1415
+ })).trim(),
1416
+ appToken: String(await prompter.text({
1417
+ message: "Enter Slack app token (xapp-...)",
1418
+ validate: (value) => value?.trim() ? void 0 : "Required"
1419
+ })).trim()
1420
+ };
1421
+ }
1422
+ function setSlackChannelAllowlist(cfg, accountId, channelKeys) {
1423
+ return patchChannelConfigForAccount({
1424
+ cfg,
1425
+ channel: "slack",
1426
+ accountId,
1427
+ patch: { channels: Object.fromEntries(channelKeys.map((key) => [key, { allow: true }])) }
1428
+ });
1429
+ }
1430
+ async function promptSlackAllowFrom(params) {
1431
+ const accountId = resolveOnboardingAccountId({
1432
+ accountId: params.accountId,
1433
+ defaultAccountId: resolveDefaultSlackAccountId(params.cfg)
1434
+ });
1435
+ const resolved = resolveSlackAccount({
1436
+ cfg: params.cfg,
1437
+ accountId
1438
+ });
1439
+ const token = resolved.config.userToken ?? resolved.config.botToken ?? "";
1440
+ const existing = params.cfg.channels?.slack?.allowFrom ?? params.cfg.channels?.slack?.dm?.allowFrom ?? [];
1441
+ const parseId = (value) => parseMentionOrPrefixedId({
1442
+ value,
1443
+ mentionPattern: /^<@([A-Z0-9]+)>$/i,
1444
+ prefixPattern: /^(slack:|user:)/i,
1445
+ idPattern: /^[A-Z][A-Z0-9]+$/i,
1446
+ normalizeId: (id) => id.toUpperCase()
1447
+ });
1448
+ return promptLegacyChannelAllowFrom({
1449
+ cfg: params.cfg,
1450
+ channel: "slack",
1451
+ prompter: params.prompter,
1452
+ existing,
1453
+ token,
1454
+ noteTitle: "Slack allowlist",
1455
+ noteLines: [
1456
+ "Allowlist Slack DMs by username (we resolve to user ids).",
1457
+ "Examples:",
1458
+ "- U12345678",
1459
+ "- @alice",
1460
+ "Multiple entries: comma-separated.",
1461
+ `Docs: ${formatDocsLink("/slack", "slack")}`
1462
+ ],
1463
+ message: "Slack allowFrom (usernames or ids)",
1464
+ placeholder: "@alice, U12345678",
1465
+ parseId,
1466
+ invalidWithoutTokenNote: "Slack token missing; use user ids (or mention form) only.",
1467
+ resolveEntries: ({ token, entries }) => resolveSlackUserAllowlist({
1468
+ token,
1469
+ entries
1470
+ })
1471
+ });
1472
+ }
1473
+ const dmPolicy$1 = {
1474
+ label: "Slack",
1475
+ channel: channel$2,
1476
+ policyKey: "channels.slack.dmPolicy",
1477
+ allowFromKey: "channels.slack.allowFrom",
1478
+ getCurrent: (cfg) => cfg.channels?.slack?.dmPolicy ?? cfg.channels?.slack?.dm?.policy ?? "pairing",
1479
+ setPolicy: (cfg, policy) => setLegacyChannelDmPolicyWithAllowFrom({
1480
+ cfg,
1481
+ channel: "slack",
1482
+ dmPolicy: policy
1483
+ }),
1484
+ promptAllowFrom: promptSlackAllowFrom
1485
+ };
1486
+ const slackOnboardingAdapter = {
1487
+ channel: channel$2,
1488
+ getStatus: async ({ cfg }) => {
1489
+ const configured = listSlackAccountIds(cfg).some((accountId) => {
1490
+ const account = resolveSlackAccount({
1491
+ cfg,
1492
+ accountId
1493
+ });
1494
+ return Boolean(account.botToken && account.appToken);
1495
+ });
1496
+ return {
1497
+ channel: channel$2,
1498
+ configured,
1499
+ statusLines: [`Slack: ${configured ? "configured" : "needs tokens"}`],
1500
+ selectionHint: configured ? "configured" : "needs tokens",
1501
+ quickstartScore: configured ? 2 : 1
1502
+ };
1503
+ },
1504
+ configure: async ({ cfg, prompter, accountOverrides, shouldPromptAccountIds }) => {
1505
+ const defaultSlackAccountId = resolveDefaultSlackAccountId(cfg);
1506
+ const slackAccountId = await resolveAccountIdForConfigure({
1507
+ cfg,
1508
+ prompter,
1509
+ label: "Slack",
1510
+ accountOverride: accountOverrides.slack,
1511
+ shouldPromptAccountIds,
1512
+ listAccountIds: listSlackAccountIds,
1513
+ defaultAccountId: defaultSlackAccountId
1514
+ });
1515
+ let next = cfg;
1516
+ const resolvedAccount = resolveSlackAccount({
1517
+ cfg: next,
1518
+ accountId: slackAccountId
1519
+ });
1520
+ const accountConfigured = Boolean(resolvedAccount.botToken && resolvedAccount.appToken);
1521
+ const canUseEnv = slackAccountId === DEFAULT_ACCOUNT_ID && Boolean(process.env.SLACK_BOT_TOKEN?.trim()) && Boolean(process.env.SLACK_APP_TOKEN?.trim());
1522
+ const hasConfigTokens = Boolean(resolvedAccount.config.botToken && resolvedAccount.config.appToken);
1523
+ let botToken = null;
1524
+ let appToken = null;
1525
+ const slackBotName = String(await prompter.text({
1526
+ message: "Slack bot display name (used for manifest)",
1527
+ initialValue: "RemoteClaw"
1528
+ })).trim();
1529
+ if (!accountConfigured) await noteSlackTokenHelp(prompter, slackBotName);
1530
+ if (canUseEnv && (!resolvedAccount.config.botToken || !resolvedAccount.config.appToken)) if (await prompter.confirm({
1531
+ message: "SLACK_BOT_TOKEN + SLACK_APP_TOKEN detected. Use env vars?",
1532
+ initialValue: true
1533
+ })) next = patchChannelConfigForAccount({
1534
+ cfg: next,
1535
+ channel: "slack",
1536
+ accountId: slackAccountId,
1537
+ patch: {}
1538
+ });
1539
+ else ({botToken, appToken} = await promptSlackTokens(prompter));
1540
+ else if (hasConfigTokens) {
1541
+ if (!await prompter.confirm({
1542
+ message: "Slack tokens already configured. Keep them?",
1543
+ initialValue: true
1544
+ })) ({botToken, appToken} = await promptSlackTokens(prompter));
1545
+ } else ({botToken, appToken} = await promptSlackTokens(prompter));
1546
+ if (botToken && appToken) next = patchChannelConfigForAccount({
1547
+ cfg: next,
1548
+ channel: "slack",
1549
+ accountId: slackAccountId,
1550
+ patch: {
1551
+ botToken,
1552
+ appToken
1553
+ }
1554
+ });
1555
+ next = await configureChannelAccessWithAllowlist({
1556
+ cfg: next,
1557
+ prompter,
1558
+ label: "Slack channels",
1559
+ currentPolicy: resolvedAccount.config.groupPolicy ?? "allowlist",
1560
+ currentEntries: Object.entries(resolvedAccount.config.channels ?? {}).filter(([, value]) => value?.allow !== false && value?.enabled !== false).map(([key]) => key),
1561
+ placeholder: "#general, #private, C123",
1562
+ updatePrompt: Boolean(resolvedAccount.config.channels),
1563
+ setPolicy: (cfg, policy) => setAccountGroupPolicyForChannel({
1564
+ cfg,
1565
+ channel: "slack",
1566
+ accountId: slackAccountId,
1567
+ groupPolicy: policy
1568
+ }),
1569
+ resolveAllowlist: async ({ cfg, entries }) => {
1570
+ let keys = entries;
1571
+ const accountWithTokens = resolveSlackAccount({
1572
+ cfg,
1573
+ accountId: slackAccountId
1574
+ });
1575
+ if (accountWithTokens.botToken && entries.length > 0) try {
1576
+ const resolved = await resolveSlackChannelAllowlist({
1577
+ token: accountWithTokens.botToken,
1578
+ entries
1579
+ });
1580
+ const resolvedKeys = resolved.filter((entry) => entry.resolved && entry.id).map((entry) => entry.id);
1581
+ const unresolved = resolved.filter((entry) => !entry.resolved).map((entry) => entry.input);
1582
+ keys = [...resolvedKeys, ...unresolved.map((entry) => entry.trim()).filter(Boolean)];
1583
+ await noteChannelLookupSummary({
1584
+ prompter,
1585
+ label: "Slack channels",
1586
+ resolvedSections: [{
1587
+ title: "Resolved",
1588
+ values: resolvedKeys
1589
+ }],
1590
+ unresolved
1591
+ });
1592
+ } catch (err) {
1593
+ await noteChannelLookupFailure({
1594
+ prompter,
1595
+ label: "Slack channels",
1596
+ error: err
1597
+ });
1598
+ }
1599
+ return keys;
1600
+ },
1601
+ applyAllowlist: ({ cfg, resolved }) => {
1602
+ return setSlackChannelAllowlist(cfg, slackAccountId, resolved);
1603
+ }
1604
+ });
1605
+ return {
1606
+ cfg: next,
1607
+ accountId: slackAccountId
1608
+ };
1609
+ },
1610
+ dmPolicy: dmPolicy$1,
1611
+ disable: (cfg) => setOnboardingChannelEnabled(cfg, channel$2, false)
1612
+ };
1613
+
1614
+ //#endregion
1615
+ //#region src/channels/plugins/onboarding/telegram.ts
1616
+ const channel$1 = "telegram";
1617
+ async function noteTelegramTokenHelp(prompter) {
1618
+ await prompter.note([
1619
+ "1) Open Telegram and chat with @BotFather",
1620
+ "2) Run /newbot (or /mybots)",
1621
+ "3) Copy the token (looks like 123456:ABC...)",
1622
+ "Tip: you can also set TELEGRAM_BOT_TOKEN in your env.",
1623
+ `Docs: ${formatDocsLink("/telegram")}`,
1624
+ "Website: https://remoteclaw.org"
1625
+ ].join("\n"), "Telegram bot token");
1626
+ }
1627
+ async function noteTelegramUserIdHelp(prompter) {
1628
+ await prompter.note([
1629
+ `1) DM your bot, then read from.id in \`${formatCliCommand("remoteclaw logs --follow")}\` (safest)`,
1630
+ "2) Or call https://api.telegram.org/bot<bot_token>/getUpdates and read message.from.id",
1631
+ "3) Third-party: DM @userinfobot or @getidsbot",
1632
+ `Docs: ${formatDocsLink("/telegram")}`,
1633
+ "Website: https://remoteclaw.org"
1634
+ ].join("\n"), "Telegram user id");
1635
+ }
1636
+ function normalizeTelegramAllowFromInput(raw) {
1637
+ return raw.trim().replace(/^(telegram|tg):/i, "").trim();
1638
+ }
1639
+ function parseTelegramAllowFromId(raw) {
1640
+ const stripped = normalizeTelegramAllowFromInput(raw);
1641
+ return /^\d+$/.test(stripped) ? stripped : null;
1642
+ }
1643
+ async function promptTelegramAllowFrom(params) {
1644
+ const { cfg, prompter, accountId } = params;
1645
+ const resolved = resolveTelegramAccount({
1646
+ cfg,
1647
+ accountId
1648
+ });
1649
+ const existingAllowFrom = resolved.config.allowFrom ?? [];
1650
+ await noteTelegramUserIdHelp(prompter);
1651
+ const token = resolved.token;
1652
+ if (!token) await prompter.note("Telegram token missing; username lookup is unavailable.", "Telegram");
1653
+ return patchChannelConfigForAccount({
1654
+ cfg,
1655
+ channel: "telegram",
1656
+ accountId,
1657
+ patch: {
1658
+ dmPolicy: "allowlist",
1659
+ allowFrom: await promptResolvedAllowFrom({
1660
+ prompter,
1661
+ existing: existingAllowFrom,
1662
+ token,
1663
+ message: "Telegram allowFrom (numeric sender id; @username resolves to id)",
1664
+ placeholder: "@username",
1665
+ label: "Telegram allowlist",
1666
+ parseInputs: splitOnboardingEntries,
1667
+ parseId: parseTelegramAllowFromId,
1668
+ invalidWithoutTokenNote: "Telegram token missing; use numeric sender ids (usernames require a bot token).",
1669
+ resolveEntries: async ({ token: tokenValue, entries }) => {
1670
+ return await Promise.all(entries.map(async (entry) => {
1671
+ const numericId = parseTelegramAllowFromId(entry);
1672
+ if (numericId) return {
1673
+ input: entry,
1674
+ resolved: true,
1675
+ id: numericId
1676
+ };
1677
+ const stripped = normalizeTelegramAllowFromInput(entry);
1678
+ if (!stripped) return {
1679
+ input: entry,
1680
+ resolved: false,
1681
+ id: null
1682
+ };
1683
+ const id = await fetchTelegramChatId({
1684
+ token: tokenValue,
1685
+ chatId: stripped.startsWith("@") ? stripped : `@${stripped}`
1686
+ });
1687
+ return {
1688
+ input: entry,
1689
+ resolved: Boolean(id),
1690
+ id
1691
+ };
1692
+ }));
1693
+ }
1694
+ })
1695
+ }
1696
+ });
1697
+ }
1698
+ async function promptTelegramAllowFromForAccount(params) {
1699
+ const accountId = resolveOnboardingAccountId({
1700
+ accountId: params.accountId,
1701
+ defaultAccountId: resolveDefaultTelegramAccountId(params.cfg)
1702
+ });
1703
+ return promptTelegramAllowFrom({
1704
+ cfg: params.cfg,
1705
+ prompter: params.prompter,
1706
+ accountId
1707
+ });
1708
+ }
1709
+ const dmPolicy = {
1710
+ label: "Telegram",
1711
+ channel: channel$1,
1712
+ policyKey: "channels.telegram.dmPolicy",
1713
+ allowFromKey: "channels.telegram.allowFrom",
1714
+ getCurrent: (cfg) => cfg.channels?.telegram?.dmPolicy ?? "pairing",
1715
+ setPolicy: (cfg, policy) => setChannelDmPolicyWithAllowFrom({
1716
+ cfg,
1717
+ channel: "telegram",
1718
+ dmPolicy: policy
1719
+ }),
1720
+ promptAllowFrom: promptTelegramAllowFromForAccount
1721
+ };
1722
+ const telegramOnboardingAdapter = {
1723
+ channel: channel$1,
1724
+ getStatus: async ({ cfg }) => {
1725
+ const configured = listTelegramAccountIds(cfg).some((accountId) => Boolean(resolveTelegramAccount({
1726
+ cfg,
1727
+ accountId
1728
+ }).token));
1729
+ return {
1730
+ channel: channel$1,
1731
+ configured,
1732
+ statusLines: [`Telegram: ${configured ? "configured" : "needs token"}`],
1733
+ selectionHint: configured ? "recommended · configured" : "recommended · newcomer-friendly",
1734
+ quickstartScore: configured ? 1 : 10
1735
+ };
1736
+ },
1737
+ configure: async ({ cfg, prompter, accountOverrides, shouldPromptAccountIds, forceAllowFrom }) => {
1738
+ const defaultTelegramAccountId = resolveDefaultTelegramAccountId(cfg);
1739
+ const telegramAccountId = await resolveAccountIdForConfigure({
1740
+ cfg,
1741
+ prompter,
1742
+ label: "Telegram",
1743
+ accountOverride: accountOverrides.telegram,
1744
+ shouldPromptAccountIds,
1745
+ listAccountIds: listTelegramAccountIds,
1746
+ defaultAccountId: defaultTelegramAccountId
1747
+ });
1748
+ let next = cfg;
1749
+ const resolvedAccount = resolveTelegramAccount({
1750
+ cfg: next,
1751
+ accountId: telegramAccountId
1752
+ });
1753
+ const accountConfigured = Boolean(resolvedAccount.token);
1754
+ const canUseEnv = telegramAccountId === DEFAULT_ACCOUNT_ID && !resolvedAccount.config.botToken && Boolean(process.env.TELEGRAM_BOT_TOKEN?.trim());
1755
+ const hasConfigToken = Boolean(resolvedAccount.config.botToken || resolvedAccount.config.tokenFile);
1756
+ if (!accountConfigured) await noteTelegramTokenHelp(prompter);
1757
+ const tokenResult = await promptSingleChannelToken({
1758
+ prompter,
1759
+ accountConfigured,
1760
+ canUseEnv,
1761
+ hasConfigToken,
1762
+ envPrompt: "TELEGRAM_BOT_TOKEN detected. Use env var?",
1763
+ keepPrompt: "Telegram token already configured. Keep it?",
1764
+ inputPrompt: "Enter Telegram bot token"
1765
+ });
1766
+ next = applySingleTokenPromptResult({
1767
+ cfg: next,
1768
+ channel: "telegram",
1769
+ accountId: telegramAccountId,
1770
+ tokenPatchKey: "botToken",
1771
+ tokenResult
1772
+ });
1773
+ if (forceAllowFrom) next = await promptTelegramAllowFrom({
1774
+ cfg: next,
1775
+ prompter,
1776
+ accountId: telegramAccountId
1777
+ });
1778
+ return {
1779
+ cfg: next,
1780
+ accountId: telegramAccountId
1781
+ };
1782
+ },
1783
+ dmPolicy,
1784
+ disable: (cfg) => setOnboardingChannelEnabled(cfg, channel$1, false)
1785
+ };
1786
+
1787
+ //#endregion
1788
+ //#region src/config/merge-config.ts
1789
+ function mergeConfigSection(base, patch, options = {}) {
1790
+ const next = { ...base ?? void 0 };
1791
+ for (const [key, value] of Object.entries(patch)) {
1792
+ if (value === void 0) {
1793
+ if (options.unsetOnUndefined?.includes(key)) delete next[key];
1794
+ continue;
1795
+ }
1796
+ next[key] = value;
1797
+ }
1798
+ return next;
1799
+ }
1800
+ function mergeWhatsAppConfig(cfg, patch, options) {
1801
+ return {
1802
+ ...cfg,
1803
+ channels: {
1804
+ ...cfg.channels,
1805
+ whatsapp: mergeConfigSection(cfg.channels?.whatsapp, patch, options)
1806
+ }
1807
+ };
1808
+ }
1809
+
1810
+ //#endregion
1811
+ //#region src/channels/plugins/onboarding/whatsapp.ts
1812
+ const channel = "whatsapp";
1813
+ function setWhatsAppDmPolicy(cfg, dmPolicy) {
1814
+ return mergeWhatsAppConfig(cfg, { dmPolicy });
1815
+ }
1816
+ function setWhatsAppAllowFrom(cfg, allowFrom) {
1817
+ return mergeWhatsAppConfig(cfg, { allowFrom }, { unsetOnUndefined: ["allowFrom"] });
1818
+ }
1819
+ function setWhatsAppSelfChatMode(cfg, selfChatMode) {
1820
+ return mergeWhatsAppConfig(cfg, { selfChatMode });
1821
+ }
1822
+ async function detectWhatsAppLinked(cfg, accountId) {
1823
+ const { authDir } = resolveWhatsAppAuthDir({
1824
+ cfg,
1825
+ accountId
1826
+ });
1827
+ return await pathExists(path.join(authDir, "creds.json"));
1828
+ }
1829
+ async function promptWhatsAppOwnerAllowFrom(params) {
1830
+ const { prompter, existingAllowFrom } = params;
1831
+ await prompter.note("We need the sender/owner number so RemoteClaw can allowlist you.", "WhatsApp number");
1832
+ const entry = await prompter.text({
1833
+ message: "Your personal WhatsApp number (the phone you will message from)",
1834
+ placeholder: "+15555550123",
1835
+ initialValue: existingAllowFrom[0],
1836
+ validate: (value) => {
1837
+ const raw = String(value ?? "").trim();
1838
+ if (!raw) return "Required";
1839
+ if (!normalizeE164(raw)) return `Invalid number: ${raw}`;
1840
+ }
1841
+ });
1842
+ const normalized = normalizeE164(String(entry).trim());
1843
+ if (!normalized) throw new Error("Invalid WhatsApp owner number (expected E.164 after validation).");
1844
+ return {
1845
+ normalized,
1846
+ allowFrom: normalizeAllowFromEntries([...existingAllowFrom.filter((item) => item !== "*"), normalized], normalizeE164)
1847
+ };
1848
+ }
1849
+ async function applyWhatsAppOwnerAllowlist(params) {
1850
+ const { normalized, allowFrom } = await promptWhatsAppOwnerAllowFrom({
1851
+ prompter: params.prompter,
1852
+ existingAllowFrom: params.existingAllowFrom
1853
+ });
1854
+ let next = setWhatsAppSelfChatMode(params.cfg, true);
1855
+ next = setWhatsAppDmPolicy(next, "allowlist");
1856
+ next = setWhatsAppAllowFrom(next, allowFrom);
1857
+ await params.prompter.note([...params.messageLines, `- allowFrom includes ${normalized}`].join("\n"), params.title);
1858
+ return next;
1859
+ }
1860
+ function parseWhatsAppAllowFromEntries(raw) {
1861
+ const parts = splitOnboardingEntries(raw);
1862
+ if (parts.length === 0) return { entries: [] };
1863
+ const entries = [];
1864
+ for (const part of parts) {
1865
+ if (part === "*") {
1866
+ entries.push("*");
1867
+ continue;
1868
+ }
1869
+ const normalized = normalizeE164(part);
1870
+ if (!normalized) return {
1871
+ entries: [],
1872
+ invalidEntry: part
1873
+ };
1874
+ entries.push(normalized);
1875
+ }
1876
+ return { entries: normalizeAllowFromEntries(entries, normalizeE164) };
1877
+ }
1878
+ async function promptWhatsAppAllowFrom(cfg, _runtime, prompter, options) {
1879
+ const existingPolicy = cfg.channels?.whatsapp?.dmPolicy ?? "pairing";
1880
+ const existingAllowFrom = cfg.channels?.whatsapp?.allowFrom ?? [];
1881
+ const existingLabel = existingAllowFrom.length > 0 ? existingAllowFrom.join(", ") : "unset";
1882
+ if (options?.forceAllowlist) return await applyWhatsAppOwnerAllowlist({
1883
+ cfg,
1884
+ prompter,
1885
+ existingAllowFrom,
1886
+ title: "WhatsApp allowlist",
1887
+ messageLines: ["Allowlist mode enabled."]
1888
+ });
1889
+ await prompter.note([
1890
+ "WhatsApp direct chats are gated by `channels.whatsapp.dmPolicy` + `channels.whatsapp.allowFrom`.",
1891
+ "- pairing (default): unknown senders get a pairing code; owner approves",
1892
+ "- allowlist: unknown senders are blocked",
1893
+ "- open: public inbound DMs (requires allowFrom to include \"*\")",
1894
+ "- disabled: ignore WhatsApp DMs",
1895
+ "",
1896
+ `Current: dmPolicy=${existingPolicy}, allowFrom=${existingLabel}`,
1897
+ `Docs: ${formatDocsLink("/whatsapp", "whatsapp")}`
1898
+ ].join("\n"), "WhatsApp DM access");
1899
+ if (await prompter.select({
1900
+ message: "WhatsApp phone setup",
1901
+ options: [{
1902
+ value: "personal",
1903
+ label: "This is my personal phone number"
1904
+ }, {
1905
+ value: "separate",
1906
+ label: "Separate phone just for RemoteClaw"
1907
+ }]
1908
+ }) === "personal") return await applyWhatsAppOwnerAllowlist({
1909
+ cfg,
1910
+ prompter,
1911
+ existingAllowFrom,
1912
+ title: "WhatsApp personal phone",
1913
+ messageLines: ["Personal phone mode enabled.", "- dmPolicy set to allowlist (pairing skipped)"]
1914
+ });
1915
+ const policy = await prompter.select({
1916
+ message: "WhatsApp DM policy",
1917
+ options: [
1918
+ {
1919
+ value: "pairing",
1920
+ label: "Pairing (recommended)"
1921
+ },
1922
+ {
1923
+ value: "allowlist",
1924
+ label: "Allowlist only (block unknown senders)"
1925
+ },
1926
+ {
1927
+ value: "open",
1928
+ label: "Open (public inbound DMs)"
1929
+ },
1930
+ {
1931
+ value: "disabled",
1932
+ label: "Disabled (ignore WhatsApp DMs)"
1933
+ }
1934
+ ]
1935
+ });
1936
+ let next = setWhatsAppSelfChatMode(cfg, false);
1937
+ next = setWhatsAppDmPolicy(next, policy);
1938
+ if (policy === "open") {
1939
+ const allowFrom = normalizeAllowFromEntries(["*", ...existingAllowFrom], normalizeE164);
1940
+ next = setWhatsAppAllowFrom(next, allowFrom.length > 0 ? allowFrom : ["*"]);
1941
+ return next;
1942
+ }
1943
+ if (policy === "disabled") return next;
1944
+ const allowOptions = existingAllowFrom.length > 0 ? [
1945
+ {
1946
+ value: "keep",
1947
+ label: "Keep current allowFrom"
1948
+ },
1949
+ {
1950
+ value: "unset",
1951
+ label: "Unset allowFrom (use pairing approvals only)"
1952
+ },
1953
+ {
1954
+ value: "list",
1955
+ label: "Set allowFrom to specific numbers"
1956
+ }
1957
+ ] : [{
1958
+ value: "unset",
1959
+ label: "Unset allowFrom (default)"
1960
+ }, {
1961
+ value: "list",
1962
+ label: "Set allowFrom to specific numbers"
1963
+ }];
1964
+ const mode = await prompter.select({
1965
+ message: "WhatsApp allowFrom (optional pre-allowlist)",
1966
+ options: allowOptions.map((opt) => ({
1967
+ value: opt.value,
1968
+ label: opt.label
1969
+ }))
1970
+ });
1971
+ if (mode === "keep") {} else if (mode === "unset") next = setWhatsAppAllowFrom(next, void 0);
1972
+ else {
1973
+ const allowRaw = await prompter.text({
1974
+ message: "Allowed sender numbers (comma-separated, E.164)",
1975
+ placeholder: "+15555550123, +447700900123",
1976
+ validate: (value) => {
1977
+ const raw = String(value ?? "").trim();
1978
+ if (!raw) return "Required";
1979
+ const parsed = parseWhatsAppAllowFromEntries(raw);
1980
+ if (parsed.entries.length === 0 && !parsed.invalidEntry) return "Required";
1981
+ if (parsed.invalidEntry) return `Invalid number: ${parsed.invalidEntry}`;
1982
+ }
1983
+ });
1984
+ const parsed = parseWhatsAppAllowFromEntries(String(allowRaw));
1985
+ next = setWhatsAppAllowFrom(next, parsed.entries);
1986
+ }
1987
+ return next;
1988
+ }
1989
+ const whatsappOnboardingAdapter = {
1990
+ channel,
1991
+ getStatus: async ({ cfg, accountOverrides }) => {
1992
+ const defaultAccountId = resolveDefaultWhatsAppAccountId(cfg);
1993
+ const accountId = resolveOnboardingAccountId({
1994
+ accountId: accountOverrides.whatsapp,
1995
+ defaultAccountId
1996
+ });
1997
+ const linked = await detectWhatsAppLinked(cfg, accountId);
1998
+ return {
1999
+ channel,
2000
+ configured: linked,
2001
+ statusLines: [`WhatsApp (${accountId === DEFAULT_ACCOUNT_ID ? "default" : accountId}): ${linked ? "linked" : "not linked"}`],
2002
+ selectionHint: linked ? "linked" : "not linked",
2003
+ quickstartScore: linked ? 5 : 4
2004
+ };
2005
+ },
2006
+ configure: async ({ cfg, runtime, prompter, options, accountOverrides, shouldPromptAccountIds, forceAllowFrom }) => {
2007
+ const accountId = await resolveAccountIdForConfigure({
2008
+ cfg,
2009
+ prompter,
2010
+ label: "WhatsApp",
2011
+ accountOverride: accountOverrides.whatsapp,
2012
+ shouldPromptAccountIds: Boolean(shouldPromptAccountIds || options?.promptWhatsAppAccountId),
2013
+ listAccountIds: listWhatsAppAccountIds,
2014
+ defaultAccountId: resolveDefaultWhatsAppAccountId(cfg)
2015
+ });
2016
+ let next = cfg;
2017
+ if (accountId !== DEFAULT_ACCOUNT_ID) next = {
2018
+ ...next,
2019
+ channels: {
2020
+ ...next.channels,
2021
+ whatsapp: {
2022
+ ...next.channels?.whatsapp,
2023
+ accounts: {
2024
+ ...next.channels?.whatsapp?.accounts,
2025
+ [accountId]: {
2026
+ ...next.channels?.whatsapp?.accounts?.[accountId],
2027
+ enabled: next.channels?.whatsapp?.accounts?.[accountId]?.enabled ?? true
2028
+ }
2029
+ }
2030
+ }
2031
+ }
2032
+ };
2033
+ const linked = await detectWhatsAppLinked(next, accountId);
2034
+ const { authDir } = resolveWhatsAppAuthDir({
2035
+ cfg: next,
2036
+ accountId
2037
+ });
2038
+ if (!linked) await prompter.note([
2039
+ "Scan the QR with WhatsApp on your phone.",
2040
+ `Credentials are stored under ${authDir}/ for future runs.`,
2041
+ `Docs: ${formatDocsLink("/whatsapp", "whatsapp")}`
2042
+ ].join("\n"), "WhatsApp linking");
2043
+ if (await prompter.confirm({
2044
+ message: linked ? "WhatsApp already linked. Re-link now?" : "Link WhatsApp now (QR)?",
2045
+ initialValue: !linked
2046
+ })) try {
2047
+ await loginWeb(false, void 0, runtime, accountId);
2048
+ } catch (err) {
2049
+ runtime.error(`WhatsApp login failed: ${String(err)}`);
2050
+ await prompter.note(`Docs: ${formatDocsLink("/whatsapp", "whatsapp")}`, "WhatsApp help");
2051
+ }
2052
+ else if (!linked) await prompter.note(`Run \`${formatCliCommand("remoteclaw channels login")}\` later to link WhatsApp.`, "WhatsApp");
2053
+ next = await promptWhatsAppAllowFrom(next, runtime, prompter, { forceAllowlist: forceAllowFrom });
2054
+ return {
2055
+ cfg: next,
2056
+ accountId
2057
+ };
2058
+ },
2059
+ onAccountRecorded: (accountId, options) => {
2060
+ options?.onWhatsAppAccountId?.(accountId);
2061
+ }
2062
+ };
2063
+
2064
+ //#endregion
2065
+ //#region src/commands/onboarding/registry.ts
2066
+ const BUILTIN_ONBOARDING_ADAPTERS = [
2067
+ telegramOnboardingAdapter,
2068
+ whatsappOnboardingAdapter,
2069
+ discordOnboardingAdapter,
2070
+ slackOnboardingAdapter,
2071
+ signalOnboardingAdapter,
2072
+ imessageOnboardingAdapter
2073
+ ];
2074
+ const CHANNEL_ONBOARDING_ADAPTERS = () => {
2075
+ const fromRegistry = listChannelPlugins().map((plugin) => plugin.onboarding ? [plugin.id, plugin.onboarding] : null).filter((entry) => Boolean(entry));
2076
+ const fromBuiltins = BUILTIN_ONBOARDING_ADAPTERS.map((adapter) => [adapter.channel, adapter]);
2077
+ return new Map([...fromBuiltins, ...fromRegistry]);
2078
+ };
2079
+ function getChannelOnboardingAdapter(channel) {
2080
+ return CHANNEL_ONBOARDING_ADAPTERS().get(channel);
2081
+ }
2082
+ function listChannelOnboardingAdapters() {
2083
+ return Array.from(CHANNEL_ONBOARDING_ADAPTERS().values());
2084
+ }
2085
+
2086
+ //#endregion
2087
+ //#region src/commands/onboard-channels.ts
2088
+ var onboard_channels_exports = /* @__PURE__ */ __exportAll({
2089
+ noteChannelStatus: () => noteChannelStatus,
2090
+ setupChannels: () => setupChannels
2091
+ });
2092
+ function formatAccountLabel(accountId) {
2093
+ return accountId === DEFAULT_ACCOUNT_ID ? "default (primary)" : accountId;
2094
+ }
2095
+ async function promptConfiguredAction(params) {
2096
+ const { prompter, label, supportsDisable, supportsDelete } = params;
2097
+ const updateOption = {
2098
+ value: "update",
2099
+ label: "Modify settings"
2100
+ };
2101
+ const disableOption = {
2102
+ value: "disable",
2103
+ label: "Disable (keeps config)"
2104
+ };
2105
+ const deleteOption = {
2106
+ value: "delete",
2107
+ label: "Delete config"
2108
+ };
2109
+ const skipOption = {
2110
+ value: "skip",
2111
+ label: "Skip (leave as-is)"
2112
+ };
2113
+ const options = [
2114
+ updateOption,
2115
+ ...supportsDisable ? [disableOption] : [],
2116
+ ...supportsDelete ? [deleteOption] : [],
2117
+ skipOption
2118
+ ];
2119
+ return await prompter.select({
2120
+ message: `${label} already configured. What do you want to do?`,
2121
+ options,
2122
+ initialValue: "update"
2123
+ });
2124
+ }
2125
+ async function promptRemovalAccountId(params) {
2126
+ const { cfg, prompter, label, channel } = params;
2127
+ const plugin = getChannelPlugin(channel);
2128
+ if (!plugin) return DEFAULT_ACCOUNT_ID;
2129
+ const accountIds = plugin.config.listAccountIds(cfg).filter(Boolean);
2130
+ const defaultAccountId = resolveChannelDefaultAccountId({
2131
+ plugin,
2132
+ cfg,
2133
+ accountIds
2134
+ });
2135
+ if (accountIds.length <= 1) return defaultAccountId;
2136
+ return normalizeAccountId(await prompter.select({
2137
+ message: `${label} account`,
2138
+ options: accountIds.map((accountId) => ({
2139
+ value: accountId,
2140
+ label: formatAccountLabel(accountId)
2141
+ })),
2142
+ initialValue: defaultAccountId
2143
+ })) ?? defaultAccountId;
2144
+ }
2145
+ async function collectChannelStatus(params) {
2146
+ const installedPlugins = listChannelPlugins();
2147
+ const installedIds = new Set(installedPlugins.map((plugin) => plugin.id));
2148
+ const catalogEntries = listChannelPluginCatalogEntries({ workspaceDir: resolveAgentWorkspaceDir(params.cfg, resolveDefaultAgentId(params.cfg)) }).filter((entry) => !installedIds.has(entry.id));
2149
+ const statusEntries = await Promise.all(listChannelOnboardingAdapters().map((adapter) => adapter.getStatus({
2150
+ cfg: params.cfg,
2151
+ options: params.options,
2152
+ accountOverrides: params.accountOverrides
2153
+ })));
2154
+ const statusByChannel = new Map(statusEntries.map((entry) => [entry.channel, entry]));
2155
+ const fallbackStatuses = listChatChannels().filter((meta) => !statusByChannel.has(meta.id)).map((meta) => {
2156
+ const configured = isChannelConfigured(params.cfg, meta.id);
2157
+ const statusLabel = configured ? "configured (plugin disabled)" : "not configured";
2158
+ return {
2159
+ channel: meta.id,
2160
+ configured,
2161
+ statusLines: [`${meta.label}: ${statusLabel}`],
2162
+ selectionHint: configured ? "configured · plugin disabled" : "not configured",
2163
+ quickstartScore: 0
2164
+ };
2165
+ });
2166
+ const catalogStatuses = catalogEntries.map((entry) => ({
2167
+ channel: entry.id,
2168
+ configured: false,
2169
+ statusLines: [`${entry.meta.label}: install plugin to enable`],
2170
+ selectionHint: "plugin · install",
2171
+ quickstartScore: 0
2172
+ }));
2173
+ const combinedStatuses = [
2174
+ ...statusEntries,
2175
+ ...fallbackStatuses,
2176
+ ...catalogStatuses
2177
+ ];
2178
+ return {
2179
+ installedPlugins,
2180
+ catalogEntries,
2181
+ statusByChannel: new Map(combinedStatuses.map((entry) => [entry.channel, entry])),
2182
+ statusLines: combinedStatuses.flatMap((entry) => entry.statusLines)
2183
+ };
2184
+ }
2185
+ async function noteChannelStatus(params) {
2186
+ const { statusLines } = await collectChannelStatus({
2187
+ cfg: params.cfg,
2188
+ options: params.options,
2189
+ accountOverrides: params.accountOverrides ?? {}
2190
+ });
2191
+ if (statusLines.length > 0) await params.prompter.note(statusLines.join("\n"), "Channel status");
2192
+ }
2193
+ async function noteChannelPrimer(prompter, channels) {
2194
+ const channelLines = channels.map((channel) => formatChannelPrimerLine({
2195
+ id: channel.id,
2196
+ label: channel.label,
2197
+ selectionLabel: channel.label,
2198
+ docsPath: "/",
2199
+ blurb: channel.blurb
2200
+ }));
2201
+ await prompter.note([
2202
+ "DM security: default is pairing; unknown DMs get a pairing code.",
2203
+ `Approve with: ${formatCliCommand("remoteclaw pairing approve <channel> <code>")}`,
2204
+ "Public DMs require dmPolicy=\"open\" + allowFrom=[\"*\"].",
2205
+ "Multi-user DMs: run: " + formatCliCommand("remoteclaw config set session.dmScope \"per-channel-peer\"") + " (or \"per-account-channel-peer\" for multi-account channels) to isolate sessions.",
2206
+ `Docs: ${formatDocsLink("/channels/pairing", "channels/pairing")}`,
2207
+ "",
2208
+ ...channelLines
2209
+ ].join("\n"), "How channels work");
2210
+ }
2211
+ function resolveQuickstartDefault(statusByChannel) {
2212
+ let best = null;
2213
+ for (const [channel, status] of statusByChannel) {
2214
+ if (status.quickstartScore == null) continue;
2215
+ if (!best || status.quickstartScore > best.score) best = {
2216
+ channel,
2217
+ score: status.quickstartScore
2218
+ };
2219
+ }
2220
+ return best?.channel;
2221
+ }
2222
+ async function maybeConfigureDmPolicies(params) {
2223
+ const { selection, prompter, accountIdsByChannel } = params;
2224
+ const dmPolicies = selection.map((channel) => getChannelOnboardingAdapter(channel)?.dmPolicy).filter(Boolean);
2225
+ if (dmPolicies.length === 0) return params.cfg;
2226
+ if (!await prompter.confirm({
2227
+ message: "Configure DM access policies now? (default: pairing)",
2228
+ initialValue: false
2229
+ })) return params.cfg;
2230
+ let cfg = params.cfg;
2231
+ const selectPolicy = async (policy) => {
2232
+ await prompter.note([
2233
+ "Default: pairing (unknown DMs get a pairing code).",
2234
+ `Approve: ${formatCliCommand(`remoteclaw pairing approve ${policy.channel} <code>`)}`,
2235
+ `Allowlist DMs: ${policy.policyKey}="allowlist" + ${policy.allowFromKey} entries.`,
2236
+ `Public DMs: ${policy.policyKey}="open" + ${policy.allowFromKey} includes "*".`,
2237
+ "Multi-user DMs: run: " + formatCliCommand("remoteclaw config set session.dmScope \"per-channel-peer\"") + " (or \"per-account-channel-peer\" for multi-account channels) to isolate sessions.",
2238
+ `Docs: ${formatDocsLink("/channels/pairing", "channels/pairing")}`
2239
+ ].join("\n"), `${policy.label} DM access`);
2240
+ return await prompter.select({
2241
+ message: `${policy.label} DM policy`,
2242
+ options: [
2243
+ {
2244
+ value: "pairing",
2245
+ label: "Pairing (recommended)"
2246
+ },
2247
+ {
2248
+ value: "allowlist",
2249
+ label: "Allowlist (specific users only)"
2250
+ },
2251
+ {
2252
+ value: "open",
2253
+ label: "Open (public inbound DMs)"
2254
+ },
2255
+ {
2256
+ value: "disabled",
2257
+ label: "Disabled (ignore DMs)"
2258
+ }
2259
+ ]
2260
+ });
2261
+ };
2262
+ for (const policy of dmPolicies) {
2263
+ const current = policy.getCurrent(cfg);
2264
+ const nextPolicy = await selectPolicy(policy);
2265
+ if (nextPolicy !== current) cfg = policy.setPolicy(cfg, nextPolicy);
2266
+ if (nextPolicy === "allowlist" && policy.promptAllowFrom) cfg = await policy.promptAllowFrom({
2267
+ cfg,
2268
+ prompter,
2269
+ accountId: accountIdsByChannel?.get(policy.channel)
2270
+ });
2271
+ }
2272
+ return cfg;
2273
+ }
2274
+ async function setupChannels(cfg, runtime, prompter, options) {
2275
+ let next = cfg;
2276
+ const forceAllowFromChannels = new Set(options?.forceAllowFromChannels ?? []);
2277
+ const accountOverrides = { ...options?.accountIds };
2278
+ if (options?.whatsappAccountId?.trim()) accountOverrides.whatsapp = options.whatsappAccountId.trim();
2279
+ const { installedPlugins, catalogEntries, statusByChannel, statusLines } = await collectChannelStatus({
2280
+ cfg: next,
2281
+ options,
2282
+ accountOverrides
2283
+ });
2284
+ if (!options?.skipStatusNote && statusLines.length > 0) await prompter.note(statusLines.join("\n"), "Channel status");
2285
+ if (!(options?.skipConfirm ? true : await prompter.confirm({
2286
+ message: "Configure chat channels now?",
2287
+ initialValue: true
2288
+ }))) return cfg;
2289
+ const corePrimer = listChatChannels().map((meta) => ({
2290
+ id: meta.id,
2291
+ label: meta.label,
2292
+ blurb: meta.blurb
2293
+ }));
2294
+ const coreIds = new Set(corePrimer.map((entry) => entry.id));
2295
+ await noteChannelPrimer(prompter, [
2296
+ ...corePrimer,
2297
+ ...installedPlugins.filter((plugin) => !coreIds.has(plugin.id)).map((plugin) => ({
2298
+ id: plugin.id,
2299
+ label: plugin.meta.label,
2300
+ blurb: plugin.meta.blurb
2301
+ })),
2302
+ ...catalogEntries.filter((entry) => !coreIds.has(entry.id)).map((entry) => ({
2303
+ id: entry.id,
2304
+ label: entry.meta.label,
2305
+ blurb: entry.meta.blurb
2306
+ }))
2307
+ ]);
2308
+ const quickstartDefault = options?.initialSelection?.[0] ?? resolveQuickstartDefault(statusByChannel);
2309
+ const shouldPromptAccountIds = options?.promptAccountIds === true;
2310
+ const accountIdsByChannel = /* @__PURE__ */ new Map();
2311
+ const recordAccount = (channel, accountId) => {
2312
+ options?.onAccountId?.(channel, accountId);
2313
+ getChannelOnboardingAdapter(channel)?.onAccountRecorded?.(accountId, options);
2314
+ accountIdsByChannel.set(channel, accountId);
2315
+ };
2316
+ const selection = [];
2317
+ const addSelection = (channel) => {
2318
+ if (!selection.includes(channel)) selection.push(channel);
2319
+ };
2320
+ const resolveDisabledHint = (channel) => {
2321
+ const plugin = getChannelPlugin(channel);
2322
+ if (!plugin) {
2323
+ if (next.plugins?.entries?.[channel]?.enabled === false) return "plugin disabled";
2324
+ if (next.plugins?.enabled === false) return "plugins disabled";
2325
+ return;
2326
+ }
2327
+ const accountId = resolveChannelDefaultAccountId({
2328
+ plugin,
2329
+ cfg: next
2330
+ });
2331
+ const account = plugin.config.resolveAccount(next, accountId);
2332
+ let enabled;
2333
+ if (plugin.config.isEnabled) enabled = plugin.config.isEnabled(account, next);
2334
+ else if (typeof account?.enabled === "boolean") enabled = account.enabled;
2335
+ else if (typeof next.channels?.[channel]?.enabled === "boolean") enabled = next.channels[channel]?.enabled;
2336
+ return enabled === false ? "disabled" : void 0;
2337
+ };
2338
+ const buildSelectionOptions = (entries) => entries.map((entry) => {
2339
+ const status = statusByChannel.get(entry.id);
2340
+ const disabledHint = resolveDisabledHint(entry.id);
2341
+ const hint = [status?.selectionHint, disabledHint].filter(Boolean).join(" · ") || void 0;
2342
+ return {
2343
+ value: entry.meta.id,
2344
+ label: entry.meta.selectionLabel ?? entry.meta.label,
2345
+ ...hint ? { hint } : {}
2346
+ };
2347
+ });
2348
+ const getChannelEntries = () => {
2349
+ const core = listChatChannels();
2350
+ const installed = listChannelPlugins();
2351
+ const installedIds = new Set(installed.map((plugin) => plugin.id));
2352
+ const catalog = listChannelPluginCatalogEntries({ workspaceDir: resolveAgentWorkspaceDir(next, resolveDefaultAgentId(next)) }).filter((entry) => !installedIds.has(entry.id));
2353
+ const metaById = /* @__PURE__ */ new Map();
2354
+ for (const meta of core) metaById.set(meta.id, meta);
2355
+ for (const plugin of installed) metaById.set(plugin.id, plugin.meta);
2356
+ for (const entry of catalog) if (!metaById.has(entry.id)) metaById.set(entry.id, entry.meta);
2357
+ return {
2358
+ entries: Array.from(metaById, ([id, meta]) => ({
2359
+ id,
2360
+ meta
2361
+ })),
2362
+ catalog,
2363
+ catalogById: new Map(catalog.map((entry) => [entry.id, entry]))
2364
+ };
2365
+ };
2366
+ const refreshStatus = async (channel) => {
2367
+ const adapter = getChannelOnboardingAdapter(channel);
2368
+ if (!adapter) return;
2369
+ const status = await adapter.getStatus({
2370
+ cfg: next,
2371
+ options,
2372
+ accountOverrides
2373
+ });
2374
+ statusByChannel.set(channel, status);
2375
+ };
2376
+ const ensureBundledPluginEnabled = async (channel) => {
2377
+ if (getChannelPlugin(channel)) return true;
2378
+ const result = enablePluginInConfig(next, channel);
2379
+ next = result.config;
2380
+ if (!result.enabled) {
2381
+ await prompter.note(`Cannot enable ${channel}: ${result.reason ?? "plugin disabled"}.`, "Channel setup");
2382
+ return false;
2383
+ }
2384
+ const workspaceDir = resolveAgentWorkspaceDir(next, resolveDefaultAgentId(next));
2385
+ reloadOnboardingPluginRegistry({
2386
+ cfg: next,
2387
+ runtime,
2388
+ workspaceDir
2389
+ });
2390
+ if (!getChannelPlugin(channel)) {
2391
+ if (getChannelOnboardingAdapter(channel)) {
2392
+ await prompter.note(`${channel} plugin not available (continuing with onboarding). If the channel still doesn't work after setup, run \`${formatCliCommand("remoteclaw plugins list")}\` and \`${formatCliCommand("remoteclaw plugins enable " + channel)}\`, then restart the gateway.`, "Channel setup");
2393
+ await refreshStatus(channel);
2394
+ return true;
2395
+ }
2396
+ await prompter.note(`${channel} plugin not available.`, "Channel setup");
2397
+ return false;
2398
+ }
2399
+ await refreshStatus(channel);
2400
+ return true;
2401
+ };
2402
+ const configureChannel = async (channel) => {
2403
+ const adapter = getChannelOnboardingAdapter(channel);
2404
+ if (!adapter) {
2405
+ await prompter.note(`${channel} does not support onboarding yet.`, "Channel setup");
2406
+ return;
2407
+ }
2408
+ const result = await adapter.configure({
2409
+ cfg: next,
2410
+ runtime,
2411
+ prompter,
2412
+ options,
2413
+ accountOverrides,
2414
+ shouldPromptAccountIds,
2415
+ forceAllowFrom: forceAllowFromChannels.has(channel)
2416
+ });
2417
+ next = result.cfg;
2418
+ if (result.accountId) recordAccount(channel, result.accountId);
2419
+ addSelection(channel);
2420
+ await refreshStatus(channel);
2421
+ };
2422
+ const handleConfiguredChannel = async (channel, label) => {
2423
+ const plugin = getChannelPlugin(channel);
2424
+ const adapter = getChannelOnboardingAdapter(channel);
2425
+ const supportsDisable = Boolean(options?.allowDisable && (plugin?.config.setAccountEnabled || adapter?.disable));
2426
+ const supportsDelete = Boolean(options?.allowDisable && plugin?.config.deleteAccount);
2427
+ const action = await promptConfiguredAction({
2428
+ prompter,
2429
+ label,
2430
+ supportsDisable,
2431
+ supportsDelete
2432
+ });
2433
+ if (action === "skip") return;
2434
+ if (action === "update") {
2435
+ await configureChannel(channel);
2436
+ return;
2437
+ }
2438
+ if (!options?.allowDisable) return;
2439
+ if (action === "delete" && !supportsDelete) {
2440
+ await prompter.note(`${label} does not support deleting config entries.`, "Remove channel");
2441
+ return;
2442
+ }
2443
+ const resolvedAccountId = normalizeAccountId((action === "delete" ? Boolean(plugin?.config.deleteAccount) : Boolean(plugin?.config.setAccountEnabled)) ? await promptRemovalAccountId({
2444
+ cfg: next,
2445
+ prompter,
2446
+ label,
2447
+ channel
2448
+ }) : DEFAULT_ACCOUNT_ID) ?? (plugin ? resolveChannelDefaultAccountId({
2449
+ plugin,
2450
+ cfg: next
2451
+ }) : DEFAULT_ACCOUNT_ID);
2452
+ const accountLabel = formatAccountLabel(resolvedAccountId);
2453
+ if (action === "delete") {
2454
+ if (!await prompter.confirm({
2455
+ message: `Delete ${label} account "${accountLabel}"?`,
2456
+ initialValue: false
2457
+ })) return;
2458
+ if (plugin?.config.deleteAccount) next = plugin.config.deleteAccount({
2459
+ cfg: next,
2460
+ accountId: resolvedAccountId
2461
+ });
2462
+ await refreshStatus(channel);
2463
+ return;
2464
+ }
2465
+ if (plugin?.config.setAccountEnabled) next = plugin.config.setAccountEnabled({
2466
+ cfg: next,
2467
+ accountId: resolvedAccountId,
2468
+ enabled: false
2469
+ });
2470
+ else if (adapter?.disable) next = adapter.disable(next);
2471
+ await refreshStatus(channel);
2472
+ };
2473
+ const handleChannelChoice = async (channel) => {
2474
+ const { catalogById } = getChannelEntries();
2475
+ const catalogEntry = catalogById.get(channel);
2476
+ if (catalogEntry) {
2477
+ const workspaceDir = resolveAgentWorkspaceDir(next, resolveDefaultAgentId(next));
2478
+ const result = await ensureOnboardingPluginInstalled({
2479
+ cfg: next,
2480
+ entry: catalogEntry,
2481
+ prompter,
2482
+ runtime,
2483
+ workspaceDir
2484
+ });
2485
+ next = result.cfg;
2486
+ if (!result.installed) return;
2487
+ reloadOnboardingPluginRegistry({
2488
+ cfg: next,
2489
+ runtime,
2490
+ workspaceDir
2491
+ });
2492
+ await refreshStatus(channel);
2493
+ } else if (!await ensureBundledPluginEnabled(channel)) return;
2494
+ const label = getChannelPlugin(channel)?.meta.label ?? catalogEntry?.meta.label ?? channel;
2495
+ if (statusByChannel.get(channel)?.configured ?? false) {
2496
+ await handleConfiguredChannel(channel, label);
2497
+ return;
2498
+ }
2499
+ await configureChannel(channel);
2500
+ };
2501
+ if (options?.quickstartDefaults) {
2502
+ const { entries } = getChannelEntries();
2503
+ const choice = await prompter.select({
2504
+ message: "Select channel (QuickStart)",
2505
+ options: [...buildSelectionOptions(entries), {
2506
+ value: "__skip__",
2507
+ label: "Skip for now",
2508
+ hint: `You can add channels later via \`${formatCliCommand("remoteclaw channels add")}\``
2509
+ }],
2510
+ initialValue: quickstartDefault
2511
+ });
2512
+ if (choice !== "__skip__") await handleChannelChoice(choice);
2513
+ } else {
2514
+ const doneValue = "__done__";
2515
+ const initialValue = options?.initialSelection?.[0] ?? quickstartDefault;
2516
+ while (true) {
2517
+ const { entries } = getChannelEntries();
2518
+ const choice = await prompter.select({
2519
+ message: "Select a channel",
2520
+ options: [...buildSelectionOptions(entries), {
2521
+ value: doneValue,
2522
+ label: "Finished",
2523
+ hint: selection.length > 0 ? "Done" : "Skip for now"
2524
+ }],
2525
+ initialValue
2526
+ });
2527
+ if (choice === doneValue) break;
2528
+ await handleChannelChoice(choice);
2529
+ }
2530
+ }
2531
+ options?.onSelection?.(selection);
2532
+ const selectionNotes = /* @__PURE__ */ new Map();
2533
+ const { entries: selectionEntries } = getChannelEntries();
2534
+ for (const entry of selectionEntries) selectionNotes.set(entry.id, formatChannelSelectionLine(entry.meta, formatDocsLink));
2535
+ const selectedLines = selection.map((channel) => selectionNotes.get(channel)).filter((line) => Boolean(line));
2536
+ if (selectedLines.length > 0) await prompter.note(selectedLines.join("\n"), "Selected channels");
2537
+ if (!options?.skipDmPolicyPrompt) next = await maybeConfigureDmPolicies({
2538
+ cfg: next,
2539
+ selection,
2540
+ prompter,
2541
+ accountIdsByChannel
2542
+ });
2543
+ return next;
2544
+ }
2545
+
2546
+ //#endregion
2547
+ export { reloadOnboardingPluginRegistry as a, ensureOnboardingPluginInstalled as i, onboard_channels_exports as n, setupChannels as r, noteChannelStatus as t };