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,400 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ToolBrowser Component
|
|
4
|
+
* Interactive browser for exploring available tools
|
|
5
|
+
* Features:
|
|
6
|
+
* - Search/filter tools by name
|
|
7
|
+
* - View tool details (description, schema)
|
|
8
|
+
* - Shows source (MCP server or Internal)
|
|
9
|
+
*/
|
|
10
|
+
import { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, } from 'react';
|
|
11
|
+
import { Box, Text } from 'ink';
|
|
12
|
+
import { useTerminalSize } from '../../hooks/useTerminalSize.js';
|
|
13
|
+
import { writeToClipboard } from '../../utils/clipboardUtils.js';
|
|
14
|
+
const MAX_VISIBLE_ITEMS = 12;
|
|
15
|
+
const MAX_DETAIL_LINES = 15;
|
|
16
|
+
/**
|
|
17
|
+
* Tool browser with search and detail views
|
|
18
|
+
*/
|
|
19
|
+
const ToolBrowser = forwardRef(function ToolBrowser({ isVisible, onClose, agent }, ref) {
|
|
20
|
+
const { columns, rows } = useTerminalSize();
|
|
21
|
+
const [tools, setTools] = useState([]);
|
|
22
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
23
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
24
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
25
|
+
const [scrollOffset, setScrollOffset] = useState(0);
|
|
26
|
+
const [viewMode, setViewMode] = useState('list');
|
|
27
|
+
const [selectedTool, setSelectedTool] = useState(null);
|
|
28
|
+
const [detailScrollOffset, setDetailScrollOffset] = useState(0);
|
|
29
|
+
const [copyFeedback, setCopyFeedback] = useState(null);
|
|
30
|
+
const selectedIndexRef = useRef(selectedIndex);
|
|
31
|
+
const viewModeRef = useRef(viewMode);
|
|
32
|
+
const detailScrollOffsetRef = useRef(detailScrollOffset);
|
|
33
|
+
const detailMaxScrollOffsetRef = useRef(0);
|
|
34
|
+
const selectedToolRef = useRef(null);
|
|
35
|
+
// Keep refs in sync
|
|
36
|
+
selectedIndexRef.current = selectedIndex;
|
|
37
|
+
viewModeRef.current = viewMode;
|
|
38
|
+
detailScrollOffsetRef.current = detailScrollOffset;
|
|
39
|
+
selectedToolRef.current = selectedTool;
|
|
40
|
+
// Fetch tools from agent
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!isVisible)
|
|
43
|
+
return;
|
|
44
|
+
let cancelled = false;
|
|
45
|
+
setIsLoading(true);
|
|
46
|
+
setSearchQuery('');
|
|
47
|
+
setSelectedIndex(0);
|
|
48
|
+
setScrollOffset(0);
|
|
49
|
+
setViewMode('list');
|
|
50
|
+
setSelectedTool(null);
|
|
51
|
+
const fetchTools = async () => {
|
|
52
|
+
try {
|
|
53
|
+
const [allTools, mcpTools] = await Promise.all([
|
|
54
|
+
agent.getAllTools(),
|
|
55
|
+
agent.getAllMcpTools(),
|
|
56
|
+
]);
|
|
57
|
+
const toolList = [];
|
|
58
|
+
const mcpToolNames = new Set(Object.keys(mcpTools));
|
|
59
|
+
for (const [toolName, toolInfo] of Object.entries(allTools)) {
|
|
60
|
+
const isMcpTool = mcpToolNames.has(toolName) || toolName.startsWith('mcp--');
|
|
61
|
+
// Extract server name from MCP tool name (format: mcp--serverName--toolName)
|
|
62
|
+
let serverName;
|
|
63
|
+
if (toolName.startsWith('mcp--')) {
|
|
64
|
+
const parts = toolName.split('--');
|
|
65
|
+
if (parts.length >= 2) {
|
|
66
|
+
serverName = parts[1];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
toolList.push({
|
|
70
|
+
name: toolName,
|
|
71
|
+
description: toolInfo.description || 'No description available',
|
|
72
|
+
source: isMcpTool ? 'mcp' : 'internal',
|
|
73
|
+
serverName,
|
|
74
|
+
inputSchema: toolInfo.parameters,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Sort: internal tools first, then MCP tools
|
|
78
|
+
toolList.sort((a, b) => {
|
|
79
|
+
if (a.source !== b.source) {
|
|
80
|
+
return a.source === 'internal' ? -1 : 1;
|
|
81
|
+
}
|
|
82
|
+
return a.name.localeCompare(b.name);
|
|
83
|
+
});
|
|
84
|
+
if (!cancelled) {
|
|
85
|
+
setTools(toolList);
|
|
86
|
+
setIsLoading(false);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
if (!cancelled) {
|
|
91
|
+
setTools([]);
|
|
92
|
+
setIsLoading(false);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
void fetchTools();
|
|
97
|
+
return () => {
|
|
98
|
+
cancelled = true;
|
|
99
|
+
};
|
|
100
|
+
}, [isVisible, agent]);
|
|
101
|
+
// Filter tools based on search query
|
|
102
|
+
const filteredTools = useMemo(() => {
|
|
103
|
+
if (!searchQuery.trim()) {
|
|
104
|
+
return tools;
|
|
105
|
+
}
|
|
106
|
+
const query = searchQuery.toLowerCase();
|
|
107
|
+
return tools.filter((tool) => {
|
|
108
|
+
const name = tool.name.toLowerCase();
|
|
109
|
+
const desc = tool.description.toLowerCase();
|
|
110
|
+
const server = (tool.serverName || '').toLowerCase();
|
|
111
|
+
return name.includes(query) || desc.includes(query) || server.includes(query);
|
|
112
|
+
});
|
|
113
|
+
}, [tools, searchQuery]);
|
|
114
|
+
// Adjust selected index when filter changes
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (selectedIndex >= filteredTools.length) {
|
|
117
|
+
setSelectedIndex(Math.max(0, filteredTools.length - 1));
|
|
118
|
+
}
|
|
119
|
+
}, [filteredTools.length, selectedIndex]);
|
|
120
|
+
// Calculate scroll offset
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (selectedIndex < scrollOffset) {
|
|
123
|
+
setScrollOffset(selectedIndex);
|
|
124
|
+
}
|
|
125
|
+
else if (selectedIndex >= scrollOffset + MAX_VISIBLE_ITEMS) {
|
|
126
|
+
setScrollOffset(selectedIndex - MAX_VISIBLE_ITEMS + 1);
|
|
127
|
+
}
|
|
128
|
+
}, [selectedIndex, scrollOffset]);
|
|
129
|
+
// Handle showing tool details
|
|
130
|
+
const showToolDetails = (tool) => {
|
|
131
|
+
setSelectedTool(tool);
|
|
132
|
+
setViewMode('detail');
|
|
133
|
+
setDetailScrollOffset(0);
|
|
134
|
+
};
|
|
135
|
+
// Handle going back to list
|
|
136
|
+
const goBackToList = () => {
|
|
137
|
+
setViewMode('list');
|
|
138
|
+
setSelectedTool(null);
|
|
139
|
+
};
|
|
140
|
+
// Expose handleInput method via ref
|
|
141
|
+
useImperativeHandle(ref, () => ({
|
|
142
|
+
handleInput: (input, key) => {
|
|
143
|
+
if (!isVisible)
|
|
144
|
+
return false;
|
|
145
|
+
// In detail view (use ref to get latest value)
|
|
146
|
+
if (viewModeRef.current === 'detail') {
|
|
147
|
+
if (key.escape || key.backspace || key.delete) {
|
|
148
|
+
goBackToList();
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
// Handle scrolling in detail view - check refs before setState to avoid flicker
|
|
152
|
+
if (key.upArrow) {
|
|
153
|
+
if (detailScrollOffsetRef.current > 0) {
|
|
154
|
+
setDetailScrollOffset((prev) => prev - 1);
|
|
155
|
+
}
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
if (key.downArrow) {
|
|
159
|
+
if (detailScrollOffsetRef.current < detailMaxScrollOffsetRef.current) {
|
|
160
|
+
setDetailScrollOffset((prev) => prev + 1);
|
|
161
|
+
}
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
// Copy schema to clipboard
|
|
165
|
+
if (input === 'c' || input === 'C') {
|
|
166
|
+
const tool = selectedToolRef.current;
|
|
167
|
+
if (tool) {
|
|
168
|
+
const schema = {
|
|
169
|
+
type: 'function',
|
|
170
|
+
name: tool.name,
|
|
171
|
+
description: tool.description,
|
|
172
|
+
parameters: tool.inputSchema || {},
|
|
173
|
+
};
|
|
174
|
+
void writeToClipboard(JSON.stringify(schema, null, 2)).then((success) => {
|
|
175
|
+
setCopyFeedback(success ? 'Copied!' : 'Copy failed');
|
|
176
|
+
setTimeout(() => setCopyFeedback(null), 1500);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
return true; // Consume all input in detail view
|
|
182
|
+
}
|
|
183
|
+
// In list view
|
|
184
|
+
// Escape closes
|
|
185
|
+
if (key.escape) {
|
|
186
|
+
onClose();
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
// Handle character input for search
|
|
190
|
+
if (input && !key.return && !key.upArrow && !key.downArrow && !key.tab) {
|
|
191
|
+
// Backspace
|
|
192
|
+
if (key.backspace || key.delete) {
|
|
193
|
+
setSearchQuery((prev) => prev.slice(0, -1));
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
// Regular character - add to search
|
|
197
|
+
if (input.length === 1 && input.charCodeAt(0) >= 32) {
|
|
198
|
+
setSearchQuery((prev) => prev + input);
|
|
199
|
+
setSelectedIndex(0);
|
|
200
|
+
setScrollOffset(0);
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// Backspace when no other input
|
|
205
|
+
if (key.backspace || key.delete) {
|
|
206
|
+
setSearchQuery((prev) => prev.slice(0, -1));
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
const itemsLength = filteredTools.length;
|
|
210
|
+
if (itemsLength === 0)
|
|
211
|
+
return false;
|
|
212
|
+
if (key.upArrow) {
|
|
213
|
+
const nextIndex = (selectedIndexRef.current - 1 + itemsLength) % itemsLength;
|
|
214
|
+
setSelectedIndex(nextIndex);
|
|
215
|
+
selectedIndexRef.current = nextIndex;
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
if (key.downArrow) {
|
|
219
|
+
const nextIndex = (selectedIndexRef.current + 1) % itemsLength;
|
|
220
|
+
setSelectedIndex(nextIndex);
|
|
221
|
+
selectedIndexRef.current = nextIndex;
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
if (key.return && itemsLength > 0) {
|
|
225
|
+
const tool = filteredTools[selectedIndexRef.current];
|
|
226
|
+
if (tool) {
|
|
227
|
+
showToolDetails(tool);
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return false;
|
|
232
|
+
},
|
|
233
|
+
}), [isVisible, filteredTools, onClose, viewMode]);
|
|
234
|
+
if (!isVisible)
|
|
235
|
+
return null;
|
|
236
|
+
if (isLoading) {
|
|
237
|
+
return (_jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: "Loading tools..." }) }));
|
|
238
|
+
}
|
|
239
|
+
// Detail view
|
|
240
|
+
if (viewMode === 'detail' && selectedTool) {
|
|
241
|
+
// Calculate max visible lines based on terminal height
|
|
242
|
+
const maxVisibleLines = Math.min(18, Math.max(5, rows - 6)); // Cap at 18 to reduce flicker
|
|
243
|
+
return (_jsx(ToolDetailView, { tool: selectedTool, columns: columns, scrollOffset: detailScrollOffset, maxVisibleLines: maxVisibleLines, maxScrollOffsetRef: detailMaxScrollOffsetRef, copyFeedback: copyFeedback }));
|
|
244
|
+
}
|
|
245
|
+
// List view
|
|
246
|
+
const visibleTools = filteredTools.slice(scrollOffset, scrollOffset + MAX_VISIBLE_ITEMS);
|
|
247
|
+
// Show counts based on filtered results, not total
|
|
248
|
+
const filteredInternalCount = filteredTools.filter((t) => t.source === 'internal').length;
|
|
249
|
+
const filteredMcpCount = filteredTools.filter((t) => t.source === 'mcp').length;
|
|
250
|
+
return (_jsxs(Box, { flexDirection: "column", width: columns, children: [_jsxs(Box, { paddingX: 0, paddingY: 0, children: [_jsx(Text, { color: "cyan", bold: true, children: "Tool Browser" }), _jsxs(Text, { color: "gray", children: [' ', "(", filteredTools.length, " tools: ", filteredInternalCount, " internal,", ' ', filteredMcpCount, " MCP)"] })] }), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: "\u2191\u2193 navigate, Enter view details, Esc close" }) }), _jsxs(Box, { paddingX: 0, paddingY: 0, marginTop: 1, children: [_jsx(Text, { color: "gray", children: "Search: " }), _jsx(Text, { color: searchQuery ? 'white' : 'gray', children: searchQuery || 'Type to filter...' }), _jsx(Text, { color: "cyan", children: "\u258C" })] }), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: '─'.repeat(Math.min(60, columns - 2)) }) }), filteredTools.length === 0 ? (_jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: "No tools match your search" }) })) : (visibleTools.map((tool, visibleIndex) => {
|
|
251
|
+
const actualIndex = scrollOffset + visibleIndex;
|
|
252
|
+
const isSelected = actualIndex === selectedIndex;
|
|
253
|
+
return (_jsxs(Box, { paddingX: 0, paddingY: 0, children: [_jsx(Text, { color: isSelected ? 'cyan' : 'white', children: isSelected ? '▶ ' : ' ' }), _jsx(Text, { color: isSelected ? 'cyan' : 'white', bold: isSelected, children: truncateText(tool.name, 35) }), _jsxs(Text, { color: tool.source === 'internal' ? 'magenta' : 'blue', children: [' ', "[", tool.source === 'internal' ? 'Internal' : 'MCP', "]"] }), tool.serverName && _jsxs(Text, { color: "gray", children: [" (", tool.serverName, ")"] })] }, tool.name));
|
|
254
|
+
})), filteredTools.length > MAX_VISIBLE_ITEMS && (_jsx(Box, { paddingX: 0, paddingY: 0, marginTop: 1, children: _jsxs(Text, { color: "gray", children: [scrollOffset > 0 ? '↑ more above' : '', scrollOffset > 0 && scrollOffset + MAX_VISIBLE_ITEMS < filteredTools.length
|
|
255
|
+
? ' | '
|
|
256
|
+
: '', scrollOffset + MAX_VISIBLE_ITEMS < filteredTools.length
|
|
257
|
+
? '↓ more below'
|
|
258
|
+
: ''] }) }))] }));
|
|
259
|
+
});
|
|
260
|
+
/**
|
|
261
|
+
* Build detail line data for a tool (plain data, not React elements)
|
|
262
|
+
*/
|
|
263
|
+
function buildDetailLineData(tool, maxWidth) {
|
|
264
|
+
const lines = [];
|
|
265
|
+
// Tool name
|
|
266
|
+
lines.push({ type: 'title', text: tool.name });
|
|
267
|
+
// Source
|
|
268
|
+
lines.push({ type: 'source', source: tool.source, serverName: tool.serverName });
|
|
269
|
+
// Empty line before description
|
|
270
|
+
lines.push({ type: 'empty' });
|
|
271
|
+
// Description header
|
|
272
|
+
lines.push({ type: 'header', text: 'Description:' });
|
|
273
|
+
// Description content (wrapped)
|
|
274
|
+
const descriptionLines = wrapText(tool.description, maxWidth - 2).split('\n');
|
|
275
|
+
for (const descLine of descriptionLines) {
|
|
276
|
+
lines.push({ type: 'description', text: descLine });
|
|
277
|
+
}
|
|
278
|
+
// Parameters section
|
|
279
|
+
if (tool.inputSchema) {
|
|
280
|
+
const properties = tool.inputSchema.properties;
|
|
281
|
+
const required = tool.inputSchema.required || [];
|
|
282
|
+
if (properties && Object.keys(properties).length > 0) {
|
|
283
|
+
// Empty line before parameters
|
|
284
|
+
lines.push({ type: 'empty' });
|
|
285
|
+
// Parameters header
|
|
286
|
+
lines.push({ type: 'header', text: 'Parameters:' });
|
|
287
|
+
// Each parameter
|
|
288
|
+
for (const [propName, propSchema] of Object.entries(properties)) {
|
|
289
|
+
const paramType = propSchema.type || 'any';
|
|
290
|
+
const description = propSchema.description;
|
|
291
|
+
const isRequired = required.includes(propName);
|
|
292
|
+
const enumValues = propSchema.enum;
|
|
293
|
+
// Parameter name line
|
|
294
|
+
lines.push({
|
|
295
|
+
type: 'param-name',
|
|
296
|
+
name: propName,
|
|
297
|
+
paramType,
|
|
298
|
+
required: isRequired,
|
|
299
|
+
});
|
|
300
|
+
// Parameter description (wrapped)
|
|
301
|
+
if (description) {
|
|
302
|
+
const paramDescLines = wrapText(description, maxWidth - 6).split('\n');
|
|
303
|
+
for (const paramDescLine of paramDescLines) {
|
|
304
|
+
lines.push({ type: 'param-desc', text: paramDescLine });
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
// Enum values
|
|
308
|
+
if (enumValues) {
|
|
309
|
+
lines.push({ type: 'param-enum', values: enumValues });
|
|
310
|
+
}
|
|
311
|
+
// Empty line between parameters
|
|
312
|
+
lines.push({ type: 'empty' });
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
// Empty line before "no parameters"
|
|
317
|
+
lines.push({ type: 'empty' });
|
|
318
|
+
lines.push({ type: 'param-desc', text: 'No parameters' });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return lines;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Render a single detail line from data
|
|
325
|
+
*/
|
|
326
|
+
function renderDetailLine(line, index) {
|
|
327
|
+
switch (line.type) {
|
|
328
|
+
case 'title':
|
|
329
|
+
return (_jsx(Text, { color: "cyan", bold: true, children: line.text }));
|
|
330
|
+
case 'source':
|
|
331
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { color: "gray", children: "Source: " }), _jsx(Text, { color: line.source === 'internal' ? 'magenta' : 'blue', children: line.source === 'internal' ? 'Internal' : 'MCP' }), line.serverName && _jsxs(Text, { color: "gray", children: [" (server: ", line.serverName, ")"] })] }));
|
|
332
|
+
case 'empty':
|
|
333
|
+
return _jsx(Text, { children: " " });
|
|
334
|
+
case 'header':
|
|
335
|
+
return _jsx(Text, { color: "gray", children: line.text });
|
|
336
|
+
case 'description':
|
|
337
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { children: line.text })] }));
|
|
338
|
+
case 'param-name':
|
|
339
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: "cyan", children: line.name }), _jsxs(Text, { color: "gray", children: [" (", line.paramType, ")"] }), line.required && _jsx(Text, { color: "red", children: " *required" })] }));
|
|
340
|
+
case 'param-desc':
|
|
341
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: "gray", children: line.text })] }));
|
|
342
|
+
case 'param-enum':
|
|
343
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsxs(Text, { color: "gray", children: ["Allowed: ", line.values.join(' | ')] })] }));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Tool detail view component with scrolling support
|
|
348
|
+
*/
|
|
349
|
+
function ToolDetailView({ tool, columns, scrollOffset, maxVisibleLines, maxScrollOffsetRef, copyFeedback, }) {
|
|
350
|
+
const maxWidth = Math.min(80, columns - 4);
|
|
351
|
+
// Build plain data for lines (memoized)
|
|
352
|
+
const lineData = useMemo(() => buildDetailLineData(tool, maxWidth), [tool, maxWidth]);
|
|
353
|
+
// Calculate visible range and update max scroll offset ref
|
|
354
|
+
const totalLines = lineData.length;
|
|
355
|
+
const maxScrollOffset = Math.max(0, totalLines - maxVisibleLines);
|
|
356
|
+
maxScrollOffsetRef.current = maxScrollOffset;
|
|
357
|
+
const clampedOffset = Math.min(scrollOffset, maxScrollOffset);
|
|
358
|
+
// Calculate scroll indicators
|
|
359
|
+
const hasMoreAbove = clampedOffset > 0;
|
|
360
|
+
const hasMoreBelow = clampedOffset + maxVisibleLines < totalLines;
|
|
361
|
+
return (_jsxs(Box, { flexDirection: "column", width: columns, children: [_jsxs(Box, { paddingX: 0, paddingY: 0, children: [_jsx(Text, { color: "cyan", bold: true, children: "Tool Details" }), _jsx(Text, { color: "gray", children: " - \u2191\u2193 scroll, c copy schema, Esc back" }), copyFeedback && (_jsxs(Text, { color: "green", bold: true, children: [' ', copyFeedback] }))] }), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: '─'.repeat(Math.min(60, columns - 2)) }) }), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: hasMoreAbove ? `↑ ${clampedOffset} more above` : ' ' }) }), Array.from({ length: maxVisibleLines }, (_, i) => {
|
|
362
|
+
const absoluteIndex = clampedOffset + i;
|
|
363
|
+
const line = lineData[absoluteIndex];
|
|
364
|
+
return (_jsx(Box, { paddingX: 0, paddingY: 0, children: line ? renderDetailLine(line, absoluteIndex) : _jsx(Text, { children: " " }) }, i));
|
|
365
|
+
}), _jsx(Box, { paddingX: 0, paddingY: 0, children: _jsx(Text, { color: "gray", children: hasMoreBelow
|
|
366
|
+
? `↓ ${totalLines - clampedOffset - maxVisibleLines} more below`
|
|
367
|
+
: ' ' }) })] }));
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Truncate text to max length with ellipsis
|
|
371
|
+
*/
|
|
372
|
+
function truncateText(text, maxLength) {
|
|
373
|
+
if (text.length <= maxLength)
|
|
374
|
+
return text;
|
|
375
|
+
return text.slice(0, maxLength - 1) + '…';
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Wrap text to fit within max width
|
|
379
|
+
*/
|
|
380
|
+
function wrapText(text, maxWidth) {
|
|
381
|
+
if (text.length <= maxWidth)
|
|
382
|
+
return text;
|
|
383
|
+
const words = text.split(' ');
|
|
384
|
+
const lines = [];
|
|
385
|
+
let currentLine = '';
|
|
386
|
+
for (const word of words) {
|
|
387
|
+
if (currentLine.length + word.length + 1 <= maxWidth) {
|
|
388
|
+
currentLine += (currentLine ? ' ' : '') + word;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
if (currentLine)
|
|
392
|
+
lines.push(currentLine);
|
|
393
|
+
currentLine = word;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (currentLine)
|
|
397
|
+
lines.push(currentLine);
|
|
398
|
+
return lines.join('\n');
|
|
399
|
+
}
|
|
400
|
+
export default ToolBrowser;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalModelWizard Component
|
|
3
|
+
* Specialized wizard for adding local GGUF models with:
|
|
4
|
+
* - Registry model selection with download support
|
|
5
|
+
* - Custom GGUF file path option
|
|
6
|
+
* - Download progress display
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { Key } from '../../../hooks/useInputOrchestrator.js';
|
|
10
|
+
import { type CustomModel } from '@dexto/agent-management';
|
|
11
|
+
interface LocalModelWizardProps {
|
|
12
|
+
isVisible: boolean;
|
|
13
|
+
onComplete: (model: CustomModel) => void;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface LocalModelWizardHandle {
|
|
17
|
+
handleInput: (input: string, key: Key) => boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Specialized wizard for local GGUF model setup.
|
|
21
|
+
* Similar UX to CLI setup flow but in Ink.
|
|
22
|
+
*/
|
|
23
|
+
declare const LocalModelWizard: React.ForwardRefExoticComponent<LocalModelWizardProps & React.RefAttributes<LocalModelWizardHandle>>;
|
|
24
|
+
export default LocalModelWizard;
|
|
25
|
+
//# sourceMappingURL=LocalModelWizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalModelWizard.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/ink-cli/components/overlays/custom-model-wizard/LocalModelWizard.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA4E,MAAM,OAAO,CAAC;AAKjG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EASH,KAAK,WAAW,EACnB,MAAM,yBAAyB,CAAC;AAqBjC,UAAU,qBAAqB;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CACrD;AAaD;;;GAGG;AACH,QAAA,MAAM,gBAAgB,sGA4/BrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|