@sagmans/dsh-tui 0.3.0 → 0.5.0

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 (253) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +407 -53
  3. package/cordis.patch.yml +14 -0
  4. package/lib/agent/present.js +1 -1
  5. package/lib/agent/present.js.map +1 -1
  6. package/lib/agent/projections.d.ts +22 -6
  7. package/lib/agent/projections.d.ts.map +1 -1
  8. package/lib/agent/projections.js +21 -10
  9. package/lib/agent/projections.js.map +1 -1
  10. package/lib/agent/prompt-history.d.ts +89 -0
  11. package/lib/agent/prompt-history.d.ts.map +1 -0
  12. package/lib/agent/prompt-history.js +382 -0
  13. package/lib/agent/prompt-history.js.map +1 -0
  14. package/lib/agent/status.d.ts +6 -0
  15. package/lib/agent/status.d.ts.map +1 -1
  16. package/lib/agent/status.js +1 -0
  17. package/lib/agent/status.js.map +1 -1
  18. package/lib/cards.d.ts +83 -13
  19. package/lib/cards.d.ts.map +1 -1
  20. package/lib/cards.js +96 -28
  21. package/lib/cards.js.map +1 -1
  22. package/lib/export.d.ts +3 -3
  23. package/lib/export.d.ts.map +1 -1
  24. package/lib/export.js +23 -13
  25. package/lib/export.js.map +1 -1
  26. package/lib/fold-cursor.d.ts +12 -5
  27. package/lib/fold-cursor.d.ts.map +1 -1
  28. package/lib/fold-cursor.js +16 -5
  29. package/lib/fold-cursor.js.map +1 -1
  30. package/lib/gates.d.ts.map +1 -1
  31. package/lib/gates.js +42 -9
  32. package/lib/gates.js.map +1 -1
  33. package/lib/herdr/client.d.ts +57 -0
  34. package/lib/herdr/client.d.ts.map +1 -0
  35. package/lib/herdr/client.js +218 -0
  36. package/lib/herdr/client.js.map +1 -0
  37. package/lib/herdr/constants.d.ts +93 -0
  38. package/lib/herdr/constants.d.ts.map +1 -0
  39. package/lib/herdr/constants.js +79 -0
  40. package/lib/herdr/constants.js.map +1 -0
  41. package/lib/herdr/reporter.d.ts +60 -0
  42. package/lib/herdr/reporter.d.ts.map +1 -0
  43. package/lib/herdr/reporter.js +217 -0
  44. package/lib/herdr/reporter.js.map +1 -0
  45. package/lib/herdr/state.d.ts +57 -0
  46. package/lib/herdr/state.d.ts.map +1 -0
  47. package/lib/herdr/state.js +62 -0
  48. package/lib/herdr/state.js.map +1 -0
  49. package/lib/index.d.ts.map +1 -1
  50. package/lib/index.js +700 -81
  51. package/lib/index.js.map +1 -1
  52. package/lib/injection.d.ts +9 -0
  53. package/lib/injection.d.ts.map +1 -0
  54. package/lib/injection.js +128 -0
  55. package/lib/injection.js.map +1 -0
  56. package/lib/input/actions.d.ts +19 -2
  57. package/lib/input/actions.d.ts.map +1 -1
  58. package/lib/input/actions.js +60 -11
  59. package/lib/input/actions.js.map +1 -1
  60. package/lib/input/cancel.d.ts +55 -0
  61. package/lib/input/cancel.d.ts.map +1 -0
  62. package/lib/input/cancel.js +47 -0
  63. package/lib/input/cancel.js.map +1 -0
  64. package/lib/input/completion.d.ts +5 -2
  65. package/lib/input/completion.d.ts.map +1 -1
  66. package/lib/input/completion.js +79 -4
  67. package/lib/input/completion.js.map +1 -1
  68. package/lib/input/file-search.d.ts +105 -0
  69. package/lib/input/file-search.d.ts.map +1 -0
  70. package/lib/input/file-search.js +665 -0
  71. package/lib/input/file-search.js.map +1 -0
  72. package/lib/input/fuzzy.d.ts +42 -0
  73. package/lib/input/fuzzy.d.ts.map +1 -0
  74. package/lib/input/fuzzy.js +289 -0
  75. package/lib/input/fuzzy.js.map +1 -0
  76. package/lib/input/ghost.d.ts +46 -0
  77. package/lib/input/ghost.d.ts.map +1 -0
  78. package/lib/input/ghost.js +58 -0
  79. package/lib/input/ghost.js.map +1 -0
  80. package/lib/input/keymap.d.ts +3 -1
  81. package/lib/input/keymap.d.ts.map +1 -1
  82. package/lib/input/keymap.js +16 -3
  83. package/lib/input/keymap.js.map +1 -1
  84. package/lib/input/match.d.ts +12 -4
  85. package/lib/input/match.d.ts.map +1 -1
  86. package/lib/input/match.js +50 -51
  87. package/lib/input/match.js.map +1 -1
  88. package/lib/input/submission.d.ts +34 -1
  89. package/lib/input/submission.d.ts.map +1 -1
  90. package/lib/input/submission.js +33 -5
  91. package/lib/input/submission.js.map +1 -1
  92. package/lib/keys-command.d.ts +19 -3
  93. package/lib/keys-command.d.ts.map +1 -1
  94. package/lib/keys-command.js +34 -31
  95. package/lib/keys-command.js.map +1 -1
  96. package/lib/settings-notice.d.ts +5 -0
  97. package/lib/settings-notice.d.ts.map +1 -1
  98. package/lib/settings-notice.js +9 -7
  99. package/lib/settings-notice.js.map +1 -1
  100. package/lib/stash/lock.d.ts +72 -0
  101. package/lib/stash/lock.d.ts.map +1 -0
  102. package/lib/stash/lock.js +374 -0
  103. package/lib/stash/lock.js.map +1 -0
  104. package/lib/stash/paths.d.ts +22 -0
  105. package/lib/stash/paths.d.ts.map +1 -0
  106. package/lib/stash/paths.js +84 -0
  107. package/lib/stash/paths.js.map +1 -0
  108. package/lib/stash/private-fs.d.ts +61 -0
  109. package/lib/stash/private-fs.d.ts.map +1 -0
  110. package/lib/stash/private-fs.js +379 -0
  111. package/lib/stash/private-fs.js.map +1 -0
  112. package/lib/stash/schema.d.ts +56 -0
  113. package/lib/stash/schema.d.ts.map +1 -0
  114. package/lib/stash/schema.js +108 -0
  115. package/lib/stash/schema.js.map +1 -0
  116. package/lib/stash/store.d.ts +92 -0
  117. package/lib/stash/store.d.ts.map +1 -0
  118. package/lib/stash/store.js +262 -0
  119. package/lib/stash/store.js.map +1 -0
  120. package/lib/stash.d.ts +122 -0
  121. package/lib/stash.d.ts.map +1 -0
  122. package/lib/stash.js +353 -0
  123. package/lib/stash.js.map +1 -0
  124. package/lib/terminal/external-editor.d.ts +93 -0
  125. package/lib/terminal/external-editor.d.ts.map +1 -0
  126. package/lib/terminal/external-editor.js +263 -0
  127. package/lib/terminal/external-editor.js.map +1 -0
  128. package/lib/terminal/host-writes.d.ts +39 -0
  129. package/lib/terminal/host-writes.d.ts.map +1 -0
  130. package/lib/terminal/host-writes.js +136 -0
  131. package/lib/terminal/host-writes.js.map +1 -0
  132. package/lib/terminal/signals.d.ts +25 -0
  133. package/lib/terminal/signals.d.ts.map +1 -0
  134. package/lib/terminal/signals.js +39 -0
  135. package/lib/terminal/signals.js.map +1 -0
  136. package/lib/terminal/warning-screen.d.ts +19 -1
  137. package/lib/terminal/warning-screen.d.ts.map +1 -1
  138. package/lib/terminal/warning-screen.js +37 -1
  139. package/lib/terminal/warning-screen.js.map +1 -1
  140. package/lib/terminal-text.d.ts +72 -0
  141. package/lib/terminal-text.d.ts.map +1 -0
  142. package/lib/terminal-text.js +603 -0
  143. package/lib/terminal-text.js.map +1 -0
  144. package/lib/text.d.ts +45 -6
  145. package/lib/text.d.ts.map +1 -1
  146. package/lib/text.js +106 -46
  147. package/lib/text.js.map +1 -1
  148. package/lib/theme-command.d.ts +7 -4
  149. package/lib/theme-command.d.ts.map +1 -1
  150. package/lib/theme-command.js +32 -12
  151. package/lib/theme-command.js.map +1 -1
  152. package/lib/theme-files.d.ts +110 -0
  153. package/lib/theme-files.d.ts.map +1 -0
  154. package/lib/theme-files.js +352 -0
  155. package/lib/theme-files.js.map +1 -0
  156. package/lib/theme-schema.d.ts +121 -0
  157. package/lib/theme-schema.d.ts.map +1 -0
  158. package/lib/theme-schema.js +87 -0
  159. package/lib/theme-schema.js.map +1 -0
  160. package/lib/theme-settings.d.ts +72 -10
  161. package/lib/theme-settings.d.ts.map +1 -1
  162. package/lib/theme-settings.js +162 -45
  163. package/lib/theme-settings.js.map +1 -1
  164. package/lib/theme-tokens.d.ts +39 -7
  165. package/lib/theme-tokens.d.ts.map +1 -1
  166. package/lib/theme-tokens.js +104 -13
  167. package/lib/theme-tokens.js.map +1 -1
  168. package/lib/theme.d.ts +24 -2
  169. package/lib/theme.d.ts.map +1 -1
  170. package/lib/theme.js +49 -6
  171. package/lib/theme.js.map +1 -1
  172. package/lib/todo-guard.d.ts +116 -0
  173. package/lib/todo-guard.d.ts.map +1 -0
  174. package/lib/todo-guard.js +259 -0
  175. package/lib/todo-guard.js.map +1 -0
  176. package/lib/tool-display.d.ts +57 -0
  177. package/lib/tool-display.d.ts.map +1 -0
  178. package/lib/tool-display.js +51 -0
  179. package/lib/tool-display.js.map +1 -0
  180. package/lib/transcript.d.ts +28 -0
  181. package/lib/transcript.d.ts.map +1 -1
  182. package/lib/transcript.js +126 -37
  183. package/lib/transcript.js.map +1 -1
  184. package/lib/ui/diff.d.ts +49 -0
  185. package/lib/ui/diff.d.ts.map +1 -0
  186. package/lib/ui/diff.js +208 -0
  187. package/lib/ui/diff.js.map +1 -0
  188. package/lib/ui/dock.d.ts.map +1 -1
  189. package/lib/ui/dock.js +9 -6
  190. package/lib/ui/dock.js.map +1 -1
  191. package/lib/ui/editor.d.ts +41 -1
  192. package/lib/ui/editor.d.ts.map +1 -1
  193. package/lib/ui/editor.js +100 -4
  194. package/lib/ui/editor.js.map +1 -1
  195. package/lib/ui/frame.d.ts +16 -5
  196. package/lib/ui/frame.d.ts.map +1 -1
  197. package/lib/ui/frame.js +32 -13
  198. package/lib/ui/frame.js.map +1 -1
  199. package/lib/ui/history-picker.d.ts +15 -0
  200. package/lib/ui/history-picker.d.ts.map +1 -0
  201. package/lib/ui/history-picker.js +26 -0
  202. package/lib/ui/history-picker.js.map +1 -0
  203. package/lib/ui/keymap-picker.d.ts +16 -0
  204. package/lib/ui/keymap-picker.d.ts.map +1 -0
  205. package/lib/ui/keymap-picker.js +41 -0
  206. package/lib/ui/keymap-picker.js.map +1 -0
  207. package/lib/ui/layout.d.ts +33 -0
  208. package/lib/ui/layout.d.ts.map +1 -0
  209. package/lib/ui/layout.js +33 -0
  210. package/lib/ui/layout.js.map +1 -0
  211. package/lib/ui/markdown.d.ts +25 -3
  212. package/lib/ui/markdown.d.ts.map +1 -1
  213. package/lib/ui/markdown.js +12 -8
  214. package/lib/ui/markdown.js.map +1 -1
  215. package/lib/ui/picker-card.d.ts +42 -0
  216. package/lib/ui/picker-card.d.ts.map +1 -0
  217. package/lib/ui/picker-card.js +148 -0
  218. package/lib/ui/picker-card.js.map +1 -0
  219. package/lib/ui/picker.d.ts +50 -2
  220. package/lib/ui/picker.d.ts.map +1 -1
  221. package/lib/ui/picker.js +66 -7
  222. package/lib/ui/picker.js.map +1 -1
  223. package/lib/ui/prompt.d.ts +12 -2
  224. package/lib/ui/prompt.d.ts.map +1 -1
  225. package/lib/ui/prompt.js +25 -2
  226. package/lib/ui/prompt.js.map +1 -1
  227. package/lib/ui/rows.d.ts +8 -6
  228. package/lib/ui/rows.d.ts.map +1 -1
  229. package/lib/ui/rows.js +10 -18
  230. package/lib/ui/rows.js.map +1 -1
  231. package/lib/ui/stash-picker.d.ts +43 -0
  232. package/lib/ui/stash-picker.d.ts.map +1 -0
  233. package/lib/ui/stash-picker.js +78 -0
  234. package/lib/ui/stash-picker.js.map +1 -0
  235. package/lib/ui/status.d.ts +2 -0
  236. package/lib/ui/status.d.ts.map +1 -1
  237. package/lib/ui/status.js +25 -16
  238. package/lib/ui/status.js.map +1 -1
  239. package/lib/ui/theme-picker.d.ts +18 -0
  240. package/lib/ui/theme-picker.d.ts.map +1 -0
  241. package/lib/ui/theme-picker.js +68 -0
  242. package/lib/ui/theme-picker.js.map +1 -0
  243. package/lib/ui/view.d.ts +146 -22
  244. package/lib/ui/view.d.ts.map +1 -1
  245. package/lib/ui/view.js +461 -154
  246. package/lib/ui/view.js.map +1 -1
  247. package/lib/work.d.ts +3 -1
  248. package/lib/work.d.ts.map +1 -1
  249. package/lib/work.js +9 -1
  250. package/lib/work.js.map +1 -1
  251. package/package.json +7 -1
  252. package/themes/deepseek-blue.yaml +183 -0
  253. package/themes/violet-orbit.yaml +178 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-picker.js","sourceRoot":"","sources":["../../src/ui/theme-picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAe,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,a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,GAAG,EAAE,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,aAAa,CAAC,cAAc,QAAQ,CAAC,IAAI,EAAE,EAAE,gBAAgB,CAAC,YAAY,QAAQ,CAAC,IAAI,EAAE,EAAE,eAAe,CAAC,0BAA0B;KACrL,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAuB;IACtD,YACE,OAA2B,EAC3B,MAAgC,EAChC,IAAkB;IAClB,gFAAgF;IAChF,OAAiD;QAEjD,4EAA4E;QAC5E,2EAA2E;QAC3E,MAAM,KAAK,GAAG,GAAW,EAAE,CAAC,MAAM,EAAE,IAAI,aAAa,CAAA;QACrD,KAAK,CACH,GAAG,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EACvC,GAAG,EAAE,CAAC,WAAW,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,YAAY,EACpD,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EACnB,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EACtC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACnF,UAAU,CAAC,IAAI,CAAC,EAChB,IAAI;QACJ,sEAAsE;QACtE,EAAE,EACF,OAAO,CACR,CAAA;IACH,CAAC;CACF"}
