@claude-flow/cli 3.0.0-alpha.2 → 3.0.0-alpha.21
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 +172 -6
- package/bin/cli.js +0 -0
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +43 -27
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.d.ts +19 -0
- package/dist/src/commands/analyze.d.ts.map +1 -0
- package/dist/src/commands/analyze.js +1823 -0
- package/dist/src/commands/analyze.js.map +1 -0
- package/dist/src/commands/claims.d.ts +10 -0
- package/dist/src/commands/claims.d.ts.map +1 -0
- package/dist/src/commands/claims.js +288 -0
- package/dist/src/commands/claims.js.map +1 -0
- package/dist/src/commands/completions.d.ts +10 -0
- package/dist/src/commands/completions.d.ts.map +1 -0
- package/dist/src/commands/completions.js +539 -0
- package/dist/src/commands/completions.js.map +1 -0
- package/dist/src/commands/config.js +2 -2
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.d.ts +8 -0
- package/dist/src/commands/daemon.d.ts.map +1 -0
- package/dist/src/commands/daemon.js +545 -0
- package/dist/src/commands/daemon.js.map +1 -0
- package/dist/src/commands/deployment.d.ts +10 -0
- package/dist/src/commands/deployment.d.ts.map +1 -0
- package/dist/src/commands/deployment.js +289 -0
- package/dist/src/commands/deployment.js.map +1 -0
- package/dist/src/commands/doctor.d.ts +10 -0
- package/dist/src/commands/doctor.d.ts.map +1 -0
- package/dist/src/commands/doctor.js +429 -0
- package/dist/src/commands/doctor.js.map +1 -0
- package/dist/src/commands/embeddings.d.ts +18 -0
- package/dist/src/commands/embeddings.d.ts.map +1 -0
- package/dist/src/commands/embeddings.js +616 -0
- package/dist/src/commands/embeddings.js.map +1 -0
- package/dist/src/commands/hive-mind.d.ts.map +1 -1
- package/dist/src/commands/hive-mind.js +252 -35
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +326 -2
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +13 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +52 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/mcp.js +4 -4
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +236 -170
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +1 -1
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.d.ts +10 -0
- package/dist/src/commands/neural.d.ts.map +1 -0
- package/dist/src/commands/neural.js +224 -0
- package/dist/src/commands/neural.js.map +1 -0
- package/dist/src/commands/performance.d.ts +10 -0
- package/dist/src/commands/performance.d.ts.map +1 -0
- package/dist/src/commands/performance.js +262 -0
- package/dist/src/commands/performance.js.map +1 -0
- package/dist/src/commands/plugins.d.ts +10 -0
- package/dist/src/commands/plugins.d.ts.map +1 -0
- package/dist/src/commands/plugins.js +280 -0
- package/dist/src/commands/plugins.js.map +1 -0
- package/dist/src/commands/process.d.ts.map +1 -1
- package/dist/src/commands/process.js +95 -20
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/providers.d.ts +10 -0
- package/dist/src/commands/providers.d.ts.map +1 -0
- package/dist/src/commands/providers.js +232 -0
- package/dist/src/commands/providers.js.map +1 -0
- package/dist/src/commands/route.d.ts +16 -0
- package/dist/src/commands/route.d.ts.map +1 -0
- package/dist/src/commands/route.js +603 -0
- package/dist/src/commands/route.js.map +1 -0
- package/dist/src/commands/security.d.ts +10 -0
- package/dist/src/commands/security.d.ts.map +1 -0
- package/dist/src/commands/security.js +261 -0
- package/dist/src/commands/security.js.map +1 -0
- package/dist/src/commands/start.js +2 -2
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +26 -2
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +6 -6
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +63 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +218 -362
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +5 -0
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +22 -12
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +17 -1
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +5 -0
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +350 -14
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
- package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/analyze-tools.js +317 -0
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -0
- package/dist/src/mcp-tools/config-tools.d.ts +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +262 -15
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/hive-mind-tools.js +447 -0
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +80 -15
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +6 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +6 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +157 -9
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.d.ts +8 -0
- package/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/session-tools.js +315 -0
- package/dist/src/mcp-tools/session-tools.js.map +1 -0
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +37 -2
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts +8 -0
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/task-tools.js +302 -0
- package/dist/src/mcp-tools/task-tools.js.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.js +481 -0
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -0
- package/dist/src/output.d.ts +16 -0
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +42 -0
- package/dist/src/output.js.map +1 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
- package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +277 -0
- package/dist/src/ruvector/ast-analyzer.js.map +1 -0
- package/dist/src/ruvector/coverage-router.d.ts +145 -0
- package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-router.js +451 -0
- package/dist/src/ruvector/coverage-router.js.map +1 -0
- package/dist/src/ruvector/coverage-tools.d.ts +33 -0
- package/dist/src/ruvector/coverage-tools.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-tools.js +157 -0
- package/dist/src/ruvector/coverage-tools.js.map +1 -0
- package/dist/src/ruvector/diff-classifier.d.ts +175 -0
- package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
- package/dist/src/ruvector/diff-classifier.js +662 -0
- package/dist/src/ruvector/diff-classifier.js.map +1 -0
- package/dist/src/ruvector/graph-analyzer.d.ts +174 -0
- package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/graph-analyzer.js +878 -0
- package/dist/src/ruvector/graph-analyzer.js.map +1 -0
- package/dist/src/ruvector/index.d.ts +27 -0
- package/dist/src/ruvector/index.d.ts.map +1 -0
- package/dist/src/ruvector/index.js +49 -0
- package/dist/src/ruvector/index.js.map +1 -0
- package/dist/src/ruvector/q-learning-router.d.ts +211 -0
- package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/src/ruvector/q-learning-router.js +681 -0
- package/dist/src/ruvector/q-learning-router.js.map +1 -0
- package/dist/src/ruvector/vector-db.d.ts +69 -0
- package/dist/src/ruvector/vector-db.d.ts.map +1 -0
- package/dist/src/ruvector/vector-db.js +243 -0
- package/dist/src/ruvector/vector-db.js.map +1 -0
- package/dist/src/services/index.d.ts +7 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/index.js +6 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/services/worker-daemon.d.ts +153 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +567 -0
- package/dist/src/services/worker-daemon.js.map +1 -0
- package/dist/src/suggest.d.ts +53 -0
- package/dist/src/suggest.d.ts.map +1 -0
- package/dist/src/suggest.js +200 -0
- package/dist/src/suggest.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -6
- package/.agentic-flow/intelligence.json +0 -16
- package/.claude-flow/metrics/agent-metrics.json +0 -1
- package/.claude-flow/metrics/performance.json +0 -87
- package/.claude-flow/metrics/task-metrics.json +0 -10
- package/__tests__/README.md +0 -140
- package/__tests__/TEST_SUMMARY.md +0 -144
- package/__tests__/cli.test.ts +0 -558
- package/__tests__/commands.test.ts +0 -726
- package/__tests__/config-adapter.test.ts +0 -362
- package/__tests__/config-loading.test.ts +0 -106
- package/__tests__/coverage/.tmp/coverage-0.json +0 -1
- package/__tests__/coverage/.tmp/coverage-1.json +0 -1
- package/__tests__/coverage/.tmp/coverage-2.json +0 -1
- package/__tests__/coverage/.tmp/coverage-3.json +0 -1
- package/__tests__/coverage/.tmp/coverage-4.json +0 -1
- package/__tests__/coverage/.tmp/coverage-5.json +0 -1
- package/__tests__/mcp-client.test.ts +0 -480
- package/__tests__/p1-commands.test.ts +0 -1064
- package/docs/CONFIG_LOADING.md +0 -236
- package/docs/IMPLEMENTATION_COMPLETE.md +0 -421
- package/docs/MCP_CLIENT_GUIDE.md +0 -620
- package/docs/REFACTORING_SUMMARY.md +0 -247
- package/src/commands/agent.ts +0 -941
- package/src/commands/config.ts +0 -452
- package/src/commands/hive-mind.ts +0 -762
- package/src/commands/hooks.ts +0 -2603
- package/src/commands/index.ts +0 -115
- package/src/commands/init.ts +0 -597
- package/src/commands/mcp.ts +0 -753
- package/src/commands/memory.ts +0 -1063
- package/src/commands/migrate.ts +0 -447
- package/src/commands/process.ts +0 -617
- package/src/commands/session.ts +0 -891
- package/src/commands/start.ts +0 -457
- package/src/commands/status.ts +0 -705
- package/src/commands/swarm.ts +0 -648
- package/src/commands/task.ts +0 -792
- package/src/commands/workflow.ts +0 -742
- package/src/config-adapter.ts +0 -210
- package/src/index.ts +0 -383
- package/src/infrastructure/in-memory-repositories.ts +0 -310
- package/src/init/claudemd-generator.ts +0 -631
- package/src/init/executor.ts +0 -756
- package/src/init/helpers-generator.ts +0 -628
- package/src/init/index.ts +0 -60
- package/src/init/mcp-generator.ts +0 -83
- package/src/init/settings-generator.ts +0 -274
- package/src/init/statusline-generator.ts +0 -211
- package/src/init/types.ts +0 -447
- package/src/mcp-client.ts +0 -227
- package/src/mcp-server.ts +0 -571
- package/src/mcp-tools/agent-tools.ts +0 -92
- package/src/mcp-tools/config-tools.ts +0 -88
- package/src/mcp-tools/hooks-tools.ts +0 -1819
- package/src/mcp-tools/index.ts +0 -12
- package/src/mcp-tools/memory-tools.ts +0 -89
- package/src/mcp-tools/swarm-tools.ts +0 -69
- package/src/mcp-tools/types.ts +0 -33
- package/src/output.ts +0 -593
- package/src/parser.ts +0 -417
- package/src/prompt.ts +0 -619
- package/src/types.ts +0 -287
- package/tmp.json +0 -0
- package/tsconfig.json +0 -16
- package/tsconfig.tsbuildinfo +0 -1
- package/vitest.config.ts +0 -13
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI Route Command
|
|
3
|
+
* Intelligent task-to-agent routing using Q-Learning
|
|
4
|
+
*
|
|
5
|
+
* Features:
|
|
6
|
+
* - Q-Learning based agent selection
|
|
7
|
+
* - Semantic task understanding
|
|
8
|
+
* - Confidence scoring
|
|
9
|
+
* - Learning from feedback
|
|
10
|
+
*
|
|
11
|
+
* Created with love by ruv.io
|
|
12
|
+
*/
|
|
13
|
+
import { output } from '../output.js';
|
|
14
|
+
import { createQLearningRouter, isRuvectorAvailable, } from '../ruvector/index.js';
|
|
15
|
+
/**
|
|
16
|
+
* Available agent types for routing
|
|
17
|
+
*/
|
|
18
|
+
const AGENT_TYPES = [
|
|
19
|
+
{ id: 'coder', name: 'Coder', description: 'Implements features and writes code', capabilities: ['coding', 'implementation', 'refactoring'], priority: 1 },
|
|
20
|
+
{ id: 'tester', name: 'Tester', description: 'Creates tests and validates functionality', capabilities: ['testing', 'validation', 'quality'], priority: 2 },
|
|
21
|
+
{ id: 'reviewer', name: 'Reviewer', description: 'Reviews code quality and security', capabilities: ['review', 'security', 'best-practices'], priority: 3 },
|
|
22
|
+
{ id: 'architect', name: 'Architect', description: 'Designs system architecture', capabilities: ['design', 'architecture', 'planning'], priority: 4 },
|
|
23
|
+
{ id: 'researcher', name: 'Researcher', description: 'Researches requirements and patterns', capabilities: ['research', 'analysis', 'documentation'], priority: 5 },
|
|
24
|
+
{ id: 'optimizer', name: 'Optimizer', description: 'Optimizes performance and efficiency', capabilities: ['optimization', 'performance', 'profiling'], priority: 6 },
|
|
25
|
+
{ id: 'debugger', name: 'Debugger', description: 'Debugs issues and fixes bugs', capabilities: ['debugging', 'troubleshooting', 'fixing'], priority: 7 },
|
|
26
|
+
{ id: 'documenter', name: 'Documenter', description: 'Creates and updates documentation', capabilities: ['documentation', 'writing', 'explaining'], priority: 8 },
|
|
27
|
+
];
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Router Singleton
|
|
30
|
+
// ============================================================================
|
|
31
|
+
let routerInstance = null;
|
|
32
|
+
let routerInitialized = false;
|
|
33
|
+
/**
|
|
34
|
+
* Get or create the router instance
|
|
35
|
+
*/
|
|
36
|
+
async function getRouter() {
|
|
37
|
+
if (!routerInstance) {
|
|
38
|
+
routerInstance = createQLearningRouter();
|
|
39
|
+
}
|
|
40
|
+
if (!routerInitialized) {
|
|
41
|
+
await routerInstance.initialize();
|
|
42
|
+
routerInitialized = true;
|
|
43
|
+
}
|
|
44
|
+
return routerInstance;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get agent type by route name
|
|
48
|
+
*/
|
|
49
|
+
function getAgentType(route) {
|
|
50
|
+
return AGENT_TYPES.find(a => a.id === route);
|
|
51
|
+
}
|
|
52
|
+
// ============================================================================
|
|
53
|
+
// Route Subcommand
|
|
54
|
+
// ============================================================================
|
|
55
|
+
const routeTaskCommand = {
|
|
56
|
+
name: 'task',
|
|
57
|
+
description: 'Route a task to the optimal agent using Q-Learning',
|
|
58
|
+
options: [
|
|
59
|
+
{
|
|
60
|
+
name: 'q-learning',
|
|
61
|
+
short: 'q',
|
|
62
|
+
description: 'Use Q-Learning for agent selection (default: true)',
|
|
63
|
+
type: 'boolean',
|
|
64
|
+
default: true,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'agent',
|
|
68
|
+
short: 'a',
|
|
69
|
+
description: 'Force specific agent (bypasses Q-Learning)',
|
|
70
|
+
type: 'string',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'explore',
|
|
74
|
+
short: 'e',
|
|
75
|
+
description: 'Enable exploration (random selection chance)',
|
|
76
|
+
type: 'boolean',
|
|
77
|
+
default: true,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'json',
|
|
81
|
+
short: 'j',
|
|
82
|
+
description: 'Output in JSON format',
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
default: false,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
examples: [
|
|
88
|
+
{ command: 'claude-flow route task "implement authentication"', description: 'Route task to best agent' },
|
|
89
|
+
{ command: 'claude-flow route task "write unit tests" --q-learning', description: 'Use Q-Learning routing' },
|
|
90
|
+
{ command: 'claude-flow route task "review code" --agent reviewer', description: 'Force specific agent' },
|
|
91
|
+
],
|
|
92
|
+
action: async (ctx) => {
|
|
93
|
+
const taskDescription = ctx.args[0];
|
|
94
|
+
const forceAgent = ctx.flags.agent;
|
|
95
|
+
const useExploration = ctx.flags.explore;
|
|
96
|
+
const jsonOutput = ctx.flags.json;
|
|
97
|
+
if (!taskDescription) {
|
|
98
|
+
output.printError('Task description is required');
|
|
99
|
+
output.writeln(output.dim('Usage: claude-flow route task "task description"'));
|
|
100
|
+
return { success: false, exitCode: 1 };
|
|
101
|
+
}
|
|
102
|
+
const spinner = output.createSpinner({ text: 'Analyzing task...', spinner: 'dots' });
|
|
103
|
+
spinner.start();
|
|
104
|
+
try {
|
|
105
|
+
if (forceAgent) {
|
|
106
|
+
// Bypass Q-Learning, use specified agent
|
|
107
|
+
const agent = getAgentType(forceAgent) ||
|
|
108
|
+
AGENT_TYPES.find(a => a.name.toLowerCase() === forceAgent.toLowerCase());
|
|
109
|
+
if (!agent) {
|
|
110
|
+
spinner.fail(`Agent "${forceAgent}" not found`);
|
|
111
|
+
output.writeln();
|
|
112
|
+
output.writeln('Available agents:');
|
|
113
|
+
output.printList(AGENT_TYPES.map(a => `${output.highlight(a.id)} - ${a.description}`));
|
|
114
|
+
return { success: false, exitCode: 1 };
|
|
115
|
+
}
|
|
116
|
+
spinner.succeed(`Routed to ${agent.name}`);
|
|
117
|
+
if (jsonOutput) {
|
|
118
|
+
output.printJson({
|
|
119
|
+
task: taskDescription,
|
|
120
|
+
agentId: agent.id,
|
|
121
|
+
agentName: agent.name,
|
|
122
|
+
confidence: 1.0,
|
|
123
|
+
method: 'forced',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
output.writeln();
|
|
128
|
+
output.printBox([
|
|
129
|
+
`Task: ${taskDescription}`,
|
|
130
|
+
`Agent: ${output.highlight(agent.name)} (${agent.id})`,
|
|
131
|
+
`Confidence: ${output.success('100%')} (forced)`,
|
|
132
|
+
`Description: ${agent.description}`,
|
|
133
|
+
].join('\n'), 'Routing Result');
|
|
134
|
+
}
|
|
135
|
+
return { success: true, data: { agentId: agent.id, agentName: agent.name } };
|
|
136
|
+
}
|
|
137
|
+
// Use Q-Learning routing
|
|
138
|
+
const router = await getRouter();
|
|
139
|
+
const result = router.route(taskDescription, useExploration);
|
|
140
|
+
const agent = getAgentType(result.route) || AGENT_TYPES[0];
|
|
141
|
+
spinner.succeed(`Routed to ${agent.name}`);
|
|
142
|
+
if (jsonOutput) {
|
|
143
|
+
output.printJson({
|
|
144
|
+
task: taskDescription,
|
|
145
|
+
agentId: result.route,
|
|
146
|
+
agentName: agent.name,
|
|
147
|
+
confidence: result.confidence,
|
|
148
|
+
qValues: result.qValues,
|
|
149
|
+
explored: result.explored,
|
|
150
|
+
alternatives: result.alternatives.map(a => ({
|
|
151
|
+
agentId: a.route,
|
|
152
|
+
agentName: getAgentType(a.route)?.name || a.route,
|
|
153
|
+
score: a.score,
|
|
154
|
+
})),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
output.writeln();
|
|
159
|
+
const confidence = result.confidence ?? 0;
|
|
160
|
+
// Use bound methods to preserve `this` context when calling output methods
|
|
161
|
+
const confidenceColor = confidence >= 0.7
|
|
162
|
+
? (text) => output.success(text)
|
|
163
|
+
: confidence >= 0.4
|
|
164
|
+
? (text) => output.warning(text)
|
|
165
|
+
: (text) => output.error(text);
|
|
166
|
+
const qValues = result.qValues || [0];
|
|
167
|
+
const maxQValue = Math.max(...qValues);
|
|
168
|
+
const capabilities = agent.capabilities || [];
|
|
169
|
+
const alternatives = result.alternatives || [];
|
|
170
|
+
output.printBox([
|
|
171
|
+
`Task: ${taskDescription}`,
|
|
172
|
+
``,
|
|
173
|
+
`Agent: ${output.highlight(agent.name)} (${result.route})`,
|
|
174
|
+
`Confidence: ${confidenceColor(`${(confidence * 100).toFixed(1)}%`)}`,
|
|
175
|
+
`Q-Value: ${maxQValue.toFixed(3)}`,
|
|
176
|
+
`Exploration: ${result.explored ? output.warning('Yes') : 'No'}`,
|
|
177
|
+
``,
|
|
178
|
+
`Description: ${agent.description}`,
|
|
179
|
+
`Capabilities: ${capabilities.join(', ')}`,
|
|
180
|
+
].join('\n'), 'Q-Learning Routing');
|
|
181
|
+
if (alternatives.length > 0) {
|
|
182
|
+
output.writeln();
|
|
183
|
+
output.writeln(output.bold('Alternatives:'));
|
|
184
|
+
output.printTable({
|
|
185
|
+
columns: [
|
|
186
|
+
{ key: 'agent', header: 'Agent', width: 20 },
|
|
187
|
+
{ key: 'score', header: 'Score', width: 12, align: 'right' },
|
|
188
|
+
],
|
|
189
|
+
data: alternatives.map(a => ({
|
|
190
|
+
agent: getAgentType(a.route)?.name || a.route,
|
|
191
|
+
score: (a.score ?? 0).toFixed(3),
|
|
192
|
+
})),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return { success: true, data: { agentId: result.route, result } };
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
spinner.fail('Routing failed');
|
|
200
|
+
output.printError(error instanceof Error ? error.message : String(error));
|
|
201
|
+
return { success: false, exitCode: 1 };
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
// ============================================================================
|
|
206
|
+
// List Agents Subcommand
|
|
207
|
+
// ============================================================================
|
|
208
|
+
const listAgentsCommand = {
|
|
209
|
+
name: 'list-agents',
|
|
210
|
+
aliases: ['agents', 'ls'],
|
|
211
|
+
description: 'List all available agent types for routing',
|
|
212
|
+
options: [
|
|
213
|
+
{
|
|
214
|
+
name: 'json',
|
|
215
|
+
short: 'j',
|
|
216
|
+
description: 'Output in JSON format',
|
|
217
|
+
type: 'boolean',
|
|
218
|
+
default: false,
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
examples: [
|
|
222
|
+
{ command: 'claude-flow route list-agents', description: 'List all agents' },
|
|
223
|
+
{ command: 'claude-flow route agents --json', description: 'List agents as JSON' },
|
|
224
|
+
],
|
|
225
|
+
action: async (ctx) => {
|
|
226
|
+
const jsonOutput = ctx.flags.json;
|
|
227
|
+
try {
|
|
228
|
+
if (jsonOutput) {
|
|
229
|
+
output.printJson(AGENT_TYPES);
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
output.writeln();
|
|
233
|
+
output.writeln(output.bold('Available Agent Types'));
|
|
234
|
+
output.writeln(output.dim('Ordered by priority (highest first)'));
|
|
235
|
+
output.writeln();
|
|
236
|
+
output.printTable({
|
|
237
|
+
columns: [
|
|
238
|
+
{ key: 'id', header: 'ID', width: 15 },
|
|
239
|
+
{ key: 'name', header: 'Name', width: 15 },
|
|
240
|
+
{ key: 'priority', header: 'Priority', width: 10, align: 'right' },
|
|
241
|
+
{ key: 'description', header: 'Description', width: 45 },
|
|
242
|
+
],
|
|
243
|
+
data: AGENT_TYPES.map(a => ({
|
|
244
|
+
id: output.highlight(a.id),
|
|
245
|
+
name: a.name,
|
|
246
|
+
priority: String(a.priority),
|
|
247
|
+
description: a.description,
|
|
248
|
+
})),
|
|
249
|
+
});
|
|
250
|
+
output.writeln();
|
|
251
|
+
output.writeln(output.dim(`Total: ${AGENT_TYPES.length} agent types`));
|
|
252
|
+
}
|
|
253
|
+
return { success: true, data: AGENT_TYPES };
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
output.printError(error instanceof Error ? error.message : String(error));
|
|
257
|
+
return { success: false, exitCode: 1 };
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
// ============================================================================
|
|
262
|
+
// Stats Subcommand
|
|
263
|
+
// ============================================================================
|
|
264
|
+
const statsCommand = {
|
|
265
|
+
name: 'stats',
|
|
266
|
+
description: 'Show Q-Learning router statistics',
|
|
267
|
+
options: [
|
|
268
|
+
{
|
|
269
|
+
name: 'json',
|
|
270
|
+
short: 'j',
|
|
271
|
+
description: 'Output in JSON format',
|
|
272
|
+
type: 'boolean',
|
|
273
|
+
default: false,
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
examples: [
|
|
277
|
+
{ command: 'claude-flow route stats', description: 'Show routing statistics' },
|
|
278
|
+
],
|
|
279
|
+
action: async (ctx) => {
|
|
280
|
+
const jsonOutput = ctx.flags.json;
|
|
281
|
+
try {
|
|
282
|
+
const router = await getRouter();
|
|
283
|
+
const stats = router.getStats();
|
|
284
|
+
const ruvectorAvailable = await isRuvectorAvailable();
|
|
285
|
+
const ruvectorStatus = {
|
|
286
|
+
available: ruvectorAvailable,
|
|
287
|
+
wasmAccelerated: stats.useNative === 1,
|
|
288
|
+
backend: stats.useNative === 1 ? 'ruvector-native' : 'fallback',
|
|
289
|
+
};
|
|
290
|
+
if (jsonOutput) {
|
|
291
|
+
output.printJson({ stats, ruvector: ruvectorStatus });
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
output.writeln();
|
|
295
|
+
output.writeln(output.bold('Q-Learning Router Statistics'));
|
|
296
|
+
output.writeln();
|
|
297
|
+
output.printTable({
|
|
298
|
+
columns: [
|
|
299
|
+
{ key: 'metric', header: 'Metric', width: 25 },
|
|
300
|
+
{ key: 'value', header: 'Value', width: 20, align: 'right' },
|
|
301
|
+
],
|
|
302
|
+
data: [
|
|
303
|
+
{ metric: 'Update Count', value: String(stats.updateCount) },
|
|
304
|
+
{ metric: 'Q-Table Size', value: String(stats.qTableSize) },
|
|
305
|
+
{ metric: 'Step Count', value: String(stats.stepCount) },
|
|
306
|
+
{ metric: 'Epsilon', value: stats.epsilon.toFixed(4) },
|
|
307
|
+
{ metric: 'Avg TD Error', value: stats.avgTDError.toFixed(4) },
|
|
308
|
+
{ metric: 'Native Backend', value: stats.useNative === 1 ? 'Yes' : 'No' },
|
|
309
|
+
],
|
|
310
|
+
});
|
|
311
|
+
output.writeln();
|
|
312
|
+
output.writeln(output.bold('RuVector Status'));
|
|
313
|
+
output.printList([
|
|
314
|
+
`Available: ${ruvectorStatus.available ? output.success('Yes') : output.warning('No (using fallback)')}`,
|
|
315
|
+
`WASM Accelerated: ${ruvectorStatus.wasmAccelerated ? output.success('Yes') : 'No'}`,
|
|
316
|
+
`Backend: ${ruvectorStatus.backend}`,
|
|
317
|
+
]);
|
|
318
|
+
}
|
|
319
|
+
return { success: true, data: { stats, ruvector: ruvectorStatus } };
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
output.printError(error instanceof Error ? error.message : String(error));
|
|
323
|
+
return { success: false, exitCode: 1 };
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
// ============================================================================
|
|
328
|
+
// Feedback Subcommand
|
|
329
|
+
// ============================================================================
|
|
330
|
+
const feedbackCommand = {
|
|
331
|
+
name: 'feedback',
|
|
332
|
+
description: 'Provide feedback on a routing decision',
|
|
333
|
+
options: [
|
|
334
|
+
{
|
|
335
|
+
name: 'task',
|
|
336
|
+
short: 't',
|
|
337
|
+
description: 'Task description (context for learning)',
|
|
338
|
+
type: 'string',
|
|
339
|
+
required: true,
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: 'agent',
|
|
343
|
+
short: 'a',
|
|
344
|
+
description: 'Agent that was used',
|
|
345
|
+
type: 'string',
|
|
346
|
+
required: true,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'reward',
|
|
350
|
+
short: 'r',
|
|
351
|
+
description: 'Reward value (-1 to 1, where 1 is best)',
|
|
352
|
+
type: 'number',
|
|
353
|
+
default: 0.8,
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
name: 'next-task',
|
|
357
|
+
short: 'n',
|
|
358
|
+
description: 'Next task description (for multi-step learning)',
|
|
359
|
+
type: 'string',
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
examples: [
|
|
363
|
+
{ command: 'claude-flow route feedback -t "implement auth" -a coder -r 0.9', description: 'Positive feedback' },
|
|
364
|
+
{ command: 'claude-flow route feedback -t "write tests" -a tester -r -0.5', description: 'Negative feedback' },
|
|
365
|
+
],
|
|
366
|
+
action: async (ctx) => {
|
|
367
|
+
const taskDescription = ctx.flags.task;
|
|
368
|
+
const agentId = ctx.flags.agent;
|
|
369
|
+
const reward = ctx.flags.reward;
|
|
370
|
+
const nextTask = ctx.flags['next-task'];
|
|
371
|
+
if (!taskDescription || !agentId) {
|
|
372
|
+
output.printError('Task description and agent are required');
|
|
373
|
+
return { success: false, exitCode: 1 };
|
|
374
|
+
}
|
|
375
|
+
// Validate agent
|
|
376
|
+
const agent = getAgentType(agentId);
|
|
377
|
+
if (!agent) {
|
|
378
|
+
output.printError(`Unknown agent: ${agentId}`);
|
|
379
|
+
output.writeln('Available agents:');
|
|
380
|
+
output.printList(AGENT_TYPES.map(a => a.id));
|
|
381
|
+
return { success: false, exitCode: 1 };
|
|
382
|
+
}
|
|
383
|
+
try {
|
|
384
|
+
const router = await getRouter();
|
|
385
|
+
const clampedReward = Math.max(-1, Math.min(1, reward));
|
|
386
|
+
const tdError = router.update(taskDescription, agentId, clampedReward, nextTask);
|
|
387
|
+
output.printSuccess(`Feedback recorded for agent "${agent.name}"`);
|
|
388
|
+
output.writeln();
|
|
389
|
+
output.printBox([
|
|
390
|
+
`Task: ${taskDescription}`,
|
|
391
|
+
`Agent: ${agent.name} (${agentId})`,
|
|
392
|
+
`Reward: ${clampedReward >= 0 ? output.success(clampedReward.toFixed(2)) : output.error(clampedReward.toFixed(2))}`,
|
|
393
|
+
`TD Error: ${Math.abs(tdError).toFixed(4)}`,
|
|
394
|
+
nextTask ? `Next Task: ${nextTask}` : '',
|
|
395
|
+
].filter(Boolean).join('\n'), 'Feedback Recorded');
|
|
396
|
+
return { success: true, data: { tdError } };
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
output.printError(error instanceof Error ? error.message : String(error));
|
|
400
|
+
return { success: false, exitCode: 1 };
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
};
|
|
404
|
+
// ============================================================================
|
|
405
|
+
// Reset Subcommand
|
|
406
|
+
// ============================================================================
|
|
407
|
+
const resetCommand = {
|
|
408
|
+
name: 'reset',
|
|
409
|
+
description: 'Reset the Q-Learning router state',
|
|
410
|
+
options: [
|
|
411
|
+
{
|
|
412
|
+
name: 'force',
|
|
413
|
+
short: 'f',
|
|
414
|
+
description: 'Force reset without confirmation',
|
|
415
|
+
type: 'boolean',
|
|
416
|
+
default: false,
|
|
417
|
+
},
|
|
418
|
+
],
|
|
419
|
+
examples: [
|
|
420
|
+
{ command: 'claude-flow route reset', description: 'Reset router state' },
|
|
421
|
+
{ command: 'claude-flow route reset --force', description: 'Force reset' },
|
|
422
|
+
],
|
|
423
|
+
action: async (ctx) => {
|
|
424
|
+
const force = ctx.flags.force;
|
|
425
|
+
if (!force && ctx.interactive) {
|
|
426
|
+
output.printWarning('This will reset all learned Q-values and statistics.');
|
|
427
|
+
output.writeln(output.dim('Use --force to skip this confirmation.'));
|
|
428
|
+
return { success: false, exitCode: 1 };
|
|
429
|
+
}
|
|
430
|
+
try {
|
|
431
|
+
const router = await getRouter();
|
|
432
|
+
router.reset();
|
|
433
|
+
output.printSuccess('Q-Learning router state has been reset');
|
|
434
|
+
return { success: true };
|
|
435
|
+
}
|
|
436
|
+
catch (error) {
|
|
437
|
+
output.printError(error instanceof Error ? error.message : String(error));
|
|
438
|
+
return { success: false, exitCode: 1 };
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
// ============================================================================
|
|
443
|
+
// Export/Import Subcommands
|
|
444
|
+
// ============================================================================
|
|
445
|
+
const exportCommand = {
|
|
446
|
+
name: 'export',
|
|
447
|
+
description: 'Export Q-table for persistence',
|
|
448
|
+
options: [
|
|
449
|
+
{
|
|
450
|
+
name: 'file',
|
|
451
|
+
short: 'f',
|
|
452
|
+
description: 'Output file path (outputs to stdout if not specified)',
|
|
453
|
+
type: 'string',
|
|
454
|
+
},
|
|
455
|
+
],
|
|
456
|
+
examples: [
|
|
457
|
+
{ command: 'claude-flow route export', description: 'Export Q-table to stdout' },
|
|
458
|
+
{ command: 'claude-flow route export -f qtable.json', description: 'Export to file' },
|
|
459
|
+
],
|
|
460
|
+
action: async (ctx) => {
|
|
461
|
+
const filePath = ctx.flags.file;
|
|
462
|
+
try {
|
|
463
|
+
const router = await getRouter();
|
|
464
|
+
const data = router.export();
|
|
465
|
+
if (filePath) {
|
|
466
|
+
const fs = await import('node:fs/promises');
|
|
467
|
+
await fs.writeFile(filePath, JSON.stringify(data, null, 2));
|
|
468
|
+
output.printSuccess(`Q-table exported to ${filePath}`);
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
output.printJson(data);
|
|
472
|
+
}
|
|
473
|
+
return { success: true, data };
|
|
474
|
+
}
|
|
475
|
+
catch (error) {
|
|
476
|
+
output.printError(error instanceof Error ? error.message : String(error));
|
|
477
|
+
return { success: false, exitCode: 1 };
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
};
|
|
481
|
+
const importCommand = {
|
|
482
|
+
name: 'import',
|
|
483
|
+
description: 'Import Q-table from file',
|
|
484
|
+
options: [
|
|
485
|
+
{
|
|
486
|
+
name: 'file',
|
|
487
|
+
short: 'f',
|
|
488
|
+
description: 'Input file path',
|
|
489
|
+
type: 'string',
|
|
490
|
+
required: true,
|
|
491
|
+
},
|
|
492
|
+
],
|
|
493
|
+
examples: [
|
|
494
|
+
{ command: 'claude-flow route import -f qtable.json', description: 'Import Q-table from file' },
|
|
495
|
+
],
|
|
496
|
+
action: async (ctx) => {
|
|
497
|
+
const filePath = ctx.flags.file;
|
|
498
|
+
if (!filePath) {
|
|
499
|
+
output.printError('File path is required');
|
|
500
|
+
return { success: false, exitCode: 1 };
|
|
501
|
+
}
|
|
502
|
+
try {
|
|
503
|
+
const fs = await import('node:fs/promises');
|
|
504
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
505
|
+
const data = JSON.parse(content);
|
|
506
|
+
const router = await getRouter();
|
|
507
|
+
router.import(data);
|
|
508
|
+
output.printSuccess(`Q-table imported from ${filePath}`);
|
|
509
|
+
output.writeln(output.dim(`Loaded ${Object.keys(data).length} state entries`));
|
|
510
|
+
return { success: true };
|
|
511
|
+
}
|
|
512
|
+
catch (error) {
|
|
513
|
+
output.printError(error instanceof Error ? error.message : String(error));
|
|
514
|
+
return { success: false, exitCode: 1 };
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
};
|
|
518
|
+
// ============================================================================
|
|
519
|
+
// Main Route Command
|
|
520
|
+
// ============================================================================
|
|
521
|
+
export const routeCommand = {
|
|
522
|
+
name: 'route',
|
|
523
|
+
description: 'Intelligent task-to-agent routing using Q-Learning',
|
|
524
|
+
subcommands: [
|
|
525
|
+
routeTaskCommand,
|
|
526
|
+
listAgentsCommand,
|
|
527
|
+
statsCommand,
|
|
528
|
+
feedbackCommand,
|
|
529
|
+
resetCommand,
|
|
530
|
+
exportCommand,
|
|
531
|
+
importCommand,
|
|
532
|
+
],
|
|
533
|
+
options: [
|
|
534
|
+
{
|
|
535
|
+
name: 'q-learning',
|
|
536
|
+
short: 'q',
|
|
537
|
+
description: 'Use Q-Learning for agent selection',
|
|
538
|
+
type: 'boolean',
|
|
539
|
+
default: true,
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
name: 'agent',
|
|
543
|
+
short: 'a',
|
|
544
|
+
description: 'Force specific agent',
|
|
545
|
+
type: 'string',
|
|
546
|
+
},
|
|
547
|
+
],
|
|
548
|
+
examples: [
|
|
549
|
+
{ command: 'claude-flow route "implement feature"', description: 'Route task to best agent' },
|
|
550
|
+
{ command: 'claude-flow route "write tests" --q-learning', description: 'Use Q-Learning routing' },
|
|
551
|
+
{ command: 'claude-flow route --agent coder "fix bug"', description: 'Force specific agent' },
|
|
552
|
+
{ command: 'claude-flow route list-agents', description: 'List available agents' },
|
|
553
|
+
{ command: 'claude-flow route stats', description: 'Show routing statistics' },
|
|
554
|
+
],
|
|
555
|
+
action: async (ctx) => {
|
|
556
|
+
// If task description provided directly, route it
|
|
557
|
+
if (ctx.args.length > 0 && routeTaskCommand.action) {
|
|
558
|
+
const result = await routeTaskCommand.action(ctx);
|
|
559
|
+
if (result)
|
|
560
|
+
return result;
|
|
561
|
+
return { success: true };
|
|
562
|
+
}
|
|
563
|
+
// Show help
|
|
564
|
+
output.writeln();
|
|
565
|
+
output.writeln(output.bold('Q-Learning Agent Router'));
|
|
566
|
+
output.writeln(output.dim('Intelligent task-to-agent routing using reinforcement learning'));
|
|
567
|
+
output.writeln();
|
|
568
|
+
output.writeln('Usage: claude-flow route <task> [options]');
|
|
569
|
+
output.writeln(' claude-flow route <subcommand>');
|
|
570
|
+
output.writeln();
|
|
571
|
+
output.writeln(output.bold('Subcommands:'));
|
|
572
|
+
output.printList([
|
|
573
|
+
`${output.highlight('task')} - Route a task to optimal agent`,
|
|
574
|
+
`${output.highlight('list-agents')} - List available agent types`,
|
|
575
|
+
`${output.highlight('stats')} - Show router statistics`,
|
|
576
|
+
`${output.highlight('feedback')} - Provide routing feedback`,
|
|
577
|
+
`${output.highlight('reset')} - Reset router state`,
|
|
578
|
+
`${output.highlight('export')} - Export Q-table`,
|
|
579
|
+
`${output.highlight('import')} - Import Q-table`,
|
|
580
|
+
]);
|
|
581
|
+
output.writeln();
|
|
582
|
+
output.writeln(output.bold('How It Works:'));
|
|
583
|
+
output.printList([
|
|
584
|
+
'Analyzes task description using hash-based state encoding',
|
|
585
|
+
'Uses Q-Learning to learn from routing outcomes',
|
|
586
|
+
'Epsilon-greedy exploration for continuous improvement',
|
|
587
|
+
'Provides confidence scores and alternatives',
|
|
588
|
+
]);
|
|
589
|
+
output.writeln();
|
|
590
|
+
// Show quick status
|
|
591
|
+
const ruvectorAvailable = await isRuvectorAvailable();
|
|
592
|
+
output.writeln(output.bold('Backend Status:'));
|
|
593
|
+
output.printList([
|
|
594
|
+
`RuVector: ${ruvectorAvailable ? output.success('Available') : output.warning('Fallback mode')}`,
|
|
595
|
+
`Backend: ${ruvectorAvailable ? 'ruvector-native' : 'JavaScript fallback'}`,
|
|
596
|
+
]);
|
|
597
|
+
output.writeln();
|
|
598
|
+
output.writeln(output.dim('Run "claude-flow route <subcommand> --help" for more info'));
|
|
599
|
+
return { success: true };
|
|
600
|
+
},
|
|
601
|
+
};
|
|
602
|
+
export default routeCommand;
|
|
603
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../src/commands/route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAc9B;;GAEG;AACH,MAAM,WAAW,GAAgB;IAC/B,EAAE,EAAE,EAAE,OAA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aAAa,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;YAChG,YAAY,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,qBAAqB,EAAE;SAC5E,CAAC,CAAC;QACH,MAAM,CAAC,OAAO,EAAE,CAAC;QAEjB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC,CAAC;QAExF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 CLI Security Command
|
|
3
|
+
* Security scanning, CVE detection, threat modeling, vulnerability management
|
|
4
|
+
*
|
|
5
|
+
* Created with ❤️ by ruv.io
|
|
6
|
+
*/
|
|
7
|
+
import type { Command } from '../types.js';
|
|
8
|
+
export declare const securityCommand: Command;
|
|
9
|
+
export default securityCommand;
|
|
10
|
+
//# sourceMappingURL=security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../src/commands/security.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AA0P1E,eAAO,MAAM,eAAe,EAAE,OA4B7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|