@slowcook-ai/cli 0.13.0 → 0.14.0-alpha.5

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 (57) hide show
  1. package/dist/cli.js +9 -0
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/brew/prompts.d.ts +3 -290
  4. package/dist/commands/brew/prompts.d.ts.map +1 -1
  5. package/dist/commands/brew/prompts.js +3 -462
  6. package/dist/commands/brew/prompts.js.map +1 -1
  7. package/dist/commands/extract/index.d.ts +2 -0
  8. package/dist/commands/extract/index.d.ts.map +1 -0
  9. package/dist/commands/extract/index.js +90 -0
  10. package/dist/commands/extract/index.js.map +1 -0
  11. package/dist/commands/init/templates.d.ts.map +1 -1
  12. package/dist/commands/init/templates.js +4 -0
  13. package/dist/commands/init/templates.js.map +1 -1
  14. package/dist/commands/investigate/prompts.d.ts +7 -87
  15. package/dist/commands/investigate/prompts.d.ts.map +1 -1
  16. package/dist/commands/investigate/prompts.js +7 -234
  17. package/dist/commands/investigate/prompts.js.map +1 -1
  18. package/dist/commands/map/emit-tokens.d.ts +53 -0
  19. package/dist/commands/map/emit-tokens.d.ts.map +1 -0
  20. package/dist/commands/map/emit-tokens.js +316 -0
  21. package/dist/commands/map/emit-tokens.js.map +1 -0
  22. package/dist/commands/map/index.d.ts +17 -0
  23. package/dist/commands/map/index.d.ts.map +1 -1
  24. package/dist/commands/map/index.js +72 -5
  25. package/dist/commands/map/index.js.map +1 -1
  26. package/dist/commands/refine/agent.d.ts.map +1 -1
  27. package/dist/commands/refine/agent.js +21 -0
  28. package/dist/commands/refine/agent.js.map +1 -1
  29. package/dist/commands/refine/context.d.ts +11 -0
  30. package/dist/commands/refine/context.d.ts.map +1 -1
  31. package/dist/commands/refine/context.js +45 -0
  32. package/dist/commands/refine/context.js.map +1 -1
  33. package/dist/commands/refine/mock-fixtures.d.ts +39 -0
  34. package/dist/commands/refine/mock-fixtures.d.ts.map +1 -0
  35. package/dist/commands/refine/mock-fixtures.js +86 -0
  36. package/dist/commands/refine/mock-fixtures.js.map +1 -0
  37. package/dist/commands/refine/prompts.d.ts +10 -21
  38. package/dist/commands/refine/prompts.d.ts.map +1 -1
  39. package/dist/commands/refine/prompts.js +10 -376
  40. package/dist/commands/refine/prompts.js.map +1 -1
  41. package/dist/commands/refine/proposals-synth.d.ts +9 -1
  42. package/dist/commands/refine/proposals-synth.d.ts.map +1 -1
  43. package/dist/commands/refine/proposals-synth.js +488 -22
  44. package/dist/commands/refine/proposals-synth.js.map +1 -1
  45. package/dist/commands/refine/spec-yaml.d.ts +306 -128
  46. package/dist/commands/refine/spec-yaml.d.ts.map +1 -1
  47. package/dist/commands/refine/spec-yaml.js +33 -0
  48. package/dist/commands/refine/spec-yaml.js.map +1 -1
  49. package/dist/commands/sift/prompts.d.ts +3 -111
  50. package/dist/commands/sift/prompts.d.ts.map +1 -1
  51. package/dist/commands/sift/prompts.js +3 -190
  52. package/dist/commands/sift/prompts.js.map +1 -1
  53. package/dist/commands/testgen/prompts.d.ts +3 -13
  54. package/dist/commands/testgen/prompts.d.ts.map +1 -1
  55. package/dist/commands/testgen/prompts.js +3 -384
  56. package/dist/commands/testgen/prompts.js.map +1 -1
  57. package/package.json +4 -4
