remoteclaw 0.1.0-next.87fb2cd → 0.1.0-next.9f7caba

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 (849) hide show
  1. package/dist/accounts-B5BNJ_lk.js +36 -0
  2. package/dist/accounts-BnkzjNsj.js +32 -0
  3. package/dist/accounts-DOwpPNpJ.js +47 -0
  4. package/dist/accounts-Y6fBCsx_.js +272 -0
  5. package/dist/ack-reactions-DndoGKeN.js +446 -0
  6. package/dist/ack-reactions-XQPdJAzb.js +446 -0
  7. package/dist/acp-cli-C2sAKfGR.js +1326 -0
  8. package/dist/acp-cli-DSmofBAf.js +1320 -0
  9. package/dist/active-listener-D4pocaWh.js +37 -0
  10. package/dist/agent-BA1XT2jG.js +728 -0
  11. package/dist/agent-CyVs7WvP.js +727 -0
  12. package/dist/agent-helpers-DlqwUqOd.js +606 -0
  13. package/dist/agent-scope-BDF8U7HM.js +99 -0
  14. package/dist/agent-scope-Dzc3Pxwr.js +101 -0
  15. package/dist/agents-GDnr7rw4.js +788 -0
  16. package/dist/agents.config-Ba4A6sdg.js +116 -0
  17. package/dist/agents.config-CeN3byLA.js +116 -0
  18. package/dist/audio-preflight-BFPZB_BA.js +69 -0
  19. package/dist/audio-preflight-CowiaUIn.js +64 -0
  20. package/dist/audit-BHUOvUJw.js +3149 -0
  21. package/dist/audit-oXRhFtwT.js +3149 -0
  22. package/dist/auth-0nvm_vu0.js +448 -0
  23. package/dist/auth-DCGEkWB5.js +448 -0
  24. package/dist/auth-profiles-DJsaxEsz.js +281 -0
  25. package/dist/banner--jCLPIfU.js +294 -0
  26. package/dist/binaries-DEBQrQj9.js +13 -0
  27. package/dist/bindings-C6J0GYWO.js +69 -0
  28. package/dist/bindings-D0yqi_XP.js +69 -0
  29. package/dist/bonjour-discovery-JS2eV51P.js +378 -0
  30. package/dist/bonjour-discovery-hfRH88nW.js +378 -0
  31. package/dist/boot/handler.js +30 -33
  32. package/dist/browser-cli-BABicrdh.js +1692 -0
  33. package/dist/browser-cli-Qa_1PYDv.js +1687 -0
  34. package/dist/build-info.json +3 -3
  35. package/dist/call-fGA-3SDL.js +2828 -0
  36. package/dist/call-jLXWNKPQ.js +2829 -0
  37. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  38. package/dist/catalog-BzeCPOus.js +185 -0
  39. package/dist/catalog-oYxNmkeA.js +185 -0
  40. package/dist/channel-account-context-BVnz5r1H.js +550 -0
  41. package/dist/channel-account-context-BcPTaTZb.js +550 -0
  42. package/dist/channel-activity-BuZbH6WD.js +94 -0
  43. package/dist/channel-activity-CDdk0baN.js +94 -0
  44. package/dist/channel-activity-hL4KZrCz.js +292 -0
  45. package/dist/channel-options-XhTwtBf5.js +33 -0
  46. package/dist/channel-options-ctxY53Lc.js +32 -0
  47. package/dist/channel-selection-CMK4YLlO.js +51 -0
  48. package/dist/channel-selection-_eCHA2U9.js +51 -0
  49. package/dist/channel-web-BZpC6hhV.js +2134 -0
  50. package/dist/channel-web-CQ6_87Mm.js +2136 -0
  51. package/dist/channels-cli-BNl9vUWn.js +1421 -0
  52. package/dist/channels-cli-DZR57uHI.js +1426 -0
  53. package/dist/channels-status-issues-CVIgTe2p.js +18 -0
  54. package/dist/channels-status-issues-DcC43ljl.js +18 -0
  55. package/dist/chat-envelope-CRqgofiw.js +248 -0
  56. package/dist/chrome-8vydo3dJ.js +1733 -0
  57. package/dist/chrome-B_rPhRU5.js +1732 -0
  58. package/dist/chunk-Cx-gs159.js +341 -0
  59. package/dist/clack-prompter-BzCKGyUs.js +121 -0
  60. package/dist/clack-prompter-D7MCzOPT.js +122 -0
  61. package/dist/cli/daemon-cli.js +1 -1
  62. package/dist/cli-CpAjRQ-P.js +125 -0
  63. package/dist/cli-DUXK9wJZ.js +130 -0
  64. package/dist/clipboard-DIewy_WG.js +31 -0
  65. package/dist/command-logger/handler.js +1 -1
  66. package/dist/command-registry-DJNQEtnc.js +215 -0
  67. package/dist/commands-CX-o6Gzn.js +41 -0
  68. package/dist/commands-ChY7s9hy.js +41 -0
  69. package/dist/commands-registry-C-NFTH7P.js +891 -0
  70. package/dist/commands-registry-C_sd8Lmg.js +892 -0
  71. package/dist/common-Gc07uSGw.js +156 -0
  72. package/dist/completion-cli-DhuIE5Go.js +452 -0
  73. package/dist/completion-cli-DpaiSYzH.js +452 -0
  74. package/dist/config-BzYPJgWg.js +6919 -0
  75. package/dist/config-CxSZl93L.js +6917 -0
  76. package/dist/config-cli-CWeRxEJK.js +241 -0
  77. package/dist/config-cli-CYQ2SdRU.js +246 -0
  78. package/dist/config-guard-CYJDizl5.js +97 -0
  79. package/dist/config-guard-D1Q3ZQbe.js +75 -0
  80. package/dist/config-validation-BQqpcnJj.js +18 -0
  81. package/dist/config-validation-DFt9nI1w.js +18 -0
  82. package/dist/configure-BQw2dIdc.js +891 -0
  83. package/dist/configure-CXTvRKTB.js +889 -0
  84. package/dist/constants-CMq8PtHp.js +70 -0
  85. package/dist/constants-tLOgmZZ1.js +70 -0
  86. package/dist/control-auth-DWYlgWkO.js +397 -0
  87. package/dist/control-auth-pDCKtSlm.js +397 -0
  88. package/dist/control-ui/assets/index-D8iWlx90.js +7738 -0
  89. package/dist/control-ui/assets/index-D8iWlx90.js.map +1 -0
  90. package/dist/control-ui/assets/index-D_fjkN3g.css +1 -0
  91. package/dist/control-ui/index.html +2 -2
  92. package/dist/control-ui-assets-BQiFibyu.js +186 -0
  93. package/dist/control-ui-assets-DvQAtkDy.js +186 -0
  94. package/dist/cron-cli-B06geKKo.js +490 -0
  95. package/dist/cron-cli-Ct2y3uRB.js +495 -0
  96. package/dist/daemon-cli-Bt5Kcq3U.js +1197 -0
  97. package/dist/daemon-cli-Cd0bKq3g.js +1199 -0
  98. package/dist/daemon-cli.js +29 -69
  99. package/dist/daemon-install-C3Q8Jcx3.js +55 -0
  100. package/dist/daemon-install-helpers-B7UgD_mo.js +462 -0
  101. package/dist/daemon-install-helpers-Crqe5m8B.js +462 -0
  102. package/dist/daemon-install-oa7I86B_.js +60 -0
  103. package/dist/deliver-04fDIQb1.js +481 -0
  104. package/dist/deliver-D4QqtgMj.js +481 -0
  105. package/dist/delivery-queue-BM3aWQIK.js +244 -0
  106. package/dist/devices-cli-B7jdFjR6.js +316 -0
  107. package/dist/devices-cli-D-YMJZn1.js +321 -0
  108. package/dist/diagnostics-lMmEIZdJ.js +46 -0
  109. package/dist/diagnostics-rgiIJEXZ.js +46 -0
  110. package/dist/directory-cli-DWHQF2VD.js +222 -0
  111. package/dist/directory-cli-D_pT4Je0.js +217 -0
  112. package/dist/dm-policy-shared-BHRB2wzi.js +22 -0
  113. package/dist/dm-policy-shared-BTzThzqQ.js +22 -0
  114. package/dist/dns-cli-BbdtaLDe.js +202 -0
  115. package/dist/dns-cli-DghCMHgj.js +197 -0
  116. package/dist/dock-BtLbLczG.js +928 -0
  117. package/dist/dock-_qq4sBie.js +929 -0
  118. package/dist/doctor-completion-Cs6sL_IA.js +92 -0
  119. package/dist/doctor-completion-Cx2tN3vQ.js +92 -0
  120. package/dist/doctor-config-flow-CilyEptw.js +1934 -0
  121. package/dist/doctor-config-flow-PRWWIepI.js +1933 -0
  122. package/dist/enable-BEScoJBZ.js +59 -0
  123. package/dist/enable-Dt27_ZMm.js +59 -0
  124. package/dist/entry.js +1 -3
  125. package/dist/env-DUb5GiQe.js +60 -0
  126. package/dist/exec-D6PvFXKb.js +164 -0
  127. package/dist/export-html/template.css +0 -36
  128. package/dist/export-html/template.js +0 -26
  129. package/dist/extensionAPI.js +78 -77
  130. package/dist/fetch-Duxh68Ws.js +67 -0
  131. package/dist/fs-safe-S3Zvbabd.js +98 -0
  132. package/dist/gateway-cli-Mo6X1-yC.js +23756 -0
  133. package/dist/gateway-cli-P6QI1rgs.js +23761 -0
  134. package/dist/gateway-rpc-AYvHI3Um.js +28 -0
  135. package/dist/gateway-rpc-Bsz_VM32.js +28 -0
  136. package/dist/gmail-setup-utils-D_g2PQOA.js +423 -0
  137. package/dist/gmail-setup-utils-ni_zkMpC.js +422 -0
  138. package/dist/health-C903Uthy.js +1423 -0
  139. package/dist/health-vO9pggEr.js +1420 -0
  140. package/dist/heartbeat-visibility-BHb-m9Fu.js +125 -0
  141. package/dist/heartbeat-visibility-DgRcKpeV.js +125 -0
  142. package/dist/helpers-DkUEDuKD.js +10 -0
  143. package/dist/hook-runner-global-CyIDoO1Z.js +527 -0
  144. package/dist/hooks-cli-B5oVqP3O.js +1222 -0
  145. package/dist/hooks-cli-xRelj3fq.js +1217 -0
  146. package/dist/image-ops-XoE9nn-z.js +354 -0
  147. package/dist/import-buqTDG9j.js +250 -0
  148. package/dist/import-j_5xbT7b.js +248 -0
  149. package/dist/inbound-path-policy-gHabNHWN.js +250 -0
  150. package/dist/index.js +93 -93
  151. package/dist/inspect-CV7o4EFm.js +559 -0
  152. package/dist/inspect-CkEMQlFE.js +559 -0
  153. package/dist/installs--lvmS_5X.js +325 -0
  154. package/dist/installs-BA3T7VAz.js +325 -0
  155. package/dist/ir-BaHZnJJM.js +940 -0
  156. package/dist/loader-8b9zCJni.js +22621 -0
  157. package/dist/loader-FZXIZr3R.js +22624 -0
  158. package/dist/local-roots-CWQNmgUt.js +313 -0
  159. package/dist/local-roots-DJo8GN9l.js +314 -0
  160. package/dist/logger-BiVcvOhw.js +49 -0
  161. package/dist/login-9iJ6gWZk.js +61 -0
  162. package/dist/login-EqnFreqS.js +62 -0
  163. package/dist/login-qr-C-iNjUWs.js +327 -0
  164. package/dist/login-qr-WMfGy6v_.js +322 -0
  165. package/dist/logs-cli-DFZz2ger.js +238 -0
  166. package/dist/logs-cli-gX4_EMx4.js +233 -0
  167. package/dist/markdown-tables-Bry8gXRC.js +29 -0
  168. package/dist/markdown-tables-vq6-CCk-.js +29 -0
  169. package/dist/media-C0_rYTSG.js +10455 -0
  170. package/dist/media-DNm8s1nv.js +940 -0
  171. package/dist/message-action-names-BMv6kUc8.js +2521 -0
  172. package/dist/message-action-names-DSrGq84w.js +2521 -0
  173. package/dist/message-channel-DF4I2vOK.js +91 -0
  174. package/dist/net-Dl7oQfqm.js +225 -0
  175. package/dist/node-cli-Cv_2cuVQ.js +24 -0
  176. package/dist/nodes-cli-Bh5kE7rx.js +1343 -0
  177. package/dist/nodes-cli-C1nJHXNR.js +1348 -0
  178. package/dist/note-CAx7Id1-.js +92 -0
  179. package/dist/note-CpSd8qLI.js +92 -0
  180. package/dist/npm-registry-spec-CaHkYE_x.js +786 -0
  181. package/dist/npm-registry-spec-CocXp7ba.js +786 -0
  182. package/dist/npm-resolution-DQS5ZVqD.js +86 -0
  183. package/dist/npm-resolution-w3878lun.js +86 -0
  184. package/dist/onboard-BCal_4Gv.js +407 -0
  185. package/dist/onboard-YnHnBbNe.js +405 -0
  186. package/dist/onboard-channels-B87Gz5qD.js +2547 -0
  187. package/dist/onboard-channels-RBADpVYy.js +2548 -0
  188. package/dist/onboard-config-DgTNC3ZT.js +39 -0
  189. package/dist/onboard-config-x054Cod3.js +39 -0
  190. package/dist/onboard-helpers-CoKiZn8s.js +363 -0
  191. package/dist/onboard-helpers-DKApDaN3.js +362 -0
  192. package/dist/onboard-remote-B1RsWyDT.js +127 -0
  193. package/dist/onboard-remote-BKJJgiD6.js +127 -0
  194. package/dist/onboarding-B4xiRmix.js +534 -0
  195. package/dist/onboarding-CBzaoGrg.js +532 -0
  196. package/dist/onboarding.finalize-CmKkVYDg.js +401 -0
  197. package/dist/onboarding.finalize-Deue-iB5.js +398 -0
  198. package/dist/onboarding.gateway-config-CVzVE8Em.js +191 -0
  199. package/dist/onboarding.gateway-config-Z5kbnB3s.js +198 -0
  200. package/dist/outbound-BFD5_jba.js +221 -0
  201. package/dist/outbound-Cnqvf0fO.js +220 -0
  202. package/dist/outbound-attachment-BnqWk5_B.js +18 -0
  203. package/dist/outbound-attachment-D05iLA7W.js +18 -0
  204. package/dist/outbound-attachment-DEyKzFjb.js +18 -0
  205. package/dist/pairing-cli-Blm356D6.js +122 -0
  206. package/dist/pairing-cli-h_rEV_wP.js +127 -0
  207. package/dist/pairing-labels-D1m2vZ16.js +9 -0
  208. package/dist/pairing-labels-DtbcpHbW.js +9 -0
  209. package/dist/pairing-store-3EoUkpJk.js +459 -0
  210. package/dist/pairing-store-DlhFf9Sd.js +460 -0
  211. package/dist/path-env-BHe995Zs.js +89 -0
  212. package/dist/path-env-Dt0Pot3Y.js +89 -0
  213. package/dist/path-safety-BlhW64vx.js +14 -0
  214. package/dist/plugin-auto-enable-CAXV8TAD.js +301 -0
  215. package/dist/plugin-auto-enable-SoRyAF_8.js +302 -0
  216. package/dist/plugin-registry-B3Ovot-q.js +33 -0
  217. package/dist/plugin-registry-CLs2mk9g.js +33 -0
  218. package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +0 -1
  219. package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +0 -7
  220. package/dist/plugin-sdk/auto-reply/reply/session-updates.d.ts +0 -10
  221. package/dist/plugin-sdk/auto-reply/status.d.ts +1 -3
  222. package/dist/plugin-sdk/config/defaults.d.ts +0 -1
  223. package/dist/plugin-sdk/config/sessions/types.d.ts +0 -6
  224. package/dist/plugin-sdk/config/types.agent-defaults.d.ts +21 -101
  225. package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +8 -63
  226. package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +2 -10
  227. package/dist/plugin-sdk/config/zod-schema.agents.d.ts +10 -71
  228. package/dist/plugin-sdk/config/zod-schema.d.ts +10 -71
  229. package/dist/plugin-sdk/daemon/constants.d.ts +2 -2
  230. package/dist/plugin-sdk/index.js +34 -67
  231. package/dist/plugin-sdk/middleware/channel-bridge.d.ts +4 -0
  232. package/dist/plugin-sdk/middleware/runtime-factory.d.ts +42 -0
  233. package/dist/plugin-sdk/middleware/types.d.ts +4 -0
  234. package/dist/plugins-BtMu6L8i.js +453 -0
  235. package/dist/plugins-HyUNaoYP.js +455 -0
  236. package/dist/plugins-cli-Bfz5q2Eu.js +793 -0
  237. package/dist/plugins-cli-IC5XEIJP.js +798 -0
  238. package/dist/ports-B5ckNet-.js +96 -0
  239. package/dist/ports-Bd3hoh8b.js +96 -0
  240. package/dist/ports-BookgaRI.js +370 -0
  241. package/dist/ports-UXImZGj6.js +316 -0
  242. package/dist/program-DHHHUVxq.js +244 -0
  243. package/dist/program-context-CJ5VtH21.js +474 -0
  244. package/dist/progress-WaSih6uF.js +124 -0
  245. package/dist/prompt-select-styled-CvndflSu.js +1647 -0
  246. package/dist/prompt-select-styled-DRpXaDjZ.js +1650 -0
  247. package/dist/provider-dispatcher-BtSfIQn3.js +659 -0
  248. package/dist/provider-dispatcher-CUXHJBTf.js +660 -0
  249. package/dist/push-apns-BH90TRlq.js +713 -0
  250. package/dist/pw-ai-89JDYEsx.js +1906 -0
  251. package/dist/pw-ai-DLMRJYTF.js +1910 -0
  252. package/dist/qr-cli-B-vXl2tJ.js +352 -0
  253. package/dist/qr-cli-CPLEROlB.js +347 -0
  254. package/dist/redact-snapshot-D6v5Y3cH.js +2016 -0
  255. package/dist/redact-snapshot-DRkh_GXw.js +2016 -0
  256. package/dist/register.agent-6t54SCKS.js +1043 -0
  257. package/dist/register.agent-CrTeig6j.js +286 -0
  258. package/dist/register.configure-CLKO7CBz.js +124 -0
  259. package/dist/register.configure-CYhzeMUN.js +130 -0
  260. package/dist/register.import-CwB3CVmx.js +30 -0
  261. package/dist/register.import-DuMlmKVZ.js +27 -0
  262. package/dist/register.maintenance-BywvjbLM.js +494 -0
  263. package/dist/register.maintenance-CmZiik6M.js +497 -0
  264. package/dist/register.message-C4uOmrmu.js +681 -0
  265. package/dist/register.message-_xLO9io6.js +686 -0
  266. package/dist/register.onboard-D70dDDQi.js +262 -0
  267. package/dist/register.onboard-FyyzQnPJ.js +257 -0
  268. package/dist/register.setup-D6gZLMvn.js +114 -0
  269. package/dist/register.setup-PQ_egL-s.js +109 -0
  270. package/dist/register.status-health-sessions-CPGqgxER.js +668 -0
  271. package/dist/register.status-health-sessions-D0hrBo9e.js +423 -0
  272. package/dist/register.subclis-B4JkPvWw.js +267 -0
  273. package/dist/replies-DwXyI317.js +136 -0
  274. package/dist/replies-vM-49F7Z.js +136 -0
  275. package/dist/reply-DO3tkAbl.js +13717 -0
  276. package/dist/reply-directives-BSHSMfOP.js +182 -0
  277. package/dist/reply-directives-Bd8xCxw5.js +182 -0
  278. package/dist/reply-gX7Zk9R8.js +13720 -0
  279. package/dist/reply-payloads-BzxytLE1.js +527 -0
  280. package/dist/reply-prefix-BPUsoqRv.js +38 -0
  281. package/dist/reply-prefix-Cz79Mk_9.js +38 -0
  282. package/dist/resolve-route-CbxnmqSZ.js +249 -0
  283. package/dist/resolve-route-RsSFZfEu.js +249 -0
  284. package/dist/response-prefix-template-BqmQwHFv.js +136 -0
  285. package/dist/response-prefix-template-oS-m4x5k.js +136 -0
  286. package/dist/retry-BMUvSHT-.js +77 -0
  287. package/dist/run-main-D_Yvs705.js +302 -0
  288. package/dist/runner-BvtNyNts.js +2294 -0
  289. package/dist/runner-bzffxuwY.js +2294 -0
  290. package/dist/runtime-guard-B43sm9Yk.js +60 -0
  291. package/dist/secure-random-CsKN1dAJ.js +44 -0
  292. package/dist/security-cli-ClDV4uPt.js +484 -0
  293. package/dist/security-cli-D578rt9i.js +478 -0
  294. package/dist/send-16QFH4iu.js +492 -0
  295. package/dist/send-1ch3HEta.js +29 -0
  296. package/dist/send-B5mtDLya.js +492 -0
  297. package/dist/send-BA-OQAbS.js +547 -0
  298. package/dist/send-BAki96aY.js +547 -0
  299. package/dist/send-BzYdvFV2.js +1775 -0
  300. package/dist/send-C-Vix83b.js +374 -0
  301. package/dist/send-C2vPu8jr.js +2245 -0
  302. package/dist/send-CCpFrPS3.js +426 -0
  303. package/dist/send-CXoL2Zzi.js +349 -0
  304. package/dist/send-Cp7xKp6y.js +2245 -0
  305. package/dist/send-DmR0m7rx.js +332 -0
  306. package/dist/send-MwvIhKYv.js +11 -0
  307. package/dist/send-YjzTu9Vf.js +1778 -0
  308. package/dist/send-jlq_MH8C.js +1174 -0
  309. package/dist/send-ysN09khs.js +349 -0
  310. package/dist/server-02ElXzP1.js +200 -0
  311. package/dist/server-lifecycle-B8xKnzsQ.js +2437 -0
  312. package/dist/server-lifecycle-CEvhrc0-.js +2437 -0
  313. package/dist/server-node-events-DU4X16h1.js +398 -0
  314. package/dist/server-node-events-DrH58PI5.js +393 -0
  315. package/dist/server-ur9b1Yzm.js +205 -0
  316. package/dist/service-CiiOMO48.js +670 -0
  317. package/dist/service-Csa_Zp8l.js +670 -0
  318. package/dist/session-BtRSSNK_.js +170 -0
  319. package/dist/session-cost-usage-Cd5Heqqu.js +627 -0
  320. package/dist/session-cost-usage-CnPZY4id.js +627 -0
  321. package/dist/session-dirs-DhnTK_rA.js +947 -0
  322. package/dist/session-dirs-Ii3gbgos.js +947 -0
  323. package/dist/session-utils-Cs0dVU0y.js +624 -0
  324. package/dist/session-utils-DuK3Cyeh.js +624 -0
  325. package/dist/sessions-B3mSpWqX.js +2568 -0
  326. package/dist/sessions-BKYYI9GY.js +251 -0
  327. package/dist/status-B2d7Lmls.js +2067 -0
  328. package/dist/status-DSrcpDkP.js +2071 -0
  329. package/dist/status.update-BdkJ6oB8.js +79 -0
  330. package/dist/status.update-Cx6moscN.js +79 -0
  331. package/dist/store-COXTNbLU.js +53 -0
  332. package/dist/store-DdUK8zTC.js +2570 -0
  333. package/dist/subagent-registry-CpaLEiLw.js +4860 -0
  334. package/dist/subagent-registry-CwfHcOru.js +4858 -0
  335. package/dist/subsystem-BgxIzx7w.js +1137 -0
  336. package/dist/system-cli-C_3mdl-Y.js +75 -0
  337. package/dist/system-cli-Cg3uYNSx.js +70 -0
  338. package/dist/systemd-C9CRJ1Vh.js +547 -0
  339. package/dist/systemd-Clsb90Zg.js +547 -0
  340. package/dist/systemd-linger-CeBq5lTN.js +75 -0
  341. package/dist/systemd-linger-D70Sc4ia.js +75 -0
  342. package/dist/table-DVVqt1iT.js +279 -0
  343. package/dist/tables-6RxRFEl1.js +55 -0
  344. package/dist/tables-CamcS9gx.js +55 -0
  345. package/dist/tables-CmbvfFUi.js +55 -0
  346. package/dist/tailscale-C_8-YaZu.js +230 -0
  347. package/dist/targets--D1Sgq6T.js +220 -0
  348. package/dist/targets-BEON1rlZ.js +650 -0
  349. package/dist/targets-DRd0Al1y.js +650 -0
  350. package/dist/targets-DzGG0A-J.js +2245 -0
  351. package/dist/targets-IkURIBGL.js +53 -0
  352. package/dist/targets-NcJOa0-P.js +2244 -0
  353. package/dist/tool-images-BLldmoMO.js +263 -0
  354. package/dist/trash-CLx3VKz0.js +125 -0
  355. package/dist/tui-BqrwhnqU.js +3392 -0
  356. package/dist/tui-D1yYpK5L.js +3392 -0
  357. package/dist/tui-cli-DSoJ3FKB.js +58 -0
  358. package/dist/tui-cli-DmT2z3u-.js +63 -0
  359. package/dist/update-Bqxd57w0.js +349 -0
  360. package/dist/update-DNLS8oRs.js +349 -0
  361. package/dist/update-cli-CU9ZXQY3.js +1373 -0
  362. package/dist/update-cli-CVyu40ky.js +1370 -0
  363. package/dist/usage-DmDjx45Z.js +5337 -0
  364. package/dist/web-BUwk0Z14.js +3065 -0
  365. package/dist/web-D0Q23mS6.js +70 -0
  366. package/dist/web-Dbsn7rM8.js +76 -0
  367. package/dist/webhooks-cli-CVkKq_i_.js +328 -0
  368. package/dist/webhooks-cli-DUcnf7Eh.js +333 -0
  369. package/dist/whatsapp-actions-Drtn7JXc.js +128 -0
  370. package/dist/whatsapp-actions-OYitul5l.js +122 -0
  371. package/dist/workspace-CZ3yxyNd.js +447 -0
  372. package/dist/workspace-DJ7hsM9r.js +449 -0
  373. package/package.json +3 -3
  374. package/dist/accounts-B1aJFYXr.js +0 -272
  375. package/dist/accounts-Bexa80SB.js +0 -32
  376. package/dist/accounts-Cl_cFv9X.js +0 -47
  377. package/dist/accounts-Dn9h7HHT.js +0 -36
  378. package/dist/ack-reactions-B11TAC2D.js +0 -446
  379. package/dist/ack-reactions-CDUSdN8O.js +0 -446
  380. package/dist/acp-cli-CA1xMmVo.js +0 -1320
  381. package/dist/acp-cli-Dr83tqAg.js +0 -1326
  382. package/dist/active-listener-VzhWW8W6.js +0 -37
  383. package/dist/agent-CFKgqSEH.js +0 -732
  384. package/dist/agent-D2RVoS5g.js +0 -731
  385. package/dist/agent-helpers-D_9mS2Ti.js +0 -606
  386. package/dist/agent-scope-9WY5O-KK.js +0 -121
  387. package/dist/agent-scope-C50VuLKh.js +0 -119
  388. package/dist/agents-BBXCuDMp.js +0 -788
  389. package/dist/agents.config-BPGQ3Qyn.js +0 -116
  390. package/dist/agents.config-p3V3b9u6.js +0 -116
  391. package/dist/audio-preflight-BwmCYeuM.js +0 -64
  392. package/dist/audio-preflight-Dj6hBcFR.js +0 -69
  393. package/dist/audit-DhIKIeXD.js +0 -3138
  394. package/dist/audit-qgtCT3ik.js +0 -3138
  395. package/dist/auth-C6VDYgb7.js +0 -448
  396. package/dist/auth-Deh9i9Eg.js +0 -448
  397. package/dist/auth-profiles-CeDgZz_7.js +0 -281
  398. package/dist/banner-HCssFZcB.js +0 -294
  399. package/dist/binaries-X6FW-wD4.js +0 -13
  400. package/dist/bindings-B582pDIa.js +0 -69
  401. package/dist/bindings-CRU_udk8.js +0 -69
  402. package/dist/bonjour-discovery-BtPaR8vb.js +0 -378
  403. package/dist/bonjour-discovery-DuhiIZZx.js +0 -378
  404. package/dist/browser-cli-HH45lxP0.js +0 -1687
  405. package/dist/browser-cli-TB-GNoZq.js +0 -1692
  406. package/dist/call-BbwtB9Y-.js +0 -2828
  407. package/dist/call-ByOzoLDI.js +0 -2829
  408. package/dist/catalog-BY7OPtnz.js +0 -185
  409. package/dist/catalog-BqO6yem_.js +0 -185
  410. package/dist/channel-account-context-CjXyzMXE.js +0 -550
  411. package/dist/channel-account-context-CvIDAtHS.js +0 -550
  412. package/dist/channel-activity-BeRrcCd8.js +0 -94
  413. package/dist/channel-activity-DTKGf3j5.js +0 -94
  414. package/dist/channel-activity-hPfValKp.js +0 -292
  415. package/dist/channel-options-BLdLu0xk.js +0 -33
  416. package/dist/channel-options-BQ61blla.js +0 -32
  417. package/dist/channel-selection-CJXZTxae.js +0 -51
  418. package/dist/channel-selection-NNPbxnyZ.js +0 -51
  419. package/dist/channel-web-D1_mlyPg.js +0 -2136
  420. package/dist/channel-web-DmhVkWbP.js +0 -2134
  421. package/dist/channels-cli-C4O8pp1S.js +0 -1426
  422. package/dist/channels-cli-DAu1TXTH.js +0 -1421
  423. package/dist/channels-status-issues-BDAHISWe.js +0 -18
  424. package/dist/channels-status-issues-DwRDzwrV.js +0 -18
  425. package/dist/chat-envelope-el7Uo-Fe.js +0 -248
  426. package/dist/chrome-CNDtczoM.js +0 -1733
  427. package/dist/chrome-CdcwZN9t.js +0 -1732
  428. package/dist/chunk-DAjFKt2g.js +0 -341
  429. package/dist/clack-prompter-CCFnKP_1.js +0 -121
  430. package/dist/clack-prompter-CabwzmG4.js +0 -122
  431. package/dist/cli-BuMX-jRY.js +0 -130
  432. package/dist/cli-Ci4DmAyk.js +0 -125
  433. package/dist/clipboard-B2j4qGIl.js +0 -31
  434. package/dist/command-registry-DxsFXB5t.js +0 -215
  435. package/dist/commands-C2uNKRTf.js +0 -41
  436. package/dist/commands-CDonBOrw.js +0 -41
  437. package/dist/commands-registry-BvESmXoK.js +0 -893
  438. package/dist/commands-registry-CWJv6xe2.js +0 -892
  439. package/dist/common-Cp3rsBqx.js +0 -156
  440. package/dist/completion-cli-B-X5nwdT.js +0 -452
  441. package/dist/completion-cli-DD3pVpPn.js +0 -452
  442. package/dist/config-BqY7k-L8.js +0 -6953
  443. package/dist/config-FHu9Bn4R.js +0 -6951
  444. package/dist/config-cli-CPH_PfVk.js +0 -241
  445. package/dist/config-cli-Czvt02PC.js +0 -246
  446. package/dist/config-guard-5oI2BiSY.js +0 -97
  447. package/dist/config-guard-cB5a_ANg.js +0 -75
  448. package/dist/config-validation-BPNyd9_3.js +0 -18
  449. package/dist/config-validation-J3cJ0OCa.js +0 -18
  450. package/dist/configure-Bi_9d94n.js +0 -889
  451. package/dist/configure-DiQaHI3s.js +0 -891
  452. package/dist/constants-BmRFoHl0.js +0 -67
  453. package/dist/constants-C9WPAluB.js +0 -67
  454. package/dist/control-auth-D0tpV3ts.js +0 -397
  455. package/dist/control-auth-q4zZXaoS.js +0 -397
  456. package/dist/control-ui/assets/index-B4ZM1lW1.js +0 -7738
  457. package/dist/control-ui/assets/index-B4ZM1lW1.js.map +0 -1
  458. package/dist/control-ui/assets/index-PED72sKF.css +0 -1
  459. package/dist/control-ui-assets-Cx_mw4D0.js +0 -186
  460. package/dist/control-ui-assets-D4yaD8jm.js +0 -186
  461. package/dist/cron-cli-Bfh7ftYz.js +0 -495
  462. package/dist/cron-cli-C8j_uslU.js +0 -490
  463. package/dist/daemon-cli-DQFZB1yM.js +0 -1197
  464. package/dist/daemon-cli-lTsfNeDm.js +0 -1199
  465. package/dist/daemon-install-CcohRvKV.js +0 -55
  466. package/dist/daemon-install-DrTvAWhM.js +0 -60
  467. package/dist/daemon-install-helpers-CFGAfRlj.js +0 -462
  468. package/dist/daemon-install-helpers-DIUzSFG1.js +0 -462
  469. package/dist/defaults-B5KStIBg.js +0 -7
  470. package/dist/defaults-xUAL2Z-F.js +0 -7
  471. package/dist/deliver-912khjLK.js +0 -481
  472. package/dist/deliver-D78pwuPC.js +0 -481
  473. package/dist/delivery-queue-CxVRi4tw.js +0 -244
  474. package/dist/devices-cli-0qDhTgZR.js +0 -316
  475. package/dist/devices-cli-CstkYXzr.js +0 -321
  476. package/dist/diagnostics-HGkN467d.js +0 -46
  477. package/dist/diagnostics-VC0cz7kX.js +0 -46
  478. package/dist/directory-cli-5YXdoVdn.js +0 -217
  479. package/dist/directory-cli-duhBZl2c.js +0 -222
  480. package/dist/dm-policy-shared-BBfEyAN1.js +0 -22
  481. package/dist/dm-policy-shared-D8lgnmrC.js +0 -22
  482. package/dist/dns-cli-11CtErVU.js +0 -197
  483. package/dist/dns-cli-Sr6SB9ei.js +0 -202
  484. package/dist/dock-BqNINg7k.js +0 -928
  485. package/dist/dock-O8ArYwed.js +0 -929
  486. package/dist/doctor-completion-B1UlvZFx.js +0 -92
  487. package/dist/doctor-completion-C0j7b_f8.js +0 -92
  488. package/dist/doctor-config-flow-BVkHcvoj.js +0 -1933
  489. package/dist/doctor-config-flow-BiShkCxs.js +0 -1934
  490. package/dist/enable-DMIq6evt.js +0 -59
  491. package/dist/enable-ibNq4UWy.js +0 -59
  492. package/dist/env-Br2Bl6Ht.js +0 -60
  493. package/dist/exec-C6ACg_Mn.js +0 -164
  494. package/dist/fetch-Bmv93nu9.js +0 -67
  495. package/dist/fs-safe-DkBhNAc3.js +0 -98
  496. package/dist/gateway-cli-D4cDhvZx.js +0 -23747
  497. package/dist/gateway-cli-DuMjB8Ff.js +0 -23742
  498. package/dist/gateway-rpc-B4jTtupy.js +0 -28
  499. package/dist/gateway-rpc-Dq44SkOv.js +0 -28
  500. package/dist/gmail-setup-utils-BPmUIqso.js +0 -423
  501. package/dist/gmail-setup-utils-Cnx8A5pW.js +0 -422
  502. package/dist/health-SOuaKNRa.js +0 -1420
  503. package/dist/health-wr-JDHlc.js +0 -1423
  504. package/dist/heartbeat-visibility-BxkZjE5m.js +0 -125
  505. package/dist/heartbeat-visibility-ossI_l4t.js +0 -125
  506. package/dist/helpers-kkeXif0Q.js +0 -10
  507. package/dist/hook-runner-global-DJ14gXFP.js +0 -527
  508. package/dist/hooks-cli-BUTtESiX.js +0 -1217
  509. package/dist/hooks-cli-eqPYjw4l.js +0 -1222
  510. package/dist/image-ops-DRdKC0uO.js +0 -354
  511. package/dist/import-Be73VPF2.js +0 -170
  512. package/dist/import-DQ6NI4Fz.js +0 -168
  513. package/dist/inbound-path-policy-C_Qo8rqg.js +0 -250
  514. package/dist/inspect-B1Fq39RC.js +0 -559
  515. package/dist/inspect-Dt8hogS3.js +0 -559
  516. package/dist/installs-C8apg11p.js +0 -325
  517. package/dist/installs-pWdqG8HL.js +0 -325
  518. package/dist/ir-Ch9FC9Z_.js +0 -940
  519. package/dist/loader-Cuq-saEl.js +0 -22621
  520. package/dist/loader-u9FC6kYG.js +0 -22624
  521. package/dist/local-roots-BrH0Q63K.js +0 -313
  522. package/dist/local-roots-z2u_s7jG.js +0 -314
  523. package/dist/logger-pznB_IdT.js +0 -49
  524. package/dist/login-CYq-visu.js +0 -62
  525. package/dist/login-DOmWDMeP.js +0 -61
  526. package/dist/login-qr-CXU0wC5K.js +0 -322
  527. package/dist/login-qr-D85vVatX.js +0 -327
  528. package/dist/logs-cli-Cu2S08Y3.js +0 -238
  529. package/dist/logs-cli-D7ayUvz_.js +0 -233
  530. package/dist/markdown-tables-hhOWaw8L.js +0 -29
  531. package/dist/markdown-tables-jrnSPvZ6.js +0 -29
  532. package/dist/media-DN7yRfrH.js +0 -940
  533. package/dist/media-DOQIalam.js +0 -10492
  534. package/dist/message-action-names-Dk9kxwRd.js +0 -2521
  535. package/dist/message-action-names-EsOcuFpq.js +0 -2521
  536. package/dist/message-channel-BlYrtmIp.js +0 -91
  537. package/dist/net-D6D0wgcF.js +0 -225
  538. package/dist/node-cli-Q2-n3Fgv.js +0 -24
  539. package/dist/nodes-cli-BDq-4dHm.js +0 -1348
  540. package/dist/nodes-cli-C2SoKfCv.js +0 -1343
  541. package/dist/note-DR8A0G5H.js +0 -92
  542. package/dist/note-Dlv4NmlQ.js +0 -92
  543. package/dist/npm-registry-spec-COvUzy5J.js +0 -786
  544. package/dist/npm-registry-spec-Cobb5KYR.js +0 -786
  545. package/dist/npm-resolution-BmgD7x45.js +0 -86
  546. package/dist/npm-resolution-DNYcV-Br.js +0 -86
  547. package/dist/onboard-Dy0q82Mj.js +0 -405
  548. package/dist/onboard-channels-9QS_7iph.js +0 -2548
  549. package/dist/onboard-channels-EH2wvu6Y.js +0 -2547
  550. package/dist/onboard-config-BCTthQ7J.js +0 -24
  551. package/dist/onboard-config-y-2cgT0V.js +0 -24
  552. package/dist/onboard-helpers-ChPmr3lh.js +0 -363
  553. package/dist/onboard-helpers-Jy3345Jk.js +0 -362
  554. package/dist/onboard-remote-CM6Yl1oL.js +0 -127
  555. package/dist/onboard-remote-Id80PV28.js +0 -127
  556. package/dist/onboard-uvDMehqu.js +0 -407
  557. package/dist/onboarding-BVtzeopT.js +0 -534
  558. package/dist/onboarding-DlXBAIDc.js +0 -532
  559. package/dist/onboarding.finalize-Dve-3p-y.js +0 -398
  560. package/dist/onboarding.finalize-GIK3ktiW.js +0 -401
  561. package/dist/onboarding.gateway-config-BCV5T35-.js +0 -198
  562. package/dist/onboarding.gateway-config-DW-09FX5.js +0 -191
  563. package/dist/outbound-CFfJC1j5.js +0 -220
  564. package/dist/outbound-CjFRpudN.js +0 -221
  565. package/dist/outbound-attachment-BxMSma9v.js +0 -18
  566. package/dist/outbound-attachment-DIiKB_mP.js +0 -18
  567. package/dist/outbound-attachment-o0seS0CP.js +0 -18
  568. package/dist/pairing-cli-BeydfoF9.js +0 -122
  569. package/dist/pairing-cli-GgwzEWJX.js +0 -127
  570. package/dist/pairing-labels-B_53dY5L.js +0 -9
  571. package/dist/pairing-labels-BiSZLitI.js +0 -9
  572. package/dist/pairing-store-BgAv4uN8.js +0 -460
  573. package/dist/pairing-store-CTkD51uW.js +0 -459
  574. package/dist/path-env-ErEKbxOI.js +0 -89
  575. package/dist/path-env-qRJbjJzj.js +0 -89
  576. package/dist/path-safety-juI2XbO1.js +0 -14
  577. package/dist/plugin-auto-enable-CloCFyTz.js +0 -302
  578. package/dist/plugin-auto-enable-DuPS9XiJ.js +0 -301
  579. package/dist/plugin-registry-D5QsH-IS.js +0 -33
  580. package/dist/plugin-registry-DnO3azwy.js +0 -33
  581. package/dist/plugin-sdk/agents/defaults.d.ts +0 -3
  582. package/dist/plugin-sdk/auto-reply/model-runtime.d.ts +0 -17
  583. package/dist/plugin-sdk/config/model-input.d.ts +0 -9
  584. package/dist/plugin-sdk/config/zod-schema.agent-model.d.ts +0 -5
  585. package/dist/plugin-sdk/sessions/model-overrides.d.ts +0 -14
  586. package/dist/plugins-BXkDApVh.js +0 -455
  587. package/dist/plugins-BflZz0sp.js +0 -453
  588. package/dist/plugins-cli-Cf_RP_bn.js +0 -798
  589. package/dist/plugins-cli-DmbjYnO9.js +0 -793
  590. package/dist/ports-DIYJq-SY.js +0 -370
  591. package/dist/ports-DPL-Pzfh.js +0 -96
  592. package/dist/ports-NPqtlfp0.js +0 -316
  593. package/dist/ports-QMI4-F9m.js +0 -96
  594. package/dist/program-BaATq6CL.js +0 -244
  595. package/dist/program-context-C7b5MQbg.js +0 -474
  596. package/dist/progress--dapuyZA.js +0 -124
  597. package/dist/prompt-select-styled-BAsxl6hj.js +0 -1650
  598. package/dist/prompt-select-styled-aqjxCbwP.js +0 -1647
  599. package/dist/provider-dispatcher-B4QMe-I6.js +0 -659
  600. package/dist/provider-dispatcher-mAkRbPyH.js +0 -660
  601. package/dist/push-apns-CLmNS5AZ.js +0 -713
  602. package/dist/pw-ai-DuK87zsJ.js +0 -1906
  603. package/dist/pw-ai-ulOU3Ya1.js +0 -1910
  604. package/dist/qr-cli-9WQBnauO.js +0 -352
  605. package/dist/qr-cli-hSLixZCe.js +0 -347
  606. package/dist/redact-snapshot-BZYLIqe-.js +0 -2028
  607. package/dist/redact-snapshot-D2P_lRgf.js +0 -2028
  608. package/dist/register.agent-CquY2yLI.js +0 -286
  609. package/dist/register.agent-DZL_fw2K.js +0 -1043
  610. package/dist/register.configure-C2HjaKO0.js +0 -124
  611. package/dist/register.configure-D7Di47Lb.js +0 -130
  612. package/dist/register.import-Bs-UkOs-.js +0 -27
  613. package/dist/register.import-CaJ0DS1t.js +0 -30
  614. package/dist/register.maintenance-CslelbHK.js +0 -497
  615. package/dist/register.maintenance-Dd4fn6oX.js +0 -494
  616. package/dist/register.message-D2xmx0xB.js +0 -681
  617. package/dist/register.message-_Q8ehgQP.js +0 -686
  618. package/dist/register.onboard-BFSwh5g4.js +0 -262
  619. package/dist/register.onboard-CIupEYmX.js +0 -257
  620. package/dist/register.setup-7pk1r-54.js +0 -114
  621. package/dist/register.setup-Bm1Jtx0c.js +0 -109
  622. package/dist/register.status-health-sessions-C-Pbi-qq.js +0 -669
  623. package/dist/register.status-health-sessions-Cn4yWBWw.js +0 -423
  624. package/dist/register.subclis-DXmLofHX.js +0 -267
  625. package/dist/replies-BKrzM0QI.js +0 -136
  626. package/dist/replies-BkXDql3c.js +0 -136
  627. package/dist/reply-DSKC8kyS.js +0 -13897
  628. package/dist/reply-directives-CBeNSCHL.js +0 -182
  629. package/dist/reply-directives-CD2WycBM.js +0 -182
  630. package/dist/reply-n8KWtBQB.js +0 -13900
  631. package/dist/reply-payloads-CeL_cBnD.js +0 -527
  632. package/dist/reply-prefix-4zLS7A1Y.js +0 -38
  633. package/dist/reply-prefix-DBLCYiup.js +0 -38
  634. package/dist/resolve-route-BDGdM-l3.js +0 -249
  635. package/dist/resolve-route-CBVbY0xS.js +0 -249
  636. package/dist/response-prefix-template-CSxp9HN5.js +0 -136
  637. package/dist/response-prefix-template-up4REfuR.js +0 -136
  638. package/dist/retry-C81p7BZU.js +0 -77
  639. package/dist/run-main-CuA7VmAq.js +0 -320
  640. package/dist/runner-BbLPl1dz.js +0 -2294
  641. package/dist/runner-z92MWZ3m.js +0 -2294
  642. package/dist/runtime-guard-DZ_xuCc4.js +0 -60
  643. package/dist/secure-random-D2IOpBkk.js +0 -44
  644. package/dist/security-cli-BR3Y1FBJ.js +0 -484
  645. package/dist/security-cli-DP5QJpa5.js +0 -478
  646. package/dist/send-0uEtKwU_.js +0 -2245
  647. package/dist/send-B3O7bzYU.js +0 -1174
  648. package/dist/send-BWSo3i3H.js +0 -1778
  649. package/dist/send-BkSUAGj6.js +0 -349
  650. package/dist/send-Bx9bUGav.js +0 -492
  651. package/dist/send-CBGSXjfD.js +0 -2245
  652. package/dist/send-CRS-OcnW.js +0 -29
  653. package/dist/send-DPttDPIR.js +0 -374
  654. package/dist/send-D_DUQJ6H.js +0 -349
  655. package/dist/send-DyftOlFD.js +0 -332
  656. package/dist/send-Lij9A7lk.js +0 -547
  657. package/dist/send-YRVDWfSs.js +0 -547
  658. package/dist/send-dzS4fa9O.js +0 -492
  659. package/dist/send-uchxcHYC.js +0 -11
  660. package/dist/send-xUPOqzUr.js +0 -426
  661. package/dist/send-xnwty9cY.js +0 -1775
  662. package/dist/server-BE5lybcS.js +0 -205
  663. package/dist/server-LdLsvPPw.js +0 -200
  664. package/dist/server-lifecycle-B3Rdmq7-.js +0 -2437
  665. package/dist/server-lifecycle-CFmE_Adm.js +0 -2437
  666. package/dist/server-node-events-De4WZQQD.js +0 -393
  667. package/dist/server-node-events-d7eK4LBW.js +0 -398
  668. package/dist/service-BHos7oX8.js +0 -670
  669. package/dist/service-Bjqii5nW.js +0 -670
  670. package/dist/session-aUptxSVD.js +0 -170
  671. package/dist/session-cost-usage-DX09eTPU.js +0 -627
  672. package/dist/session-cost-usage-yYi525j3.js +0 -627
  673. package/dist/session-dirs-BADAi9Iz.js +0 -947
  674. package/dist/session-dirs-DdF6TDsE.js +0 -947
  675. package/dist/session-key-5YLnn_qf.js +0 -235
  676. package/dist/session-utils-CEtEq6bi.js +0 -625
  677. package/dist/session-utils-CiXbZkM2.js +0 -625
  678. package/dist/sessions--PykPynp.js +0 -2593
  679. package/dist/sessions-Bw4LRnSr.js +0 -252
  680. package/dist/status-CrGLegI6.js +0 -2072
  681. package/dist/status-D_3sszaS.js +0 -2068
  682. package/dist/status.update-C55QM2xs.js +0 -79
  683. package/dist/status.update-CVnonGHu.js +0 -79
  684. package/dist/store-C6w1sB5x.js +0 -53
  685. package/dist/store-DoOPG3rl.js +0 -2595
  686. package/dist/subagent-registry-C-xI2uK4.js +0 -4860
  687. package/dist/subagent-registry-Db4Ho_2Y.js +0 -4858
  688. package/dist/subsystem-CrJCqjAh.js +0 -1139
  689. package/dist/system-cli-CCKzF3uh.js +0 -75
  690. package/dist/system-cli-eAk5wVbP.js +0 -70
  691. package/dist/systemd-B5lyaCc3.js +0 -547
  692. package/dist/systemd-DSnlM3jX.js +0 -547
  693. package/dist/systemd-linger-DRPSEQVw.js +0 -75
  694. package/dist/systemd-linger-_0_-RY4v.js +0 -75
  695. package/dist/table-CpmqqcxJ.js +0 -279
  696. package/dist/tables-DI5LGEr1.js +0 -55
  697. package/dist/tables-D_PTzthR.js +0 -55
  698. package/dist/tables-DcQUNIvB.js +0 -55
  699. package/dist/tailscale-Dxyz13fn.js +0 -230
  700. package/dist/targets-B2vBpQdr.js +0 -2173
  701. package/dist/targets-B54vK3wc.js +0 -220
  702. package/dist/targets-Cm1X3IyA.js +0 -650
  703. package/dist/targets-D7OKVXMI.js +0 -650
  704. package/dist/targets-DB4vBpIQ.js +0 -2172
  705. package/dist/targets-DyybKefq.js +0 -53
  706. package/dist/tool-images-DVrUJEqc.js +0 -263
  707. package/dist/trash-DzrtBoP1.js +0 -125
  708. package/dist/tui-CyHwc2uX.js +0 -3392
  709. package/dist/tui-cHd20SZm.js +0 -3392
  710. package/dist/tui-cli-C7kQj9ef.js +0 -63
  711. package/dist/tui-cli-C9I18SfW.js +0 -58
  712. package/dist/update-DeQGoaIC.js +0 -349
  713. package/dist/update-IX7vdqA8.js +0 -349
  714. package/dist/update-cli-C52dmo3x.js +0 -1370
  715. package/dist/update-cli-DY_iE1E5.js +0 -1373
  716. package/dist/usage-B--dL37U.js +0 -5279
  717. package/dist/web-CMxp78WA.js +0 -76
  718. package/dist/web-DMweaNnG.js +0 -3065
  719. package/dist/web-Dquzwqf4.js +0 -70
  720. package/dist/webhooks-cli-BpZHQlVd.js +0 -328
  721. package/dist/webhooks-cli-CqFX8Ywl.js +0 -333
  722. package/dist/whatsapp-actions-C31Zdwez.js +0 -128
  723. package/dist/whatsapp-actions-DaA291Ya.js +0 -122
  724. package/dist/workspace-B4ZvVYT9.js +0 -447
  725. package/dist/workspace-B8qk__ff.js +0 -449
  726. /package/dist/{ansi-D04X81yq.js → ansi-aRwLYlzD.js} +0 -0
  727. /package/dist/{api-BeQMq2iS.js → api-B5a-GhRx.js} +0 -0
  728. /package/dist/{api-CxX8-gGz.js → api-CIseA2oL.js} +0 -0
  729. /package/dist/{argv-Co-b9Zsc.js → argv-BpnfFual.js} +0 -0
  730. /package/dist/{audio-DPOuhNq7.js → audio-B_mzy948.js} +0 -0
  731. /package/dist/{audio-VBcVDa08.js → audio-DDvXRwh-.js} +0 -0
  732. /package/dist/{brew-DbSbN8sD.js → brew-DJ_dfLHZ.js} +0 -0
  733. /package/dist/{brew-C4zKZsHX.js → brew-j-qOseim.js} +0 -0
  734. /package/dist/{cleanup-utils-CwQvD73q.js → cleanup-utils-CELo1uhg.js} +0 -0
  735. /package/dist/{cleanup-utils-o2MM9xyf.js → cleanup-utils-iC7eNxVL.js} +0 -0
  736. /package/dist/{cli-utils-BhXbz2UF.js → cli-utils-BRpudJBb.js} +0 -0
  737. /package/dist/{cli-utils-DZe_rVkZ.js → cli-utils-DJwgT-LP.js} +0 -0
  738. /package/dist/{client-C61M8zI3.js → client-Ck9_YeG3.js} +0 -0
  739. /package/dist/{client-DdpmATKq.js → client-CwnX0nXo.js} +0 -0
  740. /package/dist/{clipboard-Dzkx6Q2K.js → clipboard-DT-6OtUP.js} +0 -0
  741. /package/dist/{command-options-C4paWSGf.js → command-options-BOLa_fOM.js} +0 -0
  742. /package/dist/{command-options-CA30lfLK.js → command-options-DbRrl8qF.js} +0 -0
  743. /package/dist/{config-eval-CjGZtLwx.js → config-eval-BsrVpg0A.js} +0 -0
  744. /package/dist/{config-eval-H_wlEYIG.js → config-eval-BzDtybYL.js} +0 -0
  745. /package/dist/{constants-ChptG3d7.js → constants-B1UiXFxs.js} +0 -0
  746. /package/dist/{constants-DY6b-_Wl.js → constants-DKUEbLZr.js} +0 -0
  747. /package/dist/{credentials-DFsi1_e8.js → credentials-C82aU5z-.js} +0 -0
  748. /package/dist/{daemon-runtime-CMnbwryP.js → daemon-runtime-BOcdJaFy.js} +0 -0
  749. /package/dist/{daemon-runtime-CvqE4ysg.js → daemon-runtime-CbyS9Xgu.js} +0 -0
  750. /package/dist/{dangerous-name-matching-BzmiLXmA.js → dangerous-name-matching-C2i9AEgf.js} +0 -0
  751. /package/dist/{dangerous-name-matching-DaVRgwer.js → dangerous-name-matching-CCBwBn49.js} +0 -0
  752. /package/dist/{dangerous-tools-BOLoCRv4.js → dangerous-tools-BRtX1d_K.js} +0 -0
  753. /package/dist/{dangerous-tools-Baq7Q-i6.js → dangerous-tools-D8hrp16Q.js} +0 -0
  754. /package/dist/{delivery-queue-Cfa9Wmxp.js → delivery-queue-CgAgO5_a.js} +0 -0
  755. /package/dist/{errors-DZ199hOo.js → errors-Dblex1kc.js} +0 -0
  756. /package/dist/{fetch-C6XKGA11.js → fetch-Du9BJ20J.js} +0 -0
  757. /package/dist/{fetch-CEDsOiql.js → fetch-KSHIFKGH.js} +0 -0
  758. /package/dist/{format-duration-CqUERz51.js → format-duration-BRNiDrqx.js} +0 -0
  759. /package/dist/{format-duration-Ct-yiwkS.js → format-duration-C11mR8D_.js} +0 -0
  760. /package/dist/{format-relative-79_Y1n2Y.js → format-relative-C6kUHuOj.js} +0 -0
  761. /package/dist/{format-relative-CxLpEQOX.js → format-relative-CEWK-aoC.js} +0 -0
  762. /package/dist/{health-format-B_QRD8Si.js → health-format-D-AQZK4v.js} +0 -0
  763. /package/dist/{health-format-Bygse7KA.js → health-format-DGyISuUh.js} +0 -0
  764. /package/dist/{heartbeat-wake-LGEgcXjs.js → heartbeat-wake-BtRrOB-t.js} +0 -0
  765. /package/dist/{heartbeat-wake-Y97geucO.js → heartbeat-wake-SJ-JCo-E.js} +0 -0
  766. /package/dist/{help-format-sqWgYEdL.js → help-format-BjjZaoq3.js} +0 -0
  767. /package/dist/{help-format-NNm_Ov4H.js → help-format-DB1wv6bQ.js} +0 -0
  768. /package/dist/{helpers-R7bU5IBz.js → helpers-BVw8gMr-.js} +0 -0
  769. /package/dist/{helpers-BAsMXprO.js → helpers-D-8vB6NY.js} +0 -0
  770. /package/dist/{helpers-DLgbkcEn.js → helpers-D04-Gim7.js} +0 -0
  771. /package/dist/{inbound-context-DS_kpIYI.js → inbound-context-D94rw0Oq.js} +0 -0
  772. /package/dist/{input-provenance-Bn6thJNm.js → input-provenance-BDPOaXFk.js} +0 -0
  773. /package/dist/{ipv4-CDQpx1A7.js → ipv4-Bp2lJpEb.js} +0 -0
  774. /package/dist/{ipv4--2WXMVtE.js → ipv4-D73_qHXL.js} +0 -0
  775. /package/dist/{is-main-DN8-sNR5.js → is-main-CqNDOs3L.js} +0 -0
  776. /package/dist/{json-files-CmpYSF4G.js → json-files-Ct2lDInr.js} +0 -0
  777. /package/dist/{lanes-ByWMUgrz.js → lanes-DKkroN9D.js} +0 -0
  778. /package/dist/{links-Cm43Vcft.js → links-BWZPW7Lq.js} +0 -0
  779. /package/dist/{links-Bz4V7R_p.js → links-Y3epeqjH.js} +0 -0
  780. /package/dist/{location-DBWCGNLq.js → location-BcldrVN7.js} +0 -0
  781. /package/dist/{location-GbZ0bBRU.js → location-BrkAgrz9.js} +0 -0
  782. /package/dist/{logger-DyL5G2DO.js → logger-BuGfr7KR.js} +0 -0
  783. /package/dist/{logger-GvipVDfh.js → logger-TzwNwShm.js} +0 -0
  784. /package/dist/{logging-D8-Kozjc.js → logging-BiGr95aB.js} +0 -0
  785. /package/dist/{logging-D8R0sLY9.js → logging-DZhZ5xLX.js} +0 -0
  786. /package/dist/{mutable-allowlist-detectors-DiZDtmlZ.js → mutable-allowlist-detectors-BaVrnZS3.js} +0 -0
  787. /package/dist/{mutable-allowlist-detectors-U5ThQr9V.js → mutable-allowlist-detectors-NtI6s4TE.js} +0 -0
  788. /package/dist/{node-cli-Uf6lAntf.js → node-cli-DFKT5s4K.js} +0 -0
  789. /package/dist/{nodes-screen-Bmp1l9wY.js → nodes-screen-ByJHtT0R.js} +0 -0
  790. /package/dist/{nodes-screen-Cw7Hv7M2.js → nodes-screen-C17NdAyR.js} +0 -0
  791. /package/dist/{parse-log-line-enq8pduH.js → parse-log-line-CM1cOe-W.js} +0 -0
  792. /package/dist/{parse-log-line-mz9TG6ig.js → parse-log-line-DXE28Ti3.js} +0 -0
  793. /package/dist/{parse-timeout-BMP8a0_a.js → parse-timeout-DFxbkOgy.js} +0 -0
  794. /package/dist/{parse-timeout-CDkco8kd.js → parse-timeout-dIdCY9EB.js} +0 -0
  795. /package/dist/{path-guards-CrQOUlsq.js → path-guards-DJteVA0d.js} +0 -0
  796. /package/dist/{path-safety-DkT9RmTG.js → path-safety-BGnQWeUs.js} +0 -0
  797. /package/dist/{plugins-allowlist-BbTQ5Z2k.js → plugins-allowlist-Bvd3WXPX.js} +0 -0
  798. /package/dist/{plugins-allowlist-C20oaESO.js → plugins-allowlist-DyoGDzwZ.js} +0 -0
  799. /package/dist/{polls-B0CCBDeR.js → polls-DXd67TD8.js} +0 -0
  800. /package/dist/{ports-lsof-Wteul3ju.js → ports-lsof-BNQJW1Qu.js} +0 -0
  801. /package/dist/{program-context-jqeI5alP.js → program-context-DpJ5udOA.js} +0 -0
  802. /package/dist/{progress-C1kUfYL-.js → progress-Dvx-ExOb.js} +0 -0
  803. /package/dist/{prompt-Yn2yClg1.js → prompt-DRT7xYvH.js} +0 -0
  804. /package/dist/{prompt-BVZVovoB.js → prompt-YAKpM1vg.js} +0 -0
  805. /package/dist/{prompt-style-D0LUnqXi.js → prompt-style-BsR0RICZ.js} +0 -0
  806. /package/dist/{prompt-style-DjEYC_s-.js → prompt-style-inF3A_oX.js} +0 -0
  807. /package/dist/{proxy-DL3MD6-P.js → proxy-GJkoUC6V.js} +0 -0
  808. /package/dist/{proxy-DpNv2cSV.js → proxy-yk1Oqe9p.js} +0 -0
  809. /package/dist/{push-apns-DuG95AKC.js → push-apns-Ak1TkhPj.js} +0 -0
  810. /package/dist/{pw-ai-state-CGfLv6nV.js → pw-ai-state-D2Fjn4L6.js} +0 -0
  811. /package/dist/{pw-ai-state-Dynx20hr.js → pw-ai-state-Ds_-5nzI.js} +0 -0
  812. /package/dist/{redact-identifier-CAagcfWA.js → redact-identifier-CKA9ZTIc.js} +0 -0
  813. /package/dist/{remoteclaw-root-DybYl8PL.js → remoteclaw-root-BbqPSH6q.js} +0 -0
  814. /package/dist/{remoteclaw-root-C2HV2VeC.js → remoteclaw-root-dHyfh_2E.js} +0 -0
  815. /package/dist/{render-CCLsW6Lz.js → render-CUAKPmvZ.js} +0 -0
  816. /package/dist/{retry-DnqPAqWp.js → retry-0uBjohL-.js} +0 -0
  817. /package/dist/{retry-CxXVRdes.js → retry-BbVJvOUo.js} +0 -0
  818. /package/dist/{runtime-DJNp29jv.js → runtime-Ds3E9SqF.js} +0 -0
  819. /package/dist/{runtime-guard-U-ewY_QH.js → runtime-guard-Dw19MuxF.js} +0 -0
  820. /package/dist/{secret-equal-BbHdTtqY.js → secret-equal-DgjJcvjv.js} +0 -0
  821. /package/dist/{secure-random-CS2mSdTn.js → secure-random-Bla7VjVG.js} +0 -0
  822. /package/dist/{session-DBL5nHDy.js → session-C7PLQQMA.js} +0 -0
  823. /package/dist/{stagger-BXv_apuy.js → stagger-Cu9_3JD_.js} +0 -0
  824. /package/dist/{stagger-MI9gd2rQ.js → stagger-NmUOU1S6.js} +0 -0
  825. /package/dist/{status-BmtCS3T1.js → status-BNw-xk6B.js} +0 -0
  826. /package/dist/{status-BrwHRn2B.js → status-D98glect.js} +0 -0
  827. /package/dist/{store-BPZo49zT.js → store-CmRidfgp.js} +0 -0
  828. /package/dist/{store-v3P-OWhi.js → store-oxFp4Iqf.js} +0 -0
  829. /package/dist/{strip-inbound-meta-jy3bkUab.js → strip-inbound-meta-B21Qdh8I.js} +0 -0
  830. /package/dist/{subsystem-CDhxwtDd.js → subsystem-SgROXN1v.js} +0 -0
  831. /package/dist/{table-C1rdyYl9.js → table-DhGVhmP-.js} +0 -0
  832. /package/dist/{tailnet-PnMrjwGT.js → tailnet-wUV6epIk.js} +0 -0
  833. /package/dist/{tailscale-Dbyahx0J.js → tailscale-DAa9lokU.js} +0 -0
  834. /package/dist/{target-errors-BDpPcwh5.js → target-errors-BDipwemU.js} +0 -0
  835. /package/dist/{targets-C-2xwh9f.js → targets-DfXObWaL.js} +0 -0
  836. /package/dist/{targets-UncQvCVs.js → targets-PM39J-YL.js} +0 -0
  837. /package/dist/{text-format-BQ3z_OXA.js → text-format-CFm4X8Ze.js} +0 -0
  838. /package/dist/{text-format-oWqzVmah.js → text-format-Cy1bnk2A.js} +0 -0
  839. /package/dist/{tool-display-B-nr7cSF.js → tool-display-BAIuLbtW.js} +0 -0
  840. /package/dist/{trash-DPi0aCCQ.js → trash-BS86zpVy.js} +0 -0
  841. /package/dist/{usage-BdhBT0Vz.js → usage-BvSX010R.js} +0 -0
  842. /package/dist/{usage-format-C3mNLfhI.js → usage-format-C6Iz_Ws9.js} +0 -0
  843. /package/dist/{usage-format-DAaPzr_z.js → usage-format-CHBrzgvG.js} +0 -0
  844. /package/dist/{usage-BtQcAnf6.js → usage-sF5tij7A.js} +0 -0
  845. /package/dist/{widearea-dns-CsmBVbez.js → widearea-dns-CsqvX85g.js} +0 -0
  846. /package/dist/{widearea-dns-BXGCmXnD.js → widearea-dns-DtACcM7M.js} +0 -0
  847. /package/dist/{workspace-BzPeZDew.js → workspace-DpbQppPf.js} +0 -0
  848. /package/dist/{wsl-B_sPlzWw.js → wsl-B5ccPr42.js} +0 -0
  849. /package/dist/{wsl-BCnYV9O0.js → wsl-BJW8nTyL.js} +0 -0
