@linxiraos/pi-tui 1.2.1 → 1.3.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/CHANGELOG.md +188 -125
- package/README.md +36 -0
- package/THIRD-PARTY-NOTICES.txt +55 -5
- package/dist/types/app-keybindings.d.ts +18 -8
- package/dist/types/apps/git/diff-pane.d.ts +5 -0
- package/dist/types/apps/git/git-tui.d.ts +16 -2
- package/dist/types/apps/git/state.d.ts +11 -0
- package/dist/types/autocomplete.d.ts +2 -0
- package/dist/types/charts/chart-svg.d.ts +7 -13
- package/dist/types/chat/advisor-message.d.ts +4 -1
- package/dist/types/chat/assistant-message.d.ts +9 -4
- package/dist/types/chat/figure-markdown.d.ts +7 -2
- package/dist/types/chat/messages.d.ts +3 -1
- package/dist/types/chat/read-tool-group.d.ts +2 -2
- package/dist/types/chat/table-chart.d.ts +11 -15
- package/dist/types/chat/tool-execution.d.ts +32 -20
- package/dist/types/chat/user-message.d.ts +3 -2
- package/dist/types/chrome/countdown-timer.d.ts +3 -2
- package/dist/types/chrome/diff.d.ts +2 -3
- package/dist/types/chrome/transcript-container.d.ts +2 -0
- package/dist/types/components/image.d.ts +2 -0
- package/dist/types/components/markdown.d.ts +49 -3
- package/dist/types/components/text.d.ts +2 -0
- package/dist/types/debug-server.d.ts +2 -0
- package/dist/types/keybinding-matchers.d.ts +6 -0
- package/dist/types/multiplexers/tmux.d.ts +1 -0
- package/dist/types/multiplexers/types.d.ts +6 -0
- package/dist/types/native/backend.d.ts +5 -4
- package/dist/types/native/blobs.d.ts +24 -12
- package/dist/types/overlays/agent-hub-projection.d.ts +10 -5
- package/dist/types/overlays/annotation-overlay.d.ts +19 -0
- package/dist/types/overlays/approval-dialog.d.ts +79 -0
- package/dist/types/overlays/ask-dialog.d.ts +11 -6
- package/dist/types/overlays/btw-history-panel.d.ts +2 -6
- package/dist/types/overlays/hook-editor.d.ts +7 -2
- package/dist/types/overlays/hook-input.d.ts +12 -4
- package/dist/types/overlays/job-tree.d.ts +50 -0
- package/dist/types/overlays/jobs-panel.d.ts +25 -11
- package/dist/types/overlays/login-dialog.d.ts +8 -3
- package/dist/types/overlays/mcp-add-wizard.d.ts +9 -1
- package/dist/types/overlays/model-browser.d.ts +6 -1
- package/dist/types/overlays/model-picker.d.ts +2 -0
- package/dist/types/overlays/pause-screen.d.ts +5 -0
- package/dist/types/overlays/plan-review-overlay.d.ts +4 -0
- package/dist/types/overlays/report-panel.d.ts +5 -1
- package/dist/types/overlays/reset-usage-selector.d.ts +7 -5
- package/dist/types/overlays/session-account-selector.d.ts +4 -0
- package/dist/types/overlays/session-info-overlay.d.ts +7 -3
- package/dist/types/overlays/session-selector.d.ts +3 -1
- package/dist/types/overlays/usage-dashboard.d.ts +6 -6
- package/dist/types/prompt/composer.d.ts +21 -20
- package/dist/types/prompt/custom-editor.d.ts +20 -10
- package/dist/types/prompt/image-references.d.ts +22 -0
- package/dist/types/prompt/internal-url-autocomplete.d.ts +1 -0
- package/dist/types/prompt/macos-spelling.d.ts +2 -1
- package/dist/types/prompt/prose-gate.d.ts +3 -0
- package/dist/types/prompt/queued-messages.d.ts +1 -1
- package/dist/types/prompt/typing-word.d.ts +25 -0
- package/dist/types/prompt/welcome.d.ts +26 -6
- package/dist/types/render/hanging-wrap.d.ts +7 -0
- package/dist/types/render/hyperlink.d.ts +2 -0
- package/dist/types/render/render-utils.d.ts +9 -1
- package/dist/types/render/utils.d.ts +1 -1
- package/dist/types/setup/scenes/splash.d.ts +6 -5
- package/dist/types/status-line/context-usage.d.ts +4 -1
- package/dist/types/status-line/host.d.ts +6 -4
- package/dist/types/status-line/startup.d.ts +6 -6
- package/dist/types/status-line/types.d.ts +3 -0
- package/dist/types/stdin-buffer.d.ts +7 -0
- package/dist/types/terminal-capabilities.d.ts +16 -1
- package/dist/types/terminal-multiplexer.d.ts +7 -0
- package/dist/types/terminal.d.ts +8 -4
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/theme/theme.d.ts +11 -0
- package/dist/types/thinking.d.ts +5 -0
- package/dist/types/tmux.d.ts +39 -4
- package/dist/types/tools/ast-edit.d.ts +2 -2
- package/dist/types/tools/ast-grep.d.ts +2 -2
- package/dist/types/tools/bash.d.ts +6 -1
- package/dist/types/tools/edit.d.ts +2 -0
- package/dist/types/tools/eval.d.ts +53 -4
- package/dist/types/tools/find.d.ts +14 -4
- package/dist/types/tools/glob.d.ts +3 -3
- package/dist/types/tools/grep.d.ts +2 -2
- package/dist/types/tools/grouped-file-output.d.ts +9 -4
- package/dist/types/tools/native-view.d.ts +1 -1
- package/dist/types/tools/read.d.ts +32 -10
- package/dist/types/tools/renderer.d.ts +2 -0
- package/dist/types/tools/task.d.ts +31 -0
- package/dist/types/tools/write.d.ts +2 -0
- package/dist/types/tui.d.ts +20 -3
- package/package.json +10 -10
- package/src/app-keybindings.d.ts +18 -8
- package/src/app-keybindings.ts +20 -8
- package/src/apps/autoresearch-dashboard.ts +444 -27
- package/src/apps/debug/raw-sse.ts +2 -2
- package/src/apps/git/diff-pane.ts +39 -41
- package/src/apps/git/git-tui.ts +80 -14
- package/src/apps/git/sidebar.ts +10 -1
- package/src/apps/git/state.ts +12 -0
- package/src/autocomplete.d.ts +2 -0
- package/src/autocomplete.ts +21 -19
- package/src/bracketed-paste.ts +9 -2
- package/src/charts/chart-svg.d.ts +7 -13
- package/src/charts/chart-svg.ts +19 -22
- package/src/chat/advisor-message.d.ts +4 -1
- package/src/chat/advisor-message.ts +77 -24
- package/src/chat/assistant-message.d.ts +9 -4
- package/src/chat/assistant-message.ts +127 -31
- package/src/chat/bash-execution.ts +7 -2
- package/src/chat/figure-markdown.d.ts +7 -2
- package/src/chat/figure-markdown.ts +10 -3
- package/src/chat/image-loading.ts +9 -6
- package/src/chat/messages.d.ts +3 -1
- package/src/chat/messages.ts +4 -1
- package/src/chat/read-tool-group.d.ts +2 -2
- package/src/chat/read-tool-group.ts +97 -42
- package/src/chat/svg-figure.ts +3 -1
- package/src/chat/svg-source.ts +6 -3
- package/src/chat/table-chart.d.ts +11 -15
- package/src/chat/table-chart.ts +24 -57
- package/src/chat/tool-execution.d.ts +32 -20
- package/src/chat/tool-execution.ts +103 -36
- package/src/chat/user-message.d.ts +3 -2
- package/src/chat/user-message.ts +54 -34
- package/src/chrome/countdown-timer.ts +3 -3
- package/src/chrome/diff.d.ts +2 -3
- package/src/chrome/diff.ts +4 -9
- package/src/chrome/transcript-container.d.ts +2 -0
- package/src/chrome/transcript-container.ts +212 -28
- package/src/components/editor.ts +12 -12
- package/src/components/image.d.ts +2 -0
- package/src/components/image.ts +54 -20
- package/src/components/markdown.d.ts +49 -3
- package/src/components/markdown.ts +461 -11
- package/src/components/settings-list.ts +2 -4
- package/src/components/text.d.ts +2 -0
- package/src/components/text.ts +11 -1
- package/src/debug-server.d.ts +2 -0
- package/src/debug-server.ts +51 -69
- package/src/hotkeys-markdown.ts +2 -0
- package/src/keybinding-matchers.d.ts +6 -0
- package/src/keybinding-matchers.ts +19 -0
- package/src/multiplexers/tmux.d.ts +1 -0
- package/src/multiplexers/tmux.ts +3 -0
- package/src/multiplexers/types.d.ts +6 -0
- package/src/multiplexers/types.ts +6 -0
- package/src/native/backend.d.ts +5 -4
- package/src/native/backend.ts +13 -5
- package/src/native/blobs.d.ts +24 -12
- package/src/native/blobs.ts +56 -7
- package/src/native/reconcile.ts +43 -21
- package/src/overlays/advisor-config.ts +259 -8
- package/src/overlays/agent-hub-projection.d.ts +10 -5
- package/src/overlays/agent-hub-projection.ts +63 -12
- package/src/overlays/annotation-overlay.ts +422 -168
- package/src/overlays/approval-dialog.ts +389 -0
- package/src/overlays/ask-dialog.ts +244 -105
- package/src/overlays/btw-history-panel.ts +208 -147
- package/src/overlays/extensions/extension-list.ts +4 -6
- package/src/overlays/hook-editor.ts +90 -32
- package/src/overlays/hook-input.ts +105 -19
- package/src/overlays/job-tree.ts +177 -0
- package/src/overlays/jobs-panel.ts +222 -142
- package/src/overlays/login-dialog.ts +201 -91
- package/src/overlays/mcp-add-wizard.ts +562 -279
- package/src/overlays/model-browser.ts +32 -7
- package/src/overlays/model-hub.ts +4 -10
- package/src/overlays/model-picker.ts +58 -21
- package/src/overlays/pause-screen.ts +81 -23
- package/src/overlays/plan-review-overlay.ts +16 -0
- package/src/overlays/plugin-selector.ts +17 -1
- package/src/overlays/queue-mode-selector.ts +10 -0
- package/src/overlays/report-panel.ts +6 -2
- package/src/overlays/reset-usage-selector.ts +130 -21
- package/src/overlays/session-account-selector.ts +36 -0
- package/src/overlays/session-info-overlay.ts +199 -76
- package/src/overlays/session-selector.ts +15 -10
- package/src/overlays/settings-selector.ts +3 -0
- package/src/overlays/show-images-selector.ts +1 -0
- package/src/overlays/snapcompact-shape-preview.ts +13 -6
- package/src/overlays/theme-selector.ts +6 -1
- package/src/overlays/thinking-selector.ts +8 -4
- package/src/overlays/tree-selector.ts +117 -2
- package/src/overlays/usage-dashboard.ts +498 -144
- package/src/prompt/composer-cache.ts +1 -1
- package/src/prompt/composer.ts +194 -74
- package/src/prompt/custom-editor.ts +168 -65
- package/src/prompt/image-references.d.ts +22 -0
- package/src/prompt/image-references.ts +79 -2
- package/src/prompt/internal-url-autocomplete.ts +1 -0
- package/src/prompt/macos-spelling.ts +28 -5
- package/src/prompt/prose-gate.ts +3 -0
- package/src/prompt/queued-messages.ts +9 -2
- package/src/prompt/tips.txt +1 -2
- package/src/prompt/typing-word.ts +59 -0
- package/src/prompt/welcome.ts +97 -45
- package/src/render/code-cell.ts +18 -5
- package/src/render/hanging-wrap.d.ts +7 -0
- package/src/render/hanging-wrap.ts +58 -0
- package/src/render/hyperlink.d.ts +2 -0
- package/src/render/hyperlink.ts +5 -0
- package/src/render/render-utils.d.ts +9 -1
- package/src/render/render-utils.ts +16 -2
- package/src/render/utils.d.ts +1 -1
- package/src/render/utils.ts +1 -1
- package/src/render/width-aware-text.ts +6 -5
- package/src/setup/scenes/splash.ts +22 -8
- package/src/status-line/component.ts +23 -10
- package/src/status-line/context-usage.ts +176 -73
- package/src/status-line/footer.ts +18 -35
- package/src/status-line/host.ts +6 -1
- package/src/status-line/segments.ts +16 -5
- package/src/status-line/startup.ts +6 -6
- package/src/status-line/types.ts +1 -0
- package/src/stdin-buffer.d.ts +7 -0
- package/src/stdin-buffer.ts +11 -1
- package/src/terminal-capabilities.d.ts +16 -1
- package/src/terminal-capabilities.ts +66 -28
- package/src/terminal-multiplexer.d.ts +7 -0
- package/src/terminal-multiplexer.ts +14 -0
- package/src/terminal.d.ts +8 -4
- package/src/terminal.ts +160 -46
- package/src/theme/symbols.d.ts +1 -1
- package/src/theme/symbols.ts +1 -0
- package/src/theme/theme-class.ts +1 -0
- package/src/theme/theme.d.ts +11 -0
- package/src/theme/theme.ts +46 -14
- package/src/thinking.d.ts +5 -0
- package/src/thinking.ts +9 -1
- package/src/tmux.d.ts +39 -4
- package/src/tmux.ts +110 -16
- package/src/tools/ask.ts +20 -9
- package/src/tools/ast-edit.d.ts +2 -2
- package/src/tools/ast-edit.ts +30 -7
- package/src/tools/ast-grep.d.ts +2 -2
- package/src/tools/ast-grep.ts +39 -35
- package/src/tools/bash.d.ts +6 -1
- package/src/tools/bash.ts +15 -9
- package/src/tools/debug.ts +2 -1
- package/src/tools/default-renderer.ts +3 -2
- package/src/tools/edit.d.ts +2 -0
- package/src/tools/edit.ts +100 -21
- package/src/tools/eval.d.ts +53 -4
- package/src/tools/eval.ts +173 -137
- package/src/tools/find.d.ts +14 -4
- package/src/tools/find.ts +71 -18
- package/src/tools/glob.d.ts +3 -3
- package/src/tools/glob.ts +51 -17
- package/src/tools/grep.d.ts +2 -2
- package/src/tools/grep.ts +99 -22
- package/src/tools/grouped-file-output.d.ts +9 -4
- package/src/tools/grouped-file-output.ts +21 -6
- package/src/tools/lsp.ts +30 -18
- package/src/tools/mcp.ts +2 -2
- package/src/tools/native-view.d.ts +1 -1
- package/src/tools/native-view.ts +2 -2
- package/src/tools/read.d.ts +32 -10
- package/src/tools/read.ts +89 -43
- package/src/tools/renderer.d.ts +2 -0
- package/src/tools/renderer.ts +2 -0
- package/src/tools/task.d.ts +31 -0
- package/src/tools/task.ts +40 -7
- package/src/tools/todo.ts +3 -2
- package/src/tools/wait.ts +16 -30
- package/src/tools/web-search.ts +2 -1
- package/src/tools/write.d.ts +2 -0
- package/src/tools/write.ts +36 -12
- package/src/tools/yield.ts +2 -2
- package/src/tui.d.ts +20 -3
- package/src/tui.ts +140 -36
- package/src/utils.ts +5 -3
- package/dist/types/tools/eval-format/code-mode-declarations.d.ts +0 -5
- package/src/tools/eval-format/code-mode-declarations.ts +0 -61
package/dist/types/terminal.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ export type GlyphProtocolReportHandler = (supported: boolean) => void;
|
|
|
117
117
|
/**
|
|
118
118
|
* Outcome of the Tern Surface Protocol `hello` probe: the terminal's reply,
|
|
119
119
|
* or null when it answered the DA1 sentinel first (no TSP) or the probe was
|
|
120
|
-
* skipped (`PI_TUI_NATIVE=0`, multiplexers).
|
|
120
|
+
* skipped (`PI_TUI_NATIVE=0`, multiplexers, devenv's reloading shell).
|
|
121
121
|
*/
|
|
122
122
|
export type TspHelloHandler = (hello: TspHello | null) => void;
|
|
123
123
|
/**
|
|
@@ -181,6 +181,7 @@ export interface Terminal {
|
|
|
181
181
|
get kittyEnableSequence(): string | null;
|
|
182
182
|
readonly keyboardEnhancementEnterSequence?: string | null;
|
|
183
183
|
readonly keyboardEnhancementExitSequence?: string | null;
|
|
184
|
+
readonly keyboardEnhancementRestoreSequence?: string | null;
|
|
184
185
|
moveBy(lines: number): void;
|
|
185
186
|
hideCursor(force?: boolean): void;
|
|
186
187
|
showCursor(force?: boolean): void;
|
|
@@ -283,9 +284,11 @@ export interface ProcessTerminalOptions {
|
|
|
283
284
|
conpty?: boolean;
|
|
284
285
|
/**
|
|
285
286
|
* Whether stdin is a native Windows console handle (win32, not WSL), whose
|
|
286
|
-
* console host
|
|
287
|
-
*
|
|
288
|
-
*
|
|
287
|
+
* console host is certain to answer `CSI ? 9001 h` with win32-input-mode key
|
|
288
|
+
* records. When false (WSL), the keyboard fallback requests modifyOtherKeys
|
|
289
|
+
* alongside win32-input-mode, since a WSL pty may not be relayed by a console
|
|
290
|
+
* host. Defaults to `process.platform === "win32"`; only consulted when
|
|
291
|
+
* `conpty` is also true.
|
|
289
292
|
*/
|
|
290
293
|
nativeWindowsConsole?: boolean;
|
|
291
294
|
}
|
|
@@ -298,6 +301,7 @@ export declare class ProcessTerminal implements Terminal {
|
|
|
298
301
|
get kittyProtocolActive(): boolean;
|
|
299
302
|
get kittyEnableSequence(): string | null;
|
|
300
303
|
get keyboardEnhancementEnterSequence(): string | null;
|
|
304
|
+
get keyboardEnhancementRestoreSequence(): string | null;
|
|
301
305
|
get keyboardEnhancementExitSequence(): string | null;
|
|
302
306
|
get appearance(): TerminalAppearance | undefined;
|
|
303
307
|
onAppearanceChange(callback: (appearance: TerminalAppearance, requestToken?: TerminalAppearanceRequestToken) => void): void;
|
|
@@ -9,7 +9,7 @@ export type SymbolMap = Record<SymbolKey, string>;
|
|
|
9
9
|
* resolves through `Theme.cmd` to either a dedicated `cmd.*` symbol or an
|
|
10
10
|
* existing `icon.*` symbol shared with the rest of the UI.
|
|
11
11
|
*/
|
|
12
|
-
export type SlashCommandIconName = "action" | "prompt" | "extension" | "settings" | "gear" | "shield" | "wave" | "compass" | "inbox" | "swap" | "expand" | "computer" | "eye" | "todo" | "stats" | "news" | "keyboard" | "export" | "clipboard" | "share" | "broadcast" | "globe" | "copy" | "plus" | "restart" | "eraser" | "trash" | "compress" | "vibrate" | "handoff" | "history" | "question" | "rocket" | "stethoscope" | "redo" | "bug" | "memory" | "pencil" | "folderMove" | "folderPlus" | "folderMinus" | "hammer" | "power" | "cart" | "model" | "plan" | "prewalk" | "goal" | "pause" | "loop" | "session" | "jobs" | "gauge" | "context" | "agents" | "branch" | "tree" | "signIn" | "signOut" | "advisor" | "host" | "package" | "fast" | "voice" | "tools" | "rule" | "skill" | "mcp" | "pin";
|
|
12
|
+
export type SlashCommandIconName = "action" | "prompt" | "extension" | "settings" | "gear" | "shield" | "wave" | "compass" | "inbox" | "swap" | "expand" | "computer" | "eye" | "todo" | "stats" | "news" | "keyboard" | "export" | "clipboard" | "share" | "broadcast" | "globe" | "copy" | "plus" | "restart" | "eraser" | "trash" | "compress" | "vibrate" | "handoff" | "history" | "question" | "rocket" | "stethoscope" | "redo" | "bug" | "memory" | "pencil" | "folderMove" | "folderPlus" | "folderMinus" | "hammer" | "power" | "cart" | "model" | "plan" | "prewalk" | "goal" | "pause" | "loop" | "session" | "jobs" | "gauge" | "context" | "ghost" | "agents" | "branch" | "tree" | "signIn" | "signOut" | "advisor" | "host" | "package" | "fast" | "voice" | "tools" | "rule" | "skill" | "mcp" | "pin";
|
|
13
13
|
export declare const SYMBOL_PRESETS: Record<SymbolPreset, SymbolMap>;
|
|
14
14
|
export type SpinnerType = "status" | "activity";
|
|
15
15
|
export declare const SPINNER_FRAMES: Record<SymbolPreset, Record<SpinnerType, string[]>>;
|
|
@@ -7,6 +7,17 @@ export { isValidThemeColor, type ThemeBg, type ThemeColor } from "./schema.js";
|
|
|
7
7
|
export { getAvailableSymbolPresets, isValidSymbolPreset, type SpinnerType, type SymbolKey, type SymbolPreset, } from "./symbols.js";
|
|
8
8
|
export { Theme } from "./theme-class.js";
|
|
9
9
|
export { createHighlightStream, getEditorTheme, getMarkdownTheme, getMarkdownThemeWithLinkTargets, getSelectListTheme, getSettingsListTheme, getSymbolTheme, highlightCode, setMarkdownMermaidRendering, warmHighlighter, } from "./tui-adapters.js";
|
|
10
|
+
/**
|
|
11
|
+
* Subscribe to native fallback appearance changes independently of theme changes.
|
|
12
|
+
* Consumers must re-check the effective background: COLORFGBG can override it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function onTerminalBackgroundFallbackChange(callback: () => void): () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Detect appearance from trusted OSC 11 reports, then COLORFGBG, then native
|
|
17
|
+
* macOS appearance only on known-broken multiplexer background-query paths.
|
|
18
|
+
* Defaults to dark when none of those signals is available.
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectTerminalBackground(): "dark" | "light";
|
|
10
21
|
/** Active theme; imports remain live across initialization, previews, and theme switches. */
|
|
11
22
|
export declare var theme: Theme;
|
|
12
23
|
type ThemeBinding = (value: Theme) => void;
|
package/dist/types/thinking.d.ts
CHANGED
|
@@ -37,6 +37,11 @@ export declare function shouldDisableReasoning(level: ThinkingLevel | undefined)
|
|
|
37
37
|
* Resolves a selector against the current model while preserving explicit "off".
|
|
38
38
|
*/
|
|
39
39
|
export declare function resolveThinkingLevelForModel(model: Model | undefined, level: ThinkingLevel | undefined): ResolvedThinkingLevel | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Level applied to `model` when the user has not picked one for it (carried,
|
|
42
|
+
* global default, auto). Unverified thinking stays unset until the user picks.
|
|
43
|
+
*/
|
|
44
|
+
export declare function automaticThinkingLevel<T>(model: Model | undefined, fallback: T): T | undefined;
|
|
40
45
|
/**
|
|
41
46
|
* Sentinel selector for the coding-agent "auto" thinking mode. Kept entirely
|
|
42
47
|
* inside the coding-agent layer: it is never an {@link Effort} or
|
package/dist/types/tmux.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export { wrapTmuxPassthrough } from "./multiplexers/tmux.js";
|
|
2
2
|
/** Pass a control sequence through tmux, leaving direct-terminal output unchanged. */
|
|
3
3
|
export declare function wrapTmuxPassthroughIfNeeded(payload: string, env?: NodeJS.ProcessEnv): string;
|
|
4
|
+
/**
|
|
5
|
+
* Emulator name candidates from a `#{client_termtype}<TAB>#{client_termname}`
|
|
6
|
+
* line, best first: the terminal-type reply (tmux 3.4+, XTVERSION), then the
|
|
7
|
+
* emulator the client's `TERM` names when it ships its own terminfo entry. Both
|
|
8
|
+
* are kept because the reply can name an unrecognized program (a nested tmux
|
|
9
|
+
* answers `tmux 3.4`) while `TERM` still identifies the emulator.
|
|
10
|
+
*/
|
|
11
|
+
export declare function tmuxClientProgramsFromReport(report: string): string[];
|
|
4
12
|
/**
|
|
5
13
|
* Whether the terminal hosting this tmux session draws TSP programs natively:
|
|
6
14
|
* it sets the session user option `@tern-tsp` while it watches the session.
|
|
@@ -12,10 +20,37 @@ export declare function tmuxSessionSpeaksTsp(env?: NodeJS.ProcessEnv): boolean;
|
|
|
12
20
|
*/
|
|
13
21
|
export declare function setTmuxPaneApcTitles(on: boolean, env?: NodeJS.ProcessEnv): void;
|
|
14
22
|
/**
|
|
15
|
-
* Resolve the terminal emulator
|
|
23
|
+
* Resolve the terminal emulator names recorded for this tmux client, best first.
|
|
16
24
|
*
|
|
17
25
|
* tmux overwrites pane identity variables with its own values, but retains the
|
|
18
|
-
* attached client's terminal-type reply in `#{client_termtype}
|
|
19
|
-
*
|
|
26
|
+
* attached client's terminal-type reply in `#{client_termtype}` and its `TERM`
|
|
27
|
+
* in `#{client_termname}` (see {@link tmuxClientProgramsFromReport}). The local
|
|
28
|
+
* IPC query runs once per process and degrades to `[]` when unavailable.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveTmuxClientTerminalNames(env?: NodeJS.ProcessEnv): readonly string[];
|
|
31
|
+
/**
|
|
32
|
+
* Whether tmux draws SIXEL to the client attached to this session: its
|
|
33
|
+
* effective terminal description for that client carries `Sxl`.
|
|
34
|
+
*
|
|
35
|
+
* A tmux built with SIXEL answers every pane's DA1 with attribute 4 and draws a
|
|
36
|
+
* `SIXEL IMAGE (WxH)` text placeholder for clients without SIXEL, so the pane's
|
|
37
|
+
* DA1 says nothing about the outer terminal. tmux itself renders SIXEL only
|
|
38
|
+
* when the client's terminal has `Sxl`, whether from terminfo,
|
|
39
|
+
* `terminal-overrides`, or the `sixel` feature (DA1 or `terminal-features`),
|
|
40
|
+
* and `show-messages -T` reports that merged description. The TUI consults
|
|
41
|
+
* this before trusting the pane's DA1 attribute. Queried once per tmux
|
|
42
|
+
* session; `false` outside tmux, with no attached client, or when the query
|
|
43
|
+
* fails. Nested tmux usually reports no `Sxl`: the inner client's terminal is
|
|
44
|
+
* the outer tmux, whose DA1 starts with level 1, which tmux does not parse
|
|
45
|
+
* for features.
|
|
46
|
+
*/
|
|
47
|
+
export declare function tmuxClientRendersSixel(env?: NodeJS.ProcessEnv): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether tmux forwards this pane's `\x1bPtmux;…\x1b\\` passthrough envelopes
|
|
50
|
+
* to the attached client. tmux 3.3+ defaults `allow-passthrough` to `off` and
|
|
51
|
+
* then silently drops every wrapped sequence, so Kitty graphics sent through
|
|
52
|
+
* the envelope never reach a Kitty-capable outer terminal. Resolves the
|
|
53
|
+
* effective pane value (pane → window → global). Queried once per pane;
|
|
54
|
+
* `false` outside tmux or when the query fails.
|
|
20
55
|
*/
|
|
21
|
-
export declare function
|
|
56
|
+
export declare function tmuxPaneAllowsPassthrough(env?: NodeJS.ProcessEnv): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Component } from "../tui.js";
|
|
2
2
|
import type { Theme } from "../theme/theme.js";
|
|
3
3
|
import type { OutputMeta } from "./output-meta.js";
|
|
4
|
-
import type { NativeToolView, RenderResultOptions } from "./renderer.js";
|
|
4
|
+
import type { NativeToolView, RenderResultContextOptions, RenderResultOptions } from "./renderer.js";
|
|
5
5
|
/** Display metadata returned by ast-edit. */
|
|
6
6
|
export interface AstEditToolDetails {
|
|
7
7
|
totalReplacements: number;
|
|
@@ -47,7 +47,7 @@ export declare const astEditToolRenderer: {
|
|
|
47
47
|
}>;
|
|
48
48
|
details?: AstEditToolDetails;
|
|
49
49
|
isError?: boolean;
|
|
50
|
-
}, options:
|
|
50
|
+
}, options: RenderResultContextOptions, uiTheme: Theme, args?: AstEditRenderArgs): Component;
|
|
51
51
|
describeCall(args: AstEditRenderArgs): NativeToolView;
|
|
52
52
|
describeResult(result: {
|
|
53
53
|
content: Array<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Component } from "../tui.js";
|
|
2
2
|
import type { Theme } from "../theme/theme.js";
|
|
3
3
|
import type { OutputMeta } from "./output-meta.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { NativeToolView, RenderResultContextOptions, RenderResultOptions } from "./renderer.js";
|
|
5
5
|
/** Display metadata returned by ast-grep. */
|
|
6
6
|
export interface AstGrepToolDetails {
|
|
7
7
|
matchCount: number;
|
|
@@ -46,7 +46,7 @@ export declare const astGrepToolRenderer: {
|
|
|
46
46
|
}>;
|
|
47
47
|
details?: AstGrepToolDetails;
|
|
48
48
|
isError?: boolean;
|
|
49
|
-
}, options:
|
|
49
|
+
}, options: RenderResultContextOptions, uiTheme: Theme, args?: AstGrepRenderArgs): Component;
|
|
50
50
|
describeCall(args: AstGrepRenderArgs): NativeToolView;
|
|
51
51
|
describeResult(result: {
|
|
52
52
|
content: Array<{
|
|
@@ -18,6 +18,8 @@ export interface BashToolDetails {
|
|
|
18
18
|
requestedTimeoutSeconds?: number;
|
|
19
19
|
timeoutDisabled?: boolean;
|
|
20
20
|
wallTimeMs?: number;
|
|
21
|
+
/** False when no wall-time footer was emitted; absent on older results. */
|
|
22
|
+
wallTimeNoticeEmitted?: boolean;
|
|
21
23
|
/** Exit code of a command that ran to completion but failed (non-zero). */
|
|
22
24
|
exitCode?: number;
|
|
23
25
|
/** True when the command was killed by its timeout deadline (not a failure). */
|
|
@@ -31,12 +33,15 @@ export interface BashToolDetails {
|
|
|
31
33
|
timedOut: boolean;
|
|
32
34
|
pid?: number;
|
|
33
35
|
};
|
|
36
|
+
/** Background job behind the call; `cancelled`: killed (`proc://<id>/kill`) before it finished. */
|
|
34
37
|
async?: {
|
|
35
|
-
state: "running" | "completed" | "failed";
|
|
38
|
+
state: "running" | "completed" | "failed" | "cancelled";
|
|
36
39
|
jobId: string;
|
|
37
40
|
type: "bash";
|
|
38
41
|
};
|
|
39
42
|
}
|
|
43
|
+
/** Minimum duration for a model-facing wall-time notice; shorter runs keep timing only in details. */
|
|
44
|
+
export declare const WALL_TIME_NOTICE_MIN_MS = 1000;
|
|
40
45
|
/** Formats the model-facing command duration notice. */
|
|
41
46
|
export declare function formatWallTimeNotice(wallTimeMs: number): string;
|
|
42
47
|
/** Formats the model-facing command exit status notice. */
|
|
@@ -133,6 +133,8 @@ export interface EditRenderContext {
|
|
|
133
133
|
renderDiff?: (diffText: string, options?: {
|
|
134
134
|
filePath?: string;
|
|
135
135
|
}) => string;
|
|
136
|
+
/** Unsanitized result metadata, used only for filesystem link targets. */
|
|
137
|
+
rawDetails?: unknown;
|
|
136
138
|
}
|
|
137
139
|
/** Render replacement text until a computed diff preview is available. */
|
|
138
140
|
export declare function renderStreamingFallback(editMode: EditMode, args: unknown, theme: Theme): string;
|
|
@@ -13,25 +13,60 @@ export interface EvalStatusEvent {
|
|
|
13
13
|
resolvedThinkingLevel?: ConfiguredThinkingLevel;
|
|
14
14
|
[key: string]: unknown;
|
|
15
15
|
}
|
|
16
|
+
/** One column of a table view. */
|
|
17
|
+
export interface EvalTableColumn {
|
|
18
|
+
head: string;
|
|
19
|
+
/** Numeric values: renderers right-align the column. */
|
|
20
|
+
numeric?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A pretty rendering of something a cell printed, shown to the user in place
|
|
24
|
+
* of its text; the model only ever sees the text.
|
|
25
|
+
* - `table`: a data frame or `console.table`; leading index columns are plain
|
|
26
|
+
* columns, and a truncated frame's elided rows/columns are `…` cells.
|
|
27
|
+
* - `json`: a structured value (dict/list, object/array) as a collapsible tree.
|
|
28
|
+
* - `markdown`: an object's Markdown representation.
|
|
29
|
+
*/
|
|
30
|
+
export type EvalView = {
|
|
31
|
+
kind: "table";
|
|
32
|
+
columns: EvalTableColumn[];
|
|
33
|
+
rows: string[][];
|
|
34
|
+
} | {
|
|
35
|
+
kind: "json";
|
|
36
|
+
value: unknown;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "markdown";
|
|
39
|
+
text: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A view and the exact printed text it stands for. Renderers locate `text` in
|
|
43
|
+
* the cell's `output` (entries in print order) and show the view there; an
|
|
44
|
+
* entry whose text is no longer in the output (truncated) is skipped.
|
|
45
|
+
*/
|
|
46
|
+
export interface EvalViewEntry {
|
|
47
|
+
text: string;
|
|
48
|
+
view: EvalView;
|
|
49
|
+
}
|
|
16
50
|
/** Per-cell execution result for transcript rendering. */
|
|
17
51
|
export interface EvalCellResult {
|
|
18
52
|
index: number;
|
|
19
53
|
title?: string;
|
|
20
54
|
code: string;
|
|
21
55
|
language?: EvalLanguage;
|
|
56
|
+
/** What the model saw: the cell's printed text plus image notes. */
|
|
22
57
|
output: string;
|
|
58
|
+
/** Pretty views of spans of `output`, in print order. */
|
|
59
|
+
views?: EvalViewEntry[];
|
|
23
60
|
status: "pending" | "running" | "complete" | "error";
|
|
24
61
|
durationMs?: number;
|
|
25
62
|
exitCode?: number;
|
|
26
63
|
statusEvents?: EvalStatusEvent[];
|
|
27
64
|
/** Discrete events dropped from the front of `statusEvents` (see {@link recordStatusEvent}). */
|
|
28
65
|
statusEventsElided?: number;
|
|
29
|
-
hasMarkdown?: boolean;
|
|
30
66
|
}
|
|
31
67
|
/** Tool result detail object surfaced to the UI/transcript. */
|
|
32
68
|
export interface EvalToolDetails {
|
|
33
69
|
cells?: EvalCellResult[];
|
|
34
|
-
jsonOutputs?: unknown[];
|
|
35
70
|
images?: ImageContent[];
|
|
36
71
|
statusEvents?: EvalStatusEvent[];
|
|
37
72
|
/** Discrete events dropped from the front of `statusEvents` (see {@link recordStatusEvent}). */
|
|
@@ -44,9 +79,9 @@ export interface EvalToolDetails {
|
|
|
44
79
|
languages?: EvalLanguage[];
|
|
45
80
|
/** Optional human-readable notice (e.g. fallback explanation). */
|
|
46
81
|
notice?: string;
|
|
47
|
-
/** Present when the cell was auto-backgrounded as an async job. */
|
|
82
|
+
/** Present when the cell was auto-backgrounded as an async job; `cancelled`: killed before it finished. */
|
|
48
83
|
async?: {
|
|
49
|
-
state: "running" | "completed" | "failed";
|
|
84
|
+
state: "running" | "completed" | "failed" | "cancelled";
|
|
50
85
|
jobId: string;
|
|
51
86
|
type: "eval";
|
|
52
87
|
};
|
|
@@ -100,6 +135,20 @@ export declare function upsertStatusEvent(events: EvalStatusEvent[], event: Eval
|
|
|
100
135
|
* events behind an "… N earlier" row.
|
|
101
136
|
*/
|
|
102
137
|
export declare function recordStatusEvent(log: StatusEventLog, event: EvalStatusEvent): void;
|
|
138
|
+
/** One ordered piece of a cell's output: printed text, or a view shown in place of the text it matched. */
|
|
139
|
+
export type EvalOutputPart = {
|
|
140
|
+
kind: "text";
|
|
141
|
+
text: string;
|
|
142
|
+
} | {
|
|
143
|
+
kind: "view";
|
|
144
|
+
view: EvalView;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Split `output` around its views, in order: each view's `text` is searched
|
|
148
|
+
* from the end of the previous match, unmatched entries are skipped, and
|
|
149
|
+
* blank text between views is dropped (newlines bordering a view trimmed).
|
|
150
|
+
*/
|
|
151
|
+
export declare function splitEvalOutput(output: string, views: readonly EvalViewEntry[] | undefined): EvalOutputPart[];
|
|
103
152
|
/** Render eval code cells, structured display output, and progress events. */
|
|
104
153
|
export declare const evalToolRenderer: {
|
|
105
154
|
animatedPendingPreview: true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Theme } from "../theme/theme.js";
|
|
2
2
|
import type { Component } from "../tui.js";
|
|
3
3
|
import type { OutputMeta } from "./output-meta.js";
|
|
4
|
-
import type { NativeToolView, RenderResultOptions } from "./renderer.js";
|
|
4
|
+
import type { NativeToolView, RenderResultContextOptions, RenderResultOptions } from "./renderer.js";
|
|
5
5
|
/** A verified line range with its yes-probability and a one-line preview. */
|
|
6
6
|
export interface FindRange {
|
|
7
7
|
start: number;
|
|
@@ -22,12 +22,21 @@ export interface FindHit {
|
|
|
22
22
|
linesSeen: number;
|
|
23
23
|
truncated: boolean;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* How much of a search the judge actually covered. `unavailable`: every judge
|
|
27
|
+
* request failed, so an empty result is not evidence of absence. `partial`:
|
|
28
|
+
* some requests failed. `complete`: none failed (or none were needed).
|
|
29
|
+
*/
|
|
30
|
+
export type FindCoverage = "complete" | "partial" | "unavailable";
|
|
25
31
|
/** Search accounting reported alongside the hits. */
|
|
26
32
|
export interface FindStats {
|
|
27
33
|
/** Eligible files under the root. */
|
|
28
34
|
listed: number;
|
|
29
35
|
requests: number;
|
|
30
|
-
|
|
36
|
+
/** Judge requests that failed outright; decides {@link FindCoverage}. */
|
|
37
|
+
failed: number;
|
|
38
|
+
/** Questions a successful response left without a usable answer. */
|
|
39
|
+
unanswered: number;
|
|
31
40
|
/** Entries judged by name. */
|
|
32
41
|
judged: number;
|
|
33
42
|
/** Files whose content was read and sent. */
|
|
@@ -51,6 +60,7 @@ export interface FindToolDetails {
|
|
|
51
60
|
/** Verified-passage probability at or above which a file is a hit. */
|
|
52
61
|
threshold: number;
|
|
53
62
|
hits: FindHit[];
|
|
63
|
+
coverage: FindCoverage;
|
|
54
64
|
stats: FindStats;
|
|
55
65
|
elapsedMs: number;
|
|
56
66
|
/** Session cwd; hit paths are relative to it. */
|
|
@@ -74,7 +84,7 @@ export declare const findToolRenderer: {
|
|
|
74
84
|
}>;
|
|
75
85
|
details?: FindToolDetails;
|
|
76
86
|
isError?: boolean;
|
|
77
|
-
}, options:
|
|
87
|
+
}, options: RenderResultContextOptions, uiTheme: Theme, args?: FindRenderArgs): Component;
|
|
78
88
|
describeCall(args: FindRenderArgs): NativeToolView;
|
|
79
89
|
/**
|
|
80
90
|
* Inline (§7.3 find): `Find “query” 2 hits · 8 files`, then per hit its
|
|
@@ -88,7 +98,7 @@ export declare const findToolRenderer: {
|
|
|
88
98
|
}>;
|
|
89
99
|
details?: FindToolDetails;
|
|
90
100
|
isError?: boolean;
|
|
91
|
-
}, options:
|
|
101
|
+
}, options: RenderResultContextOptions, args?: FindRenderArgs): NativeToolView;
|
|
92
102
|
mergeCallAndResult: true;
|
|
93
103
|
animatedPendingPreview: true;
|
|
94
104
|
animatedPartialResult: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from "../tui.js";
|
|
2
|
-
import type { NativeToolView, RenderResultOptions } from "./renderer.js";
|
|
2
|
+
import type { NativeToolView, RenderResultContextOptions, RenderResultOptions } from "./renderer.js";
|
|
3
3
|
import { type Theme } from "../theme/theme.js";
|
|
4
4
|
import type { OutputMeta } from "./output-meta.js";
|
|
5
5
|
import type { TruncationResult } from "./streaming-output.js";
|
|
@@ -42,7 +42,7 @@ export declare const globToolRenderer: {
|
|
|
42
42
|
}>;
|
|
43
43
|
details?: GlobToolDetails;
|
|
44
44
|
isError?: boolean;
|
|
45
|
-
}, options:
|
|
45
|
+
}, options: RenderResultContextOptions, uiTheme: Theme, args?: GlobRenderArgs): Component;
|
|
46
46
|
describeCall(args: GlobRenderArgs): NativeToolView;
|
|
47
47
|
/**
|
|
48
48
|
* Inline (§7.3 glob): `Glob “pattern” 5 files`, then the files as rows
|
|
@@ -55,7 +55,7 @@ export declare const globToolRenderer: {
|
|
|
55
55
|
}>;
|
|
56
56
|
details?: GlobToolDetails;
|
|
57
57
|
isError?: boolean;
|
|
58
|
-
},
|
|
58
|
+
}, options: RenderResultContextOptions, args?: GlobRenderArgs): NativeToolView;
|
|
59
59
|
mergeCallAndResult: true;
|
|
60
60
|
};
|
|
61
61
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from "../tui.js";
|
|
2
|
-
import type { NativeToolView, RenderResultOptions } from "./renderer.js";
|
|
2
|
+
import type { NativeToolView, RenderResultContextOptions, RenderResultOptions } from "./renderer.js";
|
|
3
3
|
import { type Theme } from "../theme/theme.js";
|
|
4
4
|
import type { OutputMeta } from "./output-meta.js";
|
|
5
5
|
import type { TruncationResult } from "./streaming-output.js";
|
|
@@ -58,7 +58,7 @@ export declare const grepToolRenderer: {
|
|
|
58
58
|
}>;
|
|
59
59
|
details?: GrepToolDetails;
|
|
60
60
|
isError?: boolean;
|
|
61
|
-
}, options:
|
|
61
|
+
}, options: RenderResultContextOptions, uiTheme: Theme, args?: GrepRenderArgs): Component;
|
|
62
62
|
describeCall(args: GrepRenderArgs): NativeToolView;
|
|
63
63
|
/**
|
|
64
64
|
* Inline (§7.3 grep): `Grep “pattern” 5 matches · 2 files in src`, then
|
|
@@ -110,10 +110,13 @@ export interface NumberedLine {
|
|
|
110
110
|
* Numbered `code` for possibly non-contiguous source lines: one block per run
|
|
111
111
|
* of consecutive line numbers (`start` = the run's first line, match lines
|
|
112
112
|
* `mark`ed), with a `…` row wherever the numbers jump or an elision marker
|
|
113
|
-
* (`n: null`) sits.
|
|
113
|
+
* (`n: null`) sits. `path` is the file the lines come from: Tern picks their
|
|
114
|
+
* grammar from it and draws no header (the row or head above names the file).
|
|
115
|
+
* `wrap` soft-wraps long lines instead of scrolling the block sideways.
|
|
114
116
|
*/
|
|
115
117
|
export declare function numberedCode(lines: readonly NumberedLine[], opts?: {
|
|
116
|
-
|
|
118
|
+
path?: string;
|
|
119
|
+
wrap?: boolean;
|
|
117
120
|
}): NativeNode[];
|
|
118
121
|
/**
|
|
119
122
|
* Describe grouped search output (grep / ast-grep / ast-edit display content)
|
|
@@ -121,9 +124,11 @@ export declare function numberedCode(lines: readonly NumberedLine[], opts?: {
|
|
|
121
124
|
* header's suffix or the match count as a chip), then its lines as
|
|
122
125
|
* {@link numberedCode} with match lines marked and `…` between non-adjacent
|
|
123
126
|
* runs. Unnumbered body lines stay plain `code`. `maxFiles` keeps only the
|
|
124
|
-
* first files (the caller says how many were left out).
|
|
127
|
+
* first files (the caller says how many were left out). `file` owns the lines
|
|
128
|
+
* before any header: a single-file search prints none, yet its lines get the
|
|
129
|
+
* same file row as a directory search's.
|
|
125
130
|
*/
|
|
126
131
|
export declare function describeGroupedOutput(lines: readonly string[], options?: {
|
|
127
|
-
lang?: (path: string) => string | undefined;
|
|
128
132
|
maxFiles?: number;
|
|
133
|
+
file?: string;
|
|
129
134
|
}): NativeNode[];
|
|
@@ -85,7 +85,7 @@ export interface RunFootInput {
|
|
|
85
85
|
readonly state: RunState;
|
|
86
86
|
/** Exit code of a `failed` run; a non-zero code names the state `exit N`. */
|
|
87
87
|
readonly exitCode?: number;
|
|
88
|
-
/** Milliseconds run so far (`running`) or in total;
|
|
88
|
+
/** Milliseconds run so far (`running`, a live `background` job) or in total; omitted when undefined. */
|
|
89
89
|
readonly elapsedMs?: number;
|
|
90
90
|
/** Quiet facts (job id, service state, artifact), muted and ` · `-joined. */
|
|
91
91
|
readonly facts?: readonly string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SummaryResult } from "@linxiraos/pi-natives";
|
|
2
2
|
import type { Component } from "../tui.js";
|
|
3
|
-
import type { NativeToolView, RenderResultOptions, ToolActivityContext, ToolActivitySummary } from "./renderer.js";
|
|
3
|
+
import type { RenderResultContextOptions, NativeToolView, RenderResultOptions, ToolActivityContext, ToolActivitySummary } from "./renderer.js";
|
|
4
4
|
import type { NativeNode } from "../native/node.js";
|
|
5
5
|
import type { Theme } from "../theme/theme.js";
|
|
6
6
|
import type { OutputMeta } from "./output-meta.js";
|
|
@@ -20,6 +20,12 @@ export interface ReadToolDetails {
|
|
|
20
20
|
truncation?: ReadTruncationStats;
|
|
21
21
|
isDirectory?: boolean;
|
|
22
22
|
resolvedPath?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Absolute path of the disk file whose image this read returned. A native TSP host that
|
|
25
|
+
* supports `media` shows the file by path instead of the uploaded image bytes. Unset for
|
|
26
|
+
* screenshots, URL reads and other images not backed by a file. Display-only.
|
|
27
|
+
*/
|
|
28
|
+
mediaPath?: string;
|
|
23
29
|
suffixResolution?: {
|
|
24
30
|
from: string;
|
|
25
31
|
to: string;
|
|
@@ -34,6 +40,11 @@ export interface ReadToolDetails {
|
|
|
34
40
|
fileSize?: number;
|
|
35
41
|
/** Full source line count when the read reached EOF and the count is exact. */
|
|
36
42
|
totalLines?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the text's rows carry line-number prefixes (`N:` hashline, `N|` line numbers). Set where a
|
|
45
|
+
* file read is formatted; a raw read sets `false`. Snapcompact reads it to tell a `12:` prefix from content.
|
|
46
|
+
*/
|
|
47
|
+
rowPrefixes?: boolean;
|
|
37
48
|
/** Raw text + start line for user-visible TUI rendering, set when content is text-like.
|
|
38
49
|
* Mirrors the same lines the model receives but without hashline/line-number prefixes,
|
|
39
50
|
* so the TUI can render the file content with its own gutter without re-parsing the formatted text. */
|
|
@@ -49,7 +60,10 @@ export interface ReadToolDetails {
|
|
|
49
60
|
};
|
|
50
61
|
/** Number of unresolved git conflicts surfaced by this read (TUI uses for inline `⚠ N` badge). */
|
|
51
62
|
conflictCount?: number;
|
|
52
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Paths recovered from a delimited read argument. The TUI renders one call as multiple read rows; snapcompact
|
|
65
|
+
* keeps such a composite result as text.
|
|
66
|
+
*/
|
|
53
67
|
displayReadTargets?: string[];
|
|
54
68
|
/**
|
|
55
69
|
* Resolved filesystem link target for each {@link displayReadTargets} entry, aligned by index; `null` when a
|
|
@@ -107,14 +121,22 @@ export declare function pendingFileLinkPath(inputPath: string): string;
|
|
|
107
121
|
* target when the structured `resolvedPath` isn't set (the common plain-file and
|
|
108
122
|
* image reads only record the path in `meta.source`). URL/internal sources are
|
|
109
123
|
* not fs paths, so only `type: "path"` qualifies. */
|
|
110
|
-
export declare function readSourceFsPath(details:
|
|
124
|
+
export declare function readSourceFsPath(details: unknown): string | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Whether a read result renders as a Markdown preview rather than numbered source:
|
|
127
|
+
* the read tool tagged it `text/markdown` (`read.renderMarkdown`, or a protocol
|
|
128
|
+
* resource) and the call did not ask for `:raw` source. Shared by the standalone
|
|
129
|
+
* read card and the read group's content previews so both honor the setting.
|
|
130
|
+
*/
|
|
131
|
+
export declare function readResultIsMarkdown(details: ReadToolDetails | undefined, args: ReadRenderArgs | undefined): boolean;
|
|
111
132
|
/**
|
|
112
|
-
* Read content as numbered `code` (no path header: the head names
|
|
113
|
-
*
|
|
114
|
-
* `null` for an elided
|
|
115
|
-
* every line, else count
|
|
133
|
+
* Read content as numbered, wrapped `code` (no path header: the head names
|
|
134
|
+
* the file), matching the ANSI preview's hanging wrap. Numbers come from
|
|
135
|
+
* `lineNumbers` (`displayContent`'s per-line numbers, `null` for an elided
|
|
136
|
+
* block; runs split with `…` between) when they cover every line, else count
|
|
137
|
+
* up from `start`.
|
|
116
138
|
*/
|
|
117
|
-
export declare function readContentCode(content: string, start: number, numbers: readonly (number | null)[] | undefined,
|
|
139
|
+
export declare function readContentCode(content: string, start: number, numbers: readonly (number | null)[] | undefined, path: string | undefined): NativeNode[];
|
|
118
140
|
/** Render file, image, and URL reads in the transcript. */
|
|
119
141
|
export declare const readToolRenderer: {
|
|
120
142
|
activitySummary(args: unknown, _context: ToolActivityContext): ToolActivitySummary;
|
|
@@ -126,7 +148,7 @@ export declare const readToolRenderer: {
|
|
|
126
148
|
}>;
|
|
127
149
|
details?: ReadToolDetails;
|
|
128
150
|
isError?: boolean;
|
|
129
|
-
}, options:
|
|
151
|
+
}, options: RenderResultContextOptions, uiTheme: Theme, args?: ReadRenderArgs): Component;
|
|
130
152
|
describeCall(args: ReadRenderArgs): NativeToolView;
|
|
131
153
|
/**
|
|
132
154
|
* Inline (§7.3 read): the head names the file and range; the content
|
|
@@ -140,7 +162,7 @@ export declare const readToolRenderer: {
|
|
|
140
162
|
}>;
|
|
141
163
|
details?: ReadToolDetails;
|
|
142
164
|
isError?: boolean;
|
|
143
|
-
},
|
|
165
|
+
}, options: RenderResultContextOptions, args?: ReadRenderArgs): NativeToolView;
|
|
144
166
|
mergeCallAndResult: true;
|
|
145
167
|
};
|
|
146
168
|
/** Inclusive line range describing one elided span in a structural summary. */
|
|
@@ -33,6 +33,8 @@ export interface RenderResultOptions {
|
|
|
33
33
|
elapsedMs?: number;
|
|
34
34
|
/** The call was abandoned without a final result (turn aborted, sealed). Native describe hooks only. */
|
|
35
35
|
cancelled?: boolean;
|
|
36
|
+
/** The native host shows files by path (`cx.supports("media")`). Native describe hooks only. */
|
|
37
|
+
media?: boolean;
|
|
36
38
|
}
|
|
37
39
|
/** Render options for a result, plus the tool-specific context the transcript threads through. */
|
|
38
40
|
export type RenderResultContextOptions = RenderResultOptions & {
|
|
@@ -101,6 +101,10 @@ export interface TaskItem {
|
|
|
101
101
|
name?: string;
|
|
102
102
|
/** Agent type to run this item (e.g. "scout"). Defaults to the spawn policy's default agent. */
|
|
103
103
|
agent?: string;
|
|
104
|
+
/** Historical source session selected by the bundled consult agent. */
|
|
105
|
+
sourceSession?: string;
|
|
106
|
+
/** Optional model selector override for the historical source session. */
|
|
107
|
+
model?: string | string[];
|
|
104
108
|
/** The work; required by the schema. */
|
|
105
109
|
task?: string;
|
|
106
110
|
/** How open-ended the work is; required by the schema and the child's sole `auto` thinking classification input. */
|
|
@@ -127,6 +131,10 @@ export interface TaskParams {
|
|
|
127
131
|
name?: string;
|
|
128
132
|
/** Agent type to spawn (flat form); omitted values resolve from the session spawn policy. */
|
|
129
133
|
agent?: string;
|
|
134
|
+
/** Historical source session selected by the bundled consult agent. */
|
|
135
|
+
sourceSession?: string;
|
|
136
|
+
/** Optional model selector override for the historical source session. */
|
|
137
|
+
model?: string | string[];
|
|
130
138
|
/** The work (flat form). */
|
|
131
139
|
task?: string;
|
|
132
140
|
/** How open-ended the work is (flat form); see {@link TaskItem.solutionSpace}. */
|
|
@@ -383,6 +391,29 @@ export interface SingleResult {
|
|
|
383
391
|
attempt: number;
|
|
384
392
|
errorMessage: string;
|
|
385
393
|
};
|
|
394
|
+
/**
|
|
395
|
+
* Coarse category of a non-zero exit — `usage-limit`, `auth`,
|
|
396
|
+
* `account-policy`, `context-overflow`, `transient`, `aborted`, or
|
|
397
|
+
* `unknown`. A parent agent reads this to tell "swap the model" (the first
|
|
398
|
+
* three) from "fix the request" instead of parsing provider prose.
|
|
399
|
+
*/
|
|
400
|
+
failureClass?: "usage-limit" | "auth" | "account-policy" | "context-overflow" | "transient" | "aborted" | "unknown";
|
|
401
|
+
/**
|
|
402
|
+
* Other models this session could run instead (selectors accepted by the
|
|
403
|
+
* task `model` parameter, including `@role` aliases). Empty when nothing
|
|
404
|
+
* else is configured or every alternative is already in cooldown.
|
|
405
|
+
*/
|
|
406
|
+
fallbackCandidates?: string[];
|
|
407
|
+
/**
|
|
408
|
+
* Set when a caller-supplied `model` replaced the model this run would
|
|
409
|
+
* otherwise have used — the audit trail of an agent-driven switch.
|
|
410
|
+
*/
|
|
411
|
+
modelChange?: {
|
|
412
|
+
source: "spawn-param" | "wake-param";
|
|
413
|
+
/** The model the run would have used without the override, when resolvable. */
|
|
414
|
+
from?: string;
|
|
415
|
+
to: string;
|
|
416
|
+
};
|
|
386
417
|
/** Output metadata for agent:// URL integration */
|
|
387
418
|
outputMeta?: {
|
|
388
419
|
lineCount: number;
|
|
@@ -73,6 +73,8 @@ interface WriteStreamingPreviewStateCarrier {
|
|
|
73
73
|
/** Render context for the write tool: resolves an `xd://`-mounted tool so its live renderer drives device dispatch previews. */
|
|
74
74
|
export interface WriteRenderContext {
|
|
75
75
|
resolveXdevMounted?: (name: string) => XdevMountedRenderer | undefined;
|
|
76
|
+
/** Original result metadata used only for filesystem link targets. */
|
|
77
|
+
rawDetails?: unknown;
|
|
76
78
|
}
|
|
77
79
|
/** Render file writes and delegated tool-device calls. */
|
|
78
80
|
export declare const writeToolRenderer: {
|