@wrongstack/tui 1.0.24 → 1.0.26

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 (84) hide show
  1. package/dist/app-action-type.d.ts +54 -1
  2. package/dist/app-panel-state.d.ts +25 -0
  3. package/dist/app-props.d.ts +20 -0
  4. package/dist/app-reducer.d.ts +1 -1
  5. package/dist/app-state-core-types.d.ts +13 -0
  6. package/dist/app-view-contract.d.ts +1 -1
  7. package/dist/background-strip-model.d.ts +65 -0
  8. package/dist/brain-panel-model.d.ts +7 -7
  9. package/dist/chat-search-slash.d.ts +15 -0
  10. package/dist/clipboard.d.ts +14 -1
  11. package/dist/components/background-strip.d.ts +20 -0
  12. package/dist/components/chat-search-bar.d.ts +19 -0
  13. package/dist/components/checkpoint-timeline.d.ts +6 -2
  14. package/dist/components/history/code-block.d.ts +2 -136
  15. package/dist/components/history/diff-model.d.ts +143 -0
  16. package/dist/components/history/scroll-controller-types.d.ts +11 -0
  17. package/dist/components/history/scrollbar-rail.d.ts +14 -2
  18. package/dist/components/history/use-history-controller.d.ts +5 -0
  19. package/dist/components/monitor-shell.d.ts +5 -1
  20. package/dist/components/phase-monitor.d.ts +3 -1
  21. package/dist/components/prompt-picker-model.d.ts +16 -0
  22. package/dist/components/prompt-picker.d.ts +2 -16
  23. package/dist/components/resource-menu-model.d.ts +3 -0
  24. package/dist/components/resource-menu.d.ts +3 -3
  25. package/dist/components/scrollable-history.d.ts +1 -1
  26. package/dist/components/send-mode-model.d.ts +44 -0
  27. package/dist/components/send-mode-picker.d.ts +2 -43
  28. package/dist/components/sidebar-panel-agents.d.ts +10 -0
  29. package/dist/components/sidebar-panel-connections.d.ts +11 -0
  30. package/dist/components/sidebar-panel-coordinator.d.ts +11 -0
  31. package/dist/components/sidebar-panel-fleet.d.ts +16 -0
  32. package/dist/components/sidebar-panel-project.d.ts +12 -0
  33. package/dist/components/sidebar-panel-worktree.d.ts +10 -0
  34. package/dist/components/sidebar-panel-wrong-proxy.d.ts +25 -0
  35. package/dist/components/sidebar-panels-workspace.d.ts +10 -79
  36. package/dist/components/status-bar-rails-async.d.ts +2 -2
  37. package/dist/components/status-bar-types.d.ts +6 -0
  38. package/dist/components/status-bar.d.ts +1 -1
  39. package/dist/components/statusline-picker-model.d.ts +45 -0
  40. package/dist/components/statusline-picker.d.ts +2 -41
  41. package/dist/hooks/fork-at-checkpoint.d.ts +25 -0
  42. package/dist/hooks/use-app-execution-pipeline.d.ts +1 -1
  43. package/dist/hooks/use-app-picker-keys.d.ts +4 -2
  44. package/dist/hooks/use-chip-staleness-guard.d.ts +6 -0
  45. package/dist/hooks/use-core-tui-commands.d.ts +7 -2
  46. package/dist/hooks/use-file-search.d.ts +10 -0
  47. package/dist/hooks/use-picker-keys-brain-statusline.d.ts +4 -0
  48. package/dist/hooks/use-provider-warmup.d.ts +9 -0
  49. package/dist/hooks/use-queue-manager.d.ts +11 -1
  50. package/dist/hooks/use-session-rewind.d.ts +8 -1
  51. package/dist/hooks/use-slash-picker.d.ts +1 -1
  52. package/dist/hooks/use-stable-key-handler.d.ts +8 -1
  53. package/dist/hooks/use-status-sync-interval.d.ts +3 -2
  54. package/dist/hooks/use-tui-environment-state.d.ts +3 -0
  55. package/dist/hooks/use-tui-event-bridge.d.ts +12 -0
  56. package/dist/index.js +22173 -20317
  57. package/dist/ink.d.ts +1 -1
  58. package/dist/input-validation/action-types.d.ts +1 -1
  59. package/dist/input-validation/limits.d.ts +2 -0
  60. package/dist/input-validation-display.d.ts +9 -0
  61. package/dist/input-validation.d.ts +0 -52
  62. package/dist/key-routes/key-route-background-strip.d.ts +14 -0
  63. package/dist/key-routes/key-route-chat-search.d.ts +24 -0
  64. package/dist/layout-store.d.ts +2 -2
  65. package/dist/memory-slash-render.d.ts +1 -1
  66. package/dist/message-checkpoint.d.ts +19 -0
  67. package/dist/motion.d.ts +16 -0
  68. package/dist/reducers/chat-search.d.ts +11 -0
  69. package/dist/reducers/composer-action-types.d.ts +6 -0
  70. package/dist/reducers/composer-pickers.d.ts +4 -0
  71. package/dist/reducers/composer.d.ts +1 -5
  72. package/dist/reducers/message-jump.d.ts +16 -0
  73. package/dist/reducers/workspace-panels.d.ts +1 -1
  74. package/dist/resume-session-tree.d.ts +8 -0
  75. package/dist/rewind-prompt.d.ts +24 -0
  76. package/dist/run-tui-options.d.ts +23 -4
  77. package/dist/scroll-anchor.d.ts +6 -0
  78. package/dist/submit-controller.d.ts +1 -1
  79. package/dist/submit-slash-command.d.ts +67 -0
  80. package/dist/transcript-search.d.ts +38 -0
  81. package/dist/ui-contracts.d.ts +1 -1
  82. package/dist/use-app-controller.d.ts +1 -1
  83. package/dist/use-controller-key-pipeline.d.ts +217 -0
  84. package/package.json +7 -7
