@linxiraos/pi-tui 1.4.6 → 1.4.7
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 +194 -195
- package/README.md +34 -34
- package/dist/types/app-keybindings.d.ts +15 -0
- package/dist/types/apps/session-picker.d.ts +5 -0
- package/dist/types/charts/chart-plan.d.ts +9 -7
- package/dist/types/chat/assistant-message.d.ts +15 -3
- package/dist/types/chat/bash-execution.d.ts +2 -0
- package/dist/types/chat/display-preferences.d.ts +2 -0
- package/dist/types/chat/extension-types.d.ts +31 -0
- package/dist/types/chat/reply-write.d.ts +48 -0
- package/dist/types/chat/table-chart.d.ts +4 -3
- package/dist/types/chat/tool-execution.d.ts +1 -2
- package/dist/types/chat/transcript-outline.d.ts +7 -0
- package/dist/types/chat/transcript-render-helpers.d.ts +2 -0
- package/dist/types/chrome/index.d.ts +1 -0
- package/dist/types/chrome/transcript-notice.d.ts +35 -0
- package/dist/types/chrome/transcript-status.d.ts +20 -8
- package/dist/types/components/editor.d.ts +8 -0
- package/dist/types/components/markdown.d.ts +7 -0
- package/dist/types/native/blobs.d.ts +2 -1
- package/dist/types/native/picker.d.ts +4 -4
- package/dist/types/overlays/annotation-overlay.d.ts +7 -1
- package/dist/types/overlays/annotation-types.d.ts +28 -0
- package/dist/types/overlays/login-dialog.d.ts +5 -1
- package/dist/types/overlays/model-browser.d.ts +10 -1
- package/dist/types/overlays/oauth-selector.d.ts +23 -0
- package/dist/types/overlays/plan-review-overlay.d.ts +2 -0
- package/dist/types/overlays/rewind-selector.d.ts +1 -1
- package/dist/types/overlays/session-selector.d.ts +22 -2
- package/dist/types/prompt/composer.d.ts +43 -0
- package/dist/types/prompt/interactive-context-helpers.d.ts +10 -3
- package/dist/types/render/extension-links.d.ts +65 -0
- package/dist/types/render/hyperlink.d.ts +25 -7
- package/dist/types/render/index.d.ts +1 -0
- package/dist/types/setup/scenes/glyph.d.ts +1 -1
- package/dist/types/setup/scenes/model.d.ts +1 -1
- package/dist/types/setup/scenes/outro.d.ts +5 -4
- package/dist/types/setup/scenes/sign-in.d.ts +13 -8
- package/dist/types/setup/scenes/types.d.ts +16 -1
- package/dist/types/setup/startup-splash.d.ts +1 -1
- package/dist/types/setup/wizard-overlay.d.ts +11 -7
- package/dist/types/setup/wizard.d.ts +5 -1
- package/dist/types/status-line/component.d.ts +1 -1
- package/dist/types/status-line/context-usage.d.ts +28 -6
- package/dist/types/status-line/host.d.ts +6 -2
- package/dist/types/theme/theme.d.ts +0 -23
- package/dist/types/tools/bash-interactive.d.ts +6 -0
- package/dist/types/tools/bash.d.ts +2 -0
- package/dist/types/tools/default-renderer.d.ts +6 -4
- package/dist/types/tools/irc.d.ts +6 -0
- package/dist/types/tools/json-tree.d.ts +23 -4
- package/dist/types/tools/lsp.d.ts +2 -0
- package/dist/types/tools/mcp.d.ts +6 -5
- package/dist/types/tools/native-view.d.ts +1 -1
- package/dist/types/tools/renderer.d.ts +2 -0
- package/dist/types/tools/streaming-output.d.ts +11 -0
- package/dist/types/tools/task.d.ts +9 -1
- package/dist/types/tools/url-scheme-host.d.ts +17 -0
- package/dist/types/tools/yield.d.ts +1 -1
- package/dist/types/tui.d.ts +7 -2
- package/package.json +10 -14
- package/src/app-keybindings.d.ts +15 -0
- package/src/app-keybindings.ts +15 -0
- package/src/apps/session-picker.ts +7 -0
- package/src/charts/chart-plan.d.ts +9 -7
- package/src/charts/chart-plan.ts +20 -50
- package/src/chat/advisor-message.ts +2 -0
- package/src/chat/assistant-message.d.ts +15 -3
- package/src/chat/assistant-message.ts +137 -19
- package/src/chat/background-tan-message.ts +4 -0
- package/src/chat/bash-execution.d.ts +2 -0
- package/src/chat/bash-execution.ts +6 -0
- package/src/chat/chat-transcript-builder.ts +58 -28
- package/src/chat/compaction-summary-message.ts +2 -1
- package/src/chat/display-preferences.d.ts +2 -0
- package/src/chat/display-preferences.ts +3 -0
- package/src/chat/extension-types.d.ts +31 -0
- package/src/chat/extension-types.ts +34 -0
- package/src/chat/reply-write.d.ts +48 -0
- package/src/chat/reply-write.ts +127 -0
- package/src/chat/table-chart.d.ts +4 -3
- package/src/chat/table-chart.ts +10 -4
- package/src/chat/tool-execution.d.ts +1 -2
- package/src/chat/tool-execution.ts +20 -13
- package/src/chat/transcript-outline.d.ts +7 -0
- package/src/chat/transcript-outline.ts +27 -0
- package/src/chat/transcript-render-helpers.d.ts +2 -0
- package/src/chat/transcript-render-helpers.ts +66 -24
- package/src/chrome/index.ts +1 -0
- package/src/chrome/transcript-notice.d.ts +35 -0
- package/src/chrome/transcript-notice.ts +83 -0
- package/src/chrome/transcript-status.d.ts +20 -8
- package/src/chrome/transcript-status.ts +29 -29
- package/src/components/editor.d.ts +8 -0
- package/src/components/editor.ts +10 -1
- package/src/components/markdown.d.ts +7 -0
- package/src/components/markdown.ts +116 -6
- package/src/hotkeys-markdown.ts +1 -0
- package/src/native/backend.ts +5 -66
- package/src/native/blobs.d.ts +2 -1
- package/src/native/blobs.ts +3 -2
- package/src/native/picker.d.ts +4 -4
- package/src/native/picker.ts +4 -4
- package/src/overlays/advisor-config.ts +1 -10
- package/src/overlays/annotation-overlay.ts +125 -37
- package/src/overlays/annotation-types.ts +24 -0
- package/src/overlays/hook-selector.ts +2 -2
- package/src/overlays/login-dialog.ts +31 -5
- package/src/overlays/mcp-add-wizard.ts +1 -1
- package/src/overlays/model-browser.ts +37 -0
- package/src/overlays/model-hub.ts +1 -7
- package/src/overlays/model-picker.ts +1 -10
- package/src/overlays/oauth-selector.ts +44 -6
- package/src/overlays/plan-review-overlay.ts +13 -2
- package/src/overlays/rewind-selector.ts +29 -12
- package/src/overlays/session-selector.ts +313 -42
- package/src/overlays/usage-dashboard.ts +5 -12
- package/src/prompt/composer.ts +216 -1
- package/src/prompt/custom-editor.ts +6 -1
- package/src/prompt/emoji-autocomplete.ts +0 -2
- package/src/prompt/interactive-context-helpers.ts +29 -4
- package/src/render/extension-links.d.ts +65 -0
- package/src/render/extension-links.ts +214 -0
- package/src/render/hyperlink.d.ts +25 -7
- package/src/render/hyperlink.ts +65 -9
- package/src/render/index.d.ts +1 -0
- package/src/render/index.ts +1 -0
- package/src/setup/scenes/composer.ts +2 -0
- package/src/setup/scenes/glyph.ts +3 -1
- package/src/setup/scenes/model.ts +192 -29
- package/src/setup/scenes/outro.ts +33 -15
- package/src/setup/scenes/sign-in.ts +196 -400
- package/src/setup/scenes/theme.ts +2 -0
- package/src/setup/scenes/types.ts +18 -1
- package/src/setup/startup-splash.ts +8 -7
- package/src/setup/wizard-overlay.ts +164 -35
- package/src/setup/wizard.ts +11 -2
- package/src/status-line/component.ts +4 -10
- package/src/status-line/context-usage.ts +72 -21
- package/src/status-line/host.ts +6 -2
- package/src/terminal.ts +24 -2
- package/src/theme/defaults.json +1 -0
- package/src/theme/loader.ts +1 -1
- package/src/theme/theme.d.ts +0 -23
- package/src/theme/theme.ts +2 -75
- package/src/tools/bash-interactive.d.ts +49 -0
- package/src/tools/bash-interactive.ts +6 -1
- package/src/tools/bash.d.ts +2 -0
- package/src/tools/bash.ts +2 -0
- package/src/tools/default-renderer.d.ts +6 -4
- package/src/tools/default-renderer.ts +9 -6
- package/src/tools/eval.ts +14 -4
- package/src/tools/irc.d.ts +6 -0
- package/src/tools/irc.ts +6 -0
- package/src/tools/job-widget.ts +13 -1
- package/src/tools/json-tree.d.ts +23 -4
- package/src/tools/json-tree.ts +132 -42
- package/src/tools/lsp.d.ts +2 -0
- package/src/tools/lsp.ts +36 -15
- package/src/tools/mcp.d.ts +6 -5
- package/src/tools/mcp.ts +20 -12
- package/src/tools/native-view.d.ts +1 -1
- package/src/tools/native-view.ts +1 -1
- package/src/tools/renderer.d.ts +2 -0
- package/src/tools/renderer.ts +2 -0
- package/src/tools/streaming-output.d.ts +11 -0
- package/src/tools/streaming-output.ts +41 -0
- package/src/tools/task.d.ts +9 -1
- package/src/tools/task.ts +59 -16
- package/src/tools/url-scheme-host.d.ts +17 -0
- package/src/tools/url-scheme-host.ts +21 -0
- package/src/tools/yield.d.ts +1 -1
- package/src/tools/yield.ts +18 -9
- package/src/tui.d.ts +7 -2
- package/src/tui.ts +43 -15
- package/dist/types/theme/defaults/index.d.ts +0 -10289
- package/src/theme/defaults/alabaster.json +0 -103
- package/src/theme/defaults/amethyst.json +0 -106
- package/src/theme/defaults/anthracite.json +0 -103
- package/src/theme/defaults/basalt.json +0 -101
- package/src/theme/defaults/birch.json +0 -105
- package/src/theme/defaults/dark-abyss.json +0 -101
- package/src/theme/defaults/dark-arctic.json +0 -114
- package/src/theme/defaults/dark-aurora.json +0 -105
- package/src/theme/defaults/dark-catppuccin.json +0 -117
- package/src/theme/defaults/dark-cavern.json +0 -101
- package/src/theme/defaults/dark-celestial.json +0 -116
- package/src/theme/defaults/dark-copper.json +0 -105
- package/src/theme/defaults/dark-cosmos.json +0 -100
- package/src/theme/defaults/dark-cyberpunk.json +0 -112
- package/src/theme/defaults/dark-dracula.json +0 -108
- package/src/theme/defaults/dark-eclipse.json +0 -101
- package/src/theme/defaults/dark-ember.json +0 -105
- package/src/theme/defaults/dark-equinox.json +0 -100
- package/src/theme/defaults/dark-forest.json +0 -106
- package/src/theme/defaults/dark-github.json +0 -115
- package/src/theme/defaults/dark-gruvbox.json +0 -122
- package/src/theme/defaults/dark-lavender.json +0 -105
- package/src/theme/defaults/dark-lunar.json +0 -99
- package/src/theme/defaults/dark-midnight.json +0 -105
- package/src/theme/defaults/dark-monochrome.json +0 -104
- package/src/theme/defaults/dark-monokai.json +0 -108
- package/src/theme/defaults/dark-nebula.json +0 -100
- package/src/theme/defaults/dark-neon-noir.json +0 -110
- package/src/theme/defaults/dark-nord.json +0 -108
- package/src/theme/defaults/dark-ocean.json +0 -111
- package/src/theme/defaults/dark-one.json +0 -110
- package/src/theme/defaults/dark-poimandres.json +0 -125
- package/src/theme/defaults/dark-rainforest.json +0 -101
- package/src/theme/defaults/dark-reef.json +0 -101
- package/src/theme/defaults/dark-retro.json +0 -102
- package/src/theme/defaults/dark-rose-pine.json +0 -106
- package/src/theme/defaults/dark-sakura.json +0 -105
- package/src/theme/defaults/dark-slate.json +0 -105
- package/src/theme/defaults/dark-solarized.json +0 -107
- package/src/theme/defaults/dark-solstice.json +0 -100
- package/src/theme/defaults/dark-starfall.json +0 -101
- package/src/theme/defaults/dark-sunset.json +0 -109
- package/src/theme/defaults/dark-swamp.json +0 -100
- package/src/theme/defaults/dark-synthwave.json +0 -113
- package/src/theme/defaults/dark-taiga.json +0 -101
- package/src/theme/defaults/dark-terminal.json +0 -105
- package/src/theme/defaults/dark-tokyo-night.json +0 -111
- package/src/theme/defaults/dark-tundra.json +0 -101
- package/src/theme/defaults/dark-twilight.json +0 -101
- package/src/theme/defaults/dark-volcanic.json +0 -101
- package/src/theme/defaults/graphite.json +0 -102
- package/src/theme/defaults/index.d.ts +0 -10289
- package/src/theme/defaults/index.ts +0 -203
- package/src/theme/defaults/light-arctic.json +0 -117
- package/src/theme/defaults/light-aurora-day.json +0 -101
- package/src/theme/defaults/light-canyon.json +0 -101
- package/src/theme/defaults/light-catppuccin.json +0 -116
- package/src/theme/defaults/light-cirrus.json +0 -100
- package/src/theme/defaults/light-coral.json +0 -105
- package/src/theme/defaults/light-cyberpunk.json +0 -106
- package/src/theme/defaults/light-dawn.json +0 -100
- package/src/theme/defaults/light-dunes.json +0 -101
- package/src/theme/defaults/light-eucalyptus.json +0 -105
- package/src/theme/defaults/light-forest.json +0 -110
- package/src/theme/defaults/light-frost.json +0 -105
- package/src/theme/defaults/light-github.json +0 -125
- package/src/theme/defaults/light-glacier.json +0 -101
- package/src/theme/defaults/light-gruvbox.json +0 -118
- package/src/theme/defaults/light-haze.json +0 -100
- package/src/theme/defaults/light-honeycomb.json +0 -105
- package/src/theme/defaults/light-lagoon.json +0 -101
- package/src/theme/defaults/light-lavender.json +0 -105
- package/src/theme/defaults/light-meadow.json +0 -101
- package/src/theme/defaults/light-mint.json +0 -105
- package/src/theme/defaults/light-monochrome.json +0 -111
- package/src/theme/defaults/light-ocean.json +0 -109
- package/src/theme/defaults/light-one.json +0 -109
- package/src/theme/defaults/light-opal.json +0 -101
- package/src/theme/defaults/light-orchard.json +0 -101
- package/src/theme/defaults/light-paper.json +0 -105
- package/src/theme/defaults/light-poimandres.json +0 -125
- package/src/theme/defaults/light-prism.json +0 -100
- package/src/theme/defaults/light-retro.json +0 -108
- package/src/theme/defaults/light-sand.json +0 -105
- package/src/theme/defaults/light-savanna.json +0 -101
- package/src/theme/defaults/light-solarized.json +0 -112
- package/src/theme/defaults/light-soleil.json +0 -100
- package/src/theme/defaults/light-sunset.json +0 -109
- package/src/theme/defaults/light-synthwave.json +0 -108
- package/src/theme/defaults/light-tokyo-night.json +0 -121
- package/src/theme/defaults/light-wetland.json +0 -101
- package/src/theme/defaults/light-zenith.json +0 -99
- package/src/theme/defaults/limestone.json +0 -104
- package/src/theme/defaults/mahogany.json +0 -107
- package/src/theme/defaults/marble.json +0 -103
- package/src/theme/defaults/obsidian.json +0 -101
- package/src/theme/defaults/onyx.json +0 -101
- package/src/theme/defaults/pearl.json +0 -103
- package/src/theme/defaults/porcelain.json +0 -101
- package/src/theme/defaults/quartz.json +0 -106
- package/src/theme/defaults/sandstone.json +0 -105
- package/src/theme/defaults/titanium.json +0 -100
|
@@ -23,11 +23,12 @@ export declare function renderMCPResult(result: {
|
|
|
23
23
|
isError?: boolean;
|
|
24
24
|
}, options: RenderResultOptions, theme: Theme, args?: Record<string, unknown>): Component;
|
|
25
25
|
/** Native MCP call view: the head plus the folded args, inline while pending. */
|
|
26
|
-
export declare function describeMCPCall(args: Record<string, unknown>, label: string): NativeToolView;
|
|
26
|
+
export declare function describeMCPCall(args: Record<string, unknown>, label: string, options?: RenderResultOptions): NativeToolView;
|
|
27
27
|
/**
|
|
28
|
-
* Native MCP result view: JSON output as
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* Native MCP result view: JSON output as the host's `json` viewer (when it
|
|
29
|
+
* draws one) or a JSON tree, Markdown when the preference is on, otherwise
|
|
30
|
+
* the raw text as tool output; the folded Args section follows, so the
|
|
31
|
+
* collapsed preview still leads with the output.
|
|
31
32
|
*/
|
|
32
33
|
export declare function describeMCPResult(result: {
|
|
33
34
|
content: Array<{
|
|
@@ -36,7 +37,7 @@ export declare function describeMCPResult(result: {
|
|
|
36
37
|
}>;
|
|
37
38
|
details?: MCPToolDetails;
|
|
38
39
|
isError?: boolean;
|
|
39
|
-
},
|
|
40
|
+
}, options: RenderResultOptions, args?: Record<string, unknown>): NativeToolView | undefined;
|
|
40
41
|
import type { OutputMeta } from "./output-meta.js";
|
|
41
42
|
/** Set whether plain MCP text results render as Markdown. */
|
|
42
43
|
export declare function setMcpRenderMarkdownResults(enabled: boolean): void;
|
|
@@ -6,7 +6,7 @@ import { type OutputMeta } from "./output-meta.js";
|
|
|
6
6
|
import type { NativeToolHead, NativeToolView, ToolRenderResult } from "./renderer.js";
|
|
7
7
|
/** A path for native heads: relative to the working directory when inside it, else `~`-shortened. */
|
|
8
8
|
export declare function displayPath(filePath: string): string;
|
|
9
|
-
/**
|
|
9
|
+
/** Configured file link for a head's path target, when the path is absolute. */
|
|
10
10
|
export declare function fileHref(filePath: string | undefined): string | undefined;
|
|
11
11
|
/** Diff stats as one head `meta` string, `+8 −1` (U+2212 minus), or undefined when nothing changed. */
|
|
12
12
|
export declare function diffStatsMeta(added: number, removed: number): string | undefined;
|
|
@@ -36,6 +36,8 @@ export interface RenderResultOptions {
|
|
|
36
36
|
cancelled?: boolean;
|
|
37
37
|
/** The native host shows files by path (`cx.supports("media")`). Native describe hooks only. */
|
|
38
38
|
media?: boolean;
|
|
39
|
+
/** The native host draws raw JSON values (`cx.supports("json")`). Native describe hooks only. */
|
|
40
|
+
json?: boolean;
|
|
39
41
|
}
|
|
40
42
|
/** Render options for a result, plus the tool-specific context the transcript threads through. */
|
|
41
43
|
export type RenderResultContextOptions = RenderResultOptions & {
|
|
@@ -177,6 +177,17 @@ export declare function truncateLineBytes(line: string, maxBytes?: number): {
|
|
|
177
177
|
text: string;
|
|
178
178
|
wasTruncated: boolean;
|
|
179
179
|
};
|
|
180
|
+
/**
|
|
181
|
+
* Where `text` shows in `output` written through an {@link OutputSink} with
|
|
182
|
+
* `maxColumns`, searching from `from`: each of its lines whole, or, where the
|
|
183
|
+
* cap cut the output line, a head of it and `…` ending that output line.
|
|
184
|
+
* Only the first line can be cut short of its first 16 characters (after
|
|
185
|
+
* other text on its output line); such text is not found.
|
|
186
|
+
*/
|
|
187
|
+
export declare function findColumnCapped(output: string, text: string, from?: number): {
|
|
188
|
+
start: number;
|
|
189
|
+
end: number;
|
|
190
|
+
} | undefined;
|
|
180
191
|
/** Shared helper to build a no-truncation result. */
|
|
181
192
|
export declare function noTruncResult(content: string, totalLines?: number, totalBytes?: number): TruncationResult;
|
|
182
193
|
/**
|
|
@@ -105,8 +105,9 @@ export interface TaskItem {
|
|
|
105
105
|
sourceSession?: string;
|
|
106
106
|
/** Optional model selector override for the historical source session. */
|
|
107
107
|
model?: string | string[];
|
|
108
|
-
/**
|
|
108
|
+
/** Inline instructions; exactly one of task or taskFile is required. */
|
|
109
109
|
task?: string;
|
|
110
|
+
taskFile?: string;
|
|
110
111
|
/** How open-ended the work is; required by the schema and the child's sole `auto` thinking classification input. */
|
|
111
112
|
solutionSpace?: string;
|
|
112
113
|
/** Per-spawn thinking effort: lowest/middle/highest level the resolved model supports. Overrides the agent's default selector (e.g. `auto`). */
|
|
@@ -137,6 +138,8 @@ export interface TaskParams {
|
|
|
137
138
|
model?: string | string[];
|
|
138
139
|
/** The work (flat form). */
|
|
139
140
|
task?: string;
|
|
141
|
+
/** Absolute path or local:// URL to a UTF-8 file (flat form), mutually exclusive with task. */
|
|
142
|
+
taskFile?: string;
|
|
140
143
|
/** How open-ended the work is (flat form); see {@link TaskItem.solutionSpace}. */
|
|
141
144
|
solutionSpace?: string;
|
|
142
145
|
/** Per-spawn thinking effort (flat form): lowest/middle/highest level the resolved model supports. */
|
|
@@ -212,6 +215,9 @@ export interface AgentProgress {
|
|
|
212
215
|
status: "pending" | "running" | "completed" | "failed" | "aborted";
|
|
213
216
|
task: string;
|
|
214
217
|
assignment?: string;
|
|
218
|
+
taskFile?: string;
|
|
219
|
+
/** SHA-256 of the exact task file bytes before decoding and trimming. */
|
|
220
|
+
taskFileSha256?: string;
|
|
215
221
|
description?: string;
|
|
216
222
|
lastIntent?: string;
|
|
217
223
|
currentTool?: string;
|
|
@@ -319,6 +325,8 @@ export interface SingleResult {
|
|
|
319
325
|
agentSource: AgentSource;
|
|
320
326
|
task: string;
|
|
321
327
|
assignment?: string;
|
|
328
|
+
taskFile?: string;
|
|
329
|
+
taskFileSha256?: string;
|
|
322
330
|
description?: string;
|
|
323
331
|
lastIntent?: string;
|
|
324
332
|
exitCode: number;
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
* selector peeling and transcript renderers consult it instead of hardcoding
|
|
5
5
|
* scheme names.
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Mutation class of a writable scheme; drives plan-mode and device-only `write` gates.
|
|
9
|
+
* - `workspace`: mutates user/external state; blocked in plan mode and device-only sessions.
|
|
10
|
+
* - `sandbox`: session scratch space (local://); allowed in plan mode and device-only sessions.
|
|
11
|
+
* - `coordination`: peer messaging (agent://); always allowed. `SchemeWritePolicy.cancels` grants the same per URL.
|
|
12
|
+
* - `device`: tool-device dispatch (xd://); always allowed, the device enforces its own policy.
|
|
13
|
+
* - `reply`: a message to the user (out://); always allowed, and transcripts draw the content as assistant prose.
|
|
14
|
+
*/
|
|
15
|
+
export type SchemeWriteScope = "workspace" | "sandbox" | "coordination" | "device" | "reply";
|
|
7
16
|
/** Renderer-relevant subset of a registered scheme's declared spec. */
|
|
8
17
|
export interface InternalUrlSchemeSpec {
|
|
9
18
|
/** `lines`: a trailing `:<selector>` chain is a read selector; `none`/`opaque`: never peel. */
|
|
@@ -12,16 +21,24 @@ export interface InternalUrlSchemeSpec {
|
|
|
12
21
|
readonly portAuthority?: boolean;
|
|
13
22
|
/** Read cards collapse into the compact read group like plain files instead of expanding. */
|
|
14
23
|
readonly compactTranscript?: boolean;
|
|
24
|
+
/** Write policy; absent on read-only schemes. Transcripts draw `reply`-scoped writes as assistant prose. */
|
|
25
|
+
readonly write?: {
|
|
26
|
+
readonly scope: SchemeWriteScope;
|
|
27
|
+
};
|
|
15
28
|
}
|
|
16
29
|
/** Scheme registry capabilities installed by the internal URL host. */
|
|
17
30
|
export interface InternalUrlSchemeHost {
|
|
18
31
|
/** Declared spec of a registered scheme (case-insensitive); undefined when unregistered. */
|
|
19
32
|
spec(scheme: string): InternalUrlSchemeSpec | undefined;
|
|
33
|
+
/** Declared specs of every registered scheme, keyed by lowercased scheme. */
|
|
34
|
+
specs(): ReadonlyMap<string, InternalUrlSchemeSpec>;
|
|
20
35
|
}
|
|
21
36
|
/** Install the scheme registry. Until one is installed, no URL counts as an internal scheme. */
|
|
22
37
|
export declare function setInternalUrlSchemeHost(host: InternalUrlSchemeHost): void;
|
|
23
38
|
/** Declared spec of `scheme`; undefined when it is unregistered or no host is installed. */
|
|
24
39
|
export declare function internalUrlSchemeSpec(scheme: string): InternalUrlSchemeSpec | undefined;
|
|
40
|
+
/** Declared specs of every registered scheme, keyed by lowercased scheme; empty when no host is installed. */
|
|
41
|
+
export declare function internalUrlSchemeSpecs(): ReadonlyMap<string, InternalUrlSchemeSpec>;
|
|
25
42
|
/** Split a hierarchical `scheme://rest` URL into its lowercased scheme and the text after `://`. */
|
|
26
43
|
export declare function splitUrlScheme(input: string): {
|
|
27
44
|
scheme: string;
|
|
@@ -15,7 +15,7 @@ export declare const yieldToolRenderer: {
|
|
|
15
15
|
renderCall(args: YieldRenderArgs, options: RenderResultOptions, theme: Theme): Component;
|
|
16
16
|
renderResult(result: ToolRenderResult<YieldItem>, options: RenderResultContextOptions, theme: Theme, args?: YieldRenderArgs): Component;
|
|
17
17
|
describeCall(args: YieldRenderArgs, options: RenderResultOptions): NativeToolView;
|
|
18
|
-
describeResult(result: ToolRenderResult<YieldItem>,
|
|
18
|
+
describeResult(result: ToolRenderResult<YieldItem>, options: RenderResultContextOptions, args?: YieldRenderArgs): NativeToolView;
|
|
19
19
|
mergeCallAndResult: true;
|
|
20
20
|
animatedPendingPreview: true;
|
|
21
21
|
};
|
package/dist/types/tui.d.ts
CHANGED
|
@@ -80,7 +80,9 @@ export interface TUIStartOptions {
|
|
|
80
80
|
* switches to raw input and replays the kernel-buffered keystrokes.
|
|
81
81
|
*
|
|
82
82
|
* A terminal expected to speak TSP needs raw input from the start, so it
|
|
83
|
-
* gets it
|
|
83
|
+
* gets it. Plain typing (printable text, Backspace) still edits the focused
|
|
84
|
+
* component live, as the kernel echo shows it elsewhere; the first other key
|
|
85
|
+
* and every key after it are held instead (TSP events and the cell-size
|
|
84
86
|
* reply still apply) until {@link TUI.releaseHeldInput} replays them.
|
|
85
87
|
*/
|
|
86
88
|
deferInput?: boolean;
|
|
@@ -525,7 +527,10 @@ export declare class TUI extends Container {
|
|
|
525
527
|
* never come.
|
|
526
528
|
*/
|
|
527
529
|
addStartListener(listener: StartListener): () => void;
|
|
528
|
-
|
|
530
|
+
/** Registers a key listener; `prepend` gives a foreground input owner first refusal over global shortcuts. */
|
|
531
|
+
addInputListener(listener: InputListener, options?: {
|
|
532
|
+
prepend?: boolean;
|
|
533
|
+
}): () => void;
|
|
529
534
|
removeInputListener(listener: InputListener): void;
|
|
530
535
|
stop(): void;
|
|
531
536
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@linxiraos/pi-tui",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.7",
|
|
5
5
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
6
6
|
"homepage": "https://linxira-os.github.io/zeta/",
|
|
7
7
|
"author": "Linxira-OS",
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"gen:glyphs": "bun scripts/gen-glyphs.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@linxiraos/pi-omptype": "1.4.
|
|
42
|
-
"@linxiraos/pi-agent-core": "1.4.
|
|
43
|
-
"@linxiraos/pi-ai": "1.4.
|
|
44
|
-
"@linxiraos/pi-catalog": "1.4.
|
|
45
|
-
"@linxiraos/pi-natives": "1.4.
|
|
46
|
-
"@linxiraos/pi-utils": "1.4.
|
|
47
|
-
"@linxiraos/pi-wire": "1.4.
|
|
48
|
-
"@linxiraos/pi-snapcompact": "1.4.
|
|
41
|
+
"@linxiraos/pi-omptype": "1.4.7",
|
|
42
|
+
"@linxiraos/pi-agent-core": "1.4.7",
|
|
43
|
+
"@linxiraos/pi-ai": "1.4.7",
|
|
44
|
+
"@linxiraos/pi-catalog": "1.4.7",
|
|
45
|
+
"@linxiraos/pi-natives": "1.4.7",
|
|
46
|
+
"@linxiraos/pi-utils": "1.4.7",
|
|
47
|
+
"@linxiraos/pi-wire": "1.4.7",
|
|
48
|
+
"@linxiraos/pi-snapcompact": "1.4.7"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"kitty-vt-wasm": "^0.2.0"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
|
-
"bun": ">=1.
|
|
54
|
+
"bun": ">=1.4.4"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"src",
|
|
@@ -70,10 +70,6 @@
|
|
|
70
70
|
"types": "./dist/types/theme/index.d.ts",
|
|
71
71
|
"import": "./src/theme/index.ts"
|
|
72
72
|
},
|
|
73
|
-
"./theme/defaults": {
|
|
74
|
-
"types": "./dist/types/theme/defaults/index.d.ts",
|
|
75
|
-
"import": "./src/theme/defaults/index.ts"
|
|
76
|
-
},
|
|
77
73
|
"./theme/*": {
|
|
78
74
|
"types": "./dist/types/theme/*.d.ts",
|
|
79
75
|
"import": "./src/theme/*.ts"
|
package/src/app-keybindings.d.ts
CHANGED
|
@@ -39,10 +39,13 @@ interface AppKeybindings {
|
|
|
39
39
|
"app.session.rename": true;
|
|
40
40
|
"app.session.delete": true;
|
|
41
41
|
"app.session.deleteNoninvasive": true;
|
|
42
|
+
"app.session.pin": true;
|
|
43
|
+
"app.session.unpin": true;
|
|
42
44
|
"app.tree.previousBranch": true;
|
|
43
45
|
"app.tree.nextBranch": true;
|
|
44
46
|
"app.plan.toggle": true;
|
|
45
47
|
"app.history.search": true;
|
|
48
|
+
"app.links.hint": true;
|
|
46
49
|
"app.stt.pushToTalk": true;
|
|
47
50
|
"app.stt.toggle": true;
|
|
48
51
|
"app.live.toggle": true;
|
|
@@ -329,6 +332,14 @@ export declare const KEYBINDINGS: {
|
|
|
329
332
|
readonly defaultKeys: "ctrl+backspace";
|
|
330
333
|
readonly description: "Delete session (non-invasive)";
|
|
331
334
|
};
|
|
335
|
+
readonly "app.session.pin": {
|
|
336
|
+
readonly defaultKeys: "alt+k";
|
|
337
|
+
readonly description: "Pin the selected session in the resume picker";
|
|
338
|
+
};
|
|
339
|
+
readonly "app.session.unpin": {
|
|
340
|
+
readonly defaultKeys: "alt+shift+k";
|
|
341
|
+
readonly description: "Unpin the selected session in the resume picker";
|
|
342
|
+
};
|
|
332
343
|
readonly "app.tree.previousBranch": {
|
|
333
344
|
readonly defaultKeys: [];
|
|
334
345
|
readonly description: "Jump to the previous branch in /tree";
|
|
@@ -345,6 +356,10 @@ export declare const KEYBINDINGS: {
|
|
|
345
356
|
readonly defaultKeys: "ctrl+r";
|
|
346
357
|
readonly description: "Search history";
|
|
347
358
|
};
|
|
359
|
+
readonly "app.links.hint": {
|
|
360
|
+
readonly defaultKeys: "alt+o";
|
|
361
|
+
readonly description: "Pick an extension link on screen by its hint tag";
|
|
362
|
+
};
|
|
348
363
|
readonly "app.stt.pushToTalk": {
|
|
349
364
|
readonly defaultKeys: "space";
|
|
350
365
|
readonly description: "Hold to record speech-to-text";
|
package/src/app-keybindings.ts
CHANGED
|
@@ -59,10 +59,13 @@ interface AppKeybindings {
|
|
|
59
59
|
"app.session.rename": true;
|
|
60
60
|
"app.session.delete": true;
|
|
61
61
|
"app.session.deleteNoninvasive": true;
|
|
62
|
+
"app.session.pin": true;
|
|
63
|
+
"app.session.unpin": true;
|
|
62
64
|
"app.tree.previousBranch": true;
|
|
63
65
|
"app.tree.nextBranch": true;
|
|
64
66
|
"app.plan.toggle": true;
|
|
65
67
|
"app.history.search": true;
|
|
68
|
+
"app.links.hint": true;
|
|
66
69
|
"app.stt.pushToTalk": true;
|
|
67
70
|
"app.stt.toggle": true;
|
|
68
71
|
"app.live.toggle": true;
|
|
@@ -239,6 +242,14 @@ export const KEYBINDINGS = {
|
|
|
239
242
|
defaultKeys: "ctrl+backspace",
|
|
240
243
|
description: "Delete session (non-invasive)",
|
|
241
244
|
},
|
|
245
|
+
"app.session.pin": {
|
|
246
|
+
defaultKeys: "alt+k",
|
|
247
|
+
description: "Pin the selected session in the resume picker",
|
|
248
|
+
},
|
|
249
|
+
"app.session.unpin": {
|
|
250
|
+
defaultKeys: "alt+shift+k",
|
|
251
|
+
description: "Unpin the selected session in the resume picker",
|
|
252
|
+
},
|
|
242
253
|
"app.tree.previousBranch": {
|
|
243
254
|
defaultKeys: [],
|
|
244
255
|
description: "Jump to the previous branch in /tree",
|
|
@@ -255,6 +266,10 @@ export const KEYBINDINGS = {
|
|
|
255
266
|
defaultKeys: "ctrl+r",
|
|
256
267
|
description: "Search history",
|
|
257
268
|
},
|
|
269
|
+
"app.links.hint": {
|
|
270
|
+
defaultKeys: "alt+o",
|
|
271
|
+
description: "Pick an extension link on screen by its hint tag",
|
|
272
|
+
},
|
|
258
273
|
"app.stt.pushToTalk": {
|
|
259
274
|
defaultKeys: "space",
|
|
260
275
|
description: "Hold to record speech-to-text",
|
|
@@ -14,6 +14,9 @@ export interface SessionPickerHost<T extends SessionSelectorEntry = SessionSelec
|
|
|
14
14
|
loadPinnedIds?(): Promise<ReadonlySet<string>>;
|
|
15
15
|
loadHistoryMatcher?(): SessionHistoryMatcher;
|
|
16
16
|
deleteSession?(session: T): Promise<boolean>;
|
|
17
|
+
/** Rename the session and resolve with the title as stored, or null when it did not happen. */
|
|
18
|
+
renameSession?(session: T, title: string): Promise<string | null>;
|
|
19
|
+
setSessionPinned?(session: T, pinned: boolean): Promise<void>;
|
|
17
20
|
loadAllSessions?(): Promise<T[]>;
|
|
18
21
|
/** Builds the three-level resume source for the standalone `--resume` tree. */
|
|
19
22
|
loadResumeSource?(deleteMode: "trash" | "permanent", workspacePath?: string): Promise<ResumeTreeSource | undefined>;
|
|
@@ -26,6 +29,8 @@ export interface SessionPickerOptions<T extends SessionSelectorEntry = SessionSe
|
|
|
26
29
|
scopeLabel?: string | false;
|
|
27
30
|
showCwd?: boolean;
|
|
28
31
|
allowDelete?: boolean;
|
|
32
|
+
/** Rename the selected session; resolve with the title as stored, or null when it did not happen. */
|
|
33
|
+
onRename?: (session: T, title: string) => Promise<string | null>;
|
|
29
34
|
allowGlobalScope?: boolean;
|
|
30
35
|
historySearch?: boolean;
|
|
31
36
|
pinnedIds?: ReadonlySet<string>;
|
|
@@ -79,6 +84,8 @@ export async function selectSession<T extends SessionSelectorEntry>(
|
|
|
79
84
|
},
|
|
80
85
|
{
|
|
81
86
|
onDelete: options.allowDelete === false ? undefined : host.deleteSession,
|
|
87
|
+
onRename: options.onRename ?? host.renameSession,
|
|
88
|
+
onSetPinned: host.setSessionPinned,
|
|
82
89
|
historyMatcher,
|
|
83
90
|
loadAllSessions: options.allowGlobalScope === false ? undefined : host.loadAllSessions,
|
|
84
91
|
allSessions: options.allSessions,
|
|
@@ -419,9 +419,10 @@ export type ChartAnnotation = {
|
|
|
419
419
|
export declare function planChart(table: TableAnalysis): ChartPlan | undefined;
|
|
420
420
|
/**
|
|
421
421
|
* Whether a model should pick `table`'s chart (`tui.autoGraph: smart`):
|
|
422
|
-
* multi-series tables,
|
|
423
|
-
* `guess` plots (`Thread | State`, `Finding | Current`),
|
|
424
|
-
* tells a
|
|
422
|
+
* multi-series tables, tables whose rows may be named by a number the
|
|
423
|
+
* `guess` plots (`Thread | State`, `Finding | Current`), and any other chart
|
|
424
|
+
* the guess would draw — only meaning tells a measure from page references,
|
|
425
|
+
* step numbers or figures quoted in prose, which the judge charts as none.
|
|
425
426
|
*/
|
|
426
427
|
export declare function shouldJudge(table: TableAnalysis, guess: ChartPlan | undefined): boolean;
|
|
427
428
|
/** Measure columns before `guess`'s text label column: numbers that may only name their rows. */
|
|
@@ -446,10 +447,11 @@ export declare function tableTakeaways(table: TableAnalysis, plan: ChartPlan, co
|
|
|
446
447
|
*/
|
|
447
448
|
export declare function drawnNames(spec: ChartSpec): Set<string>;
|
|
448
449
|
/**
|
|
449
|
-
* The local guess at what `plan`'s rows and measures mean:
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
* `(current)` row names, and a status
|
|
450
|
+
* The local guess at what `plan`'s rows and measures mean: each measure's
|
|
451
|
+
* {@link Polarity} as far as its unit says ({@link dimPolarity}; what a name
|
|
452
|
+
* means — `Memory` as a capacity or a cost — is the judge's call), rivals from
|
|
453
|
+
* the label's header, focus from bolded or `(current)` row names, and a status
|
|
454
|
+
* column whose cells vary.
|
|
453
455
|
*/
|
|
454
456
|
export declare function guessMeaning(table: TableAnalysis, plan: ChartPlan): Pick<ChartPlan, "polarity" | "rowPolarity" | "rivals" | "focus" | "status">;
|
|
455
457
|
/** Whether `plan`'s rows may each be a metric of their own: a `change`, a transposed table, or mixed-unit columns. */
|
package/src/charts/chart-plan.ts
CHANGED
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
isNumber,
|
|
34
34
|
type NumberCell,
|
|
35
35
|
parseCell,
|
|
36
|
-
plainCell,
|
|
37
36
|
type Status,
|
|
38
37
|
type TableAnalysis,
|
|
39
38
|
type TableColumn,
|
|
@@ -536,20 +535,6 @@ const NEST_SEPARATORS = [" — ", " – ", ": ", " · ", ", ", " ", "/", "-", "_
|
|
|
536
535
|
/** Where a long row name's description starts (`Payroll (10 people…)`, `@watzon — #19, #53`). */
|
|
537
536
|
const DESCRIPTION = / [—–] | - |: | \(/;
|
|
538
537
|
|
|
539
|
-
/**
|
|
540
|
-
* Measures that improve upward, by header: pass and success rates, retrieval
|
|
541
|
-
* scores, throughput, speedups and savings.
|
|
542
|
-
*/
|
|
543
|
-
const HIGHER_BETTER =
|
|
544
|
-
/(?:^|[^\w])(?:pass(?:ed|es|ing)?|pass ?%|pass ?rate|success(?:es|ful)?|succeeded|accuracy|acc|recall|precision|prec|f1|em|exact[_ ]?match|scores?|wins?|win ?rate|hit ?rate|throughput|qps|rps|ops\/s|req\/s|tok\/s|tokens\/s|speedup|faster|improvement|savings?|saved|gain|coverage|quality|relevance|correct|solved|ok|renders|completion ?rate|uptime|performance|profits?|roi|pnl|growth|per \$|\/\$)(?![\w])/i;
|
|
545
|
-
/** Measures that improve downward, by header: cost, time, failures. */
|
|
546
|
-
const LOWER_BETTER =
|
|
547
|
-
/(?:^|[^\w])(?:cost|costs|price|bill|spend|usd|latency|time|duration|wall(?: ?clock)?|elapsed|errors?|err|fail(?:s|ed|ures?)?|timeouts?|miss(?:es)?|crash(?:es)?|regressions?|bugs?|warnings?|retries|turns|p\d{2}|blockers|violations|leaks?|stalls?|load|\$\/\w+)(?![\w])/i;
|
|
548
|
-
/** Resources a before/after change aims to shrink: lower is better only beside a baseline. */
|
|
549
|
-
const LOWER_IN_CHANGE =
|
|
550
|
-
/(?:^|[^\w])(?:tokens?|tok|rss|memory|mem|heap|allocs?|allocations?|clones|size|bytes|cpu|gc|input|output)(?![\w])/i;
|
|
551
|
-
/** Names of shares and counts that describe rather than score: no polarity whatever else they say. */
|
|
552
|
-
const NEUTRAL = /(?:^|[^\w])(?:share|shares|% of|portion|fraction|distribution|breakdown)(?![\w])/i;
|
|
553
538
|
/** Label headers naming rival options a table compares (models, configs, arms). */
|
|
554
539
|
const RIVALS =
|
|
555
540
|
/(?:^|[^\w])(?:models?|config(?:uration)?s?|arms?|variants?|approach(?:es)?|options?|plans?|polic(?:y|ies)|providers?|modes?|strateg(?:y|ies)|candidates?|settings?|shapes?|backends?|engines?|librar(?:y|ies)|implementations?|vendors?|tools?|methods?|algorithms?|setups?|runs?)(?![\w])/i;
|
|
@@ -606,13 +591,16 @@ export function planChart(table: TableAnalysis): ChartPlan | undefined {
|
|
|
606
591
|
|
|
607
592
|
/**
|
|
608
593
|
* Whether a model should pick `table`'s chart (`tui.autoGraph: smart`):
|
|
609
|
-
* multi-series tables,
|
|
610
|
-
* `guess` plots (`Thread | State`, `Finding | Current`),
|
|
611
|
-
* tells a
|
|
594
|
+
* multi-series tables, tables whose rows may be named by a number the
|
|
595
|
+
* `guess` plots (`Thread | State`, `Finding | Current`), and any other chart
|
|
596
|
+
* the guess would draw — only meaning tells a measure from page references,
|
|
597
|
+
* step numbers or figures quoted in prose, which the judge charts as none.
|
|
612
598
|
*/
|
|
613
599
|
export function shouldJudge(table: TableAnalysis, guess: ChartPlan | undefined): boolean {
|
|
614
600
|
if (!guess || table.rows.length < 3) return false;
|
|
615
|
-
|
|
601
|
+
if (table.measures.length >= 2 || leadingMeasures(table, guess).length > 0) return true;
|
|
602
|
+
const spec = buildChart(table, guess);
|
|
603
|
+
return spec !== undefined && worthCharting(spec);
|
|
616
604
|
}
|
|
617
605
|
|
|
618
606
|
/** Measure columns before `guess`'s text label column: numbers that may only name their rows. */
|
|
@@ -696,38 +684,33 @@ export function drawnNames(spec: ChartSpec): Set<string> {
|
|
|
696
684
|
}
|
|
697
685
|
|
|
698
686
|
/**
|
|
699
|
-
* The local guess at what `plan`'s rows and measures mean:
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
* `(current)` row names, and a status
|
|
687
|
+
* The local guess at what `plan`'s rows and measures mean: each measure's
|
|
688
|
+
* {@link Polarity} as far as its unit says ({@link dimPolarity}; what a name
|
|
689
|
+
* means — `Memory` as a capacity or a cost — is the judge's call), rivals from
|
|
690
|
+
* the label's header, focus from bolded or `(current)` row names, and a status
|
|
691
|
+
* column whose cells vary.
|
|
703
692
|
*/
|
|
704
693
|
export function guessMeaning(
|
|
705
694
|
table: TableAnalysis,
|
|
706
695
|
plan: ChartPlan,
|
|
707
696
|
): Pick<ChartPlan, "polarity" | "rowPolarity" | "rivals" | "focus" | "status"> {
|
|
708
697
|
const label = plan.label === undefined ? undefined : table.columns[plan.label];
|
|
709
|
-
// A comparison of two conditions reads
|
|
698
|
+
// A comparison of two conditions reads money and sizes the way a change does: as what it cuts.
|
|
710
699
|
const change =
|
|
711
700
|
plan.kind === "change" || plan.kind === "stat" || table.columns.some(column => BEFORE.test(column.header));
|
|
712
701
|
const polarity: Record<number, Polarity> = {};
|
|
713
702
|
for (const column of table.columns) {
|
|
714
|
-
if (column === label) continue;
|
|
715
703
|
// A signed delta's sign convention (saved vs. spent) is not in its unit.
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
(column.role === "measure" && !delta
|
|
720
|
-
? dimPolarity(column.dim, column.unit, change, column.scores)
|
|
721
|
-
: undefined);
|
|
704
|
+
if (column === label || column.role !== "measure" || DELTA.test(column.header) || column.signedShare >= 0.5)
|
|
705
|
+
continue;
|
|
706
|
+
const guessed = dimPolarity(column.dim, column.unit, change, column.scores);
|
|
722
707
|
if (guessed) polarity[column.index] = guessed;
|
|
723
708
|
}
|
|
724
709
|
const rowPolarity: Record<number, Polarity> = {};
|
|
725
710
|
if (label && rowsAreMetrics(table, plan))
|
|
726
711
|
for (const row of [...table.rows, ...table.totals]) {
|
|
727
712
|
const first = plan.series.map(index => table.columns[index]!.cells[row]).find(isNumber);
|
|
728
|
-
const guessed =
|
|
729
|
-
headerPolarity(label.cells[row]!.text, true) ??
|
|
730
|
-
(first ? dimPolarity(first.dim, first.unit, true, false) : undefined);
|
|
713
|
+
const guessed = first && dimPolarity(first.dim, first.unit, change, false);
|
|
731
714
|
if (guessed) rowPolarity[row] = guessed;
|
|
732
715
|
}
|
|
733
716
|
return {
|
|
@@ -745,23 +728,10 @@ export function rowsAreMetrics(table: TableAnalysis, plan: ChartPlan): boolean {
|
|
|
745
728
|
}
|
|
746
729
|
|
|
747
730
|
/**
|
|
748
|
-
* A measure's {@link Polarity} from its
|
|
749
|
-
* none); `change` admits resources a change aims to shrink.
|
|
750
|
-
*/
|
|
751
|
-
function headerPolarity(name: string, change: boolean): Polarity | undefined {
|
|
752
|
-
// `gtTagRelevance`: camelCase words read apart.
|
|
753
|
-
const plain = plainCell(name).text.replace(/([a-z])([A-Z])/g, "$1 $2");
|
|
754
|
-
if (NEUTRAL.test(plain)) return undefined;
|
|
755
|
-
if (HIGHER_BETTER.test(plain)) return "higher";
|
|
756
|
-
if (LOWER_BETTER.test(plain)) return "lower";
|
|
757
|
-
if (change && LOWER_IN_CHANGE.test(plain)) return "lower";
|
|
758
|
-
return undefined;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* A measure's {@link Polarity} from its unit when its name gives none:
|
|
731
|
+
* A measure's {@link Polarity} from the unit its values are written in:
|
|
763
732
|
* scores out of a total and rates per second climb, durations shrink, and
|
|
764
|
-
* money and sizes shrink beside a baseline.
|
|
733
|
+
* money and sizes shrink beside a baseline (`change`). Elsewhere a size may
|
|
734
|
+
* be a capacity (`L2 cache`, `Memory`) and money a budget: no polarity.
|
|
765
735
|
*/
|
|
766
736
|
function dimPolarity(dim: Dimension | undefined, unit: string, change: boolean, scores: boolean): Polarity | undefined {
|
|
767
737
|
if (scores) return "higher";
|
|
@@ -2,6 +2,7 @@ import { type Component } from "../tui";
|
|
|
2
2
|
import { Disclosure } from "../components/disclosure";
|
|
3
3
|
import { visibleWidth } from "../utils";
|
|
4
4
|
import type { AdvisorMessageDetails, AdvisorNote, AdvisorSeverity } from "./messages";
|
|
5
|
+
import { chatTranscriptDisplayPreferences } from "./display-preferences";
|
|
5
6
|
import { formatBadge, replaceTabs, type ToolUIColor, wrapTextWithAnsi } from "../render/render-utils";
|
|
6
7
|
import { Ellipsis, truncateToWidth } from "../render";
|
|
7
8
|
import type { Theme } from "../theme";
|
|
@@ -274,6 +275,7 @@ export function createAdvisorMessageCard(
|
|
|
274
275
|
body: () => new AdvisorNotes(notes, 0, uiTheme),
|
|
275
276
|
expanded: getExpanded(),
|
|
276
277
|
paddingX: 1,
|
|
278
|
+
maxCollapsedRows: chatTranscriptDisplayPreferences.advisorCollapsedLines || undefined,
|
|
277
279
|
});
|
|
278
280
|
// The tool-output toggle owns expansion state; synchronize the controlled
|
|
279
281
|
// disclosure from the callback on every render.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AssistantMessage, ImageContent } from "@linxiraos/pi-ai";
|
|
2
2
|
import { type Component, Container } from "../tui";
|
|
3
3
|
import { type ImageBudget } from "../components/image";
|
|
4
|
-
import type { AssistantThinkingRenderer } from "./extension-types";
|
|
4
|
+
import type { AssistantTextRenderer, AssistantTextRendering, AssistantThinkingRenderer } from "./extension-types";
|
|
5
5
|
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node";
|
|
6
6
|
import { type CacheInvalidation } from "./cache-invalidation-marker";
|
|
7
7
|
import { type ServedModelMismatch } from "./served-model-marker";
|
|
@@ -38,7 +38,7 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
38
38
|
* for lack of a target is re-rendered with its reaction stripped.
|
|
39
39
|
*/
|
|
40
40
|
pickReactionTarget(transcript: readonly Component[]): void;
|
|
41
|
-
constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: () => void, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget, proseOnlyThinking?: boolean, linkTargets?: ReadonlyMap<string, string>, expandThinkingBlocks?: boolean);
|
|
41
|
+
constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: () => void, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget, proseOnlyThinking?: boolean, linkTargets?: ReadonlyMap<string, string>, expandThinkingBlocks?: boolean, textRendering?: AssistantTextRendering);
|
|
42
42
|
/**
|
|
43
43
|
* Show or clear the trailing cache-invalidation divider. Set at `message_end`
|
|
44
44
|
* (live) or during rebuild, once the turn's usage is known and compared
|
|
@@ -87,7 +87,7 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
87
87
|
*/
|
|
88
88
|
setExpanded(expanded: boolean): void;
|
|
89
89
|
isTranscriptBlockFinalized(): boolean;
|
|
90
|
-
/**
|
|
90
|
+
/** Hold image and figure rendering until the completed block can enter immutable scrollback. */
|
|
91
91
|
isTranscriptBlockPending(): boolean;
|
|
92
92
|
render(width: number): readonly string[];
|
|
93
93
|
/**
|
|
@@ -122,7 +122,19 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
122
122
|
renderTranscriptBlockEmergencyRow(width: number): string | undefined;
|
|
123
123
|
getTranscriptBlockVersion(): number;
|
|
124
124
|
markTranscriptBlockFinalized(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Swap the extension text renderers (the setting enabling them changed) and redraw with them.
|
|
127
|
+
* Enabling them also drops rows already published as stable, since a renderer may rewrite them;
|
|
128
|
+
* callers MUST pair this with a scrollback-clearing display reset, as for
|
|
129
|
+
* {@link resetTranscriptStableRows}.
|
|
130
|
+
*/
|
|
131
|
+
setTextRenderers(renderers: readonly AssistantTextRenderer[]): void;
|
|
125
132
|
applyRetryRecovery(retryRecovery: AssistantMessage["retryRecovery"]): void;
|
|
133
|
+
/**
|
|
134
|
+
* Draw the current message again when it is the reply sent at `timestamp`, re-running the
|
|
135
|
+
* extension text renderers; returns whether it was. The caller schedules the frame.
|
|
136
|
+
*/
|
|
137
|
+
rerenderMessage(timestamp: number): boolean;
|
|
126
138
|
messagePersistenceKey(): string | undefined;
|
|
127
139
|
/** Toggle rendering for assistant-native and tool-result images. */
|
|
128
140
|
setImagesVisible(visible: boolean): void;
|