@pentoshi/clai 2.0.62 → 3.5.1
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/README.md +262 -368
- package/dist/agent/classic-renderer.js +9 -1
- package/dist/agent/classic-renderer.js.map +1 -1
- package/dist/agent/context-manager.d.ts +5 -0
- package/dist/agent/context-manager.js +14 -2
- package/dist/agent/context-manager.js.map +1 -1
- package/dist/agent/events.d.ts +9 -1
- package/dist/agent/plan-tool.js +80 -8
- package/dist/agent/plan-tool.js.map +1 -1
- package/dist/agent/runner.js +261 -122
- package/dist/agent/runner.js.map +1 -1
- package/dist/agent/tool-call-parser.d.ts +20 -0
- package/dist/agent/tool-call-parser.js +186 -2
- package/dist/agent/tool-call-parser.js.map +1 -1
- package/dist/app/adapters/agent-event-adapter.d.ts +29 -0
- package/dist/app/adapters/agent-event-adapter.js +148 -0
- package/dist/app/adapters/agent-event-adapter.js.map +1 -0
- package/dist/app/adapters/current-agent-adapter.d.ts +7 -0
- package/dist/app/adapters/current-agent-adapter.js +27 -0
- package/dist/app/adapters/current-agent-adapter.js.map +1 -0
- package/dist/app/adapters/current-jobs-adapter.d.ts +4 -0
- package/dist/app/adapters/current-jobs-adapter.js +13 -0
- package/dist/app/adapters/current-jobs-adapter.js.map +1 -0
- package/dist/app/adapters/current-store-adapter.d.ts +3 -0
- package/dist/app/adapters/current-store-adapter.js +22 -0
- package/dist/app/adapters/current-store-adapter.js.map +1 -0
- package/dist/app/adapters/current-terminal-adapter.d.ts +9 -0
- package/dist/app/adapters/current-terminal-adapter.js +31 -0
- package/dist/app/adapters/current-terminal-adapter.js.map +1 -0
- package/dist/app/adapters/current-updates-adapter.d.ts +7 -0
- package/dist/app/adapters/current-updates-adapter.js +31 -0
- package/dist/app/adapters/current-updates-adapter.js.map +1 -0
- package/dist/app/adapters/in-memory-clipboard-adapter.d.ts +10 -0
- package/dist/app/adapters/in-memory-clipboard-adapter.js +20 -0
- package/dist/app/adapters/in-memory-clipboard-adapter.js.map +1 -0
- package/dist/app/commands/command.d.ts +24 -0
- package/dist/app/commands/command.js +4 -0
- package/dist/app/commands/command.js.map +1 -0
- package/dist/app/commands/registry.d.ts +45 -0
- package/dist/app/commands/registry.js +164 -0
- package/dist/app/commands/registry.js.map +1 -0
- package/dist/app/controllers/disposable.d.ts +15 -0
- package/dist/app/controllers/disposable.js +38 -0
- package/dist/app/controllers/disposable.js.map +1 -0
- package/dist/app/controllers/job-controller.d.ts +22 -0
- package/dist/app/controllers/job-controller.js +35 -0
- package/dist/app/controllers/job-controller.js.map +1 -0
- package/dist/app/controllers/plan-controller.d.ts +31 -0
- package/dist/app/controllers/plan-controller.js +69 -0
- package/dist/app/controllers/plan-controller.js.map +1 -0
- package/dist/app/controllers/session-controller.d.ts +167 -0
- package/dist/app/controllers/session-controller.js +467 -0
- package/dist/app/controllers/session-controller.js.map +1 -0
- package/dist/app/controllers/turn-controller.d.ts +52 -0
- package/dist/app/controllers/turn-controller.js +118 -0
- package/dist/app/controllers/turn-controller.js.map +1 -0
- package/dist/app/events/app-event.d.ts +122 -0
- package/dist/app/events/app-event.js +25 -0
- package/dist/app/events/app-event.js.map +1 -0
- package/dist/app/events/event-buffer.d.ts +51 -0
- package/dist/app/events/event-buffer.js +109 -0
- package/dist/app/events/event-buffer.js.map +1 -0
- package/dist/app/events/sequencer.d.ts +32 -0
- package/dist/app/events/sequencer.js +55 -0
- package/dist/app/events/sequencer.js.map +1 -0
- package/dist/app/ports/agent-port.d.ts +29 -0
- package/dist/app/ports/agent-port.js +2 -0
- package/dist/app/ports/agent-port.js.map +1 -0
- package/dist/app/ports/clipboard-port.d.ts +9 -0
- package/dist/app/ports/clipboard-port.js +2 -0
- package/dist/app/ports/clipboard-port.js.map +1 -0
- package/dist/app/ports/confirm-port.d.ts +17 -0
- package/dist/app/ports/confirm-port.js +2 -0
- package/dist/app/ports/confirm-port.js.map +1 -0
- package/dist/app/ports/jobs-port.d.ts +18 -0
- package/dist/app/ports/jobs-port.js +2 -0
- package/dist/app/ports/jobs-port.js.map +1 -0
- package/dist/app/ports/persistence-port.d.ts +21 -0
- package/dist/app/ports/persistence-port.js +2 -0
- package/dist/app/ports/persistence-port.js.map +1 -0
- package/dist/app/ports/secret-port.d.ts +12 -0
- package/dist/app/ports/secret-port.js +2 -0
- package/dist/app/ports/secret-port.js.map +1 -0
- package/dist/app/ports/terminal-port.d.ts +18 -0
- package/dist/app/ports/terminal-port.js +2 -0
- package/dist/app/ports/terminal-port.js.map +1 -0
- package/dist/app/ports/updates-port.d.ts +12 -0
- package/dist/app/ports/updates-port.js +2 -0
- package/dist/app/ports/updates-port.js.map +1 -0
- package/dist/commands/doctor.js +19 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/update.js +1 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/index.js +47 -12
- package/dist/index.js.map +1 -1
- package/dist/llm/router.js +4 -2
- package/dist/llm/router.js.map +1 -1
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.js +11 -8
- package/dist/prompts/index.js.map +1 -1
- package/dist/repl/slash-commands.js +1 -1
- package/dist/repl/slash-commands.js.map +1 -1
- package/dist/repl.js +35 -107
- package/dist/repl.js.map +1 -1
- package/dist/store/config.js +3 -1
- package/dist/store/config.js.map +1 -1
- package/dist/store/history.d.ts +26 -2
- package/dist/store/history.js +383 -72
- package/dist/store/history.js.map +1 -1
- package/dist/store/logs.js +3 -3
- package/dist/store/logs.js.map +1 -1
- package/dist/store/paths.d.ts +6 -0
- package/dist/store/paths.js +38 -0
- package/dist/store/paths.js.map +1 -0
- package/dist/store/plan.js +8 -5
- package/dist/store/plan.js.map +1 -1
- package/dist/tools/fs.d.ts +6 -0
- package/dist/tools/fs.js +56 -6
- package/dist/tools/fs.js.map +1 -1
- package/dist/tools/jobs.js +2 -2
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/registry.js +189 -67
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/shell.js +2 -2
- package/dist/tools/shell.js.map +1 -1
- package/dist/tui/runtime.d.ts +19 -0
- package/dist/tui/runtime.js +92 -0
- package/dist/tui/runtime.js.map +1 -0
- package/dist/tui/state.js +22 -17
- package/dist/tui/state.js.map +1 -1
- package/dist/tui-v2/actions/action-id.d.ts +14 -0
- package/dist/tui-v2/actions/action-id.js +109 -0
- package/dist/tui-v2/actions/action-id.js.map +1 -0
- package/dist/tui-v2/actions/action-router.d.ts +18 -0
- package/dist/tui-v2/actions/action-router.js +62 -0
- package/dist/tui-v2/actions/action-router.js.map +1 -0
- package/dist/tui-v2/actions/chord-from-key.d.ts +26 -0
- package/dist/tui-v2/actions/chord-from-key.js +45 -0
- package/dist/tui-v2/actions/chord-from-key.js.map +1 -0
- package/dist/tui-v2/actions/keymap.d.ts +24 -0
- package/dist/tui-v2/actions/keymap.js +134 -0
- package/dist/tui-v2/actions/keymap.js.map +1 -0
- package/dist/tui-v2/app/App.d.ts +13 -0
- package/dist/tui-v2/app/App.js +332 -0
- package/dist/tui-v2/app/App.js.map +1 -0
- package/dist/tui-v2/app/command-handlers.d.ts +8 -0
- package/dist/tui-v2/app/command-handlers.js +66 -0
- package/dist/tui-v2/app/command-handlers.js.map +1 -0
- package/dist/tui-v2/app/commands/config-commands.d.ts +14 -0
- package/dist/tui-v2/app/commands/config-commands.js +161 -0
- package/dist/tui-v2/app/commands/config-commands.js.map +1 -0
- package/dist/tui-v2/app/commands/key-commands.d.ts +9 -0
- package/dist/tui-v2/app/commands/key-commands.js +263 -0
- package/dist/tui-v2/app/commands/key-commands.js.map +1 -0
- package/dist/tui-v2/app/commands/picker-commands.d.ts +24 -0
- package/dist/tui-v2/app/commands/picker-commands.js +423 -0
- package/dist/tui-v2/app/commands/picker-commands.js.map +1 -0
- package/dist/tui-v2/app/commands/session-commands.d.ts +19 -0
- package/dist/tui-v2/app/commands/session-commands.js +162 -0
- package/dist/tui-v2/app/commands/session-commands.js.map +1 -0
- package/dist/tui-v2/app/plan-lifecycle.d.ts +22 -0
- package/dist/tui-v2/app/plan-lifecycle.js +95 -0
- package/dist/tui-v2/app/plan-lifecycle.js.map +1 -0
- package/dist/tui-v2/app/providers.d.ts +17 -0
- package/dist/tui-v2/app/providers.js +32 -0
- package/dist/tui-v2/app/providers.js.map +1 -0
- package/dist/tui-v2/bootstrap/capabilities.d.ts +35 -0
- package/dist/tui-v2/bootstrap/capabilities.js +93 -0
- package/dist/tui-v2/bootstrap/capabilities.js.map +1 -0
- package/dist/tui-v2/bootstrap/composition-root.d.ts +85 -0
- package/dist/tui-v2/bootstrap/composition-root.js +131 -0
- package/dist/tui-v2/bootstrap/composition-root.js.map +1 -0
- package/dist/tui-v2/bootstrap/disable-native-selection.d.ts +11 -0
- package/dist/tui-v2/bootstrap/disable-native-selection.js +13 -0
- package/dist/tui-v2/bootstrap/disable-native-selection.js.map +1 -0
- package/dist/tui-v2/bootstrap/lifecycle.d.ts +62 -0
- package/dist/tui-v2/bootstrap/lifecycle.js +123 -0
- package/dist/tui-v2/bootstrap/lifecycle.js.map +1 -0
- package/dist/tui-v2/bootstrap/osc52-clipboard.d.ts +28 -0
- package/dist/tui-v2/bootstrap/osc52-clipboard.js +44 -0
- package/dist/tui-v2/bootstrap/osc52-clipboard.js.map +1 -0
- package/dist/tui-v2/bootstrap/overlay-ports.d.ts +12 -0
- package/dist/{tui/confirm.js → tui-v2/bootstrap/overlay-ports.js} +17 -25
- package/dist/tui-v2/bootstrap/overlay-ports.js.map +1 -0
- package/dist/tui-v2/bootstrap/pager-export.d.ts +24 -0
- package/dist/tui-v2/bootstrap/pager-export.js +87 -0
- package/dist/tui-v2/bootstrap/pager-export.js.map +1 -0
- package/dist/tui-v2/bootstrap/start-tui-v2.d.ts +15 -0
- package/dist/tui-v2/bootstrap/start-tui-v2.js +95 -0
- package/dist/tui-v2/bootstrap/start-tui-v2.js.map +1 -0
- package/dist/tui-v2/bootstrap/ui-selection.d.ts +30 -0
- package/dist/tui-v2/bootstrap/ui-selection.js +59 -0
- package/dist/tui-v2/bootstrap/ui-selection.js.map +1 -0
- package/dist/tui-v2/components/completion/completion-menu.d.ts +23 -0
- package/dist/tui-v2/components/completion/completion-menu.js +84 -0
- package/dist/tui-v2/components/completion/completion-menu.js.map +1 -0
- package/dist/tui-v2/components/jobs/jobs-panel.d.ts +16 -0
- package/dist/tui-v2/components/jobs/jobs-panel.js +92 -0
- package/dist/tui-v2/components/jobs/jobs-panel.js.map +1 -0
- package/dist/tui-v2/components/modal/confirm-modal.d.ts +20 -0
- package/dist/tui-v2/components/modal/confirm-modal.js +110 -0
- package/dist/tui-v2/components/modal/confirm-modal.js.map +1 -0
- package/dist/tui-v2/components/modal/prompt-actions-modal.d.ts +15 -0
- package/dist/tui-v2/components/modal/prompt-actions-modal.js +80 -0
- package/dist/tui-v2/components/modal/prompt-actions-modal.js.map +1 -0
- package/dist/tui-v2/components/modal/secret-modal.d.ts +18 -0
- package/dist/tui-v2/components/modal/secret-modal.js +50 -0
- package/dist/tui-v2/components/modal/secret-modal.js.map +1 -0
- package/dist/tui-v2/components/overlay/overlay-host.d.ts +26 -0
- package/dist/tui-v2/components/overlay/overlay-host.js +43 -0
- package/dist/tui-v2/components/overlay/overlay-host.js.map +1 -0
- package/dist/tui-v2/components/pager/pager.d.ts +20 -0
- package/dist/tui-v2/components/pager/pager.js +396 -0
- package/dist/tui-v2/components/pager/pager.js.map +1 -0
- package/dist/tui-v2/components/picker/picker.d.ts +17 -0
- package/dist/tui-v2/components/picker/picker.js +222 -0
- package/dist/tui-v2/components/picker/picker.js.map +1 -0
- package/dist/tui-v2/components/plan/plan-view.d.ts +20 -0
- package/dist/tui-v2/components/plan/plan-view.js +120 -0
- package/dist/tui-v2/components/plan/plan-view.js.map +1 -0
- package/dist/tui-v2/components/queue/queue-panel.d.ts +23 -0
- package/dist/tui-v2/components/queue/queue-panel.js +58 -0
- package/dist/tui-v2/components/queue/queue-panel.js.map +1 -0
- package/dist/tui-v2/components/status/status-line.d.ts +27 -0
- package/dist/tui-v2/components/status/status-line.js +167 -0
- package/dist/tui-v2/components/status/status-line.js.map +1 -0
- package/dist/tui-v2/components/toast/toast-host.d.ts +15 -0
- package/dist/tui-v2/components/toast/toast-host.js +48 -0
- package/dist/tui-v2/components/toast/toast-host.js.map +1 -0
- package/dist/tui-v2/components/transcript/assistant-message.d.ts +20 -0
- package/dist/tui-v2/components/transcript/assistant-message.js +41 -0
- package/dist/tui-v2/components/transcript/assistant-message.js.map +1 -0
- package/dist/tui-v2/components/transcript/compacted-row.d.ts +19 -0
- package/dist/tui-v2/components/transcript/compacted-row.js +69 -0
- package/dist/tui-v2/components/transcript/compacted-row.js.map +1 -0
- package/dist/tui-v2/components/transcript/intro-card.d.ts +19 -0
- package/dist/tui-v2/components/transcript/intro-card.js +50 -0
- package/dist/tui-v2/components/transcript/intro-card.js.map +1 -0
- package/dist/tui-v2/components/transcript/linkable-text.d.ts +21 -0
- package/dist/tui-v2/components/transcript/linkable-text.js +46 -0
- package/dist/tui-v2/components/transcript/linkable-text.js.map +1 -0
- package/dist/tui-v2/components/transcript/notice-row.d.ts +14 -0
- package/dist/tui-v2/components/transcript/notice-row.js +40 -0
- package/dist/tui-v2/components/transcript/notice-row.js.map +1 -0
- package/dist/tui-v2/components/transcript/search-bar.d.ts +19 -0
- package/dist/tui-v2/components/transcript/search-bar.js +7 -0
- package/dist/tui-v2/components/transcript/search-bar.js.map +1 -0
- package/dist/tui-v2/components/transcript/thinking-block.d.ts +22 -0
- package/dist/tui-v2/components/transcript/thinking-block.js +27 -0
- package/dist/tui-v2/components/transcript/thinking-block.js.map +1 -0
- package/dist/tui-v2/components/transcript/tool-card.d.ts +26 -0
- package/dist/tui-v2/components/transcript/tool-card.js +205 -0
- package/dist/tui-v2/components/transcript/tool-card.js.map +1 -0
- package/dist/tui-v2/components/transcript/transcript-row.d.ts +25 -0
- package/dist/tui-v2/components/transcript/transcript-row.js +37 -0
- package/dist/tui-v2/components/transcript/transcript-row.js.map +1 -0
- package/dist/tui-v2/components/transcript/transcript-scroll-port.d.ts +52 -0
- package/dist/tui-v2/components/transcript/transcript-scroll-port.js +86 -0
- package/dist/tui-v2/components/transcript/transcript-scroll-port.js.map +1 -0
- package/dist/tui-v2/components/transcript/transcript-view.d.ts +24 -0
- package/dist/tui-v2/components/transcript/transcript-view.js +403 -0
- package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -0
- package/dist/tui-v2/components/transcript/use-click-without-drag.d.ts +13 -0
- package/dist/tui-v2/components/transcript/use-click-without-drag.js +35 -0
- package/dist/tui-v2/components/transcript/use-click-without-drag.js.map +1 -0
- package/dist/tui-v2/components/transcript/use-native-selection-copy.d.ts +10 -0
- package/dist/tui-v2/components/transcript/use-native-selection-copy.js +37 -0
- package/dist/tui-v2/components/transcript/use-native-selection-copy.js.map +1 -0
- package/dist/tui-v2/components/transcript/use-transcript-selection.d.ts +23 -0
- package/dist/tui-v2/components/transcript/use-transcript-selection.js +136 -0
- package/dist/tui-v2/components/transcript/use-transcript-selection.js.map +1 -0
- package/dist/tui-v2/components/transcript/user-message.d.ts +10 -0
- package/dist/tui-v2/components/transcript/user-message.js +23 -0
- package/dist/tui-v2/components/transcript/user-message.js.map +1 -0
- package/dist/tui-v2/composer/arrow-intent.d.ts +23 -0
- package/dist/tui-v2/composer/arrow-intent.js +35 -0
- package/dist/tui-v2/composer/arrow-intent.js.map +1 -0
- package/dist/tui-v2/composer/completion.d.ts +37 -0
- package/dist/tui-v2/composer/completion.js +67 -0
- package/dist/tui-v2/composer/completion.js.map +1 -0
- package/dist/tui-v2/composer/composer-editor.d.ts +33 -0
- package/dist/tui-v2/composer/composer-editor.js +620 -0
- package/dist/tui-v2/composer/composer-editor.js.map +1 -0
- package/dist/tui-v2/composer/composer-height.d.ts +21 -0
- package/dist/tui-v2/composer/composer-height.js +29 -0
- package/dist/tui-v2/composer/composer-height.js.map +1 -0
- package/dist/tui-v2/composer/composer-meta.d.ts +9 -0
- package/dist/tui-v2/composer/composer-meta.js +38 -0
- package/dist/tui-v2/composer/composer-meta.js.map +1 -0
- package/dist/tui-v2/composer/history-nav.d.ts +15 -0
- package/dist/tui-v2/composer/history-nav.js +16 -0
- package/dist/tui-v2/composer/history-nav.js.map +1 -0
- package/dist/tui-v2/composer/newline-hint.d.ts +13 -0
- package/dist/tui-v2/composer/newline-hint.js +13 -0
- package/dist/tui-v2/composer/newline-hint.js.map +1 -0
- package/dist/tui-v2/composer/paste-placeholder.d.ts +35 -0
- package/dist/tui-v2/composer/paste-placeholder.js +55 -0
- package/dist/tui-v2/composer/paste-placeholder.js.map +1 -0
- package/dist/tui-v2/composer/prompt-history.d.ts +22 -0
- package/dist/tui-v2/composer/prompt-history.js +51 -0
- package/dist/tui-v2/composer/prompt-history.js.map +1 -0
- package/dist/tui-v2/composer/secret-buffer.d.ts +20 -0
- package/dist/tui-v2/composer/secret-buffer.js +42 -0
- package/dist/tui-v2/composer/secret-buffer.js.map +1 -0
- package/dist/tui-v2/composer/textarea-keybindings.d.ts +22 -0
- package/dist/tui-v2/composer/textarea-keybindings.js +27 -0
- package/dist/tui-v2/composer/textarea-keybindings.js.map +1 -0
- package/dist/tui-v2/controllers/focus-controller.d.ts +30 -0
- package/dist/tui-v2/controllers/focus-controller.js +80 -0
- package/dist/tui-v2/controllers/focus-controller.js.map +1 -0
- package/dist/tui-v2/controllers/overlay-controller.d.ts +99 -0
- package/dist/tui-v2/controllers/overlay-controller.js +195 -0
- package/dist/tui-v2/controllers/overlay-controller.js.map +1 -0
- package/dist/tui-v2/controllers/selection-controller.d.ts +76 -0
- package/dist/tui-v2/controllers/selection-controller.js +238 -0
- package/dist/tui-v2/controllers/selection-controller.js.map +1 -0
- package/dist/tui-v2/controllers/toast-controller.d.ts +35 -0
- package/dist/tui-v2/controllers/toast-controller.js +88 -0
- package/dist/tui-v2/controllers/toast-controller.js.map +1 -0
- package/dist/tui-v2/layout/compute-layout.d.ts +59 -0
- package/dist/tui-v2/layout/compute-layout.js +170 -0
- package/dist/tui-v2/layout/compute-layout.js.map +1 -0
- package/dist/tui-v2/rendering/ansi-to-styled.d.ts +17 -0
- package/dist/tui-v2/rendering/ansi-to-styled.js +217 -0
- package/dist/tui-v2/rendering/ansi-to-styled.js.map +1 -0
- package/dist/tui-v2/rendering/batch-sections.d.ts +57 -0
- package/dist/tui-v2/rendering/batch-sections.js +177 -0
- package/dist/tui-v2/rendering/batch-sections.js.map +1 -0
- package/dist/tui-v2/rendering/link-detector.d.ts +16 -0
- package/dist/tui-v2/rendering/link-detector.js +43 -0
- package/dist/tui-v2/rendering/link-detector.js.map +1 -0
- package/dist/tui-v2/rendering/open-tool-output.d.ts +28 -0
- package/dist/tui-v2/rendering/open-tool-output.js +138 -0
- package/dist/tui-v2/rendering/open-tool-output.js.map +1 -0
- package/dist/tui-v2/rendering/picker-filter.d.ts +22 -0
- package/dist/tui-v2/rendering/picker-filter.js +68 -0
- package/dist/tui-v2/rendering/picker-filter.js.map +1 -0
- package/dist/tui-v2/rendering/plan-view.d.ts +32 -0
- package/dist/tui-v2/rendering/plan-view.js +196 -0
- package/dist/tui-v2/rendering/plan-view.js.map +1 -0
- package/dist/tui-v2/rendering/render-markdown-lines.d.ts +29 -0
- package/dist/tui-v2/rendering/render-markdown-lines.js +46 -0
- package/dist/tui-v2/rendering/render-markdown-lines.js.map +1 -0
- package/dist/tui-v2/rendering/sanitize-display.d.ts +13 -0
- package/dist/tui-v2/rendering/sanitize-display.js +24 -0
- package/dist/tui-v2/rendering/sanitize-display.js.map +1 -0
- package/dist/tui-v2/rendering/strip-tool-surfaces.d.ts +10 -0
- package/dist/tui-v2/rendering/strip-tool-surfaces.js +32 -0
- package/dist/tui-v2/rendering/strip-tool-surfaces.js.map +1 -0
- package/dist/tui-v2/rendering/theme.d.ts +67 -0
- package/dist/tui-v2/rendering/theme.js +74 -0
- package/dist/tui-v2/rendering/theme.js.map +1 -0
- package/dist/tui-v2/rendering/tool-presenter.d.ts +39 -0
- package/dist/tui-v2/rendering/tool-presenter.js +209 -0
- package/dist/tui-v2/rendering/tool-presenter.js.map +1 -0
- package/dist/tui-v2/rendering/transcript-export.d.ts +11 -0
- package/dist/tui-v2/rendering/transcript-export.js +18 -0
- package/dist/tui-v2/rendering/transcript-export.js.map +1 -0
- package/dist/tui-v2/rendering/transcript-semantic.d.ts +17 -0
- package/dist/tui-v2/rendering/transcript-semantic.js +67 -0
- package/dist/tui-v2/rendering/transcript-semantic.js.map +1 -0
- package/dist/tui-v2/state/pager-search.d.ts +22 -0
- package/dist/tui-v2/state/pager-search.js +78 -0
- package/dist/tui-v2/state/pager-search.js.map +1 -0
- package/dist/tui-v2/state/semantic-document.d.ts +34 -0
- package/dist/tui-v2/state/semantic-document.js +201 -0
- package/dist/tui-v2/state/semantic-document.js.map +1 -0
- package/dist/tui-v2/state/transcript-compaction.d.ts +24 -0
- package/dist/tui-v2/state/transcript-compaction.js +79 -0
- package/dist/tui-v2/state/transcript-compaction.js.map +1 -0
- package/dist/tui-v2/state/transcript-hydrate.d.ts +27 -0
- package/dist/tui-v2/state/transcript-hydrate.js +276 -0
- package/dist/tui-v2/state/transcript-hydrate.js.map +1 -0
- package/dist/tui-v2/state/transcript-reducer.d.ts +10 -0
- package/dist/tui-v2/state/transcript-reducer.js +339 -0
- package/dist/tui-v2/state/transcript-reducer.js.map +1 -0
- package/dist/tui-v2/state/transcript-search.d.ts +17 -0
- package/dist/tui-v2/state/transcript-search.js +38 -0
- package/dist/tui-v2/state/transcript-search.js.map +1 -0
- package/dist/tui-v2/state/transcript-store.d.ts +32 -0
- package/dist/tui-v2/state/transcript-store.js +66 -0
- package/dist/tui-v2/state/transcript-store.js.map +1 -0
- package/dist/tui-v2/state/transcript-struct.d.ts +15 -0
- package/dist/tui-v2/state/transcript-struct.js +133 -0
- package/dist/tui-v2/state/transcript-struct.js.map +1 -0
- package/dist/tui-v2/state/transcript-types.d.ts +76 -0
- package/dist/tui-v2/state/transcript-types.js +65 -0
- package/dist/tui-v2/state/transcript-types.js.map +1 -0
- package/dist/tui-v2/state/use-overlay.d.ts +3 -0
- package/dist/tui-v2/state/use-overlay.js +6 -0
- package/dist/tui-v2/state/use-overlay.js.map +1 -0
- package/dist/tui-v2/state/use-plan.d.ts +4 -0
- package/dist/tui-v2/state/use-plan.js +6 -0
- package/dist/tui-v2/state/use-plan.js.map +1 -0
- package/dist/tui-v2/state/use-session-state.d.ts +2 -0
- package/dist/tui-v2/state/use-session-state.js +7 -0
- package/dist/tui-v2/state/use-session-state.js.map +1 -0
- package/dist/tui-v2/state/use-toast.d.ts +3 -0
- package/dist/tui-v2/state/use-toast.js +15 -0
- package/dist/tui-v2/state/use-toast.js.map +1 -0
- package/dist/tui-v2/state/use-transcript-store.d.ts +10 -0
- package/dist/tui-v2/state/use-transcript-store.js +12 -0
- package/dist/tui-v2/state/use-transcript-store.js.map +1 -0
- package/dist/ui/intro-card.js +3 -3
- package/dist/ui/intro-card.js.map +1 -1
- package/dist/ui/intro-header.d.ts +23 -0
- package/dist/ui/intro-header.js +232 -0
- package/dist/ui/intro-header.js.map +1 -0
- package/dist/ui/markdown.js +0 -1
- package/dist/ui/markdown.js.map +1 -1
- package/dist/ui/mentions.d.ts +9 -2
- package/dist/ui/mentions.js +102 -4
- package/dist/ui/mentions.js.map +1 -1
- package/dist/ui/output-pane.js +1 -1
- package/dist/ui/output-pane.js.map +1 -1
- package/dist/ui/plan-pane.d.ts +8 -0
- package/dist/ui/plan-pane.js +38 -0
- package/dist/ui/plan-pane.js.map +1 -1
- package/dist/ui/wordmark.d.ts +5 -0
- package/dist/ui/wordmark.js +6 -1
- package/dist/ui/wordmark.js.map +1 -1
- package/package.json +25 -12
- package/dist/tui/App.d.ts +0 -12
- package/dist/tui/App.js +0 -2174
- package/dist/tui/App.js.map +0 -1
- package/dist/tui/components/ConfirmModal.d.ts +0 -9
- package/dist/tui/components/ConfirmModal.js +0 -55
- package/dist/tui/components/ConfirmModal.js.map +0 -1
- package/dist/tui/components/JobsPanel.d.ts +0 -11
- package/dist/tui/components/JobsPanel.js +0 -55
- package/dist/tui/components/JobsPanel.js.map +0 -1
- package/dist/tui/components/Pager.d.ts +0 -14
- package/dist/tui/components/Pager.js +0 -56
- package/dist/tui/components/Pager.js.map +0 -1
- package/dist/tui/components/PickerPanel.d.ts +0 -15
- package/dist/tui/components/PickerPanel.js +0 -126
- package/dist/tui/components/PickerPanel.js.map +0 -1
- package/dist/tui/components/PlanSidebar.d.ts +0 -6
- package/dist/tui/components/PlanSidebar.js +0 -99
- package/dist/tui/components/PlanSidebar.js.map +0 -1
- package/dist/tui/components/SecretInputPanel.d.ts +0 -7
- package/dist/tui/components/SecretInputPanel.js +0 -38
- package/dist/tui/components/SecretInputPanel.js.map +0 -1
- package/dist/tui/confirm.d.ts +0 -16
- package/dist/tui/confirm.js.map +0 -1
- package/dist/tui/default.d.ts +0 -6
- package/dist/tui/default.js +0 -11
- package/dist/tui/default.js.map +0 -1
- package/dist/tui/hooks/useAgentRunner.d.ts +0 -73
- package/dist/tui/hooks/useAgentRunner.js +0 -277
- package/dist/tui/hooks/useAgentRunner.js.map +0 -1
- package/dist/tui/hooks/useJobs.d.ts +0 -7
- package/dist/tui/hooks/useJobs.js +0 -39
- package/dist/tui/hooks/useJobs.js.map +0 -1
- package/dist/tui/hooks/useSpinner.d.ts +0 -5
- package/dist/tui/hooks/useSpinner.js +0 -21
- package/dist/tui/hooks/useSpinner.js.map +0 -1
- package/dist/tui/hooks/useTerminalSize.d.ts +0 -9
- package/dist/tui/hooks/useTerminalSize.js +0 -26
- package/dist/tui/hooks/useTerminalSize.js.map +0 -1
- package/dist/tui/index.d.ts +0 -10
- package/dist/tui/index.js +0 -37
- package/dist/tui/index.js.map +0 -1
- package/dist/tui/key-intent.d.ts +0 -36
- package/dist/tui/key-intent.js +0 -54
- package/dist/tui/key-intent.js.map +0 -1
- package/dist/tui/mouse.d.ts +0 -8
- package/dist/tui/mouse.js +0 -34
- package/dist/tui/mouse.js.map +0 -1
- package/dist/tui/plan-sidebar-lines.d.ts +0 -2
- package/dist/tui/plan-sidebar-lines.js +0 -140
- package/dist/tui/plan-sidebar-lines.js.map +0 -1
- package/dist/tui/render-lines.d.ts +0 -22
- package/dist/tui/render-lines.js +0 -611
- package/dist/tui/render-lines.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { TextAttributes } from "@opentui/core";
|
|
3
|
+
import { LinkableText } from "./linkable-text.js";
|
|
4
|
+
function badge(level) {
|
|
5
|
+
// Fixed-width labels so wrap indent stays consistent across levels.
|
|
6
|
+
if (level === "warn")
|
|
7
|
+
return { label: " WARN ", fg: "#FFFFFF", bg: "#D97706" };
|
|
8
|
+
if (level === "error")
|
|
9
|
+
return { label: " ERR ", fg: "#FFFFFF", bg: "#B91C1C" };
|
|
10
|
+
return { label: " INFO ", fg: "#FFFFFF", bg: "#334155" };
|
|
11
|
+
}
|
|
12
|
+
function bodyColor(level, theme) {
|
|
13
|
+
if (level === "warn")
|
|
14
|
+
return theme.activity;
|
|
15
|
+
if (level === "error")
|
|
16
|
+
return theme.mode;
|
|
17
|
+
return theme.cyan;
|
|
18
|
+
}
|
|
19
|
+
export function NoticeRow(props) {
|
|
20
|
+
const { item, theme } = props;
|
|
21
|
+
const b = badge(item.level);
|
|
22
|
+
return (_jsxs("box", { id: item.id, style: {
|
|
23
|
+
marginBottom: 1,
|
|
24
|
+
flexDirection: "row",
|
|
25
|
+
width: "100%",
|
|
26
|
+
alignItems: "flex-start",
|
|
27
|
+
}, children: [_jsx("text", { selectable: true, style: {
|
|
28
|
+
fg: b.fg,
|
|
29
|
+
bg: b.bg,
|
|
30
|
+
attributes: TextAttributes.BOLD,
|
|
31
|
+
flexShrink: 0,
|
|
32
|
+
}, children: b.label }), _jsx("box", { style: {
|
|
33
|
+
flexGrow: 1,
|
|
34
|
+
flexShrink: 1,
|
|
35
|
+
flexDirection: "column",
|
|
36
|
+
paddingLeft: 1,
|
|
37
|
+
minWidth: 0,
|
|
38
|
+
}, children: _jsx(LinkableText, { text: item.text, theme: theme, fg: bodyColor(item.level, theme), selectable: true }) })] }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=notice-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notice-row.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/notice-row.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,SAAS,KAAK,CAAC,KAAkB;IAC/B,oEAAoE;IACpE,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;IAC/E,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;IAChF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;AAC3D,CAAC;AAED,SAAS,SAAS,CAAC,KAAkB,EAAE,KAAY;IACjD,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC;IAC5C,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC;IACzC,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAyC;IACjE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC9B,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,CACL,eACE,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,KAAK,EAAE;YACL,YAAY,EAAE,CAAC;YACf,aAAa,EAAE,KAAK;YACpB,KAAK,EAAE,MAAM;YACb,UAAU,EAAE,YAAY;SACzB,aAED,eACE,UAAU,QACV,KAAK,EAAE;oBACL,EAAE,EAAE,CAAC,CAAC,EAAE;oBACR,EAAE,EAAE,CAAC,CAAC,EAAE;oBACR,UAAU,EAAE,cAAc,CAAC,IAAI;oBAC/B,UAAU,EAAE,CAAC;iBACd,YAEA,CAAC,CAAC,KAAK,GACH,EACP,cACE,KAAK,EAAE;oBACL,QAAQ,EAAE,CAAC;oBACX,UAAU,EAAE,CAAC;oBACb,aAAa,EAAE,QAAQ;oBACvB,WAAW,EAAE,CAAC;oBACd,QAAQ,EAAE,CAAC;iBACZ,YAED,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,UAAU,SAAG,GACxF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* Transcript search input (CHAT/V2-057). Purely a text field plus a match
|
|
4
|
+
* counter; query matching and index navigation live in the renderer-
|
|
5
|
+
* independent `transcript-search.ts` and are owned by `TranscriptView`, which
|
|
6
|
+
* also handles Escape (global key handling can't be typed on `<input>`'s
|
|
7
|
+
* React props — see that component for why).
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
import type { Theme } from "../../rendering/theme.js";
|
|
11
|
+
export interface SearchBarProps {
|
|
12
|
+
readonly theme: Theme;
|
|
13
|
+
readonly query: string;
|
|
14
|
+
readonly matchCount: number;
|
|
15
|
+
readonly activeOrdinal: number;
|
|
16
|
+
readonly onQueryChange: (value: string) => void;
|
|
17
|
+
readonly onSubmit: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function SearchBar(props: SearchBarProps): ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
export function SearchBar(props) {
|
|
3
|
+
const { theme, query, matchCount, activeOrdinal, onQueryChange, onSubmit } = props;
|
|
4
|
+
const status = matchCount > 0 ? `${activeOrdinal}/${matchCount}` : query ? "no matches" : "";
|
|
5
|
+
return (_jsxs("box", { style: { flexDirection: "row", backgroundColor: theme.statusBackground, paddingLeft: 1 }, children: [_jsx("text", { style: { fg: theme.muted }, children: "type:filter " }), _jsx("input", { focused: true, value: query, onInput: onQueryChange, onSubmit: onSubmit, textColor: theme.foreground, backgroundColor: theme.statusBackground, style: { flexGrow: 1 } }), _jsxs("text", { style: { fg: theme.muted }, children: [" ", status, " \u00B7 enter:next \u00B7 esc:close"] })] }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=search-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-bar.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/search-bar.tsx"],"names":[],"mappings":";AAqBA,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnF,MAAM,MAAM,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7F,OAAO,CACL,eAAK,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,CAAC,gBAAgB,EAAE,WAAW,EAAE,CAAC,EAAE,aAC3F,eAAM,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,8BAAsB,EACtD,gBACE,OAAO,QACP,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,KAAK,CAAC,UAAU,EAC3B,eAAe,EAAE,KAAK,CAAC,gBAAgB,EACvC,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,GACtB,EACF,gBAAM,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,aAC7B,GAAG,EACH,MAAM,+CACF,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* Renders a `ThinkingItem` (CHAT-006, V2-053).
|
|
4
|
+
*
|
|
5
|
+
* Live stream: while the model is still reasoning (`item.streaming`), the body
|
|
6
|
+
* is always shown — same as the classic TUI's thinking preview. After the
|
|
7
|
+
* block is finalized, the body follows the global Ctrl+T toggle (or a per-
|
|
8
|
+
* block override from clicking the header).
|
|
9
|
+
*
|
|
10
|
+
* Placement: thinking rows always precede the ◆ Response / tool cards for
|
|
11
|
+
* the same model step (agent emits thinking-block before assistant-message
|
|
12
|
+
* and tool-call). Violet accent distinguishes reasoning from green replies.
|
|
13
|
+
*/
|
|
14
|
+
import type { ReactNode } from "react";
|
|
15
|
+
import type { ThinkingItem } from "../../state/transcript-types.js";
|
|
16
|
+
import type { Theme } from "../../rendering/theme.js";
|
|
17
|
+
export declare function ThinkingBlock(props: {
|
|
18
|
+
item: ThinkingItem;
|
|
19
|
+
theme: Theme;
|
|
20
|
+
expanded: boolean;
|
|
21
|
+
onToggle: () => void;
|
|
22
|
+
}): ReactNode;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { TextAttributes } from "@opentui/core";
|
|
3
|
+
export function ThinkingBlock(props) {
|
|
4
|
+
const { item, theme, expanded, onToggle } = props;
|
|
5
|
+
// Always show live content while streaming; after finalize, honor toggle.
|
|
6
|
+
const showBody = item.streaming || expanded;
|
|
7
|
+
const onMouseUp = (event) => {
|
|
8
|
+
event.preventDefault();
|
|
9
|
+
// Only allow collapse/expand once the block is complete.
|
|
10
|
+
if (item.streaming)
|
|
11
|
+
return;
|
|
12
|
+
onToggle();
|
|
13
|
+
};
|
|
14
|
+
const header = item.streaming
|
|
15
|
+
? "✦ thinking…"
|
|
16
|
+
: showBody
|
|
17
|
+
? "▾ thinking"
|
|
18
|
+
: "▸ thinking · ctrl+t or click to view";
|
|
19
|
+
return (_jsxs("box", { id: item.id, style: { flexDirection: "column", marginBottom: 1, width: "100%" }, children: [_jsx("box", { onMouseUp: onMouseUp, style: { flexDirection: "row" }, children: _jsx("text", { selectable: true, style: {
|
|
20
|
+
fg: theme.thinking,
|
|
21
|
+
attributes: TextAttributes.ITALIC,
|
|
22
|
+
}, children: header }) }), showBody && item.content ? (_jsx("box", { style: { flexDirection: "column", paddingLeft: 2 }, children: _jsx("text", { selectable: true, style: {
|
|
23
|
+
fg: theme.thinking,
|
|
24
|
+
attributes: TextAttributes.ITALIC,
|
|
25
|
+
}, children: item.content }) })) : null] }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=thinking-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-block.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/thinking-block.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAC;AAIhE,MAAM,UAAU,aAAa,CAAC,KAK7B;IACC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAClD,0EAA0E;IAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC;IAC5C,MAAM,SAAS,GAAG,CAAC,KAAiB,EAAQ,EAAE;QAC5C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,yDAAyD;QACzD,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO;QAC3B,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS;QAC3B,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,QAAQ;YACR,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,sCAAsC,CAAC;IAE7C,OAAO,CACL,eAAK,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,aAClF,cAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,YACxD,eACE,UAAU,QACV,KAAK,EAAE;wBACL,EAAE,EAAE,KAAK,CAAC,QAAQ;wBAClB,UAAU,EAAE,cAAc,CAAC,MAAM;qBAClC,YAEA,MAAM,GACF,GACH,EACL,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAC1B,cAAK,KAAK,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,EAAE,YACrD,eACE,UAAU,QACV,KAAK,EAAE;wBACL,EAAE,EAAE,KAAK,CAAC,QAAQ;wBAClB,UAAU,EAAE,cAAc,CAAC,MAAM;qBAClC,YAEA,IAAI,CAAC,OAAO,GACR,GACH,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* Tool card: flat single-border pane (classic parity — no 3D depth / outer plate).
|
|
4
|
+
*
|
|
5
|
+
* Click (body or footer) opens the full-output pager modal — unless the card is
|
|
6
|
+
* already expanded in place via Ctrl+O. Ctrl+O expands every card to show the
|
|
7
|
+
* full cleaned body; click does not toggle expand (classic: keyboard expands,
|
|
8
|
+
* click opens the unbounded viewer).
|
|
9
|
+
*
|
|
10
|
+
* tool.batch: parent card nests one mini-card per sub-tool. Click the parent
|
|
11
|
+
* (header/footer) for the full batch; click a sub-card for that call only.
|
|
12
|
+
* Ctrl+O expands sub-bodies in place the same as a normal tool.
|
|
13
|
+
*/
|
|
14
|
+
import type { ReactNode } from "react";
|
|
15
|
+
import type { OutputSpool } from "../../../app/events/event-buffer.js";
|
|
16
|
+
import type { AppServices } from "../../bootstrap/composition-root.js";
|
|
17
|
+
import type { ToolItem } from "../../state/transcript-types.js";
|
|
18
|
+
import type { Theme } from "../../rendering/theme.js";
|
|
19
|
+
export declare function ToolCard(props: {
|
|
20
|
+
item: ToolItem;
|
|
21
|
+
theme: Theme;
|
|
22
|
+
spool: OutputSpool;
|
|
23
|
+
expanded: boolean;
|
|
24
|
+
services: AppServices;
|
|
25
|
+
onToggle: () => void;
|
|
26
|
+
}): ReactNode;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { TextAttributes } from "@opentui/core";
|
|
3
|
+
import { batchSummaryLine, formatBatchSectionForPager, isBatchToolName, parseBatchLiveProgress, parseBatchSections, presentBatchSection, } from "../../rendering/batch-sections.js";
|
|
4
|
+
import { presentOutput, presentTool } from "../../rendering/tool-presenter.js";
|
|
5
|
+
import { openToolOutputPager } from "../../rendering/open-tool-output.js";
|
|
6
|
+
import { LinkableText } from "./linkable-text.js";
|
|
7
|
+
import { useClickWithoutDrag } from "./use-click-without-drag.js";
|
|
8
|
+
const STATUS_COLOR = {
|
|
9
|
+
queued: "muted",
|
|
10
|
+
running: "activity",
|
|
11
|
+
ok: "response",
|
|
12
|
+
failed: "mode",
|
|
13
|
+
blocked: "mode",
|
|
14
|
+
};
|
|
15
|
+
function OutputLines(props) {
|
|
16
|
+
const { lines, theme, gutterFg } = props;
|
|
17
|
+
// Tool/output body: CLAI wordmark magenta (same as task-pane border / logo "I").
|
|
18
|
+
const bodyFg = theme.magenta;
|
|
19
|
+
return (_jsx(_Fragment, { children: lines.map((line, i) => {
|
|
20
|
+
const isGap = line.startsWith("···");
|
|
21
|
+
return (_jsxs("text", { selectable: true, children: [_jsx("span", { style: { fg: isGap ? theme.muted : gutterFg }, children: "│ " }), _jsx("span", { style: {
|
|
22
|
+
fg: isGap ? theme.muted : bodyFg,
|
|
23
|
+
attributes: isGap ? TextAttributes.DIM : TextAttributes.NONE,
|
|
24
|
+
}, children: line })] }, i));
|
|
25
|
+
}) }));
|
|
26
|
+
}
|
|
27
|
+
function BatchSubCard(props) {
|
|
28
|
+
const { section, theme, expanded, parentExpanded, onOpen } = props;
|
|
29
|
+
const presented = presentBatchSection(section, expanded);
|
|
30
|
+
const borderFg = section.ok ? theme.response : theme.mode;
|
|
31
|
+
const statusFg = borderFg;
|
|
32
|
+
// Click (no drag) opens pager; drag-select copies output lines.
|
|
33
|
+
const click = useClickWithoutDrag(() => {
|
|
34
|
+
if (parentExpanded)
|
|
35
|
+
return;
|
|
36
|
+
onOpen(section);
|
|
37
|
+
});
|
|
38
|
+
let footerHint;
|
|
39
|
+
if (presented.hasBody) {
|
|
40
|
+
if (expanded) {
|
|
41
|
+
footerHint = "expanded · Ctrl+O to collapse";
|
|
42
|
+
}
|
|
43
|
+
else if (presented.hiddenAboveCount > 0) {
|
|
44
|
+
footerHint = `+${presented.hiddenAboveCount} more · click for full · Ctrl+O to expand`;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
footerHint = "click for full · Ctrl+O to expand";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return (_jsxs("box", { border: true, borderStyle: "rounded", style: {
|
|
51
|
+
flexDirection: "column",
|
|
52
|
+
width: "100%",
|
|
53
|
+
marginTop: 1,
|
|
54
|
+
marginBottom: 0,
|
|
55
|
+
borderColor: borderFg,
|
|
56
|
+
// Match parent face — no second elevated plate.
|
|
57
|
+
backgroundColor: theme.statusBackground,
|
|
58
|
+
paddingLeft: 1,
|
|
59
|
+
paddingRight: 1,
|
|
60
|
+
paddingTop: 0,
|
|
61
|
+
paddingBottom: 0,
|
|
62
|
+
}, onMouseDown: click.onMouseDown, onMouseUp: click.onMouseUp, children: [_jsxs("box", { style: { flexDirection: "row", width: "100%" }, children: [_jsxs("text", { selectable: true, style: { fg: statusFg, attributes: TextAttributes.BOLD }, children: [presented.glyph, " ", presented.name] }), _jsx("text", { content: " ", selectable: true }), _jsx("text", { selectable: true, style: { fg: statusFg, bg: theme.chip, attributes: TextAttributes.BOLD }, children: ` ${presented.statusLabel} ` }), _jsx("text", { content: " ", selectable: true }), _jsxs("text", { selectable: true, style: { fg: theme.muted, attributes: TextAttributes.DIM }, children: ["#", section.index] })] }), presented.lines.length > 0 ? (_jsx("box", { style: {
|
|
63
|
+
flexDirection: "column",
|
|
64
|
+
width: "100%",
|
|
65
|
+
marginTop: 0,
|
|
66
|
+
flexShrink: 1,
|
|
67
|
+
}, children: _jsx(OutputLines, { lines: presented.lines, theme: theme, gutterFg: borderFg }) })) : null, footerHint ? (_jsxs("box", { style: { flexDirection: "row", width: "100%", marginTop: 0 }, children: [_jsx("text", { selectable: false, style: { fg: theme.cyan }, children: "› " }), _jsx("text", { selectable: false, style: { fg: theme.cyan, attributes: TextAttributes.DIM }, children: footerHint })] })) : null] }));
|
|
68
|
+
}
|
|
69
|
+
export function ToolCard(props) {
|
|
70
|
+
const { item, theme, spool, expanded, services } = props;
|
|
71
|
+
const { glyph, statusLabel, name, argsLabel, argsDisplay, detail } = presentTool(item);
|
|
72
|
+
const tail = spool.tail(item.toolCallId);
|
|
73
|
+
const spoolState = spool.state(item.toolCallId);
|
|
74
|
+
const isBatchName = isBatchToolName(item.name);
|
|
75
|
+
const batchSections = isBatchName && item.status !== "running" && tail
|
|
76
|
+
? parseBatchSections(tail)
|
|
77
|
+
: [];
|
|
78
|
+
const isBatch = batchSections.length > 0;
|
|
79
|
+
const liveBatch = isBatchName && item.status === "running" && tail
|
|
80
|
+
? parseBatchLiveProgress(tail)
|
|
81
|
+
: { lines: [], summary: "" };
|
|
82
|
+
const isBatchLive = isBatchName && item.status === "running";
|
|
83
|
+
const { lines, hiddenAboveCount, truncatedNotice } = isBatch || isBatchLive
|
|
84
|
+
? {
|
|
85
|
+
lines: [],
|
|
86
|
+
hiddenAboveCount: 0,
|
|
87
|
+
truncatedNotice: undefined,
|
|
88
|
+
}
|
|
89
|
+
: presentOutput(tail, spoolState, expanded);
|
|
90
|
+
const statusFg = theme[STATUS_COLOR[item.status]];
|
|
91
|
+
const highlight = item.status === "running"
|
|
92
|
+
? theme.activity
|
|
93
|
+
: item.status === "queued"
|
|
94
|
+
? theme.muted
|
|
95
|
+
: item.status === "ok"
|
|
96
|
+
? theme.toolBorder
|
|
97
|
+
: theme.mode;
|
|
98
|
+
const hasBody = isBatch ||
|
|
99
|
+
isBatchLive ||
|
|
100
|
+
lines.length > 0 ||
|
|
101
|
+
item.outputBytes > 0 ||
|
|
102
|
+
Boolean(item.artifactPath);
|
|
103
|
+
/** Open unbounded pager for the whole tool (or full batch). */
|
|
104
|
+
const openFull = () => {
|
|
105
|
+
if (expanded)
|
|
106
|
+
return;
|
|
107
|
+
if (item.status === "running" && !hasBody)
|
|
108
|
+
return;
|
|
109
|
+
void openToolOutputPager(services, item);
|
|
110
|
+
};
|
|
111
|
+
// Click without drag opens pager; drag-select includes output text.
|
|
112
|
+
const openFullClick = useClickWithoutDrag(openFull);
|
|
113
|
+
const openSection = (section) => {
|
|
114
|
+
void openToolOutputPager(services, {
|
|
115
|
+
toolCallId: item.toolCallId,
|
|
116
|
+
name: section.name,
|
|
117
|
+
argsDisplay: `#${section.index}`,
|
|
118
|
+
artifactPath: undefined,
|
|
119
|
+
}, {
|
|
120
|
+
bodyOverride: formatBatchSectionForPager(section),
|
|
121
|
+
titleOverride: `${section.name} · #${section.index}`,
|
|
122
|
+
skipArtifact: true,
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
// Footer: keyboard expand always advertised; click-for-modal only when collapsed.
|
|
126
|
+
let footerHint;
|
|
127
|
+
if (item.status !== "running" && hasBody) {
|
|
128
|
+
if (expanded) {
|
|
129
|
+
footerHint = isBatch
|
|
130
|
+
? "sub-calls expanded · click batch or sub-tool for pager · Ctrl+O collapses"
|
|
131
|
+
: "expanded · Ctrl+O to collapse";
|
|
132
|
+
}
|
|
133
|
+
else if (isBatch) {
|
|
134
|
+
footerHint =
|
|
135
|
+
"click batch = all output · click sub-tool = that call · Ctrl+O expands all";
|
|
136
|
+
}
|
|
137
|
+
else if (hiddenAboveCount > 0) {
|
|
138
|
+
footerHint = `+${hiddenAboveCount} more · click for full · Ctrl+O to expand`;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
footerHint = "click for full · Ctrl+O to expand";
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else if (isBatchLive) {
|
|
145
|
+
footerHint = "live sub-calls · finishes into nested cards";
|
|
146
|
+
}
|
|
147
|
+
else if (item.status === "running" && hasBody && !expanded) {
|
|
148
|
+
footerHint = "click for full · Ctrl+O to expand";
|
|
149
|
+
}
|
|
150
|
+
const summary = isBatch
|
|
151
|
+
? batchSummaryLine(batchSections)
|
|
152
|
+
: isBatchLive
|
|
153
|
+
? liveBatch.summary
|
|
154
|
+
: undefined;
|
|
155
|
+
const summaryFg = isBatch && batchSections.some((s) => !s.ok) ? theme.mode : theme.muted;
|
|
156
|
+
return (_jsxs("box", { id: item.id, border: true, borderStyle: "rounded", style: {
|
|
157
|
+
flexDirection: "column",
|
|
158
|
+
width: "100%",
|
|
159
|
+
marginBottom: 1,
|
|
160
|
+
borderColor: highlight,
|
|
161
|
+
// Flat face only — no layered header/well plate outside the border.
|
|
162
|
+
backgroundColor: theme.statusBackground,
|
|
163
|
+
paddingLeft: 1,
|
|
164
|
+
paddingRight: 1,
|
|
165
|
+
paddingTop: 0,
|
|
166
|
+
paddingBottom: 0,
|
|
167
|
+
}, children: [_jsxs("box", { style: {
|
|
168
|
+
flexDirection: "row",
|
|
169
|
+
width: "100%",
|
|
170
|
+
paddingTop: 0,
|
|
171
|
+
paddingBottom: 0,
|
|
172
|
+
}, onMouseDown: openFullClick.onMouseDown, onMouseUp: openFullClick.onMouseUp, children: [_jsxs("text", { selectable: true, style: { fg: statusFg, attributes: TextAttributes.BOLD }, children: [glyph, " ", name] }), _jsx("text", { content: " ", selectable: true }), _jsx("text", { selectable: true, style: { fg: statusFg, bg: theme.chip, attributes: TextAttributes.BOLD }, children: ` ${statusLabel} ` }), isBatch || isBatchLive ? (_jsxs(_Fragment, { children: [_jsx("text", { content: " ", selectable: true }), _jsx("text", { selectable: true, style: { fg: theme.muted, attributes: TextAttributes.DIM }, children: "batch" })] })) : null] }), argsDisplay && argsLabel ? (_jsxs("box", { style: { flexDirection: "row", width: "100%", marginTop: 0 }, children: [_jsxs("text", { selectable: true, style: { fg: theme.muted }, children: [argsLabel, ": "] }), _jsx("text", { selectable: true, style: { fg: theme.cyan }, children: argsDisplay })] })) : null, detail ? _jsx(LinkableText, { text: detail, theme: theme, fg: theme.mode, selectable: true }) : null, summary ? (_jsx("text", { selectable: true, style: { fg: summaryFg, attributes: TextAttributes.DIM }, children: summary })) : null, isBatchLive && liveBatch.lines.length > 0 ? (_jsx("box", { style: { flexDirection: "column", width: "100%", marginTop: 0 }, children: liveBatch.lines.map((line, i) => {
|
|
173
|
+
const fg = line.tone === "ok"
|
|
174
|
+
? theme.response
|
|
175
|
+
: line.tone === "fail"
|
|
176
|
+
? theme.mode
|
|
177
|
+
: line.tone === "running"
|
|
178
|
+
? theme.activity
|
|
179
|
+
: theme.muted;
|
|
180
|
+
return (_jsx("text", { selectable: true, style: { fg }, children: ` ${line.tone === "ok" ? "✓" : line.tone === "fail" ? "✗" : line.tone === "running" ? "●" : "·"} ${line.text}` }, `live-${i}`));
|
|
181
|
+
}) })) : null, isBatch
|
|
182
|
+
? batchSections.map((section) => (_jsx(BatchSubCard, { section: section, theme: theme, expanded: expanded, parentExpanded: expanded, onOpen: openSection }, `${item.id}-sub-${section.index}`)))
|
|
183
|
+
: null, !isBatch && !isBatchLive && lines.length > 0 ? (_jsxs("box", { style: {
|
|
184
|
+
flexDirection: "column",
|
|
185
|
+
width: "100%",
|
|
186
|
+
paddingLeft: 0,
|
|
187
|
+
paddingRight: 0,
|
|
188
|
+
paddingTop: 0,
|
|
189
|
+
paddingBottom: 0,
|
|
190
|
+
marginTop: 0,
|
|
191
|
+
flexShrink: 1,
|
|
192
|
+
}, onMouseDown: openFullClick.onMouseDown, onMouseUp: openFullClick.onMouseUp, children: [_jsx("text", { selectable: true, style: { fg: theme.white, bg: theme.chipTeal, attributes: TextAttributes.BOLD }, children: " OUTPUT " }), _jsx(OutputLines, { lines: lines, theme: theme, gutterFg: theme.muted })] })) : null, item.artifactPath ? (_jsxs("box", { style: { flexDirection: "row", width: "100%", marginTop: 0 }, children: [_jsx("text", { selectable: true, style: { fg: theme.white, bg: theme.chipTeal, attributes: TextAttributes.BOLD }, children: " SAVED " }), _jsx("text", { content: " ", selectable: true }), _jsx(LinkableText, { text: item.artifactPath, theme: theme, fg: theme.cyan, selectable: true })] })) : null, truncatedNotice ? (_jsx("text", { selectable: true, style: { fg: theme.muted, attributes: TextAttributes.ITALIC }, children: truncatedNotice })) : null, footerHint ? (_jsxs("box", { style: {
|
|
193
|
+
flexDirection: "row",
|
|
194
|
+
width: "100%",
|
|
195
|
+
marginTop: 0,
|
|
196
|
+
marginBottom: 0,
|
|
197
|
+
paddingBottom: 0,
|
|
198
|
+
}, ...(expanded
|
|
199
|
+
? {}
|
|
200
|
+
: {
|
|
201
|
+
onMouseDown: openFullClick.onMouseDown,
|
|
202
|
+
onMouseUp: openFullClick.onMouseUp,
|
|
203
|
+
}), children: [_jsx("text", { selectable: false, style: { fg: theme.cyan }, children: "› " }), _jsx("text", { selectable: false, style: { fg: theme.cyan, attributes: TextAttributes.DIM }, children: footerHint })] })) : null] }));
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=tool-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-card.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/tool-card.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAK/C,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,YAAY,GAA4C;IAC5D,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,UAAU;IACnB,EAAE,EAAE,UAAU;IACd,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;CAChB,CAAC;AAEF,SAAS,WAAW,CAAC,KAIpB;IACC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACzC,iFAAiF;IACjF,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC;IAC7B,OAAO,CACL,4BACG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;YACrB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACrC,OAAO,CAEL,gBAAc,UAAU,mBACtB,eAAM,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,YAAG,IAAI,GAAQ,EAClE,e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AE,EAAE,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,cAAc,CAAC,MAAM,EAAE,YAC3E,eAAe,GACX,CACR,CAAC,CAAC,CAAC,IAAI,EACP,UAAU,CAAC,CAAC,CAAC,CACZ,eACE,KAAK,EAAE;oBACL,aAAa,EAAE,KAAK;oBACpB,KAAK,EAAE,MAAM;oBACb,SAAS,EAAE,CAAC;oBACZ,YAAY,EAAE,CAAC;oBACf,aAAa,EAAE,CAAC;iBACjB,KACG,CAAC,QAAQ;oBACX,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC;wBACE,WAAW,EAAE,aAAa,CAAC,WAAW;wBACtC,SAAS,EAAE,aAAa,CAAC,SAAS;qBACnC,CAAC,aAEN,eAAM,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE,YAAG,IAAI,GAAQ,EACjE,eAAM,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,cAAc,CAAC,GAAG,EAAE,YAAG,UAAU,GAAQ,IACnG,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* Dispatches one normalized item to its renderer (V2-051..055).
|
|
4
|
+
*
|
|
5
|
+
* The only place that switches on `item.kind`; adding an item kind means
|
|
6
|
+
* adding one case here plus its renderer, not touching a scattered UI switch
|
|
7
|
+
* (ARCHITECTURE "commands are data plus handlers, not switch statements").
|
|
8
|
+
*/
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
import type { OutputSpool } from "../../../app/events/event-buffer.js";
|
|
11
|
+
import type { AppServices } from "../../bootstrap/composition-root.js";
|
|
12
|
+
import type { TranscriptStore } from "../../state/transcript-store.js";
|
|
13
|
+
import { type TranscriptItem, type TranscriptState } from "../../state/transcript-types.js";
|
|
14
|
+
import type { Theme } from "../../rendering/theme.js";
|
|
15
|
+
export declare function TranscriptRow(props: {
|
|
16
|
+
item: TranscriptItem;
|
|
17
|
+
state: TranscriptState;
|
|
18
|
+
theme: Theme;
|
|
19
|
+
store: TranscriptStore;
|
|
20
|
+
spool: OutputSpool;
|
|
21
|
+
services: AppServices;
|
|
22
|
+
onOpenUserPrompt: (prompt: string) => void;
|
|
23
|
+
/** Chat-pane columns so markdown tables reflow beside the plan pane. */
|
|
24
|
+
contentWidth?: number | undefined;
|
|
25
|
+
}): ReactNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
+
import { isItemExpanded } from "../../state/transcript-types.js";
|
|
3
|
+
import { UserMessage } from "./user-message.js";
|
|
4
|
+
import { AssistantMessage } from "./assistant-message.js";
|
|
5
|
+
import { ThinkingBlock } from "./thinking-block.js";
|
|
6
|
+
import { ToolCard } from "./tool-card.js";
|
|
7
|
+
import { NoticeRow } from "./notice-row.js";
|
|
8
|
+
import { CompactedRow } from "./compacted-row.js";
|
|
9
|
+
export function TranscriptRow(props) {
|
|
10
|
+
const { item, state, theme, store, spool, services, onOpenUserPrompt, contentWidth, } = props;
|
|
11
|
+
switch (item.kind) {
|
|
12
|
+
case "user":
|
|
13
|
+
return _jsx(UserMessage, { item: item, theme: theme, onOpen: onOpenUserPrompt });
|
|
14
|
+
case "assistant":
|
|
15
|
+
return (_jsx(AssistantMessage, { item: item, theme: theme, contentWidth: contentWidth }));
|
|
16
|
+
case "thinking":
|
|
17
|
+
return (_jsx(ThinkingBlock, { item: item, theme: theme, expanded: isItemExpanded(state, item), onToggle: () => store.toggleItemOverride(item.id, state.expandThinkingGlobal) }));
|
|
18
|
+
case "tool":
|
|
19
|
+
return (_jsx(ToolCard, { item: item, theme: theme, spool: spool, services: services, expanded: isItemExpanded(state, item), onToggle: () => store.toggleItemOverride(item.id, state.expandOutputGlobal) }));
|
|
20
|
+
case "notice":
|
|
21
|
+
return _jsx(NoticeRow, { item: item, theme: theme });
|
|
22
|
+
case "compacted":
|
|
23
|
+
return (_jsx(CompactedRow, { item: item, theme: theme, services: services, contentWidth: contentWidth, expanded: isItemExpanded(state, item), onToggle: () => {
|
|
24
|
+
// Ctrl+O / toggle: open pager (do not dump multi‑KB memory in chat).
|
|
25
|
+
const summary = item.summary;
|
|
26
|
+
const title = item.beforeTokens > 0 || item.afterTokens > 0
|
|
27
|
+
? `Compacted context · ~${item.beforeTokens.toLocaleString()} → ~${item.afterTokens.toLocaleString()} tokens`
|
|
28
|
+
: "Compacted context";
|
|
29
|
+
services.overlay.openPager(title, summary);
|
|
30
|
+
} }));
|
|
31
|
+
default: {
|
|
32
|
+
const unreachable = item;
|
|
33
|
+
throw new Error(`unhandled transcript item: ${JSON.stringify(unreachable)}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=transcript-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-row.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/transcript-row.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,cAAc,EAA6C,MAAM,iCAAiC,CAAC;AAE5G,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,UAAU,aAAa,CAAC,KAU7B;IACC,MAAM,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,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AQ,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,EACrC,QAAQ,EAAE,GAAG,EAAE;oBACb,qEAAqE;oBACrE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;oBAC7B,MAAM,KAAK,GACT,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC;wBAC3C,CAAC,CAAC,wBAAwB,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,SAAS;wBAC7G,CAAC,CAAC,mBAAmB,CAAC;oBAC1B,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;gBAC7C,CAAC,GACD,CACH,CAAC;QACJ,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,WAAW,GAAU,IAAI,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App-wide transcript scroll bridge.
|
|
3
|
+
*
|
|
4
|
+
* Wheel/trackpad events often land on the focused composer (or fail hit-test
|
|
5
|
+
* and fall back to it). Those events never bubble into the transcript
|
|
6
|
+
* ScrollBox, so scroll felt like “walking prompt history” instead of moving
|
|
7
|
+
* the chat. TranscriptView registers its native scrollbox here; App +
|
|
8
|
+
* Composer forward every free wheel event to this port.
|
|
9
|
+
*
|
|
10
|
+
* Selection drag uses the same port for edge autoscroll when the pointer
|
|
11
|
+
* leaves the scrollbox (e.g. over the composer) so “select down” keeps moving.
|
|
12
|
+
*
|
|
13
|
+
* Scroll metrics (lines above / below the viewport) feed the status bar badges
|
|
14
|
+
* that classic Ink showed under the input (`▲ N` / `▼ N`).
|
|
15
|
+
*/
|
|
16
|
+
export interface TranscriptScrollPort {
|
|
17
|
+
/** Scroll the chat by `dy` rows (negative = up). Returns false if unmounted. */
|
|
18
|
+
scrollBy(dy: number): boolean;
|
|
19
|
+
/** OpenTUI ScrollBox edge autoscroll while drag-selecting. */
|
|
20
|
+
updateAutoScroll(x: number, y: number): void;
|
|
21
|
+
stopAutoScroll(): void;
|
|
22
|
+
/** True when the live port is registered. */
|
|
23
|
+
readonly active: boolean;
|
|
24
|
+
/** Latest lines-above / lines-below metrics (classic status badges). */
|
|
25
|
+
readonly metrics: ScrollMetrics;
|
|
26
|
+
/** Subscribe to metric changes; fires immediately with the current value. */
|
|
27
|
+
onMetrics(listener: (metrics: ScrollMetrics) => void): () => void;
|
|
28
|
+
}
|
|
29
|
+
/** Classic-parity remaining-line counts for the status strip under the input. */
|
|
30
|
+
export interface ScrollMetrics {
|
|
31
|
+
/** Rows of transcript above the viewport (scroll further up to read). */
|
|
32
|
+
readonly linesAbove: number;
|
|
33
|
+
/** Rows of transcript below the viewport (scroll further down to catch up). */
|
|
34
|
+
readonly linesBelow: number;
|
|
35
|
+
}
|
|
36
|
+
export declare const EMPTY_SCROLL_METRICS: ScrollMetrics;
|
|
37
|
+
type Handler = (dy: number) => void;
|
|
38
|
+
type AutoScrollHandler = {
|
|
39
|
+
update(x: number, y: number): void;
|
|
40
|
+
stop(): void;
|
|
41
|
+
};
|
|
42
|
+
export declare const transcriptScrollPort: TranscriptScrollPort;
|
|
43
|
+
/** TranscriptView calls this on mount; returns an unregister function. */
|
|
44
|
+
export declare function registerTranscriptScrollPort(next: Handler): () => void;
|
|
45
|
+
/** Wire ScrollBox start/update/stop auto-scroll for selection edge scroll. */
|
|
46
|
+
export declare function registerTranscriptAutoScroll(next: AutoScrollHandler): () => void;
|
|
47
|
+
/**
|
|
48
|
+
* TranscriptView publishes viewport remainder so the status line can show
|
|
49
|
+
* classic `▲ N` / `▼ N` badges under the composer.
|
|
50
|
+
*/
|
|
51
|
+
export declare function publishTranscriptScrollMetrics(next: ScrollMetrics): void;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App-wide transcript scroll bridge.
|
|
3
|
+
*
|
|
4
|
+
* Wheel/trackpad events often land on the focused composer (or fail hit-test
|
|
5
|
+
* and fall back to it). Those events never bubble into the transcript
|
|
6
|
+
* ScrollBox, so scroll felt like “walking prompt history” instead of moving
|
|
7
|
+
* the chat. TranscriptView registers its native scrollbox here; App +
|
|
8
|
+
* Composer forward every free wheel event to this port.
|
|
9
|
+
*
|
|
10
|
+
* Selection drag uses the same port for edge autoscroll when the pointer
|
|
11
|
+
* leaves the scrollbox (e.g. over the composer) so “select down” keeps moving.
|
|
12
|
+
*
|
|
13
|
+
* Scroll metrics (lines above / below the viewport) feed the status bar badges
|
|
14
|
+
* that classic Ink showed under the input (`▲ N` / `▼ N`).
|
|
15
|
+
*/
|
|
16
|
+
export const EMPTY_SCROLL_METRICS = {
|
|
17
|
+
linesAbove: 0,
|
|
18
|
+
linesBelow: 0,
|
|
19
|
+
};
|
|
20
|
+
let handler;
|
|
21
|
+
let autoScroll;
|
|
22
|
+
let metrics = EMPTY_SCROLL_METRICS;
|
|
23
|
+
const metricListeners = new Set();
|
|
24
|
+
function publishMetrics(next) {
|
|
25
|
+
if (next.linesAbove === metrics.linesAbove &&
|
|
26
|
+
next.linesBelow === metrics.linesBelow) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
metrics = next;
|
|
30
|
+
for (const listener of metricListeners)
|
|
31
|
+
listener(metrics);
|
|
32
|
+
}
|
|
33
|
+
export const transcriptScrollPort = {
|
|
34
|
+
get active() {
|
|
35
|
+
return handler !== undefined;
|
|
36
|
+
},
|
|
37
|
+
get metrics() {
|
|
38
|
+
return metrics;
|
|
39
|
+
},
|
|
40
|
+
scrollBy(dy) {
|
|
41
|
+
if (!handler || dy === 0)
|
|
42
|
+
return false;
|
|
43
|
+
handler(dy);
|
|
44
|
+
return true;
|
|
45
|
+
},
|
|
46
|
+
updateAutoScroll(x, y) {
|
|
47
|
+
autoScroll?.update(x, y);
|
|
48
|
+
},
|
|
49
|
+
stopAutoScroll() {
|
|
50
|
+
autoScroll?.stop();
|
|
51
|
+
},
|
|
52
|
+
onMetrics(listener) {
|
|
53
|
+
metricListeners.add(listener);
|
|
54
|
+
listener(metrics);
|
|
55
|
+
return () => {
|
|
56
|
+
metricListeners.delete(listener);
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
/** TranscriptView calls this on mount; returns an unregister function. */
|
|
61
|
+
export function registerTranscriptScrollPort(next) {
|
|
62
|
+
handler = next;
|
|
63
|
+
return () => {
|
|
64
|
+
if (handler === next)
|
|
65
|
+
handler = undefined;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** Wire ScrollBox start/update/stop auto-scroll for selection edge scroll. */
|
|
69
|
+
export function registerTranscriptAutoScroll(next) {
|
|
70
|
+
autoScroll = next;
|
|
71
|
+
return () => {
|
|
72
|
+
if (autoScroll === next)
|
|
73
|
+
autoScroll = undefined;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* TranscriptView publishes viewport remainder so the status line can show
|
|
78
|
+
* classic `▲ N` / `▼ N` badges under the composer.
|
|
79
|
+
*/
|
|
80
|
+
export function publishTranscriptScrollMetrics(next) {
|
|
81
|
+
publishMetrics({
|
|
82
|
+
linesAbove: Math.max(0, Math.floor(next.linesAbove)),
|
|
83
|
+
linesBelow: Math.max(0, Math.floor(next.linesBelow)),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=transcript-scroll-port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-scroll-port.js","sourceRoot":"","sources":["../../../../src/tui-v2/components/transcript/transcript-scroll-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwBH,MAAM,CAAC,MAAM,oBAAoB,GAAkB;IACjD,UAAU,EAAE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IAAa;IACxD,OAAO,GAAG,IAAI,CAAC;IACf,OAAO,GAAG,EAAE;QACV,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,GAAG,SAAS,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,4BAA4B,CAAC,IAAuB;IAClE,UAAU,GAAG,IAAI,CAAC;IAClB,OAAO,GAAG,EAAE;QACV,IAAI,UAAU,KAAK,IAAI;YAAE,UAAU,GAAG,SAAS,CAAC;IAClD,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,IAAmB;IAChE,cAAc,CAAC;QACb,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACpD,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KACrD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/react */
|
|
2
|
+
/**
|
|
3
|
+
* Chat pane: virtualized, auto-following transcript (V2-050, 056, 057).
|
|
4
|
+
*
|
|
5
|
+
* Auto-follow uses OpenTUI ScrollBox `stickyScroll` + `stickyStart="bottom"`
|
|
6
|
+
* so new rows and growing stream text pin the viewport to the latest content.
|
|
7
|
+
* Manual scroll-up suspends follow (library `_hasManualScroll`); scrolling back
|
|
8
|
+
* to the bottom or a new user prompt re-engages. We still call pinToBottom on
|
|
9
|
+
* content changes as a belt-and-suspenders for layout races.
|
|
10
|
+
*/
|
|
11
|
+
import { type ReactNode } from "react";
|
|
12
|
+
import type { AppServices } from "../../bootstrap/composition-root.js";
|
|
13
|
+
import type { Theme } from "../../rendering/theme.js";
|
|
14
|
+
export interface TranscriptViewProps {
|
|
15
|
+
readonly services: AppServices;
|
|
16
|
+
readonly theme: Theme;
|
|
17
|
+
readonly focused: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Available content columns for the chat pane (not full terminal). Used for
|
|
20
|
+
* the intro card and markdown wrap (tables reflow when the plan pane is open).
|
|
21
|
+
*/
|
|
22
|
+
readonly contentWidth?: number | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare function TranscriptView(props: TranscriptViewProps): ReactNode;
|