@oh-my-pi/pi-tui 18.4.2 → 18.4.4
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 +56 -0
- package/dist/types/apps/cleanse-board.d.ts +17 -0
- package/dist/types/apps/git/help.d.ts +16 -0
- package/dist/types/apps/git/sidebar.d.ts +18 -0
- package/dist/types/apps/live-visualizer.d.ts +10 -0
- package/dist/types/apps/ps-top.d.ts +15 -0
- package/dist/types/apps/standalone-picker.d.ts +3 -0
- package/dist/types/autocomplete.d.ts +8 -0
- package/dist/types/chat/advisor-message.d.ts +12 -2
- package/dist/types/chat/assistant-message.d.ts +20 -0
- package/dist/types/chat/bash-execution.d.ts +9 -0
- package/dist/types/chat/chat-transcript-builder.d.ts +6 -1
- package/dist/types/chat/collab-prompt-message.d.ts +4 -0
- package/dist/types/chat/compaction-summary-message.d.ts +15 -0
- package/dist/types/chat/eval-execution.d.ts +8 -0
- package/dist/types/chat/execution-shared.d.ts +58 -0
- package/dist/types/chat/late-diagnostics-message.d.ts +15 -1
- package/dist/types/chat/read-tool-group.d.ts +15 -0
- package/dist/types/chat/skill-message.d.ts +9 -0
- package/dist/types/chat/stripped-tool-calls-placeholder.d.ts +3 -0
- package/dist/types/chat/thinking-display.d.ts +2 -0
- package/dist/types/chat/todo-reminder.d.ts +4 -1
- package/dist/types/chat/tool-execution.d.ts +25 -1
- package/dist/types/chat/transcript-actions.d.ts +37 -0
- package/dist/types/chat/transcript-entry.d.ts +3 -1
- package/dist/types/chat/user-message.d.ts +25 -0
- package/dist/types/chrome/collab-qrcode.d.ts +7 -0
- package/dist/types/chrome/context-thresholds.d.ts +11 -0
- package/dist/types/chrome/countdown-timer.d.ts +9 -3
- package/dist/types/chrome/diff.d.ts +12 -0
- package/dist/types/chrome/dynamic-border.d.ts +3 -0
- package/dist/types/chrome/format.d.ts +6 -0
- package/dist/types/chrome/message-divider.d.ts +13 -0
- package/dist/types/chrome/message-frame.d.ts +10 -0
- package/dist/types/chrome/message-notice.d.ts +23 -0
- package/dist/types/chrome/overlay-box.d.ts +11 -2
- package/dist/types/chrome/qrcode.d.ts +7 -0
- package/dist/types/chrome/segment-track.d.ts +7 -0
- package/dist/types/chrome/selector-helpers.d.ts +0 -6
- package/dist/types/chrome/status-notice.d.ts +14 -0
- package/dist/types/chrome/streaming-panel.d.ts +3 -0
- package/dist/types/chrome/tool-activity.d.ts +3 -0
- package/dist/types/chrome/transcript-container.d.ts +13 -0
- package/dist/types/chrome/transcript-status.d.ts +15 -3
- package/dist/types/components/box.d.ts +7 -0
- package/dist/types/components/disclosure.d.ts +9 -0
- package/dist/types/components/editor.d.ts +42 -0
- package/dist/types/components/form.d.ts +14 -0
- package/dist/types/components/image.d.ts +7 -0
- package/dist/types/components/input.d.ts +20 -1
- package/dist/types/components/key-value-list.d.ts +3 -0
- package/dist/types/components/layout/geometry.d.ts +16 -0
- package/dist/types/components/layout/row.d.ts +7 -0
- package/dist/types/components/layout/split-pane.d.ts +8 -0
- package/dist/types/components/layout/stack.d.ts +6 -0
- package/dist/types/components/loader.d.ts +48 -0
- package/dist/types/components/markdown.d.ts +8 -0
- package/dist/types/components/metric.d.ts +7 -0
- package/dist/types/components/progress-bar.d.ts +3 -0
- package/dist/types/components/scroll-view.d.ts +6 -0
- package/dist/types/components/section.d.ts +3 -0
- package/dist/types/components/select-list.d.ts +33 -0
- package/dist/types/components/settings-list.d.ts +68 -0
- package/dist/types/components/spacer.d.ts +4 -0
- package/dist/types/components/tab-bar.d.ts +9 -0
- package/dist/types/components/table.d.ts +7 -0
- package/dist/types/components/text.d.ts +6 -0
- package/dist/types/components/tree-view.d.ts +9 -0
- package/dist/types/components/truncated-text.d.ts +3 -0
- package/dist/types/components/wizard-step.d.ts +6 -0
- package/dist/types/hotkeys-markdown.d.ts +24 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/latex-block.d.ts +7 -0
- package/dist/types/loop-watchdog.d.ts +9 -0
- package/dist/types/native/apply.d.ts +39 -0
- package/dist/types/native/backend.d.ts +94 -0
- package/dist/types/native/blobs.d.ts +29 -0
- package/dist/types/native/describe.d.ts +56 -0
- package/dist/types/native/encode.d.ts +50 -0
- package/dist/types/native/icons.d.ts +18 -0
- package/dist/types/native/memo.d.ts +27 -0
- package/dist/types/native/node.d.ts +107 -0
- package/dist/types/native/overlay.d.ts +64 -0
- package/dist/types/native/picker.d.ts +124 -0
- package/dist/types/native/reconcile.d.ts +41 -0
- package/dist/types/native/settle.d.ts +11 -0
- package/dist/types/native/spans.d.ts +21 -0
- package/dist/types/native/state.d.ts +6 -0
- package/dist/types/native/tone.d.ts +24 -0
- package/dist/types/overlays/advisor-config.d.ts +20 -0
- package/dist/types/overlays/agent-hub-renderer.d.ts +27 -11
- package/dist/types/overlays/agent-hub.d.ts +10 -0
- package/dist/types/overlays/agent-transcript-viewer.d.ts +7 -0
- package/dist/types/overlays/agents-hub.d.ts +8 -0
- package/dist/types/overlays/annotation-overlay.d.ts +3 -0
- package/dist/types/overlays/ask-dialog.d.ts +23 -0
- package/dist/types/overlays/bordered-loader.d.ts +3 -0
- package/dist/types/overlays/btw-history-panel.d.ts +9 -0
- package/dist/types/overlays/btw-panel.d.ts +3 -0
- package/dist/types/overlays/cleanse-panel.d.ts +5 -2
- package/dist/types/overlays/composer-shape-preview.d.ts +7 -1
- package/dist/types/overlays/copy-selector.d.ts +38 -0
- package/dist/types/overlays/error-banner.d.ts +9 -0
- package/dist/types/overlays/extensions/extension-list.d.ts +1 -0
- package/dist/types/overlays/history-search.d.ts +18 -0
- package/dist/types/overlays/hook-editor.d.ts +28 -1
- package/dist/types/overlays/hook-input.d.ts +3 -0
- package/dist/types/overlays/hook-selector.d.ts +10 -0
- package/dist/types/overlays/hub-frame.d.ts +18 -0
- package/dist/types/overlays/jobs-panel.d.ts +24 -0
- package/dist/types/overlays/login-dialog.d.ts +10 -0
- package/dist/types/overlays/logout-account-selector.d.ts +4 -0
- package/dist/types/overlays/mcp-add-wizard.d.ts +4 -0
- package/dist/types/overlays/model-browser.d.ts +69 -0
- package/dist/types/overlays/model-hub.d.ts +7 -0
- package/dist/types/overlays/model-picker.d.ts +9 -1
- package/dist/types/overlays/move-overlay.d.ts +3 -0
- package/dist/types/overlays/oauth-selector.d.ts +4 -0
- package/dist/types/overlays/omfg-panel.d.ts +3 -0
- package/dist/types/overlays/pause-screen.d.ts +12 -0
- package/dist/types/overlays/plan-review-overlay.d.ts +5 -0
- package/dist/types/overlays/plan-save-overlay.d.ts +10 -0
- package/dist/types/overlays/plugin-selector.d.ts +4 -0
- package/dist/types/overlays/plugin-settings.d.ts +30 -0
- package/dist/types/overlays/queue-mode-selector.d.ts +4 -0
- package/dist/types/overlays/reset-usage-selector.d.ts +8 -0
- package/dist/types/overlays/rewind-selector.d.ts +5 -0
- package/dist/types/overlays/session-info-overlay.d.ts +19 -1
- package/dist/types/overlays/session-selector.d.ts +64 -1
- package/dist/types/overlays/settings-defs.d.ts +14 -0
- package/dist/types/overlays/settings-selector.d.ts +21 -0
- package/dist/types/overlays/show-images-selector.d.ts +4 -0
- package/dist/types/overlays/snapcompact-shape-preview.d.ts +2 -0
- package/dist/types/overlays/stats-notice.d.ts +8 -0
- package/dist/types/overlays/theme-selector.d.ts +11 -0
- package/dist/types/overlays/thinking-selector.d.ts +4 -0
- package/dist/types/overlays/tree-selector.d.ts +60 -2
- package/dist/types/overlays/usage-dashboard.d.ts +26 -3
- package/dist/types/overlays/usage-row.d.ts +36 -2
- package/dist/types/prompt/attachment-chips.d.ts +8 -0
- package/dist/types/prompt/composer-attachments.d.ts +15 -3
- package/dist/types/prompt/composer.d.ts +18 -1
- package/dist/types/prompt/custom-editor.d.ts +48 -2
- package/dist/types/prompt/editor-top-gap.d.ts +2 -0
- package/dist/types/prompt/macos-spelling.d.ts +6 -0
- package/dist/types/prompt/magic-keywords.d.ts +9 -0
- package/dist/types/prompt/queued-messages.d.ts +23 -0
- package/dist/types/prompt/skill-tokens.d.ts +4 -2
- package/dist/types/prompt/welcome.d.ts +16 -0
- package/dist/types/render/code-cell.d.ts +10 -0
- package/dist/types/render/file-list.d.ts +8 -0
- package/dist/types/render/hyperlink.d.ts +14 -0
- package/dist/types/render/output-block.d.ts +43 -0
- package/dist/types/render/output-pane.d.ts +17 -0
- package/dist/types/render/tool-card.d.ts +8 -0
- package/dist/types/render/tree-list.d.ts +8 -0
- package/dist/types/render/width-aware-text.d.ts +7 -0
- package/dist/types/setup/scenes/outro.d.ts +7 -0
- package/dist/types/setup/scenes/sign-in.d.ts +16 -9
- package/dist/types/setup/scenes/splash.d.ts +8 -0
- package/dist/types/setup/scenes/types.d.ts +6 -27
- package/dist/types/setup/wizard-overlay.d.ts +9 -0
- package/dist/types/status-line/component.d.ts +49 -5
- package/dist/types/status-line/context-usage.d.ts +20 -0
- package/dist/types/status-line/footer.d.ts +8 -0
- package/dist/types/status-line/metrics.d.ts +1 -2
- package/dist/types/status-line/segments.d.ts +10 -1
- package/dist/types/status-line/types.d.ts +40 -1
- package/dist/types/stdin-buffer.d.ts +10 -7
- package/dist/types/terminal-capabilities.d.ts +1 -1
- package/dist/types/terminal.d.ts +36 -0
- package/dist/types/theme/defaults/index.d.ts +100 -0
- package/dist/types/theme/schema.d.ts +2 -0
- package/dist/types/theme/shimmer.d.ts +8 -0
- package/dist/types/theme/theme-class.d.ts +2 -0
- package/dist/types/theme/theme.d.ts +33 -1
- package/dist/types/tools/ask.d.ts +3 -0
- package/dist/types/tools/ast-edit.d.ts +10 -1
- package/dist/types/tools/ast-grep.d.ts +10 -1
- package/dist/types/tools/autoresearch.d.ts +21 -4
- package/dist/types/tools/bash.d.ts +30 -1
- package/dist/types/tools/cfg-render.d.ts +5 -1
- package/dist/types/tools/debug.d.ts +3 -1
- package/dist/types/tools/default-renderer.d.ts +6 -1
- package/dist/types/tools/edit.d.ts +14 -1
- package/dist/types/tools/eval.d.ts +12 -1
- package/dist/types/tools/fetch.d.ts +16 -1
- package/dist/types/tools/find.d.ts +15 -1
- package/dist/types/tools/github.d.ts +3 -0
- package/dist/types/tools/glob.d.ts +14 -1
- package/dist/types/tools/goal.d.ts +3 -1
- package/dist/types/tools/grep.d.ts +14 -1
- package/dist/types/tools/grouped-file-output.d.ts +58 -0
- package/dist/types/tools/json-tree.d.ts +20 -0
- package/dist/types/tools/lsp.d.ts +3 -10
- package/dist/types/tools/mcp.d.ts +16 -1
- package/dist/types/tools/memory.d.ts +26 -0
- package/dist/types/tools/native-view.d.ts +90 -0
- package/dist/types/tools/proc-render.d.ts +7 -1
- package/dist/types/tools/read.d.ts +23 -1
- package/dist/types/tools/renderer.d.ts +57 -0
- package/dist/types/tools/report-tool-issue.d.ts +3 -0
- package/dist/types/tools/resolve.d.ts +14 -1
- package/dist/types/tools/task.d.ts +3 -0
- package/dist/types/tools/think.d.ts +3 -0
- package/dist/types/tools/todo.d.ts +12 -0
- package/dist/types/tools/vibe.d.ts +3 -1
- package/dist/types/tools/wait.d.ts +3 -0
- package/dist/types/tools/web-search-types.d.ts +90 -0
- package/dist/types/tools/web-search.d.ts +9 -168
- package/dist/types/tools/write.d.ts +14 -1
- package/dist/types/tools/xdev.d.ts +13 -0
- package/dist/types/tui.d.ts +49 -0
- package/package.json +9 -9
- package/src/apps/autoresearch-dashboard.ts +362 -4
- package/src/apps/cleanse-board.ts +219 -1
- package/src/apps/cleanse-picker.ts +9 -1
- package/src/apps/debug/log-viewer.ts +15 -15
- package/src/apps/debug/protocol-probe.ts +2 -20
- package/src/apps/git/avatar.ts +2 -22
- package/src/apps/git/git-tui.ts +406 -59
- package/src/apps/git/help.ts +130 -0
- package/src/apps/git/sidebar.ts +491 -0
- package/src/apps/live-visualizer.ts +65 -0
- package/src/apps/ps-top.ts +448 -17
- package/src/apps/session-picker.ts +1 -0
- package/src/apps/setup-model-picker.ts +5 -1
- package/src/apps/standalone-picker.ts +55 -1
- package/src/autocomplete.ts +44 -1
- package/src/chat/advisor-message.ts +72 -3
- package/src/chat/assistant-message.ts +538 -51
- package/src/chat/background-tan-message.ts +4 -4
- package/src/chat/bash-execution.ts +81 -0
- package/src/chat/cache-invalidation-marker.ts +8 -0
- package/src/chat/chat-transcript-builder.ts +37 -6
- package/src/chat/collab-prompt-message.ts +15 -3
- package/src/chat/compaction-summary-message.ts +74 -1
- package/src/chat/custom-message.ts +3 -1
- package/src/chat/eval-execution.ts +57 -0
- package/src/chat/execution-shared.ts +153 -1
- package/src/chat/hook-message.ts +1 -0
- package/src/chat/late-diagnostics-message.ts +85 -2
- package/src/chat/read-tool-group.ts +341 -1
- package/src/chat/served-model-marker.ts +8 -0
- package/src/chat/skill-message.ts +63 -0
- package/src/chat/stripped-tool-calls-placeholder.ts +18 -10
- package/src/chat/thinking-display.ts +73 -11
- package/src/chat/todo-reminder.ts +34 -4
- package/src/chat/tool-execution.ts +385 -10
- package/src/chat/transcript-actions.ts +38 -0
- package/src/chat/transcript-browser.ts +2 -9
- package/src/chat/transcript-entry.ts +10 -1
- package/src/chat/transcript-render-helpers.ts +16 -15
- package/src/chat/ttsr-notification.ts +38 -1
- package/src/chat/user-message.ts +167 -4
- package/src/chrome/collab-qrcode.ts +27 -2
- package/src/chrome/context-thresholds.ts +34 -0
- package/src/chrome/countdown-timer.ts +24 -1
- package/src/chrome/diff.ts +60 -1
- package/src/chrome/dynamic-border.ts +7 -0
- package/src/chrome/format.ts +12 -0
- package/src/chrome/message-divider.ts +33 -1
- package/src/chrome/message-frame.ts +53 -10
- package/src/chrome/message-notice.ts +71 -0
- package/src/chrome/overlay-box.ts +45 -2
- package/src/chrome/qrcode.ts +28 -0
- package/src/chrome/segment-track.ts +26 -0
- package/src/chrome/selector-helpers.ts +1 -17
- package/src/chrome/status-notice.ts +46 -0
- package/src/chrome/streaming-panel.ts +25 -1
- package/src/chrome/tool-activity.ts +20 -0
- package/src/chrome/transcript-container.ts +139 -17
- package/src/chrome/transcript-status.ts +40 -11
- package/src/components/box.ts +51 -0
- package/src/components/disclosure.ts +33 -0
- package/src/components/editor.ts +239 -36
- package/src/components/form.ts +93 -9
- package/src/components/image.ts +30 -0
- package/src/components/input.ts +77 -26
- package/src/components/key-value-list.ts +18 -0
- package/src/components/layout/geometry.ts +44 -0
- package/src/components/layout/row.ts +30 -0
- package/src/components/layout/split-pane.ts +65 -0
- package/src/components/layout/stack.ts +27 -0
- package/src/components/loader.ts +183 -1
- package/src/components/markdown.ts +131 -56
- package/src/components/metric.ts +39 -0
- package/src/components/progress-bar.ts +28 -0
- package/src/components/scroll-view.ts +23 -0
- package/src/components/section.ts +16 -0
- package/src/components/select-list.ts +174 -25
- package/src/components/settings-list.ts +264 -7
- package/src/components/spacer.ts +17 -0
- package/src/components/tab-bar.ts +42 -0
- package/src/components/table.ts +34 -0
- package/src/components/text.ts +23 -0
- package/src/components/tree-view.ts +65 -0
- package/src/components/truncated-text.ts +14 -0
- package/src/components/wizard-step.ts +18 -9
- package/src/debug-server.ts +14 -7
- package/src/hotkeys-markdown.ts +251 -69
- package/src/index.ts +6 -0
- package/src/latex-block.ts +11 -0
- package/src/loop-watchdog.ts +38 -10
- package/src/native/apply.ts +275 -0
- package/src/native/backend.ts +682 -0
- package/src/native/blobs.ts +70 -0
- package/src/native/describe.ts +124 -0
- package/src/native/encode.ts +233 -0
- package/src/native/icons.ts +184 -0
- package/src/native/memo.ts +64 -0
- package/src/native/node.ts +112 -0
- package/src/native/overlay.ts +131 -0
- package/src/native/picker.ts +333 -0
- package/src/native/reconcile.ts +1063 -0
- package/src/native/settle.ts +23 -0
- package/src/native/spans.ts +308 -0
- package/src/native/state.ts +28 -0
- package/src/native/tone.ts +79 -0
- package/src/overlays/advisor-config.ts +420 -0
- package/src/overlays/agent-hub-renderer.ts +155 -18
- package/src/overlays/agent-hub.ts +1037 -44
- package/src/overlays/agent-transcript-viewer.ts +129 -0
- package/src/overlays/agents-hub.ts +688 -53
- package/src/overlays/annotation-overlay.ts +391 -52
- package/src/overlays/ask-dialog.ts +435 -24
- package/src/overlays/bordered-loader.ts +17 -0
- package/src/overlays/btw-history-panel.ts +182 -0
- package/src/overlays/btw-panel.ts +68 -2
- package/src/overlays/cleanse-panel.ts +105 -15
- package/src/overlays/codex-reset-fireworks.ts +65 -5
- package/src/overlays/composer-shape-preview.ts +26 -1
- package/src/overlays/copy-selector.ts +545 -23
- package/src/overlays/error-banner.ts +44 -0
- package/src/overlays/extensions/extension-list.ts +23 -17
- package/src/overlays/history-search.ts +175 -33
- package/src/overlays/hook-editor.ts +113 -6
- package/src/overlays/hook-input.ts +22 -1
- package/src/overlays/hook-selector.ts +311 -22
- package/src/overlays/hub-frame.ts +80 -0
- package/src/overlays/jobs-panel.ts +112 -0
- package/src/overlays/login-dialog.ts +183 -1
- package/src/overlays/logout-account-selector.ts +102 -4
- package/src/overlays/mcp-add-wizard.ts +232 -53
- package/src/overlays/model-browser.ts +681 -22
- package/src/overlays/model-hub.ts +1402 -78
- package/src/overlays/model-picker.ts +184 -7
- package/src/overlays/move-overlay.ts +45 -0
- package/src/overlays/oauth-selector.ts +227 -23
- package/src/overlays/omfg-panel.ts +86 -2
- package/src/overlays/pause-screen.ts +55 -4
- package/src/overlays/plan-review-overlay.ts +352 -0
- package/src/overlays/plan-save-overlay.ts +45 -0
- package/src/overlays/plugin-selector.ts +21 -1
- package/src/overlays/plugin-settings.ts +195 -5
- package/src/overlays/queue-mode-selector.ts +19 -1
- package/src/overlays/reset-usage-selector.ts +110 -40
- package/src/overlays/rewind-selector.ts +458 -44
- package/src/overlays/session-account-selector.ts +1 -1
- package/src/overlays/session-info-overlay.ts +137 -1
- package/src/overlays/session-selector.ts +807 -46
- package/src/overlays/settings-defs.ts +41 -0
- package/src/overlays/settings-selector.ts +585 -33
- package/src/overlays/show-images-selector.ts +18 -1
- package/src/overlays/snapcompact-shape-preview.ts +48 -3
- package/src/overlays/stats-notice.ts +31 -0
- package/src/overlays/theme-selector.ts +31 -1
- package/src/overlays/thinking-selector.ts +22 -1
- package/src/overlays/tree-selector.ts +570 -110
- package/src/overlays/usage-dashboard.ts +587 -12
- package/src/overlays/usage-row.ts +161 -25
- package/src/prompt/attachment-chips.ts +60 -0
- package/src/prompt/composer-attachments.ts +31 -9
- package/src/prompt/composer.ts +55 -2
- package/src/prompt/custom-editor.ts +302 -4
- package/src/prompt/editor-top-gap.ts +8 -0
- package/src/prompt/macos-spelling.ts +24 -9
- package/src/prompt/magic-keywords.ts +22 -1
- package/src/prompt/model-mention-autocomplete.ts +1 -0
- package/src/prompt/queued-messages.ts +101 -0
- package/src/prompt/skill-tokens.ts +5 -3
- package/src/prompt/welcome.ts +213 -6
- package/src/render/code-cell.ts +103 -2
- package/src/render/file-list.ts +29 -0
- package/src/render/hyperlink.ts +32 -0
- package/src/render/output-block.ts +110 -0
- package/src/render/output-pane.ts +37 -0
- package/src/render/tool-card.ts +137 -0
- package/src/render/tree-list.ts +39 -0
- package/src/render/width-aware-text.ts +20 -0
- package/src/setup/scenes/composer.ts +29 -0
- package/src/setup/scenes/glyph.ts +15 -0
- package/src/setup/scenes/model.ts +36 -8
- package/src/setup/scenes/outro.ts +28 -1
- package/src/setup/scenes/sign-in.ts +138 -24
- package/src/setup/scenes/splash.ts +28 -1
- package/src/setup/scenes/theme.ts +88 -3
- package/src/setup/scenes/types.ts +7 -28
- package/src/setup/startup-splash.ts +46 -9
- package/src/setup/wizard-overlay.ts +140 -23
- package/src/setup/wizard.ts +1 -1
- package/src/status-line/component.ts +414 -18
- package/src/status-line/context-usage.ts +279 -50
- package/src/status-line/footer.ts +94 -1
- package/src/status-line/metrics.ts +3 -6
- package/src/status-line/segments.ts +463 -97
- package/src/status-line/separators.ts +3 -16
- package/src/status-line/types.ts +43 -1
- package/src/stdin-buffer.ts +27 -21
- package/src/terminal-capabilities.ts +7 -0
- package/src/terminal.ts +153 -11
- package/src/theme/defaults/dark-neon-noir.json +100 -0
- package/src/theme/defaults/index.ts +2 -0
- package/src/theme/defaults/light-prism.json +5 -5
- package/src/theme/defaults/onyx.json +62 -62
- package/src/theme/mermaid-cache.ts +10 -1
- package/src/theme/schema.ts +15 -0
- package/src/theme/shimmer.ts +33 -0
- package/src/theme/theme-class.ts +24 -19
- package/src/theme/theme.ts +111 -9
- package/src/theme/tui-adapters.ts +14 -1
- package/src/tools/ask.ts +157 -1
- package/src/tools/ast-edit.ts +174 -1
- package/src/tools/ast-grep.ts +82 -2
- package/src/tools/autoresearch.ts +149 -1
- package/src/tools/bash.ts +233 -62
- package/src/tools/cfg-render.ts +66 -1
- package/src/tools/debug.ts +78 -1
- package/src/tools/default-renderer.ts +35 -1
- package/src/tools/edit.ts +357 -31
- package/src/tools/eval.ts +257 -1
- package/src/tools/fetch.ts +102 -3
- package/src/tools/find.ts +127 -1
- package/src/tools/github.ts +119 -10
- package/src/tools/glob.ts +116 -1
- package/src/tools/goal.ts +56 -1
- package/src/tools/grep.ts +83 -2
- package/src/tools/grouped-file-output.ts +205 -0
- package/src/tools/json-tree.ts +116 -1
- package/src/tools/lsp.ts +318 -1
- package/src/tools/mcp.ts +80 -1
- package/src/tools/memory.ts +93 -11
- package/src/tools/native-view.ts +292 -0
- package/src/tools/proc-render.ts +221 -1
- package/src/tools/read.ts +199 -4
- package/src/tools/renderer.ts +61 -0
- package/src/tools/report-tool-issue.ts +7 -1
- package/src/tools/resolve.ts +63 -1
- package/src/tools/streaming-output.ts +79 -16
- package/src/tools/task.ts +406 -4
- package/src/tools/think.ts +19 -1
- package/src/tools/todo.ts +89 -0
- package/src/tools/vibe.ts +230 -2
- package/src/tools/wait.ts +181 -1
- package/src/tools/web-search-types.ts +99 -0
- package/src/tools/web-search.ts +111 -170
- package/src/tools/write.ts +144 -5
- package/src/tools/xdev.ts +64 -1
- package/src/tui.ts +295 -4
- package/dist/types/setup/scenes/providers.d.ts +0 -3
- package/dist/types/setup/scenes/web-search.d.ts +0 -22
- package/src/setup/scenes/providers.ts +0 -110
- package/src/setup/scenes/web-search.ts +0 -165
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* transcript components. Built-in renderers live beside this file; the
|
|
4
4
|
* coding-agent tools implement the matching `*Details` payloads.
|
|
5
5
|
*/
|
|
6
|
+
import type { TspPreview, TspText, TspTone, TspToolProps } from "@oh-my-pi/pi-wire";
|
|
7
|
+
import type { NativeChild } from "../native/node.js";
|
|
6
8
|
import type { Component } from "../tui.js";
|
|
7
9
|
import type { Theme } from "../theme/theme.js";
|
|
8
10
|
/** Display state handed to `renderCall`/`renderResult`. */
|
|
@@ -58,6 +60,54 @@ export interface ToolActivityContext {
|
|
|
58
60
|
/** Tool-specific render context (same shape `renderCall` receives), when available. */
|
|
59
61
|
readonly renderContext?: Record<string, unknown>;
|
|
60
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* The data head of a tool call (NATIVE_REDESIGN §7.2): what the terminal
|
|
65
|
+
* draws in the `tool` kind's head. Each fact appears once — a target named
|
|
66
|
+
* here is never repeated in the body.
|
|
67
|
+
*/
|
|
68
|
+
export interface NativeToolHead {
|
|
69
|
+
/** The verb ("Bash", "Edit"); defaults to the tool's label. */
|
|
70
|
+
readonly title?: TspText;
|
|
71
|
+
/** The primary argument, shown once: command, path, pattern, query. */
|
|
72
|
+
readonly target?: TspText;
|
|
73
|
+
readonly targetKind?: TspToolProps["targetKind"];
|
|
74
|
+
/** Language for `command` targets. */
|
|
75
|
+
readonly lang?: string;
|
|
76
|
+
/** `file://` link for path targets. */
|
|
77
|
+
readonly href?: string;
|
|
78
|
+
/** Short facts after the target (`+8 −1`, `5 matches · 2 files`). */
|
|
79
|
+
readonly meta?: readonly TspText[];
|
|
80
|
+
readonly badges?: TspToolProps["badges"];
|
|
81
|
+
/** A one-word state note ("timed out", "partial"). */
|
|
82
|
+
readonly note?: TspText;
|
|
83
|
+
/** A non-zero exit code (error chip). */
|
|
84
|
+
readonly exit?: number | null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A tool's semantic presentation for Tern Surface Protocol terminals.
|
|
88
|
+
* `ToolExecutionComponent` wraps it in a `tool` node (terminals that list
|
|
89
|
+
* the kind) or, as the fallback, a `card` (role `omp.tool.<name>`, status,
|
|
90
|
+
* elapsed timer, collapse): the renderer supplies only the head data and the
|
|
91
|
+
* body nodes, never frames, padding or width math.
|
|
92
|
+
*/
|
|
93
|
+
export interface NativeToolView {
|
|
94
|
+
/** The data head; the fallback card's head spans derive from it when {@link head} is absent. */
|
|
95
|
+
readonly tool?: NativeToolHead;
|
|
96
|
+
/** Header spans for the fallback card (and the `tool` title when {@link tool} is absent). */
|
|
97
|
+
readonly head?: TspText;
|
|
98
|
+
/** Body: sections, never frames. */
|
|
99
|
+
readonly body?: readonly NativeChild[];
|
|
100
|
+
/** Tone override; the frame otherwise derives it from the call status. */
|
|
101
|
+
readonly tone?: TspTone;
|
|
102
|
+
/** Body clamp while collapsed; `{tail}` keeps the end (terminal output). Defaults to the transcript's preview size. */
|
|
103
|
+
readonly preview?: TspPreview | {
|
|
104
|
+
readonly tail: number;
|
|
105
|
+
} | "none";
|
|
106
|
+
/** Render frameless (`frame:"inline"`): a head line plus a disclosed body. */
|
|
107
|
+
readonly inline?: boolean;
|
|
108
|
+
/** Head actions offered on hover (`copy`, `retry`). */
|
|
109
|
+
readonly tools?: TspToolProps["tools"];
|
|
110
|
+
}
|
|
61
111
|
/**
|
|
62
112
|
* A tool's transcript presentation: call preview, result view, and repaint/animation hints.
|
|
63
113
|
* Method signatures are intentionally bivariant so a renderer typed over its own
|
|
@@ -67,6 +117,13 @@ export interface ToolActivityContext {
|
|
|
67
117
|
export interface ToolRenderer<TArgs = unknown, TDetails = unknown> {
|
|
68
118
|
renderCall(args: TArgs, options: RenderResultOptions, theme: Theme): Component | undefined;
|
|
69
119
|
renderResult(result: ToolRenderResult<TDetails>, options: RenderResultContextOptions, theme: Theme, args?: TArgs): Component | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Semantic call preview for TSP terminals. When a renderer implements the
|
|
122
|
+
* describe hooks, the native backend never calls `renderCall`/`renderResult`.
|
|
123
|
+
*/
|
|
124
|
+
describeCall?(args: TArgs, options: RenderResultOptions): NativeToolView | undefined;
|
|
125
|
+
/** Semantic result view for TSP terminals; merged with the call view when {@link mergeCallAndResult}. */
|
|
126
|
+
describeResult?(result: ToolRenderResult<TDetails>, options: RenderResultContextOptions, args?: TArgs): NativeToolView | undefined;
|
|
70
127
|
mergeCallAndResult?: boolean;
|
|
71
128
|
/** Describes current activity without coupling a renderer to terminal layout. */
|
|
72
129
|
activitySummary?(args: TArgs, context: ToolActivityContext): ToolActivitySummary;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Component } from "../index.js";
|
|
2
2
|
import type { Theme } from "../theme/theme.js";
|
|
3
|
+
import type { NativeToolView } from "./renderer.js";
|
|
3
4
|
/** Call preview for an `xd://report_issue` write. */
|
|
4
5
|
export declare function renderReportIssueDeviceCall(content: unknown, uiTheme: Theme): Component;
|
|
6
|
+
/** Native call preview for an `xd://report_issue` write. */
|
|
7
|
+
export declare function describeReportIssueDeviceCall(content: unknown): NativeToolView;
|
|
5
8
|
/** Device name for automatic tool issue reports. */
|
|
6
9
|
export declare const REPORT_ISSUE_DEVICE_NAME = "report_issue";
|
|
7
10
|
/** Internal device URL for automatic tool issue reports. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from "../index.js";
|
|
2
|
-
import type { RenderResultOptions } from "./renderer.js";
|
|
2
|
+
import type { NativeToolView, RenderResultOptions } from "./renderer.js";
|
|
3
3
|
import type { Theme } from "../theme/theme.js";
|
|
4
4
|
import { Ellipsis } from "../render/index.js";
|
|
5
5
|
/** Device name for applying a staged action. */
|
|
@@ -27,6 +27,10 @@ export interface ResolveInvocation {
|
|
|
27
27
|
}
|
|
28
28
|
/** Streaming-safe call preview for a resolution-device write: `Resolve/Reject/Propose: <text>`. */
|
|
29
29
|
export declare function renderResolutionDeviceCall(device: ResolutionDeviceName, content: unknown, uiTheme: Theme): Component;
|
|
30
|
+
/** Native form of {@link renderResolutionDeviceCall}: `Resolve/Reject/Propose` head with the first content line. */
|
|
31
|
+
export declare function describeResolutionDeviceCall(device: ResolutionDeviceName, content: unknown): NativeToolView;
|
|
32
|
+
/** Native form of {@link renderDeviceCallPreview}: title head plus the first content line of a pending device write. */
|
|
33
|
+
export declare function describeDeviceCallPreview(title: string, content: unknown): NativeToolView;
|
|
30
34
|
/** Render the first content line of a pending device write. */
|
|
31
35
|
export declare function renderDeviceCallPreview(title: string, content: unknown, uiTheme: Theme, ellipsis?: Ellipsis): Component;
|
|
32
36
|
/** Render staged-action acceptance or rejection. */
|
|
@@ -40,6 +44,15 @@ export declare const resolveRenderer: {
|
|
|
40
44
|
details?: ResolveDetails;
|
|
41
45
|
isError?: boolean;
|
|
42
46
|
}, _options: RenderResultOptions, uiTheme: Theme): Component;
|
|
47
|
+
describeCall(args: Partial<ResolveInvocation>): NativeToolView;
|
|
48
|
+
describeResult(result: {
|
|
49
|
+
content: Array<{
|
|
50
|
+
type: string;
|
|
51
|
+
text?: string;
|
|
52
|
+
}>;
|
|
53
|
+
details?: ResolveDetails;
|
|
54
|
+
isError?: boolean;
|
|
55
|
+
}): NativeToolView | undefined;
|
|
43
56
|
inline: true;
|
|
44
57
|
mergeCallAndResult: true;
|
|
45
58
|
};
|
|
@@ -4,6 +4,7 @@ import type { ConfiguredThinkingLevel } from "../render/render-utils.js";
|
|
|
4
4
|
import { type Component } from "../tui.js";
|
|
5
5
|
import type { RenderResultOptions } from "./renderer.js";
|
|
6
6
|
import { type Theme } from "../theme/theme.js";
|
|
7
|
+
import type { NativeToolView, ToolRenderResult } from "./renderer.js";
|
|
7
8
|
/** Render context threaded in from `ToolExecutionComponent.#buildRenderContext`. */
|
|
8
9
|
interface TaskRenderContext {
|
|
9
10
|
hasResult?: boolean;
|
|
@@ -61,6 +62,8 @@ export declare function renderNestedTaskResults(detailsList: TaskToolDetails[],
|
|
|
61
62
|
export declare const taskToolRenderer: {
|
|
62
63
|
renderCall: typeof renderCall;
|
|
63
64
|
renderResult: typeof renderResult;
|
|
65
|
+
describeCall(args: TaskParams, options: RenderResultOptions): NativeToolView | undefined;
|
|
66
|
+
describeResult(result: ToolRenderResult<TaskToolDetails>, options: TaskRenderOptions, args?: TaskParams): NativeToolView | undefined;
|
|
64
67
|
mergeCallAndResult: true;
|
|
65
68
|
};
|
|
66
69
|
/** Source of an agent definition */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NativeToolView } from "./renderer.js";
|
|
1
2
|
import { type Component } from "../index.js";
|
|
2
3
|
import type { RenderResultOptions } from "./renderer.js";
|
|
3
4
|
import { type Theme } from "../theme/theme.js";
|
|
@@ -10,4 +11,6 @@ export declare const thinkToolRenderer: {
|
|
|
10
11
|
inline: true;
|
|
11
12
|
renderCall(args: ThinkRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component;
|
|
12
13
|
renderResult(): undefined;
|
|
14
|
+
describeCall(args: ThinkRenderArgs, options: RenderResultOptions): NativeToolView;
|
|
15
|
+
describeResult(): undefined;
|
|
13
16
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Component } from "../index.js";
|
|
2
2
|
import type { RenderResultOptions } from "./renderer.js";
|
|
3
3
|
import type { Theme } from "../theme/theme.js";
|
|
4
|
+
import type { TspChecklistPhase } from "@oh-my-pi/pi-wire";
|
|
5
|
+
import type { NativeToolView, ToolRenderResult } from "./renderer.js";
|
|
4
6
|
/** Lifecycle state of a todo item. */
|
|
5
7
|
export type TodoStatus = "pending" | "in_progress" | "completed" | "abandoned" | "blocked";
|
|
6
8
|
/** Operation names accepted by the todo tool and echoed in successful result details. */
|
|
@@ -102,6 +104,14 @@ export declare const TODO_STRIKE_REVEAL_FRAMES = 12;
|
|
|
102
104
|
export declare const TODO_STRIKE_TOTAL_FRAMES: number;
|
|
103
105
|
/** Wire the live-subagent description source for {@link todoToolRenderer}. */
|
|
104
106
|
export declare function setActiveTodoDescriptionsProvider(provider: () => readonly string[]): void;
|
|
107
|
+
/**
|
|
108
|
+
* Checklist phases for native terminals: plain phase titles (no roman
|
|
109
|
+
* numerals — the terminal numbers nothing), completed phases folded.
|
|
110
|
+
*/
|
|
111
|
+
export declare function todoChecklistPhases(phases: readonly {
|
|
112
|
+
name: string;
|
|
113
|
+
tasks: readonly TodoItem[];
|
|
114
|
+
}[], isMatched?: (task: TodoItem) => boolean): TspChecklistPhase[];
|
|
105
115
|
/** Render todo operations and phased task snapshots. */
|
|
106
116
|
export declare const todoToolRenderer: {
|
|
107
117
|
renderCall(args: TodoRenderArgs, options: RenderResultOptions, uiTheme: Theme): Component;
|
|
@@ -113,6 +123,8 @@ export declare const todoToolRenderer: {
|
|
|
113
123
|
details?: TodoToolDetails;
|
|
114
124
|
isError?: boolean;
|
|
115
125
|
}, options: RenderResultOptions, uiTheme: Theme, args?: TodoRenderArgs): Component;
|
|
126
|
+
describeCall(args: TodoRenderArgs): NativeToolView;
|
|
127
|
+
describeResult(result: ToolRenderResult<TodoToolDetails>, options: RenderResultOptions): NativeToolView | undefined;
|
|
116
128
|
mergeCallAndResult: true;
|
|
117
129
|
};
|
|
118
130
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Component } from "../tui.js";
|
|
2
2
|
import type { Theme } from "../theme/theme.js";
|
|
3
|
-
import type { RenderResultOptions } from "./renderer.js";
|
|
3
|
+
import type { NativeToolView, RenderResultOptions, ToolRenderResult } from "./renderer.js";
|
|
4
4
|
/** Operation represented by a worker-session tool result. */
|
|
5
5
|
export type VibeOp = "spawn" | "send" | "wait" | "kill" | "list";
|
|
6
6
|
/** Details payload shared by every vibe tool for TUI rendering. */
|
|
@@ -120,5 +120,7 @@ export declare function createVibeToolRenderer(op: VibeOp): {
|
|
|
120
120
|
details?: VibeToolDetails;
|
|
121
121
|
isError?: boolean;
|
|
122
122
|
}, options: RenderResultOptions, uiTheme: Theme, args?: VibeRenderArgs): Component;
|
|
123
|
+
describeCall(args: VibeRenderArgs): NativeToolView | undefined;
|
|
124
|
+
describeResult(result: ToolRenderResult<VibeToolDetails>, _options: RenderResultOptions, args?: VibeRenderArgs): NativeToolView | undefined;
|
|
123
125
|
};
|
|
124
126
|
export {};
|
|
@@ -5,6 +5,7 @@ import { type ConfiguredThinkingLevel } from "../render/render-utils.js";
|
|
|
5
5
|
import type { StructuredSubagentOutput } from "./task.js";
|
|
6
6
|
import type { RenderResultOptions, ToolActivitySummary } from "./renderer.js";
|
|
7
7
|
import type { IrcDeliveryReceipt, IrcMessage } from "./irc.js";
|
|
8
|
+
import type { NativeToolView, ToolRenderResult } from "./renderer.js";
|
|
8
9
|
/** Whether a wait snapshot contains only running jobs and no cancellations. */
|
|
9
10
|
export declare function isWaitingPollDetails(details: unknown): boolean;
|
|
10
11
|
/** Coordination details retained by wait and background job operations. */
|
|
@@ -119,6 +120,8 @@ export declare const waitToolRenderer: {
|
|
|
119
120
|
mergeCallAndResult: true;
|
|
120
121
|
activitySummary(): ToolActivitySummary;
|
|
121
122
|
renderCall: typeof waitRenderCall;
|
|
123
|
+
describeCall(): NativeToolView;
|
|
124
|
+
describeResult(result: ToolRenderResult<CoordinationDetails>, options: RenderResultOptions): NativeToolView | undefined;
|
|
122
125
|
renderResult(result: {
|
|
123
126
|
content: Array<{
|
|
124
127
|
type: string;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web search response types shared by the coding agent's search providers and
|
|
3
|
+
* the transcript renderer in {@link ./web-search}. Render-free, so provider code
|
|
4
|
+
* can import it without loading UI components.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Display label for every search implementation: `web/*` engines and the
|
|
8
|
+
* chat-model groundings. Keys are the ids providers report in
|
|
9
|
+
* {@link SearchResponse.provider} and search errors.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SEARCH_PROVIDER_LABELS: {
|
|
12
|
+
readonly parallel: "Parallel";
|
|
13
|
+
readonly perplexity: "Perplexity";
|
|
14
|
+
readonly gemini: "Gemini";
|
|
15
|
+
readonly anthropic: "Anthropic";
|
|
16
|
+
readonly codex: "OpenAI Codex";
|
|
17
|
+
readonly openai: "OpenAI API";
|
|
18
|
+
readonly xai: "xAI";
|
|
19
|
+
readonly openrouter: "OpenRouter";
|
|
20
|
+
readonly zai: "Z.AI";
|
|
21
|
+
readonly exa: "Exa";
|
|
22
|
+
readonly tinyfish: "TinyFish";
|
|
23
|
+
readonly jina: "Jina";
|
|
24
|
+
readonly kagi: "Kagi";
|
|
25
|
+
readonly tavily: "Tavily";
|
|
26
|
+
readonly firecrawl: "Firecrawl";
|
|
27
|
+
readonly brave: "Brave";
|
|
28
|
+
readonly kimi: "Kimi";
|
|
29
|
+
readonly synthetic: "Synthetic";
|
|
30
|
+
readonly ollama: "Ollama";
|
|
31
|
+
readonly searxng: "SearXNG";
|
|
32
|
+
readonly startpage: "Startpage";
|
|
33
|
+
readonly duckduckgo: "DuckDuckGo";
|
|
34
|
+
readonly ecosia: "Ecosia";
|
|
35
|
+
readonly google: "Google";
|
|
36
|
+
readonly mojeek: "Mojeek";
|
|
37
|
+
readonly public: "Public Web";
|
|
38
|
+
};
|
|
39
|
+
/** Id of a search implementation; see {@link SEARCH_PROVIDER_LABELS}. */
|
|
40
|
+
export type SearchProviderId = keyof typeof SEARCH_PROVIDER_LABELS;
|
|
41
|
+
/** Label for a provider id; ids from older transcripts fall back to the raw id. */
|
|
42
|
+
export declare function getSearchProviderLabel(id: SearchProviderId): string;
|
|
43
|
+
/** Source returned by search (all providers) */
|
|
44
|
+
export interface SearchSource {
|
|
45
|
+
title: string;
|
|
46
|
+
url: string;
|
|
47
|
+
snippet?: string;
|
|
48
|
+
/** ISO date string or relative ("2d ago") */
|
|
49
|
+
publishedDate?: string;
|
|
50
|
+
/** Age in seconds for consistent formatting */
|
|
51
|
+
ageSeconds?: number;
|
|
52
|
+
author?: string;
|
|
53
|
+
}
|
|
54
|
+
/** Citation with text reference (LLM-mediated providers) */
|
|
55
|
+
export interface SearchCitation {
|
|
56
|
+
url: string;
|
|
57
|
+
title: string;
|
|
58
|
+
citedText?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Usage metrics */
|
|
61
|
+
export interface SearchUsage {
|
|
62
|
+
inputTokens?: number;
|
|
63
|
+
outputTokens?: number;
|
|
64
|
+
/** Anthropic: number of web search requests made */
|
|
65
|
+
searchRequests?: number;
|
|
66
|
+
/** Perplexity: combined token count */
|
|
67
|
+
totalTokens?: number;
|
|
68
|
+
}
|
|
69
|
+
/** Unified response across providers */
|
|
70
|
+
export interface SearchResponse {
|
|
71
|
+
provider: SearchProviderId | "none";
|
|
72
|
+
/** Synthesized answer text (LLM-mediated providers) */
|
|
73
|
+
answer?: string;
|
|
74
|
+
/** Search result sources */
|
|
75
|
+
sources: SearchSource[];
|
|
76
|
+
/** Text citations with context */
|
|
77
|
+
citations?: SearchCitation[];
|
|
78
|
+
/** Intermediate search queries (anthropic) */
|
|
79
|
+
searchQueries?: string[];
|
|
80
|
+
/** Follow-up question suggestions (provider-dependent) */
|
|
81
|
+
relatedQuestions?: string[];
|
|
82
|
+
/** Token usage metrics */
|
|
83
|
+
usage?: SearchUsage;
|
|
84
|
+
/** Model used */
|
|
85
|
+
model?: string;
|
|
86
|
+
/** Request ID for debugging */
|
|
87
|
+
requestId?: string;
|
|
88
|
+
/** Authentication mode used by the provider (e.g. oauth, api-key) */
|
|
89
|
+
authMode?: string;
|
|
90
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NativeToolView, ToolRenderResult } from "./renderer.js";
|
|
1
2
|
/**
|
|
2
3
|
* Web Search TUI Rendering
|
|
3
4
|
*
|
|
@@ -6,6 +7,7 @@
|
|
|
6
7
|
import type { Component } from "../index.js";
|
|
7
8
|
import type { RenderResultOptions } from "./renderer.js";
|
|
8
9
|
import { type Theme } from "../theme/theme.js";
|
|
10
|
+
import { type SearchResponse } from "./web-search-types.js";
|
|
9
11
|
/** Search response and optional failure shown in the transcript. */
|
|
10
12
|
export interface SearchRenderDetails {
|
|
11
13
|
response: SearchResponse;
|
|
@@ -27,177 +29,16 @@ export declare function renderSearchCall(args: {
|
|
|
27
29
|
query?: string;
|
|
28
30
|
[key: string]: unknown;
|
|
29
31
|
}, _options: RenderResultOptions, theme: Theme): Component;
|
|
32
|
+
type SearchRenderArgs = {
|
|
33
|
+
query?: string;
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
};
|
|
30
36
|
/** Render web search queries, answers, and cited sources. */
|
|
31
37
|
export declare const webSearchToolRenderer: {
|
|
32
38
|
renderCall: typeof renderSearchCall;
|
|
33
39
|
renderResult: typeof renderSearchResult;
|
|
40
|
+
describeCall(args: SearchRenderArgs): NativeToolView;
|
|
41
|
+
describeResult(result: ToolRenderResult<SearchRenderDetails>, _options: RenderResultOptions, args?: SearchRenderArgs): NativeToolView | undefined;
|
|
34
42
|
mergeCallAndResult: true;
|
|
35
43
|
};
|
|
36
|
-
|
|
37
|
-
* Web Search Types
|
|
38
|
-
*
|
|
39
|
-
* Unified types for web search responses across supported providers.
|
|
40
|
-
*/
|
|
41
|
-
export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
42
|
-
readonly value: "auto";
|
|
43
|
-
readonly label: "Auto";
|
|
44
|
-
readonly description: "Automatically uses the first configured web-search provider";
|
|
45
|
-
}, {
|
|
46
|
-
readonly value: "parallel";
|
|
47
|
-
readonly label: "Parallel";
|
|
48
|
-
readonly description: "Uses API auth when configured; otherwise searches through the keyless public MCP";
|
|
49
|
-
}, {
|
|
50
|
-
readonly value: "perplexity";
|
|
51
|
-
readonly label: "Perplexity";
|
|
52
|
-
readonly description: "Uses auth when configured; explicit selection falls back to anonymous search";
|
|
53
|
-
}, {
|
|
54
|
-
readonly value: "gemini";
|
|
55
|
-
readonly label: "Gemini";
|
|
56
|
-
readonly description: "Google Search grounding via Gemini (uses google-gemini-cli or google-antigravity OAuth)";
|
|
57
|
-
}, {
|
|
58
|
-
readonly value: "anthropic";
|
|
59
|
-
readonly label: "Anthropic";
|
|
60
|
-
readonly description: "Claude's native web_search tool (uses Anthropic OAuth or ANTHROPIC_API_KEY)";
|
|
61
|
-
}, {
|
|
62
|
-
readonly value: "codex";
|
|
63
|
-
readonly label: "OpenAI Codex";
|
|
64
|
-
readonly description: "OpenAI's native web_search (uses ChatGPT OAuth via /login openai-codex)";
|
|
65
|
-
}, {
|
|
66
|
-
readonly value: "openai";
|
|
67
|
-
readonly label: "OpenAI API";
|
|
68
|
-
readonly description: "OpenAI hosted web_search via OPENAI_API_KEY or OpenAI API-key registry credentials; billed by API usage";
|
|
69
|
-
}, {
|
|
70
|
-
readonly value: "xai";
|
|
71
|
-
readonly label: "xAI";
|
|
72
|
-
readonly description: "Grok web search via xAI Responses API (uses SuperGrok/X Premium+ OAuth via /login xai-oauth, or XAI_API_KEY)";
|
|
73
|
-
}, {
|
|
74
|
-
readonly value: "openrouter";
|
|
75
|
-
readonly label: "OpenRouter";
|
|
76
|
-
readonly description: "OpenRouter plugins-based web search with model-selected grounding";
|
|
77
|
-
}, {
|
|
78
|
-
readonly value: "zai";
|
|
79
|
-
readonly label: "Z.AI";
|
|
80
|
-
readonly description: "Calls Z.AI webSearchPrime MCP";
|
|
81
|
-
}, {
|
|
82
|
-
readonly value: "exa";
|
|
83
|
-
readonly label: "Exa";
|
|
84
|
-
readonly description: "API via /login exa or EXA_API_KEY; explicit keyless fallback via MCP";
|
|
85
|
-
}, {
|
|
86
|
-
readonly value: "tinyfish";
|
|
87
|
-
readonly label: "TinyFish";
|
|
88
|
-
readonly description: "Requires TINYFISH_API_KEY";
|
|
89
|
-
}, {
|
|
90
|
-
readonly value: "jina";
|
|
91
|
-
readonly label: "Jina";
|
|
92
|
-
readonly description: "Requires JINA_API_KEY";
|
|
93
|
-
}, {
|
|
94
|
-
readonly value: "kagi";
|
|
95
|
-
readonly label: "Kagi";
|
|
96
|
-
readonly description: "Requires KAGI_API_KEY and Kagi Search API beta access";
|
|
97
|
-
}, {
|
|
98
|
-
readonly value: "tavily";
|
|
99
|
-
readonly label: "Tavily";
|
|
100
|
-
readonly description: "Requires TAVILY_API_KEY";
|
|
101
|
-
}, {
|
|
102
|
-
readonly value: "firecrawl";
|
|
103
|
-
readonly label: "Firecrawl";
|
|
104
|
-
readonly description: "Uses Firecrawl API when FIRECRAWL_API_KEY is set; falls back to keyless mode";
|
|
105
|
-
}, {
|
|
106
|
-
readonly value: "brave";
|
|
107
|
-
readonly label: "Brave";
|
|
108
|
-
readonly description: "Requires BRAVE_API_KEY";
|
|
109
|
-
}, {
|
|
110
|
-
readonly value: "kimi";
|
|
111
|
-
readonly label: "Kimi";
|
|
112
|
-
readonly description: "Kimi Code search (requires a Kimi Code Console key via KIMI_SEARCH_API_KEY/MOONSHOT_SEARCH_API_KEY or /login kimi-code; not MOONSHOT_API_KEY)";
|
|
113
|
-
}, {
|
|
114
|
-
readonly value: "synthetic";
|
|
115
|
-
readonly label: "Synthetic";
|
|
116
|
-
readonly description: "Requires SYNTHETIC_API_KEY";
|
|
117
|
-
}, {
|
|
118
|
-
readonly value: "ollama";
|
|
119
|
-
readonly label: "Ollama";
|
|
120
|
-
readonly description: "Requires OLLAMA_CLOUD_API_KEY";
|
|
121
|
-
}, {
|
|
122
|
-
readonly value: "searxng";
|
|
123
|
-
readonly label: "SearXNG";
|
|
124
|
-
readonly description: "Requires SEARXNG_ENDPOINT or searxng.endpoint";
|
|
125
|
-
}, {
|
|
126
|
-
readonly value: "startpage";
|
|
127
|
-
readonly label: "Startpage";
|
|
128
|
-
readonly description: "Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged";
|
|
129
|
-
}, {
|
|
130
|
-
readonly value: "duckduckgo";
|
|
131
|
-
readonly label: "DuckDuckGo";
|
|
132
|
-
readonly description: "Credential-free best-effort fallback; may be bot-challenged on datacenter/shared-egress IPs";
|
|
133
|
-
}, {
|
|
134
|
-
readonly value: "ecosia";
|
|
135
|
-
readonly label: "Ecosia";
|
|
136
|
-
readonly description: "Credential-free browser-backed scrape of Ecosia (Google-backed) results";
|
|
137
|
-
}, {
|
|
138
|
-
readonly value: "google";
|
|
139
|
-
readonly label: "Google";
|
|
140
|
-
readonly description: "Credential-free browser-backed fallback; slower and may be bot-challenged";
|
|
141
|
-
}, {
|
|
142
|
-
readonly value: "mojeek";
|
|
143
|
-
readonly label: "Mojeek";
|
|
144
|
-
readonly description: "Credential-free browser-backed scrape of Mojeek's independent index";
|
|
145
|
-
}, {
|
|
146
|
-
readonly value: "public";
|
|
147
|
-
readonly label: "Public Web";
|
|
148
|
-
readonly description: "Queries every credential-free engine in parallel and consolidates deduplicated results";
|
|
149
|
-
}];
|
|
150
|
-
/** Supported web search providers (every option except `auto`). */
|
|
151
|
-
export type SearchProviderId = Exclude<(typeof SEARCH_PROVIDER_OPTIONS)[number]["value"], "auto">;
|
|
152
|
-
/** Display labels, derived from {@link SEARCH_PROVIDER_OPTIONS}. */
|
|
153
|
-
export declare const SEARCH_PROVIDER_LABELS: Record<SearchProviderId, string>;
|
|
154
|
-
/** Source returned by search (all providers) */
|
|
155
|
-
export interface SearchSource {
|
|
156
|
-
title: string;
|
|
157
|
-
url: string;
|
|
158
|
-
snippet?: string;
|
|
159
|
-
/** ISO date string or relative ("2d ago") */
|
|
160
|
-
publishedDate?: string;
|
|
161
|
-
/** Age in seconds for consistent formatting */
|
|
162
|
-
ageSeconds?: number;
|
|
163
|
-
author?: string;
|
|
164
|
-
}
|
|
165
|
-
/** Citation with text reference (LLM-mediated providers) */
|
|
166
|
-
export interface SearchCitation {
|
|
167
|
-
url: string;
|
|
168
|
-
title: string;
|
|
169
|
-
citedText?: string;
|
|
170
|
-
}
|
|
171
|
-
/** Usage metrics */
|
|
172
|
-
export interface SearchUsage {
|
|
173
|
-
inputTokens?: number;
|
|
174
|
-
outputTokens?: number;
|
|
175
|
-
/** Anthropic: number of web search requests made */
|
|
176
|
-
searchRequests?: number;
|
|
177
|
-
/** Perplexity: combined token count */
|
|
178
|
-
totalTokens?: number;
|
|
179
|
-
}
|
|
180
|
-
/** Unified response across providers */
|
|
181
|
-
export interface SearchResponse {
|
|
182
|
-
provider: SearchProviderId | "none";
|
|
183
|
-
/** Synthesized answer text (LLM-mediated providers) */
|
|
184
|
-
answer?: string;
|
|
185
|
-
/** Search result sources */
|
|
186
|
-
sources: SearchSource[];
|
|
187
|
-
/** Text citations with context */
|
|
188
|
-
citations?: SearchCitation[];
|
|
189
|
-
/** Intermediate search queries (anthropic) */
|
|
190
|
-
searchQueries?: string[];
|
|
191
|
-
/** Follow-up question suggestions (provider-dependent) */
|
|
192
|
-
relatedQuestions?: string[];
|
|
193
|
-
/** Token usage metrics */
|
|
194
|
-
usage?: SearchUsage;
|
|
195
|
-
/** Model used */
|
|
196
|
-
model?: string;
|
|
197
|
-
/** Request ID for debugging */
|
|
198
|
-
requestId?: string;
|
|
199
|
-
/** Authentication mode used by the provider (e.g. oauth, api-key) */
|
|
200
|
-
authMode?: string;
|
|
201
|
-
}
|
|
202
|
-
/** Cheap, sync metadata accessor — never triggers a provider load. */
|
|
203
|
-
export declare function getSearchProviderLabel(id: SearchProviderId): string;
|
|
44
|
+
export {};
|
|
@@ -6,7 +6,7 @@ import { type ProcWriteDetails } from "./proc-render.js";
|
|
|
6
6
|
import { type CfgWriteDetails } from "./cfg-render.js";
|
|
7
7
|
import type { FileDiagnosticsResult } from "./lsp.js";
|
|
8
8
|
import type { OutputMeta } from "./output-meta.js";
|
|
9
|
-
import type { RenderResultOptions, ToolActivityContext, ToolActivitySummary } from "./renderer.js";
|
|
9
|
+
import type { NativeToolView, RenderResultOptions, ToolActivityContext, ToolActivitySummary } from "./renderer.js";
|
|
10
10
|
import { type XdevRenderDispatch, type XdevMountedRenderer } from "./xdev.js";
|
|
11
11
|
/** Details returned by the write tool for transcript rendering. */
|
|
12
12
|
export interface WriteToolDetails {
|
|
@@ -76,6 +76,19 @@ export declare const writeToolRenderer: {
|
|
|
76
76
|
}, options: RenderResultOptions & {
|
|
77
77
|
renderContext?: WriteRenderContext;
|
|
78
78
|
}, uiTheme: Theme, args?: WriteRenderArgs): Component;
|
|
79
|
+
describeCall(args: WriteRenderArgs, options: RenderResultOptions & {
|
|
80
|
+
renderContext?: WriteRenderContext;
|
|
81
|
+
}): NativeToolView | undefined;
|
|
82
|
+
describeResult(result: {
|
|
83
|
+
content: Array<{
|
|
84
|
+
type: string;
|
|
85
|
+
text?: string;
|
|
86
|
+
}>;
|
|
87
|
+
details?: WriteToolDetails;
|
|
88
|
+
isError?: boolean;
|
|
89
|
+
}, options: RenderResultOptions & {
|
|
90
|
+
renderContext?: WriteRenderContext;
|
|
91
|
+
}, args?: WriteRenderArgs): NativeToolView | undefined;
|
|
79
92
|
mergeCallAndResult: true;
|
|
80
93
|
forceFirstResultViewportRepaint: (args: unknown, options: RenderResultOptions) => boolean;
|
|
81
94
|
};
|
|
@@ -2,9 +2,12 @@ import type { ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
|
2
2
|
import { type Component } from "../index.js";
|
|
3
3
|
import type { Theme } from "../theme/theme.js";
|
|
4
4
|
import type { RenderResultOptions, ToolActivitySummary, ToolRenderer } from "./renderer.js";
|
|
5
|
+
import type { NativeToolView } from "./renderer.js";
|
|
5
6
|
/** Mounted device display callbacks, independent of tool execution state. */
|
|
6
7
|
export interface XdevMountedRenderer {
|
|
7
8
|
label?: string;
|
|
9
|
+
describeCall?: ToolRenderer["describeCall"];
|
|
10
|
+
describeResult?: ToolRenderer["describeResult"];
|
|
8
11
|
renderCall?(...args: Parameters<ToolRenderer["renderCall"]>): unknown;
|
|
9
12
|
renderResult?(...args: Parameters<ToolRenderer["renderResult"]>): unknown;
|
|
10
13
|
mergeCallAndResult?: boolean;
|
|
@@ -50,6 +53,16 @@ export declare function xdevActivitySummary(name: string, content: unknown, reso
|
|
|
50
53
|
* nothing) when no renderer produces output.
|
|
51
54
|
*/
|
|
52
55
|
export declare function renderXdevCall(name: string, content: unknown, options: RenderResultOptions, theme: Theme, resolveMounted?: (name: string) => XdevMountedRenderer | undefined): Component | undefined;
|
|
56
|
+
/** TSP call view for an `xd://` write: queued card until execution, then the device renderer's own view. */
|
|
57
|
+
export declare function describeXdevCall(name: string, content: unknown, options: RenderResultOptions, resolveMounted?: (name: string) => XdevMountedRenderer | undefined): NativeToolView | undefined;
|
|
58
|
+
/** TSP result view for an `xd://` dispatch, forwarded to the device renderer. */
|
|
59
|
+
export declare function describeXdevResult(dispatch: XdevRenderDispatch, result: {
|
|
60
|
+
content: Array<{
|
|
61
|
+
type: string;
|
|
62
|
+
text?: string;
|
|
63
|
+
}>;
|
|
64
|
+
isError?: boolean;
|
|
65
|
+
}, options: RenderResultOptions, resolveMounted?: (name: string) => XdevMountedRenderer | undefined): NativeToolView | undefined;
|
|
53
66
|
/** Forward an `xd://` dispatch result to the mounted tool's renderer. */
|
|
54
67
|
export declare function renderXdevResult(dispatch: XdevRenderDispatch, result: {
|
|
55
68
|
content: Array<{
|
package/dist/types/tui.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { TspFrame, TspNode, TspText } from "@oh-my-pi/pi-wire";
|
|
1
2
|
import { ImageBudget } from "./components/image.js";
|
|
3
|
+
import type { DescribeContext, NativeNode, NativeUiEvent } from "./native/node.js";
|
|
2
4
|
import { type Terminal } from "./terminal.js";
|
|
3
5
|
import { visibleWidth } from "./utils.js";
|
|
4
6
|
/** Full-attribute reset terminating each rendered content row. */
|
|
@@ -109,6 +111,35 @@ export interface Component {
|
|
|
109
111
|
* last time.
|
|
110
112
|
*/
|
|
111
113
|
render(width: number): readonly string[];
|
|
114
|
+
/**
|
|
115
|
+
* Describe the component semantically for a Tern Surface Protocol
|
|
116
|
+
* terminal (see `native/node.ts`). Called instead of `render()` when the
|
|
117
|
+
* native backend is active. Return the same node object while nothing
|
|
118
|
+
* changed; return null to fall back to `render()` rows.
|
|
119
|
+
*/
|
|
120
|
+
describe?(cx: DescribeContext): NativeNode | null;
|
|
121
|
+
/**
|
|
122
|
+
* Props for the native `overlay` wrapper when this component is shown as
|
|
123
|
+
* an overlay: the sheet's `role` (Tern styles `omp.overlay.*` roles as
|
|
124
|
+
* glass sheets, so the component's own root must not draw a second frame),
|
|
125
|
+
* `head` spans for the sheet's title row, and `size`/`anchor` overriding
|
|
126
|
+
* the ones derived from the overlay options.
|
|
127
|
+
*/
|
|
128
|
+
nativeOverlay?: {
|
|
129
|
+
role?: string;
|
|
130
|
+
head?: TspText;
|
|
131
|
+
size?: "sm" | "md" | "lg" | "full";
|
|
132
|
+
anchor?: "center" | "top" | "bottom";
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* True when this component, shown as an overlay, describes a data-first
|
|
136
|
+
* sheet (`picker`, `prefs`) that is its own frame: the backend puts it
|
|
137
|
+
* directly in `layer` with no `overlay` wrapper. Usually
|
|
138
|
+
* `cx.supports("picker")`, so older terminals keep the wrapped fallback.
|
|
139
|
+
*/
|
|
140
|
+
nativeSheet?(cx: DescribeContext): boolean;
|
|
141
|
+
/** User actions on nodes this component described (toggle, select, activate, custom). */
|
|
142
|
+
handleNativeEvent?(event: NativeUiEvent): void;
|
|
112
143
|
/**
|
|
113
144
|
* Optional handler for keyboard input when component has focus
|
|
114
145
|
*/
|
|
@@ -269,6 +300,7 @@ export declare class Container implements Component {
|
|
|
269
300
|
*/
|
|
270
301
|
dispose(): void;
|
|
271
302
|
render(width: number): readonly string[];
|
|
303
|
+
describe(_cx: DescribeContext): NativeNode | null;
|
|
272
304
|
}
|
|
273
305
|
/**
|
|
274
306
|
* Merge runs of byte-adjacent SGR sequences (`CSI [0-9;:]* m`) into one. Only
|
|
@@ -382,6 +414,23 @@ export declare class TUI extends Container {
|
|
|
382
414
|
setInlineMouseTrackingProvider(provider: (() => boolean) | undefined): void;
|
|
383
415
|
invalidate(): void;
|
|
384
416
|
start(options?: TUIStartOptions): void;
|
|
417
|
+
/** Whether frames go to a Tern Surface Protocol surface instead of the row renderer. */
|
|
418
|
+
get nativeRendering(): boolean;
|
|
419
|
+
/**
|
|
420
|
+
* Close the TSP surfaces ahead of {@link stop}, before the exit drains
|
|
421
|
+
* input: the terminal answers nothing once they are closed, and whatever it
|
|
422
|
+
* already sent (acks, events) is read and dropped here instead of reaching
|
|
423
|
+
* the shell as typed text. A render already requested (the exit's status
|
|
424
|
+
* line) goes out first; none is forced, and nothing renders from now until
|
|
425
|
+
* `stop()`.
|
|
426
|
+
*/
|
|
427
|
+
closeNative(): void;
|
|
428
|
+
/** Reference document the TSP terminal should hold (debug mirror only). */
|
|
429
|
+
getNativeDocument(): TspNode | undefined;
|
|
430
|
+
/** Most recent TSP frames sent (debug mirror only). */
|
|
431
|
+
getNativeFrames(count?: number): readonly TspFrame[];
|
|
432
|
+
/** `rows` fallback nodes in the last native frame. */
|
|
433
|
+
get nativeFallbackCount(): number;
|
|
385
434
|
/**
|
|
386
435
|
* Take ownership of stdin after a `deferInput` start: raw mode, input
|
|
387
436
|
* handlers, and the response-eliciting capability probes start() skipped.
|