botmux 2.104.0 → 2.105.1

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 (339) hide show
  1. package/README.en.md +10 -10
  2. package/README.md +10 -10
  3. package/dist/adapters/backend/sandbox.d.ts +5 -1
  4. package/dist/adapters/backend/sandbox.d.ts.map +1 -1
  5. package/dist/adapters/backend/sandbox.js +54 -5
  6. package/dist/adapters/backend/sandbox.js.map +1 -1
  7. package/dist/adapters/backend/tmux-pipe-backend.d.ts +1 -1
  8. package/dist/adapters/backend/tmux-pipe-backend.js +1 -1
  9. package/dist/adapters/backend/zellij-observe-backend.d.ts +1 -1
  10. package/dist/adapters/backend/zellij-observe-backend.js +1 -1
  11. package/dist/adapters/cli/claude-code.d.ts +1 -1
  12. package/dist/adapters/cli/read-isolation.d.ts +2 -1
  13. package/dist/adapters/cli/read-isolation.d.ts.map +1 -1
  14. package/dist/adapters/cli/read-isolation.js +51 -4
  15. package/dist/adapters/cli/read-isolation.js.map +1 -1
  16. package/dist/adapters/cli/relay.d.ts +2 -2
  17. package/dist/adapters/cli/relay.js +2 -2
  18. package/dist/adapters/cli/seed.d.ts +2 -2
  19. package/dist/adapters/cli/seed.js +2 -2
  20. package/dist/adapters/cli/shared-hints.d.ts.map +1 -1
  21. package/dist/adapters/cli/shared-hints.js +1 -0
  22. package/dist/adapters/cli/shared-hints.js.map +1 -1
  23. package/dist/bot-registry.d.ts +65 -1
  24. package/dist/bot-registry.d.ts.map +1 -1
  25. package/dist/bot-registry.js +145 -0
  26. package/dist/bot-registry.js.map +1 -1
  27. package/dist/cli/send-dispatch.d.ts +44 -0
  28. package/dist/cli/send-dispatch.d.ts.map +1 -1
  29. package/dist/cli/send-dispatch.js +79 -0
  30. package/dist/cli/send-dispatch.js.map +1 -1
  31. package/dist/cli/vc-agent.d.ts +2 -0
  32. package/dist/cli/vc-agent.d.ts.map +1 -0
  33. package/dist/cli/vc-agent.js +331 -0
  34. package/dist/cli/vc-agent.js.map +1 -0
  35. package/dist/cli.d.ts.map +1 -1
  36. package/dist/cli.js +125 -24
  37. package/dist/cli.js.map +1 -1
  38. package/dist/config.d.ts +8 -0
  39. package/dist/config.d.ts.map +1 -1
  40. package/dist/config.js +13 -1
  41. package/dist/config.js.map +1 -1
  42. package/dist/core/auto-start.d.ts +2 -2
  43. package/dist/core/auto-start.js +2 -2
  44. package/dist/core/command-handler.d.ts.map +1 -1
  45. package/dist/core/command-handler.js +2 -1
  46. package/dist/core/command-handler.js.map +1 -1
  47. package/dist/core/dashboard-events.d.ts +5 -0
  48. package/dist/core/dashboard-events.d.ts.map +1 -1
  49. package/dist/core/dashboard-events.js.map +1 -1
  50. package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
  51. package/dist/core/dashboard-ipc-server.js +47 -2
  52. package/dist/core/dashboard-ipc-server.js.map +1 -1
  53. package/dist/core/idle-worker-sweeper.d.ts +1 -1
  54. package/dist/core/idle-worker-sweeper.js +1 -1
  55. package/dist/core/passthrough-commands.d.ts.map +1 -1
  56. package/dist/core/passthrough-commands.js +1 -0
  57. package/dist/core/passthrough-commands.js.map +1 -1
  58. package/dist/core/scheduler.d.ts +12 -0
  59. package/dist/core/scheduler.d.ts.map +1 -1
  60. package/dist/core/scheduler.js +67 -7
  61. package/dist/core/scheduler.js.map +1 -1
  62. package/dist/core/session-discovery.js +1 -1
  63. package/dist/core/session-discovery.js.map +1 -1
  64. package/dist/core/session-manager.d.ts +1 -1
  65. package/dist/core/session-manager.d.ts.map +1 -1
  66. package/dist/core/session-manager.js +55 -10
  67. package/dist/core/session-manager.js.map +1 -1
  68. package/dist/core/trigger-session.d.ts.map +1 -1
  69. package/dist/core/trigger-session.js +78 -23
  70. package/dist/core/trigger-session.js.map +1 -1
  71. package/dist/core/types.d.ts +3 -3
  72. package/dist/core/types.d.ts.map +1 -1
  73. package/dist/core/worker-pool.d.ts +8 -1
  74. package/dist/core/worker-pool.d.ts.map +1 -1
  75. package/dist/core/worker-pool.js +31 -9
  76. package/dist/core/worker-pool.js.map +1 -1
  77. package/dist/core/zellij-adopt-discovery.js +1 -1
  78. package/dist/core/zellij-adopt-discovery.js.map +1 -1
  79. package/dist/daemon.d.ts +121 -0
  80. package/dist/daemon.d.ts.map +1 -1
  81. package/dist/daemon.js +2644 -2
  82. package/dist/daemon.js.map +1 -1
  83. package/dist/dashboard/federated-group-core.js +1 -1
  84. package/dist/dashboard/federated-group-core.js.map +1 -1
  85. package/dist/dashboard/federation-api.js +1 -1
  86. package/dist/dashboard/schedule-card-model.d.ts +4 -3
  87. package/dist/dashboard/schedule-card-model.d.ts.map +1 -1
  88. package/dist/dashboard/schedule-card-model.js +5 -4
  89. package/dist/dashboard/schedule-card-model.js.map +1 -1
  90. package/dist/dashboard/settings-write-applier.d.ts +37 -3
  91. package/dist/dashboard/settings-write-applier.d.ts.map +1 -1
  92. package/dist/dashboard/settings-write-applier.js +63 -0
  93. package/dist/dashboard/settings-write-applier.js.map +1 -1
  94. package/dist/dashboard/web/i18n.d.ts.map +1 -1
  95. package/dist/dashboard/web/i18n.js +28 -0
  96. package/dist/dashboard/web/i18n.js.map +1 -1
  97. package/dist/dashboard/web/insights.js +19 -19
  98. package/dist/dashboard/web/insights.js.map +1 -1
  99. package/dist/dashboard/web/overview-page.d.ts.map +1 -1
  100. package/dist/dashboard/web/overview-page.js +7 -4
  101. package/dist/dashboard/web/overview-page.js.map +1 -1
  102. package/dist/dashboard/web/schedules-page.d.ts +1 -1
  103. package/dist/dashboard/web/schedules-page.d.ts.map +1 -1
  104. package/dist/dashboard/web/schedules-page.js +7 -3
  105. package/dist/dashboard/web/schedules-page.js.map +1 -1
  106. package/dist/dashboard/web/sessions.js +2 -2
  107. package/dist/dashboard/web/settings-page.d.ts +9 -0
  108. package/dist/dashboard/web/settings-page.d.ts.map +1 -1
  109. package/dist/dashboard/web/settings-page.js +132 -43
  110. package/dist/dashboard/web/settings-page.js.map +1 -1
  111. package/dist/dashboard/web/store.d.ts +6 -0
  112. package/dist/dashboard/web/store.d.ts.map +1 -1
  113. package/dist/dashboard/web/store.js +18 -1
  114. package/dist/dashboard/web/store.js.map +1 -1
  115. package/dist/dashboard/webhook-routes.d.ts.map +1 -1
  116. package/dist/dashboard/webhook-routes.js +24 -0
  117. package/dist/dashboard/webhook-routes.js.map +1 -1
  118. package/dist/dashboard-web/app.js +3 -3
  119. package/dist/dashboard-web/chunks/{bot-defaults-page-Z36I5CKM.js → bot-defaults-page-3OIY7N76.js} +1 -1
  120. package/dist/dashboard-web/chunks/{chunk-2BBCKWNO.js → chunk-BNEXMNQD.js} +3 -3
  121. package/dist/dashboard-web/chunks/{chunk-QDKIUULH.js → chunk-DKKOGZCG.js} +1 -1
  122. package/dist/dashboard-web/chunks/chunk-LXIK7OUJ.js +1 -0
  123. package/dist/dashboard-web/chunks/{chunk-BAMNP73K.js → chunk-VFCACTRF.js} +1 -1
  124. package/dist/dashboard-web/chunks/{connectors-I3MGERCM.js → connectors-VDOAKUW3.js} +1 -1
  125. package/dist/dashboard-web/chunks/{groups-page-DTP2L4FQ.js → groups-page-CX5AN4XG.js} +1 -1
  126. package/dist/dashboard-web/chunks/{insights-page-FNI24WYF.js → insights-page-DOMRL4S6.js} +1 -1
  127. package/dist/dashboard-web/chunks/overview-page-AZBAXVZ7.js +1 -0
  128. package/dist/dashboard-web/chunks/{roles-page-A5DZ7Q6U.js → roles-page-3FEAH6S4.js} +1 -1
  129. package/dist/dashboard-web/chunks/schedules-CTQEA7IE.js +1 -0
  130. package/dist/dashboard-web/chunks/{sessions-YJ735IH4.js → sessions-LVZCXO2Z.js} +1 -1
  131. package/dist/dashboard-web/chunks/{sessions-page-2REIJ56C.js → sessions-page-NHBJDSBC.js} +1 -1
  132. package/dist/dashboard-web/chunks/settings-page-CRDIHRNE.js +2 -0
  133. package/dist/dashboard-web/chunks/{skills-page-ZCCLHWMJ.js → skills-page-VUG3EPWX.js} +1 -1
  134. package/dist/dashboard-web/chunks/{team-federation-page-4FCGO3WW.js → team-federation-page-ZKL3YMGN.js} +1 -1
  135. package/dist/dashboard-web/chunks/{workflows-KFJ7O57L.js → workflows-4BYQQBFP.js} +1 -1
  136. package/dist/dashboard-web/index.html +1 -1
  137. package/dist/dashboard-web/style.css +111 -16
  138. package/dist/dashboard.js +196 -2
  139. package/dist/dashboard.js.map +1 -1
  140. package/dist/global-config.d.ts +30 -0
  141. package/dist/global-config.d.ts.map +1 -1
  142. package/dist/global-config.js +64 -1
  143. package/dist/global-config.js.map +1 -1
  144. package/dist/i18n/en.d.ts.map +1 -1
  145. package/dist/i18n/en.js +10 -7
  146. package/dist/i18n/en.js.map +1 -1
  147. package/dist/i18n/zh.d.ts.map +1 -1
  148. package/dist/i18n/zh.js +10 -7
  149. package/dist/i18n/zh.js.map +1 -1
  150. package/dist/im/lark/card-builder.d.ts +1 -1
  151. package/dist/im/lark/card-builder.js +1 -1
  152. package/dist/im/lark/card-handler.d.ts +3 -0
  153. package/dist/im/lark/card-handler.d.ts.map +1 -1
  154. package/dist/im/lark/card-handler.js +8 -0
  155. package/dist/im/lark/card-handler.js.map +1 -1
  156. package/dist/im/lark/client.d.ts +1 -0
  157. package/dist/im/lark/client.d.ts.map +1 -1
  158. package/dist/im/lark/client.js +19 -0
  159. package/dist/im/lark/client.js.map +1 -1
  160. package/dist/im/lark/event-dispatcher.d.ts +10 -0
  161. package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
  162. package/dist/im/lark/event-dispatcher.js +100 -21
  163. package/dist/im/lark/event-dispatcher.js.map +1 -1
  164. package/dist/im/lark/grant-command.d.ts +1 -1
  165. package/dist/im/lark/grant-command.js +1 -1
  166. package/dist/im/lark/workflow-slash-command.js +4 -0
  167. package/dist/im/lark/workflow-slash-command.js.map +1 -1
  168. package/dist/mir-prompt.d.ts +16 -0
  169. package/dist/mir-prompt.d.ts.map +1 -0
  170. package/dist/mir-prompt.js +170 -0
  171. package/dist/mir-prompt.js.map +1 -0
  172. package/dist/mir-runner.js +1 -149
  173. package/dist/mir-runner.js.map +1 -1
  174. package/dist/platform/bind.d.ts.map +1 -1
  175. package/dist/platform/bind.js +3 -11
  176. package/dist/platform/bind.js.map +1 -1
  177. package/dist/platform/binding.d.ts +4 -5
  178. package/dist/platform/binding.d.ts.map +1 -1
  179. package/dist/platform/binding.js +0 -11
  180. package/dist/platform/binding.js.map +1 -1
  181. package/dist/platform/tunnel-client.d.ts.map +1 -1
  182. package/dist/platform/tunnel-client.js +37 -28
  183. package/dist/platform/tunnel-client.js.map +1 -1
  184. package/dist/services/deployment-identity.d.ts +1 -1
  185. package/dist/services/deployment-identity.d.ts.map +1 -1
  186. package/dist/services/deployment-identity.js +1 -1
  187. package/dist/services/deployment-identity.js.map +1 -1
  188. package/dist/services/doc-subs-store.js +1 -1
  189. package/dist/services/team-board-store.js +1 -1
  190. package/dist/services/team-board-store.js.map +1 -1
  191. package/dist/services/trigger-types.d.ts +2 -1
  192. package/dist/services/trigger-types.d.ts.map +1 -1
  193. package/dist/services/trigger-types.js +11 -2
  194. package/dist/services/trigger-types.js.map +1 -1
  195. package/dist/services/vc-meeting-runtime-store.d.ts +55 -0
  196. package/dist/services/vc-meeting-runtime-store.d.ts.map +1 -0
  197. package/dist/services/vc-meeting-runtime-store.js +313 -0
  198. package/dist/services/vc-meeting-runtime-store.js.map +1 -0
  199. package/dist/services/voice/index.d.ts +6 -1
  200. package/dist/services/voice/index.d.ts.map +1 -1
  201. package/dist/services/voice/index.js +12 -5
  202. package/dist/services/voice/index.js.map +1 -1
  203. package/dist/services/voice/sami.js +1 -1
  204. package/dist/setup/lark-scopes.json +5 -0
  205. package/dist/setup/verify-permissions.d.ts +6 -0
  206. package/dist/setup/verify-permissions.d.ts.map +1 -1
  207. package/dist/setup/verify-permissions.js +17 -0
  208. package/dist/setup/verify-permissions.js.map +1 -1
  209. package/dist/skills/definitions.d.ts.map +1 -1
  210. package/dist/skills/definitions.js +10 -0
  211. package/dist/skills/definitions.js.map +1 -1
  212. package/dist/types.d.ts +4 -0
  213. package/dist/types.d.ts.map +1 -1
  214. package/dist/utils/daemon-discovery.d.ts +2 -0
  215. package/dist/utils/daemon-discovery.d.ts.map +1 -1
  216. package/dist/utils/daemon-discovery.js +2 -0
  217. package/dist/utils/daemon-discovery.js.map +1 -1
  218. package/dist/utils/timezone.d.ts +51 -0
  219. package/dist/utils/timezone.d.ts.map +1 -0
  220. package/dist/utils/timezone.js +110 -0
  221. package/dist/utils/timezone.js.map +1 -0
  222. package/dist/vc-agent/cards.d.ts +47 -0
  223. package/dist/vc-agent/cards.d.ts.map +1 -0
  224. package/dist/vc-agent/cards.js +489 -0
  225. package/dist/vc-agent/cards.js.map +1 -0
  226. package/dist/vc-agent/meeting-state.d.ts +39 -0
  227. package/dist/vc-agent/meeting-state.d.ts.map +1 -0
  228. package/dist/vc-agent/meeting-state.js +186 -0
  229. package/dist/vc-agent/meeting-state.js.map +1 -0
  230. package/dist/vc-agent/normalizer.d.ts +13 -0
  231. package/dist/vc-agent/normalizer.d.ts.map +1 -0
  232. package/dist/vc-agent/normalizer.js +411 -0
  233. package/dist/vc-agent/normalizer.js.map +1 -0
  234. package/dist/vc-agent/polling-source.d.ts +36 -0
  235. package/dist/vc-agent/polling-source.d.ts.map +1 -0
  236. package/dist/vc-agent/polling-source.js +129 -0
  237. package/dist/vc-agent/polling-source.js.map +1 -0
  238. package/dist/vc-agent/push-source.d.ts +13 -0
  239. package/dist/vc-agent/push-source.d.ts.map +1 -0
  240. package/dist/vc-agent/push-source.js +109 -0
  241. package/dist/vc-agent/push-source.js.map +1 -0
  242. package/dist/vc-agent/realtime/audio-source.d.ts +6 -0
  243. package/dist/vc-agent/realtime/audio-source.d.ts.map +1 -0
  244. package/dist/vc-agent/realtime/audio-source.js +17 -0
  245. package/dist/vc-agent/realtime/audio-source.js.map +1 -0
  246. package/dist/vc-agent/realtime/endpoint.d.ts +6 -0
  247. package/dist/vc-agent/realtime/endpoint.d.ts.map +1 -0
  248. package/dist/vc-agent/realtime/endpoint.js +25 -0
  249. package/dist/vc-agent/realtime/endpoint.js.map +1 -0
  250. package/dist/vc-agent/realtime/errors.d.ts +9 -0
  251. package/dist/vc-agent/realtime/errors.d.ts.map +1 -0
  252. package/dist/vc-agent/realtime/errors.js +17 -0
  253. package/dist/vc-agent/realtime/errors.js.map +1 -0
  254. package/dist/vc-agent/realtime/events.d.ts +24 -0
  255. package/dist/vc-agent/realtime/events.d.ts.map +1 -0
  256. package/dist/vc-agent/realtime/events.js +190 -0
  257. package/dist/vc-agent/realtime/events.js.map +1 -0
  258. package/dist/vc-agent/realtime/frontier.d.ts +34 -0
  259. package/dist/vc-agent/realtime/frontier.d.ts.map +1 -0
  260. package/dist/vc-agent/realtime/frontier.js +40 -0
  261. package/dist/vc-agent/realtime/frontier.js.map +1 -0
  262. package/dist/vc-agent/realtime/index.d.ts +11 -0
  263. package/dist/vc-agent/realtime/index.d.ts.map +1 -0
  264. package/dist/vc-agent/realtime/index.js +11 -0
  265. package/dist/vc-agent/realtime/index.js.map +1 -0
  266. package/dist/vc-agent/realtime/pacer.d.ts +21 -0
  267. package/dist/vc-agent/realtime/pacer.d.ts.map +1 -0
  268. package/dist/vc-agent/realtime/pacer.js +80 -0
  269. package/dist/vc-agent/realtime/pacer.js.map +1 -0
  270. package/dist/vc-agent/realtime/protobuf.d.ts +33 -0
  271. package/dist/vc-agent/realtime/protobuf.d.ts.map +1 -0
  272. package/dist/vc-agent/realtime/protobuf.js +159 -0
  273. package/dist/vc-agent/realtime/protobuf.js.map +1 -0
  274. package/dist/vc-agent/realtime/protocol.d.ts +4 -0
  275. package/dist/vc-agent/realtime/protocol.d.ts.map +1 -0
  276. package/dist/vc-agent/realtime/protocol.js +59 -0
  277. package/dist/vc-agent/realtime/protocol.js.map +1 -0
  278. package/dist/vc-agent/realtime/session.d.ts +39 -0
  279. package/dist/vc-agent/realtime/session.d.ts.map +1 -0
  280. package/dist/vc-agent/realtime/session.js +221 -0
  281. package/dist/vc-agent/realtime/session.js.map +1 -0
  282. package/dist/vc-agent/realtime/transport.d.ts +23 -0
  283. package/dist/vc-agent/realtime/transport.d.ts.map +1 -0
  284. package/dist/vc-agent/realtime/transport.js +112 -0
  285. package/dist/vc-agent/realtime/transport.js.map +1 -0
  286. package/dist/vc-agent/realtime/types.d.ts +84 -0
  287. package/dist/vc-agent/realtime/types.d.ts.map +1 -0
  288. package/dist/vc-agent/realtime/types.js +5 -0
  289. package/dist/vc-agent/realtime/types.js.map +1 -0
  290. package/dist/vc-agent/types.d.ts +142 -0
  291. package/dist/vc-agent/types.d.ts.map +1 -0
  292. package/dist/vc-agent/types.js +2 -0
  293. package/dist/vc-agent/types.js.map +1 -0
  294. package/dist/worker.js +8 -5
  295. package/dist/worker.js.map +1 -1
  296. package/dist/workflows/attempt-resume.d.ts +4 -0
  297. package/dist/workflows/attempt-resume.d.ts.map +1 -1
  298. package/dist/workflows/attempt-resume.js +2 -0
  299. package/dist/workflows/attempt-resume.js.map +1 -1
  300. package/dist/workflows/attempt-terminal.d.ts +4 -0
  301. package/dist/workflows/attempt-terminal.d.ts.map +1 -1
  302. package/dist/workflows/attempt-terminal.js.map +1 -1
  303. package/dist/workflows/daemon-spawn.d.ts.map +1 -1
  304. package/dist/workflows/daemon-spawn.js +7 -0
  305. package/dist/workflows/daemon-spawn.js.map +1 -1
  306. package/dist/workflows/definition.d.ts +14 -14
  307. package/dist/workflows/events/payloads.d.ts +40 -8
  308. package/dist/workflows/events/payloads.d.ts.map +1 -1
  309. package/dist/workflows/events/payloads.js +4 -0
  310. package/dist/workflows/events/payloads.js.map +1 -1
  311. package/dist/workflows/events/schema.d.ts +508 -452
  312. package/dist/workflows/events/schema.d.ts.map +1 -1
  313. package/dist/workflows/runtime.d.ts +4 -0
  314. package/dist/workflows/runtime.d.ts.map +1 -1
  315. package/dist/workflows/runtime.js.map +1 -1
  316. package/dist/workflows/spawn-policy.d.ts +14 -0
  317. package/dist/workflows/spawn-policy.d.ts.map +1 -0
  318. package/dist/workflows/spawn-policy.js +9 -0
  319. package/dist/workflows/spawn-policy.js.map +1 -0
  320. package/dist/workflows/v3/bot-resolve.d.ts.map +1 -1
  321. package/dist/workflows/v3/bot-resolve.js +4 -0
  322. package/dist/workflows/v3/bot-resolve.js.map +1 -1
  323. package/dist/workflows/v3/cli-run.d.ts.map +1 -1
  324. package/dist/workflows/v3/cli-run.js +4 -0
  325. package/dist/workflows/v3/cli-run.js.map +1 -1
  326. package/dist/workflows/v3/contract.d.ts +9 -3
  327. package/dist/workflows/v3/contract.d.ts.map +1 -1
  328. package/dist/workflows/v3/contract.js +3 -3
  329. package/dist/workflows/v3/contract.js.map +1 -1
  330. package/dist/workflows/v3/ephemeral-pool.d.ts.map +1 -1
  331. package/dist/workflows/v3/ephemeral-pool.js +2 -0
  332. package/dist/workflows/v3/ephemeral-pool.js.map +1 -1
  333. package/dist/workflows/v3/runtime.js +1 -1
  334. package/dist/workflows/v3/runtime.js.map +1 -1
  335. package/package.json +1 -1
  336. package/dist/dashboard-web/chunks/chunk-76J7PNZI.js +0 -1
  337. package/dist/dashboard-web/chunks/overview-page-EHCZJBWY.js +0 -1
  338. package/dist/dashboard-web/chunks/schedules-RSXALJU4.js +0 -1
  339. package/dist/dashboard-web/chunks/settings-page-XKFTXTDE.js +0 -2
