@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
|
@@ -17,6 +17,10 @@ import { renderProgressBar, type ProgressBarStyle } from "../components/progress
|
|
|
17
17
|
import { fgOrPlain, theme } from "../theme/theme";
|
|
18
18
|
import { createLiveBoard, type LiveBoardOutput } from "../chrome/live-board";
|
|
19
19
|
import type { AgentProgress } from "../tools/task";
|
|
20
|
+
import type { TspSpan } from "@oh-my-pi/pi-wire";
|
|
21
|
+
import { col, elapsed, keyed, node, row, span, stableKey, text } from "../native/describe";
|
|
22
|
+
import type { DescribeContext, NativeNode } from "../native/node";
|
|
23
|
+
import { Memo } from "../native/memo";
|
|
20
24
|
|
|
21
25
|
/** Checker identity shown in live rows and verdicts. */
|
|
22
26
|
export interface CleanseCheckerDescriptor {
|
|
@@ -100,19 +104,36 @@ export class CleanseBoardModel {
|
|
|
100
104
|
#repairTotal = 0;
|
|
101
105
|
#repairDone = 0;
|
|
102
106
|
#repairStartedAt = 0;
|
|
107
|
+
/** Bumped by every mutator that changes the live rows; keys the native memo. */
|
|
108
|
+
#version = 0;
|
|
109
|
+
readonly #native = new Memo();
|
|
110
|
+
#lastSettled: NativeNode | undefined;
|
|
103
111
|
|
|
104
112
|
phase(text: string | undefined): void {
|
|
105
113
|
this.#phaseText = text;
|
|
114
|
+
this.#version += 1;
|
|
106
115
|
}
|
|
107
116
|
|
|
108
117
|
checkerStarted(checker: CleanseCheckerDescriptor): void {
|
|
109
118
|
this.#checkers.set(checker.id, { label: checker.label, startedAt: Date.now() });
|
|
119
|
+
this.#version += 1;
|
|
110
120
|
}
|
|
111
121
|
|
|
112
122
|
/** Drop the checker's live row and build its permanent verdict line. */
|
|
113
123
|
checkerFinished(check: CleanseCheckResult, durationMs: number): string {
|
|
114
124
|
this.#checkers.delete(check.id);
|
|
125
|
+
this.#version += 1;
|
|
115
126
|
const count = check.diagnostics.length;
|
|
127
|
+
const tone = count === 0 ? "success" : "warning";
|
|
128
|
+
this.#lastSettled = text(
|
|
129
|
+
[
|
|
130
|
+
span(count === 0 ? "✓ " : "● ", tone),
|
|
131
|
+
span(`${check.label} `),
|
|
132
|
+
span(count === 0 ? "clean" : `${count} issue${count === 1 ? "" : "s"}`, tone),
|
|
133
|
+
span(` · ${formatDuration(durationMs)}`, "dim"),
|
|
134
|
+
],
|
|
135
|
+
{ wrap: "word", role: "omp.cleanse.verdict" },
|
|
136
|
+
);
|
|
116
137
|
const verdict =
|
|
117
138
|
count === 0 ? fgOrPlain("success", "clean") : fgOrPlain("warning", `${count} issue${count === 1 ? "" : "s"}`);
|
|
118
139
|
const glyph = count === 0 ? fgOrPlain("success", "✓") : fgOrPlain("warning", "●");
|
|
@@ -123,18 +144,21 @@ export class CleanseBoardModel {
|
|
|
123
144
|
this.#repairTotal = 0;
|
|
124
145
|
this.#repairDone = 0;
|
|
125
146
|
this.#agents.clear();
|
|
147
|
+
this.#version += 1;
|
|
126
148
|
}
|
|
127
149
|
|
|
128
150
|
agentStarted(name: string, assignment: CleanseAssignment): void {
|
|
129
151
|
if (this.#repairStartedAt === 0) this.#repairStartedAt = Date.now();
|
|
130
152
|
this.#repairTotal += 1;
|
|
131
153
|
this.#agents.set(name, { assignment, startedAt: Date.now() });
|
|
154
|
+
this.#version += 1;
|
|
132
155
|
}
|
|
133
156
|
|
|
134
157
|
agentProgress(name: string, progress: AgentProgress): void {
|
|
135
158
|
this.#totals.set(name, { tokens: progress.tokens, cost: progress.cost });
|
|
136
159
|
const agent = this.#agents.get(name);
|
|
137
160
|
if (agent) agent.progress = progress;
|
|
161
|
+
this.#version += 1;
|
|
138
162
|
}
|
|
139
163
|
|
|
140
164
|
/** Drop the agent's live row, advance the repair bar, and build its permanent outcome line. */
|
|
@@ -142,7 +166,98 @@ export class CleanseBoardModel {
|
|
|
142
166
|
const agent = this.#agents.get(outcome.name);
|
|
143
167
|
this.#agents.delete(outcome.name);
|
|
144
168
|
this.#repairDone = Math.min(this.#repairDone + 1, this.#repairTotal);
|
|
145
|
-
|
|
169
|
+
this.#version += 1;
|
|
170
|
+
const total = this.#totals.get(outcome.name);
|
|
171
|
+
this.#lastSettled = describeOutcome(outcome, assignment, agent, total);
|
|
172
|
+
return renderOutcomeLine(outcome, assignment, agent, total);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Semantic twin of the permanent line the most recent
|
|
177
|
+
* {@link checkerFinished}/{@link agentFinished} call returned, for native
|
|
178
|
+
* surfaces that log settled work as nodes.
|
|
179
|
+
*/
|
|
180
|
+
get lastSettled(): NativeNode | undefined {
|
|
181
|
+
return this.#lastSettled;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Native live rows (NATIVE_REDESIGN §10): phase and checker spinners, the
|
|
186
|
+
* repair head with a `meter` of fixed lanes, and the running repair agents
|
|
187
|
+
* as a grid of lanes, one `agent` row each (status, current tool with its
|
|
188
|
+
* intent, tools, tokens, cost, timer). Terminals without `agent`/`meter`
|
|
189
|
+
* get the plain rows and a `progress` bar. Spinners and timers are
|
|
190
|
+
* terminal-clocked, so the node only changes when the board state does.
|
|
191
|
+
* `undefined` while nothing is live.
|
|
192
|
+
*/
|
|
193
|
+
describeLive(cx: DescribeContext): NativeNode | undefined {
|
|
194
|
+
if (!this.#phaseText && this.#checkers.size === 0 && this.#repairTotal === 0) return undefined;
|
|
195
|
+
const lanes = cx.supports("agent");
|
|
196
|
+
const meter = cx.supports("meter");
|
|
197
|
+
return this.#native.get([this.#version, lanes, meter], () => {
|
|
198
|
+
const rows: NativeNode[] = [];
|
|
199
|
+
if (this.#phaseText) {
|
|
200
|
+
rows.push(node("spinner", { label: this.#phaseText, tone: "warning" }, undefined, "phase"));
|
|
201
|
+
}
|
|
202
|
+
for (const [id, checker] of this.#checkers) {
|
|
203
|
+
const checkerRow = row(
|
|
204
|
+
[node("spinner", { label: checker.label, tone: "warning" }), elapsed(Date.now() - checker.startedAt)],
|
|
205
|
+
{ gap: "sm" },
|
|
206
|
+
);
|
|
207
|
+
rows.push(keyed(checkerRow, `checker-${stableKey(id)}`));
|
|
208
|
+
}
|
|
209
|
+
if (this.#repairTotal > 0) {
|
|
210
|
+
rows.push(this.#describeRepairHeader(meter));
|
|
211
|
+
const agents = [...this.#agents.entries()].sort(
|
|
212
|
+
(left, right) => left[1].assignment.index - right[1].assignment.index,
|
|
213
|
+
);
|
|
214
|
+
if (lanes) {
|
|
215
|
+
const now = Date.now();
|
|
216
|
+
rows.push(
|
|
217
|
+
node(
|
|
218
|
+
"col",
|
|
219
|
+
{ role: "omp.cleanse.lanes", gap: "sm" },
|
|
220
|
+
agents.map(([name, agent]) => describeAgentLane(name, agent, now)),
|
|
221
|
+
"lanes",
|
|
222
|
+
),
|
|
223
|
+
);
|
|
224
|
+
} else {
|
|
225
|
+
for (const [name, agent] of agents) rows.push(describeAgentRow(name, agent));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return col(rows, { role: "omp.cleanse.live", gap: lanes ? "sm" : "xs" });
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
#describeRepairHeader(meter: boolean): NativeNode {
|
|
233
|
+
let tokens = 0;
|
|
234
|
+
let cost = 0;
|
|
235
|
+
for (const entry of this.#totals.values()) {
|
|
236
|
+
tokens += entry.tokens;
|
|
237
|
+
cost += entry.cost;
|
|
238
|
+
}
|
|
239
|
+
const parts: string[] = [];
|
|
240
|
+
if (this.#agents.size > 0) parts.push(`${this.#agents.size} running`);
|
|
241
|
+
if (tokens > 0) parts.push(`${formatNumber(tokens)} tok`);
|
|
242
|
+
if (cost > 0) parts.push(formatCost(cost));
|
|
243
|
+
const value = this.#repairDone / this.#repairTotal;
|
|
244
|
+
const label = `${this.#repairDone}/${this.#repairTotal}`;
|
|
245
|
+
const children: NativeNode[] = [
|
|
246
|
+
node("spinner", { label: "Repairing", tone: "accent" }),
|
|
247
|
+
meter
|
|
248
|
+
? node("meter", {
|
|
249
|
+
value,
|
|
250
|
+
style: "bar",
|
|
251
|
+
size: "md",
|
|
252
|
+
label: `${label} lanes`,
|
|
253
|
+
title: `${this.#repairDone} of ${this.#repairTotal} repair lanes finished`,
|
|
254
|
+
role: "omp.cleanse.meter",
|
|
255
|
+
})
|
|
256
|
+
: node("progress", { value, label, tone: "accent" }),
|
|
257
|
+
];
|
|
258
|
+
if (parts.length > 0) children.push(text([span(parts.join(" · "), "muted")]));
|
|
259
|
+
children.push(elapsed(Date.now() - this.#repairStartedAt));
|
|
260
|
+
return keyed(row(children, { gap: "sm", align: "center", role: "omp.cleanse.head" }), "repair");
|
|
146
261
|
}
|
|
147
262
|
|
|
148
263
|
/** Render the transient live rows for the current spinner frame. */
|
|
@@ -277,6 +392,109 @@ function renderAgentRow(spinner: string, agentName: string, agent: RunningAgent)
|
|
|
277
392
|
);
|
|
278
393
|
}
|
|
279
394
|
|
|
395
|
+
function describeAgentRow(agentName: string, agent: RunningAgent): NativeNode {
|
|
396
|
+
const toolCount = agent.progress?.toolCount ?? 0;
|
|
397
|
+
const children: NativeNode[] = [
|
|
398
|
+
node("spinner", { label: [span(agentName.replace(/^Cleanse/, ""), "strong")], tone: "warning" }),
|
|
399
|
+
text([span(compactFiles(agent.assignment), "path")], { truncate: "middle" }),
|
|
400
|
+
text(describeActivity(agent.progress), { truncate: "end", grow: 1 }),
|
|
401
|
+
];
|
|
402
|
+
if (toolCount > 0) children.push(text([span(`${toolCount} tool${toolCount === 1 ? "" : "s"}`, "dim")]));
|
|
403
|
+
children.push(elapsed(Date.now() - agent.startedAt));
|
|
404
|
+
return keyed(row(children, { gap: "sm" }), `agent-${stableKey(agentName)}`);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** A running repair lane as an `agent` row: its files as the task, the live tool and its intent, the run's stats. */
|
|
408
|
+
function describeAgentLane(agentName: string, agent: RunningAgent, now: number): NativeNode {
|
|
409
|
+
const progress = agent.progress;
|
|
410
|
+
const intent = sanitizeDisplaySingleLine(progress?.lastIntent ?? progress?.currentToolArgs ?? "")
|
|
411
|
+
.replace(/\s+/g, " ")
|
|
412
|
+
.trim();
|
|
413
|
+
return node(
|
|
414
|
+
"agent",
|
|
415
|
+
{
|
|
416
|
+
name: agentName.replace(/^Cleanse/, "") || agentName,
|
|
417
|
+
task: [span(compactFiles(agent.assignment), "path")],
|
|
418
|
+
status: progress?.status === "pending" ? "pending" : "running",
|
|
419
|
+
model: progress?.resolvedModel,
|
|
420
|
+
tool: progress?.currentTool
|
|
421
|
+
? {
|
|
422
|
+
name: progress.currentTool,
|
|
423
|
+
intent: intent || undefined,
|
|
424
|
+
age: progress.currentToolStartMs ? Math.max(0, now - progress.currentToolStartMs) : undefined,
|
|
425
|
+
}
|
|
426
|
+
: null,
|
|
427
|
+
retry: progress?.retryState
|
|
428
|
+
? {
|
|
429
|
+
attempt: progress.retryState.attempt,
|
|
430
|
+
max: progress.retryState.maxAttempts,
|
|
431
|
+
age: Math.max(0, now - progress.retryState.startedAtMs),
|
|
432
|
+
delay: progress.retryState.delayMs,
|
|
433
|
+
error: progress.retryState.errorMessage,
|
|
434
|
+
}
|
|
435
|
+
: null,
|
|
436
|
+
stats: {
|
|
437
|
+
tools: progress?.toolCount || undefined,
|
|
438
|
+
tokens: progress?.tokens || undefined,
|
|
439
|
+
cost: progress && progress.cost > 0 ? progress.cost : undefined,
|
|
440
|
+
age: now - agent.startedAt,
|
|
441
|
+
},
|
|
442
|
+
role: "omp.cleanse.lane",
|
|
443
|
+
},
|
|
444
|
+
undefined,
|
|
445
|
+
`agent-${stableKey(agentName)}`,
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/** Spans for a repair agent's latest activity, mirroring {@link agentActivity}. */
|
|
450
|
+
function describeActivity(progress: AgentProgress | undefined): TspSpan[] {
|
|
451
|
+
if (!progress) return [span("starting", "dim")];
|
|
452
|
+
if (progress.retryState) {
|
|
453
|
+
return [
|
|
454
|
+
span(`rate-limited · retry ${progress.retryState.attempt}/${progress.retryState.maxAttempts}`, "warning"),
|
|
455
|
+
];
|
|
456
|
+
}
|
|
457
|
+
const intent = sanitizeDisplaySingleLine(progress.lastIntent ?? "")
|
|
458
|
+
.replace(/\s+/g, " ")
|
|
459
|
+
.trim();
|
|
460
|
+
if (progress.currentTool) {
|
|
461
|
+
const args = sanitizeDisplaySingleLine(progress.currentToolArgs ?? "")
|
|
462
|
+
.replace(/\s+/g, " ")
|
|
463
|
+
.trim();
|
|
464
|
+
const tool = span(args ? `${progress.currentTool} ${args}` : progress.currentTool, "dim");
|
|
465
|
+
return intent ? [span(`${intent} `), tool] : [tool];
|
|
466
|
+
}
|
|
467
|
+
return intent ? [span(intent)] : [span("thinking", "dim")];
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/** Semantic twin of {@link renderOutcomeLine}. */
|
|
471
|
+
function describeOutcome(
|
|
472
|
+
outcome: CleanseAgentOutcome,
|
|
473
|
+
assignment: CleanseAssignment,
|
|
474
|
+
agent: RunningAgent | undefined,
|
|
475
|
+
total: { tokens: number; cost: number } | undefined,
|
|
476
|
+
): NativeNode {
|
|
477
|
+
const files = compactFiles(assignment);
|
|
478
|
+
if (!outcome.success) {
|
|
479
|
+
const message = sanitizeDisplaySingleLine(outcome.error ?? "subagent failed")
|
|
480
|
+
.replace(/\s+/g, " ")
|
|
481
|
+
.trim();
|
|
482
|
+
return text([span("✗ ", "error"), span(`${outcome.name} `), span(files, "path"), span(` ${message}`, "error")], {
|
|
483
|
+
wrap: "word",
|
|
484
|
+
role: "omp.cleanse.outcome",
|
|
485
|
+
tone: "error",
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
const meta: string[] = [];
|
|
489
|
+
const toolCount = agent?.progress?.toolCount ?? 0;
|
|
490
|
+
if (toolCount > 0) meta.push(`${toolCount} tool${toolCount === 1 ? "" : "s"}`);
|
|
491
|
+
if (total && total.tokens > 0) meta.push(`${formatNumber(total.tokens)} tok`);
|
|
492
|
+
if (agent) meta.push(formatDuration(Date.now() - agent.startedAt));
|
|
493
|
+
const spans = [span("✓ ", "success"), span(`${outcome.name} `), span(files, "path")];
|
|
494
|
+
if (meta.length > 0) spans.push(span(` · ${meta.join(" · ")}`, "dim"));
|
|
495
|
+
return text(spans, { wrap: "word", role: "omp.cleanse.outcome" });
|
|
496
|
+
}
|
|
497
|
+
|
|
280
498
|
function renderOutcomeLine(
|
|
281
499
|
outcome: CleanseAgentOutcome,
|
|
282
500
|
assignment: CleanseAssignment,
|
|
@@ -41,7 +41,15 @@ export async function pickCleanseTarget(checkers: readonly CleanseCheckerChoice[
|
|
|
41
41
|
description: "A discovery agent figures out the command to run",
|
|
42
42
|
},
|
|
43
43
|
];
|
|
44
|
-
const selection = await selectStandaloneItem("Select what to cleanse:", items, {
|
|
44
|
+
const selection = await selectStandaloneItem("Select what to cleanse:", items, {
|
|
45
|
+
maxVisible: 12,
|
|
46
|
+
picker: {
|
|
47
|
+
icon: "wand",
|
|
48
|
+
noun: "checkers",
|
|
49
|
+
subtitle: "Run the checkers, then repair what they find",
|
|
50
|
+
confirm: "Cleanse",
|
|
51
|
+
},
|
|
52
|
+
});
|
|
45
53
|
if (selection === null) return { kind: "cancel" };
|
|
46
54
|
if (selection === "all") return { kind: "all" };
|
|
47
55
|
if (selection === "request") {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { formatKeyHint, formatKeyHints } from "../../app-keybindings";
|
|
2
2
|
import type { Component } from "../../tui";
|
|
3
|
-
import {
|
|
3
|
+
import { matchesKey } from "../../keys";
|
|
4
|
+
import { Input } from "../../components/input";
|
|
4
5
|
import { routeSgrMouseInput, type SgrMouseEvent } from "../../mouse";
|
|
5
|
-
import { padding,
|
|
6
|
+
import { padding, truncateToWidth, visibleWidth } from "../../utils";
|
|
6
7
|
import { sanitizeText } from "@oh-my-pi/pi-utils";
|
|
7
8
|
import { theme } from "../../theme/theme";
|
|
8
9
|
import { sanitizeDisplayText } from "../../overlays/extensions/display-text";
|
|
@@ -503,6 +504,8 @@ interface DebugLogViewerComponentOptions {
|
|
|
503
504
|
/** Interactive log viewer with host-provided storage and clipboard capabilities. */
|
|
504
505
|
export class DebugLogViewerComponent implements Component {
|
|
505
506
|
#model: DebugLogViewerModel;
|
|
507
|
+
/** Filter field; its value is pushed into the model whenever it changes. */
|
|
508
|
+
readonly #filter = new Input();
|
|
506
509
|
#terminalRows: number;
|
|
507
510
|
#onExit: () => void;
|
|
508
511
|
#onStatus?: (message: string) => void;
|
|
@@ -522,6 +525,7 @@ export class DebugLogViewerComponent implements Component {
|
|
|
522
525
|
hasOlderLogs: this.#deps.hasOlderLogs?.bind(this.#deps),
|
|
523
526
|
loadOlderLogs: this.#deps.loadOlderLogs?.bind(this.#deps),
|
|
524
527
|
});
|
|
528
|
+
this.#filter.prompt = "";
|
|
525
529
|
this.#terminalRows = options.terminalRows;
|
|
526
530
|
this.#onExit = options.onExit;
|
|
527
531
|
this.#onStatus = options.onStatus;
|
|
@@ -618,18 +622,13 @@ export class DebugLogViewerComponent implements Component {
|
|
|
618
622
|
return;
|
|
619
623
|
}
|
|
620
624
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
return;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
const printableText = extractPrintableText(keyData);
|
|
630
|
-
if (printableText) {
|
|
625
|
+
// Everything else edits the filter field; refilter only when the text changed.
|
|
626
|
+
const before = this.#filter.getValue();
|
|
627
|
+
this.#filter.handleInput(keyData);
|
|
628
|
+
const after = this.#filter.getValue();
|
|
629
|
+
if (after !== before) {
|
|
631
630
|
this.#statusMessage = undefined;
|
|
632
|
-
this.#model.setFilterQuery(
|
|
631
|
+
this.#model.setFilterQuery(after);
|
|
633
632
|
}
|
|
634
633
|
}
|
|
635
634
|
|
|
@@ -720,8 +719,9 @@ export class DebugLogViewerComponent implements Component {
|
|
|
720
719
|
}
|
|
721
720
|
|
|
722
721
|
#filterText(): string {
|
|
723
|
-
const
|
|
724
|
-
const
|
|
722
|
+
const value = this.#filter.getValue();
|
|
723
|
+
const [field = ""] = this.#filter.render(visibleWidth(value) + 1);
|
|
724
|
+
const query = value.length === 0 ? field + theme.fg("muted", "type to filter") : theme.fg("accent", field);
|
|
725
725
|
const pidStatus = this.#model.isProcessFilterEnabled()
|
|
726
726
|
? theme.fg("success", "pid on")
|
|
727
727
|
: theme.fg("muted", "pid off");
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* so the graphics test needs no asset on disk and works across all three image
|
|
14
14
|
* protocols, each of which decodes a standard PNG.
|
|
15
15
|
*/
|
|
16
|
+
import { hsvToRgb } from "@oh-my-pi/pi-utils/color";
|
|
16
17
|
import * as zlib from "node:zlib";
|
|
17
18
|
import { type Component, Container } from "../../tui";
|
|
18
19
|
import { encodeTextSized, type TextSizingScale } from "../../utils";
|
|
@@ -110,30 +111,11 @@ export function buildLargeTextLines(scales: readonly TextSizingScale[] = [2, 3])
|
|
|
110
111
|
return lines;
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
/** HSV (h in degrees, s/v in 0..1) to 8-bit RGB, for the truecolor demo bar. */
|
|
114
|
-
function hsvToRgb(h: number, s: number, v: number): [number, number, number] {
|
|
115
|
-
const c = v * s;
|
|
116
|
-
const hp = (((h % 360) + 360) % 360) / 60;
|
|
117
|
-
const x = c * (1 - Math.abs((hp % 2) - 1));
|
|
118
|
-
let r = 0;
|
|
119
|
-
let g = 0;
|
|
120
|
-
let b = 0;
|
|
121
|
-
if (hp < 1) [r, g, b] = [c, x, 0];
|
|
122
|
-
else if (hp < 2) [r, g, b] = [x, c, 0];
|
|
123
|
-
else if (hp < 3) [r, g, b] = [0, c, x];
|
|
124
|
-
else if (hp < 4) [r, g, b] = [0, x, c];
|
|
125
|
-
else if (hp < 5) [r, g, b] = [x, 0, c];
|
|
126
|
-
else [r, g, b] = [c, 0, x];
|
|
127
|
-
const m = v - c;
|
|
128
|
-
const to8 = (n: number) => Math.round((n + m) * 255);
|
|
129
|
-
return [to8(r), to8(g), to8(b)];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
114
|
/** A 24-bit-color hue sweep rendered as background-painted cells (one space each). */
|
|
133
115
|
function truecolorBar(cells: number): string {
|
|
134
116
|
let out = "";
|
|
135
117
|
for (let i = 0; i < cells; i++) {
|
|
136
|
-
const
|
|
118
|
+
const { r, g, b } = hsvToRgb({ h: (i / cells) * 360, s: 0.85, v: 1 });
|
|
137
119
|
out += `\x1b[48;2;${r};${g};${b}m `;
|
|
138
120
|
}
|
|
139
121
|
return `${out}\x1b[0m`;
|
package/src/apps/git/avatar.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { hslToHex } from "@oh-my-pi/pi-utils/color";
|
|
2
|
+
|
|
1
3
|
/** Cached author photos supplied by the command host. */
|
|
2
4
|
export interface AvatarSource {
|
|
3
5
|
get(email: string, cwd: string): string | null | undefined;
|
|
@@ -28,25 +30,3 @@ export function identiconLines(email: string, colorize: (hex: string, text: stri
|
|
|
28
30
|
}
|
|
29
31
|
return lines;
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
function hslToHex(hue: number, saturation: number, lightness: number): string {
|
|
33
|
-
const chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
34
|
-
const second = chroma * (1 - Math.abs(((hue / 60) % 2) - 1));
|
|
35
|
-
const base = lightness - chroma / 2;
|
|
36
|
-
const sector = Math.floor(hue / 60) % 6;
|
|
37
|
-
const rgb = [
|
|
38
|
-
[chroma, second, 0],
|
|
39
|
-
[second, chroma, 0],
|
|
40
|
-
[0, chroma, second],
|
|
41
|
-
[0, second, chroma],
|
|
42
|
-
[second, 0, chroma],
|
|
43
|
-
[chroma, 0, second],
|
|
44
|
-
][sector];
|
|
45
|
-
return `#${rgb
|
|
46
|
-
.map(channel =>
|
|
47
|
-
Math.round((channel + base) * 255)
|
|
48
|
-
.toString(16)
|
|
49
|
-
.padStart(2, "0"),
|
|
50
|
-
)
|
|
51
|
-
.join("")}`;
|
|
52
|
-
}
|