@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type SgrMouseEvent } from "../index.js";
|
|
2
2
|
import { OverlayPanel } from "../chrome/overlay-box.js";
|
|
3
|
+
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
|
|
3
4
|
/** Stored account identity rendered and matched by the session account picker. */
|
|
4
5
|
export interface SessionPinAccount {
|
|
5
6
|
position: number;
|
|
@@ -17,6 +18,9 @@ export interface SessionPinAccount {
|
|
|
17
18
|
export declare class SessionAccountSelectorComponent extends OverlayPanel {
|
|
18
19
|
#private;
|
|
19
20
|
constructor(providerName: string, accounts: readonly SessionPinAccount[], onSelect: (account: SessionPinAccount) => void, onCancel: () => void);
|
|
21
|
+
describe(cx: DescribeContext): NativeNode | null;
|
|
22
|
+
/** Picker pointer events drive the list exactly as its keys do. */
|
|
23
|
+
handleNativeEvent(event: NativeUiEvent): void;
|
|
20
24
|
/** Forward keyboard navigation and cancellation when the wrapper owns focus. */
|
|
21
25
|
handleInput(keyData: string): void;
|
|
22
26
|
/** Route mouse selection through the title rows into the account list. */
|
|
@@ -24,9 +24,13 @@ export declare class SessionInfoOverlay implements Component {
|
|
|
24
24
|
setIgnoreTight(ignore: boolean): this;
|
|
25
25
|
dispose(): void;
|
|
26
26
|
/**
|
|
27
|
-
* The sheet body (the overlay is the frame): the session
|
|
28
|
-
* (
|
|
29
|
-
*
|
|
27
|
+
* The sheet body (the overlay is the frame), in three tiers: who the session
|
|
28
|
+
* is (the id and file as copyable mono fields), how full its context window
|
|
29
|
+
* is (a meter under a right-aligned figure), then the report's sections as
|
|
30
|
+
* headed groups. Groups of plain counts (Messages, Tokens, Cost) share a
|
|
31
|
+
* two-column stats grid with right-aligned figures and their Total set off
|
|
32
|
+
* last; the rest (Provider, servers) are key/value rows. A Close button (Esc)
|
|
33
|
+
* ends it.
|
|
30
34
|
*/
|
|
31
35
|
describe(cx: DescribeContext): NativeNode;
|
|
32
36
|
/** The Close button runs Esc's path. */
|
|
@@ -127,6 +127,8 @@ export interface SessionSelectorOptions<T extends SessionSelectorEntry = Session
|
|
|
127
127
|
allSessions?: T[];
|
|
128
128
|
/** Picker heading; defaults to "Resume Session". */
|
|
129
129
|
title?: string;
|
|
130
|
+
/** Primary action label; defaults to "Resume" (ANSI footer defaults to "select"). */
|
|
131
|
+
actionLabel?: string;
|
|
130
132
|
/** Fixed scope label, or false to omit the scope suffix. */
|
|
131
133
|
scopeLabel?: string | false;
|
|
132
134
|
/**
|
|
@@ -152,7 +154,7 @@ export interface SessionSelectorOptions<T extends SessionSelectorEntry = Session
|
|
|
152
154
|
/** Path of the live session, or a getter so detach/newSession stays accurate. */
|
|
153
155
|
currentSessionPath?: string | (() => string | undefined);
|
|
154
156
|
/**
|
|
155
|
-
* The picker is the whole program (`
|
|
157
|
+
* The picker is the whole program (`zetacode --resume`): the native picker
|
|
156
158
|
* fills the screen surface (`size:"screen"`) instead of floating as a
|
|
157
159
|
* sheet over the transcript.
|
|
158
160
|
*/
|
|
@@ -122,12 +122,12 @@ export declare class UsageDashboardComponent implements Component {
|
|
|
122
122
|
dispose(): void;
|
|
123
123
|
render(width: number): readonly string[];
|
|
124
124
|
/**
|
|
125
|
-
* The sheet body (the terminal's `lg` overlay is the frame): a
|
|
126
|
-
* (
|
|
127
|
-
*
|
|
128
|
-
* per-provider detail tables, then Close like the other
|
|
129
|
-
* `meter`/`chart` fall back to `progress`/`table` on
|
|
130
|
-
* them. Rebuilt only when its inputs change.
|
|
125
|
+
* The sheet body (the terminal's `lg` overlay is the frame): a toolbar
|
|
126
|
+
* (Overview/Details, freshness, Refresh), then either the overview — a
|
|
127
|
+
* strip of headline figures, the quota rows per provider, the activity
|
|
128
|
+
* calendar — or the per-provider detail tables, then Close like the other
|
|
129
|
+
* report sheets. `meter`/`chart` fall back to `progress`/`table` on
|
|
130
|
+
* terminals without them. Rebuilt only when its inputs change.
|
|
131
131
|
*/
|
|
132
132
|
describe(cx: DescribeContext): NativeNode;
|
|
133
133
|
/** Tab clicks switch views like Enter/Esc; the Refresh button runs `r`; Close closes from either view. */
|
|
@@ -50,18 +50,8 @@ export interface ComposerOptions {
|
|
|
50
50
|
readonly exit?: (code: number) => void;
|
|
51
51
|
readonly now?: () => number;
|
|
52
52
|
}
|
|
53
|
-
/** How {@link Composer.setRuntimeChildren}
|
|
53
|
+
/** How {@link Composer.setRuntimeChildren} lays out the roots below the transcript. */
|
|
54
54
|
export interface RuntimeChildrenOptions {
|
|
55
|
-
/**
|
|
56
|
-
* Below-transcript roots whose growth is momentary (inline dialogs, a tall
|
|
57
|
-
* multi-line editor). They are billed at their smallest height so expansion
|
|
58
|
-
* clips the live tail instead of retiring rows a later shrink could not
|
|
59
|
-
* reclaim (#11007). Every other root is billed at its current height, so
|
|
60
|
-
* settled rows it displaces retire to native scrollback. Decision panels
|
|
61
|
-
* declaring `retireDisplacedTranscript` opt out of this floor even when
|
|
62
|
-
* mounted as a child of a transient editor container.
|
|
63
|
-
*/
|
|
64
|
-
readonly transient?: readonly Component[];
|
|
65
55
|
/**
|
|
66
56
|
* Dock order on a TSP terminal (no status strip; the composer carries its
|
|
67
57
|
* facts): the native dock stacks HUD pills, the working row and queued messages over
|
|
@@ -69,6 +59,20 @@ export interface RuntimeChildrenOptions {
|
|
|
69
59
|
* to the roots below the transcript in render order.
|
|
70
60
|
*/
|
|
71
61
|
readonly nativeDock?: readonly Component[];
|
|
62
|
+
/**
|
|
63
|
+
* Below-transcript roots the user opens and closes (the editor surface that
|
|
64
|
+
* drafts and dialogs swap into, docked reports). Their rows never become
|
|
65
|
+
* part of the post-run chrome floor, so collapsing them refills the screen.
|
|
66
|
+
*/
|
|
67
|
+
readonly transientChrome?: readonly Component[];
|
|
68
|
+
/**
|
|
69
|
+
* Transient roots that clear themselves (todo and subagent HUDs, progress).
|
|
70
|
+
* Their first paint can be their tallest, e.g. a restored todo list on a
|
|
71
|
+
* resumed session, so unlike {@link transientChrome} it is never treated as
|
|
72
|
+
* their resting height: all of their rows stay out of the floor. Roots listed
|
|
73
|
+
* here are transient and need not also appear in `transientChrome`.
|
|
74
|
+
*/
|
|
75
|
+
readonly selfClearingChrome?: readonly Component[];
|
|
72
76
|
}
|
|
73
77
|
/** Controls the first terminal paint for a composer that does not already own the terminal. */
|
|
74
78
|
export interface ComposerStartOptions {
|
|
@@ -123,15 +127,6 @@ export declare class Composer implements TerminalFrameProvider, NativeSurfacePro
|
|
|
123
127
|
* the screen rows left above them; `undefined` before `root` was laid out.
|
|
124
128
|
*/
|
|
125
129
|
rowsBelow(root: Component): number | undefined;
|
|
126
|
-
/**
|
|
127
|
-
* Keep the input on the bottom row while the live rows cannot fill the
|
|
128
|
-
* screen, as after an inline decision panel closes. A tall block that just
|
|
129
|
-
* left the chrome above the editor (a command report) may have scrolled
|
|
130
|
-
* rows into native history that cannot be pulled back; without the pin the
|
|
131
|
-
* editor would jump up to where the shorter frame now ends. The pin lifts
|
|
132
|
-
* once live rows fill the screen again.
|
|
133
|
-
*/
|
|
134
|
-
pinInputToBottom(): void;
|
|
135
130
|
/** Compose the bounded mutable viewport and the next ordered history append. */
|
|
136
131
|
renderFrame(viewport: ViewportSize): TerminalFramePlan;
|
|
137
132
|
/**
|
|
@@ -176,6 +171,12 @@ export declare class Composer implements TerminalFrameProvider, NativeSurfacePro
|
|
|
176
171
|
setPreferences(update: Partial<ComposerPreferences>): void;
|
|
177
172
|
/** Patch welcome data in place as version, session, and project discovery complete. */
|
|
178
173
|
updateWelcome(update: ComposerWelcomeUpdate): void;
|
|
174
|
+
/**
|
|
175
|
+
* Mark whether a host agent run is in flight. Mid-run gaps with no streaming
|
|
176
|
+
* block (tool arguments not yet parseable, between tool calls) then do not
|
|
177
|
+
* count as the run ending when the post-run chrome floor is decided.
|
|
178
|
+
*/
|
|
179
|
+
setRunActive(active: boolean): void;
|
|
179
180
|
/** Replace optional header content around the stable welcome scene. */
|
|
180
181
|
setHeaderExtras(before: readonly Component[], after: readonly Component[]): void;
|
|
181
182
|
/** Update the canonical editor reference after InteractiveMode remounts a custom editor. */
|
|
@@ -24,6 +24,8 @@ export interface ComposerNativeState {
|
|
|
24
24
|
readonly rate?: number;
|
|
25
25
|
/** A turn is running: the send keycap becomes a Stop button. */
|
|
26
26
|
readonly running: boolean;
|
|
27
|
+
/** Native dictation control; undefined hides it for hosts without speech-to-text. */
|
|
28
|
+
readonly dictation?: "idle" | "starting" | "recording" | "transcribing";
|
|
27
29
|
/** The viewed subagent's lineage, outermost first and the viewed agent last; undefined on the main session. */
|
|
28
30
|
readonly viewing?: readonly string[];
|
|
29
31
|
/** The session's title, quoted in italics as the TSP placeholder; undefined until it has one. */
|
|
@@ -196,6 +198,8 @@ export declare class CustomEditor extends Editor {
|
|
|
196
198
|
* item markers use the accent color so separate follow-ups remain visible while composing.
|
|
197
199
|
* Called once per layout segment, so whole-buffer inputs are computed once per text revision. */
|
|
198
200
|
decorateText: (text: string, context: EditorTextDecorationContext) => string;
|
|
201
|
+
/** Catch the typed word up with the caret first: its leaving the word (or a blur) re-describes the typo marks. */
|
|
202
|
+
describe(cx: DescribeContext): NativeNode;
|
|
199
203
|
/**
|
|
200
204
|
* TSP decorations: magic keywords shimmer (terminal-clocked) in the accent
|
|
201
205
|
* color, chips and markers take their token colors, misspellings are marked,
|
|
@@ -220,7 +224,8 @@ export declare class CustomEditor extends Editor {
|
|
|
220
224
|
* once after construction (and again after `setEditorComponent` swaps the
|
|
221
225
|
* editor). Passing `undefined` clears any pending frame. */
|
|
222
226
|
setShimmerRepaintHandler(handler: (() => void) | undefined): void;
|
|
223
|
-
/** Editing is available during bootstrap; atomic sends wait until submission is wired and enabled
|
|
227
|
+
/** Editing is available during bootstrap; atomic sends wait until submission is wired and enabled
|
|
228
|
+
* and no dictation is still writing into the draft. */
|
|
224
229
|
protected get nativeSendable(): boolean;
|
|
225
230
|
/** Viewing a subagent, the draft goes to it: the placeholder names it; else the session's title, quoted in italics. */
|
|
226
231
|
describePlaceholder: () => TspText;
|
|
@@ -238,17 +243,17 @@ export declare class CustomEditor extends Editor {
|
|
|
238
243
|
* subagent is focused, the attachment chips, a `line` row of the
|
|
239
244
|
* shell-mode chip and the input, and the `bar`: model chip, effort chip
|
|
240
245
|
* (or the effort glyph as the model chip's icon), the generation rate,
|
|
241
|
-
* the other status facts, usage, then send (Stop while a turn runs).
|
|
242
|
-
* Clicks come back as `status.model`, `thinking.cycle`, `
|
|
243
|
-
* `interrupt` and `focus:<id>` actions.
|
|
246
|
+
* the other status facts, usage, dictation, then send (Stop while a turn runs).
|
|
247
|
+
* Clicks come back as `status.model`, `thinking.cycle`, `dictation.toggle`,
|
|
248
|
+
* `submit`, `interrupt` and `focus:<id>` actions.
|
|
244
249
|
*/
|
|
245
250
|
describeLayout: (input: NativeNode, cx: DescribeContext) => NativeEditorLayout;
|
|
246
251
|
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* the status facts' clicks
|
|
250
|
-
* go to the buffer; `send` submits its own prompt after
|
|
251
|
-
* for recall and waiting for in-flight clipboard work.
|
|
252
|
+
* Dictation clicks go directly to the host, independent of keybindings.
|
|
253
|
+
* Other controls take the same paths as their keys; the viewing header's
|
|
254
|
+
* links (`focus:<id>`) go to the host, the status facts' clicks to their source.
|
|
255
|
+
* Selection edits go to the buffer; `send` submits its own prompt after
|
|
256
|
+
* saving the old draft for recall and waiting for in-flight clipboard work.
|
|
252
257
|
*/
|
|
253
258
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
254
259
|
onEscape?: () => void;
|
|
@@ -275,6 +280,8 @@ export declare class CustomEditor extends Editor {
|
|
|
275
280
|
onRetry?: () => void;
|
|
276
281
|
/** Called when Caps Lock is pressed. */
|
|
277
282
|
onCapsLock?: () => void;
|
|
283
|
+
/** Called directly by the native microphone/stop control, without synthesizing a keypress. */
|
|
284
|
+
onToggleDictation?: () => void;
|
|
278
285
|
/** Called when left-arrow is pressed while the editor is empty (cursor necessarily at start). */
|
|
279
286
|
onLeftAtStart?: () => void;
|
|
280
287
|
/** Called when the viewing header asks to view agent `id` ({@link MAIN_AGENT_ID}: the main session). */
|
|
@@ -296,6 +303,8 @@ export declare class CustomEditor extends Editor {
|
|
|
296
303
|
* Clear all custom key handlers.
|
|
297
304
|
*/
|
|
298
305
|
clearCustomKeyHandlers(): void;
|
|
306
|
+
/** True while a clipboard-image or image-path paste is still landing; later keys queue behind it. */
|
|
307
|
+
get pasteInFlight(): boolean;
|
|
299
308
|
capturesInput(data: string): boolean;
|
|
300
309
|
handleInput(data: string): void;
|
|
301
310
|
/**
|
|
@@ -305,7 +314,8 @@ export declare class CustomEditor extends Editor {
|
|
|
305
314
|
* an Ask dialog opened over a non-empty prompt — so finishing or submitting
|
|
306
315
|
* the draft cannot fire an editor-slot shortcut that clears
|
|
307
316
|
* `editorContainer` and orphans the overlay. Only text editing, cursor
|
|
308
|
-
* movement, submission,
|
|
317
|
+
* movement, submission, the clear action, and pastes (clipboard images and
|
|
318
|
+
* image paths attach as on the composer) reach the buffer.
|
|
309
319
|
*/
|
|
310
320
|
handleDraftEdit(data: string): void;
|
|
311
321
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ImageContent } from "@linxiraos/pi-ai";
|
|
2
|
+
import type { TspSpan } from "@linxiraos/pi-wire";
|
|
2
3
|
/** Materialized image destination returned by the host blob writer. */
|
|
3
4
|
interface ImageBlobResult {
|
|
4
5
|
displayPath: string;
|
|
@@ -23,4 +24,25 @@ type ImageBlobWriterSync = (data: Buffer, options?: {
|
|
|
23
24
|
export declare function imageReferenceHyperlink(label: string, index: number, imageLinks: readonly (string | undefined)[] | undefined, renderLabel: (text: string) => string): string;
|
|
24
25
|
export declare function materializeImageReferenceLinks(images: readonly ImageContent[] | undefined, putBlob: ImageBlobWriter): Promise<(string | undefined)[] | undefined>;
|
|
25
26
|
export declare function materializeImageReferenceLinksSync(images: readonly ImageContent[] | undefined, putBlob: ImageBlobWriterSync): (string | undefined)[] | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Register the host's blob writer that backs links for images without a file of their
|
|
29
|
+
* own. Returns a disposer that unregisters it unless another writer replaced it since.
|
|
30
|
+
*/
|
|
31
|
+
export declare function setImageBlobWriter(next: ImageBlobWriterSync): () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Whether transcript images carry links under the current `tui.hyperlinks` policy: a
|
|
34
|
+
* native surface honours only an explicit `off`, text mode the resolved OSC 8 support.
|
|
35
|
+
* Renderers caching a linked image key their cache on it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function imageLinksEnabled(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The file a transcript image opens: `sourcePath` when it was read from one, else a
|
|
40
|
+
* blob copy of its bytes written through the host. Undefined when links are disabled
|
|
41
|
+
* or no file exists, so a disabled policy never writes blobs.
|
|
42
|
+
*/
|
|
43
|
+
export declare function transcriptImageLink(image: Pick<ImageContent, "data" | "mimeType">, sourcePath?: string): string | undefined;
|
|
44
|
+
/** `text` (an image's placeholder) as an OSC 8 link to the image's file; plain when hyperlinks are off or no file exists. */
|
|
45
|
+
export declare function linkedImageText(text: string, image: Pick<ImageContent, "data" | "mimeType">, sourcePath?: string): string;
|
|
46
|
+
/** Native counterpart of {@link linkedImageText}: a span linking to the image's file when one exists. */
|
|
47
|
+
export declare function linkedImageSpan(text: string, image: Pick<ImageContent, "data" | "mimeType">, sourcePath: string | undefined, s?: string): TspSpan;
|
|
26
48
|
export {};
|
|
@@ -30,7 +30,8 @@ export declare class MacOSSpellingProvider implements EditorTextAssistProvider {
|
|
|
30
30
|
decorateTypos(text: string, context: SpellingDecorationContext, decorate?: (span: string) => string): string;
|
|
31
31
|
/**
|
|
32
32
|
* Misspelled prose ranges in `text` (offsets into it), in order and
|
|
33
|
-
* non-overlapping
|
|
33
|
+
* non-overlapping, except ones touching `context.typing` (the word still
|
|
34
|
+
* being typed). Schedules the verification check for uncached text; its
|
|
34
35
|
* result arrives through {@link onUpdate}.
|
|
35
36
|
*/
|
|
36
37
|
typoRanges(text: string, context: SpellingDecorationContext): readonly native.SpellingRange[];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { TypingWord } from "./typing-word.js";
|
|
1
2
|
/** Logical source location for one rendered editor segment. */
|
|
2
3
|
export interface SpellingDecorationContext {
|
|
3
4
|
editorText: string;
|
|
4
5
|
lines: readonly string[];
|
|
5
6
|
line: number;
|
|
6
7
|
startCol: number;
|
|
8
|
+
/** The word being typed: typo marks touching it wait until the caret leaves it. */
|
|
9
|
+
typing?: TypingWord | undefined;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Whether `text[start, end)` is a prose word: unmasked by {@link maskNonProse},
|
|
@@ -10,7 +10,7 @@ export interface QueuedMessageGroup {
|
|
|
10
10
|
* Messages queued while the agent works, above the editor. ANSI: a heading
|
|
11
11
|
* per group, numbered dim rows and the dequeue hint. Natively (§8.1): a
|
|
12
12
|
* stack of pills, each `corner-down-right` · the text · `⌥↑ Edit`, the total
|
|
13
|
-
*
|
|
13
|
+
* (`N queued`, not a position) in the first pill when more than one waits; the edit control sends
|
|
14
14
|
* `queue.edit`, answered like the dequeue key.
|
|
15
15
|
*/
|
|
16
16
|
export declare class QueuedMessagesBand extends Container {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The word being typed in the composer. Misspelling marks hold off on it until
|
|
3
|
+
* the caret leaves it (a space or punctuation, a caret move, losing focus), the
|
|
4
|
+
* way Slack and Chromium mark a typo only once its word is done; marks on other
|
|
5
|
+
* words stay while typing.
|
|
6
|
+
*/
|
|
7
|
+
/** A word of one logical line, as UTF-16 columns `[start, end)`. */
|
|
8
|
+
export interface TypingWord {
|
|
9
|
+
line: number;
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
}
|
|
13
|
+
/** Follows an editor's text revision and caret to know which word is being typed. */
|
|
14
|
+
export declare class TypingWordTracker {
|
|
15
|
+
#private;
|
|
16
|
+
/** The word being typed, if any. */
|
|
17
|
+
get word(): TypingWord | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Catch up with the editor: an edit that leaves the caret in (or right after)
|
|
20
|
+
* a word starts typing it; a caret move out of that word, or losing focus,
|
|
21
|
+
* ends it. The first call only records the revision, so a restored draft is
|
|
22
|
+
* not held. Returns whether the held word changed.
|
|
23
|
+
*/
|
|
24
|
+
update(revision: number, lines: readonly string[], line: number, col: number, focused: boolean): boolean;
|
|
25
|
+
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import type { DescribeContext, NativeNode } from "../native/node.js";
|
|
2
2
|
import type { Component } from "../tui.js";
|
|
3
|
+
/** Catalogue keys (`tip${line}`) of every tips.txt line, in file order. The
|
|
4
|
+
* host needs them to gate a tip by the product feature it advertises. */
|
|
5
|
+
export declare const TIP_CATALOGUE_KEYS: readonly string[];
|
|
6
|
+
/**
|
|
7
|
+
* Host-installable tip gate: receives the tip's catalogue key and its raw
|
|
8
|
+
* tips.txt line; returning false removes it from the splash pool.
|
|
9
|
+
*/
|
|
10
|
+
export type TuiTipFilter = (key: string, raw: string) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Install the host's tip gate (pass `undefined` to reset). Consulted for every
|
|
13
|
+
* candidate on every pick, so no roll can surface a rejected tip — used when a
|
|
14
|
+
* feature a tip advertises is switched off by configuration.
|
|
15
|
+
*/
|
|
16
|
+
export declare function setTuiTipFilter(filter: TuiTipFilter | undefined): void;
|
|
3
17
|
/** Pick a tip from `tips`, biased toward "[NEW]" tips by {@link NEW_TIP_WEIGHT};
|
|
4
18
|
* `r` is a uniform sample in [0, 1). Returns "" when `tips` is empty.
|
|
5
19
|
* Exported for tests. */
|
|
@@ -13,10 +27,11 @@ export declare function pickWeightedTip(tips: readonly string[], r: number): str
|
|
|
13
27
|
*/
|
|
14
28
|
export declare function renderWelcomeTip(tip: string, width: number, phase?: number, isNew?: boolean): string[];
|
|
15
29
|
/**
|
|
16
|
-
* The session's welcome banner. In a terminal: the gradient
|
|
17
|
-
* `
|
|
30
|
+
* The session's welcome banner. In a terminal: the gradient mark beside the
|
|
31
|
+
* `Zeta` wordmark, with the version under the wordmark and the `Linxira-Zeta`
|
|
32
|
+
* identity subline centered below the pair (the mark alone when the lockup does
|
|
18
33
|
* not fit) and the tip of the session (dropped below {@link TIP_MIN_COLUMNS}
|
|
19
|
-
* columns). Natively: a card with the same
|
|
34
|
+
* columns). Natively: a card with the same mark, wordmark, version and tip
|
|
20
35
|
* ({@link WelcomeComponent.describe}).
|
|
21
36
|
*/
|
|
22
37
|
export declare class WelcomeComponent implements Component {
|
|
@@ -28,7 +43,8 @@ export declare class WelcomeComponent implements Component {
|
|
|
28
43
|
/**
|
|
29
44
|
* A `card` (`zeta.welcome`) mirroring the terminal banner: the lockup
|
|
30
45
|
* (`zeta.welcome.lockup`: the terminal's builtin `zeta` mark, which it animates,
|
|
31
|
-
* beside the wordmark with the version
|
|
46
|
+
* beside the `Zeta` wordmark with the version and the `Linxira-Zeta`
|
|
47
|
+
* subline under it) and the tip of the session.
|
|
32
48
|
* Roles carry the look (gradient logo, type scale); a "[NEW]" tip
|
|
33
49
|
* carries a terminal-clocked shimmering tag.
|
|
34
50
|
*/
|
|
@@ -53,9 +69,13 @@ export declare class WelcomeComponent implements Component {
|
|
|
53
69
|
setVersion(version: string): void;
|
|
54
70
|
render(termWidth: number): readonly string[];
|
|
55
71
|
}
|
|
56
|
-
/**
|
|
72
|
+
/** Brand mark: FIGlet `ANSI Shadow` render of `Z` (generated). */
|
|
57
73
|
export declare const ZETA_LOGO: string[];
|
|
58
|
-
/**
|
|
74
|
+
/** Primary product name: FIGlet `ANSI Shadow` render of `Zeta` (generated). */
|
|
75
|
+
export declare const ZETA_WORDMARK: string[];
|
|
76
|
+
/** Secondary identity line: FIGlet `mini` render of `Linxira-Zeta` (generated). */
|
|
77
|
+
export declare const ZETA_SUBLINE: string[];
|
|
78
|
+
/** The generated brand mark as accent lines; `shimmer` declares the terminal-clocked shine sweep. */
|
|
59
79
|
export declare function logoNode(lines: readonly string[], shimmer: boolean): NativeNode;
|
|
60
80
|
export interface ShineConfig {
|
|
61
81
|
/** Overall opacity of the shine overlay, in [0, 1]. */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Theme } from "../theme/theme.js";
|
|
2
|
+
/** Wrap content under a distinct first-row prefix, preserving its column on continuation rows. */
|
|
3
|
+
export declare function wrapPrefixedLine(prefix: string, continuationPrefix: string, content: string, width: number): string[];
|
|
4
|
+
/** Preserve a tree connector's ancestor guides while hanging a long node beneath its label. */
|
|
5
|
+
export declare function wrapTreeLine(line: string, width: number, theme: Theme): string[] | undefined;
|
|
6
|
+
/** Hang a tree row beneath its connector, or a connector-less detail row beneath its guide rails. */
|
|
7
|
+
export declare function wrapGuidedLine(line: string, width: number, theme: Theme): string[];
|
|
@@ -70,6 +70,8 @@ export declare function urlHyperlinkAlways(url: string, displayText: string): st
|
|
|
70
70
|
* Non-HTTP(S) or unparsable URLs yield a plain span.
|
|
71
71
|
*/
|
|
72
72
|
export declare function urlLinkSpan(target: string, displayText: string, s?: string): TspSpan;
|
|
73
|
+
/** Whether native link spans and nodes may carry an `href`: everything but an explicit `off` policy. */
|
|
74
|
+
export declare function isNativeLinkEnabled(): boolean;
|
|
73
75
|
/**
|
|
74
76
|
* A native link span to a filesystem path as a plain `file://` URI (the
|
|
75
77
|
* terminal opens it through the system; the location stays in the visible
|
|
@@ -105,14 +105,22 @@ export declare function cappedHeadLines(lines: readonly string[], max: number):
|
|
|
105
105
|
};
|
|
106
106
|
/** Get the first nonblank preview lines, trimmed and width-capped. */
|
|
107
107
|
export declare function getPreviewLines(text: string, maxLines: number, maxLineLen: number, ellipsis?: Ellipsis): string[];
|
|
108
|
+
/** Collapse a possibly multi-line string into one line; whitespace runs (tabs included) become one space. */
|
|
109
|
+
export declare function flattenLine(text: string): string;
|
|
108
110
|
/**
|
|
109
111
|
* Collapse a possibly multi-line string into a single line, then truncate it to
|
|
110
112
|
* `maxWidth` display cells. {@link truncateToWidth} alone caps width but
|
|
111
113
|
* newlines are zero-width, so multi-line content (markdown briefs, tool args,
|
|
112
114
|
* provider errors) would otherwise spill a single status row across several
|
|
113
|
-
* visual lines.
|
|
115
|
+
* visual lines.
|
|
114
116
|
*/
|
|
115
117
|
export declare function previewLine(text: string, maxWidth: number, ellipsis?: Ellipsis): string;
|
|
118
|
+
/**
|
|
119
|
+
* Clip a result row to `maxWidth` only while collapsed. Expanded rows stay whole
|
|
120
|
+
* so the frame wraps them: the expand key ({@link formatExpandHint}) must reveal
|
|
121
|
+
* text, not re-clip it.
|
|
122
|
+
*/
|
|
123
|
+
export declare function clipCollapsed(text: string, maxWidth: number, expanded: boolean | undefined): string;
|
|
116
124
|
/**
|
|
117
125
|
* Extract domain from URL, stripping www. prefix.
|
|
118
126
|
*/
|
|
@@ -32,7 +32,7 @@ export interface RenderCache {
|
|
|
32
32
|
lines: string[];
|
|
33
33
|
}
|
|
34
34
|
/** Build indentation and continuing branches for ancestor levels. */
|
|
35
|
-
export declare function buildTreePrefix(ancestors: boolean[], theme: Theme): string;
|
|
35
|
+
export declare function buildTreePrefix(ancestors: readonly boolean[], theme: Theme): string;
|
|
36
36
|
/** Return the branch glyph for a final or continuing tree item. */
|
|
37
37
|
export declare function getTreeBranch(isLast: boolean, theme: Theme): string;
|
|
38
38
|
/** Return the continuation prefix for subsequent lines of a tree item. */
|
|
@@ -3,11 +3,12 @@ export declare const SETUP_SPLASH_MS = 2600;
|
|
|
3
3
|
export declare const SETUP_TICK_MS = 33;
|
|
4
4
|
export declare function renderStarfield(width: number, height: number, frame: number): string[];
|
|
5
5
|
/**
|
|
6
|
-
* Animated setup splash, in the spirit of the Zeta visual identity: the brand
|
|
7
|
-
* mark rendered
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* whole scene; the water
|
|
6
|
+
* Animated setup splash, in the spirit of the Zeta visual identity: the brand
|
|
7
|
+
* mark — the FIGlet-rendered Latin `Z`, the ASCII form of `Ζ` — with the live
|
|
8
|
+
* diagonal gradient + shine sweep, rising out of a rippling, gradient-lit water
|
|
9
|
+
* surface, under a faint twinkling starfield. The mark and water share one
|
|
10
|
+
* continuous gradient so the sweep reads across the whole scene; the water
|
|
11
|
+
* surface drifts each frame.
|
|
11
12
|
*/
|
|
12
13
|
export declare function renderSetupSplash(width: number, height: number, elapsedMs: number): string[];
|
|
13
14
|
/**
|
|
@@ -98,6 +98,7 @@ export interface CompactionBoundaries {
|
|
|
98
98
|
export declare function computeCompactionBoundaries(compactionSettings: CompactionSettings, contextWindow: number, speculationLeadTokens?: number): CompactionBoundaries | null;
|
|
99
99
|
/** Stable inputs used to cache non-message token estimates. */
|
|
100
100
|
export interface NonMessageTokenSource {
|
|
101
|
+
readonly model?: Model;
|
|
101
102
|
readonly systemPrompt?: readonly string[];
|
|
102
103
|
readonly agent?: {
|
|
103
104
|
readonly state?: {
|
|
@@ -137,6 +138,8 @@ export declare function invalidateToolSchemaMetadata(tools: ToolSchemaSource): v
|
|
|
137
138
|
* {@link invalidateToolSchemaMetadata} when those inputs change.
|
|
138
139
|
*/
|
|
139
140
|
export declare function estimateToolSchemaTokens(tools: ToolSchemaSource, tokenizer: Tokenizer, sourceRevision?: number): number;
|
|
141
|
+
/** Count schemas carried on every request, excluding server-side deferred catalogs. */
|
|
142
|
+
export declare function estimateContextToolSchemaTokens(tools: ToolSchemaSource, tokenizer: Tokenizer, model: Model | undefined, sourceRevision?: number): number;
|
|
140
143
|
export declare function computeNonMessageTokens(session: NonMessageTokenSource, tokenizer: Tokenizer, sourceRevision?: number): number;
|
|
141
144
|
/**
|
|
142
145
|
* Shared helper for the four non-message token totals used by
|
|
@@ -155,7 +158,7 @@ export declare function computeNonMessageBreakdown(session: NonMessageTokenSourc
|
|
|
155
158
|
* session and model.
|
|
156
159
|
*/
|
|
157
160
|
export declare function computeContextBreakdown(session: ContextUsageSession, options: ContextUsageOptions): ContextBreakdown;
|
|
158
|
-
/** The `/context` title: the model
|
|
161
|
+
/** The `/context` title: the model once one is selected (the body leads with its window). */
|
|
159
162
|
export declare function contextUsageHead(breakdown: ContextBreakdown): TspText;
|
|
160
163
|
/**
|
|
161
164
|
* Native context-usage panel for terminals without `meter`: the cell grid as
|
|
@@ -97,11 +97,13 @@ export interface FooterSession {
|
|
|
97
97
|
autoResolvedThinkingLevel(): string | undefined;
|
|
98
98
|
getContextUsage: StatusLineSession["getContextUsage"];
|
|
99
99
|
modelRegistry: Pick<StatusLineSession["modelRegistry"], "isUsingOAuth">;
|
|
100
|
+
/**
|
|
101
|
+
* Cumulative session rollup. Unlike the active-window stats it spans every
|
|
102
|
+
* entry in the session, so compaction does not reset the counters, and it
|
|
103
|
+
* folds in usage carried by completed `task` tool results.
|
|
104
|
+
*/
|
|
100
105
|
sessionManager: {
|
|
101
|
-
|
|
102
|
-
type: string;
|
|
103
|
-
message?: AgentMessage;
|
|
104
|
-
}[];
|
|
106
|
+
getUsageStatistics: StatusLineSession["sessionManager"]["getUsageStatistics"];
|
|
105
107
|
};
|
|
106
108
|
}
|
|
107
109
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Status line for the speculative first frame, before any session exists.
|
|
3
3
|
*
|
|
4
|
-
* InteractiveMode persists {@link StatusLineStartupData} (settings plus the
|
|
5
|
-
*
|
|
6
|
-
* real {@link StatusLineComponent} as a fresh, unnamed session at
|
|
7
|
-
* terminal width. Path and git branch are read live; context usage is
|
|
8
|
-
* unknown so the gauge shows the window without a percent.
|
|
4
|
+
* InteractiveMode persists {@link StatusLineStartupData} (settings plus the
|
|
5
|
+
* resolved default role model and status inputs); the next launch renders it
|
|
6
|
+
* through the real {@link StatusLineComponent} as a fresh, unnamed session at
|
|
7
|
+
* the live terminal width. Path and git branch are read live; context usage is
|
|
8
|
+
* reported unknown so the gauge shows the window without a percent.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* ```ts ignore
|
|
@@ -22,7 +22,7 @@ import type { StatusLineSettings } from "./types.js";
|
|
|
22
22
|
export interface StatusLineStartupData {
|
|
23
23
|
readonly settings: StatusLineSettings;
|
|
24
24
|
readonly gitEnabled: boolean;
|
|
25
|
-
/** Model
|
|
25
|
+
/** Model resolved for the next fresh session's default role. */
|
|
26
26
|
readonly model?: Model;
|
|
27
27
|
readonly thinkingLevel?: ThinkingLevel;
|
|
28
28
|
readonly autoThinking: boolean;
|
|
@@ -61,6 +61,13 @@ export type StdinBufferEventMap = {
|
|
|
61
61
|
export declare class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
62
62
|
#private;
|
|
63
63
|
constructor(options?: StdinBufferOptions);
|
|
64
|
+
/**
|
|
65
|
+
* Whether a bracketed paste has started and its end marker has not arrived.
|
|
66
|
+
* Terminal skips its per-read DEC 2004 reassertion meanwhile: the host is
|
|
67
|
+
* evidently in bracketed-paste mode, and a paste delivered one key record
|
|
68
|
+
* per read would otherwise cost one terminal write per pasted key (#15757).
|
|
69
|
+
*/
|
|
70
|
+
get pasting(): boolean;
|
|
64
71
|
process(data: string | Buffer): void;
|
|
65
72
|
/**
|
|
66
73
|
* Gate unbracketed raw-paste classification on event-loop responsiveness.
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { HangulCompatibilityJamoWidth } from "./utils.js";
|
|
2
2
|
export * from "./terminal-multiplexer.js";
|
|
3
3
|
export { wrapTmuxPassthrough } from "./tmux.js";
|
|
4
|
+
/**
|
|
5
|
+
* Trusted terminal background when reported; otherwise black for detected dark
|
|
6
|
+
* appearance or white for detected light appearance, using theme auto-detection.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getTerminalBackgroundColor(): number;
|
|
9
|
+
/** Store an OSC 11 background, or reset to appearance detection (also for tests). */
|
|
10
|
+
export declare function setTerminalBackgroundColor(color: number | undefined): void;
|
|
4
11
|
export declare enum ImageProtocol {
|
|
5
12
|
Kitty = "\u001B_G",
|
|
6
13
|
Iterm2 = "\u001B]1337;File=",
|
|
@@ -339,6 +346,14 @@ export interface ParsedKittyPlacementLine {
|
|
|
339
346
|
* callers fall back to writing the line verbatim.
|
|
340
347
|
*/
|
|
341
348
|
export declare function parseKittyDirectPlacementLine(line: string): ParsedKittyPlacementLine | null;
|
|
349
|
+
/**
|
|
350
|
+
* Rows above its own line that an {@link Image} direct-placement line paints
|
|
351
|
+
* over: the `CUU(rows-1)` of its lead-in, or 0 for any other line. The renderer
|
|
352
|
+
* erases those rows before a SIXEL/iTerm2 block is written again, because
|
|
353
|
+
* those protocols have no delete command and the block's reserved rows are
|
|
354
|
+
* byte-identical between frames, so the diff never rewrites them.
|
|
355
|
+
*/
|
|
356
|
+
export declare function directPlacementLift(line: string): number;
|
|
342
357
|
/**
|
|
343
358
|
* Rebuild an {@link Image} direct-placement line for the viewport row it is
|
|
344
359
|
* written at. The component-rendered line encodes `CUU(rows-1)`, which clamps
|
|
@@ -397,7 +412,7 @@ export declare function getImageDimensions(base64Data: string, mimeType: string)
|
|
|
397
412
|
* thread; `null` when the encode fails. For output that cannot wait for an
|
|
398
413
|
* off-thread encode.
|
|
399
414
|
*/
|
|
400
|
-
export declare function encodeSixelNow(base64Data: string, widthPx: number, heightPx: number): string | null;
|
|
415
|
+
export declare function encodeSixelNow(base64Data: string, widthPx: number, heightPx: number, backgroundRgb?: number): string | null;
|
|
401
416
|
export declare function renderImage(base64Data: string, imageDimensions: ImageDimensions, options?: ImageRenderOptions): {
|
|
402
417
|
sequence?: string;
|
|
403
418
|
lines?: string[];
|
|
@@ -38,6 +38,7 @@ declare const registry: readonly [{
|
|
|
38
38
|
readonly passthrough: typeof import("./tmux.js").wrapTmuxPassthrough;
|
|
39
39
|
readonly settleMs: 100;
|
|
40
40
|
};
|
|
41
|
+
readonly gatesBracketedPaste: true;
|
|
41
42
|
readonly expandsRepPadding: true;
|
|
42
43
|
readonly expiresSynchronizedOutput: true;
|
|
43
44
|
readonly altRestoreEndsSynchronizedOutput: true;
|
|
@@ -100,6 +101,12 @@ export declare function hasTerminalMultiplexerSession(multiplexer: TerminalMulti
|
|
|
100
101
|
* order. Nested sessions all appear; TERM is not consulted.
|
|
101
102
|
*/
|
|
102
103
|
export declare function terminalMultiplexerSessions(env?: NodeJS.ProcessEnv): TerminalMultiplexerModule<TerminalMultiplexer>[];
|
|
104
|
+
/**
|
|
105
|
+
* Whether OSC 11 background replies are trusted on this platform. Any active
|
|
106
|
+
* session with `backgroundQueryBrokenOn` matching the platform makes the entire
|
|
107
|
+
* path untrusted; TERM-only classification does not identify an active session.
|
|
108
|
+
*/
|
|
109
|
+
export declare function isTerminalBackgroundQueryTrusted(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): boolean;
|
|
103
110
|
/**
|
|
104
111
|
* The multiplexer TERM names, whether or not its session markers survived.
|
|
105
112
|
* This is classification's TERM fallback; session markers are not consulted.
|