@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/theme/loader.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { getCustomThemesDir } from "@linxiraos/pi-utils/dirs";
|
|
|
5
5
|
import { isEnoent } from "@linxiraos/pi-utils/fs-error";
|
|
6
6
|
import { detectColorMode, resolveThemeColors } from "./color";
|
|
7
7
|
import darkThemeJson from "./dark.json" with { type: "json" };
|
|
8
|
-
import
|
|
8
|
+
import defaultThemes from "./defaults.json" with { type: "json" };
|
|
9
9
|
import lightThemeJson from "./light.json" with { type: "json" };
|
|
10
10
|
import type { ColorMode, ThemeBg, ThemeColor, ThemeJson } from "./schema";
|
|
11
11
|
import { normalizeSpinnerFramesOverride, type SymbolPreset } from "./symbols";
|
package/src/theme/symbols.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
|
|
|
2
2
|
/**
|
|
3
3
|
* All available symbol keys organized by category.
|
|
4
4
|
*/
|
|
5
|
-
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted"
|
|
5
|
+
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted"
|
|
6
|
+
/** @deprecated Alias of `status.success`; kept so extensions and theme overrides that name it keep working. */
|
|
7
|
+
| "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "progress.filled" | "progress.empty" | "context.speculation" | "context.compaction" | "context.content" | "context.messages" | "context.buffer" | "context.free" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxDotted.horizontal" | "boxDotted.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.powerlineCapLeft" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.prewalk" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.pin" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.subscription" | "icon.advisor" | "icon.advisorClosed" | "icon.time" | "icon.omp" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.throughput" | "icon.intelligence" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.vimNormal" | "icon.vimInsert" | "icon.vimVisual" | "icon.vimVisualLine" | "icon.vimReplace" | "cmd.action" | "cmd.prompt" | "cmd.extension" | "cmd.settings" | "cmd.gear" | "cmd.shield" | "cmd.wave" | "cmd.compass" | "cmd.inbox" | "cmd.swap" | "cmd.expand" | "cmd.computer" | "cmd.eye" | "cmd.todo" | "cmd.stats" | "cmd.news" | "cmd.keyboard" | "cmd.export" | "cmd.clipboard" | "cmd.share" | "cmd.broadcast" | "cmd.globe" | "cmd.copy" | "cmd.plus" | "cmd.restart" | "cmd.eraser" | "cmd.trash" | "cmd.compress" | "cmd.vibrate" | "cmd.handoff" | "cmd.history" | "cmd.question" | "cmd.rocket" | "cmd.stethoscope" | "cmd.redo" | "cmd.bug" | "cmd.memory" | "cmd.pencil" | "cmd.folderMove" | "cmd.folderPlus" | "cmd.folderMinus" | "cmd.hammer" | "cmd.power" | "cmd.cart" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "skill.rail" | "btw.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "chip.image" | "chip.video" | "chip.paste" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.launch" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move" | "key.ctrl" | "key.ctrlMac" | "key.shift" | "key.alt" | "key.altMac" | "key.super" | "key.superMac" | "key.joiner" | "key.enter" | "key.esc" | "key.tab" | "key.backspace" | "key.delete" | "key.space" | "key.up" | "key.down" | "key.left" | "key.right";
|
|
6
8
|
export type SymbolMap = Record<SymbolKey, string>;
|
|
7
9
|
/**
|
|
8
10
|
* Icon vocabulary for slash-command autocomplete type indicators. Each name
|
package/src/theme/symbols.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type SymbolKey =
|
|
|
19
19
|
| "status.running"
|
|
20
20
|
| "status.shadowed"
|
|
21
21
|
| "status.aborted"
|
|
22
|
+
/** @deprecated Alias of `status.success`; kept so extensions and theme overrides that name it keep working. */
|
|
22
23
|
| "status.done"
|
|
23
24
|
// Navigation
|
|
24
25
|
| "nav.cursor"
|
|
@@ -212,6 +213,8 @@ export type SymbolKey =
|
|
|
212
213
|
| "advisor.rail"
|
|
213
214
|
// Skill callout rail (user turn that opened with a skill chip)
|
|
214
215
|
| "skill.rail"
|
|
216
|
+
// /btw steering-prompt rail (the <inject> block a side answer drafted)
|
|
217
|
+
| "btw.rail"
|
|
215
218
|
// Language/file type icons
|
|
216
219
|
| "lang.default"
|
|
217
220
|
| "lang.typescript"
|
|
@@ -404,7 +407,7 @@ const UNICODE_SYMBOLS: SymbolMap = {
|
|
|
404
407
|
"status.running": "⟳",
|
|
405
408
|
"status.shadowed": "○",
|
|
406
409
|
"status.aborted": "⏹",
|
|
407
|
-
"status.done": "
|
|
410
|
+
"status.done": "✔",
|
|
408
411
|
// Navigation
|
|
409
412
|
"nav.cursor": "❯",
|
|
410
413
|
"nav.selected": "➤",
|
|
@@ -598,6 +601,7 @@ const UNICODE_SYMBOLS: SymbolMap = {
|
|
|
598
601
|
// Advisor note rail (heavier than md.quoteBorder so notes read as a distinct voice)
|
|
599
602
|
"advisor.rail": "▎",
|
|
600
603
|
"skill.rail": "▎",
|
|
604
|
+
"btw.rail": "▎",
|
|
601
605
|
// Language/file icons (emoji-centric, no Nerd Font required)
|
|
602
606
|
"lang.default": "⌘",
|
|
603
607
|
"lang.typescript": "🟦",
|
|
@@ -721,8 +725,8 @@ const NERD_SYMBOLS: SymbolMap = {
|
|
|
721
725
|
"status.shadowed": "\uf10c",
|
|
722
726
|
// pick: | alt:
|
|
723
727
|
"status.aborted": "\uf04d",
|
|
724
|
-
//
|
|
725
|
-
"status.done": "
|
|
728
|
+
// alias of status.success
|
|
729
|
+
"status.done": "\uf00c",
|
|
726
730
|
// Navigation
|
|
727
731
|
// pick: | alt:
|
|
728
732
|
"nav.cursor": "\uf054",
|
|
@@ -1072,6 +1076,7 @@ const NERD_SYMBOLS: SymbolMap = {
|
|
|
1072
1076
|
// pick: ▎ | alt: ┃ │
|
|
1073
1077
|
"advisor.rail": "▎",
|
|
1074
1078
|
"skill.rail": "▎",
|
|
1079
|
+
"btw.rail": "▎",
|
|
1075
1080
|
// Language icons (nerd font devicons)
|
|
1076
1081
|
"lang.default": "",
|
|
1077
1082
|
"lang.typescript": "\u{E628}",
|
|
@@ -1186,17 +1191,17 @@ const NERD_SYMBOLS: SymbolMap = {
|
|
|
1186
1191
|
|
|
1187
1192
|
const ASCII_SYMBOLS: SymbolMap = {
|
|
1188
1193
|
// Status Indicators
|
|
1189
|
-
"status.success": "[
|
|
1190
|
-
"status.error": "[
|
|
1194
|
+
"status.success": "[+]",
|
|
1195
|
+
"status.error": "[-]",
|
|
1191
1196
|
"status.warning": "[!]",
|
|
1192
1197
|
"status.info": "[i]",
|
|
1193
|
-
"status.pending": "[
|
|
1198
|
+
"status.pending": "[ ]",
|
|
1194
1199
|
"status.disabled": "[ ]",
|
|
1195
1200
|
"status.enabled": "[x]",
|
|
1196
1201
|
"status.running": "[~]",
|
|
1197
1202
|
"status.shadowed": "[/]",
|
|
1198
|
-
"status.aborted": "[
|
|
1199
|
-
"status.done": "
|
|
1203
|
+
"status.aborted": "[#]",
|
|
1204
|
+
"status.done": "[+]",
|
|
1200
1205
|
// Navigation
|
|
1201
1206
|
"nav.cursor": ">",
|
|
1202
1207
|
"nav.selected": "->",
|
|
@@ -1386,6 +1391,7 @@ const ASCII_SYMBOLS: SymbolMap = {
|
|
|
1386
1391
|
"md.colorSwatch": "[]",
|
|
1387
1392
|
"advisor.rail": "|",
|
|
1388
1393
|
"skill.rail": "|",
|
|
1394
|
+
"btw.rail": "|",
|
|
1389
1395
|
// Language icons (ASCII uses abbreviations)
|
|
1390
1396
|
"lang.default": "code",
|
|
1391
1397
|
"lang.typescript": "ts",
|
|
@@ -1502,7 +1508,8 @@ export const SPINNER_FRAMES: Record<SymbolPreset, Record<SpinnerType, string[]>>
|
|
|
1502
1508
|
activity: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
|
|
1503
1509
|
},
|
|
1504
1510
|
ascii: {
|
|
1505
|
-
status
|
|
1511
|
+
// Bracketed like the `status.*` glyphs, so a settling call keeps its column width.
|
|
1512
|
+
status: ["[|]", "[/]", "[-]", "[\\]"],
|
|
1506
1513
|
activity: ["-", "\\", "|", "/"],
|
|
1507
1514
|
},
|
|
1508
1515
|
};
|
package/src/theme/theme-class.ts
CHANGED
|
@@ -138,6 +138,15 @@ const LANG_BRAND_COLORS: Partial<Record<SymbolKey, string>> = {
|
|
|
138
138
|
const BACKGROUND_RESET_PATTERN = /\x1b\[(?:0|49)m/g;
|
|
139
139
|
const FOREGROUND_RESET_PATTERN = /\x1b\[(?:0|39)m/g;
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Color `text` with the foreground `ansi`, restoring it after every nested reset so the rest of `text`
|
|
143
|
+
* keeps it (`fg("dim", `${fg("success", "+2")} more`)`); only the foreground is reset at the end.
|
|
144
|
+
*/
|
|
145
|
+
function wrapForeground(ansi: string, text: string): string {
|
|
146
|
+
const body = text.includes("\x1b[") ? text.replace(FOREGROUND_RESET_PATTERN, `$&${ansi}`) : text;
|
|
147
|
+
return `${ansi}${body}\x1b[39m`;
|
|
148
|
+
}
|
|
149
|
+
|
|
141
150
|
// Prebuilt stylers: each `chalk.<style>` access builds a fresh builder. Builders share the
|
|
142
151
|
// root chalk context, so later `chalk.level` changes still apply.
|
|
143
152
|
const boldStyler = chalk.bold;
|
|
@@ -234,6 +243,8 @@ export class Theme {
|
|
|
234
243
|
logger.debug("Invalid symbol key in override", { key, availableKeys: Object.keys(this.#symbols) });
|
|
235
244
|
}
|
|
236
245
|
}
|
|
246
|
+
// `status.done` aliases `status.success` unless a theme overrides it explicitly.
|
|
247
|
+
if (!("status.done" in symbolOverrides)) this.#symbols["status.done"] = this.#symbols["status.success"];
|
|
237
248
|
this.#spinnerFramesOverrides = spinnerFramesOverrides;
|
|
238
249
|
}
|
|
239
250
|
|
|
@@ -350,7 +361,7 @@ export class Theme {
|
|
|
350
361
|
fg(color: ThemeColor, text: string): string {
|
|
351
362
|
const ansi = this.#fgColors[color];
|
|
352
363
|
if (!ansi) throw new Error(`Unknown theme color: ${color}`);
|
|
353
|
-
return
|
|
364
|
+
return wrapForeground(ansi, text);
|
|
354
365
|
}
|
|
355
366
|
|
|
356
367
|
/** Apply a foreground, replacing terminal-default tokens with the theme's contrast-safe fallback. */
|
|
@@ -362,7 +373,7 @@ export class Theme {
|
|
|
362
373
|
resolved = ansi === "\x1b[39m" ? colorToAnsi(this.getColorHex(color), this.mode) : ansi;
|
|
363
374
|
this.#resolvedFgColors.set(color, resolved);
|
|
364
375
|
}
|
|
365
|
-
return
|
|
376
|
+
return wrapForeground(resolved, text);
|
|
366
377
|
}
|
|
367
378
|
|
|
368
379
|
bg(color: ThemeBg, text: string): string {
|
|
@@ -390,7 +401,7 @@ export class Theme {
|
|
|
390
401
|
*/
|
|
391
402
|
fgOnBg(color: ThemeColor, background: ThemeBg, text: string): string {
|
|
392
403
|
const ansi = this.getFgOnBgAnsi(color, background);
|
|
393
|
-
return
|
|
404
|
+
return wrapForeground(ansi, text);
|
|
394
405
|
}
|
|
395
406
|
|
|
396
407
|
bold(text: string): string {
|
|
@@ -519,6 +530,7 @@ export class Theme {
|
|
|
519
530
|
running: this.#symbols["status.running"],
|
|
520
531
|
shadowed: this.#symbols["status.shadowed"],
|
|
521
532
|
aborted: this.#symbols["status.aborted"],
|
|
533
|
+
/** @deprecated Alias of `success`. */
|
|
522
534
|
done: this.#symbols["status.done"],
|
|
523
535
|
};
|
|
524
536
|
}
|
package/src/theme/theme.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { getAvailableThemes, getAvailableThemesWithPaths, getThemeByName, type T
|
|
|
6
6
|
export { isValidThemeColor, type ThemeBg, type ThemeColor } from "./schema";
|
|
7
7
|
export { getAvailableSymbolPresets, isValidSymbolPreset, type SpinnerType, type SymbolKey, type SymbolPreset, } from "./symbols";
|
|
8
8
|
export { Theme } from "./theme-class";
|
|
9
|
-
export { createHighlightStream, getEditorTheme, getMarkdownTheme, getMarkdownThemeWithLinkTargets, getSelectListTheme, getSettingsListTheme, getSymbolTheme, highlightCode, setMarkdownMermaidRendering, warmHighlighter, } from "./tui-adapters";
|
|
9
|
+
export { createHighlightStream, getEditorTheme, getMarkdownTheme, getMarkdownThemeWithLinkTargets, getSelectListTheme, getSettingsListTheme, getSymbolTheme, highlightCode, isHighlightLanguage, setMarkdownMermaidRendering, warmHighlighter, } from "./tui-adapters";
|
|
10
10
|
/**
|
|
11
11
|
* Subscribe to native fallback appearance changes independently of theme changes.
|
|
12
12
|
* Consumers must re-check the effective background: COLORFGBG can override it.
|
|
@@ -114,29 +114,6 @@ export declare function stopThemeWatcher(): void;
|
|
|
114
114
|
* Used by HTML export to generate CSS custom properties.
|
|
115
115
|
*/
|
|
116
116
|
export declare function getResolvedThemeColors(themeName?: string): Promise<Record<string, string>>;
|
|
117
|
-
/** One appearance variant of {@link NativeThemePalette}: token name → `#rrggbb`. */
|
|
118
|
-
export type NativeThemeVariant = Record<string, string>;
|
|
119
|
-
/** omp's resolved theme for a Tern Surface Protocol terminal (the `t` verb body minus `sf`). */
|
|
120
|
-
export interface NativeThemePalette {
|
|
121
|
-
dark?: NativeThemeVariant;
|
|
122
|
-
light?: NativeThemeVariant;
|
|
123
|
-
name: {
|
|
124
|
-
dark?: string;
|
|
125
|
-
light?: string;
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Cheap identity of everything {@link getNativeThemePalette} depends on;
|
|
130
|
-
* recompute the palette only when it changes.
|
|
131
|
-
*/
|
|
132
|
-
export declare function getNativeThemePaletteKey(): string;
|
|
133
|
-
/**
|
|
134
|
-
* omp's theme for a native surface: with auto theme, the configured dark and
|
|
135
|
-
* light themes; otherwise (or while the theme selector previews one) the
|
|
136
|
-
* active theme under its own appearance only. Themes without a loadable
|
|
137
|
-
* definition (in-memory instances) contribute nothing.
|
|
138
|
-
*/
|
|
139
|
-
export declare function getNativeThemePalette(): NativeThemePalette;
|
|
140
117
|
/**
|
|
141
118
|
* Check if a theme is a "light" theme by analyzing its status-line background
|
|
142
119
|
* luminance. Loads theme JSON synchronously (built-in or custom file on disk)
|
package/src/theme/theme.ts
CHANGED
|
@@ -8,16 +8,8 @@ import * as logger from "@linxiraos/pi-utils/logger";
|
|
|
8
8
|
import { isTerminalBackgroundQueryTrusted } from "../terminal-multiplexer";
|
|
9
9
|
import { setActiveSymbolTheme } from "./active-symbols";
|
|
10
10
|
import { ansi256ToHex, resolveThemeColors, resolveVarRefs } from "./color";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
createTheme,
|
|
14
|
-
getBuiltinThemes,
|
|
15
|
-
loadTheme,
|
|
16
|
-
loadThemeJson,
|
|
17
|
-
loadThemeJsonSync,
|
|
18
|
-
loadThemeSync,
|
|
19
|
-
} from "./loader";
|
|
20
|
-
import { isValidThemeBg, isValidThemeColor, type ThemeColor, type ThemeJson } from "./schema";
|
|
11
|
+
import { type CreateThemeOptions, getBuiltinThemes, loadTheme, loadThemeJson, loadThemeSync } from "./loader";
|
|
12
|
+
import { type ThemeColor, type ThemeJson } from "./schema";
|
|
21
13
|
import type { SymbolPreset } from "./symbols";
|
|
22
14
|
import type { Theme } from "./theme-class";
|
|
23
15
|
|
|
@@ -40,6 +32,7 @@ export {
|
|
|
40
32
|
getSettingsListTheme,
|
|
41
33
|
getSymbolTheme,
|
|
42
34
|
highlightCode,
|
|
35
|
+
isHighlightLanguage,
|
|
43
36
|
setMarkdownMermaidRendering,
|
|
44
37
|
warmHighlighter,
|
|
45
38
|
} from "./tui-adapters";
|
|
@@ -843,71 +836,6 @@ export async function getResolvedThemeColors(themeName?: string): Promise<Record
|
|
|
843
836
|
return cssColors;
|
|
844
837
|
}
|
|
845
838
|
|
|
846
|
-
/** One appearance variant of {@link NativeThemePalette}: token name → `#rrggbb`. */
|
|
847
|
-
export type NativeThemeVariant = Record<string, string>;
|
|
848
|
-
|
|
849
|
-
/** omp's resolved theme for a Tern Surface Protocol terminal (the `t` verb body minus `sf`). */
|
|
850
|
-
export interface NativeThemePalette {
|
|
851
|
-
dark?: NativeThemeVariant;
|
|
852
|
-
light?: NativeThemeVariant;
|
|
853
|
-
name: { dark?: string; light?: string };
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* Cheap identity of everything {@link getNativeThemePalette} depends on;
|
|
858
|
-
* recompute the palette only when it changes.
|
|
859
|
-
*/
|
|
860
|
-
export function getNativeThemePaletteKey(): string {
|
|
861
|
-
return `${themeEpoch}|${autoDetectedTheme}|${autoDarkTheme}|${autoLightTheme}|${currentThemeName}|${previewThemeName}|${currentColorBlindMode}`;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
/** Every token of theme `name` as hex (terminal-default tokens omitted), plus its export colours. */
|
|
865
|
-
function nativeThemeVariant(name: string): { light: boolean; colors: NativeThemeVariant } {
|
|
866
|
-
const themeJson = loadThemeJsonSync(name);
|
|
867
|
-
const built = createTheme(themeJson, getCurrentThemeOptions());
|
|
868
|
-
const raw = resolveThemeColors(themeJson.colors, themeJson.vars);
|
|
869
|
-
const colors: NativeThemeVariant = {};
|
|
870
|
-
for (const key in raw) {
|
|
871
|
-
// Terminal-default tokens stay unset; keys outside the schema are ignored like the theme does.
|
|
872
|
-
if (raw[key as keyof typeof raw] === "") continue;
|
|
873
|
-
if (isValidThemeColor(key)) colors[key] = built.getColorHex(key);
|
|
874
|
-
else if (isValidThemeBg(key)) colors[key] = built.getBgHex(key);
|
|
875
|
-
}
|
|
876
|
-
const exported = resolveThemeExportColors(themeJson);
|
|
877
|
-
for (const key of ["pageBg", "cardBg", "infoBg"] as const) {
|
|
878
|
-
const value = exported[key];
|
|
879
|
-
if (value) colors[key] = value;
|
|
880
|
-
}
|
|
881
|
-
return { light: isLightThemeJson(themeJson), colors };
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
/**
|
|
885
|
-
* omp's theme for a native surface: with auto theme, the configured dark and
|
|
886
|
-
* light themes; otherwise (or while the theme selector previews one) the
|
|
887
|
-
* active theme under its own appearance only. Themes without a loadable
|
|
888
|
-
* definition (in-memory instances) contribute nothing.
|
|
889
|
-
*/
|
|
890
|
-
export function getNativeThemePalette(): NativeThemePalette {
|
|
891
|
-
const palette: NativeThemePalette = { name: {} };
|
|
892
|
-
const add = (name: string, as?: "dark" | "light"): void => {
|
|
893
|
-
try {
|
|
894
|
-
const variant = nativeThemeVariant(name);
|
|
895
|
-
const slot = as ?? (variant.light ? "light" : "dark");
|
|
896
|
-
palette[slot] = variant.colors;
|
|
897
|
-
palette.name[slot] = name;
|
|
898
|
-
} catch (error) {
|
|
899
|
-
logger.debug("Native theme palette: theme not loadable", { name, error: String(error) });
|
|
900
|
-
}
|
|
901
|
-
};
|
|
902
|
-
const single = previewThemeName ?? (autoDetectedTheme ? undefined : currentThemeName);
|
|
903
|
-
if (single !== undefined) add(single);
|
|
904
|
-
else {
|
|
905
|
-
add(autoDarkTheme, "dark");
|
|
906
|
-
add(autoLightTheme, "light");
|
|
907
|
-
}
|
|
908
|
-
return palette;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
839
|
/**
|
|
912
840
|
* Check if a theme is a "light" theme by analyzing its status-line background
|
|
913
841
|
* luminance. Loads theme JSON synchronously (built-in or custom file on disk)
|
|
@@ -6,6 +6,8 @@ import type { SettingsListTheme } from "../components/settings-list";
|
|
|
6
6
|
import type { SymbolTheme } from "../symbols";
|
|
7
7
|
import type { SlashCommandIconName } from "./symbols";
|
|
8
8
|
import type { Theme } from "./theme-class";
|
|
9
|
+
/** Whether {@link highlightCode} colors `lang`; text in any other language comes back unstyled. */
|
|
10
|
+
export declare function isHighlightLanguage(lang: string | undefined): lang is string;
|
|
9
11
|
/**
|
|
10
12
|
* Highlight code with syntax coloring based on file extension or language.
|
|
11
13
|
* Returns array of highlighted lines.
|
|
@@ -96,12 +96,17 @@ function highlightCached(code: string, validLang: string | undefined, highlightT
|
|
|
96
96
|
return highlighted;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/** Whether {@link highlightCode} colors `lang`; text in any other language comes back unstyled. */
|
|
100
|
+
export function isHighlightLanguage(lang: string | undefined): lang is string {
|
|
101
|
+
return lang !== undefined && nativeSupportsLanguage(lang);
|
|
102
|
+
}
|
|
103
|
+
|
|
99
104
|
/**
|
|
100
105
|
* Highlight code with syntax coloring based on file extension or language.
|
|
101
106
|
* Returns array of highlighted lines.
|
|
102
107
|
*/
|
|
103
108
|
export function highlightCode(code: string, lang?: string, highlightTheme: Theme = theme): string[] {
|
|
104
|
-
const validLang =
|
|
109
|
+
const validLang = isHighlightLanguage(lang) ? lang : undefined;
|
|
105
110
|
const highlighted = highlightCached(code, validLang, highlightTheme);
|
|
106
111
|
// Always return a fresh array: callers (e.g. renderCodeCell) push extra lines
|
|
107
112
|
// onto the result, which would corrupt the cached string otherwise.
|
|
@@ -110,7 +115,7 @@ export function highlightCode(code: string, lang?: string, highlightTheme: Theme
|
|
|
110
115
|
|
|
111
116
|
/** Create a stateful highlighter for progressive terminal rendering. */
|
|
112
117
|
export function createHighlightStream(lang?: string, highlightTheme: Theme = theme): NativeHighlightStream | null {
|
|
113
|
-
const validLang =
|
|
118
|
+
const validLang = isHighlightLanguage(lang) ? lang : undefined;
|
|
114
119
|
if (!validLang) return null;
|
|
115
120
|
// Workspace loads skip the natives version sentinel, so a stale local
|
|
116
121
|
// `.node` can omit `HighlightStream` after a pull. Napi constructors can
|
|
@@ -305,7 +310,7 @@ export function getMarkdownTheme(): MarkdownTheme {
|
|
|
305
310
|
})
|
|
306
311
|
: undefined,
|
|
307
312
|
highlightCode: (code: string, lang?: string): string[] => {
|
|
308
|
-
const validLang =
|
|
313
|
+
const validLang = isHighlightLanguage(lang) ? lang : undefined;
|
|
309
314
|
const highlighted = highlightCached(code, validLang, theme);
|
|
310
315
|
if (highlighted !== null) return highlighted.split("\n");
|
|
311
316
|
return code.split("\n").map(line => theme.fg("mdCodeBlock", line));
|
package/src/thinking.d.ts
CHANGED
|
@@ -137,12 +137,12 @@ export type TaskEffort = (typeof TASK_EFFORTS)[number];
|
|
|
137
137
|
export declare function resolveTaskEffortLevel(model: Model | undefined, effort: TaskEffort, maxEffort?: Effort): Effort | undefined;
|
|
138
138
|
/**
|
|
139
139
|
* Clamps a concrete thinking selector to a per-session effort ceiling (e.g. a
|
|
140
|
-
* task spawn's `task.maxEffort
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
140
|
+
* task spawn's `task.maxEffort`). Unset/`inherit`/`off` retain their existing
|
|
141
|
+
* meaning, as do levels already at or below the ceiling. Levels above it snap
|
|
142
|
+
* to the highest model-supported effort at or below the ceiling. A model whose
|
|
143
|
+
* floor exceeds the ceiling has nothing valid to snap to; the requested level
|
|
144
|
+
* is returned unchanged and the caller must reject or skip such models (see
|
|
145
|
+
* {@link modelSupportsEffortCeiling}).
|
|
146
146
|
*/
|
|
147
147
|
export declare function clampThinkingLevelToCeiling(model: Model | undefined, level: Effort | undefined, ceiling: Effort | undefined): Effort | undefined;
|
|
148
148
|
export declare function clampThinkingLevelToCeiling(model: Model | undefined, level: ThinkingLevel | undefined, ceiling: Effort | undefined): ThinkingLevel | undefined;
|
|
@@ -153,6 +153,8 @@ export declare function clampThinkingLevelToCeiling(model: Model | undefined, le
|
|
|
153
153
|
* skip models whose floor would force the session above the ceiling.
|
|
154
154
|
*/
|
|
155
155
|
export declare function modelSupportsEffortCeiling(model: Model, ceiling: Effort): boolean;
|
|
156
|
+
/** Throws when `model` has no supported effort at or below `task.maxEffort`, so a capped spawn fails instead of running at its floor. */
|
|
157
|
+
export declare function assertModelSupportsEffortCeiling(model: Model, maxEffort: Effort): void;
|
|
156
158
|
/**
|
|
157
159
|
* The provisional concrete level shown while `auto` is configured but before a
|
|
158
160
|
* turn has been classified, and the fallback when classification fails. Prefers
|
package/src/thinking.ts
CHANGED
|
@@ -312,23 +312,21 @@ export function resolveTaskEffortLevel(
|
|
|
312
312
|
break;
|
|
313
313
|
}
|
|
314
314
|
if (maxEffort === undefined) return resolved;
|
|
315
|
+
if (model) assertModelSupportsEffortCeiling(model, maxEffort);
|
|
315
316
|
const maxIndex = THINKING_EFFORTS.indexOf(maxEffort);
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
const modelName = model ? `${model.provider}/${model.id}` : "Selected model";
|
|
319
|
-
throw new RangeError(`${modelName} has no supported thinking effort at or below task.maxEffort=${maxEffort}`);
|
|
320
|
-
}
|
|
317
|
+
// Without a model the full canonical range always holds `maxEffort` itself.
|
|
318
|
+
const ceiling = supported.findLast(candidate => THINKING_EFFORTS.indexOf(candidate) <= maxIndex) ?? maxEffort;
|
|
321
319
|
return THINKING_EFFORTS.indexOf(resolved) > THINKING_EFFORTS.indexOf(ceiling) ? ceiling : resolved;
|
|
322
320
|
}
|
|
323
321
|
|
|
324
322
|
/**
|
|
325
323
|
* Clamps a concrete thinking selector to a per-session effort ceiling (e.g. a
|
|
326
|
-
* task spawn's `task.maxEffort
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
324
|
+
* task spawn's `task.maxEffort`). Unset/`inherit`/`off` retain their existing
|
|
325
|
+
* meaning, as do levels already at or below the ceiling. Levels above it snap
|
|
326
|
+
* to the highest model-supported effort at or below the ceiling. A model whose
|
|
327
|
+
* floor exceeds the ceiling has nothing valid to snap to; the requested level
|
|
328
|
+
* is returned unchanged and the caller must reject or skip such models (see
|
|
329
|
+
* {@link modelSupportsEffortCeiling}).
|
|
332
330
|
*/
|
|
333
331
|
export function clampThinkingLevelToCeiling(
|
|
334
332
|
model: Model | undefined,
|
|
@@ -367,6 +365,14 @@ export function modelSupportsEffortCeiling(model: Model, ceiling: Effort): boole
|
|
|
367
365
|
return supported.some(candidate => THINKING_EFFORTS.indexOf(candidate) <= maxIndex);
|
|
368
366
|
}
|
|
369
367
|
|
|
368
|
+
/** Throws when `model` has no supported effort at or below `task.maxEffort`, so a capped spawn fails instead of running at its floor. */
|
|
369
|
+
export function assertModelSupportsEffortCeiling(model: Model, maxEffort: Effort): void {
|
|
370
|
+
if (modelSupportsEffortCeiling(model, maxEffort)) return;
|
|
371
|
+
throw new RangeError(
|
|
372
|
+
`${model.provider}/${model.id} has no supported thinking effort at or below task.maxEffort=${maxEffort}`,
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
|
|
370
376
|
/**
|
|
371
377
|
* The provisional concrete level shown while `auto` is configured but before a
|
|
372
378
|
* turn has been classified, and the fallback when classification fails. Prefers
|
package/src/tmux.ts
CHANGED
|
@@ -21,6 +21,7 @@ const CLIENT_TERMINAL_TIMEOUT_MS = 2_000;
|
|
|
21
21
|
const CLIENT_TERMNAME_PROGRAMS: ReadonlyArray<readonly [RegExp, string]> = [
|
|
22
22
|
[/^xterm-kitty$/u, "kitty"],
|
|
23
23
|
[/^xterm-ghostty$/u, "ghostty"],
|
|
24
|
+
[/^xterm-rex$/u, "rex"],
|
|
24
25
|
[/^wezterm$/u, "wezterm"],
|
|
25
26
|
];
|
|
26
27
|
let cachedClientTerminalNames: readonly string[] | undefined;
|
package/src/tools/agent-tree.ts
CHANGED
|
@@ -74,20 +74,22 @@ export function renderAgentTreeRow(
|
|
|
74
74
|
const task = options.presentation === "task";
|
|
75
75
|
const live = status === "pending" || status === "running";
|
|
76
76
|
const failed = status === "failed" || status === "aborted";
|
|
77
|
-
const iconColor = status === "completed" ? "success" : failed ? "error" : "accent";
|
|
78
77
|
const nameColor = task && live && options.frozen ? "dim" : task && status === "completed" ? "text" : "accent";
|
|
79
|
-
const iconStatus = status === "failed" ? "error" : status === "completed" ? "
|
|
78
|
+
const iconStatus = status === "failed" ? "error" : status === "completed" ? "success" : status;
|
|
79
|
+
// Task rows draw a static glyph, so their bytes hold across spinner frames; eval rows animate.
|
|
80
|
+
const spinnerFrame = !task && status === "running" ? options.spinnerFrame : undefined;
|
|
81
|
+
// formatStatusIcon colors every glyph except a raw spinner frame, which eval rows paint accent.
|
|
82
|
+
// A frozen snapshot of a live Task row dims its glyph with its name, so it stops reading as in flight.
|
|
80
83
|
const icon =
|
|
81
|
-
task &&
|
|
82
|
-
? theme.styledSymbol("
|
|
83
|
-
:
|
|
84
|
-
? theme.
|
|
85
|
-
:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
);
|
|
84
|
+
!task && status === "completed"
|
|
85
|
+
? theme.styledSymbol("tool.eval", "accent")
|
|
86
|
+
: task && live && options.frozen
|
|
87
|
+
? theme.fg("dim", status === "running" ? theme.status.running : theme.status.pending)
|
|
88
|
+
: spinnerFrame === undefined
|
|
89
|
+
? formatStatusIcon(iconStatus, theme)
|
|
90
|
+
: theme.fg("accent", formatStatusIcon(iconStatus, theme, spinnerFrame));
|
|
89
91
|
const lead = `${options.prefix}${options.prefix || !task ? " " : ""}${icon} `;
|
|
90
|
-
const statusBadge = options.statusBadge ?? (failed ? ` ${formatBadge(status,
|
|
92
|
+
const statusBadge = options.statusBadge ?? (failed ? ` ${formatBadge(status, "error", theme)}` : "");
|
|
91
93
|
const id = Number.isFinite(width)
|
|
92
94
|
? truncateToWidth(options.id, Math.max(0, width - visibleWidth(lead) - visibleWidth(statusBadge)))
|
|
93
95
|
: options.id;
|