@@ -1,90 +1,10 @@
1
1
  /**
2
- * Prompts for the `slowcook investigate` agent.
3
- *
4
- * The investigate agent is the bug-flow analogue of refine. Where
5
- * refine asks PM clarifying questions, investigate reads code to
6
- * find the failure locus. The two roles are mirror images:
7
- *
8
- * refine investigate
9
- * ────── ───────────
10
- * "what to build" "what's broken"
11
- * text-only code-reading
12
- * 2-3 questions 0-1 questions (only on truly ambiguous symptoms)
13
- * spec.yaml bug-profile.yaml
14
- *
15
- * The system prompt below names the role explicitly so the LLM
16
- * doesn't drift back into refine-style behaviour (asking design
17
- * questions about a 1-line column rename, etc.).
2
+ * Re-export shim the actual prompt strings + tool defs live in
3
+ * `@slowcook-ai/llm-anthropic` as of 0.13.1 (per the llm-agnosticism
4
+ * refactor). Kept as a passthrough so internal imports
5
+ * (`from "./prompts.js"`) keep working without touching every agent
6
+ * file. A future GPT / Gemini adapter package would publish drop-in
7
+ * replacements with the same exported names.
18
8
  */
19
- export declare const INVESTIGATE_SYSTEM = "You are the investigate agent for slowcook \u2014 a TDD-first agentic development harness with a bug-fix flow.\n\n## Your role\n\nYou receive a GitHub issue describing a bug. Your job: read the codebase, identify the failure locus (file, line, function) and the actual root cause, and emit a structured `bug-profile.yaml` that the next agent (sift) will use as its contract.\n\nYou are NOT refine. Refine asks PM clarifying questions and emits design specs. You investigate failed reality. Different posture, different tools, different output.\n\n## Posture\n\n- **Read the code.** The issue body tells you the symptom. The codebase tells you the cause. You have read tools \u2014 use them. A diagnosis built from issue text alone is hand-wavy; a diagnosis built from `outline_file(actual-route.ts)` + `find_references(broken-symbol)` + `grep -r 'thing_X'` is honest.\n- **Don't paraphrase the symptom.** The PM's words in the issue body are the authoritative description of what's broken from the user's perspective. Copy the symptom verbatim where you can; mild paraphrase is OK only when the issue body is unstructured prose. (See slowcook memory: \"PM intent carries weight\" \u2014 you cannot silently weaken it.)\n- **Don't suggest a fix.** Your output names the failure locus + the regression assertion. The actual code change is sift's job. If you find yourself writing \"and the fix should rename X to Y\", stop \u2014 that's beyond your scope.\n- **Ask only when truly stuck.** Most bugs have a single failure locus discoverable from one or two reads. If after reading the obvious files you can't find the failure mode, ask one focused clarifying question on the issue. Do NOT ask multiple rounds of questions like refine does.\n\n## Critical: read the code, NOT just the issue body\n\nIssue bodies often contain BOTH the symptom *and* the reporter's proposed fix (\"Expected fix: ...\"). The proposed fix is a hypothesis \u2014 it has not been verified or applied to the codebase. Your diagnosis must be based on **what the code actually contains right now**, not on what the issue says it should contain.\n\nConcrete rule: before claiming \"X is fixed\" or \"Y now does Z\", read X or Y with a tool. If the issue body describes a fix and you find the code in its pre-fix state, the bug is still active and you investigate it. If the code already contains the fix, the bug is closed and your profile should say so explicitly (`status: closed` is not in the v1 schema, but the diagnosis can name the resolution and the failure_locus.diagnosis can read \"bug already fixed in <commit/PR>\").\n\n## Output\n\nA single `bug-profile.yaml` document with these fields:\n\n```yaml\nschema_version: 1\nbug_id: B-<n> # filled in by slowcook, you don't pick this\ntitle: \"<one-line bug title>\"\nsource_issue: \"#<NNN>\" # the issue you investigated\nstatus: investigated\ninvestigated_by: slowcook-investigate@<version>\ncreated_at: <ISO-8601 UTC>\n\nsymptom:\n - \"<verbatim or near-verbatim from issue body \u2014 what the user sees>\"\n\nexpected:\n - \"<what should happen instead \u2014 from issue body or implicit>\"\n\nreproduction:\n - \"<minimum step 1>\"\n - \"<minimum step 2>\"\n\nfailure_locus:\n file: \"src/path/to/broken-file.ts\"\n line: 42 # optional; omit if not pinpointable\n function: handlerName # optional\n diagnosis: |\n <One paragraph: why is the bug happening? Be specific. Reference\n the read evidence: \"src/foo.ts:42 selects column 'bar' but no\n migration adds 'bar' (verified: grep returns 0 hits)\".>\n\nregression_assertion:\n - \"Given <repro context>, when <action>, then <correct behavior>\"\n - \"(may be multiple if the bug has compound effects)\"\n\nfix_scope:\n - \"src/path/to/broken-file.ts\"\n - \"supabase/migrations/\" # for example, when the fix needs DDL\n\nrelated_specs: # optional, omit if none\n - id: \"story-007\"\n relationship: touches\n note: \"/api/X is owned by story-007's spec; check that contract\"\n```\n\n**Output format is strict.** Wrap the YAML in a single `<bug_profile>...</bug_profile>` XML block. The slowcook parser greps for the literal opening + closing tags; any output without those exact tags fails parsing and the run errors out.\n\nConcrete example of the expected final-message format:\n\n```\n<bug_profile>\nschema_version: 1\ntitle: \"<one-line bug title>\"\nsource_issue: \"#135\"\nstatus: investigated\ninvestigated_by: \"(slowcook stamps this)\"\ncreated_at: \"(slowcook stamps this)\"\n\nsymptom:\n - \"Verbatim user-visible failure mode.\"\n\nexpected:\n - \"What should happen instead.\"\n\nreproduction:\n - \"Step 1.\"\n\nfailure_locus:\n file: \"src/path/to/broken.ts\"\n line: 42\n function: \"handler\"\n diagnosis: |\n One paragraph naming the actual cause, citing read evidence\n (e.g., 'src/foo.ts:42 selects column bar but no migration adds\n bar \u2014 verified via grep').\n\nregression_assertion:\n - \"Given <repro context>, when <action>, then <correct behavior>.\"\n\nfix_scope:\n - \"src/path/to/broken.ts\"\n</bug_profile>\n```\n\nIf you have one preliminary thought to share, put it BEFORE the `<bug_profile>` block \u2014 but the parser only reads what's inside the tags. Anything outside is ignored.\n\nIf you cannot find a single failure locus from reading the obvious files, emit a `<halt>` block with a one-line description of what you couldn't disambiguate. Do not emit prose explaining your confusion \u2014 the slowcook parser doesn't read prose. `<halt>` is the structured way to ask for help.\n\n## Tools\n\nYou have read tools (read_file, outline_file, find_references, find_definition, grep, list_directory) \u2014 exactly the same ones brew uses for pre-write discovery. You do NOT have write_file: investigate doesn't write code, only diagnoses.\n\n## When to halt voluntarily\n\nIf after reading the issue body and the obvious files (mirrored path from issue mentions, fetch URLs, table names, etc.) you cannot identify a single failure locus, halt by emitting a `<halt>` block with a one-line description of what you couldn't disambiguate. Slowcook will surface this to the operator who will either edit the issue with more context or take the bug out of investigate flow. **Don't guess** \u2014 a wrong bug profile costs sift more than a clean halt costs the operator's time.\n";
20
- /**
21
- * Tool definitions the investigate agent has access to. Mirrors the
22
- * brew read-only subset (no write_file): investigate diagnoses, sift
23
- * fixes.
24
- *
25
- * Kept minimal in alpha.2a — alpha.2b wires the actual ts-morph
26
- * implementations from brew/retrieval.ts.
27
- */
28
- export declare const INVESTIGATE_TOOLS: ({
29
- name: string;
30
- description: string;
31
- input_schema: {
32
- type: "object";
33
- properties: {
34
- path: {
35
- type: "string";
36
- description: string;
37
- };
38
- symbol?: undefined;
39
- pattern?: undefined;
40
- glob?: undefined;
41
- };
42
- required: string[];
43
- };
44
- } | {
45
- name: string;
46
- description: string;
47
- input_schema: {
48
- type: "object";
49
- properties: {
50
- symbol: {
51
- type: "string";
52
- description: string;
53
- };
54
- path?: undefined;
55
- pattern?: undefined;
56
- glob?: undefined;
57
- };
58
- required: string[];
59
- };
60
- } | {
61
- name: string;
62
- description: string;
63
- input_schema: {
64
- type: "object";
65
- properties: {
66
- pattern: {
67
- type: "string";
68
- description: string;
69
- };
70
- glob: {
71
- type: "string";
72
- description: string;
73
- };
74
- path?: undefined;
75
- symbol?: undefined;
76
- };
77
- required: string[];
78
- };
79
- })[];
80
- /**
81
- * Build the per-issue user message. The issue body becomes the
82
- * agent's primary input; it tools its way out from there.
83
- */
84
- export declare function buildInvestigateUserPrompt(args: {
85
- issueNumber: number;
86
- issueTitle: string;
87
- issueBody: string;
88
- prior_comments?: string[];
89
- }): string;
9
+ export { INVESTIGATE_SYSTEM, INVESTIGATE_TOOLS, buildInvestigateUserPrompt, } from "@slowcook-ai/llm-anthropic";
90
10
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/commands/investigate/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,kBAAkB,iwMAqH9B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsE7B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,GAAG,MAAM,CAsBT"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/commands/investigate/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC"}
@@ -1,237 +1,10 @@
1
1
  /**
2
- * Prompts for the `slowcook investigate` agent.
3
- *
4
- * The investigate agent is the bug-flow analogue of refine. Where
5
- * refine asks PM clarifying questions, investigate reads code to
6
- * find the failure locus. The two roles are mirror images:
7
- *
8
- * refine investigate
9
- * ────── ───────────
10
- * "what to build" "what's broken"
11
- * text-only code-reading
12
- * 2-3 questions 0-1 questions (only on truly ambiguous symptoms)
13
- * spec.yaml bug-profile.yaml
14
- *
15
- * The system prompt below names the role explicitly so the LLM
16
- * doesn't drift back into refine-style behaviour (asking design
17
- * questions about a 1-line column rename, etc.).
2
+ * Re-export shim the actual prompt strings + tool defs live in
3
+ * `@slowcook-ai/llm-anthropic` as of 0.13.1 (per the llm-agnosticism
4
+ * refactor). Kept as a passthrough so internal imports
5
+ * (`from "./prompts.js"`) keep working without touching every agent
6
+ * file. A future GPT / Gemini adapter package would publish drop-in
7
+ * replacements with the same exported names.
18
8
  */
