@sagmans/dsh-tui 0.6.0 → 0.7.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 (250) hide show
  1. package/.agents/skills/dsh-tui-dogfood/SKILL.md +83 -0
  2. package/.agents/skills/dsh-tui-dogfood/references/home-state.md +78 -0
  3. package/.agents/skills/dsh-tui-dogfood/scripts/clone-links.mjs +133 -0
  4. package/.agents/skills/dsh-tui-dogfood/scripts/run-plugin-from-worktree.sh +417 -0
  5. package/.agents/skills/dsh-tui-update-models/SKILL.md +121 -0
  6. package/.agents/skills/dsh-tui-update-models/references/model-wiring.md +162 -0
  7. package/.agents/skills/dsh-tui-update-models/scripts/dump-model-catalog.mjs +178 -0
  8. package/README.md +99 -5
  9. package/lib/agent/present.d.ts.map +1 -1
  10. package/lib/agent/present.js +2 -1
  11. package/lib/agent/present.js.map +1 -1
  12. package/lib/cards/composition.d.ts +68 -0
  13. package/lib/cards/composition.d.ts.map +1 -0
  14. package/lib/cards/composition.js +117 -0
  15. package/lib/cards/composition.js.map +1 -0
  16. package/lib/cards/presenter.d.ts +23 -0
  17. package/lib/cards/presenter.d.ts.map +1 -0
  18. package/lib/cards/presenter.js +394 -0
  19. package/lib/cards/presenter.js.map +1 -0
  20. package/lib/cards/preview.d.ts +42 -0
  21. package/lib/cards/preview.d.ts.map +1 -0
  22. package/lib/cards/preview.js +51 -0
  23. package/lib/cards/preview.js.map +1 -0
  24. package/lib/cards.d.ts +12 -120
  25. package/lib/cards.d.ts.map +1 -1
  26. package/lib/cards.js +4 -556
  27. package/lib/cards.js.map +1 -1
  28. package/lib/compat/section.d.ts +29 -0
  29. package/lib/compat/section.d.ts.map +1 -0
  30. package/lib/compat/section.js +82 -0
  31. package/lib/compat/section.js.map +1 -0
  32. package/lib/config.d.ts +27 -2
  33. package/lib/config.d.ts.map +1 -1
  34. package/lib/config.js +61 -1
  35. package/lib/config.js.map +1 -1
  36. package/lib/contracts.d.ts +28 -0
  37. package/lib/contracts.d.ts.map +1 -1
  38. package/lib/fold-cursor.d.ts +8 -0
  39. package/lib/fold-cursor.d.ts.map +1 -1
  40. package/lib/fold-cursor.js +18 -0
  41. package/lib/fold-cursor.js.map +1 -1
  42. package/lib/gates/question-card.d.ts +77 -0
  43. package/lib/gates/question-card.d.ts.map +1 -0
  44. package/lib/gates/question-card.js +113 -0
  45. package/lib/gates/question-card.js.map +1 -0
  46. package/lib/gates/questions.d.ts +127 -0
  47. package/lib/gates/questions.d.ts.map +1 -0
  48. package/lib/gates/questions.js +418 -0
  49. package/lib/gates/questions.js.map +1 -0
  50. package/lib/gates.d.ts +1 -113
  51. package/lib/gates.d.ts.map +1 -1
  52. package/lib/gates.js +1 -484
  53. package/lib/gates.js.map +1 -1
  54. package/lib/index.d.ts +1 -0
  55. package/lib/index.d.ts.map +1 -1
  56. package/lib/index.js +343 -2602
  57. package/lib/index.js.map +1 -1
  58. package/lib/input/action-catalog.d.ts +74 -0
  59. package/lib/input/action-catalog.d.ts.map +1 -0
  60. package/lib/input/action-catalog.js +137 -0
  61. package/lib/input/action-catalog.js.map +1 -0
  62. package/lib/input/actions.d.ts +5 -81
  63. package/lib/input/actions.d.ts.map +1 -1
  64. package/lib/input/actions.js +4 -625
  65. package/lib/input/actions.js.map +1 -1
  66. package/lib/input/completion.d.ts +1 -1
  67. package/lib/input/completion.d.ts.map +1 -1
  68. package/lib/input/completion.js +2 -1
  69. package/lib/input/completion.js.map +1 -1
  70. package/lib/input/file-index.d.ts +40 -0
  71. package/lib/input/file-index.d.ts.map +1 -0
  72. package/lib/input/file-index.js +141 -0
  73. package/lib/input/file-index.js.map +1 -0
  74. package/lib/input/file-search.d.ts +1 -38
  75. package/lib/input/file-search.d.ts.map +1 -1
  76. package/lib/input/file-search.js +1 -487
  77. package/lib/input/file-search.js.map +1 -1
  78. package/lib/input/key-press.d.ts +57 -0
  79. package/lib/input/key-press.d.ts.map +1 -0
  80. package/lib/input/key-press.js +218 -0
  81. package/lib/input/key-press.js.map +1 -0
  82. package/lib/input/keymap-conflicts.d.ts +59 -0
  83. package/lib/input/keymap-conflicts.d.ts.map +1 -0
  84. package/lib/input/keymap-conflicts.js +292 -0
  85. package/lib/input/keymap-conflicts.js.map +1 -0
  86. package/lib/input/keymap-settings.js +1 -1
  87. package/lib/input/keymap-settings.js.map +1 -1
  88. package/lib/input/keymap.d.ts.map +1 -1
  89. package/lib/input/keymap.js +3 -1
  90. package/lib/input/keymap.js.map +1 -1
  91. package/lib/input/workspace-files.d.ts +10 -0
  92. package/lib/input/workspace-files.d.ts.map +1 -0
  93. package/lib/input/workspace-files.js +359 -0
  94. package/lib/input/workspace-files.js.map +1 -0
  95. package/lib/install-skills.d.ts +20 -0
  96. package/lib/install-skills.d.ts.map +1 -0
  97. package/lib/install-skills.js +198 -0
  98. package/lib/install-skills.js.map +1 -0
  99. package/lib/keys-command.d.ts +2 -1
  100. package/lib/keys-command.d.ts.map +1 -1
  101. package/lib/keys-command.js +2 -1
  102. package/lib/keys-command.js.map +1 -1
  103. package/lib/model-list.d.ts +37 -0
  104. package/lib/model-list.d.ts.map +1 -0
  105. package/lib/model-list.js +60 -0
  106. package/lib/model-list.js.map +1 -0
  107. package/lib/startup.d.ts +8 -0
  108. package/lib/startup.d.ts.map +1 -1
  109. package/lib/startup.js +120 -24
  110. package/lib/startup.js.map +1 -1
  111. package/lib/subagents.d.ts +7 -3
  112. package/lib/subagents.d.ts.map +1 -1
  113. package/lib/subagents.js +28 -4
  114. package/lib/subagents.js.map +1 -1
  115. package/lib/surface/appearance-preferences.d.ts +26 -0
  116. package/lib/surface/appearance-preferences.d.ts.map +1 -0
  117. package/lib/surface/appearance-preferences.js +139 -0
  118. package/lib/surface/appearance-preferences.js.map +1 -0
  119. package/lib/surface/appearance.d.ts +87 -0
  120. package/lib/surface/appearance.d.ts.map +1 -0
  121. package/lib/surface/appearance.js +353 -0
  122. package/lib/surface/appearance.js.map +1 -0
  123. package/lib/surface/background-work.d.ts +49 -0
  124. package/lib/surface/background-work.d.ts.map +1 -0
  125. package/lib/surface/background-work.js +146 -0
  126. package/lib/surface/background-work.js.map +1 -0
  127. package/lib/surface/commands.d.ts +80 -0
  128. package/lib/surface/commands.d.ts.map +1 -0
  129. package/lib/surface/commands.js +364 -0
  130. package/lib/surface/commands.js.map +1 -0
  131. package/lib/surface/modal-input.d.ts +58 -0
  132. package/lib/surface/modal-input.d.ts.map +1 -0
  133. package/lib/surface/modal-input.js +237 -0
  134. package/lib/surface/modal-input.js.map +1 -0
  135. package/lib/surface/model-choice.d.ts +54 -0
  136. package/lib/surface/model-choice.d.ts.map +1 -0
  137. package/lib/surface/model-choice.js +325 -0
  138. package/lib/surface/model-choice.js.map +1 -0
  139. package/lib/surface/preset-choice.d.ts +78 -0
  140. package/lib/surface/preset-choice.d.ts.map +1 -0
  141. package/lib/surface/preset-choice.js +163 -0
  142. package/lib/surface/preset-choice.js.map +1 -0
  143. package/lib/surface/prompt-input.d.ts +97 -0
  144. package/lib/surface/prompt-input.d.ts.map +1 -0
  145. package/lib/surface/prompt-input.js +215 -0
  146. package/lib/surface/prompt-input.js.map +1 -0
  147. package/lib/surface/prompt-memory.d.ts +76 -0
  148. package/lib/surface/prompt-memory.d.ts.map +1 -0
  149. package/lib/surface/prompt-memory.js +167 -0
  150. package/lib/surface/prompt-memory.js.map +1 -0
  151. package/lib/surface/session-lifecycle.d.ts +120 -0
  152. package/lib/surface/session-lifecycle.d.ts.map +1 -0
  153. package/lib/surface/session-lifecycle.js +321 -0
  154. package/lib/surface/session-lifecycle.js.map +1 -0
  155. package/lib/surface/session-picker.d.ts +39 -0
  156. package/lib/surface/session-picker.d.ts.map +1 -0
  157. package/lib/surface/session-picker.js +107 -0
  158. package/lib/surface/session-picker.js.map +1 -0
  159. package/lib/surface/session-view.d.ts +86 -0
  160. package/lib/surface/session-view.d.ts.map +1 -0
  161. package/lib/surface/session-view.js +215 -0
  162. package/lib/surface/session-view.js.map +1 -0
  163. package/lib/surface/staged-turns.d.ts +81 -0
  164. package/lib/surface/staged-turns.d.ts.map +1 -0
  165. package/lib/surface/staged-turns.js +206 -0
  166. package/lib/surface/staged-turns.js.map +1 -0
  167. package/lib/surface/terminal-lifecycle.d.ts +76 -0
  168. package/lib/surface/terminal-lifecycle.d.ts.map +1 -0
  169. package/lib/surface/terminal-lifecycle.js +222 -0
  170. package/lib/surface/terminal-lifecycle.js.map +1 -0
  171. package/lib/terminal-text/scan.d.ts +44 -0
  172. package/lib/terminal-text/scan.d.ts.map +1 -0
  173. package/lib/terminal-text/scan.js +195 -0
  174. package/lib/terminal-text/scan.js.map +1 -0
  175. package/lib/terminal-text/sgr.d.ts +32 -0
  176. package/lib/terminal-text/sgr.d.ts.map +1 -0
  177. package/lib/terminal-text/sgr.js +203 -0
  178. package/lib/terminal-text/sgr.js.map +1 -0
  179. package/lib/terminal-text.d.ts +1 -1
  180. package/lib/terminal-text.d.ts.map +1 -1
  181. package/lib/terminal-text.js +2 -379
  182. package/lib/terminal-text.js.map +1 -1
  183. package/lib/theme-command.js +2 -1
  184. package/lib/theme-command.js.map +1 -1
  185. package/lib/theme-defaults.d.ts +64 -0
  186. package/lib/theme-defaults.d.ts.map +1 -0
  187. package/lib/theme-defaults.js +248 -0
  188. package/lib/theme-defaults.js.map +1 -0
  189. package/lib/theme-resolver.d.ts +36 -0
  190. package/lib/theme-resolver.d.ts.map +1 -0
  191. package/lib/theme-resolver.js +112 -0
  192. package/lib/theme-resolver.js.map +1 -0
  193. package/lib/theme-schema.d.ts.map +1 -1
  194. package/lib/theme-schema.js +3 -2
  195. package/lib/theme-schema.js.map +1 -1
  196. package/lib/theme-settings.d.ts +5 -7
  197. package/lib/theme-settings.d.ts.map +1 -1
  198. package/lib/theme-settings.js +27 -19
  199. package/lib/theme-settings.js.map +1 -1
  200. package/lib/theme-tokens.d.ts +0 -89
  201. package/lib/theme-tokens.d.ts.map +1 -1
  202. package/lib/theme-tokens.js +0 -356
  203. package/lib/theme-tokens.js.map +1 -1
  204. package/lib/theme.d.ts +1 -1
  205. package/lib/theme.d.ts.map +1 -1
  206. package/lib/theme.js +2 -1
  207. package/lib/theme.js.map +1 -1
  208. package/lib/tool-display.d.ts.map +1 -1
  209. package/lib/tool-display.js +2 -1
  210. package/lib/tool-display.js.map +1 -1
  211. package/lib/transcript/message-content.d.ts +21 -0
  212. package/lib/transcript/message-content.d.ts.map +1 -0
  213. package/lib/transcript/message-content.js +61 -0
  214. package/lib/transcript/message-content.js.map +1 -0
  215. package/lib/transcript/tool-calls.d.ts +106 -0
  216. package/lib/transcript/tool-calls.d.ts.map +1 -0
  217. package/lib/transcript/tool-calls.js +254 -0
  218. package/lib/transcript/tool-calls.js.map +1 -0
  219. package/lib/transcript.d.ts +14 -55
  220. package/lib/transcript.d.ts.map +1 -1
  221. package/lib/transcript.js +31 -253
  222. package/lib/transcript.js.map +1 -1
  223. package/lib/ui/dock.d.ts +14 -2
  224. package/lib/ui/dock.d.ts.map +1 -1
  225. package/lib/ui/dock.js +52 -10
  226. package/lib/ui/dock.js.map +1 -1
  227. package/lib/ui/editor.d.ts.map +1 -1
  228. package/lib/ui/editor.js +2 -1
  229. package/lib/ui/editor.js.map +1 -1
  230. package/lib/ui/keymap-picker.d.ts +2 -1
  231. package/lib/ui/keymap-picker.d.ts.map +1 -1
  232. package/lib/ui/keymap-picker.js +1 -0
  233. package/lib/ui/keymap-picker.js.map +1 -1
  234. package/lib/ui/view/gate-card.d.ts +21 -0
  235. package/lib/ui/view/gate-card.d.ts.map +1 -0
  236. package/lib/ui/view/gate-card.js +104 -0
  237. package/lib/ui/view/gate-card.js.map +1 -0
  238. package/lib/ui/view/tool-card.d.ts +138 -0
  239. package/lib/ui/view/tool-card.d.ts.map +1 -0
  240. package/lib/ui/view/tool-card.js +413 -0
  241. package/lib/ui/view/tool-card.js.map +1 -0
  242. package/lib/ui/view/transcript-message.d.ts +62 -0
  243. package/lib/ui/view/transcript-message.d.ts.map +1 -0
  244. package/lib/ui/view/transcript-message.js +158 -0
  245. package/lib/ui/view/transcript-message.js.map +1 -0
  246. package/lib/ui/view.d.ts +80 -220
  247. package/lib/ui/view.d.ts.map +1 -1
  248. package/lib/ui/view.js +81 -675
  249. package/lib/ui/view.js.map +1 -1
  250. package/package.json +3 -1
