dexto 1.3.0 → 1.5.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 +87 -22
- package/dist/agents/agent-registry.json +9 -0
- package/dist/agents/agent-template.yml +2 -2
- package/dist/agents/coding-agent/coding-agent.yml +27 -16
- package/dist/agents/database-agent/database-agent.yml +2 -2
- package/dist/agents/default-agent.yml +9 -7
- package/dist/agents/github-agent/github-agent.yml +2 -2
- package/dist/agents/product-name-researcher/product-name-researcher.yml +2 -2
- package/dist/agents/talk2pdf-agent/talk2pdf-agent.yml +2 -2
- package/dist/analytics/events.d.ts +13 -6
- package/dist/analytics/events.d.ts.map +1 -1
- package/dist/analytics/index.d.ts +1 -1
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/analytics/index.js +6 -2
- package/dist/api/server-hono.d.ts.map +1 -1
- package/dist/api/server-hono.js +65 -9
- package/dist/cli/cli-subscriber.d.ts +4 -0
- package/dist/cli/cli-subscriber.d.ts.map +1 -1
- package/dist/cli/cli-subscriber.js +47 -3
- package/dist/cli/commands/create-app.d.ts +16 -14
- package/dist/cli/commands/create-app.d.ts.map +1 -1
- package/dist/cli/commands/create-app.js +626 -102
- package/dist/cli/commands/create-image.d.ts +7 -0
- package/dist/cli/commands/create-image.d.ts.map +1 -0
- package/dist/cli/commands/create-image.js +201 -0
- package/dist/cli/commands/helpers/formatters.d.ts.map +1 -1
- package/dist/cli/commands/helpers/formatters.js +9 -8
- package/dist/cli/commands/index.d.ts +2 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +2 -1
- package/dist/cli/commands/init-app.js +7 -7
- package/dist/cli/commands/install.d.ts +0 -3
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +19 -70
- 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 +7 -22
- 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 +77 -60
- 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 +106 -77
- 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 +38 -34
- package/dist/cli/commands/session-commands.js +16 -16
- package/dist/cli/commands/setup.d.ts +13 -5
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +860 -65
- 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 +18 -4
- 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 +26 -3
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +182 -45
- package/dist/cli/ink-cli/components/CustomInput.js +1 -1
- package/dist/cli/ink-cli/components/EditableMultiLineInput.js +4 -4
- 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/ErrorBoundary.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ErrorBoundary.js +1 -1
- 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/MultiLineInput.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/MultiLineInput.js +3 -3
- 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 +50 -10
- 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/BaseAutocomplete.js +4 -4
- 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/Footer.js +1 -1
- 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 +6 -3
- 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 +5 -3
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.js +21 -7
- 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 +29 -0
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +286 -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 +400 -23
- 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/overlays/custom-model-wizard/LocalModelWizard.d.ts +25 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.js +609 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.d.ts +15 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/index.js +14 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts +33 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.js +419 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts +25 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ApiKeyStep.js +29 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts +17 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/ProviderSelector.js +11 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts +20 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/SetupInfoBanner.js +10 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts +30 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/WizardStepInput.js +13 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.d.ts +8 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/shared/index.js +7 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.d.ts +79 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/types.js +38 -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 +362 -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 +513 -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 +1214 -132
- 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 +90 -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 +190 -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 +742 -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 +223 -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 +59 -3
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +348 -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 +15 -0
- package/dist/cli/utils/api-key-setup.d.ts +54 -4
- package/dist/cli/utils/api-key-setup.d.ts.map +1 -1
- package/dist/cli/utils/api-key-setup.js +433 -107
- package/dist/cli/utils/api-key-verification.d.ts +17 -0
- package/dist/cli/utils/api-key-verification.d.ts.map +1 -0
- package/dist/cli/utils/api-key-verification.js +211 -0
- package/dist/cli/utils/config-validation.d.ts +22 -2
- package/dist/cli/utils/config-validation.d.ts.map +1 -1
- package/dist/cli/utils/config-validation.js +354 -25
- package/dist/cli/utils/local-model-setup.d.ts +46 -0
- package/dist/cli/utils/local-model-setup.d.ts.map +1 -0
- package/dist/cli/utils/local-model-setup.js +662 -0
- package/dist/cli/utils/options.d.ts.map +1 -1
- package/dist/cli/utils/options.js +1 -3
- package/dist/cli/utils/prompt-helpers.d.ts +47 -0
- package/dist/cli/utils/prompt-helpers.d.ts.map +1 -0
- package/dist/cli/utils/prompt-helpers.js +66 -0
- package/dist/cli/utils/provider-setup.d.ts +66 -8
- package/dist/cli/utils/provider-setup.d.ts.map +1 -1
- package/dist/cli/utils/provider-setup.js +324 -84
- package/dist/cli/utils/scaffolding-utils.d.ts +76 -0
- package/dist/cli/utils/scaffolding-utils.d.ts.map +1 -0
- package/dist/cli/utils/scaffolding-utils.js +246 -0
- package/dist/cli/utils/setup-utils.d.ts +16 -0
- package/dist/cli/utils/setup-utils.d.ts.map +1 -1
- package/dist/cli/utils/setup-utils.js +72 -21
- package/dist/cli/utils/template-engine.d.ts +65 -0
- package/dist/cli/utils/template-engine.d.ts.map +1 -0
- package/dist/cli/utils/template-engine.js +1089 -0
- package/dist/config/cli-overrides.d.ts +45 -2
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +107 -10
- package/dist/index.js +379 -99
- 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-8j-KMkX1.js +2054 -0
- package/dist/webui/assets/index-c_AX24V4.css +1 -0
- package/dist/webui/assets/{tanstack-DgxBONJY.js → tanstack-Br79RQ-n.js} +1 -1
- package/dist/webui/index.html +4 -10
- package/dist/webui/logos/aws-color.svg +1 -0
- package/dist/webui/logos/dexto/dexto_logo.svg +1 -1
- package/dist/webui/logos/dexto/dexto_logo_light.svg +6 -6
- package/dist/webui/logos/glama.svg +7 -0
- package/dist/webui/logos/litellm.svg +7 -0
- package/dist/webui/logos/openrouter.svg +1 -0
- package/package.json +18 -15
- 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
|
@@ -2,143 +2,571 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
/**
|
|
3
3
|
* InputContainer Component
|
|
4
4
|
* Smart container for input area - handles submission and state
|
|
5
|
+
*
|
|
6
|
+
* Buffer is passed as prop from parent (useCLIState).
|
|
7
|
+
* No more ref chain - buffer can be accessed directly.
|
|
5
8
|
*/
|
|
6
|
-
import { useCallback, useRef } from 'react';
|
|
9
|
+
import { useCallback, useRef, useEffect, useImperativeHandle, forwardRef } from 'react';
|
|
7
10
|
import { InputArea } from '../components/input/InputArea.js';
|
|
11
|
+
import { processStream } from '../services/index.js';
|
|
8
12
|
import { createUserMessage } from '../utils/messageFormatting.js';
|
|
9
13
|
import { generateMessageId } from '../utils/idGenerator.js';
|
|
14
|
+
import { capture } from '../../../analytics/index.js';
|
|
10
15
|
/**
|
|
11
16
|
* Smart container for input area
|
|
12
|
-
* Manages
|
|
17
|
+
* Manages submission, history, and overlay triggers
|
|
13
18
|
*/
|
|
14
|
-
export function InputContainer({
|
|
15
|
-
const { input, ui, approval, session } = state;
|
|
19
|
+
export const InputContainer = forwardRef(function InputContainer({ buffer, input, ui, session, approval, queuedMessages, setInput, setUi, setSession, setMessages, setPendingMessages, setDequeuedBuffer, setQueuedMessages, setApproval, setApprovalQueue, agent, inputService, onKeyboardScroll, useStreaming = true, }, ref) {
|
|
16
20
|
// Track pending session creation to prevent race conditions
|
|
17
|
-
// when multiple messages are sent before first session is created
|
|
18
21
|
const sessionCreationPromiseRef = useRef(null);
|
|
19
|
-
//
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// Ref to track autoApproveEdits so processStream can read latest value mid-stream
|
|
23
|
+
const autoApproveEditsRef = useRef(ui.autoApproveEdits);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
autoApproveEditsRef.current = ui.autoApproveEdits;
|
|
26
|
+
}, [ui.autoApproveEdits]);
|
|
27
|
+
// Clear the session creation ref when session is cleared
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (session.id === null) {
|
|
30
|
+
sessionCreationPromiseRef.current = null;
|
|
31
|
+
}
|
|
32
|
+
}, [session.id]);
|
|
33
|
+
// Extract text content from ContentPart[]
|
|
34
|
+
const extractTextFromContent = useCallback((content) => {
|
|
35
|
+
return content
|
|
36
|
+
.filter((part) => part.type === 'text')
|
|
37
|
+
.map((part) => part.text)
|
|
38
|
+
.join('\n');
|
|
39
|
+
}, []);
|
|
40
|
+
// Handle history navigation - set text directly on buffer
|
|
41
|
+
// Up arrow first edits queued messages (removes from queue), then navigates history
|
|
24
42
|
const handleHistoryNavigate = useCallback((direction) => {
|
|
25
|
-
|
|
26
|
-
|
|
43
|
+
const { history, historyIndex, draftBeforeHistory } = input;
|
|
44
|
+
if (direction === 'up') {
|
|
45
|
+
// First check if there are queued messages to edit
|
|
46
|
+
if (queuedMessages.length > 0 && session.id) {
|
|
47
|
+
// Get the last queued message
|
|
48
|
+
const lastQueued = queuedMessages[queuedMessages.length - 1];
|
|
49
|
+
if (lastQueued) {
|
|
50
|
+
// Extract text content and put it in the input
|
|
51
|
+
const text = extractTextFromContent(lastQueued.content);
|
|
52
|
+
buffer.setText(text);
|
|
53
|
+
setInput((prev) => ({ ...prev, value: text }));
|
|
54
|
+
// Remove from queue (this will trigger the event and update queuedMessages state)
|
|
55
|
+
agent.removeQueuedMessage(session.id, lastQueued.id).catch(() => {
|
|
56
|
+
// Silently ignore errors - queue might have been cleared
|
|
57
|
+
});
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Don't navigate history when processing (only queue editing is allowed)
|
|
62
|
+
if (ui.isProcessing)
|
|
63
|
+
return;
|
|
64
|
+
// No queued messages, navigate history
|
|
65
|
+
if (history.length === 0)
|
|
66
|
+
return;
|
|
67
|
+
let newIndex = historyIndex;
|
|
68
|
+
if (newIndex < 0) {
|
|
69
|
+
// First time pressing up - save current input as draft
|
|
70
|
+
const currentText = buffer.text;
|
|
71
|
+
setInput((prev) => ({
|
|
72
|
+
...prev,
|
|
73
|
+
draftBeforeHistory: currentText,
|
|
74
|
+
historyIndex: history.length - 1,
|
|
75
|
+
value: history[history.length - 1] || '',
|
|
76
|
+
}));
|
|
77
|
+
buffer.setText(history[history.length - 1] || '');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
else if (newIndex > 0) {
|
|
81
|
+
newIndex = newIndex - 1;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
return; // Already at oldest
|
|
85
|
+
}
|
|
86
|
+
const historyItem = history[newIndex] || '';
|
|
87
|
+
buffer.setText(historyItem);
|
|
88
|
+
setInput((prev) => ({ ...prev, value: historyItem, historyIndex: newIndex }));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
// Down - navigate history (queued messages don't affect down navigation)
|
|
92
|
+
// Don't navigate history when processing
|
|
93
|
+
if (ui.isProcessing)
|
|
94
|
+
return;
|
|
95
|
+
if (historyIndex < 0)
|
|
96
|
+
return; // Not navigating history
|
|
97
|
+
if (historyIndex < history.length - 1) {
|
|
98
|
+
const newIndex = historyIndex + 1;
|
|
99
|
+
const historyItem = history[newIndex] || '';
|
|
100
|
+
buffer.setText(historyItem);
|
|
101
|
+
setInput((prev) => ({
|
|
102
|
+
...prev,
|
|
103
|
+
value: historyItem,
|
|
104
|
+
historyIndex: newIndex,
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
// At newest history item, restore draft
|
|
109
|
+
buffer.setText(draftBeforeHistory);
|
|
110
|
+
setInput((prev) => ({
|
|
111
|
+
...prev,
|
|
112
|
+
value: draftBeforeHistory,
|
|
113
|
+
historyIndex: -1,
|
|
114
|
+
draftBeforeHistory: '',
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}, [
|
|
119
|
+
buffer,
|
|
120
|
+
input,
|
|
121
|
+
setInput,
|
|
122
|
+
queuedMessages,
|
|
123
|
+
session.id,
|
|
124
|
+
agent,
|
|
125
|
+
extractTextFromContent,
|
|
126
|
+
ui.isProcessing,
|
|
127
|
+
]);
|
|
128
|
+
// Handle overlay triggers
|
|
129
|
+
const handleTriggerOverlay = useCallback((trigger) => {
|
|
130
|
+
if (ui.isProcessing || approval)
|
|
131
|
+
return;
|
|
132
|
+
if (trigger === 'close') {
|
|
133
|
+
if (ui.activeOverlay === 'slash-autocomplete' ||
|
|
134
|
+
ui.activeOverlay === 'resource-autocomplete') {
|
|
135
|
+
setUi((prev) => ({
|
|
136
|
+
...prev,
|
|
137
|
+
activeOverlay: 'none',
|
|
138
|
+
mcpWizardServerType: null,
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else if (trigger === 'slash-autocomplete') {
|
|
143
|
+
setUi((prev) => ({ ...prev, activeOverlay: 'slash-autocomplete' }));
|
|
144
|
+
}
|
|
145
|
+
else if (trigger === 'resource-autocomplete') {
|
|
146
|
+
setUi((prev) => ({ ...prev, activeOverlay: 'resource-autocomplete' }));
|
|
147
|
+
}
|
|
148
|
+
}, [setUi, ui.isProcessing, ui.activeOverlay, approval]);
|
|
149
|
+
// Handle image paste from clipboard
|
|
150
|
+
const handleImagePaste = useCallback((image) => {
|
|
151
|
+
// Track image attachment analytics (only if session exists)
|
|
152
|
+
if (session.id) {
|
|
153
|
+
capture('dexto_image_attached', {
|
|
154
|
+
source: 'cli',
|
|
155
|
+
sessionId: session.id,
|
|
156
|
+
imageType: image.mimeType,
|
|
157
|
+
imageSizeBytes: Math.floor(image.data.length * 0.75), // Approx base64 decode
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
setInput((prev) => ({
|
|
161
|
+
...prev,
|
|
162
|
+
images: [...prev.images, image],
|
|
163
|
+
}));
|
|
164
|
+
}, [setInput, session.id]);
|
|
165
|
+
// Handle image removal (when placeholder is deleted from text)
|
|
166
|
+
const handleImageRemove = useCallback((imageId) => {
|
|
167
|
+
setInput((prev) => ({
|
|
168
|
+
...prev,
|
|
169
|
+
images: prev.images.filter((img) => img.id !== imageId),
|
|
170
|
+
}));
|
|
171
|
+
}, [setInput]);
|
|
172
|
+
// Handle new paste block creation (when large text is pasted)
|
|
173
|
+
const handlePasteBlock = useCallback((block) => {
|
|
174
|
+
setInput((prev) => ({
|
|
175
|
+
...prev,
|
|
176
|
+
pastedBlocks: [...prev.pastedBlocks, block],
|
|
177
|
+
pasteCounter: Math.max(prev.pasteCounter, block.number),
|
|
178
|
+
}));
|
|
179
|
+
}, [setInput]);
|
|
180
|
+
// Handle paste block update (e.g., toggle collapse)
|
|
181
|
+
const handlePasteBlockUpdate = useCallback((blockId, updates) => {
|
|
182
|
+
setInput((prev) => ({
|
|
183
|
+
...prev,
|
|
184
|
+
pastedBlocks: prev.pastedBlocks.map((block) => block.id === blockId ? { ...block, ...updates } : block),
|
|
185
|
+
}));
|
|
186
|
+
}, [setInput]);
|
|
187
|
+
// Handle paste block removal (when placeholder is deleted from text)
|
|
188
|
+
const handlePasteBlockRemove = useCallback((blockId) => {
|
|
189
|
+
setInput((prev) => ({
|
|
190
|
+
...prev,
|
|
191
|
+
pastedBlocks: prev.pastedBlocks.filter((block) => block.id !== blockId),
|
|
192
|
+
}));
|
|
193
|
+
}, [setInput]);
|
|
194
|
+
// Expand all collapsed paste blocks in a text string
|
|
195
|
+
const expandPasteBlocks = useCallback((text, blocks) => {
|
|
196
|
+
let result = text;
|
|
197
|
+
// Sort blocks by placeholder position descending to avoid offset issues
|
|
198
|
+
const sortedBlocks = [...blocks].sort((a, b) => {
|
|
199
|
+
const posA = result.indexOf(a.placeholder);
|
|
200
|
+
const posB = result.indexOf(b.placeholder);
|
|
201
|
+
return posB - posA;
|
|
202
|
+
});
|
|
203
|
+
for (const block of sortedBlocks) {
|
|
204
|
+
if (block.isCollapsed) {
|
|
205
|
+
// Replace placeholder with full text
|
|
206
|
+
result = result.replace(block.placeholder, block.fullText);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return result;
|
|
210
|
+
}, []);
|
|
27
211
|
// Handle submission
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
212
|
+
// bypassOverlayCheck: skip the overlay check when called programmatically (e.g., from OverlayContainer)
|
|
213
|
+
const handleSubmit = useCallback(async (value, bypassOverlayCheck = false) => {
|
|
214
|
+
// Expand all collapsed paste blocks before processing
|
|
215
|
+
const expandedValue = expandPasteBlocks(value, input.pastedBlocks);
|
|
216
|
+
const trimmed = expandedValue.trim();
|
|
217
|
+
if (!trimmed)
|
|
31
218
|
return;
|
|
219
|
+
// Auto-queue when agent is processing
|
|
220
|
+
if (ui.isProcessing && session.id) {
|
|
221
|
+
// Build content parts for queueing
|
|
222
|
+
const content = [{ type: 'text', text: trimmed }];
|
|
223
|
+
// Add images if any
|
|
224
|
+
for (const img of input.images) {
|
|
225
|
+
content.push({
|
|
226
|
+
type: 'image',
|
|
227
|
+
image: img.data,
|
|
228
|
+
mimeType: img.mimeType,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
try {
|
|
232
|
+
await agent.queueMessage(session.id, { content });
|
|
233
|
+
// Queued messages are displayed via QueuedMessagesDisplay component
|
|
234
|
+
// (state updated by message:queued event handler in useAgentEvents)
|
|
235
|
+
// Clear input, update history, and clear images
|
|
236
|
+
buffer.setText('');
|
|
237
|
+
setInput((prev) => {
|
|
238
|
+
const newHistory = prev.history.length > 0 &&
|
|
239
|
+
prev.history[prev.history.length - 1] === trimmed
|
|
240
|
+
? prev.history
|
|
241
|
+
: [...prev.history, trimmed].slice(-100);
|
|
242
|
+
return {
|
|
243
|
+
...prev,
|
|
244
|
+
value: '',
|
|
245
|
+
history: newHistory,
|
|
246
|
+
historyIndex: -1,
|
|
247
|
+
draftBeforeHistory: '',
|
|
248
|
+
images: [],
|
|
249
|
+
pastedBlocks: [],
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
setMessages((prev) => [
|
|
255
|
+
...prev,
|
|
256
|
+
{
|
|
257
|
+
id: generateMessageId('error'),
|
|
258
|
+
role: 'system',
|
|
259
|
+
content: `Failed to queue message: ${error instanceof Error ? error.message : String(error)}`,
|
|
260
|
+
timestamp: new Date(),
|
|
261
|
+
},
|
|
262
|
+
]);
|
|
263
|
+
}
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
32
266
|
// Prevent double submission when autocomplete/selector is active
|
|
33
|
-
//
|
|
34
|
-
if (
|
|
267
|
+
// Skip this check when called programmatically (e.g., from OverlayContainer prompt selection)
|
|
268
|
+
if (!bypassOverlayCheck &&
|
|
269
|
+
ui.activeOverlay !== 'none' &&
|
|
270
|
+
ui.activeOverlay !== 'approval') {
|
|
35
271
|
return;
|
|
36
272
|
}
|
|
37
|
-
//
|
|
273
|
+
// Capture images before clearing - we need them for the API call
|
|
274
|
+
const pendingImages = [...input.images];
|
|
275
|
+
// Create user message and add it to messages
|
|
38
276
|
const userMessage = createUserMessage(trimmed);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
277
|
+
setMessages((prev) => [...prev, userMessage]);
|
|
278
|
+
// Clear input directly on buffer and update history
|
|
279
|
+
buffer.setText('');
|
|
280
|
+
setInput((prev) => {
|
|
281
|
+
const newHistory = prev.history.length > 0 && prev.history[prev.history.length - 1] === trimmed
|
|
282
|
+
? prev.history
|
|
283
|
+
: [...prev.history, trimmed].slice(-100);
|
|
284
|
+
return {
|
|
285
|
+
value: '',
|
|
286
|
+
history: newHistory,
|
|
287
|
+
historyIndex: -1,
|
|
288
|
+
draftBeforeHistory: '',
|
|
289
|
+
images: [], // Clear images on submit
|
|
290
|
+
pastedBlocks: [], // Clear paste blocks on submit
|
|
291
|
+
pasteCounter: prev.pasteCounter, // Keep counter for next session
|
|
292
|
+
};
|
|
44
293
|
});
|
|
294
|
+
// Start processing
|
|
295
|
+
setUi((prev) => ({
|
|
296
|
+
...prev,
|
|
297
|
+
isProcessing: true,
|
|
298
|
+
isCancelling: false,
|
|
299
|
+
activeOverlay: 'none',
|
|
300
|
+
exitWarningShown: false,
|
|
301
|
+
exitWarningTimestamp: null,
|
|
302
|
+
}));
|
|
45
303
|
// Parse and handle command or prompt
|
|
46
304
|
const parsed = inputService.parseInput(trimmed);
|
|
305
|
+
// Check if this command should show an interactive overlay
|
|
306
|
+
if (parsed.type === 'command' && parsed.command) {
|
|
307
|
+
const { getCommandOverlay } = await import('../utils/commandOverlays.js');
|
|
308
|
+
const overlay = getCommandOverlay(parsed.command, parsed.args || []);
|
|
309
|
+
if (overlay) {
|
|
310
|
+
setUi((prev) => ({
|
|
311
|
+
...prev,
|
|
312
|
+
isProcessing: false,
|
|
313
|
+
activeOverlay: overlay,
|
|
314
|
+
}));
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
47
318
|
if (parsed.type === 'command' && parsed.command) {
|
|
48
|
-
// Import command service dynamically to avoid circular deps
|
|
49
319
|
const { CommandService } = await import('../services/CommandService.js');
|
|
50
320
|
const commandService = new CommandService();
|
|
51
321
|
try {
|
|
52
|
-
|
|
53
|
-
const currentSessionId = session.id;
|
|
54
|
-
const result = await commandService.executeCommand(parsed.command, parsed.args || [], agent, currentSessionId || undefined);
|
|
55
|
-
if (result.type === 'prompt') {
|
|
56
|
-
// Command executed a prompt via agent.run()
|
|
57
|
-
// Processing will continue via event bus
|
|
58
|
-
// Don't set SUBMIT_COMPLETE here - wait for agent response
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
322
|
+
const result = await commandService.executeCommand(parsed.command, parsed.args || [], agent, session.id || undefined);
|
|
61
323
|
if (result.type === 'output' && result.output) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
324
|
+
const output = result.output;
|
|
325
|
+
setMessages((prev) => [
|
|
326
|
+
...prev,
|
|
327
|
+
{
|
|
66
328
|
id: generateMessageId('command'),
|
|
67
329
|
role: 'system',
|
|
68
|
-
content:
|
|
330
|
+
content: output,
|
|
69
331
|
timestamp: new Date(),
|
|
70
332
|
},
|
|
333
|
+
]);
|
|
334
|
+
}
|
|
335
|
+
if (result.type === 'styled' && result.styled) {
|
|
336
|
+
const { fallbackText, styledType, styledData } = result.styled;
|
|
337
|
+
setMessages((prev) => [
|
|
338
|
+
...prev,
|
|
339
|
+
{
|
|
340
|
+
id: generateMessageId('command'),
|
|
341
|
+
role: 'system',
|
|
342
|
+
content: fallbackText,
|
|
343
|
+
timestamp: new Date(),
|
|
344
|
+
styledType,
|
|
345
|
+
styledData,
|
|
346
|
+
},
|
|
347
|
+
]);
|
|
348
|
+
}
|
|
349
|
+
// Handle sendMessage - send through normal streaming flow
|
|
350
|
+
if (result.type === 'sendMessage' && result.messageToSend) {
|
|
351
|
+
let currentSessionId = session.id;
|
|
352
|
+
if (!currentSessionId) {
|
|
353
|
+
if (sessionCreationPromiseRef.current) {
|
|
354
|
+
try {
|
|
355
|
+
const existingSession = await sessionCreationPromiseRef.current;
|
|
356
|
+
currentSessionId = existingSession.id;
|
|
357
|
+
}
|
|
358
|
+
catch {
|
|
359
|
+
sessionCreationPromiseRef.current = null;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (!currentSessionId) {
|
|
363
|
+
const sessionPromise = agent.createSession();
|
|
364
|
+
sessionCreationPromiseRef.current = sessionPromise;
|
|
365
|
+
const newSession = await sessionPromise;
|
|
366
|
+
currentSessionId = newSession.id;
|
|
367
|
+
setSession((prev) => ({
|
|
368
|
+
...prev,
|
|
369
|
+
id: currentSessionId,
|
|
370
|
+
hasActiveSession: true,
|
|
371
|
+
}));
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (!currentSessionId) {
|
|
375
|
+
throw new Error('Failed to create or retrieve session');
|
|
376
|
+
}
|
|
377
|
+
// Send through normal streaming flow (matches WebUI pattern)
|
|
378
|
+
const iterator = await agent.stream(result.messageToSend, currentSessionId);
|
|
379
|
+
await processStream(iterator, {
|
|
380
|
+
setMessages,
|
|
381
|
+
setPendingMessages,
|
|
382
|
+
setDequeuedBuffer,
|
|
383
|
+
setUi,
|
|
384
|
+
setQueuedMessages,
|
|
385
|
+
setApproval,
|
|
386
|
+
setApprovalQueue,
|
|
387
|
+
}, {
|
|
388
|
+
useStreaming,
|
|
389
|
+
autoApproveEditsRef,
|
|
390
|
+
eventBus: agent.agentEventBus,
|
|
71
391
|
});
|
|
392
|
+
return; // processStream handles UI state
|
|
72
393
|
}
|
|
73
|
-
|
|
74
|
-
|
|
394
|
+
setUi((prev) => ({
|
|
395
|
+
...prev,
|
|
396
|
+
isProcessing: false,
|
|
397
|
+
isCancelling: false,
|
|
398
|
+
isThinking: false,
|
|
399
|
+
}));
|
|
75
400
|
}
|
|
76
401
|
catch (error) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
402
|
+
setMessages((prev) => [
|
|
403
|
+
...prev,
|
|
404
|
+
{
|
|
405
|
+
id: generateMessageId('error'),
|
|
406
|
+
role: 'system',
|
|
407
|
+
content: `❌ Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
408
|
+
timestamp: new Date(),
|
|
409
|
+
},
|
|
410
|
+
]);
|
|
411
|
+
setUi((prev) => ({
|
|
412
|
+
...prev,
|
|
413
|
+
isProcessing: false,
|
|
414
|
+
isCancelling: false,
|
|
415
|
+
isThinking: false,
|
|
416
|
+
}));
|
|
81
417
|
}
|
|
82
418
|
}
|
|
83
419
|
else {
|
|
84
|
-
// Regular prompt - pass to AI with explicit sessionId
|
|
85
420
|
try {
|
|
86
|
-
const streamingId = generateMessageId('assistant');
|
|
87
|
-
dispatch({ type: 'STREAMING_START', id: streamingId });
|
|
88
|
-
// Pass sessionId explicitly to agent.run() like WebUI does
|
|
89
|
-
// Use sessionId from state (never from getCurrentSessionId)
|
|
90
421
|
let currentSessionId = session.id;
|
|
91
|
-
// Create session on first message if not already created (deferred creation)
|
|
92
|
-
// Use ref to prevent race condition when multiple messages sent rapidly
|
|
93
422
|
if (!currentSessionId) {
|
|
94
|
-
// Check if session creation is already in progress
|
|
95
423
|
if (sessionCreationPromiseRef.current) {
|
|
96
|
-
// Wait for existing session creation to complete
|
|
97
|
-
const existingSession = await sessionCreationPromiseRef.current;
|
|
98
|
-
currentSessionId = existingSession.id;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
// Start new session creation and store promise in ref
|
|
102
|
-
const sessionPromise = agent.createSession();
|
|
103
|
-
sessionCreationPromiseRef.current = sessionPromise;
|
|
104
424
|
try {
|
|
105
|
-
const
|
|
106
|
-
currentSessionId =
|
|
107
|
-
dispatch({
|
|
108
|
-
type: 'SESSION_SET',
|
|
109
|
-
sessionId: currentSessionId,
|
|
110
|
-
hasActiveSession: true,
|
|
111
|
-
});
|
|
425
|
+
const existingSession = await sessionCreationPromiseRef.current;
|
|
426
|
+
currentSessionId = existingSession.id;
|
|
112
427
|
}
|
|
113
|
-
|
|
114
|
-
// Clear the ref after creation completes (success or failure)
|
|
428
|
+
catch {
|
|
115
429
|
sessionCreationPromiseRef.current = null;
|
|
116
430
|
}
|
|
117
431
|
}
|
|
432
|
+
if (!currentSessionId) {
|
|
433
|
+
const sessionPromise = agent.createSession();
|
|
434
|
+
sessionCreationPromiseRef.current = sessionPromise;
|
|
435
|
+
const newSession = await sessionPromise;
|
|
436
|
+
currentSessionId = newSession.id;
|
|
437
|
+
setSession((prev) => ({
|
|
438
|
+
...prev,
|
|
439
|
+
id: currentSessionId,
|
|
440
|
+
hasActiveSession: true,
|
|
441
|
+
}));
|
|
442
|
+
}
|
|
118
443
|
}
|
|
119
|
-
// At this point currentSessionId must be defined (either from state or created above)
|
|
120
444
|
if (!currentSessionId) {
|
|
121
445
|
throw new Error('Failed to create or retrieve session');
|
|
122
446
|
}
|
|
123
|
-
await agent.
|
|
124
|
-
|
|
125
|
-
//
|
|
447
|
+
const metadata = await agent.getSessionMetadata(currentSessionId);
|
|
448
|
+
const isFirstMessage = !metadata || metadata.messageCount <= 0;
|
|
449
|
+
// Build content with images if any
|
|
450
|
+
let content;
|
|
451
|
+
if (pendingImages.length > 0) {
|
|
452
|
+
// Build multimodal content parts
|
|
453
|
+
const parts = [];
|
|
454
|
+
// Add text part first
|
|
455
|
+
parts.push({ type: 'text', text: trimmed });
|
|
456
|
+
// Add image parts
|
|
457
|
+
for (const img of pendingImages) {
|
|
458
|
+
parts.push({
|
|
459
|
+
type: 'image',
|
|
460
|
+
image: img.data,
|
|
461
|
+
mimeType: img.mimeType,
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
content = parts;
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
content = trimmed;
|
|
468
|
+
}
|
|
469
|
+
// Get current LLM config for analytics
|
|
470
|
+
const llmConfig = agent.getCurrentLLMConfig();
|
|
471
|
+
// Track message sent analytics
|
|
472
|
+
capture('dexto_message_sent', {
|
|
473
|
+
source: 'cli',
|
|
474
|
+
sessionId: currentSessionId,
|
|
475
|
+
provider: llmConfig.provider,
|
|
476
|
+
model: llmConfig.model,
|
|
477
|
+
hasImage: pendingImages.length > 0,
|
|
478
|
+
hasFile: false,
|
|
479
|
+
messageLength: trimmed.length,
|
|
480
|
+
});
|
|
481
|
+
// Use streaming API and process events directly
|
|
482
|
+
const iterator = await agent.stream(content, currentSessionId);
|
|
483
|
+
await processStream(iterator, {
|
|
484
|
+
setMessages,
|
|
485
|
+
setPendingMessages,
|
|
486
|
+
setDequeuedBuffer,
|
|
487
|
+
setUi,
|
|
488
|
+
setQueuedMessages,
|
|
489
|
+
setApproval,
|
|
490
|
+
setApprovalQueue,
|
|
491
|
+
}, {
|
|
492
|
+
useStreaming,
|
|
493
|
+
autoApproveEditsRef,
|
|
494
|
+
eventBus: agent.agentEventBus,
|
|
495
|
+
});
|
|
496
|
+
if (isFirstMessage) {
|
|
497
|
+
agent.generateSessionTitle(currentSessionId).catch(() => {
|
|
498
|
+
// Title generation is non-critical - silently ignore failures
|
|
499
|
+
});
|
|
500
|
+
}
|
|
126
501
|
}
|
|
127
502
|
catch (error) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
503
|
+
setMessages((prev) => [
|
|
504
|
+
...prev,
|
|
505
|
+
{
|
|
506
|
+
id: generateMessageId('error'),
|
|
507
|
+
role: 'system',
|
|
508
|
+
content: `❌ Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
509
|
+
timestamp: new Date(),
|
|
510
|
+
},
|
|
511
|
+
]);
|
|
512
|
+
setUi((prev) => ({
|
|
513
|
+
...prev,
|
|
514
|
+
isProcessing: false,
|
|
515
|
+
isCancelling: false,
|
|
516
|
+
isThinking: false,
|
|
517
|
+
}));
|
|
132
518
|
}
|
|
133
519
|
}
|
|
134
|
-
}, [
|
|
135
|
-
|
|
520
|
+
}, [
|
|
521
|
+
buffer,
|
|
522
|
+
input.images,
|
|
523
|
+
input.pastedBlocks,
|
|
524
|
+
expandPasteBlocks,
|
|
525
|
+
setInput,
|
|
526
|
+
setUi,
|
|
527
|
+
setMessages,
|
|
528
|
+
setPendingMessages,
|
|
529
|
+
setDequeuedBuffer,
|
|
530
|
+
setQueuedMessages,
|
|
531
|
+
setSession,
|
|
532
|
+
agent,
|
|
533
|
+
inputService,
|
|
534
|
+
ui.isProcessing,
|
|
535
|
+
ui.activeOverlay,
|
|
536
|
+
session.id,
|
|
537
|
+
useStreaming,
|
|
538
|
+
]);
|
|
539
|
+
// Determine if input should be active (not blocked by approval/overlay/history search)
|
|
540
|
+
// Input stays active for filter-type overlays (so user can keep typing to filter)
|
|
541
|
+
// Disable for approval prompts, overlays with their own text input, and history search mode
|
|
542
|
+
const overlaysWithOwnInput = [
|
|
543
|
+
'mcp-custom-wizard',
|
|
544
|
+
'custom-model-wizard',
|
|
545
|
+
'api-key-input',
|
|
546
|
+
'search',
|
|
547
|
+
'tool-browser',
|
|
548
|
+
'prompt-add-wizard',
|
|
549
|
+
'model-selector',
|
|
550
|
+
];
|
|
551
|
+
const hasOverlayWithOwnInput = overlaysWithOwnInput.includes(ui.activeOverlay);
|
|
552
|
+
const isHistorySearchActive = ui.historySearch.isActive;
|
|
553
|
+
const isInputActive = !approval && !hasOverlayWithOwnInput && !isHistorySearchActive;
|
|
554
|
+
const isInputDisabled = !!approval || hasOverlayWithOwnInput || isHistorySearchActive;
|
|
555
|
+
// Allow submit when:
|
|
556
|
+
// - no overlay active
|
|
557
|
+
// - approval active
|
|
558
|
+
// Note: slash-autocomplete handles its own Enter key (either executes command or submits raw text)
|
|
559
|
+
const shouldHandleSubmit = ui.activeOverlay === 'none' || ui.activeOverlay === 'approval';
|
|
560
|
+
// Allow history navigation when not blocked by approval/overlay
|
|
561
|
+
// When processing: handler allows queue editing but blocks history navigation
|
|
562
|
+
const canNavigateHistory = !approval && ui.activeOverlay === 'none';
|
|
136
563
|
const placeholder = approval
|
|
137
564
|
? 'Approval required above...'
|
|
138
565
|
: 'Type your message or /help for commands';
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
566
|
+
// Expose submit method for external use (e.g., from OverlayContainer)
|
|
567
|
+
// Pass bypassOverlayCheck=true since programmatic calls should skip the overlay check
|
|
568
|
+
useImperativeHandle(ref, () => ({
|
|
569
|
+
submit: (text) => handleSubmit(text, true),
|
|
570
|
+
}));
|
|
571
|
+
return (_jsx(InputArea, { buffer: buffer, onSubmit: shouldHandleSubmit ? handleSubmit : () => { }, isDisabled: isInputDisabled, isActive: isInputActive, placeholder: placeholder, onHistoryNavigate: canNavigateHistory ? handleHistoryNavigate : undefined, onTriggerOverlay: handleTriggerOverlay, onKeyboardScroll: onKeyboardScroll, imageCount: input.images.length, onImagePaste: handleImagePaste, images: input.images, onImageRemove: handleImageRemove, pastedBlocks: input.pastedBlocks, onPasteBlock: handlePasteBlock, onPasteBlockUpdate: handlePasteBlockUpdate, onPasteBlockRemove: handlePasteBlockRemove, highlightQuery: ui.historySearch.isActive ? ui.historySearch.query : undefined }));
|
|
572
|
+
});
|