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
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the CustomModelWizard component architecture.
|
|
3
|
+
*/
|
|
4
|
+
import type { CustomModel, CustomModelProvider } from '@dexto/agent-management';
|
|
5
|
+
import type { Key } from '../../../hooks/useInputOrchestrator.js';
|
|
6
|
+
/**
|
|
7
|
+
* A single step in the wizard flow.
|
|
8
|
+
*/
|
|
9
|
+
export interface WizardStep {
|
|
10
|
+
field: string;
|
|
11
|
+
label: string;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
validate?: (value: string) => string | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Props passed to each provider-specific wizard component.
|
|
18
|
+
*/
|
|
19
|
+
export interface ProviderWizardProps {
|
|
20
|
+
/** Current accumulated values from all steps */
|
|
21
|
+
values: Record<string, string>;
|
|
22
|
+
/** Current step index within the provider's steps */
|
|
23
|
+
currentStep: number;
|
|
24
|
+
/** Current text input value */
|
|
25
|
+
currentInput: string;
|
|
26
|
+
/** Validation error message (if any) */
|
|
27
|
+
error: string | null;
|
|
28
|
+
/** Whether async validation is in progress */
|
|
29
|
+
isValidating: boolean;
|
|
30
|
+
/** Whether the model is being saved */
|
|
31
|
+
isSaving: boolean;
|
|
32
|
+
/** Whether we're editing an existing model */
|
|
33
|
+
isEditing: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Handle returned by provider components for input handling.
|
|
37
|
+
*/
|
|
38
|
+
export interface ProviderWizardHandle {
|
|
39
|
+
/** Handle keyboard input. Returns true if handled. */
|
|
40
|
+
handleInput: (input: string, key: Key) => boolean;
|
|
41
|
+
/** Get the steps for this provider */
|
|
42
|
+
getSteps: () => WizardStep[];
|
|
43
|
+
/** Get current step config */
|
|
44
|
+
getCurrentStepConfig: () => WizardStep | undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Configuration for a custom model provider.
|
|
48
|
+
*/
|
|
49
|
+
export interface ProviderConfig {
|
|
50
|
+
/** Display name shown in provider selector */
|
|
51
|
+
displayName: string;
|
|
52
|
+
/** Short description of the provider */
|
|
53
|
+
description: string;
|
|
54
|
+
/** Wizard steps for this provider */
|
|
55
|
+
steps: WizardStep[];
|
|
56
|
+
/** Build a CustomModel from accumulated values */
|
|
57
|
+
buildModel: (values: Record<string, string>, provider: CustomModelProvider) => CustomModel;
|
|
58
|
+
/** Optional async validation for specific fields */
|
|
59
|
+
asyncValidation?: {
|
|
60
|
+
field: string;
|
|
61
|
+
validate: (value: string) => Promise<string | null>;
|
|
62
|
+
};
|
|
63
|
+
/** Whether this provider needs a setup info banner */
|
|
64
|
+
setupInfo?: {
|
|
65
|
+
title: string;
|
|
66
|
+
description: string;
|
|
67
|
+
docsUrl?: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Common validation functions
|
|
72
|
+
*/
|
|
73
|
+
export declare const validators: {
|
|
74
|
+
required: (label: string) => (v: string) => string | null;
|
|
75
|
+
url: (v: string) => "URL is required" | "Invalid URL format" | "URL must use http:// or https://" | null;
|
|
76
|
+
positiveNumber: (v: string) => "Must be a positive number" | null;
|
|
77
|
+
slashFormat: (v: string) => "Model ID is required" | "Must use format: provider/model-name" | null;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/ink-cli/components/overlays/custom-model-wizard/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wCAAwC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,8CAA8C;IAC9C,YAAY,EAAE,OAAO,CAAC;IACtB,uCAAuC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,8CAA8C;IAC9C,SAAS,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,sDAAsD;IACtD,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;IAClD,sCAAsC;IACtC,QAAQ,EAAE,MAAM,UAAU,EAAE,CAAC;IAC7B,8BAA8B;IAC9B,oBAAoB,EAAE,MAAM,UAAU,GAAG,SAAS,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,kDAAkD;IAClD,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,mBAAmB,KAAK,WAAW,CAAC;IAC3F,oDAAoD;IACpD,eAAe,CAAC,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;KACvD,CAAC;IACF,sDAAsD;IACtD,SAAS,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACL;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;sBACD,MAAM,MAAM,GAAG,MAAM;aAE9B,MAAM;wBAaK,MAAM;qBAOT,MAAM;CAK1B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the CustomModelWizard component architecture.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Common validation functions
|
|
6
|
+
*/
|
|
7
|
+
export const validators = {
|
|
8
|
+
required: (label) => (v) => (v.trim() ? null : `${label} is required`),
|
|
9
|
+
url: (v) => {
|
|
10
|
+
if (!v.trim())
|
|
11
|
+
return 'URL is required';
|
|
12
|
+
try {
|
|
13
|
+
const url = new URL(v);
|
|
14
|
+
if (!['http:', 'https:'].includes(url.protocol)) {
|
|
15
|
+
return 'URL must use http:// or https://';
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return 'Invalid URL format';
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
positiveNumber: (v) => {
|
|
24
|
+
if (!v.trim())
|
|
25
|
+
return null; // Optional field
|
|
26
|
+
const num = parseInt(v, 10);
|
|
27
|
+
if (isNaN(num) || num <= 0)
|
|
28
|
+
return 'Must be a positive number';
|
|
29
|
+
return null;
|
|
30
|
+
},
|
|
31
|
+
slashFormat: (v) => {
|
|
32
|
+
if (!v.trim())
|
|
33
|
+
return 'Model ID is required';
|
|
34
|
+
if (!v.includes('/'))
|
|
35
|
+
return 'Must use format: provider/model-name';
|
|
36
|
+
return null;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiffRenderer Component
|
|
3
|
+
*
|
|
4
|
+
* Renders unified diff output with colored lines and line numbers.
|
|
5
|
+
* Used for edit_file and write_file (overwrite) tool results in message list.
|
|
6
|
+
* Matches the approval preview UX style.
|
|
7
|
+
*/
|
|
8
|
+
import type { DiffDisplayData } from '@dexto/core';
|
|
9
|
+
interface DiffRendererProps {
|
|
10
|
+
/** Diff display data from tool result */
|
|
11
|
+
data: DiffDisplayData;
|
|
12
|
+
/** Maximum lines to display before truncating */
|
|
13
|
+
maxLines?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Renders unified diff with colored lines, line numbers, and word-level highlighting.
|
|
17
|
+
* Matches the approval preview UX style. No truncation by default.
|
|
18
|
+
*/
|
|
19
|
+
export declare function DiffRenderer({ data, maxLines }: DiffRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=DiffRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/renderers/DiffRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWnD,UAAU,iBAAiB;IACvB,yCAAyC;IACzC,IAAI,EAAE,eAAe,CAAC;IACtB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAmB,EAAE,EAAE,iBAAiB,2CAkH5E"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* DiffRenderer Component
|
|
4
|
+
*
|
|
5
|
+
* Renders unified diff output with colored lines and line numbers.
|
|
6
|
+
* Used for edit_file and write_file (overwrite) tool results in message list.
|
|
7
|
+
* Matches the approval preview UX style.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Box, Text } from 'ink';
|
|
11
|
+
import { makeRelativePath } from '../../utils/messageFormatting.js';
|
|
12
|
+
import { parseUnifiedDiff, findLinePairs, computeWordDiff, getLineNumWidth, DiffLine, HunkSeparator, } from './diff-shared.js';
|
|
13
|
+
/**
|
|
14
|
+
* Renders unified diff with colored lines, line numbers, and word-level highlighting.
|
|
15
|
+
* Matches the approval preview UX style. No truncation by default.
|
|
16
|
+
*/
|
|
17
|
+
export function DiffRenderer({ data, maxLines = Infinity }) {
|
|
18
|
+
const { unified, filename, additions, deletions } = data;
|
|
19
|
+
const hunks = parseUnifiedDiff(unified);
|
|
20
|
+
// Calculate max line number for width
|
|
21
|
+
let maxLineNum = 1;
|
|
22
|
+
for (const hunk of hunks) {
|
|
23
|
+
for (const line of hunk.lines) {
|
|
24
|
+
maxLineNum = Math.max(maxLineNum, line.lineNum);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const lineNumWidth = getLineNumWidth(maxLineNum);
|
|
28
|
+
// Find line pairs for word-level diff
|
|
29
|
+
const allLinePairs = hunks.map((hunk) => findLinePairs(hunk.lines));
|
|
30
|
+
// Count total display lines and apply truncation
|
|
31
|
+
let totalLines = 0;
|
|
32
|
+
for (const hunk of hunks) {
|
|
33
|
+
totalLines += hunk.lines.length;
|
|
34
|
+
}
|
|
35
|
+
const shouldTruncate = totalLines > maxLines;
|
|
36
|
+
let linesRendered = 0;
|
|
37
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: "gray", children: ' ⎿ ' }), _jsx(Text, { children: makeRelativePath(filename) }), _jsxs(Text, { color: "green", children: [" +", additions] }), _jsxs(Text, { color: "red", children: [" -", deletions] })] }), _jsxs(Box, { flexDirection: "column", paddingLeft: 2, children: [hunks.map((hunk, hunkIndex) => {
|
|
38
|
+
if (shouldTruncate && linesRendered >= maxLines) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const linePairs = allLinePairs[hunkIndex];
|
|
42
|
+
const processedIndices = new Set();
|
|
43
|
+
return (_jsxs(React.Fragment, { children: [hunkIndex > 0 && _jsx(HunkSeparator, {}), hunk.lines.map((line, lineIndex) => {
|
|
44
|
+
if (shouldTruncate && linesRendered >= maxLines) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if (processedIndices.has(lineIndex)) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const pair = linePairs.get(lineIndex);
|
|
51
|
+
if (pair) {
|
|
52
|
+
processedIndices.add(lineIndex + 1);
|
|
53
|
+
if (shouldTruncate && linesRendered + 2 > maxLines) {
|
|
54
|
+
linesRendered = maxLines;
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
linesRendered += 2;
|
|
58
|
+
const { oldParts, newParts } = computeWordDiff(pair.del.content, pair.add.content);
|
|
59
|
+
return (_jsxs(React.Fragment, { children: [_jsx(DiffLine, { type: "deletion", lineNum: pair.del.lineNum, lineNumWidth: lineNumWidth, content: pair.del.content, wordDiffParts: oldParts }), _jsx(DiffLine, { type: "addition", lineNum: pair.add.lineNum, lineNumWidth: lineNumWidth, content: pair.add.content, wordDiffParts: newParts })] }, lineIndex));
|
|
60
|
+
}
|
|
61
|
+
linesRendered++;
|
|
62
|
+
return (_jsx(DiffLine, { type: line.type, lineNum: line.lineNum, lineNumWidth: lineNumWidth, content: line.content }, lineIndex));
|
|
63
|
+
})] }, hunkIndex));
|
|
64
|
+
}), shouldTruncate && _jsxs(Text, { color: "gray", children: ["... +", totalLines - maxLines, " lines"] })] })] }));
|
|
65
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Preview Renderers
|
|
3
|
+
*
|
|
4
|
+
* Preview renderers for edit_file and write_file approval prompts.
|
|
5
|
+
* - DiffPreview: for edit_file and write_file (overwrite)
|
|
6
|
+
* - CreateFilePreview: for write_file (new file)
|
|
7
|
+
*/
|
|
8
|
+
import type { DiffDisplayData, FileDisplayData } from '@dexto/core';
|
|
9
|
+
interface DiffPreviewProps {
|
|
10
|
+
data: DiffDisplayData;
|
|
11
|
+
/** Header text: "Edit file" or "Overwrite file" */
|
|
12
|
+
headerType: 'edit' | 'overwrite';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Enhanced diff preview for edit_file and write_file (overwrite) approval
|
|
16
|
+
* Shows full diff with line backgrounds, hunk collapsing, and word-level highlighting
|
|
17
|
+
*/
|
|
18
|
+
export declare function DiffPreview({ data, headerType }: DiffPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
interface CreateFilePreviewProps {
|
|
20
|
+
data: FileDisplayData;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Preview for write_file (new file creation)
|
|
24
|
+
* Shows full file content with line numbers, white text
|
|
25
|
+
*/
|
|
26
|
+
export declare function CreateFilePreview({ data }: CreateFilePreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=FilePreviewRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePreviewRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/renderers/FilePreviewRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAgBpE,UAAU,gBAAgB;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,mDAAmD;IACnD,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,gBAAgB,2CAiGjE;AAMD,UAAU,sBAAsB;IAC5B,IAAI,EAAE,eAAe,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,sBAAsB,2CAoDjE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* File Preview Renderers
|
|
4
|
+
*
|
|
5
|
+
* Preview renderers for edit_file and write_file approval prompts.
|
|
6
|
+
* - DiffPreview: for edit_file and write_file (overwrite)
|
|
7
|
+
* - CreateFilePreview: for write_file (new file)
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Box, Text } from 'ink';
|
|
11
|
+
import { makeRelativePath } from '../../utils/messageFormatting.js';
|
|
12
|
+
import { parseUnifiedDiff, findLinePairs, computeWordDiff, getLineNumWidth, formatLineNum, DiffLine, HunkSeparator, } from './diff-shared.js';
|
|
13
|
+
/**
|
|
14
|
+
* Enhanced diff preview for edit_file and write_file (overwrite) approval
|
|
15
|
+
* Shows full diff with line backgrounds, hunk collapsing, and word-level highlighting
|
|
16
|
+
*/
|
|
17
|
+
export function DiffPreview({ data, headerType }) {
|
|
18
|
+
const { unified, filename } = data;
|
|
19
|
+
const hunks = parseUnifiedDiff(unified);
|
|
20
|
+
// Calculate max line number for width
|
|
21
|
+
let maxLineNum = 1;
|
|
22
|
+
for (const hunk of hunks) {
|
|
23
|
+
for (const line of hunk.lines) {
|
|
24
|
+
maxLineNum = Math.max(maxLineNum, line.lineNum);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const lineNumWidth = getLineNumWidth(maxLineNum);
|
|
28
|
+
// Find line pairs for word-level diff
|
|
29
|
+
const allLinePairs = hunks.map((hunk) => findLinePairs(hunk.lines));
|
|
30
|
+
const headerText = headerType === 'edit' ? 'Edit file' : 'Overwrite file';
|
|
31
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { color: "cyan", bold: true, children: headerText }) }), _jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { children: makeRelativePath(filename) }) }), hunks.map((hunk, hunkIndex) => {
|
|
32
|
+
const linePairs = allLinePairs[hunkIndex];
|
|
33
|
+
const processedIndices = new Set();
|
|
34
|
+
return (_jsxs(React.Fragment, { children: [hunkIndex > 0 && _jsx(HunkSeparator, {}), hunk.lines.map((line, lineIndex) => {
|
|
35
|
+
// Skip if already processed as part of a pair
|
|
36
|
+
if (processedIndices.has(lineIndex)) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
// Check if this is part of a deletion/addition pair
|
|
40
|
+
const pair = linePairs.get(lineIndex);
|
|
41
|
+
if (pair) {
|
|
42
|
+
// Mark the addition line as processed
|
|
43
|
+
processedIndices.add(lineIndex + 1);
|
|
44
|
+
// Compute word-level diff
|
|
45
|
+
const { oldParts, newParts } = computeWordDiff(pair.del.content, pair.add.content);
|
|
46
|
+
return (_jsxs(React.Fragment, { children: [_jsx(DiffLine, { type: "deletion", lineNum: pair.del.lineNum, lineNumWidth: lineNumWidth, content: pair.del.content, wordDiffParts: oldParts }), _jsx(DiffLine, { type: "addition", lineNum: pair.add.lineNum, lineNumWidth: lineNumWidth, content: pair.add.content, wordDiffParts: newParts })] }, lineIndex));
|
|
47
|
+
}
|
|
48
|
+
// Regular line (no word-level diff)
|
|
49
|
+
return (_jsx(DiffLine, { type: line.type, lineNum: line.lineNum, lineNumWidth: lineNumWidth, content: line.content }, lineIndex));
|
|
50
|
+
})] }, hunkIndex));
|
|
51
|
+
})] })] }));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Preview for write_file (new file creation)
|
|
55
|
+
* Shows full file content with line numbers, white text
|
|
56
|
+
*/
|
|
57
|
+
export function CreateFilePreview({ data }) {
|
|
58
|
+
const { path, content, lineCount } = data;
|
|
59
|
+
if (!content) {
|
|
60
|
+
// Fallback if content not provided
|
|
61
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { color: "cyan", bold: true, children: "Create file" }) }), _jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, children: [_jsx(Text, { children: makeRelativePath(path) }), lineCount && _jsxs(Text, { color: "gray", children: [lineCount, " lines"] })] })] }));
|
|
62
|
+
}
|
|
63
|
+
const lines = content.split('\n');
|
|
64
|
+
const lineNumWidth = getLineNumWidth(lines.length);
|
|
65
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { color: "cyan", bold: true, children: "Create file" }) }), _jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, children: [_jsx(Box, { marginBottom: 0, children: _jsx(Text, { children: makeRelativePath(path) }) }), lines.map((line, index) => (_jsxs(Box, { children: [_jsx(Text, { color: "gray", children: formatLineNum(index + 1, lineNumWidth) }), _jsxs(Text, { children: [' ', line] })] }, index)))] })] }));
|
|
66
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FileRenderer Component
|
|
3
|
+
*
|
|
4
|
+
* Renders file operation status.
|
|
5
|
+
* - Read: "Read N lines"
|
|
6
|
+
* - Write/Create: "Wrote N lines to filename"
|
|
7
|
+
*/
|
|
8
|
+
import type { FileDisplayData } from '@dexto/core';
|
|
9
|
+
interface FileRendererProps {
|
|
10
|
+
/** File display data from tool result */
|
|
11
|
+
data: FileDisplayData;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders file operation status.
|
|
15
|
+
* Uses ⎿ character for continuation lines.
|
|
16
|
+
*/
|
|
17
|
+
export declare function FileRenderer({ data }: FileRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=FileRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/renderers/FileRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,UAAU,iBAAiB;IACvB,yCAAyC;IACzC,IAAI,EAAE,eAAe,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,iBAAiB,2CAoCvD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from 'ink';
|
|
3
|
+
/**
|
|
4
|
+
* Renders file operation status.
|
|
5
|
+
* Uses ⎿ character for continuation lines.
|
|
6
|
+
*/
|
|
7
|
+
export function FileRenderer({ data }) {
|
|
8
|
+
const { operation, lineCount } = data;
|
|
9
|
+
// Format based on operation type
|
|
10
|
+
if (operation === 'read') {
|
|
11
|
+
// Format: "Read N lines"
|
|
12
|
+
const lineText = lineCount !== undefined ? `${lineCount} lines` : 'file';
|
|
13
|
+
return (_jsxs(Text, { color: "gray", children: [' ⎿ ', "Read ", lineText] }));
|
|
14
|
+
}
|
|
15
|
+
// For write/create operations
|
|
16
|
+
if (operation === 'write' || operation === 'create') {
|
|
17
|
+
const lineText = lineCount !== undefined ? `${lineCount} lines` : 'content';
|
|
18
|
+
return (_jsxs(Text, { color: "gray", children: [' ⎿ ', "Wrote ", lineText] }));
|
|
19
|
+
}
|
|
20
|
+
// Delete operation
|
|
21
|
+
if (operation === 'delete') {
|
|
22
|
+
return _jsxs(Text, { color: "gray", children: [' ⎿ ', "Deleted file"] });
|
|
23
|
+
}
|
|
24
|
+
// Fallback
|
|
25
|
+
return (_jsxs(Text, { color: "gray", children: [' ⎿ ', operation] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GenericRenderer Component
|
|
3
|
+
*
|
|
4
|
+
* Fallback renderer for unknown tools and MCP tools.
|
|
5
|
+
* Renders content[] as plain text with truncation.
|
|
6
|
+
*/
|
|
7
|
+
import type { ContentPart } from '@dexto/core';
|
|
8
|
+
interface GenericRendererProps {
|
|
9
|
+
/** Content parts from SanitizedToolResult */
|
|
10
|
+
content: ContentPart[];
|
|
11
|
+
/** Maximum lines to display before truncating */
|
|
12
|
+
maxLines?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders tool result content as plain text.
|
|
16
|
+
* Used as fallback for tools without specific display data.
|
|
17
|
+
* Uses ⎿ character for continuation lines.
|
|
18
|
+
*/
|
|
19
|
+
export declare function GenericRenderer({ content, maxLines }: GenericRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=GenericRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/renderers/GenericRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,UAAU,oBAAoB;IAC1B,6CAA6C;IAC7C,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,QAAa,EAAE,EAAE,oBAAoB,kDA8C/E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
/**
|
|
4
|
+
* Renders tool result content as plain text.
|
|
5
|
+
* Used as fallback for tools without specific display data.
|
|
6
|
+
* Uses ⎿ character for continuation lines.
|
|
7
|
+
*/
|
|
8
|
+
export function GenericRenderer({ content, maxLines = 15 }) {
|
|
9
|
+
// Extract text from content parts
|
|
10
|
+
const text = content
|
|
11
|
+
.filter((part) => part.type === 'text')
|
|
12
|
+
.map((part) => part.text)
|
|
13
|
+
.join('\n');
|
|
14
|
+
if (!text) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const lines = text.split('\n').filter((line) => line.trim().length > 0);
|
|
18
|
+
const displayLines = lines.slice(0, maxLines);
|
|
19
|
+
const truncated = lines.length > maxLines;
|
|
20
|
+
// For single line results, show inline
|
|
21
|
+
if (lines.length === 1 && lines[0]) {
|
|
22
|
+
const line = lines[0];
|
|
23
|
+
return (_jsxs(Text, { color: "gray", children: [' ⎿ ', line.slice(0, 80), line.length > 80 ? '...' : ''] }));
|
|
24
|
+
}
|
|
25
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: "gray", children: [' ⎿ ', displayLines.length, " lines"] }), displayLines.map((line, i) => (_jsxs(Text, { color: "gray", wrap: "truncate", children: [' ', line] }, i))), truncated && (_jsxs(Text, { color: "gray", children: [' ', "... ", lines.length - maxLines, " more lines"] }))] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SearchRenderer Component
|
|
3
|
+
*
|
|
4
|
+
* Renders search results with file:line format.
|
|
5
|
+
* Used for grep_content and glob_files tool results.
|
|
6
|
+
*/
|
|
7
|
+
import type { SearchDisplayData } from '@dexto/core';
|
|
8
|
+
interface SearchRendererProps {
|
|
9
|
+
/** Search display data from tool result */
|
|
10
|
+
data: SearchDisplayData;
|
|
11
|
+
/** Maximum matches to display before truncating */
|
|
12
|
+
maxMatches?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders search results with file paths and line numbers.
|
|
16
|
+
* Uses ⎿ character for continuation lines.
|
|
17
|
+
*/
|
|
18
|
+
export declare function SearchRenderer({ data, maxMatches }: SearchRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=SearchRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/renderers/SearchRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,UAAU,mBAAmB;IACzB,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC;IACxB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,UAAc,EAAE,EAAE,mBAAmB,2CA8B3E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
/**
|
|
4
|
+
* Renders search results with file paths and line numbers.
|
|
5
|
+
* Uses ⎿ character for continuation lines.
|
|
6
|
+
*/
|
|
7
|
+
export function SearchRenderer({ data, maxMatches = 5 }) {
|
|
8
|
+
const { pattern, matches, totalMatches, truncated: dataTruncated } = data;
|
|
9
|
+
const displayMatches = matches.slice(0, maxMatches);
|
|
10
|
+
const truncated = dataTruncated || matches.length > maxMatches;
|
|
11
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: "gray", children: [' ⎿ ', totalMatches, " match", totalMatches !== 1 ? 'es' : '', " for \"", pattern, "\"", truncated && ' (truncated)'] }), displayMatches.map((match, i) => (_jsxs(Text, { color: "gray", children: [' ', match.file, match.line > 0 && `:${match.line}`] }, i))), matches.length > maxMatches && (_jsxs(Text, { color: "gray", children: [' ', "... ", matches.length - maxMatches, " more"] }))] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ShellRenderer Component
|
|
3
|
+
*
|
|
4
|
+
* Renders shell command output.
|
|
5
|
+
* Shows actual stdout/stderr, limited to 5 lines with "+N lines" truncation.
|
|
6
|
+
*/
|
|
7
|
+
import type { ShellDisplayData } from '@dexto/core';
|
|
8
|
+
interface ShellRendererProps {
|
|
9
|
+
/** Shell display data from tool result */
|
|
10
|
+
data: ShellDisplayData;
|
|
11
|
+
/** Maximum lines to display before truncating (default: 10) */
|
|
12
|
+
maxLines?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders shell command result with output.
|
|
16
|
+
* Uses ⎿ character for continuation lines.
|
|
17
|
+
* Shows just the output, "(No content)" for empty results.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ShellRenderer({ data, maxLines }: ShellRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=ShellRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShellRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/renderers/ShellRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,UAAU,kBAAkB;IACxB,0CAA0C;IAC1C,IAAI,EAAE,gBAAgB,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAY,EAAE,EAAE,kBAAkB,2CAwCvE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
/**
|
|
4
|
+
* Renders shell command result with output.
|
|
5
|
+
* Uses ⎿ character for continuation lines.
|
|
6
|
+
* Shows just the output, "(No content)" for empty results.
|
|
7
|
+
*/
|
|
8
|
+
export function ShellRenderer({ data, maxLines = 5 }) {
|
|
9
|
+
// Use stdout from display data, fall back to stderr if no stdout
|
|
10
|
+
const output = data.stdout || data.stderr || '';
|
|
11
|
+
const lines = output.split('\n').filter((line) => line.length > 0);
|
|
12
|
+
const displayLines = lines.slice(0, maxLines);
|
|
13
|
+
const truncatedCount = lines.length - maxLines;
|
|
14
|
+
// No output - show "(No content)"
|
|
15
|
+
if (lines.length === 0) {
|
|
16
|
+
return _jsxs(Text, { color: "gray", children: [' ⎿ ', "(No content)"] });
|
|
17
|
+
}
|
|
18
|
+
// Single line output - show inline
|
|
19
|
+
if (lines.length === 1 && lines[0]) {
|
|
20
|
+
return (_jsxs(Text, { color: "gray", children: [' ⎿ ', lines[0]] }));
|
|
21
|
+
}
|
|
22
|
+
// Multi-line output
|
|
23
|
+
// TODO: Add ctrl+o expansion to show full output
|
|
24
|
+
return (_jsxs(Box, { flexDirection: "column", children: [displayLines.map((line, i) => (_jsxs(Text, { color: "gray", wrap: "truncate", children: [i === 0 ? ' ⎿ ' : ' ', line] }, i))), truncatedCount > 0 && (_jsxs(Text, { color: "gray", children: [' ', "+", truncatedCount, " lines"] }))] }));
|
|
25
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Diff Components and Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common code for DiffRenderer and FilePreviewRenderer.
|
|
5
|
+
* Handles unified diff parsing, word-level diff highlighting, and line rendering.
|
|
6
|
+
*/
|
|
7
|
+
export interface ParsedHunk {
|
|
8
|
+
oldStart: number;
|
|
9
|
+
newStart: number;
|
|
10
|
+
lines: ParsedLine[];
|
|
11
|
+
}
|
|
12
|
+
export interface ParsedLine {
|
|
13
|
+
type: 'context' | 'addition' | 'deletion';
|
|
14
|
+
content: string;
|
|
15
|
+
lineNum: number;
|
|
16
|
+
}
|
|
17
|
+
export interface WordDiffPart {
|
|
18
|
+
value: string;
|
|
19
|
+
added?: boolean;
|
|
20
|
+
removed?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Parse unified diff into structured hunks
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseUnifiedDiff(unified: string): ParsedHunk[];
|
|
26
|
+
/**
|
|
27
|
+
* Find paired deletion/addition lines for word-level diff
|
|
28
|
+
*/
|
|
29
|
+
export declare function findLinePairs(lines: ParsedLine[]): Map<number, {
|
|
30
|
+
del: ParsedLine;
|
|
31
|
+
add: ParsedLine;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Compute word-level diff between two strings
|
|
35
|
+
*/
|
|
36
|
+
export declare function computeWordDiff(oldStr: string, newStr: string): {
|
|
37
|
+
oldParts: WordDiffPart[];
|
|
38
|
+
newParts: WordDiffPart[];
|
|
39
|
+
};
|
|
40
|
+
export declare function getLineNumWidth(maxLineNum: number): number;
|
|
41
|
+
export declare function formatLineNum(num: number, width: number): string;
|
|
42
|
+
interface DiffLineProps {
|
|
43
|
+
type: 'context' | 'addition' | 'deletion';
|
|
44
|
+
lineNum: number;
|
|
45
|
+
lineNumWidth: number;
|
|
46
|
+
content: string;
|
|
47
|
+
wordDiffParts?: WordDiffPart[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Render a single diff line with true 2-column layout.
|
|
51
|
+
* Column 1: Fixed-width gutter (line number + symbol)
|
|
52
|
+
* Column 2: Fixed-width content area (remaining terminal width)
|
|
53
|
+
* This prevents content/backgrounds from leaking beyond boundaries.
|
|
54
|
+
*/
|
|
55
|
+
export declare function DiffLine({ type, lineNum, lineNumWidth, content, wordDiffParts }: DiffLineProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* Hunk separator component
|
|
58
|
+
*/
|
|
59
|
+
export declare function HunkSeparator(): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=diff-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff-shared.d.ts","sourceRoot":"","sources":["../../../../../src/cli/ink-cli/components/renderers/diff-shared.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAyD9D;AAED;;GAEG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE,UAAU,EAAE,GACpB,GAAG,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAE,CAAC,CAanD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC3B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACf;IAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;IAAC,QAAQ,EAAE,YAAY,EAAE,CAAA;CAAE,CAkBxD;AAMD,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhE;AAMD,UAAU,aAAa;IACnB,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,aAAa,2CAgE9F;AAED;;GAEG;AACH,wBAAgB,aAAa,4CAM5B"}
|