@beastmode-develeap/beastmode 0.1.271 → 0.1.273

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/index.js CHANGED
@@ -6443,7 +6443,8 @@ Path: ${projectPath}
6443
6443
  status: "complete",
6444
6444
  analyzed_at: meta.analyzed_at,
6445
6445
  duration_seconds: meta.duration_seconds,
6446
- target_repo_head_sha: meta.target_repo_head_sha
6446
+ target_repo_head_sha: meta.target_repo_head_sha,
6447
+ claude_skeleton: meta.claude_skeleton
6447
6448
  };
6448
6449
  }
6449
6450
  if (meta && meta.status === "failed") {
@@ -6471,6 +6472,36 @@ Path: ${projectPath}
6471
6472
  return { status: "idle" };
6472
6473
  }
6473
6474
  },
6475
+ // ── GET /api/projects/:name/codebase-guide ──
6476
+ // Return the project's codebase guide content at a requested pyramid level.
6477
+ // Levels: l0 (one-line .txt), l1 (paragraph .md, DEFAULT), l2 (full .md).
6478
+ // Responds 200 with { level, content, meta } when the guide is available;
6479
+ // 404 when analysis has not completed or the requested level file is missing.
6480
+ {
6481
+ method: "GET",
6482
+ pattern: "/api/projects/:name/codebase-guide",
6483
+ handler: (_body, params, query) => {
6484
+ const { name } = params;
6485
+ assertSafeName(name);
6486
+ const projectsDir = join14(factoryDir, ".beastmode", "projects");
6487
+ const meta = _readAnalyzeMeta(projectsDir, name);
6488
+ if (!meta || meta.status !== "complete") {
6489
+ throw new HttpError(404, {
6490
+ error: "No codebase guide available",
6491
+ status: meta?.status || "none"
6492
+ });
6493
+ }
6494
+ const levelRaw = query?.level || "l1";
6495
+ const level = levelRaw === "l0" || levelRaw === "l2" ? levelRaw : "l1";
6496
+ const filename = level === "l0" ? "codebase-guide.l0.txt" : level === "l2" ? "codebase-guide.md" : "codebase-guide.l1.md";
6497
+ const filePath = join14(projectsDir, name, filename);
6498
+ if (!existsSync16(filePath)) {
6499
+ throw new HttpError(404, { error: "Guide file not found" });
6500
+ }
6501
+ const content = readFileSync13(filePath, "utf-8");
6502
+ return { level, content, meta };
6503
+ }
6504
+ },
6474
6505
  // ── Runs ──
6475
6506
  {
6476
6507
  method: "GET",