package/dist/cli.js CHANGED
@@ -40,9 +40,10 @@ import { buildBotFromAddFlags, editInputFromFlags, isScriptedSetupInvocation, ma
40
40
  import { interactiveSelect, pickChoice, pickCliSelection } from './setup/interactive-select.js';
41
41
  import { buildPreset, serializePreset, presetFilename } from './setup/agent-preset.js';
42
42
  import { logger } from './utils/logger.js';
43
+ import { scheduleTimeZone } from './utils/timezone.js';
43
44
  import { expandHomePath, invalidWorkingDirs } from './utils/working-dir.js';
44
45
  import { firstPositional } from './cli/arg-utils.js';
45
- import { dispatchPrimaryMessage, findStdinAliasAttachment, sendFileAttachments } from './cli/send-dispatch.js';
46
+ import { dispatchPrimaryMessage, findStdinAliasAttachment, sendFileAttachments, sendVideoAttachments, shouldSendAsPureVideo, validateVideoAttachments } from './cli/send-dispatch.js';
46
47
  import { buildPm2SpawnCommand } from './cli/pm2-command.js';
47
48
  import { callDashboard } from './cli/dashboard-endpoint.js';
48
49
  import { npmGlobalUpdateCwd } from './core/maintenance.js';
@@ -3458,6 +3459,8 @@ botmux v${getVersion()} — IM ↔ AI 编程 CLI 桥接
3458
3459
  voice 配置语音总结(高级功能,独立于 setup)— 交互式填 TTS 引擎+凭证
3459
3460
  voice status 查看当前语音配置(凭证打码)
3460
3461
  voice disable 关闭语音功能(移除配置)
3462
+ vc-agent tat-gate|poll
3463
+ 飞书会议智能体 P0:校验 TAT 会中事件读取、轮询会议事件并触发 workflow
3461
3464
  whiteboard status|enable|disable
3462
3465
  本地项目白板(默认关闭;enable 只打开能力,不创建白板)
3463
3466
  current --create / list / read / update / write --yes
@@ -3474,6 +3477,8 @@ botmux v${getVersion()} — IM ↔ AI 编程 CLI 桥接
3474
3477
  send [content] 发消息到当前话题(支持 stdin / --content-file)
3475
3478
  --images <path> 内联图片(可重复)
3476
3479
  --files <path> 附件(可重复)
3480
+ --videos <path> 视频预览 MP4(可重复,需配套 --video-covers)
3481
+ --video-covers <path> 视频封面图片(可重复,按顺序对应 --videos)
3477
3482
  --mention <open_id:name> @提及(可重复)
3478
3483
  --mention-back @回本轮触发消息的发送者(open_id 自动取自会话)
3479
3484
  --no-mention 明确声明本条不@任何人
@@ -3898,8 +3903,8 @@ async function cmdSchedule(sub, rest) {
3898
3903
  console.log(`定时任务 (${filtered.length}${filter ? '/' + tasks.length : ''}):\n`);
3899
3904
  for (const t of filtered) {
3900
3905
  const status = t.enabled ? '✅' : '⏸️';
3901
- const next = t.nextRunAt ? new Date(t.nextRunAt).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) : '—';
3902
- const last = t.lastRunAt ? new Date(t.lastRunAt).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) : '—';
3906
+ const next = t.nextRunAt ? new Date(t.nextRunAt).toLocaleString('zh-CN', { timeZone: scheduleTimeZone() }) : '—';
3907
+ const last = t.lastRunAt ? new Date(t.lastRunAt).toLocaleString('zh-CN', { timeZone: scheduleTimeZone() }) : '—';
3903
3908
  const display = t.parsed?.display ?? t.schedule;
3904
3909
  const prompt = t.prompt ?? '';
3905
3910
  const chatId = t.chatId ?? '—';
@@ -3961,7 +3966,7 @@ async function cmdSchedule(sub, rest) {
3961
3966
  chatType: cur?.chatType === 'p2p' ? 'p2p' : 'topic_group',
3962
3967
  deliver,
3963
3968
  });
