botmux 3.11.0 → 3.12.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 (165) hide show
  1. package/dist/.runtime-build-id +1 -1
  2. package/dist/adapters/backend/riff-backend.d.ts.map +1 -1
  3. package/dist/adapters/backend/riff-backend.js +11 -2
  4. package/dist/adapters/backend/riff-backend.js.map +1 -1
  5. package/dist/adapters/cli/coco.js +3 -3
  6. package/dist/adapters/cli/coco.js.map +1 -1
  7. package/dist/adapters/cli/codex.js +2 -2
  8. package/dist/adapters/cli/codex.js.map +1 -1
  9. package/dist/cli/dashboard-command.d.ts +23 -0
  10. package/dist/cli/dashboard-command.d.ts.map +1 -0
  11. package/dist/cli/dashboard-command.js +61 -0
  12. package/dist/cli/dashboard-command.js.map +1 -0
  13. package/dist/cli/dashboard-endpoint.d.ts +3 -3
  14. package/dist/cli/dashboard-endpoint.d.ts.map +1 -1
  15. package/dist/cli/dashboard-endpoint.js +1 -1
  16. package/dist/cli.d.ts.map +1 -1
  17. package/dist/cli.js +36 -22
  18. package/dist/cli.js.map +1 -1
  19. package/dist/codex-rpc-engine.d.ts +33 -3
  20. package/dist/codex-rpc-engine.d.ts.map +1 -1
  21. package/dist/codex-rpc-engine.js +182 -20
  22. package/dist/codex-rpc-engine.js.map +1 -1
  23. package/dist/codex-rpc-lifecycle.d.ts +42 -7
  24. package/dist/codex-rpc-lifecycle.d.ts.map +1 -1
  25. package/dist/codex-rpc-lifecycle.js +73 -7
  26. package/dist/codex-rpc-lifecycle.js.map +1 -1
  27. package/dist/config.d.ts +1 -1
  28. package/dist/config.js +1 -1
  29. package/dist/core/command-handler.d.ts +3 -2
  30. package/dist/core/command-handler.d.ts.map +1 -1
  31. package/dist/core/command-handler.js +3 -2
  32. package/dist/core/command-handler.js.map +1 -1
  33. package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
  34. package/dist/core/dashboard-ipc-server.js +15 -10
  35. package/dist/core/dashboard-ipc-server.js.map +1 -1
  36. package/dist/core/dispatch.d.ts +9 -10
  37. package/dist/core/dispatch.d.ts.map +1 -1
  38. package/dist/core/dispatch.js +17 -10
  39. package/dist/core/dispatch.js.map +1 -1
  40. package/dist/core/role-resolver.d.ts +5 -2
  41. package/dist/core/role-resolver.d.ts.map +1 -1
  42. package/dist/core/role-resolver.js +55 -23
  43. package/dist/core/role-resolver.js.map +1 -1
  44. package/dist/core/session-manager.d.ts +2 -0
  45. package/dist/core/session-manager.d.ts.map +1 -1
  46. package/dist/core/session-manager.js +20 -18
  47. package/dist/core/session-manager.js.map +1 -1
  48. package/dist/core/terminal-write-auth.d.ts +4 -4
  49. package/dist/core/terminal-write-auth.d.ts.map +1 -1
  50. package/dist/core/terminal-write-auth.js +18 -6
  51. package/dist/core/terminal-write-auth.js.map +1 -1
  52. package/dist/daemon.d.ts +1 -0
  53. package/dist/daemon.d.ts.map +1 -1
  54. package/dist/daemon.js +101 -12
  55. package/dist/daemon.js.map +1 -1
  56. package/dist/dashboard/auth.d.ts +21 -11
  57. package/dist/dashboard/auth.d.ts.map +1 -1
  58. package/dist/dashboard/auth.js +39 -25
  59. package/dist/dashboard/auth.js.map +1 -1
  60. package/dist/dashboard/bot-payload.d.ts +0 -1
  61. package/dist/dashboard/bot-payload.d.ts.map +1 -1
  62. package/dist/dashboard/bot-payload.js +0 -1
  63. package/dist/dashboard/bot-payload.js.map +1 -1
  64. package/dist/dashboard/dashboard-summary-endpoint.d.ts +39 -0
  65. package/dist/dashboard/dashboard-summary-endpoint.d.ts.map +1 -0
  66. package/dist/dashboard/dashboard-summary-endpoint.js +50 -0
  67. package/dist/dashboard/dashboard-summary-endpoint.js.map +1 -0
  68. package/dist/dashboard/dashboard-summary.d.ts +62 -0
  69. package/dist/dashboard/dashboard-summary.d.ts.map +1 -0
  70. package/dist/dashboard/dashboard-summary.js +106 -0
  71. package/dist/dashboard/dashboard-summary.js.map +1 -0
  72. package/dist/dashboard/web/feed-group-picker.d.ts +13 -0
  73. package/dist/dashboard/web/feed-group-picker.d.ts.map +1 -0
  74. package/dist/dashboard/web/feed-group-picker.js +45 -0
  75. package/dist/dashboard/web/feed-group-picker.js.map +1 -0
  76. package/dist/dashboard/web/groups-page.d.ts.map +1 -1
  77. package/dist/dashboard/web/groups-page.js +2 -5
  78. package/dist/dashboard/web/groups-page.js.map +1 -1
  79. package/dist/dashboard/web/i18n.d.ts.map +1 -1
  80. package/dist/dashboard/web/i18n.js +8 -14
  81. package/dist/dashboard/web/i18n.js.map +1 -1
  82. package/dist/dashboard/web/roles-page.d.ts.map +1 -1
  83. package/dist/dashboard/web/roles-page.js +36 -4
  84. package/dist/dashboard/web/roles-page.js.map +1 -1
  85. package/dist/dashboard/web/roles.d.ts +3 -1
  86. package/dist/dashboard/web/roles.d.ts.map +1 -1
  87. package/dist/dashboard/web/roles.js +10 -2
  88. package/dist/dashboard/web/roles.js.map +1 -1
  89. package/dist/dashboard/web/schedules-page.d.ts.map +1 -1
  90. package/dist/dashboard/web/schedules-page.js +8 -2
  91. package/dist/dashboard/web/schedules-page.js.map +1 -1
  92. package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
  93. package/dist/dashboard/web/sessions-page.js +2 -2
  94. package/dist/dashboard/web/sessions-page.js.map +1 -1
  95. package/dist/dashboard-web/app.js +1 -1
  96. package/dist/dashboard-web/chunks/{bot-defaults-page-GED4FEMS.js → bot-defaults-page-USC6EZXP.js} +1 -1
  97. package/dist/dashboard-web/chunks/chunk-6ALR252E.js +1 -0
  98. package/dist/dashboard-web/chunks/{chunk-VBXJOJFH.js → chunk-A7VC4BXR.js} +1 -1
  99. package/dist/dashboard-web/chunks/{chunk-HK7NIBJG.js → chunk-KOPISPHN.js} +1 -1
  100. package/dist/dashboard-web/chunks/{chunk-6J5LS5AU.js → chunk-M6BHWQFO.js} +6 -6
  101. package/dist/dashboard-web/chunks/{chunk-KRHWZEXU.js → chunk-RXRJB5SO.js} +1 -1
  102. package/dist/dashboard-web/chunks/{connectors-page-EELM66G3.js → connectors-page-4Z76HWRH.js} +1 -1
  103. package/dist/dashboard-web/chunks/groups-page-C6NSDTIN.js +8 -0
  104. package/dist/dashboard-web/chunks/{insights-page-54UBPPOC.js → insights-page-UTOVYLLY.js} +1 -1
  105. package/dist/dashboard-web/chunks/{monitor-room-PORHVKRH.js → monitor-room-UKTJYTA2.js} +1 -1
  106. package/dist/dashboard-web/chunks/{monitoring-page-XGA7AXNL.js → monitoring-page-Q3CEZIVX.js} +1 -1
  107. package/dist/dashboard-web/chunks/{office-page-AO3AFG45.js → office-page-GYCZOOVJ.js} +1 -1
  108. package/dist/dashboard-web/chunks/{overview-page-F5BUTYR6.js → overview-page-W2VBJ6OH.js} +1 -1
  109. package/dist/dashboard-web/chunks/roles-page-U4SHER4K.js +1 -0
  110. package/dist/dashboard-web/chunks/schedules-page-TNPW3N3Q.js +1 -0
  111. package/dist/dashboard-web/chunks/{sessions-page-YFRPSTIL.js → sessions-page-YWWDDV57.js} +3 -3
  112. package/dist/dashboard-web/chunks/{settings-page-OJAZLZQT.js → settings-page-VKW5ZK5K.js} +1 -1
  113. package/dist/dashboard-web/chunks/{skills-page-EFZQPWV4.js → skills-page-ZCEDFGZZ.js} +1 -1
  114. package/dist/dashboard-web/chunks/{team-federation-page-ZJVAP7HW.js → team-federation-page-OMFGGBT2.js} +1 -1
  115. package/dist/dashboard-web/chunks/{v3-page-GYWTRGO2.js → v3-page-PLXWK4KO.js} +1 -1
  116. package/dist/dashboard-web/chunks/{whiteboards-page-MSDAG6P7.js → whiteboards-page-NJQOEO2P.js} +1 -1
  117. package/dist/dashboard-web/style.css +112 -0
  118. package/dist/dashboard.js +116 -31
  119. package/dist/dashboard.js.map +1 -1
  120. package/dist/desktop/main/ipc.js +1 -1
  121. package/dist/desktop/main/runtime-service.js +2 -2
  122. package/dist/desktop/main/runtime-service.js.map +1 -1
  123. package/dist/desktop/shared/types.d.ts +1 -1
  124. package/dist/i18n/en.d.ts.map +1 -1
  125. package/dist/i18n/en.js +3 -1
  126. package/dist/i18n/en.js.map +1 -1
  127. package/dist/i18n/zh.d.ts.map +1 -1
  128. package/dist/i18n/zh.js +3 -1
  129. package/dist/i18n/zh.js.map +1 -1
  130. package/dist/services/adopt-input-sequence.d.ts +52 -0
  131. package/dist/services/adopt-input-sequence.d.ts.map +1 -0
  132. package/dist/services/adopt-input-sequence.js +50 -0
  133. package/dist/services/adopt-input-sequence.js.map +1 -0
  134. package/dist/services/bridge-fallback-gate.d.ts.map +1 -1
  135. package/dist/services/bridge-fallback-gate.js +34 -11
  136. package/dist/services/bridge-fallback-gate.js.map +1 -1
  137. package/dist/services/codex-bridge-queue.d.ts +103 -7
  138. package/dist/services/codex-bridge-queue.d.ts.map +1 -1
  139. package/dist/services/codex-bridge-queue.js +291 -17
  140. package/dist/services/codex-bridge-queue.js.map +1 -1
  141. package/dist/services/codex-transcript.d.ts +4 -3
  142. package/dist/services/codex-transcript.d.ts.map +1 -1
  143. package/dist/services/codex-transcript.js.map +1 -1
  144. package/dist/services/structured-bridge-clis.d.ts +8 -1
  145. package/dist/services/structured-bridge-clis.d.ts.map +1 -1
  146. package/dist/services/structured-bridge-clis.js +13 -0
  147. package/dist/services/structured-bridge-clis.js.map +1 -1
  148. package/dist/services/submit-confirmation.d.ts +50 -0
  149. package/dist/services/submit-confirmation.d.ts.map +1 -1
  150. package/dist/services/submit-confirmation.js +82 -0
  151. package/dist/services/submit-confirmation.js.map +1 -1
  152. package/dist/utils/async-serial-queue.d.ts +9 -0
  153. package/dist/utils/async-serial-queue.d.ts.map +1 -0
  154. package/dist/utils/async-serial-queue.js +13 -0
  155. package/dist/utils/async-serial-queue.js.map +1 -0
  156. package/dist/utils/runtime-screen-status.d.ts +52 -0
  157. package/dist/utils/runtime-screen-status.d.ts.map +1 -0
  158. package/dist/utils/runtime-screen-status.js +60 -0
  159. package/dist/utils/runtime-screen-status.js.map +1 -0
  160. package/dist/worker.js +1642 -452
  161. package/dist/worker.js.map +1 -1
  162. package/package.json +1 -1
  163. package/dist/dashboard-web/chunks/groups-page-WKUV6E42.js +0 -8
  164. package/dist/dashboard-web/chunks/roles-page-M5GIASJU.js +0 -1
  165. package/dist/dashboard-web/chunks/schedules-page-O232WQRR.js +0 -1
