dexto 1.4.0 → 1.5.1
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 +62 -7
- package/dist/agents/agent-template.yml +2 -2
- package/dist/agents/coding-agent/coding-agent.yml +22 -16
- package/dist/agents/database-agent/database-agent.yml +2 -2
- package/dist/agents/default-agent.yml +7 -5
- 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 +27 -5
- 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 +40 -2
- 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.js +7 -7
- 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 +10 -35
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +1 -1
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/command-parser.js +18 -8
- package/dist/cli/commands/interactive-commands/general-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/general-commands.js +64 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +11 -11
- package/dist/cli/commands/interactive-commands/system/system-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/system/system-commands.js +6 -5
- package/dist/cli/commands/list-agents.js +2 -2
- 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 +995 -65
- package/dist/cli/commands/which.js +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +2 -0
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +29 -7
- 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.map +1 -1
- package/dist/cli/ink-cli/components/ElicitationForm.js +6 -6
- 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.map +1 -1
- package/dist/cli/ink-cli/components/Footer.js +1 -1
- package/dist/cli/ink-cli/components/HistorySearchBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/HistorySearchBar.js +1 -1
- 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.map +1 -1
- package/dist/cli/ink-cli/components/ResourceAutocomplete.js +4 -4
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +3 -3
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/StatusBar.js +7 -5
- package/dist/cli/ink-cli/components/TextBufferInput.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/TextBufferInput.js +13 -9
- package/dist/cli/ink-cli/components/base/BaseAutocomplete.js +4 -4
- package/dist/cli/ink-cli/components/base/BaseSelector.js +2 -2
- package/dist/cli/ink-cli/components/chat/Footer.js +1 -1
- package/dist/cli/ink-cli/components/chat/Header.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/Header.js +2 -4
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +9 -6
- package/dist/cli/ink-cli/components/chat/MessageList.js +1 -1
- package/dist/cli/ink-cli/components/chat/QueuedMessagesDisplay.js +1 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.d.ts +1 -1
- package/dist/cli/ink-cli/components/chat/ToolIcon.js +4 -4
- package/dist/cli/ink-cli/components/chat/styled-boxes/ConfigBox.js +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/HelpBox.js +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/LogConfigBox.js +2 -2
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionHistoryBox.js +5 -5
- package/dist/cli/ink-cli/components/chat/styled-boxes/SessionListBox.js +2 -2
- package/dist/cli/ink-cli/components/chat/styled-boxes/ShortcutsBox.js +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/StatsBox.js +1 -1
- package/dist/cli/ink-cli/components/chat/styled-boxes/StyledBox.js +2 -2
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +1 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +1 -1
- package/dist/cli/ink-cli/components/overlays/ApiKeyInput.js +1 -1
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts +10 -2
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/CustomModelWizard.js +209 -89
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +2 -2
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpAddChoice.js +1 -1
- package/dist/cli/ink-cli/components/overlays/McpAddSelector.js +1 -1
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpCustomTypeSelector.js +2 -2
- package/dist/cli/ink-cli/components/overlays/McpCustomWizard.js +1 -1
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +1 -1
- package/dist/cli/ink-cli/components/overlays/McpSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpSelector.js +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.js +2 -2
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerList.js +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts +6 -5
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +284 -68
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptAddChoice.js +2 -2
- package/dist/cli/ink-cli/components/overlays/PromptAddWizard.js +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptDeleteSelector.js +2 -2
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptList.js +2 -2
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/SearchOverlay.js +4 -4
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/SessionSubcommandSelector.js +1 -1
- package/dist/cli/ink-cli/components/overlays/StreamSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/StreamSelector.js +1 -1
- package/dist/cli/ink-cli/components/overlays/ToolBrowser.js +12 -12
- 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 +462 -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 +85 -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.js +2 -2
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +1 -1
- package/dist/cli/ink-cli/components/renderers/FileRenderer.js +4 -4
- package/dist/cli/ink-cli/components/renderers/GenericRenderer.js +2 -2
- package/dist/cli/ink-cli/components/renderers/SearchRenderer.js +1 -1
- package/dist/cli/ink-cli/components/renderers/ShellRenderer.js +3 -3
- package/dist/cli/ink-cli/components/renderers/diff-shared.js +1 -1
- package/dist/cli/ink-cli/components/shared/MarkdownText.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/shared/MarkdownText.js +8 -6
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +23 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +81 -25
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts +9 -2
- package/dist/cli/ink-cli/hooks/useAgentEvents.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useAgentEvents.js +148 -6
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts +1 -1
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useCLIState.js +7 -2
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts +11 -7
- package/dist/cli/ink-cli/hooks/useTokenCounter.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useTokenCounter.js +41 -18
- package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/processStream.js +97 -17
- package/dist/cli/ink-cli/state/types.d.ts +5 -4
- package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +5 -0
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +59 -1
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/toolUtils.js +2 -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.js +1 -1
- 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 +44 -1
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +102 -0
- package/dist/index.js +339 -56
- package/dist/webui/assets/index-8j-KMkX1.js +2054 -0
- package/dist/webui/assets/index-c_AX24V4.css +1 -0
- package/dist/webui/index.html +3 -9
- 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 +8 -7
- package/dist/webui/assets/index-BkwPkZpd.css +0 -1
- package/dist/webui/assets/index-D9u1XfyH.js +0 -2025
|
@@ -10,9 +10,42 @@
|
|
|
10
10
|
* - /clear, /reset - Clear conversation history
|
|
11
11
|
*/
|
|
12
12
|
import chalk from 'chalk';
|
|
13
|
+
import { spawn } from 'child_process';
|
|
13
14
|
import { formatForInkCli } from './utils/format-output.js';
|
|
14
15
|
import { CommandOutputHelper } from './utils/command-output.js';
|
|
15
16
|
import { writeToClipboard } from '../../ink-cli/utils/clipboardUtils.js';
|
|
17
|
+
/**
|
|
18
|
+
* Execute a shell command and return the output
|
|
19
|
+
*/
|
|
20
|
+
async function executeShellCommand(command, cwd, timeoutMs = 30000) {
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
const child = spawn(command, [], {
|
|
23
|
+
cwd,
|
|
24
|
+
shell: true,
|
|
25
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
26
|
+
});
|
|
27
|
+
let stdout = '';
|
|
28
|
+
let stderr = '';
|
|
29
|
+
const timer = setTimeout(() => {
|
|
30
|
+
child.kill();
|
|
31
|
+
resolve({ stdout, stderr: `Command timed out after ${timeoutMs}ms`, exitCode: -1 });
|
|
32
|
+
}, timeoutMs);
|
|
33
|
+
child.stdout.on('data', (data) => {
|
|
34
|
+
stdout += data.toString();
|
|
35
|
+
});
|
|
36
|
+
child.stderr.on('data', (data) => {
|
|
37
|
+
stderr += data.toString();
|
|
38
|
+
});
|
|
39
|
+
child.on('error', (error) => {
|
|
40
|
+
clearTimeout(timer);
|
|
41
|
+
resolve({ stdout, stderr: error.message, exitCode: -1 });
|
|
42
|
+
});
|
|
43
|
+
child.on('close', (code) => {
|
|
44
|
+
clearTimeout(timer);
|
|
45
|
+
resolve({ stdout, stderr, exitCode: code ?? -1 });
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
16
49
|
/**
|
|
17
50
|
* Creates the help command with access to all commands for display
|
|
18
51
|
*/
|
|
@@ -47,6 +80,36 @@ export function createHelpCommand(getAllCommands) {
|
|
|
47
80
|
* Note: The help command is created separately to avoid circular dependencies
|
|
48
81
|
*/
|
|
49
82
|
export const generalCommands = [
|
|
83
|
+
{
|
|
84
|
+
name: 'shell',
|
|
85
|
+
description: 'Execute shell command directly (use !command as shortcut)',
|
|
86
|
+
usage: '!<command> or /shell <command>',
|
|
87
|
+
category: 'General',
|
|
88
|
+
handler: async (args, agent, _ctx) => {
|
|
89
|
+
const command = args.join(' ').trim();
|
|
90
|
+
if (!command) {
|
|
91
|
+
return formatForInkCli('❌ No command provided. Usage: !<command>');
|
|
92
|
+
}
|
|
93
|
+
const cwd = process.cwd();
|
|
94
|
+
agent.logger.debug(`Executing shell command: ${command}`);
|
|
95
|
+
const { stdout, stderr, exitCode } = await executeShellCommand(command, cwd);
|
|
96
|
+
// Build output
|
|
97
|
+
const lines = [];
|
|
98
|
+
if (stdout.trim()) {
|
|
99
|
+
lines.push(stdout.trim());
|
|
100
|
+
}
|
|
101
|
+
if (stderr.trim()) {
|
|
102
|
+
lines.push(chalk.yellow(stderr.trim()));
|
|
103
|
+
}
|
|
104
|
+
if (exitCode !== 0) {
|
|
105
|
+
lines.push(chalk.red(`Exit code: ${exitCode}`));
|
|
106
|
+
}
|
|
107
|
+
if (lines.length === 0) {
|
|
108
|
+
return formatForInkCli(chalk.gray('(no output)'));
|
|
109
|
+
}
|
|
110
|
+
return formatForInkCli(lines.join('\n'));
|
|
111
|
+
},
|
|
112
|
+
},
|
|
50
113
|
{
|
|
51
114
|
name: 'exit',
|
|
52
115
|
description: 'Exit the CLI',
|
|
@@ -54,7 +117,7 @@ export const generalCommands = [
|
|
|
54
117
|
category: 'General',
|
|
55
118
|
aliases: ['quit', 'q'],
|
|
56
119
|
handler: async (_args, _agent, _ctx) => {
|
|
57
|
-
console.log(chalk.
|
|
120
|
+
console.log(chalk.rgb(255, 165, 0)('Exiting AI CLI. Goodbye!'));
|
|
58
121
|
process.exit(0);
|
|
59
122
|
},
|
|
60
123
|
},
|
|
@@ -51,7 +51,7 @@ export const promptCommands = [
|
|
|
51
51
|
const promptNames = Object.keys(prompts || {});
|
|
52
52
|
if (promptNames.length === 0) {
|
|
53
53
|
const output = '\n⚠️ No prompts available';
|
|
54
|
-
console.log(chalk.
|
|
54
|
+
console.log(chalk.rgb(255, 165, 0)(output));
|
|
55
55
|
return formatForInkCli(output);
|
|
56
56
|
}
|
|
57
57
|
// Build output string
|
|
@@ -132,20 +132,20 @@ export const promptCommands = [
|
|
|
132
132
|
.map((a) => `${a.name}${a.required ? '*' : ''}`)
|
|
133
133
|
.join(', ')}]`
|
|
134
134
|
: '';
|
|
135
|
-
console.log(` ${chalk.blue(displayName)}${chalk.
|
|
135
|
+
console.log(` ${chalk.blue(displayName)}${chalk.rgb(255, 165, 0)(title)}${chalk.gray(desc)}${chalk.gray(args)}`);
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
console.log();
|
|
139
139
|
}
|
|
140
140
|
if (configPrompts.length > 0) {
|
|
141
|
-
console.log(chalk.
|
|
141
|
+
console.log(chalk.cyan('📋 Config Prompts:'));
|
|
142
142
|
configPrompts.forEach((name) => {
|
|
143
143
|
const info = prompts[name];
|
|
144
144
|
if (info) {
|
|
145
145
|
const displayName = info.displayName || name;
|
|
146
146
|
const title = info.title && info.title !== displayName ? ` (${info.title})` : '';
|
|
147
147
|
const desc = info.description ? ` - ${info.description}` : '';
|
|
148
|
-
console.log(` ${chalk.blue(displayName)}${chalk.
|
|
148
|
+
console.log(` ${chalk.blue(displayName)}${chalk.rgb(255, 165, 0)(title)}${chalk.gray(desc)}`);
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
151
|
console.log();
|
|
@@ -158,13 +158,13 @@ export const promptCommands = [
|
|
|
158
158
|
const displayName = info.displayName || name;
|
|
159
159
|
const title = info.title && info.title !== displayName ? ` (${info.title})` : '';
|
|
160
160
|
const desc = info.description ? ` - ${info.description}` : '';
|
|
161
|
-
console.log(` ${chalk.blue(displayName)}${chalk.
|
|
161
|
+
console.log(` ${chalk.blue(displayName)}${chalk.rgb(255, 165, 0)(title)}${chalk.gray(desc)}`);
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
console.log();
|
|
165
165
|
}
|
|
166
|
-
console.log(chalk.
|
|
167
|
-
console.log(chalk.
|
|
166
|
+
console.log(chalk.gray(`Total: ${promptNames.length} prompts`));
|
|
167
|
+
console.log(chalk.gray('💡 Use /<prompt-name> to execute a prompt directly\n'));
|
|
168
168
|
return formatForInkCli(output);
|
|
169
169
|
}
|
|
170
170
|
catch (error) {
|
|
@@ -198,15 +198,15 @@ function createPromptCommand(promptInfo, hasCollision) {
|
|
|
198
198
|
const { argMap, context: contextString } = splitPromptArguments(args);
|
|
199
199
|
if (Object.keys(argMap).length > 0) {
|
|
200
200
|
console.log(chalk.cyan(`🤖 Executing prompt: ${commandName}`));
|
|
201
|
-
console.log(chalk.
|
|
201
|
+
console.log(chalk.gray(`Explicit arguments: ${JSON.stringify(argMap)}`));
|
|
202
202
|
}
|
|
203
203
|
else if (contextString) {
|
|
204
204
|
console.log(chalk.cyan(`🤖 Executing prompt: ${commandName}`));
|
|
205
|
-
console.log(chalk.
|
|
205
|
+
console.log(chalk.gray(`Context: ${contextString} (LLM will extrapolate template variables)`));
|
|
206
206
|
}
|
|
207
207
|
else {
|
|
208
208
|
console.log(chalk.cyan(`🤖 Executing prompt: ${commandName}`));
|
|
209
|
-
console.log(chalk.
|
|
209
|
+
console.log(chalk.gray('No arguments provided - LLM will extrapolate from context'));
|
|
210
210
|
}
|
|
211
211
|
// Use resolvePrompt instead of getPrompt + flattenPromptResult (matches WebUI approach)
|
|
212
212
|
const resolveOptions = {};
|
|
@@ -232,7 +232,7 @@ function createPromptCommand(promptInfo, hasCollision) {
|
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
234
|
const warningMsg = `⚠️ Prompt '${commandName}' returned no content`;
|
|
235
|
-
console.log(chalk.
|
|
235
|
+
console.log(chalk.rgb(255, 165, 0)(warningMsg));
|
|
236
236
|
return formatForInkCli(warningMsg);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-commands.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/system/system-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAwC,MAAM,sBAAsB,CAAC;AAKpG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"system-commands.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/interactive-commands/system/system-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAwC,MAAM,sBAAsB,CAAC;AAKpG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,iBAAiB,EAyO7C,CAAC"}
|
|
@@ -33,21 +33,22 @@ export const systemCommands = [
|
|
|
33
33
|
const logFilePath = logger.getLogFilePath();
|
|
34
34
|
console.log(chalk.bold.blue('\n📊 Logging Configuration:\n'));
|
|
35
35
|
console.log(` Current level: ${chalk.green.bold(currentLevel)}`);
|
|
36
|
-
if (logFilePath) {
|
|
36
|
+
if (logFilePath && process.env.DEXTO_PRIVACY_MODE !== 'true') {
|
|
37
37
|
console.log(` Log file: ${chalk.cyan(logFilePath)}`);
|
|
38
38
|
}
|
|
39
|
-
console.log(chalk.
|
|
39
|
+
console.log(chalk.gray('\n Available levels (from least to most verbose):'));
|
|
40
40
|
validLevels.forEach((lvl) => {
|
|
41
41
|
const isCurrent = lvl === currentLevel;
|
|
42
42
|
const marker = isCurrent ? chalk.green('▶') : ' ';
|
|
43
43
|
const levelText = isCurrent ? chalk.green.bold(lvl) : chalk.gray(lvl);
|
|
44
44
|
console.log(` ${marker} ${levelText}`);
|
|
45
45
|
});
|
|
46
|
-
console.log(chalk.
|
|
46
|
+
console.log(chalk.gray('\n 💡 Use /log <level> to change level (e.g., /log debug)\n'));
|
|
47
|
+
const isPrivacyMode = process.env.DEXTO_PRIVACY_MODE === 'true';
|
|
47
48
|
const output = [
|
|
48
49
|
'\n📊 Logging Configuration:',
|
|
49
50
|
`Current level: ${currentLevel}`,
|
|
50
|
-
logFilePath ? `Log file: ${logFilePath}` : '',
|
|
51
|
+
logFilePath && !isPrivacyMode ? `Log file: ${logFilePath}` : '',
|
|
51
52
|
'\nAvailable levels: error, warn, info, http, verbose, debug, silly',
|
|
52
53
|
'💡 Use /log <level> to change level',
|
|
53
54
|
]
|
|
@@ -65,7 +66,7 @@ export const systemCommands = [
|
|
|
65
66
|
else {
|
|
66
67
|
const errorMsg = `❌ Invalid log level: ${level}\nValid levels: ${validLevels.join(', ')}`;
|
|
67
68
|
console.log(chalk.red(`❌ Invalid log level: ${chalk.bold(level)}`));
|
|
68
|
-
console.log(chalk.
|
|
69
|
+
console.log(chalk.gray(`Valid levels: ${validLevels.join(', ')}`));
|
|
69
70
|
return formatForInkCli(errorMsg);
|
|
70
71
|
}
|
|
71
72
|
},
|
|
@@ -149,7 +149,7 @@ export async function handleListAgentsCommand(options) {
|
|
|
149
149
|
console.log();
|
|
150
150
|
}
|
|
151
151
|
else if (showInstalled) {
|
|
152
|
-
console.log(chalk.
|
|
152
|
+
console.log(chalk.rgb(255, 165, 0)('📦 No agents installed yet.'));
|
|
153
153
|
console.log(chalk.gray(' Use `dexto install <agent-name>` to install agents from the registry.\n'));
|
|
154
154
|
}
|
|
155
155
|
// Show available agents (not installed)
|
|
@@ -174,7 +174,7 @@ export async function handleListAgentsCommand(options) {
|
|
|
174
174
|
console.log();
|
|
175
175
|
}
|
|
176
176
|
if (customAgents.length > 0) {
|
|
177
|
-
console.log(chalk.
|
|
177
|
+
console.log(chalk.cyan('🔧 Custom Agents Available:'));
|
|
178
178
|
for (const agent of customAgents) {
|
|
179
179
|
if (validated.verbose) {
|
|
180
180
|
console.log(` ${chalk.bold(agent.name)}`);
|
|
@@ -46,14 +46,14 @@ async function displaySessionHistory(sessionId, agent) {
|
|
|
46
46
|
console.log(chalk.blue(`\n💬 Session History for: ${chalk.bold(sessionId)}\n`));
|
|
47
47
|
const history = await agent.getSessionHistory(sessionId);
|
|
48
48
|
if (history.length === 0) {
|
|
49
|
-
console.log(chalk.
|
|
49
|
+
console.log(chalk.gray(' No messages in this session yet.\n'));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
// Display each message with formatting
|
|
53
53
|
history.forEach((message, index) => {
|
|
54
54
|
console.log(formatHistoryMessage(message, index));
|
|
55
55
|
});
|
|
56
|
-
console.log(chalk.
|
|
56
|
+
console.log(chalk.gray(`\n Total: ${history.length} messages`));
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* List all available sessions
|
|
@@ -64,7 +64,7 @@ export async function handleSessionListCommand(agent) {
|
|
|
64
64
|
const sessionIds = await agent.listSessions();
|
|
65
65
|
const mostRecent = await getMostRecentSessionInfo(agent);
|
|
66
66
|
if (sessionIds.length === 0) {
|
|
67
|
-
console.log(chalk.
|
|
67
|
+
console.log(chalk.gray(' No sessions found. Run `dexto` to start a new session, or use `dexto -c`/`dexto -r <id>`.\n'));
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
// Fetch metadata concurrently; errors do not abort listing
|
|
@@ -87,8 +87,8 @@ export async function handleSessionListCommand(agent) {
|
|
|
87
87
|
console.log(` ${formatSessionInfo(id, metadata, isMostRecent)}`);
|
|
88
88
|
displayed++;
|
|
89
89
|
}
|
|
90
|
-
console.log(chalk.
|
|
91
|
-
console.log(chalk.
|
|
90
|
+
console.log(chalk.gray(`\n Total: ${displayed} of ${sessionIds.length} sessions`));
|
|
91
|
+
console.log(chalk.gray(' 💡 Use `dexto -r <id>` to resume a session\n'));
|
|
92
92
|
}
|
|
93
93
|
catch (error) {
|
|
94
94
|
logger.error(`Failed to list sessions: ${error instanceof Error ? error.message : String(error)}`, null, 'red');
|
|
@@ -106,18 +106,18 @@ export async function handleSessionHistoryCommand(agent, sessionId) {
|
|
|
106
106
|
const recentSession = await getMostRecentSessionInfo(agent);
|
|
107
107
|
if (!recentSession) {
|
|
108
108
|
console.log(chalk.red('❌ No sessions found'));
|
|
109
|
-
console.log(chalk.
|
|
109
|
+
console.log(chalk.gray(' Create a session first by running: dexto'));
|
|
110
110
|
throw new Error('No sessions found');
|
|
111
111
|
}
|
|
112
112
|
targetSessionId = recentSession.id;
|
|
113
|
-
console.log(chalk.
|
|
113
|
+
console.log(chalk.gray(`Using most recent session: ${targetSessionId}\n`));
|
|
114
114
|
}
|
|
115
115
|
await displaySessionHistory(targetSessionId, agent);
|
|
116
116
|
}
|
|
117
117
|
catch (error) {
|
|
118
118
|
if (error instanceof Error && error.message.includes('not found')) {
|
|
119
119
|
console.log(chalk.red(`❌ Session not found: ${sessionId || 'current'}`));
|
|
120
|
-
console.log(chalk.
|
|
120
|
+
console.log(chalk.gray(' Use `dexto session list` to see available sessions'));
|
|
121
121
|
}
|
|
122
122
|
else if (error instanceof Error && error.message !== 'No sessions found') {
|
|
123
123
|
logger.error(`Failed to get session history: ${error.message}`, null, 'red');
|
|
@@ -161,21 +161,21 @@ export async function handleSessionSearchCommand(agent, query, options = {}) {
|
|
|
161
161
|
}
|
|
162
162
|
console.log(chalk.blue(`🔍 Searching for: "${query}"`));
|
|
163
163
|
if (searchOptions.sessionId) {
|
|
164
|
-
console.log(chalk.
|
|
164
|
+
console.log(chalk.gray(` Session: ${searchOptions.sessionId}`));
|
|
165
165
|
}
|
|
166
166
|
if (searchOptions.role) {
|
|
167
|
-
console.log(chalk.
|
|
167
|
+
console.log(chalk.gray(` Role: ${searchOptions.role}`));
|
|
168
168
|
}
|
|
169
|
-
console.log(chalk.
|
|
169
|
+
console.log(chalk.gray(` Limit: ${searchOptions.limit}`));
|
|
170
170
|
console.log();
|
|
171
171
|
const results = await agent.searchMessages(query, searchOptions);
|
|
172
172
|
if (results.results.length === 0) {
|
|
173
|
-
console.log(chalk.
|
|
173
|
+
console.log(chalk.rgb(255, 165, 0)('📭 No messages found matching your search'));
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
176
|
console.log(chalk.green(`✅ Found ${results.total} result${results.total === 1 ? '' : 's'}`));
|
|
177
177
|
if (results.hasMore) {
|
|
178
|
-
console.log(chalk.
|
|
178
|
+
console.log(chalk.gray(` Showing first ${results.results.length} results`));
|
|
179
179
|
}
|
|
180
180
|
console.log();
|
|
181
181
|
// Precompile safe regex for highlighting (only if query is not empty)
|
|
@@ -188,8 +188,8 @@ export async function handleSessionSearchCommand(agent, query, options = {}) {
|
|
|
188
188
|
? chalk.blue
|
|
189
189
|
: result.message.role === 'assistant'
|
|
190
190
|
? chalk.green
|
|
191
|
-
: chalk.
|
|
192
|
-
console.log(`${chalk.
|
|
191
|
+
: chalk.rgb(255, 165, 0);
|
|
192
|
+
console.log(`${chalk.gray(`${index + 1}.`)} ${chalk.cyan(result.sessionId)} ${roleColor(`[${result.message.role}]`)}`);
|
|
193
193
|
// Safe highlighting - only if we have a valid regex
|
|
194
194
|
const highlightedContext = highlightRegex
|
|
195
195
|
? result.context.replace(highlightRegex, chalk.inverse('$1'))
|
|
@@ -198,7 +198,7 @@ export async function handleSessionSearchCommand(agent, query, options = {}) {
|
|
|
198
198
|
console.log();
|
|
199
199
|
});
|
|
200
200
|
if (results.hasMore) {
|
|
201
|
-
console.log(chalk.
|
|
201
|
+
console.log(chalk.gray('💡 Use --limit to see more results'));
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
catch (error) {
|
|
@@ -1,37 +1,45 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
declare const SetupCommandSchema: z.ZodEffects<z.ZodObject<{
|
|
3
|
-
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>>;
|
|
3
|
+
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>>;
|
|
4
4
|
model: z.ZodOptional<z.ZodString>;
|
|
5
5
|
defaultAgent: z.ZodDefault<z.ZodString>;
|
|
6
6
|
interactive: z.ZodDefault<z.ZodBoolean>;
|
|
7
7
|
force: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
quickStart: z.ZodDefault<z.ZodBoolean>;
|
|
8
9
|
}, "strict", z.ZodTypeAny, {
|
|
9
10
|
interactive: boolean;
|
|
10
11
|
defaultAgent: string;
|
|
11
12
|
force: boolean;
|
|
12
|
-
|
|
13
|
+
quickStart: boolean;
|
|
14
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
13
15
|
model?: string | undefined;
|
|
14
16
|
}, {
|
|
15
17
|
interactive?: boolean | undefined;
|
|
16
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
18
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
17
19
|
model?: string | undefined;
|
|
18
20
|
defaultAgent?: string | undefined;
|
|
19
21
|
force?: boolean | undefined;
|
|
22
|
+
quickStart?: boolean | undefined;
|
|
20
23
|
}>, {
|
|
21
24
|
interactive: boolean;
|
|
22
25
|
defaultAgent: string;
|
|
23
26
|
force: boolean;
|
|
24
|
-
|
|
27
|
+
quickStart: boolean;
|
|
28
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
25
29
|
model?: string | undefined;
|
|
26
30
|
}, {
|
|
27
31
|
interactive?: boolean | undefined;
|
|
28
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
32
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
29
33
|
model?: string | undefined;
|
|
30
34
|
defaultAgent?: string | undefined;
|
|
31
35
|
force?: boolean | undefined;
|
|
36
|
+
quickStart?: boolean | undefined;
|
|
32
37
|
}>;
|
|
33
38
|
export type CLISetupOptions = z.output<typeof SetupCommandSchema>;
|
|
34
39
|
export type CLISetupOptionsInput = z.input<typeof SetupCommandSchema>;
|
|
40
|
+
/**
|
|
41
|
+
* Main setup command handler
|
|
42
|
+
*/
|
|
35
43
|
export declare function handleSetupCommand(options: Partial<CLISetupOptionsInput>): Promise<void>;
|
|
36
44
|
export {};
|
|
37
45
|
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2CxB,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0ClB,CAAC;AAEP,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAsHtE;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmC9F"}
|