19
- export const INVESTIGATE_SYSTEM = `You are the investigate agent for slowcook — a TDD-first agentic development harness with a bug-fix flow.
20
-
21
- ## Your role
22
-
23
- You receive a GitHub issue describing a bug. Your job: read the codebase, identify the failure locus (file, line, function) and the actual root cause, and emit a structured \`bug-profile.yaml\` that the next agent (sift) will use as its contract.
24
-
25
- You are NOT refine. Refine asks PM clarifying questions and emits design specs. You investigate failed reality. Different posture, different tools, different output.
26
-
27
- ## Posture
28
-
29
- - **Read the code.** The issue body tells you the symptom. The codebase tells you the cause. You have read tools — use them. A diagnosis built from issue text alone is hand-wavy; a diagnosis built from \`outline_file(actual-route.ts)\` + \`find_references(broken-symbol)\` + \`grep -r 'thing_X'\` is honest.
30
- - **Don't paraphrase the symptom.** The PM's words in the issue body are the authoritative description of what's broken from the user's perspective. Copy the symptom verbatim where you can; mild paraphrase is OK only when the issue body is unstructured prose. (See slowcook memory: "PM intent carries weight" — you cannot silently weaken it.)
31
- - **Don't suggest a fix.** Your output names the failure locus + the regression assertion. The actual code change is sift's job. If you find yourself writing "and the fix should rename X to Y", stop — that's beyond your scope.
32
- - **Ask only when truly stuck.** Most bugs have a single failure locus discoverable from one or two reads. If after reading the obvious files you can't find the failure mode, ask one focused clarifying question on the issue. Do NOT ask multiple rounds of questions like refine does.
33
-
34
- ## Critical: read the code, NOT just the issue body
35
-
36
- Issue bodies often contain BOTH the symptom *and* the reporter's proposed fix ("Expected fix: ..."). The proposed fix is a hypothesis — it has not been verified or applied to the codebase. Your diagnosis must be based on **what the code actually contains right now**, not on what the issue says it should contain.
37
-
38
- Concrete rule: before claiming "X is fixed" or "Y now does Z", read X or Y with a tool. If the issue body describes a fix and you find the code in its pre-fix state, the bug is still active and you investigate it. If the code already contains the fix, the bug is closed and your profile should say so explicitly (\`status: closed\` is not in the v1 schema, but the diagnosis can name the resolution and the failure_locus.diagnosis can read "bug already fixed in <commit/PR>").
39
-
40
- ## Output
41
-
42
- A single \`bug-profile.yaml\` document with these fields:
43
-
44
- \`\`\`yaml
45
- schema_version: 1
46
- bug_id: B-<n> # filled in by slowcook, you don't pick this
47
- title: "<one-line bug title>"
48
- source_issue: "#<NNN>" # the issue you investigated
49
- status: investigated
50
- investigated_by: slowcook-investigate@<version>
51
- created_at: <ISO-8601 UTC>
52
-
53
- symptom:
54
- - "<verbatim or near-verbatim from issue body — what the user sees>"
55
-
56
- expected:
57
- - "<what should happen instead — from issue body or implicit>"
58
-
59
- reproduction:
60
- - "<minimum step 1>"
61
- - "<minimum step 2>"
62
-
63
- failure_locus:
64
- file: "src/path/to/broken-file.ts"
65
- line: 42 # optional; omit if not pinpointable
66
- function: handlerName # optional
67
- diagnosis: |
68
- <One paragraph: why is the bug happening? Be specific. Reference
69
- the read evidence: "src/foo.ts:42 selects column 'bar' but no
70
- migration adds 'bar' (verified: grep returns 0 hits)".>
71
-
72
- regression_assertion:
73
- - "Given <repro context>, when <action>, then <correct behavior>"
74
- - "(may be multiple if the bug has compound effects)"
75
-
76
- fix_scope:
77
- - "src/path/to/broken-file.ts"
78
- - "supabase/migrations/" # for example, when the fix needs DDL
79
-
80
- related_specs: # optional, omit if none
81
- - id: "story-007"
82
- relationship: touches
83
- note: "/api/X is owned by story-007's spec; check that contract"
84
- \`\`\`
85
-
86
- **Output format is strict.** Wrap the YAML in a single \`<bug_profile>...</bug_profile>\` XML block. The slowcook parser greps for the literal opening + closing tags; any output without those exact tags fails parsing and the run errors out.
87
-
88
- Concrete example of the expected final-message format:
89
-
90
- \`\`\`
91
- <bug_profile>
92
- schema_version: 1
93
- title: "<one-line bug title>"
94
- source_issue: "#135"
95
- status: investigated
96
- investigated_by: "(slowcook stamps this)"
97
- created_at: "(slowcook stamps this)"
98
-
99
- symptom:
100
- - "Verbatim user-visible failure mode."
101
-
102
- expected:
103
- - "What should happen instead."
104
-
105
- reproduction:
106
- - "Step 1."
107
-
108
- failure_locus:
109
- file: "src/path/to/broken.ts"
110
- line: 42
111
- function: "handler"
112
- diagnosis: |
113
- One paragraph naming the actual cause, citing read evidence
114
- (e.g., 'src/foo.ts:42 selects column bar but no migration adds
115
- bar — verified via grep').
116
-
117
- regression_assertion:
118
- - "Given <repro context>, when <action>, then <correct behavior>."
119
-
120
- fix_scope:
121
- - "src/path/to/broken.ts"
122
- </bug_profile>
123
- \`\`\`
124
-
125
- If you have one preliminary thought to share, put it BEFORE the \`<bug_profile>\` block — but the parser only reads what's inside the tags. Anything outside is ignored.
126
-
127
- If you cannot find a single failure locus from reading the obvious files, emit a \`<halt>\` block with a one-line description of what you couldn't disambiguate. Do not emit prose explaining your confusion — the slowcook parser doesn't read prose. \`<halt>\` is the structured way to ask for help.
128
-
129
- ## Tools
130
-
131
- You have read tools (read_file, outline_file, find_references, find_definition, grep, list_directory) — exactly the same ones brew uses for pre-write discovery. You do NOT have write_file: investigate doesn't write code, only diagnoses.
132
-
133
- ## When to halt voluntarily
134
-
135
- If after reading the issue body and the obvious files (mirrored path from issue mentions, fetch URLs, table names, etc.) you cannot identify a single failure locus, halt by emitting a \`<halt>\` block with a one-line description of what you couldn't disambiguate. Slowcook will surface this to the operator who will either edit the issue with more context or take the bug out of investigate flow. **Don't guess** — a wrong bug profile costs sift more than a clean halt costs the operator's time.
136
- `;
137
- /**
138
- * Tool definitions the investigate agent has access to. Mirrors the
139
- * brew read-only subset (no write_file): investigate diagnoses, sift
140
- * fixes.
141
- *
142
- * Kept minimal in alpha.2a — alpha.2b wires the actual ts-morph
143
- * implementations from brew/retrieval.ts.
144
- */
145
- export const INVESTIGATE_TOOLS = [
146
- {
147
- name: "read_file",
148
- description: "Read a file's full contents. Use sparingly — outline_file is cheaper for initial scoping.",
149
- input_schema: {
150
- type: "object",
151
- properties: {
152
- path: { type: "string", description: "Repo-relative path." },
153
- },
154
- required: ["path"],
155
- },
156
- },
157
- {
158
- name: "outline_file",
159
- description: "Compact ~200-token outline of a TS/TSX file: imports, top-level exports, signatures with line numbers. Use this first to decide whether a file is relevant.",
160
- input_schema: {
161
- type: "object",
162
- properties: {
163
- path: { type: "string", description: "Repo-relative path." },
164
- },
165
- required: ["path"],
166
- },
167
- },
168
- {
169
- name: "list_directory",
170
- description: "List entries in a directory.",
171
- input_schema: {
172
- type: "object",
173
- properties: {
174
- path: { type: "string", description: "Repo-relative path." },
175
- },
176
- required: ["path"],
177
- },
178
- },
179
- {
180
- name: "find_references",
181
- description: "Find all references to a symbol across the repo (definitions + use sites). Returns file:line entries.",
182
- input_schema: {
183
- type: "object",
184
- properties: {
185
- symbol: {
186
- type: "string",
187
- description: "Identifier name to search for.",
188
- },
189
- },
190
- required: ["symbol"],
191
- },
192
- },
193
- {
194
- name: "grep",
195
- description: "Repo-wide ripgrep for a literal or regex string. Use when find_references is too narrow (e.g. searching column names in SQL files).",
196
- input_schema: {
197
- type: "object",
198
- properties: {
199
- pattern: {
200
- type: "string",
201
- description: "Pattern to search.",
202
- },
203
- glob: {
204
- type: "string",
205
- description: "Optional glob restriction (e.g. 'supabase/migrations/*.sql').",
206
- },
207
- },
208
- required: ["pattern"],
209
- },
210
- },
211
- ];
212
- /**
213
- * Build the per-issue user message. The issue body becomes the
214
- * agent's primary input; it tools its way out from there.
215
- */
216
- export function buildInvestigateUserPrompt(args) {
217
- const lines = [];
218
- lines.push(`# Investigate bug — issue #${args.issueNumber}`);
219
- lines.push("");
220
- lines.push(`## Title`);
221
- lines.push(args.issueTitle);
222
- lines.push("");
223
- lines.push(`## Issue body`);
224
- lines.push(args.issueBody);
225
- if (args.prior_comments && args.prior_comments.length > 0) {
226
- lines.push("");
227
- lines.push(`## Prior comments (in chronological order)`);
228
- for (const c of args.prior_comments) {
229
- lines.push("---");
230
- lines.push(c);
231
- }
232
- }
233
- lines.push("");
234
- lines.push(`## Your task\n\nInvestigate. Identify the failure locus + diagnosis. Emit a single \`<bug_profile>\` block following the system-prompt schema.`);
235
- return lines.join("\n");
236
- }
9
+ export { INVESTIGATE_SYSTEM, INVESTIGATE_TOOLS, buildInvestigateUserPrompt, } from "@slowcook-ai/llm-anthropic";
237
10
  //# sourceMappingURL=prompts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/commands/investigate/prompts.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/commands/investigate/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * 0.13.3 (brownfield-extraction track for 0.14 mockup-first refinement) —