package/dist/cli.js CHANGED
@@ -37,7 +37,7 @@ import { validateWorkingDir } from './core/working-dir.js';
37
37
  import { findAncestorSessionContext as findLiveAncestorSessionContext, resolveSessionContext, } from './core/session-marker.js';
38
38
  import { resolveBotmuxDataDir } from './core/data-dir.js';
39
39
  import { dashboardSecretPath } from './core/dashboard-secret.js';
40
- import { acceptedDispatchBotAppIds, activeConversationBotOpenIds, appendDispatchReportProtocol, appendLegacyDispatchReportProtocol, parseDispatchBotSpec, buildDispatchMessages, buildRepoPrimeText, buildReportContent, eligibleAutoMentionAliases, findDispatchRegistryEntry, foldableChatSessionAppIds, offTopicSubBotTopic, resolveReportPlacement, resolveReportRecipient, resolveReportTarget, resolveSendTarget, threadRootForReachability } from './core/dispatch.js';
40
+ import { acceptedDispatchBotAppIds, activeConversationBotOpenIds, buildDispatchCompletionBrief, parseDispatchBotSpec, buildDispatchMessages, buildRepoPrimeText, buildReportContent, eligibleAutoMentionAliases, findDispatchRegistryEntry, foldableChatSessionAppIds, offTopicSubBotTopic, resolveReportPlacement, resolveReportRecipient, resolveReportTarget, resolveSendTarget, threadRootForReachability } from './core/dispatch.js';
41
41
  import { pickTurnReplyTarget, collectTurnWindowParticipants } from './core/reply-target.js';
