@prisma/composer 0.39.0-dev.3 → 0.39.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/{app-config-CxdIiCvU-7vQWECm1.d.mts → app-config-Ubi4CftJ-DUSDjI2i.d.mts} +58 -57
  2. package/dist/app-config-Ubi4CftJ-DUSDjI2i.d.mts.map +1 -0
  3. package/dist/{app-configuration-file-Cw9autUL-DebaEvDz.mjs → app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs} +40 -40
  4. package/dist/app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs.map +1 -0
  5. package/dist/config-BmRE_eTa.d.mts +1 -0
  6. package/dist/config.d.mts +3 -3
  7. package/dist/config.mjs +2 -2
  8. package/dist/control.d.mts +21 -8
  9. package/dist/control.d.mts.map +1 -1
  10. package/dist/control.mjs +3 -3
  11. package/dist/control.mjs.map +1 -1
  12. package/dist/converge-in-process-BBBeood8-C7VG5b35.d.mts +67 -0
  13. package/dist/converge-in-process-BBBeood8-C7VG5b35.d.mts.map +1 -0
  14. package/dist/deploy-BW_F4Y9W.d.mts +12 -0
  15. package/dist/deploy-BW_F4Y9W.d.mts.map +1 -0
  16. package/dist/{deploy-BzRRAmns.mjs → deploy-NArSOken.mjs} +65 -16
  17. package/dist/deploy-NArSOken.mjs.map +1 -0
  18. package/dist/deploy.d.mts +3 -3
  19. package/dist/deploy.mjs +3 -3
  20. package/dist/{deployment-summary-p88NV5m5-3Ga91LRH.d.mts → deployment-summary-6LgQDUuu-DtCvw9UQ.d.mts} +7 -4
  21. package/dist/deployment-summary-6LgQDUuu-DtCvw9UQ.d.mts.map +1 -0
  22. package/dist/{deployment-summary-B6rYxEZe-E4IIcngK.mjs → deployment-summary-YP7eMPJI-CQsj7BHh.mjs} +16 -44
  23. package/dist/deployment-summary-YP7eMPJI-CQsj7BHh.mjs.map +1 -0
  24. package/dist/{dev-current-D8GwJQex-C8F3EUBY.mjs → dev-current-Dp3jvXGN-C1Y2BAtC.mjs} +5 -5
  25. package/dist/{dev-current-D8GwJQex-C8F3EUBY.mjs.map → dev-current-Dp3jvXGN-C1Y2BAtC.mjs.map} +1 -1
  26. package/dist/{dist-BN9EXWWX.mjs → dist-BxtsHOfP.mjs} +2 -2
  27. package/dist/{dist-BN9EXWWX.mjs.map → dist-BxtsHOfP.mjs.map} +1 -1
  28. package/dist/{execute-deploy-destroy-1SIH5uAu-DVRY18xU.mjs → execute-deploy-destroy-J0buFSWK-BhVTX4-E.mjs} +272 -36
  29. package/dist/execute-deploy-destroy-J0buFSWK-BhVTX4-E.mjs.map +1 -0
  30. package/dist/{execute-dev-xPaS5SAl-BUeHjmYV.mjs → execute-dev-B5YaMqpD-BAxU6Smm.mjs} +10 -11
  31. package/dist/{execute-dev-xPaS5SAl-BUeHjmYV.mjs.map → execute-dev-B5YaMqpD-BAxU6Smm.mjs.map} +1 -1
  32. package/dist/{execute-dev-current-DsAsDBB1-DwfOidWf.mjs → execute-dev-current-C7le-kh2-BoUej3LZ.mjs} +4 -4
  33. package/dist/{execute-dev-current-DsAsDBB1-DwfOidWf.mjs.map → execute-dev-current-C7le-kh2-BoUej3LZ.mjs.map} +1 -1
  34. package/dist/{execute-log-Be9DYRI6-WnytA3d7.mjs → execute-log-BcmA2gDv-CPrOZtEh.mjs} +4 -4
  35. package/dist/{execute-log-Be9DYRI6-WnytA3d7.mjs.map → execute-log-BcmA2gDv-CPrOZtEh.mjs.map} +1 -1
  36. package/dist/{graph-K7VOpCAj-D6UHSltu.mjs → graph-C6Fqe2gn-DMa2udEA.mjs} +4 -4
  37. package/dist/graph-C6Fqe2gn-DMa2udEA.mjs.map +1 -0
  38. package/dist/http.mjs +2 -2
  39. package/dist/index.mjs +2 -2
  40. package/dist/internal-app-configuration-file.d.mts +4 -4
  41. package/dist/internal-app-configuration-file.d.mts.map +1 -1
  42. package/dist/internal-app-configuration-file.mjs +1 -1
  43. package/dist/internal-converge-contract.d.mts +14 -0
  44. package/dist/internal-converge-contract.d.mts.map +1 -0
  45. package/dist/internal-converge-contract.mjs +14 -0
  46. package/dist/internal-converge-contract.mjs.map +1 -0
  47. package/dist/internal-converge.d.mts +4 -0
  48. package/dist/internal-converge.mjs +228 -0
  49. package/dist/internal-converge.mjs.map +1 -0
  50. package/dist/local-target.d.mts +1 -1
  51. package/dist/nextjs-control.d.mts +3 -3
  52. package/dist/node-control.d.mts +3 -3
  53. package/dist/{preflight-transport-DJjTWvyH-CEJ9WlaN.mjs → preflight-transport-C7_3abXW-Bza_hn9G.mjs} +3 -39
  54. package/dist/preflight-transport-C7_3abXW-Bza_hn9G.mjs.map +1 -0
  55. package/dist/{redaction-CqdeMBKw-BECjU4HR.d.mts → redaction-CIaE4m9U-DJGrkcn3.d.mts} +7 -6
  56. package/dist/redaction-CIaE4m9U-DJGrkcn3.d.mts.map +1 -0
  57. package/dist/{redaction-C-NnlVUh-B1nJc6rb.mjs → redaction-CjMYXtGp-CEQ5z1PK.mjs} +17 -6
  58. package/dist/redaction-CjMYXtGp-CEQ5z1PK.mjs.map +1 -0
  59. package/dist/report.d.mts +3 -3
  60. package/dist/report.mjs +2 -2
  61. package/dist/report.mjs.map +1 -1
  62. package/dist/{run-alchemy-CyciV8i0-BxPAyrch.mjs → run-alchemy-BlYyc4Oh-mIzYC4lq.mjs} +3 -3
  63. package/dist/{run-alchemy-CyciV8i0-BxPAyrch.mjs.map → run-alchemy-BlYyc4Oh-mIzYC4lq.mjs.map} +1 -1
  64. package/dist/service-rpc.mjs +2 -2
  65. package/dist/{validate-environment-DyW59rJ7-u8hQkzuY.mjs → validate-environment-XwVDifWN-BhPOzWN8.mjs} +6 -6
  66. package/dist/{validate-environment-DyW59rJ7-u8hQkzuY.mjs.map → validate-environment-XwVDifWN-BhPOzWN8.mjs.map} +1 -1
  67. package/package.json +15 -13
  68. package/skills/prisma-composer-core-concepts/SKILL.md +9 -23
  69. package/src/exports/internal-converge-contract.ts +1 -0
  70. package/src/exports/internal-converge.ts +1 -0
  71. package/dist/app-config-CxdIiCvU-7vQWECm1.d.mts.map +0 -1
  72. package/dist/app-configuration-file-Cw9autUL-DebaEvDz.mjs.map +0 -1
  73. package/dist/config-BcT6edff.d.mts +0 -1
  74. package/dist/deploy-BzRRAmns.mjs.map +0 -1
  75. package/dist/deploy-D7NHGXag.d.mts +0 -2
  76. package/dist/deployment-summary-B6rYxEZe-E4IIcngK.mjs.map +0 -1
  77. package/dist/deployment-summary-p88NV5m5-3Ga91LRH.d.mts.map +0 -1
  78. package/dist/execute-deploy-destroy-1SIH5uAu-DVRY18xU.mjs.map +0 -1
  79. package/dist/graph-K7VOpCAj-D6UHSltu.mjs.map +0 -1
  80. package/dist/preflight-transport-DJjTWvyH-CEJ9WlaN.mjs.map +0 -1
  81. package/dist/redaction-C-NnlVUh-B1nJc6rb.mjs.map +0 -1
  82. package/dist/redaction-CqdeMBKw-BECjU4HR.d.mts.map +0 -1