@@ -0,0 +1,1426 @@
1
+ import "./paths-BTaH3rLn.js";
2
+ import { B as getResolvedLoggerSettings, L as theme, T as danger, j as setVerbose, l as isRecord } from "./utils-C5daYcFn.js";
3
+ import "./agent-helpers-DlqwUqOd.js";
4
+ import { $ as formatUsageReportLines, Q as loadProviderUsageSummary } from "./reply-gX7Zk9R8.js";
5
+ import "./subsystem-BgxIzx7w.js";
6
+ import { n as defaultRuntime } from "./runtime-Ds3E9SqF.js";
7
+ import "./ansi-aRwLYlzD.js";
8
+ import { h as normalizeAccountId, m as DEFAULT_ACCOUNT_ID } from "./session-key-C2n-VILA.js";
9
+ import { a as resolveAgentWorkspaceDir, s as resolveDefaultAgentId } from "./agent-scope-Dzc3Pxwr.js";
10
+ import "./subagent-registry-CpaLEiLw.js";
11
+ import "./message-channel-DF4I2vOK.js";
12
+ import { t as parseDiscordTarget } from "./targets-BEON1rlZ.js";
13
+ import { i as loadConfig, l as writeConfigFile, o as readConfigFileSnapshot } from "./config-BzYPJgWg.js";
14
+ import "./env-DUb5GiQe.js";
15
+ import "./host-env-security-Bms2_EMV.js";
16
+ import "./inbound-path-policy-gHabNHWN.js";
17
+ import "./env-vars-CLGbxdpL.js";
18
+ import "./dock-_qq4sBie.js";
19
+ import "./runner-BvtNyNts.js";
20
+ import "./logger-BiVcvOhw.js";
21
+ import "./ip-C9q3Oq20.js";
22
+ import "./ssrf-m7kFIobZ.js";
23
+ import "./local-roots-DJo8GN9l.js";
24
+ import "./exec-D6PvFXKb.js";
25
+ import "./tool-images-BLldmoMO.js";
26
+ import "./redact-BsoXOV1y.js";
27
+ import "./errors-BpAidYqH.js";
28
+ import "./mime-BS3jhcZE.js";
29
+ import { t as formatCliCommand } from "./command-format-DgXcqxBt.js";
30
+ import { o as loadAuthProfileStore } from "./auth-profiles-DJsaxEsz.js";
31
+ import "./file-lock-CIvloidc.js";
32
+ import { d as resolveTelegramAccount, n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-HyUNaoYP.js";
33
+ import "./accounts-Y6fBCsx_.js";
34
+ import "./accounts-B5BNJ_lk.js";
35
+ import "./accounts-DOwpPNpJ.js";
36
+ import "./bindings-C6J0GYWO.js";
37
+ import "./tokens-qLtFu3nT.js";
38
+ import "./reply-payloads-BzxytLE1.js";
39
+ import "./targets-DzGG0A-J.js";
40
+ import { n as deleteTelegramUpdateOffset } from "./loader-FZXIZr3R.js";
41
+ import "./commands-CX-o6Gzn.js";
42
+ import "./commands-registry-C_sd8Lmg.js";
43
+ import "./pairing-store-DlhFf9Sd.js";
44
+ import "./fetch-Du9BJ20J.js";
45
+ import "./retry-BbVJvOUo.js";
46
+ import { t as createSlackWebClient } from "./client-CwnX0nXo.js";
47
+ import "./chat-envelope-CRqgofiw.js";
48
+ import "./store-DdUK8zTC.js";
49
+ import "./strip-inbound-meta-B21Qdh8I.js";
50
+ import { n as formatTimeAgo } from "./format-relative-C6kUHuOj.js";
51
+ import "./audio-B_mzy948.js";
52
+ import { n as callGateway } from "./call-jLXWNKPQ.js";
53
+ import "./net-Dl7oQfqm.js";
54
+ import "./tailnet-wUV6epIk.js";
55
+ import "./lanes-DKkroN9D.js";
56
+ import "./response-prefix-template-oS-m4x5k.js";
57
+ import "./image-ops-XoE9nn-z.js";
58
+ import "./tool-display-BAIuLbtW.js";
59
+ import "./channel-activity-CDdk0baN.js";
60
+ import { Q as fetchChannelPermissionsDiscord } from "./send-C2vPu8jr.js";
61
+ import "./fs-safe-S3Zvbabd.js";
62
+ import "./ir-BaHZnJJM.js";
63
+ import "./chunk-Cx-gs159.js";
64
+ import "./markdown-tables-vq6-CCk-.js";
65
+ import "./render-CUAKPmvZ.js";
66
+ import "./tables-CmbvfFUi.js";
67
+ import "./session-cost-usage-Cd5Heqqu.js";
68
+ import "./common-Gc07uSGw.js";
69
+ import "./reply-directives-BSHSMfOP.js";
70
+ import "./channel-web-CQ6_87Mm.js";
71
+ import "./outbound-BFD5_jba.js";
72
+ import "./ack-reactions-DndoGKeN.js";
73
+ import "./session-BtRSSNK_.js";
74
+ import "./resolve-route-RsSFZfEu.js";
75
+ import "./provider-dispatcher-CUXHJBTf.js";
76
+ import "./store-CmRidfgp.js";
77
+ import "./reply-prefix-Cz79Mk_9.js";
78
+ import "./login-EqnFreqS.js";
79
+ import "./agent-BA1XT2jG.js";
80
+ import { r as listChannelPluginCatalogEntries } from "./catalog-oYxNmkeA.js";
81
+ import "./send-ysN09khs.js";
82
+ import "./send-BAki96aY.js";
83
+ import "./send-YjzTu9Vf.js";
84
+ import "./proxy-yk1Oqe9p.js";
85
+ import "./replies-DwXyI317.js";
86
+ import { n as resolveMessageChannelSelection } from "./channel-selection-CMK4YLlO.js";
87
+ import "./deliver-04fDIQb1.js";
88
+ import "./outbound-attachment-D05iLA7W.js";
89
+ import "./delivery-queue-BM3aWQIK.js";
90
+ import "./send-16QFH4iu.js";
91
+ import "./onboard-helpers-CoKiZn8s.js";
92
+ import "./prompt-style-BsR0RICZ.js";
93
+ import "./pairing-labels-D1m2vZ16.js";
94
+ import "./plugin-registry-B3Ovot-q.js";
95
+ import { t as formatCliChannelOptions } from "./channel-options-XhTwtBf5.js";
96
+ import { t as formatDocsLink } from "./links-BWZPW7Lq.js";
97
+ import { t as hasExplicitOptions } from "./command-options-DbRrl8qF.js";
98
+ import { n as withProgress } from "./progress-WaSih6uF.js";
99
+ import { t as runCommandWithRuntime } from "./cli-utils-DJwgT-LP.js";
100
+ import { t as formatHelpExamples } from "./help-format-BjjZaoq3.js";
101
+ import "./note-CAx7Id1-.js";
102
+ import { t as createClackPrompter } from "./clack-prompter-D7MCzOPT.js";
103
+ import { t as resolveChannelDefaultAccountId } from "./helpers-DkUEDuKD.js";
104
+ import "./plugin-auto-enable-SoRyAF_8.js";
105
+ import "./enable-BEScoJBZ.js";
106
+ import "./npm-registry-spec-CaHkYE_x.js";
107
+ import "./installs-BA3T7VAz.js";
108
+ import { a as reloadOnboardingPluginRegistry, i as ensureOnboardingPluginInstalled, r as setupChannels } from "./onboard-channels-RBADpVYy.js";
109
+ import { t as requireValidConfigSnapshot } from "./config-validation-BQqpcnJj.js";
110
+ import { t as buildChannelAccountSnapshot } from "./status-BNw-xk6B.js";
111
+ import { t as parseLogLine } from "./parse-log-line-CM1cOe-W.js";
112
+ import { t as collectChannelStatusIssues } from "./channels-status-issues-CVIgTe2p.js";
113
+ import fs from "node:fs/promises";
114
+
115
+ //#region src/commands/channels/add-mutators.ts
116
+ function applyAccountName(params) {
117
+ const accountId = normalizeAccountId(params.accountId);
118
+ const apply = getChannelPlugin(params.channel)?.setup?.applyAccountName;
119
+ return apply ? apply({
120
+ cfg: params.cfg,
121
+ accountId,
122
+ name: params.name
123
+ }) : params.cfg;
124
+ }
125
+ function applyChannelAccountConfig(params) {
126
+ const accountId = normalizeAccountId(params.accountId);
127
+ const apply = getChannelPlugin(params.channel)?.setup?.applyAccountConfig;
128
+ if (!apply) return params.cfg;
129
+ return apply({
130
+ cfg: params.cfg,
131
+ accountId,
132
+ input: params.input
133
+ });
134
+ }
135
+
136
+ //#endregion
137
+ //#region src/commands/channels/shared.ts
138
+ async function requireValidConfig(runtime = defaultRuntime) {
139
+ return await requireValidConfigSnapshot(runtime);
140
+ }
141
+ function formatAccountLabel(params) {
142
+ const base = params.accountId || DEFAULT_ACCOUNT_ID;
143
+ if (params.name?.trim()) return `${base} (${params.name.trim()})`;
144
+ return base;
145
+ }
146
+ const channelLabel = (channel) => {
147
+ return getChannelPlugin(channel)?.meta.label ?? channel;
148
+ };
149
+ function formatChannelAccountLabel(params) {
150
+ const channelText = channelLabel(params.channel);
151
+ const accountText = formatAccountLabel({
152
+ accountId: params.accountId,
153
+ name: params.name
154
+ });
155
+ return `${params.channelStyle ? params.channelStyle(channelText) : channelText} ${params.accountStyle ? params.accountStyle(accountText) : accountText}`;
156
+ }
157
+ function shouldUseWizard(params) {
158
+ return params?.hasFlags === false;
159
+ }
160
+
161
+ //#endregion
162
+ //#region src/commands/channels/add.ts
163
+ function parseList(value) {
164
+ if (!value?.trim()) return;
165
+ const parsed = value.split(/[\n,;]+/g).map((entry) => entry.trim()).filter(Boolean);
166
+ return parsed.length > 0 ? parsed : void 0;
167
+ }
168
+ function resolveCatalogChannelEntry(raw, cfg) {
169
+ const trimmed = raw.trim().toLowerCase();
170
+ if (!trimmed) return;
171
+ return listChannelPluginCatalogEntries({ workspaceDir: cfg ? resolveAgentWorkspaceDir(cfg, resolveDefaultAgentId(cfg)) : void 0 }).find((entry) => {
172
+ if (entry.id.toLowerCase() === trimmed) return true;
173
+ return (entry.meta.aliases ?? []).some((alias) => alias.trim().toLowerCase() === trimmed);
174
+ });
175
+ }
176
+ async function channelsAddCommand(opts, runtime = defaultRuntime, params) {
177
+ const cfg = await requireValidConfig(runtime);
178
+ if (!cfg) return;
179
+ let nextConfig = cfg;
180
+ if (shouldUseWizard(params)) {
181
+ const prompter = createClackPrompter();
182
+ let selection = [];
183
+ const accountIds = {};
184
+ await prompter.intro("Channel setup");
185
+ let nextConfig = await setupChannels(cfg, runtime, prompter, {
186
+ allowDisable: false,
187
+ allowSignalInstall: true,
188
+ promptAccountIds: true,
189
+ onSelection: (value) => {
190
+ selection = value;
191
+ },
192
+ onAccountId: (channel, accountId) => {
193
+ accountIds[channel] = accountId;
194
+ }
195
+ });
196
+ if (selection.length === 0) {
197
+ await prompter.outro("No channels selected.");
198
+ return;
199
+ }
200
+ if (await prompter.confirm({
201
+ message: "Add display names for these accounts? (optional)",
202
+ initialValue: false
203
+ })) for (const channel of selection) {
204
+ const accountId = accountIds[channel] ?? DEFAULT_ACCOUNT_ID;
205
+ const plugin = getChannelPlugin(channel);
206
+ const account = plugin?.config.resolveAccount(nextConfig, accountId);
207
+ const existingName = (plugin?.config.describeAccount?.(account, nextConfig))?.name ?? account?.name;
208
+ const name = await prompter.text({
209
+ message: `${channel} account name (${accountId})`,
210
+ initialValue: existingName
211
+ });
212
+ if (name?.trim()) nextConfig = applyAccountName({
213
+ cfg: nextConfig,
214
+ channel,
215
+ accountId,
216
+ name
217
+ });
218
+ }
219
+ await writeConfigFile(nextConfig);
220
+ await prompter.outro("Channels updated.");
221
+ return;
222
+ }
223
+ const rawChannel = String(opts.channel ?? "");
224
+ let channel = normalizeChannelId(rawChannel);
225
+ let catalogEntry = channel ? void 0 : resolveCatalogChannelEntry(rawChannel, nextConfig);
226
+ if (!channel && catalogEntry) {
227
+ const prompter = createClackPrompter();
228
+ const workspaceDir = resolveAgentWorkspaceDir(nextConfig, resolveDefaultAgentId(nextConfig));
229
+ const result = await ensureOnboardingPluginInstalled({
230
+ cfg: nextConfig,
231
+ entry: catalogEntry,
232
+ prompter,
233
+ runtime,
234
+ workspaceDir
235
+ });
236
+ nextConfig = result.cfg;
237
+ if (!result.installed) return;
238
+ reloadOnboardingPluginRegistry({
239
+ cfg: nextConfig,
240
+ runtime,
241
+ workspaceDir
242
+ });
243
+ channel = normalizeChannelId(catalogEntry.id) ?? catalogEntry.id;
244
+ }
245
+ if (!channel) {
246
+ const hint = catalogEntry ? `Plugin ${catalogEntry.meta.label} could not be loaded after install.` : `Unknown channel: ${String(opts.channel ?? "")}`;
247
+ runtime.error(hint);
248
+ runtime.exit(1);
249
+ return;
250
+ }
251
+ const plugin = getChannelPlugin(channel);
252
+ if (!plugin?.setup?.applyAccountConfig) {
253
+ runtime.error(`Channel ${channel} does not support add.`);
254
+ runtime.exit(1);
255
+ return;
256
+ }
257
+ const accountId = plugin.setup.resolveAccountId?.({
258
+ cfg: nextConfig,
259
+ accountId: opts.account
260
+ }) ?? normalizeAccountId(opts.account);
261
+ const useEnv = opts.useEnv === true;
262
+ const initialSyncLimit = typeof opts.initialSyncLimit === "number" ? opts.initialSyncLimit : typeof opts.initialSyncLimit === "string" && opts.initialSyncLimit.trim() ? Number.parseInt(opts.initialSyncLimit, 10) : void 0;
263
+ const groupChannels = parseList(opts.groupChannels);
264
+ const dmAllowlist = parseList(opts.dmAllowlist);
265
+ const input = {
266
+ name: opts.name,
267
+ token: opts.token,
268
+ tokenFile: opts.tokenFile,
269
+ botToken: opts.botToken,
270
+ appToken: opts.appToken,
271
+ signalNumber: opts.signalNumber,
272
+ cliPath: opts.cliPath,
273
+ dbPath: opts.dbPath,
274
+ service: opts.service,
275
+ region: opts.region,
276
+ authDir: opts.authDir,
277
+ httpUrl: opts.httpUrl,
278
+ httpHost: opts.httpHost,
279
+ httpPort: opts.httpPort,
280
+ webhookPath: opts.webhookPath,
281
+ webhookUrl: opts.webhookUrl,
282
+ audienceType: opts.audienceType,
283
+ audience: opts.audience,
284
+ homeserver: opts.homeserver,
285
+ userId: opts.userId,
286
+ accessToken: opts.accessToken,
287
+ password: opts.password,
288
+ deviceName: opts.deviceName,
289
+ initialSyncLimit,
290
+ useEnv,
291
+ ship: opts.ship,
292
+ url: opts.url,
293
+ code: opts.code,
294
+ groupChannels,
295
+ dmAllowlist,
296
+ autoDiscoverChannels: opts.autoDiscoverChannels
297
+ };
298
+ const validationError = plugin.setup.validateInput?.({
299
+ cfg: nextConfig,
300
+ accountId,
301
+ input
302
+ });
303
+ if (validationError) {
304
+ runtime.error(validationError);
305
+ runtime.exit(1);
306
+ return;
307
+ }
308
+ const previousTelegramToken = channel === "telegram" ? resolveTelegramAccount({
309
+ cfg: nextConfig,
310
+ accountId
311
+ }).token.trim() : "";
312
+ nextConfig = applyChannelAccountConfig({
313
+ cfg: nextConfig,
314
+ channel,
315
+ accountId,
316
+ input
317
+ });
318
+ if (channel === "telegram") {
319
+ if (previousTelegramToken !== resolveTelegramAccount({
320
+ cfg: nextConfig,
321
+ accountId
322
+ }).token.trim()) await deleteTelegramUpdateOffset({ accountId });
323
+ }
324
+ await writeConfigFile(nextConfig);
325
+ runtime.log(`Added ${channelLabel(channel)} account "${accountId}".`);
326
+ }
327
+
328
+ //#endregion
329
+ //#region src/slack/scopes.ts
330
+ function collectScopes(value, into) {
331
+ if (!value) return;
332
+ if (Array.isArray(value)) {
333
+ for (const entry of value) if (typeof entry === "string" && entry.trim()) into.push(entry.trim());
334
+ return;
335
+ }
336
+ if (typeof value === "string") {
337
+ const raw = value.trim();
338
+ if (!raw) return;
339
+ const parts = raw.split(/[,\s]+/).map((part) => part.trim());
340
+ for (const part of parts) if (part) into.push(part);
341
+ return;
342
+ }
343
+ if (!isRecord(value)) return;
344
+ for (const entry of Object.values(value)) if (Array.isArray(entry) || typeof entry === "string") collectScopes(entry, into);
345
+ }
346
+ function normalizeScopes(scopes) {
347
+ return Array.from(new Set(scopes.map((scope) => scope.trim()).filter(Boolean))).toSorted();
348
+ }
349
+ function extractScopes(payload) {
350
+ if (!isRecord(payload)) return [];
351
+ const scopes = [];
352
+ collectScopes(payload.scopes, scopes);
353
+ collectScopes(payload.scope, scopes);
354
+ if (isRecord(payload.info)) {
355
+ collectScopes(payload.info.scopes, scopes);
356
+ collectScopes(payload.info.scope, scopes);
357
+ collectScopes(payload.info.user_scopes, scopes);
358
+ collectScopes(payload.info.bot_scopes, scopes);
359
+ }
360
+ return normalizeScopes(scopes);
361
+ }
362
+ function readError(payload) {
363
+ if (!isRecord(payload)) return;
364
+ const error = payload.error;
365
+ return typeof error === "string" && error.trim() ? error.trim() : void 0;
366
+ }
367
+ async function callSlack(client, method) {
368
+ try {
369
+ const result = await client.apiCall(method);
370
+ return isRecord(result) ? result : null;
371
+ } catch (err) {
372
+ return {
373
+ ok: false,
374
+ error: err instanceof Error ? err.message : String(err)
375
+ };
376
+ }
377
+ }
378
+ async function fetchSlackScopes(token, timeoutMs) {
379
+ const client = createSlackWebClient(token, { timeout: timeoutMs });
380
+ const attempts = ["auth.scopes", "apps.permissions.info"];
381
+ const errors = [];
382
+ for (const method of attempts) {
383
+ const result = await callSlack(client, method);
384
+ const scopes = extractScopes(result);
385
+ if (scopes.length > 0) return {
386
+ ok: true,
387
+ scopes,
388
+ source: method
389
+ };
390
+ const error = readError(result);
391
+ if (error) errors.push(`${method}: ${error}`);
392
+ }
393
+ return {
394
+ ok: false,
395
+ error: errors.length > 0 ? errors.join(" | ") : "no scopes returned"
396
+ };
397
+ }
398
+
399
+ //#endregion
400
+ //#region src/commands/channels/capabilities.ts
401
+ const REQUIRED_DISCORD_PERMISSIONS = ["ViewChannel", "SendMessages"];
402
+ const TEAMS_GRAPH_PERMISSION_HINTS = {
403
+ "ChannelMessage.Read.All": "channel history",
404
+ "Chat.Read.All": "chat history",
405
+ "Channel.ReadBasic.All": "channel list",
406
+ "Team.ReadBasic.All": "team list",
407
+ "TeamsActivity.Read.All": "teams activity",
408
+ "Sites.Read.All": "files (SharePoint)",
409
+ "Files.Read.All": "files (OneDrive)"
410
+ };
411
+ function normalizeTimeout(raw, fallback = 1e4) {
412
+ const value = typeof raw === "string" ? Number(raw) : Number(raw);
413
+ if (!Number.isFinite(value) || value <= 0) return fallback;
414
+ return value;
415
+ }
416
+ function formatSupport(capabilities) {
417
+ if (!capabilities) return "unknown";
418
+ const bits = [];
419
+ if (capabilities.chatTypes?.length) bits.push(`chatTypes=${capabilities.chatTypes.join(",")}`);
420
+ if (capabilities.polls) bits.push("polls");
421
+ if (capabilities.reactions) bits.push("reactions");
422
+ if (capabilities.edit) bits.push("edit");
423
+ if (capabilities.unsend) bits.push("unsend");
424
+ if (capabilities.reply) bits.push("reply");
425
+ if (capabilities.effects) bits.push("effects");
426
+ if (capabilities.groupManagement) bits.push("groupManagement");
427
+ if (capabilities.threads) bits.push("threads");
428
+ if (capabilities.media) bits.push("media");
429
+ if (capabilities.nativeCommands) bits.push("nativeCommands");
430
+ if (capabilities.blockStreaming) bits.push("blockStreaming");
431
+ return bits.length ? bits.join(" ") : "none";
432
+ }
433
+ function summarizeDiscordTarget(raw) {
434
+ if (!raw) return;
435
+ const target = parseDiscordTarget(raw, { defaultKind: "channel" });
436
+ if (!target) return { raw };
437
+ if (target.kind === "channel") return {
438
+ raw,
439
+ normalized: target.normalized,
440
+ kind: "channel",
441
+ channelId: target.id
442
+ };
443
+ if (target.kind === "user") return {
444
+ raw,
445
+ normalized: target.normalized,
446
+ kind: "user"
447
+ };
448
+ return {
449
+ raw,
450
+ normalized: target.normalized
451
+ };
452
+ }
453
+ function formatDiscordIntents(intents) {
454
+ if (!intents) return "unknown";
455
+ return [
456
+ `messageContent=${intents.messageContent ?? "unknown"}`,
457
+ `guildMembers=${intents.guildMembers ?? "unknown"}`,
458
+ `presence=${intents.presence ?? "unknown"}`
459
+ ].join(" ");
460
+ }
461
+ function formatProbeLines(channelId, probe) {
462
+ const lines = [];
463
+ if (!probe || typeof probe !== "object") return lines;
464
+ const probeObj = probe;
465
+ if (channelId === "discord") {
466
+ const bot = probeObj.bot;
467
+ if (bot?.username) {
468
+ const botId = bot.id ? ` (${bot.id})` : "";
469
+ lines.push(`Bot: ${theme.accent(`@${bot.username}`)}${botId}`);
470
+ }
471
+ const app = probeObj.application;
472
+ if (app?.intents) lines.push(`Intents: ${formatDiscordIntents(app.intents)}`);
473
+ }
474
+ if (channelId === "telegram") {
475
+ const bot = probeObj.bot;
476
+ if (bot?.username) {
477
+ const botId = bot.id ? ` (${bot.id})` : "";
478
+ lines.push(`Bot: ${theme.accent(`@${bot.username}`)}${botId}`);
479
+ }
480
+ const flags = [];
481
+ const canJoinGroups = bot?.canJoinGroups;
482
+ const canReadAll = bot?.canReadAllGroupMessages;
483
+ const inlineQueries = bot?.supportsInlineQueries;
484
+ if (typeof canJoinGroups === "boolean") flags.push(`joinGroups=${canJoinGroups}`);
485
+ if (typeof canReadAll === "boolean") flags.push(`readAllGroupMessages=${canReadAll}`);
486
+ if (typeof inlineQueries === "boolean") flags.push(`inlineQueries=${inlineQueries}`);
487
+ if (flags.length > 0) lines.push(`Flags: ${flags.join(" ")}`);
488
+ const webhook = probeObj.webhook;
489
+ if (webhook?.url !== void 0) lines.push(`Webhook: ${webhook.url || "none"}`);
490
+ }
491
+ if (channelId === "slack") {
492
+ const bot = probeObj.bot;
493
+ const team = probeObj.team;
494
+ if (bot?.name) lines.push(`Bot: ${theme.accent(`@${bot.name}`)}`);
495
+ if (team?.name || team?.id) {
496
+ const id = team?.id ? ` (${team.id})` : "";
497
+ lines.push(`Team: ${team?.name ?? "unknown"}${id}`);
498
+ }
499
+ }
500
+ if (channelId === "signal") {
501
+ const version = probeObj.version;
502
+ if (version) lines.push(`Signal daemon: ${version}`);
503
+ }
504
+ if (channelId === "msteams") {
505
+ const appId = typeof probeObj.appId === "string" ? probeObj.appId.trim() : "";
506
+ if (appId) lines.push(`App: ${theme.accent(appId)}`);
507
+ const graph = probeObj.graph;
508
+ if (graph) {
509
+ const roles = Array.isArray(graph.roles) ? graph.roles.map((role) => String(role).trim()).filter(Boolean) : [];
510
+ const scopes = typeof graph.scopes === "string" ? graph.scopes.split(/\s+/).map((scope) => scope.trim()).filter(Boolean) : Array.isArray(graph.scopes) ? graph.scopes.map((scope) => String(scope).trim()).filter(Boolean) : [];
511
+ if (graph.ok === false) lines.push(`Graph: ${theme.error(graph.error ?? "failed")}`);
512
+ else if (roles.length > 0 || scopes.length > 0) {
513
+ const formatPermission = (permission) => {
514
+ const hint = TEAMS_GRAPH_PERMISSION_HINTS[permission];
515
+ return hint ? `${permission} (${hint})` : permission;
516
+ };
517
+ if (roles.length > 0) lines.push(`Graph roles: ${roles.map(formatPermission).join(", ")}`);
518
+ if (scopes.length > 0) lines.push(`Graph scopes: ${scopes.map(formatPermission).join(", ")}`);
519
+ } else if (graph.ok === true) lines.push("Graph: ok");
520
+ }
521
+ }
522
+ const ok = typeof probeObj.ok === "boolean" ? probeObj.ok : void 0;
523
+ if (ok === true && lines.length === 0) lines.push("Probe: ok");
524
+ if (ok === false) {
525
+ const error = typeof probeObj.error === "string" && probeObj.error ? ` (${probeObj.error})` : "";
526
+ lines.push(`Probe: ${theme.error(`failed${error}`)}`);
527
+ }
528
+ return lines;
529
+ }
530
+ async function buildDiscordPermissions(params) {
531
+ const target = summarizeDiscordTarget(params.target?.trim());
532
+ if (!target) return {};
533
+ if (target.kind !== "channel" || !target.channelId) return {
534
+ target,
535
+ report: { error: "Target looks like a DM user; pass channel:<id> to audit channel permissions." }
536
+ };
537
+ const token = params.account.token?.trim();
538
+ if (!token) return {
539
+ target,
540
+ report: {
541
+ channelId: target.channelId,
542
+ error: "Discord bot token missing for permission audit."
543
+ }
544
+ };
545
+ try {
546
+ const perms = await fetchChannelPermissionsDiscord(target.channelId, {
547
+ token,
548
+ accountId: params.account.accountId ?? void 0
549
+ });
550
+ const missing = REQUIRED_DISCORD_PERMISSIONS.filter((permission) => !perms.permissions.includes(permission));
551
+ return {
552
+ target,
553
+ report: {
554
+ channelId: perms.channelId,
555
+ guildId: perms.guildId,
556
+ isDm: perms.isDm,
557
+ channelType: perms.channelType,
558
+ permissions: perms.permissions,
559
+ missingRequired: missing.length ? missing : [],
560
+ raw: perms.raw
561
+ }
562
+ };
563
+ } catch (err) {
564
+ return {
565
+ target,
566
+ report: {
567
+ channelId: target.channelId,
568
+ error: err instanceof Error ? err.message : String(err)
569
+ }
570
+ };
571
+ }
572
+ }
573
+ async function resolveChannelReports(params) {
574
+ const { plugin, cfg, timeoutMs } = params;
575
+ const accountIds = params.accountOverride ? [params.accountOverride] : (() => {
576
+ const ids = plugin.config.listAccountIds(cfg);
577
+ return ids.length > 0 ? ids : [resolveChannelDefaultAccountId({
578
+ plugin,
579
+ cfg,
580
+ accountIds: ids
581
+ })];
582
+ })();
583
+ const reports = [];
584
+ const listedActions = plugin.actions?.listActions?.({ cfg }) ?? [];
585
+ const actions = Array.from(new Set([
586
+ "send",
587
+ "broadcast",
588
+ ...listedActions.map((action) => String(action))
589
+ ]));
590
+ for (const accountId of accountIds) {
591
+ const resolvedAccount = plugin.config.resolveAccount(cfg, accountId);
592
+ const configured = plugin.config.isConfigured ? await plugin.config.isConfigured(resolvedAccount, cfg) : Boolean(resolvedAccount);
593
+ const enabled = plugin.config.isEnabled ? plugin.config.isEnabled(resolvedAccount, cfg) : resolvedAccount.enabled !== false;
594
+ let probe;
595
+ if (configured && enabled && plugin.status?.probeAccount) try {
596
+ probe = await plugin.status.probeAccount({
597
+ account: resolvedAccount,
598
+ timeoutMs,
599
+ cfg
600
+ });
601
+ } catch (err) {
602
+ probe = {
603
+ ok: false,
604
+ error: err instanceof Error ? err.message : String(err)
605
+ };
606
+ }
607
+ let slackScopes;
608
+ if (plugin.id === "slack" && configured && enabled) {
609
+ const botToken = resolvedAccount.botToken?.trim();
610
+ const userToken = resolvedAccount.config?.userToken?.trim();
611
+ const scopeReports = [];
612
+ if (botToken) scopeReports.push({
613
+ tokenType: "bot",
614
+ result: await fetchSlackScopes(botToken, timeoutMs)
615
+ });
616
+ else scopeReports.push({
617
+ tokenType: "bot",
618
+ result: {
619
+ ok: false,
620
+ error: "Slack bot token missing."
621
+ }
622
+ });
623
+ if (userToken) scopeReports.push({
624
+ tokenType: "user",
625
+ result: await fetchSlackScopes(userToken, timeoutMs)
626
+ });
627
+ slackScopes = scopeReports;
628
+ }
629
+ let discordTarget;
630
+ let discordPermissions;
631
+ if (plugin.id === "discord" && params.target) {
632
+ const perms = await buildDiscordPermissions({
633
+ account: resolvedAccount,
634
+ target: params.target
635
+ });
636
+ discordTarget = perms.target;
637
+ discordPermissions = perms.report;
638
+ }
639
+ reports.push({
640
+ channel: plugin.id,
641
+ accountId,
642
+ accountName: typeof resolvedAccount.name === "string" ? resolvedAccount.name?.trim() || void 0 : void 0,
643
+ configured,
644
+ enabled,
645
+ support: plugin.capabilities,
646
+ probe,
647
+ target: discordTarget,
648
+ channelPermissions: discordPermissions,
649
+ actions,
650
+ slackScopes
651
+ });
652
+ }
653
+ return reports;
654
+ }
655
+ async function channelsCapabilitiesCommand(opts, runtime = defaultRuntime) {
656
+ const cfg = await requireValidConfig(runtime);
657
+ if (!cfg) return;
658
+ const timeoutMs = normalizeTimeout(opts.timeout, 1e4);
659
+ const rawChannel = typeof opts.channel === "string" ? opts.channel.trim().toLowerCase() : "";
660
+ const rawTarget = typeof opts.target === "string" ? opts.target.trim() : "";
661
+ if (opts.account && (!rawChannel || rawChannel === "all")) {
662
+ runtime.error(danger("--account requires a specific --channel."));
663
+ runtime.exit(1);
664
+ return;
665
+ }
666
+ if (rawTarget && rawChannel !== "discord") {
667
+ runtime.error(danger("--target requires --channel discord."));
668
+ runtime.exit(1);
669
+ return;
670
+ }
671
+ const plugins = listChannelPlugins();
672
+ const selected = !rawChannel || rawChannel === "all" ? plugins : (() => {
673
+ const plugin = getChannelPlugin(rawChannel);
674
+ if (!plugin) return null;
675
+ return [plugin];
676
+ })();
677
+ if (!selected || selected.length === 0) {
678
+ runtime.error(danger(`Unknown channel "${rawChannel}".`));
679
+ runtime.exit(1);
680
+ return;
681
+ }
682
+ const reports = [];
683
+ for (const plugin of selected) {
684
+ const accountOverride = opts.account?.trim() || void 0;
685
+ reports.push(...await resolveChannelReports({
686
+ plugin,
687
+ cfg,
688
+ timeoutMs,
689
+ accountOverride,
690
+ target: rawTarget && plugin.id === "discord" ? rawTarget : void 0
691
+ }));
692
+ }
693
+ if (opts.json) {
694
+ runtime.log(JSON.stringify({ channels: reports }, null, 2));
695
+ return;
696
+ }
697
+ const lines = [];
698
+ for (const report of reports) {
699
+ const label = formatChannelAccountLabel({
700
+ channel: report.channel,
701
+ accountId: report.accountId,
702
+ name: report.accountName,
703
+ channelStyle: theme.accent,
704
+ accountStyle: theme.heading
705
+ });
706
+ lines.push(theme.heading(label));
707
+ lines.push(`Support: ${formatSupport(report.support)}`);
708
+ if (report.actions && report.actions.length > 0) lines.push(`Actions: ${report.actions.join(", ")}`);
709
+ if (report.configured === false || report.enabled === false) {
710
+ const configuredLabel = report.configured === false ? "not configured" : "configured";
711
+ const enabledLabel = report.enabled === false ? "disabled" : "enabled";
712
+ lines.push(`Status: ${configuredLabel}, ${enabledLabel}`);
713
+ }
714
+ const probeLines = formatProbeLines(report.channel, report.probe);
715
+ if (probeLines.length > 0) lines.push(...probeLines);
716
+ else if (report.configured && report.enabled) lines.push(theme.muted("Probe: unavailable"));
717
+ if (report.channel === "slack" && report.slackScopes) for (const entry of report.slackScopes) {
718
+ const source = entry.result.source ? ` (${entry.result.source})` : "";
719
+ const label = entry.tokenType === "user" ? "User scopes" : "Bot scopes";
720
+ if (entry.result.ok && entry.result.scopes?.length) lines.push(`${label}${source}: ${entry.result.scopes.join(", ")}`);
721
+ else if (entry.result.error) lines.push(`${label}: ${theme.error(entry.result.error)}`);
722
+ }
723
+ if (report.channel === "discord" && report.channelPermissions) {
724
+ const perms = report.channelPermissions;
725
+ if (perms.error) lines.push(`Permissions: ${theme.error(perms.error)}`);
726
+ else {
727
+ const list = perms.permissions?.length ? perms.permissions.join(", ") : "none";
728
+ const label = perms.channelId ? ` (${perms.channelId})` : "";
729
+ lines.push(`Permissions${label}: ${list}`);
730
+ if (perms.missingRequired && perms.missingRequired.length > 0) lines.push(`${theme.warn("Missing required:")} ${perms.missingRequired.join(", ")}`);
731
+ else lines.push(theme.success("Missing required: none"));
732
+ }
733
+ } else if (report.channel === "discord" && rawTarget && !report.channelPermissions) lines.push(theme.muted("Permissions: skipped (no target)."));
734
+ lines.push("");
735
+ }
736
+ runtime.log(lines.join("\n").trimEnd());
737
+ }
738
+
739
+ //#endregion
740
+ //#region src/commands/channels/list.ts
741
+ const colorValue = (value) => {
742
+ if (value === "none") return theme.error(value);
743
+ if (value === "env") return theme.accent(value);
744
+ return theme.success(value);
745
+ };
746
+ function formatEnabled(value) {
747
+ return value === false ? theme.error("disabled") : theme.success("enabled");
748
+ }
749
+ function formatConfigured(value) {
750
+ return value ? theme.success("configured") : theme.warn("not configured");
751
+ }
752
+ function formatTokenSource(source) {
753
+ return `token=${colorValue(source || "none")}`;
754
+ }
755
+ function formatSource(label, source) {
756
+ return `${label}=${colorValue(source || "none")}`;
757
+ }
758
+ function formatLinked(value) {
759
+ return value ? theme.success("linked") : theme.warn("not linked");
760
+ }
761
+ function shouldShowConfigured(channel) {
762
+ return channel.meta.showConfigured !== false;
763
+ }
764
+ function formatAccountLine(params) {
765
+ const { channel, snapshot } = params;
766
+ const label = formatChannelAccountLabel({
767
+ channel: channel.id,
768
+ accountId: snapshot.accountId,
769
+ name: snapshot.name,
770
+ channelStyle: theme.accent,
771
+ accountStyle: theme.heading
772
+ });
773
+ const bits = [];
774
+ if (snapshot.linked !== void 0) bits.push(formatLinked(snapshot.linked));
775
+ if (shouldShowConfigured(channel) && typeof snapshot.configured === "boolean") bits.push(formatConfigured(snapshot.configured));
776
+ if (snapshot.tokenSource) bits.push(formatTokenSource(snapshot.tokenSource));
777
+ if (snapshot.botTokenSource) bits.push(formatSource("bot", snapshot.botTokenSource));
778
+ if (snapshot.appTokenSource) bits.push(formatSource("app", snapshot.appTokenSource));
779
+ if (snapshot.baseUrl) bits.push(`base=${theme.muted(snapshot.baseUrl)}`);
780
+ if (typeof snapshot.enabled === "boolean") bits.push(formatEnabled(snapshot.enabled));
781
+ return `- ${label}: ${bits.join(", ")}`;
782
+ }
783
+ async function loadUsageWithProgress(runtime) {
784
+ try {
785
+ return await withProgress({
786
+ label: "Fetching usage snapshot…",
787
+ indeterminate: true,
788
+ enabled: true
789
+ }, async () => await loadProviderUsageSummary());
790
+ } catch (err) {
791
+ runtime.error(String(err));
792
+ return null;
793
+ }
794
+ }
795
+ async function channelsListCommand(opts, runtime = defaultRuntime) {
796
+ const cfg = await requireValidConfig(runtime);
797
+ if (!cfg) return;
798
+ const includeUsage = opts.usage !== false;
799
+ const plugins = listChannelPlugins();
800
+ const authStore = loadAuthProfileStore();
801
+ const authProfiles = Object.entries(authStore.profiles).map(([profileId, profile]) => ({
802
+ id: profileId,
803
+ provider: profile.provider,
804
+ type: profile.type,
805
+ isExternal: false
806
+ }));
807
+ if (opts.json) {
808
+ const usage = includeUsage ? await loadProviderUsageSummary() : void 0;
809
+ const chat = {};
810
+ for (const plugin of plugins) chat[plugin.id] = plugin.config.listAccountIds(cfg);
811
+ const payload = {
812
+ chat,
813
+ auth: authProfiles,
814
+ ...usage ? { usage } : {}
815
+ };
816
+ runtime.log(JSON.stringify(payload, null, 2));
817
+ return;
818
+ }
819
+ const lines = [];
820
+ lines.push(theme.heading("Chat channels:"));
821
+ for (const plugin of plugins) {
822
+ const accounts = plugin.config.listAccountIds(cfg);
823
+ if (!accounts || accounts.length === 0) continue;
824
+ for (const accountId of accounts) {
825
+ const snapshot = await buildChannelAccountSnapshot({
826
+ plugin,
827
+ cfg,
828
+ accountId
829
+ });
830
+ lines.push(formatAccountLine({
831
+ channel: plugin,
832
+ snapshot
833
+ }));
834
+ }
835
+ }
836
+ lines.push("");
837
+ lines.push(theme.heading("Auth providers (OAuth + API keys):"));
838
+ if (authProfiles.length === 0) lines.push(theme.muted("- none"));
839
+ else for (const profile of authProfiles) {
840
+ const external = profile.isExternal ? theme.muted(" (synced)") : "";
841
+ lines.push(`- ${theme.accent(profile.id)} (${theme.success(profile.type)}${external})`);
842
+ }
843
+ runtime.log(lines.join("\n"));
844
+ if (includeUsage) {
845
+ runtime.log("");
846
+ const usage = await loadUsageWithProgress(runtime);
847
+ if (usage) {
848
+ const usageLines = formatUsageReportLines(usage);
849
+ if (usageLines.length > 0) {
850
+ usageLines[0] = theme.accent(usageLines[0]);
851
+ runtime.log(usageLines.join("\n"));
852
+ }
853
+ }
854
+ }
855
+ runtime.log("");
856
+ runtime.log(`Docs: ${formatDocsLink("/gateway/configuration", "gateway/configuration")}`);
857
+ }
858
+
859
+ //#endregion
860
+ //#region src/commands/channels/logs.ts
861
+ const DEFAULT_LIMIT = 200;
862
+ const MAX_BYTES = 1e6;
863
+ const getChannelSet = () => new Set([...listChannelPlugins().map((plugin) => plugin.id), "all"]);
864
+ function parseChannelFilter(raw) {
865
+ const trimmed = raw?.trim().toLowerCase();
866
+ if (!trimmed) return "all";
867
+ return getChannelSet().has(trimmed) ? trimmed : "all";
868
+ }
869
+ function matchesChannel(line, channel) {
870
+ if (channel === "all") return true;
871
+ const needle = `gateway/channels/${channel}`;
872
+ if (line.subsystem?.includes(needle)) return true;
873
+ if (line.module?.includes(channel)) return true;
874
+ return false;
875
+ }
876
+ async function readTailLines(file, limit) {
877
+ const stat = await fs.stat(file).catch(() => null);
878
+ if (!stat) return [];
879
+ const size = stat.size;
880
+ const start = Math.max(0, size - MAX_BYTES);
881
+ const handle = await fs.open(file, "r");
882
+ try {
883
+ const length = Math.max(0, size - start);
884
+ if (length === 0) return [];
885
+ const buffer = Buffer.alloc(length);
886
+ const readResult = await handle.read(buffer, 0, length, start);
887
+ let lines = buffer.toString("utf8", 0, readResult.bytesRead).split("\n");
888
+ if (start > 0) lines = lines.slice(1);
889
+ if (lines.length && lines[lines.length - 1] === "") lines = lines.slice(0, -1);
890
+ if (lines.length > limit) lines = lines.slice(lines.length - limit);
891
+ return lines;
892
+ } finally {
893
+ await handle.close();
894
+ }
895
+ }
896
+ async function channelsLogsCommand(opts, runtime = defaultRuntime) {
897
+ const channel = parseChannelFilter(opts.channel);
898
+ const limitRaw = typeof opts.lines === "string" ? Number(opts.lines) : opts.lines;
899
+ const limit = typeof limitRaw === "number" && Number.isFinite(limitRaw) && limitRaw > 0 ? Math.floor(limitRaw) : DEFAULT_LIMIT;
900
+ const file = getResolvedLoggerSettings().file;
901
+ const filtered = (await readTailLines(file, limit * 4)).map(parseLogLine).filter((line) => Boolean(line)).filter((line) => matchesChannel(line, channel));
902
+ const lines = filtered.slice(Math.max(0, filtered.length - limit));
903
+ if (opts.json) {
904
+ runtime.log(JSON.stringify({
905
+ file,
906
+ channel,
907
+ lines
908
+ }, null, 2));
909
+ return;
910
+ }
911
+ runtime.log(theme.info(`Log file: ${file}`));
912
+ if (channel !== "all") runtime.log(theme.info(`Channel: ${channel}`));
913
+ if (lines.length === 0) {
914
+ runtime.log(theme.muted("No matching log lines."));
915
+ return;
916
+ }
917
+ for (const line of lines) {
918
+ const ts = line.time ? `${line.time} ` : "";
919
+ const level = line.level ? `${line.level.toLowerCase()} ` : "";
920
+ runtime.log(`${ts}${level}${line.message}`.trim());
921
+ }
922
+ }
923
+
924
+ //#endregion
925
+ //#region src/commands/channels/remove.ts
926
+ function listAccountIds(cfg, channel) {
927
+ const plugin = getChannelPlugin(channel);
928
+ if (!plugin) return [];
929
+ return plugin.config.listAccountIds(cfg);
930
+ }
931
+ async function channelsRemoveCommand(opts, runtime = defaultRuntime, params) {
932
+ const cfg = await requireValidConfig(runtime);
933
+ if (!cfg) return;
934
+ const useWizard = shouldUseWizard(params);
935
+ const prompter = useWizard ? createClackPrompter() : null;
936
+ let channel = normalizeChannelId(opts.channel);
937
+ let accountId = normalizeAccountId(opts.account);
938
+ const deleteConfig = Boolean(opts.delete);
939
+ if (useWizard && prompter) {
940
+ await prompter.intro("Remove channel account");
941
+ const selectedChannel = await prompter.select({
942
+ message: "Channel",
943
+ options: listChannelPlugins().map((plugin) => ({
944
+ value: plugin.id,
945
+ label: plugin.meta.label
946
+ }))
947
+ });
948
+ channel = selectedChannel;
949
+ accountId = await (async () => {
950
+ const ids = listAccountIds(cfg, selectedChannel);
951
+ return normalizeAccountId(await prompter.select({
952
+ message: "Account",
953
+ options: ids.map((id) => ({
954
+ value: id,
955
+ label: id === DEFAULT_ACCOUNT_ID ? "default (primary)" : id
956
+ })),
957
+ initialValue: ids[0] ?? DEFAULT_ACCOUNT_ID
958
+ }));
959
+ })();
960
+ if (!await prompter.confirm({
961
+ message: `Disable ${channelLabel(selectedChannel)} account "${accountId}"? (keeps config)`,
962
+ initialValue: true
963
+ })) {
964
+ await prompter.outro("Cancelled.");
965
+ return;
966
+ }
967
+ } else {
968
+ if (!channel) {
969
+ runtime.error("Channel is required. Use --channel <name>.");
970
+ runtime.exit(1);
971
+ return;
972
+ }
973
+ if (!deleteConfig) {
974
+ if (!await createClackPrompter().confirm({
975
+ message: `Disable ${channelLabel(channel)} account "${accountId}"? (keeps config)`,
976
+ initialValue: true
977
+ })) return;
978
+ }
979
+ }
980
+ const plugin = getChannelPlugin(channel);
981
+ if (!plugin) {
982
+ runtime.error(`Unknown channel: ${channel}`);
983
+ runtime.exit(1);
984
+ return;
985
+ }
986
+ const resolvedAccountId = normalizeAccountId(accountId) ?? resolveChannelDefaultAccountId({
987
+ plugin,
988
+ cfg
989
+ });
990
+ const accountKey = resolvedAccountId || DEFAULT_ACCOUNT_ID;
991
+ let next = { ...cfg };
992
+ if (deleteConfig) {
993
+ if (!plugin.config.deleteAccount) {
994
+ runtime.error(`Channel ${channel} does not support delete.`);
995
+ runtime.exit(1);
996
+ return;
997
+ }
998
+ next = plugin.config.deleteAccount({
999
+ cfg: next,
1000
+ accountId: resolvedAccountId
1001
+ });
1002
+ if (channel === "telegram") await deleteTelegramUpdateOffset({ accountId: resolvedAccountId });
1003
+ } else {
1004
+ if (!plugin.config.setAccountEnabled) {
1005
+ runtime.error(`Channel ${channel} does not support disable.`);
1006
+ runtime.exit(1);
1007
+ return;
1008
+ }
1009
+ next = plugin.config.setAccountEnabled({
1010
+ cfg: next,
1011
+ accountId: resolvedAccountId,
1012
+ enabled: false
1013
+ });
1014
+ }
1015
+ await writeConfigFile(next);
1016
+ if (useWizard && prompter) await prompter.outro(deleteConfig ? `Deleted ${channelLabel(channel)} account "${accountKey}".` : `Disabled ${channelLabel(channel)} account "${accountKey}".`);
1017
+ else runtime.log(deleteConfig ? `Deleted ${channelLabel(channel)} account "${accountKey}".` : `Disabled ${channelLabel(channel)} account "${accountKey}".`);
1018
+ }
1019
+
1020
+ //#endregion
1021
+ //#region src/commands/channels/resolve.ts
1022
+ function resolvePreferredKind(kind) {
1023
+ if (!kind || kind === "auto") return;
1024
+ if (kind === "user") return "user";
1025
+ return "group";
1026
+ }
1027
+ function detectAutoKind(input) {
1028
+ const trimmed = input.trim();
1029
+ if (!trimmed) return "group";
1030
+ if (trimmed.startsWith("@")) return "user";
1031
+ if (/^<@!?/.test(trimmed)) return "user";
1032
+ if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(trimmed)) return "user";
1033
+ if (/^(user|discord|slack|matrix|msteams|teams|zalo|zalouser|googlechat|google-chat|gchat):/i.test(trimmed)) return "user";
1034
+ return "group";
1035
+ }
1036
+ function formatResolveResult(result) {
1037
+ if (!result.resolved || !result.id) return `${result.input} -> unresolved`;
1038
+ const name = result.name ? ` (${result.name})` : "";
1039
+ const note = result.note ? ` [${result.note}]` : "";
1040
+ return `${result.input} -> ${result.id}${name}${note}`;
1041
+ }
1042
+ async function channelsResolveCommand(opts, runtime) {
1043
+ const cfg = loadConfig();
1044
+ const entries = (opts.entries ?? []).map((entry) => entry.trim()).filter(Boolean);
1045
+ if (entries.length === 0) throw new Error("At least one entry is required.");
1046
+ const selection = await resolveMessageChannelSelection({
1047
+ cfg,
1048
+ channel: opts.channel ?? null
1049
+ });
1050
+ const plugin = getChannelPlugin(selection.channel);
1051
+ if (!plugin?.resolver?.resolveTargets) throw new Error(`Channel ${selection.channel} does not support resolve.`);
1052
+ const preferredKind = resolvePreferredKind(opts.kind);
1053
+ let results = [];
1054
+ if (preferredKind) results = (await plugin.resolver.resolveTargets({
1055
+ cfg,
1056
+ accountId: opts.account ?? null,
1057
+ inputs: entries,
1058
+ kind: preferredKind,
1059
+ runtime
1060
+ })).map((entry) => ({
1061
+ input: entry.input,
1062
+ resolved: entry.resolved,
1063
+ id: entry.id,
1064
+ name: entry.name,
1065
+ note: entry.note
1066
+ }));
1067
+ else {
1068
+ const byKind = /* @__PURE__ */ new Map();
1069
+ for (const entry of entries) {
1070
+ const kind = detectAutoKind(entry);
1071
+ byKind.set(kind, [...byKind.get(kind) ?? [], entry]);
1072
+ }
1073
+ const resolved = [];
1074
+ for (const [kind, inputs] of byKind.entries()) {
1075
+ const batch = await plugin.resolver.resolveTargets({
1076
+ cfg,
1077
+ accountId: opts.account ?? null,
1078
+ inputs,
1079
+ kind,
1080
+ runtime
1081
+ });
1082
+ resolved.push(...batch);
1083
+ }
1084
+ const byInput = new Map(resolved.map((entry) => [entry.input, entry]));
1085
+ results = entries.map((input) => {
1086
+ const entry = byInput.get(input);
1087
+ return {
1088
+ input,
1089
+ resolved: entry?.resolved ?? false,
1090
+ id: entry?.id,
1091
+ name: entry?.name,
1092
+ note: entry?.note
1093
+ };
1094
+ });
1095
+ }
1096
+ if (opts.json) {
1097
+ runtime.log(JSON.stringify(results, null, 2));
1098
+ return;
1099
+ }
1100
+ for (const result of results) if (result.resolved && result.id) runtime.log(formatResolveResult(result));
1101
+ else runtime.error(danger(`${result.input} -> unresolved${result.error ? ` (${result.error})` : result.note ? ` (${result.note})` : ""}`));
1102
+ }
1103
+
1104
+ //#endregion
1105
+ //#region src/commands/channels/status.ts
1106
+ function appendEnabledConfiguredLinkedBits(bits, account) {
1107
+ if (typeof account.enabled === "boolean") bits.push(account.enabled ? "enabled" : "disabled");
1108
+ if (typeof account.configured === "boolean") bits.push(account.configured ? "configured" : "not configured");
1109
+ if (typeof account.linked === "boolean") bits.push(account.linked ? "linked" : "not linked");
1110
+ }
1111
+ function appendModeBit(bits, account) {
1112
+ if (typeof account.mode === "string" && account.mode.length > 0) bits.push(`mode:${account.mode}`);
1113
+ }
1114
+ function appendTokenSourceBits(bits, account) {
1115
+ if (typeof account.tokenSource === "string" && account.tokenSource) bits.push(`token:${account.tokenSource}`);
1116
+ if (typeof account.botTokenSource === "string" && account.botTokenSource) bits.push(`bot:${account.botTokenSource}`);
1117
+ if (typeof account.appTokenSource === "string" && account.appTokenSource) bits.push(`app:${account.appTokenSource}`);
1118
+ }
1119
+ function appendBaseUrlBit(bits, account) {
1120
+ if (typeof account.baseUrl === "string" && account.baseUrl) bits.push(`url:${account.baseUrl}`);
1121
+ }
1122
+ function buildChannelAccountLine(provider, account, bits) {
1123
+ return `- ${formatChannelAccountLabel({
1124
+ channel: provider,
1125
+ accountId: typeof account.accountId === "string" ? account.accountId : "default",
1126
+ name: (typeof account.name === "string" ? account.name.trim() : "") || void 0
1127
+ })}: ${bits.join(", ")}`;
1128
+ }
1129
+ function formatGatewayChannelsStatusLines(payload) {
1130
+ const lines = [];
1131
+ lines.push(theme.success("Gateway reachable."));
1132
+ const accountLines = (provider, accounts) => accounts.map((account) => {
1133
+ const bits = [];
1134
+ appendEnabledConfiguredLinkedBits(bits, account);
1135
+ if (typeof account.running === "boolean") bits.push(account.running ? "running" : "stopped");
1136
+ if (typeof account.connected === "boolean") bits.push(account.connected ? "connected" : "disconnected");
1137
+ const inboundAt = typeof account.lastInboundAt === "number" && Number.isFinite(account.lastInboundAt) ? account.lastInboundAt : null;
1138
+ const outboundAt = typeof account.lastOutboundAt === "number" && Number.isFinite(account.lastOutboundAt) ? account.lastOutboundAt : null;
1139
+ if (inboundAt) bits.push(`in:${formatTimeAgo(Date.now() - inboundAt)}`);
1140
+ if (outboundAt) bits.push(`out:${formatTimeAgo(Date.now() - outboundAt)}`);
1141
+ appendModeBit(bits, account);
1142
+ const botUsername = (() => {
1143
+ const bot = account.bot;
1144
+ const probeBot = account.probe?.bot;
1145
+ const raw = bot?.username ?? probeBot?.username ?? "";
1146
+ if (typeof raw !== "string") return "";
1147
+ const trimmed = raw.trim();
1148
+ if (!trimmed) return "";
1149
+ return trimmed.startsWith("@") ? trimmed : `@${trimmed}`;
1150
+ })();
1151
+ if (botUsername) bits.push(`bot:${botUsername}`);
1152
+ if (typeof account.dmPolicy === "string" && account.dmPolicy.length > 0) bits.push(`dm:${account.dmPolicy}`);
1153
+ if (Array.isArray(account.allowFrom) && account.allowFrom.length > 0) bits.push(`allow:${account.allowFrom.slice(0, 2).join(",")}`);
1154
+ appendTokenSourceBits(bits, account);
1155
+ const messageContent = account.application?.intents?.messageContent;
1156
+ if (typeof messageContent === "string" && messageContent.length > 0 && messageContent !== "enabled") bits.push(`intents:content=${messageContent}`);
1157
+ if (account.allowUnmentionedGroups === true) bits.push("groups:unmentioned");
1158
+ appendBaseUrlBit(bits, account);
1159
+ const probe = account.probe;
1160
+ if (probe && typeof probe.ok === "boolean") bits.push(probe.ok ? "works" : "probe failed");
1161
+ const audit = account.audit;
1162
+ if (audit && typeof audit.ok === "boolean") bits.push(audit.ok ? "audit ok" : "audit failed");
1163
+ if (typeof account.lastError === "string" && account.lastError) bits.push(`error:${account.lastError}`);
1164
+ return buildChannelAccountLine(provider, account, bits);
1165
+ });
1166
+ const plugins = listChannelPlugins();
1167
+ const accountsByChannel = payload.channelAccounts;
1168
+ const accountPayloads = {};
1169
+ for (const plugin of plugins) {
1170
+ const raw = accountsByChannel?.[plugin.id];
1171
+ if (Array.isArray(raw)) accountPayloads[plugin.id] = raw;
1172
+ }
1173
+ for (const plugin of plugins) {
1174
+ const accounts = accountPayloads[plugin.id];
1175
+ if (accounts && accounts.length > 0) lines.push(...accountLines(plugin.id, accounts));
1176
+ }
1177
+ lines.push("");
1178
+ const issues = collectChannelStatusIssues(payload);
1179
+ if (issues.length > 0) {
1180
+ lines.push(theme.warn("Warnings:"));
1181
+ for (const issue of issues) lines.push(`- ${issue.channel} ${issue.accountId}: ${issue.message}${issue.fix ? ` (${issue.fix})` : ""}`);
1182
+ lines.push(`- Run: ${formatCliCommand("remoteclaw doctor")}`);
1183
+ lines.push("");
1184
+ }
1185
+ lines.push(`Tip: ${formatDocsLink("/cli#status", "status --deep")} adds gateway health probes to status output (requires a reachable gateway).`);
1186
+ return lines;
1187
+ }
1188
+ async function formatConfigChannelsStatusLines(cfg, meta) {
1189
+ const lines = [];
1190
+ lines.push(theme.warn("Gateway not reachable; showing config-only status."));
1191
+ if (meta.path) lines.push(`Config: ${meta.path}`);
1192
+ if (meta.mode) lines.push(`Mode: ${meta.mode}`);
1193
+ if (meta.path || meta.mode) lines.push("");
1194
+ const accountLines = (provider, accounts) => accounts.map((account) => {
1195
+ const bits = [];
1196
+ appendEnabledConfiguredLinkedBits(bits, account);
1197
+ appendModeBit(bits, account);
1198
+ appendTokenSourceBits(bits, account);
1199
+ appendBaseUrlBit(bits, account);
1200
+ return buildChannelAccountLine(provider, account, bits);
1201
+ });
1202
+ const plugins = listChannelPlugins();
1203
+ for (const plugin of plugins) {
1204
+ const accountIds = plugin.config.listAccountIds(cfg);
1205
+ if (!accountIds.length) continue;
1206
+ const snapshots = [];
1207
+ for (const accountId of accountIds) {
1208
+ const snapshot = await buildChannelAccountSnapshot({
1209
+ plugin,
1210
+ cfg,
1211
+ accountId
1212
+ });
1213
+ snapshots.push(snapshot);
1214
+ }
1215
+ if (snapshots.length > 0) lines.push(...accountLines(plugin.id, snapshots));
1216
+ }
1217
+ lines.push("");
1218
+ lines.push(`Tip: ${formatDocsLink("/cli#status", "status --deep")} adds gateway health probes to status output (requires a reachable gateway).`);
1219
+ return lines;
1220
+ }
1221
+ async function channelsStatusCommand(opts, runtime = defaultRuntime) {
1222
+ const timeoutMs = Number(opts.timeout ?? 1e4);
1223
+ const statusLabel = opts.probe ? "Checking channel status (probe)…" : "Checking channel status…";
1224
+ if (opts.json !== true && !process.stderr.isTTY) runtime.log(statusLabel);
1225
+ try {
1226
+ const payload = await withProgress({
1227
+ label: statusLabel,
1228
+ indeterminate: true,
1229
+ enabled: opts.json !== true
1230
+ }, async () => await callGateway({
1231
+ method: "channels.status",
1232
+ params: {
1233
+ probe: Boolean(opts.probe),
1234
+ timeoutMs
1235
+ },
1236
+ timeoutMs
1237
+ }));
1238
+ if (opts.json) {
1239
+ runtime.log(JSON.stringify(payload, null, 2));
1240
+ return;
1241
+ }
1242
+ runtime.log(formatGatewayChannelsStatusLines(payload).join("\n"));
1243
+ } catch (err) {
1244
+ runtime.error(`Gateway not reachable: ${String(err)}`);
1245
+ const cfg = await requireValidConfig(runtime);
1246
+ if (!cfg) return;
1247
+ const snapshot = await readConfigFileSnapshot();
1248
+ const mode = cfg.gateway?.mode === "remote" ? "remote" : "local";
1249
+ runtime.log((await formatConfigChannelsStatusLines(cfg, {
1250
+ path: snapshot.path,
1251
+ mode
1252
+ })).join("\n"));
1253
+ }
1254
+ }
1255
+
1256
+ //#endregion
1257
+ //#region src/cli/channel-auth.ts
1258
+ async function resolveChannelPluginForMode(opts, mode, cfg) {
1259
+ const explicitChannel = opts.channel?.trim();
1260
+ const channelInput = explicitChannel ? explicitChannel : (await resolveMessageChannelSelection({ cfg })).channel;
1261
+ const channelId = normalizeChannelId(channelInput);
1262
+ if (!channelId) throw new Error(`Unsupported channel: ${channelInput}`);
1263
+ const plugin = getChannelPlugin(channelId);
1264
+ if (!(mode === "login" ? Boolean(plugin?.auth?.login) : Boolean(plugin?.gateway?.logoutAccount))) throw new Error(`Channel ${channelId} does not support ${mode}`);
1265
+ return {
1266
+ channelInput,
1267
+ channelId,
1268
+ plugin
1269
+ };
1270
+ }
1271
+ function resolveAccountContext(plugin, opts, cfg) {
1272
+ return { accountId: opts.account?.trim() || resolveChannelDefaultAccountId({
1273
+ plugin,
1274
+ cfg
1275
+ }) };
1276
+ }
1277
+ async function runChannelLogin(opts, runtime = defaultRuntime) {
1278
+ const cfg = loadConfig();
1279
+ const { channelInput, plugin } = await resolveChannelPluginForMode(opts, "login", cfg);
1280
+ const login = plugin.auth?.login;
1281
+ if (!login) throw new Error(`Channel ${channelInput} does not support login`);
1282
+ setVerbose(Boolean(opts.verbose));
1283
+ const { accountId } = resolveAccountContext(plugin, opts, cfg);
1284
+ await login({
1285
+ cfg,
1286
+ accountId,
1287
+ runtime,
1288
+ verbose: Boolean(opts.verbose),
1289
+ channelInput
1290
+ });
1291
+ }
1292
+ async function runChannelLogout(opts, runtime = defaultRuntime) {
1293
+ const cfg = loadConfig();
1294
+ const { channelInput, plugin } = await resolveChannelPluginForMode(opts, "logout", cfg);
1295
+ const logoutAccount = plugin.gateway?.logoutAccount;
1296
+ if (!logoutAccount) throw new Error(`Channel ${channelInput} does not support logout`);
1297
+ const { accountId } = resolveAccountContext(plugin, opts, cfg);
1298
+ await logoutAccount({
1299
+ cfg,
1300
+ accountId,
1301
+ account: plugin.config.resolveAccount(cfg, accountId),
1302
+ runtime
1303
+ });
1304
+ }
1305
+
1306
+ //#endregion
1307
+ //#region src/cli/channels-cli.ts
1308
+ const optionNamesAdd = [
1309
+ "channel",
1310
+ "account",
1311
+ "name",
1312
+ "token",
1313
+ "tokenFile",
1314
+ "botToken",
1315
+ "appToken",
1316
+ "signalNumber",
1317
+ "cliPath",
1318
+ "dbPath",
1319
+ "service",
1320
+ "region",
1321
+ "authDir",
1322
+ "httpUrl",
1323
+ "httpHost",
1324
+ "httpPort",
1325
+ "webhookPath",
1326
+ "webhookUrl",
1327
+ "audienceType",
1328
+ "audience",
1329
+ "useEnv",
1330
+ "homeserver",
1331
+ "userId",
1332
+ "accessToken",
1333
+ "password",
1334
+ "deviceName",
1335
+ "initialSyncLimit",
1336
+ "ship",
1337
+ "url",
1338
+ "code",
1339
+ "groupChannels",
1340
+ "dmAllowlist",
1341
+ "autoDiscoverChannels"
1342
+ ];
1343
+ const optionNamesRemove = [
1344
+ "channel",
1345
+ "account",
1346
+ "delete"
1347
+ ];
1348
+ function runChannelsCommand(action) {
1349
+ return runCommandWithRuntime(defaultRuntime, action);
1350
+ }
1351
+ function runChannelsCommandWithDanger(action, label) {
1352
+ return runCommandWithRuntime(defaultRuntime, action, (err) => {
1353
+ defaultRuntime.error(danger(`${label}: ${String(err)}`));
1354
+ defaultRuntime.exit(1);
1355
+ });
1356
+ }
1357
+ function registerChannelsCli(program) {
1358
+ const channelNames = formatCliChannelOptions();
1359
+ const channels = program.command("channels").description("Manage connected chat channels and accounts").addHelpText("after", () => `\n${theme.heading("Examples:")}\n${formatHelpExamples([
1360
+ ["remoteclaw channels list", "List configured channels and auth profiles."],
1361
+ ["remoteclaw channels status --probe", "Run channel status checks and probes."],
1362
+ ["remoteclaw channels add --channel telegram --token <token>", "Add or update a channel account non-interactively."],
1363
+ ["remoteclaw channels login --channel whatsapp", "Link a WhatsApp Web account."]
1364
+ ])}\n\n${theme.muted("Docs:")} ${formatDocsLink("/cli/channels", "docs.remoteclaw.org/cli/channels")}\n`);
1365
+ channels.command("list").description("List configured channels + auth profiles").option("--no-usage", "Skip model provider usage/quota snapshots").option("--json", "Output JSON", false).action(async (opts) => {
1366
+ await runChannelsCommand(async () => {
1367
+ await channelsListCommand(opts, defaultRuntime);
1368
+ });
1369
+ });
1370
+ channels.command("status").description("Show gateway channel status (use status --deep for local)").option("--probe", "Probe channel credentials", false).option("--timeout <ms>", "Timeout in ms", "10000").option("--json", "Output JSON", false).action(async (opts) => {
1371
+ await runChannelsCommand(async () => {
1372
+ await channelsStatusCommand(opts, defaultRuntime);
1373
+ });
1374
+ });
1375
+ channels.command("capabilities").description("Show provider capabilities (intents/scopes + supported features)").option("--channel <name>", `Channel (${formatCliChannelOptions(["all"])})`).option("--account <id>", "Account id (only with --channel)").option("--target <dest>", "Channel target for permission audit (Discord channel:<id>)").option("--timeout <ms>", "Timeout in ms", "10000").option("--json", "Output JSON", false).action(async (opts) => {
1376
+ await runChannelsCommand(async () => {
1377
+ await channelsCapabilitiesCommand(opts, defaultRuntime);
1378
+ });
1379
+ });
1380
+ channels.command("resolve").description("Resolve channel/user names to IDs").argument("<entries...>", "Entries to resolve (names or ids)").option("--channel <name>", `Channel (${channelNames})`).option("--account <id>", "Account id (accountId)").option("--kind <kind>", "Target kind (auto|user|group)", "auto").option("--json", "Output JSON", false).action(async (entries, opts) => {
1381
+ await runChannelsCommand(async () => {
1382
+ await channelsResolveCommand({
1383
+ channel: opts.channel,
1384
+ account: opts.account,
1385
+ kind: opts.kind,
1386
+ json: Boolean(opts.json),
1387
+ entries: Array.isArray(entries) ? entries : [String(entries)]
1388
+ }, defaultRuntime);
1389
+ });
1390
+ });
1391
+ channels.command("logs").description("Show recent channel logs from the gateway log file").option("--channel <name>", `Channel (${formatCliChannelOptions(["all"])})`, "all").option("--lines <n>", "Number of lines (default: 200)", "200").option("--json", "Output JSON", false).action(async (opts) => {
1392
+ await runChannelsCommand(async () => {
1393
+ await channelsLogsCommand(opts, defaultRuntime);
1394
+ });
1395
+ });
1396
+ channels.command("add").description("Add or update a channel account").option("--channel <name>", `Channel (${channelNames})`).option("--account <id>", "Account id (default when omitted)").option("--name <name>", "Display name for this account").option("--token <token>", "Bot token (Telegram/Discord)").option("--token-file <path>", "Bot token file (Telegram)").option("--bot-token <token>", "Slack bot token (xoxb-...)").option("--app-token <token>", "Slack app token (xapp-...)").option("--signal-number <e164>", "Signal account number (E.164)").option("--cli-path <path>", "CLI path (signal-cli or imsg)").option("--db-path <path>", "iMessage database path").option("--service <service>", "iMessage service (imessage|sms|auto)").option("--region <region>", "iMessage region (for SMS)").option("--auth-dir <path>", "WhatsApp auth directory override").option("--http-url <url>", "Signal HTTP daemon base URL").option("--http-host <host>", "Signal HTTP host").option("--http-port <port>", "Signal HTTP port").option("--webhook-path <path>", "Webhook path (Google Chat/BlueBubbles)").option("--webhook-url <url>", "Google Chat webhook URL").option("--audience-type <type>", "Google Chat audience type (app-url|project-number)").option("--audience <value>", "Google Chat audience value (app URL or project number)").option("--homeserver <url>", "Matrix homeserver URL").option("--user-id <id>", "Matrix user ID").option("--access-token <token>", "Matrix access token").option("--password <password>", "Matrix password").option("--device-name <name>", "Matrix device name").option("--initial-sync-limit <n>", "Matrix initial sync limit").option("--ship <ship>", "Tlon ship name (~sampel-palnet)").option("--url <url>", "Tlon ship URL").option("--code <code>", "Tlon login code").option("--group-channels <list>", "Tlon group channels (comma-separated)").option("--dm-allowlist <list>", "Tlon DM allowlist (comma-separated ships)").option("--auto-discover-channels", "Tlon auto-discover group channels").option("--no-auto-discover-channels", "Disable Tlon auto-discovery").option("--use-env", "Use env token (default account only)", false).action(async (opts, command) => {
1397
+ await runChannelsCommand(async () => {
1398
+ await channelsAddCommand(opts, defaultRuntime, { hasFlags: hasExplicitOptions(command, optionNamesAdd) });
1399
+ });
1400
+ });
1401
+ channels.command("remove").description("Disable or delete a channel account").option("--channel <name>", `Channel (${channelNames})`).option("--account <id>", "Account id (default when omitted)").option("--delete", "Delete config entries (no prompt)", false).action(async (opts, command) => {
1402
+ await runChannelsCommand(async () => {
1403
+ await channelsRemoveCommand(opts, defaultRuntime, { hasFlags: hasExplicitOptions(command, optionNamesRemove) });
1404
+ });
1405
+ });
1406
+ channels.command("login").description("Link a channel account (if supported)").option("--channel <channel>", "Channel alias (auto when only one is configured)").option("--account <id>", "Account id (accountId)").option("--verbose", "Verbose connection logs", false).action(async (opts) => {
1407
+ await runChannelsCommandWithDanger(async () => {
1408
+ await runChannelLogin({
1409
+ channel: opts.channel,
1410
+ account: opts.account,
1411
+ verbose: Boolean(opts.verbose)
1412
+ }, defaultRuntime);
1413
+ }, "Channel login failed");
1414
+ });
1415
+ channels.command("logout").description("Log out of a channel session (if supported)").option("--channel <channel>", "Channel alias (auto when only one is configured)").option("--account <id>", "Account id (accountId)").action(async (opts) => {
1416
+ await runChannelsCommandWithDanger(async () => {
1417
+ await runChannelLogout({
1418
+ channel: opts.channel,
1419
+ account: opts.account
1420
+ }, defaultRuntime);
1421
+ }, "Channel logout failed");
1422
+ });
1423
+ }
1424
+
1425
+ //#endregion
1426
+ export { registerChannelsCli };