42
42
  import { recordDispatchRegistryEntry } from './core/dispatch-registry.js';
43
43
  import { enableAutostart, disableAutostart, autostartStatus, refreshAutostart } from './autostart.js';
@@ -82,6 +82,7 @@ import { assertIncludePm2RestartAdmission } from './cli/pm2-god-admission.js';
82
82
  import { requestAttestedDaemonShutdown, requestAttestedDaemonShutdownBatch, } from './cli/supervisor-shutdown-client.js';
83
83
  import { assertDaemonPm2GracefulExitPolicy, assertConfiguredPm2FleetReady, assertExactAttestedDaemonSet, classifyStartBotFleetAdmission, normalizeRawPm2StopExitCodes, reconcileLatePm2StartPublication, runBoundedPm2StartTransaction, } from './cli/pm2-start-transaction.js';
84
84
  import { callDashboard } from './cli/dashboard-endpoint.js';
85
+ import { DASHBOARD_COMMAND_USAGE, executeDashboardCommand, formatDashboardFallbackFailure, } from './cli/dashboard-command.js';
85
86
  import { globalInstallUpdateLockTargetIn, installLatestBotmuxSync } from './core/maintenance.js';
86
87
  import { formatGlobalInstallCommand, resolveGlobalInstallPlan, UnsupportedGlobalInstallError, } from './utils/global-install.js';
