aimux-cli 0.1.16 → 0.1.19

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 (357) hide show
  1. package/README.md +184 -67
  2. package/bin/aimux-dev +10 -0
  3. package/dist/agent-events.js +0 -1
  4. package/dist/agent-output-parser.js +0 -1
  5. package/dist/agent-prompt-delivery.js +0 -1
  6. package/dist/agent-tracker.js +0 -1
  7. package/dist/agent-watcher.js +0 -1
  8. package/dist/alert-display.d.ts +21 -0
  9. package/dist/alert-display.js +85 -0
  10. package/dist/atomic-write.js +0 -1
  11. package/dist/attachment-store.d.ts +0 -7
  12. package/dist/attachment-store.js +2 -87
  13. package/dist/builtin-metadata-watchers.js +4 -5
  14. package/dist/claude-hooks.d.ts +1 -0
  15. package/dist/claude-hooks.js +25 -1
  16. package/dist/config.d.ts +19 -13
  17. package/dist/config.js +28 -15
  18. package/dist/connection-targets.d.ts +8 -0
  19. package/dist/connection-targets.js +27 -0
  20. package/dist/context/compactor.js +0 -1
  21. package/dist/context/context-bridge.js +0 -1
  22. package/dist/context/context-file.js +0 -1
  23. package/dist/context/history.js +0 -1
  24. package/dist/credentials.d.ts +12 -0
  25. package/dist/credentials.js +48 -0
  26. package/dist/daemon.d.ts +23 -0
  27. package/dist/daemon.js +391 -67
  28. package/dist/dashboard/command-spec.js +0 -1
  29. package/dist/dashboard/feedback.js +0 -1
  30. package/dist/dashboard/index.d.ts +13 -10
  31. package/dist/dashboard/index.js +3 -27
  32. package/dist/dashboard/operation-failures.js +0 -1
  33. package/dist/dashboard/order.d.ts +22 -0
  34. package/dist/dashboard/order.js +54 -0
  35. package/dist/dashboard/pending-actions.d.ts +39 -10
  36. package/dist/dashboard/pending-actions.js +166 -37
  37. package/dist/dashboard/quick-jump.d.ts +2 -1
  38. package/dist/dashboard/quick-jump.js +7 -5
  39. package/dist/dashboard/runtime-evidence.js +0 -1
  40. package/dist/dashboard/session-actions.d.ts +4 -4
  41. package/dist/dashboard/session-actions.js +1 -2
  42. package/dist/dashboard/session-registry.d.ts +4 -3
  43. package/dist/dashboard/session-registry.js +16 -51
  44. package/dist/dashboard/sort.js +0 -1
  45. package/dist/dashboard/state.d.ts +1 -1
  46. package/dist/dashboard/state.js +0 -1
  47. package/dist/dashboard/targets.js +0 -1
  48. package/dist/dashboard/ui-state-store.d.ts +16 -1
  49. package/dist/dashboard/ui-state-store.js +73 -3
  50. package/dist/debug-state.d.ts +97 -0
  51. package/dist/debug-state.js +540 -0
  52. package/dist/debug.d.ts +38 -0
  53. package/dist/debug.js +219 -16
  54. package/dist/default-plugins/gh-pr-context.d.ts +2 -1
  55. package/dist/default-plugins/gh-pr-context.js +17 -12
  56. package/dist/default-plugins/transcript-length.js +15 -3
  57. package/dist/fast-control.js +37 -20
  58. package/dist/hotkeys.js +0 -1
  59. package/dist/http-client.js +31 -3
  60. package/dist/key-parser.js +0 -1
  61. package/dist/last-used.js +0 -1
  62. package/dist/local-ui-server.d.ts +22 -0
  63. package/dist/local-ui-server.js +185 -0
  64. package/dist/login-flow.d.ts +7 -0
  65. package/dist/login-flow.js +119 -0
  66. package/dist/main.js +821 -152
  67. package/dist/managed-launch-env.js +14 -1
  68. package/dist/metadata-server.d.ts +36 -36
  69. package/dist/metadata-server.js +638 -138
  70. package/dist/metadata-store.d.ts +4 -1
  71. package/dist/metadata-store.js +30 -3
  72. package/dist/multiplexer/agent-io-methods.d.ts +2 -10
  73. package/dist/multiplexer/agent-io-methods.js +12 -44
  74. package/dist/multiplexer/archives.js +8 -10
  75. package/dist/multiplexer/dashboard-actions-methods.js +0 -1
  76. package/dist/multiplexer/dashboard-control.js +45 -14
  77. package/dist/multiplexer/dashboard-interaction.d.ts +8 -2
  78. package/dist/multiplexer/dashboard-interaction.js +187 -29
  79. package/dist/multiplexer/dashboard-model.d.ts +10 -3
  80. package/dist/multiplexer/dashboard-model.js +417 -36
  81. package/dist/multiplexer/dashboard-ops.d.ts +9 -7
  82. package/dist/multiplexer/dashboard-ops.js +178 -69
  83. package/dist/multiplexer/dashboard-state-methods.d.ts +2 -1
  84. package/dist/multiplexer/dashboard-state-methods.js +3 -3
  85. package/dist/multiplexer/dashboard-tail-methods.d.ts +22 -10
  86. package/dist/multiplexer/dashboard-tail-methods.js +164 -48
  87. package/dist/multiplexer/dashboard-view-methods.d.ts +1 -1
  88. package/dist/multiplexer/dashboard-view-methods.js +23 -9
  89. package/dist/multiplexer/graveyard-view-model.d.ts +9 -1
  90. package/dist/multiplexer/graveyard-view-model.js +39 -1
  91. package/dist/multiplexer/index.d.ts +15 -12
  92. package/dist/multiplexer/index.js +64 -44
  93. package/dist/multiplexer/navigation.js +0 -1
  94. package/dist/multiplexer/notifications.js +107 -25
  95. package/dist/multiplexer/persistence-methods.d.ts +31 -4
  96. package/dist/multiplexer/persistence-methods.js +304 -309
  97. package/dist/multiplexer/runtime-lifecycle-methods.d.ts +8 -10
  98. package/dist/multiplexer/runtime-lifecycle-methods.js +104 -87
  99. package/dist/multiplexer/runtime-state.d.ts +8 -10
  100. package/dist/multiplexer/runtime-state.js +82 -146
  101. package/dist/multiplexer/runtime-sync.d.ts +2 -10
  102. package/dist/multiplexer/runtime-sync.js +3 -19
  103. package/dist/multiplexer/service-state-snapshot.d.ts +2 -4
  104. package/dist/multiplexer/service-state-snapshot.js +4 -52
  105. package/dist/multiplexer/services.d.ts +1 -0
  106. package/dist/multiplexer/services.js +55 -6
  107. package/dist/multiplexer/session-capture.d.ts +1 -0
  108. package/dist/multiplexer/session-capture.js +23 -0
  109. package/dist/multiplexer/session-launch.d.ts +4 -1
  110. package/dist/multiplexer/session-launch.js +152 -64
  111. package/dist/multiplexer/session-runtime-core.d.ts +8 -20
  112. package/dist/multiplexer/session-runtime-core.js +40 -136
  113. package/dist/multiplexer/subscreens.js +10 -4
  114. package/dist/multiplexer/tool-picker.js +0 -1
  115. package/dist/multiplexer/worktree-graveyard.d.ts +0 -1
  116. package/dist/multiplexer/worktree-graveyard.js +15 -17
  117. package/dist/multiplexer/worktrees.js +96 -41
  118. package/dist/notification-context.js +8 -5
  119. package/dist/notifications.js +163 -102
  120. package/dist/notify.d.ts +4 -0
  121. package/dist/notify.js +14 -1
  122. package/dist/orchestration-actions.js +0 -1
  123. package/dist/orchestration-routing.js +0 -1
  124. package/dist/orchestration.js +0 -1
  125. package/dist/osc-notifications.js +0 -1
  126. package/dist/paths.d.ts +32 -7
  127. package/dist/paths.js +82 -59
  128. package/dist/pending-actions.d.ts +5 -0
  129. package/dist/pending-actions.js +13 -0
  130. package/dist/plugin-runtime.js +9 -3
  131. package/dist/project-events.d.ts +1 -10
  132. package/dist/project-events.js +0 -11
  133. package/dist/project-scanner.d.ts +2 -3
  134. package/dist/project-scanner.js +58 -130
  135. package/dist/project-service-manifest.d.ts +1 -3
  136. package/dist/project-service-manifest.js +1 -4
  137. package/dist/recency.js +0 -1
  138. package/dist/recorder.js +0 -1
  139. package/dist/relay-client.d.ts +30 -0
  140. package/dist/relay-client.js +190 -0
  141. package/dist/remote-access.d.ts +16 -0
  142. package/dist/remote-access.js +90 -0
  143. package/dist/runtime-core/exchange-derived.d.ts +2 -0
  144. package/dist/runtime-core/exchange-derived.js +153 -0
  145. package/dist/runtime-core/exchange-import.d.ts +24 -0
  146. package/dist/runtime-core/exchange-import.js +317 -0
  147. package/dist/runtime-core/exchange-store.d.ts +157 -0
  148. package/dist/runtime-core/exchange-store.js +452 -0
  149. package/dist/runtime-core/topology-services.d.ts +38 -0
  150. package/dist/runtime-core/topology-services.js +170 -0
  151. package/dist/runtime-core/topology-sessions.d.ts +52 -0
  152. package/dist/runtime-core/topology-sessions.js +238 -0
  153. package/dist/runtime-core/topology-store.d.ts +171 -0
  154. package/dist/runtime-core/topology-store.js +419 -0
  155. package/dist/runtime-core/topology-worktrees.d.ts +60 -0
  156. package/dist/runtime-core/topology-worktrees.js +199 -0
  157. package/dist/runtime-migration.d.ts +69 -0
  158. package/dist/runtime-migration.js +398 -0
  159. package/dist/session-bootstrap.d.ts +8 -6
  160. package/dist/session-bootstrap.js +51 -159
  161. package/dist/session-runtime.d.ts +2 -0
  162. package/dist/session-runtime.js +1 -1
  163. package/dist/session-semantics.d.ts +12 -4
  164. package/dist/session-semantics.js +14 -1
  165. package/dist/shell-args.js +0 -1
  166. package/dist/shell-hooks.js +32 -11
  167. package/dist/shell-state.d.ts +2 -0
  168. package/dist/shell-state.js +26 -2
  169. package/dist/status-detector.js +0 -1
  170. package/dist/statusline-model.d.ts +10 -2
  171. package/dist/statusline-model.js +106 -31
  172. package/dist/task-workflow.d.ts +6 -9
  173. package/dist/task-workflow.js +37 -85
  174. package/dist/tasks.d.ts +6 -33
  175. package/dist/tasks.js +46 -89
  176. package/dist/team.d.ts +29 -0
  177. package/dist/team.js +40 -1
  178. package/dist/terminal-host.js +0 -1
  179. package/dist/threads.d.ts +6 -35
  180. package/dist/threads.js +89 -99
  181. package/dist/tmux/doctor.js +0 -1
  182. package/dist/tmux/inbox-popup.js +37 -16
  183. package/dist/tmux/runtime-manager.d.ts +3 -0
  184. package/dist/tmux/runtime-manager.js +21 -5
  185. package/dist/tmux/session-transport.js +0 -1
  186. package/dist/tmux/statusline-cache.js +0 -1
  187. package/dist/tmux/statusline.js +49 -10
  188. package/dist/tmux/switcher.js +0 -1
  189. package/dist/tmux/window-open.js +1 -3
  190. package/dist/tool-output-watchers.d.ts +0 -18
  191. package/dist/tool-output-watchers.js +0 -323
  192. package/dist/tui/render/box.js +0 -1
  193. package/dist/tui/render/text.js +0 -1
  194. package/dist/tui/screens/dashboard-renderers.js +37 -26
  195. package/dist/tui/screens/overlay-renderers.d.ts +2 -0
  196. package/dist/tui/screens/overlay-renderers.js +37 -2
  197. package/dist/tui/screens/subscreen-renderers.js +7 -1
  198. package/dist/workflow.js +0 -1
  199. package/dist/worktree.js +17 -1
  200. package/dist-ui/_expo/static/css/web-30453ede1678c16acb08b97e83e8646d.css +1 -0
  201. package/dist-ui/_expo/static/js/web/entry-477c745b2adc79367a4380ecf07d9ff6.js +14620 -0
  202. package/dist-ui/assets/assets/images/icon.a5413dcd2e811c9f2317d01a28118d8a.png +0 -0
  203. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
  204. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
  205. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
  206. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
  207. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
  208. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
  209. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
  210. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
  211. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
  212. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
  213. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
  214. package/dist-ui/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
  215. package/dist-ui/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
  216. package/dist-ui/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
  217. package/dist-ui/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
  218. package/dist-ui/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
  219. package/dist-ui/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
  220. package/dist-ui/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
  221. package/dist-ui/favicon.ico +0 -0
  222. package/dist-ui/index.html +38 -0
  223. package/dist-ui/metadata.json +1 -0
  224. package/package.json +29 -12
  225. package/dist/agent-events.js.map +0 -1
  226. package/dist/agent-message-parts.d.ts +0 -17
  227. package/dist/agent-message-parts.js +0 -31
  228. package/dist/agent-message-parts.js.map +0 -1
  229. package/dist/agent-output-parser.js.map +0 -1
  230. package/dist/agent-prompt-delivery.js.map +0 -1
  231. package/dist/agent-tracker.js.map +0 -1
  232. package/dist/agent-watcher.js.map +0 -1
  233. package/dist/atomic-write.js.map +0 -1
  234. package/dist/attachment-store.js.map +0 -1
  235. package/dist/builtin-metadata-watchers.js.map +0 -1
  236. package/dist/claude-hooks.js.map +0 -1
  237. package/dist/config.js.map +0 -1
  238. package/dist/context/compactor.js.map +0 -1
  239. package/dist/context/context-bridge.js.map +0 -1
  240. package/dist/context/context-file.js.map +0 -1
  241. package/dist/context/history.js.map +0 -1
  242. package/dist/daemon.js.map +0 -1
  243. package/dist/dashboard/command-spec.js.map +0 -1
  244. package/dist/dashboard/feedback.js.map +0 -1
  245. package/dist/dashboard/index.js.map +0 -1
  246. package/dist/dashboard/operation-failures.js.map +0 -1
  247. package/dist/dashboard/pending-actions.js.map +0 -1
  248. package/dist/dashboard/quick-jump.js.map +0 -1
  249. package/dist/dashboard/runtime-evidence.js.map +0 -1
  250. package/dist/dashboard/session-actions.js.map +0 -1
  251. package/dist/dashboard/session-registry.js.map +0 -1
  252. package/dist/dashboard/sort.js.map +0 -1
  253. package/dist/dashboard/state.js.map +0 -1
  254. package/dist/dashboard/targets.js.map +0 -1
  255. package/dist/dashboard/ui-state-store.js.map +0 -1
  256. package/dist/debug.js.map +0 -1
  257. package/dist/default-plugins/gh-pr-context.js.map +0 -1
  258. package/dist/default-plugins/transcript-length.js.map +0 -1
  259. package/dist/fast-control.js.map +0 -1
  260. package/dist/hotkeys.js.map +0 -1
  261. package/dist/http-client.js.map +0 -1
  262. package/dist/instance-directory.d.ts +0 -32
  263. package/dist/instance-directory.js +0 -82
  264. package/dist/instance-directory.js.map +0 -1
  265. package/dist/instance-registry.d.ts +0 -39
  266. package/dist/instance-registry.js +0 -208
  267. package/dist/instance-registry.js.map +0 -1
  268. package/dist/key-parser.js.map +0 -1
  269. package/dist/last-used.js.map +0 -1
  270. package/dist/main.js.map +0 -1
  271. package/dist/managed-launch-env.js.map +0 -1
  272. package/dist/metadata-server.js.map +0 -1
  273. package/dist/metadata-store.js.map +0 -1
  274. package/dist/multiplexer/agent-io-methods.js.map +0 -1
  275. package/dist/multiplexer/archives.js.map +0 -1
  276. package/dist/multiplexer/dashboard-actions-methods.js.map +0 -1
  277. package/dist/multiplexer/dashboard-control.js.map +0 -1
  278. package/dist/multiplexer/dashboard-interaction.js.map +0 -1
  279. package/dist/multiplexer/dashboard-model.js.map +0 -1
  280. package/dist/multiplexer/dashboard-ops.js.map +0 -1
  281. package/dist/multiplexer/dashboard-state-methods.js.map +0 -1
  282. package/dist/multiplexer/dashboard-tail-methods.js.map +0 -1
  283. package/dist/multiplexer/dashboard-view-methods.js.map +0 -1
  284. package/dist/multiplexer/graveyard-view-model.js.map +0 -1
  285. package/dist/multiplexer/index.js.map +0 -1
  286. package/dist/multiplexer/navigation.js.map +0 -1
  287. package/dist/multiplexer/notifications.js.map +0 -1
  288. package/dist/multiplexer/persistence-methods.js.map +0 -1
  289. package/dist/multiplexer/runtime-lifecycle-methods.js.map +0 -1
  290. package/dist/multiplexer/runtime-state.js.map +0 -1
  291. package/dist/multiplexer/runtime-sync.js.map +0 -1
  292. package/dist/multiplexer/service-state-snapshot.js.map +0 -1
  293. package/dist/multiplexer/services.js.map +0 -1
  294. package/dist/multiplexer/session-actions.d.ts +0 -40
  295. package/dist/multiplexer/session-actions.js +0 -110
  296. package/dist/multiplexer/session-actions.js.map +0 -1
  297. package/dist/multiplexer/session-launch.js.map +0 -1
  298. package/dist/multiplexer/session-runtime-core.js.map +0 -1
  299. package/dist/multiplexer/subscreens.js.map +0 -1
  300. package/dist/multiplexer/tool-picker.js.map +0 -1
  301. package/dist/multiplexer/worktree-graveyard.js.map +0 -1
  302. package/dist/multiplexer/worktrees.js.map +0 -1
  303. package/dist/notification-context.js.map +0 -1
  304. package/dist/notifications.js.map +0 -1
  305. package/dist/notify.js.map +0 -1
  306. package/dist/orchestration-actions.js.map +0 -1
  307. package/dist/orchestration-dispatcher.d.ts +0 -25
  308. package/dist/orchestration-dispatcher.js +0 -59
  309. package/dist/orchestration-dispatcher.js.map +0 -1
  310. package/dist/orchestration-routing.js.map +0 -1
  311. package/dist/orchestration.js.map +0 -1
  312. package/dist/osc-notifications.js.map +0 -1
  313. package/dist/paths.js.map +0 -1
  314. package/dist/plugin-runtime.js.map +0 -1
  315. package/dist/project-events.js.map +0 -1
  316. package/dist/project-scanner.js.map +0 -1
  317. package/dist/project-service-manifest.js.map +0 -1
  318. package/dist/recency.js.map +0 -1
  319. package/dist/recorder.js.map +0 -1
  320. package/dist/session-bootstrap.js.map +0 -1
  321. package/dist/session-input-operations.d.ts +0 -19
  322. package/dist/session-input-operations.js +0 -46
  323. package/dist/session-input-operations.js.map +0 -1
  324. package/dist/session-message-history.d.ts +0 -27
  325. package/dist/session-message-history.js +0 -105
  326. package/dist/session-message-history.js.map +0 -1
  327. package/dist/session-runtime.js.map +0 -1
  328. package/dist/session-semantics.js.map +0 -1
  329. package/dist/shell-args.js.map +0 -1
  330. package/dist/shell-hooks.js.map +0 -1
  331. package/dist/shell-state.js.map +0 -1
  332. package/dist/status-detector.js.map +0 -1
  333. package/dist/statusline-model.js.map +0 -1
  334. package/dist/task-dispatcher.d.ts +0 -64
  335. package/dist/task-dispatcher.js +0 -213
  336. package/dist/task-dispatcher.js.map +0 -1
  337. package/dist/task-workflow.js.map +0 -1
  338. package/dist/tasks.js.map +0 -1
  339. package/dist/team.js.map +0 -1
  340. package/dist/terminal-host.js.map +0 -1
  341. package/dist/threads.js.map +0 -1
  342. package/dist/tmux/doctor.js.map +0 -1
  343. package/dist/tmux/inbox-popup.js.map +0 -1
  344. package/dist/tmux/runtime-manager.js.map +0 -1
  345. package/dist/tmux/session-transport.js.map +0 -1
  346. package/dist/tmux/statusline-cache.js.map +0 -1
  347. package/dist/tmux/statusline.js.map +0 -1
  348. package/dist/tmux/switcher.js.map +0 -1
  349. package/dist/tmux/window-open.js.map +0 -1
  350. package/dist/tool-output-watchers.js.map +0 -1
  351. package/dist/tui/render/box.js.map +0 -1
  352. package/dist/tui/render/text.js.map +0 -1
  353. package/dist/tui/screens/dashboard-renderers.js.map +0 -1
  354. package/dist/tui/screens/overlay-renderers.js.map +0 -1
  355. package/dist/tui/screens/subscreen-renderers.js.map +0 -1
  356. package/dist/workflow.js.map +0 -1
  357. package/dist/worktree.js.map +0 -1
