aimux-cli 0.1.16 → 0.1.18

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 (299) hide show
  1. package/README.md +184 -67
  2. package/bin/aimux-dev +10 -0
  3. package/dist/alert-display.d.ts +21 -0
  4. package/dist/alert-display.js +86 -0
  5. package/dist/alert-display.js.map +1 -0
  6. package/dist/attachment-store.d.ts +0 -7
  7. package/dist/attachment-store.js +2 -86
  8. package/dist/attachment-store.js.map +1 -1
  9. package/dist/builtin-metadata-watchers.js +4 -4
  10. package/dist/builtin-metadata-watchers.js.map +1 -1
  11. package/dist/claude-hooks.d.ts +1 -0
  12. package/dist/claude-hooks.js +25 -0
  13. package/dist/claude-hooks.js.map +1 -1
  14. package/dist/config.d.ts +19 -13
  15. package/dist/config.js +28 -14
  16. package/dist/config.js.map +1 -1
  17. package/dist/connection-targets.d.ts +8 -0
  18. package/dist/connection-targets.js +28 -0
  19. package/dist/connection-targets.js.map +1 -0
  20. package/dist/credentials.d.ts +12 -0
  21. package/dist/credentials.js +49 -0
  22. package/dist/credentials.js.map +1 -0
  23. package/dist/daemon.d.ts +23 -0
  24. package/dist/daemon.js +391 -66
  25. package/dist/daemon.js.map +1 -1
  26. package/dist/dashboard/index.d.ts +13 -10
  27. package/dist/dashboard/index.js +3 -26
  28. package/dist/dashboard/index.js.map +1 -1
  29. package/dist/dashboard/order.d.ts +22 -0
  30. package/dist/dashboard/order.js +55 -0
  31. package/dist/dashboard/order.js.map +1 -0
  32. package/dist/dashboard/pending-actions.d.ts +39 -10
  33. package/dist/dashboard/pending-actions.js +166 -36
  34. package/dist/dashboard/pending-actions.js.map +1 -1
  35. package/dist/dashboard/quick-jump.d.ts +2 -1
  36. package/dist/dashboard/quick-jump.js +7 -4
  37. package/dist/dashboard/quick-jump.js.map +1 -1
  38. package/dist/dashboard/session-actions.d.ts +4 -4
  39. package/dist/dashboard/session-actions.js +1 -1
  40. package/dist/dashboard/session-actions.js.map +1 -1
  41. package/dist/dashboard/session-registry.d.ts +4 -3
  42. package/dist/dashboard/session-registry.js +16 -50
  43. package/dist/dashboard/session-registry.js.map +1 -1
  44. package/dist/dashboard/state.d.ts +1 -1
  45. package/dist/dashboard/state.js.map +1 -1
  46. package/dist/dashboard/ui-state-store.d.ts +16 -1
  47. package/dist/dashboard/ui-state-store.js +73 -2
  48. package/dist/dashboard/ui-state-store.js.map +1 -1
  49. package/dist/debug-state.d.ts +97 -0
  50. package/dist/debug-state.js +541 -0
  51. package/dist/debug-state.js.map +1 -0
  52. package/dist/debug.d.ts +38 -0
  53. package/dist/debug.js +219 -15
  54. package/dist/debug.js.map +1 -1
  55. package/dist/default-plugins/gh-pr-context.d.ts +2 -1
  56. package/dist/default-plugins/gh-pr-context.js +17 -11
  57. package/dist/default-plugins/gh-pr-context.js.map +1 -1
  58. package/dist/default-plugins/transcript-length.js +15 -2
  59. package/dist/default-plugins/transcript-length.js.map +1 -1
  60. package/dist/fast-control.js +37 -19
  61. package/dist/fast-control.js.map +1 -1
  62. package/dist/http-client.js +31 -2
  63. package/dist/http-client.js.map +1 -1
  64. package/dist/local-ui-server.d.ts +22 -0
  65. package/dist/local-ui-server.js +186 -0
  66. package/dist/local-ui-server.js.map +1 -0
  67. package/dist/login-flow.d.ts +7 -0
  68. package/dist/login-flow.js +120 -0
  69. package/dist/login-flow.js.map +1 -0
  70. package/dist/main.js +821 -151
  71. package/dist/main.js.map +1 -1
  72. package/dist/managed-launch-env.js +14 -0
  73. package/dist/managed-launch-env.js.map +1 -1
  74. package/dist/metadata-server.d.ts +36 -36
  75. package/dist/metadata-server.js +638 -137
  76. package/dist/metadata-server.js.map +1 -1
  77. package/dist/metadata-store.d.ts +4 -1
  78. package/dist/metadata-store.js +30 -2
  79. package/dist/metadata-store.js.map +1 -1
  80. package/dist/multiplexer/agent-io-methods.d.ts +2 -10
  81. package/dist/multiplexer/agent-io-methods.js +12 -43
  82. package/dist/multiplexer/agent-io-methods.js.map +1 -1
  83. package/dist/multiplexer/archives.js +8 -9
  84. package/dist/multiplexer/archives.js.map +1 -1
  85. package/dist/multiplexer/dashboard-control.js +45 -13
  86. package/dist/multiplexer/dashboard-control.js.map +1 -1
  87. package/dist/multiplexer/dashboard-interaction.d.ts +8 -2
  88. package/dist/multiplexer/dashboard-interaction.js +187 -28
  89. package/dist/multiplexer/dashboard-interaction.js.map +1 -1
  90. package/dist/multiplexer/dashboard-model.d.ts +10 -3
  91. package/dist/multiplexer/dashboard-model.js +417 -35
  92. package/dist/multiplexer/dashboard-model.js.map +1 -1
  93. package/dist/multiplexer/dashboard-ops.d.ts +9 -7
  94. package/dist/multiplexer/dashboard-ops.js +178 -68
  95. package/dist/multiplexer/dashboard-ops.js.map +1 -1
  96. package/dist/multiplexer/dashboard-state-methods.d.ts +2 -1
  97. package/dist/multiplexer/dashboard-state-methods.js +3 -2
  98. package/dist/multiplexer/dashboard-state-methods.js.map +1 -1
  99. package/dist/multiplexer/dashboard-tail-methods.d.ts +22 -10
  100. package/dist/multiplexer/dashboard-tail-methods.js +164 -47
  101. package/dist/multiplexer/dashboard-tail-methods.js.map +1 -1
  102. package/dist/multiplexer/dashboard-view-methods.d.ts +1 -1
  103. package/dist/multiplexer/dashboard-view-methods.js +23 -8
  104. package/dist/multiplexer/dashboard-view-methods.js.map +1 -1
  105. package/dist/multiplexer/graveyard-view-model.d.ts +9 -1
  106. package/dist/multiplexer/graveyard-view-model.js +39 -0
  107. package/dist/multiplexer/graveyard-view-model.js.map +1 -1
  108. package/dist/multiplexer/index.d.ts +15 -12
  109. package/dist/multiplexer/index.js +64 -43
  110. package/dist/multiplexer/index.js.map +1 -1
  111. package/dist/multiplexer/notifications.js +107 -24
  112. package/dist/multiplexer/notifications.js.map +1 -1
  113. package/dist/multiplexer/persistence-methods.d.ts +31 -4
  114. package/dist/multiplexer/persistence-methods.js +304 -308
  115. package/dist/multiplexer/persistence-methods.js.map +1 -1
  116. package/dist/multiplexer/runtime-lifecycle-methods.d.ts +8 -10
  117. package/dist/multiplexer/runtime-lifecycle-methods.js +104 -86
  118. package/dist/multiplexer/runtime-lifecycle-methods.js.map +1 -1
  119. package/dist/multiplexer/runtime-state.d.ts +8 -10
  120. package/dist/multiplexer/runtime-state.js +82 -145
  121. package/dist/multiplexer/runtime-state.js.map +1 -1
  122. package/dist/multiplexer/runtime-sync.d.ts +2 -10
  123. package/dist/multiplexer/runtime-sync.js +3 -18
  124. package/dist/multiplexer/runtime-sync.js.map +1 -1
  125. package/dist/multiplexer/service-state-snapshot.d.ts +2 -4
  126. package/dist/multiplexer/service-state-snapshot.js +4 -51
  127. package/dist/multiplexer/service-state-snapshot.js.map +1 -1
  128. package/dist/multiplexer/services.d.ts +1 -0
  129. package/dist/multiplexer/services.js +55 -5
  130. package/dist/multiplexer/services.js.map +1 -1
  131. package/dist/multiplexer/session-capture.d.ts +1 -0
  132. package/dist/multiplexer/session-capture.js +24 -0
  133. package/dist/multiplexer/session-capture.js.map +1 -0
  134. package/dist/multiplexer/session-launch.d.ts +4 -1
  135. package/dist/multiplexer/session-launch.js +152 -63
  136. package/dist/multiplexer/session-launch.js.map +1 -1
  137. package/dist/multiplexer/session-runtime-core.d.ts +8 -20
  138. package/dist/multiplexer/session-runtime-core.js +40 -135
  139. package/dist/multiplexer/session-runtime-core.js.map +1 -1
  140. package/dist/multiplexer/subscreens.js +10 -3
  141. package/dist/multiplexer/subscreens.js.map +1 -1
  142. package/dist/multiplexer/worktree-graveyard.d.ts +0 -1
  143. package/dist/multiplexer/worktree-graveyard.js +15 -16
  144. package/dist/multiplexer/worktree-graveyard.js.map +1 -1
  145. package/dist/multiplexer/worktrees.js +96 -40
  146. package/dist/multiplexer/worktrees.js.map +1 -1
  147. package/dist/notification-context.js +8 -4
  148. package/dist/notification-context.js.map +1 -1
  149. package/dist/notifications.js +163 -101
  150. package/dist/notifications.js.map +1 -1
  151. package/dist/notify.d.ts +4 -0
  152. package/dist/notify.js +14 -0
  153. package/dist/notify.js.map +1 -1
  154. package/dist/paths.d.ts +32 -7
  155. package/dist/paths.js +82 -58
  156. package/dist/paths.js.map +1 -1
  157. package/dist/pending-actions.d.ts +5 -0
  158. package/dist/pending-actions.js +14 -0
  159. package/dist/pending-actions.js.map +1 -0
  160. package/dist/plugin-runtime.js +9 -2
  161. package/dist/plugin-runtime.js.map +1 -1
  162. package/dist/project-events.d.ts +1 -10
  163. package/dist/project-events.js +0 -10
  164. package/dist/project-events.js.map +1 -1
  165. package/dist/project-scanner.d.ts +2 -3
  166. package/dist/project-scanner.js +58 -129
  167. package/dist/project-scanner.js.map +1 -1
  168. package/dist/project-service-manifest.d.ts +1 -3
  169. package/dist/project-service-manifest.js +1 -3
  170. package/dist/project-service-manifest.js.map +1 -1
  171. package/dist/relay-client.d.ts +30 -0
  172. package/dist/relay-client.js +191 -0
  173. package/dist/relay-client.js.map +1 -0
  174. package/dist/remote-access.d.ts +16 -0
  175. package/dist/remote-access.js +91 -0
  176. package/dist/remote-access.js.map +1 -0
  177. package/dist/runtime-core/exchange-derived.d.ts +2 -0
  178. package/dist/runtime-core/exchange-derived.js +154 -0
  179. package/dist/runtime-core/exchange-derived.js.map +1 -0
  180. package/dist/runtime-core/exchange-import.d.ts +24 -0
  181. package/dist/runtime-core/exchange-import.js +318 -0
  182. package/dist/runtime-core/exchange-import.js.map +1 -0
  183. package/dist/runtime-core/exchange-store.d.ts +157 -0
  184. package/dist/runtime-core/exchange-store.js +453 -0
  185. package/dist/runtime-core/exchange-store.js.map +1 -0
  186. package/dist/runtime-core/topology-services.d.ts +38 -0
  187. package/dist/runtime-core/topology-services.js +171 -0
  188. package/dist/runtime-core/topology-services.js.map +1 -0
  189. package/dist/runtime-core/topology-sessions.d.ts +52 -0
  190. package/dist/runtime-core/topology-sessions.js +239 -0
  191. package/dist/runtime-core/topology-sessions.js.map +1 -0
  192. package/dist/runtime-core/topology-store.d.ts +171 -0
  193. package/dist/runtime-core/topology-store.js +420 -0
  194. package/dist/runtime-core/topology-store.js.map +1 -0
  195. package/dist/runtime-core/topology-worktrees.d.ts +60 -0
  196. package/dist/runtime-core/topology-worktrees.js +200 -0
  197. package/dist/runtime-core/topology-worktrees.js.map +1 -0
  198. package/dist/runtime-migration.d.ts +69 -0
  199. package/dist/runtime-migration.js +399 -0
  200. package/dist/runtime-migration.js.map +1 -0
  201. package/dist/session-bootstrap.d.ts +8 -6
  202. package/dist/session-bootstrap.js +51 -158
  203. package/dist/session-bootstrap.js.map +1 -1
  204. package/dist/session-runtime.d.ts +2 -0
  205. package/dist/session-runtime.js +1 -0
  206. package/dist/session-runtime.js.map +1 -1
  207. package/dist/session-semantics.d.ts +12 -4
  208. package/dist/session-semantics.js +14 -0
  209. package/dist/session-semantics.js.map +1 -1
  210. package/dist/shell-hooks.js +32 -10
  211. package/dist/shell-hooks.js.map +1 -1
  212. package/dist/shell-state.d.ts +2 -0
  213. package/dist/shell-state.js +26 -1
  214. package/dist/shell-state.js.map +1 -1
  215. package/dist/statusline-model.d.ts +10 -2
  216. package/dist/statusline-model.js +106 -30
  217. package/dist/statusline-model.js.map +1 -1
  218. package/dist/task-workflow.d.ts +6 -9
  219. package/dist/task-workflow.js +37 -84
  220. package/dist/task-workflow.js.map +1 -1
  221. package/dist/tasks.d.ts +6 -33
  222. package/dist/tasks.js +46 -88
  223. package/dist/tasks.js.map +1 -1
  224. package/dist/team.d.ts +29 -0
  225. package/dist/team.js +40 -0
  226. package/dist/team.js.map +1 -1
  227. package/dist/threads.d.ts +6 -35
  228. package/dist/threads.js +89 -98
  229. package/dist/threads.js.map +1 -1
  230. package/dist/tmux/inbox-popup.js +37 -15
  231. package/dist/tmux/inbox-popup.js.map +1 -1
  232. package/dist/tmux/runtime-manager.d.ts +3 -0
  233. package/dist/tmux/runtime-manager.js +21 -4
  234. package/dist/tmux/runtime-manager.js.map +1 -1
  235. package/dist/tmux/statusline.js +49 -9
  236. package/dist/tmux/statusline.js.map +1 -1
  237. package/dist/tmux/window-open.js +1 -2
  238. package/dist/tmux/window-open.js.map +1 -1
  239. package/dist/tool-output-watchers.d.ts +0 -18
  240. package/dist/tool-output-watchers.js +0 -322
  241. package/dist/tool-output-watchers.js.map +1 -1
  242. package/dist/tui/screens/dashboard-renderers.js +37 -25
  243. package/dist/tui/screens/dashboard-renderers.js.map +1 -1
  244. package/dist/tui/screens/overlay-renderers.d.ts +2 -0
  245. package/dist/tui/screens/overlay-renderers.js +37 -1
  246. package/dist/tui/screens/overlay-renderers.js.map +1 -1
  247. package/dist/tui/screens/subscreen-renderers.js +7 -0
  248. package/dist/tui/screens/subscreen-renderers.js.map +1 -1
  249. package/dist/worktree.js +17 -0
  250. package/dist/worktree.js.map +1 -1
  251. package/dist-ui/_expo/static/css/web-30453ede1678c16acb08b97e83e8646d.css +1 -0
  252. package/dist-ui/_expo/static/js/web/entry-477c745b2adc79367a4380ecf07d9ff6.js +14620 -0
  253. package/dist-ui/assets/assets/images/icon.a5413dcd2e811c9f2317d01a28118d8a.png +0 -0
  254. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
  255. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
  256. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
  257. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
  258. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
  259. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
  260. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
  261. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
  262. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
  263. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
  264. package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
  265. package/dist-ui/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
  266. package/dist-ui/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
  267. package/dist-ui/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
  268. package/dist-ui/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
  269. package/dist-ui/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
  270. package/dist-ui/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
  271. package/dist-ui/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
  272. package/dist-ui/favicon.ico +0 -0
  273. package/dist-ui/index.html +38 -0
  274. package/dist-ui/metadata.json +1 -0
  275. package/package.json +28 -12
  276. package/dist/agent-message-parts.d.ts +0 -17
  277. package/dist/agent-message-parts.js +0 -31
  278. package/dist/agent-message-parts.js.map +0 -1
  279. package/dist/instance-directory.d.ts +0 -32
  280. package/dist/instance-directory.js +0 -82
  281. package/dist/instance-directory.js.map +0 -1
  282. package/dist/instance-registry.d.ts +0 -39
  283. package/dist/instance-registry.js +0 -208
  284. package/dist/instance-registry.js.map +0 -1
  285. package/dist/multiplexer/session-actions.d.ts +0 -40
  286. package/dist/multiplexer/session-actions.js +0 -110
  287. package/dist/multiplexer/session-actions.js.map +0 -1
  288. package/dist/orchestration-dispatcher.d.ts +0 -25
  289. package/dist/orchestration-dispatcher.js +0 -59
  290. package/dist/orchestration-dispatcher.js.map +0 -1
  291. package/dist/session-input-operations.d.ts +0 -19
  292. package/dist/session-input-operations.js +0 -46
  293. package/dist/session-input-operations.js.map +0 -1
  294. package/dist/session-message-history.d.ts +0 -27
  295. package/dist/session-message-history.js +0 -105
  296. package/dist/session-message-history.js.map +0 -1
  297. package/dist/task-dispatcher.d.ts +0 -64
  298. package/dist/task-dispatcher.js +0 -213
  299. package/dist/task-dispatcher.js.map +0 -1
