remoteclaw 0.1.0-next.da482d8 → 0.1.0-next.db8a792

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 (1020) hide show
  1. package/dist/accounts-BZ2kR_Ij.js +47 -0
  2. package/dist/accounts-Bi4rFQG5.js +272 -0
  3. package/dist/accounts-Bpk-loA6.js +47 -0
  4. package/dist/accounts-D1CBpsaa.js +32 -0
  5. package/dist/accounts-DAdUdbPk.js +36 -0
  6. package/dist/accounts-WYyfAiie.js +270 -0
  7. package/dist/accounts-zQKMwnvt.js +36 -0
  8. package/dist/ack-reactions-B1l-vKPr.js +621 -0
  9. package/dist/ack-reactions-BnG0DLMu.js +621 -0
  10. package/dist/acp-cli-Btx71t69.js +1319 -0
  11. package/dist/acp-cli-DVQMjl0p.js +1324 -0
  12. package/dist/active-listener-BfN4RKlA.js +37 -0
  13. package/dist/active-listener-Bq7ckjOV.js +37 -0
  14. package/dist/agent-D2IwuL6g.js +688 -0
  15. package/dist/agent-WaE2mXI1.js +687 -0
  16. package/dist/agent-helpers-BcaiJFiG.js +400 -0
  17. package/dist/agent-scope-DVvX_nkQ.js +116 -0
  18. package/dist/agents-BwnT7jca.js +760 -0
  19. package/dist/agents.config-Dorm30BQ.js +116 -0
  20. package/dist/audio-B1lTyRqS.js +43 -0
  21. package/dist/audio-e0dFnrn8.js +43 -0
  22. package/dist/audit-DZvqycbG.js +3150 -0
  23. package/dist/audit-Mit73dYD.js +3150 -0
  24. package/dist/auth-C-XX0Tdt.js +314 -0
  25. package/dist/auth-D8--b01l.js +315 -0
  26. package/dist/auth-DJ7XEBDO.js +448 -0
  27. package/dist/auth-otyjXf9l.js +448 -0
  28. package/dist/banner-DSE-i7gH.js +294 -0
  29. package/dist/binaries-BSjilwX-.js +13 -0
  30. package/dist/bindings-DFTxQj8x.js +69 -0
  31. package/dist/bonjour-discovery-BnxTMHRd.js +378 -0
  32. package/dist/bonjour-discovery-CVJYHT3g.js +378 -0
  33. package/dist/boot/handler.js +28 -44
  34. package/dist/browser-cli-BR2pZWTC.js +1694 -0
  35. package/dist/browser-cli-I0kfR7FV.js +1690 -0
  36. package/dist/build-info.json +3 -3
  37. package/dist/call-Ck7ysmEl.js +517 -0
  38. package/dist/call-MN6mCJEB.js +518 -0
  39. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  40. package/dist/catalog-Bt9EM4sK.js +185 -0
  41. package/dist/catalog-BtUvWKd9.js +185 -0
  42. package/dist/channel-account-context-BLQq9NKz.js +133 -0
  43. package/dist/channel-account-context-CaCzVa76.js +133 -0
  44. package/dist/channel-activity-BatlvP_U.js +292 -0
  45. package/dist/channel-activity-DHVMMb2x.js +94 -0
  46. package/dist/channel-activity-DtRx3b0W.js +94 -0
  47. package/dist/channel-options-C6kT3nXB.js +32 -0
  48. package/dist/channel-options-CbgR_vsp.js +33 -0
  49. package/dist/channel-selection-CzbrpDPd.js +51 -0
  50. package/dist/channel-selection-Xv5UFxOx.js +51 -0
  51. package/dist/channel-web-DfDokU69.js +2134 -0
  52. package/dist/channel-web-DtvksSuY.js +2132 -0
  53. package/dist/channels-cli-BmdCVX6O.js +1435 -0
  54. package/dist/channels-cli-CrAZpaiN.js +1439 -0
  55. package/dist/channels-status-issues-B77y-TLr.js +18 -0
  56. package/dist/channels-status-issues-COECL8nx.js +18 -0
  57. package/dist/chrome-Cr5wmMk8.js +1733 -0
  58. package/dist/chrome-YBrnJN-g.js +1732 -0
  59. package/dist/chunk-CrfQ_O--.js +341 -0
  60. package/dist/chunk-DFBUmlXU.js +341 -0
  61. package/dist/clack-prompter-CFNKgQXx.js +122 -0
  62. package/dist/clack-prompter-DDlR2e34.js +121 -0
  63. package/dist/cli/daemon-cli.js +1 -1
  64. package/dist/cli-BbOinSy6.js +130 -0
  65. package/dist/cli-DuvHXQ5h.js +134 -0
  66. package/dist/client-BZeatr3g.js +2316 -0
  67. package/dist/client-Bc9JFAwL.js +2316 -0
  68. package/dist/clipboard-Com-8GBg.js +31 -0
  69. package/dist/clipboard-J_9AABIu.js +31 -0
  70. package/dist/command-format-CMAQa4dB.js +32 -0
  71. package/dist/command-format-KkslAzwV.js +18 -0
  72. package/dist/command-logger/handler.js +1 -1
  73. package/dist/command-registry-BJnVtHo0.js +215 -0
  74. package/dist/commands-ijxtne0J.js +41 -0
  75. package/dist/commands-kZtQfqDl.js +41 -0
  76. package/dist/commands-registry-BrBtH2_B.js +891 -0
  77. package/dist/commands-registry-xZoSouba.js +892 -0
  78. package/dist/common-6D7nhDP-.js +156 -0
  79. package/dist/common-B4cjsvqP.js +156 -0
  80. package/dist/completion-cli-CpUq9QC3.js +452 -0
  81. package/dist/completion-cli-De4umD_N.js +452 -0
  82. package/dist/config-C_WcTz_O.js +4231 -0
  83. package/dist/config-DfcqHTH-.js +4229 -0
  84. package/dist/config-cli-C7rq2n_m.js +243 -0
  85. package/dist/config-cli-VToCKln2.js +247 -0
  86. package/dist/config-guard-BlAcGEao.js +75 -0
  87. package/dist/config-guard-C-h_KIeI.js +99 -0
  88. package/dist/config-validation-C0YXR2dY.js +18 -0
  89. package/dist/config-validation-DDYBTmxT.js +18 -0
  90. package/dist/configure-Bkre1zEB.js +891 -0
  91. package/dist/configure-ifuEamRQ.js +889 -0
  92. package/dist/control-auth-DK6cIBzl.js +397 -0
  93. package/dist/control-auth-DQ8bfDMk.js +397 -0
  94. package/dist/control-ui-assets-DLEWfed6.js +186 -0
  95. package/dist/control-ui-assets-DVhkAyhv.js +186 -0
  96. package/dist/conversation-label-HuHoShPF.js +36 -0
  97. package/dist/conversation-label-L0QTtKji.js +36 -0
  98. package/dist/cron-cli-DnxnTi83.js +498 -0
  99. package/dist/cron-cli-yqcBkqZT.js +494 -0
  100. package/dist/daemon-cli-CmQYq8uO.js +735 -0
  101. package/dist/daemon-cli-_OIRoswC.js +737 -0
  102. package/dist/daemon-cli.js +34 -69
  103. package/dist/daemon-install-BEgffqDj.js +56 -0
  104. package/dist/daemon-install-DAorzotp.js +60 -0
  105. package/dist/daemon-install-helpers-B82uvJjJ.js +504 -0
  106. package/dist/daemon-install-helpers-BhL2Gh4l.js +504 -0
  107. package/dist/deliver-CCvDBk5c.js +481 -0
  108. package/dist/deliver-CqKw0wFi.js +481 -0
  109. package/dist/delivery-queue-CK7VnUJf.js +244 -0
  110. package/dist/delivery-queue-DMeQchpT.js +244 -0
  111. package/dist/devices-cli-C6UAfRV_.js +323 -0
  112. package/dist/devices-cli-Le-isdZB.js +319 -0
  113. package/dist/diagnostics-BhFwk6F3.js +35 -0
  114. package/dist/diagnostics-BtaQtaVR.js +35 -0
  115. package/dist/directory-cli-BqMfX5og.js +220 -0
  116. package/dist/directory-cli-DD72TTD4.js +224 -0
  117. package/dist/dispatcher-BLC2WYZv.js +173 -0
  118. package/dist/dispatcher-Cm2FAG_D.js +174 -0
  119. package/dist/dm-policy-shared-DOzpxMHC.js +22 -0
  120. package/dist/dm-policy-shared-DZY0f1bR.js +22 -0
  121. package/dist/dns-cli-BgsNg-bn.js +203 -0
  122. package/dist/dns-cli-CdMU5yuG.js +199 -0
  123. package/dist/dock-ByrYnLiz.js +929 -0
  124. package/dist/dock-CpNmmysM.js +928 -0
  125. package/dist/doctor-completion-BPeaRbmd.js +92 -0
  126. package/dist/doctor-completion-CfOyGJd3.js +92 -0
  127. package/dist/doctor-config-flow-DMyTycn7.js +1935 -0
  128. package/dist/doctor-config-flow-DoMu-pTm.js +1934 -0
  129. package/dist/enable-D5KetMo7.js +59 -0
  130. package/dist/entry.js +61 -1
  131. package/dist/env-BJ36dSrx.js +60 -0
  132. package/dist/errors-BfONuT95.js +35 -0
  133. package/dist/errors-_DSePI1C.js +35 -0
  134. package/dist/exec-DkFE7lqU.js +164 -0
  135. package/dist/exec-mY96dhIg.js +164 -0
  136. package/dist/extensionAPI.js +112 -76
  137. package/dist/fetch-B3EQXbTa.js +67 -0
  138. package/dist/fetch-BPeSHPvr.js +281 -0
  139. package/dist/fetch-BQ7HvRwe.js +67 -0
  140. package/dist/fetch-CbGTzJ8L.js +281 -0
  141. package/dist/fetch-CfIaWynF.js +67 -0
  142. package/dist/file-lock-BHfqppLm.js +107 -0
  143. package/dist/file-lock-CCBpdPM_.js +107 -0
  144. package/dist/fs-safe-BcEpbVjc.js +88 -0
  145. package/dist/fs-safe-S3Zvbabd.js +98 -0
  146. package/dist/gateway-cli-BXipRcsU.js +24602 -0
  147. package/dist/gateway-cli-Bv2K3rXx.js +24606 -0
  148. package/dist/gateway-rpc-BHnd7P1q.js +28 -0
  149. package/dist/gateway-rpc-COEQDswS.js +28 -0
  150. package/dist/gmail-setup-utils-BpdKFe3P.js +423 -0
  151. package/dist/gmail-setup-utils-CqbWr0Kq.js +422 -0
  152. package/dist/health-1ero5j64.js +1414 -0
  153. package/dist/health-ioP2au7j.js +1417 -0
  154. package/dist/heartbeat-visibility-C88L-_f2.js +125 -0
  155. package/dist/heartbeat-visibility-Dk_Q02qX.js +125 -0
  156. package/dist/hook-runner-global-BztoD8lu.js +527 -0
  157. package/dist/hooks-cli-B8D9DzRR.js +1226 -0
  158. package/dist/hooks-cli-rZ3GOXag.js +1222 -0
  159. package/dist/image-ops-Cx1ym2Hi.js +354 -0
  160. package/dist/image-ops-DWytvdh_.js +354 -0
  161. package/dist/import-CTUBsy7D.js +604 -0
  162. package/dist/import-cBp4f62k.js +606 -0
  163. package/dist/inbound-context-COwswi8z.js +68 -0
  164. package/dist/inbound-context-ChcNR30g.js +68 -0
  165. package/dist/index.js +127 -102
  166. package/dist/inspect-BsS3_z-x.js +286 -0
  167. package/dist/inspect-drfsUSIW.js +286 -0
  168. package/dist/installs-BFmmM5Zd.js +325 -0
  169. package/dist/installs-DA7SG0Tx.js +325 -0
  170. package/dist/ipv4-BZGSwnH4.js +46 -0
  171. package/dist/ipv4-DsOgHE0B.js +46 -0
  172. package/dist/ir-R3Pk8Cv8.js +972 -0
  173. package/dist/lifecycle-core-BZMeOT7u.js +474 -0
  174. package/dist/lifecycle-core-C6-_Gts0.js +476 -0
  175. package/dist/loader-CJ2UHqV7.js +22414 -0
  176. package/dist/loader-dEFvmwXu.js +22411 -0
  177. package/dist/logger-9I2fg5mr.js +49 -0
  178. package/dist/login-D9uJTyEv.js +62 -0
  179. package/dist/login-DTh702_w.js +61 -0
  180. package/dist/login-qr-BKsmW6XI.js +325 -0
  181. package/dist/login-qr-SOXdIR58.js +329 -0
  182. package/dist/logs-cli-BshJBHZQ.js +236 -0
  183. package/dist/logs-cli-Ckh-BBTT.js +240 -0
  184. package/dist/markdown-tables-Cfz7zDXI.js +29 -0
  185. package/dist/markdown-tables-DeFSK6aY.js +29 -0
  186. package/dist/media-BD2cZGXT.js +971 -0
  187. package/dist/media-CjvpnJmQ.js +10388 -0
  188. package/dist/message-action-names-CZHrHMRE.js +2520 -0
  189. package/dist/message-action-names-CiZ-0Smk.js +2520 -0
  190. package/dist/message-channel-EMCYRaxk.js +91 -0
  191. package/dist/mime-1E7nn9IU.js +146 -0
  192. package/dist/mime-mSgQeDnC.js +146 -0
  193. package/dist/net-Cg8AQeke.js +225 -0
  194. package/dist/net-DMh1m8AZ.js +225 -0
  195. package/dist/node-cli-BJ5CCbqx.js +1462 -0
  196. package/dist/node-cli-wYYhAs8x.js +1458 -0
  197. package/dist/node-service-CkwVlcey.js +67 -0
  198. package/dist/node-service-DTVW9YJh.js +67 -0
  199. package/dist/nodes-cli-CMFYLD1o.js +1346 -0
  200. package/dist/nodes-cli-DC2zUx3f.js +1350 -0
  201. package/dist/nodes-screen-6pXv1lYa.js +250 -0
  202. package/dist/nodes-screen-CTIZKksn.js +250 -0
  203. package/dist/note-CMELkPJN.js +92 -0
  204. package/dist/npm-registry-spec-BiJI7Rkr.js +786 -0
  205. package/dist/npm-registry-spec-Dza35Ig4.js +786 -0
  206. package/dist/npm-resolution-CUQGDty4.js +86 -0
  207. package/dist/npm-resolution-CwbZK9AI.js +86 -0
  208. package/dist/onboard-8Qd9lU8x.js +649 -0
  209. package/dist/onboard-Q3cY65m8.js +647 -0
  210. package/dist/onboard-auth-BUzYDEqf.js +211 -0
  211. package/dist/onboard-auth-DcVXyd-Z.js +207 -0
  212. package/dist/onboard-channels-BFHuA-AU.js +2548 -0
  213. package/dist/onboard-channels-DVrPP_ie.js +2547 -0
  214. package/dist/onboard-helpers-B-bBSsyR.js +363 -0
  215. package/dist/onboard-helpers-YsCa-sAt.js +364 -0
  216. package/dist/onboard-remote-BWFcuEOD.js +127 -0
  217. package/dist/onboard-remote-C0THuDTK.js +127 -0
  218. package/dist/onboarding-B31lnOPp.js +586 -0
  219. package/dist/onboarding-DmN_qC8e.js +588 -0
  220. package/dist/onboarding.finalize-DGD0PA-D.js +402 -0
  221. package/dist/onboarding.finalize-DNIb3meE.js +404 -0
  222. package/dist/onboarding.gateway-config-BaeIuA62.js +195 -0
  223. package/dist/onboarding.gateway-config-DMV2Odzr.js +201 -0
  224. package/dist/outbound-BdxBHDax.js +220 -0
  225. package/dist/outbound-D-Y9rMgB.js +221 -0
  226. package/dist/outbound-attachment-CvZ04r5k.js +18 -0
  227. package/dist/outbound-attachment-DYa1asB5.js +18 -0
  228. package/dist/outbound-attachment-DgUpk7Uh.js +18 -0
  229. package/dist/pairing-cli-BxTv78V7.js +125 -0
  230. package/dist/pairing-cli-CxUCzNUc.js +129 -0
  231. package/dist/pairing-labels-DVO6NJr0.js +9 -0
  232. package/dist/pairing-labels-D_pD8Cag.js +9 -0
  233. package/dist/pairing-store-Bu9pVlkO.js +459 -0
  234. package/dist/pairing-store-CWaGbAGi.js +460 -0
  235. package/dist/path-env-RsuO6yO-.js +89 -0
  236. package/dist/path-env-_my-d_iR.js +89 -0
  237. package/dist/path-safety-CfiVyVz7.js +14 -0
  238. package/dist/path-safety-D-wLK4pV.js +14 -0
  239. package/dist/plugin-auto-enable-CW01H36W.js +301 -0
  240. package/dist/plugin-auto-enable-CeHhBLCU.js +302 -0
  241. package/dist/plugin-registry-CWL37HnB.js +33 -0
  242. package/dist/plugin-registry-ELliiumZ.js +33 -0
  243. package/dist/plugin-sdk/auth/provider-auth.d.ts +0 -6
  244. package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +9 -29
  245. package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +0 -2
  246. package/dist/plugin-sdk/auto-reply/reply/commands-subagents/shared.d.ts +1 -1
  247. package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +0 -2
  248. package/dist/plugin-sdk/auto-reply/status.d.ts +0 -4
  249. package/dist/plugin-sdk/auto-reply/templating.d.ts +0 -4
  250. package/dist/plugin-sdk/config/sessions/types.d.ts +0 -2
  251. package/dist/plugin-sdk/config/types.tools.d.ts +1 -59
  252. package/dist/plugin-sdk/config/types.tts.d.ts +2 -1
  253. package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +0 -177
  254. package/dist/plugin-sdk/config/zod-schema.core.d.ts +2 -230
  255. package/dist/plugin-sdk/config/zod-schema.d.ts +3 -192
  256. package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +3 -15
  257. package/dist/plugin-sdk/config/zod-schema.providers.d.ts +2 -10
  258. package/dist/plugin-sdk/config/zod-schema.session.d.ts +1 -5
  259. package/dist/plugin-sdk/gateway/protocol/index.d.ts +5 -5
  260. package/dist/plugin-sdk/index.js +72 -142
  261. package/dist/plugin-sdk/middleware/cli-runtime-base.d.ts +6 -0
  262. package/dist/plugin-sdk/middleware/runtimes/claude.d.ts +6 -0
  263. package/dist/plugin-sdk/middleware/runtimes/codex.d.ts +2 -2
  264. package/dist/plugin-sdk/plugin-sdk/index.d.ts +2 -0
  265. package/dist/plugin-sdk/plugins/manifest-registry.d.ts +2 -0
  266. package/dist/plugin-sdk/plugins/manifest.d.ts +2 -0
  267. package/dist/plugin-sdk/plugins/registry.d.ts +18 -0
  268. package/dist/plugin-sdk/plugins/types.d.ts +4 -0
  269. package/dist/plugin-sdk/stt/preflight.d.ts +2 -4
  270. package/dist/plugin-sdk/stt/providers/index.d.ts +1 -1
  271. package/dist/plugin-sdk/stt/providers/shared.d.ts +20 -1
  272. package/dist/plugin-sdk/tts/providers/edge.d.ts +2 -0
  273. package/dist/plugin-sdk/tts/providers/elevenlabs.d.ts +2 -0
  274. package/dist/plugin-sdk/tts/providers/index.d.ts +4 -0
  275. package/dist/plugin-sdk/tts/providers/openai.d.ts +2 -0
  276. package/dist/plugin-sdk/tts/tts.d.ts +13 -5
  277. package/dist/plugin-sdk/tts/types.d.ts +21 -0
  278. package/dist/plugins-DExsdlTp.js +455 -0
  279. package/dist/plugins-DdMgSc_b.js +453 -0
  280. package/dist/plugins-cli-DqBWiT_G.js +806 -0
  281. package/dist/plugins-cli-KQEzhU6P.js +802 -0
  282. package/dist/ports-CL0pXAXO.js +96 -0
  283. package/dist/ports-CRI-HSZx.js +370 -0
  284. package/dist/ports-DiQFcKUB.js +316 -0
  285. package/dist/ports-HRurfPIr.js +96 -0
  286. package/dist/preflight-6QRqxWh7.js +667 -0
  287. package/dist/preflight-DDZjr5KD.js +667 -0
  288. package/dist/program-DmhbOJj3.js +249 -0
  289. package/dist/program-context-PPMzZ6Gu.js +474 -0
  290. package/dist/prompt-select-styled-CmSWunD8.js +1669 -0
  291. package/dist/prompt-select-styled-PfxT9zl9.js +1672 -0
  292. package/dist/provider-auth-CfdnLqh3.js +187 -0
  293. package/dist/provider-auth-gpHOMUBP.js +187 -0
  294. package/dist/provider-dispatcher-D4eY8LZW.js +659 -0
  295. package/dist/provider-dispatcher-D5Q7M15D.js +660 -0
  296. package/dist/push-apns-BNwVMXX9.js +713 -0
  297. package/dist/push-apns-BszVkcZK.js +711 -0
  298. package/dist/pw-ai-Bdb3zrBM.js +1911 -0
  299. package/dist/pw-ai-BvcvEdGs.js +1908 -0
  300. package/dist/qr-cli-BBgk2ci1.js +349 -0
  301. package/dist/qr-cli-BLzVrhia.js +353 -0
  302. package/dist/redact-snapshot-CyBDcb_a.js +1966 -0
  303. package/dist/redact-snapshot-D9oPMqA-.js +1966 -0
  304. package/dist/register.agent-CAhKX3Ft.js +1019 -0
  305. package/dist/register.agent-RKHXtLLm.js +291 -0
  306. package/dist/register.configure-CW6XRGxV.js +129 -0
  307. package/dist/register.configure-dvrKc0j7.js +134 -0
  308. package/dist/register.import-CRLOolHv.js +31 -0
  309. package/dist/register.import-dhDEj7Om.js +29 -0
  310. package/dist/register.maintenance-EAhr1tJ9.js +500 -0
  311. package/dist/register.maintenance-lWz4v90u.js +502 -0
  312. package/dist/register.message-DyWkwUIU.js +690 -0
  313. package/dist/register.message-bl2Khz6c.js +686 -0
  314. package/dist/register.onboard-BAozmeei.js +97 -0
  315. package/dist/register.onboard-Da9hWQR1.js +93 -0
  316. package/dist/register.setup-DVrQWLoF.js +117 -0
  317. package/dist/register.setup-DbiLuuqg.js +113 -0
  318. package/dist/register.status-health-sessions-CA8ApUkH.js +668 -0
  319. package/dist/register.status-health-sessions-lGszs-NJ.js +428 -0
  320. package/dist/register.subclis-C-lqMygb.js +267 -0
  321. package/dist/replies-BTC1z8j0.js +136 -0
  322. package/dist/replies-BhlnuFp0.js +136 -0
  323. package/dist/reply-DZMooMoq.js +12880 -0
  324. package/dist/reply-directives-C0-hYyAt.js +182 -0
  325. package/dist/reply-directives-C_CGXLBJ.js +182 -0
  326. package/dist/reply-payloads-BospFSPI.js +527 -0
  327. package/dist/reply-prefix-DDgh77yy.js +37 -0
  328. package/dist/reply-prefix-DwKZPZyG.js +37 -0
  329. package/dist/reply-yGEQ0UW4.js +12877 -0
  330. package/dist/resolve-route-B73QhBIl.js +249 -0
  331. package/dist/resolve-route-DckdRbW8.js +249 -0
  332. package/dist/response-prefix-template-x5RBQnEy.js +134 -0
  333. package/dist/retry-CDrH81GP.js +77 -0
  334. package/dist/run-main-D869n5qf.js +307 -0
  335. package/dist/secure-random-CxzxAnMS.js +44 -0
  336. package/dist/security-cli-CfqosyUf.js +487 -0
  337. package/dist/security-cli-DMZun6gO.js +482 -0
  338. package/dist/send-3wvngctD.js +547 -0
  339. package/dist/send-AY7Fs5ky.js +374 -0
  340. package/dist/send-BSWD4Kr_.js +2245 -0
  341. package/dist/send-BT4HhTLm.js +349 -0
  342. package/dist/send-BvuxToC8.js +2245 -0
  343. package/dist/send-CaUxFvu0.js +492 -0
  344. package/dist/send-CiBRE4OY.js +1178 -0
  345. package/dist/send-Cidd4lQn.js +11 -0
  346. package/dist/send-Cq_Db9wG.js +1779 -0
  347. package/dist/send-DBFcxDPm.js +1776 -0
  348. package/dist/send-DUha0nIz.js +492 -0
  349. package/dist/send-DgYBI05s.js +332 -0
  350. package/dist/send-Dnf5bISH.js +426 -0
  351. package/dist/send-NcQk6UH1.js +547 -0
  352. package/dist/send-Og0-IMee.js +29 -0
  353. package/dist/send-oCN80Pl2.js +349 -0
  354. package/dist/server-DoGGLeP3.js +202 -0
  355. package/dist/server-V7G9FG2A.js +206 -0
  356. package/dist/server-lifecycle-CSWpSlvn.js +2437 -0
  357. package/dist/server-lifecycle-Cal8hBP1.js +2437 -0
  358. package/dist/server-node-events-DSee6jSG.js +394 -0
  359. package/dist/server-node-events-DbQWkU3M.js +390 -0
  360. package/dist/service-Duw0xMJX.js +670 -0
  361. package/dist/service-SRcnA1Am.js +670 -0
  362. package/dist/session-BLcfWX5_.js +170 -0
  363. package/dist/session-CQwkaAs-.js +170 -0
  364. package/dist/session-cost-usage-C-UcrvL4.js +627 -0
  365. package/dist/session-cost-usage-Dg3dzS0E.js +627 -0
  366. package/dist/session-dirs-D6mFEF90.js +318 -0
  367. package/dist/session-dirs-DVsG6e7L.js +318 -0
  368. package/dist/session-utils-C6522g3D.js +622 -0
  369. package/dist/session-utils-Dq2BJyVy.js +622 -0
  370. package/dist/sessions-CNkj4Eq8.js +247 -0
  371. package/dist/sessions-DDIoP7Rl.js +2569 -0
  372. package/dist/shell-env-D8nXPDbP.js +163 -0
  373. package/dist/ssrf-7I3FUHpm.js +183 -0
  374. package/dist/ssrf-DZi4qw5c.js +183 -0
  375. package/dist/status-CrAe8ZYt.js +1983 -0
  376. package/dist/status-DetRJxvZ.js +1979 -0
  377. package/dist/status.update-DquSK3p7.js +449 -0
  378. package/dist/status.update-iABAY3iW.js +449 -0
  379. package/dist/store-Bnm6zwaq.js +2571 -0
  380. package/dist/store-CVkGKjWm.js +64 -0
  381. package/dist/store-D_gpBpAW.js +64 -0
  382. package/dist/store-mxh63FBa.js +53 -0
  383. package/dist/subagent-registry-DNAz7Heu.js +4856 -0
  384. package/dist/subagent-registry-Dhz6HC4Z.js +4854 -0
  385. package/dist/subsystem-DGSHVL8I.js +1081 -0
  386. package/dist/subsystem-m7RSGQoR.js +1196 -0
  387. package/dist/system-cli-ByVDF6p8.js +77 -0
  388. package/dist/system-cli-CERb89Bl.js +73 -0
  389. package/dist/systemd-CSUtfsJx.js +547 -0
  390. package/dist/systemd-hints-BCxkQemJ.js +278 -0
  391. package/dist/systemd-hints-ef7m-7ZH.js +278 -0
  392. package/dist/systemd-linger-CWLgT0Wr.js +75 -0
  393. package/dist/systemd-linger-DT0E7YET.js +75 -0
  394. package/dist/systemd-tS61V4ao.js +547 -0
  395. package/dist/tables-DED01JNI.js +55 -0
  396. package/dist/tables-K3rOiGaJ.js +55 -0
  397. package/dist/tables-NcsXz3r_.js +55 -0
  398. package/dist/tailnet-CEudzG0i.js +40 -0
  399. package/dist/tailnet-D66Y5zC7.js +40 -0
  400. package/dist/tailscale-DjSRjPA-.js +230 -0
  401. package/dist/tailscale-DngZHD9L.js +230 -0
  402. package/dist/targets-BOpYPsGM.js +2545 -0
  403. package/dist/targets-BVsxzQh1.js +220 -0
  404. package/dist/targets-C99szk_e.js +114 -0
  405. package/dist/targets-CA4zx5G4.js +650 -0
  406. package/dist/targets-CTNm3bJ8.js +2544 -0
  407. package/dist/targets-DpmQjetK.js +53 -0
  408. package/dist/targets-Q-YGeAqu.js +650 -0
  409. package/dist/targets-rdWlC6Y-.js +53 -0
  410. package/dist/tool-display-Br6mwaJc.js +785 -0
  411. package/dist/tool-display-CLBf5cRa.js +785 -0
  412. package/dist/tool-images-DB4f57XK.js +263 -0
  413. package/dist/tool-images-kloBqxqK.js +263 -0
  414. package/dist/trash-B32LfX0l.js +125 -0
  415. package/dist/trash-SlUJxKO7.js +125 -0
  416. package/dist/tui-CHOtFK6k.js +3282 -0
  417. package/dist/tui-D4yiSpop.js +3282 -0
  418. package/dist/tui-cli-CzrjmAMZ.js +66 -0
  419. package/dist/tui-cli-Dpbs2QW_.js +62 -0
  420. package/dist/update-B5nYVxpc.js +349 -0
  421. package/dist/update-Bs3HhSnE.js +349 -0
  422. package/dist/update-cli-D_yz9Kyz.js +1147 -0
  423. package/dist/update-cli-DdfwNAsA.js +1149 -0
  424. package/dist/usage-BVyabt5E.js +5421 -0
  425. package/dist/voice-credentials-CI4VgB6u.js +46 -0
  426. package/dist/voice-credentials-l_d_gZiG.js +46 -0
  427. package/dist/web-B5xSAAH2.js +74 -0
  428. package/dist/web-Cc4tDVO9.js +3067 -0
  429. package/dist/web-Cdp9_IUk.js +79 -0
  430. package/dist/webhooks-cli-BDPcBkZL.js +330 -0
  431. package/dist/webhooks-cli-sRfsNesg.js +334 -0
  432. package/dist/whatsapp-actions-BGZXdWiP.js +125 -0
  433. package/dist/whatsapp-actions-HdmZu8oU.js +130 -0
  434. package/dist/workspace-D5LAl41l.js +449 -0
  435. package/dist/workspace-DRYGbrDM.js +447 -0
  436. package/dist/zod-schema-C8gEV0uz.js +2739 -0
  437. package/dist/zod-schema-CCUbW_Si.js +2739 -0
  438. package/package.json +1 -1
  439. package/dist/accounts-Aqbb2_Fn.js +0 -270
  440. package/dist/accounts-Bo2bX8jP.js +0 -272
  441. package/dist/accounts-D3fAPVzU.js +0 -36
  442. package/dist/accounts-DUEDngp6.js +0 -32
  443. package/dist/accounts-DZmv4bXS.js +0 -47
  444. package/dist/accounts-DmB4SVPK.js +0 -47
  445. package/dist/accounts-DtkyfvwR.js +0 -36
  446. package/dist/ack-reactions-Bvfy17SM.js +0 -446
  447. package/dist/ack-reactions-DYU8uhcz.js +0 -446
  448. package/dist/acp-cli-DVXhDMc6.js +0 -1324
  449. package/dist/acp-cli-QBL4_qcW.js +0 -1319
  450. package/dist/active-listener-CwxZ24bZ.js +0 -37
  451. package/dist/active-listener-v2sItamh.js +0 -37
  452. package/dist/agent-BisC5WZ6.js +0 -704
  453. package/dist/agent-Bqdrc0AK.js +0 -703
  454. package/dist/agent-helpers-BSGqeJr-.js +0 -400
  455. package/dist/agent-scope-_ND_-bJy.js +0 -116
  456. package/dist/agents-khSbraAA.js +0 -760
  457. package/dist/agents.config-D8gLHPWo.js +0 -116
  458. package/dist/audio-BIvUsncf.js +0 -43
  459. package/dist/audio-CQ8TfmVN.js +0 -43
  460. package/dist/audit-C0x7Cm6K.js +0 -3150
  461. package/dist/audit-CAY-uzWP.js +0 -3150
  462. package/dist/auth-DGqCLaQq.js +0 -448
  463. package/dist/auth-DLTRySEi.js +0 -314
  464. package/dist/auth-Drf91ntw.js +0 -315
  465. package/dist/auth-ku2khJyQ.js +0 -448
  466. package/dist/banner-txHC40UW.js +0 -294
  467. package/dist/binaries-BTvHIrCr.js +0 -13
  468. package/dist/bindings-DsWJQVKh.js +0 -69
  469. package/dist/bonjour-discovery-BElR62fH.js +0 -378
  470. package/dist/bonjour-discovery-C8XyVsjb.js +0 -378
  471. package/dist/browser-cli-DxJew43l.js +0 -1694
  472. package/dist/browser-cli-p0nakrjO.js +0 -1690
  473. package/dist/call-BrTmlOx3.js +0 -518
  474. package/dist/call-ChdUdwb4.js +0 -517
  475. package/dist/catalog-DTlcfTT9.js +0 -185
  476. package/dist/catalog-PixZqhZK.js +0 -185
  477. package/dist/channel-account-context-BO245Tcn.js +0 -133
  478. package/dist/channel-account-context-BgK0hm-I.js +0 -133
  479. package/dist/channel-activity-B0qlUR5e.js +0 -292
  480. package/dist/channel-activity-C-L6rDrQ.js +0 -94
  481. package/dist/channel-activity-DdgLBZ7M.js +0 -94
  482. package/dist/channel-options-CjlvAHSH.js +0 -32
  483. package/dist/channel-options-DpjP7qQf.js +0 -33
  484. package/dist/channel-selection-DW21dXB1.js +0 -51
  485. package/dist/channel-selection-wK_6S2Ku.js +0 -51
  486. package/dist/channel-web-COTkzJBt.js +0 -2136
  487. package/dist/channel-web-DUz5bn9h.js +0 -2134
  488. package/dist/channels-cli-D8RS8g2Q.js +0 -1438
  489. package/dist/channels-cli-X_8rENR6.js +0 -1434
  490. package/dist/channels-status-issues-B6I2l7Sm.js +0 -18
  491. package/dist/channels-status-issues-DhDH2fWp.js +0 -18
  492. package/dist/chrome-Dqtq7zCc.js +0 -1733
  493. package/dist/chrome-XeSY99Z_.js +0 -1732
  494. package/dist/chunk-CWD_zrz_.js +0 -341
  495. package/dist/chunk-LUabyS9k.js +0 -341
  496. package/dist/clack-prompter-fAgbvPW4.js +0 -122
  497. package/dist/clack-prompter-kf9qTN5p.js +0 -121
  498. package/dist/cli-BjPLpuZR.js +0 -133
  499. package/dist/cli-fFyOTtkD.js +0 -129
  500. package/dist/client-B9u3JdT_.js +0 -2316
  501. package/dist/client-DEEOhx0w.js +0 -2316
  502. package/dist/clipboard-B2nstLx7.js +0 -31
  503. package/dist/clipboard-C8QI9fes.js +0 -31
  504. package/dist/command-format-D0vKipG9.js +0 -32
  505. package/dist/command-format-LFmgWzKJ.js +0 -18
  506. package/dist/command-registry-BsPaMI53.js +0 -215
  507. package/dist/commands-BAYwlS3d.js +0 -41
  508. package/dist/commands-D842kCjj.js +0 -41
  509. package/dist/commands-registry-Cg2GTT2J.js +0 -892
  510. package/dist/commands-registry-Yz-uV5oG.js +0 -891
  511. package/dist/common-B67cBSew.js +0 -156
  512. package/dist/common-DEoiTqOr.js +0 -156
  513. package/dist/completion-cli-BO5mIPLa.js +0 -452
  514. package/dist/completion-cli-z9a6MVgr.js +0 -452
  515. package/dist/config-CAa0rZSx.js +0 -4225
  516. package/dist/config-W0w-gi2j.js +0 -4223
  517. package/dist/config-cli-DdRue35G.js +0 -243
  518. package/dist/config-cli-uOwxu5AC.js +0 -247
  519. package/dist/config-guard-BI85dxHR.js +0 -99
  520. package/dist/config-guard-DQqnigKh.js +0 -75
  521. package/dist/config-validation-D-h4LHyA.js +0 -18
  522. package/dist/config-validation-Df_kroIQ.js +0 -18
  523. package/dist/configure-B7ChPbXv.js +0 -891
  524. package/dist/configure-QspkIXME.js +0 -889
  525. package/dist/control-auth-BrBr2xb8.js +0 -397
  526. package/dist/control-auth-CehjYKnL.js +0 -397
  527. package/dist/control-ui-assets-D8F383Mo.js +0 -186
  528. package/dist/control-ui-assets-DYKtRIm0.js +0 -186
  529. package/dist/conversation-label-Bn5j3lUT.js +0 -36
  530. package/dist/conversation-label-CDH4rKMG.js +0 -36
  531. package/dist/cron-cli-DVzDHzAX.js +0 -494
  532. package/dist/cron-cli-gkH2qKM4.js +0 -498
  533. package/dist/daemon-cli-BTdNO1vH.js +0 -737
  534. package/dist/daemon-cli-DNNqI2LD.js +0 -735
  535. package/dist/daemon-install-CaEHG92p.js +0 -56
  536. package/dist/daemon-install-DbpDSDfW.js +0 -60
  537. package/dist/daemon-install-helpers-DjE_WnlY.js +0 -504
  538. package/dist/daemon-install-helpers-DocTUxqQ.js +0 -504
  539. package/dist/deliver-CDcL8ok6.js +0 -481
  540. package/dist/deliver-CS8JsevV.js +0 -481
  541. package/dist/delivery-queue-CTaYZQ_8.js +0 -244
  542. package/dist/delivery-queue-DMZ7mH8P.js +0 -244
  543. package/dist/devices-cli-BBJ4His-.js +0 -319
  544. package/dist/devices-cli-DHSJSFW1.js +0 -323
  545. package/dist/diagnostics-BSvCaLNs.js +0 -35
  546. package/dist/diagnostics-mWFAsFeo.js +0 -35
  547. package/dist/directory-cli-C-oHD_XE.js +0 -224
  548. package/dist/directory-cli-Cw99VGvr.js +0 -220
  549. package/dist/dispatcher-C8d1NNLZ.js +0 -174
  550. package/dist/dispatcher-DY6Ga60j.js +0 -173
  551. package/dist/dm-policy-shared-CRQ-Wr5g.js +0 -22
  552. package/dist/dm-policy-shared-CXXf2ltd.js +0 -22
  553. package/dist/dns-cli-BOqx9qo1.js +0 -199
  554. package/dist/dns-cli-WfqSC3JU.js +0 -203
  555. package/dist/dock-Big-J2VN.js +0 -929
  556. package/dist/dock-Cj4PKiUh.js +0 -928
  557. package/dist/doctor-completion-hYqcZ7IE.js +0 -92
  558. package/dist/doctor-completion-nxQQ5bEw.js +0 -92
  559. package/dist/doctor-config-flow-BUuADMDa.js +0 -1935
  560. package/dist/doctor-config-flow-yOUpQC2B.js +0 -1934
  561. package/dist/enable-DC9V0nTO.js +0 -59
  562. package/dist/env-B3zr72vQ.js +0 -60
  563. package/dist/errors-CdmXrBic.js +0 -35
  564. package/dist/errors-Cr_NbOb4.js +0 -35
  565. package/dist/exec-D_s-zAtY.js +0 -164
  566. package/dist/exec-Zz6eJ6YU.js +0 -164
  567. package/dist/fetch-BIZkXB5i.js +0 -67
  568. package/dist/fetch-DRVdxxEj.js +0 -67
  569. package/dist/fetch-DTR2MlOk.js +0 -67
  570. package/dist/file-lock-6NXMPZTT.js +0 -107
  571. package/dist/file-lock-C_KRlR7M.js +0 -107
  572. package/dist/fs-safe-DZHpH7TI.js +0 -98
  573. package/dist/fs-safe-vm3JMUkq.js +0 -88
  574. package/dist/gateway-cli-DEW-Ukmc.js +0 -24351
  575. package/dist/gateway-cli-DQYcZCOV.js +0 -24347
  576. package/dist/gateway-rpc-BCFkQPa2.js +0 -28
  577. package/dist/gateway-rpc-DOgYbsOG.js +0 -28
  578. package/dist/gmail-setup-utils-DMeA1UM1.js +0 -423
  579. package/dist/gmail-setup-utils-FHWSAur3.js +0 -422
  580. package/dist/health-BrLNGkZV.js +0 -1414
  581. package/dist/health-C8p9mnfl.js +0 -1417
  582. package/dist/heartbeat-visibility-CJVdaMZF.js +0 -125
  583. package/dist/heartbeat-visibility-DwK1UL0t.js +0 -125
  584. package/dist/hook-runner-global-C0DFQmQw.js +0 -527
  585. package/dist/hooks-cli-DEKi-tbA.js +0 -1221
  586. package/dist/hooks-cli-FndXPMD3.js +0 -1225
  587. package/dist/image-ops-B9ofmzSq.js +0 -354
  588. package/dist/image-ops-CMuvRsMY.js +0 -354
  589. package/dist/import-BH13F5mT.js +0 -606
  590. package/dist/import-D8HVcDqO.js +0 -604
  591. package/dist/inbound-context-BLy-G2Eq.js +0 -68
  592. package/dist/inbound-context-CmmmT8IP.js +0 -68
  593. package/dist/inbound-path-policy-BdmTOUka.js +0 -90
  594. package/dist/inbound-path-policy-BurOAu44.js +0 -90
  595. package/dist/inspect-nW8LAukU.js +0 -286
  596. package/dist/inspect-xy2EHy8G.js +0 -286
  597. package/dist/installs-CpfHmKY1.js +0 -325
  598. package/dist/installs-DebiMrGj.js +0 -325
  599. package/dist/ipv4-ysiNGssl.js +0 -46
  600. package/dist/ipv4-zc_Hfvbp.js +0 -46
  601. package/dist/ir-CaxTklDC.js +0 -940
  602. package/dist/lifecycle-core-Z5SScMlU.js +0 -476
  603. package/dist/lifecycle-core-pPwYSt7m.js +0 -474
  604. package/dist/loader-BapIdJyx.js +0 -22404
  605. package/dist/loader-BdAToyDH.js +0 -22401
  606. package/dist/local-roots-CrJ_Jv_G.js +0 -314
  607. package/dist/local-roots-n_Y4iYwb.js +0 -313
  608. package/dist/logger-B8yHnzPl.js +0 -49
  609. package/dist/login-C99fsB0N.js +0 -61
  610. package/dist/login-cLvGPjeO.js +0 -62
  611. package/dist/login-qr-CGqRFwgl.js +0 -329
  612. package/dist/login-qr-dnY5DC2C.js +0 -325
  613. package/dist/logs-cli-Bda7xY4N.js +0 -236
  614. package/dist/logs-cli-HzR-vnpD.js +0 -240
  615. package/dist/markdown-tables-58Hq__7K.js +0 -29
  616. package/dist/markdown-tables-GFEX0OR6.js +0 -29
  617. package/dist/media-CFsyXs3H.js +0 -940
  618. package/dist/media-Du5SHtnp.js +0 -10452
  619. package/dist/message-action-names-BfuEvR6j.js +0 -2521
  620. package/dist/message-action-names-CVBkpOLt.js +0 -2521
  621. package/dist/message-channel-FMNRI5Ax.js +0 -91
  622. package/dist/mime-AuIDUZPG.js +0 -149
  623. package/dist/mime-Cqg1jjia.js +0 -149
  624. package/dist/net-BEFkF-nI.js +0 -225
  625. package/dist/net-CNsUGiSw.js +0 -225
  626. package/dist/node-cli-Bu-InsO9.js +0 -1462
  627. package/dist/node-cli-DE7Pm7Fr.js +0 -1458
  628. package/dist/node-service-CumFZc9L.js +0 -67
  629. package/dist/node-service-DY1gG06I.js +0 -67
  630. package/dist/nodes-cli-B5aAExN0.js +0 -1350
  631. package/dist/nodes-cli-eKRqlKuO.js +0 -1346
  632. package/dist/nodes-screen-B3Sij1uT.js +0 -250
  633. package/dist/nodes-screen-DEvpoFmH.js +0 -250
  634. package/dist/note-CPFJCWJJ.js +0 -92
  635. package/dist/npm-registry-spec-BgMtTHvq.js +0 -786
  636. package/dist/npm-registry-spec-Dz3z1Zpd.js +0 -786
  637. package/dist/npm-resolution-Buio63BQ.js +0 -86
  638. package/dist/npm-resolution-gH1zHW2a.js +0 -86
  639. package/dist/onboard-BSf6qJWk.js +0 -647
  640. package/dist/onboard-V-SsZRk-.js +0 -649
  641. package/dist/onboard-auth-C_wHkop1.js +0 -207
  642. package/dist/onboard-auth-CkCBLvTg.js +0 -211
  643. package/dist/onboard-channels-DQTGPC18.js +0 -2548
  644. package/dist/onboard-channels-DSDQfR0u.js +0 -2547
  645. package/dist/onboard-helpers-Q7M6vdzh.js +0 -363
  646. package/dist/onboard-helpers-SCO3k5Y8.js +0 -364
  647. package/dist/onboard-remote-Co2hv1AD.js +0 -127
  648. package/dist/onboard-remote-Dl3BFSg2.js +0 -127
  649. package/dist/onboarding-B0bJfZ20.js +0 -588
  650. package/dist/onboarding-CeBR9OBi.js +0 -586
  651. package/dist/onboarding.finalize-BPgfWPB9.js +0 -404
  652. package/dist/onboarding.finalize-BmfLvNPJ.js +0 -402
  653. package/dist/onboarding.gateway-config-BL0Q7Wpg.js +0 -201
  654. package/dist/onboarding.gateway-config-D2QsXMYO.js +0 -195
  655. package/dist/outbound-CcaPcetn.js +0 -220
  656. package/dist/outbound-CeiW8z3a.js +0 -221
  657. package/dist/outbound-attachment-BIvFb3Is.js +0 -18
  658. package/dist/outbound-attachment-Bfm5-JYe.js +0 -18
  659. package/dist/outbound-attachment-CZ7zoYxB.js +0 -18
  660. package/dist/pairing-cli-CgX79ujL.js +0 -125
  661. package/dist/pairing-cli-DvbbXFgC.js +0 -129
  662. package/dist/pairing-labels-3wDxaApH.js +0 -9
  663. package/dist/pairing-labels-DCbWnbWk.js +0 -9
  664. package/dist/pairing-store-CdY7iRS0.js +0 -459
  665. package/dist/pairing-store-DykkYpQ7.js +0 -460
  666. package/dist/path-env-Cqo5LZmw.js +0 -89
  667. package/dist/path-env-GTM4HXCN.js +0 -89
  668. package/dist/path-safety-CXKAVpMp.js +0 -14
  669. package/dist/path-safety-DGB91qBk.js +0 -14
  670. package/dist/plugin-auto-enable-C6FPGg_-.js +0 -301
  671. package/dist/plugin-auto-enable-L8eOc8iC.js +0 -302
  672. package/dist/plugin-registry-CHlaWZD7.js +0 -33
  673. package/dist/plugin-registry-DQdMze4z.js +0 -33
  674. package/dist/plugin-sdk/auth/session-override.d.ts +0 -17
  675. package/dist/plugin-sdk/auto-reply/reply/directive-handling.auth.d.ts +0 -18
  676. package/dist/plugin-sdk/link-understanding/apply.d.ts +0 -10
  677. package/dist/plugin-sdk/link-understanding/defaults.d.ts +0 -2
  678. package/dist/plugin-sdk/link-understanding/detect.d.ts +0 -3
  679. package/dist/plugin-sdk/link-understanding/format.d.ts +0 -4
  680. package/dist/plugin-sdk/link-understanding/runner.d.ts +0 -11
  681. package/dist/plugin-sdk/media/input-files.d.ts +0 -95
  682. package/dist/plugin-sdk/media-understanding/apply.d.ts +0 -19
  683. package/dist/plugin-sdk/media-understanding/attachments.d.ts +0 -49
  684. package/dist/plugin-sdk/media-understanding/concurrency.d.ts +0 -1
  685. package/dist/plugin-sdk/media-understanding/defaults.d.ts +0 -11
  686. package/dist/plugin-sdk/media-understanding/errors.d.ts +0 -6
  687. package/dist/plugin-sdk/media-understanding/format.d.ts +0 -7
  688. package/dist/plugin-sdk/media-understanding/fs.d.ts +0 -1
  689. package/dist/plugin-sdk/media-understanding/output-extract.d.ts +0 -2
  690. package/dist/plugin-sdk/media-understanding/providers/anthropic/index.d.ts +0 -2
  691. package/dist/plugin-sdk/media-understanding/providers/deepgram/audio.d.ts +0 -1
  692. package/dist/plugin-sdk/media-understanding/providers/deepgram/index.d.ts +0 -2
  693. package/dist/plugin-sdk/media-understanding/providers/google/audio.d.ts +0 -1
  694. package/dist/plugin-sdk/media-understanding/providers/google/index.d.ts +0 -2
  695. package/dist/plugin-sdk/media-understanding/providers/google/video.d.ts +0 -3
  696. package/dist/plugin-sdk/media-understanding/providers/groq/index.d.ts +0 -2
  697. package/dist/plugin-sdk/media-understanding/providers/index.d.ts +0 -4
  698. package/dist/plugin-sdk/media-understanding/providers/minimax/index.d.ts +0 -2
  699. package/dist/plugin-sdk/media-understanding/providers/mistral/index.d.ts +0 -2
  700. package/dist/plugin-sdk/media-understanding/providers/moonshot/index.d.ts +0 -2
  701. package/dist/plugin-sdk/media-understanding/providers/moonshot/video.d.ts +0 -3
  702. package/dist/plugin-sdk/media-understanding/providers/openai/audio.d.ts +0 -1
  703. package/dist/plugin-sdk/media-understanding/providers/openai/index.d.ts +0 -2
  704. package/dist/plugin-sdk/media-understanding/providers/shared.d.ts +0 -20
  705. package/dist/plugin-sdk/media-understanding/providers/zai/index.d.ts +0 -2
  706. package/dist/plugin-sdk/media-understanding/resolve.d.ts +0 -44
  707. package/dist/plugin-sdk/media-understanding/runner.d.ts +0 -34
  708. package/dist/plugin-sdk/media-understanding/runner.entries.d.ts +0 -33
  709. package/dist/plugin-sdk/media-understanding/scope.d.ts +0 -9
  710. package/dist/plugin-sdk/media-understanding/types.d.ts +0 -59
  711. package/dist/plugin-sdk/media-understanding/video.d.ts +0 -2
  712. package/dist/plugin-sdk/utils/mask-api-key.d.ts +0 -1
  713. package/dist/plugin-sdk/utils/run-with-concurrency.d.ts +0 -11
  714. package/dist/plugins-7B167wIj.js +0 -453
  715. package/dist/plugins-BRHOfy1Z.js +0 -455
  716. package/dist/plugins-cli--I43zIaS.js +0 -797
  717. package/dist/plugins-cli-DIxMbY9I.js +0 -801
  718. package/dist/ports-BS8kQkd9.js +0 -96
  719. package/dist/ports-CAqyeQYZ.js +0 -316
  720. package/dist/ports-CTUgXF2d.js +0 -96
  721. package/dist/ports-DqfnVnCw.js +0 -370
  722. package/dist/preflight-CaRJtknt.js +0 -64
  723. package/dist/preflight-DeDRKMx4.js +0 -68
  724. package/dist/program-context-9dv7ClZz.js +0 -474
  725. package/dist/program-wVSvyiD-.js +0 -248
  726. package/dist/prompt-select-styled-BE_4W66Z.js +0 -1672
  727. package/dist/prompt-select-styled-BTPf06Os.js +0 -1669
  728. package/dist/provider-dispatcher-VZWITjmt.js +0 -660
  729. package/dist/provider-dispatcher-zYYGo00g.js +0 -659
  730. package/dist/push-apns-Cj0Ryn18.js +0 -713
  731. package/dist/push-apns-fFfYCqda.js +0 -711
  732. package/dist/pw-ai-CnN2sITD.js +0 -1908
  733. package/dist/pw-ai-fnX3cecw.js +0 -1911
  734. package/dist/qr-cli-CriPg41m.js +0 -349
  735. package/dist/qr-cli-DSURqD0D.js +0 -353
  736. package/dist/redact-snapshot-BecRL_h6.js +0 -2016
  737. package/dist/redact-snapshot-pTdzSrex.js +0 -2016
  738. package/dist/register.agent-B5_1XatO.js +0 -290
  739. package/dist/register.agent-Dba3CYyo.js +0 -1018
  740. package/dist/register.configure-DmwHGsPG.js +0 -128
  741. package/dist/register.configure-DrPlgBqB.js +0 -133
  742. package/dist/register.import-CPQqqdje.js +0 -31
  743. package/dist/register.import-D1UaH1QV.js +0 -29
  744. package/dist/register.maintenance-D76tiF4W.js +0 -501
  745. package/dist/register.maintenance-hUriFBfi.js +0 -499
  746. package/dist/register.message--VzmF3u4.js +0 -685
  747. package/dist/register.message-itNWUdvP.js +0 -689
  748. package/dist/register.onboard-Co8D908b.js +0 -93
  749. package/dist/register.onboard-q8JzWtuv.js +0 -97
  750. package/dist/register.setup-Djc6jZTc.js +0 -113
  751. package/dist/register.setup-hhPii4O7.js +0 -117
  752. package/dist/register.status-health-sessions-C1FhACQB.js +0 -668
  753. package/dist/register.status-health-sessions-DcUegHcH.js +0 -428
  754. package/dist/register.subclis-DAfihpBz.js +0 -267
  755. package/dist/replies-IpiCq1Ht.js +0 -136
  756. package/dist/replies-LSx_XhsP.js +0 -136
  757. package/dist/reply-D0CLqcBY.js +0 -13718
  758. package/dist/reply-Djq8ghfI.js +0 -13715
  759. package/dist/reply-directives-Cz7622Qx.js +0 -182
  760. package/dist/reply-directives-ssnaPNiU.js +0 -182
  761. package/dist/reply-payloads-CQMtrphw.js +0 -527
  762. package/dist/reply-prefix-CWcAZKhE.js +0 -37
  763. package/dist/reply-prefix-Drq7Pf3A.js +0 -37
  764. package/dist/resolve-route-B8uIc2H3.js +0 -249
  765. package/dist/resolve-route-C8ooNlI4.js +0 -249
  766. package/dist/response-prefix-template-DPOggmPO.js +0 -134
  767. package/dist/retry-BdhJlZQI.js +0 -77
  768. package/dist/run-main-B-Cb62fC.js +0 -306
  769. package/dist/runner-DUnmgjJ8.js +0 -2394
  770. package/dist/runner-EobZIrDt.js +0 -2394
  771. package/dist/secure-random-B5qmFc3N.js +0 -44
  772. package/dist/security-cli-05blEYyC.js +0 -482
  773. package/dist/security-cli-DYbt8duB.js +0 -487
  774. package/dist/send-7O3-bRtl.js +0 -547
  775. package/dist/send-9Huf62k3.js +0 -2245
  776. package/dist/send-B9mIJdUo.js +0 -547
  777. package/dist/send-Bj0RXr-a.js +0 -492
  778. package/dist/send-BzkAsn7K.js +0 -29
  779. package/dist/send-CXFhFLP9.js +0 -11
  780. package/dist/send-Ce_BDa8P.js +0 -349
  781. package/dist/send-ChvasRSh.js +0 -1779
  782. package/dist/send-Cl5BhbnF.js +0 -426
  783. package/dist/send-CpebTvM6.js +0 -374
  784. package/dist/send-DWf7BCPe.js +0 -492
  785. package/dist/send-DX8QSuSI.js +0 -1174
  786. package/dist/send-DZRn6PT2.js +0 -332
  787. package/dist/send-Dd2_MykI.js +0 -2245
  788. package/dist/send-IJaUAa8H.js +0 -1776
  789. package/dist/send-vvZXksNU.js +0 -349
  790. package/dist/server-BrzR9JmX.js +0 -206
  791. package/dist/server-_h27-uP_.js +0 -202
  792. package/dist/server-lifecycle-CUdA6Far.js +0 -2437
  793. package/dist/server-lifecycle-DQZWL8iP.js +0 -2437
  794. package/dist/server-node-events-DgB1z2Cx.js +0 -392
  795. package/dist/server-node-events-DtvPfM1I.js +0 -396
  796. package/dist/service-9le8AnC-.js +0 -670
  797. package/dist/service-Drb0kx6I.js +0 -670
  798. package/dist/session-BIAOl5QR.js +0 -170
  799. package/dist/session-Wu00pCn_.js +0 -170
  800. package/dist/session-cost-usage-7plmOKbs.js +0 -627
  801. package/dist/session-cost-usage-CPFxBFUg.js +0 -627
  802. package/dist/session-dirs-CfIrIJxG.js +0 -318
  803. package/dist/session-dirs-DlPpWt5Q.js +0 -318
  804. package/dist/session-utils-Sd9w4vc1.js +0 -622
  805. package/dist/session-utils-iL47hYmZ.js +0 -622
  806. package/dist/sessions-6pKQ3gN3.js +0 -247
  807. package/dist/sessions-ZRmCDdj1.js +0 -2569
  808. package/dist/shell-env-DYZq9PqC.js +0 -163
  809. package/dist/ssrf-B-rF_tZB.js +0 -183
  810. package/dist/ssrf-DJW14Wkh.js +0 -183
  811. package/dist/status-CTRQCXRj.js +0 -1979
  812. package/dist/status-Y67xsH93.js +0 -1983
  813. package/dist/status.update-DlBReI5-.js +0 -449
  814. package/dist/status.update-v7fEQ7R9.js +0 -449
  815. package/dist/store-B5989JkX.js +0 -64
  816. package/dist/store-BgtgYJoX.js +0 -53
  817. package/dist/store-DCrrxHyS.js +0 -2571
  818. package/dist/store-Ql6vAcsg.js +0 -64
  819. package/dist/subagent-registry-BGknZEUI.js +0 -4856
  820. package/dist/subagent-registry-CWeRBjfn.js +0 -4854
  821. package/dist/subsystem-Ct6qOOqZ.js +0 -1079
  822. package/dist/subsystem-PQ64_nsu.js +0 -1136
  823. package/dist/system-cli-CmO-4Rju.js +0 -77
  824. package/dist/system-cli-VBsa18K6.js +0 -73
  825. package/dist/systemd-CqFpK30Y.js +0 -547
  826. package/dist/systemd-fK9AV5bP.js +0 -547
  827. package/dist/systemd-hints-D3rr0j14.js +0 -278
  828. package/dist/systemd-hints-DNOSRaqA.js +0 -278
  829. package/dist/systemd-linger-B907NVVy.js +0 -75
  830. package/dist/systemd-linger-wYksBbM7.js +0 -75
  831. package/dist/tables-Boxa9MJH.js +0 -55
  832. package/dist/tables-CO_kxD0e.js +0 -55
  833. package/dist/tables-WZp8Vt9n.js +0 -55
  834. package/dist/tailnet-CfZhpSnt.js +0 -40
  835. package/dist/tailnet-D0NV0tRJ.js +0 -40
  836. package/dist/tailscale-B__xvMjA.js +0 -230
  837. package/dist/tailscale-q_ZrxUCc.js +0 -230
  838. package/dist/targets-B4rMyQFJ.js +0 -53
  839. package/dist/targets-BHYLCv06.js +0 -2534
  840. package/dist/targets-BjWhDMJM.js +0 -650
  841. package/dist/targets-BnpMZZC_.js +0 -120
  842. package/dist/targets-CHwGDIgO.js +0 -650
  843. package/dist/targets-DIDKlfKI.js +0 -220
  844. package/dist/targets-bqjVeCnF.js +0 -2535
  845. package/dist/targets-mqj9GNg1.js +0 -53
  846. package/dist/tool-display-C0hpLmkw.js +0 -785
  847. package/dist/tool-display-CQTRHo3Z.js +0 -785
  848. package/dist/tool-images-BYY11Gw3.js +0 -263
  849. package/dist/tool-images-CnJ0R8Fo.js +0 -263
  850. package/dist/trash-C0mjnHuW.js +0 -125
  851. package/dist/trash-Cgwc9mLD.js +0 -125
  852. package/dist/tui-9cJnR1dN.js +0 -3282
  853. package/dist/tui-BR3egaFJ.js +0 -3282
  854. package/dist/tui-cli-BYpkhE6J.js +0 -66
  855. package/dist/tui-cli-DndeZyup.js +0 -62
  856. package/dist/update-BJVdkzk7.js +0 -349
  857. package/dist/update-DjI6KTA5.js +0 -349
  858. package/dist/update-cli-B7Rl2Qr2.js +0 -1146
  859. package/dist/update-cli-CFk_jqUm.js +0 -1148
  860. package/dist/usage-CFv4a1Nf.js +0 -5448
  861. package/dist/voice-credentials-D59RcLbl.js +0 -45
  862. package/dist/voice-credentials-fjA7GShF.js +0 -45
  863. package/dist/web-Bs1td8Qw.js +0 -79
  864. package/dist/web-CSiw--Px.js +0 -3070
  865. package/dist/web-jRTtDiNf.js +0 -74
  866. package/dist/webhooks-cli-0yQha2yj.js +0 -334
  867. package/dist/webhooks-cli-ula0bTX-.js +0 -330
  868. package/dist/whatsapp-actions-3NdzsNg1.js +0 -130
  869. package/dist/whatsapp-actions-y_1vjkYY.js +0 -125
  870. package/dist/workspace-BT3X-qCZ.js +0 -449
  871. package/dist/workspace-D5hHXubL.js +0 -447
  872. package/dist/zod-schema-CbqZAIYy.js +0 -2696
  873. package/dist/zod-schema-YGQJEcnj.js +0 -2696
  874. /package/dist/{account-lookup-BOCzCnir.js → account-lookup-CIY_RKhi.js} +0 -0
  875. /package/dist/{account-lookup-C0ndrpt-.js → account-lookup-DGscKBsr.js} +0 -0
  876. /package/dist/{agent-helpers-eEHy5uX2.js → agent-helpers-D83kfcF9.js} +0 -0
  877. /package/dist/{agents.config-BgDBcY4h.js → agents.config-BPe_hkMn.js} +0 -0
  878. /package/dist/{api-Cd_7aESj.js → api-D8QQo5bc.js} +0 -0
  879. /package/dist/{api-DJ_oWYus.js → api-GywrnwRm.js} +0 -0
  880. /package/dist/{argv-BY8EVMTP.js → argv-DW4MYBdJ.js} +0 -0
  881. /package/dist/{bindings-Dr0bGRst.js → bindings-BpL4pISF.js} +0 -0
  882. /package/dist/{brew-CmTYeZk1.js → brew-CBsS-Vq1.js} +0 -0
  883. /package/dist/{brew-V4lMBeE3.js → brew-Clw9vXhE.js} +0 -0
  884. /package/dist/{chat-envelope-CrM0X4sl.js → chat-envelope-CY1yvCc-.js} +0 -0
  885. /package/dist/{chat-envelope-BIujl9Cj.js → chat-envelope-DUMcMMB2.js} +0 -0
  886. /package/dist/{chat-type-CH3W-zKy.js → chat-type-BKe459rw.js} +0 -0
  887. /package/dist/{chat-type-DyovJwCt.js → chat-type-CE6cJOyt.js} +0 -0
  888. /package/dist/{cleanup-utils-CNwlTKyR.js → cleanup-utils-365rf8YN.js} +0 -0
  889. /package/dist/{cleanup-utils-gNzIs9yk.js → cleanup-utils-rqUXvR3Z.js} +0 -0
  890. /package/dist/{cli-name-3MdfbvIR.js → cli-name-7Gb97Vyl.js} +0 -0
  891. /package/dist/{cli-name-CRLBidNP.js → cli-name-Yv30OygA.js} +0 -0
  892. /package/dist/{cli-utils-5ZIfXAfM.js → cli-utils-5W6ugvN5.js} +0 -0
  893. /package/dist/{cli-utils-BUOtyfnU.js → cli-utils-CZJacPS2.js} +0 -0
  894. /package/dist/{client-D5m46AuY.js → client-DQ-Nh-rV.js} +0 -0
  895. /package/dist/{client-DFyI5I0n.js → client-Fi2k2G9Z.js} +0 -0
  896. /package/dist/{command-options-Cn2fc1Of.js → command-options-CXHYeogR.js} +0 -0
  897. /package/dist/{command-options-D2nN4AXX.js → command-options-Cx6evn0x.js} +0 -0
  898. /package/dist/{config-eval-CU2G7a83.js → config-eval-DU_v_3lY.js} +0 -0
  899. /package/dist/{config-eval-BCKpAS_K.js → config-eval-V26Gl6eZ.js} +0 -0
  900. /package/dist/{constants-CRGAZ2ow.js → constants-C7gkSGRE.js} +0 -0
  901. /package/dist/{constants-BAZuhSRm.js → constants-DAiBiWlI.js} +0 -0
  902. /package/dist/{constants-DoYLsBmv.js → constants-DOnQraOP.js} +0 -0
  903. /package/dist/{constants-BBVTjb1j.js → constants-DQxqJVLu.js} +0 -0
  904. /package/dist/{credentials-DMAWNZdV.js → credentials-BHWUBHMd.js} +0 -0
  905. /package/dist/{credentials-Dmc3H-jd.js → credentials-DG0tD6-e.js} +0 -0
  906. /package/dist/{daemon-runtime-CzFI2dPw.js → daemon-runtime-B7Tmba31.js} +0 -0
  907. /package/dist/{daemon-runtime-aQhinwSL.js → daemon-runtime-KyXiP2ib.js} +0 -0
  908. /package/dist/{dangerous-name-matching-BlTBBZns.js → dangerous-name-matching-B4MRPcn-.js} +0 -0
  909. /package/dist/{dangerous-tools-BRmbBvRf.js → dangerous-tools-CIPZZJoN.js} +0 -0
  910. /package/dist/{dangerous-tools-E1i3IoxZ.js → dangerous-tools-D-GNbdpV.js} +0 -0
  911. /package/dist/{fetch-timeout-DBRRPNBi.js → fetch-timeout-CPe2rPLq.js} +0 -0
  912. /package/dist/{fetch-timeout-l_6RdoMw.js → fetch-timeout-DkT3EnRA.js} +0 -0
  913. /package/dist/{file-identity-BnGA6wyc.js → file-identity-C8MIb5lb.js} +0 -0
  914. /package/dist/{format-duration-B-Uv5nOi.js → format-duration-Cd7SCued.js} +0 -0
  915. /package/dist/{format-duration-D1M3Zxu6.js → format-duration-Oj8pTbYL.js} +0 -0
  916. /package/dist/{format-relative-Cywx6ldk.js → format-relative-8dpVUfzZ.js} +0 -0
  917. /package/dist/{format-relative-DcQZUAYl.js → format-relative-BMNeqaxW.js} +0 -0
  918. /package/dist/{health-format-CL2Xq92A.js → health-format-CwLlmYSK.js} +0 -0
  919. /package/dist/{health-format-CVgQD-z9.js → health-format-CycFH5Sj.js} +0 -0
  920. /package/dist/{heartbeat-wake-DLxQm6-U.js → heartbeat-wake-D6Lt5YUk.js} +0 -0
  921. /package/dist/{heartbeat-wake-DjsTDzF3.js → heartbeat-wake-uZkAP-tP.js} +0 -0
  922. /package/dist/{help-format-DM6-OBt-.js → help-format-B0YIbosn.js} +0 -0
  923. /package/dist/{help-format-CJQ7APRn.js → help-format-GeOPYD_A.js} +0 -0
  924. /package/dist/{helpers-BER76F_2.js → helpers-6_MYSJEW.js} +0 -0
  925. /package/dist/{helpers-DSMIGYx2.js → helpers-703bXVlF.js} +0 -0
  926. /package/dist/{helpers-D-r6yhnI.js → helpers-p_u0Gnj_.js} +0 -0
  927. /package/dist/{input-provenance-BgfeDgck.js → input-provenance-C4nlFv5Y.js} +0 -0
  928. /package/dist/{input-provenance-xUsSMOsz.js → input-provenance-duDehu0D.js} +0 -0
  929. /package/dist/{ip-BAhS4rY2.js → ip-BFJnbRh9.js} +0 -0
  930. /package/dist/{ip-BUhsZdJu.js → ip-D0zgNmBV.js} +0 -0
  931. /package/dist/{is-main-BmHYGRhd.js → is-main-BE1Jih91.js} +0 -0
  932. /package/dist/{json-file-B5WEJJye.js → json-file-CsV03dh-.js} +0 -0
  933. /package/dist/{json-file-Dbg7nZg1.js → json-file-CtQKYRLl.js} +0 -0
  934. /package/dist/{json-files-BFGbyEzL.js → json-files-B2yMsppu.js} +0 -0
  935. /package/dist/{json-files-CfhnuGaC.js → json-files-BYH8U7Mx.js} +0 -0
  936. /package/dist/{lanes-4FoQemog.js → lanes-BWL_LwXG.js} +0 -0
  937. /package/dist/{lanes-BhdzrAIa.js → lanes-cHJ5arWg.js} +0 -0
  938. /package/dist/{links-CwTlzaPe.js → links-BFtUmGLH.js} +0 -0
  939. /package/dist/{links-D5vtq30Q.js → links-BNjLUJ9U.js} +0 -0
  940. /package/dist/{location-50gaJF5Z.js → location-BC45kOxc.js} +0 -0
  941. /package/dist/{location-Qo8Ii1zo.js → location-BUhzov-a.js} +0 -0
  942. /package/dist/{logger-IA_Dr_BT.js → logger-1QWMF9Hc.js} +0 -0
  943. /package/dist/{logger-nEdVxm5D.js → logger-BWMPnILd.js} +0 -0
  944. /package/dist/{logger-O6JX52kK.js → logger-Liu31nEU.js} +0 -0
  945. /package/dist/{logging-FctZEleJ.js → logging-CtbzyUjs.js} +0 -0
  946. /package/dist/{logging-BiuZwq5D.js → logging-DJFQvfGD.js} +0 -0
  947. /package/dist/{logging-Bs1VqVFL.js → logging-JiRrQn2_.js} +0 -0
  948. /package/dist/{logging-JZEg5nDp.js → logging-kuFzZMsG.js} +0 -0
  949. /package/dist/{message-channel-tuc9CdEw.js → message-channel-DOyKgFu8.js} +0 -0
  950. /package/dist/{mutable-allowlist-detectors-CtKavajp.js → mutable-allowlist-detectors-4m-Kc8Kn.js} +0 -0
  951. /package/dist/{mutable-allowlist-detectors-TCG6mnbz.js → mutable-allowlist-detectors-BECxOoKX.js} +0 -0
  952. /package/dist/{onboard-config-BxfgUqk6.js → onboard-config-C9so5ggC.js} +0 -0
  953. /package/dist/{onboard-config-DNzlo8Cg.js → onboard-config-oXID97rS.js} +0 -0
  954. /package/dist/{parse-log-line-CT0H1-oQ.js → parse-log-line-BtFI563v.js} +0 -0
  955. /package/dist/{parse-log-line-pij_xhtE.js → parse-log-line-COptqka7.js} +0 -0
  956. /package/dist/{parse-timeout-CvODy9RC.js → parse-timeout-BpphuwYl.js} +0 -0
  957. /package/dist/{path-guards-DOpzcMXz.js → path-guards-DJteVA0d.js} +0 -0
  958. /package/dist/{path-guards-DipYoPVw.js → path-guards-DVRUJZVN.js} +0 -0
  959. /package/dist/plugin-sdk/{media-understanding → stt}/providers/google/inline-data.d.ts +0 -0
  960. /package/dist/{plugins-allowlist-Bcqe9Gd8.js → plugins-allowlist-Clt6dsY6.js} +0 -0
  961. /package/dist/{polls-DQrR-qT3.js → polls-C5xr-8pM.js} +0 -0
  962. /package/dist/{polls-ybwcqkWt.js → polls-DXd67TD8.js} +0 -0
  963. /package/dist/{ports-lsof-CDyv5GJd.js → ports-lsof-xWMTWvMQ.js} +0 -0
  964. /package/dist/{process-scoped-map-BwUkYFQV.js → process-scoped-map-C7KeadUK.js} +0 -0
  965. /package/dist/{process-scoped-map-_zxf_kLz.js → process-scoped-map-CQ1C5MbT.js} +0 -0
  966. /package/dist/{program-context-CG-t6Yp-.js → program-context-LuBAPt4y.js} +0 -0
  967. /package/dist/{progress-DRLmcFiG.js → progress-C-hTn2yV.js} +0 -0
  968. /package/dist/{progress-BOdRbOHD.js → progress-ChmZpgvt.js} +0 -0
  969. /package/dist/{prompt-WEkXwIMT.js → prompt-BXeXEH0o.js} +0 -0
  970. /package/dist/{prompt-BRGfic91.js → prompt-C31r0R5I.js} +0 -0
  971. /package/dist/{prompt-style-B4Cq4PyQ.js → prompt-style-BcM-VSMx.js} +0 -0
  972. /package/dist/{proxy-BMJL0Qog.js → proxy-dRhp8Ykw.js} +0 -0
  973. /package/dist/{pw-ai-state-CwXeO5d0.js → pw-ai-state-CjfcKQoO.js} +0 -0
  974. /package/dist/{pw-ai-state-DaISdsXY.js → pw-ai-state-DfjyEttO.js} +0 -0
  975. /package/dist/{redact-gXuh8MFk.js → redact-D975G-N6.js} +0 -0
  976. /package/dist/{redact-CqWx9rpK.js → redact-Dx1Fue21.js} +0 -0
  977. /package/dist/{redact-identifier-BJOQDEj0.js → redact-identifier-Bqj_YiPd.js} +0 -0
  978. /package/dist/{redact-identifier-DR54qsoT.js → redact-identifier-HyK89Sod.js} +0 -0
  979. /package/dist/{remoteclaw-root-CgNyrbxc.js → remoteclaw-root-B1iQBmbi.js} +0 -0
  980. /package/dist/{remoteclaw-root-u8dAeHID.js → remoteclaw-root-BmYwCzQN.js} +0 -0
  981. /package/dist/{render-CDCvpfhh.js → render-BvFSFJZW.js} +0 -0
  982. /package/dist/{render-CJl4GK1B.js → render-flG67HhW.js} +0 -0
  983. /package/dist/{response-prefix-template-D3ZcJP4E.js → response-prefix-template-DDvbVpx6.js} +0 -0
  984. /package/dist/{retry-cXXk2j6_.js → retry-CByUYDAZ.js} +0 -0
  985. /package/dist/{retry-B19gMxS7.js → retry-oNE3cBeG.js} +0 -0
  986. /package/dist/{runtime-guard-BS55uiSW.js → runtime-guard-CqNug-FG.js} +0 -0
  987. /package/dist/{runtime-guard-CK80eucm.js → runtime-guard-DAHXelsb.js} +0 -0
  988. /package/dist/{runtime-status-BhW7hP_U.js → runtime-status-CM4rzyfO.js} +0 -0
  989. /package/dist/{runtime-status-hFVEC3wO.js → runtime-status-DJYthOLz.js} +0 -0
  990. /package/dist/{secret-equal-CJzes24Z.js → secret-equal-1-dwi8DL.js} +0 -0
  991. /package/dist/{secret-equal-CQAmGfGc.js → secret-equal-CXJEZiWb.js} +0 -0
  992. /package/dist/{secure-random-B3f7Ri2X.js → secure-random-Ba4Y5xG5.js} +0 -0
  993. /package/dist/{secure-random-BkZFG9cd.js → secure-random-C6AVByhV.js} +0 -0
  994. /package/dist/{stagger-B-_Wnofy.js → stagger-CjeisVRF.js} +0 -0
  995. /package/dist/{stagger-B2ORDHsP.js → stagger-vkvpUmOz.js} +0 -0
  996. /package/dist/{status-C6YNwimj.js → status-DNLnVQZ4.js} +0 -0
  997. /package/dist/{status-yrDGXYZM.js → status-DZhl73dM.js} +0 -0
  998. /package/dist/{strip-inbound-meta-0cvL6itU.js → strip-inbound-meta-C3Cwe_ZO.js} +0 -0
  999. /package/dist/{strip-inbound-meta-DjKcSFaW.js → strip-inbound-meta-DuDjnGjC.js} +0 -0
  1000. /package/dist/{table-ByMyHTh_.js → table-B9zSN_7D.js} +0 -0
  1001. /package/dist/{table-C-dba-5-.js → table-j8Ayarot.js} +0 -0
  1002. /package/dist/{target-errors-DJVRKFcU.js → target-errors-ChjvOMuV.js} +0 -0
  1003. /package/dist/{target-errors-GZXDqlUu.js → target-errors-Dn4aykSV.js} +0 -0
  1004. /package/dist/{targets-B_d_1z3N.js → targets-BtGRUQMa.js} +0 -0
  1005. /package/dist/{targets-DOJXjN1U.js → targets-CE4AYRI9.js} +0 -0
  1006. /package/dist/{targets-D01MJGnh.js → targets-DlufWCmy.js} +0 -0
  1007. /package/dist/{targets-WSwPflb6.js → targets-akvAerZF.js} +0 -0
  1008. /package/dist/{text-format-DarxU3JH.js → text-format-VSogn9Yq.js} +0 -0
  1009. /package/dist/{text-format-mr5bZq0f.js → text-format-xeHt9ywT.js} +0 -0
  1010. /package/dist/{thinking-BqJmU6Zp.js → thinking-B171Rc3-.js} +0 -0
  1011. /package/dist/{tokens-C8yGxAcR.js → tokens-B-jmvNR9.js} +0 -0
  1012. /package/dist/{tokens-DAFBx5qr.js → tokens-kTLGxaAF.js} +0 -0
  1013. /package/dist/{usage-BXi79Rq6.js → usage-CRJFqYf8.js} +0 -0
  1014. /package/dist/{usage-C1lHaofV.js → usage-Txvb0Iq2.js} +0 -0
  1015. /package/dist/{usage-format-CD5jsZY1.js → usage-format-70DvrseE.js} +0 -0
  1016. /package/dist/{usage-format-CRVpDVj1.js → usage-format-Bs8DkQtr.js} +0 -0
  1017. /package/dist/{widearea-dns-C-0P7TRi.js → widearea-dns-BOgHvO4O.js} +0 -0
  1018. /package/dist/{widearea-dns-DFZMcfLf.js → widearea-dns-CGhfClCr.js} +0 -0
  1019. /package/dist/{workspace-BJCKO8Ns.js → workspace-DhUqtMK_.js} +0 -0
  1020. /package/dist/{wsl-kFaeW76c.js → wsl-Cs-gowFJ.js} +0 -0