package/lib/ui/view.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { type Component } from '@earendil-works/pi-tui';
1
+ import { type Component, type TuiMouseEvent, type TuiMouseEventResult } from '@earendil-works/pi-tui';
2
2
  import { type Keymap } from '../input/actions.ts';
3
3
  import { type GateCard } from '../gates.ts';
4
4
  import type { TranscriptEntry, TranscriptModel } from '../transcript.ts';
5
+ import { type ToolDisplaySpec } from '../tool-display.ts';
5
6
  import type { TuiTheme } from '../theme.ts';
6
- import type { MarkdownRenderer } from './markdown.ts';
7
+ import { type MarkdownRenderer } from './markdown.ts';
7
8
  import type { PickerCard } from './picker.ts';
8
- import { RowCache } from './rows.ts';
9
- /** Which rows the reader has opened; one key decides for every row of a kind. */
9
+ import { RowCache, type RowCacheStats } from './rows.ts';
10
+ /** Which rows the reader has opened by key; a click decides for one message instead. */
10
11
  export interface ViewState {
11
12
  readonly expandCards: boolean;
12
13
  readonly expandReasoning: boolean;
@@ -16,10 +17,10 @@ export interface ViewState {
16
17
  /**
17
18
  * The state a reader gets before opening anything, and the view's own fallback.
18
19
  *
19
- * Cards and thoughts start folded because either can be long enough to push the
20
- * answer off the screen. A program's calls are the opposite case: one clipped
21
- * line each, under a header that already names them, so folding them costs a
22
- * reader the very thing the card stands for.
20
+ * Thoughts start folded because they can be long enough to push the answer off
21
+ * the screen. Cards and a program's calls start from the reader's own `tools:`
22
+ * settings, which ship folded for cards — one clipped line each — and inline for
23
+ * a program's calls, whose one line per dispatch is what the card stands for.
23
24
  */
24
25
  export declare const DEFAULT_VIEW_STATE: ViewState;
25
26
  /**
@@ -45,6 +46,13 @@ export interface TranscriptViewOptions {
45
46
  * a settings edit moved the key.
46
47
  */
47
48
  readonly keys?: () => Keymap;
49
+ /**
50
+ * How one tool's cards draw, read per render.
51
+ *
52
+ * The settings document is hot-reloaded, so a captured table would keep
53
+ * folding a session under the policy it happened to start with.
54
+ */
55
+ readonly toolDisplay?: (tool: string) => ToolDisplaySpec;
48
56
  }
49
57
  export declare class TranscriptView implements Component {
50
58
  private readonly model;
@@ -52,16 +60,56 @@ export declare class TranscriptView implements Component {
52
60
  private readonly markdown;
53
61
  private readonly options;
54
62
  private readonly rows;
63
+ /**
64
+ * Fold choices the reader made by clicking, per message.
65
+ *
66
+ * Absent means the key or the tool's own policy decides, so a settings edit
67
+ * stays in charge of messages nobody clicked. Keyed by the call or thought id
68
+ * rather than by the entry, because a result replaces the entry a click was
69
+ * made on and a thought outlives the live row that streamed it.
70
+ */
71
+ private readonly clicked;
72
+ /** The rows each clickable message drew last render, for mapping a click back to it. */
73
+ private spans;
74
+ /** The same spans relative to their entry, so a cached entry still answers clicks. */
75
+ private readonly entrySpans;
55
76
  constructor(model: TranscriptModel, theme: TuiTheme, markdown: MarkdownRenderer, options?: TranscriptViewOptions);
56
77
  private get viewState();
78
+ /** The display the reader configured for a tool, or the shipped one. */
79
+ private toolDisplay;
80
+ /**
81
+ * Whether one tool message draws open.
82
+ *
83
+ * A click outranks the key, which outranks the tool's start state: Ctrl+O
84
+ * stays "show me everything", while one clicked message keeps the state the
85
+ * reader gave it.
86
+ */
87
+ private expansionOf;
88
+ /** Whether one thought draws its body; a click decides for that thought alone. */
89
+ private reasoningOpen;
90
+ /** Whether one dispatched call draws its argument in full; a click decides for that call. */
91
+ private subCallOpen;
92
+ /**
93
+ * Answer a click on a message by folding or unfolding that one row.
94
+ *
95
+ * The tightest span under the point wins, so a click on a dispatched call
96
+ * opens that call rather than the card around it. Only a left click is
97
+ * consumed: a press, a drag, and a wheel belong to the surface's own
98
+ * selection and scrolling, and a row that swallowed them would cost the
99
+ * reader the ability to copy the command it just drew.
100
+ */
101
+ handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
57
102
  /** The cache's own account of the work it avoided; a test reads this. */
58
- rowStats(): {
59
- readonly hits: number;
60
- readonly misses: number;
61
- readonly size: number;
62
- };
103
+ rowStats(): RowCacheStats;
63
104
  invalidate(): void;
64
- /** Wrap one text block under a prefix, keeping the prefix's column budget. */
105
+ /**
106
+ * Wrap one text block under a prefix, keeping the prefix's column budget.
107
+ *
108
+ * The block is drawn before it is wrapped: a sequence a terminal would have
109
+ * acted on has to be gone before pi-tui measures the row, and a tab has to
110
+ * land on the stop the writer saw rather than one a wrapper would guess at.
111
+ * The prefix seeds that stop, because it is already on the row.
112
+ */
65
113
  private pushWrapped;
66
114
  /**
67
115
  * Wrap one already-styled block under a prefix.
@@ -73,8 +121,40 @@ export declare class TranscriptView implements Component {
73
121
  * command is worse than a taller card.
74
122
  */
75
123
  private pushStyledWrapped;
76
- /** Render assistant text as markdown: the model writes structure, the reader reads it. */
124
+ /**
125
+ * The rows one markdown message draws, with the padding pi-tui adds for background styling removed.
126
+ *
127
+ * The source is drawn first so the markdown renderer never measures a sequence
128
+ * it cannot see; its own spans are applied around the result afterwards.
129
+ */
130
+ private markdownLines;
131
+ /**
132
+ * Render one message's text as markdown.
133
+ *
134
+ * A thought passes its own face and an indent, so the row stays visibly a
135
+ * detail of the step that produced it rather than a second answer.
136
+ */
77
137
  private pushMarkdown;
138
+ /**
139
+ * One message closed into a frame, with its markdown laid out to what is left inside.
140
+ *
141
+ * A prompt and a reply are the two objects of an exchange, so both are drawn as
142
+ * bars rather than as one more stretch of rows; the face, the border's element,
143
+ * and whether the text is still arriving are the only differences. Markdown lays
144
+ * itself out to the frame's text width, so the frame may only place the rows:
145
+ * wrapping them again would break what it drew.
146
+ */
147
+ private pushFramed;
148
+ /**
149
+ * The face a thought is drawn in.
150
+ *
151
+ * Its shade stays the thought body's and it asks for no drawing: a diagram in
152
+ * the middle of a thought would carry the answer's weight, and the answer's
153
+ * colours would make the thinking compete with it.
154
+ */
155
+ private reasoningFace;
156
+ /** The face a submitted prompt is drawn in: its structure is markdown's, its shade stays the prompt's. */
157
+ private userFace;
78
158
  /** The live map, or the shipped one for a caller that did not lend one. */
79
159
  private keymap;
80
160
  private reasoningFoldHint;
@@ -84,21 +164,65 @@ export declare class TranscriptView implements Component {
84
164
  * The calls one card dispatched, one entry each.
85
165
  *
86
166
  * A nested call is a signpost rather than a card of its own, so it keeps one
87
- * entry per call; a long argument still wraps under that entry rather than
88
- * being cut, because the argument is the part a reader scans for and a
89
- * silently shortened path reads as the one that ran.
167
+ * entry per call, clipped to that entry until the reader clicks it: the
168
+ * argument is the part a reader scans for, and one that always wrapped pushed
169
+ * the rest of the program off the screen.
90
170
  */
91
171
  private pushSubCalls;
172
+ /**
173
+ * What a dispatched call declared and what it produced, under its argument.
174
+ *
175
+ * The parent card keeps only the program's return value, so both are otherwise
176
+ * gone; a reader who opens the row is asking for them, which is why the call's
177
+ * own rows come first and its outcome under them. Each section keeps the
178
+ * retention its card used, so a long run still says what it dropped.
179
+ */
180
+ private pushSubCallOutput;
181
+ /**
182
+ * A folded card's one row: label, clipped argument, measured facts, outcome.
183
+ *
184
+ * The outcome rides this row rather than a row of its own, because one line
185
+ * per call is what folding promises. A shell card's hidden rows are counted
186
+ * here too: its output is the answer the reader asked for, and a fold that
187
+ * left no trace of it would read as a call that produced nothing.
188
+ *
189
+ * The argument is the part that gives up room: it is clipped to whatever the
190
+ * label, the facts, and the outcome leave before the edge, so a wide terminal
191
+ * shows more of the call while a narrow one still shows how it ended.
192
+ */
193
+ private renderCollapsedHead;
194
+ /**
195
+ * One detail row, drawn with its own kind's colours or nothing at all.
196
+ *
197
+ * The row says what it is, so the renderer never guesses from the text: a diff
198
+ * line beginning with "+" is an addition because the presenter said so, not
199
+ * because of its first character.
200
+ */
201
+ private detailRow;
202
+ /** The mark that introduces a card, empty when the theme hides its label. */
203
+ private cardLead;
204
+ /** A card's label, styled, or nothing when the theme hides it. */
205
+ private cardTitle;
206
+ /** A card's argument, styled and flattened, clipped to `limit` when one is given. */
207
+ private cardArgument;
92
208
  /**
93
209
  * A card's header: its label, its argument, and its measured facts.
94
210
  *
95
211
  * The glyph is returned apart from the body so a wrapped continuation can
96
- * align under the label rather than under the mark. A terminal's argument is
97
- * left out because it needs a row of its own — it is the one argument that can
98
- * be a whole command rather than a word.
212
+ * align under the label rather than under the mark. An opened terminal's
213
+ * argument is left out because it needs a row of its own — it is the one
214
+ * argument that can be a whole command rather than a word.
99
215
  */
100
216
  private renderHead;
101
- /** The measured facts, each in its own colour, or nothing when none is visible. */
217
+ /** The separator a header uses between its label, its facts, and its outcome. */
218
+ private statSeparator;
219
+ /**
220
+ * The measured facts, each in its own colour, or nothing when none is visible.
221
+ *
222
+ * The lead is a parameter because a header that already carries a title and an
223
+ * argument separates its facts with the same mark as its outcome, while facts
224
+ * on a row of their own stand apart with blank columns.
225
+ */
102
226
  private renderStats;
103
227
  private pushPicker;
104
228
  private pushGate;
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/ui/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,wBAAwB,CAAA;AAEvF,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAiDpC,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;IACjC,qFAAqF;IACrF,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CACjC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAgF,CAAA;AAEjH;;;;;;;GAOG;AACH,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,SAAS,CAAA;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,QAAQ,GAAG,SAAS,CAAA;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,UAAU,GAAG,SAAS,CAAA;IAC9C,0EAA0E;IAC1E,Q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