@linxiraos/pi-tui 1.4.6 → 1.4.9
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 +162 -244
- package/README.md +41 -35
- 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/charts/table-data.d.ts +4 -2
- package/dist/types/chat/assistant-message.d.ts +15 -3
- package/dist/types/chat/bash-execution.d.ts +6 -1
- package/dist/types/chat/display-preferences.d.ts +2 -0
- package/dist/types/chat/eval-execution.d.ts +2 -0
- package/dist/types/chat/execution-shared.d.ts +14 -8
- package/dist/types/chat/extension-types.d.ts +31 -0
- package/dist/types/chat/figure-markdown.d.ts +2 -0
- package/dist/types/chat/reply-write.d.ts +48 -0
- package/dist/types/chat/svg-figure.d.ts +5 -0
- package/dist/types/chat/table-chart.d.ts +6 -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 +13 -3
- package/dist/types/chrome/dynamic-border.d.ts +6 -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 +21 -9
- package/dist/types/components/editor.d.ts +23 -6
- package/dist/types/components/image.d.ts +6 -0
- package/dist/types/components/loader.d.ts +2 -0
- package/dist/types/components/markdown.d.ts +7 -0
- package/dist/types/keybinding-matchers.d.ts +7 -0
- package/dist/types/native/blobs.d.ts +2 -1
- package/dist/types/native/describe.d.ts +4 -2
- package/dist/types/native/node.d.ts +2 -3
- package/dist/types/native/overlay.d.ts +42 -2
- package/dist/types/native/picker.d.ts +4 -4
- package/dist/types/native/state.d.ts +4 -0
- package/dist/types/overlays/annotation-overlay.d.ts +7 -1
- package/dist/types/overlays/annotation-types.d.ts +28 -0
- package/dist/types/overlays/btw-history-panel.d.ts +15 -0
- package/dist/types/overlays/btw-history.d.ts +24 -0
- package/dist/types/overlays/btw-inject.d.ts +22 -0
- package/dist/types/overlays/btw-panel.d.ts +7 -0
- package/dist/types/overlays/hook-editor.d.ts +2 -0
- package/dist/types/overlays/jobs-panel.d.ts +4 -0
- package/dist/types/overlays/login-dialog.d.ts +5 -1
- package/dist/types/overlays/model-browser.d.ts +11 -2
- 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 +33 -4
- package/dist/types/prompt/composer.d.ts +56 -5
- 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/render/render-utils.d.ts +23 -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 +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/status-line/startup.d.ts +0 -15
- package/dist/types/terminal-capabilities.d.ts +1 -1
- package/dist/types/theme/symbols.d.ts +3 -1
- package/dist/types/theme/theme-class.d.ts +1 -0
- package/dist/types/theme/theme.d.ts +1 -24
- package/dist/types/theme/tui-adapters.d.ts +2 -0
- package/dist/types/thinking.d.ts +8 -6
- package/dist/types/tools/ast-grep.d.ts +2 -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/eval.d.ts +2 -0
- package/dist/types/tools/find.d.ts +1 -1
- package/dist/types/tools/grouped-file-output.d.ts +100 -19
- package/dist/types/tools/hashline-format.d.ts +5 -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 +6 -5
- package/dist/types/tools/native-view.d.ts +3 -1
- package/dist/types/tools/output-meta.d.ts +27 -0
- package/dist/types/tools/read.d.ts +14 -4
- 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 +13 -4
- package/dist/types/tools/url-scheme-host.d.ts +17 -0
- package/dist/types/tools/wait.d.ts +2 -0
- package/dist/types/tools/yield.d.ts +1 -1
- package/dist/types/tui.d.ts +19 -2
- package/dist/types/utils.d.ts +4 -0
- package/package.json +10 -14
- package/src/app-keybindings.d.ts +20 -0
- package/src/app-keybindings.ts +20 -0
- package/src/apps/git/git-tui.ts +10 -17
- package/src/apps/git/sidebar.ts +21 -35
- package/src/apps/ps-top.ts +4 -12
- package/src/apps/session-picker.ts +7 -0
- package/src/charts/chart-plan.d.ts +9 -7
- package/src/charts/chart-plan.ts +20 -79
- package/src/charts/table-data.d.ts +4 -2
- package/src/charts/table-data.ts +55 -6
- 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 +6 -1
- package/src/chat/bash-execution.ts +26 -9
- package/src/chat/chat-transcript-builder.ts +63 -30
- 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/eval-execution.d.ts +2 -0
- package/src/chat/eval-execution.ts +14 -7
- package/src/chat/execution-shared.d.ts +14 -8
- package/src/chat/execution-shared.ts +39 -18
- package/src/chat/extension-types.d.ts +31 -0
- package/src/chat/extension-types.ts +34 -0
- package/src/chat/figure-markdown.d.ts +2 -0
- package/src/chat/figure-markdown.ts +6 -4
- package/src/chat/read-tool-group.ts +56 -36
- package/src/chat/reply-write.d.ts +48 -0
- package/src/chat/reply-write.ts +127 -0
- package/src/chat/svg-figure.d.ts +5 -0
- package/src/chat/svg-figure.ts +55 -16
- package/src/chat/table-chart.d.ts +6 -3
- package/src/chat/table-chart.ts +29 -6
- 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 +13 -3
- package/src/chat/transcript-render-helpers.ts +134 -44
- package/src/chrome/dynamic-border.d.ts +6 -0
- package/src/chrome/dynamic-border.ts +28 -2
- 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 +21 -9
- package/src/chrome/transcript-status.ts +32 -30
- package/src/components/editor.d.ts +23 -6
- package/src/components/editor.ts +133 -25
- package/src/components/image.d.ts +6 -0
- package/src/components/image.ts +13 -0
- package/src/components/key-value-list.ts +9 -9
- package/src/components/loader.d.ts +2 -0
- package/src/components/loader.ts +7 -0
- package/src/components/markdown.d.ts +7 -0
- package/src/components/markdown.ts +116 -6
- package/src/components/section.ts +1 -9
- package/src/components/table.ts +1 -9
- package/src/hotkeys-markdown.ts +1 -0
- package/src/keybinding-matchers.d.ts +7 -0
- package/src/keybinding-matchers.ts +13 -0
- package/src/native/backend.ts +10 -67
- package/src/native/blobs.d.ts +2 -1
- package/src/native/blobs.ts +3 -2
- package/src/native/describe.d.ts +4 -2
- package/src/native/describe.ts +9 -4
- package/src/native/node.d.ts +2 -3
- package/src/native/node.ts +2 -3
- package/src/native/overlay.d.ts +42 -2
- package/src/native/overlay.ts +124 -16
- package/src/native/picker.d.ts +4 -4
- package/src/native/picker.ts +4 -4
- package/src/native/state.d.ts +4 -0
- package/src/native/state.ts +25 -5
- 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/btw-history-panel.ts +106 -14
- package/src/overlays/btw-history.ts +65 -0
- package/src/overlays/btw-inject.ts +91 -0
- package/src/overlays/btw-panel.ts +53 -12
- package/src/overlays/extensions/extension-dashboard.ts +7 -8
- package/src/overlays/hook-editor.ts +6 -0
- package/src/overlays/hook-selector.ts +2 -2
- package/src/overlays/jobs-panel.ts +82 -22
- package/src/overlays/login-dialog.ts +39 -31
- package/src/overlays/mcp-add-wizard.ts +1 -1
- package/src/overlays/model-browser.ts +106 -10
- 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 +338 -47
- package/src/overlays/settings-defs.ts +2 -2
- package/src/overlays/tree-selector.ts +83 -27
- package/src/overlays/usage-dashboard.ts +9 -18
- package/src/prompt/composer.ts +233 -6
- 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/code-cell.ts +1 -1
- package/src/render/extension-links.d.ts +65 -0
- package/src/render/extension-links.ts +214 -0
- package/src/render/file-list.ts +4 -7
- 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/render/render-utils.d.ts +23 -1
- package/src/render/render-utils.ts +38 -6
- package/src/setup/scenes/composer.ts +2 -0
- package/src/setup/scenes/glyph.ts +4 -2
- 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/status-line/startup.ts +36 -70
- package/src/terminal-capabilities.d.ts +1 -1
- package/src/terminal-capabilities.ts +5 -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 +3 -1
- package/src/theme/symbols.ts +16 -9
- package/src/theme/theme-class.d.ts +1 -0
- package/src/theme/theme-class.ts +15 -3
- package/src/theme/theme.d.ts +1 -24
- package/src/theme/theme.ts +3 -75
- package/src/theme/tui-adapters.d.ts +2 -0
- package/src/theme/tui-adapters.ts +8 -3
- package/src/thinking.d.ts +8 -6
- package/src/thinking.ts +17 -11
- package/src/tmux.ts +1 -0
- package/src/tools/agent-tree.ts +13 -11
- package/src/tools/ask.ts +24 -37
- package/src/tools/ast-edit.ts +48 -93
- package/src/tools/ast-grep.d.ts +2 -0
- package/src/tools/ast-grep.ts +31 -67
- 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 +9 -0
- package/src/tools/default-renderer.d.ts +6 -4
- package/src/tools/default-renderer.ts +10 -7
- package/src/tools/edit.ts +50 -43
- package/src/tools/eval.d.ts +2 -0
- package/src/tools/eval.ts +16 -4
- package/src/tools/fetch.ts +2 -1
- package/src/tools/find.d.ts +1 -1
- package/src/tools/find.ts +13 -5
- package/src/tools/github.ts +14 -46
- package/src/tools/glob.ts +2 -1
- package/src/tools/grep.ts +47 -277
- package/src/tools/grouped-file-output.d.ts +100 -19
- package/src/tools/grouped-file-output.ts +414 -103
- package/src/tools/hashline-format.d.ts +5 -0
- package/src/tools/hashline-format.ts +5 -0
- 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 -46
- package/src/tools/lsp.d.ts +2 -0
- package/src/tools/lsp.ts +246 -47
- package/src/tools/mcp.d.ts +6 -5
- package/src/tools/mcp.ts +20 -12
- package/src/tools/native-view.d.ts +3 -1
- package/src/tools/native-view.ts +12 -6
- package/src/tools/output-meta.d.ts +27 -0
- package/src/tools/output-meta.ts +68 -4
- package/src/tools/proc-render.ts +3 -3
- package/src/tools/read.d.ts +14 -4
- package/src/tools/read.ts +20 -5
- 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 +13 -4
- package/src/tools/task.ts +100 -97
- package/src/tools/url-scheme-host.d.ts +17 -0
- package/src/tools/url-scheme-host.ts +21 -0
- package/src/tools/vibe.ts +4 -4
- package/src/tools/wait.d.ts +2 -0
- package/src/tools/wait.ts +8 -5
- package/src/tools/write.ts +17 -27
- package/src/tools/yield.d.ts +1 -1
- package/src/tools/yield.ts +19 -10
- package/src/tui.d.ts +19 -2
- package/src/tui.ts +134 -24
- package/src/utils.d.ts +4 -0
- package/src/utils.ts +10 -0
- 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
|
@@ -98,6 +98,14 @@ export declare class Editor implements Component, Focusable {
|
|
|
98
98
|
describeDecorations: ((lines: readonly string[]) => readonly TspEditorDecoration[]) | undefined;
|
|
99
99
|
/** TSP code language of the buffer (`python`, `bash`): the terminal highlights it in the mono face. */
|
|
100
100
|
describeLanguage: (() => string | undefined) | undefined;
|
|
101
|
+
/** Label the TSP field to disable host-side editing while another input owner handles raw keys. */
|
|
102
|
+
nativeKeyPassthrough: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Ask the TSP terminal to keep what is typed into this field and draw it at
|
|
105
|
+
* the caret until this clears, then send it: set while startup cannot read
|
|
106
|
+
* input yet (the prompt composer's deferred-input start).
|
|
107
|
+
*/
|
|
108
|
+
nativeTypeahead: boolean;
|
|
101
109
|
/**
|
|
102
110
|
* TSP chrome around the `editor` node (the prompt composer's chips, mode
|
|
103
111
|
* chip, send/stop): the root role, the children with `input` placed where
|
|
@@ -149,12 +157,21 @@ export declare class Editor implements Component, Focusable {
|
|
|
149
157
|
* cursor. The host styles it (ANSI allowed). Re-evaluated on every render, so hosts can derive
|
|
150
158
|
* it from live state. */
|
|
151
159
|
placeholder?: () => string | undefined;
|
|
152
|
-
/** Whole-message
|
|
153
|
-
*
|
|
154
|
-
* autocomplete is open. A shown prediction replaces the {@link placeholder}; Tab or
|
|
155
|
-
* the rest without submitting.
|
|
156
|
-
*
|
|
157
|
-
|
|
160
|
+
/** Whole-message predictions for the next prompt, most likely first. The first one the single-line
|
|
161
|
+
* buffer is a strict prefix of is painted as ghost text after the cursor while the cursor sits at
|
|
162
|
+
* its end and no autocomplete is open. A shown prediction replaces the {@link placeholder}; Tab or
|
|
163
|
+
* Right inserts the rest without submitting. A buffer the user typed keeps the ghost even when it
|
|
164
|
+
* equals a shorter prediction; once Tab, Right, or the list has inserted one of two or more
|
|
165
|
+
* predictions, no ghost extends it to a longer one, and Tab instead opens a list of all of them
|
|
166
|
+
* that swaps the whole line, also without submitting. Each must be a single line. Re-evaluated on
|
|
167
|
+
* every render, so hosts can derive them from live state. */
|
|
168
|
+
predictions?: () => readonly string[] | undefined;
|
|
169
|
+
/** Called with the prediction's index in {@link predictions} after Tab or Right inserts the rest of
|
|
170
|
+
* a shown prediction, or the alternatives list swaps a different one into the buffer. */
|
|
171
|
+
onPredictionAccepted?: (index: number) => void;
|
|
172
|
+
/** Called for each frame that paints a prediction as ghost text: a terminal frame that draws at
|
|
173
|
+
* least one cell of it, or a native frame that carries it as the editor's ghost. */
|
|
174
|
+
onPredictionShown?: () => void;
|
|
158
175
|
constructor(theme: EditorTheme);
|
|
159
176
|
/** Return bounded editor content, cursor, and transient child state for debug inspection. */
|
|
160
177
|
debugState(): Record<string, unknown>;
|
|
@@ -207,6 +207,12 @@ export declare class Image implements Component {
|
|
|
207
207
|
/** Return source metadata without exposing the encoded image buffer. */
|
|
208
208
|
debugState(): Record<string, unknown>;
|
|
209
209
|
invalidate(): void;
|
|
210
|
+
/**
|
|
211
|
+
* Refit to a new row ceiling; a SIXEL reserves its rows until the off-thread
|
|
212
|
+
* encode lands. A demoted fallback keeps the height already drawn only
|
|
213
|
+
* within the new ceiling: the owner chose to shrink the block.
|
|
214
|
+
*/
|
|
215
|
+
setMaxHeightCells(maxHeightCells: number): void;
|
|
210
216
|
releaseRenderCaches(): void;
|
|
211
217
|
/**
|
|
212
218
|
* A native `image` backed by a content-addressed blob; the terminal fits
|
|
@@ -71,6 +71,8 @@ export declare class Loader extends Text {
|
|
|
71
71
|
stop(): void;
|
|
72
72
|
/** Lifecycle teardown: stop the animation timer. Idempotent. */
|
|
73
73
|
dispose(): void;
|
|
74
|
+
/** The current spinner frame and message as one styled line, for hosts that set it into their own chrome. */
|
|
75
|
+
inlineText(): string;
|
|
74
76
|
/** Install a lazy right-docked suffix for the spinner row (e.g. a styled
|
|
75
77
|
* session title). Re-evaluated every paint; dropped when the row leaves
|
|
76
78
|
* less than a two-cell gap. */
|
|
@@ -10,6 +10,13 @@ import type { Component } from "../tui.js";
|
|
|
10
10
|
* byte-identical to rendering `text`.
|
|
11
11
|
*/
|
|
12
12
|
export declare function streamingMarkdownSource(text: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether `text` ends inside a code fence the source never closed. The
|
|
15
|
+
* renderer still draws such a fence's closing border, so a caller publishing a
|
|
16
|
+
* settled source prefix must drop that fabricated row: it is not a prefix of
|
|
17
|
+
* the live block, which reaches the border only once the closer arrives.
|
|
18
|
+
*/
|
|
19
|
+
export declare function endsInsideOpenFence(text: string): boolean;
|
|
13
20
|
/**
|
|
14
21
|
* Streaming `md` source for a native terminal, minus a still-growing table row:
|
|
15
22
|
* the unterminated last line when a GFM table (a run of pipe lines holding a
|
|
@@ -42,3 +42,10 @@ export declare function matchesAppFollowUp(data: string): boolean;
|
|
|
42
42
|
export declare function appApproveKeys(): readonly KeyId[];
|
|
43
43
|
/** Match the tool-approval key, recognizing modifier-tagged LF as Ctrl+Enter like {@link matchesAppFollowUp}. */
|
|
44
44
|
export declare function matchesAppApprove(data: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Effective /btw inject key (Alt+I by default). No fallback: it sends text into the main
|
|
47
|
+
* session, so a user who unbinds it gets no key at all.
|
|
48
|
+
*/
|
|
49
|
+
export declare function appBtwInjectKey(): KeyId | undefined;
|
|
50
|
+
/** Match the key that sends a /btw answer's steering prompt to the main session. */
|
|
51
|
+
export declare function matchesAppBtwInject(data: string): boolean;
|
|
@@ -29,7 +29,8 @@ export declare function base64ImageNode(data: string, mimeType: string, p?: Omit
|
|
|
29
29
|
/**
|
|
30
30
|
* Props that make an `image` node open the file at `filePath` (as a `file://` URL, the TSP
|
|
31
31
|
* open-target form): a click zooms the image in the terminal, and the file opens from its
|
|
32
|
-
* context menu.
|
|
32
|
+
* context menu. Always uses a local file URL because the open action runs locally,
|
|
33
|
+
* even when remote file handlers are configured. Empty without a file.
|
|
33
34
|
*/
|
|
34
35
|
export declare function openableImageProps(filePath: string | undefined): Pick<TspProps<"image">, "href" | "actions">;
|
|
35
36
|
/**
|
|
@@ -56,7 +56,9 @@ export declare function list(items: readonly NativeChild[], p?: TspProps<"list">
|
|
|
56
56
|
/** Terminal-clocked elapsed counter: `age` ms already elapsed; `stopped` freezes it there. */
|
|
57
57
|
export declare function elapsed(age: number, stopped?: boolean): NativeNode;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
59
|
+
* The key names of one key id (`"ctrl+o"` → `["ctrl", "o"]`), as `kbd` and
|
|
60
|
+
* `button` `keys` take them. A literal `+` key survives (`"+"`, `"ctrl++"`).
|
|
61
61
|
*/
|
|
62
|
+
export declare function keyNames(key: string): string[];
|
|
63
|
+
/** Keycap for one key id ({@link keyNames}); the terminal draws platform glyphs. */
|
|
62
64
|
export declare function kbd(key: string, nodeKey?: string): NativeNode;
|
|
@@ -10,9 +10,8 @@
|
|
|
10
10
|
* reference contract as `render()`). A component without `describe` becomes a
|
|
11
11
|
* `rows` fallback node rendered through `render(cx.cols)`.
|
|
12
12
|
*
|
|
13
|
-
* See `packages/wire/src/tsp.ts` for the wire vocabulary
|
|
14
|
-
* the Tern
|
|
15
|
-
* Stencil repository, https://docs.stencil.so/tern/protocol/) for the spec.
|
|
13
|
+
* See `packages/wire/src/tsp.ts` for the wire vocabulary; the normative spec is
|
|
14
|
+
* the Tern Surface Protocol.
|
|
16
15
|
*/
|
|
17
16
|
import type { TspEvent, TspKind, TspProps, TspScrollBy, TspSpan } from "@linxiraos/pi-wire";
|
|
18
17
|
import type { Component } from "../tui.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Overlay chrome for `describe()`: root cards, key-hint footers,
|
|
3
|
-
* lists and annotation callouts.
|
|
2
|
+
* Overlay chrome for `describe()`: root cards, key-hint footers, buttons and
|
|
3
|
+
* segmented controls, selectable lists and annotation callouts.
|
|
4
4
|
*
|
|
5
5
|
* The overlay frame itself (glass, ring, placement) is the terminal's: the
|
|
6
6
|
* engine wraps every overlay-stack component in an `overlay` node. An overlay
|
|
@@ -53,11 +53,23 @@ export interface ActionButtonOptions {
|
|
|
53
53
|
readonly title?: string;
|
|
54
54
|
/** Target of an `open` action (URL or `file://` path). */
|
|
55
55
|
readonly href?: string;
|
|
56
|
+
/** Why the action can't run now: the button dims and a click sends nothing. */
|
|
57
|
+
readonly disabled?: string;
|
|
58
|
+
/** The button's work is running: a spinner leads the label. */
|
|
59
|
+
readonly busy?: boolean;
|
|
60
|
+
/** Icon beside the label (before it on a `button` node, after it on a row). */
|
|
61
|
+
readonly icon?: string;
|
|
56
62
|
}
|
|
57
63
|
/**
|
|
58
64
|
* A native button (role `zeta.btn`): a label plus an optional keycap. A click
|
|
59
65
|
* sends `act` back as an `action` event (or runs a terminal-local `open`/`copy`),
|
|
60
66
|
* which the component routes to the same code path as the key.
|
|
67
|
+
*
|
|
68
|
+
* A terminal that draws the `button` kind ({@link nativeButtons}) gets one
|
|
69
|
+
* (tone `accent` → variant `primary`, `error` → `danger`, `disabled` with its
|
|
70
|
+
* reason as the tooltip); older ones get the row their stylesheets draw by
|
|
71
|
+
* role. Both keep the role and tone the omp sheets' context rules key on; a
|
|
72
|
+
* disabled button's tone is `muted`.
|
|
61
73
|
*/
|
|
62
74
|
export declare function actionButton(label: string, act: string, options?: ActionButtonOptions): NativeNode;
|
|
63
75
|
/**
|
|
@@ -65,6 +77,34 @@ export declare function actionButton(label: string, act: string, options?: Actio
|
|
|
65
77
|
* `act` (default `close`), which the component routes to its Esc path.
|
|
66
78
|
*/
|
|
67
79
|
export declare function escCloseButton(act?: string, key?: string): NativeNode;
|
|
80
|
+
/** Options of an {@link iconButton}. */
|
|
81
|
+
export interface IconButtonOptions {
|
|
82
|
+
/** Sibling identity key; unkeyed buttons take their position. */
|
|
83
|
+
readonly key?: string;
|
|
84
|
+
/** Accessible name; defaults to the title. */
|
|
85
|
+
readonly aria?: string;
|
|
86
|
+
/** A toggle that is on (role `zeta.app.ibtn.set`). */
|
|
87
|
+
readonly on?: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A quiet icon-only button (role `zeta.app.ibtn`, the kit's icon button) for an
|
|
91
|
+
* app head or toolbar: a `button` node where the terminal draws one
|
|
92
|
+
* ({@link nativeButtons}), else an `icon` with a click action.
|
|
93
|
+
*/
|
|
94
|
+
export declare function iconButton(name: string, act: string, title: string, options?: IconButtonOptions): NativeNode;
|
|
95
|
+
/**
|
|
96
|
+
* A quiet text button (role `zeta.app.qbtn`, the kit's quiet button) for a
|
|
97
|
+
* section head or toolbar, keyed by its action: a small quiet `button` where
|
|
98
|
+
* the terminal draws one ({@link nativeButtons}), else a row.
|
|
99
|
+
*/
|
|
100
|
+
export declare function quietButton(label: string, act: string, title: string): NativeNode;
|
|
101
|
+
/**
|
|
102
|
+
* A segmented control: `tabs` drawn as a well with a raised thumb on the
|
|
103
|
+
* active tab. A terminal that draws the `button` kind ({@link nativeButtons})
|
|
104
|
+
* draws `variant: "segmented"` too; older ones restyle the tabs by role
|
|
105
|
+
* (`zeta.app.seg`) or parent.
|
|
106
|
+
*/
|
|
107
|
+
export declare function segmentedTabs(p: TspProps<"tabs">, key: string): NativeNode;
|
|
68
108
|
/** A row of {@link actionButton}s (role `zeta.actions`); `null` entries become the spacer that end-aligns what follows. */
|
|
69
109
|
export declare function actionBar(buttons: readonly (NativeNode | null)[], key?: string): NativeNode;
|
|
70
110
|
/** Spans of an annotation callout: a dim `label:` then the note. */
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
* the item id and `action` with an action id (plus `value` for
|
|
17
17
|
* `scope`/`tab`/`strip`). {@link pickerEvent} folds them into one shape.
|
|
18
18
|
*/
|
|
19
|
-
import type { TspPickerAction, TspPickerItem, TspPickerProps } from "@linxiraos/pi-wire";
|
|
19
|
+
import type { TspPickerAction, TspPickerItem, TspPickerProps, TspProps } from "@linxiraos/pi-wire";
|
|
20
20
|
import type { KeyName } from "../key-hint-format.js";
|
|
21
21
|
import { type Keybinding } from "../keybindings.js";
|
|
22
22
|
import type { Input } from "../components/input.js";
|
|
23
23
|
import type { SelectItem, SelectList } from "../components/select-list.js";
|
|
24
24
|
import type { NativeChild, NativeNode, NativeUiEvent } from "./node.js";
|
|
25
25
|
/** The picker sheet; `preview` children fill its preview pane. */
|
|
26
|
-
export declare function picker(p:
|
|
26
|
+
export declare function picker(p: TspProps<"picker">, preview?: readonly NativeChild[]): NativeNode;
|
|
27
27
|
/**
|
|
28
28
|
* A picker's search field from the {@link Input} that edits it: the text and
|
|
29
29
|
* its caret. `null` hides the field. Memoized pickers MUST key on the caret
|
|
@@ -37,7 +37,7 @@ export declare const PICKER_KEY = "picker";
|
|
|
37
37
|
* the picker as child {@link PICKER_KEY}, which the reconciler hoists into
|
|
38
38
|
* `layer`. Route its events with `pickerEvent(event, PICKER_KEY)`.
|
|
39
39
|
*/
|
|
40
|
-
export declare function dockedPicker(p:
|
|
40
|
+
export declare function dockedPicker(p: TspProps<"picker">, preview?: readonly NativeChild[]): NativeNode;
|
|
41
41
|
/** Keycap names for one key id (`"alt+enter"` → `["alt", "enter"]`, `"escape"` → `["esc"]`). */
|
|
42
42
|
export declare function pickerKeys(key: KeyName | string): string[];
|
|
43
43
|
/** The keycaps of a keybinding's primary key, empty when unbound. */
|
|
@@ -83,7 +83,7 @@ export interface SelectPickerOptions {
|
|
|
83
83
|
readonly subtitle?: string;
|
|
84
84
|
readonly icon?: string;
|
|
85
85
|
readonly noun?: string;
|
|
86
|
-
/** Show
|
|
86
|
+
/** Show Zeta's filter text as the search field (lists that filter as you type). */
|
|
87
87
|
readonly searchable?: boolean;
|
|
88
88
|
/** Per-item extras (a thinking-level dot, a swatch mark, a budget fact). */
|
|
89
89
|
readonly decorate?: (item: SelectItem) => Partial<Omit<TspPickerItem, "id">> | undefined;
|
|
@@ -2,5 +2,9 @@
|
|
|
2
2
|
export declare function isNativeRendering(): boolean;
|
|
3
3
|
/** Called by the native backend on surface open and close. */
|
|
4
4
|
export declare function setNativeRendering(on: boolean): void;
|
|
5
|
+
/** Whether omp's buttons go out as `button` nodes (see {@link setNativeButtons}). */
|
|
6
|
+
export declare function nativeButtons(): boolean;
|
|
7
|
+
/** Called by the native backend when it adopts a `hello` reply and when it stops. */
|
|
8
|
+
export declare function setNativeButtons(on: boolean): void;
|
|
5
9
|
/** Call `listener` whenever native rendering starts or stops; returns the unsubscribe. */
|
|
6
10
|
export declare function onNativeRenderingChange(listener: (on: boolean) => void): () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Focusable, type TUI } from "../index.js";
|
|
2
2
|
import { type KeybindingsManager } from "../app-keybindings.js";
|
|
3
3
|
import { type Theme } from "../theme/theme.js";
|
|
4
|
-
import type { CodeReviewAnnotation, CodeReviewOverlayResult, ReviewDiffFile, TextReviewAnnotation, TextReviewOverlayResult, TextReviewSource } from "./annotation-types.js";
|
|
4
|
+
import type { AnnotationOverlayDraft, CodeReviewAnnotation, CodeReviewOverlayResult, ReviewDiffFile, TextReviewAnnotation, TextReviewOverlayResult, TextReviewSource } from "./annotation-types.js";
|
|
5
5
|
import type { TspSpan } from "@linxiraos/pi-wire";
|
|
6
6
|
import { type NativeNode, type NativeUiEvent } from "../native/node.js";
|
|
7
7
|
export declare const CONTINUE_CODE_REVIEW_ACTION = "Continue with LLM review";
|
|
@@ -20,6 +20,8 @@ export interface CodeReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
|
|
|
20
20
|
export interface TextReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
|
|
21
21
|
onComplete(result: TextReviewOverlayResult | undefined): void;
|
|
22
22
|
}
|
|
23
|
+
/** Clears every note and closes; the host then has nothing to keep. Needs a second confirm. */
|
|
24
|
+
export declare const DISCARD_ANNOTATIONS_ACTION = "Discard notes and close";
|
|
23
25
|
/** Splits a text source into the overlay's 1-based annotatable lines. */
|
|
24
26
|
export declare function splitTextLines(text: string): string[];
|
|
25
27
|
/** The native sheet: full-pane glass, titled by the review kind with what is under review after it. */
|
|
@@ -38,6 +40,10 @@ export declare class AnnotationOverlay implements Focusable {
|
|
|
38
40
|
setUseTerminalCursor(useTerminalCursor: boolean): void;
|
|
39
41
|
invalidate(): void;
|
|
40
42
|
dispose(): void;
|
|
43
|
+
/** Notes, the unfinished note, and any source edit, in the form {@link restoreDraft} replays. */
|
|
44
|
+
getDraft(): AnnotationOverlayDraft;
|
|
45
|
+
/** Replay a draft taken from this same source; anything anchored outside it is dropped. */
|
|
46
|
+
restoreDraft(draft: AnnotationOverlayDraft): void;
|
|
41
47
|
getAnnotations(): CodeReviewAnnotation[];
|
|
42
48
|
getTextAnnotations(): TextReviewAnnotation[];
|
|
43
49
|
/** Repo-relative path of the diff file under the cursor, if this is a code review. */
|
|
@@ -84,3 +84,31 @@ export interface TextReviewOverlayResult {
|
|
|
84
84
|
/** Source text after an external-editor edit; absent when the source was not edited. */
|
|
85
85
|
editedText?: string;
|
|
86
86
|
}
|
|
87
|
+
export type AnnotationOverlayDraft = {
|
|
88
|
+
kind: "diff";
|
|
89
|
+
annotations: {
|
|
90
|
+
fileIndex: number;
|
|
91
|
+
sourceIndex: number;
|
|
92
|
+
annotation: CodeReviewAnnotation;
|
|
93
|
+
}[];
|
|
94
|
+
editor?: {
|
|
95
|
+
fileIndex: number;
|
|
96
|
+
sourceIndex: number;
|
|
97
|
+
scope: "file" | "line";
|
|
98
|
+
editingAnnotationIndex?: number;
|
|
99
|
+
text: string;
|
|
100
|
+
};
|
|
101
|
+
} | {
|
|
102
|
+
kind: "text";
|
|
103
|
+
annotations: {
|
|
104
|
+
sourceIndex: number;
|
|
105
|
+
annotation: TextReviewAnnotation;
|
|
106
|
+
}[];
|
|
107
|
+
editedText?: string;
|
|
108
|
+
editor?: {
|
|
109
|
+
sourceIndex: number;
|
|
110
|
+
scope: "text" | "line";
|
|
111
|
+
editingAnnotationIndex?: number;
|
|
112
|
+
text: string;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ImageContent } from "@linxiraos/pi-ai";
|
|
2
2
|
import { type Component, type Focusable, Input } from "../index.js";
|
|
3
3
|
import { type BtwHistoryRecord } from "./btw-history.js";
|
|
4
|
+
import { type BtwInjectState } from "./btw-inject.js";
|
|
4
5
|
import type { SpaceHoldHandler } from "../space-hold.js";
|
|
5
6
|
import { type KeyId } from "../app-keybindings.js";
|
|
6
7
|
import type { NativeNode, NativeUiEvent } from "../native/node.js";
|
|
@@ -26,6 +27,18 @@ interface BtwHistoryPanelOptions {
|
|
|
26
27
|
* first. For a host with no inline panel to fall back to (Tern).
|
|
27
28
|
*/
|
|
28
29
|
escapeHides?: boolean;
|
|
30
|
+
/** `btw.inject` hooks, given only while it is on for this view. */
|
|
31
|
+
inject?: BtwHistoryInject;
|
|
32
|
+
}
|
|
33
|
+
interface BtwHistoryInject {
|
|
34
|
+
/**
|
|
35
|
+
* How a finished turn's closed `<inject>` block shows: apart from its prose while pending or
|
|
36
|
+
* sent, plain text when `undefined`. A streaming turn always shows its block.
|
|
37
|
+
*/
|
|
38
|
+
state: (record: BtwHistoryRecord, turnIndex: number) => BtwInjectState | undefined;
|
|
39
|
+
/** Whether the inject key may send the record's latest block now. */
|
|
40
|
+
canSend: (record: BtwHistoryRecord) => boolean;
|
|
41
|
+
send: (record: BtwHistoryRecord) => void;
|
|
29
42
|
}
|
|
30
43
|
/** Session-local side questions. Selecting or copying never promotes them into chat. */
|
|
31
44
|
export declare class BtwHistoryPanel implements Component, Focusable {
|
|
@@ -33,6 +46,8 @@ export declare class BtwHistoryPanel implements Component, Focusable {
|
|
|
33
46
|
constructor(options: BtwHistoryPanelOptions);
|
|
34
47
|
get focused(): boolean;
|
|
35
48
|
set focused(value: boolean);
|
|
49
|
+
/** Keep the follow-up input's cursor mode aligned so the hardware cursor (and IME preedit) lands on its caret. */
|
|
50
|
+
setUseTerminalCursor(useTerminalCursor: boolean): void;
|
|
36
51
|
update(records: readonly BtwHistoryRecord[]): void;
|
|
37
52
|
/** Visual confirmation that `c` copied this record's answer to the clipboard. */
|
|
38
53
|
markCopied(recordId: string, text: string): void;
|
|
@@ -20,5 +20,29 @@ export interface BtwHistoryRecord extends BtwHistoryTurn {
|
|
|
20
20
|
export declare function getBtwTopicLabel(record: BtwHistoryRecord): string;
|
|
21
21
|
export declare function getBtwLatestTurn(record: BtwHistoryRecord): BtwHistoryTurn;
|
|
22
22
|
export declare function getBtwTurns(record: BtwHistoryRecord): readonly BtwHistoryTurn[];
|
|
23
|
+
/** Identifies one turn of a topic, its latest by default: a follow-up gets a new key, so per-answer marks reset. */
|
|
24
|
+
export declare function getBtwTurnKey(record: BtwHistoryRecord, turnIndex?: number): string;
|
|
23
25
|
/** Copy the most recent nonblank answer, preserving its original whitespace. */
|
|
24
26
|
export declare function getBtwCopyText(record: BtwHistoryRecord): string | undefined;
|
|
27
|
+
/** An answer around its `<inject>` block: the steering prompt a side answer drafted for the main session. */
|
|
28
|
+
export interface BtwInjectParts {
|
|
29
|
+
before: string;
|
|
30
|
+
inject: string;
|
|
31
|
+
after: string;
|
|
32
|
+
/** False while no opener has a close: the block may still be streaming, so it runs to the end. */
|
|
33
|
+
closed: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Split an answer at its last closed `<inject>` block: the last opener that has a close
|
|
37
|
+
* after it, paired with the first close after it. A tag merely mentioned in prose,
|
|
38
|
+
* before or after the block, cannot capture it. Without a closed block, the last opener
|
|
39
|
+
* runs to the end (`closed: false`); display it only while the answer still streams.
|
|
40
|
+
* Linear: the last opener before the last close is the last one with any close after it.
|
|
41
|
+
*/
|
|
42
|
+
export declare function splitBtwInject(answer: string): BtwInjectParts | undefined;
|
|
43
|
+
/** A block's text as shown and as sent: control sequences stripped, tabs expanded, trimmed. */
|
|
44
|
+
export declare function formatBtwInjectText(inject: string): string;
|
|
45
|
+
/** The steering prompt to send, exactly as the block shows it; undefined while unclosed or blank. */
|
|
46
|
+
export declare function getBtwInject(answer: string): string | undefined;
|
|
47
|
+
/** A topic's steering prompt: only its latest turn's, once that turn completed. */
|
|
48
|
+
export declare function getBtwRecordInject(record: BtwHistoryRecord): string | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Component } from "../index.js";
|
|
2
|
+
import type { NativeNode } from "../native/node.js";
|
|
3
|
+
import { type BtwInjectParts } from "./btw-history.js";
|
|
4
|
+
/** Labels a steering prompt that has not been sent yet. */
|
|
5
|
+
export declare const BTW_INJECT_LABEL = "Inject into main session";
|
|
6
|
+
/** Labels a sent steering prompt. */
|
|
7
|
+
export declare const BTW_INJECTED_LABEL = "Injected into main session";
|
|
8
|
+
/** A displayed `<inject>` block: still sendable, or sent. Blocks in neither state render as plain text. */
|
|
9
|
+
export type BtwInjectState = "pending" | "sent";
|
|
10
|
+
/** Text-mode answer split around its `<inject>` block: prose, the railed block, prose, a blank row apart. */
|
|
11
|
+
export declare class BtwInjectAnswer implements Component {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(parts: BtwInjectParts, sent: boolean);
|
|
14
|
+
render(width: number): string[];
|
|
15
|
+
invalidate(): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The same answer for native surfaces. They wrap text themselves, so a per-row gutter cannot
|
|
19
|
+
* follow wrapped lines: a card toned like the rail (`user` pending, `success` sent) marks the
|
|
20
|
+
* whole block instead, with the label as its last row.
|
|
21
|
+
*/
|
|
22
|
+
export declare function describeBtwInjectAnswer(parts: BtwInjectParts, sent: boolean, stream: boolean): NativeNode;
|
|
@@ -8,6 +8,11 @@ interface BtwPanelComponentOptions {
|
|
|
8
8
|
tui: TUI;
|
|
9
9
|
canBranch?: () => boolean;
|
|
10
10
|
canFollowUp?: () => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Given only while `btw.inject` is on: the answer's `<inject>` block shows apart from its
|
|
13
|
+
* prose, and the inject key (`app.btw.inject`) is offered while this returns true.
|
|
14
|
+
*/
|
|
15
|
+
canInject?: () => boolean;
|
|
11
16
|
}
|
|
12
17
|
export declare class BtwPanelComponent extends OverlayPanel {
|
|
13
18
|
#private;
|
|
@@ -17,6 +22,8 @@ export declare class BtwPanelComponent extends OverlayPanel {
|
|
|
17
22
|
markComplete(): void;
|
|
18
23
|
/** Visual confirmation that `c` copied the answer to the clipboard. */
|
|
19
24
|
markCopied(): void;
|
|
25
|
+
/** Shows the answer's steering prompt as sent (send arrows, green), or back to pending when a send failed. */
|
|
26
|
+
setInjected(injected: boolean): void;
|
|
20
27
|
/** Shows that the completed answer is being promoted into the chat session. */
|
|
21
28
|
markBranching(): void;
|
|
22
29
|
markAborted(): void;
|
|
@@ -85,4 +85,6 @@ export declare class HookEditorComponent extends OverlayPanel implements Focusab
|
|
|
85
85
|
* enhanced-paste routing falls back to the main prompt editor hidden behind the
|
|
86
86
|
* dialog (#2127 routing contract). */
|
|
87
87
|
pasteText(text: string): void;
|
|
88
|
+
/** Replace the draft, as Ctrl+R history search does for the main composer. */
|
|
89
|
+
setText(text: string): void;
|
|
88
90
|
}
|
|
@@ -8,6 +8,10 @@ export interface JobsPanelJob {
|
|
|
8
8
|
readonly type: string;
|
|
9
9
|
readonly status: "running" | "completed" | "failed" | "cancelled";
|
|
10
10
|
readonly label: string;
|
|
11
|
+
/** What the job is for, in the model's words; rows and the detail lead with it over a command `label`. */
|
|
12
|
+
readonly intent?: string;
|
|
13
|
+
/** One line on what a command does and when it ends, from the cheap model; the detail shows it under the intent. */
|
|
14
|
+
readonly caption?: string;
|
|
11
15
|
readonly startTime: number;
|
|
12
16
|
readonly endTime?: number;
|
|
13
17
|
/** Registry id of the agent that owns the job. */
|
|
@@ -7,7 +7,11 @@ import type { NativeNode, NativeUiEvent } from "../native/node.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class LoginDialogComponent extends OverlayPanel {
|
|
9
9
|
#private;
|
|
10
|
-
constructor(tui: TUI, providerId: string, onComplete: (success: boolean, message?: string) => void, openUrl: (url: string) => void);
|
|
10
|
+
constructor(tui: Pick<TUI, "requestRender">, providerId: string, onComplete: (success: boolean, message?: string) => void, openUrl: (url: string) => void);
|
|
11
|
+
/** Focus reaches the live field: it draws the caret (the hardware cursor when the terminal's is on). */
|
|
12
|
+
get focused(): boolean;
|
|
13
|
+
set focused(value: boolean);
|
|
14
|
+
setUseTerminalCursor(useTerminalCursor: boolean): void;
|
|
11
15
|
get signal(): AbortSignal;
|
|
12
16
|
/**
|
|
13
17
|
* Called by the OAuth `onAuth` callback. Renders the full authorization URL
|
|
@@ -4,10 +4,10 @@ import type { Component } from "../tui.js";
|
|
|
4
4
|
import type { SgrMouseEvent } from "../mouse.js";
|
|
5
5
|
import { type ConfiguredThinkingLevel } from "../thinking.js";
|
|
6
6
|
import { type ThemeColor } from "../theme/theme.js";
|
|
7
|
-
import type { TspPickerColumn, TspPickerGroup, TspPickerItem, TspPickerMark } from "@linxiraos/pi-wire";
|
|
7
|
+
import type { TspPickerColumn, TspPickerGroup, TspPickerItem, TspPickerMark, TspPickerProps } from "@linxiraos/pi-wire";
|
|
8
8
|
import type { NativeChild, NativeNode, NativeUiEvent } from "../native/node.js";
|
|
9
9
|
/** Canonical display ordering of built-in model roles. */
|
|
10
|
-
export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "commit" | "tiny" | "memory" | "task" | "advisor" | "widget" | "image" | "web" | "speech" | "dictation" | "judge";
|
|
10
|
+
export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "commit" | "tiny" | "memory" | "task" | "advisor" | "widget" | "image" | "web" | "speech" | "dictation" | "judge" | "taste";
|
|
11
11
|
export declare const MODEL_ROLE_IDS: ModelRole[];
|
|
12
12
|
export declare const CHAT_MODEL_ROLE_IDS: ModelRole[];
|
|
13
13
|
export declare const KIND_ROLE_IDS: ModelRole[];
|
|
@@ -232,6 +232,8 @@ export interface ModelPickerCatalogue {
|
|
|
232
232
|
readonly itemsAdd?: readonly TspPickerItem[];
|
|
233
233
|
readonly itemsDel?: readonly string[];
|
|
234
234
|
}
|
|
235
|
+
/** The search, fact-column and row props every model `picker` sheet sends ({@link ModelBrowser.pickerRows}). */
|
|
236
|
+
export type ModelPickerRows = Pick<TspPickerProps, "query" | "cursor" | "columns" | "items" | "itemsAdd" | "itemsDel" | "order" | "hits" | "selected" | "current" | "total">;
|
|
235
237
|
/** How {@link ModelBrowser.pickerOrder} heads its rows. */
|
|
236
238
|
export interface ModelPickerGrouping {
|
|
237
239
|
/** One group per provider after the Recent block (the unfiltered All models view). */
|
|
@@ -329,6 +331,13 @@ export declare class ModelBrowser implements Component {
|
|
|
329
331
|
get baseCount(): number;
|
|
330
332
|
/** The selected row's selector, null when nothing selectable is selected. */
|
|
331
333
|
get pickerSelected(): string | null;
|
|
334
|
+
/**
|
|
335
|
+
* A model picker's search field, fact columns and rows: `catalogue` (from
|
|
336
|
+
* {@link pickerItems}) in `view` order (from {@link pickerOrder}), the
|
|
337
|
+
* selection, and `current` checked. Memoize hosts on its inputs plus
|
|
338
|
+
* {@link query}, {@link cursor} and {@link pickerSelected}.
|
|
339
|
+
*/
|
|
340
|
+
pickerRows(catalogue: ModelPickerCatalogue, view: ModelPickerOrder, current: string | undefined): ModelPickerRows;
|
|
332
341
|
/**
|
|
333
342
|
* Picker rows for `catalogue`: the same object while the catalogue, roles
|
|
334
343
|
* and row inputs are unchanged, so typing and scope hops never resend it.
|
|
@@ -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
|
|
@@ -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. */
|
|
@@ -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,11 +140,28 @@ 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;
|
|
152
|
+
/**
|
|
153
|
+
* Complete folder listing when the constructor's `sessions` are a preliminary
|
|
154
|
+
* subset; replaces them once it settles.
|
|
155
|
+
*/
|
|
156
|
+
completeSessions?: Promise<T[]>;
|
|
132
157
|
/** Loads sessions across all projects for the all-projects scope toggle (Tab). */
|
|
133
|
-
loadAllSessions?: () => Promise<T[]
|
|
158
|
+
loadAllSessions?: () => Promise<T[] | {
|
|
159
|
+
sessions: T[];
|
|
160
|
+
}>;
|
|
134
161
|
/** Preloaded all-projects list; cached so the first Tab toggle is instant. */
|
|
135
|
-
allSessions?: T[]
|
|
162
|
+
allSessions?: T[] | {
|
|
163
|
+
sessions: T[];
|
|
164
|
+
};
|
|
136
165
|
/**
|
|
137
166
|
* The host's resume model (project → workspace → conversation) and its
|
|
138
167
|
* pure view builder. When set, the native `picker` describes the resume
|
|
@@ -205,8 +234,8 @@ export declare class SessionSelectorComponent<T extends SessionSelectorEntry = S
|
|
|
205
234
|
/**
|
|
206
235
|
* With the `picker` kind: the data-first session picker (§4.7). Otherwise
|
|
207
236
|
* 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.
|
|
237
|
+
* `list` — or the delete-confirmation / rename dialog in their place, as on
|
|
238
|
+
* the ANSI path — and the key-hint footer.
|
|
210
239
|
*/
|
|
211
240
|
describe(cx: DescribeContext): NativeNode;
|
|
212
241
|
/** Picker events (root keypath); fallback: scope tab → toggle scope, click on a session → resume it, exactly like a mouse click. */
|