@@ -1,29 +1,181 @@
1
- import { debug } from "../debug.js";
2
- import { forkAgent as forkAgentImpl, migrateAgentSession as migrateAgentSessionImpl, renameAgent as renameAgentImpl, sendAgentToGraveyard as sendAgentToGraveyardImpl, spawnAgent as spawnAgentImpl, stopAgent as stopAgentImpl, } from "./session-actions.js";
3
1
  import { buildPlanPreview as buildPlanPreviewImpl, handleGraveyardKey as handleGraveyardKeyImpl, handlePlansKey as handlePlansKeyImpl, loadPlanEntries as loadPlanEntriesImpl, openPlanInEditor as openPlanInEditorImpl, parsePlanFrontmatter as parsePlanFrontmatterImpl, renderGraveyard as renderGraveyardImpl, renderGraveyardDetailsForHost as renderGraveyardDetailsForHostImpl, renderPlanDetailsForHost as renderPlanDetailsForHostImpl, renderPlans as renderPlansImpl, resurrectGraveyardEntry as resurrectGraveyardEntryImpl, showGraveyard as showGraveyardImpl, showPlans as showPlansImpl, } from "./archives.js";
4
2
  import { confirmSwitcher as confirmSwitcherImpl, dismissHelp as dismissHelpImpl, dismissSwitcher as dismissSwitcherImpl, getSwitcherList as getSwitcherListImpl, handleHelpKey as handleHelpKeyImpl, handleMigratePickerKey as handleMigratePickerKeyImpl, handleSwitcherKey as handleSwitcherKeyImpl, redrawCurrentView as redrawCurrentViewImpl, renderHelp as renderHelpImpl, renderMigratePicker as renderMigratePickerImpl, renderSwitcher as renderSwitcherImpl, resetSwitcherTimeout as resetSwitcherTimeoutImpl, showHelp as showHelpImpl, showMigratePicker as showMigratePickerImpl, showSwitcher as showSwitcherImpl, } from "./navigation.js";
