@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.
Files changed (2) hide show
  1. package/dist/cli.cjs +19 -11
  2. 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 epicsDir = (0, import_node_path3.join)(projectPath, ".saga", "epics");
3236
- if (!(0, import_node_fs3.existsSync)(epicsDir)) {
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)(epicsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
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 storiesDir = (0, import_node_path3.join)(epicsDir, epicSlug, "stories");
3242
- if (!(0, import_node_fs3.existsSync)(storiesDir)) {
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 storyDir = (0, import_node_path3.join)(storiesDir, storySlug);
3246
- const storyPath = (0, import_node_path3.join)(storyDir, "story.md");
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", "epics")}`);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saga-ai/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI for SAGA - Structured Autonomous Goal Achievement",
5
5
  "type": "module",
6
6
  "bin": {