@bastani/atomic 0.10.0 → 0.10.1-alpha.1

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 (233) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/builtin/intercom/package.json +1 -1
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  5. package/dist/builtin/subagents/package.json +1 -1
  6. package/dist/builtin/subagents/skills/tmux/scripts/wait-for-text.sh +33 -3
  7. package/dist/builtin/web-access/package.json +1 -1
  8. package/dist/core/agent-session-events.d.ts.map +1 -1
  9. package/dist/core/agent-session-events.js +21 -6
  10. package/dist/core/agent-session-events.js.map +1 -1
  11. package/dist/core/lifecycle-timings.d.ts +6 -0
  12. package/dist/core/lifecycle-timings.d.ts.map +1 -1
  13. package/dist/core/lifecycle-timings.js +12 -0
  14. package/dist/core/lifecycle-timings.js.map +1 -1
  15. package/dist/core/queued-message-delivery.d.ts +41 -0
  16. package/dist/core/queued-message-delivery.d.ts.map +1 -0
  17. package/dist/core/queued-message-delivery.js +48 -0
  18. package/dist/core/queued-message-delivery.js.map +1 -0
  19. package/dist/core/storage/node-sqlite-thread.d.ts +64 -0
  20. package/dist/core/storage/node-sqlite-thread.d.ts.map +1 -0
  21. package/dist/core/storage/node-sqlite-thread.js +326 -0
  22. package/dist/core/storage/node-sqlite-thread.js.map +1 -0
  23. package/dist/core/storage/node-sqlite.d.ts.map +1 -1
  24. package/dist/core/storage/node-sqlite.js +230 -104
  25. package/dist/core/storage/node-sqlite.js.map +1 -1
  26. package/dist/core/tasks/agent-panel-source.d.ts +5 -0
  27. package/dist/core/tasks/agent-panel-source.d.ts.map +1 -1
  28. package/dist/core/tasks/agent-panel-source.js +1 -1
  29. package/dist/core/tasks/agent-panel-source.js.map +1 -1
  30. package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts +8 -1
  31. package/dist/modes/interactive/agent-view/agent-view-bridge.d.ts.map +1 -1
  32. package/dist/modes/interactive/agent-view/agent-view-bridge.js.map +1 -1
  33. package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts +11 -5
  34. package/dist/modes/interactive/agent-view/agent-view-switcher.d.ts.map +1 -1
  35. package/dist/modes/interactive/agent-view/agent-view-switcher.js +17 -5
  36. package/dist/modes/interactive/agent-view/agent-view-switcher.js.map +1 -1
  37. package/dist/modes/interactive/agent-view/contracts.d.ts +5 -0
  38. package/dist/modes/interactive/agent-view/contracts.d.ts.map +1 -1
  39. package/dist/modes/interactive/agent-view/contracts.js.map +1 -1
  40. package/dist/modes/interactive/agent-view/install.d.ts.map +1 -1
  41. package/dist/modes/interactive/agent-view/install.js +6 -3
  42. package/dist/modes/interactive/agent-view/install.js.map +1 -1
  43. package/dist/modes/interactive/agent-view/local-port.d.ts +5 -0
  44. package/dist/modes/interactive/agent-view/local-port.d.ts.map +1 -1
  45. package/dist/modes/interactive/agent-view/local-port.js +8 -0
  46. package/dist/modes/interactive/agent-view/local-port.js.map +1 -1
  47. package/dist/modes/interactive/agent-view/remote-port.d.ts +4 -1
  48. package/dist/modes/interactive/agent-view/remote-port.d.ts.map +1 -1
  49. package/dist/modes/interactive/agent-view/remote-port.js +22 -8
  50. package/dist/modes/interactive/agent-view/remote-port.js.map +1 -1
  51. package/dist/modes/interactive/agent-view/transcript-slot.d.ts +9 -0
  52. package/dist/modes/interactive/agent-view/transcript-slot.d.ts.map +1 -1
  53. package/dist/modes/interactive/agent-view/transcript-slot.js +141 -1
  54. package/dist/modes/interactive/agent-view/transcript-slot.js.map +1 -1
  55. package/dist/modes/interactive/components/agent-panel.d.ts +6 -0
  56. package/dist/modes/interactive/components/agent-panel.d.ts.map +1 -1
  57. package/dist/modes/interactive/components/agent-panel.js +40 -10
  58. package/dist/modes/interactive/components/agent-panel.js.map +1 -1
  59. package/dist/modes/interactive/components/atomic-working-status.d.ts +15 -0
  60. package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -1
  61. package/dist/modes/interactive/components/atomic-working-status.js +51 -3
  62. package/dist/modes/interactive/components/atomic-working-status.js.map +1 -1
  63. package/dist/modes/interactive/components/bash-execution.d.ts +2 -0
  64. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  65. package/dist/modes/interactive/components/bash-execution.js +5 -1
  66. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  67. package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -0
  68. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  69. package/dist/modes/interactive/components/branch-summary-message.js +5 -1
  70. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  71. package/dist/modes/interactive/components/chat-message-renderer.d.ts +2 -0
  72. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  73. package/dist/modes/interactive/components/chat-message-renderer.js +17 -6
  74. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  75. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  76. package/dist/modes/interactive/components/chat-session-host-events.js +35 -4
  77. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  78. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  79. package/dist/modes/interactive/components/chat-session-host-rendering.js +70 -13
  80. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  81. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +7 -0
  82. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  83. package/dist/modes/interactive/components/chat-session-host-runtime.js +25 -4
  84. package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
  85. package/dist/modes/interactive/components/chat-session-host-state.d.ts +41 -1
  86. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  87. package/dist/modes/interactive/components/chat-session-host-state.js +24 -3
  88. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  89. package/dist/modes/interactive/components/chat-session-host-steering.d.ts.map +1 -1
  90. package/dist/modes/interactive/components/chat-session-host-steering.js +2 -1
  91. package/dist/modes/interactive/components/chat-session-host-steering.js.map +1 -1
  92. package/dist/modes/interactive/components/chat-session-host.d.ts +13 -1
  93. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  94. package/dist/modes/interactive/components/chat-session-host.js +20 -2
  95. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  96. package/dist/modes/interactive/components/chat-transcript.d.ts +15 -0
  97. package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
  98. package/dist/modes/interactive/components/chat-transcript.js +14 -1
  99. package/dist/modes/interactive/components/chat-transcript.js.map +1 -1
  100. package/dist/modes/interactive/components/compaction-boundary-message.d.ts +2 -0
  101. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  102. package/dist/modes/interactive/components/compaction-boundary-message.js +5 -1
  103. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  104. package/dist/modes/interactive/components/custom-entry.d.ts +2 -0
  105. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  106. package/dist/modes/interactive/components/custom-entry.js +5 -1
  107. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  108. package/dist/modes/interactive/components/custom-message.d.ts +2 -0
  109. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  110. package/dist/modes/interactive/components/custom-message.js +5 -1
  111. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  112. package/dist/modes/interactive/components/model-column.d.ts +96 -0
  113. package/dist/modes/interactive/components/model-column.d.ts.map +1 -0
  114. package/dist/modes/interactive/components/model-column.js +207 -0
  115. package/dist/modes/interactive/components/model-column.js.map +1 -0
  116. package/dist/modes/interactive/components/prompt-slot.d.ts +73 -0
  117. package/dist/modes/interactive/components/prompt-slot.d.ts.map +1 -0
  118. package/dist/modes/interactive/components/prompt-slot.js +201 -0
  119. package/dist/modes/interactive/components/prompt-slot.js.map +1 -0
  120. package/dist/modes/interactive/components/queued-messages-view.d.ts +6 -3
  121. package/dist/modes/interactive/components/queued-messages-view.d.ts.map +1 -1
  122. package/dist/modes/interactive/components/queued-messages-view.js +7 -4
  123. package/dist/modes/interactive/components/queued-messages-view.js.map +1 -1
  124. package/dist/modes/interactive/components/session-selector.d.ts +2 -0
  125. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  126. package/dist/modes/interactive/components/session-selector.js +4 -0
  127. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  128. package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -0
  129. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  130. package/dist/modes/interactive/components/skill-invocation-message.js +5 -1
  131. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  132. package/dist/modes/interactive/components/task-board.d.ts +12 -3
  133. package/dist/modes/interactive/components/task-board.d.ts.map +1 -1
  134. package/dist/modes/interactive/components/task-board.js +33 -17
  135. package/dist/modes/interactive/components/task-board.js.map +1 -1
  136. package/dist/modes/interactive/components/task-inspector.d.ts +6 -1
  137. package/dist/modes/interactive/components/task-inspector.d.ts.map +1 -1
  138. package/dist/modes/interactive/components/task-inspector.js +27 -7
  139. package/dist/modes/interactive/components/task-inspector.js.map +1 -1
  140. package/dist/modes/interactive/components/task-row.d.ts +4 -0
  141. package/dist/modes/interactive/components/task-row.d.ts.map +1 -1
  142. package/dist/modes/interactive/components/task-row.js +7 -1
  143. package/dist/modes/interactive/components/task-row.js.map +1 -1
  144. package/dist/modes/interactive/components/task-transcript-page.d.ts +5 -0
  145. package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
  146. package/dist/modes/interactive/components/task-transcript-page.js +25 -0
  147. package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
  148. package/dist/modes/interactive/components/tool-execution.d.ts +7 -0
  149. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  150. package/dist/modes/interactive/components/tool-execution.js +19 -2
  151. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  152. package/dist/modes/interactive/components/tool-group-tracker.d.ts +20 -3
  153. package/dist/modes/interactive/components/tool-group-tracker.d.ts.map +1 -1
  154. package/dist/modes/interactive/components/tool-group-tracker.js +34 -7
  155. package/dist/modes/interactive/components/tool-group-tracker.js.map +1 -1
  156. package/dist/modes/interactive/components/transcript-block-clicks.d.ts +14 -2
  157. package/dist/modes/interactive/components/transcript-block-clicks.d.ts.map +1 -1
  158. package/dist/modes/interactive/components/transcript-block-clicks.js +23 -2
  159. package/dist/modes/interactive/components/transcript-block-clicks.js.map +1 -1
  160. package/dist/modes/interactive/interactive-agent-events.js +10 -2
  161. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  162. package/dist/modes/interactive/interactive-extension-runtime.d.ts +12 -1
  163. package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
  164. package/dist/modes/interactive/interactive-extension-runtime.js +37 -5
  165. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  166. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  167. package/dist/modes/interactive/interactive-input-handling.js +70 -46
  168. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  169. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  170. package/dist/modes/interactive/interactive-mode-base.js +7 -1
  171. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  172. package/dist/modes/interactive/interactive-prompt-turn.js +17 -9
  173. package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
  174. package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
  175. package/dist/modes/interactive/interactive-queueing.js +2 -1
  176. package/dist/modes/interactive/interactive-queueing.js.map +1 -1
  177. package/dist/modes/interactive/interactive-render-chat.d.ts +18 -1
  178. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  179. package/dist/modes/interactive/interactive-render-chat.js +90 -10
  180. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  181. package/dist/modes/interactive/interactive-session-routing.js +2 -0
  182. package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
  183. package/dist/modes/interactive/interactive-task-projection.js +2 -2
  184. package/dist/modes/interactive/interactive-task-projection.js.map +1 -1
  185. package/dist/modes/interactive/screen-hold.d.ts +41 -0
  186. package/dist/modes/interactive/screen-hold.d.ts.map +1 -0
  187. package/dist/modes/interactive/screen-hold.js +80 -0
  188. package/dist/modes/interactive/screen-hold.js.map +1 -0
  189. package/dist/modes/interactive/started-run-echo.d.ts +66 -0
  190. package/dist/modes/interactive/started-run-echo.d.ts.map +1 -0
  191. package/dist/modes/interactive/started-run-echo.js +75 -0
  192. package/dist/modes/interactive/started-run-echo.js.map +1 -0
  193. package/dist/modes/interactive-engine/engine-custom-ui.d.ts +1 -0
  194. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  195. package/dist/modes/interactive-engine/engine-custom-ui.js +25 -1
  196. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  197. package/dist/modes/interactive-engine/engine-quit-intent.d.ts.map +1 -1
  198. package/dist/modes/interactive-engine/engine-quit-intent.js +3 -0
  199. package/dist/modes/interactive-engine/engine-quit-intent.js.map +1 -1
  200. package/dist/modes/interactive-engine/protocol.d.ts +5 -0
  201. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  202. package/dist/modes/interactive-engine/protocol.js +7 -1
  203. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  204. package/dist/modes/interactive-engine/remote-component.d.ts +10 -2
  205. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  206. package/dist/modes/interactive-engine/remote-component.js +19 -2
  207. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  208. package/dist/modes/interactive-engine/remote-renderer.d.ts +10 -0
  209. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
  210. package/dist/modes/interactive-engine/remote-renderer.js +24 -4
  211. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  212. package/dist/modes/interactive-engine/transcript-frame-layout.d.ts +50 -0
  213. package/dist/modes/interactive-engine/transcript-frame-layout.d.ts.map +1 -0
  214. package/dist/modes/interactive-engine/transcript-frame-layout.js +95 -0
  215. package/dist/modes/interactive-engine/transcript-frame-layout.js.map +1 -0
  216. package/dist/modes/rpc/agent-panel-bridge.d.ts.map +1 -1
  217. package/dist/modes/rpc/agent-panel-bridge.js +16 -0
  218. package/dist/modes/rpc/agent-panel-bridge.js.map +1 -1
  219. package/dist/modes/rpc/agent-view-engine-registry.d.ts.map +1 -1
  220. package/dist/modes/rpc/agent-view-engine-registry.js +36 -1
  221. package/dist/modes/rpc/agent-view-engine-registry.js.map +1 -1
  222. package/dist/modes/rpc/agent-view-rpc-panel.d.ts.map +1 -1
  223. package/dist/modes/rpc/agent-view-rpc-panel.js +5 -1
  224. package/dist/modes/rpc/agent-view-rpc-panel.js.map +1 -1
  225. package/dist/modes/rpc/task-ui-bridge.js +1 -1
  226. package/dist/modes/rpc/task-ui-bridge.js.map +1 -1
  227. package/docs/background-tasks.md +1 -1
  228. package/docs/development.md +2 -0
  229. package/docs/extensions/authoring.md +1 -1
  230. package/docs/keybindings.md +2 -2
  231. package/docs/storage.md +1 -0
  232. package/npm-shrinkwrap.json +49 -49
  233. package/package.json +6 -6
