@prisma/composer-cli 0.8.0 → 0.9.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/bin.mjs +7 -7
- package/dist/bin.mjs.map +1 -1
- package/dist/{execute-deploy-destroy-DRl6Tfg9-C1fMkZI-.mjs → execute-deploy-destroy-Bk5vwMOf-DR0yTDWz.mjs} +3 -3
- package/dist/{execute-deploy-destroy-DRl6Tfg9-C1fMkZI-.mjs.map → execute-deploy-destroy-Bk5vwMOf-DR0yTDWz.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-DRl6Tfg9-C6DPd1Ks.mjs → execute-deploy-destroy-Bk5vwMOf-IZ-iFlHY.mjs} +3 -3
- package/dist/{execute-deploy-destroy-DRl6Tfg9-C6DPd1Ks.mjs.map → execute-deploy-destroy-Bk5vwMOf-IZ-iFlHY.mjs.map} +1 -1
- package/dist/{execute-dev-BMTFWfFc-B1whS-Rr.mjs → execute-dev-CM2xQ_pz-NpvkuAOf.mjs} +3 -3
- package/dist/{execute-dev-BMTFWfFc-B1whS-Rr.mjs.map → execute-dev-CM2xQ_pz-NpvkuAOf.mjs.map} +1 -1
- package/dist/{execute-dev-BMTFWfFc-D0niyhe3.mjs → execute-dev-CM2xQ_pz-qVd6OzyA.mjs} +3 -3
- package/dist/{execute-dev-BMTFWfFc-D0niyhe3.mjs.map → execute-dev-CM2xQ_pz-qVd6OzyA.mjs.map} +1 -1
- package/dist/{execute-log-Cay9hlKW-DrMeVOXq.mjs → execute-log-CUbn7f2_-Dr4RKACX.mjs} +3 -3
- package/dist/{execute-log-Cay9hlKW-DrMeVOXq.mjs.map → execute-log-CUbn7f2_-Dr4RKACX.mjs.map} +1 -1
- package/dist/{execute-log-Cay9hlKW-DJMh35AZ.mjs → execute-log-CUbn7f2_-IblMXyUJ.mjs} +3 -3
- package/dist/{execute-log-Cay9hlKW-DJMh35AZ.mjs.map → execute-log-CUbn7f2_-IblMXyUJ.mjs.map} +1 -1
- package/dist/family.mjs +6 -6
- package/dist/family.mjs.map +1 -1
- package/dist/{pipeline-AoW8zq4I-C6Qe0VaZ.mjs → pipeline-CCuthvMX-DeTFEdBI.mjs} +78 -4
- package/dist/pipeline-CCuthvMX-DeTFEdBI.mjs.map +1 -0
- package/dist/{pipeline-AoW8zq4I-DYNbf-ad.mjs → pipeline-CCuthvMX-DuLdp_gi.mjs} +78 -4
- package/dist/pipeline-CCuthvMX-DuLdp_gi.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/pipeline-AoW8zq4I-C6Qe0VaZ.mjs.map +0 -1
- package/dist/pipeline-AoW8zq4I-DYNbf-ad.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as CliStructuredError, n as ok, s as toStructured, t as notOk } from "./result-B4XjxVK6.mjs";
|
|
2
|
-
import { t as resolveAppIdentity } from "./pipeline-
|
|
2
|
+
import { t as resolveAppIdentity } from "./pipeline-CCuthvMX-DeTFEdBI.mjs";
|
|
3
3
|
import { n as withEmulatorRetry, r as DEV_DIR, t as resolveLocalTargets } from "./local-target-H0IWu_FM.mjs";
|
|
4
4
|
import * as path from "node:path";
|
|
5
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-log-
|
|
5
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-log-CUbn7f2_.mjs
|
|
6
6
|
/**
|
|
7
7
|
* The log executor — run-log.ts's attach-and-tail (config → localTarget →
|
|
8
8
|
* container → attach → logs) with console and signal handling removed: the
|
|
@@ -154,4 +154,4 @@ async function executeLog(input, deps, cwd) {
|
|
|
154
154
|
//#endregion
|
|
155
155
|
export { LOG_QUEUE_LIMIT, executeLog };
|
|
156
156
|
|
|
157
|
-
//# sourceMappingURL=execute-log-
|
|
157
|
+
//# sourceMappingURL=execute-log-CUbn7f2_-Dr4RKACX.mjs.map
|
package/dist/{execute-log-Cay9hlKW-DrMeVOXq.mjs.map → execute-log-CUbn7f2_-Dr4RKACX.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-log-
|
|
1
|
+
{"version":3,"file":"execute-log-CUbn7f2_-Dr4RKACX.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/execute-log-CUbn7f2_.mjs"],"sourcesContent":["import { r as toStructured } from \"./shared-BTnATsqm.mjs\";\nimport { t as resolveAppIdentity } from \"./pipeline-CCuthvMX.mjs\";\nimport { t as withEmulatorRetry } from \"./emulator-retry-DGonap4g.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { DEV_DIR, resolveLocalTargets } from \"@internal/core/local-target\";\n//#region src/operations/execute-log.ts\n/**\n* The log executor — run-log.ts's attach-and-tail (config → localTarget →\n* container → attach → logs) with console and signal handling removed: the\n* merged stream comes back as an AsyncIterable, ended by the caller's\n* AbortSignal. Reached only by lazy import from log.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nfunction failureMessage(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** The merge queue's bound: past this, the oldest line is dropped and the\n* consumer is told via a `lines-dropped` event — a log viewer tolerates loss\n* better than the host tolerates unbounded memory growth. Exported so tests\n* can size their floods relative to the bound. */\nconst LOG_QUEUE_LIMIT = 1e4;\n/**\n* Merges every attachment's log stream into one iterable: one pump per\n* attachment pushing into a shared bounded queue. A pump's throw becomes a\n* `stream-failed` event and ends that pump only; the merged iterable ends\n* when `input.signal` aborts, when every pump ends, or when the consumer\n* stops iterating (an early `break` aborts an internal controller so the\n* pumps tear down — the generator never waits on a source that will not\n* end). No event is delivered after the iterable has ended. Address\n* filtering and `tail` apply exactly as the CLI always has.\n*/\nasync function* mergeLogStreams(attachments, input) {\n\tconst controller = new AbortController();\n\tconst { signal } = controller;\n\tconst abortInternal = () => controller.abort();\n\tif (input.signal?.aborted === true) controller.abort();\n\tinput.signal?.addEventListener(\"abort\", abortInternal, { once: true });\n\tconst queue = [];\n\tlet dropped = 0;\n\tlet done = false;\n\tlet active = attachments.length;\n\tlet wake;\n\tconst notify = () => {\n\t\twake?.();\n\t\twake = void 0;\n\t};\n\tsignal.addEventListener(\"abort\", notify, { once: true });\n\tconst emit = (event) => {\n\t\tif (done) return;\n\t\ttry {\n\t\t\tinput.onEvent?.(event);\n\t\t} catch {}\n\t};\n\tconst pump = async (attachment) => {\n\t\ttry {\n\t\t\tfor await (const { service, line } of attachment.logs(signal, { tail: input.tail ?? 0 })) {\n\t\t\t\tif (signal.aborted) return;\n\t\t\t\tif (input.address !== void 0 && service !== input.address) continue;\n\t\t\t\tif (queue.length >= 1e4) {\n\t\t\t\t\tqueue.shift();\n\t\t\t\t\tdropped += 1;\n\t\t\t\t}\n\t\t\t\tqueue.push({\n\t\t\t\t\tservice,\n\t\t\t\t\tline\n\t\t\t\t});\n\t\t\t\tnotify();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (!signal.aborted) emit({\n\t\t\t\tkind: \"stream-failed\",\n\t\t\t\tmessage: failureMessage(error)\n\t\t\t});\n\t\t} finally {\n\t\t\tactive -= 1;\n\t\t\tnotify();\n\t\t}\n\t};\n\tfor (const attachment of attachments) pump(attachment);\n\ttry {\n\t\twhile (true) {\n\t\t\tlet next = queue.shift();\n\t\t\twhile (next !== void 0) {\n\t\t\t\tif (dropped > 0) {\n\t\t\t\t\tconst count = dropped;\n\t\t\t\t\tdropped = 0;\n\t\t\t\t\temit({\n\t\t\t\t\t\tkind: \"lines-dropped\",\n\t\t\t\t\t\tcount\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tyield next;\n\t\t\t\tnext = queue.shift();\n\t\t\t}\n\t\t\tif (signal.aborted || active === 0) break;\n\t\t\tawait new Promise((resolve) => {\n\t\t\t\twake = resolve;\n\t\t\t});\n\t\t}\n\t} finally {\n\t\tdone = true;\n\t\tcontroller.abort();\n\t\tsignal.removeEventListener(\"abort\", notify);\n\t\tinput.signal?.removeEventListener(\"abort\", abortInternal);\n\t}\n}\n/** Resolves the running app and attaches to its log streams; the caller consumes `lines`. */\nasync function executeLog(input, deps, cwd) {\n\tif (process.platform === \"win32\") return notOk(new CliStructuredError(\"LOG.PLATFORM_UNSUPPORTED\", \"local dev is not supported on Windows yet.\"));\n\tconst devDir = path.join(cwd, DEV_DIR);\n\tlet name;\n\tconst attachments = [];\n\tlet services;\n\ttry {\n\t\tconst identity = deps.identity ?? await resolveAppIdentity(input.entry, input.name, cwd, {\n\t\t\tconfig: deps.config,\n\t\t\tconfigPath: deps.configPath\n\t\t});\n\t\tname = identity.name;\n\t\tconst resolved = await resolveLocalTargets(identity.config);\n\t\tfor (const target of resolved.values()) try {\n\t\t\tconst container = await target.container.ensure({\n\t\t\t\tappName: name,\n\t\t\t\tstage: void 0\n\t\t\t});\n\t\t\tattachments.push(await withEmulatorRetry(() => target.attach({\n\t\t\t\tcontainer,\n\t\t\t\tdevDir\n\t\t\t})));\n\t\t} catch (error) {\n\t\t\tthrow toStructured(\"LOG.ATTACH_FAILED\", error);\n\t\t}\n\t\ttry {\n\t\t\tservices = (await Promise.all(attachments.map((a) => withEmulatorRetry(() => a.endpoints())))).flat();\n\t\t} catch (error) {\n\t\t\tthrow toStructured(\"LOG.ATTACH_FAILED\", error);\n\t\t}\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (services.length === 0) return ok({\n\t\tappName: name,\n\t\tservices: [],\n\t\tlines: mergeLogStreams([], input)\n\t});\n\tif (input.address !== void 0 && !services.some((s) => s.address === input.address)) return notOk(new CliStructuredError(\"LOG.ADDRESS_UNKNOWN\", `no service \"${input.address}\" in \"${name}\" — running services: ${services.map((s) => s.address).join(\", \")}.`));\n\treturn ok({\n\t\tappName: name,\n\t\tservices,\n\t\tlines: mergeLogStreams(attachments, input)\n\t});\n}\n//#endregion\nexport { LOG_QUEUE_LIMIT, executeLog };\n\n//# sourceMappingURL=execute-log-CUbn7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OAAO;GACf,MAAM,aAAa,qBAAqB,KAAK;EAC9C;CACD,SAAS,OAAO;EACf,IAAI,mBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,MAAM;CACP;CACA,IAAI,SAAS,WAAW,GAAG,OAAO,GAAG;EACpC,SAAS;EACT,UAAU,CAAC;EACX,OAAO,gBAAgB,CAAC,GAAG,KAAK;CACjC,CAAC;CACD,IAAI,MAAM,YAAY,KAAK,KAAK,CAAC,SAAS,MAAM,MAAM,EAAE,YAAY,MAAM,OAAO,GAAG,OAAO,MAAM,IAAI,mBAAmB,uBAAuB,eAAe,MAAM,QAAQ,QAAQ,KAAK,wBAAwB,SAAS,KAAK,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;CAC9P,OAAO,GAAG;EACT,SAAS;EACT;EACA,OAAO,gBAAgB,aAAa,KAAK;CAC1C,CAAC;AACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as CliStructuredError, n as ok, t as notOk } from "./result-D4d-xy4I.mjs";
|
|
2
2
|
import { i as toStructured } from "./shared-BTnATsqm-CDCqKwCF.mjs";
|
|
3
|
-
import { t as resolveAppIdentity } from "./pipeline-
|
|
3
|
+
import { t as resolveAppIdentity } from "./pipeline-CCuthvMX-DuLdp_gi.mjs";
|
|
4
4
|
import { n as withEmulatorRetry, r as DEV_DIR, t as resolveLocalTargets } from "./local-target-CBZyaBy0.mjs";
|
|
5
5
|
import * as path from "node:path";
|
|
6
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-log-
|
|
6
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-log-CUbn7f2_.mjs
|
|
7
7
|
/**
|
|
8
8
|
* The log executor — run-log.ts's attach-and-tail (config → localTarget →
|
|
9
9
|
* container → attach → logs) with console and signal handling removed: the
|
|
@@ -155,4 +155,4 @@ async function executeLog(input, deps, cwd) {
|
|
|
155
155
|
//#endregion
|
|
156
156
|
export { LOG_QUEUE_LIMIT, executeLog };
|
|
157
157
|
|
|
158
|
-
//# sourceMappingURL=execute-log-
|
|
158
|
+
//# sourceMappingURL=execute-log-CUbn7f2_-IblMXyUJ.mjs.map
|
package/dist/{execute-log-Cay9hlKW-DJMh35AZ.mjs.map → execute-log-CUbn7f2_-IblMXyUJ.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-log-
|
|
1
|
+
{"version":3,"file":"execute-log-CUbn7f2_-IblMXyUJ.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/execute-log-CUbn7f2_.mjs"],"sourcesContent":["import { r as toStructured } from \"./shared-BTnATsqm.mjs\";\nimport { t as resolveAppIdentity } from \"./pipeline-CCuthvMX.mjs\";\nimport { t as withEmulatorRetry } from \"./emulator-retry-DGonap4g.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as path from \"node:path\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { DEV_DIR, resolveLocalTargets } from \"@internal/core/local-target\";\n//#region src/operations/execute-log.ts\n/**\n* The log executor — run-log.ts's attach-and-tail (config → localTarget →\n* container → attach → logs) with console and signal handling removed: the\n* merged stream comes back as an AsyncIterable, ended by the caller's\n* AbortSignal. Reached only by lazy import from log.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nfunction failureMessage(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** The merge queue's bound: past this, the oldest line is dropped and the\n* consumer is told via a `lines-dropped` event — a log viewer tolerates loss\n* better than the host tolerates unbounded memory growth. Exported so tests\n* can size their floods relative to the bound. */\nconst LOG_QUEUE_LIMIT = 1e4;\n/**\n* Merges every attachment's log stream into one iterable: one pump per\n* attachment pushing into a shared bounded queue. A pump's throw becomes a\n* `stream-failed` event and ends that pump only; the merged iterable ends\n* when `input.signal` aborts, when every pump ends, or when the consumer\n* stops iterating (an early `break` aborts an internal controller so the\n* pumps tear down — the generator never waits on a source that will not\n* end). No event is delivered after the iterable has ended. Address\n* filtering and `tail` apply exactly as the CLI always has.\n*/\nasync function* mergeLogStreams(attachments, input) {\n\tconst controller = new AbortController();\n\tconst { signal } = controller;\n\tconst abortInternal = () => controller.abort();\n\tif (input.signal?.aborted === true) controller.abort();\n\tinput.signal?.addEventListener(\"abort\", abortInternal, { once: true });\n\tconst queue = [];\n\tlet dropped = 0;\n\tlet done = false;\n\tlet active = attachments.length;\n\tlet wake;\n\tconst notify = () => {\n\t\twake?.();\n\t\twake = void 0;\n\t};\n\tsignal.addEventListener(\"abort\", notify, { once: true });\n\tconst emit = (event) => {\n\t\tif (done) return;\n\t\ttry {\n\t\t\tinput.onEvent?.(event);\n\t\t} catch {}\n\t};\n\tconst pump = async (attachment) => {\n\t\ttry {\n\t\t\tfor await (const { service, line } of attachment.logs(signal, { tail: input.tail ?? 0 })) {\n\t\t\t\tif (signal.aborted) return;\n\t\t\t\tif (input.address !== void 0 && service !== input.address) continue;\n\t\t\t\tif (queue.length >= 1e4) {\n\t\t\t\t\tqueue.shift();\n\t\t\t\t\tdropped += 1;\n\t\t\t\t}\n\t\t\t\tqueue.push({\n\t\t\t\t\tservice,\n\t\t\t\t\tline\n\t\t\t\t});\n\t\t\t\tnotify();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (!signal.aborted) emit({\n\t\t\t\tkind: \"stream-failed\",\n\t\t\t\tmessage: failureMessage(error)\n\t\t\t});\n\t\t} finally {\n\t\t\tactive -= 1;\n\t\t\tnotify();\n\t\t}\n\t};\n\tfor (const attachment of attachments) pump(attachment);\n\ttry {\n\t\twhile (true) {\n\t\t\tlet next = queue.shift();\n\t\t\twhile (next !== void 0) {\n\t\t\t\tif (dropped > 0) {\n\t\t\t\t\tconst count = dropped;\n\t\t\t\t\tdropped = 0;\n\t\t\t\t\temit({\n\t\t\t\t\t\tkind: \"lines-dropped\",\n\t\t\t\t\t\tcount\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tyield next;\n\t\t\t\tnext = queue.shift();\n\t\t\t}\n\t\t\tif (signal.aborted || active === 0) break;\n\t\t\tawait new Promise((resolve) => {\n\t\t\t\twake = resolve;\n\t\t\t});\n\t\t}\n\t} finally {\n\t\tdone = true;\n\t\tcontroller.abort();\n\t\tsignal.removeEventListener(\"abort\", notify);\n\t\tinput.signal?.removeEventListener(\"abort\", abortInternal);\n\t}\n}\n/** Resolves the running app and attaches to its log streams; the caller consumes `lines`. */\nasync function executeLog(input, deps, cwd) {\n\tif (process.platform === \"win32\") return notOk(new CliStructuredError(\"LOG.PLATFORM_UNSUPPORTED\", \"local dev is not supported on Windows yet.\"));\n\tconst devDir = path.join(cwd, DEV_DIR);\n\tlet name;\n\tconst attachments = [];\n\tlet services;\n\ttry {\n\t\tconst identity = deps.identity ?? await resolveAppIdentity(input.entry, input.name, cwd, {\n\t\t\tconfig: deps.config,\n\t\t\tconfigPath: deps.configPath\n\t\t});\n\t\tname = identity.name;\n\t\tconst resolved = await resolveLocalTargets(identity.config);\n\t\tfor (const target of resolved.values()) try {\n\t\t\tconst container = await target.container.ensure({\n\t\t\t\tappName: name,\n\t\t\t\tstage: void 0\n\t\t\t});\n\t\t\tattachments.push(await withEmulatorRetry(() => target.attach({\n\t\t\t\tcontainer,\n\t\t\t\tdevDir\n\t\t\t})));\n\t\t} catch (error) {\n\t\t\tthrow toStructured(\"LOG.ATTACH_FAILED\", error);\n\t\t}\n\t\ttry {\n\t\t\tservices = (await Promise.all(attachments.map((a) => withEmulatorRetry(() => a.endpoints())))).flat();\n\t\t} catch (error) {\n\t\t\tthrow toStructured(\"LOG.ATTACH_FAILED\", error);\n\t\t}\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (services.length === 0) return ok({\n\t\tappName: name,\n\t\tservices: [],\n\t\tlines: mergeLogStreams([], input)\n\t});\n\tif (input.address !== void 0 && !services.some((s) => s.address === input.address)) return notOk(new CliStructuredError(\"LOG.ADDRESS_UNKNOWN\", `no service \"${input.address}\" in \"${name}\" — running services: ${services.map((s) => s.address).join(\", \")}.`));\n\treturn ok({\n\t\tappName: name,\n\t\tservices,\n\t\tlines: mergeLogStreams(attachments, input)\n\t});\n}\n//#endregion\nexport { LOG_QUEUE_LIMIT, executeLog };\n\n//# sourceMappingURL=execute-log-CUbn7f2_.mjs.map"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAS,eAAe,OAAO;CAC9B,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC7D;;;;;AAKA,MAAM,kBAAkB;;;;;;;;;;;AAWxB,gBAAgB,gBAAgB,aAAa,OAAO;CACnD,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,EAAE,WAAW;CACnB,MAAM,sBAAsB,WAAW,MAAM;CAC7C,IAAI,MAAM,QAAQ,YAAY,MAAM,WAAW,MAAM;CACrD,MAAM,QAAQ,iBAAiB,SAAS,eAAe,EAAE,MAAM,KAAK,CAAC;CACrE,MAAM,QAAQ,CAAC;CACf,IAAI,UAAU;CACd,IAAI,OAAO;CACX,IAAI,SAAS,YAAY;CACzB,IAAI;CACJ,MAAM,eAAe;EACpB,OAAO;EACP,OAAO,KAAK;CACb;CACA,OAAO,iBAAiB,SAAS,QAAQ,EAAE,MAAM,KAAK,CAAC;CACvD,MAAM,QAAQ,UAAU;EACvB,IAAI,MAAM;EACV,IAAI;GACH,MAAM,UAAU,KAAK;EACtB,QAAQ,CAAC;CACV;CACA,MAAM,OAAO,OAAO,eAAe;EAClC,IAAI;GACH,WAAW,MAAM,EAAE,SAAS,UAAU,WAAW,KAAK,QAAQ,EAAE,MAAM,MAAM,QAAQ,EAAE,CAAC,GAAG;IACzF,IAAI,OAAO,SAAS;IACpB,IAAI,MAAM,YAAY,KAAK,KAAK,YAAY,MAAM,SAAS;IAC3D,IAAI,MAAM,UAAU,KAAK;KACxB,MAAM,MAAM;KACZ,WAAW;IACZ;IACA,MAAM,KAAK;KACV;KACA;IACD,CAAC;I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A;GACD,CAAC,CAAC,CAAC;EACJ,SAAS,OAAO;GACf,MAAM,aAAa,qBAAqB,KAAK;EAC9C;EACA,IAAI;GACH,YAAY,MAAM,QAAQ,IAAI,YAAY,KAAK,MAAM,wBAAwB,EAAE,UAAU,CAAC,CAAC,CAAC,EAAA,CAAG,KAAK;EACrG,SAAS,OAAO;GACf,MAAM,aAAa,qBAAqB,KAAK;EAC9C;CACD,SAAS,OAAO;EACf,IAAI,mBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,MAAM;CACP;CACA,IAAI,SAAS,WAAW,GAAG,OAAO,GAAG;EACpC,SAAS;EACT,UAAU,CAAC;EACX,OAAO,gBAAgB,CAAC,GAAG,KAAK;CACjC,CAAC;CACD,IAAI,MAAM,YAAY,KAAK,KAAK,CAAC,SAAS,MAAM,MAAM,EAAE,YAAY,MAAM,OAAO,GAAG,OAAO,MAAM,IAAI,mBAAmB,uBAAuB,eAAe,MAAM,QAAQ,QAAQ,KAAK,wBAAwB,SAAS,KAAK,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;CAC9P,OAAO,GAAG;EACT,SAAS;EACT;EACA,OAAO,gBAAgB,aAAa,KAAK;CAC1C,CAAC;AACF"}
|
package/dist/family.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { t as alchemyCommandLine } from "./run-alchemy-D44OZlyB-wmf8mHRE.mjs";
|
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { EnvironmentCredentialManager, createCli, defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, loadConfig, positional } from "@prisma/cli-engine";
|
|
6
6
|
import { CliStructuredError, notOk, ok } from "@prisma/cli-engine/protocol";
|
|
7
|
-
//#region ../../0-framework/3-tooling/cli/dist/log-
|
|
7
|
+
//#region ../../0-framework/3-tooling/cli/dist/log-1EohuWIZ.mjs
|
|
8
8
|
/** In-package variant threading the injection seam (the CLI's RunDeps, unit
|
|
9
9
|
* tests). Deliberately NOT re-exported through `./control` — the seam mirrors
|
|
10
10
|
* internal types and is not part of the published surface. */
|
|
@@ -12,7 +12,7 @@ async function deployWithDeps(input, deps) {
|
|
|
12
12
|
const cwd = input.cwd ?? process.cwd();
|
|
13
13
|
let executor;
|
|
14
14
|
try {
|
|
15
|
-
executor = await import("./execute-deploy-destroy-
|
|
15
|
+
executor = await import("./execute-deploy-destroy-Bk5vwMOf-DR0yTDWz.mjs");
|
|
16
16
|
} catch (error) {
|
|
17
17
|
return notOk$1(executorLoadFailure("deploy", error, cwd));
|
|
18
18
|
}
|
|
@@ -25,7 +25,7 @@ async function destroyWithDeps(input, deps) {
|
|
|
25
25
|
const cwd = input.cwd ?? process.cwd();
|
|
26
26
|
let executor;
|
|
27
27
|
try {
|
|
28
|
-
executor = await import("./execute-deploy-destroy-
|
|
28
|
+
executor = await import("./execute-deploy-destroy-Bk5vwMOf-DR0yTDWz.mjs");
|
|
29
29
|
} catch (error) {
|
|
30
30
|
return notOk$1(executorLoadFailure("destroy", error, cwd));
|
|
31
31
|
}
|
|
@@ -38,7 +38,7 @@ async function devWithDeps(input, deps) {
|
|
|
38
38
|
const cwd = input.cwd ?? process.cwd();
|
|
39
39
|
let executor;
|
|
40
40
|
try {
|
|
41
|
-
executor = await import("./execute-dev-
|
|
41
|
+
executor = await import("./execute-dev-CM2xQ_pz-qVd6OzyA.mjs");
|
|
42
42
|
} catch (error) {
|
|
43
43
|
return notOk$1(executorLoadFailure("dev", error, cwd));
|
|
44
44
|
}
|
|
@@ -51,14 +51,14 @@ async function logWithDeps(input, deps) {
|
|
|
51
51
|
const cwd = input.cwd ?? process.cwd();
|
|
52
52
|
let executor;
|
|
53
53
|
try {
|
|
54
|
-
executor = await import("./execute-log-
|
|
54
|
+
executor = await import("./execute-log-CUbn7f2_-IblMXyUJ.mjs");
|
|
55
55
|
} catch (error) {
|
|
56
56
|
return notOk$1(executorLoadFailure("log", error, cwd));
|
|
57
57
|
}
|
|
58
58
|
return executor.executeLog(input, deps, cwd);
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|
|
61
|
-
//#region ../../0-framework/3-tooling/cli/dist/engine-cli-
|
|
61
|
+
//#region ../../0-framework/3-tooling/cli/dist/engine-cli-zWLMCCrQ.mjs
|
|
62
62
|
/**
|
|
63
63
|
* The family boundary's error translation.
|
|
64
64
|
*
|
package/dist/family.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"family.mjs","names":["notOk","CliStructuredError$1"],"sources":["../../../0-framework/3-tooling/cli/dist/log-B1EJJGSl.mjs","../../../0-framework/3-tooling/cli/dist/engine-cli-CaEeyz5M.mjs"],"sourcesContent":["import { n as executorLoadFailure } from \"./shared-BTnATsqm.mjs\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DRl6Tfg9.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error, cwd));\n\t}\n\treturn executor.executeDeploy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/destroy.ts\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DRl6Tfg9.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error, cwd));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-BMTFWfFc.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error, cwd));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's LogRunDeps,\n* unit tests). Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-Cay9hlKW.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error, cwd));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { destroy as a, deployWithDeps as c, devWithDeps as i, logWithDeps as n, destroyWithDeps as o, dev as r, deploy as s, log as t };\n\n//# sourceMappingURL=log-B1EJJGSl.mjs.map","import { t as executionDiagnostics } from \"./shared-BTnATsqm.mjs\";\nimport { c as deployWithDeps, i as devWithDeps, n as logWithDeps, o as destroyWithDeps } from \"./log-B1EJJGSl.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy-D44OZlyB.mjs\";\nimport { DOCS_BASE } from \"@internal/foundation/errors\";\nimport { EnvironmentCredentialManager, createCli, defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, loadConfig, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError as CliStructuredError$1, notOk, ok } from \"@prisma/cli-engine/protocol\";\nimport { spawn } from \"node:child_process\";\n//#region src/family/translate-error.ts\n/**\n* The family boundary's error translation.\n*\n* Composer and the engine each carry a class called `CliStructuredError`, both\n* descended from the same prisma/prisma foundation, and both recognize errors\n* by duck-typing on `name === 'CliStructuredError'`. That means a composer\n* error handed to the engine untranslated is ACCEPTED — it does not fail\n* loudly, it renders. What it loses is its `fix`: composer's foundation\n* carries remediation as one prose string on that field, the engine carries it\n* as a `nextActions` list and has no `fix` at all, so the fix text is dropped\n* silently and the user is told what broke with no word on what to do about\n* it. Nothing about that failure is visible without a test that looks for the\n* fix on the other side, which is why there is one.\n*\n* Everything else on the envelope survives as-is; only remediation changes\n* representation.\n*/\n/**\n* Composer's `fix` is free prose — \"add this overrides block and reinstall\",\n* \"run the build, then retry\" — with no machine-readable command inside it.\n* `user-choice` is the engine's own kind for exactly that (it is what the\n* engine uses for its own config and prompt failures), so the text carries\n* over verbatim as one action rather than being parsed into a command the\n* author never wrote.\n*/\nfunction fixAsNextActions(fix) {\n\treturn fix === void 0 ? [] : [{\n\t\tkind: \"user-choice\",\n\t\tlabel: fix\n\t}];\n}\n/** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */\nfunction toEngineError(error) {\n\treturn new CliStructuredError$1(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tnextActions: fixAsNextActions(error.fix),\n\t\t...error.why === void 0 ? {} : { why: error.why },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: error.meta },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl },\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/family/converge.ts\n/** The adapter the operations call, backed by the engine's `ctx.spawn` so the\n* terminal reaches alchemy natively and the engine owns signal policy. */\nfunction convergeSpawn(ctx) {\n\treturn async (invocation) => {\n\t\tconst line = alchemyCommandLine(invocation);\n\t\treturn await ctx.spawn({\n\t\t\tcommand: line.command,\n\t\t\targs: line.args,\n\t\t\tcwd: line.cwd,\n\t\t\tenv: line.env\n\t\t});\n\t};\n}\n/** The in-process leg's deps: composer's existing seam, carrying the engine's\n* own client and workspace id rather than anything read from the env. */\nfunction operationDeps(spec) {\n\treturn {\n\t\talchemy: spec.alchemy,\n\t\tconfigPath: spec.configPath,\n\t\tcredentials: {\n\t\t\tworkspaceId: spec.workspaceId,\n\t\t\tclient: spec.client\n\t\t}\n\t};\n}\n/**\n* The reproduce hint a failed converge carries. Deliberately absent for an\n* aborted one: the user stopped it, so there is nothing to reproduce.\n*/\nfunction reproduceHint(failure) {\n\tconst diagnostics = executionDiagnostics(failure);\n\tif (diagnostics === void 0) return [];\n\treturn [{\n\t\tkind: \"run-command\",\n\t\tlabel: `Run the converge directly from ${diagnostics.cwd} to reproduce this`,\n\t\tcommand: diagnostics.reproduceCommand,\n\t\treason: `Generated stack file: ${diagnostics.stackFilePath}`\n\t}];\n}\n/**\n* How a FAILED converge settles. `deploy`, `destroy` and `dev` all end this\n* way and must not drift apart, so the decision lives here once rather than\n* inline in each handler.\n*\n* A failure that reached the child exits with the child's status verbatim and\n* carries the reproduce hint; a failure that never reached the child is an\n* ordinary structured error and gets the normal envelope. Nothing here reads\n* `signal` — see settleConverge.\n*/\nfunction settleConvergeFailure(failure, ctx) {\n\tconst child = ctx.lastChild();\n\tif (child !== void 0 && child.exitCode !== 0) return ok(exitWithChildStatus({ nextActions: reproduceHint(failure) }));\n\treturn notOk(toEngineError(failure));\n}\n/**\n* How a converge settles, now that the engine owns the child's status.\n*\n* Nothing here reads `signal`. `exitWithChildStatus` settles from the engine's\n* own record of the child, and a signal-killed one overrules whatever this\n* function asked for: 128 + the signal, no failure envelope, and the reproduce\n* hint dropped, because the user stopped the run and there is nothing to\n* reproduce.\n*\n* What is left is the operation's own verdict. A failure that reached the\n* child exits with the child's status verbatim and carries the reproduce hint;\n* a failure that never reached the child is an ordinary structured error and\n* gets the normal envelope.\n*\n* A SUCCESS presents its result even when the child was signal-killed. No\n* composer operation produces that pair today — each one reports a\n* signal-killed converge as a failure — and an operation that ever did would\n* have a real result worth showing. The run still exits 130, because the\n* engine settles a signal-terminated run from its own record of the signal\n* whatever the handler returns.\n*/\nfunction settleConverge(result, ctx, present) {\n\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\treturn ok(present(result.value));\n}\n//#endregion\n//#region src/family/section.ts\n/**\n* Composer's projection into `prisma.config.ts` — the `composer` section.\n*\n* The section is deliberately tiny. Composer's real configuration lives in\n* `prisma-composer.config.ts`, which holds executable values (Effect layers,\n* provider factories, container lifecycles) and can only be understood by\n* evaluating it inside a running command. A config-section validator loads\n* with the command tree at start-up and must be dependency-light and total,\n* so it is the wrong place to evaluate any of that. What the section carries\n* is therefore only the one fact the engine can usefully know before a\n* command runs: WHERE that file is, when the user wants to say so.\n*\n* Its fields grow only by amending the slice contract.\n*/\nconst KNOWN_FIELDS = [\"configPath\"];\nfunction diagnostic(spec) {\n\treturn {\n\t\tcode: spec.code,\n\t\tseverity: spec.severity,\n\t\tsummary: spec.summary,\n\t\t...spec.why === void 0 ? {} : { why: spec.why },\n\t\tnextActions: spec.fix === void 0 ? [] : [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: spec.fix\n\t\t}]\n\t};\n}\nfunction validate(raw) {\n\tif (raw === void 0) return {\n\t\tok: true,\n\t\tvalue: {},\n\t\tdiagnostics: []\n\t};\n\tif (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) return {\n\t\tok: false,\n\t\tdiagnostics: [diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tseverity: \"error\",\n\t\t\tsummary: \"The `composer` section of prisma.config.ts must be an object.\",\n\t\t\tfix: \"Write `composer: { configPath: \\\"./prisma-composer.config.ts\\\" }`, or remove the section entirely.\"\n\t\t})]\n\t};\n\tlet record;\n\ttry {\n\t\trecord = { ...raw };\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tdiagnostics: [diagnostic({\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tsummary: \"The `composer` section of prisma.config.ts could not be read.\",\n\t\t\t\twhy: \"Reading its fields threw, so nothing in it can be trusted.\",\n\t\t\t\tfix: \"Write it as a plain object literal, e.g. `composer: { configPath: \\\"./prisma-composer.config.ts\\\" }`.\"\n\t\t\t})]\n\t\t};\n\t}\n\tconst configPath = record[\"configPath\"];\n\tif (configPath !== void 0 && (typeof configPath !== \"string\" || configPath.length === 0)) return {\n\t\tok: false,\n\t\tdiagnostics: [diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tseverity: \"error\",\n\t\t\tsummary: \"`composer.configPath` must be a non-empty string.\",\n\t\t\twhy: \"It names the prisma-composer.config.ts file to load.\",\n\t\t\tfix: \"Set it to a path, or remove it to search upward from the entry.\"\n\t\t})]\n\t};\n\tconst unknown = Object.keys(record).filter((key) => !KNOWN_FIELDS.includes(key));\n\treturn {\n\t\tok: true,\n\t\tvalue: configPath === void 0 ? {} : { configPath },\n\t\tdiagnostics: unknown.map((key) => diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_UNKNOWN\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: `The \\`composer\\` section has no field \\`${key}\\`; it is ignored.`,\n\t\t\tfix: `Remove \\`${key}\\`, or check it against the version of @prisma/composer you have installed.`\n\t\t}))\n\t};\n}\nconst composerSection = defineConfigSection({\n\tname: \"composer\",\n\tvalidate\n});\n//#endregion\n//#region src/family/workspace.ts\n/**\n* The workspace the in-process leg acts in, from the engine's credential\n* read. Handlers never decode a token and never read PRISMA_WORKSPACE_ID:\n* whether the credential came from a stored session or the environment, the\n* engine has already resolved it, and branching on where it came from is a\n* defect by the credential-manager design.\n*\n* Undefined when the active credential names no workspace — an environment\n* token whose claims carry none. The container descriptors raise their own\n* \"workspace required\" error in that case, which is the error the user needs.\n*/\nasync function workspaceIdOf(ctx) {\n\treturn (await ctx.activeCredential())?.workspaceId;\n}\n//#endregion\n//#region src/family/commands/deploy.ts\n/**\n* `deploy <entry>` — a result command that hands the terminal to alchemy.\n*\n* `--production` is gone. It was accepted and then always errored (\"only\n* valid with destroy\"), so no invocation using it could ever have succeeded;\n* deploy targets production by default when no `--stage` is given.\n*/\nconst createDeployCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} deploy src/service.ts\", \"{bin} deploy src/service.ts --stage feat-auth\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the deploy's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Deploy scope to target; omit for production.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\treport: flag.string({\n\t\t\t\tbrief: \"Write the deploy's outcome as JSON to this path — resources, preview URLs, and the failure cause. Also settable as PRISMA_COMPOSER_REPORT_FILE.\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t}),\n\t\t\tbuildId: flag.string({\n\t\t\t\tbrief: \"Join the deploy record your CI already created rather than letting the target create one. Each target also reads its own environment variable for this; the flag wins.\",\n\t\t\t\tplaceholder: \"id\"\n\t\t\t})\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.deploy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\tstage: args.flags.stage,\n\t\t\tcwd: ctx.cwd,\n\t\t\treportPath: args.flags.report,\n\t\t\treportId: args.flags.buildId\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tconfigPath: ctx.config.configPath,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, ({ summary }) => ctx.present({ data: { summary: summary ?? null } }, {\n\t\t\thuman: (ui) => summary === void 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Deployed.\"\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `Deployed ${ui.emphasize(summary.app)}.`\n\t\t\t}, {\n\t\t\t\tkind: \"table\",\n\t\t\t\tcolumns: [\"Address\", \"Deployed\"],\n\t\t\t\trows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(\", \")])\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => ({ summary: summary ?? null }),\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/target.ts\n/**\n* `destroy`'s target, from its two mutually exclusive flags. Kept out of the\n* grammar because the engine's flag layer has no \"exactly one of these\"\n* construct — and because both wrong shapes need their own remedy, which a\n* generic arity error could not give.\n*/\nfunction targetOf(stage, production) {\n\tif (stage !== void 0 && production) return notOk(new CliStructuredError$1(\"DEPLOY.TARGET_CONFLICT\", \"Pass either --stage <name> or --production to `destroy`, not both.\"));\n\tif (stage === void 0 && !production) return notOk(new CliStructuredError$1(\"DEPLOY.TARGET_MISSING\", \"`destroy` requires an explicit target.\", { nextActions: [{\n\t\tkind: \"user-choice\",\n\t\tlabel: \"Pass --stage <name> to tear down a branch environment, or --production to tear down the production environment.\"\n\t}] }));\n\treturn ok(stage !== void 0 ? {\n\t\tkind: \"stage\",\n\t\tstage\n\t} : { kind: \"production\" });\n}\n//#endregion\n//#region src/family/commands/destroy.ts\n/**\n* `destroy <entry>` — deploy's mirror: same derivation, alchemy destroy.\n*\n* No confirmation prompt, matching the CLI this replaces. The front door\n* cannot know what the child will tear down, so a consent step here would be\n* asking the user to approve a list nobody has computed yet; if destroy\n* deserves one it belongs in composer's own operation, not in the grammar.\n*/\nconst createDestroyCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Tear down the application whose root node is <entry>'s default export.\",\n\t\tdescription: \"Same derivation as deploy. Requires an explicit target: --stage <name> for a branch environment, or --production for the production environment.\",\n\t\texamples: [\"{bin} destroy src/service.ts --stage feat-auth\", \"{bin} destroy src/service.ts --production\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the application name to tear down.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Tear down this branch environment.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\tproduction: flag.boolean({ brief: \"Tear down the project-level production environment.\" })\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst target = targetOf(args.flags.stage, args.flags.production);\n\t\tif (!target.ok) return target;\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.destroy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\ttarget: target.value,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: (event) => {\n\t\t\t\tif (event.kind !== \"no-local-deploy-state\") return;\n\t\t\t\tctx.report({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `No prior deploy state under ${event.cwd} — if you deployed from a different directory, run destroy from there; otherwise this is a no-op.`\n\t\t\t\t});\n\t\t\t}\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tconfigPath: ctx.config.configPath,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, () => ctx.present({ data: void 0 }, {\n\t\t\thuman: () => [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Destroyed.\"\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => void 0,\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/commands/dev.ts\nconst STOP_STEP = \"Stopping the app's services — emulators and data stay up\";\n/** Resolves when the run is asked to stop. */\nfunction stopRequested(signal) {\n\tif (signal.aborted) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* One converge at a time. `ctx.spawn` refuses a second live child, and the\n* watch loop can well fire a rebuild while the previous converge is still\n* running — so a request that arrives during a live converge joins the single\n* queued follow-up instead of starting its own. That extends the coalescing\n* the watcher already does across a burst of edits to cover the converge\n* itself, and it is sound because every dev converge is the SAME invocation:\n* one stack file at one fixed path, rewritten in place before each request.\n*/\nfunction coalescedConverge(run) {\n\tlet live;\n\tlet queued;\n\tconst start = (invocation) => {\n\t\tconst outcome = run(invocation);\n\t\tconst settled = outcome.then(() => void 0, () => void 0);\n\t\tlive = settled;\n\t\tsettled.then(() => {\n\t\t\tif (live === settled) live = void 0;\n\t\t});\n\t\treturn outcome;\n\t};\n\treturn (invocation) => {\n\t\tconst running = live;\n\t\tif (running === void 0) return start(invocation);\n\t\tqueued ??= running.then(() => {\n\t\t\tqueued = void 0;\n\t\t\treturn start(invocation);\n\t\t});\n\t\treturn queued;\n\t};\n}\n/** The front door, ordered by address depth (fewest dots first) then lexicographically. */\nfunction frontDoorOrder(endpoints) {\n\treturn [...endpoints].sort((a, b) => {\n\t\tconst depth = a.address.split(\".\").length - b.address.split(\".\").length;\n\t\tif (depth !== 0) return depth;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t});\n}\n/**\n* The operation's events as engine events. The legacy `[dev]` console prefix\n* is gone: these are commentary the engine renders and frames.\n*/\nfunction reportDevEvent(report, lastChild) {\n\tlet stopFailed = false;\n\treturn (event) => {\n\t\tswitch (event.kind) {\n\t\t\tcase \"ready\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"status\",\n\t\t\t\t\tsubject: \"dev\",\n\t\t\t\t\tstatus: \"ready\"\n\t\t\t\t});\n\t\t\t\tfor (const endpoint of frontDoorOrder(event.endpoints)) report({\n\t\t\t\t\tkind: \"endpoint\",\n\t\t\t\t\tname: endpoint.address,\n\t\t\t\t\turl: endpoint.url\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"unwatchable\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.address} has no watchable inputs.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"rebuild-failed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Rebuild failed: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"watch-error\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Watch error: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"converge-failed\": {\n\t\t\t\tconst child = lastChild();\n\t\t\t\tif (child !== void 0 && child.signal !== null) return;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Converge failed — the running app is untouched; still watching.\nGenerated stack file: ${event.stackFilePath}\\nRun \\`${event.reproduceCommand}\\` from ${event.cwd} to reproduce this directly.`\n\t\t\t\t});\n\t\t\t\treport({\n\t\t\t\t\tkind: \"remediation\",\n\t\t\t\t\taction: {\n\t\t\t\t\t\tkind: \"run-command\",\n\t\t\t\t\t\tlabel: `Run the converge directly from ${event.cwd} to reproduce this`,\n\t\t\t\t\t\tcommand: event.reproduceCommand,\n\t\t\t\t\t\treason: `Generated stack file: ${event.stackFilePath}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"stopping\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-started\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stop-error\":\n\t\t\t\tstopFailed = true;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `A service refused to stop: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stopped\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\",\n\t\t\t\t\toutcome: stopFailed ? \"warning\" : \"ok\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t}\n\t};\n}\nconst createDevCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit. Logs are a separate command; run `log <entry>` to tail them.\",\n\t\texamples: [\"{bin} dev src/service.ts\", \"{bin} dev src/service.ts --fresh\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tfresh: flag.boolean({ brief: \"Destroy the dev stack and wipe the dev state directory before starting.\" })\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\tconst result = await operations.dev({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\tfresh: args.flags.fresh,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: reportDevEvent(ctx.report, ctx.lastChild)\n\t\t}, {\n\t\t\talchemy: coalescedConverge(alchemy),\n\t\t\tconfigPath: ctx.config.configPath\n\t\t});\n\t\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\t\tawait stopRequested(ctx.signal);\n\t\tawait result.value.stop();\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/commands/log.ts\n/**\n* `log <entry> [address]` — a session command that tails the merged logs of\n* the app running locally on this machine.\n*\n* It reads the LOCAL dev-emulator daemon, not the platform's logs surface, so\n* it is credential-free. It hands the terminal to nothing, which is why it\n* does not declare `maySpawn` and keeps json support: the log lines ARE its\n* json surface.\n*\n* Windows is refused inside the operation itself (LOG.PLATFORM_UNSUPPORTED),\n* which is why nothing here reads the platform.\n*/\n/** An empty screen reads as broken, so show a little recent history before going live. */\nconst DEFAULT_TAIL = 20;\nconst createLogCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Tail the merged logs of the locally-running application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} log src/service.ts\", \"{bin} log src/service.ts catalog.service\"]\n\t},\n\targs: {\n\t\tpositionals: {\n\t\t\tentry: positional.string({\n\t\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\t\tplaceholder: \"entry\"\n\t\t\t}),\n\t\t\taddress: positional.optionalString({\n\t\t\t\tbrief: \"Only this service's lines, by its dotted address (catalog.service); every service when absent.\",\n\t\t\t\tplaceholder: \"address\"\n\t\t\t})\n\t\t},\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\ttail: flag.number({\n\t\t\t\tbrief: `How many trailing history lines to show before live output (default ${String(DEFAULT_TAIL)}).`,\n\t\t\t\tplaceholder: \"lines\",\n\t\t\t\tdefault: DEFAULT_TAIL\n\t\t\t})\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\thandler: async (args, ctx) => {\n\t\tconst reportLogEvent = (event) => {\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: event.kind === \"stream-failed\" ? `Stream failed: ${event.message}` : `Falling behind — dropped the ${String(event.count)} oldest lines.`\n\t\t\t});\n\t\t};\n\t\tconst result = await operations.log({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\taddress: args.positionals.address,\n\t\t\ttail: args.flags.tail ?? DEFAULT_TAIL,\n\t\t\tcwd: ctx.cwd,\n\t\t\tsignal: ctx.signal,\n\t\t\tonEvent: reportLogEvent\n\t\t}, { configPath: ctx.config.configPath });\n\t\tif (!result.ok) return notOk(toEngineError(result.failure));\n\t\tconst attached = result.value;\n\t\tif (attached.services.length === 0) {\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: `No running services for \"${attached.appName}\" — start it first with \\`dev ${args.positionals.entry}\\`.`\n\t\t\t});\n\t\t\treturn ok(void 0);\n\t\t}\n\t\tfor await (const { service, line } of attached.lines) ctx.report({\n\t\t\tkind: \"output\",\n\t\t\tsource: service,\n\t\t\tchannel: \"data\",\n\t\t\tline: `[${service}] ${line}`\n\t\t});\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/family.ts\n/**\n* Composer's `CommandFamily` — the unit the engine mounts, whether the process\n* is composer's own CLI or the `prisma` bin.\n*\n* This module and everything it reaches statically must stay free of alchemy\n* and of effect VALUE imports: the `prisma` bin imports the family directly,\n* so anything in this static graph loads on `prisma --version`. The mechanism\n* that holds it is the existing lazy boundary inside the operation modules —\n* `operations/deploy.ts`, `destroy.ts`, `dev.ts` and `log.ts` each `await\n* import()` their executor, and it is the executors that reach the provider\n* tree. Importing the operations here is therefore free; importing an\n* executor, or flattening one of those dynamic imports, is not.\n* scripts/check-family-static-graph.mjs enforces this against BUILT output,\n* where type-only imports have already been erased.\n*\n* The four commands close over the operations they are given, so a host can\n* mount this family against the test double and exercise real grammar, real\n* arg validation and real handlers with no alchemy behind them.\n*/\nconst realOperations = {\n\tdeploy: deployWithDeps,\n\tdestroy: destroyWithDeps,\n\tdev: devWithDeps,\n\tlog: logWithDeps\n};\nfunction createComposerFamily(options = {}) {\n\tconst operations = options.operations ?? realOperations;\n\treturn defineCommandFamily({\n\t\tconfigSection: composerSection,\n\t\tcommands: {\n\t\t\tdeploy: createDeployCommand(operations),\n\t\t\tdestroy: createDestroyCommand(operations),\n\t\t\tdev: createDevCommand(operations),\n\t\t\tlog: createLogCommand(operations)\n\t\t},\n\t\tdocsBaseUrl: DOCS_BASE\n\t});\n}\n//#endregion\n//#region src/family/runtime.ts\n/**\n* Everything environmental the engine needs, assembled from a host process.\n*\n* The engine takes no globals: streams, cwd, env, TTY-ness, exit and signal\n* subscription all arrive through `Runtime`, which is what lets a test drive a\n* whole run without touching `process`. Composing one is the substantive part\n* of hosting the engine — `createCli` and `Cli.run` are two calls.\n*\n* Credentials come from the engine's own environment-only manager, which\n* composes a session from PRISMA_SERVICE_TOKEN / PRISMA_WORKSPACE_ID and\n* refuses every mutation. That is the whole of composer's standalone auth\n* story: this CLI has no login flow and mounts no auth commands, so there is\n* nothing to store — the two variables ARE the credential.\n*/\n/** Where the management API lives. Matches the lowering client's default origin; the env var is the escape hatch for staging. */\nconst DEFAULT_MANAGEMENT_API_BASE_URL = \"https://api.prisma.io\";\nconst DEFAULT_AUTH_BASE_URL = \"https://auth.prisma.io\";\n/**\n* Starts the converge child: inherited stdio, this process's own group, no\n* `detached` and no new console — which is what lets the terminal deliver\n* Ctrl-C to the child natively instead of the CLI forwarding it. The engine\n* never imports node:child_process; this adapter is the whole of the host's\n* side of that seam.\n*/\nconst spawnChild = (request) => {\n\tconst child = spawn(request.command, [...request.args], {\n\t\tcwd: request.cwd,\n\t\tstdio: \"inherit\",\n\t\tenv: request.env\n\t});\n\treturn {\n\t\tended: new Promise((resolve, reject) => {\n\t\t\tchild.on(\"error\", reject);\n\t\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\t\tresolve({\n\t\t\t\t\texitCode,\n\t\t\t\t\tsignal\n\t\t\t\t});\n\t\t\t});\n\t\t}),\n\t\tkill: (signal) => {\n\t\t\tchild.kill(signal);\n\t\t}\n\t};\n};\n/**\n* The SDK's client construction config. The engine requires all four fields\n* whenever a credential manager is wired, but this host reaches none of the\n* login paths: an environment credential carries no refresh token, so nothing\n* ever refreshes and `clientId`/`redirectUri` are never read. They are\n* env-overridable rather than hard-coded so a staging run can point the whole\n* client somewhere else in one place.\n*/\nfunction clientConfig(env, apiBaseUrl) {\n\treturn {\n\t\tclientId: env[\"PRISMA_CLIENT_ID\"] ?? \"prisma-composer-cli\",\n\t\tredirectUri: env[\"PRISMA_REDIRECT_URI\"] ?? \"http://127.0.0.1/callback\",\n\t\tapiBaseUrl,\n\t\tauthBaseUrl: env[\"PRISMA_AUTH_URL\"] ?? DEFAULT_AUTH_BASE_URL\n\t};\n}\n/**\n* What this process runs on, for `ctx.host`. Bun and Deno both announce\n* themselves in `versions`; nothing else does, so an absent marker means Node.\n*/\nfunction describeHost(host) {\n\tconst name = [\"bun\", \"deno\"].find((candidate) => host.versions[candidate] !== void 0) ?? \"node\";\n\treturn {\n\t\truntime: {\n\t\t\tname,\n\t\t\tversion: host.versions[name] ?? host.version\n\t\t},\n\t\tplatform: host.platform,\n\t\tarch: host.arch\n\t};\n}\n/**\n* Which package manager invoked us, read from the `npm_config_user_agent`\n* every major manager sets (`pnpm/10.27.0 npm/? node/v24.16.0 darwin arm64`).\n* `undefined` when the CLI was run directly rather than through a manager — a\n* normal case, not a failure, so nothing is inferred from the filesystem, and\n* the engine falls back to its own detection from the project at cwd.\n*/\nfunction detectPackageManager(env) {\n\tconst agent = env[\"npm_config_user_agent\"];\n\tif (agent === void 0) return void 0;\n\tconst name = agent.split(\"/\")[0];\n\tswitch (name) {\n\t\tcase \"npm\":\n\t\tcase \"pnpm\":\n\t\tcase \"yarn\":\n\t\tcase \"bun\":\n\t\tcase \"deno\": return name;\n\t\tdefault: return;\n\t}\n}\n/**\n* The config loader arrives as a function rather than an already-loaded config\n* because the engine reads `prisma.config.ts` on demand — only when the command\n* it is about to run declares a config section, and with whatever file\n* `--config` named. A host that loaded the file up front would read it for runs\n* that never needed it, and would have nowhere to put `--config`.\n*\n* Nothing here answers \"is this CI\": the engine detects it from `env` itself,\n* and `isCIOverride` exists only for hosts where that detection cannot be\n* right — composer is not one.\n*/\nfunction createRuntime(host, loadConfig) {\n\tconst env = host.env;\n\tconst apiBaseUrl = env[\"PRISMA_MANAGEMENT_API_URL\"] ?? DEFAULT_MANAGEMENT_API_BASE_URL;\n\tconst packageManager = detectPackageManager(env);\n\treturn {\n\t\tstdout: host.stdout,\n\t\tstderr: host.stderr,\n\t\tstdin: host.stdin,\n\t\tcwd: host.cwd(),\n\t\tenv,\n\t\tisTty: {\n\t\t\tstdin: host.stdin.isTTY === true,\n\t\t\tstdout: host.stdout.isTTY === true,\n\t\t\tstderr: host.stderr.isTTY === true\n\t\t},\n\t\texit: (code) => host.exit(code),\n\t\tonSignal: (cb) => {\n\t\t\tconst onSigint = () => {\n\t\t\t\tcb(\"SIGINT\");\n\t\t\t};\n\t\t\tconst onSigterm = () => {\n\t\t\t\tcb(\"SIGTERM\");\n\t\t\t};\n\t\t\thost.on(\"SIGINT\", onSigint);\n\t\t\thost.on(\"SIGTERM\", onSigterm);\n\t\t\treturn () => {\n\t\t\t\thost.off(\"SIGINT\", onSigint);\n\t\t\t\thost.off(\"SIGTERM\", onSigterm);\n\t\t\t};\n\t\t},\n\t\tloadConfig,\n\t\tcredentialManager: new EnvironmentCredentialManager({ env }),\n\t\tmanagementApiClientConfig: clientConfig(env, apiBaseUrl),\n\t\tspawn: spawnChild,\n\t\tmanagementApi: { baseUrl: apiBaseUrl },\n\t\t...packageManager !== void 0 && { packageManager },\n\t\thost: describeHost(host)\n\t};\n}\n//#endregion\n//#region src/family/engine-cli.ts\n/**\n* Composer's own CLI, rebuilt as a thin composition of the family it\n* publishes: `createCli` over `createComposerFamily()`, `Cli.run` with a\n* Runtime. Grammar, help, arg validation, output framing, exit codes and\n* signal ownership all belong to the engine now — this module contributes the\n* family and the environment, and nothing else.\n*\n* Running composer's commands through the same path an external host uses is\n* the point: it is what proves the family works standalone before the `prisma`\n* bin mounts it.\n*\n* This IS composer's CLI. The clipanion shell it replaced, and the bespoke\n* runner that shelled out to alchemy, are gone; `bin.ts` is a call into here.\n*/\nconst BINARY_NAME = \"prisma-composer\";\n/**\n* Composer's commands mount at the top level of its own CLI (`prisma-composer\n* deploy`); under the `prisma` bin the same family mounts one level down\n* (`prisma composer deploy`). The family is identical either way — only the\n* mount paths differ, which is exactly the split `createCli` draws between\n* `commandFamilies` and `commands`.\n*/\nfunction mountedTree(family) {\n\treturn { ...family.commands };\n}\nfunction createComposerCli(spec) {\n\tconst family = createComposerFamily({ operations: spec.operations });\n\treturn createCli({\n\t\tname: BINARY_NAME,\n\t\tversion: spec.version,\n\t\tcommandFamilies: [family],\n\t\tgroups: {},\n\t\tcommands: mountedTree(family)\n\t});\n}\n/**\n* Composes the Runtime and runs one invocation. Returns the exit code rather\n* than exiting, so the caller owns the process — a bin assigns it to\n* `process.exitCode` and lets the streams drain, as composer's CLI has always\n* done.\n*\n* `prisma.config.ts` is not read here. The loader goes in as a function, and the\n* engine calls it only when the command it is about to run declares a config\n* section, passing it the file `--config` named; the loader resolves that\n* against the host's cwd.\n*/\nfunction runComposerCli(argv, host, spec, hooks) {\n\tconst runtime = createRuntime(host, (configPath) => loadConfig(host.cwd(), configPath));\n\treturn createComposerCli(spec).run(argv, runtime, hooks);\n}\n//#endregion\nexport { realOperations as a, createComposerFamily as i, createComposerCli as n, composerSection as o, runComposerCli as r, toEngineError as s, BINARY_NAME as t };\n\n//# sourceMappingURL=engine-cli-CaEeyz5M.mjs.map"],"mappings":";;;;;;;;;;AASA,eAAe,eAAe,OAAO,MAAM;CAC1C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,UAAU,OAAO,GAAG,CAAC;CACvD;CACA,OAAO,SAAS,cAAc,OAAO,MAAM,GAAG;AAC/C;;;;AASA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,WAAW,OAAO,GAAG,CAAC;CACxD;CACA,OAAO,SAAS,eAAe,OAAO,MAAM,GAAG;AAChD;;;;AASA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,OAAO,OAAO,GAAG,CAAC;CACpD;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;;;;AASA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,OAAO,OAAO,GAAG,CAAC;CACpD;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;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AC5B,aAAa;IACZ,KAAK,IAAI,UAAU,QAAQ;IAC3B,KAAK,IAAI,WAAW,SAAS;GAC9B;EACD;EACA;EACA,mBAAmB,IAAI,6BAA6B,EAAE,IAAI,CAAC;EAC3D,2BAA2B,aAAa,KAAK,UAAU;EACvD,OAAO;EACP,eAAe,EAAE,SAAS,WAAW;EACrC,GAAG,mBAAmB,KAAK,KAAK,EAAE,eAAe;EACjD,MAAM,aAAa,IAAI;CACxB;AACD;;;;;;;;;;;;;;;AAiBA,MAAM,cAAc;;;;;;;;AAQpB,SAAS,YAAY,QAAQ;CAC5B,OAAO,EAAE,GAAG,OAAO,SAAS;AAC7B;AACA,SAAS,kBAAkB,MAAM;CAChC,MAAM,SAAS,qBAAqB,EAAE,YAAY,KAAK,WAAW,CAAC;CACnE,OAAO,UAAU;EAChB,MAAM;EACN,SAAS,KAAK;EACd,iBAAiB,CAAC,MAAM;EACxB,QAAQ,CAAC;EACT,UAAU,YAAY,MAAM;CAC7B,CAAC;AACF;;;;;;;;;;;;AAYA,SAAS,eAAe,MAAM,MAAM,MAAM,OAAO;CAChD,MAAM,UAAU,cAAc,OAAO,eAAe,WAAW,KAAK,IAAI,GAAG,UAAU,CAAC;CACtF,OAAO,kBAAkB,IAAI,CAAC,CAAC,IAAI,MAAM,SAAS,KAAK;AACxD"}
|
|
1
|
+
{"version":3,"file":"family.mjs","names":["notOk","CliStructuredError$1"],"sources":["../../../0-framework/3-tooling/cli/dist/log-1EohuWIZ.mjs","../../../0-framework/3-tooling/cli/dist/engine-cli-zWLMCCrQ.mjs"],"sourcesContent":["import { n as executorLoadFailure } from \"./shared-BTnATsqm.mjs\";\nimport { notOk } from \"@internal/foundation/result\";\n//#region src/operations/deploy.ts\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-Bk5vwMOf.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error, cwd));\n\t}\n\treturn executor.executeDeploy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/destroy.ts\nasync function destroy(input) {\n\treturn destroyWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function destroyWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-Bk5vwMOf.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"destroy\", error, cwd));\n\t}\n\treturn executor.executeDestroy(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's RunDeps, unit\n* tests). Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-CM2xQ_pz.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error, cwd));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/log.ts\nasync function log(input) {\n\treturn logWithDeps(input, {});\n}\n/** In-package variant threading the injection seam (the CLI's LogRunDeps,\n* unit tests). Deliberately NOT re-exported through `./control` — the seam\n* mirrors internal types and is not part of the published surface. */\nasync function logWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-log-CUbn7f2_.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"log\", error, cwd));\n\t}\n\treturn executor.executeLog(input, deps, cwd);\n}\n//#endregion\nexport { destroy as a, deployWithDeps as c, devWithDeps as i, logWithDeps as n, destroyWithDeps as o, dev as r, deploy as s, log as t };\n\n//# sourceMappingURL=log-1EohuWIZ.mjs.map","import { t as executionDiagnostics } from \"./shared-BTnATsqm.mjs\";\nimport { c as deployWithDeps, i as devWithDeps, n as logWithDeps, o as destroyWithDeps } from \"./log-1EohuWIZ.mjs\";\nimport { t as alchemyCommandLine } from \"./run-alchemy-D44OZlyB.mjs\";\nimport { DOCS_BASE } from \"@internal/foundation/errors\";\nimport { EnvironmentCredentialManager, createCli, defineCommand, defineCommandFamily, defineConfigSection, defineSessionCommand, exitWithChildStatus, flag, loadConfig, positional } from \"@prisma/cli-engine\";\nimport { CliStructuredError as CliStructuredError$1, notOk, ok } from \"@prisma/cli-engine/protocol\";\nimport { spawn } from \"node:child_process\";\n//#region src/family/translate-error.ts\n/**\n* The family boundary's error translation.\n*\n* Composer and the engine each carry a class called `CliStructuredError`, both\n* descended from the same prisma/prisma foundation, and both recognize errors\n* by duck-typing on `name === 'CliStructuredError'`. That means a composer\n* error handed to the engine untranslated is ACCEPTED — it does not fail\n* loudly, it renders. What it loses is its `fix`: composer's foundation\n* carries remediation as one prose string on that field, the engine carries it\n* as a `nextActions` list and has no `fix` at all, so the fix text is dropped\n* silently and the user is told what broke with no word on what to do about\n* it. Nothing about that failure is visible without a test that looks for the\n* fix on the other side, which is why there is one.\n*\n* Everything else on the envelope survives as-is; only remediation changes\n* representation.\n*/\n/**\n* Composer's `fix` is free prose — \"add this overrides block and reinstall\",\n* \"run the build, then retry\" — with no machine-readable command inside it.\n* `user-choice` is the engine's own kind for exactly that (it is what the\n* engine uses for its own config and prompt failures), so the text carries\n* over verbatim as one action rather than being parsed into a command the\n* author never wrote.\n*/\nfunction fixAsNextActions(fix) {\n\treturn fix === void 0 ? [] : [{\n\t\tkind: \"user-choice\",\n\t\tlabel: fix\n\t}];\n}\n/** Translates a composer failure into the engine's error type. Composer-side detail — `meta`, `where`, `docsUrl` — rides along untouched. */\nfunction toEngineError(error) {\n\treturn new CliStructuredError$1(error.code, error.message, {\n\t\tseverity: error.severity,\n\t\tnextActions: fixAsNextActions(error.fix),\n\t\t...error.why === void 0 ? {} : { why: error.why },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: error.meta },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl },\n\t\tcause: error\n\t});\n}\n//#endregion\n//#region src/family/converge.ts\n/** The adapter the operations call, backed by the engine's `ctx.spawn` so the\n* terminal reaches alchemy natively and the engine owns signal policy. */\nfunction convergeSpawn(ctx) {\n\treturn async (invocation) => {\n\t\tconst line = alchemyCommandLine(invocation);\n\t\treturn await ctx.spawn({\n\t\t\tcommand: line.command,\n\t\t\targs: line.args,\n\t\t\tcwd: line.cwd,\n\t\t\tenv: line.env\n\t\t});\n\t};\n}\n/** The in-process leg's deps: composer's existing seam, carrying the engine's\n* own client and workspace id rather than anything read from the env. */\nfunction operationDeps(spec) {\n\treturn {\n\t\talchemy: spec.alchemy,\n\t\tconfigPath: spec.configPath,\n\t\tcredentials: {\n\t\t\tworkspaceId: spec.workspaceId,\n\t\t\tclient: spec.client\n\t\t}\n\t};\n}\n/**\n* The reproduce hint a failed converge carries. Deliberately absent for an\n* aborted one: the user stopped it, so there is nothing to reproduce.\n*/\nfunction reproduceHint(failure) {\n\tconst diagnostics = executionDiagnostics(failure);\n\tif (diagnostics === void 0) return [];\n\treturn [{\n\t\tkind: \"run-command\",\n\t\tlabel: `Run the converge directly from ${diagnostics.cwd} to reproduce this`,\n\t\tcommand: diagnostics.reproduceCommand,\n\t\treason: `Generated stack file: ${diagnostics.stackFilePath}`\n\t}];\n}\n/**\n* How a FAILED converge settles. `deploy`, `destroy` and `dev` all end this\n* way and must not drift apart, so the decision lives here once rather than\n* inline in each handler.\n*\n* A failure that reached the child exits with the child's status verbatim and\n* carries the reproduce hint; a failure that never reached the child is an\n* ordinary structured error and gets the normal envelope. Nothing here reads\n* `signal` — see settleConverge.\n*/\nfunction settleConvergeFailure(failure, ctx) {\n\tconst child = ctx.lastChild();\n\tif (child !== void 0 && child.exitCode !== 0) return ok(exitWithChildStatus({ nextActions: reproduceHint(failure) }));\n\treturn notOk(toEngineError(failure));\n}\n/**\n* How a converge settles, now that the engine owns the child's status.\n*\n* Nothing here reads `signal`. `exitWithChildStatus` settles from the engine's\n* own record of the child, and a signal-killed one overrules whatever this\n* function asked for: 128 + the signal, no failure envelope, and the reproduce\n* hint dropped, because the user stopped the run and there is nothing to\n* reproduce.\n*\n* What is left is the operation's own verdict. A failure that reached the\n* child exits with the child's status verbatim and carries the reproduce hint;\n* a failure that never reached the child is an ordinary structured error and\n* gets the normal envelope.\n*\n* A SUCCESS presents its result even when the child was signal-killed. No\n* composer operation produces that pair today — each one reports a\n* signal-killed converge as a failure — and an operation that ever did would\n* have a real result worth showing. The run still exits 130, because the\n* engine settles a signal-terminated run from its own record of the signal\n* whatever the handler returns.\n*/\nfunction settleConverge(result, ctx, present) {\n\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\treturn ok(present(result.value));\n}\n//#endregion\n//#region src/family/section.ts\n/**\n* Composer's projection into `prisma.config.ts` — the `composer` section.\n*\n* The section is deliberately tiny. Composer's real configuration lives in\n* `prisma-composer.config.ts`, which holds executable values (Effect layers,\n* provider factories, container lifecycles) and can only be understood by\n* evaluating it inside a running command. A config-section validator loads\n* with the command tree at start-up and must be dependency-light and total,\n* so it is the wrong place to evaluate any of that. What the section carries\n* is therefore only the one fact the engine can usefully know before a\n* command runs: WHERE that file is, when the user wants to say so.\n*\n* Its fields grow only by amending the slice contract.\n*/\nconst KNOWN_FIELDS = [\"configPath\"];\nfunction diagnostic(spec) {\n\treturn {\n\t\tcode: spec.code,\n\t\tseverity: spec.severity,\n\t\tsummary: spec.summary,\n\t\t...spec.why === void 0 ? {} : { why: spec.why },\n\t\tnextActions: spec.fix === void 0 ? [] : [{\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: spec.fix\n\t\t}]\n\t};\n}\nfunction validate(raw) {\n\tif (raw === void 0) return {\n\t\tok: true,\n\t\tvalue: {},\n\t\tdiagnostics: []\n\t};\n\tif (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) return {\n\t\tok: false,\n\t\tdiagnostics: [diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tseverity: \"error\",\n\t\t\tsummary: \"The `composer` section of prisma.config.ts must be an object.\",\n\t\t\tfix: \"Write `composer: { configPath: \\\"./prisma-composer.config.ts\\\" }`, or remove the section entirely.\"\n\t\t})]\n\t};\n\tlet record;\n\ttry {\n\t\trecord = { ...raw };\n\t} catch {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tdiagnostics: [diagnostic({\n\t\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\t\tseverity: \"error\",\n\t\t\t\tsummary: \"The `composer` section of prisma.config.ts could not be read.\",\n\t\t\t\twhy: \"Reading its fields threw, so nothing in it can be trusted.\",\n\t\t\t\tfix: \"Write it as a plain object literal, e.g. `composer: { configPath: \\\"./prisma-composer.config.ts\\\" }`.\"\n\t\t\t})]\n\t\t};\n\t}\n\tconst configPath = record[\"configPath\"];\n\tif (configPath !== void 0 && (typeof configPath !== \"string\" || configPath.length === 0)) return {\n\t\tok: false,\n\t\tdiagnostics: [diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_INVALID\",\n\t\t\tseverity: \"error\",\n\t\t\tsummary: \"`composer.configPath` must be a non-empty string.\",\n\t\t\twhy: \"It names the prisma-composer.config.ts file to load.\",\n\t\t\tfix: \"Set it to a path, or remove it to search upward from the entry.\"\n\t\t})]\n\t};\n\tconst unknown = Object.keys(record).filter((key) => !KNOWN_FIELDS.includes(key));\n\treturn {\n\t\tok: true,\n\t\tvalue: configPath === void 0 ? {} : { configPath },\n\t\tdiagnostics: unknown.map((key) => diagnostic({\n\t\t\tcode: \"CONFIG.FIELD_UNKNOWN\",\n\t\t\tseverity: \"warn\",\n\t\t\tsummary: `The \\`composer\\` section has no field \\`${key}\\`; it is ignored.`,\n\t\t\tfix: `Remove \\`${key}\\`, or check it against the version of @prisma/composer you have installed.`\n\t\t}))\n\t};\n}\nconst composerSection = defineConfigSection({\n\tname: \"composer\",\n\tvalidate\n});\n//#endregion\n//#region src/family/workspace.ts\n/**\n* The workspace the in-process leg acts in, from the engine's credential\n* read. Handlers never decode a token and never read PRISMA_WORKSPACE_ID:\n* whether the credential came from a stored session or the environment, the\n* engine has already resolved it, and branching on where it came from is a\n* defect by the credential-manager design.\n*\n* Undefined when the active credential names no workspace — an environment\n* token whose claims carry none. The container descriptors raise their own\n* \"workspace required\" error in that case, which is the error the user needs.\n*/\nasync function workspaceIdOf(ctx) {\n\treturn (await ctx.activeCredential())?.workspaceId;\n}\n//#endregion\n//#region src/family/commands/deploy.ts\n/**\n* `deploy <entry>` — a result command that hands the terminal to alchemy.\n*\n* `--production` is gone. It was accepted and then always errored (\"only\n* valid with destroy\"), so no invocation using it could ever have succeeded;\n* deploy targets production by default when no `--stage` is given.\n*/\nconst createDeployCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Deploy the application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} deploy src/service.ts\", \"{bin} deploy src/service.ts --stage feat-auth\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the deploy's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Deploy scope to target; omit for production.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\treport: flag.string({\n\t\t\t\tbrief: \"Write the deploy's outcome as JSON to this path — resources, preview URLs, and the failure cause. Also settable as PRISMA_COMPOSER_REPORT_FILE.\",\n\t\t\t\tplaceholder: \"path\"\n\t\t\t}),\n\t\t\tbuildId: flag.string({\n\t\t\t\tbrief: \"Join the deploy record your CI already created rather than letting the target create one. Each target also reads its own environment variable for this; the flag wins.\",\n\t\t\t\tplaceholder: \"id\"\n\t\t\t})\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.deploy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\tstage: args.flags.stage,\n\t\t\tcwd: ctx.cwd,\n\t\t\treportPath: args.flags.report,\n\t\t\treportId: args.flags.buildId\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tconfigPath: ctx.config.configPath,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, ({ summary }) => ctx.present({ data: { summary: summary ?? null } }, {\n\t\t\thuman: (ui) => summary === void 0 ? [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Deployed.\"\n\t\t\t}] : [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: `Deployed ${ui.emphasize(summary.app)}.`\n\t\t\t}, {\n\t\t\t\tkind: \"table\",\n\t\t\t\tcolumns: [\"Address\", \"Deployed\"],\n\t\t\t\trows: summary.nodes.map((node) => [node.address, node.entities.map((entity) => `${entity.kind} ${entity.id}`).join(\", \")])\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => ({ summary: summary ?? null }),\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/target.ts\n/**\n* `destroy`'s target, from its two mutually exclusive flags. Kept out of the\n* grammar because the engine's flag layer has no \"exactly one of these\"\n* construct — and because both wrong shapes need their own remedy, which a\n* generic arity error could not give.\n*/\nfunction targetOf(stage, production) {\n\tif (stage !== void 0 && production) return notOk(new CliStructuredError$1(\"DEPLOY.TARGET_CONFLICT\", \"Pass either --stage <name> or --production to `destroy`, not both.\"));\n\tif (stage === void 0 && !production) return notOk(new CliStructuredError$1(\"DEPLOY.TARGET_MISSING\", \"`destroy` requires an explicit target.\", { nextActions: [{\n\t\tkind: \"user-choice\",\n\t\tlabel: \"Pass --stage <name> to tear down a branch environment, or --production to tear down the production environment.\"\n\t}] }));\n\treturn ok(stage !== void 0 ? {\n\t\tkind: \"stage\",\n\t\tstage\n\t} : { kind: \"production\" });\n}\n//#endregion\n//#region src/family/commands/destroy.ts\n/**\n* `destroy <entry>` — deploy's mirror: same derivation, alchemy destroy.\n*\n* No confirmation prompt, matching the CLI this replaces. The front door\n* cannot know what the child will tear down, so a consent step here would be\n* asking the user to approve a list nobody has computed yet; if destroy\n* deserves one it belongs in composer's own operation, not in the grammar.\n*/\nconst createDestroyCommand = (operations) => defineCommand({\n\thelp: {\n\t\tsummary: \"Tear down the application whose root node is <entry>'s default export.\",\n\t\tdescription: \"Same derivation as deploy. Requires an explicit target: --stage <name> for a branch environment, or --production for the production environment.\",\n\t\texamples: [\"{bin} destroy src/service.ts --stage feat-auth\", \"{bin} destroy src/service.ts --production\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the application name to tear down.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tstage: flag.string({\n\t\t\t\tbrief: \"Tear down this branch environment.\",\n\t\t\t\tplaceholder: \"stage\"\n\t\t\t}),\n\t\t\tproduction: flag.boolean({ brief: \"Tear down the project-level production environment.\" })\n\t\t}\n\t},\n\tneeds: {\n\t\tconfig: composerSection,\n\t\tcredentials: \"child\"\n\t},\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst target = targetOf(args.flags.stage, args.flags.production);\n\t\tif (!target.ok) return target;\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\treturn settleConverge(await operations.destroy({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\ttarget: target.value,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: (event) => {\n\t\t\t\tif (event.kind !== \"no-local-deploy-state\") return;\n\t\t\t\tctx.report({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `No prior deploy state under ${event.cwd} — if you deployed from a different directory, run destroy from there; otherwise this is a no-op.`\n\t\t\t\t});\n\t\t\t}\n\t\t}, operationDeps({\n\t\t\talchemy,\n\t\t\tconfigPath: ctx.config.configPath,\n\t\t\tworkspaceId: await workspaceIdOf(ctx),\n\t\t\tclient: ctx.api\n\t\t})), ctx, () => ctx.present({ data: void 0 }, {\n\t\t\thuman: () => [{\n\t\t\t\tkind: \"summary\",\n\t\t\t\tstatus: \"ok\",\n\t\t\t\ttext: \"Destroyed.\"\n\t\t\t}],\n\t\t\tstdout: () => [],\n\t\t\tjson: () => void 0,\n\t\t\tnext: () => []\n\t\t}));\n\t}\n});\n//#endregion\n//#region src/family/commands/dev.ts\nconst STOP_STEP = \"Stopping the app's services — emulators and data stay up\";\n/** Resolves when the run is asked to stop. */\nfunction stopRequested(signal) {\n\tif (signal.aborted) return Promise.resolve();\n\treturn new Promise((resolve) => {\n\t\tsignal.addEventListener(\"abort\", () => resolve(), { once: true });\n\t});\n}\n/**\n* One converge at a time. `ctx.spawn` refuses a second live child, and the\n* watch loop can well fire a rebuild while the previous converge is still\n* running — so a request that arrives during a live converge joins the single\n* queued follow-up instead of starting its own. That extends the coalescing\n* the watcher already does across a burst of edits to cover the converge\n* itself, and it is sound because every dev converge is the SAME invocation:\n* one stack file at one fixed path, rewritten in place before each request.\n*/\nfunction coalescedConverge(run) {\n\tlet live;\n\tlet queued;\n\tconst start = (invocation) => {\n\t\tconst outcome = run(invocation);\n\t\tconst settled = outcome.then(() => void 0, () => void 0);\n\t\tlive = settled;\n\t\tsettled.then(() => {\n\t\t\tif (live === settled) live = void 0;\n\t\t});\n\t\treturn outcome;\n\t};\n\treturn (invocation) => {\n\t\tconst running = live;\n\t\tif (running === void 0) return start(invocation);\n\t\tqueued ??= running.then(() => {\n\t\t\tqueued = void 0;\n\t\t\treturn start(invocation);\n\t\t});\n\t\treturn queued;\n\t};\n}\n/** The front door, ordered by address depth (fewest dots first) then lexicographically. */\nfunction frontDoorOrder(endpoints) {\n\treturn [...endpoints].sort((a, b) => {\n\t\tconst depth = a.address.split(\".\").length - b.address.split(\".\").length;\n\t\tif (depth !== 0) return depth;\n\t\treturn a.address < b.address ? -1 : a.address > b.address ? 1 : 0;\n\t});\n}\n/**\n* The operation's events as engine events. The legacy `[dev]` console prefix\n* is gone: these are commentary the engine renders and frames.\n*/\nfunction reportDevEvent(report, lastChild) {\n\tlet stopFailed = false;\n\treturn (event) => {\n\t\tswitch (event.kind) {\n\t\t\tcase \"ready\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"status\",\n\t\t\t\t\tsubject: \"dev\",\n\t\t\t\t\tstatus: \"ready\"\n\t\t\t\t});\n\t\t\t\tfor (const endpoint of frontDoorOrder(event.endpoints)) report({\n\t\t\t\t\tkind: \"endpoint\",\n\t\t\t\t\tname: endpoint.address,\n\t\t\t\t\turl: endpoint.url\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"unwatchable\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `${event.address} has no watchable inputs.`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"rebuild-failed\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Rebuild failed: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"watch-error\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Watch error: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"converge-failed\": {\n\t\t\t\tconst child = lastChild();\n\t\t\t\tif (child !== void 0 && child.signal !== null) return;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `Converge failed — the running app is untouched; still watching.\nGenerated stack file: ${event.stackFilePath}\\nRun \\`${event.reproduceCommand}\\` from ${event.cwd} to reproduce this directly.`\n\t\t\t\t});\n\t\t\t\treport({\n\t\t\t\t\tkind: \"remediation\",\n\t\t\t\t\taction: {\n\t\t\t\t\t\tkind: \"run-command\",\n\t\t\t\t\t\tlabel: `Run the converge directly from ${event.cwd} to reproduce this`,\n\t\t\t\t\t\tcommand: event.reproduceCommand,\n\t\t\t\t\t\treason: `Generated stack file: ${event.stackFilePath}`\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase \"stopping\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-started\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stop-error\":\n\t\t\t\tstopFailed = true;\n\t\t\t\treport({\n\t\t\t\t\tkind: \"message\",\n\t\t\t\t\tseverity: \"warn\",\n\t\t\t\t\ttext: `A service refused to stop: ${event.message}`\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tcase \"stopped\":\n\t\t\t\treport({\n\t\t\t\t\tkind: \"step-finished\",\n\t\t\t\t\tstep: STOP_STEP,\n\t\t\t\t\tid: \"dev-stop\",\n\t\t\t\t\toutcome: stopFailed ? \"warning\" : \"ok\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t}\n\t};\n}\nconst createDevCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Bring up the application whose root node is <entry>'s default export, entirely on this machine.\",\n\t\tdescription: \"Runs credential-free and watches the app for changes, reconverging on every edit. Logs are a separate command; run `log <entry>` to tail them.\",\n\t\texamples: [\"{bin} dev src/service.ts\", \"{bin} dev src/service.ts --fresh\"]\n\t},\n\targs: {\n\t\tpositionals: { entry: positional.string({\n\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\tplaceholder: \"entry\"\n\t\t}) },\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\tfresh: flag.boolean({ brief: \"Destroy the dev stack and wipe the dev state directory before starting.\" })\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\tmaySpawn: true,\n\thandler: async (args, ctx) => {\n\t\tconst alchemy = convergeSpawn(ctx);\n\t\tconst result = await operations.dev({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\tfresh: args.flags.fresh,\n\t\t\tcwd: ctx.cwd,\n\t\t\tonEvent: reportDevEvent(ctx.report, ctx.lastChild)\n\t\t}, {\n\t\t\talchemy: coalescedConverge(alchemy),\n\t\t\tconfigPath: ctx.config.configPath\n\t\t});\n\t\tif (!result.ok) return settleConvergeFailure(result.failure, ctx);\n\t\tawait stopRequested(ctx.signal);\n\t\tawait result.value.stop();\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/commands/log.ts\n/**\n* `log <entry> [address]` — a session command that tails the merged logs of\n* the app running locally on this machine.\n*\n* It reads the LOCAL dev-emulator daemon, not the platform's logs surface, so\n* it is credential-free. It hands the terminal to nothing, which is why it\n* does not declare `maySpawn` and keeps json support: the log lines ARE its\n* json surface.\n*\n* Windows is refused inside the operation itself (LOG.PLATFORM_UNSUPPORTED),\n* which is why nothing here reads the platform.\n*/\n/** An empty screen reads as broken, so show a little recent history before going live. */\nconst DEFAULT_TAIL = 20;\nconst createLogCommand = (operations) => defineSessionCommand({\n\thelp: {\n\t\tsummary: \"Tail the merged logs of the locally-running application whose root node is <entry>'s default export.\",\n\t\texamples: [\"{bin} log src/service.ts\", \"{bin} log src/service.ts catalog.service\"]\n\t},\n\targs: {\n\t\tpositionals: {\n\t\t\tentry: positional.string({\n\t\t\t\tbrief: \"The module whose default export is the application root.\",\n\t\t\t\tplaceholder: \"entry\"\n\t\t\t}),\n\t\t\taddress: positional.optionalString({\n\t\t\t\tbrief: \"Only this service's lines, by its dotted address (catalog.service); every service when absent.\",\n\t\t\t\tplaceholder: \"address\"\n\t\t\t})\n\t\t},\n\t\tflags: {\n\t\t\tname: flag.string({\n\t\t\t\tbrief: \"Override the root node's name — the dev instance's application name.\",\n\t\t\t\tplaceholder: \"name\"\n\t\t\t}),\n\t\t\ttail: flag.number({\n\t\t\t\tbrief: `How many trailing history lines to show before live output (default ${String(DEFAULT_TAIL)}).`,\n\t\t\t\tplaceholder: \"lines\",\n\t\t\t\tdefault: DEFAULT_TAIL\n\t\t\t})\n\t\t}\n\t},\n\tneeds: { config: composerSection },\n\thandler: async (args, ctx) => {\n\t\tconst reportLogEvent = (event) => {\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: event.kind === \"stream-failed\" ? `Stream failed: ${event.message}` : `Falling behind — dropped the ${String(event.count)} oldest lines.`\n\t\t\t});\n\t\t};\n\t\tconst result = await operations.log({\n\t\t\tentry: args.positionals.entry,\n\t\t\tname: args.flags.name,\n\t\t\taddress: args.positionals.address,\n\t\t\ttail: args.flags.tail ?? DEFAULT_TAIL,\n\t\t\tcwd: ctx.cwd,\n\t\t\tsignal: ctx.signal,\n\t\t\tonEvent: reportLogEvent\n\t\t}, { configPath: ctx.config.configPath });\n\t\tif (!result.ok) return notOk(toEngineError(result.failure));\n\t\tconst attached = result.value;\n\t\tif (attached.services.length === 0) {\n\t\t\tctx.report({\n\t\t\t\tkind: \"message\",\n\t\t\t\tseverity: \"warn\",\n\t\t\t\ttext: `No running services for \"${attached.appName}\" — start it first with \\`dev ${args.positionals.entry}\\`.`\n\t\t\t});\n\t\t\treturn ok(void 0);\n\t\t}\n\t\tfor await (const { service, line } of attached.lines) ctx.report({\n\t\t\tkind: \"output\",\n\t\t\tsource: service,\n\t\t\tchannel: \"data\",\n\t\t\tline: `[${service}] ${line}`\n\t\t});\n\t\treturn ok(void 0);\n\t}\n});\n//#endregion\n//#region src/family/family.ts\n/**\n* Composer's `CommandFamily` — the unit the engine mounts, whether the process\n* is composer's own CLI or the `prisma` bin.\n*\n* This module and everything it reaches statically must stay free of alchemy\n* and of effect VALUE imports: the `prisma` bin imports the family directly,\n* so anything in this static graph loads on `prisma --version`. The mechanism\n* that holds it is the existing lazy boundary inside the operation modules —\n* `operations/deploy.ts`, `destroy.ts`, `dev.ts` and `log.ts` each `await\n* import()` their executor, and it is the executors that reach the provider\n* tree. Importing the operations here is therefore free; importing an\n* executor, or flattening one of those dynamic imports, is not.\n* scripts/check-family-static-graph.mjs enforces this against BUILT output,\n* where type-only imports have already been erased.\n*\n* The four commands close over the operations they are given, so a host can\n* mount this family against the test double and exercise real grammar, real\n* arg validation and real handlers with no alchemy behind them.\n*/\nconst realOperations = {\n\tdeploy: deployWithDeps,\n\tdestroy: destroyWithDeps,\n\tdev: devWithDeps,\n\tlog: logWithDeps\n};\nfunction createComposerFamily(options = {}) {\n\tconst operations = options.operations ?? realOperations;\n\treturn defineCommandFamily({\n\t\tconfigSection: composerSection,\n\t\tcommands: {\n\t\t\tdeploy: createDeployCommand(operations),\n\t\t\tdestroy: createDestroyCommand(operations),\n\t\t\tdev: createDevCommand(operations),\n\t\t\tlog: createLogCommand(operations)\n\t\t},\n\t\tdocsBaseUrl: DOCS_BASE\n\t});\n}\n//#endregion\n//#region src/family/runtime.ts\n/**\n* Everything environmental the engine needs, assembled from a host process.\n*\n* The engine takes no globals: streams, cwd, env, TTY-ness, exit and signal\n* subscription all arrive through `Runtime`, which is what lets a test drive a\n* whole run without touching `process`. Composing one is the substantive part\n* of hosting the engine — `createCli` and `Cli.run` are two calls.\n*\n* Credentials come from the engine's own environment-only manager, which\n* composes a session from PRISMA_SERVICE_TOKEN / PRISMA_WORKSPACE_ID and\n* refuses every mutation. That is the whole of composer's standalone auth\n* story: this CLI has no login flow and mounts no auth commands, so there is\n* nothing to store — the two variables ARE the credential.\n*/\n/** Where the management API lives. Matches the lowering client's default origin; the env var is the escape hatch for staging. */\nconst DEFAULT_MANAGEMENT_API_BASE_URL = \"https://api.prisma.io\";\nconst DEFAULT_AUTH_BASE_URL = \"https://auth.prisma.io\";\n/**\n* Starts the converge child: inherited stdio, this process's own group, no\n* `detached` and no new console — which is what lets the terminal deliver\n* Ctrl-C to the child natively instead of the CLI forwarding it. The engine\n* never imports node:child_process; this adapter is the whole of the host's\n* side of that seam.\n*/\nconst spawnChild = (request) => {\n\tconst child = spawn(request.command, [...request.args], {\n\t\tcwd: request.cwd,\n\t\tstdio: \"inherit\",\n\t\tenv: request.env\n\t});\n\treturn {\n\t\tended: new Promise((resolve, reject) => {\n\t\t\tchild.on(\"error\", reject);\n\t\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\t\tresolve({\n\t\t\t\t\texitCode,\n\t\t\t\t\tsignal\n\t\t\t\t});\n\t\t\t});\n\t\t}),\n\t\tkill: (signal) => {\n\t\t\tchild.kill(signal);\n\t\t}\n\t};\n};\n/**\n* The SDK's client construction config. The engine requires all four fields\n* whenever a credential manager is wired, but this host reaches none of the\n* login paths: an environment credential carries no refresh token, so nothing\n* ever refreshes and `clientId`/`redirectUri` are never read. They are\n* env-overridable rather than hard-coded so a staging run can point the whole\n* client somewhere else in one place.\n*/\nfunction clientConfig(env, apiBaseUrl) {\n\treturn {\n\t\tclientId: env[\"PRISMA_CLIENT_ID\"] ?? \"prisma-composer-cli\",\n\t\tredirectUri: env[\"PRISMA_REDIRECT_URI\"] ?? \"http://127.0.0.1/callback\",\n\t\tapiBaseUrl,\n\t\tauthBaseUrl: env[\"PRISMA_AUTH_URL\"] ?? DEFAULT_AUTH_BASE_URL\n\t};\n}\n/**\n* What this process runs on, for `ctx.host`. Bun and Deno both announce\n* themselves in `versions`; nothing else does, so an absent marker means Node.\n*/\nfunction describeHost(host) {\n\tconst name = [\"bun\", \"deno\"].find((candidate) => host.versions[candidate] !== void 0) ?? \"node\";\n\treturn {\n\t\truntime: {\n\t\t\tname,\n\t\t\tversion: host.versions[name] ?? host.version\n\t\t},\n\t\tplatform: host.platform,\n\t\tarch: host.arch\n\t};\n}\n/**\n* Which package manager invoked us, read from the `npm_config_user_agent`\n* every major manager sets (`pnpm/10.27.0 npm/? node/v24.16.0 darwin arm64`).\n* `undefined` when the CLI was run directly rather than through a manager — a\n* normal case, not a failure, so nothing is inferred from the filesystem, and\n* the engine falls back to its own detection from the project at cwd.\n*/\nfunction detectPackageManager(env) {\n\tconst agent = env[\"npm_config_user_agent\"];\n\tif (agent === void 0) return void 0;\n\tconst name = agent.split(\"/\")[0];\n\tswitch (name) {\n\t\tcase \"npm\":\n\t\tcase \"pnpm\":\n\t\tcase \"yarn\":\n\t\tcase \"bun\":\n\t\tcase \"deno\": return name;\n\t\tdefault: return;\n\t}\n}\n/**\n* The config loader arrives as a function rather than an already-loaded config\n* because the engine reads `prisma.config.ts` on demand — only when the command\n* it is about to run declares a config section, and with whatever file\n* `--config` named. A host that loaded the file up front would read it for runs\n* that never needed it, and would have nowhere to put `--config`.\n*\n* Nothing here answers \"is this CI\": the engine detects it from `env` itself,\n* and `isCIOverride` exists only for hosts where that detection cannot be\n* right — composer is not one.\n*/\nfunction createRuntime(host, loadConfig) {\n\tconst env = host.env;\n\tconst apiBaseUrl = env[\"PRISMA_MANAGEMENT_API_URL\"] ?? DEFAULT_MANAGEMENT_API_BASE_URL;\n\tconst packageManager = detectPackageManager(env);\n\treturn {\n\t\tstdout: host.stdout,\n\t\tstderr: host.stderr,\n\t\tstdin: host.stdin,\n\t\tcwd: host.cwd(),\n\t\tenv,\n\t\tisTty: {\n\t\t\tstdin: host.stdin.isTTY === true,\n\t\t\tstdout: host.stdout.isTTY === true,\n\t\t\tstderr: host.stderr.isTTY === true\n\t\t},\n\t\texit: (code) => host.exit(code),\n\t\tonSignal: (cb) => {\n\t\t\tconst onSigint = () => {\n\t\t\t\tcb(\"SIGINT\");\n\t\t\t};\n\t\t\tconst onSigterm = () => {\n\t\t\t\tcb(\"SIGTERM\");\n\t\t\t};\n\t\t\thost.on(\"SIGINT\", onSigint);\n\t\t\thost.on(\"SIGTERM\", onSigterm);\n\t\t\treturn () => {\n\t\t\t\thost.off(\"SIGINT\", onSigint);\n\t\t\t\thost.off(\"SIGTERM\", onSigterm);\n\t\t\t};\n\t\t},\n\t\tloadConfig,\n\t\tcredentialManager: new EnvironmentCredentialManager({ env }),\n\t\tmanagementApiClientConfig: clientConfig(env, apiBaseUrl),\n\t\tspawn: spawnChild,\n\t\tmanagementApi: { baseUrl: apiBaseUrl },\n\t\t...packageManager !== void 0 && { packageManager },\n\t\thost: describeHost(host)\n\t};\n}\n//#endregion\n//#region src/family/engine-cli.ts\n/**\n* Composer's own CLI, rebuilt as a thin composition of the family it\n* publishes: `createCli` over `createComposerFamily()`, `Cli.run` with a\n* Runtime. Grammar, help, arg validation, output framing, exit codes and\n* signal ownership all belong to the engine now — this module contributes the\n* family and the environment, and nothing else.\n*\n* Running composer's commands through the same path an external host uses is\n* the point: it is what proves the family works standalone before the `prisma`\n* bin mounts it.\n*\n* This IS composer's CLI. The clipanion shell it replaced, and the bespoke\n* runner that shelled out to alchemy, are gone; `bin.ts` is a call into here.\n*/\nconst BINARY_NAME = \"prisma-composer\";\n/**\n* Composer's commands mount at the top level of its own CLI (`prisma-composer\n* deploy`); under the `prisma` bin the same family mounts one level down\n* (`prisma composer deploy`). The family is identical either way — only the\n* mount paths differ, which is exactly the split `createCli` draws between\n* `commandFamilies` and `commands`.\n*/\nfunction mountedTree(family) {\n\treturn { ...family.commands };\n}\nfunction createComposerCli(spec) {\n\tconst family = createComposerFamily({ operations: spec.operations });\n\treturn createCli({\n\t\tname: BINARY_NAME,\n\t\tversion: spec.version,\n\t\tcommandFamilies: [family],\n\t\tgroups: {},\n\t\tcommands: mountedTree(family)\n\t});\n}\n/**\n* Composes the Runtime and runs one invocation. Returns the exit code rather\n* than exiting, so the caller owns the process — a bin assigns it to\n* `process.exitCode` and lets the streams drain, as composer's CLI has always\n* done.\n*\n* `prisma.config.ts` is not read here. The loader goes in as a function, and the\n* engine calls it only when the command it is about to run declares a config\n* section, passing it the file `--config` named; the loader resolves that\n* against the host's cwd.\n*/\nfunction runComposerCli(argv, host, spec, hooks) {\n\tconst runtime = createRuntime(host, (configPath) => loadConfig(host.cwd(), configPath));\n\treturn createComposerCli(spec).run(argv, runtime, hooks);\n}\n//#endregion\nexport { realOperations as a, createComposerFamily as i, createComposerCli as n, composerSection as o, runComposerCli as r, toEngineError as s, BINARY_NAME as t };\n\n//# sourceMappingURL=engine-cli-zWLMCCrQ.mjs.map"],"mappings":";;;;;;;;;;AASA,eAAe,eAAe,OAAO,MAAM;CAC1C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,UAAU,OAAO,GAAG,CAAC;CACvD;CACA,OAAO,SAAS,cAAc,OAAO,MAAM,GAAG;AAC/C;;;;AASA,eAAe,gBAAgB,OAAO,MAAM;CAC3C,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAOA,QAAM,oBAAoB,WAAW,OAAO,GAAG,CAAC;CACxD;CACA,OAAO,SAAS,eAAe,OA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AAU,cAAc,OAAO,eAAe,WAAW,KAAK,IAAI,GAAG,UAAU,CAAC;CACtF,OAAO,kBAAkB,IAAI,CAAC,CAAC,IAAI,MAAM,SAAS,KAAK;AACxD"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { c as CliStructuredError, d as blindCast, i as effectResolutionDiagnostic, u as InternalError } from "./result-B4XjxVK6.mjs";
|
|
2
|
+
import * as mod from "node:module";
|
|
2
3
|
import * as fs from "node:fs";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
3
5
|
import * as path from "node:path";
|
|
4
|
-
import { pathToFileURL } from "node:url";
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
7
|
import * as c12 from "c12";
|
|
6
8
|
//#region ../../0-framework/1-core/core/dist/graph-BJgUfGB0.mjs
|
|
7
9
|
/**
|
|
@@ -531,7 +533,78 @@ function Load(root, opts) {
|
|
|
531
533
|
}
|
|
532
534
|
blindCast(Symbol.for("prisma:secret-box"));
|
|
533
535
|
//#endregion
|
|
534
|
-
//#region ../../0-framework/3-tooling/cli/dist/load-entry-
|
|
536
|
+
//#region ../../0-framework/3-tooling/cli/dist/load-entry-BjRb7YB3.mjs
|
|
537
|
+
/**
|
|
538
|
+
* Synchronous Node resolve hook so that entry modules may import relative
|
|
539
|
+
* files using the specifier forms TypeScript accepts by default —
|
|
540
|
+
* extensionless `./service` and `./service.js` for a `.ts` source file —
|
|
541
|
+
* without requiring `allowImportingTsExtensions` in every consumer's tsconfig.
|
|
542
|
+
*
|
|
543
|
+
* Resolution only; uses TypeScript's own documented mapping: for a specifier
|
|
544
|
+
* Node could not resolve, strip any JS-family extension and probe the
|
|
545
|
+
* corresponding TypeScript source; first candidate that exists on disk wins.
|
|
546
|
+
* Format-specific rules: `.mjs` → `.mts`; `.cjs` → `.cts`; `.js` and
|
|
547
|
+
* extensionless → `.ts`, `.mts`, `.tsx`, then `./index.ts`. Bare and package
|
|
548
|
+
* specifiers are never touched. Existing `./x.ts` imports keep working —
|
|
549
|
+
* Node resolves them before the hook fires (ADR-0005: no transform, no
|
|
550
|
+
* guessing, deterministic TypeScript rule).
|
|
551
|
+
*
|
|
552
|
+
* Bun resolves `./x.js` and `./x` to `x.ts` natively, so the hook is a
|
|
553
|
+
* no-op under Bun. Nothing is registered there.
|
|
554
|
+
*/
|
|
555
|
+
let registered = false;
|
|
556
|
+
/**
|
|
557
|
+
* Registers the resolve hook once (idempotent). Call at the start of
|
|
558
|
+
* `loadEntry` so every module in the entry graph benefits, including those
|
|
559
|
+
* imported lazily after the entry itself loads.
|
|
560
|
+
*/
|
|
561
|
+
function registerEntryResolution() {
|
|
562
|
+
if (registered || typeof process.versions.bun === "string") return;
|
|
563
|
+
if (typeof mod.registerHooks !== "function") return;
|
|
564
|
+
registered = true;
|
|
565
|
+
mod.registerHooks({ resolve(specifier, context, nextResolve) {
|
|
566
|
+
try {
|
|
567
|
+
return nextResolve(specifier, context);
|
|
568
|
+
} catch (error) {
|
|
569
|
+
if (!isRelativeSpecifier(specifier) || context.parentURL === void 0 || !isModuleNotFoundError(error)) throw error;
|
|
570
|
+
for (const candidate of sourceCandidates(new URL(specifier, context.parentURL))) if (existsSync(fileURLToPath(candidate))) return nextResolve(candidate.href, context);
|
|
571
|
+
throw error;
|
|
572
|
+
}
|
|
573
|
+
} });
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* TypeScript's extension mapping: for a JS-family or extensionless URL,
|
|
577
|
+
* produce the source candidates to probe. Format-specific: `.mjs` maps only
|
|
578
|
+
* to `.mts`; `.cjs` maps only to `.cts`; `.js` and extensionless probe
|
|
579
|
+
* `.ts`, `.mts`, `.tsx` (keeping `.tsx` so the JSX diagnostic fires), then
|
|
580
|
+
* `./index.ts`.
|
|
581
|
+
*/
|
|
582
|
+
function sourceCandidates(resolved) {
|
|
583
|
+
const href = resolved.href;
|
|
584
|
+
if (href.endsWith(".mjs")) {
|
|
585
|
+
const base = href.slice(0, -4);
|
|
586
|
+
return [new URL(`${base}.mts`)];
|
|
587
|
+
}
|
|
588
|
+
if (href.endsWith(".cjs")) {
|
|
589
|
+
const base = href.slice(0, -4);
|
|
590
|
+
return [new URL(`${base}.cts`)];
|
|
591
|
+
}
|
|
592
|
+
const base = href.endsWith(".js") ? href.slice(0, -3) : href;
|
|
593
|
+
return [
|
|
594
|
+
new URL(`${base}.ts`),
|
|
595
|
+
new URL(`${base}.mts`),
|
|
596
|
+
new URL(`${base}.tsx`),
|
|
597
|
+
new URL(`${base}/index.ts`)
|
|
598
|
+
];
|
|
599
|
+
}
|
|
600
|
+
function isRelativeSpecifier(specifier) {
|
|
601
|
+
return specifier.startsWith("./") || specifier.startsWith("../");
|
|
602
|
+
}
|
|
603
|
+
function isModuleNotFoundError(error) {
|
|
604
|
+
if (!(error instanceof Error)) return false;
|
|
605
|
+
if (!("code" in error)) return false;
|
|
606
|
+
return error.code === "ERR_MODULE_NOT_FOUND";
|
|
607
|
+
}
|
|
535
608
|
/**
|
|
536
609
|
* `loadEntry` imports a user's topology with the host runtime's own module
|
|
537
610
|
* loader — under node (the CLI's shebang runtime), that loader strips
|
|
@@ -576,6 +649,7 @@ function explainJsxLoadError(error, entryPath) {
|
|
|
576
649
|
* IS the application; nothing else marks a root (ADR-0003).
|
|
577
650
|
*/
|
|
578
651
|
async function loadEntry(entryArg, cwd) {
|
|
652
|
+
registerEntryResolution();
|
|
579
653
|
const resolvedPath = path.resolve(cwd, entryArg);
|
|
580
654
|
let mod;
|
|
581
655
|
try {
|
|
@@ -652,7 +726,7 @@ async function assembleServices(graph, config, cwd, run) {
|
|
|
652
726
|
return { bundles };
|
|
653
727
|
}
|
|
654
728
|
//#endregion
|
|
655
|
-
//#region ../../0-framework/3-tooling/cli/dist/pipeline-
|
|
729
|
+
//#region ../../0-framework/3-tooling/cli/dist/pipeline-CCuthvMX.mjs
|
|
656
730
|
/**
|
|
657
731
|
* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE
|
|
658
732
|
* file that imports control-plane code. Discovery is the standard walk-up
|
|
@@ -973,4 +1047,4 @@ async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError)
|
|
|
973
1047
|
//#endregion
|
|
974
1048
|
export { runPipeline as n, resolveAppIdentity as t };
|
|
975
1049
|
|
|
976
|
-
//# sourceMappingURL=pipeline-
|
|
1050
|
+
//# sourceMappingURL=pipeline-CCuthvMX-DeTFEdBI.mjs.map
|