package/README.md CHANGED
@@ -16,8 +16,8 @@ aimux uses `tmux` as its terminal runtime substrate. Each project gets its own m
16
16
  - **Dashboard view** — see all running, offline, and remote agents at a glance
17
17
  - **Multi-instance** — run aimux in multiple terminal tabs; agents from other instances appear inline and can be taken over
18
18
  - **Agent lifecycle** — two-step kill (`[x]` stops → offline, `[x]` again → graveyard), with `aimux graveyard resurrect` for recovery
19
- - **Task delegation** — agents can delegate work to each other via `.aimux/tasks/`, with automatic dispatch, completion notifications, and dashboard badges
20
- - **Threaded orchestration** — direct messages, handoffs, and task assignment all flow through durable `.aimux/threads/` state with queued delivery when recipients are busy
19
+ - **Task delegation** — agents can create explicit handoff records in `.aimux/tasks/`; users and control-plane clients can coordinate teammate work through the metadata API
20
+ - **Threaded orchestration** — direct messages, handoffs, and task assignment all flow through durable `.aimux/threads/` state and explicit user/agent workflow actions
21
21
  - **Dashboard orchestration actions** — from the main dashboard, use `S` to send a message, `H` to send a handoff, `T` to assign a task, `o` to jump to the most relevant thread, and `R` to reply when something is waiting on you
