botmux 2.107.0 → 2.108.0

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 (515) hide show
  1. package/README.en.md +17 -14
  2. package/README.md +19 -14
  3. package/dist/adapters/backend/sandbox.d.ts +3 -1
  4. package/dist/adapters/backend/sandbox.d.ts.map +1 -1
  5. package/dist/adapters/backend/sandbox.js +19 -3
  6. package/dist/adapters/backend/sandbox.js.map +1 -1
  7. package/dist/adapters/backend/tmux-backend.d.ts.map +1 -1
  8. package/dist/adapters/backend/tmux-backend.js +16 -1
  9. package/dist/adapters/backend/tmux-backend.js.map +1 -1
  10. package/dist/adapters/backend/tmux-pipe-backend.d.ts +24 -15
  11. package/dist/adapters/backend/tmux-pipe-backend.d.ts.map +1 -1
  12. package/dist/adapters/backend/tmux-pipe-backend.js +75 -43
  13. package/dist/adapters/backend/tmux-pipe-backend.js.map +1 -1
  14. package/dist/adapters/cli/genius.d.ts.map +1 -1
  15. package/dist/adapters/cli/genius.js +9 -15
  16. package/dist/adapters/cli/genius.js.map +1 -1
  17. package/dist/adapters/cli/grok.d.ts +73 -0
  18. package/dist/adapters/cli/grok.d.ts.map +1 -0
  19. package/dist/adapters/cli/grok.js +298 -0
  20. package/dist/adapters/cli/grok.js.map +1 -0
  21. package/dist/adapters/cli/oh-my-pi.d.ts.map +1 -1
  22. package/dist/adapters/cli/oh-my-pi.js +133 -12
  23. package/dist/adapters/cli/oh-my-pi.js.map +1 -1
  24. package/dist/adapters/cli/registry.d.ts +2 -1
  25. package/dist/adapters/cli/registry.d.ts.map +1 -1
  26. package/dist/adapters/cli/registry.js +3 -1
  27. package/dist/adapters/cli/registry.js.map +1 -1
  28. package/dist/adapters/cli/shared-hints.d.ts +8 -4
  29. package/dist/adapters/cli/shared-hints.d.ts.map +1 -1
  30. package/dist/adapters/cli/shared-hints.js +8 -4
  31. package/dist/adapters/cli/shared-hints.js.map +1 -1
  32. package/dist/adapters/cli/types.d.ts +18 -16
  33. package/dist/adapters/cli/types.d.ts.map +1 -1
  34. package/dist/adapters/hook-installer.d.ts +5 -4
  35. package/dist/adapters/hook-installer.d.ts.map +1 -1
  36. package/dist/adapters/hook-installer.js +42 -0
  37. package/dist/adapters/hook-installer.js.map +1 -1
  38. package/dist/cli/send-dispatch.d.ts +21 -0
  39. package/dist/cli/send-dispatch.d.ts.map +1 -1
  40. package/dist/cli/send-dispatch.js +159 -0
  41. package/dist/cli/send-dispatch.js.map +1 -1
  42. package/dist/cli/session-list-liveness.d.ts +22 -0
  43. package/dist/cli/session-list-liveness.d.ts.map +1 -0
  44. package/dist/cli/session-list-liveness.js +22 -0
  45. package/dist/cli/session-list-liveness.js.map +1 -0
  46. package/dist/cli.d.ts.map +1 -1
  47. package/dist/cli.js +182 -33
  48. package/dist/cli.js.map +1 -1
  49. package/dist/core/ask-types.d.ts +4 -0
  50. package/dist/core/ask-types.d.ts.map +1 -1
  51. package/dist/core/ask-types.js +10 -0
  52. package/dist/core/ask-types.js.map +1 -1
  53. package/dist/core/cost-calculator.d.ts.map +1 -1
  54. package/dist/core/cost-calculator.js +35 -13
  55. package/dist/core/cost-calculator.js.map +1 -1
  56. package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
  57. package/dist/core/dashboard-ipc-server.js +89 -16
  58. package/dist/core/dashboard-ipc-server.js.map +1 -1
  59. package/dist/core/dashboard-rows.d.ts.map +1 -1
  60. package/dist/core/dashboard-rows.js +6 -2
  61. package/dist/core/dashboard-rows.js.map +1 -1
  62. package/dist/core/dashboard-url.d.ts +6 -5
  63. package/dist/core/dashboard-url.d.ts.map +1 -1
  64. package/dist/core/dashboard-url.js +11 -8
  65. package/dist/core/dashboard-url.js.map +1 -1
  66. package/dist/core/maintenance.d.ts +11 -8
  67. package/dist/core/maintenance.d.ts.map +1 -1
  68. package/dist/core/maintenance.js +45 -20
  69. package/dist/core/maintenance.js.map +1 -1
  70. package/dist/core/per-bot-env.d.ts.map +1 -1
  71. package/dist/core/per-bot-env.js +4 -0
  72. package/dist/core/per-bot-env.js.map +1 -1
  73. package/dist/core/session-discovery.d.ts.map +1 -1
  74. package/dist/core/session-discovery.js +4 -0
  75. package/dist/core/session-discovery.js.map +1 -1
  76. package/dist/core/skills/cli-admin-command.d.ts.map +1 -1
  77. package/dist/core/skills/cli-admin-command.js +8 -2
  78. package/dist/core/skills/cli-admin-command.js.map +1 -1
  79. package/dist/core/skills/im-command.d.ts.map +1 -1
  80. package/dist/core/skills/im-command.js +3 -1
  81. package/dist/core/skills/im-command.js.map +1 -1
  82. package/dist/core/skills/sources.d.ts +33 -1
  83. package/dist/core/skills/sources.d.ts.map +1 -1
  84. package/dist/core/skills/sources.js +97 -0
  85. package/dist/core/skills/sources.js.map +1 -1
  86. package/dist/core/skills/types.d.ts +8 -0
  87. package/dist/core/skills/types.d.ts.map +1 -1
  88. package/dist/core/terminal-url.d.ts.map +1 -1
  89. package/dist/core/terminal-url.js +12 -2
  90. package/dist/core/terminal-url.js.map +1 -1
  91. package/dist/core/terminal-write-auth.d.ts +34 -0
  92. package/dist/core/terminal-write-auth.d.ts.map +1 -0
  93. package/dist/core/terminal-write-auth.js +76 -0
  94. package/dist/core/terminal-write-auth.js.map +1 -0
  95. package/dist/core/tmux-recovery.d.ts +11 -0
  96. package/dist/core/tmux-recovery.d.ts.map +1 -0
  97. package/dist/core/tmux-recovery.js +19 -0
  98. package/dist/core/tmux-recovery.js.map +1 -0
  99. package/dist/core/types.d.ts +10 -4
  100. package/dist/core/types.d.ts.map +1 -1
  101. package/dist/core/types.js.map +1 -1
  102. package/dist/core/update-check.d.ts +2 -2
  103. package/dist/core/update-check.js +2 -2
  104. package/dist/core/worker-pool.d.ts +3 -0
  105. package/dist/core/worker-pool.d.ts.map +1 -1
  106. package/dist/core/worker-pool.js +70 -3
  107. package/dist/core/worker-pool.js.map +1 -1
  108. package/dist/daemon.d.ts.map +1 -1
  109. package/dist/daemon.js +15 -8
  110. package/dist/daemon.js.map +1 -1
  111. package/dist/dashboard/auth.d.ts +1 -1
  112. package/dist/dashboard/auth.d.ts.map +1 -1
  113. package/dist/dashboard/auth.js +7 -2
  114. package/dist/dashboard/auth.js.map +1 -1
  115. package/dist/dashboard/bot-payload.d.ts +3 -0
  116. package/dist/dashboard/bot-payload.d.ts.map +1 -1
  117. package/dist/dashboard/bot-payload.js +3 -0
  118. package/dist/dashboard/bot-payload.js.map +1 -1
  119. package/dist/dashboard/connector-api.d.ts.map +1 -1
  120. package/dist/dashboard/connector-api.js +39 -13
  121. package/dist/dashboard/connector-api.js.map +1 -1
  122. package/dist/dashboard/history-senders.d.ts +37 -0
  123. package/dist/dashboard/history-senders.d.ts.map +1 -0
  124. package/dist/dashboard/history-senders.js +60 -0
  125. package/dist/dashboard/history-senders.js.map +1 -0
  126. package/dist/dashboard/roles-batch.d.ts +31 -0
  127. package/dist/dashboard/roles-batch.d.ts.map +1 -0
  128. package/dist/dashboard/roles-batch.js +87 -0
  129. package/dist/dashboard/roles-batch.js.map +1 -0
  130. package/dist/dashboard/settings-card-model.d.ts +4 -2
  131. package/dist/dashboard/settings-card-model.d.ts.map +1 -1
  132. package/dist/dashboard/settings-card-model.js +13 -5
  133. package/dist/dashboard/settings-card-model.js.map +1 -1
  134. package/dist/dashboard/settings-write-applier.d.ts +4 -1
  135. package/dist/dashboard/settings-write-applier.d.ts.map +1 -1
  136. package/dist/dashboard/settings-write-applier.js +6 -1
  137. package/dist/dashboard/settings-write-applier.js.map +1 -1
  138. package/dist/dashboard/skill-install-request.d.ts +4 -0
  139. package/dist/dashboard/skill-install-request.d.ts.map +1 -1
  140. package/dist/dashboard/skill-install-request.js +11 -1
  141. package/dist/dashboard/skill-install-request.js.map +1 -1
  142. package/dist/dashboard/trigger-api.d.ts +9 -1
  143. package/dist/dashboard/trigger-api.d.ts.map +1 -1
  144. package/dist/dashboard/trigger-api.js +48 -10
  145. package/dist/dashboard/trigger-api.js.map +1 -1
  146. package/dist/dashboard/web/app.d.ts.map +1 -1
  147. package/dist/dashboard/web/app.js +286 -271
  148. package/dist/dashboard/web/app.js.map +1 -1
  149. package/dist/dashboard/web/bot-defaults-page.d.ts +26 -0
  150. package/dist/dashboard/web/bot-defaults-page.d.ts.map +1 -1
  151. package/dist/dashboard/web/bot-defaults-page.js +1408 -12
  152. package/dist/dashboard/web/bot-defaults-page.js.map +1 -1
  153. package/dist/dashboard/web/bot-defaults.d.ts +91 -4
  154. package/dist/dashboard/web/bot-defaults.d.ts.map +1 -1
  155. package/dist/dashboard/web/bot-defaults.js +43 -2141
  156. package/dist/dashboard/web/bot-defaults.js.map +1 -1
  157. package/dist/dashboard/web/bot-onboarding.d.ts +6 -1
  158. package/dist/dashboard/web/bot-onboarding.d.ts.map +1 -1
  159. package/dist/dashboard/web/bot-onboarding.js +261 -306
  160. package/dist/dashboard/web/bot-onboarding.js.map +1 -1
  161. package/dist/dashboard/web/connectors-page.d.ts +4 -0
  162. package/dist/dashboard/web/connectors-page.d.ts.map +1 -1
  163. package/dist/dashboard/web/connectors-page.js +228 -48
  164. package/dist/dashboard/web/connectors-page.js.map +1 -1
  165. package/dist/dashboard/web/dashboard-api.d.ts +9 -0
  166. package/dist/dashboard/web/dashboard-api.d.ts.map +1 -0
  167. package/dist/dashboard/web/dashboard-api.js +18 -0
  168. package/dist/dashboard/web/dashboard-api.js.map +1 -0
  169. package/dist/dashboard/web/dashboard-components.d.ts +92 -0
  170. package/dist/dashboard/web/dashboard-components.d.ts.map +1 -0
  171. package/dist/dashboard/web/dashboard-components.js +250 -0
  172. package/dist/dashboard/web/dashboard-components.js.map +1 -0
  173. package/dist/dashboard/web/dashboard-routes.d.ts.map +1 -1
  174. package/dist/dashboard/web/dashboard-routes.js +30 -183
  175. package/dist/dashboard/web/dashboard-routes.js.map +1 -1
  176. package/dist/dashboard/web/floating-scrollbars.d.ts +2 -0
  177. package/dist/dashboard/web/floating-scrollbars.d.ts.map +1 -0
  178. package/dist/dashboard/web/floating-scrollbars.js +264 -0
  179. package/dist/dashboard/web/floating-scrollbars.js.map +1 -0
  180. package/dist/dashboard/web/groups-api.d.ts +36 -0
  181. package/dist/dashboard/web/groups-api.d.ts.map +1 -0
  182. package/dist/dashboard/web/groups-api.js +44 -0
  183. package/dist/dashboard/web/groups-api.js.map +1 -0
  184. package/dist/dashboard/web/groups-page.d.ts.map +1 -1
  185. package/dist/dashboard/web/groups-page.js +746 -15
  186. package/dist/dashboard/web/groups-page.js.map +1 -1
  187. package/dist/dashboard/web/groups.d.ts +51 -18
  188. package/dist/dashboard/web/groups.d.ts.map +1 -1
  189. package/dist/dashboard/web/groups.js +145 -1096
  190. package/dist/dashboard/web/groups.js.map +1 -1
  191. package/dist/dashboard/web/i18n.d.ts.map +1 -1
  192. package/dist/dashboard/web/i18n.js +545 -255
  193. package/dist/dashboard/web/i18n.js.map +1 -1
  194. package/dist/dashboard/web/insights-page.d.ts.map +1 -1
  195. package/dist/dashboard/web/insights-page.js +1047 -14
  196. package/dist/dashboard/web/insights-page.js.map +1 -1
  197. package/dist/dashboard/web/insights.d.ts +177 -7
  198. package/dist/dashboard/web/insights.d.ts.map +1 -1
  199. package/dist/dashboard/web/insights.js +187 -1926
  200. package/dist/dashboard/web/insights.js.map +1 -1
  201. package/dist/dashboard/web/legacy-workflow-page.d.ts +3 -0
  202. package/dist/dashboard/web/legacy-workflow-page.d.ts.map +1 -0
  203. package/dist/dashboard/web/legacy-workflow-page.js +717 -0
  204. package/dist/dashboard/web/legacy-workflow-page.js.map +1 -0
  205. package/dist/dashboard/web/monitor-room.d.ts.map +1 -1
  206. package/dist/dashboard/web/monitor-room.js +10 -8
  207. package/dist/dashboard/web/monitor-room.js.map +1 -1
  208. package/dist/dashboard/web/monitoring-page.d.ts.map +1 -1
  209. package/dist/dashboard/web/monitoring-page.js +188 -14
  210. package/dist/dashboard/web/monitoring-page.js.map +1 -1
  211. package/dist/dashboard/web/office-page.d.ts.map +1 -1
  212. package/dist/dashboard/web/office-page.js +11 -23
  213. package/dist/dashboard/web/office-page.js.map +1 -1
  214. package/dist/dashboard/web/overview-page.d.ts.map +1 -1
  215. package/dist/dashboard/web/overview-page.js +141 -147
  216. package/dist/dashboard/web/overview-page.js.map +1 -1
  217. package/dist/dashboard/web/overview.d.ts +0 -1
  218. package/dist/dashboard/web/overview.d.ts.map +1 -1
  219. package/dist/dashboard/web/overview.js +3 -275
  220. package/dist/dashboard/web/overview.js.map +1 -1
  221. package/dist/dashboard/web/preferences.d.ts +1 -6
  222. package/dist/dashboard/web/preferences.d.ts.map +1 -1
  223. package/dist/dashboard/web/preferences.js +0 -21
  224. package/dist/dashboard/web/preferences.js.map +1 -1
  225. package/dist/dashboard/web/role-batch.d.ts +9 -0
  226. package/dist/dashboard/web/role-batch.d.ts.map +1 -0
  227. package/dist/dashboard/web/role-batch.js +42 -0
  228. package/dist/dashboard/web/role-batch.js.map +1 -0
  229. package/dist/dashboard/web/roles-page.d.ts.map +1 -1
  230. package/dist/dashboard/web/roles-page.js +538 -13
  231. package/dist/dashboard/web/roles-page.js.map +1 -1
  232. package/dist/dashboard/web/roles.d.ts +98 -1
  233. package/dist/dashboard/web/roles.d.ts.map +1 -1
  234. package/dist/dashboard/web/roles.js +117 -903
  235. package/dist/dashboard/web/roles.js.map +1 -1
  236. package/dist/dashboard/web/schedules-page.d.ts.map +1 -1
  237. package/dist/dashboard/web/schedules-page.js +82 -24
  238. package/dist/dashboard/web/schedules-page.js.map +1 -1
  239. package/dist/dashboard/web/sessions-kanban.d.ts +67 -0
  240. package/dist/dashboard/web/sessions-kanban.d.ts.map +1 -0
  241. package/dist/dashboard/web/sessions-kanban.js +481 -0
  242. package/dist/dashboard/web/sessions-kanban.js.map +1 -0
  243. package/dist/dashboard/web/sessions-page.d.ts +4 -0
  244. package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
  245. package/dist/dashboard/web/sessions-page.js +1633 -18
  246. package/dist/dashboard/web/sessions-page.js.map +1 -1
  247. package/dist/dashboard/web/sessions.d.ts +45 -4
  248. package/dist/dashboard/web/sessions.d.ts.map +1 -1
  249. package/dist/dashboard/web/sessions.js +53 -2535
  250. package/dist/dashboard/web/sessions.js.map +1 -1
  251. package/dist/dashboard/web/settings-page.d.ts +0 -2
  252. package/dist/dashboard/web/settings-page.d.ts.map +1 -1
  253. package/dist/dashboard/web/settings-page.js +127 -117
  254. package/dist/dashboard/web/settings-page.js.map +1 -1
  255. package/dist/dashboard/web/skills-page.d.ts +10 -1
  256. package/dist/dashboard/web/skills-page.d.ts.map +1 -1
  257. package/dist/dashboard/web/skills-page.js +235 -93
  258. package/dist/dashboard/web/skills-page.js.map +1 -1
  259. package/dist/dashboard/web/team-federation-page.d.ts.map +1 -1
  260. package/dist/dashboard/web/team-federation-page.js +446 -28
  261. package/dist/dashboard/web/team-federation-page.js.map +1 -1
  262. package/dist/dashboard/web/team-federation.d.ts +91 -2
  263. package/dist/dashboard/web/team-federation.d.ts.map +1 -1
  264. package/dist/dashboard/web/team-federation.js +87 -474
  265. package/dist/dashboard/web/team-federation.js.map +1 -1
  266. package/dist/dashboard/web/theme-menu.d.ts +1 -0
  267. package/dist/dashboard/web/theme-menu.d.ts.map +1 -1
  268. package/dist/dashboard/web/theme-menu.js +79 -20
  269. package/dist/dashboard/web/theme-menu.js.map +1 -1
  270. package/dist/dashboard/web/ui.d.ts +1 -2
  271. package/dist/dashboard/web/ui.d.ts.map +1 -1
  272. package/dist/dashboard/web/ui.js +8 -20
  273. package/dist/dashboard/web/ui.js.map +1 -1
  274. package/dist/dashboard/web/v3-api.d.ts +16 -0
  275. package/dist/dashboard/web/v3-api.d.ts.map +1 -0
  276. package/dist/dashboard/web/v3-api.js +21 -0
  277. package/dist/dashboard/web/v3-api.js.map +1 -0
  278. package/dist/dashboard/web/v3-components.d.ts +2 -0
  279. package/dist/dashboard/web/v3-components.d.ts.map +1 -0
  280. package/dist/dashboard/web/v3-components.js +290 -0
  281. package/dist/dashboard/web/v3-components.js.map +1 -0
  282. package/dist/dashboard/web/v3-model.d.ts +80 -0
  283. package/dist/dashboard/web/v3-model.d.ts.map +1 -0
  284. package/dist/dashboard/web/v3-model.js +240 -0
  285. package/dist/dashboard/web/v3-model.js.map +1 -0
  286. package/dist/dashboard/web/v3-page.d.ts.map +1 -1
  287. package/dist/dashboard/web/v3-page.js +2 -22
  288. package/dist/dashboard/web/v3-page.js.map +1 -1
  289. package/dist/dashboard/web/v3-terminal.d.ts +14 -0
  290. package/dist/dashboard/web/v3-terminal.d.ts.map +1 -1
  291. package/dist/dashboard/web/v3-terminal.js +31 -19
  292. package/dist/dashboard/web/v3-terminal.js.map +1 -1
  293. package/dist/dashboard/web/webhook-logs-page.d.ts +16 -0
  294. package/dist/dashboard/web/webhook-logs-page.d.ts.map +1 -0
  295. package/dist/dashboard/web/webhook-logs-page.js +195 -0
  296. package/dist/dashboard/web/webhook-logs-page.js.map +1 -0
  297. package/dist/dashboard/web/whiteboards-page.d.ts.map +1 -1
  298. package/dist/dashboard/web/whiteboards-page.js +18 -23
  299. package/dist/dashboard/web/whiteboards-page.js.map +1 -1
  300. package/dist/dashboard/web/workflow-version-switch.d.ts +8 -0
  301. package/dist/dashboard/web/workflow-version-switch.d.ts.map +1 -0
  302. package/dist/dashboard/web/workflow-version-switch.js +9 -0
  303. package/dist/dashboard/web/workflow-version-switch.js.map +1 -0
  304. package/dist/dashboard/web/workflows.d.ts +272 -1
  305. package/dist/dashboard/web/workflows.d.ts.map +1 -1
  306. package/dist/dashboard/web/workflows.js +211 -1397
  307. package/dist/dashboard/web/workflows.js.map +1 -1
  308. package/dist/dashboard/webhook-routes.d.ts.map +1 -1
  309. package/dist/dashboard/webhook-routes.js +92 -39
  310. package/dist/dashboard/webhook-routes.js.map +1 -1
  311. package/dist/dashboard-web/app.js +1 -65
  312. package/dist/dashboard-web/brand-logo.png +0 -0
  313. package/dist/dashboard-web/chunks/bot-defaults-page-HSQ6HR3R.js +1 -0
  314. package/dist/dashboard-web/chunks/chunk-6TPODDDC.js +1 -0
  315. package/dist/dashboard-web/chunks/chunk-73EJP2MO.js +1 -0
  316. package/dist/dashboard-web/chunks/chunk-BRTZFELS.js +1 -0
  317. package/dist/dashboard-web/chunks/chunk-EVK77ASG.js +1 -0
  318. package/dist/dashboard-web/chunks/chunk-R3FXBFQH.js +1 -0
  319. package/dist/dashboard-web/chunks/chunk-VRLL7SNU.js +1 -0
  320. package/dist/dashboard-web/chunks/chunk-XCPSHD3G.js +37 -0
  321. package/dist/dashboard-web/chunks/chunk-XJ7BGPJH.js +1 -0
  322. package/dist/dashboard-web/chunks/chunk-YVRWYGXR.js +1 -0
  323. package/dist/dashboard-web/chunks/chunk-ZJING6FY.js +66 -0
  324. package/dist/dashboard-web/chunks/connectors-page-ODUA5UCW.js +1 -0
  325. package/dist/dashboard-web/chunks/groups-page-OYX5M6NK.js +8 -0
  326. package/dist/dashboard-web/chunks/insights-page-YCQO6OCR.js +22 -0
  327. package/dist/dashboard-web/chunks/legacy-workflow-page-XJAUNONP.js +2 -0
  328. package/dist/dashboard-web/chunks/{monitor-room-RFX4HPS5.js → monitor-room-WTZNYAFV.js} +17 -15
  329. package/dist/dashboard-web/chunks/monitoring-page-R6LJUK7G.js +2 -0
  330. package/dist/dashboard-web/chunks/office-page-4OXK3GNR.js +1 -0
  331. package/dist/dashboard-web/chunks/overview-page-4MVEJY6U.js +1 -0
  332. package/dist/dashboard-web/chunks/roles-page-NQDW27VV.js +1 -0
  333. package/dist/dashboard-web/chunks/schedules-page-JRNKYHOX.js +1 -0
  334. package/dist/dashboard-web/chunks/sessions-page-LF7UVI7B.js +3 -0
  335. package/dist/dashboard-web/chunks/settings-page-WGW7KQQS.js +2 -0
  336. package/dist/dashboard-web/chunks/skills-page-AMD4XP3T.js +3 -0
  337. package/dist/dashboard-web/chunks/team-federation-page-SYG3K4GG.js +1 -0
  338. package/dist/dashboard-web/chunks/v3-page-6NFFWNUK.js +94 -0
  339. package/dist/dashboard-web/chunks/whiteboards-page-FBRUK2AS.js +1 -0
  340. package/dist/dashboard-web/favicon.png +0 -0
  341. package/dist/dashboard-web/index.html +5 -69
  342. package/dist/dashboard-web/style.css +18835 -7211
  343. package/dist/dashboard.js +150 -32
  344. package/dist/dashboard.js.map +1 -1
  345. package/dist/global-config.d.ts +2 -2
  346. package/dist/global-config.d.ts.map +1 -1
  347. package/dist/i18n/en.d.ts.map +1 -1
  348. package/dist/i18n/en.js +3 -0
  349. package/dist/i18n/en.js.map +1 -1
  350. package/dist/i18n/zh.d.ts.map +1 -1
  351. package/dist/i18n/zh.js +3 -0
  352. package/dist/i18n/zh.js.map +1 -1
  353. package/dist/im/lark/card-builder.d.ts +7 -5
  354. package/dist/im/lark/card-builder.d.ts.map +1 -1
  355. package/dist/im/lark/card-builder.js +10 -7
  356. package/dist/im/lark/card-builder.js.map +1 -1
  357. package/dist/im/lark/card-handler.d.ts.map +1 -1
  358. package/dist/im/lark/card-handler.js +25 -1
  359. package/dist/im/lark/card-handler.js.map +1 -1
  360. package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
  361. package/dist/im/lark/event-dispatcher.js +84 -0
  362. package/dist/im/lark/event-dispatcher.js.map +1 -1
  363. package/dist/platform/binding.d.ts +9 -0
  364. package/dist/platform/binding.d.ts.map +1 -1
  365. package/dist/platform/binding.js +14 -0
  366. package/dist/platform/binding.js.map +1 -1
  367. package/dist/platform/tunnel-client.d.ts.map +1 -1
  368. package/dist/platform/tunnel-client.js +9 -0
  369. package/dist/platform/tunnel-client.js.map +1 -1
  370. package/dist/services/bot-config-store.d.ts +1 -1
  371. package/dist/services/bot-config-store.d.ts.map +1 -1
  372. package/dist/services/bot-config-store.js +11 -5
  373. package/dist/services/bot-config-store.js.map +1 -1
  374. package/dist/services/file-bridge-path.d.ts +8 -0
  375. package/dist/services/file-bridge-path.d.ts.map +1 -0
  376. package/dist/services/file-bridge-path.js +75 -0
  377. package/dist/services/file-bridge-path.js.map +1 -0
  378. package/dist/services/grok-paths.d.ts +27 -0
  379. package/dist/services/grok-paths.d.ts.map +1 -0
  380. package/dist/services/grok-paths.js +106 -0
  381. package/dist/services/grok-paths.js.map +1 -0
  382. package/dist/services/grok-transcript.d.ts +67 -0
  383. package/dist/services/grok-transcript.d.ts.map +1 -0
  384. package/dist/services/grok-transcript.js +630 -0
  385. package/dist/services/grok-transcript.js.map +1 -0
  386. package/dist/services/hermes-session-filter.d.ts +28 -0
  387. package/dist/services/hermes-session-filter.d.ts.map +1 -0
  388. package/dist/services/hermes-session-filter.js +53 -0
  389. package/dist/services/hermes-session-filter.js.map +1 -0
  390. package/dist/services/hermes-transcript.d.ts +3 -0
  391. package/dist/services/hermes-transcript.d.ts.map +1 -1
  392. package/dist/services/hermes-transcript.js +20 -2
  393. package/dist/services/hermes-transcript.js.map +1 -1
  394. package/dist/services/resumable-session-discovery.d.ts +3 -0
  395. package/dist/services/resumable-session-discovery.d.ts.map +1 -1
  396. package/dist/services/resumable-session-discovery.js +6 -1
  397. package/dist/services/resumable-session-discovery.js.map +1 -1
  398. package/dist/services/skill-registry-store.d.ts +9 -0
  399. package/dist/services/skill-registry-store.d.ts.map +1 -1
  400. package/dist/services/skill-registry-store.js +304 -1
  401. package/dist/services/skill-registry-store.js.map +1 -1
  402. package/dist/services/structured-bridge-clis.d.ts +29 -0
  403. package/dist/services/structured-bridge-clis.d.ts.map +1 -0
  404. package/dist/services/structured-bridge-clis.js +76 -0
  405. package/dist/services/structured-bridge-clis.js.map +1 -0
  406. package/dist/services/trigger-log-store.d.ts +59 -0
  407. package/dist/services/trigger-log-store.d.ts.map +1 -1
  408. package/dist/services/trigger-log-store.js +81 -10
  409. package/dist/services/trigger-log-store.js.map +1 -1
  410. package/dist/services/usage-ledger.d.ts +4 -1
  411. package/dist/services/usage-ledger.d.ts.map +1 -1
  412. package/dist/services/usage-ledger.js +48 -10
  413. package/dist/services/usage-ledger.js.map +1 -1
  414. package/dist/services/webhook-audit.d.ts +10 -0
  415. package/dist/services/webhook-audit.d.ts.map +1 -0
  416. package/dist/services/webhook-audit.js +116 -0
  417. package/dist/services/webhook-audit.js.map +1 -0
  418. package/dist/setup/bot-config-editor.d.ts.map +1 -1
  419. package/dist/setup/bot-config-editor.js +2 -0
  420. package/dist/setup/bot-config-editor.js.map +1 -1
  421. package/dist/setup/ensure-tmux.d.ts +26 -12
  422. package/dist/setup/ensure-tmux.d.ts.map +1 -1
  423. package/dist/setup/ensure-tmux.js +85 -18
  424. package/dist/setup/ensure-tmux.js.map +1 -1
  425. package/dist/skills/definitions.d.ts.map +1 -1
  426. package/dist/skills/definitions.js +14 -1
  427. package/dist/skills/definitions.js.map +1 -1
  428. package/dist/skills/injection-mode.d.ts +16 -0
  429. package/dist/skills/injection-mode.d.ts.map +1 -1
  430. package/dist/skills/injection-mode.js +25 -0
  431. package/dist/skills/injection-mode.js.map +1 -1
  432. package/dist/types.d.ts +9 -0
  433. package/dist/types.d.ts.map +1 -1
  434. package/dist/utils/global-install.d.ts +22 -0
  435. package/dist/utils/global-install.d.ts.map +1 -0
  436. package/dist/utils/global-install.js +106 -0
  437. package/dist/utils/global-install.js.map +1 -0
  438. package/dist/utils/install-diagnostics.d.ts +1 -1
  439. package/dist/utils/install-diagnostics.d.ts.map +1 -1
  440. package/dist/utils/install-diagnostics.js +6 -4
  441. package/dist/utils/install-diagnostics.js.map +1 -1
  442. package/dist/utils/install-info.d.ts +2 -0
  443. package/dist/utils/install-info.d.ts.map +1 -1
  444. package/dist/utils/install-info.js +10 -4
  445. package/dist/utils/install-info.js.map +1 -1
  446. package/dist/worker.js +293 -172
  447. package/dist/worker.js.map +1 -1
  448. package/dist/workflows/events/payloads.d.ts +10 -10
  449. package/dist/workflows/events/schema.d.ts +28 -28
  450. package/package.json +8 -7
  451. package/dist/dashboard/web/connectors.d.ts +0 -2
  452. package/dist/dashboard/web/connectors.d.ts.map +0 -1
  453. package/dist/dashboard/web/connectors.js +0 -2
  454. package/dist/dashboard/web/connectors.js.map +0 -1
  455. package/dist/dashboard/web/office.d.ts +0 -2
  456. package/dist/dashboard/web/office.d.ts.map +0 -1
  457. package/dist/dashboard/web/office.js +0 -2
  458. package/dist/dashboard/web/office.js.map +0 -1
  459. package/dist/dashboard/web/schedules.d.ts +0 -2
  460. package/dist/dashboard/web/schedules.d.ts.map +0 -1
  461. package/dist/dashboard/web/schedules.js +0 -2
  462. package/dist/dashboard/web/schedules.js.map +0 -1
  463. package/dist/dashboard/web/settings.d.ts +0 -2
  464. package/dist/dashboard/web/settings.d.ts.map +0 -1
  465. package/dist/dashboard/web/settings.js +0 -2
  466. package/dist/dashboard/web/settings.js.map +0 -1
  467. package/dist/dashboard/web/skills.d.ts +0 -2
  468. package/dist/dashboard/web/skills.d.ts.map +0 -1
  469. package/dist/dashboard/web/skills.js +0 -2
  470. package/dist/dashboard/web/skills.js.map +0 -1
  471. package/dist/dashboard/web/skin-intro.d.ts +0 -4
  472. package/dist/dashboard/web/skin-intro.d.ts.map +0 -1
  473. package/dist/dashboard/web/skin-intro.js +0 -49
  474. package/dist/dashboard/web/skin-intro.js.map +0 -1
  475. package/dist/dashboard/web/v3.d.ts +0 -3
  476. package/dist/dashboard/web/v3.d.ts.map +0 -1
  477. package/dist/dashboard/web/v3.js +0 -539
  478. package/dist/dashboard/web/v3.js.map +0 -1
  479. package/dist/dashboard/web/whiteboards.d.ts +0 -2
  480. package/dist/dashboard/web/whiteboards.d.ts.map +0 -1
  481. package/dist/dashboard/web/whiteboards.js +0 -2
  482. package/dist/dashboard/web/whiteboards.js.map +0 -1
  483. package/dist/dashboard-web/chunks/bot-defaults-page-OCIHPGEU.js +0 -438
  484. package/dist/dashboard-web/chunks/chunk-3N2PPQVD.js +0 -1
  485. package/dist/dashboard-web/chunks/chunk-3UJYRR2Q.js +0 -37
  486. package/dist/dashboard-web/chunks/chunk-5E3MJJL4.js +0 -1
  487. package/dist/dashboard-web/chunks/chunk-7SZRL6FY.js +0 -1
  488. package/dist/dashboard-web/chunks/chunk-JTSE5VP6.js +0 -54
  489. package/dist/dashboard-web/chunks/chunk-LXIK7OUJ.js +0 -1
  490. package/dist/dashboard-web/chunks/chunk-PE6W3C2C.js +0 -1
  491. package/dist/dashboard-web/chunks/chunk-QW54DWU3.js +0 -325
  492. package/dist/dashboard-web/chunks/connectors-IGETYWCP.js +0 -1
  493. package/dist/dashboard-web/chunks/groups-page-MYBS4ZYJ.js +0 -207
  494. package/dist/dashboard-web/chunks/insights-page-UPA32V2S.js +0 -309
  495. package/dist/dashboard-web/chunks/monitoring-page-7T3BESZ2.js +0 -1
  496. package/dist/dashboard-web/chunks/office-page-6DXYOG55.js +0 -1
  497. package/dist/dashboard-web/chunks/overview-page-LJSBCQW4.js +0 -1
  498. package/dist/dashboard-web/chunks/roles-page-ESURTVQH.js +0 -98
  499. package/dist/dashboard-web/chunks/schedules-LML2ISOT.js +0 -1
  500. package/dist/dashboard-web/chunks/sessions-YB73XOTU.js +0 -1
  501. package/dist/dashboard-web/chunks/sessions-page-MCO5QR7Z.js +0 -1
  502. package/dist/dashboard-web/chunks/settings-page-OSDKNVS3.js +0 -2
  503. package/dist/dashboard-web/chunks/skills-page-PXBZJ6P6.js +0 -2
  504. package/dist/dashboard-web/chunks/team-federation-page-TTPVHFPX.js +0 -10
  505. package/dist/dashboard-web/chunks/v3-page-FVPUL665.js +0 -149
  506. package/dist/dashboard-web/chunks/whiteboards-page-HLCTYSSV.js +0 -1
  507. package/dist/dashboard-web/chunks/workflows-FCPM4S4D.js +0 -184
  508. package/dist/dashboard-web/skins/bluearchive-hero.webp +0 -0
  509. package/dist/dashboard-web/skins/dragonball-goku.webp +0 -0
  510. package/dist/dashboard-web/skins/dragonball-wukong.webp +0 -0
  511. package/dist/dashboard-web/skins/genshin-breeze.webp +0 -0
  512. package/dist/dashboard-web/skins/ikun-hero.webp +0 -0
  513. package/dist/dashboard-web/skins/prts-priestess.webp +0 -0
  514. package/dist/dashboard-web/skins/zzz-hero.webp +0 -0
  515. package/dist/dashboard-web/skins/zzz-pattern.svg +0 -25
