@linxiraos/pi-tui 1.4.4 → 1.4.7
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 +208 -207
- package/README.md +34 -34
- 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/chat/assistant-message.d.ts +15 -3
- package/dist/types/chat/bash-execution.d.ts +2 -0
- package/dist/types/chat/display-preferences.d.ts +2 -0
- package/dist/types/chat/extension-types.d.ts +31 -0
- package/dist/types/chat/reply-write.d.ts +48 -0
- package/dist/types/chat/table-chart.d.ts +4 -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 +2 -0
- package/dist/types/chrome/context-map.d.ts +15 -0
- package/dist/types/chrome/context-presentation.d.ts +48 -0
- package/dist/types/chrome/context-view-model.d.ts +77 -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 +20 -8
- package/dist/types/components/editor.d.ts +8 -0
- package/dist/types/components/image.d.ts +20 -0
- package/dist/types/components/loader.d.ts +1 -1
- package/dist/types/components/markdown.d.ts +7 -0
- package/dist/types/native/blobs.d.ts +11 -1
- package/dist/types/native/picker.d.ts +4 -4
- package/dist/types/overlays/advisor-config.d.ts +6 -0
- package/dist/types/overlays/agent-hub-projection.d.ts +3 -1
- package/dist/types/overlays/annotation-overlay.d.ts +7 -1
- package/dist/types/overlays/annotation-types.d.ts +28 -0
- package/dist/types/overlays/ask-dialog.d.ts +12 -3
- package/dist/types/overlays/btw-history-panel.d.ts +16 -2
- package/dist/types/overlays/btw-history.d.ts +7 -0
- package/dist/types/overlays/btw-panel.d.ts +2 -0
- package/dist/types/overlays/context-viewer-format.d.ts +42 -0
- package/dist/types/overlays/context-viewer-overview.d.ts +70 -0
- package/dist/types/overlays/context-viewer.d.ts +25 -0
- package/dist/types/overlays/hook-input.d.ts +1 -0
- package/dist/types/overlays/login-dialog.d.ts +5 -1
- package/dist/types/overlays/mcp-add-wizard.d.ts +2 -0
- package/dist/types/overlays/model-browser.d.ts +10 -1
- package/dist/types/overlays/oauth-selector.d.ts +23 -0
- package/dist/types/overlays/pause-screen.d.ts +13 -3
- 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/running-subagent-badge.d.ts +7 -1
- package/dist/types/overlays/session-selector.d.ts +22 -2
- package/dist/types/prompt/composer.d.ts +43 -0
- package/dist/types/prompt/interactive-context-helpers.d.ts +10 -3
- package/dist/types/prompt/macos-spelling.d.ts +2 -2
- package/dist/types/render/extension-links.d.ts +65 -0
- package/dist/types/render/hyperlink.d.ts +38 -7
- package/dist/types/render/index.d.ts +1 -0
- package/dist/types/render/output-pane.d.ts +1 -1
- package/dist/types/render/render-utils.d.ts +7 -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 +3 -3
- package/dist/types/status-line/context-usage.d.ts +42 -35
- package/dist/types/status-line/host.d.ts +6 -2
- package/dist/types/terminal-capabilities.d.ts +7 -0
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/theme/theme.d.ts +0 -23
- package/dist/types/tools/ask.d.ts +4 -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/edit.d.ts +3 -1
- package/dist/types/tools/fetch.d.ts +1 -0
- package/dist/types/tools/github.d.ts +3 -0
- package/dist/types/tools/grouped-file-output.d.ts +2 -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 +7 -6
- package/dist/types/tools/native-view.d.ts +1 -1
- package/dist/types/tools/read.d.ts +3 -0
- 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 +9 -1
- package/dist/types/tools/url-scheme-host.d.ts +17 -0
- package/dist/types/tools/wait.d.ts +16 -2
- package/dist/types/tools/yield.d.ts +1 -1
- package/dist/types/tui.d.ts +9 -2
- package/dist/types/vim.d.ts +39 -0
- package/package.json +10 -14
- package/src/app-keybindings.d.ts +20 -0
- package/src/app-keybindings.ts +20 -0
- package/src/apps/session-picker.ts +7 -0
- package/src/charts/chart-plan.d.ts +9 -7
- package/src/charts/chart-plan.ts +20 -50
- 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 +2 -0
- package/src/chat/bash-execution.ts +13 -1
- package/src/chat/chat-transcript-builder.ts +58 -28
- 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/extension-types.d.ts +31 -0
- package/src/chat/extension-types.ts +34 -0
- package/src/chat/read-tool-group.ts +1 -2
- package/src/chat/reply-write.d.ts +48 -0
- package/src/chat/reply-write.ts +127 -0
- package/src/chat/skill-message.ts +2 -6
- package/src/chat/table-chart.d.ts +4 -3
- package/src/chat/table-chart.ts +10 -4
- 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 +2 -0
- package/src/chat/transcript-render-helpers.ts +66 -24
- package/src/chrome/context-map.ts +62 -0
- package/src/chrome/context-presentation.ts +26 -0
- package/src/chrome/context-view-model.ts +73 -0
- package/src/chrome/index.ts +1 -0
- package/src/chrome/transcript-container.ts +89 -59
- package/src/chrome/transcript-notice.d.ts +35 -0
- package/src/chrome/transcript-notice.ts +83 -0
- package/src/chrome/transcript-status.d.ts +20 -8
- package/src/chrome/transcript-status.ts +29 -29
- package/src/components/editor.d.ts +8 -0
- package/src/components/editor.ts +465 -14
- package/src/components/image.d.ts +20 -0
- package/src/components/image.ts +83 -18
- package/src/components/loader.d.ts +1 -1
- package/src/components/loader.ts +1 -1
- package/src/components/markdown.d.ts +7 -0
- package/src/components/markdown.ts +225 -13
- package/src/hotkeys-markdown.ts +2 -0
- package/src/native/backend.ts +5 -66
- package/src/native/blobs.d.ts +11 -1
- package/src/native/blobs.ts +5 -3
- package/src/native/picker.d.ts +4 -4
- package/src/native/picker.ts +4 -4
- package/src/overlays/advisor-config.ts +10 -12
- package/src/overlays/agent-hub-projection.d.ts +3 -1
- package/src/overlays/agent-hub-projection.ts +6 -5
- package/src/overlays/agent-hub.ts +51 -42
- package/src/overlays/annotation-overlay.ts +125 -37
- package/src/overlays/annotation-types.ts +24 -0
- package/src/overlays/ask-dialog.ts +125 -35
- package/src/overlays/btw-history-panel.ts +124 -12
- package/src/overlays/btw-history.ts +11 -0
- package/src/overlays/btw-panel.ts +8 -4
- package/src/overlays/context-viewer-format.ts +145 -0
- package/src/overlays/context-viewer-overview.ts +381 -0
- package/src/overlays/context-viewer.ts +728 -0
- package/src/overlays/hook-input.ts +2 -0
- package/src/overlays/hook-selector.ts +2 -2
- package/src/overlays/login-dialog.ts +31 -5
- package/src/overlays/mcp-add-wizard.ts +6 -1
- package/src/overlays/model-browser.ts +37 -0
- 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/pause-screen.ts +166 -33
- package/src/overlays/plan-review-overlay.ts +13 -2
- package/src/overlays/rewind-selector.ts +29 -12
- package/src/overlays/running-subagent-badge.ts +12 -1
- package/src/overlays/session-selector.ts +313 -42
- package/src/overlays/settings-defs.ts +1 -0
- package/src/overlays/usage-dashboard.ts +20 -14
- package/src/prompt/composer.ts +216 -1
- 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/prompt/macos-spelling.ts +24 -15
- package/src/render/extension-links.d.ts +65 -0
- package/src/render/extension-links.ts +214 -0
- package/src/render/hyperlink.d.ts +38 -7
- package/src/render/hyperlink.ts +102 -23
- package/src/render/index.d.ts +1 -0
- package/src/render/index.ts +1 -0
- package/src/render/output-pane.d.ts +1 -1
- package/src/render/output-pane.ts +60 -17
- package/src/render/render-utils.d.ts +7 -1
- package/src/render/render-utils.ts +11 -2
- package/src/setup/scenes/composer.ts +2 -0
- package/src/setup/scenes/glyph.ts +3 -1
- package/src/setup/scenes/model.ts +192 -29
- package/src/setup/scenes/outro.ts +33 -15
- package/src/setup/scenes/sign-in.ts +194 -392
- 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 +10 -14
- package/src/status-line/context-usage.ts +122 -597
- package/src/status-line/host.ts +6 -2
- package/src/terminal-capabilities.d.ts +7 -0
- package/src/terminal-capabilities.ts +10 -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 +1 -1
- package/src/theme/symbols.ts +16 -0
- package/src/theme/theme.d.ts +0 -23
- package/src/theme/theme.ts +2 -75
- package/src/tools/ask.d.ts +4 -0
- package/src/tools/ask.ts +4 -0
- package/src/tools/ast-grep.ts +3 -2
- 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 +7 -23
- package/src/tools/default-renderer.d.ts +6 -4
- package/src/tools/default-renderer.ts +9 -6
- package/src/tools/edit.d.ts +3 -1
- package/src/tools/edit.ts +8 -4
- package/src/tools/eval.ts +14 -4
- package/src/tools/fetch.d.ts +1 -0
- package/src/tools/fetch.ts +1 -0
- package/src/tools/find.ts +3 -10
- package/src/tools/github.d.ts +3 -0
- package/src/tools/github.ts +23 -3
- package/src/tools/glob.ts +4 -3
- package/src/tools/grep.ts +3 -4
- package/src/tools/grouped-file-output.d.ts +2 -0
- package/src/tools/grouped-file-output.ts +8 -2
- 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 -42
- package/src/tools/lsp.d.ts +2 -0
- package/src/tools/lsp.ts +36 -15
- package/src/tools/mcp.d.ts +7 -6
- package/src/tools/mcp.ts +41 -15
- package/src/tools/native-view.d.ts +1 -1
- package/src/tools/native-view.ts +3 -3
- package/src/tools/read.d.ts +3 -0
- package/src/tools/read.ts +3 -1
- 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 +9 -1
- package/src/tools/task.ts +59 -16
- package/src/tools/url-scheme-host.d.ts +17 -0
- package/src/tools/url-scheme-host.ts +21 -0
- package/src/tools/vibe.ts +14 -3
- package/src/tools/wait.d.ts +16 -2
- package/src/tools/wait.ts +16 -2
- package/src/tools/yield.d.ts +1 -1
- package/src/tools/yield.ts +18 -9
- package/src/tui.d.ts +9 -2
- package/src/tui.ts +102 -34
- package/src/vim.d.ts +39 -0
- package/src/vim.ts +313 -22
- 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,7 @@ 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" | "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" | "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" | "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";
|
|
5
|
+
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "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" | "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
6
|
export type SymbolMap = Record<SymbolKey, string>;
|
|
7
7
|
/**
|
|
8
8
|
* Icon vocabulary for slash-command autocomplete type indicators. Each name
|
package/src/theme/symbols.ts
CHANGED
|
@@ -38,6 +38,10 @@ export type SymbolKey =
|
|
|
38
38
|
// Context gauge boundaries
|
|
39
39
|
| "context.speculation"
|
|
40
40
|
| "context.compaction"
|
|
41
|
+
| "context.content"
|
|
42
|
+
| "context.messages"
|
|
43
|
+
| "context.buffer"
|
|
44
|
+
| "context.free"
|
|
41
45
|
// Box Drawing - Rounded
|
|
42
46
|
| "boxRound.topLeft"
|
|
43
47
|
| "boxRound.topRight"
|
|
@@ -419,6 +423,10 @@ const UNICODE_SYMBOLS: SymbolMap = {
|
|
|
419
423
|
// Context gauge boundaries
|
|
420
424
|
"context.speculation": "╎",
|
|
421
425
|
"context.compaction": "┃",
|
|
426
|
+
"context.content": "⛁",
|
|
427
|
+
"context.messages": "⛃",
|
|
428
|
+
"context.buffer": "⛝",
|
|
429
|
+
"context.free": "⛶",
|
|
422
430
|
// Box (rounded)
|
|
423
431
|
"boxRound.topLeft": "╭",
|
|
424
432
|
"boxRound.topRight": "╮",
|
|
@@ -745,6 +753,10 @@ const NERD_SYMBOLS: SymbolMap = {
|
|
|
745
753
|
// Context gauge boundaries — vector intersection starts async speculation; auto-fix applies compaction.
|
|
746
754
|
"context.speculation": "\u{f055d}",
|
|
747
755
|
"context.compaction": "\u{f0068}",
|
|
756
|
+
"context.content": "⛁",
|
|
757
|
+
"context.messages": "⛃",
|
|
758
|
+
"context.buffer": "⛝",
|
|
759
|
+
"context.free": "⛶",
|
|
748
760
|
// Box Drawing - Rounded (same as unicode)
|
|
749
761
|
// pick: ╭ | alt: ┌ ┏ ╔
|
|
750
762
|
"boxRound.topLeft": "╭",
|
|
@@ -1203,6 +1215,10 @@ const ASCII_SYMBOLS: SymbolMap = {
|
|
|
1203
1215
|
// Context gauge boundaries
|
|
1204
1216
|
"context.speculation": ":",
|
|
1205
1217
|
"context.compaction": "|",
|
|
1218
|
+
"context.content": "#",
|
|
1219
|
+
"context.messages": "@",
|
|
1220
|
+
"context.buffer": "x",
|
|
1221
|
+
"context.free": ".",
|
|
1206
1222
|
// Box Drawing - Rounded (ASCII fallback)
|
|
1207
1223
|
"boxRound.topLeft": "+",
|
|
1208
1224
|
"boxRound.topRight": "+",
|
package/src/theme/theme.d.ts
CHANGED
|
@@ -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
|
|
|
@@ -843,71 +835,6 @@ export async function getResolvedThemeColors(themeName?: string): Promise<Record
|
|
|
843
835
|
return cssColors;
|
|
844
836
|
}
|
|
845
837
|
|
|
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
838
|
/**
|
|
912
839
|
* Check if a theme is a "light" theme by analyzing its status-line background
|
|
913
840
|
* luminance. Loads theme JSON synchronously (built-in or custom file on disk)
|
package/src/tools/ask.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface QuestionResult {
|
|
|
12
12
|
customInput?: string;
|
|
13
13
|
/** Optional note attached to the selected answer in the rich ask dialog. */
|
|
14
14
|
note?: string;
|
|
15
|
+
/** Label of the option the note is on; unset when it is on the custom answer. */
|
|
16
|
+
noteOption?: string;
|
|
15
17
|
/** True when the answer was auto-selected because the dialog timed out. */
|
|
16
18
|
timedOut?: boolean;
|
|
17
19
|
}
|
|
@@ -24,6 +26,8 @@ export interface AskToolDetails {
|
|
|
24
26
|
customInput?: string;
|
|
25
27
|
/** Optional note attached to the selected answer in the rich ask dialog. */
|
|
26
28
|
note?: string;
|
|
29
|
+
/** Label of the option the note is on; unset when it is on the custom answer. */
|
|
30
|
+
noteOption?: string;
|
|
27
31
|
/** True when the answer was auto-selected because the dialog timed out. */
|
|
28
32
|
timedOut?: boolean;
|
|
29
33
|
/** Multi-part question mode */
|
package/src/tools/ask.ts
CHANGED
|
@@ -38,6 +38,8 @@ export interface QuestionResult {
|
|
|
38
38
|
customInput?: string;
|
|
39
39
|
/** Optional note attached to the selected answer in the rich ask dialog. */
|
|
40
40
|
note?: string;
|
|
41
|
+
/** Label of the option the note is on; unset when it is on the custom answer. */
|
|
42
|
+
noteOption?: string;
|
|
41
43
|
/** True when the answer was auto-selected because the dialog timed out. */
|
|
42
44
|
timedOut?: boolean;
|
|
43
45
|
}
|
|
@@ -51,6 +53,8 @@ export interface AskToolDetails {
|
|
|
51
53
|
customInput?: string;
|
|
52
54
|
/** Optional note attached to the selected answer in the rich ask dialog. */
|
|
53
55
|
note?: string;
|
|
56
|
+
/** Label of the option the note is on; unset when it is on the custom answer. */
|
|
57
|
+
noteOption?: string;
|
|
54
58
|
/** True when the answer was auto-selected because the dialog timed out. */
|
|
55
59
|
timedOut?: boolean;
|
|
56
60
|
/** Multi-part question mode */
|
package/src/tools/ast-grep.ts
CHANGED
|
@@ -2,10 +2,11 @@ import { isRecord, sanitizeText } from "@linxiraos/pi-utils";
|
|
|
2
2
|
import type { Component } from "../tui";
|
|
3
3
|
import { Text } from "../components/text";
|
|
4
4
|
import type { Theme } from "../theme/theme";
|
|
5
|
-
import {
|
|
5
|
+
import { fileHyperlink, renderStatusLine, renderTreeList } from "../render";
|
|
6
6
|
import {
|
|
7
7
|
appendParseErrorsBulletList,
|
|
8
8
|
createCachedComponent,
|
|
9
|
+
fitHeaderedRows,
|
|
9
10
|
formatCount,
|
|
10
11
|
formatEmptyMessage,
|
|
11
12
|
formatErrorMessage,
|
|
@@ -205,7 +206,7 @@ export const astGrepToolRenderer = {
|
|
|
205
206
|
},
|
|
206
207
|
uiTheme,
|
|
207
208
|
);
|
|
208
|
-
return
|
|
209
|
+
return fitHeaderedRows(header, [...matchLines, ...extraLines], width);
|
|
209
210
|
},
|
|
210
211
|
);
|
|
211
212
|
},
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type * as XtermModule from "@linxiraos/pi-utils/vterm";
|
|
2
|
+
import type { Component } from "../tui";
|
|
3
|
+
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node";
|
|
4
|
+
import type { Theme } from "../theme/theme";
|
|
5
|
+
/** Resize-only backend exposed by an interactive PTY controller. */
|
|
6
|
+
export interface BashInteractiveTerminalBackend {
|
|
7
|
+
resize(columns: number, rows: number): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Translates a TUI key event into the bytes a terminal would send to a PTY
|
|
11
|
+
* child; key releases encode to "". Shared by the agent `pty` console and
|
|
12
|
+
* `!` commands (`BashExecutionComponent.encodePtyInput`).
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizeInputForPty(data: string, applicationCursorKeysMode: boolean): string;
|
|
15
|
+
/** Interactive terminal overlay driven by an external PTY controller. */
|
|
16
|
+
export declare class BashInteractiveOverlayComponent implements Component {
|
|
17
|
+
#private;
|
|
18
|
+
/** Native sheet: a full-pane glass overlay titled Console. */
|
|
19
|
+
readonly nativeOverlay: {
|
|
20
|
+
readonly role: "zeta.overlay.console";
|
|
21
|
+
readonly size: "full";
|
|
22
|
+
readonly head: "Console";
|
|
23
|
+
};
|
|
24
|
+
constructor(command: string, uiTheme: Theme, getTerminalRows: () => number, terminalCtor: typeof XtermModule.Terminal, backend: BashInteractiveTerminalBackend);
|
|
25
|
+
/** Connects normalized keyboard input and overlay lifecycle events to the controller. */
|
|
26
|
+
setHandlers(onInput: (data: string) => void, onDismiss: () => void, onDispose: () => void): void;
|
|
27
|
+
/** Queues a raw terminal output chunk for virtual-terminal rendering. */
|
|
28
|
+
appendOutput(chunk: string): void;
|
|
29
|
+
/** Resolves when the virtual terminal has processed all queued output. */
|
|
30
|
+
flushOutput(): Promise<void>;
|
|
31
|
+
/** Records process completion and stops forwarding keyboard input. */
|
|
32
|
+
setComplete(result: {
|
|
33
|
+
exitCode: number | undefined;
|
|
34
|
+
cancelled: boolean;
|
|
35
|
+
timedOut: boolean;
|
|
36
|
+
}): void;
|
|
37
|
+
handleInput(data: string): void;
|
|
38
|
+
/** The Force kill button runs the Esc path. */
|
|
39
|
+
handleNativeEvent(event: NativeUiEvent): void;
|
|
40
|
+
/**
|
|
41
|
+
* Native view: the command with its state badge, the PTY screen as an
|
|
42
|
+
* `ansi` node (SGR kept, fixed to the PTY grid), and a footer with the
|
|
43
|
+
* Force kill action while running.
|
|
44
|
+
*/
|
|
45
|
+
describe(cx: DescribeContext): NativeNode;
|
|
46
|
+
render(width: number): readonly string[];
|
|
47
|
+
invalidate(): void;
|
|
48
|
+
dispose(): void;
|
|
49
|
+
}
|
|
@@ -25,7 +25,12 @@ const NATIVE_SHEET_INSET_COLS = 8;
|
|
|
25
25
|
// Action id of the native Force kill button (mirrors Esc).
|
|
26
26
|
const KILL_ACTION = "kill";
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Translates a TUI key event into the bytes a terminal would send to a PTY
|
|
30
|
+
* child; key releases encode to "". Shared by the agent `pty` console and
|
|
31
|
+
* `!` commands (`BashExecutionComponent.encodePtyInput`).
|
|
32
|
+
*/
|
|
33
|
+
export function normalizeInputForPty(data: string, applicationCursorKeysMode: boolean): string {
|
|
29
34
|
const kitty = parseKittySequence(data);
|
|
30
35
|
if (kitty?.eventType === 3) {
|
|
31
36
|
return "";
|
package/src/tools/bash.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export interface BashToolDetails {
|
|
|
24
24
|
exitCode?: number;
|
|
25
25
|
/** True when the command was killed by its timeout deadline (not a failure). */
|
|
26
26
|
timedOut?: boolean;
|
|
27
|
+
/** Text the command wrote to `out://`, oldest first; transcripts draw each as a reply after the call. */
|
|
28
|
+
replies?: string[];
|
|
27
29
|
/** Live ACP update only; completed results refer to released terminals. */
|
|
28
30
|
terminalId?: string;
|
|
29
31
|
service?: {
|
package/src/tools/bash.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from "../tui";
|
|
2
|
-
import { getProjectDir } from "@linxiraos/pi-utils";
|
|
2
|
+
import { getProjectDir, jsonContainerEnd } from "@linxiraos/pi-utils";
|
|
3
3
|
import { highlightCode, type Theme } from "../theme/theme";
|
|
4
4
|
import { renderStatusLine } from "../render/status-line";
|
|
5
5
|
import { framedToolCard, type ToolCardSnapshot } from "../render/tool-card";
|
|
@@ -69,6 +69,8 @@ export interface BashToolDetails {
|
|
|
69
69
|
exitCode?: number;
|
|
70
70
|
/** True when the command was killed by its timeout deadline (not a failure). */
|
|
71
71
|
timedOut?: boolean;
|
|
72
|
+
/** Text the command wrote to `out://`, oldest first; transcripts draw each as a reply after the call. */
|
|
73
|
+
replies?: string[];
|
|
72
74
|
/** Live ACP update only; completed results refer to released terminals. */
|
|
73
75
|
terminalId?: string;
|
|
74
76
|
service?: {
|
|
@@ -174,28 +176,10 @@ function extractPartialBashEnv(partialJson: string | undefined): Readonly<Record
|
|
|
174
176
|
const objectStart = envStart === -1 ? -1 : partialJson.indexOf("{", envStart);
|
|
175
177
|
if (objectStart !== -1) {
|
|
176
178
|
// Scan only the env object: stop at its closing brace (outside strings)
|
|
177
|
-
// so the keys that follow it are not read as env assignments.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const ch = partialJson.charCodeAt(i);
|
|
182
|
-
if (ch === 0x22) {
|
|
183
|
-
// Skip the string body, honoring escapes; an unterminated string runs to the end.
|
|
184
|
-
for (i++; i < partialJson.length; i++) {
|
|
185
|
-
const inner = partialJson.charCodeAt(i);
|
|
186
|
-
if (inner === 0x5c) i++;
|
|
187
|
-
else if (inner === 0x22) break;
|
|
188
|
-
}
|
|
189
|
-
} else if (ch === 0x7b || ch === 0x5b) {
|
|
190
|
-
depth++;
|
|
191
|
-
} else if (ch === 0x7d || ch === 0x5d) {
|
|
192
|
-
if (depth === 0) {
|
|
193
|
-
objectEnd = i;
|
|
194
|
-
break;
|
|
195
|
-
}
|
|
196
|
-
depth--;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
179
|
+
// so the keys that follow it are not read as env assignments. An
|
|
180
|
+
// unclosed object (still streaming) runs to the end.
|
|
181
|
+
const end = jsonContainerEnd(partialJson, objectStart);
|
|
182
|
+
const objectEnd = end === -1 ? partialJson.length : end - 1;
|
|
199
183
|
const envBody = partialJson.slice(objectStart + 1, objectEnd);
|
|
200
184
|
const matcher = /"([A-Za-z_][A-Za-z0-9_]*)"\s*:\s*"((?:\\.|[^"\\])*)(?:"|$)/gu;
|
|
201
185
|
for (const match of envBody.matchAll(matcher)) {
|
|
@@ -22,10 +22,12 @@ export interface DefaultToolRenderInput {
|
|
|
22
22
|
export declare function formatDefaultToolExecution(input: DefaultToolRenderInput, contentWidth: number, uiTheme: Theme): string;
|
|
23
23
|
/**
|
|
24
24
|
* TSP view of the generic fallback card: the tool label with a one-line args
|
|
25
|
-
* summary as the head target; the result as
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* summary as the head target; the result as JSON (the host's `json` viewer,
|
|
26
|
+
* else a JSON tree) or raw `ansi` output. The complete output goes over the
|
|
27
|
+
* wire — the card-level disclosure clamp the terminal applies is the only
|
|
28
|
+
* bound, so an expanded card keeps every row. The `json` viewer never cuts;
|
|
29
|
+
* JSON the fallback tree's depth, node or scalar caps would cut keeps the raw
|
|
30
|
+
* path instead.
|
|
29
31
|
*/
|
|
30
32
|
export declare function describeDefaultToolExecution(input: DefaultToolRenderInput): NativeToolView;
|
|
31
33
|
/** Render the generic fallback as the state-tinted card used by direct custom tools. */
|
|
@@ -9,7 +9,7 @@ import { renderStatusLine, type StatusLineOptions } from "../render/status-line"
|
|
|
9
9
|
import { plainToolCard, type ToolCardPhase } from "../render/tool-card";
|
|
10
10
|
import { clipCollapsed } from "../render/render-utils";
|
|
11
11
|
import {
|
|
12
|
-
|
|
12
|
+
describeJsonValue,
|
|
13
13
|
formatArgsInline,
|
|
14
14
|
JSON_TREE_MAX_DEPTH_COLLAPSED,
|
|
15
15
|
JSON_TREE_MAX_DEPTH_EXPANDED,
|
|
@@ -186,10 +186,12 @@ const NATIVE_ARGS_SUMMARY_CHARS = 160;
|
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
188
|
* TSP view of the generic fallback card: the tool label with a one-line args
|
|
189
|
-
* summary as the head target; the result as
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
189
|
+
* summary as the head target; the result as JSON (the host's `json` viewer,
|
|
190
|
+
* else a JSON tree) or raw `ansi` output. The complete output goes over the
|
|
191
|
+
* wire — the card-level disclosure clamp the terminal applies is the only
|
|
192
|
+
* bound, so an expanded card keeps every row. The `json` viewer never cuts;
|
|
193
|
+
* JSON the fallback tree's depth, node or scalar caps would cut keeps the raw
|
|
194
|
+
* path instead.
|
|
193
195
|
*/
|
|
194
196
|
export function describeDefaultToolExecution(input: DefaultToolRenderInput): NativeToolView {
|
|
195
197
|
const { result } = input;
|
|
@@ -212,7 +214,8 @@ export function describeDefaultToolExecution(input: DefaultToolRenderInput): Nat
|
|
|
212
214
|
}
|
|
213
215
|
if (parsed !== undefined) {
|
|
214
216
|
let truncated = false;
|
|
215
|
-
const tree =
|
|
217
|
+
const tree = describeJsonValue(parsed, {
|
|
218
|
+
native: input.options.json,
|
|
216
219
|
// A result's own `i` or `__partialJson` keys are data, not call metadata.
|
|
217
220
|
hiddenRootKeys: [],
|
|
218
221
|
onTruncated: () => {
|
package/src/tools/edit.d.ts
CHANGED
|
@@ -51,8 +51,10 @@ export interface EditToolPerFileResult {
|
|
|
51
51
|
}
|
|
52
52
|
/** Diff, diagnostics, and snapshots returned by an edit. */
|
|
53
53
|
export interface EditToolDetails {
|
|
54
|
-
/** Unified diff of the changes made */
|
|
54
|
+
/** Unified diff of the changes made; empty when the edit failed */
|
|
55
55
|
diff: string;
|
|
56
|
+
/** Why the edit failed, as the engine classed it (`unseen_lines`, `stale_tag`, `parse`, …) */
|
|
57
|
+
errorKind?: string;
|
|
56
58
|
/** Line number of the first change in the new file (for editor navigation) */
|
|
57
59
|
firstChangedLine?: number;
|
|
58
60
|
/** Diagnostic result (if available) */
|
package/src/tools/edit.ts
CHANGED
|
@@ -95,8 +95,10 @@ export interface EditToolPerFileResult {
|
|
|
95
95
|
|
|
96
96
|
/** Diff, diagnostics, and snapshots returned by an edit. */
|
|
97
97
|
export interface EditToolDetails {
|
|
98
|
-
/** Unified diff of the changes made */
|
|
98
|
+
/** Unified diff of the changes made; empty when the edit failed */
|
|
99
99
|
diff: string;
|
|
100
|
+
/** Why the edit failed, as the engine classed it (`unseen_lines`, `stale_tag`, `parse`, …) */
|
|
101
|
+
errorKind?: string;
|
|
100
102
|
/** Line number of the first change in the new file (for editor navigation) */
|
|
101
103
|
firstChangedLine?: number;
|
|
102
104
|
/** Diagnostic result (if available) */
|
|
@@ -1418,7 +1420,8 @@ function editFileParts(
|
|
|
1418
1420
|
filePathFromEditEntry(firstEdit?.rename) ??
|
|
1419
1421
|
filePathFromEditEntry(firstEdit?.move) ??
|
|
1420
1422
|
(details && "move" in details && typeof details.move === "string" ? details.move : undefined);
|
|
1421
|
-
|
|
1423
|
+
// Details that only class a failure leave the streamed preview to locate it.
|
|
1424
|
+
const editDiffPreview = details && !("errorKind" in details) ? undefined : options.renderContext?.editDiffPreview;
|
|
1422
1425
|
const previewDiff = editDiffPreview && !("error" in editDiffPreview) ? editDiffPreview.diff : undefined;
|
|
1423
1426
|
const diffText = isError ? undefined : details?.diff || previewDiff;
|
|
1424
1427
|
const firstChangedLine =
|
|
@@ -1530,8 +1533,9 @@ function renderSingleFileResult(
|
|
|
1530
1533
|
// what happened. The shared streaming `editDiffPreview` is a call-phase
|
|
1531
1534
|
// artifact (in a batch it reflects only the first file), so consulting it
|
|
1532
1535
|
// for an empty-diff delete/move/no-op result mislabels the card. Fall
|
|
1533
|
-
// back to the preview only when no details exist yet
|
|
1534
|
-
|
|
1536
|
+
// back to the preview only when no details exist yet, or when they only
|
|
1537
|
+
// class a failure.
|
|
1538
|
+
const editDiffPreview = details && !("errorKind" in details) ? undefined : renderContext?.editDiffPreview;
|
|
1535
1539
|
const renderDiffFn = renderContext?.renderDiff ?? renderFallbackDiff;
|
|
1536
1540
|
|
|
1537
1541
|
if (diffSectionRenderDiffFn !== renderDiffFn) {
|
package/src/tools/eval.ts
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
JSON_TREE_MAX_LINES_EXPANDED,
|
|
32
32
|
JSON_TREE_SCALAR_LEN_COLLAPSED,
|
|
33
33
|
JSON_TREE_SCALAR_LEN_EXPANDED,
|
|
34
|
-
|
|
34
|
+
describeJsonValue,
|
|
35
35
|
renderJsonTreeLines,
|
|
36
36
|
} from "./json-tree";
|
|
37
37
|
import { formatStyledTruncationWarning, stripOutputNotice } from "./output-meta";
|
|
@@ -820,11 +820,14 @@ function evalTableNode(view: Extract<EvalView, { kind: "table" }>, key: string):
|
|
|
820
820
|
/**
|
|
821
821
|
* One cell's outputs in order: printed text (following its tail, clamped to
|
|
822
822
|
* the last `previewLines` while folded) with each view in place of its text.
|
|
823
|
+
* A json view is the host's own JSON viewer (`json`), top-level entries
|
|
824
|
+
* listed and containers folded, when it draws the kind; else a JSON tree.
|
|
823
825
|
*/
|
|
824
826
|
function evalOutputNodes(
|
|
825
827
|
output: string,
|
|
826
828
|
views: readonly EvalViewEntry[] | undefined,
|
|
827
829
|
previewLines: number,
|
|
830
|
+
json: boolean,
|
|
828
831
|
): NativeNode[] {
|
|
829
832
|
if (output.trim().length === 0) return [];
|
|
830
833
|
return splitEvalOutput(output, views).map((part, i) => {
|
|
@@ -837,7 +840,9 @@ function evalOutputNodes(
|
|
|
837
840
|
}
|
|
838
841
|
const view = part.view;
|
|
839
842
|
if (view.kind === "table") return evalTableNode(view, `table-${i}`);
|
|
840
|
-
if (view.kind === "json")
|
|
843
|
+
if (view.kind === "json") {
|
|
844
|
+
return keyed(describeJsonValue(view.value, { native: json, hiddenRootKeys: [] }), `json-${i}`);
|
|
845
|
+
}
|
|
841
846
|
return keyed(md(view.text), `markdown-${i}`);
|
|
842
847
|
});
|
|
843
848
|
}
|
|
@@ -1307,7 +1312,7 @@ export const evalToolRenderer = {
|
|
|
1307
1312
|
language,
|
|
1308
1313
|
code: formatEvalCodeForDisplay(cell.code, language),
|
|
1309
1314
|
title: cell.title,
|
|
1310
|
-
outputs: [...evalOutputNodes(cell.output, cell.views, previewLines)],
|
|
1315
|
+
outputs: [...evalOutputNodes(cell.output, cell.views, previewLines, options.json === true)],
|
|
1311
1316
|
status: evalStatusSection(cell, expanded),
|
|
1312
1317
|
foot: state && {
|
|
1313
1318
|
state,
|
|
@@ -1332,7 +1337,12 @@ export const evalToolRenderer = {
|
|
|
1332
1337
|
const rawOutput = options.renderContext?.output ?? resultText(result).trimEnd();
|
|
1333
1338
|
const state: RunState = cancelled ? "cancelled" : isPartial ? "running" : result.isError ? "failed" : "done";
|
|
1334
1339
|
const last: Omit<EvalCellRun, "language" | "code" | "title"> = {
|
|
1335
|
-
outputs: evalOutputNodes(
|
|
1340
|
+
outputs: evalOutputNodes(
|
|
1341
|
+
stripOutputNotice(rawOutput, details?.meta).trimEnd(),
|
|
1342
|
+
undefined,
|
|
1343
|
+
previewLines,
|
|
1344
|
+
options.json === true,
|
|
1345
|
+
),
|
|
1336
1346
|
status: evalStatusSection(details ?? {}, expanded),
|
|
1337
1347
|
foot: { state, elapsedMs: options.elapsedMs, ...callFacts },
|
|
1338
1348
|
};
|
package/src/tools/fetch.d.ts
CHANGED
package/src/tools/fetch.ts
CHANGED
package/src/tools/find.ts
CHANGED
|
@@ -7,17 +7,10 @@ import * as path from "node:path";
|
|
|
7
7
|
import { formatDuration, formatNumber } from "@linxiraos/pi-utils";
|
|
8
8
|
import { renderProgressBar } from "../components/progress-bar";
|
|
9
9
|
import { Text } from "../components/text";
|
|
10
|
-
import {
|
|
11
|
-
Ellipsis,
|
|
12
|
-
fileHyperlink,
|
|
13
|
-
getTreeBranch,
|
|
14
|
-
renderStatusLine,
|
|
15
|
-
renderTreeList,
|
|
16
|
-
truncateToWidth,
|
|
17
|
-
uriHyperlink,
|
|
18
|
-
} from "../render";
|
|
10
|
+
import { fileHyperlink, getTreeBranch, renderStatusLine, renderTreeList, uriHyperlink } from "../render";
|
|
19
11
|
import {
|
|
20
12
|
createCachedComponent,
|
|
13
|
+
fitHeaderedRows,
|
|
21
14
|
formatCount,
|
|
22
15
|
formatEmptyMessage,
|
|
23
16
|
formatErrorMessage,
|
|
@@ -357,7 +350,7 @@ export const findToolRenderer = {
|
|
|
357
350
|
extra.push(uiTheme.fg("dim", `keywords: ${details.keywords.join(", ")}`));
|
|
358
351
|
for (const failure of stats.failures) extra.push(uiTheme.fg("warning", failure));
|
|
359
352
|
}
|
|
360
|
-
return
|
|
353
|
+
return fitHeaderedRows(header, [...hitLines, ...extra], width);
|
|
361
354
|
},
|
|
362
355
|
);
|
|
363
356
|
},
|
package/src/tools/github.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export interface GhRunWatchFailedLogDetails {
|
|
|
85
85
|
conclusion?: string;
|
|
86
86
|
tail?: string;
|
|
87
87
|
available: boolean;
|
|
88
|
+
unavailableReason?: string;
|
|
88
89
|
}
|
|
89
90
|
/** Live workflow watcher display snapshot. */
|
|
90
91
|
export interface GhRunWatchViewDetails {
|
|
@@ -130,6 +131,8 @@ export interface GhFailedJobLog {
|
|
|
130
131
|
full?: string;
|
|
131
132
|
tail?: string;
|
|
132
133
|
available: boolean;
|
|
134
|
+
unavailableReason?: string;
|
|
135
|
+
truncated?: boolean;
|
|
133
136
|
}
|
|
134
137
|
/** Choose the terminal conclusion or current job state. */
|
|
135
138
|
export declare function formatJobState(job: GhRunJobSnapshot): string;
|