@@ -0,0 +1,51 @@
1
+ import { CARD_DETAIL_MAX } from "../cards.js";
2
+ import { title } from "./presenter.js";
3
+ /**
4
+ * Output rows a folded card keeps on screen when a tool configures a tail.
5
+ *
6
+ * Shipped as the `tail` default for every tool, but drawn only when that tool
7
+ * asks for `output: tail`: the shipped `output: hidden` is what makes a folded
8
+ * card one line. The tail is the part that carries the outcome of a long run,
9
+ * and the retention cap still bounds what ctrl+o can reveal.
10
+ */
11
+ export const CARD_SHELL_PREVIEW = 20;
12
+ /**
13
+ * The tail of the hint a folded shell card draws when it dropped rows.
14
+ *
15
+ * "more" rather than "them": retention caps detail rows, so a command that
16
+ * printed thousands of lines cannot promise ctrl+o will reveal every dropped
17
+ * one.
18
+ */
19
+ /** The fold hint names the key that opens the card, which the reader owns. */
20
+ const cardHintEarlier = (showMoreKey) => `earlier lines · ${showMoreKey} shows more`;
21
+ /**
22
+ * The tail of the hint an opened shell card draws when retention dropped rows.
23
+ *
24
+ * Retention keeps the tail of a run, so the rows it refused are always the
25
+ * beginning; a hint that only counted them would send the reader looking past
26
+ * the end of the output for rows that are not there.
27
+ */
28
+ const CARD_HINT_UNRETAINED_EARLIER = 'earlier lines not shown';
29
+ /**
30
+ * The rows a card shows right now, and how many the reader is not seeing.
31
+ *
32
+ * Expansion is a view decision rather than a card field so one key press can
33
+ * change every card at once without rebuilding the transcript.
34
+ */
35
+ export function cardDetailRows(card, preview) {
36
+ const lines = preview.expanded
37
+ ? card.detail.slice(0, CARD_DETAIL_MAX)
38
+ : preview.preview === 'tail'
39
+ ? card.detail.slice(Math.max(0, card.detail.length - Math.max(0, preview.rows)))
40
+ : [];
41
+ return { lines, hidden: Math.max(0, card.totalLines - lines.length) };
42
+ }
43
+ /** The hint row for a folded shell card, or undefined when its preview dropped nothing. */
44
+ export function shellFoldHint(hidden, showMoreKey) {
45
+ return hidden <= 0 ? undefined : `… ${hidden} ${cardHintEarlier(showMoreKey)}`;
46
+ }
47
+ /** The hint row for an opened shell card whose retention dropped the run's earlier rows. */
48
+ export function shellRetentionHint(hidden) {
49
+ return hidden <= 0 ? undefined : `… ${hidden} ${CARD_HINT_UNRETAINED_EARLIER}`;
50
+ }
51
+ //# sourceMappingURL=preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.js","sourceRoot":"","sources":["../../src/cards/preview.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAEpC;;;;;;GAMG;AACH,8EAA8E;AAC9E,MAAM,eAAe,GAAG,CAAC,WAAmB,EAAU,EAAE,CAAC,mBAAmB,WAAW,aAAa,CAAA;AAEpG;;;;;;GAMG;AACH,MAAM,4BAA4B,GAAG,yBAAyB,CAAA;AAc9D;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAc,EAAE,OAAoB;IACjE,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ;QAC5B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC;QACvC,CAAC,CAAC,OAAO,CAAC,OAAO,KAAK,MAAM;YAC1B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YAChF,CAAC,CAAC,EAAE,CAAA;IACR,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAA;AACvE,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,WAAmB;IAC/D,OAAO,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,eAAe,CAAC,WAAW,CAAC,EAAE,CAAA;AAChF,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,4BAA4B,EAAE,CAAA;AAChF,CAAC"}
package/lib/cards.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import type { FileDiff, ToolCallView, ToolResultView } from '@deepseek-ai/dsh-tools';
2
- import type { CardRowClass } from './theme-tokens.ts';
1
+ import { type CardRowClass } from './theme-tokens.ts';
3
2
  /** What a tool's result presenter receives, plus the call arguments it was asked with. */