22
22
  - **Workflow view** — a dedicated workflow screen groups related task/review/revision chains, supports actionable filters, and exposes explicit accept/block/complete/reopen/review controls
23
23
  - **Next-action guidance** — dashboard rows and details surface `on me`, `blocked`, family-chain pressure, and the single most relevant next orchestration step
@@ -50,7 +50,7 @@ curl -fsSL https://raw.githubusercontent.com/TraderSamwise/aimux/master/scripts/
50
50
  ```
51
51
 
52
52
  This installs the bundled release under `~/.aimux/native/` and links `aimux` into `~/.local/bin`.
53
- It still requires Node.js >= 18 and `tmux` in `PATH`; it does not require npm/yarn on the target machine.
53
+ It still requires Node.js >= 24 and `tmux` in `PATH`; it does not require npm/yarn on the target machine.
54
54
 
55
55
  To install a specific version:
56
56
 
@@ -58,6 +58,15 @@ To install a specific version:
58
58
  curl -fsSL https://raw.githubusercontent.com/TraderSamwise/aimux/master/scripts/install.sh | AIMUX_VERSION=0.1.13 sh
59
59
  ```
60
60
 
61
+ To install a frozen local build from the current checkout:
62
+
63
+ ```bash
64
+ AIMUX_RELEASE_VERSION=0.1.16-local.$(git rev-parse --short HEAD) yarn release:asset
65
+ scripts/install.sh release/aimux-darwin-arm64.tar.gz
66
+ ```
67
+
68
+ That keeps `aimux` as a stable installed artifact under `~/.aimux/native/` instead of a live symlink to the repository.
69
+
61
70
  ### Build from source
