ultra-dex 2.2.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -151
- package/assets/agents/00-AGENT_INDEX.md +1 -1
- package/assets/code-patterns/clerk-middleware.ts +138 -0
- package/assets/code-patterns/prisma-schema.prisma +224 -0
- package/assets/code-patterns/rls-policies.sql +246 -0
- package/assets/code-patterns/server-actions.ts +191 -0
- package/assets/code-patterns/trpc-router.ts +258 -0
- package/assets/cursor-rules/13-ai-integration.mdc +155 -0
- package/assets/cursor-rules/14-server-components.mdc +81 -0
- package/assets/cursor-rules/15-server-actions.mdc +102 -0
- package/assets/cursor-rules/16-edge-middleware.mdc +105 -0
- package/assets/cursor-rules/17-streaming-ssr.mdc +138 -0
- package/assets/docs/LAUNCH-POSTS.md +1 -1
- package/assets/docs/QUICK-REFERENCE.md +9 -4
- package/assets/docs/VISION-V2.md +1 -1
- package/assets/hooks/pre-commit +98 -0
- package/assets/saas-plan/04-Imp-Template.md +1 -1
- package/bin/ultra-dex.js +132 -4
- package/lib/commands/advanced.js +471 -0
- package/lib/commands/agent-builder.js +226 -0
- package/lib/commands/agents.js +102 -42
- package/lib/commands/auto-implement.js +68 -0
- package/lib/commands/banner.js +43 -21
- package/lib/commands/build.js +78 -183
- package/lib/commands/ci-monitor.js +84 -0
- package/lib/commands/config.js +207 -0
- package/lib/commands/dashboard.js +770 -0
- package/lib/commands/diff.js +233 -0
- package/lib/commands/doctor.js +416 -0
- package/lib/commands/export.js +408 -0
- package/lib/commands/fix.js +96 -0
- package/lib/commands/generate.js +105 -78
- package/lib/commands/hooks.js +251 -76
- package/lib/commands/init.js +102 -54
- package/lib/commands/memory.js +80 -0
- package/lib/commands/plan.js +82 -0
- package/lib/commands/review.js +34 -5
- package/lib/commands/run.js +233 -0
- package/lib/commands/scaffold.js +151 -0
- package/lib/commands/serve.js +179 -146
- package/lib/commands/state.js +327 -0
- package/lib/commands/swarm.js +306 -0
- package/lib/commands/sync.js +82 -23
- package/lib/commands/team.js +275 -0
- package/lib/commands/upgrade.js +190 -0
- package/lib/commands/validate.js +34 -0
- package/lib/commands/verify.js +81 -0
- package/lib/commands/watch.js +79 -0
- package/lib/config/theme.js +47 -0
- package/lib/mcp/graph.js +92 -0
- package/lib/mcp/memory.js +95 -0
- package/lib/mcp/resources.js +152 -0
- package/lib/mcp/server.js +34 -0
- package/lib/mcp/tools.js +481 -0
- package/lib/mcp/websocket.js +117 -0
- package/lib/providers/index.js +49 -4
- package/lib/providers/ollama.js +136 -0
- package/lib/providers/router.js +63 -0
- package/lib/quality/scanner.js +128 -0
- package/lib/swarm/coordinator.js +97 -0
- package/lib/swarm/index.js +598 -0
- package/lib/swarm/protocol.js +677 -0
- package/lib/swarm/tiers.js +485 -0
- package/lib/templates/code/clerk-middleware.ts +138 -0
- package/lib/templates/code/prisma-schema.prisma +224 -0
- package/lib/templates/code/rls-policies.sql +246 -0
- package/lib/templates/code/server-actions.ts +191 -0
- package/lib/templates/code/trpc-router.ts +258 -0
- package/lib/templates/custom-agent.md +10 -0
- package/lib/themes/doomsday.js +229 -0
- package/lib/ui/index.js +5 -0
- package/lib/ui/interface.js +241 -0
- package/lib/ui/spinners.js +116 -0
- package/lib/ui/theme.js +183 -0
- package/lib/utils/agents.js +32 -0
- package/lib/utils/files.js +14 -0
- package/lib/utils/graph.js +108 -0
- package/lib/utils/help.js +64 -0
- package/lib/utils/messages.js +35 -0
- package/lib/utils/progress.js +24 -0
- package/lib/utils/prompts.js +47 -0
- package/lib/utils/spinners.js +46 -0
- package/lib/utils/status.js +31 -0
- package/lib/utils/tables.js +41 -0
- package/lib/utils/theme-state.js +9 -0
- package/lib/utils/version-display.js +32 -0
- package/package.json +31 -13
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// Ultra-Dex CLI — Main Interface Display
|
|
2
|
+
// The startup screen and interactive interface
|
|
3
|
+
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { theme, box, header, divider, status, table, keyHints, statusLine } from './theme.js';
|
|
6
|
+
|
|
7
|
+
// ═══════════════════════════════════════════════════════════════
|
|
8
|
+
// STARTUP BANNER (Like Gemini CLI's clean intro)
|
|
9
|
+
// ═══════════════════════════════════════════════════════════════
|
|
10
|
+
|
|
11
|
+
const logo = `
|
|
12
|
+
██╗ ██╗██╗ ████████╗██████╗ █████╗
|
|
13
|
+
██║ ██║██║ ╚══██╔══╝██╔══██╗██╔══██╗
|
|
14
|
+
██║ ██║██║ ██║ ██████╔╝███████║
|
|
15
|
+
██║ ██║██║ ██║ ██╔══██╗██╔══██║
|
|
16
|
+
╚██████╔╝███████╗██║ ██║ ██║██║ ██║
|
|
17
|
+
╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
|
18
|
+
██████╗ ███████╗██╗ ██╗
|
|
19
|
+
██╔══██╗██╔════╝╚██╗██╔╝
|
|
20
|
+
██║ ██║█████╗ ╚███╔╝
|
|
21
|
+
██║ ██║██╔══╝ ██╔██╗
|
|
22
|
+
██████╔╝███████╗██╔╝ ██╗
|
|
23
|
+
╚═════╝ ╚══════╝╚═╝ ╚═╝`;
|
|
24
|
+
|
|
25
|
+
export function showStartup(version = '3.1.0') {
|
|
26
|
+
console.clear();
|
|
27
|
+
console.log(theme.primary(logo));
|
|
28
|
+
console.log('');
|
|
29
|
+
console.log(theme.dim(' ─────────────────────────────────────────────────────────'));
|
|
30
|
+
console.log(` ${theme.title('ULTRA-DEX')} ${theme.dim('v' + version)} ${theme.dim('•')} ${theme.subtitle('AI Orchestration Meta-Layer')}`);
|
|
31
|
+
console.log(theme.dim(' ─────────────────────────────────────────────────────────'));
|
|
32
|
+
console.log('');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ═══════════════════════════════════════════════════════════════
|
|
36
|
+
// MAIN INTERFACE (Interactive mode like Claude Code)
|
|
37
|
+
// ═══════════════════════════════════════════════════════════════
|
|
38
|
+
|
|
39
|
+
export function showMainInterface() {
|
|
40
|
+
showStartup();
|
|
41
|
+
|
|
42
|
+
console.log(theme.subtitle(' What would you like to do?'));
|
|
43
|
+
console.log('');
|
|
44
|
+
|
|
45
|
+
const options = [
|
|
46
|
+
[theme.primary('1'), 'generate', 'Create implementation plan from idea'],
|
|
47
|
+
[theme.primary('2'), 'build', 'Start AI-assisted development'],
|
|
48
|
+
[theme.primary('3'), 'agents', 'Browse 16 specialized agents'],
|
|
49
|
+
[theme.primary('4'), 'swarm', 'Run autonomous agent pipeline'],
|
|
50
|
+
[theme.primary('5'), 'dashboard', 'Open monitoring dashboard'],
|
|
51
|
+
[theme.primary('6'), 'serve', 'Start MCP server']
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
options.forEach(([num, cmd, desc]) => {
|
|
55
|
+
console.log(` ${num} ${theme.accent(cmd.padEnd(12))} ${theme.dim(desc)}`);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
console.log('');
|
|
59
|
+
keyHints([['q', 'quit'], ['h', 'help'], ['↑↓', 'navigate']]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ═══════════════════════════════════════════════════════════════
|
|
63
|
+
// STATUS DISPLAY (Like Gemini's project status view)
|
|
64
|
+
// ═══════════════════════════════════════════════════════════════
|
|
65
|
+
|
|
66
|
+
export function showStatus(projectData) {
|
|
67
|
+
header('Project Status');
|
|
68
|
+
console.log('');
|
|
69
|
+
|
|
70
|
+
// Project info
|
|
71
|
+
statusLine(status.info, theme.title(projectData.name || 'Ultra-Dex Project'));
|
|
72
|
+
console.log('');
|
|
73
|
+
|
|
74
|
+
// Alignment score with bar
|
|
75
|
+
const score = projectData.score || 0;
|
|
76
|
+
const scoreColor = score >= 80 ? theme.success : score >= 50 ? theme.warning : theme.error;
|
|
77
|
+
console.log(` ${theme.dim('Alignment')} ${progressBar(score, 100)}`);
|
|
78
|
+
console.log('');
|
|
79
|
+
|
|
80
|
+
// Quick stats
|
|
81
|
+
table(['Metric', 'Value', 'Status'], [
|
|
82
|
+
['Sections Complete', `${projectData.sectionsComplete || 0}/34`, score >= 70 ? status.success : status.warning],
|
|
83
|
+
['Agents Ready', `${projectData.agentsReady || 16}/16`, status.success],
|
|
84
|
+
['Cursor Rules', `${projectData.rulesLoaded || 13}/13`, status.success],
|
|
85
|
+
['Last Updated', projectData.lastUpdated || 'Never', status.info]
|
|
86
|
+
]);
|
|
87
|
+
|
|
88
|
+
console.log('');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ═══════════════════════════════════════════════════════════════
|
|
92
|
+
// AGENTS LIST (Clean grid view)
|
|
93
|
+
// ═══════════════════════════════════════════════════════════════
|
|
94
|
+
|
|
95
|
+
export function showAgentsList() {
|
|
96
|
+
header('Agents');
|
|
97
|
+
console.log('');
|
|
98
|
+
|
|
99
|
+
const agents = [
|
|
100
|
+
{
|
|
101
|
+
tier: '1-leadership', agents: [
|
|
102
|
+
{ name: 'cto', icon: '🏛️', status: 'ready' },
|
|
103
|
+
{ name: 'planner', icon: '📋', status: 'ready' },
|
|
104
|
+
{ name: 'research', icon: '🔍', status: 'ready' }
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
tier: '2-development', agents: [
|
|
109
|
+
{ name: 'backend', icon: '⚙️', status: 'ready' },
|
|
110
|
+
{ name: 'frontend', icon: '🎨', status: 'ready' },
|
|
111
|
+
{ name: 'database', icon: '💾', status: 'ready' }
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
tier: '3-security', agents: [
|
|
116
|
+
{ name: 'auth', icon: '🔐', status: 'ready' },
|
|
117
|
+
{ name: 'security', icon: '🛡️', status: 'ready' }
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
tier: '4-devops', agents: [
|
|
122
|
+
{ name: 'devops', icon: '🚀', status: 'ready' }
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
tier: '5-quality', agents: [
|
|
127
|
+
{ name: 'testing', icon: '🧪', status: 'ready' },
|
|
128
|
+
{ name: 'docs', icon: '📖', status: 'ready' },
|
|
129
|
+
{ name: 'reviewer', icon: '👀', status: 'ready' },
|
|
130
|
+
{ name: 'debugger', icon: '🐛', status: 'ready' }
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
tier: '6-specialist', agents: [
|
|
135
|
+
{ name: 'performance', icon: '⚡', status: 'ready' },
|
|
136
|
+
{ name: 'refactoring', icon: '♻️', status: 'ready' }
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
agents.forEach(tier => {
|
|
142
|
+
console.log(` ${theme.dim(tier.tier)}`);
|
|
143
|
+
tier.agents.forEach(agent => {
|
|
144
|
+
const statusIcon = agent.status === 'ready' ? theme.success('●') : theme.dim('○');
|
|
145
|
+
console.log(` ${statusIcon} ${agent.icon} ${theme.accent(agent.name)}`);
|
|
146
|
+
});
|
|
147
|
+
console.log('');
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
keyHints([['enter', 'select'], ['q', 'back']]);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ═══════════════════════════════════════════════════════════════
|
|
154
|
+
// SWARM MODE DISPLAY (Pipeline visualization)
|
|
155
|
+
// ═══════════════════════════════════════════════════════════════
|
|
156
|
+
|
|
157
|
+
export function showSwarmPipeline(task, agents, currentIdx = -1) {
|
|
158
|
+
header('Agent Swarm');
|
|
159
|
+
console.log('');
|
|
160
|
+
console.log(` ${theme.dim('Task:')} ${theme.title(task)}`);
|
|
161
|
+
console.log('');
|
|
162
|
+
|
|
163
|
+
agents.forEach((agent, idx) => {
|
|
164
|
+
let icon, color;
|
|
165
|
+
|
|
166
|
+
if (idx < currentIdx) {
|
|
167
|
+
icon = status.success;
|
|
168
|
+
color = theme.success;
|
|
169
|
+
} else if (idx === currentIdx) {
|
|
170
|
+
icon = status.running;
|
|
171
|
+
color = theme.accent;
|
|
172
|
+
} else {
|
|
173
|
+
icon = status.pending;
|
|
174
|
+
color = theme.dim;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const line = idx < agents.length - 1 ? theme.dim('│') : ' ';
|
|
178
|
+
console.log(` ${icon} ${color(agent.name)}`);
|
|
179
|
+
console.log(` ${line}`);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
if (currentIdx >= agents.length) {
|
|
183
|
+
console.log('');
|
|
184
|
+
console.log(` ${theme.success.bold('✓ Pipeline complete')}`);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
console.log('');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// ═══════════════════════════════════════════════════════════════
|
|
191
|
+
// HELP DISPLAY
|
|
192
|
+
// ═══════════════════════════════════════════════════════════════
|
|
193
|
+
|
|
194
|
+
export function showHelp() {
|
|
195
|
+
header('Commands');
|
|
196
|
+
console.log('');
|
|
197
|
+
|
|
198
|
+
const commands = [
|
|
199
|
+
['Getting Started', [
|
|
200
|
+
['init', 'Initialize new project'],
|
|
201
|
+
['generate <idea>', 'Create plan from idea'],
|
|
202
|
+
['doctor', 'Check project health']
|
|
203
|
+
]],
|
|
204
|
+
['AI Agents', [
|
|
205
|
+
['agents', 'List all agents'],
|
|
206
|
+
['run <agent>', 'Run specific agent'],
|
|
207
|
+
['swarm <task>', 'Run agent pipeline']
|
|
208
|
+
]],
|
|
209
|
+
['Monitoring', [
|
|
210
|
+
['status', 'Show project status'],
|
|
211
|
+
['dashboard', 'Open web dashboard'],
|
|
212
|
+
['watch', 'Watch for changes']
|
|
213
|
+
]],
|
|
214
|
+
['Integration', [
|
|
215
|
+
['serve', 'Start MCP server'],
|
|
216
|
+
['config --mcp', 'Generate MCP config'],
|
|
217
|
+
['hooks', 'Install git hooks']
|
|
218
|
+
]]
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
commands.forEach(([section, cmds]) => {
|
|
222
|
+
console.log(` ${theme.subtitle(section)}`);
|
|
223
|
+
cmds.forEach(([cmd, desc]) => {
|
|
224
|
+
console.log(` ${theme.accent(cmd.padEnd(18))} ${theme.dim(desc)}`);
|
|
225
|
+
});
|
|
226
|
+
console.log('');
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// ═══════════════════════════════════════════════════════════════
|
|
231
|
+
// EXPORT ALL
|
|
232
|
+
// ═══════════════════════════════════════════════════════════════
|
|
233
|
+
|
|
234
|
+
export default {
|
|
235
|
+
showStartup,
|
|
236
|
+
showMainInterface,
|
|
237
|
+
showStatus,
|
|
238
|
+
showAgentsList,
|
|
239
|
+
showSwarmPipeline,
|
|
240
|
+
showHelp
|
|
241
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Ultra-Dex CLI — Spinner & Loading Animations
|
|
2
|
+
// Professional loading states like Gemini CLI
|
|
3
|
+
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { theme } from './theme.js';
|
|
7
|
+
|
|
8
|
+
// ═══════════════════════════════════════════════════════════════
|
|
9
|
+
// CUSTOM SPINNER (Matrix-style green)
|
|
10
|
+
// ═══════════════════════════════════════════════════════════════
|
|
11
|
+
|
|
12
|
+
const doomsdaySpinner = {
|
|
13
|
+
interval: 80,
|
|
14
|
+
frames: [
|
|
15
|
+
'▰▱▱▱▱▱▱',
|
|
16
|
+
'▰▰▱▱▱▱▱',
|
|
17
|
+
'▰▰▰▱▱▱▱',
|
|
18
|
+
'▰▰▰▰▱▱▱',
|
|
19
|
+
'▰▰▰▰▰▱▱',
|
|
20
|
+
'▰▰▰▰▰▰▱',
|
|
21
|
+
'▰▰▰▰▰▰▰',
|
|
22
|
+
'▱▰▰▰▰▰▰',
|
|
23
|
+
'▱▱▰▰▰▰▰',
|
|
24
|
+
'▱▱▱▰▰▰▰',
|
|
25
|
+
'▱▱▱▱▰▰▰',
|
|
26
|
+
'▱▱▱▱▱▰▰',
|
|
27
|
+
'▱▱▱▱▱▱▰'
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const dotSpinner = {
|
|
32
|
+
interval: 80,
|
|
33
|
+
frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const pulseSpinner = {
|
|
37
|
+
interval: 100,
|
|
38
|
+
frames: ['●', '◉', '○', '◉']
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// ═══════════════════════════════════════════════════════════════
|
|
42
|
+
// SPINNER FACTORY
|
|
43
|
+
// ═══════════════════════════════════════════════════════════════
|
|
44
|
+
|
|
45
|
+
export function createSpinner(text, type = 'default') {
|
|
46
|
+
const spinnerType = type === 'progress' ? doomsdaySpinner :
|
|
47
|
+
type === 'pulse' ? pulseSpinner : dotSpinner;
|
|
48
|
+
|
|
49
|
+
return ora({
|
|
50
|
+
text: theme.dim(text),
|
|
51
|
+
spinner: spinnerType,
|
|
52
|
+
color: 'green'
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function startLoading(text) {
|
|
57
|
+
const spinner = createSpinner(text);
|
|
58
|
+
spinner.start();
|
|
59
|
+
return spinner;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function succeed(spinner, text) {
|
|
63
|
+
spinner.succeed(theme.success(text));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function fail(spinner, text) {
|
|
67
|
+
spinner.fail(theme.error(text));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ═══════════════════════════════════════════════════════════════
|
|
71
|
+
// TASK LIST (Like Gemini's multi-step tasks)
|
|
72
|
+
// ═══════════════════════════════════════════════════════════════
|
|
73
|
+
|
|
74
|
+
export async function runTaskList(tasks) {
|
|
75
|
+
console.log('');
|
|
76
|
+
|
|
77
|
+
for (let i = 0; i < tasks.length; i++) {
|
|
78
|
+
const task = tasks[i];
|
|
79
|
+
const spinner = createSpinner(task.title, 'progress');
|
|
80
|
+
spinner.start();
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
await task.fn();
|
|
84
|
+
spinner.succeed(theme.success(task.title));
|
|
85
|
+
} catch (error) {
|
|
86
|
+
spinner.fail(theme.error(`${task.title}: ${error.message}`));
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
console.log('');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ═══════════════════════════════════════════════════════════════
|
|
95
|
+
// TYPING EFFECT (Like AI typing response)
|
|
96
|
+
// ═══════════════════════════════════════════════════════════════
|
|
97
|
+
|
|
98
|
+
export async function typeText(text, speed = 20) {
|
|
99
|
+
for (const char of text) {
|
|
100
|
+
process.stdout.write(theme.primary(char));
|
|
101
|
+
await new Promise(r => setTimeout(r, speed));
|
|
102
|
+
}
|
|
103
|
+
console.log('');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ═══════════════════════════════════════════════════════════════
|
|
107
|
+
// COUNTDOWN
|
|
108
|
+
// ═══════════════════════════════════════════════════════════════
|
|
109
|
+
|
|
110
|
+
export async function countdown(seconds, message) {
|
|
111
|
+
for (let i = seconds; i > 0; i--) {
|
|
112
|
+
process.stdout.write(`\r ${theme.accent(i)} ${theme.dim(message)}`);
|
|
113
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
114
|
+
}
|
|
115
|
+
process.stdout.write('\r' + ' '.repeat(60) + '\r');
|
|
116
|
+
}
|
package/lib/ui/theme.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// Ultra-Dex CLI — Professional Purple Theme
|
|
2
|
+
// This file provides the visual styling for the CLI
|
|
3
|
+
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import gradient from 'gradient-string';
|
|
6
|
+
|
|
7
|
+
// ═══════════════════════════════════════════════════════════════
|
|
8
|
+
// PROFESSIONAL PURPLE COLOR PALETTE
|
|
9
|
+
// ═══════════════════════════════════════════════════════════════
|
|
10
|
+
|
|
11
|
+
export const themeColors = {
|
|
12
|
+
primary: '#6366f1', // Indigo
|
|
13
|
+
secondary: '#8b5cf6', // Purple
|
|
14
|
+
accent: '#d946ef', // Pink
|
|
15
|
+
success: '#22c55e', // Green
|
|
16
|
+
warning: '#f59e0b', // Amber
|
|
17
|
+
error: '#ef4444', // Red
|
|
18
|
+
dim: '#6b7280', // Gray
|
|
19
|
+
muted: '#4b5563' // Darker Gray
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const ultraGradient = gradient(['#6366f1', '#8b5cf6', '#d946ef']);
|
|
23
|
+
|
|
24
|
+
export const theme = {
|
|
25
|
+
// Primary brand colors
|
|
26
|
+
primary: chalk.hex(themeColors.primary),
|
|
27
|
+
secondary: chalk.hex(themeColors.secondary),
|
|
28
|
+
accent: chalk.hex(themeColors.accent),
|
|
29
|
+
|
|
30
|
+
// Status colors
|
|
31
|
+
success: chalk.hex(themeColors.success),
|
|
32
|
+
error: chalk.hex(themeColors.error),
|
|
33
|
+
warning: chalk.hex(themeColors.warning),
|
|
34
|
+
info: chalk.hex(themeColors.primary),
|
|
35
|
+
|
|
36
|
+
// Text styles
|
|
37
|
+
title: chalk.hex(themeColors.secondary).bold,
|
|
38
|
+
subtitle: chalk.hex(themeColors.primary),
|
|
39
|
+
dim: chalk.hex(themeColors.dim),
|
|
40
|
+
muted: chalk.hex(themeColors.muted),
|
|
41
|
+
|
|
42
|
+
// Special
|
|
43
|
+
highlight: chalk.hex(themeColors.secondary).inverse,
|
|
44
|
+
link: chalk.hex(themeColors.primary).underline,
|
|
45
|
+
code: chalk.hex(themeColors.accent),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// ═══════════════════════════════════════════════════════════════
|
|
49
|
+
// STYLED COMPONENTS
|
|
50
|
+
// ═══════════════════════════════════════════════════════════════
|
|
51
|
+
|
|
52
|
+
export function box(content, title = '') {
|
|
53
|
+
const width = 60;
|
|
54
|
+
const border = theme.secondary;
|
|
55
|
+
|
|
56
|
+
const top = border('╭' + '─'.repeat(width - 2) + '╮');
|
|
57
|
+
const bottom = border('╰' + '─'.repeat(width - 2) + '╯');
|
|
58
|
+
const side = border('│');
|
|
59
|
+
|
|
60
|
+
const lines = content.split('\n');
|
|
61
|
+
const paddedLines = lines.map(line => {
|
|
62
|
+
const padding = width - 4 - stripAnsi(line).length;
|
|
63
|
+
return `${side} ${line}${' '.repeat(Math.max(0, padding))} ${side}`;
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
let titleBar = '';
|
|
67
|
+
if (title) {
|
|
68
|
+
const titlePadding = Math.floor((width - 4 - title.length) / 2);
|
|
69
|
+
titleBar = border('│') + ' '.repeat(titlePadding) + theme.title(title) + ' '.repeat(width - 4 - titlePadding - title.length) + border('│') + '\n';
|
|
70
|
+
titleBar += border('├' + '─'.repeat(width - 2) + '┤') + '\n';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return top + '\n' + titleBar + paddedLines.join('\n') + '\n' + bottom;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function divider(char = '─', width = 60) {
|
|
77
|
+
return theme.dim(char.repeat(width));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function header(text) {
|
|
81
|
+
console.log('');
|
|
82
|
+
console.log(theme.title(` ${text}`));
|
|
83
|
+
console.log(theme.dim(' ' + '─'.repeat(56)));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function subheader(text) {
|
|
87
|
+
console.log(theme.subtitle(` ${text}`));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ═══════════════════════════════════════════════════════════════
|
|
91
|
+
// STATUS INDICATORS
|
|
92
|
+
// ═══════════════════════════════════════════════════════════════
|
|
93
|
+
|
|
94
|
+
export const status = {
|
|
95
|
+
success: theme.success('✓'),
|
|
96
|
+
error: theme.error('✗'),
|
|
97
|
+
warning: theme.warning('⚠'),
|
|
98
|
+
info: theme.info('ℹ'),
|
|
99
|
+
pending: theme.dim('○'),
|
|
100
|
+
running: theme.accent('◉'),
|
|
101
|
+
arrow: theme.primary('→'),
|
|
102
|
+
bullet: theme.dim('•'),
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export function statusLine(icon, text, detail = '') {
|
|
106
|
+
const detailText = detail ? theme.dim(` · ${detail}`) : '';
|
|
107
|
+
console.log(` ${icon} ${text}${detailText}`);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// ═══════════════════════════════════════════════════════════════
|
|
111
|
+
// TABLE STYLING
|
|
112
|
+
// ═══════════════════════════════════════════════════════════════
|
|
113
|
+
|
|
114
|
+
export function table(headers, rows) {
|
|
115
|
+
const colWidths = headers.map((h, i) => {
|
|
116
|
+
const maxRow = Math.max(...rows.map(r => String(r[i] || '').length));
|
|
117
|
+
return Math.max(h.length, maxRow) + 2;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const border = theme.dim;
|
|
121
|
+
|
|
122
|
+
// Top border
|
|
123
|
+
console.log(border(' ┌' + colWidths.map(w => '─'.repeat(w)).join('┬') + '┐'));
|
|
124
|
+
|
|
125
|
+
// Header row
|
|
126
|
+
const headerRow = headers.map((h, i) => theme.title(h.padEnd(colWidths[i] - 2))).join(border(' │ '));
|
|
127
|
+
console.log(border(' │ ') + headerRow + border(' │'));
|
|
128
|
+
|
|
129
|
+
// Header separator
|
|
130
|
+
console.log(border(' ├' + colWidths.map(w => '─'.repeat(w)).join('┼') + '┤'));
|
|
131
|
+
|
|
132
|
+
// Data rows
|
|
133
|
+
rows.forEach(row => {
|
|
134
|
+
const rowText = row.map((cell, i) => String(cell || '').padEnd(colWidths[i] - 2)).join(border(' │ '));
|
|
135
|
+
console.log(border(' │ ') + rowText + border(' │'));
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Bottom border
|
|
139
|
+
console.log(border(' └' + colWidths.map(w => '─'.repeat(w)).join('┴') + '┘'));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ═══════════════════════════════════════════════════════════════
|
|
143
|
+
// PROGRESS & LOADING
|
|
144
|
+
// ═══════════════════════════════════════════════════════════════
|
|
145
|
+
|
|
146
|
+
export function progressBar(current, total, width = 40) {
|
|
147
|
+
const percentage = Math.round((current / total) * 100);
|
|
148
|
+
const filled = Math.round((current / total) * width);
|
|
149
|
+
const empty = width - filled;
|
|
150
|
+
|
|
151
|
+
const bar = theme.primary('█'.repeat(filled)) + theme.dim('░'.repeat(empty));
|
|
152
|
+
return `${bar} ${theme.accent(percentage + '%')}`;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function loadingDots() {
|
|
156
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
157
|
+
let i = 0;
|
|
158
|
+
return setInterval(() => {
|
|
159
|
+
process.stdout.write(`\r ${theme.accent(frames[i])} `);
|
|
160
|
+
i = (i + 1) % frames.length;
|
|
161
|
+
}, 80);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// ═══════════════════════════════════════════════════════════════
|
|
165
|
+
// KEYBOARD HINTS
|
|
166
|
+
// ═══════════════════════════════════════════════════════════════
|
|
167
|
+
|
|
168
|
+
export function keyHints(hints) {
|
|
169
|
+
const formattedHints = hints.map(([key, action]) =>
|
|
170
|
+
`${theme.highlight(` ${key} `)} ${theme.dim(action)}`
|
|
171
|
+
).join(' ');
|
|
172
|
+
|
|
173
|
+
console.log('');
|
|
174
|
+
console.log(` ${formattedHints}`);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ═══════════════════════════════════════════════════════════════
|
|
178
|
+
// HELPER
|
|
179
|
+
// ═══════════════════════════════════════════════════════════════
|
|
180
|
+
|
|
181
|
+
function stripAnsi(str) {
|
|
182
|
+
return str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
183
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// cli/lib/utils/agents.js
|
|
2
|
+
export const agents = {
|
|
3
|
+
// Leadership Tier
|
|
4
|
+
cto: { name: 'Chief Architect', emoji: '📐', tagline: 'Defining system architecture' },
|
|
5
|
+
planner: { name: 'Product Planner', emoji: '📋', tagline: 'breaking down requirements' },
|
|
6
|
+
research: { name: 'Research Analyst', emoji: '🔍', tagline: 'Analyzing patterns' },
|
|
7
|
+
|
|
8
|
+
// Development Tier
|
|
9
|
+
backend: { name: 'Backend Engineer', emoji: '⚙️', tagline: 'Building API services' },
|
|
10
|
+
frontend: { name: 'Frontend Engineer', emoji: '🎨', tagline: 'Crafting user interfaces' },
|
|
11
|
+
database: { name: 'Data Architect', emoji: '💾', tagline: 'Optimizing schema' },
|
|
12
|
+
|
|
13
|
+
// Security Tier
|
|
14
|
+
auth: { name: 'Security Engineer', emoji: '🔒', tagline: 'Securing access' },
|
|
15
|
+
security: { name: 'Security Auditor', emoji: '🛡️', tagline: 'Auditing vulnerabilities' },
|
|
16
|
+
|
|
17
|
+
// DevOps Tier
|
|
18
|
+
devops: { name: 'DevOps Engineer', emoji: '🚀', tagline: 'Managing deployment' },
|
|
19
|
+
|
|
20
|
+
// Quality Tier
|
|
21
|
+
testing: { name: 'QA Engineer', emoji: '🧪', tagline: 'Ensuring quality' },
|
|
22
|
+
documentation: { name: 'Tech Writer', emoji: '📝', tagline: 'Documenting systems' },
|
|
23
|
+
reviewer: { name: 'Code Reviewer', emoji: '👀', tagline: 'Reviewing code quality' },
|
|
24
|
+
debugger: { name: 'Debug Specialist', emoji: '🐛', tagline: 'Resolving issues' },
|
|
25
|
+
|
|
26
|
+
// Specialist Tier
|
|
27
|
+
performance: { name: 'Performance Engineer', emoji: '⚡', tagline: 'Optimizing speed' },
|
|
28
|
+
refactoring: { name: 'Refactoring Specialist', emoji: '♻️', tagline: 'Improving code structure' }
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// For compatibility if swarm.js imports avengersAgents
|
|
32
|
+
export const avengersAgents = agents;
|
package/lib/utils/files.js
CHANGED
|
@@ -24,3 +24,17 @@ export async function pathExists(targetPath, type = 'file') {
|
|
|
24
24
|
export function resolveAssetPath(basePath, relativePath) {
|
|
25
25
|
return path.join(basePath, relativePath);
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
export async function copyDirectory(sourceDir, targetDir) {
|
|
29
|
+
await fs.mkdir(targetDir, { recursive: true });
|
|
30
|
+
const entries = await fs.readdir(sourceDir, { withFileTypes: true });
|
|
31
|
+
for (const entry of entries) {
|
|
32
|
+
const sourcePath = path.join(sourceDir, entry.name);
|
|
33
|
+
const targetPath = path.join(targetDir, entry.name);
|
|
34
|
+
if (entry.isDirectory()) {
|
|
35
|
+
await copyDirectory(sourcePath, targetPath);
|
|
36
|
+
} else if (entry.isFile()) {
|
|
37
|
+
await fs.copyFile(sourcePath, targetPath);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|