@wrongstack/tui 0.284.1 → 0.286.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/dist/app-initial-state.d.ts +28 -0
- package/dist/app-initial-state.d.ts.map +1 -0
- package/dist/app-reducer.d.ts +5 -0
- package/dist/app-reducer.d.ts.map +1 -0
- package/dist/app-state.d.ts +1841 -0
- package/dist/app-state.d.ts.map +1 -0
- package/dist/app.d.ts +593 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/clipboard.d.ts +2 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/components/agents-monitor.d.ts +114 -0
- package/dist/components/agents-monitor.d.ts.map +1 -0
- package/dist/components/animation-style.d.ts +51 -0
- package/dist/components/animation-style.d.ts.map +1 -0
- package/dist/components/audit-panel.d.ts +9 -0
- package/dist/components/audit-panel.d.ts.map +1 -0
- package/dist/components/auth-panel-model.d.ts +150 -0
- package/dist/components/auth-panel-model.d.ts.map +1 -0
- package/dist/components/auth-panel.d.ts +8 -0
- package/dist/components/auth-panel.d.ts.map +1 -0
- package/dist/components/autonomy-picker.d.ts +15 -0
- package/dist/components/autonomy-picker.d.ts.map +1 -0
- package/dist/components/brain-decision-prompt.d.ts +28 -0
- package/dist/components/brain-decision-prompt.d.ts.map +1 -0
- package/dist/components/brain-panel-model.d.ts +107 -0
- package/dist/components/brain-panel-model.d.ts.map +1 -0
- package/dist/components/brain-panel.d.ts +22 -0
- package/dist/components/brain-panel.d.ts.map +1 -0
- package/dist/components/checkpoint-timeline.d.ts +19 -0
- package/dist/components/checkpoint-timeline.d.ts.map +1 -0
- package/dist/components/confirm-prompt.d.ts +26 -0
- package/dist/components/confirm-prompt.d.ts.map +1 -0
- package/dist/components/continue-confirm-panel.d.ts +47 -0
- package/dist/components/continue-confirm-panel.d.ts.map +1 -0
- package/dist/components/coordinator-panel.d.ts +11 -0
- package/dist/components/coordinator-panel.d.ts.map +1 -0
- package/dist/components/design-picker.d.ts +14 -0
- package/dist/components/design-picker.d.ts.map +1 -0
- package/dist/components/enhance-panel.d.ts +36 -0
- package/dist/components/enhance-panel.d.ts.map +1 -0
- package/dist/components/esc-confirm-prompt.d.ts +17 -0
- package/dist/components/esc-confirm-prompt.d.ts.map +1 -0
- package/dist/components/f-key-picker.d.ts +13 -0
- package/dist/components/f-key-picker.d.ts.map +1 -0
- package/dist/components/file-picker.d.ts +8 -0
- package/dist/components/file-picker.d.ts.map +1 -0
- package/dist/components/fleet-monitor.d.ts +60 -0
- package/dist/components/fleet-monitor.d.ts.map +1 -0
- package/dist/components/fleet-panel.d.ts +69 -0
- package/dist/components/fleet-panel.d.ts.map +1 -0
- package/dist/components/goal-panel.d.ts +17 -0
- package/dist/components/goal-panel.d.ts.map +1 -0
- package/dist/components/help-overlay.d.ts +27 -0
- package/dist/components/help-overlay.d.ts.map +1 -0
- package/dist/components/help-panel.d.ts +16 -0
- package/dist/components/help-panel.d.ts.map +1 -0
- package/dist/components/history/assistant.d.ts +61 -0
- package/dist/components/history/assistant.d.ts.map +1 -0
- package/dist/components/history/banner.d.ts +13 -0
- package/dist/components/history/banner.d.ts.map +1 -0
- package/dist/components/history/code-block.d.ts +217 -0
- package/dist/components/history/code-block.d.ts.map +1 -0
- package/dist/components/history/entry.d.ts +19 -0
- package/dist/components/history/entry.d.ts.map +1 -0
- package/dist/components/history/index.d.ts +21 -0
- package/dist/components/history/index.d.ts.map +1 -0
- package/dist/components/history/replay.d.ts +44 -0
- package/dist/components/history/replay.d.ts.map +1 -0
- package/dist/components/history/types.d.ts +146 -0
- package/dist/components/history/types.d.ts.map +1 -0
- package/dist/components/history/utils.d.ts +65 -0
- package/dist/components/history/utils.d.ts.map +1 -0
- package/dist/components/history.d.ts +2 -0
- package/dist/components/history.d.ts.map +1 -0
- package/dist/components/input.d.ts +57 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/kanban-panel.d.ts +7 -0
- package/dist/components/kanban-panel.d.ts.map +1 -0
- package/dist/components/key-hint-bar.d.ts +31 -0
- package/dist/components/key-hint-bar.d.ts.map +1 -0
- package/dist/components/live-activity-strip.d.ts +39 -0
- package/dist/components/live-activity-strip.d.ts.map +1 -0
- package/dist/components/mailbox-panel.d.ts +40 -0
- package/dist/components/mailbox-panel.d.ts.map +1 -0
- package/dist/components/mcp-picker.d.ts +18 -0
- package/dist/components/mcp-picker.d.ts.map +1 -0
- package/dist/components/mode-picker.d.ts +17 -0
- package/dist/components/mode-picker.d.ts.map +1 -0
- package/dist/components/model-picker.d.ts +37 -0
- package/dist/components/model-picker.d.ts.map +1 -0
- package/dist/components/phase-monitor.d.ts +33 -0
- package/dist/components/phase-monitor.d.ts.map +1 -0
- package/dist/components/phase-panel.d.ts +22 -0
- package/dist/components/phase-panel.d.ts.map +1 -0
- package/dist/components/plan-panel.d.ts +17 -0
- package/dist/components/plan-panel.d.ts.map +1 -0
- package/dist/components/plugin-picker.d.ts +22 -0
- package/dist/components/plugin-picker.d.ts.map +1 -0
- package/dist/components/process-list.d.ts +14 -0
- package/dist/components/process-list.d.ts.map +1 -0
- package/dist/components/project-picker.d.ts +21 -0
- package/dist/components/project-picker.d.ts.map +1 -0
- package/dist/components/prompt-picker.d.ts +31 -0
- package/dist/components/prompt-picker.d.ts.map +1 -0
- package/dist/components/provider-colors.d.ts +40 -0
- package/dist/components/provider-colors.d.ts.map +1 -0
- package/dist/components/queue-panel.d.ts +16 -0
- package/dist/components/queue-panel.d.ts.map +1 -0
- package/dist/components/resume-picker.d.ts +16 -0
- package/dist/components/resume-picker.d.ts.map +1 -0
- package/dist/components/scrollable-history.d.ts +60 -0
- package/dist/components/scrollable-history.d.ts.map +1 -0
- package/dist/components/sdd-board-overlay.d.ts +15 -0
- package/dist/components/sdd-board-overlay.d.ts.map +1 -0
- package/dist/components/send-mode-picker.d.ts +64 -0
- package/dist/components/send-mode-picker.d.ts.map +1 -0
- package/dist/components/sessions-panel.d.ts +46 -0
- package/dist/components/sessions-panel.d.ts.map +1 -0
- package/dist/components/settings-picker.d.ts +387 -0
- package/dist/components/settings-picker.d.ts.map +1 -0
- package/dist/components/shadow-panel.d.ts +13 -0
- package/dist/components/shadow-panel.d.ts.map +1 -0
- package/dist/components/shell-command-warning.d.ts +9 -0
- package/dist/components/shell-command-warning.d.ts.map +1 -0
- package/dist/components/slash-menu.d.ts +9 -0
- package/dist/components/slash-menu.d.ts.map +1 -0
- package/dist/components/status-bar.d.ts +378 -0
- package/dist/components/status-bar.d.ts.map +1 -0
- package/dist/components/statusline-picker.d.ts +55 -0
- package/dist/components/statusline-picker.d.ts.map +1 -0
- package/dist/components/suggestions.d.ts +9 -0
- package/dist/components/suggestions.d.ts.map +1 -0
- package/dist/components/todos-monitor.d.ts +13 -0
- package/dist/components/todos-monitor.d.ts.map +1 -0
- package/dist/components/tools-picker.d.ts +20 -0
- package/dist/components/tools-picker.d.ts.map +1 -0
- package/dist/components/worktree-monitor.d.ts +23 -0
- package/dist/components/worktree-monitor.d.ts.map +1 -0
- package/dist/components/worktree-panel.d.ts +21 -0
- package/dist/components/worktree-panel.d.ts.map +1 -0
- package/dist/f-key-panels.d.ts +46 -0
- package/dist/f-key-panels.d.ts.map +1 -0
- package/dist/file-search.d.ts +3 -0
- package/dist/file-search.d.ts.map +1 -0
- package/dist/fn-keys.d.ts +20 -0
- package/dist/fn-keys.d.ts.map +1 -0
- package/dist/git-info.d.ts +20 -0
- package/dist/git-info.d.ts.map +1 -0
- package/dist/heap-watchdog.d.ts +41 -0
- package/dist/heap-watchdog.d.ts.map +1 -0
- package/dist/highlight.d.ts +30 -0
- package/dist/highlight.d.ts.map +1 -0
- package/dist/hit-test.d.ts +75 -0
- package/dist/hit-test.d.ts.map +1 -0
- package/dist/hooks/fleet-chat-coalescer.d.ts +32 -0
- package/dist/hooks/fleet-chat-coalescer.d.ts.map +1 -0
- package/dist/hooks/use-auth-panel.d.ts +38 -0
- package/dist/hooks/use-auth-panel.d.ts.map +1 -0
- package/dist/hooks/use-autonomous-coordinator.d.ts +21 -0
- package/dist/hooks/use-autonomous-coordinator.d.ts.map +1 -0
- package/dist/hooks/use-brain-events.d.ts +7 -0
- package/dist/hooks/use-brain-events.d.ts.map +1 -0
- package/dist/hooks/use-brain-panel.d.ts +43 -0
- package/dist/hooks/use-brain-panel.d.ts.map +1 -0
- package/dist/hooks/use-director-fleet-bridge.d.ts +31 -0
- package/dist/hooks/use-director-fleet-bridge.d.ts.map +1 -0
- package/dist/hooks/use-file-search.d.ts +42 -0
- package/dist/hooks/use-file-search.d.ts.map +1 -0
- package/dist/hooks/use-input-history-persistence.d.ts +14 -0
- package/dist/hooks/use-input-history-persistence.d.ts.map +1 -0
- package/dist/hooks/use-mode-picker.d.ts +15 -0
- package/dist/hooks/use-mode-picker.d.ts.map +1 -0
- package/dist/hooks/use-model-pick.d.ts +34 -0
- package/dist/hooks/use-model-pick.d.ts.map +1 -0
- package/dist/hooks/use-paste-handling.d.ts +30 -0
- package/dist/hooks/use-paste-handling.d.ts.map +1 -0
- package/dist/hooks/use-picker-keys.d.ts +72 -0
- package/dist/hooks/use-picker-keys.d.ts.map +1 -0
- package/dist/hooks/use-prompt-picker.d.ts +28 -0
- package/dist/hooks/use-prompt-picker.d.ts.map +1 -0
- package/dist/hooks/use-queue-manager.d.ts +26 -0
- package/dist/hooks/use-queue-manager.d.ts.map +1 -0
- package/dist/hooks/use-statusline-hidden-sync.d.ts +14 -0
- package/dist/hooks/use-statusline-hidden-sync.d.ts.map +1 -0
- package/dist/hooks/use-statusline-state.d.ts +44 -0
- package/dist/hooks/use-statusline-state.d.ts.map +1 -0
- package/dist/hooks/use-stream-chip-expiration.d.ts +25 -0
- package/dist/hooks/use-stream-chip-expiration.d.ts.map +1 -0
- package/dist/hooks/use-subagent-events.d.ts +16 -0
- package/dist/hooks/use-subagent-events.d.ts.map +1 -0
- package/dist/hooks/use-token-counter-refresh.d.ts +30 -0
- package/dist/hooks/use-token-counter-refresh.d.ts.map +1 -0
- package/dist/hooks/use-tui-controllers.d.ts +37 -0
- package/dist/hooks/use-tui-controllers.d.ts.map +1 -0
- package/dist/hooks/use-tui-event-bridge.d.ts +29 -0
- package/dist/hooks/use-tui-event-bridge.d.ts.map +1 -0
- package/dist/hooks/use-working-dir-chip.d.ts +8 -0
- package/dist/hooks/use-working-dir-chip.d.ts.map +1 -0
- package/dist/index.d.ts +12 -910
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4348 -2974
- package/dist/index.js.map +7 -1
- package/dist/ink.d.ts +20 -0
- package/dist/ink.d.ts.map +1 -0
- package/dist/input-editing.d.ts +76 -0
- package/dist/input-editing.d.ts.map +1 -0
- package/dist/input-tokens.d.ts +65 -0
- package/dist/input-tokens.d.ts.map +1 -0
- package/dist/kill-slash.d.ts +3 -0
- package/dist/kill-slash.d.ts.map +1 -0
- package/dist/markdown-table.d.ts +45 -0
- package/dist/markdown-table.d.ts.map +1 -0
- package/dist/markdown.d.ts +47 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/mouse.d.ts +73 -0
- package/dist/mouse.d.ts.map +1 -0
- package/dist/on-panel-open.d.ts +62 -0
- package/dist/on-panel-open.d.ts.map +1 -0
- package/dist/paste-accumulator.d.ts +19 -0
- package/dist/paste-accumulator.d.ts.map +1 -0
- package/dist/ps-slash.d.ts +7 -0
- package/dist/ps-slash.d.ts.map +1 -0
- package/dist/queue-slash.d.ts +24 -0
- package/dist/queue-slash.d.ts.map +1 -0
- package/dist/reducers/fleet.d.ts +16 -0
- package/dist/reducers/fleet.d.ts.map +1 -0
- package/dist/reducers/helpers.d.ts +38 -0
- package/dist/reducers/helpers.d.ts.map +1 -0
- package/dist/rehydrate-history.d.ts +40 -0
- package/dist/rehydrate-history.d.ts.map +1 -0
- package/dist/run-tui.d.ts +522 -0
- package/dist/run-tui.d.ts.map +1 -0
- package/dist/sdd-lifecycle-entry.d.ts +18 -0
- package/dist/sdd-lifecycle-entry.d.ts.map +1 -0
- package/dist/slash-command-search.d.ts +10 -0
- package/dist/slash-command-search.d.ts.map +1 -0
- package/dist/steering-preamble.d.ts +25 -0
- package/dist/steering-preamble.d.ts.map +1 -0
- package/dist/submit-history.d.ts +17 -0
- package/dist/submit-history.d.ts.map +1 -0
- package/dist/terminal-title.d.ts +12 -0
- package/dist/terminal-title.d.ts.map +1 -0
- package/dist/theme.d.ts +91 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/thinking-word.d.ts +26 -0
- package/dist/thinking-word.d.ts.map +1 -0
- package/dist/tool-glyph.d.ts +18 -0
- package/dist/tool-glyph.d.ts.map +1 -0
- package/package.json +8 -9
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type Lang, type Token } from '../../highlight.js';
|
|
3
|
+
import { type DiffLineRow, type DiffPreview } from '@wrongstack/tools/tool-diff';
|
|
4
|
+
export type { DiffLineKind, DiffLineRow, DiffPreview } from '@wrongstack/tools/tool-diff';
|
|
5
|
+
/**
|
|
6
|
+
* A parsed diff paired with the file it belongs to. Used when a tool
|
|
7
|
+
* produces diffs for several files at once (currently `replace`); each
|
|
8
|
+
* `DiffFilePreview` renders as one labeled `DiffFileBlock`.
|
|
9
|
+
*/
|
|
10
|
+
export interface DiffFilePreview {
|
|
11
|
+
path: string;
|
|
12
|
+
preview: DiffPreview;
|
|
13
|
+
}
|
|
14
|
+
/** Max code-block lines rendered before a "+N more" footer. */
|
|
15
|
+
export declare const MAX_CODE_LINES = 80;
|
|
16
|
+
/**
|
|
17
|
+
* Default cap on rows surfaced by {@link parseUnifiedDiff} for the main
|
|
18
|
+
* Update tool diff view. Previously hardcoded to `12`, which silently
|
|
19
|
+
* truncated larger diffs and pushed the rest into a `… +N -M hidden`
|
|
20
|
+
* footer. The Update tool runs in a scrollable history surface, so a
|
|
21
|
+
* long diff is a legitimate read — let it render in full. Callers that
|
|
22
|
+
* still need a hard cap (e.g. the approval dialog's tighter box) pass
|
|
23
|
+
* their own number explicitly to `parseUnifiedDiff`; this default is
|
|
24
|
+
* for the unbounded read-everything path.
|
|
25
|
+
*
|
|
26
|
+
* Set to `Number.POSITIVE_INFINITY` so `parseUnifiedDiff`'s `if (all.length
|
|
27
|
+
* <= maxLines)` branch always matches and the slice/footer machinery
|
|
28
|
+
* becomes a no-op. The `DIFF_LINE_SAFETY_CAP` below still bounds
|
|
29
|
+
* individual row text length, which protects against pathological
|
|
30
|
+
* one-liners (minified bundles, huge JSON blobs).
|
|
31
|
+
*/
|
|
32
|
+
export declare const DIFF_MAX_LINES: number;
|
|
33
|
+
/** Syntax-highlighted, framed code block. */
|
|
34
|
+
export declare function CodeBlock({ code, lang, contentWidth, }: {
|
|
35
|
+
code: string;
|
|
36
|
+
lang: Lang;
|
|
37
|
+
contentWidth: number;
|
|
38
|
+
}): React.ReactElement;
|
|
39
|
+
/**
|
|
40
|
+
* Minimum number of files before a summary footer is rendered above the
|
|
41
|
+
* per-file blocks. Below this threshold each file's own `… +N -M hidden`
|
|
42
|
+
* footer carries enough signal; above it, a single aggregate line keeps
|
|
43
|
+
* the screen from being drowned in per-file tail lines.
|
|
44
|
+
*
|
|
45
|
+
* This is the default when no user-tunable value is supplied. The
|
|
46
|
+
* settings picker exposes `MULTI_DIFF_SUMMARY_THRESHOLD_PRESETS` so
|
|
47
|
+
* users can raise the cutoff (e.g. for very wide terminals) or lower
|
|
48
|
+
* it (e.g. for tiny scrollback), or set it to 0 to suppress the
|
|
49
|
+
* summary entirely.
|
|
50
|
+
*/
|
|
51
|
+
export declare const MULTI_DIFF_SUMMARY_THRESHOLD = 5;
|
|
52
|
+
/**
|
|
53
|
+
* Aggregate stats across a list of per-file diffs — used to print a
|
|
54
|
+
* single summary line at the top of a multi-file diff view when there
|
|
55
|
+
* are enough files to make the rollup useful.
|
|
56
|
+
*/
|
|
57
|
+
export interface MultiDiffSummary {
|
|
58
|
+
fileCount: number;
|
|
59
|
+
added: number;
|
|
60
|
+
removed: number;
|
|
61
|
+
hiddenAdded: number;
|
|
62
|
+
hiddenRemoved: number;
|
|
63
|
+
/** Number of files whose preview was truncated by the per-file cap. */
|
|
64
|
+
truncatedFiles: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Sum the totals of a list of per-file diff previews. Files that were
|
|
68
|
+
* parsed but have no rows (e.g. entirely empty after the no-op skip) are
|
|
69
|
+
* excluded from the rollup so the summary reflects what the user will
|
|
70
|
+
* actually see rendered below.
|
|
71
|
+
*/
|
|
72
|
+
export declare function summarizeMultiFileDiffs(items: DiffFilePreview[]): MultiDiffSummary;
|
|
73
|
+
/**
|
|
74
|
+
* Format a multi-file diff summary as a single dim italic line, suitable
|
|
75
|
+
* for rendering above the per-file blocks. Mirrors the per-file footer's
|
|
76
|
+
* `… +N -M hidden` shape so a reader who has seen the footer recognises
|
|
77
|
+
* the format. Returns `null` when there's nothing useful to surface
|
|
78
|
+
* (no files, or below the user's threshold where the per-file footer
|
|
79
|
+
* already covers the rollup).
|
|
80
|
+
*
|
|
81
|
+
* @param threshold User-tunable cutoff. Pass `MULTI_DIFF_SUMMARY_THRESHOLD`
|
|
82
|
+
* for the default behaviour, `0` to suppress the summary entirely
|
|
83
|
+
* (always returns null), or a positive number to set a custom cutoff.
|
|
84
|
+
* A negative value is treated as "use default" so callers can pass an
|
|
85
|
+
* `undefined`-coerced settings value without a separate branch.
|
|
86
|
+
*/
|
|
87
|
+
export declare function formatMultiDiffSummary(summary: MultiDiffSummary, threshold?: number): string | null;
|
|
88
|
+
/**
|
|
89
|
+
* One labeled diff — used to render a per-file block inside multi-file
|
|
90
|
+
* diff views (e.g. when `replace` modifies several files). The path label
|
|
91
|
+
* is rendered dim and italic so the file boundary is visible without
|
|
92
|
+
* competing with the add/remove wash.
|
|
93
|
+
*/
|
|
94
|
+
export declare function DiffFileBlock({ path, preview, useColor, contentWidth, }: {
|
|
95
|
+
path: string;
|
|
96
|
+
preview: DiffPreview;
|
|
97
|
+
/** Pass-through to {@link DiffBlock}. See that component for details. */
|
|
98
|
+
useColor?: boolean | undefined;
|
|
99
|
+
/** Pass-through to {@link DiffBlock}. See that component for details. */
|
|
100
|
+
contentWidth?: number | undefined;
|
|
101
|
+
}): React.ReactElement;
|
|
102
|
+
/**
|
|
103
|
+
* Human-readable change-size line for a diff — `Added N lines, removed M
|
|
104
|
+
* lines` (Claude Code phrasing). Omits the zero side; returns `null` when
|
|
105
|
+
* nothing changed so callers can skip the line entirely.
|
|
106
|
+
*/
|
|
107
|
+
export declare function formatDiffStats(added: number, removed: number): string | null;
|
|
108
|
+
/**
|
|
109
|
+
* Return the token list to render on a diff wash (`diffAddBg` /
|
|
110
|
+
* `diffDelBg`). When `onWash` is false the input is returned unchanged —
|
|
111
|
+
* plain-background rendering keeps the conventional dim/gray comment
|
|
112
|
+
* look and there is no contrast reason to intervene.
|
|
113
|
+
*
|
|
114
|
+
* When `onWash` is true, comment tokens (color `gray`, conventionally
|
|
115
|
+
* `dim: true`) are promoted to a brighter foreground (`grayBright`) and
|
|
116
|
+
* lose their dim flag. The diff wash is dark enough that `dim gray`
|
|
117
|
+
* (`pastel.gray`) falls below WCAG AA contrast on either `theme.diffAddBg`
|
|
118
|
+
* (ratio ≈ 2.91) or `theme.diffDelBg` (ratio ≈ 3.47) and reads as near-
|
|
119
|
+
* invisible noise; `grayBright` clears both wash backgrounds (≥ 4.5) and
|
|
120
|
+
* keeps the comment visually secondary without becoming unreadable.
|
|
121
|
+
* Non-comment tokens pass through unchanged so the rest of the line keeps
|
|
122
|
+
* its existing syntax palette on the wash.
|
|
123
|
+
*
|
|
124
|
+
* Exported for unit testing — `renderTokens` calls it before mapping to
|
|
125
|
+
* `<Text>` elements so the override logic itself stays a pure function.
|
|
126
|
+
*/
|
|
127
|
+
export declare function applyWashTokens(tokens: Token[], onWash: boolean): Token[];
|
|
128
|
+
export declare function DiffBlock({ rows, hidden, added, removed, hiddenAdded, hiddenRemoved, useColor, lang, showStats, contentWidth, }: {
|
|
129
|
+
rows: DiffLineRow[];
|
|
130
|
+
hidden: number;
|
|
131
|
+
/**
|
|
132
|
+
* Total lines added across the whole diff (not just the visible slice).
|
|
133
|
+
* Surfaced in the `⎿ Added N lines, removed M lines` stats line so the
|
|
134
|
+
* reader knows the change size even when the body is truncated.
|
|
135
|
+
*/
|
|
136
|
+
added?: number | undefined;
|
|
137
|
+
/** Total lines removed across the whole diff (not just the visible slice). */
|
|
138
|
+
removed?: number | undefined;
|
|
139
|
+
hiddenAdded?: number | undefined;
|
|
140
|
+
hiddenRemoved?: number | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* When true (default), added/removed rows get a dark green/maroon
|
|
143
|
+
* background wash (Claude Code style) with normal-brightness,
|
|
144
|
+
* syntax-highlighted foreground text. When false, only the `+`/`-`
|
|
145
|
+
* markers get colored (bright green/red, bold) so the diff stays
|
|
146
|
+
* readable on terminals that don't support truecolor backgrounds
|
|
147
|
+
* (TERM=xterm, `NO_COLOR=1`, etc.). Pass `theme.supportsBackground`
|
|
148
|
+
* from the entry-point.
|
|
149
|
+
*/
|
|
150
|
+
useColor?: boolean | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* Syntax-highlight language for line bodies (derive from the touched
|
|
153
|
+
* file's extension via `langFromPath`). `plain` disables highlighting.
|
|
154
|
+
*/
|
|
155
|
+
lang?: Lang | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* Render the leading `⎿ Added N lines, removed M lines` stats line.
|
|
158
|
+
* Callers that print their own header/stats (e.g. the Update(path)
|
|
159
|
+
* entry header) pass `false` to avoid the duplicate.
|
|
160
|
+
*/
|
|
161
|
+
showStats?: boolean | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* Terminal width available to this block. Line bodies longer than the
|
|
164
|
+
* remaining budget hard-wrap onto continuation rows (blank gutter, blank
|
|
165
|
+
* marker cell, same background wash) so the full line content is always
|
|
166
|
+
* visible without ever flowing under the gutter. When omitted, wrapping
|
|
167
|
+
* falls back to a 100-char budget.
|
|
168
|
+
*/
|
|
169
|
+
contentWidth?: number | undefined;
|
|
170
|
+
}): React.ReactElement;
|
|
171
|
+
/**
|
|
172
|
+
* Parse a unified-diff string into a {@link DiffPreview}. Thin wrapper over the
|
|
173
|
+
* shared, single-source-of-truth `parseUnifiedDiffPreview` in
|
|
174
|
+
* @wrongstack/tools/tool-diff (which the WebUI and HQ also read). Kept as a
|
|
175
|
+
* local export so this module's many callers and tests are unchanged.
|
|
176
|
+
*/
|
|
177
|
+
export declare function parseUnifiedDiff(diff: string, maxLines: number): DiffPreview;
|
|
178
|
+
/**
|
|
179
|
+
* Pull a unified-diff string out of a tool's JSON output, then turn it
|
|
180
|
+
* into a small, structured preview suitable for colour-coded rendering.
|
|
181
|
+
*/
|
|
182
|
+
export declare function extractDiffPreview(toolName: string, output: string | undefined, input?: unknown | undefined): DiffPreview | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Pull one diff preview per file from a `replace` tool result. Each entry
|
|
185
|
+
* has a `path` (best-effort: `results[i].path`, falling back to the input
|
|
186
|
+
* argument when every result is for the same file) and a `preview` ready
|
|
187
|
+
* for `DiffFileBlock` / `DiffBlock` rendering.
|
|
188
|
+
*
|
|
189
|
+
* Returns `undefined` when no per-file diff is recoverable (e.g. an empty
|
|
190
|
+
* `results` array, no diff fields, or the result isn't a JSON object).
|
|
191
|
+
*
|
|
192
|
+
* Note: For a single entry point that handles `replace`, `diff`, and
|
|
193
|
+
* `patch` (the three tools whose output can span multiple files), use
|
|
194
|
+
* {@link extractMultiFileDiffs} instead — this function is kept for the
|
|
195
|
+
* narrower replace-specific test cases.
|
|
196
|
+
*/
|
|
197
|
+
export declare function extractReplaceDiffs(toolName: string, output: string | undefined, input?: unknown | undefined): DiffFilePreview[] | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Pull a list of per-file diffs from a tool result that may span multiple
|
|
200
|
+
* files. Handles:
|
|
201
|
+
*
|
|
202
|
+
* - `replace`: JSON `{ results: [{ path, diff }, …] }` (path per result,
|
|
203
|
+
* fallback to the input path when the result omits one).
|
|
204
|
+
* - `diff`: JSON `{ diff: string }` where `diff` is a git-style multi-file
|
|
205
|
+
* unified diff (split on `diff --git` headers).
|
|
206
|
+
* - `patch`: either JSON `{ diff: string, files: string[] }` or a raw
|
|
207
|
+
* unified-diff string (split on `diff --git` headers, falling back to
|
|
208
|
+
* `--- a/<path>` if no `diff --git` is present).
|
|
209
|
+
*
|
|
210
|
+
* Returns `undefined` when the tool isn't multi-file capable, the output
|
|
211
|
+
* is missing/unparseable, or no per-file diff is recoverable. Returns an
|
|
212
|
+
* empty array (not undefined) when the output parses but every entry has
|
|
213
|
+
* an empty diff after trimming — the caller treats both as "nothing to
|
|
214
|
+
* render" but the distinction is useful in tests.
|
|
215
|
+
*/
|
|
216
|
+
export declare function extractMultiFileDiffs(toolName: string, output: string | undefined, input?: unknown | undefined): DiffFilePreview[] | undefined;
|
|
217
|
+
//# sourceMappingURL=code-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../src/components/history/code-block.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,KAAK,IAAI,EAET,KAAK,KAAK,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,WAAW,EAEjB,MAAM,6BAA6B,CAAC;AAarC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1F;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,CAAC;CACtB;AAID,+DAA+D;AAC/D,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,QAA2B,CAAC;AAuDvD,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,YAAY,GACb,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IA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,MAAM,EAChB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAC1B,eAAe,EAAE,GAAG,SAAS,CAa/B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type TodoItem } from '@wrongstack/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { HistoryEntry } from './types.js';
|
|
4
|
+
export declare const Entry: React.MemoExoticComponent<({ entry, termWidth, setSuggestions, autonomyMode, multiDiffSummaryThreshold, todos, }: {
|
|
5
|
+
entry: HistoryEntry;
|
|
6
|
+
termWidth: number;
|
|
7
|
+
/** Store parsed next steps in the shared suggestion store so /next 1 works. */
|
|
8
|
+
setSuggestions?: ((steps: string[]) => void) | undefined;
|
|
9
|
+
/** Current autonomy mode — when 'auto', first step shows an auto marker. */
|
|
10
|
+
autonomyMode?: string | undefined;
|
|
11
|
+
/** User-tunable cutoff for the multi-file diff summary footer. Passes
|
|
12
|
+
* through to `formatMultiDiffSummary`; `undefined` means "use default". */
|
|
13
|
+
multiDiffSummaryThreshold?: number | undefined;
|
|
14
|
+
/** Live todo list. When non-empty (pending/in_progress), the NEXT STEPS
|
|
15
|
+
* panel is hidden and the store is not written — same rule as the host
|
|
16
|
+
* callback (b0970387), so the two paths agree. */
|
|
17
|
+
todos?: readonly TodoItem[] | undefined;
|
|
18
|
+
}) => React.ReactElement>;
|
|
19
|
+
//# sourceMappingURL=entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../src/components/history/entry.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAA6B,MAAM,OAAO,CAAC;AAgBlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAkD/C,eAAO,MAAM,KAAK,oHAOf;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACzD,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;gFAC4E;IAC5E,yBAAyB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C;;uDAEmD;IACnD,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,CAAC;CACzC,KAAG,KAAK,CAAC,YAAY,CAkgBpB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { HistoryProps } from './types.js';
|
|
3
|
+
export type { HistoryEntry, HistoryProps } from './types.js';
|
|
4
|
+
export type { BodySegment } from './types.js';
|
|
5
|
+
export { Banner } from './banner.js';
|
|
6
|
+
export { CodeBlock, DiffBlock, DiffFileBlock, type DiffFilePreview, type DiffLineKind, type DiffLineRow, type DiffPreview, type MultiDiffSummary, MULTI_DIFF_SUMMARY_THRESHOLD, extractDiffPreview, extractMultiFileDiffs, extractReplaceDiffs, formatDiffStats, formatMultiDiffSummary, parseUnifiedDiff, summarizeMultiFileDiffs, } from './code-block.js';
|
|
7
|
+
export { Entry } from './entry.js';
|
|
8
|
+
export { MESSAGE_PANEL_BORDER_WIDTH, MESSAGE_PANEL_CHROME_WIDTH, MESSAGE_PANEL_MARGIN, AssistantBody, AssistantTail, assistantContentWidth, assistantTailRows, splitFencedBlocks } from './assistant.js';
|
|
9
|
+
export { shortenPath, previewArgs, previewOutput, fmtTok, fmtDuration, fmtBytes, truncMid, stringOf, numOf, tryParseJson, scanNumberedRange, countLines, firstNonEmpty, formatMatchHit, formatToolArgs, formatToolOutput, formatToolVisualOutput, type ToolVisualLine, type ToolVisualLineKind, ToolOutputLines, ToolStreamBox, streamBoxRows, MAX_STREAM_DISPLAY_CHARS, tailForDisplay, } from './utils.js';
|
|
10
|
+
/**
|
|
11
|
+
* History component — renders committed entries via <Static> so they
|
|
12
|
+
* flow into terminal scrollback, plus a live streaming assistant tail.
|
|
13
|
+
*
|
|
14
|
+
* Wrapped in `React.memo` so keystrokes in the input buffer (which
|
|
15
|
+
* change `state.buffer`/`state.cursor` in the same reducer) don't
|
|
16
|
+
* trigger an expensive full-history re-render. All props are either
|
|
17
|
+
* primitives or stable reducer references, so default shallow
|
|
18
|
+
* comparison is sufficient.
|
|
19
|
+
*/
|
|
20
|
+
export declare const History: React.MemoExoticComponent<({ entries, generation, streamingText, toolStream, setSuggestions, autonomyMode, multiDiffSummaryThreshold, todos }: HistoryProps) => React.ReactElement>;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/history/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACzM,OAAO,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,eAAe,EACf,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,cAAc,GACf,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,iJAA6I,YAAY,KAAG,KAAK,CAAC,YAAY,CAkDhM,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { SessionEvent } from '@wrongstack/core';
|
|
2
|
+
import type { HistoryEntry } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Render a SessionEvent back into a TUI HistoryEntry so a resumed session
|
|
5
|
+
* displays exactly what the user saw during live interaction.
|
|
6
|
+
*
|
|
7
|
+
* ## Entry mapping
|
|
8
|
+
*
|
|
9
|
+
* | Event type | HistoryEntry kind |
|
|
10
|
+
* |--------------------------|-------------------|
|
|
11
|
+
* | `user_input` | `user` |
|
|
12
|
+
* | `llm_response` | `assistant` |
|
|
13
|
+
* | `tool_use` + `tool_result` | `tool` (paired) |
|
|
14
|
+
* | `tool_call_start`/`tool_call_end` | `tool` |
|
|
15
|
+
* | `compaction` | `info` |
|
|
16
|
+
* | `error` | `error` |
|
|
17
|
+
* | `provider_retry` | `warn` |
|
|
18
|
+
* | `provider_error` | `error` |
|
|
19
|
+
* | `checkpoint` | `info` |
|
|
20
|
+
* | `agent_spawned`/`agent_stopped` | `subagent` |
|
|
21
|
+
* | `agent_error` | `subagent` |
|
|
22
|
+
* | `mode_changed` | `info` |
|
|
23
|
+
* | `skill_activated`/`skill_deactivated` | `info` |
|
|
24
|
+
* | `message_truncated` | `warn` |
|
|
25
|
+
*
|
|
26
|
+
* ## Non-resumable events (subagent transcripts)
|
|
27
|
+
*
|
|
28
|
+
* Subagent events (`agent_spawned`, `agent_stopped`, `agent_error`) are
|
|
29
|
+
* rendered as `subagent` entries in the main TUI history but the full
|
|
30
|
+
* subagent tool-call details live in per-subagent JSONL files. The main
|
|
31
|
+
* session only holds the lifecycle markers.
|
|
32
|
+
*
|
|
33
|
+
* ## Compaction events
|
|
34
|
+
*
|
|
35
|
+
* Compaction boundaries are rendered as `info` entries showing how many
|
|
36
|
+
* tokens were collapsed. This keeps the display neat without pretending
|
|
37
|
+
* the full verbose context never existed.
|
|
38
|
+
*
|
|
39
|
+
* @param events Parsed SessionEvent[] from session JSONL
|
|
40
|
+
* @param startId Starting id counter for the generated entries
|
|
41
|
+
* @returns Ordered HistoryEntry[] ready for display
|
|
42
|
+
*/
|
|
43
|
+
export declare function replaySessionEvents(events: SessionEvent[], startId: number): HistoryEntry[];
|
|
44
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/components/history/replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EAAE,EACtB,OAAO,EAAE,MAAM,GACd,YAAY,EAAE,CAgChB"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { TodoItem } from '@wrongstack/core';
|
|
2
|
+
import type { Lang } from '../../highlight.js';
|
|
3
|
+
export type HistoryEntry = {
|
|
4
|
+
id: number;
|
|
5
|
+
kind: 'user';
|
|
6
|
+
text: string;
|
|
7
|
+
queued?: boolean | undefined;
|
|
8
|
+
pasteContent?: string | undefined;
|
|
9
|
+
} | {
|
|
10
|
+
id: number;
|
|
11
|
+
kind: 'assistant';
|
|
12
|
+
text: string;
|
|
13
|
+
} | {
|
|
14
|
+
id: number;
|
|
15
|
+
kind: 'thinking';
|
|
16
|
+
text: string;
|
|
17
|
+
} | {
|
|
18
|
+
id: number;
|
|
19
|
+
kind: 'tool';
|
|
20
|
+
name: string;
|
|
21
|
+
durationMs: number;
|
|
22
|
+
ok: boolean;
|
|
23
|
+
input?: unknown | undefined;
|
|
24
|
+
output?: string | undefined;
|
|
25
|
+
/** Full byte length of the result body the model actually received
|
|
26
|
+
* (post-cap, post-scrub). Carried separately because `output` is a
|
|
27
|
+
* ~400-char preview — `outputBytes` is what the model paid for. */
|
|
28
|
+
outputBytes?: number | undefined;
|
|
29
|
+
/** ~3.5 chars/token estimate over `outputBytes`. Cheap to render in
|
|
30
|
+
* the chip; the authoritative count lives in provider.response.usage. */
|
|
31
|
+
outputTokens?: number | undefined;
|
|
32
|
+
/** Real line count for tools that have a meaningful one — read counts
|
|
33
|
+
* numbered prefixes, shell/grep/logs count newlines. Undefined for
|
|
34
|
+
* tools without a line notion (json, fetch, …). */
|
|
35
|
+
outputLines?: number | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Per-tool on-screen result render mode. `simple` hides the body
|
|
38
|
+
* preview and shows only meta (line count, byte size); `extend`
|
|
39
|
+
* shows the full preview. Mirrors the CLI's `setResultRenderMode`
|
|
40
|
+
* state. The frontend TUI reads this off the same
|
|
41
|
+
* `tools.resultRenderMode[name]` config the CLI uses.
|
|
42
|
+
*/
|
|
43
|
+
resultRenderMode?: 'simple' | 'extend' | undefined;
|
|
44
|
+
} | {
|
|
45
|
+
id: number;
|
|
46
|
+
kind: 'info';
|
|
47
|
+
text: string;
|
|
48
|
+
} | {
|
|
49
|
+
id: number;
|
|
50
|
+
kind: 'warn';
|
|
51
|
+
text: string;
|
|
52
|
+
} | {
|
|
53
|
+
id: number;
|
|
54
|
+
kind: 'error';
|
|
55
|
+
text: string;
|
|
56
|
+
} | {
|
|
57
|
+
id: number;
|
|
58
|
+
kind: 'turn-summary';
|
|
59
|
+
text: string;
|
|
60
|
+
} | {
|
|
61
|
+
id: number;
|
|
62
|
+
kind: 'brain';
|
|
63
|
+
status: 'thinking' | 'answered' | 'ask_human' | 'denied' | 'intervention';
|
|
64
|
+
source: string;
|
|
65
|
+
risk: 'low' | 'medium' | 'high' | 'critical';
|
|
66
|
+
question: string;
|
|
67
|
+
decision?: string | undefined;
|
|
68
|
+
rationale?: string | undefined;
|
|
69
|
+
} | {
|
|
70
|
+
id: number;
|
|
71
|
+
kind: 'banner';
|
|
72
|
+
version: string;
|
|
73
|
+
provider: string;
|
|
74
|
+
model: string;
|
|
75
|
+
cwd: string;
|
|
76
|
+
family?: string | undefined;
|
|
77
|
+
keyTail?: string | undefined;
|
|
78
|
+
} | {
|
|
79
|
+
id: number;
|
|
80
|
+
kind: 'confirm';
|
|
81
|
+
toolName: string;
|
|
82
|
+
input: unknown;
|
|
83
|
+
suggestedPattern: string;
|
|
84
|
+
} | {
|
|
85
|
+
id: number;
|
|
86
|
+
kind: 'subagent';
|
|
87
|
+
agentLabel: string;
|
|
88
|
+
agentColor: string;
|
|
89
|
+
icon: string;
|
|
90
|
+
text: string;
|
|
91
|
+
detail?: string | undefined;
|
|
92
|
+
};
|
|
93
|
+
export interface HistoryProps {
|
|
94
|
+
entries: HistoryEntry[];
|
|
95
|
+
/**
|
|
96
|
+
* Store parsed next steps in the shared suggestion store so /next 1 works.
|
|
97
|
+
* Called by the Entry component after parsing each assistant message.
|
|
98
|
+
*/
|
|
99
|
+
setSuggestions?: ((steps: string[]) => void) | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Current autonomy mode. When 'auto', a marker is shown next to the first
|
|
102
|
+
* next-step suggestion indicating it will be auto-submitted.
|
|
103
|
+
*/
|
|
104
|
+
autonomyMode?: string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Generation counter for wholesale history replacements (session resume).
|
|
107
|
+
* Keys the internal <Static> so a replacement remounts it — Ink's Static
|
|
108
|
+
* tracks written items by index and would otherwise skip replayed entries
|
|
109
|
+
* whenever the new array is shorter than what it already printed.
|
|
110
|
+
*/
|
|
111
|
+
generation?: number | undefined;
|
|
112
|
+
streamingText?: string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Optional live tail of the currently streaming tool. Rendered below the
|
|
115
|
+
* assistant tail so the user sees both at once: model thinking and tool
|
|
116
|
+
* output. Cleared automatically when the tool's `tool.executed` event
|
|
117
|
+
* fires and the final entry lands in `entries`.
|
|
118
|
+
*/
|
|
119
|
+
toolStream?: {
|
|
120
|
+
toolUseId: string;
|
|
121
|
+
name: string;
|
|
122
|
+
text: string;
|
|
123
|
+
startedAt: number;
|
|
124
|
+
} | null;
|
|
125
|
+
/**
|
|
126
|
+
* Minimum number of files before the per-tool multi-file diff summary
|
|
127
|
+
* footer is rendered. `0` suppresses the footer entirely; any positive
|
|
128
|
+
* number sets the cutoff. When `undefined`, the code-block module's
|
|
129
|
+
* default (`MULTI_DIFF_SUMMARY_THRESHOLD`) is used.
|
|
130
|
+
*/
|
|
131
|
+
multiDiffSummaryThreshold?: number | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Live todo list. When it has any `pending`/`in_progress` items, the
|
|
134
|
+
* `💡 NEXT STEPS` panel is hidden and the suggestion store is not
|
|
135
|
+
* written from the render path — mirrors the host callback's
|
|
136
|
+
* `hasOpenTodos` gate (b0970387) so the two paths can't disagree about
|
|
137
|
+
* whether suggestions are available.
|
|
138
|
+
*/
|
|
139
|
+
todos?: readonly TodoItem[] | undefined;
|
|
140
|
+
}
|
|
141
|
+
export interface BodySegment {
|
|
142
|
+
type: 'prose' | 'code';
|
|
143
|
+
text: string;
|
|
144
|
+
lang?: Lang | undefined;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=types.d.ts.map
|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,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEN,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACzD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;;;OAKG;IACH,UAAU,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzF;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function shortenPath(p: string, max: number): string;
|
|
3
|
+
export declare function previewArgs(input: unknown): string;
|
|
4
|
+
export declare function previewOutput(output: string): string;
|
|
5
|
+
export declare function fmtTok(n: number): string;
|
|
6
|
+
export declare function fmtDuration(ms: number): string;
|
|
7
|
+
export declare function fmtBytes(n: number): string;
|
|
8
|
+
export declare function truncMid(s: string, max: number): string;
|
|
9
|
+
export declare function stringOf(v: unknown): string | undefined;
|
|
10
|
+
export declare function numOf(v: unknown): number | undefined;
|
|
11
|
+
export declare function tryParseJson(s: string): unknown;
|
|
12
|
+
export declare function scanNumberedRange(text: string): {
|
|
13
|
+
first?: number | undefined;
|
|
14
|
+
last?: number | undefined;
|
|
15
|
+
count: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function countLines(text: string): number;
|
|
18
|
+
export declare function firstNonEmpty(text: string): string | undefined;
|
|
19
|
+
export declare function formatMatchHit(hit: unknown): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Render the most useful single-line description of a tool call's arguments.
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatToolArgs(toolName: string, input: unknown): string;
|
|
24
|
+
/**
|
|
25
|
+
* Distil a tool's result text into 0–N digest lines the renderer can stack.
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatToolOutput(toolName: string, output: string | undefined, ok: boolean, _outputBytes?: number | undefined, outputLines?: number | undefined): string[];
|
|
28
|
+
export type ToolVisualLineKind = 'ok' | 'warn' | 'error' | 'meta' | 'path' | 'match' | 'code' | 'stdout' | 'stderr';
|
|
29
|
+
export interface ToolVisualLine {
|
|
30
|
+
kind: ToolVisualLineKind;
|
|
31
|
+
text: string;
|
|
32
|
+
marker?: string | undefined;
|
|
33
|
+
lineNo?: string | undefined;
|
|
34
|
+
path?: string | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Build richer terminal-native rows for common tool outputs. This handles both
|
|
38
|
+
* raw JSON-shaped results used by unit tests and the compact serializer text
|
|
39
|
+
* emitted in real sessions.
|
|
40
|
+
*/
|
|
41
|
+
export declare function formatToolVisualOutput(toolName: string, output: string | undefined, ok: boolean, input?: unknown | undefined): ToolVisualLine[] | undefined;
|
|
42
|
+
export declare function ToolOutputLines({ lines, hasFollowingBlock, }: {
|
|
43
|
+
lines: ToolVisualLine[];
|
|
44
|
+
hasFollowingBlock?: boolean | undefined;
|
|
45
|
+
}): React.ReactElement;
|
|
46
|
+
export declare const MAX_STREAM_DISPLAY_CHARS = 480;
|
|
47
|
+
/**
|
|
48
|
+
* Build the CONSTANT-height content block for the live tool-stream box: always
|
|
49
|
+
* exactly `maxLines` rows, newest-pinned-to-bottom, every line truncated to
|
|
50
|
+
* `contentWidth` so nothing wraps. Holding the row count fixed is what stops the
|
|
51
|
+
* live region from growing (and thus scrolling the terminal + leaking the header
|
|
52
|
+
* into scrollback) as output streams in. Pure + exported for testing.
|
|
53
|
+
*/
|
|
54
|
+
export declare function streamBoxRows(text: string, maxLines: number, contentWidth: number): Array<{
|
|
55
|
+
text: string;
|
|
56
|
+
italic?: boolean | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const ToolStreamBox: React.MemoExoticComponent<({ name, text, startedAt, termWidth, }: {
|
|
59
|
+
name: string;
|
|
60
|
+
text: string;
|
|
61
|
+
startedAt: number;
|
|
62
|
+
termWidth: number;
|
|
63
|
+
}) => React.ReactElement>;
|
|
64
|
+
export declare function tailForDisplay(text: string, maxChars: number): string;
|
|
65
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/history/utils.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAG1D;AAID,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQlD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAOD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAKxC;AAED,wBAAgB,WAAW,CAAC,EAAE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
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { History, type HistoryEntry, type HistoryProps, type BodySegment, type DiffFilePreview, type DiffLineKind, type DiffLineRow, type DiffPreview, type MultiDiffSummary, MULTI_DIFF_SUMMARY_THRESHOLD, Banner, CodeBlock, DiffBlock, DiffFileBlock, Entry, MESSAGE_PANEL_BORDER_WIDTH, MESSAGE_PANEL_CHROME_WIDTH, MESSAGE_PANEL_MARGIN, AssistantBody, AssistantTail, splitFencedBlocks, extractDiffPreview, extractMultiFileDiffs, extractReplaceDiffs, formatMultiDiffSummary, parseUnifiedDiff, shortenPath, previewArgs, previewOutput, summarizeMultiFileDiffs, fmtTok, fmtDuration, fmtBytes, truncMid, stringOf, numOf, tryParseJson, scanNumberedRange, countLines, firstNonEmpty, formatMatchHit, formatToolArgs, formatToolOutput, formatToolVisualOutput, type ToolVisualLine, type ToolVisualLineKind, ToolOutputLines, ToolStreamBox, streamBoxRows, assistantTailRows, MAX_STREAM_DISPLAY_CHARS, tailForDisplay, assistantContentWidth } from './history/index.js';
|
|
2
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/components/history.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type MouseEventInfo } from '../mouse.js';
|
|
3
|
+
export interface InputProps {
|
|
4
|
+
prompt?: string | undefined;
|
|
5
|
+
value: string;
|
|
6
|
+
cursor: number;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
hint?: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* When true the visible prompt rows are replaced by an empty placeholder of
|
|
11
|
+
* `placeholderHeight` rows, but BOTH keyboard listeners (the Ink `useInput`
|
|
12
|
+
* and the raw-stdin parser that produces F-keys / Home / End / wheel) stay
|
|
13
|
+
* mounted. This is what keeps the central `handleKey` router — and therefore
|
|
14
|
+
* the F-key/Esc toggles that open and CLOSE the monitor overlays — alive
|
|
15
|
+
* while an overlay occupies the bottom region. Unmounting the Input here is
|
|
16
|
+
* what previously left overlays (e.g. the F3 agents monitor) un-closable.
|
|
17
|
+
*/
|
|
18
|
+
hidden?: boolean | undefined;
|
|
19
|
+
/** Row count for the hidden placeholder so the bottom region never resizes. */
|
|
20
|
+
placeholderHeight?: number | undefined;
|
|
21
|
+
onKey: (input: string, key: KeyEvent) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface KeyEvent {
|
|
24
|
+
upArrow: boolean;
|
|
25
|
+
downArrow: boolean;
|
|
26
|
+
leftArrow: boolean;
|
|
27
|
+
rightArrow: boolean;
|
|
28
|
+
return: boolean;
|
|
29
|
+
escape: boolean;
|
|
30
|
+
ctrl: boolean;
|
|
31
|
+
meta: boolean;
|
|
32
|
+
shift: boolean;
|
|
33
|
+
tab: boolean;
|
|
34
|
+
backspace: boolean;
|
|
35
|
+
delete: boolean;
|
|
36
|
+
pageUp: boolean;
|
|
37
|
+
pageDown: boolean;
|
|
38
|
+
home: boolean;
|
|
39
|
+
end: boolean;
|
|
40
|
+
/** Mouse wheel scroll: positive = up (away from user), negative = down. */
|
|
41
|
+
wheelDeltaY?: number | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Full mouse report (click/release/drag/hover/wheel) when terminal mouse
|
|
44
|
+
* tracking is enabled. `wheelDeltaY` above is the back-compat shorthand for
|
|
45
|
+
* `mouse.wheel`; consumers wanting clicks/coords should read `mouse`.
|
|
46
|
+
*/
|
|
47
|
+
mouse?: MouseEventInfo | undefined;
|
|
48
|
+
/** Function-key number 1–12 when a plain F-key was pressed, else undefined.
|
|
49
|
+
* Ink's useInput does not decode F-keys, so these are caught from raw stdin
|
|
50
|
+
* (same mechanism as Home/End) and surfaced here. F-keys are terminal-safe
|
|
51
|
+
* aliases for chords some terminals intercept (e.g. Windows Terminal eats
|
|
52
|
+
* Ctrl+F for "Find"). */
|
|
53
|
+
fn?: number | undefined;
|
|
54
|
+
}
|
|
55
|
+
export declare const EMPTY_KEY: KeyEvent;
|
|
56
|
+
export declare const Input: React.MemoExoticComponent<({ prompt, value, cursor, disabled, hint, hidden, placeholderHeight, onKey, }: InputProps) => React.ReactElement>;
|
|
57
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,KAAK,cAAc,EAAwC,MAAM,aAAa,CAAC;AACxF,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG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