dexto 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -15
- package/dist/agents/agent-registry.json +9 -0
- package/dist/agents/coding-agent/coding-agent.yml +5 -0
- package/dist/agents/default-agent.yml +2 -2
- package/dist/api/server-hono.d.ts.map +1 -1
- package/dist/api/server-hono.js +39 -5
- package/dist/cli/cli-subscriber.d.ts.map +1 -1
- package/dist/cli/cli-subscriber.js +7 -1
- package/dist/cli/commands/helpers/formatters.d.ts.map +1 -1
- package/dist/cli/commands/helpers/formatters.js +2 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +14 -40
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +17 -14
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/command-parser.js +0 -15
- package/dist/cli/commands/interactive-commands/commands.d.ts +4 -4
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.js +34 -42
- package/dist/cli/commands/interactive-commands/documentation-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/documentation-commands.js +4 -7
- package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/general-commands.js +159 -117
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts +9 -3
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/mcp/index.js +18 -3
- package/dist/cli/commands/interactive-commands/model/index.d.ts +8 -6
- package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/model/index.js +18 -6
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -2
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +69 -52
- package/dist/cli/commands/interactive-commands/session/index.d.ts +7 -12
- package/dist/cli/commands/interactive-commands/session/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/session/index.js +7 -14
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts +10 -24
- package/dist/cli/commands/interactive-commands/session/session-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/session/session-commands.js +16 -371
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts +1 -0
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/system/system-commands.js +103 -74
- package/dist/cli/commands/interactive-commands/tool-commands.d.ts +1 -1
- package/dist/cli/commands/interactive-commands/tool-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/tool-commands.js +5 -62
- package/dist/cli/commands/interactive-commands/utils/command-output.d.ts +13 -17
- package/dist/cli/commands/interactive-commands/utils/command-output.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/utils/command-output.js +18 -37
- package/dist/cli/commands/list-agents.d.ts +2 -2
- package/dist/cli/commands/list-agents.d.ts.map +1 -1
- package/dist/cli/commands/list-agents.js +36 -32
- package/dist/cli/commands/uninstall.d.ts.map +1 -1
- package/dist/cli/commands/uninstall.js +4 -6
- package/dist/cli/commands/which.d.ts.map +1 -1
- package/dist/cli/commands/which.js +17 -3
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts +9 -22
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +50 -133
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +24 -3
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +160 -45
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts +22 -0
- package/dist/cli/ink-cli/components/ElicitationForm.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/ElicitationForm.js +358 -0
- package/dist/cli/ink-cli/components/Footer.d.ts +16 -0
- package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/Footer.js +27 -0
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts +17 -0
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/HistorySearchBar.js +8 -0
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts +15 -2
- package/dist/cli/ink-cli/components/ResourceAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ResourceAutocomplete.js +126 -82
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts +15 -2
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +228 -122
- package/dist/cli/ink-cli/components/StatusBar.d.ts +15 -2
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/StatusBar.js +46 -8
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts +52 -0
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/TextBufferInput.js +471 -0
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts +11 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/base/BaseSelector.js +90 -49
- package/dist/cli/ink-cli/components/chat/Header.d.ts +1 -0
- package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/Header.js +7 -2
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts +3 -0
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +95 -9
- package/dist/cli/ink-cli/components/chat/MessageList.js +1 -1
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts +16 -0
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.js +27 -0
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts +4 -2
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.js +19 -5
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +6 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.js +15 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +9 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.js +37 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.js +9 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.js +6 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.js +29 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts +45 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.js +38 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts +10 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/SyspromptBox.js +6 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts +13 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/chat/styled-boxes/index.js +12 -0
- package/dist/cli/ink-cli/components/input/InputArea.d.ts +36 -8
- package/dist/cli/ink-cli/components/input/InputArea.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/input/InputArea.js +3 -3
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts +25 -0
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +166 -0
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts +27 -0
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +95 -0
- package/dist/cli/ink-cli/components/modes/index.d.ts +10 -0
- package/dist/cli/ink-cli/components/modes/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/modes/index.js +9 -0
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts +26 -0
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.js +92 -0
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +177 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +22 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +59 -0
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts +22 -0
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.js +59 -0
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts +26 -0
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.js +73 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.js +51 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts +29 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.js +215 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts +22 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +74 -0
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpSelector.js +52 -0
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +28 -0
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpServerActions.js +84 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts +29 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.js +109 -0
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +15 -8
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +247 -24
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts +22 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.js +52 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts +29 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.js +166 -0
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts +27 -0
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.js +119 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts +33 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.js +144 -0
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts +23 -0
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.js +189 -0
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts +7 -2
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/SessionSelectorRefactored.js +19 -5
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.js +42 -0
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts +20 -0
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/StreamSelector.js +58 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts +25 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +400 -0
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts +21 -0
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/DiffRenderer.js +65 -0
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +28 -0
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +66 -0
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts +19 -0
- package/dist/cli/ink-cli/components/renderers/FileRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/FileRenderer.js +26 -0
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts +21 -0
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.js +26 -0
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts +20 -0
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.js +12 -0
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts +21 -0
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +25 -0
- package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts +61 -0
- package/dist/cli/ink-cli/components/renderers/diff-shared.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/diff-shared.js +158 -0
- package/dist/cli/ink-cli/components/renderers/index.d.ts +28 -0
- package/dist/cli/ink-cli/components/renderers/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/renderers/index.js +36 -0
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts +38 -0
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/MarkdownText.js +360 -0
- package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts +44 -0
- package/dist/cli/ink-cli/components/shared/VirtualizedList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/VirtualizedList.js +300 -0
- package/dist/cli/ink-cli/components/shared/text-buffer.d.ts +185 -0
- package/dist/cli/ink-cli/components/shared/text-buffer.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/shared/text-buffer.js +1338 -0
- package/dist/cli/ink-cli/constants/processingPhrases.d.ts +10 -0
- package/dist/cli/ink-cli/constants/processingPhrases.d.ts.map +1 -0
- package/dist/cli/ink-cli/constants/processingPhrases.js +64 -0
- package/dist/cli/ink-cli/constants/tips.d.ts +15 -0
- package/dist/cli/ink-cli/constants/tips.d.ts.map +1 -0
- package/dist/cli/ink-cli/constants/tips.js +53 -0
- package/dist/cli/ink-cli/containers/InputContainer.d.ts +42 -8
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +491 -85
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts +23 -5
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +1156 -130
- package/dist/cli/ink-cli/containers/index.d.ts +1 -1
- package/dist/cli/ink-cli/containers/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/contexts/KeypressContext.d.ts +36 -0
- package/dist/cli/ink-cli/contexts/KeypressContext.d.ts.map +1 -0
- package/dist/cli/ink-cli/contexts/KeypressContext.js +461 -0
- package/dist/cli/ink-cli/contexts/MouseContext.d.ts +27 -0
- package/dist/cli/ink-cli/contexts/MouseContext.d.ts.map +1 -0
- package/dist/cli/ink-cli/contexts/MouseContext.js +102 -0
- package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts +33 -0
- package/dist/cli/ink-cli/contexts/ScrollProvider.d.ts.map +1 -0
- package/dist/cli/ink-cli/contexts/ScrollProvider.js +170 -0
- package/dist/cli/ink-cli/contexts/index.d.ts +7 -0
- package/dist/cli/ink-cli/contexts/index.d.ts.map +1 -0
- package/dist/cli/ink-cli/contexts/index.js +6 -0
- package/dist/cli/ink-cli/hooks/index.d.ts +5 -0
- package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/index.js +6 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts +26 -9
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.js +86 -198
- package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts +14 -0
- package/dist/cli/ink-cli/hooks/useBatchedScroll.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useBatchedScroll.js +25 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts +50 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useCLIState.js +188 -0
- package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts +24 -0
- package/dist/cli/ink-cli/hooks/useElapsedTime.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useElapsedTime.js +69 -0
- package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts +61 -0
- package/dist/cli/ink-cli/hooks/useHistorySearch.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useHistorySearch.js +210 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts +136 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +663 -0
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useKeyboardShortcuts.js +7 -26
- package/dist/cli/ink-cli/hooks/useKeypress.d.ts +18 -0
- package/dist/cli/ink-cli/hooks/useKeypress.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useKeypress.js +26 -0
- package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts +30 -0
- package/dist/cli/ink-cli/hooks/usePhraseCycler.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/usePhraseCycler.js +68 -0
- package/dist/cli/ink-cli/hooks/useStreaming.d.ts +19 -0
- package/dist/cli/ink-cli/hooks/useStreaming.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useStreaming.js +26 -0
- package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts +14 -0
- package/dist/cli/ink-cli/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useTerminalSize.js +31 -0
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts +42 -0
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useTokenCounter.js +96 -0
- package/dist/cli/ink-cli/services/CommandService.d.ts +32 -1
- package/dist/cli/ink-cli/services/CommandService.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/CommandService.js +36 -5
- package/dist/cli/ink-cli/services/InputService.d.ts +1 -5
- package/dist/cli/ink-cli/services/InputService.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/InputService.js +1 -8
- package/dist/cli/ink-cli/services/index.d.ts +2 -1
- package/dist/cli/ink-cli/services/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/index.js +2 -1
- package/dist/cli/ink-cli/services/processStream.d.ts +69 -0
- package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -0
- package/dist/cli/ink-cli/services/processStream.js +674 -0
- package/dist/cli/ink-cli/state/actions.d.ts +30 -60
- package/dist/cli/ink-cli/state/actions.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/actions.js +3 -0
- package/dist/cli/ink-cli/state/index.d.ts +5 -3
- package/dist/cli/ink-cli/state/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/index.js +4 -3
- package/dist/cli/ink-cli/state/initialState.d.ts +4 -3
- package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/initialState.js +20 -4
- package/dist/cli/ink-cli/state/reducer.d.ts +3 -0
- package/dist/cli/ink-cli/state/reducer.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/reducer.js +62 -168
- package/dist/cli/ink-cli/state/streaming-state.d.ts +27 -0
- package/dist/cli/ink-cli/state/streaming-state.d.ts.map +1 -0
- package/dist/cli/ink-cli/state/streaming-state.js +39 -0
- package/dist/cli/ink-cli/state/types.d.ts +222 -6
- package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/bracketedPaste.d.ts +22 -0
- package/dist/cli/ink-cli/utils/bracketedPaste.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/bracketedPaste.js +27 -0
- package/dist/cli/ink-cli/utils/clipboardUtils.d.ts +49 -0
- package/dist/cli/ink-cli/utils/clipboardUtils.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/clipboardUtils.js +356 -0
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts +33 -0
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/commandOverlays.js +78 -0
- package/dist/cli/ink-cli/utils/debugLog.d.ts +38 -0
- package/dist/cli/ink-cli/utils/debugLog.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/debugLog.js +66 -0
- package/dist/cli/ink-cli/utils/index.d.ts +2 -1
- package/dist/cli/ink-cli/utils/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/index.js +3 -1
- package/dist/cli/ink-cli/utils/input.d.ts +25 -0
- package/dist/cli/ink-cli/utils/input.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/input.js +56 -0
- package/dist/cli/ink-cli/utils/inputParsing.d.ts +0 -9
- package/dist/cli/ink-cli/utils/inputParsing.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/inputParsing.js +0 -27
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +54 -3
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +290 -20
- package/dist/cli/ink-cli/utils/mouse.d.ts +61 -0
- package/dist/cli/ink-cli/utils/mouse.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/mouse.js +209 -0
- package/dist/cli/ink-cli/utils/streamSplitter.d.ts +44 -0
- package/dist/cli/ink-cli/utils/streamSplitter.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/streamSplitter.js +154 -0
- package/dist/cli/ink-cli/utils/textUtils.d.ts +63 -0
- package/dist/cli/ink-cli/utils/textUtils.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/textUtils.js +248 -0
- package/dist/cli/ink-cli/utils/toolUtils.d.ts +9 -0
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -0
- package/dist/cli/ink-cli/utils/toolUtils.js +13 -0
- package/dist/cli/utils/options.d.ts.map +1 -1
- package/dist/cli/utils/options.js +0 -2
- package/dist/config/cli-overrides.d.ts +1 -1
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +5 -10
- package/dist/index.js +66 -48
- package/dist/utils/agent-helpers.d.ts +95 -0
- package/dist/utils/agent-helpers.d.ts.map +1 -0
- package/dist/utils/agent-helpers.js +117 -0
- package/dist/webui/assets/index-BkwPkZpd.css +1 -0
- package/dist/webui/assets/index-D9u1XfyH.js +2025 -0
- package/dist/webui/assets/{tanstack-DgxBONJY.js → tanstack-Br79RQ-n.js} +1 -1
- package/dist/webui/index.html +3 -3
- package/package.json +16 -14
- package/dist/cli/commands/interactive-commands/index.d.ts +0 -63
- package/dist/cli/commands/interactive-commands/index.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/index.js +0 -73
- package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts +0 -34
- package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/mcp/mcp-add-utils.js +0 -178
- package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts +0 -9
- package/dist/cli/commands/interactive-commands/mcp/mcp-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/mcp/mcp-commands.js +0 -325
- package/dist/cli/commands/interactive-commands/model/model-commands.d.ts +0 -21
- package/dist/cli/commands/interactive-commands/model/model-commands.d.ts.map +0 -1
- package/dist/cli/commands/interactive-commands/model/model-commands.js +0 -190
- package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts +0 -26
- package/dist/cli/ink-cli/components/MultiLineTextInput.d.ts.map +0 -1
- package/dist/cli/ink-cli/components/MultiLineTextInput.js +0 -220
- package/dist/discord/bot.d.ts +0 -4
- package/dist/discord/bot.d.ts.map +0 -1
- package/dist/discord/bot.js +0 -193
- package/dist/telegram/bot.d.ts +0 -5
- package/dist/telegram/bot.d.ts.map +0 -1
- package/dist/telegram/bot.js +0 -251
- package/dist/webui/assets/index-DKq5Xng1.js +0 -687
- package/dist/webui/assets/index-D_0_GBu5.css +0 -1
package/README.md
CHANGED
|
@@ -132,6 +132,7 @@ dexto --agent nano-banana-agent
|
|
|
132
132
|
- **Triage Agent** – Demo multi-agent customer support routing system
|
|
133
133
|
- **Workflow Builder Agent** – Build and manage n8n automation workflows
|
|
134
134
|
- **Product Analysis Agent** – Product analytics and insights using PostHog
|
|
135
|
+
- **Gaming Agent** – Play GameBoy games like Pokemon through an emulator
|
|
135
136
|
|
|
136
137
|
Each agent is pre-configured with the right tools, prompts, and LLM settings for its domain. No setup required—just install and start building.
|
|
137
138
|
|
|
@@ -270,8 +271,8 @@ dexto --agent ./agents/examples/email_slack.yml
|
|
|
270
271
|
| **Headless Server** | `dexto --mode server` | REST & SSE streaming APIs for agent interaction |
|
|
271
272
|
| **MCP Server (Agent)** | `dexto --mode mcp` | Exposing your agent as a tool for others via stdio |
|
|
272
273
|
| **MCP Server (Aggregator)** | `dexto mcp --group-servers` | Re-exposing tools from multiple MCP servers via stdio |
|
|
273
|
-
| **Discord Bot** | `
|
|
274
|
-
| **Telegram Bot** | `
|
|
274
|
+
| **Discord Bot** | [See `examples/discord-bot/`](examples/discord-bot/) | Community servers & channels (reference implementation) |
|
|
275
|
+
| **Telegram Bot** | [See `examples/telegram-bot/`](examples/telegram-bot/) | Mobile chat (reference implementation) |
|
|
275
276
|
|
|
276
277
|
Run `dexto --help` for **all flags, sub-commands, and environment variables**.
|
|
277
278
|
|
|
@@ -353,19 +354,28 @@ await agent.start();
|
|
|
353
354
|
const session = await agent.createSession();
|
|
354
355
|
|
|
355
356
|
// Use generate() for simple request/response
|
|
356
|
-
const response = await agent.generate('What is TypeScript?',
|
|
357
|
-
sessionId: session.id
|
|
358
|
-
});
|
|
357
|
+
const response = await agent.generate('What is TypeScript?', session.id);
|
|
359
358
|
console.log(response.content);
|
|
360
359
|
|
|
361
360
|
// Conversations maintain context within a session
|
|
362
|
-
await agent.generate('Write a haiku about it',
|
|
363
|
-
await agent.generate('Make it funnier',
|
|
361
|
+
await agent.generate('Write a haiku about it', session.id);
|
|
362
|
+
await agent.generate('Make it funnier', session.id);
|
|
363
|
+
|
|
364
|
+
// Multimodal: send images or files
|
|
365
|
+
await agent.generate([
|
|
366
|
+
{ type: 'text', text: 'Describe this image' },
|
|
367
|
+
{ type: 'image', image: base64Data, mimeType: 'image/png' }
|
|
368
|
+
], session.id);
|
|
369
|
+
|
|
370
|
+
// Streaming for real-time UIs
|
|
371
|
+
for await (const event of await agent.stream('Write a story', session.id)) {
|
|
372
|
+
if (event.name === 'llm:chunk') process.stdout.write(event.content);
|
|
373
|
+
}
|
|
364
374
|
|
|
365
375
|
await agent.stop();
|
|
366
376
|
```
|
|
367
377
|
|
|
368
|
-
See our [Dexto Agent SDK docs](https://docs.dexto.ai/
|
|
378
|
+
See our [Dexto Agent SDK docs](https://docs.dexto.ai/docs/guides/dexto-sdk) for multimodal content, streaming, MCP tools, and advanced features.
|
|
369
379
|
|
|
370
380
|
---
|
|
371
381
|
|
|
@@ -381,7 +391,7 @@ await agent.start();
|
|
|
381
391
|
|
|
382
392
|
// Create and manage sessions
|
|
383
393
|
const session = await agent.createSession('user-123');
|
|
384
|
-
await agent.generate('Hello, how can you help me?',
|
|
394
|
+
await agent.generate('Hello, how can you help me?', session.id);
|
|
385
395
|
|
|
386
396
|
// List and manage sessions
|
|
387
397
|
const sessions = await agent.listSessions();
|
|
@@ -508,10 +518,12 @@ Agent Selection:
|
|
|
508
518
|
|
|
509
519
|
Advanced Modes:
|
|
510
520
|
dexto --mode server Run as API server
|
|
511
|
-
dexto --mode discord Run as Discord bot
|
|
512
|
-
dexto --mode telegram Run as Telegram bot
|
|
513
521
|
dexto --mode mcp Run as MCP server
|
|
514
522
|
|
|
523
|
+
Platform Integrations (Reference Implementations):
|
|
524
|
+
See examples/discord-bot/ Run as Discord bot
|
|
525
|
+
See examples/telegram-bot/ Run as Telegram bot
|
|
526
|
+
|
|
515
527
|
Session Commands: dexto session list|history|delete • search
|
|
516
528
|
Search: dexto search <query> [--session <id>] [--role <role>]
|
|
517
529
|
|
|
@@ -534,15 +546,13 @@ Options:
|
|
|
534
546
|
--skip-setup Skip global setup validation (useful for MCP
|
|
535
547
|
mode, automation)
|
|
536
548
|
-m, --model <model> Specify the LLM model to use
|
|
537
|
-
--router <router> Specify the LLM router to use (vercel or
|
|
538
|
-
in-built)
|
|
539
549
|
--auto-approve Always approve tool executions without
|
|
540
550
|
confirmation prompts
|
|
541
551
|
-c, --continue Continue most recent conversation
|
|
542
552
|
-r, --resume <sessionId> Resume session by ID
|
|
543
553
|
--mode <mode> The application in which dexto should talk
|
|
544
|
-
to you - web | cli | server |
|
|
545
|
-
|
|
554
|
+
to you - web | cli | server | mcp
|
|
555
|
+
(default: "web")
|
|
546
556
|
--port <port> port for the server (default: 3000 for web,
|
|
547
557
|
3001 for server mode)
|
|
548
558
|
--no-auto-install Disable automatic installation of missing
|
|
@@ -125,6 +125,15 @@
|
|
|
125
125
|
"tags": ["posthog", "analytics", "product", "insights", "feature-flags", "mcp"],
|
|
126
126
|
"source": "product-analysis-agent/",
|
|
127
127
|
"main": "product-analysis-agent.yml"
|
|
128
|
+
},
|
|
129
|
+
"gaming-agent": {
|
|
130
|
+
"id": "gaming-agent",
|
|
131
|
+
"name": "Gaming Agent",
|
|
132
|
+
"description": "AI agent that plays GameBoy games like Pokemon through an emulator with screen capture and button controls",
|
|
133
|
+
"author": "Truffle AI",
|
|
134
|
+
"tags": ["gaming", "gameboy", "pokemon", "emulator", "mcp"],
|
|
135
|
+
"source": "gaming-agent/",
|
|
136
|
+
"main": "gaming-agent.yml"
|
|
128
137
|
}
|
|
129
138
|
}
|
|
130
139
|
}
|
|
@@ -79,6 +79,11 @@ toolConfirmation:
|
|
|
79
79
|
# alwaysDeny:
|
|
80
80
|
# - internal--bash_exec--rm -rf* # Prevent recursive deletion
|
|
81
81
|
|
|
82
|
+
# Elicitation configuration - required for ask_user tool
|
|
83
|
+
elicitation:
|
|
84
|
+
enabled: true
|
|
85
|
+
timeout: 120000
|
|
86
|
+
|
|
82
87
|
# Internal tools - all coding tools enabled
|
|
83
88
|
internalTools:
|
|
84
89
|
- ask_user # Ask questions and collect input
|
|
@@ -85,7 +85,7 @@ storage:
|
|
|
85
85
|
|
|
86
86
|
toolConfirmation:
|
|
87
87
|
mode: manual
|
|
88
|
-
timeout:
|
|
88
|
+
# timeout: <optional> # Time to wait for approval (ms). Omit for no timeout (wait indefinitely)
|
|
89
89
|
allowedToolsStorage: memory # 'memory' or 'storage' for persisting allowed tools
|
|
90
90
|
|
|
91
91
|
# Optional: Static tool policies for fine-grained allow/deny control
|
|
@@ -107,7 +107,7 @@ toolConfirmation:
|
|
|
107
107
|
# Allows auto-approve for tools while still supporting user input requests
|
|
108
108
|
elicitation:
|
|
109
109
|
enabled: true # Enable ask_user tool and MCP server elicitations
|
|
110
|
-
timeout:
|
|
110
|
+
# timeout: <optional> # Time to wait for user input (ms). Omit for no timeout (wait indefinitely)
|
|
111
111
|
|
|
112
112
|
# Internal tools - built-in Dexto capabilities
|
|
113
113
|
internalTools:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-hono.d.ts","sourceRoot":"","sources":["../../src/api/server-hono.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAuC,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"server-hono.d.ts","sourceRoot":"","sources":["../../src/api/server-hono.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAuC,UAAU,EAAE,MAAM,aAAa,CAAC;AAQ9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EACH,cAAc,EACd,gBAAgB,EAShB,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AAwEvB,MAAM,MAAM,wBAAwB,GAAG;IACnC,GAAG,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IACvC,MAAM,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC;IACtD,iBAAiB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC1F,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5E,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/E,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7E,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,gBAAgB,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAC9C,CAAC;AAGF,wBAAsB,iBAAiB,CACnC,KAAK,EAAE,UAAU,EACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,EACtC,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,kBAAkB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CA6VnC;AAED,wBAAsB,kBAAkB,CACpC,KAAK,EAAE,UAAU,EACjB,IAAI,SAAO,EACX,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,EACtC,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,kBAAkB,GACjC,OAAO,CAAC;IACP,MAAM,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC;IACtD,iBAAiB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;CAC7F,CAAC,CAgCD"}
|
package/dist/api/server-hono.js
CHANGED
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
import { createAgentCard, logger, AgentError, DextoAgent } from '@dexto/core';
|
|
3
|
-
import { loadAgentConfig, enrichAgentConfig } from '@dexto/agent-management';
|
|
4
|
-
import { Dexto, deriveDisplayName } from '@dexto/agent-management';
|
|
3
|
+
import { loadAgentConfig, enrichAgentConfig, deriveDisplayName, getAgentRegistry, AgentFactory, } from '@dexto/agent-management';
|
|
5
4
|
import { createDextoApp, createNodeServer, createMcpTransport as createServerMcpTransport, createMcpHttpHandlers, initializeMcpServer as initializeServerMcpServer, createManualApprovalHandler, WebhookEventSubscriber, A2ASseEventSubscriber, ApprovalCoordinator, } from '@dexto/server';
|
|
6
5
|
import { registerGracefulShutdown } from '../utils/graceful-shutdown.js';
|
|
7
6
|
const DEFAULT_AGENT_VERSION = '1.0.0';
|
|
7
|
+
/**
|
|
8
|
+
* List all agents (installed and available)
|
|
9
|
+
* Replacement for old Dexto.listAgents()
|
|
10
|
+
*/
|
|
11
|
+
async function listAgents() {
|
|
12
|
+
return AgentFactory.listAgents({
|
|
13
|
+
descriptionFallback: 'No description',
|
|
14
|
+
customAgentDescriptionFallback: 'Custom agent',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create an agent from an agent ID
|
|
19
|
+
* Replacement for old Dexto.createAgent()
|
|
20
|
+
* Uses registry.resolveAgent() which auto-installs if needed
|
|
21
|
+
*/
|
|
22
|
+
async function createAgentFromId(agentId) {
|
|
23
|
+
try {
|
|
24
|
+
// Use registry to resolve agent path (auto-installs if not present)
|
|
25
|
+
const registry = getAgentRegistry();
|
|
26
|
+
const agentPath = await registry.resolveAgent(agentId, true, true);
|
|
27
|
+
// Load and enrich agent config
|
|
28
|
+
const config = await loadAgentConfig(agentPath);
|
|
29
|
+
const enrichedConfig = enrichAgentConfig(config, agentPath, {
|
|
30
|
+
logLevel: 'info', // Server uses info-level logging for visibility
|
|
31
|
+
});
|
|
32
|
+
// Create agent instance
|
|
33
|
+
logger.info(`Creating agent: ${agentId} from ${agentPath}`);
|
|
34
|
+
return new DextoAgent(enrichedConfig, agentPath);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw new Error(`Failed to create agent '${agentId}': ${error instanceof Error ? error.message : String(error)}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
8
40
|
function resolvePort(listenPort) {
|
|
9
41
|
if (typeof listenPort === 'number') {
|
|
10
42
|
return listenPort;
|
|
@@ -52,7 +84,7 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
52
84
|
* Helper to resolve agent ID to { id, name } by looking up in registry
|
|
53
85
|
*/
|
|
54
86
|
async function resolveAgentInfo(agentId) {
|
|
55
|
-
const agents = await
|
|
87
|
+
const agents = await listAgents();
|
|
56
88
|
const agent = agents.installed.find((a) => a.id === agentId) ??
|
|
57
89
|
agents.available.find((a) => a.id === agentId);
|
|
58
90
|
return {
|
|
@@ -135,7 +167,7 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
135
167
|
const { Telemetry } = await import('@dexto/core');
|
|
136
168
|
await Telemetry.shutdownGlobal();
|
|
137
169
|
// 2. Create new agent from registry (will initialize fresh telemetry in createAgentServices)
|
|
138
|
-
newAgent = await
|
|
170
|
+
newAgent = await createAgentFromId(agentId);
|
|
139
171
|
// 3. Use common switch logic (register subscribers, start agent, stop previous)
|
|
140
172
|
return await performAgentSwitch(newAgent, agentId, bridge);
|
|
141
173
|
}
|
|
@@ -170,7 +202,9 @@ export async function initializeHonoApi(agent, agentCardOverride, listenPort, ag
|
|
|
170
202
|
// 2. Load agent configuration from file path
|
|
171
203
|
const config = await loadAgentConfig(filePath);
|
|
172
204
|
// 3. Enrich config with per-agent paths (logs, storage, etc.)
|
|
173
|
-
const enrichedConfig = enrichAgentConfig(config, filePath
|
|
205
|
+
const enrichedConfig = enrichAgentConfig(config, filePath, {
|
|
206
|
+
logLevel: 'info', // Server uses info-level logging for visibility
|
|
207
|
+
});
|
|
174
208
|
// 4. Create new agent instance directly (will initialize fresh telemetry in createAgentServices)
|
|
175
209
|
newAgent = new DextoAgent(enrichedConfig, filePath);
|
|
176
210
|
// 5. Use enriched agentId (derived from config or filename during enrichment)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-subscriber.d.ts","sourceRoot":"","sources":["../../src/cli/cli-subscriber.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;GAGG;AACH,qBAAa,aAAc,YAAW,eAAe;IACjD,OAAO,CAAC,gBAAgB,CAAc;IACtC,OAAO,CAAC,iBAAiB,CAAC,CAAa;IACvC,OAAO,CAAC,gBAAgB,CAAC,CAAyB;IAElD,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"cli-subscriber.d.ts","sourceRoot":"","sources":["../../src/cli/cli-subscriber.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;GAGG;AACH,qBAAa,aAAc,YAAW,eAAe;IACjD,OAAO,CAAC,gBAAgB,CAAc;IACtC,OAAO,CAAC,iBAAiB,CAAC,CAAa;IACvC,OAAO,CAAC,gBAAgB,CAAC,CAAyB;IAElD,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IA0BxC;;;OAGG;IACH,OAAO,IAAI,IAAI;IAcf,UAAU,IAAI,IAAI;IAIlB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAM3B,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAK9C,YAAY,CACR,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,mBAAmB,EAC9B,SAAS,CAAC,EAAE,OAAO,EACnB,OAAO,CAAC,EAAE,OAAO,GAClB,IAAI;IAMP,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IA0B9B,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IA0B3B,mBAAmB,IAAI,IAAI;IAM3B;;;OAGG;IACG,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAsBxF"}
|
|
@@ -23,7 +23,13 @@ export class CLISubscriber {
|
|
|
23
23
|
// Ignore reasoning chunks for headless mode
|
|
24
24
|
});
|
|
25
25
|
eventBus.on('llm:tool-call', (payload) => this.onToolCall(payload.toolName, payload.args));
|
|
26
|
-
eventBus.on('llm:tool-result', (payload) =>
|
|
26
|
+
eventBus.on('llm:tool-result', (payload) => {
|
|
27
|
+
// Only call onToolResult when we have sanitized result (success case)
|
|
28
|
+
if (payload.sanitized) {
|
|
29
|
+
this.onToolResult(payload.toolName, payload.sanitized, payload.rawResult, payload.success);
|
|
30
|
+
}
|
|
31
|
+
// For error case (success=false), the error is handled via llm:error event
|
|
32
|
+
});
|
|
27
33
|
eventBus.on('llm:response', (payload) => this.onResponse(payload.content));
|
|
28
34
|
eventBus.on('llm:error', (payload) => this.onError(payload.error));
|
|
29
35
|
eventBus.on('session:reset', this.onConversationReset.bind(this));
|
|
@@ -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
|
*/
|
|
@@ -82,7 +83,7 @@ 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(', ');
|
|
@@ -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;AAOxB,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;EAOb,CAAC;AAEd,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,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;AAOxB,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;EAOb,CAAC;AAEd,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAgL1E,wBAAsB,oBAAoB,CACtC,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC,CAqLf"}
|
|
@@ -3,8 +3,8 @@ 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 { installBundledAgent, installCustomAgent } from '../../utils/agent-helpers.js';
|
|
8
8
|
import { capture } from '../../analytics/index.js';
|
|
9
9
|
// Zod schema for install command validation
|
|
10
10
|
const InstallCommandSchema = z
|
|
@@ -121,14 +121,13 @@ async function promptForMetadata(suggestedName) {
|
|
|
121
121
|
* Validate install command arguments with registry-aware validation
|
|
122
122
|
*/
|
|
123
123
|
function validateInstallCommand(agents, options) {
|
|
124
|
-
const registry = getAgentRegistry();
|
|
125
124
|
// Basic structure validation
|
|
126
125
|
const validated = InstallCommandSchema.parse({
|
|
127
126
|
...options,
|
|
128
127
|
agents,
|
|
129
128
|
});
|
|
130
129
|
// Business logic validation
|
|
131
|
-
const availableAgents =
|
|
130
|
+
const availableAgents = loadBundledRegistryAgents();
|
|
132
131
|
if (!validated.all && validated.agents.length === 0) {
|
|
133
132
|
throw new Error(`No agents specified. Use agent names or --all flag. Available agents: ${Object.keys(availableAgents).join(', ')}`);
|
|
134
133
|
}
|
|
@@ -137,7 +136,7 @@ function validateInstallCommand(agents, options) {
|
|
|
137
136
|
const filePaths = validated.agents.filter(isFilePath);
|
|
138
137
|
const registryNames = validated.agents.filter((agent) => !isFilePath(agent));
|
|
139
138
|
// Validate registry names exist in registry
|
|
140
|
-
const invalidAgents = registryNames.filter((agent) => !
|
|
139
|
+
const invalidAgents = registryNames.filter((agent) => !(agent in availableAgents));
|
|
141
140
|
if (invalidAgents.length > 0) {
|
|
142
141
|
throw new Error(`Unknown agents: ${invalidAgents.join(', ')}. ` +
|
|
143
142
|
`Available agents: ${Object.keys(availableAgents).join(', ')}`);
|
|
@@ -156,12 +155,12 @@ function validateInstallCommand(agents, options) {
|
|
|
156
155
|
export async function handleInstallCommand(agents, options) {
|
|
157
156
|
// Validate command with Zod
|
|
158
157
|
const validated = validateInstallCommand(agents, options);
|
|
159
|
-
const registry = getAgentRegistry();
|
|
160
158
|
// Determine which agents to install
|
|
161
159
|
let agentsToInstall;
|
|
162
160
|
if (validated.all) {
|
|
163
161
|
// --all flag only works with registry agents, not file paths
|
|
164
|
-
|
|
162
|
+
const availableAgents = loadBundledRegistryAgents();
|
|
163
|
+
agentsToInstall = Object.keys(availableAgents);
|
|
165
164
|
console.log(`📋 Installing all ${agentsToInstall.length} available agents...`);
|
|
166
165
|
}
|
|
167
166
|
else {
|
|
@@ -191,35 +190,6 @@ export async function handleInstallCommand(agents, options) {
|
|
|
191
190
|
: extractAgentNameFromPath(resolvedPath);
|
|
192
191
|
// Prompt for metadata
|
|
193
192
|
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
193
|
// Check if already installed (unless --force)
|
|
224
194
|
const globalAgentsDir = getDextoGlobalPath('agents');
|
|
225
195
|
const installedPath = path.join(globalAgentsDir, metadata.agentName);
|
|
@@ -236,12 +206,14 @@ export async function handleInstallCommand(agents, options) {
|
|
|
236
206
|
continue;
|
|
237
207
|
}
|
|
238
208
|
// Install custom agent
|
|
239
|
-
await
|
|
209
|
+
await installCustomAgent(metadata.agentName, resolvedPath, {
|
|
210
|
+
name: metadata.agentName,
|
|
240
211
|
description: metadata.description,
|
|
241
212
|
author: metadata.author,
|
|
242
213
|
tags: metadata.tags,
|
|
243
|
-
|
|
244
|
-
|
|
214
|
+
}, {
|
|
215
|
+
injectPreferences: validated.injectPreferences,
|
|
216
|
+
});
|
|
245
217
|
successCount++;
|
|
246
218
|
console.log(`✅ ${metadata.agentName} installed successfully`);
|
|
247
219
|
installed.push(metadata.agentName);
|
|
@@ -271,7 +243,9 @@ export async function handleInstallCommand(agents, options) {
|
|
|
271
243
|
});
|
|
272
244
|
continue;
|
|
273
245
|
}
|
|
274
|
-
await
|
|
246
|
+
await installBundledAgent(agentInput, {
|
|
247
|
+
injectPreferences: validated.injectPreferences,
|
|
248
|
+
});
|
|
275
249
|
successCount++;
|
|
276
250
|
console.log(`✅ ${agentInput} installed successfully`);
|
|
277
251
|
installed.push(agentInput);
|
|
@@ -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"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Helper for command handlers to get the current session ID from CLI context.
|
|
4
|
-
* This is set by executeCommand() when invoked from InkCLI.
|
|
5
|
-
*
|
|
6
|
-
* Maintains separation of concerns:
|
|
7
|
-
* - InkCLI state manages current sessionId
|
|
8
|
-
* - executeCommand() stores it temporarily on agent for command access
|
|
9
|
-
* - Commands use this helper instead of removed agent.getCurrentSessionId()
|
|
10
|
-
*
|
|
11
|
-
* @param agent - DextoAgent instance with __cliSessionId set by executeCommand
|
|
12
|
-
* @returns Current session ID from CLI context, or null if not available
|
|
13
|
-
*/
|
|
14
|
-
export function getCLISessionId(agent) {
|
|
15
|
-
return agent.__cliSessionId || null;
|
|
16
|
-
}
|
|
17
2
|
/**
|
|
18
3
|
* Parse arguments respecting quotes and escape sequences
|
|
19
4
|
*/
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* This file serves as the integration layer that combines all modular commands
|
|
19
19
|
* into a single CLI_COMMANDS array for the command execution system.
|
|
20
20
|
*/
|
|
21
|
-
import {
|
|
22
|
-
import type { CommandDefinition } from './command-parser.js';
|
|
21
|
+
import type { DextoAgent } from '@dexto/core';
|
|
22
|
+
import type { CommandDefinition, CommandHandlerResult } from './command-parser.js';
|
|
23
23
|
/**
|
|
24
24
|
* Complete list of all available CLI commands.
|
|
25
25
|
* This array combines commands from all extracted modules to maintain
|
|
@@ -40,9 +40,9 @@ export declare const CLI_COMMANDS: CommandDefinition[];
|
|
|
40
40
|
* Execute a slash command
|
|
41
41
|
*
|
|
42
42
|
* @param sessionId - Session ID to use for agent.run() calls
|
|
43
|
-
* @returns
|
|
43
|
+
* @returns CommandHandlerResult - boolean, string, or StyledOutput
|
|
44
44
|
*/
|
|
45
|
-
export declare function executeCommand(command: string, args: string[], agent: DextoAgent, sessionId?: string): Promise<
|
|
45
|
+
export declare function executeCommand(command: string, args: string[], agent: DextoAgent, sessionId?: string): Promise<CommandHandlerResult>;
|
|
46
46
|
/**
|
|
47
47
|
* Get all available command definitions
|
|
48
48
|
* This is used by external systems that need to inspect available commands
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/interactive-commands/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAYnF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,EAAE,iBAAiB,EAAO,CAAC;AAqCpD;;;;;GAKG;AACH,wBAAsB,cAAc,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,UAAU,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAyD/B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,iBAAiB,EAAE,CAEpD"}
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
* This file serves as the integration layer that combines all modular commands
|
|
19
19
|
* into a single CLI_COMMANDS array for the command execution system.
|
|
20
20
|
*/
|
|
21
|
-
import { logger } from '@dexto/core';
|
|
22
21
|
// Import modular command definitions
|
|
23
22
|
import { generalCommands, createHelpCommand } from './general-commands.js';
|
|
24
23
|
import { searchCommand, resumeCommand } from './session/index.js';
|
|
@@ -45,18 +44,17 @@ import { documentationCommands } from './documentation-commands.js';
|
|
|
45
44
|
*/
|
|
46
45
|
export const CLI_COMMANDS = [];
|
|
47
46
|
// Build the commands array with proper help command that can access all commands
|
|
48
|
-
//
|
|
49
|
-
// Regular CLI (headless) has full subcommand access via `dexto session list`, etc.
|
|
47
|
+
// All commands here use interactive overlays - no text-based subcommands
|
|
50
48
|
const baseCommands = [
|
|
51
49
|
// General commands (without help)
|
|
52
50
|
...generalCommands,
|
|
53
|
-
// Session management
|
|
54
|
-
searchCommand, // /search - search
|
|
55
|
-
resumeCommand, // /resume -
|
|
56
|
-
// Model management
|
|
57
|
-
modelCommands, // /model -
|
|
58
|
-
// MCP server management
|
|
59
|
-
mcpCommands,
|
|
51
|
+
// Session management
|
|
52
|
+
searchCommand, // /search - opens search overlay
|
|
53
|
+
resumeCommand, // /resume - opens session selector overlay
|
|
54
|
+
// Model management
|
|
55
|
+
modelCommands, // /model - opens model selector overlay
|
|
56
|
+
// MCP server management
|
|
57
|
+
mcpCommands, // /mcp - opens MCP server list overlay
|
|
60
58
|
// Tool management commands
|
|
61
59
|
...toolCommands,
|
|
62
60
|
// Prompt management commands
|
|
@@ -74,60 +72,54 @@ CLI_COMMANDS.push(...baseCommands);
|
|
|
74
72
|
* Execute a slash command
|
|
75
73
|
*
|
|
76
74
|
* @param sessionId - Session ID to use for agent.run() calls
|
|
77
|
-
* @returns
|
|
75
|
+
* @returns CommandHandlerResult - boolean, string, or StyledOutput
|
|
78
76
|
*/
|
|
79
77
|
export async function executeCommand(command, args, agent, sessionId) {
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
agent.__cliSessionId = sessionId;
|
|
83
|
-
}
|
|
78
|
+
// Create command context with sessionId
|
|
79
|
+
const ctx = { sessionId: sessionId ?? null };
|
|
84
80
|
// Find the command (including aliases)
|
|
85
81
|
const cmd = CLI_COMMANDS.find((c) => c.name === command || (c.aliases && c.aliases.includes(command)));
|
|
86
82
|
if (cmd) {
|
|
87
83
|
try {
|
|
88
|
-
// Execute the handler with
|
|
89
|
-
const result = await cmd.handler(args, agent);
|
|
84
|
+
// Execute the handler with context
|
|
85
|
+
const result = await cmd.handler(args, agent, ctx);
|
|
90
86
|
// If handler returns a string, it's formatted output for ink-cli
|
|
91
87
|
// If it returns boolean, it's the old behavior (handled or not)
|
|
92
88
|
return result;
|
|
93
89
|
}
|
|
94
90
|
catch (error) {
|
|
95
91
|
const errorMsg = `❌ Error executing command /${command}:\n${error instanceof Error ? error.message : String(error)}`;
|
|
96
|
-
|
|
92
|
+
agent.logger.error(`Error executing command /${command}: ${error instanceof Error ? error.message : String(error)}`);
|
|
97
93
|
return errorMsg; // Return for ink-cli
|
|
98
94
|
}
|
|
99
95
|
}
|
|
100
|
-
// Command not found in static commands - check if it's a prompt
|
|
96
|
+
// Command not found in static commands - check if it's a dynamic prompt command
|
|
97
|
+
// Dynamic commands use displayName (e.g., "quick-start" instead of "config:quick-start")
|
|
101
98
|
try {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const errorMsg = `❌ Error executing prompt /${command}:\n${error instanceof Error ? error.message : String(error)}`;
|
|
118
|
-
console.error(errorMsg);
|
|
119
|
-
return errorMsg;
|
|
120
|
-
}
|
|
99
|
+
// Import prompt command creation dynamically to avoid circular dependencies
|
|
100
|
+
const { getDynamicPromptCommands } = await import('./prompt-commands.js');
|
|
101
|
+
const dynamicCommands = await getDynamicPromptCommands(agent);
|
|
102
|
+
// Commands are registered by displayName, so search by command name directly
|
|
103
|
+
const promptCmd = dynamicCommands.find((c) => c.name === command);
|
|
104
|
+
if (promptCmd) {
|
|
105
|
+
try {
|
|
106
|
+
const result = await promptCmd.handler(args, agent, ctx);
|
|
107
|
+
// Return the result directly - can be string, boolean, StyledOutput, or SendMessageMarker
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
const errorMsg = `❌ Error executing prompt /${command}:\n${error instanceof Error ? error.message : String(error)}`;
|
|
112
|
+
agent.logger.error(`Error executing prompt /${command}: ${error instanceof Error ? error.message : String(error)}`);
|
|
113
|
+
return errorMsg;
|
|
121
114
|
}
|
|
122
115
|
}
|
|
123
116
|
}
|
|
124
117
|
catch (error) {
|
|
125
|
-
// If
|
|
126
|
-
logger.debug(`Failed to check
|
|
118
|
+
// If loading dynamic commands fails, continue to unknown command error
|
|
119
|
+
agent.logger.debug(`Failed to check dynamic commands for ${command}: ${error instanceof Error ? error.message : String(error)}`);
|
|
127
120
|
}
|
|
128
121
|
// Command not found and not a prompt
|
|
129
|
-
const errorMsg = `❌ Unknown command: /${command}\nType /
|
|
130
|
-
console.log(errorMsg);
|
|
122
|
+
const errorMsg = `❌ Unknown command: /${command}\nType / to see available commands, /prompts to add new ones`;
|
|
131
123
|
return errorMsg; // Return for ink-cli
|
|
132
124
|
}
|
|
133
125
|
/**
|