@linxiraos/pi-tui 1.4.4 → 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 +208 -207
- package/README.md +34 -34
- package/dist/types/app-keybindings.d.ts +20 -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/context-map.d.ts +15 -0
- package/dist/types/chrome/context-presentation.d.ts +48 -0
- package/dist/types/chrome/context-view-model.d.ts +77 -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/image.d.ts +20 -0
- package/dist/types/components/loader.d.ts +1 -1
- package/dist/types/components/markdown.d.ts +7 -0
- package/dist/types/native/blobs.d.ts +11 -1
- package/dist/types/native/picker.d.ts +4 -4
- package/dist/types/overlays/advisor-config.d.ts +6 -0
- package/dist/types/overlays/agent-hub-projection.d.ts +3 -1
- package/dist/types/overlays/annotation-overlay.d.ts +7 -1
- package/dist/types/overlays/annotation-types.d.ts +28 -0
- package/dist/types/overlays/ask-dialog.d.ts +12 -3
- package/dist/types/overlays/btw-history-panel.d.ts +16 -2
- package/dist/types/overlays/btw-history.d.ts +7 -0
- package/dist/types/overlays/btw-panel.d.ts +2 -0
- package/dist/types/overlays/context-viewer-format.d.ts +42 -0
- package/dist/types/overlays/context-viewer-overview.d.ts +70 -0
- package/dist/types/overlays/context-viewer.d.ts +25 -0
- package/dist/types/overlays/hook-input.d.ts +1 -0
- package/dist/types/overlays/login-dialog.d.ts +5 -1
- package/dist/types/overlays/mcp-add-wizard.d.ts +2 -0
- package/dist/types/overlays/model-browser.d.ts +10 -1
- package/dist/types/overlays/oauth-selector.d.ts +23 -0
- package/dist/types/overlays/pause-screen.d.ts +13 -3
- 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/running-subagent-badge.d.ts +7 -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/prompt/macos-spelling.d.ts +2 -2
- package/dist/types/render/extension-links.d.ts +65 -0
- package/dist/types/render/hyperlink.d.ts +38 -7
- package/dist/types/render/index.d.ts +1 -0
- package/dist/types/render/output-pane.d.ts +1 -1
- package/dist/types/render/render-utils.d.ts +7 -1
- 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 +3 -3
- package/dist/types/status-line/context-usage.d.ts +42 -35
- package/dist/types/status-line/host.d.ts +6 -2
- package/dist/types/terminal-capabilities.d.ts +7 -0
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/theme/theme.d.ts +0 -23
- package/dist/types/tools/ask.d.ts +4 -0
- 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/edit.d.ts +3 -1
- package/dist/types/tools/fetch.d.ts +1 -0
- package/dist/types/tools/github.d.ts +3 -0
- package/dist/types/tools/grouped-file-output.d.ts +2 -0
- 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 +7 -6
- package/dist/types/tools/native-view.d.ts +1 -1
- package/dist/types/tools/read.d.ts +3 -0
- 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/wait.d.ts +16 -2
- package/dist/types/tools/yield.d.ts +1 -1
- package/dist/types/tui.d.ts +9 -2
- package/dist/types/vim.d.ts +39 -0
- package/package.json +10 -14
- package/src/app-keybindings.d.ts +20 -0
- package/src/app-keybindings.ts +20 -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 +13 -1
- 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/read-tool-group.ts +1 -2
- package/src/chat/reply-write.d.ts +48 -0
- package/src/chat/reply-write.ts +127 -0
- package/src/chat/skill-message.ts +2 -6
- 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/context-map.ts +62 -0
- package/src/chrome/context-presentation.ts +26 -0
- package/src/chrome/context-view-model.ts +73 -0
- package/src/chrome/index.ts +1 -0
- package/src/chrome/transcript-container.ts +89 -59
- 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 +465 -14
- package/src/components/image.d.ts +20 -0
- package/src/components/image.ts +83 -18
- package/src/components/loader.d.ts +1 -1
- package/src/components/loader.ts +1 -1
- package/src/components/markdown.d.ts +7 -0
- package/src/components/markdown.ts +225 -13
- package/src/hotkeys-markdown.ts +2 -0
- package/src/native/backend.ts +5 -66
- package/src/native/blobs.d.ts +11 -1
- package/src/native/blobs.ts +5 -3
- package/src/native/picker.d.ts +4 -4
- package/src/native/picker.ts +4 -4
- package/src/overlays/advisor-config.ts +10 -12
- package/src/overlays/agent-hub-projection.d.ts +3 -1
- package/src/overlays/agent-hub-projection.ts +6 -5
- package/src/overlays/agent-hub.ts +51 -42
- package/src/overlays/annotation-overlay.ts +125 -37
- package/src/overlays/annotation-types.ts +24 -0
- package/src/overlays/ask-dialog.ts +125 -35
- package/src/overlays/btw-history-panel.ts +124 -12
- package/src/overlays/btw-history.ts +11 -0
- package/src/overlays/btw-panel.ts +8 -4
- package/src/overlays/context-viewer-format.ts +145 -0
- package/src/overlays/context-viewer-overview.ts +381 -0
- package/src/overlays/context-viewer.ts +728 -0
- package/src/overlays/hook-input.ts +2 -0
- package/src/overlays/hook-selector.ts +2 -2
- package/src/overlays/login-dialog.ts +31 -5
- package/src/overlays/mcp-add-wizard.ts +6 -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/pause-screen.ts +166 -33
- package/src/overlays/plan-review-overlay.ts +13 -2
- package/src/overlays/rewind-selector.ts +29 -12
- package/src/overlays/running-subagent-badge.ts +12 -1
- package/src/overlays/session-selector.ts +313 -42
- package/src/overlays/settings-defs.ts +1 -0
- package/src/overlays/usage-dashboard.ts +20 -14
- 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/prompt/macos-spelling.ts +24 -15
- package/src/render/extension-links.d.ts +65 -0
- package/src/render/extension-links.ts +214 -0
- package/src/render/hyperlink.d.ts +38 -7
- package/src/render/hyperlink.ts +102 -23
- package/src/render/index.d.ts +1 -0
- package/src/render/index.ts +1 -0
- package/src/render/output-pane.d.ts +1 -1
- package/src/render/output-pane.ts +60 -17
- package/src/render/render-utils.d.ts +7 -1
- package/src/render/render-utils.ts +11 -2
- 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 +194 -392
- 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 +10 -14
- package/src/status-line/context-usage.ts +122 -597
- package/src/status-line/host.ts +6 -2
- package/src/terminal-capabilities.d.ts +7 -0
- package/src/terminal-capabilities.ts +10 -0
- package/src/terminal.ts +24 -2
- package/src/theme/defaults.json +1 -0
- package/src/theme/loader.ts +1 -1
- package/src/theme/symbols.d.ts +1 -1
- package/src/theme/symbols.ts +16 -0
- package/src/theme/theme.d.ts +0 -23
- package/src/theme/theme.ts +2 -75
- package/src/tools/ask.d.ts +4 -0
- package/src/tools/ask.ts +4 -0
- package/src/tools/ast-grep.ts +3 -2
- 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 +7 -23
- package/src/tools/default-renderer.d.ts +6 -4
- package/src/tools/default-renderer.ts +9 -6
- package/src/tools/edit.d.ts +3 -1
- package/src/tools/edit.ts +8 -4
- package/src/tools/eval.ts +14 -4
- package/src/tools/fetch.d.ts +1 -0
- package/src/tools/fetch.ts +1 -0
- package/src/tools/find.ts +3 -10
- package/src/tools/github.d.ts +3 -0
- package/src/tools/github.ts +23 -3
- package/src/tools/glob.ts +4 -3
- package/src/tools/grep.ts +3 -4
- package/src/tools/grouped-file-output.d.ts +2 -0
- package/src/tools/grouped-file-output.ts +8 -2
- 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 +7 -6
- package/src/tools/mcp.ts +41 -15
- package/src/tools/native-view.d.ts +1 -1
- package/src/tools/native-view.ts +3 -3
- package/src/tools/read.d.ts +3 -0
- package/src/tools/read.ts +3 -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/vibe.ts +14 -3
- package/src/tools/wait.d.ts +16 -2
- package/src/tools/wait.ts +16 -2
- package/src/tools/yield.d.ts +1 -1
- package/src/tools/yield.ts +18 -9
- package/src/tui.d.ts +9 -2
- package/src/tui.ts +102 -34
- package/src/vim.d.ts +39 -0
- package/src/vim.ts +313 -22
- 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
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import type { CredentialsApi, KeysApi } from "@linxiraos/pi-ai";
|
|
2
2
|
import { type SgrMouseEvent } from "../index.js";
|
|
3
3
|
import { OverlayPanel } from "../chrome/overlay-box.js";
|
|
4
|
+
import type { TspText } from "@linxiraos/pi-wire";
|
|
4
5
|
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
|
|
5
6
|
/** Credential presence and provenance needed by the provider picker. */
|
|
6
7
|
export interface OAuthSelectorAuthSource {
|
|
7
8
|
readonly credentials: Pick<CredentialsApi, "has">;
|
|
8
9
|
readonly keys: Pick<KeysApi, "source">;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* How a host other than `/login` presents the native provider sheet (the
|
|
13
|
+
* setup wizard): its heading, `role` and size, a status line docked above the
|
|
14
|
+
* action bar, and the Esc action that leaves in place of Close (the action's
|
|
15
|
+
* `id` cancels like Esc).
|
|
16
|
+
*/
|
|
17
|
+
export interface OAuthSelectorSheet {
|
|
18
|
+
readonly title: string;
|
|
19
|
+
readonly subtitle: TspText;
|
|
20
|
+
readonly role: string;
|
|
21
|
+
readonly size: "md" | "lg";
|
|
22
|
+
readonly status?: TspText;
|
|
23
|
+
readonly leave: {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly label: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
10
28
|
/**
|
|
11
29
|
* Component that renders an OAuth provider selector.
|
|
12
30
|
*/
|
|
@@ -16,8 +34,13 @@ export declare class OAuthSelectorComponent extends OverlayPanel {
|
|
|
16
34
|
disabledProviders?: readonly string[];
|
|
17
35
|
validateAuth?: (providerId: string) => Promise<boolean>;
|
|
18
36
|
requestRender?: () => void;
|
|
37
|
+
sheet?: OAuthSelectorSheet;
|
|
19
38
|
});
|
|
20
39
|
stopValidation(): void;
|
|
40
|
+
/** Replace the native sheet's presentation (a new outcome line, a relabelled leave action). */
|
|
41
|
+
setSheet(sheet: OAuthSelectorSheet): void;
|
|
42
|
+
/** Re-read credential state after a sign-in stored one, keeping the query and selection. */
|
|
43
|
+
refreshAuth(): void;
|
|
21
44
|
/**
|
|
22
45
|
* Fit the selector into `lines` rendered rows by shrinking the visible list
|
|
23
46
|
* window (the window is centered on the selection, so the selected row is
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { type Component, type OverlayFocusOwner, type OverlayHandle, type OverlayOptions } from "../index.js";
|
|
2
2
|
import type { NativeNode, NativeUiEvent } from "../native/node.js";
|
|
3
|
+
/** Outstanding turn and job counts supplied by the pause-screen host. */
|
|
4
|
+
export interface PauseWorkStatus {
|
|
5
|
+
unsettledTurns: number;
|
|
6
|
+
unfinishedJobs: number;
|
|
7
|
+
}
|
|
8
|
+
/** Optional live work source for the pause overlay. */
|
|
9
|
+
export interface PauseScreenOptions {
|
|
10
|
+
getWorkStatus?: () => PauseWorkStatus;
|
|
11
|
+
}
|
|
3
12
|
/**
|
|
4
13
|
* Slice of `InteractiveModeContext` the pause screen drives. Narrow so tests
|
|
5
14
|
* can exercise the full engage → hold → release lifecycle without a real TUI.
|
|
@@ -22,12 +31,13 @@ export interface PauseScreenHost {
|
|
|
22
31
|
* Paint the pause scene as exactly `height` rows, vertically centered.
|
|
23
32
|
* Exported for tests.
|
|
24
33
|
*/
|
|
25
|
-
export declare function renderPauseScreen(width: number, height: number, elapsedMs: number, sessionName?: string): string[];
|
|
34
|
+
export declare function renderPauseScreen(width: number, height: number, elapsedMs: number, sessionName?: string, workStatus?: PauseWorkStatus): string[];
|
|
26
35
|
/** Fullscreen overlay component; resolves {@link run} when a resume key lands. */
|
|
27
36
|
export declare class PauseScreenComponent implements Component, OverlayFocusOwner {
|
|
28
37
|
#private;
|
|
29
38
|
readonly host: PauseScreenHost;
|
|
30
|
-
|
|
39
|
+
readonly options: PauseScreenOptions;
|
|
40
|
+
constructor(host: PauseScreenHost, options?: PauseScreenOptions);
|
|
31
41
|
/** Start the clock; resolves once the user asks to resume. */
|
|
32
42
|
run(): Promise<void>;
|
|
33
43
|
dispose(): void;
|
|
@@ -57,4 +67,4 @@ export declare class PauseScreenComponent implements Component, OverlayFocusOwne
|
|
|
57
67
|
* gate on the way out (including teardown throws) — a leaked pause would
|
|
58
68
|
* freeze every agent in the process with no UI left to release it.
|
|
59
69
|
*/
|
|
60
|
-
export declare function runPauseScreen(host: PauseScreenHost): Promise<void>;
|
|
70
|
+
export declare function runPauseScreen(host: PauseScreenHost, options?: PauseScreenOptions): Promise<void>;
|
|
@@ -74,6 +74,8 @@ export interface PlanReviewOverlayOptions {
|
|
|
74
74
|
slider?: HookSelectorSlider;
|
|
75
75
|
/** Display label for the external-editor key, surfaced in the footer help. */
|
|
76
76
|
externalEditorLabel?: string;
|
|
77
|
+
/** The external editor's name ("Notepad", "nvim") for the native Edit button; `$EDITOR` when unset. */
|
|
78
|
+
externalEditorName?: string;
|
|
77
79
|
/** Serializable annotations restored into this overlay instance. */
|
|
78
80
|
annotationState?: PlanReviewAnnotationState;
|
|
79
81
|
}
|
|
@@ -74,7 +74,7 @@ export declare class RewindSelectorComponent implements Component {
|
|
|
74
74
|
* of branch columns, the current path first. The bar is this component's
|
|
75
75
|
* own node, docked under the page, so the filter field keeps the caret.
|
|
76
76
|
*/
|
|
77
|
-
describeScreen(
|
|
77
|
+
describeScreen(cx: DescribeContext): NativeScreen;
|
|
78
78
|
/** The bar docked under the page: position, key hints, Cancel and Rewind; the filter field while filtering. */
|
|
79
79
|
describe(_cx: DescribeContext): NativeNode;
|
|
80
80
|
/** The bar's buttons run their keys' paths; everything else belongs to the blocks. */
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AgentHubRegistry } from "./agent-hub-types.js";
|
|
2
2
|
export interface RunningSubagentRegistrySource<T extends AgentHubRegistry = AgentHubRegistry> {
|
|
3
3
|
agentRegistry: T;
|
|
4
4
|
}
|
|
5
5
|
export declare function getRunningSubagentBadgeRegistry<T extends AgentHubRegistry>(collabGuest: RunningSubagentRegistrySource<T> | undefined, localRegistry: T): T;
|
|
6
6
|
export declare function getRunningSubagentBadgeAgentIds(registry: AgentHubRegistry): string[];
|
|
7
|
+
/**
|
|
8
|
+
* Agents the Agent Hub roster can show (every registry ref but the main
|
|
9
|
+
* session), whatever their status: finished, parked and killed subagents
|
|
10
|
+
* stay inspectable after the last one stops running.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getInspectableSubagentCount(registry: AgentHubRegistry): number;
|
|
@@ -74,6 +74,8 @@ declare class SessionList<T extends SessionSelectorEntry> implements Component {
|
|
|
74
74
|
onExit: () => void;
|
|
75
75
|
onToggleScope?: () => void;
|
|
76
76
|
onDeleteRequest?: (session: T) => void;
|
|
77
|
+
onRenameRequest?: (session: T) => void;
|
|
78
|
+
onPinRequest?: (session: T, pinned: boolean) => void;
|
|
77
79
|
/** Re-render hook for async list updates (fuzzy scan completion, history merge). */
|
|
78
80
|
onRequestRender?: () => void;
|
|
79
81
|
constructor(sessions: T[], showCwd?: boolean, historyMatcher?: SessionHistoryMatcher, getTerminalRows?: () => number, pinnedIds?: ReadonlySet<string>, currentSessionPath?: string | (() => string | undefined));
|
|
@@ -87,6 +89,8 @@ declare class SessionList<T extends SessionSelectorEntry> implements Component {
|
|
|
87
89
|
/** Cancel pending async search work; idempotent, called on every picker exit path. */
|
|
88
90
|
dispose(): void;
|
|
89
91
|
removeSession(sessionPath: string): void;
|
|
92
|
+
/** Update a session's title in place and refresh the visible list, keeping the selection. */
|
|
93
|
+
renameSessionTitle(sessionPath: string, title: string): void;
|
|
90
94
|
/** Resolve a list-local rendered-line index to a filtered-session index. */
|
|
91
95
|
hitTestSession(line: number): number | undefined;
|
|
92
96
|
/** Wheel notch: move the selection one step (clamped, no wrap). */
|
|
@@ -101,6 +105,14 @@ declare class SessionList<T extends SessionSelectorEntry> implements Component {
|
|
|
101
105
|
resumeSelected(): void;
|
|
102
106
|
/** Delete / Backspace on an empty query: ask the parent to confirm deleting the selected session. */
|
|
103
107
|
requestDelete(): void;
|
|
108
|
+
/** F2: ask the parent to rename the selected session. */
|
|
109
|
+
requestRename(): void;
|
|
110
|
+
/** Pin keys: ask the parent to pin or unpin the selected session (default: flip it); no-op when already there. */
|
|
111
|
+
requestPin(pinned?: boolean): void;
|
|
112
|
+
/** Apply a persisted pin change; the list re-partitions and the cursor follows the session. */
|
|
113
|
+
setPinned(sessionId: string, pinned: boolean): void;
|
|
114
|
+
/** Whether the selected session is pinned (picks the pin action's direction). */
|
|
115
|
+
get selectedPinned(): boolean;
|
|
104
116
|
/** Empty the search query (the empty state's "Clear search"). */
|
|
105
117
|
clearSearch(): void;
|
|
106
118
|
get selectedSession(): T | undefined;
|
|
@@ -128,6 +140,14 @@ declare class SessionList<T extends SessionSelectorEntry> implements Component {
|
|
|
128
140
|
}
|
|
129
141
|
export interface SessionSelectorOptions<T extends SessionSelectorEntry = SessionSelectorEntry> {
|
|
130
142
|
onDelete?: (session: T) => Promise<boolean>;
|
|
143
|
+
/**
|
|
144
|
+
* Rename the selected session to a user-supplied title; resolve with the
|
|
145
|
+
* title as stored (the session canonicalizes it) or null when the rename
|
|
146
|
+
* did not happen.
|
|
147
|
+
*/
|
|
148
|
+
onRename?: (session: T, title: string) => Promise<string | null>;
|
|
149
|
+
/** Persist the selected session's pin state (pin keys / the picker's Pin action). */
|
|
150
|
+
onSetPinned?: (session: T, pinned: boolean) => Promise<void>;
|
|
131
151
|
historyMatcher?: SessionHistoryMatcher;
|
|
132
152
|
/** Loads sessions across all projects for the all-projects scope toggle (Tab). */
|
|
133
153
|
loadAllSessions?: () => Promise<T[]>;
|
|
@@ -205,8 +225,8 @@ export declare class SessionSelectorComponent<T extends SessionSelectorEntry = S
|
|
|
205
225
|
/**
|
|
206
226
|
* With the `picker` kind: the data-first session picker (§4.7). Otherwise
|
|
207
227
|
* scope `tabs`, loading/error message, then the search `input` and session
|
|
208
|
-
* `list` — or the delete-confirmation dialog in their place, as on
|
|
209
|
-
* path — and the key-hint footer.
|
|
228
|
+
* `list` — or the delete-confirmation / rename dialog in their place, as on
|
|
229
|
+
* the ANSI path — and the key-hint footer.
|
|
210
230
|
*/
|
|
211
231
|
describe(cx: DescribeContext): NativeNode;
|
|
212
232
|
/** Picker events (root keypath); fallback: scope tab → toggle scope, click on a session → resume it, exactly like a mouse click. */
|
|
@@ -108,6 +108,19 @@ export interface ViewportClickRowTarget {
|
|
|
108
108
|
* decides focusability and recency.
|
|
109
109
|
*/
|
|
110
110
|
export declare function routeViewportClick(spans: readonly ViewportClickSpan[], index: number): string[];
|
|
111
|
+
/** An extension link label drawn on a mutable-viewport line: what a click or hint tag lands on. */
|
|
112
|
+
export interface ViewportLink {
|
|
113
|
+
readonly url: string;
|
|
114
|
+
/** Mutable-viewport line the label is drawn on. */
|
|
115
|
+
readonly row: number;
|
|
116
|
+
/** First cell of the label's part on that line. */
|
|
117
|
+
readonly start: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Called once when link-hint mode ends; `reason` is `"crowded"` when a row held more links than
|
|
121
|
+
* their tags could fit side by side, so no tags were drawn.
|
|
122
|
+
*/
|
|
123
|
+
export type LinkHintsEnd = (reason?: "crowded") => void;
|
|
111
124
|
/**
|
|
112
125
|
* Reserved click-candidate id for the pinned HUD expander row. Checked before
|
|
113
126
|
* any registry lookup: its `@…:…` charset cannot collide with generated agent
|
|
@@ -146,11 +159,35 @@ export declare class Composer implements TerminalFrameProvider, NativeSurfacePro
|
|
|
146
159
|
* are never in the viewport). Callers intersect with the live registry.
|
|
147
160
|
*/
|
|
148
161
|
viewportClickCandidates(index: number): string[];
|
|
162
|
+
/**
|
|
163
|
+
* The extension-owned link label drawn at cell `col` of a mutable-viewport line, or `undefined`.
|
|
164
|
+
* Only links whose scheme an extension registered match; see `extensionLinkLabels`.
|
|
165
|
+
*/
|
|
166
|
+
viewportLinkAt(index: number, col: number): ViewportLink | undefined;
|
|
149
167
|
/**
|
|
150
168
|
* Point the hover band at a click-candidate id (or clear it). Takes effect
|
|
151
169
|
* on the next frame; callers repaint only when the target actually changes.
|
|
152
170
|
*/
|
|
153
171
|
setHoveredClickId(id: string | undefined): void;
|
|
172
|
+
/** How many extension link labels the last frame drew; a label wrapped across rows counts once. */
|
|
173
|
+
viewportLinkCount(): number;
|
|
174
|
+
/**
|
|
175
|
+
* Enter keyboard link-hint mode: the next frame draws a tag over each extension link label it
|
|
176
|
+
* shows. `onEnd` runs once when the mode ends: a pick, a cancel, a key no tag starts with, a
|
|
177
|
+
* repaint that no longer draws the tagged labels where they were, or (`"crowded"`) a row with
|
|
178
|
+
* too many links for their tags to fit side by side.
|
|
179
|
+
*/
|
|
180
|
+
startLinkHints(onEnd: LinkHintsEnd): void;
|
|
181
|
+
/** Whether link-hint mode is on. */
|
|
182
|
+
get linkHintsActive(): boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Type one letter of a tag. Returns the link whose whole tag is now typed, `true` while the
|
|
185
|
+
* letters still lead to several tags, and `false` when none starts with them. The mode ends on
|
|
186
|
+
* a pick or a miss.
|
|
187
|
+
*/
|
|
188
|
+
typeLinkHint(letter: string): ViewportLink | boolean;
|
|
189
|
+
/** Leave link-hint mode without picking a link. */
|
|
190
|
+
cancelLinkHints(): void;
|
|
154
191
|
/** Acknowledges one accepted header, replay, or transcript batch. */
|
|
155
192
|
acknowledgeHistory(id: number): void;
|
|
156
193
|
/** Render the semantic transcript tail while the terminal borrows its resize buffer. */
|
|
@@ -183,6 +220,12 @@ export declare class Composer implements TerminalFrameProvider, NativeSurfacePro
|
|
|
183
220
|
setHeaderExtras(before: readonly Component[], after: readonly Component[]): void;
|
|
184
221
|
/** Update the canonical editor reference after InteractiveMode remounts a custom editor. */
|
|
185
222
|
setEditor(editor: CustomEditor): void;
|
|
223
|
+
/**
|
|
224
|
+
* End the startup input hold once the app's handlers are wired: the TSP
|
|
225
|
+
* terminal sends the typing it kept, and the keys the TUI held replay
|
|
226
|
+
* ({@link TUI.releaseHeldInput}). Idempotent.
|
|
227
|
+
*/
|
|
228
|
+
releaseHeldInput(): void;
|
|
186
229
|
/**
|
|
187
230
|
* Mount the session-aware status component into the slot below the editor,
|
|
188
231
|
* retiring the startup status line; the caller installs the real top-border
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
/** Shared assistant transcript construction and model-authored link caching. */
|
|
2
2
|
import type { AssistantMessage, Model } from "@linxiraos/pi-ai";
|
|
3
3
|
import type { ImageBudget } from "../components/image.js";
|
|
4
|
-
import type { AssistantThinkingRenderer } from "../chat/extension-types.js";
|
|
4
|
+
import type { AssistantTextRenderer, AssistantThinkingRenderer } from "../chat/extension-types.js";
|
|
5
5
|
import { AssistantMessageComponent } from "../chat/assistant-message.js";
|
|
6
|
+
import { ReplyWriteComponent } from "../chat/reply-write.js";
|
|
6
7
|
/** Session display capabilities supplied unchanged by the interactive host. */
|
|
7
8
|
export interface AssistantMessageSession {
|
|
8
9
|
readonly model?: Model;
|
|
9
10
|
readonly extensionRunner?: {
|
|
10
11
|
getAssistantThinkingRenderers(): readonly AssistantThinkingRenderer[];
|
|
12
|
+
/** Empty while the setting that enables them is off; hosts predating it may omit it. */
|
|
13
|
+
getAssistantTextRenderers?(): readonly AssistantTextRenderer[];
|
|
11
14
|
};
|
|
12
15
|
}
|
|
13
16
|
/** Host state required to construct and refresh assistant transcript segments. */
|
|
@@ -42,6 +45,10 @@ export declare function assistantMessageLinkTargets(message: AssistantMessage, t
|
|
|
42
45
|
/**
|
|
43
46
|
* Construct an {@link AssistantMessageComponent} wired to the live context's
|
|
44
47
|
* thinking/image settings. `message` is omitted for the streaming placeholder
|
|
45
|
-
* component and supplied when rendering a persisted turn.
|
|
48
|
+
* component and supplied when rendering a persisted turn. `contentOffset` is
|
|
49
|
+
* the index in the full reply of the first block of a segment drawn after a
|
|
50
|
+
* tool call, so extension text renderers see the reply's own block indexes.
|
|
46
51
|
*/
|
|
47
|
-
export declare function createAssistantMessageComponent(ctx: AssistantMessageHost, message?: AssistantMessage, linkTargets?: ReadonlyMap<string, string
|
|
52
|
+
export declare function createAssistantMessageComponent(ctx: AssistantMessageHost, message?: AssistantMessage, linkTargets?: ReadonlyMap<string, string>, contentOffset?: number): AssistantMessageComponent;
|
|
53
|
+
/** Construct a {@link ReplyWriteComponent} (an `out://` write) drawn like the context's assistant prose. */
|
|
54
|
+
export declare function createReplyWriteComponent(ctx: AssistantMessageHost): ReplyWriteComponent;
|
|
@@ -31,8 +31,8 @@ export declare class MacOSSpellingProvider implements EditorTextAssistProvider {
|
|
|
31
31
|
/**
|
|
32
32
|
* Misspelled prose ranges in `text` (offsets into it), in order and
|
|
33
33
|
* non-overlapping, except ones touching `context.typing` (the word still
|
|
34
|
-
* being typed).
|
|
35
|
-
*
|
|
34
|
+
* being typed). Checks the full logical line so rendering cuts cannot
|
|
35
|
+
* change spelling or prose boundaries. Uncached lines arrive through {@link onUpdate}.
|
|
36
36
|
*/
|
|
37
37
|
typoRanges(text: string, context: SpellingDecorationContext): readonly native.SpellingRange[];
|
|
38
38
|
/** Return the confident macOS correction after a completed prose word. */
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set the registered schemes (lowercase, without `:`). Bumps {@link extensionLinksVersion} on any
|
|
3
|
+
* change so cached markdown renders are redrawn.
|
|
4
|
+
*/
|
|
5
|
+
export declare function setExtensionLinks(next: Iterable<string>): void;
|
|
6
|
+
/** Changes whenever the scheme set changes; part of the markdown render cache key. */
|
|
7
|
+
export declare function extensionLinksVersion(): number;
|
|
8
|
+
/**
|
|
9
|
+
* Whether activating a registered-scheme link (a click or a hint tag) reaches its extension: a
|
|
10
|
+
* scheme is registered and the terminal is plain.
|
|
11
|
+
*/
|
|
12
|
+
export declare function extensionLinksRouted(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Set by the interactive product: whether the user has a way to pick a link drawn now (a bound
|
|
15
|
+
* hint key, mouse clicks). `undefined` when nothing in this process can pick one.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setExtensionLinkPicking(provider: (() => boolean) | undefined): void;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a registered-scheme link drawn now can be activated: links are routed and the product
|
|
20
|
+
* offers a way to pick them. Process-wide, so a UI-less extension runner (a subagent's, whose
|
|
21
|
+
* transcript the user may focus) answers like the interactive one.
|
|
22
|
+
*/
|
|
23
|
+
export declare function extensionLinkClicksAvailable(): boolean;
|
|
24
|
+
/** The registered scheme `href` uses, or `undefined` for every other link. */
|
|
25
|
+
export declare function extensionLinkScheme(href: string): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Draw an extension link's label: dotted-underlined (plain underline where the terminal has no
|
|
28
|
+
* styled underlines, re-applied after any style reset inside it) and wrapped in the OSC 8 marker
|
|
29
|
+
* {@link extensionLinkLabels} reads back in a plain terminal; as given in Tern's native view. Never
|
|
30
|
+
* followed by a ` (url)` suffix. `key` tells apart links of one URL drawn near each other; it must
|
|
31
|
+
* not change between renders of the same text, or rows rendered twice stop matching.
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatExtensionLink(label: string, href: string, key: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Tags for `count` links in keyboard link-hint mode: single letters while they suffice, otherwise
|
|
36
|
+
* two letters each, so no tag is a prefix of another. At most the alphabet squared (676) are made;
|
|
37
|
+
* links past that stay untagged.
|
|
38
|
+
*/
|
|
39
|
+
export declare function linkHintTags(count: number): string[];
|
|
40
|
+
/**
|
|
41
|
+
* `line` without omp's extension-link markers (the OSC 8 open and close around each label), for
|
|
42
|
+
* terminal output. Every other hyperlink is kept as is.
|
|
43
|
+
*/
|
|
44
|
+
export declare function stripExtensionLinkMarkers(line: string): string;
|
|
45
|
+
/** One extension link label drawn on a rendered row (before {@link stripExtensionLinkMarkers}). */
|
|
46
|
+
export interface ExtensionLinkLabel {
|
|
47
|
+
readonly url: string;
|
|
48
|
+
/**
|
|
49
|
+
* The marker's params, unique to each drawn link and repeated on every row a wrapped label
|
|
50
|
+
* spans, so a row's parts of one label can be told from an adjacent label of the same URL.
|
|
51
|
+
*/
|
|
52
|
+
readonly id: string;
|
|
53
|
+
/** First 0-based cell the label covers. */
|
|
54
|
+
readonly start: number;
|
|
55
|
+
/** Cell just past the label. */
|
|
56
|
+
readonly end: number;
|
|
57
|
+
/** Whether only blank cells follow the label on its row, so a wrapped label may go on below. */
|
|
58
|
+
readonly endsRow: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The extension link labels drawn on a rendered row, left to right. Only omp's own markers with a
|
|
62
|
+
* registered scheme match, so ordinary hyperlinks (even of a registered scheme) and rows drawn for
|
|
63
|
+
* a scheme that is no longer registered never do.
|
|
64
|
+
*/
|
|
65
|
+
export declare function extensionLinkLabels(line: string): ExtensionLinkLabel[];
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import type { TspSpan } from "@linxiraos/pi-wire";
|
|
2
2
|
import { type TerminalId } from "../terminal-capabilities.js";
|
|
3
|
+
export interface FileLinkConfig {
|
|
4
|
+
scheme?: string;
|
|
5
|
+
host?: string;
|
|
6
|
+
}
|
|
7
|
+
interface FileUriOptions {
|
|
8
|
+
line?: number;
|
|
9
|
+
col?: number;
|
|
10
|
+
/** Native image open actions need a local file URL rather than a desktop handler. */
|
|
11
|
+
local?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the remote file-link configuration once at host startup. Passing an
|
|
15
|
+
* explicit object lets SDK hosts and tests configure links without changing the
|
|
16
|
+
* process environment; an empty object restores ordinary file links. An invalid
|
|
17
|
+
* scheme or host logs a warning and keeps ordinary links.
|
|
18
|
+
*/
|
|
19
|
+
export declare function applyFileLinkSetting(config?: FileLinkConfig): void;
|
|
20
|
+
/**
|
|
21
|
+
* A file-link target for `filePath`, or `undefined` when Node cannot encode it.
|
|
22
|
+
*
|
|
23
|
+
* Node rejects a malformed UNC target (a UNC path escaped twice by its author,
|
|
24
|
+
* e.g. `\\\wsl.localhost\…`) with `ERR_INVALID_ARG_VALUE: Empty UNC servername`.
|
|
25
|
+
* A stored session keeps whatever a tool call recorded, so a transcript must
|
|
26
|
+
* render such a path without a link rather than throw while it rebuilds.
|
|
27
|
+
*/
|
|
28
|
+
export declare function tryFileUri(filePath: string, opts?: FileUriOptions): string | undefined;
|
|
3
29
|
/**
|
|
4
30
|
* Build the OSC 8 target for a file path on `terminalId`.
|
|
5
31
|
*
|
|
@@ -14,12 +40,16 @@ import { type TerminalId } from "../terminal-capabilities.js";
|
|
|
14
40
|
* The VS Code family instead navigates the documented
|
|
15
41
|
* `vscode://file/<path>:<line>:<col>` form. Everywhere else the plain `file:`
|
|
16
42
|
* URI is right, with the location left in the visible text — terminals that
|
|
17
|
-
* parse a `path:line:col` suffix resolve that on their own.
|
|
43
|
+
* parse a `path:line:col` suffix resolve that on their own. A configured custom
|
|
44
|
+
* handler takes precedence and receives optional `line`/`col` query parameters.
|
|
45
|
+
*
|
|
46
|
+
* Returns `undefined` when `filePath` cannot be encoded — a malformed UNC
|
|
47
|
+
* target on the `file:` branch, or a lone surrogate on the `vscode://` branch.
|
|
18
48
|
*/
|
|
19
49
|
export declare function fileUriForTerminal(filePath: string, opts: {
|
|
20
50
|
line?: number;
|
|
21
51
|
col?: number;
|
|
22
|
-
} | undefined, terminalId: TerminalId): string;
|
|
52
|
+
} | undefined, terminalId: TerminalId): string | undefined;
|
|
23
53
|
/**
|
|
24
54
|
* Returns true when OSC 8 hyperlinks should be emitted.
|
|
25
55
|
*
|
|
@@ -73,9 +103,8 @@ export declare function urlLinkSpan(target: string, displayText: string, s?: str
|
|
|
73
103
|
/** Whether native link spans and nodes may carry an `href`: everything but an explicit `off` policy. */
|
|
74
104
|
export declare function isNativeLinkEnabled(): boolean;
|
|
75
105
|
/**
|
|
76
|
-
* A native link span to a filesystem path
|
|
77
|
-
*
|
|
78
|
-
* text). Honours an explicit `off` policy.
|
|
106
|
+
* A native link span to a filesystem path using the configured file-link
|
|
107
|
+
* target. Honours an explicit `off` policy.
|
|
79
108
|
*/
|
|
80
109
|
export declare function fileLinkSpan(filePath: string, displayText: string, s?: string): TspSpan;
|
|
81
110
|
/**
|
|
@@ -84,13 +113,15 @@ export declare function fileLinkSpan(filePath: string, displayText: string, s?:
|
|
|
84
113
|
* Returns `displayText` unchanged when hyperlinks are disabled or when
|
|
85
114
|
* the text already contains an OSC 8 sequence (prevents double-wrapping).
|
|
86
115
|
* Relative paths resolve against the current working directory before URI
|
|
87
|
-
* encoding so the OSC 8 target is always a valid `file://` URL.
|
|
116
|
+
* encoding so the OSC 8 target is always a valid `file://` URL. A path Node
|
|
117
|
+
* cannot encode renders as `displayText` with no link.
|
|
88
118
|
*
|
|
89
119
|
* @param filePath - Filesystem path
|
|
90
120
|
* @param displayText - Text to render as the hyperlink anchor (may contain ANSI codes)
|
|
91
|
-
* @param opts - Optional line/col position
|
|
121
|
+
* @param opts - Optional line/col position (custom handlers use query params; VS Code uses a path suffix)
|
|
92
122
|
*/
|
|
93
123
|
export declare function fileHyperlink(filePath: string, displayText: string, opts?: {
|
|
94
124
|
line?: number;
|
|
95
125
|
col?: number;
|
|
96
126
|
}): string;
|
|
127
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DescribeContext, NativeNode } from "../native/node.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type Theme } from "../theme/theme.js";
|
|
3
3
|
import type { Component } from "../tui.js";
|
|
4
4
|
/** Which side of an output stream remains visible when the pane is capped. */
|
|
5
5
|
export type OutputPaneEdge = "head" | "tail";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* tool renderers to ensure a unified TUI experience.
|
|
6
6
|
*/
|
|
7
7
|
import { ThinkingLevel } from "@linxiraos/pi-agent-core";
|
|
8
|
-
import
|
|
8
|
+
import { Ellipsis } from "@linxiraos/pi-natives";
|
|
9
9
|
import type { Theme } from "../theme/theme.js";
|
|
10
10
|
import type { Component } from "../tui.js";
|
|
11
11
|
export { Ellipsis } from "@linxiraos/pi-natives";
|
|
@@ -284,6 +284,12 @@ export declare function capParseErrors(errors: string[] | undefined, limit?: num
|
|
|
284
284
|
export declare function createCachedComponent(getExpanded: () => boolean, compute: (width: number, expanded: boolean) => string[], options?: {
|
|
285
285
|
paddingX?: number;
|
|
286
286
|
}): Component;
|
|
287
|
+
/**
|
|
288
|
+
* Fit a status header plus body rows to `width` for search-style results. The
|
|
289
|
+
* header soft-wraps so its trailing summary meta (counts, `truncated`) stays
|
|
290
|
+
* visible behind a long pattern; body rows keep single-row truncation.
|
|
291
|
+
*/
|
|
292
|
+
export declare function fitHeaderedRows(header: string, rows: readonly string[], width: number): string[];
|
|
287
293
|
/**
|
|
288
294
|
* Single-slot memo for an expensive rendered string (syntax highlighting, diff
|
|
289
295
|
* coloring) keyed by the exact inputs that shape the bytes: theme instance,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SetupScene } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Preview and persist the terminal glyph preset. Skipped once the Glyph
|
|
4
|
-
* Protocol handshake confirmed the terminal renders
|
|
4
|
+
* Protocol handshake confirmed the terminal renders Zeta's bundled icons: every
|
|
5
5
|
* row renders cleanly there, and the default `unicode` preset already upgrades
|
|
6
6
|
* to nerd at runtime while staying safe on terminals without the protocol.
|
|
7
7
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { NativeNode } from "../../native/node.js";
|
|
2
2
|
export declare const SETUP_OUTRO_MS = 1200;
|
|
3
3
|
/**
|
|
4
|
-
* Native outro: the shimmering mark,
|
|
5
|
-
*
|
|
6
|
-
* the
|
|
4
|
+
* Native outro, centered: the shimmering Zeta mark, "Setup saved", the
|
|
5
|
+
* default model now in effect (`model`, its display name, when there is
|
|
6
|
+
* one), and an indeterminate progress bar standing in for the timed sweep.
|
|
7
|
+
* A click sends the `continue` action.
|
|
7
8
|
*/
|
|
8
|
-
export declare function describeSetupOutro(): NativeNode;
|
|
9
|
+
export declare function describeSetupOutro(model: string | undefined): NativeNode;
|
|
9
10
|
export declare function renderSetupOutro(width: number, height: number, elapsedMs: number): string[];
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { type SgrMouseEvent } from "../../mouse.js";
|
|
2
|
-
import type { NativeNode } from "../../native/node.js";
|
|
3
|
-
import type
|
|
2
|
+
import type { DescribeContext, NativeNode } from "../../native/node.js";
|
|
3
|
+
import { type SetupScene, type SetupSceneController, type SetupSceneHost } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* "Sign in" scene: lets the user authenticate one or more model providers via
|
|
6
6
|
* OAuth. It never auto-advances the wizard — the user may sign in to several
|
|
7
|
-
* providers and then
|
|
7
|
+
* providers and then leave the step with Esc.
|
|
8
|
+
*
|
|
9
|
+
* Picking is the provider selector (natively a setup sheet: Skip/Continue on
|
|
10
|
+
* Esc, Sign in on Enter); signing in is the app's {@link LoginDialogComponent},
|
|
11
|
+
* driven like `/login` drives it: natively its own sheet over the setup page,
|
|
12
|
+
* in the cell grid drawn in the wizard body in place of the selector.
|
|
8
13
|
*/
|
|
9
14
|
export declare class SignInScene implements SetupSceneController {
|
|
10
15
|
#private;
|
|
@@ -14,15 +19,15 @@ export declare class SignInScene implements SetupSceneController {
|
|
|
14
19
|
dispose(): void;
|
|
15
20
|
invalidate(): void;
|
|
16
21
|
handleInput(data: string): void;
|
|
17
|
-
/** Forward mouse to the provider selector;
|
|
22
|
+
/** Forward mouse to the provider selector; the login dialog takes keys only. */
|
|
18
23
|
routeMouse(event: SgrMouseEvent, line: number, col: number): void;
|
|
19
24
|
render(width: number, maxLines?: number): readonly string[];
|
|
20
25
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
26
|
+
* Signing in: the login dialog (its own sheet). Picking: the provider
|
|
27
|
+
* selector, which presents the setup sheet where the terminal draws
|
|
28
|
+
* pickers; elsewhere it is an inline card under the lead and the outcome.
|
|
24
29
|
*/
|
|
25
|
-
describe(): NativeNode;
|
|
30
|
+
describe(cx: DescribeContext): NativeNode;
|
|
26
31
|
}
|
|
27
32
|
/** Onboarding scene for provider sign-in. */
|
|
28
33
|
export declare const providersSetupScene: SetupScene;
|
|
@@ -42,7 +42,6 @@ export interface SetupHost extends SetupUiHost {
|
|
|
42
42
|
saveColorBlindMode(enabled: boolean): void;
|
|
43
43
|
saveTheme(mode: "dark" | "light", name: string): void;
|
|
44
44
|
captureBrowserSession(request: OAuthBrowserSessionRequest, signal?: AbortSignal): Promise<string>;
|
|
45
|
-
copyToClipboard(text: string): Promise<void>;
|
|
46
45
|
openInBrowser(url: string): void;
|
|
47
46
|
markComplete(version: number): Promise<void>;
|
|
48
47
|
playWelcomeIntro(): void;
|
|
@@ -80,11 +79,27 @@ export interface SetupSceneController extends Component {
|
|
|
80
79
|
*/
|
|
81
80
|
routeMouse?(event: SgrMouseEvent, line: number, col: number): void;
|
|
82
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Role of the sheet (`picker` or `overlay`) an interactive scene presents in a
|
|
84
|
+
* TSP terminal. The terminal's setup stylesheet seats it under the wizard's
|
|
85
|
+
* brand and stepper instead of floating it over a dimmed page.
|
|
86
|
+
*/
|
|
87
|
+
export declare const SETUP_SHEET_ROLE = "zeta.setup.sheet";
|
|
88
|
+
/** Surface role of the setup page (wizard and startup splash) in a TSP terminal. */
|
|
89
|
+
export declare const SETUP_SURFACE_ROLE = "zeta.app.setup";
|
|
83
90
|
/** Versioned onboarding scene definition. */
|
|
84
91
|
export interface SetupScene {
|
|
85
92
|
id: string;
|
|
86
93
|
title: string;
|
|
94
|
+
/** Short label for the wizard's stepper (`Sign in`, `Model`). */
|
|
95
|
+
step: string;
|
|
87
96
|
minVersion: number;
|
|
97
|
+
/**
|
|
98
|
+
* Configures something only the cell-grid renderer draws (glyphs, composer
|
|
99
|
+
* shape, theme). A TSP terminal draws those itself, so the wizard skips the
|
|
100
|
+
* scene while a native surface is live.
|
|
101
|
+
*/
|
|
102
|
+
ansiOnly?: boolean;
|
|
88
103
|
shouldRun?(ctx: SetupHost): boolean | Promise<boolean>;
|
|
89
104
|
mount(host: SetupSceneHost): SetupSceneController;
|
|
90
105
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type Component, type OverlayFocusOwner } from "../tui.js";
|
|
2
|
-
import type { NativeNode, NativeUiEvent } from "../native/node.js";
|
|
2
|
+
import type { DescribeContext, NativeNode, NativeScreen, NativeUiEvent } from "../native/node.js";
|
|
3
3
|
import type { SetupHost } from "./scenes/types.js";
|
|
4
|
-
import type
|
|
4
|
+
import { type SetupScene } from "./scenes/types.js";
|
|
5
|
+
/** Whether `scene` is asked under the current renderer: a TSP surface draws `ansiOnly` settings itself. */
|
|
6
|
+
export declare function setupSceneApplies(scene: SetupScene): boolean;
|
|
5
7
|
/** Fullscreen onboarding presentation with scene focus and mouse routing. */
|
|
6
8
|
export declare class SetupWizardComponent implements Component, OverlayFocusOwner {
|
|
7
9
|
#private;
|
|
@@ -14,12 +16,14 @@ export declare class SetupWizardComponent implements Component, OverlayFocusOwne
|
|
|
14
16
|
ownsOverlayFocusTarget(component: Component): boolean;
|
|
15
17
|
handleInput(data: string): void;
|
|
16
18
|
render(width: number): readonly string[];
|
|
19
|
+
/** The wizard is a page of its own: a screen surface styled by {@link SETUP_SURFACE_ROLE}. */
|
|
20
|
+
describeScreen(_cx: DescribeContext): NativeScreen;
|
|
17
21
|
/**
|
|
18
|
-
* Fullscreen description: splash, the active scene
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
+
* Fullscreen description: splash, the active scene under the setup
|
|
23
|
+
* header (brand, stepper, Exit setup), or the outro. The splash→scene
|
|
24
|
+
* dissolve is a row effect with no native counterpart, so a transition
|
|
25
|
+
* describes as the scene.
|
|
22
26
|
*/
|
|
23
|
-
describe(): NativeNode;
|
|
27
|
+
describe(cx: DescribeContext): NativeNode;
|
|
24
28
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
25
29
|
}
|
|
@@ -21,5 +21,9 @@ export interface RunSetupWizardOptions {
|
|
|
21
21
|
markComplete?: boolean;
|
|
22
22
|
playWelcomeIntro?: boolean;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Own the fullscreen setup overlay until its scenes and outro finish. When
|
|
26
|
+
* none of `scenes` applies to the current renderer (a TSP surface skips
|
|
27
|
+
* `ansiOnly` ones) nothing is shown, but completion is still persisted.
|
|
28
|
+
*/
|
|
25
29
|
export declare function runSetupWizard(ctx: SetupHost, scenes?: readonly SetupScene[], options?: RunSetupWizardOptions): Promise<void>;
|