@saga-ai/cli 0.1.1 → 0.1.2
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.cjs +19 -11
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -3232,25 +3232,32 @@ var WORKER_OUTPUT_SCHEMA = {
|
|
|
3232
3232
|
required: ["status", "summary"]
|
|
3233
3233
|
};
|
|
3234
3234
|
function findStory(projectPath, storySlug) {
|
|
3235
|
-
const
|
|
3236
|
-
if (!(0, import_node_fs3.existsSync)(
|
|
3235
|
+
const worktreesDir = (0, import_node_path3.join)(projectPath, ".saga", "worktrees");
|
|
3236
|
+
if (!(0, import_node_fs3.existsSync)(worktreesDir)) {
|
|
3237
3237
|
return null;
|
|
3238
3238
|
}
|
|
3239
|
-
const epicDirs = (0, import_node_fs3.readdirSync)(
|
|
3239
|
+
const epicDirs = (0, import_node_fs3.readdirSync)(worktreesDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
|
|
3240
3240
|
for (const epicSlug of epicDirs) {
|
|
3241
|
-
const
|
|
3242
|
-
|
|
3241
|
+
const epicWorktreeDir = (0, import_node_path3.join)(worktreesDir, epicSlug);
|
|
3242
|
+
const storyWorktree = (0, import_node_path3.join)(epicWorktreeDir, storySlug);
|
|
3243
|
+
if (!(0, import_node_fs3.existsSync)(storyWorktree)) {
|
|
3243
3244
|
continue;
|
|
3244
3245
|
}
|
|
3245
|
-
const
|
|
3246
|
-
|
|
3246
|
+
const storyPath = (0, import_node_path3.join)(
|
|
3247
|
+
storyWorktree,
|
|
3248
|
+
".saga",
|
|
3249
|
+
"epics",
|
|
3250
|
+
epicSlug,
|
|
3251
|
+
"stories",
|
|
3252
|
+
storySlug,
|
|
3253
|
+
"story.md"
|
|
3254
|
+
);
|
|
3247
3255
|
if ((0, import_node_fs3.existsSync)(storyPath)) {
|
|
3248
|
-
const worktreePath = (0, import_node_path3.join)(projectPath, ".saga", "worktrees", epicSlug, storySlug);
|
|
3249
3256
|
return {
|
|
3250
3257
|
epicSlug,
|
|
3251
3258
|
storySlug,
|
|
3252
3259
|
storyPath,
|
|
3253
|
-
worktreePath
|
|
3260
|
+
worktreePath: storyWorktree
|
|
3254
3261
|
};
|
|
3255
3262
|
}
|
|
3256
3263
|
}
|
|
@@ -3604,8 +3611,9 @@ async function implementCommand(storySlug, options) {
|
|
|
3604
3611
|
if (!storyInfo) {
|
|
3605
3612
|
console.error(`Error: Story '${storySlug}' not found in SAGA project.`);
|
|
3606
3613
|
console.error(`
|
|
3607
|
-
Searched in: ${(0, import_node_path3.join)(projectPath, ".saga", "
|
|
3608
|
-
console.error("\nMake sure the story exists and has a story.md file.");
|
|
3614
|
+
Searched in: ${(0, import_node_path3.join)(projectPath, ".saga", "worktrees")}`);
|
|
3615
|
+
console.error("\nMake sure the story worktree exists and has a story.md file.");
|
|
3616
|
+
console.error("Run /generate-stories to create story worktrees.");
|
|
3609
3617
|
process.exit(1);
|
|
3610
3618
|
}
|
|
3611
3619
|
const pluginRoot = process.env.SAGA_PLUGIN_ROOT;
|