@oh-my-pi/pi-tui 18.4.3 → 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 +36 -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/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 +37 -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/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 +7 -0
- 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 +7 -0
- package/dist/types/setup/scenes/splash.d.ts +8 -0
- package/dist/types/setup/scenes/types.d.ts +6 -1
- 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/terminal-capabilities.d.ts +1 -1
- package/dist/types/terminal.d.ts +27 -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.d.ts +8 -0
- 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 +346 -11
- 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/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 +37 -0
- 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 +216 -27
- 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 +21 -0
- 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/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 +175 -1
- 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 +583 -23
- 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 +122 -13
- package/src/setup/scenes/splash.ts +28 -1
- package/src/setup/scenes/theme.ts +88 -3
- package/src/setup/scenes/types.ts +7 -1
- package/src/setup/startup-splash.ts +46 -9
- package/src/setup/wizard-overlay.ts +140 -23
- package/src/status-line/component.ts +398 -16
- 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/terminal-capabilities.ts +7 -0
- package/src/terminal.ts +130 -2
- 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/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/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 +180 -49
- 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 +247 -2
- 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/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.ts +113 -1
- package/src/tools/write.ts +144 -5
- package/src/tools/xdev.ts +64 -1
- package/src/tui.ts +294 -3
|
@@ -8,6 +8,18 @@ import { OverlayPanel } from "../chrome/overlay-box";
|
|
|
8
8
|
import { TextFormField } from "../components/form";
|
|
9
9
|
import { formatKeyHint, keyHintPlatform } from "../app-keybindings";
|
|
10
10
|
import { editorKey } from "../chrome/keybinding-hints";
|
|
11
|
+
import { col, keyed, node, span, text } from "../native/describe";
|
|
12
|
+
import type { NativeChild, NativeNode, NativeUiEvent } from "../native/node";
|
|
13
|
+
import { actionBar, actionButton } from "../native/overlay";
|
|
14
|
+
import { plainText } from "../native/spans";
|
|
15
|
+
|
|
16
|
+
/** `Enter code: ABCD-1234` style device-flow instructions: the lead-in and the code. */
|
|
17
|
+
const DEVICE_CODE_INSTRUCTIONS = /^(.*\bcode:?\s+)([A-Za-z0-9][A-Za-z0-9-]{3,})\s*$/s;
|
|
18
|
+
|
|
19
|
+
/** One native step after the sign-in link: a text answer (live or given) or a progress message. */
|
|
20
|
+
type LoginStep =
|
|
21
|
+
| { kind: "input"; message: string; placeholder?: string; paste: boolean; field: TextFormField; answer?: string }
|
|
22
|
+
| { kind: "progress"; message: string };
|
|
11
23
|
|
|
12
24
|
/**
|
|
13
25
|
* Login dialog component - replaces editor during OAuth login flow
|
|
@@ -22,6 +34,12 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
22
34
|
#inputResolver?: (value: string) => void;
|
|
23
35
|
#inputRejecter?: (error: Error) => void;
|
|
24
36
|
#inputAbortCleanup?: () => void;
|
|
37
|
+
readonly #providerName: string;
|
|
38
|
+
/** The sign-in link from `showAuth` (native step 1 and the device code). */
|
|
39
|
+
#nativeAuth: { url: string; launchUrl?: string; instructions?: string } | undefined;
|
|
40
|
+
/** Native steps after the link, in arrival order; the live input field is embedded by identity. */
|
|
41
|
+
#nativeSteps: LoginStep[] = [];
|
|
42
|
+
#nativeRoot: NativeNode | undefined;
|
|
25
43
|
|
|
26
44
|
constructor(
|
|
27
45
|
tui: TUI,
|
|
@@ -31,7 +49,8 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
31
49
|
) {
|
|
32
50
|
const providerInfo = getOAuthProviders().find(p => p.id === providerId);
|
|
33
51
|
const providerName = providerInfo?.name || providerId;
|
|
34
|
-
super(`Login to ${providerName}
|
|
52
|
+
super(`Login to ${providerName}`, "omp.overlay.login");
|
|
53
|
+
this.#providerName = providerName;
|
|
35
54
|
this.#tui = tui;
|
|
36
55
|
this.#onComplete = onComplete;
|
|
37
56
|
this.#openUrl = openUrl;
|
|
@@ -115,6 +134,14 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
115
134
|
this.#contentContainer.addChild(new Text(theme.fg("warning", instructions), 0, 0));
|
|
116
135
|
}
|
|
117
136
|
|
|
137
|
+
this.#nativeAuth = {
|
|
138
|
+
url,
|
|
139
|
+
launchUrl: launchUrl && launchUrl !== url ? launchUrl : undefined,
|
|
140
|
+
instructions: instructions ? plainText(instructions) : undefined,
|
|
141
|
+
};
|
|
142
|
+
this.#nativeSteps = [];
|
|
143
|
+
this.#nativeRoot = undefined;
|
|
144
|
+
|
|
118
145
|
// Open browser (best-effort)
|
|
119
146
|
this.#openUrl(url);
|
|
120
147
|
|
|
@@ -127,10 +154,14 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
127
154
|
showManualInput(prompt: string, signal?: AbortSignal): Promise<string> {
|
|
128
155
|
// Keep retry chrome in place, but discard prior prompt undo/kill history.
|
|
129
156
|
const mounted = this.#contentContainer.children.indexOf(this.#input);
|
|
157
|
+
const previousInput = this.#input;
|
|
130
158
|
this.#input = this.#createInput();
|
|
159
|
+
const nativeMounted = this.#nativeSteps.find(step => step.kind === "input" && step.field === previousInput);
|
|
131
160
|
if (mounted !== -1) {
|
|
132
161
|
this.#contentContainer.children.splice(mounted, 1, this.#input);
|
|
162
|
+
if (nativeMounted?.kind === "input") nativeMounted.field = this.#input;
|
|
133
163
|
} else {
|
|
164
|
+
this.#nativeSteps.push({ kind: "input", message: plainText(prompt), paste: true, field: this.#input });
|
|
134
165
|
this.#contentContainer.addChild(new Spacer(1));
|
|
135
166
|
this.#contentContainer.addChild(new Text(theme.fg("dim", prompt), 0, 0));
|
|
136
167
|
this.#contentContainer.addChild(this.#input);
|
|
@@ -138,6 +169,7 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
138
169
|
new Text(theme.fg("dim", `(${editorKey("tui.select.cancel")} to cancel)`), 0, 0),
|
|
139
170
|
);
|
|
140
171
|
}
|
|
172
|
+
this.#nativeRoot = undefined;
|
|
141
173
|
this.#tui.requestRender();
|
|
142
174
|
|
|
143
175
|
if (signal?.aborted) {
|
|
@@ -170,6 +202,8 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
170
202
|
const answer = new Text(theme.fg("dim", `${this.#input.input.prompt}${value}`), 0, 0);
|
|
171
203
|
this.#contentContainer.removeChild(this.#input);
|
|
172
204
|
this.#contentContainer.children.splice(mounted, 0, answer);
|
|
205
|
+
const answered = this.#nativeSteps.find(step => step.kind === "input" && step.field === this.#input);
|
|
206
|
+
if (answered?.kind === "input") answered.answer = `${plainText(this.#input.input.prompt)}${value}`;
|
|
173
207
|
}
|
|
174
208
|
// A new prompt must not recover a previous secret through undo or yank.
|
|
175
209
|
this.#input = this.#createInput(prompt.secret === true);
|
|
@@ -189,6 +223,14 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
189
223
|
0,
|
|
190
224
|
),
|
|
191
225
|
);
|
|
226
|
+
this.#nativeSteps.push({
|
|
227
|
+
kind: "input",
|
|
228
|
+
message: plainText(prompt.message),
|
|
229
|
+
placeholder: prompt.placeholder ? plainText(prompt.placeholder) : undefined,
|
|
230
|
+
paste: false,
|
|
231
|
+
field: this.#input,
|
|
232
|
+
});
|
|
233
|
+
this.#nativeRoot = undefined;
|
|
192
234
|
|
|
193
235
|
this.#tui.requestRender();
|
|
194
236
|
|
|
@@ -214,6 +256,8 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
214
256
|
this.#contentContainer.addChild(new Spacer(1));
|
|
215
257
|
this.#contentContainer.addChild(new Text(theme.fg("dim", message), 0, 0));
|
|
216
258
|
this.#contentContainer.addChild(new Text(theme.fg("dim", `(${editorKey("tui.select.cancel")} to cancel)`), 0, 0));
|
|
259
|
+
this.#nativeSteps.push({ kind: "progress", message: plainText(message) });
|
|
260
|
+
this.#nativeRoot = undefined;
|
|
217
261
|
this.#tui.requestRender();
|
|
218
262
|
}
|
|
219
263
|
|
|
@@ -222,9 +266,147 @@ export class LoginDialogComponent extends OverlayPanel {
|
|
|
222
266
|
*/
|
|
223
267
|
showProgress(message: string): void {
|
|
224
268
|
this.#contentContainer.addChild(new Text(theme.fg("dim", message), 0, 0));
|
|
269
|
+
this.#nativeSteps.push({ kind: "progress", message: plainText(message) });
|
|
270
|
+
this.#nativeRoot = undefined;
|
|
225
271
|
this.#tui.requestRender();
|
|
226
272
|
}
|
|
227
273
|
|
|
274
|
+
/**
|
|
275
|
+
* A glass sheet over the composer (the dialog replaces the editor in the
|
|
276
|
+
* dock; the `overlay` hoists into the terminal's layer): numbered steps —
|
|
277
|
+
* open or copy the sign-in link, the device code, the live wait, the paste
|
|
278
|
+
* field — and Cancel.
|
|
279
|
+
*/
|
|
280
|
+
override describe(): NativeNode {
|
|
281
|
+
if (this.#nativeRoot) return this.#nativeRoot;
|
|
282
|
+
const steps: NativeChild[] = [];
|
|
283
|
+
const auth = this.#nativeAuth;
|
|
284
|
+
if (auth) {
|
|
285
|
+
steps.push(this.#describeLinkStep(auth.url, auth.launchUrl));
|
|
286
|
+
if (auth.instructions) steps.push(this.#describeInstructionsStep(auth.instructions));
|
|
287
|
+
}
|
|
288
|
+
const live = this.#nativeSteps.findLastIndex(step => step.kind === "progress");
|
|
289
|
+
// Progress messages share one step: settled ones dim, the latest one the live spinner.
|
|
290
|
+
let progress: NativeChild[] | undefined;
|
|
291
|
+
for (const [index, step] of this.#nativeSteps.entries()) {
|
|
292
|
+
if (step.kind === "progress") {
|
|
293
|
+
const line =
|
|
294
|
+
index === live
|
|
295
|
+
? node("row", { role: "omp.login.waiting", gap: "sm", align: "center" }, [
|
|
296
|
+
node("spinner", { label: step.message, tone: "muted" }),
|
|
297
|
+
])
|
|
298
|
+
: text([span(step.message, "dim")], { wrap: "word" });
|
|
299
|
+
if (progress) {
|
|
300
|
+
progress.push(line);
|
|
301
|
+
} else {
|
|
302
|
+
progress = [line];
|
|
303
|
+
steps.push(node("col", { role: "omp.login.step", gap: "xs" }, progress, `p${index}`));
|
|
304
|
+
}
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (step.answer !== undefined) {
|
|
308
|
+
steps.push(keyed(text([span(step.answer, "dim")]), `a${index}`));
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
const children: NativeChild[] = [text(step.message, { wrap: "word" })];
|
|
312
|
+
if (step.placeholder) children.push(text([span(`e.g., ${step.placeholder}`, "dim")]));
|
|
313
|
+
children.push(node("col", { role: "omp.login.paste" }, [step.field], "field"));
|
|
314
|
+
steps.push(node("col", { role: "omp.login.step", gap: "xs" }, children, `i${index}`));
|
|
315
|
+
}
|
|
316
|
+
const cancelKey = getKeybindings().getKeys("tui.select.cancel")[0];
|
|
317
|
+
const buttons: (NativeNode | null)[] = [
|
|
318
|
+
null,
|
|
319
|
+
actionButton("Cancel", "cancel", cancelKey ? { keys: cancelKey } : {}),
|
|
320
|
+
];
|
|
321
|
+
if (this.#activeField()) {
|
|
322
|
+
const submitKey = getKeybindings().getKeys("tui.input.submit")[0];
|
|
323
|
+
buttons.push(
|
|
324
|
+
actionButton("Continue", "submit", { tone: "accent", ...(submitKey ? { keys: submitKey } : {}) }),
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
const sheet = node(
|
|
328
|
+
"overlay",
|
|
329
|
+
{
|
|
330
|
+
role: this.nativeRole,
|
|
331
|
+
head: `Sign in to ${this.#providerName}`,
|
|
332
|
+
anchor: "center",
|
|
333
|
+
size: "md",
|
|
334
|
+
modal: true,
|
|
335
|
+
},
|
|
336
|
+
[
|
|
337
|
+
col([node("col", { role: "omp.login.steps", gap: "md" }, steps, "steps"), actionBar(buttons)], {
|
|
338
|
+
gap: "lg",
|
|
339
|
+
}),
|
|
340
|
+
],
|
|
341
|
+
"sheet",
|
|
342
|
+
);
|
|
343
|
+
this.#nativeRoot = col([sheet]);
|
|
344
|
+
return this.#nativeRoot;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/** Step 1: open the sign-in page (Tern opens the link) or copy it; the full URL beneath on one mono line. */
|
|
348
|
+
#describeLinkStep(url: string, launchUrl: string | undefined): NativeNode {
|
|
349
|
+
const children: NativeChild[] = [
|
|
350
|
+
actionBar(
|
|
351
|
+
[
|
|
352
|
+
actionButton("Open sign-in page ↗", "open", { href: url, key: "openLink", title: url }),
|
|
353
|
+
actionButton("Copy link", "copy", { href: url, key: "copyLink", title: "Copy the sign-in link" }),
|
|
354
|
+
],
|
|
355
|
+
"links",
|
|
356
|
+
),
|
|
357
|
+
text([span(url, "dim mono", { href: url })], {
|
|
358
|
+
role: "omp.login.url",
|
|
359
|
+
truncate: "middle",
|
|
360
|
+
lines: 1,
|
|
361
|
+
title: url,
|
|
362
|
+
}),
|
|
363
|
+
];
|
|
364
|
+
if (launchUrl) {
|
|
365
|
+
children.push(
|
|
366
|
+
text(
|
|
367
|
+
[span("Local shortcut (this machine only): ", "dim"), span(launchUrl, "dim link", { href: launchUrl })],
|
|
368
|
+
{
|
|
369
|
+
truncate: "middle",
|
|
370
|
+
lines: 1,
|
|
371
|
+
},
|
|
372
|
+
),
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
return node("col", { role: "omp.login.step", gap: "sm" }, children, "link");
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/** Step 2: a device code large and click-to-copy, or the provider's instructions as they came. */
|
|
379
|
+
#describeInstructionsStep(instructions: string): NativeNode {
|
|
380
|
+
const device = DEVICE_CODE_INSTRUCTIONS.exec(instructions);
|
|
381
|
+
const children: NativeChild[] = device
|
|
382
|
+
? [
|
|
383
|
+
text(device[1]!.trimEnd()),
|
|
384
|
+
text([span(device[2]!, "mono")], {
|
|
385
|
+
role: "omp.login.code",
|
|
386
|
+
actions: { click: "copy" },
|
|
387
|
+
title: "Copy code",
|
|
388
|
+
}),
|
|
389
|
+
]
|
|
390
|
+
: [text([span(instructions, "warning")], { wrap: "word" })];
|
|
391
|
+
return node("col", { role: "omp.login.step", gap: "sm" }, children, "code");
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/** The input field still waiting for an answer, if any. */
|
|
395
|
+
#activeField(): TextFormField | undefined {
|
|
396
|
+
for (let i = this.#nativeSteps.length - 1; i >= 0; i--) {
|
|
397
|
+
const step = this.#nativeSteps[i]!;
|
|
398
|
+
if (step.kind === "input" && step.answer === undefined && step.field === this.#input) return step.field;
|
|
399
|
+
}
|
|
400
|
+
return undefined;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/** Cancel and Continue run what Esc and Enter run. */
|
|
404
|
+
handleNativeEvent(event: NativeUiEvent): void {
|
|
405
|
+
if (event.type !== "action") return;
|
|
406
|
+
if (event.act === "cancel") this.#cancel();
|
|
407
|
+
else if (event.act === "submit") this.#activeField()?.submit();
|
|
408
|
+
}
|
|
409
|
+
|
|
228
410
|
/** Route non-bracketed paste transports into the active login input. */
|
|
229
411
|
pasteText(text: string): void {
|
|
230
412
|
this.#input.pasteText(text);
|
|
@@ -6,6 +6,11 @@ import { MenuSelection } from "../components/menu-selection";
|
|
|
6
6
|
import { centeredViewportRange } from "../components/scroll-viewport";
|
|
7
7
|
import { formatKeyHint } from "../app-keybindings";
|
|
8
8
|
import { editorKey, editorKeys } from "../chrome/keybinding-hints";
|
|
9
|
+
import { node, span } from "../native/describe";
|
|
10
|
+
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node";
|
|
11
|
+
import { CLOSE_ACTION, dockedPicker, PICKER_KEY, pickerAction, pickerEvent } from "../native/picker";
|
|
12
|
+
import type { TspPickerItem } from "@oh-my-pi/pi-wire";
|
|
13
|
+
import { actionHint, hintsRow, overlayCard } from "../native/overlay";
|
|
9
14
|
|
|
10
15
|
const LOGOUT_SELECTOR_MAX_VISIBLE = 10;
|
|
11
16
|
|
|
@@ -24,6 +29,13 @@ export class LogoutAccountSelectorComponent extends OverlayPanel {
|
|
|
24
29
|
#menu: MenuSelection<LogoutAccount>;
|
|
25
30
|
#onSelectCallback: (account: LogoutAccount) => void;
|
|
26
31
|
#onCancelCallback: () => void;
|
|
32
|
+
#nativeItems: readonly NativeNode[] | undefined;
|
|
33
|
+
#nativeHints: NativeNode | undefined;
|
|
34
|
+
#nativeRoot: NativeNode | undefined;
|
|
35
|
+
#pickerRoot: NativeNode | undefined;
|
|
36
|
+
#pickerItems: readonly TspPickerItem[] | undefined;
|
|
37
|
+
readonly #providerName: string;
|
|
38
|
+
readonly #accounts: readonly LogoutAccount[];
|
|
27
39
|
|
|
28
40
|
constructor(
|
|
29
41
|
providerName: string,
|
|
@@ -31,9 +43,11 @@ export class LogoutAccountSelectorComponent extends OverlayPanel {
|
|
|
31
43
|
onSelect: (account: LogoutAccount) => void,
|
|
32
44
|
onCancel: () => void,
|
|
33
45
|
) {
|
|
34
|
-
super(`Select ${providerName} account to log out
|
|
46
|
+
super(`Select ${providerName} account to log out`, "omp.overlay.logout");
|
|
35
47
|
this.#onSelectCallback = onSelect;
|
|
36
48
|
this.#onCancelCallback = onCancel;
|
|
49
|
+
this.#providerName = providerName;
|
|
50
|
+
this.#accounts = accounts;
|
|
37
51
|
const active = accounts.find(account => account.active);
|
|
38
52
|
this.#menu = new MenuSelection<LogoutAccount>(
|
|
39
53
|
accounts,
|
|
@@ -50,6 +64,8 @@ export class LogoutAccountSelectorComponent extends OverlayPanel {
|
|
|
50
64
|
}
|
|
51
65
|
|
|
52
66
|
#updateList(): void {
|
|
67
|
+
this.#nativeRoot = undefined;
|
|
68
|
+
this.#pickerRoot = undefined;
|
|
53
69
|
this.#listContainer.clear();
|
|
54
70
|
|
|
55
71
|
const items = this.#menu.visibleItems;
|
|
@@ -116,9 +132,91 @@ export class LogoutAccountSelectorComponent extends OverlayPanel {
|
|
|
116
132
|
this.#menu.move(LOGOUT_SELECTOR_MAX_VISIBLE, false);
|
|
117
133
|
this.#updateList();
|
|
118
134
|
} else if (matchesKey(keyData, "enter") || matchesKey(keyData, "return") || keyData === "\n") {
|
|
119
|
-
|
|
120
|
-
if (!account) return;
|
|
121
|
-
this.#onSelectCallback(account);
|
|
135
|
+
this.#confirmSelection();
|
|
122
136
|
}
|
|
123
137
|
}
|
|
138
|
+
|
|
139
|
+
#confirmSelection(): void {
|
|
140
|
+
const account = this.#menu.selectedItem;
|
|
141
|
+
if (!account) return;
|
|
142
|
+
this.#onSelectCallback(account);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
override describe(cx: DescribeContext): NativeNode {
|
|
146
|
+
if (cx.supports("picker")) {
|
|
147
|
+
this.#pickerRoot ??= dockedPicker({
|
|
148
|
+
title: `${this.#providerName} accounts`,
|
|
149
|
+
subtitle: "Pick the account to sign out",
|
|
150
|
+
icon: "key-round",
|
|
151
|
+
noun: "accounts",
|
|
152
|
+
size: "md",
|
|
153
|
+
layout: "cards",
|
|
154
|
+
preview: "none",
|
|
155
|
+
query: null,
|
|
156
|
+
items: (this.#pickerItems ??= this.#accounts.map(account => ({
|
|
157
|
+
id: String(account.credentialId),
|
|
158
|
+
label: account.label,
|
|
159
|
+
...(account.detail ? { detail: account.detail } : {}),
|
|
160
|
+
badges: [{ text: account.type === "oauth" ? "login" : "api key" }],
|
|
161
|
+
}))),
|
|
162
|
+
current: this.#accounts.filter(account => account.active).map(account => String(account.credentialId)),
|
|
163
|
+
selected: this.#menu.selectedKey ?? null,
|
|
164
|
+
empty: "No stored accounts to log out",
|
|
165
|
+
actions: [pickerAction("confirm", "Sign out", "enter", { primary: true, danger: true }), CLOSE_ACTION],
|
|
166
|
+
});
|
|
167
|
+
return this.#pickerRoot;
|
|
168
|
+
}
|
|
169
|
+
if (this.#nativeRoot) return this.#nativeRoot;
|
|
170
|
+
this.#nativeItems ??= this.#menu.visibleItems.map(account =>
|
|
171
|
+
node(
|
|
172
|
+
"item",
|
|
173
|
+
{
|
|
174
|
+
label: account.label,
|
|
175
|
+
detail: account.detail || undefined,
|
|
176
|
+
value: account.active ? [span("active", "muted")] : undefined,
|
|
177
|
+
},
|
|
178
|
+
undefined,
|
|
179
|
+
String(account.credentialId),
|
|
180
|
+
),
|
|
181
|
+
);
|
|
182
|
+
this.#nativeRoot = overlayCard(this.nativeRole, this.title, [
|
|
183
|
+
node(
|
|
184
|
+
"list",
|
|
185
|
+
{
|
|
186
|
+
selected: this.#menu.selectedKey ?? null,
|
|
187
|
+
empty: "No stored accounts to log out",
|
|
188
|
+
max: { lines: LOGOUT_SELECTOR_MAX_VISIBLE },
|
|
189
|
+
},
|
|
190
|
+
this.#nativeItems,
|
|
191
|
+
"list",
|
|
192
|
+
),
|
|
193
|
+
(this.#nativeHints ??= hintsRow([
|
|
194
|
+
actionHint(["tui.select.up", "tui.select.down"], "select"),
|
|
195
|
+
{ keys: ["enter"], label: "log out account" },
|
|
196
|
+
actionHint("tui.select.cancel", "cancel"),
|
|
197
|
+
])),
|
|
198
|
+
]);
|
|
199
|
+
return this.#nativeRoot;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** A click (or double-click) on an account highlights it and logs it out, like Enter. */
|
|
203
|
+
handleNativeEvent(event: NativeUiEvent): void {
|
|
204
|
+
const ev = pickerEvent(event, PICKER_KEY);
|
|
205
|
+
if (ev?.kind === "action") {
|
|
206
|
+
if (ev.act === "confirm") this.#confirmSelection();
|
|
207
|
+
else if (ev.act === "close" || ev.act === "cancel") this.#onCancelCallback();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (ev?.kind === "select") {
|
|
211
|
+
this.#menu.setSelectedKey(ev.item);
|
|
212
|
+
this.#updateList();
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if ((event.type !== "select" && event.type !== "activate") || (event.key !== "list" && ev?.kind !== "activate"))
|
|
216
|
+
return;
|
|
217
|
+
this.#menu.setSelectedKey(event.item);
|
|
218
|
+
if (this.#menu.selectedKey !== event.item) return;
|
|
219
|
+
this.#updateList();
|
|
220
|
+
this.#confirmSelection();
|
|
221
|
+
}
|
|
124
222
|
}
|