@slowcook-ai/cli 0.19.6 → 0.20.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/README.md +8 -0
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/brew/fidelity-loop.d.ts +71 -0
- package/dist/commands/brew/fidelity-loop.d.ts.map +1 -0
- package/dist/commands/brew/fidelity-loop.js +108 -0
- package/dist/commands/brew/fidelity-loop.js.map +1 -0
- package/dist/commands/brew/fidelity-phase.d.ts +49 -0
- package/dist/commands/brew/fidelity-phase.d.ts.map +1 -0
- package/dist/commands/brew/fidelity-phase.js +75 -0
- package/dist/commands/brew/fidelity-phase.js.map +1 -0
- package/dist/commands/eye/index.d.ts +2 -0
- package/dist/commands/eye/index.d.ts.map +1 -0
- package/dist/commands/eye/index.js +64 -0
- package/dist/commands/eye/index.js.map +1 -0
- package/dist/commands/eye/plan.d.ts +61 -0
- package/dist/commands/eye/plan.d.ts.map +1 -0
- package/dist/commands/eye/plan.js +81 -0
- package/dist/commands/eye/plan.js.map +1 -0
- package/dist/commands/eye/run.d.ts +19 -0
- package/dist/commands/eye/run.d.ts.map +1 -0
- package/dist/commands/eye/run.js +47 -0
- package/dist/commands/eye/run.js.map +1 -0
- package/dist/commands/eye/spec-modes.d.ts +5 -0
- package/dist/commands/eye/spec-modes.d.ts.map +1 -0
- package/dist/commands/eye/spec-modes.js +36 -0
- package/dist/commands/eye/spec-modes.js.map +1 -0
- package/dist/commands/gate/github.d.ts +27 -0
- package/dist/commands/gate/github.d.ts.map +1 -0
- package/dist/commands/gate/github.js +46 -0
- package/dist/commands/gate/github.js.map +1 -0
- package/dist/commands/gate/index.d.ts +2 -0
- package/dist/commands/gate/index.d.ts.map +1 -0
- package/dist/commands/gate/index.js +68 -0
- package/dist/commands/gate/index.js.map +1 -0
- package/dist/commands/gate/model.d.ts +55 -0
- package/dist/commands/gate/model.d.ts.map +1 -0
- package/dist/commands/gate/model.js +64 -0
- package/dist/commands/gate/model.js.map +1 -0
- package/dist/commands/gate/reviewers.d.ts +24 -0
- package/dist/commands/gate/reviewers.d.ts.map +1 -0
- package/dist/commands/gate/reviewers.js +69 -0
- package/dist/commands/gate/reviewers.js.map +1 -0
- package/dist/commands/recon/shape-preserve.d.ts +38 -0
- package/dist/commands/recon/shape-preserve.d.ts.map +1 -1
- package/dist/commands/recon/shape-preserve.js +112 -1
- package/dist/commands/recon/shape-preserve.js.map +1 -1
- package/dist/commands/refine/spec-yaml.d.ts +3 -0
- package/dist/commands/refine/spec-yaml.d.ts.map +1 -1
- package/dist/commands/refine/spec-yaml.js +4 -0
- package/dist/commands/refine/spec-yaml.js.map +1 -1
- package/dist/commands/serve/config.d.ts +28 -9
- package/dist/commands/serve/config.d.ts.map +1 -1
- package/dist/commands/serve/config.js +43 -1
- package/dist/commands/serve/config.js.map +1 -1
- package/dist/commands/serve/dev.d.ts +14 -19
- package/dist/commands/serve/dev.d.ts.map +1 -1
- package/dist/commands/serve/dev.js +46 -50
- package/dist/commands/serve/dev.js.map +1 -1
- package/dist/commands/serve/index.d.ts.map +1 -1
- package/dist/commands/serve/index.js +30 -22
- package/dist/commands/serve/index.js.map +1 -1
- package/dist/commands/serve/mock.d.ts +5 -20
- package/dist/commands/serve/mock.d.ts.map +1 -1
- package/dist/commands/serve/mock.js +44 -65
- package/dist/commands/serve/mock.js.map +1 -1
- package/dist/commands/serve/runner.d.ts +52 -0
- package/dist/commands/serve/runner.d.ts.map +1 -0
- package/dist/commands/serve/runner.js +53 -0
- package/dist/commands/serve/runner.js.map +1 -0
- package/dist/commands/serve/staging.d.ts +8 -19
- package/dist/commands/serve/staging.d.ts.map +1 -1
- package/dist/commands/serve/staging.js +53 -91
- package/dist/commands/serve/staging.js.map +1 -1
- package/dist/commands/upsert-agent-docs.d.ts.map +1 -1
- package/dist/commands/upsert-agent-docs.js +12 -0
- package/dist/commands/upsert-agent-docs.js.map +1 -1
- package/dist/commands.manifest.d.ts.map +1 -1
- package/dist/commands.manifest.js +12 -0
- package/dist/commands.manifest.js.map +1 -1
- package/package.json +6 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Verbs (Phase 1):
|
|
5
5
|
* - up — bring up the dev profile (compose overlay or fallback)
|
|
6
|
-
* - sync —
|
|
6
|
+
* - sync — push source-branch + restart bind-mount targets
|
|
7
7
|
* - down — stop the profile's services (volumes preserved)
|
|
8
8
|
* - logs — pass-through to docker-compose logs
|
|
9
9
|
* - reset — no-op for dev profile (only meaningful for staging)
|
|
@@ -13,19 +13,17 @@
|
|
|
13
13
|
* - `slowcook dev-env up` ≡ `slowcook serve dev up`
|
|
14
14
|
* - `slowcook dev-env reset` ≡ `slowcook serve dev reset` (no-op + notice)
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* 0.19.7 (sc#173 fixes):
|
|
17
|
+
* - Planner populates `commands[]` (structured ShellCommand records).
|
|
18
|
+
* The cli wrapper invokes runCommands() to actually execute (or
|
|
19
|
+
* dry-run); previously `up`/`down`/`logs` were planners only.
|
|
20
|
+
* - Compose-file layering: respects `profile.compose_files` (multi-`-f`)
|
|
21
|
+
* OR `compose_overlay` (single). Real consumers need base+overlay.
|
|
22
|
+
* - `--build` flag is suppressed for `bind-mount-source` mode (the
|
|
23
|
+
* mode's whole point is skipping the build loop).
|
|
21
24
|
*/
|
|
22
25
|
import { execSync } from "node:child_process";
|
|
23
|
-
|
|
24
|
-
* Pure dispatcher for the dev profile. Returns a DevVerbResult so the
|
|
25
|
-
* caller (cli) can render output + set the exit code. Splitting the
|
|
26
|
-
* pure planner from the IO wrapper lets the tests assert on the plan
|
|
27
|
-
* without spawning docker.
|
|
28
|
-
*/
|
|
26
|
+
import { composeFiles, shouldBuildOnUp } from "./config.js";
|
|
29
27
|
export function planServeDev(args, _config, profile) {
|
|
30
28
|
switch (args.verb) {
|
|
31
29
|
case "up":
|
|
@@ -46,19 +44,22 @@ export function planServeDev(args, _config, profile) {
|
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
function planUp(_args, profile) {
|
|
49
|
-
const
|
|
47
|
+
const files = composeFiles(profile);
|
|
50
48
|
const apps = Object.keys(profile.apps);
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
else {
|
|
56
|
-
lines.push(" (no compose_overlay set; consumer must wire its own up command)");
|
|
49
|
+
const output = [`[serve dev up] bringing up: ${apps.join(", ") || "(no apps configured)"}`];
|
|
50
|
+
if (files.length === 0) {
|
|
51
|
+
output.push(" (no compose_files / compose_overlay set; declare one in serve.yaml)");
|
|
52
|
+
return { exitCode: 64, output };
|
|
57
53
|
}
|
|
54
|
+
const fileFlags = files.map((f) => `-f ${f}`).join(" ");
|
|
55
|
+
const buildFlag = shouldBuildOnUp(profile) ? " --build" : "";
|
|
56
|
+
const commands = [
|
|
57
|
+
{ cmd: `docker compose ${fileFlags} up -d${buildFlag}`, remote: true, label: "bring up" },
|
|
58
|
+
];
|
|
58
59
|
if (profile.seed_script) {
|
|
59
|
-
|
|
60
|
+
commands.push({ cmd: `pnpm exec ts-node ${profile.seed_script}`, remote: true, label: "seed" });
|
|
60
61
|
}
|
|
61
|
-
return { exitCode: 0, output
|
|
62
|
+
return { exitCode: 0, output, commands };
|
|
62
63
|
}
|
|
63
64
|
function planSync(args, profile) {
|
|
64
65
|
const sourceBranch = profile.source_branch;
|
|
@@ -68,7 +69,7 @@ function planSync(args, profile) {
|
|
|
68
69
|
localBranch = execSync("git rev-parse --abbrev-ref HEAD", { cwd: args.repoRoot, encoding: "utf8" }).trim();
|
|
69
70
|
}
|
|
70
71
|
catch {
|
|
71
|
-
//
|
|
72
|
+
// handled below
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
else if (!localBranch && args.dryRun) {
|
|
@@ -80,47 +81,42 @@ function planSync(args, profile) {
|
|
|
80
81
|
output: ["[serve dev sync] couldn't resolve a local branch (detached HEAD?). Pass --branch <name>."],
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
|
-
const
|
|
84
|
+
const output = [
|
|
84
85
|
`[serve dev sync] ${localBranch} → origin/${sourceBranch}${args.story ? ` (story-${args.story})` : ""}`,
|
|
85
86
|
];
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
execSync(`git push --force origin ${localBranch}:${sourceBranch}`, { cwd: args.repoRoot, stdio: "inherit" });
|
|
92
|
-
}
|
|
93
|
-
catch {
|
|
94
|
-
return {
|
|
95
|
-
exitCode: 1,
|
|
96
|
-
output: [...lines, `[serve dev sync] git push failed. Check push permissions on origin/${sourceBranch}.`],
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
lines.push(`[serve dev sync] done. The dev-deploy workflow on origin/${sourceBranch} will fire next.`);
|
|
100
|
-
return { exitCode: 0, output: lines };
|
|
87
|
+
const commands = [
|
|
88
|
+
{ cmd: `git push --force origin ${localBranch}:${sourceBranch}`, remote: false, label: "git push" },
|
|
89
|
+
];
|
|
90
|
+
return { exitCode: 0, output, commands };
|
|
101
91
|
}
|
|
102
92
|
function planDown(args, profile) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return { exitCode: 64, output: ["[serve dev down] no compose_overlay set; nothing to stop."] };
|
|
93
|
+
const files = composeFiles(profile);
|
|
94
|
+
if (files.length === 0) {
|
|
95
|
+
return { exitCode: 64, output: ["[serve dev down] no compose_files / compose_overlay set; nothing to stop."] };
|
|
107
96
|
}
|
|
97
|
+
const fileFlags = files.map((f) => `-f ${f}`).join(" ");
|
|
108
98
|
const cmd = args.prune
|
|
109
|
-
? `docker compose
|
|
110
|
-
: `docker compose
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
? `docker compose ${fileFlags} down -v`
|
|
100
|
+
: `docker compose ${fileFlags} down`;
|
|
101
|
+
return {
|
|
102
|
+
exitCode: 0,
|
|
103
|
+
output: ["[serve dev down]"],
|
|
104
|
+
commands: [{ cmd, remote: true, label: "compose down" }],
|
|
105
|
+
};
|
|
113
106
|
}
|
|
114
107
|
function planLogs(args, profile) {
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
117
|
-
return { exitCode: 64, output: ["[serve dev logs] no compose_overlay set; nothing to tail."] };
|
|
108
|
+
const files = composeFiles(profile);
|
|
109
|
+
if (files.length === 0) {
|
|
110
|
+
return { exitCode: 64, output: ["[serve dev logs] no compose_files / compose_overlay set; nothing to tail."] };
|
|
118
111
|
}
|
|
112
|
+
const fileFlags = files.map((f) => `-f ${f}`).join(" ");
|
|
119
113
|
const follow = args.follow ? "-f" : "";
|
|
120
114
|
const service = args.service ?? "";
|
|
115
|
+
const cmd = `docker compose ${fileFlags} logs ${follow} ${service}`.replace(/\s+/g, " ").trim();
|
|
121
116
|
return {
|
|
122
117
|
exitCode: 0,
|
|
123
|
-
output: [
|
|
118
|
+
output: ["[serve dev logs]"],
|
|
119
|
+
commands: [{ cmd, remote: true, label: "compose logs" }],
|
|
124
120
|
};
|
|
125
121
|
}
|
|
126
122
|
//# sourceMappingURL=dev.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/commands/serve/dev.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/commands/serve/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAuB5D,MAAM,UAAU,YAAY,CAC1B,IAAiB,EACjB,OAAoB,EACpB,OAAsB;IAEtB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,IAAI;YACP,OAAO,M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AE,CAAC;IACjH,CAAC;IACD,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;IACnC,MAAM,GAAG,GAAG,kBAAkB,SAAS,SAAS,MAAM,IAAI,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAChG,OAAO;QACL,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,CAAC,kBAAkB,CAAC;QAC5B,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;KACzD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAwBxD;AAED,wBAAgB,SAAS,IAAI,IAAI,CAkChC;AAED,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsEzD"}
|
|
@@ -15,6 +15,7 @@ import { planServeDev } from "./dev.js";
|
|
|
15
15
|
import { planServeMock } from "./mock.js";
|
|
16
16
|
import { detectMockRunnable } from "./detect.js";
|
|
17
17
|
import { planServeStaging } from "./staging.js";
|
|
18
|
+
import { runCommands } from "./runner.js";
|
|
18
19
|
export function parseServeArgs(argv) {
|
|
19
20
|
const args = { repoRoot: process.cwd() };
|
|
20
21
|
// First two positionals (if present + not flags) are profile + verb.
|
|
@@ -133,15 +134,11 @@ export async function serve(argv) {
|
|
|
133
134
|
console.error(`slowcook serve: profile "${args.profile}" not found in config. Available: ${available}.`);
|
|
134
135
|
process.exit(64);
|
|
135
136
|
}
|
|
137
|
+
let planResult;
|
|
136
138
|
switch (args.profile) {
|
|
137
|
-
case "dev":
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
console.log(line);
|
|
141
|
-
if (result.exitCode !== 0)
|
|
142
|
-
process.exit(result.exitCode);
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
139
|
+
case "dev":
|
|
140
|
+
planResult = runDevVerb(args, config, profile);
|
|
141
|
+
break;
|
|
145
142
|
case "mock": {
|
|
146
143
|
// Trade-off #4: auto-skip if mock/ isn't vite-runnable.
|
|
147
144
|
const detect = detectMockRunnable(args.repoRoot);
|
|
@@ -149,25 +146,36 @@ export async function serve(argv) {
|
|
|
149
146
|
console.log(`[serve mock] skipped — ${detect.reason}`);
|
|
150
147
|
return;
|
|
151
148
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
console.log(line);
|
|
155
|
-
if (result.exitCode !== 0)
|
|
156
|
-
process.exit(result.exitCode);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
case "staging": {
|
|
160
|
-
const result = runStagingVerb(args, config, profile);
|
|
161
|
-
for (const line of result.output)
|
|
162
|
-
console.log(line);
|
|
163
|
-
if (result.exitCode !== 0)
|
|
164
|
-
process.exit(result.exitCode);
|
|
165
|
-
return;
|
|
149
|
+
planResult = runMockVerb(args, config, profile);
|
|
150
|
+
break;
|
|
166
151
|
}
|
|
152
|
+
case "staging":
|
|
153
|
+
planResult = runStagingVerb(args, config, profile);
|
|
154
|
+
break;
|
|
167
155
|
default:
|
|
168
156
|
console.error(`slowcook serve: profile "${args.profile}" has no runtime in this release.`);
|
|
169
157
|
process.exit(64);
|
|
170
158
|
}
|
|
159
|
+
for (const line of planResult.output)
|
|
160
|
+
console.log(line);
|
|
161
|
+
if (planResult.exitCode !== 0)
|
|
162
|
+
process.exit(planResult.exitCode);
|
|
163
|
+
// sc#173 #1: actually execute the plan. Wraps `remote: true` commands
|
|
164
|
+
// in `ssh user@host 'cd <checkout_dir> && <cmd>'` when ssh_target is
|
|
165
|
+
// set; runs locally otherwise. --dry-run prints the wrapped form
|
|
166
|
+
// without executing.
|
|
167
|
+
if (planResult.commands && planResult.commands.length > 0) {
|
|
168
|
+
const runResult = runCommands({
|
|
169
|
+
commands: planResult.commands,
|
|
170
|
+
profile,
|
|
171
|
+
repoRoot: args.repoRoot,
|
|
172
|
+
dryRun: args.dryRun,
|
|
173
|
+
});
|
|
174
|
+
for (const line of runResult.output)
|
|
175
|
+
console.log(line);
|
|
176
|
+
if (runResult.exitCode !== 0)
|
|
177
|
+
process.exit(runResult.exitCode);
|
|
178
|
+
}
|
|
171
179
|
}
|
|
172
180
|
function runDevVerb(args, config, profile) {
|
|
173
181
|
if (!profile)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,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KAAK,CAAC,aAAa,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAiB;QAC7B,IAAI,EAAE,IAAI,CAAC,IAAK;QAChB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;IACF,OAAO,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,cAAc,CAAC,IAAe,EAAE,MAAmB,EAAE,OAAsC;IAClG,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAoB;QACnC,IAAI,EAAE,IAAI,CAAC,IAAK;QAChB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;IACF,OAAO,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -2,23 +2,12 @@
|
|
|
2
2
|
* `slowcook serve mock <verb>` — Phase 2 implementation.
|
|
3
3
|
*
|
|
4
4
|
* The mock profile runs the consumer's `mock/` package as a vite-dev
|
|
5
|
-
* server on a shared box
|
|
6
|
-
* all hit the same artefact at the same URL. Mock-vite runs alongside
|
|
7
|
-
* `serve dev` on the same host with distinct ports + profile-prefixed
|
|
8
|
-
* container names (per design #5).
|
|
5
|
+
* server on a shared box. See `dev.ts` header for the broader pattern.
|
|
9
6
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - down — stop the mock services (volumes preserved)
|
|
15
|
-
* - logs — pass-through to docker-compose logs
|
|
16
|
-
* - reset — no-op (mock has no scenario seed)
|
|
17
|
-
*
|
|
18
|
-
* Auto-skip per Trade-off #4: if the consumer's `mock/package.json`
|
|
19
|
-
* has no `scripts.dev`, slowcook prints a notice + exits 0 instead of
|
|
20
|
-
* trying to bring up an unrunnable vite-dev. Detection runs from
|
|
21
|
-
* `index.ts`'s dispatcher before this module is called.
|
|
7
|
+
* 0.19.7 (sc#173): same refactor as dev.ts — emit ShellCommand[] so
|
|
8
|
+
* runCommands() can actually execute (including ssh-wrapping for the
|
|
9
|
+
* remote case); support `compose_files` multi-`-f`; suppress `--build`
|
|
10
|
+
* for `bind-mount-source`.
|
|
22
11
|
*/
|
|
23
12
|
import type { ProfileConfig, ServeConfig } from "./config.js";
|
|
24
13
|
import type { DevVerbResult } from "./dev.js";
|
|
@@ -31,9 +20,5 @@ export interface MockVerbArgs {
|
|
|
31
20
|
repoRoot: string;
|
|
32
21
|
dryRun?: boolean;
|
|
33
22
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Pure planner for the mock profile. Same shape as `planServeDev` so
|
|
36
|
-
* the cli wrapper can render output uniformly.
|
|
37
|
-
*/
|
|
38
23
|
export declare function planServeMock(args: MockVerbArgs, _config: ServeConfig, profile: ProfileConfig): DevVerbResult;
|
|
39
24
|
//# sourceMappingURL=mock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/mock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/mock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,aAAa,GACrB,aAAa,CAkBf"}
|
|
@@ -2,29 +2,15 @@
|
|
|
2
2
|
* `slowcook serve mock <verb>` — Phase 2 implementation.
|
|
3
3
|
*
|
|
4
4
|
* The mock profile runs the consumer's `mock/` package as a vite-dev
|
|
5
|
-
* server on a shared box
|
|
6
|
-
* all hit the same artefact at the same URL. Mock-vite runs alongside
|
|
7
|
-
* `serve dev` on the same host with distinct ports + profile-prefixed
|
|
8
|
-
* container names (per design #5).
|
|
5
|
+
* server on a shared box. See `dev.ts` header for the broader pattern.
|
|
9
6
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - down — stop the mock services (volumes preserved)
|
|
15
|
-
* - logs — pass-through to docker-compose logs
|
|
16
|
-
* - reset — no-op (mock has no scenario seed)
|
|
17
|
-
*
|
|
18
|
-
* Auto-skip per Trade-off #4: if the consumer's `mock/package.json`
|
|
19
|
-
* has no `scripts.dev`, slowcook prints a notice + exits 0 instead of
|
|
20
|
-
* trying to bring up an unrunnable vite-dev. Detection runs from
|
|
21
|
-
* `index.ts`'s dispatcher before this module is called.
|
|
7
|
+
* 0.19.7 (sc#173): same refactor as dev.ts — emit ShellCommand[] so
|
|
8
|
+
* runCommands() can actually execute (including ssh-wrapping for the
|
|
9
|
+
* remote case); support `compose_files` multi-`-f`; suppress `--build`
|
|
10
|
+
* for `bind-mount-source`.
|
|
22
11
|
*/
|
|
23
12
|
import { execSync } from "node:child_process";
|
|
24
|
-
|
|
25
|
-
* Pure planner for the mock profile. Same shape as `planServeDev` so
|
|
26
|
-
* the cli wrapper can render output uniformly.
|
|
27
|
-
*/
|
|
13
|
+
import { composeFiles, shouldBuildOnUp } from "./config.js";
|
|
28
14
|
export function planServeMock(args, _config, profile) {
|
|
29
15
|
switch (args.verb) {
|
|
30
16
|
case "up":
|
|
@@ -41,28 +27,35 @@ export function planServeMock(args, _config, profile) {
|
|
|
41
27
|
output: ["[serve mock reset] mock profile has no scenario seed; nothing to reset (only meaningful for staging)."],
|
|
42
28
|
};
|
|
43
29
|
default:
|
|
44
|
-
return {
|
|
45
|
-
exitCode: 64,
|
|
46
|
-
output: [`Unknown verb: ${args.verb}. See \`slowcook serve --help\`.`],
|
|
47
|
-
};
|
|
30
|
+
return { exitCode: 64, output: [`Unknown verb: ${args.verb}. See \`slowcook serve --help\`.`] };
|
|
48
31
|
}
|
|
49
32
|
}
|
|
50
33
|
function planUp(_args, profile) {
|
|
51
|
-
const
|
|
34
|
+
const files = composeFiles(profile);
|
|
52
35
|
const apps = Object.keys(profile.apps);
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
36
|
+
const output = [`[serve mock up] bringing up: ${apps.join(", ") || "(no apps configured)"}`];
|
|
37
|
+
if (files.length === 0) {
|
|
38
|
+
// Fallback: no compose, run `pnpm --filter ./mock dev` locally. Used on
|
|
39
|
+
// a dev's laptop without a docker box.
|
|
40
|
+
output.push(" (no compose_files / compose_overlay set; falling back to local pnpm filter)");
|
|
41
|
+
return {
|
|
42
|
+
exitCode: 0,
|
|
43
|
+
output,
|
|
44
|
+
commands: [{ cmd: "pnpm --filter ./mock dev", remote: false, label: "vite dev" }],
|
|
45
|
+
};
|
|
59
46
|
}
|
|
60
47
|
// PM + designer reference URL: surface the vite port if exactly one app.
|
|
61
48
|
if (apps.length === 1) {
|
|
62
49
|
const vitePort = profile.apps[apps[0]].port;
|
|
63
|
-
|
|
50
|
+
output.push(` vite dev URL (once up): http://<your-box>:${vitePort}`);
|
|
64
51
|
}
|
|
65
|
-
|
|
52
|
+
const fileFlags = files.map((f) => `-f ${f}`).join(" ");
|
|
53
|
+
const buildFlag = shouldBuildOnUp(profile) ? " --build" : "";
|
|
54
|
+
return {
|
|
55
|
+
exitCode: 0,
|
|
56
|
+
output,
|
|
57
|
+
commands: [{ cmd: `docker compose ${fileFlags} up -d${buildFlag}`, remote: true, label: "bring up" }],
|
|
58
|
+
};
|
|
66
59
|
}
|
|
67
60
|
function planSync(args, profile) {
|
|
68
61
|
const sourceBranch = profile.source_branch;
|
|
@@ -87,46 +80,32 @@ function planSync(args, profile) {
|
|
|
87
80
|
output: ["[serve mock sync] couldn't resolve a local branch (detached HEAD?). Pass --branch <name>."],
|
|
88
81
|
};
|
|
89
82
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
try {
|
|
96
|
-
execSync(`git push --force origin ${localBranch}:${sourceBranch}`, {
|
|
97
|
-
cwd: args.repoRoot,
|
|
98
|
-
stdio: "inherit",
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
catch {
|
|
102
|
-
return {
|
|
103
|
-
exitCode: 1,
|
|
104
|
-
output: [...lines, `[serve mock sync] git push failed. Check push permissions on origin/${sourceBranch}.`],
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
lines.push(`[serve mock sync] done. The mock-deploy workflow on origin/${sourceBranch} will fire next.`);
|
|
108
|
-
return { exitCode: 0, output: lines };
|
|
83
|
+
return {
|
|
84
|
+
exitCode: 0,
|
|
85
|
+
output: [`[serve mock sync] ${localBranch} → origin/${sourceBranch}`],
|
|
86
|
+
commands: [{ cmd: `git push --force origin ${localBranch}:${sourceBranch}`, remote: false, label: "git push" }],
|
|
87
|
+
};
|
|
109
88
|
}
|
|
110
89
|
function planDown(args, profile) {
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
return { exitCode: 64, output: ["[serve mock down] no compose_overlay set; nothing to stop."] };
|
|
90
|
+
const files = composeFiles(profile);
|
|
91
|
+
if (files.length === 0) {
|
|
92
|
+
return { exitCode: 64, output: ["[serve mock down] no compose_files / compose_overlay set; nothing to stop."] };
|
|
114
93
|
}
|
|
94
|
+
const fileFlags = files.map((f) => `-f ${f}`).join(" ");
|
|
115
95
|
const cmd = args.prune
|
|
116
|
-
? `docker compose
|
|
117
|
-
: `docker compose
|
|
118
|
-
return { exitCode: 0, output: ["[serve mock down]",
|
|
96
|
+
? `docker compose ${fileFlags} down -v`
|
|
97
|
+
: `docker compose ${fileFlags} down`;
|
|
98
|
+
return { exitCode: 0, output: ["[serve mock down]"], commands: [{ cmd, remote: true, label: "compose down" }] };
|
|
119
99
|
}
|
|
120
100
|
function planLogs(args, profile) {
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
return { exitCode: 64, output: ["[serve mock logs] no compose_overlay set; nothing to tail."] };
|
|
101
|
+
const files = composeFiles(profile);
|
|
102
|
+
if (files.length === 0) {
|
|
103
|
+
return { exitCode: 64, output: ["[serve mock logs] no compose_files / compose_overlay set; nothing to tail."] };
|
|
124
104
|
}
|
|
105
|
+
const fileFlags = files.map((f) => `-f ${f}`).join(" ");
|
|
125
106
|
const follow = args.follow ? "-f" : "";
|
|
126
107
|
const service = args.service ?? "";
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
output: [` cmd: docker compose -f ${overlay} logs ${follow} ${service}`.replace(/\s+/g, " ").trim()],
|
|
130
|
-
};
|
|
108
|
+
const cmd = `docker compose ${fileFlags} logs ${follow} ${service}`.replace(/\s+/g, " ").trim();
|
|
109
|
+
return { exitCode: 0, output: ["[serve mock logs]"], commands: [{ cmd, remote: true, label: "compose logs" }] };
|
|
131
110
|
}
|
|
132
111
|
//# sourceMappingURL=mock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../../src/commands/serve/mock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../../src/commands/serve/mock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAc5D,MAAM,UAAU,aAAa,CAC3B,IAAkB,EAClB,OAAoB,EACpB,OAAsB;IAEtB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,IAAI;YACP,OAAO,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC/B,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,KAAK,OAAO;YACV,OAAO;gBACL,QAAQ,EAAE,CAAC;gBACX,MAAM,EAAE,CAAC,uGAAuG,CAAC;aAClH,CAAC;QACJ;YACE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,iBAAiB,IAAI,CAAC,IAAI,kCAAkC,CAAC,EAAE,CAAC;IACpG,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,KAAmB,EAAE,OAAsB;IACzD,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,MAAM,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
2
|
+
* Shell-command execution layer for `slowcook serve`.
|
|
3
|
+
*
|
|
4
|
+
* Closes sc#173 finding #1: prior to this, planners emitted command
|
|
5
|
+
* strings into `output[]` and exited without executing them, even when
|
|
6
|
+
* `profile.ssh_target` was set. Operators had to copy-paste the emitted
|
|
7
|
+
* command and run it themselves — the verb was documentation, not
|
|
8
|
+
* automation.
|
|
9
|
+
*
|
|
10
|
+
* Now planners populate `result.commands[]` with structured ShellCommand
|
|
11
|
+
* records; `runCommands()` wraps `remote: true` commands in
|
|
12
|
+
* `ssh user@host 'cd checkout_dir && <cmd>'` and executes (unless
|
|
13
|
+
* --dry-run, in which case the wrapped form is just printed).
|
|
14
|
+
*
|
|
15
|
+
* Local commands run via execSync in the repoRoot. Remote commands run
|
|
16
|
+
* via execSync of an ssh invocation. Either way: stdio inherited so the
|
|
17
|
+
* operator sees docker / git output in real time.
|
|
18
|
+
*/
|
|
19
|
+
import type { ProfileConfig } from "./config.js";
|
|
20
|
+
export interface ShellCommand {
|
|
21
|
+
/** The local-shell-shape command (e.g. `docker compose -f a.yml up -d`). */
|
|
22
|
+
cmd: string;
|
|
23
|
+
/**
|
|
24
|
+
* When true AND `profile.ssh_target` is set, wrap the command in
|
|
25
|
+
* `ssh <user>@<host> 'cd <checkout_dir> && <cmd>'`. When `ssh_target`
|
|
26
|
+
* is absent, runs locally regardless. Use for docker / box-side
|
|
27
|
+
* operations (up, down, logs). Local-only operations like `git push`
|
|
28
|
+
* should pass `remote: false`.
|
|
29
|
+
*/
|
|
30
|
+
remote?: boolean;
|
|
31
|
+
/** Optional label printed before the command (e.g. "bring up", "seed"). */
|
|
32
|
+
label?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface RunCommandsArgs {
|
|
35
|
+
commands: ShellCommand[];
|
|
36
|
+
profile: ProfileConfig;
|
|
37
|
+
repoRoot: string;
|
|
38
|
+
/** When true: print the resolved command but don't execute. */
|
|
39
|
+
dryRun?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface RunCommandsResult {
|
|
42
|
+
exitCode: number;
|
|
43
|
+
/** Additional human-readable lines emitted by the runner (resolved cmds, errors). */
|
|
44
|
+
output: string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a single ShellCommand into the wire-form string we'd actually
|
|
48
|
+
* pass to /bin/sh. Pure; useful for tests + the dry-run print path.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveCommand(cmd: ShellCommand, profile: ProfileConfig): string;
|
|
51
|
+
export declare function runCommands(args: RunCommandsArgs): RunCommandsResult;
|
|
52
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAShF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,iBAAiB,CAepE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell-command execution layer for `slowcook serve`.
|
|
3
|
+
*
|
|
4
|
+
* Closes sc#173 finding #1: prior to this, planners emitted command
|
|
5
|
+
* strings into `output[]` and exited without executing them, even when
|
|
6
|
+
* `profile.ssh_target` was set. Operators had to copy-paste the emitted
|
|
7
|
+
* command and run it themselves — the verb was documentation, not
|
|
8
|
+
* automation.
|
|
9
|
+
*
|
|
10
|
+
* Now planners populate `result.commands[]` with structured ShellCommand
|
|
11
|
+
* records; `runCommands()` wraps `remote: true` commands in
|
|
12
|
+
* `ssh user@host 'cd checkout_dir && <cmd>'` and executes (unless
|
|
13
|
+
* --dry-run, in which case the wrapped form is just printed).
|
|
14
|
+
*
|
|
15
|
+
* Local commands run via execSync in the repoRoot. Remote commands run
|
|
16
|
+
* via execSync of an ssh invocation. Either way: stdio inherited so the
|
|
17
|
+
* operator sees docker / git output in real time.
|
|
18
|
+
*/
|
|
19
|
+
import { execSync } from "node:child_process";
|
|
20
|
+
/**
|
|
21
|
+
* Resolve a single ShellCommand into the wire-form string we'd actually
|
|
22
|
+
* pass to /bin/sh. Pure; useful for tests + the dry-run print path.
|
|
23
|
+
*/
|
|
24
|
+
export function resolveCommand(cmd, profile) {
|
|
25
|
+
if (cmd.remote && profile.ssh_target) {
|
|
26
|
+
const { user, host, checkout_dir } = profile.ssh_target;
|
|
27
|
+
// Single-quote the remote command. Inner single quotes get escaped via
|
|
28
|
+
// the bash `'\''` trick so paths/cmds containing `'` survive.
|
|
29
|
+
const inner = cmd.cmd.replace(/'/g, `'\\''`);
|
|
30
|
+
return `ssh ${user}@${host} 'cd ${checkout_dir} && ${inner}'`;
|
|
31
|
+
}
|
|
32
|
+
return cmd.cmd;
|
|
33
|
+
}
|
|
34
|
+
export function runCommands(args) {
|
|
35
|
+
const out = [];
|
|
36
|
+
for (const c of args.commands) {
|
|
37
|
+
const wire = resolveCommand(c, args.profile);
|
|
38
|
+
if (c.label)
|
|
39
|
+
out.push(` ${c.label}:`);
|
|
40
|
+
out.push(` ${args.dryRun ? "would run" : "run"}: ${wire}`);
|
|
41
|
+
if (args.dryRun)
|
|
42
|
+
continue;
|
|
43
|
+
try {
|
|
44
|
+
execSync(wire, { cwd: args.repoRoot, stdio: "inherit" });
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
out.push(` ✗ command failed: ${wire}`);
|
|
48
|
+
return { exitCode: 1, output: out };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return { exitCode: 0, output: out };
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../../src/commands/serve/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAgC9C;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAiB,EAAE,OAAsB;IACtE,IAAI,GAAG,CAAC,MAAM,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACrC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;QACxD,uEAAuE;QACvE,8DAA8D;QAC9D,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7C,OAAO,OAAO,IAAI,IAAI,IAAI,QAAQ,YAAY,OAAO,KAAK,GAAG,CAAC;IAChE,CAAC;IACD,OAAO,GAAG,CAAC,GAAG,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAqB;IAC/C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,cAAc,CAAC,CAAC,EAAE,IAAI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