bmalph 2.7.5 → 2.7.6
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 +20 -5
- package/dist/commands/doctor-runtime-checks.js +104 -86
- package/dist/commands/doctor-runtime-checks.js.map +1 -1
- package/dist/installer/bmad-assets.js +182 -0
- package/dist/installer/bmad-assets.js.map +1 -0
- package/dist/installer/commands.js +324 -0
- package/dist/installer/commands.js.map +1 -0
- package/dist/installer/install.js +42 -0
- package/dist/installer/install.js.map +1 -0
- package/dist/installer/metadata.js +56 -0
- package/dist/installer/metadata.js.map +1 -0
- package/dist/installer/project-files.js +169 -0
- package/dist/installer/project-files.js.map +1 -0
- package/dist/installer/ralph-assets.js +91 -0
- package/dist/installer/ralph-assets.js.map +1 -0
- package/dist/installer/template-files.js +168 -0
- package/dist/installer/template-files.js.map +1 -0
- package/dist/installer/types.js +2 -0
- package/dist/installer/types.js.map +1 -0
- package/dist/installer.js +5 -843
- package/dist/installer.js.map +1 -1
- package/dist/transition/artifact-loading.js +91 -0
- package/dist/transition/artifact-loading.js.map +1 -0
- package/dist/transition/context-output.js +85 -0
- package/dist/transition/context-output.js.map +1 -0
- package/dist/transition/fix-plan-sync.js +119 -0
- package/dist/transition/fix-plan-sync.js.map +1 -0
- package/dist/transition/orchestration.js +25 -362
- package/dist/transition/orchestration.js.map +1 -1
- package/dist/transition/specs-sync.js +78 -2
- package/dist/transition/specs-sync.js.map +1 -1
- package/dist/utils/ralph-runtime-state.js +222 -0
- package/dist/utils/ralph-runtime-state.js.map +1 -0
- package/dist/utils/state.js +17 -16
- package/dist/utils/state.js.map +1 -1
- package/dist/utils/validate.js +16 -0
- package/dist/utils/validate.js.map +1 -1
- package/dist/watch/renderer.js +48 -6
- package/dist/watch/renderer.js.map +1 -1
- package/dist/watch/state-reader.js +79 -44
- package/dist/watch/state-reader.js.map +1 -1
- package/package.json +1 -1
- package/ralph/RALPH-REFERENCE.md +33 -13
- package/ralph/drivers/claude-code.sh +25 -0
- package/ralph/drivers/codex.sh +11 -0
- package/ralph/drivers/copilot.sh +11 -0
- package/ralph/drivers/cursor.sh +11 -0
- package/ralph/lib/circuit_breaker.sh +3 -3
- package/ralph/lib/date_utils.sh +28 -9
- package/ralph/lib/response_analyzer.sh +127 -7
- package/ralph/ralph_loop.sh +464 -121
- package/ralph/templates/PROMPT.md +5 -0
- package/ralph/templates/ralphrc.template +14 -4
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { cp, mkdir, readFile, readdir, rm } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { atomicWriteFile } from "../utils/file-system.js";
|
|
4
|
+
import { isEnoent } from "../utils/errors.js";
|
|
5
|
+
import { SKILLS_DIR, SKILLS_PREFIX } from "../utils/constants.js";
|
|
6
|
+
const AGENT_DESCRIPTIONS = {
|
|
7
|
+
analyst: "Research, briefs, discovery",
|
|
8
|
+
architect: "Technical design, architecture",
|
|
9
|
+
pm: "PRDs, epics, stories",
|
|
10
|
+
sm: "Sprint planning, status, coordination",
|
|
11
|
+
dev: "Implementation, coding",
|
|
12
|
+
"ux-designer": "User experience, wireframes",
|
|
13
|
+
qa: "Test automation, quality assurance",
|
|
14
|
+
"tech-writer": "Documentation, technical writing",
|
|
15
|
+
"quick-flow-solo-dev": "Quick one-off tasks, small changes",
|
|
16
|
+
};
|
|
17
|
+
const BMALPH_COMMANDS = {
|
|
18
|
+
bmalph: {
|
|
19
|
+
description: "BMAD master agent — navigate phases",
|
|
20
|
+
howToRun: "Read and follow the master agent instructions in this file",
|
|
21
|
+
},
|
|
22
|
+
"bmalph-implement": {
|
|
23
|
+
description: "Transition planning artifacts to Ralph format",
|
|
24
|
+
howToRun: "Run `bmalph implement`",
|
|
25
|
+
},
|
|
26
|
+
"bmalph-status": {
|
|
27
|
+
description: "Show current phase, Ralph progress, version info",
|
|
28
|
+
howToRun: "Run `bmalph status`",
|
|
29
|
+
},
|
|
30
|
+
"bmalph-upgrade": {
|
|
31
|
+
description: "Update bundled assets to current version",
|
|
32
|
+
howToRun: "Run `bmalph upgrade`",
|
|
33
|
+
},
|
|
34
|
+
"bmalph-doctor": {
|
|
35
|
+
description: "Check project health and report issues",
|
|
36
|
+
howToRun: "Run `bmalph doctor`",
|
|
37
|
+
},
|
|
38
|
+
"bmalph-watch": {
|
|
39
|
+
description: "Launch Ralph live dashboard",
|
|
40
|
+
howToRun: "Run `bmalph run`",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const PHASE_SECTIONS = [
|
|
44
|
+
{ key: "1-analysis", label: "Phase 1: Analysis" },
|
|
45
|
+
{ key: "2-planning", label: "Phase 2: Planning" },
|
|
46
|
+
{ key: "3-solutioning", label: "Phase 3: Solutioning" },
|
|
47
|
+
{ key: "4-implementation", label: "Phase 4: Implementation" },
|
|
48
|
+
{ key: "anytime", label: "Utilities" },
|
|
49
|
+
];
|
|
50
|
+
// CSV column indices for bmad-help.csv
|
|
51
|
+
const CSV_COL_PHASE = 1;
|
|
52
|
+
const CSV_COL_NAME = 2;
|
|
53
|
+
const CSV_COL_WORKFLOW_FILE = 5;
|
|
54
|
+
const CSV_COL_DESCRIPTION = 10;
|
|
55
|
+
const FALLBACK_PHASE = "anytime";
|
|
56
|
+
/** CLI-pointer bmalph commands are all bmalph-* except the master "bmalph" command. */
|
|
57
|
+
function isCliPointer(cmd) {
|
|
58
|
+
return cmd.kind === "bmalph" && cmd.name !== "bmalph";
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parse a CSV row handling double-quoted fields.
|
|
62
|
+
*/
|
|
63
|
+
function parseCsvRow(row) {
|
|
64
|
+
const fields = [];
|
|
65
|
+
let current = "";
|
|
66
|
+
let inQuotes = false;
|
|
67
|
+
for (let i = 0; i < row.length; i++) {
|
|
68
|
+
const ch = row[i];
|
|
69
|
+
if (inQuotes) {
|
|
70
|
+
if (ch === '"') {
|
|
71
|
+
if (i + 1 < row.length && row[i + 1] === '"') {
|
|
72
|
+
current += '"';
|
|
73
|
+
i++;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
inQuotes = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
current += ch;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (ch === '"') {
|
|
84
|
+
inQuotes = true;
|
|
85
|
+
}
|
|
86
|
+
else if (ch === ",") {
|
|
87
|
+
fields.push(current);
|
|
88
|
+
current = "";
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
current += ch;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
fields.push(current);
|
|
95
|
+
return fields;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Deliver slash commands based on the platform's command delivery strategy.
|
|
99
|
+
*
|
|
100
|
+
* - "directory": Copy command files to a directory (e.g., .claude/commands/)
|
|
101
|
+
* - "skills": No-op — commands are generated as skills by generateSkills()
|
|
102
|
+
* - "index": No-op — commands are discoverable via _bmad/COMMANDS.md
|
|
103
|
+
*/
|
|
104
|
+
export async function deliverCommands(projectDir, platform, slashCommandsDir) {
|
|
105
|
+
const delivery = platform.commandDelivery;
|
|
106
|
+
if (delivery.kind !== "directory") {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
const slashFiles = await readdir(slashCommandsDir);
|
|
110
|
+
const bundledCommandNames = new Set(slashFiles.filter((f) => f.endsWith(".md")));
|
|
111
|
+
const commandsDir = join(projectDir, delivery.dir);
|
|
112
|
+
await mkdir(commandsDir, { recursive: true });
|
|
113
|
+
// Clean stale bmalph-owned commands before copying (preserve user-created commands)
|
|
114
|
+
try {
|
|
115
|
+
const existingCommands = await readdir(commandsDir);
|
|
116
|
+
for (const file of existingCommands) {
|
|
117
|
+
if (file.endsWith(".md") && bundledCommandNames.has(file)) {
|
|
118
|
+
await rm(join(commandsDir, file), { force: true });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
if (!isEnoent(err))
|
|
124
|
+
throw err;
|
|
125
|
+
}
|
|
126
|
+
for (const file of bundledCommandNames) {
|
|
127
|
+
await cp(join(slashCommandsDir, file), join(commandsDir, file), { dereference: false });
|
|
128
|
+
}
|
|
129
|
+
return [`${delivery.dir}/`];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Classify all slash commands by reading CSV metadata and file contents.
|
|
133
|
+
* Shared by generateCommandIndex() and generateSkills().
|
|
134
|
+
*/
|
|
135
|
+
export async function classifyCommands(projectDir, slashCmdsDir) {
|
|
136
|
+
const helpCsvPath = join(projectDir, "_bmad/_config/bmad-help.csv");
|
|
137
|
+
const helpCsv = await readFile(helpCsvPath, "utf-8");
|
|
138
|
+
// Parse CSV: build workflow-file → {phase, description} lookup
|
|
139
|
+
const csvLines = helpCsv.trimEnd().split(/\r?\n/);
|
|
140
|
+
const workflowLookup = new Map();
|
|
141
|
+
for (const line of csvLines.slice(1)) {
|
|
142
|
+
if (!line.trim())
|
|
143
|
+
continue;
|
|
144
|
+
const fields = parseCsvRow(line);
|
|
145
|
+
const workflowFile = fields[CSV_COL_WORKFLOW_FILE]?.trim();
|
|
146
|
+
if (workflowFile) {
|
|
147
|
+
workflowLookup.set(workflowFile, {
|
|
148
|
+
phase: fields[CSV_COL_PHASE]?.trim() ?? FALLBACK_PHASE,
|
|
149
|
+
description: fields[CSV_COL_DESCRIPTION]?.trim() ?? fields[CSV_COL_NAME]?.trim() ?? "",
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Read slash command files
|
|
154
|
+
const slashFiles = (await readdir(slashCmdsDir)).filter((f) => f.endsWith(".md")).sort();
|
|
155
|
+
const results = [];
|
|
156
|
+
for (const file of slashFiles) {
|
|
157
|
+
const name = file.replace(/\.md$/, "");
|
|
158
|
+
const body = (await readFile(join(slashCmdsDir, file), "utf-8")).trim();
|
|
159
|
+
const firstLine = body.split("\n")[0].trim();
|
|
160
|
+
// Extract _bmad/ file references from content
|
|
161
|
+
const fileRefs = [...body.matchAll(/`(_bmad\/[^`]+)`/g)].map((m) => m[1]);
|
|
162
|
+
const agentRef = fileRefs.find((ref) => ref.includes("/agents/"));
|
|
163
|
+
const workflowRef = fileRefs.find((ref) => ref.includes("/workflows/") || ref.includes("/tasks/"));
|
|
164
|
+
// Classify: bmalph CLI commands
|
|
165
|
+
if (name.startsWith("bmalph")) {
|
|
166
|
+
const known = BMALPH_COMMANDS[name];
|
|
167
|
+
const desc = known?.description ?? name.replace(/-/g, " ");
|
|
168
|
+
const howToRun = known?.howToRun ?? `Run \`bmalph ${name.replace("bmalph-", "")}\``;
|
|
169
|
+
results.push({
|
|
170
|
+
name,
|
|
171
|
+
description: desc,
|
|
172
|
+
invocation: firstLine,
|
|
173
|
+
body,
|
|
174
|
+
kind: "bmalph",
|
|
175
|
+
howToRun,
|
|
176
|
+
});
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
// Classify: workflow/task commands (matched via CSV)
|
|
180
|
+
if (workflowRef && workflowLookup.has(workflowRef)) {
|
|
181
|
+
const csv = workflowLookup.get(workflowRef);
|
|
182
|
+
results.push({
|
|
183
|
+
name,
|
|
184
|
+
description: csv.description,
|
|
185
|
+
invocation: firstLine,
|
|
186
|
+
body,
|
|
187
|
+
kind: "workflow",
|
|
188
|
+
phase: csv.phase,
|
|
189
|
+
});
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
// Classify: pure agent commands
|
|
193
|
+
if (agentRef && !workflowRef) {
|
|
194
|
+
results.push({
|
|
195
|
+
name,
|
|
196
|
+
description: AGENT_DESCRIPTIONS[name] ?? name,
|
|
197
|
+
invocation: firstLine,
|
|
198
|
+
body,
|
|
199
|
+
kind: "agent",
|
|
200
|
+
});
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
// Fallback: unmatched commands go to utilities
|
|
204
|
+
results.push({
|
|
205
|
+
name,
|
|
206
|
+
description: name.replace(/-/g, " "),
|
|
207
|
+
invocation: firstLine,
|
|
208
|
+
body,
|
|
209
|
+
kind: "utility",
|
|
210
|
+
phase: FALLBACK_PHASE,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return results;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Generate _bmad/COMMANDS.md from pre-classified slash commands.
|
|
217
|
+
* Provides command discoverability for platforms without native slash command support.
|
|
218
|
+
*/
|
|
219
|
+
export async function generateCommandIndex(projectDir, classified) {
|
|
220
|
+
const agents = [];
|
|
221
|
+
const phaseGroups = {};
|
|
222
|
+
const bmalpEntries = [];
|
|
223
|
+
for (const cmd of classified) {
|
|
224
|
+
if (cmd.kind === "bmalph") {
|
|
225
|
+
bmalpEntries.push({
|
|
226
|
+
name: cmd.name,
|
|
227
|
+
description: cmd.description,
|
|
228
|
+
howToRun: cmd.howToRun,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
else if (cmd.kind === "agent") {
|
|
232
|
+
agents.push({ name: cmd.name, description: cmd.description, invocation: cmd.invocation });
|
|
233
|
+
}
|
|
234
|
+
else if (cmd.kind === "workflow") {
|
|
235
|
+
const phase = cmd.phase;
|
|
236
|
+
if (!phaseGroups[phase])
|
|
237
|
+
phaseGroups[phase] = [];
|
|
238
|
+
phaseGroups[phase].push({
|
|
239
|
+
name: cmd.name,
|
|
240
|
+
description: cmd.description,
|
|
241
|
+
invocation: cmd.invocation,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
const phase = cmd.phase ?? FALLBACK_PHASE;
|
|
246
|
+
if (!phaseGroups[phase])
|
|
247
|
+
phaseGroups[phase] = [];
|
|
248
|
+
phaseGroups[phase].push({
|
|
249
|
+
name: cmd.name,
|
|
250
|
+
description: cmd.description,
|
|
251
|
+
invocation: cmd.invocation,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// Build markdown
|
|
256
|
+
const sections = ["# BMAD Commands\n\n> Auto-generated by bmalph. Do not edit.\n"];
|
|
257
|
+
if (agents.length > 0) {
|
|
258
|
+
sections.push(formatCommandTable("Agents", agents));
|
|
259
|
+
}
|
|
260
|
+
for (const { key, label } of PHASE_SECTIONS) {
|
|
261
|
+
const entries = phaseGroups[key];
|
|
262
|
+
if (entries && entries.length > 0) {
|
|
263
|
+
sections.push(formatCommandTable(label, entries));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (bmalpEntries.length > 0) {
|
|
267
|
+
sections.push(formatCommandTable("bmalph CLI", bmalpEntries.map((b) => ({
|
|
268
|
+
name: b.name,
|
|
269
|
+
description: b.description,
|
|
270
|
+
invocation: b.howToRun,
|
|
271
|
+
})), "How to run"));
|
|
272
|
+
}
|
|
273
|
+
await atomicWriteFile(join(projectDir, "_bmad/COMMANDS.md"), sections.join("\n"));
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Generate Codex Skills from pre-classified slash commands.
|
|
277
|
+
* Creates .agents/skills/bmad-<name>/SKILL.md for each non-CLI-pointer command.
|
|
278
|
+
*/
|
|
279
|
+
export async function generateSkills(projectDir, classified) {
|
|
280
|
+
const skillsBaseDir = join(projectDir, SKILLS_DIR);
|
|
281
|
+
// Cleanup: remove existing bmad-* skill directories
|
|
282
|
+
try {
|
|
283
|
+
const existingDirs = await readdir(skillsBaseDir);
|
|
284
|
+
for (const dir of existingDirs) {
|
|
285
|
+
if (dir.startsWith(SKILLS_PREFIX)) {
|
|
286
|
+
await rm(join(skillsBaseDir, dir), { recursive: true, force: true });
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
catch (err) {
|
|
291
|
+
if (!isEnoent(err))
|
|
292
|
+
throw err;
|
|
293
|
+
}
|
|
294
|
+
// Generate skills for non-CLI-pointer commands
|
|
295
|
+
for (const cmd of classified) {
|
|
296
|
+
if (isCliPointer(cmd))
|
|
297
|
+
continue;
|
|
298
|
+
const skillDir = join(skillsBaseDir, `${SKILLS_PREFIX}${cmd.name}`);
|
|
299
|
+
await mkdir(skillDir, { recursive: true });
|
|
300
|
+
const skillContent = `---
|
|
301
|
+
name: ${cmd.name}
|
|
302
|
+
description: >
|
|
303
|
+
${cmd.description}. Use when the user asks about ${cmd.name.replace(/-/g, " ")}.
|
|
304
|
+
metadata:
|
|
305
|
+
managed-by: bmalph
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
${cmd.body}
|
|
309
|
+
`;
|
|
310
|
+
await atomicWriteFile(join(skillDir, "SKILL.md"), skillContent);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
function formatCommandTable(heading, entries, thirdCol = "Invocation") {
|
|
314
|
+
const lines = [
|
|
315
|
+
`## ${heading}\n`,
|
|
316
|
+
`| Command | Description | ${thirdCol} |`,
|
|
317
|
+
"|---------|-------------|------------|",
|
|
318
|
+
];
|
|
319
|
+
for (const e of entries) {
|
|
320
|
+
lines.push(`| ${e.name} | ${e.description} | ${e.invocation} |`);
|
|
321
|
+
}
|
|
322
|
+
return lines.join("\n") + "\n";
|
|
323
|
+
}
|
|
324
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/installer/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAUlE,MAAM,kBAAkB,GAA2B;IACjD,OAAO,EAAE,6BAA6B;IACtC,SAAS,EAAE,gCAAgC;IAC3C,EAAE,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O,IAAI;QACjB,6BAA6B,QAAQ,IAAI;QACzC,wCAAwC;KACzC,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,WAAW,MAAM,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { exists } from "../utils/file-system.js";
|
|
4
|
+
import { STATE_DIR } from "../utils/constants.js";
|
|
5
|
+
import { deliverCommands, generateSkills } from "./commands.js";
|
|
6
|
+
import { installBmadAssets } from "./bmad-assets.js";
|
|
7
|
+
import { getBundledBmadDir, getBundledRalphDir, getDefaultPlatform, getPackageVersion, getSlashCommandsDir, } from "./metadata.js";
|
|
8
|
+
import { updateGitignore } from "./project-files.js";
|
|
9
|
+
import { installRalphAssets } from "./ralph-assets.js";
|
|
10
|
+
export async function copyBundledAssets(projectDir, platform) {
|
|
11
|
+
const p = platform ?? (await getDefaultPlatform());
|
|
12
|
+
const bmadDir = getBundledBmadDir();
|
|
13
|
+
const ralphDir = getBundledRalphDir();
|
|
14
|
+
const slashCommandsDir = getSlashCommandsDir();
|
|
15
|
+
if (!(await exists(bmadDir))) {
|
|
16
|
+
throw new Error(`BMAD source directory not found at ${bmadDir}. Package may be corrupted.`);
|
|
17
|
+
}
|
|
18
|
+
if (!(await exists(ralphDir))) {
|
|
19
|
+
throw new Error(`Ralph source directory not found at ${ralphDir}. Package may be corrupted.`);
|
|
20
|
+
}
|
|
21
|
+
if (!(await exists(slashCommandsDir))) {
|
|
22
|
+
throw new Error(`Slash commands directory not found at ${slashCommandsDir}. Package may be corrupted.`);
|
|
23
|
+
}
|
|
24
|
+
const classified = await installBmadAssets(projectDir, bmadDir, slashCommandsDir, p);
|
|
25
|
+
if (p.commandDelivery.kind === "skills") {
|
|
26
|
+
await generateSkills(projectDir, classified);
|
|
27
|
+
}
|
|
28
|
+
const ralphAssets = await installRalphAssets(projectDir, ralphDir, p, await getPackageVersion());
|
|
29
|
+
const commandPaths = await deliverCommands(projectDir, p, slashCommandsDir);
|
|
30
|
+
await updateGitignore(projectDir);
|
|
31
|
+
return {
|
|
32
|
+
updatedPaths: ["_bmad/", ...ralphAssets.updatedPaths, ...commandPaths, ".gitignore"],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export async function installProject(projectDir, platform) {
|
|
36
|
+
await mkdir(join(projectDir, STATE_DIR), { recursive: true });
|
|
37
|
+
await mkdir(join(projectDir, ".ralph/specs"), { recursive: true });
|
|
38
|
+
await mkdir(join(projectDir, ".ralph/logs"), { recursive: true });
|
|
39
|
+
await mkdir(join(projectDir, ".ralph/docs/generated"), { recursive: true });
|
|
40
|
+
await copyBundledAssets(projectDir, platform);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/installer/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,e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E,gBAAgB,CAAC,CAAC;IAE5E,MAAM,eAAe,CAAC,UAAU,CAAC,CAAC;IAElC,OAAO;QACL,YAAY,EAAE,CAAC,QAAQ,EAAE,GAAG,WAAW,CAAC,YAAY,EAAE,GAAG,YAAY,EAAE,YAAY,CAAC;KACrF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,UAAkB,EAAE,QAAmB;IAC1E,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9D,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACnE,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,uBAAuB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5E,MAAM,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { debug } from "../utils/logger.js";
|
|
5
|
+
import { formatError, isEnoent } from "../utils/errors.js";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
export async function getPackageVersion() {
|
|
9
|
+
const pkgPath = join(__dirname, "..", "..", "package.json");
|
|
10
|
+
try {
|
|
11
|
+
const pkg = JSON.parse(await readFile(pkgPath, "utf-8"));
|
|
12
|
+
return pkg.version ?? "unknown";
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
if (!isEnoent(err)) {
|
|
16
|
+
debug(`Failed to read package.json: ${formatError(err)}`);
|
|
17
|
+
}
|
|
18
|
+
return "unknown";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export async function getBundledVersions() {
|
|
22
|
+
const versionsPath = join(__dirname, "..", "..", "bundled-versions.json");
|
|
23
|
+
try {
|
|
24
|
+
const versions = JSON.parse(await readFile(versionsPath, "utf-8"));
|
|
25
|
+
if (!versions || typeof versions.bmadCommit !== "string") {
|
|
26
|
+
throw new Error("Invalid bundled-versions.json structure: missing bmadCommit");
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
bmadCommit: versions.bmadCommit,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
if (err instanceof Error && err.message.includes("Invalid bundled-versions.json")) {
|
|
34
|
+
throw err;
|
|
35
|
+
}
|
|
36
|
+
throw new Error(`Failed to read bundled-versions.json at ${versionsPath}`, { cause: err });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function getBundledBmadDir() {
|
|
40
|
+
return join(__dirname, "..", "..", "bmad");
|
|
41
|
+
}
|
|
42
|
+
export function getBundledRalphDir() {
|
|
43
|
+
return join(__dirname, "..", "..", "ralph");
|
|
44
|
+
}
|
|
45
|
+
export function getSlashCommandsDir() {
|
|
46
|
+
return join(__dirname, "..", "..", "slash-commands");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Lazily loads the default (claude-code) platform to avoid circular imports
|
|
50
|
+
* and keep backward compatibility for callers that don't pass a platform.
|
|
51
|
+
*/
|
|
52
|
+
export async function getDefaultPlatform() {
|
|
53
|
+
const { claudeCodePlatform } = await import("../platform/claude-code.js");
|
|
54
|
+
return claudeCodePlatform;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["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AAC,QAAQ,IAAI,OAAO,QAAQ,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QACD,OAAO;YACL,UAAU,EAAE,QAAQ,CAAC,UAAU;SAChC,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EAAE,CAAC;YAClF,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,2CAA2C,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7F,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAC1E,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { mkdir, readFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { atomicWriteFile, exists, parseGitignoreLines, replaceSection, } from "../utils/file-system.js";
|
|
4
|
+
import { isEnoent } from "../utils/errors.js";
|
|
5
|
+
import { CONFIG_FILE, SKILLS_DIR, STATE_DIR } from "../utils/constants.js";
|
|
6
|
+
import { getDefaultPlatform } from "./metadata.js";
|
|
7
|
+
import { isTemplateCustomized } from "./template-files.js";
|
|
8
|
+
export async function updateGitignore(projectDir) {
|
|
9
|
+
const gitignorePath = join(projectDir, ".gitignore");
|
|
10
|
+
let existing = "";
|
|
11
|
+
try {
|
|
12
|
+
existing = await readFile(gitignorePath, "utf-8");
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
if (!isEnoent(err))
|
|
16
|
+
throw err;
|
|
17
|
+
}
|
|
18
|
+
const existingLines = parseGitignoreLines(existing);
|
|
19
|
+
const entries = [".ralph/logs/", "_bmad-output/"];
|
|
20
|
+
const newEntries = entries.filter((e) => !existingLines.has(e));
|
|
21
|
+
if (newEntries.length === 0)
|
|
22
|
+
return;
|
|
23
|
+
const suffix = existing.length > 0 && !existing.endsWith("\n")
|
|
24
|
+
? "\n" + newEntries.join("\n") + "\n"
|
|
25
|
+
: newEntries.join("\n") + "\n";
|
|
26
|
+
await atomicWriteFile(gitignorePath, existing + suffix);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Merge the BMAD instructions snippet into the platform's instructions file.
|
|
30
|
+
* Creates the file if it doesn't exist, replaces an existing BMAD section on upgrade.
|
|
31
|
+
*/
|
|
32
|
+
export async function mergeInstructionsFile(projectDir, platform) {
|
|
33
|
+
const p = platform ?? (await getDefaultPlatform());
|
|
34
|
+
const instructionsPath = join(projectDir, p.instructionsFile);
|
|
35
|
+
const snippet = p.generateInstructionsSnippet();
|
|
36
|
+
const marker = p.instructionsSectionMarker;
|
|
37
|
+
// Ensure parent directory exists for nested paths (e.g. .cursor/rules/)
|
|
38
|
+
await mkdir(dirname(instructionsPath), { recursive: true });
|
|
39
|
+
let existing = "";
|
|
40
|
+
try {
|
|
41
|
+
existing = await readFile(instructionsPath, "utf-8");
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
if (!isEnoent(err))
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
if (existing.includes(marker)) {
|
|
48
|
+
await atomicWriteFile(instructionsPath, replaceSection(existing, marker, "\n" + snippet));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
await atomicWriteFile(instructionsPath, existing + snippet);
|
|
52
|
+
}
|
|
53
|
+
export async function isInitialized(projectDir) {
|
|
54
|
+
return exists(join(projectDir, CONFIG_FILE));
|
|
55
|
+
}
|
|
56
|
+
export async function previewInstall(projectDir, platform) {
|
|
57
|
+
const p = platform ?? (await getDefaultPlatform());
|
|
58
|
+
const wouldCreate = [];
|
|
59
|
+
const wouldModify = [];
|
|
60
|
+
const wouldSkip = [];
|
|
61
|
+
// Directories that would be created
|
|
62
|
+
const dirsToCreate = [
|
|
63
|
+
`${STATE_DIR}/`,
|
|
64
|
+
".ralph/specs/",
|
|
65
|
+
".ralph/logs/",
|
|
66
|
+
".ralph/docs/generated/",
|
|
67
|
+
"_bmad/",
|
|
68
|
+
];
|
|
69
|
+
if (p.commandDelivery.kind === "directory") {
|
|
70
|
+
dirsToCreate.push(`${p.commandDelivery.dir}/`);
|
|
71
|
+
}
|
|
72
|
+
else if (p.commandDelivery.kind === "skills") {
|
|
73
|
+
dirsToCreate.push(`${SKILLS_DIR}/`);
|
|
74
|
+
}
|
|
75
|
+
for (const dir of dirsToCreate) {
|
|
76
|
+
if (await exists(join(projectDir, dir))) {
|
|
77
|
+
if (dir === "_bmad/" ||
|
|
78
|
+
(p.commandDelivery.kind === "directory" && dir === `${p.commandDelivery.dir}/`) ||
|
|
79
|
+
(p.commandDelivery.kind === "skills" && dir === `${SKILLS_DIR}/`)) {
|
|
80
|
+
wouldModify.push(dir);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
wouldCreate.push(dir);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const filesToCheck = [
|
|
88
|
+
{ path: ".ralph/PROMPT.md", isTemplate: true },
|
|
89
|
+
{ path: ".ralph/@AGENT.md", isTemplate: true },
|
|
90
|
+
{ path: ".ralph/.ralphrc", isTemplate: true },
|
|
91
|
+
{ path: ".ralph/ralph_loop.sh", isTemplate: false },
|
|
92
|
+
{ path: CONFIG_FILE, isTemplate: false },
|
|
93
|
+
];
|
|
94
|
+
for (const file of filesToCheck) {
|
|
95
|
+
if (await exists(join(projectDir, file.path))) {
|
|
96
|
+
if (file.isTemplate) {
|
|
97
|
+
wouldModify.push(file.path);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
wouldCreate.push(file.path);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (await exists(join(projectDir, ".gitignore"))) {
|
|
105
|
+
wouldModify.push(".gitignore");
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
wouldCreate.push(".gitignore");
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const content = await readFile(join(projectDir, p.instructionsFile), "utf-8");
|
|
112
|
+
if (content.includes(p.instructionsSectionMarker)) {
|
|
113
|
+
wouldSkip.push(`${p.instructionsFile} (already integrated)`);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
wouldModify.push(p.instructionsFile);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
if (isEnoent(err)) {
|
|
121
|
+
wouldCreate.push(p.instructionsFile);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
throw err;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return { wouldCreate, wouldModify, wouldSkip };
|
|
128
|
+
}
|
|
129
|
+
export async function previewUpgrade(projectDir, platform) {
|
|
130
|
+
const p = platform ?? (await getDefaultPlatform());
|
|
131
|
+
const managedPaths = [
|
|
132
|
+
{ path: "_bmad/", isDir: true },
|
|
133
|
+
{ path: ".ralph/ralph_loop.sh", isDir: false },
|
|
134
|
+
{ path: ".ralph/ralph_import.sh", isDir: false },
|
|
135
|
+
{ path: ".ralph/ralph_monitor.sh", isDir: false },
|
|
136
|
+
{ path: ".ralph/lib/", isDir: true },
|
|
137
|
+
{ path: ".ralph/PROMPT.md", isDir: false, templateName: "PROMPT.md" },
|
|
138
|
+
{ path: ".ralph/@AGENT.md", isDir: false, templateName: "AGENT.md" },
|
|
139
|
+
{ path: ".ralph/.ralphrc", isDir: false, templateName: "RALPHRC" },
|
|
140
|
+
{ path: ".ralph/RALPH-REFERENCE.md", isDir: false },
|
|
141
|
+
{ path: ".gitignore", isDir: false },
|
|
142
|
+
];
|
|
143
|
+
if (p.commandDelivery.kind === "directory") {
|
|
144
|
+
managedPaths.push({ path: `${p.commandDelivery.dir}/`, isDir: true });
|
|
145
|
+
}
|
|
146
|
+
else if (p.commandDelivery.kind === "skills") {
|
|
147
|
+
managedPaths.push({ path: `${SKILLS_DIR}/`, isDir: true });
|
|
148
|
+
}
|
|
149
|
+
const wouldUpdate = [];
|
|
150
|
+
const wouldCreate = [];
|
|
151
|
+
const wouldPreserve = [];
|
|
152
|
+
for (const { path: pathStr, templateName } of managedPaths) {
|
|
153
|
+
const fullPath = join(projectDir, pathStr.replace(/\/$/, ""));
|
|
154
|
+
if (await exists(fullPath)) {
|
|
155
|
+
if (templateName &&
|
|
156
|
+
(await isTemplateCustomized(fullPath, templateName, { platformId: p.id }))) {
|
|
157
|
+
wouldPreserve.push(pathStr);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
wouldUpdate.push(pathStr);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
wouldCreate.push(pathStr);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return { wouldUpdate, wouldCreate, wouldPreserve };
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=project-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/installer/project-files.ts"],"names":[],"mappings":"A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