@bastani/atomic 0.10.2 → 0.10.3

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 (499) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +22 -0
  3. package/dist/builtin/intercom/broker/broker-instance.ts +2 -13
  4. package/dist/builtin/intercom/broker/broker.ts +158 -73
  5. package/dist/builtin/intercom/broker/durable-ended-queue.ts +14 -2
  6. package/dist/builtin/intercom/broker/host-command-environment.ts +13 -0
  7. package/dist/builtin/intercom/broker/hosted-session-errors.ts +1 -0
  8. package/dist/builtin/intercom/broker/multinode-router.ts +111 -16
  9. package/dist/builtin/intercom/broker/multinode-state-store.ts +50 -4
  10. package/dist/builtin/intercom/broker/open-broker-state.ts +5 -4
  11. package/dist/builtin/intercom/broker/spawn.ts +144 -25
  12. package/dist/builtin/intercom/broker/sql-add-column.ts +33 -0
  13. package/dist/builtin/intercom/broker/sql-known-session-store.ts +120 -36
  14. package/dist/builtin/intercom/broker/sql-outbox-store.ts +75 -13
  15. package/dist/builtin/intercom/broker/start-announcement.ts +55 -10
  16. package/dist/builtin/intercom/broker/watchdog.ts +10 -7
  17. package/dist/builtin/intercom/index.bundle.mjs +111 -27
  18. package/dist/builtin/intercom/package.json +1 -1
  19. package/dist/builtin/mcp/package.json +1 -1
  20. package/dist/builtin/subagents/CHANGELOG.md +26 -0
  21. package/dist/builtin/subagents/package.json +1 -1
  22. package/dist/builtin/subagents/skills/skill-creator/SKILL.md +30 -52
  23. package/dist/builtin/subagents/skills/skill-creator/eval-viewer/generate_review.py +34 -40
  24. package/dist/builtin/subagents/skills/skill-creator/eval-viewer/viewer.html +2 -2
  25. package/dist/builtin/subagents/skills/skill-creator/scripts/atomic_cli.py +731 -0
  26. package/dist/builtin/subagents/skills/skill-creator/scripts/generate_report.py +3 -3
  27. package/dist/builtin/subagents/skills/skill-creator/scripts/improve_description.py +41 -38
  28. package/dist/builtin/subagents/skills/skill-creator/scripts/run_eval.py +276 -176
  29. package/dist/builtin/subagents/skills/skill-creator/scripts/run_loop.py +20 -11
  30. package/dist/builtin/subagents/skills/skill-creator/scripts/utils.py +1 -1
  31. package/dist/builtin/subagents/src/extension/index.bundle.mjs +163 -97
  32. package/dist/builtin/web-access/CHANGELOG.md +14 -0
  33. package/dist/builtin/web-access/index.bundle.mjs +5 -4
  34. package/dist/builtin/web-access/package.json +1 -1
  35. package/dist/core/agent-session-auto-compaction.d.ts +10 -1
  36. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  37. package/dist/core/agent-session-auto-compaction.js +54 -2
  38. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  39. package/dist/core/agent-session-compaction.d.ts +4 -0
  40. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  41. package/dist/core/agent-session-compaction.js +17 -2
  42. package/dist/core/agent-session-compaction.js.map +1 -1
  43. package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
  44. package/dist/core/agent-session-custom-message-commit.js +3 -1
  45. package/dist/core/agent-session-custom-message-commit.js.map +1 -1
  46. package/dist/core/agent-session-events.d.ts +2 -0
  47. package/dist/core/agent-session-events.d.ts.map +1 -1
  48. package/dist/core/agent-session-events.js +34 -13
  49. package/dist/core/agent-session-events.js.map +1 -1
  50. package/dist/core/agent-session-export.d.ts.map +1 -1
  51. package/dist/core/agent-session-export.js +3 -0
  52. package/dist/core/agent-session-export.js.map +1 -1
  53. package/dist/core/agent-session-message-queue.d.ts +27 -0
  54. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  55. package/dist/core/agent-session-message-queue.js +213 -30
  56. package/dist/core/agent-session-message-queue.js.map +1 -1
  57. package/dist/core/agent-session-methods.d.ts +6 -1
  58. package/dist/core/agent-session-methods.d.ts.map +1 -1
  59. package/dist/core/agent-session-methods.js.map +1 -1
  60. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  61. package/dist/core/agent-session-prompt.js +35 -3
  62. package/dist/core/agent-session-prompt.js.map +1 -1
  63. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  64. package/dist/core/agent-session-runtime.js +2 -2
  65. package/dist/core/agent-session-runtime.js.map +1 -1
  66. package/dist/core/agent-session-state.d.ts.map +1 -1
  67. package/dist/core/agent-session-state.js +6 -1
  68. package/dist/core/agent-session-state.js.map +1 -1
  69. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  70. package/dist/core/agent-session-tool-hooks.js +15 -2
  71. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  72. package/dist/core/agent-session-typed-queue.d.ts +14 -1
  73. package/dist/core/agent-session-typed-queue.d.ts.map +1 -1
  74. package/dist/core/agent-session-typed-queue.js +26 -1
  75. package/dist/core/agent-session-typed-queue.js.map +1 -1
  76. package/dist/core/agent-session-types.d.ts +5 -0
  77. package/dist/core/agent-session-types.d.ts.map +1 -1
  78. package/dist/core/agent-session-types.js.map +1 -1
  79. package/dist/core/agent-session.d.ts.map +1 -1
  80. package/dist/core/agent-session.js +2 -1
  81. package/dist/core/agent-session.js.map +1 -1
  82. package/dist/core/async-scope.d.ts +9 -4
  83. package/dist/core/async-scope.d.ts.map +1 -1
  84. package/dist/core/async-scope.js +13 -5
  85. package/dist/core/async-scope.js.map +1 -1
  86. package/dist/core/builtin-diagnostics.js +2 -2
  87. package/dist/core/builtin-diagnostics.js.map +1 -1
  88. package/dist/core/chat-admission-order.d.ts.map +1 -1
  89. package/dist/core/chat-admission-order.js +2 -1
  90. package/dist/core/chat-admission-order.js.map +1 -1
  91. package/dist/core/chat-record-saves.d.ts +4 -0
  92. package/dist/core/chat-record-saves.d.ts.map +1 -0
  93. package/dist/core/chat-record-saves.js +25 -0
  94. package/dist/core/chat-record-saves.js.map +1 -0
  95. package/dist/core/command-deliveries.d.ts +62 -0
  96. package/dist/core/command-deliveries.d.ts.map +1 -0
  97. package/dist/core/command-deliveries.js +139 -0
  98. package/dist/core/command-deliveries.js.map +1 -0
  99. package/dist/core/diagnostic-writer.d.ts.map +1 -1
  100. package/dist/core/diagnostic-writer.js +5 -4
  101. package/dist/core/diagnostic-writer.js.map +1 -1
  102. package/dist/core/extension-startup-close.d.ts +1 -2
  103. package/dist/core/extension-startup-close.d.ts.map +1 -1
  104. package/dist/core/extension-startup-close.js +2 -2
  105. package/dist/core/extension-startup-close.js.map +1 -1
  106. package/dist/core/extensions/jiti-aliases.d.ts +11 -0
  107. package/dist/core/extensions/jiti-aliases.d.ts.map +1 -0
  108. package/dist/core/extensions/jiti-aliases.js +28 -0
  109. package/dist/core/extensions/jiti-aliases.js.map +1 -0
  110. package/dist/core/extensions/loader-api.js +3 -3
  111. package/dist/core/extensions/loader-api.js.map +1 -1
  112. package/dist/core/extensions/loader-bindings.js +2 -2
  113. package/dist/core/extensions/loader-bindings.js.map +1 -1
  114. package/dist/core/extensions/loader-rollback.d.ts +1 -2
  115. package/dist/core/extensions/loader-rollback.d.ts.map +1 -1
  116. package/dist/core/extensions/loader-rollback.js +2 -2
  117. package/dist/core/extensions/loader-rollback.js.map +1 -1
  118. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  119. package/dist/core/extensions/loader-virtual-modules.js +53 -9
  120. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  121. package/dist/core/extensions/native-builtin-entries.d.ts +5 -0
  122. package/dist/core/extensions/native-builtin-entries.d.ts.map +1 -1
  123. package/dist/core/extensions/native-builtin-entries.js +8 -1
  124. package/dist/core/extensions/native-builtin-entries.js.map +1 -1
  125. package/dist/core/extensions/reloadable-scripts.d.ts +21 -2
  126. package/dist/core/extensions/reloadable-scripts.d.ts.map +1 -1
  127. package/dist/core/extensions/reloadable-scripts.js +11 -3
  128. package/dist/core/extensions/reloadable-scripts.js.map +1 -1
  129. package/dist/core/extensions/source-builtin-imports.d.ts +40 -0
  130. package/dist/core/extensions/source-builtin-imports.d.ts.map +1 -0
  131. package/dist/core/extensions/source-builtin-imports.js +142 -0
  132. package/dist/core/extensions/source-builtin-imports.js.map +1 -0
  133. package/dist/core/extensions/transform-graph.d.ts +15 -0
  134. package/dist/core/extensions/transform-graph.d.ts.map +1 -0
  135. package/dist/core/extensions/transform-graph.js +85 -0
  136. package/dist/core/extensions/transform-graph.js.map +1 -0
  137. package/dist/core/extensions/ts-source-specifiers.d.ts +2 -0
  138. package/dist/core/extensions/ts-source-specifiers.d.ts.map +1 -1
  139. package/dist/core/extensions/ts-source-specifiers.js +7 -0
  140. package/dist/core/extensions/ts-source-specifiers.js.map +1 -1
  141. package/dist/core/extensions/ts-transform-worker.d.ts +2 -0
  142. package/dist/core/extensions/ts-transform-worker.d.ts.map +1 -0
  143. package/dist/core/extensions/ts-transform-worker.js +43 -0
  144. package/dist/core/extensions/ts-transform-worker.js.map +1 -0
  145. package/dist/core/message-admission.d.ts.map +1 -1
  146. package/dist/core/message-admission.js +4 -4
  147. package/dist/core/message-admission.js.map +1 -1
  148. package/dist/core/messages.d.ts +5 -0
  149. package/dist/core/messages.d.ts.map +1 -1
  150. package/dist/core/messages.js +35 -0
  151. package/dist/core/messages.js.map +1 -1
  152. package/dist/core/model-fallback-failures.d.ts +1 -1
  153. package/dist/core/model-fallback-failures.d.ts.map +1 -1
  154. package/dist/core/model-fallback-failures.js +18 -1
  155. package/dist/core/model-fallback-failures.js.map +1 -1
  156. package/dist/core/process-start-token.d.ts +7 -0
  157. package/dist/core/process-start-token.d.ts.map +1 -1
  158. package/dist/core/process-start-token.js +14 -0
  159. package/dist/core/process-start-token.js.map +1 -1
  160. package/dist/core/project-trust-electorate.d.ts +24 -0
  161. package/dist/core/project-trust-electorate.d.ts.map +1 -0
  162. package/dist/core/project-trust-electorate.js +52 -0
  163. package/dist/core/project-trust-electorate.js.map +1 -0
  164. package/dist/core/project-trust-state.d.ts +15 -0
  165. package/dist/core/project-trust-state.d.ts.map +1 -1
  166. package/dist/core/project-trust-state.js +15 -0
  167. package/dist/core/project-trust-state.js.map +1 -1
  168. package/dist/core/provider-request-admission.d.ts.map +1 -1
  169. package/dist/core/provider-request-admission.js +2 -2
  170. package/dist/core/provider-request-admission.js.map +1 -1
  171. package/dist/core/queued-input-admission.js +2 -2
  172. package/dist/core/queued-input-admission.js.map +1 -1
  173. package/dist/core/queued-message-delivery.d.ts +2 -2
  174. package/dist/core/queued-message-delivery.d.ts.map +1 -1
  175. package/dist/core/queued-message-delivery.js +6 -3
  176. package/dist/core/queued-message-delivery.js.map +1 -1
  177. package/dist/core/resource-admission-scope.js +2 -2
  178. package/dist/core/resource-admission-scope.js.map +1 -1
  179. package/dist/core/resume/blueprint/process.d.ts +3 -4
  180. package/dist/core/resume/blueprint/process.d.ts.map +1 -1
  181. package/dist/core/resume/blueprint/process.js +33 -17
  182. package/dist/core/resume/blueprint/process.js.map +1 -1
  183. package/dist/core/resume/path-mapping.js +4 -4
  184. package/dist/core/resume/path-mapping.js.map +1 -1
  185. package/dist/core/resume/session-resume.d.ts +9 -0
  186. package/dist/core/resume/session-resume.d.ts.map +1 -1
  187. package/dist/core/resume/session-resume.js +27 -2
  188. package/dist/core/resume/session-resume.js.map +1 -1
  189. package/dist/core/resume-cache-checkpoint.d.ts +27 -1
  190. package/dist/core/resume-cache-checkpoint.d.ts.map +1 -1
  191. package/dist/core/resume-cache-checkpoint.js +45 -0
  192. package/dist/core/resume-cache-checkpoint.js.map +1 -1
  193. package/dist/core/sdk.d.ts.map +1 -1
  194. package/dist/core/sdk.js +7 -31
  195. package/dist/core/sdk.js.map +1 -1
  196. package/dist/core/session-lifecycle-scope.d.ts +1 -2
  197. package/dist/core/session-lifecycle-scope.d.ts.map +1 -1
  198. package/dist/core/session-lifecycle-scope.js +2 -2
  199. package/dist/core/session-lifecycle-scope.js.map +1 -1
  200. package/dist/core/session-lifecycle-work.js +2 -2
  201. package/dist/core/session-lifecycle-work.js.map +1 -1
  202. package/dist/core/session-manager-core.d.ts.map +1 -1
  203. package/dist/core/session-manager-core.js +3 -0
  204. package/dist/core/session-manager-core.js.map +1 -1
  205. package/dist/core/session-storage.d.ts +12 -0
  206. package/dist/core/session-storage.d.ts.map +1 -1
  207. package/dist/core/session-storage.js +68 -1
  208. package/dist/core/session-storage.js.map +1 -1
  209. package/dist/core/settings-lock-directory.d.ts.map +1 -1
  210. package/dist/core/settings-lock-directory.js +4 -3
  211. package/dist/core/settings-lock-directory.js.map +1 -1
  212. package/dist/core/settings-write-ownership.d.ts +1 -2
  213. package/dist/core/settings-write-ownership.d.ts.map +1 -1
  214. package/dist/core/settings-write-ownership.js +2 -2
  215. package/dist/core/settings-write-ownership.js.map +1 -1
  216. package/dist/core/storage/node-sqlite-thread.d.ts.map +1 -1
  217. package/dist/core/storage/node-sqlite-thread.js +6 -4
  218. package/dist/core/storage/node-sqlite-thread.js.map +1 -1
  219. package/dist/core/storage/node-sqlite.d.ts.map +1 -1
  220. package/dist/core/storage/node-sqlite.js +22 -8
  221. package/dist/core/storage/node-sqlite.js.map +1 -1
  222. package/dist/core/system-prompt.d.ts +16 -2
  223. package/dist/core/system-prompt.d.ts.map +1 -1
  224. package/dist/core/system-prompt.js +33 -6
  225. package/dist/core/system-prompt.js.map +1 -1
  226. package/dist/core/tasks/agent-adapter.d.ts.map +1 -1
  227. package/dist/core/tasks/agent-adapter.js +2 -1
  228. package/dist/core/tasks/agent-adapter.js.map +1 -1
  229. package/dist/core/tasks/completion.d.ts +3 -2
  230. package/dist/core/tasks/completion.d.ts.map +1 -1
  231. package/dist/core/tasks/completion.js.map +1 -1
  232. package/dist/core/tasks/execution-scope.js +2 -2
  233. package/dist/core/tasks/execution-scope.js.map +1 -1
  234. package/dist/core/tools/bash.d.ts.map +1 -1
  235. package/dist/core/tools/bash.js +2 -1
  236. package/dist/core/tools/bash.js.map +1 -1
  237. package/dist/core/tools/history-regex-worker.d.ts.map +1 -1
  238. package/dist/core/tools/history-regex-worker.js +3 -2
  239. package/dist/core/tools/history-regex-worker.js.map +1 -1
  240. package/dist/core/tools/shell-task-render.d.ts +3 -2
  241. package/dist/core/tools/shell-task-render.d.ts.map +1 -1
  242. package/dist/core/tools/shell-task-render.js +7 -5
  243. package/dist/core/tools/shell-task-render.js.map +1 -1
  244. package/dist/core/tools/shell-task-status.d.ts +6 -2
  245. package/dist/core/tools/shell-task-status.d.ts.map +1 -1
  246. package/dist/core/tools/shell-task-status.js +13 -8
  247. package/dist/core/tools/shell-task-status.js.map +1 -1
  248. package/dist/core/tools/sqlite-selector-connection.d.ts.map +1 -1
  249. package/dist/core/tools/sqlite-selector-connection.js +4 -3
  250. package/dist/core/tools/sqlite-selector-connection.js.map +1 -1
  251. package/dist/core/tools/windows-directory-security.d.ts.map +1 -1
  252. package/dist/core/tools/windows-directory-security.js +2 -1
  253. package/dist/core/tools/windows-directory-security.js.map +1 -1
  254. package/dist/core/worktree-snapshot/git.js +2 -2
  255. package/dist/core/worktree-snapshot/git.js.map +1 -1
  256. package/dist/extensions/mcp/index.d.ts +6 -1
  257. package/dist/extensions/mcp/index.d.ts.map +1 -1
  258. package/dist/extensions/mcp/index.js +150 -18
  259. package/dist/extensions/mcp/index.js.map +1 -1
  260. package/dist/extensions/mcp/tool-records.d.ts +44 -9
  261. package/dist/extensions/mcp/tool-records.d.ts.map +1 -1
  262. package/dist/extensions/mcp/tool-records.js +58 -16
  263. package/dist/extensions/mcp/tool-records.js.map +1 -1
  264. package/dist/index.d.ts +2 -0
  265. package/dist/index.d.ts.map +1 -1
  266. package/dist/index.js +4 -0
  267. package/dist/index.js.map +1 -1
  268. package/dist/main-session.d.ts +3 -1
  269. package/dist/main-session.d.ts.map +1 -1
  270. package/dist/main-session.js +1 -0
  271. package/dist/main-session.js.map +1 -1
  272. package/dist/main.d.ts.map +1 -1
  273. package/dist/main.js +230 -96
  274. package/dist/main.js.map +1 -1
  275. package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts +5 -0
  276. package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts.map +1 -1
  277. package/dist/modes/interactive/agent-view/agent-view-bridge.js.map +1 -1
  278. package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +5 -2
  279. package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts.map +1 -1
  280. package/dist/modes/interactive/agent-view/agent-view-switcher.js +3 -3
  281. package/dist/modes/interactive/agent-view/agent-view-switcher.js.map +1 -1
  282. package/dist/modes/interactive/agent-view/contracts.d.ts +6 -0
  283. package/dist/modes/interactive/agent-view/contracts.d.ts.map +1 -1
  284. package/dist/modes/interactive/agent-view/contracts.js.map +1 -1
  285. package/dist/modes/interactive/agent-view/install.d.ts.map +1 -1
  286. package/dist/modes/interactive/agent-view/install.js +2 -1
  287. package/dist/modes/interactive/agent-view/install.js.map +1 -1
  288. package/dist/modes/interactive/agent-view/open-port.d.ts +4 -2
  289. package/dist/modes/interactive/agent-view/open-port.d.ts.map +1 -1
  290. package/dist/modes/interactive/agent-view/open-port.js +4 -3
  291. package/dist/modes/interactive/agent-view/open-port.js.map +1 -1
  292. package/dist/modes/interactive/agent-view/prompt-retarget.d.ts.map +1 -1
  293. package/dist/modes/interactive/agent-view/prompt-retarget.js +18 -5
  294. package/dist/modes/interactive/agent-view/prompt-retarget.js.map +1 -1
  295. package/dist/modes/interactive/agent-view/remote-port.d.ts +10 -1
  296. package/dist/modes/interactive/agent-view/remote-port.d.ts.map +1 -1
  297. package/dist/modes/interactive/agent-view/remote-port.js +36 -4
  298. package/dist/modes/interactive/agent-view/remote-port.js.map +1 -1
  299. package/dist/modes/interactive/agent-view/viewed-keys.d.ts +56 -0
  300. package/dist/modes/interactive/agent-view/viewed-keys.d.ts.map +1 -0
  301. package/dist/modes/interactive/agent-view/viewed-keys.js +63 -0
  302. package/dist/modes/interactive/agent-view/viewed-keys.js.map +1 -0
  303. package/dist/modes/interactive/agent-view/viewed-submit.d.ts +14 -4
  304. package/dist/modes/interactive/agent-view/viewed-submit.d.ts.map +1 -1
  305. package/dist/modes/interactive/agent-view/viewed-submit.js +51 -17
  306. package/dist/modes/interactive/agent-view/viewed-submit.js.map +1 -1
  307. package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
  308. package/dist/modes/interactive/components/agent-panel.js +8 -21
  309. package/dist/modes/interactive/components/agent-panel.js.map +1 -1
  310. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  311. package/dist/modes/interactive/components/chat-session-host-actions.js +18 -5
  312. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  313. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  314. package/dist/modes/interactive/components/chat-session-host-rendering.js +6 -0
  315. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  316. package/dist/modes/interactive/components/chat-session-host-state.d.ts +1 -0
  317. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  318. package/dist/modes/interactive/components/chat-session-host-state.js +2 -0
  319. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  320. package/dist/modes/interactive/components/chat-session-host-types.d.ts +5 -0
  321. package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
  322. package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
  323. package/dist/modes/interactive/components/custom-editor.d.ts +33 -2
  324. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  325. package/dist/modes/interactive/components/custom-editor.js +58 -2
  326. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  327. package/dist/modes/interactive/components/host-session-picker.js +2 -2
  328. package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
  329. package/dist/modes/interactive/components/main-composer-keys.d.ts +16 -5
  330. package/dist/modes/interactive/components/main-composer-keys.d.ts.map +1 -1
  331. package/dist/modes/interactive/components/main-composer-keys.js +27 -8
  332. package/dist/modes/interactive/components/main-composer-keys.js.map +1 -1
  333. package/dist/modes/interactive/components/notice-line.d.ts +8 -25
  334. package/dist/modes/interactive/components/notice-line.d.ts.map +1 -1
  335. package/dist/modes/interactive/components/notice-line.js +18 -17
  336. package/dist/modes/interactive/components/notice-line.js.map +1 -1
  337. package/dist/modes/interactive/components/prompt-slot.d.ts +20 -3
  338. package/dist/modes/interactive/components/prompt-slot.d.ts.map +1 -1
  339. package/dist/modes/interactive/components/prompt-slot.js +82 -32
  340. package/dist/modes/interactive/components/prompt-slot.js.map +1 -1
  341. package/dist/modes/interactive/components/queued-messages-view.d.ts +5 -2
  342. package/dist/modes/interactive/components/queued-messages-view.d.ts.map +1 -1
  343. package/dist/modes/interactive/components/queued-messages-view.js +12 -5
  344. package/dist/modes/interactive/components/queued-messages-view.js.map +1 -1
  345. package/dist/modes/interactive/components/task-board.d.ts +5 -8
  346. package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
  347. package/dist/modes/interactive/components/task-board.js +5 -49
  348. package/dist/modes/interactive/components/task-board.js.map +1 -1
  349. package/dist/modes/interactive/components/task-completion-message.d.ts.map +1 -1
  350. package/dist/modes/interactive/components/task-completion-message.js +9 -2
  351. package/dist/modes/interactive/components/task-completion-message.js.map +1 -1
  352. package/dist/modes/interactive/components/task-marks.d.ts +19 -0
  353. package/dist/modes/interactive/components/task-marks.d.ts.map +1 -0
  354. package/dist/modes/interactive/components/task-marks.js +25 -0
  355. package/dist/modes/interactive/components/task-marks.js.map +1 -0
  356. package/dist/modes/interactive/components/task-row.d.ts +10 -2
  357. package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
  358. package/dist/modes/interactive/components/task-row.js +39 -32
  359. package/dist/modes/interactive/components/task-row.js.map +1 -1
  360. package/dist/modes/interactive/components/task-transcript-page.d.ts +7 -0
  361. package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
  362. package/dist/modes/interactive/components/task-transcript-page.js +106 -10
  363. package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
  364. package/dist/modes/interactive/components/tool-block-families.d.ts.map +1 -1
  365. package/dist/modes/interactive/components/tool-block-families.js +8 -9
  366. package/dist/modes/interactive/components/tool-block-families.js.map +1 -1
  367. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  368. package/dist/modes/interactive/components/tool-execution.js +5 -1
  369. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  370. package/dist/modes/interactive/extension-command-hold.d.ts.map +1 -1
  371. package/dist/modes/interactive/extension-command-hold.js +5 -7
  372. package/dist/modes/interactive/extension-command-hold.js.map +1 -1
  373. package/dist/modes/interactive/interactive-extension-dialogs.js +6 -1
  374. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  375. package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
  376. package/dist/modes/interactive/interactive-extension-runtime.js +21 -7
  377. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  378. package/dist/modes/interactive/interactive-initial-session-binding.d.ts +1 -2
  379. package/dist/modes/interactive/interactive-initial-session-binding.d.ts.map +1 -1
  380. package/dist/modes/interactive/interactive-initial-session-binding.js +2 -2
  381. package/dist/modes/interactive/interactive-initial-session-binding.js.map +1 -1
  382. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  383. package/dist/modes/interactive/interactive-input-handling.js +13 -4
  384. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  385. package/dist/modes/interactive/interactive-mode-base.d.ts +2 -1
  386. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  387. package/dist/modes/interactive/interactive-mode-base.js +6 -1
  388. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  389. package/dist/modes/interactive/interactive-mode-helpers.d.ts +4 -2
  390. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  391. package/dist/modes/interactive/interactive-mode-helpers.js +6 -0
  392. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  393. package/dist/modes/interactive/interactive-mode-surface.d.ts +5 -0
  394. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  395. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  396. package/dist/modes/interactive/interactive-process-lifecycle.js +96 -17
  397. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  398. package/dist/modes/interactive/interactive-queueing.d.ts +5 -0
  399. package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
  400. package/dist/modes/interactive/interactive-queueing.js +37 -5
  401. package/dist/modes/interactive/interactive-queueing.js.map +1 -1
  402. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  403. package/dist/modes/interactive/interactive-render-chat.js +45 -4
  404. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  405. package/dist/modes/interactive/interactive-resource-disclosure.d.ts +4 -1
  406. package/dist/modes/interactive/interactive-resource-disclosure.d.ts.map +1 -1
  407. package/dist/modes/interactive/interactive-resource-disclosure.js +20 -1
  408. package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
  409. package/dist/modes/interactive/interactive-resource-rendering.js +3 -0
  410. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  411. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  412. package/dist/modes/interactive/interactive-startup.js +43 -5
  413. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  414. package/dist/modes/interactive-engine/activity-watchdog.d.ts +6 -3
  415. package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -1
  416. package/dist/modes/interactive-engine/activity-watchdog.js +3 -2
  417. package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -1
  418. package/dist/modes/interactive-engine/engine-health.d.ts +2 -0
  419. package/dist/modes/interactive-engine/engine-health.d.ts.map +1 -1
  420. package/dist/modes/interactive-engine/engine-health.js.map +1 -1
  421. package/dist/modes/interactive-engine/engine-quit-intent.d.ts +10 -0
  422. package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -1
  423. package/dist/modes/interactive-engine/engine-quit-intent.js +33 -0
  424. package/dist/modes/interactive-engine/engine-quit-intent.js.map +1 -1
  425. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +7 -1
  426. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  427. package/dist/modes/interactive-engine/extension-ui-bridge.js +15 -2
  428. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  429. package/dist/modes/interactive-engine/host-listener-failures.d.ts +24 -0
  430. package/dist/modes/interactive-engine/host-listener-failures.d.ts.map +1 -0
  431. package/dist/modes/interactive-engine/host-listener-failures.js +98 -0
  432. package/dist/modes/interactive-engine/host-listener-failures.js.map +1 -0
  433. package/dist/modes/interactive-engine/isolated-runtime.d.ts +16 -0
  434. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  435. package/dist/modes/interactive-engine/isolated-runtime.js +74 -7
  436. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  437. package/dist/modes/interactive-engine/protocol.d.ts +5 -0
  438. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  439. package/dist/modes/interactive-engine/protocol.js +8 -2
  440. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  441. package/dist/modes/interactive-engine/remote-component.d.ts +13 -0
  442. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  443. package/dist/modes/interactive-engine/remote-component.js +69 -4
  444. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  445. package/dist/modes/print-mode.d.ts.map +1 -1
  446. package/dist/modes/print-mode.js +34 -6
  447. package/dist/modes/print-mode.js.map +1 -1
  448. package/dist/modes/rpc/agent-panel-bridge.d.ts +7 -0
  449. package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
  450. package/dist/modes/rpc/agent-panel-bridge.js +11 -1
  451. package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
  452. package/dist/modes/rpc/agent-view-rpc-panel.d.ts.map +1 -1
  453. package/dist/modes/rpc/agent-view-rpc-panel.js +11 -5
  454. package/dist/modes/rpc/agent-view-rpc-panel.js.map +1 -1
  455. package/dist/modes/rpc/rpc-client-process.d.ts +8 -1
  456. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  457. package/dist/modes/rpc/rpc-client-process.js +89 -65
  458. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  459. package/dist/modes/rpc/rpc-client.d.ts +21 -0
  460. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  461. package/dist/modes/rpc/rpc-client.js +77 -33
  462. package/dist/modes/rpc/rpc-client.js.map +1 -1
  463. package/dist/modes/rpc/rpc-event-buffer.d.ts +5 -0
  464. package/dist/modes/rpc/rpc-event-buffer.d.ts.map +1 -1
  465. package/dist/modes/rpc/rpc-event-buffer.js +8 -2
  466. package/dist/modes/rpc/rpc-event-buffer.js.map +1 -1
  467. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  468. package/dist/modes/rpc/rpc-mode.js +9 -2
  469. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  470. package/dist/utils/shell.d.ts +5 -1
  471. package/dist/utils/shell.d.ts.map +1 -1
  472. package/dist/utils/shell.js +14 -7
  473. package/dist/utils/shell.js.map +1 -1
  474. package/dist/utils/worker-threads.d.ts +10 -4
  475. package/dist/utils/worker-threads.d.ts.map +1 -1
  476. package/dist/utils/worker-threads.js +10 -4
  477. package/dist/utils/worker-threads.js.map +1 -1
  478. package/docs/background-tasks.md +10 -10
  479. package/docs/compaction.md +1 -0
  480. package/docs/development.md +1 -1
  481. package/docs/environment-variables.md +4 -0
  482. package/docs/extensions/api-reference.md +2 -0
  483. package/docs/extensions/events.md +1 -1
  484. package/docs/getting-started/installation.md +1 -0
  485. package/docs/guides/non-interactive.md +2 -0
  486. package/docs/guides/resume-on-any-machine.md +3 -1
  487. package/docs/intercom/reference.md +1 -1
  488. package/docs/keybindings.md +6 -5
  489. package/docs/libraries/ai.md +2 -1
  490. package/docs/mcp-servers.md +1 -1
  491. package/docs/sdk/reference.md +1 -1
  492. package/docs/sdk.md +6 -0
  493. package/docs/security.md +4 -2
  494. package/docs/settings.md +2 -1
  495. package/docs/storage.md +2 -0
  496. package/docs/subagents.md +2 -2
  497. package/docs/tui/reference.md +3 -1
  498. package/npm-shrinkwrap.json +49 -49
  499. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"pr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AI,IAAI;gBAAE,OAAO;YACjB,GAAG,EAAE,CAAC;YACN,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;QACzB,CAAC,EAAE,mBAAmB,CAAC,CAAC;QACxB,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,GAAG;YACZ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;YAC7B,KAAK;YACL,UAAU;YACV,GAAG;SACM,CAAC;QACX,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["import { type Component, Container, stripHintMarkers, type TUI, type TuiMouseEvent } from \"@bastani/atomic-tui\";\nimport { ScreenHold } from \"../screen-hold.ts\";\n\n/**\n * The longest the prompt's slot keeps showing what it showed while a view is on its way: as long as a key in a view\n * another process draws waits for that process to answer.\n */\nexport const PROMPT_SLOT_HOLD_MS = 250;\n\n/** Atomic's own views that can mount with nothing to draw yet, and how each tells. */\nconst firstContent = new WeakMap<Component, () => boolean>();\n\n/**\n * `view` has nothing to draw while `awaiting` answers true, as a panel the engine draws before its first frame: the\n * prompt's slot keeps its rows meanwhile. Only views registered here are asked; any other component draws at once.\n */\nexport function awaitFirstContent(view: Component, awaiting: () => boolean): void {\n\tfirstContent.set(view, awaiting);\n}\n\nfunction awaitsFirstContent(component: Component): boolean {\n\treturn firstContent.get(component)?.() === true;\n}\n\n/** A command that opens a view holds the prompt's slot; `settle` says the command is done. */\nexport interface PromptSlotHold {\n\tsettle(): void;\n}\n\nconst SETTLED: PromptSlotHold = { settle: () => {} };\n\n/** Keep `slot` as it is on screen until the view the running command opens is up, when it is the prompt's slot. */\nexport function holdPromptSlot(slot: Container): PromptSlotHold {\n\treturn slot instanceof PromptSlot ? slot.hold() : SETTLED;\n}\n\n/**\n * Whether what `slot` last drew is live and still current: not held rows, no view still waiting for its first frame,\n * drawn onto the screen, and nothing mounted and no run's working status changed since.\n */\nexport function promptSlotDrewLive(slot: Container): boolean {\n\treturn !(slot instanceof PromptSlot) || slot.drewLive;\n}\n\n/** The opening and closing sequences of an OSC 8 hyperlink; the text between them is kept. */\nconst HYPERLINK = /\\x1b\\]8;[^;\\x07\\x1b]*;[^\\x07\\x1b]*(?:\\x07|\\x1b\\\\)/g;\n\n/** `row` as it looks, with nothing on it that a click could run: no key hints and no links. */\nfunction inertRow(row: string): string {\n\treturn stripHintMarkers(row).replace(HYPERLINK, \"\");\n}\n\n/** What a render of the slot drew. */\ninterface Drawn {\n\treadonly width: number;\n\treadonly rows: readonly string[];\n\t/** The children it drew, counted by `generation`. */\n\treadonly generation: number;\n\t/** Live content drawn onto the screen: not held rows, not a view yet to draw, not under a held dock. */\n\treadonly live: boolean;\n\t/** It drew a run's working status in the prompt. */\n\treadonly runStatus: boolean;\n\t/** The working status changes counted when it drew (`ScreenHold.statusEpoch`). */\n\treadonly statusEpoch: number;\n}\n\ntype PromptSlotState =\n\t| { readonly kind: \"live\" }\n\t| {\n\t\t\treadonly kind: \"held\";\n\t\t\t/** Which hold this is. */\n\t\t\treadonly token: object;\n\t\t\t/** The rows the slot drew last, at `width`, with their key hints and links made plain text: they run nothing. */\n\t\t\treadonly rows: readonly string[];\n\t\t\treadonly width: number;\n\t\t\t/** The slot's children as they were when the hold began, counted by `generation`. */\n\t\t\treadonly generation: number;\n\t\t\treadonly end: () => void;\n\t };\n\n/**\n * Where the prompt is drawn, or the selector or panel that takes its place. A slash command that opens a view clears\n * the prompt at once, but its view can mount only after an await, or draw only after another process answers. Until\n * then the slot keeps the rows it drew before, so the screen goes from the prompt straight to the view and the rows\n * around it stay put. Only these rows wait: everything else on the screen keeps drawing.\n *\n * The rows come back live when the view is up and has something to draw, when the command ends without one, on the\n * user's next key, at another width, or after `PROMPT_SLOT_HOLD_MS`. The slot holds only through the screen's hold\n * (`ScreenHold`): never while another part of the screen is held, and only rows it drew from live content.\n *\n * A prompt that draws a run's working status in its own rows is never held: the hold would stop that status moving, and\n * could keep showing it after the run ended.\n */\nexport class PromptSlot extends Container {\n\tprivate state: PromptSlotState = { kind: \"live\" };\n\t/** Counts changes of `children`. */\n\tprivate generation = 0;\n\t/** What the last render drew. */\n\tprivate drawn: Drawn | undefined;\n\tprivate showingHeldRows = false;\n\tprivate readonly ui: Pick<TUI, \"requestRender\">;\n\tprivate readonly showsRunStatus: () => boolean;\n\tprivate readonly screen: ScreenHold;\n\n\t/**\n\t * `showsRunStatus` answers whether the prompt draws a run's working status in its rows now; `screen` is the hold of\n\t * the screen the slot is on.\n\t */\n\tconstructor(\n\t\tui: Pick<TUI, \"requestRender\">,\n\t\tshowsRunStatus: () => boolean = () => false,\n\t\tscreen: ScreenHold = new ScreenHold(),\n\t) {\n\t\tsuper();\n\t\tthis.ui = ui;\n\t\tthis.showsRunStatus = showsRunStatus;\n\t\tthis.screen = screen;\n\t}\n\n\t/**\n\t * Whether the last render drew live content that is still current (`promptSlotDrewLive`): what a held dock, which\n\t * has the status area in it too, may keep.\n\t */\n\tget drewLive(): boolean {\n\t\tconst drawn = this.drawn;\n\t\treturn (\n\t\t\tdrawn?.live === true && drawn.generation === this.generation && drawn.statusEpoch === this.screen.statusEpoch\n\t\t);\n\t}\n\n\t/**\n\t * Whether a hold may keep what the last render drew: live content of the children the slot has now, with no run's\n\t * working status in it. A status drawn elsewhere on the screen is not in these rows.\n\t */\n\tprivate mayHold(): boolean {\n\t\tconst drawn = this.drawn;\n\t\treturn drawn?.live === true && drawn.generation === this.generation && !drawn.runStatus && !this.showsRunStatus();\n\t}\n\n\toverride addChild(component: Component): void {\n\t\tthis.generation++;\n\t\tsuper.addChild(component);\n\t}\n\n\toverride removeChild(component: Component): void {\n\t\tthis.generation++;\n\t\tsuper.removeChild(component);\n\t}\n\n\toverride clear(): void {\n\t\tthis.generation++;\n\t\tsuper.clear();\n\t}\n\n\t/** Keep showing what the slot drew last until the view a command opens is up or the command settles. */\n\thold(): PromptSlotHold {\n\t\tconst generation = this.generation;\n\t\tlet token: object | undefined;\n\t\tthis.screen.begin(\"prompt\", (ended) => {\n\t\t\tconst drawn = this.drawn;\n\t\t\tif (drawn === undefined || !this.mayHold()) return undefined;\n\t\t\tconst held = this.beginHold(drawn, drawn.width, generation, ended);\n\t\t\ttoken = held.token;\n\t\t\treturn held.end;\n\t\t});\n\t\tif (token === undefined) return SETTLED;\n\t\tconst own = token;\n\t\treturn {\n\t\t\t// A command that ends with nothing mounted shows the slot as it is; a mounted view decides for itself. The\n\t\t\t// handle keeps only the hold's token, not its rows: a command can keep it until its view closes.\n\t\t\tsettle: () => {\n\t\t\t\tconst state = this.state;\n\t\t\t\tif (state.kind === \"held\" && state.token === own && this.generation === generation) {\n\t\t\t\t\tstate.end();\n\t\t\t\t\tthis.ui.requestRender();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst live = super.render(width);\n\t\tlet rows: readonly string[] = live;\n\t\tconst state = this.state;\n\t\tconst previous = this.drawn;\n\t\tif (state.kind === \"held\") {\n\t\t\tif (this.showsHeldRows(state, width)) rows = state.rows;\n\t\t\telse state.end();\n\t\t} else if (\n\t\t\tprevious?.live === true &&\n\t\t\t!previous.runStatus &&\n\t\t\tprevious.width === width &&\n\t\t\tprevious.generation !== this.generation &&\n\t\t\tthis.children.some(awaitsFirstContent) &&\n\t\t\t!this.showsRunStatus()\n\t\t) {\n\t\t\t// A view mounted with nothing to draw yet, as an engine panel before its first frame: the rows stay.\n\t\t\tthis.screen.begin(\"prompt\", (ended) => {\n\t\t\t\tconst held = this.beginHold(previous, width, previous.generation, ended);\n\t\t\t\trows = held.rows;\n\t\t\t\treturn held.end;\n\t\t\t});\n\t\t}\n\t\tthis.showingHeldRows = rows !== live;\n\t\tthis.drawn = {\n\t\t\twidth,\n\t\t\trows,\n\t\t\tgeneration: this.generation,\n\t\t\t// Under a held dock the slot is drawn unseen: what it draws then never reached the screen.\n\t\t\tlive: rows === live && !this.children.some(awaitsFirstContent) && this.screen.region !== \"dock\",\n\t\t\trunStatus: this.showsRunStatus(),\n\t\t\tstatusEpoch: this.screen.statusEpoch,\n\t\t};\n\t\treturn rows === live ? live : [...rows];\n\t}\n\n\t/** Held rows are a picture of what was there: a click on them reaches nothing. */\n\toverride handleMouse(event: TuiMouseEvent): ReturnType<Container[\"handleMouse\"]> {\n\t\treturn this.showingHeldRows ? undefined : super.handleMouse(event);\n\t}\n\n\tprivate showsHeldRows(state: Extract<PromptSlotState, { kind: \"held\" }>, width: number): boolean {\n\t\tif (width !== state.width || this.showsRunStatus()) return false;\n\t\treturn this.generation === state.generation || this.children.some(awaitsFirstContent);\n\t}\n\n\t/** Hold the rows `seed` drew, the slot's last render. */\n\tprivate beginHold(\n\t\tseed: Drawn,\n\t\twidth: number,\n\t\tgeneration: number,\n\t\tended: () => void,\n\t): Extract<PromptSlotState, { kind: \"held\" }> {\n\t\tlet over = false;\n\t\tconst end = () => {\n\t\t\tif (over) return;\n\t\t\tover = true;\n\t\t\tclearTimeout(timer);\n\t\t\tif (this.state === held) this.state = { kind: \"live\" };\n\t\t\t// Nothing drawn since the hold began: its rows were kept once, and no later hold keeps them again.\n\t\t\tif (this.drawn === seed) this.drawn = { ...seed, live: false };\n\t\t\tended();\n\t\t};\n\t\tconst timer = setTimeout(() => {\n\t\t\tif (over) return;\n\t\t\tend();\n\t\t\tthis.ui.requestRender();\n\t\t}, PROMPT_SLOT_HOLD_MS);\n\t\ttimer.unref?.();\n\t\tconst held = {\n\t\t\tkind: \"held\",\n\t\t\ttoken: {},\n\t\t\trows: seed.rows.map(inertRow),\n\t\t\twidth,\n\t\t\tgeneration,\n\t\t\tend,\n\t\t} as const;\n\t\tthis.state = held;\n\t\treturn held;\n\t}\n}\n"]}
