brainforge-ai 1.0.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/LICENSE +21 -0
- package/README.md +254 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +47 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/dashboard.d.ts +2 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +46 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +90 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +203 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/updateDashboard.d.ts +2 -0
- package/dist/commands/updateDashboard.d.ts.map +1 -0
- package/dist/commands/updateDashboard.js +31 -0
- package/dist/commands/updateDashboard.js.map +1 -0
- package/dist/core/config.d.ts +25 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +52 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/dashboard.d.ts +25 -0
- package/dist/core/dashboard.d.ts.map +1 -0
- package/dist/core/dashboard.js +76 -0
- package/dist/core/dashboard.js.map +1 -0
- package/dist/core/dashboardTemplate.d.ts +3 -0
- package/dist/core/dashboardTemplate.d.ts.map +1 -0
- package/dist/core/dashboardTemplate.js +324 -0
- package/dist/core/dashboardTemplate.js.map +1 -0
- package/dist/core/fileSystem.d.ts +3 -0
- package/dist/core/fileSystem.d.ts.map +1 -0
- package/dist/core/fileSystem.js +468 -0
- package/dist/core/fileSystem.js.map +1 -0
- package/dist/core/git.d.ts +6 -0
- package/dist/core/git.d.ts.map +1 -0
- package/dist/core/git.js +63 -0
- package/dist/core/git.js.map +1 -0
- package/dist/core/templates.d.ts +5 -0
- package/dist/core/templates.d.ts.map +1 -0
- package/dist/core/templates.js +1065 -0
- package/dist/core/templates.js.map +1 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +17 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 BrainForge
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# ⚡ BrainForge
|
|
2
|
+
|
|
3
|
+
> Transform any idea into a structured, AI-assisted project — with agents, slash commands, a phase roadmap, persistent memory, and a live HTML dashboard.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx brainforge-ai init
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What is BrainForge?
|
|
12
|
+
|
|
13
|
+
BrainForge is a CLI that installs a complete **structured AI development system** into any project directory.
|
|
14
|
+
|
|
15
|
+
It gives you:
|
|
16
|
+
|
|
17
|
+
- **8 specialized AI agents** (Architect, Coder, Reviewer, Researcher, Planner, Teacher, Git Agent, Dashboard Agent)
|
|
18
|
+
- **15 slash commands** (`/start-project`, `/create-roadmap`, `/execute-phase`, `/humanize-code`, `/professor-check`…)
|
|
19
|
+
- **Project memory** (architecture, coding style, known bugs, glossary, decisions)
|
|
20
|
+
- **Phase-based roadmap** with validation checklists
|
|
21
|
+
- **HTML dashboard** showing progress, commits, bugs, and decisions
|
|
22
|
+
- **Git checkpoints** (local only — never pushes)
|
|
23
|
+
- **Multi-AI compatibility** files (Claude Code, Codex, Gemini CLI, OpenCode, Cursor)
|
|
24
|
+
- **Code Level Engine** (beginner / intermediate / academic-realistic / professional)
|
|
25
|
+
|
|
26
|
+
### Who is it for?
|
|
27
|
+
|
|
28
|
+
- Students building school or PFA projects
|
|
29
|
+
- Beginners doing vibe-coding
|
|
30
|
+
- Developers using Claude Code, Codex, Gemini CLI, Cursor, or Copilot
|
|
31
|
+
- Anyone who wants structure before they start coding
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## The Workflow
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Idea / PRD
|
|
39
|
+
→ /start-project (document the project)
|
|
40
|
+
→ /create-roadmap (break into phases)
|
|
41
|
+
→ /initiate-phase (research + plan)
|
|
42
|
+
→ /execute-phase (code only what's planned)
|
|
43
|
+
→ /review-phase (quality check)
|
|
44
|
+
→ /checkpoint (local git commit)
|
|
45
|
+
→ /update-dashboard (refresh the dashboard)
|
|
46
|
+
→ repeat per phase
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Rule:** The AI never codes without a plan. Always plan before executing.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Installation & Usage
|
|
54
|
+
|
|
55
|
+
### Option 1 — Run directly with npx (no install)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx brainforge-ai init
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Option 2 — Global install
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install -g brainforge-ai
|
|
65
|
+
brainforge init
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Option 3 — Local development / npm link
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
git clone https://github.com/yourusername/brainforge-ai
|
|
72
|
+
cd brainforge-ai
|
|
73
|
+
npm install
|
|
74
|
+
npm run build
|
|
75
|
+
npm link
|
|
76
|
+
brainforge init
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## CLI Commands
|
|
82
|
+
|
|
83
|
+
| Command | Description |
|
|
84
|
+
|---------|-------------|
|
|
85
|
+
| `brainforge init` | Initialize BrainForge in the current directory |
|
|
86
|
+
| `brainforge doctor` | Health check — verify all files and dependencies |
|
|
87
|
+
| `brainforge dashboard` | Open the HTML dashboard in your browser |
|
|
88
|
+
| `brainforge update-dashboard` | Refresh dashboard data from current project state |
|
|
89
|
+
| `brainforge version` | Show version info |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Generated Structure
|
|
94
|
+
|
|
95
|
+
After `brainforge init`, your project will contain:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
.brainforge/
|
|
99
|
+
config.json ← project configuration
|
|
100
|
+
project.md ← project definition
|
|
101
|
+
questions.md ← Q&A from init
|
|
102
|
+
decisions.md ← architecture decisions log
|
|
103
|
+
roadmap.md ← full phase roadmap
|
|
104
|
+
memory/
|
|
105
|
+
architecture.md ← technical architecture notes
|
|
106
|
+
coding-style.md ← code level rules
|
|
107
|
+
known-bugs.md ← bug tracker
|
|
108
|
+
glossary.md ← project vocabulary
|
|
109
|
+
design-system.md ← UI/UX guidelines
|
|
110
|
+
phases/
|
|
111
|
+
phase-01.md ← phase plan + checklist
|
|
112
|
+
phase-02.md
|
|
113
|
+
agents/
|
|
114
|
+
architect.md ← Architect agent instructions
|
|
115
|
+
researcher.md
|
|
116
|
+
planner.md
|
|
117
|
+
coder.md
|
|
118
|
+
reviewer.md
|
|
119
|
+
teacher.md
|
|
120
|
+
git-agent.md
|
|
121
|
+
dashboard-agent.md
|
|
122
|
+
commands/
|
|
123
|
+
start-project.md ← /start-project slash command
|
|
124
|
+
create-roadmap.md
|
|
125
|
+
initiate-phase.md
|
|
126
|
+
execute-phase.md
|
|
127
|
+
review-phase.md
|
|
128
|
+
humanize-code.md
|
|
129
|
+
explain-my-code.md
|
|
130
|
+
professor-check.md
|
|
131
|
+
checkpoint.md
|
|
132
|
+
debug-issue.md
|
|
133
|
+
design-system.md
|
|
134
|
+
generate-docs.md
|
|
135
|
+
generate-report.md
|
|
136
|
+
update-dashboard.md
|
|
137
|
+
dashboard/
|
|
138
|
+
index.html ← visual dashboard
|
|
139
|
+
style.css
|
|
140
|
+
data.json
|
|
141
|
+
AGENTS.md ← instructions for all AI agents
|
|
142
|
+
CLAUDE.md ← Claude Code specific instructions
|
|
143
|
+
GEMINI.md ← Gemini CLI specific instructions
|
|
144
|
+
OPENAI.md ← OpenAI / Codex specific instructions
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Code Level Engine
|
|
150
|
+
|
|
151
|
+
BrainForge adapts the generated and reviewed code to your target level:
|
|
152
|
+
|
|
153
|
+
| Level | Description |
|
|
154
|
+
|-------|-------------|
|
|
155
|
+
| `beginner` | Simple, direct, few files, comments in French |
|
|
156
|
+
| `intermediate` | Clean structure, reusable, good practices |
|
|
157
|
+
| `academic-realistic` | Credible student code — clean but not enterprise-perfect, easy to explain |
|
|
158
|
+
| `professional` | Strict typing, tests, security, scalable architecture |
|
|
159
|
+
|
|
160
|
+
The `academic-realistic` level is especially useful for school projects — it produces code that's professional enough to pass but natural enough to explain in an oral defense.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Slash Commands Reference
|
|
165
|
+
|
|
166
|
+
| Command | Purpose |
|
|
167
|
+
|---------|---------|
|
|
168
|
+
| `/start-project` | Document your idea, gather project info |
|
|
169
|
+
| `/create-roadmap` | Break project into phases (Epic > Feature > Task) |
|
|
170
|
+
| `/initiate-phase N` | Research + plan phase N before coding |
|
|
171
|
+
| `/execute-phase N` | Implement phase N following the plan |
|
|
172
|
+
| `/review-phase N` | Code review for quality and level-appropriateness |
|
|
173
|
+
| `/humanize-code` | Adapt code to match the user's real level |
|
|
174
|
+
| `/explain-my-code` | Generate an explanation for professors or teams |
|
|
175
|
+
| `/professor-check` | Detect code that looks "too AI-generated" |
|
|
176
|
+
| `/checkpoint` | Local git commit (never pushes) |
|
|
177
|
+
| `/debug-issue` | Systematic bug analysis and fix |
|
|
178
|
+
| `/design-system` | Create UI/UX design system |
|
|
179
|
+
| `/generate-docs` | Generate README and docs/ |
|
|
180
|
+
| `/generate-report` | Generate academic report template |
|
|
181
|
+
| `/update-dashboard` | Refresh the HTML dashboard |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Stack
|
|
186
|
+
|
|
187
|
+
Built with:
|
|
188
|
+
|
|
189
|
+
- **Node.js** + **TypeScript**
|
|
190
|
+
- **Commander.js** — CLI framework
|
|
191
|
+
- **Inquirer** — interactive prompts
|
|
192
|
+
- **Chalk** — terminal colors
|
|
193
|
+
- **Ora** — spinners
|
|
194
|
+
- **simple-git** — Git operations
|
|
195
|
+
- **fs-extra** — file system utilities
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Development
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Install dependencies
|
|
203
|
+
npm install
|
|
204
|
+
|
|
205
|
+
# Build TypeScript
|
|
206
|
+
npm run build
|
|
207
|
+
|
|
208
|
+
# Run in dev mode (ts-node)
|
|
209
|
+
npm run dev -- init
|
|
210
|
+
|
|
211
|
+
# Link globally for local testing
|
|
212
|
+
npm link
|
|
213
|
+
brainforge init
|
|
214
|
+
|
|
215
|
+
# Unlink
|
|
216
|
+
npm unlink
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Publishing to npm
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Make sure you're logged in
|
|
225
|
+
npm login
|
|
226
|
+
|
|
227
|
+
# Dry run to check what will be published
|
|
228
|
+
npm publish --dry-run
|
|
229
|
+
|
|
230
|
+
# Publish
|
|
231
|
+
npm publish
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Roadmap
|
|
237
|
+
|
|
238
|
+
- [ ] `brainforge checkpoint` — standalone git checkpoint command
|
|
239
|
+
- [ ] `brainforge phase` — phase management (status, list, activate)
|
|
240
|
+
- [ ] `brainforge memory` — view and search project memory
|
|
241
|
+
- [ ] AI model integration for auto-generating roadmaps
|
|
242
|
+
- [ ] Export report to PDF
|
|
243
|
+
- [ ] VS Code extension
|
|
244
|
+
- [ ] Web-based dashboard with live reload
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## License
|
|
249
|
+
|
|
250
|
+
MIT — feel free to use, modify, and share.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
*Built for students and developers who want structure before they start vibing.*
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const init_1 = require("./commands/init");
|
|
6
|
+
const doctor_1 = require("./commands/doctor");
|
|
7
|
+
const dashboard_1 = require("./commands/dashboard");
|
|
8
|
+
const updateDashboard_1 = require("./commands/updateDashboard");
|
|
9
|
+
const program = new commander_1.Command();
|
|
10
|
+
program
|
|
11
|
+
.name('brainforge')
|
|
12
|
+
.description('Transform any idea into a structured, AI-assisted project with agents, phases, memory, and a dashboard.')
|
|
13
|
+
.version('1.0.0');
|
|
14
|
+
program
|
|
15
|
+
.command('init')
|
|
16
|
+
.description('Initialize BrainForge in the current directory')
|
|
17
|
+
.action(async () => {
|
|
18
|
+
await (0, init_1.initCommand)();
|
|
19
|
+
});
|
|
20
|
+
program
|
|
21
|
+
.command('doctor')
|
|
22
|
+
.description('Check BrainForge health and project status')
|
|
23
|
+
.action(async () => {
|
|
24
|
+
await (0, doctor_1.doctorCommand)();
|
|
25
|
+
});
|
|
26
|
+
program
|
|
27
|
+
.command('dashboard')
|
|
28
|
+
.description('Open the project dashboard in the browser')
|
|
29
|
+
.action(() => {
|
|
30
|
+
(0, dashboard_1.dashboardCommand)();
|
|
31
|
+
});
|
|
32
|
+
program
|
|
33
|
+
.command('update-dashboard')
|
|
34
|
+
.description('Refresh dashboard data from current project state')
|
|
35
|
+
.action(async () => {
|
|
36
|
+
await (0, updateDashboard_1.updateDashboardCommand)();
|
|
37
|
+
});
|
|
38
|
+
program
|
|
39
|
+
.command('version')
|
|
40
|
+
.description('Show version information')
|
|
41
|
+
.action(() => {
|
|
42
|
+
console.log('brainforge-ai v1.0.0');
|
|
43
|
+
console.log('Node:', process.version);
|
|
44
|
+
console.log('Platform:', process.platform);
|
|
45
|
+
});
|
|
46
|
+
program.parse(process.argv);
|
|
47
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @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O,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,IAAI,IAAI,CAmCvC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.dashboardCommand = dashboardCommand;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const config_1 = require("../core/config");
|
|
10
|
+
const logger_1 = require("../utils/logger");
|
|
11
|
+
function dashboardCommand() {
|
|
12
|
+
const cwd = process.cwd();
|
|
13
|
+
if (!(0, config_1.configExists)(cwd)) {
|
|
14
|
+
logger_1.logger.error('BrainForge not initialized. Run: brainforge init');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const dashPath = path_1.default.join((0, config_1.getBrainforgeDir)(cwd), 'dashboard', 'index.html');
|
|
18
|
+
const absPath = path_1.default.resolve(dashPath);
|
|
19
|
+
logger_1.logger.title('⚡ BrainForge Dashboard');
|
|
20
|
+
logger_1.logger.divider();
|
|
21
|
+
logger_1.logger.info(`Dashboard: ${absPath}`);
|
|
22
|
+
console.log();
|
|
23
|
+
logger_1.logger.info('Open this file in your browser to view the dashboard.');
|
|
24
|
+
console.log();
|
|
25
|
+
// Try to open in default browser (best-effort)
|
|
26
|
+
try {
|
|
27
|
+
const platform = process.platform;
|
|
28
|
+
if (platform === 'win32') {
|
|
29
|
+
(0, child_process_1.execSync)(`start "" "${absPath}"`, { stdio: 'ignore' });
|
|
30
|
+
logger_1.logger.success('Dashboard opened in browser.');
|
|
31
|
+
}
|
|
32
|
+
else if (platform === 'darwin') {
|
|
33
|
+
(0, child_process_1.execSync)(`open "${absPath}"`, { stdio: 'ignore' });
|
|
34
|
+
logger_1.logger.success('Dashboard opened in browser.');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
(0, child_process_1.execSync)(`xdg-open "${absPath}"`, { stdio: 'ignore' });
|
|
38
|
+
logger_1.logger.success('Dashboard opened in browser.');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
logger_1.logger.warn('Could not auto-open browser. Open manually:');
|
|
43
|
+
console.log(` file://${absPath.replace(/\\/g, '/')}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":";;;;;AAKA,4CAmCC;AAxCD,gDAAwB;AACxB,iDAAyC;AACzC,2CAAgE;AAChE,4CAAyC;AAEzC,SAAgB,gBAAgB;IAC9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,IAAI,CAAC,IAAA,qBAAY,EAAC,GAAG,CAAC,EAAE,CAAC;QACvB,eAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACjE,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,IAAA,yBAAgB,EAAC,GAAG,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;IAC7E,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEvC,eAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACvC,eAAM,CAAC,OAAO,EAAE,C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@@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.doctorCommand = doctorCommand;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const config_1 = require("../core/config");
|
|
9
|
+
const git_1 = require("../core/git");
|
|
10
|
+
const logger_1 = require("../utils/logger");
|
|
11
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
|
+
async function doctorCommand() {
|
|
14
|
+
const cwd = process.cwd();
|
|
15
|
+
const checks = [];
|
|
16
|
+
// Node version
|
|
17
|
+
try {
|
|
18
|
+
const ver = process.version;
|
|
19
|
+
const major = parseInt(ver.slice(1).split('.')[0]);
|
|
20
|
+
checks.push({ label: 'Node.js >= 16', ok: major >= 16, detail: ver });
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
checks.push({ label: 'Node.js', ok: false, detail: 'Could not detect version' });
|
|
24
|
+
}
|
|
25
|
+
// Git availability
|
|
26
|
+
try {
|
|
27
|
+
const ver = (0, child_process_1.execSync)('git --version', { encoding: 'utf8' }).trim();
|
|
28
|
+
checks.push({ label: 'Git available', ok: true, detail: ver });
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
checks.push({ label: 'Git available', ok: false, detail: 'git not found in PATH' });
|
|
32
|
+
}
|
|
33
|
+
// BrainForge initialized
|
|
34
|
+
const initialized = (0, config_1.configExists)(cwd);
|
|
35
|
+
checks.push({ label: '.brainforge/ initialized', ok: initialized });
|
|
36
|
+
if (initialized) {
|
|
37
|
+
// Config valid
|
|
38
|
+
try {
|
|
39
|
+
const config = (0, config_1.readConfig)(cwd);
|
|
40
|
+
checks.push({ label: 'config.json valid', ok: true, detail: `Project: ${config.projectName}` });
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
checks.push({ label: 'config.json valid', ok: false, detail: String(e) });
|
|
44
|
+
}
|
|
45
|
+
// Required directories
|
|
46
|
+
const dirs = ['memory', 'phases', 'agents', 'commands', 'dashboard'];
|
|
47
|
+
for (const dir of dirs) {
|
|
48
|
+
const exists = fs_extra_1.default.existsSync(path_1.default.join(cwd, '.brainforge', dir));
|
|
49
|
+
checks.push({ label: `.brainforge/${dir}/`, ok: exists });
|
|
50
|
+
}
|
|
51
|
+
// Dashboard files
|
|
52
|
+
const dashFiles = ['index.html', 'style.css', 'data.json'];
|
|
53
|
+
for (const f of dashFiles) {
|
|
54
|
+
const exists = fs_extra_1.default.existsSync(path_1.default.join(cwd, '.brainforge', 'dashboard', f));
|
|
55
|
+
checks.push({ label: `dashboard/${f}`, ok: exists });
|
|
56
|
+
}
|
|
57
|
+
// Root files
|
|
58
|
+
const rootFiles = ['AGENTS.md', 'CLAUDE.md'];
|
|
59
|
+
for (const f of rootFiles) {
|
|
60
|
+
const exists = fs_extra_1.default.existsSync(path_1.default.join(cwd, f));
|
|
61
|
+
checks.push({ label: `${f} in root`, ok: exists });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Git repo
|
|
65
|
+
const hasGit = await (0, git_1.isGitRepo)(cwd);
|
|
66
|
+
checks.push({ label: 'Git repository', ok: hasGit });
|
|
67
|
+
// Print results
|
|
68
|
+
logger_1.logger.title('⚡ BrainForge Doctor');
|
|
69
|
+
logger_1.logger.divider();
|
|
70
|
+
console.log();
|
|
71
|
+
let allOk = true;
|
|
72
|
+
for (const check of checks) {
|
|
73
|
+
const icon = check.ok ? '✔' : '✖';
|
|
74
|
+
const color = check.ok ? '\x1b[32m' : '\x1b[31m';
|
|
75
|
+
const reset = '\x1b[0m';
|
|
76
|
+
const detail = check.detail ? ` — ${check.detail}` : '';
|
|
77
|
+
console.log(` ${color}${icon}${reset} ${check.label}${detail}`);
|
|
78
|
+
if (!check.ok)
|
|
79
|
+
allOk = false;
|
|
80
|
+
}
|
|
81
|
+
console.log();
|
|
82
|
+
logger_1.logger.divider();
|
|
83
|
+
if (allOk) {
|
|
84
|
+
logger_1.logger.success('Everything looks good!');
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
logger_1.logger.warn('Some checks failed. Run `brainforge init` if not initialized.');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":";;;;;AAaA,sCAkFC;AA/FD,iDAAyC;AACzC,2CAA0D;AAC1D,qCAAwC;AACxC,4CAAyC;AACzC,wDAA0B;AAC1B,gDAAwB;AAQjB,KAAK,UAAU,aAAa;IACjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,eAAe;IACf,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;QAC5B,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,KAAK,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACxE,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,mBAAmB;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAA,wBAAQ,EAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CA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