dexto 1.5.6 → 1.5.7
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 +13 -0
- package/dist/agents/coding-agent/coding-agent.yml +15 -0
- package/dist/agents/coding-agent/skills/code-review.md +46 -0
- package/dist/agents/explore-agent/explore-agent.yml +2 -0
- package/dist/analytics/events.d.ts +1 -1
- package/dist/analytics/events.d.ts.map +1 -1
- package/dist/api/server-hono.d.ts.map +1 -1
- package/dist/api/server-hono.js +55 -10
- package/dist/cli/assets/dexto-logo.svg +31 -0
- package/dist/cli/auth/api-client.d.ts +49 -0
- package/dist/cli/auth/api-client.d.ts.map +1 -0
- package/dist/cli/auth/api-client.js +127 -0
- package/dist/cli/auth/constants.d.ts +23 -0
- package/dist/cli/auth/constants.d.ts.map +1 -0
- package/dist/cli/auth/constants.js +24 -0
- package/dist/cli/auth/index.d.ts +5 -0
- package/dist/cli/auth/index.d.ts.map +1 -0
- package/dist/cli/auth/index.js +6 -0
- package/dist/cli/auth/oauth.d.ts +26 -0
- package/dist/cli/auth/oauth.d.ts.map +1 -0
- package/dist/cli/auth/oauth.js +327 -0
- package/dist/cli/auth/service.d.ts +20 -0
- package/dist/cli/auth/service.d.ts.map +1 -0
- package/dist/cli/auth/service.js +147 -0
- package/dist/cli/commands/auth/index.d.ts +4 -0
- package/dist/cli/commands/auth/index.d.ts.map +1 -0
- package/dist/cli/commands/auth/index.js +4 -0
- package/dist/cli/commands/auth/login.d.ts +9 -0
- package/dist/cli/commands/auth/login.d.ts.map +1 -0
- package/dist/cli/commands/auth/login.js +255 -0
- package/dist/cli/commands/auth/logout.d.ts +5 -0
- package/dist/cli/commands/auth/logout.d.ts.map +1 -0
- package/dist/cli/commands/auth/logout.js +51 -0
- package/dist/cli/commands/auth/status.d.ts +2 -0
- package/dist/cli/commands/auth/status.d.ts.map +1 -0
- package/dist/cli/commands/auth/status.js +22 -0
- package/dist/cli/commands/billing/index.d.ts +2 -0
- package/dist/cli/commands/billing/index.d.ts.map +1 -0
- package/dist/cli/commands/billing/index.js +2 -0
- package/dist/cli/commands/billing/status.d.ts +6 -0
- package/dist/cli/commands/billing/status.d.ts.map +1 -0
- package/dist/cli/commands/billing/status.js +60 -0
- package/dist/cli/commands/index.d.ts +3 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +8 -0
- package/dist/cli/commands/interactive-commands/auth/index.d.ts +12 -0
- package/dist/cli/commands/interactive-commands/auth/index.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/auth/index.js +20 -0
- package/dist/cli/commands/interactive-commands/command-parser.d.ts +5 -0
- package/dist/cli/commands/interactive-commands/command-parser.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/command-parser.js +6 -0
- package/dist/cli/commands/interactive-commands/commands.d.ts +1 -0
- package/dist/cli/commands/interactive-commands/commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/commands.js +8 -0
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts +2 -2
- package/dist/cli/commands/interactive-commands/mcp/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/mcp/index.js +4 -7
- package/dist/cli/commands/interactive-commands/model/index.d.ts +2 -2
- package/dist/cli/commands/interactive-commands/model/index.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/model/index.js +4 -7
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts +13 -0
- package/dist/cli/commands/interactive-commands/plugin/index.d.ts.map +1 -0
- package/dist/cli/commands/interactive-commands/plugin/index.js +18 -0
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts +3 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.d.ts.map +1 -1
- package/dist/cli/commands/interactive-commands/prompt-commands.js +72 -36
- package/dist/cli/commands/plugin.d.ts +161 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +376 -0
- package/dist/cli/commands/setup.d.ts +9 -9
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +228 -19
- package/dist/cli/ink-cli/InkCLIRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/InkCLIRefactored.js +2 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/ApprovalPrompt.js +80 -12
- package/dist/cli/ink-cli/components/Footer.d.ts +2 -1
- package/dist/cli/ink-cli/components/Footer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/Footer.js +6 -2
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/SlashCommandAutocomplete.js +15 -7
- package/dist/cli/ink-cli/components/StatusBar.d.ts +5 -1
- package/dist/cli/ink-cli/components/StatusBar.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/StatusBar.js +2 -2
- package/dist/cli/ink-cli/components/chat/MessageItem.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/chat/MessageItem.js +14 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/AlternateBufferCLI.js +4 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/modes/StaticCLI.js +4 -1
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts +1 -0
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/LogLevelSelector.js +30 -19
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts +20 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceAddPrompt.js +81 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts +31 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/MarketplaceBrowser.js +297 -0
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpRemoveSelector.js +7 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerActions.js +9 -0
- package/dist/cli/ink-cli/components/overlays/McpServerList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/McpServerList.js +9 -2
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/ModelSelectorRefactored.js +15 -2
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts +27 -0
- package/dist/cli/ink-cli/components/overlays/PluginActions.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginActions.js +66 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginList.js +70 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts +21 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.d.ts.map +1 -0
- package/dist/cli/ink-cli/components/overlays/PluginManager.js +63 -0
- package/dist/cli/ink-cli/components/overlays/PromptList.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/PromptList.js +4 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts +2 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/overlays/custom-model-wizard/provider-config.js +61 -2
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts +4 -2
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.d.ts.map +1 -1
- package/dist/cli/ink-cli/components/renderers/FilePreviewRenderer.js +4 -4
- package/dist/cli/ink-cli/containers/InputContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/InputContainer.js +30 -3
- package/dist/cli/ink-cli/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/cli/ink-cli/containers/OverlayContainer.js +256 -11
- package/dist/cli/ink-cli/hooks/index.d.ts +1 -0
- package/dist/cli/ink-cli/hooks/index.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/index.js +1 -0
- package/dist/cli/ink-cli/hooks/useCLIState.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useCLIState.js +2 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts +13 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.d.ts.map +1 -0
- package/dist/cli/ink-cli/hooks/useGitBranch.js +35 -0
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.d.ts.map +1 -1
- package/dist/cli/ink-cli/hooks/useInputOrchestrator.js +47 -8
- package/dist/cli/ink-cli/services/processStream.d.ts.map +1 -1
- package/dist/cli/ink-cli/services/processStream.js +42 -10
- package/dist/cli/ink-cli/state/initialState.d.ts.map +1 -1
- package/dist/cli/ink-cli/state/initialState.js +2 -0
- package/dist/cli/ink-cli/state/types.d.ts +3 -1
- package/dist/cli/ink-cli/state/types.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/commandOverlays.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/commandOverlays.js +1 -0
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts +14 -1
- package/dist/cli/ink-cli/utils/messageFormatting.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/messageFormatting.js +66 -6
- package/dist/cli/ink-cli/utils/toolUtils.d.ts +11 -0
- package/dist/cli/ink-cli/utils/toolUtils.d.ts.map +1 -1
- package/dist/cli/ink-cli/utils/toolUtils.js +17 -0
- package/dist/cli/mcp/index.d.ts +8 -0
- package/dist/cli/mcp/index.d.ts.map +1 -0
- package/dist/cli/mcp/index.js +7 -0
- package/dist/cli/mcp/oauth-factory.d.ts +6 -0
- package/dist/cli/mcp/oauth-factory.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-factory.js +25 -0
- package/dist/cli/mcp/oauth-provider.d.ts +10 -0
- package/dist/cli/mcp/oauth-provider.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-provider.js +77 -0
- package/dist/cli/mcp/oauth-redirect.d.ts +3 -0
- package/dist/cli/mcp/oauth-redirect.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-redirect.js +4 -0
- package/dist/cli/mcp/oauth-server.d.ts +2 -0
- package/dist/cli/mcp/oauth-server.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-server.js +70 -0
- package/dist/cli/mcp/oauth-store.d.ts +10 -0
- package/dist/cli/mcp/oauth-store.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-store.js +27 -0
- package/dist/cli/mcp/oauth-ui.d.ts +2 -0
- package/dist/cli/mcp/oauth-ui.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-ui.js +12 -0
- package/dist/cli/mcp/oauth-utils.d.ts +2 -0
- package/dist/cli/mcp/oauth-utils.d.ts.map +1 -0
- package/dist/cli/mcp/oauth-utils.js +17 -0
- package/dist/cli/utils/api-key-verification.d.ts.map +1 -1
- package/dist/cli/utils/api-key-verification.js +36 -0
- package/dist/cli/utils/config-validation.d.ts +3 -1
- package/dist/cli/utils/config-validation.d.ts.map +1 -1
- package/dist/cli/utils/config-validation.js +42 -19
- package/dist/cli/utils/dexto-auth-check.d.ts +53 -0
- package/dist/cli/utils/dexto-auth-check.d.ts.map +1 -0
- package/dist/cli/utils/dexto-auth-check.js +104 -0
- package/dist/cli/utils/dexto-setup.d.ts +8 -0
- package/dist/cli/utils/dexto-setup.d.ts.map +1 -0
- package/dist/cli/utils/dexto-setup.js +17 -0
- package/dist/cli/utils/options.d.ts.map +1 -1
- package/dist/cli/utils/options.js +5 -1
- package/dist/cli/utils/provider-setup.d.ts +4 -0
- package/dist/cli/utils/provider-setup.d.ts.map +1 -1
- package/dist/cli/utils/provider-setup.js +20 -0
- package/dist/config/cli-overrides.d.ts +17 -8
- package/dist/config/cli-overrides.d.ts.map +1 -1
- package/dist/config/cli-overrides.js +36 -22
- package/dist/config/effective-llm.d.ts +123 -0
- package/dist/config/effective-llm.d.ts.map +1 -0
- package/dist/config/effective-llm.js +171 -0
- package/dist/index.js +395 -99
- package/dist/webui/assets/index-C9JXwpvo.css +1 -0
- package/dist/webui/assets/{index-DVQWNLpT.js → index-Dl3mj53P.js} +217 -217
- package/dist/webui/index.html +2 -2
- package/package.json +9 -8
- package/dist/webui/assets/index-BglIVTSG.css +0 -1
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin CLI Command Handlers
|
|
3
|
+
*
|
|
4
|
+
* Handles CLI commands for plugin management:
|
|
5
|
+
* - dexto plugin list
|
|
6
|
+
* - dexto plugin install --path <path>
|
|
7
|
+
* - dexto plugin uninstall <name>
|
|
8
|
+
* - dexto plugin validate [path]
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
import { listInstalledPlugins, installPluginFromPath, uninstallPlugin, validatePluginDirectory,
|
|
13
|
+
// Marketplace
|
|
14
|
+
addMarketplace, removeMarketplace, updateMarketplace, listMarketplaces, listAllMarketplacePlugins, installPluginFromMarketplace, } from '@dexto/agent-management';
|
|
15
|
+
// === Schema Definitions ===
|
|
16
|
+
const PluginListCommandSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
verbose: z.boolean().default(false).describe('Show detailed plugin information'),
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
21
|
+
const PluginInstallCommandSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
path: z.string().min(1).describe('Path to the plugin directory'),
|
|
24
|
+
scope: z.enum(['user', 'project', 'local']).default('user').describe('Installation scope'),
|
|
25
|
+
force: z.boolean().default(false).describe('Force overwrite if already installed'),
|
|
26
|
+
})
|
|
27
|
+
.strict();
|
|
28
|
+
const PluginUninstallCommandSchema = z
|
|
29
|
+
.object({
|
|
30
|
+
name: z.string().min(1).describe('Name of the plugin to uninstall'),
|
|
31
|
+
})
|
|
32
|
+
.strict();
|
|
33
|
+
const PluginValidateCommandSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
path: z.string().default('.').describe('Path to the plugin directory to validate'),
|
|
36
|
+
})
|
|
37
|
+
.strict();
|
|
38
|
+
// === Marketplace Command Schemas ===
|
|
39
|
+
const MarketplaceAddCommandSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
source: z
|
|
42
|
+
.string()
|
|
43
|
+
.min(1)
|
|
44
|
+
.describe('Marketplace source (owner/repo, git URL, or local path)'),
|
|
45
|
+
name: z.string().optional().describe('Custom name for the marketplace'),
|
|
46
|
+
})
|
|
47
|
+
.strict();
|
|
48
|
+
const MarketplaceRemoveCommandSchema = z
|
|
49
|
+
.object({
|
|
50
|
+
name: z.string().min(1).describe('Name of the marketplace to remove'),
|
|
51
|
+
})
|
|
52
|
+
.strict();
|
|
53
|
+
const MarketplaceUpdateCommandSchema = z
|
|
54
|
+
.object({
|
|
55
|
+
name: z.string().optional().describe('Name of the marketplace to update (all if omitted)'),
|
|
56
|
+
})
|
|
57
|
+
.strict();
|
|
58
|
+
const MarketplaceListCommandSchema = z
|
|
59
|
+
.object({
|
|
60
|
+
verbose: z.boolean().default(false).describe('Show detailed marketplace information'),
|
|
61
|
+
})
|
|
62
|
+
.strict();
|
|
63
|
+
const MarketplaceInstallCommandSchema = z
|
|
64
|
+
.object({
|
|
65
|
+
plugin: z.string().min(1).describe('Plugin spec: name or name@marketplace'),
|
|
66
|
+
scope: z.enum(['user', 'project', 'local']).default('user').describe('Installation scope'),
|
|
67
|
+
force: z.boolean().default(false).describe('Force reinstall if already exists'),
|
|
68
|
+
})
|
|
69
|
+
.strict();
|
|
70
|
+
// === Command Handlers ===
|
|
71
|
+
/**
|
|
72
|
+
* Handles the `dexto plugin list` command.
|
|
73
|
+
* Lists all installed plugins managed by Dexto.
|
|
74
|
+
*/
|
|
75
|
+
export async function handlePluginListCommand(options) {
|
|
76
|
+
const validated = PluginListCommandSchema.parse(options);
|
|
77
|
+
const plugins = listInstalledPlugins();
|
|
78
|
+
if (plugins.length === 0) {
|
|
79
|
+
console.log(chalk.yellow('No plugins installed.'));
|
|
80
|
+
console.log('');
|
|
81
|
+
console.log('Install a plugin with:');
|
|
82
|
+
console.log(chalk.cyan(' dexto plugin install --path <path-to-plugin>'));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
console.log(chalk.bold(`Installed Plugins (${plugins.length}):`));
|
|
86
|
+
console.log('');
|
|
87
|
+
for (const plugin of plugins) {
|
|
88
|
+
const sourceLabel = getSourceLabel(plugin.source);
|
|
89
|
+
const scopeLabel = plugin.scope ? ` [${plugin.scope}]` : '';
|
|
90
|
+
console.log(` ${chalk.green(plugin.name)}${chalk.dim('@' + (plugin.version || 'unknown'))} ${sourceLabel}${scopeLabel}`);
|
|
91
|
+
if (validated.verbose) {
|
|
92
|
+
if (plugin.description) {
|
|
93
|
+
console.log(chalk.dim(` ${plugin.description}`));
|
|
94
|
+
}
|
|
95
|
+
console.log(chalk.dim(` Path: ${plugin.path}`));
|
|
96
|
+
if (plugin.installedAt) {
|
|
97
|
+
const date = new Date(plugin.installedAt).toLocaleDateString();
|
|
98
|
+
console.log(chalk.dim(` Installed: ${date}`));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
console.log('');
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Handles the `dexto plugin install --path <path>` command.
|
|
106
|
+
* Installs a plugin from a local directory.
|
|
107
|
+
*/
|
|
108
|
+
export async function handlePluginInstallCommand(options) {
|
|
109
|
+
const validated = PluginInstallCommandSchema.parse(options);
|
|
110
|
+
console.log(chalk.cyan(`Installing plugin from ${validated.path}...`));
|
|
111
|
+
console.log('');
|
|
112
|
+
const result = await installPluginFromPath(validated.path, {
|
|
113
|
+
scope: validated.scope,
|
|
114
|
+
force: validated.force,
|
|
115
|
+
});
|
|
116
|
+
// Show warnings
|
|
117
|
+
if (result.warnings.length > 0) {
|
|
118
|
+
console.log(chalk.yellow('Warnings:'));
|
|
119
|
+
for (const warning of result.warnings) {
|
|
120
|
+
console.log(chalk.yellow(` - ${warning}`));
|
|
121
|
+
}
|
|
122
|
+
console.log('');
|
|
123
|
+
}
|
|
124
|
+
console.log(chalk.green(`Successfully installed plugin '${result.pluginName}'`));
|
|
125
|
+
console.log(chalk.dim(` Path: ${result.installPath}`));
|
|
126
|
+
console.log('');
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Handles the `dexto plugin uninstall <name>` command.
|
|
130
|
+
* Uninstalls a plugin by name.
|
|
131
|
+
*/
|
|
132
|
+
export async function handlePluginUninstallCommand(options) {
|
|
133
|
+
const validated = PluginUninstallCommandSchema.parse(options);
|
|
134
|
+
console.log(chalk.cyan(`Uninstalling plugin '${validated.name}'...`));
|
|
135
|
+
const result = await uninstallPlugin(validated.name);
|
|
136
|
+
console.log(chalk.green(`Successfully uninstalled plugin '${validated.name}'`));
|
|
137
|
+
if (result.removedPath) {
|
|
138
|
+
console.log(chalk.dim(` Removed: ${result.removedPath}`));
|
|
139
|
+
}
|
|
140
|
+
console.log('');
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Handles the `dexto plugin validate [path]` command.
|
|
144
|
+
* Validates a plugin directory structure and manifest.
|
|
145
|
+
*/
|
|
146
|
+
export async function handlePluginValidateCommand(options) {
|
|
147
|
+
const validated = PluginValidateCommandSchema.parse(options);
|
|
148
|
+
console.log(chalk.cyan(`Validating plugin at ${validated.path}...`));
|
|
149
|
+
console.log('');
|
|
150
|
+
const result = validatePluginDirectory(validated.path);
|
|
151
|
+
if (result.valid) {
|
|
152
|
+
console.log(chalk.green('Plugin is valid!'));
|
|
153
|
+
console.log('');
|
|
154
|
+
if (result.manifest) {
|
|
155
|
+
console.log(chalk.bold('Manifest:'));
|
|
156
|
+
console.log(` Name: ${chalk.green(result.manifest.name)}`);
|
|
157
|
+
if (result.manifest.description) {
|
|
158
|
+
console.log(` Description: ${result.manifest.description}`);
|
|
159
|
+
}
|
|
160
|
+
if (result.manifest.version) {
|
|
161
|
+
console.log(` Version: ${result.manifest.version}`);
|
|
162
|
+
}
|
|
163
|
+
console.log('');
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
console.log(chalk.red('Plugin validation failed!'));
|
|
168
|
+
console.log('');
|
|
169
|
+
}
|
|
170
|
+
// Show errors
|
|
171
|
+
if (result.errors.length > 0) {
|
|
172
|
+
console.log(chalk.red('Errors:'));
|
|
173
|
+
for (const error of result.errors) {
|
|
174
|
+
console.log(chalk.red(` - ${error}`));
|
|
175
|
+
}
|
|
176
|
+
console.log('');
|
|
177
|
+
}
|
|
178
|
+
// Show warnings
|
|
179
|
+
if (result.warnings.length > 0) {
|
|
180
|
+
console.log(chalk.yellow('Warnings:'));
|
|
181
|
+
for (const warning of result.warnings) {
|
|
182
|
+
console.log(chalk.yellow(` - ${warning}`));
|
|
183
|
+
}
|
|
184
|
+
console.log('');
|
|
185
|
+
}
|
|
186
|
+
// Exit with error code if invalid
|
|
187
|
+
if (!result.valid) {
|
|
188
|
+
const errorDetails = result.errors.length > 0 ? `: ${result.errors.join(', ')}` : '';
|
|
189
|
+
throw new Error(`Plugin validation failed${errorDetails}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// === Marketplace Command Handlers ===
|
|
193
|
+
/**
|
|
194
|
+
* Handles the `dexto plugin marketplace add <source>` command.
|
|
195
|
+
* Adds a new marketplace from GitHub, git URL, or local path.
|
|
196
|
+
*/
|
|
197
|
+
export async function handleMarketplaceAddCommand(options) {
|
|
198
|
+
const validated = MarketplaceAddCommandSchema.parse(options);
|
|
199
|
+
console.log(chalk.cyan(`Adding marketplace from ${validated.source}...`));
|
|
200
|
+
console.log('');
|
|
201
|
+
const result = await addMarketplace(validated.source, {
|
|
202
|
+
name: validated.name,
|
|
203
|
+
});
|
|
204
|
+
// Show warnings
|
|
205
|
+
if (result.warnings.length > 0) {
|
|
206
|
+
console.log(chalk.yellow('Warnings:'));
|
|
207
|
+
for (const warning of result.warnings) {
|
|
208
|
+
console.log(chalk.yellow(` - ${warning}`));
|
|
209
|
+
}
|
|
210
|
+
console.log('');
|
|
211
|
+
}
|
|
212
|
+
console.log(chalk.green(`Successfully added marketplace '${result.name}'`));
|
|
213
|
+
console.log(chalk.dim(` Plugins found: ${result.pluginCount}`));
|
|
214
|
+
console.log('');
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Handles the `dexto plugin marketplace remove <name>` command.
|
|
218
|
+
* Removes a registered marketplace.
|
|
219
|
+
*/
|
|
220
|
+
export async function handleMarketplaceRemoveCommand(options) {
|
|
221
|
+
const validated = MarketplaceRemoveCommandSchema.parse(options);
|
|
222
|
+
console.log(chalk.cyan(`Removing marketplace '${validated.name}'...`));
|
|
223
|
+
await removeMarketplace(validated.name);
|
|
224
|
+
console.log(chalk.green(`Successfully removed marketplace '${validated.name}'`));
|
|
225
|
+
console.log('');
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Handles the `dexto plugin marketplace update [name]` command.
|
|
229
|
+
* Updates marketplace(s) by pulling latest from git.
|
|
230
|
+
*/
|
|
231
|
+
export async function handleMarketplaceUpdateCommand(options) {
|
|
232
|
+
const validated = MarketplaceUpdateCommandSchema.parse(options);
|
|
233
|
+
if (validated.name) {
|
|
234
|
+
console.log(chalk.cyan(`Updating marketplace '${validated.name}'...`));
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
console.log(chalk.cyan('Updating all marketplaces...'));
|
|
238
|
+
}
|
|
239
|
+
console.log('');
|
|
240
|
+
const results = await updateMarketplace(validated.name);
|
|
241
|
+
for (const result of results) {
|
|
242
|
+
if (result.hasChanges) {
|
|
243
|
+
console.log(chalk.green(`✓ ${result.name}: Updated`));
|
|
244
|
+
if (result.previousSha && result.newSha) {
|
|
245
|
+
console.log(chalk.dim(` ${result.previousSha.substring(0, 8)} → ${result.newSha.substring(0, 8)}`));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
console.log(chalk.dim(`○ ${result.name}: Already up to date`));
|
|
250
|
+
}
|
|
251
|
+
// Show warnings
|
|
252
|
+
if (result.warnings.length > 0) {
|
|
253
|
+
for (const warning of result.warnings) {
|
|
254
|
+
console.log(chalk.yellow(` - ${warning}`));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
console.log('');
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Handles the `dexto plugin marketplace list` command.
|
|
262
|
+
* Lists all registered marketplaces.
|
|
263
|
+
*/
|
|
264
|
+
export async function handleMarketplaceListCommand(options) {
|
|
265
|
+
const validated = MarketplaceListCommandSchema.parse(options);
|
|
266
|
+
const marketplaces = listMarketplaces();
|
|
267
|
+
if (marketplaces.length === 0) {
|
|
268
|
+
console.log(chalk.yellow('No marketplaces registered.'));
|
|
269
|
+
console.log('');
|
|
270
|
+
console.log('Add a marketplace with:');
|
|
271
|
+
console.log(chalk.cyan(' dexto plugin marketplace add <owner/repo>'));
|
|
272
|
+
console.log('');
|
|
273
|
+
console.log('Examples:');
|
|
274
|
+
console.log(chalk.dim(' dexto plugin marketplace add anthropics/claude-plugins-official'));
|
|
275
|
+
console.log(chalk.dim(' dexto plugin marketplace add https://github.com/user/plugins.git'));
|
|
276
|
+
console.log(chalk.dim(' dexto plugin marketplace add ~/my-local-plugins'));
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
console.log(chalk.bold(`Registered Marketplaces (${marketplaces.length}):`));
|
|
280
|
+
console.log('');
|
|
281
|
+
for (const marketplace of marketplaces) {
|
|
282
|
+
const sourceType = chalk.dim(`[${marketplace.source.type}]`);
|
|
283
|
+
console.log(` ${chalk.green(marketplace.name)} ${sourceType}`);
|
|
284
|
+
if (validated.verbose) {
|
|
285
|
+
console.log(chalk.dim(` Source: ${marketplace.source.value}`));
|
|
286
|
+
console.log(chalk.dim(` Path: ${marketplace.installLocation}`));
|
|
287
|
+
if (marketplace.lastUpdated) {
|
|
288
|
+
const date = new Date(marketplace.lastUpdated).toLocaleDateString();
|
|
289
|
+
console.log(chalk.dim(` Updated: ${date}`));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
console.log('');
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Handles the `dexto plugin marketplace plugins [name]` command.
|
|
297
|
+
* Lists plugins available in marketplaces.
|
|
298
|
+
*/
|
|
299
|
+
export async function handleMarketplacePluginsCommand(options) {
|
|
300
|
+
const plugins = listAllMarketplacePlugins();
|
|
301
|
+
// Filter by marketplace if specified
|
|
302
|
+
const filtered = options.marketplace
|
|
303
|
+
? plugins.filter((plugin) => plugin.marketplace.toLowerCase() === options.marketplace?.toLowerCase())
|
|
304
|
+
: plugins;
|
|
305
|
+
if (filtered.length === 0) {
|
|
306
|
+
if (options.marketplace) {
|
|
307
|
+
console.log(chalk.yellow(`No plugins found in marketplace '${options.marketplace}'.`));
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
console.log(chalk.yellow('No plugins found in any marketplace.'));
|
|
311
|
+
console.log('');
|
|
312
|
+
console.log('Make sure you have marketplaces registered:');
|
|
313
|
+
console.log(chalk.cyan(' dexto plugin marketplace list'));
|
|
314
|
+
}
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
console.log(chalk.bold(`Available Plugins (${filtered.length}):`));
|
|
318
|
+
console.log('');
|
|
319
|
+
// Group by marketplace
|
|
320
|
+
const byMarketplace = new Map();
|
|
321
|
+
for (const plugin of filtered) {
|
|
322
|
+
const list = byMarketplace.get(plugin.marketplace) || [];
|
|
323
|
+
list.push(plugin);
|
|
324
|
+
byMarketplace.set(plugin.marketplace, list);
|
|
325
|
+
}
|
|
326
|
+
for (const [marketplace, marketplacePlugins] of byMarketplace) {
|
|
327
|
+
console.log(chalk.cyan(` ${marketplace}:`));
|
|
328
|
+
for (const plugin of marketplacePlugins) {
|
|
329
|
+
const version = plugin.version ? chalk.dim(`@${plugin.version}`) : '';
|
|
330
|
+
const category = plugin.category ? chalk.dim(` [${plugin.category}]`) : '';
|
|
331
|
+
console.log(` ${chalk.green(plugin.name)}${version}${category}`);
|
|
332
|
+
if (options.verbose && plugin.description) {
|
|
333
|
+
console.log(chalk.dim(` ${plugin.description}`));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
console.log('');
|
|
337
|
+
}
|
|
338
|
+
console.log('Install a plugin with:');
|
|
339
|
+
console.log(chalk.cyan(' dexto plugin marketplace install <name>@<marketplace>'));
|
|
340
|
+
console.log('');
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Handles the `dexto plugin marketplace install <plugin>` command.
|
|
344
|
+
* Installs a plugin from a registered marketplace.
|
|
345
|
+
*/
|
|
346
|
+
export async function handleMarketplaceInstallCommand(options) {
|
|
347
|
+
const validated = MarketplaceInstallCommandSchema.parse(options);
|
|
348
|
+
console.log(chalk.cyan(`Installing plugin '${validated.plugin}' from marketplace...`));
|
|
349
|
+
console.log('');
|
|
350
|
+
const result = await installPluginFromMarketplace(validated.plugin, {
|
|
351
|
+
scope: validated.scope,
|
|
352
|
+
force: validated.force,
|
|
353
|
+
});
|
|
354
|
+
// Show warnings
|
|
355
|
+
if (result.warnings.length > 0) {
|
|
356
|
+
console.log(chalk.yellow('Warnings:'));
|
|
357
|
+
for (const warning of result.warnings) {
|
|
358
|
+
console.log(chalk.yellow(` - ${warning}`));
|
|
359
|
+
}
|
|
360
|
+
console.log('');
|
|
361
|
+
}
|
|
362
|
+
console.log(chalk.green(`Successfully installed plugin '${result.pluginName}'`));
|
|
363
|
+
console.log(chalk.dim(` Marketplace: ${result.marketplace}`));
|
|
364
|
+
console.log(chalk.dim(` Path: ${result.installPath}`));
|
|
365
|
+
if (result.gitCommitSha) {
|
|
366
|
+
console.log(chalk.dim(` Version: ${result.gitCommitSha.substring(0, 8)}`));
|
|
367
|
+
}
|
|
368
|
+
console.log('');
|
|
369
|
+
}
|
|
370
|
+
// === Helper Functions ===
|
|
371
|
+
/**
|
|
372
|
+
* Gets a display label for the plugin source.
|
|
373
|
+
*/
|
|
374
|
+
function getSourceLabel(_source) {
|
|
375
|
+
return chalk.blue('(dexto)');
|
|
376
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
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", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>>;
|
|
3
|
+
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "minimax", "glm", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama", "dexto"]>>;
|
|
4
4
|
model: z.ZodOptional<z.ZodString>;
|
|
5
5
|
defaultAgent: z.ZodDefault<z.ZodString>;
|
|
6
6
|
interactive: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -8,31 +8,31 @@ declare const SetupCommandSchema: z.ZodEffects<z.ZodObject<{
|
|
|
8
8
|
quickStart: z.ZodDefault<z.ZodBoolean>;
|
|
9
9
|
}, "strict", z.ZodTypeAny, {
|
|
10
10
|
interactive: boolean;
|
|
11
|
-
defaultAgent: string;
|
|
12
11
|
force: boolean;
|
|
12
|
+
defaultAgent: string;
|
|
13
13
|
quickStart: boolean;
|
|
14
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
14
|
+
provider?: "dexto" | "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
15
15
|
model?: string | undefined;
|
|
16
16
|
}, {
|
|
17
17
|
interactive?: boolean | undefined;
|
|
18
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
18
|
+
provider?: "dexto" | "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
19
19
|
model?: string | undefined;
|
|
20
|
-
defaultAgent?: string | undefined;
|
|
21
20
|
force?: boolean | undefined;
|
|
21
|
+
defaultAgent?: string | undefined;
|
|
22
22
|
quickStart?: boolean | undefined;
|
|
23
23
|
}>, {
|
|
24
24
|
interactive: boolean;
|
|
25
|
-
defaultAgent: string;
|
|
26
25
|
force: boolean;
|
|
26
|
+
defaultAgent: string;
|
|
27
27
|
quickStart: boolean;
|
|
28
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
28
|
+
provider?: "dexto" | "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
29
29
|
model?: string | undefined;
|
|
30
30
|
}, {
|
|
31
31
|
interactive?: boolean | undefined;
|
|
32
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
32
|
+
provider?: "dexto" | "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
33
33
|
model?: string | undefined;
|
|
34
|
-
defaultAgent?: string | undefined;
|
|
35
34
|
force?: boolean | undefined;
|
|
35
|
+
defaultAgent?: string | undefined;
|
|
36
36
|
quickStart?: boolean | undefined;
|
|
37
37
|
}>;
|
|
38
38
|
export type CLISetupOptions = z.output<typeof SetupCommandSchema>;
|
|
@@ -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;AA8CxB,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"}
|