1
+ {"version":3,"file":"prompt-slot.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/prompt-slot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,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AE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;gBAC/F,CAAC,CAAC,IAAI,CACP,CAAC;YACF,OAAO,IAAI,CAAC;QACb,CAAC,CAAC;QACF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC7B,IAAI,QAAQ,EAAE;gBAAE,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;QACzC,CAAC,EAAE,mBAAmB,CAAC,CAAC;QACxB,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,GAAa,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;QACnG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["import { type Component, Container, stripHintMarkers, type TUI, type TuiMouseEvent } from \"@bastani/atomic-tui\";\nimport { ScreenHold } from \"../screen-hold.ts\";\n\n/**\n * The longest the prompt's slot keeps showing what it showed while a view is on its way: as long as a key in a view\n * another process draws waits for that process to answer.\n */\nexport const PROMPT_SLOT_HOLD_MS = 250;\n\n/** Atomic's own views that can mount with nothing to draw yet, and how each tells. */\nconst firstContent = new WeakMap<Component, () => boolean>();\n\n/**\n * `view` has nothing to draw while `awaiting` answers true, as a panel the engine draws before its first frame: the\n * prompt's slot keeps its rows meanwhile. Only views registered here are asked; any other component draws at once.\n */\nexport function awaitFirstContent(view: Component, awaiting: () => boolean): void {\n\tfirstContent.set(view, awaiting);\n}\n\nfunction awaitsFirstContent(component: Component): boolean {\n\treturn firstContent.get(component)?.() === true;\n}\n\n/** A command that opens a view holds the prompt's slot; `settle` says the command is done. */\nexport interface PromptSlotHold {\n\tsettle(): void;\n\t/**\n\t * Another change on the screen ends the hold before the command did: the slot shows live from the next frame, unless\n\t * the command mounts a view with nothing to draw yet before it. Answers whether this ended the hold.\n\t */\n\tendEarly(): boolean;\n}\n\nconst SETTLED: PromptSlotHold = { settle: () => {}, endEarly: () => false };\n\nexport interface PromptSlotHoldOptions {\n\t/**\n\t * The command's view can mount at any time, also after the hold ends (an extension command, which nothing waits\n\t * for). A view it mounts with nothing to draw yet, while held or before the first frame after the hold ended,\n\t * keeps the rows on screen until it draws, for one more bound from when it is first drawn.\n\t */\n\treadonly lateView?: boolean;\n}\n\n/** Keep `slot` as it is on screen until the view the running command opens is up, when it is the prompt's slot. */\nexport function holdPromptSlot(slot: Container, options?: PromptSlotHoldOptions): PromptSlotHold {\n\treturn slot instanceof PromptSlot ? slot.hold(options) : SETTLED;\n}\n\n/**\n * Whether what `slot` last drew is live and still current: not held rows, no view still waiting for its first frame,\n * drawn onto the screen, and nothing mounted and no run's working status changed since.\n */\nexport function promptSlotDrewLive(slot: Container): boolean {\n\treturn !(slot instanceof PromptSlot) || slot.drewLive;\n}\n\n/** The opening and closing sequences of an OSC 8 hyperlink; the text between them is kept. */\nconst HYPERLINK = /\\x1b\\]8;[^;\\x07\\x1b]*;[^\\x07\\x1b]*(?:\\x07|\\x1b\\\\)/g;\n\n/** `row` as it looks, with nothing on it that a click could run: no key hints and no links. */\nfunction inertRow(row: string): string {\n\treturn stripHintMarkers(row).replace(HYPERLINK, \"\");\n}\n\n/** What a render of the slot drew. */\ninterface Drawn {\n\treadonly width: number;\n\treadonly rows: readonly string[];\n\t/** The children it drew, counted by `generation`. */\n\treadonly generation: number;\n\t/** Live content drawn onto the screen: not held rows, not a view yet to draw, not under a held dock. */\n\treadonly live: boolean;\n\t/** It drew a run's working status in the prompt. */\n\treadonly runStatus: boolean;\n\t/** The working status changes counted when it drew (`ScreenHold.statusEpoch`). */\n\treadonly statusEpoch: number;\n}\n\ntype HeldSlot = {\n\treadonly kind: \"held\";\n\t/**\n\t * What the rows wait for: the view a command opens (`lateView`: an extension command's, which waits for its first\n\t * frame once mounted, and can also mount after the hold ends), or the first frame of a view mounted with nothing to\n\t * draw yet.\n\t */\n\treadonly awaits: \"view\" | \"lateView\" | \"firstContent\";\n\t/** Which hold this is. */\n\treadonly token: object;\n\t/** The rows the slot drew last, at `width`, with their key hints and links made plain text: they run nothing. */\n\treadonly rows: readonly string[];\n\treadonly width: number;\n\t/** The slot's children as they were when the hold began, counted by `generation`. */\n\treadonly generation: number;\n\t/** Shows the slot live again. */\n\treadonly end: () => void;\n\t/** Ends the hold at its bound, or at another extension's change: a `lateView` hold leaves its rows to the next frame. */\n\treadonly endEarly: () => boolean;\n};\n\ntype PromptSlotState =\n\t| { readonly kind: \"live\" }\n\t| HeldSlot\n\t| {\n\t\t\t/**\n\t\t\t * A `lateView` hold ended at its bound, or at another extension's change, and no frame was drawn since: the\n\t\t\t * screen still shows its rows. The slot's next render gives them, once, to a view the command mounted with\n\t\t\t * nothing to draw yet, and otherwise draws live. The screen is not held meanwhile: another part of it can be.\n\t\t\t */\n\t\t\treadonly kind: \"handoff\";\n\t\t\treadonly token: object;\n\t\t\treadonly rows: readonly string[];\n\t\t\treadonly width: number;\n\t\t\treadonly generation: number;\n\t\t\t/** The user's key presses counted when the hold ended (`ScreenHold.keyPresses`): a key since shows it live. */\n\t\t\treadonly keys: number;\n\t };\n\nconst LIVE: PromptSlotState = { kind: \"live\" };\n\n/**\n * Where the prompt is drawn, or the selector or panel that takes its place. A slash command that opens a view clears\n * the prompt at once, but its view can mount only after an await, or draw only after another process answers. Until\n * then the slot keeps the rows it drew before, so the screen goes from the prompt straight to the view and the rows\n * around it stay put. Only these rows wait: everything else on the screen keeps drawing.\n *\n * The rows come back live when the view is up and has something to draw, when the command ends without one, on the\n * user's next key, at another width, or after `PROMPT_SLOT_HOLD_MS`. The slot holds only through the screen's hold\n * (`ScreenHold`): never while another part of the screen is held, and only rows it drew from live content.\n *\n * A prompt that draws a run's working status in its own rows is never held: the hold would stop that status moving, and\n * could keep showing it after the run ended.\n */\nexport class PromptSlot extends Container {\n\tprivate state: PromptSlotState = { kind: \"live\" };\n\t/** Counts changes of `children`. */\n\tprivate generation = 0;\n\t/** What the last render drew. */\n\tprivate drawn: Drawn | undefined;\n\tprivate showingHeldRows = false;\n\tprivate readonly ui: Pick<TUI, \"requestRender\">;\n\tprivate readonly showsRunStatus: () => boolean;\n\tprivate readonly screen: ScreenHold;\n\n\t/**\n\t * `showsRunStatus` answers whether the prompt draws a run's working status in its rows now; `screen` is the hold of\n\t * the screen the slot is on.\n\t */\n\tconstructor(\n\t\tui: Pick<TUI, \"requestRender\">,\n\t\tshowsRunStatus: () => boolean = () => false,\n\t\tscreen: ScreenHold = new ScreenHold(),\n\t) {\n\t\tsuper();\n\t\tthis.ui = ui;\n\t\tthis.showsRunStatus = showsRunStatus;\n\t\tthis.screen = screen;\n\t}\n\n\t/**\n\t * Whether the last render drew live content that is still current (`promptSlotDrewLive`): what a held dock, which\n\t * has the status area in it too, may keep.\n\t */\n\tget drewLive(): boolean {\n\t\tconst drawn = this.drawn;\n\t\treturn (\n\t\t\tdrawn?.live === true && drawn.generation === this.generation && drawn.statusEpoch === this.screen.statusEpoch\n\t\t);\n\t}\n\n\t/**\n\t * Whether a hold may keep what the last render drew: live content of the children the slot has now, with no run's\n\t * working status in it. A status drawn elsewhere on the screen is not in these rows.\n\t */\n\tprivate mayHold(): boolean {\n\t\tconst drawn = this.drawn;\n\t\treturn drawn?.live === true && drawn.generation === this.generation && !drawn.runStatus && !this.showsRunStatus();\n\t}\n\n\toverride addChild(component: Component): void {\n\t\tthis.generation++;\n\t\tsuper.addChild(component);\n\t}\n\n\toverride removeChild(component: Component): void {\n\t\tthis.generation++;\n\t\tsuper.removeChild(component);\n\t}\n\n\toverride clear(): void {\n\t\tthis.generation++;\n\t\tsuper.clear();\n\t}\n\n\t/** Keep showing what the slot drew last until the view a command opens is up or the command settles. */\n\thold(options?: PromptSlotHoldOptions): PromptSlotHold {\n\t\t// Rows an earlier command left for its view are not this command's.\n\t\tif (this.state.kind === \"handoff\") this.state = LIVE;\n\t\tconst generation = this.generation;\n\t\tlet token: object | undefined;\n\t\tthis.screen.begin(\"prompt\", (ended) => {\n\t\t\tconst drawn = this.drawn;\n\t\t\tif (drawn === undefined || !this.mayHold()) return undefined;\n\t\t\tconst awaits = options?.lateView === true ? \"lateView\" : \"view\";\n\t\t\tconst held = this.beginHold(awaits, drawn.rows.map(inertRow), drawn.width, generation, ended, drawn);\n\t\t\ttoken = held.token;\n\t\t\treturn held.end;\n\t\t});\n\t\tif (token === undefined) return SETTLED;\n\t\tconst own = token;\n\t\t/** This command's hold, or the rows it left for its view, with nothing mounted since it began. */\n\t\tconst unchanged = () => {\n\t\t\tconst state = this.state;\n\t\t\treturn state.kind !== \"live\" && state.token === own && this.generation === generation ? state : undefined;\n\t\t};\n\t\treturn {\n\t\t\t// A command that ends with nothing mounted shows the slot as it is; a mounted view decides for itself. The\n\t\t\t// handle keeps only the hold's token, not its rows: a command can keep it until its view closes.\n\t\t\tsettle: () => {\n\t\t\t\tconst state = unchanged();\n\t\t\t\tif (state === undefined) return;\n\t\t\t\tif (state.kind === \"held\") state.end();\n\t\t\t\telse this.state = LIVE;\n\t\t\t\tthis.ui.requestRender();\n\t\t\t},\n\t\t\tendEarly: () => {\n\t\t\t\tconst state = unchanged();\n\t\t\t\treturn state?.kind === \"held\" && state.endEarly();\n\t\t\t},\n\t\t};\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst live = super.render(width);\n\t\tlet rows: readonly string[] = live;\n\t\tconst state = this.state;\n\t\tconst previous = this.drawn;\n\t\tif (state.kind === \"held\") {\n\t\t\tif (!this.showsHeldRows(state, width)) state.end();\n\t\t\telse if (\n\t\t\t\tstate.awaits === \"lateView\" &&\n\t\t\t\tstate.generation !== this.generation &&\n\t\t\t\tthis.children.some(awaitsFirstContent)\n\t\t\t) {\n\t\t\t\t// The command's view mounted with nothing to draw yet: its first frame, not the command's bound, ends the wait\n\t\t\t\t// now, for one bound from here.\n\t\t\t\tstate.end();\n\t\t\t\tthis.screen.begin(\"prompt\", (ended) => {\n\t\t\t\t\tconst held = this.beginHold(\"firstContent\", state.rows, width, state.generation, ended);\n\t\t\t\t\trows = held.rows;\n\t\t\t\t\treturn held.end;\n\t\t\t\t});\n\t\t\t} else rows = state.rows;\n\t\t} else if (state.kind === \"handoff\") {\n\t\t\tthis.state = LIVE;\n\t\t\tif (\n\t\t\t\tstate.keys === this.screen.keyPresses &&\n\t\t\t\tstate.width === width &&\n\t\t\t\tstate.generation !== this.generation &&\n\t\t\t\tthis.children.some(awaitsFirstContent) &&\n\t\t\t\t!this.showsRunStatus()\n\t\t\t) {\n\t\t\t\t// The command's view mounted after its hold ended, before this frame, with nothing to draw yet: the rows\n\t\t\t\t// still on screen stay until it draws, for one more bound, and are not kept again after that.\n\t\t\t\tthis.screen.begin(\"prompt\", (ended) => {\n\t\t\t\t\tconst held = this.beginHold(\"firstContent\", state.rows, width, state.generation, ended);\n\t\t\t\t\trows = held.rows;\n\t\t\t\t\treturn held.end;\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (\n\t\t\tprevious?.live === true &&\n\t\t\t!previous.runStatus &&\n\t\t\tprevious.width === width &&\n\t\t\tprevious.generation !== this.generation &&\n\t\t\tthis.children.some(awaitsFirstContent) &&\n\t\t\t!this.showsRunStatus()\n\t\t) {\n\t\t\t// A view mounted with nothing to draw yet, as an engine panel before its first frame: the rows stay.\n\t\t\tthis.screen.begin(\"prompt\", (ended) => {\n\t\t\t\tconst held = this.beginHold(\n\t\t\t\t\t\"firstContent\",\n\t\t\t\t\tprevious.rows.map(inertRow),\n\t\t\t\t\twidth,\n\t\t\t\t\tprevious.generation,\n\t\t\t\t\tended,\n\t\t\t\t\tprevious,\n\t\t\t\t);\n\t\t\t\trows = held.rows;\n\t\t\t\treturn held.end;\n\t\t\t});\n\t\t}\n\t\tthis.showingHeldRows = rows !== live;\n\t\tthis.drawn = {\n\t\t\twidth,\n\t\t\trows,\n\t\t\tgeneration: this.generation,\n\t\t\t// Under a held dock the slot is drawn unseen: what it draws then never reached the screen.\n\t\t\tlive: rows === live && !this.children.some(awaitsFirstContent) && this.screen.region !== \"dock\",\n\t\t\trunStatus: this.showsRunStatus(),\n\t\t\tstatusEpoch: this.screen.statusEpoch,\n\t\t};\n\t\treturn rows === live ? live : [...rows];\n\t}\n\n\t/** Held rows are a picture of what was there: a click on them reaches nothing. */\n\toverride handleMouse(event: TuiMouseEvent): ReturnType<Container[\"handleMouse\"]> {\n\t\treturn this.showingHeldRows ? undefined : super.handleMouse(event);\n\t}\n\n\tprivate showsHeldRows(state: HeldSlot, width: number): boolean {\n\t\tif (width !== state.width || this.showsRunStatus()) return false;\n\t\treturn this.generation === state.generation || this.children.some(awaitsFirstContent);\n\t}\n\n\t/**\n\t * Hold `rows`: those `seed` drew, the slot's last render, or those a command's hold left for its view. A `lateView`\n\t * hold that reaches its bound, or ends at another change, leaves them to the next frame (`handoff`); any other end\n\t * shows the slot live.\n\t */\n\tprivate beginHold(\n\t\tawaits: HeldSlot[\"awaits\"],\n\t\trows: readonly string[],\n\t\twidth: number,\n\t\tgeneration: number,\n\t\tended: () => void,\n\t\tseed?: Drawn,\n\t): HeldSlot {\n\t\tlet over = false;\n\t\tconst finish = (next: PromptSlotState) => {\n\t\t\tover = true;\n\t\t\tclearTimeout(timer);\n\t\t\tif (this.state === held) this.state = next;\n\t\t\t// Nothing drawn since the hold began: its rows were kept once, and no later hold keeps them again.\n\t\t\tif (seed !== undefined && this.drawn === seed) this.drawn = { ...seed, live: false };\n\t\t\tended();\n\t\t};\n\t\tconst end = () => {\n\t\t\tif (!over) finish(LIVE);\n\t\t};\n\t\tconst endEarly = () => {\n\t\t\tif (over) return false;\n\t\t\tfinish(\n\t\t\t\tawaits === \"lateView\"\n\t\t\t\t\t? { kind: \"handoff\", token: held.token, rows, width, generation, keys: this.screen.keyPresses }\n\t\t\t\t\t: LIVE,\n\t\t\t);\n\t\t\treturn true;\n\t\t};\n\t\tconst timer = setTimeout(() => {\n\t\t\tif (endEarly()) this.ui.requestRender();\n\t\t}, PROMPT_SLOT_HOLD_MS);\n\t\ttimer.unref?.();\n\t\tconst held: HeldSlot = { kind: \"held\", awaits, token: {}, rows, width, generation, end, endEarly };\n\t\tthis.state = held;\n\t\treturn held;\n\t}\n}\n"]}
@@ -4,6 +4,8 @@ import type { SteeringLane, SteeringQueuedTexts, SteeringQueueLists } from "../s
4
4
  export interface QueuedMessageRow {
5
5
  readonly lane: SteeringLane;
6
6
  readonly text: string;
7
+ /** The agent already took it: drawn until its own row shows, but no longer queued, so no key takes it back. */
8
+ readonly delivering?: true;
7
9
  }
