@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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Usage } from "@linxiraos/pi-ai";
|
|
2
2
|
import type { ThemeColor } from "../theme/theme.js";
|
|
3
3
|
import type { ConfiguredThinkingLevel } from "../render/render-utils.js";
|
|
4
|
-
import type { RenderResultOptions, NativeToolView, ToolRenderResult } from "./renderer.js";
|
|
5
4
|
import { type Component } from "../tui.js";
|
|
5
|
+
import type { RenderResultOptions } from "./renderer.js";
|
|
6
6
|
import { type Theme } from "../theme/theme.js";
|
|
7
|
+
import type { NativeToolView, ToolRenderResult } from "./renderer.js";
|
|
7
8
|
/** Render context threaded in from `ToolExecutionComponent.#buildRenderContext`. */
|
|
8
9
|
interface TaskRenderContext {
|
|
9
10
|
hasResult?: boolean;
|
|
@@ -103,10 +104,11 @@ export interface TaskItem {
|
|
|
103
104
|
agent?: string;
|
|
104
105
|
/** Historical source session selected by the bundled consult agent. */
|
|
105
106
|
sourceSession?: string;
|
|
106
|
-
/**
|
|
107
|
+
/** Bundled seance: override for the source session's saved model. Any other agent: one exact per-call model, gated by `task.perCallModel`. */
|
|
107
108
|
model?: string | string[];
|
|
108
|
-
/**
|
|
109
|
+
/** Inline instructions; exactly one of task or taskFile is required. */
|
|
109
110
|
task?: string;
|
|
111
|
+
taskFile?: string;
|
|
110
112
|
/** How open-ended the work is; required by the schema and the child's sole `auto` thinking classification input. */
|
|
111
113
|
solutionSpace?: string;
|
|
112
114
|
/** Per-spawn thinking effort: lowest/middle/highest level the resolved model supports. Overrides the agent's default selector (e.g. `auto`). */
|
|
@@ -133,10 +135,12 @@ export interface TaskParams {
|
|
|
133
135
|
agent?: string;
|
|
134
136
|
/** Historical source session selected by the bundled consult agent. */
|
|
135
137
|
sourceSession?: string;
|
|
136
|
-
/**
|
|
138
|
+
/** See {@link TaskItem.model}. */
|
|
137
139
|
model?: string | string[];
|
|
138
140
|
/** The work (flat form). */
|
|
139
141
|
task?: string;
|
|
142
|
+
/** Absolute path or local:// URL to a UTF-8 file (flat form), mutually exclusive with task. */
|
|
143
|
+
taskFile?: string;
|
|
140
144
|
/** How open-ended the work is (flat form); see {@link TaskItem.solutionSpace}. */
|
|
141
145
|
solutionSpace?: string;
|
|
142
146
|
/** Per-spawn thinking effort (flat form): lowest/middle/highest level the resolved model supports. */
|
|
@@ -212,6 +216,9 @@ export interface AgentProgress {
|
|
|
212
216
|
status: "pending" | "running" | "completed" | "failed" | "aborted";
|
|
213
217
|
task: string;
|
|
214
218
|
assignment?: string;
|
|
219
|
+
taskFile?: string;
|
|
220
|
+
/** SHA-256 of the exact task file bytes before decoding and trimming. */
|
|
221
|
+
taskFileSha256?: string;
|
|
215
222
|
description?: string;
|
|
216
223
|
lastIntent?: string;
|
|
217
224
|
currentTool?: string;
|
|
@@ -319,6 +326,8 @@ export interface SingleResult {
|
|
|
319
326
|
agentSource: AgentSource;
|
|
320
327
|
task: string;
|
|
321
328
|
assignment?: string;
|
|
329
|
+
taskFile?: string;
|
|
330
|
+
taskFileSha256?: string;
|
|
322
331
|
description?: string;
|
|
323
332
|
lastIntent?: string;
|
|
324
333
|
exitCode: number;
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
* selector peeling and transcript renderers consult it instead of hardcoding
|
|
5
5
|
* scheme names.
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Mutation class of a writable scheme; drives plan-mode and device-only `write` gates.
|
|
9
|
+
* - `workspace`: mutates user/external state; blocked in plan mode and device-only sessions.
|
|
10
|
+
* - `sandbox`: session scratch space (local://); allowed in plan mode and device-only sessions.
|
|
11
|
+
* - `coordination`: peer messaging (agent://); always allowed. `SchemeWritePolicy.cancels` grants the same per URL.
|
|
12
|
+
* - `device`: tool-device dispatch (xd://); always allowed, the device enforces its own policy.
|
|
13
|
+
* - `reply`: a message to the user (out://); always allowed, and transcripts draw the content as assistant prose.
|
|
14
|
+
*/
|
|
15
|
+
export type SchemeWriteScope = "workspace" | "sandbox" | "coordination" | "device" | "reply";
|
|
7
16
|
/** Renderer-relevant subset of a registered scheme's declared spec. */
|
|
8
17
|
export interface InternalUrlSchemeSpec {
|
|
9
18
|
/** `lines`: a trailing `:<selector>` chain is a read selector; `none`/`opaque`: never peel. */
|
|
@@ -12,16 +21,24 @@ export interface InternalUrlSchemeSpec {
|
|
|
12
21
|
readonly portAuthority?: boolean;
|
|
13
22
|
/** Read cards collapse into the compact read group like plain files instead of expanding. */
|
|
14
23
|
readonly compactTranscript?: boolean;
|
|
24
|
+
/** Write policy; absent on read-only schemes. Transcripts draw `reply`-scoped writes as assistant prose. */
|
|
25
|
+
readonly write?: {
|
|
26
|
+
readonly scope: SchemeWriteScope;
|
|
27
|
+
};
|
|
15
28
|
}
|
|
16
29
|
/** Scheme registry capabilities installed by the internal URL host. */
|
|
17
30
|
export interface InternalUrlSchemeHost {
|
|
18
31
|
/** Declared spec of a registered scheme (case-insensitive); undefined when unregistered. */
|
|
19
32
|
spec(scheme: string): InternalUrlSchemeSpec | undefined;
|
|
33
|
+
/** Declared specs of every registered scheme, keyed by lowercased scheme. */
|
|
34
|
+
specs(): ReadonlyMap<string, InternalUrlSchemeSpec>;
|
|
20
35
|
}
|
|
21
36
|
/** Install the scheme registry. Until one is installed, no URL counts as an internal scheme. */
|
|
22
37
|
export declare function setInternalUrlSchemeHost(host: InternalUrlSchemeHost): void;
|
|
23
38
|
/** Declared spec of `scheme`; undefined when it is unregistered or no host is installed. */
|
|
24
39
|
export declare function internalUrlSchemeSpec(scheme: string): InternalUrlSchemeSpec | undefined;
|
|
40
|
+
/** Declared specs of every registered scheme, keyed by lowercased scheme; empty when no host is installed. */
|
|
41
|
+
export declare function internalUrlSchemeSpecs(): ReadonlyMap<string, InternalUrlSchemeSpec>;
|
|
25
42
|
/** Split a hierarchical `scheme://rest` URL into its lowercased scheme and the text after `://`. */
|
|
26
43
|
export declare function splitUrlScheme(input: string): {
|
|
27
44
|
scheme: string;
|
|
@@ -17,6 +17,8 @@ export interface JobSnapshot {
|
|
|
17
17
|
type: "bash" | "task" | "eval";
|
|
18
18
|
status: "running" | "completed" | "failed" | "cancelled";
|
|
19
19
|
label: string;
|
|
20
|
+
/** What the job is for, in the model's words (a process job's `label` is its command line). */
|
|
21
|
+
intent?: string;
|
|
20
22
|
durationMs: number;
|
|
21
23
|
/** Process exit status when the job reports one. */
|
|
22
24
|
exitCode?: number;
|
|
@@ -15,7 +15,7 @@ export declare const yieldToolRenderer: {
|
|
|
15
15
|
renderCall(args: YieldRenderArgs, options: RenderResultOptions, theme: Theme): Component;
|
|
16
16
|
renderResult(result: ToolRenderResult<YieldItem>, options: RenderResultContextOptions, theme: Theme, args?: YieldRenderArgs): Component;
|
|
17
17
|
describeCall(args: YieldRenderArgs, options: RenderResultOptions): NativeToolView;
|
|
18
|
-
describeResult(result: ToolRenderResult<YieldItem>,
|
|
18
|
+
describeResult(result: ToolRenderResult<YieldItem>, options: RenderResultContextOptions, args?: YieldRenderArgs): NativeToolView;
|
|
19
19
|
mergeCallAndResult: true;
|
|
20
20
|
animatedPendingPreview: true;
|
|
21
21
|
};
|
package/dist/types/tui.d.ts
CHANGED
|
@@ -80,7 +80,9 @@ export interface TUIStartOptions {
|
|
|
80
80
|
* switches to raw input and replays the kernel-buffered keystrokes.
|
|
81
81
|
*
|
|
82
82
|
* A terminal expected to speak TSP needs raw input from the start, so it
|
|
83
|
-
* gets it
|
|
83
|
+
* gets it. Plain typing (printable text, Backspace) still edits the focused
|
|
84
|
+
* component live, as the kernel echo shows it elsewhere; the first other key
|
|
85
|
+
* and every key after it are held instead (TSP events and the cell-size
|
|
84
86
|
* reply still apply) until {@link TUI.releaseHeldInput} replays them.
|
|
85
87
|
*/
|
|
86
88
|
deferInput?: boolean;
|
|
@@ -192,6 +194,18 @@ export interface Component {
|
|
|
192
194
|
*/
|
|
193
195
|
dispose?(): void;
|
|
194
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* A gutter component that can hand an external native renderer a semantic
|
|
199
|
+
* snapshot of the column it draws (see {@link TUI.setGutterComponent}). Such a
|
|
200
|
+
* component keeps rendering its ANSI rows — the snapshot only travels
|
|
201
|
+
* out-of-band — and a GUI that receives it draws the same content natively.
|
|
202
|
+
* Deliberately separate from {@link Component}: only a sidebar-shaped
|
|
203
|
+
* component describes itself for a whole external surface.
|
|
204
|
+
*/
|
|
205
|
+
export interface NativeSnapshotSource {
|
|
206
|
+
/** JSON-serializable TSP node for an external native sidebar renderer. */
|
|
207
|
+
describeSnapshot(): NativeNode | null;
|
|
208
|
+
}
|
|
195
209
|
/** Lets an overlay root delegate keyboard focus to components it owns. */
|
|
196
210
|
export interface OverlayFocusOwner {
|
|
197
211
|
/** Returns true when `component` is a focus target inside this overlay. */
|
|
@@ -525,7 +539,10 @@ export declare class TUI extends Container {
|
|
|
525
539
|
* never come.
|
|
526
540
|
*/
|
|
527
541
|
addStartListener(listener: StartListener): () => void;
|
|
528
|
-
|
|
542
|
+
/** Registers a key listener; `prepend` gives a foreground input owner first refusal over global shortcuts. */
|
|
543
|
+
addInputListener(listener: InputListener, options?: {
|
|
544
|
+
prepend?: boolean;
|
|
545
|
+
}): () => void;
|
|
529
546
|
removeInputListener(listener: InputListener): void;
|
|
530
547
|
stop(): void;
|
|
531
548
|
/**
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ export declare function truncateToWidth(text: string, maxWidth: number, ellipsis
|
|
|
36
36
|
export declare function wrapTextWithAnsi(text: string, width: number): string[];
|
|
37
37
|
export declare function extractSegments(line: string, beforeEnd: number, afterStart: number, afterLen: number, strictAfter: boolean): ExtractSegmentsResult;
|
|
38
38
|
export declare function replaceTabs(text: string): string;
|
|
39
|
+
/** Tabs expanded and line breaks collapsed to spaces, for text confined to one rendered row. */
|
|
40
|
+
export declare function singleLine(text: string): string;
|
|
41
|
+
/** A non-negative integer cell width; non-finite input becomes `fallback`. */
|
|
42
|
+
export declare function finiteWidth(width: number, fallback?: number): number;
|
|
39
43
|
/**
|
|
40
44
|
* Returns a string of n spaces. Uses a pre-allocated buffer for efficiency.
|
|
41
45
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@linxiraos/pi-tui",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.9",
|
|
5
5
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
6
6
|
"homepage": "https://linxira-os.github.io/zeta/",
|
|
7
7
|
"author": "Linxira-OS",
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"gen:glyphs": "bun scripts/gen-glyphs.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@linxiraos/pi-omptype": "1.4.
|
|
42
|
-
"@linxiraos/pi-agent-core": "1.4.
|
|
43
|
-
"@linxiraos/pi-ai": "1.4.
|
|
44
|
-
"@linxiraos/pi-catalog": "1.4.
|
|
45
|
-
"@linxiraos/pi-natives": "1.4.
|
|
46
|
-
"@linxiraos/pi-utils": "1.4.
|
|
47
|
-
"@linxiraos/pi-wire": "1.4.
|
|
48
|
-
"@linxiraos/pi-snapcompact": "1.4.
|
|
41
|
+
"@linxiraos/pi-omptype": "1.4.9",
|
|
42
|
+
"@linxiraos/pi-agent-core": "1.4.9",
|
|
43
|
+
"@linxiraos/pi-ai": "1.4.9",
|
|
44
|
+
"@linxiraos/pi-catalog": "1.4.9",
|
|
45
|
+
"@linxiraos/pi-natives": "1.4.9",
|
|
46
|
+
"@linxiraos/pi-utils": "1.4.9",
|
|
47
|
+
"@linxiraos/pi-wire": "1.4.9",
|
|
48
|
+
"@linxiraos/pi-snapcompact": "1.4.9"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"kitty-vt-wasm": "^0.2.0"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
|
-
"bun": ">=1.
|
|
54
|
+
"bun": ">=1.4.4"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"src",
|
|
@@ -70,10 +70,6 @@
|
|
|
70
70
|
"types": "./dist/types/theme/index.d.ts",
|
|
71
71
|
"import": "./src/theme/index.ts"
|
|
72
72
|
},
|
|
73
|
-
"./theme/defaults": {
|
|
74
|
-
"types": "./dist/types/theme/defaults/index.d.ts",
|
|
75
|
-
"import": "./src/theme/defaults/index.ts"
|
|
76
|
-
},
|
|
77
73
|
"./theme/*": {
|
|
78
74
|
"types": "./dist/types/theme/*.d.ts",
|
|
79
75
|
"import": "./src/theme/*.ts"
|
package/src/app-keybindings.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ interface AppKeybindings {
|
|
|
24
24
|
"app.message.followUp": true;
|
|
25
25
|
"app.retry": true;
|
|
26
26
|
"app.message.dequeue": true;
|
|
27
|
+
"app.btw.inject": true;
|
|
27
28
|
"app.clipboard.pasteImage": true;
|
|
28
29
|
"app.clipboard.pasteTextRaw": true;
|
|
29
30
|
"app.clipboard.copyLine": true;
|
|
@@ -39,10 +40,13 @@ interface AppKeybindings {
|
|
|
39
40
|
"app.session.rename": true;
|
|
40
41
|
"app.session.delete": true;
|
|
41
42
|
"app.session.deleteNoninvasive": true;
|
|
43
|
+
"app.session.pin": true;
|
|
44
|
+
"app.session.unpin": true;
|
|
42
45
|
"app.tree.previousBranch": true;
|
|
43
46
|
"app.tree.nextBranch": true;
|
|
44
47
|
"app.plan.toggle": true;
|
|
45
48
|
"app.history.search": true;
|
|
49
|
+
"app.links.hint": true;
|
|
46
50
|
"app.stt.pushToTalk": true;
|
|
47
51
|
"app.stt.toggle": true;
|
|
48
52
|
"app.live.toggle": true;
|
|
@@ -269,6 +273,10 @@ export declare const KEYBINDINGS: {
|
|
|
269
273
|
readonly defaultKeys: ["alt+up", "shift+up"];
|
|
270
274
|
readonly description: "Dequeue message";
|
|
271
275
|
};
|
|
276
|
+
readonly "app.btw.inject": {
|
|
277
|
+
readonly defaultKeys: "alt+i";
|
|
278
|
+
readonly description: "Send a /btw answer's steering prompt to the main session";
|
|
279
|
+
};
|
|
272
280
|
readonly "app.clipboard.pasteImage": {
|
|
273
281
|
readonly defaultKeys: KeyId[];
|
|
274
282
|
readonly description: "Paste image or text from clipboard";
|
|
@@ -329,6 +337,14 @@ export declare const KEYBINDINGS: {
|
|
|
329
337
|
readonly defaultKeys: "ctrl+backspace";
|
|
330
338
|
readonly description: "Delete session (non-invasive)";
|
|
331
339
|
};
|
|
340
|
+
readonly "app.session.pin": {
|
|
341
|
+
readonly defaultKeys: "alt+k";
|
|
342
|
+
readonly description: "Pin the selected session in the resume picker";
|
|
343
|
+
};
|
|
344
|
+
readonly "app.session.unpin": {
|
|
345
|
+
readonly defaultKeys: "alt+shift+k";
|
|
346
|
+
readonly description: "Unpin the selected session in the resume picker";
|
|
347
|
+
};
|
|
332
348
|
readonly "app.tree.previousBranch": {
|
|
333
349
|
readonly defaultKeys: [];
|
|
334
350
|
readonly description: "Jump to the previous branch in /tree";
|
|
@@ -345,6 +361,10 @@ export declare const KEYBINDINGS: {
|
|
|
345
361
|
readonly defaultKeys: "ctrl+r";
|
|
346
362
|
readonly description: "Search history";
|
|
347
363
|
};
|
|
364
|
+
readonly "app.links.hint": {
|
|
365
|
+
readonly defaultKeys: "alt+o";
|
|
366
|
+
readonly description: "Pick an extension link on screen by its hint tag";
|
|
367
|
+
};
|
|
348
368
|
readonly "app.stt.pushToTalk": {
|
|
349
369
|
readonly defaultKeys: "space";
|
|
350
370
|
readonly description: "Hold to record speech-to-text";
|
package/src/app-keybindings.ts
CHANGED
|
@@ -44,6 +44,7 @@ interface AppKeybindings {
|
|
|
44
44
|
"app.message.followUp": true;
|
|
45
45
|
"app.retry": true;
|
|
46
46
|
"app.message.dequeue": true;
|
|
47
|
+
"app.btw.inject": true;
|
|
47
48
|
"app.clipboard.pasteImage": true;
|
|
48
49
|
"app.clipboard.pasteTextRaw": true;
|
|
49
50
|
"app.clipboard.copyLine": true;
|
|
@@ -59,10 +60,13 @@ interface AppKeybindings {
|
|
|
59
60
|
"app.session.rename": true;
|
|
60
61
|
"app.session.delete": true;
|
|
61
62
|
"app.session.deleteNoninvasive": true;
|
|
63
|
+
"app.session.pin": true;
|
|
64
|
+
"app.session.unpin": true;
|
|
62
65
|
"app.tree.previousBranch": true;
|
|
63
66
|
"app.tree.nextBranch": true;
|
|
64
67
|
"app.plan.toggle": true;
|
|
65
68
|
"app.history.search": true;
|
|
69
|
+
"app.links.hint": true;
|
|
66
70
|
"app.stt.pushToTalk": true;
|
|
67
71
|
"app.stt.toggle": true;
|
|
68
72
|
"app.live.toggle": true;
|
|
@@ -179,6 +183,10 @@ export const KEYBINDINGS = {
|
|
|
179
183
|
defaultKeys: ["alt+up", "shift+up"],
|
|
180
184
|
description: "Dequeue message",
|
|
181
185
|
},
|
|
186
|
+
"app.btw.inject": {
|
|
187
|
+
defaultKeys: "alt+i",
|
|
188
|
+
description: "Send a /btw answer's steering prompt to the main session",
|
|
189
|
+
},
|
|
182
190
|
"app.clipboard.pasteImage": {
|
|
183
191
|
defaultKeys: getDefaultPasteImageKeys(),
|
|
184
192
|
description: "Paste image or text from clipboard",
|
|
@@ -239,6 +247,14 @@ export const KEYBINDINGS = {
|
|
|
239
247
|
defaultKeys: "ctrl+backspace",
|
|
240
248
|
description: "Delete session (non-invasive)",
|
|
241
249
|
},
|
|
250
|
+
"app.session.pin": {
|
|
251
|
+
defaultKeys: "alt+k",
|
|
252
|
+
description: "Pin the selected session in the resume picker",
|
|
253
|
+
},
|
|
254
|
+
"app.session.unpin": {
|
|
255
|
+
defaultKeys: "alt+shift+k",
|
|
256
|
+
description: "Unpin the selected session in the resume picker",
|
|
257
|
+
},
|
|
242
258
|
"app.tree.previousBranch": {
|
|
243
259
|
defaultKeys: [],
|
|
244
260
|
description: "Jump to the previous branch in /tree",
|
|
@@ -255,6 +271,10 @@ export const KEYBINDINGS = {
|
|
|
255
271
|
defaultKeys: "ctrl+r",
|
|
256
272
|
description: "Search history",
|
|
257
273
|
},
|
|
274
|
+
"app.links.hint": {
|
|
275
|
+
defaultKeys: "alt+o",
|
|
276
|
+
description: "Pick an extension link on screen by its hint tag",
|
|
277
|
+
},
|
|
258
278
|
"app.stt.pushToTalk": {
|
|
259
279
|
defaultKeys: "space",
|
|
260
280
|
description: "Hold to record speech-to-text",
|
package/src/apps/git/git-tui.ts
CHANGED
|
@@ -37,7 +37,7 @@ import { routeSgrMouseInput } from "../../mouse";
|
|
|
37
37
|
import { col, compact, keyed, node, row, span, stableKey, text } from "../../native/describe";
|
|
38
38
|
import { Memo } from "../../native/memo";
|
|
39
39
|
import type { DescribeContext, NativeNode, NativeUiEvent } from "../../native/node";
|
|
40
|
-
import { actionButton } from "../../native/overlay";
|
|
40
|
+
import { actionButton, iconButton, segmentedTabs } from "../../native/overlay";
|
|
41
41
|
import { type Component, type OverlayHandle, TUI } from "../../tui";
|
|
42
42
|
import { truncateToWidth, visibleWidth } from "../../utils";
|
|
43
43
|
import { theme, warmHighlighter } from "../../theme/theme";
|
|
@@ -1039,35 +1039,28 @@ class GitTuiComponent implements Component {
|
|
|
1039
1039
|
} else {
|
|
1040
1040
|
left.push(text([span(this.#model.branch ?? "detached", "muted")], { role: "zeta.app.git.path" }));
|
|
1041
1041
|
}
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
"icon",
|
|
1045
|
-
{ name, title, aria: title, role: on ? "zeta.app.ibtn.set" : "zeta.app.ibtn", actions: { click: act } },
|
|
1046
|
-
undefined,
|
|
1047
|
-
act,
|
|
1048
|
-
);
|
|
1042
|
+
const tool = (name: string, act: string, title: string, on?: boolean): NativeNode =>
|
|
1043
|
+
iconButton(name, act, title, { key: act, on });
|
|
1049
1044
|
const right: NativeNode[] = [
|
|
1050
1045
|
row(
|
|
1051
1046
|
[
|
|
1052
|
-
|
|
1053
|
-
|
|
1047
|
+
tool("chev-up", "prev-hunk", `Previous change (${formatTooltipKey("alt+up")})`),
|
|
1048
|
+
tool("chev", "next-hunk", `Next change (${formatTooltipKey("alt+down")})`),
|
|
1054
1049
|
],
|
|
1055
1050
|
{ gap: "none", align: "center" },
|
|
1056
1051
|
),
|
|
1057
|
-
|
|
1058
|
-
"tabs",
|
|
1052
|
+
segmentedTabs(
|
|
1059
1053
|
{
|
|
1060
1054
|
items: VIEW_TABS.map(tab => ({ id: tab.id, label: tab.label })),
|
|
1061
1055
|
active: this.#pane.mode,
|
|
1062
1056
|
role: "zeta.app.seg",
|
|
1063
1057
|
},
|
|
1064
|
-
undefined,
|
|
1065
1058
|
"views",
|
|
1066
1059
|
),
|
|
1067
1060
|
];
|
|
1068
1061
|
if (!narrow) {
|
|
1069
1062
|
right.push(
|
|
1070
|
-
|
|
1063
|
+
tool(
|
|
1071
1064
|
"type",
|
|
1072
1065
|
"whitespace",
|
|
1073
1066
|
this.#whitespace === "off"
|
|
@@ -1077,7 +1070,7 @@ class GitTuiComponent implements Component {
|
|
|
1077
1070
|
: `Ignoring formatting and imports; show all (${formatTooltipKey("b")})`,
|
|
1078
1071
|
this.#whitespace !== "off",
|
|
1079
1072
|
),
|
|
1080
|
-
|
|
1073
|
+
tool("corner-down-right", "wrap", `Wrap lines (${formatTooltipKey("w")})`, this.#pane.wrap),
|
|
1081
1074
|
);
|
|
1082
1075
|
}
|
|
1083
1076
|
if (file?.area === "unstaged" || file?.area === "staged") {
|
|
@@ -1089,8 +1082,8 @@ class GitTuiComponent implements Component {
|
|
|
1089
1082
|
);
|
|
1090
1083
|
}
|
|
1091
1084
|
right.push(
|
|
1092
|
-
|
|
1093
|
-
|
|
1085
|
+
tool("keyboard", "help", `Keyboard shortcuts (${formatTooltipKey("?")})`),
|
|
1086
|
+
tool("x", "close", `Close (${formatTooltipKey("q")})`),
|
|
1094
1087
|
);
|
|
1095
1088
|
return keyed(
|
|
1096
1089
|
row(
|
package/src/apps/git/sidebar.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { matchesKey } from "../../keys";
|
|
|
20
20
|
import { col, compact, item, keyed, list, node, row, span, stableKey, text } from "../../native/describe";
|
|
21
21
|
import { Memo } from "../../native/memo";
|
|
22
22
|
import type { DescribeContext, NativeChild, NativeNode, NativeUiEvent } from "../../native/node";
|
|
23
|
+
import { actionButton, iconButton, quietButton, segmentedTabs } from "../../native/overlay";
|
|
23
24
|
import type { TspProps, TspSpan } from "@linxiraos/pi-wire";
|
|
24
25
|
import { TERMINAL } from "../../terminal-capabilities";
|
|
25
26
|
import { truncateToWidth, visibleWidth } from "../../utils";
|
|
@@ -237,11 +238,6 @@ class GitFileTree {
|
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
240
|
|
|
240
|
-
/** A quiet text button (`Stage all`): a clickable row the role sheet draws as `.btn.quiet`. */
|
|
241
|
-
function quietButton(label: string, act: string, title: string): NativeNode {
|
|
242
|
-
return node("row", { role: "zeta.app.qbtn", actions: { click: act }, title }, [text(label)], act);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
241
|
/** A text field at rest: its value (or placeholder) as text; a click starts editing it. */
|
|
246
242
|
function fieldText(
|
|
247
243
|
value: string,
|
|
@@ -1099,8 +1095,7 @@ export class Sidebar {
|
|
|
1099
1095
|
}
|
|
1100
1096
|
|
|
1101
1097
|
#describeStyleToggle(): NativeNode {
|
|
1102
|
-
return
|
|
1103
|
-
"tabs",
|
|
1098
|
+
return segmentedTabs(
|
|
1104
1099
|
{
|
|
1105
1100
|
items: [
|
|
1106
1101
|
{ id: "path", label: "Path" },
|
|
@@ -1109,7 +1104,6 @@ export class Sidebar {
|
|
|
1109
1104
|
active: this.viewStyle,
|
|
1110
1105
|
role: "zeta.app.seg",
|
|
1111
1106
|
},
|
|
1112
|
-
undefined,
|
|
1113
1107
|
"style",
|
|
1114
1108
|
);
|
|
1115
1109
|
}
|
|
@@ -1128,18 +1122,10 @@ export class Sidebar {
|
|
|
1128
1122
|
area === "unstaged"
|
|
1129
1123
|
? [
|
|
1130
1124
|
quietButton("Stage all", "stage-all", "Stage every change (space on the head)"),
|
|
1131
|
-
|
|
1132
|
-
"
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
role: "zeta.app.ibtn",
|
|
1136
|
-
title: "Stage by description…",
|
|
1137
|
-
aria: "Stage by description",
|
|
1138
|
-
actions: { click: "stage-ai" },
|
|
1139
|
-
},
|
|
1140
|
-
undefined,
|
|
1141
|
-
"ai",
|
|
1142
|
-
),
|
|
1125
|
+
iconButton("wand", "stage-ai", "Stage by description…", {
|
|
1126
|
+
key: "ai",
|
|
1127
|
+
aria: "Stage by description",
|
|
1128
|
+
}),
|
|
1143
1129
|
]
|
|
1144
1130
|
: [quietButton("Unstage all", "unstage-all", "Unstage every change (space on the head)")];
|
|
1145
1131
|
const head = row(
|
|
@@ -1264,8 +1250,13 @@ export class Sidebar {
|
|
|
1264
1250
|
"zeta.app.git.body",
|
|
1265
1251
|
);
|
|
1266
1252
|
const hasChanges = this.#model.staged.length > 0 || this.#model.unstaged.length > 0 || this.amend;
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1253
|
+
const blocked = !hasChanges
|
|
1254
|
+
? "Nothing to commit"
|
|
1255
|
+
: this.generating
|
|
1256
|
+
? "Generating the commit message…"
|
|
1257
|
+
: summary.trim().length === 0 && description.trim().length > 0
|
|
1258
|
+
? "Write a summary line first"
|
|
1259
|
+
: undefined;
|
|
1269
1260
|
const label = this.generating
|
|
1270
1261
|
? "Generating message…"
|
|
1271
1262
|
: summary.trim().length === 0 && description.trim().length === 0
|
|
@@ -1273,8 +1264,13 @@ export class Sidebar {
|
|
|
1273
1264
|
: this.#model.staged.length > 0
|
|
1274
1265
|
? "Commit"
|
|
1275
1266
|
: "Stage all & commit";
|
|
1276
|
-
// The panels' button
|
|
1277
|
-
const
|
|
1267
|
+
// The panels' button: the primary while the keyboard is on it, disabled (saying why) when it can't run.
|
|
1268
|
+
const commit = actionButton(label, "commit", {
|
|
1269
|
+
title: this.#model.staged.length > 0 ? "Commit the staged changes" : "Stage everything, then commit",
|
|
1270
|
+
busy: this.generating,
|
|
1271
|
+
disabled: blocked,
|
|
1272
|
+
tone: on({ kind: "commit-button" }) ? "accent" : undefined,
|
|
1273
|
+
});
|
|
1278
1274
|
return col(
|
|
1279
1275
|
[
|
|
1280
1276
|
keyed(summaryField, "summary"),
|
|
@@ -1289,17 +1285,7 @@ export class Sidebar {
|
|
|
1289
1285
|
actions: { click: "amend" },
|
|
1290
1286
|
title: "Amend the previous commit",
|
|
1291
1287
|
}),
|
|
1292
|
-
|
|
1293
|
-
gap: "xs",
|
|
1294
|
-
align: "center",
|
|
1295
|
-
role: "zeta.btn",
|
|
1296
|
-
tone: commitTone,
|
|
1297
|
-
actions: canCommit ? { click: "commit" } : undefined,
|
|
1298
|
-
title:
|
|
1299
|
-
this.#model.staged.length > 0
|
|
1300
|
-
? "Commit the staged changes"
|
|
1301
|
-
: "Stage everything, then commit",
|
|
1302
|
-
}),
|
|
1288
|
+
commit,
|
|
1303
1289
|
],
|
|
1304
1290
|
{ justify: "between", align: "center", role: "zeta.app.git.foot" },
|
|
1305
1291
|
),
|
package/src/apps/ps-top.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { type Component, TUI } from "../tui";
|
|
|
17
17
|
import type { TspSpan, TspText, TspTone } from "@linxiraos/pi-wire";
|
|
18
18
|
import { col, compact, elapsed, keyed, node, row, span, stableKey, text } from "../native/describe";
|
|
19
19
|
import type { NativeNode, NativeUiEvent } from "../native/node";
|
|
20
|
-
import { actionBar, actionButton } from "../native/overlay";
|
|
20
|
+
import { actionBar, actionButton, iconButton, segmentedTabs } from "../native/overlay";
|
|
21
21
|
import { Memo } from "../native/memo";
|
|
22
22
|
import { truncateToWidth } from "../utils";
|
|
23
23
|
import { formatDuration } from "@linxiraos/pi-utils";
|
|
@@ -410,13 +410,7 @@ export class PsTopComponent implements Component {
|
|
|
410
410
|
);
|
|
411
411
|
} else {
|
|
412
412
|
left.push(
|
|
413
|
-
|
|
414
|
-
name: "back",
|
|
415
|
-
role: "zeta.app.ibtn",
|
|
416
|
-
title: "Back esc",
|
|
417
|
-
aria: "Back",
|
|
418
|
-
actions: { click: "back" },
|
|
419
|
-
}),
|
|
413
|
+
iconButton("back", "back", "Back esc", { aria: "Back" }),
|
|
420
414
|
text(
|
|
421
415
|
this.#view === "logs" ? `Logs · ${entry?.row.snapshot.name ?? "?"}` : (entry?.row.snapshot.name ?? "?"),
|
|
422
416
|
{
|
|
@@ -432,8 +426,7 @@ export class PsTopComponent implements Component {
|
|
|
432
426
|
const right: NativeNode[] = [];
|
|
433
427
|
if (this.#view === "table") {
|
|
434
428
|
right.push(
|
|
435
|
-
|
|
436
|
-
"tabs",
|
|
429
|
+
segmentedTabs(
|
|
437
430
|
{
|
|
438
431
|
items: [
|
|
439
432
|
{
|
|
@@ -448,7 +441,6 @@ export class PsTopComponent implements Component {
|
|
|
448
441
|
active: this.#all ? "all" : "current",
|
|
449
442
|
role: "zeta.app.seg",
|
|
450
443
|
},
|
|
451
|
-
undefined,
|
|
452
444
|
"scope",
|
|
453
445
|
),
|
|
454
446
|
);
|
|
@@ -468,7 +460,7 @@ export class PsTopComponent implements Component {
|
|
|
468
460
|
align: "center",
|
|
469
461
|
role: "zeta.app.fresh",
|
|
470
462
|
}),
|
|
471
|
-
|
|
463
|
+
iconButton("x", "quit", "Quit q", { aria: "Quit" }),
|
|
472
464
|
);
|
|
473
465
|
return keyed(
|
|
474
466
|
row(
|
|
@@ -14,6 +14,9 @@ export interface SessionPickerHost<T extends SessionSelectorEntry = SessionSelec
|
|
|
14
14
|
loadPinnedIds?(): Promise<ReadonlySet<string>>;
|
|
15
15
|
loadHistoryMatcher?(): SessionHistoryMatcher;
|
|
16
16
|
deleteSession?(session: T): Promise<boolean>;
|
|
17
|
+
/** Rename the session and resolve with the title as stored, or null when it did not happen. */
|
|
18
|
+
renameSession?(session: T, title: string): Promise<string | null>;
|
|
19
|
+
setSessionPinned?(session: T, pinned: boolean): Promise<void>;
|
|
17
20
|
loadAllSessions?(): Promise<T[]>;
|
|
18
21
|
/** Builds the three-level resume source for the standalone `--resume` tree. */
|
|
19
22
|
loadResumeSource?(deleteMode: "trash" | "permanent", workspacePath?: string): Promise<ResumeTreeSource | undefined>;
|
|
@@ -26,6 +29,8 @@ export interface SessionPickerOptions<T extends SessionSelectorEntry = SessionSe
|
|
|
26
29
|
scopeLabel?: string | false;
|
|
27
30
|
showCwd?: boolean;
|
|
28
31
|
allowDelete?: boolean;
|
|
32
|
+
/** Rename the selected session; resolve with the title as stored, or null when it did not happen. */
|
|
33
|
+
onRename?: (session: T, title: string) => Promise<string | null>;
|
|
29
34
|
allowGlobalScope?: boolean;
|
|
30
35
|
historySearch?: boolean;
|
|
31
36
|
pinnedIds?: ReadonlySet<string>;
|
|
@@ -79,6 +84,8 @@ export async function selectSession<T extends SessionSelectorEntry>(
|
|
|
79
84
|
},
|
|
80
85
|
{
|
|
81
86
|
onDelete: options.allowDelete === false ? undefined : host.deleteSession,
|
|
87
|
+
onRename: options.onRename ?? host.renameSession,
|
|
88
|
+
onSetPinned: host.setSessionPinned,
|
|
82
89
|
historyMatcher,
|
|
83
90
|
loadAllSessions: options.allowGlobalScope === false ? undefined : host.loadAllSessions,
|
|
84
91
|
allSessions: options.allSessions,
|
|
@@ -419,9 +419,10 @@ export type ChartAnnotation = {
|
|
|
419
419
|
export declare function planChart(table: TableAnalysis): ChartPlan | undefined;
|
|
420
420
|
/**
|
|
421
421
|
* Whether a model should pick `table`'s chart (`tui.autoGraph: smart`):
|
|
422
|
-
* multi-series tables,
|
|
423
|
-
* `guess` plots (`Thread | State`, `Finding | Current`),
|
|
424
|
-
* tells a
|
|
422
|
+
* multi-series tables, tables whose rows may be named by a number the
|
|
423
|
+
* `guess` plots (`Thread | State`, `Finding | Current`), and any other chart
|
|
424
|
+
* the guess would draw — only meaning tells a measure from page references,
|
|
425
|
+
* step numbers or figures quoted in prose, which the judge charts as none.
|
|
425
426
|
*/
|
|
426
427
|
export declare function shouldJudge(table: TableAnalysis, guess: ChartPlan | undefined): boolean;
|
|
427
428
|
/** Measure columns before `guess`'s text label column: numbers that may only name their rows. */
|
|
@@ -446,10 +447,11 @@ export declare function tableTakeaways(table: TableAnalysis, plan: ChartPlan, co
|
|
|
446
447
|
*/
|
|
447
448
|
export declare function drawnNames(spec: ChartSpec): Set<string>;
|
|
448
449
|
/**
|
|
449
|
-
* The local guess at what `plan`'s rows and measures mean:
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
* `(current)` row names, and a status
|
|
450
|
+
* The local guess at what `plan`'s rows and measures mean: each measure's
|
|
451
|
+
* {@link Polarity} as far as its unit says ({@link dimPolarity}; what a name
|
|
452
|
+
* means — `Memory` as a capacity or a cost — is the judge's call), rivals from
|
|
453
|
+
* the label's header, focus from bolded or `(current)` row names, and a status
|
|
454
|
+
* column whose cells vary.
|
|
453
455
|
*/
|
|
454
456
|
export declare function guessMeaning(table: TableAnalysis, plan: ChartPlan): Pick<ChartPlan, "polarity" | "rowPolarity" | "rivals" | "focus" | "status">;
|
|
455
457
|
/** Whether `plan`'s rows may each be a metric of their own: a `change`, a transposed table, or mixed-unit columns. */
|