@linxiraos/pi-tui 1.1.26 → 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 +51 -491
- package/README.md +13 -7
- package/dist/types/active-terminal.d.ts +30 -0
- package/dist/types/app-keybindings.d.ts +7 -2
- 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 +5 -4
- 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 +11 -1
- package/dist/types/chat/chat-transcript-builder.d.ts +3 -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 +17 -4
- package/dist/types/chrome/shared.d.ts +9 -0
- package/dist/types/chrome/status-notice.d.ts +15 -3
- 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 +23 -5
- package/dist/types/components/form.d.ts +1 -0
- package/dist/types/components/image.d.ts +26 -44
- package/dist/types/components/input.d.ts +2 -1
- 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/loader.d.ts +5 -6
- package/dist/types/components/markdown.d.ts +47 -5
- 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 +9 -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/apply.d.ts +4 -3
- package/dist/types/native/backend.d.ts +5 -4
- package/dist/types/native/blobs.d.ts +7 -3
- package/dist/types/native/encode.d.ts +8 -6
- package/dist/types/native/node.d.ts +36 -5
- package/dist/types/native/overlay.d.ts +8 -3
- package/dist/types/native/settle.d.ts +4 -3
- 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 +3 -0
- package/dist/types/overlays/agent-transcript-viewer.d.ts +12 -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/btw-history-panel.d.ts +13 -1
- package/dist/types/overlays/copy-selector.d.ts +1 -0
- package/dist/types/overlays/history-search.d.ts +10 -0
- package/dist/types/overlays/hook-selector.d.ts +9 -4
- package/dist/types/overlays/hub-frame.d.ts +4 -1
- 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 +37 -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/report-panel.d.ts +68 -0
- package/dist/types/overlays/rewind-selector.d.ts +1 -0
- 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/thinking-selector.d.ts +2 -2
- package/dist/types/overlays/usage-dashboard.d.ts +12 -8
- package/dist/types/overlays/usage-display.d.ts +3 -1
- package/dist/types/prompt/composer-cache.d.ts +0 -16
- package/dist/types/prompt/composer.d.ts +18 -3
- package/dist/types/prompt/custom-editor.d.ts +25 -13
- package/dist/types/prompt/image-source.d.ts +2 -1
- package/dist/types/prompt/interactive-context-helpers.d.ts +5 -1
- package/dist/types/prompt/model-mention-autocomplete.d.ts +1 -1
- package/dist/types/prompt/welcome.d.ts +7 -2
- 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/space-hold.d.ts +40 -25
- package/dist/types/status-line/component.d.ts +3 -0
- package/dist/types/status-line/context-usage.d.ts +7 -5
- 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 +41 -36
- package/dist/types/terminal-multiplexer.d.ts +127 -14
- package/dist/types/terminal.d.ts +23 -16
- 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/thinking.d.ts +1 -1
- package/dist/types/tmux.d.ts +11 -4
- package/dist/types/tools/bash.d.ts +7 -2
- 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 +2 -3
- package/dist/types/tools/write.d.ts +9 -2
- package/dist/types/tools/yield.d.ts +22 -0
- package/dist/types/tui.d.ts +36 -0
- package/dist/types/utils.d.ts +6 -0
- package/dist/types/vim.d.ts +19 -5
- package/dist/types/windows-input-mode.d.ts +33 -1
- package/package.json +13 -9
- package/src/active-terminal.d.ts +30 -0
- package/src/active-terminal.ts +80 -0
- package/src/app-keybindings.d.ts +7 -2
- package/src/app-keybindings.ts +7 -2
- 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 +96 -23
- package/src/apps/git/git-tui.ts +23 -16
- package/src/apps/git/help.ts +29 -20
- package/src/apps/git/sidebar.ts +8 -3
- 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/bracketed-paste.ts +10 -3
- 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 +11 -1
- package/src/chat/assistant-message.ts +245 -54
- package/src/chat/chat-transcript-builder.d.ts +3 -0
- package/src/chat/chat-transcript-builder.ts +9 -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 +86 -7
- package/src/chat/user-message.d.ts +17 -4
- package/src/chat/user-message.ts +71 -8
- package/src/chrome/shared.ts +53 -0
- package/src/chrome/status-notice.ts +25 -7
- package/src/chrome/transcript-container.d.ts +6 -0
- package/src/chrome/transcript-container.ts +162 -19
- 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 +23 -5
- package/src/components/editor.ts +316 -47
- package/src/components/form.d.ts +1 -0
- package/src/components/form.ts +8 -0
- package/src/components/image.d.ts +26 -44
- package/src/components/image.ts +115 -152
- package/src/components/input.d.ts +2 -1
- package/src/components/input.ts +17 -7
- 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/loader.d.ts +5 -6
- package/src/components/loader.ts +10 -17
- package/src/components/markdown.d.ts +47 -5
- package/src/components/markdown.ts +786 -303
- 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 +3 -2
- package/src/fuzzy.d.ts +29 -1
- package/src/fuzzy.ts +115 -30
- package/src/hotkeys-markdown.ts +9 -2
- package/src/key-hint-format.d.ts +9 -1
- package/src/key-hint-format.ts +26 -11
- 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 +11 -5
- 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/apply.d.ts +4 -3
- package/src/native/apply.ts +4 -3
- package/src/native/backend.d.ts +5 -4
- package/src/native/backend.ts +199 -22
- package/src/native/blobs.d.ts +7 -3
- package/src/native/blobs.ts +47 -12
- package/src/native/encode.d.ts +8 -6
- package/src/native/encode.ts +76 -34
- package/src/native/node.d.ts +36 -5
- package/src/native/node.ts +31 -5
- package/src/native/overlay.d.ts +8 -3
- package/src/native/overlay.ts +17 -4
- package/src/native/reconcile.ts +16 -4
- package/src/native/settle.d.ts +4 -3
- package/src/native/settle.ts +4 -3
- 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 +48 -29
- package/src/overlays/agent-transcript-viewer.ts +93 -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 +10 -17
- package/src/overlays/btw-history-panel.ts +136 -39
- package/src/overlays/copy-selector.d.ts +1 -0
- package/src/overlays/copy-selector.ts +32 -8
- package/src/overlays/extensions/extension-dashboard.ts +4 -4
- 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/hub-frame.ts +19 -1
- package/src/overlays/jobs-panel.ts +33 -52
- package/src/overlays/model-browser.ts +367 -122
- package/src/overlays/model-hub.ts +435 -59
- package/src/overlays/move-overlay.ts +28 -14
- package/src/overlays/oauth-selector.ts +54 -70
- package/src/overlays/pause-screen.ts +2 -2
- package/src/overlays/plan-review-overlay.ts +208 -70
- package/src/overlays/plugin-settings.ts +3 -3
- package/src/overlays/report-panel.ts +191 -0
- package/src/overlays/rewind-selector.ts +88 -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 +5 -4
- 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/thinking-selector.ts +11 -10
- package/src/overlays/tree-selector.ts +41 -20
- package/src/overlays/usage-dashboard.ts +117 -58
- package/src/overlays/usage-display.ts +10 -4
- package/src/overlays/usage-row.ts +22 -8
- package/src/prompt/attachment-chips.ts +15 -11
- package/src/prompt/composer-attachments.ts +6 -4
- package/src/prompt/composer-cache.ts +7 -86
- package/src/prompt/composer.ts +37 -26
- package/src/prompt/custom-editor.ts +282 -105
- package/src/prompt/image-source.ts +2 -1
- package/src/prompt/interactive-context-helpers.ts +32 -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/queued-messages.ts +6 -4
- package/src/prompt/tips.txt +13 -9
- package/src/prompt/welcome.ts +64 -46
- 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 +16 -1
- 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/space-hold.d.ts +40 -25
- package/src/space-hold.ts +156 -52
- package/src/status-line/component.ts +292 -78
- package/src/status-line/context-usage.ts +21 -46
- 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 +41 -36
- package/src/terminal-capabilities.ts +137 -213
- package/src/terminal-multiplexer.d.ts +127 -14
- package/src/terminal-multiplexer.ts +112 -33
- package/src/terminal.d.ts +23 -16
- package/src/terminal.ts +203 -99
- 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 +11 -4
- 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/thinking.d.ts +1 -1
- package/src/thinking.ts +1 -1
- 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.d.ts +7 -2
- package/src/tools/bash.ts +116 -47
- 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 +154 -50
- package/src/tools/task.d.ts +2 -3
- package/src/tools/task.ts +115 -62
- 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 +36 -0
- package/src/tui.ts +666 -217
- 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.d.ts +33 -1
- package/src/windows-input-mode.ts +212 -6
|
@@ -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
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Component, type Focusable, Input } from "../index.js";
|
|
2
2
|
import { type BtwHistoryRecord } from "./btw-history.js";
|
|
3
3
|
import type { SpaceHoldHandler } from "../space-hold.js";
|
|
4
|
+
import { type KeyId } from "../app-keybindings.js";
|
|
4
5
|
import type { NativeNode, NativeUiEvent } from "../native/node.js";
|
|
5
6
|
interface BtwHistoryPanelOptions {
|
|
6
7
|
records: readonly BtwHistoryRecord[];
|
|
@@ -9,10 +10,17 @@ interface BtwHistoryPanelOptions {
|
|
|
9
10
|
onCancel: (record: BtwHistoryRecord) => void;
|
|
10
11
|
canFollowUp?: (record: BtwHistoryRecord) => boolean;
|
|
11
12
|
onFollowUp?: (record: BtwHistoryRecord, question: string, signal: AbortSignal) => Promise<boolean>;
|
|
12
|
-
/**
|
|
13
|
+
/** Configured push-to-talk keys for a follow-up composer. */
|
|
14
|
+
spaceHoldKeys?: readonly KeyId[];
|
|
13
15
|
spaceHold?: (input: Input) => SpaceHoldHandler;
|
|
14
16
|
requestRender: () => void;
|
|
15
17
|
getHeight: () => number;
|
|
18
|
+
/**
|
|
19
|
+
* Esc closes the panel even while the selected answer runs (it keeps
|
|
20
|
+
* streaming in the background) and `x` cancels it, instead of Esc cancelling
|
|
21
|
+
* first. For a host with no inline panel to fall back to (Tern).
|
|
22
|
+
*/
|
|
23
|
+
escapeHides?: boolean;
|
|
16
24
|
}
|
|
17
25
|
/** Session-local side questions. Selecting or copying never promotes them into chat. */
|
|
18
26
|
export declare class BtwHistoryPanel implements Component, Focusable {
|
|
@@ -25,6 +33,10 @@ export declare class BtwHistoryPanel implements Component, Focusable {
|
|
|
25
33
|
markCopied(recordId: string, text: string): void;
|
|
26
34
|
invalidate(): void;
|
|
27
35
|
openFollowUp(recordId: string): boolean;
|
|
36
|
+
/** Select a record with its answer pane focused, read from the top (a just-asked /btw). */
|
|
37
|
+
showRecord(recordId: string): void;
|
|
38
|
+
/** Only an active follow-up composer can claim its configured push-to-talk keys. */
|
|
39
|
+
capturesInput(data: string): boolean;
|
|
28
40
|
/** Enhanced clipboard pastes belong only to the active composer. */
|
|
29
41
|
pasteText(text: string): void;
|
|
30
42
|
handleInput(data: string): void;
|
|
@@ -31,6 +31,7 @@ export interface CopySelectorDeps {
|
|
|
31
31
|
cwd: string;
|
|
32
32
|
hideThinkingBlock?: () => boolean;
|
|
33
33
|
proseOnlyThinking?: () => boolean;
|
|
34
|
+
expandThinkingBlocks?: () => boolean;
|
|
34
35
|
linkTargets?: ReadonlyMap<string, string>;
|
|
35
36
|
requestRender: () => void;
|
|
36
37
|
/** Replaces the "Copy" header when the picker is reused for another purpose. */
|
|
@@ -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. */
|
|
@@ -61,7 +61,10 @@ export declare class HubFrame {
|
|
|
61
61
|
constructor(title: string, sidebarBounds: {
|
|
62
62
|
min: number;
|
|
63
63
|
max: number;
|
|
64
|
-
}, renderSidebar: (width: number, rows: number) => string[], renderBody: (width: number, height: number | undefined) => readonly string[]
|
|
64
|
+
}, renderSidebar: (width: number, rows: number) => string[], renderBody: (width: number, height: number | undefined) => readonly string[], options?: {
|
|
65
|
+
bodyMinWidth?: number;
|
|
66
|
+
preserveSidebar?: boolean;
|
|
67
|
+
});
|
|
65
68
|
/** Invalidate the composed layout. */
|
|
66
69
|
invalidate(): void;
|
|
67
70
|
/** Measure labels and annotations within this hub's sidebar width bounds. */
|
|
@@ -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). */
|
|
@@ -12,6 +12,14 @@ export interface ModelHubSource extends ModelBrowserSource {
|
|
|
12
12
|
getProjectModelRole(role: string): string | undefined;
|
|
13
13
|
getGlobalModelRole(role: string): string | undefined;
|
|
14
14
|
getModelRoleSource(role: string): "global" | "project" | "default";
|
|
15
|
+
/**
|
|
16
|
+
* Saved model presets (in switch order) and the one the current role setup
|
|
17
|
+
* matches, if any. Absent hosts have no presets to switch between.
|
|
18
|
+
*/
|
|
19
|
+
getModelPresets?(): {
|
|
20
|
+
names: readonly string[];
|
|
21
|
+
active: string | undefined;
|
|
22
|
+
};
|
|
15
23
|
}
|
|
16
24
|
/** Catalog capabilities required by the model hub. */
|
|
17
25
|
export interface ModelHubRegistry extends ModelBrowserRegistry {
|
|
@@ -48,10 +56,39 @@ export interface ModelHubCallbacks {
|
|
|
48
56
|
onLoginRequest?: (providerId: string) => void;
|
|
49
57
|
/** Save the current role assignments and default thinking level as a named model preset. */
|
|
50
58
|
onSavePreset?: (name: string) => void;
|
|
59
|
+
/**
|
|
60
|
+
* Apply a saved model preset (ctrl+←/→ or p/⇧P in the Roles view) and report
|
|
61
|
+
* the outcome itself. A switch that writes nothing (a refused preset) still
|
|
62
|
+
* advances the hub's preset cursor, so the next press moves past it.
|
|
63
|
+
*/
|
|
64
|
+
onSwitchPreset?: (name: string) => void | Promise<void>;
|
|
51
65
|
/** Persist a new quick-switch cycle order (the ctrl+p role cycle). */
|
|
52
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;
|
|
53
82
|
onCancel: () => void;
|
|
54
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
|
+
};
|
|
55
92
|
export interface ModelHubOptions {
|
|
56
93
|
/** Preselect this provider's sidebar entry (e.g. when reopening after /login). */
|
|
57
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";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { TspText } from "@linxiraos/pi-wire";
|
|
2
|
+
import { OverlayPanel } from "../chrome/overlay-box.js";
|
|
3
|
+
import type { NativeNode, NativeUiEvent } from "../native/node.js";
|
|
4
|
+
import type { Component } from "../tui.js";
|
|
5
|
+
/** Options of a {@link ReportPanel}. */
|
|
6
|
+
export interface ReportPanelOptions {
|
|
7
|
+
/** Plain title: the text-mode border title, and the native sheet head unless {@link head} is given. */
|
|
8
|
+
readonly title: string;
|
|
9
|
+
/** Styled native sheet head. */
|
|
10
|
+
readonly head?: TspText;
|
|
11
|
+
/** The read-only report; it draws no frame or title of its own. */
|
|
12
|
+
readonly body: Component;
|
|
13
|
+
/**
|
|
14
|
+
* Display form of the key that dismisses the report while it sits above the
|
|
15
|
+
* editor (the editor's interrupt key, which routes to it). Once the panel
|
|
16
|
+
* holds focus ({@link ReportPanel.holdFocus}) the hint shows the key its own
|
|
17
|
+
* input closes on instead.
|
|
18
|
+
*/
|
|
19
|
+
readonly closeKey: string;
|
|
20
|
+
/** The focused panel (native sheet, text-mode full-screen page) closes on Esc / its Close button: this runs. */
|
|
21
|
+
readonly onClose: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Most rows the text-mode panel may take, borders included (the screen rows
|
|
24
|
+
* left above the editor); a taller report scrolls inside it. `undefined`
|
|
25
|
+
* leaves it uncapped.
|
|
26
|
+
*/
|
|
27
|
+
readonly maxRows?: () => number | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A read-only command report (`/changelog`, `/context`, `/tools`, …).
|
|
31
|
+
*
|
|
32
|
+
* Text mode draws a titled box with the body and an Esc hint: above the editor
|
|
33
|
+
* like the `/btw` panel while it fits there (the editor keeps focus and its
|
|
34
|
+
* Esc takes it away), or as a full-screen page on the alternate screen when it
|
|
35
|
+
* is taller, whose body scrolls on the arrow/page/Home/End keys and the wheel.
|
|
36
|
+
* Natively it is a sheet like `/usage`: a centred `lg` glass sheet titled by
|
|
37
|
+
* the report whose body the terminal scrolls (wheel, and the same keys
|
|
38
|
+
* forwarded as scroll requests), then a Close button; Esc closes it.
|
|
39
|
+
*/
|
|
40
|
+
export declare class ReportPanel extends OverlayPanel {
|
|
41
|
+
#private;
|
|
42
|
+
readonly nativeOverlay: NonNullable<Component["nativeOverlay"]>;
|
|
43
|
+
constructor(options: ReportPanelOptions);
|
|
44
|
+
/**
|
|
45
|
+
* The panel is shown with focus (native sheet, text-mode full-screen page):
|
|
46
|
+
* its own {@link handleInput} closes it, so the hint names that key.
|
|
47
|
+
*/
|
|
48
|
+
holdFocus(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Text mode: cap the box to {@link ReportPanelOptions.maxRows}, scrolling a
|
|
51
|
+
* taller body. The cap is a hard limit: when a resize leaves fewer rows than
|
|
52
|
+
* the box's chrome needs, its bottom (the hint and closing border) is cut
|
|
53
|
+
* rather than spilling over the editor.
|
|
54
|
+
*/
|
|
55
|
+
render(width: number): readonly string[];
|
|
56
|
+
/** Text mode: rows the whole box takes at `width` when nothing caps it. */
|
|
57
|
+
heightAt(width: number): number;
|
|
58
|
+
/** The sheet body (the overlay is the frame, and its body the scroller): the report, then Close (Esc). */
|
|
59
|
+
describe(): NativeNode;
|
|
60
|
+
invalidate(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Focused (the native sheet, or the text-mode full-screen page): Esc closes;
|
|
63
|
+
* the arrow, page, Home and End keys and the wheel scroll the body.
|
|
64
|
+
*/
|
|
65
|
+
handleInput(data: string): void;
|
|
66
|
+
/** Close runs what Esc runs. */
|
|
67
|
+
handleNativeEvent(event: NativeUiEvent): void;
|
|
68
|
+
}
|
|
@@ -48,6 +48,7 @@ export interface RewindSelectorDeps {
|
|
|
48
48
|
cwd: string;
|
|
49
49
|
hideThinkingBlock?: () => boolean;
|
|
50
50
|
proseOnlyThinking?: () => boolean;
|
|
51
|
+
expandThinkingBlocks?: () => boolean;
|
|
51
52
|
linkTargets?: ReadonlyMap<string, string>;
|
|
52
53
|
requestRender: () => void;
|
|
53
54
|
/** Sibling branch paths of `entryId`'s turn (excluding the turn itself). */
|
|
@@ -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";
|
|
@@ -71,7 +71,7 @@ declare class SessionList<T extends SessionSelectorEntry> implements Component {
|
|
|
71
71
|
onExit: () => void;
|
|
72
72
|
onToggleScope?: () => void;
|
|
73
73
|
onDeleteRequest?: (session: T) => void;
|
|
74
|
-
/** Re-render hook for async list updates (fuzzy scan
|
|
74
|
+
/** Re-render hook for async list updates (fuzzy scan completion, history merge). */
|
|
75
75
|
onRequestRender?: () => void;
|
|
76
76
|
constructor(sessions: T[], showCwd?: boolean, historyMatcher?: SessionHistoryMatcher, getTerminalRows?: () => number, pinnedIds?: ReadonlySet<string>, currentSessionPath?: string | (() => string | undefined));
|
|
77
77
|
/** Replace the visible dataset, e.g. when toggling folder/all-projects scope. */
|
|
@@ -129,7 +129,11 @@ export interface SessionSelectorOptions<T extends SessionSelectorEntry = Session
|
|
|
129
129
|
title?: string;
|
|
130
130
|
/** Fixed scope label, or false to omit the scope suffix. */
|
|
131
131
|
scopeLabel?: string | false;
|
|
132
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Show each session's working directory in the list. Defaults to on when
|
|
134
|
+
* the session files live in more than one directory (e.g. the folder scope
|
|
135
|
+
* merging a repository's worktrees).
|
|
136
|
+
*/
|
|
133
137
|
showCwd?: boolean;
|
|
134
138
|
/**
|
|
135
139
|
* Reads the live terminal height so the visible window fits the viewport.
|
|
@@ -43,6 +43,7 @@ export type AnyUiMetadata = UiBase & {
|
|
|
43
43
|
options?: ReadonlyArray<SubmenuOption> | "runtime";
|
|
44
44
|
secret?: boolean;
|
|
45
45
|
ordered?: boolean;
|
|
46
|
+
editor?: "json";
|
|
46
47
|
};
|
|
47
48
|
/** Structural schema entries supplied by the application host. */
|
|
48
49
|
export interface SettingsDisplayEntry {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConfiguredThinkingLevel } from "../thinking.js";
|
|
2
2
|
import { SelectList, type SgrMouseEvent } from "../index.js";
|
|
3
3
|
import { OverlayPanel } from "../chrome/overlay-box.js";
|
|
4
4
|
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
|
|
@@ -7,7 +7,7 @@ import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class ThinkingSelectorComponent extends OverlayPanel {
|
|
9
9
|
#private;
|
|
10
|
-
constructor(currentLevel:
|
|
10
|
+
constructor(currentLevel: ConfiguredThinkingLevel | undefined, availableLevels: ConfiguredThinkingLevel[], onSelect: (level: ConfiguredThinkingLevel) => void, onCancel: () => void);
|
|
11
11
|
describe(cx: DescribeContext): NativeNode | null;
|
|
12
12
|
/** Picker pointer events drive the list exactly as its keys do. */
|
|
13
13
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
@@ -33,10 +33,12 @@ export interface ProviderCard {
|
|
|
33
33
|
/** Number of represented accounts, including unavailable usage lookups. */
|
|
34
34
|
accounts: number;
|
|
35
35
|
unavailableAccounts: string[];
|
|
36
|
-
/** Window rows
|
|
36
|
+
/** Window rows in provider-declared order (e.g. 5h → weekly → monthly); the fullest CARD_MAX_WINDOWS lead. */
|
|
37
37
|
windows: CardWindowRow[];
|
|
38
|
-
/** True when every account reports no limits (e.g. enterprise plans). */
|
|
38
|
+
/** True when every account reports no limits (e.g. enterprise plans, providers without a quota API). */
|
|
39
39
|
unlimited: boolean;
|
|
40
|
+
/** Distinct report notes across accounts (e.g. why a provider exposes no quota windows). */
|
|
41
|
+
notes: string[];
|
|
40
42
|
/** True when nothing is used anywhere (or there are no limits): collapses to a tick. */
|
|
41
43
|
idle: boolean;
|
|
42
44
|
resetCredits?: {
|
|
@@ -52,8 +54,10 @@ export interface ProviderCard {
|
|
|
52
54
|
* Collapse usage reports into one compact card per provider: limits grouped by
|
|
53
55
|
* quota bucket (label + window), each bucket showing the mean used fraction
|
|
54
56
|
* across accounts (matching the classic report's aggregate "% free") with the
|
|
55
|
-
* most-used account's reset countdown.
|
|
56
|
-
*
|
|
57
|
+
* most-used account's reset countdown. Rows keep the provider's declared window
|
|
58
|
+
* order so 5h → week → month reads the same every time; cards sort by their
|
|
59
|
+
* fullest window so what's burning is on top-left; fully idle providers
|
|
60
|
+
* collapse into a tick.
|
|
57
61
|
*/
|
|
58
62
|
export declare function buildProviderCards(reports: UsageReport[], nowMs: number, unavailableAccounts?: readonly UnavailableUsageAccount[]): ProviderCard[];
|
|
59
63
|
/** GitHub-style week-per-column heatmap grid derived from daily activity. */
|
|
@@ -121,12 +125,12 @@ export declare class UsageDashboardComponent implements Component {
|
|
|
121
125
|
* The sheet body (the terminal's `lg` overlay is the frame): a head row
|
|
122
126
|
* (checked ago, Overview/Details tabs, Refresh), then either the provider
|
|
123
127
|
* grid of frames with window meters and the activity heatmap, or the
|
|
124
|
-
* per-provider detail tables
|
|
125
|
-
* `progress`/`table` on terminals without
|
|
126
|
-
* inputs change.
|
|
128
|
+
* per-provider detail tables, then Close like the other report sheets.
|
|
129
|
+
* `meter`/`chart` fall back to `progress`/`table` on terminals without
|
|
130
|
+
* them. Rebuilt only when its inputs change.
|
|
127
131
|
*/
|
|
128
132
|
describe(cx: DescribeContext): NativeNode;
|
|
129
|
-
/** Tab clicks switch views like Enter/Esc; the Refresh button runs `r
|
|
133
|
+
/** Tab clicks switch views like Enter/Esc; the Refresh button runs `r`; Close closes from either view. */
|
|
130
134
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
131
135
|
handleInput(data: string): void;
|
|
132
136
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UsageLimit, UsageReport, UsageResetCredits } from "@linxiraos/pi-ai";
|
|
1
|
+
import type { UsageLimit, UsageReport, UsageResetCreditDetail, UsageResetCredits } from "@linxiraos/pi-ai";
|
|
2
2
|
/** Include the usage tier in a limit title unless its label already names it. */
|
|
3
3
|
export declare function formatLimitTitle(limit: UsageLimit): string;
|
|
4
4
|
/** Human-readable quota scope for a normalized saved-reset window ID. */
|
|
@@ -10,6 +10,8 @@ export interface UsageResetSummary {
|
|
|
10
10
|
soonestExpiry?: string;
|
|
11
11
|
unavailableReason?: string;
|
|
12
12
|
}
|
|
13
|
+
/** Expiry (epoch ms) of a credit that still banks a reset, whether or not it can be spent now. */
|
|
14
|
+
export declare function bankedResetCreditExpiryMs(credit: UsageResetCreditDetail): number | undefined;
|
|
13
15
|
/**
|
|
14
16
|
* Normalize old count-only and current provider reset metadata for display.
|
|
15
17
|
* `availableCount` is banked inventory; `redeemableCount` is the subset that
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { LspServerInfo, RecentSession } from "./welcome.js";
|
|
2
1
|
import type { ComposerPreferences, ComposerStatusCache } from "./composer.js";
|
|
3
2
|
import type { SymbolPreset } from "../theme/theme.js";
|
|
4
3
|
/** Theme inputs cached from the last resolved settings load for stable prepaint colors. */
|
|
@@ -8,19 +7,10 @@ export interface ComposerThemePreferences {
|
|
|
8
7
|
readonly darkTheme?: string;
|
|
9
8
|
readonly lightTheme?: string;
|
|
10
9
|
}
|
|
11
|
-
/** Last authoritative model labels shown in the welcome component. */
|
|
12
|
-
export interface ComposerWelcomeCache {
|
|
13
|
-
readonly modelName: string;
|
|
14
|
-
readonly providerName: string;
|
|
15
|
-
}
|
|
16
10
|
/** Speculative composer state read before the settings/session graph is available. */
|
|
17
11
|
export interface ComposerStartupCache {
|
|
18
12
|
readonly preferences?: ComposerPreferences;
|
|
19
13
|
readonly theme?: ComposerThemePreferences;
|
|
20
|
-
readonly welcome?: ComposerWelcomeCache;
|
|
21
|
-
readonly recentSessions: RecentSession[];
|
|
22
|
-
/** `null` when the last run had LSP disabled. */
|
|
23
|
-
readonly lspServers: LspServerInfo[] | null;
|
|
24
14
|
readonly status?: ComposerStatusCache;
|
|
25
15
|
}
|
|
26
16
|
/**
|
|
@@ -43,12 +33,6 @@ export declare class ComposerCache {
|
|
|
43
33
|
read(cwd: string): ComposerStartupCache;
|
|
44
34
|
/** Resolved theme and composer settings for the next prepaint. */
|
|
45
35
|
writeUi(cwd: string, preferences: ComposerPreferences, theme: ComposerThemePreferences): void;
|
|
46
|
-
/** Authoritative model/provider labels for the next welcome prepaint. */
|
|
47
|
-
writeWelcome(cwd: string, welcome: ComposerWelcomeCache): void;
|
|
48
|
-
/** The latest recent-session rows (first four). */
|
|
49
|
-
writeRecentSessions(cwd: string, sessions: readonly RecentSession[]): void;
|
|
50
|
-
/** The latest detected project LSP rows; `null` records that LSP is disabled. */
|
|
51
|
-
writeLspServers(cwd: string, servers: readonly LspServerInfo[] | null): void;
|
|
52
36
|
/** Status-bar inputs for the next prepaint's startup status line. */
|
|
53
37
|
writeStatus(cwd: string, status: ComposerStatusCache): void;
|
|
54
38
|
close(): void;
|