@@ -1,2547 +0,0 @@
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 { c as resolveDefaultAgentId, o as resolveAgentWorkspaceDir } from "./agent-scope-CJW7vnF8.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-7B167wIj.js";
6
- import { a as resolveWhatsAppAuthDir, n as listWhatsAppAccountIds, r as resolveDefaultWhatsAppAccountId } from "./accounts-Aqbb2_Fn.js";
7
- import { n as resolveDefaultIMessageAccountId, r as resolveIMessageAccount, t as listIMessageAccountIds } from "./accounts-D3fAPVzU.js";
8
- import { i as resolveSignalAccount, n as listSignalAccountIds, r as resolveDefaultSignalAccountId } from "./accounts-DZmv4bXS.js";
9
- import { t as formatCliCommand } from "./command-format-LFmgWzKJ.js";
10
- import { l as normalizeDiscordSlug } from "./targets-CHwGDIgO.js";
11
- import { d as resolveDiscordChannelAllowlist, r as resolveSlackChannelAllowlist, t as loadRemoteClawPlugins } from "./loader-BdAToyDH.js";
12
- import { t as runCommandWithTimeout } from "./exec-D_s-zAtY.js";
13
- import { at as resolveSlackUserAllowlist, ot as resolveDiscordUserAllowlist } from "./reply-Djq8ghfI.js";
14
- import { t as loginWeb } from "./login-C99fsB0N.js";
15
- import { t as resolveBrewExecutable } from "./brew-V4lMBeE3.js";
16
- import { t as formatDocsLink } from "./links-CwTlzaPe.js";
17
- import { r as listChannelPluginCatalogEntries } from "./catalog-DTlcfTT9.js";
18
- import { t as resolveChannelDefaultAccountId } from "./helpers-CRrn7Err.js";
19
- import { n as isChannelConfigured } from "./plugin-auto-enable-C6FPGg_-.js";
20
- import { t as enablePluginInConfig } from "./enable-DzXMQJ-o.js";
21
- import { p as extractArchive } from "./npm-registry-spec-BgMtTHvq.js";
22
- import { n as recordPluginInstall, r as installPluginFromNpmSpec, t as buildNpmResolutionInstallFields } from "./installs-DebiMrGj.js";
23
- import { a as normalizeIMessageHandle } from "./send-Bj0RXr-a.js";
24
- import { n as detectBinary } from "./onboard-helpers-Q7M6vdzh.js";
25
- import { t as createPluginLoaderLogger } from "./logger-O6JX52kK.js";
26
- import { t as fetchTelegramChatId } from "./api-Cd_7aESj.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 === "next") 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 };