@slowcook-ai/cli 0.12.12 → 0.13.0
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 +41 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/brew/agent.d.ts.map +1 -1
- package/dist/commands/brew/agent.js +19 -6
- package/dist/commands/brew/agent.js.map +1 -1
- package/dist/commands/chef/classify.d.ts +65 -0
- package/dist/commands/chef/classify.d.ts.map +1 -0
- package/dist/commands/chef/classify.js +102 -0
- package/dist/commands/chef/classify.js.map +1 -0
- package/dist/commands/chef/index.d.ts +22 -0
- package/dist/commands/chef/index.d.ts.map +1 -0
- package/dist/commands/chef/index.js +287 -0
- package/dist/commands/chef/index.js.map +1 -0
- package/dist/commands/dispatch/index.d.ts.map +1 -1
- package/dist/commands/dispatch/index.js +10 -3
- package/dist/commands/dispatch/index.js.map +1 -1
- package/dist/commands/investigate/agent.d.ts +68 -0
- package/dist/commands/investigate/agent.d.ts.map +1 -0
- package/dist/commands/investigate/agent.js +503 -0
- package/dist/commands/investigate/agent.js.map +1 -0
- package/dist/commands/investigate/index.d.ts +43 -0
- package/dist/commands/investigate/index.d.ts.map +1 -0
- package/dist/commands/investigate/index.js +413 -0
- package/dist/commands/investigate/index.js.map +1 -0
- package/dist/commands/investigate/prompts.d.ts +90 -0
- package/dist/commands/investigate/prompts.d.ts.map +1 -0
- package/dist/commands/investigate/prompts.js +237 -0
- package/dist/commands/investigate/prompts.js.map +1 -0
- package/dist/commands/investigate/schema.d.ts +91 -0
- package/dist/commands/investigate/schema.d.ts.map +1 -0
- package/dist/commands/investigate/schema.js +87 -0
- package/dist/commands/investigate/schema.js.map +1 -0
- package/dist/commands/on-brew-merged/index.d.ts.map +1 -1
- package/dist/commands/on-brew-merged/index.js +27 -6
- package/dist/commands/on-brew-merged/index.js.map +1 -1
- package/dist/commands/recipe-regression/agent.d.ts +94 -0
- package/dist/commands/recipe-regression/agent.d.ts.map +1 -0
- package/dist/commands/recipe-regression/agent.js +442 -0
- package/dist/commands/recipe-regression/agent.js.map +1 -0
- package/dist/commands/recipe-regression/index.d.ts +61 -0
- package/dist/commands/recipe-regression/index.d.ts.map +1 -0
- package/dist/commands/recipe-regression/index.js +187 -0
- package/dist/commands/recipe-regression/index.js.map +1 -0
- package/dist/commands/sift/agent.d.ts +52 -0
- package/dist/commands/sift/agent.d.ts.map +1 -0
- package/dist/commands/sift/agent.js +392 -0
- package/dist/commands/sift/agent.js.map +1 -0
- package/dist/commands/sift/index.d.ts +23 -0
- package/dist/commands/sift/index.d.ts.map +1 -0
- package/dist/commands/sift/index.js +314 -0
- package/dist/commands/sift/index.js.map +1 -0
- package/dist/commands/sift/prompts.d.ts +114 -0
- package/dist/commands/sift/prompts.d.ts.map +1 -0
- package/dist/commands/sift/prompts.js +193 -0
- package/dist/commands/sift/prompts.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,237 @@
|
|
|
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.).
|
|
18
|
+
*/
|
|
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
|
+
}
|
|
237
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/commands/investigate/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqHjC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EACT,2FAA2F;QAC7F,YAAY,EAAE;YACZ,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE;aACtE;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,6JAA6J;QAC/J,YAAY,EAAE;YACZ,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE;aACtE;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACnB;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AC,eAAe,CAAC,CAAC;IAC5B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3B,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;QACzD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CACR,gJAAgJ,CACjJ,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BugProfile — the artefact emitted by `slowcook investigate`.
|
|
3
|
+
*
|
|
4
|
+
* Lives at `.brewing/bug-profiles/B-<id>.yaml`. Plays the role for
|
|
5
|
+
* the bug-fix flow that `specs/story-N.yaml` plays for the story
|
|
6
|
+
* flow: the contract between investigate (or refine) and the next
|
|
7
|
+
* agent down the pipeline (sift / brew).
|
|
8
|
+
*
|
|
9
|
+
* v1 (slowcook 0.13.0) shape. Schema version bump on any field
|
|
10
|
+
* removal or rename.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BUG_PROFILE_SCHEMA_VERSION: 1;
|
|
13
|
+
/**
|
|
14
|
+
* Bug ids are sequential under `B-<n>`. The numbering is independent
|
|
15
|
+
* of `story-<NNN>` — bugs and stories are different artefact types.
|
|
16
|
+
* Race-condition collision avoidance: same logic as story-id picker
|
|
17
|
+
* (slowcook#8 fix); the picker walks `.brewing/bug-profiles/` and
|
|
18
|
+
* matching `slowcook/bug-profile/B-*` branches before assigning.
|
|
19
|
+
*/
|
|
20
|
+
export type BugId = string;
|
|
21
|
+
export interface FailureLocus {
|
|
22
|
+
/** Repo-relative path where the failure originates (or where the
|
|
23
|
+
* fix should land if multi-site). Always present. */
|
|
24
|
+
file: string;
|
|
25
|
+
/** 1-based line of the offending statement when known. */
|
|
26
|
+
line?: number;
|
|
27
|
+
/** Function / method / route name when known. */
|
|
28
|
+
function?: string;
|
|
29
|
+
/** One-paragraph human-readable diagnosis from the investigate
|
|
30
|
+
* agent. The "why broken", not the "how to fix" — fix-shaping
|
|
31
|
+
* happens in sift. */
|
|
32
|
+
diagnosis: string;
|
|
33
|
+
}
|
|
34
|
+
export interface RelatedSpec {
|
|
35
|
+
/** Spec or bug id that's relevant context. */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Relationship hint — guides chef when sequencing fixes. */
|
|
38
|
+
relationship: "touches" | "supersedes" | "related" | "duplicates";
|
|
39
|
+
/** One-line explanation. Optional. */
|
|
40
|
+
note?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface BugProfile {
|
|
43
|
+
/** $schema field for editor tooling. */
|
|
44
|
+
$schema?: string;
|
|
45
|
+
schema_version: typeof BUG_PROFILE_SCHEMA_VERSION;
|
|
46
|
+
bug_id: BugId;
|
|
47
|
+
/** Human title — usually a paraphrase of the issue title. */
|
|
48
|
+
title: string;
|
|
49
|
+
/** GitHub issue number (`#NNN`). */
|
|
50
|
+
source_issue: string;
|
|
51
|
+
/** Lifecycle. Mirrors story-flow status semantics. */
|
|
52
|
+
status: "investigated" | "recipe-emitted" | "sifted" | "shipped" | "closed";
|
|
53
|
+
/** Investigate agent + version that emitted this profile. */
|
|
54
|
+
investigated_by: string;
|
|
55
|
+
/** ISO-8601 timestamp of emission. */
|
|
56
|
+
created_at: string;
|
|
57
|
+
/** What the user / reporter sees. Verbatim or close-paraphrase
|
|
58
|
+
* from the issue body. Refine-style paraphrasing is forbidden;
|
|
59
|
+
* see the "PM intent carries weight" rule. */
|
|
60
|
+
symptom: string[];
|
|
61
|
+
/** What the system should do instead. Often inferable from the
|
|
62
|
+
* issue body; otherwise asked of the PM. */
|
|
63
|
+
expected: string[];
|
|
64
|
+
/** Minimum repro steps. Often a one-liner ("load /feed as authed
|
|
65
|
+
* user"); rarely longer than 3 steps. */
|
|
66
|
+
reproduction: string[];
|
|
67
|
+
/** Where the bug actually lives in the code. The investigate
|
|
68
|
+
* agent's job is to find this. */
|
|
69
|
+
failure_locus: FailureLocus;
|
|
70
|
+
/** What the regression test should assert in plain English.
|
|
71
|
+
* recipe --regression turns this into a vitest file. */
|
|
72
|
+
regression_assertion: string[];
|
|
73
|
+
/** Paths the fix is allowed to touch. Sift uses this as
|
|
74
|
+
* allowed_paths. Narrow on purpose — bug fixes shouldn't sprawl. */
|
|
75
|
+
fix_scope: string[];
|
|
76
|
+
/** Stories or bugs this fix interacts with. */
|
|
77
|
+
related_specs?: RelatedSpec[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Validate a parsed YAML object against the schema. Returns
|
|
81
|
+
* `{ ok: true, profile }` on success, `{ ok: false, errors }`
|
|
82
|
+
* otherwise. Hand-rolled; we don't want a JSON-schema dep.
|
|
83
|
+
*/
|
|
84
|
+
export declare function validateBugProfile(input: unknown): {
|
|
85
|
+
ok: true;
|
|
86
|
+
profile: BugProfile;
|
|
87
|
+
} | {
|
|
88
|
+
ok: false;
|
|
89
|
+
errors: string[];
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/commands/investigate/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,0BAA0B,EAAG,CAAU,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B,MAAM,WAAW,YAAY;IAC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,KAAK,EAAE,OAAO,GAAG;IAClD,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,EAAE,UAAU,CAAC;CACrB,GAAG;IACF,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAsEA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BugProfile — the artefact emitted by `slowcook investigate`.
|
|
3
|
+
*
|
|
4
|
+
* Lives at `.brewing/bug-profiles/B-<id>.yaml`. Plays the role for
|
|
5
|
+
* the bug-fix flow that `specs/story-N.yaml` plays for the story
|
|
6
|
+
* flow: the contract between investigate (or refine) and the next
|
|
7
|
+
* agent down the pipeline (sift / brew).
|
|
8
|
+
*
|
|
9
|
+
* v1 (slowcook 0.13.0) shape. Schema version bump on any field
|
|
10
|
+
* removal or rename.
|
|
11
|
+
*/
|
|
12
|
+
export const BUG_PROFILE_SCHEMA_VERSION = 1;
|
|
13
|
+
/**
|
|
14
|
+
* Validate a parsed YAML object against the schema. Returns
|
|
15
|
+
* `{ ok: true, profile }` on success, `{ ok: false, errors }`
|
|
16
|
+
* otherwise. Hand-rolled; we don't want a JSON-schema dep.
|
|
17
|
+
*/
|
|
18
|
+
export function validateBugProfile(input) {
|
|
19
|
+
const errors = [];
|
|
20
|
+
if (!isPlainObject(input)) {
|
|
21
|
+
return { ok: false, errors: ["root must be an object"] };
|
|
22
|
+
}
|
|
23
|
+
const obj = input;
|
|
24
|
+
const schemaVersion = obj["schema_version"];
|
|
25
|
+
if (schemaVersion !== BUG_PROFILE_SCHEMA_VERSION) {
|
|
26
|
+
errors.push(`schema_version must be ${BUG_PROFILE_SCHEMA_VERSION}, got ${String(schemaVersion)}`);
|
|
27
|
+
}
|
|
28
|
+
const requireString = (key) => {
|
|
29
|
+
const v = obj[key];
|
|
30
|
+
if (typeof v !== "string" || v.length === 0) {
|
|
31
|
+
errors.push(`${key} must be a non-empty string`);
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return v;
|
|
35
|
+
};
|
|
36
|
+
const requireStringArray = (key) => {
|
|
37
|
+
const v = obj[key];
|
|
38
|
+
if (!Array.isArray(v) || v.some((x) => typeof x !== "string")) {
|
|
39
|
+
errors.push(`${key} must be an array of strings`);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return v;
|
|
43
|
+
};
|
|
44
|
+
const bugId = requireString("bug_id");
|
|
45
|
+
if (bugId && !/^B-\d+$/.test(bugId)) {
|
|
46
|
+
errors.push(`bug_id must match /^B-\\d+$/ (got "${bugId}")`);
|
|
47
|
+
}
|
|
48
|
+
const sourceIssue = requireString("source_issue");
|
|
49
|
+
if (sourceIssue && !/^#\d+$/.test(sourceIssue)) {
|
|
50
|
+
errors.push(`source_issue must match /^#\\d+$/ (got "${sourceIssue}")`);
|
|
51
|
+
}
|
|
52
|
+
requireString("title");
|
|
53
|
+
requireString("status");
|
|
54
|
+
requireString("investigated_by");
|
|
55
|
+
requireString("created_at");
|
|
56
|
+
requireStringArray("symptom");
|
|
57
|
+
requireStringArray("expected");
|
|
58
|
+
requireStringArray("reproduction");
|
|
59
|
+
requireStringArray("regression_assertion");
|
|
60
|
+
requireStringArray("fix_scope");
|
|
61
|
+
const locus = obj["failure_locus"];
|
|
62
|
+
if (!isPlainObject(locus)) {
|
|
63
|
+
errors.push("failure_locus must be an object");
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const l = locus;
|
|
67
|
+
if (typeof l["file"] !== "string" || l["file"].length === 0) {
|
|
68
|
+
errors.push("failure_locus.file must be a non-empty string");
|
|
69
|
+
}
|
|
70
|
+
if (typeof l["diagnosis"] !== "string" || l["diagnosis"].length === 0) {
|
|
71
|
+
errors.push("failure_locus.diagnosis must be a non-empty string");
|
|
72
|
+
}
|
|
73
|
+
if (l["line"] !== undefined && typeof l["line"] !== "number") {
|
|
74
|
+
errors.push("failure_locus.line must be a number when present");
|
|
75
|
+
}
|
|
76
|
+
if (l["function"] !== undefined && typeof l["function"] !== "string") {
|
|
77
|
+
errors.push("failure_locus.function must be a string when present");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (errors.length > 0)
|
|
81
|
+
return { ok: false, errors };
|
|
82
|
+
return { ok: true, profile: obj };
|
|
83
|
+
}
|
|
84
|
+
function isPlainObject(v) {
|
|
85
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/commands/investigate/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAU,CAAC;AA6ErD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAO/C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,wBAAwB,CAAC,EAAE,CAAC;IAC3D,CAAC;IACD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAE7C,MAAM,aAAa,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5C,IAAI,aAAa,KAAK,0BAA0B,EAAE,CAAC;QACjD,MAAM,CAAC,IAAI,CACT,0BAA0B,0BAA0B,SAAS,MAAM,CAAC,aAAa,CAAC,EAAE,CACrF,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,CAAC,GAAW,EAAiB,EAAE;QACnD,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACnB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5C,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,6BAA6B,CAAC,CAAC;YACjD,OAA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CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/on-brew-merged/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/on-brew-merged/index.ts"],"names":[],"mappings":"AA2GA,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoJhE"}
|
|
@@ -67,6 +67,13 @@ Exit codes:
|
|
|
67
67
|
2 script error
|
|
68
68
|
`);
|
|
69
69
|
}
|
|
70
|
+
function centre(text, width) {
|
|
71
|
+
if (text.length >= width)
|
|
72
|
+
return text;
|
|
73
|
+
const totalPad = width - text.length;
|
|
74
|
+
const left = Math.floor(totalPad / 2);
|
|
75
|
+
return " ".repeat(left) + text + " ".repeat(totalPad - left);
|
|
76
|
+
}
|
|
70
77
|
function detectOwnerRepo(cwd) {
|
|
71
78
|
try {
|
|
72
79
|
const url = execSync("git remote get-url origin", {
|
|
@@ -160,18 +167,32 @@ export async function onBrewMerged(argv) {
|
|
|
160
167
|
byAgent.set(m.agent, acc);
|
|
161
168
|
}
|
|
162
169
|
const totalUsd = [...byAgent.values()].reduce((a, b) => a + b.usd, 0);
|
|
163
|
-
|
|
170
|
+
// 0.12.13+ — restaurant-bill rendering. Wrapped in a code block so
|
|
171
|
+
// GitHub renders it in a fixed-width font; columns align.
|
|
172
|
+
// Order respects the pipeline flow (refine → testgen/recipe →
|
|
173
|
+
// brew/sift). Bug-flow agents (investigate, sift) included so
|
|
174
|
+
// future bugs render with the same template.
|
|
175
|
+
const order = ["refine", "investigate", "testgen", "recipe", "brew", "sift"];
|
|
176
|
+
const lineWidth = 38;
|
|
164
177
|
const lines = [];
|
|
165
|
-
|
|
178
|
+
const sep = "─".repeat(lineWidth);
|
|
179
|
+
lines.push(sep);
|
|
180
|
+
lines.push(centre("SLOWCOOK · PIPELINE BILL", lineWidth));
|
|
181
|
+
lines.push(sep);
|
|
166
182
|
for (const agent of order) {
|
|
167
183
|
const acc = byAgent.get(agent);
|
|
168
184
|
if (!acc)
|
|
169
185
|
continue;
|
|
170
|
-
const
|
|
171
|
-
|
|
186
|
+
const left = ` ${agent.padEnd(12)}× ${acc.n}`;
|
|
187
|
+
const right = `$${acc.usd.toFixed(4)} `;
|
|
188
|
+
lines.push(left + " ".repeat(Math.max(1, lineWidth - left.length - right.length)) + right);
|
|
172
189
|
}
|
|
173
|
-
lines.push(
|
|
174
|
-
|
|
190
|
+
lines.push(sep);
|
|
191
|
+
const totalLeft = " TOTAL";
|
|
192
|
+
const totalRight = `$${totalUsd.toFixed(4)} `;
|
|
193
|
+
lines.push(totalLeft + " ".repeat(Math.max(1, lineWidth - totalLeft.length - totalRight.length)) + totalRight);
|
|
194
|
+
lines.push(sep);
|
|
195
|
+
costSummaryMd = "\n\n```\n" + lines.join("\n") + "\n```\n";
|
|
175
196
|
}
|
|
176
197
|
}
|
|
177
198
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/on-brew-merged/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmBpD,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,IAAI,GAAS;QACjB,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,OAAO,CAAC,GAAG,EAAE;KACxB,CAAC;IACF,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AQ,wBAAwB,KAAK,IAAI,IAAI,SAAS,IAAI,CAAC,QAAQ,aAAa;QAC7F,WAAW,OAAO,+EAA+E;QACjG,aAAa;QACb,qBAAqB;QACrB,0DAA0D;QAC1D,yDAAyD;QACzD,0BAA0B;QAC1B,kDAAkD,CAAC;IACrD,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC;YACjC,KAAK;YACL,IAAI;YACJ,YAAY,EAAE,WAAW;YACzB,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CACX,gCAAgC,WAAW,KAAM,CAAW,CAAC,OAAO,EAAE,CACvE,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 0.13.0-alpha.3b — LLM-backed regression test emitter.
|
|
3
|
+
*
|
|
4
|
+
* Replaces alpha.3a's `expect.fail()` stub with a real vitest file
|
|
5
|
+
* the agent writes by reading the bug profile + the failure-locus
|
|
6
|
+
* file. The emitted test must be RED against current code (the bug
|
|
7
|
+
* exists) and become GREEN once sift fixes it. That's the contract
|
|
8
|
+
* sift's red→green ratchet runs against.
|
|
9
|
+
*
|
|
10
|
+
* Different from sift: recipe-regression *only* writes the test
|
|
11
|
+
* file. It doesn't edit production code. Read tools available;
|
|
12
|
+
* write_file is restricted to the regression test path itself.
|
|
13
|
+
*/
|
|
14
|
+
import type { BugProfile } from "../investigate/schema.js";
|
|
15
|
+
export declare const RECIPE_REGRESSION_SYSTEM = "You are the recipe agent (regression mode) for slowcook \u2014 a TDD-first bug-fix flow.\n\n## Your role\n\nYou receive a bug profile from `investigate`. Your job: write a single vitest file that asserts the regression assertion(s) hold. The test you write is the contract `sift` will fix the code against.\n\nYou are NOT testgen. testgen writes acceptance tests for new features. You write a regression test for a known-broken behavior. Different posture:\n\n- **The bug profile names the failure locus.** Read it (read_file). Understand what's broken. The diagnosis tells you why.\n- **The regression test must be RED against current code.** If your test passes against the broken state, the bug profile is wrong OR your test isn't actually exercising the bug. Halt voluntarily \u2014 don't ship a passing regression test for a live bug.\n- **The regression test must be GREEN once the bug is fixed.** It targets the corrected behavior, not the buggy state.\n- **One test file. tests/regression/B-N-<slug>.test.ts.** Don't create helpers, don't edit fixtures, don't touch source code. The output is exactly one new file.\n- **Test against the SMALLEST testable surface.** If the bug is in an API route, hit the route handler in isolation (mock the database). If it's in a component, render the component with stub props (mock fetch). Don't spin up the whole app.\n\n## Tools\n\n- **read_file(path)** \u2014 read a file in full.\n- **outline_file(path)** \u2014 compact outline (imports, top-level exports, signatures with line numbers).\n- **list_directory(path)** \u2014 see what's in a dir.\n- **find_references(symbol)** \u2014 find all use sites of a symbol.\n- **find_definition(symbol)** \u2014 find where a symbol is declared.\n- **grep(pattern, glob?)** \u2014 repo-wide ripgrep.\n\nYou do NOT have write_file \u2014 you produce the test file as a single `<test_file>` block in your final reply. Slowcook writes it to disk after parsing.\n\n## Test conventions\n\nThe consumer project uses vitest. Match the patterns already in tests/integration/ \u2014 use `vi.mock(\"@/utils/supabase/server\")`, `renderWithProviders`, `mockFetch` etc. when relevant. Don't invent new patterns.\n\nFor UI components, mock the data layer at the fetch boundary; for handlers, mock supabase via `realShapedCreateClient`. Read at least one existing tests/integration/ file before writing yours so you match the local conventions.\n\n## Output format\n\nA single `<test_file>` block whose content is the complete vitest source:\n\n```\n<test_file>\n// slowcook regression test \u2014 B-N\n//\n// (full test file contents)\nimport { describe, it, expect, vi } from \"vitest\";\n// ...\n\ndescribe(\"B-N regression \u2014 <bug title>\", () => {\n it(\"<regression assertion>\", () => {\n // ...\n expect(...).toBe(...);\n });\n});\n</test_file>\n```\n\nIf you can't write a test that's reliably red-against-current and green-against-fixed (e.g., the failure mode is non-deterministic, or you can't isolate the bug from network state), emit a `<halt>` block with a one-line description instead. **Don't ship a useless test.**\n\n## Halt format\n\n```\n<halt>\n<reason>One-line description of what made writing the test impossible.</reason>\n</halt>\n```\n";
|
|
16
|
+
export declare const RECIPE_REGRESSION_TOOLS: ({
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
input_schema: {
|
|
20
|
+
type: "object";
|
|
21
|
+
properties: {
|
|
22
|
+
path: {
|
|
23
|
+
type: "string";
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
symbol?: undefined;
|
|
27
|
+
pattern?: undefined;
|
|
28
|
+
glob?: undefined;
|
|
29
|
+
};
|
|
30
|
+
required: string[];
|
|
31
|
+
};
|
|
32
|
+
} | {
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
input_schema: {
|
|
36
|
+
type: "object";
|
|
37
|
+
properties: {
|
|
38
|
+
symbol: {
|
|
39
|
+
type: "string";
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
path?: undefined;
|
|
43
|
+
pattern?: undefined;
|
|
44
|
+
glob?: undefined;
|
|
45
|
+
};
|
|
46
|
+
required: string[];
|
|
47
|
+
};
|
|
48
|
+
} | {
|
|
49
|
+
name: string;
|
|
50
|
+
description: string;
|
|
51
|
+
input_schema: {
|
|
52
|
+
type: "object";
|
|
53
|
+
properties: {
|
|
54
|
+
pattern: {
|
|
55
|
+
type: "string";
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
glob: {
|
|
59
|
+
type: "string";
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
path?: undefined;
|
|
63
|
+
symbol?: undefined;
|
|
64
|
+
};
|
|
65
|
+
required: string[];
|
|
66
|
+
};
|
|
67
|
+
})[];
|
|
68
|
+
export interface RegressionRecipeContext {
|
|
69
|
+
repoRoot: string;
|
|
70
|
+
anthropicApiKey: string;
|
|
71
|
+
model: string;
|
|
72
|
+
bugProfile: BugProfile;
|
|
73
|
+
cliVersion: string;
|
|
74
|
+
now?: () => Date;
|
|
75
|
+
}
|
|
76
|
+
export interface RegressionRecipeResult {
|
|
77
|
+
/** True when the agent emitted a usable <test_file> block. */
|
|
78
|
+
emitted: boolean;
|
|
79
|
+
/** The test file contents (only set when emitted=true). */
|
|
80
|
+
testContents?: string;
|
|
81
|
+
/** Total LLM rounds. */
|
|
82
|
+
rounds: number;
|
|
83
|
+
/** USD spent. */
|
|
84
|
+
spendUsd: number;
|
|
85
|
+
/** When emitted=false, why the agent halted. */
|
|
86
|
+
haltReason?: string;
|
|
87
|
+
/** Last text the agent produced (debug aid). */
|
|
88
|
+
finalText: string;
|
|
89
|
+
}
|
|
90
|
+
export declare function runRegressionRecipe(ctx: RegressionRecipeContext): Promise<RegressionRecipeResult>;
|
|
91
|
+
export declare function parseTestFileBlock(text: string): string | null;
|
|
92
|
+
export declare function hasTestFileBlock(text: string): boolean;
|
|
93
|
+
export declare function parseHalt(text: string): string | null;
|
|
94
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/recipe-regression/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAK3D,eAAO,MAAM,wBAAwB,urGA6DpC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoEnC,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,uBAAuB,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CAyFjC;AAoLD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU9D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKrD"}
|