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.
Files changed (87) hide show
  1. package/README.md +112 -151
  2. package/assets/agents/00-AGENT_INDEX.md +1 -1
  3. package/assets/code-patterns/clerk-middleware.ts +138 -0
  4. package/assets/code-patterns/prisma-schema.prisma +224 -0
  5. package/assets/code-patterns/rls-policies.sql +246 -0
  6. package/assets/code-patterns/server-actions.ts +191 -0
  7. package/assets/code-patterns/trpc-router.ts +258 -0
  8. package/assets/cursor-rules/13-ai-integration.mdc +155 -0
  9. package/assets/cursor-rules/14-server-components.mdc +81 -0
  10. package/assets/cursor-rules/15-server-actions.mdc +102 -0
  11. package/assets/cursor-rules/16-edge-middleware.mdc +105 -0
  12. package/assets/cursor-rules/17-streaming-ssr.mdc +138 -0
  13. package/assets/docs/LAUNCH-POSTS.md +1 -1
  14. package/assets/docs/QUICK-REFERENCE.md +9 -4
  15. package/assets/docs/VISION-V2.md +1 -1
  16. package/assets/hooks/pre-commit +98 -0
  17. package/assets/saas-plan/04-Imp-Template.md +1 -1
  18. package/bin/ultra-dex.js +132 -4
  19. package/lib/commands/advanced.js +471 -0
  20. package/lib/commands/agent-builder.js +226 -0
  21. package/lib/commands/agents.js +102 -42
  22. package/lib/commands/auto-implement.js +68 -0
  23. package/lib/commands/banner.js +43 -21
  24. package/lib/commands/build.js +78 -183
  25. package/lib/commands/ci-monitor.js +84 -0
  26. package/lib/commands/config.js +207 -0
  27. package/lib/commands/dashboard.js +770 -0
  28. package/lib/commands/diff.js +233 -0
  29. package/lib/commands/doctor.js +416 -0
  30. package/lib/commands/export.js +408 -0
  31. package/lib/commands/fix.js +96 -0
  32. package/lib/commands/generate.js +105 -78
  33. package/lib/commands/hooks.js +251 -76
  34. package/lib/commands/init.js +102 -54
  35. package/lib/commands/memory.js +80 -0
  36. package/lib/commands/plan.js +82 -0
  37. package/lib/commands/review.js +34 -5
  38. package/lib/commands/run.js +233 -0
  39. package/lib/commands/scaffold.js +151 -0
  40. package/lib/commands/serve.js +179 -146
  41. package/lib/commands/state.js +327 -0
  42. package/lib/commands/swarm.js +306 -0
  43. package/lib/commands/sync.js +82 -23
  44. package/lib/commands/team.js +275 -0
  45. package/lib/commands/upgrade.js +190 -0
  46. package/lib/commands/validate.js +34 -0
  47. package/lib/commands/verify.js +81 -0
  48. package/lib/commands/watch.js +79 -0
  49. package/lib/config/theme.js +47 -0
  50. package/lib/mcp/graph.js +92 -0
  51. package/lib/mcp/memory.js +95 -0
  52. package/lib/mcp/resources.js +152 -0
  53. package/lib/mcp/server.js +34 -0
  54. package/lib/mcp/tools.js +481 -0
  55. package/lib/mcp/websocket.js +117 -0
  56. package/lib/providers/index.js +49 -4
  57. package/lib/providers/ollama.js +136 -0
  58. package/lib/providers/router.js +63 -0
  59. package/lib/quality/scanner.js +128 -0
  60. package/lib/swarm/coordinator.js +97 -0
  61. package/lib/swarm/index.js +598 -0
  62. package/lib/swarm/protocol.js +677 -0
  63. package/lib/swarm/tiers.js +485 -0
  64. package/lib/templates/code/clerk-middleware.ts +138 -0
  65. package/lib/templates/code/prisma-schema.prisma +224 -0
  66. package/lib/templates/code/rls-policies.sql +246 -0
  67. package/lib/templates/code/server-actions.ts +191 -0
  68. package/lib/templates/code/trpc-router.ts +258 -0
  69. package/lib/templates/custom-agent.md +10 -0
  70. package/lib/themes/doomsday.js +229 -0
  71. package/lib/ui/index.js +5 -0
  72. package/lib/ui/interface.js +241 -0
  73. package/lib/ui/spinners.js +116 -0
  74. package/lib/ui/theme.js +183 -0
  75. package/lib/utils/agents.js +32 -0
  76. package/lib/utils/files.js +14 -0
  77. package/lib/utils/graph.js +108 -0
  78. package/lib/utils/help.js +64 -0
  79. package/lib/utils/messages.js +35 -0
  80. package/lib/utils/progress.js +24 -0
  81. package/lib/utils/prompts.js +47 -0
  82. package/lib/utils/spinners.js +46 -0
  83. package/lib/utils/status.js +31 -0
  84. package/lib/utils/tables.js +41 -0
  85. package/lib/utils/theme-state.js +9 -0
  86. package/lib/utils/version-display.js +32 -0
  87. package/package.json +31 -13
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Graph Utility (CPG Implementation)
3
+ * Manages the Code Property Graph (CPG) for architectural memory
4
+ */
5
+
6
+ import fs from 'fs/promises';
7
+ import path from 'path';
8
+ import { glob } from 'glob';
9
+
10
+ /**
11
+ * Build a simple Code Property Graph (CPG)
12
+ * Maps files, functions, and dependencies
13
+ */
14
+ export async function buildGraph() {
15
+ const files = await glob('**/*.{js,ts,jsx,tsx}', {
16
+ ignore: ['node_modules/**', '.git/**', 'dist/**', 'build/**'],
17
+ nodir: true
18
+ });
19
+
20
+ const graph = {
21
+ nodes: [],
22
+ edges: [],
23
+ lastUpdated: new Date().toISOString()
24
+ };
25
+
26
+ for (const file of files) {
27
+ try {
28
+ const content = await fs.readFile(file, 'utf8');
29
+ const fileNode = {
30
+ id: file,
31
+ type: 'file',
32
+ path: file,
33
+ exports: [],
34
+ imports: []
35
+ };
36
+
37
+ // Naive parsing using Regex (Phase 2.1)
38
+ // In Phase 2.2+ this would use tree-sitter
39
+
40
+ // Extract imports
41
+ const importRegex = /import\s+.*?\s+from\s+['"](.+?)['"]/g;
42
+ let match;
43
+ while ((match = importRegex.exec(content)) !== null) {
44
+ fileNode.imports.push(match[1]);
45
+ graph.edges.push({
46
+ source: file,
47
+ target: match[1],
48
+ type: 'depends_on'
49
+ });
50
+ }
51
+
52
+ // Extract function declarations
53
+ const funcRegex = /(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z0-9_]+)/g;
54
+ while ((match = funcRegex.exec(content)) !== null) {
55
+ const funcName = match[1];
56
+ const funcId = `${file}:${funcName}`;
57
+ graph.nodes.push({
58
+ id: funcId,
59
+ type: 'function',
60
+ name: funcName,
61
+ parent: file
62
+ });
63
+ graph.edges.push({
64
+ source: funcId,
65
+ target: file,
66
+ type: 'contained_in'
67
+ });
68
+ fileNode.exports.push(funcName);
69
+ }
70
+
71
+ graph.nodes.push(fileNode);
72
+ } catch (e) {
73
+ // Skip files that can't be read
74
+ }
75
+ }
76
+
77
+ return graph;
78
+ }
79
+
80
+ /**
81
+ * Find the impact of changing a file
82
+ * @param {Object} graph - The CPG
83
+ * @param {string} filePath - The file being changed
84
+ */
85
+ export function getImpactAnalysis(graph, filePath) {
86
+ const impactedBy = graph.edges
87
+ .filter(edge => edge.target === filePath || filePath.endsWith(edge.target))
88
+ .map(edge => edge.source);
89
+
90
+ return [...new Set(impactedBy)];
91
+ }
92
+
93
+ /**
94
+ * Find structural truth (exact subgraph)
95
+ * @param {Object} graph - The CPG
96
+ * @param {string} query - Symbol name
97
+ */
98
+ export function queryGraph(graph, query) {
99
+ return graph.nodes.filter(node =>
100
+ node.id.includes(query) || (node.name && node.name === query)
101
+ );
102
+ }
103
+
104
+ export default {
105
+ buildGraph,
106
+ getImpactAnalysis,
107
+ queryGraph
108
+ };
@@ -0,0 +1,64 @@
1
+ import chalk from 'chalk';
2
+ import gradient from 'gradient-string';
3
+ import { isDoomsdayMode } from './theme-state.js';
4
+ import { showHelp as showDoomsdayHelp } from '../themes/doomsday.js';
5
+
6
+ const ultraGradient = gradient(['#6366f1', '#8b5cf6', '#d946ef']);
7
+
8
+ export function showHelp() {
9
+ if (isDoomsdayMode()) {
10
+ return showDoomsdayHelp();
11
+ }
12
+
13
+ console.log('');
14
+ console.log(ultraGradient(' ═══════════════════════════════════════════════'));
15
+ console.log(ultraGradient(' ║ U L T R A - D E X : O R C H E S T R A T I O N'));
16
+ console.log(ultraGradient(' ═══════════════════════════════════════════════'));
17
+ console.log('');
18
+
19
+ const sections = [
20
+ {
21
+ title: '🚀 PROJECT SETUP',
22
+ commands: [
23
+ ['init', 'Initialize new project'],
24
+ ['generate', 'Generate implementation plan'],
25
+ ['swarm', 'Run agent pipeline']
26
+ ]
27
+ },
28
+ {
29
+ title: '🛡️ QUALITY & DEFENSE',
30
+ commands: [
31
+ ['review', 'Run code review'],
32
+ ['validate', 'Check project integrity'],
33
+ ['hooks', 'Install git hooks']
34
+ ]
35
+ },
36
+ {
37
+ title: '⚡ ACTIVE KERNEL',
38
+ commands: [
39
+ ['serve', 'Start MCP server & dashboard'],
40
+ ['dashboard', 'Open web dashboard'],
41
+ ['agents', 'List available agents']
42
+ ]
43
+ },
44
+ {
45
+ title: '📦 DEPLOYMENT',
46
+ commands: [
47
+ ['build', 'Execute next task'],
48
+ ['deploy', 'Deploy application'],
49
+ ['doctor', 'System diagnostics']
50
+ ]
51
+ }
52
+ ];
53
+
54
+ sections.forEach(section => {
55
+ console.log(` ${chalk.hex('#8b5cf6').bold(section.title)}`);
56
+ section.commands.forEach(([cmd, desc]) => {
57
+ console.log(` ${chalk.hex('#6366f1')(cmd.padEnd(16))} ${chalk.dim(desc)}`);
58
+ });
59
+ console.log('');
60
+ });
61
+
62
+ console.log(chalk.dim(' "AI Orchestration Meta-Layer for Professional SaaS Development"'));
63
+ console.log('');
64
+ }
@@ -0,0 +1,35 @@
1
+ // cli/lib/utils/messages.js
2
+ export const professionalMessages = {
3
+ start: [
4
+ "AI Orchestration initialized. Ready for mission.",
5
+ "Analyzing project graph for optimal path...",
6
+ "System check complete. Starting task execution.",
7
+ "Leveraging 16 specialized agents for development."
8
+ ],
9
+
10
+ success: [
11
+ "✓ Task completed successfully. Alignment verified.",
12
+ "✓ System integrity confirmed. Code merged.",
13
+ "✓ Orchestration successful. Results saved.",
14
+ "✓ Professional SaaS standards achieved."
15
+ ],
16
+
17
+ error: [
18
+ "✕ Task failed. Analyzing logs for recovery...",
19
+ "✕ System anomaly detected. Diagnostic required.",
20
+ "✕ Orchestration interrupted. Please check configuration.",
21
+ "✕ Quality gate failed. Refactoring recommended."
22
+ ],
23
+
24
+ loading: [
25
+ "Initializing agent pipeline...",
26
+ "Scanning project context...",
27
+ "Optimizing orchestration logic...",
28
+ "Verifying system state..."
29
+ ]
30
+ };
31
+
32
+ export function getRandomMessage(type) {
33
+ const messages = professionalMessages[type];
34
+ return messages[Math.floor(Math.random() * messages.length)];
35
+ }
@@ -0,0 +1,24 @@
1
+ import chalk from 'chalk';
2
+ import ora from 'ora';
3
+
4
+ export function showProgress(tasks) {
5
+ const total = tasks.length;
6
+ console.log('');
7
+ console.log(chalk.hex('#8b5cf6').bold(' ⚡ EXECUTING TASKS...'));
8
+ console.log('');
9
+
10
+ tasks.forEach((task, idx) => {
11
+ // Simple vertical list for now
12
+ console.log(` ${chalk.hex('#d946ef')('►')} ${task}`);
13
+ });
14
+ console.log('');
15
+ }
16
+
17
+ export function progressBar(current, total, width = 40) {
18
+ const percentage = Math.round((current / total) * 100);
19
+ const filled = Math.round((current / total) * width);
20
+ const empty = width - filled;
21
+
22
+ const bar = chalk.hex('#6366f1')('█'.repeat(filled)) + chalk.dim('░'.repeat(empty));
23
+ return `${bar} ${chalk.hex('#d946ef')(percentage + '%')}`;
24
+ }
@@ -0,0 +1,47 @@
1
+ import inquirer from 'inquirer';
2
+ import chalk from 'chalk';
3
+ import gradient from 'gradient-string';
4
+
5
+ export async function selectAgent() {
6
+ const agents = [
7
+ { name: '🏛️ CTO - Architecture decisions', value: 'cto' },
8
+ { name: '📋 Planner - Task breakdown', value: 'planner' },
9
+ { name: '🔧 Backend - API & server', value: 'backend' },
10
+ { name: '🎨 Frontend - UI components', value: 'frontend' },
11
+ { name: '💾 Database - Schema & queries', value: 'database' },
12
+ { name: '🔐 Auth - Authentication', value: 'auth' },
13
+ { name: '🛡️ Security - Security review', value: 'security' },
14
+ { name: '📝 Testing - Write tests', value: 'testing' },
15
+ { name: '📖 Docs - Documentation', value: 'documentation' },
16
+ { name: '👀 Reviewer - Code review', value: 'reviewer' }
17
+ ];
18
+ const { agent } = await inquirer.prompt([{
19
+ type: 'list',
20
+ name: 'agent',
21
+ message: gradient(['#6366f1', '#8b5cf6'])('Select an agent:'),
22
+ choices: agents,
23
+ pageSize: 12
24
+ }]);
25
+
26
+ return agent;
27
+ }
28
+
29
+ export async function confirmAction(message) {
30
+ const { confirm } = await inquirer.prompt([{
31
+ type: 'confirm',
32
+ name: 'confirm',
33
+ message: chalk.yellow(message),
34
+ default: false
35
+ }]);
36
+ return confirm;
37
+ }
38
+
39
+ export async function inputText(message, defaultValue = '') {
40
+ const { value } = await inquirer.prompt([{
41
+ type: 'input',
42
+ name: 'value',
43
+ message: chalk.cyan(message),
44
+ default: defaultValue
45
+ }]);
46
+ return value;
47
+ }
@@ -0,0 +1,46 @@
1
+ import ora from 'ora';
2
+ import chalk from 'chalk';
3
+
4
+ const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
5
+
6
+ export function createSpinner(text) {
7
+ return ora({
8
+ text: chalk.cyan(text),
9
+ spinner: {
10
+ interval: 80,
11
+ frames: spinnerFrames
12
+ },
13
+ color: 'magenta'
14
+ });
15
+ }
16
+
17
+ export function success(text) {
18
+ return ora().succeed(chalk.green(text));
19
+ }
20
+
21
+ export function fail(text) {
22
+ return ora().fail(chalk.red(text));
23
+ }
24
+
25
+ export function info(text) {
26
+ return ora().info(chalk.blue(text));
27
+ }
28
+
29
+ export function warn(text) {
30
+ return ora().warn(chalk.yellow(text));
31
+ }
32
+
33
+ // Task list with progress
34
+ export async function runTasks(tasks) {
35
+ for (const task of tasks) {
36
+ const spinner = createSpinner(task.title);
37
+ spinner.start();
38
+ try {
39
+ await task.fn();
40
+ spinner.succeed(chalk.green(task.title));
41
+ } catch (error) {
42
+ spinner.fail(chalk.red(`${task.title}: ${error.message}`));
43
+ throw error;
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,31 @@
1
+ import chalk from 'chalk';
2
+ import figures from 'figures';
3
+
4
+ export const icons = {
5
+ success: chalk.hex('#22c55e')(figures.tick),
6
+ error: chalk.hex('#ef4444')(figures.cross),
7
+ warning: chalk.hex('#f59e0b')(figures.warning),
8
+ info: chalk.hex('#6366f1')(figures.info),
9
+ pending: chalk.hex('#6b7280')(figures.circle),
10
+ running: chalk.hex('#d946ef')(figures.play),
11
+ pointer: chalk.hex('#8b5cf6')(figures.pointer),
12
+ bullet: chalk.dim(figures.bullet)
13
+ };
14
+
15
+ export function showInfinityStatus() {
16
+ // Deprecated function, kept for compatibility if called elsewhere but showing nothing or simple status
17
+ }
18
+
19
+ export function statusLine(icon, text) {
20
+ console.log(` ${icon} ${text}`);
21
+ }
22
+
23
+ export function header(text) {
24
+ console.log('');
25
+ console.log(chalk.bold.hex('#8b5cf6')(` ${text}`));
26
+ console.log(chalk.dim(' ' + '─'.repeat(50)));
27
+ }
28
+
29
+ export function separator() {
30
+ console.log('');
31
+ }
@@ -0,0 +1,41 @@
1
+ import Table from 'cli-table3';
2
+ import chalk from 'chalk';
3
+ import gradient from 'gradient-string';
4
+
5
+ export function createTable(headers, rows) {
6
+ const table = new Table({
7
+ head: headers.map(h => gradient(['#6366f1', '#8b5cf6'])(h)),
8
+ chars: {
9
+ 'top': '─', 'top-mid': '┬', 'top-left': '╭', 'top-right': '╮',
10
+ 'bottom': '─', 'bottom-mid': '┴', 'bottom-left': '╰', 'bottom-right': '╯',
11
+ 'left': '│', 'left-mid': '├', 'mid': '─', 'mid-mid': '┼',
12
+ 'right': '│', 'right-mid': '┤', 'middle': '│'
13
+ },
14
+ style: {
15
+ head: ['magenta'],
16
+ border: ['dim']
17
+ }
18
+ });
19
+
20
+ rows.forEach(row => table.push(row));
21
+ return table.toString();
22
+ }
23
+
24
+ export function showAgentsTable(agents) {
25
+ const headers = ['Tier', 'Agent', 'Status'];
26
+ const rows = agents.map(a => [
27
+ chalk.dim(a.tier || 'N/A'),
28
+ chalk.cyan(a.name),
29
+ a.status === 'ready' ? chalk.green('●') : chalk.yellow('○')
30
+ ]);
31
+ console.log(createTable(headers, rows));
32
+ }
33
+
34
+ export function showCommandsTable(commands) {
35
+ const headers = ['Command', 'Description'];
36
+ const rows = commands.map(c => [
37
+ chalk.cyan(c.name),
38
+ chalk.dim(c.description)
39
+ ]);
40
+ console.log(createTable(headers, rows));
41
+ }
@@ -0,0 +1,9 @@
1
+ export let isDoomsday = false;
2
+
3
+ export function setDoomsdayMode(enabled) {
4
+ isDoomsday = enabled;
5
+ }
6
+
7
+ export function isDoomsdayMode() {
8
+ return isDoomsday;
9
+ }
@@ -0,0 +1,32 @@
1
+ import boxen from 'boxen';
2
+ import chalk from 'chalk';
3
+ import gradient from 'gradient-string';
4
+
5
+ export function showVersionCard() {
6
+ const version = '3.1.0';
7
+ const ultra = gradient(['#6366f1', '#8b5cf6'])('Ultra-Dex');
8
+
9
+ console.log(boxen(
10
+ `${ultra} ${chalk.dim('v')}${chalk.bold.white(version)}
11
+
12
+ ` +
13
+ `${chalk.cyan('◆')} AI Orchestration Meta-Layer
14
+ ` +
15
+ `${chalk.magenta('◆')} 35 Commands • 16 Agents
16
+ ` +
17
+ `${chalk.yellow('◆')} MCP Server • Swarm Mode
18
+
19
+ ` +
20
+ `${chalk.dim('npm install -g ultra-dex')}
21
+ ` +
22
+ `${chalk.dim('github.com/Srujan0798/Ultra-Dex')}`,
23
+ {
24
+ padding: 1,
25
+ margin: 1,
26
+ borderStyle: 'double',
27
+ borderColor: '#8b5cf6',
28
+ title: '🪐 Ultra-Dex',
29
+ titleAlignment: 'center'
30
+ }
31
+ ));
32
+ }
package/package.json CHANGED
@@ -1,20 +1,18 @@
1
1
  {
2
2
  "name": "ultra-dex",
3
- "version": "2.2.1",
4
- "description": "CLI for Ultra-Dex SaaS Implementation Framework with AI-Powered Plan Generation, Build Mode, and Code Review",
3
+ "version": "3.2.0",
4
+ "description": "AI Orchestration Meta-Layer for SaaS Development",
5
5
  "keywords": [
6
- "saas",
7
- "template",
8
- "implementation",
9
- "planning",
10
- "startup",
11
- "framework",
12
6
  "ai",
7
+ "orchestration",
8
+ "saas",
9
+ "mcp",
10
+ "langchain",
13
11
  "claude",
14
12
  "openai",
15
13
  "gemini",
16
- "orchestration",
17
- "mcp"
14
+ "agents",
15
+ "swarm"
18
16
  ],
19
17
  "author": "Srujan Sai Karna",
20
18
  "license": "MIT",
@@ -36,15 +34,35 @@
36
34
  "node": ">=18"
37
35
  },
38
36
  "dependencies": {
37
+ "@modelcontextprotocol/sdk": "^1.25.3",
38
+ "boxen": "^7.1.1",
39
39
  "chalk": "^5.3.0",
40
+ "cli-table3": "^0.6.5",
40
41
  "commander": "^11.1.0",
42
+ "figures": "^6.1.0",
43
+ "glob": "^10.5.0",
44
+ "gradient-string": "^2.0.2",
45
+ "ink": "^4.4.1",
46
+ "ink-spinner": "^5.0.0",
41
47
  "inquirer": "^9.2.12",
42
- "ora": "^8.0.1"
48
+ "listr2": "^8.3.3",
49
+ "ora": "^8.0.1",
50
+ "terminal-link": "^3.0.0",
51
+ "update-notifier": "^7.3.1",
52
+ "ws": "^8.19.0",
53
+ "zod": "^3.25.76"
54
+ },
55
+ "scripts": {
56
+ "test": "node --test test/*.test.js",
57
+ "lint": "eslint lib bin --fix"
43
58
  },
44
59
  "optionalDependencies": {
45
60
  "@anthropic-ai/sdk": "^0.30.0",
46
- "openai": "^4.70.0",
47
61
  "@google/generative-ai": "^0.21.0",
48
- "dotenv": "^16.4.5"
62
+ "dotenv": "^16.4.5",
63
+ "openai": "^4.70.0"
64
+ },
65
+ "devDependencies": {
66
+ "eslint": "^8.57.0"
49
67
  }
50
68
  }