@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
package/src/components/editor.ts
CHANGED
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
export type { EditorBorderStyle, EditorTopBorder };
|
|
72
72
|
|
|
73
73
|
import { type SelectItem, SelectList, type SelectListLayoutOptions, type SelectListTheme } from "./select-list";
|
|
74
|
+
import { editorKey } from "../chrome/keybinding-hints";
|
|
74
75
|
|
|
75
76
|
/** The TSP root an {@link Editor.describeLayout} hook builds around the `editor` node. */
|
|
76
77
|
export interface NativeEditorLayout {
|
|
@@ -776,6 +777,14 @@ export class Editor implements Component, Focusable {
|
|
|
776
777
|
describeDecorations: ((lines: readonly string[]) => readonly TspEditorDecoration[]) | undefined;
|
|
777
778
|
/** TSP code language of the buffer (`python`, `bash`): the terminal highlights it in the mono face. */
|
|
778
779
|
describeLanguage: (() => string | undefined) | undefined;
|
|
780
|
+
/** Label the TSP field to disable host-side editing while another input owner handles raw keys. */
|
|
781
|
+
nativeKeyPassthrough = false;
|
|
782
|
+
/**
|
|
783
|
+
* Ask the TSP terminal to keep what is typed into this field and draw it at
|
|
784
|
+
* the caret until this clears, then send it: set while startup cannot read
|
|
785
|
+
* input yet (the prompt composer's deferred-input start).
|
|
786
|
+
*/
|
|
787
|
+
nativeTypeahead = false;
|
|
779
788
|
/**
|
|
780
789
|
* TSP chrome around the `editor` node (the prompt composer's chips, mode
|
|
781
790
|
* chip, send/stop): the root role, the children with `input` placed where
|
|
@@ -858,9 +867,19 @@ export class Editor implements Component, Focusable {
|
|
|
858
867
|
#autocompleteList?: SelectList;
|
|
859
868
|
#autocompleteState: "regular" | "force" | "assist" | null = null;
|
|
860
869
|
#textAssistReplacement:
|
|
861
|
-
| {
|
|
870
|
+
| {
|
|
871
|
+
line: number;
|
|
872
|
+
startCol: number;
|
|
873
|
+
endCol: number;
|
|
874
|
+
original: string;
|
|
875
|
+
cursorOffset: number;
|
|
876
|
+
/** The list offers {@link predictions} for the whole line rather than spelling replacements. */
|
|
877
|
+
prediction?: boolean;
|
|
878
|
+
}
|
|
862
879
|
| undefined;
|
|
863
880
|
#autocompletePrefix: string = "";
|
|
881
|
+
/** The line a prediction insert (Tab, Right, or the alternatives list) left in the buffer; any later edit clears it. */
|
|
882
|
+
#insertedPrediction: string | undefined;
|
|
864
883
|
/** False while the popup's untouched top row is a description-only slash hit ({@link AutocompleteItem.descriptionMatch}): Enter then submits the typed text. */
|
|
865
884
|
#enterAcceptsSelection = true;
|
|
866
885
|
#autocompleteRequestId: number = 0;
|
|
@@ -937,12 +956,21 @@ export class Editor implements Component, Focusable {
|
|
|
937
956
|
* cursor. The host styles it (ANSI allowed). Re-evaluated on every render, so hosts can derive
|
|
938
957
|
* it from live state. */
|
|
939
958
|
placeholder?: () => string | undefined;
|
|
940
|
-
/** Whole-message
|
|
941
|
-
*
|
|
942
|
-
* autocomplete is open. A shown prediction replaces the {@link placeholder}; Tab or
|
|
943
|
-
* the rest without submitting.
|
|
944
|
-
*
|
|
945
|
-
|
|
959
|
+
/** Whole-message predictions for the next prompt, most likely first. The first one the single-line
|
|
960
|
+
* buffer is a strict prefix of is painted as ghost text after the cursor while the cursor sits at
|
|
961
|
+
* its end and no autocomplete is open. A shown prediction replaces the {@link placeholder}; Tab or
|
|
962
|
+
* Right inserts the rest without submitting. A buffer the user typed keeps the ghost even when it
|
|
963
|
+
* equals a shorter prediction; once Tab, Right, or the list has inserted one of two or more
|
|
964
|
+
* predictions, no ghost extends it to a longer one, and Tab instead opens a list of all of them
|
|
965
|
+
* that swaps the whole line, also without submitting. Each must be a single line. Re-evaluated on
|
|
966
|
+
* every render, so hosts can derive them from live state. */
|
|
967
|
+
predictions?: () => readonly string[] | undefined;
|
|
968
|
+
/** Called with the prediction's index in {@link predictions} after Tab or Right inserts the rest of
|
|
969
|
+
* a shown prediction, or the alternatives list swaps a different one into the buffer. */
|
|
970
|
+
onPredictionAccepted?: (index: number) => void;
|
|
971
|
+
/** Called for each frame that paints a prediction as ghost text: a terminal frame that draws at
|
|
972
|
+
* least one cell of it, or a native frame that carries it as the editor's ghost. */
|
|
973
|
+
onPredictionShown?: () => void;
|
|
946
974
|
|
|
947
975
|
// Custom top border (for status line integration). Either an eager `content`
|
|
948
976
|
// (set once, reused every frame) or a `provider` that recomputes lazily just
|
|
@@ -1591,6 +1619,10 @@ export class Editor implements Component, Focusable {
|
|
|
1591
1619
|
// against the cursor, or the placeholder flush right.
|
|
1592
1620
|
const placeholder = this.#getPlaceholder();
|
|
1593
1621
|
const inlineHint = placeholder ? null : this.#getInlineHint();
|
|
1622
|
+
// Whether the hint is the prediction, and how many of its cells this frame draws: a full row,
|
|
1623
|
+
// an unfocused hardware-cursor row, or the IME-safe layout can leave it unpainted.
|
|
1624
|
+
const hintIsPrediction = inlineHint !== null && inlineHint === this.#getPredictionSuffix();
|
|
1625
|
+
let hintCellsPainted = 0;
|
|
1594
1626
|
const hintStyle = this.#theme.hintStyle ?? ((t: string) => `\x1b[2m${t}\x1b[0m`);
|
|
1595
1627
|
const hintTail = (avail: number): { text: string; width: number } | undefined => {
|
|
1596
1628
|
if (placeholder) {
|
|
@@ -1705,6 +1737,7 @@ export class Editor implements Component, Focusable {
|
|
|
1705
1737
|
} else if (tail) {
|
|
1706
1738
|
displayText = before + marker + tail.text;
|
|
1707
1739
|
displayWidth += tail.width;
|
|
1740
|
+
hintCellsPainted += tail.width;
|
|
1708
1741
|
} else if (after.length === 0 && !isSideBordered && displayWidth >= lineContentWidth) {
|
|
1709
1742
|
displayText = this.#renderTerminalCursorMarker(before, marker, lineContentWidth);
|
|
1710
1743
|
} else {
|
|
@@ -1751,6 +1784,7 @@ export class Editor implements Component, Focusable {
|
|
|
1751
1784
|
const tail = hintTail(Math.max(0, lineContentWidth - displayWidth - overrideWidth));
|
|
1752
1785
|
displayText = before + marker + this.cursorOverride + (tail?.text ?? "");
|
|
1753
1786
|
displayWidth += overrideWidth + (tail?.width ?? 0);
|
|
1787
|
+
hintCellsPainted += tail?.width ?? 0;
|
|
1754
1788
|
}
|
|
1755
1789
|
} else {
|
|
1756
1790
|
// Cursor is at the end - add thin cursor glyph
|
|
@@ -1765,6 +1799,7 @@ export class Editor implements Component, Focusable {
|
|
|
1765
1799
|
const tail = hintTail(Math.max(0, lineContentWidth - displayWidth - cursorWidth));
|
|
1766
1800
|
displayText = before + marker + cursor + (tail?.text ?? "");
|
|
1767
1801
|
displayWidth += cursorWidth + (tail?.width ?? 0);
|
|
1802
|
+
hintCellsPainted += tail?.width ?? 0;
|
|
1768
1803
|
}
|
|
1769
1804
|
if (displayWidth > lineContentWidth && paddingX > 0) {
|
|
1770
1805
|
cursorPaddingOverflow = displayWidth - lineContentWidth;
|
|
@@ -1807,6 +1842,7 @@ export class Editor implements Component, Focusable {
|
|
|
1807
1842
|
}),
|
|
1808
1843
|
);
|
|
1809
1844
|
}
|
|
1845
|
+
if (hintIsPrediction && hintCellsPainted > 0) this.onPredictionShown?.();
|
|
1810
1846
|
|
|
1811
1847
|
const bottomRow = style.renderBottom(chromeCtx);
|
|
1812
1848
|
if (bottomRow !== undefined) result.push(bottomRow);
|
|
@@ -1871,6 +1907,7 @@ export class Editor implements Component, Focusable {
|
|
|
1871
1907
|
: placeholder && plainText(placeholder).trim();
|
|
1872
1908
|
const atLineEnd = cursorCol >= (lines[cursorLine]?.length ?? 0);
|
|
1873
1909
|
const ghost = nativePlaceholder || !atLineEnd ? null : this.#getInlineHint();
|
|
1910
|
+
if (ghost && ghost === this.#getPredictionSuffix()) this.onPredictionShown?.();
|
|
1874
1911
|
const vim = this.#vim;
|
|
1875
1912
|
let anchor: number | null = null;
|
|
1876
1913
|
if (vim?.visual && vim.anchor !== null) {
|
|
@@ -1894,9 +1931,10 @@ export class Editor implements Component, Focusable {
|
|
|
1894
1931
|
decor: decor.decor,
|
|
1895
1932
|
ghost: ghost ? plainText(ghost) : undefined,
|
|
1896
1933
|
placeholder: nativePlaceholder || undefined,
|
|
1897
|
-
mode: vim ? VIM_MODE_LABELS[vim.mode] : undefined,
|
|
1934
|
+
mode: this.nativeKeyPassthrough ? "PTY" : vim ? VIM_MODE_LABELS[vim.mode] : undefined,
|
|
1898
1935
|
lang: this.describeLanguage?.(),
|
|
1899
1936
|
maxLines: this.#maxHeight,
|
|
1937
|
+
typeahead: this.nativeTypeahead || undefined,
|
|
1900
1938
|
};
|
|
1901
1939
|
let editor = this.#nativeEditor;
|
|
1902
1940
|
if (!editor || !sameProps(editor.props, props)) {
|
|
@@ -2126,7 +2164,7 @@ export class Editor implements Component, Focusable {
|
|
|
2126
2164
|
kb.matchesCanonical(canonical, "tui.input.tab") ||
|
|
2127
2165
|
rightArrowAccepts)
|
|
2128
2166
|
) {
|
|
2129
|
-
this.#
|
|
2167
|
+
this.#applyAssistReplacement();
|
|
2130
2168
|
return;
|
|
2131
2169
|
}
|
|
2132
2170
|
// Let the autocomplete list handle navigation and selection
|
|
@@ -3256,6 +3294,7 @@ export class Editor implements Component, Focusable {
|
|
|
3256
3294
|
|
|
3257
3295
|
#notifyChange(text?: string): void {
|
|
3258
3296
|
this.#textRevision++;
|
|
3297
|
+
this.#insertedPrediction = undefined;
|
|
3259
3298
|
this.onChange?.(text ?? this.getText());
|
|
3260
3299
|
}
|
|
3261
3300
|
|
|
@@ -5073,7 +5112,7 @@ export class Editor implements Component, Focusable {
|
|
|
5073
5112
|
// A pointer pick on the popup (TSP `select`/`activate`) accepts it like Tab.
|
|
5074
5113
|
list.onSelect = item => {
|
|
5075
5114
|
if (this.#autocompleteList !== list) return;
|
|
5076
|
-
if (this.#autocompleteState === "assist") this.#
|
|
5115
|
+
if (this.#autocompleteState === "assist") this.#applyAssistReplacement();
|
|
5077
5116
|
else this.#acceptAutocompleteSelection(item);
|
|
5078
5117
|
};
|
|
5079
5118
|
return list;
|
|
@@ -5081,6 +5120,7 @@ export class Editor implements Component, Focusable {
|
|
|
5081
5120
|
|
|
5082
5121
|
async #handleTabCompletion(): Promise<void> {
|
|
5083
5122
|
if (this.#acceptPrediction()) return;
|
|
5123
|
+
if (this.#showPredictionAlternatives()) return;
|
|
5084
5124
|
if (this.#acceptWordCompletion({ space: true })) return;
|
|
5085
5125
|
if (!this.#autocompleteProvider) return;
|
|
5086
5126
|
|
|
@@ -5118,11 +5158,37 @@ export class Editor implements Component, Focusable {
|
|
|
5118
5158
|
if (space) this.#lastAction = "accept-word";
|
|
5119
5159
|
return true;
|
|
5120
5160
|
}
|
|
5121
|
-
/** Insert the rest of the shown
|
|
5161
|
+
/** Insert the rest of the shown prediction, if any. Never submits. */
|
|
5122
5162
|
#acceptPrediction(): boolean {
|
|
5123
|
-
const
|
|
5124
|
-
if (!
|
|
5125
|
-
this.#insertTextAtCursor(suffix);
|
|
5163
|
+
const shown = this.#getShownPrediction();
|
|
5164
|
+
if (!shown) return false;
|
|
5165
|
+
this.#insertTextAtCursor(shown.suffix);
|
|
5166
|
+
this.#insertedPrediction = this.#state.lines[0];
|
|
5167
|
+
this.onPredictionAccepted?.(shown.index);
|
|
5168
|
+
return true;
|
|
5169
|
+
}
|
|
5170
|
+
|
|
5171
|
+
/** Open the list of every prediction over a buffer that equals one of them, that one selected. */
|
|
5172
|
+
#showPredictionAlternatives(): boolean {
|
|
5173
|
+
const alternatives = this.#getPredictionAlternatives();
|
|
5174
|
+
if (!alternatives) return false;
|
|
5175
|
+
const original = this.#state.lines[0] ?? "";
|
|
5176
|
+
this.#autocompletePrefix = original;
|
|
5177
|
+
this.#autocompleteList = this.#createAutocompleteList(
|
|
5178
|
+
"",
|
|
5179
|
+
alternatives.choices.map(value => ({ value, label: value })),
|
|
5180
|
+
);
|
|
5181
|
+
this.#autocompleteList.setSelectedIndex(alternatives.index);
|
|
5182
|
+
this.#autocompleteState = "assist";
|
|
5183
|
+
this.#textAssistReplacement = {
|
|
5184
|
+
line: 0,
|
|
5185
|
+
startCol: 0,
|
|
5186
|
+
endCol: original.length,
|
|
5187
|
+
original,
|
|
5188
|
+
cursorOffset: 0,
|
|
5189
|
+
prediction: true,
|
|
5190
|
+
};
|
|
5191
|
+
this.onAutocompleteUpdate?.();
|
|
5126
5192
|
return true;
|
|
5127
5193
|
}
|
|
5128
5194
|
|
|
@@ -5165,7 +5231,7 @@ export class Editor implements Component, Focusable {
|
|
|
5165
5231
|
this.onAutocompleteUpdate?.();
|
|
5166
5232
|
}
|
|
5167
5233
|
|
|
5168
|
-
#
|
|
5234
|
+
#applyAssistReplacement(): void {
|
|
5169
5235
|
const replacement = this.#textAssistReplacement;
|
|
5170
5236
|
const selected = this.#autocompleteList?.getSelectedItem();
|
|
5171
5237
|
if (!replacement || !selected) {
|
|
@@ -5173,8 +5239,13 @@ export class Editor implements Component, Focusable {
|
|
|
5173
5239
|
return;
|
|
5174
5240
|
}
|
|
5175
5241
|
const line = this.#state.lines[replacement.line] ?? "";
|
|
5176
|
-
|
|
5242
|
+
// A mismatch means the list went stale; picking the prediction already in the buffer changes nothing.
|
|
5243
|
+
if (
|
|
5244
|
+
line.slice(replacement.startCol, replacement.endCol) !== replacement.original ||
|
|
5245
|
+
(replacement.prediction && selected.value === replacement.original)
|
|
5246
|
+
) {
|
|
5177
5247
|
this.#cancelAutocomplete();
|
|
5248
|
+
this.onAutocompleteUpdate?.();
|
|
5178
5249
|
return;
|
|
5179
5250
|
}
|
|
5180
5251
|
this.#recordUndoState();
|
|
@@ -5186,6 +5257,11 @@ export class Editor implements Component, Focusable {
|
|
|
5186
5257
|
this.#cancelAutocomplete();
|
|
5187
5258
|
this.onAutocompleteUpdate?.();
|
|
5188
5259
|
this.#notifyChange();
|
|
5260
|
+
if (replacement.prediction) {
|
|
5261
|
+
this.#insertedPrediction = selected.value;
|
|
5262
|
+
const index = this.predictions?.()?.indexOf(selected.value) ?? -1;
|
|
5263
|
+
if (index >= 0) this.onPredictionAccepted?.(index);
|
|
5264
|
+
}
|
|
5189
5265
|
}
|
|
5190
5266
|
async #handleSlashCommandCompletion(): Promise<void> {
|
|
5191
5267
|
await this.#tryTriggerAutocomplete();
|
|
@@ -5391,7 +5467,8 @@ export class Editor implements Component, Focusable {
|
|
|
5391
5467
|
|
|
5392
5468
|
/**
|
|
5393
5469
|
* Get inline hint text to show as dim ghost text after the cursor.
|
|
5394
|
-
* Checks the selected autocomplete item's hint first, then the prediction
|
|
5470
|
+
* Checks the selected autocomplete item's hint first, then the prediction and its alternatives,
|
|
5471
|
+
* then the provider.
|
|
5395
5472
|
*/
|
|
5396
5473
|
#getInlineHint(): string | null {
|
|
5397
5474
|
// Check selected autocomplete item for a hint
|
|
@@ -5402,7 +5479,12 @@ export class Editor implements Component, Focusable {
|
|
|
5402
5479
|
|
|
5403
5480
|
const prediction = this.#getPredictionSuffix();
|
|
5404
5481
|
if (prediction) return prediction;
|
|
5405
|
-
|
|
5482
|
+
const alternatives = this.#getPredictionAlternatives();
|
|
5483
|
+
if (alternatives) {
|
|
5484
|
+
// Tab opens the alternatives list from here; without a bound key there is nothing to hint.
|
|
5485
|
+
const tab = editorKey("tui.input.tab");
|
|
5486
|
+
if (tab) return ` ${tab} ${alternatives.choices.length - 1} more`;
|
|
5487
|
+
}
|
|
5406
5488
|
// Fall back to provider's getInlineHint
|
|
5407
5489
|
if (this.#autocompleteProvider?.getInlineHint) {
|
|
5408
5490
|
const hint = this.#autocompleteProvider.getInlineHint(
|
|
@@ -5419,18 +5501,44 @@ export class Editor implements Component, Focusable {
|
|
|
5419
5501
|
if (this.#autocompleteState || !this.#isEditorEmpty() || this.#getPredictionSuffix()) return undefined;
|
|
5420
5502
|
return this.placeholder?.() || undefined;
|
|
5421
5503
|
}
|
|
5422
|
-
/** The part of
|
|
5504
|
+
/** The part of the shown prediction not yet typed, or `null` when no prediction is shown. */
|
|
5423
5505
|
#getPredictionSuffix(): string | null {
|
|
5506
|
+
return this.#getShownPrediction()?.suffix ?? null;
|
|
5507
|
+
}
|
|
5508
|
+
/**
|
|
5509
|
+
* The prediction painted as ghost text: the first one the single-line buffer is a strict prefix of,
|
|
5510
|
+
* with the cursor at its end and no autocomplete open. None while the buffer is a prediction insert
|
|
5511
|
+
* that equals one of two or more predictions, so Tab opens their list rather than extending to a
|
|
5512
|
+
* longer one; a buffer the user typed keeps its ghost.
|
|
5513
|
+
*/
|
|
5514
|
+
#getShownPrediction(): { index: number; suffix: string } | null {
|
|
5424
5515
|
if (this.#autocompleteState) return null;
|
|
5425
|
-
const
|
|
5426
|
-
if (!
|
|
5516
|
+
const predictions = this.predictions?.();
|
|
5517
|
+
if (!predictions?.length) return null;
|
|
5427
5518
|
const { lines, cursorCol } = this.#state;
|
|
5428
5519
|
if (lines.length !== 1) return null;
|
|
5429
5520
|
const typed = lines[0] ?? "";
|
|
5430
|
-
if (cursorCol !== typed.length
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5521
|
+
if (cursorCol !== typed.length) return null;
|
|
5522
|
+
if (predictions.length > 1 && typed === this.#insertedPrediction && predictions.includes(typed)) return null;
|
|
5523
|
+
const index = predictions.findIndex(
|
|
5524
|
+
prediction => typed.length < prediction.length && prediction.startsWith(typed),
|
|
5525
|
+
);
|
|
5526
|
+
return index < 0 ? null : { index, suffix: predictions[index]!.slice(typed.length) };
|
|
5527
|
+
}
|
|
5528
|
+
/**
|
|
5529
|
+
* Two or more predictions, and which one the single-line buffer equals with the cursor at its end:
|
|
5530
|
+
* Tab then opens the list of all of them.
|
|
5531
|
+
*/
|
|
5532
|
+
#getPredictionAlternatives(): { choices: readonly string[]; index: number } | null {
|
|
5533
|
+
if (this.#autocompleteState) return null;
|
|
5534
|
+
const choices = this.predictions?.();
|
|
5535
|
+
if (!choices || choices.length < 2) return null;
|
|
5536
|
+
const { lines, cursorCol } = this.#state;
|
|
5537
|
+
if (lines.length !== 1) return null;
|
|
5538
|
+
const typed = lines[0] ?? "";
|
|
5539
|
+
if (cursorCol !== typed.length) return null;
|
|
5540
|
+
const index = choices.indexOf(typed);
|
|
5541
|
+
return index < 0 ? null : { choices, index };
|
|
5434
5542
|
}
|
|
5435
5543
|
/** Typing `typed` where it diverges from the shown ghost completion rejects that ghost. */
|
|
5436
5544
|
#reportTypedPastWordCompletion(typed: string): void {
|
|
@@ -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
|
package/src/components/image.ts
CHANGED
|
@@ -773,6 +773,19 @@ export class Image implements Component {
|
|
|
773
773
|
this.#cachedWidth = undefined;
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
+
/**
|
|
777
|
+
* Refit to a new row ceiling; a SIXEL reserves its rows until the off-thread
|
|
778
|
+
* encode lands. A demoted fallback keeps the height already drawn only
|
|
779
|
+
* within the new ceiling: the owner chose to shrink the block.
|
|
780
|
+
*/
|
|
781
|
+
setMaxHeightCells(maxHeightCells: number): void {
|
|
782
|
+
if (this.#options.maxHeightCells === maxHeightCells) return;
|
|
783
|
+
this.#options.maxHeightCells = maxHeightCells;
|
|
784
|
+
this.#renderedGraphicRows = Math.min(this.#renderedGraphicRows, maxHeightCells);
|
|
785
|
+
this.#native = undefined;
|
|
786
|
+
this.invalidate();
|
|
787
|
+
}
|
|
788
|
+
|
|
776
789
|
releaseRenderCaches(): void {
|
|
777
790
|
this.#cachedLines = undefined;
|
|
778
791
|
this.#cachedWidth = undefined;
|
|
@@ -2,7 +2,15 @@ import { compactText, styleSpans } from "../native/spans";
|
|
|
2
2
|
import { node } from "../native/describe";
|
|
3
3
|
import type { DescribeContext, NativeNode } from "../native/node";
|
|
4
4
|
import type { Component } from "../tui";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Ellipsis,
|
|
7
|
+
finiteWidth,
|
|
8
|
+
getWidthConfigEpoch,
|
|
9
|
+
singleLine,
|
|
10
|
+
truncateToWidth,
|
|
11
|
+
visibleWidth,
|
|
12
|
+
wrapTextWithAnsi,
|
|
13
|
+
} from "../utils";
|
|
6
14
|
|
|
7
15
|
/** One label/value entry in a {@link KeyValueList}. */
|
|
8
16
|
export interface KeyValueRow {
|
|
@@ -21,14 +29,6 @@ export interface KeyValueListOptions {
|
|
|
21
29
|
readonly labelOverflow?: "allow" | "truncate";
|
|
22
30
|
}
|
|
23
31
|
|
|
24
|
-
function finiteWidth(width: number): number {
|
|
25
|
-
return Number.isFinite(width) ? Math.max(0, Math.trunc(width)) : 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function singleLine(text: string): string {
|
|
29
|
-
return replaceTabs(text).replace(/[\r\n]+/g, " ");
|
|
30
|
-
}
|
|
31
|
-
|
|
32
32
|
/** A bounded ANSI-aware label/value list with replaceable rows and aligned wrapped continuations. */
|
|
33
33
|
export class KeyValueList implements Component {
|
|
34
34
|
#rows: readonly KeyValueRow[];
|
|
@@ -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. */
|
package/src/components/loader.ts
CHANGED
|
@@ -325,6 +325,13 @@ export class Loader extends Text {
|
|
|
325
325
|
dispose() {
|
|
326
326
|
this.stop();
|
|
327
327
|
}
|
|
328
|
+
|
|
329
|
+
/** The current spinner frame and message as one styled line, for hosts that set it into their own chrome. */
|
|
330
|
+
inlineText(): string {
|
|
331
|
+
const spinner = this.spinnerColorFn(this.#frames[this.#currentFrame]);
|
|
332
|
+
return `${spinner} ${this.messageColorFn(this.#resolveMessage())}`;
|
|
333
|
+
}
|
|
334
|
+
|
|
328
335
|
/** Install a lazy right-docked suffix for the spinner row (e.g. a styled
|
|
329
336
|
* session title). Re-evaluated every paint; dropped when the row leaves
|
|
330
337
|
* less than a two-cell gap. */
|
|
@@ -10,6 +10,13 @@ import type { Component } from "../tui";
|
|
|
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
|