3964
- const next = task.nextRunAt ? new Date(task.nextRunAt).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }) : '—';
3969
+ const next = task.nextRunAt ? new Date(task.nextRunAt).toLocaleString('zh-CN', { timeZone: scheduleTimeZone() }) : '—';
3965
3970
  console.log(`✅ 已创建定时任务 [${task.id}] ${task.name}`);
3966
3971
  console.log(` 规则: ${parsed.display}`);
3967
3972
  console.log(` 下次执行: ${next}`);
@@ -4167,6 +4172,11 @@ async function cmdQuoted(rest) {
4167
4172
  console.error('用法: botmux quoted <message_id> [--session-id <id>]');
4168
4173
  process.exit(1);
4169
4174
  }
4175
+ // Read isolation: register this bot from its own send-cred file so the Lark
4176
+ // client (getMessageDetail below) is available WITHOUT reading the denied
4177
+ // bots.json — same as cmdHistory / cmdSend. Missing this was why a sandboxed
4178
+ // isolated bot's `botmux quoted` failed "Bot not registered".
4179
+ await registerSelfFromCredFile();
4170
4180
  const { larkAppId: appId } = await resolveSessionAppId(sessionIdArg);
4171
4181
  const { getMessageDetail } = await import('./im/lark/client.js');
4172
4182
  const { expandMergeForward } = await import('./im/lark/merge-forward.js');