62
71
 
63
72
  ```bash
@@ -71,7 +80,33 @@ yarn build
71
80
  yarn link
72
81
  ```
73
82
 
74
- Requires Node.js >= 18 and `tmux` in `PATH`.
83
+ Requires Node.js >= 24 and `tmux` in `PATH`.
84
+
85
+ ### Develop the App from Source
86
+
87
+ The browser/mobile client lives in `app/` and talks to the local aimux daemon.
88
+
89
+ ```bash
90
+ yarn install
91
+ cp app/.env.example app/.env
92
+ yarn dev:gui:web # web app + local daemon
93
+ yarn dev:gui:ios # build/install/open iOS simulator dev build
94
+ yarn dev:gui:android # build/install/open Android emulator dev build
95
+ ```
96
+
97
+ Use `aimux-dev` for repo-linked Aimux development. It uses `~/.aimux-dev`, daemon port `43191`, development defaults, and the local web app at `http://localhost:8081`. Keep `aimux` reserved for stable/prod-like project work and remote auth against `https://aimux.app`.
98
+
99
+ For an already-installed native dev build:
100
+
101
+ ```bash
102
+ yarn build
103
+ node bin/aimux-dev daemon ensure
104
+ cd app
105
+ yarn dev:native:local
106
+ ```
107
+
108
+ Only one Expo/Metro process can own port `8081`. If the simulator loads another
109
+ app's JavaScript bundle, stop that other Expo process and restart Aimux Metro.
75
110
 
76
111
  ## Quick Start
77
112
 
@@ -121,12 +156,12 @@ Each active project may have one daemon-managed project service. That project se
121
156
 
122
157
  There is no per-project host election anymore. Dashboard processes are clients, not control-plane owners.
123
158
 
124
- Desktop/Tauri now talks to the live control plane directly:
159
+ The user-facing client (browser + mobile) at `app/` talks to the live control plane directly:
125
160
 
126
161
  - daemon HTTP is used for project discovery / service discovery
127
162
  - project-service HTTP is used for live project state and awaited lifecycle actions
128
- - `statusline.json` remains a derived artifact for tmux/status/debugging, not the desktop's primary transport
129
- - desktop loading state should clear on heartbeat reconciliation of the expected state change, not on HTTP return alone
163
+ - `statusline.json` remains a derived artifact for tmux/status/debugging, not the client's primary transport
164
+ - client loading state should clear on heartbeat reconciliation of the expected state change, not on HTTP return alone
130
165
 
131
166
  Terminal clients are isolated from each other:
132
167
 
@@ -187,13 +222,9 @@ aimux worktree create feature-x --project /abs/path/to/repo --json
187
222
  desktop terminal focus now uses the thin tmux fast-control entrypoint via the project service and terminal client tty
188
223
  ```
189
224
 
190
- HTTP-backed agent I/O helpers:
225
+ HTTP-backed agent output helpers:
191
226
 
192
227
  ```bash
193
- # Send raw input to a running agent through the project service
194
- aimux host agent-send <sessionId> "hello\r"
195
- printf 'hello\r' | aimux host agent-send <sessionId> --stdin
196
-
197
228
  # Read a tmux pane snapshot for a running agent
198
229
  aimux host agent-read <sessionId> --start-line -80
199
230
 
@@ -208,21 +239,10 @@ Ephemeral project events:
208
239
  curl -N http://127.0.0.1:<project-service-port>/events
209
240
  ```
210
241
 
211
- These commands are additive control-plane helpers on top of the existing `aimux -> tmux -> codex/claude` runtime. They do not replace the native TUI path; they reuse the same session write path and tmux pane capture path through the project HTTP service.
242
+ These commands are additive control-plane helpers on top of the existing `aimux -> tmux -> codex/claude` runtime. They do not replace the native TUI path; they reuse the tmux pane capture path through the project HTTP service.
212
243
 
213
244
  For desktop / GUI callers, prefer explicit `--project` usage instead of relying on launcher cwd.
214
245
 
215
- Structured message parts:
216
-
217
- - `POST /agents/input` accepts either plain `data` or ordered `parts`.
218
- - `parts` currently supports:
219
- - `{ "type": "text", "text": "..." }`
220
- - `{ "type": "image", "path": "/abs/path.png", "alt": "..." }`
221
- - `{ "type": "image", "url": "https://...", "alt": "..." }`
222
- - `{ "type": "image", "attachmentId": "att_123", "alt": "..." }`
223
- - Parts preserve inline ordering for GUI / HTTP callers.
224
- - Today, tmux-backed agent sessions still receive image parts as explicit inline image descriptors in the prompt text. This preserves message structure now, but it is not yet binary image upload/attachment transport.
225
-
226
246
  Example:
227
247
 
228
248
  ```json