@@ -0,0 +1,228 @@
1
+ import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
2
+ import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
3
+ import { f as wrappedProviderError, o as lower } from "./deploy-NArSOken.mjs";
4
+ import * as Effect from "effect/Effect";
5
+ import { isMainThread } from "node:worker_threads";
6
+ import * as Alchemist from "alchemy/Alchemist";
7
+ import * as Interaction from "alchemy/Interaction";
8
+ import { recordOf } from "alchemy/Util/LogRecord";
9
+ import * as Cause from "effect/Cause";
10
+ import * as Exit from "effect/Exit";
11
+ import * as Logger from "effect/Logger";
12
+ //#region ../../0-framework/3-tooling/cli/dist/converge.mjs
13
+ /**
14
+ * Runs a lowered stack's plan and apply in this process through Alchemy's
15
+ * programmatic API (`alchemy/Alchemist`). Alchemy's typed events and log
16
+ * lines come back as {@link ConvergeEvent}s, and what Alchemy writes to the
17
+ * terminal itself goes to the request's `output`, so the caller renders
18
+ * progress in its own format.
19
+ *
20
+ * Published as `@prisma/composer/internal/converge`: the CLI loads it from
21
+ * the app's install, so it runs on the app's copy of alchemy and effect.
22
+ */
23
+ const FINISHED = /* @__PURE__ */ new Set([
24
+ "created",
25
+ "updated",
26
+ "adopted",
27
+ "deleted",
28
+ "orphaned",
29
+ "replaced",
30
+ "ran",
31
+ "skipped"
32
+ ]);
33
+ function phaseOf(status) {
34
+ if (status === "pending") return "pending";
35
+ if (status === "fail") return "failed";
36
+ return FINISHED.has(status) ? "done" : "running";
37
+ }
38
+ /** Alchemy's typed event as a converge event; undefined for the events Composer does not show. */
39
+ function toConvergeEvent(event) {
40
+ switch (event.type) {
41
+ case "apply.resource.status": return {
42
+ kind: "resource",
43
+ fqn: event.fqn,
44
+ resourceType: event.resourceType,
45
+ status: event.status,
46
+ phase: phaseOf(event.status),
47
+ ...event.message === void 0 ? {} : { message: event.message }
48
+ };
49
+ case "apply.resource.note": return {
50
+ kind: "log",
51
+ severity: event.kind === void 0 ? "info" : "verbose",
52
+ text: `${event.fqn}: ${event.message}`
53
+ };
54
+ default: return;
55
+ }
56
+ }
57
+ const SEVERITY_OF = {
58
+ info: "info",
59
+ warn: "warn",
60
+ error: "warn",
61
+ fatal: "warn"
62
+ };
63
+ /** Alchemy's log lines at info and above, as Alchemy's console sink would print them. Typed events are left to `Alchemist.onEvent`. */
64
+ function logEvents(emit) {
65
+ return Logger.make((options) => {
66
+ const record = recordOf(options);
67
+ const severity = SEVERITY_OF[record.level];
68
+ if (severity === void 0) return;
69
+ if (record.kind === "log") {
70
+ const fqn = record.attributes["fqn"];
71
+ emit({
72
+ kind: "log",
73
+ severity,
74
+ text: `${typeof fqn === "string" ? `${fqn}: ` : ""}${record.data.message}`
75
+ });
76
+ if (record.data.cause !== null) emit({
77
+ kind: "log",
78
+ severity,
79
+ text: record.data.cause
80
+ });
81
+ } else if (record.kind === "output") emit({
82
+ kind: "log",
83
+ severity: "verbose",
84
+ text: record.data.text
85
+ });
86
+ });
87
+ }
88
+ function textOf(value) {
89
+ if (typeof value === "string") return value;
90
+ try {
91
+ const json = JSON.stringify(value);
92
+ if (json !== void 0) return json;
93
+ } catch {}
94
+ return String(value);
95
+ }
96
+ function isRecord(value) {
97
+ return typeof value === "object" && value !== null;
98
+ }
99
+ /** One error as a reason. A wrapped provider failure reports the error it wraps, and a structured error reports its code as its tag. */
100
+ function reasonOf(error) {
101
+ if (!isRecord(error)) return {
102
+ tag: "Unknown",
103
+ message: textOf(error)
104
+ };
105
+ const wrapped = wrappedProviderError(error);
106
+ if (wrapped !== void 0) return reasonOf(wrapped);
107
+ const message = typeof error["message"] === "string" ? error["message"] : void 0;
108
+ return {
109
+ tag: CliStructuredError.is(error) ? error.code : typeof error["_tag"] === "string" ? error["_tag"] : error instanceof Error ? error.name : "Unknown",
110
+ message: message ?? textOf(error)
111
+ };
112
+ }
113
+ /** The errors a converge failed with, one per distinct error, interruptions left out. */
114
+ function failureReasons(cause) {
115
+ const reasons = cause.reasons.flatMap((reason) => {
116
+ if (Cause.isInterruptReason(reason)) return [];
117
+ return [reasonOf(Cause.isFailReason(reason) ? reason.error : reason.defect)];
118
+ });
119
+ const unique = new Map(reasons.map((reason) => [`${reason.tag}\0${reason.message}`, reason]));
120
+ return unique.size > 0 ? [...unique.values()] : [{
121
+ tag: "Unknown",
122
+ message: Cause.pretty(cause)
123
+ }];
124
+ }
125
+ /** One flag per process, shared by every copy of this module, so two apps' installs in one host cannot converge at once. */
126
+ const RUNNING = Symbol.for("prisma.composer.converge.running");
127
+ const flag = blindCast(globalThis);
128
+ /**
129
+ * Sets the process state Alchemy reads for the length of `run`, and restores
130
+ * it on every exit path: the variables in `env`, then the working directory.
131
+ * A directory that cannot be restored never leaves a variable behind and
132
+ * never changes what `run` returned.
133
+ */
134
+ async function withProcessState(env, cwd, run) {
135
+ const previousEnv = Object.keys(env).map((name) => [name, process.env[name]]);
136
+ const previousCwd = process.cwd();
137
+ let changedDirectory = false;
138
+ try {
139
+ for (const [name, value] of Object.entries(env)) if (value === void 0) delete process.env[name];
140
+ else process.env[name] = value;
141
+ if (previousCwd !== cwd) {
142
+ process.chdir(cwd);
143
+ changedDirectory = true;
144
+ }
145
+ return await run();
146
+ } finally {
147
+ for (const [name, value] of previousEnv) if (value === void 0) delete process.env[name];
148
+ else process.env[name] = value;
149
+ if (changedDirectory) try {
150
+ process.chdir(previousCwd);
151
+ } catch {}
152
+ }
153
+ }
154
+ /** A stream for Alchemy's terminal output that hands each write to `write`; it reports the terminal's size and colours as stderr does. */
155
+ function writingTo(write) {
156
+ const stream = Object.create(process.stderr);
157
+ stream.write = (chunk) => {
158
+ try {
159
+ write(typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8"));
160
+ } catch {}
161
+ return true;
162
+ };
163
+ return stream;
164
+ }
165
+ function program(request, emit) {
166
+ const terminal = request.output === void 0 ? process.stderr : writingTo(request.output);
167
+ return Effect.gen(function* () {
168
+ const plan = yield* Alchemist.plan({
169
+ stack: request.stack,
170
+ operation: request.operation,
171
+ stage: request.stage,
172
+ updateStateStore: true
173
+ });
174
+ yield* Alchemist.apply(plan);
175
+ }).pipe(Alchemist.onEvent((event) => Effect.sync(() => {
176
+ const converted = toConvergeEvent(event);
177
+ if (converted !== void 0) emit(converted);
178
+ })), Effect.scoped, Effect.provide(Logger.layer([logEvents(emit)])), Effect.provide(Interaction.layerNonInteractive({
179
+ stdout: terminal,
180
+ stderr: terminal
181
+ })), Effect.provide(Alchemist.layer()));
182
+ }
183
+ /**
184
+ * Plans and applies `stack` in this process, as `alchemy deploy --yes` would.
185
+ * The plan's scope, and the state-store lease it holds, closes before this
186
+ * returns, including when `signal` interrupts it. One converge runs at a time
187
+ * per process, across every install of this module: a second call while one
188
+ * runs is refused.
189
+ */
190
+ const convergeInProcess = async (request) => {
191
+ if (flag[RUNNING] === true) return {
192
+ kind: "refused",
193
+ reason: "already-running"
194
+ };
195
+ if (!isMainThread && process.cwd() !== request.cwd) return {
196
+ kind: "refused",
197
+ reason: "worker-thread"
198
+ };
199
+ const emit = (event) => {
200
+ try {
201
+ request.onEvent?.(event);
202
+ } catch {}
203
+ };
204
+ try {
205
+ flag[RUNNING] = true;
206
+ const effect = program(request, emit);
207
+ return await withProcessState(request.env, request.cwd, async () => {
208
+ const exit = await Effect.runPromiseExit(effect, request.signal === void 0 ? void 0 : { signal: request.signal });
209
+ if (Exit.isSuccess(exit)) return { kind: "applied" };
210
+ if (Cause.hasInterruptsOnly(exit.cause)) return { kind: "interrupted" };
211
+ return {
212
+ kind: "failed",
213
+ reasons: failureReasons(exit.cause)
214
+ };
215
+ });
216
+ } catch (error) {
217
+ return {
218
+ kind: "failed",
219
+ reasons: [reasonOf(error)]
220
+ };
221
+ } finally {
222
+ flag[RUNNING] = false;
223
+ }
224
+ };
225
+ //#endregion
226
+ export { convergeInProcess, lower };
227
+
228
+ //# sourceMappingURL=internal-converge.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-converge.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/converge.mjs"],"sourcesContent":["import { lower, wrappedProviderError } from \"@internal/core/deploy\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { isMainThread } from \"node:worker_threads\";\nimport * as Alchemist from \"alchemy/Alchemist\";\nimport * as Interaction from \"alchemy/Interaction\";\nimport { recordOf } from \"alchemy/Util/LogRecord\";\nimport * as Cause from \"effect/Cause\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Logger from \"effect/Logger\";\n//#region src/converge-in-process.ts\n/**\n* Runs a lowered stack's plan and apply in this process through Alchemy's\n* programmatic API (`alchemy/Alchemist`). Alchemy's typed events and log\n* lines come back as {@link ConvergeEvent}s, and what Alchemy writes to the\n* terminal itself goes to the request's `output`, so the caller renders\n* progress in its own format.\n*\n* Published as `@prisma/composer/internal/converge`: the CLI loads it from\n* the app's install, so it runs on the app's copy of alchemy and effect.\n*/\nconst FINISHED = /* @__PURE__ */ new Set([\n\t\"created\",\n\t\"updated\",\n\t\"adopted\",\n\t\"deleted\",\n\t\"orphaned\",\n\t\"replaced\",\n\t\"ran\",\n\t\"skipped\"\n]);\nfunction phaseOf(status) {\n\tif (status === \"pending\") return \"pending\";\n\tif (status === \"fail\") return \"failed\";\n\treturn FINISHED.has(status) ? \"done\" : \"running\";\n}\n/** Alchemy's typed event as a converge event; undefined for the events Composer does not show. */\nfunction toConvergeEvent(event) {\n\tswitch (event.type) {\n\t\tcase \"apply.resource.status\": return {\n\t\t\tkind: \"resource\",\n\t\t\tfqn: event.fqn,\n\t\t\tresourceType: event.resourceType,\n\t\t\tstatus: event.status,\n\t\t\tphase: phaseOf(event.status),\n\t\t\t...event.message === void 0 ? {} : { message: event.message }\n\t\t};\n\t\tcase \"apply.resource.note\": return {\n\t\t\tkind: \"log\",\n\t\t\tseverity: event.kind === void 0 ? \"info\" : \"verbose\",\n\t\t\ttext: `${event.fqn}: ${event.message}`\n\t\t};\n\t\tdefault: return;\n\t}\n}\nconst SEVERITY_OF = {\n\tinfo: \"info\",\n\twarn: \"warn\",\n\terror: \"warn\",\n\tfatal: \"warn\"\n};\n/** Alchemy's log lines at info and above, as Alchemy's console sink would print them. Typed events are left to `Alchemist.onEvent`. */\nfunction logEvents(emit) {\n\treturn Logger.make((options) => {\n\t\tconst record = recordOf(options);\n\t\tconst severity = SEVERITY_OF[record.level];\n\t\tif (severity === void 0) return;\n\t\tif (record.kind === \"log\") {\n\t\t\tconst fqn = record.attributes[\"fqn\"];\n\t\t\temit({\n\t\t\t\tkind: \"log\",\n\t\t\t\tseverity,\n\t\t\t\ttext: `${typeof fqn === \"string\" ? `${fqn}: ` : \"\"}${record.data.message}`\n\t\t\t});\n\t\t\tif (record.data.cause !== null) emit({\n\t\t\t\tkind: \"log\",\n\t\t\t\tseverity,\n\t\t\t\ttext: record.data.cause\n\t\t\t});\n\t\t} else if (record.kind === \"output\") emit({\n\t\t\tkind: \"log\",\n\t\t\tseverity: \"verbose\",\n\t\t\ttext: record.data.text\n\t\t});\n\t});\n}\nfunction textOf(value) {\n\tif (typeof value === \"string\") return value;\n\ttry {\n\t\tconst json = JSON.stringify(value);\n\t\tif (json !== void 0) return json;\n\t} catch {}\n\treturn String(value);\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\n/** One error as a reason. A wrapped provider failure reports the error it wraps, and a structured error reports its code as its tag. */\nfunction reasonOf(error) {\n\tif (!isRecord(error)) return {\n\t\ttag: \"Unknown\",\n\t\tmessage: textOf(error)\n\t};\n\tconst wrapped = wrappedProviderError(error);\n\tif (wrapped !== void 0) return reasonOf(wrapped);\n\tconst message = typeof error[\"message\"] === \"string\" ? error[\"message\"] : void 0;\n\treturn {\n\t\ttag: CliStructuredError.is(error) ? error.code : typeof error[\"_tag\"] === \"string\" ? error[\"_tag\"] : error instanceof Error ? error.name : \"Unknown\",\n\t\tmessage: message ?? textOf(error)\n\t};\n}\n/** The errors a converge failed with, one per distinct error, interruptions left out. */\nfunction failureReasons(cause) {\n\tconst reasons = cause.reasons.flatMap((reason) => {\n\t\tif (Cause.isInterruptReason(reason)) return [];\n\t\treturn [reasonOf(Cause.isFailReason(reason) ? reason.error : reason.defect)];\n\t});\n\tconst unique = new Map(reasons.map((reason) => [`${reason.tag}\\0${reason.message}`, reason]));\n\treturn unique.size > 0 ? [...unique.values()] : [{\n\t\ttag: \"Unknown\",\n\t\tmessage: Cause.pretty(cause)\n\t}];\n}\n/** One flag per process, shared by every copy of this module, so two apps' installs in one host cannot converge at once. */\nconst RUNNING = Symbol.for(\"prisma.composer.converge.running\");\nconst flag = blindCast(globalThis);\n/**\n* Sets the process state Alchemy reads for the length of `run`, and restores\n* it on every exit path: the variables in `env`, then the working directory.\n* A directory that cannot be restored never leaves a variable behind and\n* never changes what `run` returned.\n*/\nasync function withProcessState(env, cwd, run) {\n\tconst previousEnv = Object.keys(env).map((name) => [name, process.env[name]]);\n\tconst previousCwd = process.cwd();\n\tlet changedDirectory = false;\n\ttry {\n\t\tfor (const [name, value] of Object.entries(env)) if (value === void 0) delete process.env[name];\n\t\telse process.env[name] = value;\n\t\tif (previousCwd !== cwd) {\n\t\t\tprocess.chdir(cwd);\n\t\t\tchangedDirectory = true;\n\t\t}\n\t\treturn await run();\n\t} finally {\n\t\tfor (const [name, value] of previousEnv) if (value === void 0) delete process.env[name];\n\t\telse process.env[name] = value;\n\t\tif (changedDirectory) try {\n\t\t\tprocess.chdir(previousCwd);\n\t\t} catch {}\n\t}\n}\n/** A stream for Alchemy's terminal output that hands each write to `write`; it reports the terminal's size and colours as stderr does. */\nfunction writingTo(write) {\n\tconst stream = Object.create(process.stderr);\n\tstream.write = (chunk) => {\n\t\ttry {\n\t\t\twrite(typeof chunk === \"string\" ? chunk : Buffer.from(chunk).toString(\"utf8\"));\n\t\t} catch {}\n\t\treturn true;\n\t};\n\treturn stream;\n}\nfunction program(request, emit) {\n\tconst terminal = request.output === void 0 ? process.stderr : writingTo(request.output);\n\treturn Effect.gen(function* () {\n\t\tconst plan = yield* Alchemist.plan({\n\t\t\tstack: request.stack,\n\t\t\toperation: request.operation,\n\t\t\tstage: request.stage,\n\t\t\tupdateStateStore: true\n\t\t});\n\t\tyield* Alchemist.apply(plan);\n\t}).pipe(Alchemist.onEvent((event) => Effect.sync(() => {\n\t\tconst converted = toConvergeEvent(event);\n\t\tif (converted !== void 0) emit(converted);\n\t})), Effect.scoped, Effect.provide(Logger.layer([logEvents(emit)])), Effect.provide(Interaction.layerNonInteractive({\n\t\tstdout: terminal,\n\t\tstderr: terminal\n\t})), Effect.provide(Alchemist.layer()));\n}\n/**\n* Plans and applies `stack` in this process, as `alchemy deploy --yes` would.\n* The plan's scope, and the state-store lease it holds, closes before this\n* returns, including when `signal` interrupts it. One converge runs at a time\n* per process, across every install of this module: a second call while one\n* runs is refused.\n*/\nconst convergeInProcess = async (request) => {\n\tif (flag[RUNNING] === true) return {\n\t\tkind: \"refused\",\n\t\treason: \"already-running\"\n\t};\n\tif (!isMainThread && process.cwd() !== request.cwd) return {\n\t\tkind: \"refused\",\n\t\treason: \"worker-thread\"\n\t};\n\tconst emit = (event) => {\n\t\ttry {\n\t\t\trequest.onEvent?.(event);\n\t\t} catch {}\n\t};\n\ttry {\n\t\tflag[RUNNING] = true;\n\t\tconst effect = program(request, emit);\n\t\treturn await withProcessState(request.env, request.cwd, async () => {\n\t\t\tconst exit = await Effect.runPromiseExit(effect, request.signal === void 0 ? void 0 : { signal: request.signal });\n\t\t\tif (Exit.isSuccess(exit)) return { kind: \"applied\" };\n\t\t\tif (Cause.hasInterruptsOnly(exit.cause)) return { kind: \"interrupted\" };\n\t\t\treturn {\n\t\t\t\tkind: \"failed\",\n\t\t\t\treasons: failureReasons(exit.cause)\n\t\t\t};\n\t\t});\n\t} catch (error) {\n\t\treturn {\n\t\t\tkind: \"failed\",\n\t\t\treasons: [reasonOf(error)]\n\t\t};\n\t} finally {\n\t\tflag[RUNNING] = false;\n\t}\n};\n//#endregion\nexport { convergeInProcess, lower };\n\n//# sourceMappingURL=converge.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,2BAA2B,IAAI,IAAI;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,SAAS,QAAQ,QAAQ;CACxB,IAAI,WAAW,WAAW,OAAO;CACjC,IAAI,WAAW,QAAQ,OAAO;CAC9B,OAAO,SAAS,IAAI,MAAM,IAAI,SAAS;AACxC;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,QAAQ,MAAM,MAAd;EACC,KAAK,yBAAyB,OAAO;GACpC,MAAM;GACN,KAAK,MAAM;GACX,cAAc,MAAM;GACpB,QAAQ,MAAM;GACd,OAAO,QAAQ,MAAM,MAAM;GAC3B,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,EAAE,SAAS,MAAM,QAAQ;EAC7D;EACA,KAAK,uBAAuB,OAAO;GAClC,MAAM;GACN,UAAU,MAAM,SAAS,KAAK,IAAI,SAAS;GAC3C,MAAM,GAAG,MAAM,IAAI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AS,QAAQ,SAAS,IAAI;EACpC,OAAO,MAAM,iBAAiB,QAAQ,KAAK,QAAQ,KAAK,YAAY;GACnE,MAAM,OAAO,MAAM,OAAO,eAAe,QAAQ,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,EAAE,QAAQ,QAAQ,OAAO,CAAC;GAChH,IAAI,KAAK,UAAU,IAAI,GAAG,OAAO,EAAE,MAAM,UAAU;GACnD,IAAI,MAAM,kBAAkB,KAAK,KAAK,GAAG,OAAO,EAAE,MAAM,cAAc;GACtE,OAAO;IACN,MAAM;IACN,SAAS,eAAe,KAAK,KAAK;GACnC;EACD,CAAC;CACF,SAAS,OAAO;EACf,OAAO;GACN,MAAM;GACN,SAAS,CAAC,SAAS,KAAK,CAAC;EAC1B;CACD,UAAU;EACT,KAAK,WAAW;CACjB;AACD"}
@@ -1,4 +1,4 @@
1
- import { A as LocalTargetEmulatorsInput, C as LocalNodeLocation, D as LocalTargetCurrentApp, E as LocalTargetAttachment, J as PrismaAppConfig, O as LocalTargetCurrentInput, R as NamedSecrets, S as LocalNodeCondition, T as LocalTargetAttachInput, h as DEV_ENVIRONMENT_NAME_FILE, j as LocalTargetProvidersInput, k as LocalTargetDescriptor, m as DEV_DIR, mt as devEnvironmentDir, p as ContainerInstance, t as AlchemyStateLayer, w as LocalNodeStopped, y as DevPreflightResult } from "./app-config-CxdIiCvU-7vQWECm1.mjs";
1
+ import { A as LocalTargetEmulatorsInput, C as LocalNodeLocation, D as LocalTargetCurrentApp, E as LocalTargetAttachment, O as LocalTargetCurrentInput, R as NamedSecrets, S as LocalNodeCondition, T as LocalTargetAttachInput, h as DEV_ENVIRONMENT_NAME_FILE, j as LocalTargetProvidersInput, k as LocalTargetDescriptor, m as DEV_DIR, mt as devEnvironmentDir, p as ContainerInstance, q as PrismaAppConfig, t as AlchemyStateLayer, w as LocalNodeStopped, y as DevPreflightResult } from "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
2
2
  import * as Layer from "effect/Layer";
3
3
  //#region ../../0-framework/1-core/core/dist/local-target.d.mts
4
4
  //#region src/control/local-target.d.ts
@@ -1,6 +1,6 @@
1
- import { b as DevServer, nt as ServeInput, o as AssembleInput, s as Bundle, x as ExtensionDescriptor } from "./app-config-CxdIiCvU-7vQWECm1.mjs";
2
- import "./config-BcT6edff.mjs";
3
- import "./deploy-D7NHGXag.mjs";
1
+ import { b as DevServer, nt as ServeInput, o as AssembleInput, s as Bundle, x as ExtensionDescriptor } from "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
2
+ import "./config-BmRE_eTa.mjs";
3
+ import "./deploy-BW_F4Y9W.mjs";
4
4
  import { t as NextjsBuildAdapter } from "./nextjs-DLyeRR7M-Z_xX74Cp.mjs";
5
5
  //#region ../../0-framework/2-authoring/nextjs/dist/control.d.mts
6
6
  //#region src/control/build.d.ts
@@ -1,6 +1,6 @@
1
- import { b as DevServer, nt as ServeInput, o as AssembleInput, s as Bundle, x as ExtensionDescriptor } from "./app-config-CxdIiCvU-7vQWECm1.mjs";
2
- import "./config-BcT6edff.mjs";
3
- import "./deploy-D7NHGXag.mjs";
1
+ import { b as DevServer, nt as ServeInput, o as AssembleInput, s as Bundle, x as ExtensionDescriptor } from "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
2
+ import "./config-BmRE_eTa.mjs";
3
+ import "./deploy-BW_F4Y9W.mjs";
4
4
  //#region ../../0-framework/2-authoring/node/dist/control.d.mts
5
5
  //#region src/control/build.d.ts
6
6
  declare function assemble(input: AssembleInput): Promise<Bundle>;
@@ -1,4 +1,4 @@
1
- //#region ../../0-framework/1-core/core/dist/preflight-transport-DJjTWvyH.mjs
1
+ //#region ../../0-framework/1-core/core/dist/preflight-transport-C7_3abXW.mjs
2
2
  /** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PRISMA_CLOUD': uppercased, every non-alphanumeric run replaced by one underscore. */
3
3
  function envVarSafeExtensionId(extensionId) {
4
4
  return extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, "_").replace(/^_+|_+$/g, "");
@@ -64,7 +64,6 @@ function preflightEnv(payloads) {
64
64
  for (const [extensionId, payload] of payloads) {
65
65
  if (payload.length === 0) continue;
66
66
  const varName = preflightEnvVarName(extensionId);
67
- if (varName === "PRISMA_COMPOSER_PREFLIGHT_FINDINGS") throw new Error(`Extension id "${extensionId}" uses the environment variable "${varName}", which Composer reserves. Rename the extension.`);
68
67
  const owner = ownerByVarName.get(varName);
69
68
  if (owner !== void 0) throw new Error(`Extension ids "${owner}" and "${extensionId}" both use the environment variable "${varName}". Rename one of the extensions.`);
70
69
  ownerByVarName.set(varName, extensionId);
@@ -84,42 +83,7 @@ function platformVariableReaderText(reader) {
84
83
  case "unread": return `named by resource "${reader.node}", read by no service`;
85
84
  }
86
85
  }
87
- const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
88
- const isStringArray = (value) => Array.isArray(value) && value.every((member) => typeof member === "string");
89
- function isPlatformVariableReader(value) {
90
- if (!isRecord(value)) return false;
91
- switch (value["kind"]) {
92
- case "field": return typeof value["service"] === "string" && typeof value["path"] === "string";
93
- case "unread": return typeof value["node"] === "string";
94
- default: return false;
95
- }
96
- }
97
- function isUnsetPlatformVariable(value) {
98
- return isRecord(value) && typeof value["name"] === "string" && Array.isArray(value["readers"]) && value["readers"].every(isPlatformVariableReader) && isStringArray(value["commands"]);
99
- }
100
- function isPreflightFindings(value) {
101
- return isRecord(value) && Array.isArray(value["unset"]) && value["unset"].every(isUnsetPlatformVariable);
102
- }
103
- /** The variable that carries every extension's deploy preflight findings from the first process to the second. No extension's preflight variable may take this name. */
104
- const PREFLIGHT_FINDINGS_ENV_VAR = "PRISMA_COMPOSER_PREFLIGHT_FINDINGS";
105
- /** The env entry the CLI sets on the second process. It is always set, and empty when nothing was found, so a stale value in the shell never reads as this run's. */
106
- function preflightFindingsEnv(findings) {
107
- return { [PREFLIGHT_FINDINGS_ENV_VAR]: findings.unset.length === 0 ? "" : JSON.stringify(findings) };
108
- }
109
- /** The second process's side: the findings the CLI carried, or none. Throws on a value that does not decode: that is a framework bug. */
110
- function readPreflightFindings(env) {
111
- const text = env[PREFLIGHT_FINDINGS_ENV_VAR];
112
- if (text === void 0 || text.length === 0) return { unset: [] };
113
- let parsed;
114
- try {
115
- parsed = JSON.parse(text);
116
- } catch {
117
- parsed = void 0;
118
- }
119
- if (!isPreflightFindings(parsed)) throw new Error(`The deploy check's findings could not be read in the second process (${PREFLIGHT_FINDINGS_ENV_VAR}). This is a Composer bug; deploying again will not fix it.`);
120
- return parsed;
121
- }
122
86
  //#endregion
123
- export { platformVariableReaderText as a, preflightFindingsEnv as c, deserializeContainers as i, readPreflightFindings as l, containerEnv as n, preflightEnv as o, containerEnvVarName as r, preflightEnvVarName as s, PREFLIGHT_FINDINGS_ENV_VAR as t, readPreflightPayload as u };
87
+ export { preflightEnv as a, platformVariableReaderText as i, containerEnvVarName as n, preflightEnvVarName as o, deserializeContainers as r, readPreflightPayload as s, containerEnv as t };
124
88
 
125
- //# sourceMappingURL=preflight-transport-DJjTWvyH-CEJ9WlaN.mjs.map
89
+ //# sourceMappingURL=preflight-transport-C7_3abXW-Bza_hn9G.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight-transport-C7_3abXW-Bza_hn9G.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/preflight-transport-C7_3abXW.mjs"],"sourcesContent":["//#region src/container-transport.ts\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PRISMA_CLOUD': uppercased, every non-alphanumeric run replaced by one underscore. */\nfunction envVarSafeExtensionId(extensionId) {\n\treturn extensionId.toUpperCase().replace(/[^A-Z0-9]+/g, \"_\").replace(/^_+|_+$/g, \"\");\n}\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_CONTAINER_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction containerEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_CONTAINER_${envVarSafeExtensionId(extensionId)}`;\n}\nfunction collisionError(a, b, varName) {\n\treturn /* @__PURE__ */ new Error(`Extension ids \"${a}\" and \"${b}\" both map to the container transport variable \"${varName}\" — rename one of the extensions.`);\n}\nfunction emptySerializeError(extensionId) {\n\treturn /* @__PURE__ */ new Error(`Extension \"${extensionId}\"'s container instance serialized to an empty string — ContainerInstance.serialize() must return a non-empty string.`);\n}\n/** The env entries the CLI sets on the alchemy process: `{ [containerEnvVarName(id)]: instance.serialize() }` for every resolved instance. */\nfunction containerEnv(instances) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, instance] of instances) {\n\t\tconst varName = containerEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw collisionError(owner, extensionId, varName);\n\t\townerByVarName.set(varName, extensionId);\n\t\tconst serialized = instance.serialize();\n\t\tif (serialized.length === 0) throw emptySerializeError(extensionId);\n\t\tenv[varName] = serialized;\n\t}\n\treturn env;\n}\n/**\n* The alchemy-process side: for each extension with a container descriptor\n* whose var is present in `env`, call its deserialize. Absent var → no entry.\n*/\nfunction deserializeContainers(extensions, env) {\n\tconst instances = /* @__PURE__ */ new Map();\n\tfor (const extension of extensions) {\n\t\tconst descriptor = extension.container;\n\t\tif (descriptor === void 0) continue;\n\t\tconst serialized = env[containerEnvVarName(extension.id)];\n\t\tif (serialized === void 0) continue;\n\t\tinstances.set(extension.id, descriptor.deserialize(serialized));\n\t}\n\treturn instances;\n}\n//#endregion\n//#region src/preflight-transport.ts\n/**\n* Carries an extension's preflight payload from the CLI process to the\n* alchemy child (which re-imports the config from scratch) — one env var per\n* extension, same channel as containers (container-transport.ts), filled by\n* whichever preflight the run executed: the deploy preflight or the local\n* target's dev preflight. The framework never reads the contents, so an\n* extension that implements both must tell its own payload kinds apart.\n* Payloads carry metadata only, never secret values: the child's environment\n* is not a secret store.\n*/\n/** '@prisma/composer-prisma-cloud' → 'PRISMA_COMPOSER_PREFLIGHT_PRISMA_COMPOSER_PRISMA_CLOUD' */\nfunction preflightEnvVarName(extensionId) {\n\treturn `PRISMA_COMPOSER_PREFLIGHT_${envVarSafeExtensionId(extensionId)}`;\n}\n/** The env entries the CLI sets on the alchemy process: `{ [preflightEnvVarName(id)]: payload }` for every extension whose preflight returned one. */\nfunction preflightEnv(payloads) {\n\tconst env = {};\n\tconst ownerByVarName = /* @__PURE__ */ new Map();\n\tfor (const [extensionId, payload] of payloads) {\n\t\tif (payload.length === 0) continue;\n\t\tconst varName = preflightEnvVarName(extensionId);\n\t\tconst owner = ownerByVarName.get(varName);\n\t\tif (owner !== void 0) throw new Error(`Extension ids \"${owner}\" and \"${extensionId}\" both use the environment variable \"${varName}\". Rename one of the extensions.`);\n\t\townerByVarName.set(varName, extensionId);\n\t\tenv[varName] = payload;\n\t}\n\treturn env;\n}\n/** The alchemy-process side: the payload this extension's own preflight wrote, or `undefined` when it wrote none (or when nothing ran a preflight at all). */\nfunction readPreflightPayload(extensionId, env) {\n\tconst payload = env[preflightEnvVarName(extensionId)];\n\treturn payload === void 0 || payload.length === 0 ? void 0 : payload;\n}\n/** One reader as the deploy prints it, for example `read by service \"shop.email\", field \"apiKey\"`. */\nfunction platformVariableReaderText(reader) {\n\tswitch (reader.kind) {\n\t\tcase \"field\": return `read by service \"${reader.service}\", field \"${reader.path === \"\" ? \"(root)\" : reader.path}\"`;\n\t\tcase \"unread\": return `named by resource \"${reader.node}\", read by no service`;\n\t}\n}\n//#endregion\nexport { containerEnv as a, readPreflightPayload as i, preflightEnv as n, containerEnvVarName as o, preflightEnvVarName as r, deserializeContainers as s, platformVariableReaderText as t };\n\n//# sourceMappingURL=preflight-transport-C7_3abXW.mjs.map"],"mappings":";;AAEA,SAAS,sBAAsB,aAAa;CAC3C,OAAO,YAAY,YAAY,CAAC,CAAC,QAAQ,eAAe,GAAG,CAAC,CAAC,QAAQ,YAAY,EAAE;AACpF;;AAEA,SAAS,oBAAoB,aAAa;CACzC,OAAO,6BAA6B,sBAAsB,WAAW;A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xC,IAAI,UAAU,KAAK,GAAG,MAAM,IAAI,MAAM,kBAAkB,MAAM,SAAS,YAAY,uCAAuC,QAAQ,iCAAiC;EACnK,eAAe,IAAI,SAAS,WAAW;EACvC,IAAI,WAAW;CAChB;CACA,OAAO;AACR;;AAEA,SAAS,qBAAqB,aAAa,KAAK;CAC/C,MAAM,UAAU,IAAI,oBAAoB,WAAW;CACnD,OAAO,YAAY,KAAK,KAAK,QAAQ,WAAW,IAAI,KAAK,IAAI;AAC9D;;AAEA,SAAS,2BAA2B,QAAQ;CAC3C,QAAQ,OAAO,MAAf;EACC,KAAK,SAAS,OAAO,oBAAoB,OAAO,QAAQ,YAAY,OAAO,SAAS,KAAK,WAAW,OAAO,KAAK;EAChH,KAAK,UAAU,OAAO,sBAAsB,OAAO,KAAK;CACzD;AACD"}
@@ -1,8 +1,9 @@
1
1
  import { Rt as CliStructuredError } from "./graph-types-Bzj1fahC-C8rOVj0c.mjs";
2
- import { J as PrismaAppConfig } from "./app-config-CxdIiCvU-7vQWECm1.mjs";
3
- import "./config-BcT6edff.mjs";
4
- import "./deploy-D7NHGXag.mjs";
5
- import "./deployment-summary-p88NV5m5-3Ga91LRH.mjs";
2
+ import { q as PrismaAppConfig } from "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
3
+ import "./config-BmRE_eTa.mjs";
4
+ import "./deploy-BW_F4Y9W.mjs";
5
+ import "./deployment-summary-6LgQDUuu-DtCvw9UQ.mjs";
6
+ import "./converge-in-process-BBBeood8-C7VG5b35.mjs";
6
7
  import "./index-B8s0bLZY.mjs";
7
8
  //#region ../../0-framework/0-foundation/foundation/dist/result.d.mts
8
9
  //#region src/result.d.ts
@@ -32,7 +33,7 @@ interface NotOk<F> {
32
33
  */
33
34
  type Result<T, F> = Ok<T> | NotOk<F>;
34
35
  //#endregion
35
- //#region ../../0-framework/3-tooling/cli/dist/dev-DDe8SH4o.d.mts
36
+ //#region ../../0-framework/3-tooling/cli/dist/redaction-CIaE4m9U.d.mts
36
37
  //#region src/composer-config.d.ts
37
38
  /** Composer's configuration and the `prisma.config.ts` that declares it. */
38
39
  interface ComposerConfigSource {
@@ -187,4 +188,4 @@ interface DevSession {
187
188
  declare function dev(input: DevInput): Promise<Result<DevSession, CliStructuredError>>;
188
189
  //#endregion
189
190
  export { ExecutionDiagnostics as a, executionDiagnostics as c, Result as d, DevSession as i, NotOk as l, DevEvent as n, ServiceEndpoint as o, DevInput as r, dev as s, ComposerConfigSource as t, Ok as u };
190
- //# sourceMappingURL=redaction-CqdeMBKw-BECjU4HR.d.mts.map
191
+ //# sourceMappingURL=redaction-CIaE4m9U-DJGrkcn3.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redaction-CIaE4m9U-DJGrkcn3.d.mts","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.d.mts","../../../0-framework/3-tooling/cli/dist/redaction-CIaE4m9U.d.mts"],"mappings":";;;;;;;;;;;;UAIU,GAAG;WACF;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAKQ,MAAM;WACL;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KAQZ,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;;UCfxB;;WAEC,OAAO;;WAEP;;;;;;UAuFD;WACC;WACA;;WAEA;;;;;;;;;;UA8CD;;;WAGC;;;;WAIA;WACA;WACA;WACA;;;;;;iBAMM,qBAAqB,GAAG,qBAAqB;;;KAGzD;;;WAGM;WACA,oBAAoB;;WAEpB;WACA;;;;WAIA;WACA;;WAEA;WACA;;;;WAIA;WACA;;;;WAIA;WACA;;;;WAIA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;WACA;;;;WAIA;WACA;WACA;;;;WAIA;WACA;WACA;;WAEA;;;;WAIA;WACA;;WAEA;;UAED;;;;WAIC,QAAQ;;WAER;WACA;;WAEA;;WAEA;;;;;;WAMA;WACA;WACA,YAAY,OAAO;;;;;UAKpB;;WAEC,oBAAoB;;;EAG7B,QAAQ;;WAEC,QAAQ;;iBAEF,IAAI,OAAO,WAAW,QAAQ,OAAO,YAAY"}
@@ -1,5 +1,6 @@
1
1
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
- //#region ../../0-framework/3-tooling/cli/dist/redaction-C-NnlVUh.mjs
2
+ import { inspect } from "node:util";
3
+ //#region ../../0-framework/3-tooling/cli/dist/redaction-CjMYXtGp.mjs
3
4
  const REDACTED = "[redacted]";
4
5
  /** Env var names whose values are credentials: the service token, preflight payloads, and the usual secret spellings. */
5
6
  const SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$|^PRISMA_COMPOSER_PREFLIGHT_/i;
@@ -11,17 +12,26 @@ const SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|AP
11
12
  function credentialLookingValues(variables) {
12
13
  return Object.entries(variables).flatMap(([name, value]) => SECRET_ENV_NAME.test(name) && typeof value === "string" && value.length >= 8 ? [value] : []);
13
14
  }
15
+ /** `value` as it appears inside a string that `JSON.stringify` or `util.inspect` printed, where a newline, quote or backslash is escaped. */
16
+ function escapedForms(value) {
17
+ return [
18
+ value,
19
+ JSON.stringify(value).slice(1, -1),
20
+ inspect(value).slice(1, -1)
21
+ ];
22
+ }
14
23
  /**
15
- * Finds every secret in a text: one regular expression for all of them, built once. A match
16
- * is the span of the longest secret that starts at a position, and spans that overlap are
17
- * merged, so two overlapping secrets are hidden whole.
24
+ * Finds every secret in a text, as written or as `JSON.stringify` and `util.format` escape it:
25
+ * one regular expression for all of them, built once. A match is the span of the longest
26
+ * secret that starts at a position, and spans that overlap are merged, so two overlapping
27
+ * secrets are hidden whole.
18
28
  */
19
29
  var SecretMatcher = class {
20
30
  starts;
21
31
  prefixes = /* @__PURE__ */ new Set();
22
32
  longestPrefix;
23
33
  constructor(values) {
24
- const sorted = [...new Set(values)].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);
34
+ const sorted = [...new Set([...values].flatMap(escapedForms))].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);
25
35
  this.starts = sorted.length === 0 ? void 0 : new RegExp(`(?=(${sorted.map((value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")}))`, "g");
26
36
  for (const value of sorted) for (let length = 1; length < value.length; length++) this.prefixes.add(value.slice(0, length));
27
37
  this.longestPrefix = Math.max(0, (sorted[0]?.length ?? 0) - 1);
@@ -258,6 +268,7 @@ function redactSummary(summary, redaction) {
258
268
  if (summary === void 0) return void 0;
259
269
  return {
260
270
  app: summary.app,
271
+ findings: { unset: summary.findings.unset.map((variable) => redactUnsetPlatformVariable(variable, redaction)) },
261
272
  nodes: summary.nodes.map((node) => ({
262
273
  address: node.address,
263
274
  entities: node.entities.map((entity) => ({
@@ -313,4 +324,4 @@ var StreamRedactor = class {
313
324
  //#endregion
314
325
  export { redactDevEvent as a, redactThrown as c, redactCredentialLooking as i, redactUnsetPlatformVariable as l, StreamRedactor as n, redactError as o, credentialLookingValues as r, redactSummary as s, SecretRedaction as t, valuesUnderSecretsKeys as u };
315
326
 
316
- //# sourceMappingURL=redaction-C-NnlVUh-B1nJc6rb.mjs.map
327
+ //# sourceMappingURL=redaction-CjMYXtGp-CEQ5z1PK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redaction-CjMYXtGp-CEQ5z1PK.mjs","names":["#names"],"sources":["../../../0-framework/3-tooling/cli/dist/redaction-CjMYXtGp.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\nimport { inspect } from \"node:util\";\n//#region src/redaction.ts\nconst REDACTED = \"[redacted]\";\n/** Env var names whose values are credentials: the service token, preflight payloads, and the usual secret spellings. */\nconst SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$|^PRISMA_COMPOSER_PREFLIGHT_/i;\n/**\n* The credential-looking values in `variables`: text of eight characters or more under a name\n* that looks like a credential's. The length limit keeps a one-letter placeholder from blanking\n* every matching letter.\n*/\nfunction credentialLookingValues(variables) {\n\treturn Object.entries(variables).flatMap(([name, value]) => SECRET_ENV_NAME.test(name) && typeof value === \"string\" && value.length >= 8 ? [value] : []);\n}\n/** `value` as it appears inside a string that `JSON.stringify` or `util.inspect` printed, where a newline, quote or backslash is escaped. */\nfunction escapedForms(value) {\n\treturn [\n\t\tvalue,\n\t\tJSON.stringify(value).slice(1, -1),\n\t\tinspect(value).slice(1, -1)\n\t];\n}\n/**\n* Finds every secret in a text, as written or as `JSON.stringify` and `util.format` escape it:\n* one regular expression for all of them, built once. A match is the span of the longest\n* secret that starts at a position, and spans that overlap are merged, so two overlapping\n* secrets are hidden whole.\n*/\nvar SecretMatcher = class {\n\tstarts;\n\tprefixes = /* @__PURE__ */ new Set();\n\tlongestPrefix;\n\tconstructor(values) {\n\t\tconst sorted = [...new Set([...values].flatMap(escapedForms))].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);\n\t\tthis.starts = sorted.length === 0 ? void 0 : new RegExp(`(?=(${sorted.map((value) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\")}))`, \"g\");\n\t\tfor (const value of sorted) for (let length = 1; length < value.length; length++) this.prefixes.add(value.slice(0, length));\n\t\tthis.longestPrefix = Math.max(0, (sorted[0]?.length ?? 0) - 1);\n\t}\n\t/** The merged spans of every secret in `text`, in order, as `[start, end)`. */\n\tspans(text) {\n\t\tconst spans = [];\n\t\tif (this.starts === void 0) return spans;\n\t\tfor (const match of text.matchAll(this.starts)) {\n\t\t\tconst start = match.index;\n\t\t\tconst end = start + (match[1]?.length ?? 0);\n\t\t\tconst last = spans.at(-1);\n\t\t\tif (last !== void 0 && start < last[1]) last[1] = Math.max(last[1], end);\n\t\t\telse spans.push([start, end]);\n\t\t}\n\t\treturn spans;\n\t}\n\t/** The length of the longest end of `text` that is the start, not the whole, of a secret. */\n\tstartOfSecretAtEnd(text) {\n\t\tfor (let length = Math.min(this.longestPrefix, text.length); length > 0; length--) if (this.prefixes.has(text.slice(text.length - length))) return length;\n\t\treturn 0;\n\t}\n\t/** `text` with each span replaced by `[redacted]`. */\n\tredact(text) {\n\t\tlet out = \"\";\n\t\tlet from = 0;\n\t\tfor (const [start, end] of this.spans(text)) {\n\t\t\tout += text.slice(from, start) + REDACTED;\n\t\t\tfrom = end;\n\t\t}\n\t\treturn from === 0 ? text : out + text.slice(from);\n\t}\n};\n/** `text` with each value in `values` replaced by `[redacted]`, at any length; an empty one is skipped. Overlapping values are hidden whole. */\nfunction redactValues(text, values) {\n\treturn new SecretMatcher(values).redact(text);\n}\n/** `text` with bearer and basic tokens, JWTs, the password in a URL, and `token=…`-style pairs replaced by `[redacted]`. The `<value>` placeholder in a printed command is kept. */\nfunction redactShapes(text) {\n\treturn text.replace(/\\b(Bearer|Basic)\\s+[\\w.~+/=-]+/gi, `$1 ${REDACTED}`).replace(/\\beyJ[\\w-]+\\.[\\w-]+\\.[\\w-]*/g, REDACTED).replace(/(\\b[a-z][\\w+.-]*:\\/\\/[^\\s:/@]*:)[^\\s/@]+@/gi, `$1${REDACTED}@`).replace(/\\b((?:[\\w-]*[_-])?(?:token|secret|password|passwd|api[_-]?key|access[_-]?key|private[_-]?key)[\"']?\\s*[:=]\\s*[\"']?)(?!<value>(?:[\\s\"',;&]|$))[^\\s\"',;&]+/gi, `$1${REDACTED}`);\n}\n/**\n* `text` with the credential-looking values of `env` and the credential shapes replaced by\n* `[redacted]`. For a process that has no `SecretRedaction`; `SecretRedaction.redact` hides\n* the known secrets too.\n*/\nfunction redactCredentialLooking(text, env) {\n\treturn redactShapes(redactValues(text, credentialLookingValues(env)));\n}\n/**\n* The known secrets of one command: the values under the secrets keys the graph names, in the app\n* secrets and the app configuration (ADR-0062). The app configuration file must not hold any of them.\n*/\nvar KnownSecrets = class {\n\t#names = /* @__PURE__ */ new Map();\n\tconstructor(secrets = []) {\n\t\tthis.add(secrets);\n\t}\n\t/** Adds each secret whose value is not empty. A value already known keeps its first name. */\n\tadd(secrets) {\n\t\tfor (const { name, value } of secrets) if (value.length > 0 && !this.#names.has(value)) this.#names.set(value, name);\n\t}\n\tvalues() {\n\t\treturn new Set(this.#names.keys());\n\t}\n\t/**\n\t* The name of a known secret `text` holds, or undefined. A secret of\n\t* `MIN_SECRET_LENGTH_INSIDE_A_VALUE` characters or more is found anywhere in `text`; a shorter\n\t* one only when it is all of `text`.\n\t*/\n\tnameIn(text) {\n\t\tfor (const [value, name] of this.#names) if (value.length >= 8 ? text.includes(value) : text === value) return name;\n\t}\n};\n/**\n* What one command hides from everything it prints, returns or reports (ADR-0062): its known\n* secrets, and the credential-looking values, which only look like secrets by the name of the\n* variable they are under. It starts with the credential-looking values of the process\n* environment.\n*/\nvar SecretRedaction = class {\n\tknownSecrets = new KnownSecrets();\n\tcredentialLooking = /* @__PURE__ */ new Set();\n\tmatcher;\n\tconstructor(env) {\n\t\tthis.addCredentialLookingValues(credentialLookingValues(env));\n\t}\n\taddKnownSecrets(secrets) {\n\t\tthis.knownSecrets.add(secrets);\n\t}\n\taddCredentialLookingValues(values) {\n\t\tfor (const value of values) if (value.length > 0) this.credentialLooking.add(value);\n\t}\n\t/** The known secrets and the credential-looking values, longest first. */\n\tallValues() {\n\t\treturn [.../* @__PURE__ */ new Set([...this.knownSecrets.values(), ...this.credentialLooking])].sort((a, b) => b.length - a.length);\n\t}\n\t/** `text` with every known secret and credential-looking value replaced by `[redacted]` at any length, then bearer tokens, JWTs, URL passwords and `token=…` pairs. */\n\tredact(text) {\n\t\tconst size = this.knownSecrets.values().size + this.credentialLooking.size;\n\t\tif (this.matcher?.size !== size) this.matcher = {\n\t\t\tsize,\n\t\t\tmatcher: new SecretMatcher(this.allValues())\n\t\t};\n\t\treturn redactShapes(this.matcher.matcher.redact(text));\n\t}\n};\n/** The text under each name in `secretsKeys`, in the app configuration and in the app secrets, at any length. */\nfunction valuesUnderSecretsKeys(configuration, secrets, secretsKeys) {\n\treturn secretsKeys.flatMap((name) => [configuration[name], secrets[name]].flatMap((value) => typeof value === \"string\" ? [{\n\t\tname,\n\t\tvalue\n\t}] : []));\n}\nfunction redactReader(reader, redaction) {\n\tswitch (reader.kind) {\n\t\tcase \"field\": return {\n\t\t\tkind: \"field\",\n\t\t\tservice: redaction.redact(reader.service),\n\t\t\tpath: redaction.redact(reader.path)\n\t\t};\n\t\tcase \"unread\": return {\n\t\t\tkind: \"unread\",\n\t\t\tnode: redaction.redact(reader.node)\n\t\t};\n\t}\n}\n/** `variable` with every text in it redacted: its name, each reader's names and each command. */\nfunction redactUnsetPlatformVariable(variable, redaction) {\n\treturn {\n\t\tname: redaction.redact(variable.name),\n\t\treaders: variable.readers.map((reader) => redactReader(reader, redaction)),\n\t\tcommands: variable.commands.map((command) => redaction.redact(command))\n\t};\n}\nfunction redactData(value, redaction) {\n\tif (typeof value === \"string\") return redaction.redact(value);\n\tif (Array.isArray(value)) return value.map((member) => redactData(member, redaction));\n\tif (typeof value === \"object\" && value !== null && Object.getPrototypeOf(value) === Object.prototype) return Object.fromEntries(Object.entries(value).map(([key, member]) => [key, redactData(member, redaction)]));\n\treturn value;\n}\n/**\n* `error` with every value `redaction` hides removed from its summary, `why`, `fix` and every string in\n* its `meta`. The code, severity, `where` and docs link are kept. The cause is dropped, because\n* it holds the same text unredacted and a renderer may print it.\n*/\nfunction redactError(error, redaction) {\n\treturn new CliStructuredError(error.code, redaction.redact(error.message), {\n\t\tseverity: error.severity,\n\t\t...error.why === void 0 ? {} : { why: redaction.redact(error.why) },\n\t\t...error.fix === void 0 ? {} : { fix: redaction.redact(error.fix) },\n\t\t...error.where === void 0 ? {} : { where: error.where },\n\t\t...error.meta === void 0 ? {} : { meta: Object.fromEntries(Object.entries(error.meta).map(([key, value]) => [key, redactData(value, redaction)])) },\n\t\t...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl }\n\t});\n}\nfunction setOwn(error, name, value) {\n\tObject.defineProperty(error, name, {\n\t\tvalue,\n\t\twritable: true,\n\t\tconfigurable: true\n\t});\n}\nconst UNPRINTABLE = \"A value was thrown that cannot be turned into text.\";\nfunction safeString(value) {\n\ttry {\n\t\treturn String(value);\n\t} catch {\n\t\ttry {\n\t\t\treturn Object.prototype.toString.call(value);\n\t\t} catch {\n\t\t\treturn UNPRINTABLE;\n\t\t}\n\t}\n}\n/**\n* The error to rethrow in place of a thrown defect, with every secret removed from its message\n* and stack, and from those of each error in its `cause` chain and in an `AggregateError`'s\n* `errors`. A cause that is text or plain data becomes a redacted copy. Each error is redacted\n* in place where it can be. One whose properties cannot change, such as a frozen error, is\n* replaced by a new error with the redacted message, stack and cause. A thrown value that is not\n* an `Error` becomes an `Error` whose message is its redacted text. Never throws: when reading\n* the error fails, the result is a new `Error` holding the redacted text of what was thrown.\n*/\nfunction redactThrown(thrown, redaction) {\n\ttry {\n\t\treturn thrown instanceof Error ? redactErrorChain(thrown, redaction, /* @__PURE__ */ new Map()) : new Error(redaction.redact(safeString(thrown)));\n\t} catch {\n\t\treturn new Error(redaction.redact(safeString(thrown)));\n\t}\n}\nfunction redactErrorChain(error, redaction, seen) {\n\tconst done = seen.get(error);\n\tif (done !== void 0) return done;\n\tseen.set(error, error);\n\tconst message = redaction.redact(typeof error.message === \"string\" ? error.message : safeString(error.message));\n\tconst stack = typeof error.stack === \"string\" ? redaction.redact(error.stack) : void 0;\n\tconst cause = error.cause instanceof Error ? redactErrorChain(error.cause, redaction, seen) : redactData(error.cause, redaction);\n\tconst members = error instanceof AggregateError ? error.errors.map((member) => member instanceof Error ? redactErrorChain(member, redaction, seen) : redactData(member, redaction)) : void 0;\n\ttry {\n\t\tsetOwn(error, \"message\", message);\n\t\tif (stack !== void 0) setOwn(error, \"stack\", stack);\n\t\tif (error.cause !== void 0) setOwn(error, \"cause\", cause);\n\t\tif (members !== void 0) setOwn(error, \"errors\", members);\n\t\treturn error;\n\t} catch {\n\t\tconst options = cause === void 0 ? void 0 : { cause };\n\t\tconst copy = members === void 0 ? new Error(message, options) : new AggregateError(members, message, options);\n\t\tcopy.name = error.name;\n\t\tsetOwn(copy, \"stack\", stack ?? `${error.name}: ${message}`);\n\t\tseen.set(error, copy);\n\t\treturn copy;\n\t}\n}\n/** `event` with every value `redaction` hides removed from the text it carries: a message, or a dev server's output line. */\nfunction redactDevEvent(event, redaction) {\n\tswitch (event.kind) {\n\t\tcase \"target-warning\":\n\t\tcase \"rebuild-failed\":\n\t\tcase \"watch-error\":\n\t\tcase \"stop-error\": return {\n\t\t\t...event,\n\t\t\tmessage: redaction.redact(event.message)\n\t\t};\n\t\tcase \"dev-server-output\": return {\n\t\t\t...event,\n\t\t\tline: redaction.redact(event.line)\n\t\t};\n\t\tdefault: return event;\n\t}\n}\n/** `summary` with every value `redaction` hides removed from each entity's id, url and details. */\nfunction redactSummary(summary, redaction) {\n\tif (summary === void 0) return void 0;\n\treturn {\n\t\tapp: summary.app,\n\t\tfindings: { unset: summary.findings.unset.map((variable) => redactUnsetPlatformVariable(variable, redaction)) },\n\t\tnodes: summary.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities.map((entity) => ({\n\t\t\t\t...entity,\n\t\t\t\tid: redaction.redact(entity.id),\n\t\t\t\t...entity.url === void 0 ? {} : { url: redaction.redact(entity.url) },\n\t\t\t\t...entity.details === void 0 ? {} : { details: Object.fromEntries(Object.entries(entity.details).map(([key, value]) => [key, redaction.redact(value)])) }\n\t\t\t}))\n\t\t}))\n\t};\n}\nfunction isHighSurrogate(code) {\n\treturn code >= 55296 && code <= 56319;\n}\n/**\n* Redacts a stream of text chunk by chunk: every value in `values` becomes `[redacted]`, and\n* overlapping values are hidden whole. It holds back only the end of the text that could still\n* be part of a value: the longest end that could start one, or a match that a later value could\n* extend. So a value split across two chunks is still replaced, and text that cannot start one,\n* such as a prompt, is returned at once. It never splits a surrogate pair. `push` returns the\n* text that is ready; `end` returns the rest.\n*/\nvar StreamRedactor = class {\n\theld = \"\";\n\tmatcher;\n\tconstructor(values) {\n\t\tthis.matcher = new SecretMatcher(values);\n\t}\n\tpush(chunk) {\n\t\tconst text = this.held + chunk;\n\t\tconst cut = text.length - this.matcher.startOfSecretAtEnd(text);\n\t\tlet out = \"\";\n\t\tlet from = 0;\n\t\tlet ready = cut;\n\t\tfor (const [start, end] of this.matcher.spans(text)) {\n\t\t\tif (end > cut) {\n\t\t\t\tready = Math.min(cut, start);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tout += text.slice(from, start) + REDACTED;\n\t\t\tfrom = end;\n\t\t}\n\t\tif (ready > from && ready < text.length && isHighSurrogate(text.charCodeAt(ready - 1))) ready -= 1;\n\t\tthis.held = text.slice(ready);\n\t\treturn out + text.slice(from, ready);\n\t}\n\tend() {\n\t\tconst text = this.held;\n\t\tthis.held = \"\";\n\t\treturn this.matcher.redact(text);\n\t}\n};\n//#endregion\nexport { redactCredentialLooking as a, redactSummary as c, valuesUnderSecretsKeys as d, credentialLookingValues as i, redactThrown as l, SecretRedaction as n, redactDevEvent as o, StreamRedactor as r, redactError as s, KnownSecrets as t, redactUnsetPlatformVariable as u };\n\n//# sourceMappingURL=redaction-CjMYXtGp.mjs.map"],"mappings":";;;AAGA,MAAM,WAAW;;AAEjB,MAAM,kBAAkB;;;;;;AAMxB,SAAS,wBAAwB,WAAW;CAC3C,OAAO,OAAO,QAAQ,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,WAAW,gBAAgB,KAAK,IAAI,KAAK,OAAO,UAAU,YAAY,MAAM,UAAU,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;AACxJ;;AAEA,SAAS,aAAa,OAAO;CAC5B,OAAO;EACN;EACA,KAAK,UAAU,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;EACjC,QAAQ,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;CAC3B;AACD;;;;;;;AAO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AE;CACH;AACD;AACA,SAAS,gBAAgB,MAAM;CAC9B,OAAO,QAAQ,SAAS,QAAQ;AACjC;;;;;;;;;AASA,IAAI,iBAAiB,MAAM;CAC1B,OAAO;CACP;CACA,YAAY,QAAQ;EACnB,KAAK,UAAU,IAAI,cAAc,MAAM;CACxC;CACA,KAAK,OAAO;EACX,MAAM,OAAO,KAAK,OAAO;EACzB,MAAM,MAAM,KAAK,SAAS,KAAK,QAAQ,mBAAmB,IAAI;EAC9D,IAAI,MAAM;EACV,IAAI,OAAO;EACX,IAAI,QAAQ;EACZ,KAAK,MAAM,CAAC,OAAO,QAAQ,KAAK,QAAQ,MAAM,IAAI,GAAG;GACpD,IAAI,MAAM,KAAK;IACd,QAAQ,KAAK,IAAI,KAAK,KAAK;IAC3B;GACD;GACA,OAAO,KAAK,MAAM,MAAM,KAAK,IAAI;GACjC,OAAO;EACR;EACA,IAAI,QAAQ,QAAQ,QAAQ,KAAK,UAAU,gBAAgB,KAAK,WAAW,QAAQ,CAAC,CAAC,GAAG,SAAS;EACjG,KAAK,OAAO,KAAK,MAAM,KAAK;EAC5B,OAAO,MAAM,KAAK,MAAM,MAAM,KAAK;CACpC;CACA,MAAM;EACL,MAAM,OAAO,KAAK;EAClB,KAAK,OAAO;EACZ,OAAO,KAAK,QAAQ,OAAO,IAAI;CAChC;AACD"}
package/dist/report.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { v as DeploymentResult } from "./app-config-CxdIiCvU-7vQWECm1.mjs";
2
- import "./deploy-D7NHGXag.mjs";
3
- import { r as captureEngineFailure } from "./deployment-summary-p88NV5m5-3Ga91LRH.mjs";
1
+ import { v as DeploymentResult } from "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
2
+ import "./deploy-BW_F4Y9W.mjs";
3
+ import { r as captureEngineFailure } from "./deployment-summary-6LgQDUuu-DtCvw9UQ.mjs";
4
4
  //#region ../../0-framework/3-tooling/cli/dist/report.d.mts
5
5
  //#region src/render-deployment.d.ts
6
6
  /**
package/dist/report.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as platformVariableReaderText } from "./preflight-transport-DJjTWvyH-CEJ9WlaN.mjs";
2
- import { n as captureEngineFailure, o as writeDeploymentSummaryFile } from "./deployment-summary-B6rYxEZe-E4IIcngK.mjs";
1
+ import { i as platformVariableReaderText } from "./preflight-transport-C7_3abXW-Bza_hn9G.mjs";
2
+ import { c as writeDeploymentSummaryFile, r as captureEngineFailure } from "./deployment-summary-YP7eMPJI-CQsj7BHh.mjs";
3
3
  //#region ../../0-framework/3-tooling/cli/dist/unset-platform-variables-B0aMhHaR.mjs
4
4
  const variableLines = (variable) => [variable.readers.length === 0 ? ` - ${variable.name}` : ` - ${variable.name} (${variable.readers.map(platformVariableReaderText).join("; ")})`, ...variable.commands.map((command) => ` ${command}`)];
5
5
  function unsetPlatformVariablesText(unset) {
@@ -1 +1 @@
1
- {"version":3,"file":"report.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/unset-platform-variables-B0aMhHaR.mjs","../../../0-framework/3-tooling/cli/dist/report.mjs"],"sourcesContent":["import { platformVariableReaderText } from \"@internal/core/config\";\n//#region src/unset-platform-variables.ts\nconst variableLines = (variable) => [variable.readers.length === 0 ? ` - ${variable.name}` : ` - ${variable.name} (${variable.readers.map(platformVariableReaderText).join(\"; \")})`, ...variable.commands.map((command) => ` ${command}`)];\nfunction unsetPlatformVariablesText(unset) {\n\tif (unset.length === 0) return void 0;\n\treturn [\"Platform variables with no value:\", ...unset.flatMap(variableLines)].join(\"\\n\");\n}\n//#endregion\nexport { unsetPlatformVariablesText as t };\n\n//# sourceMappingURL=unset-platform-variables-B0aMhHaR.mjs.map","import { n as captureEngineFailure, o as writeDeploymentSummaryFile } from \"./deployment-summary-B6rYxEZe.mjs\";\nimport { t as unsetPlatformVariablesText } from \"./unset-platform-variables-B0aMhHaR.mjs\";\n//#region src/render-deployment.ts\n/** Gap between the deepest tree label and the entity column. */\nconst LABEL_GAP = 3;\nconst emptyNode = (segment) => ({\n\tsegment,\n\tchildren: /* @__PURE__ */ new Map()\n});\n/** Builds the address tree, splitting each dot-address into its segments. */\nfunction buildTree(nodes) {\n\tconst root = emptyNode(\"\");\n\tfor (const deployed of nodes) {\n\t\tlet node = root;\n\t\tfor (const segment of deployed.address.split(\".\")) {\n\t\t\tlet child = node.children.get(segment);\n\t\t\tif (child === void 0) {\n\t\t\t\tchild = emptyNode(segment);\n\t\t\t\tnode.children.set(segment, child);\n\t\t\t}\n\t\t\tnode = child;\n\t\t}\n\t\tnode.deployed = deployed;\n\t}\n\treturn root;\n}\n/** Flattens the tree to rows in address order, drawing the box guides. */\nfunction toRows(node, guides, rows) {\n\tconst children = Array.from(node.children.values());\n\tchildren.forEach((child, index) => {\n\t\tconst isLast = index === children.length - 1;\n\t\trows.push({\n\t\t\tlabel: `${guides}${isLast ? \"└─ \" : \"├─ \"}${child.segment}`,\n\t\t\tcontinuation: `${guides}${isLast ? \" \" : \"│ \"}`,\n\t\t\tdeployed: child.deployed\n\t\t});\n\t\ttoRows(child, `${guides}${isLast ? \" \" : \"│ \"}`, rows);\n\t});\n}\n/** `kind id` — the one line an entity gets. */\nconst entityLine = (entity) => `${entity.kind} ${entity.id}`;\n/** Pads `prefix` out to `width`, so every entity starts in the same column. */\nconst pad = (prefix, width) => prefix.padEnd(width, \" \");\n/**\n* Renders a deploy's result as the app's own topology. Pure — returns the\n* string; the caller prints.\n*/\nfunction renderDeployment(result) {\n\tconst rows = [];\n\tconst tree = buildTree(result.nodes);\n\ttoRows(tree.children.get(result.app) ?? tree, \"\", rows);\n\tconst column = Math.max(0, ...rows.map((row) => row.label.length)) + LABEL_GAP;\n\tconst lines = [result.app];\n\tfor (const row of rows) {\n\t\tif (row.deployed === void 0) {\n\t\t\tlines.push(row.label);\n\t\t\tcontinue;\n\t\t}\n\t\tif (row.deployed.entities.length === 0) {\n\t\t\tlines.push(`${pad(row.label, column)}(no entities reported)`);\n\t\t\tcontinue;\n\t\t}\n\t\trow.deployed.entities.forEach((entity, index) => {\n\t\t\tconst prefix = index === 0 ? row.label : row.continuation;\n\t\t\tlines.push(`${pad(prefix, column)}${entityLine(entity)}`);\n\t\t\tif (entity.url !== void 0) lines.push(`${pad(row.continuation, column)}${entity.url}`);\n\t\t\tfor (const [key, value] of Object.entries(entity.details ?? {})) {\n\t\t\t\tif (value === \"\") continue;\n\t\t\t\tfor (const line of value.split(\"\\n\")) lines.push(`${pad(row.continuation, column)}${key} ${line}`);\n\t\t\t}\n\t\t});\n\t}\n\tconst unset = unsetPlatformVariablesText(result.findings.unset);\n\tif (unset !== void 0) lines.push(\"\", unset);\n\treturn lines.join(\"\\n\");\n}\n/**\n* The report hook the generated stack file wires into `LowerOptions`. Prints a\n* leading blank line so the summary separates from alchemy's own apply output,\n* then hands the result to the cross-process writer (deployment-summary.ts).\n*/\nfunction deploymentReport(result) {\n\tconsole.log(\"\");\n\tconsole.log(renderDeployment(result));\n\twriteDeploymentSummaryFile(result);\n}\n//#endregion\nexport { captureEngineFailure, deploymentReport, renderDeployment };\n\n//# sourceMappingURL=report.mjs.map"],"mappings":";;;AAEA,MAAM,iBAAiB,aAAa,CAAC,SAAS,QAAQ,WAAW,IAAI,OAAO,SAAS,SAAS,OAAO,SAAS,KAAK,KAAK,SAAS,QAAQ,IAAI,0BAA0B,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI,GAAG,SAAS,SAAS,KAAK,YAAY,OAAO,SAAS,CAAC;AAC/O,SAAS,2BAA2B,OAAO;CAC1C,IAAI,MAAM,WAAW,GAAG,OAAO,KAAK;CACpC,OAAO,CAAC,qCAAqC,GAAG,MAAM,QAAQ,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI;AACxF;;;;ACFA,MAAM,YAAY;AAClB,MAAM,aAAa,aAAa;CAC/B;CACA,0BAA0B,IAAI,IAAI;AACnC;;AAEA,SAAS,UAAU,OAAO;CACzB,MAAM,OAAO,UAAU,EAAE;CACzB,KAAK,MAAM,YAAY,OAAO;EAC7B,IAA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uB;GAC5D;EACD;EACA,IAAI,SAAS,SAAS,SAAS,QAAQ,UAAU;GAChD,MAAM,SAAS,UAAU,IAAI,IAAI,QAAQ,IAAI;GAC7C,MAAM,KAAK,GAAG,IAAI,QAAQ,MAAM,IAAI,WAAW,MAAM,GAAG;GACxD,IAAI,OAAO,QAAQ,KAAK,GAAG,MAAM,KAAK,GAAG,IAAI,IAAI,cAAc,MAAM,IAAI,OAAO,KAAK;GACrF,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,WAAW,CAAC,CAAC,GAAG;IAChE,IAAI,UAAU,IAAI;IAClB,KAAK,MAAM,QAAQ,MAAM,MAAM,IAAI,GAAG,MAAM,KAAK,GAAG,IAAI,IAAI,cAAc,MAAM,IAAI,IAAI,GAAG,MAAM;GAClG;EACD,CAAC;CACF;CACA,MAAM,QAAQ,2BAA2B,OAAO,SAAS,KAAK;CAC9D,IAAI,UAAU,KAAK,GAAG,MAAM,KAAK,IAAI,KAAK;CAC1C,OAAO,MAAM,KAAK,IAAI;AACvB;;;;;;AAMA,SAAS,iBAAiB,QAAQ;CACjC,QAAQ,IAAI,EAAE;CACd,QAAQ,IAAI,iBAAiB,MAAM,CAAC;CACpC,2BAA2B,MAAM;AAClC"}
1
+ {"version":3,"file":"report.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/unset-platform-variables-B0aMhHaR.mjs","../../../0-framework/3-tooling/cli/dist/report.mjs"],"sourcesContent":["import { platformVariableReaderText } from \"@internal/core/config\";\n//#region src/unset-platform-variables.ts\nconst variableLines = (variable) => [variable.readers.length === 0 ? ` - ${variable.name}` : ` - ${variable.name} (${variable.readers.map(platformVariableReaderText).join(\"; \")})`, ...variable.commands.map((command) => ` ${command}`)];\nfunction unsetPlatformVariablesText(unset) {\n\tif (unset.length === 0) return void 0;\n\treturn [\"Platform variables with no value:\", ...unset.flatMap(variableLines)].join(\"\\n\");\n}\n//#endregion\nexport { unsetPlatformVariablesText as t };\n\n//# sourceMappingURL=unset-platform-variables-B0aMhHaR.mjs.map","import { c as writeDeploymentSummaryFile, r as captureEngineFailure } from \"./deployment-summary-YP7eMPJI.mjs\";\nimport { t as unsetPlatformVariablesText } from \"./unset-platform-variables-B0aMhHaR.mjs\";\n//#region src/render-deployment.ts\n/** Gap between the deepest tree label and the entity column. */\nconst LABEL_GAP = 3;\nconst emptyNode = (segment) => ({\n\tsegment,\n\tchildren: /* @__PURE__ */ new Map()\n});\n/** Builds the address tree, splitting each dot-address into its segments. */\nfunction buildTree(nodes) {\n\tconst root = emptyNode(\"\");\n\tfor (const deployed of nodes) {\n\t\tlet node = root;\n\t\tfor (const segment of deployed.address.split(\".\")) {\n\t\t\tlet child = node.children.get(segment);\n\t\t\tif (child === void 0) {\n\t\t\t\tchild = emptyNode(segment);\n\t\t\t\tnode.children.set(segment, child);\n\t\t\t}\n\t\t\tnode = child;\n\t\t}\n\t\tnode.deployed = deployed;\n\t}\n\treturn root;\n}\n/** Flattens the tree to rows in address order, drawing the box guides. */\nfunction toRows(node, guides, rows) {\n\tconst children = Array.from(node.children.values());\n\tchildren.forEach((child, index) => {\n\t\tconst isLast = index === children.length - 1;\n\t\trows.push({\n\t\t\tlabel: `${guides}${isLast ? \"└─ \" : \"├─ \"}${child.segment}`,\n\t\t\tcontinuation: `${guides}${isLast ? \" \" : \"│ \"}`,\n\t\t\tdeployed: child.deployed\n\t\t});\n\t\ttoRows(child, `${guides}${isLast ? \" \" : \"│ \"}`, rows);\n\t});\n}\n/** `kind id` — the one line an entity gets. */\nconst entityLine = (entity) => `${entity.kind} ${entity.id}`;\n/** Pads `prefix` out to `width`, so every entity starts in the same column. */\nconst pad = (prefix, width) => prefix.padEnd(width, \" \");\n/**\n* Renders a deploy's result as the app's own topology. Pure — returns the\n* string; the caller prints.\n*/\nfunction renderDeployment(result) {\n\tconst rows = [];\n\tconst tree = buildTree(result.nodes);\n\ttoRows(tree.children.get(result.app) ?? tree, \"\", rows);\n\tconst column = Math.max(0, ...rows.map((row) => row.label.length)) + LABEL_GAP;\n\tconst lines = [result.app];\n\tfor (const row of rows) {\n\t\tif (row.deployed === void 0) {\n\t\t\tlines.push(row.label);\n\t\t\tcontinue;\n\t\t}\n\t\tif (row.deployed.entities.length === 0) {\n\t\t\tlines.push(`${pad(row.label, column)}(no entities reported)`);\n\t\t\tcontinue;\n\t\t}\n\t\trow.deployed.entities.forEach((entity, index) => {\n\t\t\tconst prefix = index === 0 ? row.label : row.continuation;\n\t\t\tlines.push(`${pad(prefix, column)}${entityLine(entity)}`);\n\t\t\tif (entity.url !== void 0) lines.push(`${pad(row.continuation, column)}${entity.url}`);\n\t\t\tfor (const [key, value] of Object.entries(entity.details ?? {})) {\n\t\t\t\tif (value === \"\") continue;\n\t\t\t\tfor (const line of value.split(\"\\n\")) lines.push(`${pad(row.continuation, column)}${key} ${line}`);\n\t\t\t}\n\t\t});\n\t}\n\tconst unset = unsetPlatformVariablesText(result.findings.unset);\n\tif (unset !== void 0) lines.push(\"\", unset);\n\treturn lines.join(\"\\n\");\n}\n/**\n* The report hook the generated stack file wires into `LowerOptions`. Prints a\n* leading blank line so the summary separates from alchemy's own apply output,\n* then hands the result to the cross-process writer (deployment-summary.ts).\n*/\nfunction deploymentReport(result) {\n\tconsole.log(\"\");\n\tconsole.log(renderDeployment(result));\n\twriteDeploymentSummaryFile(result);\n}\n//#endregion\nexport { captureEngineFailure, deploymentReport, renderDeployment };\n\n//# sourceMappingURL=report.mjs.map"],"mappings":";;;AAEA,MAAM,iBAAiB,aAAa,CAAC,SAAS,QAAQ,WAAW,IAAI,OAAO,SAAS,SAAS,OAAO,SAAS,KAAK,KAAK,SAAS,QAAQ,IAAI,0BAA0B,CAAC,CAAC,KAAK,IAAI,EAAE,IAAI,GAAG,SAAS,SAAS,KAAK,YAAY,OAAO,SAAS,CAAC;AAC/O,SAAS,2BAA2B,OAAO;CAC1C,IAAI,MAAM,WAAW,GAAG,OAAO,KAAK;CACpC,OAAO,CAAC,qCAAqC,GAAG,MAAM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AQ,CAAC,OAAO,GAAG;CACzB,KAAK,MAAM,OAAO,MAAM;EACvB,IAAI,IAAI,aAAa,KAAK,GAAG;GAC5B,MAAM,KAAK,IAAI,KAAK;GACpB;EACD;EACA,IAAI,IAAI,SAAS,SAAS,WAAW,GAAG;GACvC,MAAM,KAAK,GAAG,IAAI,IAAI,OAAO,MAAM,EAAE,uBAAuB;GAC5D;EACD;EACA,IAAI,SAAS,SAAS,SAAS,QAAQ,UAAU;GAChD,MAAM,SAAS,UAAU,IAAI,IAAI,QAAQ,IAAI;GAC7C,MAAM,KAAK,GAAG,IAAI,QAAQ,MAAM,IAAI,WAAW,MAAM,GAAG;GACxD,IAAI,OAAO,QAAQ,KAAK,GAAG,MAAM,KAAK,GAAG,IAAI,IAAI,cAAc,MAAM,IAAI,OAAO,KAAK;GACrF,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,WAAW,CAAC,CAAC,GAAG;IAChE,IAAI,UAAU,IAAI;IAClB,KAAK,MAAM,QAAQ,MAAM,MAAM,IAAI,GAAG,MAAM,KAAK,GAAG,IAAI,IAAI,cAAc,MAAM,IAAI,IAAI,GAAG,MAAM;GAClG;EACD,CAAC;CACF;CACA,MAAM,QAAQ,2BAA2B,OAAO,SAAS,KAAK;CAC9D,IAAI,UAAU,KAAK,GAAG,MAAM,KAAK,IAAI,KAAK;CAC1C,OAAO,MAAM,KAAK,IAAI;AACvB;;;;;;AAMA,SAAS,iBAAiB,QAAQ;CACjC,QAAQ,IAAI,EAAE;CACd,QAAQ,IAAI,iBAAiB,MAAM,CAAC;CACpC,2BAA2B,MAAM;AAClC"}
@@ -1,10 +1,10 @@
1
1
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
- import { n as StreamRedactor } from "./redaction-C-NnlVUh-B1nJc6rb.mjs";
2
+ import { n as StreamRedactor } from "./redaction-CjMYXtGp-CEQ5z1PK.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import * as path$1 from "node:path";
5
5
  import * as fs$1 from "node:fs";
6
6
  import spawn from "cross-spawn";
7
- //#region ../../0-framework/3-tooling/cli/dist/run-alchemy-CyciV8i0.mjs
7
+ //#region ../../0-framework/3-tooling/cli/dist/run-alchemy-BlYyc4Oh.mjs
8
8
  /**
9
9
  * Which Alchemy CLI runs a generated stack file: the `alchemy` that
10
10
  * `@prisma/composer` depends on, found from the app the way the stack file's
@@ -233,4 +233,4 @@ function spawnCommandLine(line, redactedValues, outputs = process) {
233
233
  //#endregion
234
234
  export { reproduceCommand as n, spawnAlchemy as r, alchemyInvocation as t };
235
235
 
236
- //# sourceMappingURL=run-alchemy-CyciV8i0-BxPAyrch.mjs.map
236
+ //# sourceMappingURL=run-alchemy-BlYyc4Oh-mIzYC4lq.mjs.map