@linxiraos/pi-tui 1.1.27 → 1.2.0
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 +47 -463
- package/README.md +7 -5
- package/dist/types/app-keybindings.d.ts +1 -1
- package/dist/types/apps/cleanse-board.d.ts +1 -1
- package/dist/types/apps/debug/log-viewer.d.ts +4 -0
- package/dist/types/apps/debug/raw-sse-buffer.d.ts +2 -0
- package/dist/types/apps/git/git-tui.d.ts +2 -2
- package/dist/types/apps/git/help.d.ts +3 -1
- package/dist/types/apps/if-bench-board.d.ts +2 -2
- package/dist/types/apps/setup-model-picker.d.ts +1 -1
- package/dist/types/autocomplete.d.ts +5 -2
- package/dist/types/charts/chart-plan.d.ts +674 -0
- package/dist/types/charts/chart-svg.d.ts +59 -0
- package/dist/types/charts/table-data.d.ts +175 -0
- package/dist/types/chat/assistant-message.d.ts +5 -0
- package/dist/types/chat/chat-transcript-builder.d.ts +2 -0
- package/dist/types/chat/compaction-summary-message.d.ts +1 -0
- package/dist/types/chat/execution-shared.d.ts +6 -5
- package/dist/types/chat/fence-figure.d.ts +42 -0
- package/dist/types/chat/figure-markdown.d.ts +42 -0
- package/dist/types/chat/messages.d.ts +1 -1
- package/dist/types/chat/svg-figure.d.ts +33 -0
- package/dist/types/chat/svg-source.d.ts +49 -0
- package/dist/types/chat/table-chart.d.ts +89 -0
- package/dist/types/chat/tool-execution.d.ts +2 -0
- package/dist/types/chat/user-message.d.ts +15 -2
- package/dist/types/chrome/shared.d.ts +9 -0
- package/dist/types/chrome/transcript-container.d.ts +6 -0
- package/dist/types/components/box.d.ts +1 -0
- package/dist/types/components/disclosure.d.ts +1 -0
- package/dist/types/components/editor.d.ts +15 -4
- package/dist/types/components/form.d.ts +1 -0
- package/dist/types/components/image.d.ts +12 -44
- package/dist/types/components/key-value-list.d.ts +1 -0
- package/dist/types/components/layout/row.d.ts +1 -0
- package/dist/types/components/layout/stack.d.ts +1 -0
- package/dist/types/components/markdown.d.ts +36 -3
- package/dist/types/components/scroll-view.d.ts +1 -0
- package/dist/types/components/section.d.ts +1 -0
- package/dist/types/components/table.d.ts +1 -0
- package/dist/types/components/text.d.ts +1 -0
- package/dist/types/components/tree-view.d.ts +7 -0
- package/dist/types/components/truncated-text.d.ts +1 -0
- package/dist/types/fuzzy.d.ts +29 -1
- package/dist/types/key-hint-format.d.ts +1 -1
- package/dist/types/keybinding-matchers.d.ts +3 -0
- package/dist/types/keybindings.d.ts +1 -1
- package/dist/types/kitty-graphics.d.ts +2 -2
- package/dist/types/loop-watchdog.d.ts +8 -7
- package/dist/types/multiplexers/cmux.d.ts +16 -0
- package/dist/types/multiplexers/herdr.d.ts +26 -0
- package/dist/types/multiplexers/notify.d.ts +13 -0
- package/dist/types/multiplexers/orca.d.ts +12 -0
- package/dist/types/multiplexers/screen.d.ts +9 -0
- package/dist/types/multiplexers/tmux.d.ts +29 -0
- package/dist/types/multiplexers/types.d.ts +100 -0
- package/dist/types/multiplexers/wmux.d.ts +12 -0
- package/dist/types/multiplexers/zellij.d.ts +12 -0
- package/dist/types/native/backend.d.ts +3 -2
- package/dist/types/native/blobs.d.ts +7 -3
- package/dist/types/native/encode.d.ts +3 -4
- package/dist/types/native/overlay.d.ts +5 -0
- package/dist/types/overlays/agent-hub-projection.d.ts +6 -5
- package/dist/types/overlays/agent-hub-types.d.ts +9 -0
- package/dist/types/overlays/agent-hub.d.ts +2 -0
- package/dist/types/overlays/agent-transcript-viewer.d.ts +11 -2
- package/dist/types/overlays/agents-hub.d.ts +9 -0
- package/dist/types/overlays/annotation-overlay.d.ts +19 -2
- package/dist/types/overlays/annotation-types.d.ts +2 -0
- package/dist/types/overlays/ask-dialog.d.ts +5 -2
- package/dist/types/overlays/history-search.d.ts +10 -0
- package/dist/types/overlays/hook-selector.d.ts +9 -4
- package/dist/types/overlays/jobs-panel.d.ts +1 -7
- package/dist/types/overlays/model-browser.d.ts +54 -7
- package/dist/types/overlays/model-hub.d.ts +23 -0
- package/dist/types/overlays/oauth-selector.d.ts +0 -1
- package/dist/types/overlays/plan-review-overlay.d.ts +3 -2
- package/dist/types/overlays/session-observer-registry.d.ts +2 -0
- package/dist/types/overlays/session-selector.d.ts +6 -2
- package/dist/types/overlays/settings-defs.d.ts +1 -0
- package/dist/types/overlays/usage-dashboard.d.ts +8 -4
- package/dist/types/overlays/usage-display.d.ts +3 -1
- package/dist/types/prompt/composer.d.ts +1 -1
- package/dist/types/prompt/custom-editor.d.ts +11 -8
- package/dist/types/prompt/image-source.d.ts +2 -1
- package/dist/types/prompt/interactive-context-helpers.d.ts +4 -1
- package/dist/types/prompt/model-mention-autocomplete.d.ts +1 -1
- package/dist/types/prompt/welcome.d.ts +6 -1
- package/dist/types/render/composite.d.ts +2 -0
- package/dist/types/render/output-pane.d.ts +1 -0
- package/dist/types/render/render-utils.d.ts +1 -0
- package/dist/types/render/tool-card.d.ts +6 -0
- package/dist/types/render/width-aware-text.d.ts +2 -0
- package/dist/types/setup/scenes/types.d.ts +1 -0
- package/dist/types/status-line/component.d.ts +3 -0
- package/dist/types/status-line/host.d.ts +4 -1
- package/dist/types/status-line/segments.d.ts +2 -0
- package/dist/types/status-line/types.d.ts +14 -3
- package/dist/types/terminal-capabilities.d.ts +27 -35
- package/dist/types/terminal-multiplexer.d.ts +127 -14
- package/dist/types/terminal.d.ts +22 -6
- package/dist/types/theme/active-symbols.d.ts +1 -1
- package/dist/types/theme/schema.d.ts +11 -2
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/theme/theme-class.d.ts +7 -0
- package/dist/types/theme/theme.d.ts +1 -1
- package/dist/types/theme/tui-adapters.d.ts +3 -0
- package/dist/types/tmux.d.ts +11 -4
- package/dist/types/tools/daemon.d.ts +1 -1
- package/dist/types/tools/eval.d.ts +22 -3
- package/dist/types/tools/glob.d.ts +4 -0
- package/dist/types/tools/native-view.d.ts +47 -0
- package/dist/types/tools/output-meta.d.ts +11 -1
- package/dist/types/tools/renderer.d.ts +37 -2
- package/dist/types/tools/streaming-output.d.ts +20 -1
- package/dist/types/tools/task.d.ts +0 -4
- package/dist/types/tools/write.d.ts +9 -2
- package/dist/types/tools/yield.d.ts +22 -0
- package/dist/types/tui.d.ts +31 -0
- package/dist/types/utils.d.ts +6 -0
- package/dist/types/vim.d.ts +19 -5
- package/package.json +13 -9
- package/src/app-keybindings.d.ts +1 -1
- package/src/app-keybindings.ts +1 -1
- package/src/apps/autoresearch-dashboard.ts +7 -3
- package/src/apps/cleanse-board.ts +2 -2
- package/src/apps/cleanse-picker.ts +1 -1
- package/src/apps/debug/log-viewer.ts +188 -72
- package/src/apps/debug/raw-sse-buffer.ts +8 -0
- package/src/apps/debug/raw-sse.ts +39 -5
- package/src/apps/git/diff-pane.ts +26 -5
- package/src/apps/git/git-tui.ts +2 -2
- package/src/apps/git/help.ts +29 -20
- package/src/apps/if-bench-board.ts +2 -2
- package/src/apps/ps-top.ts +2 -2
- package/src/apps/setup-model-picker.ts +1 -1
- package/src/autocomplete.d.ts +5 -2
- package/src/autocomplete.ts +67 -43
- package/src/charts/chart-plan.d.ts +674 -0
- package/src/charts/chart-plan.ts +5081 -0
- package/src/charts/chart-svg.d.ts +59 -0
- package/src/charts/chart-svg.ts +4657 -0
- package/src/charts/table-data.d.ts +175 -0
- package/src/charts/table-data.ts +1478 -0
- package/src/chat/advisor-message.ts +11 -0
- package/src/chat/assistant-message.d.ts +5 -0
- package/src/chat/assistant-message.ts +219 -50
- package/src/chat/chat-transcript-builder.d.ts +2 -0
- package/src/chat/chat-transcript-builder.ts +5 -3
- package/src/chat/compaction-summary-message.d.ts +1 -0
- package/src/chat/compaction-summary-message.ts +8 -0
- package/src/chat/execution-shared.d.ts +6 -5
- package/src/chat/execution-shared.ts +42 -25
- package/src/chat/fence-figure.d.ts +42 -0
- package/src/chat/fence-figure.ts +80 -0
- package/src/chat/figure-markdown.d.ts +42 -0
- package/src/chat/figure-markdown.ts +174 -0
- package/src/chat/messages.d.ts +1 -1
- package/src/chat/messages.ts +1 -1
- package/src/chat/read-tool-group.ts +6 -4
- package/src/chat/skill-message.ts +6 -0
- package/src/chat/svg-figure.d.ts +33 -0
- package/src/chat/svg-figure.ts +399 -0
- package/src/chat/svg-source.d.ts +49 -0
- package/src/chat/svg-source.ts +188 -0
- package/src/chat/table-chart.d.ts +89 -0
- package/src/chat/table-chart.ts +294 -0
- package/src/chat/tool-execution.d.ts +2 -0
- package/src/chat/tool-execution.ts +80 -6
- package/src/chat/user-message.d.ts +15 -2
- package/src/chat/user-message.ts +55 -3
- package/src/chrome/shared.ts +53 -0
- package/src/chrome/transcript-container.d.ts +6 -0
- package/src/chrome/transcript-container.ts +93 -13
- package/src/components/box.d.ts +1 -0
- package/src/components/box.ts +5 -0
- package/src/components/disclosure.d.ts +1 -0
- package/src/components/disclosure.ts +8 -0
- package/src/components/editor.d.ts +15 -4
- package/src/components/editor.ts +294 -46
- package/src/components/form.d.ts +1 -0
- package/src/components/form.ts +8 -0
- package/src/components/image.d.ts +12 -44
- package/src/components/image.ts +47 -151
- package/src/components/key-value-list.d.ts +1 -0
- package/src/components/key-value-list.ts +4 -0
- package/src/components/layout/row.d.ts +1 -0
- package/src/components/layout/row.ts +7 -0
- package/src/components/layout/stack.d.ts +1 -0
- package/src/components/layout/stack.ts +7 -0
- package/src/components/markdown.d.ts +36 -3
- package/src/components/markdown.ts +433 -318
- package/src/components/scroll-view.d.ts +1 -0
- package/src/components/scroll-view.ts +5 -0
- package/src/components/section.d.ts +1 -0
- package/src/components/section.ts +5 -0
- package/src/components/settings-list.ts +2 -0
- package/src/components/table.d.ts +1 -0
- package/src/components/table.ts +4 -0
- package/src/components/text.d.ts +1 -0
- package/src/components/text.ts +7 -0
- package/src/components/tree-view.d.ts +7 -0
- package/src/components/tree-view.ts +38 -8
- package/src/components/truncated-text.d.ts +1 -0
- package/src/components/truncated-text.ts +5 -0
- package/src/desktop-notify.ts +1 -1
- package/src/fuzzy.d.ts +29 -1
- package/src/fuzzy.ts +115 -30
- package/src/key-hint-format.d.ts +1 -1
- package/src/key-hint-format.ts +1 -1
- package/src/keybinding-matchers.d.ts +3 -0
- package/src/keybinding-matchers.ts +6 -2
- package/src/keybindings.d.ts +1 -1
- package/src/keybindings.ts +1 -1
- package/src/kitty-graphics.d.ts +2 -2
- package/src/kitty-graphics.ts +4 -4
- package/src/loop-watchdog.d.ts +8 -7
- package/src/loop-watchdog.ts +18 -13
- package/src/multiplexers/cmux.d.ts +16 -0
- package/src/multiplexers/cmux.ts +29 -0
- package/src/multiplexers/herdr.d.ts +26 -0
- package/src/multiplexers/herdr.ts +64 -0
- package/src/multiplexers/notify.d.ts +13 -0
- package/src/multiplexers/notify.ts +24 -0
- package/src/multiplexers/orca.d.ts +12 -0
- package/src/multiplexers/orca.ts +16 -0
- package/src/multiplexers/screen.d.ts +9 -0
- package/src/multiplexers/screen.ts +15 -0
- package/src/multiplexers/tmux.d.ts +29 -0
- package/src/multiplexers/tmux.ts +40 -0
- package/src/multiplexers/types.d.ts +100 -0
- package/src/multiplexers/types.ts +110 -0
- package/src/multiplexers/wmux.d.ts +12 -0
- package/src/multiplexers/wmux.ts +16 -0
- package/src/multiplexers/zellij.d.ts +12 -0
- package/src/multiplexers/zellij.ts +24 -0
- package/src/native/backend.d.ts +3 -2
- package/src/native/backend.ts +174 -18
- package/src/native/blobs.d.ts +7 -3
- package/src/native/blobs.ts +47 -12
- package/src/native/encode.d.ts +3 -4
- package/src/native/encode.ts +58 -31
- package/src/native/overlay.d.ts +5 -0
- package/src/native/overlay.ts +13 -0
- package/src/native/reconcile.ts +4 -0
- package/src/overlays/agent-hub-projection.d.ts +6 -5
- package/src/overlays/agent-hub-projection.ts +124 -13
- package/src/overlays/agent-hub-types.d.ts +9 -0
- package/src/overlays/agent-hub-types.ts +6 -0
- package/src/overlays/agent-hub.ts +44 -29
- package/src/overlays/agent-transcript-viewer.ts +91 -23
- package/src/overlays/agents-hub.ts +28 -8
- package/src/overlays/annotation-overlay.ts +293 -90
- package/src/overlays/annotation-types.ts +2 -0
- package/src/overlays/ask-dialog.ts +7 -10
- package/src/overlays/btw-history-panel.ts +12 -1
- package/src/overlays/copy-selector.ts +30 -8
- package/src/overlays/extensions/state-manager.ts +52 -12
- package/src/overlays/history-search.ts +100 -7
- package/src/overlays/hook-selector.ts +12 -5
- package/src/overlays/jobs-panel.ts +28 -46
- package/src/overlays/model-browser.ts +341 -110
- package/src/overlays/model-hub.ts +300 -49
- package/src/overlays/move-overlay.ts +28 -14
- package/src/overlays/oauth-selector.ts +54 -70
- package/src/overlays/plan-review-overlay.ts +194 -70
- package/src/overlays/plugin-settings.ts +3 -3
- package/src/overlays/report-panel.ts +2 -2
- package/src/overlays/rewind-selector.ts +86 -17
- package/src/overlays/session-observer-registry.d.ts +2 -0
- package/src/overlays/session-observer-registry.ts +10 -2
- package/src/overlays/session-selector.ts +64 -26
- package/src/overlays/settings-defs.ts +4 -3
- package/src/overlays/settings-selector.ts +33 -8
- package/src/overlays/snapcompact-shape-preview.ts +2 -3
- package/src/overlays/stats-notice.ts +1 -1
- package/src/overlays/tree-selector.ts +41 -20
- package/src/overlays/usage-dashboard.ts +100 -50
- package/src/overlays/usage-display.ts +10 -4
- package/src/prompt/attachment-chips.ts +15 -11
- package/src/prompt/composer-attachments.ts +6 -4
- package/src/prompt/composer.ts +4 -15
- package/src/prompt/custom-editor.ts +54 -26
- package/src/prompt/image-source.ts +2 -1
- package/src/prompt/interactive-context-helpers.ts +30 -18
- package/src/prompt/macos-spelling.ts +7 -0
- package/src/prompt/magic-keywords.ts +11 -2
- package/src/prompt/model-mention-autocomplete.ts +14 -14
- package/src/prompt/tips.txt +6 -5
- package/src/prompt/welcome.ts +55 -12
- package/src/prompt/word-completion.ts +38 -5
- package/src/render/composite.d.ts +2 -0
- package/src/render/composite.ts +64 -0
- package/src/render/output-pane.d.ts +1 -0
- package/src/render/output-pane.ts +6 -0
- package/src/render/render-utils.d.ts +1 -0
- package/src/render/render-utils.ts +11 -0
- package/src/render/tool-card.d.ts +6 -0
- package/src/render/tool-card.ts +15 -0
- package/src/render/width-aware-text.d.ts +2 -0
- package/src/render/width-aware-text.ts +5 -0
- package/src/setup/scenes/model.ts +2 -1
- package/src/setup/scenes/types.ts +1 -0
- package/src/status-line/component.ts +292 -78
- package/src/status-line/host.ts +4 -1
- package/src/status-line/segments.ts +40 -22
- package/src/status-line/types.ts +15 -3
- package/src/terminal-capabilities.d.ts +27 -35
- package/src/terminal-capabilities.ts +75 -189
- package/src/terminal-multiplexer.d.ts +127 -14
- package/src/terminal-multiplexer.ts +112 -33
- package/src/terminal.d.ts +22 -6
- package/src/terminal.ts +139 -37
- package/src/theme/active-symbols.d.ts +1 -1
- package/src/theme/active-symbols.ts +1 -1
- package/src/theme/schema-validation.ts +1 -0
- package/src/theme/schema.d.ts +11 -2
- package/src/theme/schema.ts +14 -1
- package/src/theme/session-color.ts +1 -7
- package/src/theme/symbols.d.ts +1 -1
- package/src/theme/symbols.ts +6 -1
- package/src/theme/theme-class.d.ts +7 -0
- package/src/theme/theme-class.ts +26 -1
- package/src/theme/theme-schema.json +5 -1
- package/src/theme/theme.d.ts +1 -1
- package/src/theme/theme.ts +8 -4
- package/src/theme/tui-adapters.d.ts +3 -0
- package/src/theme/tui-adapters.ts +68 -0
- package/src/tmux.d.ts +11 -4
- package/src/tmux.ts +47 -11
- package/src/tools/ast-edit.ts +59 -35
- package/src/tools/ast-grep.ts +35 -16
- package/src/tools/bash.ts +92 -42
- package/src/tools/daemon.d.ts +1 -1
- package/src/tools/daemon.ts +1 -1
- package/src/tools/default-renderer.ts +35 -19
- package/src/tools/edit.ts +142 -120
- package/src/tools/eval-format/index.ts +28 -2
- package/src/tools/eval-format/javascript.ts +7 -5
- package/src/tools/eval.d.ts +22 -3
- package/src/tools/eval.ts +364 -208
- package/src/tools/fetch.ts +5 -6
- package/src/tools/glob.d.ts +4 -0
- package/src/tools/glob.ts +33 -65
- package/src/tools/grep.ts +81 -48
- package/src/tools/index.ts +2 -0
- package/src/tools/lsp.ts +81 -59
- package/src/tools/mcp.ts +111 -68
- package/src/tools/native-view.d.ts +47 -0
- package/src/tools/native-view.ts +102 -1
- package/src/tools/output-meta.d.ts +11 -1
- package/src/tools/output-meta.ts +23 -3
- package/src/tools/read.ts +7 -5
- package/src/tools/renderer.d.ts +37 -2
- package/src/tools/renderer.ts +42 -2
- package/src/tools/streaming-output.d.ts +20 -1
- package/src/tools/streaming-output.ts +149 -50
- package/src/tools/task.d.ts +0 -4
- package/src/tools/task.ts +112 -59
- package/src/tools/todo.ts +119 -30
- package/src/tools/wait.ts +34 -24
- package/src/tools/web-search.ts +1 -1
- package/src/tools/write.d.ts +9 -2
- package/src/tools/write.ts +147 -95
- package/src/tools/yield.d.ts +22 -0
- package/src/tools/yield.ts +225 -0
- package/src/tui.d.ts +31 -0
- package/src/tui.ts +309 -160
- package/src/utils.d.ts +6 -0
- package/src/utils.ts +19 -0
- package/src/vim.d.ts +19 -5
- package/src/vim.ts +333 -18
- package/src/windows-input-mode.ts +8 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { TerminalNotification } from "../terminal-capabilities.js";
|
|
2
|
+
/**
|
|
3
|
+
* Classification tier. `session` markers outrank the TERM fallback; `outerApp`
|
|
4
|
+
* hosts rank below it so a multiplexer nested inside them still wins.
|
|
5
|
+
*/
|
|
6
|
+
export type TerminalMultiplexerPrecedence = "session" | "outerApp";
|
|
7
|
+
/**
|
|
8
|
+
* Notification delivery tier, tried in this order so the innermost target wins:
|
|
9
|
+
* a `pane` notifier addresses the exact pane through the multiplexer's CLI, a
|
|
10
|
+
* `surface` notifier addresses the containing app surface, and an `inBand`
|
|
11
|
+
* notifier rewrites the terminal's own notification sequence.
|
|
12
|
+
*/
|
|
13
|
+
export type TerminalMultiplexerNotificationTier = "pane" | "surface" | "inBand";
|
|
14
|
+
/** One notification offered to a multiplexer notifier. */
|
|
15
|
+
export interface TerminalMultiplexerNotificationRequest {
|
|
16
|
+
readonly message: string | TerminalNotification;
|
|
17
|
+
readonly env: NodeJS.ProcessEnv;
|
|
18
|
+
/** The host terminal's formatted OSC notification, or `null` when it notifies with a bare BEL. */
|
|
19
|
+
readonly sequence: string | null;
|
|
20
|
+
/** Write a sequence through the active terminal. */
|
|
21
|
+
write(data: string): void;
|
|
22
|
+
}
|
|
23
|
+
export interface TerminalMultiplexerNotifier {
|
|
24
|
+
readonly tier: TerminalMultiplexerNotificationTier;
|
|
25
|
+
/** Deliver the notification. `false` leaves it to the next notifier and then the terminal fallback. */
|
|
26
|
+
send(request: TerminalMultiplexerNotificationRequest): boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* OSC 8 handling inside a multiplexer session:
|
|
30
|
+
* - `render`: the multiplexer draws and opens links itself, so links work
|
|
31
|
+
* whatever the outer terminal supports, unless another session with a
|
|
32
|
+
* hyperlink policy sits in the path.
|
|
33
|
+
* - `drop`: never forwards OSC 8; its session anywhere in the path disables links.
|
|
34
|
+
* - `forward`: forwards OSC 8 once it self-reports (`TERM_PROGRAM`/`TERM_PROGRAM_VERSION`)
|
|
35
|
+
* at least `major.minor`; older or unreported versions stay off.
|
|
36
|
+
*/
|
|
37
|
+
export type TerminalMultiplexerHyperlinks = "render" | "drop" | {
|
|
38
|
+
readonly forward: {
|
|
39
|
+
/** Lowercase `TERM_PROGRAM` the multiplexer sets inside its panes. */
|
|
40
|
+
readonly termProgram: string;
|
|
41
|
+
readonly major: number;
|
|
42
|
+
readonly minor: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** A multiplexer that answers OSC 11 from a cached copy of the outer terminal's background color. */
|
|
46
|
+
export interface TerminalMultiplexerBackgroundColorCache {
|
|
47
|
+
/** Wrap a query so it reaches the outer terminal and refreshes the cache. */
|
|
48
|
+
passthrough(query: string): string;
|
|
49
|
+
/** How long the multiplexer needs to store the outer reply before the cache is re-read. */
|
|
50
|
+
readonly settleMs: number;
|
|
51
|
+
}
|
|
52
|
+
/** Everything omp needs to recognize one terminal multiplexer and adapt to it. */
|
|
53
|
+
export interface TerminalMultiplexerModule<Id extends string = string> {
|
|
54
|
+
readonly id: Id;
|
|
55
|
+
readonly precedence: TerminalMultiplexerPrecedence;
|
|
56
|
+
/** Every environment variable `isInside()` reads. */
|
|
57
|
+
readonly sessionEnvKeys: readonly string[];
|
|
58
|
+
/** Lowercase TERM prefix that identifies the multiplexer when its session markers were stripped. */
|
|
59
|
+
readonly termPrefix?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the multiplexer owns the screen grid. When true, rendering takes the
|
|
62
|
+
* multiplexer path (no scrollback rebuild, anchored resize, skipped probes).
|
|
63
|
+
*/
|
|
64
|
+
readonly ownsScreenGrid: boolean;
|
|
65
|
+
isInside(env?: NodeJS.ProcessEnv): boolean;
|
|
66
|
+
/** Routes notifications the multiplexer would otherwise swallow. */
|
|
67
|
+
readonly notifier?: TerminalMultiplexerNotifier;
|
|
68
|
+
/** OSC 8 policy inside a session; unset defers to the outer terminal. */
|
|
69
|
+
readonly hyperlinks?: TerminalMultiplexerHyperlinks;
|
|
70
|
+
/**
|
|
71
|
+
* The pane's VTE honors DEC 2026 even when DECRQM is unanswered or reports
|
|
72
|
+
* the mode unrecognized (status 0): synchronized output starts on inside a
|
|
73
|
+
* session, and an unrecognized report does not turn it off.
|
|
74
|
+
*/
|
|
75
|
+
readonly honorsSynchronizedOutput?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* The session does not reveal whether its client renders graphics while
|
|
78
|
+
* outer-terminal identity variables leak in, so images and Kitty
|
|
79
|
+
* placeholders stay off unless the user forces them.
|
|
80
|
+
*/
|
|
81
|
+
readonly imagesRequireOverride?: boolean;
|
|
82
|
+
/** Platforms where the multiplexer breaks OSC 11 passthrough, so host appearance is used instead. */
|
|
83
|
+
readonly backgroundQueryBrokenOn?: readonly NodeJS.Platform[];
|
|
84
|
+
/** Present when OSC 11 replies come from a cache an explicit refresh must update first. */
|
|
85
|
+
readonly backgroundColorCache?: TerminalMultiplexerBackgroundColorCache;
|
|
86
|
+
/** Expands REP into identical styled cells, so destructive replays REP-encode their padding. */
|
|
87
|
+
readonly expandsRepPadding?: boolean;
|
|
88
|
+
/** Expires a synchronized update after a deadline, so large rebuild replays renew DEC 2026 as they stream. */
|
|
89
|
+
readonly expiresSynchronizedOutput?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Restoring the alternate buffer schedules a redraw that ends a synchronized
|
|
92
|
+
* update early, so a synchronized resize rebuild stays on the main buffer.
|
|
93
|
+
*/
|
|
94
|
+
readonly altRestoreEndsSynchronizedOutput?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* May grow its grid before SIGWINCH reaches the app, so a rebuild-mode grow
|
|
97
|
+
* whose full viewport no longer reaches the bottom replays history.
|
|
98
|
+
*/
|
|
99
|
+
readonly growsBeforeSigwinch?: boolean;
|
|
100
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wmux is a Windows multiplexer (Electron + xterm.js) modeled on cmux/herdr that
|
|
3
|
+
* repaints its pane in place. WMUX_CLI / WMUX_PIPE are CLI path overrides and can
|
|
4
|
+
* be set outside a wmux terminal.
|
|
5
|
+
*/
|
|
6
|
+
export declare const wmuxMultiplexer: {
|
|
7
|
+
readonly id: "wmux";
|
|
8
|
+
readonly precedence: "session";
|
|
9
|
+
readonly sessionEnvKeys: readonly ["WMUX", "WMUX_SURFACE_ID"];
|
|
10
|
+
readonly ownsScreenGrid: true;
|
|
11
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const zellijMultiplexer: {
|
|
2
|
+
readonly id: "zellij";
|
|
3
|
+
readonly precedence: "session";
|
|
4
|
+
readonly sessionEnvKeys: readonly ["ZELLIJ"];
|
|
5
|
+
readonly ownsScreenGrid: true;
|
|
6
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
7
|
+
readonly notifier: {
|
|
8
|
+
readonly tier: "inBand";
|
|
9
|
+
readonly send: ({ sequence, write }: import("./types.js").TerminalMultiplexerNotificationRequest) => boolean;
|
|
10
|
+
};
|
|
11
|
+
readonly backgroundQueryBrokenOn: readonly ["darwin"];
|
|
12
|
+
};
|
|
@@ -48,8 +48,9 @@ export interface NativeBackendOptions {
|
|
|
48
48
|
/**
|
|
49
49
|
* The reply a v1 terminal is assumed to give before its real `hello` arrives
|
|
50
50
|
* (the `TERM_PROGRAM=tern` optimistic start): the whole vocabulary, the
|
|
51
|
-
* default APC limit and credits, the terminal's width, the appearance
|
|
52
|
-
* already detected, and
|
|
51
|
+
* default APC limit and credits, the terminal's width, the appearance omp
|
|
52
|
+
* already detected, full motion, and `blobs`, so a resumed session's images
|
|
53
|
+
* are asked about rather than resent before the reply comes.
|
|
53
54
|
*/
|
|
54
55
|
export declare function assumedTspHello(terminal: Terminal): TspHello;
|
|
55
56
|
export declare class NativeBackend {
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Content-addressed binary blobs (images) for `image` nodes.
|
|
3
3
|
*
|
|
4
4
|
* `describe()` registers the bytes and puts the returned id in `image.p.blob`;
|
|
5
|
-
* the native backend
|
|
6
|
-
*
|
|
5
|
+
* the native backend delivers each referenced blob once per terminal
|
|
6
|
+
* connection (asking the terminal first which it holds, or through its blob
|
|
7
|
+
* cache), else uploads it with verb `b` before the frame that first
|
|
8
|
+
* references it.
|
|
7
9
|
*/
|
|
8
10
|
import type { TspProps } from "@linxiraos/pi-wire";
|
|
9
11
|
import type { NativeNode } from "./node.js";
|
|
@@ -12,10 +14,12 @@ export interface NativeBlob {
|
|
|
12
14
|
readonly mime: string;
|
|
13
15
|
readonly bytes: Uint8Array;
|
|
14
16
|
}
|
|
15
|
-
/** Register
|
|
17
|
+
/** Register bytes for process-lifetime, id-only use. Prefer {@link nativeImageNode} for owned images. */
|
|
16
18
|
export declare function registerNativeBlob(bytes: Uint8Array, mime: string): string;
|
|
17
19
|
/** A registered blob by id. */
|
|
18
20
|
export declare function getNativeBlob(id: string): NativeBlob | undefined;
|
|
21
|
+
/** An image whose props own its bytes, including while hidden, unmounted, or awaiting upload. */
|
|
22
|
+
export declare function nativeImageNode(bytes: Uint8Array, mime: string, p?: Omit<TspProps<"image">, "blob" | "builtin">, key?: string): NativeNode;
|
|
19
23
|
/**
|
|
20
24
|
* An `image` node for a base64 payload: the bytes are registered as a blob and
|
|
21
25
|
* the pixel size probed from the header. Decoding and hashing cost real time,
|
|
@@ -15,11 +15,10 @@ export type TspIncoming = {
|
|
|
15
15
|
};
|
|
16
16
|
/** Message parameters (`k=v`, ASCII, never containing `;`). */
|
|
17
17
|
export type TspParams = Readonly<Record<string, string | number>>;
|
|
18
|
-
/** Split `body` into pieces of at most `limit` UTF-8 bytes, never inside a code point. */
|
|
19
|
-
export declare function splitUtf8(body: string, limit: number): string[];
|
|
20
18
|
/**
|
|
21
|
-
* Encode one logical message, chunked when `body` exceeds `limit` UTF-8 bytes
|
|
22
|
-
*
|
|
19
|
+
* Encode one logical message, chunked when `body` exceeds `limit` UTF-8 bytes:
|
|
20
|
+
* the first chunk carries `params`, every chunk `c=<id>` and all but the last
|
|
21
|
+
* `m=1`. Returns the complete byte string to write (all chunks, in order).
|
|
23
22
|
*/
|
|
24
23
|
export declare function encodeTspMessage(verb: TspVerb, body: string, params?: TspParams, limit?: number): string;
|
|
25
24
|
/** Encode a JSON message body. */
|
|
@@ -58,6 +58,11 @@ export interface ActionButtonOptions {
|
|
|
58
58
|
* which the component routes to the same code path as the key.
|
|
59
59
|
*/
|
|
60
60
|
export declare function actionButton(label: string, act: string, options?: ActionButtonOptions): NativeNode;
|
|
61
|
+
/**
|
|
62
|
+
* A bare `esc` keycap button for a view's top-right corner: a click sends
|
|
63
|
+
* `act` (default `close`), which the component routes to its Esc path.
|
|
64
|
+
*/
|
|
65
|
+
export declare function escCloseButton(act?: string, key?: string): NativeNode;
|
|
61
66
|
/** A row of {@link actionButton}s (role `zeta.actions`); `null` entries become the spacer that end-aligns what follows. */
|
|
62
67
|
export declare function actionBar(buttons: readonly (NativeNode | null)[], key?: string): NativeNode;
|
|
63
68
|
/** Spans of an annotation callout: a dim `label:` then the note. */
|
|
@@ -15,11 +15,12 @@ interface AgentTreeProjection<TRecord extends AgentRecordLike> {
|
|
|
15
15
|
export declare const STATUS_ORDER: Record<AgentStatus, number>;
|
|
16
16
|
/** Exact observer usage for one roster entry. */
|
|
17
17
|
export declare function progressMetrics(observed: ObservableSession | undefined): AgentMetrics | undefined;
|
|
18
|
-
/** Live session
|
|
18
|
+
/** Live session used to cache a row's direct assistant usage, including with observer progress. */
|
|
19
19
|
export declare function hubFallbackStatsSession<TRecord extends AgentRecordLike>(ref: TRecord, observed: ObservableSession | undefined): NonNullable<TRecord["session"]> | undefined;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Preserve progress/history for non-cost metrics, overlaying cumulative direct-session cost.
|
|
22
|
+
* Persisted `history.metrics.cost` is a leaf-scoped snapshot, so it never overrides live
|
|
23
|
+
* progress; only the cumulative direct-cost sources do.
|
|
23
24
|
*/
|
|
24
25
|
export declare function hubRowMetrics<TRecord extends AgentRecordLike>(ref: TRecord, observed: ObservableSession | undefined, sessionMetrics: WeakMap<object, {
|
|
25
26
|
metrics: AgentMetrics | undefined;
|
|
@@ -37,6 +38,6 @@ export declare function aggregateMetrics<TRecord extends AgentRecordLike>(args:
|
|
|
37
38
|
metrics: AggregateMetrics;
|
|
38
39
|
hasFallbackLiveSessions: boolean;
|
|
39
40
|
};
|
|
40
|
-
/** Parent-before-child projection preserving
|
|
41
|
-
export declare function projectAgentTree<TRecord extends AgentRecordLike>(refs: readonly TRecord[]): AgentTreeProjection<TRecord>;
|
|
41
|
+
/** Parent-before-child projection preserving initial subtree rank and prepending new siblings. */
|
|
42
|
+
export declare function projectAgentTree<TRecord extends AgentRecordLike>(refs: readonly TRecord[], rosterRank: ReadonlyMap<TRecord, number> | undefined): AgentTreeProjection<TRecord>;
|
|
42
43
|
export {};
|
|
@@ -28,6 +28,13 @@ export interface AgentHubSession {
|
|
|
28
28
|
messages: AgentMessage[];
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
/** Existing session ledger includes off-transcript model usage and nested-task attribution. */
|
|
32
|
+
readonly sessionManager?: {
|
|
33
|
+
getUsageStatistics(): {
|
|
34
|
+
cost: number;
|
|
35
|
+
subagentCost: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
31
38
|
getSessionStats(): {
|
|
32
39
|
tokens: {
|
|
33
40
|
input: number;
|
|
@@ -64,6 +71,8 @@ export interface AgentRecordLike {
|
|
|
64
71
|
resolvedModel?: string;
|
|
65
72
|
resolvedModelIsFallback?: boolean;
|
|
66
73
|
metrics?: AgentMetricsSummary;
|
|
74
|
+
/** Cumulative own-session assistant and model_usage cost, excluding nested task results. */
|
|
75
|
+
directCost?: number;
|
|
67
76
|
readOnly?: boolean;
|
|
68
77
|
outputPath?: string;
|
|
69
78
|
patchPath?: string;
|
|
@@ -114,6 +114,8 @@ export declare class AgentHubOverlayComponent<TRecord extends AgentRecordLike =
|
|
|
114
114
|
* was raised by that gesture.
|
|
115
115
|
*/
|
|
116
116
|
armCloseTap(): void;
|
|
117
|
+
/** Show `section`, as a slash-command deep link into an already-open hub does. */
|
|
118
|
+
showSection(section: AgentHubSection): void;
|
|
117
119
|
/**
|
|
118
120
|
* Open the fullscreen transcript viewer for an agent id (public for table Enter
|
|
119
121
|
* and tests). Mounts {@link AgentTranscriptViewer} as a `fullscreen` overlay so it
|
|
@@ -23,7 +23,7 @@ import type { AgentHubRegistry } from "./agent-hub-types.js";
|
|
|
23
23
|
import type { SessionMessageEntryLike } from "../chat/transcript-entry.js";
|
|
24
24
|
import type { SessionObserverRegistry } from "./session-observer-registry.js";
|
|
25
25
|
import type { AgentHubRemote } from "./agent-hub.js";
|
|
26
|
-
import type { DescribeContext, NativeNode } from "../native/node.js";
|
|
26
|
+
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
|
|
27
27
|
/** Parsed message and model metadata relevant to a transcript viewer. */
|
|
28
28
|
export type AgentTranscriptEntry = SessionMessageEntryLike | {
|
|
29
29
|
type: "model_change";
|
|
@@ -31,7 +31,14 @@ export type AgentTranscriptEntry = SessionMessageEntryLike | {
|
|
|
31
31
|
};
|
|
32
32
|
/** Local filesystem and session parsing capabilities supplied by the host. */
|
|
33
33
|
export interface AgentTranscriptSource {
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Sync primitives drive the first paint and the incremental tail. When the
|
|
36
|
+
* host also supplies `promises.readFile` (e.g. passes `node:fs` itself), full
|
|
37
|
+
* reloads after rotation/rewrite read the file off the UI thread.
|
|
38
|
+
*/
|
|
39
|
+
fs: Pick<typeof fs, "openSync" | "closeSync" | "readSync" | "readFileSync" | "statSync"> & {
|
|
40
|
+
promises?: Pick<typeof fs.promises, "readFile">;
|
|
41
|
+
};
|
|
35
42
|
parseEntries(text: string): AgentTranscriptEntry[];
|
|
36
43
|
}
|
|
37
44
|
export interface AgentTranscriptViewerDeps {
|
|
@@ -70,6 +77,8 @@ export declare class AgentTranscriptViewer implements Component {
|
|
|
70
77
|
dispose(): void;
|
|
71
78
|
handleInput(data: string): void;
|
|
72
79
|
render(width: number): readonly string[];
|
|
80
|
+
/** The top-right `esc` runs Esc. */
|
|
81
|
+
handleNativeEvent(event: NativeUiEvent): void;
|
|
73
82
|
/**
|
|
74
83
|
* Header, transcript body (the builder's container, which describes its own
|
|
75
84
|
* blocks), notice, message editor, stats and key hints. Scrolling is the
|
|
@@ -60,6 +60,15 @@ export interface AgentsHubDeps {
|
|
|
60
60
|
export interface AgentsHubCallbacks {
|
|
61
61
|
onCancel: () => void;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Parse model output into a {@link GeneratedAgentSpec}. Accepts a bare JSON object
|
|
65
|
+
* (tried first) or one wrapped in a code fence. Returns the spec with trimmed fields.
|
|
66
|
+
* Throws if the output is not valid JSON or not an object, if `identifier`, `whenToUse`
|
|
67
|
+
* or `systemPrompt` is missing or not a string, if the identifier is not lowercase
|
|
68
|
+
* kebab-case with 2+ words, if `whenToUse` does not start with "Use this agent when",
|
|
69
|
+
* or if `systemPrompt` is empty.
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseGeneratedAgentSpec(raw: string): GeneratedAgentSpec;
|
|
63
72
|
/**
|
|
64
73
|
* The fullscreen agents hub component. Hosted via
|
|
65
74
|
* `ui.showOverlay(..., { fullscreen: true })`; the host must call
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Focusable, type TUI } from "../index.js";
|
|
2
2
|
import { type KeybindingsManager } from "../app-keybindings.js";
|
|
3
3
|
import { type Theme } from "../theme/theme.js";
|
|
4
4
|
import type { CodeReviewAnnotation, CodeReviewOverlayResult, ReviewDiffFile, TextReviewAnnotation, TextReviewOverlayResult, TextReviewSource } from "./annotation-types.js";
|
|
@@ -10,6 +10,8 @@ export interface AnnotationOverlayCallbacks {
|
|
|
10
10
|
onWarning?(message: string): void;
|
|
11
11
|
/** Open the draft in the host's editor and invoke `commit` with its result. */
|
|
12
12
|
onAnnotationExternalEditor?(draft: string, commit: (text: string | null) => void): void | Promise<void>;
|
|
13
|
+
/** Open the current source in the host's editor. The overlay stays open. */
|
|
14
|
+
onExternalEditor?(): void | Promise<void>;
|
|
13
15
|
}
|
|
14
16
|
export interface CodeReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
|
|
15
17
|
onComplete(result: CodeReviewOverlayResult | undefined): void;
|
|
@@ -17,15 +19,30 @@ export interface CodeReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
|
|
|
17
19
|
export interface TextReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
|
|
18
20
|
onComplete(result: TextReviewOverlayResult | undefined): void;
|
|
19
21
|
}
|
|
22
|
+
/** Splits a text source into the overlay's 1-based annotatable lines. */
|
|
23
|
+
export declare function splitTextLines(text: string): string[];
|
|
20
24
|
/** A fullscreen, annotated diff picker that only relies on public OMP APIs. */
|
|
21
|
-
export declare class AnnotationOverlay implements
|
|
25
|
+
export declare class AnnotationOverlay implements Focusable {
|
|
22
26
|
#private;
|
|
27
|
+
focused: boolean;
|
|
23
28
|
constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, files: readonly ReviewDiffFile[], mode: string, callbacks: CodeReviewOverlayCallbacks);
|
|
24
29
|
constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, source: TextReviewSource, callbacks: TextReviewOverlayCallbacks);
|
|
30
|
+
/** Keep the nested editor's cursor mode aligned with the overlay focus target. */
|
|
31
|
+
setUseTerminalCursor(useTerminalCursor: boolean): void;
|
|
25
32
|
invalidate(): void;
|
|
26
33
|
dispose(): void;
|
|
27
34
|
getAnnotations(): CodeReviewAnnotation[];
|
|
28
35
|
getTextAnnotations(): TextReviewAnnotation[];
|
|
36
|
+
/** Repo-relative path of the diff file under the cursor, if this is a code review. */
|
|
37
|
+
reviewFilePath(): string | undefined;
|
|
38
|
+
/** Current text-source bytes, including edits applied by {@link replaceTextSource}. */
|
|
39
|
+
textSourceText(): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Replace the text under review. Line notes whose quote still sits on the
|
|
42
|
+
* same row stay; a quote that moved to exactly one row is retargeted;
|
|
43
|
+
* every other line note is dropped. Returns how many were dropped.
|
|
44
|
+
*/
|
|
45
|
+
replaceTextSource(text: string): number;
|
|
29
46
|
handleInput(data: string): void;
|
|
30
47
|
describe(): NativeNode;
|
|
31
48
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
@@ -101,8 +101,11 @@ export declare class AskDialogComponent implements Component {
|
|
|
101
101
|
handleInput(keyData: string): void;
|
|
102
102
|
render(width: number): readonly string[];
|
|
103
103
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
104
|
+
* In the dock, in the composer's place and framed as the composer is: a
|
|
105
|
+
* `col` with the prompt editor's root role (`zeta.editor`), so the terminal
|
|
106
|
+
* gives it the composer's insets and spacing. Not a modal `overlay` sheet:
|
|
107
|
+
* one anchored at the bottom covered the transcript rows that explain the
|
|
108
|
+
* question and blocked scrolling until the question was answered.
|
|
106
109
|
*/
|
|
107
110
|
describe(cx: DescribeContext): NativeNode;
|
|
108
111
|
/**
|
|
@@ -15,6 +15,13 @@ import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.
|
|
|
15
15
|
export declare class HistorySearchComponent extends OverlayPanel {
|
|
16
16
|
#private;
|
|
17
17
|
constructor(historyStorage: HistorySource, onSelect: (prompt: string) => void, onCancel: () => void);
|
|
18
|
+
/**
|
|
19
|
+
* Repaint hook for debounced result updates. Once set, query edits search
|
|
20
|
+
* storage after a {@link SEARCH_DEBOUNCE_MS} quiet period instead of on
|
|
21
|
+
* every key; without it every edit searches synchronously.
|
|
22
|
+
*/
|
|
23
|
+
setOnRequestRender(callback: () => void): void;
|
|
24
|
+
dispose(): void;
|
|
18
25
|
handleInput(keyData: string): void;
|
|
19
26
|
/**
|
|
20
27
|
* With the `picker` kind: a `size:"md"` sheet of past prompts (first line
|
|
@@ -29,6 +36,9 @@ export declare class HistorySearchComponent extends OverlayPanel {
|
|
|
29
36
|
* Picker: a row click highlights, a second click or `Insert` inserts it
|
|
30
37
|
* (Enter), `Close` cancels (Esc), `Clear search` empties the query.
|
|
31
38
|
* List: picking a result does what highlighting it and pressing Enter does.
|
|
39
|
+
* A row picked while a debounced search is pending belongs to the previous
|
|
40
|
+
* query: results are refreshed first and the pick only lands if that entry
|
|
41
|
+
* is still among them.
|
|
32
42
|
*/
|
|
33
43
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
34
44
|
}
|
|
@@ -57,6 +57,10 @@ export interface HookSelectorOptions {
|
|
|
57
57
|
/** Number of leading options (original order) that receive a selection
|
|
58
58
|
* marker. Defaults to every option when {@link selectionMarker} is set. */
|
|
59
59
|
markableCount?: number;
|
|
60
|
+
/** Describe as a card in the dock (the composer slot) instead of a picker
|
|
61
|
+
* sheet, so dock content above it (e.g. a `/omfg` candidate rule) stays
|
|
62
|
+
* visible and the transcript stays scrollable on native surfaces. */
|
|
63
|
+
inline?: boolean;
|
|
60
64
|
}
|
|
61
65
|
export interface HookSelectorOption {
|
|
62
66
|
label: string;
|
|
@@ -70,10 +74,11 @@ export declare class HookSelectorComponent extends OverlayPanel {
|
|
|
70
74
|
render(width: number): readonly string[];
|
|
71
75
|
dispose(): void;
|
|
72
76
|
/**
|
|
73
|
-
* A plain option list is a picker sheet. Otherwise
|
|
74
|
-
* title (plus the countdown `elapsed` when a
|
|
75
|
-
* lines, the slider as `tabs`, the options as
|
|
76
|
-
* option index, the search query while typing,
|
|
77
|
+
* A plain option list is a picker sheet. Otherwise (inline, slider, or
|
|
78
|
+
* countdown) a card headed by the title (plus the countdown `elapsed` when a
|
|
79
|
+
* timeout runs), the extra title lines, the slider as `tabs`, the options as
|
|
80
|
+
* a `list` keyed by original option index, the search query while typing,
|
|
81
|
+
* and the key hints.
|
|
77
82
|
*/
|
|
78
83
|
describe(cx: DescribeContext): NativeNode;
|
|
79
84
|
/** Pointer pick of an option does what highlighting it and pressing Enter does; a tab pick moves the slider. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Component } from "../tui.js";
|
|
2
2
|
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
|
|
3
3
|
/** One async job as the session snapshots it. */
|
|
4
4
|
export interface JobsPanelJob {
|
|
@@ -40,12 +40,6 @@ export interface JobsSheetSource {
|
|
|
40
40
|
/** Dismiss the sheet. */
|
|
41
41
|
close(): void;
|
|
42
42
|
}
|
|
43
|
-
/** The `/jobs` block: `ansi` renders in the terminal, the snapshot describes the native frame. */
|
|
44
|
-
export declare class JobsPanel extends Container {
|
|
45
|
-
#private;
|
|
46
|
-
constructor(snapshot: JobsPanelSnapshot, nowMs: number, ansi: readonly Component[]);
|
|
47
|
-
describe(cx: DescribeContext): NativeNode;
|
|
48
|
-
}
|
|
49
43
|
/**
|
|
50
44
|
* The jobs pill's sheet: a centred `lg` glass sheet titled Background jobs.
|
|
51
45
|
* A selectable list of every job (running first) sits over the selected
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Model } from "@linxiraos/pi-ai";
|
|
2
|
-
import type
|
|
2
|
+
import { type ModelKind } from "@linxiraos/pi-catalog/types";
|
|
3
3
|
import type { Component } from "../tui.js";
|
|
4
4
|
import type { SgrMouseEvent } from "../mouse.js";
|
|
5
5
|
import { type ConfiguredThinkingLevel } from "../thinking.js";
|
|
@@ -37,6 +37,17 @@ export interface ResolvedModelRoleValue {
|
|
|
37
37
|
explicitThinkingLevel: boolean;
|
|
38
38
|
warning?: string;
|
|
39
39
|
}
|
|
40
|
+
/** Where auto-compaction triggers for one model, as the model hub's preview shows it (edited from the Roles view). */
|
|
41
|
+
export interface ModelCompactionPoint {
|
|
42
|
+
/** Context tokens that trigger auto-compaction; undefined when auto-compaction is off or the window is unknown. */
|
|
43
|
+
tokens: number | undefined;
|
|
44
|
+
/** Why it triggers there, in a few words: `fixed`, `85% of 400K base`, `80% of window`. */
|
|
45
|
+
basis?: string;
|
|
46
|
+
/** What sets it: the matching `compaction.modelThresholds` key, `global`, or `default`. */
|
|
47
|
+
source: string;
|
|
48
|
+
/** The model's own exact entry as editable text (`90k`, `80%`); absent when it has none. */
|
|
49
|
+
draft?: string;
|
|
50
|
+
}
|
|
40
51
|
/** Host-provided preferences and model-role resolution for the browser. */
|
|
41
52
|
export interface ModelBrowserSource extends ModelRoleLookup {
|
|
42
53
|
/**
|
|
@@ -49,11 +60,17 @@ export interface ModelBrowserSource extends ModelRoleLookup {
|
|
|
49
60
|
readonly knownRoleIds: readonly string[];
|
|
50
61
|
readonly mruOrder: readonly string[];
|
|
51
62
|
readonly modelPerf: ReadonlyMap<string, ModelBrowserPerf>;
|
|
63
|
+
/**
|
|
64
|
+
* Service tier the host would send for `model`, when it runs one. Rows with a
|
|
65
|
+
* measured tier aggregate (`selector@tier`) then display that tier's numbers
|
|
66
|
+
* instead of the standard aggregate.
|
|
67
|
+
*/
|
|
68
|
+
serviceTierFor?(model: Model): string | undefined;
|
|
52
69
|
getRoleInfo(role: string): ModelBrowserRoleInfo;
|
|
53
|
-
/** True when the provider was injected from the upstream OMP model config. */
|
|
54
|
-
isOmpOriginProvider?(provider: string): boolean;
|
|
55
70
|
defaultRoleChain(role: string): string[];
|
|
56
71
|
resolveRoleValue(value: string | undefined, models: Model[], roleLookup?: ModelRoleLookup): ResolvedModelRoleValue;
|
|
72
|
+
/** Auto-compaction point for `model`; absent hosts show no compaction row in the preview. */
|
|
73
|
+
compactionPointFor?(model: Model): ModelCompactionPoint | undefined;
|
|
57
74
|
}
|
|
58
75
|
/** Read-only catalog surface consumed by model browsers. */
|
|
59
76
|
export interface ModelBrowserRegistry {
|
|
@@ -86,6 +103,14 @@ export type RoleAssignments = Record<string, RoleAssignment | undefined>;
|
|
|
86
103
|
* the alt+p session picker.
|
|
87
104
|
*/
|
|
88
105
|
export declare function resolveRoleAssignments(settings: ModelBrowserSource, allModels: ReadonlyArray<Model>, autoCandidates: ReadonlyArray<Model>): RoleAssignments;
|
|
106
|
+
/**
|
|
107
|
+
* Role-resolution pool for a `--models`/`enabledModels` scope: the scoped
|
|
108
|
+
* models plus every available non-chat runner (judge, search, image, …). The
|
|
109
|
+
* scope only filters chat models (it feeds Ctrl+P cycling) and runtime role
|
|
110
|
+
* resolution ignores it for other kinds, so displayed role assignments must too.
|
|
111
|
+
* Shared by the /models hub and the session picker.
|
|
112
|
+
*/
|
|
113
|
+
export declare function scopedRolePool(scoped: ReadonlyArray<Model>, registry: ModelBrowserRegistry): Model[];
|
|
89
114
|
/** Wrap raw models into browser items. */
|
|
90
115
|
export declare function buildBrowserItems(models: ReadonlyArray<Model>): ModelBrowserItem[];
|
|
91
116
|
/** Options for {@link sortModelItems}. */
|
|
@@ -136,12 +161,28 @@ export interface SearchAffinity {
|
|
|
136
161
|
* policy, not evidence of user preference.
|
|
137
162
|
*/
|
|
138
163
|
export declare function buildSearchAffinity(providerOrder: ReadonlyArray<string>, roles: RoleAssignments, mruOrder: ReadonlyArray<string>): SearchAffinity;
|
|
139
|
-
/**
|
|
140
|
-
export
|
|
164
|
+
/** Inputs to {@link rankModelItems} / {@link ModelItemRanker}. */
|
|
165
|
+
export interface ModelRankOptions {
|
|
141
166
|
roles: RoleAssignments;
|
|
142
167
|
mruOrder: ReadonlyArray<string>;
|
|
143
168
|
affinity: SearchAffinity;
|
|
144
|
-
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* {@link rankModelItems} prepared for one candidate list: the fuzzy index, the
|
|
172
|
+
* MRU/version order, and the affinity ranks depend only on the items and options,
|
|
173
|
+
* so per-keystroke callers (composer mentions, `/switch` arguments, the picker)
|
|
174
|
+
* hold one ranker and pay only the per-query fuzzy scan.
|
|
175
|
+
*/
|
|
176
|
+
export declare class ModelItemRanker {
|
|
177
|
+
#private;
|
|
178
|
+
readonly items: ReadonlyArray<ModelBrowserItem>;
|
|
179
|
+
readonly options: ModelRankOptions;
|
|
180
|
+
constructor(items: ReadonlyArray<ModelBrowserItem>, options: ModelRankOptions);
|
|
181
|
+
/** Rank by text relevance, user affinity, and MRU/version order. */
|
|
182
|
+
rank(query: string): ModelBrowserItem[];
|
|
183
|
+
}
|
|
184
|
+
/** Rank picker and mention candidates by text relevance, user affinity, and MRU/version order. */
|
|
185
|
+
export declare function rankModelItems(query: string, items: ReadonlyArray<ModelBrowserItem>, options: ModelRankOptions): ModelBrowserItem[];
|
|
145
186
|
/**
|
|
146
187
|
* A slim role chip: `● default ◉` — solid dot for configured assignments,
|
|
147
188
|
* hollow for auto-selected fallbacks, thinking glyph attached when set.
|
|
@@ -157,7 +198,7 @@ export declare function rankModelItems(query: string, items: ReadonlyArray<Model
|
|
|
157
198
|
export declare function formatRoleChip(role: string, assignment: RoleAssignment, settings: ModelBrowserSource): string;
|
|
158
199
|
/** Fact columns of a model picker (Stencil `NATIVE_REDESIGN.md` §4.7); the lowest priority hides first. */
|
|
159
200
|
export declare const MODEL_PICKER_COLUMNS: readonly TspPickerColumn[];
|
|
160
|
-
/** The
|
|
201
|
+
/** The omp theme token of a thinking level's dot (`thinkingHigh`); none for inherit and auto. */
|
|
161
202
|
export declare function thinkingDotToken(level: ConfiguredThinkingLevel): string | undefined;
|
|
162
203
|
/**
|
|
163
204
|
* The fuzzy haystack for a model row: the displayed `provider/id`, plus `free`
|
|
@@ -242,6 +283,12 @@ export declare class ModelBrowser implements Component {
|
|
|
242
283
|
setQuery(query: string): void;
|
|
243
284
|
getSelected(): ModelBrowserItem | undefined;
|
|
244
285
|
get visibleCount(): number;
|
|
286
|
+
/**
|
|
287
|
+
* Base items matching the live query, best first, without the separator
|
|
288
|
+
* row; undefined while the query is blank. Reuses the ranking the list
|
|
289
|
+
* already ran, so hosts can derive match counts without ranking again.
|
|
290
|
+
*/
|
|
291
|
+
get queryMatches(): readonly ModelBrowserItem[] | undefined;
|
|
245
292
|
/** Move selection to `selector`; false when it is not in the current view. */
|
|
246
293
|
selectSelector(selector: string): boolean;
|
|
247
294
|
/** True when `item`'s context window is smaller than the live session token count (grayed row; hosts compact before switching). */
|
|
@@ -64,8 +64,31 @@ export interface ModelHubCallbacks {
|
|
|
64
64
|
onSwitchPreset?: (name: string) => void | Promise<void>;
|
|
65
65
|
/** Persist a new quick-switch cycle order (the ctrl+p role cycle). */
|
|
66
66
|
onCycleOrderChange?: (order: string[]) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Persist typed text as `model`'s own compaction limit: a token base the
|
|
69
|
+
* policy scales (`400k`), a fixed trigger (`f400k`), a percentage (`80%`), or
|
|
70
|
+
* empty to reset. Rejected input returns `{ kind: "error" }`; input that
|
|
71
|
+
* needs acknowledgement (one that opens the extended window) returns
|
|
72
|
+
* `{ kind: "confirm" }` until called again with the same text and
|
|
73
|
+
* `confirmed`. Either keeps the field open.
|
|
74
|
+
*/
|
|
75
|
+
onCompactionPointChange?: (model: Model, input: string, confirmed: boolean) => CompactionPointChangeResult | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* One short line on where `model` would compact with the typed limit
|
|
78
|
+
* (`compacts at 340K · 85% of 400K base`), shown beside the field while
|
|
79
|
+
* typing; undefined for input that does not parse or fit.
|
|
80
|
+
*/
|
|
81
|
+
previewCompactionPoint?: (model: Model, input: string) => string | undefined;
|
|
67
82
|
onCancel: () => void;
|
|
68
83
|
}
|
|
84
|
+
/** Why {@link ModelHubCallbacks.onCompactionPointChange} kept the field open. */
|
|
85
|
+
export type CompactionPointChangeResult = {
|
|
86
|
+
kind: "error";
|
|
87
|
+
message: string;
|
|
88
|
+
} | {
|
|
89
|
+
kind: "confirm";
|
|
90
|
+
message: string;
|
|
91
|
+
};
|
|
69
92
|
export interface ModelHubOptions {
|
|
70
93
|
/** Preselect this provider's sidebar entry (e.g. when reopening after /login). */
|
|
71
94
|
initialProviderId?: string;
|
|
@@ -39,5 +39,4 @@ export declare class OAuthSelectorComponent extends OverlayPanel {
|
|
|
39
39
|
* drives the hover band, and a left click selects and confirms like Enter.
|
|
40
40
|
*/
|
|
41
41
|
routeMouse(event: SgrMouseEvent, line: number, _col: number): void;
|
|
42
|
-
render(width: number): readonly string[];
|
|
43
42
|
}
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* Focus regions (`toc`/`body`/`actions`) cycle with Tab/Shift+Tab; arrows move
|
|
14
14
|
* within the focused region and step left into the sidebar. The default focus is
|
|
15
15
|
* `actions`, so the muscle memory of the old single-target overlay carries over:
|
|
16
|
-
* ↑/↓ select options, Enter confirms, ←/→ drives the slider
|
|
17
|
-
*
|
|
16
|
+
* ↑/↓ select options, Enter confirms, ←/→ drives the slider, g/G + PgUp/PgDn
|
|
17
|
+
* scroll, and the external-editor key opens the plan. Under Tern the options
|
|
18
|
+
* are a horizontal bar, so ←/→ select options and Shift+←/→ drive the slider.
|
|
18
19
|
*/
|
|
19
20
|
import { type Component } from "../index.js";
|
|
20
21
|
import type { HookSelectorSlider } from "./hook-selector.js";
|
|
@@ -58,6 +58,8 @@ export interface ObservableSession {
|
|
|
58
58
|
lastUpdate: number;
|
|
59
59
|
/** Latest progress snapshot from the subagent executor */
|
|
60
60
|
progress?: AgentProgress;
|
|
61
|
+
/** `Date.now()` when {@link progress} arrived; its `durationMs` was current then. */
|
|
62
|
+
progressAt?: number;
|
|
61
63
|
}
|
|
62
64
|
/** Coarse source of an observer change; callers use it to separate lifecycle work from high-frequency progress. */
|
|
63
65
|
export type SessionObserverChangeKind = "main" | "reset" | "lifecycle" | "progress";
|