dexto 1.3.0 → 1.4.0
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 +25 -15
- package/dist/agents/agent-registry.json +9 -0
- package/dist/agents/coding-agent/coding-agent.yml +5 -0
- package/dist/agents/default-agent.yml +2 -2
- package/dist/api/server-hono.d.ts.map +1 -1
- package/dist/api/server-hono.js +39 -5
- package/dist/cli/cli-subscriber.d.ts.map +1 -1
- package/dist/cli/cli-subscriber.js +7 -1
- package/dist/cli/commands/helpers/formatters.d.ts.map +1 -1
- package/dist/cli/commands/helpers/formatters.js +2 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +14 -40
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +17 -14
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/command-parser.js +0 -15
- package/dist/cli/commands/interactive-commands/commands.d.ts +4 -4
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.js +34 -42
- package/dist/cli/commands/interactive-commands/documentation-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/documentation-commands.js +4 -7
- package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/general-commands.js +159 -117
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts +9 -3
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/mcp/index.js +18 -3
- package/dist/cli/commands/interactive-commands/model/index.d.ts +8 -6
- package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/model/index.js +18 -6
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -2
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +69 -52
- package/dist/cli/commands/interactive-commands/session/index.d.ts +7 -12
- package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/session/index.js +7 -14
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +10 -24
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/session/session-commands.js +16 -371
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -0
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/system/system-commands.js +103 -74
- package/dist/cli/commands/interactive-commands/tool-commands.d.ts +1 -1
- package/dist/cli/commands/interactive-commands/tool-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/tool-commands.js +5 -62
- package/dist/cli/commands/interactive-commands/utils/command-output.d.ts +13 -17
- package/dist/cli/commands/interactive-commands/utils/command-output.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/utils/command-output.js +18 -37
- package/dist/cli/commands/list-agents.d.ts +2 -2
- package/dist/cli/commands/list-agents.d.ts.map +1 -1
- package/dist/cli/commands/list-agents.js +36 -32
- package/dist/cli/commands/uninstall.d.ts.map +1 -1
- package/dist/cli/commands/uninstall.js +4 -6
- package/dist/cli/commands/which.d.ts.map +1 -1
- package/dist/cli/commands/which.js +17 -3
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts +9 -22
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +50 -133
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +24 -3
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +160 -45
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts +22 -0
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/ElicitationForm.js +358 -0
- package/dist/cli/ink-cli/components/Footer.d.ts +16 -0
- package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/Footer.js +27 -0
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts +17 -0
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/HistorySearchBar.js +8 -0
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts +15 -2
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ResourceAutocomplete.js +126 -82
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts +15 -2
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +228 -122
- package/dist/cli/ink-cli/components/StatusBar.d.ts +15 -2
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/StatusBar.js +46 -8
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts +52 -0
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/TextBufferInput.js +471 -0
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +11 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.js +90 -49
- package/dist/cli/ink-cli/components/chat/Header.d.ts +1 -0
- package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/Header.js +7 -2
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts +3 -0
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +95 -9
- package/dist/cli/ink-cli/components/chat/MessageList.js +1 -1
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts +16 -0
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.js +27 -0
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts +4 -2
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.js +19 -5
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +6 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.js +15 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +9 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.js +37 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.js +9 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.js +6 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.js +29 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts +45 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.js +38 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.js +6 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts +13 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.js +12 -0
- package/dist/cli/ink-cli/components/input/InputArea.d.ts +36 -8
- package/dist/cli/ink-cli/components/input/InputArea.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/input/InputArea.js +3 -3
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +25 -0
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +166 -0
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +27 -0
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +95 -0
- package/dist/cli/ink-cli/components/modes/index.d.ts +10 -0
- package/dist/cli/ink-cli/components/modes/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/modes/index.js +9 -0
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts +26 -0
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.js +92 -0
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +177 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +22 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +59 -0
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts +22 -0
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.js +59 -0
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts +26 -0
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.js +73 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.js +51 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts +29 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.js +215 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts +22 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +74 -0
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpSelector.js +52 -0
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +28 -0
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpServerActions.js +84 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts +29 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.js +109 -0
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +15 -8
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +247 -24
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts +22 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.js +52 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts +29 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.js +166 -0
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts +27 -0
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.js +119 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts +33 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.js +144 -0
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts +23 -0
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.js +189 -0
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts +7 -2
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.js +19 -5
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.js +42 -0
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts +20 -0
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/StreamSelector.js +58 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +25 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +400 -0
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts +21 -0
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.js +65 -0
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +28 -0
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +66 -0
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +19 -0
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/FileRenderer.js +26 -0
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts +21 -0
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.js +26 -0
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts +20 -0
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.js +12 -0
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts +21 -0
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +25 -0
- package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts +61 -0
- package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/diff-shared.js +158 -0
- package/dist/cli/ink-cli/components/renderers/index.d.ts +28 -0
- package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/index.js +36 -0
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts +38 -0
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/MarkdownText.js +360 -0
- package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts +44 -0
- package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/VirtualizedList.js +300 -0
- package/dist/cli/ink-cli/components/shared/text-buffer.d.ts +185 -0
- package/dist/cli/ink-cli/components/shared/text-buffer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/text-buffer.js +1338 -0
- package/dist/cli/ink-cli/constants/processingPhrases.d.ts +10 -0
- package/dist/cli/ink-cli/constants/processingPhrases.d.ts.map +1 -0
- package/dist/cli/ink-cli/constants/processingPhrases.js +64 -0
- package/dist/cli/ink-cli/constants/tips.d.ts +15 -0
- package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -0
- package/dist/cli/ink-cli/constants/tips.js +53 -0
- package/dist/cli/ink-cli/containers/InputContainer.d.ts +42 -8
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +491 -85
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +23 -5
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +1156 -130
- package/dist/cli/ink-cli/containers/index.d.ts +1 -1
- package/dist/cli/ink-cli/containers/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/contexts/KeypressContext.d.ts +36 -0
- package/dist/cli/ink-cli/contexts/KeypressContext.d.ts.map +1 -0
- package/dist/cli/ink-cli/contexts/KeypressContext.js +461 -0
- package/dist/cli/ink-cli/contexts/MouseContext.d.ts +27 -0
- package/dist/cli/ink-cli/contexts/MouseContext.d.ts.map +1 -0
- package/dist/cli/ink-cli/contexts/MouseContext.js +102 -0
- package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts +33 -0
- package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts.map +1 -0
- package/dist/cli/ink-cli/contexts/ScrollProvider.js +170 -0
- package/dist/cli/ink-cli/contexts/index.d.ts +7 -0
- package/dist/cli/ink-cli/contexts/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/contexts/index.js +6 -0
- package/dist/cli/ink-cli/hooks/index.d.ts +5 -0
- package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/index.js +6 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts +26 -9
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.js +86 -198
- package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts +14 -0
- package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useBatchedScroll.js +25 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts +50 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useCLIState.js +188 -0
- package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts +24 -0
- package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useElapsedTime.js +69 -0
- package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts +61 -0
- package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useHistorySearch.js +210 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts +136 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +663 -0
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.js +7 -26
- package/dist/cli/ink-cli/hooks/useKeypress.d.ts +18 -0
- package/dist/cli/ink-cli/hooks/useKeypress.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useKeypress.js +26 -0
- package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts +30 -0
- package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/usePhraseCycler.js +68 -0
- package/dist/cli/ink-cli/hooks/useStreaming.d.ts +19 -0
- package/dist/cli/ink-cli/hooks/useStreaming.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useStreaming.js +26 -0
- package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts +14 -0
- package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useTerminalSize.js +31 -0
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts +42 -0
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useTokenCounter.js +96 -0
- package/dist/cli/ink-cli/services/CommandService.d.ts +32 -1
- package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/CommandService.js +36 -5
- package/dist/cli/ink-cli/services/InputService.d.ts +1 -5
- package/dist/cli/ink-cli/services/InputService.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/InputService.js +1 -8
- package/dist/cli/ink-cli/services/index.d.ts +2 -1
- package/dist/cli/ink-cli/services/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/index.js +2 -1
- package/dist/cli/ink-cli/services/processStream.d.ts +69 -0
- package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -0
- package/dist/cli/ink-cli/services/processStream.js +674 -0
- package/dist/cli/ink-cli/state/actions.d.ts +30 -60
- package/dist/cli/ink-cli/state/actions.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/actions.js +3 -0
- package/dist/cli/ink-cli/state/index.d.ts +5 -3
- package/dist/cli/ink-cli/state/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/index.js +4 -3
- package/dist/cli/ink-cli/state/initialState.d.ts +4 -3
- package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/initialState.js +20 -4
- package/dist/cli/ink-cli/state/reducer.d.ts +3 -0
- package/dist/cli/ink-cli/state/reducer.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/reducer.js +62 -168
- package/dist/cli/ink-cli/state/streaming-state.d.ts +27 -0
- package/dist/cli/ink-cli/state/streaming-state.d.ts.map +1 -0
- package/dist/cli/ink-cli/state/streaming-state.js +39 -0
- package/dist/cli/ink-cli/state/types.d.ts +222 -6
- package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/bracketedPaste.d.ts +22 -0
- package/dist/cli/ink-cli/utils/bracketedPaste.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/bracketedPaste.js +27 -0
- package/dist/cli/ink-cli/utils/clipboardUtils.d.ts +49 -0
- package/dist/cli/ink-cli/utils/clipboardUtils.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/clipboardUtils.js +356 -0
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts +33 -0
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/commandOverlays.js +78 -0
- package/dist/cli/ink-cli/utils/debugLog.d.ts +38 -0
- package/dist/cli/ink-cli/utils/debugLog.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/debugLog.js +66 -0
- package/dist/cli/ink-cli/utils/index.d.ts +2 -1
- package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/index.js +3 -1
- package/dist/cli/ink-cli/utils/input.d.ts +25 -0
- package/dist/cli/ink-cli/utils/input.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/input.js +56 -0
- package/dist/cli/ink-cli/utils/inputParsing.d.ts +0 -9
- package/dist/cli/ink-cli/utils/inputParsing.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/inputParsing.js +0 -27
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +54 -3
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +290 -20
- package/dist/cli/ink-cli/utils/mouse.d.ts +61 -0
- package/dist/cli/ink-cli/utils/mouse.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/mouse.js +209 -0
- package/dist/cli/ink-cli/utils/streamSplitter.d.ts +44 -0
- package/dist/cli/ink-cli/utils/streamSplitter.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/streamSplitter.js +154 -0
- package/dist/cli/ink-cli/utils/textUtils.d.ts +63 -0
- package/dist/cli/ink-cli/utils/textUtils.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/textUtils.js +248 -0
- package/dist/cli/ink-cli/utils/toolUtils.d.ts +9 -0
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/toolUtils.js +13 -0
- package/dist/cli/utils/options.d.ts.map +1 -1
- package/dist/cli/utils/options.js +0 -2
- package/dist/config/cli-overrides.d.ts +1 -1
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +5 -10
- package/dist/index.js +66 -48
- package/dist/utils/agent-helpers.d.ts +95 -0
- package/dist/utils/agent-helpers.d.ts.map +1 -0
- package/dist/utils/agent-helpers.js +117 -0
- package/dist/webui/assets/index-BkwPkZpd.css +1 -0
- package/dist/webui/assets/index-D9u1XfyH.js +2025 -0
- package/dist/webui/assets/{tanstack-DgxBONJY.js → tanstack-Br79RQ-n.js} +1 -1
- package/dist/webui/index.html +3 -3
- package/package.json +16 -14
- package/dist/cli/commands/interactive-commands/index.d.ts +0 -63
- package/dist/cli/commands/interactive-commands/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/index.js +0 -73
- package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts +0 -34
- package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.js +0 -178
- package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts +0 -9
- package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/mcp/mcp-commands.js +0 -325
- package/dist/cli/commands/interactive-commands/model/model-commands.d.ts +0 -21
- package/dist/cli/commands/interactive-commands/model/model-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/model/model-commands.js +0 -190
- package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts +0 -26
- package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/MultiLineTextInput.js +0 -220
- package/dist/discord/bot.d.ts +0 -4
- package/dist/discord/bot.d.ts.map +0 -1
- package/dist/discord/bot.js +0 -193
- package/dist/telegram/bot.d.ts +0 -5
- package/dist/telegram/bot.d.ts.map +0 -1
- package/dist/telegram/bot.js +0 -251
- package/dist/webui/assets/index-DKq5Xng1.js +0 -687
- package/dist/webui/assets/index-D_0_GBu5.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/cli/src/cli/commands/uninstall.ts
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { uninstallAgent, listInstalledAgents } from '../../utils/agent-helpers.js';
|
|
4
4
|
import { capture } from '../../analytics/index.js';
|
|
5
5
|
// Zod schema for uninstall command validation
|
|
6
6
|
const UninstallCommandSchema = z
|
|
@@ -20,8 +20,7 @@ async function validateUninstallCommand(agents, options) {
|
|
|
20
20
|
agents,
|
|
21
21
|
});
|
|
22
22
|
// Business logic validation
|
|
23
|
-
const
|
|
24
|
-
const installedAgents = await registry.getInstalledAgents();
|
|
23
|
+
const installedAgents = await listInstalledAgents();
|
|
25
24
|
if (installedAgents.length === 0) {
|
|
26
25
|
throw new Error('No agents are currently installed.');
|
|
27
26
|
}
|
|
@@ -33,8 +32,7 @@ async function validateUninstallCommand(agents, options) {
|
|
|
33
32
|
export async function handleUninstallCommand(agents, options) {
|
|
34
33
|
// Validate command with Zod
|
|
35
34
|
const validated = await validateUninstallCommand(agents, options);
|
|
36
|
-
const
|
|
37
|
-
const installedAgents = await registry.getInstalledAgents();
|
|
35
|
+
const installedAgents = await listInstalledAgents();
|
|
38
36
|
if (installedAgents.length === 0) {
|
|
39
37
|
console.log('📋 No agents are currently installed.');
|
|
40
38
|
return;
|
|
@@ -64,7 +62,7 @@ export async function handleUninstallCommand(agents, options) {
|
|
|
64
62
|
for (const agentName of agentsToUninstall) {
|
|
65
63
|
try {
|
|
66
64
|
console.log(`\n🗑️ Uninstalling ${agentName}...`);
|
|
67
|
-
await
|
|
65
|
+
await uninstallAgent(agentName);
|
|
68
66
|
successCount++;
|
|
69
67
|
console.log(`✅ ${agentName} uninstalled successfully`);
|
|
70
68
|
uninstalled.push(agentName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"which.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/which.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"which.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/which.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,kBAAkB;;;;;;EAIX,CAAC;AAEd,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAgBtE;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBzE"}
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
// packages/cli/src/cli/commands/which.ts
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
import { z } from 'zod';
|
|
4
|
-
import { resolveAgentPath,
|
|
5
|
+
import { resolveAgentPath, resolveBundledScript } from '@dexto/agent-management';
|
|
5
6
|
// Zod schema for which command validation
|
|
6
7
|
const WhichCommandSchema = z
|
|
7
8
|
.object({
|
|
8
9
|
agentName: z.string().min(1, 'Agent name cannot be empty'),
|
|
9
10
|
})
|
|
10
11
|
.strict();
|
|
12
|
+
/**
|
|
13
|
+
* Load available agent names from bundled registry
|
|
14
|
+
*/
|
|
15
|
+
function getAvailableAgentNames() {
|
|
16
|
+
try {
|
|
17
|
+
const registryPath = resolveBundledScript('agents/agent-registry.json');
|
|
18
|
+
const content = readFileSync(registryPath, 'utf-8');
|
|
19
|
+
const registry = JSON.parse(content);
|
|
20
|
+
return Object.keys(registry.agents || {});
|
|
21
|
+
}
|
|
22
|
+
catch (_error) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
11
26
|
/**
|
|
12
27
|
* Handle the which command
|
|
13
28
|
*/
|
|
14
29
|
export async function handleWhichCommand(agentName) {
|
|
15
30
|
// Validate command with Zod
|
|
16
31
|
const validated = WhichCommandSchema.parse({ agentName });
|
|
17
|
-
const
|
|
18
|
-
const availableAgents = Object.keys(registry.getAvailableAgents());
|
|
32
|
+
const availableAgents = getAvailableAgentNames();
|
|
19
33
|
try {
|
|
20
34
|
const resolvedPath = await resolveAgentPath(validated.agentName, false, false); // Don't auto-install, don't inject preferences
|
|
21
35
|
console.log(resolvedPath);
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* InkCLI Component (Refactored)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Entry point for the Ink-based CLI. Selects between two rendering modes:
|
|
5
|
+
* - AlternateBufferCLI: VirtualizedList with mouse scroll, keyboard scroll, copy mode
|
|
6
|
+
* - StaticCLI: Static pattern with native terminal scrollback and selection
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
* - State managed by useReducer with typed actions
|
|
8
|
-
* - Business logic in services
|
|
9
|
-
* - Event handling via custom hooks
|
|
10
|
-
* - UI in presentational components
|
|
11
|
-
* - Smart containers orchestrate interactions
|
|
12
|
-
*
|
|
13
|
-
* Before: 50+ useState hooks, 15+ useEffect hooks, complex state management
|
|
14
|
-
* After: 1 useReducer, 5 custom hooks, clear separation of concerns
|
|
8
|
+
* The mode is selected via USE_ALTERNATE_BUFFER constant.
|
|
15
9
|
*/
|
|
16
10
|
import type { DextoAgent } from '@dexto/core';
|
|
17
|
-
import {
|
|
11
|
+
import type { StartupInfo } from './state/types.js';
|
|
18
12
|
interface InkCLIProps {
|
|
19
13
|
agent: DextoAgent;
|
|
20
14
|
initialSessionId: string | null;
|
|
@@ -23,21 +17,14 @@ interface InkCLIProps {
|
|
|
23
17
|
/**
|
|
24
18
|
* Modern CLI interface using React Ink
|
|
25
19
|
*
|
|
26
|
-
*
|
|
27
|
-
* -
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
30
|
-
* - Performance
|
|
31
|
-
* - Type safety
|
|
32
|
-
*
|
|
33
|
-
* Uses explicit sessionId in state (like WebUI) instead of defaultSession pattern
|
|
20
|
+
* Wraps the CLI with:
|
|
21
|
+
* - ErrorBoundary for graceful error handling
|
|
22
|
+
* - KeypressProvider for unified keyboard input
|
|
23
|
+
* - MouseProvider (only in alternate buffer mode)
|
|
34
24
|
*/
|
|
35
25
|
export declare function InkCLIRefactored({ agent, initialSessionId, startupInfo }: InkCLIProps): import("react/jsx-runtime").JSX.Element;
|
|
36
26
|
/**
|
|
37
27
|
* Start the modern Ink-based CLI
|
|
38
|
-
* Entry point for the refactored CLI
|
|
39
|
-
* @param agent - The DextoAgent instance
|
|
40
|
-
* @param initialSessionId - The session ID to use for this CLI session
|
|
41
28
|
*/
|
|
42
29
|
export declare function startInkCliRefactored(agent: DextoAgent, initialSessionId: string | null): Promise<void>;
|
|
43
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InkCLIRefactored.d.ts","sourceRoot":"","sources":["../../../src/cli/ink-cli/InkCLIRefactored.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"InkCLIRefactored.d.ts","sourceRoot":"","sources":["../../../src/cli/ink-cli/InkCLIRefactored.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAoBpD,UAAU,WAAW;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,WAAW,CAAC;CAC5B;AAyCD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,WAAW,2CAerF;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,UAAU,EACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -1,158 +1,75 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* InkCLI Component (Refactored)
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Entry point for the Ink-based CLI. Selects between two rendering modes:
|
|
6
|
+
* - AlternateBufferCLI: VirtualizedList with mouse scroll, keyboard scroll, copy mode
|
|
7
|
+
* - StaticCLI: Static pattern with native terminal scrollback and selection
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
* - State managed by useReducer with typed actions
|
|
9
|
-
* - Business logic in services
|
|
10
|
-
* - Event handling via custom hooks
|
|
11
|
-
* - UI in presentational components
|
|
12
|
-
* - Smart containers orchestrate interactions
|
|
13
|
-
*
|
|
14
|
-
* Before: 50+ useState hooks, 15+ useEffect hooks, complex state management
|
|
15
|
-
* After: 1 useReducer, 5 custom hooks, clear separation of concerns
|
|
9
|
+
* The mode is selected via USE_ALTERNATE_BUFFER constant.
|
|
16
10
|
*/
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
11
|
+
import { useCallback, useState } from 'react';
|
|
12
|
+
import { render } from 'ink';
|
|
19
13
|
import { registerGracefulShutdown } from '../../utils/graceful-shutdown.js';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import { useAgentEvents, useKeyboardShortcuts } from './hooks/index.js';
|
|
24
|
-
// Services
|
|
25
|
-
import { InputService, MessageService } from './services/index.js';
|
|
26
|
-
// Utils
|
|
27
|
-
import { getStartupInfo, convertHistoryToUIMessages } from './utils/messageFormatting.js';
|
|
14
|
+
import { enableBracketedPaste, disableBracketedPaste } from './utils/bracketedPaste.js';
|
|
15
|
+
// Contexts (keyboard/mouse providers)
|
|
16
|
+
import { KeypressProvider, MouseProvider, ScrollProvider } from './contexts/index.js';
|
|
28
17
|
// Components
|
|
29
|
-
import { ChatView } from './components/chat/ChatView.js';
|
|
30
|
-
import { Footer } from './components/chat/Footer.js';
|
|
31
18
|
import { ErrorBoundary } from './components/ErrorBoundary.js';
|
|
32
|
-
import {
|
|
33
|
-
//
|
|
34
|
-
import {
|
|
35
|
-
|
|
19
|
+
import { AlternateBufferCLI, StaticCLI } from './components/modes/index.js';
|
|
20
|
+
// Hooks
|
|
21
|
+
import { useStreaming } from './hooks/useStreaming.js';
|
|
22
|
+
// Utils
|
|
23
|
+
import { getStartupInfo } from './utils/messageFormatting.js';
|
|
24
|
+
// Rendering mode: true = alternate buffer with VirtualizedList, false = Static pattern
|
|
25
|
+
// Toggle this to switch between modes for testing
|
|
26
|
+
//const USE_ALTERNATE_BUFFER = true;
|
|
27
|
+
const USE_ALTERNATE_BUFFER = false;
|
|
28
|
+
/**
|
|
29
|
+
* Inner component that wraps the mode-specific component with providers
|
|
30
|
+
*/
|
|
31
|
+
function InkCLIInner({ agent, initialSessionId, startupInfo }) {
|
|
32
|
+
// Selection hint callback for alternate buffer mode
|
|
33
|
+
const [, setSelectionHintShown] = useState(false);
|
|
34
|
+
// Streaming mode - can be toggled via /stream command
|
|
35
|
+
const { streaming } = useStreaming();
|
|
36
|
+
const handleSelectionAttempt = useCallback(() => {
|
|
37
|
+
setSelectionHintShown(true);
|
|
38
|
+
}, []);
|
|
39
|
+
if (USE_ALTERNATE_BUFFER) {
|
|
40
|
+
return (_jsx(ScrollProvider, { onSelectionAttempt: handleSelectionAttempt, children: _jsx(AlternateBufferCLI, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo, onSelectionAttempt: handleSelectionAttempt, useStreaming: streaming }) }));
|
|
41
|
+
}
|
|
42
|
+
// Static mode - no ScrollProvider needed
|
|
43
|
+
return (_jsx(StaticCLI, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo, useStreaming: streaming }));
|
|
44
|
+
}
|
|
36
45
|
/**
|
|
37
46
|
* Modern CLI interface using React Ink
|
|
38
47
|
*
|
|
39
|
-
*
|
|
40
|
-
* -
|
|
41
|
-
* -
|
|
42
|
-
* -
|
|
43
|
-
* - Performance
|
|
44
|
-
* - Type safety
|
|
45
|
-
*
|
|
46
|
-
* Uses explicit sessionId in state (like WebUI) instead of defaultSession pattern
|
|
48
|
+
* Wraps the CLI with:
|
|
49
|
+
* - ErrorBoundary for graceful error handling
|
|
50
|
+
* - KeypressProvider for unified keyboard input
|
|
51
|
+
* - MouseProvider (only in alternate buffer mode)
|
|
47
52
|
*/
|
|
48
53
|
export function InkCLIRefactored({ agent, initialSessionId, startupInfo }) {
|
|
49
|
-
|
|
50
|
-
const [state, dispatch] = useReducer(cliReducer, undefined, () => {
|
|
51
|
-
const initialModelName = agent.getCurrentLLMConfig().model;
|
|
52
|
-
const initial = createInitialState([], initialModelName);
|
|
53
|
-
initial.session.id = initialSessionId;
|
|
54
|
-
initial.session.hasActiveSession = initialSessionId !== null;
|
|
55
|
-
return initial;
|
|
56
|
-
});
|
|
57
|
-
// Initialize services (memoized)
|
|
58
|
-
const inputService = useMemo(() => new InputService(), []);
|
|
59
|
-
const messageService = useMemo(() => new MessageService(), []);
|
|
60
|
-
// Setup event bus subscriptions
|
|
61
|
-
useAgentEvents({ agent, dispatch, isCancelling: state.ui.isCancelling });
|
|
62
|
-
// Session is now managed in state - no need for sync hook
|
|
63
|
-
// useSessionSync removed - sessionId is in state from initialization or SESSION_SET actions
|
|
64
|
-
// Input history navigation is now handled by MultiLineTextInput component
|
|
65
|
-
// Setup global keyboard shortcuts
|
|
66
|
-
useKeyboardShortcuts({ state, dispatch, agent });
|
|
67
|
-
// Hydrate conversation history when resuming a session
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
if (!initialSessionId || !state.session.hasActiveSession || state.messages.length > 0) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
let cancelled = false;
|
|
73
|
-
(async () => {
|
|
74
|
-
try {
|
|
75
|
-
const history = await agent.getSessionHistory(initialSessionId);
|
|
76
|
-
if (!history?.length || cancelled)
|
|
77
|
-
return;
|
|
78
|
-
const historyMessages = convertHistoryToUIMessages(history, initialSessionId);
|
|
79
|
-
dispatch({ type: 'MESSAGE_ADD_MULTIPLE', messages: historyMessages });
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
if (cancelled)
|
|
83
|
-
return;
|
|
84
|
-
dispatch({
|
|
85
|
-
type: 'ERROR',
|
|
86
|
-
errorMessage: error instanceof Error ? error.message : String(error),
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
})();
|
|
90
|
-
return () => {
|
|
91
|
-
cancelled = true;
|
|
92
|
-
};
|
|
93
|
-
}, [agent, dispatch, initialSessionId, state.messages.length, state.session.hasActiveSession]);
|
|
94
|
-
// Detect overlays based on input (with guards to prevent infinite loop)
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
// Don't detect overlays if processing or approval is active
|
|
97
|
-
if (state.ui.isProcessing || state.approval)
|
|
98
|
-
return;
|
|
99
|
-
const autocompleteType = inputService.detectAutocompleteType(state.input.value);
|
|
100
|
-
const selectorType = inputService.detectInteractiveSelector(state.input.value);
|
|
101
|
-
// Determine what overlay should be shown
|
|
102
|
-
let desiredOverlay = 'none';
|
|
103
|
-
// Priority: selector > autocomplete
|
|
104
|
-
if (selectorType === 'model') {
|
|
105
|
-
desiredOverlay = 'model-selector';
|
|
106
|
-
}
|
|
107
|
-
else if (selectorType === 'session') {
|
|
108
|
-
desiredOverlay = 'session-selector';
|
|
109
|
-
}
|
|
110
|
-
else if (autocompleteType === 'slash') {
|
|
111
|
-
desiredOverlay = 'slash-autocomplete';
|
|
112
|
-
}
|
|
113
|
-
else if (autocompleteType === 'resource') {
|
|
114
|
-
desiredOverlay = 'resource-autocomplete';
|
|
115
|
-
}
|
|
116
|
-
// Only dispatch if overlay needs to change
|
|
117
|
-
if (desiredOverlay !== state.ui.activeOverlay && state.ui.activeOverlay !== 'approval') {
|
|
118
|
-
if (desiredOverlay === 'none') {
|
|
119
|
-
dispatch({ type: 'CLOSE_OVERLAY' });
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
dispatch({ type: 'SHOW_OVERLAY', overlay: desiredOverlay });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}, [
|
|
126
|
-
state.input.value,
|
|
127
|
-
state.ui.isProcessing,
|
|
128
|
-
state.approval,
|
|
129
|
-
state.ui.activeOverlay,
|
|
130
|
-
inputService,
|
|
131
|
-
dispatch,
|
|
132
|
-
]);
|
|
133
|
-
// Get visible messages (performance optimization)
|
|
134
|
-
// Limit to last 30 messages to prevent scrolling issues
|
|
135
|
-
const visibleMessages = useMemo(() => {
|
|
136
|
-
return messageService.getVisibleMessages(state.messages, 30);
|
|
137
|
-
}, [state.messages, messageService]);
|
|
138
|
-
return (_jsx(ErrorBoundary, { children: _jsxs(Box, { flexDirection: "column", minHeight: 0, children: [_jsx(ChatView, { messages: visibleMessages, modelName: state.session.modelName, sessionId: state.session.id || undefined, hasActiveSession: state.session.hasActiveSession, startupInfo: startupInfo }), _jsx(StatusBar, { isProcessing: state.ui.isProcessing, isThinking: state.ui.isThinking, approvalQueueCount: state.approvalQueue.length, exitWarningShown: state.ui.exitWarningShown }), _jsx(OverlayContainer, { state: state, dispatch: dispatch, agent: agent, inputService: inputService }), _jsx(InputContainer, { state: state, dispatch: dispatch, agent: agent, inputService: inputService }), _jsx(Footer, {})] }) }));
|
|
54
|
+
return (_jsx(ErrorBoundary, { children: _jsx(KeypressProvider, { children: _jsx(MouseProvider, { mouseEventsEnabled: USE_ALTERNATE_BUFFER, children: _jsx(InkCLIInner, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo }) }) }) }));
|
|
139
55
|
}
|
|
140
56
|
/**
|
|
141
57
|
* Start the modern Ink-based CLI
|
|
142
|
-
* Entry point for the refactored CLI
|
|
143
|
-
* @param agent - The DextoAgent instance
|
|
144
|
-
* @param initialSessionId - The session ID to use for this CLI session
|
|
145
58
|
*/
|
|
146
59
|
export async function startInkCliRefactored(agent, initialSessionId) {
|
|
147
|
-
// Use inkMode to let Ctrl+C be handled by the UI for exit warning
|
|
148
60
|
registerGracefulShutdown(() => agent, { inkMode: true });
|
|
149
|
-
//
|
|
61
|
+
// Enable bracketed paste mode so we can detect pasted text
|
|
62
|
+
// This wraps pastes with escape sequences that our KeypressContext handles
|
|
63
|
+
enableBracketedPaste();
|
|
150
64
|
const startupInfo = await getStartupInfo(agent);
|
|
151
65
|
const inkApp = render(_jsx(InkCLIRefactored, { agent: agent, initialSessionId: initialSessionId, startupInfo: startupInfo }), {
|
|
152
|
-
// Disable default Ctrl+C exit to handle it ourselves with double-press warning
|
|
153
66
|
exitOnCtrlC: false,
|
|
67
|
+
alternateBuffer: USE_ALTERNATE_BUFFER,
|
|
68
|
+
// Incremental rendering works better with VirtualizedList
|
|
69
|
+
// Static pattern doesn't need it (and may work better without)
|
|
70
|
+
incrementalRendering: USE_ALTERNATE_BUFFER,
|
|
154
71
|
});
|
|
155
|
-
// Wait for the Ink app to exit before resolving
|
|
156
|
-
// This ensures console suppression remains active until the UI is fully closed
|
|
157
72
|
await inkApp.waitUntilExit();
|
|
73
|
+
// Disable bracketed paste mode to restore normal terminal behavior
|
|
74
|
+
disableBracketedPaste();
|
|
158
75
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Key } from '../hooks/useInputOrchestrator.js';
|
|
1
3
|
export interface ApprovalRequest {
|
|
2
4
|
approvalId: string;
|
|
3
5
|
type: string;
|
|
@@ -6,16 +8,35 @@ export interface ApprovalRequest {
|
|
|
6
8
|
timestamp: Date;
|
|
7
9
|
metadata: Record<string, unknown>;
|
|
8
10
|
}
|
|
11
|
+
export interface ApprovalPromptHandle {
|
|
12
|
+
handleInput: (input: string, key: Key) => boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Options passed when approving a request
|
|
16
|
+
*/
|
|
17
|
+
export interface ApprovalOptions {
|
|
18
|
+
/** Remember this tool for the entire session (approves ALL uses) */
|
|
19
|
+
rememberChoice?: boolean;
|
|
20
|
+
/** Remember a specific command pattern for bash (e.g., "git *") */
|
|
21
|
+
rememberPattern?: string;
|
|
22
|
+
/** Form data for elicitation requests */
|
|
23
|
+
formData?: Record<string, unknown>;
|
|
24
|
+
/** Enable "accept all edits" mode (auto-approve future edit_file/write_file) */
|
|
25
|
+
enableAcceptEditsMode?: boolean;
|
|
26
|
+
}
|
|
9
27
|
interface ApprovalPromptProps {
|
|
10
28
|
approval: ApprovalRequest;
|
|
11
|
-
onApprove: (
|
|
29
|
+
onApprove: (options: ApprovalOptions) => void;
|
|
12
30
|
onDeny: () => void;
|
|
13
31
|
onCancel: () => void;
|
|
14
32
|
}
|
|
15
33
|
/**
|
|
16
34
|
* Compact approval prompt component that displays above the input area
|
|
17
|
-
* Shows
|
|
35
|
+
* Shows options based on approval type:
|
|
36
|
+
* - Tool confirmation: Yes, Yes (Session), No
|
|
37
|
+
* - Bash with patterns: Yes (once), pattern options, Yes (all bash), No
|
|
38
|
+
* - Elicitation: Form with input fields
|
|
18
39
|
*/
|
|
19
|
-
export declare
|
|
40
|
+
export declare const ApprovalPrompt: React.ForwardRefExoticComponent<ApprovalPromptProps & React.RefAttributes<ApprovalPromptHandle>>;
|
|
20
41
|
export {};
|
|
21
42
|
//# sourceMappingURL=ApprovalPrompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ApprovalPrompt.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApprovalPrompt.d.ts","sourceRoot":"","sources":["../../../../src/cli/ink-cli/components/ApprovalPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAG5F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAK5D,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,UAAU,mBAAmB;IACzB,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAOD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,kGAoP1B,CAAC"}
|
|
@@ -1,55 +1,170 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Box, Text
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState, useImperativeHandle, useRef, useEffect } from 'react';
|
|
3
|
+
import { Box, Text } from 'ink';
|
|
4
|
+
import { ElicitationForm } from './ElicitationForm.js';
|
|
5
|
+
import { DiffPreview, CreateFilePreview } from './renderers/index.js';
|
|
6
|
+
import { isEditWriteTool } from '../utils/toolUtils.js';
|
|
4
7
|
/**
|
|
5
8
|
* Compact approval prompt component that displays above the input area
|
|
6
|
-
* Shows
|
|
9
|
+
* Shows options based on approval type:
|
|
10
|
+
* - Tool confirmation: Yes, Yes (Session), No
|
|
11
|
+
* - Bash with patterns: Yes (once), pattern options, Yes (all bash), No
|
|
12
|
+
* - Elicitation: Form with input fields
|
|
7
13
|
*/
|
|
8
|
-
export
|
|
14
|
+
export const ApprovalPrompt = forwardRef(({ approval, onApprove, onDeny, onCancel }, ref) => {
|
|
9
15
|
const isCommandConfirmation = approval.type === 'command_confirmation';
|
|
10
|
-
const
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return 'yes'; // no -> yes (wrap)
|
|
16
|
+
const isElicitation = approval.type === 'elicitation';
|
|
17
|
+
// Extract suggested patterns for bash tools
|
|
18
|
+
const suggestedPatterns = approval.metadata.suggestedPatterns ?? [];
|
|
19
|
+
const hasBashPatterns = suggestedPatterns.length > 0;
|
|
20
|
+
// Check if this is an edit/write file tool
|
|
21
|
+
const toolName = approval.metadata.toolName;
|
|
22
|
+
const isEditOrWriteTool = isEditWriteTool(toolName);
|
|
23
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
24
|
+
// Ref for elicitation form
|
|
25
|
+
const elicitationFormRef = useRef(null);
|
|
26
|
+
// Use ref to avoid stale closure issues in handleInput
|
|
27
|
+
const selectedIndexRef = useRef(0);
|
|
28
|
+
// Build the list of options based on approval type
|
|
29
|
+
const options = [];
|
|
30
|
+
if (hasBashPatterns) {
|
|
31
|
+
// Bash tool with pattern suggestions
|
|
32
|
+
options.push({ id: 'yes', label: 'Yes (once)' });
|
|
33
|
+
suggestedPatterns.forEach((pattern, i) => {
|
|
34
|
+
options.push({
|
|
35
|
+
id: `pattern-${i}`,
|
|
36
|
+
label: `Yes, allow "${pattern}"`,
|
|
32
37
|
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
});
|
|
39
|
+
options.push({ id: 'yes-session', label: 'Yes, allow all bash' });
|
|
40
|
+
options.push({ id: 'no', label: 'No' });
|
|
41
|
+
}
|
|
42
|
+
else if (isCommandConfirmation) {
|
|
43
|
+
// Command confirmation (no session option)
|
|
44
|
+
options.push({ id: 'yes', label: 'Yes' });
|
|
45
|
+
options.push({ id: 'no', label: 'No' });
|
|
46
|
+
}
|
|
47
|
+
else if (isEditOrWriteTool) {
|
|
48
|
+
// Edit/write file tools - offer "accept all edits" mode instead of session
|
|
49
|
+
options.push({ id: 'yes', label: 'Yes' });
|
|
50
|
+
options.push({ id: 'yes-accept-edits', label: 'Yes, and accept all edits' });
|
|
51
|
+
options.push({ id: 'no', label: 'No' });
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// Standard tool confirmation
|
|
55
|
+
options.push({ id: 'yes', label: 'Yes' });
|
|
56
|
+
options.push({ id: 'yes-session', label: 'Yes (Session)' });
|
|
57
|
+
options.push({ id: 'no', label: 'No' });
|
|
58
|
+
}
|
|
59
|
+
// Keep ref in sync with state
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
selectedIndexRef.current = selectedIndex;
|
|
62
|
+
}, [selectedIndex]);
|
|
63
|
+
// Helper to get the option at current index
|
|
64
|
+
const getCurrentOption = () => options[selectedIndexRef.current];
|
|
65
|
+
// Expose handleInput method via ref
|
|
66
|
+
useImperativeHandle(ref, () => ({
|
|
67
|
+
handleInput: (input, key) => {
|
|
68
|
+
// For elicitation, delegate to the form
|
|
69
|
+
if (isElicitation && elicitationFormRef.current) {
|
|
70
|
+
return elicitationFormRef.current.handleInput(input, key);
|
|
38
71
|
}
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
if (key.upArrow) {
|
|
73
|
+
setSelectedIndex((current) => current === 0 ? options.length - 1 : current - 1);
|
|
74
|
+
return true;
|
|
41
75
|
}
|
|
42
|
-
else {
|
|
43
|
-
|
|
76
|
+
else if (key.downArrow) {
|
|
77
|
+
setSelectedIndex((current) => current === options.length - 1 ? 0 : current + 1);
|
|
78
|
+
return true;
|
|
44
79
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
80
|
+
else if (key.return) {
|
|
81
|
+
const option = getCurrentOption();
|
|
82
|
+
if (!option)
|
|
83
|
+
return false;
|
|
84
|
+
if (option.id === 'yes') {
|
|
85
|
+
onApprove({});
|
|
86
|
+
}
|
|
87
|
+
else if (option.id === 'yes-session') {
|
|
88
|
+
onApprove({ rememberChoice: true });
|
|
89
|
+
}
|
|
90
|
+
else if (option.id === 'yes-accept-edits') {
|
|
91
|
+
// Approve and enable "accept all edits" mode
|
|
92
|
+
onApprove({ enableAcceptEditsMode: true });
|
|
93
|
+
}
|
|
94
|
+
else if (option.id === 'no') {
|
|
95
|
+
onDeny();
|
|
96
|
+
}
|
|
97
|
+
else if (option.id.startsWith('pattern-')) {
|
|
98
|
+
// Extract pattern index and get the pattern string
|
|
99
|
+
const patternIndex = parseInt(option.id.replace('pattern-', ''), 10);
|
|
100
|
+
const pattern = suggestedPatterns[patternIndex];
|
|
101
|
+
if (pattern) {
|
|
102
|
+
onApprove({ rememberPattern: pattern });
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
onApprove({});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
else if (key.shift && key.tab && isEditOrWriteTool) {
|
|
111
|
+
// Shift+Tab on edit/write tool: approve and enable "accept all edits" mode
|
|
112
|
+
onApprove({ enableAcceptEditsMode: true });
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
else if (key.escape) {
|
|
116
|
+
onCancel();
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
},
|
|
121
|
+
}), [
|
|
122
|
+
isElicitation,
|
|
123
|
+
isEditOrWriteTool,
|
|
124
|
+
options,
|
|
125
|
+
suggestedPatterns,
|
|
126
|
+
onApprove,
|
|
127
|
+
onDeny,
|
|
128
|
+
onCancel,
|
|
129
|
+
]);
|
|
130
|
+
// For elicitation, render the form
|
|
131
|
+
if (isElicitation) {
|
|
132
|
+
const metadata = approval.metadata;
|
|
133
|
+
return (_jsx(ElicitationForm, { ref: elicitationFormRef, metadata: metadata, onSubmit: (formData) => onApprove({ formData }), onCancel: onCancel }));
|
|
134
|
+
}
|
|
51
135
|
// Extract information from metadata based on approval type
|
|
52
|
-
const toolName = approval.metadata.toolName;
|
|
53
136
|
const command = approval.metadata.command;
|
|
54
|
-
|
|
55
|
-
|
|
137
|
+
const displayPreview = approval.metadata.displayPreview;
|
|
138
|
+
// Render preview based on display type
|
|
139
|
+
const renderPreview = () => {
|
|
140
|
+
if (!displayPreview)
|
|
141
|
+
return null;
|
|
142
|
+
switch (displayPreview.type) {
|
|
143
|
+
case 'diff': {
|
|
144
|
+
const isOverwrite = toolName === 'internal--write_file' || toolName === 'write_file';
|
|
145
|
+
return (_jsx(DiffPreview, { data: displayPreview, headerType: isOverwrite ? 'overwrite' : 'edit' }));
|
|
146
|
+
}
|
|
147
|
+
case 'shell':
|
|
148
|
+
// For shell preview, just show the command (no output yet)
|
|
149
|
+
return (_jsxs(Box, { marginBottom: 1, flexDirection: "row", children: [_jsx(Text, { dimColor: true, children: "$ " }), _jsx(Text, { color: "yellow", children: displayPreview.command }), displayPreview.isBackground && _jsx(Text, { dimColor: true, children: " (background)" })] }));
|
|
150
|
+
case 'file':
|
|
151
|
+
// Use enhanced file preview with full content for new file creation
|
|
152
|
+
if (displayPreview.operation === 'create' && displayPreview.content) {
|
|
153
|
+
return _jsx(CreateFilePreview, { data: displayPreview });
|
|
154
|
+
}
|
|
155
|
+
// Fallback for other file operations
|
|
156
|
+
return (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { dimColor: true, children: [displayPreview.operation === 'read' &&
|
|
157
|
+
`Read ${displayPreview.lineCount ?? 'file'} lines`, displayPreview.operation === 'write' &&
|
|
158
|
+
`Write to ${displayPreview.path}`, displayPreview.operation === 'delete' &&
|
|
159
|
+
`Delete ${displayPreview.path}`] }) }));
|
|
160
|
+
default:
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
return (_jsxs(Box, { paddingX: 0, paddingY: 0, flexDirection: "column", children: [_jsxs(Box, { flexDirection: "column", marginBottom: 0, children: [_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: "yellow", bold: true, children: ["\uD83D\uDD10 Approval:", ' '] }), toolName && _jsx(Text, { color: "cyan", children: toolName })] }), isCommandConfirmation && command && (_jsxs(Box, { flexDirection: "row", marginTop: 0, children: [_jsx(Text, { color: "gray", children: ' Command: ' }), _jsx(Text, { color: "red", children: command })] }))] }), renderPreview(), _jsx(Box, { flexDirection: "column", marginTop: 0, children: options.map((option, index) => {
|
|
165
|
+
const isSelected = index === selectedIndex;
|
|
166
|
+
const isNo = option.id === 'no';
|
|
167
|
+
return (_jsx(Box, { children: isSelected ? (_jsxs(Text, { color: isNo ? 'red' : 'green', bold: true, children: [' ▶ ', option.label] })) : (_jsxs(Text, { color: "gray", children: [' ', option.label] })) }, option.id));
|
|
168
|
+
}) }), _jsx(Box, { marginTop: 0, children: _jsxs(Text, { color: "gray", dimColor: true, children: [' ', "\u2191\u2193 to select \u2022 Enter to confirm \u2022 Esc to cancel"] }) })] }));
|
|
169
|
+
});
|
|
170
|
+
ApprovalPrompt.displayName = 'ApprovalPrompt';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ElicitationForm Component
|
|
3
|
+
* Renders a form for ask_user/elicitation requests in the CLI
|
|
4
|
+
* Supports string, number, boolean, and enum field types
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { Key } from '../hooks/useInputOrchestrator.js';
|
|
8
|
+
import type { ElicitationMetadata } from '@dexto/core';
|
|
9
|
+
export interface ElicitationFormHandle {
|
|
10
|
+
handleInput: (input: string, key: Key) => boolean;
|
|
11
|
+
}
|
|
12
|
+
interface ElicitationFormProps {
|
|
13
|
+
metadata: ElicitationMetadata;
|
|
14
|
+
onSubmit: (formData: Record<string, unknown>) => void;
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Form component for elicitation/ask_user requests
|
|
19
|
+
*/
|
|
20
|
+
export declare const ElicitationForm: React.ForwardRefExoticComponent<ElicitationFormProps & React.RefAttributes<ElicitationFormHandle>>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=ElicitationForm.d.ts.map
|