package/dist/cli.js CHANGED
@@ -43,10 +43,12 @@ import { logger } from './utils/logger.js';
43
43
  import { scheduleTimeZone } from './utils/timezone.js';
44
44
  import { expandHomePath, invalidWorkingDirs } from './utils/working-dir.js';
45
45
  import { firstPositional } from './cli/arg-utils.js';
46
- import { dispatchPrimaryMessage, findStdinAliasAttachment, sendFileAttachments, sendVideoAttachments, shouldSendAsPureVideo, validateVideoAttachments } from './cli/send-dispatch.js';
46
+ import { isColdResumeDormant, sessionListDisposition } from './cli/session-list-liveness.js';
47
+ import { dispatchPrimaryMessage, findStdinAliasAttachment, normalizeInteractiveCardInput, sendFileAttachments, sendVideoAttachments, shouldSendAsPureVideo, validateVideoAttachments } from './cli/send-dispatch.js';
47
48
  import { buildPm2SpawnCommand } from './cli/pm2-command.js';
48
49
  import { callDashboard } from './cli/dashboard-endpoint.js';
49
- import { npmGlobalUpdateCwd } from './core/maintenance.js';
50
+ import { installLatestBotmuxSync } from './core/maintenance.js';
51
+ import { formatGlobalInstallCommand, resolveGlobalInstallPlan, UnsupportedGlobalInstallError, } from './utils/global-install.js';
50
52
  import { loadDashboardSecret } from './dashboard/auth.js';