@@ -0,0 +1,201 @@
1
+ import { Container, stripHintMarkers } from "@bastani/atomic-tui";
2
+ import { ScreenHold } from "../screen-hold.js";
3
+ /**
4
+ * 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
5
+ * another process draws waits for that process to answer.
6
+ */
7
+ export const PROMPT_SLOT_HOLD_MS = 250;
8
+ /** Atomic's own views that can mount with nothing to draw yet, and how each tells. */
9
+ const firstContent = new WeakMap();
10
+ /**
11
+ * `view` has nothing to draw while `awaiting` answers true, as a panel the engine draws before its first frame: the
12
+ * prompt's slot keeps its rows meanwhile. Only views registered here are asked; any other component draws at once.
13
+ */
14
+ export function awaitFirstContent(view, awaiting) {
15
+ firstContent.set(view, awaiting);
16
+ }
17
+ function awaitsFirstContent(component) {
18
+ return firstContent.get(component)?.() === true;
19
+ }
20
+ const SETTLED = { settle: () => { } };
21
+ /** Keep `slot` as it is on screen until the view the running command opens is up, when it is the prompt's slot. */
22
+ export function holdPromptSlot(slot) {
23
+ return slot instanceof PromptSlot ? slot.hold() : SETTLED;
24
+ }
25
+ /**
26
+ * Whether what `slot` last drew is live and still current: not held rows, no view still waiting for its first frame,
27
+ * drawn onto the screen, and nothing mounted and no run's working status changed since.
28
+ */
29
+ export function promptSlotDrewLive(slot) {
30
+ return !(slot instanceof PromptSlot) || slot.drewLive;
31
+ }
32
+ /** The opening and closing sequences of an OSC 8 hyperlink; the text between them is kept. */
33
+ const HYPERLINK = /\x1b\]8;[^;\x07\x1b]*;[^\x07\x1b]*(?:\x07|\x1b\\)/g;
34
+ /** `row` as it looks, with nothing on it that a click could run: no key hints and no links. */
35
+ function inertRow(row) {
36
+ return stripHintMarkers(row).replace(HYPERLINK, "");
37
+ }
38
+ /**
39
+ * Where the prompt is drawn, or the selector or panel that takes its place. A slash command that opens a view clears
40
+ * the prompt at once, but its view can mount only after an await, or draw only after another process answers. Until
41
+ * then the slot keeps the rows it drew before, so the screen goes from the prompt straight to the view and the rows
42
+ * around it stay put. Only these rows wait: everything else on the screen keeps drawing.
43
+ *
44
+ * The rows come back live when the view is up and has something to draw, when the command ends without one, on the
45
+ * user's next key, at another width, or after `PROMPT_SLOT_HOLD_MS`. The slot holds only through the screen's hold
46
+ * (`ScreenHold`): never while another part of the screen is held, and only rows it drew from live content.
47
+ *
48
+ * A prompt that draws a run's working status in its own rows is never held: the hold would stop that status moving, and
49
+ * could keep showing it after the run ended.
50
+ */
51
+ export class PromptSlot extends Container {
52
+ state = { kind: "live" };
53
+ /** Counts changes of `children`. */
54
+ generation = 0;
55
+ /** What the last render drew. */
56
+ drawn;
57
+ showingHeldRows = false;
58
+ ui;
59
+ showsRunStatus;
60
+ screen;
61
+ /**
62
+ * `showsRunStatus` answers whether the prompt draws a run's working status in its rows now; `screen` is the hold of
63
+ * the screen the slot is on.
64
+ */
65
+ constructor(ui, showsRunStatus = () => false, screen = new ScreenHold()) {
66
+ super();
67
+ this.ui = ui;
68
+ this.showsRunStatus = showsRunStatus;
69
+ this.screen = screen;
70
+ }
71
+ /**
72
+ * Whether the last render drew live content that is still current (`promptSlotDrewLive`): what a held dock, which
73
+ * has the status area in it too, may keep.
74
+ */
75
+ get drewLive() {
76
+ const drawn = this.drawn;
77
+ return (drawn?.live === true && drawn.generation === this.generation && drawn.statusEpoch === this.screen.statusEpoch);
78
+ }
79
+ /**
80
+ * Whether a hold may keep what the last render drew: live content of the children the slot has now, with no run's
81
+ * working status in it. A status drawn elsewhere on the screen is not in these rows.
82
+ */
83
+ mayHold() {
84
+ const drawn = this.drawn;
85
+ return drawn?.live === true && drawn.generation === this.generation && !drawn.runStatus && !this.showsRunStatus();
86
+ }
87
+ addChild(component) {
88
+ this.generation++;
89
+ super.addChild(component);
90
+ }
91
+ removeChild(component) {
92
+ this.generation++;
93
+ super.removeChild(component);
94
+ }
95
+ clear() {
96
+ this.generation++;
97
+ super.clear();
98
+ }
99
+ /** Keep showing what the slot drew last until the view a command opens is up or the command settles. */
100
+ hold() {
101
+ const generation = this.generation;
102
+ let token;
103
+ this.screen.begin("prompt", (ended) => {
104
+ const drawn = this.drawn;
105
+ if (drawn === undefined || !this.mayHold())
106
+ return undefined;
107
+ const held = this.beginHold(drawn.rows, drawn.width, generation, ended);
108
+ token = held.token;
109
+ return held.end;
110
+ });
111
+ if (token === undefined)
112
+ return SETTLED;
113
+ const own = token;
114
+ return {
115
+ // A command that ends with nothing mounted shows the slot as it is; a mounted view decides for itself. The
116
+ // handle keeps only the hold's token, not its rows: a command can keep it until its view closes.
117
+ settle: () => {
118
+ const state = this.state;
119
+ if (state.kind === "held" && state.token === own && this.generation === generation) {
120
+ state.end();
121
+ this.ui.requestRender();
122
+ }
123
+ },
124
+ };
125
+ }
126
+ render(width) {
127
+ const live = super.render(width);
128
+ let rows = live;
129
+ const state = this.state;
130
+ const previous = this.drawn;
131
+ if (state.kind === "held") {
132
+ if (this.showsHeldRows(state, width))
133
+ rows = state.rows;
134
+ else
135
+ state.end();
136
+ }
137
+ else if (previous?.live === true &&
138
+ !previous.runStatus &&
139
+ previous.width === width &&
140
+ previous.generation !== this.generation &&
141
+ this.children.some(awaitsFirstContent) &&
142
+ !this.showsRunStatus()) {
143
+ // A view mounted with nothing to draw yet, as an engine panel before its first frame: the rows stay.
144
+ this.screen.begin("prompt", (ended) => {
145
+ const held = this.beginHold(previous.rows, width, previous.generation, ended);
146
+ rows = held.rows;
147
+ return held.end;
148
+ });
149
+ }
150
+ this.showingHeldRows = rows !== live;
151
+ this.drawn = {
152
+ width,
153
+ rows,
154
+ generation: this.generation,
155
+ // Under a held dock the slot is drawn unseen: what it draws then never reached the screen.
156
+ live: rows === live && !this.children.some(awaitsFirstContent) && this.screen.region !== "dock",
157
+ runStatus: this.showsRunStatus(),
158
+ statusEpoch: this.screen.statusEpoch,
159
+ };
160
+ return rows === live ? live : [...rows];
161
+ }
162
+ /** Held rows are a picture of what was there: a click on them reaches nothing. */
163
+ handleMouse(event) {
164
+ return this.showingHeldRows ? undefined : super.handleMouse(event);
165
+ }
166
+ showsHeldRows(state, width) {
167
+ if (width !== state.width || this.showsRunStatus())
168
+ return false;
169
+ return this.generation === state.generation || this.children.some(awaitsFirstContent);
170
+ }
171
+ beginHold(rows, width, generation, ended) {
172
+ let over = false;
173
+ const end = () => {
174
+ if (over)
175
+ return;
176
+ over = true;
177
+ clearTimeout(timer);
178
+ if (this.state === held)
179
+ this.state = { kind: "live" };
180
+ ended();
181
+ };
182
+ const timer = setTimeout(() => {
183
+ if (over)
184
+ return;
185
+ end();
186
+ this.ui.requestRender();
187
+ }, PROMPT_SLOT_HOLD_MS);
188
+ timer.unref?.();
189
+ const held = {
190
+ kind: "held",
191
+ token: {},
192
+ rows: rows.map(inertRow),
193
+ width,
194
+ generation,
195
+ end,
196
+ };
197
+ this.state = held;
198
+ return held;
199
+ }
200
+ }
201
+ //# sourceMappingURL=prompt-slot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-slot.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/prompt-slot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,gBAAgB,EAAgC,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,sFAAsF;AACtF,MAAM,YAAY,GAAG,IAAI,OAAO,EAA4B,CAAC;AAE7D;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAe,EAAE,QAAuB;IACzE,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,kBAAkB,CAAC,SAAoB;IAC/C,OAAO,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC;AACjD,CAAC;AAOD,MAAM,OAAO,GAAmB,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;AAErD,mHAAmH;AACnH,MAAM,UAAU,cAAc,CAAC,IAAe;IAC7C,OAAO,IAAI,YAAY,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAe;IACjD,OAAO,CAAC,CAAC,IAAI,YAAY,UAAU,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC;AACvD,CAAC;AAED,8FAA8F;AAC9F,MAAM,SAAS,GAAG,oDAAoD,CAAC;AAEvE,+FAA+F;AAC/F,SAAS,QAAQ,CAAC,GAAW;IAC5B,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC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,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,GAAG,CAAC,QAAQ,CAAC;YACxB,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\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:\n\t\t| {\n\t\t\t\treadonly width: number;\n\t\t\t\treadonly rows: readonly string[];\n\t\t\t\t/** The children it drew, counted by `generation`. */\n\t\t\t\treadonly generation: number;\n\t\t\t\t/** Live content drawn onto the screen: not held rows, not a view yet to draw, not under a held dock. */\n\t\t\t\treadonly live: boolean;\n\t\t\t\t/** It drew a run's working status in the prompt. */\n\t\t\t\treadonly runStatus: boolean;\n\t\t\t\t/** The working status changes counted when it drew (`ScreenHold.statusEpoch`). */\n\t\t\t\treadonly statusEpoch: number;\n\t\t }\n\t\t| 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.rows, 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.rows, 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\tprivate beginHold(\n\t\trows: readonly string[],\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\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: 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,5 +1,5 @@
1
1
  import { type Component } from "@bastani/atomic-tui";