4
3
  export interface ToolResultInput {
5
4
  readonly argumentsJson: string;
@@ -177,23 +176,6 @@ export interface ToolCard {
177
176
  * memory for a reader who will never scroll that far.
178
177
  */
179
178
  export declare const CARD_DETAIL_MAX = 200;
180
- /**
181
- * Output rows a folded card keeps on screen when a tool configures a tail.
182
- *
183
- * Shipped as the `tail` default for every tool, but drawn only when that tool
184
- * asks for `output: tail`: the shipped `output: hidden` is what makes a folded
185
- * card one line. The tail is the part that carries the outcome of a long run,
186
- * and the retention cap still bounds what ctrl+o can reveal.
187
- */
188
- export declare const CARD_SHELL_PREVIEW = 20;
189
- /**
190
- * Nested calls retained on one PTC card.
191
- *
192
- * A program can dispatch in a loop, and one line each is small but not free;
193
- * the cap keeps a card bounded while {@link ToolCard.subCallsTotal} still
194
- * reports everything the program ran.
195
- */
196
- export declare const SUBCALL_MAX = 100;
197
179
  /** Character budget for one detail row, so a minified file cannot flood the viewport. */
198
180
  export declare const CARD_LINE_LIMIT = 200;
199
181
  /**
@@ -207,6 +189,7 @@ export declare const CARD_LINE_LIMIT = 200;
207
189
  * row keeps as many words as a plain one.
208
190
  */
209
191
  export declare function clip(text: string, limit: number): string;
192
+ export declare function clipLine(text: string): string;
210
193
  /**
211
194
  * Text on one row, with every run of whitespace collapsed.
212
195
  *
@@ -214,78 +197,21 @@ export declare function clip(text: string, limit: number): string;
214
197
  * wrapped continuation would make one card read as two.
215
198
  */
216
199
  export declare function oneLine(text: string): string;
217
- /**
218
- * What the fold learned about one dispatched call, in the order it learned it.
219
- *
220
- * A call is logged twice — once when the program asks for it, once with what it
221
- * answered — and each moment supplies part of the row: the call view names it,
222
- * the result view says how it ended and what it produced.
223
- */
224
- export interface SubCallFacts {
225
- /** The card the call declared, or nothing when no presenter answered for it. */
226
- readonly view: ToolCard | undefined;
227
- /** The rows the row opens to, once the call reported them. */
228
- readonly output: ToolSubCallRows | undefined;
229
- /** How the call finished, as the tool that ran it reported. */
230
- readonly status: string | undefined;
231
- /** Whether the call is logged and still unanswered. */
232
- readonly running: boolean;
233
- /** Whether the call is one the log marked as an error. */
234
- readonly failed: boolean;
235
- }
236
- /**
237
- * The one-line row for one nested call, as its start or its settle leaves it.
238
- *
239
- * A tool that declares a call view is drawn exactly as its own header would be;
240
- * only a tool with no view at all falls back to its registry name and raw call,
241
- * because the surface cannot name a salient argument for a schema it never saw.
242
- * A settle logs the same call again, and the presenter that answered the first
243
- * time is asked again for the view it would draw — so the row's identity comes
244
- * from the row already on screen wherever there is one, and only a call that was
245
- * dropped earlier is named from the log. The row also keeps how the call ended,
246
- * because a program's calls are told apart by their outcomes rather than by
247
- * anything the program itself says about them.
248
- */
249
- export declare function subCallRow(id: string, name: string, argumentsJson: string, facts: SubCallFacts, existing?: ToolSubCall): ToolSubCall;
250
- /**
251
- * The rows one dispatched call keeps, from the card that drew them.
252
- *
253
- * The total is clamped to what was kept: a card built from a call or result
254
- * view reports no total of its own, because it is not a stream retention had to
255
- * cut, and a count below the rows on screen would hint at rows already shown.
256
- */
257
- export declare function subCallRows(card: ToolCard | undefined): ToolSubCallRows | undefined;
258
- /**
259
- * How much of a card the reader has asked for.
260
- *
261
- * The folded state names its own treatment because the reader's settings decide
262
- * whether a folded card shows a tail of its rows or nothing beyond its header;
263
- * the count travels with the choice so the view never re-reads the policy.
264
- */
265
- export type CardPreview = {
266
- readonly expanded: true;
267
- } | {
268
- readonly expanded: false;
269
- readonly preview: 'title';
270
- } | {
271
- readonly expanded: false;
272
- readonly preview: 'tail';
273
- readonly rows: number;
200
+ export declare function bound(rows: readonly CardRow[]): {
201
+ detail: CardRow[];
202
+ totalLines: number;
274
203
  };
275
204
  /**
276
- * The rows a card shows right now, and how many the reader is not seeing.
205
+ * Bound a card to its retained rows from the END.
277
206
  *
278
- * Expansion is a view decision rather than a card field so one key press can
279
- * change every card at once without rebuilding the transcript.
207
+ * A command's answer is its last lines, so keeping the head would show a long
208
+ * run's middle and lose the ending the reader asked for; the tail is also what
209
+ * a folded shell card tails again.
280
210
  */
281
- export declare function cardDetailRows(card: ToolCard, preview: CardPreview): {
282
- lines: readonly CardRow[];
283
- hidden: number;
211
+ export declare function boundTail(rows: readonly CardRow[]): {
212
+ detail: CardRow[];
213
+ totalLines: number;
284
214
  };
285
- /** The hint row for a folded shell card, or undefined when its preview dropped nothing. */
286
- export declare function shellFoldHint(hidden: number, showMoreKey: string): string | undefined;
287
- /** The hint row for an opened shell card whose retention dropped the run's earlier rows. */
288
- export declare function shellRetentionHint(hidden: number): string | undefined;
289
215
  /**
290
216
  * Build a card from raw text lines.
291
217
  *
@@ -296,38 +222,4 @@ export declare function shellRetentionHint(hidden: number): string | undefined;
296
222
  export declare function cardFromLines(kind: ToolCardKind, tool: string, title: string, lines: readonly string[], failed: boolean): ToolCard;
297
223
  /** Text lines carried by model-facing content blocks. */
298
224
  export declare function contentLines(content: unknown): string[];
299
- /**
300
- * The header fields a rebuilt card must keep.
301
- *
302
- * Replacing a card's rows says nothing about what the call was made with, what
303
- * it measured, how it ended, or which calls it dispatched, so those fields
304
- * travel with the rebuild: dropping the argument is how a shell card loses its
305
- * command the moment a presenter declines the result.
306
- */
307
- export declare function carriedFields(card: ToolCard): Pick<ToolCard, 'argument' | 'stats' | 'status' | 'subCalls' | 'subCallsTotal'>;
308
- /**
309
- * Collapse one call and its result into the single row the reader sees.
310
- *
311
- * The pending row already told the reader what the tool is doing, so the
312
- * settled row keeps that header and swaps in the outcome; a result that
313
- * presents nothing keeps the call's detail rather than blanking the row.
314
- */
315
- export declare function mergeCards(call: ToolCard | undefined, result: ToolCard | undefined): ToolCard;
316
- /**
317
- * Render one file change as a bounded unified hunk.
318
- *
319
- * Only the changed middle is shown: a presenter has the prior and next text but
320
- * no hunk list, so trimming the shared prefix and suffix yields the same region
321
- * a full diff would highlight without paying for a line-diff computation on
322
- * every frame.
323
- */
324
- export declare function renderFileDiff(diff: FileDiff): CardRow[];
325
- /** Map a tool's pending-call intent to a card, falling back to the raw call name. */
326
- export declare function cardOfCall(view: ToolCallView | undefined, name: string): ToolCard;
327
- /** Map a tool's result intent to a card, falling back to the model-facing text. */
328
- export declare function cardOfResult(view: ToolResultView | undefined, input: {
329
- readonly name: string;
330
- readonly failed: boolean;
331
- readonly contentLines: readonly string[];
332
- }): ToolCard;
333
225
  //# sourceMappingURL=cards.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../src/cards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,QAAQ,EAOR,YAAY,EACZ,cAAc,EAEf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ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