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,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a Dexto image project - a distributable agent harness package
|
|
3
|
+
* @param name - Optional name of the image project
|
|
4
|
+
* @returns The absolute path to the created project directory
|
|
5
|
+
*/
|
|
6
|
+
export declare function createImage(name?: string): Promise<string>;
|
|
7
|
+
//# sourceMappingURL=create-image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-image.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/create-image.ts"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkPhE"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import * as p from '@clack/prompts';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { selectOrExit, textOrExit, confirmOrExit } from '../utils/prompt-helpers.js';
|
|
5
|
+
import { promptForProjectName, createProjectDirectory, setupGitRepo, createGitignore, initPackageJson, createTsconfigForImage, installDependencies, ensureDirectory, } from '../utils/scaffolding-utils.js';
|
|
6
|
+
import { generateDextoImageFile, generateImageReadme, generateExampleTool, } from '../utils/template-engine.js';
|
|
7
|
+
import fs from 'fs-extra';
|
|
8
|
+
import { getExecutionContext } from '@dexto/agent-management';
|
|
9
|
+
/**
|
|
10
|
+
* Creates a Dexto image project - a distributable agent harness package
|
|
11
|
+
* @param name - Optional name of the image project
|
|
12
|
+
* @returns The absolute path to the created project directory
|
|
13
|
+
*/
|
|
14
|
+
export async function createImage(name) {
|
|
15
|
+
console.log(chalk.blue('🎨 Creating a Dexto image - a distributable agent harness package\n'));
|
|
16
|
+
// Step 1: Get project name
|
|
17
|
+
const projectName = name
|
|
18
|
+
? name
|
|
19
|
+
: await promptForProjectName('my-dexto-image', 'What do you want to name your image?');
|
|
20
|
+
// Step 2: Get description
|
|
21
|
+
const description = await textOrExit({
|
|
22
|
+
message: 'Describe your image:',
|
|
23
|
+
placeholder: 'Custom agent harness for my organization',
|
|
24
|
+
defaultValue: 'Custom agent harness for my organization',
|
|
25
|
+
}, 'Image creation cancelled');
|
|
26
|
+
// Step 3: Starting point - new base or extend existing
|
|
27
|
+
const startingPoint = await selectOrExit({
|
|
28
|
+
message: 'Starting point:',
|
|
29
|
+
options: [
|
|
30
|
+
{ value: 'base', label: 'New base image (build from scratch)' },
|
|
31
|
+
{ value: 'extend', label: 'Extend existing image (add providers to base)' },
|
|
32
|
+
],
|
|
33
|
+
}, 'Image creation cancelled');
|
|
34
|
+
let baseImage;
|
|
35
|
+
if (startingPoint === 'extend') {
|
|
36
|
+
// Step 4: Which image to extend?
|
|
37
|
+
const baseImageChoice = await selectOrExit({
|
|
38
|
+
message: 'Which image to extend?',
|
|
39
|
+
options: [
|
|
40
|
+
{
|
|
41
|
+
value: '@dexto/image-local',
|
|
42
|
+
label: '@dexto/image-local (local development)',
|
|
43
|
+
},
|
|
44
|
+
{ value: '@dexto/image-cloud', label: '@dexto/image-cloud (cloud production)' },
|
|
45
|
+
{ value: '@dexto/image-edge', label: '@dexto/image-edge (edge/serverless)' },
|
|
46
|
+
{ value: 'custom', label: 'Custom npm package...' },
|
|
47
|
+
],
|
|
48
|
+
}, 'Image creation cancelled');
|
|
49
|
+
if (baseImageChoice === 'custom') {
|
|
50
|
+
const customBase = await textOrExit({
|
|
51
|
+
message: 'Enter the npm package name:',
|
|
52
|
+
placeholder: '@myorg/image-base',
|
|
53
|
+
validate: (value) => {
|
|
54
|
+
if (!value || value.trim() === '') {
|
|
55
|
+
return 'Package name is required';
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
},
|
|
59
|
+
}, 'Image creation cancelled');
|
|
60
|
+
baseImage = customBase;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
baseImage = baseImageChoice;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Step 5: Target environment
|
|
67
|
+
const target = await selectOrExit({
|
|
68
|
+
message: 'Target environment:',
|
|
69
|
+
options: [
|
|
70
|
+
{ value: 'local-development', label: 'Local development' },
|
|
71
|
+
{ value: 'cloud-production', label: 'Cloud production' },
|
|
72
|
+
{ value: 'edge-serverless', label: 'Edge/serverless' },
|
|
73
|
+
{ value: 'custom', label: 'Custom' },
|
|
74
|
+
],
|
|
75
|
+
}, 'Image creation cancelled');
|
|
76
|
+
// Step 6: Include example providers?
|
|
77
|
+
const includeExamples = await confirmOrExit({
|
|
78
|
+
message: 'Include example tool provider?',
|
|
79
|
+
initialValue: true,
|
|
80
|
+
}, 'Image creation cancelled');
|
|
81
|
+
// Start scaffolding
|
|
82
|
+
const spinner = p.spinner();
|
|
83
|
+
let projectPath;
|
|
84
|
+
try {
|
|
85
|
+
// Save original cwd before changing directories (for resolving relative paths)
|
|
86
|
+
const originalCwd = process.cwd();
|
|
87
|
+
// Create project directory
|
|
88
|
+
projectPath = await createProjectDirectory(projectName, spinner);
|
|
89
|
+
// Change to project directory
|
|
90
|
+
process.chdir(projectPath);
|
|
91
|
+
spinner.start('Setting up project structure...');
|
|
92
|
+
// Create convention-based folders
|
|
93
|
+
await ensureDirectory('tools');
|
|
94
|
+
await ensureDirectory('blob-store');
|
|
95
|
+
await ensureDirectory('compression');
|
|
96
|
+
await ensureDirectory('plugins');
|
|
97
|
+
// Create .gitkeep files for empty directories
|
|
98
|
+
await fs.writeFile('blob-store/.gitkeep', '');
|
|
99
|
+
await fs.writeFile('compression/.gitkeep', '');
|
|
100
|
+
await fs.writeFile('plugins/.gitkeep', '');
|
|
101
|
+
// Create example tool if requested
|
|
102
|
+
if (includeExamples) {
|
|
103
|
+
await ensureDirectory('tools/example-tool');
|
|
104
|
+
const exampleToolCode = generateExampleTool('example-tool');
|
|
105
|
+
await fs.writeFile('tools/example-tool/index.ts', exampleToolCode);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
await fs.writeFile('tools/.gitkeep', '');
|
|
109
|
+
}
|
|
110
|
+
spinner.message('Generating configuration files...');
|
|
111
|
+
// Create dexto.image.ts
|
|
112
|
+
const dextoImageContent = generateDextoImageFile({
|
|
113
|
+
projectName,
|
|
114
|
+
packageName: projectName,
|
|
115
|
+
description,
|
|
116
|
+
imageName: projectName,
|
|
117
|
+
...(baseImage ? { baseImage } : {}),
|
|
118
|
+
target,
|
|
119
|
+
});
|
|
120
|
+
await fs.writeFile('dexto.image.ts', dextoImageContent);
|
|
121
|
+
// Create package.json
|
|
122
|
+
await initPackageJson(projectPath, projectName, 'image');
|
|
123
|
+
// Update package.json with build script
|
|
124
|
+
const packageJsonPath = path.join(projectPath, 'package.json');
|
|
125
|
+
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'));
|
|
126
|
+
packageJson.scripts = {
|
|
127
|
+
build: 'dexto-bundle build',
|
|
128
|
+
typecheck: 'tsc --noEmit',
|
|
129
|
+
...packageJson.scripts,
|
|
130
|
+
};
|
|
131
|
+
await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
132
|
+
// Create tsconfig.json
|
|
133
|
+
await createTsconfigForImage(projectPath);
|
|
134
|
+
// Create README
|
|
135
|
+
const readmeContent = generateImageReadme({
|
|
136
|
+
projectName,
|
|
137
|
+
packageName: projectName,
|
|
138
|
+
description,
|
|
139
|
+
imageName: projectName,
|
|
140
|
+
...(baseImage ? { baseImage } : {}),
|
|
141
|
+
});
|
|
142
|
+
await fs.writeFile('README.md', readmeContent);
|
|
143
|
+
// Create .gitignore
|
|
144
|
+
await createGitignore(projectPath, ['*.tsbuildinfo']);
|
|
145
|
+
// Initialize git
|
|
146
|
+
spinner.message('Initializing git repository...');
|
|
147
|
+
await setupGitRepo(projectPath);
|
|
148
|
+
spinner.message('Installing dependencies...');
|
|
149
|
+
// Detect if we're in dexto source - use workspace protocol for local development
|
|
150
|
+
const executionContext = getExecutionContext();
|
|
151
|
+
const isDextoSource = executionContext === 'dexto-source';
|
|
152
|
+
const coreVersion = isDextoSource ? 'workspace:*' : '^1.3.0';
|
|
153
|
+
const bundlerVersion = isDextoSource ? 'workspace:*' : '^1.3.0';
|
|
154
|
+
// Determine dependencies based on whether extending
|
|
155
|
+
const dependencies = [`@dexto/core@${coreVersion}`, 'zod'];
|
|
156
|
+
const devDependencies = [
|
|
157
|
+
'typescript@^5.0.0',
|
|
158
|
+
'@types/node@^20.0.0',
|
|
159
|
+
`@dexto/image-bundler@${bundlerVersion}`,
|
|
160
|
+
];
|
|
161
|
+
if (baseImage) {
|
|
162
|
+
// Resolve base image path if we're in dexto source
|
|
163
|
+
let resolvedBaseImage = baseImage;
|
|
164
|
+
if (isDextoSource && baseImage.startsWith('@dexto/image-')) {
|
|
165
|
+
// In dexto source, resolve official images to local workspace packages
|
|
166
|
+
// e.g., @dexto/image-local -> packages/image-local
|
|
167
|
+
const imagePkgName = baseImage.replace('@dexto/', '');
|
|
168
|
+
const imagePkgPath = path.resolve(originalCwd, 'packages', imagePkgName);
|
|
169
|
+
if (await fs.pathExists(imagePkgPath)) {
|
|
170
|
+
resolvedBaseImage = imagePkgPath;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
dependencies.push(resolvedBaseImage);
|
|
174
|
+
}
|
|
175
|
+
// Install dependencies (use pnpm in dexto source for workspace protocol support)
|
|
176
|
+
await installDependencies(projectPath, {
|
|
177
|
+
dependencies,
|
|
178
|
+
devDependencies,
|
|
179
|
+
}, isDextoSource ? 'pnpm' : undefined);
|
|
180
|
+
spinner.stop(chalk.green(`✓ Successfully created image: ${projectName}`));
|
|
181
|
+
console.log(`\n${chalk.cyan('Next steps:')}`);
|
|
182
|
+
console.log(` ${chalk.gray('$')} cd ${projectName}`);
|
|
183
|
+
console.log(` ${chalk.gray('$')} pnpm run build`);
|
|
184
|
+
console.log(`\n${chalk.gray('Add your custom providers to the convention-based folders:')}`);
|
|
185
|
+
console.log(` ${chalk.gray('tools/')} - Custom tool providers`);
|
|
186
|
+
console.log(` ${chalk.gray('blob-store/')} - Blob storage providers`);
|
|
187
|
+
console.log(` ${chalk.gray('compression/')} - Compression strategies`);
|
|
188
|
+
console.log(` ${chalk.gray('plugins/')} - Plugin providers`);
|
|
189
|
+
console.log(`\n${chalk.gray('Learn more:')} https://docs.dexto.ai/docs/guides/images\n`);
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
if (spinner) {
|
|
193
|
+
spinner.stop(chalk.red('✗ Failed to create image'));
|
|
194
|
+
}
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
if (!projectPath) {
|
|
198
|
+
throw new Error('Failed to create project directory');
|
|
199
|
+
}
|
|
200
|
+
return projectPath;
|
|
201
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/helpers/formatters.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/helpers/formatters.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AAG9E;;GAEG;AACH,wBAAgB,iBAAiB,CAC7B,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,eAAe,EAC1B,SAAS,GAAE,OAAe,GAC3B,MAAM,CAqBR;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CA8DpF"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Shared between interactive and non-interactive session commands.
|
|
6
6
|
*/
|
|
7
7
|
import chalk from 'chalk';
|
|
8
|
+
import { isAssistantMessage } from '@dexto/core';
|
|
8
9
|
/**
|
|
9
10
|
* Helper to format session information consistently
|
|
10
11
|
*/
|
|
@@ -17,9 +18,9 @@ export function formatSessionInfo(sessionId, metadata, isCurrent = false) {
|
|
|
17
18
|
const activity = metadata.lastActivity && metadata.lastActivity > 0
|
|
18
19
|
? new Date(metadata.lastActivity).toLocaleString()
|
|
19
20
|
: 'Never';
|
|
20
|
-
info += chalk.
|
|
21
|
+
info += chalk.gray(` (${messages} messages, last: ${activity})`);
|
|
21
22
|
if (isCurrent) {
|
|
22
|
-
info += chalk.
|
|
23
|
+
info += chalk.rgb(255, 165, 0)(' [ACTIVE]');
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
return info;
|
|
@@ -31,7 +32,7 @@ export function formatHistoryMessage(message, index) {
|
|
|
31
32
|
const timestamp = message.timestamp
|
|
32
33
|
? new Date(message.timestamp).toLocaleTimeString()
|
|
33
34
|
: `#${index + 1}`;
|
|
34
|
-
let roleColor = chalk.
|
|
35
|
+
let roleColor = chalk.gray;
|
|
35
36
|
let displayLabel = message.role;
|
|
36
37
|
switch (message.role) {
|
|
37
38
|
case 'user':
|
|
@@ -43,11 +44,11 @@ export function formatHistoryMessage(message, index) {
|
|
|
43
44
|
displayLabel = 'Assistant';
|
|
44
45
|
break;
|
|
45
46
|
case 'system':
|
|
46
|
-
roleColor = chalk.
|
|
47
|
+
roleColor = chalk.rgb(255, 165, 0);
|
|
47
48
|
displayLabel = 'System';
|
|
48
49
|
break;
|
|
49
50
|
case 'tool':
|
|
50
|
-
roleColor = chalk.
|
|
51
|
+
roleColor = chalk.green;
|
|
51
52
|
displayLabel = 'Tool';
|
|
52
53
|
break;
|
|
53
54
|
}
|
|
@@ -82,11 +83,11 @@ export function formatHistoryMessage(message, index) {
|
|
|
82
83
|
}
|
|
83
84
|
// Format tool calls if present
|
|
84
85
|
let toolInfo = '';
|
|
85
|
-
if (message.toolCalls && message.toolCalls.length > 0) {
|
|
86
|
+
if (isAssistantMessage(message) && message.toolCalls && message.toolCalls.length > 0) {
|
|
86
87
|
const toolNames = message.toolCalls
|
|
87
88
|
.map((tc) => tc.function?.name || 'unknown')
|
|
88
89
|
.join(', ');
|
|
89
|
-
toolInfo = chalk.
|
|
90
|
+
toolInfo = chalk.gray(` [Tools: ${toolNames}]`);
|
|
90
91
|
}
|
|
91
|
-
return ` ${chalk.
|
|
92
|
+
return ` ${chalk.gray(timestamp)} ${roleColor.bold(displayLabel)}: ${content}${toolInfo}`;
|
|
92
93
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { createDextoProject,
|
|
1
|
+
export { createDextoProject, type CreateAppOptions } from './create-app.js';
|
|
2
|
+
export { createImage } from './create-image.js';
|
|
2
3
|
export { getUserInputToInitDextoApp, initDexto, postInitDexto } from './init-app.js';
|
|
3
4
|
export { handleSetupCommand, type CLISetupOptions, type CLISetupOptionsInput } from './setup.js';
|
|
4
5
|
export { handleInstallCommand, type InstallCommandOptions } from './install.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EACH,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,GACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// packages/cli/src/cli/commands/index.ts
|
|
2
2
|
// Project setup commands
|
|
3
|
-
export { createDextoProject
|
|
3
|
+
export { createDextoProject } from './create-app.js';
|
|
4
|
+
export { createImage } from './create-image.js';
|
|
4
5
|
export { getUserInputToInitDextoApp, initDexto, postInitDexto } from './init-app.js';
|
|
5
6
|
export { handleSetupCommand } from './setup.js';
|
|
6
7
|
export { handleInstallCommand } from './install.js';
|
|
@@ -103,7 +103,7 @@ export async function initDexto(directory, createExampleFile = true, llmProvider
|
|
|
103
103
|
installError instanceof Error &&
|
|
104
104
|
/\bERR_PNPM_ADDING_TO_ROOT\b/.test(installError.message)) {
|
|
105
105
|
spinner.stop(chalk.red('Error: Cannot install in pnpm workspace root'));
|
|
106
|
-
p.note('You are initializing dexto in a pnpm workspace root. Go to a specific workspace package and run "pnpm add @dexto/core" there.', chalk.
|
|
106
|
+
p.note('You are initializing dexto in a pnpm workspace root. Go to a specific workspace package and run "pnpm add @dexto/core" there.', chalk.rgb(255, 165, 0)('Workspace Error'));
|
|
107
107
|
process.exit(1);
|
|
108
108
|
}
|
|
109
109
|
throw installError; // Re-throw other errors
|
|
@@ -135,7 +135,7 @@ export async function initDexto(directory, createExampleFile = true, llmProvider
|
|
|
135
135
|
catch (configError) {
|
|
136
136
|
spinner.stop(chalk.red('Failed to create agent config file'));
|
|
137
137
|
logger.error(`Config creation error: ${configError}`);
|
|
138
|
-
throw new Error(`Failed to create
|
|
138
|
+
throw new Error(`Failed to create coding-agent.yml: ${configError instanceof Error ? configError.message : String(configError)}`);
|
|
139
139
|
}
|
|
140
140
|
// update dexto config file based on llmProvider
|
|
141
141
|
if (llmProvider) {
|
|
@@ -168,11 +168,11 @@ export async function postInitDexto(directory) {
|
|
|
168
168
|
const nextSteps = [
|
|
169
169
|
`1. Run the example: ${chalk.cyan(`node --loader ts-node/esm ${path.join(directory, 'dexto', 'dexto-example.ts')}`)}`,
|
|
170
170
|
`2. Add/update your API key(s) in ${chalk.cyan('.env')}`,
|
|
171
|
-
`3. Check out the agent configuration file ${chalk.cyan(path.join(directory, 'dexto', 'agents', '
|
|
172
|
-
`4. Try out different LLMs and MCP servers in the
|
|
171
|
+
`3. Check out the agent configuration file ${chalk.cyan(path.join(directory, 'dexto', 'agents', 'coding-agent.yml'))}`,
|
|
172
|
+
`4. Try out different LLMs and MCP servers in the coding-agent.yml file`,
|
|
173
173
|
`5. Read more about Dexto: ${chalk.cyan('https://github.com/truffle-ai/dexto')}`,
|
|
174
174
|
].join('\n');
|
|
175
|
-
p.note(nextSteps, chalk.
|
|
175
|
+
p.note(nextSteps, chalk.rgb(255, 165, 0)('Next steps:'));
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* Creates the dexto directories (dexto, dexto/agents) in the given directory.
|
|
@@ -215,7 +215,7 @@ export async function createDextoConfigFile(directory) {
|
|
|
215
215
|
throw new Error(`Template file not found at: ${templateConfigSrc}. This indicates a build issue - the template should be included in the package.`);
|
|
216
216
|
}
|
|
217
217
|
// Path to the destination config file
|
|
218
|
-
const destConfigPath = path.join(directory, '
|
|
218
|
+
const destConfigPath = path.join(directory, 'coding-agent.yml');
|
|
219
219
|
logger.debug(`Copying template to: ${destConfigPath}`);
|
|
220
220
|
// Copy the config file from the Dexto package
|
|
221
221
|
await fsExtra.copy(templateConfigSrc, destConfigPath);
|
|
@@ -235,7 +235,7 @@ export async function createDextoConfigFile(directory) {
|
|
|
235
235
|
export async function createDextoExampleFile(directory) {
|
|
236
236
|
// Extract the base directory from the given path (e.g., "src" from "src/dexto")
|
|
237
237
|
const baseDir = path.dirname(directory);
|
|
238
|
-
const configPath = `./${path.posix.join(baseDir, 'dexto/agents/
|
|
238
|
+
const configPath = `./${path.posix.join(baseDir, 'dexto/agents/coding-agent.yml')}`;
|
|
239
239
|
const indexTsLines = [
|
|
240
240
|
"import 'dotenv/config';",
|
|
241
241
|
"import { DextoAgent, loadAgentConfig } from '@dexto/core';",
|
|
@@ -2,18 +2,15 @@ import { z } from 'zod';
|
|
|
2
2
|
declare const InstallCommandSchema: z.ZodObject<{
|
|
3
3
|
agents: z.ZodArray<z.ZodString, "many">;
|
|
4
4
|
all: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
-
injectPreferences: z.ZodDefault<z.ZodBoolean>;
|
|
6
5
|
force: z.ZodDefault<z.ZodBoolean>;
|
|
7
6
|
}, "strict", z.ZodTypeAny, {
|
|
8
7
|
all: boolean;
|
|
9
8
|
agents: string[];
|
|
10
9
|
force: boolean;
|
|
11
|
-
injectPreferences: boolean;
|
|
12
10
|
}, {
|
|
13
11
|
agents: string[];
|
|
14
12
|
all?: boolean | undefined;
|
|
15
13
|
force?: boolean | undefined;
|
|
16
|
-
injectPreferences?: boolean | undefined;
|
|
17
14
|
}>;
|
|
18
15
|
export type InstallCommandOptions = z.output<typeof InstallCommandSchema>;
|
|
19
16
|
export declare function handleInstallCommand(agents: string[], options: Partial<InstallCommandOptions>): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,oBAAoB;;;;;;;;;;;;EAMb,CAAC;AAEd,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAwK1E,wBAAsB,oBAAoB,CACtC,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC,CAuKf"}
|
|
@@ -3,15 +3,15 @@ import { existsSync, statSync } from 'fs';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import * as p from '@clack/prompts';
|
|
6
|
-
import { getDextoGlobalPath } from '@dexto/agent-management';
|
|
7
|
-
import {
|
|
6
|
+
import { getDextoGlobalPath, loadBundledRegistryAgents } from '@dexto/agent-management';
|
|
7
|
+
import { textOrExit } from '../utils/prompt-helpers.js';
|
|
8
|
+
import { installBundledAgent, installCustomAgent } from '../../utils/agent-helpers.js';
|
|
8
9
|
import { capture } from '../../analytics/index.js';
|
|
9
10
|
// Zod schema for install command validation
|
|
10
11
|
const InstallCommandSchema = z
|
|
11
12
|
.object({
|
|
12
13
|
agents: z.array(z.string().min(1, 'Agent name cannot be empty')),
|
|
13
14
|
all: z.boolean().default(false),
|
|
14
|
-
injectPreferences: z.boolean().default(true),
|
|
15
15
|
force: z.boolean().default(false),
|
|
16
16
|
})
|
|
17
17
|
.strict();
|
|
@@ -54,7 +54,7 @@ function extractAgentNameFromPath(filePath) {
|
|
|
54
54
|
*/
|
|
55
55
|
async function promptForMetadata(suggestedName) {
|
|
56
56
|
p.intro('📝 Custom Agent Installation');
|
|
57
|
-
const agentName =
|
|
57
|
+
const agentName = await textOrExit({
|
|
58
58
|
message: 'Agent name:',
|
|
59
59
|
placeholder: suggestedName,
|
|
60
60
|
defaultValue: suggestedName,
|
|
@@ -67,12 +67,8 @@ async function promptForMetadata(suggestedName) {
|
|
|
67
67
|
}
|
|
68
68
|
return undefined;
|
|
69
69
|
},
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
p.cancel('Installation cancelled');
|
|
73
|
-
process.exit(0);
|
|
74
|
-
}
|
|
75
|
-
const description = (await p.text({
|
|
70
|
+
}, 'Installation cancelled');
|
|
71
|
+
const description = await textOrExit({
|
|
76
72
|
message: 'Description:',
|
|
77
73
|
placeholder: 'A custom agent for...',
|
|
78
74
|
validate: (value) => {
|
|
@@ -81,12 +77,8 @@ async function promptForMetadata(suggestedName) {
|
|
|
81
77
|
}
|
|
82
78
|
return undefined;
|
|
83
79
|
},
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
p.cancel('Installation cancelled');
|
|
87
|
-
process.exit(0);
|
|
88
|
-
}
|
|
89
|
-
const author = (await p.text({
|
|
80
|
+
}, 'Installation cancelled');
|
|
81
|
+
const author = await textOrExit({
|
|
90
82
|
message: 'Author:',
|
|
91
83
|
placeholder: 'Your Name',
|
|
92
84
|
validate: (value) => {
|
|
@@ -95,20 +87,12 @@ async function promptForMetadata(suggestedName) {
|
|
|
95
87
|
}
|
|
96
88
|
return undefined;
|
|
97
89
|
},
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
p.cancel('Installation cancelled');
|
|
101
|
-
process.exit(0);
|
|
102
|
-
}
|
|
103
|
-
const tagsInput = (await p.text({
|
|
90
|
+
}, 'Installation cancelled');
|
|
91
|
+
const tagsInput = await textOrExit({
|
|
104
92
|
message: 'Tags (comma-separated):',
|
|
105
93
|
placeholder: 'custom, coding, productivity',
|
|
106
94
|
defaultValue: 'custom',
|
|
107
|
-
})
|
|
108
|
-
if (p.isCancel(tagsInput)) {
|
|
109
|
-
p.cancel('Installation cancelled');
|
|
110
|
-
process.exit(0);
|
|
111
|
-
}
|
|
95
|
+
}, 'Installation cancelled');
|
|
112
96
|
const tags = tagsInput
|
|
113
97
|
.split(',')
|
|
114
98
|
.map((tag) => tag.trim())
|
|
@@ -121,14 +105,13 @@ async function promptForMetadata(suggestedName) {
|
|
|
121
105
|
* Validate install command arguments with registry-aware validation
|
|
122
106
|
*/
|
|
123
107
|
function validateInstallCommand(agents, options) {
|
|
124
|
-
const registry = getAgentRegistry();
|
|
125
108
|
// Basic structure validation
|
|
126
109
|
const validated = InstallCommandSchema.parse({
|
|
127
110
|
...options,
|
|
128
111
|
agents,
|
|
129
112
|
});
|
|
130
113
|
// Business logic validation
|
|
131
|
-
const availableAgents =
|
|
114
|
+
const availableAgents = loadBundledRegistryAgents();
|
|
132
115
|
if (!validated.all && validated.agents.length === 0) {
|
|
133
116
|
throw new Error(`No agents specified. Use agent names or --all flag. Available agents: ${Object.keys(availableAgents).join(', ')}`);
|
|
134
117
|
}
|
|
@@ -137,7 +120,7 @@ function validateInstallCommand(agents, options) {
|
|
|
137
120
|
const filePaths = validated.agents.filter(isFilePath);
|
|
138
121
|
const registryNames = validated.agents.filter((agent) => !isFilePath(agent));
|
|
139
122
|
// Validate registry names exist in registry
|
|
140
|
-
const invalidAgents = registryNames.filter((agent) => !
|
|
123
|
+
const invalidAgents = registryNames.filter((agent) => !(agent in availableAgents));
|
|
141
124
|
if (invalidAgents.length > 0) {
|
|
142
125
|
throw new Error(`Unknown agents: ${invalidAgents.join(', ')}. ` +
|
|
143
126
|
`Available agents: ${Object.keys(availableAgents).join(', ')}`);
|
|
@@ -156,12 +139,12 @@ function validateInstallCommand(agents, options) {
|
|
|
156
139
|
export async function handleInstallCommand(agents, options) {
|
|
157
140
|
// Validate command with Zod
|
|
158
141
|
const validated = validateInstallCommand(agents, options);
|
|
159
|
-
const registry = getAgentRegistry();
|
|
160
142
|
// Determine which agents to install
|
|
161
143
|
let agentsToInstall;
|
|
162
144
|
if (validated.all) {
|
|
163
145
|
// --all flag only works with registry agents, not file paths
|
|
164
|
-
|
|
146
|
+
const availableAgents = loadBundledRegistryAgents();
|
|
147
|
+
agentsToInstall = Object.keys(availableAgents);
|
|
165
148
|
console.log(`📋 Installing all ${agentsToInstall.length} available agents...`);
|
|
166
149
|
}
|
|
167
150
|
else {
|
|
@@ -191,35 +174,6 @@ export async function handleInstallCommand(agents, options) {
|
|
|
191
174
|
: extractAgentNameFromPath(resolvedPath);
|
|
192
175
|
// Prompt for metadata
|
|
193
176
|
const metadata = await promptForMetadata(suggestedName);
|
|
194
|
-
// Prompt for main field if installing from directory
|
|
195
|
-
let main;
|
|
196
|
-
if (isDirectory) {
|
|
197
|
-
const mainInput = await p.text({
|
|
198
|
-
message: 'Main config file:',
|
|
199
|
-
placeholder: 'agent.yml',
|
|
200
|
-
defaultValue: 'agent.yml',
|
|
201
|
-
validate: (value) => {
|
|
202
|
-
if (!value || value.trim().length === 0) {
|
|
203
|
-
return 'Main config file is required';
|
|
204
|
-
}
|
|
205
|
-
// Validate it's a YAML file
|
|
206
|
-
if (!value.endsWith('.yml') && !value.endsWith('.yaml')) {
|
|
207
|
-
return 'Main file must be a .yml or .yaml file';
|
|
208
|
-
}
|
|
209
|
-
// Validate that main file exists in source directory
|
|
210
|
-
const mainPath = path.join(resolvedPath, value);
|
|
211
|
-
if (!existsSync(mainPath)) {
|
|
212
|
-
return `File not found: ${value}`;
|
|
213
|
-
}
|
|
214
|
-
return undefined;
|
|
215
|
-
},
|
|
216
|
-
});
|
|
217
|
-
if (p.isCancel(mainInput)) {
|
|
218
|
-
p.cancel('Installation cancelled');
|
|
219
|
-
process.exit(0);
|
|
220
|
-
}
|
|
221
|
-
main = mainInput;
|
|
222
|
-
}
|
|
223
177
|
// Check if already installed (unless --force)
|
|
224
178
|
const globalAgentsDir = getDextoGlobalPath('agents');
|
|
225
179
|
const installedPath = path.join(globalAgentsDir, metadata.agentName);
|
|
@@ -231,17 +185,16 @@ export async function handleInstallCommand(agents, options) {
|
|
|
231
185
|
status: 'skipped',
|
|
232
186
|
reason: 'already_installed',
|
|
233
187
|
force: validated.force,
|
|
234
|
-
injectPreferences: validated.injectPreferences,
|
|
235
188
|
});
|
|
236
189
|
continue;
|
|
237
190
|
}
|
|
238
191
|
// Install custom agent
|
|
239
|
-
await
|
|
192
|
+
await installCustomAgent(metadata.agentName, resolvedPath, {
|
|
193
|
+
name: metadata.agentName,
|
|
240
194
|
description: metadata.description,
|
|
241
195
|
author: metadata.author,
|
|
242
196
|
tags: metadata.tags,
|
|
243
|
-
|
|
244
|
-
}, validated.injectPreferences);
|
|
197
|
+
});
|
|
245
198
|
successCount++;
|
|
246
199
|
console.log(`✅ ${metadata.agentName} installed successfully`);
|
|
247
200
|
installed.push(metadata.agentName);
|
|
@@ -250,7 +203,6 @@ export async function handleInstallCommand(agents, options) {
|
|
|
250
203
|
agent: metadata.agentName,
|
|
251
204
|
status: 'installed',
|
|
252
205
|
force: validated.force,
|
|
253
|
-
injectPreferences: validated.injectPreferences,
|
|
254
206
|
});
|
|
255
207
|
}
|
|
256
208
|
else {
|
|
@@ -267,11 +219,10 @@ export async function handleInstallCommand(agents, options) {
|
|
|
267
219
|
status: 'skipped',
|
|
268
220
|
reason: 'already_installed',
|
|
269
221
|
force: validated.force,
|
|
270
|
-
injectPreferences: validated.injectPreferences,
|
|
271
222
|
});
|
|
272
223
|
continue;
|
|
273
224
|
}
|
|
274
|
-
await
|
|
225
|
+
await installBundledAgent(agentInput);
|
|
275
226
|
successCount++;
|
|
276
227
|
console.log(`✅ ${agentInput} installed successfully`);
|
|
277
228
|
installed.push(agentInput);
|
|
@@ -279,7 +230,6 @@ export async function handleInstallCommand(agents, options) {
|
|
|
279
230
|
agent: agentInput,
|
|
280
231
|
status: 'installed',
|
|
281
232
|
force: validated.force,
|
|
282
|
-
injectPreferences: validated.injectPreferences,
|
|
283
233
|
});
|
|
284
234
|
}
|
|
285
235
|
}
|
|
@@ -296,7 +246,6 @@ export async function handleInstallCommand(agents, options) {
|
|
|
296
246
|
status: 'failed',
|
|
297
247
|
error_message: error instanceof Error ? error.message : String(error),
|
|
298
248
|
force: validated.force,
|
|
299
|
-
injectPreferences: validated.injectPreferences,
|
|
300
249
|
});
|
|
301
250
|
}
|
|
302
251
|
}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import type { DextoAgent } from '@dexto/core';
|
|
2
|
+
import type { StyledOutput, SendMessageMarker } from '../../ink-cli/services/CommandService.js';
|
|
2
3
|
export interface CommandResult {
|
|
3
4
|
type: 'command' | 'prompt';
|
|
4
5
|
command?: string;
|
|
5
6
|
args?: string[];
|
|
6
7
|
rawInput: string;
|
|
7
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Command handler return type:
|
|
11
|
+
* - boolean: Command handled (true) or not found (false)
|
|
12
|
+
* - string: Output text to display
|
|
13
|
+
* - StyledOutput: Styled output with structured data for rich rendering
|
|
14
|
+
* - SendMessageMarker: Send text through normal streaming flow (for prompt commands)
|
|
15
|
+
*/
|
|
16
|
+
export type CommandHandlerResult = boolean | string | StyledOutput | SendMessageMarker;
|
|
17
|
+
/**
|
|
18
|
+
* Context passed to command handlers
|
|
19
|
+
*/
|
|
20
|
+
export interface CommandContext {
|
|
21
|
+
/** Current session ID, or null if no active session */
|
|
22
|
+
sessionId: string | null;
|
|
23
|
+
}
|
|
8
24
|
export interface CommandDefinition {
|
|
9
25
|
name: string;
|
|
10
26
|
description: string;
|
|
@@ -12,21 +28,8 @@ export interface CommandDefinition {
|
|
|
12
28
|
category?: string;
|
|
13
29
|
aliases?: string[];
|
|
14
30
|
subcommands?: CommandDefinition[];
|
|
15
|
-
handler: (args: string[], agent: DextoAgent) => Promise<
|
|
31
|
+
handler: (args: string[], agent: DextoAgent, ctx: CommandContext) => Promise<CommandHandlerResult>;
|
|
16
32
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Helper for command handlers to get the current session ID from CLI context.
|
|
19
|
-
* This is set by executeCommand() when invoked from InkCLI.
|
|
20
|
-
*
|
|
21
|
-
* Maintains separation of concerns:
|
|
22
|
-
* - InkCLI state manages current sessionId
|
|
23
|
-
* - executeCommand() stores it temporarily on agent for command access
|
|
24
|
-
* - Commands use this helper instead of removed agent.getCurrentSessionId()
|
|
25
|
-
*
|
|
26
|
-
* @param agent - DextoAgent instance with __cliSessionId set by executeCommand
|
|
27
|
-
* @returns Current session ID from CLI context, or null if not available
|
|
28
|
-
*/
|
|
29
|
-
export declare function getCLISessionId(agent: DextoAgent): string | null;
|
|
30
33
|
/**
|
|
31
34
|
* Parses user input to determine if it's a slash command or a regular prompt
|
|
32
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-parser.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/command-parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"command-parser.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/command-parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAEhG,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,uDAAuD;IACvD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAClC,OAAO,EAAE,CACL,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,cAAc,KAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACtC;AA4CD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAsBvD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAoB9F;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,EAAE,QAAQ,GAAE,OAAe,GAAG,MAAM,CAmB3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAuDtE"}
|