@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
|
@@ -13,7 +13,7 @@ import { expandWindowsLongPath, getWindowsShortPath } from "@linxiraos/pi-native
|
|
|
13
13
|
import { pluralize, sanitizeText } from "@linxiraos/pi-utils";
|
|
14
14
|
import { formatKeyHint, type KeyId } from "../app-keybindings";
|
|
15
15
|
import { getKeybindings } from "../keybindings";
|
|
16
|
-
import type { Theme } from "../theme/theme";
|
|
16
|
+
import type { Theme, ThemeColor } from "../theme/theme";
|
|
17
17
|
import type { Component } from "../tui";
|
|
18
18
|
import { replaceTabs, sliceByColumn, truncateToWidth, visibleWidth, wrapTextWithAnsi } from "../utils";
|
|
19
19
|
import { Hasher } from "./utils";
|
|
@@ -103,6 +103,8 @@ export const PREVIEW_LIMITS = {
|
|
|
103
103
|
EXPANDED_LINES: 12,
|
|
104
104
|
/** Items (files, results) shown in collapsed view */
|
|
105
105
|
COLLAPSED_ITEMS: 8,
|
|
106
|
+
/** Definition, type-definition and implementation locations shown in collapsed view */
|
|
107
|
+
LOCATIONS_COLLAPSED: 2,
|
|
106
108
|
/** Output preview lines in collapsed view */
|
|
107
109
|
OUTPUT_COLLAPSED: 3,
|
|
108
110
|
/** Output preview lines in expanded view */
|
|
@@ -291,9 +293,8 @@ export { formatAge, formatBytes, formatCount, formatDuration, formatNumber, plur
|
|
|
291
293
|
export function formatStatusIcon(status: ToolUIStatus, theme: Theme, spinnerFrame?: number): string {
|
|
292
294
|
switch (status) {
|
|
293
295
|
case "success":
|
|
294
|
-
return theme.styledSymbol("status.success", "success");
|
|
295
296
|
case "done":
|
|
296
|
-
return theme.styledSymbol("status.
|
|
297
|
+
return theme.styledSymbol("status.success", "success");
|
|
297
298
|
case "error":
|
|
298
299
|
return theme.styledSymbol("status.error", "error");
|
|
299
300
|
case "warning":
|
|
@@ -433,6 +434,34 @@ export function formatEmptyMessage(message: string, theme: Theme): string {
|
|
|
433
434
|
return `${theme.styledSymbol("status.warning", "warning")} ${theme.fg("muted", message)}`;
|
|
434
435
|
}
|
|
435
436
|
|
|
437
|
+
/**
|
|
438
|
+
* Color of a file's name, or a whole URL, in tool bodies: it keeps paths apart
|
|
439
|
+
* from the tool titles above them (bronze in titanium).
|
|
440
|
+
*/
|
|
441
|
+
export const FILE_NAME_COLOR = "customMessageLabel" satisfies ThemeColor;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Where a display path's final segment (file or folder name) starts, past its
|
|
445
|
+
* last `/` or `\` separator; a trailing-slash directory keeps its slash on the
|
|
446
|
+
* name. Shared by the terminal ({@link formatStyledPath}) and Tern file rows.
|
|
447
|
+
*/
|
|
448
|
+
export function pathNameStart(filePath: string): number {
|
|
449
|
+
let end = filePath.length;
|
|
450
|
+
while (end > 0 && (filePath[end - 1] === "/" || filePath[end - 1] === "\\")) end--;
|
|
451
|
+
return end === 0 ? 0 : Math.max(filePath.lastIndexOf("/", end - 1), filePath.lastIndexOf("\\", end - 1)) + 1;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* A file path in a tool body: the directory (with its trailing separator) dim,
|
|
456
|
+
* the final segment in {@link FILE_NAME_COLOR}. Tool headers keep paths in
|
|
457
|
+
* their plain subject color instead.
|
|
458
|
+
*/
|
|
459
|
+
export function formatStyledPath(filePath: string, theme: Theme): string {
|
|
460
|
+
const cut = pathNameStart(filePath);
|
|
461
|
+
const name = theme.fg(FILE_NAME_COLOR, filePath.slice(cut));
|
|
462
|
+
return cut > 0 ? `${theme.fg("dim", filePath.slice(0, cut))}${name}` : name;
|
|
463
|
+
}
|
|
464
|
+
|
|
436
465
|
// =============================================================================
|
|
437
466
|
// Code Frame Formatting
|
|
438
467
|
// =============================================================================
|
|
@@ -457,7 +486,10 @@ export function formatCodeFrameLine(
|
|
|
457
486
|
// Tool UI Helpers
|
|
458
487
|
// =============================================================================
|
|
459
488
|
|
|
460
|
-
/**
|
|
489
|
+
/**
|
|
490
|
+
* Status states supported by shared tool renderer icons. `done` is a deprecated
|
|
491
|
+
* alias of `success`, kept for extension renderers.
|
|
492
|
+
*/
|
|
461
493
|
export type ToolUIStatus = "success" | "done" | "error" | "warning" | "info" | "pending" | "running" | "aborted";
|
|
462
494
|
/** Semantic foreground colors used by tool renderer labels. */
|
|
463
495
|
export type ToolUIColor = "success" | "error" | "warning" | "accent" | "muted";
|
|
@@ -598,7 +630,7 @@ export function formatDiagnostics(
|
|
|
598
630
|
const fileBranch = isLastFileNode ? theme.tree.last : theme.tree.branch;
|
|
599
631
|
|
|
600
632
|
const fileIcon = theme.fg("muted", getLangIcon(filePath));
|
|
601
|
-
output += `\n ${theme.fg("dim", fileBranch)} ${fileIcon} ${
|
|
633
|
+
output += `\n ${theme.fg("dim", fileBranch)} ${fileIcon} ${formatStyledPath(filePath, theme)}`;
|
|
602
634
|
|
|
603
635
|
for (let di = 0; di < diagnostics.length && diagsShown < maxDiags; di++) {
|
|
604
636
|
const d = diagnostics[di];
|
|
@@ -622,7 +654,7 @@ export function formatDiagnostics(
|
|
|
622
654
|
: d.severity === "warning"
|
|
623
655
|
? theme.styledSymbol("status.warning", "warning")
|
|
624
656
|
: theme.styledSymbol("status.info", "muted");
|
|
625
|
-
const location = theme.fg("
|
|
657
|
+
const location = theme.fg("muted", `:${d.line}:${d.col}`);
|
|
626
658
|
const codeTag = d.code ? theme.fg("dim", ` (${d.code})`) : "";
|
|
627
659
|
const msgColor = d.severity === "error" ? "error" : d.severity === "warning" ? "warning" : "toolOutput";
|
|
628
660
|
|
|
@@ -155,6 +155,8 @@ class ComposerSceneController implements SetupSceneController {
|
|
|
155
155
|
export const composerSetupScene: SetupScene = {
|
|
156
156
|
id: "composer-shape",
|
|
157
157
|
title: "Choose composer shape",
|
|
158
|
+
step: "Composer",
|
|
158
159
|
minVersion: 2,
|
|
160
|
+
ansiOnly: true,
|
|
159
161
|
mount: host => new ComposerSceneController(host),
|
|
160
162
|
};
|
|
@@ -21,7 +21,7 @@ const GLYPH_LABELS: Readonly<Record<SymbolPreset, string>> = {
|
|
|
21
21
|
const GLYPH_SAMPLES: Readonly<Record<SymbolPreset, string>> = {
|
|
22
22
|
nerd: " ",
|
|
23
23
|
unicode: "✔ ✖ 📁 ⬢ ╭─╮ ├─ • ⠋ →",
|
|
24
|
-
ascii: "[
|
|
24
|
+
ascii: "[+] [-] > + [D] +-+ |-- * ->",
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/** One picker row per preset; the description column shows live sample glyphs instead of prose. */
|
|
@@ -142,7 +142,7 @@ class GlyphSceneController implements SetupSceneController {
|
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
144
|
* Preview and persist the terminal glyph preset. Skipped once the Glyph
|
|
145
|
-
* Protocol handshake confirmed the terminal renders
|
|
145
|
+
* Protocol handshake confirmed the terminal renders Zeta's bundled icons: every
|
|
146
146
|
* row renders cleanly there, and the default `unicode` preset already upgrades
|
|
147
147
|
* to nerd at runtime while staying safe on terminals without the protocol.
|
|
148
148
|
*/
|
|
@@ -151,7 +151,9 @@ export const glyphSetupScene: SetupScene = {
|
|
|
151
151
|
get title(): string {
|
|
152
152
|
return tuiText("setupGlyphTitle", "Choose glyph mode");
|
|
153
153
|
},
|
|
154
|
+
step: "Symbols",
|
|
154
155
|
minVersion: 1,
|
|
156
|
+
ansiOnly: true,
|
|
155
157
|
shouldRun: () => !TERMINAL.glyphProtocol,
|
|
156
158
|
mount: host => new GlyphSceneController(host),
|
|
157
159
|
};
|
|
@@ -1,29 +1,53 @@
|
|
|
1
1
|
import type { Model } from "@linxiraos/pi-ai";
|
|
2
2
|
import { modelKind } from "@linxiraos/pi-catalog/types";
|
|
3
|
+
import type { TspPickerProps } from "@linxiraos/pi-wire";
|
|
3
4
|
import type { SgrMouseEvent } from "../../mouse";
|
|
4
5
|
import { Text } from "../../components/text";
|
|
5
6
|
import { WizardStep } from "../../components/wizard-step";
|
|
6
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
buildBrowserItems,
|
|
9
|
+
ModelBrowser,
|
|
10
|
+
type ModelBrowserItem,
|
|
11
|
+
resolveRoleAssignments,
|
|
12
|
+
sortModelItems,
|
|
13
|
+
} from "../../overlays/model-browser";
|
|
7
14
|
import { BROWSER_FRAME_ROWS } from "../../overlays/model-picker";
|
|
8
15
|
import { formatKeyHint } from "../../app-keybindings";
|
|
16
|
+
import { matchesKey } from "../../keys";
|
|
9
17
|
import { theme } from "../../theme/theme";
|
|
10
18
|
import { col, node, span, text } from "../../native/describe";
|
|
11
|
-
import type { NativeNode } from "../../native/node";
|
|
19
|
+
import type { DescribeContext, NativeChild, NativeNode, NativeUiEvent } from "../../native/node";
|
|
12
20
|
import { Memo } from "../../native/memo";
|
|
13
|
-
import
|
|
21
|
+
import { dockedPicker, PICKER_KEY, pickerAction, pickerEvent } from "../../native/picker";
|
|
22
|
+
import {
|
|
23
|
+
SETUP_SHEET_ROLE,
|
|
24
|
+
type SetupScene,
|
|
25
|
+
type SetupSceneController,
|
|
26
|
+
type SetupSceneHost,
|
|
27
|
+
type StyledLine,
|
|
28
|
+
} from "./types";
|
|
14
29
|
|
|
15
30
|
const MAX_VISIBLE_MODELS = 10;
|
|
31
|
+
const TITLE = "Choose your default model";
|
|
32
|
+
/** The sheet's subtitle while nothing is in flight. */
|
|
33
|
+
const SHEET_SUBTITLE = "Used by new sessions. Change it with /model.";
|
|
16
34
|
|
|
17
35
|
class ModelSceneController implements SetupSceneController {
|
|
18
|
-
title =
|
|
36
|
+
title = TITLE;
|
|
19
37
|
subtitle = "Search configured models and save the model used for new sessions.";
|
|
20
38
|
#browser: ModelBrowser;
|
|
21
|
-
/**
|
|
22
|
-
#
|
|
23
|
-
#
|
|
39
|
+
/** Base rows (available chat models), the picker's catalogue. */
|
|
40
|
+
#items: ModelBrowserItem[] = [];
|
|
41
|
+
#current: string | undefined;
|
|
42
|
+
#discovering = false;
|
|
43
|
+
#discoveryError: string | undefined;
|
|
44
|
+
/** Selector being saved as the default. */
|
|
45
|
+
#saving: string | undefined;
|
|
46
|
+
#saveError: string | undefined;
|
|
24
47
|
#disposed = false;
|
|
25
48
|
#step: WizardStep | undefined;
|
|
26
|
-
#
|
|
49
|
+
#sheet = new Memo();
|
|
50
|
+
#inline = new Memo();
|
|
27
51
|
|
|
28
52
|
readonly #host: SetupSceneHost;
|
|
29
53
|
|
|
@@ -38,8 +62,6 @@ class ModelSceneController implements SetupSceneController {
|
|
|
38
62
|
}
|
|
39
63
|
|
|
40
64
|
async onMount(): Promise<void> {
|
|
41
|
-
this.#status = { text: "Discovering available models…", color: "muted", busy: true };
|
|
42
|
-
this.#host.requestRender();
|
|
43
65
|
await this.#refreshModels();
|
|
44
66
|
}
|
|
45
67
|
|
|
@@ -48,24 +70,30 @@ class ModelSceneController implements SetupSceneController {
|
|
|
48
70
|
}
|
|
49
71
|
|
|
50
72
|
invalidate(): void {
|
|
51
|
-
this.#
|
|
73
|
+
this.#sheet.clear();
|
|
74
|
+
this.#inline.clear();
|
|
52
75
|
if (this.#step) this.#step.invalidate();
|
|
53
76
|
else this.#browser.invalidate();
|
|
54
77
|
}
|
|
55
78
|
|
|
56
79
|
handleInput(data: string): void {
|
|
57
|
-
if (this.#
|
|
80
|
+
if (this.#saving !== undefined) return;
|
|
81
|
+
// With nothing to pick after a failed discovery, Enter retries it (the sheet's primary action).
|
|
82
|
+
if (this.#canRetry() && (matchesKey(data, "enter") || matchesKey(data, "return"))) {
|
|
83
|
+
void this.#refreshModels();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
58
86
|
if (this.#step) this.#step.handleInput(data);
|
|
59
87
|
else this.#browser.handleInput(data);
|
|
60
88
|
}
|
|
61
89
|
|
|
62
90
|
routeMouse(event: SgrMouseEvent, line: number, col: number): void {
|
|
63
|
-
if (this.#
|
|
91
|
+
if (this.#saving !== undefined) return;
|
|
64
92
|
this.#step?.routeMouse(event, line, col);
|
|
65
93
|
}
|
|
66
94
|
|
|
67
95
|
render(width: number, maxLines?: number): readonly string[] {
|
|
68
|
-
const status = this.#status;
|
|
96
|
+
const status = this.#status();
|
|
69
97
|
const intro = new Text(
|
|
70
98
|
status
|
|
71
99
|
? theme.fg(status.color, status.text)
|
|
@@ -94,12 +122,140 @@ class ModelSceneController implements SetupSceneController {
|
|
|
94
122
|
return this.#step.render(width);
|
|
95
123
|
}
|
|
96
124
|
|
|
97
|
-
/**
|
|
98
|
-
|
|
99
|
-
|
|
125
|
+
/**
|
|
126
|
+
* The setup sheet (search, provider-grouped models with fact columns, the
|
|
127
|
+
* highlighted model's details, Skip and Set as default), or where the
|
|
128
|
+
* terminal lacks `picker`, a status line over the browser's own list.
|
|
129
|
+
*/
|
|
130
|
+
describe(cx?: DescribeContext): NativeNode {
|
|
131
|
+
return cx?.supports("picker") ? this.#describeSheet() : this.#describeInline();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** Sheet pointer events, each on the path of the key it stands for. */
|
|
135
|
+
handleNativeEvent(event: NativeUiEvent): void {
|
|
136
|
+
const picked = pickerEvent(event, PICKER_KEY);
|
|
137
|
+
if (!picked || this.#saving !== undefined) return;
|
|
138
|
+
if (picked.kind !== "action") {
|
|
139
|
+
this.#browser.routePickerItem(picked.item, picked.kind === "activate");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
switch (picked.act) {
|
|
143
|
+
case "skip":
|
|
144
|
+
this.#host.finish("skipped");
|
|
145
|
+
return;
|
|
146
|
+
case "retry":
|
|
147
|
+
if (this.#discoveryError !== undefined) void this.#refreshModels();
|
|
148
|
+
return;
|
|
149
|
+
case "save": {
|
|
150
|
+
const selected = this.#browser.pickerSelected;
|
|
151
|
+
if (selected) this.#browser.routePickerItem(selected, true);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
case "clear":
|
|
155
|
+
if (this.#browser.query.length > 0) this.#browser.handleCancel();
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** The latest in-flight or failed operation, as one line of status copy. */
|
|
161
|
+
#status(): (StyledLine & { readonly busy: boolean }) | undefined {
|
|
162
|
+
if (this.#saving !== undefined) {
|
|
163
|
+
return { text: `Saving ${this.#saving} as the default model…`, color: "muted", busy: true };
|
|
164
|
+
}
|
|
165
|
+
if (this.#saveError !== undefined) return { text: this.#saveError, color: "error", busy: false };
|
|
166
|
+
if (this.#discoveryError !== undefined) return { text: this.#discoveryError, color: "error", busy: false };
|
|
167
|
+
if (this.#discovering) return { text: "Discovering available models…", color: "muted", busy: true };
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Discovery failed and nothing is listed: Enter and the primary action retry it. */
|
|
172
|
+
#canRetry(): boolean {
|
|
173
|
+
return this.#discoveryError !== undefined && this.#browser.pickerSelected === null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
#describeSheet(): NativeNode {
|
|
177
|
+
const browser = this.#browser;
|
|
178
|
+
const query = browser.query;
|
|
179
|
+
const filtering = query.trim().length > 0;
|
|
180
|
+
// Provider groups while browsing; one ranked "Matches" block while searching.
|
|
181
|
+
const view = browser.pickerOrder({ providers: !filtering, rest: filtering ? "Matches" : "All models" });
|
|
182
|
+
const catalogue = browser.pickerItems(this.#items);
|
|
183
|
+
const preview = browser.pickerPreview("full", this.#current);
|
|
184
|
+
const deps = [
|
|
185
|
+
catalogue,
|
|
186
|
+
view,
|
|
187
|
+
preview,
|
|
188
|
+
query,
|
|
189
|
+
browser.cursor,
|
|
190
|
+
browser.pickerSelected,
|
|
191
|
+
this.#current,
|
|
192
|
+
this.#discovering,
|
|
193
|
+
this.#discoveryError,
|
|
194
|
+
this.#saving,
|
|
195
|
+
this.#saveError,
|
|
196
|
+
];
|
|
197
|
+
return this.#sheet.get(deps, () => {
|
|
198
|
+
const rows = browser.pickerRows(catalogue, view, this.#current);
|
|
199
|
+
const listed = view.count > 0 || query.length > 0;
|
|
200
|
+
const state: TspPickerProps["state"] = listed
|
|
201
|
+
? "ready"
|
|
202
|
+
: this.#discoveryError !== undefined
|
|
203
|
+
? "error"
|
|
204
|
+
: this.#discovering
|
|
205
|
+
? "loading"
|
|
206
|
+
: "ready";
|
|
207
|
+
const saving = this.#saving !== undefined;
|
|
208
|
+
const retry = this.#canRetry();
|
|
209
|
+
const primary = retry
|
|
210
|
+
? pickerAction("retry", "Retry", "enter", { primary: true })
|
|
211
|
+
: pickerAction("save", saving ? "Saving…" : "Set as default", "enter", {
|
|
212
|
+
primary: true,
|
|
213
|
+
...(saving
|
|
214
|
+
? { disabled: "Saving the default model" }
|
|
215
|
+
: rows.selected
|
|
216
|
+
? {}
|
|
217
|
+
: { disabled: "No model highlighted" }),
|
|
218
|
+
});
|
|
219
|
+
// The reconciler hoists the picker into `layer`; the column is its place in the page.
|
|
220
|
+
return dockedPicker(
|
|
221
|
+
{
|
|
222
|
+
role: SETUP_SHEET_ROLE,
|
|
223
|
+
title: TITLE,
|
|
224
|
+
subtitle: this.#sheetSubtitle(),
|
|
225
|
+
icon: "cpu",
|
|
226
|
+
noun: "models",
|
|
227
|
+
size: "lg",
|
|
228
|
+
layout: "rows",
|
|
229
|
+
preview: "side",
|
|
230
|
+
placeholder: "Search models…",
|
|
231
|
+
...rows,
|
|
232
|
+
state,
|
|
233
|
+
...(state === "error" && this.#discoveryError !== undefined ? { message: this.#discoveryError } : {}),
|
|
234
|
+
empty: "No models yet. Skip this step and run /login to sign in to a provider.",
|
|
235
|
+
actions: [pickerAction("skip", "Skip", "escape", { end: true }), primary],
|
|
236
|
+
},
|
|
237
|
+
this.#saveError === undefined
|
|
238
|
+
? preview
|
|
239
|
+
: [text([span(this.#saveError, "error")], { wrap: "word" }), ...preview],
|
|
240
|
+
);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
#sheetSubtitle(): TspPickerProps["subtitle"] {
|
|
245
|
+
if (this.#saving !== undefined)
|
|
246
|
+
return [span("Saving "), span(this.#saving, "mono"), span(" as your default model…")];
|
|
247
|
+
if (this.#saveError !== undefined) return [span(`Couldn't save the default model: ${this.#saveError}`, "error")];
|
|
248
|
+
if (this.#discoveryError !== undefined && this.#items.length > 0) return [span(this.#discoveryError, "error")];
|
|
249
|
+
if (this.#discovering && this.#items.length > 0) return "Looking for more models…";
|
|
250
|
+
return SHEET_SUBTITLE;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** Status (a spinner while models load or the choice saves) over the model browser, which describes itself. */
|
|
254
|
+
#describeInline(): NativeNode {
|
|
255
|
+
const status = this.#status();
|
|
100
256
|
const enter = formatKeyHint("enter");
|
|
101
|
-
return this.#
|
|
102
|
-
let intro:
|
|
257
|
+
return this.#inline.get([status?.text, status?.color, status?.busy, enter], () => {
|
|
258
|
+
let intro: NativeChild;
|
|
103
259
|
if (status?.busy) {
|
|
104
260
|
intro = node("spinner", { label: [span(status.text, status.color)] });
|
|
105
261
|
} else if (status) {
|
|
@@ -117,6 +273,7 @@ class ModelSceneController implements SetupSceneController {
|
|
|
117
273
|
const roles = resolveRoleAssignments(source, all, available);
|
|
118
274
|
const items = buildBrowserItems(available.filter(model => modelKind(model) === "chat"));
|
|
119
275
|
sortModelItems(items, { roles, mruOrder: source.mruOrder });
|
|
276
|
+
this.#items = items;
|
|
120
277
|
this.#browser.setRoles(roles);
|
|
121
278
|
this.#browser.setMruOrder(source.mruOrder);
|
|
122
279
|
this.#browser.setPerfStats(source.modelPerf);
|
|
@@ -124,37 +281,42 @@ class ModelSceneController implements SetupSceneController {
|
|
|
124
281
|
|
|
125
282
|
if (current) {
|
|
126
283
|
const selector = `${current.provider}/${current.id}`;
|
|
284
|
+
this.#current = selector;
|
|
127
285
|
this.#browser.setCurrentSelector(selector);
|
|
128
286
|
this.#browser.selectSelector(selector);
|
|
129
287
|
}
|
|
130
288
|
}
|
|
131
289
|
|
|
132
290
|
async #refreshModels(): Promise<void> {
|
|
291
|
+
if (this.#discovering) return;
|
|
292
|
+
this.#discovering = true;
|
|
293
|
+
this.#discoveryError = undefined;
|
|
294
|
+
this.#host.requestRender();
|
|
133
295
|
try {
|
|
134
296
|
await this.#host.ctx.refreshModels();
|
|
135
297
|
if (this.#disposed) return;
|
|
136
298
|
this.#syncModels();
|
|
137
|
-
this.#status = undefined;
|
|
138
|
-
this.#host.requestRender();
|
|
139
299
|
} catch (error) {
|
|
140
300
|
if (this.#disposed) return;
|
|
141
|
-
this.#
|
|
142
|
-
|
|
301
|
+
this.#discoveryError = error instanceof Error ? error.message : String(error);
|
|
302
|
+
} finally {
|
|
303
|
+
this.#discovering = false;
|
|
143
304
|
}
|
|
305
|
+
this.#host.requestRender();
|
|
144
306
|
}
|
|
145
307
|
|
|
146
308
|
async #select(model: Model, selector: string): Promise<void> {
|
|
147
|
-
if (this.#
|
|
148
|
-
this.#
|
|
149
|
-
this.#
|
|
309
|
+
if (this.#saving !== undefined) return;
|
|
310
|
+
this.#saving = selector;
|
|
311
|
+
this.#saveError = undefined;
|
|
150
312
|
this.#host.requestRender();
|
|
151
313
|
try {
|
|
152
314
|
await this.#host.ctx.selectModel(model, selector);
|
|
153
315
|
if (!this.#disposed) this.#host.finish("done");
|
|
154
316
|
} catch (error) {
|
|
155
317
|
if (this.#disposed) return;
|
|
156
|
-
this.#
|
|
157
|
-
this.#
|
|
318
|
+
this.#saving = undefined;
|
|
319
|
+
this.#saveError = error instanceof Error ? error.message : String(error);
|
|
158
320
|
this.#host.requestRender();
|
|
159
321
|
}
|
|
160
322
|
}
|
|
@@ -163,7 +325,8 @@ class ModelSceneController implements SetupSceneController {
|
|
|
163
325
|
/** Setup step that assigns one available model to the persisted default role. */
|
|
164
326
|
export const modelSetupScene: SetupScene = {
|
|
165
327
|
id: "model",
|
|
166
|
-
title:
|
|
328
|
+
title: TITLE,
|
|
329
|
+
step: "Model",
|
|
167
330
|
minVersion: 1,
|
|
168
331
|
mount: host => new ModelSceneController(host),
|
|
169
332
|
};
|
|
@@ -2,7 +2,7 @@ import { centerLine } from "../../utils";
|
|
|
2
2
|
import { padToWidth } from "../../render/utils";
|
|
3
3
|
import { theme } from "../../theme/theme";
|
|
4
4
|
import { tuiText } from "../../i18n";
|
|
5
|
-
import { col, node, span, text } from "../../native/describe";
|
|
5
|
+
import { col, compact, keyed, node, span, text } from "../../native/describe";
|
|
6
6
|
import type { NativeNode } from "../../native/node";
|
|
7
7
|
import { Memo } from "../../native/memo";
|
|
8
8
|
import { renderStarfield, SETUP_TICK_MS } from "./splash";
|
|
@@ -13,23 +13,41 @@ export const SETUP_OUTRO_MS = 1200;
|
|
|
13
13
|
const outroMemo = new Memo();
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Native outro: the shimmering mark,
|
|
17
|
-
*
|
|
18
|
-
* the
|
|
16
|
+
* Native outro, centered: the shimmering Zeta mark, "Setup saved", the
|
|
17
|
+
* default model now in effect (`model`, its display name, when there is
|
|
18
|
+
* one), and an indeterminate progress bar standing in for the timed sweep.
|
|
19
|
+
* A click sends the `continue` action.
|
|
19
20
|
*/
|
|
20
|
-
export function describeSetupOutro(): NativeNode {
|
|
21
|
-
|
|
22
|
-
return outroMemo.get([saved], () =>
|
|
21
|
+
export function describeSetupOutro(model: string | undefined): NativeNode {
|
|
22
|
+
return outroMemo.get([model], () =>
|
|
23
23
|
col(
|
|
24
|
-
[
|
|
25
|
-
node("spacer", { grow: 1 }),
|
|
24
|
+
compact([
|
|
25
|
+
node("spacer", { grow: 1 }, undefined, "top"),
|
|
26
26
|
logoNode(ZETA_LOGO, true),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
keyed(
|
|
28
|
+
text([span("Setup saved", "success strong")], { wrap: "none", role: "zeta.setup.outro.title" }),
|
|
29
|
+
"title",
|
|
30
|
+
),
|
|
31
|
+
model !== undefined &&
|
|
32
|
+
keyed(
|
|
33
|
+
text([span("Default model", "muted"), span(" · ", "dim"), span(model, "muted")], {
|
|
34
|
+
wrap: "none",
|
|
35
|
+
truncate: "end",
|
|
36
|
+
role: "zeta.setup.outro.model",
|
|
37
|
+
}),
|
|
38
|
+
"model",
|
|
39
|
+
),
|
|
40
|
+
keyed(
|
|
41
|
+
text([span("Handing off to the normal CLI…", "muted")], {
|
|
42
|
+
wrap: "none",
|
|
43
|
+
role: "zeta.setup.outro.status",
|
|
44
|
+
}),
|
|
45
|
+
"status",
|
|
46
|
+
),
|
|
47
|
+
node("progress", { value: null, role: "zeta.setup.outro.progress" }, undefined, "progress"),
|
|
48
|
+
node("spacer", { grow: 1 }, undefined, "bottom"),
|
|
49
|
+
]),
|
|
50
|
+
{ align: "center", grow: 1, role: "zeta.setup.outro", actions: { click: "continue" } },
|
|
33
51
|
),
|
|
34
52
|
);
|
|
35
53
|
}
|