@@ -239,9 +259,28 @@ Example:
239
259
 
240
260
  Runtime health:
241
261
 
242
- - The desktop UI now surfaces project-runtime health and exposes a repair/restart control path.
243
262
  - The tmux statusline shows `ctl ok`, `ctl daemon↓`, or `ctl stale`.
244
263
  - `ctl stale` means the project-service `statusline.json` snapshot has stopped updating, which usually means the project service died.
264
+ - Persistent runtime logging is disabled by default. Enable it with config, env, or CLI flags when reproducing a bug:
265
+
266
+ ```bash
267
+ aimux --debug
268
+ AIMUX_LOG=1 AIMUX_LOG_LEVEL=debug aimux
269
+ AIMUX_LOG=1 AIMUX_LOG_CATEGORIES=daemon,session,tmux aimux
270
+ ```
271
+
272
+ - Project logs are written under `~/.aimux/projects/<project-id>/logs/aimux.jsonl`.
273
+ - Daemon logs are written under `~/.aimux/daemon/logs/daemon.jsonl`.
274
+ - Child stdout/stderr is captured separately as `daemon-stdio.log` or `project-service-stdio.log` when logging is enabled.
275
+
276
+ ```bash
277
+ aimux logs path
278
+ aimux logs tail -n 100
279
+ aimux logs path --daemon
280
+ aimux logs tail --daemon
281
+ aimux logs clear
282
+ ```
283
+
245
284
  - Manual recovery is now:
246
285
 
247
286
  ```bash
@@ -277,21 +316,73 @@ Navigation ownership rule:
277
316
  - [src/tmux/control-script.test.ts](src/tmux/control-script.test.ts)
278
317
  - Do not clone “similar” ordering logic in the Node runtime for live-pane shortcuts. If the user is pointing at the visible live footer chips and references `n/p`, the shortcut belongs to the tmux layer unless there is a strong reason otherwise.
279
318
 
280
- The desktop app now exposes these flows directly over daemon/project-service HTTP:
319
+ The browser/mobile client at `app/` exposes these flows directly over daemon (port 43190) and per-project metadata-server HTTP:
281
320
 
282
- - dashboard worktree/agent management
283
- - spawn, fork, rename, migrate, stop, kill
284
- - graveyard browse + resurrect
321
+ - dashboard monitoring and read-only session views
322
+ - graveyard browsing
285
323
  - worktree create + remove
286
324
  - activity, workflow, threads, plans, and graveyard secondary screens
287
- - direct message compose, handoff send/accept/complete, and task/review workflow actions
288
- - thread state updates and per-message delivery visibility
325
+ - thread and workflow visibility
289
326
 
290
327
  For the lifecycle model, see [docs/runtime-lifecycle.md](docs/runtime-lifecycle.md).
291
328
  For the current source of truth, see [docs/current-architecture.md](docs/current-architecture.md).
292
- For desktop UI integration details, see [docs/desktop-ui-contract.md](docs/desktop-ui-contract.md).
329
+ For the original Tauri/Svelte client contract (historical, superseded by `app/`), see [docs/desktop-ui-contract.md](docs/desktop-ui-contract.md).
293
330
  For the migration rationale, see [docs/global-control-plane-rfc.md](docs/global-control-plane-rfc.md).
294
331
 
332
+ ## Web / Mobile Client (`app/`)
333
+
334
+ The user-facing browser and native clients live in `app/` as a single Expo Router + React Native project. The same code targets web (browser), iOS, and Android.
335
+
336
+ For GUI and daemon development, use the isolated `aimux-dev` runtime so your real
337
+ `aimux` daemon and active work sessions keep running:
338
+
339
+ ```bash
340
+ aimux-dev daemon restart
341
+ aimux-dev daemon project-ensure --project /Users/sam/cs/glyde-frontend
342
+ cd app
343
+ yarn dev:web:local
344
+ ```
345
+
346
+ See [docs/dev-runtime.md](docs/dev-runtime.md) for the full local GUI/backend loop.
347
+
348
+ ```bash
349
+ cd app
350
+ yarn install
351
+ yarn dev:web:local # browser client on http://localhost:8081
352
+ yarn dev:native:local # Metro for an installed native dev build
353
+ yarn dev:ios:local # build/install/open iOS simulator dev build, not Expo Go
354
+ yarn dev:android:local # build/install/open Android emulator dev build
355
+ ```
356
+
357
+ The app talks to two HTTP surfaces:
358
+
359
+ - the global aimux daemon at `http://localhost:43190` for project discovery
360
+ - per-project metadata servers (port supplied via `/projects` response) for state, agent I/O, plans, and the `/events` SSE stream
361
+
362
+ For a built local web UI without Cloudflare relay or hosted auth, run:
363
+
364
+ ```bash
365
+ aimux ui --open
366
+ ```
367
+
368
+ `aimux ui` serves the exported first-party web app from the local machine, ensures
369
+ the loopback daemon is running, and injects local runtime config for the daemon
370
+ port. The UI server binds to `127.0.0.1:43192` by default; use `--port` to choose
371
+ a different local UI port.
372
+
373
+ For simulator-local development, the helper scripts use `http://127.0.0.1:43191`
374
+ for iOS and `http://10.0.2.2:43191` for Android. For mobile use against a remote
375
+ machine, set `EXPO_PUBLIC_AIMUX_DAEMON_URL=http://<machine>:43190` in `app/.env`.
376
+
377
+ Release pipeline (uses EAS):
378
+
379
+ ```bash
380
+ cd app
381
+ yarn version:bump-build # new native build
382
+ yarn build:testflight # EAS build → TestFlight
383
+ yarn update # OTA JS-only update (testflight channel)
384
+ ```
385
+
295
386
  ## Tmux Compatibility
296
387
 
297
388
  Aimux treats tmux as a managed runtime, not a transparent pass-through. For aimux-owned tmux sessions, aimux applies a fixed compatibility contract instead of inheriting whatever ambient tmux defaults happen to exist on the machine.
