@aragon-agent/tui 0.0.0-stage → 0.0.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/CHANGELOG.md +27 -0
- package/LICENSE +21 -0
- package/README.md +81 -2
- package/dist/index.d.ts +11 -0
- package/dist/index.js +11 -0
- package/dist/input/control-sequences.d.ts +71 -0
- package/dist/input/control-sequences.js +222 -0
- package/dist/input/csiu-keys.d.ts +66 -0
- package/dist/input/csiu-keys.js +181 -0
- package/dist/input/cursor-report.d.ts +61 -0
- package/dist/input/cursor-report.js +97 -0
- package/dist/input/enter-sequences.d.ts +64 -0
- package/dist/input/enter-sequences.js +153 -0
- package/dist/input/interrupt-gesture.d.ts +18 -0
- package/dist/input/interrupt-gesture.js +19 -0
- package/dist/input/keyboard-enhancement.d.ts +42 -0
- package/dist/input/keyboard-enhancement.js +65 -0
- package/dist/input/keymap.d.ts +20 -0
- package/dist/input/keymap.js +99 -0
- package/dist/input/limits.d.ts +118 -0
- package/dist/input/limits.js +109 -0
- package/dist/input/mouse-events.d.ts +87 -0
- package/dist/input/mouse-events.js +212 -0
- package/dist/input/paste-parse.d.ts +83 -0
- package/dist/input/paste-parse.js +107 -0
- package/dist/input/pointer-router.d.ts +11 -0
- package/dist/input/pointer-router.js +14 -0
- package/dist/input/stdin-filter.d.ts +112 -0
- package/dist/input/stdin-filter.js +657 -0
- package/dist/input/win32-input-mode.d.ts +61 -0
- package/dist/input/win32-input-mode.js +269 -0
- package/dist/model/agent/agent-mode.d.ts +108 -0
- package/dist/model/agent/agent-mode.js +121 -0
- package/dist/model/agent/entry-limits.d.ts +65 -0
- package/dist/model/agent/entry-limits.js +133 -0
- package/dist/model/agent/governance-view.d.ts +40 -0
- package/dist/model/agent/governance-view.js +40 -0
- package/dist/model/agent/invocation-card.d.ts +77 -0
- package/dist/model/agent/invocation-card.js +169 -0
- package/dist/model/agent/model-probe-limits.d.ts +39 -0
- package/dist/model/agent/model-probe-limits.js +25 -0
- package/dist/model/agent/model-probe.d.ts +104 -0
- package/dist/model/agent/model-probe.js +391 -0
- package/dist/model/agent/queued-messages.d.ts +23 -0
- package/dist/model/agent/queued-messages.js +49 -0
- package/dist/model/agent/reducer.d.ts +857 -0
- package/dist/model/agent/reducer.js +1646 -0
- package/dist/model/agent/retry-view.d.ts +68 -0
- package/dist/model/agent/retry-view.js +95 -0
- package/dist/model/agent/usage.d.ts +47 -0
- package/dist/model/agent/usage.js +84 -0
- package/dist/model/compaction/limits.d.ts +61 -0
- package/dist/model/compaction/limits.js +64 -0
- package/dist/model/compaction/meter.d.ts +276 -0
- package/dist/model/compaction/meter.js +512 -0
- package/dist/model/compaction/pressure.d.ts +163 -0
- package/dist/model/compaction/pressure.js +199 -0
- package/dist/model/compaction/reason-text.d.ts +36 -0
- package/dist/model/compaction/reason-text.js +78 -0
- package/dist/model/compaction/types.d.ts +360 -0
- package/dist/model/compaction/types.js +22 -0
- package/dist/model/config/governance-config.d.ts +125 -0
- package/dist/model/config/governance-config.js +164 -0
- package/dist/model/config/kit-resolution.d.ts +93 -0
- package/dist/model/config/kit-resolution.js +226 -0
- package/dist/model/config/model-kits.d.ts +225 -0
- package/dist/model/config/model-kits.js +302 -0
- package/dist/model/config/model-profile-resolution.d.ts +28 -0
- package/dist/model/config/model-profile-resolution.js +88 -0
- package/dist/model/config/model-profiles.d.ts +103 -0
- package/dist/model/config/model-profiles.js +188 -0
- package/dist/model/config/model-settings-types.d.ts +71 -0
- package/dist/model/config/model-settings-types.js +18 -0
- package/dist/model/config/schema.d.ts +1645 -0
- package/dist/model/config/schema.js +1383 -0
- package/dist/model/fast/limits.d.ts +152 -0
- package/dist/model/fast/limits.js +152 -0
- package/dist/model/fast/resolve.d.ts +44 -0
- package/dist/model/fast/resolve.js +107 -0
- package/dist/model/fast/task-summary-types.d.ts +66 -0
- package/dist/model/fast/task-summary-types.js +17 -0
- package/dist/model/fast/types.d.ts +141 -0
- package/dist/model/fast/types.js +14 -0
- package/dist/model/governance/governed-dispatch.d.ts +19 -0
- package/dist/model/governance/governed-dispatch.js +17 -0
- package/dist/model/governance/limits.d.ts +107 -0
- package/dist/model/governance/limits.js +131 -0
- package/dist/model/governance/posture.d.ts +35 -0
- package/dist/model/governance/posture.js +59 -0
- package/dist/model/governance/rules/events-table.d.ts +46 -0
- package/dist/model/governance/rules/events-table.js +94 -0
- package/dist/model/governance/types.d.ts +661 -0
- package/dist/model/governance/types.js +27 -0
- package/dist/model/logging/levels.d.ts +40 -0
- package/dist/model/logging/levels.js +59 -0
- package/dist/model/logging/log-port.d.ts +38 -0
- package/dist/model/logging/log-port.js +41 -0
- package/dist/model/logging/secret-registry.d.ts +32 -0
- package/dist/model/logging/secret-registry.js +73 -0
- package/dist/model/proc/limits.d.ts +214 -0
- package/dist/model/proc/limits.js +221 -0
- package/dist/model/proc/progress.d.ts +47 -0
- package/dist/model/proc/progress.js +163 -0
- package/dist/model/proc/types.d.ts +269 -0
- package/dist/model/proc/types.js +15 -0
- package/dist/model/proc/wait-view.d.ts +65 -0
- package/dist/model/proc/wait-view.js +66 -0
- package/dist/model/prompts/copy.d.ts +89 -0
- package/dist/model/prompts/copy.js +131 -0
- package/dist/model/prompts/fill.d.ts +51 -0
- package/dist/model/prompts/fill.js +46 -0
- package/dist/model/prompts/limits.d.ts +53 -0
- package/dist/model/prompts/limits.js +53 -0
- package/dist/model/prompts/search.d.ts +58 -0
- package/dist/model/prompts/search.js +146 -0
- package/dist/model/prompts/types.d.ts +204 -0
- package/dist/model/prompts/types.js +13 -0
- package/dist/model/prompts/validate.d.ts +22 -0
- package/dist/model/prompts/validate.js +69 -0
- package/dist/model/team/activity.d.ts +67 -0
- package/dist/model/team/activity.js +130 -0
- package/dist/model/team/limits.d.ts +308 -0
- package/dist/model/team/limits.js +330 -0
- package/dist/model/team/model.d.ts +104 -0
- package/dist/model/team/model.js +150 -0
- package/dist/model/team/panel-rows.d.ts +48 -0
- package/dist/model/team/panel-rows.js +75 -0
- package/dist/model/team/timeline.d.ts +74 -0
- package/dist/model/team/timeline.js +101 -0
- package/dist/model/team/types.d.ts +354 -0
- package/dist/model/team/types.js +13 -0
- package/dist/model/todo/acceptance.d.ts +120 -0
- package/dist/model/todo/acceptance.js +399 -0
- package/dist/model/todo/follow-through.d.ts +138 -0
- package/dist/model/todo/follow-through.js +248 -0
- package/dist/model/todo/limits.d.ts +152 -0
- package/dist/model/todo/limits.js +152 -0
- package/dist/model/todo/panel-rows.d.ts +45 -0
- package/dist/model/todo/panel-rows.js +70 -0
- package/dist/model/todo/plan-sections.d.ts +60 -0
- package/dist/model/todo/plan-sections.js +108 -0
- package/dist/model/todo/row-window.d.ts +51 -0
- package/dist/model/todo/row-window.js +107 -0
- package/dist/model/todo/types.d.ts +124 -0
- package/dist/model/todo/types.js +12 -0
- package/dist/model/tools/human-input.d.ts +212 -0
- package/dist/model/tools/human-input.js +265 -0
- package/dist/model/tools/patch.d.ts +115 -0
- package/dist/model/tools/patch.js +453 -0
- package/dist/model/tools/terminal-output.d.ts +115 -0
- package/dist/model/tools/terminal-output.js +201 -0
- package/dist/model/tools/tool-output-store.d.ts +68 -0
- package/dist/model/tools/tool-output-store.js +102 -0
- package/dist/model/update/limits.d.ts +111 -0
- package/dist/model/update/limits.js +111 -0
- package/dist/model/update/semver.d.ts +89 -0
- package/dist/model/update/semver.js +295 -0
- package/dist/model/update/types.d.ts +169 -0
- package/dist/model/update/types.js +68 -0
- package/dist/testing/governance-fixtures.d.ts +13 -0
- package/dist/testing/governance-fixtures.js +98 -0
- package/dist/testing/mini-vt.d.ts +28 -0
- package/dist/testing/mini-vt.js +158 -0
- package/dist/testing/render-at-width.d.ts +16 -0
- package/dist/testing/render-at-width.js +57 -0
- package/dist/testing/terminal-harness.d.ts +15 -0
- package/dist/testing/terminal-harness.js +40 -0
- package/dist/testing/vt-screen.d.ts +28 -0
- package/dist/testing/vt-screen.js +139 -0
- package/dist/ui/ActivityLine.d.ts +26 -0
- package/dist/ui/ActivityLine.js +51 -0
- package/dist/ui/AutocompletePopup.d.ts +23 -0
- package/dist/ui/AutocompletePopup.js +17 -0
- package/dist/ui/BottomStatusRow.d.ts +10 -0
- package/dist/ui/BottomStatusRow.js +9 -0
- package/dist/ui/Composer.d.ts +115 -0
- package/dist/ui/Composer.js +64 -0
- package/dist/ui/GovernancePanel.d.ts +50 -0
- package/dist/ui/GovernancePanel.js +77 -0
- package/dist/ui/GovernanceRun.d.ts +18 -0
- package/dist/ui/GovernanceRun.js +11 -0
- package/dist/ui/Header.d.ts +48 -0
- package/dist/ui/Header.js +27 -0
- package/dist/ui/Logo.d.ts +32 -0
- package/dist/ui/Logo.js +65 -0
- package/dist/ui/Markdown.d.ts +29 -0
- package/dist/ui/Markdown.js +116 -0
- package/dist/ui/PromptCaret.d.ts +11 -0
- package/dist/ui/PromptCaret.js +31 -0
- package/dist/ui/PromptInput.d.ts +192 -0
- package/dist/ui/PromptInput.js +689 -0
- package/dist/ui/QueuePanel.d.ts +8 -0
- package/dist/ui/QueuePanel.js +9 -0
- package/dist/ui/QueueStatusRow.d.ts +24 -0
- package/dist/ui/QueueStatusRow.js +51 -0
- package/dist/ui/ScrollbackShell.d.ts +132 -0
- package/dist/ui/ScrollbackShell.js +26 -0
- package/dist/ui/SessionOpener.d.ts +30 -0
- package/dist/ui/SessionOpener.js +12 -0
- package/dist/ui/StatusBar.d.ts +130 -0
- package/dist/ui/StatusBar.js +61 -0
- package/dist/ui/TeamPanel.d.ts +76 -0
- package/dist/ui/TeamPanel.js +103 -0
- package/dist/ui/ToastStack.d.ts +8 -0
- package/dist/ui/ToastStack.js +31 -0
- package/dist/ui/TodoPanel.d.ts +52 -0
- package/dist/ui/TodoPanel.js +214 -0
- package/dist/ui/Transcript.d.ts +105 -0
- package/dist/ui/Transcript.js +258 -0
- package/dist/ui/UpdateLine.d.ts +44 -0
- package/dist/ui/UpdateLine.js +129 -0
- package/dist/ui/activity-phrases.d.ts +33 -0
- package/dist/ui/activity-phrases.js +50 -0
- package/dist/ui/capabilities.d.ts +27 -0
- package/dist/ui/capabilities.js +65 -0
- package/dist/ui/clipboard-task.d.ts +29 -0
- package/dist/ui/clipboard-task.js +66 -0
- package/dist/ui/clipboard.d.ts +31 -0
- package/dist/ui/clipboard.js +157 -0
- package/dist/ui/color-runtime.d.ts +5 -0
- package/dist/ui/color-runtime.js +29 -0
- package/dist/ui/composer-input.d.ts +38 -0
- package/dist/ui/composer-input.js +79 -0
- package/dist/ui/composer-limits.d.ts +30 -0
- package/dist/ui/composer-limits.js +45 -0
- package/dist/ui/composer-rows.d.ts +73 -0
- package/dist/ui/composer-rows.js +129 -0
- package/dist/ui/console-bridge.d.ts +19 -0
- package/dist/ui/console-bridge.js +52 -0
- package/dist/ui/density.d.ts +26 -0
- package/dist/ui/density.js +34 -0
- package/dist/ui/display-tab.d.ts +51 -0
- package/dist/ui/display-tab.js +82 -0
- package/dist/ui/editor-navigation.d.ts +55 -0
- package/dist/ui/editor-navigation.js +96 -0
- package/dist/ui/editor-reducer.d.ts +108 -0
- package/dist/ui/editor-reducer.js +187 -0
- package/dist/ui/enter-frames.d.ts +47 -0
- package/dist/ui/enter-frames.js +117 -0
- package/dist/ui/entries/AssistantEntry.d.ts +37 -0
- package/dist/ui/entries/AssistantEntry.js +43 -0
- package/dist/ui/entries/CompactionCard.d.ts +88 -0
- package/dist/ui/entries/CompactionCard.js +222 -0
- package/dist/ui/entries/DiffView.d.ts +61 -0
- package/dist/ui/entries/DiffView.js +103 -0
- package/dist/ui/entries/EntryFrame.d.ts +23 -0
- package/dist/ui/entries/EntryFrame.js +6 -0
- package/dist/ui/entries/FastCard.d.ts +53 -0
- package/dist/ui/entries/FastCard.js +105 -0
- package/dist/ui/entries/GovernanceCard.d.ts +30 -0
- package/dist/ui/entries/GovernanceCard.js +32 -0
- package/dist/ui/entries/InvocationCard.d.ts +20 -0
- package/dist/ui/entries/InvocationCard.js +32 -0
- package/dist/ui/entries/QueuedEntry.d.ts +27 -0
- package/dist/ui/entries/QueuedEntry.js +33 -0
- package/dist/ui/entries/RetryCard.d.ts +56 -0
- package/dist/ui/entries/RetryCard.js +60 -0
- package/dist/ui/entries/ServiceCard.d.ts +82 -0
- package/dist/ui/entries/ServiceCard.js +151 -0
- package/dist/ui/entries/TeamCard.d.ts +55 -0
- package/dist/ui/entries/TeamCard.js +94 -0
- package/dist/ui/entries/TodoCard.d.ts +54 -0
- package/dist/ui/entries/TodoCard.js +98 -0
- package/dist/ui/entries/ToolCard.d.ts +81 -0
- package/dist/ui/entries/ToolCard.js +169 -0
- package/dist/ui/entries/ToolPreview.d.ts +59 -0
- package/dist/ui/entries/ToolPreview.js +208 -0
- package/dist/ui/entries/UserEntry.d.ts +36 -0
- package/dist/ui/entries/UserEntry.js +57 -0
- package/dist/ui/entries/WaitCard.d.ts +37 -0
- package/dist/ui/entries/WaitCard.js +92 -0
- package/dist/ui/exit-snapshot.d.ts +43 -0
- package/dist/ui/exit-snapshot.js +26 -0
- package/dist/ui/frame-differ.d.ts +166 -0
- package/dist/ui/frame-differ.js +354 -0
- package/dist/ui/frame-observer.d.ts +17 -0
- package/dist/ui/frame-observer.js +94 -0
- package/dist/ui/frame-parser.d.ts +7 -0
- package/dist/ui/frame-parser.js +18 -0
- package/dist/ui/gauge.d.ts +39 -0
- package/dist/ui/gauge.js +55 -0
- package/dist/ui/glyphs.d.ts +178 -0
- package/dist/ui/glyphs.js +165 -0
- package/dist/ui/governance-copy.d.ts +69 -0
- package/dist/ui/governance-copy.js +104 -0
- package/dist/ui/governance-status.d.ts +145 -0
- package/dist/ui/governance-status.js +326 -0
- package/dist/ui/gradient.d.ts +11 -0
- package/dist/ui/gradient.js +50 -0
- package/dist/ui/ink-runtime.d.ts +4 -0
- package/dist/ui/ink-runtime.js +51 -0
- package/dist/ui/interaction-copy.d.ts +84 -0
- package/dist/ui/interaction-copy.js +41 -0
- package/dist/ui/interaction-hints.d.ts +44 -0
- package/dist/ui/interaction-hints.js +97 -0
- package/dist/ui/layout/AppShell.d.ts +17 -0
- package/dist/ui/layout/AppShell.js +6 -0
- package/dist/ui/layout/Gutter.d.ts +67 -0
- package/dist/ui/layout/Gutter.js +42 -0
- package/dist/ui/layout/MeasuredEntry.d.ts +21 -0
- package/dist/ui/layout/MeasuredEntry.js +30 -0
- package/dist/ui/layout/OverlayFrame.d.ts +73 -0
- package/dist/ui/layout/OverlayFrame.js +110 -0
- package/dist/ui/layout/ScrollIndicator.d.ts +32 -0
- package/dist/ui/layout/ScrollIndicator.js +22 -0
- package/dist/ui/layout/ScrollViewport.d.ts +40 -0
- package/dist/ui/layout/ScrollViewport.js +222 -0
- package/dist/ui/layout/agents-board.d.ts +102 -0
- package/dist/ui/layout/agents-board.js +389 -0
- package/dist/ui/layout/autocomplete.d.ts +18 -0
- package/dist/ui/layout/autocomplete.js +26 -0
- package/dist/ui/layout/budget.d.ts +43 -0
- package/dist/ui/layout/budget.js +52 -0
- package/dist/ui/layout/cells.d.ts +61 -0
- package/dist/ui/layout/cells.js +156 -0
- package/dist/ui/layout/document-layout.d.ts +13 -0
- package/dist/ui/layout/document-layout.js +10 -0
- package/dist/ui/layout/follow-state.d.ts +138 -0
- package/dist/ui/layout/follow-state.js +148 -0
- package/dist/ui/layout/frame.d.ts +36 -0
- package/dist/ui/layout/frame.js +39 -0
- package/dist/ui/layout/governance-board.d.ts +121 -0
- package/dist/ui/layout/governance-board.js +382 -0
- package/dist/ui/layout/governance-card.d.ts +53 -0
- package/dist/ui/layout/governance-card.js +134 -0
- package/dist/ui/layout/governance-chip.d.ts +38 -0
- package/dist/ui/layout/governance-chip.js +64 -0
- package/dist/ui/layout/governance-panel.d.ts +85 -0
- package/dist/ui/layout/governance-panel.js +358 -0
- package/dist/ui/layout/governance-roster.d.ts +65 -0
- package/dist/ui/layout/governance-roster.js +275 -0
- package/dist/ui/layout/header-hints.d.ts +90 -0
- package/dist/ui/layout/header-hints.js +110 -0
- package/dist/ui/layout/header-left.d.ts +115 -0
- package/dist/ui/layout/header-left.js +206 -0
- package/dist/ui/layout/invocation-card.d.ts +41 -0
- package/dist/ui/layout/invocation-card.js +91 -0
- package/dist/ui/layout/kit-chip.d.ts +50 -0
- package/dist/ui/layout/kit-chip.js +81 -0
- package/dist/ui/layout/overlay-window.d.ts +43 -0
- package/dist/ui/layout/overlay-window.js +51 -0
- package/dist/ui/layout/queue-layout.d.ts +19 -0
- package/dist/ui/layout/queue-layout.js +26 -0
- package/dist/ui/layout/rail.d.ts +7 -0
- package/dist/ui/layout/rail.js +16 -0
- package/dist/ui/layout/scroll-indicator.d.ts +27 -0
- package/dist/ui/layout/scroll-indicator.js +36 -0
- package/dist/ui/layout/scroll.d.ts +37 -0
- package/dist/ui/layout/scroll.js +99 -0
- package/dist/ui/layout/scrollbar-geometry.d.ts +17 -0
- package/dist/ui/layout/scrollbar-geometry.js +13 -0
- package/dist/ui/layout/session-chip.d.ts +52 -0
- package/dist/ui/layout/session-chip.js +64 -0
- package/dist/ui/layout/shortcut-panel-layout.d.ts +191 -0
- package/dist/ui/layout/shortcut-panel-layout.js +321 -0
- package/dist/ui/layout/status-detail-layout.d.ts +9 -0
- package/dist/ui/layout/status-detail-layout.js +79 -0
- package/dist/ui/layout/status-layout.d.ts +140 -0
- package/dist/ui/layout/status-layout.js +262 -0
- package/dist/ui/layout/task-summary-cell.d.ts +61 -0
- package/dist/ui/layout/task-summary-cell.js +65 -0
- package/dist/ui/layout/team-panel.d.ts +18 -0
- package/dist/ui/layout/team-panel.js +25 -0
- package/dist/ui/layout/team-row.d.ts +139 -0
- package/dist/ui/layout/team-row.js +246 -0
- package/dist/ui/layout/todo-layout.d.ts +62 -0
- package/dist/ui/layout/todo-layout.js +102 -0
- package/dist/ui/layout/useTerminalSize.d.ts +13 -0
- package/dist/ui/layout/useTerminalSize.js +50 -0
- package/dist/ui/layout/viewport-geometry.d.ts +29 -0
- package/dist/ui/layout/viewport-geometry.js +28 -0
- package/dist/ui/layout/virtual-window.d.ts +112 -0
- package/dist/ui/layout/virtual-window.js +494 -0
- package/dist/ui/layout/wait-bar.d.ts +34 -0
- package/dist/ui/layout/wait-bar.js +48 -0
- package/dist/ui/layout/wrap-rows.d.ts +26 -0
- package/dist/ui/layout/wrap-rows.js +88 -0
- package/dist/ui/live-clamp.d.ts +14 -0
- package/dist/ui/live-clamp.js +46 -0
- package/dist/ui/markdown-blocks.d.ts +107 -0
- package/dist/ui/markdown-blocks.js +240 -0
- package/dist/ui/overlays/AgentsBoardOverlay.d.ts +57 -0
- package/dist/ui/overlays/AgentsBoardOverlay.js +183 -0
- package/dist/ui/overlays/ConfirmDialog.d.ts +31 -0
- package/dist/ui/overlays/ConfirmDialog.js +44 -0
- package/dist/ui/overlays/GovernanceBoardOverlay.d.ts +41 -0
- package/dist/ui/overlays/GovernanceBoardOverlay.js +76 -0
- package/dist/ui/overlays/GovernanceSettingsPage.d.ts +48 -0
- package/dist/ui/overlays/GovernanceSettingsPage.js +93 -0
- package/dist/ui/overlays/HelpOverlay.d.ts +29 -0
- package/dist/ui/overlays/HelpOverlay.js +232 -0
- package/dist/ui/overlays/KitEditor.d.ts +23 -0
- package/dist/ui/overlays/KitEditor.js +101 -0
- package/dist/ui/overlays/KitManager.d.ts +23 -0
- package/dist/ui/overlays/KitManager.js +104 -0
- package/dist/ui/overlays/KitPicker.d.ts +49 -0
- package/dist/ui/overlays/KitPicker.js +58 -0
- package/dist/ui/overlays/ModelDiscoveryList.d.ts +23 -0
- package/dist/ui/overlays/ModelDiscoveryList.js +161 -0
- package/dist/ui/overlays/ModelPicker.d.ts +26 -0
- package/dist/ui/overlays/ModelPicker.js +63 -0
- package/dist/ui/overlays/ModelProfileEditor.d.ts +29 -0
- package/dist/ui/overlays/ModelProfileEditor.js +168 -0
- package/dist/ui/overlays/ModelProfilePicker.d.ts +48 -0
- package/dist/ui/overlays/ModelProfilePicker.js +231 -0
- package/dist/ui/overlays/PlanReviewOverlay.d.ts +51 -0
- package/dist/ui/overlays/PlanReviewOverlay.js +132 -0
- package/dist/ui/overlays/PromptEditorPage.d.ts +48 -0
- package/dist/ui/overlays/PromptEditorPage.js +227 -0
- package/dist/ui/overlays/PromptLibraryOverlay.d.ts +37 -0
- package/dist/ui/overlays/PromptLibraryOverlay.js +191 -0
- package/dist/ui/overlays/PromptPicker.d.ts +36 -0
- package/dist/ui/overlays/PromptPicker.js +129 -0
- package/dist/ui/overlays/PromptTextArea.d.ts +86 -0
- package/dist/ui/overlays/PromptTextArea.js +141 -0
- package/dist/ui/overlays/QuestionOverlay.d.ts +39 -0
- package/dist/ui/overlays/QuestionOverlay.js +258 -0
- package/dist/ui/overlays/QueueOverlay.d.ts +22 -0
- package/dist/ui/overlays/QueueOverlay.js +79 -0
- package/dist/ui/overlays/SettingsScreen.d.ts +228 -0
- package/dist/ui/overlays/SettingsScreen.js +1037 -0
- package/dist/ui/overlays/ShortcutPanel.d.ts +39 -0
- package/dist/ui/overlays/ShortcutPanel.js +106 -0
- package/dist/ui/overlays/TeamFanoutPage.d.ts +51 -0
- package/dist/ui/overlays/TeamFanoutPage.js +90 -0
- package/dist/ui/overlays/governance-settings.d.ts +79 -0
- package/dist/ui/overlays/governance-settings.js +140 -0
- package/dist/ui/overlays/kit-picker-state.d.ts +87 -0
- package/dist/ui/overlays/kit-picker-state.js +136 -0
- package/dist/ui/overlays/kit-settings-state.d.ts +129 -0
- package/dist/ui/overlays/kit-settings-state.js +268 -0
- package/dist/ui/overlays/model-probe-view.d.ts +128 -0
- package/dist/ui/overlays/model-probe-view.js +225 -0
- package/dist/ui/overlays/model-profile-state.d.ts +177 -0
- package/dist/ui/overlays/model-profile-state.js +301 -0
- package/dist/ui/overlays/prompt-library-state.d.ts +162 -0
- package/dist/ui/overlays/prompt-library-state.js +335 -0
- package/dist/ui/overlays/prompt-picker-state.d.ts +71 -0
- package/dist/ui/overlays/prompt-picker-state.js +98 -0
- package/dist/ui/overlays/team-fanout-state.d.ts +106 -0
- package/dist/ui/overlays/team-fanout-state.js +155 -0
- package/dist/ui/overlays/use-model-probe.d.ts +30 -0
- package/dist/ui/overlays/use-model-probe.js +109 -0
- package/dist/ui/palettes.d.ts +112 -0
- package/dist/ui/palettes.js +130 -0
- package/dist/ui/paste-frames.d.ts +91 -0
- package/dist/ui/paste-frames.js +117 -0
- package/dist/ui/paste-tokens.d.ts +90 -0
- package/dist/ui/paste-tokens.js +147 -0
- package/dist/ui/render-cache.d.ts +81 -0
- package/dist/ui/render-cache.js +196 -0
- package/dist/ui/render-governor.d.ts +54 -0
- package/dist/ui/render-governor.js +78 -0
- package/dist/ui/run-metrics.d.ts +23 -0
- package/dist/ui/run-metrics.js +27 -0
- package/dist/ui/run-status-row.d.ts +63 -0
- package/dist/ui/run-status-row.js +54 -0
- package/dist/ui/screen.d.ts +107 -0
- package/dist/ui/screen.js +234 -0
- package/dist/ui/scrollback/LiveTail.d.ts +115 -0
- package/dist/ui/scrollback/LiveTail.js +48 -0
- package/dist/ui/scrollback/band.d.ts +114 -0
- package/dist/ui/scrollback/band.js +143 -0
- package/dist/ui/scrollback/budget.d.ts +90 -0
- package/dist/ui/scrollback/budget.js +100 -0
- package/dist/ui/scrollback/canvas.d.ts +100 -0
- package/dist/ui/scrollback/canvas.js +114 -0
- package/dist/ui/scrollback/cursor-probe.d.ts +71 -0
- package/dist/ui/scrollback/cursor-probe.js +133 -0
- package/dist/ui/scrollback/drain.d.ts +32 -0
- package/dist/ui/scrollback/drain.js +64 -0
- package/dist/ui/scrollback/exit-summary.d.ts +23 -0
- package/dist/ui/scrollback/exit-summary.js +25 -0
- package/dist/ui/scrollback/limits.d.ts +98 -0
- package/dist/ui/scrollback/limits.js +98 -0
- package/dist/ui/scrollback/live-preview.d.ts +34 -0
- package/dist/ui/scrollback/live-preview.js +130 -0
- package/dist/ui/scrollback/overflow-print.d.ts +108 -0
- package/dist/ui/scrollback/overflow-print.js +120 -0
- package/dist/ui/scrollback/renderer.d.ts +48 -0
- package/dist/ui/scrollback/renderer.js +186 -0
- package/dist/ui/scrollback/scrollback-writer.d.ts +174 -0
- package/dist/ui/scrollback/scrollback-writer.js +648 -0
- package/dist/ui/scrollback/settled-boundary.d.ts +42 -0
- package/dist/ui/scrollback/settled-boundary.js +109 -0
- package/dist/ui/scrollback/tail-anchor.d.ts +71 -0
- package/dist/ui/scrollback/tail-anchor.js +79 -0
- package/dist/ui/scrollback/tail-window.d.ts +73 -0
- package/dist/ui/scrollback/tail-window.js +89 -0
- package/dist/ui/scrollback/use-scrollback-view.d.ts +139 -0
- package/dist/ui/scrollback/use-scrollback-view.js +601 -0
- package/dist/ui/scrollback/writer-shapes.d.ts +127 -0
- package/dist/ui/scrollback/writer-shapes.js +159 -0
- package/dist/ui/scrollbar-controller.d.ts +30 -0
- package/dist/ui/scrollbar-controller.js +124 -0
- package/dist/ui/selection/highlight.d.ts +39 -0
- package/dist/ui/selection/highlight.js +64 -0
- package/dist/ui/selection/screen-mirror.d.ts +24 -0
- package/dist/ui/selection/screen-mirror.js +35 -0
- package/dist/ui/selection/selection-controller.d.ts +104 -0
- package/dist/ui/selection/selection-controller.js +372 -0
- package/dist/ui/selection/selection.d.ts +90 -0
- package/dist/ui/selection/selection.js +223 -0
- package/dist/ui/shortcuts.d.ts +81 -0
- package/dist/ui/shortcuts.js +221 -0
- package/dist/ui/status-feedback.d.ts +35 -0
- package/dist/ui/status-feedback.js +38 -0
- package/dist/ui/stdout-frame-writer.d.ts +74 -0
- package/dist/ui/stdout-frame-writer.js +155 -0
- package/dist/ui/team-status.d.ts +166 -0
- package/dist/ui/team-status.js +252 -0
- package/dist/ui/terminal-plan.d.ts +52 -0
- package/dist/ui/terminal-plan.js +49 -0
- package/dist/ui/theme.d.ts +96 -0
- package/dist/ui/theme.js +130 -0
- package/dist/ui/transcript-text.d.ts +41 -0
- package/dist/ui/transcript-text.js +282 -0
- package/dist/ui/use-height-store.d.ts +31 -0
- package/dist/ui/use-height-store.js +76 -0
- package/dist/ui/use-render-governor.d.ts +39 -0
- package/dist/ui/use-render-governor.js +57 -0
- package/dist/ui/use-wheel-routing.d.ts +57 -0
- package/dist/ui/use-wheel-routing.js +152 -0
- package/dist/ui/win-vt-force.d.ts +136 -0
- package/dist/ui/win-vt-force.js +237 -0
- package/dist/ui/win-vt-input.d.ts +57 -0
- package/dist/ui/win-vt-input.js +62 -0
- package/package.json +86 -4
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { pickGlyphs } from './glyphs.js';
|
|
4
|
+
import { railBorderProps } from './layout/Gutter.js';
|
|
5
|
+
import { highlightCached, parseMarkdownCached } from './render-cache.js';
|
|
6
|
+
import { formatTable, isRule, parseHeading, parseInline, } from './markdown-blocks.js';
|
|
7
|
+
/** Width of the `---` rule. Fixed so it cannot force a wrap on narrow frames. */
|
|
8
|
+
const RULE_WIDTH = 24;
|
|
9
|
+
export function Markdown({ text, theme, caps }) {
|
|
10
|
+
const glyphs = pickGlyphs(caps);
|
|
11
|
+
const blocks = parseMarkdownCached(text);
|
|
12
|
+
return (_jsx(Box, { flexDirection: "column", children: blocks.map((block, i) => renderBlock(block, i, theme, glyphs)) }));
|
|
13
|
+
}
|
|
14
|
+
function renderBlock(block, key, theme, glyphs) {
|
|
15
|
+
switch (block.kind) {
|
|
16
|
+
case 'code':
|
|
17
|
+
return (_jsx(CodeBlock, { code: block.code, lang: block.lang, theme: theme, glyphs: glyphs }, `b${key}`));
|
|
18
|
+
case 'table': {
|
|
19
|
+
// Glyphs are injected rather than hardcoded: this module is inside the
|
|
20
|
+
// ASCII-only scan, and the pure parser defaults to ASCII `|` / `-`.
|
|
21
|
+
const formatted = formatTable(block.rows, block.align, {
|
|
22
|
+
separator: glyphs.railVertical,
|
|
23
|
+
rule: glyphs.hrule,
|
|
24
|
+
});
|
|
25
|
+
return (_jsx(Box, { flexDirection: "column", children: formatted.map((row, r) => (_jsx(Text, { wrap: "truncate", bold: r === 0, color: tableRowColor(r, theme), children: row }, r))) }, `b${key}`));
|
|
26
|
+
}
|
|
27
|
+
default:
|
|
28
|
+
return _jsx(InlineLine, { line: block.text, theme: theme, glyphs: glyphs }, `b${key}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Table row 0 is the header (bold + accent); row 1 is the divider drawn under it.
|
|
33
|
+
*
|
|
34
|
+
* The divider must stay distinguishable at colour level 0, where bold is dropped
|
|
35
|
+
* to nothing, so it is MUTED and never bold: in `--no-color` the `----` run is
|
|
36
|
+
* itself the signal, and in a coloured tier the weight difference separates the
|
|
37
|
+
* header from the rule beneath it.
|
|
38
|
+
*/
|
|
39
|
+
function tableRowColor(index, theme) {
|
|
40
|
+
if (index === 0)
|
|
41
|
+
return theme.accent;
|
|
42
|
+
if (index === 1)
|
|
43
|
+
return theme.muted;
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Fenced code. The round border is gone (§4.3): nested inside a tool card it
|
|
48
|
+
* produced a box inside a box and squeezed an 80-column terminal down to 74
|
|
49
|
+
* usable columns. A left rail plus the language tag conveys the same "this is
|
|
50
|
+
* code" boundary for 1 column and 0 rows.
|
|
51
|
+
*
|
|
52
|
+
* The language tag is a muted TITLE, not a body row: it used to carry a chip
|
|
53
|
+
* background and one padding space either side of the text, so it rendered as
|
|
54
|
+
* ` | ts` above code rows that start at `| export ...` — a body line that
|
|
55
|
+
* happened to be the language. It keeps its own row on purpose: the height
|
|
56
|
+
* estimator (`virtual-window.estimateEntryRows`) counts RAW markdown lines and
|
|
57
|
+
* has no code-block branch, so the fence line must still occupy exactly 1 row.
|
|
58
|
+
*/
|
|
59
|
+
function CodeBlock({ code, lang, theme, glyphs, }) {
|
|
60
|
+
const rendered = highlightCached(code, lang);
|
|
61
|
+
return (_jsxs(Box, { flexDirection: "column", flexShrink: 0, paddingLeft: 1, ...railBorderProps(glyphs.railVertical, theme.border), children: [lang.length > 0 && (_jsx(Text, { bold: true, color: theme.muted, children: lang })), _jsx(Text, { children: rendered })] }));
|
|
62
|
+
}
|
|
63
|
+
/** Six heading levels used to render identically; now they carry three weights. */
|
|
64
|
+
function headingStyle(level, theme) {
|
|
65
|
+
if (level <= 2)
|
|
66
|
+
return { color: theme.primary };
|
|
67
|
+
if (level === 3)
|
|
68
|
+
return { color: theme.accent };
|
|
69
|
+
return { color: theme.assistant };
|
|
70
|
+
}
|
|
71
|
+
function InlineLine({ line, theme, glyphs, }) {
|
|
72
|
+
const heading = parseHeading(line);
|
|
73
|
+
if (heading) {
|
|
74
|
+
const style = headingStyle(heading.level, theme);
|
|
75
|
+
if (heading.level === 1) {
|
|
76
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, color: style.color, children: heading.text }), _jsx(Text, { color: theme.border, children: glyphs.hrule.repeat(RULE_WIDTH) })] }));
|
|
77
|
+
}
|
|
78
|
+
return (_jsx(Text, { bold: true, color: style.color, children: heading.text }));
|
|
79
|
+
}
|
|
80
|
+
if (isRule(line)) {
|
|
81
|
+
return _jsx(Text, { color: theme.border, children: glyphs.hrule.repeat(RULE_WIDTH) });
|
|
82
|
+
}
|
|
83
|
+
const quote = /^>\s?(.*)$/.exec(line);
|
|
84
|
+
if (quote) {
|
|
85
|
+
return (_jsxs(Text, { color: theme.muted, italic: true, children: [glyphs.railVertical, " ", renderInline(quote[1] ?? '', theme)] }));
|
|
86
|
+
}
|
|
87
|
+
const bullet = /^(\s*)([-*+])\s+(.*)$/.exec(line);
|
|
88
|
+
if (bullet) {
|
|
89
|
+
return (_jsxs(Text, { children: [bullet[1], _jsxs(Text, { color: theme.accent, children: [glyphs.bullet, " "] }), renderInline(bullet[3] ?? '', theme)] }));
|
|
90
|
+
}
|
|
91
|
+
const ordered = /^(\s*)(\d+)\.\s+(.*)$/.exec(line);
|
|
92
|
+
if (ordered) {
|
|
93
|
+
return (_jsxs(Text, { children: [ordered[1], _jsxs(Text, { color: theme.accent, children: [ordered[2], ". "] }), renderInline(ordered[3] ?? '', theme)] }));
|
|
94
|
+
}
|
|
95
|
+
return _jsx(Text, { children: renderInline(line, theme) });
|
|
96
|
+
}
|
|
97
|
+
/** Turn parsed inline spans into Ink `<Text>` nodes. */
|
|
98
|
+
export function renderInline(text, theme) {
|
|
99
|
+
const spans = parseInline(text);
|
|
100
|
+
if (spans.length === 0)
|
|
101
|
+
return text;
|
|
102
|
+
return spans.map((span, i) => {
|
|
103
|
+
switch (span.kind) {
|
|
104
|
+
case 'code':
|
|
105
|
+
return (_jsx(Text, { color: theme.code, children: span.text }, `i${i}`));
|
|
106
|
+
case 'bold':
|
|
107
|
+
return (_jsx(Text, { bold: true, children: span.text }, `i${i}`));
|
|
108
|
+
case 'italic':
|
|
109
|
+
return (_jsx(Text, { italic: true, children: span.text }, `i${i}`));
|
|
110
|
+
case 'strike':
|
|
111
|
+
return (_jsx(Text, { strikethrough: true, children: span.text }, `i${i}`));
|
|
112
|
+
default:
|
|
113
|
+
return span.text;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PromptCaretProps {
|
|
3
|
+
text: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
reducedMotion: boolean;
|
|
6
|
+
colorLevel: 0 | 1 | 2 | 3;
|
|
7
|
+
color?: string;
|
|
8
|
+
resetKey: object;
|
|
9
|
+
}
|
|
10
|
+
/** The only blinking state belongs to this leaf, never to the editor. */
|
|
11
|
+
export declare function PromptCaret({ text, active, reducedMotion, colorLevel, color, resetKey, }: PromptCaretProps): React.ReactElement;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect, useState } from 'react';
|
|
3
|
+
import { Text } from 'ink';
|
|
4
|
+
import { displayWidth } from './composer-rows.js';
|
|
5
|
+
function monochromeMarker(text) {
|
|
6
|
+
// Ink's output grid advances for combining marks, even though they have no
|
|
7
|
+
// terminal width. Retain them in both phases so its cell count stays stable.
|
|
8
|
+
const replace = (marker) => Array.from(text, (point) => {
|
|
9
|
+
const width = displayWidth(point);
|
|
10
|
+
return width > 0 ? marker.repeat(width) : point;
|
|
11
|
+
}).join('');
|
|
12
|
+
const underline = replace('_');
|
|
13
|
+
return underline === text ? replace('^') : underline;
|
|
14
|
+
}
|
|
15
|
+
/** The only blinking state belongs to this leaf, never to the editor. */
|
|
16
|
+
export function PromptCaret({ text, active, reducedMotion, colorLevel, color, resetKey, }) {
|
|
17
|
+
const [visible, setVisible] = useState(true);
|
|
18
|
+
useLayoutEffect(() => {
|
|
19
|
+
setVisible(true);
|
|
20
|
+
if (!active || reducedMotion)
|
|
21
|
+
return;
|
|
22
|
+
const timer = setInterval(() => setVisible((previous) => !previous), 500);
|
|
23
|
+
return () => clearInterval(timer);
|
|
24
|
+
}, [resetKey, active, reducedMotion]);
|
|
25
|
+
const bright = active && (reducedMotion || visible);
|
|
26
|
+
let content = text;
|
|
27
|
+
if (bright && colorLevel === 0) {
|
|
28
|
+
content = monochromeMarker(text);
|
|
29
|
+
}
|
|
30
|
+
return _jsx(Text, { color: color, inverse: bright && colorLevel > 0, children: content });
|
|
31
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PromptInput (spec §3.6 / §3.10) — a controlled multiline input on Ink's
|
|
3
|
+
* `useInput` with: full line editing (Home/End, word jump/delete, kill-line via
|
|
4
|
+
* `input/keymap`), multi-line vertical cursor navigation, prompt-history recall
|
|
5
|
+
* at the edges, a slash-command palette, and `@file` path completion.
|
|
6
|
+
*
|
|
7
|
+
* The buffer/cursor transforms (`applyEdit`, `moveVertical`) and the suggestion
|
|
8
|
+
* computations (`slashSuggestions`, `fileTokenAt`) are pure module functions,
|
|
9
|
+
* exported for `input.test.ts`, so the component itself stays thin.
|
|
10
|
+
*
|
|
11
|
+
* THE EDITOR'S FIVE PIECES OF STATE LIVE IN ONE REDUCER, and every branch of the
|
|
12
|
+
* input handler performs AT MOST ONE `dispatch` (tui-input-flicker-fix §3.4).
|
|
13
|
+
* Ink mounts a LEGACY React root, where `setState` outside a React event handler
|
|
14
|
+
* is not batched — and `useInput` runs from a stdin `'data'` listener, which is
|
|
15
|
+
* outside React entirely. The five `setState` calls one keystroke used to make
|
|
16
|
+
* were five commits, five whole-tree Yoga layouts and, through Ink's 32 ms
|
|
17
|
+
* leading+trailing throttle, two full-frame repaints per character. `fileMatches`
|
|
18
|
+
* stays a plain `useState` because it is written from the debounced glob effect
|
|
19
|
+
* rather than from a key.
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import type { Theme } from './theme.js';
|
|
23
|
+
import type { TermCapabilities } from './capabilities.js';
|
|
24
|
+
import { pickGlyphs } from './glyphs.js';
|
|
25
|
+
import { type EditIntent } from '../input/keymap.js';
|
|
26
|
+
import { type Suggestion } from './AutocompletePopup.js';
|
|
27
|
+
import { type EditorState, type InputSegment } from './editor-reducer.js';
|
|
28
|
+
import { type ComposerSubmitResult } from './composer-input.js';
|
|
29
|
+
import type { AgentMode } from '../model/agent/agent-mode.js';
|
|
30
|
+
export interface CommandOption {
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
}
|
|
34
|
+
interface PromptInputProps {
|
|
35
|
+
cols?: number;
|
|
36
|
+
terminalRows?: number;
|
|
37
|
+
statusExpanded?: boolean;
|
|
38
|
+
cursorVisible?: boolean;
|
|
39
|
+
onInteraction?: () => void;
|
|
40
|
+
isActive: boolean;
|
|
41
|
+
running: boolean;
|
|
42
|
+
history: string[];
|
|
43
|
+
commands: CommandOption[];
|
|
44
|
+
cwd: string;
|
|
45
|
+
theme: Theme;
|
|
46
|
+
caps: TermCapabilities;
|
|
47
|
+
/**
|
|
48
|
+
* Row budget for the completion popup (§5.2 / R-14).
|
|
49
|
+
*
|
|
50
|
+
* The popup shares the scrolling footer with the editor. Its height budget
|
|
51
|
+
* reserves visible message rows without changing the viewport or TODO rail.
|
|
52
|
+
*/
|
|
53
|
+
popupMaxRows?: number;
|
|
54
|
+
/** Total menu rows, including borders and the overflow hint. */
|
|
55
|
+
popupMaxHeight?: number;
|
|
56
|
+
onPopupRowsChange?: (rows: number) => void;
|
|
57
|
+
onCompletionContextChange?: (context: 'none' | 'slash' | 'file') => void;
|
|
58
|
+
/** True only when the stdin filter normalized DEL before Ink parsed it. */
|
|
59
|
+
deleteDisambiguated?: boolean;
|
|
60
|
+
onSubmit: (text: string) => ComposerSubmitResult;
|
|
61
|
+
onHelp?: () => void;
|
|
62
|
+
onEscape?: () => void;
|
|
63
|
+
onEscapeDismiss?: () => void;
|
|
64
|
+
reducedMotion?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Mirror of the session mode. Read for the placeholder only — the toggle
|
|
67
|
+
* itself belongs to `App`, and this component's job is to get out of its way
|
|
68
|
+
* (see the first statement of the input handler).
|
|
69
|
+
*/
|
|
70
|
+
agentMode?: AgentMode;
|
|
71
|
+
borderColor?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Fires when the draft flips empty ⇄ non-empty (for the border color) OR when
|
|
74
|
+
* its ROW COUNT changes (for `layout/budget.ts`) — never per keystroke.
|
|
75
|
+
*
|
|
76
|
+
* Widened from `(hasDraft: boolean)` by tui-paste-handling section 5.5. The row
|
|
77
|
+
* count is what makes I-8 true: the composer's rendered height and the
|
|
78
|
+
* `draftRows` handed to `viewportRows` have to be the same number, and the only
|
|
79
|
+
* component that knows the first one is this one. It is reported ALREADY
|
|
80
|
+
* CLAMPED, so a 218-line draft and a 400-line draft report the same value and
|
|
81
|
+
* the transcript stops moving once the composer is full (R-12).
|
|
82
|
+
*/
|
|
83
|
+
onDraftChange?: (state: {
|
|
84
|
+
hasDraft: boolean;
|
|
85
|
+
rows: number;
|
|
86
|
+
}) => void;
|
|
87
|
+
/**
|
|
88
|
+
* Tell the user a paste was refused (D-11 / P1-4).
|
|
89
|
+
*
|
|
90
|
+
* `PASTE_DRAFT_MAX_BYTES` and `PASTE_MAX_BLOCKS` cannot be enforced in the
|
|
91
|
+
* filter (it does not know the draft) and cannot be enforced in the reducer (it
|
|
92
|
+
* is pure, so it can neither raise a toast nor say why it refused). This
|
|
93
|
+
* component is the only place that holds both facts.
|
|
94
|
+
*/
|
|
95
|
+
onNotice?: (level: 'warn' | 'error', text: string) => void;
|
|
96
|
+
/**
|
|
97
|
+
* App-owned draft clearing (ctrl-c-clear-draft-exit): the second
|
|
98
|
+
* Ctrl+C of the armed ladder asks the editor to drop the draft. A
|
|
99
|
+
* NUMBER, not a boolean, so repeated requests stay distinguishable
|
|
100
|
+
* and the effect below never re-fires for an unchanged value.
|
|
101
|
+
* `'clear'` returns the editor to INITIAL_EDITOR_STATE, releasing
|
|
102
|
+
* paste payloads with it.
|
|
103
|
+
*/
|
|
104
|
+
draftClearNonce?: number;
|
|
105
|
+
/**
|
|
106
|
+
* App-owned ONE-SHOT fill (quick-prompt-library D-6 / §4.6).
|
|
107
|
+
*
|
|
108
|
+
* The payload-carrying sibling of `draftClearNonce`: `{ nonce, text, submit }`, with
|
|
109
|
+
* the same monotonic-nonce discipline, because a nonce is the only thing that makes
|
|
110
|
+
* an effect idempotent under StrictMode and re-renders (I-8). It is applied through
|
|
111
|
+
* `transact`, NOT by dispatching and calling `onSubmit` here: the composer has
|
|
112
|
+
* exactly one submission path and a fill must not become the second one (P0-1 / I-9).
|
|
113
|
+
*/
|
|
114
|
+
draftFill?: DraftFill;
|
|
115
|
+
/** `prompts.insertMode`: what a fill does to a draft that already has text. */
|
|
116
|
+
insertMode?: 'insert' | 'replace';
|
|
117
|
+
scrolledLines?: number;
|
|
118
|
+
}
|
|
119
|
+
/** A one-shot "put this text in the draft" payload (quick-prompt-library §4.6). */
|
|
120
|
+
export interface DraftFill {
|
|
121
|
+
/** Monotonic; the same value is applied at most once. */
|
|
122
|
+
nonce: number;
|
|
123
|
+
text: string;
|
|
124
|
+
/** `true` = apply and submit in ONE transaction (the picker's `Ctrl+Enter`). */
|
|
125
|
+
submit?: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface ScrollChip {
|
|
128
|
+
text: string;
|
|
129
|
+
/** FIXED width, so the number gaining a digit cannot re-wrap the draft (P2-4). */
|
|
130
|
+
cells: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Build the chip, or `null` when the viewport is pinned to the newest output.
|
|
134
|
+
*
|
|
135
|
+
* Every glyph comes from `pickGlyphs` and none from a literal (I-5): on a legacy
|
|
136
|
+
* console this renders `v12` rather than mojibake, and `glyphs.test.ts`'s static
|
|
137
|
+
* scan fails the build if that rule is broken here.
|
|
138
|
+
*/
|
|
139
|
+
export declare function scrollChip(scrolledLines: number, cols: number, glyphs: ReturnType<typeof pickGlyphs>): ScrollChip | null;
|
|
140
|
+
export interface OverflowChip {
|
|
141
|
+
text: string;
|
|
142
|
+
/** FIXED width, so a number gaining a digit cannot re-wrap the draft. */
|
|
143
|
+
cells: number;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Build the "there is more draft above / below this window" indicator, or `null`
|
|
147
|
+
* when the whole draft is on screen.
|
|
148
|
+
*
|
|
149
|
+
* Every glyph comes from `pickGlyphs` and none from a literal (I-5): on a legacy
|
|
150
|
+
* console this renders `^3 v7` rather than mojibake, and `glyphs.test.ts`'s
|
|
151
|
+
* static scan fails the build if that rule is broken here.
|
|
152
|
+
*/
|
|
153
|
+
export declare function overflowChip(hiddenAbove: number, hiddenBelow: number, glyphs: ReturnType<typeof pickGlyphs>): OverflowChip | null;
|
|
154
|
+
/**
|
|
155
|
+
* Would these segments push the draft past a limit? Returns the refusal text, or
|
|
156
|
+
* `null` when the paste is allowed.
|
|
157
|
+
*
|
|
158
|
+
* Checked BEFORE `dispatch`, so a refusal dispatches nothing at all and the draft
|
|
159
|
+
* is left byte-for-byte unchanged (AC-9). The one-dispatch-per-key rule is
|
|
160
|
+
* unaffected for the same reason.
|
|
161
|
+
*/
|
|
162
|
+
export declare function draftLimitRefusal(segments: InputSegment[], editor: Pick<EditorState, 'pastes'>): string | null;
|
|
163
|
+
/** Apply an edit intent as a pure buffer/cursor transform. */
|
|
164
|
+
export declare function applyEdit(buffer: string, cursor: number, intent: EditIntent): {
|
|
165
|
+
buffer: string;
|
|
166
|
+
cursor: number;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Move the cursor up/down one line preserving the column. Returns `null` at the
|
|
170
|
+
* top/bottom edge (or for a single-line buffer) so the caller can fall back to
|
|
171
|
+
* prompt-history recall.
|
|
172
|
+
*/
|
|
173
|
+
export declare function moveVertical(buffer: string, cursor: number, dir: 'up' | 'down'): {
|
|
174
|
+
cursor: number;
|
|
175
|
+
} | null;
|
|
176
|
+
/**
|
|
177
|
+
* Slash-command suggestions when the buffer is a bare `/word` (no space yet).
|
|
178
|
+
*
|
|
179
|
+
* The character class covers `-` and `:` as well as `\w` (D16). Skill names are
|
|
180
|
+
* kebab-case and the namespaced fallback is `/skill:<name>`; with the original
|
|
181
|
+
* `^\/(\w*)$` a user typing `/my-sk` got NO popup at all — not an error message,
|
|
182
|
+
* just silence, which reads as "that command does not exist".
|
|
183
|
+
*/
|
|
184
|
+
export declare function slashSuggestions(buffer: string, commands: CommandOption[]): Suggestion[] | null;
|
|
185
|
+
/** The `@file` token under the cursor (`@` + non-space run), if any. */
|
|
186
|
+
export declare function fileTokenAt(buffer: string, cursor: number): {
|
|
187
|
+
start: number;
|
|
188
|
+
end: number;
|
|
189
|
+
query: string;
|
|
190
|
+
} | null;
|
|
191
|
+
export declare function PromptInput({ cols: colsProp, terminalRows: terminalRowsProp, statusExpanded, cursorVisible, onInteraction, isActive, running, history, commands, cwd, theme, caps, popupMaxRows, popupMaxHeight, onPopupRowsChange, onCompletionContextChange, deleteDisambiguated, agentMode, onSubmit, onHelp, onEscape, onEscapeDismiss, reducedMotion, borderColor, onDraftChange, draftClearNonce, draftFill, insertMode, onNotice, }: PromptInputProps): React.ReactElement;
|
|
192
|
+
export {};
|