@pixelzx/genesis 2026.5.5-1 → 2026.5.5-3

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 (2448) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/.buildstamp +1 -1
  3. package/dist/abort-Yw60gQ-C.js +201 -0
  4. package/dist/abort-cutoff.runtime-DCJWSVCk.js +20 -0
  5. package/dist/abort-cutoff.runtime.js +1 -1
  6. package/dist/abort.runtime-DYQuut_O.js +2 -0
  7. package/dist/abort.runtime.js +1 -1
  8. package/dist/accounts-BSCHGPHp.js +107 -0
  9. package/dist/accounts-Bb0FqxV2.js +104 -0
  10. package/dist/accounts-BjGgx8lz.js +2 -0
  11. package/dist/accounts-CJJT0vS7.js +43 -0
  12. package/dist/accounts-CM2Ko2xl.js +365 -0
  13. package/dist/accounts-Co4cbVCU.js +66 -0
  14. package/dist/accounts.runtime-V3yFS1uD.js +2 -0
  15. package/dist/accounts.runtime.js +1 -1
  16. package/dist/acp-cli-emMnOaiO.js +2193 -0
  17. package/dist/acp-spawn-BmyUZuJX.js +1093 -0
  18. package/dist/acp-spawn-DPF5zmnN.js +2 -0
  19. package/dist/acp-stateful-target-driver-CJ4JyIHf.js +89 -0
  20. package/dist/action-agents-D1tXt8Kj.js +67 -0
  21. package/dist/action-focus-Bk6AJsNH.js +132 -0
  22. package/dist/action-help-4nFSAuVo.js +7 -0
  23. package/dist/action-info-D-byoefn.js +101 -0
  24. package/dist/action-kill-Bo-NwBVR.js +33 -0
  25. package/dist/action-list-lAa4rlzN.js +21 -0
  26. package/dist/action-log-BasoUC3L.js +30 -0
  27. package/dist/action-send-DwLkiz4x.js +39 -0
  28. package/dist/action-spawn-C70_iR8d.js +47 -0
  29. package/dist/action-unfocus-dUVMx5Fh.js +29 -0
  30. package/dist/actions.runtime-BdSo6rN8.js +18 -0
  31. package/dist/actions.runtime-BvY67XKu.js +5 -0
  32. package/dist/actions.runtime.js +1 -1
  33. package/dist/agent-DDBv3Vgl.js +2 -0
  34. package/dist/agent-command-DC7I_88W.js +874 -0
  35. package/dist/agent-harness-runtime-TA6YH7Ud.js +144 -0
  36. package/dist/agent-runner-utils-CMe-JIDq.js +239 -0
  37. package/dist/agent-runner.runtime-le6AmJRw.js +3455 -0
  38. package/dist/agent-runner.runtime.js +1 -1
  39. package/dist/agent-runtime-CONy4fDD.js +18 -0
  40. package/dist/agents/auth-profiles.runtime.js +1 -1
  41. package/dist/agents/model-catalog.runtime.js +1 -1
  42. package/dist/agents/models-config.runtime.js +1 -1
  43. package/dist/agents/pi-model-discovery-runtime.js +1 -1
  44. package/dist/agents-BlbOM4XW.js +953 -0
  45. package/dist/agents-Byj8CDAP.js +5 -0
  46. package/dist/agents.command-shared-ZsmaTJk8.js +40 -0
  47. package/dist/aliases-C3Ks5x38.js +2 -0
  48. package/dist/aliases-CxBcx9gF.js +96 -0
  49. package/dist/api-2tC9XD4P.js +4 -0
  50. package/dist/api-BHhDAMrX.js +2 -0
  51. package/dist/api-CGlGNVyu2.js +2 -0
  52. package/dist/api-CK3xj--e.js +48 -0
  53. package/dist/api-CLoj7nYH.js +3 -0
  54. package/dist/api-CQ1kMo4j.js +3 -0
  55. package/dist/api-DEwetAD22.js +2 -0
  56. package/dist/api-DZiRkVPk.js +5 -0
  57. package/dist/api-_Y4nIHNo.js +139 -0
  58. package/dist/apply-CKkto_0W.js +508 -0
  59. package/dist/apply.runtime-Bby76mns.js +166 -0
  60. package/dist/apply.runtime-xFS-XMxA.js +2 -0
  61. package/dist/apply.runtime.js +1 -1
  62. package/dist/approval-client-helpers-Dn1zaJjB.js +82 -0
  63. package/dist/approval-gateway-resolver-Ba_2kb3B.js +29 -0
  64. package/dist/approval-gateway-runtime-7VMivk0A.js +2 -0
  65. package/dist/approval-handler-runtime-Bh0onoHD.js +439 -0
  66. package/dist/approval-native-helpers-SV1NXo3R.js +33 -0
  67. package/dist/approval-native-runtime-IYFyT8Hf.js +729 -0
  68. package/dist/approval-renderers-BFN4GCN1.js +64 -0
  69. package/dist/attempt-execution.runtime-CpL2tsYd.js +509 -0
  70. package/dist/attempt-execution.runtime.js +1 -1
  71. package/dist/attempt-execution.shared-BVGg4jtm.js +22 -0
  72. package/dist/attempt.prompt-helpers-Gx9nGKbW.js +221 -0
  73. package/dist/attempt.tool-run-context-BmuljBMs.js +933 -0
  74. package/dist/audit-CsjqOEVE.js +939 -0
  75. package/dist/audit-extra.async-CxQj_A5s.js +971 -0
  76. package/dist/audit-membership-runtime-Fh49slzK.js +550 -0
  77. package/dist/audit.deep.runtime-COBioB9E.js +2 -0
  78. package/dist/audit.deep.runtime.js +1 -1
  79. package/dist/audit.nondeep.runtime-Bk_5xOjT.js +880 -0
  80. package/dist/audit.nondeep.runtime.js +1 -1
  81. package/dist/audit.runtime-BybEaYH4.js +7 -0
  82. package/dist/audit.runtime.js +1 -1
  83. package/dist/auth-BFbLz2gx.js +383 -0
  84. package/dist/auth-C7wPgZbo.js +56 -0
  85. package/dist/auth-DLWZd54x.js +177 -0
  86. package/dist/auth-DdoNShRm.js +2 -0
  87. package/dist/auth-choice-DZdnIn4M.js +3 -0
  88. package/dist/auth-choice-DtSIi1lM.js +354 -0
  89. package/dist/auth-choice-dBaHPiBQ.js +88 -0
  90. package/dist/auth-choice-options-C0mgcUc9.js +97 -0
  91. package/dist/auth-choice-prompt-Crln8JIf.js +2 -0
  92. package/dist/auth-choice-prompt-DhSxj7wM.js +37 -0
  93. package/dist/auth-choice.apply.api-providers-DBPXmiaM.js +2 -0
  94. package/dist/auth-choice.apply.api-providers-TO_ZIWX7.js +34 -0
  95. package/dist/auth-choice.plugin-providers.runtime-CRMLXING.js +11 -0
  96. package/dist/auth-choice.plugin-providers.runtime.js +1 -1
  97. package/dist/auth-health-DvPWpSkl.js +183 -0
  98. package/dist/auth-install-policy-BpHrj1L-.js +195 -0
  99. package/dist/auth-order-CtO2WQTH.js +2 -0
  100. package/dist/auth-order-zXIiW-Cn.js +96 -0
  101. package/dist/auth-profiles-qkJp8etH.js +679 -0
  102. package/dist/backup-create-DgVJHnfc.js +395 -0
  103. package/dist/banner-0afXR3gC.js +2 -0
  104. package/dist/banner-D-k2EM3C.js +336 -0
  105. package/dist/base-url-N7e93gGu.js +15 -0
  106. package/dist/bash-tools-CnDYSbnX.js +2824 -0
  107. package/dist/bash-tools-DiOcKaak.js +3 -0
  108. package/dist/binding-routing-E9Gh_NqO.js +85 -0
  109. package/dist/binding-targets-C5PbBaZ6.js +121 -0
  110. package/dist/bluebubbles-C4fAEm2A.js +77 -0
  111. package/dist/brave-web-search-provider-DkkbSBBP.js +111 -0
  112. package/dist/brave-web-search-provider.runtime-AjyyvF6E.js +229 -0
  113. package/dist/brave-web-search-provider.runtime.js +1 -1
  114. package/dist/brave-web-search-provider.shared-Bk59J40Z.js +174 -0
  115. package/dist/bridge-auth-registry-j9Nf_eKW.js +23 -0
  116. package/dist/bridge-server-DragdaQD.js +113 -0
  117. package/dist/browser-config-runtime-DYHwPrae.js +7 -0
  118. package/dist/browser-control-auth-D_M31xJ1.js +2 -0
  119. package/dist/browser-node-runtime-Bgu82luB.js +12 -0
  120. package/dist/browser-profiles-C3ffkgOt.js +2 -0
  121. package/dist/browser-runtime-D84IBo4A.js +387 -0
  122. package/dist/browser-setup-tools-VC7rGCyn.js +13 -0
  123. package/dist/build-DeGDX_pJ.js +550 -0
  124. package/dist/build-info.json +3 -3
  125. package/dist/bundled/boot-md/handler.js +5 -5
  126. package/dist/bundled/session-memory/handler.js +1 -1
  127. package/dist/call-CbvF41H8.js +3 -0
  128. package/dist/call-DuDGOVT1.js +331 -0
  129. package/dist/call-status-DMAmF1AO.js +33 -0
  130. package/dist/call.runtime-DztWXjMr.js +2 -0
  131. package/dist/call.runtime.js +1 -1
  132. package/dist/capability-cli-DoJLi3eS.js +1401 -0
  133. package/dist/card-command-VrZ5VEMb.js +241 -0
  134. package/dist/catalog-provider-iymLG3Kz.js +40 -0
  135. package/dist/catchup-Dk-5hIwm.js +300 -0
  136. package/dist/channel-BJ9iEC4Y.js +595 -0
  137. package/dist/channel-BdvsbgZE.js +453 -0
  138. package/dist/channel-Bu-7KaIx.js +1802 -0
  139. package/dist/channel-C9vQNMK1.js +350 -0
  140. package/dist/channel-CZoVAZyW.js +491 -0
  141. package/dist/channel-Cr2KTwyo.js +840 -0
  142. package/dist/channel-DCeC6AEQ.js +297 -0
  143. package/dist/channel-DOGp2TfT.js +1320 -0
  144. package/dist/channel-Dfq1lxxI.js +226 -0
  145. package/dist/channel-add-wizard-CTUaSVvE.js +125 -0
  146. package/dist/channel-add-wizard-DeODDpiD.js +2 -0
  147. package/dist/channel-core-DiltAzdr.js +5 -0
  148. package/dist/channel-hZDaTBpm.js +1100 -0
  149. package/dist/channel-inbound-DvOS-Z1s.js +31 -0
  150. package/dist/channel-plugin-runtime-PFRHQ61T.js +771 -0
  151. package/dist/channel-runtime-BAjxIEfQ.js +425 -0
  152. package/dist/channel-summary-BMmi0p_s.js +2 -0
  153. package/dist/channel-summary-BvSCERUz.js +129 -0
  154. package/dist/channel-szBwbQZB.js +1174 -0
  155. package/dist/channel.runtime-B1Ry35gt.js +89 -0
  156. package/dist/channel.runtime-BNp6GxaQ.js +34702 -0
  157. package/dist/channel.runtime-BfjvNvbj.js +2364 -0
  158. package/dist/channel.runtime-BlGn4QYV.js +4 -0
  159. package/dist/channel.runtime-BozvCkMo.js +26 -0
  160. package/dist/channel.runtime-D7bv5rJl.js +576 -0
  161. package/dist/channel.runtime-DQ5gSgeW.js +109 -0
  162. package/dist/channel.runtime-IxClQMdT.js +430 -0
  163. package/dist/channel.runtime-xIH29E7O.js +67 -0
  164. package/dist/channel.runtime.js +1 -1
  165. package/dist/channel.setup-BsfyGPgV.js +10 -0
  166. package/dist/channels-Dn2VHRmZ.js +733 -0
  167. package/dist/channels-cli-l4xjPvDv.js +268 -0
  168. package/dist/chat-zUeX8mQw.js +2758 -0
  169. package/dist/chrome-CgLTMlX5.js +1181 -0
  170. package/dist/chrome-mcp-0zQTzU3A.js +2 -0
  171. package/dist/chrome-mcp-BjiLGZmi.js +600 -0
  172. package/dist/chrome.executables-CoZsfQLC.js +541 -0
  173. package/dist/clawbot-cli-C3BFdHJB.js +9 -0
  174. package/dist/clawhub-Dz5KDje-.js +400 -0
  175. package/dist/clawhub-LPw6cLUe.js +300 -0
  176. package/dist/cli/daemon-cli.js +4 -4
  177. package/dist/cli-BTnpFsj1.js +2 -0
  178. package/dist/cli-CAFQ6Cwy.js +72 -0
  179. package/dist/cli-CUAjdQ7v.js +683 -0
  180. package/dist/cli-CiqIbwtg.js +219 -0
  181. package/dist/cli-Cp2qY3Xp.js +154 -0
  182. package/dist/cli-D8SnjKKR.js +3726 -0
  183. package/dist/cli-DL1ppK38.js +2 -0
  184. package/dist/cli-Dyu4jU8j.js +2 -0
  185. package/dist/cli-runner-DO6lEPJr.js +286 -0
  186. package/dist/cli-runner.runtime-B-Ic4DyC.js +3 -0
  187. package/dist/cli-runner.runtime-C4cAORcg.js +4 -0
  188. package/dist/cli-runner.runtime.js +1 -1
  189. package/dist/cli-startup-metadata.json +2 -2
  190. package/dist/cli.runtime-CYHctHVS.js +1261 -0
  191. package/dist/cli.runtime.js +1 -1
  192. package/dist/client-Bb_miREU.js +138 -0
  193. package/dist/client-CrPccv7a.js +713 -0
  194. package/dist/codex-native-web-search-Bu1J52-W.js +113 -0
  195. package/dist/codex-native-web-search-Deyt8mj0.js +3 -0
  196. package/dist/combined-store-gateway-DT2C-8GW.js +163 -0
  197. package/dist/command-auth-B7P-1IeA.js +76 -0
  198. package/dist/command-config-resolution-BB-SsCob.js +23 -0
  199. package/dist/command-config-resolution-DMKYb0Kh.js +2 -0
  200. package/dist/command-config-resolution.runtime-Coeaa9lz.js +2 -0
  201. package/dist/command-config-resolution.runtime.js +1 -1
  202. package/dist/command-execution-startup-BlHlyCgU.js +305 -0
  203. package/dist/command-registry-B2JzWHqy.js +9 -0
  204. package/dist/command-registry-CNUpJUp8.js +4 -0
  205. package/dist/command-registry-core-BLap9aka.js +101 -0
  206. package/dist/command-secret-gateway-ChRXthnT.js +528 -0
  207. package/dist/command-status.runtime-D8VWyC3v.js +87 -0
  208. package/dist/command-status.runtime.js +1 -1
  209. package/dist/commands-acp-QLk1cU5f.js +77 -0
  210. package/dist/commands-compact.runtime-BIHG2RSY.js +10 -0
  211. package/dist/commands-compact.runtime.js +1 -1
  212. package/dist/commands-core.runtime-2OrgNeAA.js +2 -0
  213. package/dist/commands-core.runtime.js +1 -1
  214. package/dist/commands-handlers.runtime-DjimbxSJ.js +4597 -0
  215. package/dist/commands-handlers.runtime.js +1 -1
  216. package/dist/commands-models-BAneNjrI.js +327 -0
  217. package/dist/commands-reset-hooks-BkEMNl84.js +133 -0
  218. package/dist/commands-status-DiIQSYSt.js +16 -0
  219. package/dist/commands-status.runtime-DBRxICN6.js +3 -0
  220. package/dist/commands-status.runtime.js +1 -1
  221. package/dist/commands-subagents-control.runtime-BmqXiKHu.js +3 -0
  222. package/dist/commands-subagents-control.runtime-CVQSOd8H.js +2 -0
  223. package/dist/commands-subagents-control.runtime.js +1 -1
  224. package/dist/commands-system-prompt-2qwZc3xL.js +158 -0
  225. package/dist/commands-system-prompt-Clnn_Gct.js +2 -0
  226. package/dist/commands.runtime-DAqpiDPr.js +166 -0
  227. package/dist/commands.runtime.js +1 -1
  228. package/dist/compact-DqOkQZYr.js +1118 -0
  229. package/dist/compact.runtime-CC_l29j4.js +12 -0
  230. package/dist/compact.runtime.js +1 -1
  231. package/dist/completion-cli-DZFJPSiF.js +328 -0
  232. package/dist/config-3He3LWHw.js +5 -0
  233. package/dist/config-D9XEe0Cd.js +251 -0
  234. package/dist/config-DDoTcXdn.js +9 -0
  235. package/dist/config-api-q218x1pm.js +2 -0
  236. package/dist/config-cli-DVDwIjKr.js +1078 -0
  237. package/dist/config-compat-2ov7ryzQ.js +126 -0
  238. package/dist/config-compat-k8n8hPxr.js +130 -0
  239. package/dist/config-guard-8hQGGUl4.js +96 -0
  240. package/dist/config-runtime-CiIsBMuo.js +32 -0
  241. package/dist/config-validation-BeKCV2p-.js +30 -0
  242. package/dist/configure-39oQUHuK.js +1245 -0
  243. package/dist/configure-BGD8tViZ.js +2 -0
  244. package/dist/connect-options-Fpky6zuL.js +699 -0
  245. package/dist/context-D3NokKLx.js +2 -0
  246. package/dist/context-rtkuRtGt.js +278 -0
  247. package/dist/control-auth-BlqH4IVx.js +125 -0
  248. package/dist/control-service-CaqDohiY.js +156 -0
  249. package/dist/control-ui-CIhsZ2Nb.js +688 -0
  250. package/dist/conversation-id-BH9GFVB2.js +235 -0
  251. package/dist/conversation-id-UdIegcf4.js +38 -0
  252. package/dist/conversation-label-generator-CNvvC18B.js +56 -0
  253. package/dist/conversation-runtime-Bao0kIPf.js +31 -0
  254. package/dist/core-DXUh5Xbm.js +275 -0
  255. package/dist/create-5kvABMhw.js +80 -0
  256. package/dist/cron-cli-B1mxHnGP.js +713 -0
  257. package/dist/daemon-cli-CaHBNwMy.js +12 -0
  258. package/dist/daemon-install-BBwOxf1q.js +64 -0
  259. package/dist/daemon-install-auth-profiles-store.runtime-DWg8FeUH.js +2 -0
  260. package/dist/daemon-install-auth-profiles-store.runtime.js +1 -1
  261. package/dist/daemon-install-plan.shared-WG_DYWei.js +287 -0
  262. package/dist/ddg-client-BnD8tAM2.js +147 -0
  263. package/dist/ddg-search-provider-CNeCrvl0.js +54 -0
  264. package/dist/delegate-7G7R4C-C.js +64 -0
  265. package/dist/deliver-CEuqmKKH.js +747 -0
  266. package/dist/deliver-Cndvxi9P.js +3 -0
  267. package/dist/deliver-runtime-BvDWmZrW.js +2 -0
  268. package/dist/delivery-outbound.runtime-BQeyIAOJ.js +6 -0
  269. package/dist/delivery-outbound.runtime.js +1 -1
  270. package/dist/delivery.runtime-Ci0ToUzj.js +253 -0
  271. package/dist/delivery.runtime.js +1 -1
  272. package/dist/deps-CFCIpuzV.js +2 -0
  273. package/dist/deps-D3gqpOra.js +73 -0
  274. package/dist/detached-task-runtime-BMdSrcuz.js +73 -0
  275. package/dist/devices-cli-DnEQH3R2.js +496 -0
  276. package/dist/diagnostic-CC9CPVio.js +400 -0
  277. package/dist/diagnostic-support-export-CufM12zj.js +533 -0
  278. package/dist/diagnostics-C8VwSDtU.js +154 -0
  279. package/dist/direct-dm-BSEkIiOe.js +64 -0
  280. package/dist/directive-handling.fast-lane-C6uvW96M.js +66 -0
  281. package/dist/directive-handling.impl-BTuNitCK.js +2 -0
  282. package/dist/directive-handling.impl-DIeSI-ux.js +703 -0
  283. package/dist/directive-handling.model-selection-Cq8JhQdI.js +114 -0
  284. package/dist/directive-handling.persist.runtime-DrUu8zaW.js +215 -0
  285. package/dist/directive-handling.persist.runtime.js +1 -1
  286. package/dist/directory-cli-DNMdDpqd.js +240 -0
  287. package/dist/dispatch-1gv6It-6.js +1131 -0
  288. package/dist/dispatch-acp-hbhR9aHr.js +981 -0
  289. package/dist/dispatch-acp-manager.runtime-BXQbK1cO.js +3 -0
  290. package/dist/dispatch-acp-manager.runtime.js +1 -1
  291. package/dist/dispatch-acp-media.runtime-DqSdScnW.js +4 -0
  292. package/dist/dispatch-acp-media.runtime.js +1 -1
  293. package/dist/dispatch-acp-session.runtime-B-AG2-VC.js +2 -0
  294. package/dist/dispatch-acp-session.runtime.js +1 -1
  295. package/dist/dispatch-acp.runtime-Dhx090J2.js +19 -0
  296. package/dist/dispatch-acp.runtime.js +1 -1
  297. package/dist/dns-cli-z20808Yz.js +192 -0
  298. package/dist/doctor-auth-CqdmPgiK.js +172 -0
  299. package/dist/doctor-auth-legacy-oauth-C2ojfRvc.js +2 -0
  300. package/dist/doctor-auth-legacy-oauth-CcveIbUh.js +48 -0
  301. package/dist/doctor-claude-cli-B6pnkFEn.js +147 -0
  302. package/dist/doctor-config-analysis-B_xkK9eg.js +94 -0
  303. package/dist/doctor-config-flow-D9W_glLc.js +417 -0
  304. package/dist/doctor-config-preflight-BAZTh5MZ.js +2 -0
  305. package/dist/doctor-config-preflight-Bui2U29x.js +63 -0
  306. package/dist/doctor-contract-DgJ867-C.js +26 -0
  307. package/dist/doctor-device-pairing-1gf3tk3g.js +307 -0
  308. package/dist/doctor-gateway-daemon-flow-LEnN6pL-.js +250 -0
  309. package/dist/doctor-gateway-health-DwxLkTV4.js +60 -0
  310. package/dist/doctor-gateway-services-BhqUOY_e.js +316 -0
  311. package/dist/doctor-health-CdJkaUYf.js +59 -0
  312. package/dist/doctor-health-contributions-BaTnIzCT.js +486 -0
  313. package/dist/doctor-memory-search-C25cUVoI.js +371 -0
  314. package/dist/doctor-prompter-BZTb5rOn.js +56 -0
  315. package/dist/doctor-sandbox-CNi6l2wR.js +194 -0
  316. package/dist/doctor-session-locks-CYaHscyv.js +52 -0
  317. package/dist/doctor-state-integrity-jbbt8OVU.js +609 -0
  318. package/dist/doctor-state-migrations-DgYUKVNF.js +2 -0
  319. package/dist/doctor-update-r4fBiE_r.js +58 -0
  320. package/dist/doctor-workspace-status-DnBARoPa.js +75 -0
  321. package/dist/dreaming-BAGFdUxh.js +1574 -0
  322. package/dist/dreaming-narrative-XoOfVb0x.js +595 -0
  323. package/dist/dreaming-shared-B7vlQ1yu.js +21 -0
  324. package/dist/embedded-gateway-stub.runtime-xwZ-M7Ei.js +9 -0
  325. package/dist/embedded-gateway-stub.runtime.js +1 -1
  326. package/dist/embedding-batch-BU4JjG1y.js +161 -0
  327. package/dist/embedding-batch-DOZ1gHYu.js +191 -0
  328. package/dist/embedding-provider-BI2BRW8e.js +64 -0
  329. package/dist/embedding-provider-Bb3l6tny.js +33 -0
  330. package/dist/embedding-provider-Cjyi9qRs.js +118 -0
  331. package/dist/embedding-provider-D-IE5LZN.js +38 -0
  332. package/dist/embeddings-eOJvLToU.js +215 -0
  333. package/dist/embeddings-http-BDz5OXZk.js +205 -0
  334. package/dist/engine-embeddings-CxNSH_in.js +458 -0
  335. package/dist/engine-qmd-BSGZVwOC.js +551 -0
  336. package/dist/entry.js +2 -2
  337. package/dist/exa-web-search-provider-DMHM6_vZ.js +80 -0
  338. package/dist/exa-web-search-provider.runtime-5amTdDMt.js +2 -0
  339. package/dist/exa-web-search-provider.runtime-DOeJpDGm.js +302 -0
  340. package/dist/exa-web-search-provider.runtime.js +1 -1
  341. package/dist/exec-approval-forwarder.runtime-ToZ9QUrR.js +3 -0
  342. package/dist/exec-approval-forwarder.runtime.js +1 -1
  343. package/dist/exec-approval-reply-CErKkY_w.js +2 -0
  344. package/dist/exec-approval-reply-CwnSisXg.js +296 -0
  345. package/dist/exec-approval-session-target-BcyDQz_G.js +176 -0
  346. package/dist/exec-approvals-cli-CWVWSMk-.js +498 -0
  347. package/dist/exec-policy-cli-F3L_mLPh.js +298 -0
  348. package/dist/extensionAPI.js +4 -4
  349. package/dist/extensions/active-memory/index.js +3 -3
  350. package/dist/extensions/alibaba/index.js +1 -1
  351. package/dist/extensions/alibaba/video-generation-provider.js +1 -1
  352. package/dist/extensions/arcee/index.js +2 -2
  353. package/dist/extensions/bluebubbles/api.js +3 -3
  354. package/dist/extensions/bluebubbles/channel-plugin-api.js +1 -1
  355. package/dist/extensions/brave/index.js +1 -1
  356. package/dist/extensions/brave/test-api.js +1 -1
  357. package/dist/extensions/brave/web-search-provider.js +1 -1
  358. package/dist/extensions/browser/browser-bridge.js +1 -1
  359. package/dist/extensions/browser/browser-config.js +4 -4
  360. package/dist/extensions/browser/browser-control-auth.js +2 -2
  361. package/dist/extensions/browser/browser-doctor.js +5 -5
  362. package/dist/extensions/browser/browser-host-inspection.js +1 -1
  363. package/dist/extensions/browser/browser-maintenance.js +2 -2
  364. package/dist/extensions/browser/browser-profiles.js +2 -2
  365. package/dist/extensions/browser/browser-runtime-api.js +14 -14
  366. package/dist/extensions/browser/index.js +1 -1
  367. package/dist/extensions/browser/plugin-registration.js +1 -1
  368. package/dist/extensions/browser/register.runtime.js +3 -3
  369. package/dist/extensions/browser/runtime-api.js +15 -15
  370. package/dist/extensions/browser/setup-api.js +2 -2
  371. package/dist/extensions/browser/test-support.js +1 -1
  372. package/dist/extensions/byteplus/index.js +3 -3
  373. package/dist/extensions/byteplus/video-generation-provider.js +1 -1
  374. package/dist/extensions/chutes/api.js +3 -3
  375. package/dist/extensions/chutes/index.js +7 -7
  376. package/dist/extensions/chutes/models.js +1 -1
  377. package/dist/extensions/chutes/onboard.js +2 -2
  378. package/dist/extensions/chutes/provider-catalog.js +1 -1
  379. package/dist/extensions/cloudflare-ai-gateway/api.js +1 -1
  380. package/dist/extensions/cloudflare-ai-gateway/catalog-provider.js +1 -1
  381. package/dist/extensions/cloudflare-ai-gateway/index.js +7 -7
  382. package/dist/extensions/comfy/image-generation-provider.js +2 -2
  383. package/dist/extensions/comfy/index.js +5 -5
  384. package/dist/extensions/comfy/music-generation-provider.js +1 -1
  385. package/dist/extensions/comfy/test-helpers.js +1 -1
  386. package/dist/extensions/comfy/video-generation-provider.js +2 -2
  387. package/dist/extensions/comfy/workflow-runtime.js +1 -1
  388. package/dist/extensions/deepgram/index.js +1 -1
  389. package/dist/extensions/deepgram/realtime-transcription-provider.js +1 -1
  390. package/dist/extensions/deepgram/test-api.js +1 -1
  391. package/dist/extensions/deepseek/index.js +1 -1
  392. package/dist/extensions/device-pair/api.js +2 -2
  393. package/dist/extensions/device-pair/index.js +5 -5
  394. package/dist/extensions/device-pair/notify.js +1 -1
  395. package/dist/extensions/device-pair/pair-command-approve.js +1 -1
  396. package/dist/extensions/device-pair/qr-image.js +2 -2
  397. package/dist/extensions/duckduckgo/index.js +1 -1
  398. package/dist/extensions/duckduckgo/web-search-provider.js +1 -1
  399. package/dist/extensions/elevenlabs/config-compat.js +1 -1
  400. package/dist/extensions/elevenlabs/contract-api.js +2 -2
  401. package/dist/extensions/elevenlabs/doctor-contract.js +2 -2
  402. package/dist/extensions/elevenlabs/index.js +2 -2
  403. package/dist/extensions/elevenlabs/realtime-transcription-provider.js +1 -1
  404. package/dist/extensions/elevenlabs/setup-api.js +1 -1
  405. package/dist/extensions/elevenlabs/speech-provider.js +1 -1
  406. package/dist/extensions/elevenlabs/test-api.js +2 -2
  407. package/dist/extensions/exa/index.js +1 -1
  408. package/dist/extensions/exa/test-api.js +1 -1
  409. package/dist/extensions/exa/web-search-provider.js +1 -1
  410. package/dist/extensions/fal/image-generation-provider.js +1 -1
  411. package/dist/extensions/fal/index.js +3 -3
  412. package/dist/extensions/fal/provider-registration.js +1 -1
  413. package/dist/extensions/fal/test-api.js +2 -2
  414. package/dist/extensions/fal/video-generation-provider.js +1 -1
  415. package/dist/extensions/firecrawl/api.js +1 -1
  416. package/dist/extensions/fireworks/index.js +1 -1
  417. package/dist/extensions/github-copilot/api.js +1 -1
  418. package/dist/extensions/github-copilot/auth.js +1 -1
  419. package/dist/extensions/github-copilot/embeddings.js +1 -1
  420. package/dist/extensions/github-copilot/index.js +8 -8
  421. package/dist/extensions/github-copilot/login.js +1 -1
  422. package/dist/extensions/github-copilot/models-defaults.js +1 -1
  423. package/dist/extensions/github-copilot/models.js +1 -1
  424. package/dist/extensions/github-copilot/register.runtime.js +3 -3
  425. package/dist/extensions/github-copilot/replay-policy.js +1 -1
  426. package/dist/extensions/google-meet/index.js +7 -7
  427. package/dist/extensions/groq/index.js +1 -1
  428. package/dist/extensions/groq/media-understanding-provider.js +1 -1
  429. package/dist/extensions/groq/test-api.js +1 -1
  430. package/dist/extensions/huggingface/api.js +3 -3
  431. package/dist/extensions/huggingface/index.js +3 -3
  432. package/dist/extensions/huggingface/models.js +1 -1
  433. package/dist/extensions/huggingface/onboard.js +1 -1
  434. package/dist/extensions/huggingface/provider-catalog.js +2 -2
  435. package/dist/extensions/image-generation-core/api.js +3 -3
  436. package/dist/extensions/image-generation-core/runtime-api.js +2 -2
  437. package/dist/extensions/imessage/api.js +5 -5
  438. package/dist/extensions/imessage/channel-plugin-api.js +1 -1
  439. package/dist/extensions/imessage/contract-api.js +2 -2
  440. package/dist/extensions/imessage/media-contract-api.js +2 -2
  441. package/dist/extensions/imessage/runtime-api.js +5 -5
  442. package/dist/extensions/imessage/test-api.js +2 -2
  443. package/dist/extensions/irc/api.js +2 -2
  444. package/dist/extensions/irc/channel-plugin-api.js +1 -1
  445. package/dist/extensions/kilocode/api.js +2 -2
  446. package/dist/extensions/kilocode/index.js +6 -6
  447. package/dist/extensions/kilocode/onboard.js +2 -2
  448. package/dist/extensions/kilocode/provider-catalog.js +1 -1
  449. package/dist/extensions/kilocode/provider-models.js +1 -1
  450. package/dist/extensions/kilocode/shared.js +1 -1
  451. package/dist/extensions/kimi-coding/index.js +4 -4
  452. package/dist/extensions/kimi-coding/stream.js +1 -1
  453. package/dist/extensions/line/api.js +2 -2
  454. package/dist/extensions/line/channel-plugin-api.js +1 -1
  455. package/dist/extensions/line/contract-api.js +1 -1
  456. package/dist/extensions/line/index.js +1 -1
  457. package/dist/extensions/line/runtime-api.js +7 -7
  458. package/dist/extensions/line/setup-api.js +1 -1
  459. package/dist/extensions/litellm/index.js +1 -1
  460. package/dist/extensions/llm-task/index.js +3 -3
  461. package/dist/extensions/lmstudio/api.js +7 -7
  462. package/dist/extensions/lmstudio/index.js +3 -3
  463. package/dist/extensions/lmstudio/memory-embedding-adapter.js +1 -1
  464. package/dist/extensions/lmstudio/runtime-api.js +1 -1
  465. package/dist/extensions/lobster/index.js +3 -3
  466. package/dist/extensions/lobster/runtime-api.js +1 -1
  467. package/dist/extensions/mattermost/api.js +1 -1
  468. package/dist/extensions/mattermost/channel-plugin-api.js +1 -1
  469. package/dist/extensions/mattermost/channel-plugin-runtime.js +1 -1
  470. package/dist/extensions/mattermost/policy-api.js +1 -1
  471. package/dist/extensions/mattermost/runtime-api.js +8 -8
  472. package/dist/extensions/mattermost/slash-route-api.js +1 -1
  473. package/dist/extensions/media-understanding-core/runtime-api.js +2 -2
  474. package/dist/extensions/memory-core/api.js +1 -1
  475. package/dist/extensions/memory-core/cli-metadata.js +2 -2
  476. package/dist/extensions/memory-core/index.js +12 -12
  477. package/dist/extensions/memory-core/manager-runtime.js +1 -1
  478. package/dist/extensions/memory-core/runtime-api.js +7 -7
  479. package/dist/extensions/memory-lancedb/cli-metadata.js +1 -1
  480. package/dist/extensions/memory-lancedb/index.js +2 -2
  481. package/dist/extensions/memory-wiki/cli-metadata.js +1 -1
  482. package/dist/extensions/memory-wiki/index.js +1 -1
  483. package/dist/extensions/microsoft/index.js +1 -1
  484. package/dist/extensions/microsoft/speech-provider.js +1 -1
  485. package/dist/extensions/microsoft/test-api.js +1 -1
  486. package/dist/extensions/microsoft/tts.js +1 -1
  487. package/dist/extensions/microsoft-foundry/auth.js +1 -1
  488. package/dist/extensions/microsoft-foundry/cli.js +1 -1
  489. package/dist/extensions/microsoft-foundry/index.js +1 -1
  490. package/dist/extensions/microsoft-foundry/onboard.js +2 -2
  491. package/dist/extensions/microsoft-foundry/provider.js +1 -1
  492. package/dist/extensions/microsoft-foundry/runtime.js +1 -1
  493. package/dist/extensions/microsoft-foundry/shared-runtime.js +2 -2
  494. package/dist/extensions/microsoft-foundry/shared.js +1 -1
  495. package/dist/extensions/minimax/image-generation-provider.js +1 -1
  496. package/dist/extensions/minimax/index.js +7 -7
  497. package/dist/extensions/minimax/media-understanding-provider.js +1 -1
  498. package/dist/extensions/minimax/music-generation-provider.js +1 -1
  499. package/dist/extensions/minimax/oauth.js +1 -1
  500. package/dist/extensions/minimax/oauth.runtime.js +1 -1
  501. package/dist/extensions/minimax/provider-registration.js +1 -1
  502. package/dist/extensions/minimax/speech-provider.js +1 -1
  503. package/dist/extensions/minimax/test-api.js +5 -5
  504. package/dist/extensions/minimax/video-generation-provider.js +1 -1
  505. package/dist/extensions/minimax/web-search-provider.js +1 -1
  506. package/dist/extensions/mistral/embedding-provider.js +1 -1
  507. package/dist/extensions/mistral/index.js +5 -5
  508. package/dist/extensions/mistral/media-understanding-provider.js +1 -1
  509. package/dist/extensions/mistral/memory-embedding-adapter.js +1 -1
  510. package/dist/extensions/mistral/provider-compat.js +1 -1
  511. package/dist/extensions/mistral/realtime-transcription-provider.js +1 -1
  512. package/dist/extensions/mistral/test-api.js +2 -2
  513. package/dist/extensions/moonshot/index.js +5 -5
  514. package/dist/extensions/moonshot/media-understanding-provider.js +1 -1
  515. package/dist/extensions/moonshot/test-api.js +2 -2
  516. package/dist/extensions/moonshot/web-search-provider.js +1 -1
  517. package/dist/extensions/msteams/api.js +1 -1
  518. package/dist/extensions/msteams/channel-plugin-api.js +1 -1
  519. package/dist/extensions/msteams/runtime-api.js +4 -4
  520. package/dist/extensions/msteams/test-api.js +1 -1
  521. package/dist/extensions/nextcloud-talk/api.js +1 -1
  522. package/dist/extensions/nextcloud-talk/channel-plugin-api.js +1 -1
  523. package/dist/extensions/nextcloud-talk/runtime-api.js +2 -2
  524. package/dist/extensions/nvidia/index.js +1 -1
  525. package/dist/extensions/ollama/api.js +3 -3
  526. package/dist/extensions/ollama/index.js +10 -10
  527. package/dist/extensions/ollama/runtime-api.js +2 -2
  528. package/dist/extensions/ollama/web-search-provider.js +1 -1
  529. package/dist/extensions/openai/api.js +4 -4
  530. package/dist/extensions/openai/base-url.js +1 -1
  531. package/dist/extensions/openai/embedding-batch.js +1 -1
  532. package/dist/extensions/openai/embedding-provider.js +1 -1
  533. package/dist/extensions/openai/image-generation-provider.js +1 -1
  534. package/dist/extensions/openai/index.js +10 -10
  535. package/dist/extensions/openai/media-understanding-provider.js +1 -1
  536. package/dist/extensions/openai/memory-embedding-adapter.js +1 -1
  537. package/dist/extensions/openai/native-web-search.js +1 -1
  538. package/dist/extensions/openai/openai-codex-auth-identity.js +1 -1
  539. package/dist/extensions/openai/openai-codex-device-code.js +1 -1
  540. package/dist/extensions/openai/openai-codex-provider.js +1 -1
  541. package/dist/extensions/openai/openai-codex-shared.js +1 -1
  542. package/dist/extensions/openai/openai-provider.js +1 -1
  543. package/dist/extensions/openai/realtime-provider-shared.js +1 -1
  544. package/dist/extensions/openai/realtime-transcription-provider.js +1 -1
  545. package/dist/extensions/openai/realtime-voice-provider.js +1 -1
  546. package/dist/extensions/openai/register.runtime.js +7 -7
  547. package/dist/extensions/openai/shared.js +1 -1
  548. package/dist/extensions/openai/speech-provider.js +1 -1
  549. package/dist/extensions/openai/test-api.js +6 -6
  550. package/dist/extensions/openai/transport-policy.js +1 -1
  551. package/dist/extensions/openai/video-generation-provider.js +1 -1
  552. package/dist/extensions/opencode/index.js +3 -3
  553. package/dist/extensions/opencode/media-understanding-provider.js +1 -1
  554. package/dist/extensions/opencode-go/index.js +2 -2
  555. package/dist/extensions/opencode-go/media-understanding-provider.js +1 -1
  556. package/dist/extensions/openrouter/api.js +2 -2
  557. package/dist/extensions/openrouter/image-generation-provider.js +1 -1
  558. package/dist/extensions/openrouter/index.js +8 -8
  559. package/dist/extensions/openrouter/media-understanding-provider.js +1 -1
  560. package/dist/extensions/openrouter/register.runtime.js +7 -7
  561. package/dist/extensions/openrouter/speech-provider.js +1 -1
  562. package/dist/extensions/openrouter/stream.js +1 -1
  563. package/dist/extensions/openrouter/test-api.js +3 -3
  564. package/dist/extensions/openshell/index.js +4 -4
  565. package/dist/extensions/perplexity/index.js +1 -1
  566. package/dist/extensions/perplexity/test-api.js +1 -1
  567. package/dist/extensions/perplexity/web-search-provider.js +1 -1
  568. package/dist/extensions/phone-control/index.js +1 -1
  569. package/dist/extensions/qianfan/index.js +1 -1
  570. package/dist/extensions/qwen/index.js +3 -3
  571. package/dist/extensions/qwen/media-understanding-provider.js +1 -1
  572. package/dist/extensions/qwen/test-api.js +2 -2
  573. package/dist/extensions/qwen/video-generation-provider.js +1 -1
  574. package/dist/extensions/runway/index.js +1 -1
  575. package/dist/extensions/runway/video-generation-provider.js +1 -1
  576. package/dist/extensions/sglang/api.js +2 -2
  577. package/dist/extensions/sglang/index.js +2 -2
  578. package/dist/extensions/sglang/models.js +1 -1
  579. package/dist/extensions/signal/api.js +11 -11
  580. package/dist/extensions/signal/channel-plugin-api.js +1 -1
  581. package/dist/extensions/signal/contract-api.js +2 -2
  582. package/dist/extensions/signal/reaction-runtime-api.js +1 -1
  583. package/dist/extensions/signal/runtime-api.js +13 -13
  584. package/dist/extensions/skill-workshop/api.js +1 -1
  585. package/dist/extensions/skill-workshop/index.js +2 -2
  586. package/dist/extensions/speech-core/api.js +2 -2
  587. package/dist/extensions/speech-core/runtime-api.js +4 -4
  588. package/dist/extensions/stepfun/index.js +3 -3
  589. package/dist/extensions/synology-chat/api.js +1 -1
  590. package/dist/extensions/synology-chat/channel-plugin-api.js +1 -1
  591. package/dist/extensions/synthetic/index.js +1 -1
  592. package/dist/extensions/talk-voice/index.js +3 -3
  593. package/dist/extensions/tavily/index.js +2 -2
  594. package/dist/extensions/tavily/web-search-provider.js +1 -1
  595. package/dist/extensions/tencent/index.js +2 -2
  596. package/dist/extensions/thread-ownership/index.js +2 -2
  597. package/dist/extensions/tlon/api.js +2 -2
  598. package/dist/extensions/tlon/channel-plugin-api.js +1 -1
  599. package/dist/extensions/tlon/runtime-api.js +1 -1
  600. package/dist/extensions/tlon/setup-api.js +2 -2
  601. package/dist/extensions/tlon/test-api.js +1 -1
  602. package/dist/extensions/together/index.js +2 -2
  603. package/dist/extensions/together/video-generation-provider.js +1 -1
  604. package/dist/extensions/twitch/api.js +1 -1
  605. package/dist/extensions/twitch/channel-plugin-api.js +1 -1
  606. package/dist/extensions/twitch/setup-plugin-api.js +1 -1
  607. package/dist/extensions/venice/api.js +3 -3
  608. package/dist/extensions/venice/index.js +5 -5
  609. package/dist/extensions/venice/models.js +1 -1
  610. package/dist/extensions/venice/onboard.js +2 -2
  611. package/dist/extensions/venice/provider-catalog.js +1 -1
  612. package/dist/extensions/vercel-ai-gateway/index.js +1 -1
  613. package/dist/extensions/video-generation-core/api.js +2 -2
  614. package/dist/extensions/video-generation-core/runtime-api.js +2 -2
  615. package/dist/extensions/vllm/api.js +2 -2
  616. package/dist/extensions/vllm/index.js +2 -2
  617. package/dist/extensions/vllm/models.js +1 -1
  618. package/dist/extensions/vllm/register.runtime.js +2 -2
  619. package/dist/extensions/voice-call/index.js +3 -3
  620. package/dist/extensions/voice-call/runtime-entry.js +1 -1
  621. package/dist/extensions/voice-call/setup-api.js +2 -2
  622. package/dist/extensions/volcengine/index.js +2 -2
  623. package/dist/extensions/voyage/embedding-batch.js +1 -1
  624. package/dist/extensions/voyage/embedding-provider.js +1 -1
  625. package/dist/extensions/voyage/index.js +1 -1
  626. package/dist/extensions/voyage/memory-embedding-adapter.js +1 -1
  627. package/dist/extensions/vydra/image-generation-provider.js +1 -1
  628. package/dist/extensions/vydra/index.js +5 -5
  629. package/dist/extensions/vydra/shared.js +1 -1
  630. package/dist/extensions/vydra/speech-provider.js +1 -1
  631. package/dist/extensions/vydra/video-generation-provider.js +1 -1
  632. package/dist/extensions/xai/api.js +6 -6
  633. package/dist/extensions/xai/code-execution.js +3 -3
  634. package/dist/extensions/xai/image-generation-provider.js +1 -1
  635. package/dist/extensions/xai/index.js +13 -13
  636. package/dist/extensions/xai/model-definitions.js +1 -1
  637. package/dist/extensions/xai/onboard.js +1 -1
  638. package/dist/extensions/xai/provider-catalog.js +1 -1
  639. package/dist/extensions/xai/provider-models.js +1 -1
  640. package/dist/extensions/xai/realtime-transcription-provider.js +1 -1
  641. package/dist/extensions/xai/setup-api.js +1 -1
  642. package/dist/extensions/xai/speech-provider.js +1 -1
  643. package/dist/extensions/xai/stt.js +1 -1
  644. package/dist/extensions/xai/test-api.js +1 -1
  645. package/dist/extensions/xai/tts.js +2 -2
  646. package/dist/extensions/xai/video-generation-provider.js +1 -1
  647. package/dist/extensions/xai/web-search.js +1 -1
  648. package/dist/extensions/xai/x-search.js +4 -4
  649. package/dist/extensions/xiaomi/index.js +1 -1
  650. package/dist/extensions/zai/api.js +1 -1
  651. package/dist/extensions/zai/index.js +9 -9
  652. package/dist/extensions/zai/media-understanding-provider.js +1 -1
  653. package/dist/extensions/zai/onboard.js +1 -1
  654. package/dist/extensions/zai/test-api.js +1 -1
  655. package/dist/extensions/zalo/api.js +3 -3
  656. package/dist/extensions/zalo/channel-plugin-api.js +1 -1
  657. package/dist/extensions/zalo/runtime-api.js +2 -2
  658. package/dist/extensions/zalo/setup-api.js +2 -2
  659. package/dist/extensions/zalouser/api.js +4 -4
  660. package/dist/extensions/zalouser/channel-plugin-api.js +1 -1
  661. package/dist/extensions/zalouser/runtime-api.js +9 -9
  662. package/dist/extensions/zalouser/setup-plugin-api.js +1 -1
  663. package/dist/extensions/zalouser/test-api.js +4 -4
  664. package/dist/extra-params-DXOULv19.js +388 -0
  665. package/dist/fallbacks-BKA5XrxA.js +31 -0
  666. package/dist/fallbacks-QvezaDAr.js +2 -0
  667. package/dist/fallbacks-shared-DS-qTOLR.js +111 -0
  668. package/dist/format-DQi1munp.js +245 -0
  669. package/dist/format-Dv6HmuyW.js +176 -0
  670. package/dist/gateway-C0YHaLXO.js +115 -0
  671. package/dist/gateway-cli-DJBCD8J5.js +1325 -0
  672. package/dist/gateway-install-token-CBRkr0l1.js +141 -0
  673. package/dist/gateway-rpc-CmJXd4SU.js +14 -0
  674. package/dist/gateway-rpc.runtime-C9Fs2mSx.js +23 -0
  675. package/dist/gateway-rpc.runtime.js +1 -1
  676. package/dist/gateway-runtime-Bm2_MhFn.js +15 -0
  677. package/dist/gateway-status-DXKMKFtB.js +584 -0
  678. package/dist/genesis-tools-AolFZ-0I.js +8999 -0
  679. package/dist/genesis-tools.runtime-CBWXJqzw.js +2 -0
  680. package/dist/genesis-tools.runtime.js +1 -1
  681. package/dist/get-reply-BpxjHQBp.js +3879 -0
  682. package/dist/get-reply-from-config.runtime-DJKEqLSi.js +2 -0
  683. package/dist/get-reply-from-config.runtime.js +1 -1
  684. package/dist/gmail-setup-utils-CViEwpXs.js +430 -0
  685. package/dist/gmail-watcher-lifecycle-5JNDL-Qn.js +2 -0
  686. package/dist/gmail-watcher-lifecycle-CbLbP5wf.js +191 -0
  687. package/dist/graph-users-D2Q5UTGQ.js +1337 -0
  688. package/dist/guarded-json-api-BGsPLvM1.js +594 -0
  689. package/dist/health-BNKpuAPB.js +469 -0
  690. package/dist/health-BkxZfKx8.js +3 -0
  691. package/dist/heartbeat-runner-Bdu2q6k3.js +5 -0
  692. package/dist/heartbeat-runner-C0B-c-fv.js +1292 -0
  693. package/dist/heartbeat-runner.runtime-Cic23eNy.js +4 -0
  694. package/dist/heartbeat-runner.runtime.js +1 -1
  695. package/dist/help-B-jwXS97.js +81 -0
  696. package/dist/hooks-cli-BfCr2In5.js +433 -0
  697. package/dist/http-endpoint-helpers-CY0P-_y2.js +41 -0
  698. package/dist/http-headers-BQgW7fC2.js +11 -0
  699. package/dist/http-utils-Da8hOLty.js +924 -0
  700. package/dist/identity-PVMitPyT.js +140 -0
  701. package/dist/image-fallbacks-Dgy-LmDo.js +2 -0
  702. package/dist/image-fallbacks-RlfTqOne.js +31 -0
  703. package/dist/image-flYicC8O.js +272 -0
  704. package/dist/image-generation-core-ByCwGM7N.js +18 -0
  705. package/dist/image-generation-core.auth.runtime-BoHVcjuF.js +2 -0
  706. package/dist/image-generation-core.auth.runtime.js +1 -1
  707. package/dist/image-generation-provider-AZDQCts4.js +228 -0
  708. package/dist/image-generation-provider-BWIWrjvD.js +137 -0
  709. package/dist/image-generation-provider-Bq7iOzlf.js +529 -0
  710. package/dist/image-generation-provider-Bv5-fwPX.js +95 -0
  711. package/dist/image-generation-provider-CGSTJ4hP.js +63 -0
  712. package/dist/image-generation-provider-Cllhe0AP.js +274 -0
  713. package/dist/image-generation-provider-Cs4wRp50.js +157 -0
  714. package/dist/image-generation-runtime-xstqpFrd.js +2 -0
  715. package/dist/image-runtime-CaiLu4CB.js +9 -0
  716. package/dist/inbound-reply-dispatch-D4KJHWLG.js +73 -0
  717. package/dist/inbound.runtime-B-GWbA14.js +4 -0
  718. package/dist/inbound.runtime-ZW0e3dff.js +3 -0
  719. package/dist/inbound.runtime.js +1 -1
  720. package/dist/index.js +2 -2
  721. package/dist/infra-runtime-BTJv3KK8.js +39 -0
  722. package/dist/init-q4INH9uv.js +59 -0
  723. package/dist/install-BT4BNeMX.js +190 -0
  724. package/dist/install-signal-cli-BGP-9Zvn.js +202 -0
  725. package/dist/install.runtime-BnqPyIyn.js +2 -0
  726. package/dist/install.runtime.js +1 -1
  727. package/dist/io-C8-NJ1hW.js +5 -0
  728. package/dist/io-DNd8mbjy.js +19290 -0
  729. package/dist/jobs-tgmPyzoA.js +734 -0
  730. package/dist/kimi-web-search-provider-BP8Sm_zW.js +80 -0
  731. package/dist/kimi-web-search-provider.runtime-BiS2hZd_.js +2 -0
  732. package/dist/kimi-web-search-provider.runtime-hPogdlIf.js +261 -0
  733. package/dist/kimi-web-search-provider.runtime.js +1 -1
  734. package/dist/launchd-BM_37PLv.js +698 -0
  735. package/dist/legacy-tools-by-sender-C2fBnMkv.js +2 -0
  736. package/dist/legacy-tools-by-sender-PrWN1Kpn.js +95 -0
  737. package/dist/library-DGd4UZKC.js +45 -0
  738. package/dist/lifecycle-B_RLw4uY.js +229 -0
  739. package/dist/lifecycle-Bw01evSl.js +571 -0
  740. package/dist/lifecycle-core-CTjCo-k0.js +422 -0
  741. package/dist/lifecycle.runtime-BxpD2Ol7.js +2 -0
  742. package/dist/lifecycle.runtime.js +1 -1
  743. package/dist/list-BXa4zUF-.js +2 -0
  744. package/dist/list-BugTSXmQ.js +131 -0
  745. package/dist/list-CgC_rsta.js +1201 -0
  746. package/dist/list-D2sk1YPs.js +2 -0
  747. package/dist/list.probe-C6zfgLdG.js +419 -0
  748. package/dist/list.runtime-Cx-ix6ts.js +11 -0
  749. package/dist/list.runtime-zIkM6USX.js +159 -0
  750. package/dist/list.runtime.js +1 -1
  751. package/dist/live-model-switch-CgHU4tVW.js +336 -0
  752. package/dist/llm-slug-generator-DsWJvqNx.js +79 -0
  753. package/dist/llm-slug-generator.js +1 -1
  754. package/dist/load-config-D6ZKPY7I.js +35 -0
  755. package/dist/load-context-Bzz0kkeb.js +56 -0
  756. package/dist/local-dispatch.runtime-MWMxyZKj.js +8 -0
  757. package/dist/local-dispatch.runtime.js +1 -1
  758. package/dist/logging-CZpl4hS4.js +2 -0
  759. package/dist/logging-ct4GyQVj.js +13 -0
  760. package/dist/login-DyL8eVfP.js +108 -0
  761. package/dist/logs-cli-Dn-8jl3z.js +265 -0
  762. package/dist/logs-cli.runtime-DwsccWUJ.js +2 -0
  763. package/dist/logs-cli.runtime.js +1 -1
  764. package/dist/main-session-restart-recovery-6Uh4W8ZJ.js +206 -0
  765. package/dist/managed-image-attachments-DHawPS1-.js +2 -0
  766. package/dist/managed-image-attachments-DjtxwZ9o.js +635 -0
  767. package/dist/manager-ChyGVMLU.js +3114 -0
  768. package/dist/manager-D0tkR46e.js +2057 -0
  769. package/dist/manager-g_P1RDky.js +2 -0
  770. package/dist/markdown-to-line-7AxR7QFo.js +790 -0
  771. package/dist/mcp/plugin-tools-serve.js +4 -4
  772. package/dist/mcp-cli-Cw2XQMOA.js +725 -0
  773. package/dist/mcp-config-CDKA6_LY.js +115 -0
  774. package/dist/mcp-http-DFKqya8U.js +529 -0
  775. package/dist/media-contract-BLCEEI6I.js +49 -0
  776. package/dist/media-contract-api-CosBQX2V.js +2 -0
  777. package/dist/media-runtime-D2xH8y9Y.js +329 -0
  778. package/dist/media-understanding-B2qGioD4.js +85 -0
  779. package/dist/media-understanding-provider-BKieNTVy.js +13 -0
  780. package/dist/media-understanding-provider-Bp_FPuBe.js +12 -0
  781. package/dist/media-understanding-provider-BpxYGf2K.js +21 -0
  782. package/dist/media-understanding-provider-CGjB0jWY.js +69 -0
  783. package/dist/media-understanding-provider-CSCR1DOo.js +12 -0
  784. package/dist/media-understanding-provider-Cdopdt7A.js +85 -0
  785. package/dist/media-understanding-provider-Cv77beub.js +37 -0
  786. package/dist/media-understanding-provider-Cvr1QElU.js +18 -0
  787. package/dist/media-understanding-provider-DRMnI7Om.js +28 -0
  788. package/dist/media-understanding-provider-DorcYzVO.js +18 -0
  789. package/dist/media-understanding-runtime-CtocCbLl.js +2 -0
  790. package/dist/memory-24Kp99di.js +342 -0
  791. package/dist/memory-core-host-engine-embeddings-j3l9VHMa.js +2 -0
  792. package/dist/memory-core-host-engine-foundation-C5L_o_kv.js +11 -0
  793. package/dist/memory-core-host-engine-qmd-BjRQxINV.js +2 -0
  794. package/dist/memory-core-host-runtime-cli-DaAsOXiU.js +9 -0
  795. package/dist/memory-core-host-runtime-core-CCiyGJ4d.js +8 -0
  796. package/dist/memory-embedding-adapter-DHCNhMQQ.js +32 -0
  797. package/dist/memory-embedding-adapter-DPMNJ50b.js +123 -0
  798. package/dist/memory-embedding-adapter-PANdmah2.js +50 -0
  799. package/dist/memory-embedding-adapter-gyNKuuJg.js +55 -0
  800. package/dist/memory-host-core-BLJfQ7tv.js +2 -0
  801. package/dist/memory-host-search-CXYoKllg.js +12 -0
  802. package/dist/memory-host-search.runtime-BlSP4tRs.js +2 -0
  803. package/dist/memory-host-search.runtime.js +1 -1
  804. package/dist/memory-runtime-BR50X7bD.js +2 -0
  805. package/dist/memory-runtime-CsD3VOEo.js +26 -0
  806. package/dist/message-BDCG7eWj.js +232 -0
  807. package/dist/message-action-runner-6C7kXcC9.js +2 -0
  808. package/dist/message-action-runner-C2P3efhU.js +1407 -0
  809. package/dist/message-actions-BWQWt5gT.js +143 -0
  810. package/dist/message.config.runtime-sOiwk5jH.js +2 -0
  811. package/dist/message.config.runtime.js +1 -1
  812. package/dist/message.gateway.runtime-BXChuYAf.js +2 -0
  813. package/dist/message.gateway.runtime.js +1 -1
  814. package/dist/metadata-registry-loader-BO5ga4BG.js +2 -0
  815. package/dist/metadata-registry-loader-DXWKbRU1.js +16 -0
  816. package/dist/minimax-vlm-M6jWEPQW.js +233 -0
  817. package/dist/minimax-web-search-provider-D2OTaFur.js +53 -0
  818. package/dist/minimax-web-search-provider.runtime-DC6wIpv_.js +2 -0
  819. package/dist/minimax-web-search-provider.runtime-Drj1xU_u.js +140 -0
  820. package/dist/minimax-web-search-provider.runtime.js +1 -1
  821. package/dist/mock-yKTkxAIg.js +136 -0
  822. package/dist/model-Dox-u3UD.js +666 -0
  823. package/dist/model-DqVVHjXR.js +3 -0
  824. package/dist/model-auth-CDl8OFEJ.js +456 -0
  825. package/dist/model-auth-env-BawHgU1x.js +68 -0
  826. package/dist/model-auth-label-BM5SET4I.js +46 -0
  827. package/dist/model-catalog-1XlBrFEV.js +159 -0
  828. package/dist/model-catalog-S5TqfK9t.js +2 -0
  829. package/dist/model-definitions-epX5XXUF.js +260 -0
  830. package/dist/model-fallback-CmX4SjzE.js +827 -0
  831. package/dist/model-fallback-auth.runtime-Dz9zpmf4.js +4 -0
  832. package/dist/model-fallback-auth.runtime.js +1 -1
  833. package/dist/model-picker-B9B-lkWH.js +3 -0
  834. package/dist/model-picker-DbWIvwfd.js +554 -0
  835. package/dist/model-picker-visibility-DTdSdobf.js +13 -0
  836. package/dist/model-picker.runtime-fnHv9FZI.js +15 -0
  837. package/dist/model-picker.runtime.js +1 -1
  838. package/dist/model-selection-DBvbuIS-.js +213 -0
  839. package/dist/model-suppression-DuBnrvXK.js +28 -0
  840. package/dist/model-suppression.runtime-_96p7psP.js +7 -0
  841. package/dist/model-suppression.runtime.js +1 -1
  842. package/dist/models-BStOaoOP.js +18 -0
  843. package/dist/models-BtIpPCk2.js +760 -0
  844. package/dist/models-CAqi2TQ-.js +47 -0
  845. package/dist/models-CVuV0GE0.js +157 -0
  846. package/dist/models-DFRkfhsN.js +569 -0
  847. package/dist/models-auth-status-B8lnM1PS.js +201 -0
  848. package/dist/models-cli-DbUA18AN.js +219 -0
  849. package/dist/models-config-DDM74chF.js +2 -0
  850. package/dist/models-config-DnicdxyQ.js +933 -0
  851. package/dist/models-config.providers.secrets-DIfmfODH.js +304 -0
  852. package/dist/models-http-n4zWGd1p.js +92 -0
  853. package/dist/models-nU-69lrH.js +18 -0
  854. package/dist/models.fetch-BANynh-l.js +518 -0
  855. package/dist/monitor-BEJe2ceJ.js +1237 -0
  856. package/dist/monitor-BO9i6U5R.js +1459 -0
  857. package/dist/monitor-BZLrxL_x.js +1661 -0
  858. package/dist/monitor-CDDxHGlD.js +788 -0
  859. package/dist/monitor-D779kLc0.js +671 -0
  860. package/dist/monitor-V5ZNCrQL.js +2 -0
  861. package/dist/monitor-auth-D2rCHNgr.js +207 -0
  862. package/dist/monitor-oHi8GwXc.js +295 -0
  863. package/dist/monitor-processing-BLbsNFVv.js +1974 -0
  864. package/dist/monitor.runtime-RrusGXVO.js +2 -0
  865. package/dist/monitor.runtime.js +1 -1
  866. package/dist/monitor.webhook-B0DuBNWa.js +180 -0
  867. package/dist/msteams-hh9nwLlZ.js +35 -0
  868. package/dist/music-generation-provider-6ru_5Xe9.js +170 -0
  869. package/dist/music-generation-provider-CfDrN0vg.js +63 -0
  870. package/dist/mutate-atVXfhNp.js +116 -0
  871. package/dist/native-hook-relay-BygYZoeR.js +519 -0
  872. package/dist/native-web-search-C6deWq6V.js +64 -0
  873. package/dist/nextcloud-talk-AadRCqXn.js +17 -0
  874. package/dist/node-cli-FF1zz0JU.js +2506 -0
  875. package/dist/node-service-f8mmgM5L.js +68 -0
  876. package/dist/nodes-cli-tQ5dpecZ.js +1046 -0
  877. package/dist/nodes-utils-BfpGcUca.js +84 -0
  878. package/dist/nodes.helpers-CMXxavTs.js +34 -0
  879. package/dist/notify-DaNP5Zyh.js +315 -0
  880. package/dist/oauth-BKY3WmDu.js +75 -0
  881. package/dist/oauth-BKZJiY9a.js +152 -0
  882. package/dist/oauth-D4AUTZ6P.js +2 -0
  883. package/dist/oauth-N3WLEMX0.js +139 -0
  884. package/dist/oauth.flow-C0eia8-I.js +45 -0
  885. package/dist/oauth.flow-DfN3z9Nf.js +3 -0
  886. package/dist/onboard-B2eZziXs.js +49 -0
  887. package/dist/onboard-B9hx80Dm.js +632 -0
  888. package/dist/onboard-CGOeDj-J.js +58 -0
  889. package/dist/onboard-DTP_mB9k.js +25 -0
  890. package/dist/onboard-DY6XCMjI.js +29 -0
  891. package/dist/onboard-YitR883F.js +25 -0
  892. package/dist/onboard-custom-BQtg1wQW.js +271 -0
  893. package/dist/onboard-custom-Bz-MYvTm.js +3 -0
  894. package/dist/onboard-ffMqs4Bf.js +316 -0
  895. package/dist/onboard-gP5XFNCO.js +25 -0
  896. package/dist/onboard-helpers-BlPrFJHK.js +204 -0
  897. package/dist/onboard-helpers-kL8mgUkl.js +6 -0
  898. package/dist/onboard-remote-ByHuQd1m.js +193 -0
  899. package/dist/onboard-remote-CRPXcrWy.js +2 -0
  900. package/dist/onboard-search-Hz02JQSQ.js +323 -0
  901. package/dist/onboard-skills-ChtyNRCd.js +2 -0
  902. package/dist/onboard-skills-DROlYXya.js +134 -0
  903. package/dist/openai-codex-auth-identity-H1dPXVzb.js +45 -0
  904. package/dist/openai-codex-device-code-DNVug9Q3.js +164 -0
  905. package/dist/openai-codex-provider-HYYOGyC5.js +464 -0
  906. package/dist/openai-codex-shared-C4b7n1WS.js +6 -0
  907. package/dist/openai-http-2An5HAJU.js +500 -0
  908. package/dist/openai-provider-C6QMbZeL.js +313 -0
  909. package/dist/opencode-DGmHIBEa.js +35 -0
  910. package/dist/openresponses-http-DpbJXZP4.js +1128 -0
  911. package/dist/operator-approvals-client-BoN_VmkB.js +68 -0
  912. package/dist/order-DZPHX4Ka.js +109 -0
  913. package/dist/outbound-media-B2QJEeDc.js +57 -0
  914. package/dist/outbound-runtime-DZyO1T_R.js +5 -0
  915. package/dist/outbound.runtime-D_aebUn6.js +2 -0
  916. package/dist/outbound.runtime.js +1 -1
  917. package/dist/pair-command-approve-i-1VECJx.js +44 -0
  918. package/dist/pairing-cli-kZkl_DC7.js +117 -0
  919. package/dist/perplexity-web-search-provider-CzCigaqV.js +92 -0
  920. package/dist/perplexity-web-search-provider.runtime-B86YHY5f.js +324 -0
  921. package/dist/perplexity-web-search-provider.runtime-U6g1JO38.js +2 -0
  922. package/dist/perplexity-web-search-provider.runtime.js +1 -1
  923. package/dist/persistent-bindings.lifecycle-eZyKQ1D8.js +85 -0
  924. package/dist/persistent-bindings.lifecycle-mxY73TJR.js +2 -0
  925. package/dist/pi-bundle-mcp-runtime-BYDTyW-h.js +2 -0
  926. package/dist/pi-bundle-mcp-runtime-DaIHhxDu.js +829 -0
  927. package/dist/pi-bundle-mcp-tools-Biz_skfK.js +108 -0
  928. package/dist/pi-embedded-0fErjTQ7.js +2905 -0
  929. package/dist/pi-embedded-Bc1jC2x0.js +4 -0
  930. package/dist/pi-embedded-subscribe.handlers.compaction.runtime-BRiX-RqX.js +23 -0
  931. package/dist/pi-embedded-subscribe.handlers.compaction.runtime.js +1 -1
  932. package/dist/pi-embedded.runtime-Bn_RZ5z8.js +4 -0
  933. package/dist/pi-embedded.runtime.js +1 -1
  934. package/dist/pi-model-discovery-k8VUE5Tp.js +237 -0
  935. package/dist/pi-tool-definition-adapter-thh7LO1t.js +217 -0
  936. package/dist/pi-tools-BtlLDovQ.js +1057 -0
  937. package/dist/pi-tools.before-tool-call-BJ_X8Dq3.js +2 -0
  938. package/dist/pi-tools.before-tool-call-DdPCGWCs.js +433 -0
  939. package/dist/pi-tools.before-tool-call.runtime-1acRmC9A.js +13 -0
  940. package/dist/pi-tools.before-tool-call.runtime.js +1 -1
  941. package/dist/plivo-D4do6QU0.js +394 -0
  942. package/dist/plugin-CdHHk4Xn.js +12195 -0
  943. package/dist/plugin-enabled-DybhbjKQ.js +140 -0
  944. package/dist/plugin-install-config-policy-ZN1F58XF.js +137 -0
  945. package/dist/plugin-registration-Bgwpsokw.js +23 -0
  946. package/dist/plugin-registry-7OvG7Tu6.js +3 -0
  947. package/dist/plugin-registry-BcYuO-i5.js +2 -0
  948. package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
  949. package/dist/plugin-sdk/acp-binding-runtime.js +1 -1
  950. package/dist/plugin-sdk/acp-runtime.js +3 -3
  951. package/dist/plugin-sdk/agent-harness-runtime.js +9 -9
  952. package/dist/plugin-sdk/agent-harness.js +10 -10
  953. package/dist/plugin-sdk/agent-runtime.js +11 -11
  954. package/dist/plugin-sdk/approval-client-runtime.js +2 -2
  955. package/dist/plugin-sdk/approval-gateway-runtime.js +2 -2
  956. package/dist/plugin-sdk/approval-handler-runtime.js +3 -3
  957. package/dist/plugin-sdk/approval-native-runtime.js +2 -2
  958. package/dist/plugin-sdk/approval-reply-runtime.js +2 -2
  959. package/dist/plugin-sdk/approval-runtime.js +6 -6
  960. package/dist/plugin-sdk/bluebubbles.js +2 -2
  961. package/dist/plugin-sdk/browser-config-runtime.js +2 -2
  962. package/dist/plugin-sdk/browser-node-runtime.js +5 -5
  963. package/dist/plugin-sdk/browser-setup-tools.js +3 -3
  964. package/dist/plugin-sdk/browser-support.js +10 -10
  965. package/dist/plugin-sdk/channel-core.js +2 -2
  966. package/dist/plugin-sdk/channel-inbound.js +3 -3
  967. package/dist/plugin-sdk/command-auth.js +2 -2
  968. package/dist/plugin-sdk/command-status-runtime.js +1 -1
  969. package/dist/plugin-sdk/compat.js +3 -3
  970. package/dist/plugin-sdk/config-runtime.js +7 -7
  971. package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
  972. package/dist/plugin-sdk/conversation-runtime.js +4 -4
  973. package/dist/plugin-sdk/core.js +2 -2
  974. package/dist/plugin-sdk/direct-dm.js +1 -1
  975. package/dist/plugin-sdk/gateway-runtime.js +3 -3
  976. package/dist/plugin-sdk/image-generation-core.js +3 -3
  977. package/dist/plugin-sdk/image-generation-runtime.js +2 -2
  978. package/dist/plugin-sdk/inbound-reply-dispatch.js +1 -1
  979. package/dist/plugin-sdk/index.js +1 -1
  980. package/dist/plugin-sdk/infra-runtime.js +4 -4
  981. package/dist/plugin-sdk/irc.js +2 -2
  982. package/dist/plugin-sdk/matrix.js +1 -1
  983. package/dist/plugin-sdk/mattermost.js +3 -3
  984. package/dist/plugin-sdk/media-generation-runtime-shared.js +1 -1
  985. package/dist/plugin-sdk/media-generation-runtime.js +1 -1
  986. package/dist/plugin-sdk/media-runtime.js +5 -5
  987. package/dist/plugin-sdk/media-understanding-runtime.js +2 -2
  988. package/dist/plugin-sdk/media-understanding.js +2 -2
  989. package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +2 -2
  990. package/dist/plugin-sdk/memory-core-host-engine-foundation.js +2 -2
  991. package/dist/plugin-sdk/memory-core-host-engine-qmd.js +2 -2
  992. package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
  993. package/dist/plugin-sdk/memory-core-host-runtime-core.js +2 -2
  994. package/dist/plugin-sdk/memory-core.js +4 -4
  995. package/dist/plugin-sdk/memory-host-core.js +2 -2
  996. package/dist/plugin-sdk/memory-host-search.js +1 -1
  997. package/dist/plugin-sdk/models-provider-runtime.js +1 -1
  998. package/dist/plugin-sdk/msteams.js +3 -3
  999. package/dist/plugin-sdk/nextcloud-talk.js +2 -2
  1000. package/dist/plugin-sdk/nostr.js +1 -1
  1001. package/dist/plugin-sdk/opencode.js +1 -1
  1002. package/dist/plugin-sdk/outbound-runtime.js +2 -2
  1003. package/dist/plugin-sdk/provider-auth-api-key.js +5 -5
  1004. package/dist/plugin-sdk/provider-auth-runtime.js +2 -2
  1005. package/dist/plugin-sdk/provider-auth.js +8 -8
  1006. package/dist/plugin-sdk/provider-entry.js +1 -1
  1007. package/dist/plugin-sdk/provider-setup.js +2 -2
  1008. package/dist/plugin-sdk/provider-stream-family.js +3 -3
  1009. package/dist/plugin-sdk/provider-stream.js +2 -2
  1010. package/dist/plugin-sdk/reply-dispatch-runtime.js +2 -2
  1011. package/dist/plugin-sdk/reply-runtime.js +5 -5
  1012. package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
  1013. package/dist/plugin-sdk/runtime.js +3 -3
  1014. package/dist/plugin-sdk/sandbox.js +1 -1
  1015. package/dist/plugin-sdk/self-hosted-provider-setup.js +1 -1
  1016. package/dist/plugin-sdk/session-store-runtime.js +2 -2
  1017. package/dist/plugin-sdk/session-transcript-hit.js +2 -2
  1018. package/dist/plugin-sdk/session-visibility.js +1 -1
  1019. package/dist/plugin-sdk/simple-completion-runtime.js +1 -1
  1020. package/dist/plugin-sdk/speech-core.js +1 -1
  1021. package/dist/plugin-sdk/src/infra/semver-compare.d.ts +1 -0
  1022. package/dist/plugin-sdk/testing.js +5 -5
  1023. package/dist/plugin-sdk/text-runtime.js +2 -2
  1024. package/dist/plugin-sdk/tlon.js +1 -1
  1025. package/dist/plugin-sdk/video-generation-core.js +2 -2
  1026. package/dist/plugin-sdk/video-generation-runtime.js +2 -2
  1027. package/dist/plugin-sdk/zalo.js +1 -1
  1028. package/dist/plugin-sdk/zalouser.js +1 -1
  1029. package/dist/plugin-service-ClhrJfT3.js +2890 -0
  1030. package/dist/plugins/provider-discovery.runtime.js +1 -1
  1031. package/dist/plugins/provider-runtime.runtime.js +1 -1
  1032. package/dist/plugins/runtime/index.js +1 -1
  1033. package/dist/plugins-cli-xVUY8V-3.js +584 -0
  1034. package/dist/plugins-command-helpers-oZG-T69i.js +107 -0
  1035. package/dist/plugins-install-persist-Ccyj_thC.js +133 -0
  1036. package/dist/plugins-update-command-D_q-p0ED.js +1057 -0
  1037. package/dist/policy-CoqHgREn.js +328 -0
  1038. package/dist/postinstall-inventory.json +959 -959
  1039. package/dist/prepare.runtime-CawO_32K.js +815 -0
  1040. package/dist/prepare.runtime.js +1 -1
  1041. package/dist/preview-warnings-Cb65Drvj.js +120 -0
  1042. package/dist/probe-B78ZATWo.js +243 -0
  1043. package/dist/probe-BP3QS65i.js +74 -0
  1044. package/dist/probe-BdCXAH_u.js +2 -0
  1045. package/dist/probe-Cv5tXOMP.js +2205 -0
  1046. package/dist/probe-D-D_1oc4.js +241 -0
  1047. package/dist/probe-DO-gll0g.js +2 -0
  1048. package/dist/probe-Dy-moN-J.js +32 -0
  1049. package/dist/probe-T6c0F73q.js +45 -0
  1050. package/dist/probe-dxji7IxZ.js +1443 -0
  1051. package/dist/probe.runtime-CNJWHyTn.js +2 -0
  1052. package/dist/probe.runtime.js +1 -1
  1053. package/dist/profiles-C0gEr4Vt.js +111 -0
  1054. package/dist/program-GMPfHt5E.js +111 -0
  1055. package/dist/prompt-select-styled-BvuJNEJG.js +20 -0
  1056. package/dist/protocol-Batc2DmY.js +2234 -0
  1057. package/dist/provider-C7oJz1U0.js +70 -0
  1058. package/dist/provider-api-key-auth-Dp8hp-Ml.js +114 -0
  1059. package/dist/provider-api-key-auth.runtime-nb7eC5vo.js +14 -0
  1060. package/dist/provider-api-key-auth.runtime.js +1 -1
  1061. package/dist/provider-auth-Df3lSzr_.js +46 -0
  1062. package/dist/provider-auth-api-key-CZA78Uou.js +5 -0
  1063. package/dist/provider-auth-choice-DzrRJAic.js +228 -0
  1064. package/dist/provider-auth-choice-preference-BDTIHERa.js +26 -0
  1065. package/dist/provider-auth-choice.runtime-CVrNfUP0.js +14 -0
  1066. package/dist/provider-auth-choice.runtime-DOC3zhP2.js +2 -0
  1067. package/dist/provider-auth-choice.runtime.js +1 -1
  1068. package/dist/provider-auth-guidance-CVpgabZ6.js +2 -0
  1069. package/dist/provider-auth-guidance-CZ-VI4e5.js +34 -0
  1070. package/dist/provider-auth-helpers-rNcrL2rf.js +173 -0
  1071. package/dist/provider-auth-input-zpegYxxe.js +119 -0
  1072. package/dist/provider-auth-runtime-spGhqq1R.js +149 -0
  1073. package/dist/provider-catalog-B_612t69.js +26 -0
  1074. package/dist/provider-catalog-Bo9KagTv.js +11 -0
  1075. package/dist/provider-catalog-C4IkuJHX.js +12 -0
  1076. package/dist/provider-catalog-CEHPmBtG.js +24 -0
  1077. package/dist/provider-catalog-UJ8mWU0J.js +11 -0
  1078. package/dist/provider-compat-CqDox4I4.js +37 -0
  1079. package/dist/provider-discovery.runtime--0zGwmtf.js +118 -0
  1080. package/dist/provider-discovery.runtime.js +1 -1
  1081. package/dist/provider-dispatcher-CGYoOdKf.js +2 -0
  1082. package/dist/provider-dispatcher-iTEDM88F.js +22 -0
  1083. package/dist/provider-entry-BzH2PNpN.js +106 -0
  1084. package/dist/provider-flow-B_VNl-lk.js +147 -0
  1085. package/dist/provider-model-defaults-PMGtjcr2.js +6 -0
  1086. package/dist/provider-models-DBv9Enx4.js +119 -0
  1087. package/dist/provider-models-Du3smcTu.js +35 -0
  1088. package/dist/provider-registration-B3sbIgIZ.js +218 -0
  1089. package/dist/provider-registration-B9ECEmSg.js +37 -0
  1090. package/dist/provider-runtime-CE8zqYv8.js +472 -0
  1091. package/dist/provider-runtime-CV5mC70X.js +2 -0
  1092. package/dist/provider-runtime.runtime-B4Idxtd0.js +26 -0
  1093. package/dist/provider-runtime.runtime.js +1 -1
  1094. package/dist/provider-self-hosted-setup-Comuw-z3.js +251 -0
  1095. package/dist/provider-setup-DnUcdtJq.js +2 -0
  1096. package/dist/provider-stream-B8nU1r79.js +290 -0
  1097. package/dist/provider-stream-DQRHM0a1.js +2174 -0
  1098. package/dist/provider-stream-family-C4XL1sCH.js +2 -0
  1099. package/dist/provider-usage-CNNFTSFt.js +4 -0
  1100. package/dist/provider-usage-DkdPMGc6.js +71 -0
  1101. package/dist/provider-usage.load-Ckz1tFpH.js +334 -0
  1102. package/dist/provider-utils-BR35tIjk.js +49 -0
  1103. package/dist/provider-wizard-_jfjTfSM.js +166 -0
  1104. package/dist/providers.runtime-DHetxgM5.js +2 -0
  1105. package/dist/providers.runtime-PiYTktu_.js +164 -0
  1106. package/dist/providers.runtime.js +1 -1
  1107. package/dist/proxy-stream-wrappers-CSbzc-1F.js +394 -0
  1108. package/dist/prune-DlDJX10W.js +83 -0
  1109. package/dist/pw-ai-CCPJq-CT.js +2511 -0
  1110. package/dist/pw-role-snapshot-D65unjCD.js +380 -0
  1111. package/dist/qmd-manager-BVXvoOqt.js +1921 -0
  1112. package/dist/qr-cli-6IxenO1C.js +349 -0
  1113. package/dist/qr-cli-D63piSog.js +2 -0
  1114. package/dist/qr-image-BAPDnfbt.js +2 -0
  1115. package/dist/queue-Rq1mceUG.js +409 -0
  1116. package/dist/reaction-runtime-api-DgwRXTz2.js +116 -0
  1117. package/dist/reactions-Dnh7t4Zl.js +998 -0
  1118. package/dist/read-best-effort-config.runtime-CsH29elm.js +2 -0
  1119. package/dist/read-best-effort-config.runtime.js +1 -1
  1120. package/dist/read-capability-7xOdYqOo.js +412 -0
  1121. package/dist/realtime-provider-shared-C2fZT5O_.js +37 -0
  1122. package/dist/realtime-transcription-provider-CCX9jOLy.js +120 -0
  1123. package/dist/realtime-transcription-provider-CqIc1zwy.js +184 -0
  1124. package/dist/realtime-transcription-provider-CyI79CyM.js +183 -0
  1125. package/dist/realtime-transcription-provider-CydzsmVb.js +172 -0
  1126. package/dist/realtime-transcription-provider-D4PaV840.js +184 -0
  1127. package/dist/realtime-voice-provider-DgL6WxN7.js +489 -0
  1128. package/dist/record-shared-DxabpimX.js +10 -0
  1129. package/dist/register-service-commands-D7w01SKL.js +71 -0
  1130. package/dist/register.agent-j1Eno4xr.js +248 -0
  1131. package/dist/register.backup-Bxvo3j_q.js +64 -0
  1132. package/dist/register.configure-ubwxTkGt.js +15 -0
  1133. package/dist/register.maintenance-B7FuM_ZW.js +438 -0
  1134. package/dist/register.message-QR3u9rBl.js +329 -0
  1135. package/dist/register.onboard-Bdcf_lH0.js +81 -0
  1136. package/dist/register.runtime-QDduc4yj.js +81 -0
  1137. package/dist/register.runtime.js +1 -1
  1138. package/dist/register.setup-DzVV6tdQ.js +150 -0
  1139. package/dist/register.status-health-sessions-Brw3VcxG.js +1215 -0
  1140. package/dist/register.subclis-B8qDbqPl.js +29 -0
  1141. package/dist/register.subclis-DdoN3nZi.js +3 -0
  1142. package/dist/register.subclis-core-CWHmnIoe.js +249 -0
  1143. package/dist/register.wallet-aTazgPYX.js +159 -0
  1144. package/dist/repair-sequencing-CjiQXU4z.js +145 -0
  1145. package/dist/replay-policy-XaA2Foet.js +8 -0
  1146. package/dist/reply-dispatch-runtime-BVLvCeJ0.js +13 -0
  1147. package/dist/reply-media-paths.runtime-CmS_Bnnf.js +2 -0
  1148. package/dist/reply-media-paths.runtime-DCj1JhDR.js +146 -0
  1149. package/dist/reply-media-paths.runtime.js +1 -1
  1150. package/dist/reply-payload-transform-DmArXXXO.js +720 -0
  1151. package/dist/reply-runtime-BXkvfLv_.js +11 -0
  1152. package/dist/reply.runtime-BTkpxI5R.js +2 -0
  1153. package/dist/reply.runtime.js +1 -1
  1154. package/dist/resolve-IXqG_vKU.js +259 -0
  1155. package/dist/response-generator-DCxui-Yb.js +175 -0
  1156. package/dist/restart-C-4J0cf2.js +490 -0
  1157. package/dist/restart-health-6cjrRBpF.js +202 -0
  1158. package/dist/restart-health-b6Qw43Tj.js +2 -0
  1159. package/dist/root-help-DDa1oEtT.js +44 -0
  1160. package/dist/route-reply-q5jc2Nv9.js +162 -0
  1161. package/dist/route-reply.runtime-Co8TnDf9.js +2 -0
  1162. package/dist/route-reply.runtime.js +1 -1
  1163. package/dist/routes-CoCMty69.js +2 -0
  1164. package/dist/routes-D9uC_Zdy.js +3341 -0
  1165. package/dist/rpc-DpLGM3FH.js +61 -0
  1166. package/dist/rpc-context-e__2PCau.js +17 -0
  1167. package/dist/rpc.runtime-B27EA5A0.js +21 -0
  1168. package/dist/rpc.runtime.js +1 -1
  1169. package/dist/run-auth-profile.runtime-CMkCqc7k.js +2 -0
  1170. package/dist/run-auth-profile.runtime.js +1 -1
  1171. package/dist/run-context.runtime-DCgb3ETM.js +2 -0
  1172. package/dist/run-context.runtime.js +1 -1
  1173. package/dist/run-delivery.runtime-OmILefLX.js +530 -0
  1174. package/dist/run-delivery.runtime.js +1 -1
  1175. package/dist/run-embedded.runtime-Dc43u_Z7.js +4 -0
  1176. package/dist/run-embedded.runtime.js +1 -1
  1177. package/dist/run-execution-cli.runtime-DL5w7Ac8.js +4 -0
  1178. package/dist/run-execution-cli.runtime.js +1 -1
  1179. package/dist/run-executor.runtime-Bzwt0zP-.js +277 -0
  1180. package/dist/run-executor.runtime.js +1 -1
  1181. package/dist/run-main-BLD1wTLU.js +516 -0
  1182. package/dist/run-model-catalog.runtime-B7wlXnDF.js +2 -0
  1183. package/dist/run-model-catalog.runtime.js +1 -1
  1184. package/dist/run-subagent-registry.runtime-CddCeg6W.js +2 -0
  1185. package/dist/run-subagent-registry.runtime.js +1 -1
  1186. package/dist/run-wait-D4Gxuyru.js +135 -0
  1187. package/dist/runner-BKhQg4av.js +966 -0
  1188. package/dist/runner.entries-Dbp1RZd9.js +604 -0
  1189. package/dist/runs-DUTtPgDm.js +496 -0
  1190. package/dist/runs-DWOm31T_.js +2 -0
  1191. package/dist/runtime-8BuIPrSY.js +973 -0
  1192. package/dist/runtime-B3upjFki.js +475 -0
  1193. package/dist/runtime-B6k9iJRB.js +187 -0
  1194. package/dist/runtime-BuEvshdw.js +94 -0
  1195. package/dist/runtime-Bu_cc482.js +107 -0
  1196. package/dist/runtime-Co8r21pw.js +9 -0
  1197. package/dist/runtime-CsaTxb99.js +187 -0
  1198. package/dist/runtime-DB1WNkhW.js +262 -0
  1199. package/dist/runtime-Db_oJ87Z.js +2 -0
  1200. package/dist/runtime-Dlvh7_uU.js +116 -0
  1201. package/dist/runtime-DvzcF4-r.js +2 -0
  1202. package/dist/runtime-NlpdlX79.js +72 -0
  1203. package/dist/runtime-_-L5ftbu.js +269 -0
  1204. package/dist/runtime-api-BG0XWkir.js +4 -0
  1205. package/dist/runtime-api-BjBzlgns.js +9 -0
  1206. package/dist/runtime-api-DlYbbA-n.js +14 -0
  1207. package/dist/runtime-api-faT33SE2.js +9 -0
  1208. package/dist/runtime-embedded-pi.runtime-QdJ7K4t0.js +2 -0
  1209. package/dist/runtime-embedded-pi.runtime.js +1 -1
  1210. package/dist/runtime-entry-CWugm0Uj.js +2769 -0
  1211. package/dist/runtime-internal-C0xc_Zhf.js +2 -0
  1212. package/dist/runtime-model-auth.runtime-B0HsFXG7.js +2 -0
  1213. package/dist/runtime-model-auth.runtime-CwdDdKqY.js +45 -0
  1214. package/dist/runtime-model-auth.runtime.js +1 -1
  1215. package/dist/runtime-options-DLv7ygkO.js +275 -0
  1216. package/dist/runtime-prepare.runtime-B3oyafQ4.js +80 -0
  1217. package/dist/runtime-prepare.runtime.js +1 -1
  1218. package/dist/runtime-provider-Dcc5OeVJ.js +21 -0
  1219. package/dist/runtime-registry-loader-B5mIkwhZ.js +85 -0
  1220. package/dist/runtime-registry-loader-CGNT5-qz.js +2 -0
  1221. package/dist/runtime-schema-CQK5R5Pl.js +27780 -0
  1222. package/dist/runtime-shared-BC82_Fzc.js +267 -0
  1223. package/dist/runtime-web-channel-plugin-DQoEo6bK.js +203 -0
  1224. package/dist/runtime-web-tools-BizCqA0v.js +1477 -0
  1225. package/dist/runtime-web-tools-fallback.runtime-CYAGzwsD.js +9 -0
  1226. package/dist/runtime-web-tools-fallback.runtime.js +1 -1
  1227. package/dist/sandbox-C95gEa17.js +3 -0
  1228. package/dist/sandbox-DAnx9TYc.js +1156 -0
  1229. package/dist/sandbox-cli-CPs_gL72.js +450 -0
  1230. package/dist/scan-Yz6DoQn5.js +523 -0
  1231. package/dist/scan-k38hL_6o.js +2 -0
  1232. package/dist/secrets-cli-Bjvr0bOw.js +2101 -0
  1233. package/dist/security-cli-C2gkMFcB.js +486 -0
  1234. package/dist/selection-DC8EXnRg.js +7736 -0
  1235. package/dist/selection-DmSFI5k4.js +2 -0
  1236. package/dist/semver-compare-tPC_r5LW.js +64 -0
  1237. package/dist/send-CMqcsAS2.js +534 -0
  1238. package/dist/send-CT6EfHrc.js +102 -0
  1239. package/dist/send-_ANvjE_C.js +156 -0
  1240. package/dist/send.runtime-COIjG4BV.js +2 -0
  1241. package/dist/send.runtime.js +1 -1
  1242. package/dist/server-COkv9Si4.js +13 -0
  1243. package/dist/server-DHLQZJL8.js +77 -0
  1244. package/dist/server-context-6jnr-aAw.js +2 -0
  1245. package/dist/server-context-DK1QsdLh.js +847 -0
  1246. package/dist/server-middleware-BTovsGYd.js +120 -0
  1247. package/dist/server-node-events-q8H0odkq.js +481 -0
  1248. package/dist/server-plugin-bootstrap-Bw4a88yA.js +2 -0
  1249. package/dist/server-plugin-bootstrap-By_w9ngt.js +11333 -0
  1250. package/dist/server-restart-sentinel-CGLYF3mk.js +697 -0
  1251. package/dist/server-startup-memory-ClzqrFwF.js +32 -0
  1252. package/dist/server.impl-8j4SImks.js +12735 -0
  1253. package/dist/service-CNjb_qXC.js +2 -0
  1254. package/dist/service-CyR3mZIU.js +120 -0
  1255. package/dist/service-Dw-BzupJ.js +940 -0
  1256. package/dist/service-audit-DIL0OiMa.js +260 -0
  1257. package/dist/service-audit-pwloDggS.js +2 -0
  1258. package/dist/session-DF38Qk5T.js +48 -0
  1259. package/dist/session-cost-usage-CbaKFiYP.js +651 -0
  1260. package/dist/session-envelope-SoEaHn7u.js +18 -0
  1261. package/dist/session-key-BpQtNboQ.js +65 -0
  1262. package/dist/session-kill-http-Dek5w0Ee.js +110 -0
  1263. package/dist/session-meta-DHOj7FVp.js +109 -0
  1264. package/dist/session-override-Cra7WfkP.js +106 -0
  1265. package/dist/session-reset-model.runtime-CITOeORk.js +133 -0
  1266. package/dist/session-reset-model.runtime.js +1 -1
  1267. package/dist/session-reset-service-B_9Ps0kr.js +471 -0
  1268. package/dist/session-route-Cr6vOd9_.js +93 -0
  1269. package/dist/session-status.runtime-C_x1MHH5.js +2 -0
  1270. package/dist/session-status.runtime.js +1 -1
  1271. package/dist/session-store-DfVF72xW.js +126 -0
  1272. package/dist/session-store.runtime-jJK2KnR6.js +2 -0
  1273. package/dist/session-store.runtime.js +1 -1
  1274. package/dist/session-subagent-reactivation.runtime-BKWuNild.js +2 -0
  1275. package/dist/session-subagent-reactivation.runtime.js +1 -1
  1276. package/dist/session-system-events-BS6g-vqa.js +63 -0
  1277. package/dist/session-tab-registry-C08V5jx6.js +491 -0
  1278. package/dist/session-transcript-hit-Mxv1sZGp.js +41 -0
  1279. package/dist/session-updates-BdB1lGXz.js +236 -0
  1280. package/dist/session-updates.runtime-6GlaYt-B.js +2 -0
  1281. package/dist/session-updates.runtime.js +1 -1
  1282. package/dist/session-utils-BPYVECh0.js +926 -0
  1283. package/dist/session-visibility-D4j8hN_B.js +147 -0
  1284. package/dist/sessions--xDkaJeX.js +48 -0
  1285. package/dist/sessions-D3RqoN9N.js +2 -0
  1286. package/dist/sessions-DrFkAEV2.js +281 -0
  1287. package/dist/sessions-c-R_ynJR.js +16 -0
  1288. package/dist/sessions-helpers-DmUVRk16.js +304 -0
  1289. package/dist/sessions-history-http-DN3KzEnX.js +383 -0
  1290. package/dist/sessions-patch-BPtlF0Lu.js +309 -0
  1291. package/dist/sessions-resolve-D6KPfG_4.js +174 -0
  1292. package/dist/sessions.runtime-DGL1-G20.js +2 -0
  1293. package/dist/sessions.runtime.js +1 -1
  1294. package/dist/set-BraQD5KU.js +17 -0
  1295. package/dist/set-DZUigywb.js +2 -0
  1296. package/dist/set-image-C08k8cVg.js +2 -0
  1297. package/dist/set-image-CsCPBHZC.js +17 -0
  1298. package/dist/setup-CkYiQoP0.js +495 -0
  1299. package/dist/setup-FPfOBbYL.js +421 -0
  1300. package/dist/setup-api-CUGYqGNT.js +29 -0
  1301. package/dist/setup-core-BmplfubJ.js +171 -0
  1302. package/dist/setup-core-C5ddWpfy.js +176 -0
  1303. package/dist/setup-core-CAFnyY_a.js +393 -0
  1304. package/dist/setup-core-dF4To6Jd.js +184 -0
  1305. package/dist/setup-surface-2JmEfowI.js +219 -0
  1306. package/dist/setup-surface-BpSH7F_m.js +351 -0
  1307. package/dist/setup-surface-BzHQx_GD.js +403 -0
  1308. package/dist/setup-surface-DGJUq-2P.js +72 -0
  1309. package/dist/setup-surface-DOH6kc6w.js +286 -0
  1310. package/dist/setup-surface-DiYEprKG.js +3 -0
  1311. package/dist/setup.finalize-Ci2HBkDq.js +539 -0
  1312. package/dist/setup.gateway-config-CyG_Fzaa.js +250 -0
  1313. package/dist/shared-BItUH43s.js +121 -0
  1314. package/dist/shared-CZOgyBro.js +60 -0
  1315. package/dist/shared-D7BxFCKU.js +217 -0
  1316. package/dist/shared-D7diJkX6.js +198 -0
  1317. package/dist/shared-DJU_HCJ1.js +76 -0
  1318. package/dist/shared-DrgQbH3q.js +186 -0
  1319. package/dist/shared-runtime-xz83dsyA.js +7 -0
  1320. package/dist/shared-u-3RmeL1.js +135 -0
  1321. package/dist/short-term-promotion-DCHcaW2F.js +1543 -0
  1322. package/dist/simple-completion-runtime-CfFpRl7j.js +158 -0
  1323. package/dist/simple-completion-transport-C1ooKj9X.js +33 -0
  1324. package/dist/skills-clawhub-DxVmnVrv.js +275 -0
  1325. package/dist/skills-cli-DCr7N_Sq.js +370 -0
  1326. package/dist/slash-state-C4YD-tLz.js +1911 -0
  1327. package/dist/speech-core-CmPRP1zB.js +94 -0
  1328. package/dist/speech-provider-CNOimJB2.js +209 -0
  1329. package/dist/speech-provider-D9i0DEZ1.js +216 -0
  1330. package/dist/speech-provider-DGbn1IrA.js +209 -0
  1331. package/dist/speech-provider-DKyYgpwf.js +103 -0
  1332. package/dist/speech-provider-eDG83bBp.js +184 -0
  1333. package/dist/speech-provider-mKY_GAkS.js +170 -0
  1334. package/dist/speech-provider-zoWs7x7l.js +395 -0
  1335. package/dist/src-8HdytGc7.js +3974 -0
  1336. package/dist/stage-sandbox-media.runtime-CErRBxI5.js +232 -0
  1337. package/dist/stage-sandbox-media.runtime.js +1 -1
  1338. package/dist/startup-auth-8XVCRzQi.js +180 -0
  1339. package/dist/startup-context-CfcCyUU0.js +312 -0
  1340. package/dist/state-migrations-CHc2Y8Pl.js +820 -0
  1341. package/dist/status-B94yciC9.js +397 -0
  1342. package/dist/status-BUkUYtFm.js +190 -0
  1343. package/dist/status-BsHC-0MV.js +2 -0
  1344. package/dist/status-ChOxNWSb.js +62 -0
  1345. package/dist/status-D4jNATg0.js +209 -0
  1346. package/dist/status-DagNCfVv.js +323 -0
  1347. package/dist/status-U8ut-X2Q.js +2 -0
  1348. package/dist/status-all-CIzsXQnV.js +498 -0
  1349. package/dist/status-json-alPkfWTd.js +14 -0
  1350. package/dist/status-json-command-CAkzWzw7.js +84 -0
  1351. package/dist/status-jxNdVQVZ.js +3 -0
  1352. package/dist/status-message-tZJ_0MsI.js +466 -0
  1353. package/dist/status-message.runtime-KeyKW26h.js +6 -0
  1354. package/dist/status-message.runtime.js +1 -1
  1355. package/dist/status-queue.runtime-R5ZlyNdK.js +2 -0
  1356. package/dist/status-queue.runtime.js +1 -1
  1357. package/dist/status-runtime-shared-BSsA48i9.js +257 -0
  1358. package/dist/status-subagents.runtime-hIKg6PXV.js +18 -0
  1359. package/dist/status-subagents.runtime.js +1 -1
  1360. package/dist/status-text-BmLJrLth.js +237 -0
  1361. package/dist/status.command.text-runtime-C4-j2lqa.js +15 -0
  1362. package/dist/status.gateway-connection.runtime-Dr7HJ1wZ.js +2 -0
  1363. package/dist/status.gateway-connection.runtime.js +1 -1
  1364. package/dist/status.gather-DFY0T97g.js +2 -0
  1365. package/dist/status.gather-e6sfNh8I.js +292 -0
  1366. package/dist/status.runtime-CKd1Qzxg.js +2 -0
  1367. package/dist/status.runtime-DBvapXQS.js +2 -0
  1368. package/dist/status.runtime.js +1 -1
  1369. package/dist/status.scan-DSpkE-Q-.js +65 -0
  1370. package/dist/status.scan-overview-Dr72bkbi.js +379 -0
  1371. package/dist/status.scan.deps.runtime-B7f3inzh.js +18 -0
  1372. package/dist/status.scan.deps.runtime.js +1 -1
  1373. package/dist/status.scan.fast-json-C7k_m46S.js +2 -0
  1374. package/dist/status.scan.fast-json-KHh7R3wX.js +132 -0
  1375. package/dist/status.scan.runtime-CtXWwjb8.js +409 -0
  1376. package/dist/status.scan.runtime.js +1 -1
  1377. package/dist/status.summary-C4r9lkCH.js +214 -0
  1378. package/dist/status.summary-D0EJwkmX.js +2 -0
  1379. package/dist/status.update-CxsGc95A.js +79 -0
  1380. package/dist/status.update-Czi5MNWC.js +2 -0
  1381. package/dist/store-BdedeUHG.js +4 -0
  1382. package/dist/store-CUSu4-Qr.js +910 -0
  1383. package/dist/store-load-CUqchamJ.js +370 -0
  1384. package/dist/store-zVJHt5-N.js +1235 -0
  1385. package/dist/store.runtime-DEIs4Pal.js +2 -0
  1386. package/dist/store.runtime.js +1 -1
  1387. package/dist/stream-BLThzHaS.js +134 -0
  1388. package/dist/stream-BbTa3Gk4.js +27 -0
  1389. package/dist/stream-CKjYSBQh.js +664 -0
  1390. package/dist/stt-DM1vajYf.js +66 -0
  1391. package/dist/subagent-announce-Bu5-8O3P.js +351 -0
  1392. package/dist/subagent-announce-delivery-4hk9P48s.js +726 -0
  1393. package/dist/subagent-announce-output-Csyi1-Kz.js +364 -0
  1394. package/dist/subagent-capabilities-1ZqaiPST.js +251 -0
  1395. package/dist/subagent-control-DAeNsV_G.js +506 -0
  1396. package/dist/subagent-control.runtime-BNoZSftx.js +3 -0
  1397. package/dist/subagent-control.runtime.js +1 -1
  1398. package/dist/subagent-followup.runtime-Bch92LIq.js +68 -0
  1399. package/dist/subagent-followup.runtime.js +1 -1
  1400. package/dist/subagent-list-w3yWfW9R.js +172 -0
  1401. package/dist/subagent-orphan-recovery-mNzyr1b-.js +305 -0
  1402. package/dist/subagent-registry-BMjQxBxi.js +3 -0
  1403. package/dist/subagent-registry-D4DFKQCL.js +1753 -0
  1404. package/dist/subagent-registry.runtime.js +1 -1
  1405. package/dist/subagent-spawn-C13uUm47.js +1005 -0
  1406. package/dist/system-cli-BU6GhJxG.js +59 -0
  1407. package/dist/target-id-0_iIeBLg.js +107 -0
  1408. package/dist/targets-eYkepVzz.js +67 -0
  1409. package/dist/task-executor-DzJLcm4D.js +360 -0
  1410. package/dist/task-owner-access-DW9EbhjP.js +74 -0
  1411. package/dist/task-registry-DBJkAtFF.js +2366 -0
  1412. package/dist/task-registry-delivery-runtime-BdkPeGC1.js +2 -0
  1413. package/dist/task-registry-delivery-runtime-Ov88LGnv.js +3 -0
  1414. package/dist/task-registry.maintenance-BU6Z4V_9.js +416 -0
  1415. package/dist/task-registry.maintenance-sEo6eYdx.js +2 -0
  1416. package/dist/tavily-client--ZxuZ8JY.js +193 -0
  1417. package/dist/tavily-client-D3L2LtMF.js +2 -0
  1418. package/dist/tavily-search-provider-gMJgCeVS.js +62 -0
  1419. package/dist/telegram/audit.js +2 -2
  1420. package/dist/telegram/token.js +2 -2
  1421. package/dist/telnyx-UQXrfg_e.js +260 -0
  1422. package/dist/testing-B2jHeQft.js +575 -0
  1423. package/dist/text-report-HYrgZP8-.js +587 -0
  1424. package/dist/text-runtime-B4pK_Jpd.js +290 -0
  1425. package/dist/tool-auth-shared-B9CrADMc.js +90 -0
  1426. package/dist/tool-config-shared-DrS6NohH.js +19 -0
  1427. package/dist/tool-policy-pipeline-CC9_1Ta1.js +109 -0
  1428. package/dist/tool-resolution-BZxaDOKg.js +90 -0
  1429. package/dist/tool-schema-runtime-BCx7p6Ey.js +167 -0
  1430. package/dist/tools-F4mE-OU0.js +113 -0
  1431. package/dist/tools-effective-inventory-BCvCprpD.js +152 -0
  1432. package/dist/tools-invoke-http-Dt1rsx4a.js +206 -0
  1433. package/dist/tools.runtime-DV_PUXuD.js +4 -0
  1434. package/dist/tools.runtime.js +1 -1
  1435. package/dist/transcript-Bu-SsK2V.js +312 -0
  1436. package/dist/transcript-resolve.runtime-CnnOwtyU.js +2 -0
  1437. package/dist/transcript-resolve.runtime.js +1 -1
  1438. package/dist/transcript.runtime-DBVz9-zl.js +2 -0
  1439. package/dist/transcript.runtime.js +1 -1
  1440. package/dist/transport-policy-Byy3HifG.js +75 -0
  1441. package/dist/trash-F4tvjrKS.js +24 -0
  1442. package/dist/tts-BmCzLLJ_.js +183 -0
  1443. package/dist/tts-D4vxwDtE.js +64 -0
  1444. package/dist/tui-cli-DlQ1oejy.js +4575 -0
  1445. package/dist/twilio-CZsjakcE.js +609 -0
  1446. package/dist/update-DSox1dVQ.js +1282 -0
  1447. package/dist/update-check-CaPWrLU-.js +438 -0
  1448. package/dist/update-cli-DHMdwQWA.js +1759 -0
  1449. package/dist/update-runner-eQrUTjUC.js +1892 -0
  1450. package/dist/update-startup-DgWKoqop.js +331 -0
  1451. package/dist/update-startup-XA38a9KV.js +2 -0
  1452. package/dist/upgrade-UR-EI5pO.js +1226 -0
  1453. package/dist/usage-CLnhtd59.js +606 -0
  1454. package/dist/usage-format-CaxDNPPm.js +2 -0
  1455. package/dist/usage-format-CeDc5if9.js +703 -0
  1456. package/dist/video-generation-core-CuFcXCvE.js +6 -0
  1457. package/dist/video-generation-provider-B5_G-r4P.js +64 -0
  1458. package/dist/video-generation-provider-BD7G-8X5.js +118 -0
  1459. package/dist/video-generation-provider-CIIRQd3c.js +254 -0
  1460. package/dist/video-generation-provider-CLCLvtWm.js +264 -0
  1461. package/dist/video-generation-provider-CpPkkFNc.js +187 -0
  1462. package/dist/video-generation-provider-CvmPMAXP.js +271 -0
  1463. package/dist/video-generation-provider-D4l7Q8t7.js +78 -0
  1464. package/dist/video-generation-provider-DNe73dVv.js +221 -0
  1465. package/dist/video-generation-provider-M281XkUx.js +281 -0
  1466. package/dist/video-generation-provider-Y9urhhT4.js +287 -0
  1467. package/dist/video-generation-provider-iA6Vaqc_2.js +77 -0
  1468. package/dist/video-generation-runtime-BfNI4qH8.js +2 -0
  1469. package/dist/video-generation-task-status-qtHrIZLt.js +163 -0
  1470. package/dist/voice-mapping-FtCIKOHQ.js +41 -0
  1471. package/dist/wait-for-idle-before-flush-CYB_61O0.js +5986 -0
  1472. package/dist/web-fetch-providers.runtime-DN6FBm7n.js +34 -0
  1473. package/dist/web-fetch-providers.runtime.js +1 -1
  1474. package/dist/web-provider-runtime-shared-C1Sy3sQI.js +180 -0
  1475. package/dist/web-search-CgZ8TUj8.js +61 -0
  1476. package/dist/web-search-provider-DL2LLOsz.js +163 -0
  1477. package/dist/web-search-provider.runtime-B01EY78s.js +2 -0
  1478. package/dist/web-search-provider.runtime-Bgwk3KBe.js +185 -0
  1479. package/dist/web-search-provider.runtime.js +1 -1
  1480. package/dist/web-search-providers.runtime-BFtJCprz.js +42 -0
  1481. package/dist/web-search-providers.runtime.js +1 -1
  1482. package/dist/webhook-shared-DMbP4pF5.js +12 -0
  1483. package/dist/webhooks-cli-lrEfJsYQ.js +321 -0
  1484. package/dist/wizard-models-BKqMCaCm.js +161 -0
  1485. package/dist/workflow-runtime-hF0PG5ky.js +485 -0
  1486. package/dist/x-search-config-CqjeeiPu.js +36 -0
  1487. package/dist/x-search-shared-DomcrGQ_.js +75 -0
  1488. package/dist/zalo-js-B0dhviG7.js +1157 -0
  1489. package/package.json +1 -1
  1490. package/dist/abort-ca8hDmJr.js +0 -201
  1491. package/dist/abort-cutoff.runtime-vuCUcBP6.js +0 -20
  1492. package/dist/abort.runtime-BrChEuUS.js +0 -2
  1493. package/dist/accounts-B8y7HaWy.js +0 -66
  1494. package/dist/accounts-BM62Jgez.js +0 -43
  1495. package/dist/accounts-C1ECKXaw.js +0 -107
  1496. package/dist/accounts-CNMAC2Vo.js +0 -365
  1497. package/dist/accounts-DH8HU_Fu.js +0 -104
  1498. package/dist/accounts-DWQpG06j.js +0 -2
  1499. package/dist/accounts.runtime-DkGk9q3U.js +0 -2
  1500. package/dist/acp-cli-BLpWVnc7.js +0 -2193
  1501. package/dist/acp-spawn-D1p6b1gk.js +0 -2
  1502. package/dist/acp-spawn-qoyl9NiU.js +0 -1093
  1503. package/dist/acp-stateful-target-driver-NL9txhIM.js +0 -89
  1504. package/dist/action-agents-C729fJ_P.js +0 -67
  1505. package/dist/action-focus-53k9XP4K.js +0 -132
  1506. package/dist/action-help-bIJZBYLz.js +0 -7
  1507. package/dist/action-info-BBzvYFX_.js +0 -101
  1508. package/dist/action-kill-C4fa3E9I.js +0 -33
  1509. package/dist/action-list-BEiIbwP1.js +0 -21
  1510. package/dist/action-log-Cq7RLW2T.js +0 -30
  1511. package/dist/action-send-DyiHgRwh.js +0 -39
  1512. package/dist/action-spawn-CEZfDvXU.js +0 -47
  1513. package/dist/action-unfocus-CpAw3JOi.js +0 -29
  1514. package/dist/actions.runtime-BKEwPyo7.js +0 -18
  1515. package/dist/actions.runtime-Bp0UusIf.js +0 -5
  1516. package/dist/agent-C2hwJefQ.js +0 -2
  1517. package/dist/agent-command-BAAeGRql.js +0 -874
  1518. package/dist/agent-harness-runtime-Czrx53YL.js +0 -144
  1519. package/dist/agent-runner-utils-DzShckNa.js +0 -239
  1520. package/dist/agent-runner.runtime-d_EtNxBK.js +0 -3455
  1521. package/dist/agent-runtime-DNgz7AOP.js +0 -18
  1522. package/dist/agents-DSV7R_Ys.js +0 -953
  1523. package/dist/agents-DZP5tYDr.js +0 -5
  1524. package/dist/agents.command-shared-CX0AI2SJ.js +0 -40
  1525. package/dist/aliases-CZemdpTj.js +0 -2
  1526. package/dist/aliases-KefnmoaT.js +0 -96
  1527. package/dist/api-B87UL3DC.js +0 -2
  1528. package/dist/api-BWN4PIiM.js +0 -4
  1529. package/dist/api-CO05iXNH.js +0 -139
  1530. package/dist/api-CVXzxdCp.js +0 -48
  1531. package/dist/api-CyjlApHT.js +0 -3
  1532. package/dist/api-D3Y0Edm_.js +0 -3
  1533. package/dist/api-DArm1ECd.js +0 -5
  1534. package/dist/api-DgHFv6c12.js +0 -2
  1535. package/dist/api-qoDs2ceF2.js +0 -2
  1536. package/dist/apply-DmW0sOwq.js +0 -508
  1537. package/dist/apply.runtime-DR3dLbbu.js +0 -166
  1538. package/dist/apply.runtime-DiBS7O9R.js +0 -2
  1539. package/dist/approval-client-helpers-CLYckHzb.js +0 -82
  1540. package/dist/approval-gateway-resolver-URpDQMld.js +0 -29
  1541. package/dist/approval-gateway-runtime-B087BMms.js +0 -2
  1542. package/dist/approval-handler-runtime-BgRQnG4g.js +0 -439
  1543. package/dist/approval-native-helpers-XhNhwe4W.js +0 -33
  1544. package/dist/approval-native-runtime-DAsraihr.js +0 -729
  1545. package/dist/approval-renderers-bwrFaldo.js +0 -64
  1546. package/dist/attempt-execution.runtime-D_FGkDQz.js +0 -509
  1547. package/dist/attempt-execution.shared-WN2pMInT.js +0 -22
  1548. package/dist/attempt.prompt-helpers-CDzDUi1C.js +0 -221
  1549. package/dist/attempt.tool-run-context-DitxaTPJ.js +0 -933
  1550. package/dist/audit-extra.async-BCum5o_S.js +0 -971
  1551. package/dist/audit-k5sVbkP5.js +0 -939
  1552. package/dist/audit-membership-runtime-CF94r_hx.js +0 -550
  1553. package/dist/audit.deep.runtime-De20ia-s.js +0 -2
  1554. package/dist/audit.nondeep.runtime-D2m0GAmG.js +0 -880
  1555. package/dist/audit.runtime-BVZs63pn.js +0 -7
  1556. package/dist/auth-B6TDtKdZ.js +0 -177
  1557. package/dist/auth-CfUOZJWq.js +0 -2
  1558. package/dist/auth-DtQv6fQz.js +0 -56
  1559. package/dist/auth-_9zCNYrQ.js +0 -383
  1560. package/dist/auth-choice-B4-IWttU.js +0 -354
  1561. package/dist/auth-choice-CqMHwtjq.js +0 -3
  1562. package/dist/auth-choice-D1VRwrad.js +0 -88
  1563. package/dist/auth-choice-options-CvEDY7-R.js +0 -97
  1564. package/dist/auth-choice-prompt-1EriFNA8.js +0 -2
  1565. package/dist/auth-choice-prompt-XcsSlY4m.js +0 -37
  1566. package/dist/auth-choice.apply.api-providers-DA5zxSX2.js +0 -34
  1567. package/dist/auth-choice.apply.api-providers-DoVm22Ln.js +0 -2
  1568. package/dist/auth-choice.plugin-providers.runtime-R7dET-rk.js +0 -11
  1569. package/dist/auth-health-DGNHS1hv.js +0 -183
  1570. package/dist/auth-install-policy-kR4_sljC.js +0 -195
  1571. package/dist/auth-order-C3zGI0s9.js +0 -96
  1572. package/dist/auth-order-XQ9ZGPd9.js +0 -2
  1573. package/dist/auth-profiles-Bn8y2hqR.js +0 -679
  1574. package/dist/backup-create-ChqA8nu7.js +0 -395
  1575. package/dist/banner-BwacLUaf.js +0 -2
  1576. package/dist/banner-CFADygMU.js +0 -336
  1577. package/dist/base-url-l_nyPQC0.js +0 -15
  1578. package/dist/bash-tools-BBRtIa6j.js +0 -2824
  1579. package/dist/bash-tools-BI0d1TdC.js +0 -3
  1580. package/dist/binding-routing-Cvm5c1IV.js +0 -85
  1581. package/dist/binding-targets-DSs4NXbd.js +0 -121
  1582. package/dist/bluebubbles-5jDMT0b0.js +0 -77
  1583. package/dist/brave-web-search-provider-BuSp_bii.js +0 -111
  1584. package/dist/brave-web-search-provider.runtime-Dts_65-F.js +0 -229
  1585. package/dist/brave-web-search-provider.shared-BSh8nzHC.js +0 -174
  1586. package/dist/bridge-auth-registry-C5sNQKcj.js +0 -23
  1587. package/dist/bridge-server-B6Hfjg1u.js +0 -113
  1588. package/dist/browser-config-runtime-BKzd6AyE.js +0 -7
  1589. package/dist/browser-control-auth-BbzwesFd.js +0 -2
  1590. package/dist/browser-node-runtime-BDVW4WBK.js +0 -12
  1591. package/dist/browser-profiles-BFgCMoPL.js +0 -2
  1592. package/dist/browser-runtime-PsMSIYQ7.js +0 -387
  1593. package/dist/browser-setup-tools-CFB52yQc.js +0 -13
  1594. package/dist/build-TlobwpQW.js +0 -550
  1595. package/dist/call-Bx8lENb2.js +0 -3
  1596. package/dist/call-jYRpeAWm.js +0 -331
  1597. package/dist/call-status-DB7m5q5K.js +0 -33
  1598. package/dist/call.runtime-BRluUZbD.js +0 -2
  1599. package/dist/capability-cli-B3u_GAig.js +0 -1401
  1600. package/dist/card-command-Db-58QX1.js +0 -241
  1601. package/dist/catalog-provider-DLdEsRxZ.js +0 -40
  1602. package/dist/catchup-CtxTwzY8.js +0 -300
  1603. package/dist/channel-BJKHBfnq.js +0 -491
  1604. package/dist/channel-BNNnYzwK.js +0 -1100
  1605. package/dist/channel-BXS-Hd8p.js +0 -226
  1606. package/dist/channel-C4XWpowe.js +0 -1174
  1607. package/dist/channel-CJQdQgPr.js +0 -840
  1608. package/dist/channel-C_zWAu4D.js +0 -595
  1609. package/dist/channel-CtGzrF-K.js +0 -1802
  1610. package/dist/channel-O9DE4IIq.js +0 -350
  1611. package/dist/channel-WHUOtJme.js +0 -297
  1612. package/dist/channel-WoDWDxqx.js +0 -1320
  1613. package/dist/channel-add-wizard-CW2kMHCQ.js +0 -2
  1614. package/dist/channel-add-wizard-MPlDWR78.js +0 -125
  1615. package/dist/channel-core-BJjq9SOq.js +0 -5
  1616. package/dist/channel-inbound-DLs-YfUs.js +0 -31
  1617. package/dist/channel-plugin-runtime-D5jtM0YK.js +0 -771
  1618. package/dist/channel-runtime-4UjeDmDI.js +0 -425
  1619. package/dist/channel-summary-D34JTfKA.js +0 -129
  1620. package/dist/channel-summary-DN_PekkS.js +0 -2
  1621. package/dist/channel-ys2FFqi1.js +0 -453
  1622. package/dist/channel.runtime-B38Ky3R9.js +0 -109
  1623. package/dist/channel.runtime-BMhrGM1i.js +0 -26
  1624. package/dist/channel.runtime-Bl8WYZvF.js +0 -576
  1625. package/dist/channel.runtime-CX2p8xgN.js +0 -67
  1626. package/dist/channel.runtime-CrN1mC1m.js +0 -2364
  1627. package/dist/channel.runtime-D3kAsCsR.js +0 -89
  1628. package/dist/channel.runtime-DG-EUnSC.js +0 -4
  1629. package/dist/channel.runtime-IfV1Md6p.js +0 -430
  1630. package/dist/channel.runtime-w1tHjTOa.js +0 -34702
  1631. package/dist/channel.setup-dXwiMlyi.js +0 -10
  1632. package/dist/channels-DJZu0HEX.js +0 -733
  1633. package/dist/channels-cli-DJMgmakk.js +0 -268
  1634. package/dist/chat-DdKbu8CA.js +0 -2758
  1635. package/dist/chrome-Cs0ME7FH.js +0 -1181
  1636. package/dist/chrome-mcp-DkIFJETj.js +0 -2
  1637. package/dist/chrome-mcp-DxhdLTiR.js +0 -600
  1638. package/dist/chrome.executables-CfWpFyzT.js +0 -541
  1639. package/dist/clawbot-cli-CnHERFYk.js +0 -9
  1640. package/dist/clawhub-BtR3rMxw.js +0 -300
  1641. package/dist/clawhub-oHDXDom4.js +0 -400
  1642. package/dist/cli-Bt8TEQTY.js +0 -3726
  1643. package/dist/cli-C0Ib5uEO.js +0 -683
  1644. package/dist/cli-CN0o_7BK.js +0 -2
  1645. package/dist/cli-CSNAd6Sz.js +0 -72
  1646. package/dist/cli-DMPwqYqc.js +0 -219
  1647. package/dist/cli-DaXzOAcN.js +0 -154
  1648. package/dist/cli-O9WMyUsH.js +0 -2
  1649. package/dist/cli-ctyAqh0j.js +0 -2
  1650. package/dist/cli-runner-CNlk7xmx.js +0 -286
  1651. package/dist/cli-runner.runtime-BK4sQk1m.js +0 -3
  1652. package/dist/cli-runner.runtime-BT8ZZn-R.js +0 -4
  1653. package/dist/cli.runtime-DU7swpBI.js +0 -1261
  1654. package/dist/client-CQdcTPUf.js +0 -138
  1655. package/dist/client-Vx7pseEY.js +0 -713
  1656. package/dist/codex-native-web-search-BB3PWg7n.js +0 -3
  1657. package/dist/codex-native-web-search-BLevwOtN.js +0 -113
  1658. package/dist/combined-store-gateway-Cp7gSMlV.js +0 -163
  1659. package/dist/command-auth-DkJWb2HE.js +0 -76
  1660. package/dist/command-config-resolution-CIRWRfR8.js +0 -23
  1661. package/dist/command-config-resolution-DYZWj6Zm.js +0 -2
  1662. package/dist/command-config-resolution.runtime-CUtVJOf0.js +0 -2
  1663. package/dist/command-execution-startup-DEsPsZEU.js +0 -305
  1664. package/dist/command-registry-5QcI0D66.js +0 -4
  1665. package/dist/command-registry-6nNAhDaE.js +0 -9
  1666. package/dist/command-registry-core-B-Tfqu1R.js +0 -101
  1667. package/dist/command-secret-gateway-BNnWdAlq.js +0 -528
  1668. package/dist/command-status.runtime-CKgimR6Y.js +0 -87
  1669. package/dist/commands-acp-DSm97O5v.js +0 -77
  1670. package/dist/commands-compact.runtime-BXhP6WJ6.js +0 -10
  1671. package/dist/commands-core.runtime-6efmBjL5.js +0 -2
  1672. package/dist/commands-handlers.runtime-FzK-n0L8.js +0 -4597
  1673. package/dist/commands-models-CYEA4oks.js +0 -327
  1674. package/dist/commands-reset-hooks-BuIPeOLT.js +0 -133
  1675. package/dist/commands-status-BQnB5OSX.js +0 -16
  1676. package/dist/commands-status.runtime-B6GcfEDm.js +0 -3
  1677. package/dist/commands-subagents-control.runtime-CByd528A.js +0 -2
  1678. package/dist/commands-subagents-control.runtime-CqI4LMYa.js +0 -3
  1679. package/dist/commands-system-prompt-BD_LeeZk.js +0 -2
  1680. package/dist/commands-system-prompt-C2Md_Ia1.js +0 -158
  1681. package/dist/commands.runtime-CwiPf7Cc.js +0 -166
  1682. package/dist/compact-B_4bMVpw.js +0 -1118
  1683. package/dist/compact.runtime-BhRqiBXG.js +0 -12
  1684. package/dist/completion-cli-DPAWxu_A.js +0 -328
  1685. package/dist/config-B3ZoZd5V.js +0 -5
  1686. package/dist/config-D1ooXKCx.js +0 -9
  1687. package/dist/config-DidVsRqm.js +0 -251
  1688. package/dist/config-api-BRmW2LUx.js +0 -2
  1689. package/dist/config-cli-Ibsfa8Bm.js +0 -1078
  1690. package/dist/config-compat-B57zq89q.js +0 -130
  1691. package/dist/config-compat-ixP32ZwJ.js +0 -126
  1692. package/dist/config-guard-DnIVuR5d.js +0 -96
  1693. package/dist/config-runtime-Dr1JoMKQ.js +0 -32
  1694. package/dist/config-validation-COw3JcuF.js +0 -30
  1695. package/dist/configure-BfQlIIk0.js +0 -1245
  1696. package/dist/configure-DQ-DTcOJ.js +0 -2
  1697. package/dist/connect-options-zqTIEl6K.js +0 -699
  1698. package/dist/context-D5Ro5yCf.js +0 -278
  1699. package/dist/context-g9ANkVhl.js +0 -2
  1700. package/dist/control-auth-Bi8COEXI.js +0 -125
  1701. package/dist/control-service-DkYQV-Tl.js +0 -156
  1702. package/dist/control-ui-BA0iGAG9.js +0 -688
  1703. package/dist/conversation-id-BLY9ffjm.js +0 -38
  1704. package/dist/conversation-id-DVeOM5Jh.js +0 -235
  1705. package/dist/conversation-label-generator-Cc-S8z9Q.js +0 -56
  1706. package/dist/conversation-runtime-gJt7AAg2.js +0 -31
  1707. package/dist/core-BtmNtOpS.js +0 -275
  1708. package/dist/create-an7bnQv1.js +0 -80
  1709. package/dist/cron-cli-CPG4lnt5.js +0 -713
  1710. package/dist/daemon-cli-BXuqNS-3.js +0 -12
  1711. package/dist/daemon-install-BHDgo9qp.js +0 -64
  1712. package/dist/daemon-install-auth-profiles-store.runtime-DuRtWxoP.js +0 -2
  1713. package/dist/daemon-install-plan.shared-BQxPrU7X.js +0 -266
  1714. package/dist/ddg-client-CntWAh8N.js +0 -147
  1715. package/dist/ddg-search-provider-BeZ9HYXK.js +0 -54
  1716. package/dist/delegate-DyITI93V.js +0 -64
  1717. package/dist/deliver-BUbBF0P-.js +0 -3
  1718. package/dist/deliver-VYqGta5q.js +0 -747
  1719. package/dist/deliver-runtime-LEUVCSBV.js +0 -2
  1720. package/dist/delivery-outbound.runtime-DmSpBsJ2.js +0 -6
  1721. package/dist/delivery.runtime-Dwii5usm.js +0 -253
  1722. package/dist/deps-BMuC_6j0.js +0 -73
  1723. package/dist/deps-CIN4SVhK.js +0 -2
  1724. package/dist/detached-task-runtime-CTUQj84i.js +0 -73
  1725. package/dist/devices-cli-B_M2eMJ1.js +0 -496
  1726. package/dist/diagnostic-Ca7xQ_sl.js +0 -400
  1727. package/dist/diagnostic-support-export-uKXdbhuH.js +0 -533
  1728. package/dist/diagnostics-waSemGnZ.js +0 -154
  1729. package/dist/direct-dm-CiSjkmkL.js +0 -64
  1730. package/dist/directive-handling.fast-lane-BXAeEY49.js +0 -66
  1731. package/dist/directive-handling.impl-Bz01SejL.js +0 -703
  1732. package/dist/directive-handling.impl-CiFN7Cu1.js +0 -2
  1733. package/dist/directive-handling.model-selection-DZzMOtyl.js +0 -114
  1734. package/dist/directive-handling.persist.runtime-BzIB50Uy.js +0 -215
  1735. package/dist/directory-cli-17h5XIsS.js +0 -240
  1736. package/dist/dispatch-BnQSIx2G.js +0 -1131
  1737. package/dist/dispatch-acp-CaNQyl2L.js +0 -981
  1738. package/dist/dispatch-acp-manager.runtime-DJK1eHYX.js +0 -3
  1739. package/dist/dispatch-acp-media.runtime-FDZi3hhw.js +0 -4
  1740. package/dist/dispatch-acp-session.runtime-tA9m4L7t.js +0 -2
  1741. package/dist/dispatch-acp.runtime-Bl5cvtX4.js +0 -19
  1742. package/dist/dns-cli-QNL0F2Ri.js +0 -192
  1743. package/dist/doctor-auth-BzeKJols.js +0 -172
  1744. package/dist/doctor-auth-legacy-oauth-aZ9YjnlK.js +0 -2
  1745. package/dist/doctor-auth-legacy-oauth-zNlHTB4O.js +0 -48
  1746. package/dist/doctor-claude-cli-CxK8Pfom.js +0 -147
  1747. package/dist/doctor-config-analysis-CT6ojUa2.js +0 -94
  1748. package/dist/doctor-config-flow-DUCx5yjH.js +0 -417
  1749. package/dist/doctor-config-preflight-C-cFOcPn.js +0 -63
  1750. package/dist/doctor-config-preflight-Fm2wkSwd.js +0 -2
  1751. package/dist/doctor-contract-DxFV42-h.js +0 -26
  1752. package/dist/doctor-device-pairing-DBhEA-8G.js +0 -307
  1753. package/dist/doctor-gateway-daemon-flow-Ds47Er3Y.js +0 -250
  1754. package/dist/doctor-gateway-health-EWwTw5JR.js +0 -60
  1755. package/dist/doctor-gateway-services-Cibvf3nR.js +0 -316
  1756. package/dist/doctor-health-COiArVwj.js +0 -59
  1757. package/dist/doctor-health-contributions-D58LIVdN.js +0 -486
  1758. package/dist/doctor-memory-search-C-GTYsnB.js +0 -371
  1759. package/dist/doctor-prompter-BYIoKiZ8.js +0 -56
  1760. package/dist/doctor-sandbox-D0hdfdpJ.js +0 -194
  1761. package/dist/doctor-session-locks-CvM6ubaI.js +0 -56
  1762. package/dist/doctor-state-integrity-CxrVC_nh.js +0 -589
  1763. package/dist/doctor-state-migrations-DWChkFtX.js +0 -2
  1764. package/dist/doctor-update-leN3aPnU.js +0 -58
  1765. package/dist/doctor-workspace-status-CiEWZXrx.js +0 -75
  1766. package/dist/dreaming-DFPenC85.js +0 -1574
  1767. package/dist/dreaming-narrative-6A27_Gft.js +0 -595
  1768. package/dist/dreaming-shared-BDD2oWhL.js +0 -21
  1769. package/dist/embedded-gateway-stub.runtime-UVgfXZzk.js +0 -9
  1770. package/dist/embedding-batch-7hvzwHHl.js +0 -191
  1771. package/dist/embedding-batch-WKVjg_Bk.js +0 -161
  1772. package/dist/embedding-provider-BJee-X_b.js +0 -64
  1773. package/dist/embedding-provider-CTEUDSG2.js +0 -38
  1774. package/dist/embedding-provider-CiLu78QS.js +0 -118
  1775. package/dist/embedding-provider-ixUayU0N.js +0 -33
  1776. package/dist/embeddings-http-C0fpcL_-.js +0 -205
  1777. package/dist/embeddings-qvqBLfrg.js +0 -215
  1778. package/dist/engine-embeddings-9_Ztlm7g.js +0 -458
  1779. package/dist/engine-qmd-CceSLwoI.js +0 -551
  1780. package/dist/exa-web-search-provider-BEY5IeZV.js +0 -80
  1781. package/dist/exa-web-search-provider.runtime-BP0Bqh27.js +0 -302
  1782. package/dist/exa-web-search-provider.runtime-CE2dSkq8.js +0 -2
  1783. package/dist/exec-approval-forwarder.runtime-oBiamxIz.js +0 -3
  1784. package/dist/exec-approval-reply-DEujRvhz.js +0 -2
  1785. package/dist/exec-approval-reply-DJBZZafd.js +0 -296
  1786. package/dist/exec-approval-session-target-C08JaU9I.js +0 -176
  1787. package/dist/exec-approvals-cli-BIz6EjFc.js +0 -498
  1788. package/dist/exec-policy-cli-CPwfn4OX.js +0 -298
  1789. package/dist/extra-params--o3Bs_ba.js +0 -388
  1790. package/dist/fallbacks-DX4YcmAx.js +0 -2
  1791. package/dist/fallbacks-inTaaG-m.js +0 -31
  1792. package/dist/fallbacks-shared-ow1la-U2.js +0 -111
  1793. package/dist/format-CDtdyx29.js +0 -245
  1794. package/dist/format-CNZYdk0T.js +0 -176
  1795. package/dist/gateway-D4iWwu3_.js +0 -115
  1796. package/dist/gateway-cli-8Nrhyv3_.js +0 -1325
  1797. package/dist/gateway-install-token-Cvm6VMoq.js +0 -119
  1798. package/dist/gateway-rpc-DnaZL20f.js +0 -14
  1799. package/dist/gateway-rpc.runtime-CkhcOPe0.js +0 -23
  1800. package/dist/gateway-runtime-DctMRv_p.js +0 -15
  1801. package/dist/gateway-status-B6eKLX3H.js +0 -584
  1802. package/dist/genesis-tools-CvMcpUvH.js +0 -8999
  1803. package/dist/genesis-tools.runtime-Ch3NDEDq.js +0 -2
  1804. package/dist/get-reply-Cm39MCyU.js +0 -3879
  1805. package/dist/get-reply-from-config.runtime-CSqCYatb.js +0 -2
  1806. package/dist/gmail-setup-utils-D2pDgLCA.js +0 -430
  1807. package/dist/gmail-watcher-lifecycle-BZgPito0.js +0 -2
  1808. package/dist/gmail-watcher-lifecycle-dFjMERa7.js +0 -191
  1809. package/dist/graph-users-BJxYqA3A.js +0 -1337
  1810. package/dist/guarded-json-api-BhJR7l-7.js +0 -594
  1811. package/dist/health-C14jIilQ.js +0 -469
  1812. package/dist/health-C6yJSCMc.js +0 -3
  1813. package/dist/heartbeat-runner-C6-gFnyC.js +0 -5
  1814. package/dist/heartbeat-runner-yUYjgzIM.js +0 -1292
  1815. package/dist/heartbeat-runner.runtime-DZzyrUNB.js +0 -4
  1816. package/dist/help-DyqSh8kc.js +0 -81
  1817. package/dist/hooks-cli-JdkXCE5M.js +0 -433
  1818. package/dist/http-endpoint-helpers-TtZT-T3I.js +0 -41
  1819. package/dist/http-headers-BRWJRzAN.js +0 -11
  1820. package/dist/http-utils-C2hu7rtC.js +0 -924
  1821. package/dist/identity-BQK1BAp-.js +0 -140
  1822. package/dist/image-CQJOF-Zg.js +0 -272
  1823. package/dist/image-fallbacks-BH9qLbBG.js +0 -31
  1824. package/dist/image-fallbacks-DUOPO1ic.js +0 -2
  1825. package/dist/image-generation-core-Dk3jOqwq.js +0 -18
  1826. package/dist/image-generation-core.auth.runtime-BkPCNk6g.js +0 -2
  1827. package/dist/image-generation-provider-B2Sotuek.js +0 -157
  1828. package/dist/image-generation-provider-BjItC1ZB.js +0 -137
  1829. package/dist/image-generation-provider-CAuX-Q7r.js +0 -63
  1830. package/dist/image-generation-provider-CNnNFca5.js +0 -274
  1831. package/dist/image-generation-provider-CW39t66x.js +0 -95
  1832. package/dist/image-generation-provider-Cr8PAjS0.js +0 -529
  1833. package/dist/image-generation-provider-fPdPfoPR.js +0 -228
  1834. package/dist/image-generation-runtime-BjkgbLs7.js +0 -2
  1835. package/dist/image-runtime-ZHzWcqxM.js +0 -9
  1836. package/dist/inbound-reply-dispatch-DPf_IrbV.js +0 -73
  1837. package/dist/inbound.runtime-DVqg8xZi.js +0 -4
  1838. package/dist/inbound.runtime-DWu8LMdN.js +0 -3
  1839. package/dist/infra-runtime-CLND6LJ0.js +0 -39
  1840. package/dist/init-CzWob-9v.js +0 -59
  1841. package/dist/install-BZaQGsDZ.js +0 -159
  1842. package/dist/install-signal-cli-CE1vqFDm.js +0 -202
  1843. package/dist/install.runtime-DOhM77gf.js +0 -2
  1844. package/dist/io-h8M_Z0Lj.js +0 -19290
  1845. package/dist/io-z2jIOtLk.js +0 -5
  1846. package/dist/jobs-CNJYQgEn.js +0 -734
  1847. package/dist/kimi-web-search-provider-B2uRzMJ7.js +0 -80
  1848. package/dist/kimi-web-search-provider.runtime-2xk5W9Cs.js +0 -2
  1849. package/dist/kimi-web-search-provider.runtime-RTe_38UX.js +0 -261
  1850. package/dist/launchd-lFgfiDrN.js +0 -688
  1851. package/dist/legacy-tools-by-sender-B04NdZPf.js +0 -95
  1852. package/dist/legacy-tools-by-sender-CHP1JLBt.js +0 -2
  1853. package/dist/library-C0a9Bz2M.js +0 -45
  1854. package/dist/lifecycle-B_B_jt3r.js +0 -571
  1855. package/dist/lifecycle-DuqKKZop.js +0 -229
  1856. package/dist/lifecycle-core-BpdZi2zv.js +0 -422
  1857. package/dist/lifecycle.runtime-CgDdABk8.js +0 -2
  1858. package/dist/list-Bly8XeOF.js +0 -2
  1859. package/dist/list-CHIiamt1.js +0 -131
  1860. package/dist/list-u1v9z9iN.js +0 -1201
  1861. package/dist/list-w7tUjpdY.js +0 -2
  1862. package/dist/list.probe-kmHRFlrP.js +0 -419
  1863. package/dist/list.runtime-CjSnff-c.js +0 -159
  1864. package/dist/list.runtime-D1dElDsx.js +0 -11
  1865. package/dist/live-model-switch-Dd-0E2l_.js +0 -336
  1866. package/dist/llm-slug-generator-C3u6Ptgq.js +0 -79
  1867. package/dist/load-config-CXvIGI7N.js +0 -35
  1868. package/dist/load-context-avthPPkW.js +0 -56
  1869. package/dist/local-dispatch.runtime-BUoo02tX.js +0 -8
  1870. package/dist/logging-D5LEBy37.js +0 -13
  1871. package/dist/logging-bfkJL7yT.js +0 -2
  1872. package/dist/login-BKS5WGkP.js +0 -108
  1873. package/dist/logs-cli-DBYJ2Aq-.js +0 -265
  1874. package/dist/logs-cli.runtime-DQJPG_eL.js +0 -2
  1875. package/dist/main-session-restart-recovery-CzfY6Cd8.js +0 -206
  1876. package/dist/managed-image-attachments-BGPKA7Mn.js +0 -2
  1877. package/dist/managed-image-attachments-CTrq9ym-.js +0 -635
  1878. package/dist/manager-BYhRnRfB.js +0 -3114
  1879. package/dist/manager-C_ZGa9x8.js +0 -2057
  1880. package/dist/manager-DIHLRzYF.js +0 -2
  1881. package/dist/markdown-to-line-CRbbXtJK.js +0 -790
  1882. package/dist/mcp-cli-m4DjBDez.js +0 -725
  1883. package/dist/mcp-config-CczNZytL.js +0 -115
  1884. package/dist/mcp-http-b6UMoE_J.js +0 -529
  1885. package/dist/media-contract-BgaJThuI.js +0 -49
  1886. package/dist/media-contract-api-DzHEkFJ4.js +0 -2
  1887. package/dist/media-runtime-B1GzwmDa.js +0 -329
  1888. package/dist/media-understanding-XlANOKVy.js +0 -85
  1889. package/dist/media-understanding-provider-BMR6G9bs.js +0 -13
  1890. package/dist/media-understanding-provider-BeOpYnTw.js +0 -28
  1891. package/dist/media-understanding-provider-BxHOSDHK.js +0 -18
  1892. package/dist/media-understanding-provider-D1uimEOF.js +0 -37
  1893. package/dist/media-understanding-provider-D2bhV5kG.js +0 -69
  1894. package/dist/media-understanding-provider-Df4f_jEZ.js +0 -18
  1895. package/dist/media-understanding-provider-DjTpl-f8.js +0 -85
  1896. package/dist/media-understanding-provider-DmAZ22X7.js +0 -21
  1897. package/dist/media-understanding-provider-DyfMlzNa.js +0 -12
  1898. package/dist/media-understanding-provider-qrkRrB9V.js +0 -12
  1899. package/dist/media-understanding-runtime-BHRvMVOL.js +0 -2
  1900. package/dist/memory-CIDuBmaR.js +0 -342
  1901. package/dist/memory-core-host-engine-embeddings-M-Gp1i52.js +0 -2
  1902. package/dist/memory-core-host-engine-foundation-DasxnV_N.js +0 -11
  1903. package/dist/memory-core-host-engine-qmd-Bf8cHYXG.js +0 -2
  1904. package/dist/memory-core-host-runtime-cli-CquxELNj.js +0 -9
  1905. package/dist/memory-core-host-runtime-core-CmuFU_k8.js +0 -8
  1906. package/dist/memory-embedding-adapter-BMd68BpZ.js +0 -55
  1907. package/dist/memory-embedding-adapter-CFbi6QHC.js +0 -50
  1908. package/dist/memory-embedding-adapter-DEciIC1g.js +0 -123
  1909. package/dist/memory-embedding-adapter-DnzOdoj-.js +0 -32
  1910. package/dist/memory-host-core-CepAYJOC.js +0 -2
  1911. package/dist/memory-host-search-ef4xiGhZ.js +0 -12
  1912. package/dist/memory-host-search.runtime-DFl3cUHn.js +0 -2
  1913. package/dist/memory-runtime-Bwq0Ofx-.js +0 -2
  1914. package/dist/memory-runtime-Cj0UGN2J.js +0 -26
  1915. package/dist/message-CmjuvIFf.js +0 -232
  1916. package/dist/message-action-runner-CiY3rhqt.js +0 -1407
  1917. package/dist/message-action-runner-Do4P0h5i.js +0 -2
  1918. package/dist/message-actions-BYREqFJA.js +0 -143
  1919. package/dist/message.config.runtime-8kkpPgDw.js +0 -2
  1920. package/dist/message.gateway.runtime-gkoWzaYV.js +0 -2
  1921. package/dist/metadata-registry-loader-DAu2cSL5.js +0 -16
  1922. package/dist/metadata-registry-loader-GRi5Rm2Z.js +0 -2
  1923. package/dist/minimax-vlm-DkZ09FrD.js +0 -233
  1924. package/dist/minimax-web-search-provider--mirSuQz.js +0 -53
  1925. package/dist/minimax-web-search-provider.runtime-BCJPoUln.js +0 -140
  1926. package/dist/minimax-web-search-provider.runtime-Bg9lBTAr.js +0 -2
  1927. package/dist/mock-BBELHoyy.js +0 -136
  1928. package/dist/model-BEm0xMnp.js +0 -666
  1929. package/dist/model-DDJPPR3F.js +0 -3
  1930. package/dist/model-auth-C1Z9RsQ5.js +0 -456
  1931. package/dist/model-auth-env-Dz5Pixvx.js +0 -68
  1932. package/dist/model-auth-label-BAtXJxa0.js +0 -46
  1933. package/dist/model-catalog-C3Ib1fYR.js +0 -2
  1934. package/dist/model-catalog-DXtA4U6p.js +0 -159
  1935. package/dist/model-definitions-B8q-8mef.js +0 -260
  1936. package/dist/model-fallback-BSj7JGyo.js +0 -827
  1937. package/dist/model-fallback-auth.runtime-Bb5Zkx_r.js +0 -4
  1938. package/dist/model-picker-BTHkN0l4.js +0 -554
  1939. package/dist/model-picker-C3HMFJxK.js +0 -3
  1940. package/dist/model-picker-visibility-BL8rbGSy.js +0 -13
  1941. package/dist/model-picker.runtime-DX0Lf0PG.js +0 -15
  1942. package/dist/model-selection-Cc1fswUI.js +0 -213
  1943. package/dist/model-suppression-DvaJBPSc.js +0 -28
  1944. package/dist/model-suppression.runtime-JuLFgwjM.js +0 -7
  1945. package/dist/models-BJgjZ5vN.js +0 -18
  1946. package/dist/models-BS1WkKuU.js +0 -569
  1947. package/dist/models-Bdl84ZEi.js +0 -760
  1948. package/dist/models-DAWoIDFQ.js +0 -18
  1949. package/dist/models-auth-status-B_Pcr0tl.js +0 -201
  1950. package/dist/models-cli-C7_XNkjs.js +0 -219
  1951. package/dist/models-config-CeSA-IsM.js +0 -2
  1952. package/dist/models-config-DzJzRLUs.js +0 -933
  1953. package/dist/models-config.providers.secrets-DACp_2kp.js +0 -304
  1954. package/dist/models-ezJkixUd.js +0 -47
  1955. package/dist/models-http-CtMnZc8I.js +0 -92
  1956. package/dist/models-iki4v2pw.js +0 -157
  1957. package/dist/models.fetch-DeidpNMb.js +0 -518
  1958. package/dist/monitor-22LY8y6z.js +0 -788
  1959. package/dist/monitor-BZdf_CEm.js +0 -1237
  1960. package/dist/monitor-CTVDlTs2.js +0 -671
  1961. package/dist/monitor-Cfv-KGAl.js +0 -1661
  1962. package/dist/monitor-D_5ywEdZ.js +0 -295
  1963. package/dist/monitor-DuA69-8E.js +0 -2
  1964. package/dist/monitor-auth-BNDlfcw7.js +0 -207
  1965. package/dist/monitor-cmWeDVxf.js +0 -1459
  1966. package/dist/monitor-processing-D9Xcsagt.js +0 -1974
  1967. package/dist/monitor.runtime-zWvcbNim.js +0 -2
  1968. package/dist/monitor.webhook-BYWQa5lY.js +0 -180
  1969. package/dist/msteams-n9HDT4O-.js +0 -35
  1970. package/dist/music-generation-provider-BOf8FxsI.js +0 -170
  1971. package/dist/music-generation-provider-DXjWrzeQ.js +0 -63
  1972. package/dist/mutate-DCm-o6et.js +0 -116
  1973. package/dist/native-hook-relay-CKyIfLOm.js +0 -519
  1974. package/dist/native-web-search-CVg_cqdB.js +0 -64
  1975. package/dist/nextcloud-talk-BuJVVP0J.js +0 -17
  1976. package/dist/node-cli-BaWSEysu.js +0 -2506
  1977. package/dist/node-service-DCI-s3Mm.js +0 -68
  1978. package/dist/nodes-cli-DZht7scn.js +0 -1046
  1979. package/dist/nodes-utils-C6IKaTjm.js +0 -84
  1980. package/dist/nodes.helpers-CkJO5i0d.js +0 -34
  1981. package/dist/notify-v0zoiI-O.js +0 -315
  1982. package/dist/oauth-B8tWMfTJ.js +0 -139
  1983. package/dist/oauth-BmcwdgQf.js +0 -75
  1984. package/dist/oauth-DDT-kHNB.js +0 -152
  1985. package/dist/oauth-Gan0lup1.js +0 -2
  1986. package/dist/oauth.flow-CNEwf0O5.js +0 -45
  1987. package/dist/oauth.flow-CUZgJHCQ.js +0 -3
  1988. package/dist/onboard-BN0A1x-N.js +0 -632
  1989. package/dist/onboard-BxGE5zlS.js +0 -29
  1990. package/dist/onboard-C4pAjamt.js +0 -49
  1991. package/dist/onboard-Cu0Zb0tI.js +0 -25
  1992. package/dist/onboard-DSrD9d76.js +0 -58
  1993. package/dist/onboard-custom-D7-Whw_0.js +0 -271
  1994. package/dist/onboard-custom-Skp24tPF.js +0 -3
  1995. package/dist/onboard-g0Gns-rv.js +0 -25
  1996. package/dist/onboard-helpers-Cc2AnoIU.js +0 -6
  1997. package/dist/onboard-helpers-DIxfEXNM.js +0 -204
  1998. package/dist/onboard-remote-CYhQbOXH.js +0 -2
  1999. package/dist/onboard-remote-DrH3yVxE.js +0 -193
  2000. package/dist/onboard-search-XCG-N-tW.js +0 -323
  2001. package/dist/onboard-skills-DCI3hVXa.js +0 -134
  2002. package/dist/onboard-skills-i4KuFzS4.js +0 -2
  2003. package/dist/onboard-uHe_WHnV.js +0 -25
  2004. package/dist/onboard-vfG-wMNV.js +0 -316
  2005. package/dist/openai-codex-auth-identity-BP8ajX50.js +0 -45
  2006. package/dist/openai-codex-device-code-Cr2cbEdd.js +0 -164
  2007. package/dist/openai-codex-provider-BehtHuQr.js +0 -464
  2008. package/dist/openai-codex-shared-HFAofBwf.js +0 -6
  2009. package/dist/openai-http-DwCqhEcX.js +0 -500
  2010. package/dist/openai-provider-DsET7IpX.js +0 -313
  2011. package/dist/opencode-Cb-WQKky.js +0 -35
  2012. package/dist/openresponses-http-tJr67vC1.js +0 -1128
  2013. package/dist/operator-approvals-client-C0t_-2xC.js +0 -68
  2014. package/dist/order-dgHk1PE1.js +0 -109
  2015. package/dist/outbound-media-FIxE0Dv0.js +0 -57
  2016. package/dist/outbound-runtime-UoL4JsL6.js +0 -5
  2017. package/dist/outbound.runtime-nXA4k1xA.js +0 -2
  2018. package/dist/pair-command-approve-G5y-rKn9.js +0 -44
  2019. package/dist/pairing-cli-Cj31Dv4N.js +0 -117
  2020. package/dist/perplexity-web-search-provider-B6x_ImjZ.js +0 -92
  2021. package/dist/perplexity-web-search-provider.runtime-CXeIZv1r.js +0 -2
  2022. package/dist/perplexity-web-search-provider.runtime-DnjYQskA.js +0 -324
  2023. package/dist/persistent-bindings.lifecycle-C56aKBVc.js +0 -2
  2024. package/dist/persistent-bindings.lifecycle-CfBqvz9L.js +0 -85
  2025. package/dist/pi-bundle-mcp-runtime--MTfBo4Z.js +0 -829
  2026. package/dist/pi-bundle-mcp-runtime-ean1aFxj.js +0 -2
  2027. package/dist/pi-bundle-mcp-tools-BqjE32FZ.js +0 -108
  2028. package/dist/pi-embedded-B1wvxHXL.js +0 -2905
  2029. package/dist/pi-embedded-DmDb-oUB.js +0 -4
  2030. package/dist/pi-embedded-subscribe.handlers.compaction.runtime-BoDN2GHw.js +0 -23
  2031. package/dist/pi-embedded.runtime-D5xqw9Ko.js +0 -4
  2032. package/dist/pi-model-discovery-CYZ5LuGU.js +0 -237
  2033. package/dist/pi-tool-definition-adapter-CAxlo-Va.js +0 -217
  2034. package/dist/pi-tools-C69yvznf.js +0 -1057
  2035. package/dist/pi-tools.before-tool-call-BDeCmoAy.js +0 -2
  2036. package/dist/pi-tools.before-tool-call-DG7VVNBn.js +0 -433
  2037. package/dist/pi-tools.before-tool-call.runtime-GbZhbLH3.js +0 -13
  2038. package/dist/plivo-DFM_olZN.js +0 -394
  2039. package/dist/plugin-B9Ld0CUs.js +0 -12195
  2040. package/dist/plugin-enabled-Cxce83s1.js +0 -140
  2041. package/dist/plugin-install-config-policy-BimGg0f2.js +0 -137
  2042. package/dist/plugin-registration-BxJi2XYk.js +0 -23
  2043. package/dist/plugin-registry-D66gpl7-.js +0 -2
  2044. package/dist/plugin-registry-dEPS2Zb9.js +0 -3
  2045. package/dist/plugin-service-Cu0uMqDN.js +0 -2890
  2046. package/dist/plugins-cli-UICpKNEZ.js +0 -584
  2047. package/dist/plugins-command-helpers-ny7AVRZJ.js +0 -107
  2048. package/dist/plugins-install-persist-CSPRiteo.js +0 -133
  2049. package/dist/plugins-update-command-4Jece913.js +0 -1057
  2050. package/dist/policy-DgfegT_Y.js +0 -328
  2051. package/dist/prepare.runtime-C_sRmuFC.js +0 -815
  2052. package/dist/preview-warnings-BSovEOvs.js +0 -120
  2053. package/dist/probe-8vb_Ssot.js +0 -45
  2054. package/dist/probe-B6zM3cMF.js +0 -74
  2055. package/dist/probe-BjmKFiz1.js +0 -2205
  2056. package/dist/probe-CakOsrSu.js +0 -241
  2057. package/dist/probe-CbOoVumf.js +0 -2
  2058. package/dist/probe-D6yFcZpK.js +0 -1443
  2059. package/dist/probe-DtHuNHbp.js +0 -243
  2060. package/dist/probe-OcOYm1bj.js +0 -2
  2061. package/dist/probe-XYiCUrVW.js +0 -32
  2062. package/dist/probe.runtime-oasa8nRY.js +0 -2
  2063. package/dist/profiles-t-GpZimP.js +0 -111
  2064. package/dist/program-B7jIObA6.js +0 -111
  2065. package/dist/prompt-select-styled-DvkSxDCm.js +0 -20
  2066. package/dist/protocol-C40iRm9c.js +0 -2234
  2067. package/dist/provider-DuH_nkk-.js +0 -70
  2068. package/dist/provider-api-key-auth-BCbqFek0.js +0 -114
  2069. package/dist/provider-api-key-auth.runtime-C0dB6QR5.js +0 -14
  2070. package/dist/provider-auth-DlJTw0-4.js +0 -46
  2071. package/dist/provider-auth-api-key-kFD2TSQI.js +0 -5
  2072. package/dist/provider-auth-choice-7C46Z7_L.js +0 -228
  2073. package/dist/provider-auth-choice-preference-g0W-1lIY.js +0 -26
  2074. package/dist/provider-auth-choice.runtime-BMstkDeF.js +0 -14
  2075. package/dist/provider-auth-choice.runtime-DBaJlbBQ.js +0 -2
  2076. package/dist/provider-auth-guidance-CLhKt9_y.js +0 -2
  2077. package/dist/provider-auth-guidance-DMjnCkYr.js +0 -34
  2078. package/dist/provider-auth-helpers-g5J1YN29.js +0 -173
  2079. package/dist/provider-auth-input-Cmt5ISWx.js +0 -119
  2080. package/dist/provider-auth-runtime-C_of8BP-.js +0 -149
  2081. package/dist/provider-catalog-Bva0AQ20.js +0 -24
  2082. package/dist/provider-catalog-CDF5UffZ.js +0 -12
  2083. package/dist/provider-catalog-CIZ7lwcD.js +0 -11
  2084. package/dist/provider-catalog-WRqmEzqK.js +0 -26
  2085. package/dist/provider-catalog-lrSBHdfM.js +0 -11
  2086. package/dist/provider-compat-ia849gPL.js +0 -37
  2087. package/dist/provider-discovery.runtime-CKPRNOu9.js +0 -118
  2088. package/dist/provider-dispatcher-BIOPYzb9.js +0 -2
  2089. package/dist/provider-dispatcher-CpwviX0O.js +0 -22
  2090. package/dist/provider-entry-BZGcYiV-.js +0 -106
  2091. package/dist/provider-flow-DNqq-LGA.js +0 -147
  2092. package/dist/provider-model-defaults-M93SupwY.js +0 -6
  2093. package/dist/provider-models-BvjP15o5.js +0 -35
  2094. package/dist/provider-models-DzsmORvl.js +0 -119
  2095. package/dist/provider-registration-BL1hjJNQ.js +0 -218
  2096. package/dist/provider-registration-CKaw8a6k.js +0 -37
  2097. package/dist/provider-runtime-C4mK2ZHM.js +0 -472
  2098. package/dist/provider-runtime-C9Y0fX9M.js +0 -2
  2099. package/dist/provider-runtime.runtime-C1zVPJ_2.js +0 -26
  2100. package/dist/provider-self-hosted-setup-B_01kPQV.js +0 -251
  2101. package/dist/provider-setup-BTm4FuW0.js +0 -2
  2102. package/dist/provider-stream-BZwCdDk2.js +0 -290
  2103. package/dist/provider-stream-D80mDtUQ.js +0 -2174
  2104. package/dist/provider-stream-family-tKIQwQoP.js +0 -2
  2105. package/dist/provider-usage-DZHssxuZ.js +0 -4
  2106. package/dist/provider-usage-DtCUHOBT.js +0 -71
  2107. package/dist/provider-usage.load-DfxOyIjr.js +0 -334
  2108. package/dist/provider-utils-CDXJKXaV.js +0 -49
  2109. package/dist/provider-wizard-FaPEKwkS.js +0 -166
  2110. package/dist/providers.runtime-CNRwqmqP.js +0 -164
  2111. package/dist/providers.runtime-D5WUUxG6.js +0 -2
  2112. package/dist/proxy-stream-wrappers-Bne4sxnC.js +0 -394
  2113. package/dist/prune-CObb_7Tm.js +0 -83
  2114. package/dist/pw-ai-BXxjh18R.js +0 -2511
  2115. package/dist/pw-role-snapshot-Bl3hTc-h.js +0 -380
  2116. package/dist/qmd-manager-BUsmbNH2.js +0 -1921
  2117. package/dist/qr-cli-CJXKCj0L.js +0 -2
  2118. package/dist/qr-cli-kSU9X-N0.js +0 -349
  2119. package/dist/qr-image-BGiWCT9D.js +0 -2
  2120. package/dist/queue-C2h8xD0q.js +0 -409
  2121. package/dist/reaction-runtime-api-3XFmruJA.js +0 -116
  2122. package/dist/reactions-By-nqZC6.js +0 -998
  2123. package/dist/read-best-effort-config.runtime-D8wqGyi-.js +0 -2
  2124. package/dist/read-capability-iNDCfA71.js +0 -412
  2125. package/dist/realtime-provider-shared-BUH18A9i.js +0 -37
  2126. package/dist/realtime-transcription-provider-C8U5iIPd.js +0 -184
  2127. package/dist/realtime-transcription-provider-Ct_urZH7.js +0 -172
  2128. package/dist/realtime-transcription-provider-DWWihiYW.js +0 -184
  2129. package/dist/realtime-transcription-provider-DixI6prO.js +0 -120
  2130. package/dist/realtime-transcription-provider-LPnmN5fC.js +0 -183
  2131. package/dist/realtime-voice-provider-CNHR_8Ip.js +0 -489
  2132. package/dist/record-shared-B-W3jnOg.js +0 -10
  2133. package/dist/register-service-commands-C4gdXE5G.js +0 -71
  2134. package/dist/register.agent-CT6bSshW.js +0 -248
  2135. package/dist/register.backup-DZZZkF5L.js +0 -64
  2136. package/dist/register.configure-CImVXV1T.js +0 -15
  2137. package/dist/register.maintenance-D5jC2Wav.js +0 -438
  2138. package/dist/register.message-CT0eXmu4.js +0 -329
  2139. package/dist/register.onboard-BiigO1vS.js +0 -81
  2140. package/dist/register.runtime-CGAA56n8.js +0 -81
  2141. package/dist/register.setup-BG-rXone.js +0 -150
  2142. package/dist/register.status-health-sessions-CYuXd-5V.js +0 -1215
  2143. package/dist/register.subclis-BaJ6m946.js +0 -29
  2144. package/dist/register.subclis-D2lhCIAR.js +0 -3
  2145. package/dist/register.subclis-core-BZs-HQ4k.js +0 -249
  2146. package/dist/register.wallet-IC7GFGSz.js +0 -159
  2147. package/dist/repair-sequencing-DAQWWg1Q.js +0 -145
  2148. package/dist/replay-policy-SzJMVnli.js +0 -8
  2149. package/dist/reply-dispatch-runtime-DjIuN_dr.js +0 -13
  2150. package/dist/reply-media-paths.runtime-BwHwrFo5.js +0 -146
  2151. package/dist/reply-media-paths.runtime-BzHN3Oug.js +0 -2
  2152. package/dist/reply-payload-transform-DZTvoDh6.js +0 -720
  2153. package/dist/reply-runtime-5TFidLR3.js +0 -11
  2154. package/dist/reply.runtime-6d1e0INl.js +0 -2
  2155. package/dist/resolve-CmlJ4Qe6.js +0 -259
  2156. package/dist/response-generator-Bkk91EcQ.js +0 -175
  2157. package/dist/restart-DXckXfpS.js +0 -490
  2158. package/dist/restart-health-BWUPc4R-.js +0 -202
  2159. package/dist/restart-health-CWvsjHVN.js +0 -2
  2160. package/dist/root-help-DsdvAmaO.js +0 -44
  2161. package/dist/route-reply-GewElVG6.js +0 -162
  2162. package/dist/route-reply.runtime-CkHKAVic.js +0 -2
  2163. package/dist/routes-BxtbmAAO.js +0 -2
  2164. package/dist/routes-Dm0_DobO.js +0 -3341
  2165. package/dist/rpc-2YP43H5U.js +0 -61
  2166. package/dist/rpc-context-Cz5ff-4T.js +0 -17
  2167. package/dist/rpc.runtime-CmH330Bk.js +0 -21
  2168. package/dist/run-auth-profile.runtime-BN1_tgCB.js +0 -2
  2169. package/dist/run-context.runtime-DiIMdE17.js +0 -2
  2170. package/dist/run-delivery.runtime-qZIB76oE.js +0 -530
  2171. package/dist/run-embedded.runtime-nHunVmCv.js +0 -4
  2172. package/dist/run-execution-cli.runtime-CMT7La6D.js +0 -4
  2173. package/dist/run-executor.runtime-BG6SDi3f.js +0 -277
  2174. package/dist/run-main-C4yxwXlS.js +0 -516
  2175. package/dist/run-model-catalog.runtime-BeDPla6j.js +0 -2
  2176. package/dist/run-subagent-registry.runtime-D0RcqcJr.js +0 -2
  2177. package/dist/run-wait--kou3jZ7.js +0 -135
  2178. package/dist/runner-CJNyVFAv.js +0 -966
  2179. package/dist/runner.entries-CDDEOL4i.js +0 -604
  2180. package/dist/runs-BeROanhp.js +0 -496
  2181. package/dist/runs-oFHUw3em.js +0 -2
  2182. package/dist/runtime-B99WdxAw.js +0 -262
  2183. package/dist/runtime-BBdZI0T9.js +0 -116
  2184. package/dist/runtime-BMTh1o_4.js +0 -187
  2185. package/dist/runtime-BuDSQWY3.js +0 -187
  2186. package/dist/runtime-BvxkGJm2.js +0 -9
  2187. package/dist/runtime-C7re7-b0.js +0 -2
  2188. package/dist/runtime-CVeRX_h2.js +0 -72
  2189. package/dist/runtime-DgQ5oUKq.js +0 -973
  2190. package/dist/runtime-DhFt71Dh.js +0 -94
  2191. package/dist/runtime-SBCw4GZx.js +0 -2
  2192. package/dist/runtime-UhEn3-g2.js +0 -107
  2193. package/dist/runtime-WH7zKxDh.js +0 -269
  2194. package/dist/runtime-api-6SzMK-FZ.js +0 -4
  2195. package/dist/runtime-api-BAMrcB-5.js +0 -9
  2196. package/dist/runtime-api-DLSrxS5O.js +0 -9
  2197. package/dist/runtime-api-DsPleWQg.js +0 -14
  2198. package/dist/runtime-embedded-pi.runtime-eyjaJfAz.js +0 -2
  2199. package/dist/runtime-entry-NIlaVaCh.js +0 -2769
  2200. package/dist/runtime-internal-BTfGDlHi.js +0 -2
  2201. package/dist/runtime-model-auth.runtime-BmCKx59j.js +0 -45
  2202. package/dist/runtime-model-auth.runtime-CtfEmiHD.js +0 -2
  2203. package/dist/runtime-options-B5_eZxMV.js +0 -275
  2204. package/dist/runtime-prepare.runtime-CYL2KuLu.js +0 -80
  2205. package/dist/runtime-provider-2DNb6s0A.js +0 -21
  2206. package/dist/runtime-registry-loader-DR-J9mYJ.js +0 -2
  2207. package/dist/runtime-registry-loader-oRtkux7P.js +0 -85
  2208. package/dist/runtime-schema--IHLExJA.js +0 -27780
  2209. package/dist/runtime-shared-ClxGZaGO.js +0 -267
  2210. package/dist/runtime-tx7lDmPU.js +0 -475
  2211. package/dist/runtime-web-channel-plugin-DSUY71Zm.js +0 -203
  2212. package/dist/runtime-web-tools-B5m4pFEj.js +0 -1477
  2213. package/dist/runtime-web-tools-fallback.runtime-CuzXsYDs.js +0 -9
  2214. package/dist/sandbox-Bjg0J6uZ.js +0 -1156
  2215. package/dist/sandbox-DyLgT2hb.js +0 -3
  2216. package/dist/sandbox-cli-BLLA3tnd.js +0 -450
  2217. package/dist/scan-D0fsxqed.js +0 -2
  2218. package/dist/scan-DrjjN66Z.js +0 -523
  2219. package/dist/secrets-cli-xKEQ4JhR.js +0 -2101
  2220. package/dist/security-cli-B2rQ7-9U.js +0 -486
  2221. package/dist/selection-DEAdLh1Q.js +0 -2
  2222. package/dist/selection-zPPyzfBX.js +0 -7736
  2223. package/dist/semver-compare-4WdZjB8E.js +0 -53
  2224. package/dist/send-Buu-OT-I.js +0 -534
  2225. package/dist/send-CYKfZTCJ.js +0 -156
  2226. package/dist/send-Di1tRwJD.js +0 -102
  2227. package/dist/send.runtime-Bw22DBkL.js +0 -2
  2228. package/dist/server-CkhWy2iz.js +0 -77
  2229. package/dist/server-DPbF4NLN.js +0 -13
  2230. package/dist/server-context-C3fozX-C.js +0 -2
  2231. package/dist/server-context-R_Yx4X7V.js +0 -847
  2232. package/dist/server-middleware-K0bO4D5s.js +0 -120
  2233. package/dist/server-node-events-CdZP3Kok.js +0 -481
  2234. package/dist/server-plugin-bootstrap-C1Su6th-.js +0 -2
  2235. package/dist/server-plugin-bootstrap-DV23MPGu.js +0 -11333
  2236. package/dist/server-restart-sentinel-BWiOzljY.js +0 -697
  2237. package/dist/server-startup-memory-DcY7vInd.js +0 -32
  2238. package/dist/server.impl-DVM9pR9C.js +0 -12735
  2239. package/dist/service-2moXf4Z3.js +0 -940
  2240. package/dist/service-ChLFBF7Q.js +0 -120
  2241. package/dist/service-XI052xiT.js +0 -2
  2242. package/dist/service-audit-BFxGImYM.js +0 -254
  2243. package/dist/service-audit-cqHyD5gB.js +0 -2
  2244. package/dist/session-DgdrHsUH.js +0 -48
  2245. package/dist/session-cost-usage-v7CmY-jl.js +0 -651
  2246. package/dist/session-envelope-DdJGLsph.js +0 -18
  2247. package/dist/session-key-CGM2lMjF.js +0 -65
  2248. package/dist/session-kill-http-B_J1fJ4-.js +0 -110
  2249. package/dist/session-meta-DNYXwb8Y.js +0 -109
  2250. package/dist/session-override-CvWOXFPt.js +0 -106
  2251. package/dist/session-reset-model.runtime-CSgYVD3U.js +0 -133
  2252. package/dist/session-reset-service-DPgw70iw.js +0 -471
  2253. package/dist/session-route-B0h6MEyB.js +0 -93
  2254. package/dist/session-status.runtime-DCvgI1pG.js +0 -2
  2255. package/dist/session-store-2T8PZlcn.js +0 -126
  2256. package/dist/session-store.runtime-BvnkL0Mw.js +0 -2
  2257. package/dist/session-subagent-reactivation.runtime-BgsCnI-h.js +0 -2
  2258. package/dist/session-system-events-Yvfgcmpd.js +0 -63
  2259. package/dist/session-tab-registry-BoZsI5I6.js +0 -491
  2260. package/dist/session-transcript-hit-CJ5Jj7sA.js +0 -41
  2261. package/dist/session-updates-CUUxKrNv.js +0 -236
  2262. package/dist/session-updates.runtime-Dl3SAkoT.js +0 -2
  2263. package/dist/session-utils-BrGPE9ed.js +0 -926
  2264. package/dist/session-visibility-CZjMA1SL.js +0 -147
  2265. package/dist/sessions-BsnttWP_.js +0 -48
  2266. package/dist/sessions-CZok7kda.js +0 -281
  2267. package/dist/sessions-DnGJeOcI.js +0 -2
  2268. package/dist/sessions-GSCHVTz5.js +0 -16
  2269. package/dist/sessions-helpers-B3W7MdIb.js +0 -304
  2270. package/dist/sessions-history-http-Bw5J6HQ-.js +0 -383
  2271. package/dist/sessions-patch-2sBcHc9a.js +0 -309
  2272. package/dist/sessions-resolve-C-VZh_56.js +0 -174
  2273. package/dist/sessions.runtime-cLuc67tJ.js +0 -2
  2274. package/dist/set-5DGVoB6Q.js +0 -2
  2275. package/dist/set-COJp56WQ.js +0 -17
  2276. package/dist/set-image-CLKXLt5l.js +0 -2
  2277. package/dist/set-image-Wy-bkC3Q.js +0 -17
  2278. package/dist/setup-BG2J2HR-.js +0 -495
  2279. package/dist/setup-CEO-WwxS.js +0 -421
  2280. package/dist/setup-api-Culp0Usf.js +0 -29
  2281. package/dist/setup-core-CaTBS6Tz.js +0 -171
  2282. package/dist/setup-core-Dhwqz5ni.js +0 -184
  2283. package/dist/setup-core-Zijy2DMv.js +0 -393
  2284. package/dist/setup-core-youmXvW_.js +0 -176
  2285. package/dist/setup-surface-BBqs2Jo2.js +0 -351
  2286. package/dist/setup-surface-BKIPq1vY.js +0 -72
  2287. package/dist/setup-surface-BeMn-9hU.js +0 -403
  2288. package/dist/setup-surface-CUd-s0wh.js +0 -286
  2289. package/dist/setup-surface-Czri_ht7.js +0 -3
  2290. package/dist/setup-surface-DtscjAY3.js +0 -219
  2291. package/dist/setup.finalize-BSCjEqxV.js +0 -539
  2292. package/dist/setup.gateway-config-Df6Jm4vX.js +0 -250
  2293. package/dist/shared-B3Pz1Xcr.js +0 -121
  2294. package/dist/shared-Bc3x3THS.js +0 -76
  2295. package/dist/shared-C2qh8ugk.js +0 -217
  2296. package/dist/shared-CciCGYbs.js +0 -135
  2297. package/dist/shared-CsIxMVr_.js +0 -186
  2298. package/dist/shared-CxbLx0Ww.js +0 -198
  2299. package/dist/shared-DicCIRvK.js +0 -60
  2300. package/dist/shared-runtime-6_MnYe7Q.js +0 -7
  2301. package/dist/short-term-promotion-BIzj922a.js +0 -1543
  2302. package/dist/simple-completion-runtime-CGhlf0hZ.js +0 -158
  2303. package/dist/simple-completion-transport-DewSxAwJ.js +0 -33
  2304. package/dist/skills-clawhub-Dlv_j_Jg.js +0 -275
  2305. package/dist/skills-cli-D0EdapwV.js +0 -370
  2306. package/dist/slash-state-XfeMEeuI.js +0 -1911
  2307. package/dist/speech-core-DvaF8h0I.js +0 -94
  2308. package/dist/speech-provider-BQ98DhrM.js +0 -184
  2309. package/dist/speech-provider-BrwlxrtZ.js +0 -395
  2310. package/dist/speech-provider-CQLk4cH9.js +0 -170
  2311. package/dist/speech-provider-CUinmhV6.js +0 -103
  2312. package/dist/speech-provider-Cu9Q9-q6.js +0 -216
  2313. package/dist/speech-provider-Dr8g2Zbc.js +0 -209
  2314. package/dist/speech-provider-xHvRvcVe.js +0 -209
  2315. package/dist/src-BiDxQvtV.js +0 -3974
  2316. package/dist/stage-sandbox-media.runtime-UP-7985c.js +0 -232
  2317. package/dist/startup-auth-DVAg6R78.js +0 -180
  2318. package/dist/startup-context-CXQi-7YB.js +0 -312
  2319. package/dist/state-migrations-Aoorw4v_.js +0 -820
  2320. package/dist/status--hkh9cCZ.js +0 -209
  2321. package/dist/status-B880ja1s.js +0 -3
  2322. package/dist/status-BwSnS_wh.js +0 -397
  2323. package/dist/status-Cra01dC_.js +0 -62
  2324. package/dist/status-CuYSeMym.js +0 -2
  2325. package/dist/status-DY0DlWlw.js +0 -190
  2326. package/dist/status-DuZdkulz.js +0 -323
  2327. package/dist/status-MT62_Jgw.js +0 -2
  2328. package/dist/status-all-Dr3a4BAf.js +0 -498
  2329. package/dist/status-json-CXeZPfDL.js +0 -14
  2330. package/dist/status-json-command-JBCAP3wk.js +0 -84
  2331. package/dist/status-message-D8KTfWqp.js +0 -466
  2332. package/dist/status-message.runtime-i6HSwq0C.js +0 -6
  2333. package/dist/status-queue.runtime-Dpqj1jlp.js +0 -2
  2334. package/dist/status-runtime-shared-BeB5Gpc6.js +0 -257
  2335. package/dist/status-subagents.runtime-B4UXD0lL.js +0 -18
  2336. package/dist/status-text-myqmk4OL.js +0 -237
  2337. package/dist/status.command.text-runtime-DxXvRSSp.js +0 -15
  2338. package/dist/status.gateway-connection.runtime-B0Iwl2iZ.js +0 -2
  2339. package/dist/status.gather-CRbfrtwi.js +0 -292
  2340. package/dist/status.gather-DgGJqGIO.js +0 -2
  2341. package/dist/status.runtime-B1fTpY0S.js +0 -2
  2342. package/dist/status.runtime-Cbw0CFuM.js +0 -2
  2343. package/dist/status.scan-C1aqDsy2.js +0 -65
  2344. package/dist/status.scan-overview-BerlJz2l.js +0 -379
  2345. package/dist/status.scan.deps.runtime-vyKPba81.js +0 -18
  2346. package/dist/status.scan.fast-json-BXY82vu2.js +0 -2
  2347. package/dist/status.scan.fast-json-DJqgEbzZ.js +0 -132
  2348. package/dist/status.scan.runtime-nuf4UXm_.js +0 -409
  2349. package/dist/status.summary-CCdLUph8.js +0 -214
  2350. package/dist/status.summary-CHAn0_FS.js +0 -2
  2351. package/dist/status.update-Brj2S4WO.js +0 -2
  2352. package/dist/status.update-wHbH0vtL.js +0 -79
  2353. package/dist/store-DPPUFKL4.js +0 -1235
  2354. package/dist/store-DVf_1KBR.js +0 -4
  2355. package/dist/store-DsNJP7a2.js +0 -910
  2356. package/dist/store-load-DevCJoMp.js +0 -370
  2357. package/dist/store.runtime-DXcFo-7e.js +0 -2
  2358. package/dist/stream-CpdM0BB4.js +0 -27
  2359. package/dist/stream-QnfgL1uu.js +0 -664
  2360. package/dist/stream-Yw9oI1N9.js +0 -134
  2361. package/dist/stt-BKJ7-W_H.js +0 -66
  2362. package/dist/subagent-announce-D4jG75Ub.js +0 -351
  2363. package/dist/subagent-announce-delivery-BkQYzDcy.js +0 -726
  2364. package/dist/subagent-announce-output-C3pkuu-t.js +0 -364
  2365. package/dist/subagent-capabilities-Dr9kqRXv.js +0 -251
  2366. package/dist/subagent-control-DVVK8du2.js +0 -506
  2367. package/dist/subagent-control.runtime-D20i92a8.js +0 -3
  2368. package/dist/subagent-followup.runtime-CdeweG-S.js +0 -68
  2369. package/dist/subagent-list-CPGmzGIr.js +0 -172
  2370. package/dist/subagent-orphan-recovery-ZQanOHb4.js +0 -305
  2371. package/dist/subagent-registry-BcPa3ho0.js +0 -3
  2372. package/dist/subagent-registry-hJUso5eL.js +0 -1753
  2373. package/dist/subagent-spawn-DTaeQc9q.js +0 -1005
  2374. package/dist/system-cli-MQUV1Kt2.js +0 -59
  2375. package/dist/target-id-DwGFlj0w.js +0 -107
  2376. package/dist/targets-BPdSjnQH.js +0 -67
  2377. package/dist/task-executor-B62Qzfi-.js +0 -360
  2378. package/dist/task-owner-access-BBMrMOlN.js +0 -74
  2379. package/dist/task-registry-BD-ew2bT.js +0 -2366
  2380. package/dist/task-registry-delivery-runtime-B2WyGY0d.js +0 -3
  2381. package/dist/task-registry-delivery-runtime-MFJszOHI.js +0 -2
  2382. package/dist/task-registry.maintenance-0D2Yxl49.js +0 -416
  2383. package/dist/task-registry.maintenance-OPlfB5W9.js +0 -2
  2384. package/dist/tavily-client-C3xytQRs.js +0 -193
  2385. package/dist/tavily-client-CZGbAgS5.js +0 -2
  2386. package/dist/tavily-search-provider-D6KPby-f.js +0 -62
  2387. package/dist/telnyx-dl-FWSZ7.js +0 -260
  2388. package/dist/testing-DmxZ16UC.js +0 -575
  2389. package/dist/text-report-DbwOAt-s.js +0 -587
  2390. package/dist/text-runtime-7KpTTpVi.js +0 -290
  2391. package/dist/tool-auth-shared-Bv6BKCi8.js +0 -90
  2392. package/dist/tool-config-shared-DzQUOIuD.js +0 -19
  2393. package/dist/tool-policy-pipeline-v9XxD-ex.js +0 -109
  2394. package/dist/tool-resolution-vn72hwMo.js +0 -90
  2395. package/dist/tool-schema-runtime-jV8YdQ9e.js +0 -167
  2396. package/dist/tools-CqCuGTXf.js +0 -113
  2397. package/dist/tools-effective-inventory-DII_pOSr.js +0 -152
  2398. package/dist/tools-invoke-http-DdthGR52.js +0 -206
  2399. package/dist/tools.runtime-B8up1LNG.js +0 -4
  2400. package/dist/transcript-BEG6GDFF.js +0 -312
  2401. package/dist/transcript-resolve.runtime-BiYkACEe.js +0 -2
  2402. package/dist/transcript.runtime-MFREl0oG.js +0 -2
  2403. package/dist/transport-policy-B0VagXph.js +0 -75
  2404. package/dist/trash-Cngl97iU.js +0 -24
  2405. package/dist/tts-Bp81AGLz.js +0 -183
  2406. package/dist/tts-O3Lo0LND.js +0 -64
  2407. package/dist/tui-cli-Bz51WCAi.js +0 -4575
  2408. package/dist/twilio-CFtxsLCP.js +0 -609
  2409. package/dist/update-CgkXd2kv.js +0 -1282
  2410. package/dist/update-check-HnA0I2Da.js +0 -438
  2411. package/dist/update-cli-BYxOEE8h.js +0 -1759
  2412. package/dist/update-runner-Dghmpf13.js +0 -1892
  2413. package/dist/update-startup-BbGRP2fd.js +0 -331
  2414. package/dist/update-startup-CvNOEuOg.js +0 -2
  2415. package/dist/upgrade-Dvj8K4WB.js +0 -1226
  2416. package/dist/usage-format-B8I_58zr.js +0 -2
  2417. package/dist/usage-format-Hc-FyvzW.js +0 -703
  2418. package/dist/usage-q0pe5lMT.js +0 -606
  2419. package/dist/video-generation-core-BlmpVj-F.js +0 -6
  2420. package/dist/video-generation-provider-BTKjUEr6.js +0 -264
  2421. package/dist/video-generation-provider-BsJaGSdY.js +0 -271
  2422. package/dist/video-generation-provider-CRd5mS15.js +0 -187
  2423. package/dist/video-generation-provider-D5Dt3o8N.js +0 -221
  2424. package/dist/video-generation-provider-DAadtfjT2.js +0 -77
  2425. package/dist/video-generation-provider-DEuIYj4Q.js +0 -118
  2426. package/dist/video-generation-provider-I00zAw5a.js +0 -281
  2427. package/dist/video-generation-provider-LsvxSeCH.js +0 -78
  2428. package/dist/video-generation-provider-PjRFUZuF.js +0 -254
  2429. package/dist/video-generation-provider-_lpEJ0sZ.js +0 -287
  2430. package/dist/video-generation-provider-rYLsBGcx.js +0 -64
  2431. package/dist/video-generation-runtime-C0HgCTTM.js +0 -2
  2432. package/dist/video-generation-task-status-CHYB_IeZ.js +0 -163
  2433. package/dist/voice-mapping-CqBur95r.js +0 -41
  2434. package/dist/wait-for-idle-before-flush-DJMxeE2X.js +0 -5986
  2435. package/dist/web-fetch-providers.runtime-DV5-20bl.js +0 -34
  2436. package/dist/web-provider-runtime-shared-GwramnJ6.js +0 -180
  2437. package/dist/web-search-DInuHnh4.js +0 -61
  2438. package/dist/web-search-provider-BshM5HnM.js +0 -163
  2439. package/dist/web-search-provider.runtime-BKjABarO.js +0 -2
  2440. package/dist/web-search-provider.runtime-DcC48-4y.js +0 -185
  2441. package/dist/web-search-providers.runtime-Ct-fiRLn.js +0 -42
  2442. package/dist/webhook-shared-C5lP_giw.js +0 -12
  2443. package/dist/webhooks-cli-VV9ptfcF.js +0 -321
  2444. package/dist/wizard-models-BxP-rnuO.js +0 -161
  2445. package/dist/workflow-runtime-BZbnyBLJ.js +0 -485
  2446. package/dist/x-search-config-B5seJHNk.js +0 -36
  2447. package/dist/x-search-shared-B3VKBF82.js +0 -75
  2448. package/dist/zalo-js-XocMxKUr.js +0 -1157
@@ -0,0 +1,4597 @@
1
+ import { i as formatErrorMessage } from "./errors-Jbvi20TW.js";
2
+ import { a as normalizeLowercaseStringOrEmpty, c as normalizeOptionalString, i as normalizeFastMode, s as normalizeOptionalLowercaseString } from "./string-coerce-C1IzJjqi.js";
3
+ import { m as resolveUserPath, r as clampInt } from "./utils-DaGfogP-.js";
4
+ import { _ as resolveStateDir } from "./paths-DmR9mjUX.js";
5
+ import { r as logVerbose } from "./globals-C5IxqXPj.js";
6
+ import { s as normalizeStringEntries } from "./string-normalization-Bvcn03I9.js";
7
+ import { a as clearPluginManifestRegistryCache } from "./manifest-registry-DQR_-Eq8.js";
8
+ import { F as unsetConfigOverride, M as getConfigOverrides, N as resetConfigOverrides, P as setConfigOverride, T as validateConfigObjectWithPlugins, u as readConfigFileSnapshot, y as writeConfigFile } from "./io-DNd8mbjy.js";
9
+ import { r as normalizeOptionalAccountId } from "./account-id-C3j_3_su.js";
10
+ import { u as resolveAgentIdFromSessionKey } from "./session-key-EpIbK3Oz.js";
11
+ import { o as normalizeChannelId } from "./registry-CXnn3dzM.js";
12
+ import { i as normalizeChannelId$1, t as getChannelPlugin } from "./registry-DXDC8Wqv.js";
13
+ import { i as unsetConfigValueAtPath, n as parseConfigPath, r as setConfigValueAtPath, t as getConfigValueAtPath } from "./config-paths-DaElECOW.js";
14
+ import { b as resolveAgentWorkspaceDir, p as resolveSessionAgentId, y as resolveAgentDir } from "./agent-scope-CDjZLqNk.js";
15
+ import { t as parseDurationMs } from "./parse-duration-DH3x5y_9.js";
16
+ import { n as isRestartEnabled, t as isCommandFlagEnabled } from "./commands.flags-CR-1vURU.js";
17
+ import "./config-3He3LWHw.js";
18
+ import { i as GATEWAY_CLIENT_NAMES, r as GATEWAY_CLIENT_MODES } from "./client-info-CfESmEX1.js";
19
+ import { r as isInternalMessageChannel, u as normalizeMessageChannel } from "./message-channel-BbI8d0sw.js";
20
+ import { n as resolveChannelApprovalCapability } from "./plugins-DNe6i7Rv.js";
21
+ import { m as triggerInternalHook, n as createInternalHookEvent } from "./internal-hooks-aB3cCCPc.js";
22
+ import { x as prepareProviderRuntimeAuth } from "./provider-runtime-CE8zqYv8.js";
23
+ import { t as ensureGenesisModelsJson } from "./models-config-DnicdxyQ.js";
24
+ import { g as resolveResponseUsageMode, m as normalizeUsageDisplay } from "./thinking-CM0wvLlr.js";
25
+ import { t as requireApiKey } from "./model-auth-runtime-shared-7w03qzdi.js";
26
+ import { i as discoverModels, r as discoverAuthStorage } from "./pi-model-discovery-k8VUE5Tp.js";
27
+ import { a as resolveSessionFilePathOptions, i as resolveSessionFilePath, r as resolveDefaultSessionStorePath } from "./paths-DD6L4IvS.js";
28
+ import { t as loadSessionStore } from "./store-load-CUqchamJ.js";
29
+ import { o as resolveFreshSessionTotalTokens } from "./types-Bx9yhV03.js";
30
+ import { o as updateSessionStore } from "./store-CUSu4-Qr.js";
31
+ import { t as extractDeliveryInfo } from "./sessions--xDkaJeX.js";
32
+ import { i as formatUsd, r as formatTokenCount } from "./usage-format-CeDc5if9.js";
33
+ import { n as stripInboundMetadata } from "./strip-inbound-meta-BpubGgAq.js";
34
+ import { t as diagnosticLogger } from "./diagnostic-runtime-BvLyIIwP.js";
35
+ import { n as redactSupportString } from "./diagnostic-support-redaction-DZPXhPOk.js";
36
+ import { C as safeJsonStringify, S as safeTrajectorySessionFileName, b as resolveTrajectoryFilePath, w as sanitizeDiagnosticPayload, x as resolveTrajectoryPointerFilePath, y as TRAJECTORY_RUNTIME_FILE_MAX_BYTES } from "./selection-DC8EXnRg.js";
37
+ import { S as setTtsProvider, _ as setLastTtsAttempt, a as getTtsMaxLength, b as setTtsEnabled, c as isTtsEnabled, h as resolveTtsPrefsPath, i as getResolvedSpeechProviderConfig, l as isTtsProviderConfigured, m as resolveTtsConfig, o as getTtsProvider, r as getLastTtsAttempt, s as isSummarizationEnabled, v as setSummarizationEnabled, w as textToSpeech, x as setTtsMaxLength } from "./tts-Dp_lVFqh.js";
38
+ import { t as analyzeBootstrapBudget } from "./bootstrap-budget-CpN-YN0m.js";
39
+ import { h as resolveBootstrapTotalMaxChars, p as resolveBootstrapMaxChars } from "./pi-embedded-helpers-BhsTiD6Y.js";
40
+ import { n as resolveSandboxRuntimeStatus } from "./runtime-status-W0lHxRqX.js";
41
+ import { i as resolveImageSanitizationLimits, n as sanitizeImageBlocks } from "./tool-images-1Y5MwBpT.js";
42
+ import { r as getApiKeyForModel } from "./model-auth-CDl8OFEJ.js";
43
+ import { t as registerProviderStreamForModel } from "./provider-stream-DQRHM0a1.js";
44
+ import { m as stripToolResultDetails } from "./transport-stream-shared-B3e6W1dy.js";
45
+ import { i as unsetConfiguredMcpServer, r as setConfiguredMcpServer, t as listConfiguredMcpServers } from "./mcp-config-CDKA6_LY.js";
46
+ import { t as EmbeddedBlockChunker } from "./pi-embedded-block-chunker-D1H99cJT.js";
47
+ import { r as callGateway } from "./call-DuDGOVT1.js";
48
+ import { d as writeRestartSentinel, n as buildRestartSuccessContinuation, r as formatDoctorNonInteractiveHint, s as removeRestartSentinelFile } from "./restart-sentinel-D0qfIlId.js";
49
+ import { l as triggerGenesisRestart, o as scheduleGatewaySigusr1Restart } from "./restart-C-4J0cf2.js";
50
+ import { i as resolveReplyToMode } from "./reply-threading-CSNWvu2g.js";
51
+ import { _ as authorizeConfigWriteShared, b as resolveConfigWriteTargetFromPathShared, v as canBypassConfigWritePolicyShared, y as formatConfigWriteDeniedMessageShared } from "./channel-config-helpers-Bn_khg_r.js";
52
+ import { n as formatTaskStatusDetail, r as formatTaskStatusTitle, t as buildTaskStatusSnapshot } from "./task-status-LIWTrTqj.js";
53
+ import { a as clearSessionQueues } from "./queue-Rq1mceUG.js";
54
+ import { r as getSessionBindingService } from "./session-binding-service-DoeFMDT5.js";
55
+ import { h as replyRunRegistry, i as getActiveEmbeddedRunSnapshot } from "./runs-DUTtPgDm.js";
56
+ import "./diagnostic-CC9CPVio.js";
57
+ import { t as formatDurationCompact } from "./format-duration-D7ua_Cv_.js";
58
+ import "./sandbox-DAnx9TYc.js";
59
+ import { t as buildSystemPromptReport } from "./system-prompt-report-DUc7GJ-N.js";
60
+ import { n as estimateTokensFromChars } from "./cjk-chars-DwPGabQx.js";
61
+ import { i as streamWithPayloadPatch } from "./moonshot-thinking-stream-wrappers-C6ChjovN.js";
62
+ import { r as resolveModelWithRegistry } from "./model-Dox-u3UD.js";
63
+ import { i as matchPluginCommand, n as executePluginCommand } from "./commands-BZ3Hrsgn.js";
64
+ import { t as isApprovalNotFoundError } from "./approval-errors-Cp6xrD42.js";
65
+ import { r as normalizeCommandBody } from "./commands-registry-normalize-ZSb2LkjJ.js";
66
+ import { i as setAbortMemory, r as isAbortTrigger } from "./abort-primitives-B2NIccgr.js";
67
+ import "./commands-registry-BUxuRHG0.js";
68
+ import { n as formatTimeAgo } from "./format-relative-uQtNNoGl.js";
69
+ import { o as stripMentions, s as stripStructuralPrefixes } from "./mentions-Dm5IQz51.js";
70
+ import { n as setChannelConversationBindingMaxAgeBySessionKey, t as setChannelConversationBindingIdleTimeoutBySessionKey } from "./conversation-bindings-CgNVPGwn.js";
71
+ import { a as readChannelAllowFromStore, l as removeChannelAllowFromStoreEntry, t as addChannelAllowFromStoreEntry } from "./pairing-store-DI7znxyK.js";
72
+ import { i as installPluginFromPath, r as installPluginFromNpmSpec } from "./install-BmYV_Qz0.js";
73
+ import { l as resolveArchiveKind } from "./archive-Cm1nQqez.js";
74
+ import { n as isImplicitSameChatApprovalAuthorization } from "./approval-auth-helpers-BUQDSYGo.js";
75
+ import { n as parseActivationCommand } from "./group-activation-C_gTAl_1.js";
76
+ import { t as resolveFastModeState } from "./fast-mode-Cw7-WKiu.js";
77
+ import { n as resolveSessionAuthProfileOverride } from "./session-override-Cra7WfkP.js";
78
+ import { n as extractExplicitGroupId, t as formatElevatedUnavailableMessage } from "./elevated-unavailable-Dl1vpi7z.js";
79
+ import { t as resolveRuntimePolicySessionKey } from "./runtime-policy-session-key-ClUJDeX7.js";
80
+ import { a as shouldPersistAbortCutoff, i as resolveAbortCutoffFromContext, t as applyAbortCutoffToSessionEntry } from "./abort-cutoff-ICh6JSMK.js";
81
+ import { t as resolveEffectiveToolInventory } from "./tools-effective-inventory-BCvCprpD.js";
82
+ import { r as resolveConversationBindingContextFromAcpCommand } from "./conversation-binding-input-4r2gq_KQ.js";
83
+ import { n as resolveSessionEntryForKey, r as stopSubagentsForRequester, t as formatAbortReplyText } from "./abort-Yw60gQ-C.js";
84
+ import { t as extractBtwQuestion } from "./btw-command-DGuvquyH.js";
85
+ import { t as formatThreadBindingDurationLabel } from "./thread-bindings-messages-BbXbfHuh.js";
86
+ import { n as getSpeechProvider, r as listSpeechProviders, t as canonicalizeSpeechProviderId } from "./provider-registry-ChCcnRHr.js";
87
+ import { a as requireGatewayClientScopeForInternalChannel, i as requireCommandFlagEnabled, n as rejectNonOwnerCommand, r as rejectUnauthorizedCommand, t as buildDisabledCommandReply } from "./command-gates-BZ2Ly1tg.js";
88
+ import { t as handleAcpCommand } from "./commands-acp-QLk1cU5f.js";
89
+ import { n as buildCommandsMessagePaginated, r as buildHelpMessage, t as buildCommandsMessage } from "./command-status-builders-gbO0smso.js";
90
+ import { _ as getFinishedSession, v as getSession } from "./bash-tools.exec-runtime-nmZEc38u.js";
91
+ import { t as listSkillCommandsForAgents } from "./skill-commands-Cjewv1mD.js";
92
+ import { r as handleModelsCommand } from "./commands-models-BAneNjrI.js";
93
+ import { n as setPluginEnabledInConfig } from "./enable--YQu1m7B.js";
94
+ import { r as createExecTool } from "./bash-tools-CnDYSbnX.js";
95
+ import { n as listTasksForAgentIdForStatus, r as listTasksForSessionKeyForStatus } from "./status-text-BmLJrLth.js";
96
+ import { n as buildThreadingToolContext } from "./agent-runner-utils-CMe-JIDq.js";
97
+ import { d as resolveChannelAccountId, f as resolveCommandSurfaceChannel, l as resolveSubagentsAction, o as resolveHandledPrefix, s as resolveRequesterSessionKey, u as stopWithText } from "./shared-D7diJkX6.js";
98
+ import { t as buildToolsMessage } from "./status-ChOxNWSb.js";
99
+ import { t as parseConfigValue } from "./config-value-sfbZgEb6.js";
100
+ import { t as resolveCommandsSystemPromptBundle } from "./commands-system-prompt-2qwZc3xL.js";
101
+ import { a as writeSupportBundleDirectory, i as textSupportBundleFile, n as jsonlSupportBundleFile, r as supportBundleContents, t as jsonSupportBundleFile } from "./diagnostic-support-bundle-CZhX-X2W.js";
102
+ import { t as buildStatusReply } from "./commands-status-DiIQSYSt.js";
103
+ import { i as buildNpmInstallRecordFields, n as persistPluginInstall } from "./plugins-install-persist-Ccyj_thC.js";
104
+ import { h as parseClawHubPluginSpec } from "./clawhub-LPw6cLUe.js";
105
+ import { r as installPluginFromClawHub } from "./clawhub-Dz5KDje-.js";
106
+ import { a as buildPluginDiagnosticsReport, c as formatPluginCompatibilityNotice, o as buildPluginInspectReport, s as buildPluginSnapshotReport, t as buildAllPluginInspectReports } from "./status-DagNCfVv.js";
107
+ import { a as decidePreferredClawHubFallback, i as createPluginInstallLogger, n as buildPreferredClawHubSpec, u as resolveFileNpmSpecToLocalPath } from "./plugins-command-helpers-oZG-T69i.js";
108
+ import { n as loadCostUsageSummary, r as loadSessionCostSummary } from "./session-cost-usage-CbaKFiYP.js";
109
+ import { fileURLToPath } from "node:url";
110
+ import fs from "node:fs";
111
+ import path from "node:path";
112
+ import { SessionManager } from "@mariozechner/pi-coding-agent";
113
+ import { streamSimple } from "@mariozechner/pi-ai";
114
+ //#region src/channels/plugins/config-writes.ts
115
+ function isInternalConfigWriteMessageChannel(channel) {
116
+ return normalizeLowercaseStringOrEmpty(channel) === "webchat";
117
+ }
118
+ function authorizeConfigWrite(params) {
119
+ return authorizeConfigWriteShared(params);
120
+ }
121
+ function resolveConfigWriteTargetFromPath(path) {
122
+ return resolveConfigWriteTargetFromPathShared({
123
+ path,
124
+ normalizeChannelId: (raw) => normalizeLowercaseStringOrEmpty(raw)
125
+ });
126
+ }
127
+ function canBypassConfigWritePolicy(params) {
128
+ return canBypassConfigWritePolicyShared({
129
+ ...params,
130
+ isInternalMessageChannel: isInternalConfigWriteMessageChannel
131
+ });
132
+ }
133
+ function formatConfigWriteDeniedMessage(params) {
134
+ return formatConfigWriteDeniedMessageShared(params);
135
+ }
136
+ //#endregion
137
+ //#region src/auto-reply/reply/config-write-authorization.ts
138
+ function resolveConfigWriteDeniedText(params) {
139
+ const writeAuth = authorizeConfigWrite({
140
+ cfg: params.cfg,
141
+ origin: {
142
+ channelId: params.channelId,
143
+ accountId: params.accountId
144
+ },
145
+ target: params.target,
146
+ allowBypass: canBypassConfigWritePolicy({
147
+ channel: params.channel ?? "",
148
+ gatewayClientScopes: params.gatewayClientScopes
149
+ })
150
+ });
151
+ if (writeAuth.allowed) return null;
152
+ return formatConfigWriteDeniedMessage({
153
+ result: writeAuth,
154
+ fallbackChannelId: params.channelId
155
+ });
156
+ }
157
+ //#endregion
158
+ //#region src/auto-reply/reply/commands-allowlist.ts
159
+ const ACTIONS = new Set([
160
+ "list",
161
+ "add",
162
+ "remove"
163
+ ]);
164
+ const SCOPES = new Set([
165
+ "dm",
166
+ "group",
167
+ "all"
168
+ ]);
169
+ function resolveAllowlistAccountId(params) {
170
+ const explicitAccountId = normalizeOptionalAccountId(params.parsedAccount);
171
+ if (explicitAccountId) return explicitAccountId;
172
+ const configuredDefaultAccountId = normalizeOptionalString(getChannelPlugin(params.channelId)?.config.defaultAccountId?.(params.cfg));
173
+ const ctxAccountId = normalizeOptionalAccountId(params.ctxAccountId);
174
+ return configuredDefaultAccountId || ctxAccountId || "default";
175
+ }
176
+ function parseAllowlistCommand(raw) {
177
+ const trimmed = raw.trim();
178
+ if (!(normalizeOptionalLowercaseString(trimmed) ?? "").startsWith("/allowlist")) return null;
179
+ const rest = trimmed.slice(10).trim();
180
+ if (!rest) return {
181
+ action: "list",
182
+ scope: "dm"
183
+ };
184
+ const tokens = rest.split(/\s+/);
185
+ let action = "list";
186
+ let scope = "dm";
187
+ let resolve = false;
188
+ let target = "both";
189
+ let channel;
190
+ let account;
191
+ const entryTokens = [];
192
+ let i = 0;
193
+ const firstAction = normalizeOptionalLowercaseString(tokens[i]);
194
+ if (firstAction && ACTIONS.has(firstAction)) {
195
+ action = firstAction;
196
+ i += 1;
197
+ }
198
+ const firstScope = normalizeOptionalLowercaseString(tokens[i]);
199
+ if (firstScope && SCOPES.has(firstScope)) {
200
+ scope = firstScope;
201
+ i += 1;
202
+ }
203
+ for (; i < tokens.length; i += 1) {
204
+ const token = tokens[i];
205
+ const lowered = normalizeOptionalLowercaseString(token) ?? "";
206
+ if (lowered === "--resolve" || lowered === "resolve") {
207
+ resolve = true;
208
+ continue;
209
+ }
210
+ if (lowered === "--config" || lowered === "config") {
211
+ target = "config";
212
+ continue;
213
+ }
214
+ if (lowered === "--store" || lowered === "store") {
215
+ target = "store";
216
+ continue;
217
+ }
218
+ if (lowered === "--channel" && tokens[i + 1]) {
219
+ channel = tokens[i + 1];
220
+ i += 1;
221
+ continue;
222
+ }
223
+ if (lowered === "--account" && tokens[i + 1]) {
224
+ account = tokens[i + 1];
225
+ i += 1;
226
+ continue;
227
+ }
228
+ const kv = token.split("=");
229
+ if (kv.length === 2) {
230
+ const key = normalizeOptionalLowercaseString(kv[0]);
231
+ const value = normalizeOptionalString(kv[1]);
232
+ if (key === "channel") {
233
+ if (value) channel = value;
234
+ continue;
235
+ }
236
+ if (key === "account") {
237
+ if (value) account = value;
238
+ continue;
239
+ }
240
+ const normalizedValue = normalizeOptionalLowercaseString(value);
241
+ if (key === "scope" && normalizedValue && SCOPES.has(normalizedValue)) {
242
+ scope = normalizedValue;
243
+ continue;
244
+ }
245
+ }
246
+ entryTokens.push(token);
247
+ }
248
+ if (action === "add" || action === "remove") {
249
+ const entry = entryTokens.join(" ").trim();
250
+ if (!entry) return {
251
+ action: "error",
252
+ message: "Usage: /allowlist add|remove <entry>"
253
+ };
254
+ return {
255
+ action,
256
+ scope,
257
+ entry,
258
+ channel,
259
+ account,
260
+ resolve,
261
+ target
262
+ };
263
+ }
264
+ return {
265
+ action: "list",
266
+ scope,
267
+ channel,
268
+ account,
269
+ resolve
270
+ };
271
+ }
272
+ function normalizeAllowFrom(params) {
273
+ const plugin = getChannelPlugin(params.channelId);
274
+ if (plugin?.config.formatAllowFrom) return plugin.config.formatAllowFrom({
275
+ cfg: params.cfg,
276
+ accountId: params.accountId,
277
+ allowFrom: params.values
278
+ });
279
+ return normalizeStringEntries(params.values);
280
+ }
281
+ function formatEntryList(entries, resolved) {
282
+ if (entries.length === 0) return "(none)";
283
+ return entries.map((entry) => {
284
+ const name = resolved?.get(entry);
285
+ return name ? `${entry} (${name})` : entry;
286
+ }).join(", ");
287
+ }
288
+ async function updatePairingStoreAllowlist(params) {
289
+ const storeEntry = {
290
+ channel: params.channelId,
291
+ entry: params.entry,
292
+ accountId: params.accountId
293
+ };
294
+ if (params.action === "add") {
295
+ await addChannelAllowFromStoreEntry(storeEntry);
296
+ return;
297
+ }
298
+ await removeChannelAllowFromStoreEntry(storeEntry);
299
+ if (params.accountId === "default") await removeChannelAllowFromStoreEntry({
300
+ channel: params.channelId,
301
+ entry: params.entry
302
+ });
303
+ }
304
+ function mapResolvedAllowlistNames(entries) {
305
+ const map = /* @__PURE__ */ new Map();
306
+ for (const entry of entries) if (entry.resolved && entry.name) map.set(entry.input, entry.name);
307
+ return map;
308
+ }
309
+ async function resolveAllowlistNames(params) {
310
+ return mapResolvedAllowlistNames(await getChannelPlugin(params.channelId)?.allowlist?.resolveNames?.({
311
+ cfg: params.cfg,
312
+ accountId: params.accountId,
313
+ scope: params.scope,
314
+ entries: params.entries
315
+ }) ?? []);
316
+ }
317
+ async function readAllowlistConfig(params) {
318
+ return await getChannelPlugin(params.channelId)?.allowlist?.readConfig?.({
319
+ cfg: params.cfg,
320
+ accountId: params.accountId
321
+ }) ?? {};
322
+ }
323
+ const handleAllowlistCommand = async (params, allowTextCommands) => {
324
+ if (!allowTextCommands) return null;
325
+ const parsed = parseAllowlistCommand(params.command.commandBodyNormalized);
326
+ if (!parsed) return null;
327
+ if (parsed.action === "error") return {
328
+ shouldContinue: false,
329
+ reply: { text: `āš ļø ${parsed.message}` }
330
+ };
331
+ const unauthorized = rejectUnauthorizedCommand(params, "/allowlist");
332
+ if (unauthorized) return unauthorized;
333
+ if (parsed.action !== "list") {
334
+ const nonOwner = rejectNonOwnerCommand(params, "/allowlist");
335
+ if (nonOwner) return nonOwner;
336
+ }
337
+ const channelId = normalizeChannelId(parsed.channel) ?? params.command.channelId ?? normalizeChannelId(params.command.channel);
338
+ if (!channelId) return {
339
+ shouldContinue: false,
340
+ reply: { text: "āš ļø Unknown channel. Add channel=<id> to the command." }
341
+ };
342
+ if (normalizeOptionalString(parsed.account) && !normalizeOptionalAccountId(parsed.account)) return {
343
+ shouldContinue: false,
344
+ reply: { text: "āš ļø Invalid account id. Reserved keys (__proto__, constructor, prototype) are blocked." }
345
+ };
346
+ const accountId = resolveAllowlistAccountId({
347
+ cfg: params.cfg,
348
+ channelId,
349
+ parsedAccount: parsed.account,
350
+ ctxAccountId: params.ctx.AccountId
351
+ });
352
+ const plugin = getChannelPlugin(channelId);
353
+ if (parsed.action === "list") {
354
+ const supportsStore = Boolean(plugin?.pairing);
355
+ if (!plugin?.allowlist?.readConfig && !supportsStore) return {
356
+ shouldContinue: false,
357
+ reply: { text: `āš ļø ${channelId} does not expose allowlist configuration.` }
358
+ };
359
+ const storeAllowFrom = supportsStore ? await readChannelAllowFromStore(channelId, process.env, accountId).catch(() => []) : [];
360
+ const configState = await readAllowlistConfig({
361
+ cfg: params.cfg,
362
+ channelId,
363
+ accountId
364
+ });
365
+ const dmAllowFrom = (configState.dmAllowFrom ?? []).map(String);
366
+ const groupAllowFrom = (configState.groupAllowFrom ?? []).map(String);
367
+ const groupOverrides = (configState.groupOverrides ?? []).map((entry) => ({
368
+ label: entry.label,
369
+ entries: entry.entries.map(String).filter(Boolean)
370
+ }));
371
+ const dmDisplay = normalizeAllowFrom({
372
+ cfg: params.cfg,
373
+ channelId,
374
+ accountId,
375
+ values: dmAllowFrom
376
+ });
377
+ const groupDisplay = normalizeAllowFrom({
378
+ cfg: params.cfg,
379
+ channelId,
380
+ accountId,
381
+ values: groupAllowFrom
382
+ });
383
+ const groupOverrideEntries = groupOverrides.flatMap((entry) => entry.entries);
384
+ const groupOverrideDisplay = normalizeAllowFrom({
385
+ cfg: params.cfg,
386
+ channelId,
387
+ accountId,
388
+ values: groupOverrideEntries
389
+ });
390
+ const resolvedDm = parsed.resolve && dmDisplay.length > 0 ? await resolveAllowlistNames({
391
+ cfg: params.cfg,
392
+ channelId,
393
+ accountId,
394
+ scope: "dm",
395
+ entries: dmDisplay
396
+ }) : void 0;
397
+ const resolvedGroup = parsed.resolve && groupOverrideDisplay.length > 0 ? await resolveAllowlistNames({
398
+ cfg: params.cfg,
399
+ channelId,
400
+ accountId,
401
+ scope: "group",
402
+ entries: groupOverrideDisplay
403
+ }) : void 0;
404
+ const lines = ["🧾 Allowlist"];
405
+ lines.push(`Channel: ${channelId}${accountId ? ` (account ${accountId})` : ""}`);
406
+ if (configState.dmPolicy) lines.push(`DM policy: ${configState.dmPolicy}`);
407
+ if (configState.groupPolicy) lines.push(`Group policy: ${configState.groupPolicy}`);
408
+ const showDm = parsed.scope === "dm" || parsed.scope === "all";
409
+ const showGroup = parsed.scope === "group" || parsed.scope === "all";
410
+ if (showDm) lines.push(`DM allowFrom (config): ${formatEntryList(dmDisplay, resolvedDm)}`);
411
+ if (supportsStore && storeAllowFrom.length > 0) {
412
+ const storeLabel = normalizeAllowFrom({
413
+ cfg: params.cfg,
414
+ channelId,
415
+ accountId,
416
+ values: storeAllowFrom
417
+ });
418
+ lines.push(`Paired allowFrom (store): ${formatEntryList(storeLabel)}`);
419
+ }
420
+ if (showGroup) {
421
+ if (groupAllowFrom.length > 0) lines.push(`Group allowFrom (config): ${formatEntryList(groupDisplay, resolvedGroup)}`);
422
+ if (groupOverrides.length > 0) {
423
+ lines.push("Group overrides:");
424
+ for (const entry of groupOverrides) {
425
+ const normalized = normalizeAllowFrom({
426
+ cfg: params.cfg,
427
+ channelId,
428
+ accountId,
429
+ values: entry.entries
430
+ });
431
+ lines.push(`- ${entry.label}: ${formatEntryList(normalized, resolvedGroup)}`);
432
+ }
433
+ }
434
+ }
435
+ return {
436
+ shouldContinue: false,
437
+ reply: { text: lines.join("\n") }
438
+ };
439
+ }
440
+ const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
441
+ label: "/allowlist write",
442
+ allowedScopes: ["operator.admin"],
443
+ missingText: "āŒ /allowlist add|remove requires operator.admin for gateway clients."
444
+ });
445
+ if (missingAdminScope) return missingAdminScope;
446
+ const disabled = requireCommandFlagEnabled(params.cfg, {
447
+ label: "/allowlist edits",
448
+ configKey: "config",
449
+ disabledVerb: "are"
450
+ });
451
+ if (disabled) return disabled;
452
+ const shouldUpdateConfig = parsed.target !== "store";
453
+ const shouldTouchStore = parsed.target !== "config" && Boolean(plugin?.pairing);
454
+ if (shouldUpdateConfig) {
455
+ if (parsed.scope === "all") return {
456
+ shouldContinue: false,
457
+ reply: { text: "āš ļø /allowlist add|remove requires scope dm or group." }
458
+ };
459
+ if (!plugin?.allowlist?.applyConfigEdit) return {
460
+ shouldContinue: false,
461
+ reply: { text: `āš ļø ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
462
+ };
463
+ const snapshot = await readConfigFileSnapshot();
464
+ if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
465
+ shouldContinue: false,
466
+ reply: { text: "āš ļø Config file is invalid; fix it before using /allowlist." }
467
+ };
468
+ const parsedConfig = structuredClone(snapshot.parsed);
469
+ const editResult = await plugin.allowlist.applyConfigEdit({
470
+ cfg: params.cfg,
471
+ parsedConfig,
472
+ accountId,
473
+ scope: parsed.scope,
474
+ action: parsed.action,
475
+ entry: parsed.entry
476
+ });
477
+ if (!editResult) return {
478
+ shouldContinue: false,
479
+ reply: { text: `āš ļø ${channelId} does not support ${parsed.scope} allowlist edits via /allowlist.` }
480
+ };
481
+ if (editResult.kind === "invalid-entry") return {
482
+ shouldContinue: false,
483
+ reply: { text: "āš ļø Invalid allowlist entry." }
484
+ };
485
+ const deniedText = resolveConfigWriteDeniedText({
486
+ cfg: params.cfg,
487
+ channel: params.command.channel,
488
+ channelId,
489
+ accountId,
490
+ gatewayClientScopes: params.ctx.GatewayClientScopes,
491
+ target: editResult.writeTarget
492
+ });
493
+ if (deniedText) return {
494
+ shouldContinue: false,
495
+ reply: { text: deniedText }
496
+ };
497
+ const configChanged = editResult.changed;
498
+ if (configChanged) {
499
+ const validated = validateConfigObjectWithPlugins(parsedConfig);
500
+ if (!validated.ok) {
501
+ const issue = validated.issues[0];
502
+ return {
503
+ shouldContinue: false,
504
+ reply: { text: `āš ļø Config invalid after update (${issue.path}: ${issue.message}).` }
505
+ };
506
+ }
507
+ await writeConfigFile(validated.config);
508
+ }
509
+ if (!configChanged && !shouldTouchStore) return {
510
+ shouldContinue: false,
511
+ reply: { text: parsed.action === "add" ? "āœ… Already allowlisted." : "āš ļø Entry not found." }
512
+ };
513
+ if (shouldTouchStore) await updatePairingStoreAllowlist({
514
+ action: parsed.action,
515
+ channelId,
516
+ accountId,
517
+ entry: parsed.entry
518
+ });
519
+ const actionLabel = parsed.action === "add" ? "added" : "removed";
520
+ const scopeLabel = parsed.scope === "dm" ? "DM" : "group";
521
+ const locations = [];
522
+ if (configChanged) locations.push(editResult.pathLabel);
523
+ if (shouldTouchStore) locations.push("pairing store");
524
+ return {
525
+ shouldContinue: false,
526
+ reply: { text: `āœ… ${scopeLabel} allowlist ${actionLabel}: ${locations.length > 0 ? locations.join(" + ") : "no-op"}.` }
527
+ };
528
+ }
529
+ if (!shouldTouchStore) return {
530
+ shouldContinue: false,
531
+ reply: { text: "āš ļø This channel does not support allowlist storage." }
532
+ };
533
+ await updatePairingStoreAllowlist({
534
+ action: parsed.action,
535
+ channelId,
536
+ accountId,
537
+ entry: parsed.entry
538
+ });
539
+ const actionLabel = parsed.action === "add" ? "added" : "removed";
540
+ return {
541
+ shouldContinue: false,
542
+ reply: { text: `āœ… ${parsed.scope === "dm" ? "DM" : "group"} allowlist ${actionLabel} in pairing store.` }
543
+ };
544
+ };
545
+ //#endregion
546
+ //#region src/infra/channel-approval-auth.ts
547
+ function resolveApprovalCommandAuthorization(params) {
548
+ const channel = normalizeMessageChannel(params.channel);
549
+ if (!channel) return {
550
+ authorized: true,
551
+ explicit: false
552
+ };
553
+ const approvalCapability = resolveChannelApprovalCapability(getChannelPlugin(channel));
554
+ const resolved = approvalCapability?.authorizeActorAction?.({
555
+ cfg: params.cfg,
556
+ accountId: params.accountId,
557
+ senderId: params.senderId,
558
+ action: "approve",
559
+ approvalKind: params.kind
560
+ });
561
+ if (!resolved) return {
562
+ authorized: true,
563
+ explicit: false
564
+ };
565
+ const implicitSameChatAuthorization = isImplicitSameChatApprovalAuthorization(resolved);
566
+ const availability = approvalCapability?.getActionAvailabilityState?.({
567
+ cfg: params.cfg,
568
+ accountId: params.accountId,
569
+ action: "approve",
570
+ approvalKind: params.kind
571
+ });
572
+ return {
573
+ authorized: resolved.authorized,
574
+ reason: resolved.reason,
575
+ explicit: resolved.authorized ? !implicitSameChatAuthorization && availability?.kind !== "disabled" : true
576
+ };
577
+ }
578
+ //#endregion
579
+ //#region src/auto-reply/reply/commands-approve.ts
580
+ const COMMAND_REGEX = /^\/?approve(?:\s|$)/i;
581
+ const FOREIGN_COMMAND_MENTION_REGEX = /^\/approve@([^\s]+)(?:\s|$)/i;
582
+ const DECISION_ALIASES = {
583
+ allow: "allow-once",
584
+ once: "allow-once",
585
+ "allow-once": "allow-once",
586
+ allowonce: "allow-once",
587
+ always: "allow-always",
588
+ "allow-always": "allow-always",
589
+ allowalways: "allow-always",
590
+ deny: "deny",
591
+ reject: "deny",
592
+ block: "deny"
593
+ };
594
+ const APPROVE_USAGE_TEXT = "Usage: /approve <id> <decision> (see the pending approval message for available decisions)";
595
+ function parseApproveCommand(raw) {
596
+ const trimmed = raw.trim();
597
+ if (FOREIGN_COMMAND_MENTION_REGEX.test(trimmed)) return {
598
+ ok: false,
599
+ error: "āŒ This /approve command targets a different Telegram bot."
600
+ };
601
+ const commandMatch = trimmed.match(COMMAND_REGEX);
602
+ if (!commandMatch) return null;
603
+ const rest = trimmed.slice(commandMatch[0].length).trim();
604
+ if (!rest) return {
605
+ ok: false,
606
+ error: APPROVE_USAGE_TEXT
607
+ };
608
+ const tokens = rest.split(/\s+/).filter(Boolean);
609
+ if (tokens.length < 2) return {
610
+ ok: false,
611
+ error: APPROVE_USAGE_TEXT
612
+ };
613
+ const first = normalizeLowercaseStringOrEmpty(tokens[0]);
614
+ const second = normalizeLowercaseStringOrEmpty(tokens[1]);
615
+ if (DECISION_ALIASES[first]) return {
616
+ ok: true,
617
+ decision: DECISION_ALIASES[first],
618
+ id: tokens.slice(1).join(" ").trim()
619
+ };
620
+ if (DECISION_ALIASES[second]) return {
621
+ ok: true,
622
+ decision: DECISION_ALIASES[second],
623
+ id: tokens[0]
624
+ };
625
+ return {
626
+ ok: false,
627
+ error: APPROVE_USAGE_TEXT
628
+ };
629
+ }
630
+ function buildResolvedByLabel(params) {
631
+ return `${params.command.channel}:${params.command.senderId ?? "unknown"}`;
632
+ }
633
+ function formatApprovalSubmitError(error) {
634
+ return formatErrorMessage(error);
635
+ }
636
+ function resolveApprovalMethods(params) {
637
+ if (params.approvalId.startsWith("plugin:")) return params.pluginAuthorization.authorized ? ["plugin.approval.resolve"] : [];
638
+ if (params.execAuthorization.authorized && params.pluginAuthorization.authorized) return ["exec.approval.resolve", "plugin.approval.resolve"];
639
+ if (params.execAuthorization.authorized) return ["exec.approval.resolve"];
640
+ if (params.pluginAuthorization.authorized) return ["plugin.approval.resolve"];
641
+ return [];
642
+ }
643
+ function resolveApprovalAuthorizationError(params) {
644
+ if (params.approvalId.startsWith("plugin:")) return params.pluginAuthorization.reason ?? "āŒ You are not authorized to approve this request.";
645
+ return params.execAuthorization.reason ?? params.pluginAuthorization.reason ?? "āŒ You are not authorized to approve this request.";
646
+ }
647
+ const handleApproveCommand = async (params, allowTextCommands) => {
648
+ if (!allowTextCommands) return null;
649
+ const normalized = params.command.commandBodyNormalized;
650
+ const parsed = parseApproveCommand(normalized);
651
+ if (!parsed) return null;
652
+ if (!parsed.ok) return {
653
+ shouldContinue: false,
654
+ reply: { text: parsed.error }
655
+ };
656
+ const isPluginId = parsed.id.startsWith("plugin:");
657
+ const effectiveAccountId = resolveChannelAccountId({
658
+ cfg: params.cfg,
659
+ ctx: params.ctx,
660
+ command: params.command
661
+ });
662
+ const approveCommandBehavior = resolveChannelApprovalCapability(getChannelPlugin(params.command.channel))?.resolveApproveCommandBehavior?.({
663
+ cfg: params.cfg,
664
+ accountId: effectiveAccountId,
665
+ senderId: params.command.senderId,
666
+ approvalKind: isPluginId ? "plugin" : "exec"
667
+ });
668
+ if (approveCommandBehavior?.kind === "ignore") return { shouldContinue: false };
669
+ if (approveCommandBehavior?.kind === "reply") return {
670
+ shouldContinue: false,
671
+ reply: { text: approveCommandBehavior.text }
672
+ };
673
+ const execApprovalAuthorization = resolveApprovalCommandAuthorization({
674
+ cfg: params.cfg,
675
+ channel: params.command.channel,
676
+ accountId: effectiveAccountId,
677
+ senderId: params.command.senderId,
678
+ kind: "exec"
679
+ });
680
+ const pluginApprovalAuthorization = resolveApprovalCommandAuthorization({
681
+ cfg: params.cfg,
682
+ channel: params.command.channel,
683
+ accountId: effectiveAccountId,
684
+ senderId: params.command.senderId,
685
+ kind: "plugin"
686
+ });
687
+ const hasExplicitApprovalAuthorization = execApprovalAuthorization.explicit && execApprovalAuthorization.authorized || pluginApprovalAuthorization.explicit && pluginApprovalAuthorization.authorized;
688
+ if (!params.command.isAuthorizedSender && !hasExplicitApprovalAuthorization) {
689
+ logVerbose(`Ignoring /approve from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
690
+ return { shouldContinue: false };
691
+ }
692
+ const missingScope = requireGatewayClientScopeForInternalChannel(params, {
693
+ label: "/approve",
694
+ allowedScopes: ["operator.approvals", "operator.admin"],
695
+ missingText: "āŒ /approve requires operator.approvals for gateway clients."
696
+ });
697
+ if (missingScope) return missingScope;
698
+ const resolvedBy = buildResolvedByLabel(params);
699
+ const callApprovalMethod = async (method) => {
700
+ await callGateway({
701
+ method,
702
+ params: {
703
+ id: parsed.id,
704
+ decision: parsed.decision
705
+ },
706
+ clientName: GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT,
707
+ clientDisplayName: `Chat approval (${resolvedBy})`,
708
+ mode: GATEWAY_CLIENT_MODES.BACKEND
709
+ });
710
+ };
711
+ const methods = resolveApprovalMethods({
712
+ approvalId: parsed.id,
713
+ execAuthorization: execApprovalAuthorization,
714
+ pluginAuthorization: pluginApprovalAuthorization
715
+ });
716
+ if (methods.length === 0) return {
717
+ shouldContinue: false,
718
+ reply: { text: resolveApprovalAuthorizationError({
719
+ approvalId: parsed.id,
720
+ execAuthorization: execApprovalAuthorization,
721
+ pluginAuthorization: pluginApprovalAuthorization
722
+ }) }
723
+ };
724
+ let lastError = null;
725
+ for (const [index, method] of methods.entries()) try {
726
+ await callApprovalMethod(method);
727
+ lastError = null;
728
+ break;
729
+ } catch (error) {
730
+ lastError = error;
731
+ const isLastMethod = index === methods.length - 1;
732
+ if (!isApprovalNotFoundError(error) || isLastMethod) return {
733
+ shouldContinue: false,
734
+ reply: { text: `āŒ Failed to submit approval: ${formatApprovalSubmitError(error)}` }
735
+ };
736
+ }
737
+ if (lastError) return {
738
+ shouldContinue: false,
739
+ reply: { text: `āŒ Failed to submit approval: ${formatApprovalSubmitError(lastError)}` }
740
+ };
741
+ return {
742
+ shouldContinue: false,
743
+ reply: { text: `āœ… Approval ${parsed.decision} submitted for ${parsed.id}.` }
744
+ };
745
+ };
746
+ //#endregion
747
+ //#region src/auto-reply/reply/bash-command.ts
748
+ const CHAT_BASH_SCOPE_KEY = "chat:bash";
749
+ const DEFAULT_FOREGROUND_MS = 2e3;
750
+ const MAX_FOREGROUND_MS = 3e4;
751
+ let activeJob = null;
752
+ function resolveForegroundMs(cfg) {
753
+ const raw = cfg.commands?.bashForegroundMs;
754
+ if (typeof raw !== "number" || Number.isNaN(raw)) return DEFAULT_FOREGROUND_MS;
755
+ return clampInt(raw, 0, MAX_FOREGROUND_MS);
756
+ }
757
+ function formatSessionSnippet(sessionId) {
758
+ const trimmed = sessionId.trim();
759
+ if (trimmed.length <= 12) return trimmed;
760
+ return `${trimmed.slice(0, 8)}…`;
761
+ }
762
+ function formatOutputBlock(text) {
763
+ const trimmed = text.trim();
764
+ if (!trimmed) return "(no output)";
765
+ return `\`\`\`txt\n${trimmed}\n\`\`\``;
766
+ }
767
+ function parseBashRequest(raw) {
768
+ const trimmed = raw.trimStart();
769
+ let restSource = "";
770
+ if (normalizeLowercaseStringOrEmpty(trimmed).startsWith("/bash")) {
771
+ const match = trimmed.match(/^\/bash(?:\s*:\s*|\s+|$)([\s\S]*)$/i);
772
+ if (!match) return null;
773
+ restSource = match[1] ?? "";
774
+ } else if (trimmed.startsWith("!")) {
775
+ restSource = trimmed.slice(1);
776
+ if (restSource.trimStart().startsWith(":")) restSource = restSource.trimStart().slice(1);
777
+ } else return null;
778
+ const rest = restSource.trimStart();
779
+ if (!rest) return { action: "help" };
780
+ const tokenMatch = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
781
+ const token = normalizeOptionalString(tokenMatch?.[1]) ?? "";
782
+ const remainder = normalizeOptionalString(tokenMatch?.[2]) ?? "";
783
+ const lowered = normalizeLowercaseStringOrEmpty(token);
784
+ if (lowered === "poll") return {
785
+ action: "poll",
786
+ sessionId: remainder || void 0
787
+ };
788
+ if (lowered === "stop") return {
789
+ action: "stop",
790
+ sessionId: remainder || void 0
791
+ };
792
+ if (lowered === "help") return { action: "help" };
793
+ return {
794
+ action: "run",
795
+ command: rest
796
+ };
797
+ }
798
+ function resolveRawCommandBody(params) {
799
+ const stripped = stripStructuralPrefixes(params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body ?? "");
800
+ return params.isGroup ? stripMentions(stripped, params.ctx, params.cfg, params.agentId) : stripped;
801
+ }
802
+ function getScopedSession(sessionId) {
803
+ const running = getSession(sessionId);
804
+ if (running && running.scopeKey === CHAT_BASH_SCOPE_KEY) return { running };
805
+ const finished = getFinishedSession(sessionId);
806
+ if (finished && finished.scopeKey === CHAT_BASH_SCOPE_KEY) return { finished };
807
+ return {};
808
+ }
809
+ function ensureActiveJobState() {
810
+ if (!activeJob) return null;
811
+ if (activeJob.state === "starting") return activeJob;
812
+ const { running, finished } = getScopedSession(activeJob.sessionId);
813
+ if (running) return activeJob;
814
+ if (finished) {
815
+ activeJob = null;
816
+ return null;
817
+ }
818
+ activeJob = null;
819
+ return null;
820
+ }
821
+ function attachActiveWatcher(sessionId) {
822
+ if (!activeJob || activeJob.state !== "running") return;
823
+ if (activeJob.sessionId !== sessionId) return;
824
+ if (activeJob.watcherAttached) return;
825
+ const { running } = getScopedSession(sessionId);
826
+ const child = running?.child;
827
+ if (!child) return;
828
+ activeJob.watcherAttached = true;
829
+ child.once("close", () => {
830
+ if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
831
+ });
832
+ }
833
+ function buildUsageReply() {
834
+ return { text: [
835
+ "āš™ļø Usage:",
836
+ "- ! <command>",
837
+ "- !poll | ! poll",
838
+ "- !stop | ! stop",
839
+ "- /bash ... (alias; same subcommands as !)"
840
+ ].join("\n") };
841
+ }
842
+ async function handleBashChatCommand(params) {
843
+ if (!isCommandFlagEnabled(params.cfg, "bash")) return buildDisabledCommandReply({
844
+ label: "bash",
845
+ configKey: "bash",
846
+ docsUrl: "https://docs.genesis.ai/tools/slash-commands#config"
847
+ });
848
+ const agentId = params.agentId ?? resolveSessionAgentId({
849
+ sessionKey: params.sessionKey,
850
+ config: params.cfg
851
+ });
852
+ if (!params.elevated.enabled || !params.elevated.allowed) {
853
+ const runtimeSandboxed = resolveSandboxRuntimeStatus({
854
+ cfg: params.cfg,
855
+ sessionKey: resolveRuntimePolicySessionKey({
856
+ cfg: params.cfg,
857
+ ctx: params.ctx,
858
+ sessionKey: params.sessionKey
859
+ })
860
+ }).sandboxed;
861
+ return { text: formatElevatedUnavailableMessage({
862
+ runtimeSandboxed,
863
+ failures: params.elevated.failures,
864
+ sessionKey: params.sessionKey
865
+ }) };
866
+ }
867
+ const request = parseBashRequest(resolveRawCommandBody({
868
+ ctx: params.ctx,
869
+ cfg: params.cfg,
870
+ agentId,
871
+ isGroup: params.isGroup
872
+ }).trim());
873
+ if (!request) return { text: "āš ļø Unrecognized bash request." };
874
+ const liveJob = ensureActiveJobState();
875
+ if (request.action === "help") return buildUsageReply();
876
+ if (request.action === "poll") {
877
+ const sessionId = normalizeOptionalString(request.sessionId) || (liveJob?.state === "running" ? liveJob.sessionId : "");
878
+ if (!sessionId) return { text: "āš™ļø No active bash job." };
879
+ const { running, finished } = getScopedSession(sessionId);
880
+ if (running) {
881
+ attachActiveWatcher(sessionId);
882
+ const runtimeSec = Math.max(0, Math.floor((Date.now() - running.startedAt) / 1e3));
883
+ const tail = running.tail || "(no output yet)";
884
+ return { text: [
885
+ `āš™ļø bash still running (session ${formatSessionSnippet(sessionId)}, ${runtimeSec}s).`,
886
+ formatOutputBlock(tail),
887
+ "Hint: !stop (or /bash stop)"
888
+ ].join("\n") };
889
+ }
890
+ if (finished) {
891
+ if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
892
+ const exitLabel = finished.exitSignal ? `signal ${String(finished.exitSignal)}` : `code ${String(finished.exitCode ?? 0)}`;
893
+ return { text: [
894
+ `${finished.status === "completed" ? "āš™ļø" : "āš ļø"} bash finished (session ${formatSessionSnippet(sessionId)}).`,
895
+ `Exit: ${exitLabel}`,
896
+ formatOutputBlock(finished.aggregated || finished.tail)
897
+ ].join("\n") };
898
+ }
899
+ if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
900
+ return { text: `āš™ļø No bash session found for ${formatSessionSnippet(sessionId)}.` };
901
+ }
902
+ if (request.action === "stop") {
903
+ const sessionId = normalizeOptionalString(request.sessionId) || (liveJob?.state === "running" ? liveJob.sessionId : "");
904
+ if (!sessionId) return { text: "āš™ļø No active bash job." };
905
+ const { running } = getScopedSession(sessionId);
906
+ if (!running) {
907
+ if (activeJob?.state === "running" && activeJob.sessionId === sessionId) activeJob = null;
908
+ return { text: `āš™ļø No running bash job found for ${formatSessionSnippet(sessionId)}.` };
909
+ }
910
+ if (!running.backgrounded) return { text: `āš ļø Session ${formatSessionSnippet(sessionId)} is not backgrounded.` };
911
+ const pid = running.pid ?? running.child?.pid;
912
+ if (!pid) return { text: `āš ļø Unable to stop bash session ${formatSessionSnippet(sessionId)} because no process ID is available. Use !poll ${sessionId} to check whether it exits on its own.` };
913
+ const { killProcessTree } = await import("./kill-tree-Be-ZU6Ay.js");
914
+ killProcessTree(pid);
915
+ return { text: `āš™ļø bash stopping (session ${formatSessionSnippet(sessionId)}). Use !poll ${sessionId} to confirm exit.` };
916
+ }
917
+ if (liveJob) return { text: `āš ļø A bash job is already running (${liveJob.state === "running" ? formatSessionSnippet(liveJob.sessionId) : "starting"}). Use !poll / !stop (or /bash poll / /bash stop).` };
918
+ const commandText = request.command.trim();
919
+ if (!commandText) return buildUsageReply();
920
+ activeJob = {
921
+ state: "starting",
922
+ startedAt: Date.now(),
923
+ command: commandText
924
+ };
925
+ try {
926
+ const foregroundMs = resolveForegroundMs(params.cfg);
927
+ const shouldBackgroundImmediately = foregroundMs <= 0;
928
+ const timeoutSec = params.cfg.tools?.exec?.timeoutSec;
929
+ const notifyOnExit = params.cfg.tools?.exec?.notifyOnExit;
930
+ const notifyOnExitEmptySuccess = params.cfg.tools?.exec?.notifyOnExitEmptySuccess;
931
+ const result = await createExecTool({
932
+ scopeKey: CHAT_BASH_SCOPE_KEY,
933
+ allowBackground: true,
934
+ timeoutSec,
935
+ sessionKey: params.sessionKey,
936
+ notifyOnExit,
937
+ notifyOnExitEmptySuccess,
938
+ elevated: {
939
+ enabled: params.elevated.enabled,
940
+ allowed: params.elevated.allowed,
941
+ defaultLevel: "on"
942
+ }
943
+ }).execute("chat-bash", {
944
+ command: commandText,
945
+ background: shouldBackgroundImmediately,
946
+ yieldMs: shouldBackgroundImmediately ? void 0 : foregroundMs,
947
+ timeout: timeoutSec,
948
+ elevated: true
949
+ });
950
+ if (result.details?.status === "running") {
951
+ const sessionId = result.details.sessionId;
952
+ activeJob = {
953
+ state: "running",
954
+ sessionId,
955
+ startedAt: result.details.startedAt,
956
+ command: commandText,
957
+ watcherAttached: false
958
+ };
959
+ attachActiveWatcher(sessionId);
960
+ logVerbose(`Started bash session ${formatSessionSnippet(sessionId)}: ${commandText}`);
961
+ return { text: `āš™ļø bash started (session ${sessionId}). Still running; use !poll / !stop (or /bash poll / /bash stop).` };
962
+ }
963
+ activeJob = null;
964
+ const exitCode = result.details?.status === "completed" ? result.details.exitCode : 0;
965
+ const output = result.details?.status === "completed" ? result.details.aggregated : result.content.map((chunk) => chunk.type === "text" ? chunk.text : "").join("\n");
966
+ return { text: [
967
+ `āš™ļø bash: ${commandText}`,
968
+ `Exit: ${exitCode}`,
969
+ formatOutputBlock(output || "(no output)")
970
+ ].join("\n") };
971
+ } catch (err) {
972
+ activeJob = null;
973
+ const message = formatErrorMessage(err);
974
+ return { text: [`āš ļø bash failed: ${commandText}`, formatOutputBlock(message)].join("\n") };
975
+ }
976
+ }
977
+ //#endregion
978
+ //#region src/auto-reply/reply/commands-bash.ts
979
+ const handleBashCommand = async (params, allowTextCommands) => {
980
+ if (!allowTextCommands) return null;
981
+ const { command } = params;
982
+ const bashSlashRequested = command.commandBodyNormalized === "/bash" || command.commandBodyNormalized.startsWith("/bash ");
983
+ const bashBangRequested = command.commandBodyNormalized.startsWith("!");
984
+ if (!bashSlashRequested && !(bashBangRequested && command.isAuthorizedSender)) return null;
985
+ const unauthorized = rejectUnauthorizedCommand(params, "/bash");
986
+ if (unauthorized) return unauthorized;
987
+ const agentId = params.sessionKey ? resolveSessionAgentId({
988
+ sessionKey: params.sessionKey,
989
+ config: params.cfg
990
+ }) : params.agentId;
991
+ return {
992
+ shouldContinue: false,
993
+ reply: await handleBashChatCommand({
994
+ ctx: params.ctx,
995
+ cfg: params.cfg,
996
+ agentId,
997
+ sessionKey: params.sessionKey,
998
+ isGroup: params.isGroup,
999
+ elevated: params.elevated
1000
+ })
1001
+ };
1002
+ };
1003
+ //#endregion
1004
+ //#region src/agents/btw.ts
1005
+ function collectTextContent(content) {
1006
+ return content.filter((part) => part.type === "text").map((part) => part.text).join("");
1007
+ }
1008
+ function collectThinkingContent(content) {
1009
+ return content.filter((part) => part.type === "thinking").map((part) => part.thinking).join("");
1010
+ }
1011
+ function buildBtwSystemPrompt() {
1012
+ return [
1013
+ "You are answering an ephemeral /btw side question about the current conversation.",
1014
+ "Use the conversation only as background context.",
1015
+ "Answer only the side question in the last user message.",
1016
+ "Do not continue, resume, or complete any unfinished task from the conversation.",
1017
+ "Do not emit tool calls, pseudo-tool calls, shell commands, file writes, patches, or code unless the side question explicitly asks for them.",
1018
+ "Do not say you will continue the main task after answering.",
1019
+ "If the question can be answered briefly, answer briefly."
1020
+ ].join("\n");
1021
+ }
1022
+ function buildBtwQuestionPrompt(question, inFlightPrompt) {
1023
+ const lines = ["Answer this side question only.", "Ignore any unfinished task in the conversation while answering it."];
1024
+ const trimmedPrompt = inFlightPrompt?.trim();
1025
+ if (trimmedPrompt) lines.push("", "Current in-flight main task request for background context only:", "<in_flight_main_task>", trimmedPrompt, "</in_flight_main_task>", "Do not continue or complete that task while answering the side question.");
1026
+ lines.push("", "<btw_side_question>", question.trim(), "</btw_side_question>");
1027
+ return lines.join("\n");
1028
+ }
1029
+ function normalizeBtwContentBlocks(content) {
1030
+ if (Array.isArray(content)) return content;
1031
+ if (content && typeof content === "object") return [content];
1032
+ }
1033
+ function isBtwTextBlock(block) {
1034
+ if (!block || typeof block !== "object") return false;
1035
+ const record = block;
1036
+ return normalizeLowercaseStringOrEmpty(record.type) === "text" && typeof record.text === "string";
1037
+ }
1038
+ function isBtwImageBlock(block) {
1039
+ if (!block || typeof block !== "object") return false;
1040
+ const record = block;
1041
+ return normalizeLowercaseStringOrEmpty(record.type) === "image" && typeof record.data === "string" && typeof record.mimeType === "string";
1042
+ }
1043
+ async function sanitizeBtwUserMessage(params) {
1044
+ if (typeof params.message.content === "string") return params.message;
1045
+ const blocks = normalizeBtwContentBlocks(params.message.content);
1046
+ if (!blocks) return;
1047
+ const content = [];
1048
+ for (const block of blocks) {
1049
+ if (isBtwTextBlock(block)) {
1050
+ content.push({
1051
+ type: "text",
1052
+ text: block.text
1053
+ });
1054
+ continue;
1055
+ }
1056
+ if (!isBtwImageBlock(block)) continue;
1057
+ const { images } = await sanitizeImageBlocks([block], "btw:context", params.imageLimits);
1058
+ const image = images[0];
1059
+ if (image) content.push(image);
1060
+ }
1061
+ if (content.length === 0) return;
1062
+ return {
1063
+ ...params.message,
1064
+ content
1065
+ };
1066
+ }
1067
+ function sanitizeBtwAssistantMessage(message) {
1068
+ const rawContent = message.content;
1069
+ if (typeof rawContent === "string") {
1070
+ const trimmed = rawContent.trim();
1071
+ return trimmed.length > 0 ? {
1072
+ ...message,
1073
+ content: [{
1074
+ type: "text",
1075
+ text: trimmed
1076
+ }]
1077
+ } : void 0;
1078
+ }
1079
+ const blocks = normalizeBtwContentBlocks(rawContent);
1080
+ if (!blocks) return;
1081
+ const content = blocks.flatMap((block) => isBtwTextBlock(block) ? [{
1082
+ type: "text",
1083
+ text: block.text
1084
+ }] : []);
1085
+ if (content.length === 0) return;
1086
+ return {
1087
+ ...message,
1088
+ content
1089
+ };
1090
+ }
1091
+ async function toSimpleContextMessages(params) {
1092
+ const contextMessages = [];
1093
+ for (const message of params.messages) {
1094
+ if (!message || typeof message !== "object") continue;
1095
+ const role = message.role;
1096
+ if (role === "user") {
1097
+ const sanitizedMessage = await sanitizeBtwUserMessage({
1098
+ message,
1099
+ imageLimits: params.imageLimits
1100
+ });
1101
+ if (sanitizedMessage) contextMessages.push(sanitizedMessage);
1102
+ continue;
1103
+ }
1104
+ if (role !== "assistant") continue;
1105
+ const sanitizedMessage = sanitizeBtwAssistantMessage(message);
1106
+ if (sanitizedMessage) contextMessages.push(sanitizedMessage);
1107
+ }
1108
+ return stripToolResultDetails(contextMessages);
1109
+ }
1110
+ function resolveSessionTranscriptPath(params) {
1111
+ try {
1112
+ const agentId = params.sessionKey?.split(":")[1];
1113
+ const pathOpts = resolveSessionFilePathOptions({
1114
+ agentId,
1115
+ storePath: params.storePath
1116
+ });
1117
+ return resolveSessionFilePath(params.sessionId, params.sessionEntry, pathOpts);
1118
+ } catch (error) {
1119
+ diagnosticLogger.debug(`resolveSessionTranscriptPath failed: sessionId=${params.sessionId} err=${String(error)}`);
1120
+ return;
1121
+ }
1122
+ }
1123
+ async function resolveRuntimeModel(params) {
1124
+ await ensureGenesisModelsJson(params.cfg, params.agentDir);
1125
+ const modelRegistry = discoverModels(discoverAuthStorage(params.agentDir), params.agentDir);
1126
+ const model = resolveModelWithRegistry({
1127
+ provider: params.provider,
1128
+ modelId: params.model,
1129
+ modelRegistry,
1130
+ cfg: params.cfg
1131
+ });
1132
+ if (!model) throw new Error(`Unknown model: ${params.provider}/${params.model}`);
1133
+ return {
1134
+ model,
1135
+ authProfileId: await resolveSessionAuthProfileOverride({
1136
+ cfg: params.cfg,
1137
+ provider: params.provider,
1138
+ agentDir: params.agentDir,
1139
+ sessionEntry: params.sessionEntry,
1140
+ sessionStore: params.sessionStore,
1141
+ sessionKey: params.sessionKey,
1142
+ storePath: params.storePath,
1143
+ isNewSession: params.isNewSession
1144
+ }),
1145
+ authProfileIdSource: params.sessionEntry?.authProfileOverrideSource
1146
+ };
1147
+ }
1148
+ async function runBtwSideQuestion(params) {
1149
+ const sessionId = params.sessionEntry.sessionId?.trim();
1150
+ if (!sessionId) throw new Error("No active session context.");
1151
+ const sessionFile = resolveSessionTranscriptPath({
1152
+ sessionId,
1153
+ sessionEntry: params.sessionEntry,
1154
+ sessionKey: params.sessionKey,
1155
+ storePath: params.storePath
1156
+ });
1157
+ if (!sessionFile) throw new Error("No active session transcript.");
1158
+ const sessionManager = SessionManager.open(sessionFile);
1159
+ const activeRunSnapshot = getActiveEmbeddedRunSnapshot(sessionId);
1160
+ const imageLimits = resolveImageSanitizationLimits(params.cfg);
1161
+ let messages = [];
1162
+ let inFlightPrompt;
1163
+ if (Array.isArray(activeRunSnapshot?.messages) && activeRunSnapshot.messages.length > 0) {
1164
+ messages = await toSimpleContextMessages({
1165
+ messages: activeRunSnapshot.messages,
1166
+ imageLimits
1167
+ });
1168
+ inFlightPrompt = activeRunSnapshot.inFlightPrompt;
1169
+ } else if (activeRunSnapshot) {
1170
+ inFlightPrompt = activeRunSnapshot.inFlightPrompt;
1171
+ if (activeRunSnapshot.transcriptLeafId && sessionManager.branch) try {
1172
+ sessionManager.branch(activeRunSnapshot.transcriptLeafId);
1173
+ } catch (error) {
1174
+ diagnosticLogger.debug(`btw snapshot leaf unavailable: sessionId=${sessionId} leaf=${activeRunSnapshot.transcriptLeafId} err=${String(error)}`);
1175
+ sessionManager.resetLeaf?.();
1176
+ }
1177
+ else sessionManager.resetLeaf?.();
1178
+ } else {
1179
+ const leafEntry = sessionManager.getLeafEntry?.();
1180
+ if (leafEntry?.type === "message" && leafEntry.message?.role === "user") if (leafEntry.parentId && sessionManager.branch) sessionManager.branch(leafEntry.parentId);
1181
+ else sessionManager.resetLeaf?.();
1182
+ }
1183
+ if (messages.length === 0) {
1184
+ const sessionContext = sessionManager.buildSessionContext();
1185
+ messages = await toSimpleContextMessages({
1186
+ messages: Array.isArray(sessionContext.messages) ? sessionContext.messages : [],
1187
+ imageLimits
1188
+ });
1189
+ }
1190
+ if (messages.length === 0 && !inFlightPrompt?.trim()) throw new Error("No active session context.");
1191
+ const { model, authProfileId } = await resolveRuntimeModel({
1192
+ cfg: params.cfg,
1193
+ provider: params.provider,
1194
+ model: params.model,
1195
+ agentDir: params.agentDir,
1196
+ sessionEntry: params.sessionEntry,
1197
+ sessionStore: params.sessionStore,
1198
+ sessionKey: params.sessionKey,
1199
+ storePath: params.storePath,
1200
+ isNewSession: params.isNewSession
1201
+ });
1202
+ const apiKeyInfo = await getApiKeyForModel({
1203
+ model,
1204
+ cfg: params.cfg,
1205
+ profileId: authProfileId,
1206
+ agentDir: params.agentDir
1207
+ });
1208
+ let runtimeModel = model;
1209
+ let apiKey = apiKeyInfo.mode === "aws-sdk" && !apiKeyInfo.apiKey ? void 0 : requireApiKey(apiKeyInfo, model.provider);
1210
+ const sessionAgentId = resolveSessionAgentId({
1211
+ sessionKey: params.sessionKey,
1212
+ config: params.cfg
1213
+ });
1214
+ const workspaceDir = resolveAgentWorkspaceDir(params.cfg, sessionAgentId);
1215
+ if (apiKey) {
1216
+ const preparedAuth = await prepareProviderRuntimeAuth({
1217
+ provider: model.provider,
1218
+ config: params.cfg,
1219
+ workspaceDir,
1220
+ env: process.env,
1221
+ context: {
1222
+ config: params.cfg,
1223
+ agentDir: params.agentDir,
1224
+ workspaceDir,
1225
+ env: process.env,
1226
+ provider: model.provider,
1227
+ modelId: model.id,
1228
+ model,
1229
+ apiKey,
1230
+ authMode: apiKeyInfo.mode,
1231
+ profileId: authProfileId
1232
+ }
1233
+ });
1234
+ if (preparedAuth?.baseUrl) runtimeModel = {
1235
+ ...runtimeModel,
1236
+ baseUrl: preparedAuth.baseUrl
1237
+ };
1238
+ if (preparedAuth?.apiKey) apiKey = preparedAuth.apiKey;
1239
+ }
1240
+ const providerStreamFn = registerProviderStreamForModel({
1241
+ model: runtimeModel,
1242
+ cfg: params.cfg,
1243
+ agentDir: params.agentDir,
1244
+ workspaceDir,
1245
+ env: process.env
1246
+ });
1247
+ const chunker = params.opts?.onBlockReply && params.blockReplyChunking ? new EmbeddedBlockChunker(params.blockReplyChunking) : void 0;
1248
+ let emittedBlocks = 0;
1249
+ let blockEmitChain = Promise.resolve();
1250
+ let answerText = "";
1251
+ let reasoningText = "";
1252
+ let assistantStarted = false;
1253
+ let sawTextEvent = false;
1254
+ const emitBlockChunk = async (text) => {
1255
+ if (!text.trim() || !params.opts?.onBlockReply) return;
1256
+ emittedBlocks += 1;
1257
+ blockEmitChain = blockEmitChain.then(async () => {
1258
+ await params.opts?.onBlockReply?.({
1259
+ text,
1260
+ btw: { question: params.question }
1261
+ });
1262
+ });
1263
+ await blockEmitChain;
1264
+ };
1265
+ const stream = await streamWithPayloadPatch(providerStreamFn ?? streamSimple, runtimeModel, {
1266
+ systemPrompt: buildBtwSystemPrompt(),
1267
+ messages: [...messages, {
1268
+ role: "user",
1269
+ content: [{
1270
+ type: "text",
1271
+ text: buildBtwQuestionPrompt(params.question, inFlightPrompt)
1272
+ }],
1273
+ timestamp: Date.now()
1274
+ }]
1275
+ }, {
1276
+ apiKey,
1277
+ reasoning: void 0,
1278
+ signal: params.opts?.abortSignal
1279
+ }, (payloadObj) => {
1280
+ if (Array.isArray(payloadObj.tools) && payloadObj.tools.length === 0) delete payloadObj.tools;
1281
+ });
1282
+ let finalEvent;
1283
+ for await (const event of stream) {
1284
+ finalEvent = event.type === "done" || event.type === "error" ? event : finalEvent;
1285
+ if (!assistantStarted && (event.type === "text_start" || event.type === "start")) {
1286
+ assistantStarted = true;
1287
+ await params.opts?.onAssistantMessageStart?.();
1288
+ }
1289
+ if (event.type === "text_delta") {
1290
+ sawTextEvent = true;
1291
+ answerText += event.delta;
1292
+ chunker?.append(event.delta);
1293
+ if (chunker && params.resolvedBlockStreamingBreak === "text_end") chunker.drain({
1294
+ force: false,
1295
+ emit: (chunk) => void emitBlockChunk(chunk)
1296
+ });
1297
+ continue;
1298
+ }
1299
+ if (event.type === "text_end" && chunker && params.resolvedBlockStreamingBreak === "text_end") {
1300
+ chunker.drain({
1301
+ force: true,
1302
+ emit: (chunk) => void emitBlockChunk(chunk)
1303
+ });
1304
+ continue;
1305
+ }
1306
+ if (event.type === "thinking_delta") {
1307
+ reasoningText += event.delta;
1308
+ if (params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningStream?.({
1309
+ text: reasoningText,
1310
+ isReasoning: true
1311
+ });
1312
+ continue;
1313
+ }
1314
+ if (event.type === "thinking_end" && params.resolvedReasoningLevel !== "off") await params.opts?.onReasoningEnd?.();
1315
+ }
1316
+ if (chunker && params.resolvedBlockStreamingBreak !== "text_end" && chunker.hasBuffered()) chunker.drain({
1317
+ force: true,
1318
+ emit: (chunk) => void emitBlockChunk(chunk)
1319
+ });
1320
+ await blockEmitChain;
1321
+ if (finalEvent?.type === "error") {
1322
+ const message = collectTextContent(finalEvent.error.content);
1323
+ throw new Error(message || finalEvent.error.errorMessage || "BTW failed.");
1324
+ }
1325
+ const finalMessage = finalEvent?.type === "done" ? finalEvent.message : void 0;
1326
+ if (finalMessage) {
1327
+ if (!sawTextEvent) answerText = collectTextContent(finalMessage.content);
1328
+ if (!reasoningText) reasoningText = collectThinkingContent(finalMessage.content);
1329
+ }
1330
+ const answer = answerText.trim();
1331
+ if (!answer) throw new Error("No BTW response generated.");
1332
+ if (emittedBlocks > 0) return;
1333
+ return { text: answer };
1334
+ }
1335
+ //#endregion
1336
+ //#region src/auto-reply/reply/commands-btw.ts
1337
+ const BTW_USAGE = "Usage: /btw <side question>";
1338
+ const handleBtwCommand = async (params, allowTextCommands) => {
1339
+ if (!allowTextCommands) return null;
1340
+ const question = extractBtwQuestion(params.command.commandBodyNormalized);
1341
+ if (question === null) return null;
1342
+ const unauthorized = rejectUnauthorizedCommand(params, "/btw");
1343
+ if (unauthorized) return unauthorized;
1344
+ if (!question) return {
1345
+ shouldContinue: false,
1346
+ reply: { text: BTW_USAGE }
1347
+ };
1348
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
1349
+ if (!targetSessionEntry?.sessionId) return {
1350
+ shouldContinue: false,
1351
+ reply: { text: "āš ļø /btw requires an active session with existing context." }
1352
+ };
1353
+ const sessionAgentId = params.sessionKey ? resolveSessionAgentId({
1354
+ sessionKey: params.sessionKey,
1355
+ config: params.cfg
1356
+ }) : params.agentId;
1357
+ const agentDir = (sessionAgentId ? resolveAgentDir(params.cfg, sessionAgentId) : void 0) ?? params.agentDir;
1358
+ if (!agentDir) return {
1359
+ shouldContinue: false,
1360
+ reply: { text: "āš ļø /btw is unavailable because the active agent directory could not be resolved." }
1361
+ };
1362
+ try {
1363
+ await params.typing?.startTypingLoop();
1364
+ const reply = await runBtwSideQuestion({
1365
+ cfg: params.cfg,
1366
+ agentDir,
1367
+ provider: params.provider,
1368
+ model: params.model,
1369
+ question,
1370
+ sessionEntry: targetSessionEntry,
1371
+ sessionStore: params.sessionStore,
1372
+ sessionKey: params.sessionKey,
1373
+ storePath: params.storePath,
1374
+ resolvedThinkLevel: "off",
1375
+ resolvedReasoningLevel: "off",
1376
+ blockReplyChunking: params.blockReplyChunking,
1377
+ resolvedBlockStreamingBreak: params.resolvedBlockStreamingBreak,
1378
+ opts: params.opts,
1379
+ isNewSession: false
1380
+ });
1381
+ return {
1382
+ shouldContinue: false,
1383
+ reply: reply ? {
1384
+ ...reply,
1385
+ btw: { question }
1386
+ } : reply
1387
+ };
1388
+ } catch (error) {
1389
+ const message = error instanceof Error ? error.message.trim() : "";
1390
+ return {
1391
+ shouldContinue: false,
1392
+ reply: {
1393
+ text: `āš ļø /btw failed${message ? `: ${message}` : "."}`,
1394
+ btw: { question },
1395
+ isError: true
1396
+ }
1397
+ };
1398
+ }
1399
+ };
1400
+ //#endregion
1401
+ //#region src/auto-reply/reply/commands-compact.ts
1402
+ let compactRuntimePromise = null;
1403
+ function loadCompactRuntime() {
1404
+ compactRuntimePromise ??= import("./commands-compact.runtime-BIHG2RSY.js");
1405
+ return compactRuntimePromise;
1406
+ }
1407
+ function extractCompactInstructions(params) {
1408
+ const raw = stripStructuralPrefixes(params.rawBody ?? "");
1409
+ const trimmed = (params.isGroup ? stripMentions(raw, params.ctx, params.cfg, params.agentId) : raw).trim();
1410
+ if (!trimmed) return;
1411
+ const prefix = normalizeLowercaseStringOrEmpty(trimmed).startsWith("/compact") ? "/compact" : null;
1412
+ if (!prefix) return;
1413
+ let rest = trimmed.slice(prefix.length).trimStart();
1414
+ if (rest.startsWith(":")) rest = rest.slice(1).trimStart();
1415
+ return rest.length ? rest : void 0;
1416
+ }
1417
+ function isCompactionSkipReason(reason) {
1418
+ const text = normalizeOptionalLowercaseString(reason) ?? "";
1419
+ return text.includes("nothing to compact") || text.includes("below threshold") || text.includes("already compacted") || text.includes("no real conversation messages");
1420
+ }
1421
+ function formatCompactionReason(reason) {
1422
+ const text = normalizeOptionalString(reason);
1423
+ if (!text) return;
1424
+ const lower = normalizeLowercaseStringOrEmpty(text);
1425
+ if (lower.includes("nothing to compact")) return "nothing compactable in this session yet";
1426
+ if (lower.includes("below threshold")) return "context is below the compaction threshold";
1427
+ if (lower.includes("already compacted")) return "session was already compacted recently";
1428
+ if (lower.includes("no real conversation messages")) return "no real conversation messages yet";
1429
+ return text;
1430
+ }
1431
+ const handleCompactCommand = async (params) => {
1432
+ if (!(params.command.commandBodyNormalized === "/compact" || params.command.commandBodyNormalized.startsWith("/compact "))) return null;
1433
+ if (!params.command.isAuthorizedSender) {
1434
+ logVerbose(`Ignoring /compact from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
1435
+ return { shouldContinue: false };
1436
+ }
1437
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
1438
+ if (!targetSessionEntry?.sessionId) return {
1439
+ shouldContinue: false,
1440
+ reply: { text: "āš™ļø Compaction unavailable (missing session id)." }
1441
+ };
1442
+ const runtime = await loadCompactRuntime();
1443
+ const sessionId = targetSessionEntry.sessionId;
1444
+ if (runtime.isEmbeddedPiRunActive(sessionId)) {
1445
+ runtime.abortEmbeddedPiRun(sessionId);
1446
+ await runtime.waitForEmbeddedPiRunEnd(sessionId, 15e3);
1447
+ }
1448
+ const sessionAgentId = params.sessionKey ? resolveSessionAgentId({
1449
+ sessionKey: params.sessionKey,
1450
+ config: params.cfg
1451
+ }) : params.agentId ?? "main";
1452
+ const sessionAgentDir = sessionAgentId === (params.agentId ?? "main") && params.agentDir ? params.agentDir : resolveAgentDir(params.cfg, sessionAgentId);
1453
+ const customInstructions = extractCompactInstructions({
1454
+ rawBody: params.ctx.CommandBody ?? params.ctx.RawBody ?? params.ctx.Body,
1455
+ ctx: params.ctx,
1456
+ cfg: params.cfg,
1457
+ agentId: sessionAgentId,
1458
+ isGroup: params.isGroup
1459
+ });
1460
+ const result = await runtime.compactEmbeddedPiSession({
1461
+ sessionId,
1462
+ sessionKey: params.sessionKey,
1463
+ allowGatewaySubagentBinding: true,
1464
+ messageChannel: params.command.channel,
1465
+ groupId: targetSessionEntry.groupId,
1466
+ groupChannel: targetSessionEntry.groupChannel,
1467
+ groupSpace: targetSessionEntry.space,
1468
+ spawnedBy: targetSessionEntry.spawnedBy,
1469
+ senderId: params.command.senderId,
1470
+ senderName: params.ctx.SenderName,
1471
+ senderUsername: params.ctx.SenderUsername,
1472
+ senderE164: params.ctx.SenderE164,
1473
+ sessionFile: runtime.resolveSessionFilePath(sessionId, targetSessionEntry, runtime.resolveSessionFilePathOptions({
1474
+ agentId: sessionAgentId,
1475
+ storePath: params.storePath
1476
+ })),
1477
+ workspaceDir: params.workspaceDir,
1478
+ agentDir: sessionAgentDir,
1479
+ config: params.cfg,
1480
+ skillsSnapshot: targetSessionEntry.skillsSnapshot,
1481
+ provider: params.provider,
1482
+ model: params.model,
1483
+ agentHarnessId: targetSessionEntry.sessionId === sessionId ? targetSessionEntry.agentHarnessId : void 0,
1484
+ thinkLevel: params.resolvedThinkLevel ?? await params.resolveDefaultThinkingLevel(),
1485
+ bashElevated: {
1486
+ enabled: false,
1487
+ allowed: false,
1488
+ defaultLevel: "off"
1489
+ },
1490
+ customInstructions,
1491
+ trigger: "manual",
1492
+ senderIsOwner: params.command.senderIsOwner,
1493
+ ownerNumbers: params.command.ownerList.length > 0 ? params.command.ownerList : void 0
1494
+ });
1495
+ const compactLabel = result.ok || isCompactionSkipReason(result.reason) ? result.compacted ? result.result?.tokensBefore != null && result.result?.tokensAfter != null ? `Compacted (${runtime.formatTokenCount(result.result.tokensBefore)} → ${runtime.formatTokenCount(result.result.tokensAfter)})` : result.result?.tokensBefore ? `Compacted (${runtime.formatTokenCount(result.result.tokensBefore)} before)` : "Compacted" : "Compaction skipped" : "Compaction failed";
1496
+ if (result.ok && result.compacted) await runtime.incrementCompactionCount({
1497
+ cfg: params.cfg,
1498
+ sessionEntry: targetSessionEntry,
1499
+ sessionStore: params.sessionStore,
1500
+ sessionKey: params.sessionKey,
1501
+ storePath: params.storePath,
1502
+ tokensAfter: result.result?.tokensAfter
1503
+ });
1504
+ const totalTokens = result.result?.tokensAfter ?? runtime.resolveFreshSessionTotalTokens(targetSessionEntry);
1505
+ const contextSummary = runtime.formatContextUsageShort(typeof totalTokens === "number" && totalTokens > 0 ? totalTokens : null, params.contextTokens ?? targetSessionEntry.contextTokens ?? null);
1506
+ const reason = formatCompactionReason(result.reason);
1507
+ const line = reason ? `${compactLabel}: ${reason} • ${contextSummary}` : `${compactLabel} • ${contextSummary}`;
1508
+ runtime.enqueueSystemEvent(line, { sessionKey: params.sessionKey });
1509
+ return {
1510
+ shouldContinue: false,
1511
+ reply: { text: `āš™ļø ${line}` }
1512
+ };
1513
+ };
1514
+ //#endregion
1515
+ //#region src/auto-reply/reply/commands-slash-parse.ts
1516
+ function parseSlashCommandActionArgs(raw, slash) {
1517
+ const trimmed = raw.trim();
1518
+ const slashLower = normalizeLowercaseStringOrEmpty(slash);
1519
+ if (!normalizeLowercaseStringOrEmpty(trimmed).startsWith(slashLower)) return { kind: "no-match" };
1520
+ const rest = trimmed.slice(slash.length).trim();
1521
+ if (!rest) return { kind: "empty" };
1522
+ const match = rest.match(/^(\S+)(?:\s+([\s\S]+))?$/);
1523
+ if (!match) return { kind: "invalid" };
1524
+ return {
1525
+ kind: "parsed",
1526
+ action: normalizeLowercaseStringOrEmpty(match[1]),
1527
+ args: (match[2] ?? "").trim()
1528
+ };
1529
+ }
1530
+ function parseSlashCommandOrNull(raw, slash, opts) {
1531
+ const parsed = parseSlashCommandActionArgs(raw, slash);
1532
+ if (parsed.kind === "no-match") return null;
1533
+ if (parsed.kind === "invalid") return {
1534
+ ok: false,
1535
+ message: opts.invalidMessage
1536
+ };
1537
+ if (parsed.kind === "empty") return {
1538
+ ok: true,
1539
+ action: opts.defaultAction ?? "show",
1540
+ args: ""
1541
+ };
1542
+ return {
1543
+ ok: true,
1544
+ action: parsed.action,
1545
+ args: parsed.args
1546
+ };
1547
+ }
1548
+ //#endregion
1549
+ //#region src/auto-reply/reply/commands-setunset.ts
1550
+ function parseSetUnsetCommand(params) {
1551
+ const action = params.action;
1552
+ const args = params.args.trim();
1553
+ if (action === "unset") {
1554
+ if (!args) return {
1555
+ kind: "error",
1556
+ message: `Usage: ${params.slash} unset path`
1557
+ };
1558
+ return {
1559
+ kind: "unset",
1560
+ path: args
1561
+ };
1562
+ }
1563
+ if (!args) return {
1564
+ kind: "error",
1565
+ message: `Usage: ${params.slash} set path=value`
1566
+ };
1567
+ const eqIndex = args.indexOf("=");
1568
+ if (eqIndex <= 0) return {
1569
+ kind: "error",
1570
+ message: `Usage: ${params.slash} set path=value`
1571
+ };
1572
+ const path = args.slice(0, eqIndex).trim();
1573
+ const rawValue = args.slice(eqIndex + 1);
1574
+ if (!path) return {
1575
+ kind: "error",
1576
+ message: `Usage: ${params.slash} set path=value`
1577
+ };
1578
+ const parsed = parseConfigValue(rawValue);
1579
+ if (parsed.error) return {
1580
+ kind: "error",
1581
+ message: parsed.error
1582
+ };
1583
+ return {
1584
+ kind: "set",
1585
+ path,
1586
+ value: parsed.value
1587
+ };
1588
+ }
1589
+ function parseSetUnsetCommandAction(params) {
1590
+ if (params.action !== "set" && params.action !== "unset") return null;
1591
+ const parsed = parseSetUnsetCommand({
1592
+ slash: params.slash,
1593
+ action: params.action,
1594
+ args: params.args
1595
+ });
1596
+ if (parsed.kind === "error") return params.onError(parsed.message);
1597
+ return parsed.kind === "set" ? params.onSet(parsed.path, parsed.value) : params.onUnset(parsed.path);
1598
+ }
1599
+ function parseSlashCommandWithSetUnset(params) {
1600
+ const parsed = parseSlashCommandOrNull(params.raw, params.slash, { invalidMessage: params.invalidMessage });
1601
+ if (!parsed) return null;
1602
+ if (!parsed.ok) return params.onError(parsed.message);
1603
+ const { action, args } = parsed;
1604
+ const setUnset = parseSetUnsetCommandAction({
1605
+ slash: params.slash,
1606
+ action,
1607
+ args,
1608
+ onSet: params.onSet,
1609
+ onUnset: params.onUnset,
1610
+ onError: params.onError
1611
+ });
1612
+ if (setUnset) return setUnset;
1613
+ const knownAction = params.onKnownAction(action, args);
1614
+ if (knownAction) return knownAction;
1615
+ return params.onError(params.usageMessage);
1616
+ }
1617
+ //#endregion
1618
+ //#region src/auto-reply/reply/commands-setunset-standard.ts
1619
+ function parseStandardSetUnsetSlashCommand(params) {
1620
+ return parseSlashCommandWithSetUnset({
1621
+ raw: params.raw,
1622
+ slash: params.slash,
1623
+ invalidMessage: params.invalidMessage,
1624
+ usageMessage: params.usageMessage,
1625
+ onKnownAction: params.onKnownAction,
1626
+ onSet: params.onSet ?? ((path, value) => ({
1627
+ action: "set",
1628
+ path,
1629
+ value
1630
+ })),
1631
+ onUnset: params.onUnset ?? ((path) => ({
1632
+ action: "unset",
1633
+ path
1634
+ })),
1635
+ onError: params.onError ?? ((message) => ({
1636
+ action: "error",
1637
+ message
1638
+ }))
1639
+ });
1640
+ }
1641
+ //#endregion
1642
+ //#region src/auto-reply/reply/config-commands.ts
1643
+ function parseConfigCommand(raw) {
1644
+ return parseStandardSetUnsetSlashCommand({
1645
+ raw,
1646
+ slash: "/config",
1647
+ invalidMessage: "Invalid /config syntax.",
1648
+ usageMessage: "Usage: /config show|set|unset",
1649
+ onKnownAction: (action, args) => {
1650
+ if (action === "show" || action === "get") return {
1651
+ action: "show",
1652
+ path: args || void 0
1653
+ };
1654
+ }
1655
+ });
1656
+ }
1657
+ //#endregion
1658
+ //#region src/auto-reply/reply/debug-commands.ts
1659
+ function parseDebugCommand(raw) {
1660
+ return parseStandardSetUnsetSlashCommand({
1661
+ raw,
1662
+ slash: "/debug",
1663
+ invalidMessage: "Invalid /debug syntax.",
1664
+ usageMessage: "Usage: /debug show|set|unset|reset",
1665
+ onKnownAction: (action) => {
1666
+ if (action === "show") return { action: "show" };
1667
+ if (action === "reset") return { action: "reset" };
1668
+ }
1669
+ });
1670
+ }
1671
+ //#endregion
1672
+ //#region src/auto-reply/reply/commands-config.ts
1673
+ const handleConfigCommand = async (params, allowTextCommands) => {
1674
+ if (!allowTextCommands) return null;
1675
+ const configCommand = parseConfigCommand(params.command.commandBodyNormalized);
1676
+ if (!configCommand) return null;
1677
+ const unauthorized = rejectUnauthorizedCommand(params, "/config");
1678
+ if (unauthorized) return unauthorized;
1679
+ const nonOwner = configCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/config");
1680
+ if (nonOwner) return nonOwner;
1681
+ const disabled = requireCommandFlagEnabled(params.cfg, {
1682
+ label: "/config",
1683
+ configKey: "config"
1684
+ });
1685
+ if (disabled) return disabled;
1686
+ if (configCommand.action === "error") return {
1687
+ shouldContinue: false,
1688
+ reply: { text: `āš ļø ${configCommand.message}` }
1689
+ };
1690
+ let parsedWritePath;
1691
+ if (configCommand.action === "set" || configCommand.action === "unset") {
1692
+ const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
1693
+ label: "/config write",
1694
+ allowedScopes: ["operator.admin"],
1695
+ missingText: "āŒ /config set|unset requires operator.admin for gateway clients."
1696
+ });
1697
+ if (missingAdminScope) return missingAdminScope;
1698
+ const parsedPath = parseConfigPath(configCommand.path);
1699
+ if (!parsedPath.ok || !parsedPath.path) return {
1700
+ shouldContinue: false,
1701
+ reply: { text: `āš ļø ${parsedPath.error ?? "Invalid path."}` }
1702
+ };
1703
+ parsedWritePath = parsedPath.path;
1704
+ const channelId = params.command.channelId ?? normalizeChannelId(params.command.channel);
1705
+ const deniedText = resolveConfigWriteDeniedText({
1706
+ cfg: params.cfg,
1707
+ channel: params.command.channel,
1708
+ channelId,
1709
+ accountId: resolveChannelAccountId({
1710
+ cfg: params.cfg,
1711
+ ctx: params.ctx,
1712
+ command: params.command
1713
+ }),
1714
+ gatewayClientScopes: params.ctx.GatewayClientScopes,
1715
+ target: resolveConfigWriteTargetFromPath(parsedWritePath)
1716
+ });
1717
+ if (deniedText) return {
1718
+ shouldContinue: false,
1719
+ reply: { text: deniedText }
1720
+ };
1721
+ }
1722
+ const snapshot = await readConfigFileSnapshot();
1723
+ if (!snapshot.valid || !snapshot.parsed || typeof snapshot.parsed !== "object") return {
1724
+ shouldContinue: false,
1725
+ reply: { text: "āš ļø Config file is invalid; fix it before using /config." }
1726
+ };
1727
+ const parsedBase = structuredClone(snapshot.parsed);
1728
+ if (configCommand.action === "show") {
1729
+ const pathRaw = normalizeOptionalString(configCommand.path);
1730
+ if (pathRaw) {
1731
+ const parsedPath = parseConfigPath(pathRaw);
1732
+ if (!parsedPath.ok || !parsedPath.path) return {
1733
+ shouldContinue: false,
1734
+ reply: { text: `āš ļø ${parsedPath.error ?? "Invalid path."}` }
1735
+ };
1736
+ const value = getConfigValueAtPath(parsedBase, parsedPath.path);
1737
+ return {
1738
+ shouldContinue: false,
1739
+ reply: { text: `āš™ļø Config ${pathRaw}:\n\`\`\`json\n${JSON.stringify(value ?? null, null, 2)}\n\`\`\`` }
1740
+ };
1741
+ }
1742
+ return {
1743
+ shouldContinue: false,
1744
+ reply: { text: `āš™ļø Config (raw):\n\`\`\`json\n${JSON.stringify(parsedBase, null, 2)}\n\`\`\`` }
1745
+ };
1746
+ }
1747
+ if (configCommand.action === "unset") {
1748
+ if (!unsetConfigValueAtPath(parsedBase, parsedWritePath ?? [])) return {
1749
+ shouldContinue: false,
1750
+ reply: { text: `āš™ļø No config value found for ${configCommand.path}.` }
1751
+ };
1752
+ const validated = validateConfigObjectWithPlugins(parsedBase);
1753
+ if (!validated.ok) {
1754
+ const issue = validated.issues[0];
1755
+ return {
1756
+ shouldContinue: false,
1757
+ reply: { text: `āš ļø Config invalid after unset (${issue.path}: ${issue.message}).` }
1758
+ };
1759
+ }
1760
+ await writeConfigFile(validated.config);
1761
+ return {
1762
+ shouldContinue: false,
1763
+ reply: { text: `āš™ļø Config updated: ${configCommand.path} removed.` }
1764
+ };
1765
+ }
1766
+ if (configCommand.action === "set") {
1767
+ setConfigValueAtPath(parsedBase, parsedWritePath ?? [], configCommand.value);
1768
+ const validated = validateConfigObjectWithPlugins(parsedBase);
1769
+ if (!validated.ok) {
1770
+ const issue = validated.issues[0];
1771
+ return {
1772
+ shouldContinue: false,
1773
+ reply: { text: `āš ļø Config invalid after set (${issue.path}: ${issue.message}).` }
1774
+ };
1775
+ }
1776
+ await writeConfigFile(validated.config);
1777
+ const valueLabel = typeof configCommand.value === "string" ? `"${configCommand.value}"` : JSON.stringify(configCommand.value);
1778
+ return {
1779
+ shouldContinue: false,
1780
+ reply: { text: `āš™ļø Config updated: ${configCommand.path}=${valueLabel ?? "null"}` }
1781
+ };
1782
+ }
1783
+ return null;
1784
+ };
1785
+ const handleDebugCommand = async (params, allowTextCommands) => {
1786
+ if (!allowTextCommands) return null;
1787
+ const debugCommand = parseDebugCommand(params.command.commandBodyNormalized);
1788
+ if (!debugCommand) return null;
1789
+ const unauthorized = rejectUnauthorizedCommand(params, "/debug");
1790
+ if (unauthorized) return unauthorized;
1791
+ const nonOwner = rejectNonOwnerCommand(params, "/debug");
1792
+ if (nonOwner) return nonOwner;
1793
+ const disabled = requireCommandFlagEnabled(params.cfg, {
1794
+ label: "/debug",
1795
+ configKey: "debug"
1796
+ });
1797
+ if (disabled) return disabled;
1798
+ if (debugCommand.action === "error") return {
1799
+ shouldContinue: false,
1800
+ reply: { text: `āš ļø ${debugCommand.message}` }
1801
+ };
1802
+ if (debugCommand.action === "show") {
1803
+ const overrides = getConfigOverrides();
1804
+ if (!(Object.keys(overrides).length > 0)) return {
1805
+ shouldContinue: false,
1806
+ reply: { text: "āš™ļø Debug overrides: (none)" }
1807
+ };
1808
+ return {
1809
+ shouldContinue: false,
1810
+ reply: { text: `āš™ļø Debug overrides (memory-only):\n\`\`\`json\n${JSON.stringify(overrides, null, 2)}\n\`\`\`` }
1811
+ };
1812
+ }
1813
+ if (debugCommand.action === "reset") {
1814
+ resetConfigOverrides();
1815
+ return {
1816
+ shouldContinue: false,
1817
+ reply: { text: "āš™ļø Debug overrides cleared; using config on disk." }
1818
+ };
1819
+ }
1820
+ if (debugCommand.action === "unset") {
1821
+ const result = unsetConfigOverride(debugCommand.path);
1822
+ if (!result.ok) return {
1823
+ shouldContinue: false,
1824
+ reply: { text: `āš ļø ${result.error ?? "Invalid path."}` }
1825
+ };
1826
+ if (!result.removed) return {
1827
+ shouldContinue: false,
1828
+ reply: { text: `āš™ļø No debug override found for ${debugCommand.path}.` }
1829
+ };
1830
+ return {
1831
+ shouldContinue: false,
1832
+ reply: { text: `āš™ļø Debug override removed for ${debugCommand.path}.` }
1833
+ };
1834
+ }
1835
+ if (debugCommand.action === "set") {
1836
+ const result = setConfigOverride(debugCommand.path, debugCommand.value);
1837
+ if (!result.ok) return {
1838
+ shouldContinue: false,
1839
+ reply: { text: `āš ļø ${result.error ?? "Invalid override."}` }
1840
+ };
1841
+ const valueLabel = typeof debugCommand.value === "string" ? `"${debugCommand.value}"` : JSON.stringify(debugCommand.value);
1842
+ return {
1843
+ shouldContinue: false,
1844
+ reply: { text: `āš™ļø Debug override set: ${debugCommand.path}=${valueLabel ?? "null"}` }
1845
+ };
1846
+ }
1847
+ return null;
1848
+ };
1849
+ //#endregion
1850
+ //#region src/auto-reply/reply/commands-context-report.ts
1851
+ function formatInt(n) {
1852
+ return new Intl.NumberFormat("en-US").format(n);
1853
+ }
1854
+ function formatCharsAndTokens(chars) {
1855
+ return `${formatInt(chars)} chars (~${formatInt(estimateTokensFromChars(chars))} tok)`;
1856
+ }
1857
+ function parseContextArgs(commandBodyNormalized) {
1858
+ if (commandBodyNormalized === "/context") return "";
1859
+ if (commandBodyNormalized.startsWith("/context ")) return commandBodyNormalized.slice(8).trim();
1860
+ return "";
1861
+ }
1862
+ function formatListTop(entries, cap) {
1863
+ const sorted = [...entries].toSorted((a, b) => b.value - a.value);
1864
+ const top = sorted.slice(0, cap);
1865
+ const omitted = Math.max(0, sorted.length - top.length);
1866
+ return {
1867
+ lines: top.map((e) => `- ${e.name}: ${formatCharsAndTokens(e.value)}`),
1868
+ omitted
1869
+ };
1870
+ }
1871
+ async function resolveContextReport(params) {
1872
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
1873
+ const existing = targetSessionEntry?.systemPromptReport;
1874
+ if (existing && existing.source === "run") return existing;
1875
+ const bootstrapMaxChars = resolveBootstrapMaxChars(params.cfg);
1876
+ const bootstrapTotalMaxChars = resolveBootstrapTotalMaxChars(params.cfg);
1877
+ const { resolveCommandsSystemPromptBundle } = await import("./commands-system-prompt-Clnn_Gct.js");
1878
+ const { systemPrompt, tools, skillsPrompt, bootstrapFiles, injectedFiles, sandboxRuntime } = await resolveCommandsSystemPromptBundle(params);
1879
+ return buildSystemPromptReport({
1880
+ source: "estimate",
1881
+ generatedAt: Date.now(),
1882
+ sessionId: targetSessionEntry?.sessionId,
1883
+ sessionKey: params.sessionKey,
1884
+ provider: params.provider,
1885
+ model: params.model,
1886
+ workspaceDir: params.workspaceDir,
1887
+ bootstrapMaxChars,
1888
+ bootstrapTotalMaxChars,
1889
+ sandbox: {
1890
+ mode: sandboxRuntime.mode,
1891
+ sandboxed: sandboxRuntime.sandboxed
1892
+ },
1893
+ systemPrompt,
1894
+ bootstrapFiles,
1895
+ injectedFiles,
1896
+ skillsPrompt,
1897
+ tools
1898
+ });
1899
+ }
1900
+ async function buildContextReply(params) {
1901
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
1902
+ const sub = normalizeLowercaseStringOrEmpty(parseContextArgs(params.command.commandBodyNormalized).split(/\s+/).find(Boolean));
1903
+ if (!sub || sub === "help") return { text: [
1904
+ "🧠 /context",
1905
+ "",
1906
+ "What counts as context (high-level), plus a breakdown mode.",
1907
+ "",
1908
+ "Try:",
1909
+ "- /context list (short breakdown)",
1910
+ "- /context detail (per-file + per-tool + per-skill + system prompt size)",
1911
+ "- /context json (same, machine-readable)",
1912
+ "",
1913
+ "Inline shortcut = a command token inside a normal message (e.g. ā€œhey /statusā€). It runs immediately (allowlisted senders only) and is stripped before the model sees the remaining text."
1914
+ ].join("\n") };
1915
+ const report = await resolveContextReport(params);
1916
+ const cachedContextUsageTokens = resolveFreshSessionTotalTokens(targetSessionEntry);
1917
+ const session = {
1918
+ totalTokens: targetSessionEntry?.totalTokens ?? null,
1919
+ totalTokensFresh: targetSessionEntry?.totalTokensFresh ?? null,
1920
+ inputTokens: targetSessionEntry?.inputTokens ?? null,
1921
+ outputTokens: targetSessionEntry?.outputTokens ?? null,
1922
+ contextTokens: params.contextTokens ?? null
1923
+ };
1924
+ if (sub === "json") return { text: JSON.stringify({
1925
+ report,
1926
+ session
1927
+ }, null, 2) };
1928
+ if (sub !== "list" && sub !== "show" && sub !== "detail" && sub !== "deep") return { text: ["Unknown /context mode.", "Use: /context, /context list, /context detail, or /context json"].join("\n") };
1929
+ const fileLines = report.injectedWorkspaceFiles.map((f) => {
1930
+ const status = f.missing ? "MISSING" : f.truncated ? "TRUNCATED" : "OK";
1931
+ const raw = f.missing ? "0" : formatCharsAndTokens(f.rawChars);
1932
+ const injected = f.missing ? "0" : formatCharsAndTokens(f.injectedChars);
1933
+ return `- ${f.name}: ${status} | raw ${raw} | injected ${injected}`;
1934
+ });
1935
+ const sandboxLine = `Sandbox: mode=${report.sandbox?.mode ?? "unknown"} sandboxed=${report.sandbox?.sandboxed ?? false}`;
1936
+ const toolSchemaLine = `Tool schemas (JSON): ${formatCharsAndTokens(report.tools.schemaChars)} (counts toward context; not shown as text)`;
1937
+ const toolListLine = `Tool list (system prompt text): ${formatCharsAndTokens(report.tools.listChars)}`;
1938
+ const skillNameSet = new Set(report.skills.entries.map((s) => s.name));
1939
+ const skillNames = Array.from(skillNameSet);
1940
+ const toolNames = report.tools.entries.map((t) => t.name);
1941
+ const formatNameList = (names, cap) => names.length <= cap ? names.join(", ") : `${names.slice(0, cap).join(", ")}, … (+${names.length - cap} more)`;
1942
+ const skillsLine = `Skills list (system prompt text): ${formatCharsAndTokens(report.skills.promptChars)} (${skillNameSet.size} skills)`;
1943
+ const skillsNamesLine = skillNameSet.size ? `Skills: ${formatNameList(skillNames, 20)}` : "Skills: (none)";
1944
+ const toolsNamesLine = toolNames.length ? `Tools: ${formatNameList(toolNames, 30)}` : "Tools: (none)";
1945
+ const systemPromptLine = `System prompt (${report.source}): ${formatCharsAndTokens(report.systemPrompt.chars)} (Project Context ${formatCharsAndTokens(report.systemPrompt.projectContextChars)})`;
1946
+ const workspaceLabel = report.workspaceDir ?? params.workspaceDir;
1947
+ const bootstrapMaxChars = typeof report.bootstrapMaxChars === "number" && Number.isFinite(report.bootstrapMaxChars) && report.bootstrapMaxChars > 0 ? report.bootstrapMaxChars : resolveBootstrapMaxChars(params.cfg);
1948
+ const bootstrapTotalMaxChars = typeof report.bootstrapTotalMaxChars === "number" && Number.isFinite(report.bootstrapTotalMaxChars) && report.bootstrapTotalMaxChars > 0 ? report.bootstrapTotalMaxChars : resolveBootstrapTotalMaxChars(params.cfg);
1949
+ const bootstrapMaxLabel = `${formatInt(bootstrapMaxChars)} chars`;
1950
+ const bootstrapTotalLabel = `${formatInt(bootstrapTotalMaxChars)} chars`;
1951
+ const bootstrapAnalysis = analyzeBootstrapBudget({
1952
+ files: report.injectedWorkspaceFiles,
1953
+ bootstrapMaxChars,
1954
+ bootstrapTotalMaxChars
1955
+ });
1956
+ const truncatedBootstrapFiles = bootstrapAnalysis.truncatedFiles;
1957
+ const truncationCauseCounts = truncatedBootstrapFiles.reduce((acc, file) => {
1958
+ for (const cause of file.causes) if (cause === "per-file-limit") acc.perFile += 1;
1959
+ else if (cause === "total-limit") acc.total += 1;
1960
+ return acc;
1961
+ }, {
1962
+ perFile: 0,
1963
+ total: 0
1964
+ });
1965
+ const truncationCauseParts = [truncationCauseCounts.perFile > 0 ? `${truncationCauseCounts.perFile} file(s) exceeded max/file` : null, truncationCauseCounts.total > 0 ? `${truncationCauseCounts.total} file(s) hit max/total` : null].filter(Boolean);
1966
+ const bootstrapWarningLines = truncatedBootstrapFiles.length > 0 ? [
1967
+ `⚠ Bootstrap context is over configured limits: ${truncatedBootstrapFiles.length} file(s) truncated (${formatInt(bootstrapAnalysis.totals.rawChars)} raw chars -> ${formatInt(bootstrapAnalysis.totals.injectedChars)} injected chars).`,
1968
+ ...truncationCauseParts.length ? [`Causes: ${truncationCauseParts.join("; ")}.`] : [],
1969
+ "Tip: increase `agents.defaults.bootstrapMaxChars` and/or `agents.defaults.bootstrapTotalMaxChars` if this truncation is not intentional."
1970
+ ] : [];
1971
+ const contextWindowLabel = session.contextTokens != null ? formatInt(session.contextTokens) : "?";
1972
+ const totalsLine = cachedContextUsageTokens != null ? `Session tokens (cached): ${formatInt(cachedContextUsageTokens)} total / ctx=${contextWindowLabel}` : `Session tokens (cached): unknown / ctx=${contextWindowLabel}`;
1973
+ const sharedContextLines = [
1974
+ `Workspace: ${workspaceLabel}`,
1975
+ `Bootstrap max/file: ${bootstrapMaxLabel}`,
1976
+ `Bootstrap max/total: ${bootstrapTotalLabel}`,
1977
+ sandboxLine,
1978
+ systemPromptLine,
1979
+ ...bootstrapWarningLines.length ? ["", ...bootstrapWarningLines] : [],
1980
+ "",
1981
+ "Injected workspace files:",
1982
+ ...fileLines,
1983
+ "",
1984
+ skillsLine,
1985
+ skillsNamesLine
1986
+ ];
1987
+ if (sub === "detail" || sub === "deep") {
1988
+ const perSkill = formatListTop(report.skills.entries.map((s) => ({
1989
+ name: s.name,
1990
+ value: s.blockChars
1991
+ })), 30);
1992
+ const perToolSchema = formatListTop(report.tools.entries.map((t) => ({
1993
+ name: t.name,
1994
+ value: t.schemaChars
1995
+ })), 30);
1996
+ const perToolSummary = formatListTop(report.tools.entries.map((t) => ({
1997
+ name: t.name,
1998
+ value: t.summaryChars
1999
+ })), 30);
2000
+ const toolPropsLines = report.tools.entries.filter((t) => t.propertiesCount != null).toSorted((a, b) => (b.propertiesCount ?? 0) - (a.propertiesCount ?? 0)).slice(0, 30).map((t) => `- ${t.name}: ${t.propertiesCount} params`);
2001
+ const trackedPromptChars = report.systemPrompt.chars + report.tools.schemaChars;
2002
+ const trackedPromptLine = `Tracked prompt estimate: ${formatCharsAndTokens(trackedPromptChars)}`;
2003
+ const actualContextLine = cachedContextUsageTokens != null ? `Actual context usage (cached): ${formatInt(cachedContextUsageTokens)} tok` : "Actual context usage (cached): unavailable";
2004
+ const overheadTokens = cachedContextUsageTokens != null ? cachedContextUsageTokens - estimateTokensFromChars(trackedPromptChars) : null;
2005
+ const overheadLine = overheadTokens == null ? null : overheadTokens > 0 ? `Untracked provider/runtime overhead: ~${formatInt(overheadTokens)} tok` : "Untracked provider/runtime overhead: not observed in cached usage";
2006
+ return { text: [
2007
+ "🧠 Context breakdown (detailed)",
2008
+ ...sharedContextLines,
2009
+ ...perSkill.lines.length ? ["Top skills (prompt entry size):", ...perSkill.lines] : [],
2010
+ ...perSkill.omitted ? [`… (+${perSkill.omitted} more skills)`] : [],
2011
+ "",
2012
+ toolListLine,
2013
+ toolSchemaLine,
2014
+ toolsNamesLine,
2015
+ "Top tools (schema size):",
2016
+ ...perToolSchema.lines,
2017
+ ...perToolSchema.omitted ? [`… (+${perToolSchema.omitted} more tools)`] : [],
2018
+ "",
2019
+ "Top tools (summary text size):",
2020
+ ...perToolSummary.lines,
2021
+ ...perToolSummary.omitted ? [`… (+${perToolSummary.omitted} more tools)`] : [],
2022
+ ...toolPropsLines.length ? [
2023
+ "",
2024
+ "Tools (param count):",
2025
+ ...toolPropsLines
2026
+ ] : [],
2027
+ "",
2028
+ trackedPromptLine,
2029
+ actualContextLine,
2030
+ ...overheadLine ? [overheadLine] : [],
2031
+ "",
2032
+ totalsLine,
2033
+ "",
2034
+ "Inline shortcut: a command token inside normal text (e.g. ā€œhey /statusā€) that runs immediately (allowlisted senders only) and is stripped before the model sees the remaining message."
2035
+ ].filter(Boolean).join("\n") };
2036
+ }
2037
+ return { text: [
2038
+ "🧠 Context breakdown",
2039
+ ...sharedContextLines,
2040
+ toolListLine,
2041
+ toolSchemaLine,
2042
+ toolsNamesLine,
2043
+ "",
2044
+ totalsLine,
2045
+ "",
2046
+ "Inline shortcut: a command token inside normal text (e.g. ā€œhey /statusā€) that runs immediately (allowlisted senders only) and is stripped before the model sees the remaining message."
2047
+ ].join("\n") };
2048
+ }
2049
+ //#endregion
2050
+ //#region src/auto-reply/reply/commands-context-command.ts
2051
+ const handleContextCommand = async (params, allowTextCommands) => {
2052
+ if (!allowTextCommands) return null;
2053
+ const normalized = params.command.commandBodyNormalized;
2054
+ if (normalized !== "/context" && !normalized.startsWith("/context ")) return null;
2055
+ if (!params.command.isAuthorizedSender) {
2056
+ logVerbose(`Ignoring /context from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
2057
+ return { shouldContinue: false };
2058
+ }
2059
+ return {
2060
+ shouldContinue: false,
2061
+ reply: await buildContextReply(params)
2062
+ };
2063
+ };
2064
+ //#endregion
2065
+ //#region src/auto-reply/reply/commands-export-common.ts
2066
+ function escapeRegExp(value) {
2067
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2068
+ }
2069
+ function parseExportCommandOutputPath(commandBodyNormalized, aliases) {
2070
+ const normalized = commandBodyNormalized.trim();
2071
+ if (aliases.some((alias) => normalized === `/${alias}`)) return {};
2072
+ const aliasPattern = aliases.map(escapeRegExp).join("|");
2073
+ return { outputPath: normalized.replace(new RegExp(`^/(${aliasPattern})\\s*`), "").trim().split(/\s+/).find((part) => !part.startsWith("-")) };
2074
+ }
2075
+ function resolveExportCommandSessionTarget(params) {
2076
+ const targetAgentId = resolveAgentIdFromSessionKey(params.sessionKey) || params.agentId;
2077
+ const storePath = params.storePath ?? resolveDefaultSessionStorePath(targetAgentId);
2078
+ const entry = loadSessionStore(storePath, { skipCache: true })[params.sessionKey];
2079
+ if (!entry?.sessionId) return { text: `āŒ Session not found: ${params.sessionKey}` };
2080
+ try {
2081
+ return {
2082
+ entry,
2083
+ sessionFile: resolveSessionFilePath(entry.sessionId, entry, resolveSessionFilePathOptions({
2084
+ agentId: targetAgentId,
2085
+ storePath
2086
+ }))
2087
+ };
2088
+ } catch (err) {
2089
+ return { text: `āŒ Failed to resolve session file: ${formatErrorMessage(err)}` };
2090
+ }
2091
+ }
2092
+ function isReplyPayload(value) {
2093
+ return "text" in value;
2094
+ }
2095
+ //#endregion
2096
+ //#region src/auto-reply/reply/commands-export-session.ts
2097
+ const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
2098
+ function loadTemplate(fileName) {
2099
+ return fs.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
2100
+ }
2101
+ function generateHtml(sessionData) {
2102
+ const template = loadTemplate("template.html");
2103
+ const templateCss = loadTemplate("template.css");
2104
+ const templateJs = loadTemplate("template.js");
2105
+ const markedJs = loadTemplate(path.join("vendor", "marked.min.js"));
2106
+ const hljsJs = loadTemplate(path.join("vendor", "highlight.min.js"));
2107
+ const themeVars = `
2108
+ --cyan: #00d7ff;
2109
+ --blue: #5f87ff;
2110
+ --green: #b5bd68;
2111
+ --red: #cc6666;
2112
+ --yellow: #ffff00;
2113
+ --gray: #808080;
2114
+ --dimGray: #666666;
2115
+ --darkGray: #505050;
2116
+ --accent: #8abeb7;
2117
+ --selectedBg: #3a3a4a;
2118
+ --userMsgBg: #343541;
2119
+ --toolPendingBg: #282832;
2120
+ --toolSuccessBg: #283228;
2121
+ --toolErrorBg: #3c2828;
2122
+ --customMsgBg: #2d2838;
2123
+ --text: #e0e0e0;
2124
+ --dim: #666666;
2125
+ --muted: #808080;
2126
+ --border: #5f87ff;
2127
+ --borderAccent: #00d7ff;
2128
+ --borderMuted: #505050;
2129
+ --success: #b5bd68;
2130
+ --error: #cc6666;
2131
+ --warning: #ffff00;
2132
+ --thinkingText: #808080;
2133
+ --userMessageBg: #343541;
2134
+ --userMessageText: #e0e0e0;
2135
+ --customMessageBg: #2d2838;
2136
+ --customMessageText: #e0e0e0;
2137
+ --customMessageLabel: #9575cd;
2138
+ --toolTitle: #e0e0e0;
2139
+ --toolOutput: #808080;
2140
+ --mdHeading: #f0c674;
2141
+ --mdLink: #81a2be;
2142
+ --mdLinkUrl: #666666;
2143
+ --mdCode: #8abeb7;
2144
+ --mdCodeBlock: #b5bd68;
2145
+ `;
2146
+ const bodyBg = "#1e1e28";
2147
+ const containerBg = "#282832";
2148
+ const infoBg = "#343541";
2149
+ const sessionDataBase64 = Buffer.from(JSON.stringify(sessionData)).toString("base64");
2150
+ const css = templateCss.replace("/* {{THEME_VARS}} */", themeVars.trim()).replace("/* {{BODY_BG_DECL}} */", `--body-bg: ${bodyBg};`).replace("/* {{CONTAINER_BG_DECL}} */", `--container-bg: ${containerBg};`).replace("/* {{INFO_BG_DECL}} */", `--info-bg: ${infoBg};`);
2151
+ return template.replace("{{CSS}}", css).replace("{{JS}}", templateJs).replace("{{SESSION_DATA}}", sessionDataBase64).replace("{{MARKED_JS}}", markedJs).replace("{{HIGHLIGHT_JS}}", hljsJs);
2152
+ }
2153
+ async function buildExportSessionReply(params) {
2154
+ const args = parseExportCommandOutputPath(params.command.commandBodyNormalized, ["export-session", "export"]);
2155
+ const sessionTarget = resolveExportCommandSessionTarget(params);
2156
+ if (isReplyPayload(sessionTarget)) return sessionTarget;
2157
+ const { entry, sessionFile } = sessionTarget;
2158
+ if (!fs.existsSync(sessionFile)) return { text: `āŒ Session file not found: ${sessionFile}` };
2159
+ const sessionManager = SessionManager.open(sessionFile);
2160
+ const entries = sessionManager.getEntries();
2161
+ const header = sessionManager.getHeader();
2162
+ const leafId = sessionManager.getLeafId();
2163
+ const { systemPrompt, tools } = await resolveCommandsSystemPromptBundle({
2164
+ ...params,
2165
+ sessionEntry: entry
2166
+ });
2167
+ const html = generateHtml({
2168
+ header,
2169
+ entries,
2170
+ leafId,
2171
+ systemPrompt,
2172
+ tools: tools.map((t) => ({
2173
+ name: t.name,
2174
+ description: t.description,
2175
+ parameters: t.parameters
2176
+ }))
2177
+ });
2178
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2179
+ const defaultFileName = `genesis-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
2180
+ const outputPath = args.outputPath ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) : path.join(params.workspaceDir, defaultFileName);
2181
+ const outputDir = path.dirname(outputPath);
2182
+ if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, { recursive: true });
2183
+ fs.writeFileSync(outputPath, html, "utf-8");
2184
+ const relativePath = path.relative(params.workspaceDir, outputPath);
2185
+ return { text: [
2186
+ "āœ… Session exported!",
2187
+ "",
2188
+ `šŸ“„ File: ${relativePath.startsWith("..") ? outputPath : relativePath}`,
2189
+ `šŸ“Š Entries: ${entries.length}`,
2190
+ `🧠 System prompt: ${systemPrompt.length.toLocaleString()} chars`,
2191
+ `šŸ”§ Tools: ${tools.length}`
2192
+ ].join("\n") };
2193
+ }
2194
+ //#endregion
2195
+ //#region src/trajectory/export.ts
2196
+ const MAX_TRAJECTORY_RUNTIME_EVENTS = 2e5;
2197
+ const MAX_TRAJECTORY_TOTAL_EVENTS = 25e4;
2198
+ const MAX_TRAJECTORY_SESSION_FILE_BYTES = 50 * 1024 * 1024;
2199
+ function parseSessionEntries(content) {
2200
+ return content.split(/\r?\n/u).map((line) => line.trim()).filter(Boolean).flatMap((line) => {
2201
+ try {
2202
+ return [JSON.parse(line)];
2203
+ } catch {
2204
+ return [];
2205
+ }
2206
+ });
2207
+ }
2208
+ function migrateLegacySessionEntries(entries) {
2209
+ const version = entries.find((entry) => entry.type === "session")?.version ?? 1;
2210
+ if (version < 2) {
2211
+ let previousId = null;
2212
+ let index = 0;
2213
+ for (const entry of entries) {
2214
+ if (entry.type === "session") {
2215
+ entry.version = 2;
2216
+ continue;
2217
+ }
2218
+ const mutable = entry;
2219
+ if (typeof mutable.id !== "string") mutable.id = `legacy-${index++}`;
2220
+ mutable.parentId = previousId;
2221
+ const entryId = mutable.id;
2222
+ previousId = typeof entryId === "string" ? entryId : null;
2223
+ if (entry.type === "compaction" && typeof mutable.firstKeptEntryIndex === "number") {
2224
+ const target = entries[mutable.firstKeptEntryIndex];
2225
+ if (target && target.type !== "session") mutable.firstKeptEntryId = target.id;
2226
+ delete mutable.firstKeptEntryIndex;
2227
+ }
2228
+ }
2229
+ }
2230
+ if (version < 3) for (const entry of entries) {
2231
+ if (entry.type === "session") {
2232
+ entry.version = 3;
2233
+ continue;
2234
+ }
2235
+ if (entry.type === "message") {
2236
+ const message = entry.message;
2237
+ if (message?.role === "hookMessage") message.role = "custom";
2238
+ }
2239
+ }
2240
+ }
2241
+ function readSessionBranch(filePath) {
2242
+ const fileEntries = parseSessionEntries(fs.readFileSync(filePath, "utf8"));
2243
+ migrateLegacySessionEntries(fileEntries);
2244
+ const header = fileEntries.find((entry) => entry.type === "session") ?? null;
2245
+ const entries = fileEntries.filter((entry) => entry.type !== "session" && typeof entry.id === "string" && (typeof entry.timestamp === "string" || typeof entry.timestamp === "number"));
2246
+ const byId = new Map(entries.map((entry) => [entry.id, entry]));
2247
+ const leafId = entries.at(-1)?.id ?? null;
2248
+ const branchEntries = [];
2249
+ let current = leafId ? byId.get(leafId) : void 0;
2250
+ while (current) {
2251
+ branchEntries.unshift(current);
2252
+ current = current.parentId ? byId.get(current.parentId) : void 0;
2253
+ }
2254
+ return {
2255
+ header,
2256
+ leafId,
2257
+ branchEntries
2258
+ };
2259
+ }
2260
+ function parseJsonlFile(filePath, params) {
2261
+ if (!fs.existsSync(filePath)) return [];
2262
+ const stat = fs.statSync(filePath);
2263
+ if (stat.size > params.maxBytes) throw new Error(`Trajectory runtime file is too large to export (${stat.size} bytes; limit ${params.maxBytes})`);
2264
+ const rows = fs.readFileSync(filePath, "utf8").split(/\r?\n/u).map((line) => line.trim()).filter(Boolean);
2265
+ const parsed = [];
2266
+ for (const row of rows) {
2267
+ if (parsed.length >= params.maxEvents) throw new Error(`Trajectory runtime file has too many events to export (limit ${params.maxEvents})`);
2268
+ try {
2269
+ const value = JSON.parse(row);
2270
+ if (!params.validate || params.validate(value)) parsed.push(value);
2271
+ } catch {}
2272
+ }
2273
+ return parsed;
2274
+ }
2275
+ function isFiniteNumber(value) {
2276
+ return typeof value === "number" && Number.isFinite(value);
2277
+ }
2278
+ function isRecord(value) {
2279
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
2280
+ }
2281
+ function isRuntimeTrajectoryEventForSession(value, sessionId) {
2282
+ if (!isRecord(value)) return false;
2283
+ return value.traceSchema === "genesis-trajectory" && value.schemaVersion === 1 && value.source === "runtime" && typeof value.type === "string" && typeof value.ts === "string" && !Number.isNaN(Date.parse(value.ts)) && isFiniteNumber(value.seq) && value.sessionId === sessionId && (!("data" in value) || value.data === void 0 || isRecord(value.data));
2284
+ }
2285
+ function isRegularNonSymlinkFile(filePath) {
2286
+ try {
2287
+ const linkStat = fs.lstatSync(filePath);
2288
+ if (linkStat.isSymbolicLink() || !linkStat.isFile()) return false;
2289
+ const stat = fs.statSync(filePath);
2290
+ return stat.isFile() && stat.dev === linkStat.dev && stat.ino === linkStat.ino;
2291
+ } catch {
2292
+ return false;
2293
+ }
2294
+ }
2295
+ function readRuntimePointerFile(sessionFile, sessionId) {
2296
+ const pointerPath = resolveTrajectoryPointerFilePath(sessionFile);
2297
+ if (!isRegularNonSymlinkFile(pointerPath)) return;
2298
+ try {
2299
+ const parsed = JSON.parse(fs.readFileSync(pointerPath, "utf8"));
2300
+ if (!isRecord(parsed)) return;
2301
+ if (parsed.sessionId !== sessionId || typeof parsed.runtimeFile !== "string") return;
2302
+ const runtimeFile = path.resolve(parsed.runtimeFile);
2303
+ const safeRuntimeFileName = `${safeTrajectorySessionFileName(sessionId)}.jsonl`;
2304
+ if (runtimeFile !== path.resolve(resolveTrajectoryFilePath({
2305
+ env: {},
2306
+ sessionFile,
2307
+ sessionId
2308
+ })) && path.basename(runtimeFile) !== safeRuntimeFileName) return;
2309
+ return runtimeFile;
2310
+ } catch {
2311
+ return;
2312
+ }
2313
+ }
2314
+ function resolveTrajectoryRuntimeFile(params) {
2315
+ if (params.runtimeFile) return params.runtimeFile;
2316
+ return [
2317
+ readRuntimePointerFile(params.sessionFile, params.sessionId),
2318
+ resolveTrajectoryFilePath({
2319
+ env: {},
2320
+ sessionFile: params.sessionFile,
2321
+ sessionId: params.sessionId
2322
+ }),
2323
+ resolveTrajectoryFilePath({
2324
+ sessionFile: params.sessionFile,
2325
+ sessionId: params.sessionId
2326
+ })
2327
+ ].filter((candidate) => Boolean(candidate)).find((candidate) => isRegularNonSymlinkFile(candidate));
2328
+ }
2329
+ function normalizeTimestamp(value) {
2330
+ if (typeof value === "number" && Number.isFinite(value)) {
2331
+ const parsed = new Date(value);
2332
+ if (!Number.isNaN(parsed.getTime())) return parsed.toISOString();
2333
+ }
2334
+ if (typeof value === "string") {
2335
+ const parsed = new Date(value);
2336
+ if (!Number.isNaN(parsed.getTime())) return parsed.toISOString();
2337
+ }
2338
+ return (/* @__PURE__ */ new Date(0)).toISOString();
2339
+ }
2340
+ function resolveMessageEventType(message) {
2341
+ if (message.role === "user") return "user.message";
2342
+ if (message.role === "assistant") return "assistant.message";
2343
+ if (message.role === "toolResult") return "tool.result";
2344
+ return `message.${message.role}`;
2345
+ }
2346
+ function extractAssistantToolCalls(message) {
2347
+ if (message.role !== "assistant" || !Array.isArray(message.content)) return [];
2348
+ return message.content.flatMap((block, index) => {
2349
+ if (!block || typeof block !== "object") return [];
2350
+ const typedBlock = block;
2351
+ const blockType = typeof typedBlock.type === "string" ? typedBlock.type.trim().toLowerCase() : "";
2352
+ if (blockType !== "toolcall" && blockType !== "tooluse" && blockType !== "functioncall") return [];
2353
+ return [{
2354
+ id: typeof typedBlock.id === "string" ? typedBlock.id : void 0,
2355
+ name: typeof typedBlock.name === "string" ? typedBlock.name : void 0,
2356
+ arguments: typedBlock.arguments ?? typedBlock.input ?? typedBlock.parameters,
2357
+ index
2358
+ }];
2359
+ });
2360
+ }
2361
+ function buildTranscriptEvents(params) {
2362
+ const events = [];
2363
+ let seq = 0;
2364
+ for (const entry of params.entries) {
2365
+ const push = (type, data) => {
2366
+ events.push({
2367
+ traceSchema: "genesis-trajectory",
2368
+ schemaVersion: 1,
2369
+ traceId: params.traceId,
2370
+ source: "transcript",
2371
+ type,
2372
+ ts: normalizeTimestamp(entry.timestamp),
2373
+ seq: 0,
2374
+ sourceSeq: seq += 1,
2375
+ sessionId: params.sessionId,
2376
+ sessionKey: params.sessionKey,
2377
+ workspaceDir: params.workspaceDir,
2378
+ entryId: entry.id,
2379
+ parentEntryId: entry.parentId,
2380
+ data
2381
+ });
2382
+ };
2383
+ switch (entry.type) {
2384
+ case "message":
2385
+ push(resolveMessageEventType(entry.message), { message: sanitizeDiagnosticPayload(entry.message) });
2386
+ for (const toolCall of extractAssistantToolCalls(entry.message)) push("tool.call", {
2387
+ toolCallId: toolCall.id,
2388
+ name: toolCall.name,
2389
+ arguments: sanitizeDiagnosticPayload(toolCall.arguments),
2390
+ assistantEntryId: entry.id,
2391
+ blockIndex: toolCall.index
2392
+ });
2393
+ break;
2394
+ case "compaction":
2395
+ push("session.compaction", {
2396
+ summary: entry.summary,
2397
+ firstKeptEntryId: entry.firstKeptEntryId,
2398
+ tokensBefore: entry.tokensBefore,
2399
+ details: sanitizeDiagnosticPayload(entry.details),
2400
+ fromHook: entry.fromHook ?? false
2401
+ });
2402
+ break;
2403
+ case "branch_summary":
2404
+ push("session.branch_summary", {
2405
+ fromId: entry.fromId,
2406
+ summary: entry.summary,
2407
+ details: sanitizeDiagnosticPayload(entry.details),
2408
+ fromHook: entry.fromHook ?? false
2409
+ });
2410
+ break;
2411
+ case "custom":
2412
+ push("session.custom", {
2413
+ customType: entry.customType,
2414
+ data: sanitizeDiagnosticPayload(entry.data)
2415
+ });
2416
+ break;
2417
+ case "custom_message":
2418
+ push("session.custom_message", {
2419
+ customType: entry.customType,
2420
+ content: sanitizeDiagnosticPayload(entry.content),
2421
+ details: sanitizeDiagnosticPayload(entry.details),
2422
+ display: entry.display
2423
+ });
2424
+ break;
2425
+ case "thinking_level_change":
2426
+ push("session.thinking_level_change", { thinkingLevel: entry.thinkingLevel });
2427
+ break;
2428
+ case "model_change":
2429
+ push("session.model_change", {
2430
+ provider: entry.provider,
2431
+ modelId: entry.modelId
2432
+ });
2433
+ break;
2434
+ case "label":
2435
+ push("session.label", {
2436
+ targetId: entry.targetId,
2437
+ label: entry.label
2438
+ });
2439
+ break;
2440
+ case "session_info":
2441
+ push("session.info", { name: entry.name });
2442
+ break;
2443
+ }
2444
+ }
2445
+ return events;
2446
+ }
2447
+ function sortTrajectoryEvents(events) {
2448
+ const sourceOrder = {
2449
+ runtime: 0,
2450
+ transcript: 1,
2451
+ export: 2
2452
+ };
2453
+ const sorted = events.toSorted((left, right) => {
2454
+ const byTs = left.ts.localeCompare(right.ts);
2455
+ if (byTs !== 0) return byTs;
2456
+ const bySource = sourceOrder[left.source] - sourceOrder[right.source];
2457
+ if (bySource !== 0) return bySource;
2458
+ return (left.sourceSeq ?? left.seq) - (right.sourceSeq ?? right.seq);
2459
+ });
2460
+ for (const [index, event] of sorted.entries()) event.seq = index + 1;
2461
+ return sorted;
2462
+ }
2463
+ function trajectoryJsonlFile(pathName, events) {
2464
+ return jsonlSupportBundleFile(pathName, events.map((event) => safeJsonStringify(event)).filter((line) => Boolean(line)));
2465
+ }
2466
+ function buildTrajectoryExportRedaction(params) {
2467
+ const env = process.env;
2468
+ return {
2469
+ env,
2470
+ stateDir: resolveStateDir(env),
2471
+ workspaceDir: path.resolve(params.workspaceDir)
2472
+ };
2473
+ }
2474
+ function redactWorkspacePathString(value, redaction) {
2475
+ const workspaceDir = redaction.workspaceDir;
2476
+ if (!workspaceDir) return value;
2477
+ const normalizedWorkspaceDir = workspaceDir.replaceAll("\\", "/");
2478
+ let next = value;
2479
+ for (const candidate of new Set([workspaceDir, normalizedWorkspaceDir])) {
2480
+ if (!candidate) continue;
2481
+ const escaped = candidate.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
2482
+ next = next.replace(new RegExp(`${escaped}(?=$|[\\\\/])`, "gu"), "$WORKSPACE_DIR");
2483
+ }
2484
+ return next;
2485
+ }
2486
+ function maybeRedactPathString(value, redaction) {
2487
+ const workspaceRedacted = redactWorkspacePathString(value, redaction);
2488
+ if (workspaceRedacted !== value || path.isAbsolute(workspaceRedacted) || workspaceRedacted.includes(redaction.stateDir) || (redaction.env.HOME ? workspaceRedacted.includes(redaction.env.HOME) : false) || (redaction.env.USERPROFILE ? workspaceRedacted.includes(redaction.env.USERPROFILE) : false)) return redactSupportString(workspaceRedacted, redaction);
2489
+ return workspaceRedacted;
2490
+ }
2491
+ function redactLocalPathValues(value, redaction) {
2492
+ if (typeof value === "string") return maybeRedactPathString(value, redaction);
2493
+ if (Array.isArray(value)) return value.map((entry) => redactLocalPathValues(entry, redaction));
2494
+ if (!value || typeof value !== "object") return value;
2495
+ const record = value;
2496
+ const next = {};
2497
+ for (const [key, entry] of Object.entries(record)) next[key] = redactLocalPathValues(entry, redaction);
2498
+ return next;
2499
+ }
2500
+ function redactEventForExport(event, redaction) {
2501
+ return {
2502
+ ...event,
2503
+ workspaceDir: event.workspaceDir ? maybeRedactPathString(event.workspaceDir, redaction) : void 0,
2504
+ data: event.data ? redactLocalPathValues(event.data, redaction) : void 0
2505
+ };
2506
+ }
2507
+ function resolveRuntimeContext(runtimeEvents) {
2508
+ const runtimeData = runtimeEvents.slice().toReversed().find((event) => event.type === "context.compiled")?.data;
2509
+ const toolsValue = Array.isArray(runtimeData?.tools) ? runtimeData.tools : void 0;
2510
+ return {
2511
+ systemPrompt: typeof runtimeData?.systemPrompt === "string" ? runtimeData.systemPrompt : void 0,
2512
+ tools: toolsValue
2513
+ };
2514
+ }
2515
+ function resolveLatestRuntimeEventData(runtimeEvents, type) {
2516
+ return runtimeEvents.slice().toReversed().find((candidate) => candidate.type === type)?.data;
2517
+ }
2518
+ function normalizePathForMatch(value) {
2519
+ return value.replaceAll("\\", "/").trim().toLowerCase();
2520
+ }
2521
+ function collectPotentialPathStrings(value) {
2522
+ const found = /* @__PURE__ */ new Set();
2523
+ const visit = (input) => {
2524
+ if (!input || typeof input !== "object") return;
2525
+ if (Array.isArray(input)) {
2526
+ for (const entry of input) visit(entry);
2527
+ return;
2528
+ }
2529
+ for (const [key, entry] of Object.entries(input)) if (typeof entry === "string" && (key.toLowerCase().includes("path") || entry.endsWith("SKILL.md") || entry.endsWith("skill.md"))) found.add(entry);
2530
+ else visit(entry);
2531
+ };
2532
+ visit(value);
2533
+ return [...found];
2534
+ }
2535
+ function markInvokedSkills(params) {
2536
+ if (!params.skills || typeof params.skills !== "object") return params.skills;
2537
+ const skillsRecord = params.skills;
2538
+ if (!Array.isArray(skillsRecord.entries) || skillsRecord.entries.length === 0) return params.skills;
2539
+ const invokedPaths = new Set(params.events.flatMap((event) => {
2540
+ if (event.type !== "tool.call") return [];
2541
+ return collectPotentialPathStrings(event.data?.arguments);
2542
+ }));
2543
+ const normalizedInvokedPaths = new Set([...invokedPaths].map((value) => normalizePathForMatch(value)));
2544
+ const entries = skillsRecord.entries.map((entry) => {
2545
+ const rawPath = typeof entry.filePath === "string" ? entry.filePath : void 0;
2546
+ const normalizedPath = rawPath ? normalizePathForMatch(rawPath) : void 0;
2547
+ const skillDirName = rawPath?.replaceAll("\\", "/").split("/").slice(-2, -1)[0]?.toLowerCase() ?? void 0;
2548
+ const invoked = normalizedPath ? [...normalizedInvokedPaths].some((candidate) => candidate === normalizedPath || candidate.endsWith(normalizedPath) || (skillDirName ? candidate.endsWith(`/${skillDirName}/skill.md`) : false)) : false;
2549
+ return invoked ? {
2550
+ ...entry,
2551
+ invoked,
2552
+ invocationDetectedBy: "tool-call-file-path"
2553
+ } : {
2554
+ ...entry,
2555
+ invoked: false
2556
+ };
2557
+ });
2558
+ return {
2559
+ ...skillsRecord,
2560
+ entries
2561
+ };
2562
+ }
2563
+ function buildMetadataCapture(params) {
2564
+ const runtimeMetadata = resolveLatestRuntimeEventData(params.runtimeEvents, "trace.metadata");
2565
+ if (!runtimeMetadata) return;
2566
+ const modelFallback = (() => {
2567
+ const latest = params.runtimeEvents.slice().toReversed().find((event) => event.provider || event.modelId || event.modelApi);
2568
+ if (!latest?.provider && !latest?.modelId && !latest?.modelApi) return;
2569
+ return {
2570
+ provider: latest.provider,
2571
+ name: latest.modelId,
2572
+ api: latest.modelApi
2573
+ };
2574
+ })();
2575
+ return {
2576
+ traceSchema: "genesis-trajectory",
2577
+ schemaVersion: 1,
2578
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2579
+ traceId: params.manifest.traceId,
2580
+ sessionId: params.manifest.sessionId,
2581
+ sessionKey: params.manifest.sessionKey,
2582
+ harness: runtimeMetadata.harness,
2583
+ model: runtimeMetadata.model ?? modelFallback,
2584
+ config: runtimeMetadata.config,
2585
+ plugins: runtimeMetadata.plugins,
2586
+ skills: markInvokedSkills({
2587
+ skills: runtimeMetadata.skills,
2588
+ events: params.events
2589
+ }),
2590
+ prompting: runtimeMetadata.prompting,
2591
+ redaction: runtimeMetadata.redaction,
2592
+ metadata: runtimeMetadata.metadata
2593
+ };
2594
+ }
2595
+ function buildArtifactsCapture(params) {
2596
+ const runtimeArtifacts = resolveLatestRuntimeEventData(params.runtimeEvents, "trace.artifacts");
2597
+ const runtimeCompletion = resolveLatestRuntimeEventData(params.runtimeEvents, "model.completed");
2598
+ const runtimeEnd = resolveLatestRuntimeEventData(params.runtimeEvents, "session.ended");
2599
+ if (!runtimeArtifacts && !runtimeCompletion && !runtimeEnd) return;
2600
+ return {
2601
+ traceSchema: "genesis-trajectory",
2602
+ schemaVersion: 1,
2603
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2604
+ traceId: params.manifest.traceId,
2605
+ sessionId: params.manifest.sessionId,
2606
+ sessionKey: params.manifest.sessionKey,
2607
+ finalStatus: runtimeArtifacts?.finalStatus ?? runtimeEnd?.status,
2608
+ aborted: runtimeArtifacts?.aborted ?? runtimeEnd?.aborted,
2609
+ externalAbort: runtimeArtifacts?.externalAbort ?? runtimeEnd?.externalAbort,
2610
+ timedOut: runtimeArtifacts?.timedOut ?? runtimeEnd?.timedOut,
2611
+ idleTimedOut: runtimeArtifacts?.idleTimedOut ?? runtimeEnd?.idleTimedOut,
2612
+ timedOutDuringCompaction: runtimeArtifacts?.timedOutDuringCompaction ?? runtimeEnd?.timedOutDuringCompaction,
2613
+ promptError: runtimeArtifacts?.promptError ?? runtimeEnd?.promptError ?? runtimeCompletion?.promptError,
2614
+ promptErrorSource: runtimeArtifacts?.promptErrorSource ?? runtimeCompletion?.promptErrorSource,
2615
+ usage: runtimeArtifacts?.usage ?? runtimeCompletion?.usage,
2616
+ promptCache: runtimeArtifacts?.promptCache ?? runtimeCompletion?.promptCache,
2617
+ compactionCount: runtimeArtifacts?.compactionCount ?? runtimeCompletion?.compactionCount,
2618
+ assistantTexts: runtimeArtifacts?.assistantTexts ?? runtimeCompletion?.assistantTexts,
2619
+ finalPromptText: runtimeArtifacts?.finalPromptText ?? runtimeCompletion?.finalPromptText,
2620
+ itemLifecycle: runtimeArtifacts?.itemLifecycle,
2621
+ toolMetas: runtimeArtifacts?.toolMetas,
2622
+ didSendViaMessagingTool: runtimeArtifacts?.didSendViaMessagingTool,
2623
+ successfulCronAdds: runtimeArtifacts?.successfulCronAdds,
2624
+ messagingToolSentTexts: runtimeArtifacts?.messagingToolSentTexts,
2625
+ messagingToolSentMediaUrls: runtimeArtifacts?.messagingToolSentMediaUrls,
2626
+ messagingToolSentTargets: runtimeArtifacts?.messagingToolSentTargets,
2627
+ lastToolError: runtimeArtifacts?.lastToolError
2628
+ };
2629
+ }
2630
+ function buildPromptsCapture(params) {
2631
+ const runtimeMetadata = resolveLatestRuntimeEventData(params.runtimeEvents, "trace.metadata");
2632
+ const latestCompiled = resolveLatestRuntimeEventData(params.runtimeEvents, "context.compiled");
2633
+ const submittedPrompts = params.runtimeEvents.filter((event) => event.type === "prompt.submitted").map((event) => event.data?.prompt).filter((prompt) => typeof prompt === "string");
2634
+ const systemPrompt = (typeof latestCompiled?.systemPrompt === "string" ? latestCompiled.systemPrompt : void 0) ?? params.runtimeContext.systemPrompt;
2635
+ const skillsPrompt = runtimeMetadata?.prompting && typeof runtimeMetadata.prompting === "object" && typeof runtimeMetadata.prompting.skillsPrompt === "string" ? runtimeMetadata.prompting.skillsPrompt : void 0;
2636
+ const userPromptPrefixText = runtimeMetadata?.prompting && typeof runtimeMetadata.prompting === "object" && typeof runtimeMetadata.prompting.userPromptPrefixText === "string" ? runtimeMetadata.prompting.userPromptPrefixText : void 0;
2637
+ const promptReport = runtimeMetadata?.prompting && typeof runtimeMetadata.prompting === "object" && typeof runtimeMetadata.prompting.systemPromptReport === "object" ? runtimeMetadata.prompting.systemPromptReport : void 0;
2638
+ if (!systemPrompt && submittedPrompts.length === 0 && !skillsPrompt && !userPromptPrefixText) return;
2639
+ return {
2640
+ traceSchema: "genesis-trajectory",
2641
+ schemaVersion: 1,
2642
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2643
+ traceId: params.manifest.traceId,
2644
+ sessionId: params.manifest.sessionId,
2645
+ sessionKey: params.manifest.sessionKey,
2646
+ system: systemPrompt,
2647
+ submittedPrompts,
2648
+ latestSubmittedPrompt: submittedPrompts.at(-1),
2649
+ skillsPrompt,
2650
+ userPromptPrefixText,
2651
+ systemPromptReport: promptReport
2652
+ };
2653
+ }
2654
+ function resolveDefaultTrajectoryExportDir(params) {
2655
+ const timestamp = (params.now ?? /* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2656
+ const sessionFileName = safeTrajectorySessionFileName(params.sessionId);
2657
+ return path.join(params.workspaceDir, ".genesis", "trajectory-exports", `genesis-trajectory-${sessionFileName.slice(0, 8)}-${timestamp}`);
2658
+ }
2659
+ function exportTrajectoryBundle(params) {
2660
+ const redaction = buildTrajectoryExportRedaction({ workspaceDir: params.workspaceDir });
2661
+ const sessionStat = fs.statSync(params.sessionFile);
2662
+ if (sessionStat.size > MAX_TRAJECTORY_SESSION_FILE_BYTES) throw new Error(`Trajectory session file is too large to export (${sessionStat.size} bytes; limit ${MAX_TRAJECTORY_SESSION_FILE_BYTES})`);
2663
+ const { header, leafId, branchEntries } = readSessionBranch(params.sessionFile);
2664
+ const runtimeFile = resolveTrajectoryRuntimeFile({
2665
+ runtimeFile: params.runtimeFile,
2666
+ sessionFile: params.sessionFile,
2667
+ sessionId: params.sessionId
2668
+ });
2669
+ const runtimeEvents = runtimeFile ? parseJsonlFile(runtimeFile, {
2670
+ maxBytes: TRAJECTORY_RUNTIME_FILE_MAX_BYTES,
2671
+ maxEvents: MAX_TRAJECTORY_RUNTIME_EVENTS,
2672
+ validate: (value) => isRuntimeTrajectoryEventForSession(value, params.sessionId)
2673
+ }) : [];
2674
+ const transcriptEvents = buildTranscriptEvents({
2675
+ entries: branchEntries,
2676
+ sessionId: params.sessionId,
2677
+ sessionKey: params.sessionKey,
2678
+ workspaceDir: params.workspaceDir,
2679
+ traceId: params.sessionId
2680
+ });
2681
+ const maxTotalEvents = params.maxTotalEvents ?? MAX_TRAJECTORY_TOTAL_EVENTS;
2682
+ const totalEventCount = runtimeEvents.length + transcriptEvents.length;
2683
+ if (totalEventCount > maxTotalEvents) throw new Error(`Trajectory export has too many events (${totalEventCount}; limit ${maxTotalEvents})`);
2684
+ const rawEvents = sortTrajectoryEvents([...runtimeEvents, ...transcriptEvents]);
2685
+ const events = rawEvents.map((event) => redactEventForExport(event, redaction));
2686
+ const manifest = {
2687
+ traceSchema: "genesis-trajectory",
2688
+ schemaVersion: 1,
2689
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2690
+ traceId: params.sessionId,
2691
+ sessionId: params.sessionId,
2692
+ sessionKey: params.sessionKey,
2693
+ workspaceDir: maybeRedactPathString(params.workspaceDir, redaction),
2694
+ leafId,
2695
+ eventCount: events.length,
2696
+ runtimeEventCount: runtimeEvents.length,
2697
+ transcriptEventCount: transcriptEvents.length,
2698
+ sourceFiles: {
2699
+ session: maybeRedactPathString(params.sessionFile, redaction),
2700
+ runtime: runtimeFile && isRegularNonSymlinkFile(runtimeFile) ? maybeRedactPathString(runtimeFile, redaction) : void 0
2701
+ }
2702
+ };
2703
+ const bundleRuntimeContext = resolveRuntimeContext(runtimeEvents);
2704
+ const files = [];
2705
+ const supplementalFiles = [];
2706
+ const metadataCapture = buildMetadataCapture({
2707
+ manifest,
2708
+ runtimeEvents,
2709
+ events: rawEvents
2710
+ });
2711
+ const artifactsCapture = buildArtifactsCapture({
2712
+ manifest,
2713
+ runtimeEvents
2714
+ });
2715
+ const promptsCapture = buildPromptsCapture({
2716
+ manifest,
2717
+ runtimeEvents,
2718
+ runtimeContext: bundleRuntimeContext
2719
+ });
2720
+ if (metadataCapture) {
2721
+ files.push(jsonSupportBundleFile("metadata.json", redactLocalPathValues(metadataCapture, redaction)));
2722
+ supplementalFiles.push("metadata.json");
2723
+ }
2724
+ if (artifactsCapture) {
2725
+ files.push(jsonSupportBundleFile("artifacts.json", redactLocalPathValues(artifactsCapture, redaction)));
2726
+ supplementalFiles.push("artifacts.json");
2727
+ }
2728
+ if (promptsCapture) {
2729
+ files.push(jsonSupportBundleFile("prompts.json", redactLocalPathValues(promptsCapture, redaction)));
2730
+ supplementalFiles.push("prompts.json");
2731
+ }
2732
+ if (supplementalFiles.length > 0) manifest.supplementalFiles = supplementalFiles;
2733
+ files.push(trajectoryJsonlFile("events.jsonl", events));
2734
+ files.push(jsonSupportBundleFile("session-branch.json", redactLocalPathValues(sanitizeDiagnosticPayload({
2735
+ header,
2736
+ leafId,
2737
+ entries: branchEntries
2738
+ }), redaction)));
2739
+ if (bundleRuntimeContext.systemPrompt) files.push(textSupportBundleFile("system-prompt.txt", redactLocalPathValues(bundleRuntimeContext.systemPrompt, redaction)));
2740
+ if (bundleRuntimeContext.tools) files.push(jsonSupportBundleFile("tools.json", redactLocalPathValues(bundleRuntimeContext.tools, redaction)));
2741
+ manifest.contents = [...supportBundleContents(files)];
2742
+ writeSupportBundleDirectory({
2743
+ outputDir: params.outputDir,
2744
+ files: [jsonSupportBundleFile("manifest.json", manifest), ...files]
2745
+ });
2746
+ return {
2747
+ manifest,
2748
+ outputDir: params.outputDir,
2749
+ events,
2750
+ header,
2751
+ runtimeFile: runtimeFile && isRegularNonSymlinkFile(runtimeFile) ? runtimeFile : void 0,
2752
+ supplementalFiles
2753
+ };
2754
+ }
2755
+ //#endregion
2756
+ //#region src/auto-reply/reply/commands-export-trajectory.ts
2757
+ function isPathInsideOrEqual(baseDir, candidate) {
2758
+ const relative = path.relative(baseDir, candidate);
2759
+ return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
2760
+ }
2761
+ function validateExistingExportDirectory(params) {
2762
+ const linkStat = fs.lstatSync(params.dir);
2763
+ if (linkStat.isSymbolicLink() || !linkStat.isDirectory()) throw new Error(`${params.label} must be a real directory inside the workspace`);
2764
+ const realDir = fs.realpathSync(params.dir);
2765
+ if (!isPathInsideOrEqual(params.realWorkspace, realDir)) throw new Error("Trajectory exports directory must stay inside the workspace");
2766
+ return realDir;
2767
+ }
2768
+ function mkdirIfMissingThenValidate(params) {
2769
+ if (!fs.existsSync(params.dir)) try {
2770
+ fs.mkdirSync(params.dir, { mode: 448 });
2771
+ } catch (error) {
2772
+ if (error.code !== "EEXIST") throw error;
2773
+ }
2774
+ return validateExistingExportDirectory(params);
2775
+ }
2776
+ function resolveTrajectoryExportBaseDir(workspaceDir) {
2777
+ const workspacePath = path.resolve(workspaceDir);
2778
+ const realWorkspace = fs.realpathSync(workspacePath);
2779
+ const stateDir = path.join(workspacePath, ".genesis");
2780
+ mkdirIfMissingThenValidate({
2781
+ dir: stateDir,
2782
+ label: "Genesis state directory",
2783
+ realWorkspace
2784
+ });
2785
+ const baseDir = path.join(stateDir, "trajectory-exports");
2786
+ const realBase = mkdirIfMissingThenValidate({
2787
+ dir: baseDir,
2788
+ label: "Trajectory exports directory",
2789
+ realWorkspace
2790
+ });
2791
+ return {
2792
+ baseDir: path.resolve(baseDir),
2793
+ realBase
2794
+ };
2795
+ }
2796
+ function resolveTrajectoryCommandOutputDir(params) {
2797
+ const { baseDir, realBase } = resolveTrajectoryExportBaseDir(params.workspaceDir);
2798
+ const raw = params.outputPath?.trim();
2799
+ if (!raw) {
2800
+ const defaultDir = resolveDefaultTrajectoryExportDir({
2801
+ workspaceDir: params.workspaceDir,
2802
+ sessionId: params.sessionId
2803
+ });
2804
+ return path.join(baseDir, path.basename(defaultDir));
2805
+ }
2806
+ if (path.isAbsolute(raw) || raw.startsWith("~")) throw new Error("Output path must be relative to the workspace trajectory exports directory");
2807
+ const resolvedBase = path.resolve(baseDir);
2808
+ const outputDir = path.resolve(resolvedBase, raw);
2809
+ const relative = path.relative(resolvedBase, outputDir);
2810
+ if (!relative || relative.startsWith("..") || path.isAbsolute(relative)) throw new Error("Output path must stay inside the workspace trajectory exports directory");
2811
+ let existingParent = outputDir;
2812
+ while (!fs.existsSync(existingParent)) {
2813
+ const next = path.dirname(existingParent);
2814
+ if (next === existingParent) break;
2815
+ existingParent = next;
2816
+ }
2817
+ if (!isPathInsideOrEqual(realBase, fs.realpathSync(existingParent))) throw new Error("Output path must stay inside the real trajectory exports directory");
2818
+ return outputDir;
2819
+ }
2820
+ async function buildExportTrajectoryReply(params) {
2821
+ const args = parseExportCommandOutputPath(params.command.commandBodyNormalized, ["export-trajectory", "trajectory"]);
2822
+ const sessionTarget = resolveExportCommandSessionTarget(params);
2823
+ if (isReplyPayload(sessionTarget)) return sessionTarget;
2824
+ const { entry, sessionFile } = sessionTarget;
2825
+ if (!fs.existsSync(sessionFile)) return { text: "āŒ Session file not found." };
2826
+ let outputDir;
2827
+ try {
2828
+ outputDir = resolveTrajectoryCommandOutputDir({
2829
+ outputPath: args.outputPath,
2830
+ workspaceDir: params.workspaceDir,
2831
+ sessionId: entry.sessionId
2832
+ });
2833
+ } catch (err) {
2834
+ return { text: `āŒ Failed to resolve output path: ${formatErrorMessage(err)}` };
2835
+ }
2836
+ let bundle;
2837
+ try {
2838
+ bundle = exportTrajectoryBundle({
2839
+ outputDir,
2840
+ sessionFile,
2841
+ sessionId: entry.sessionId,
2842
+ sessionKey: params.sessionKey,
2843
+ workspaceDir: params.workspaceDir
2844
+ });
2845
+ } catch (err) {
2846
+ return { text: `āŒ Failed to export trajectory: ${formatErrorMessage(err)}` };
2847
+ }
2848
+ const relativePath = path.relative(params.workspaceDir, bundle.outputDir);
2849
+ const displayPath = relativePath && !relativePath.startsWith("..") && !path.isAbsolute(relativePath) ? relativePath : path.basename(bundle.outputDir);
2850
+ const files = [
2851
+ "manifest.json",
2852
+ "events.jsonl",
2853
+ "session-branch.json"
2854
+ ];
2855
+ if (bundle.events.some((event) => event.type === "context.compiled")) files.push("system-prompt.txt", "tools.json");
2856
+ files.push(...bundle.supplementalFiles);
2857
+ return { text: [
2858
+ "āœ… Trajectory exported!",
2859
+ "",
2860
+ `šŸ“¦ Bundle: ${displayPath}`,
2861
+ `🧵 Session: ${entry.sessionId}`,
2862
+ `šŸ“Š Events: ${bundle.manifest.eventCount}`,
2863
+ `🧪 Runtime events: ${bundle.manifest.runtimeEventCount}`,
2864
+ `šŸ“ Transcript events: ${bundle.manifest.transcriptEventCount}`,
2865
+ `šŸ“ Files: ${files.join(", ")}`
2866
+ ].join("\n") };
2867
+ }
2868
+ //#endregion
2869
+ //#region src/auto-reply/reply/commands-whoami.ts
2870
+ const handleWhoamiCommand = async (params, allowTextCommands) => {
2871
+ if (!allowTextCommands) return null;
2872
+ if (params.command.commandBodyNormalized !== "/whoami") return null;
2873
+ if (!params.command.isAuthorizedSender) {
2874
+ logVerbose(`Ignoring /whoami from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
2875
+ return { shouldContinue: false };
2876
+ }
2877
+ const senderId = params.ctx.SenderId ?? "";
2878
+ const senderUsername = params.ctx.SenderUsername ?? "";
2879
+ const lines = ["🧭 Identity", `Channel: ${params.command.channel}`];
2880
+ if (senderId) lines.push(`User id: ${senderId}`);
2881
+ if (senderUsername) {
2882
+ const handle = senderUsername.startsWith("@") ? senderUsername : `@${senderUsername}`;
2883
+ lines.push(`Username: ${handle}`);
2884
+ }
2885
+ if (params.ctx.ChatType === "group" && params.ctx.From) lines.push(`Chat: ${params.ctx.From}`);
2886
+ if (params.ctx.MessageThreadId != null) lines.push(`Thread: ${params.ctx.MessageThreadId}`);
2887
+ const allowFromSender = params.command.senderId ?? "";
2888
+ if (allowFromSender) lines.push(`AllowFrom: ${allowFromSender}`);
2889
+ return {
2890
+ shouldContinue: false,
2891
+ reply: { text: lines.join("\n") }
2892
+ };
2893
+ };
2894
+ //#endregion
2895
+ //#region src/auto-reply/reply/commands-info.ts
2896
+ const handleHelpCommand = async (params, allowTextCommands) => {
2897
+ if (!allowTextCommands) return null;
2898
+ if (params.command.commandBodyNormalized !== "/help") return null;
2899
+ if (!params.command.isAuthorizedSender) {
2900
+ logVerbose(`Ignoring /help from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
2901
+ return { shouldContinue: false };
2902
+ }
2903
+ return {
2904
+ shouldContinue: false,
2905
+ reply: { text: buildHelpMessage(params.cfg) }
2906
+ };
2907
+ };
2908
+ const handleCommandsListCommand = async (params, allowTextCommands) => {
2909
+ if (!allowTextCommands) return null;
2910
+ if (params.command.commandBodyNormalized !== "/commands") return null;
2911
+ if (!params.command.isAuthorizedSender) {
2912
+ logVerbose(`Ignoring /commands from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
2913
+ return { shouldContinue: false };
2914
+ }
2915
+ const agentId = params.sessionKey ? resolveSessionAgentId({
2916
+ sessionKey: params.sessionKey,
2917
+ config: params.cfg
2918
+ }) : params.agentId;
2919
+ const skillCommands = params.skillCommands ?? listSkillCommandsForAgents({
2920
+ cfg: params.cfg,
2921
+ agentIds: agentId ? [agentId] : void 0
2922
+ });
2923
+ const surface = params.ctx.Surface;
2924
+ const commandPlugin = surface ? getChannelPlugin(surface) : null;
2925
+ const paginated = buildCommandsMessagePaginated(params.cfg, skillCommands, {
2926
+ page: 1,
2927
+ surface
2928
+ });
2929
+ const channelData = commandPlugin?.commands?.buildCommandsListChannelData?.({
2930
+ currentPage: paginated.currentPage,
2931
+ totalPages: paginated.totalPages,
2932
+ agentId
2933
+ });
2934
+ if (channelData) return {
2935
+ shouldContinue: false,
2936
+ reply: {
2937
+ text: paginated.text,
2938
+ channelData
2939
+ }
2940
+ };
2941
+ return {
2942
+ shouldContinue: false,
2943
+ reply: { text: buildCommandsMessage(params.cfg, skillCommands, { surface }) }
2944
+ };
2945
+ };
2946
+ const handleToolsCommand = async (params, allowTextCommands) => {
2947
+ if (!allowTextCommands) return null;
2948
+ const normalized = params.command.commandBodyNormalized;
2949
+ let verbose = false;
2950
+ if (normalized === "/tools" || normalized === "/tools compact") verbose = false;
2951
+ else if (normalized === "/tools verbose") verbose = true;
2952
+ else if (normalized.startsWith("/tools ")) return {
2953
+ shouldContinue: false,
2954
+ reply: { text: "Usage: /tools [compact|verbose]" }
2955
+ };
2956
+ else return null;
2957
+ if (!params.command.isAuthorizedSender) {
2958
+ logVerbose(`Ignoring /tools from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
2959
+ return { shouldContinue: false };
2960
+ }
2961
+ try {
2962
+ const effectiveAccountId = resolveChannelAccountId({
2963
+ cfg: params.cfg,
2964
+ ctx: params.ctx,
2965
+ command: params.command
2966
+ });
2967
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
2968
+ const sessionBound = Boolean(params.sessionKey);
2969
+ const agentId = sessionBound ? resolveSessionAgentId({
2970
+ sessionKey: params.sessionKey,
2971
+ config: params.cfg
2972
+ }) : params.agentId;
2973
+ const threadingContext = buildThreadingToolContext({
2974
+ sessionCtx: params.ctx,
2975
+ config: params.cfg,
2976
+ hasRepliedRef: void 0
2977
+ });
2978
+ return {
2979
+ shouldContinue: false,
2980
+ reply: { text: buildToolsMessage(resolveEffectiveToolInventory({
2981
+ cfg: params.cfg,
2982
+ agentId,
2983
+ sessionKey: params.sessionKey,
2984
+ workspaceDir: params.workspaceDir,
2985
+ agentDir: sessionBound ? void 0 : params.agentDir,
2986
+ modelProvider: params.provider,
2987
+ modelId: params.model,
2988
+ messageProvider: params.command.channel,
2989
+ senderIsOwner: params.command.senderIsOwner,
2990
+ senderId: params.command.senderId,
2991
+ senderName: params.ctx.SenderName,
2992
+ senderUsername: params.ctx.SenderUsername,
2993
+ senderE164: params.ctx.SenderE164,
2994
+ accountId: effectiveAccountId,
2995
+ currentChannelId: threadingContext.currentChannelId,
2996
+ currentThreadTs: typeof params.ctx.MessageThreadId === "string" || typeof params.ctx.MessageThreadId === "number" ? String(params.ctx.MessageThreadId) : void 0,
2997
+ currentMessageId: threadingContext.currentMessageId,
2998
+ groupId: targetSessionEntry?.groupId ?? extractExplicitGroupId(params.ctx.From),
2999
+ groupChannel: targetSessionEntry?.groupChannel ?? params.ctx.GroupChannel ?? params.ctx.GroupSubject,
3000
+ groupSpace: targetSessionEntry?.space ?? params.ctx.GroupSpace,
3001
+ replyToMode: resolveReplyToMode(params.cfg, params.ctx.OriginatingChannel ?? params.ctx.Provider, effectiveAccountId, params.ctx.ChatType)
3002
+ }), { verbose }) }
3003
+ };
3004
+ } catch (err) {
3005
+ return {
3006
+ shouldContinue: false,
3007
+ reply: { text: String(err).includes("missing scope:") ? "You do not have permission to view available tools." : "Couldn't load available tools right now. Try again in a moment." }
3008
+ };
3009
+ }
3010
+ };
3011
+ const handleStatusCommand = async (params, allowTextCommands) => {
3012
+ if (!allowTextCommands) return null;
3013
+ if (!(params.directives.hasStatusDirective || params.command.commandBodyNormalized === "/status")) return null;
3014
+ if (!params.command.isAuthorizedSender) {
3015
+ logVerbose(`Ignoring /status from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
3016
+ return { shouldContinue: false };
3017
+ }
3018
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
3019
+ return {
3020
+ shouldContinue: false,
3021
+ reply: await buildStatusReply({
3022
+ cfg: params.cfg,
3023
+ command: params.command,
3024
+ sessionEntry: targetSessionEntry,
3025
+ sessionKey: params.sessionKey,
3026
+ parentSessionKey: targetSessionEntry?.parentSessionKey ?? params.ctx.ParentSessionKey,
3027
+ sessionScope: params.sessionScope,
3028
+ storePath: params.storePath,
3029
+ provider: params.provider,
3030
+ model: params.model,
3031
+ contextTokens: params.contextTokens,
3032
+ resolvedThinkLevel: params.resolvedThinkLevel,
3033
+ resolvedFastMode: params.resolvedFastMode,
3034
+ resolvedVerboseLevel: params.resolvedVerboseLevel,
3035
+ resolvedReasoningLevel: params.resolvedReasoningLevel,
3036
+ resolvedElevatedLevel: params.resolvedElevatedLevel,
3037
+ resolveDefaultThinkingLevel: params.resolveDefaultThinkingLevel,
3038
+ isGroup: params.isGroup,
3039
+ defaultGroupActivation: params.defaultGroupActivation,
3040
+ mediaDecisions: params.ctx.MediaUnderstandingDecisions
3041
+ })
3042
+ };
3043
+ };
3044
+ const handleExportSessionCommand = async (params, allowTextCommands) => {
3045
+ if (!allowTextCommands) return null;
3046
+ const normalized = params.command.commandBodyNormalized;
3047
+ if (normalized !== "/export-session" && !normalized.startsWith("/export-session ") && normalized !== "/export" && !normalized.startsWith("/export ")) return null;
3048
+ if (!params.command.isAuthorizedSender) {
3049
+ logVerbose(`Ignoring /export-session from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
3050
+ return { shouldContinue: false };
3051
+ }
3052
+ return {
3053
+ shouldContinue: false,
3054
+ reply: await buildExportSessionReply(params)
3055
+ };
3056
+ };
3057
+ const handleExportTrajectoryCommand = async (params, allowTextCommands) => {
3058
+ if (!allowTextCommands) return null;
3059
+ const normalized = params.command.commandBodyNormalized;
3060
+ if (normalized !== "/export-trajectory" && !normalized.startsWith("/export-trajectory ") && normalized !== "/trajectory" && !normalized.startsWith("/trajectory ")) return null;
3061
+ const unauthorized = rejectUnauthorizedCommand(params, "/export-trajectory");
3062
+ if (unauthorized) return unauthorized;
3063
+ const nonOwner = rejectNonOwnerCommand(params, "/export-trajectory");
3064
+ if (nonOwner) return nonOwner;
3065
+ return {
3066
+ shouldContinue: false,
3067
+ reply: await buildExportTrajectoryReply(params)
3068
+ };
3069
+ };
3070
+ //#endregion
3071
+ //#region src/auto-reply/reply/mcp-commands.ts
3072
+ function parseMcpCommand(raw) {
3073
+ return parseStandardSetUnsetSlashCommand({
3074
+ raw,
3075
+ slash: "/mcp",
3076
+ invalidMessage: "Invalid /mcp syntax.",
3077
+ usageMessage: "Usage: /mcp show|set|unset",
3078
+ onKnownAction: (action, args) => {
3079
+ if (action === "show" || action === "get") return {
3080
+ action: "show",
3081
+ name: args || void 0
3082
+ };
3083
+ },
3084
+ onSet: (name, value) => ({
3085
+ action: "set",
3086
+ name,
3087
+ value
3088
+ }),
3089
+ onUnset: (name) => ({
3090
+ action: "unset",
3091
+ name
3092
+ })
3093
+ });
3094
+ }
3095
+ //#endregion
3096
+ //#region src/auto-reply/reply/commands-mcp.ts
3097
+ function renderJsonBlock$1(label, value) {
3098
+ return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
3099
+ }
3100
+ const handleMcpCommand = async (params, allowTextCommands) => {
3101
+ if (!allowTextCommands) return null;
3102
+ const mcpCommand = parseMcpCommand(params.command.commandBodyNormalized);
3103
+ if (!mcpCommand) return null;
3104
+ const unauthorized = rejectUnauthorizedCommand(params, "/mcp");
3105
+ if (unauthorized) return unauthorized;
3106
+ const nonOwner = mcpCommand.action === "show" && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/mcp");
3107
+ if (nonOwner) return nonOwner;
3108
+ const disabled = requireCommandFlagEnabled(params.cfg, {
3109
+ label: "/mcp",
3110
+ configKey: "mcp"
3111
+ });
3112
+ if (disabled) return disabled;
3113
+ if (mcpCommand.action === "error") return {
3114
+ shouldContinue: false,
3115
+ reply: { text: `āš ļø ${mcpCommand.message}` }
3116
+ };
3117
+ if (mcpCommand.action === "show") {
3118
+ const loaded = await listConfiguredMcpServers();
3119
+ if (!loaded.ok) return {
3120
+ shouldContinue: false,
3121
+ reply: { text: `āš ļø ${loaded.error}` }
3122
+ };
3123
+ if (mcpCommand.name) {
3124
+ const server = loaded.mcpServers[mcpCommand.name];
3125
+ if (!server) return {
3126
+ shouldContinue: false,
3127
+ reply: { text: `šŸ”Œ No MCP server named "${mcpCommand.name}" in ${loaded.path}.` }
3128
+ };
3129
+ return {
3130
+ shouldContinue: false,
3131
+ reply: { text: renderJsonBlock$1(`šŸ”Œ MCP server "${mcpCommand.name}" (${loaded.path})`, server) }
3132
+ };
3133
+ }
3134
+ if (Object.keys(loaded.mcpServers).length === 0) return {
3135
+ shouldContinue: false,
3136
+ reply: { text: `šŸ”Œ No MCP servers configured in ${loaded.path}.` }
3137
+ };
3138
+ return {
3139
+ shouldContinue: false,
3140
+ reply: { text: renderJsonBlock$1(`šŸ”Œ MCP servers (${loaded.path})`, loaded.mcpServers) }
3141
+ };
3142
+ }
3143
+ const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
3144
+ label: "/mcp write",
3145
+ allowedScopes: ["operator.admin"],
3146
+ missingText: "āŒ /mcp set|unset requires operator.admin for gateway clients."
3147
+ });
3148
+ if (missingAdminScope) return missingAdminScope;
3149
+ if (mcpCommand.action === "set") {
3150
+ const result = await setConfiguredMcpServer({
3151
+ name: mcpCommand.name,
3152
+ server: mcpCommand.value
3153
+ });
3154
+ if (!result.ok) return {
3155
+ shouldContinue: false,
3156
+ reply: { text: `āš ļø ${result.error}` }
3157
+ };
3158
+ return {
3159
+ shouldContinue: false,
3160
+ reply: { text: `šŸ”Œ MCP server "${mcpCommand.name}" saved to ${result.path}.` }
3161
+ };
3162
+ }
3163
+ const result = await unsetConfiguredMcpServer({ name: mcpCommand.name });
3164
+ if (!result.ok) return {
3165
+ shouldContinue: false,
3166
+ reply: { text: `āš ļø ${result.error}` }
3167
+ };
3168
+ if (!result.removed) return {
3169
+ shouldContinue: false,
3170
+ reply: { text: `šŸ”Œ No MCP server named "${mcpCommand.name}" in ${result.path}.` }
3171
+ };
3172
+ return {
3173
+ shouldContinue: false,
3174
+ reply: { text: `šŸ”Œ MCP server "${mcpCommand.name}" removed from ${result.path}.` }
3175
+ };
3176
+ };
3177
+ //#endregion
3178
+ //#region src/auto-reply/reply/commands-plugin.ts
3179
+ /**
3180
+ * Plugin Command Handler
3181
+ *
3182
+ * Handles commands registered by plugins, bypassing the LLM agent.
3183
+ * This handler is called before built-in command handlers.
3184
+ */
3185
+ /**
3186
+ * Handle plugin-registered commands.
3187
+ * Returns a result if a plugin command was matched and executed,
3188
+ * or null to continue to the next handler.
3189
+ */
3190
+ const handlePluginCommand = async (params, allowTextCommands) => {
3191
+ const { command, cfg } = params;
3192
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
3193
+ if (!allowTextCommands) return null;
3194
+ const match = matchPluginCommand(command.commandBodyNormalized);
3195
+ if (!match) return null;
3196
+ return {
3197
+ shouldContinue: false,
3198
+ reply: await executePluginCommand({
3199
+ command: match.command,
3200
+ args: match.args,
3201
+ senderId: command.senderId,
3202
+ channel: command.channel,
3203
+ channelId: command.channelId,
3204
+ isAuthorizedSender: command.isAuthorizedSender,
3205
+ gatewayClientScopes: params.ctx.GatewayClientScopes,
3206
+ sessionKey: params.sessionKey,
3207
+ sessionId: targetSessionEntry?.sessionId,
3208
+ sessionFile: targetSessionEntry?.sessionFile,
3209
+ commandBody: command.commandBodyNormalized,
3210
+ config: cfg,
3211
+ from: command.from,
3212
+ to: command.to,
3213
+ accountId: params.ctx.AccountId ?? void 0,
3214
+ messageThreadId: typeof params.ctx.MessageThreadId === "string" || typeof params.ctx.MessageThreadId === "number" ? params.ctx.MessageThreadId : void 0,
3215
+ threadParentId: normalizeOptionalString(params.ctx.ThreadParentId)
3216
+ })
3217
+ };
3218
+ };
3219
+ //#endregion
3220
+ //#region src/auto-reply/reply/plugins-commands.ts
3221
+ function parsePluginsCommand(raw) {
3222
+ const match = raw.match(/^\/plugins?(?:\s+(.*))?$/i);
3223
+ if (!match) return null;
3224
+ const tail = normalizeOptionalString(match?.[1]) ?? "";
3225
+ if (!tail) return { action: "list" };
3226
+ const [rawAction, ...rest] = tail.split(/\s+/);
3227
+ const action = normalizeOptionalLowercaseString(rawAction);
3228
+ const name = rest.join(" ").trim();
3229
+ if (action === "list") return name ? {
3230
+ action: "error",
3231
+ message: "Usage: /plugins list|inspect|show|get|enable|disable [plugin]"
3232
+ } : { action: "list" };
3233
+ if (action === "inspect" || action === "show" || action === "get") return {
3234
+ action: "inspect",
3235
+ name: name || void 0
3236
+ };
3237
+ if (action === "install" || action === "add") {
3238
+ if (!name) return {
3239
+ action: "error",
3240
+ message: "Usage: /plugins install <path|archive|npm-spec|clawhub:pkg>"
3241
+ };
3242
+ return {
3243
+ action: "install",
3244
+ spec: name
3245
+ };
3246
+ }
3247
+ if (action === "enable" || action === "disable") {
3248
+ if (!name) return {
3249
+ action: "error",
3250
+ message: `Usage: /plugins ${action} <plugin-id-or-name>`
3251
+ };
3252
+ return {
3253
+ action,
3254
+ name
3255
+ };
3256
+ }
3257
+ return {
3258
+ action: "error",
3259
+ message: "Usage: /plugins list|inspect|show|get|install|enable|disable [plugin]"
3260
+ };
3261
+ }
3262
+ //#endregion
3263
+ //#region src/auto-reply/reply/commands-plugins.ts
3264
+ function renderJsonBlock(label, value) {
3265
+ return `${label}\n\`\`\`json\n${JSON.stringify(value, null, 2)}\n\`\`\``;
3266
+ }
3267
+ function buildPluginInspectJson(params) {
3268
+ const inspect = buildPluginInspectReport({
3269
+ id: params.id,
3270
+ config: params.config,
3271
+ report: params.report
3272
+ });
3273
+ if (!inspect) return null;
3274
+ return {
3275
+ inspect,
3276
+ compatibilityWarnings: inspect.compatibility.map((warning) => ({
3277
+ code: warning.code,
3278
+ severity: warning.severity,
3279
+ message: formatPluginCompatibilityNotice(warning)
3280
+ })),
3281
+ install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
3282
+ };
3283
+ }
3284
+ function buildAllPluginInspectJson(params) {
3285
+ return buildAllPluginInspectReports({
3286
+ config: params.config,
3287
+ report: params.report
3288
+ }).map((inspect) => ({
3289
+ inspect,
3290
+ compatibilityWarnings: inspect.compatibility.map((warning) => ({
3291
+ code: warning.code,
3292
+ severity: warning.severity,
3293
+ message: formatPluginCompatibilityNotice(warning)
3294
+ })),
3295
+ install: params.config.plugins?.installs?.[inspect.plugin.id] ?? null
3296
+ }));
3297
+ }
3298
+ function formatPluginLabel(plugin) {
3299
+ if (!plugin.name || plugin.name === plugin.id) return plugin.id;
3300
+ return `${plugin.name} (${plugin.id})`;
3301
+ }
3302
+ function formatPluginsList(report) {
3303
+ if (report.plugins.length === 0) return `šŸ”Œ No plugins found for workspace ${report.workspaceDir ?? "(unknown workspace)"}.`;
3304
+ return [`šŸ”Œ Plugins (${report.plugins.filter((plugin) => plugin.status === "loaded").length}/${report.plugins.length} loaded)`, ...report.plugins.map((plugin) => {
3305
+ const format = plugin.bundleFormat ? `${plugin.format ?? "genesis"}/${plugin.bundleFormat}` : plugin.format ?? "genesis";
3306
+ return `- ${formatPluginLabel(plugin)} [${plugin.status}] ${format}`;
3307
+ })].join("\n");
3308
+ }
3309
+ function findPlugin(report, rawName) {
3310
+ const target = normalizeOptionalLowercaseString(rawName);
3311
+ if (!target) return;
3312
+ return report.plugins.find((plugin) => normalizeOptionalLowercaseString(plugin.id) === target || normalizeOptionalLowercaseString(plugin.name) === target);
3313
+ }
3314
+ function looksLikeLocalPluginInstallSpec(raw) {
3315
+ return raw.startsWith(".") || raw.startsWith("~") || raw.startsWith("/") || raw.endsWith(".ts") || raw.endsWith(".js") || raw.endsWith(".mjs") || raw.endsWith(".cjs") || raw.endsWith(".tgz") || raw.endsWith(".tar.gz") || raw.endsWith(".tar") || raw.endsWith(".zip");
3316
+ }
3317
+ async function installPluginFromPluginsCommand(params) {
3318
+ const fileSpec = resolveFileNpmSpecToLocalPath(params.raw);
3319
+ if (fileSpec && !fileSpec.ok) return {
3320
+ ok: false,
3321
+ error: fileSpec.error
3322
+ };
3323
+ const resolved = resolveUserPath(fileSpec && fileSpec.ok ? fileSpec.path : params.raw);
3324
+ if (fs.existsSync(resolved)) {
3325
+ const result = await installPluginFromPath({
3326
+ path: resolved,
3327
+ logger: createPluginInstallLogger()
3328
+ });
3329
+ if (!result.ok) return {
3330
+ ok: false,
3331
+ error: result.error
3332
+ };
3333
+ clearPluginManifestRegistryCache();
3334
+ const source = resolveArchiveKind(resolved) ? "archive" : "path";
3335
+ await persistPluginInstall({
3336
+ config: params.config,
3337
+ pluginId: result.pluginId,
3338
+ install: {
3339
+ source,
3340
+ sourcePath: resolved,
3341
+ installPath: result.targetDir,
3342
+ version: result.version
3343
+ }
3344
+ });
3345
+ return {
3346
+ ok: true,
3347
+ pluginId: result.pluginId
3348
+ };
3349
+ }
3350
+ if (looksLikeLocalPluginInstallSpec(params.raw)) return {
3351
+ ok: false,
3352
+ error: `Path not found: ${resolved}`
3353
+ };
3354
+ if (parseClawHubPluginSpec(params.raw)) {
3355
+ const result = await installPluginFromClawHub({
3356
+ spec: params.raw,
3357
+ logger: createPluginInstallLogger()
3358
+ });
3359
+ if (!result.ok) return {
3360
+ ok: false,
3361
+ error: result.error
3362
+ };
3363
+ clearPluginManifestRegistryCache();
3364
+ await persistPluginInstall({
3365
+ config: params.config,
3366
+ pluginId: result.pluginId,
3367
+ install: {
3368
+ source: "clawhub",
3369
+ spec: params.raw,
3370
+ installPath: result.targetDir,
3371
+ version: result.version,
3372
+ integrity: result.clawhub.integrity,
3373
+ resolvedAt: result.clawhub.resolvedAt,
3374
+ clawhubUrl: result.clawhub.clawhubUrl,
3375
+ clawhubPackage: result.clawhub.clawhubPackage,
3376
+ clawhubFamily: result.clawhub.clawhubFamily,
3377
+ clawhubChannel: result.clawhub.clawhubChannel
3378
+ }
3379
+ });
3380
+ return {
3381
+ ok: true,
3382
+ pluginId: result.pluginId
3383
+ };
3384
+ }
3385
+ const preferredClawHubSpec = buildPreferredClawHubSpec(params.raw);
3386
+ if (preferredClawHubSpec) {
3387
+ const clawhubResult = await installPluginFromClawHub({
3388
+ spec: preferredClawHubSpec,
3389
+ logger: createPluginInstallLogger()
3390
+ });
3391
+ if (clawhubResult.ok) {
3392
+ clearPluginManifestRegistryCache();
3393
+ await persistPluginInstall({
3394
+ config: params.config,
3395
+ pluginId: clawhubResult.pluginId,
3396
+ install: {
3397
+ source: "clawhub",
3398
+ spec: preferredClawHubSpec,
3399
+ installPath: clawhubResult.targetDir,
3400
+ version: clawhubResult.version,
3401
+ integrity: clawhubResult.clawhub.integrity,
3402
+ resolvedAt: clawhubResult.clawhub.resolvedAt,
3403
+ clawhubUrl: clawhubResult.clawhub.clawhubUrl,
3404
+ clawhubPackage: clawhubResult.clawhub.clawhubPackage,
3405
+ clawhubFamily: clawhubResult.clawhub.clawhubFamily,
3406
+ clawhubChannel: clawhubResult.clawhub.clawhubChannel
3407
+ }
3408
+ });
3409
+ return {
3410
+ ok: true,
3411
+ pluginId: clawhubResult.pluginId
3412
+ };
3413
+ }
3414
+ if (decidePreferredClawHubFallback(clawhubResult) !== "fallback_to_npm") return {
3415
+ ok: false,
3416
+ error: clawhubResult.error
3417
+ };
3418
+ }
3419
+ const result = await installPluginFromNpmSpec({
3420
+ spec: params.raw,
3421
+ logger: createPluginInstallLogger()
3422
+ });
3423
+ if (!result.ok) return {
3424
+ ok: false,
3425
+ error: result.error
3426
+ };
3427
+ clearPluginManifestRegistryCache();
3428
+ const installRecord = buildNpmInstallRecordFields({
3429
+ spec: params.raw,
3430
+ installPath: result.targetDir,
3431
+ version: result.version,
3432
+ resolution: result.npmResolution
3433
+ });
3434
+ await persistPluginInstall({
3435
+ config: params.config,
3436
+ pluginId: result.pluginId,
3437
+ install: installRecord
3438
+ });
3439
+ return {
3440
+ ok: true,
3441
+ pluginId: result.pluginId
3442
+ };
3443
+ }
3444
+ async function loadPluginCommandState(workspaceDir, options) {
3445
+ const snapshot = await readConfigFileSnapshot();
3446
+ if (!snapshot.valid) return {
3447
+ ok: false,
3448
+ path: snapshot.path,
3449
+ error: "Config file is invalid; fix it before using /plugins."
3450
+ };
3451
+ const config = structuredClone(snapshot.resolved);
3452
+ return {
3453
+ ok: true,
3454
+ path: snapshot.path,
3455
+ config,
3456
+ report: options?.loadModules === true ? buildPluginDiagnosticsReport({
3457
+ config,
3458
+ workspaceDir
3459
+ }) : buildPluginSnapshotReport({
3460
+ config,
3461
+ workspaceDir
3462
+ })
3463
+ };
3464
+ }
3465
+ async function loadPluginCommandConfig() {
3466
+ const snapshot = await readConfigFileSnapshot();
3467
+ if (!snapshot.valid) return {
3468
+ ok: false,
3469
+ path: snapshot.path,
3470
+ error: "Config file is invalid; fix it before using /plugins."
3471
+ };
3472
+ return {
3473
+ ok: true,
3474
+ path: snapshot.path,
3475
+ config: structuredClone(snapshot.resolved)
3476
+ };
3477
+ }
3478
+ const handlePluginsCommand = async (params, allowTextCommands) => {
3479
+ if (!allowTextCommands) return null;
3480
+ const pluginsCommand = parsePluginsCommand(params.command.commandBodyNormalized);
3481
+ if (!pluginsCommand) return null;
3482
+ const unauthorized = rejectUnauthorizedCommand(params, "/plugins");
3483
+ if (unauthorized) return unauthorized;
3484
+ const nonOwner = (pluginsCommand.action === "list" || pluginsCommand.action === "inspect") && isInternalMessageChannel(params.command.channel) ? null : rejectNonOwnerCommand(params, "/plugins");
3485
+ if (nonOwner) return nonOwner;
3486
+ const disabled = requireCommandFlagEnabled(params.cfg, {
3487
+ label: "/plugins",
3488
+ configKey: "plugins"
3489
+ });
3490
+ if (disabled) return disabled;
3491
+ if (pluginsCommand.action === "error") return {
3492
+ shouldContinue: false,
3493
+ reply: { text: `āš ļø ${pluginsCommand.message}` }
3494
+ };
3495
+ const missingAdminScope = requireGatewayClientScopeForInternalChannel(params, {
3496
+ label: "/plugins write",
3497
+ allowedScopes: ["operator.admin"],
3498
+ missingText: "āŒ /plugins install|enable|disable requires operator.admin for gateway clients."
3499
+ });
3500
+ if (missingAdminScope) return missingAdminScope;
3501
+ if (pluginsCommand.action === "install") {
3502
+ const loadedConfig = await loadPluginCommandConfig();
3503
+ if (!loadedConfig.ok) return {
3504
+ shouldContinue: false,
3505
+ reply: { text: `āš ļø ${loadedConfig.error}` }
3506
+ };
3507
+ const installed = await installPluginFromPluginsCommand({
3508
+ raw: pluginsCommand.spec,
3509
+ config: loadedConfig.config
3510
+ });
3511
+ if (!installed.ok) return {
3512
+ shouldContinue: false,
3513
+ reply: { text: `āš ļø ${installed.error}` }
3514
+ };
3515
+ return {
3516
+ shouldContinue: false,
3517
+ reply: { text: `šŸ”Œ Installed plugin "${installed.pluginId}". Restart the gateway to load plugins.` }
3518
+ };
3519
+ }
3520
+ const loaded = await loadPluginCommandState(params.workspaceDir, { loadModules: pluginsCommand.action !== "list" });
3521
+ if (!loaded.ok) return {
3522
+ shouldContinue: false,
3523
+ reply: { text: `āš ļø ${loaded.error}` }
3524
+ };
3525
+ if (pluginsCommand.action === "list") return {
3526
+ shouldContinue: false,
3527
+ reply: { text: formatPluginsList(loaded.report) }
3528
+ };
3529
+ if (pluginsCommand.action === "inspect") {
3530
+ if (!pluginsCommand.name) return {
3531
+ shouldContinue: false,
3532
+ reply: { text: formatPluginsList(loaded.report) }
3533
+ };
3534
+ if (normalizeOptionalLowercaseString(pluginsCommand.name) === "all") return {
3535
+ shouldContinue: false,
3536
+ reply: { text: renderJsonBlock("šŸ”Œ Plugins", buildAllPluginInspectJson(loaded)) }
3537
+ };
3538
+ const payload = buildPluginInspectJson({
3539
+ id: pluginsCommand.name,
3540
+ config: loaded.config,
3541
+ report: loaded.report
3542
+ });
3543
+ if (!payload) return {
3544
+ shouldContinue: false,
3545
+ reply: { text: `šŸ”Œ No plugin named "${pluginsCommand.name}" found.` }
3546
+ };
3547
+ return {
3548
+ shouldContinue: false,
3549
+ reply: { text: renderJsonBlock(`šŸ”Œ Plugin "${payload.inspect.plugin.id}"`, {
3550
+ ...payload.inspect,
3551
+ compatibilityWarnings: payload.compatibilityWarnings,
3552
+ install: payload.install
3553
+ }) }
3554
+ };
3555
+ }
3556
+ const plugin = findPlugin(loaded.report, pluginsCommand.name);
3557
+ if (!plugin) return {
3558
+ shouldContinue: false,
3559
+ reply: { text: `šŸ”Œ No plugin named "${pluginsCommand.name}" found.` }
3560
+ };
3561
+ const validated = validateConfigObjectWithPlugins(setPluginEnabledInConfig(structuredClone(loaded.config), plugin.id, pluginsCommand.action === "enable"));
3562
+ if (!validated.ok) {
3563
+ const issue = validated.issues[0];
3564
+ return {
3565
+ shouldContinue: false,
3566
+ reply: { text: `āš ļø Config invalid after /plugins ${pluginsCommand.action} (${issue.path}: ${issue.message}).` }
3567
+ };
3568
+ }
3569
+ await writeConfigFile(validated.config);
3570
+ return {
3571
+ shouldContinue: false,
3572
+ reply: { text: `šŸ”Œ Plugin "${plugin.id}" ${pluginsCommand.action}d in ${loaded.path}. Restart the gateway to apply.` }
3573
+ };
3574
+ };
3575
+ //#endregion
3576
+ //#region src/auto-reply/send-policy.ts
3577
+ function normalizeSendPolicyOverride(raw) {
3578
+ const value = normalizeOptionalLowercaseString(raw);
3579
+ if (!value) return;
3580
+ if (value === "allow" || value === "on") return "allow";
3581
+ if (value === "deny" || value === "off") return "deny";
3582
+ }
3583
+ function parseSendPolicyCommand(raw) {
3584
+ if (!raw) return { hasCommand: false };
3585
+ const trimmed = raw.trim();
3586
+ if (!trimmed) return { hasCommand: false };
3587
+ const match = normalizeCommandBody(stripInboundMetadata(trimmed)).match(/^\/send(?:\s+([a-zA-Z]+))?\s*$/i);
3588
+ if (!match) return { hasCommand: false };
3589
+ const token = normalizeOptionalLowercaseString(match[1]);
3590
+ if (!token) return { hasCommand: true };
3591
+ if (token === "inherit" || token === "default" || token === "reset") return {
3592
+ hasCommand: true,
3593
+ mode: "inherit"
3594
+ };
3595
+ return {
3596
+ hasCommand: true,
3597
+ mode: normalizeSendPolicyOverride(token)
3598
+ };
3599
+ }
3600
+ //#endregion
3601
+ //#region src/auto-reply/reply/commands-session-store.ts
3602
+ async function persistSessionEntry(params) {
3603
+ if (!params.sessionEntry || !params.sessionStore || !params.sessionKey) return false;
3604
+ params.sessionEntry.updatedAt = Date.now();
3605
+ params.sessionStore[params.sessionKey] = params.sessionEntry;
3606
+ if (params.storePath) await updateSessionStore(params.storePath, (store) => {
3607
+ store[params.sessionKey] = params.sessionEntry;
3608
+ });
3609
+ return true;
3610
+ }
3611
+ async function persistAbortTargetEntry(params) {
3612
+ const { entry, key, sessionStore, storePath, abortCutoff } = params;
3613
+ if (!entry || !key || !sessionStore) return false;
3614
+ entry.abortedLastRun = true;
3615
+ applyAbortCutoffToSessionEntry(entry, abortCutoff);
3616
+ entry.updatedAt = Date.now();
3617
+ sessionStore[key] = entry;
3618
+ if (storePath) await updateSessionStore(storePath, (store) => {
3619
+ const nextEntry = store[key] ?? entry;
3620
+ if (!nextEntry) return;
3621
+ nextEntry.abortedLastRun = true;
3622
+ applyAbortCutoffToSessionEntry(nextEntry, abortCutoff);
3623
+ nextEntry.updatedAt = Date.now();
3624
+ store[key] = nextEntry;
3625
+ });
3626
+ return true;
3627
+ }
3628
+ //#endregion
3629
+ //#region src/auto-reply/reply/commands-session-abort.ts
3630
+ async function abortEmbeddedPiRunForSession(sessionId) {
3631
+ const { abortEmbeddedPiRun } = await import("./runs-DWOm31T_.js");
3632
+ abortEmbeddedPiRun(sessionId);
3633
+ }
3634
+ function resolveAbortTarget(params) {
3635
+ const targetSessionKey = normalizeOptionalString(params.ctx.CommandTargetSessionKey) || params.sessionKey;
3636
+ const { entry, key } = resolveSessionEntryForKey(params.sessionStore, targetSessionKey);
3637
+ if (entry && key) return {
3638
+ entry,
3639
+ key,
3640
+ sessionId: replyRunRegistry.resolveSessionId(key) ?? entry.sessionId
3641
+ };
3642
+ if (params.sessionEntry && params.sessionKey && (!targetSessionKey || targetSessionKey === params.sessionKey)) return {
3643
+ entry: params.sessionEntry,
3644
+ key: params.sessionKey,
3645
+ sessionId: replyRunRegistry.resolveSessionId(params.sessionKey) ?? params.sessionEntry.sessionId
3646
+ };
3647
+ return {
3648
+ entry: void 0,
3649
+ key: targetSessionKey,
3650
+ sessionId: targetSessionKey ? replyRunRegistry.resolveSessionId(targetSessionKey) : void 0
3651
+ };
3652
+ }
3653
+ function resolveAbortCutoffForTarget(params) {
3654
+ if (!shouldPersistAbortCutoff({
3655
+ commandSessionKey: params.commandSessionKey,
3656
+ targetSessionKey: params.targetSessionKey
3657
+ })) return;
3658
+ return resolveAbortCutoffFromContext(params.ctx);
3659
+ }
3660
+ async function applyAbortTarget(params) {
3661
+ const { abortTarget } = params;
3662
+ if (abortTarget.key) replyRunRegistry.abort(abortTarget.key);
3663
+ if (abortTarget.sessionId) await abortEmbeddedPiRunForSession(abortTarget.sessionId);
3664
+ if (!await persistAbortTargetEntry({
3665
+ entry: abortTarget.entry,
3666
+ key: abortTarget.key,
3667
+ sessionStore: params.sessionStore,
3668
+ storePath: params.storePath,
3669
+ abortCutoff: params.abortCutoff
3670
+ }) && params.abortKey) setAbortMemory(params.abortKey, true);
3671
+ }
3672
+ function buildAbortTargetApplyParams(params, abortTarget) {
3673
+ return {
3674
+ abortTarget,
3675
+ sessionStore: params.sessionStore,
3676
+ storePath: params.storePath,
3677
+ abortKey: params.command.abortKey,
3678
+ abortCutoff: resolveAbortCutoffForTarget({
3679
+ ctx: params.ctx,
3680
+ commandSessionKey: params.sessionKey,
3681
+ targetSessionKey: abortTarget.key
3682
+ })
3683
+ };
3684
+ }
3685
+ const handleStopCommand = async (params, allowTextCommands) => {
3686
+ if (!allowTextCommands) return null;
3687
+ if (params.command.commandBodyNormalized !== "/stop") return null;
3688
+ const unauthorizedStop = rejectUnauthorizedCommand(params, "/stop");
3689
+ if (unauthorizedStop) return unauthorizedStop;
3690
+ const abortTarget = resolveAbortTarget({
3691
+ ctx: params.ctx,
3692
+ sessionKey: params.sessionKey,
3693
+ sessionEntry: params.sessionEntry,
3694
+ sessionStore: params.sessionStore
3695
+ });
3696
+ const cleared = clearSessionQueues([abortTarget.key, abortTarget.sessionId]);
3697
+ if (cleared.followupCleared > 0 || cleared.laneCleared > 0) logVerbose(`stop: cleared followups=${cleared.followupCleared} lane=${cleared.laneCleared} keys=${cleared.keys.join(",")}`);
3698
+ await applyAbortTarget(buildAbortTargetApplyParams(params, abortTarget));
3699
+ await triggerInternalHook(createInternalHookEvent("command", "stop", abortTarget.key ?? params.sessionKey ?? "", {
3700
+ sessionEntry: abortTarget.entry,
3701
+ sessionId: abortTarget.sessionId,
3702
+ commandSource: params.command.surface,
3703
+ senderId: params.command.senderId
3704
+ }));
3705
+ const { stopped } = stopSubagentsForRequester({
3706
+ cfg: params.cfg,
3707
+ requesterSessionKey: abortTarget.key ?? params.sessionKey
3708
+ });
3709
+ return {
3710
+ shouldContinue: false,
3711
+ reply: { text: formatAbortReplyText(stopped) }
3712
+ };
3713
+ };
3714
+ const handleAbortTrigger = async (params, allowTextCommands) => {
3715
+ if (!allowTextCommands) return null;
3716
+ if (!isAbortTrigger(params.command.rawBodyNormalized)) return null;
3717
+ const unauthorizedAbortTrigger = rejectUnauthorizedCommand(params, "abort trigger");
3718
+ if (unauthorizedAbortTrigger) return unauthorizedAbortTrigger;
3719
+ await applyAbortTarget(buildAbortTargetApplyParams(params, resolveAbortTarget({
3720
+ ctx: params.ctx,
3721
+ sessionKey: params.sessionKey,
3722
+ sessionEntry: params.sessionEntry,
3723
+ sessionStore: params.sessionStore
3724
+ })));
3725
+ return {
3726
+ shouldContinue: false,
3727
+ reply: { text: "āš™ļø Agent was aborted." }
3728
+ };
3729
+ };
3730
+ //#endregion
3731
+ //#region src/auto-reply/reply/commands-session.ts
3732
+ const SESSION_DURATION_OFF_VALUES = new Set([
3733
+ "off",
3734
+ "disable",
3735
+ "disabled",
3736
+ "none",
3737
+ "0"
3738
+ ]);
3739
+ const SESSION_ACTION_IDLE = "idle";
3740
+ const SESSION_ACTION_MAX_AGE = "max-age";
3741
+ function buildRestartCommandSentinel(params) {
3742
+ const sessionKey = normalizeOptionalString(params.sessionKey);
3743
+ if (!sessionKey) return null;
3744
+ const { deliveryContext, threadId } = extractDeliveryInfo(sessionKey);
3745
+ return {
3746
+ kind: "restart",
3747
+ status: "ok",
3748
+ ts: Date.now(),
3749
+ sessionKey,
3750
+ deliveryContext,
3751
+ threadId,
3752
+ message: "/restart",
3753
+ continuation: buildRestartSuccessContinuation({ sessionKey }),
3754
+ doctorHint: formatDoctorNonInteractiveHint(),
3755
+ stats: {
3756
+ mode: "gateway.restart",
3757
+ reason: "/restart"
3758
+ }
3759
+ };
3760
+ }
3761
+ function resolveSessionCommandUsage() {
3762
+ return "Usage: /session idle <duration|off> | /session max-age <duration|off> (example: /session idle 24h)";
3763
+ }
3764
+ function parseSessionDurationMs(raw) {
3765
+ const normalized = normalizeOptionalLowercaseString(raw);
3766
+ if (!normalized) throw new Error("missing duration");
3767
+ if (SESSION_DURATION_OFF_VALUES.has(normalized)) return 0;
3768
+ if (/^\d+(?:\.\d+)?$/.test(normalized)) {
3769
+ const hours = Number(normalized);
3770
+ if (!Number.isFinite(hours) || hours < 0) throw new Error("invalid duration");
3771
+ return Math.round(hours * 60 * 60 * 1e3);
3772
+ }
3773
+ return parseDurationMs(normalized, { defaultUnit: "h" });
3774
+ }
3775
+ function formatSessionExpiry(expiresAt) {
3776
+ return new Date(expiresAt).toISOString();
3777
+ }
3778
+ function resolveSessionBindingDurationMs(binding, key, fallbackMs) {
3779
+ const raw = binding.metadata?.[key];
3780
+ if (typeof raw !== "number" || !Number.isFinite(raw)) return fallbackMs;
3781
+ return Math.max(0, Math.floor(raw));
3782
+ }
3783
+ function resolveSessionBindingLastActivityAt(binding) {
3784
+ const raw = binding.metadata?.lastActivityAt;
3785
+ if (typeof raw !== "number" || !Number.isFinite(raw)) return binding.boundAt;
3786
+ return Math.max(Math.floor(raw), binding.boundAt);
3787
+ }
3788
+ function resolveSessionBindingBoundBy(binding) {
3789
+ const raw = binding.metadata?.boundBy;
3790
+ return normalizeOptionalString(raw) ?? "";
3791
+ }
3792
+ function isSessionBindingRecord(binding) {
3793
+ return "bindingId" in binding;
3794
+ }
3795
+ function resolveUpdatedLifecycleDurationMs(binding, key) {
3796
+ if (!isSessionBindingRecord(binding)) {
3797
+ const raw = binding[key];
3798
+ if (typeof raw === "number" && Number.isFinite(raw)) return Math.max(0, Math.floor(raw));
3799
+ }
3800
+ if (!isSessionBindingRecord(binding)) return;
3801
+ const raw = binding.metadata?.[key];
3802
+ if (typeof raw !== "number" || !Number.isFinite(raw)) return;
3803
+ return Math.max(0, Math.floor(raw));
3804
+ }
3805
+ function toUpdatedLifecycleBinding(binding) {
3806
+ const lastActivityAt = isSessionBindingRecord(binding) ? resolveSessionBindingLastActivityAt(binding) : Math.max(Math.floor(binding.lastActivityAt), binding.boundAt);
3807
+ return {
3808
+ boundAt: binding.boundAt,
3809
+ lastActivityAt,
3810
+ idleTimeoutMs: resolveUpdatedLifecycleDurationMs(binding, "idleTimeoutMs"),
3811
+ maxAgeMs: resolveUpdatedLifecycleDurationMs(binding, "maxAgeMs")
3812
+ };
3813
+ }
3814
+ function resolveUpdatedBindingExpiry(params) {
3815
+ const expiries = params.bindings.map((binding) => {
3816
+ if (params.action === SESSION_ACTION_IDLE) {
3817
+ const idleTimeoutMs = typeof binding.idleTimeoutMs === "number" && Number.isFinite(binding.idleTimeoutMs) ? Math.max(0, Math.floor(binding.idleTimeoutMs)) : 0;
3818
+ if (idleTimeoutMs <= 0) return;
3819
+ return Math.max(binding.lastActivityAt, binding.boundAt) + idleTimeoutMs;
3820
+ }
3821
+ const maxAgeMs = typeof binding.maxAgeMs === "number" && Number.isFinite(binding.maxAgeMs) ? Math.max(0, Math.floor(binding.maxAgeMs)) : 0;
3822
+ if (maxAgeMs <= 0) return;
3823
+ return binding.boundAt + maxAgeMs;
3824
+ }).filter((expiresAt) => typeof expiresAt === "number");
3825
+ if (expiries.length === 0) return;
3826
+ return Math.min(...expiries);
3827
+ }
3828
+ const handleActivationCommand = async (params, allowTextCommands) => {
3829
+ if (!allowTextCommands) return null;
3830
+ const activationCommand = parseActivationCommand(params.command.commandBodyNormalized);
3831
+ if (!activationCommand.hasCommand) return null;
3832
+ if (!params.isGroup) return {
3833
+ shouldContinue: false,
3834
+ reply: { text: "āš™ļø Group activation only applies to group chats." }
3835
+ };
3836
+ if (!params.command.isAuthorizedSender) {
3837
+ logVerbose(`Ignoring /activation from unauthorized sender in group: ${params.command.senderId || "<unknown>"}`);
3838
+ return { shouldContinue: false };
3839
+ }
3840
+ if (!activationCommand.mode) return {
3841
+ shouldContinue: false,
3842
+ reply: { text: "āš™ļø Usage: /activation mention|always" }
3843
+ };
3844
+ if (params.sessionEntry && params.sessionStore && params.sessionKey) {
3845
+ params.sessionEntry.groupActivation = activationCommand.mode;
3846
+ params.sessionEntry.groupActivationNeedsSystemIntro = true;
3847
+ await persistSessionEntry(params);
3848
+ }
3849
+ return {
3850
+ shouldContinue: false,
3851
+ reply: { text: `āš™ļø Group activation set to ${activationCommand.mode}.` }
3852
+ };
3853
+ };
3854
+ const handleSendPolicyCommand = async (params, allowTextCommands) => {
3855
+ if (!allowTextCommands) return null;
3856
+ const sendPolicyCommand = parseSendPolicyCommand(params.command.commandBodyNormalized);
3857
+ if (!sendPolicyCommand.hasCommand) return null;
3858
+ const unauthorizedResult = rejectUnauthorizedCommand(params, "/send");
3859
+ if (unauthorizedResult) return unauthorizedResult;
3860
+ const nonOwnerResult = rejectNonOwnerCommand(params, "/send");
3861
+ if (nonOwnerResult) return nonOwnerResult;
3862
+ if (!sendPolicyCommand.mode) return {
3863
+ shouldContinue: false,
3864
+ reply: { text: "āš™ļø Usage: /send on|off|inherit" }
3865
+ };
3866
+ if (params.sessionEntry && params.sessionStore && params.sessionKey) {
3867
+ if (sendPolicyCommand.mode === "inherit") delete params.sessionEntry.sendPolicy;
3868
+ else params.sessionEntry.sendPolicy = sendPolicyCommand.mode;
3869
+ await persistSessionEntry(params);
3870
+ }
3871
+ return {
3872
+ shouldContinue: false,
3873
+ reply: { text: `āš™ļø Send policy set to ${sendPolicyCommand.mode === "inherit" ? "inherit" : sendPolicyCommand.mode === "allow" ? "on" : "off"}.` }
3874
+ };
3875
+ };
3876
+ const handleUsageCommand = async (params, allowTextCommands) => {
3877
+ if (!allowTextCommands) return null;
3878
+ const normalized = params.command.commandBodyNormalized;
3879
+ if (normalized !== "/usage" && !normalized.startsWith("/usage ")) return null;
3880
+ if (!params.command.isAuthorizedSender) {
3881
+ logVerbose(`Ignoring /usage from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
3882
+ return { shouldContinue: false };
3883
+ }
3884
+ const rawArgs = normalized === "/usage" ? "" : normalized.slice(6).trim();
3885
+ const requested = rawArgs ? normalizeUsageDisplay(rawArgs) : void 0;
3886
+ if (normalizeLowercaseStringOrEmpty(rawArgs).startsWith("cost")) {
3887
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
3888
+ const sessionAgentId = params.sessionKey ? resolveSessionAgentId({
3889
+ sessionKey: params.sessionKey,
3890
+ config: params.cfg
3891
+ }) : params.agentId;
3892
+ const sessionSummary = await loadSessionCostSummary({
3893
+ sessionId: targetSessionEntry?.sessionId,
3894
+ sessionEntry: targetSessionEntry,
3895
+ sessionFile: targetSessionEntry?.sessionFile,
3896
+ config: params.cfg,
3897
+ agentId: sessionAgentId
3898
+ });
3899
+ const summary = await loadCostUsageSummary({
3900
+ days: 30,
3901
+ config: params.cfg
3902
+ });
3903
+ const sessionCost = formatUsd(sessionSummary?.totalCost);
3904
+ const sessionTokens = sessionSummary?.totalTokens ? formatTokenCount(sessionSummary.totalTokens) : void 0;
3905
+ const sessionSuffix = (sessionSummary?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
3906
+ const sessionLine = sessionCost || sessionTokens ? `Session ${sessionCost ?? "n/a"}${sessionSuffix}${sessionTokens ? ` Ā· ${sessionTokens} tokens` : ""}` : "Session n/a";
3907
+ const todayKey = (/* @__PURE__ */ new Date()).toLocaleDateString("en-CA");
3908
+ const todayEntry = summary.daily.find((entry) => entry.date === todayKey);
3909
+ const todayCost = formatUsd(todayEntry?.totalCost);
3910
+ const todaySuffix = (todayEntry?.missingCostEntries ?? 0) > 0 ? " (partial)" : "";
3911
+ const todayLine = `Today ${todayCost ?? "n/a"}${todaySuffix}`;
3912
+ const last30Cost = formatUsd(summary.totals.totalCost);
3913
+ const last30Suffix = summary.totals.missingCostEntries > 0 ? " (partial)" : "";
3914
+ return {
3915
+ shouldContinue: false,
3916
+ reply: { text: `šŸ’ø Usage cost\n${sessionLine}\n${todayLine}\n${`Last 30d ${last30Cost ?? "n/a"}${last30Suffix}`}` }
3917
+ };
3918
+ }
3919
+ if (rawArgs && !requested) return {
3920
+ shouldContinue: false,
3921
+ reply: { text: "āš™ļø Usage: /usage off|tokens|full|cost" }
3922
+ };
3923
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
3924
+ const currentRaw = targetSessionEntry?.responseUsage;
3925
+ const current = resolveResponseUsageMode(currentRaw);
3926
+ const next = requested ?? (current === "off" ? "tokens" : current === "tokens" ? "full" : "off");
3927
+ if (targetSessionEntry && params.sessionStore && params.sessionKey) {
3928
+ if (next === "off") delete targetSessionEntry.responseUsage;
3929
+ else targetSessionEntry.responseUsage = next;
3930
+ params.sessionStore[params.sessionKey] = targetSessionEntry;
3931
+ await persistSessionEntry({
3932
+ ...params,
3933
+ sessionEntry: targetSessionEntry
3934
+ });
3935
+ }
3936
+ return {
3937
+ shouldContinue: false,
3938
+ reply: { text: `āš™ļø Usage footer: ${next}.` }
3939
+ };
3940
+ };
3941
+ const handleFastCommand = async (params, allowTextCommands) => {
3942
+ if (!allowTextCommands) return null;
3943
+ const normalized = params.command.commandBodyNormalized;
3944
+ if (normalized !== "/fast" && !normalized.startsWith("/fast ")) return null;
3945
+ if (!params.command.isAuthorizedSender) {
3946
+ logVerbose(`Ignoring /fast from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
3947
+ return { shouldContinue: false };
3948
+ }
3949
+ const rawMode = normalizeLowercaseStringOrEmpty(normalized === "/fast" ? "" : normalized.slice(5).trim());
3950
+ if (!rawMode || rawMode === "status") {
3951
+ const targetSessionEntry = params.sessionStore?.[params.sessionKey] ?? params.sessionEntry;
3952
+ const sessionAgentId = params.sessionKey ? resolveSessionAgentId({
3953
+ sessionKey: params.sessionKey,
3954
+ config: params.cfg
3955
+ }) : params.agentId;
3956
+ const state = resolveFastModeState({
3957
+ cfg: params.cfg,
3958
+ provider: params.provider,
3959
+ model: params.model,
3960
+ agentId: sessionAgentId,
3961
+ sessionEntry: targetSessionEntry
3962
+ });
3963
+ const suffix = state.source === "agent" ? " (agent)" : state.source === "config" ? " (config)" : state.source === "default" ? " (default)" : "";
3964
+ return {
3965
+ shouldContinue: false,
3966
+ reply: { text: `āš™ļø Current fast mode: ${state.enabled ? "on" : "off"}${suffix}.` }
3967
+ };
3968
+ }
3969
+ const nextMode = normalizeFastMode(rawMode);
3970
+ if (nextMode === void 0) return {
3971
+ shouldContinue: false,
3972
+ reply: { text: "āš™ļø Usage: /fast status|on|off" }
3973
+ };
3974
+ if (params.sessionEntry && params.sessionStore && params.sessionKey) {
3975
+ params.sessionEntry.fastMode = nextMode;
3976
+ await persistSessionEntry(params);
3977
+ }
3978
+ return {
3979
+ shouldContinue: false,
3980
+ reply: { text: `āš™ļø Fast mode ${nextMode ? "enabled" : "disabled"}.` }
3981
+ };
3982
+ };
3983
+ const handleSessionCommand = async (params, allowTextCommands) => {
3984
+ if (!allowTextCommands) return null;
3985
+ const normalized = params.command.commandBodyNormalized;
3986
+ if (!/^\/session(?:\s|$)/.test(normalized)) return null;
3987
+ if (!params.command.isAuthorizedSender) {
3988
+ logVerbose(`Ignoring /session from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
3989
+ return { shouldContinue: false };
3990
+ }
3991
+ const tokens = normalized.slice(8).trim().split(/\s+/).filter(Boolean);
3992
+ const action = normalizeOptionalLowercaseString(tokens[0]);
3993
+ if (action !== SESSION_ACTION_IDLE && action !== SESSION_ACTION_MAX_AGE) return {
3994
+ shouldContinue: false,
3995
+ reply: { text: resolveSessionCommandUsage() }
3996
+ };
3997
+ const channelId = params.command.channelId ?? normalizeChannelId$1(resolveCommandSurfaceChannel(params)) ?? void 0;
3998
+ const commandConversationBindings = channelId ? getChannelPlugin(channelId)?.conversationBindings : void 0;
3999
+ const commandSupportsCurrentConversationBinding = Boolean(commandConversationBindings?.supportsCurrentConversationBinding);
4000
+ const commandSupportsLifecycleUpdate = action === SESSION_ACTION_IDLE ? typeof commandConversationBindings?.setIdleTimeoutBySessionKey === "function" : typeof commandConversationBindings?.setMaxAgeBySessionKey === "function";
4001
+ const bindingContext = resolveConversationBindingContextFromAcpCommand(params);
4002
+ if (!bindingContext) {
4003
+ if (!channelId || !commandSupportsCurrentConversationBinding || !commandSupportsLifecycleUpdate) return {
4004
+ shouldContinue: false,
4005
+ reply: { text: "āš ļø /session idle and /session max-age are currently available only on channels that support focused conversation bindings." }
4006
+ };
4007
+ return {
4008
+ shouldContinue: false,
4009
+ reply: { text: "āš ļø /session idle and /session max-age must be run inside a focused conversation." }
4010
+ };
4011
+ }
4012
+ const resolvedChannelId = bindingContext.channel || channelId;
4013
+ const conversationBindings = resolvedChannelId ? getChannelPlugin(resolvedChannelId)?.conversationBindings : void 0;
4014
+ const supportsCurrentConversationBinding = Boolean(conversationBindings?.supportsCurrentConversationBinding);
4015
+ const supportsLifecycleUpdate = action === SESSION_ACTION_IDLE ? typeof conversationBindings?.setIdleTimeoutBySessionKey === "function" : typeof conversationBindings?.setMaxAgeBySessionKey === "function";
4016
+ if (!resolvedChannelId || !supportsCurrentConversationBinding || !supportsLifecycleUpdate) return {
4017
+ shouldContinue: false,
4018
+ reply: { text: "āš ļø /session idle and /session max-age are currently available only on channels that support focused conversation bindings." }
4019
+ };
4020
+ const activeBinding = getSessionBindingService().resolveByConversation(bindingContext);
4021
+ if (!activeBinding) return {
4022
+ shouldContinue: false,
4023
+ reply: { text: "ā„¹ļø This conversation is not currently focused." }
4024
+ };
4025
+ const idleTimeoutMs = resolveSessionBindingDurationMs(activeBinding, "idleTimeoutMs", 1440 * 60 * 1e3);
4026
+ const idleExpiresAt = idleTimeoutMs > 0 ? resolveSessionBindingLastActivityAt(activeBinding) + idleTimeoutMs : void 0;
4027
+ const maxAgeMs = resolveSessionBindingDurationMs(activeBinding, "maxAgeMs", 0);
4028
+ const maxAgeExpiresAt = maxAgeMs > 0 ? activeBinding.boundAt + maxAgeMs : void 0;
4029
+ const durationArgRaw = tokens.slice(1).join("");
4030
+ if (!durationArgRaw) {
4031
+ if (action === SESSION_ACTION_IDLE) {
4032
+ if (typeof idleExpiresAt === "number" && Number.isFinite(idleExpiresAt) && idleExpiresAt > Date.now()) return {
4033
+ shouldContinue: false,
4034
+ reply: { text: `ā„¹ļø Idle timeout active (${formatThreadBindingDurationLabel(idleTimeoutMs)}, next auto-unfocus at ${formatSessionExpiry(idleExpiresAt)}).` }
4035
+ };
4036
+ return {
4037
+ shouldContinue: false,
4038
+ reply: { text: "ā„¹ļø Idle timeout is currently disabled for this focused session." }
4039
+ };
4040
+ }
4041
+ if (typeof maxAgeExpiresAt === "number" && Number.isFinite(maxAgeExpiresAt) && maxAgeExpiresAt > Date.now()) return {
4042
+ shouldContinue: false,
4043
+ reply: { text: `ā„¹ļø Max age active (${formatThreadBindingDurationLabel(maxAgeMs)}, hard auto-unfocus at ${formatSessionExpiry(maxAgeExpiresAt)}).` }
4044
+ };
4045
+ return {
4046
+ shouldContinue: false,
4047
+ reply: { text: "ā„¹ļø Max age is currently disabled for this focused session." }
4048
+ };
4049
+ }
4050
+ const senderId = normalizeOptionalString(params.command.senderId) ?? "";
4051
+ const boundBy = resolveSessionBindingBoundBy(activeBinding);
4052
+ if (boundBy && boundBy !== "system" && senderId && senderId !== boundBy) return {
4053
+ shouldContinue: false,
4054
+ reply: { text: `āš ļø Only ${boundBy} can update session lifecycle settings for this conversation.` }
4055
+ };
4056
+ let durationMs;
4057
+ try {
4058
+ durationMs = parseSessionDurationMs(durationArgRaw);
4059
+ } catch {
4060
+ return {
4061
+ shouldContinue: false,
4062
+ reply: { text: resolveSessionCommandUsage() }
4063
+ };
4064
+ }
4065
+ const updatedBindings = action === SESSION_ACTION_IDLE ? setChannelConversationBindingIdleTimeoutBySessionKey({
4066
+ channelId: bindingContext.channel,
4067
+ targetSessionKey: activeBinding.targetSessionKey,
4068
+ accountId: bindingContext.accountId,
4069
+ idleTimeoutMs: durationMs
4070
+ }) : setChannelConversationBindingMaxAgeBySessionKey({
4071
+ channelId: bindingContext.channel,
4072
+ targetSessionKey: activeBinding.targetSessionKey,
4073
+ accountId: bindingContext.accountId,
4074
+ maxAgeMs: durationMs
4075
+ });
4076
+ if (updatedBindings.length === 0) return {
4077
+ shouldContinue: false,
4078
+ reply: { text: action === SESSION_ACTION_IDLE ? "āš ļø Failed to update idle timeout for the current binding." : "āš ļø Failed to update max age for the current binding." }
4079
+ };
4080
+ if (durationMs <= 0) return {
4081
+ shouldContinue: false,
4082
+ reply: { text: action === SESSION_ACTION_IDLE ? `āœ… Idle timeout disabled for ${updatedBindings.length} binding${updatedBindings.length === 1 ? "" : "s"}.` : `āœ… Max age disabled for ${updatedBindings.length} binding${updatedBindings.length === 1 ? "" : "s"}.` }
4083
+ };
4084
+ const nextExpiry = resolveUpdatedBindingExpiry({
4085
+ action,
4086
+ bindings: updatedBindings.map((binding) => toUpdatedLifecycleBinding(binding))
4087
+ });
4088
+ const expiryLabel = typeof nextExpiry === "number" && Number.isFinite(nextExpiry) ? formatSessionExpiry(nextExpiry) : "n/a";
4089
+ return {
4090
+ shouldContinue: false,
4091
+ reply: { text: action === SESSION_ACTION_IDLE ? `āœ… Idle timeout set to ${formatThreadBindingDurationLabel(durationMs)} for ${updatedBindings.length} binding${updatedBindings.length === 1 ? "" : "s"} (next auto-unfocus at ${expiryLabel}).` : `āœ… Max age set to ${formatThreadBindingDurationLabel(durationMs)} for ${updatedBindings.length} binding${updatedBindings.length === 1 ? "" : "s"} (hard auto-unfocus at ${expiryLabel}).` }
4092
+ };
4093
+ };
4094
+ const handleRestartCommand = async (params, allowTextCommands) => {
4095
+ if (!allowTextCommands) return null;
4096
+ if (params.command.commandBodyNormalized !== "/restart") return null;
4097
+ if (!params.command.isAuthorizedSender) {
4098
+ logVerbose(`Ignoring /restart from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
4099
+ return { shouldContinue: false };
4100
+ }
4101
+ const nonOwner = rejectNonOwnerCommand(params, "/restart");
4102
+ if (nonOwner) return nonOwner;
4103
+ if (!isRestartEnabled(params.cfg)) return {
4104
+ shouldContinue: false,
4105
+ reply: { text: "āš ļø /restart is disabled (commands.restart=false)." }
4106
+ };
4107
+ const hasSigusr1Listener = process.listenerCount("SIGUSR1") > 0;
4108
+ const sentinelPayload = buildRestartCommandSentinel(params);
4109
+ if (hasSigusr1Listener) {
4110
+ let sentinelPath = null;
4111
+ scheduleGatewaySigusr1Restart({
4112
+ reason: "/restart",
4113
+ emitHooks: sentinelPayload ? {
4114
+ beforeEmit: async () => {
4115
+ sentinelPath = await writeRestartSentinel(sentinelPayload);
4116
+ },
4117
+ afterEmitRejected: async () => {
4118
+ await removeRestartSentinelFile(sentinelPath);
4119
+ }
4120
+ } : void 0
4121
+ });
4122
+ return {
4123
+ shouldContinue: false,
4124
+ reply: { text: "āš™ļø Restarting Genesis in-process (SIGUSR1); back in a few seconds." }
4125
+ };
4126
+ }
4127
+ let sentinelPath = null;
4128
+ try {
4129
+ if (sentinelPayload) sentinelPath = await writeRestartSentinel(sentinelPayload);
4130
+ } catch (err) {
4131
+ logVerbose(`failed to write /restart sentinel: ${String(err)}`);
4132
+ return {
4133
+ shouldContinue: false,
4134
+ reply: { text: "āš ļø Restart failed: could not persist the post-restart acknowledgement." }
4135
+ };
4136
+ }
4137
+ const restartMethod = triggerGenesisRestart();
4138
+ if (!restartMethod.ok) {
4139
+ await removeRestartSentinelFile(sentinelPath);
4140
+ const detail = restartMethod.detail ? ` Details: ${restartMethod.detail}` : "";
4141
+ return {
4142
+ shouldContinue: false,
4143
+ reply: { text: `āš ļø Restart failed (${restartMethod.method}).${detail}` }
4144
+ };
4145
+ }
4146
+ return {
4147
+ shouldContinue: false,
4148
+ reply: { text: `āš™ļø Restarting Genesis via ${restartMethod.method}; give me a few seconds to come back online.` }
4149
+ };
4150
+ };
4151
+ //#endregion
4152
+ //#region src/auto-reply/reply/commands-subagents.ts
4153
+ let actionAgentsPromise = null;
4154
+ let actionFocusPromise = null;
4155
+ let actionHelpPromise = null;
4156
+ let actionInfoPromise = null;
4157
+ let actionKillPromise = null;
4158
+ let actionListPromise = null;
4159
+ let actionLogPromise = null;
4160
+ let actionSendPromise = null;
4161
+ let actionSpawnPromise = null;
4162
+ let actionUnfocusPromise = null;
4163
+ let controlRuntimePromise = null;
4164
+ function loadAgentsAction() {
4165
+ actionAgentsPromise ??= import("./action-agents-D1tXt8Kj.js");
4166
+ return actionAgentsPromise;
4167
+ }
4168
+ function loadFocusAction() {
4169
+ actionFocusPromise ??= import("./action-focus-Bk6AJsNH.js");
4170
+ return actionFocusPromise;
4171
+ }
4172
+ function loadHelpAction() {
4173
+ actionHelpPromise ??= import("./action-help-4nFSAuVo.js");
4174
+ return actionHelpPromise;
4175
+ }
4176
+ function loadInfoAction() {
4177
+ actionInfoPromise ??= import("./action-info-D-byoefn.js");
4178
+ return actionInfoPromise;
4179
+ }
4180
+ function loadKillAction() {
4181
+ actionKillPromise ??= import("./action-kill-Bo-NwBVR.js");
4182
+ return actionKillPromise;
4183
+ }
4184
+ function loadListAction() {
4185
+ actionListPromise ??= import("./action-list-lAa4rlzN.js");
4186
+ return actionListPromise;
4187
+ }
4188
+ function loadLogAction() {
4189
+ actionLogPromise ??= import("./action-log-BasoUC3L.js");
4190
+ return actionLogPromise;
4191
+ }
4192
+ function loadSendAction() {
4193
+ actionSendPromise ??= import("./action-send-DwLkiz4x.js");
4194
+ return actionSendPromise;
4195
+ }
4196
+ function loadSpawnAction() {
4197
+ actionSpawnPromise ??= import("./action-spawn-C70_iR8d.js");
4198
+ return actionSpawnPromise;
4199
+ }
4200
+ function loadUnfocusAction() {
4201
+ actionUnfocusPromise ??= import("./action-unfocus-dUVMx5Fh.js");
4202
+ return actionUnfocusPromise;
4203
+ }
4204
+ function loadControlRuntime() {
4205
+ controlRuntimePromise ??= import("./commands-subagents-control.runtime-BmqXiKHu.js");
4206
+ return controlRuntimePromise;
4207
+ }
4208
+ const handleSubagentsCommand = async (params, allowTextCommands) => {
4209
+ if (!allowTextCommands) return null;
4210
+ const normalized = params.command.commandBodyNormalized;
4211
+ const handledPrefix = resolveHandledPrefix(normalized);
4212
+ if (!handledPrefix) return null;
4213
+ if (!params.command.isAuthorizedSender) {
4214
+ logVerbose(`Ignoring ${handledPrefix} from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
4215
+ return { shouldContinue: false };
4216
+ }
4217
+ const restTokens = normalized.slice(handledPrefix.length).trim().split(/\s+/).filter(Boolean);
4218
+ const action = resolveSubagentsAction({
4219
+ handledPrefix,
4220
+ restTokens
4221
+ });
4222
+ if (!action) return (await loadHelpAction()).handleSubagentsHelpAction();
4223
+ const requesterKey = action === "spawn" ? resolveRequesterSessionKey(params, { preferCommandTarget: true }) : resolveRequesterSessionKey(params);
4224
+ if (!requesterKey) return stopWithText("āš ļø Missing session key.");
4225
+ const ctx = {
4226
+ params,
4227
+ handledPrefix,
4228
+ requesterKey,
4229
+ runs: (await loadControlRuntime()).listControlledSubagentRuns(requesterKey),
4230
+ restTokens
4231
+ };
4232
+ switch (action) {
4233
+ case "help": return (await loadHelpAction()).handleSubagentsHelpAction();
4234
+ case "agents": return (await loadAgentsAction()).handleSubagentsAgentsAction(ctx);
4235
+ case "focus": return await (await loadFocusAction()).handleSubagentsFocusAction(ctx);
4236
+ case "unfocus": return await (await loadUnfocusAction()).handleSubagentsUnfocusAction(ctx);
4237
+ case "list": return (await loadListAction()).handleSubagentsListAction(ctx);
4238
+ case "kill": return await (await loadKillAction()).handleSubagentsKillAction(ctx);
4239
+ case "info": return (await loadInfoAction()).handleSubagentsInfoAction(ctx);
4240
+ case "log": return await (await loadLogAction()).handleSubagentsLogAction(ctx);
4241
+ case "send": return await (await loadSendAction()).handleSubagentsSendAction(ctx, false);
4242
+ case "steer": return await (await loadSendAction()).handleSubagentsSendAction(ctx, true);
4243
+ case "spawn": return await (await loadSpawnAction()).handleSubagentsSpawnAction(ctx);
4244
+ default: return (await loadHelpAction()).handleSubagentsHelpAction();
4245
+ }
4246
+ };
4247
+ //#endregion
4248
+ //#region src/auto-reply/reply/commands-tasks.ts
4249
+ const MAX_VISIBLE_TASKS = 5;
4250
+ const TASK_STATUS_ICONS = {
4251
+ queued: "🟔",
4252
+ running: "🟢",
4253
+ succeeded: "āœ…",
4254
+ failed: "šŸ”“",
4255
+ timed_out: "ā±ļø",
4256
+ cancelled: "āšŖļø",
4257
+ lost: "āš ļø"
4258
+ };
4259
+ const TASK_RUNTIME_LABELS = {
4260
+ subagent: "Subagent",
4261
+ acp: "ACP",
4262
+ cli: "CLI",
4263
+ cron: "Cron"
4264
+ };
4265
+ function formatTaskHeadline(snapshot) {
4266
+ if (snapshot.totalCount === 0) return "All clear - nothing linked to this session right now.";
4267
+ return `Current session: ${snapshot.activeCount} active Ā· ${snapshot.totalCount} total`;
4268
+ }
4269
+ function formatAgentFallbackLine(agentId) {
4270
+ const snapshot = buildTaskStatusSnapshot(listTasksForAgentIdForStatus(agentId));
4271
+ if (snapshot.totalCount === 0) return;
4272
+ return `Agent-local: ${snapshot.activeCount} active Ā· ${snapshot.totalCount} total`;
4273
+ }
4274
+ function formatTaskTiming(task) {
4275
+ if (task.status === "running") {
4276
+ const startedAt = task.startedAt ?? task.createdAt;
4277
+ return `elapsed ${formatDurationCompact(Date.now() - startedAt, { spaced: true }) ?? "0s"}`;
4278
+ }
4279
+ if (task.status === "queued") return `queued ${formatTimeAgo(Date.now() - task.createdAt)}`;
4280
+ const endedAt = task.endedAt ?? task.lastEventAt ?? task.createdAt;
4281
+ return `finished ${formatTimeAgo(Date.now() - endedAt)}`;
4282
+ }
4283
+ function formatTaskDetail(task) {
4284
+ return formatTaskStatusDetail(task);
4285
+ }
4286
+ function formatVisibleTask(task, index) {
4287
+ const title = formatTaskStatusTitle(task);
4288
+ const status = task.status.replaceAll("_", " ");
4289
+ const timing = formatTaskTiming(task);
4290
+ const detail = formatTaskDetail(task);
4291
+ const meta = [
4292
+ TASK_RUNTIME_LABELS[task.runtime],
4293
+ status,
4294
+ timing
4295
+ ].filter(Boolean).join(" Ā· ");
4296
+ const lines = [`${index + 1}. ${TASK_STATUS_ICONS[task.status]} ${title}`, ` ${meta}`];
4297
+ if (detail) lines.push(` ${detail}`);
4298
+ return lines.join("\n");
4299
+ }
4300
+ function buildTasksText(params) {
4301
+ const sessionSnapshot = buildTaskStatusSnapshot(listTasksForSessionKeyForStatus(params.sessionKey));
4302
+ const lines = ["šŸ“‹ Tasks", formatTaskHeadline(sessionSnapshot)];
4303
+ if (sessionSnapshot.totalCount > 0) {
4304
+ const visible = sessionSnapshot.visible.slice(0, MAX_VISIBLE_TASKS);
4305
+ lines.push("");
4306
+ for (const [index, task] of visible.entries()) {
4307
+ lines.push(formatVisibleTask(task, index));
4308
+ if (index < visible.length - 1) lines.push("");
4309
+ }
4310
+ const hiddenCount = sessionSnapshot.visible.length - visible.length;
4311
+ if (hiddenCount > 0) lines.push("", `+${hiddenCount} more recent task${hiddenCount === 1 ? "" : "s"}`);
4312
+ return lines.join("\n");
4313
+ }
4314
+ const agentFallback = formatAgentFallbackLine(params.agentId);
4315
+ if (agentFallback) lines.push(agentFallback);
4316
+ return lines.join("\n");
4317
+ }
4318
+ async function buildTasksReply(params) {
4319
+ const agentId = resolveSessionAgentId({
4320
+ sessionKey: params.sessionKey,
4321
+ config: params.cfg
4322
+ });
4323
+ return { text: buildTasksText({
4324
+ sessionKey: params.sessionKey,
4325
+ agentId
4326
+ }) };
4327
+ }
4328
+ const handleTasksCommand = async (params, allowTextCommands) => {
4329
+ if (!allowTextCommands) return null;
4330
+ const normalized = params.command.commandBodyNormalized;
4331
+ if (normalized !== "/tasks" && !normalized.startsWith("/tasks ")) return null;
4332
+ if (!params.command.isAuthorizedSender) {
4333
+ logVerbose(`Ignoring /tasks from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
4334
+ return { shouldContinue: false };
4335
+ }
4336
+ if (normalized !== "/tasks") return {
4337
+ shouldContinue: false,
4338
+ reply: { text: "Usage: /tasks" }
4339
+ };
4340
+ return {
4341
+ shouldContinue: false,
4342
+ reply: await buildTasksReply(params)
4343
+ };
4344
+ };
4345
+ //#endregion
4346
+ //#region src/auto-reply/reply/commands-tts.ts
4347
+ function parseTtsCommand(normalized) {
4348
+ if (normalized === "/tts") return {
4349
+ action: "status",
4350
+ args: ""
4351
+ };
4352
+ if (!normalized.startsWith("/tts ")) return null;
4353
+ const rest = normalized.slice(5).trim();
4354
+ if (!rest) return {
4355
+ action: "status",
4356
+ args: ""
4357
+ };
4358
+ const [action, ...tail] = rest.split(/\s+/);
4359
+ return {
4360
+ action: normalizeOptionalLowercaseString(action) ?? "",
4361
+ args: normalizeOptionalString(tail.join(" ")) ?? ""
4362
+ };
4363
+ }
4364
+ function formatAttemptDetails(attempts) {
4365
+ if (!attempts || attempts.length === 0) return;
4366
+ return attempts.map((attempt) => {
4367
+ const reason = attempt.reasonCode === "success" ? "ok" : attempt.reasonCode;
4368
+ const latency = Number.isFinite(attempt.latencyMs) ? ` ${attempt.latencyMs}ms` : "";
4369
+ return `${attempt.provider}:${attempt.outcome}(${reason})${latency}`;
4370
+ }).join(", ");
4371
+ }
4372
+ function ttsUsage() {
4373
+ return { text: "šŸ”Š **TTS (Text-to-Speech) Help**\n\n**Commands:**\n• /tts on — Enable automatic TTS for replies\n• /tts off — Disable TTS\n• /tts status — Show current settings\n• /tts provider [name] — View/change provider\n• /tts limit [number] — View/change text limit\n• /tts summary [on|off] — View/change auto-summary\n• /tts audio <text> — Generate audio from text\n\n**Providers:**\nUse /tts provider to list the registered speech providers and their status.\n\n**Text Limit (default: 1500, max: 4096):**\nWhen text exceeds the limit:\n• Summary ON: AI summarizes, then generates audio\n• Summary OFF: Truncates text, then generates audio\n\n**Examples:**\n/tts provider <id>\n/tts limit 2000\n/tts audio Hello, this is a test!" };
4374
+ }
4375
+ const handleTtsCommands = async (params, allowTextCommands) => {
4376
+ if (!allowTextCommands) return null;
4377
+ const parsed = parseTtsCommand(params.command.commandBodyNormalized);
4378
+ if (!parsed) return null;
4379
+ if (!params.command.isAuthorizedSender) {
4380
+ logVerbose(`Ignoring TTS command from unauthorized sender: ${params.command.senderId || "<unknown>"}`);
4381
+ return { shouldContinue: false };
4382
+ }
4383
+ const config = resolveTtsConfig(params.cfg);
4384
+ const prefsPath = resolveTtsPrefsPath(config);
4385
+ const action = parsed.action;
4386
+ const args = parsed.args;
4387
+ if (action === "help") return {
4388
+ shouldContinue: false,
4389
+ reply: ttsUsage()
4390
+ };
4391
+ if (action === "on") {
4392
+ setTtsEnabled(prefsPath, true);
4393
+ return {
4394
+ shouldContinue: false,
4395
+ reply: { text: "šŸ”Š TTS enabled." }
4396
+ };
4397
+ }
4398
+ if (action === "off") {
4399
+ setTtsEnabled(prefsPath, false);
4400
+ return {
4401
+ shouldContinue: false,
4402
+ reply: { text: "šŸ”‡ TTS disabled." }
4403
+ };
4404
+ }
4405
+ if (action === "audio") {
4406
+ if (!args.trim()) return {
4407
+ shouldContinue: false,
4408
+ reply: { text: "šŸŽ¤ Generate audio from text.\n\nUsage: /tts audio <text>\nExample: /tts audio Hello, this is a test!" }
4409
+ };
4410
+ const start = Date.now();
4411
+ const result = await textToSpeech({
4412
+ text: args,
4413
+ cfg: params.cfg,
4414
+ channel: params.command.channel,
4415
+ prefsPath
4416
+ });
4417
+ if (result.success && result.audioPath) {
4418
+ setLastTtsAttempt({
4419
+ timestamp: Date.now(),
4420
+ success: true,
4421
+ textLength: args.length,
4422
+ summarized: false,
4423
+ provider: result.provider,
4424
+ fallbackFrom: result.fallbackFrom,
4425
+ attemptedProviders: result.attemptedProviders,
4426
+ attempts: result.attempts,
4427
+ latencyMs: result.latencyMs
4428
+ });
4429
+ return {
4430
+ shouldContinue: false,
4431
+ reply: {
4432
+ mediaUrl: result.audioPath,
4433
+ audioAsVoice: result.voiceCompatible === true,
4434
+ trustedLocalMedia: true,
4435
+ spokenText: args
4436
+ }
4437
+ };
4438
+ }
4439
+ setLastTtsAttempt({
4440
+ timestamp: Date.now(),
4441
+ success: false,
4442
+ textLength: args.length,
4443
+ summarized: false,
4444
+ attemptedProviders: result.attemptedProviders,
4445
+ attempts: result.attempts,
4446
+ error: result.error,
4447
+ latencyMs: Date.now() - start
4448
+ });
4449
+ return {
4450
+ shouldContinue: false,
4451
+ reply: { text: `āŒ Error generating audio: ${result.error ?? "unknown error"}` }
4452
+ };
4453
+ }
4454
+ if (action === "provider") {
4455
+ const currentProvider = getTtsProvider(config, prefsPath);
4456
+ if (!args.trim()) {
4457
+ const providers = listSpeechProviders(params.cfg);
4458
+ return {
4459
+ shouldContinue: false,
4460
+ reply: { text: `šŸŽ™ļø TTS provider\nPrimary: ${currentProvider}\n` + providers.map((provider) => `${provider.label}: ${provider.isConfigured({
4461
+ cfg: params.cfg,
4462
+ providerConfig: getResolvedSpeechProviderConfig(config, provider.id, params.cfg),
4463
+ timeoutMs: config.timeoutMs
4464
+ }) ? "āœ…" : "āŒ"}`).join("\n") + `\nUsage: /tts provider <id>` }
4465
+ };
4466
+ }
4467
+ const requested = normalizeOptionalLowercaseString(args) ?? "";
4468
+ const resolvedProvider = getSpeechProvider(requested, params.cfg);
4469
+ if (!resolvedProvider) return {
4470
+ shouldContinue: false,
4471
+ reply: ttsUsage()
4472
+ };
4473
+ const nextProvider = canonicalizeSpeechProviderId(requested, params.cfg) ?? resolvedProvider.id;
4474
+ setTtsProvider(prefsPath, nextProvider);
4475
+ return {
4476
+ shouldContinue: false,
4477
+ reply: { text: `āœ… TTS provider set to ${nextProvider}.` }
4478
+ };
4479
+ }
4480
+ if (action === "limit") {
4481
+ if (!args.trim()) return {
4482
+ shouldContinue: false,
4483
+ reply: { text: `šŸ“ TTS limit: ${getTtsMaxLength(prefsPath)} characters.\n\nText longer than this triggers summary (if enabled).\nRange: 100-4096 chars (Telegram max).\n\nTo change: /tts limit <number>\nExample: /tts limit 2000` }
4484
+ };
4485
+ const next = Number.parseInt(args.trim(), 10);
4486
+ if (!Number.isFinite(next) || next < 100 || next > 4096) return {
4487
+ shouldContinue: false,
4488
+ reply: { text: "āŒ Limit must be between 100 and 4096 characters." }
4489
+ };
4490
+ setTtsMaxLength(prefsPath, next);
4491
+ return {
4492
+ shouldContinue: false,
4493
+ reply: { text: `āœ… TTS limit set to ${next} characters.` }
4494
+ };
4495
+ }
4496
+ if (action === "summary") {
4497
+ if (!args.trim()) {
4498
+ const enabled = isSummarizationEnabled(prefsPath);
4499
+ const maxLen = getTtsMaxLength(prefsPath);
4500
+ return {
4501
+ shouldContinue: false,
4502
+ reply: { text: `šŸ“ TTS auto-summary: ${enabled ? "on" : "off"}.\n\nWhen text exceeds ${maxLen} chars:\n• ON: summarizes text, then generates audio\n• OFF: truncates text, then generates audio\n\nTo change: /tts summary on | off` }
4503
+ };
4504
+ }
4505
+ const requested = normalizeOptionalLowercaseString(args) ?? "";
4506
+ if (requested !== "on" && requested !== "off") return {
4507
+ shouldContinue: false,
4508
+ reply: ttsUsage()
4509
+ };
4510
+ setSummarizationEnabled(prefsPath, requested === "on");
4511
+ return {
4512
+ shouldContinue: false,
4513
+ reply: { text: requested === "on" ? "āœ… TTS auto-summary enabled." : "āŒ TTS auto-summary disabled." }
4514
+ };
4515
+ }
4516
+ if (action === "status") {
4517
+ const enabled = isTtsEnabled(config, prefsPath);
4518
+ const provider = getTtsProvider(config, prefsPath);
4519
+ const hasKey = isTtsProviderConfigured(config, provider, params.cfg);
4520
+ const maxLength = getTtsMaxLength(prefsPath);
4521
+ const summarize = isSummarizationEnabled(prefsPath);
4522
+ const last = getLastTtsAttempt();
4523
+ const lines = [
4524
+ "šŸ“Š TTS status",
4525
+ `State: ${enabled ? "āœ… enabled" : "āŒ disabled"}`,
4526
+ `Provider: ${provider} (${hasKey ? "āœ… configured" : "āŒ not configured"})`,
4527
+ `Text limit: ${maxLength} chars`,
4528
+ `Auto-summary: ${summarize ? "on" : "off"}`
4529
+ ];
4530
+ if (last) {
4531
+ const timeAgo = Math.round((Date.now() - last.timestamp) / 1e3);
4532
+ lines.push("");
4533
+ lines.push(`Last attempt (${timeAgo}s ago): ${last.success ? "āœ…" : "āŒ"}`);
4534
+ lines.push(`Text: ${last.textLength} chars${last.summarized ? " (summarized)" : ""}`);
4535
+ if (last.success) {
4536
+ lines.push(`Provider: ${last.provider ?? "unknown"}`);
4537
+ if (last.fallbackFrom && last.provider && last.fallbackFrom !== last.provider) lines.push(`Fallback: ${last.fallbackFrom} -> ${last.provider}`);
4538
+ if (last.attemptedProviders && last.attemptedProviders.length > 1) lines.push(`Attempts: ${last.attemptedProviders.join(" -> ")}`);
4539
+ const details = formatAttemptDetails(last.attempts);
4540
+ if (details) lines.push(`Attempt details: ${details}`);
4541
+ lines.push(`Latency: ${last.latencyMs ?? 0}ms`);
4542
+ } else if (last.error) {
4543
+ lines.push(`Error: ${last.error}`);
4544
+ if (last.attemptedProviders && last.attemptedProviders.length > 0) lines.push(`Attempts: ${last.attemptedProviders.join(" -> ")}`);
4545
+ const details = formatAttemptDetails(last.attempts);
4546
+ if (details) lines.push(`Attempt details: ${details}`);
4547
+ }
4548
+ }
4549
+ return {
4550
+ shouldContinue: false,
4551
+ reply: { text: lines.join("\n") }
4552
+ };
4553
+ }
4554
+ return {
4555
+ shouldContinue: false,
4556
+ reply: ttsUsage()
4557
+ };
4558
+ };
4559
+ //#endregion
4560
+ //#region src/auto-reply/reply/commands-handlers.runtime.ts
4561
+ function loadCommandHandlers() {
4562
+ return [
4563
+ handlePluginCommand,
4564
+ handleBtwCommand,
4565
+ handleBashCommand,
4566
+ handleActivationCommand,
4567
+ handleSendPolicyCommand,
4568
+ handleFastCommand,
4569
+ handleUsageCommand,
4570
+ handleSessionCommand,
4571
+ handleRestartCommand,
4572
+ handleTtsCommands,
4573
+ handleHelpCommand,
4574
+ handleCommandsListCommand,
4575
+ handleToolsCommand,
4576
+ handleStatusCommand,
4577
+ handleTasksCommand,
4578
+ handleAllowlistCommand,
4579
+ handleApproveCommand,
4580
+ handleContextCommand,
4581
+ handleExportSessionCommand,
4582
+ handleExportTrajectoryCommand,
4583
+ handleWhoamiCommand,
4584
+ handleSubagentsCommand,
4585
+ handleAcpCommand,
4586
+ handleMcpCommand,
4587
+ handlePluginsCommand,
4588
+ handleConfigCommand,
4589
+ handleDebugCommand,
4590
+ handleModelsCommand,
4591
+ handleStopCommand,
4592
+ handleCompactCommand,
4593
+ handleAbortTrigger
4594
+ ];
4595
+ }
4596
+ //#endregion
4597
+ export { loadCommandHandlers };