@songtonyli/dsh-cli 0.1.75 → 0.1.76

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.
package/README.md CHANGED
@@ -26,7 +26,7 @@ workspace and no build step. Native packages that ship one build per platform
26
26
  ripgrep, the PTY backend's addons, sharp, koffi, and the Landlock launcher — are
27
27
  ordinary optional dependencies, so npm resolves the right one for your machine.
28
28
 
29
- Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.75; `dsh --version`
29
+ Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.76; `dsh --version`
30
30
  also reports the harness build the package was assembled from.
31
31
 
32
32
  ## License
package/bin/dsh.mjs CHANGED
@@ -18,7 +18,7 @@ const argv = process.argv.slice(2)
18
18
  // version this package publishes. Reporting only one of the two would make an
19
19
  // ordinary `npm install @songtonyli/dsh-cli@x` look like it installed something else.
20
20
  if (argv.length === 1 && (argv[0] === '--version' || argv[0] === '-V')) {
21
- console.log('@songtonyli/dsh-cli 0.1.75 (deepseek-harness 0.2.1-alpha.3)')
21
+ console.log('@songtonyli/dsh-cli 0.1.76 (deepseek-harness 0.2.1-alpha.3)')
22
22
  process.exit(0)
23
23
  }
24
24
 
@@ -167,7 +167,7 @@ window.__ModuleLoader__.load({
167
167
  const SCROLLBAR_LINGER_MS = 2e3;
168
168
  /** Format complete-build metadata for the local brand badge. */
169
169
  function localBuildVersion() {
170
- return `0.2.1-alpha.3-ccc16e1` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-dirty" : "");
170
+ return `0.2.1-alpha.3-338c60a` + ({}.DSH_CLIENT_GIT_DIRTY === "true" ? "-dirty" : "");
171
171
  }
172
172
  /** Each panel row subscribes only to its own selection state. */
173
173
  function PanelRow({ id, label, wide, usePanelInfo, selectPanel, renderSlot }) {
@@ -21,8 +21,8 @@
21
21
  en: 58a8cf392bd6a90b
22
22
  zh: ff147492c5baf643
23
23
  /deepseek-ai-dsh-tui-app/use-this-package/the-screen:
24
- en: 7c7e0622465bd9dd
25
- zh: 4bada28f846ad050
24
+ en: 365ce77bf78accd5
25
+ zh: e945a1f209e18f36
26
26
  /deepseek-ai-dsh-tui-app/use-this-package/keys-and-commands:
27
27
  en: e3650a069cc84840
28
28
  zh: b8428946ec8beab1
@@ -39,8 +39,8 @@
39
39
  en: 23ba736da2686f52
40
40
  zh: d30ce253dd934750
41
41
  /deepseek-ai-dsh-tui-app/use-this-package/configuration:
42
- en: f333f22f997c927e
43
- zh: 35adeca2a4b12e15
42
+ en: 69b77811410fd6d6
43
+ zh: 780fb134808e2d76
44
44
  /deepseek-ai-dsh-tui-app/understand-the-implementation:
45
45
  en: f124d406565fef39
46
46
  zh: 90344b5eec319cad
@@ -54,8 +54,8 @@
54
54
  en: 142f04bf29e981dd
55
55
  zh: a1689297b06c9ca6
56
56
  /deepseek-ai-dsh-tui-app/understand-the-implementation/source-map:
57
- en: ccc6abf421de8da9
58
- zh: 6e6523137b64fefc
57
+ en: db616267d54607c0
58
+ zh: 37ac9d793fbce025
59
59
  /deepseek-ai-dsh-tui-app/understand-the-implementation/invariant-ownership:
60
60
  en: 0ddf6de8928026d5
61
61
  zh: 24feedcbb9e9d676
@@ -40,7 +40,7 @@ On quit the app prints `dsh: session <id> saved; resume with: dsh --profile tui
40
40
 
41
41
  ### The screen
42
42
 
43
- Every frame is drawn one column in from each edge of the terminal, so no line of the conversation or of the docked chrome touches either side. The header names the session by its title once one is generated or set, with the id beside it. The transcript grows in the terminal's own scrollback: your prompts start with `❯` on a tinted full-width band while colour is on (attachments listed under them), and a prompt steered or injected into a turn that already had a model step draws dim on a darker band so it recedes behind the turn it joined, assistant reasoning is dim italic under a `✻ Thinking` header above the Markdown reply, and each tool call is a card with a status glyph — a yellow spinner of that tool family's flowers, blooms, and stars while it runs, a green `◆` once done, a red `◆` on failure — the bold tool name, the presenter headline in violet — without the tool name a presenter repeated, so `Read src/app.ts` draws as `read src/app.ts`, and for a shell card the call's own summary, never the command, which the card draws once as its `$` row — a loading row while it runs, and a body folded to `toolPreviewLines` rows. A top-level workflow call also draws its own run beside that card: the name, member count, status, and a ten-cell member progress bar with the settled count, then each phase and the members that started. While a live run runs, its `◇` pulses through a diamond animation and each running member's `○` spins in the subagent family's flowers, one phase ahead of the member before it; a run drawn from a replayed log spins only while its background job is still live, and reduced motion draws the static glyphs. Running groups and groups with a failed, cancelled, or interrupted member open; a clean completion stays closed. Space or Enter on a run or phase folds that level, and Enter on a running member opens its child only while that child is a live direct child of this session. The card appears when the model starts the call, its header first and its rows unrolling beneath it over about `toolRevealFrames` frames; the result rows unroll and float out the same way when the tool answers. An `edit` or `write` diff card fills each added row edge to edge with a green background and each removed row with a red one, the removed rows above the added ones, and paints the `+` and `-` in their own lighter colour so each sign reads against the fill rather than in it; a wrapped row carries the fill on without a second sign; once the tool applied the change, the applied hunks replace the diff the call carried and lead every row with its file line number, the new file's for added and unchanged rows and the old file's for removed rows. A `subagent` or `subagent_*` card draws folded as one row behind the same status glyph, spinning while it runs and a dim `◆` for a child handed to the background: while it runs, the tool name, the task description, and the requested model and `background` when the call names them; once settled, the description dimmed with `[done]`, `[started]` for a child handed to the background, or `[failed]` at the right edge. `Space` on the marked row, or `Ctrl+O`, unfolds the full card. A nonempty system prompt and each injected context — instructions, catalogs, snapshots, notices, relays, and recalls — draw as a dim `⬡` title over the first `contextPreviewLines` rows of their model-facing text, with each snapshot contribution named above its own rows; an empty system prompt is omitted. A compaction, from `/compact` or automatic, draws as one context block whose accent `⬡` title names its origin and the estimated tokens it replaced and its summary costs, as in `context compacted by /compact · ~6.4k → ~0.9k tokens` or `context compacted automatically in turn 12 · …`; under the title, `compressed` names the item count and turns the summary replaced, each prompt among them (five at most, one row each), and a count of the replies, tool results by tool, context blocks, and earlier summaries, and `preserved` names the system prompt and what each later turn still holds verbatim; both stay drawn while the summary under them folds to `contextPreviewLines` rows like any context block. The checkpoint message itself is not drawn again. A `/compact` attempt the log closes with an error prints `/compact failed · <error>` when the session is redrawn, since the live command reports its own failure; a failed automatic attempt changes nothing and draws nothing, as in the browser. A tool card and a context block that carry more rows than they draw end on one marker: `… <n> more rows · Space expands` while the conversation's focus holds that block, and `… <n> more rows · Ctrl+O expands` otherwise. Fenced code in a reply, the file rows of a `read` card, the changed rows of an `edit` or `write` diff card — with `+` additions marked green, `-` removals red, and source text behind those signs drawn in the language the file's extension names — and the shell command of a `!` / `!!` draft, a `$ command` user-shell row (its `$` in the accent colour), and a terminal tool card, use syntax colours from a theme the terminal's own background picks, light or dark; the grammar of a language loads on the first block that asks for it, so that block draws plain and is repainted in colour a moment later, and a language with no grammar here, a terminal that reports neither 24-bit nor 256 colours, and `codeHighlight: false` each draw every block plain. Headings and list markers use warm orange, links and inline code use violet, and quotes stay dim. Streamed reasoning, reply text, and tool arguments are queued as they arrive and drawn a share per frame, about 60 frames per second by default, so a network burst spreads over `streamPaceFrames` frames instead of landing at once, and the queue never holds the model call back. Streamed reply text fades in and every word keeps its own clock: a word enters near the terminal's background color and brightens to the color it settles in over `streamFadeSteps` ticks of `streamFadeStepMs` each, so a fast stream leaves a longer trail of brightening words rather than a darker one. Streamed reasoning and a tool card float out over the same duration: they appear at a lifted color and recede to the dim italic or palette colors they settle in; a card redrawn from persisted history carries no fade, and text that has settled is never dimmed again.
43
+ Every frame is drawn one column in from each edge of the terminal, so no line of the conversation or of the docked chrome touches either side. The header names the session by its title once one is generated or set, with the id beside it. The transcript grows in the terminal's own scrollback: your prompts start with `❯` on a tinted full-width band while colour is on (attachments listed under them), and a prompt steered or injected into a turn that already had a model step draws dim on a darker band so it recedes behind the turn it joined, assistant reasoning is dim italic under a `✻ Thinking` header above the Markdown reply, a bloom spinning beside `Thinking` while it streams, and each tool call is a card with a status glyph — a yellow spinner of that tool family's flowers, blooms, and stars while it runs, a green `◆` once done, a red `◆` on failure — the bold tool name, the presenter headline in violet — without the tool name a presenter repeated, so `Read src/app.ts` draws as `read src/app.ts`, and for a shell card the call's own summary, never the command, which the card draws once as its `$` row — a loading row while it runs, and a body folded to `toolPreviewLines` rows. A top-level workflow call also draws its own run beside that card: the name, member count, status, and a ten-cell member progress bar with the settled count, then each phase and the members that started. While a live run runs, its `◇` pulses through a diamond animation and each running member's `○` spins in the subagent family's flowers, one phase ahead of the member before it; a run drawn from a replayed log spins only while its background job is still live, and reduced motion draws the static glyphs. Running groups and groups with a failed, cancelled, or interrupted member open; a clean completion stays closed. Space or Enter on a run or phase folds that level, and Enter on a running member opens its child only while that child is a live direct child of this session. The card appears when the model starts the call and flows out row after row, each row left to right, at one pace whatever the card holds: a full-width row takes `toolRevealFrames` frames, a shorter row proportionally less, and the columns just drawn brighten from the terminal background to their own colors. The result rows flow out the same way when the tool answers, behind whatever the card is still drawing; neither the call nor the result waits for the animation. An `edit` or `write` diff card fills each added row edge to edge with a green background and each removed row with a red one, the removed rows above the added ones, and paints the `+` and `-` in their own lighter colour so each sign reads against the fill rather than in it; a wrapped row carries the fill on without a second sign; once the tool applied the change, the applied hunks replace the diff the call carried and lead every row with its file line number, the new file's for added and unchanged rows and the old file's for removed rows. A `subagent` or `subagent_*` card draws folded as one row behind the same status glyph, spinning while it runs and a dim `◆` for a child handed to the background: while it runs, the tool name, the task description, and the requested model and `background` when the call names them; once settled, the description dimmed with `[done]`, `[started]` for a child handed to the background, or `[failed]` at the right edge. `Space` on the marked row, or `Ctrl+O`, unfolds the full card. A nonempty system prompt and each injected context — instructions, catalogs, snapshots, notices, relays, and recalls — draw as a dim `⬡` title over the first `contextPreviewLines` rows of their model-facing text, with each snapshot contribution named above its own rows; an empty system prompt is omitted. A compaction, from `/compact` or automatic, draws as one context block whose accent `⬡` title names its origin and the estimated tokens it replaced and its summary costs, as in `context compacted by /compact · ~6.4k → ~0.9k tokens` or `context compacted automatically in turn 12 · …`; under the title, `compressed` names the item count and turns the summary replaced, each prompt among them (five at most, one row each), and a count of the replies, tool results by tool, context blocks, and earlier summaries, and `preserved` names the system prompt and what each later turn still holds verbatim; both stay drawn while the summary under them folds to `contextPreviewLines` rows like any context block. The checkpoint message itself is not drawn again. A `/compact` attempt the log closes with an error prints `/compact failed · <error>` when the session is redrawn, since the live command reports its own failure; a failed automatic attempt changes nothing and draws nothing, as in the browser. A tool card and a context block that carry more rows than they draw end on one marker: `… <n> more rows · Space expands` while the conversation's focus holds that block, and `… <n> more rows · Ctrl+O expands` otherwise. Fenced code in a reply, the file rows of a `read` card, the changed rows of an `edit` or `write` diff card — with `+` additions marked green, `-` removals red, and source text behind those signs drawn in the language the file's extension names — and the shell command of a `!` / `!!` draft, a `$ command` user-shell row (its `$` in the accent colour), and a terminal tool card, use syntax colours from a theme the terminal's own background picks, light or dark; the grammar of a language loads on the first block that asks for it, so that block draws plain and is repainted in colour a moment later, and a language with no grammar here, a terminal that reports neither 24-bit nor 256 colours, and `codeHighlight: false` each draw every block plain. Headings and list markers use warm orange, links and inline code use violet, and quotes stay dim. Streamed reasoning, reply text, and tool arguments are queued as they arrive and drawn a share per frame, about 60 frames per second by default, so a network burst spreads over `streamPaceFrames` frames instead of landing at once, and the queue never holds the model call back. Streamed reply text fades in and every word keeps its own clock: a word enters near the terminal's background color and brightens to the color it settles in over `streamFadeSteps` ticks of `streamFadeStepMs` each, so a fast stream leaves a longer trail of brightening words rather than a darker one. Streamed reasoning floats out over the same duration: it appears at a lifted color and recedes to the dim italic it settles in. Each column of a tool card brightens over it from the terminal background to the palette color it settles in; a card redrawn from persisted history carries no flow or fade, and text that has settled is never dimmed again.
44
44
 
45
45
  Below the transcript sit a spinner while the agent works — `thinking`, `writing`, `calling <tool>`, a retry, or `compacting`, each beside its own braille animation: circling dots, filling lines, an orbiting dot, a sliding bar, or a settling cell — with a bright highlight sweeping across the word, plus live `↑` send and `↓` receive tokens for the current model call, as compact `k` / `M` / `B` counts, growing as the stream arrives and settling on the provider usage chunk — any open prompt, a boxed follow-ups list while messages wait, an activity board of the open turn's todos and latest descendant line while either has a row — completed todo content scratched out and status glyphs colored green, yellow, or cyan, the in-progress one a spinner, at most four todo rows then `+<n> more`, not a focus region, gone on `turn/end` and bind — the editor, the subagent panel, and the footer: a status bar that, unfocused, is one line built from both ends inward. The editor's caret is the terminal's own blinking bar: the app asks for that shape at start, gives your default back on quit, and draws no caret at all while the status bar or the panel holds the keyboard. The model and entry keys are colored; live turn, context, and todo facts use yellow, violet, and green. The model is anchored at the left edge and is never dropped — past 20 columns it falls back to the bare model name, and only a label still too wide for that is ellipsized — and the two keys that leave the input are anchored at the right edge as `Shift+↑ read · Shift+↓ status`, or `Shift+↑ select · Shift+↓ status` while follow-ups wait, narrowing to `Shift+↑↓ nav` and dropped below 40 columns. The key facts fill whatever middle is left, in bar order: effort (`effort default` when the selection leaves reasoning to the model), the running turn's elapsed time, the context window percentage, the todo counts, and the workspace path (shortened with `~` and `…/` when long). Every segment that middle cannot hold folds into a trailing `+N`, together with the segments the unfocused line never draws — the permission preset, token usage (session totals plus the in-flight call), the goal and plan-mode markers from the projection seam, and the count of pending attachments. Model-request retries appear as notices, the same facts the browser's markers carry.
46
46
 
@@ -52,7 +52,7 @@ The focused block is also marked where it stands, with a two-column gutter that
52
52
 
53
53
  Transient key feedback floats as a dim framed line in the top-right corner of the viewport: `press Esc again to stop turn <n>`, `press Ctrl+C again to quit`, and `nothing in the transcript to read yet`. It holds at full strength for `toastMs`, fades out, costs the conversation no row of its own, and takes no keyboard; where the renderer can no longer repaint the top of the viewport it is printed into the conversation instead, which keeps it. Facts worth keeping are notices in the conversation: `stopping the turn…`, `wait for the session switch to finish`, `above the repaint window · opened in the reader`, and every command result.
54
54
 
55
- Motion reaches past streamed text: every lift and float rides the same fade tick, and every working animation one spinner tick. The keyboard landing on the conversation, the subagent panel, or the status bar lifts that surface's frame, its chip, and the mark it holds for twelve ticks of `streamFadeStepMs`; a step of the conversation walk lifts the newly focused gutter for six; and a step along the bar lifts the selected label for eight. A new or status-changed activity-board todo row, and a replaced descendant line, float out on the fade tick the same way a tool card does; replay and `reducedMotion` draw the settled board. Every working animation has eight frames, takes the one it draws from the clock, and steps on the spinner tick of `spinnerMs`, 100 ms by default, so everything that spins advances at the same instant and speed, a label change keeps the beat, and the tick is armed only while one of them is drawn. The working spinner alone draws braille, its animation following its status, so it never repeats a card's glyph. A running tool card and a folded subagent row draw the animation of that tool's family, and an in-progress todo row draws the planning family's. Each of those animations mixes flowers, blooms, and stars, no two families share a glyph, and every frame of one family is different, so two indicators of one family at different phases never draw the same glyph. An indicator that starts while others of its family spin takes a phase at which it never draws their glyph at the same instant, for up to eight of that family spinning together; beyond eight, it takes the phase the fewest indicators of that family hold. A card whose header has scrolled above the part of the screen the renderer can repaint draws the static `◆` from then on, and `reducedMotion` draws every one of them still — the card's `◆`, the todo's `▸`, and the working spinner's label without a glyph — with no spinner tick. The reader arrives complete on the screen it owns, and what it newly shows floats out on the fade tick the way a tool card does: opening it and showing another turn float out the whole turn, and stepping the list to another section of the same turn floats out that section, over `streamFadeSteps` ticks; scrolling, live growth, and a rewrap float nothing out. No lift changes how many lines anything draws, and `reducedMotion` — like `NO_COLOR`, a disabled palette, and `TERM=dumb` — turns every lift and float off and arms no repaint for them.
55
+ Motion reaches past streamed text: every lift and float rides the same fade tick, and every working animation one spinner tick. The keyboard landing on the conversation, the subagent panel, or the status bar lifts that surface's frame, its chip, and the mark it holds for twelve ticks of `streamFadeStepMs`; a step of the conversation walk lifts the newly focused gutter for six; and a step along the bar lifts the selected label for eight. A new or status-changed activity-board todo row, and a replaced descendant line, float out on the fade tick; replay and `reducedMotion` draw the settled board. Every working animation has eight frames, takes the one it draws from the clock, and steps on the spinner tick of `spinnerMs`, 100 ms by default, so everything that spins advances at the same instant and speed, a label change keeps the beat, and the tick is armed only while one of them is drawn. The working spinner alone draws braille, its animation following its status, so it never repeats a card's glyph. A running tool card and a folded subagent row draw the animation of that tool's family, and an in-progress todo row draws the planning family's. Each of those animations mixes flowers, blooms, and stars, no two families share a glyph, and every frame of one family is different, so two indicators of one family at different phases never draw the same glyph. An indicator that starts while others of its family spin takes a phase at which it never draws their glyph at the same instant, for up to eight of that family spinning together; beyond eight, it takes the phase the fewest indicators of that family hold. A card whose header has scrolled above the part of the screen the renderer can repaint draws the static `◆` from then on, and `reducedMotion` draws every one of them still — the card's `◆`, the todo's `▸`, and the working spinner's label without a glyph — with no spinner tick. The reader arrives complete on the screen it owns, and what it newly shows floats out on the fade tick: opening it and showing another turn float out the whole turn, and stepping the list to another section of the same turn floats out that section, over `streamFadeSteps` ticks; scrolling, live growth, and a rewrap float nothing out. No lift changes how many lines anything draws, and `reducedMotion` — like `NO_COLOR`, a disabled palette, and `TERM=dumb` — turns every lift and float off and arms no repaint for them.
56
56
 
57
57
  The subagent panel is drawn while a local subagent session under the bound one is resident, or the listing carries a candidate it could not read; an external task has no local session and stays out of the panel. Unfocused it is one summary line with the listed count and the first child's key label; focused, its heading counts what it lists and ends on the keys it answers, `↑↓ children · Enter opens · Tab regions · Esc input`, narrowed to `↑↓ children · Esc input` and then to `Esc input` on a terminal that cannot hold them, and each row gives the child's depth indent, its label or id, its mode (`one-shot` or `continuable`), `resident`, whether its agent is `running`, `completed` after its latest settled turn, or `idle`, its elapsed time — the open turn's, else the total its settled turns took — and its token usage, as far as this process's own view of that child and the composed projections carry them. Six rows are drawn at most, with `+<n> more · /subagents lists them all` under them; `/subagents` shows an external task as `external task · no local session` and shows its no-local-session detail instead of opening a Session, a candidate the listing could not interpret draws as `unreadable: <reason>` and shows its reason instead of opening a Session, and a failed listing keeps the rows the last good one produced with `listing failed: <reason>` beneath. The panel disappears with its last row. `Enter` or `Right` on a readable row, like `Enter` on a readable `/subagents` row, opens that child as a subagent view: the terminal draws the child session in place of the bound one — its transcript, live stream, conversation walk, inspector, reader, and its own subagent panel — while the session it was entered from stays open. A resident child is read live, and any other is resumed. The entry's detail rows print as notices under `subagent <label> · Ctrl+P or /parent returns to session <id>`, the header ends on `◆ subagent view ›` with one `›` per level entered and `· Ctrl+P returns`, a shaded line directly above the input reads `◆ subagent view · main › <label> · Ctrl+P back to <parent>` for as long as the view is open, whatever the transcript has scrolled to, and `Ctrl+P` or `/parent` goes back one level, redrawing the parent from its log as it stands then. A one-shot child opens read-only: its banner opens with `◆ subagent view · one-shot, read-only`, a prompt or `!` line typed there is refused with a notice and stays in the editor, `Esc` does not stop its turn, and commands such as `/parent` still run, while a continuable child takes prompts and a stop as any session does. `/new`, `/clear`, `/resume`, `/sessions`, and `/fork` refuse while any session in that chain runs a turn or a background job, since releasing a session ends its jobs, and otherwise release every view with the session they leave; quitting releases every view and saves the root session.
58
58
 
@@ -240,10 +240,10 @@ An approval request draws `Allow <tool>?` with the asker's reason, the logged ca
240
240
  | `codeHighlight` | `true` | Draw fenced code in a reply, the file rows of `read` and diff tool cards, and shell commands in a `!` / `!!` draft, a `$ command` row, and a terminal tool card, in syntax colours, from a theme the terminal's background picks |
241
241
  | `toastMs` | `2000` | How long a transient key-feedback line holds at full strength before it fades out, which is also the window in which a second `Esc` stops the running turn |
242
242
  | `liveRefreshMs` | `1000` | Period of the redraw that advances the `turn` segment and the panel's elapsed values and re-reads a stale subagent listing |
243
- | `streamFadeSteps` | `24` | How many ticks a fade lasts: reply text fades in, reasoning and tool cards float out, over `streamFadeSteps × streamFadeStepMs` |
243
+ | `streamFadeSteps` | `24` | How many ticks a fade lasts: reply text and the columns of a tool card fade in, reasoning floats out, over `streamFadeSteps × streamFadeStepMs` |
244
244
  | `streamFadeStepMs` | `16` | One frame: the fade tick, the repaint period while anything is still moving, and the period paced stream text is drawn at; duration is `streamFadeSteps × streamFadeStepMs` |
245
245
  | `streamPaceFrames` | `8` | Frames a backlog of streamed reply text or tool arguments takes to reach the screen. Thinking still queued when its block ends, or when reply text or a tool call starts, is drawn at once; `0`, like `reducedMotion`, draws each delta as it arrives |
246
- | `toolRevealFrames` | `6` | Frames the rows of a tool card take to unroll when the card appears or its result lands, a share of the hidden rows per frame. Unfolding a card, and a card whose unrolling rows are above the part of the screen the renderer can repaint, draw every row at once; `0`, like `reducedMotion`, draws every row at once |
246
+ | `toolRevealFrames` | `6` | Frames one full-width row of a tool card takes to flow out when the card appears or its result lands; a shorter row takes proportionally less, so every card flows at the same pace in columns per second. Unfolding a card, and a card whose flowing row is above the part of the screen the renderer can repaint, draw every column at once; `0`, like `reducedMotion`, draws every card whole with no animation |
247
247
  | `spinnerMs` | `100` | Milliseconds one frame of every working animation lasts — the working spinner's glyph and shimmer, running tool cards, folded subagent rows, and the in-progress todo — all stepping together on one tick of this period. Every animation has eight frames, so a cycle lasts `8 × spinnerMs`; a value below 80 is rejected |
248
248
  | `reducedMotion` | `false` | Draw streamed text, streamed reasoning, tool cards, and the chrome in their settled colors, with no fade, no lift, no spinner glyph or shimmer, and no repeating repaint |
249
249
  | `mouse` | `false` | Make every key chip clickable: a left click on one presses its key. Mouse reports turn on; the wheel opens and scrolls the full-screen reader unless a prompt is open, and most terminals still scroll and select with `Shift` held |
@@ -304,10 +304,10 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
304
304
  | [`src/alt-screen.ts`](src/alt-screen.ts) | The terminal's alternate screen: taking it, drawing absolutely addressed rows on it with their key marks taken out, and giving the conversation's own screen back |
305
305
  | [`src/key-chips.ts`](src/key-chips.ts) | Key chips: the key names a hint draws as chips, the bytes each presses, the zero-width mark a clickable chip carries, and the cells a screen keeps for each marked key |
306
306
  | [`src/pointer.ts`](src/pointer.ts) | Pointer input with `mouse: true`: the terminal's mouse reports turned on and off, a click read from them, the cursor query that places a main-screen click, and the key a click presses |
307
- | [`src/fade.ts`](src/fade.ts) | The streamed-text fade: the wall-clock tail tracker, the block-fade clock and registry, the fade-in ramp, the float-out mix, and the recolor of rendered lines |
308
- | [`src/pace.ts`](src/pace.ts) | The stream pacer: the ordered queue between the assistant stream and the transcript, drained a backlog share per frame; and the row reveal that unrolls a tool card the same way |
307
+ | [`src/fade.ts`](src/fade.ts) | The streamed-text fade: the wall-clock tail tracker, the block-fade clock and registry, the fade-in ramp, the float-out mix, the fade-in of one slice of a rendered line, and the recolor of rendered lines |
308
+ | [`src/pace.ts`](src/pace.ts) | The stream pacer: the ordered queue between the assistant stream and the transcript, drained a backlog share per frame; and the card flow, whose front crosses a tool card's columns at a constant pace on the wall clock |
309
309
  | [`src/motion.ts`](src/motion.ts) | The chrome motion clock and the three-level lift its call sites draw with: the landing, the section step, and the bar walk |
310
- | [`src/spinner.ts`](src/spinner.ts) | The working animations: the activity line's braille status animations, the flower, bloom, and star animation of each tool family for running cards, subagent rows, and in-progress todos, which tool draws which, the frame each draws at one instant, the phase that keeps one family's indicators apart, and the shimmer the activity label carries |
310
+ | [`src/spinner.ts`](src/spinner.ts) | The working animations: the activity line's braille status animations, the flower, bloom, and star animation of each tool family for running cards, subagent rows, and in-progress todos, the bloom frames of the live Thinking header, which tool draws which, the frame each draws at one instant, the phase that keeps one family's indicators apart, and the shimmer the activity label carries |
311
311
  | [`src/prompts.ts`](src/prompts.ts) | Approval, question, picker, and read-only detail prompts plus the modal queue |
312
312
  | [`src/toast.ts`](src/toast.ts) | The transient key-feedback line: its overlay, its clock, and the lines it carries |
313
313
  | [`src/pinned-prompt.ts`](src/pinned-prompt.ts) | The prompt row the reader pins over a scrolled turn: the glyph, the prompt collapsed to one line, and the band |
@@ -339,9 +339,9 @@ The patch rides over `dsh-base`: it sets the coding persona prefix and cwd suffi
339
339
  | [`tests/editor.spec.ts`](tests/editor.spec.ts) | The terminal caret, `Shift+Left` / `Shift+Right` word navigation, and `!` / `!!` draft colour against pi-tui's editor behavior |
340
340
  | [`tests/frame.spec.ts`](tests/frame.spec.ts) | The rules, the chip, the body rows, and the legend a width holds |
341
341
  | [`tests/motion.spec.ts`](tests/motion.spec.ts) | The motion clock's levels, its repaint demand, and the lift each level draws |
342
- | [`tests/spinner.spec.ts`](tests/spinner.spec.ts) | The animation sets (eight one-column frames, braille only on the activity line, eight different frames in each tool family, no glyph shared by two families, every family mixing flowers, blooms, and stars), tool-family mapping, activity mapping, the wall-clock frame step, the phase stagger, and the shimmer's sweep, rest, and disabled-palette output |
343
- | [`tests/pace.spec.ts`](tests/pace.spec.ts) | The pacer's per-frame share, grapheme cuts, arrival order, flush, per-channel flush, and clear, and the row reveal's per-frame share, settle, and clamp |
344
- | [`tests/stream-pace.spec.ts`](tests/stream-pace.spec.ts) | Paced reply text and tool arguments in stream order, thinking drawn when its block ends, the flush at stream end and before a logged event, reduced motion, and tool cards unrolling on the frame tick |
342
+ | [`tests/spinner.spec.ts`](tests/spinner.spec.ts) | The animation sets (eight one-column frames, braille only on the activity line, eight different frames in each tool family, no glyph shared by two families or by the Thinking bloom, every family mixing flowers, blooms, and stars), tool-family mapping, activity mapping, the wall-clock frame step, the phase stagger, and the shimmer's sweep, rest, and disabled-palette output |
343
+ | [`tests/pace.spec.ts`](tests/pace.spec.ts) | The pacer's per-frame share, grapheme cuts, arrival order, flush, per-channel flush, and clear, and the card flow's constant pace, trail, settle, and clamp |
344
+ | [`tests/stream-pace.spec.ts`](tests/stream-pace.spec.ts) | Paced reply text and tool arguments in stream order, thinking drawn when its block ends, the flush at stream end and before a logged event, reduced motion, and tool cards flowing out on the frame tick at a constant pace |
345
345
  | [`tests/view-banner.spec.ts`](tests/view-banner.spec.ts) | The subagent-view line's trail, back target, width, and absence at the main session |
346
346
  | [`tests/toast.spec.ts`](tests/toast.spec.ts) | The transient line's box, its hold, its fade, and its early settlement |
347
347
  | [`tests/pinned-prompt.spec.ts`](tests/pinned-prompt.spec.ts) | The prompt row the reader pins: the glyph, collapsed whitespace, the ellipsis, and the band |
@@ -40,7 +40,7 @@ dsh tui --no-open # print sign-in URLs without opening a
40
40
 
41
41
  ### 屏幕布局
42
42
 
43
- 每一帧都从终端左右两边各内缩一列绘制,因此对话记录与停靠的界面组件都不会有任何一行贴到两侧边缘。页眉在标题生成或设置后以标题命名会话,并在旁边显示 id。对话记录在终端自身的回滚区中增长:你的提示以 `❯` 开头,启用颜色时铺在一条通栏的着色背景带上(附件列在其下),而在已有模型步骤的轮次中被引导或注入的提示以暗色文字铺在更深的背景带上,退到它所加入的轮次之后,assistant 的推理以暗色斜体显示在 `✻ Thinking` 标题之下、Markdown 回复上方,每次工具调用是一张卡片,含状态符号(运行中为按工具族混合花朵、绽放与星形的黄色旋转指示、完成为绿色 `◆`、失败为红色 `◆`)、粗体工具名、以紫色显示的呈现器标题(去掉呈现器重复写出的工具名,因此 `Read src/app.ts` 画成 `read src/app.ts`;shell 卡片取该次调用自身的摘要,绝不取命令,命令只由卡片的 `$` 行绘制一次)、运行中的一行加载标记,以及折叠到 `toolPreviewLines` 行的正文。顶层 workflow 调用还会在该卡片旁另绘一次运行:运行名、成员数、状态,以及一条十格的成员进度条与已结束数,然后是每个阶段和已启动的成员。实时运行进行中时,其 `◇` 以菱形动画脉动,每个运行中成员的 `○` 以子 agent 族的花朵旋转,相位比前一个成员领先一格;从重放日志绘制的运行只在其后台作业仍存活时旋转,减少动效时绘制静态符号。运行中的层级,以及含失败、取消或中断成员的层级会展开;干净完成的层级保持折叠。在运行或阶段上按 Space 或 Enter 折叠该层,在仍在运行的成员上按 Enter 只会在该子会话是本会话的直接子会话且仍在本进程运行时打开它。卡片在模型开始调用时出现,先画标题,其下各行在约 `toolRevealFrames` 帧内逐行展开;工具回答后,结果行也以同样方式展开并浮出。`edit` 或 `write` diff 卡片把每一新增行整行铺满绿色背景、每一删除行整行铺满红色背景,删除的旧行在上、新增的新行在下,并把 `+` 与 `-` 画成各自更亮的颜色,使符号从填充色中读得出来;折行续行只延续填充色,不再画第二个符号;工具应用变更后,已应用的 hunk 取代调用时携带的 diff,并在每行前标出文件行号,新增行与未变行用新文件的行号,删除行用旧文件的行号。`subagent` 与 `subagent_*` 卡片折叠时只画一行,行首是同样的状态符号,运行中旋转,交给后台的子 agent 则为暗色 `◆`:运行中显示工具名、任务描述,以及调用指定的模型与 `background`;结束后描述变暗,右端标出 `[done]`,交给后台的子 agent 标 `[started]`,失败标 `[failed]`。在被标记的行上按 `Space`,或按 `Ctrl+O`,即可展开完整卡片。非空的系统提示词与每一条注入的上下文——instructions、catalogs、snapshots、notices、relays 与 recalls——绘制为暗色 `⬡` 标题,其下是面向模型文本的前 `contextPreviewLines` 行,快照的每一份贡献具名写在其自身各行上方;空的系统提示词则省略。一次压缩(compaction)——无论来自 `/compact` 还是自动触发——绘制为一个上下文块,其强调色 `⬡` 标题写明来源,以及被替换内容与摘要各自的估算 token 数,如 `context compacted by /compact · ~6.4k → ~0.9k tokens` 或 `context compacted automatically in turn 12 · …`;标题之下,`compressed` 写明摘要替换的条目数与轮次、其中的每条提示(最多五条,每条一行),以及回复、按工具分列的工具结果、上下文块与更早摘要的计数,`preserved` 写明系统提示词以及之后每一轮仍逐字保留的内容;这两部分始终绘出,其下的摘要则像其他上下文块一样折叠到 `contextPreviewLines` 行。检查点消息本身不再重复绘制。日志以错误结束的 `/compact` 尝试会在会话重绘时打印 `/compact failed · <error>`,因为实时运行的命令会自己报告失败;失败的自动尝试不改变任何内容,也不绘制任何内容,与浏览器一致。承载的行数多于其绘制行数的工具卡片与上下文块,结尾都是同一条标记:该块被对话记录的焦点持有时为 `… <n> more rows · Space expands`,否则为 `… <n> more rows · Ctrl+O expands`。回复中的围栏代码、`read` 卡片的文件行、`edit` 或 `write` diff 卡片的变更行——其中 `+` 新增项标为绿色、`-` 删除项标为红色,符号后的源文本按文件扩展名对应的语言绘制——以及 `!` / `!!` 草稿、用户 shell 的 `$ command` 行(其 `$` 用强调色)与终端工具卡片中的 shell 命令,都使用语法高亮,配色主题由终端自身的背景在明暗之间选定;某种语言的语法会在第一个用到它的代码块出现时才加载,因此该块先以纯文本绘制、随后被重绘为彩色;这里没有对应语法的语言、既不支持 24 位也不支持 256 色的终端,以及 `codeHighlight: false`,都会把每个代码块画成纯文本。标题与列表标记使用暖橙色,链接与行内代码使用紫色,引用保持暗色。流式推理、回复文字与工具参数到达时先入队,再按帧(默认约每秒 60 帧)分批绘制,因此一次网络突发会分摊到 `streamPaceFrames` 帧里,而不是一次落下,队列也从不拖慢模型调用。流式回复文字会淡入,而且每个词各走各的时钟:一个词以接近终端背景色的亮度出现,并经 `streamFadeSteps` 次、每次 `streamFadeStepMs` 提亮到它最终稳定的颜色,因此流得更快只会留下更长的一串正在提亮的词,而不会更暗。流式推理与工具卡片在同一时长内浮出:它们以抬高的颜色出现,再退回到稳定时的暗色斜体或调色板颜色;从持久化历史重绘的卡片不带淡入,已经稳定下来的文字也不会再被调暗。
43
+ 每一帧都从终端左右两边各内缩一列绘制,因此对话记录与停靠的界面组件都不会有任何一行贴到两侧边缘。页眉在标题生成或设置后以标题命名会话,并在旁边显示 id。对话记录在终端自身的回滚区中增长:你的提示以 `❯` 开头,启用颜色时铺在一条通栏的着色背景带上(附件列在其下),而在已有模型步骤的轮次中被引导或注入的提示以暗色文字铺在更深的背景带上,退到它所加入的轮次之后,assistant 的推理以暗色斜体显示在 `✻ Thinking` 标题之下、Markdown 回复上方,流式期间标题旁的绽放符号随之旋转,每次工具调用是一张卡片,含状态符号(运行中为按工具族混合花朵、绽放与星形的黄色旋转指示、完成为绿色 `◆`、失败为红色 `◆`)、粗体工具名、以紫色显示的呈现器标题(去掉呈现器重复写出的工具名,因此 `Read src/app.ts` 画成 `read src/app.ts`;shell 卡片取该次调用自身的摘要,绝不取命令,命令只由卡片的 `$` 行绘制一次)、运行中的一行加载标记,以及折叠到 `toolPreviewLines` 行的正文。顶层 workflow 调用还会在该卡片旁另绘一次运行:运行名、成员数、状态,以及一条十格的成员进度条与已结束数,然后是每个阶段和已启动的成员。实时运行进行中时,其 `◇` 以菱形动画脉动,每个运行中成员的 `○` 以子 agent 族的花朵旋转,相位比前一个成员领先一格;从重放日志绘制的运行只在其后台作业仍存活时旋转,减少动效时绘制静态符号。运行中的层级,以及含失败、取消或中断成员的层级会展开;干净完成的层级保持折叠。在运行或阶段上按 Space 或 Enter 折叠该层,在仍在运行的成员上按 Enter 只会在该子会话是本会话的直接子会话且仍在本进程运行时打开它。卡片在模型开始调用时出现,并逐行向外流出,每行从左到右,无论卡片装着什么,速度都一致:一整行宽的内容需 `toolRevealFrames` 帧,较短的行按比例更短,刚画出的列会从终端背景色亮起到各自的颜色。工具回答后,结果行也以同样方式流出,排在卡片尚未画完的内容之后;调用与结果都不会等待动画。`edit` 或 `write` diff 卡片把每一新增行整行铺满绿色背景、每一删除行整行铺满红色背景,删除的旧行在上、新增的新行在下,并把 `+` 与 `-` 画成各自更亮的颜色,使符号从填充色中读得出来;折行续行只延续填充色,不再画第二个符号;工具应用变更后,已应用的 hunk 取代调用时携带的 diff,并在每行前标出文件行号,新增行与未变行用新文件的行号,删除行用旧文件的行号。`subagent` 与 `subagent_*` 卡片折叠时只画一行,行首是同样的状态符号,运行中旋转,交给后台的子 agent 则为暗色 `◆`:运行中显示工具名、任务描述,以及调用指定的模型与 `background`;结束后描述变暗,右端标出 `[done]`,交给后台的子 agent 标 `[started]`,失败标 `[failed]`。在被标记的行上按 `Space`,或按 `Ctrl+O`,即可展开完整卡片。非空的系统提示词与每一条注入的上下文——instructions、catalogs、snapshots、notices、relays 与 recalls——绘制为暗色 `⬡` 标题,其下是面向模型文本的前 `contextPreviewLines` 行,快照的每一份贡献具名写在其自身各行上方;空的系统提示词则省略。一次压缩(compaction)——无论来自 `/compact` 还是自动触发——绘制为一个上下文块,其强调色 `⬡` 标题写明来源,以及被替换内容与摘要各自的估算 token 数,如 `context compacted by /compact · ~6.4k → ~0.9k tokens` 或 `context compacted automatically in turn 12 · …`;标题之下,`compressed` 写明摘要替换的条目数与轮次、其中的每条提示(最多五条,每条一行),以及回复、按工具分列的工具结果、上下文块与更早摘要的计数,`preserved` 写明系统提示词以及之后每一轮仍逐字保留的内容;这两部分始终绘出,其下的摘要则像其他上下文块一样折叠到 `contextPreviewLines` 行。检查点消息本身不再重复绘制。日志以错误结束的 `/compact` 尝试会在会话重绘时打印 `/compact failed · <error>`,因为实时运行的命令会自己报告失败;失败的自动尝试不改变任何内容,也不绘制任何内容,与浏览器一致。承载的行数多于其绘制行数的工具卡片与上下文块,结尾都是同一条标记:该块被对话记录的焦点持有时为 `… <n> more rows · Space expands`,否则为 `… <n> more rows · Ctrl+O expands`。回复中的围栏代码、`read` 卡片的文件行、`edit` 或 `write` diff 卡片的变更行——其中 `+` 新增项标为绿色、`-` 删除项标为红色,符号后的源文本按文件扩展名对应的语言绘制——以及 `!` / `!!` 草稿、用户 shell 的 `$ command` 行(其 `$` 用强调色)与终端工具卡片中的 shell 命令,都使用语法高亮,配色主题由终端自身的背景在明暗之间选定;某种语言的语法会在第一个用到它的代码块出现时才加载,因此该块先以纯文本绘制、随后被重绘为彩色;这里没有对应语法的语言、既不支持 24 位也不支持 256 色的终端,以及 `codeHighlight: false`,都会把每个代码块画成纯文本。标题与列表标记使用暖橙色,链接与行内代码使用紫色,引用保持暗色。流式推理、回复文字与工具参数到达时先入队,再按帧(默认约每秒 60 帧)分批绘制,因此一次网络突发会分摊到 `streamPaceFrames` 帧里,而不是一次落下,队列也从不拖慢模型调用。流式回复文字会淡入,而且每个词各走各的时钟:一个词以接近终端背景色的亮度出现,并经 `streamFadeSteps` 次、每次 `streamFadeStepMs` 提亮到它最终稳定的颜色,因此流得更快只会留下更长的一串正在提亮的词,而不会更暗。流式推理在同一时长内浮出:以抬高的颜色出现,再退回到稳定时的暗色斜体。工具卡片的每一列则在这段时长内从终端背景色亮起到它稳定时的调色板颜色;从持久化历史重绘的卡片不带流出或淡入,已经稳定下来的文字也不会再被调暗。
44
44
 
45
45
  对话记录下方依次是 agent 工作时的旋转指示——`thinking`、`writing`、`calling <tool>`、重试或 `compacting`,各自旁边是它自己的盲文动画:环绕的点、逐行填满的线、绕行的单点、滑动的横条,或沉降又回满的方格——标签单词上带着一道扫过的高亮,并带着当前这次模型调用的实时 `↑` 发送与 `↓` 接收 token,以紧凑的 `k` / `M` / `B` 计数,随数据流入增长,并在提供方的 usage 块到达后落定——任何打开的提示、有消息等待时的带框 follow-ups 列表、本轮 todo 与最新后代行的 activity board(有行时才绘制;已完成内容划掉,状态符号以绿色、黄色或青色显示,进行中的那一项为旋转指示,todo 最多四行其后 `+<n> more`,不是焦点区域,在 `turn/end` 与 bind 时消失)、编辑器、子 agent 面板,以及页脚:未聚焦时是一行由两端向内构建的状态栏。编辑器的光标是终端自身的闪烁竖条:应用在启动时请求这一形状,退出时把你的默认形状还回去,而状态栏或面板持有键盘期间完全不绘制光标。模型与入口按键带有颜色;进行中的轮次、上下文与 todo 信息分别使用黄色、紫色与绿色。模型锚定在左端且永不丢弃——超过 20 列时退回到裸模型名,只有仍然过宽的标签才会被省略号截断——离开编辑器的那两个按键则锚定在右端,写作 `Shift+↑ read · Shift+↓ status`,有 follow-ups 等待时则写作 `Shift+↑ select · Shift+↓ status`,窄到一定程度收缩为 `Shift+↑↓ nav`,不足 40 列时整体丢弃。关键事实填满剩下的中间部分,按状态栏顺序排列:推理强度(选择把推理交给模型时标为 `effort default`)、进行中轮次的已用时间、上下文窗口百分比、todo 计数,以及 workspace 路径(过长时以 `~` 与 `…/` 缩短)。中间部分容纳不下的每个分段都折进末尾的 `+N`,未聚焦行从不绘制的那些分段也一并折入——权限预设、token 用量(会话合计加上进行中的这次调用)、来自投影接缝的目标与计划模式标记,以及待发送附件的数量。模型请求重试以通知形式出现,与浏览器标记承载的事实相同。
46
46
 
@@ -52,7 +52,7 @@ dsh tui --no-open # print sign-in URLs without opening a
52
52
 
53
53
  临时按键反馈以一行暗色带框文字浮在视口右上角:`press Esc again to stop turn <n>`、`press Ctrl+C again to quit` 与 `nothing in the transcript to read yet`。它以全亮度保持 `toastMs`、随后淡出,不占用对话记录自身的任何一行,也不接管键盘;渲染器已无法重绘视口顶部时,它改为打印进对话记录,从而被保留下来。值得留存的事实则是对话记录中的通知:`stopping the turn…`、`wait for the session switch to finish`、`above the repaint window · opened in the reader` 以及每一条命令结果。
54
54
 
55
- 动效不止于流式文本:每种抬亮与浮出都乘着同一个淡入时钟,每种工作动画则乘着同一个旋转时钟。键盘落到对话记录、子 agent 面板或状态栏上时,会把该表层的边框、其徽标与它持有的标记抬亮十二拍(每拍一个 `streamFadeStepMs`);对话记录走查中的一步把新聚焦的标记条抬亮六拍;状态栏上的一步把所选标签抬亮八拍。活动板上新出现或状态已变的 todo 行,以及被替换的后代行,也在淡入时钟上像工具卡片一样浮出;重放与 `reducedMotion` 则画出已稳定的活动板。每种工作动画都有八帧,由时钟决定当前画哪一帧,并在周期为 `spinnerMs`(默认 100 ms)的旋转时钟上步进,因此一切旋转中的指示都在同一时刻、以同一速度前进,标签变化也不打乱节拍,而该时钟只在其中之一被绘制时才启动。只有工作时的旋转指示画盲文,其动画随状态而变,因此它从不与卡片的符号重复。运行中的工具卡片与折叠的子 agent 行画该工具族的动画,进行中的 todo 行画规划族的动画。这些动画都把花朵、绽放与星形混在同一组帧里,族与族之间不共用符号,同一族的每一帧也各不相同,因此同一族里相位不同的两个指示在任何时刻都不会画出相同的符号。某个指示开始旋转时若同族已有其他指示在转,它会取一个相位,使它在任何时刻都不与它们画出相同的符号,同族同时旋转的不超过八个时都能做到;超过八个后,它取同族中被持有指示最少的那个相位。标题行已滚动到渲染器可重绘区域之上的卡片自此画出静态的 `◆`,而 `reducedMotion` 把它们全部画成静止的——卡片的 `◆`、todo 的 `▸`,以及不带符号、只剩标签的工作旋转指示——且不启动旋转时钟。阅读器在自己占据的屏幕上一次性完整出现,而它新显示的内容会像工具卡片一样在淡入时钟上浮出:打开它与显示另一个轮次时浮出整个轮次,在列表中步进到同一轮次的另一个小节时浮出该小节,历时 `streamFadeSteps` 拍;滚动、实时增长与重新换行都不浮出任何内容。任何抬亮都不改变任何东西绘制的行数,而 `reducedMotion`——与 `NO_COLOR`、被禁用的调色板和 `TERM=dumb` 一样——会关闭每一种抬亮与浮出,并且不为它们安排任何重绘。
55
+ 动效不止于流式文本:每种抬亮与浮出都乘着同一个淡入时钟,每种工作动画则乘着同一个旋转时钟。键盘落到对话记录、子 agent 面板或状态栏上时,会把该表层的边框、其徽标与它持有的标记抬亮十二拍(每拍一个 `streamFadeStepMs`);对话记录走查中的一步把新聚焦的标记条抬亮六拍;状态栏上的一步把所选标签抬亮八拍。活动板上新出现或状态已变的 todo 行,以及被替换的后代行,也在淡入时钟上浮出;重放与 `reducedMotion` 则画出已稳定的活动板。每种工作动画都有八帧,由时钟决定当前画哪一帧,并在周期为 `spinnerMs`(默认 100 ms)的旋转时钟上步进,因此一切旋转中的指示都在同一时刻、以同一速度前进,标签变化也不打乱节拍,而该时钟只在其中之一被绘制时才启动。只有工作时的旋转指示画盲文,其动画随状态而变,因此它从不与卡片的符号重复。运行中的工具卡片与折叠的子 agent 行画该工具族的动画,进行中的 todo 行画规划族的动画。这些动画都把花朵、绽放与星形混在同一组帧里,族与族之间不共用符号,同一族的每一帧也各不相同,因此同一族里相位不同的两个指示在任何时刻都不会画出相同的符号。某个指示开始旋转时若同族已有其他指示在转,它会取一个相位,使它在任何时刻都不与它们画出相同的符号,同族同时旋转的不超过八个时都能做到;超过八个后,它取同族中被持有指示最少的那个相位。标题行已滚动到渲染器可重绘区域之上的卡片自此画出静态的 `◆`,而 `reducedMotion` 把它们全部画成静止的——卡片的 `◆`、todo 的 `▸`,以及不带符号、只剩标签的工作旋转指示——且不启动旋转时钟。阅读器在自己占据的屏幕上一次性完整出现,而它新显示的内容会在淡入时钟上浮出:打开它与显示另一个轮次时浮出整个轮次,在列表中步进到同一轮次的另一个小节时浮出该小节,历时 `streamFadeSteps` 拍;滚动、实时增长与重新换行都不浮出任何内容。任何抬亮都不改变任何东西绘制的行数,而 `reducedMotion`——与 `NO_COLOR`、被禁用的调色板和 `TERM=dumb` 一样——会关闭每一种抬亮与浮出,并且不为它们安排任何重绘。
56
56
 
57
57
  子 agent 面板在绑定会话之下有常驻的本地子 agent 会话、或列表中带有无法读取的候选者时绘制;外部任务没有本地会话,因此不在面板中出现。未聚焦时它是一行摘要,含列出的数量与第一个子会话的关键标签;聚焦时其标题统计所列出的条目,并以它所应答的按键 `↑↓ children · Enter opens · Tab regions · Esc input` 结尾,在容纳不下时收缩为 `↑↓ children · Esc input`,再收缩为 `Esc input`;每一行给出该子会话的层级缩进、其标签或 id、其模式(`one-shot` 或 `continuable`)、`resident`、其 agent 处于 `running`、最新已结束轮次后为 `completed`,还是 `idle`、其已用时间——进行中轮次的用时,否则是已结束轮次的合计——以及其 token 用量,以本进程对该子会话的可见程度与已组合的投影所能提供的为限。最多绘制六行,其下是 `+<n> more · /subagents lists them all`;`/subagents` 把外部任务显示为 `external task · no local session`,并显示其没有本地会话的详情而不打开会话,列表无法解读的候选者绘制为 `unreadable: <reason>`,并显示其原因而不打开会话,读取失败的列表则保留上一次成功读取产生的各行,并在其下写出 `listing failed: <reason>`。面板随其最后一行一同消失。在可读的行上按 `Enter` 或 `Right`,与在可读的 `/subagents` 行上按 `Enter` 一样,会把该子会话作为子 agent 视图打开:终端在已绑定会话的位置绘制子会话——其对话记录、实时流、对话记录走查、检查器、阅读器以及它自己的子 agent 面板——而进入它之前的会话保持打开。常驻的子会话被实时读取,其他子会话则被恢复。条目的详情行作为通知打印在 `subagent <label> · Ctrl+P or /parent returns to session <id>` 之下,页眉以 `◆ subagent view ›`(每进入一层一个 `›`)与 `· Ctrl+P returns` 结尾,只要视图打开,输入框正上方就有一条着色行写着 `◆ subagent view · main › <label> · Ctrl+P back to <parent>`,无论对话记录滚动到哪里,`Ctrl+P` 或 `/parent` 返回上一层,并按父会话此刻的日志重绘它。`one-shot` 子会话以只读方式打开:其横幅以 `◆ subagent view · one-shot, read-only` 开头,在其中输入的提示词或 `!` 行会被通知拒绝并留在编辑器中,`Esc` 不会停止它的轮次,而 `/parent` 等命令仍可运行;`continuable` 子会话则像任何会话一样接受提示词与停止。只要这条链中任一会话正在运行轮次或后台任务,`/new`、`/clear`、`/resume`、`/sessions` 与 `/fork` 都会拒绝(释放会话会结束它的后台任务),否则它们会随所离开的会话释放每一个视图;退出会释放每一个视图并保存根会话。
58
58
 
@@ -240,10 +240,10 @@ follow-ups 面板持有键盘时:
240
240
  | `codeHighlight` | `true` | 以语法高亮绘制回复中的围栏代码、`read` 与 diff 工具卡片的文件行,以及 `!` / `!!` 草稿、`$ command` 行与终端工具卡片中的 shell 命令,配色主题由终端背景选定 |
241
241
  | `toastMs` | `2000` | 临时按键提示行以全亮度保持多久后淡出,这同时也是第二次 `Esc` 停止正在进行轮次的窗口 |
242
242
  | `liveRefreshMs` | `1000` | 重绘周期:推进 `turn` 分段与面板中的已用时间,并重新读取已过期的子 agent 列表 |
243
- | `streamFadeSteps` | `24` | 一次淡入或浮出持续多少拍:回复文字淡入,推理与工具卡片浮出,时长为 `streamFadeSteps × streamFadeStepMs` |
243
+ | `streamFadeSteps` | `24` | 一次淡入或浮出持续多少拍:回复文字与工具卡片的列淡入,推理浮出,时长为 `streamFadeSteps × streamFadeStepMs` |
244
244
  | `streamFadeStepMs` | `16` | 一帧的时长:淡入或浮出的一拍、仍在变化时的重绘周期,也是逐帧绘制流式文字的周期;总时长为 `streamFadeSteps × streamFadeStepMs` |
245
245
  | `streamPaceFrames` | `8` | 积压的流式回复文字或工具参数要经过多少帧才全部上屏。思考块结束时,或回复文字或工具调用开始时,仍在队列中的思考立即画出;`0` 与 `reducedMotion` 一样,收到即绘制 |
246
- | `toolRevealFrames` | `6` | 工具卡片出现或其结果落下时,其各行展开所用的帧数,每帧展开隐藏行的一份。展开卡片,以及正在展开的行已位于渲染器可重绘范围之上的卡片,都会一次画出所有行;`0` 与 `reducedMotion` 一样,一次画出所有行 |
246
+ | `toolRevealFrames` | `6` | 工具卡片出现或其结果落下时,一整行宽的内容流出所用的帧数;较短的行按比例更短,因此每张卡片的流出速度(以每秒列数计)都相同。展开卡片,以及正在流出的行已位于渲染器可重绘范围之上的卡片,都会一次画出所有列;`0` 与 `reducedMotion` 一样,整张卡片一次画出,不带动画 |
247
247
  | `spinnerMs` | `100` | 每种工作动画一帧持续的毫秒数——工作旋转指示的符号与扫光、运行中的工具卡片、折叠的子 agent 行与进行中的 todo——它们都在这一周期的同一个时钟上一起步进。每种动画都有八帧,因此一个循环持续 `8 × spinnerMs`;小于 80 的值会被拒绝 |
248
248
  | `reducedMotion` | `false` | 以稳定颜色绘制流式文本、流式推理、工具卡片与应用自身的边框装饰,不做淡入、不做抬亮、没有旋转符号或扫光,也不重复重绘 |
249
249
  | `mouse` | `false` | 让每枚按键徽标都可点击:左键点击其中一枚即按下它的键。鼠标报告会打开;滚轮会打开并滚动全屏阅读器,提示打开时除外,大多数终端在按住 `Shift` 时仍可滚动与选择 |
@@ -304,10 +304,10 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
304
304
  | [`src/alt-screen.ts`](src/alt-screen.ts) | 终端的备用屏幕:接管它、在其上按绝对行址绘制已取出按键标记的各行,以及把对话记录自己的屏幕交还 |
305
305
  | [`src/key-chips.ts`](src/key-chips.ts) | 按键徽标:提示中画成徽标的按键名、每枚徽标按下的字节、可点击徽标携带的零宽标记,以及屏幕为每个被标记按键保留的单元格 |
306
306
  | [`src/pointer.ts`](src/pointer.ts) | `mouse: true` 时的指针输入:打开与关闭终端的鼠标报告、从中读出的点击、为主屏幕上的点击定位的光标查询,以及一次点击按下的键 |
307
- | [`src/fade.ts`](src/fade.ts) | 流式文本淡入与浮出:基于挂钟的尾部追踪器、块时钟与注册表、淡入亮度级别、浮出混合,以及对已渲染行的重新着色 |
308
- | [`src/pace.ts`](src/pace.ts) | 流式节拍器:助手流与对话记录之间的有序队列,每帧释放积压的一份;以及以同样方式展开工具卡片的逐行展开器 |
307
+ | [`src/fade.ts`](src/fade.ts) | 流式文本淡入与浮出:基于挂钟的尾部追踪器、块时钟与注册表、淡入亮度级别、浮出混合、对已渲染行中某一段的淡入,以及对已渲染行的重新着色 |
308
+ | [`src/pace.ts`](src/pace.ts) | 流式节拍器:助手流与对话记录之间的有序队列,每帧释放积压的一份;以及卡片流出器:其前沿按挂钟以恒定速度越过工具卡片的各列 |
309
309
  | [`src/motion.ts`](src/motion.ts) | 边框装饰的动效时钟与其调用点所绘的三级抬亮:落键、小节步进与状态栏走查 |
310
- | [`src/spinner.ts`](src/spinner.ts) | 工作动画:活动行按状态区分的盲文动画、每个工具族用于运行中卡片、子 agent 行与进行中 todo 的花朵、绽放与星形动画、哪个工具画哪一族、每个指示在某一时刻画出的帧、让同一族的指示彼此错开的相位,以及活动标签所带的扫光 |
310
+ | [`src/spinner.ts`](src/spinner.ts) | 工作动画:活动行按状态区分的盲文动画、每个工具族用于运行中卡片、子 agent 行与进行中 todo 的花朵、绽放与星形动画、实时 Thinking 标题的绽放帧、哪个工具画哪一族、每个指示在某一时刻画出的帧、让同一族的指示彼此错开的相位,以及活动标签所带的扫光 |
311
311
  | [`src/prompts.ts`](src/prompts.ts) | 审批、提问、选择器与只读详情提示以及模态队列 |
312
312
  | [`src/toast.ts`](src/toast.ts) | 临时按键提示行:其浮层、其时钟,以及它承载的各条文字 |
313
313
  | [`src/pinned-prompt.ts`](src/pinned-prompt.ts) | 阅读器在轮次面板滚动后固定在顶部的提示行:符号、合并为一行的提示,以及背景带 |
@@ -339,9 +339,9 @@ runner 等待完整应用就绪(`ctx.get('loader')?.await()`),并在核心
339
339
  | [`tests/editor.spec.ts`](tests/editor.spec.ts) | 对照 pi-tui 编辑器行为验证终端光标、`Shift+Left` / `Shift+Right` 词导航,以及 `!` / `!!` 草稿着色 |
340
340
  | [`tests/frame.spec.ts`](tests/frame.spec.ts) | 边框线、徽标、正文行,以及某个宽度容纳得下的按键提示 |
341
341
  | [`tests/motion.spec.ts`](tests/motion.spec.ts) | 动效时钟的各个级别、它对重绘的要求,以及每一级所绘的抬亮 |
342
- | [`tests/spinner.spec.ts`](tests/spinner.spec.ts) | 各组动画(八个单列帧、盲文只用于活动行、每个工具族的八帧互不相同、两族不共用符号、每个族都混合花朵、绽放与星形)、工具族的映射、活动的映射、按挂钟的帧步进、相位错开,以及扫光的扫过、停顿与调色板禁用时的输出 |
343
- | [`tests/pace.spec.ts`](tests/pace.spec.ts) | 节拍器的每帧份额、按字素切分、到达顺序、flush、按通道 flush 与 clear,以及逐行展开器的每帧份额、settle 与 clamp |
344
- | [`tests/stream-pace.spec.ts`](tests/stream-pace.spec.ts) | 按流顺序分批绘制的回复文字与工具参数,思考块结束时画出思考,流结束时与已记录事件前的 flush,reducedMotion,以及在帧节拍上展开的工具卡片 |
342
+ | [`tests/spinner.spec.ts`](tests/spinner.spec.ts) | 各组动画(八个单列帧、盲文只用于活动行、每个工具族的八帧互不相同、两族以及 Thinking 绽放都不共用符号、每个族都混合花朵、绽放与星形)、工具族的映射、活动的映射、按挂钟的帧步进、相位错开,以及扫光的扫过、停顿与调色板禁用时的输出 |
343
+ | [`tests/pace.spec.ts`](tests/pace.spec.ts) | 节拍器的每帧份额、按字素切分、到达顺序、flush、按通道 flush 与 clear,以及卡片流出器的恒定速度、尾迹、settle 与 clamp |
344
+ | [`tests/stream-pace.spec.ts`](tests/stream-pace.spec.ts) | 按流顺序分批绘制的回复文字与工具参数,思考块结束时画出思考,流结束时与已记录事件前的 flush,reducedMotion,以及在帧节拍上以恒定速度流出的工具卡片 |
345
345
  | [`tests/view-banner.spec.ts`](tests/view-banner.spec.ts) | 子 agent 视图行的路径、返回目标、宽度,以及在主会话时不绘制 |
346
346
  | [`tests/toast.spec.ts`](tests/toast.spec.ts) | 临时提示行的方框、其保持、其淡出与其提前结算 |
347
347
  | [`tests/pinned-prompt.spec.ts`](tests/pinned-prompt.spec.ts) | 阅读器固定的提示行:符号、折叠的空白、省略号,以及背景带 |
@@ -2580,6 +2580,32 @@ function recolorLines(lines, age, style, from = 0) {
2580
2580
  const t = age / steps;
2581
2581
  return lines.map((line, index) => index < from || line === "" ? line : floatOutLine(line, t, capability, fg));
2582
2582
  }
2583
+ /**
2584
+ * Draw one slice of a rendered line as it climbs out of the terminal
2585
+ * background, at a single age, for a caller that gives neighbouring slices of
2586
+ * one line different ages. Each run in the slice starts at the ramp's darkest
2587
+ * level and rises to the color the component drew it in, so text in the
2588
+ * default foreground, a dim rule, and a colored title each brighten to their
2589
+ * own settled color. The slice should come from {@link sliceColumns}, which
2590
+ * replays the sequences in force at its first column.
2591
+ * @param slice - the slice's text with its escape sequences.
2592
+ * @param age - elapsed time in units of `stepMs`; `ramp.length` is t = 1.
2593
+ * @param style - the capability and the ramp, darkest level first.
2594
+ * @returns the slice at that mix, closed so the mix does not leak into the text
2595
+ * after it; the slice itself when the style writes no sequence, the slice is
2596
+ * empty, or `age` has reached the ramp length. The two-level mode draws the
2597
+ * youngest ages faint, like {@link fadeSgr}.
2598
+ */
2599
+ function fadeInSlice(slice, age, style) {
2600
+ const { capability } = style;
2601
+ if (capability === "none" || slice === "") return slice;
2602
+ if (capability === "dim") return age < DIM_AGES ? `${DIM}${slice}${RESET_INTENSITY}` : slice;
2603
+ const steps = style.ramp.length;
2604
+ const start = style.ramp[0];
2605
+ const fg = style.ramp[steps - 1];
2606
+ if (start === void 0 || fg === void 0 || age >= steps) return slice;
2607
+ return floatOutLine(slice, age / steps, capability, fg, start);
2608
+ }
2583
2609
  /** Assumed terminal white, used only to lift a settled color that is already brighter than `fg`. */
2584
2610
  const WHITE_RGB = {
2585
2611
  r: CHANNEL_MAX,
@@ -2719,14 +2745,15 @@ function encodeMix(capability, color) {
2719
2745
  return capability === "truecolor" ? truecolorSgr(color) : `${CSI$2}38;5;${String(nearestAnsi256(color))}m`;
2720
2746
  }
2721
2747
  /**
2722
- * Rebuild one card row as a per-run float-out mix.
2748
+ * Rebuild one card row as a per-run mix toward each run's settled color.
2723
2749
  * @param line - the rendered line.
2724
- * @param t - 0 at lift, 1 at settle.
2750
+ * @param t - 0 at the start color, 1 at settle.
2725
2751
  * @param capability - how the mix is encoded.
2726
2752
  * @param fg - the assumed default foreground.
2753
+ * @param from - the color every run starts from; absent starts each run at its lift above its own settled color.
2727
2754
  * @returns the line with each run overlaid, closed by {@link RESET_FOREGROUND}.
2728
2755
  */
2729
- function floatOutLine(line, t, capability, fg) {
2756
+ function floatOutLine(line, t, capability, fg, from) {
2730
2757
  let out = "";
2731
2758
  let last = 0;
2732
2759
  const state = {
@@ -2734,13 +2761,13 @@ function floatOutLine(line, t, capability, fg) {
2734
2761
  dim: false
2735
2762
  };
2736
2763
  for (const match of line.matchAll(SGR_SEQUENCE)) {
2737
- const start = match.index;
2738
- if (start > last) out += paintSegment(line.slice(last, start), state, t, capability, fg);
2764
+ const position = match.index;
2765
+ if (position > last) out += paintSegment(line.slice(last, position), state, t, capability, fg, from);
2739
2766
  applySgr(state, match[0]);
2740
2767
  out += match[0];
2741
- last = start + match[0].length;
2768
+ last = position + match[0].length;
2742
2769
  }
2743
- if (last < line.length) out += paintSegment(line.slice(last), state, t, capability, fg);
2770
+ if (last < line.length) out += paintSegment(line.slice(last), state, t, capability, fg, from);
2744
2771
  return `${out}${RESET_FOREGROUND$1}`;
2745
2772
  }
2746
2773
  /**
@@ -2750,11 +2777,12 @@ function floatOutLine(line, t, capability, fg) {
2750
2777
  * @param t - 0 at lift, 1 at settle.
2751
2778
  * @param capability - how the mix is encoded.
2752
2779
  * @param fg - the assumed default foreground.
2780
+ * @param from - the color the mix starts from; absent starts at the lift above `settled`.
2753
2781
  * @returns the run prefixed by intensity-reset and the mixed color.
2754
2782
  */
2755
- function paintSegment(text, state, t, capability, fg) {
2783
+ function paintSegment(text, state, t, capability, fg, from) {
2756
2784
  const settled = settledRgb(state, fg);
2757
- return `${RESET_INTENSITY}${encodeMix(capability, mixFadeColor(liftColor(settled, fg), settled, t))}${text}`;
2785
+ return `${RESET_INTENSITY}${encodeMix(capability, mixFadeColor(from ?? liftColor(settled, fg), settled, t))}${text}`;
2758
2786
  }
2759
2787
  /**
2760
2788
  * The float-out sequence one reasoning span draws under, toward dimmed `fg`.
@@ -4157,6 +4185,10 @@ var AssistantBlock = class {
4157
4185
  /** Width of the last render that drew a text tail; absent before the first one. */
4158
4186
  fadeWidth;
4159
4187
  reasoningFade;
4188
+ /** The live Thinking header's bloom; absent draws the settled glyph. */
4189
+ reasoningSpinner;
4190
+ /** Whether the message is still streaming, which the header spinner requires; commit settles it. */
4191
+ streaming = false;
4160
4192
  /** Width of the last render that drew a reasoning tail; absent before the first one. */
4161
4193
  reasoningFadeWidth;
4162
4194
  /** First line of this block either tail may still recolor. */
@@ -4231,6 +4263,21 @@ var AssistantBlock = class {
4231
4263
  this.reasoningFade = fade;
4232
4264
  }
4233
4265
  /**
4266
+ * Animate the live Thinking header on the application's spinner clock.
4267
+ * @param frame - the current bloom glyph, or undefined to settle the header;
4268
+ * a settled message or a header above the repaint window keeps the static glyph.
4269
+ */
4270
+ setReasoningSpinner(frame) {
4271
+ this.reasoningSpinner = this.streaming && this.repaintFloor <= 1 ? frame : void 0;
4272
+ }
4273
+ /**
4274
+ * Whether the live Thinking header still spins in the repaint window.
4275
+ * @returns true while the message streams with an attached spinner.
4276
+ */
4277
+ spinning() {
4278
+ return this.reasoningSpinner !== void 0 && this.streaming;
4279
+ }
4280
+ /**
4234
4281
  * Hand the rows the renderer can no longer repaint back to the colors this
4235
4282
  * block drew them in, so a tail that is still moving never rewrites them.
4236
4283
  * @param floor - this block's own first repaintable line; the application
@@ -4241,7 +4288,9 @@ var AssistantBlock = class {
4241
4288
  setRepaintFloor(floor) {
4242
4289
  if (floor <= this.repaintFloor) return false;
4243
4290
  this.repaintFloor = floor;
4244
- return this.fade !== void 0 && fadingInSpans(this.fade).length > 0 || this.reasoningFade !== void 0 && floatingOutSpans(this.reasoningFade).length > 0;
4291
+ const spinning = this.spinning() && floor > 1;
4292
+ if (spinning) this.reasoningSpinner = void 0;
4293
+ return spinning || this.fade !== void 0 && fadingInSpans(this.fade).length > 0 || this.reasoningFade !== void 0 && floatingOutSpans(this.reasoningFade).length > 0;
4245
4294
  }
4246
4295
  /**
4247
4296
  * Append streamed visible text.
@@ -4249,6 +4298,7 @@ var AssistantBlock = class {
4249
4298
  */
4250
4299
  appendText(delta) {
4251
4300
  this.text += delta;
4301
+ this.streaming = true;
4252
4302
  this.revision += 1;
4253
4303
  }
4254
4304
  /**
@@ -4257,6 +4307,7 @@ var AssistantBlock = class {
4257
4307
  */
4258
4308
  appendReasoning(delta) {
4259
4309
  this.reasoning += delta;
4310
+ this.streaming = true;
4260
4311
  this.revision += 1;
4261
4312
  this.reasoningText.setText(this.theme.palette.dim(this.theme.palette.italic(this.reasoning.trimEnd())));
4262
4313
  }
@@ -4270,9 +4321,11 @@ var AssistantBlock = class {
4270
4321
  this.text = text;
4271
4322
  this.reasoning = reasoning;
4272
4323
  this.interrupted = interrupted;
4324
+ this.streaming = false;
4273
4325
  this.revision += 1;
4274
4326
  this.fade = void 0;
4275
4327
  this.reasoningFade = void 0;
4328
+ this.reasoningSpinner = void 0;
4276
4329
  this.prefixCache = void 0;
4277
4330
  this.appliedPrefix = void 0;
4278
4331
  this.appliedTail = void 0;
@@ -4290,7 +4343,7 @@ var AssistantBlock = class {
4290
4343
  }
4291
4344
  render(width) {
4292
4345
  const { marked, content: inner } = focusFrame(width, this.highlight);
4293
- const { lines, reasoning, reply } = this.fade !== void 0 || this.reasoningFade !== void 0 ? this.compose(inner) : this.drawn.get(`${String(width)}:${String(marked)}:${String(this.revision)}`, () => this.compose(inner));
4346
+ const { lines, reasoning, reply } = this.fade !== void 0 || this.reasoningFade !== void 0 || this.spinning() ? this.compose(inner) : this.drawn.get(`${String(width)}:${String(marked)}:${String(this.revision)}`, () => this.compose(inner));
4294
4347
  if (this.highlight === void 0) return lines;
4295
4348
  const section = this.parts()[this.highlight]?.kind === "reasoning" ? reasoning : reply;
4296
4349
  return withGutter(this.theme.palette, lines, (index) => index >= section.from && index < section.to, this.highlightLevel);
@@ -4314,7 +4367,8 @@ var AssistantBlock = class {
4314
4367
  if (this.reasoning.trim() !== "") {
4315
4368
  const palette = this.theme.palette;
4316
4369
  reasoning.from = lines.length;
4317
- lines.push(truncateToWidth(`${palette.heading(REASONING_GLYPH)} ${palette.dim(REASONING_TITLE)}`, inner, "…"));
4370
+ const glyph = this.reasoningSpinner?.() ?? REASONING_GLYPH;
4371
+ lines.push(truncateToWidth(`${palette.heading(glyph)} ${palette.dim(REASONING_TITLE)}`, inner, "…"));
4318
4372
  const width = Math.max(1, inner - 2);
4319
4373
  lines.push(...this.renderReasoning(width, lines.length).map((line) => `${REASONING_INDENT}${line}`));
4320
4374
  reasoning.to = lines.length;
@@ -4420,14 +4474,20 @@ var AssistantBlock = class {
4420
4474
  * A tool call card: the status-coloured {@link TOOL_GLYPH}, the bold tool
4421
4475
  * name, the headline in the link colour, then a foldable body.
4422
4476
  *
4423
- * The card arrives in two pieces, and each floats out on its own: the header
4424
- * and the call rows when the model starts the call (a stream delta, or the
4425
- * logged `tool/call`), the result rows when the tool answers. While it runs
4426
- * the body carries {@link TOOL_RUNNING_ROW} in place of a result, and a card
4427
- * given a spinner ({@link ToolBlock.setSpinner}) cycles its glyph until the
4428
- * result lands or its header leaves the renderer's repaint window, then draws
4429
- * the static glyph. A card rebuilt from history carries neither fade nor
4430
- * spinner.
4477
+ * The card arrives in two pieces: the header and the call rows when the model
4478
+ * starts the call (a stream delta, or the logged `tool/call`), the result rows
4479
+ * when the tool answers. While it runs the body carries
4480
+ * {@link TOOL_RUNNING_ROW} in place of a result, and a card given a spinner
4481
+ * ({@link ToolBlock.setSpinner}) cycles its glyph until the result lands or
4482
+ * its header leaves the renderer's repaint window, then draws the static
4483
+ * glyph.
4484
+ *
4485
+ * A card given a {@link CardFlow} ({@link ToolBlock.setFlow}) flows out: the
4486
+ * flow's front decides how many columns of its rows are drawn, row after row,
4487
+ * and the columns drawn lately brighten from the terminal background toward
4488
+ * their settled colors by their own age. The flow is advanced from the application's
4489
+ * frame tick and never by a call or result, which only change what the card
4490
+ * holds. A card rebuilt from history carries neither flow nor spinner.
4431
4491
  */
4432
4492
  var ToolBlock = class {
4433
4493
  theme;
@@ -4444,8 +4504,6 @@ var ToolBlock = class {
4444
4504
  /** The facts a folded subagent card draws as one row; absent for every other tool. */
4445
4505
  subagent;
4446
4506
  expanded = false;
4447
- fade;
4448
- resultFade;
4449
4507
  /** The glyph a running card draws right now; absent draws {@link TOOL_GLYPH}. */
4450
4508
  spinner;
4451
4509
  /** First line of this card either fade may still recolor. */
@@ -4460,11 +4518,17 @@ var ToolBlock = class {
4460
4518
  revision = 0;
4461
4519
  /** The sections last read, and the revision they were built at. */
4462
4520
  sections;
4463
- /** How many of the card's rows are drawn while it unrolls; absent draws every row. */
4464
- reveal;
4465
- /** The card's full row count, the leading blank line excluded, at its last render. */
4466
- rows = 0;
4467
- /** Whether {@link rows} was measured after the last call, result, or fold change. */
4521
+ /** How many columns of the card's rows are drawn while it flows out; absent draws every column. */
4522
+ flow;
4523
+ /** The drawing settings the flow's trail is colored with; absent flows without color. */
4524
+ flowStyle;
4525
+ /** The card's visible columns over all rows, the leading blank line excluded, at its last render. */
4526
+ columns = 0;
4527
+ /** Lines the last render drew, the leading blank line included. */
4528
+ drawnLines = 0;
4529
+ /** The width the last render was given, which the flow measures its pace against. */
4530
+ flowWidth = 1;
4531
+ /** Whether {@link columns} was measured after the last call, result, or fold change. */
4468
4532
  measured = false;
4469
4533
  toolName;
4470
4534
  call;
@@ -4545,20 +4609,6 @@ var ToolBlock = class {
4545
4609
  this.measured = false;
4546
4610
  }
4547
4611
  /**
4548
- * Draw the header and the call rows through `fade` until it settles.
4549
- * @param fade - the level and drawing settings of this card's own fade.
4550
- */
4551
- setFade(fade) {
4552
- this.fade = fade;
4553
- }
4554
- /**
4555
- * Draw the result rows through `fade` until it settles.
4556
- * @param fade - the level and drawing settings of the result's own fade.
4557
- */
4558
- setResultFade(fade) {
4559
- this.resultFade = fade;
4560
- }
4561
- /**
4562
4612
  * Cycle the header glyph while the card runs.
4563
4613
  * @param frame - the glyph to draw at the moment of a render.
4564
4614
  */
@@ -4587,15 +4637,15 @@ var ToolBlock = class {
4587
4637
  this.repaintFloor = Math.max(this.repaintFloor, floor);
4588
4638
  return true;
4589
4639
  }
4590
- const reveal = this.reveal;
4591
- if (reveal !== void 0 && reveal.shown() < this.rows && floor > 1 + reveal.shown()) {
4592
- reveal.settle();
4640
+ const flow = this.flow;
4641
+ if (flow !== void 0 && flow.shown() < this.columns && floor >= this.drawnLines) {
4642
+ flow.settle();
4593
4643
  this.repaintFloor = Math.max(this.repaintFloor, floor);
4594
4644
  return true;
4595
4645
  }
4596
4646
  if (floor <= this.repaintFloor) return false;
4597
4647
  this.repaintFloor = floor;
4598
- return this.fade?.age() !== void 0 || this.resultFade?.age() !== void 0;
4648
+ return flow !== void 0 && this.flowColors() !== void 0 && flow.receding();
4599
4649
  }
4600
4650
  /**
4601
4651
  * Attach the result rows and settle the status. A diff result replaces the
@@ -4631,32 +4681,55 @@ var ToolBlock = class {
4631
4681
  this.measured = false;
4632
4682
  }
4633
4683
  /**
4634
- * Unroll the card's rows on the application's frame tick instead of drawing
4635
- * them all in one frame: now, and again whenever a call or a result makes
4636
- * the card grow.
4637
- * @param reveal - how many rows are drawn; the card draws that many of its
4638
- * rows after the leading blank line.
4684
+ * Flow the card's rows out on the application's frame tick instead of
4685
+ * drawing them all in one frame: now, and again whenever a call or a result
4686
+ * makes the card grow.
4687
+ * @param flow - the front that decides how many columns are drawn; the card
4688
+ * draws that many columns of its rows after the leading blank line.
4689
+ * @param style - the settings the freshly drawn columns are colored with,
4690
+ * read per render because the terminal background query settles after the
4691
+ * card is mounted; absent draws the flow without color.
4639
4692
  */
4640
- setReveal(reveal) {
4641
- this.reveal = reveal;
4693
+ setFlow(flow, style) {
4694
+ this.flow = flow;
4695
+ this.flowStyle = style;
4642
4696
  this.measured = false;
4643
4697
  }
4644
4698
  /**
4645
- * Whether rows of this card are still hidden, or the card changed since its
4646
- * last render and may have gained rows.
4647
- * @returns true while the reveal still has a frame to draw.
4699
+ * Whether columns of this card are still hidden or still brightening, or
4700
+ * the card changed since its last render and may have gained columns.
4701
+ * @returns true while the flow still has a frame to draw.
4648
4702
  */
4649
4703
  revealing() {
4650
- return this.reveal !== void 0 && (!this.measured || this.reveal.shown() < this.rows);
4704
+ return this.flow !== void 0 && (!this.measured || this.flowDrawing(this.flow));
4651
4705
  }
4652
4706
  /**
4653
- * Draw one frame's share of the rows still hidden.
4654
- * @returns whether the reveal still has a frame to draw after this one.
4707
+ * Move the flow's front by the time elapsed since the previous frame.
4708
+ * @returns whether the flow still has a frame to draw after this one.
4655
4709
  */
4656
4710
  revealFrame() {
4657
- if (this.reveal === void 0) return false;
4711
+ const flow = this.flow;
4712
+ if (flow === void 0) return false;
4658
4713
  if (!this.measured) return true;
4659
- return this.reveal.frame(this.rows);
4714
+ flow.frame(this.columns, this.flowWidth);
4715
+ return this.flowDrawing(flow);
4716
+ }
4717
+ /**
4718
+ * Whether another frame of `flow` changes what the card draws: columns are
4719
+ * hidden, or drawn ones are brightening in a terminal that draws the color.
4720
+ * @param flow - the card's flow.
4721
+ * @returns true while a frame is still owed.
4722
+ */
4723
+ flowDrawing(flow) {
4724
+ return flow.shown() < this.columns || this.flowColors() !== void 0 && flow.receding();
4725
+ }
4726
+ /**
4727
+ * The colors the flow's trail is drawn with right now.
4728
+ * @returns the style, or undefined when the card has none or the terminal draws no color.
4729
+ */
4730
+ flowColors() {
4731
+ const style = this.flowStyle?.();
4732
+ return style?.capability === "none" ? void 0 : style;
4660
4733
  }
4661
4734
  /**
4662
4735
  * Whether the whole body is drawn right now.
@@ -4670,7 +4743,7 @@ var ToolBlock = class {
4670
4743
  * @param expanded - whether the full body is shown.
4671
4744
  */
4672
4745
  setExpanded(expanded) {
4673
- if (expanded !== this.expanded) this.reveal?.settle();
4746
+ if (expanded !== this.expanded) this.flow?.settle();
4674
4747
  this.expanded = expanded;
4675
4748
  }
4676
4749
  invalidate() {
@@ -4680,19 +4753,20 @@ var ToolBlock = class {
4680
4753
  const palette = this.theme.palette;
4681
4754
  const { marked, content: outer } = focusFrame(width, this.highlight);
4682
4755
  const layout = this.drawn.get(`${String(width)}:${String(marked)}:${String(this.expanded)}:${this.status}:${String(this.revision)}`, () => this.layout(outer, marked));
4683
- const call = faded(this.spun(layout.call), this.fade, this.repaintFloor - 1);
4684
- const result = faded(layout.result, this.resultFade, this.repaintFloor - 1 - layout.call.length);
4685
- const full = call === layout.call && result === layout.result ? layout.lines : [
4756
+ const call = this.spun(layout.call);
4757
+ const full = call === layout.call ? layout.lines : [
4686
4758
  "",
4687
4759
  ...call,
4688
- ...result
4760
+ ...layout.result
4689
4761
  ];
4690
- this.rows = full.length - 1;
4762
+ const widths = layout.widths ??= layout.lines.slice(1).map((line) => visibleWidth(line));
4763
+ this.columns = widths.reduce((sum, columns) => sum + columns, 0);
4764
+ this.flowWidth = width;
4691
4765
  this.measured = true;
4692
- this.reveal?.clamp(this.rows);
4693
- const shown = this.reveal === void 0 ? this.rows : this.reveal.shown();
4694
- const visible = (lines) => shown < this.rows ? lines.slice(0, 1 + shown) : lines;
4695
- if (this.highlight === void 0) return visible(full);
4766
+ this.flow?.clamp(this.columns);
4767
+ const visible = this.flow === void 0 ? full : this.flowed(full, widths);
4768
+ this.drawnLines = visible.length;
4769
+ if (this.highlight === void 0) return visible;
4696
4770
  const sections = full.length - layout.marker;
4697
4771
  const section = this.parts()[this.highlight]?.kind === "result" ? {
4698
4772
  from: 1 + layout.call.length,
@@ -4708,7 +4782,34 @@ var ToolBlock = class {
4708
4782
  from: sections,
4709
4783
  to: full.length
4710
4784
  });
4711
- return visible(withGutter(palette, full, (index) => index >= held.from && index < held.to, this.highlightLevel));
4785
+ return withGutter(palette, visible, (index) => index >= held.from && index < held.to, this.highlightLevel);
4786
+ }
4787
+ /**
4788
+ * The card with only the columns the flow has reached, the last row cut
4789
+ * where the front stands, and the columns drawn lately colored by age.
4790
+ * @param full - the card's lines, the leading blank line first.
4791
+ * @param widths - the visible columns of each line after the blank one.
4792
+ * @returns the lines to draw, which are `full` itself once the flow has drawn
4793
+ * every column and its trail has receded.
4794
+ */
4795
+ flowed(full, widths) {
4796
+ const flow = this.flow;
4797
+ const shown = flow.shown();
4798
+ const style = this.flowColors();
4799
+ const trail = style === void 0 ? [] : flow.trail();
4800
+ if (shown >= this.columns && trail.length === 0) return full;
4801
+ const lines = [""];
4802
+ let start = 0;
4803
+ for (const [index, columns] of widths.entries()) {
4804
+ if (start >= shown) break;
4805
+ const line = full[1 + index];
4806
+ const drawn = Math.min(columns, shown - start);
4807
+ const cut = drawn >= columns ? line : sliceColumns(line, [drawn])[0];
4808
+ const settled = style === void 0 || trail.length === 0 || 1 + index < this.repaintFloor;
4809
+ lines.push(settled ? cut : floatedRow(cut, start, drawn, trail, style));
4810
+ start += columns;
4811
+ }
4812
+ return lines;
4712
4813
  }
4713
4814
  /**
4714
4815
  * Colour, fold, and wrap the card body.
@@ -4822,17 +4923,32 @@ var ToolBlock = class {
4822
4923
  }
4823
4924
  };
4824
4925
  /**
4825
- * Draw one group of a card's rows at the mix its fade reports.
4826
- * @param lines - the group's final rendered lines.
4827
- * @param fade - the group's fade; absent for a card that never faded.
4828
- * @param from - first line of the group the fade may recolor.
4829
- * @returns the lines at that mix, or the lines themselves once the fade
4830
- * settled or was never attached.
4926
+ * Float out the freshly drawn columns of one row, each run at its own age.
4927
+ * @param row - the row as drawn, already cut at the front.
4928
+ * @param start - the first column of this row over the card's rows.
4929
+ * @param drawn - the columns of this row that are drawn.
4930
+ * @param trail - the runs drawn lately, oldest first, in columns over the card's rows.
4931
+ * @param style - the capability and the ramp.
4932
+ * @returns the row with each run it holds recolored, or `row` when none reaches it.
4831
4933
  */
4832
- function faded(lines, fade, from) {
4833
- if (fade === void 0) return lines;
4834
- const age = fade.age();
4835
- return age === void 0 ? lines : recolorLines(lines, age, fade.style(), from);
4934
+ function floatedRow(row, start, drawn, trail, style) {
4935
+ const runs = [];
4936
+ for (const band of trail) {
4937
+ const from = Math.max(band.start - start, 0);
4938
+ const to = Math.min(band.end - start, drawn);
4939
+ if (to > from) runs.push({
4940
+ from,
4941
+ to,
4942
+ age: band.age
4943
+ });
4944
+ }
4945
+ if (runs.length === 0) return row;
4946
+ const pieces = sliceColumns(row, runs.flatMap((run) => [run.from, run.to]));
4947
+ let out = pieces[0];
4948
+ runs.forEach((run, index) => {
4949
+ out += `${fadeInSlice(pieces[2 * index + 1], run.age, style)}${pieces[2 * index + 2]}`;
4950
+ });
4951
+ return out;
4836
4952
  }
4837
4953
  /**
4838
4954
  * The tail chunks one streaming reply still draws below the terminal's own
@@ -5016,6 +5132,20 @@ const WORKFLOW_SPINNER = [
5016
5132
  "◇",
5017
5133
  "◊"
5018
5134
  ];
5135
+ /**
5136
+ * Bloom frames for the live Thinking header, disjoint from every tool
5137
+ * family; completed reasoning keeps its static `✻`.
5138
+ */
5139
+ const THINKING_SPINNER = [
5140
+ "☙",
5141
+ "✴",
5142
+ "❇",
5143
+ "✳",
5144
+ "※",
5145
+ "⚜",
5146
+ "⁂",
5147
+ "❄"
5148
+ ];
5019
5149
  /** Blank steps between two shimmer passes, so the sweep pauses past the word's end. */
5020
5150
  const SHIMMER_GAP = 6;
5021
5151
  /** Tool names that execute commands. */
@@ -8296,61 +8426,129 @@ var StreamPacer = class {
8296
8426
  }
8297
8427
  };
8298
8428
  /**
8299
- * How many rows of a growing block are drawn, advanced on the application's
8300
- * frame tick the same way {@link StreamPacer} releases text: each frame draws
8301
- * `hidden / drainFrames` more rows, at least one, with the fractional part
8302
- * carried to the next frame. The
8303
- * block reports its full row count after every render and draws only the
8304
- * first {@link RowReveal.shown} rows until the reveal catches up.
8429
+ * Longest stretch of wall-clock time one {@link CardFlow.frame} advances the
8430
+ * front by, in frames. A frame that ran late draws a few columns more, and a
8431
+ * stalled event loop does not make the card jump to its end.
8305
8432
  */
8306
- var RowReveal = class {
8307
- drainFrames;
8308
- count;
8309
- /** Rows the next frame may draw beyond its own share. */
8310
- credit = 0;
8433
+ const MAX_ADVANCE_FRAMES = 4;
8434
+ /**
8435
+ * The front of a tool card that flows out: how many columns of its rows are
8436
+ * drawn, counted row after row from the first, and the columns drawn lately,
8437
+ * which the card brightens from the terminal background by age. The front moves a fixed number of columns per
8438
+ * unit of wall-clock time, so rows and the words in them come out at one pace
8439
+ * however much the card holds and however late a frame runs.
8440
+ *
8441
+ * The pace is `width / (rowFrames * stepMs)` columns per millisecond, so a
8442
+ * full-width row takes `rowFrames` frames. The front reads only the clock and
8443
+ * the card's current column count; the call or result that grew the card never
8444
+ * waits for it, and a card that grows while it flows is caught up with at the
8445
+ * same pace.
8446
+ */
8447
+ var CardFlow = class {
8448
+ options;
8449
+ front;
8450
+ /** When the front last advanced; absent while it has nothing to draw. */
8451
+ last;
8452
+ bands = [];
8453
+ /**
8454
+ * @param options - the pace, the trail length, and the clock.
8455
+ * @param shown - columns drawn before the first frame.
8456
+ */
8457
+ constructor(options, shown) {
8458
+ this.options = {
8459
+ ...options,
8460
+ rowFrames: Math.max(1, options.rowFrames)
8461
+ };
8462
+ this.front = shown;
8463
+ this.last = options.now();
8464
+ }
8311
8465
  /**
8312
- * @param drainFrames - frames a hidden run takes to unroll; at least 1.
8313
- * @param shown - rows drawn before the first frame.
8466
+ * Columns drawn right now.
8467
+ * @returns the whole columns, which may exceed the card's columns after {@link CardFlow.settle}.
8314
8468
  */
8315
- constructor(drainFrames, shown) {
8316
- this.drainFrames = Math.max(1, drainFrames);
8317
- this.count = shown;
8469
+ shown() {
8470
+ return Math.floor(this.front);
8318
8471
  }
8319
8472
  /**
8320
- * Rows drawn right now.
8321
- * @returns the count, which may exceed the block's rows after {@link RowReveal.settle}.
8473
+ * The drawn columns still colored toward their settled colors.
8474
+ * @returns one run per frame that drew columns lately, oldest first.
8322
8475
  */
8323
- shown() {
8324
- return this.count;
8476
+ trail() {
8477
+ const at = this.options.now();
8478
+ const live = [];
8479
+ for (const band of this.bands) {
8480
+ const age = this.ageOf(band, at);
8481
+ if (age < this.options.steps) live.push({
8482
+ start: Math.floor(band.start),
8483
+ end: Math.floor(band.end),
8484
+ age
8485
+ });
8486
+ }
8487
+ return live;
8325
8488
  }
8326
8489
  /**
8327
- * Draw one frame's share of the rows still hidden.
8328
- * @param total - the block's full row count at its last render.
8329
- * @returns whether rows are still hidden after this frame.
8490
+ * Whether a drawn run is still climbing toward its settled color.
8491
+ * @returns true while the trail holds a run.
8330
8492
  */
8331
- frame(total) {
8332
- if (this.count >= total) {
8333
- this.credit = 0;
8493
+ receding() {
8494
+ return this.trail().length > 0;
8495
+ }
8496
+ /**
8497
+ * Move the front by the time elapsed since the previous frame, and drop the
8498
+ * runs that reached their settled color. The first frame after the card
8499
+ * grew again starts the clock without moving the front.
8500
+ * @param total - the card's column count at its last render.
8501
+ * @param width - the terminal width the pace is measured against.
8502
+ * @returns whether columns are still hidden after this frame.
8503
+ */
8504
+ frame(total, width) {
8505
+ const at = this.options.now();
8506
+ this.bands = this.bands.filter((band) => this.ageOf(band, at) < this.options.steps);
8507
+ if (this.front >= total) {
8508
+ this.last = void 0;
8334
8509
  return false;
8335
8510
  }
8336
- this.credit += (total - this.count) / this.drainFrames;
8337
- const rows = Math.max(1, Math.floor(this.credit));
8338
- this.credit = Math.max(0, this.credit - rows);
8339
- this.count = Math.min(total, this.count + rows);
8340
- return this.count < total;
8511
+ const previous = this.last;
8512
+ if (previous === void 0) {
8513
+ this.last = at;
8514
+ return true;
8515
+ }
8516
+ const { rowFrames, stepMs } = this.options;
8517
+ const span = Math.min(Math.max(0, at - previous), MAX_ADVANCE_FRAMES * stepMs);
8518
+ const next = Math.min(total, this.front + span * Math.max(1, width) / (rowFrames * stepMs));
8519
+ if (next > this.front) this.bands.push({
8520
+ start: this.front,
8521
+ end: next,
8522
+ bornAt: at,
8523
+ span
8524
+ });
8525
+ this.front = next;
8526
+ this.last = next < total ? at : void 0;
8527
+ return next < total;
8341
8528
  }
8342
8529
  /**
8343
- * Hold the count at the block's full row count, so rows the block loses
8344
- * later are not owed again when it grows back.
8345
- * @param total - the block's full row count at this render.
8530
+ * Hold the front at the card's column count, so columns the card loses later
8531
+ * are not owed again when it grows back.
8532
+ * @param total - the card's column count at this render.
8346
8533
  */
8347
8534
  clamp(total) {
8348
- if (this.count > total) this.count = total;
8535
+ if (this.front > total) this.front = total;
8349
8536
  }
8350
- /** Draw every row the block has at its next render. */
8537
+ /** Draw every column the card has at its next render, with no trail. */
8351
8538
  settle() {
8352
- this.count = Number.POSITIVE_INFINITY;
8353
- this.credit = 0;
8539
+ this.front = Number.POSITIVE_INFINITY;
8540
+ this.bands = [];
8541
+ this.last = void 0;
8542
+ }
8543
+ /**
8544
+ * The age a run draws at: its midpoint, which the frame drew over the
8545
+ * `span` before `bornAt`.
8546
+ * @param band - the run.
8547
+ * @param at - the current time in milliseconds.
8548
+ * @returns elapsed time in units of `stepMs`.
8549
+ */
8550
+ ageOf(band, at) {
8551
+ return (at - band.bornAt + band.span / 2) / this.options.stepMs;
8354
8552
  }
8355
8553
  };
8356
8554
  /**
@@ -17219,7 +17417,11 @@ var TuiApp = class {
17219
17417
  * releasing it after the model has moved on to reply text or a tool call.
17220
17418
  */
17221
17419
  finishReasoningPace() {
17222
- if (this.pacer?.flushChannel("reasoning") === true) this.tui.requestRender();
17420
+ const released = this.pacer?.flushChannel("reasoning") === true;
17421
+ const spinning = this.streaming?.spinning() === true;
17422
+ this.streaming?.setReasoningSpinner(void 0);
17423
+ this.updateSpinTicker();
17424
+ if (released || spinning) this.tui.requestRender();
17223
17425
  }
17224
17426
  /**
17225
17427
  * Take one visible text delta: the block draws it and the tail of that same
@@ -17247,6 +17449,10 @@ var TuiApp = class {
17247
17449
  appendStreamedReasoning(delta) {
17248
17450
  const block = this.streamingBlock();
17249
17451
  block.appendReasoning(delta);
17452
+ if (!this.deps.reducedMotion && !block.spinning()) {
17453
+ block.setReasoningSpinner(() => spinnerFrame(THINKING_SPINNER, this.deps.now(), this.deps.spinnerMs));
17454
+ this.updateSpinTicker();
17455
+ }
17250
17456
  if (!this.fading) return;
17251
17457
  if (this.reasoningTail === void 0) {
17252
17458
  this.reasoningTail = this.createTail();
@@ -17283,10 +17489,10 @@ var TuiApp = class {
17283
17489
  };
17284
17490
  }
17285
17491
  /**
17286
- * Fade one group of a card's rows in from the terminal background, from the
17287
- * instant the log carried them. A terminal that draws no ramp and a session
17288
- * being replayed fade nothing.
17289
- * @param attach - hands the fade to the block that draws those rows.
17492
+ * Fade one activity-board row in from the terminal background, from the
17493
+ * instant it appeared. A terminal that draws no ramp and a session being
17494
+ * replayed fade nothing.
17495
+ * @param attach - hands the fade to the board that draws that row.
17290
17496
  */
17291
17497
  fadeBlock(attach) {
17292
17498
  if (!this.fading || this.replaying) return;
@@ -17304,14 +17510,21 @@ var TuiApp = class {
17304
17510
  this.updateFadeTicker();
17305
17511
  }
17306
17512
  /**
17307
- * Unroll a new card's rows on the frame tick from its header down. A card
17308
- * drawn from a replayed log, and every card on a terminal that paces
17513
+ * Flow a new card out on the frame tick, row after row from its header
17514
+ * down, at a pace that depends on neither the card nor the call it shows.
17515
+ * A card drawn from a replayed log, and every card on a terminal that paces
17309
17516
  * nothing, draws whole.
17310
17517
  * @param block - the card that was just mounted.
17311
17518
  */
17312
17519
  revealBlock(block) {
17313
17520
  if (this.replaying || this.deps.reducedMotion || this.deps.toolRevealFrames === 0) return;
17314
- block.setReveal(new RowReveal(this.deps.toolRevealFrames, 1));
17521
+ const flow = new CardFlow({
17522
+ rowFrames: this.deps.toolRevealFrames,
17523
+ stepMs: this.deps.fadeStepMs,
17524
+ steps: this.deps.fadeSteps,
17525
+ now: () => this.deps.now()
17526
+ }, 1);
17527
+ block.setFlow(flow, () => this.fadeStyle);
17315
17528
  this.trackReveal(block);
17316
17529
  }
17317
17530
  /**
@@ -17356,7 +17569,7 @@ var TuiApp = class {
17356
17569
  * stopped app runs none.
17357
17570
  */
17358
17571
  updateSpinTicker() {
17359
- const spinning = this.spinners.size > 0 || this.boardSpinners.size > 0 || this.workflowSpinners.size > 0;
17572
+ const spinning = this.streaming?.spinning() === true || this.spinners.size > 0 || this.boardSpinners.size > 0 || this.workflowSpinners.size > 0;
17360
17573
  if (!this.stopped && (this.loaderAnimates() || spinning)) {
17361
17574
  this.spinTicker ??= this.deps.tick(() => {
17362
17575
  this.onSpinTick();
@@ -17379,7 +17592,7 @@ var TuiApp = class {
17379
17592
  for (const block of this.workflowSpinners) if (!block.spinning()) this.workflowSpinners.delete(block);
17380
17593
  if (this.loaderAnimates()) this.refreshLoader();
17381
17594
  if (this.boardSpinners.size > 0) this.refreshActivityBoard();
17382
- else if (this.spinners.size > 0 || this.workflowSpinners.size > 0) this.tui.requestRender();
17595
+ else if (this.streaming?.spinning() === true || this.spinners.size > 0 || this.workflowSpinners.size > 0) this.tui.requestRender();
17383
17596
  this.updateSpinTicker();
17384
17597
  }
17385
17598
  /**
@@ -17531,7 +17744,7 @@ var TuiApp = class {
17531
17744
  part: section.cursor.part,
17532
17745
  level: this.markLift()
17533
17746
  } : void 0;
17534
- const fades = this.fadesMoving() || this.spinners.size > 0;
17747
+ const fades = this.fadesMoving() || this.streaming?.spinning() === true || this.spinners.size > 0;
17535
17748
  let start = this.header.render(width).length;
17536
17749
  let wantedStart;
17537
17750
  let changed = false;
@@ -17576,6 +17789,8 @@ var TuiApp = class {
17576
17789
  switch (frame.type) {
17577
17790
  case "start":
17578
17791
  this.pacer?.flush();
17792
+ this.streaming?.setReasoningSpinner(void 0);
17793
+ this.updateSpinTicker();
17579
17794
  this.streaming = void 0;
17580
17795
  this.endFade();
17581
17796
  this.beginLiveUsage();
@@ -17638,6 +17853,8 @@ var TuiApp = class {
17638
17853
  }
17639
17854
  case "end":
17640
17855
  this.pacer?.flush();
17856
+ this.streaming?.setReasoningSpinner(void 0);
17857
+ this.updateSpinTicker();
17641
17858
  this.streaming = void 0;
17642
17859
  this.endFade();
17643
17860
  if (frame.outcome.kind === "abandoned" || frame.outcome.eventType === "assistant/attempt") this.dropUnconfirmedTools();
@@ -17710,9 +17927,6 @@ var TuiApp = class {
17710
17927
  } else block.setBackground([`◇ moved to the background as ${moved} · /jobs lists it`]);
17711
17928
  this.spinners.delete(block);
17712
17929
  this.updateSpinTicker();
17713
- this.fadeBlock((fade) => {
17714
- block.setResultFade(fade);
17715
- });
17716
17930
  this.trackReveal(block);
17717
17931
  this.pendingToolNames.delete(result.toolCallId);
17718
17932
  this.syncLoaderFromPendingTools();
@@ -18220,9 +18434,6 @@ var TuiApp = class {
18220
18434
  block.setExpanded(this.toolsExpanded);
18221
18435
  this.toolBlocks.set(callId, block);
18222
18436
  this.chat.addChild(block);
18223
- this.fadeBlock((fade) => {
18224
- block.setFade(fade);
18225
- });
18226
18437
  this.revealBlock(block);
18227
18438
  this.spinBlock(block);
18228
18439
  if (source === "stream") this.unconfirmedTools.set(callId, block);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@songtonyli/dsh-cli",
3
- "version": "0.1.75",
3
+ "version": "0.1.76",
4
4
  "description": "The dsh terminal agent: an interactive TUI over the DeepSeek Harness, with its whole Node runtime bundled in one install.",
5
5
  "license": "MIT",
6
6
  "type": "module",