@@ -44,6 +44,24 @@ export type Action = {
44
44
  provider?: string | undefined;
45
45
  cwd?: string | undefined;
46
46
  sessionId?: string | undefined;
47
+ /**
48
+ * Tells the reducer the boot-time restored transcript source has been
49
+ * discarded (e.g. by `/clear`). When explicitly `null` (not just
50
+ * omitted), the reducer resets the resume-derived state slice to the
51
+ * fresh values `createInitialState` would have produced with no
52
+ * restored entries: `historyBudget = undefined`, `autoProceedHold = false`,
53
+ * and `nextId` re-seeded from the surviving banner only. Pass
54
+ * `undefined` to leave the resume slice intact (existing behavior for
55
+ * `session.rewound` / `project.switched`).
56
+ */
57
+ restoredMessages?: readonly unknown[] | null | undefined;
58
+ restoredToolCalls?: readonly unknown[] | null | undefined;
59
+ restoredEvents?: readonly unknown[] | null | undefined;
60
+ /**
61
+ * Keep the checkpoint list. A rewind clears the screen but the
62
+ * checkpoints up to its target still belong to this conversation.
63
+ */
64
+ keepCheckpoints?: boolean | undefined;
47
65
  } | {
48
66
  type: 'streamDelta';
49
67
  delta: string;
@@ -85,6 +103,31 @@ export type Action = {
85
103
  } | {
86
104
  type: 'inspectOverlayScroll';
87
105
  delta: number;
106
+ }
107
+ /** Open the transcript search bar, optionally with a prefilled query. */
108
+ | {
109
+ type: 'chatSearchOpen';
110
+ query?: string | undefined;
111
+ includeReasoning: boolean;
112
+ } | {
113
+ type: 'chatSearchSetQuery';
114
+ query: string;
115
+ includeReasoning: boolean;
116
+ }
117
+ /** Move the selection: -1 = older match, +1 = newer match (wraps). */
118
+ | {
119
+ type: 'chatSearchStep';
120
+ delta: -1 | 1;
121
+ includeReasoning: boolean;
122
+ } | {
123
+ type: 'chatSearchClose';
124
+ }
125
+ /** Alt+↑ / Alt+↓: jump to the previous / next user message. */
126
+ | {
127
+ type: 'messageJump';
128
+ direction: -1 | 1;
129
+ } | {
130
+ type: 'messageJumpClear';
88
131
  } | {
89
132
  type: 'brainStatus';
90
133
  state: State['brain']['state'];
@@ -1101,10 +1144,20 @@ export type Action = {
1101
1144
  } | {
1102
1145
  type: 'checkpointReceived';
1103
1146
  cp: State['checkpoints'][0];
1104
- } | {
1147
+ }
1148
+ /** `selected` preselects a row (a message picked with Alt+↑); default the newest. */
1149
+ | {
1105
1150
  type: 'rewindOverlayOpen';
1151
+ selected?: number | undefined;
1106
1152
  } | {
1107
1153
  type: 'rewindOverlayClose';
1154
+ }
1155
+ /** Fork the session at a checkpoint and switch to the fork. */
1156
+ | {
1157
+ type: 'checkpointFork';
1158
+ promptIndex: number;
1159
+ } | {
1160
+ type: 'forkRequestDone';
1108
1161
  } | {
1109
1162
  type: 'rewindOverlayMove';
1110
1163
  delta: number;
@@ -34,6 +34,24 @@ export type PanelState = {
34
34
  entryIds?: readonly number[] | undefined;
35
35
  scroll: number;
36
36
  } | null;
37
+ /**
38
+ * Transcript search bar (Alt+F / `/chat-search`). `selectedEntryId` is the
39
+ * current hit; `jumpSeq` increments whenever the view should scroll that
40
+ * hit into view. Null when the bar is closed.
41
+ */
42
+ chatSearch: {
43
+ query: string;
44
+ selectedEntryId: number | null;
45
+ jumpSeq: number;
46
+ } | null;
47
+ /**
48
+ * Alt+↑ / Alt+↓ user-message navigation: the user entry last jumped to, and
49
+ * a counter that bumps on every jump so the view scrolls it into view.
50
+ */
51
+ messageJump: {
52
+ entryId: number | null;
53
+ seq: number;
54
+ };
37
55
  picker: {
38
56
  open: boolean;
39
57
  query: string;
@@ -522,6 +540,13 @@ export type PanelState = {
522
540
  sessionId: string;
523
541
  sessionName: string;
524
542
  } | null;
543
+ /**
544
+ * A fork from the checkpoint timeline, waiting for the resume machinery
545
+ * (use-app-picker-keys) to branch the session there and switch to it.
546
+ */
547
+ forkRequest?: {
548
+ promptIndex: number;
549
+ } | null | undefined;
525
550
  /** Checkpoint timeline overlay — null when closed. */
526
551
  rewindOverlay: {
527
552
  checkpoints: Array<{
@@ -54,6 +54,12 @@ export interface AppProps {
54
54
  banner?: boolean | undefined;
55
55
  /** Persists the queue across crashes; rehydrated on mount, written on every mutation. */
56
56
  queueStore?: QueueStore | undefined;
57
+ /**
58
+ * The queue store of another session. With it, `/resume` brings that
59
+ * session's queue along (the WebUI keeps its queue in the same file) and
60
+ * leaves the previous session's on disk.
61
+ */
62
+ queueStoreFor?: ((sessionId: string) => QueueStore | undefined) | undefined;
57
63
  /**
58
64
  * Mirrors the queue's display texts (head first) to the host on every
59
65
  * queue change, so a running agent can be told what's waiting (queue
@@ -390,6 +396,12 @@ export interface AppProps {
390
396
  * `(update available)` next to the version chip when this is set, so
391
397
  * users notice without having to read the stderr notice. */
392
398
  updateAvailable?: boolean | undefined;
399
+ /**
400
+ * The standalone executable's background update: called with the version
401
+ * once it is downloaded, verified and waiting to be swapped in when this
402
+ * session exits. The status bar's version chip then says so.
403
+ */
404
+ subscribeUpdateReady?: ((listener: (version: string) => void) => () => void) | undefined;
393
405
  /**
394
406
  * Snapshot the keyed providers (and their model lists) for the
395
407
  * `/model` picker. Called every time the picker opens, so the result
@@ -501,6 +513,14 @@ export interface AppProps {
501
513
  * optionally by the startup rehydration path.
502
514
  */
503
515
  listSessions?: ((limit?: number) => Promise<ResumeSessionEntry[]>) | undefined;
516
+ /**
517
+ * Branch a session at a checkpoint (the conversation before that prompt)
518
+ * into a new session, leaving the original as it is. Returns the new id;
519
+ * the TUI then resumes it. The working tree is shared, not copied.
520
+ */
521
+ forkSession?: ((sessionId: string, checkpointPromptIndex: number) => Promise<{
522
+ id: string;
523
+ }>) | undefined;
504
524
  /**
505
525
  * Goal text passed from `--goal "..."` on the command line. When set,
506
526
  * the App mounts, renders the banner, then automatically dispatches
@@ -1,7 +1,7 @@
1
1
  import type { Action } from './app-action-type.js';
2
2
  import type { State } from './app-state.js';
3
- export type { DraftEntry, FleetEntry, GoalSummary, QueueItem, ResumeSessionEntry, Settings, SlashCommandMatch, State, } from './app-state.js';
4
3
  export type { Action } from './app-action-type.js';
4
+ export type { DraftEntry, FleetEntry, GoalSummary, QueueItem, ResumeSessionEntry, Settings, SlashCommandMatch, State, } from './app-state.js';
5
5
  export { firstSelectable, pruneToolInput, skipDivider } from './reducers/helpers.js';
6
6
  export declare function reducer(state: State, action: Action): State;
7
7
  //# sourceMappingURL=app-reducer.d.ts.map
@@ -38,6 +38,19 @@ export interface ResumeSessionEntry {
38
38
  toolCallCount: number;
39
39
  toolErrorCount: number;
40
40
  outcome?: 'completed' | 'error' | 'timeout' | 'aborted' | undefined;
41
+ /** Parent session id when this session is a fork; the picker nests it. */
42
+ forkedFrom?: string | undefined;
43
+ /**
44
+ * Set when the session belongs to another git worktree of this repository
45
+ * (its own project directory). Choosing it switches to that worktree first.
46
+ */
47
+ worktree?: {
48
+ root: string;
49
+ name: string;
50
+ branch?: string | undefined;
51
+ } | undefined;
52
+ /** Tree connector (`├─ `, `└─ `) the picker draws; set when the picker opens. */
53
+ treePrefix?: string | undefined;
41
54
  /** The current session — marked so the picker can disallow resuming into itself. */
42
55
  isCurrent?: boolean | undefined;
43
56
  /**
@@ -70,7 +70,7 @@ interface AppViewRuntime {
70
70
  liveStatuslineMode: StatuslineMode;
71
71
  projectName: string | undefined;
72
72
  workingDirChip: string | undefined;
73
- handleRewindTo: (checkpointIndex: number) => Promise<void>;
73
+ handleRewindTo: (checkpointIndex: number) => Promise<import('./hooks/use-session-rewind.js').RewindOutcome>;
74
74
  activeCtrlRef: MutableRefObject<AbortController | null>;
75
75
  clearPendingConfirms: () => void;
76
76
  liveDirector: () => Director | null;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The background strip above the composer: every running subagent and every
3
+ * background shell, as one row of chips. Alt+B focuses it; ←/→ pick a chip,
4
+ * Enter shows or hides the last lines of its output, `x` stops a shell (after
5
+ * a `y`), Esc leaves.
6
+ *
7
+ * This file is the pure part (items, layout, peek lines) and the strip's own
8
+ * little store. The store lives outside the app reducer on purpose: the strip
9
+ * state is view-only and short-lived, and the key route and the component are
10
+ * its only readers.
11
+ */
12
+ import type { FleetEntry } from './app-state-fleet.js';
13
+ export interface BackgroundItem {
14
+ /** `agent:<id>` or `shell:<pid>`. */
15
+ id: string;
16
+ kind: 'agent' | 'shell';
17
+ label: string;
18
+ startedAt: number;
19
+ agentId?: string | undefined;
20
+ pid?: number | undefined;
21
+ logFile?: string | undefined;
22
+ }
23
+ export interface BackgroundProcessLike {
24
+ pid: number;
25
+ command: string;
26
+ startedAt: number;
27
+ background: boolean;
28
+ killed: boolean;
29
+ logFile?: string | undefined;
30
+ }
31
+ /** Running subagents (oldest first), then background shells (oldest first). */
32
+ export declare function buildBackgroundItems(fleet: Readonly<Record<string, FleetEntry>>, processes: readonly BackgroundProcessLike[]): BackgroundItem[];
33
+ /** `12s`, `3m`, `1h4m`. */
34
+ export declare function formatElapsed(ms: number): string;
35
+ export interface StripChip {
36
+ item: BackgroundItem;
37
+ text: string;
38
+ selected: boolean;
39
+ }
40
+ /**
41
+ * The chips that fit in `width` columns (after the `prefix` and before the
42
+ * `suffix`), always including the selected one; `hidden` counts the rest.
43
+ */
44
+ export declare function layoutStripChips(items: readonly BackgroundItem[], selected: number, width: number, now: number, spinner: string): {
45
+ chips: StripChip[];
46
+ hidden: number;
47
+ };
48
+ /** What a subagent is doing, newest last. */
49
+ export declare function agentPeekLines(entry: FleetEntry | undefined, max: number): string[];
50
+ export interface BackgroundStripState {
51
+ focused: boolean;
52
+ /** By id, so a chip that appears before it does not move the selection. */
53
+ selectedId: string | undefined;
54
+ peek: boolean;
55
+ confirmStop: boolean;
56
+ items: readonly BackgroundItem[];
57
+ }
58
+ export declare function getBackgroundStrip(): BackgroundStripState;
59
+ export declare function updateBackgroundStrip(patch: Partial<BackgroundStripState>): void;
60
+ /** Position of the selected chip (0 when nothing is selected). */
61
+ export declare function selectedIndex(state: BackgroundStripState): number;
62
+ /** Same ids in the same order: the strip keeps its item list (and render). */
63
+ export declare function sameItems(a: readonly BackgroundItem[], b: readonly BackgroundItem[]): boolean;
64
+ export declare function useBackgroundStrip(): BackgroundStripState;
65
+ //# sourceMappingURL=background-strip-model.d.ts.map
@@ -93,7 +93,8 @@ export interface BrainPanelSettings {
93
93
  /** Effective heuristic toggles (defaults already filled in by the host). */
94
94
  heuristics: BrainPanelHeuristics;
95
95
  /** Single-LLM tier quality gate. */
96
- llmMaxTokens: number;
96
+ /** undefined = the model's own output ceiling. */
97
+ llmMaxTokens?: number | undefined;
97
98
  llmRejectUncertain: boolean;
98
99
  llmMinConfidence: number;
99
100
  llmDenyIsTerminal: BrainDenyIsTerminal;
@@ -163,7 +164,7 @@ export interface BrainPanelHost {
163
164
  * positive integer"), so there is no "clear back to default" step here —
164
165
  * the preset ladders are number-only.
165
166
  */
166
- setLlmMaxTokens(tokens: number): Promise<string | null>;
167
+ setLlmMaxTokens(tokens: number | undefined): Promise<string | null>;
167
168
  setLlmRejectUncertain(on: boolean): Promise<string | null>;
168
169
  setLlmMinConfidence(value: number): Promise<string | null>;
169
170
  setLlmDenyIsTerminal(mode: BrainDenyIsTerminal): Promise<string | null>;
@@ -277,7 +278,7 @@ export declare const AUTO_DENY_PRESETS: ReadonlyArray<number | undefined>;
277
278
  * fields, so there is no `undefined` ("back to default") rung — the default
278
279
  * value itself is the first rung.
279
280
  */
280
- export declare const LLM_MAX_TOKENS_PRESETS: readonly number[];
281
+ export declare const LLM_MAX_TOKENS_PRESETS: ReadonlyArray<number | undefined>;
281
282
  export declare const LLM_MIN_CONFIDENCE_PRESETS: readonly number[];
282
283
  export declare const CACHE_TTL_PRESETS: readonly number[];
283
284
  export declare const CACHE_MAX_ENTRIES_PRESETS: readonly number[];
@@ -291,10 +292,9 @@ export declare const COUNCIL_TIMEOUT_PRESETS: ReadonlyArray<number | undefined>;
291
292
  export declare const COUNCIL_CONCURRENCY_PRESETS: ReadonlyArray<number | undefined>;
292
293
  export declare const COUNCIL_JUDGE_MAX_TOKENS_PRESETS: ReadonlyArray<number | undefined>;
293
294
  /**
294
- * Per-seat output budget rungs. The default is 2000 (see
295
- * `BRAIN_COUNCIL_DEFAULT_VOTER_MAX_TOKENS` in core) — reasoning models spend
296
- * their thinking tokens from this budget, so the rungs skew higher than the
297
- * judge ladder.
295
+ * Per-seat output budget rungs. The default (unset) is the model's own output
296
+ * ceiling — reasoning models spend their thinking tokens from this budget, so
297
+ * the rungs skew higher than the judge ladder.
298
298
  */
299
299
  /**
300
300
  * Deliberation round presets. Deliberately short: every step is another
@@ -0,0 +1,15 @@
1
+ import type { SlashCommand } from '@wrongstack/core/types';
2
+ import type { Action } from './app-action-type.js';
3
+ interface ChatSearchSlashDeps {
4
+ dispatch: (action: Action) => void;
5
+ /** Thinking cards are only searchable while model reasoning is shown. */
6
+ includeReasoning: () => boolean;
7
+ }
8
+ /**
9
+ * TUI `/chat-search [text]` — opens the transcript search bar (same as
10
+ * Alt+F), optionally prefilled. Searches the history retained in this TUI;
11
+ * entries evicted by history retention are not searched.
12
+ */
13
+ export declare function createChatSearchSlashCommand(deps: ChatSearchSlashDeps): SlashCommand;
14
+ export {};
15
+ //# sourceMappingURL=chat-search-slash.d.ts.map
@@ -1,2 +1,15 @@
1
- export { readClipboardImage, readClipboardText, writeClipboardText, type ClipboardImage, } from '@wrongstack/runtime/clipboard';
1
+ export { type ClipboardImage, readClipboardImage, readClipboardText, } from '@wrongstack/runtime/clipboard';
2
+ interface ClipboardWriteDeps {
3
+ native: (text: string) => Promise<boolean>;
4
+ stdout: Pick<NodeJS.WriteStream, 'write' | 'isTTY'>;
5
+ }
6
+ /**
7
+ * Copy text for the TUI's copy actions. The OS clipboard tool first; when there
8
+ * is none that works — an SSH session, a headless Linux box without
9
+ * wl-copy/xclip — the terminal is asked to copy it with OSC 52, which reaches
10
+ * the clipboard of the machine the user is actually sitting at. (Inside tmux
11
+ * that needs `set -g set-clipboard on`.) OSC 52 has no acknowledgement, so a
12
+ * sent sequence counts as copied.
13
+ */
14
+ export declare function writeClipboardText(text: string, deps?: ClipboardWriteDeps): Promise<boolean>;
2
15
  //# sourceMappingURL=clipboard.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type React from 'react';
2
+ import type { FleetEntry } from '../app-state-fleet.js';
3
+ /** Output lines shown under the strip while a chip is open. */
4
+ export declare const BACKGROUND_STRIP_PEEK_ROWS = 6;
5
+ /** Rows the strip takes: none while nothing runs in the background. */
6
+ export declare function backgroundStripRows(state: {
7
+ items: readonly unknown[];
8
+ focused: boolean;
9
+ peek: boolean;
10
+ }): number;
11
+ /**
12
+ * Running subagents and background shells, one chip each, right above the
13
+ * composer. Hidden while nothing runs in the background. Alt+B focuses it
14
+ * (see key-route-background-strip.ts).
15
+ */
16
+ export declare function BackgroundStrip({ fleet, width, }: {
17
+ fleet: Readonly<Record<string, FleetEntry>>;
18
+ width: number;
19
+ }): React.ReactElement | null;
20
+ //# sourceMappingURL=background-strip.d.ts.map
@@ -0,0 +1,19 @@
1
+ import type React from 'react';
2
+ import type { State } from '../app-state.js';
3
+ import type { HistoryEntry } from '../history-entry.js';
4
+ /** Rows the bar always occupies, so the history viewport never jumps. */
5
+ export declare const CHAT_SEARCH_BAR_ROWS = 2;
6
+ interface ChatSearchBarProps {
7
+ search: NonNullable<State['chatSearch']>;
8
+ entries: readonly HistoryEntry[];
9
+ includeReasoning: boolean;
10
+ width: number;
11
+ }
12
+ /**
13
+ * Transcript search bar shown above the composer while Alt+F search is open.
14
+ * Row 1: query, match position and key hints. Row 2: the selected match's
15
+ * line with the hit highlighted (or guidance when there is nothing to show).
16
+ */
17
+ export declare const ChatSearchBar: React.MemoExoticComponent<({ search, entries, includeReasoning, width, }: ChatSearchBarProps) => React.ReactElement>;
18
+ export {};
19
+ //# sourceMappingURL=chat-search-bar.d.ts.map
@@ -9,11 +9,15 @@ export interface CheckpointTimelineProps {
9
9
  selected: number;
10
10
  onSelect: (index: number) => void;
11
11
  onConfirm: (index: number) => void | Promise<void>;
12
+ /** Branch a new session at the checkpoint; absent when the host cannot fork. */
13
+ onFork?: ((index: number) => void) | undefined;
12
14
  onClose: () => void;
13
15
  }
14
16
  /**
15
17
  * Full-screen checkpoint timeline overlay for the /rewind command.
16
- * Arrow keys to navigate, Enter to rewind to selected, Esc to close.
18
+ * Arrow keys to navigate, Enter to rewind to selected, `f` to fork a new
19
+ * session there, Esc to close. Both take the selected prompt and everything
20
+ * after it back, and put the prompt back in the composer.
17
21
  */
18
- export declare function CheckpointTimeline({ checkpoints, selected, onSelect, onConfirm, onClose, }: CheckpointTimelineProps): React.ReactElement;
22
+ export declare function CheckpointTimeline({ checkpoints, selected, onSelect, onConfirm, onFork, onClose, }: CheckpointTimelineProps): React.ReactElement;
19
23
  //# sourceMappingURL=checkpoint-timeline.d.ts.map
@@ -1,96 +1,14 @@
1
- import { type DiffLineRow, type DiffPreview } from '@wrongstack/tools/tool-diff';
1
+ import type { DiffLineRow, DiffPreview } from '@wrongstack/tools/tool-diff';
2
2
  import type React from 'react';
3
3
  import { type Lang, type Token } from '../../highlight.js';
4
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
- interface OmittedDiffSummary {
15
- fileCount: number;
16
- added: number;
17
- removed: number;
18
- }
19
- /** Renderable file previews plus aggregate data for files omitted by the cap. */
20
- export type DiffFilePreviews = DiffFilePreview[] & {
21
- omitted?: OmittedDiffSummary | undefined;
22
- };
23
- /**
24
- * Hard ceiling for one file's rendered diff preview. Diff rows are React/Ink
25
- * elements and therefore retained by the active virtual-history window; an
26
- * unbounded preview lets a single generated-file edit defeat virtualization.
27
- * Totals for the whole diff remain available through `added`/`removed`, while
28
- * the footer reports the hidden portion.
29
- */
30
- export declare const DIFF_MAX_LINES = 200;
31
- /** Maximum number of per-file diff blocks retained for one tool entry. */
32
- export declare const MULTI_DIFF_MAX_FILES = 20;
33
- /** Maximum rendered diff rows retained across every file in one tool entry. */
34
- export declare const MULTI_DIFF_MAX_ROWS = 400;
5
+ export * from './diff-model.js';
35
6
  /** Syntax-highlighted, framed code block. */
36
7
  declare function CodeBlockImpl({ code, lang, contentWidth, }: {
37
8
  code: string;
38
9
  lang: Lang;
39
10
  contentWidth: number;
40
11
  }): React.ReactElement;
41
- /**
42
- * Minimum number of files before a summary footer is rendered above the
43
- * per-file blocks. Below this threshold each file's own `… +N -M hidden`
44
- * footer carries enough signal; above it, a single aggregate line keeps
45
- * the screen from being drowned in per-file tail lines.
46
- *
47
- * This is the default when no user-tunable value is supplied. The
48
- * settings picker exposes `MULTI_DIFF_SUMMARY_THRESHOLD_PRESETS` so
49
- * users can raise the cutoff (e.g. for very wide terminals) or lower
50
- * it (e.g. for tiny scrollback), or set it to 0 to suppress the
51
- * summary entirely.
52
- */
53
- export declare const MULTI_DIFF_SUMMARY_THRESHOLD = 5;
54
- /**
55
- * Aggregate stats across a list of per-file diffs — used to print a
56
- * single summary line at the top of a multi-file diff view when there
57
- * are enough files to make the rollup useful.
58
- */
59
- export interface MultiDiffSummary {
60
- fileCount: number;
61
- added: number;
62
- removed: number;
63
- hiddenAdded: number;
64
- hiddenRemoved: number;
65
- /** Number of rendered files whose preview was truncated (has hidden rows).
66
- * Does not include files omitted entirely by the multi-file render ceiling;
67
- * those are tracked separately via {@link omittedFiles}. */
68
- truncatedFiles: number;
69
- /** Files omitted entirely by the multi-file render ceiling. Guaranteed non-negative. */
70
- omittedFiles: number;
71
- }
72
- /**
73
- * Sum the totals of a list of per-file diff previews. Files that were
74
- * parsed but have no rows (e.g. entirely empty after the no-op skip) are
75
- * excluded from the rollup so the summary reflects what the user will
76
- * actually see rendered below.
77
- */
78
- export declare function summarizeMultiFileDiffs(items: DiffFilePreviews): MultiDiffSummary;
79
- /**
80
- * Format a multi-file diff summary as a single dim italic line, suitable
81
- * for rendering above the per-file blocks. Mirrors the per-file footer's
82
- * `… +N -M hidden` shape so a reader who has seen the footer recognises
83
- * the format. Returns `null` when there's nothing useful to surface
84
- * (no files, or below the user's threshold where the per-file footer
85
- * already covers the rollup).
86
- *
87
- * @param threshold User-tunable cutoff. Pass `MULTI_DIFF_SUMMARY_THRESHOLD`
88
- * for the default behaviour, `0` to suppress the summary entirely
89
- * (always returns null), or a positive number to set a custom cutoff.
90
- * A negative value is treated as "use default" so callers can pass an
91
- * `undefined`-coerced settings value without a separate branch.
92
- */
93
- export declare function formatMultiDiffSummary(summary: MultiDiffSummary, threshold?: number): string | null;
94
12
  /**
95
13
  * One labeled diff — used to render a per-file block inside multi-file
96
14
  * diff views (e.g. when `replace` modifies several files). The path label
@@ -105,12 +23,6 @@ export declare function DiffFileBlock({ path, preview, useColor, contentWidth, }
105
23
  /** Pass-through to {@link DiffBlock}. See that component for details. */
106
24
  contentWidth?: number | undefined;
107
25
  }): React.ReactElement;
108
- /**
109
- * Human-readable change-size line for a diff — `Added N lines, removed M
110
- * lines` (Claude Code phrasing). Omits the zero side; returns `null` when
111
- * nothing changed so callers can skip the line entirely.
112
- */
113
- export declare function formatDiffStats(added: number, removed: number): string | null;
114
26
  /**
115
27
  * Return the token list to render on a diff wash (`diffAddBg` /
116
28
  * `diffDelBg`). When `onWash` is false the input is returned unchanged —
@@ -176,52 +88,6 @@ export declare function DiffBlock({ rows, hidden, added, removed, hiddenAdded, h
176
88
  */
177
89
  contentWidth?: number | undefined;
178
90
  }): React.ReactElement;
179
- /**
180
- * Parse a unified-diff string into a {@link DiffPreview}. Thin wrapper over the
181
- * shared, single-source-of-truth `parseUnifiedDiffPreview` in
182
- * @wrongstack/tools/tool-diff (which the WebUI and HQ also read). Kept as a
183
- * local export so this module's many callers and tests are unchanged.
184
- */
185
- export declare function parseUnifiedDiff(diff: string, maxLines: number): DiffPreview;
186
- /**
187
- * Pull a unified-diff string out of a tool's JSON output, then turn it
188
- * into a small, structured preview suitable for colour-coded rendering.
189
- */
190
- export declare function extractDiffPreview(toolName: string, output: string | undefined, input?: unknown | undefined): DiffPreview | undefined;
191
- /**
192
- * Pull one diff preview per file from a `replace` tool result. Each entry
193
- * has a `path` (best-effort: `results[i].path`, falling back to the input
194
- * argument when every result is for the same file) and a `preview` ready
195
- * for `DiffFileBlock` / `DiffBlock` rendering.
196
- *
197
- * Returns `undefined` when no per-file diff is recoverable (e.g. an empty
198
- * `results` array, no diff fields, or the result isn't a JSON object).
199
- *
200
- * Note: For a single entry point that handles `replace`, `diff`, and
201
- * `patch` (the three tools whose output can span multiple files), use
202
- * {@link extractMultiFileDiffs} instead — this function is kept for the
203
- * narrower replace-specific test cases.
204
- */
205
- export declare function extractReplaceDiffs(toolName: string, output: string | undefined, input?: unknown | undefined): DiffFilePreviews | undefined;
206
- /**
207
- * Pull a list of per-file diffs from a tool result that may span multiple
208
- * files. Handles:
209
- *
210
- * - `replace`: JSON `{ results: [{ path, diff }, …] }` (path per result,
211
- * fallback to the input path when the result omits one).
212
- * - `diff`: JSON `{ diff: string }` where `diff` is a git-style multi-file
213
- * unified diff (split on `diff --git` headers).
214
- * - `patch`: either JSON `{ diff: string, files: string[] }` or a raw
215
- * unified-diff string (split on `diff --git` headers, falling back to
216
- * `--- a/<path>` if no `diff --git` is present).
217
- *
218
- * Returns `undefined` when the tool isn't multi-file capable, the output
219
- * is missing/unparseable, or no per-file diff is recoverable. Returns an
220
- * empty array (not undefined) when the output parses but every entry has
221
- * an empty diff after trimming — the caller treats both as "nothing to
222
- * render" but the distinction is useful in tests.
223
- */
224
- export declare function extractMultiFileDiffs(toolName: string, output: string | undefined, input?: unknown | undefined): DiffFilePreviews | undefined;
225
91
  /**
226
92
  * Syntax-highlighted code / diff block.
227
93
  *