@@ -433,6 +524,17 @@ The project-service HTTP API also exposes:
433
524
 
434
525
  Use `aimux metadata endpoint` to get the local base URL for the current project service.
435
526
 
527
+ Teammate agents are first-party aimux agents attached to a parent agent. They stay hidden from the normal dashboard unless the parent agent is focused, but can still be inspected, entered, stopped, restarted, and graveyarded through the parent/team UI. Programmatic teammate lifecycle routes are control-plane internals; agents should use `.aimux/tasks/*.json` handoff records unless the user gives an explicit CLI/API command.
528
+
529
+ Dashboard navigation exposes only the selected parent's direct team:
530
+
531
+ - On the dashboard, select a parent agent and press `e` to open its teammate picker.
532
+ - In an attached agent pane, press `Ctrl-A e` to toggle between the parent and its first/active teammate.
533
+ - `Ctrl-A n/p` stays within the current plane: root agent/service panes before `Ctrl-A e`, direct teammates after `Ctrl-A e`.
534
+ - Non-selected parents do not expose their teammates in dashboard rows, details, or footer chips.
535
+
536
+ Direct teammate teams are capped at 3 agents. Creating a teammate is idempotent by normalized `role` + `label` for the same parent: if that direct teammate already exists, aimux returns it instead of creating a duplicate.
537
+
436
538
  ## Plugins And Watchers
437
539
 
438
540
  Aimux can load local metadata plugins from:
@@ -515,13 +617,13 @@ aimux records each agent's conversation and makes it available to other agents:
515
617
  - **`.aimux/context/{session-id}/summary.checkpoints.jsonl`** — append-only compaction checkpoints
516
618
  - **`.aimux/history/{session-id}.jsonl`** — full raw conversation log
517
619
  - **`.aimux/plans/{session-id}.md`** — canonical shared plan for that agent
518
- - **`.aimux/sessions.json`** — all running agents (so agents can discover each other)
620
+ - **`.aimux/tasks/{task-id}.json`** — explicit handoff records when the user asks for delegation
519
621
 
520
622
  Agents are told about these files in their startup preamble.
521
623
 
522
624
  These are the canonical agent-facing paths. Runtime-private state stays under `~/.aimux/projects/<project-id>/...` and is not part of the agent contract.
523
625
 
524
- In tmux mode, live terminal state comes from tmux itself. `~/.aimux/projects/<project-id>/state.json` is mainly for offline/resume metadata, not live screen ownership.
626
+ In tmux mode, live terminal state comes from tmux itself. Runtime topology is stored in `~/.aimux/projects/<project-id>/runtime-topology.yaml`; `~/.aimux/projects/<project-id>/state.json` is service/project state and is not the agent session source of truth.
525
627
 
526
628
  Memory roles are explicit:
527
629
 
@@ -547,11 +649,11 @@ Tool behavior differs:
547
649
 
548
650
  - `Claude`
549
651
  - supports clean preamble injection
550
- - does **not** support backend-session-id resume in the way aimux originally assumed
551
- - so `fork` and fallback `migrate` rely on aimux-owned continuity artifacts
652
+ - supports exact backend-session-id resume when aimux starts it with `--session-id {id}` and restores it with `--resume {id}`
653
+ - targeted dashboard restore must use that exact id or fail loudly; it must not fall back to `--continue`
552
654
  - `Codex`
553
655
  - supports backend-session-id resume, so `migrate` usually takes the native resume path
554
- - does **not** currently have a clean startup handoff flag, so `fork` uses seeded files plus an auto-submitted first-turn kickoff
656
+ - uses `developer_instructions` for clean startup and fork/migration continuity, with seeded files as durable carried-over context
555
657
 
556
658
  For deeper details, see [docs/tool-integration.md](docs/tool-integration.md).
557
659
 
@@ -572,7 +674,7 @@ Each new session gets a stub plan file. Agents are instructed to keep it current
572
674
 
573
675
  ## Task Delegation
574
676
 
575
- Agents can delegate work to each other through the aimux task system. This is a file-based protocol agents create task files, aimux dispatches them, and agents report results.
677
+ Agents can coordinate handoffs through `.aimux/tasks/*.json` when the user explicitly asks for delegation or handoff. These files are a shared record format; they are not an alternate live agent lifecycle or persistence layer.
576
678
 
577
679
  ### How it works
578
680
 
@@ -589,37 +691,34 @@ Agents can delegate work to each other through the aimux task system. This is a
589
691
  }
590
692
  ```
591
693
 
592
- 2. **Aimux detects** the pending task (checks every 2s) and finds an idle agent to handle it
694
+ 2. **A target agent or user picks it up** through an explicit handoff or manual coordination
593
695
 
594
- 3. **The task prompt is injected** into the target agent's stdin the agent sees it as input and starts working
696
+ 3. **The receiving agent works from the task prompt** and treats the task file as durable coordination state
595
697
 
596
698
  4. **The agent completes the work** and updates the task file with `"status": "done"` and a `"result"` summary
597
699
 
598
- 5. **Aimux notifies** the original agent that the task is complete
700
+ 5. **The original agent or user reviews** the result from the shared task record
599
701
 
600
702
  ### Targeting
601
703
 
602
- Tasks can be targeted in three ways:
704
+ Tasks can carry routing metadata:
603
705
 
604
- - **Specific agent**: set `assignedTo` to a session ID from `.aimux/sessions.json`
605
- - **By tool type**: set `tool` to `"claude"`, `"codex"`, or `"aider"` dispatched to the first idle agent of that type
606
- - **Any idle agent**: omit both fields dispatched to any available idle agent
706
+ - **Specific agent**: set `assignedTo` to the intended aimux session ID
707
+ - **By tool type**: set `tool` to `"claude"`, `"codex"`, or `"aider"` as a preferred tool hint
708
+ - **Untargeted**: omit both fields for a general handoff record
607
709
 
608
710
  ### Dashboard indicators
609
711
 
610
- - Sessions with active tasks show a purple `⧫` badge with the task description
611
- - The dashboard footer shows task counts: `[T:2p/1a]` (2 pending, 1 assigned)
612
- - Flash notifications appear when tasks are assigned, completed, or failed
712
+ The dashboard and metadata APIs expose teammate and task workflow state where those flows are active. The runtime topology remains authoritative for session lifecycle.
613
713
 
614
714
  ### Using it
615
715
 
616
- Just ask your agent to delegate. The preamble tells agents exactly how the protocol works. For example:
716
+ Ask your agent to delegate or hand off when you want a task file created. For example:
617
717
 
618
718
  > "Delegate the test writing to another agent"
619
-
620
719
  > "Hand off the CSS cleanup to the codex agent"
621
720
 
622
- The agent will create the task file, and aimux handles the rest. This is separate from any native task system in the underlying tools (like Claude Code's internal tasks).
721
+ The agent creates the task file. Control-plane callers may expose teammate workflow APIs where configured, but agents should not call aimux metadata APIs themselves. This is separate from any native task system in the underlying tools (like Claude Code's internal tasks).
623
722
 
624
723
  ## Custom Instructions
625
724
 
@@ -648,6 +747,13 @@ This creates `.aimux/config.json`. You can also create a global config at `~/.ai
648
747
  "sessionPrefix": "aimux"
