@slowcook-ai/cli 0.14.0-alpha.6 → 0.15.0-alpha.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.js CHANGED
@@ -18,6 +18,7 @@ import { catchup } from "./commands/catchup/index.js";
18
18
  import { brew } from "./commands/brew/index.js";
19
19
  import { map } from "./commands/map/index.js";
20
20
  import { extract } from "./commands/extract/index.js";
21
+ import { vibe } from "./commands/vibe/index.js";
21
22
  import { dispatch } from "./commands/dispatch/index.js";
22
23
  import { fixtures } from "./commands/fixtures/index.js";
23
24
  // Read VERSION from package.json at runtime so the CLI's self-reported
@@ -53,6 +54,7 @@ Usage:
53
54
  slowcook brew --story <id> [--budget-usd <n>] [--max-iterations <n>] [--model <id>]
54
55
  slowcook map (generate|check) [--cwd <path>] [--out <path>] [--md <path>]
55
56
  slowcook extract [--schema] [--tokens] [--cwd <path>]
57
+ slowcook vibe --spec <id> [--cwd <path>] [--owner <login>] [--repo <name>] [--dry-run]
56
58
  slowcook dispatch <step> [inputs...]
57
59
  slowcook fixtures check [--max-age-days <n>] [--story <id>]
58
60
  slowcook version
@@ -74,6 +76,7 @@ Commands available in ${VERSION}:
74
76
  brew Ratcheted implementation loop: flip red tests to green for one story.
75
77
  map Generate / check the repo-wide code map (APIs, pages, components, helpers, types).
76
78
  extract Brownfield extracts (schema.mmd, tokens.md) for refine/investigate context. Fast, no node_modules.
79
+ vibe (0.15-α.1) Design-first mockup generator. Reads spec + brownfield + code-map; emits runnable React mockup to slowcook/mockup/story-N PR.
77
80
  dispatch Trigger a slowcook GitHub Actions workflow remotely (brew / testgen / refine).
78
81
 
79
82
  Coming in later versions:
@@ -156,6 +159,12 @@ async function main() {
156
159
  // context without paying for `map generate`'s full ts-morph scan.
157
160
  await extract(args.slice(1), VERSION);
158
161
  return;
162
+ case "vibe":
163
+ // 0.15.0-α.1 — design-first mockup generator (plate-pipeline α.1).
164
+ // Reads spec + brownfield extracts + code-map; emits a runnable
165
+ // React mockup to slowcook/mockup/story-N branch + PR.
166
+ await vibe(args.slice(1), VERSION);
167
+ return;
159
168
  case "dispatch":
160
169
  await dispatch(args.slice(1));
161
170
  return;
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAA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AC;YAC9B,OAAO;QACT,KAAK,UAAU;YACb,MAAM,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9B,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,WAAW,CAAC;QACjB,KAAK,IAAI;YACP,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;YACnC,OAAO;QACT,KAAK,SAAS,CAAC;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI;YACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO;QACT;YACE,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC;YACvD,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW;IACjC,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Vibe agent — single-shot mockup generator (0.15.0-α.1).
3
+ *
4
+ * Reads spec.yaml + brownfield extracts + code-map summary, calls the
5
+ * LLM once with the VIBE_SYSTEM prompt, parses the XML-block output,
6
+ * writes files + collects component-change requests.
7
+ *
8
+ * Pattern mirrors investigate/agent.ts but simpler:
9
+ * - no tools (vibe doesn't read files; the project context is inlined)
10
+ * - single LLM call (multi-round iteration belongs to plate, not vibe)
11
+ * - format-compliance retry once if the agent emits prose
12
+ *
13
+ * Returns a `VibeResult` the index.ts dispatch consumes for git ops +
14
+ * PR opening.
15
+ */
16
+ import { type VibeChangeRequest, type VibeFileBlock } from "./emit.js";
17
+ export interface VibeContext {
18
+ repoRoot: string;
19
+ anthropicApiKey: string;
20
+ model: string;
21
+ storyId: string;
22
+ cliVersion: string;
23
+ /** Pre-rendered spec YAML (read by the index.ts wrapper). */
24
+ specYaml: string;
25
+ /**
26
+ * Pre-assembled project-context blob: brownfield extracts + code-map
27
+ * summary, formatted as Markdown. The index.ts wrapper builds this
28
+ * from `.brewing/diagrams/{schema.mmd, tokens.md}` + a code-map
29
+ * digest.
30
+ */
31
+ projectContext: string;
32
+ /** Optional similar-pages-in-codebase free-form hint. */
33
+ similarPagesHint?: string;
34
+ }
35
+ export type VibeResult = {
36
+ kind: "emitted";
37
+ files: VibeFileBlock[];
38
+ writtenPaths: string[];
39
+ changeRequests: VibeChangeRequest[];
40
+ spendUsd: number;
41
+ rounds: number;
42
+ } | {
43
+ kind: "format-failure";
44
+ finalText: string;
45
+ spendUsd: number;
46
+ rounds: number;
47
+ };
48
+ export declare function runVibe(ctx: VibeContext): Promise<VibeResult>;
49
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/vibe/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAC;AAMnB,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN,wBAAsB,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAwEnE"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Vibe agent — single-shot mockup generator (0.15.0-α.1).
3
+ *
4
+ * Reads spec.yaml + brownfield extracts + code-map summary, calls the
5
+ * LLM once with the VIBE_SYSTEM prompt, parses the XML-block output,
6
+ * writes files + collects component-change requests.
7
+ *
8
+ * Pattern mirrors investigate/agent.ts but simpler:
9
+ * - no tools (vibe doesn't read files; the project context is inlined)
10
+ * - single LLM call (multi-round iteration belongs to plate, not vibe)
11
+ * - format-compliance retry once if the agent emits prose
12
+ *
13
+ * Returns a `VibeResult` the index.ts dispatch consumes for git ops +
14
+ * PR opening.
15
+ */
16
+ import Anthropic from "@anthropic-ai/sdk";
17
+ import { VIBE_SYSTEM, buildVibeUserPrompt, } from "./prompts.js";
18
+ import { parseVibeOutput, writeVibeFiles, } from "./emit.js";
19
+ import { costUsdForUsage } from "@slowcook-ai/llm-anthropic";
20
+ const DEFAULT_MODEL = "claude-opus-4-7";
21
+ const MAX_TOKENS = 8192;
22
+ export async function runVibe(ctx) {
23
+ const anthropic = new Anthropic({ apiKey: ctx.anthropicApiKey });
24
+ const userPrompt = buildVibeUserPrompt({
25
+ storyId: ctx.storyId,
26
+ specYaml: ctx.specYaml,
27
+ similarPagesHint: ctx.similarPagesHint,
28
+ });
29
+ const messages = [
30
+ { role: "user", content: userPrompt },
31
+ ];
32
+ let spendUsd = 0;
33
+ let rounds = 0;
34
+ let finalText = "";
35
+ // Round 1 — fresh emit.
36
+ rounds += 1;
37
+ const r1 = await anthropic.messages.create({
38
+ model: ctx.model,
39
+ max_tokens: MAX_TOKENS,
40
+ system: VIBE_SYSTEM(ctx.projectContext),
41
+ messages,
42
+ });
43
+ spendUsd += costUsd(r1, ctx.model);
44
+ for (const block of r1.content) {
45
+ if (block.type === "text")
46
+ finalText = block.text;
47
+ }
48
+ // Format-compliance retry (single nudge) if no <file> blocks parsed.
49
+ // Mirrors investigate's pattern from 0.13.0-alpha.2c.
50
+ let parsed = parseVibeOutput(finalText);
51
+ if (parsed.files.length === 0) {
52
+ rounds += 1;
53
+ messages.push({ role: "assistant", content: finalText });
54
+ messages.push({
55
+ role: "user",
56
+ content: "Your previous reply contained no `<file path=\"...\">...</file>` blocks. Slowcook's parser greps for those literal tags. Re-emit now using the Output format from your system prompt: each file as a separate `<file path=\"...\">contents</file>` block. No prose preamble or postscript.",
57
+ });
58
+ const r2 = await anthropic.messages.create({
59
+ model: ctx.model,
60
+ max_tokens: MAX_TOKENS,
61
+ system: VIBE_SYSTEM(ctx.projectContext),
62
+ messages,
63
+ });
64
+ spendUsd += costUsd(r2, ctx.model);
65
+ for (const block of r2.content) {
66
+ if (block.type === "text")
67
+ finalText = block.text;
68
+ }
69
+ parsed = parseVibeOutput(finalText);
70
+ }
71
+ if (parsed.files.length === 0) {
72
+ return {
73
+ kind: "format-failure",
74
+ finalText,
75
+ spendUsd,
76
+ rounds,
77
+ };
78
+ }
79
+ const writtenPaths = writeVibeFiles(ctx.repoRoot, parsed.files);
80
+ return {
81
+ kind: "emitted",
82
+ files: parsed.files,
83
+ writtenPaths,
84
+ changeRequests: parsed.changeRequests,
85
+ spendUsd,
86
+ rounds,
87
+ };
88
+ }
89
+ function costUsd(response, model) {
90
+ const usage = response.usage;
91
+ return costUsdForUsage(model, {
92
+ inputTokens: usage.input_tokens,
93
+ outputTokens: usage.output_tokens,
94
+ cacheReadTokens: usage.cache_read_input_tokens ?? 0,
95
+ cacheCreateTokens: usage.cache_creation_input_tokens ?? 0,
96
+ });
97
+ }
98
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/commands/vibe/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,cAAc,GAGf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,aAAa,GAAG,iBAAiB,CAAC;AACxC,MAAM,UAAU,GAAG,IAAI,CAAC;AAqCxB,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAgB;IAC5C,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC;IAEjE,MAAM,UAAU,GAAG,mBAAmB,CAAC;QACrC,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;KACvC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAsC;QAClD,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE;KACtC,CAAC;IAEF,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,wBAAwB;IACxB,MAAM,IAAI,CAAC,CAAC;IACZ,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC;QACzC,KAAK,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,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO;YACL,IAAI,EAAE,gBAAgB;YACtB,SAAS;YACT,QAAQ;YACR,MAAM;SACP,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAChE,OAAO;QACL,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,YAAY;QACZ,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,QAAQ;QACR,MAAM;KACP,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,QAAoC,EAAE,KAAa;IAClE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAGtB,CAAC;IACF,OAAO,eAAe,CAAC,KAAK,EAAE;QAC5B,WAAW,EAAE,KAAK,CAAC,YAAY;QAC/B,YAAY,EAAE,KAAK,CAAC,aAAa;QACjC,eAAe,EAAE,KAAK,CAAC,uBAAuB,IAAI,CAAC;QACnD,iBAAiB,EAAE,KAAK,CAAC,2BAA2B,IAAI,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * 0.15.0-α.1 — vibe's output parser + writer.
3
+ *
4
+ * Vibe emits multi-artifact XML-tagged blocks (matching testgen's shape):
5
+ * <file path="...">contents</file>
6
+ * <component_change_request component="..." path="...">prose</component_change_request>
7
+ *
8
+ * `parseVibeOutput` extracts the blocks. `writeVibeFiles` writes them to
9
+ * disk under repoRoot, with path-safety checks (no escapes, no absolute
10
+ * paths, must be under repoRoot).
11
+ *
12
+ * Component-change requests are surfaced separately; they don't write
13
+ * files. The plate agent (later) handles them by either applying or
14
+ * rejecting via PM iteration.
15
+ */
16
+ export interface VibeFileBlock {
17
+ /** Repo-relative path; validated to be safe. */
18
+ path: string;
19
+ /** File contents verbatim. */
20
+ contents: string;
21
+ }
22
+ export interface VibeChangeRequest {
23
+ component: string;
24
+ path: string;
25
+ rationale: string;
26
+ }
27
+ export interface VibeOutput {
28
+ files: VibeFileBlock[];
29
+ changeRequests: VibeChangeRequest[];
30
+ }
31
+ export declare function parseVibeOutput(body: string): VibeOutput;
32
+ /**
33
+ * Validate a vibe-emitted path is safe to write under repoRoot.
34
+ * Rejects absolute paths, parent-dir escapes, and paths that normalize
35
+ * outside the repo.
36
+ *
37
+ * Returns the absolute target path on success; throws on rejection.
38
+ */
39
+ export declare function validateAndResolveVibePath(repoRoot: string, relPath: string): string;
40
+ export declare function writeVibeFiles(repoRoot: string, files: VibeFileBlock[]): string[];
41
+ //# sourceMappingURL=emit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../../src/commands/vibe/emit.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC;AAMD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAuBxD;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,MAAM,CAoBR;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,aAAa,EAAE,GACrB,MAAM,EAAE,CASV"}
@@ -0,0 +1,59 @@
1
+ import { writeFileSync, mkdirSync } from "node:fs";
2
+ import { dirname, isAbsolute, normalize, join, sep } from "node:path";
3
+ const FILE_BLOCK_RE = /<file\s+path="([^"]+)">([\s\S]*?)<\/file>/g;
4
+ const CHANGE_REQ_RE = /<component_change_request\s+component="([^"]+)"\s+path="([^"]+)">([\s\S]*?)<\/component_change_request>/g;
5
+ export function parseVibeOutput(body) {
6
+ const files = [];
7
+ let m;
8
+ const fileRe = new RegExp(FILE_BLOCK_RE.source, "g");
9
+ while ((m = fileRe.exec(body)) !== null) {
10
+ const path = m[1].trim();
11
+ // Strip leading/trailing newlines from the captured body, but
12
+ // preserve interior formatting verbatim.
13
+ const contents = m[2].replace(/^\r?\n/, "").replace(/\s+$/, "") + "\n";
14
+ files.push({ path, contents });
15
+ }
16
+ const changeRequests = [];
17
+ const reqRe = new RegExp(CHANGE_REQ_RE.source, "g");
18
+ while ((m = reqRe.exec(body)) !== null) {
19
+ changeRequests.push({
20
+ component: m[1].trim(),
21
+ path: m[2].trim(),
22
+ rationale: m[3].trim(),
23
+ });
24
+ }
25
+ return { files, changeRequests };
26
+ }
27
+ /**
28
+ * Validate a vibe-emitted path is safe to write under repoRoot.
29
+ * Rejects absolute paths, parent-dir escapes, and paths that normalize
30
+ * outside the repo.
31
+ *
32
+ * Returns the absolute target path on success; throws on rejection.
33
+ */
34
+ export function validateAndResolveVibePath(repoRoot, relPath) {
35
+ if (isAbsolute(relPath)) {
36
+ throw new Error(`Vibe path safety: refusing absolute path: ${JSON.stringify(relPath)}`);
37
+ }
38
+ const normalized = normalize(relPath);
39
+ if (normalized.startsWith("..") || normalized === "..") {
40
+ throw new Error(`Vibe path safety: refusing parent-dir escape: ${JSON.stringify(relPath)}`);
41
+ }
42
+ // Defense in depth: after join, ensure result starts with repoRoot.
43
+ const abs = join(repoRoot, normalized);
44
+ if (!abs.startsWith(repoRoot + sep) && abs !== repoRoot) {
45
+ throw new Error(`Vibe path safety: resolved path escaped repoRoot: ${JSON.stringify(relPath)}`);
46
+ }
47
+ return abs;
48
+ }
49
+ export function writeVibeFiles(repoRoot, files) {
50
+ const written = [];
51
+ for (const f of files) {
52
+ const abs = validateAndResolveVibePath(repoRoot, f.path);
53
+ mkdirSync(dirname(abs), { recursive: true });
54
+ writeFileSync(abs, f.contents, "utf8");
55
+ written.push(f.path);
56
+ }
57
+ return written;
58
+ }
59
+ //# sourceMappingURL=emit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.js","sourceRoot":"","sources":["../../../src/commands/vibe/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAoCtE,MAAM,aAAa,GAAG,4CAA4C,CAAC;AACnE,MAAM,aAAa,GACjB,0GAA0G,CAAC;AAE7G,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,KAAK,GAAoB,EAAE,CAAC;IAClC,IAAI,CAAyB,CAAC;IAC9B,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrD,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC;QAC1B,8DAA8D;QAC9D,yCAAyC;QACzC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;QACxE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,cAAc,GAAwB,EAAE,CAAC;IAC/C,MAAM,KAAK,GAAG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b,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,KAAsB;IAEtB,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,0BAA0B,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACzD,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `slowcook vibe --spec <id>` — 0.15.0-α.1.
3
+ *
4
+ * Reads specs/story-<id>.yaml + brownfield extracts (.brewing/diagrams/)
5
+ * + code-map summary, runs the vibe agent (single-shot LLM call),
6
+ * writes the emitted mockup files to a `slowcook/mockup/story-<id>`
7
+ * branch, opens a draft PR labeled `slowcook-mockup`.
8
+ *
9
+ * The PR is the PM-review surface: preview-deploy renders it, PM
10
+ * comments / annotates / approves. Iteration is handled by the
11
+ * `slowcook plate` command (α.3); vibe is single-shot.
12
+ */
13
+ export declare function vibe(argv: string[], cliVersion: string): Promise<void>;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/vibe/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgMH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuH5E"}
@@ -0,0 +1,313 @@
1
+ /**
2
+ * `slowcook vibe --spec <id>` — 0.15.0-α.1.
3
+ *
4
+ * Reads specs/story-<id>.yaml + brownfield extracts (.brewing/diagrams/)
5
+ * + code-map summary, runs the vibe agent (single-shot LLM call),
6
+ * writes the emitted mockup files to a `slowcook/mockup/story-<id>`
7
+ * branch, opens a draft PR labeled `slowcook-mockup`.
8
+ *
9
+ * The PR is the PM-review surface: preview-deploy renders it, PM
10
+ * comments / annotates / approves. Iteration is handled by the
11
+ * `slowcook plate` command (α.3); vibe is single-shot.
12
+ */
13
+ import { execSync } from "node:child_process";
14
+ import { existsSync, readFileSync } from "node:fs";
15
+ import { join } from "node:path";
16
+ import { GitHubAdapter } from "@slowcook-ai/forge-github";
17
+ import { runVibe } from "./agent.js";
18
+ function parseArgs(argv) {
19
+ const args = {
20
+ specId: "",
21
+ repoRoot: process.cwd(),
22
+ model: "claude-opus-4-7",
23
+ dryRun: false,
24
+ baseBranch: "main",
25
+ };
26
+ for (let i = 0; i < argv.length; i++) {
27
+ const a = argv[i];
28
+ const next = argv[i + 1];
29
+ if (a === "--spec" && next) {
30
+ args.specId = next;
31
+ i++;
32
+ }
33
+ else if (a === "--cwd" && next) {
34
+ args.repoRoot = next;
35
+ i++;
36
+ }
37
+ else if (a === "--owner" && next) {
38
+ args.owner = next;
39
+ i++;
40
+ }
41
+ else if (a === "--repo" && next) {
42
+ args.repo = next;
43
+ i++;
44
+ }
45
+ else if (a === "--model" && next) {
46
+ args.model = next;
47
+ i++;
48
+ }
49
+ else if (a === "--base-branch" && next) {
50
+ args.baseBranch = next;
51
+ i++;
52
+ }
53
+ else if (a === "--dry-run") {
54
+ args.dryRun = true;
55
+ }
56
+ else if (a === "--help" || a === "-h") {
57
+ printHelp();
58
+ process.exit(0);
59
+ }
60
+ }
61
+ if (!args.specId) {
62
+ console.error("--spec <id> is required.");
63
+ printHelp();
64
+ process.exit(64);
65
+ }
66
+ return args;
67
+ }
68
+ function printHelp() {
69
+ console.log(`
70
+ slowcook vibe — design-first mockup generator (0.15 plate-pipeline α.1)
71
+
72
+ Reads a frozen spec YAML + brownfield extracts + code-map summary;
73
+ emits a runnable React mockup to a slowcook/mockup/story-<id> branch
74
+ and opens a draft PR. The mockup uses mock data via the data-layer
75
+ seam (src/lib/data/<domain>.{mock.ts,ts}); brew (--mode plate, later)
76
+ replaces the .ts stub with real fetches.
77
+
78
+ Usage:
79
+ slowcook vibe --spec <id> [--cwd <path>] [--owner <login>] [--repo <name>]
80
+ [--model <id>] [--base-branch <name>] [--dry-run]
81
+
82
+ Options:
83
+ --spec <id> Story id (e.g. 017). REQUIRED.
84
+ --cwd <path> Repo root (default: cwd).
85
+ --owner <login> GitHub owner (default: detect from git remote).
86
+ --repo <name> GitHub repo (default: detect from git remote).
87
+ --model <id> Anthropic model (default: claude-opus-4-7).
88
+ --base-branch <n> Base branch for the PR (default: main).
89
+ --dry-run Skip git/PR ops; just emit files in-place.
90
+
91
+ Environment:
92
+ ANTHROPIC_API_KEY (required) Anthropic API key.
93
+ GITHUB_TOKEN (required unless --dry-run) for opening the PR.
94
+ `);
95
+ }
96
+ /**
97
+ * Lightweight check for spec UI-surface eligibility. Looks for the
98
+ * `proposals: ... fixtures: ... by_domain:` shape with at least one
99
+ * domain entry. Avoids pulling in YAML parser for what's a regex
100
+ * sniff — but resilient to indentation variations.
101
+ *
102
+ * Returns true if the spec has at least one domain under
103
+ * `proposals.fixtures.by_domain`. Returns false otherwise (no fixtures
104
+ * block, empty by_domain, or unparseable spec).
105
+ */
106
+ function hasUiSurface(specYaml) {
107
+ // Anchor on the `proposals:` block at top-level (no leading
108
+ // whitespace). Then look for `fixtures:` indented under it.
109
+ const proposalsIdx = specYaml.search(/^proposals\s*:\s*$/m);
110
+ if (proposalsIdx < 0)
111
+ return false;
112
+ const tail = specYaml.slice(proposalsIdx);
113
+ // Match ` fixtures:` (any positive indent).
114
+ const fixturesMatch = tail.match(/^(\s+)fixtures\s*:\s*$/m);
115
+ if (!fixturesMatch)
116
+ return false;
117
+ const fixturesBlockStart = tail.indexOf(fixturesMatch[0]) + fixturesMatch[0].length;
118
+ // Look for `by_domain:` deeper than fixtures' indent.
119
+ const byDomainMatch = tail.slice(fixturesBlockStart).match(/^(\s+)by_domain\s*:\s*$/m);
120
+ if (!byDomainMatch)
121
+ return false;
122
+ const byDomainIndentLen = byDomainMatch[1].length;
123
+ // After by_domain:, expect at least one entry indented strictly
124
+ // deeper. Match `^<indent_deeper><word>:` lines.
125
+ const after = tail.slice(fixturesBlockStart + tail.slice(fixturesBlockStart).indexOf(byDomainMatch[0]) + byDomainMatch[0].length);
126
+ const entryRe = new RegExp(`^( {${byDomainIndentLen + 1},}|\\t+)([a-z][a-z0-9_-]*)\\s*:\\s*$`, "m");
127
+ return entryRe.test(after);
128
+ }
129
+ function detectOwnerRepo(cwd) {
130
+ try {
131
+ const url = execSync("git remote get-url origin", {
132
+ cwd,
133
+ encoding: "utf8",
134
+ stdio: ["ignore", "pipe", "ignore"],
135
+ }).trim();
136
+ const m = url.match(/github\.com[:/]([^/]+)\/([^/.]+)(?:\.git)?$/);
137
+ if (m && m[1] && m[2])
138
+ return { owner: m[1], repo: m[2] };
139
+ }
140
+ catch {
141
+ /* not a git repo */
142
+ }
143
+ return null;
144
+ }
145
+ /**
146
+ * Build the project-context blob fed to vibe's system prompt.
147
+ *
148
+ * Three sections, all optional:
149
+ * 1. .brewing/diagrams/schema.mmd — brownfield ERD
150
+ * 2. .brewing/diagrams/tokens.md — brownfield design tokens
151
+ * 3. .brewing/code-map.md — components/pages/helpers inventory
152
+ *
153
+ * If a file is missing, the section is skipped silently. Vibe still
154
+ * runs (with a "no project context" note) — but quality is much lower
155
+ * without these. Workflow templates run `slowcook map generate
156
+ * --emit-schema --emit-tokens` before vibe to ensure all three exist.
157
+ */
158
+ function buildProjectContext(repoRoot) {
159
+ const sections = [];
160
+ const schemaPath = join(repoRoot, ".brewing/diagrams/schema.mmd");
161
+ if (existsSync(schemaPath)) {
162
+ try {
163
+ const c = readFileSync(schemaPath, "utf8").trim();
164
+ sections.push("## Existing schema (extracted from `supabase/migrations/*.sql`)\n\n```mermaid\n" +
165
+ c +
166
+ "\n```\n\nReuse entity names verbatim when adding new tables; foreign keys must reference these names exactly.");
167
+ }
168
+ catch {
169
+ // ignore
170
+ }
171
+ }
172
+ const tokensPath = join(repoRoot, ".brewing/diagrams/tokens.md");
173
+ if (existsSync(tokensPath)) {
174
+ try {
175
+ const c = readFileSync(tokensPath, "utf8").trim();
176
+ sections.push("## Existing design tokens (extracted from `**/*.css`)\n\n" +
177
+ c +
178
+ "\n\nReuse these tokens by exact name (`bg-coral`, `var(--tint-celebrate)`); do NOT introduce new hex/rgb values.");
179
+ }
180
+ catch {
181
+ // ignore
182
+ }
183
+ }
184
+ const codeMapPath = join(repoRoot, ".brewing/code-map.md");
185
+ if (existsSync(codeMapPath)) {
186
+ try {
187
+ const c = readFileSync(codeMapPath, "utf8").trim();
188
+ sections.push("## Code-map (existing components, pages, helpers)\n\n" +
189
+ c +
190
+ "\n\nReuse components by their import path verbatim. NEVER duplicate functionality of an existing component under a new name.");
191
+ }
192
+ catch {
193
+ // ignore
194
+ }
195
+ }
196
+ if (sections.length === 0) {
197
+ return "_(No `.brewing/diagrams/` or `.brewing/code-map.md` extracts found. Vibe will run blind — strongly recommend running `slowcook map generate --emit-schema --emit-tokens` first.)_";
198
+ }
199
+ return sections.join("\n\n---\n\n");
200
+ }
201
+ export async function vibe(argv, cliVersion) {
202
+ const args = parseArgs(argv);
203
+ const anthropicApiKey = process.env["ANTHROPIC_API_KEY"];
204
+ if (!anthropicApiKey) {
205
+ console.error("ANTHROPIC_API_KEY environment variable is not set.");
206
+ process.exit(2);
207
+ }
208
+ // Spec must exist
209
+ const specPath = join(args.repoRoot, "specs", `story-${args.specId}.yaml`);
210
+ if (!existsSync(specPath)) {
211
+ console.error(`Spec not found at ${specPath}. Did you pass the right --spec id?`);
212
+ process.exit(2);
213
+ }
214
+ const specYaml = readFileSync(specPath, "utf8");
215
+ // Eligibility gate: vibe only runs on UI stories (proposals.fixtures
216
+ // populated). Backend-only specs skip the plate track entirely; the
217
+ // existing brew handles them in legacy mode. Soft-fail (exit 0) so
218
+ // the calling workflow doesn't fail spuriously.
219
+ if (!hasUiSurface(specYaml)) {
220
+ console.log(`slowcook vibe · story-${args.specId}: spec has no \`proposals.fixtures\` (or all seeds empty). This is a backend-only / non-UI story; skipping vibe.`);
221
+ return;
222
+ }
223
+ const projectContext = buildProjectContext(args.repoRoot);
224
+ console.log(`slowcook vibe · story-${args.specId} on ${args.repoRoot} (model: ${args.model}${args.dryRun ? ", dry-run" : ""})`);
225
+ const ctx = {
226
+ repoRoot: args.repoRoot,
227
+ anthropicApiKey,
228
+ model: args.model,
229
+ storyId: args.specId,
230
+ cliVersion,
231
+ specYaml,
232
+ projectContext,
233
+ };
234
+ const result = await runVibe(ctx);
235
+ if (result.kind === "format-failure") {
236
+ console.error(`Vibe emitted no <file> blocks after ${result.rounds} round(s). Spend: $${result.spendUsd.toFixed(4)}.`);
237
+ if (process.env["SLOWCOOK_DEBUG"]) {
238
+ console.error("\n--- agent's final text ---\n");
239
+ console.error(result.finalText);
240
+ }
241
+ process.exit(1);
242
+ }
243
+ console.log(`Vibe wrote ${result.writtenPaths.length} file(s) in ${result.rounds} round(s) (spend $${result.spendUsd.toFixed(4)}):`);
244
+ for (const p of result.writtenPaths)
245
+ console.log(` ${p}`);
246
+ if (result.changeRequests.length > 0) {
247
+ console.log(`\nVibe surfaced ${result.changeRequests.length} component-change request(s) for plate to handle:`);
248
+ for (const cr of result.changeRequests) {
249
+ console.log(` - ${cr.component} (${cr.path}): ${cr.rationale.slice(0, 100)}…`);
250
+ }
251
+ }
252
+ if (args.dryRun) {
253
+ console.log(`\n--dry-run: skipping git ops + PR opening. Files are emitted in-place at ${args.repoRoot}.`);
254
+ return;
255
+ }
256
+ const githubToken = process.env["GITHUB_TOKEN"];
257
+ if (!githubToken) {
258
+ console.error("\nGITHUB_TOKEN environment variable is not set. Pass --dry-run to skip git/PR ops.");
259
+ process.exit(2);
260
+ }
261
+ let owner = args.owner;
262
+ let repo = args.repo;
263
+ if (!owner || !repo) {
264
+ const detected = detectOwnerRepo(args.repoRoot);
265
+ if (!detected) {
266
+ console.error("Could not detect owner/repo from git remote. Pass --owner and --repo explicitly.");
267
+ process.exit(2);
268
+ }
269
+ owner = owner ?? detected.owner;
270
+ repo = repo ?? detected.repo;
271
+ }
272
+ const forge = new GitHubAdapter({ owner, repo, token: githubToken });
273
+ const branch = `slowcook/mockup/story-${args.specId}`;
274
+ await forge.git.createBranch(branch);
275
+ for (const p of result.writtenPaths)
276
+ await forge.git.stage(p);
277
+ await forge.git.commit(`vibe: mockup for story-${args.specId}\n\nGenerated by slowcook vibe@${cliVersion}.\n`);
278
+ await forge.git.push(branch);
279
+ try {
280
+ const pr = await forge.createPullRequest({
281
+ head: branch,
282
+ base: args.baseBranch,
283
+ title: `mockup: story-${args.specId}`,
284
+ body: buildPrBody(args.specId, result.writtenPaths, result.changeRequests, result.spendUsd, cliVersion),
285
+ draft: true,
286
+ labels: ["slowcook-mockup"],
287
+ });
288
+ console.log(`\nDraft PR opened: ${pr.url}`);
289
+ console.log("Review the preview deploy; comment `/plate <prose>` to iterate.");
290
+ }
291
+ catch (e) {
292
+ console.error(`Files committed + pushed to '${branch}', but PR creation failed: ${e.message}`);
293
+ process.exit(2);
294
+ }
295
+ }
296
+ function buildPrBody(specId, writtenPaths, changeRequests, spendUsd, cliVersion) {
297
+ const out = [];
298
+ out.push(`## Mockup for story-${specId}\n\nGenerated by \`slowcook vibe@${cliVersion}\` (spend $${spendUsd.toFixed(4)}).`);
299
+ out.push(`\nThis is a runnable mockup with mock data. The PM reviews the preview deploy + comments \`/plate <prose>\` to iterate. Brew (\`--mode plate\`, after recipe writes tests against this branch's DOM) will replace \`src/lib/data/<domain>.ts\` stubs with real fetches and add API handlers + migrations — leaving these UI files frozen.\n`);
300
+ out.push(`\n## Files emitted (${writtenPaths.length})\n`);
301
+ for (const p of writtenPaths)
302
+ out.push(`- \`${p}\``);
303
+ if (changeRequests.length > 0) {
304
+ out.push(`\n## Component-change requests (${changeRequests.length})\n`);
305
+ out.push(`Vibe identified existing components that would benefit from a structural change (new prop, etc.) but did NOT modify them. PM reviews + plate applies on iteration.\n`);
306
+ for (const cr of changeRequests) {
307
+ out.push(`### \`${cr.component}\` — \`${cr.path}\`\n\n${cr.rationale}\n`);
308
+ }
309
+ }
310
+ out.push(`\n---\nMerge this PR after PM approval to fire \`recipe\` (writes tests against this branch's DOM) → \`brew --mode plate\` (real data layer + API + migrations).`);
311
+ return out.join("\n");
312
+ }
313
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/vibe/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAoB,MAAM,YAAY,CAAC;AAavD,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,IAAI,GAAa;QACrB,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,OAAO,CAAC,GAAG,EAAE;QACvB,KAAK,EAAE,iBAAiB;QACxB,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,MAAM;KACnB,CAAC;IACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,QAAQ,IAAI,IAAI,EAAE,CAAC;YAAC,IAAI,CAAC,M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;IACD,GAAG,CAAC,IAAI,CACN,kKAAkK,CACnK,CAAC;IACF,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Re-export shim — see investigate/prompts.ts for the rationale.
3
+ * Source of truth: `@slowcook-ai/llm-anthropic/prompts/vibe`.
4
+ */
5
+ export { VIBE_SYSTEM, VIBE_TOOLS, buildVibeUserPrompt, type VibeUserPromptArgs, } from "@slowcook-ai/llm-anthropic";
6
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/commands/vibe/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,KAAK,kBAAkB,GACxB,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Re-export shim — see investigate/prompts.ts for the rationale.
3
+ * Source of truth: `@slowcook-ai/llm-anthropic/prompts/vibe`.
4
+ */
5
+ export { VIBE_SYSTEM, VIBE_TOOLS, buildVibeUserPrompt, } from "@slowcook-ai/llm-anthropic";
6
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/commands/vibe/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,WAAW,EACX,UAAU,EACV,mBAAmB,GAEpB,MAAM,4BAA4B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slowcook-ai/cli",
3
- "version": "0.14.0-alpha.6",
3
+ "version": "0.15.0-alpha.2",
4
4
  "description": "CLI for the slowcook brewing harness",
5
5
  "license": "MIT",
6
6
  "author": "aminazar",
@@ -40,9 +40,9 @@
40
40
  "zod": "^3.23.8",
41
41
  "@slowcook-ai/core": "^0.12.0",
42
42
  "@slowcook-ai/stack-ts": "^0.9.6",
43
- "@slowcook-ai/forge-github": "^0.10.1",
44
- "@slowcook-ai/recorder": "^0.9.1",
45
- "@slowcook-ai/llm-anthropic": "^0.9.0"
43
+ "@slowcook-ai/llm-anthropic": "^0.10.0",
44
+ "@slowcook-ai/forge-github": "^0.10.2",
45
+ "@slowcook-ai/recorder": "^0.9.1"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"