87
88
  import { loadDashboardSecret } from './dashboard/auth.js';
@@ -3658,7 +3659,7 @@ async function printDashboardHintWithRetry() {
3658
3659
  }
3659
3660
  // Soft fallback
3660
3661
  if (last?.reason === 'no-active-token') {
3661
- console.log(' 面板: 运行 `botmux dashboard` 获取链接');
3662
+ console.log(' 面板: 运行 `botmux dashboard` 创建登录链接');
3662
3663
  }
3663
3664
  else if (last?.reason === 'no-secret') {
3664
3665
  console.log(' 面板: dashboard 凭证未就绪,启动后可用 `botmux dashboard` 获取链接');
@@ -3670,13 +3671,22 @@ async function printDashboardHintWithRetry() {
3670
3671
  console.log(' 面板: `botmux dashboard`(daemon 启动中,稍后可获取链接)');
3671
3672
  }
3672
3673
  }
3673
- /**
3674
- * Print a fresh dashboard URL by HMAC-authing to the dashboard process's
3675
- * loopback rotation endpoint. Each call invalidates the previously-issued
3676
- * token, so sharing a URL is the same as sharing a one-shot session.
3677
- */
3678
- async function cmdDashboard() {
3679
- const r = await callDashboardEndpoint('/__cli/rotate');
3674
+ /** Get or create the current dashboard URL, or explicitly rotate it. Bare
3675
+ * `dashboard` is the non-rotating get-or-create form; help and invalid
3676
+ * subcommands never call either credential endpoint. */
3677
+ async function cmdDashboard(args) {
3678
+ const execution = await executeDashboardCommand(args, callDashboardEndpoint);
3679
+ if (execution.kind === 'help') {
3680
+ console.log(DASHBOARD_COMMAND_USAGE);
3681
+ return;
3682
+ }
3683
+ if (execution.kind === 'invalid') {
3684
+ console.error(`未知 dashboard 子命令: ${execution.argument}`);
3685
+ console.error(DASHBOARD_COMMAND_USAGE);
3686
+ process.exitCode = 2;
3687
+ return;
3688
+ }
3689
+ const { action, result: r } = execution;
3680
3690
  if (r.ok) {
3681
3691
  // 首行保持纯 URL(脚本/复制取第一行即可);走中心化平台时再补一行本地直连兜底。
3682
3692
  console.log(r.url);
@@ -3704,8 +3714,7 @@ async function cmdDashboard() {
3704
3714
  console.error(` 详情: ${r.detail}`);
3705
3715
  }
3706
3716
  else {
3707
- // `no-active-token` can't occur on rotate (it always mints); fall through.
3708
- console.error('Rotation failed:', r.detail ?? r.reason);
3717
+ console.error(formatDashboardFallbackFailure(action, r));
3709
3718
  }
3710
3719
  process.exit(1);
3711
3720
  }
@@ -6065,7 +6074,10 @@ botmux v${getVersion()} — IM ↔ AI 编程 CLI 桥接
6065
6074
  logs 查看 daemon 日志(--lines N, --bot <0-based-index|pm2-name|appId>)
6066
6075
  status 查看 daemon 状态
6067
6076
  upgrade 升级到最新版本(别名:update)
6068
- dashboard 打印新的 Web Dashboard 一次性登录 URL(旧 token 同时失效)
6077
+ dashboard current
6078
+ 获取当前 Web Dashboard 登录 URL(裸 \`dashboard\` 同义;没有则创建)
6079
+ dashboard rotate
6080
+ 显式轮换 token,并打印新的登录 URL
6069
6081
  device enroll|status|logout
6070
6082
  在宿主终端注册、查看或清除 desktop device 凭证(AI CLI 会话内拒绝)
6071
6083
  list 列出活跃会话(交互式选择并连接 tmux)
@@ -9536,18 +9548,20 @@ async function cmdDispatch(rest) {
9536
9548
  }
9537
9549
  const bots = [...legacyBots, ...appBots]
9538
9550
  .filter((bot, index, all) => all.findIndex(candidate => candidate.openId === bot.openId) === index);
9539
- // Only an all-local stable-app dispatch can rely on this host's registry being
9540
- // visible to every receiver. Legacy or mixed --bot dispatches may cross hosts,
9541
- // so keep their context-derived compatibility report protocol.
9551
+ const { readRoleDispatchCompletionEnabled } = await import('./core/role-resolver.js');
9552
+ const sameTopicSendEnabled = readRoleDispatchCompletionEnabled(appId, targetChatId);
9542
9553
  const exactReportRootEnabled = parsedBotApps.length > 0 && legacyBots.length === 0;
9543
- const briefWithReportProtocol = (dispatchRootId) => exactReportRootEnabled
9544
- ? appendDispatchReportProtocol(brief, dispatchRootId)
9545
- : appendLegacyDispatchReportProtocol(brief);
9554
+ const briefWithCompletionProtocol = (dispatchRootId) => buildDispatchCompletionBrief({
9555
+ brief,
9556
+ dispatchRootId,
9557
+ exactReportRootEnabled,
9558
+ sameTopicSendEnabled,
9559
+ });
9546
9560
  let built;
9547
9561
  try {
9548
9562
  built = buildDispatchMessages({
9549
9563
  title: title.trim() || '子项目',
9550
- brief: intoRoot ? briefWithReportProtocol(intoRoot) : brief,
9564
+ brief: intoRoot ? briefWithCompletionProtocol(intoRoot) : brief,
9551
9565
  bots,
9552
9566
  });
9553
9567
  }
@@ -9627,7 +9641,7 @@ async function cmdDispatch(rest) {
9627
9641
  // resident chat-scope session's mutable latest reply alias.
9628
9642
  const kickoffBuilt = buildDispatchMessages({
9629
9643
  title: title.trim() || '子项目',
9630
- brief: briefWithReportProtocol(seedId),
9644
+ brief: briefWithCompletionProtocol(seedId),
9631
9645
  bots,
9632
9646
  });
9633
9647
  const kickoffBriefJson = JSON.stringify({ zh_cn: { title: '', content: kickoffBuilt.threadContent } });
@@ -9926,7 +9940,7 @@ async function cmdReport(rest) {
9926
9940
  }
9927
9941
  let response;
9928
9942
  try {
9929
- response = await fetch(`http://127.0.0.1:${daemon.ipcPort}/api/trigger`, {
9943
+ response = await fetchDaemonIpc(daemon.ipcPort, '/api/trigger', {
9930
9944
  method: 'POST',
9931
9945
  headers: { 'content-type': 'application/json' },
9932
9946
  body: JSON.stringify({
@@ -12037,7 +12051,7 @@ switch (command) {
12037
12051
  cmdUpgrade();
12038
12052
  break;
12039
12053
  case 'dashboard':
12040
- await cmdDashboard();
12054
+ await cmdDashboard(process.argv.slice(3));
12041
12055
  break;
12042
12056
  case 'bind': {
12043
12057
  // `botmux bind <code>` — 把本机绑定到中心化平台