2
- import type { SteeringLane, SteeringQueuedTexts } from "../steering-queue-controller.ts";
2
+ import type { SteeringLane, SteeringQueuedTexts, SteeringQueueLists } from "../steering-queue-controller.ts";
3
3
  /** One queued message as a chat lists it above its prompt. */
4
4
  export interface QueuedMessageRow {
5
5
  readonly lane: SteeringLane;
@@ -7,8 +7,11 @@ export interface QueuedMessageRow {
7
7
  }
8
8
  /** The label a row starts with: `Steering:` for the next turn boundary, `Follow-up:` for after the run. */
9
9
  export declare function queuedMessageLabel(lane: SteeringLane): "Steering" | "Follow-up";
10
- /** The rows for `queued`: every steering message, then every follow-up, each lane in delivery order. */
11
- export declare function queuedMessageRows(queued: Readonly<SteeringQueuedTexts>): QueuedMessageRow[];
10
+ /**
11
+ * The rows for `queued`: every steering message, then every follow-up, each lane in delivery order. `delivering` are
12
+ * messages the agent already took whose own row its transcript does not show yet; each leads its lane until it does.
13
+ */
14
+ export declare function queuedMessageRows(queued: Readonly<SteeringQueuedTexts>, delivering?: Readonly<SteeringQueueLists>): QueuedMessageRow[];
12
15
  /** The line under the rows that names the key taking every queued message back to the editor. */
13
16
  export declare function queuedMessagesHint(dequeueKey: string): string;
14
17
  /**
@@ -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,MAAM,iCAAiC,CAAC;AAEzF,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,wGAAwG;AACxG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GAAG,gBAAgB,EAAE,CAK3F;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;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"}
@@ -3,11 +3,14 @@ import { Spacer, TruncatedText } from "@bastani/atomic-tui";
3
3
  export function queuedMessageLabel(lane) {
4
4
  return lane === "steer" ? "Steering" : "Follow-up";
5
5
  }
6
- /** The rows for `queued`: every steering message, then every follow-up, each lane in delivery order. */
7
- export function queuedMessageRows(queued) {
6
+ /**
7
+ * The rows for `queued`: every steering message, then every follow-up, each lane in delivery order. `delivering` are
8
+ * messages the agent already took whose own row its transcript does not show yet; each leads its lane until it does.
9
+ */
10
+ export function queuedMessageRows(queued, delivering) {
8
11
  return [
9
- ...queued.steering.map((text) => ({ lane: "steer", text })),
10
- ...queued.followUp.map((text) => ({ lane: "followUp", text })),
12
+ ...[...(delivering?.steering ?? []), ...queued.steering].map((text) => ({ lane: "steer", text })),
13
+ ...[...(delivering?.followUp ?? []), ...queued.followUp].map((text) => ({ lane: "followUp", text })),
11
14
  ];
12
15
  }
13
16
  /** The line under the rows that names the key taking every queued message back to the editor. */
@@ -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,wGAAwG;AACxG,MAAM,UAAU,iBAAiB,CAAC,MAAqC;IACtE,OAAO;QACN,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAoB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7E,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAoB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;KAChF,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 } 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/** The rows for `queued`: every steering message, then every follow-up, each lane in delivery order. */\nexport function queuedMessageRows(queued: Readonly<SteeringQueuedTexts>): QueuedMessageRow[] {\n\treturn [\n\t\t...queued.steering.map((text): QueuedMessageRow => ({ lane: \"steer\", text })),\n\t\t...queued.followUp.map((text): QueuedMessageRow => ({ lane: \"followUp\", text })),\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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AG,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"]}
@@ -73,6 +73,8 @@ export declare class SessionSelectorComponent extends Container implements Focus
73
73
  refreshSessions(): Promise<void>;
74
74
  private toggleScope;
75
75
  getSessionList(): SessionList;
76
+ /** Nothing to list yet: the first load of this folder's sessions has not answered. */
77
+ awaitingFirstContent(): boolean;
76
78
  /**
77
79
  * Mark the selector closed so any in-flight or late-resolving loads are
78
80
  * ignored (stale-result guard) and status timeouts are cleared. Idempotent;
@@ -1 +1 @@
1
- {"version":3,"file":"session-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,SAAS,EACT,KAAK,SAAS,EAMd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAA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AAW;IAanB,cAAc,IAAI,WAAW,CAE5B;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAMd;CACD"}
1
+ {"version":3,"file":"session-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,SAAS,EACT,KAAK,SAAS,EAMd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,kCAAkC,CAAC;AAOzF,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAElF,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGhF;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,SAAU,YAAW,SAAS;IAC3E,IAAI,qBAAqB,IAAI,OAAO,CAEnC;IAED,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAiBjC;IAED,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IACtD,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,qBAAqB,CAAiB;IAC9C,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,aAAa,CAAC,CAA2E;IACjG,OAAO,CAAC,aAAa,CAAC,CAAuC;IAC7D,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,eAAe,CAA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AAO,CAAC,cAAc;YASR,aAAa;IAwB3B,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,oBAAoB;YAId,SAAS;YAsFT,eAAe;IAgB7B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,gBAAgB;YAOV,4BAA4B;IAK7B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAG5C;IAED,OAAO,CAAC,WAAW;IAanB,cAAc,IAAI,WAAW,CAE5B;IAED,sFAAsF;IACtF,oBAAoB,IAAI,OAAO,CAE9B;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAMd;CACD"}
@@ -403,6 +403,10 @@ export class SessionSelectorComponent extends Container {
403
403
  getSessionList() {
404
404
  return this.sessionList;
405
405
  }
406
+ /** Nothing to list yet: the first load of this folder's sessions has not answered. */
407
+ awaitingFirstContent() {
408
+ return !this.disposed && this.currentLoading && this.currentSessions === null;
409
+ }
406
410
  /**
407
411
  * Mark the selector closed so any in-flight or late-resolving loads are
408
412
  * ignored (stale-result guard) and status timeouts are cleared. Idempotent;
@@ -1 +1 @@
1
- {"version":3,"file":"session-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAEN,SAAS,EAET,cAAc,EACd,KAAK,EACL,UAAU,EACV,MAAM,EACN,IAAI,GACJ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,C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,CAAC;IAED;;;;OAIG;IACH,OAAO;QACN,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACD;AAED,SAAS,kBAAkB,CAAC,OAAoB;IAC/C,OAAO,OAAO,CAAC,YAAY,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC;AAC9F,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport {\n\ttype Component,\n\tContainer,\n\ttype Focusable,\n\tgetKeybindings,\n\tInput,\n\tmatchesKey,\n\tSpacer,\n\tText,\n} from \"@bastani/atomic-tui\";\nimport { getAgentDir } from \"../../../config.js\";\nimport { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport type { SessionInfo, SessionListProgress } from \"../../../core/session-manager.ts\";\nimport { assertSessionNotOpenElsewhere } from \"../../../core/session-open-markers.js\";\nimport { theme } from \"../theme/theme.js\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyTextHint } from \"./keybinding-hints.js\";\nimport { type DeleteSessionFileResult, deleteSessionFile } from \"./session-selector-delete.ts\";\nimport { SessionSelectorHeader } from \"./session-selector-header.ts\";\nimport { SessionList, type SessionListVariant } from \"./session-selector-list.ts\";\nimport type { NameFilter, SortMode } from \"./session-selector-search.ts\";\nimport type { SessionScope, SessionsLoader } from \"./session-selector-types.ts\";\nimport { resolveSessionPathKeys, sessionComparisonPaths } from \"./session-selector-utils.ts\";\n\n/**\n * Component that renders a session selector\n */\nexport class SessionSelectorComponent extends Container implements Focusable {\n\tget capturesViewportInput(): boolean {\n\t\treturn this.mode !== \"rename\";\n\t}\n\n\thandleInput(data: string): boolean {\n\t\tif (this.mode === \"rename\") {\n\t\t\tconst kb = getKeybindings();\n\t\t\tif (matchesKey(data, \"ctrl+c\")) {\n\t\t\t\tthis.exitRenameMode();\n\t\t\t\tthis.sessionList.onCancel?.();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (kb.matches(data, \"tui.select.cancel\")) {\n\t\t\t\tthis.exitRenameMode();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis.renameInput.handleInput(data);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn this.sessionList.handleInput(data);\n\t}\n\n\tprivate canRename = true;\n\tprivate sessionList: SessionList;\n\tprivate header: SessionSelectorHeader;\n\tprivate keybindings: KeybindingsManager;\n\tprivate scope: SessionScope = \"current\";\n\tprivate sortMode: SortMode = \"threaded\";\n\tprivate nameFilter: NameFilter = \"all\";\n\tprivate currentSessions: SessionInfo[] | null = null;\n\tprivate readonly currentDirectory: string | undefined;\n\tprivate allSessions: SessionInfo[] | null = null;\n\tprivate currentSessionsLoader: SessionsLoader;\n\tprivate allSessionsLoader: SessionsLoader;\n\tprivate onCancel: () => void;\n\tprivate requestRender: () => void;\n\tprivate renameSession?: (session: SessionInfo, currentName: string | undefined) => Promise<void>;\n\tprivate deleteSession?: (sessionId: string) => Promise<void>;\n\tprivate variant: SessionListVariant = \"sessions\";\n\tprivate deletedSessions = new Set<string>();\n\tprivate currentLoading = false;\n\tprivate allLoading = false;\n\tprivate currentLoadSeq = 0;\n\tprivate allLoadSeq = 0;\n\tprivate disposed = false;\n\n\tprivate mode: \"list\" | \"rename\" = \"list\";\n\tprivate renameInput = new Input();\n\tprivate renameTarget: SessionInfo | null = null;\n\n\t// Focusable implementation - propagate to sessionList for IME cursor positioning\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.sessionList.focused = value;\n\t\tthis.renameInput.focused = value;\n\t\tif (value && this.mode === \"rename\") {\n\t\t\tthis.renameInput.focused = true;\n\t\t}\n\t}\n\n\tprivate buildBaseLayout(content: Component, options?: { showHeader?: boolean }): void {\n\t\tthis.clear();\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new DynamicBorder((s) => theme.fg(\"borderMuted\", s)));\n\t\tif (options?.showHeader ?? true) this.addChild(this.header);\n\t\tthis.addChild(content);\n\t\tthis.addChild(new DynamicBorder((s) => theme.fg(\"borderMuted\", s)));\n\t}\n\n\tconstructor(\n\t\tcurrentSessionsLoader: SessionsLoader,\n\t\tallSessionsLoader: SessionsLoader,\n\t\tonSelect: (session: SessionInfo) => void,\n\t\tonCancel: () => void,\n\t\tonExit: () => void,\n\t\trequestRender: () => void,\n\t\toptions?: {\n\t\t\trenameSession?: (session: SessionInfo, currentName: string | undefined) => Promise<void>;\n\t\t\tdeleteSession?: (sessionId: string) => Promise<void>;\n\t\t\tshowRenameHint?: boolean;\n\t\t\tkeybindings?: KeybindingsManager;\n\t\t\t/**\n\t\t\t * Rows to display in the first rendered frame before the async loader\n\t\t\t * resolves (e.g. cheap in-memory rows). Seeding lets the\n\t\t\t * selector mount and stay interactive while durable/on-disk rows load,\n\t\t\t * and keeps live rows visible if the loader later errors.\n\t\t\t */\n\t\t\tinitialSessions?: SessionInfo[];\n\t\t\tvariant?: SessionListVariant;\n\t\t\ttitle?: string;\n\t\t\tcanDelete?: boolean;\n\t\t},\n\t\tcurrentSession?: { id: string; directory: string },\n\t) {\n\t\tsuper();\n\t\tthis.currentDirectory = currentSession?.directory;\n\t\tif (options?.keybindings) {\n\t\t\tthis.keybindings = options.keybindings;\n\t\t} else {\n\t\t\tthis.keybindings = new KeybindingsManager({}, join(getAgentDir(), \"keybindings.json\"));\n\t\t\tvoid this.keybindings.reloadAsync().then(() => {\n\t\t\t\tif (!this.disposed) this.requestRender();\n\t\t\t});\n\t\t}\n\t\tthis.currentSessionsLoader = currentSessionsLoader;\n\t\tthis.allSessionsLoader = allSessionsLoader;\n\t\tthis.onCancel = onCancel;\n\t\tthis.requestRender = requestRender;\n\t\tconst variant = options?.variant ?? \"sessions\";\n\t\tthis.variant = variant;\n\t\tif (variant === \"mixed\") {\n\t\t\tthis.sortMode = \"recent\";\n\t\t}\n\t\tthis.header = new SessionSelectorHeader(this.scope, this.sortMode, this.nameFilter, this.requestRender);\n\t\tconst renameSession = options?.renameSession;\n\t\tthis.renameSession = renameSession;\n\t\tthis.deleteSession = options?.deleteSession;\n\t\tthis.canRename = !!renameSession;\n\t\tthis.header.setVariant(variant);\n\t\tthis.header.setTitle(options?.title);\n\n\t\t// Create the session list. Seed with any provided initial rows so the very\n\t\t// first frame is populated (kept minimal/in-memory by the caller) while the\n\t\t// async loader resolves the full catalog off the host hot path.\n\t\tconst initialSessions = options?.initialSessions;\n\t\tthis.sessionList = new SessionList(\n\t\t\tinitialSessions ?? [],\n\t\t\tfalse,\n\t\t\tthis.sortMode,\n\t\t\tthis.nameFilter,\n\t\t\tthis.keybindings,\n\t\t\toptions?.deleteSession && currentSession ? { id: currentSession.id } : currentSession,\n\t\t);\n\t\tif (initialSessions !== undefined) {\n\t\t\tthis.currentSessions = initialSessions;\n\t\t}\n\t\tthis.sessionList.setVariant(variant);\n\t\tthis.sessionList.setCanDelete(options?.canDelete ?? true);\n\t\tthis.sessionList.setCanRename(options?.showRenameHint ?? this.canRename);\n\t\tthis.sessionList.setNoticeProvider(() => this.header.getNotice());\n\n\t\tthis.buildBaseLayout(this.sessionList);\n\n\t\tthis.renameInput.onSubmit = (value) => {\n\t\t\tvoid this.confirmRename(value);\n\t\t};\n\n\t\t// Ensure header status timeouts are cleared when leaving the selector\n\t\tconst clearStatusMessage = () => this.header.setStatusMessage(null);\n\t\tthis.sessionList.onSelect = (session) => {\n\t\t\tclearStatusMessage();\n\t\t\tonSelect(session);\n\t\t};\n\t\tthis.sessionList.onCancel = () => {\n\t\t\tclearStatusMessage();\n\t\t\tonCancel();\n\t\t};\n\t\tthis.sessionList.onExit = () => {\n\t\t\tclearStatusMessage();\n\t\t\tonExit();\n\t\t};\n\t\tthis.sessionList.onToggleScope = () => this.toggleScope();\n\t\tthis.sessionList.onToggleSort = () => this.toggleSortMode();\n\t\tthis.sessionList.onToggleNameFilter = () => this.toggleNameFilter();\n\t\tthis.sessionList.onRenameSession = (session) => {\n\t\t\tif (!renameSession || this.variant === \"runs\") return;\n\t\t\tthis.enterRenameMode(session);\n\t\t};\n\n\t\t// Sync list events to header\n\t\tthis.sessionList.onTogglePath = (showPath) => {\n\t\t\tthis.header.setShowPath(showPath);\n\t\t\tthis.requestRender();\n\t\t};\n\t\tthis.sessionList.onDeleteConfirmationChange = (path) => {\n\t\t\tthis.header.setConfirmingDeletePath(path);\n\t\t\tthis.requestRender();\n\t\t};\n\t\tthis.sessionList.onDeletePendingChange = () => {\n\t\t\tif (!this.disposed) this.requestRender();\n\t\t};\n\t\tthis.sessionList.onError = (msg) => {\n\t\t\tthis.header.setStatusMessage({ type: \"error\", message: msg }, 3000);\n\t\t\tthis.requestRender();\n\t\t};\n\n\t\t// Handle session deletion\n\t\tthis.sessionList.onDeleteSession = async (sessionPath, session) => {\n\t\t\tlet result: DeleteSessionFileResult;\n\t\t\ttry {\n\t\t\t\tif (options?.deleteSession) {\n\t\t\t\t\tawait options.deleteSession(session.id);\n\t\t\t\t\tresult = { ok: true, method: \"store\" };\n\t\t\t\t} else {\n\t\t\t\t\t// #4971: the store delete above refuses this on its own; a file delete checks here.\n\t\t\t\t\tawait assertSessionNotOpenElsewhere(session.id);\n\t\t\t\t\tresult = await deleteSessionFile(sessionPath);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tresult = { ok: false, method: \"store\", error: error instanceof Error ? error.message : String(error) };\n\t\t\t}\n\n\t\t\tif (this.disposed) return;\n\t\t\tif (result.ok) {\n\t\t\t\tthis.deletedSessions.add(this.deletedKey(session));\n\t\t\t\tif (this.currentSessions) {\n\t\t\t\t\tthis.currentSessions = this.currentSessions.filter((s) => !this.isDeletedSession(s));\n\t\t\t\t}\n\t\t\t\tif (this.allSessions) {\n\t\t\t\t\tthis.allSessions = this.allSessions.filter((s) => !this.isDeletedSession(s));\n\t\t\t\t}\n\n\t\t\t\tconst sessions = this.scope === \"all\" ? (this.allSessions ?? []) : (this.currentSessions ?? []);\n\t\t\t\tconst showCwd = this.scope === \"all\";\n\t\t\t\tthis.sessionList.setSessions(sessions, showCwd);\n\n\t\t\t\tconst msg =\n\t\t\t\t\tthis.variant === \"runs\"\n\t\t\t\t\t\t? \"Run deleted\"\n\t\t\t\t\t\t: result.method === \"trash\"\n\t\t\t\t\t\t\t? \"Session moved to trash\"\n\t\t\t\t\t\t\t: \"Session deleted\";\n\t\t\t\tthis.header.setStatusMessage({ type: \"info\", message: msg }, 2000);\n\t\t\t\tif (this.variant !== \"runs\") void this.refreshSessionsAfterMutation();\n\t\t\t} else {\n\t\t\t\tconst errorMessage = result.error ?? \"Unknown error\";\n\t\t\t\tthis.header.setStatusMessage({ type: \"error\", message: `Failed to delete: ${errorMessage}` }, 3000);\n\t\t\t}\n\n\t\t\tthis.requestRender();\n\t\t};\n\n\t\t// Start loading current sessions immediately\n\t\tthis.loadCurrentSessions();\n\t}\n\n\tprivate loadCurrentSessions(): void {\n\t\tvoid this.loadScope(\"current\", \"initial\");\n\t}\n\n\tprivate enterRenameMode(session: SessionInfo): void {\n\t\tthis.mode = \"rename\";\n\t\tthis.renameTarget = session;\n\t\tthis.renameInput.setValue(session.name ?? \"\");\n\t\tthis.renameInput.focused = true;\n\n\t\tconst panel = new Container();\n\t\tpanel.addChild(new Text(theme.bold(\"Rename Session\"), 1, 0));\n\t\tpanel.addChild(new Spacer(1));\n\t\tpanel.addChild(this.renameInput);\n\t\tpanel.addChild(new Spacer(1));\n\t\tpanel.addChild(\n\t\t\tnew Text(\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"muted\",\n\t\t\t\t\t`${keyTextHint(\"tui.select.confirm\", \"Save\")} · ${keyTextHint(\"tui.select.cancel\", \"Cancel\")}`,\n\t\t\t\t),\n\t\t\t\t1,\n\t\t\t\t0,\n\t\t\t),\n\t\t);\n\n\t\tthis.buildBaseLayout(panel, { showHeader: false });\n\t\tthis.requestRender();\n\t}\n\n\tprivate exitRenameMode(): void {\n\t\tthis.mode = \"list\";\n\t\tthis.renameTarget = null;\n\n\t\tthis.buildBaseLayout(this.sessionList);\n\n\t\tthis.requestRender();\n\t}\n\n\tprivate async confirmRename(value: string): Promise<void> {\n\t\tconst next = value.trim();\n\t\tif (!next) return;\n\t\tconst target = this.renameTarget;\n\t\tif (!target) {\n\t\t\tthis.exitRenameMode();\n\t\t\treturn;\n\t\t}\n\n\t\t// Find current name for callback\n\t\tconst renameSession = this.renameSession;\n\t\tif (!renameSession) {\n\t\t\tthis.exitRenameMode();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait renameSession(target, next);\n\t\t\tawait this.refreshSessionsAfterMutation();\n\t\t} finally {\n\t\t\tthis.exitRenameMode();\n\t\t}\n\t}\n\n\tprivate deletedKey(session: SessionInfo): string {\n\t\tif (this.variant === \"runs\") {\n\t\t\treturn `run:${session.id}`;\n\t\t}\n\t\treturn this.deleteSession ? `session-id:${session.id}` : `session-path:${session.path}`;\n\t}\n\n\tprivate isDeletedSession(session: SessionInfo): boolean {\n\t\treturn this.deletedSessions.has(this.deletedKey(session));\n\t}\n\n\tprivate filterLoadedSessions(sessions: readonly SessionInfo[]): SessionInfo[] {\n\t\treturn sessions.filter((session) => isResumableSession(session) && !this.isDeletedSession(session));\n\t}\n\n\tprivate async loadScope(scope: SessionScope, reason: \"initial\" | \"refresh\" | \"toggle\"): Promise<void> {\n\t\tconst showCwd = scope === \"all\";\n\n\t\t// Mark loading\n\t\tif (scope === \"current\") {\n\t\t\tthis.currentLoading = true;\n\t\t} else {\n\t\t\tthis.allLoading = true;\n\t\t}\n\n\t\tconst seq = scope === \"current\" ? ++this.currentLoadSeq : ++this.allLoadSeq;\n\t\tconst isActive = () => !this.disposed && (scope === \"current\" ? this.currentLoadSeq : this.allLoadSeq) === seq;\n\t\tthis.header.setScope(scope);\n\t\tthis.header.setLoading(true);\n\t\tthis.requestRender();\n\n\t\tconst onProgress: SessionListProgress = (loaded, total, partialSessions) => {\n\t\t\tif (!isActive()) return;\n\t\t\tif (partialSessions && reason !== \"refresh\") {\n\t\t\t\tconst sessions = this.filterLoadedSessions(partialSessions);\n\t\t\t\tif (scope === \"current\") {\n\t\t\t\t\tthis.currentSessions = sessions;\n\t\t\t\t} else {\n\t\t\t\t\tthis.allSessions = sessions;\n\t\t\t\t}\n\t\t\t\tif (scope === this.scope) {\n\t\t\t\t\tthis.sessionList.setSessions(sessions, showCwd, true);\n\t\t\t\t\tvoid this.refreshPathKeys(scope, sessions, showCwd, isActive, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (scope !== this.scope) return;\n\t\t\tthis.header.setProgress(loaded, total);\n\t\t\tthis.requestRender();\n\t\t};\n\n\t\ttry {\n\t\t\tconst sessions = this.filterLoadedSessions(\n\t\t\t\tawait (scope === \"current\" ? this.currentSessionsLoader(onProgress) : this.allSessionsLoader(onProgress)),\n\t\t\t);\n\n\t\t\tif (!isActive()) return;\n\n\t\t\tif (scope === \"current\") {\n\t\t\t\tthis.currentSessions = sessions;\n\t\t\t\tthis.currentLoading = false;\n\t\t\t} else {\n\t\t\t\tthis.allSessions = sessions;\n\t\t\t\tthis.allLoading = false;\n\t\t\t}\n\n\t\t\tif (scope !== this.scope) return;\n\n\t\t\tthis.header.setLoading(false);\n\t\t\tthis.sessionList.setSessions(sessions, showCwd);\n\t\t\tthis.requestRender();\n\t\t\tvoid this.refreshPathKeys(scope, sessions, showCwd, isActive);\n\n\t\t\tif (scope === \"all\" && sessions.length === 0 && (this.currentSessions?.length ?? 0) === 0) {\n\t\t\t\tthis.onCancel();\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tif (!isActive()) return;\n\n\t\t\tif (scope === \"current\") {\n\t\t\t\tthis.currentLoading = false;\n\t\t\t} else {\n\t\t\t\tthis.allLoading = false;\n\t\t\t}\n\n\t\t\tif (scope !== this.scope) return;\n\n\t\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\t\tthis.header.setLoading(false);\n\t\t\tthis.header.setStatusMessage({ type: \"error\", message: `Failed to load sessions: ${message}` }, 4000);\n\n\t\t\t// Only blank the list on the initial load when there is nothing already\n\t\t\t// on screen. Seeded live rows must survive a loader failure so errors\n\t\t\t// render inside the still-usable picker (contract §2).\n\t\t\tconst seeded = scope === \"current\" ? this.currentSessions : this.allSessions;\n\t\t\tif (reason === \"initial\" && (seeded === null || seeded.length === 0)) {\n\t\t\t\tthis.sessionList.setSessions([], showCwd);\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t}\n\t}\n\n\tprivate async refreshPathKeys(\n\t\tscope: SessionScope,\n\t\tsessions: SessionInfo[],\n\t\tshowCwd: boolean,\n\t\tisActive: () => boolean,\n\t\tpartial = false,\n\t): Promise<void> {\n\t\tconst changed = await resolveSessionPathKeys(sessionComparisonPaths(sessions, this.currentDirectory));\n\t\tif (!changed || !isActive() || scope !== this.scope) return;\n\t\tif (partial !== (scope === \"current\" ? this.currentLoading : this.allLoading)) return;\n\t\tconst shown = scope === \"current\" ? this.currentSessions : this.allSessions;\n\t\tif (shown !== sessions) return;\n\t\tthis.sessionList.setSessions(sessions, showCwd, partial);\n\t\tthis.requestRender();\n\t}\n\n\tprivate toggleSortMode(): void {\n\t\t// Cycle: threaded -> recent -> relevance -> threaded\n\t\tthis.sortMode = this.sortMode === \"threaded\" ? \"recent\" : this.sortMode === \"recent\" ? \"relevance\" : \"threaded\";\n\t\tthis.header.setSortMode(this.sortMode);\n\t\tthis.sessionList.setSortMode(this.sortMode);\n\t\tthis.requestRender();\n\t}\n\n\tprivate toggleNameFilter(): void {\n\t\tthis.nameFilter = this.nameFilter === \"all\" ? \"named\" : \"all\";\n\t\tthis.header.setNameFilter(this.nameFilter);\n\t\tthis.sessionList.setNameFilter(this.nameFilter);\n\t\tthis.requestRender();\n\t}\n\n\tprivate async refreshSessionsAfterMutation(): Promise<void> {\n\t\tif (this.disposed) return;\n\t\tawait this.loadScope(this.scope, \"refresh\");\n\t}\n\n\tpublic async refreshSessions(): Promise<void> {\n\t\tif (this.disposed) return;\n\t\tawait this.refreshSessionsAfterMutation();\n\t}\n\n\tprivate toggleScope(): void {\n\t\tthis.scope = this.scope === \"current\" ? \"all\" : \"current\";\n\t\tconst sessions = this.scope === \"current\" ? this.currentSessions : this.allSessions;\n\t\tconst loading = this.scope === \"current\" ? this.currentLoading : this.allLoading;\n\t\tthis.header.setScope(this.scope);\n\t\tthis.header.setLoading(loading);\n\t\tthis.sessionList.setSessions(sessions ?? [], this.scope === \"all\", loading || sessions === null);\n\t\tthis.requestRender();\n\t\tif (sessions === null && !loading) {\n\t\t\tvoid this.loadScope(this.scope, \"toggle\");\n\t\t}\n\t}\n\n\tgetSessionList(): SessionList {\n\t\treturn this.sessionList;\n\t}\n\n\t/**\n\t * Mark the selector closed so any in-flight or late-resolving loads are\n\t * ignored (stale-result guard) and status timeouts are cleared. Idempotent;\n\t * safe to call from close/select/cancel/dispose paths.\n\t */\n\tdispose(): void {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.currentLoadSeq += 1;\n\t\tthis.allLoadSeq += 1;\n\t\tthis.header.setStatusMessage(null);\n\t}\n}\n\nfunction isResumableSession(session: SessionInfo): boolean {\n\treturn session.messageCount > 0 || session.hasName === true || session.summary !== undefined;\n}\n"]}
1
+ {"version":3,"file":"session-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/session-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAEN,SAAS,EAET,cAAc,EACd,KAAK,EACL,UAAU,EACV,MAAM,EACN,IAAI,GACJ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE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,CAAC;QACrB,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACnC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;IAED,cAAc;QACb,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED,sFAAsF;IACtF,oBAAoB;QACnB,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,CAAC;IAC/E,CAAC;IAED;;;;OAIG;IACH,OAAO;QACN,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACD;AAED,SAAS,kBAAkB,CAAC,OAAoB;IAC/C,OAAO,OAAO,CAAC,YAAY,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC;AAC9F,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport {\n\ttype Component,\n\tContainer,\n\ttype Focusable,\n\tgetKeybindings,\n\tInput,\n\tmatchesKey,\n\tSpacer,\n\tText,\n} from \"@bastani/atomic-tui\";\nimport { getAgentDir } from \"../../../config.js\";\nimport { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport type { SessionInfo, SessionListProgress } from \"../../../core/session-manager.ts\";\nimport { assertSessionNotOpenElsewhere } from \"../../../core/session-open-markers.js\";\nimport { theme } from \"../theme/theme.js\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyTextHint } from \"./keybinding-hints.js\";\nimport { type DeleteSessionFileResult, deleteSessionFile } from \"./session-selector-delete.ts\";\nimport { SessionSelectorHeader } from \"./session-selector-header.ts\";\nimport { SessionList, type SessionListVariant } from \"./session-selector-list.ts\";\nimport type { NameFilter, SortMode } from \"./session-selector-search.ts\";\nimport type { SessionScope, SessionsLoader } from \"./session-selector-types.ts\";\nimport { resolveSessionPathKeys, sessionComparisonPaths } from \"./session-selector-utils.ts\";\n\n/**\n * Component that renders a session selector\n */\nexport class SessionSelectorComponent extends Container implements Focusable {\n\tget capturesViewportInput(): boolean {\n\t\treturn this.mode !== \"rename\";\n\t}\n\n\thandleInput(data: string): boolean {\n\t\tif (this.mode === \"rename\") {\n\t\t\tconst kb = getKeybindings();\n\t\t\tif (matchesKey(data, \"ctrl+c\")) {\n\t\t\t\tthis.exitRenameMode();\n\t\t\t\tthis.sessionList.onCancel?.();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (kb.matches(data, \"tui.select.cancel\")) {\n\t\t\t\tthis.exitRenameMode();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tthis.renameInput.handleInput(data);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn this.sessionList.handleInput(data);\n\t}\n\n\tprivate canRename = true;\n\tprivate sessionList: SessionList;\n\tprivate header: SessionSelectorHeader;\n\tprivate keybindings: KeybindingsManager;\n\tprivate scope: SessionScope = \"current\";\n\tprivate sortMode: SortMode = \"threaded\";\n\tprivate nameFilter: NameFilter = \"all\";\n\tprivate currentSessions: SessionInfo[] | null = null;\n\tprivate readonly currentDirectory: string | undefined;\n\tprivate allSessions: SessionInfo[] | null = null;\n\tprivate currentSessionsLoader: SessionsLoader;\n\tprivate allSessionsLoader: SessionsLoader;\n\tprivate onCancel: () => void;\n\tprivate requestRender: () => void;\n\tprivate renameSession?: (session: SessionInfo, currentName: string | undefined) => Promise<void>;\n\tprivate deleteSession?: (sessionId: string) => Promise<void>;\n\tprivate variant: SessionListVariant = \"sessions\";\n\tprivate deletedSessions = new Set<string>();\n\tprivate currentLoading = false;\n\tprivate allLoading = false;\n\tprivate currentLoadSeq = 0;\n\tprivate allLoadSeq = 0;\n\tprivate disposed = false;\n\n\tprivate mode: \"list\" | \"rename\" = \"list\";\n\tprivate renameInput = new Input();\n\tprivate renameTarget: SessionInfo | null = null;\n\n\t// Focusable implementation - propagate to sessionList for IME cursor positioning\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.sessionList.focused = value;\n\t\tthis.renameInput.focused = value;\n\t\tif (value && this.mode === \"rename\") {\n\t\t\tthis.renameInput.focused = true;\n\t\t}\n\t}\n\n\tprivate buildBaseLayout(content: Component, options?: { showHeader?: boolean }): void {\n\t\tthis.clear();\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new DynamicBorder((s) => theme.fg(\"borderMuted\", s)));\n\t\tif (options?.showHeader ?? true) this.addChild(this.header);\n\t\tthis.addChild(content);\n\t\tthis.addChild(new DynamicBorder((s) => theme.fg(\"borderMuted\", s)));\n\t}\n\n\tconstructor(\n\t\tcurrentSessionsLoader: SessionsLoader,\n\t\tallSessionsLoader: SessionsLoader,\n\t\tonSelect: (session: SessionInfo) => void,\n\t\tonCancel: () => void,\n\t\tonExit: () => void,\n\t\trequestRender: () => void,\n\t\toptions?: {\n\t\t\trenameSession?: (session: SessionInfo, currentName: string | undefined) => Promise<void>;\n\t\t\tdeleteSession?: (sessionId: string) => Promise<void>;\n\t\t\tshowRenameHint?: boolean;\n\t\t\tkeybindings?: KeybindingsManager;\n\t\t\t/**\n\t\t\t * Rows to display in the first rendered frame before the async loader\n\t\t\t * resolves (e.g. cheap in-memory rows). Seeding lets the\n\t\t\t * selector mount and stay interactive while durable/on-disk rows load,\n\t\t\t * and keeps live rows visible if the loader later errors.\n\t\t\t */\n\t\t\tinitialSessions?: SessionInfo[];\n\t\t\tvariant?: SessionListVariant;\n\t\t\ttitle?: string;\n\t\t\tcanDelete?: boolean;\n\t\t},\n\t\tcurrentSession?: { id: string; directory: string },\n\t) {\n\t\tsuper();\n\t\tthis.currentDirectory = currentSession?.directory;\n\t\tif (options?.keybindings) {\n\t\t\tthis.keybindings = options.keybindings;\n\t\t} else {\n\t\t\tthis.keybindings = new KeybindingsManager({}, join(getAgentDir(), \"keybindings.json\"));\n\t\t\tvoid this.keybindings.reloadAsync().then(() => {\n\t\t\t\tif (!this.disposed) this.requestRender();\n\t\t\t});\n\t\t}\n\t\tthis.currentSessionsLoader = currentSessionsLoader;\n\t\tthis.allSessionsLoader = allSessionsLoader;\n\t\tthis.onCancel = onCancel;\n\t\tthis.requestRender = requestRender;\n\t\tconst variant = options?.variant ?? \"sessions\";\n\t\tthis.variant = variant;\n\t\tif (variant === \"mixed\") {\n\t\t\tthis.sortMode = \"recent\";\n\t\t}\n\t\tthis.header = new SessionSelectorHeader(this.scope, this.sortMode, this.nameFilter, this.requestRender);\n\t\tconst renameSession = options?.renameSession;\n\t\tthis.renameSession = renameSession;\n\t\tthis.deleteSession = options?.deleteSession;\n\t\tthis.canRename = !!renameSession;\n\t\tthis.header.setVariant(variant);\n\t\tthis.header.setTitle(options?.title);\n\n\t\t// Create the session list. Seed with any provided initial rows so the very\n\t\t// first frame is populated (kept minimal/in-memory by the caller) while the\n\t\t// async loader resolves the full catalog off the host hot path.\n\t\tconst initialSessions = options?.initialSessions;\n\t\tthis.sessionList = new SessionList(\n\t\t\tinitialSessions ?? [],\n\t\t\tfalse,\n\t\t\tthis.sortMode,\n\t\t\tthis.nameFilter,\n\t\t\tthis.keybindings,\n\t\t\toptions?.deleteSession && currentSession ? { id: currentSession.id } : currentSession,\n\t\t);\n\t\tif (initialSessions !== undefined) {\n\t\t\tthis.currentSessions = initialSessions;\n\t\t}\n\t\tthis.sessionList.setVariant(variant);\n\t\tthis.sessionList.setCanDelete(options?.canDelete ?? true);\n\t\tthis.sessionList.setCanRename(options?.showRenameHint ?? this.canRename);\n\t\tthis.sessionList.setNoticeProvider(() => this.header.getNotice());\n\n\t\tthis.buildBaseLayout(this.sessionList);\n\n\t\tthis.renameInput.onSubmit = (value) => {\n\t\t\tvoid this.confirmRename(value);\n\t\t};\n\n\t\t// Ensure header status timeouts are cleared when leaving the selector\n\t\tconst clearStatusMessage = () => this.header.setStatusMessage(null);\n\t\tthis.sessionList.onSelect = (session) => {\n\t\t\tclearStatusMessage();\n\t\t\tonSelect(session);\n\t\t};\n\t\tthis.sessionList.onCancel = () => {\n\t\t\tclearStatusMessage();\n\t\t\tonCancel();\n\t\t};\n\t\tthis.sessionList.onExit = () => {\n\t\t\tclearStatusMessage();\n\t\t\tonExit();\n\t\t};\n\t\tthis.sessionList.onToggleScope = () => this.toggleScope();\n\t\tthis.sessionList.onToggleSort = () => this.toggleSortMode();\n\t\tthis.sessionList.onToggleNameFilter = () => this.toggleNameFilter();\n\t\tthis.sessionList.onRenameSession = (session) => {\n\t\t\tif (!renameSession || this.variant === \"runs\") return;\n\t\t\tthis.enterRenameMode(session);\n\t\t};\n\n\t\t// Sync list events to header\n\t\tthis.sessionList.onTogglePath = (showPath) => {\n\t\t\tthis.header.setShowPath(showPath);\n\t\t\tthis.requestRender();\n\t\t};\n\t\tthis.sessionList.onDeleteConfirmationChange = (path) => {\n\t\t\tthis.header.setConfirmingDeletePath(path);\n\t\t\tthis.requestRender();\n\t\t};\n\t\tthis.sessionList.onDeletePendingChange = () => {\n\t\t\tif (!this.disposed) this.requestRender();\n\t\t};\n\t\tthis.sessionList.onError = (msg) => {\n\t\t\tthis.header.setStatusMessage({ type: \"error\", message: msg }, 3000);\n\t\t\tthis.requestRender();\n\t\t};\n\n\t\t// Handle session deletion\n\t\tthis.sessionList.onDeleteSession = async (sessionPath, session) => {\n\t\t\tlet result: DeleteSessionFileResult;\n\t\t\ttry {\n\t\t\t\tif (options?.deleteSession) {\n\t\t\t\t\tawait options.deleteSession(session.id);\n\t\t\t\t\tresult = { ok: true, method: \"store\" };\n\t\t\t\t} else {\n\t\t\t\t\t// #4971: the store delete above refuses this on its own; a file delete checks here.\n\t\t\t\t\tawait assertSessionNotOpenElsewhere(session.id);\n\t\t\t\t\tresult = await deleteSessionFile(sessionPath);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tresult = { ok: false, method: \"store\", error: error instanceof Error ? error.message : String(error) };\n\t\t\t}\n\n\t\t\tif (this.disposed) return;\n\t\t\tif (result.ok) {\n\t\t\t\tthis.deletedSessions.add(this.deletedKey(session));\n\t\t\t\tif (this.currentSessions) {\n\t\t\t\t\tthis.currentSessions = this.currentSessions.filter((s) => !this.isDeletedSession(s));\n\t\t\t\t}\n\t\t\t\tif (this.allSessions) {\n\t\t\t\t\tthis.allSessions = this.allSessions.filter((s) => !this.isDeletedSession(s));\n\t\t\t\t}\n\n\t\t\t\tconst sessions = this.scope === \"all\" ? (this.allSessions ?? []) : (this.currentSessions ?? []);\n\t\t\t\tconst showCwd = this.scope === \"all\";\n\t\t\t\tthis.sessionList.setSessions(sessions, showCwd);\n\n\t\t\t\tconst msg =\n\t\t\t\t\tthis.variant === \"runs\"\n\t\t\t\t\t\t? \"Run deleted\"\n\t\t\t\t\t\t: result.method === \"trash\"\n\t\t\t\t\t\t\t? \"Session moved to trash\"\n\t\t\t\t\t\t\t: \"Session deleted\";\n\t\t\t\tthis.header.setStatusMessage({ type: \"info\", message: msg }, 2000);\n\t\t\t\tif (this.variant !== \"runs\") void this.refreshSessionsAfterMutation();\n\t\t\t} else {\n\t\t\t\tconst errorMessage = result.error ?? \"Unknown error\";\n\t\t\t\tthis.header.setStatusMessage({ type: \"error\", message: `Failed to delete: ${errorMessage}` }, 3000);\n\t\t\t}\n\n\t\t\tthis.requestRender();\n\t\t};\n\n\t\t// Start loading current sessions immediately\n\t\tthis.loadCurrentSessions();\n\t}\n\n\tprivate loadCurrentSessions(): void {\n\t\tvoid this.loadScope(\"current\", \"initial\");\n\t}\n\n\tprivate enterRenameMode(session: SessionInfo): void {\n\t\tthis.mode = \"rename\";\n\t\tthis.renameTarget = session;\n\t\tthis.renameInput.setValue(session.name ?? \"\");\n\t\tthis.renameInput.focused = true;\n\n\t\tconst panel = new Container();\n\t\tpanel.addChild(new Text(theme.bold(\"Rename Session\"), 1, 0));\n\t\tpanel.addChild(new Spacer(1));\n\t\tpanel.addChild(this.renameInput);\n\t\tpanel.addChild(new Spacer(1));\n\t\tpanel.addChild(\n\t\t\tnew Text(\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"muted\",\n\t\t\t\t\t`${keyTextHint(\"tui.select.confirm\", \"Save\")} · ${keyTextHint(\"tui.select.cancel\", \"Cancel\")}`,\n\t\t\t\t),\n\t\t\t\t1,\n\t\t\t\t0,\n\t\t\t),\n\t\t);\n\n\t\tthis.buildBaseLayout(panel, { showHeader: false });\n\t\tthis.requestRender();\n\t}\n\n\tprivate exitRenameMode(): void {\n\t\tthis.mode = \"list\";\n\t\tthis.renameTarget = null;\n\n\t\tthis.buildBaseLayout(this.sessionList);\n\n\t\tthis.requestRender();\n\t}\n\n\tprivate async confirmRename(value: string): Promise<void> {\n\t\tconst next = value.trim();\n\t\tif (!next) return;\n\t\tconst target = this.renameTarget;\n\t\tif (!target) {\n\t\t\tthis.exitRenameMode();\n\t\t\treturn;\n\t\t}\n\n\t\t// Find current name for callback\n\t\tconst renameSession = this.renameSession;\n\t\tif (!renameSession) {\n\t\t\tthis.exitRenameMode();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait renameSession(target, next);\n\t\t\tawait this.refreshSessionsAfterMutation();\n\t\t} finally {\n\t\t\tthis.exitRenameMode();\n\t\t}\n\t}\n\n\tprivate deletedKey(session: SessionInfo): string {\n\t\tif (this.variant === \"runs\") {\n\t\t\treturn `run:${session.id}`;\n\t\t}\n\t\treturn this.deleteSession ? `session-id:${session.id}` : `session-path:${session.path}`;\n\t}\n\n\tprivate isDeletedSession(session: SessionInfo): boolean {\n\t\treturn this.deletedSessions.has(this.deletedKey(session));\n\t}\n\n\tprivate filterLoadedSessions(sessions: readonly SessionInfo[]): SessionInfo[] {\n\t\treturn sessions.filter((session) => isResumableSession(session) && !this.isDeletedSession(session));\n\t}\n\n\tprivate async loadScope(scope: SessionScope, reason: \"initial\" | \"refresh\" | \"toggle\"): Promise<void> {\n\t\tconst showCwd = scope === \"all\";\n\n\t\t// Mark loading\n\t\tif (scope === \"current\") {\n\t\t\tthis.currentLoading = true;\n\t\t} else {\n\t\t\tthis.allLoading = true;\n\t\t}\n\n\t\tconst seq = scope === \"current\" ? ++this.currentLoadSeq : ++this.allLoadSeq;\n\t\tconst isActive = () => !this.disposed && (scope === \"current\" ? this.currentLoadSeq : this.allLoadSeq) === seq;\n\t\tthis.header.setScope(scope);\n\t\tthis.header.setLoading(true);\n\t\tthis.requestRender();\n\n\t\tconst onProgress: SessionListProgress = (loaded, total, partialSessions) => {\n\t\t\tif (!isActive()) return;\n\t\t\tif (partialSessions && reason !== \"refresh\") {\n\t\t\t\tconst sessions = this.filterLoadedSessions(partialSessions);\n\t\t\t\tif (scope === \"current\") {\n\t\t\t\t\tthis.currentSessions = sessions;\n\t\t\t\t} else {\n\t\t\t\t\tthis.allSessions = sessions;\n\t\t\t\t}\n\t\t\t\tif (scope === this.scope) {\n\t\t\t\t\tthis.sessionList.setSessions(sessions, showCwd, true);\n\t\t\t\t\tvoid this.refreshPathKeys(scope, sessions, showCwd, isActive, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (scope !== this.scope) return;\n\t\t\tthis.header.setProgress(loaded, total);\n\t\t\tthis.requestRender();\n\t\t};\n\n\t\ttry {\n\t\t\tconst sessions = this.filterLoadedSessions(\n\t\t\t\tawait (scope === \"current\" ? this.currentSessionsLoader(onProgress) : this.allSessionsLoader(onProgress)),\n\t\t\t);\n\n\t\t\tif (!isActive()) return;\n\n\t\t\tif (scope === \"current\") {\n\t\t\t\tthis.currentSessions = sessions;\n\t\t\t\tthis.currentLoading = false;\n\t\t\t} else {\n\t\t\t\tthis.allSessions = sessions;\n\t\t\t\tthis.allLoading = false;\n\t\t\t}\n\n\t\t\tif (scope !== this.scope) return;\n\n\t\t\tthis.header.setLoading(false);\n\t\t\tthis.sessionList.setSessions(sessions, showCwd);\n\t\t\tthis.requestRender();\n\t\t\tvoid this.refreshPathKeys(scope, sessions, showCwd, isActive);\n\n\t\t\tif (scope === \"all\" && sessions.length === 0 && (this.currentSessions?.length ?? 0) === 0) {\n\t\t\t\tthis.onCancel();\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tif (!isActive()) return;\n\n\t\t\tif (scope === \"current\") {\n\t\t\t\tthis.currentLoading = false;\n\t\t\t} else {\n\t\t\t\tthis.allLoading = false;\n\t\t\t}\n\n\t\t\tif (scope !== this.scope) return;\n\n\t\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\t\tthis.header.setLoading(false);\n\t\t\tthis.header.setStatusMessage({ type: \"error\", message: `Failed to load sessions: ${message}` }, 4000);\n\n\t\t\t// Only blank the list on the initial load when there is nothing already\n\t\t\t// on screen. Seeded live rows must survive a loader failure so errors\n\t\t\t// render inside the still-usable picker (contract §2).\n\t\t\tconst seeded = scope === \"current\" ? this.currentSessions : this.allSessions;\n\t\t\tif (reason === \"initial\" && (seeded === null || seeded.length === 0)) {\n\t\t\t\tthis.sessionList.setSessions([], showCwd);\n\t\t\t}\n\t\t\tthis.requestRender();\n\t\t}\n\t}\n\n\tprivate async refreshPathKeys(\n\t\tscope: SessionScope,\n\t\tsessions: SessionInfo[],\n\t\tshowCwd: boolean,\n\t\tisActive: () => boolean,\n\t\tpartial = false,\n\t): Promise<void> {\n\t\tconst changed = await resolveSessionPathKeys(sessionComparisonPaths(sessions, this.currentDirectory));\n\t\tif (!changed || !isActive() || scope !== this.scope) return;\n\t\tif (partial !== (scope === \"current\" ? this.currentLoading : this.allLoading)) return;\n\t\tconst shown = scope === \"current\" ? this.currentSessions : this.allSessions;\n\t\tif (shown !== sessions) return;\n\t\tthis.sessionList.setSessions(sessions, showCwd, partial);\n\t\tthis.requestRender();\n\t}\n\n\tprivate toggleSortMode(): void {\n\t\t// Cycle: threaded -> recent -> relevance -> threaded\n\t\tthis.sortMode = this.sortMode === \"threaded\" ? \"recent\" : this.sortMode === \"recent\" ? \"relevance\" : \"threaded\";\n\t\tthis.header.setSortMode(this.sortMode);\n\t\tthis.sessionList.setSortMode(this.sortMode);\n\t\tthis.requestRender();\n\t}\n\n\tprivate toggleNameFilter(): void {\n\t\tthis.nameFilter = this.nameFilter === \"all\" ? \"named\" : \"all\";\n\t\tthis.header.setNameFilter(this.nameFilter);\n\t\tthis.sessionList.setNameFilter(this.nameFilter);\n\t\tthis.requestRender();\n\t}\n\n\tprivate async refreshSessionsAfterMutation(): Promise<void> {\n\t\tif (this.disposed) return;\n\t\tawait this.loadScope(this.scope, \"refresh\");\n\t}\n\n\tpublic async refreshSessions(): Promise<void> {\n\t\tif (this.disposed) return;\n\t\tawait this.refreshSessionsAfterMutation();\n\t}\n\n\tprivate toggleScope(): void {\n\t\tthis.scope = this.scope === \"current\" ? \"all\" : \"current\";\n\t\tconst sessions = this.scope === \"current\" ? this.currentSessions : this.allSessions;\n\t\tconst loading = this.scope === \"current\" ? this.currentLoading : this.allLoading;\n\t\tthis.header.setScope(this.scope);\n\t\tthis.header.setLoading(loading);\n\t\tthis.sessionList.setSessions(sessions ?? [], this.scope === \"all\", loading || sessions === null);\n\t\tthis.requestRender();\n\t\tif (sessions === null && !loading) {\n\t\t\tvoid this.loadScope(this.scope, \"toggle\");\n\t\t}\n\t}\n\n\tgetSessionList(): SessionList {\n\t\treturn this.sessionList;\n\t}\n\n\t/** Nothing to list yet: the first load of this folder's sessions has not answered. */\n\tawaitingFirstContent(): boolean {\n\t\treturn !this.disposed && this.currentLoading && this.currentSessions === null;\n\t}\n\n\t/**\n\t * Mark the selector closed so any in-flight or late-resolving loads are\n\t * ignored (stale-result guard) and status timeouts are cleared. Idempotent;\n\t * safe to call from close/select/cancel/dispose paths.\n\t */\n\tdispose(): void {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.currentLoadSeq += 1;\n\t\tthis.allLoadSeq += 1;\n\t\tthis.header.setStatusMessage(null);\n\t}\n}\n\nfunction isResumableSession(session: SessionInfo): boolean {\n\treturn session.messageCount > 0 || session.hasName === true || session.summary !== undefined;\n}\n"]}
@@ -20,6 +20,8 @@ export declare class SkillInvocationMessageComponent extends Box {
20
20
  /** A click anywhere on the skill block expands or collapses it, as Ctrl+O does. */
21
21
  readonly expandsOnClick = true;
22
22
  isExpanded(): boolean;
23
+ /** Its rows: an expand hint in them is part of the block, which a click on it expands or collapses. */
24
+ render(width: number): string[];
23
25
  /** Every row of the skill block, its padding included. */
24
26
  clickArea(width: number): RowRange | undefined;
25
27
  setExpanded(expanded: boolean): void;
@@ -1 +1 @@
1
- {"version":3,"file":"skill-invocation-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/skill-invocation-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAuB,KAAK,aAAa,EAAQ,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAI7E,OAAO,EAAE,KAAK,QAAQ,EAAY,MAAM,8BAA8B,CAAC;AAEvE;;;;GAIG;AACH,qBAAa,+BAAgC,SAAQ,GAAG;IACvD,IAAI,8BAA8B,IAAI,OAAO,CAE5C;IAED,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,oBAAoB,CAAiC;IAC7D,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAS;IAE3B,YACC,UAAU,EAAE,gBAAgB,EAC5B,aAAa,GAAE,aAAkC,EACjD,WAAW,UAAO,EAClB,SAAS,SAAI,EACb,oBAAoB,GAAE,SAAS,mBAAmB,EAAO,EACzD,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,EAUlB;IAED,mFAAmF;IACnF,QAAQ,CAAC,cAAc,QAAQ;IAE/B,UAAU,IAAI,OAAO,CAEpB;IAED,0DAA0D;IAC1D,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE7C;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAGnC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,OAAO,CAAC,aAAa;CA2CrB"}
1
+ {"version":3,"file":"skill-invocation-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/skill-invocation-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAuB,KAAK,aAAa,EAAQ,MAAM,qBAAqB,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAI7E,OAAO,EAAa,KAAK,QAAQ,EAAY,MAAM,8BAA8B,CAAC;AAElF;;;;GAIG;AACH,qBAAa,+BAAgC,SAAQ,GAAG;IACvD,IAAI,8BAA8B,IAAI,OAAO,CAE5C;IAED,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,oBAAoB,CAAiC;IAC7D,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAS;IAE3B,YACC,UAAU,EAAE,gBAAgB,EAC5B,aAAa,GAAE,aAAkC,EACjD,WAAW,UAAO,EAClB,SAAS,SAAI,EACb,oBAAoB,GAAE,SAAS,mBAAmB,EAAO,EACzD,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,EAUlB;IAED,mFAAmF;IACnF,QAAQ,CAAC,cAAc,QAAQ;IAE/B,UAAU,IAAI,OAAO,CAEpB;IAED,uGAAuG;IAC9F,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvC;IAED,0DAA0D;IAC1D,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE7C;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAGnC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,OAAO,CAAC,aAAa;CA2CrB"}
@@ -2,7 +2,7 @@ import { Box, Container, Markdown, Text } from "@bastani/atomic-tui";
2
2
  import { getMarkdownTheme, theme } from "../theme/theme.js";
3
3
  import { parenthesizedKeyHint } from "./keybinding-hints.js";
4
4
  import { createMarkdownTransform, hasExtensionMarkdownTransform } from "./markdown-transform.js";
5
- import { rowsFrom } from "./transcript-block-clicks.js";
5
+ import { blockRows, rowsFrom } from "./transcript-block-clicks.js";
6
6
  /**
7
7
  * Component that renders a skill invocation message with collapsed/expanded state.
8
8
  * Uses same background color as custom messages for visual consistency.
@@ -34,6 +34,10 @@ export class SkillInvocationMessageComponent extends Box {
34
34
  isExpanded() {
35
35
  return this.expanded;
36
36
  }
37
+ /** Its rows: an expand hint in them is part of the block, which a click on it expands or collapses. */
38
+ render(width) {
39
+ return blockRows(super.render(width));
40
+ }
37
41
  /** Every row of the skill block, its padding included. */
38
42
  clickArea(width) {
39
43
  return rowsFrom(0, this.render(width).length);
@@ -1 +1 @@
1
- {"version":3,"file":"skill-invocation-message.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/skill-invocation-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAsB,IAAI,EAAE,M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EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC;aAC5D,EACD;gBACC,gEAAgE;gBAChE,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC;gBACnE,WAAW,EAAE,IAAI,CAAC,WAAW;aAC7B,CACD,CACD,CAAC;QACH,CAAC;aAAM,CAAC;YACP,sDAAsD;YACtD,MAAM,IAAI,GAAG,oBAAoB,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAChE,MAAM,IAAI,GACT,KAAK,CAAC,EAAE,CAAC,oBAAoB,EAAE,yBAAyB,CAAC;gBACzD,KAAK,CAAC,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBACnD,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;CACD","sourcesContent":["import { Box, Container, Markdown, type MarkdownTheme, Text } from \"@bastani/atomic-tui\";\nimport type { ParsedSkillBlock } from \"../../../core/agent-session.js\";\nimport type { MarkdownTransformer } from \"../../../core/extensions/types.ts\";\nimport { getMarkdownTheme, theme } from \"../theme/theme.js\";\nimport { parenthesizedKeyHint } from \"./keybinding-hints.js\";\nimport { createMarkdownTransform, hasExtensionMarkdownTransform } from \"./markdown-transform.ts\";\nimport { type RowRange, rowsFrom } from \"./transcript-block-clicks.ts\";\n\n/**\n * Component that renders a skill invocation message with collapsed/expanded state.\n * Uses same background color as custom messages for visual consistency.\n * Only renders the skill block itself - user message is rendered separately.\n */\nexport class SkillInvocationMessageComponent extends Box {\n\tget selectionTextMayChangeOnReplay(): boolean {\n\t\treturn this.expanded && hasExtensionMarkdownTransform(this.markdownTransformers);\n\t}\n\n\tprivate expanded = false;\n\tprivate skillBlock: ParsedSkillBlock;\n\tprivate markdownTheme: MarkdownTheme;\n\tprivate renderLatex: boolean;\n\tprivate markdownTransformers: readonly MarkdownTransformer[];\n\tprivate messageId?: string;\n\tprivate timestamp?: string;\n\n\tconstructor(\n\t\tskillBlock: ParsedSkillBlock,\n\t\tmarkdownTheme: MarkdownTheme = getMarkdownTheme(),\n\t\trenderLatex = true,\n\t\toutputPad = 1,\n\t\tmarkdownTransformers: readonly MarkdownTransformer[] = [],\n\t\tmessageId?: string,\n\t\ttimestamp?: string,\n\t) {\n\t\tsuper(outputPad, 1, (t) => theme.bg(\"customMessageBg\", t));\n\t\tthis.skillBlock = skillBlock;\n\t\tthis.markdownTheme = markdownTheme;\n\t\tthis.renderLatex = renderLatex;\n\t\tthis.markdownTransformers = markdownTransformers;\n\t\tthis.messageId = messageId;\n\t\tthis.timestamp = timestamp;\n\t\tthis.updateDisplay();\n\t}\n\n\t/** A click anywhere on the skill block expands or collapses it, as Ctrl+O does. */\n\treadonly expandsOnClick = true;\n\n\tisExpanded(): boolean {\n\t\treturn this.expanded;\n\t}\n\n\t/** Every row of the skill block, its padding included. */\n\tclickArea(width: number): RowRange | undefined {\n\t\treturn rowsFrom(0, this.render(width).length);\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetOutputPad(outputPad: number): void {\n\t\tthis.setPaddingX(outputPad);\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate updateDisplay(): void {\n\t\tthis.clear();\n\t\tconst content = new Container();\n\n\t\tif (this.expanded) {\n\t\t\t// Expanded: label + skill name header + full content\n\t\t\tconst label = theme.fg(\"customMessageLabel\", `\\x1b[1m[skill]\\x1b[22m`);\n\t\t\tcontent.addChild(new Text(label, 0, 0));\n\t\t\tconst header = `**${this.skillBlock.name}**\\n\\n`;\n\t\t\tconst transform = createMarkdownTransform(\n\t\t\t\t\"custom\",\n\t\t\t\t() => false,\n\t\t\t\tthis.markdownTransformers,\n\t\t\t\tthis.messageId,\n\t\t\t\tthis.timestamp,\n\t\t\t);\n\t\t\tcontent.addChild(\n\t\t\t\tnew Markdown(\n\t\t\t\t\tthis.skillBlock.content,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\tthis.markdownTheme,\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: (text: string) => theme.fg(\"customMessageText\", text),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// Transformers see only the skill content, not Atomic's header.\n\t\t\t\t\t\ttransform: (markdown, width) => header + transform(markdown, width),\n\t\t\t\t\t\trenderLatex: this.renderLatex,\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// Collapsed: single line - [skill] name (expand hint)\n\t\t\tconst hint = parenthesizedKeyHint(\"app.tools.expand\", \"Expand\");\n\t\t\tconst line =\n\t\t\t\ttheme.fg(\"customMessageLabel\", `\\x1b[1m[skill]\\x1b[22m `) +\n\t\t\t\ttheme.fg(\"customMessageText\", this.skillBlock.name) +\n\t\t\t\t(hint ? ` ${hint}` : \"\");\n\t\t\tcontent.addChild(new Text(line, 0, 0));\n\t\t}\n\t\tthis.addChild(content);\n\t}\n}\n"]}
1
+ {"version":3,"file":"skill-invocation-message.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/skill-invocation-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAsB,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGzF,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CA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AAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC;aAC5D,EACD;gBACC,gEAAgE;gBAChE,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC;gBACnE,WAAW,EAAE,IAAI,CAAC,WAAW;aAC7B,CACD,CACD,CAAC;QACH,CAAC;aAAM,CAAC;YACP,sDAAsD;YACtD,MAAM,IAAI,GAAG,oBAAoB,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;YAChE,MAAM,IAAI,GACT,KAAK,CAAC,EAAE,CAAC,oBAAoB,EAAE,yBAAyB,CAAC;gBACzD,KAAK,CAAC,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBACnD,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;CACD","sourcesContent":["import { Box, Container, Markdown, type MarkdownTheme, Text } from \"@bastani/atomic-tui\";\nimport type { ParsedSkillBlock } from \"../../../core/agent-session.js\";\nimport type { MarkdownTransformer } from \"../../../core/extensions/types.ts\";\nimport { getMarkdownTheme, theme } from \"../theme/theme.js\";\nimport { parenthesizedKeyHint } from \"./keybinding-hints.js\";\nimport { createMarkdownTransform, hasExtensionMarkdownTransform } from \"./markdown-transform.ts\";\nimport { blockRows, type RowRange, rowsFrom } from \"./transcript-block-clicks.ts\";\n\n/**\n * Component that renders a skill invocation message with collapsed/expanded state.\n * Uses same background color as custom messages for visual consistency.\n * Only renders the skill block itself - user message is rendered separately.\n */\nexport class SkillInvocationMessageComponent extends Box {\n\tget selectionTextMayChangeOnReplay(): boolean {\n\t\treturn this.expanded && hasExtensionMarkdownTransform(this.markdownTransformers);\n\t}\n\n\tprivate expanded = false;\n\tprivate skillBlock: ParsedSkillBlock;\n\tprivate markdownTheme: MarkdownTheme;\n\tprivate renderLatex: boolean;\n\tprivate markdownTransformers: readonly MarkdownTransformer[];\n\tprivate messageId?: string;\n\tprivate timestamp?: string;\n\n\tconstructor(\n\t\tskillBlock: ParsedSkillBlock,\n\t\tmarkdownTheme: MarkdownTheme = getMarkdownTheme(),\n\t\trenderLatex = true,\n\t\toutputPad = 1,\n\t\tmarkdownTransformers: readonly MarkdownTransformer[] = [],\n\t\tmessageId?: string,\n\t\ttimestamp?: string,\n\t) {\n\t\tsuper(outputPad, 1, (t) => theme.bg(\"customMessageBg\", t));\n\t\tthis.skillBlock = skillBlock;\n\t\tthis.markdownTheme = markdownTheme;\n\t\tthis.renderLatex = renderLatex;\n\t\tthis.markdownTransformers = markdownTransformers;\n\t\tthis.messageId = messageId;\n\t\tthis.timestamp = timestamp;\n\t\tthis.updateDisplay();\n\t}\n\n\t/** A click anywhere on the skill block expands or collapses it, as Ctrl+O does. */\n\treadonly expandsOnClick = true;\n\n\tisExpanded(): boolean {\n\t\treturn this.expanded;\n\t}\n\n\t/** Its rows: an expand hint in them is part of the block, which a click on it expands or collapses. */\n\toverride render(width: number): string[] {\n\t\treturn blockRows(super.render(width));\n\t}\n\n\t/** Every row of the skill block, its padding included. */\n\tclickArea(width: number): RowRange | undefined {\n\t\treturn rowsFrom(0, this.render(width).length);\n\t}\n\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetOutputPad(outputPad: number): void {\n\t\tthis.setPaddingX(outputPad);\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate updateDisplay(): void {\n\t\tthis.clear();\n\t\tconst content = new Container();\n\n\t\tif (this.expanded) {\n\t\t\t// Expanded: label + skill name header + full content\n\t\t\tconst label = theme.fg(\"customMessageLabel\", `\\x1b[1m[skill]\\x1b[22m`);\n\t\t\tcontent.addChild(new Text(label, 0, 0));\n\t\t\tconst header = `**${this.skillBlock.name}**\\n\\n`;\n\t\t\tconst transform = createMarkdownTransform(\n\t\t\t\t\"custom\",\n\t\t\t\t() => false,\n\t\t\t\tthis.markdownTransformers,\n\t\t\t\tthis.messageId,\n\t\t\t\tthis.timestamp,\n\t\t\t);\n\t\t\tcontent.addChild(\n\t\t\t\tnew Markdown(\n\t\t\t\t\tthis.skillBlock.content,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\tthis.markdownTheme,\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: (text: string) => theme.fg(\"customMessageText\", text),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// Transformers see only the skill content, not Atomic's header.\n\t\t\t\t\t\ttransform: (markdown, width) => header + transform(markdown, width),\n\t\t\t\t\t\trenderLatex: this.renderLatex,\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\t// Collapsed: single line - [skill] name (expand hint)\n\t\t\tconst hint = parenthesizedKeyHint(\"app.tools.expand\", \"Expand\");\n\t\t\tconst line =\n\t\t\t\ttheme.fg(\"customMessageLabel\", `\\x1b[1m[skill]\\x1b[22m `) +\n\t\t\t\ttheme.fg(\"customMessageText\", this.skillBlock.name) +\n\t\t\t\t(hint ? ` ${hint}` : \"\");\n\t\t\tcontent.addChild(new Text(line, 0, 0));\n\t\t}\n\t\tthis.addChild(content);\n\t}\n}\n"]}