51
53
  import { rejectLikelyWindowsStdinMojibake, decodeStdinBytes } from './cli/stdin-encoding.js';
52
54
  import { formatBotInfoEntriesForCli, formatChatBotsForCli, } from './cli/bots-list-output.js';
@@ -2124,13 +2126,19 @@ function cmdStatus() {
2124
2126
  runPm2(['status']);
2125
2127
  }
2126
2128
  function cmdUpgrade() {
2127
- console.log('🔄 升级中...');
2128
2129
  try {
2129
- execSync('npm install -g botmux@latest', { cwd: npmGlobalUpdateCwd(), stdio: 'inherit' });
2130
+ const plan = resolveGlobalInstallPlan();
2131
+ console.log(`🔄 升级中:${formatGlobalInstallCommand(plan)}`);
2132
+ installLatestBotmuxSync(plan);
2130
2133
  console.log('\n✅ 升级完成。运行 botmux restart 以应用更新。');
2131
2134
  }
2132
- catch {
2133
- console.error('❌ 升级失败,请手动运行: npm install -g botmux@latest');
2135
+ catch (error) {
2136
+ if (error instanceof UnsupportedGlobalInstallError) {
2137
+ console.error(`❌ 无法安全识别当前安装方式(${error.manager}),请使用原包管理器手动更新 botmux。`);
2138
+ }
2139
+ else {
2140
+ console.error(`❌ 升级失败:${error instanceof Error ? error.message : error}`);
2141
+ }
2134
2142
  process.exit(1);
2135
2143
  }
2136
2144
  }
@@ -2568,6 +2576,8 @@ function sessionStatusLabel(s) {
2568
2576
  return isProcessAlive(pid) ? 'adopt' : 'stopped';
2569
2577
  return s.pid && isProcessAlive(s.pid) ? 'adopt' : 'idle';
2570
2578
  }
2579
+ if (isColdResumeDormant(s) && !(s.pid && isProcessAlive(s.pid)))
2580
+ return 'dormant';
2571
2581
  return s.pid && isProcessAlive(s.pid) ? 'online' : s.pid ? 'stopped' : 'idle';
2572
2582
  }
