opencode-athena 0.11.0 → 0.12.1
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/dist/cli/index.js +17 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +37 -18
- package/dist/index.js +187 -67
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.js +164 -55
- package/dist/plugin/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -192,6 +192,7 @@ interface AthenaConfig {
|
|
|
192
192
|
prd?: string | null;
|
|
193
193
|
architecture?: string | null;
|
|
194
194
|
epics?: string | null;
|
|
195
|
+
outputFolder?: string | null;
|
|
195
196
|
};
|
|
196
197
|
};
|
|
197
198
|
features: {
|
|
@@ -390,12 +391,12 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
390
391
|
plan: z.ZodEnum<["free", "pro", "pro-plus", "business", "enterprise", "none"]>;
|
|
391
392
|
enabledModels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
392
393
|
}, "strip", z.ZodTypeAny, {
|
|
393
|
-
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
394
394
|
enabled: boolean;
|
|
395
|
+
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
395
396
|
enabledModels?: string[] | undefined;
|
|
396
397
|
}, {
|
|
397
|
-
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
398
398
|
enabled: boolean;
|
|
399
|
+
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
399
400
|
enabledModels?: string[] | undefined;
|
|
400
401
|
}>;
|
|
401
402
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -411,8 +412,8 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
411
412
|
tier: "max5x" | "max20x" | "pro" | "none";
|
|
412
413
|
};
|
|
413
414
|
githubCopilot: {
|
|
414
|
-
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
415
415
|
enabled: boolean;
|
|
416
|
+
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
416
417
|
enabledModels?: string[] | undefined;
|
|
417
418
|
};
|
|
418
419
|
}, {
|
|
@@ -428,8 +429,8 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
428
429
|
tier: "max5x" | "max20x" | "pro" | "none";
|
|
429
430
|
};
|
|
430
431
|
githubCopilot: {
|
|
431
|
-
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
432
432
|
enabled: boolean;
|
|
433
|
+
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
433
434
|
enabledModels?: string[] | undefined;
|
|
434
435
|
};
|
|
435
436
|
}>;
|
|
@@ -716,18 +717,21 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
716
717
|
prd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
717
718
|
architecture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
718
719
|
epics: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
720
|
+
outputFolder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
719
721
|
}, "strip", z.ZodTypeAny, {
|
|
720
722
|
stories?: string | null | undefined;
|
|
721
723
|
sprintStatus?: string | null | undefined;
|
|
722
724
|
architecture?: string | null | undefined;
|
|
723
725
|
prd?: string | null | undefined;
|
|
724
726
|
epics?: string | null | undefined;
|
|
727
|
+
outputFolder?: string | null | undefined;
|
|
725
728
|
}, {
|
|
726
729
|
stories?: string | null | undefined;
|
|
727
730
|
sprintStatus?: string | null | undefined;
|
|
728
731
|
architecture?: string | null | undefined;
|
|
729
732
|
prd?: string | null | undefined;
|
|
730
733
|
epics?: string | null | undefined;
|
|
734
|
+
outputFolder?: string | null | undefined;
|
|
731
735
|
}>>;
|
|
732
736
|
}, "strip", z.ZodTypeAny, {
|
|
733
737
|
defaultTrack: "enterprise" | "quick-flow" | "bmad-method";
|
|
@@ -739,6 +743,7 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
739
743
|
architecture?: string | null | undefined;
|
|
740
744
|
prd?: string | null | undefined;
|
|
741
745
|
epics?: string | null | undefined;
|
|
746
|
+
outputFolder?: string | null | undefined;
|
|
742
747
|
} | undefined;
|
|
743
748
|
}, {
|
|
744
749
|
defaultTrack: "enterprise" | "quick-flow" | "bmad-method";
|
|
@@ -750,6 +755,7 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
750
755
|
architecture?: string | null | undefined;
|
|
751
756
|
prd?: string | null | undefined;
|
|
752
757
|
epics?: string | null | undefined;
|
|
758
|
+
outputFolder?: string | null | undefined;
|
|
753
759
|
} | undefined;
|
|
754
760
|
}>;
|
|
755
761
|
features: z.ZodObject<{
|
|
@@ -1024,6 +1030,7 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
1024
1030
|
architecture?: string | null | undefined;
|
|
1025
1031
|
prd?: string | null | undefined;
|
|
1026
1032
|
epics?: string | null | undefined;
|
|
1033
|
+
outputFolder?: string | null | undefined;
|
|
1027
1034
|
} | undefined;
|
|
1028
1035
|
};
|
|
1029
1036
|
version: string;
|
|
@@ -1040,8 +1047,8 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
1040
1047
|
tier: "max5x" | "max20x" | "pro" | "none";
|
|
1041
1048
|
};
|
|
1042
1049
|
githubCopilot: {
|
|
1043
|
-
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
1044
1050
|
enabled: boolean;
|
|
1051
|
+
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
1045
1052
|
enabledModels?: string[] | undefined;
|
|
1046
1053
|
};
|
|
1047
1054
|
};
|
|
@@ -1161,6 +1168,7 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
1161
1168
|
architecture?: string | null | undefined;
|
|
1162
1169
|
prd?: string | null | undefined;
|
|
1163
1170
|
epics?: string | null | undefined;
|
|
1171
|
+
outputFolder?: string | null | undefined;
|
|
1164
1172
|
} | undefined;
|
|
1165
1173
|
};
|
|
1166
1174
|
version: string;
|
|
@@ -1177,8 +1185,8 @@ declare const AthenaConfigSchema: z.ZodObject<{
|
|
|
1177
1185
|
tier: "max5x" | "max20x" | "pro" | "none";
|
|
1178
1186
|
};
|
|
1179
1187
|
githubCopilot: {
|
|
1180
|
-
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
1181
1188
|
enabled: boolean;
|
|
1189
|
+
plan: "pro" | "none" | "free" | "pro-plus" | "business" | "enterprise";
|
|
1182
1190
|
enabledModels?: string[] | undefined;
|
|
1183
1191
|
};
|
|
1184
1192
|
};
|
|
@@ -1423,18 +1431,29 @@ declare const CONFIG_PATHS: {
|
|
|
1423
1431
|
declare const PROJECT_PATHS: {
|
|
1424
1432
|
/** Local Athena config */
|
|
1425
1433
|
readonly localConfig: ".opencode/athena.json";
|
|
1426
|
-
/** BMAD directory */
|
|
1427
|
-
readonly bmadDir: "
|
|
1428
|
-
/** BMAD
|
|
1429
|
-
readonly
|
|
1430
|
-
/**
|
|
1431
|
-
readonly
|
|
1432
|
-
/**
|
|
1433
|
-
readonly
|
|
1434
|
-
/**
|
|
1435
|
-
readonly
|
|
1436
|
-
/**
|
|
1437
|
-
readonly
|
|
1434
|
+
/** BMAD installation directory (v6 alpha) */
|
|
1435
|
+
readonly bmadDir: "_bmad";
|
|
1436
|
+
/** BMAD output directory (v6 alpha) */
|
|
1437
|
+
readonly bmadOutputDir: "_bmad-output";
|
|
1438
|
+
/** Legacy BMAD directory */
|
|
1439
|
+
readonly legacyBmadDir: "docs";
|
|
1440
|
+
/** Sprint status file (v6 alpha) */
|
|
1441
|
+
readonly sprintStatus: "_bmad-output/implementation-artifacts/sprint-status.yaml";
|
|
1442
|
+
/** Stories directory (v6 alpha) */
|
|
1443
|
+
readonly storiesDir: "_bmad-output/implementation-artifacts/stories";
|
|
1444
|
+
/** Architecture document (v6 alpha) */
|
|
1445
|
+
readonly architecture: "_bmad-output/planning-artifacts/architecture.md";
|
|
1446
|
+
/** PRD document (v6 alpha) */
|
|
1447
|
+
readonly prd: "_bmad-output/planning-artifacts/prd.md";
|
|
1448
|
+
/** Epics document (v6 alpha) */
|
|
1449
|
+
readonly epics: "_bmad-output/planning-artifacts/epics.md";
|
|
1450
|
+
/** Legacy paths for backward compatibility */
|
|
1451
|
+
readonly legacy: {
|
|
1452
|
+
readonly sprintStatus: "docs/implementation-artifacts/sprint-status.yaml";
|
|
1453
|
+
readonly storiesDir: "docs/implementation-artifacts/stories";
|
|
1454
|
+
readonly architecture: "docs/project-planning-artifacts/architecture.md";
|
|
1455
|
+
readonly prd: "docs/project-planning-artifacts/PRD.md";
|
|
1456
|
+
};
|
|
1438
1457
|
};
|
|
1439
1458
|
/**
|
|
1440
1459
|
* Default configuration values
|
package/dist/index.js
CHANGED
|
@@ -159,7 +159,7 @@ function handleSessionError(event, tracker) {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
var log3 = createPluginLogger("bmad-finder");
|
|
162
|
-
var BMAD_DIR_NAMES = ["docs", ".bmad", "bmad"];
|
|
162
|
+
var BMAD_DIR_NAMES = ["_bmad", "docs", ".bmad", "bmad"];
|
|
163
163
|
var KNOWN_AGENT_DIRS = [
|
|
164
164
|
"_bmad/bmm/agents",
|
|
165
165
|
"src/modules/bmm/agents",
|
|
@@ -205,16 +205,26 @@ async function findBmadDir(startDir) {
|
|
|
205
205
|
return null;
|
|
206
206
|
}
|
|
207
207
|
async function readBmadConfig(bmadDir) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
let config = {};
|
|
209
|
+
const bmmConfigPath = join(bmadDir, "bmm", "config.yaml");
|
|
210
|
+
if (existsSync(bmmConfigPath)) {
|
|
211
|
+
try {
|
|
212
|
+
const content = await readFile(bmmConfigPath, "utf-8");
|
|
213
|
+
const bmmConfig = parse(content);
|
|
214
|
+
config = { ...config, ...bmmConfig };
|
|
215
|
+
} catch {
|
|
216
|
+
}
|
|
211
217
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
const coreConfigPath = join(bmadDir, "core", "config.yaml");
|
|
219
|
+
if (existsSync(coreConfigPath)) {
|
|
220
|
+
try {
|
|
221
|
+
const content = await readFile(coreConfigPath, "utf-8");
|
|
222
|
+
const coreConfig = parse(content);
|
|
223
|
+
config = { ...config, ...coreConfig };
|
|
224
|
+
} catch {
|
|
225
|
+
}
|
|
217
226
|
}
|
|
227
|
+
return Object.keys(config).length > 0 ? config : null;
|
|
218
228
|
}
|
|
219
229
|
function expandBmadPlaceholder(path2) {
|
|
220
230
|
if (!path2) return void 0;
|
|
@@ -272,6 +282,53 @@ function searchForFileWithVariants(projectRoot, filename, searchPaths) {
|
|
|
272
282
|
}
|
|
273
283
|
return join(projectRoot, searchPaths[0], filename);
|
|
274
284
|
}
|
|
285
|
+
async function detectBmadStructure(projectRoot) {
|
|
286
|
+
const bmadDir = join(projectRoot, "_bmad");
|
|
287
|
+
const hasNewBmadDir = existsSync(bmadDir);
|
|
288
|
+
if (hasNewBmadDir) {
|
|
289
|
+
const config = await readBmadConfig(bmadDir);
|
|
290
|
+
const outputFolder = expandBmadPlaceholder(config?.output_folder) ?? "_bmad-output";
|
|
291
|
+
const outputDir = join(projectRoot, outputFolder);
|
|
292
|
+
const hasOutputDir = existsSync(outputDir);
|
|
293
|
+
if (hasOutputDir) {
|
|
294
|
+
return {
|
|
295
|
+
version: "v6-alpha",
|
|
296
|
+
bmadDir,
|
|
297
|
+
outputDir,
|
|
298
|
+
configRead: config !== null
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
version: "none",
|
|
303
|
+
bmadDir,
|
|
304
|
+
outputDir: null,
|
|
305
|
+
configRead: config !== null,
|
|
306
|
+
suggestion: `Found _bmad/ directory but no ${outputFolder}/. Your BMAD setup may be incomplete. Run 'npx bmad-method@alpha install' to complete setup.`
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
const docsDir = join(projectRoot, "docs");
|
|
310
|
+
const hasDocsDir = existsSync(docsDir);
|
|
311
|
+
if (hasDocsDir) {
|
|
312
|
+
const hasImplementation = existsSync(join(docsDir, "implementation-artifacts")) || existsSync(join(docsDir, "sprint-artifacts"));
|
|
313
|
+
const hasPlanning = existsSync(join(docsDir, "project-planning-artifacts"));
|
|
314
|
+
if (hasImplementation || hasPlanning) {
|
|
315
|
+
return {
|
|
316
|
+
version: "legacy",
|
|
317
|
+
bmadDir: docsDir,
|
|
318
|
+
outputDir: null,
|
|
319
|
+
configRead: false,
|
|
320
|
+
suggestion: `Detected legacy BMAD folder structure (docs/). BMAD METHOD v6 alpha uses _bmad/ and _bmad-output/. To upgrade, run 'npx bmad-method@alpha install' and migrate your artifacts to the new structure.`
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
version: "none",
|
|
326
|
+
bmadDir: null,
|
|
327
|
+
outputDir: null,
|
|
328
|
+
configRead: false,
|
|
329
|
+
suggestion: `No BMAD directory found. Run 'npx bmad-method@alpha install' to set up BMAD METHOD in this project.`
|
|
330
|
+
};
|
|
331
|
+
}
|
|
275
332
|
async function getBmadPaths(startDir, athenaConfig) {
|
|
276
333
|
const bmadDir = await findBmadDir(startDir);
|
|
277
334
|
const projectRoot = bmadDir ? dirname(bmadDir) : startDir;
|
|
@@ -279,13 +336,16 @@ async function getBmadPaths(startDir, athenaConfig) {
|
|
|
279
336
|
if (bmadDir) {
|
|
280
337
|
config = await readBmadConfig(bmadDir);
|
|
281
338
|
}
|
|
339
|
+
const structure = await detectBmadStructure(projectRoot);
|
|
340
|
+
const outputFolder = athenaConfig?.bmad?.paths?.outputFolder ?? expandBmadPlaceholder(config?.output_folder) ?? "_bmad-output";
|
|
341
|
+
const outputDir = structure.outputDir ?? join(projectRoot, outputFolder);
|
|
282
342
|
const planningDir = join(
|
|
283
343
|
projectRoot,
|
|
284
|
-
expandBmadPlaceholder(config?.planning_artifacts) ?? BMAD_V6_DEFAULTS.planningArtifacts
|
|
344
|
+
expandBmadPlaceholder(config?.planning_artifacts) ?? (structure.version === "v6-alpha" ? join(outputFolder, "planning-artifacts") : BMAD_V6_DEFAULTS.planningArtifacts)
|
|
285
345
|
);
|
|
286
346
|
const implementationDir = join(
|
|
287
347
|
projectRoot,
|
|
288
|
-
expandBmadPlaceholder(config?.implementation_artifacts) ?? expandBmadPlaceholder(config?.sprint_artifacts) ?? BMAD_V6_DEFAULTS.implementationArtifacts
|
|
348
|
+
expandBmadPlaceholder(config?.implementation_artifacts) ?? expandBmadPlaceholder(config?.sprint_artifacts) ?? (structure.version === "v6-alpha" ? join(outputFolder, "implementation-artifacts") : BMAD_V6_DEFAULTS.implementationArtifacts)
|
|
289
349
|
);
|
|
290
350
|
const storiesDir = athenaConfig?.bmad?.paths?.stories ? join(projectRoot, athenaConfig.bmad.paths.stories) : await detectStoriesDir(implementationDir, projectRoot);
|
|
291
351
|
const sprintStatusSearchPaths = [
|
|
@@ -313,13 +373,16 @@ async function getBmadPaths(startDir, athenaConfig) {
|
|
|
313
373
|
return {
|
|
314
374
|
projectRoot,
|
|
315
375
|
bmadDir,
|
|
376
|
+
outputDir,
|
|
316
377
|
planningDir,
|
|
317
378
|
implementationDir,
|
|
318
379
|
storiesDir,
|
|
319
380
|
sprintStatus,
|
|
320
381
|
architecture,
|
|
321
382
|
prd,
|
|
322
|
-
epics
|
|
383
|
+
epics,
|
|
384
|
+
structureVersion: structure.version === "none" ? "unknown" : structure.version,
|
|
385
|
+
suggestion: structure.suggestion
|
|
323
386
|
};
|
|
324
387
|
}
|
|
325
388
|
async function findAgentFiles(projectRoot) {
|
|
@@ -712,12 +775,26 @@ async function resolveStoryIdentifier(storiesDir, identifier, projectRoot, logge
|
|
|
712
775
|
const result2 = await loadStoryFromPath(cleaned);
|
|
713
776
|
if (result2) return result2;
|
|
714
777
|
}
|
|
778
|
+
if (!cleaned.endsWith(".md")) {
|
|
779
|
+
const withExt = `${cleaned}.md`;
|
|
780
|
+
if (existsSync(withExt)) {
|
|
781
|
+
const result2 = await loadStoryFromPath(withExt);
|
|
782
|
+
if (result2) return result2;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
715
785
|
if (projectRoot) {
|
|
716
786
|
const absolutePath = resolve(projectRoot, cleaned);
|
|
717
787
|
if (existsSync(absolutePath)) {
|
|
718
788
|
const result2 = await loadStoryFromPath(absolutePath);
|
|
719
789
|
if (result2) return result2;
|
|
720
790
|
}
|
|
791
|
+
if (!cleaned.endsWith(".md")) {
|
|
792
|
+
const absoluteWithExt = resolve(projectRoot, `${cleaned}.md`);
|
|
793
|
+
if (existsSync(absoluteWithExt)) {
|
|
794
|
+
const result2 = await loadStoryFromPath(absoluteWithExt);
|
|
795
|
+
if (result2) return result2;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
721
798
|
}
|
|
722
799
|
}
|
|
723
800
|
const result = await loadStoryContent(storiesDir, cleaned, logger);
|
|
@@ -1127,7 +1204,7 @@ var GIT_WRITE_COMMANDS = [
|
|
|
1127
1204
|
"git commit",
|
|
1128
1205
|
"git push",
|
|
1129
1206
|
"git checkout -b",
|
|
1130
|
-
"git branch
|
|
1207
|
+
"git branch",
|
|
1131
1208
|
"git switch -c",
|
|
1132
1209
|
"git switch --create",
|
|
1133
1210
|
"git merge",
|
|
@@ -1184,7 +1261,7 @@ function createToolHooks(ctx, tracker, config) {
|
|
|
1184
1261
|
}
|
|
1185
1262
|
};
|
|
1186
1263
|
}
|
|
1187
|
-
async function handleStoryLoaded(
|
|
1264
|
+
async function handleStoryLoaded(_ctx, tracker, config, _sessionID, output) {
|
|
1188
1265
|
try {
|
|
1189
1266
|
const result = JSON.parse(output.output);
|
|
1190
1267
|
if (!result.storyId || !result.story) {
|
|
@@ -1209,7 +1286,6 @@ async function handleStoryLoaded(ctx, tracker, config, sessionID, output) {
|
|
|
1209
1286
|
newTodos: newBmadTodos.length,
|
|
1210
1287
|
totalTracked: mergedTodos.length
|
|
1211
1288
|
});
|
|
1212
|
-
await autoInjectTodos(ctx, sessionID, newBmadTodos);
|
|
1213
1289
|
} else {
|
|
1214
1290
|
log5.debug("No BMAD todos found in story", { storyId: result.storyId });
|
|
1215
1291
|
}
|
|
@@ -1217,35 +1293,6 @@ async function handleStoryLoaded(ctx, tracker, config, sessionID, output) {
|
|
|
1217
1293
|
log5.warn("Failed to process story for todo sync", { error: String(error) });
|
|
1218
1294
|
}
|
|
1219
1295
|
}
|
|
1220
|
-
async function autoInjectTodos(ctx, sessionID, todos) {
|
|
1221
|
-
const client = ctx.client;
|
|
1222
|
-
const session = client?.session;
|
|
1223
|
-
const updateFn = session?.update;
|
|
1224
|
-
if (!updateFn) {
|
|
1225
|
-
log5.debug("OpenCode client session.update API not available");
|
|
1226
|
-
return;
|
|
1227
|
-
}
|
|
1228
|
-
try {
|
|
1229
|
-
await updateFn({
|
|
1230
|
-
path: { id: sessionID },
|
|
1231
|
-
body: {
|
|
1232
|
-
update: {
|
|
1233
|
-
sessionUpdate: "plan",
|
|
1234
|
-
entries: todos.map((todo) => ({
|
|
1235
|
-
priority: todo.priority || "medium",
|
|
1236
|
-
status: todo.status === "cancelled" ? "completed" : todo.status,
|
|
1237
|
-
content: todo.content
|
|
1238
|
-
}))
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
});
|
|
1242
|
-
log5.debug("Auto-injected BMAD todos via OpenCode API", { count: todos.length });
|
|
1243
|
-
} catch (error) {
|
|
1244
|
-
log5.debug("Could not auto-inject todos (API call failed)", {
|
|
1245
|
-
error: String(error)
|
|
1246
|
-
});
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
1296
|
async function handleTodoWritten(ctx, tracker, config, output) {
|
|
1250
1297
|
const todos = extractTodosFromOutput(output);
|
|
1251
1298
|
if (!todos || todos.length === 0) {
|
|
@@ -1282,9 +1329,10 @@ function extractTodosFromOutput(output) {
|
|
|
1282
1329
|
}
|
|
1283
1330
|
|
|
1284
1331
|
// src/plugin/hooks/compaction-hook.ts
|
|
1285
|
-
function createCompactionHook(tracker, config) {
|
|
1286
|
-
const storiesPath = config.bmad?.paths?.stories ?? "docs/stories";
|
|
1332
|
+
function createCompactionHook(tracker, config, projectDirectory) {
|
|
1287
1333
|
return async (_input, output) => {
|
|
1334
|
+
const paths = await getBmadPaths(projectDirectory, config);
|
|
1335
|
+
const storiesPath = paths.storiesDir || "docs/stories";
|
|
1288
1336
|
const storyContext = await tracker.getCurrentStoryContext();
|
|
1289
1337
|
const todos = tracker.getCurrentTodos();
|
|
1290
1338
|
const currentStory = tracker.getCurrentStory();
|
|
@@ -2177,7 +2225,7 @@ async function analyzeStoryComplexity(ctx, config, requestedStoryId) {
|
|
|
2177
2225
|
filename: "",
|
|
2178
2226
|
assessment: null,
|
|
2179
2227
|
error: "No stories directory found",
|
|
2180
|
-
suggestion: "Ensure BMAD is set up with a stories directory."
|
|
2228
|
+
suggestion: paths.suggestion || "Ensure BMAD is set up with a stories directory. Athena supports both legacy (docs/) and v6-alpha (_bmad/ + _bmad-output/) structures."
|
|
2181
2229
|
};
|
|
2182
2230
|
}
|
|
2183
2231
|
const identifier = stripAtPrefix(requestedStoryId);
|
|
@@ -2274,18 +2322,29 @@ var CONFIG_PATHS = {
|
|
|
2274
2322
|
var PROJECT_PATHS = {
|
|
2275
2323
|
/** Local Athena config */
|
|
2276
2324
|
localConfig: ".opencode/athena.json",
|
|
2277
|
-
/** BMAD directory */
|
|
2278
|
-
bmadDir: "
|
|
2279
|
-
/** BMAD
|
|
2280
|
-
|
|
2281
|
-
/**
|
|
2282
|
-
|
|
2283
|
-
/**
|
|
2284
|
-
|
|
2285
|
-
/**
|
|
2286
|
-
|
|
2287
|
-
/**
|
|
2288
|
-
|
|
2325
|
+
/** BMAD installation directory (v6 alpha) */
|
|
2326
|
+
bmadDir: "_bmad",
|
|
2327
|
+
/** BMAD output directory (v6 alpha) */
|
|
2328
|
+
bmadOutputDir: "_bmad-output",
|
|
2329
|
+
/** Legacy BMAD directory */
|
|
2330
|
+
legacyBmadDir: "docs",
|
|
2331
|
+
/** Sprint status file (v6 alpha) */
|
|
2332
|
+
sprintStatus: "_bmad-output/implementation-artifacts/sprint-status.yaml",
|
|
2333
|
+
/** Stories directory (v6 alpha) */
|
|
2334
|
+
storiesDir: "_bmad-output/implementation-artifacts/stories",
|
|
2335
|
+
/** Architecture document (v6 alpha) */
|
|
2336
|
+
architecture: "_bmad-output/planning-artifacts/architecture.md",
|
|
2337
|
+
/** PRD document (v6 alpha) */
|
|
2338
|
+
prd: "_bmad-output/planning-artifacts/prd.md",
|
|
2339
|
+
/** Epics document (v6 alpha) */
|
|
2340
|
+
epics: "_bmad-output/planning-artifacts/epics.md",
|
|
2341
|
+
/** Legacy paths for backward compatibility */
|
|
2342
|
+
legacy: {
|
|
2343
|
+
sprintStatus: "docs/implementation-artifacts/sprint-status.yaml",
|
|
2344
|
+
storiesDir: "docs/implementation-artifacts/stories",
|
|
2345
|
+
architecture: "docs/project-planning-artifacts/architecture.md",
|
|
2346
|
+
prd: "docs/project-planning-artifacts/PRD.md"
|
|
2347
|
+
}
|
|
2289
2348
|
};
|
|
2290
2349
|
var DEFAULTS = {
|
|
2291
2350
|
/** Default BMAD track for new projects */
|
|
@@ -2744,7 +2803,7 @@ async function handleDecomposeStory(ctx, config, args) {
|
|
|
2744
2803
|
if (!paths.storiesDir) {
|
|
2745
2804
|
return createErrorResult(
|
|
2746
2805
|
"No stories directory found",
|
|
2747
|
-
"Ensure BMAD is set up with a stories directory."
|
|
2806
|
+
paths.suggestion || "Ensure BMAD is set up with a stories directory. Athena supports both legacy (docs/) and v6-alpha (_bmad/ + _bmad-output/) structures."
|
|
2748
2807
|
);
|
|
2749
2808
|
}
|
|
2750
2809
|
const resolved = await resolveStoryIdentifier(paths.storiesDir, rawStoryId, ctx.directory);
|
|
@@ -3251,7 +3310,7 @@ async function getStoryContext(ctx, tracker, config, requestedStoryId) {
|
|
|
3251
3310
|
log11.warn("BMAD directory not found", { directory: ctx.directory });
|
|
3252
3311
|
return {
|
|
3253
3312
|
error: "No BMAD directory found",
|
|
3254
|
-
suggestion: "Run 'npx bmad-method@alpha install' to set up BMAD in this project."
|
|
3313
|
+
suggestion: paths.suggestion || "Run 'npx bmad-method@alpha install' to set up BMAD in this project. Athena supports both legacy (docs/) and v6-alpha (_bmad/ + _bmad-output/) structures."
|
|
3255
3314
|
};
|
|
3256
3315
|
}
|
|
3257
3316
|
log11.debug("Reading sprint status", { sprintStatusPath: paths.sprintStatus });
|
|
@@ -4920,7 +4979,7 @@ async function executePartyReview(ctx, config, identifier, forceAdvancedModel) {
|
|
|
4920
4979
|
scope: "story",
|
|
4921
4980
|
identifier,
|
|
4922
4981
|
error: "No BMAD directory found",
|
|
4923
|
-
suggestion: "Run 'npx bmad-method@alpha install' to set up BMAD in this project."
|
|
4982
|
+
suggestion: paths.suggestion || "Run 'npx bmad-method@alpha install' to set up BMAD in this project. Athena supports both legacy (docs/) and v6-alpha (_bmad/ + _bmad-output/) structures."
|
|
4924
4983
|
};
|
|
4925
4984
|
}
|
|
4926
4985
|
const scope = detectReviewScope(identifier);
|
|
@@ -5379,7 +5438,7 @@ async function executePhase1Analysis(ctx, config, identifier, forceAdvancedModel
|
|
|
5379
5438
|
scope: "story",
|
|
5380
5439
|
identifier,
|
|
5381
5440
|
error: "No BMAD directory found",
|
|
5382
|
-
suggestion: "Run 'npx bmad-method@alpha install' to set up BMAD in this project."
|
|
5441
|
+
suggestion: paths.suggestion || "Run 'npx bmad-method@alpha install' to set up BMAD in this project. Athena supports both legacy (docs/) and v6-alpha (_bmad/ + _bmad-output/) structures."
|
|
5383
5442
|
};
|
|
5384
5443
|
}
|
|
5385
5444
|
const scope = detectReviewScope2(identifier);
|
|
@@ -6130,7 +6189,8 @@ async function handleUpdateStatus(ctx, tracker, config, args) {
|
|
|
6130
6189
|
const paths = await getBmadPaths(ctx.directory, config);
|
|
6131
6190
|
if (!paths.bmadDir) {
|
|
6132
6191
|
log14.warn("BMAD directory not found", { directory: ctx.directory });
|
|
6133
|
-
|
|
6192
|
+
const suggestion = paths.suggestion || "Run 'npx bmad-method@alpha install' to set up BMAD in this project. Athena supports both legacy (docs/) and v6-alpha (_bmad/ + _bmad-output/) structures.";
|
|
6193
|
+
return { error: `No BMAD directory found. ${suggestion}` };
|
|
6134
6194
|
}
|
|
6135
6195
|
if (!paths.sprintStatus) {
|
|
6136
6196
|
log14.error("Sprint status file not found");
|
|
@@ -6402,7 +6462,8 @@ var BmadConfigSchema = z.object({
|
|
|
6402
6462
|
sprintStatus: z.string().nullable().optional().describe("Custom path to sprint-status.yaml file (null = auto-detect)"),
|
|
6403
6463
|
prd: z.string().nullable().optional().describe("Custom path to PRD.md file (null = auto-detect)"),
|
|
6404
6464
|
architecture: z.string().nullable().optional().describe("Custom path to architecture.md file (null = auto-detect)"),
|
|
6405
|
-
epics: z.string().nullable().optional().describe("Custom path to epics.md file (null = auto-detect)")
|
|
6465
|
+
epics: z.string().nullable().optional().describe("Custom path to epics.md file (null = auto-detect)"),
|
|
6466
|
+
outputFolder: z.string().nullable().optional().describe("Custom path to BMAD output folder (null = auto-detect _bmad-output)")
|
|
6406
6467
|
}).optional()
|
|
6407
6468
|
});
|
|
6408
6469
|
var FeaturesSchema = z.object({
|
|
@@ -6912,7 +6973,43 @@ function mergeConfigs(...configs) {
|
|
|
6912
6973
|
}
|
|
6913
6974
|
}
|
|
6914
6975
|
if (config.models) {
|
|
6915
|
-
|
|
6976
|
+
if (config.models.sisyphus !== void 0) result.models.sisyphus = config.models.sisyphus;
|
|
6977
|
+
if (config.models.oracle !== void 0) result.models.oracle = config.models.oracle;
|
|
6978
|
+
if (config.models.librarian !== void 0) result.models.librarian = config.models.librarian;
|
|
6979
|
+
if (config.models.frontend !== void 0) result.models.frontend = config.models.frontend;
|
|
6980
|
+
if (config.models.documentWriter !== void 0)
|
|
6981
|
+
result.models.documentWriter = config.models.documentWriter;
|
|
6982
|
+
if (config.models.multimodalLooker !== void 0)
|
|
6983
|
+
result.models.multimodalLooker = config.models.multimodalLooker;
|
|
6984
|
+
if (config.models.settings !== void 0) {
|
|
6985
|
+
result.models.settings = result.models.settings || {};
|
|
6986
|
+
const resultSettings = result.models.settings;
|
|
6987
|
+
const configSettings = config.models.settings;
|
|
6988
|
+
for (const agentKey of [
|
|
6989
|
+
"sisyphus",
|
|
6990
|
+
"oracle",
|
|
6991
|
+
"librarian",
|
|
6992
|
+
"frontend",
|
|
6993
|
+
"documentWriter",
|
|
6994
|
+
"multimodalLooker"
|
|
6995
|
+
]) {
|
|
6996
|
+
if (configSettings[agentKey] !== void 0) {
|
|
6997
|
+
resultSettings[agentKey] = {
|
|
6998
|
+
...resultSettings[agentKey] || {},
|
|
6999
|
+
...configSettings[agentKey]
|
|
7000
|
+
};
|
|
7001
|
+
}
|
|
7002
|
+
}
|
|
7003
|
+
if (configSettings.overrides !== void 0) {
|
|
7004
|
+
resultSettings.overrides = {
|
|
7005
|
+
...resultSettings.overrides || {},
|
|
7006
|
+
...configSettings.overrides
|
|
7007
|
+
};
|
|
7008
|
+
}
|
|
7009
|
+
}
|
|
7010
|
+
if (config.models.custom !== void 0) {
|
|
7011
|
+
result.models.custom = config.models.custom;
|
|
7012
|
+
}
|
|
6916
7013
|
}
|
|
6917
7014
|
if (config.bmad) {
|
|
6918
7015
|
result.bmad = { ...result.bmad, ...config.bmad };
|
|
@@ -6923,6 +7020,29 @@ function mergeConfigs(...configs) {
|
|
|
6923
7020
|
if (config.mcps) {
|
|
6924
7021
|
result.mcps = { ...result.mcps, ...config.mcps };
|
|
6925
7022
|
}
|
|
7023
|
+
if (config.routing) {
|
|
7024
|
+
if (config.routing.providerPriority !== void 0) {
|
|
7025
|
+
result.routing.providerPriority = config.routing.providerPriority;
|
|
7026
|
+
}
|
|
7027
|
+
if (config.routing.modelFamilyPriority !== void 0) {
|
|
7028
|
+
result.routing.modelFamilyPriority = {
|
|
7029
|
+
...result.routing.modelFamilyPriority,
|
|
7030
|
+
...config.routing.modelFamilyPriority
|
|
7031
|
+
};
|
|
7032
|
+
}
|
|
7033
|
+
if (config.routing.agentOverrides !== void 0) {
|
|
7034
|
+
result.routing.agentOverrides = {
|
|
7035
|
+
...result.routing.agentOverrides,
|
|
7036
|
+
...config.routing.agentOverrides
|
|
7037
|
+
};
|
|
7038
|
+
}
|
|
7039
|
+
if (config.routing.fallbackBehavior !== void 0) {
|
|
7040
|
+
result.routing.fallbackBehavior = {
|
|
7041
|
+
...result.routing.fallbackBehavior,
|
|
7042
|
+
...config.routing.fallbackBehavior
|
|
7043
|
+
};
|
|
7044
|
+
}
|
|
7045
|
+
}
|
|
6926
7046
|
}
|
|
6927
7047
|
return result;
|
|
6928
7048
|
}
|
|
@@ -6941,7 +7061,7 @@ var OpenCodeAthena = async (ctx) => {
|
|
|
6941
7061
|
const tools = createTools(ctx, tracker, config);
|
|
6942
7062
|
const sessionHooks = createSessionHooks(ctx, tracker, config);
|
|
6943
7063
|
const toolHooks = createToolHooks(ctx, tracker, config);
|
|
6944
|
-
const compactionHook = createCompactionHook(tracker, config);
|
|
7064
|
+
const compactionHook = createCompactionHook(tracker, config, directory);
|
|
6945
7065
|
return {
|
|
6946
7066
|
// Custom tools for BMAD integration
|
|
6947
7067
|
tool: tools,
|