649
748
  }
650
749
  },
750
+ "logging": {
751
+ "enabled": false,
752
+ "level": "info",
753
+ "categories": ["*"],
754
+ "maxBytes": 10000000,
755
+ "maxFiles": 5
756
+ },
651
757
  "notifications": {
652
758
  "enabled": true,
653
759
  "onPrompt": true,
@@ -668,6 +774,15 @@ Tmux runtime:
668
774
 
669
775
  - `sessionPrefix` — deterministic prefix used for managed per-project tmux sessions
670
776
 
777
+ Logging:
778
+
779
+ - `enabled` — persist structured JSONL runtime logs
780
+ - `level` — `error`, `warn`, `info`, `debug`, or `trace`
781
+ - `categories` — category allowlist, or `["*"]`
782
+ - `maxBytes` / `maxFiles` — simple file rotation limits
783
+ - CLI overrides: `--debug`, `--trace`, `--log-level <level>`, `--log-category <a,b>`
784
+ - Env overrides: `AIMUX_LOG`, `AIMUX_LOG_LEVEL`, `AIMUX_LOG_CATEGORIES`
785
+
671
786
  ### Tool Configuration
672
787
 
673
788
  All tool behavior is config-driven. No tool-specific code exists in the multiplexer — adding or customizing a tool only requires config:
@@ -683,15 +798,10 @@ All tool behavior is config-driven. No tool-specific code exists in the multiple
683
798
  "resumeArgs": ["--resume", "{sessionId}"],
684
799
  "resumeFallback": ["--continue"],
685
800
  "sessionIdFlag": ["--session-id", "{sessionId}"],
686
- "sessionCapture": {
687
- "dir": "{home}/.my-tool/sessions/{yyyy}/{mm}/{dd}",
688
- "pattern": "([0-9a-f-]+)\\.json$",
689
- "delayMs": 2000
690
- },
691
801
  "promptPatterns": ["^> $", "^\\$ $"],
692
802
  "turnPatterns": ["^[>❯]\\s*(.+)"],
693
803
  "compactCommand": "claude --print --output-format text",
694
- "instructionsFile": "AGENTS.md"
804
+ "developerInstructionsConfigKey": "developer_instructions"
695
805
  }
696
806
  }
697
807
  }
@@ -701,22 +811,29 @@ All tool behavior is config-driven. No tool-specific code exists in the multiple
701
811
  |---|---|
702
812
  | `preambleFlag` | Flag to inject system prompt (e.g. `["--append-system-prompt"]`) |
703
813
  | `resumeArgs` | Args to resume a session, with `{sessionId}` placeholder |
704
- | `resumeFallback` | Fallback resume args when session ID is unavailable |
814
+ | `resumeByBackendSessionId` | Whether aimux's stored backend id is safe to pass to `resumeArgs` |
815
+ | `resumeFallback` | Non-specific fallback resume args for explicit latest-session flows; targeted dashboard restore must not use these |
705
816
  | `sessionIdFlag` | Flag to set session ID at spawn time |
706
- | `sessionCapture` | Filesystem-based session ID capture (dir, regex pattern, delay) |
707
817
  | `promptPatterns` | Regex patterns for idle/prompt detection in status bar |
708
818
  | `turnPatterns` | Regex patterns for extracting conversation turns from output |
709
819
  | `compactCommand` | Shell command for LLM-powered history compaction |
710
- | `instructionsFile` | File to write preamble to (for tools without system prompt flags) |
820
+ | `instructionsFile` | Optional opt-in file to merge aimux's managed standing instructions into; disabled by default so aimux does not create `AGENTS.md` |
821
+ | `developerInstructionsConfigKey` | Codex config key for model-visible standing instructions, normally `developer_instructions`; set to `null` only when you do not want aimux to inject Codex startup instructions |
822
+
823
+ Codex startup instructions use `-c developer_instructions=...` when configured. Aimux does not create `AGENTS.md` by default; existing user-authored `AGENTS.md` files are still read by Codex itself. Verify the installed Codex CLI exposes the developer-instructions channel with:
824
+
825
+ ```bash
826
+ yarn verify:codex-instructions
827
+ ```
711
828
 
712
- ## Multi-Instance
829
+ ## Multi-Client Runtime
713
830
 
714
- Run aimux in multiple terminal tabs for the same project. Each instance registers in `.aimux/instances.json` with a heartbeat. Agents from other instances appear inline in the dashboard with a `◈` icon.
831
+ Run aimux in multiple terminal tabs or through the dashboard for the same project. Session lifecycle, ownership, graveyard state, and exact resume identity live in runtime topology.
715
832
 
716
- - **Enter** on a remote agent takes it over (resumes in your instance)
717
- - `--resume` skips agents already owned by another live instance
718
- - When an instance exits, its agents become offline and visible to other instances
719
- - Dead instances are auto-pruned via PID checks and heartbeat staleness
833
+ - `.aimux/instances.json` is legacy and is not an active liveness or ownership source.
834
+ - Remote/share presence belongs to relay/share transport state unless explicitly mirrored from topology.
835
+ - `--resume` does not use instance-registry session refs for ownership decisions.
836
+ - When a runtime exits, topology-backed offline rows keep agents visible to other clients.
720
837
 
721
838
  ## Agent Lifecycle
722
839
 
@@ -777,7 +894,7 @@ Relative `baseDir` values are resolved from the main repo root. Absolute paths a
777
894
  ## Requirements
778
895
 
779
896
  - macOS (Linux support planned)
780
- - Node.js >= 18
897
+ - Node.js >= 24
781
898
  - At least one supported AI tool installed: `claude`, `codex`, or `aider`