2573
2583
  function sessionTargetLabel(s, tmuxName, hasTmux) {
@@ -2842,13 +2852,13 @@ async function cmdList() {
2842
2852
  }
2843
2853
  const hasPid = !!(s.pid && isProcessAlive(s.pid));
2844
2854
  const hasTmux = tmuxSessionExists(`bmx-${s.sessionId.substring(0, 8)}`);
2845
- if (!hasPid && !hasTmux) {
2846
- const everReal = !!(s.cliId || s.lastCliInput || s.adoptedFrom);
2847
- (everReal ? pruned : prunedScratch).push(s);
2848
- }
2849
- else {
2855
+ const disposition = sessionListDisposition(s, { hasPid, hasBackingSession: hasTmux });
2856
+ if (disposition === 'prune_real')
2857
+ pruned.push(s);
2858
+ else if (disposition === 'prune_scratch')
2859
+ prunedScratch.push(s);
2860
+ else
2850
2861
  live.push(s);
2851
- }
2852
2862
  }
2853
2863
  const closeNow = (arr) => {
2854
2864
  for (const s of arr) {
@@ -3479,6 +3489,8 @@ botmux v${getVersion()} — IM ↔ AI 编程 CLI 桥接
3479
3489
  --files <path> 附件(可重复)
3480
3490
  --videos <path> 视频预览 MP4(可重复,需配套 --video-covers)
3481
3491
  --video-covers <path> 视频封面图片(可重复,按顺序对应 --videos)
3492
+ --card-file <path> 直接发送飞书/Lark interactive 卡片 JSON
3493
+ --card-json <json> 直接发送飞书/Lark interactive 卡片 JSON 字符串
3482
3494
  --mention <open_id:name> @提及(可重复)
3483
3495
  --mention-back @回本轮触发消息的发送者(open_id 自动取自会话)
3484
3496
  --no-mention 明确声明本条不@任何人
@@ -4257,6 +4269,25 @@ function argValues(args, ...flags) {
4257
4269
  }
4258
4270
  return out;
4259
4271
  }
4272
+ function withCustomCardMentionFooter(card, mentionOpenIds, sentToLabel) {
4273
+ if (mentionOpenIds.length === 0)
4274
+ return { ok: true, card };
4275
+ const cloned = JSON.parse(JSON.stringify(card));
4276
+ const body = cloned.body;
4277
+ if (!body || !Array.isArray(body.elements)) {
4278
+ return {
4279
+ ok: false,
4280
+ error: '自定义卡片带 --mention/--mention-back 时必须是 schema 2.0 且包含 body.elements;或改用 --no-mention 并在卡片 JSON 内自行处理展示',
4281
+ };
4282
+ }
4283
+ const deduped = [...new Set(mentionOpenIds.filter(Boolean))];
4284
+ body.elements.push({ tag: 'hr' }, {
4285
+ tag: 'markdown',
4286
+ text_size: 'notation_small_v2',
4287
+ content: `<font color='grey'>${sentToLabel}${deduped.map(id => `<at id=${id}></at>`).join(' ')}</font>`,
4288
+ });
4289
+ return { ok: true, card: cloned };
4290
+ }
4260
4291
  // Card v2 body builder helpers — extracted to im/lark/md-card.ts so the
4261
4292
  // daemon's bridge fallback path can produce identical cards. cmdSend
4262
4293
  // keeps using `buildImageCardElements` from there.
@@ -4279,13 +4310,38 @@ async function relaySend(rest, relayDir) {
4279
4310
  console.error('relay: 无法确定 session-id');
4280
4311
  process.exit(1);
4281
4312
  }
4313
+ const cardJsonArg = argValue(rest, '--card-json');
4314
+ const cardFile = argValue(rest, '--card-file');
4315
+ let cardContent = '';
4316
+ if (cardJsonArg !== undefined && cardFile !== undefined) {
4317
+ console.error('relay: --card-json 与 --card-file 不能同时使用');
4318
+ process.exit(2);
4319
+ }
4320
+ if (cardJsonArg !== undefined) {
4321
+ cardContent = cardJsonArg;
4322
+ }
4323
+ else if (cardFile !== undefined) {
4324
+ if (!existsSync(cardFile)) {
4325
+ console.error(`relay: 文件不存在: ${cardFile}`);
4326
+ process.exit(1);
4327
+ }
4328
+ cardContent = readFileSync(cardFile, 'utf-8');
4329
+ }
4282
4330
  // Resolve content with the same precedence as cmdSend (content-file > positional > stdin)
4283
4331
  const contentFile = argValue(rest, '--content-file');
4284
4332
  let content = '';
4285
- if (contentFile) {
4333
+ if (cardJsonArg !== undefined || cardFile !== undefined) {
4334
+ content = '';
4335
+ }
4336
+ else if (contentFile) {
4286
4337
  content = existsSync(contentFile) ? readFileSync(contentFile, 'utf-8') : '';
4287
4338
  }
4288
4339
  else {
4340
+ // NOTE: `--attention` is deliberately NOT excluded here. The relay flag
4341
+ // allowlist (below) doesn't forward it, so sandbox `--attention` can't raise
4342
+ // the dashboard hand anyway; excluding it would silently send the reason as a
4343
+ // bare message instead of the original loud "no content" failure. Plumbing
4344
+ // `--attention` through the relay is a separate change, out of this scope.
4289
4345
  const pos = positionals(rest, ['--card', '--text', '--top-level', '--no-quote', '--mention-back', '--no-mention', '--anyway', '--voice']);
4290
4346
  content = pos.length > 0 ? pos.join(' ') : await readStdin();
4291
4347
  }
@@ -4299,6 +4355,13 @@ async function relaySend(rest, relayDir) {
4299
4355
  const contentBase = `${id}.content`;
4300
4356
  const cfile = join(relayDir, contentBase);
4301
4357
  writeFileSync(cfile, content);
4358
+ let cardBase;
4359
+ let cardOutfile;
4360
+ if (cardJsonArg !== undefined || cardFile !== undefined) {
4361
+ cardBase = `${id}.card.json`;
4362
+ cardOutfile = join(relayDir, cardBase);
4363
+ writeFileSync(cardOutfile, cardContent);
4364
+ }
4302
4365
  // Copy attachments into the outbox; carry only basenames.
4303
4366
  const copyOutboxAttachment = (p, out) => {
4304
4367
  if (!p || !existsSync(p))
@@ -4338,7 +4401,7 @@ async function relaySend(rest, relayDir) {
4338
4401
  }
4339
4402
  // 原子写:req.json 是 host watcher 的触发文件,rename 让它「完整出现」,
4340
4403
  // watcher 永远不会读到半截 JSON(tmp 后缀不匹配 .req.json 过滤)。
4341
- atomicWriteFileSync(join(relayDir, `${id}.req.json`), JSON.stringify({ contentFile: contentBase, attachments, videos, videoCovers, flags }));
4404
+ atomicWriteFileSync(join(relayDir, `${id}.req.json`), JSON.stringify({ contentFile: contentBase, cardFile: cardBase, attachments, videos, videoCovers, flags }));
4342
4405
  const resPath = join(relayDir, `${id}.res.json`);
4343
4406
  const deadlineMs = Date.now() + 120_000;
4344
4407
  while (Date.now() < deadlineMs) {
@@ -4353,6 +4416,12 @@ async function relaySend(rest, relayDir) {
4353
4416
  unlinkSync(cfile);
4354
4417
  }
4355
4418
  catch { /* */ }
4419
+ if (cardOutfile) {
4420
+ try {
4421
+ unlinkSync(cardOutfile);
4422
+ }
4423
+ catch { /* */ }
4424
+ }
4356
4425
  if (res.stdout)
4357
4426
  process.stdout.write(res.stdout);
4358
4427
  if (res.stderr)
@@ -4429,10 +4498,29 @@ async function cmdSend(rest) {
4429
4498
  process.exit(2);
4430
4499
  }
4431
4500
  }
4501
+ if (flagPresentButValueMissing(rest, '--card-file', true)) {
4502
+ console.error('botmux send: --card-file 需要路径参数');
4503
+ process.exit(2);
4504
+ }
4505
+ if (flagPresentButValueMissing(rest, '--card-json', true)) {
4506
+ console.error('botmux send: --card-json 需要 JSON 字符串参数');
4507
+ process.exit(2);
4508
+ }
4509
+ const cardJsonArg = argValue(rest, '--card-json');
4510
+ const cardFile = argValue(rest, '--card-file');
4511
+ const customCardRequested = cardJsonArg !== undefined || cardFile !== undefined;
4512
+ if (cardJsonArg !== undefined && cardFile !== undefined) {
4513
+ console.error('botmux send: --card-json 与 --card-file 不能同时使用');
4514
+ process.exit(2);
4515
+ }
4432
4516
  const images = argValues(rest, '--image', '--images');
4433
4517
  const files = argValues(rest, '--file', '--files');
4434
4518
  const videos = argValues(rest, '--video', '--videos');
4435
4519
  const videoCovers = argValues(rest, '--video-cover', '--video-covers');
4520
+ if (customCardRequested && (images.length > 0 || files.length > 0 || videos.length > 0 || videoCovers.length > 0)) {
4521
+ console.error('botmux send: --card-file/--card-json 暂不与 --images/--files/--videos 混用;请把素材先上传为飞书资源并写入卡片 JSON');
4522
+ process.exit(2);
4523
+ }
4436
4524
  const videoValidation = validateVideoAttachments(videos, videoCovers);
4437
4525
  if (!videoValidation.ok) {
4438
4526
  console.error(`botmux send: ${videoValidation.error}`);
@@ -4452,6 +4540,10 @@ async function cmdSend(rest) {
4452
4540
  }
4453
4541
  const mentionArgs = argValues(rest, '--mention'); // "open_id:Display Name"
4454
4542
  const contentFile = argValue(rest, '--content-file');
4543
+ if (customCardRequested && contentFile) {
4544
+ console.error('botmux send: --card-file/--card-json 不能与 --content-file 混用');
4545
+ process.exit(2);
4546
+ }
4455
4547
  // 回复一律走交互卡片。`--card` / `--text` 是隐藏的旧脚本兼容 no-op:纯文本
4456
4548
  // post 路径已删除,只有卡片能承载「🔊 语音总结」按钮,且守护进程兜底也一直只发卡片。
4457
4549
  // Publish-mode flags: post a fresh top-level message in a chat instead of
@@ -4479,6 +4571,10 @@ async function cmdSend(rest) {
4479
4571
  // needs-you column for this session. Parsed specially (not argValue) so a bare
4480
4572
  // `--attention "我卡住了"` doesn't eat the message as the flag value.
4481
4573
  const attention = parseAttentionFlag(rest);
4574
+ if (customCardRequested && asVoice) {
4575
+ console.error('botmux send: --card-file/--card-json 不能与 --voice 混用');
4576
+ process.exit(2);
4577
+ }
4482
4578
  const ancestorCtx = findAncestorSessionContext();
4483
4579
  const sid = sessionIdArg ?? ancestorCtx?.sessionId ?? null;
4484
4580
  if (!sid) {
@@ -4498,7 +4594,29 @@ async function cmdSend(rest) {
4498
4594
  }
4499
4595
  // Read content from: --content-file > positional arg > stdin
4500
4596
  let content = '';
4501
- if (contentFile) {
4597
+ let customCard;
4598
+ if (customCardRequested) {
4599
+ const unexpectedText = positionals(rest, ['--card', '--text', '--top-level', '--no-quote', '--mention-back', '--no-mention', '--anyway', '--voice', '--attention']);
4600
+ if (unexpectedText.length > 0) {
4601
+ console.error('botmux send: --card-file/--card-json 发送自定义卡片时不接受正文参数;卡片内容请写入 JSON');
4602
+ process.exit(2);
4603
+ }
4604
+ let rawCard = cardJsonArg ?? '';
4605
+ if (cardFile !== undefined) {
4606
+ if (!existsSync(cardFile)) {
4607
+ console.error(`文件不存在: ${cardFile}`);
4608
+ process.exit(1);
4609
+ }
4610
+ rawCard = readFileSync(cardFile, 'utf-8');
4611
+ }
4612
+ const normalizedCard = normalizeInteractiveCardInput(rawCard);
4613
+ if (!normalizedCard.ok) {
4614
+ console.error(`botmux send: ${normalizedCard.error}`);
4615
+ process.exit(2);
4616
+ }
4617
+ customCard = normalizedCard.card;
4618
+ }
4619
+ else if (contentFile) {
4502
4620
  if (!existsSync(contentFile)) {
4503
4621
  console.error(`文件不存在: ${contentFile}`);
4504
4622
  process.exit(1);
@@ -4514,9 +4632,9 @@ async function cmdSend(rest) {
4514
4632
  content = await readStdin();
4515
4633
  }
4516
4634
  }
4517
- if (!contentFile)
4635
+ if (!contentFile && !customCardRequested)
4518
4636
  rejectLikelyWindowsStdinMojibake(content);
4519
- if (!content.trim() && images.length === 0 && files.length === 0 && videoAttachments.length === 0) {
4637
+ if (!customCard && !content.trim() && images.length === 0 && files.length === 0 && videoAttachments.length === 0) {
4520
4638
  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 "视频预览"');
4521
4639
  process.exit(1);
4522
4640
  }
@@ -4607,6 +4725,10 @@ async function cmdSend(rest) {
4607
4725
  // (之前 currentTurnId 取自 cliPidMarker,文档轮里取值不稳导致误判落到 @ 硬门)。
4608
4726
  const docTarget = s.currentDocCommentTarget;
4609
4727
  if (docTarget && !sendTopLevel && !overrideChatId && !sendInto) {
4728
+ if (customCardRequested) {
4729
+ console.error('botmux send: 文档评论回复不支持 --card-file/--card-json;请改用普通文本,或显式 --top-level/--chat-id 发到飞书群');
4730
+ process.exit(2);
4731
+ }
4610
4732
  const { registerBot, loadBotConfigs } = await import('./bot-registry.js');
4611
4733
  try {
4612
4734
  for (const cfg of loadBotConfigs())
@@ -4942,6 +5064,20 @@ async function cmdSend(rest) {
4942
5064
  hasExplicitBotMention: explicitKnownBotMention,
4943
5065
  knownBotOpenIds,
4944
5066
  });
5067
+ if (customCard) {
5068
+ const mentionFooter = orderedFooterRecipients({
5069
+ sendTo: footerAddressing.sendTo,
5070
+ mentionIds: mentions.map(m => m.open_id),
5071
+ cc: footerAddressing.cc,
5072
+ inlinedIds: [],
5073
+ });
5074
+ const withFooter = withCustomCardMentionFooter(customCard, mentionFooter, t('card.sent_to', undefined, localeForBot(appId)));
5075
+ if (!withFooter.ok) {
5076
+ console.error(`botmux send: ${withFooter.error}`);
5077
+ process.exit(2);
5078
+ }
5079
+ customCard = withFooter.card;
5080
+ }
4945
5081
  // Capture sentAtMs BEFORE dispatch — the worker's bridge fallback gates
4946
5082
  // on `sentAtMs ∈ [turn.markTimeMs, nextTurn.markTimeMs)`. If we recorded
4947
5083
  // it after dispatch (which can take seconds), a slow Lark RTT could push
@@ -4952,20 +5088,25 @@ async function cmdSend(rest) {
4952
5088
  let messageId;
4953
5089
  let failedAttachments = [];
4954
5090
  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) {
5091
+ const pureVideoSend = customCard
5092
+ ? false
5093
+ : shouldSendAsPureVideo({
5094
+ hasBodyText: !!text.trim(),
5095
+ imageCount: imageKeys.length,
5096
+ fileCount: files.length,
5097
+ videoCount: videoAttachments.length,
5098
+ mentionCount: mentions.length,
5099
+ });
5100
+ if (customCard) {
5101
+ messageId = await dispatchPrimary(JSON.stringify(customCard), 'interactive');
5102
+ }
5103
+ else if (pureVideoSend) {
5104
+ // Pure-video fast path: send the preview as a standalone media message.
5105
+ // A send that also carries mentions is deliberately excluded (media messages
5106
+ // can't embed `<at>`), so it falls through to the card branch which renders
5107
+ // the @ on the footer and sends the video as a follow-up attachment — same
5108
+ // shape as an attachment-only `--files … --mention …` send, whose card body
5109
+ // is likewise empty. See shouldSendAsPureVideo.
4969
5110
  // No card/text primary here, so the FIRST media message must carry the
4970
5111
  // quote chain itself (dispatchPrimary applies the chat-scope quoteTargetId
4971
5112
  // and updates primaryQuotedId). Otherwise a bare `--videos … --no-mention`
@@ -5734,7 +5875,7 @@ async function cmdAsk(sub, rest) {
5734
5875
  process.exit(2);
5735
5876
  }
5736
5877
  const { findMissingAskEnv, parseAskOptions, parseAskTimeoutSeconds, AskArgsError } = await import('./core/ask-args.js');
5737
- const { toLegacySelected } = await import('./core/ask-types.js');
5878
+ const { toLegacySelected, isCustomReply } = await import('./core/ask-types.js');
5738
5879
  const missing = findMissingAskEnv(process.env);
5739
5880
  if (missing) {
5740
5881
  console.error(`botmux ask: 缺少必需环境变量 ${missing}。` +
@@ -5795,7 +5936,15 @@ async function cmdAsk(sub, rest) {
5795
5936
  process.stdout.write(JSON.stringify(out) + '\n');
5796
5937
  }
5797
5938
  else if (result.kind === 'answered') {
5798
- // 非 JSON 模式:输出 selected key(单问单选),多选/多问输出空字符串
5939
+ // 非 JSON 模式:输出 selected key(单问单选),多选/多问输出空字符串。
5940
+ //
5941
+ // 用户以文字作答时同样落到空字符串,与多选/多问的降级值无法区分,且 exit 0
5942
+ // ——调用方会静默走进空分支。comment 可能含换行,塞进「一行一个 key」的
5943
+ // stdout 契约并不安全,因此 stdout 保持不变,改由 stderr 指明答案去向。
5944
+ if (isCustomReply(result)) {
5945
+ console.error('botmux ask: 用户以文字作答,未点选任何选项;stdout 留空(stdout 只承载 option key)。' +
5946
+ ' 用 `--json` 读 comment 字段取回原文。');
5947
+ }
5799
5948
  process.stdout.write((selected ?? '') + '\n');
5800
5949
  }
5801
5950
  switch (result.kind) {