@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.
- package/.agents/skills/dsh-tui-dogfood/SKILL.md +83 -0
- package/.agents/skills/dsh-tui-dogfood/references/home-state.md +78 -0
- package/.agents/skills/dsh-tui-dogfood/scripts/clone-links.mjs +133 -0
- package/.agents/skills/dsh-tui-dogfood/scripts/run-plugin-from-worktree.sh +417 -0
- package/.agents/skills/dsh-tui-update-models/SKILL.md +121 -0
- package/.agents/skills/dsh-tui-update-models/references/model-wiring.md +162 -0
- package/.agents/skills/dsh-tui-update-models/scripts/dump-model-catalog.mjs +178 -0
- package/README.md +99 -5
- package/lib/agent/present.d.ts.map +1 -1
- package/lib/agent/present.js +2 -1
- package/lib/agent/present.js.map +1 -1
- package/lib/cards/composition.d.ts +68 -0
- package/lib/cards/composition.d.ts.map +1 -0
- package/lib/cards/composition.js +117 -0
- package/lib/cards/composition.js.map +1 -0
- package/lib/cards/presenter.d.ts +23 -0
- package/lib/cards/presenter.d.ts.map +1 -0
- package/lib/cards/presenter.js +394 -0
- package/lib/cards/presenter.js.map +1 -0
- package/lib/cards/preview.d.ts +42 -0
- package/lib/cards/preview.d.ts.map +1 -0
- package/lib/cards/preview.js +51 -0
- package/lib/cards/preview.js.map +1 -0
- package/lib/cards.d.ts +12 -120
- package/lib/cards.d.ts.map +1 -1
- package/lib/cards.js +4 -556
- package/lib/cards.js.map +1 -1
- package/lib/compat/section.d.ts +29 -0
- package/lib/compat/section.d.ts.map +1 -0
- package/lib/compat/section.js +82 -0
- package/lib/compat/section.js.map +1 -0
- package/lib/config.d.ts +27 -2
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +61 -1
- package/lib/config.js.map +1 -1
- package/lib/contracts.d.ts +28 -0
- package/lib/contracts.d.ts.map +1 -1
- package/lib/fold-cursor.d.ts +8 -0
- package/lib/fold-cursor.d.ts.map +1 -1
- package/lib/fold-cursor.js +18 -0
- package/lib/fold-cursor.js.map +1 -1
- package/lib/gates/question-card.d.ts +77 -0
- package/lib/gates/question-card.d.ts.map +1 -0
- package/lib/gates/question-card.js +113 -0
- package/lib/gates/question-card.js.map +1 -0
- package/lib/gates/questions.d.ts +127 -0
- package/lib/gates/questions.d.ts.map +1 -0
- package/lib/gates/questions.js +418 -0
- package/lib/gates/questions.js.map +1 -0
- package/lib/gates.d.ts +1 -113
- package/lib/gates.d.ts.map +1 -1
- package/lib/gates.js +1 -484
- package/lib/gates.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +343 -2602
- package/lib/index.js.map +1 -1
- package/lib/input/action-catalog.d.ts +74 -0
- package/lib/input/action-catalog.d.ts.map +1 -0
- package/lib/input/action-catalog.js +137 -0
- package/lib/input/action-catalog.js.map +1 -0
- package/lib/input/actions.d.ts +5 -81
- package/lib/input/actions.d.ts.map +1 -1
- package/lib/input/actions.js +4 -625
- package/lib/input/actions.js.map +1 -1
- package/lib/input/completion.d.ts +1 -1
- package/lib/input/completion.d.ts.map +1 -1
- package/lib/input/completion.js +2 -1
- package/lib/input/completion.js.map +1 -1
- package/lib/input/file-index.d.ts +40 -0
- package/lib/input/file-index.d.ts.map +1 -0
- package/lib/input/file-index.js +141 -0
- package/lib/input/file-index.js.map +1 -0
- package/lib/input/file-search.d.ts +1 -38
- package/lib/input/file-search.d.ts.map +1 -1
- package/lib/input/file-search.js +1 -487
- package/lib/input/file-search.js.map +1 -1
- package/lib/input/key-press.d.ts +57 -0
- package/lib/input/key-press.d.ts.map +1 -0
- package/lib/input/key-press.js +218 -0
- package/lib/input/key-press.js.map +1 -0
- package/lib/input/keymap-conflicts.d.ts +59 -0
- package/lib/input/keymap-conflicts.d.ts.map +1 -0
- package/lib/input/keymap-conflicts.js +292 -0
- package/lib/input/keymap-conflicts.js.map +1 -0
- package/lib/input/keymap-settings.js +1 -1
- package/lib/input/keymap-settings.js.map +1 -1
- package/lib/input/keymap.d.ts.map +1 -1
- package/lib/input/keymap.js +3 -1
- package/lib/input/keymap.js.map +1 -1
- package/lib/input/workspace-files.d.ts +10 -0
- package/lib/input/workspace-files.d.ts.map +1 -0
- package/lib/input/workspace-files.js +359 -0
- package/lib/input/workspace-files.js.map +1 -0
- package/lib/install-skills.d.ts +20 -0
- package/lib/install-skills.d.ts.map +1 -0
- package/lib/install-skills.js +198 -0
- package/lib/install-skills.js.map +1 -0
- package/lib/keys-command.d.ts +2 -1
- package/lib/keys-command.d.ts.map +1 -1
- package/lib/keys-command.js +2 -1
- package/lib/keys-command.js.map +1 -1
- package/lib/model-list.d.ts +37 -0
- package/lib/model-list.d.ts.map +1 -0
- package/lib/model-list.js +60 -0
- package/lib/model-list.js.map +1 -0
- package/lib/startup.d.ts +8 -0
- package/lib/startup.d.ts.map +1 -1
- package/lib/startup.js +120 -24
- package/lib/startup.js.map +1 -1
- package/lib/subagents.d.ts +7 -3
- package/lib/subagents.d.ts.map +1 -1
- package/lib/subagents.js +28 -4
- package/lib/subagents.js.map +1 -1
- package/lib/surface/appearance-preferences.d.ts +26 -0
- package/lib/surface/appearance-preferences.d.ts.map +1 -0
- package/lib/surface/appearance-preferences.js +139 -0
- package/lib/surface/appearance-preferences.js.map +1 -0
- package/lib/surface/appearance.d.ts +87 -0
- package/lib/surface/appearance.d.ts.map +1 -0
- package/lib/surface/appearance.js +353 -0
- package/lib/surface/appearance.js.map +1 -0
- package/lib/surface/background-work.d.ts +49 -0
- package/lib/surface/background-work.d.ts.map +1 -0
- package/lib/surface/background-work.js +146 -0
- package/lib/surface/background-work.js.map +1 -0
- package/lib/surface/commands.d.ts +80 -0
- package/lib/surface/commands.d.ts.map +1 -0
- package/lib/surface/commands.js +364 -0
- package/lib/surface/commands.js.map +1 -0
- package/lib/surface/modal-input.d.ts +58 -0
- package/lib/surface/modal-input.d.ts.map +1 -0
- package/lib/surface/modal-input.js +237 -0
- package/lib/surface/modal-input.js.map +1 -0
- package/lib/surface/model-choice.d.ts +54 -0
- package/lib/surface/model-choice.d.ts.map +1 -0
- package/lib/surface/model-choice.js +325 -0
- package/lib/surface/model-choice.js.map +1 -0
- package/lib/surface/preset-choice.d.ts +78 -0
- package/lib/surface/preset-choice.d.ts.map +1 -0
- package/lib/surface/preset-choice.js +163 -0
- package/lib/surface/preset-choice.js.map +1 -0
- package/lib/surface/prompt-input.d.ts +97 -0
- package/lib/surface/prompt-input.d.ts.map +1 -0
- package/lib/surface/prompt-input.js +215 -0
- package/lib/surface/prompt-input.js.map +1 -0
- package/lib/surface/prompt-memory.d.ts +76 -0
- package/lib/surface/prompt-memory.d.ts.map +1 -0
- package/lib/surface/prompt-memory.js +167 -0
- package/lib/surface/prompt-memory.js.map +1 -0
- package/lib/surface/session-lifecycle.d.ts +120 -0
- package/lib/surface/session-lifecycle.d.ts.map +1 -0
- package/lib/surface/session-lifecycle.js +321 -0
- package/lib/surface/session-lifecycle.js.map +1 -0
- package/lib/surface/session-picker.d.ts +39 -0
- package/lib/surface/session-picker.d.ts.map +1 -0
- package/lib/surface/session-picker.js +107 -0
- package/lib/surface/session-picker.js.map +1 -0
- package/lib/surface/session-view.d.ts +86 -0
- package/lib/surface/session-view.d.ts.map +1 -0
- package/lib/surface/session-view.js +215 -0
- package/lib/surface/session-view.js.map +1 -0
- package/lib/surface/staged-turns.d.ts +81 -0
- package/lib/surface/staged-turns.d.ts.map +1 -0
- package/lib/surface/staged-turns.js +206 -0
- package/lib/surface/staged-turns.js.map +1 -0
- package/lib/surface/terminal-lifecycle.d.ts +76 -0
- package/lib/surface/terminal-lifecycle.d.ts.map +1 -0
- package/lib/surface/terminal-lifecycle.js +222 -0
- package/lib/surface/terminal-lifecycle.js.map +1 -0
- package/lib/terminal-text/scan.d.ts +44 -0
- package/lib/terminal-text/scan.d.ts.map +1 -0
- package/lib/terminal-text/scan.js +195 -0
- package/lib/terminal-text/scan.js.map +1 -0
- package/lib/terminal-text/sgr.d.ts +32 -0
- package/lib/terminal-text/sgr.d.ts.map +1 -0
- package/lib/terminal-text/sgr.js +203 -0
- package/lib/terminal-text/sgr.js.map +1 -0
- package/lib/terminal-text.d.ts +1 -1
- package/lib/terminal-text.d.ts.map +1 -1
- package/lib/terminal-text.js +2 -379
- package/lib/terminal-text.js.map +1 -1
- package/lib/theme-command.js +2 -1
- package/lib/theme-command.js.map +1 -1
- package/lib/theme-defaults.d.ts +64 -0
- package/lib/theme-defaults.d.ts.map +1 -0
- package/lib/theme-defaults.js +248 -0
- package/lib/theme-defaults.js.map +1 -0
- package/lib/theme-resolver.d.ts +36 -0
- package/lib/theme-resolver.d.ts.map +1 -0
- package/lib/theme-resolver.js +112 -0
- package/lib/theme-resolver.js.map +1 -0
- package/lib/theme-schema.d.ts.map +1 -1
- package/lib/theme-schema.js +3 -2
- package/lib/theme-schema.js.map +1 -1
- package/lib/theme-settings.d.ts +5 -7
- package/lib/theme-settings.d.ts.map +1 -1
- package/lib/theme-settings.js +27 -19
- package/lib/theme-settings.js.map +1 -1
- package/lib/theme-tokens.d.ts +0 -89
- package/lib/theme-tokens.d.ts.map +1 -1
- package/lib/theme-tokens.js +0 -356
- package/lib/theme-tokens.js.map +1 -1
- package/lib/theme.d.ts +1 -1
- package/lib/theme.d.ts.map +1 -1
- package/lib/theme.js +2 -1
- package/lib/theme.js.map +1 -1
- package/lib/tool-display.d.ts.map +1 -1
- package/lib/tool-display.js +2 -1
- package/lib/tool-display.js.map +1 -1
- package/lib/transcript/message-content.d.ts +21 -0
- package/lib/transcript/message-content.d.ts.map +1 -0
- package/lib/transcript/message-content.js +61 -0
- package/lib/transcript/message-content.js.map +1 -0
- package/lib/transcript/tool-calls.d.ts +106 -0
- package/lib/transcript/tool-calls.d.ts.map +1 -0
- package/lib/transcript/tool-calls.js +254 -0
- package/lib/transcript/tool-calls.js.map +1 -0
- package/lib/transcript.d.ts +14 -55
- package/lib/transcript.d.ts.map +1 -1
- package/lib/transcript.js +31 -253
- package/lib/transcript.js.map +1 -1
- package/lib/ui/dock.d.ts +14 -2
- package/lib/ui/dock.d.ts.map +1 -1
- package/lib/ui/dock.js +52 -10
- package/lib/ui/dock.js.map +1 -1
- package/lib/ui/editor.d.ts.map +1 -1
- package/lib/ui/editor.js +2 -1
- package/lib/ui/editor.js.map +1 -1
- package/lib/ui/keymap-picker.d.ts +2 -1
- package/lib/ui/keymap-picker.d.ts.map +1 -1
- package/lib/ui/keymap-picker.js +1 -0
- package/lib/ui/keymap-picker.js.map +1 -1
- package/lib/ui/view/gate-card.d.ts +21 -0
- package/lib/ui/view/gate-card.d.ts.map +1 -0
- package/lib/ui/view/gate-card.js +104 -0
- package/lib/ui/view/gate-card.js.map +1 -0
- package/lib/ui/view/tool-card.d.ts +138 -0
- package/lib/ui/view/tool-card.d.ts.map +1 -0
- package/lib/ui/view/tool-card.js +413 -0
- package/lib/ui/view/tool-card.js.map +1 -0
- package/lib/ui/view/transcript-message.d.ts +62 -0
- package/lib/ui/view/transcript-message.d.ts.map +1 -0
- package/lib/ui/view/transcript-message.js +158 -0
- package/lib/ui/view/transcript-message.js.map +1 -0
- package/lib/ui/view.d.ts +80 -220
- package/lib/ui/view.d.ts.map +1 -1
- package/lib/ui/view.js +81 -675
- package/lib/ui/view.js.map +1 -1
- 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_EAR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AAS,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
|
|
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
|
-
|
|
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
|
-
*
|
|
205
|
+
* Bound a card to its retained rows from the END.
|
|
277
206
|
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
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
|
|
282
|
-
|
|
283
|
-
|
|
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
|
package/lib/cards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../src/cards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../src/cards.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC/D,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,QAAQ,GAAG,SAAS,CA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