782
899
  - Notifications work out of the box on macOS, Linux, and Windows
783
900
 
package/bin/aimux-dev ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+
5
+ process.env.AIMUX_HOME ||= join(homedir(), ".aimux-dev");
6
+ process.env.AIMUX_DAEMON_PORT ||= "43191";
7
+ process.env.AIMUX_ENV ||= "development";
8
+ process.env.AIMUX_WEB_APP_URL ||= "http://localhost:8081";
9
+
10
+ import("../dist/main.js");
@@ -0,0 +1,21 @@
1
+ import type { SessionMetadata } from "./metadata-store.js";
2
+ import type { AlertEvent, AlertKind } from "./project-events.js";
3
+ export interface SessionAlertDisplayContext {
4
+ label?: string;
5
+ command?: string;
6
+ worktreePath?: string;
7
+ worktreeName?: string;
8
+ branch?: string;
9
+ }
10
+ export type AlertPublishInput = Omit<AlertEvent, "type" | "projectId" | "ts"> & {
11
+ dedupeKey?: string;
12
+ cooldownMs?: number;
13
+ forceNotify?: boolean;
14
+ };
15
+ export declare function compactSessionId(sessionId: string): string;
16
+ export declare function metadataDisplayContext(metadata?: SessionMetadata): SessionAlertDisplayContext;
17
+ export declare function mergeDisplayContext(base: SessionAlertDisplayContext, override: SessionAlertDisplayContext): SessionAlertDisplayContext;
18
+ export declare function displayWorktreeLabel(context: SessionAlertDisplayContext): string | undefined;
19
+ export declare function sessionAlertSubject(sessionId: string | undefined, context: SessionAlertDisplayContext | undefined): string | undefined;
20
+ export declare function sessionAlertTitle(kind: AlertKind, sessionId: string | undefined, fallback: string | undefined, context?: SessionAlertDisplayContext): string;
21
+ export declare function contextualizeAlertInput(input: AlertPublishInput, context?: SessionAlertDisplayContext): AlertPublishInput;
@@ -0,0 +1,86 @@
1
+ import { basename } from "node:path";
2
+ export function compactSessionId(sessionId) {
3
+ const compact = sessionId.replace(/-[a-z0-9]{4,}$/i, "");
4
+ return compact || sessionId;
5
+ }
6
+ export function metadataDisplayContext(metadata) {
7
+ return {
8
+ worktreePath: metadata?.context?.worktreePath,
9
+ worktreeName: metadata?.context?.worktreeName,
10
+ branch: metadata?.context?.branch,
11
+ };
12
+ }
13
+ export function mergeDisplayContext(base, override) {
14
+ return {
15
+ label: override.label ?? base.label,
16
+ command: override.command ?? base.command,
17
+ worktreePath: override.worktreePath ?? base.worktreePath,
18
+ worktreeName: override.worktreeName ?? base.worktreeName,
19
+ branch: override.branch ?? base.branch,
20
+ };
21
+ }
22
+ export function displayWorktreeLabel(context) {
23
+ const worktreeName = context.worktreeName?.trim();
24
+ const branch = context.branch?.trim();
25
+ if (worktreeName)
26
+ return worktreeName;
27
+ if (branch)
28
+ return branch;
29
+ const path = context.worktreePath?.trim();
30
+ return path ? basename(path) : undefined;
31
+ }
32
+ export function sessionAlertSubject(sessionId, context) {
33
+ if (!sessionId)
34
+ return undefined;
35
+ const label = context?.label?.trim() || context?.command?.trim() || compactSessionId(sessionId);
36
+ const worktree = context ? displayWorktreeLabel(context) : undefined;
37
+ return worktree ? `${label} @ ${worktree}` : label;
38
+ }
39
+ export function sessionAlertTitle(kind, sessionId, fallback, context) {
40
+ const title = fallback?.trim();
41
+ const subject = sessionAlertSubject(sessionId, context);
42
+ if (!subject)
43
+ return title || "aimux";
44
+ if (kind === "needs_input")
45
+ return `${subject} needs input`;
46
+ if (kind === "blocked") {
47
+ if (!title || (sessionId && title === `${sessionId} is blocked`))
48
+ return `${subject} is blocked`;
49
+ return title;
50
+ }
51
+ if (kind === "task_failed") {
52
+ if (!title || (sessionId && (title === `${sessionId} errored` || title === `${sessionId} failed`))) {
53
+ return `${subject} errored`;
54
+ }
55
+ return title;
56
+ }
57
+ if (kind === "task_done") {
58
+ if (!title || (sessionId && title === `${sessionId} finished`))
59
+ return `${subject} finished`;
60
+ const genericTitles = new Set([
61
+ context?.label?.trim(),
62
+ context?.command?.trim(),
63
+ compactSessionId(sessionId ?? ""),
64
+ "service",
65
+ "shell",
66
+ ]);
67
+ if (genericTitles.has(title))
68
+ return `${subject} finished`;
69
+ return title;
70
+ }
71
+ if (!title)
72
+ return subject;
73
+ if (title.includes(subject))
74
+ return title;
75
+ if (sessionId && title.includes(sessionId))
76
+ return title.replace(sessionId, subject);
77
+ return `${subject}: ${title}`;
78
+ }
79
+ export function contextualizeAlertInput(input, context) {
80
+ return {
81
+ ...input,
82
+ title: sessionAlertTitle(input.kind, input.sessionId, input.title, context),
83
+ worktreePath: input.worktreePath ?? context?.worktreePath,
84
+ };
85
+ }
86
+ //# sourceMappingURL=alert-display.js.map
@@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C"}
@@ -20,16 +20,9 @@ export interface PublicAttachmentRecord {
20
20
  source: "path" | "upload";
21
21
  contentUrl: string;
22
22
  }
23
- export declare function ingestAttachmentFromPath(path: string): PublicAttachmentRecord;
24
- export declare function ingestAttachmentFromBase64(input: {
25
- contentBase64: string;
26
- filename?: string;
27
- mimeType?: string;
28
- }): PublicAttachmentRecord;
29
23
  export declare function getAttachment(id: string): PublicAttachmentRecord | null;
30
24
  export declare function getAttachmentContent(id: string): {
31
25
  attachment: PublicAttachmentRecord;
32
26
  contentPath: string;
33
27
  buffer: Buffer;
34
28
  } | null;
35
- export declare function resolveAttachmentPath(id: string): string | null;