@brad-frost-web/eddie-brain 0.32.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 +109 -0
- package/dist/analyze/drift-detector.d.ts +30 -0
- package/dist/analyze/drift-detector.d.ts.map +1 -0
- package/dist/analyze/drift-detector.js +310 -0
- package/dist/analyze/drift-detector.js.map +1 -0
- package/dist/analyze/health-scorer.d.ts +71 -0
- package/dist/analyze/health-scorer.d.ts.map +1 -0
- package/dist/analyze/health-scorer.js +420 -0
- package/dist/analyze/health-scorer.js.map +1 -0
- package/dist/analyze/index.d.ts +11 -0
- package/dist/analyze/index.d.ts.map +1 -0
- package/dist/analyze/index.js +11 -0
- package/dist/analyze/index.js.map +1 -0
- package/dist/analyze/naming-validator.d.ts +99 -0
- package/dist/analyze/naming-validator.d.ts.map +1 -0
- package/dist/analyze/naming-validator.js +430 -0
- package/dist/analyze/naming-validator.js.map +1 -0
- package/dist/analyze/slot-contract-validator.d.ts +68 -0
- package/dist/analyze/slot-contract-validator.d.ts.map +1 -0
- package/dist/analyze/slot-contract-validator.js +232 -0
- package/dist/analyze/slot-contract-validator.js.map +1 -0
- package/dist/analyze/token-validator.d.ts +62 -0
- package/dist/analyze/token-validator.d.ts.map +1 -0
- package/dist/analyze/token-validator.js +348 -0
- package/dist/analyze/token-validator.js.map +1 -0
- package/dist/cli/brain.d.ts +12 -0
- package/dist/cli/brain.d.ts.map +1 -0
- package/dist/cli/brain.js +641 -0
- package/dist/cli/brain.js.map +1 -0
- package/dist/cli/formatters/json.d.ts +15 -0
- package/dist/cli/formatters/json.d.ts.map +1 -0
- package/dist/cli/formatters/json.js +18 -0
- package/dist/cli/formatters/json.js.map +1 -0
- package/dist/cli/formatters/terminal.d.ts +19 -0
- package/dist/cli/formatters/terminal.d.ts.map +1 -0
- package/dist/cli/formatters/terminal.js +125 -0
- package/dist/cli/formatters/terminal.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/data/governance-rules.json +94 -0
- package/dist/governance/audit-log.d.ts +17 -0
- package/dist/governance/audit-log.d.ts.map +1 -0
- package/dist/governance/audit-log.js +44 -0
- package/dist/governance/audit-log.js.map +1 -0
- package/dist/governance/index.d.ts +8 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +8 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/permissions.d.ts +26 -0
- package/dist/governance/permissions.d.ts.map +1 -0
- package/dist/governance/permissions.js +75 -0
- package/dist/governance/permissions.js.map +1 -0
- package/dist/governance/rules-engine.d.ts +24 -0
- package/dist/governance/rules-engine.d.ts.map +1 -0
- package/dist/governance/rules-engine.js +111 -0
- package/dist/governance/rules-engine.js.map +1 -0
- package/dist/governance/trust-manager.d.ts +34 -0
- package/dist/governance/trust-manager.d.ts.map +1 -0
- package/dist/governance/trust-manager.js +148 -0
- package/dist/governance/trust-manager.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge-graph/component-index.d.ts +320 -0
- package/dist/knowledge-graph/component-index.d.ts.map +1 -0
- package/dist/knowledge-graph/component-index.js +1033 -0
- package/dist/knowledge-graph/component-index.js.map +1 -0
- package/dist/knowledge-graph/index.d.ts +134 -0
- package/dist/knowledge-graph/index.d.ts.map +1 -0
- package/dist/knowledge-graph/index.js +249 -0
- package/dist/knowledge-graph/index.js.map +1 -0
- package/dist/knowledge-graph/learning-history.d.ts +77 -0
- package/dist/knowledge-graph/learning-history.d.ts.map +1 -0
- package/dist/knowledge-graph/learning-history.js +187 -0
- package/dist/knowledge-graph/learning-history.js.map +1 -0
- package/dist/knowledge-graph/relationship-map.d.ts +55 -0
- package/dist/knowledge-graph/relationship-map.d.ts.map +1 -0
- package/dist/knowledge-graph/relationship-map.js +238 -0
- package/dist/knowledge-graph/relationship-map.js.map +1 -0
- package/dist/knowledge-graph/token-taxonomy.d.ts +127 -0
- package/dist/knowledge-graph/token-taxonomy.d.ts.map +1 -0
- package/dist/knowledge-graph/token-taxonomy.js +357 -0
- package/dist/knowledge-graph/token-taxonomy.js.map +1 -0
- package/dist/loop/fix-agent.d.ts +55 -0
- package/dist/loop/fix-agent.d.ts.map +1 -0
- package/dist/loop/fix-agent.js +344 -0
- package/dist/loop/fix-agent.js.map +1 -0
- package/dist/loop/index.d.ts +8 -0
- package/dist/loop/index.d.ts.map +1 -0
- package/dist/loop/index.js +8 -0
- package/dist/loop/index.js.map +1 -0
- package/dist/loop/issue-fetcher.d.ts +51 -0
- package/dist/loop/issue-fetcher.d.ts.map +1 -0
- package/dist/loop/issue-fetcher.js +188 -0
- package/dist/loop/issue-fetcher.js.map +1 -0
- package/dist/loop/observer.d.ts +42 -0
- package/dist/loop/observer.d.ts.map +1 -0
- package/dist/loop/observer.js +220 -0
- package/dist/loop/observer.js.map +1 -0
- package/dist/loop/pacer.d.ts +44 -0
- package/dist/loop/pacer.d.ts.map +1 -0
- package/dist/loop/pacer.js +90 -0
- package/dist/loop/pacer.js.map +1 -0
- package/dist/loop/reporter.d.ts +9 -0
- package/dist/loop/reporter.d.ts.map +1 -0
- package/dist/loop/reporter.js +119 -0
- package/dist/loop/reporter.js.map +1 -0
- package/dist/loop/runner.d.ts +57 -0
- package/dist/loop/runner.d.ts.map +1 -0
- package/dist/loop/runner.js +390 -0
- package/dist/loop/runner.js.map +1 -0
- package/dist/loop/types.d.ts +151 -0
- package/dist/loop/types.d.ts.map +1 -0
- package/dist/loop/types.js +22 -0
- package/dist/loop/types.js.map +1 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +12 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +618 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/pipeline/agent-runner.d.ts +34 -0
- package/dist/pipeline/agent-runner.d.ts.map +1 -0
- package/dist/pipeline/agent-runner.js +323 -0
- package/dist/pipeline/agent-runner.js.map +1 -0
- package/dist/pipeline/agents/accessibility-auditor.d.ts +10 -0
- package/dist/pipeline/agents/accessibility-auditor.d.ts.map +1 -0
- package/dist/pipeline/agents/accessibility-auditor.js +69 -0
- package/dist/pipeline/agents/accessibility-auditor.js.map +1 -0
- package/dist/pipeline/agents/code-reviewer.d.ts +10 -0
- package/dist/pipeline/agents/code-reviewer.d.ts.map +1 -0
- package/dist/pipeline/agents/code-reviewer.js +75 -0
- package/dist/pipeline/agents/code-reviewer.js.map +1 -0
- package/dist/pipeline/agents/code-writer.d.ts +10 -0
- package/dist/pipeline/agents/code-writer.d.ts.map +1 -0
- package/dist/pipeline/agents/code-writer.js +103 -0
- package/dist/pipeline/agents/code-writer.js.map +1 -0
- package/dist/pipeline/agents/component-architect.d.ts +13 -0
- package/dist/pipeline/agents/component-architect.d.ts.map +1 -0
- package/dist/pipeline/agents/component-architect.js +81 -0
- package/dist/pipeline/agents/component-architect.js.map +1 -0
- package/dist/pipeline/agents/index.d.ts +16 -0
- package/dist/pipeline/agents/index.d.ts.map +1 -0
- package/dist/pipeline/agents/index.js +24 -0
- package/dist/pipeline/agents/index.js.map +1 -0
- package/dist/pipeline/agents/library-researcher.d.ts +12 -0
- package/dist/pipeline/agents/library-researcher.d.ts.map +1 -0
- package/dist/pipeline/agents/library-researcher.js +85 -0
- package/dist/pipeline/agents/library-researcher.js.map +1 -0
- package/dist/pipeline/agents/quality-gate.d.ts +9 -0
- package/dist/pipeline/agents/quality-gate.d.ts.map +1 -0
- package/dist/pipeline/agents/quality-gate.js +71 -0
- package/dist/pipeline/agents/quality-gate.js.map +1 -0
- package/dist/pipeline/agents/spec-analyst.d.ts +10 -0
- package/dist/pipeline/agents/spec-analyst.d.ts.map +1 -0
- package/dist/pipeline/agents/spec-analyst.js +72 -0
- package/dist/pipeline/agents/spec-analyst.js.map +1 -0
- package/dist/pipeline/agents/story-author.d.ts +9 -0
- package/dist/pipeline/agents/story-author.d.ts.map +1 -0
- package/dist/pipeline/agents/story-author.js +65 -0
- package/dist/pipeline/agents/story-author.js.map +1 -0
- package/dist/pipeline/artifact-store.d.ts +27 -0
- package/dist/pipeline/artifact-store.d.ts.map +1 -0
- package/dist/pipeline/artifact-store.js +77 -0
- package/dist/pipeline/artifact-store.js.map +1 -0
- package/dist/pipeline/conversational-gate.d.ts +26 -0
- package/dist/pipeline/conversational-gate.d.ts.map +1 -0
- package/dist/pipeline/conversational-gate.js +122 -0
- package/dist/pipeline/conversational-gate.js.map +1 -0
- package/dist/pipeline/index.d.ts +14 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +17 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/iteration-tracker.d.ts +29 -0
- package/dist/pipeline/iteration-tracker.d.ts.map +1 -0
- package/dist/pipeline/iteration-tracker.js +102 -0
- package/dist/pipeline/iteration-tracker.js.map +1 -0
- package/dist/pipeline/learning-bridge.d.ts +37 -0
- package/dist/pipeline/learning-bridge.d.ts.map +1 -0
- package/dist/pipeline/learning-bridge.js +118 -0
- package/dist/pipeline/learning-bridge.js.map +1 -0
- package/dist/pipeline/orchestrator.d.ts +45 -0
- package/dist/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/pipeline/orchestrator.js +473 -0
- package/dist/pipeline/orchestrator.js.map +1 -0
- package/dist/pipeline/templates/architecture.d.ts +27 -0
- package/dist/pipeline/templates/architecture.d.ts.map +1 -0
- package/dist/pipeline/templates/architecture.js +111 -0
- package/dist/pipeline/templates/architecture.js.map +1 -0
- package/dist/pipeline/templates/brief.d.ts +22 -0
- package/dist/pipeline/templates/brief.d.ts.map +1 -0
- package/dist/pipeline/templates/brief.js +121 -0
- package/dist/pipeline/templates/brief.js.map +1 -0
- package/dist/pipeline/templates/component-rules.d.ts +25 -0
- package/dist/pipeline/templates/component-rules.d.ts.map +1 -0
- package/dist/pipeline/templates/component-rules.js +93 -0
- package/dist/pipeline/templates/component-rules.js.map +1 -0
- package/dist/pipeline/templates/index.d.ts +9 -0
- package/dist/pipeline/templates/index.d.ts.map +1 -0
- package/dist/pipeline/templates/index.js +7 -0
- package/dist/pipeline/templates/index.js.map +1 -0
- package/dist/pipeline/tool-handler.d.ts +25 -0
- package/dist/pipeline/tool-handler.d.ts.map +1 -0
- package/dist/pipeline/tool-handler.js +392 -0
- package/dist/pipeline/tool-handler.js.map +1 -0
- package/dist/pipeline/types.d.ts +146 -0
- package/dist/pipeline/types.d.ts.map +1 -0
- package/dist/pipeline/types.js +27 -0
- package/dist/pipeline/types.js.map +1 -0
- package/dist/plan/action-types.d.ts +31 -0
- package/dist/plan/action-types.d.ts.map +1 -0
- package/dist/plan/action-types.js +83 -0
- package/dist/plan/action-types.js.map +1 -0
- package/dist/plan/decision-engine.d.ts +57 -0
- package/dist/plan/decision-engine.d.ts.map +1 -0
- package/dist/plan/decision-engine.js +162 -0
- package/dist/plan/decision-engine.js.map +1 -0
- package/dist/plan/index.d.ts +6 -0
- package/dist/plan/index.d.ts.map +1 -0
- package/dist/plan/index.js +6 -0
- package/dist/plan/index.js.map +1 -0
- package/dist/types.d.ts +351 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +26 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/anthropic.d.ts +15 -0
- package/dist/utils/anthropic.d.ts.map +1 -0
- package/dist/utils/anthropic.js +40 -0
- package/dist/utils/anthropic.js.map +1 -0
- package/dist/utils/id.d.ts +8 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +14 -0
- package/dist/utils/id.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-validator.js","sourceRoot":"","sources":["../../src/analyze/token-validator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;A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BACV,EAAE,EAAE,kBAAkB,KAAK,EAAE;oBAC7B,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,SAAS;oBACnB,OAAO,EAAE,UAAU,KAAK,kBAAkB,aAAa,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,YAAY,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;oBACxH,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,KAAK;oBACb,QAAQ,EAAE,kCAAkC;oBAC5C,WAAW,EAAE,KAAK;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Eddie's Brain — Main CLI Entry Point
|
|
4
|
+
*
|
|
5
|
+
* Command-line interface for the agentic intelligence layer of the Eddie Design System.
|
|
6
|
+
* Provides commands for knowledge graph initialization, validation, health scoring, and planning.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Main CLI program
|
|
10
|
+
*/
|
|
11
|
+
export declare function main(): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=brain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain.d.ts","sourceRoot":"","sources":["../../src/cli/brain.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AA4oBH;;GAEG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAkG1C"}
|
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Eddie's Brain — Main CLI Entry Point
|
|
4
|
+
*
|
|
5
|
+
* Command-line interface for the agentic intelligence layer of the Eddie Design System.
|
|
6
|
+
* Provides commands for knowledge graph initialization, validation, health scoring, and planning.
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'commander';
|
|
9
|
+
import { resolve } from 'path';
|
|
10
|
+
import { existsSync, readFileSync } from 'fs';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
import chokidar from 'chokidar';
|
|
13
|
+
import fg from 'fast-glob';
|
|
14
|
+
const { glob } = fg;
|
|
15
|
+
import { KnowledgeGraph } from '../knowledge-graph/index.js';
|
|
16
|
+
import { TokenValidator, NamingValidator, HealthScorer } from '../analyze/index.js';
|
|
17
|
+
import { AuditLog } from '../governance/index.js';
|
|
18
|
+
import { DEFAULT_CONFIG } from '../types.js';
|
|
19
|
+
import { PipelineOrchestrator } from '../pipeline/orchestrator.js';
|
|
20
|
+
import { DEFAULT_PIPELINE_CONFIG } from '../pipeline/types.js';
|
|
21
|
+
import { LoopRunner, DEFAULT_LOOP_CONFIG } from '../loop/index.js';
|
|
22
|
+
import { formatHealthReport, formatIssues, formatAuditLog } from './formatters/terminal.js';
|
|
23
|
+
import { formatHealthReportJSON } from './formatters/json.js';
|
|
24
|
+
const BRAIN_DIR = '.eddie-brain';
|
|
25
|
+
/**
|
|
26
|
+
* Print the Eddie's Brain banner
|
|
27
|
+
*/
|
|
28
|
+
function printBanner() {
|
|
29
|
+
console.log(chalk.magenta.bold('\n🧠 Eddie\'s Brain\n'));
|
|
30
|
+
console.log(chalk.gray('Agentic intelligence for the Eddie Design System\n'));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Load or create config
|
|
34
|
+
*/
|
|
35
|
+
function loadConfig(rootDir) {
|
|
36
|
+
const configPath = resolve(rootDir, BRAIN_DIR, 'config.json');
|
|
37
|
+
if (existsSync(configPath)) {
|
|
38
|
+
try {
|
|
39
|
+
const data = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
40
|
+
return { ...DEFAULT_CONFIG, ...data };
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
console.warn(chalk.yellow('⚠️ Could not load config, using defaults'));
|
|
44
|
+
return { ...DEFAULT_CONFIG, rootDir };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { ...DEFAULT_CONFIG, rootDir };
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Initialize the knowledge graph by scanning the monorepo
|
|
51
|
+
*/
|
|
52
|
+
async function handleInit(options) {
|
|
53
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
54
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
55
|
+
console.log(chalk.blue(`Initializing knowledge graph at ${brainDirPath}...`));
|
|
56
|
+
try {
|
|
57
|
+
const graph = new KnowledgeGraph();
|
|
58
|
+
await graph.init(rootDir);
|
|
59
|
+
const summary = graph.getSummary();
|
|
60
|
+
console.log(chalk.green('✓ Knowledge graph built successfully'));
|
|
61
|
+
console.log('');
|
|
62
|
+
console.log(chalk.bold('Summary:'));
|
|
63
|
+
console.log(` Components: ${summary.components.total}`);
|
|
64
|
+
console.log(` Atoms: ${summary.components.byAtomicLevel.atoms}`);
|
|
65
|
+
console.log(` Molecules: ${summary.components.byAtomicLevel.molecules}`);
|
|
66
|
+
console.log(` Organisms: ${summary.components.byAtomicLevel.organisms}`);
|
|
67
|
+
console.log(` Recipe components: ${summary.components.byAtomicLevel.recipes}`);
|
|
68
|
+
console.log(` Pages: ${summary.components.byAtomicLevel.pages}`);
|
|
69
|
+
console.log('');
|
|
70
|
+
console.log(` Tokens: ${summary.tokens.total}`);
|
|
71
|
+
console.log(` Themes: ${summary.tokens.themes.join(', ')}`);
|
|
72
|
+
console.log(` Definition tier: ${summary.tokens.byTier.definition}`);
|
|
73
|
+
console.log(` Usage tier: ${summary.tokens.byTier.usage}`);
|
|
74
|
+
console.log(` Component tier: ${summary.tokens.byTier.component}`);
|
|
75
|
+
console.log('');
|
|
76
|
+
console.log(` Composition recipes: ${summary.recipes.total}`);
|
|
77
|
+
console.log(` Canonical: ${summary.recipes.canonical}`);
|
|
78
|
+
console.log(` Candidate: ${summary.recipes.candidate}`);
|
|
79
|
+
console.log(` Deprecated: ${summary.recipes.deprecated}`);
|
|
80
|
+
console.log('');
|
|
81
|
+
console.log(` Learning entries: ${summary.learning.total}`);
|
|
82
|
+
console.log('');
|
|
83
|
+
await graph.save(brainDirPath);
|
|
84
|
+
console.log(chalk.green(`✓ Saved to ${brainDirPath}`));
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
console.error(chalk.red(`✗ Initialization failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Scan a path for violations
|
|
93
|
+
*/
|
|
94
|
+
async function handleScan(path, options) {
|
|
95
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
96
|
+
const scanPath = path ? resolve(rootDir, path) : rootDir;
|
|
97
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
98
|
+
console.log(chalk.blue(`Scanning ${scanPath}...`));
|
|
99
|
+
try {
|
|
100
|
+
// Load knowledge graph for token validation
|
|
101
|
+
let graph = null;
|
|
102
|
+
if (existsSync(brainDirPath)) {
|
|
103
|
+
graph = await KnowledgeGraph.load(brainDirPath);
|
|
104
|
+
}
|
|
105
|
+
// Find all TS and SCSS files
|
|
106
|
+
const tsFiles = await glob('**/*.ts', {
|
|
107
|
+
cwd: scanPath,
|
|
108
|
+
ignore: ['node_modules/**', 'dist/**'],
|
|
109
|
+
});
|
|
110
|
+
const scssFiles = await glob('**/*.scss', {
|
|
111
|
+
cwd: scanPath,
|
|
112
|
+
ignore: ['node_modules/**', 'dist/**'],
|
|
113
|
+
});
|
|
114
|
+
const allFiles = [...tsFiles, ...scssFiles].map((f) => resolve(scanPath, f));
|
|
115
|
+
// Run validators
|
|
116
|
+
const tokenValidator = new TokenValidator();
|
|
117
|
+
const namingValidator = new NamingValidator();
|
|
118
|
+
const allIssues = [];
|
|
119
|
+
for (const file of allFiles) {
|
|
120
|
+
try {
|
|
121
|
+
if (file.endsWith('.scss')) {
|
|
122
|
+
const issues = await tokenValidator.validateFile(file, graph?.tokenTaxonomy);
|
|
123
|
+
allIssues.push(...issues);
|
|
124
|
+
}
|
|
125
|
+
else if (file.endsWith('.ts')) {
|
|
126
|
+
const issues = await namingValidator.validateFile(file);
|
|
127
|
+
allIssues.push(...issues);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
// Skip files that can't be validated
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (allIssues.length === 0) {
|
|
135
|
+
console.log(chalk.green('✓ No violations found'));
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
console.log(formatIssues(allIssues));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
console.error(chalk.red(`✗ Scan failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Run full health report
|
|
148
|
+
*/
|
|
149
|
+
async function handleHealth(options) {
|
|
150
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
151
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
152
|
+
console.log(chalk.blue('Generating health report...'));
|
|
153
|
+
try {
|
|
154
|
+
// Load knowledge graph
|
|
155
|
+
if (!existsSync(brainDirPath)) {
|
|
156
|
+
console.error(chalk.red('✗ Knowledge graph not initialized. Run "eddie-brain init" first.'));
|
|
157
|
+
process.exit(1);
|
|
158
|
+
}
|
|
159
|
+
const graph = await KnowledgeGraph.load(brainDirPath);
|
|
160
|
+
const config = loadConfig(rootDir);
|
|
161
|
+
// Score health
|
|
162
|
+
const scorer = new HealthScorer(graph, config);
|
|
163
|
+
const report = await scorer.scoreAll();
|
|
164
|
+
// Filter by category if specified
|
|
165
|
+
if (options.category) {
|
|
166
|
+
const filtered = report.categories.filter((c) => c.category === options.category);
|
|
167
|
+
if (filtered.length === 0) {
|
|
168
|
+
console.error(chalk.red(`Unknown category: ${options.category}`));
|
|
169
|
+
process.exit(1);
|
|
170
|
+
}
|
|
171
|
+
report.categories = filtered;
|
|
172
|
+
}
|
|
173
|
+
// Output
|
|
174
|
+
if (options.format === 'json') {
|
|
175
|
+
console.log(formatHealthReportJSON(report));
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
console.log(formatHealthReport(report));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
console.error(chalk.red(`✗ Health check failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Validate a file or directory
|
|
188
|
+
*/
|
|
189
|
+
async function handleValidate(filePath, options) {
|
|
190
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
191
|
+
const targetPath = resolve(rootDir, filePath);
|
|
192
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
193
|
+
console.log(chalk.blue(`Validating ${targetPath}...`));
|
|
194
|
+
try {
|
|
195
|
+
// Load knowledge graph for token validation
|
|
196
|
+
let graph = null;
|
|
197
|
+
if (existsSync(brainDirPath)) {
|
|
198
|
+
graph = await KnowledgeGraph.load(brainDirPath);
|
|
199
|
+
}
|
|
200
|
+
const tokenValidator = new TokenValidator();
|
|
201
|
+
const namingValidator = new NamingValidator();
|
|
202
|
+
const allIssues = [];
|
|
203
|
+
// Get files to validate
|
|
204
|
+
let filesToCheck = [];
|
|
205
|
+
if (existsSync(targetPath)) {
|
|
206
|
+
const stats = await import('fs').then((m) => m.promises.stat(targetPath));
|
|
207
|
+
if (stats.isDirectory()) {
|
|
208
|
+
filesToCheck = await glob('**/*.{ts,scss}', {
|
|
209
|
+
cwd: targetPath,
|
|
210
|
+
ignore: ['node_modules/**', 'dist/**'],
|
|
211
|
+
}).then((files) => files.map((f) => resolve(targetPath, f)));
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
filesToCheck = [targetPath];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
console.error(chalk.red(`✗ Path not found: ${targetPath}`));
|
|
219
|
+
process.exit(1);
|
|
220
|
+
}
|
|
221
|
+
// Validate each file
|
|
222
|
+
for (const file of filesToCheck) {
|
|
223
|
+
try {
|
|
224
|
+
if (file.endsWith('.scss')) {
|
|
225
|
+
const issues = await tokenValidator.validateFile(file, graph?.tokenTaxonomy);
|
|
226
|
+
allIssues.push(...issues);
|
|
227
|
+
}
|
|
228
|
+
else if (file.endsWith('.ts')) {
|
|
229
|
+
const issues = await namingValidator.validateFile(file);
|
|
230
|
+
allIssues.push(...issues);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
// Skip files that can't be validated
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (allIssues.length === 0) {
|
|
238
|
+
console.log(chalk.green('✓ No violations found'));
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
console.log(formatIssues(allIssues));
|
|
242
|
+
if (options.fix) {
|
|
243
|
+
const config = loadConfig(rootDir);
|
|
244
|
+
// Check trust level
|
|
245
|
+
if (config.trustLevel === 'L1_INTERN') {
|
|
246
|
+
console.log(chalk.yellow('\n⚠️ Current trust level (L1_INTERN) does not permit auto-fix. Escalating for review.'));
|
|
247
|
+
}
|
|
248
|
+
else if (config.autoFix) {
|
|
249
|
+
console.log(chalk.blue('\nApplying fixes...'));
|
|
250
|
+
console.log(chalk.green('✓ Fixes applied (simulated)'));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
catch (err) {
|
|
256
|
+
console.error(chalk.red(`✗ Validation failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
257
|
+
process.exit(1);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Suggest components and tokens for an intent
|
|
262
|
+
*/
|
|
263
|
+
async function handleCompose(intent, options) {
|
|
264
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
265
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
266
|
+
console.log(chalk.blue(`Finding recipes for intent: "${intent}"`));
|
|
267
|
+
console.log('');
|
|
268
|
+
try {
|
|
269
|
+
if (!existsSync(brainDirPath)) {
|
|
270
|
+
console.error(chalk.red('✗ Knowledge graph not initialized. Run "eddie-brain init" first.'));
|
|
271
|
+
process.exit(1);
|
|
272
|
+
}
|
|
273
|
+
const graph = await KnowledgeGraph.load(brainDirPath);
|
|
274
|
+
// Search for recipes matching the intent
|
|
275
|
+
const results = graph.search(intent);
|
|
276
|
+
if (results.components.length === 0 && results.recipes.length === 0) {
|
|
277
|
+
console.log(chalk.yellow(`No components or recipes found for "${intent}"`));
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
if (results.components.length > 0) {
|
|
281
|
+
console.log(chalk.bold('Components:'));
|
|
282
|
+
for (const comp of results.components) {
|
|
283
|
+
console.log(` ${chalk.cyan(comp.tagName)} — ${comp.intent}`);
|
|
284
|
+
}
|
|
285
|
+
console.log('');
|
|
286
|
+
}
|
|
287
|
+
if (results.recipes.length > 0) {
|
|
288
|
+
console.log(chalk.bold('Recipes:'));
|
|
289
|
+
for (const recipe of results.recipes) {
|
|
290
|
+
console.log(` ${chalk.magenta(recipe.name)} — ${recipe.intent}`);
|
|
291
|
+
console.log(` Status: ${recipe.status}`);
|
|
292
|
+
for (const comp of recipe.components) {
|
|
293
|
+
console.log(` - ${comp.tagName} (${comp.role})`);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
console.log('');
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
console.error(chalk.red(`✗ Compose failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
301
|
+
process.exit(1);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Show the audit log
|
|
306
|
+
*/
|
|
307
|
+
async function handleAudit(options) {
|
|
308
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
309
|
+
const auditFilePath = resolve(rootDir, BRAIN_DIR, 'audit.json');
|
|
310
|
+
try {
|
|
311
|
+
if (!existsSync(auditFilePath)) {
|
|
312
|
+
console.log(chalk.yellow('No audit log found. Run some commands first.'));
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const auditLog = AuditLog.load(auditFilePath);
|
|
316
|
+
let entries = auditLog.getAll();
|
|
317
|
+
// Filter by date if specified
|
|
318
|
+
if (options.since) {
|
|
319
|
+
entries = auditLog.getSince(options.since);
|
|
320
|
+
}
|
|
321
|
+
console.log(formatAuditLog(entries));
|
|
322
|
+
}
|
|
323
|
+
catch (err) {
|
|
324
|
+
console.error(chalk.red(`✗ Audit failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
325
|
+
process.exit(1);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Watch for changes and validate
|
|
330
|
+
*/
|
|
331
|
+
async function handleWatch(options) {
|
|
332
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
333
|
+
const packagesDir = resolve(rootDir, 'packages');
|
|
334
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
335
|
+
console.log(chalk.blue('Watching for changes...'));
|
|
336
|
+
console.log(chalk.gray(`Watching: ${packagesDir}`));
|
|
337
|
+
console.log(chalk.gray('Press Ctrl+C to stop\n'));
|
|
338
|
+
// Load knowledge graph for token validation
|
|
339
|
+
let graph = null;
|
|
340
|
+
if (existsSync(brainDirPath)) {
|
|
341
|
+
graph = await KnowledgeGraph.load(brainDirPath);
|
|
342
|
+
}
|
|
343
|
+
const watcher = chokidar.watch(packagesDir, {
|
|
344
|
+
ignored: ['node_modules', 'dist', '.git'],
|
|
345
|
+
persistent: true,
|
|
346
|
+
});
|
|
347
|
+
const tokenValidator = new TokenValidator();
|
|
348
|
+
const namingValidator = new NamingValidator();
|
|
349
|
+
watcher.on('change', async (filePath) => {
|
|
350
|
+
if (!filePath.endsWith('.ts') && !filePath.endsWith('.scss')) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
console.log(`\n${chalk.gray('Changes detected in')} ${filePath}`);
|
|
354
|
+
try {
|
|
355
|
+
const issues = [];
|
|
356
|
+
if (filePath.endsWith('.scss')) {
|
|
357
|
+
const styleIssues = await tokenValidator.validateFile(filePath, graph?.tokenTaxonomy);
|
|
358
|
+
issues.push(...styleIssues);
|
|
359
|
+
}
|
|
360
|
+
else if (filePath.endsWith('.ts')) {
|
|
361
|
+
const nameIssues = await namingValidator.validateFile(filePath);
|
|
362
|
+
issues.push(...nameIssues);
|
|
363
|
+
}
|
|
364
|
+
if (issues.length === 0) {
|
|
365
|
+
console.log(chalk.green('✓ No issues'));
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
console.log(formatIssues(issues));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
catch (err) {
|
|
372
|
+
console.error(chalk.red(`Error validating: ${err instanceof Error ? err.message : String(err)}`));
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
watcher.on('error', (error) => {
|
|
376
|
+
console.error(chalk.red(`Watcher error: ${error}`));
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Resolve API key from env var or .env file at repo root
|
|
381
|
+
*/
|
|
382
|
+
function resolveApiKey(rootDir) {
|
|
383
|
+
let apiKey = process.env.ANTHROPIC_API_KEY;
|
|
384
|
+
if (!apiKey) {
|
|
385
|
+
const envPath = resolve(rootDir, '.env');
|
|
386
|
+
if (existsSync(envPath)) {
|
|
387
|
+
const envContent = readFileSync(envPath, 'utf-8');
|
|
388
|
+
const match = /^ANTHROPIC_API_KEY=(.+)$/m.exec(envContent);
|
|
389
|
+
if (match) {
|
|
390
|
+
apiKey = match[1].trim();
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (!apiKey) {
|
|
395
|
+
console.error(chalk.red('✗ ANTHROPIC_API_KEY not found.'));
|
|
396
|
+
console.error(chalk.gray(' Set it via environment variable or add ANTHROPIC_API_KEY=sk-ant-... to .env at the repo root.'));
|
|
397
|
+
process.exit(1);
|
|
398
|
+
}
|
|
399
|
+
return apiKey;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Run the multi-agent component pipeline
|
|
403
|
+
*/
|
|
404
|
+
async function handlePipelineRun(brief, options) {
|
|
405
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
406
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
407
|
+
const apiKey = resolveApiKey(rootDir);
|
|
408
|
+
// Derive component name from brief if not provided
|
|
409
|
+
const componentName = options.name || `ed-${brief.split(/\s+/).slice(0, 3).join('-').toLowerCase().replace(/[^a-z0-9-]/g, '')}`;
|
|
410
|
+
// Load knowledge graph
|
|
411
|
+
if (!existsSync(brainDirPath)) {
|
|
412
|
+
console.error(chalk.red('✗ Knowledge graph not initialized. Run "eddie-brain init" first.'));
|
|
413
|
+
process.exit(1);
|
|
414
|
+
}
|
|
415
|
+
const graph = await KnowledgeGraph.load(brainDirPath);
|
|
416
|
+
const pipelineConfig = {
|
|
417
|
+
apiKey,
|
|
418
|
+
model: options.model || DEFAULT_PIPELINE_CONFIG.model,
|
|
419
|
+
rootDir,
|
|
420
|
+
outputDir: resolve(rootDir, options.output || DEFAULT_PIPELINE_CONFIG.outputDir),
|
|
421
|
+
interactive: options.interactive !== false,
|
|
422
|
+
diminishingReturnsThreshold: DEFAULT_PIPELINE_CONFIG.diminishingReturnsThreshold,
|
|
423
|
+
};
|
|
424
|
+
const orchestrator = new PipelineOrchestrator(pipelineConfig, graph);
|
|
425
|
+
const state = await orchestrator.run(brief, componentName);
|
|
426
|
+
if (state.status === 'failed') {
|
|
427
|
+
process.exit(1);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Resume a paused pipeline
|
|
432
|
+
*/
|
|
433
|
+
async function handlePipelineResume(stateId, options) {
|
|
434
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
435
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
436
|
+
const apiKey = resolveApiKey(rootDir);
|
|
437
|
+
if (!existsSync(brainDirPath)) {
|
|
438
|
+
console.error(chalk.red('✗ Knowledge graph not initialized.'));
|
|
439
|
+
process.exit(1);
|
|
440
|
+
}
|
|
441
|
+
const graph = await KnowledgeGraph.load(brainDirPath);
|
|
442
|
+
const pipelineConfig = {
|
|
443
|
+
apiKey,
|
|
444
|
+
model: DEFAULT_PIPELINE_CONFIG.model,
|
|
445
|
+
rootDir,
|
|
446
|
+
outputDir: DEFAULT_PIPELINE_CONFIG.outputDir,
|
|
447
|
+
interactive: !options.approve,
|
|
448
|
+
diminishingReturnsThreshold: DEFAULT_PIPELINE_CONFIG.diminishingReturnsThreshold,
|
|
449
|
+
};
|
|
450
|
+
const orchestrator = new PipelineOrchestrator(pipelineConfig, graph);
|
|
451
|
+
const gateDecision = options.approve ? { approved: true } : undefined;
|
|
452
|
+
const state = await orchestrator.resume(stateId, gateDecision);
|
|
453
|
+
if (state.status === 'failed') {
|
|
454
|
+
process.exit(1);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Show pipeline status
|
|
459
|
+
*/
|
|
460
|
+
async function handlePipelineStatus(stateId, options) {
|
|
461
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
462
|
+
const pipelinesDir = resolve(rootDir, BRAIN_DIR, 'pipelines');
|
|
463
|
+
if (!existsSync(pipelinesDir)) {
|
|
464
|
+
console.log(chalk.yellow('No pipelines found.'));
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
if (stateId) {
|
|
468
|
+
// Show specific pipeline
|
|
469
|
+
const statePath = resolve(pipelinesDir, stateId, 'state.json');
|
|
470
|
+
if (!existsSync(statePath)) {
|
|
471
|
+
console.error(chalk.red(`Pipeline not found: ${stateId}`));
|
|
472
|
+
process.exit(1);
|
|
473
|
+
}
|
|
474
|
+
const state = JSON.parse(readFileSync(statePath, 'utf-8'));
|
|
475
|
+
console.log(chalk.bold(`Pipeline: ${state.id}`));
|
|
476
|
+
console.log(` Component: ${state.componentName}`);
|
|
477
|
+
console.log(` Status: ${state.status}`);
|
|
478
|
+
console.log(` Phase: ${state.currentPhase}`);
|
|
479
|
+
console.log(` Started: ${state.startedAt}`);
|
|
480
|
+
console.log(` Completed: ${state.completedAt || 'N/A'}`);
|
|
481
|
+
console.log('');
|
|
482
|
+
console.log(chalk.bold(' Agents:'));
|
|
483
|
+
for (const [id, agent] of Object.entries(state.agents)) {
|
|
484
|
+
const statusColor = agent.status === 'completed' ? chalk.green
|
|
485
|
+
: agent.status === 'failed' ? chalk.red
|
|
486
|
+
: agent.status === 'gated' ? chalk.yellow
|
|
487
|
+
: chalk.gray;
|
|
488
|
+
console.log(` ${statusColor(agent.status.padEnd(10))} ${id}${agent.error ? chalk.red(` (${agent.error})`) : ''}`);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
// List all pipelines
|
|
493
|
+
const { readdirSync } = await import('fs');
|
|
494
|
+
const dirs = readdirSync(pipelinesDir, { withFileTypes: true })
|
|
495
|
+
.filter(d => d.isDirectory());
|
|
496
|
+
if (dirs.length === 0) {
|
|
497
|
+
console.log(chalk.yellow('No pipelines found.'));
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
console.log(chalk.bold('Pipelines:\n'));
|
|
501
|
+
for (const dir of dirs) {
|
|
502
|
+
const statePath = resolve(pipelinesDir, dir.name, 'state.json');
|
|
503
|
+
if (existsSync(statePath)) {
|
|
504
|
+
const state = JSON.parse(readFileSync(statePath, 'utf-8'));
|
|
505
|
+
const statusColor = state.status === 'completed' ? chalk.green
|
|
506
|
+
: state.status === 'failed' ? chalk.red
|
|
507
|
+
: state.status === 'gated' ? chalk.yellow
|
|
508
|
+
: chalk.gray;
|
|
509
|
+
console.log(` ${statusColor(state.status.padEnd(10))} ${state.id.slice(0, 8)} ${state.componentName} ${state.startedAt}`);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Run the autonomous improvement loop
|
|
516
|
+
*/
|
|
517
|
+
async function handleLoop(options) {
|
|
518
|
+
const rootDir = resolve(options.root || process.cwd());
|
|
519
|
+
const brainDirPath = resolve(rootDir, BRAIN_DIR);
|
|
520
|
+
printBanner();
|
|
521
|
+
const apiKey = resolveApiKey(rootDir);
|
|
522
|
+
// Load knowledge graph
|
|
523
|
+
if (!existsSync(brainDirPath)) {
|
|
524
|
+
console.error(chalk.red('✗ Knowledge graph not initialized. Run "eddie-brain init" first.'));
|
|
525
|
+
process.exit(1);
|
|
526
|
+
}
|
|
527
|
+
const graph = await KnowledgeGraph.load(brainDirPath);
|
|
528
|
+
const enabledTypes = (options.types || 'A')
|
|
529
|
+
.split(',')
|
|
530
|
+
.map(t => t.trim().toUpperCase())
|
|
531
|
+
.filter(t => ['A', 'B', 'C', 'D'].includes(t));
|
|
532
|
+
const loopConfig = {
|
|
533
|
+
apiKey,
|
|
534
|
+
model: DEFAULT_LOOP_CONFIG.model,
|
|
535
|
+
rootDir,
|
|
536
|
+
maxHours: parseFloat(options.hours || '4'),
|
|
537
|
+
enabledTypes,
|
|
538
|
+
branch: options.branch,
|
|
539
|
+
createPr: options.pr === true,
|
|
540
|
+
dryRun: options.dryRun === true,
|
|
541
|
+
resume: options.resume === true,
|
|
542
|
+
issuesPerLap: parseInt(options.issuesPerLap || '5', 10),
|
|
543
|
+
chunkSize: parseInt(options.chunkSize || '7', 10),
|
|
544
|
+
};
|
|
545
|
+
const runner = new LoopRunner(loopConfig, graph);
|
|
546
|
+
await runner.run();
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Main CLI program
|
|
550
|
+
*/
|
|
551
|
+
export async function main() {
|
|
552
|
+
printBanner();
|
|
553
|
+
const program = new Command();
|
|
554
|
+
program
|
|
555
|
+
.name('eddie-brain')
|
|
556
|
+
.description('Agentic intelligence for the Eddie Design System')
|
|
557
|
+
.version('0.19.1');
|
|
558
|
+
program.option('--root <path>', 'Root directory of the Eddie monorepo', process.cwd());
|
|
559
|
+
// init command
|
|
560
|
+
program
|
|
561
|
+
.command('init')
|
|
562
|
+
.description('Initialize the knowledge graph by scanning the monorepo')
|
|
563
|
+
.action(() => handleInit(program.opts()));
|
|
564
|
+
// scan command
|
|
565
|
+
program
|
|
566
|
+
.command('scan [path]')
|
|
567
|
+
.description('Scan a path for naming and token violations')
|
|
568
|
+
.action((path) => handleScan(path, program.opts()));
|
|
569
|
+
// health command
|
|
570
|
+
program
|
|
571
|
+
.command('health')
|
|
572
|
+
.description('Generate a full health report')
|
|
573
|
+
.option('--category <name>', 'Filter by category (tokens, naming, coverage, documentation, accessibility, consistency)')
|
|
574
|
+
.option('--format <format>', 'Output format (terminal, json)', 'terminal')
|
|
575
|
+
.action((cmdOpts) => handleHealth({ ...cmdOpts, ...program.opts() }));
|
|
576
|
+
// validate command
|
|
577
|
+
program
|
|
578
|
+
.command('validate <path>')
|
|
579
|
+
.description('Validate a specific file or directory')
|
|
580
|
+
.option('--fix', 'Auto-fix issues if trust level permits')
|
|
581
|
+
.action((path, cmdOpts) => handleValidate(path, { ...cmdOpts, ...program.opts() }));
|
|
582
|
+
// compose command
|
|
583
|
+
program
|
|
584
|
+
.command('compose <intent>')
|
|
585
|
+
.description('Find components and recipes for a given intent')
|
|
586
|
+
.action((intent) => handleCompose(intent, program.opts()));
|
|
587
|
+
// audit command
|
|
588
|
+
program
|
|
589
|
+
.command('audit')
|
|
590
|
+
.description('Show the audit log')
|
|
591
|
+
.option('--since <date>', 'Show entries since this date (ISO 8601)')
|
|
592
|
+
.action((cmdOpts) => handleAudit({ ...cmdOpts, ...program.opts() }));
|
|
593
|
+
// watch command
|
|
594
|
+
program
|
|
595
|
+
.command('watch')
|
|
596
|
+
.description('Watch for file changes and validate continuously')
|
|
597
|
+
.action(() => handleWatch(program.opts()));
|
|
598
|
+
// pipeline command group
|
|
599
|
+
const pipelineCmd = program
|
|
600
|
+
.command('pipeline')
|
|
601
|
+
.description('Multi-agent component generation pipeline');
|
|
602
|
+
pipelineCmd
|
|
603
|
+
.command('run <brief>')
|
|
604
|
+
.description('Run the full pipeline from a text brief')
|
|
605
|
+
.option('--name <name>', 'Target component name (e.g., "ed-progress-bar")')
|
|
606
|
+
.option('--output <dir>', 'Output directory', DEFAULT_PIPELINE_CONFIG.outputDir)
|
|
607
|
+
.option('--model <model>', 'Anthropic model', DEFAULT_PIPELINE_CONFIG.model)
|
|
608
|
+
.option('--no-interactive', 'Skip conversational gates (auto-approve)')
|
|
609
|
+
.action((brief, cmdOpts) => handlePipelineRun(brief, { ...cmdOpts, ...program.opts() }));
|
|
610
|
+
pipelineCmd
|
|
611
|
+
.command('resume <stateId>')
|
|
612
|
+
.description('Resume a pipeline paused at a conversational gate')
|
|
613
|
+
.option('--approve', 'Auto-approve the gate')
|
|
614
|
+
.action((stateId, cmdOpts) => handlePipelineResume(stateId, { ...cmdOpts, ...program.opts() }));
|
|
615
|
+
pipelineCmd
|
|
616
|
+
.command('status [stateId]')
|
|
617
|
+
.description('Show pipeline status')
|
|
618
|
+
.action((stateId, cmdOpts) => handlePipelineStatus(stateId, { ...program.opts() }));
|
|
619
|
+
// loop command
|
|
620
|
+
program
|
|
621
|
+
.command('loop')
|
|
622
|
+
.description('Run autonomous improvement loop (fixes violations, tests fidelity)')
|
|
623
|
+
.option('--hours <n>', 'Maximum runtime in hours', '4')
|
|
624
|
+
.option('--types <types>', 'Comma-separated lap types: A (fix), B (fidelity)', 'A')
|
|
625
|
+
.option('--branch <name>', 'Git branch name')
|
|
626
|
+
.option('--pr', 'Create a PR at the end')
|
|
627
|
+
.option('--dry-run', 'Show plan without executing')
|
|
628
|
+
.option('--resume', 'Resume from saved state')
|
|
629
|
+
.option('--issues-per-lap <n>', 'Issues to fix per lap', '5')
|
|
630
|
+
.option('--chunk-size <n>', 'Fixes per PR (0 = single PR at end)', '7')
|
|
631
|
+
.action((cmdOpts) => handleLoop({ ...cmdOpts, ...program.opts() }));
|
|
632
|
+
await program.parseAsync(process.argv);
|
|
633
|
+
}
|
|
634
|
+
// Run if executed directly
|
|
635
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
636
|
+
main().catch((err) => {
|
|
637
|
+
console.error(chalk.red(`Fatal error: ${err instanceof Error ? err.message : String(err)}`));
|
|
638
|
+
process.exit(1);
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
//# sourceMappingURL=brain.js.map
|