@@ -4190,6 +4200,20 @@ async function cmdQuoted(rest) {
4190
4200
  if (merged)
4191
4201
  rendered.content = merged.text;
4192
4202
  }
4203
+ // The referenced message's file/media resources arrive as key+name only. A
4204
+ // read-isolated agent can't call the Lark resource API itself (bots.json
4205
+ // creds are deny-read), so download the bytes HERE — via the bot client
4206
+ // registered above — into this bot's OWN attachment bucket
4207
+ // (attachments/<appId>/<messageId>/, read-allowed by its carve-out; sandbox
4208
+ // denies file *reads*, not writes). Surface the local paths so the agent can
4209
+ // actually open the file instead of only seeing its key.
4210
+ if (rendered.resources?.length) {
4211
+ const { downloadResources } = await import('./core/session-manager.js');
4212
+ const { attachments, needLogin } = await downloadResources(appId, messageId, rendered.resources);
4213
+ rendered.attachments = attachments;
4214
+ if (needLogin)
4215
+ rendered.needLogin = true;
4216
+ }
4193
4217
  console.log(JSON.stringify(rendered, null, 2));
4194
4218
  }
4195
4219
  catch (err) {
@@ -4275,17 +4299,28 @@ async function relaySend(rest, relayDir) {
4275
4299
  const contentBase = `${id}.content`;
4276
4300
  const cfile = join(relayDir, contentBase);
4277
4301
  writeFileSync(cfile, content);
4278
- // Copy any --image/--file attachment into the outbox; carry only basenames.
4279
- const attachments = [];
4280
- for (const p of argValues(rest, '--image', '--images', '--file', '--files')) {
4302
+ // Copy attachments into the outbox; carry only basenames.
4303
+ const copyOutboxAttachment = (p, out) => {
4281
4304
  if (!p || !existsSync(p))
4282
- continue;
4305
+ return;
4283
4306
  const base = `${id}-${randomBytes(4).toString('hex')}-${basename(p)}`;
4284
4307
  try {
4285
4308
  writeFileSync(join(relayDir, base), readFileSync(p));
4286
- attachments.push(base);
4309
+ out.push(base);
4287
4310
  }
4288
4311
  catch { /* skip unreadable */ }
4312
+ };
4313
+ const attachments = [];
4314
+ for (const p of argValues(rest, '--image', '--images', '--file', '--files')) {
4315
+ copyOutboxAttachment(p, attachments);
4316
+ }
4317
+ const videos = [];
4318
+ for (const p of argValues(rest, '--video', '--videos')) {
4319
+ copyOutboxAttachment(p, videos);
4320
+ }
4321
+ const videoCovers = [];
4322
+ for (const p of argValues(rest, '--video-cover', '--video-covers')) {
4323
+ copyOutboxAttachment(p, videoCovers);
4289
4324
  }
4290
4325
  // Forward only presentation flags (must match the watcher's allowlist); path,
4291
4326
  // routing (--chat-id/--into/--top-level) and --session-id flags are dropped —
@@ -4303,7 +4338,7 @@ async function relaySend(rest, relayDir) {
4303
4338
  }
4304
4339
  // 原子写:req.json 是 host watcher 的触发文件,rename 让它「完整出现」,
4305
4340
  // watcher 永远不会读到半截 JSON(tmp 后缀不匹配 .req.json 过滤)。
4306
- atomicWriteFileSync(join(relayDir, `${id}.req.json`), JSON.stringify({ contentFile: contentBase, attachments, flags }));
4341
+ atomicWriteFileSync(join(relayDir, `${id}.req.json`), JSON.stringify({ contentFile: contentBase, attachments, videos, videoCovers, flags }));
4307
4342
  const resPath = join(relayDir, `${id}.res.json`);
4308
4343
  const deadlineMs = Date.now() + 120_000;
4309
4344
  while (Date.now() < deadlineMs) {
@@ -4388,15 +4423,29 @@ async function cmdSend(rest) {
4388
4423
  // from its own worker-written cred file instead (see registerSelfFromCredFile).
4389
4424
  await registerSelfFromCredFile();
4390
4425
  const sessionIdArg = argValue(rest, '--session-id');
4426
+ for (const flag of ['--video', '--videos', '--video-cover', '--video-covers']) {
4427
+ if (flagPresentButValueMissing(rest, flag, true)) {
4428
+ console.error(`botmux send: ${flag} 需要路径参数`);
4429
+ process.exit(2);
4430
+ }
4431
+ }
4391
4432
  const images = argValues(rest, '--image', '--images');
4392
4433
  const files = argValues(rest, '--file', '--files');
4434
+ const videos = argValues(rest, '--video', '--videos');
4435
+ const videoCovers = argValues(rest, '--video-cover', '--video-covers');
4436
+ const videoValidation = validateVideoAttachments(videos, videoCovers);
4437
+ if (!videoValidation.ok) {
4438
+ console.error(`botmux send: ${videoValidation.error}`);
4439
+ process.exit(2);
4440
+ }
4441
+ const videoAttachments = videoValidation.videos;
4393
4442
  // stdin can't be both the message body (which `botmux send` reads from it) and
4394
- // a `--file`/`--image` attachment — the second read sees EOF and the upload
4443
+ // a `--file`/`--image`/`--video` attachment — the second read sees EOF and the upload
4395
4444
  // fails *after* the message is already sent, leaving the caller to resend.
4396
4445
  // Reject up front so exit≠0 reliably means "nothing was sent".
4397
- const stdinAlias = findStdinAliasAttachment([...images, ...files]);
4446
+ const stdinAlias = findStdinAliasAttachment([...images, ...files, ...videos, ...videoCovers]);
4398
4447
  if (stdinAlias) {
4399
- console.error(`不能把 stdin(${stdinAlias})当作 --file/--image 附件:botmux send 已从 stdin 读取消息正文,\n` +
4448
+ console.error(`不能把 stdin(${stdinAlias})当作 --file/--image/--video 附件:botmux send 已从 stdin 读取消息正文,\n` +
4400
4449
  `同一个 stdin 没法既当正文又当附件(第二次读到的是 EOF)。\n` +
4401
4450
  `要发送管道内容,先落到临时文件: 数据来源 > /tmp/x && botmux send --files /tmp/x …`);
4402
4451
  process.exit(1);
@@ -4467,8 +4516,8 @@ async function cmdSend(rest) {
4467
4516
  }
4468
4517
  if (!contentFile)
4469
4518
  rejectLikelyWindowsStdinMojibake(content);
4470
- if (!content.trim() && images.length === 0 && files.length === 0) {
4471
- console.error('没有内容可发送。用法:\n echo "消息" | botmux send\n botmux send "消息"\n botmux send --content-file /tmp/msg.md --images /tmp/chart.png');
4519
+ if (!content.trim() && images.length === 0 && files.length === 0 && videoAttachments.length === 0) {
4520
+ console.error('没有内容可发送。用法:\n echo "消息" | botmux send\n botmux send "消息"\n botmux send --content-file /tmp/msg.md --images /tmp/chart.png\n botmux send --videos /tmp/replay.mp4 --video-covers /tmp/cover.png --no-mention "视频预览"');
4472
4521
  process.exit(1);
4473
4522
  }
4474
4523
  // --attention guard: only valid replying into the current session with a text
@@ -4637,12 +4686,18 @@ async function cmdSend(rest) {
4637
4686
  mentions.push({ open_id: s.quoteTargetSenderOpenId, name: '' });
4638
4687
  }
4639
4688
  // Validate file paths
4640
- for (const p of [...images, ...files]) {
4689
+ for (const p of [...images, ...files, ...videos, ...videoCovers]) {
4641
4690
  if (!existsSync(p)) {
4642
4691
  console.error(`文件不存在: ${p}`);
4643
4692
  process.exit(1);
4644
4693
  }
4645
4694
  }
4695
+ for (const p of [...videos, ...videoCovers]) {
4696
+ if (!statSync(p).isFile()) {
4697
+ console.error(`不是普通文件: ${p}`);
4698
+ process.exit(1);
4699
+ }
4700
+ }
4646
4701
  // Register bots so Lark client works
4647
4702
  const { registerBot, loadBotConfigs, findOncallChatForAnyBot } = await import('./bot-registry.js');
4648
4703
  try {
@@ -4895,7 +4950,36 @@ async function cmdSend(rest) {
4895
4950
  // we committed to sending — that's the boundary the gate cares about.
4896
4951
  const sentAtMs = Date.now();
4897
4952
  let messageId;
4898
- {
4953
+ let failedAttachments = [];
4954
+ let failedVideoAttachments = [];
4955
+ // Pure-video fast path: send the preview as a standalone media message.
4956
+ // A send that also carries mentions is deliberately excluded (media messages
4957
+ // can't embed `<at>`), so it falls through to the card branch which renders
4958
+ // the @ on the footer and sends the video as a follow-up attachment — same
4959
+ // shape as an attachment-only `--files … --mention …` send, whose card body
4960
+ // is likewise empty. See shouldSendAsPureVideo.
4961
+ const pureVideoSend = shouldSendAsPureVideo({
4962
+ hasBodyText: !!text.trim(),
4963
+ imageCount: imageKeys.length,
4964
+ fileCount: files.length,
4965
+ videoCount: videoAttachments.length,
4966
+ mentionCount: mentions.length,
4967
+ });
4968
+ if (pureVideoSend) {
4969
+ // No card/text primary here, so the FIRST media message must carry the
4970
+ // quote chain itself (dispatchPrimary applies the chat-scope quoteTargetId
4971
+ // and updates primaryQuotedId). Otherwise a bare `--videos … --no-mention`
4972
+ // reply in a 普通群 lands as a standalone message that doesn't quote the
4973
+ // trigger — unlike file-only/image-only sends whose primary card quotes.
4974
+ const videoResult = await sendVideoAttachments({ uploadFile, uploadImage, dispatch, primaryDispatch: dispatchPrimary }, appId, videoAttachments);
4975
+ failedVideoAttachments = videoResult.failed;
4976
+ if (videoResult.sent.length === 0) {
4977
+ const first = failedVideoAttachments[0]?.error ?? 'unknown error';
4978
+ throw new Error(`视频发送失败: ${first}`);
4979
+ }
4980
+ messageId = videoResult.sent[0];
4981
+ }
4982
+ else {
4899
4983
  // 回复一律卡片(纯文本 post 路径已删)。
4900
4984
  // Inline `@Name` → `<at id=…>` at the exact spot it's written (CJK-name
4901
4985
  // aware, see applyInlineMentions); any --mention not inlined here is
@@ -4999,15 +5083,24 @@ async function cmdSend(rest) {
4999
5083
  // closed a pending response card for this turn.
5000
5084
  if (shouldRecordBridgeMarker)
5001
5085
  recordBridgeSendMarker(sentAtMs, messageId, text);
5002
- // Send file attachments as separate messages — best-effort. The primary
5003
- // message is already delivered above; a failing attachment must not throw
5004
- // out to the catch below (which would report total failure / exit 1 for an
5005
- // already-sent message and make the caller resend). Warn instead, and list
5006
- // the failures in the success JSON.
5007
- const { failed: failedAttachments } = await sendFileAttachments({ uploadFile, dispatch }, appId, files);
5086
+ // Send attachments as separate messages — best-effort. The primary message
5087
+ // is already delivered above; a failing attachment must not throw out to the
5088
+ // catch below (which would report total failure / exit 1 for an already-sent
5089
+ // message and make the caller resend). Warn instead, and list failures in
5090
+ // the success JSON. Pure-video sends have no text/card primary, so the media
5091
+ // message above is the primary and failures before any media is sent still
5092
+ // surface as command failure.
5093
+ if (!pureVideoSend) {
5094
+ ({ failed: failedAttachments } = await sendFileAttachments({ uploadFile, dispatch }, appId, files));
5095
+ const videoResult = await sendVideoAttachments({ uploadFile, uploadImage, dispatch }, appId, videoAttachments);
5096
+ failedVideoAttachments = videoResult.failed;
5097
+ }
5008
5098
  for (const f of failedAttachments) {
5009
5099
  console.error(`⚠️ 附件未发送(主消息已送达 ${messageId},请勿重发): ${f.path} — ${f.error}`);
5010
5100
  }
5101
+ for (const f of failedVideoAttachments) {
5102
+ console.error(`⚠️ 视频未发送(主消息已送达 ${messageId},请勿重发): ${f.path} / cover ${f.coverPath} — ${f.error}`);
5103
+ }
5011
5104
  // Bot-to-bot 转发依赖飞书"获取群组中其他机器人和用户@当前机器人的消息"权限:
5012
5105
  // 目标 bot 的 daemon 现在能从 WSClient 原生收到 sender_type='app' 的事件,
5013
5106
  // 不需要 botmux 自己再写本地 signal 文件做转发。outgoing 消息里 @BotName /
@@ -5055,6 +5148,9 @@ async function cmdSend(rest) {
5055
5148
  ...(failedAttachments.length > 0
5056
5149
  ? { failedAttachments: failedAttachments.map(f => f.path) }
5057
5150
  : {}),
5151
+ ...(failedVideoAttachments.length > 0
5152
+ ? { failedVideoAttachments: failedVideoAttachments.map(f => f.path) }
5153
+ : {}),
5058
5154
  }));
5059
5155
  }
5060
5156
  catch (err) {
@@ -5264,7 +5360,7 @@ async function cmdDispatch(rest) {
5264
5360
  *
5265
5361
  * In 多话题协作模式 the sub-bot lives in its own sub-topic, where the orchestrator
5266
5362
  * has no session; @-ing the orchestrator there would spawn a fresh, context-less
5267
- * one (申晗's #1 bug). Instead this routes the report INTO the orchestrator's own
5363
+ * one (the reported #1 bug). Instead this routes the report INTO the orchestrator's own
5268
5364
  * thread (recorded by `botmux dispatch` in orchestrate-dispatch.json) and @-s the
5269
5365
  * orchestrator there, so its existing, context-rich session is the one that wakes.
5270
5366
  *
@@ -6558,6 +6654,11 @@ switch (command) {
6558
6654
  case 'voice':
6559
6655
  await cmdVoiceSetup(process.argv.slice(3));
6560
6656
  break;
6657
+ case 'vc-agent': {
6658
+ const { cmdVcAgent } = await import('./cli/vc-agent.js');
6659
+ await cmdVcAgent(process.argv[3] ?? '', process.argv.slice(4));
6660
+ break;
6661
+ }
6561
6662
  case 'whiteboard':
6562
6663
  case 'wb':
6563
6664
  await cmdWhiteboard(process.argv[3] ?? 'status', process.argv.slice(4));