3
+ * walk `**\/*.css` files (excluding build output) and extract design tokens
4
+ * declared via `:root { --var: value }` and `@theme { --var: value }` blocks.
5
+ *
6
+ * Supports the Tailwind v4 idiom (inline `@theme`) and classic CSS-vars
7
+ * theming. Light/dark variants captured separately when `:root` lives
8
+ * inside `@media (prefers-color-scheme: dark)`.
9
+ *
10
+ * Output: `.brewing/diagrams/tokens.md` — refine reads this so its
11
+ * mockup proposals reuse the consumer's existing palette / scale rather
12
+ * than inventing arbitrary hex values.
13
+ */
14
+ export interface TokenEntry {
15
+ name: string;
16
+ value: string;
17
+ variant: "light" | "dark";
18
+ source: string;
19
+ }
20
+ export interface TokenCatalog {
21
+ light: TokenEntry[];
22
+ dark: TokenEntry[];
23
+ themeMappings: TokenEntry[];
24
+ filesScanned: number;
25
+ }
26
+ /**
27
+ * Parse a CSS file's :root and @theme blocks into TokenEntry rows.
28
+ *
29
+ * Strategy: walk top-level by tracking brace depth + remembering the
30
+ * last selector / at-rule prefix. We need only enough to distinguish:
31
+ * - `:root { ... }` at depth 0 → light variant
32
+ * - `:root { ... }` inside `@media (prefers-color-scheme: dark)` → dark
33
+ * - `@theme { ... }` → theme mappings (Tailwind v4)
34
+ *
35
+ * We are not building a full CSS AST; the regex+brace pass is enough
36
+ * for the conventional vars-in-:root pattern and degrades gracefully
37
+ * on weird input by emitting fewer rows.
38
+ */
39
+ export declare function parseCssTokens(content: string, sourceLabel: string): {
40
+ light: TokenEntry[];
41
+ dark: TokenEntry[];
42
+ themeMappings: TokenEntry[];
43
+ };
44
+ export declare function emitTokensCatalog(repoRoot: string): {
45
+ written: boolean;
46
+ filesScanned: number;
47
+ lightCount?: number;
48
+ darkCount?: number;
49
+ themeCount?: number;
50
+ skippedReason?: string;
51
+ };
52
+ export declare function renderTokensMarkdown(catalog: TokenCatalog): string;
53
+ //# sourceMappingURL=emit-tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit-tokens.d.ts","sourceRoot":"","sources":["../../../src/commands/map/emit-tokens.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB;AA0CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAClB;IAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAC;IAAC,aAAa,EAAE,UAAU,EAAE,CAAA;CAAE,CAsE1E;AAkGD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAoDA;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAmDlE"}