8
10
  /** The label a row starts with: `Steering:` for the next turn boundary, `Follow-up:` for after the run. */
9
11
  export declare function queuedMessageLabel(lane: SteeringLane): "Steering" | "Follow-up";
@@ -16,8 +18,9 @@ export declare function queuedMessageRows(queued: Readonly<SteeringQueuedTexts>,
16
18
  export declare function queuedMessagesHint(dequeueKey: string): string;
17
19
  /**
18
20
  * The queued messages of one chat, drawn above its prompt: a blank line, one dim row per message cut to the width,
19
- * and the hint for the key that edits them. Draws nothing while nothing is queued. Rows are styled when the view is
20
- * built, so a chat rebuilds the view when its queue, key or theme changes.
21
+ * and, while one of them is still queued, the hint for the key that takes them back to edit. Draws nothing while
22
+ * nothing is queued. Rows are styled when the view is built, so a chat rebuilds the view when its queue, key or theme
23
+ * changes.
21
24
  */
22
25
  export declare class QueuedMessagesView implements Component {
23
26
  private readonly lines;
@@ -1 +1 @@
1
- {"version":3,"file":"queued-messages-view.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/queued-messages-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE7G,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED,2GAA2G;AAC3G,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,GAAG,WAAW,CAE/E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EACrC,UAAU,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GACvC,gBAAgB,EAAE,CASpB;AAED,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2B;IAEjD,YAAY,IAAI,EAAE,SAAS,gBAAgB,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAQ/F;IAED,UAAU,IAAI,IAAI,CAAG;IAErB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAG9B;CACD"}
1
+ {"version":3,"file":"queued-messages-view.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/queued-messages-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE7G,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+GAA+G;IAC/G,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;CAC3B;AAED,2GAA2G;AAC3G,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,GAAG,WAAW,CAE/E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EACrC,UAAU,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GACvC,gBAAgB,EAAE,CASpB;AAED,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2B;IAEjD,YAAY,IAAI,EAAE,SAAS,gBAAgB,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAU/F;IAED,UAAU,IAAI,IAAI,CAAG;IAErB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAG9B;CACD"}
@@ -8,9 +8,13 @@ export function queuedMessageLabel(lane) {
8
8
  * messages the agent already took whose own row its transcript does not show yet; each leads its lane until it does.
9
9
  */
10
10
  export function queuedMessageRows(queued, delivering) {
11
+ const rows = (lane, taken, waiting) => [
12
+ ...taken.map((text) => ({ lane, text, delivering: true })),
13
+ ...waiting.map((text) => ({ lane, text })),
14
+ ];
11
15
  return [
12
- ...[...(delivering?.steering ?? []), ...queued.steering].map((text) => ({ lane: "steer", text })),
13
- ...[...(delivering?.followUp ?? []), ...queued.followUp].map((text) => ({ lane: "followUp", text })),
16
+ ...rows("steer", delivering?.steering ?? [], queued.steering),
17
+ ...rows("followUp", delivering?.followUp ?? [], queued.followUp),
14
18
  ];
15
19
  }
16
20
  /** The line under the rows that names the key taking every queued message back to the editor. */
@@ -19,8 +23,9 @@ export function queuedMessagesHint(dequeueKey) {
19
23
  }
20
24
  /**
21
25
  * The queued messages of one chat, drawn above its prompt: a blank line, one dim row per message cut to the width,
22
- * and the hint for the key that edits them. Draws nothing while nothing is queued. Rows are styled when the view is
23
- * built, so a chat rebuilds the view when its queue, key or theme changes.
26
+ * and, while one of them is still queued, the hint for the key that takes them back to edit. Draws nothing while
27
+ * nothing is queued. Rows are styled when the view is built, so a chat rebuilds the view when its queue, key or theme
28
+ * changes.
24
29
  */
25
30
  export class QueuedMessagesView {
26
31
  lines;
@@ -30,7 +35,9 @@ export class QueuedMessagesView {
30
35
  ? []
31
36
  : [
32
37
  ...rows.map((row) => new TruncatedText(dim(`${queuedMessageLabel(row.lane)}: ${row.text}`), 1, 0)),
33
- new TruncatedText(dim(queuedMessagesHint(dequeueKey)), 1, 0),
38
+ ...(rows.some((row) => row.delivering !== true)
39
+ ? [new TruncatedText(dim(queuedMessagesHint(dequeueKey)), 1, 0)]
40
+ : []),
34
41
  ];
35
42
  }
36
43
  invalidate() { }
@@ -1 +1 @@
1
- {"version":3,"file":"queued-messages-view.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/queued-messages-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAS5E,2GAA2G;AAC3G,MAAM,UAAU,kBAAkB,CAAC,IAAkB;IACpD,OAAO,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAqC,EACrC,UAAyC;IAEzC,OAAO;QACN,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAC3D,CAAC,IAAI,EAAoB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CACrD;QACD,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAC3D,CAAC,IAAI,EAAoB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACxD;KACD,CAAC;AACH,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACpD,OAAO,KAAK,UAAU,8BAA8B,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IACb,KAAK,CAA2B;IAEjD,YAAY,IAAiC,EAAE,UAAkB,EAAE,GAA6B;QAC/F,IAAI,CAAC,KAAK;YACT,IAAI,CAAC,MAAM,KAAK,CAAC;gBAChB,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACA,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBAClG,IAAI,aAAa,CAAC,GAAG,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;iBAC5D,CAAC;IACN,CAAC;IAED,UAAU,KAAU,CAAC;IAErB,MAAM,CAAC,KAAa;QACnB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACvC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;CACD","sourcesContent":["import { type Component, Spacer, TruncatedText } from \"@bastani/atomic-tui\";\nimport type { SteeringLane, SteeringQueuedTexts, SteeringQueueLists } from \"../steering-queue-controller.ts\";\n\n/** One queued message as a chat lists it above its prompt. */\nexport interface QueuedMessageRow {\n\treadonly lane: SteeringLane;\n\treadonly text: string;\n}\n\n/** The label a row starts with: `Steering:` for the next turn boundary, `Follow-up:` for after the run. */\nexport function queuedMessageLabel(lane: SteeringLane): \"Steering\" | \"Follow-up\" {\n\treturn lane === \"steer\" ? \"Steering\" : \"Follow-up\";\n}\n\n/**\n * The rows for `queued`: every steering message, then every follow-up, each lane in delivery order. `delivering` are\n * messages the agent already took whose own row its transcript does not show yet; each leads its lane until it does.\n */\nexport function queuedMessageRows(\n\tqueued: Readonly<SteeringQueuedTexts>,\n\tdelivering?: Readonly<SteeringQueueLists>,\n): QueuedMessageRow[] {\n\treturn [\n\t\t...[...(delivering?.steering ?? []), ...queued.steering].map(\n\t\t\t(text): QueuedMessageRow => ({ lane: \"steer\", text }),\n\t\t),\n\t\t...[...(delivering?.followUp ?? []), ...queued.followUp].map(\n\t\t\t(text): QueuedMessageRow => ({ lane: \"followUp\", text }),\n\t\t),\n\t];\n}\n\n/** The line under the rows that names the key taking every queued message back to the editor. */\nexport function queuedMessagesHint(dequeueKey: string): string {\n\treturn `↳ ${dequeueKey} to edit all queued messages`;\n}\n\n/**\n * The queued messages of one chat, drawn above its prompt: a blank line, one dim row per message cut to the width,\n * and the hint for the key that edits them. Draws nothing while nothing is queued. Rows are styled when the view is\n * built, so a chat rebuilds the view when its queue, key or theme changes.\n */\nexport class QueuedMessagesView implements Component {\n\tprivate readonly lines: readonly TruncatedText[];\n\n\tconstructor(rows: readonly QueuedMessageRow[], dequeueKey: string, dim: (text: string) => string) {\n\t\tthis.lines =\n\t\t\trows.length === 0\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t...rows.map((row) => new TruncatedText(dim(`${queuedMessageLabel(row.lane)}: ${row.text}`), 1, 0)),\n\t\t\t\t\t\tnew TruncatedText(dim(queuedMessagesHint(dequeueKey)), 1, 0),\n\t\t\t\t\t];\n\t}\n\n\tinvalidate(): void {}\n\n\trender(width: number): string[] {\n\t\tif (this.lines.length === 0) return [];\n\t\treturn [...new Spacer(1).render(width), ...this.lines.flatMap((line) => line.render(width))];\n\t}\n}\n"]}
1
+ {"version":3,"file":"queued-messages-view.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/queued-messages-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAW5E,2GAA2G;AAC3G,MAAM,UAAU,kBAAkB,CAAC,IAAkB;IACpD,OAAO,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAqC,EACrC,UAAyC;IAEzC,MAAM,IAAI,GAAG,CAAC,IAAkB,EAAE,KAAwB,EAAE,OAA0B,EAAsB,EAAE,CAAC;QAC9G,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAoB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5E,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAoB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;KAC5D,CAAC;IACF,OAAO;QACN,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC;QAC7D,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC;KAChE,CAAC;AACH,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACpD,OAAO,KAAK,UAAU,8BAA8B,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IACb,KAAK,CAA2B;IAEjD,YAAY,IAAiC,EAAE,UAAkB,EAAE,GAA6B;QAC/F,IAAI,CAAC,KAAK;YACT,IAAI,CAAC,MAAM,KAAK,CAAC;gBAChB,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACA,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBAClG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,KAAK,IAAI,CAAC;wBAC9C,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;wBAChE,CAAC,CAAC,EAAE,CAAC;iBACN,CAAC;IACN,CAAC;IAED,UAAU,KAAU,CAAC;IAErB,MAAM,CAAC,KAAa;QACnB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACvC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;CACD","sourcesContent":["import { type Component, Spacer, TruncatedText } from \"@bastani/atomic-tui\";\nimport type { SteeringLane, SteeringQueuedTexts, SteeringQueueLists } from \"../steering-queue-controller.ts\";\n\n/** One queued message as a chat lists it above its prompt. */\nexport interface QueuedMessageRow {\n\treadonly lane: SteeringLane;\n\treadonly text: string;\n\t/** The agent already took it: drawn until its own row shows, but no longer queued, so no key takes it back. */\n\treadonly delivering?: true;\n}\n\n/** The label a row starts with: `Steering:` for the next turn boundary, `Follow-up:` for after the run. */\nexport function queuedMessageLabel(lane: SteeringLane): \"Steering\" | \"Follow-up\" {\n\treturn lane === \"steer\" ? \"Steering\" : \"Follow-up\";\n}\n\n/**\n * The rows for `queued`: every steering message, then every follow-up, each lane in delivery order. `delivering` are\n * messages the agent already took whose own row its transcript does not show yet; each leads its lane until it does.\n */\nexport function queuedMessageRows(\n\tqueued: Readonly<SteeringQueuedTexts>,\n\tdelivering?: Readonly<SteeringQueueLists>,\n): QueuedMessageRow[] {\n\tconst rows = (lane: SteeringLane, taken: readonly string[], waiting: readonly string[]): QueuedMessageRow[] => [\n\t\t...taken.map((text): QueuedMessageRow => ({ lane, text, delivering: true })),\n\t\t...waiting.map((text): QueuedMessageRow => ({ lane, text })),\n\t];\n\treturn [\n\t\t...rows(\"steer\", delivering?.steering ?? [], queued.steering),\n\t\t...rows(\"followUp\", delivering?.followUp ?? [], queued.followUp),\n\t];\n}\n\n/** The line under the rows that names the key taking every queued message back to the editor. */\nexport function queuedMessagesHint(dequeueKey: string): string {\n\treturn `↳ ${dequeueKey} to edit all queued messages`;\n}\n\n/**\n * The queued messages of one chat, drawn above its prompt: a blank line, one dim row per message cut to the width,\n * and, while one of them is still queued, the hint for the key that takes them back to edit. Draws nothing while\n * nothing is queued. Rows are styled when the view is built, so a chat rebuilds the view when its queue, key or theme\n * changes.\n */\nexport class QueuedMessagesView implements Component {\n\tprivate readonly lines: readonly TruncatedText[];\n\n\tconstructor(rows: readonly QueuedMessageRow[], dequeueKey: string, dim: (text: string) => string) {\n\t\tthis.lines =\n\t\t\trows.length === 0\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t...rows.map((row) => new TruncatedText(dim(`${queuedMessageLabel(row.lane)}: ${row.text}`), 1, 0)),\n\t\t\t\t\t\t...(rows.some((row) => row.delivering !== true)\n\t\t\t\t\t\t\t? [new TruncatedText(dim(queuedMessagesHint(dequeueKey)), 1, 0)]\n\t\t\t\t\t\t\t: []),\n\t\t\t\t\t];\n\t}\n\n\tinvalidate(): void {}\n\n\trender(width: number): string[] {\n\t\tif (this.lines.length === 0) return [];\n\t\treturn [...new Spacer(1).render(width), ...this.lines.flatMap((line) => line.render(width))];\n\t}\n}\n"]}
@@ -1,7 +1,9 @@
1
1
  import { type AgentPanelItem } from "../../../core/tasks/agent-panel-source.ts";
2
2
  import type { TaskRecord } from "../../../core/tasks/contracts.js";
3
3
  import type { ModelCellReport } from "./model-column.ts";
4
- export type TaskBoardState = AgentPanelItem["state"];
4
+ import { type TaskMark } from "./task-marks.ts";
5
+ import { type TaskBoardState, taskBoardState } from "./task-row.js";
6
+ export { type TaskBoardState, taskBoardState };
5
7
  export type TaskBoardItem = AgentPanelItem;
6
8
  export type TaskBoardRow = {
7
9
  readonly id: string;
@@ -14,7 +16,6 @@ export type TaskBoardRow = {
14
16
  };
15
17
  export type TaskBoardGroup = "input" | "working" | "waiting" | "done";
16
18
  export declare const TASK_BOARD_GROUP_TITLES: Readonly<Record<TaskBoardGroup, string>>;
17
- export declare function taskBoardState(task: TaskRecord): TaskBoardState;
18
19
  export declare function rowState(row: TaskBoardRow): TaskBoardState;
19
20
  export declare function stateGroup(state: TaskBoardState): TaskBoardGroup;
20
21
  export declare function rowFinished(row: TaskBoardRow): boolean;
@@ -26,11 +27,8 @@ export declare function taskBoardGroups(rows: readonly TaskBoardRow[]): {
26
27
  rows: TaskBoardRow[];
27
28
  }[];
28
29
  export declare function taskBoardCounts(rows: readonly TaskBoardRow[]): string;
29
- type Glyph = {
30
- glyph: string;
31
- color: "accent" | "success" | "error" | "warning" | "muted" | "dim";
32
- };
33
- export declare function stateGlyph(state: TaskBoardState, kind?: TaskBoardItem["kind"] | "command"): Glyph;
30
+ /** A row's mark: the agent panel's for its state, the hourglass for a running shell. */
31
+ export declare function stateGlyph(state: TaskBoardState, kind?: TaskBoardItem["kind"] | "command"): TaskMark;
34
32
  export declare function rowMeta(row: TaskBoardRow): string;
35
33
  /** A row's model column text, as the agent panel shows it, and its width in cells. */
36
34
  export interface BoardRowModel {
@@ -68,5 +66,4 @@ export type PeekContent = {
68
66
  };
69
67
  export declare function renderPeekCard(title: string, content: PeekContent, replyLines: readonly string[], width: number, maxLines?: number): string[];
70
68
  export declare function rowMatches(row: TaskBoardRow, filter: string): boolean;
71
- export {};
72
69
  //# sourceMappingURL=task-board.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-board.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-board.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAqC,MAAM,2CAA2C,CAAC;AAEnH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAMnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAE3C,MAAM,MAAM,YAAY,GACrB;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GACzE;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAEhF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AACtE,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAK5E,CAAC;AAEF,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,CAyB/D;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,cAAc,CAE1D;A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CA2CR;AAED,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAE5B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,wBAAgB,cAAc,CAC7B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,KAAK,EAAE,MAAM,EACb,QAAQ,SAAI,GACV,MAAM,EAAE,CAoBV;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAIrE"}
@@ -6,41 +6,15 @@ import { isTaskTurnInterrupted } from "../../../core/tasks/owner-store.js";
6
6
  import { formatTokenCount } from "../../../utils/token-count.js";
7
7
  import { theme } from "../theme/theme.js";
8
8
  import { AGENT_PANEL_MODEL_MIN_WIDTH, formatPanelElapsed, panelModelText } from "./agent-panel.js";
9
- import { DONE_TASK_MARKER, RUNNING_TASK_MARKER, STOPPED_TASK_MARKER, WAITING_MARKER } from "./notice-line.js";
10
- import { taskDisplayText, taskLabel, taskState } from "./task-row.js";
9
+ import { taskMark } from "./task-marks.js";
10
+ import { taskBoardState, taskDisplayText, taskLabel } from "./task-row.js";
11
+ export { taskBoardState };
11
12
  export const TASK_BOARD_GROUP_TITLES = {
12
13
  input: "Needs input",
13
14
  working: "Working",
14
15
  waiting: "Waiting",
15
16
  done: "Done",
16
17
  };
17
- export function taskBoardState(task) {
18
- if (isTaskTurnInterrupted(task))
19
- return "paused";
20
- switch (taskState(task)) {
21
- case "input-needed":
22
- return "input";
23
- case "queued":
24
- return "queued";
25
- case "cancelling":
26
- return "stopping";
27
- case "completed":
28
- return "done";
29
- case "failed":
30
- return "failed";
31
- case "paused":
32
- return "stopped";
33
- case "killed":
34
- case "cancelled":
35
- return "stopped";
36
- case "released":
37
- return "waiting";
38
- case "running":
39
- return "running";
40
- default:
41
- return task.execution.kind === "settled" ? "done" : "running";
42
- }
43
- }
44
18
  export function rowState(row) {
45
19
  return row.kind === "task" ? taskBoardState(row.task) : row.item.state;
46
20
  }
@@ -87,27 +61,9 @@ export function taskBoardCounts(rows) {
87
61
  .filter(Boolean)
88
62
  .join(" · ");
89
63
  }
64
+ /** A row's mark: the agent panel's for its state, the hourglass for a running shell. */
90
65
  export function stateGlyph(state, kind) {
91
- switch (state) {
92
- case "input":
93
- return { glyph: "◆", color: "warning" };
94
- case "queued":
95
- return { glyph: "○", color: "muted" };
96
- case "stopping":
97
- return { glyph: "◼", color: "warning" };
98
- case "waiting":
99
- return WAITING_MARKER;
100
- case "done":
101
- return DONE_TASK_MARKER;
102
- case "failed":
103
- return { glyph: "✗", color: "error" };
104
- case "paused":
105
- return { glyph: "‖", color: "muted" };
106
- case "stopped":
107
- return STOPPED_TASK_MARKER;
108
- default:
109
- return kind === "shell" || kind === "command" ? { glyph: "⧗", color: "accent" } : RUNNING_TASK_MARKER;
110
- }
66
+ return taskMark(state, kind === "shell" || kind === "command");
111
67
  }
112
68
  function rowElapsed(row) {
113
69
  const span = row.kind === "task" ? row.task.elapsedSpan : row.item.elapsedSpan;
@@ -1 +1 @@
1
- {"version":3,"file":"task-board.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAuB,iBAAiB,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,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MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACzF,CAAC","sourcesContent":["import { stripTerminalSequences, truncateToWidth, visibleWidth } from \"@bastani/atomic-tui\";\nimport { type AgentPanelItem, modelHasReasoning, taskPanelModel } from \"../../../core/tasks/agent-panel-source.ts\";\nimport { waitingReleasedTools } from \"../../../core/tasks/completion.js\";\nimport type { TaskRecord } from \"../../../core/tasks/contracts.js\";\nimport { shownSpanMs, taskClockOf, taskClockRunning } from \"../../../core/tasks/live-elapsed.js\";\nimport { isTaskTurnInterrupted } from \"../../../core/tasks/owner-store.js\";\nimport { formatTokenCount } from \"../../../utils/token-count.ts\";\nimport { theme } from \"../theme/theme.js\";\nimport { AGENT_PANEL_MODEL_MIN_WIDTH, formatPanelElapsed, panelModelText } from \"./agent-panel.ts\";\nimport type { ModelCellReport } from \"./model-column.ts\";\nimport { DONE_TASK_MARKER, RUNNING_TASK_MARKER, STOPPED_TASK_MARKER, WAITING_MARKER } from \"./notice-line.ts\";\nimport { taskDisplayText, taskLabel, taskState } from \"./task-row.js\";\n\nexport type TaskBoardState = AgentPanelItem[\"state\"];\n\nexport type TaskBoardItem = AgentPanelItem;\n\nexport type TaskBoardRow =\n\t| { readonly id: string; readonly kind: \"task\"; readonly task: TaskRecord }\n\t| { readonly id: string; readonly kind: \"item\"; readonly item: TaskBoardItem };\n\nexport type TaskBoardGroup = \"input\" | \"working\" | \"waiting\" | \"done\";\nexport const TASK_BOARD_GROUP_TITLES: Readonly<Record<TaskBoardGroup, string>> = {\n\tinput: \"Needs input\",\n\tworking: \"Working\",\n\twaiting: \"Waiting\",\n\tdone: \"Done\",\n};\n\nexport function taskBoardState(task: TaskRecord): TaskBoardState {\n\tif (isTaskTurnInterrupted(task)) return \"paused\";\n\tswitch (taskState(task)) {\n\t\tcase \"input-needed\":\n\t\t\treturn \"input\";\n\t\tcase \"queued\":\n\t\t\treturn \"queued\";\n\t\tcase \"cancelling\":\n\t\t\treturn \"stopping\";\n\t\tcase \"completed\":\n\t\t\treturn \"done\";\n\t\tcase \"failed\":\n\t\t\treturn \"failed\";\n\t\tcase \"paused\":\n\t\t\treturn \"stopped\";\n\t\tcase \"killed\":\n\t\tcase \"cancelled\":\n\t\t\treturn \"stopped\";\n\t\tcase \"released\":\n\t\t\treturn \"waiting\";\n\t\tcase \"running\":\n\t\t\treturn \"running\";\n\t\tdefault:\n\t\t\treturn task.execution.kind === \"settled\" ? \"done\" : \"running\";\n\t}\n}\n\nexport function rowState(row: TaskBoardRow): TaskBoardState {\n\treturn row.kind === \"task\" ? taskBoardState(row.task) : row.item.state;\n}\n\nexport function stateGroup(state: TaskBoardState): TaskBoardGroup {\n\tif (state === \"input\") return \"input\";\n\tif (state === \"waiting\") return \"waiting\";\n\tif (state === \"running\" || state === \"queued\" || state === \"stopping\" || state === \"paused\") return \"working\";\n\treturn \"done\";\n}\n\nexport function rowFinished(row: TaskBoardRow): boolean {\n\treturn stateGroup(rowState(row)) === \"done\";\n}\n\nexport function rowName(row: TaskBoardRow): string {\n\tif (row.kind === \"item\") return taskDisplayText(row.item.name);\n\treturn taskDisplayText(row.task.kind === \"command\" ? \"shell\" : taskLabel(row.task));\n}\n\nexport function rowTask(row: TaskBoardRow): string {\n\tif (row.kind === \"item\")\n\t\treturn taskDisplayText(row.item.state === \"input\" && row.item.question ? row.item.question : row.item.task);\n\tif (row.task.attention.kind === \"input-needed\" && row.task.attention.prompt)\n\t\treturn taskDisplayText(row.task.attention.prompt);\n\treturn taskDisplayText(row.task.title || taskLabel(row.task));\n}\n\nexport function taskBoardGroups(\n\trows: readonly TaskBoardRow[],\n): { group: TaskBoardGroup; title: string; rows: TaskBoardRow[] }[] {\n\treturn ([\"input\", \"working\", \"waiting\", \"done\"] as const).flatMap((group) => {\n\t\tconst selected = rows.filter((row) => stateGroup(rowState(row)) === group);\n\t\treturn selected.length ? [{ group, title: TASK_BOARD_GROUP_TITLES[group], rows: selected }] : [];\n\t});\n}\n\nexport function taskBoardCounts(rows: readonly TaskBoardRow[]): string {\n\tconst counts = { input: 0, working: 0, waiting: 0, done: 0 };\n\tfor (const row of rows) counts[stateGroup(rowState(row))]++;\n\treturn [\n\t\tcounts.input ? `${counts.input} needs input` : \"\",\n\t\tcounts.working ? `${counts.working} working` : \"\",\n\t\tcounts.waiting ? `${counts.waiting} waiting` : \"\",\n\t\tcounts.done ? `${counts.done} done` : \"\",\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\" · \");\n}\n\ntype Glyph = { glyph: string; color: \"accent\" | \"success\" | \"error\" | \"warning\" | \"muted\" | \"dim\" };\n\nexport function stateGlyph(state: TaskBoardState, kind?: TaskBoardItem[\"kind\"] | \"command\"): Glyph {\n\tswitch (state) {\n\t\tcase \"input\":\n\t\t\treturn { glyph: \"◆\", color: \"warning\" };\n\t\tcase \"queued\":\n\t\t\treturn { glyph: \"○\", color: \"muted\" };\n\t\tcase \"stopping\":\n\t\t\treturn { glyph: \"◼\", color: \"warning\" };\n\t\tcase \"waiting\":\n\t\t\treturn WAITING_MARKER;\n\t\tcase \"done\":\n\t\t\treturn DONE_TASK_MARKER;\n\t\tcase \"failed\":\n\t\t\treturn { glyph: \"✗\", color: \"error\" };\n\t\tcase \"paused\":\n\t\t\treturn { glyph: \"‖\", color: \"muted\" };\n\t\tcase \"stopped\":\n\t\t\treturn STOPPED_TASK_MARKER;\n\t\tdefault:\n\t\t\treturn kind === \"shell\" || kind === \"command\" ? { glyph: \"⧗\", color: \"accent\" } : RUNNING_TASK_MARKER;\n\t}\n}\n\nfunction rowElapsed(row: TaskBoardRow): number | undefined {\n\tconst span = row.kind === \"task\" ? row.task.elapsedSpan : row.item.elapsedSpan;\n\tif (span) {\n\t\treturn row.kind === \"task\"\n\t\t\t? shownSpanMs(row.task.ref.taskId, span, taskClockOf(row.task))\n\t\t\t: shownSpanMs(row.item.id, span, taskClockOf(row.item));\n\t}\n\tif (row.kind === \"task\") {\n\t\tconst reported = row.task.metrics?.elapsedMs;\n\t\tif (!isTaskTurnInterrupted(row.task)) return reported;\n\t\treturn taskClockOf(row.task)?.elapsedMs(row.task.ref.taskId, reported, false) ?? reported;\n\t}\n\tif (row.item.state !== \"queued\") {\n\t\tconst clocks = taskClockOf(row.item);\n\t\tif (clocks !== undefined) {\n\t\t\treturn clocks.elapsedMs(row.item.id, row.item.elapsedMs, taskClockRunning(row.item.state));\n\t\t}\n\t}\n\treturn row.item.elapsedMs;\n}\nfunction rowWaitingOn(row: TaskBoardRow): string | undefined {\n\tif (row.kind === \"item\") return row.item.waitingOn;\n\treturn waitingReleasedTools(row.task);\n}\nfunction rowTokens(row: TaskBoardRow): number | undefined {\n\treturn row.kind === \"task\" ? row.task.metrics?.tokenCount : row.item.tokens;\n}\n\nfunction validMetric(value: number | undefined): value is number {\n\treturn value !== undefined && Number.isFinite(value) && value >= 0 && value <= Number.MAX_SAFE_INTEGER;\n}\n\nexport function rowMeta(row: TaskBoardRow): string {\n\tconst state = rowState(row);\n\tconst elapsed = rowElapsed(row);\n\tconst time = validMetric(elapsed) ? formatPanelElapsed(elapsed) : \"\";\n\tconst tokens = rowTokens(row);\n\tif (state === \"input\") return time ? `waiting ${time}` : \"waiting\";\n\tif (state === \"paused\" || state === \"stopped\") return [state, time].filter(Boolean).join(\" · \");\n\tif (state === \"failed\") return [\"failed\", time].filter(Boolean).join(\" · \");\n\tif (state === \"queued\") return \"queued\";\n\tif (state === \"waiting\")\n\t\treturn [`waiting on ${taskDisplayText(rowWaitingOn(row) ?? \"a tool call\")}`, time].filter(Boolean).join(\" · \");\n\tif (state === \"stopping\") return [\"stopping\", time].filter(Boolean).join(\" · \");\n\tif (state === \"done\") return [\"done\", time].filter(Boolean).join(\" · \");\n\treturn [time, validMetric(tokens) ? `↓ ${formatTokenCount(tokens)}` : \"\"].filter(Boolean).join(\" · \");\n}\n\nconst NAME_COLUMN = 14;\n/** The narrowest task a row keeps beside the model column. */\nconst MIN_TASK_WIDTH = 8;\n\nfunction nameColumnFor(width: number): number {\n\treturn Math.min(NAME_COLUMN, Math.max(6, Math.floor((width - 6) / 3)));\n}\n\n/** A row's model column text, as the agent panel shows it, and its width in cells. */\nexport interface BoardRowModel {\n\treadonly text: string;\n\treadonly width: number;\n}\n\nexport const NO_MODEL: BoardRowModel = { text: \"\", width: 0 };\n\n/**\n * A row's model column: empty for a shell and for a row with no known model. `owner` is the task store the row's task\n * belongs to: its session's model registry says whether the model has reasoning levels.\n */\nexport function rowModel(row: TaskBoardRow, owner?: object): BoardRowModel {\n\tconst text =\n\t\trow.kind === \"item\"\n\t\t\t? panelModelText(row.item)\n\t\t\t: row.task.kind === \"agent\"\n\t\t\t\t? panelModelText({ kind: \"agent\", ...taskPanelModel(row.task, owner ?? row.task) })\n\t\t\t\t: \"\";\n\treturn text.length === 0 ? NO_MODEL : { text, width: visibleWidth(text) };\n}\n\n/**\n * What a row with model cell `model` (its `rowModel`) reports to the view's `ModelColumn`: whether it names a model,\n * whether its reasoning level is known or the row finished, and, asked only when needed, whether `owner`'s model\n * registry gives its model no levels.\n */\nexport function rowModelReport(row: TaskBoardRow, model: BoardRowModel, owner?: object): ModelCellReport {\n\tconst reported = row.kind === \"task\" ? row.task : row.item;\n\treturn {\n\t\tmodel: model.width > 0 && typeof reported.model === \"string\" ? reported.model : undefined,\n\t\tsettled: Boolean(reported.thinking) || rowFinished(row),\n\t\tlevelless: () =>\n\t\t\ttypeof reported.model === \"string\" && modelHasReasoning(owner ?? reported, reported.model) === false,\n\t};\n}\n\n/**\n * Whether a model column `column` cells wide fits `rows` at `width`. As in the agent panel, rows narrower than 100\n * columns have none, and neither do rows where it would clip a row's right column or leave a task under 8 cells.\n */\nexport function boardModelFits(rows: readonly TaskBoardRow[], width: number): (column: number) => boolean {\n\treturn (column) => {\n\t\tif (width < AGENT_PANEL_MODEL_MIN_WIDTH) return false;\n\t\tconst fixed = 2 + 2 + nameColumnFor(width) + column + 2;\n\t\tfor (const row of rows) {\n\t\t\tconst meta = visibleWidth(rowMeta(row));\n\t\t\tconst right = meta > 0 ? 2 + meta : 0;\n\t\t\tif (fixed + right > width || (rowTask(row).length > 0 && width - fixed - right < MIN_TASK_WIDTH)) return false;\n\t\t}\n\t\treturn true;\n\t};\n}\n\n/** The width of the model column `rows` share at `width`, 0 for none; `models` are their `rowModel`s, in order. */\nexport function boardModelColumn(\n\trows: readonly TaskBoardRow[],\n\tmodels: readonly BoardRowModel[],\n\twidth: number,\n): number {\n\tlet column = 0;\n\tfor (const model of models) column = Math.max(column, model.width);\n\treturn column > 0 && boardModelFits(rows, width)(column) ? column : 0;\n}\n\n/** `model`: the model column every row of the list shares (`boardModelColumn`) and this row's cell of it. */\nexport function renderBoardRow(\n\trow: TaskBoardRow,\n\tselected: boolean,\n\twidth: number,\n\tmodel?: { readonly column: number; readonly cell: BoardRowModel },\n): string {\n\tconst state = rowState(row);\n\tconst { glyph, color } = stateGlyph(state, row.kind === \"task\" ? row.task.kind : row.item.kind);\n\tconst marker = selected ? theme.fg(\"accent\", \"❯ \") : \" \";\n\n\tconst nameColumn = nameColumnFor(width);\n\tconst modelColumn = model === undefined ? 0 : model.column;\n\tconst modelCell =\n\t\tmodel === undefined || modelColumn === 0\n\t\t\t? \"\"\n\t\t\t: `${model.cell.text}${\" \".repeat(Math.max(0, modelColumn - model.cell.width) + 2)}`;\n\tconst nameWidth = nameColumn + (modelColumn > 0 ? modelColumn + 2 : 0);\n\tconst name = truncateToWidth(rowName(row), nameColumn - 1);\n\tconst namePadded = name + \" \".repeat(Math.max(1, nameColumn - visibleWidth(name)));\n\tconst progress =\n\t\trow.kind === \"item\" &&\n\t\trow.item.progress &&\n\t\tvalidMetric(row.item.progress.done) &&\n\t\tvalidMetric(row.item.progress.total) &&\n\t\trow.item.progress.done <= row.item.progress.total &&\n\t\tstate !== \"input\"\n\t\t\t? `${row.item.progress.done}/${row.item.progress.total}`\n\t\t\t: \"\";\n\tconst reason = row.kind === \"item\" && state === \"failed\" && row.item.reason ? taskDisplayText(row.item.reason) : \"\";\n\tconst title = rowTask(row);\n\tconst task = [title, progress, reason === title ? \"\" : reason].filter(Boolean).join(\" · \");\n\tconst fullMeta = rowMeta(row);\n\tconst meta = 2 + 2 + nameWidth + 2 + visibleWidth(fullMeta) <= width ? fullMeta : \"\";\n\tconst fixed = 2 + 2 + nameWidth + (meta ? 2 + visibleWidth(meta) : 0);\n\tconst taskText = truncateToWidth(task, Math.max(0, width - fixed));\n\tconst gap = Math.max(meta ? 1 : 0, width - 2 - 2 - nameWidth - visibleWidth(taskText) - visibleWidth(meta));\n\tconst finished = stateGroup(state) === \"done\";\n\tconst nameText = selected ? theme.bold(namePadded) : finished ? theme.fg(\"muted\", namePadded) : namePadded;\n\tconst modelText = modelCell ? theme.fg(\"dim\", modelCell) : \"\";\n\tconst taskStyled = finished && !selected ? theme.fg(\"dim\", taskText) : theme.fg(\"muted\", taskText);\n\tconst line = truncateToWidth(\n\t\t`${marker}${theme.fg(color, glyph)} ${nameText}${modelText}${taskStyled}${\" \".repeat(gap)}${theme.fg(\"dim\", meta)}`,\n\t\twidth,\n\t\t\"...\",\n\t\ttrue,\n\t);\n\t// NO_COLOR: the row's mark and words say its state, so it carries no colour codes.\n\treturn process.env.NO_COLOR === undefined ? line : stripTerminalSequences(line);\n}\n\nexport type PeekContent = {\n\tquestion?: string;\n\tchoices?: readonly string[];\n\n\tlines: readonly string[];\n};\n\nexport function renderPeekCard(\n\ttitle: string,\n\tcontent: PeekContent,\n\treplyLines: readonly string[],\n\twidth: number,\n\tmaxLines = 8,\n): string[] {\n\tconst inner = Math.max(1, width - 4);\n\tconst border = (text: string) => theme.fg(\"borderMuted\", text);\n\tconst heading = ` ${truncateToWidth(title, Math.max(1, width - 8))} `;\n\tconst top = `${border(\"╭─\")}${theme.bold(heading)}${border(`${\"─\".repeat(Math.max(0, width - visibleWidth(heading) - 3))}╮`)}`;\n\tconst frame = (line: string) => {\n\t\tconst text = truncateToWidth(line, inner);\n\t\treturn `${border(\"│ \")}${text}${\" \".repeat(Math.max(0, inner - visibleWidth(text)))}${border(\" │\")}`;\n\t};\n\tconst body: string[] = [];\n\tif (content.question !== undefined) {\n\t\tbody.push(theme.bold(taskDisplayText(content.question)));\n\t\tfor (const [index, choice] of (content.choices ?? []).entries())\n\t\t\tbody.push(`${theme.fg(\"accent\", `${index + 1}`)} ${taskDisplayText(choice)}`);\n\t}\n\tfor (const line of content.lines) body.push(theme.fg(\"muted\", taskDisplayText(line)));\n\tconst clipped = body.slice(0, Math.max(1, maxLines));\n\treturn [top, ...clipped.map(frame), ...replyLines.map(frame), border(`╰${\"─\".repeat(Math.max(0, width - 2))}╯`)].map(\n\t\t(line) => truncateToWidth(line, width),\n\t);\n}\n\nexport function rowMatches(row: TaskBoardRow, filter: string): boolean {\n\tconst needle = filter.trim().toLowerCase();\n\tif (!needle) return true;\n\treturn [rowName(row), rowTask(row)].some((text) => text.toLowerCase().includes(needle));\n}\n"]}
1
+ {"version":3,"file":"task-board.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-board.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAuB,iBAAiB,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,gBAA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IAAI,CAAC;IACzB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACzF,CAAC","sourcesContent":["import { stripTerminalSequences, truncateToWidth, visibleWidth } from \"@bastani/atomic-tui\";\nimport { type AgentPanelItem, modelHasReasoning, taskPanelModel } from \"../../../core/tasks/agent-panel-source.ts\";\nimport { waitingReleasedTools } from \"../../../core/tasks/completion.js\";\nimport type { TaskRecord } from \"../../../core/tasks/contracts.js\";\nimport { shownSpanMs, taskClockOf, taskClockRunning } from \"../../../core/tasks/live-elapsed.js\";\nimport { isTaskTurnInterrupted } from \"../../../core/tasks/owner-store.js\";\nimport { formatTokenCount } from \"../../../utils/token-count.ts\";\nimport { theme } from \"../theme/theme.js\";\nimport { AGENT_PANEL_MODEL_MIN_WIDTH, formatPanelElapsed, panelModelText } from \"./agent-panel.ts\";\nimport type { ModelCellReport } from \"./model-column.ts\";\nimport { type TaskMark, taskMark } from \"./task-marks.ts\";\nimport { type TaskBoardState, taskBoardState, taskDisplayText, taskLabel } from \"./task-row.js\";\n\nexport { type TaskBoardState, taskBoardState };\n\nexport type TaskBoardItem = AgentPanelItem;\n\nexport type TaskBoardRow =\n\t| { readonly id: string; readonly kind: \"task\"; readonly task: TaskRecord }\n\t| { readonly id: string; readonly kind: \"item\"; readonly item: TaskBoardItem };\n\nexport type TaskBoardGroup = \"input\" | \"working\" | \"waiting\" | \"done\";\nexport const TASK_BOARD_GROUP_TITLES: Readonly<Record<TaskBoardGroup, string>> = {\n\tinput: \"Needs input\",\n\tworking: \"Working\",\n\twaiting: \"Waiting\",\n\tdone: \"Done\",\n};\n\nexport function rowState(row: TaskBoardRow): TaskBoardState {\n\treturn row.kind === \"task\" ? taskBoardState(row.task) : row.item.state;\n}\n\nexport function stateGroup(state: TaskBoardState): TaskBoardGroup {\n\tif (state === \"input\") return \"input\";\n\tif (state === \"waiting\") return \"waiting\";\n\tif (state === \"running\" || state === \"queued\" || state === \"stopping\" || state === \"paused\") return \"working\";\n\treturn \"done\";\n}\n\nexport function rowFinished(row: TaskBoardRow): boolean {\n\treturn stateGroup(rowState(row)) === \"done\";\n}\n\nexport function rowName(row: TaskBoardRow): string {\n\tif (row.kind === \"item\") return taskDisplayText(row.item.name);\n\treturn taskDisplayText(row.task.kind === \"command\" ? \"shell\" : taskLabel(row.task));\n}\n\nexport function rowTask(row: TaskBoardRow): string {\n\tif (row.kind === \"item\")\n\t\treturn taskDisplayText(row.item.state === \"input\" && row.item.question ? row.item.question : row.item.task);\n\tif (row.task.attention.kind === \"input-needed\" && row.task.attention.prompt)\n\t\treturn taskDisplayText(row.task.attention.prompt);\n\treturn taskDisplayText(row.task.title || taskLabel(row.task));\n}\n\nexport function taskBoardGroups(\n\trows: readonly TaskBoardRow[],\n): { group: TaskBoardGroup; title: string; rows: TaskBoardRow[] }[] {\n\treturn ([\"input\", \"working\", \"waiting\", \"done\"] as const).flatMap((group) => {\n\t\tconst selected = rows.filter((row) => stateGroup(rowState(row)) === group);\n\t\treturn selected.length ? [{ group, title: TASK_BOARD_GROUP_TITLES[group], rows: selected }] : [];\n\t});\n}\n\nexport function taskBoardCounts(rows: readonly TaskBoardRow[]): string {\n\tconst counts = { input: 0, working: 0, waiting: 0, done: 0 };\n\tfor (const row of rows) counts[stateGroup(rowState(row))]++;\n\treturn [\n\t\tcounts.input ? `${counts.input} needs input` : \"\",\n\t\tcounts.working ? `${counts.working} working` : \"\",\n\t\tcounts.waiting ? `${counts.waiting} waiting` : \"\",\n\t\tcounts.done ? `${counts.done} done` : \"\",\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\" · \");\n}\n\n/** A row's mark: the agent panel's for its state, the hourglass for a running shell. */\nexport function stateGlyph(state: TaskBoardState, kind?: TaskBoardItem[\"kind\"] | \"command\"): TaskMark {\n\treturn taskMark(state, kind === \"shell\" || kind === \"command\");\n}\n\nfunction rowElapsed(row: TaskBoardRow): number | undefined {\n\tconst span = row.kind === \"task\" ? row.task.elapsedSpan : row.item.elapsedSpan;\n\tif (span) {\n\t\treturn row.kind === \"task\"\n\t\t\t? shownSpanMs(row.task.ref.taskId, span, taskClockOf(row.task))\n\t\t\t: shownSpanMs(row.item.id, span, taskClockOf(row.item));\n\t}\n\tif (row.kind === \"task\") {\n\t\tconst reported = row.task.metrics?.elapsedMs;\n\t\tif (!isTaskTurnInterrupted(row.task)) return reported;\n\t\treturn taskClockOf(row.task)?.elapsedMs(row.task.ref.taskId, reported, false) ?? reported;\n\t}\n\tif (row.item.state !== \"queued\") {\n\t\tconst clocks = taskClockOf(row.item);\n\t\tif (clocks !== undefined) {\n\t\t\treturn clocks.elapsedMs(row.item.id, row.item.elapsedMs, taskClockRunning(row.item.state));\n\t\t}\n\t}\n\treturn row.item.elapsedMs;\n}\nfunction rowWaitingOn(row: TaskBoardRow): string | undefined {\n\tif (row.kind === \"item\") return row.item.waitingOn;\n\treturn waitingReleasedTools(row.task);\n}\nfunction rowTokens(row: TaskBoardRow): number | undefined {\n\treturn row.kind === \"task\" ? row.task.metrics?.tokenCount : row.item.tokens;\n}\n\nfunction validMetric(value: number | undefined): value is number {\n\treturn value !== undefined && Number.isFinite(value) && value >= 0 && value <= Number.MAX_SAFE_INTEGER;\n}\n\nexport function rowMeta(row: TaskBoardRow): string {\n\tconst state = rowState(row);\n\tconst elapsed = rowElapsed(row);\n\tconst time = validMetric(elapsed) ? formatPanelElapsed(elapsed) : \"\";\n\tconst tokens = rowTokens(row);\n\tif (state === \"input\") return time ? `waiting ${time}` : \"waiting\";\n\tif (state === \"paused\" || state === \"stopped\") return [state, time].filter(Boolean).join(\" · \");\n\tif (state === \"failed\") return [\"failed\", time].filter(Boolean).join(\" · \");\n\tif (state === \"queued\") return \"queued\";\n\tif (state === \"waiting\")\n\t\treturn [`waiting on ${taskDisplayText(rowWaitingOn(row) ?? \"a tool call\")}`, time].filter(Boolean).join(\" · \");\n\tif (state === \"stopping\") return [\"stopping\", time].filter(Boolean).join(\" · \");\n\tif (state === \"done\") return [\"done\", time].filter(Boolean).join(\" · \");\n\treturn [time, validMetric(tokens) ? `↓ ${formatTokenCount(tokens)}` : \"\"].filter(Boolean).join(\" · \");\n}\n\nconst NAME_COLUMN = 14;\n/** The narrowest task a row keeps beside the model column. */\nconst MIN_TASK_WIDTH = 8;\n\nfunction nameColumnFor(width: number): number {\n\treturn Math.min(NAME_COLUMN, Math.max(6, Math.floor((width - 6) / 3)));\n}\n\n/** A row's model column text, as the agent panel shows it, and its width in cells. */\nexport interface BoardRowModel {\n\treadonly text: string;\n\treadonly width: number;\n}\n\nexport const NO_MODEL: BoardRowModel = { text: \"\", width: 0 };\n\n/**\n * A row's model column: empty for a shell and for a row with no known model. `owner` is the task store the row's task\n * belongs to: its session's model registry says whether the model has reasoning levels.\n */\nexport function rowModel(row: TaskBoardRow, owner?: object): BoardRowModel {\n\tconst text =\n\t\trow.kind === \"item\"\n\t\t\t? panelModelText(row.item)\n\t\t\t: row.task.kind === \"agent\"\n\t\t\t\t? panelModelText({ kind: \"agent\", ...taskPanelModel(row.task, owner ?? row.task) })\n\t\t\t\t: \"\";\n\treturn text.length === 0 ? NO_MODEL : { text, width: visibleWidth(text) };\n}\n\n/**\n * What a row with model cell `model` (its `rowModel`) reports to the view's `ModelColumn`: whether it names a model,\n * whether its reasoning level is known or the row finished, and, asked only when needed, whether `owner`'s model\n * registry gives its model no levels.\n */\nexport function rowModelReport(row: TaskBoardRow, model: BoardRowModel, owner?: object): ModelCellReport {\n\tconst reported = row.kind === \"task\" ? row.task : row.item;\n\treturn {\n\t\tmodel: model.width > 0 && typeof reported.model === \"string\" ? reported.model : undefined,\n\t\tsettled: Boolean(reported.thinking) || rowFinished(row),\n\t\tlevelless: () =>\n\t\t\ttypeof reported.model === \"string\" && modelHasReasoning(owner ?? reported, reported.model) === false,\n\t};\n}\n\n/**\n * Whether a model column `column` cells wide fits `rows` at `width`. As in the agent panel, rows narrower than 100\n * columns have none, and neither do rows where it would clip a row's right column or leave a task under 8 cells.\n */\nexport function boardModelFits(rows: readonly TaskBoardRow[], width: number): (column: number) => boolean {\n\treturn (column) => {\n\t\tif (width < AGENT_PANEL_MODEL_MIN_WIDTH) return false;\n\t\tconst fixed = 2 + 2 + nameColumnFor(width) + column + 2;\n\t\tfor (const row of rows) {\n\t\t\tconst meta = visibleWidth(rowMeta(row));\n\t\t\tconst right = meta > 0 ? 2 + meta : 0;\n\t\t\tif (fixed + right > width || (rowTask(row).length > 0 && width - fixed - right < MIN_TASK_WIDTH)) return false;\n\t\t}\n\t\treturn true;\n\t};\n}\n\n/** The width of the model column `rows` share at `width`, 0 for none; `models` are their `rowModel`s, in order. */\nexport function boardModelColumn(\n\trows: readonly TaskBoardRow[],\n\tmodels: readonly BoardRowModel[],\n\twidth: number,\n): number {\n\tlet column = 0;\n\tfor (const model of models) column = Math.max(column, model.width);\n\treturn column > 0 && boardModelFits(rows, width)(column) ? column : 0;\n}\n\n/** `model`: the model column every row of the list shares (`boardModelColumn`) and this row's cell of it. */\nexport function renderBoardRow(\n\trow: TaskBoardRow,\n\tselected: boolean,\n\twidth: number,\n\tmodel?: { readonly column: number; readonly cell: BoardRowModel },\n): string {\n\tconst state = rowState(row);\n\tconst { glyph, color } = stateGlyph(state, row.kind === \"task\" ? row.task.kind : row.item.kind);\n\tconst marker = selected ? theme.fg(\"accent\", \"❯ \") : \" \";\n\n\tconst nameColumn = nameColumnFor(width);\n\tconst modelColumn = model === undefined ? 0 : model.column;\n\tconst modelCell =\n\t\tmodel === undefined || modelColumn === 0\n\t\t\t? \"\"\n\t\t\t: `${model.cell.text}${\" \".repeat(Math.max(0, modelColumn - model.cell.width) + 2)}`;\n\tconst nameWidth = nameColumn + (modelColumn > 0 ? modelColumn + 2 : 0);\n\tconst name = truncateToWidth(rowName(row), nameColumn - 1);\n\tconst namePadded = name + \" \".repeat(Math.max(1, nameColumn - visibleWidth(name)));\n\tconst progress =\n\t\trow.kind === \"item\" &&\n\t\trow.item.progress &&\n\t\tvalidMetric(row.item.progress.done) &&\n\t\tvalidMetric(row.item.progress.total) &&\n\t\trow.item.progress.done <= row.item.progress.total &&\n\t\tstate !== \"input\"\n\t\t\t? `${row.item.progress.done}/${row.item.progress.total}`\n\t\t\t: \"\";\n\tconst reason = row.kind === \"item\" && state === \"failed\" && row.item.reason ? taskDisplayText(row.item.reason) : \"\";\n\tconst title = rowTask(row);\n\tconst task = [title, progress, reason === title ? \"\" : reason].filter(Boolean).join(\" · \");\n\tconst fullMeta = rowMeta(row);\n\tconst meta = 2 + 2 + nameWidth + 2 + visibleWidth(fullMeta) <= width ? fullMeta : \"\";\n\tconst fixed = 2 + 2 + nameWidth + (meta ? 2 + visibleWidth(meta) : 0);\n\tconst taskText = truncateToWidth(task, Math.max(0, width - fixed));\n\tconst gap = Math.max(meta ? 1 : 0, width - 2 - 2 - nameWidth - visibleWidth(taskText) - visibleWidth(meta));\n\tconst finished = stateGroup(state) === \"done\";\n\tconst nameText = selected ? theme.bold(namePadded) : finished ? theme.fg(\"muted\", namePadded) : namePadded;\n\tconst modelText = modelCell ? theme.fg(\"dim\", modelCell) : \"\";\n\tconst taskStyled = finished && !selected ? theme.fg(\"dim\", taskText) : theme.fg(\"muted\", taskText);\n\tconst line = truncateToWidth(\n\t\t`${marker}${theme.fg(color, glyph)} ${nameText}${modelText}${taskStyled}${\" \".repeat(gap)}${theme.fg(\"dim\", meta)}`,\n\t\twidth,\n\t\t\"...\",\n\t\ttrue,\n\t);\n\t// NO_COLOR: the row's mark and words say its state, so it carries no colour codes.\n\treturn process.env.NO_COLOR === undefined ? line : stripTerminalSequences(line);\n}\n\nexport type PeekContent = {\n\tquestion?: string;\n\tchoices?: readonly string[];\n\n\tlines: readonly string[];\n};\n\nexport function renderPeekCard(\n\ttitle: string,\n\tcontent: PeekContent,\n\treplyLines: readonly string[],\n\twidth: number,\n\tmaxLines = 8,\n): string[] {\n\tconst inner = Math.max(1, width - 4);\n\tconst border = (text: string) => theme.fg(\"borderMuted\", text);\n\tconst heading = ` ${truncateToWidth(title, Math.max(1, width - 8))} `;\n\tconst top = `${border(\"╭─\")}${theme.bold(heading)}${border(`${\"─\".repeat(Math.max(0, width - visibleWidth(heading) - 3))}╮`)}`;\n\tconst frame = (line: string) => {\n\t\tconst text = truncateToWidth(line, inner);\n\t\treturn `${border(\"│ \")}${text}${\" \".repeat(Math.max(0, inner - visibleWidth(text)))}${border(\" │\")}`;\n\t};\n\tconst body: string[] = [];\n\tif (content.question !== undefined) {\n\t\tbody.push(theme.bold(taskDisplayText(content.question)));\n\t\tfor (const [index, choice] of (content.choices ?? []).entries())\n\t\t\tbody.push(`${theme.fg(\"accent\", `${index + 1}`)} ${taskDisplayText(choice)}`);\n\t}\n\tfor (const line of content.lines) body.push(theme.fg(\"muted\", taskDisplayText(line)));\n\tconst clipped = body.slice(0, Math.max(1, maxLines));\n\treturn [top, ...clipped.map(frame), ...replyLines.map(frame), border(`╰${\"─\".repeat(Math.max(0, width - 2))}╯`)].map(\n\t\t(line) => truncateToWidth(line, width),\n\t);\n}\n\nexport function rowMatches(row: TaskBoardRow, filter: string): boolean {\n\tconst needle = filter.trim().toLowerCase();\n\tif (!needle) return true;\n\treturn [rowName(row), rowTask(row)].some((text) => text.toLowerCase().includes(needle));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"task-completion-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-completion-message.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAA+D,MAAM,qBAAqB,CAAC;AAClH,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAIN,KAAK,oBAAoB,EAEzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAA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AO,CAAC,YAAY;CAqGpB"}
1
+ {"version":3,"file":"task-completion-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/task-completion-message.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAA+D,MAAM,qBAAqB,CAAC;AAClH,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAIN,KAAK,oBAAoB,EAEzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACrG,OAAO,EAEN,KAAK,qBAAqB,EAC1B,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUnE,OAAO,EAAE,KAAK,QAAQ,EAAY,MAAM,8BAA8B,CAAC;AAkCvE,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB,GAAG,SAAS,CAE9F;AAsDD,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAK3D;AA8ID,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CA0B/E;AAsHD,MAAM,MAAM,kCAAkC,GAC3C,qBAAqB,GACrB,qBAAqB,GACrB,UAAU,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC,GAC9C,SAAS,CAAC;AAEb,MAAM,WAAW,4BAA4B;IAC5C,6FAA6F;IAC7F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,8FAA8F;IAC9F,QAAQ,CAAC,cAAc,CAAC,EAAE,CACzB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,QAAQ,C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B,EAWtC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,2FAA2F;IAC3F,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE7C;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAInC;IAED,OAAO,IAAI,IAAI,CAId;IAED,8GAA8G;IAC9G,OAAO,CAAC,OAAO;IAWf,UAAU,IAAI,IAAI,CAGjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAM9B;IAED,OAAO,CAAC,sBAAsB;IAgD9B,OAAO,CAAC,YAAY;CAqGpB"}
@@ -230,13 +230,20 @@ function legacyStop(title, result) {
230
230
  },
231
231
  };
232
232
  }
233
+ /**
234
+ * The mark a saved line's status shows: a subagent paused or quit until it is resumed is stopped, as the agent panel
235
+ * and `/tasks` show it; its line keeps its `paused` status and its words.
236
+ */
237
+ function noticeMarkStatus(status) {
238
+ return status === "paused" ? "stopped" : status;
239
+ }
233
240
  export function taskNoticeLineSpec(notice) {
234
241
  const line = notice.line;
235
242
  if (isAgentNotice(notice)) {
236
243
  const status = line?.status ??
237
244
  (notice.status === "completed" ? "success" : notice.status === "failed" ? "failure" : "stopped");
238
245
  return {
239
- status,
246
+ status: noticeMarkStatus(status),
240
247
  label: agentNoticeName(notice),
241
248
  outcome: agentNoticeOutcome(status, line),
242
249
  ...(line?.elapsedMs === undefined ? {} : { meta: [noticeDuration(line.elapsedMs)] }),
@@ -244,7 +251,7 @@ export function taskNoticeLineSpec(notice) {
244
251
  }
245
252
  if (line !== undefined)
246
253
  return {
247
- status: line.status,
254
+ status: noticeMarkStatus(line.status),
248
255
  label: line.label,
249
256
  ...(line.subject === undefined ? {} : { subject: line.subject }),
250
257
  outcome: line.outcome,