5
- import { basenameForHost, clearDashboardSubscreens as clearDashboardSubscreensImpl, composeSplitScreen as composeSplitScreenImpl, composeTwoPaneLines as composeTwoPaneLinesImpl, createDashboardServiceWithFeedback as createDashboardServiceWithFeedbackImpl, dashboardSessionActionDeps as dashboardSessionActionDepsImpl, graveyardSessionWithFeedback as graveyardSessionWithFeedbackImpl, migrateSessionWithFeedback as migrateSessionWithFeedbackImpl, removeDashboardServiceWithFeedback as removeDashboardServiceWithFeedbackImpl, renderSessionDetails as renderSessionDetailsImpl, resumeOfflineServiceWithFeedback as resumeOfflineServiceWithFeedbackImpl, resumeOfflineSessionWithFeedback as resumeOfflineSessionWithFeedbackImpl, runDashboardOperation as runDashboardOperationImpl, setPendingDashboardSessionAction as setPendingDashboardSessionActionImpl, stopDashboardServiceWithFeedback as stopDashboardServiceWithFeedbackImpl, stopSessionToOfflineWithFeedback as stopSessionToOfflineWithFeedbackImpl, takeoverFromDashEntryWithFeedback as takeoverFromDashEntryWithFeedbackImpl, truncateAnsiForHost, truncatePlainForHost, waitForSessionStartForHost, wrapKeyValueForHost, wrapTextForHost, } from "./dashboard-ops.js";
3
+ import { basenameForHost, clearDashboardSubscreens as clearDashboardSubscreensImpl, composeSplitScreen as composeSplitScreenImpl, composeTwoPaneLines as composeTwoPaneLinesImpl, createDashboardServiceWithFeedback as createDashboardServiceWithFeedbackImpl, dashboardSessionActionDeps as dashboardSessionActionDepsImpl, graveyardSessionWithFeedback as graveyardSessionWithFeedbackImpl, migrateSessionWithFeedback as migrateSessionWithFeedbackImpl, removeDashboardServiceWithFeedback as removeDashboardServiceWithFeedbackImpl, renderSessionDetails as renderSessionDetailsImpl, resumeOfflineServiceWithFeedback as resumeOfflineServiceWithFeedbackImpl, resumeOfflineSessionWithFeedback as resumeOfflineSessionWithFeedbackImpl, runDashboardOperation as runDashboardOperationImpl, setPendingDashboardServiceAction as setPendingDashboardServiceActionImpl, setPendingDashboardSessionAction as setPendingDashboardSessionActionImpl, stopDashboardServiceWithFeedback as stopDashboardServiceWithFeedbackImpl, stopSessionToOfflineWithFeedback as stopSessionToOfflineWithFeedbackImpl, truncateAnsiForHost, truncatePlainForHost, waitForSessionStartForHost, wrapKeyValueForHost, wrapTextForHost, } from "./dashboard-ops.js";
6
4
  import { findMainRepo, listWorktrees as listAllWorktrees } from "../worktree.js";
