@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/native/overlay.d.ts
CHANGED
|
@@ -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. */
|
package/src/native/overlay.ts
CHANGED
|
@@ -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
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
import type { TspProps, TspSpan, TspText } from "@linxiraos/pi-wire";
|
|
10
10
|
import { formatTooltipKey, type KeyName } from "../key-hint-format";
|
|
11
11
|
import { getKeybindings, type Keybinding } from "../keybindings";
|
|
12
|
-
import { card, kbd, list, node, row, span, text } from "./describe";
|
|
12
|
+
import { card, kbd, keyNames, list, node, row, span, text } from "./describe";
|
|
13
13
|
import type { NativeChild, NativeNode } from "./node";
|
|
14
|
+
import { nativeButtons } from "./state";
|
|
14
15
|
|
|
15
16
|
/** Below this many columns a centered sheet fills the pane instead of floating with margins. */
|
|
16
17
|
export const NARROW_SHEET_COLS = 100;
|
|
@@ -96,29 +97,68 @@ export interface ActionButtonOptions {
|
|
|
96
97
|
readonly title?: string;
|
|
97
98
|
/** Target of an `open` action (URL or `file://` path). */
|
|
98
99
|
readonly href?: string;
|
|
100
|
+
/** Why the action can't run now: the button dims and a click sends nothing. */
|
|
101
|
+
readonly disabled?: string;
|
|
102
|
+
/** The button's work is running: a spinner leads the label. */
|
|
103
|
+
readonly busy?: boolean;
|
|
104
|
+
/** Icon beside the label (before it on a `button` node, after it on a row). */
|
|
105
|
+
readonly icon?: string;
|
|
99
106
|
}
|
|
100
107
|
|
|
101
108
|
/**
|
|
102
109
|
* A native button (role `zeta.btn`): a label plus an optional keycap. A click
|
|
103
110
|
* sends `act` back as an `action` event (or runs a terminal-local `open`/`copy`),
|
|
104
111
|
* which the component routes to the same code path as the key.
|
|
112
|
+
*
|
|
113
|
+
* A terminal that draws the `button` kind ({@link nativeButtons}) gets one
|
|
114
|
+
* (tone `accent` → variant `primary`, `error` → `danger`, `disabled` with its
|
|
115
|
+
* reason as the tooltip); older ones get the row their stylesheets draw by
|
|
116
|
+
* role. Both keep the role and tone the omp sheets' context rules key on; a
|
|
117
|
+
* disabled button's tone is `muted`.
|
|
105
118
|
*/
|
|
106
119
|
export function actionButton(label: string, act: string, options: ActionButtonOptions = {}): NativeNode {
|
|
107
|
-
const
|
|
108
|
-
|
|
120
|
+
const { keys, href, disabled, busy, icon } = options;
|
|
121
|
+
const title = options.title ?? (keys ? `${label} ${formatTooltipKey(keys)}` : label);
|
|
122
|
+
const tone = disabled === undefined ? options.tone : "muted";
|
|
123
|
+
const key = options.key ?? act;
|
|
124
|
+
if (nativeButtons()) {
|
|
125
|
+
return node(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
role: "zeta.btn",
|
|
129
|
+
text: label,
|
|
130
|
+
actions: { click: act },
|
|
131
|
+
title,
|
|
132
|
+
...(keys ? { keys: keyNames(keys) } : {}),
|
|
133
|
+
...(icon ? { icon } : {}),
|
|
134
|
+
...(tone === "accent" ? { variant: "primary" } : tone === "error" ? { variant: "danger" } : {}),
|
|
135
|
+
...(tone ? { tone } : {}),
|
|
136
|
+
...(disabled !== undefined ? { disabled: disabled || true } : {}),
|
|
137
|
+
...(busy ? { busy } : {}),
|
|
138
|
+
...(href ? { href } : {}),
|
|
139
|
+
},
|
|
140
|
+
undefined,
|
|
141
|
+
key,
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
const children: NativeChild[] = [];
|
|
145
|
+
if (busy) children.push(node("spinner", { style: "dots" }));
|
|
146
|
+
children.push(text(label));
|
|
147
|
+
if (icon) children.push(node("icon", { name: icon }, undefined, "icon"));
|
|
148
|
+
if (keys) children.push(kbd(keys));
|
|
109
149
|
return node(
|
|
110
150
|
"row",
|
|
111
151
|
{
|
|
112
152
|
role: "zeta.btn",
|
|
113
153
|
gap: "xs",
|
|
114
154
|
align: "center",
|
|
115
|
-
actions: { click: act },
|
|
116
|
-
title
|
|
117
|
-
...(
|
|
118
|
-
...(
|
|
155
|
+
...(disabled === undefined ? { actions: { click: act } } : {}),
|
|
156
|
+
title,
|
|
157
|
+
...(tone ? { tone } : {}),
|
|
158
|
+
...(href ? { href } : {}),
|
|
119
159
|
},
|
|
120
160
|
children,
|
|
121
|
-
|
|
161
|
+
key,
|
|
122
162
|
);
|
|
123
163
|
}
|
|
124
164
|
|
|
@@ -127,12 +167,80 @@ export function actionButton(label: string, act: string, options: ActionButtonOp
|
|
|
127
167
|
* `act` (default `close`), which the component routes to its Esc path.
|
|
128
168
|
*/
|
|
129
169
|
export function escCloseButton(act = "close", key = "esc-close"): NativeNode {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
170
|
+
const title = `Close ${formatTooltipKey("escape")}`;
|
|
171
|
+
if (nativeButtons()) {
|
|
172
|
+
return node(
|
|
173
|
+
"button",
|
|
174
|
+
{ role: "zeta.btn", keys: ["escape"], actions: { click: act }, title, aria: "Close" },
|
|
175
|
+
undefined,
|
|
176
|
+
key,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
return node("row", { role: "zeta.btn", align: "center", actions: { click: act }, title }, [kbd("escape")], key);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Options of an {@link iconButton}. */
|
|
183
|
+
export interface IconButtonOptions {
|
|
184
|
+
/** Sibling identity key; unkeyed buttons take their position. */
|
|
185
|
+
readonly key?: string;
|
|
186
|
+
/** Accessible name; defaults to the title. */
|
|
187
|
+
readonly aria?: string;
|
|
188
|
+
/** A toggle that is on (role `zeta.app.ibtn.set`). */
|
|
189
|
+
readonly on?: boolean;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* A quiet icon-only button (role `zeta.app.ibtn`, the kit's icon button) for an
|
|
194
|
+
* app head or toolbar: a `button` node where the terminal draws one
|
|
195
|
+
* ({@link nativeButtons}), else an `icon` with a click action.
|
|
196
|
+
*/
|
|
197
|
+
export function iconButton(name: string, act: string, title: string, options: IconButtonOptions = {}): NativeNode {
|
|
198
|
+
const role = options.on ? "zeta.app.ibtn.set" : "zeta.app.ibtn";
|
|
199
|
+
const aria = options.aria ?? title;
|
|
200
|
+
if (nativeButtons()) {
|
|
201
|
+
return node(
|
|
202
|
+
"button",
|
|
203
|
+
{
|
|
204
|
+
role,
|
|
205
|
+
variant: "quiet",
|
|
206
|
+
icon: name,
|
|
207
|
+
title,
|
|
208
|
+
aria,
|
|
209
|
+
actions: { click: act },
|
|
210
|
+
...(options.on ? { on: true } : {}),
|
|
211
|
+
},
|
|
212
|
+
undefined,
|
|
213
|
+
options.key,
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
return node("icon", { name, role, title, aria, actions: { click: act } }, undefined, options.key);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* A quiet text button (role `zeta.app.qbtn`, the kit's quiet button) for a
|
|
221
|
+
* section head or toolbar, keyed by its action: a small quiet `button` where
|
|
222
|
+
* the terminal draws one ({@link nativeButtons}), else a row.
|
|
223
|
+
*/
|
|
224
|
+
export function quietButton(label: string, act: string, title: string): NativeNode {
|
|
225
|
+
if (nativeButtons()) {
|
|
226
|
+
return node(
|
|
227
|
+
"button",
|
|
228
|
+
{ role: "zeta.app.qbtn", variant: "quiet", size: "sm", text: label, actions: { click: act }, title },
|
|
229
|
+
undefined,
|
|
230
|
+
act,
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
return node("row", { role: "zeta.app.qbtn", actions: { click: act }, title }, [text(label)], act);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* A segmented control: `tabs` drawn as a well with a raised thumb on the
|
|
238
|
+
* active tab. A terminal that draws the `button` kind ({@link nativeButtons})
|
|
239
|
+
* draws `variant: "segmented"` too; older ones restyle the tabs by role
|
|
240
|
+
* (`zeta.app.seg`) or parent.
|
|
241
|
+
*/
|
|
242
|
+
export function segmentedTabs(p: TspProps<"tabs">, key: string): NativeNode {
|
|
243
|
+
return node("tabs", nativeButtons() ? { ...p, variant: "segmented" } : p, undefined, key);
|
|
136
244
|
}
|
|
137
245
|
|
|
138
246
|
/** A row of {@link actionButton}s (role `zeta.actions`); `null` entries become the spacer that end-aligns what follows. */
|
package/src/native/picker.d.ts
CHANGED
|
@@ -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";
|
|
21
21
|
import { type Keybinding } from "../keybindings";
|
|
22
22
|
import type { Input } from "../components/input";
|
|
23
23
|
import type { SelectItem, SelectList } from "../components/select-list";
|
|
24
24
|
import type { NativeChild, NativeNode, NativeUiEvent } from "./node";
|
|
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;
|
package/src/native/picker.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
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";
|
|
21
21
|
import { getKeybindings, type Keybinding } from "../keybindings";
|
|
22
22
|
import type { Input } from "../components/input";
|
|
@@ -25,7 +25,7 @@ import { col, node } from "./describe";
|
|
|
25
25
|
import type { NativeChild, NativeNode, NativeUiEvent } from "./node";
|
|
26
26
|
|
|
27
27
|
/** The picker sheet; `preview` children fill its preview pane. */
|
|
28
|
-
export function picker(p:
|
|
28
|
+
export function picker(p: TspProps<"picker">, preview?: readonly NativeChild[]): NativeNode {
|
|
29
29
|
return node("picker", p, preview);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -46,7 +46,7 @@ export const PICKER_KEY = "picker";
|
|
|
46
46
|
* the picker as child {@link PICKER_KEY}, which the reconciler hoists into
|
|
47
47
|
* `layer`. Route its events with `pickerEvent(event, PICKER_KEY)`.
|
|
48
48
|
*/
|
|
49
|
-
export function dockedPicker(p:
|
|
49
|
+
export function dockedPicker(p: TspProps<"picker">, preview?: readonly NativeChild[]): NativeNode {
|
|
50
50
|
return col([node("picker", p, preview, PICKER_KEY)]);
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -193,7 +193,7 @@ export interface SelectPickerOptions {
|
|
|
193
193
|
readonly subtitle?: string;
|
|
194
194
|
readonly icon?: string;
|
|
195
195
|
readonly noun?: string;
|
|
196
|
-
/** Show
|
|
196
|
+
/** Show Zeta's filter text as the search field (lists that filter as you type). */
|
|
197
197
|
readonly searchable?: boolean;
|
|
198
198
|
/** Per-item extras (a thinking-level dot, a swatch mark, a budget fact). */
|
|
199
199
|
readonly decorate?: (item: SelectItem) => Partial<Omit<TspPickerItem, "id">> | undefined;
|
package/src/native/state.d.ts
CHANGED
|
@@ -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;
|
package/src/native/state.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Process-wide
|
|
2
|
+
* Process-wide native rendering state, set only by the native backend.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Whether a Tern Surface Protocol backend is rendering: components that
|
|
5
|
+
* animate by re-rendering on a timer (spinners, shimmer, thinking frames,
|
|
6
|
+
* countdowns) check it and skip scheduling, because the terminal clocks
|
|
7
|
+
* motion from the described nodes. Set when a surface opens and cleared when
|
|
8
|
+
* it closes.
|
|
8
9
|
*/
|
|
9
10
|
let active = false;
|
|
10
11
|
const listeners = new Set<(on: boolean) => void>();
|
|
@@ -21,6 +22,25 @@ export function setNativeRendering(on: boolean): void {
|
|
|
21
22
|
for (const listener of listeners) listener(on);
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Whether the live terminal draws the `button` kind (its `hello` lists it),
|
|
27
|
+
* and with it `tabs` `variant: "segmented"`. The button builders
|
|
28
|
+
* (`native/overlay.ts`) read it; older Terns get the `row` buttons they style
|
|
29
|
+
* by role. Set only by the native backend from the `hello` it adopts; false
|
|
30
|
+
* while no surface is live.
|
|
31
|
+
*/
|
|
32
|
+
let buttons = false;
|
|
33
|
+
|
|
34
|
+
/** Whether omp's buttons go out as `button` nodes (see {@link setNativeButtons}). */
|
|
35
|
+
export function nativeButtons(): boolean {
|
|
36
|
+
return buttons;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Called by the native backend when it adopts a `hello` reply and when it stops. */
|
|
40
|
+
export function setNativeButtons(on: boolean): void {
|
|
41
|
+
buttons = on;
|
|
42
|
+
}
|
|
43
|
+
|
|
24
44
|
/** Call `listener` whenever native rendering starts or stops; returns the unsubscribe. */
|
|
25
45
|
export function onNativeRenderingChange(listener: (on: boolean) => void): () => void {
|
|
26
46
|
listeners.add(listener);
|
|
@@ -36,7 +36,6 @@ import { editorKey, editorKeys } from "../chrome/keybinding-hints";
|
|
|
36
36
|
import { HookEditorComponent } from "./hook-editor";
|
|
37
37
|
import {
|
|
38
38
|
buildBrowserItems,
|
|
39
|
-
MODEL_PICKER_COLUMNS,
|
|
40
39
|
ModelBrowser,
|
|
41
40
|
type ModelBrowserItem,
|
|
42
41
|
type ModelBrowserSource,
|
|
@@ -749,16 +748,8 @@ export class AdvisorConfigOverlayComponent implements Component {
|
|
|
749
748
|
size: "md",
|
|
750
749
|
layout: "rows",
|
|
751
750
|
preview: "below",
|
|
752
|
-
query: browser.query,
|
|
753
|
-
cursor: browser.cursor,
|
|
754
751
|
placeholder: "Search models…",
|
|
755
|
-
|
|
756
|
-
...catalogue,
|
|
757
|
-
order: order.order,
|
|
758
|
-
...(order.hits ? { hits: order.hits } : {}),
|
|
759
|
-
selected: browser.pickerSelected,
|
|
760
|
-
...(this.#modelCurrent ? { current: [this.#modelCurrent] } : {}),
|
|
761
|
-
total: browser.baseCount,
|
|
752
|
+
...browser.pickerRows(catalogue, order, this.#modelCurrent),
|
|
762
753
|
empty: "No models available",
|
|
763
754
|
actions: [
|
|
764
755
|
pickerAction("use", "Use for advisor", "enter", { primary: true }),
|