7
5
  import { orderDashboardSessionsByVisualWorktree } from "../dashboard/session-registry.js";
8
6
  import { loadConfig } from "../config.js";
7
+ import { listTopologySessionStates, moveTopologySessionToGraveyard, upsertTopologySession, } from "../runtime-core/topology-sessions.js";
8
+ function isLiveTopologyStatus(status) {
9
+ return status === "running" || status === "idle" || status === "starting";
10
+ }
11
+ function runtimeToTopologySessionState(host, session) {
12
+ return {
13
+ id: session.id,
14
+ tool: session.command,
15
+ toolConfigKey: host.sessionToolKeys?.get?.(session.id) ?? session.command,
16
+ command: session.command,
17
+ args: host.sessionOriginalArgs?.get?.(session.id) ?? [],
18
+ lifecycle: "offline",
19
+ createdAt: session.startTime ? new Date(session.startTime).toISOString() : undefined,
20
+ backendSessionId: session.backendSessionId,
21
+ team: session.team,
22
+ worktreePath: host.sessionWorktreePaths?.get?.(session.id),
23
+ label: host.getSessionLabel?.(session.id),
24
+ headline: host.deriveHeadline?.(session.id),
25
+ };
26
+ }
27
+ function cacheOfflineSession(host, entry) {
28
+ const cache = host.offlineSessions;
29
+ if (!Array.isArray(cache))
30
+ return;
31
+ const offlineEntry = { ...entry, lifecycle: "offline", status: "offline" };
32
+ const existingIndex = cache.findIndex((session) => session.id === entry.id);
33
+ if (existingIndex >= 0) {
34
+ cache[existingIndex] = { ...cache[existingIndex], ...offlineEntry };
35
+ }
36
+ else {
37
+ cache.push(offlineEntry);
38
+ }
39
+ }
40
+ function removeOfflineSessionCache(host, sessionId) {
41
+ if (!Array.isArray(host.offlineSessions))
42
+ return;
43
+ host.offlineSessions = host.offlineSessions.filter((session) => session.id !== sessionId);
44
+ }
45
+ function findTopologySession(sessionId) {
46
+ return listTopologySessionStates({ statuses: ["running", "idle", "starting", "offline", "graveyard"] }).find((session) => session.id === sessionId);
47
+ }
48
+ function refreshLifecycleViews(host) {
49
+ host.invalidateDesktopStateSnapshot?.();
50
+ host.writeStatuslineFile?.();
51
+ if (host.mode === "dashboard") {
52
+ host.renderCurrentDashboardView?.();
53
+ }
54
+ host.updateContextWatcherSessions?.();
55
+ }
9
56
  export const dashboardTailMethods = {
10
57
  async forkAgent(opts) {
11
- return forkAgentImpl(this, opts);
58
+ const result = await this.forkSessionFromSource(opts.sourceSessionId, opts.targetToolConfigKey, opts.targetSessionId, opts.instruction, opts.targetWorktreePath, opts.extraArgs ?? []);
59
+ if (!result) {
60
+ throw new Error(`Unable to fork agent "${opts.sourceSessionId}"`);
61
+ }
62
+ if (opts.open) {
63
+ this.openLiveTmuxWindowForEntry({ id: result.sessionId });
64
+ }
65
+ return { sessionId: result.sessionId, threadId: result.threadId };
12
66
  },
13
67
  async spawnAgent(opts) {
14
- return spawnAgentImpl(this, opts);
68
+ const config = loadConfig();
69
+ const tool = config.tools[opts.toolConfigKey];
70
+ if (!tool) {
71
+ throw new Error(`Unknown tool config: ${opts.toolConfigKey}`);
72
+ }
73
+ const sessionId = opts.targetSessionId ?? this.generateDashboardSessionId?.(tool.command);
74
+ const transport = this.createSession(tool.command, [...tool.args, ...(opts.extraArgs ?? [])], tool.preambleFlag, opts.toolConfigKey, undefined, tool.sessionIdFlag, opts.targetWorktreePath, undefined, sessionId, !opts.open);
75
+ if (opts.open) {
76
+ this.openLiveTmuxWindowForEntry({ id: transport.id });
77
+ }
78
+ return { sessionId: transport.id };
79
+ },
80
+ async createTeammateAgent(opts) {
81
+ const config = loadConfig();
82
+ const toolConfigKey = opts.toolConfigKey ?? config.defaultTool;
83
+ const tool = config.tools[toolConfigKey];
84
+ if (!tool) {
85
+ throw new Error(`Unknown tool config: ${toolConfigKey}`);
86
+ }
87
+ const sessionId = opts.targetSessionId ?? this.generateDashboardSessionId?.(tool.command);
88
+ const team = {
89
+ teamId: `team-${opts.parentSessionId}`,
90
+ parentSessionId: opts.parentSessionId,
91
+ role: opts.role,
92
+ label: opts.label,
93
+ order: typeof opts.order === "number" ? opts.order : undefined,
94
+ };
95
+ const transport = this.createSession(tool.command, [...tool.args, ...(opts.extraArgs ?? [])], tool.preambleFlag, toolConfigKey, undefined, tool.sessionIdFlag, opts.targetWorktreePath, undefined, sessionId, !opts.open, false, team);
96
+ if (opts.label) {
97
+ this.applySessionLabel(transport.id, opts.label);
98
+ }
99
+ if (opts.open) {
100
+ this.openLiveTmuxWindowForEntry({ id: transport.id });
101
+ }
102
+ return {
103
+ sessionId: transport.id,
104
+ parentSessionId: opts.parentSessionId,
105
+ teamId: team.teamId,
106
+ role: opts.role,
107
+ label: opts.label,
108
+ };
15
109
  },
16
110
  async renameAgent(sessionId, label) {
17
- return renameAgentImpl(this, sessionId, label);
111
+ await this.updateSessionLabel(sessionId, label);
112
+ return { sessionId, label: label?.trim() || undefined };
18
113
  },
19
114
  async stopAgent(sessionId) {
20
- return stopAgentImpl(this, sessionId);
115
+ const runtime = this.sessions?.find?.((session) => session.id === sessionId);
116
+ if (runtime) {
117
+ if (this.graveyardAfterStopSessionIds?.has?.(sessionId)) {
118
+ throw new Error(`Session "${sessionId}" is being sent to graveyard`);
119
+ }
120
+ if (this.stoppingSessionIds?.has?.(sessionId)) {
121
+ return { sessionId, status: "offline" };
122
+ }
123
+ const offlineEntry = runtimeToTopologySessionState(this, runtime);
124
+ upsertTopologySession(offlineEntry, "offline");
125
+ cacheOfflineSession(this, offlineEntry);
126
+ this.stoppingSessionIds?.add?.(sessionId);
127
+ this.startedInDashboard = true;
128
+ runtime.kill();
129
+ refreshLifecycleViews(this);
130
+ this.debug?.(`stopped session ${sessionId} -> offline`, "session");
131
+ return { sessionId, status: "offline" };
132
+ }
133
+ const existing = findTopologySession(sessionId);
134
+ if (existing?.status === "offline") {
135
+ cacheOfflineSession(this, existing);
136
+ return { sessionId, status: "offline" };
137
+ }
138
+ if (existing && isLiveTopologyStatus(existing.status)) {
139
+ throw new Error(`Session "${sessionId}" is live but not owned by this runtime`);
140
+ }
141
+ if (existing?.status === "graveyard") {
142
+ throw new Error(`Session "${sessionId}" is already in graveyard`);
143
+ }
144
+ throw new Error(`Unknown session "${sessionId}"`);
21
145
  },
22
146
  async sendAgentToGraveyard(sessionId) {
23
- return sendAgentToGraveyardImpl(this, sessionId);
147
+ const runtime = this.sessions?.find?.((session) => session.id === sessionId);
148
+ const existing = findTopologySession(sessionId);
149
+ const previousStatus = runtime || isLiveTopologyStatus(existing?.status) ? "running" : "offline";
150
+ if (existing?.status === "graveyard") {
151
+ return { sessionId, status: "graveyard", previousStatus };
152
+ }
153
+ if (!runtime && existing && isLiveTopologyStatus(existing.status)) {
154
+ throw new Error(`Session "${sessionId}" is live but not owned by this runtime`);
155
+ }
156
+ if (runtime && !existing) {
157
+ upsertTopologySession(runtimeToTopologySessionState(this, runtime), "running");
158
+ }
159
+ else if (!runtime && !existing) {
160
+ throw new Error(`Unknown session "${sessionId}"`);
161
+ }
162
+ const moved = moveTopologySessionToGraveyard(sessionId);
163
+ if (!moved) {
164
+ throw new Error(`Unable to graveyard session "${sessionId}"`);
165
+ }
166
+ removeOfflineSessionCache(this, sessionId);
167
+ if (runtime) {
168
+ this.graveyardAfterStopSessionIds?.add?.(sessionId);
169
+ this.stoppingSessionIds?.add?.(sessionId);
170
+ runtime.kill();
171
+ }
172
+ refreshLifecycleViews(this);
173
+ this.debug?.(`graveyarded session ${sessionId}`, "session");
174
+ return { sessionId, status: "graveyard", previousStatus };
24
175
  },
25
176
  async migrateAgentSession(sessionId, targetWorktreePath) {
26
- return migrateAgentSessionImpl(this, sessionId, targetWorktreePath);
177
+ await this.migrateAgent(sessionId, targetWorktreePath);
178
+ return { sessionId, worktreePath: targetWorktreePath };
27
179
  },
28
180
  showGraveyard() {
29
181
  showGraveyardImpl(this);
@@ -112,6 +264,9 @@ export const dashboardTailMethods = {
112
264
  setPendingDashboardSessionAction(sessionId, kind, opts) {
113
265
  setPendingDashboardSessionActionImpl(this, sessionId, kind, opts);
114
266
  },
267
+ setPendingDashboardServiceAction(serviceId, kind, opts) {
268
+ setPendingDashboardServiceActionImpl(this, serviceId, kind, opts);
269
+ },
115
270
  async stopSessionToOfflineWithFeedback(session) {
116
271
  await stopSessionToOfflineWithFeedbackImpl(this, session);
117
272
  },
@@ -169,9 +324,6 @@ export const dashboardTailMethods = {
169
324
  dashboardSessionActionDeps() {
170
325
  return dashboardSessionActionDepsImpl(this);
171
326
  },
172
- async takeoverFromDashEntryWithFeedback(entry) {
173
- await takeoverFromDashEntryWithFeedbackImpl(this, entry);
174
- },
175
327
  async migrateSessionWithFeedback(session, targetPath, targetName) {
176
328
  await migrateSessionWithFeedbackImpl(this, session, targetPath, targetName);
177
329
  },
@@ -225,40 +377,4 @@ export const dashboardTailMethods = {
225
377
  }
226
378
  return orderDashboardSessionsByVisualWorktree(allDash, worktreePaths, mainRepoPath);
227
379
  },
228
- async takeoverSessionFromDashEntry(entry) {
229
- if (!entry.remoteInstanceId || !entry.remoteBackendSessionId)
230
- return;
231
- await this.takeoverSession({
232
- id: entry.id,
233
- tool: entry.command,
234
- backendSessionId: entry.remoteBackendSessionId,
235
- fromInstanceId: entry.remoteInstanceId,
236
- });
237
- },
238
- async takeoverSession(target) {
239
- const mux = this;
240
- const claimed = await mux.instanceDirectory.claimSession(target.id, target.fromInstanceId, process.cwd());
241
- if (!claimed) {
242
- debug(`takeover: session ${target.id} not found in instance ${target.fromInstanceId}`, "instance");
243
- return;
244
- }
245
- const config = loadConfig();
246
- const toolEntry = Object.entries(config.tools).find(([, t]) => t.command === target.tool);
247
- const toolCfg = toolEntry?.[1];
248
- const toolConfigKey = toolEntry?.[0];
249
- if (!toolCfg?.resumeArgs) {
250
- debug(`takeover: no resumeArgs configured for tool ${target.tool}`, "instance");
251
- return;
252
- }
253
- if (!mux.sessionBootstrap.canResumeWithBackendSessionId(toolCfg, target.backendSessionId)) {
254
- debug(`takeover: tool ${target.tool} does not support backendSessionId resume`, "instance");
255
- return;
256
- }
257
- const resumeArgs = toolCfg.resumeArgs.map((a) => a.replace("{sessionId}", target.backendSessionId));
258
- const args = mux.sessionBootstrap.composeToolArgs(toolCfg, resumeArgs);
259
- debug(`taking over session ${target.id} (backend=${target.backendSessionId}) from instance ${target.fromInstanceId}`, "instance");
260
- this.createSession(target.tool, args, toolCfg.preambleFlag, toolConfigKey, undefined, undefined, claimed.worktreePath, target.backendSessionId, undefined, false, true);
261
- this.renderDashboard();
262
- },
263
380
  };
264
- //# sourceMappingURL=dashboard-tail-methods.js.map
@@ -1,7 +1,7 @@
1
1
  export declare const dashboardViewMethods: {
2
2
  serviceLabelForCommand(this: any, commandLine: string): string;
3
3
  generateDashboardSessionId(this: any, command: string): string;
4
- settleDashboardCreatePending(this: any, itemId: string): void;
4
+ settleDashboardCreatePending(this: any, itemId: string, target?: "session" | "service" | "worktree"): void;
5
5
  preferDashboardEntrySelection(this: any, kind: "session" | "service", id: string, worktreePath?: string): void;
6
6
  createService(this: any, commandLine: string, worktreePath?: string, opts?: {
7
7
  serviceId?: string;
@@ -2,6 +2,7 @@ import { closeNotificationPanel as closeNotificationPanelImpl, handleNotificatio
2
2
  import { beginWorktreeRemoval as beginWorktreeRemovalImpl, finishWorktreeRemoval as finishWorktreeRemovalImpl, handleWorktreeInputKey as handleWorktreeInputKeyImpl, handleWorktreeRemoveConfirmKey as handleWorktreeRemoveConfirmKeyImpl, handleWorktreeListKey as handleWorktreeListKeyImpl, renderWorktreeInput as renderWorktreeInputImpl, renderWorktreeList as renderWorktreeListImpl, renderWorktreeRemoveConfirm as renderWorktreeRemoveConfirmImpl, showWorktreeCreatePrompt as showWorktreeCreatePromptImpl, showWorktreeList as showWorktreeListImpl, } from "./worktrees.js";
3
3
  import { createService as createServiceImpl, removeOfflineService as removeOfflineServiceImpl, resumeOfflineService as resumeOfflineServiceImpl, resumeOfflineServiceById as resumeOfflineServiceByIdImpl, serviceLabelForCommand as serviceLabelForCommandImpl, stopService as stopServiceImpl, } from "./services.js";
4
4
  import { derivedStatusLabel } from "../dashboard/index.js";
5
+ import { selectDashboardTeammates } from "../dashboard/session-registry.js";
5
6
  import { hasRuntimeEvidence, isAttachableDashboardSessionEntry } from "../dashboard/runtime-evidence.js";
6
7
  export const dashboardViewMethods = {
7
8
  serviceLabelForCommand(commandLine) {
@@ -10,29 +11,38 @@ export const dashboardViewMethods = {
10
11
  generateDashboardSessionId(command) {
11
12
  return `${command}-${Math.random().toString(36).slice(2, 8)}`;
12
13
  },
13
- settleDashboardCreatePending(itemId) {
14
+ settleDashboardCreatePending(itemId, target) {
14
15
  if (!(this.startedInDashboard && this.mode === "dashboard"))
15
16
  return;
16
- this.dashboardPendingActions.settleCreatePending(itemId, () => {
17
+ const pendingTarget = target ??
18
+ (itemId.startsWith("worktree:")
19
+ ? "worktree"
20
+ : this.getDashboardSessions?.().some((entry) => entry.id === itemId)
21
+ ? "session"
22
+ : "service");
23
+ this.dashboardPendingActions.settleCreatePending(pendingTarget, itemId, () => {
17
24
  this.refreshLocalDashboardModel();
18
25
  this.renderDashboard();
19
26
  }, {
20
- timeoutMs: itemId.startsWith("worktree:") ? 180_000 : undefined,
27
+ timeoutMs: pendingTarget === "worktree" ? 180_000 : undefined,
21
28
  isSettled: async () => {
22
29
  if (typeof this.refreshDashboardModelFromService === "function") {
23
30
  await this.refreshDashboardModelFromService(true);
24
31
  }
25
- if (itemId.startsWith("worktree:")) {
26
- const path = itemId.slice("worktree:".length);
32
+ if (pendingTarget === "worktree") {
33
+ const path = itemId.startsWith("worktree:") ? itemId.slice("worktree:".length) : itemId;
27
34
  const rawWorktree = this.listDesktopWorktrees?.().find((entry) => entry.path === path);
28
35
  if (rawWorktree && rawWorktree.pending !== true && rawWorktree.pendingAction !== "creating")
29
36
  return true;
30
37
  const group = this.dashboardWorktreeGroupsCache?.find((entry) => entry.path === path);
31
38
  return Boolean(group) && group.pendingAction !== "creating" && group.pending !== true;
32
39
  }
33
- const service = this.getDashboardServices?.().find((entry) => entry.id === itemId);
34
- if (service)
35
- return service.pendingAction !== "creating" || hasRuntimeEvidence(service);
40
+ if (pendingTarget === "service") {
41
+ const service = this.getDashboardServices?.().find((entry) => entry.id === itemId);
42
+ if (service)
43
+ return service.pendingAction !== "creating" || hasRuntimeEvidence(service);
44
+ return false;
45
+ }
36
46
  const session = this.getDashboardSessions?.().find((entry) => entry.id === itemId);
37
47
  return isAttachableDashboardSessionEntry(session);
38
48
  },
@@ -72,6 +82,7 @@ export const dashboardViewMethods = {
72
82
  }
73
83
  : this.getViewportSize();
74
84
  const dashSessions = this.dashboardSessionsCache;
85
+ const dashTeammates = this.dashboardTeammatesCache ?? [];
75
86
  const dashServices = this.dashboardServicesCache;
76
87
  const worktreeGroups = this.dashboardWorktreeGroupsCache;
77
88
  const mainCheckoutInfo = this.dashboardMainCheckoutInfoCache;
@@ -88,6 +99,9 @@ export const dashboardViewMethods = {
88
99
  else if (!hasWorktrees && dashSessions.length > 0) {
89
100
  selectedSession = dashSessions[this.activeIndex]?.id;
90
101
  }
102
+ const selectedSessionEntry = selectedSession
103
+ ? dashSessions.find((session) => session.id === selectedSession)
104
+ : undefined;
91
105
  this.dashboard.update({
92
106
  sessions: dashSessions,
93
107
  services: dashServices,
@@ -97,6 +111,7 @@ export const dashboardViewMethods = {
97
111
  navLevel: hasWorktrees ? this.dashboardState.level : "sessions",
98
112
  selectedSessionId: selectedSession,
99
113
  selectedServiceId: selectedService,
114
+ selectedTeammates: selectDashboardTeammates(dashTeammates, selectedSessionEntry),
100
115
  runtimeLabel: "tmux",
101
116
  mainCheckout: mainCheckoutInfo,
102
117
  operationFailures: this.dashboardOperationFailuresCache ?? [],
@@ -199,4 +214,3 @@ export const dashboardViewMethods = {
199
214
  handleWorktreeListKeyImpl(this, data);
200
215
  },
201
216
  };
202
- //# sourceMappingURL=dashboard-view-methods.js.map
@@ -54,7 +54,13 @@ export type GraveyardStandaloneAgentRow = {
54
54
  actionNumber: number;
55
55
  lastUsedAt?: string;
56
56
  };
57
- export type GraveyardViewRow = GraveyardSectionRow | GraveyardAgentWorktreeRow | GraveyardWorktreeRow | GraveyardAttachedAgentRow | GraveyardAttachedServiceRow | GraveyardAttachedMoreRow | GraveyardStandaloneAgentRow;
57
+ export type GraveyardOrphanTeammateRow = {
58
+ kind: "orphan-teammate";
59
+ entry: SessionState;
60
+ parentSessionId: string;
61
+ lastUsedAt?: string;
62
+ };
63
+ export type GraveyardViewRow = GraveyardSectionRow | GraveyardAgentWorktreeRow | GraveyardWorktreeRow | GraveyardAttachedAgentRow | GraveyardAttachedServiceRow | GraveyardAttachedMoreRow | GraveyardStandaloneAgentRow | GraveyardOrphanTeammateRow;
58
64
  export type GraveyardSelectableRow = GraveyardWorktreeRow | GraveyardStandaloneAgentRow;
59
65
  export interface GraveyardViewModel {
60
66
  rows: GraveyardViewRow[];
@@ -63,6 +69,8 @@ export interface GraveyardViewModel {
63
69
  export interface BuildGraveyardViewModelInput {
64
70
  worktrees: WorktreeGraveyardEntry[];
65
71
  agents: SessionState[];
72
+ parentSessions?: SessionState[];
73
+ teammates?: SessionState[];
66
74
  lastUsedById?: Record<string, LastUsedEntry | undefined>;
67
75
  }
68
76
  export declare function buildGraveyardViewModel(input: BuildGraveyardViewModelInput): GraveyardViewModel;
@@ -1,10 +1,12 @@
1
1
  import { basename } from "node:path";
2
2
  import { parseRecencyTimestamp } from "../recency.js";
3
+ import { isTeammateSession, selectOrphanTeammates } from "../team.js";
3
4
  export const MAX_VISIBLE_ATTACHED_AGENTS_PER_WORKTREE = 5;
4
5
  export function buildGraveyardViewModel(input) {
5
6
  const rows = [];
6
7
  const selectableRows = [];
7
8
  const flatAgentsClaimedByWorktree = new Set();
9
+ const renderedAgentIds = new Set();
8
10
  const addSelectable = (row) => {
9
11
  const actionIndex = selectableRows.length;
10
12
  const withAction = { ...row, actionIndex, actionNumber: actionIndex + 1 };
@@ -34,6 +36,9 @@ export function buildGraveyardViewModel(input) {
34
36
  sortAt: worktreeSortTimestamp(worktree, attachedAgents, attachedServices),
35
37
  });
36
38
  rows.push(worktreeRow);
39
+ for (const agent of attachedAgents) {
40
+ renderedAgentIds.add(agent.entry.id);
41
+ }
37
42
  for (const agent of visibleAttachedAgents) {
38
43
  rows.push({ kind: "attached-agent-display", parentPath: worktree.path, agent });
39
44
  }
@@ -61,6 +66,7 @@ export function buildGraveyardViewModel(input) {
61
66
  entry: agent,
62
67
  lastUsedAt: input.lastUsedById?.[agent.id]?.lastUsedAt,
63
68
  }));
69
+ renderedAgentIds.add(agent.id);
64
70
  }
65
71
  }
66
72
  }
@@ -73,10 +79,43 @@ export function buildGraveyardViewModel(input) {
73
79
  entry: agent,
74
80
  lastUsedAt: input.lastUsedById?.[agent.id]?.lastUsedAt,
75
81
  }));
82
+ renderedAgentIds.add(agent.id);
83
+ }
84
+ }
85
+ const orphanTeammates = selectOrphanTeammates(input.teammates ?? [], collectKnownParentIds(input)).filter((session) => !renderedAgentIds.has(session.id) && !input.agents.some((agent) => agent.id === session.id));
86
+ if (orphanTeammates.length > 0) {
87
+ rows.push({ kind: "section", label: "Orphaned Teammates" });
88
+ for (const teammate of orphanTeammates) {
89
+ const parentSessionId = teammate.team?.parentSessionId;
90
+ if (!parentSessionId)
91
+ continue;
92
+ rows.push({
93
+ kind: "orphan-teammate",
94
+ entry: teammate,
95
+ parentSessionId,
96
+ lastUsedAt: input.lastUsedById?.[teammate.id]?.lastUsedAt,
97
+ });
76
98
  }
77
99
  }
78
100
  return { rows, selectableRows };
79
101
  }
102
+ function collectKnownParentIds(input) {
103
+ const ids = new Set();
104
+ const add = (session) => {
105
+ if (!session || isTeammateSession(session))
106
+ return;
107
+ ids.add(session.id);
108
+ };
109
+ for (const session of input.parentSessions ?? [])
110
+ add(session);
111
+ for (const agent of input.agents)
112
+ add(agent);
113
+ for (const worktree of input.worktrees) {
114
+ for (const agent of worktree.agents ?? [])
115
+ add(agent);
116
+ }
117
+ return ids;
118
+ }
80
119
  function sortWorktrees(worktrees, flatAgents, lastUsedById) {
81
120
  const sortMsByPath = new Map();
82
121
  for (const worktree of worktrees) {
@@ -182,4 +221,3 @@ function compareRecencyOrCreated(left, leftLastUsedAt, right, rightLastUsedAt) {
182
221
  const rightCreated = parseRecencyTimestamp(right.createdAt) ?? 0;
183
222
  return rightCreated - leftCreated || left.id.localeCompare(right.id);
184
223
  }
185
- //# sourceMappingURL=graveyard-view-model.js.map
@@ -1,5 +1,6 @@
1
1
  import { SessionRuntime, type SessionTransport } from "../session-runtime.js";
2
2
  import { type TmuxTarget } from "../tmux/runtime-manager.js";
3
+ import type { SessionTeamMetadata } from "../team.js";
3
4
  import { type DashboardActionMethods } from "./dashboard-actions-methods.js";
4
5
  import { type AgentIoMethods } from "./agent-io-methods.js";
5
6
  import { type DashboardInteractionMethods } from "./dashboard-interaction.js";
@@ -18,6 +19,7 @@ export interface SessionState {
18
19
  lifecycle?: "live" | "offline";
19
20
  createdAt?: string;
20
21
  backendSessionId?: string;
22
+ team?: SessionTeamMetadata;
21
23
  worktreePath?: string;
22
24
  label?: string;
23
25
  headline?: string;
@@ -36,7 +38,6 @@ export interface ServiceState {
36
38
  export interface SavedState {
37
39
  savedAt: string;
38
40
  cwd: string;
39
- sessions: SessionState[];
40
41
  services?: ServiceState[];
41
42
  }
42
43
  type ManagedSession = SessionRuntime;
@@ -95,8 +96,10 @@ export declare class Multiplexer {
95
96
  private planEntries;
96
97
  private planIndex;
97
98
  private notificationPanelState;
99
+ private teammatePickerState;
98
100
  private dashboardPendingActions;
99
101
  private stoppingSessionIds;
102
+ private unpreservedExitedSessionIds;
100
103
  private graveyardAfterStopSessionIds;
101
104
  private dashboardQuickJumpTimeout;
102
105
  /** Quick switcher overlay state */
@@ -105,7 +108,6 @@ export declare class Multiplexer {
105
108
  /** MRU order of session IDs (most recent first) */
106
109
  private sessionMRU;
107
110
  /** Sessions confirmed registered in the instance registry (for claim detection) */
108
- private confirmedRegistered;
109
111
  /** The focused worktree path on the dashboard (undefined = main repo) */
110
112
  private dashboardState;
111
113
  private dashboardUiStateStore;
@@ -117,11 +119,8 @@ export declare class Multiplexer {
117
119
  private dashboardPendingExpandedViewportCount;
118
120
  private dashboardModelVersion;
119
121
  private agentTracker;
120
- private instanceId;
121
122
  private contextWatcher;
122
- private taskDispatcher;
123
- private orchestrationDispatcher;
124
- /** Maps session ID → toolConfigKey for state saving */
123
+ /** Maps session ID → toolConfigKey for topology persistence */
125
124
  private sessionToolKeys;
126
125
  /** Maps session ID → original args (before preamble injection) */
127
126
  private sessionOriginalArgs;
@@ -131,10 +130,9 @@ export declare class Multiplexer {
131
130
  private sessionRoles;
132
131
  /** Maps session ID → user-provided stable label */
133
132
  private sessionLabels;
134
- /** Offline sessions from previous runs (loaded from state.json) */
133
+ /** Offline sessions from previous runs (loaded from runtime topology) */
135
134
  private offlineSessions;
136
135
  /** Cross-instance discovery and claim/heartbeat ownership */
137
- private instanceDirectory;
138
136
  private tmuxRuntimeManager;
139
137
  private sessionBootstrap;
140
138
  private sessionTmuxTargets;
@@ -147,7 +145,9 @@ export declare class Multiplexer {
147
145
  private lastStatuslineSnapshotKey;
148
146
  private desktopStateSnapshot;
149
147
  private dashboardSessionsCache;
148
+ private dashboardTeammatesCache;
150
149
  private dashboardServicesCache;
150
+ private dashboardRawWorktreeGroupsCache;
151
151
  private dashboardWorktreeGroupsCache;
152
152
  private dashboardOperationFailuresCache;
153
153
  private dashboardMainCheckoutInfoCache;
@@ -161,14 +161,13 @@ export declare class Multiplexer {
161
161
  get sessionCount(): number;
162
162
  get activeSession(): ManagedSession | null;
163
163
  private publishAlert;
164
+ private resolveSessionAlertDisplayContext;
164
165
  private deriveSessionSemanticState;
165
166
  private registerManagedSession;
166
167
  private handleSessionRuntimeEvent;
167
168
  private buildTmuxWindowMetadata;
168
169
  private syncTmuxWindowMetadata;
169
170
  private updateContextWatcherSessions;
170
- private createTaskDispatcher;
171
- private createOrchestrationDispatcher;
172
171
  private selectLinkedOrOpenTarget;
173
172
  run(opts: {
174
173
  command: string;
@@ -178,7 +177,7 @@ export declare class Multiplexer {
178
177
  runProjectService(): Promise<number>;
179
178
  /**
180
179
  * Resume previous sessions using each tool's native resume mechanism.
181
- * Reads state.json and spawns sessions with resumeArgs instead of normal args.
180
+ * Reads runtime topology and spawns sessions with resumeArgs instead of normal args.
182
181
  */
183
182
  resumeSessions(toolFilter?: string): Promise<number>;
184
183
  /**
@@ -186,7 +185,11 @@ export declare class Multiplexer {
186
185
  * Starts fresh sessions but with context from the previous conversation.
187
186
  */
188
187
  restoreSessions(toolFilter?: string): Promise<number>;
189
- createSession(command: string, args: string[], preambleFlag?: string[], toolConfigKey?: string, extraPreamble?: string, sessionIdFlag?: string[], worktreePath?: string, backendSessionIdOverride?: string, sessionIdOverride?: string, detachedInTmux?: boolean, suppressStartupPreamble?: boolean): SessionTransport;
188
+ createSession(command: string, args: string[], preambleFlag?: string[], toolConfigKey?: string, extraPreamble?: string, sessionIdFlag?: string[], worktreePath?: string, backendSessionIdOverride?: string, sessionIdOverride?: string, detachedInTmux?: boolean, suppressStartupPreamble?: boolean, team?: SessionTeamMetadata): SessionTransport;
189
+ recordSessionBackendSessionId(sessionId: string, backendSessionId: string): {
190
+ sessionId: string;
191
+ backendSessionId: string;
192
+ };
190
193
  /**
191
194
  * Migrate an agent from its current worktree to a target worktree.
192
195
  * Copies history and context, kills the old session, starts a new one