@prisma/composer 0.39.0-dev.12 → 0.39.0-dev.14

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 (111) hide show
  1. package/dist/{app-config-DriAu5RU-C8hYpR38.d.mts → app-config-Dhypzb6a-C3Kb0XtS.d.mts} +35 -63
  2. package/dist/app-config-Dhypzb6a-C3Kb0XtS.d.mts.map +1 -0
  3. package/dist/{app-converge-DkTFs-ih-CAr2feEu.mjs → app-converge-DFWYhyDb-BFaMPem0.mjs} +5 -5
  4. package/dist/app-converge-DFWYhyDb-BFaMPem0.mjs.map +1 -0
  5. package/dist/config-D615fYD5.d.mts +1 -0
  6. package/dist/config.d.mts +3 -3
  7. package/dist/config.mjs +12 -2
  8. package/dist/config.mjs.map +1 -0
  9. package/dist/control.d.mts +236 -16
  10. package/dist/control.d.mts.map +1 -1
  11. package/dist/control.mjs +5 -5
  12. package/dist/control.mjs.map +1 -1
  13. package/dist/{converge-in-process-x89zb2MF-Dvj-J8xo.mjs → converge-in-process-CfeblFN9-B1KvX1Fa.mjs} +4 -4
  14. package/dist/{converge-in-process-x89zb2MF-Dvj-J8xo.mjs.map → converge-in-process-CfeblFN9-B1KvX1Fa.mjs.map} +1 -1
  15. package/dist/{converge-in-process-CTomEXaD-BnDylZP8.d.mts → converge-in-process-DZRf9uYm-Ohjvy0s_.d.mts} +6 -6
  16. package/dist/{converge-in-process-CTomEXaD-BnDylZP8.d.mts.map → converge-in-process-DZRf9uYm-Ohjvy0s_.d.mts.map} +1 -1
  17. package/dist/{deploy-DHgEJDpg.d.mts → deploy-CncPyRbo.d.mts} +4 -4
  18. package/dist/{deploy-DHgEJDpg.d.mts.map → deploy-CncPyRbo.d.mts.map} +1 -1
  19. package/dist/{deploy-CSU0kr4j.mjs → deploy-DPX4IXzF.mjs} +15 -43
  20. package/dist/deploy-DPX4IXzF.mjs.map +1 -0
  21. package/dist/deploy.d.mts +4 -4
  22. package/dist/deploy.mjs +3 -3
  23. package/dist/{dev-converge-messages-DML4rTz7-C_EAB5M_.mjs → dev-converge-messages-CElmPylA-BenEozC3.mjs} +7 -7
  24. package/dist/dev-converge-messages-CElmPylA-BenEozC3.mjs.map +1 -0
  25. package/dist/dev-converge-worker.mjs +3 -3
  26. package/dist/dev-converge-worker.mjs.map +1 -1
  27. package/dist/{dev-current-C7rT6Yxw-yJ1ORrSC.mjs → dev-current-DFRg3-my-qixpmg6C.mjs} +8 -19
  28. package/dist/dev-current-DFRg3-my-qixpmg6C.mjs.map +1 -0
  29. package/dist/{dist-Cf_mZHaH.mjs → dist-Bw5O9TDx.mjs} +2 -2
  30. package/dist/{dist-Cf_mZHaH.mjs.map → dist-Bw5O9TDx.mjs.map} +1 -1
  31. package/dist/execute-deploy-destroy-CC5eDvWh-bRklcWAk.mjs +476 -0
  32. package/dist/execute-deploy-destroy-CC5eDvWh-bRklcWAk.mjs.map +1 -0
  33. package/dist/{execute-dev-BtSLDMkv-DAXRcK9h.mjs → execute-dev-_8rBPdcp-BrGpYVIu.mjs} +11 -15
  34. package/dist/execute-dev-_8rBPdcp-BrGpYVIu.mjs.map +1 -0
  35. package/dist/{execute-dev-current-LEdiAZSw-CwM41ylY.mjs → execute-dev-current-DbcTJmtG-DEZK2Oqn.mjs} +4 -4
  36. package/dist/{execute-dev-current-LEdiAZSw-CwM41ylY.mjs.map → execute-dev-current-DbcTJmtG-DEZK2Oqn.mjs.map} +1 -1
  37. package/dist/{execute-log-CzzB35KD-BBHeeC1M.mjs → execute-log-CcNIxcQt-jpflVo9o.mjs} +4 -4
  38. package/dist/{execute-log-CzzB35KD-BBHeeC1M.mjs.map → execute-log-CcNIxcQt-jpflVo9o.mjs.map} +1 -1
  39. package/dist/{graph-D2WMLL43-CeiC5wdy.mjs → graph-BYo1OEqk-D5AtX8q4.mjs} +5 -5
  40. package/dist/graph-BYo1OEqk-D5AtX8q4.mjs.map +1 -0
  41. package/dist/{graph-CUYXjK8S-BzL-mhjq.d.mts → graph-CRFQxH8r-CI1p78T8.d.mts} +3 -3
  42. package/dist/graph-CRFQxH8r-CI1p78T8.d.mts.map +1 -0
  43. package/dist/{graph-types-D4PrtP-l-B0uuchTl.d.mts → graph-types-BeNeqIt4-LGyYX_Sm.d.mts} +9 -10
  44. package/dist/{graph-types-D4PrtP-l-B0uuchTl.d.mts.map → graph-types-BeNeqIt4-LGyYX_Sm.d.mts.map} +1 -1
  45. package/dist/http.d.mts +2 -2
  46. package/dist/http.mjs +2 -2
  47. package/dist/{index-D8chHe55.d.mts → index-DOJMK47O.d.mts} +3 -3
  48. package/dist/{index-D8chHe55.d.mts.map → index-DOJMK47O.d.mts.map} +1 -1
  49. package/dist/index.d.mts +3 -3
  50. package/dist/index.mjs +2 -2
  51. package/dist/internal-converge.d.mts +4 -4
  52. package/dist/internal-converge.mjs +2 -2
  53. package/dist/{load-entry-CEoVBdMj-CHOz7jKf.mjs → load-entry-CEoVBdMj-L1mXTtEO.mjs} +5 -5
  54. package/dist/load-entry-CEoVBdMj-L1mXTtEO.mjs.map +1 -0
  55. package/dist/{local-target-7KRsLMDO.d.mts → local-target-DZFvgvVK.d.mts} +2 -2
  56. package/dist/{local-target-7KRsLMDO.d.mts.map → local-target-DZFvgvVK.d.mts.map} +1 -1
  57. package/dist/local-target.d.mts +2 -2
  58. package/dist/{nextjs-DLyeRR7M-CzUbvPaJ.d.mts → nextjs-DLyeRR7M-C2z32CtL.d.mts} +3 -3
  59. package/dist/{nextjs-DLyeRR7M-CzUbvPaJ.d.mts.map → nextjs-DLyeRR7M-C2z32CtL.d.mts.map} +1 -1
  60. package/dist/nextjs-control.d.mts +4 -4
  61. package/dist/nextjs.d.mts +1 -1
  62. package/dist/node-control.d.mts +3 -3
  63. package/dist/node.d.mts +2 -2
  64. package/dist/{run-report-CmBz2-xc-Cc8rV1CX.mjs → run-report-HI2JqCSO-BWPG--nb.mjs} +5 -7
  65. package/dist/run-report-HI2JqCSO-BWPG--nb.mjs.map +1 -0
  66. package/dist/service-rpc.d.mts +2 -2
  67. package/dist/service-rpc.mjs +2 -2
  68. package/dist/steps-Det-FSAL-DRvo57Lf.mjs +174 -0
  69. package/dist/steps-Det-FSAL-DRvo57Lf.mjs.map +1 -0
  70. package/dist/testing.d.mts +1 -1
  71. package/dist/{validate-environment-DCZiNSlR-C7lv0cH1.mjs → validate-environment-BevPErw8-BDbXIt8U.mjs} +331 -9
  72. package/dist/validate-environment-BevPErw8-BDbXIt8U.mjs.map +1 -0
  73. package/package.json +11 -14
  74. package/skills/prisma-composer-core-concepts/SKILL.md +6 -23
  75. package/dist/app-config-DriAu5RU-C8hYpR38.d.mts.map +0 -1
  76. package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs +0 -186
  77. package/dist/app-configuration-file-D0rB5g65-CdMrjkCc.mjs.map +0 -1
  78. package/dist/app-converge-DkTFs-ih-CAr2feEu.mjs.map +0 -1
  79. package/dist/config-Bpi8QVLB.d.mts +0 -1
  80. package/dist/deploy-CSU0kr4j.mjs.map +0 -1
  81. package/dist/deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts +0 -33
  82. package/dist/deployment-summary-6LgQDUuu-Cu_6UNhc.d.mts.map +0 -1
  83. package/dist/deployment-summary-CVJZn2v0-Dz-gX1rp.mjs +0 -153
  84. package/dist/deployment-summary-CVJZn2v0-Dz-gX1rp.mjs.map +0 -1
  85. package/dist/dev-converge-messages-DML4rTz7-C_EAB5M_.mjs.map +0 -1
  86. package/dist/dev-current-C7rT6Yxw-yJ1ORrSC.mjs.map +0 -1
  87. package/dist/execute-deploy-destroy-C-aK5jh--D-AjLWc2.mjs +0 -855
  88. package/dist/execute-deploy-destroy-C-aK5jh--D-AjLWc2.mjs.map +0 -1
  89. package/dist/execute-dev-BtSLDMkv-DAXRcK9h.mjs.map +0 -1
  90. package/dist/graph-CUYXjK8S-BzL-mhjq.d.mts.map +0 -1
  91. package/dist/graph-D2WMLL43-CeiC5wdy.mjs.map +0 -1
  92. package/dist/internal-app-configuration-file.d.mts +0 -16
  93. package/dist/internal-app-configuration-file.d.mts.map +0 -1
  94. package/dist/internal-app-configuration-file.mjs +0 -2
  95. package/dist/load-entry-CEoVBdMj-CHOz7jKf.mjs.map +0 -1
  96. package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs +0 -90
  97. package/dist/preflight-transport-2d6iIchu-B-v7Di6I.mjs.map +0 -1
  98. package/dist/redaction-DY6eDC12-W-FzW7_r.mjs +0 -339
  99. package/dist/redaction-DY6eDC12-W-FzW7_r.mjs.map +0 -1
  100. package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts +0 -232
  101. package/dist/redaction-Dn7BRdaP-BcLSPhLV.d.mts.map +0 -1
  102. package/dist/report.d.mts +0 -19
  103. package/dist/report.d.mts.map +0 -1
  104. package/dist/report.mjs +0 -97
  105. package/dist/report.mjs.map +0 -1
  106. package/dist/run-report-CmBz2-xc-Cc8rV1CX.mjs.map +0 -1
  107. package/dist/steps-BZXNqW6U-C_ME2VLd.mjs +0 -112
  108. package/dist/steps-BZXNqW6U-C_ME2VLd.mjs.map +0 -1
  109. package/dist/validate-environment-DCZiNSlR-C7lv0cH1.mjs.map +0 -1
  110. package/src/exports/internal-app-configuration-file.ts +0 -1
  111. package/src/exports/report.ts +0 -1
@@ -1,15 +1,337 @@
1
1
  import { t as describeKind } from "./describe-kind-Cpm_euxo-DsSPENQa.mjs";
2
- import { E as secretsKeys, c as assertAppName, n as Load, t as GraphCheckError } from "./graph-D2WMLL43-CeiC5wdy.mjs";
2
+ import { E as secretsKeys, c as assertAppName, n as Load, t as GraphCheckError } from "./graph-BYo1OEqk-D5AtX8q4.mjs";
3
3
  import { t as InternalError } from "./internal-error-Dfur7Zqt-D96dWHZK.mjs";
4
4
  import { t as CliStructuredError } from "./errors-DI3TBXE-.mjs";
5
- import "./dist-Cf_mZHaH.mjs";
5
+ import "./dist-Bw5O9TDx.mjs";
6
6
  import { n as environmentVariables } from "./config-adapters-DG-uhGfv-Bt1M9f8b.mjs";
7
- import "./deploy-CSU0kr4j.mjs";
8
- import { a as checkComposerConfig, n as loadEntry, o as configFileMissing, s as entryMissing } from "./load-entry-CEoVBdMj-CHOz7jKf.mjs";
9
- import { r as credentialLookingValues, t as SecretRedaction, u as valuesUnderSecretsKeys } from "./redaction-DY6eDC12-W-FzW7_r.mjs";
7
+ import "./deploy-DPX4IXzF.mjs";
8
+ import { a as checkComposerConfig, n as loadEntry, o as configFileMissing, s as entryMissing } from "./load-entry-CEoVBdMj-L1mXTtEO.mjs";
10
9
  import * as path$1 from "node:path";
11
10
  import * as fs$1 from "node:fs";
11
+ import { inspect } from "node:util";
12
12
  import { spawnSync } from "node:child_process";
13
+ //#region ../../0-framework/3-tooling/cli/dist/redaction-DHaXoToJ.mjs
14
+ const REDACTED = "[redacted]";
15
+ /** Env var names whose values are credentials: the service token and the usual secret spellings. */
16
+ const SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$/i;
17
+ /**
18
+ * The credential-looking values in `variables`: text of eight characters or more under a name
19
+ * that looks like a credential's. The length limit keeps a one-letter placeholder from blanking
20
+ * every matching letter.
21
+ */
22
+ function credentialLookingValues(variables) {
23
+ return Object.entries(variables).flatMap(([name, value]) => SECRET_ENV_NAME.test(name) && typeof value === "string" && value.length >= 8 ? [value] : []);
24
+ }
25
+ /** `value` as it appears inside a string that `JSON.stringify` or `util.inspect` printed, where a newline, quote or backslash is escaped. */
26
+ function escapedForms(value) {
27
+ return [
28
+ value,
29
+ JSON.stringify(value).slice(1, -1),
30
+ inspect(value).slice(1, -1)
31
+ ];
32
+ }
33
+ /**
34
+ * Finds every secret in a text, as written or as `JSON.stringify` and `util.format` escape it:
35
+ * one regular expression for all of them, built once. A match is the span of the longest
36
+ * secret that starts at a position, and spans that overlap are merged, so two overlapping
37
+ * secrets are hidden whole.
38
+ */
39
+ var SecretMatcher = class {
40
+ starts;
41
+ prefixes = /* @__PURE__ */ new Set();
42
+ longestPrefix;
43
+ constructor(values) {
44
+ const sorted = [...new Set([...values].flatMap(escapedForms))].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);
45
+ this.starts = sorted.length === 0 ? void 0 : new RegExp(`(?=(${sorted.map((value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")}))`, "g");
46
+ for (const value of sorted) for (let length = 1; length < value.length; length++) this.prefixes.add(value.slice(0, length));
47
+ this.longestPrefix = Math.max(0, (sorted[0]?.length ?? 0) - 1);
48
+ }
49
+ /** The merged spans of every secret in `text`, in order, as `[start, end)`. */
50
+ spans(text) {
51
+ const spans = [];
52
+ if (this.starts === void 0) return spans;
53
+ for (const match of text.matchAll(this.starts)) {
54
+ const start = match.index;
55
+ const end = start + (match[1]?.length ?? 0);
56
+ const last = spans.at(-1);
57
+ if (last !== void 0 && start < last[1]) last[1] = Math.max(last[1], end);
58
+ else spans.push([start, end]);
59
+ }
60
+ return spans;
61
+ }
62
+ /** The length of the longest end of `text` that is the start, not the whole, of a secret. */
63
+ startOfSecretAtEnd(text) {
64
+ for (let length = Math.min(this.longestPrefix, text.length); length > 0; length--) if (this.prefixes.has(text.slice(text.length - length))) return length;
65
+ return 0;
66
+ }
67
+ /** `text` with each span replaced by `[redacted]`. */
68
+ redact(text) {
69
+ let out = "";
70
+ let from = 0;
71
+ for (const [start, end] of this.spans(text)) {
72
+ out += text.slice(from, start) + REDACTED;
73
+ from = end;
74
+ }
75
+ return from === 0 ? text : out + text.slice(from);
76
+ }
77
+ };
78
+ /** `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. */
79
+ function redactShapes(text) {
80
+ return 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}`);
81
+ }
82
+ /**
83
+ * The known secrets of one command: the values under the secrets keys the graph names, in the app
84
+ * secrets and the app configuration (ADR-0062). A plain value must not hold any of them.
85
+ */
86
+ var KnownSecrets = class {
87
+ #names = /* @__PURE__ */ new Map();
88
+ constructor(secrets = []) {
89
+ this.add(secrets);
90
+ }
91
+ /** Adds each secret whose value is not empty. A value already known keeps its first name. */
92
+ add(secrets) {
93
+ for (const { name, value } of secrets) if (value.length > 0 && !this.#names.has(value)) this.#names.set(value, name);
94
+ }
95
+ values() {
96
+ return new Set(this.#names.keys());
97
+ }
98
+ /**
99
+ * The name of a known secret `text` holds, or undefined. A secret of
100
+ * `MIN_SECRET_LENGTH_INSIDE_A_VALUE` characters or more is found anywhere in `text`; a shorter
101
+ * one only when it is all of `text`.
102
+ */
103
+ nameIn(text) {
104
+ for (const [value, name] of this.#names) if (value.length >= 8 ? text.includes(value) : text === value) return name;
105
+ }
106
+ };
107
+ /**
108
+ * What one command hides from everything it prints, returns or reports (ADR-0062): its known
109
+ * secrets, and the credential-looking values, which only look like secrets by the name of the
110
+ * variable they are under. It starts with the credential-looking values of the process
111
+ * environment.
112
+ */
113
+ var SecretRedaction = class {
114
+ knownSecrets = new KnownSecrets();
115
+ credentialLooking = /* @__PURE__ */ new Set();
116
+ matcher;
117
+ constructor(env) {
118
+ this.addCredentialLookingValues(credentialLookingValues(env));
119
+ }
120
+ addKnownSecrets(secrets) {
121
+ this.knownSecrets.add(secrets);
122
+ }
123
+ addCredentialLookingValues(values) {
124
+ for (const value of values) if (value.length > 0) this.credentialLooking.add(value);
125
+ }
126
+ /** The known secrets and the credential-looking values, longest first. */
127
+ allValues() {
128
+ return [.../* @__PURE__ */ new Set([...this.knownSecrets.values(), ...this.credentialLooking])].sort((a, b) => b.length - a.length);
129
+ }
130
+ /** `text` with every known secret and credential-looking value replaced by `[redacted]` at any length, then bearer tokens, JWTs, URL passwords and `token=…` pairs. */
131
+ redact(text) {
132
+ const size = this.knownSecrets.values().size + this.credentialLooking.size;
133
+ if (this.matcher?.size !== size) this.matcher = {
134
+ size,
135
+ matcher: new SecretMatcher(this.allValues())
136
+ };
137
+ return redactShapes(this.matcher.matcher.redact(text));
138
+ }
139
+ };
140
+ /** The text under each name in `secretsKeys`, in the app configuration and in the app secrets, at any length. */
141
+ function valuesUnderSecretsKeys(configuration, secrets, secretsKeys) {
142
+ return secretsKeys.flatMap((name) => [configuration[name], secrets[name]].flatMap((value) => typeof value === "string" ? [{
143
+ name,
144
+ value
145
+ }] : []));
146
+ }
147
+ function redactReader(reader, redaction) {
148
+ switch (reader.kind) {
149
+ case "field": return {
150
+ kind: "field",
151
+ service: redaction.redact(reader.service),
152
+ path: redaction.redact(reader.path)
153
+ };
154
+ case "unread": return {
155
+ kind: "unread",
156
+ node: redaction.redact(reader.node)
157
+ };
158
+ }
159
+ }
160
+ /** `variable` with every text in it redacted: its name, each reader's names and each command. */
161
+ function redactUnsetPlatformVariable(variable, redaction) {
162
+ return {
163
+ name: redaction.redact(variable.name),
164
+ readers: variable.readers.map((reader) => redactReader(reader, redaction)),
165
+ commands: variable.commands.map((command) => redaction.redact(command))
166
+ };
167
+ }
168
+ function redactData(value, redaction) {
169
+ if (typeof value === "string") return redaction.redact(value);
170
+ if (Array.isArray(value)) return value.map((member) => redactData(member, redaction));
171
+ if (typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype) return Object.fromEntries(Object.entries(value).map(([key, member]) => [key, redactData(member, redaction)]));
172
+ return value;
173
+ }
174
+ /**
175
+ * `error` with every value `redaction` hides removed from its summary, `why`, `fix` and every string in
176
+ * its `meta`. The code, severity, `where` and docs link are kept. The cause is dropped, because
177
+ * it holds the same text unredacted and a renderer may print it.
178
+ */
179
+ function redactError(error, redaction) {
180
+ return new CliStructuredError(error.code, redaction.redact(error.message), {
181
+ severity: error.severity,
182
+ ...error.why === void 0 ? {} : { why: redaction.redact(error.why) },
183
+ ...error.fix === void 0 ? {} : { fix: redaction.redact(error.fix) },
184
+ ...error.where === void 0 ? {} : { where: error.where },
185
+ ...error.meta === void 0 ? {} : { meta: Object.fromEntries(Object.entries(error.meta).map(([key, value]) => [key, redactData(value, redaction)])) },
186
+ ...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl }
187
+ });
188
+ }
189
+ function setOwn(error, name, value) {
190
+ Object.defineProperty(error, name, {
191
+ value,
192
+ writable: true,
193
+ configurable: true
194
+ });
195
+ }
196
+ const UNPRINTABLE = "A value was thrown that cannot be turned into text.";
197
+ function safeString(value) {
198
+ try {
199
+ return String(value);
200
+ } catch {
201
+ try {
202
+ return Object.prototype.toString.call(value);
203
+ } catch {
204
+ return UNPRINTABLE;
205
+ }
206
+ }
207
+ }
208
+ /**
209
+ * The error to rethrow in place of a thrown defect, with every secret removed from its message
210
+ * and stack, and from those of each error in its `cause` chain and in an `AggregateError`'s
211
+ * `errors`. A cause that is text or plain data becomes a redacted copy. Each error is redacted
212
+ * in place where it can be. One whose properties cannot change, such as a frozen error, is
213
+ * replaced by a new error with the redacted message, stack and cause. A thrown value that is not
214
+ * an `Error` becomes an `Error` whose message is its redacted text. Never throws: when reading
215
+ * the error fails, the result is a new `Error` holding the redacted text of what was thrown.
216
+ */
217
+ function redactThrown(thrown, redaction) {
218
+ try {
219
+ return thrown instanceof Error ? redactErrorChain(thrown, redaction, /* @__PURE__ */ new Map()) : new Error(redaction.redact(safeString(thrown)));
220
+ } catch {
221
+ return new Error(redaction.redact(safeString(thrown)));
222
+ }
223
+ }
224
+ function redactErrorChain(error, redaction, seen) {
225
+ const done = seen.get(error);
226
+ if (done !== void 0) return done;
227
+ seen.set(error, error);
228
+ const message = redaction.redact(typeof error.message === "string" ? error.message : safeString(error.message));
229
+ const stack = typeof error.stack === "string" ? redaction.redact(error.stack) : void 0;
230
+ const cause = error.cause instanceof Error ? redactErrorChain(error.cause, redaction, seen) : redactData(error.cause, redaction);
231
+ const members = error instanceof AggregateError ? error.errors.map((member) => member instanceof Error ? redactErrorChain(member, redaction, seen) : redactData(member, redaction)) : void 0;
232
+ try {
233
+ setOwn(error, "message", message);
234
+ if (stack !== void 0) setOwn(error, "stack", stack);
235
+ if (error.cause !== void 0) setOwn(error, "cause", cause);
236
+ if (members !== void 0) setOwn(error, "errors", members);
237
+ return error;
238
+ } catch {
239
+ const options = cause === void 0 ? void 0 : { cause };
240
+ const copy = members === void 0 ? new Error(message, options) : new AggregateError(members, message, options);
241
+ copy.name = error.name;
242
+ setOwn(copy, "stack", stack ?? `${error.name}: ${message}`);
243
+ seen.set(error, copy);
244
+ return copy;
245
+ }
246
+ }
247
+ /** `event` with every value `redaction` hides removed from the text it carries: a message, an Alchemy log line, a converge failure's reasons, or a dev server's output line. */
248
+ function redactDevEvent(event, redaction) {
249
+ switch (event.kind) {
250
+ case "target-warning":
251
+ case "rebuild-failed":
252
+ case "watch-error":
253
+ case "stop-error": return {
254
+ ...event,
255
+ message: redaction.redact(event.message)
256
+ };
257
+ case "message": return {
258
+ ...event,
259
+ text: redaction.redact(event.text)
260
+ };
261
+ case "converge-failed": return {
262
+ ...event,
263
+ message: redaction.redact(event.message),
264
+ reasons: event.reasons.map(({ tag, message }) => ({
265
+ tag,
266
+ message: redaction.redact(message)
267
+ }))
268
+ };
269
+ case "dev-server-output": return {
270
+ ...event,
271
+ line: redaction.redact(event.line)
272
+ };
273
+ default: return event;
274
+ }
275
+ }
276
+ /** `summary` with every value `redaction` hides removed from each entity's id, url and details. */
277
+ function redactSummary(summary, redaction) {
278
+ if (summary === void 0) return void 0;
279
+ return {
280
+ app: summary.app,
281
+ findings: { unset: summary.findings.unset.map((variable) => redactUnsetPlatformVariable(variable, redaction)) },
282
+ nodes: summary.nodes.map((node) => ({
283
+ address: node.address,
284
+ entities: node.entities.map((entity) => ({
285
+ ...entity,
286
+ id: redaction.redact(entity.id),
287
+ ...entity.url === void 0 ? {} : { url: redaction.redact(entity.url) },
288
+ ...entity.details === void 0 ? {} : { details: Object.fromEntries(Object.entries(entity.details).map(([key, value]) => [key, redaction.redact(value)])) }
289
+ }))
290
+ }))
291
+ };
292
+ }
293
+ function isHighSurrogate(code) {
294
+ return code >= 55296 && code <= 56319;
295
+ }
296
+ /**
297
+ * Redacts a stream of text chunk by chunk: every value in `values` becomes `[redacted]`, and
298
+ * overlapping values are hidden whole. It holds back only the end of the text that could still
299
+ * be part of a value: the longest end that could start one, or a match that a later value could
300
+ * extend. So a value split across two chunks is still replaced, and text that cannot start one,
301
+ * such as a prompt, is returned at once. It never splits a surrogate pair. `push` returns the
302
+ * text that is ready; `end` returns the rest.
303
+ */
304
+ var StreamRedactor = class {
305
+ held = "";
306
+ matcher;
307
+ constructor(values) {
308
+ this.matcher = new SecretMatcher(values);
309
+ }
310
+ push(chunk) {
311
+ const text = this.held + chunk;
312
+ const cut = text.length - this.matcher.startOfSecretAtEnd(text);
313
+ let out = "";
314
+ let from = 0;
315
+ let ready = cut;
316
+ for (const [start, end] of this.matcher.spans(text)) {
317
+ if (end > cut) {
318
+ ready = Math.min(cut, start);
319
+ break;
320
+ }
321
+ out += text.slice(from, start) + REDACTED;
322
+ from = end;
323
+ }
324
+ if (ready > from && ready < text.length && isHighSurrogate(text.charCodeAt(ready - 1))) ready -= 1;
325
+ this.held = text.slice(ready);
326
+ return out + text.slice(from, ready);
327
+ }
328
+ end() {
329
+ const text = this.held;
330
+ this.held = "";
331
+ return this.matcher.redact(text);
332
+ }
333
+ };
334
+ //#endregion
13
335
  //#region ../../0-framework/3-tooling/assemble/dist/index.mjs
14
336
  /**
15
337
  * A user-facing assembly failure, structured at origin (base-type rule 6):
@@ -106,7 +428,7 @@ async function assembleServices(graph, config, cwd, run, onEvent, options = {})
106
428
  };
107
429
  }
108
430
  //#endregion
109
- //#region ../../0-framework/3-tooling/cli/dist/validate-environment-DCZiNSlR.mjs
431
+ //#region ../../0-framework/3-tooling/cli/dist/validate-environment-BevPErw8.mjs
110
432
  function adapterInvalid(list, index, input, summary, fix) {
111
433
  return new CliStructuredError("CONFIG.ADAPTER_INVALID", summary, {
112
434
  fix,
@@ -204,7 +526,7 @@ function validateRegistryCoverage(graph, config) {
204
526
  * The shared prefix of `deploy`/`destroy`/`dev` (deploy-cli.md § The
205
527
  * pipeline; local-dev spec § 6): entry load, Load,
206
528
  * registry coverage validation, name resolution, assemble. Deploy and dev
207
- * diverge after this — deploy resolves containers/preflight/stack file
529
+ * diverge after this — deploy resolves containers and runs its preflight
208
530
  * against the hosted providers, dev against the local ones — so everything
209
531
  * up to and including assemble lives here once, consumed verbatim by both
210
532
  * `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines
@@ -339,6 +661,6 @@ function validateEnvironmentName(environment, spawn = spawnSync) {
339
661
  if (result.status !== 0) throw new CliStructuredError("DEPLOY.ENVIRONMENT_INVALID", `Invalid --environment "${environment}": must be a valid git ref name (git check-ref-format rejected "refs/heads/${environment}").`);
340
662
  }
341
663
  //#endregion
342
- export { validateEnvironmentName as i, resolveAppIdentity as n, runPipeline as r, checkConfigSource as t };
664
+ export { SecretRedaction as a, redactDevEvent as c, redactThrown as d, redactUnsetPlatformVariable as f, validateEnvironmentName as i, redactError as l, resolveAppIdentity as n, StreamRedactor as o, runPipeline as r, credentialLookingValues as s, checkConfigSource as t, redactSummary as u };
343
665
 
344
- //# sourceMappingURL=validate-environment-DCZiNSlR-C7lv0cH1.mjs.map
666
+ //# sourceMappingURL=validate-environment-BevPErw8-BDbXIt8U.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-environment-BevPErw8-BDbXIt8U.mjs","names":["#names","path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/redaction-DHaXoToJ.mjs","../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/3-tooling/cli/dist/validate-environment-BevPErw8.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 and the usual secret spellings. */\nconst SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$/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 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* 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). A plain value 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, an Alchemy log line, a converge failure's reasons, 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 \"message\": return {\n\t\t\t...event,\n\t\t\ttext: redaction.redact(event.text)\n\t\t};\n\t\tcase \"converge-failed\": return {\n\t\t\t...event,\n\t\t\tmessage: redaction.redact(event.message),\n\t\t\treasons: event.reasons.map(({ tag, message }) => ({\n\t\t\t\ttag,\n\t\t\t\tmessage: redaction.redact(message)\n\t\t\t}))\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 { redactError as a, redactUnsetPlatformVariable as c, redactDevEvent as i, valuesUnderSecretsKeys as l, StreamRedactor as n, redactSummary as o, credentialLookingValues as r, redactThrown as s, SecretRedaction as t };\n\n//# sourceMappingURL=redaction-DHaXoToJ.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/assemble-error.ts\n/**\n* A user-facing assembly failure, structured at origin (base-type rule 6):\n* a `CliStructuredError` whose code names which way assembly went wrong.\n* This package's second consumer is the programmatic deploy API, not just\n* the CLI — hosts branch on `error.code`, the CLI renders the envelope.\n*/\nvar AssembleError = class extends CliStructuredError {\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t}\n};\n//#endregion\n//#region src/assemble-services.ts\n/**\n* The registry route for one service's build: extension by\n* `build.extension`, node descriptor by `build.type`, kind must be \"build\".\n* The CLI's coverage validation reports the same misses earlier with the\n* config fix; these errors are the backstop for programmatic callers.\n*/\nfunction buildDescriptorAssemble(config, node, address, cwd, report) {\n\tconst { extension, type } = node.build;\n\tconst extensionDescriptor = config.extensions.find((candidate) => candidate.id === extension);\n\tif (extensionDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by service \"${node.name}\"'s build).`, { fix: \"Add it to `extensions` in the `composer` section of prisma.config.ts.\" });\n\tconst nodeDescriptor = extensionDescriptor.nodes[type];\n\tif (nodeDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for build type \"${type}\".`, { why: `Known types: ${Object.keys(extensionDescriptor.nodes).join(\", \")}.` });\n\tif (nodeDescriptor.kind !== \"build\") throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for type \"${type}\" is a \"${nodeDescriptor.kind}\" descriptor.`, { why: \"Assembling a service build needs a \\\"build\\\" descriptor.\" });\n\treturn nodeDescriptor.assemble({\n\t\tbuild: node.build,\n\t\taddress,\n\t\tcwd,\n\t\treport\n\t});\n}\n/**\n* The dev server a service's build descriptor declares, or `undefined` when it\n* declares none — including when the registry route misses, which the\n* assemble that follows reports with its own pinned error.\n*/\nasync function buildDescriptorServe(config, node, address) {\n\tconst { extension, type } = node.build;\n\tconst nodeDescriptor = config.extensions.find((candidate) => candidate.id === extension)?.nodes[type];\n\tif (nodeDescriptor?.kind !== \"build\" || nodeDescriptor.serve === void 0) return void 0;\n\ttry {\n\t\treturn await nodeDescriptor.serve({\n\t\t\tbuild: node.build,\n\t\t\taddress\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) throw error;\n\t\tthrow new CliStructuredError(\"DEV.DEV_SERVER_UNAVAILABLE\", `service \"${address}\" cannot run its dev server: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tmeta: { address },\n\t\t\tcause: error\n\t\t});\n\t}\n}\nasync function assembleServices(graph, config, cwd, run, onEvent, options = {}) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd, report) => buildDescriptorAssemble(config, node, address, nodeCwd, report));\n\tconst serviceNodes = graph.nodes.filter((n) => n.node.kind === \"service\");\n\tif (serviceNodes.length === 0) throw new AssembleError(\"ASSEMBLE.SERVICE_MISSING\", \"The loaded graph has no service to assemble.\");\n\tconst bundles = {};\n\tconst devServers = {};\n\tfor (const { id, node } of serviceNodes) {\n\t\tif (options.devServers === true) {\n\t\t\tconst server = await buildDescriptorServe(config, node, id);\n\t\t\tif (server !== void 0) {\n\t\t\t\tdevServers[id] = server;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tonEvent?.({\n\t\t\tkind: \"service-started\",\n\t\t\taddress: id\n\t\t});\n\t\tconst data = {};\n\t\tlet artifact;\n\t\ttry {\n\t\t\tartifact = await runAssembler(node, id, cwd, (reported) => Object.assign(data, reported));\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) throw error;\n\t\t\tthrow new AssembleError(\"ASSEMBLE.BUILD_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tmeta: { address: id },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\tbundles[id] = artifact;\n\t\tonEvent?.({\n\t\t\tkind: \"service-assembled\",\n\t\t\taddress: id,\n\t\t\tdata\n\t\t});\n\t}\n\treturn {\n\t\tbundles,\n\t\tdevServers\n\t};\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","import { n as environmentVariables } from \"./config-adapters-DG-uhGfv.mjs\";\nimport { n as configFileMissing, r as entryMissing, t as checkComposerConfig } from \"./composer-config-aL0W4HPG.mjs\";\nimport { t as loadEntry } from \"./load-entry-CEoVBdMj.mjs\";\nimport { l as valuesUnderSecretsKeys, r as credentialLookingValues, t as SecretRedaction } from \"./redaction-DHaXoToJ.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { assembleServices } from \"@internal/assemble\";\nimport { GraphCheckError, Load, assertAppName } from \"@internal/core\";\nimport { secretsKeys } from \"@internal/core/deploy\";\nimport { CliStructuredError, InternalError, describeKind } from \"@internal/foundation/errors\";\nimport { spawnSync } from \"node:child_process\";\n//#region src/app-configuration.ts\nfunction adapterInvalid(list, index, input, summary, fix) {\n\treturn new CliStructuredError(\"CONFIG.ADAPTER_INVALID\", summary, {\n\t\tfix,\n\t\twhere: { path: input.configFile },\n\t\tmeta: { field: `${list}[${index}]` }\n\t});\n}\nfunction isValues(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isText(values) {\n\treturn Object.values(values).every((value) => typeof value === \"string\");\n}\nasync function readAdapters(list, adapters, input) {\n\tconst adapterInput = Object.freeze({\n\t\tenvironment: input.environment,\n\t\tconfigDirectory: path.dirname(input.configFile)\n\t});\n\tconst merged = Object.create(null);\n\tfor (const [index, adapter] of adapters.entries()) {\n\t\tconst field = `composer.${list}[${index}]`;\n\t\tlet values;\n\t\ttry {\n\t\t\tvalues = await adapter(adapterInput);\n\t\t} catch (thrown) {\n\t\t\tthrow new CliStructuredError(\"CONFIG.ADAPTER_FAILED\", `\\`${field}\\` failed to read the values for the environment \"${input.environment}\".`, {\n\t\t\t\twhy: `It threw: ${thrown instanceof Error ? thrown.message : String(thrown)}`,\n\t\t\t\tfix: `Fix the adapter, or remove it from \\`composer.${list}\\` in prisma.config.ts.`,\n\t\t\t\twhere: { path: input.configFile },\n\t\t\t\tmeta: { field: `${list}[${index}]` },\n\t\t\t\tcause: thrown\n\t\t\t});\n\t\t}\n\t\tif (typeof values === \"function\") throw adapterInvalid(list, index, input, `\\`${field}\\` returned a function, not an object of values.`, \"An adapter factory was put in the list instead of the adapter it makes: write `dotenv()`, not `dotenv`.\");\n\t\tif (!isValues(values)) throw adapterInvalid(list, index, input, `\\`${field}\\` returned ${describeKind(values)}, not an object of values.`, \"Return an object whose keys are the names of the values, e.g. `{ EMAIL_FROM: 'shop@example.com' }`.\");\n\t\tfor (const [key, value] of Object.entries(values)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tif (list === \"secrets\" && typeof value !== \"string\") throw adapterInvalid(list, index, input, `\\`${field}\\` returned ${describeKind(value)} for \"${key}\", but a secret is text.`, \"Return the secret as a string. A platform variable holds text.\");\n\t\t\tmerged[key] = value;\n\t\t}\n\t}\n\treturn Object.freeze(merged);\n}\n/** Calls the section's `config` adapters (default `[environmentVariables()]`) and merges what they return: the app configuration. */\nfunction readAppConfiguration(section, input) {\n\treturn readAdapters(\"config\", section.config ?? [environmentVariables()], input);\n}\n/**\n* Calls the section's `secrets` adapters (default `[environmentVariables()]`) and merges what they\n* return: the app secrets. Every value must be text. A value is a known secret only once the graph\n* names it, so this adds none.\n*/\nasync function readAppSecrets(section, input) {\n\tconst merged = await readAdapters(\"secrets\", section.secrets ?? [environmentVariables()], input);\n\tif (!isText(merged)) throw new InternalError(\"readAdapters admitted a secret that is not text\");\n\treturn merged;\n}\n//#endregion\n//#region src/validate-coverage.ts\nfunction lookup(extensions, extension, type, expectedKind, what) {\n\tconst ext = extensions.get(extension);\n\tif (ext === void 0) throw new CliStructuredError(\"CONFIG.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by ${what}).`, {\n\t\tfix: \"Add it to `extensions` in the `composer` section of prisma.config.ts (import its /control entry and list its descriptor).\",\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tconst descriptor = ext.nodes[type];\n\tif (descriptor === void 0) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for node type \"${type}\" (needed by ${what}).`, {\n\t\twhy: `Known types: ${Object.keys(ext.nodes).join(\", \")}.`,\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tif (descriptor.kind !== expectedKind) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${descriptor.kind}\" descriptor — ${what} needs a \"${expectedKind}\" descriptor.`, { meta: {\n\t\textension,\n\t\ttype,\n\t\tkind: descriptor.kind\n\t} });\n}\n/** Throws a structured CONFIG.* error on the first uncovered `(extension, type)`; silent when the config covers the whole graph. */\nfunction validateRegistryCoverage(graph, config) {\n\tconst extensions = new Map(config.extensions.map((descriptor) => [descriptor.id, descriptor]));\n\tfor (const { id, node } of graph.nodes) {\n\t\tif (node.kind === \"resource\") {\n\t\t\tlookup(extensions, node.extension, node.type, \"resource\", `resource node \"${id}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (node.kind !== \"service\") continue;\n\t\tlookup(extensions, node.extension, node.type, \"service\", `service node \"${id}\"`);\n\t\tlookup(extensions, node.build.extension, node.build.type, \"build\", `service node \"${id}\"'s build descriptor`);\n\t}\n}\n//#endregion\n//#region src/pipeline.ts\n/**\n* The shared prefix of `deploy`/`destroy`/`dev` (deploy-cli.md § The\n* pipeline; local-dev spec § 6): entry load, Load,\n* registry coverage validation, name resolution, assemble. Deploy and dev\n* diverge after this — deploy resolves containers and runs its preflight\n* against the hosted providers, dev against the local ones — so everything\n* up to and including assemble lives here once, consumed verbatim by both\n* `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines\n* cannot drift.\n*/\nconst NO_SECRETS = Object.freeze({});\nfunction configError(findings, file) {\n\tconst [first] = findings;\n\treturn new CliStructuredError(first.code, first.summary, {\n\t\t...first.why === void 0 ? {} : { why: first.why },\n\t\tfix: first.fix,\n\t\twhere: { path: first.where ?? file },\n\t\tmeta: {\n\t\t\t...first.field === void 0 ? {} : { field: first.field },\n\t\t\tfindings\n\t\t}\n\t});\n}\n/**\n* Refuses a caller's config with the same findings, in the same order, as the CLI's section validator.\n* The error is the first finding and carries all of them in `meta.findings`. Returns the config with `file` resolved against `cwd`.\n*/\nfunction checkConfigSource(source, cwd) {\n\tconst file = path.resolve(cwd, source.file);\n\tif (!fs.existsSync(file)) throw configError([configFileMissing(file)], file);\n\tconst checked = checkComposerConfig(source.value, file);\n\tif (!checked.ok) throw configError(checked.findings, file);\n\treturn {\n\t\tvalue: checked.value,\n\t\tfile\n\t};\n}\n/**\n* Resolves the entry module. An override (`--entry`, or an operation's `entry` input) resolves\n* against `cwd`; the section's `entry` resolves against the directory of the file that declares it,\n* as the CLI engine resolves path fields in prisma.config.ts.\n*/\nfunction resolveEntryPath(override, source, cwd) {\n\tif (override !== void 0) return {\n\t\tpath: path.resolve(cwd, override),\n\t\tfix: `Check the \\`--entry\\` path (the \\`entry\\` input when calling @prisma/composer/control) \"${override}\". It is relative to the current directory, ${cwd}.`\n\t};\n\tconst configured = source.value.entry;\n\tif (configured === void 0) throw configError([entryMissing], source.file);\n\treturn {\n\t\tpath: path.resolve(path.dirname(source.file), configured),\n\t\tfix: `Check \\`entry: \"${configured}\"\\` in ${source.file}. It is relative to that file's directory.`\n\t};\n}\n/**\n* The pipeline's front — entry load and name resolution —\n* WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its\n* config and resolved name) to reach the already-running local instance; it\n* neither builds nor provisions, so it must not require the user's built\n* output the way the full pipeline does.\n*/\nasync function resolveAppIdentity(entry, overrideName, cwd, config) {\n\tconst checked = checkConfigSource(config, cwd);\n\tconst { value } = checked;\n\tconst resolved = resolveEntryPath(entry, checked, cwd);\n\tconst entryModule = await loadEntry(resolved.path, cwd, resolved.fix);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\tassertAppName(name);\n\treturn {\n\t\tconfig: value,\n\t\tname\n\t};\n}\n/**\n* Runs entry load, name resolution, Load, registry coverage, and assemble — steps 1–5 of `run()`. `onAssembleError`, when\n* given, lets a caller decorate an assemble failure with command-specific\n* guidance (destroy's \"build first\" hint) without this shared step knowing\n* about any one command.\n*/\nasync function runPipeline(entry, overrideName, environment, cwd, source, deps = {}, onAssembleError) {\n\tconst configSource = checkConfigSource(source, cwd);\n\tconst config = configSource.value;\n\tconst resolved = resolveEntryPath(entry, configSource, cwd);\n\tconst entryModule = await loadEntry(resolved.path, cwd, resolved.fix);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\tconst redaction = deps.redaction ?? new SecretRedaction(process.env);\n\tconst adapterInput = {\n\t\tenvironment,\n\t\tconfigFile: configSource.file\n\t};\n\tconst secrets = deps.readSecrets === true ? await readAppSecrets(config, adapterInput) : NO_SECRETS;\n\tconst configuration = await readAppConfiguration(config, adapterInput);\n\tredaction.addCredentialLookingValues(credentialLookingValues(configuration));\n\tconst graph = Load(entryModule.root, {\n\t\tid: name,\n\t\tenvironment: { name: environment },\n\t\tconfiguration\n\t});\n\tredaction.addKnownSecrets(valuesUnderSecretsKeys(configuration, secrets, secretsKeys(graph)));\n\tcheckGraph(graph, config.extensions);\n\tvalidateRegistryCoverage(graph, config);\n\tdeps.onEvent?.({ kind: \"loaded\" });\n\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler, deps.onEvent, { devServers: deps.devServers === true });\n\t} catch (error) {\n\t\tif (onAssembleError !== void 0 && error instanceof Error) throw onAssembleError(error);\n\t\tthrow error;\n\t}\n\treturn {\n\t\tconfigSource,\n\t\tentryModule,\n\t\tgraph,\n\t\tname,\n\t\tassembled,\n\t\tconfiguration,\n\t\tsecrets\n\t};\n}\nfunction checkGraph(graph, extensions) {\n\tfor (const extension of extensions) try {\n\t\textension.checkGraph?.(graph);\n\t} catch (error) {\n\t\tif (error instanceof GraphCheckError) throw new GraphCheckError(error.message, { extension: extension.id });\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/validate-environment.ts\n/** Letters, digits, `-` and `_`, starting with a letter or digit: always a valid git ref, so no `git` is needed to check it. */\nconst PLAIN_ENVIRONMENT_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;\n/** An environment name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateEnvironmentName(environment, spawn = spawnSync) {\n\tif (PLAIN_ENVIRONMENT_NAME.test(environment)) return;\n\tconst result = spawn(\"git\", [\"check-ref-format\", `refs/heads/${environment}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliStructuredError(\"DEPLOY.ENVIRONMENT_UNVALIDATABLE\", `git is required to validate --environment \"${environment}\" (git check-ref-format): ${result.error.message}.`, { cause: result.error });\n\tif (result.status !== 0) throw new CliStructuredError(\"DEPLOY.ENVIRONMENT_INVALID\", `Invalid --environment \"${environment}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${environment}\").`);\n}\n//#endregion\nexport { runPipeline as i, checkConfigSource as n, resolveAppIdentity as r, validateEnvironmentName as t };\n\n//# sourceMappingURL=validate-environment-BevPErw8.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;;;;;;;AAOA,IAAI,gBAAgB,MAAM;CACzB;CACA,2BAA2B,IAAI,IAAI;CACnC;CACA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MAAM,SAAS,CAAC;CACjC,IAAI;CACJ,IAAI;EACH,YAAY,MAAM,iBAAiB,OAAO,QAAQ,KAAK,KAAK,cAAc,KAAK,SAAS,EAAE,YAAY,KAAK,eAAe,KAAK,CAAC;CACjI,SAAS,OAAO;EACf,IAAI,oBAAoB,KAAK,KAAK,iBAAiB,OAAO,MAAM,gBAAgB,KAAK;EACrF,MAAM;CACP;CACA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD;AACA,SAAS,WAAW,OAAO,YAAY;CACtC,KAAK,MAAM,aAAa,YAAY,IAAI;EACvC,UAAU,aAAa,KAAK;CAC7B,SAAS,OAAO;EACf,IAAI,iBAAiB,iBAAiB,MAAM,IAAI,gBAAgB,MAAM,SAAS,EAAE,WAAW,UAAU,GAAG,CAAC;EAC1G,MAAM;CACP;AACD;;AAIA,MAAM,yBAAyB;;AAE/B,SAAS,wBAAwB,aAAa,QAAQ,WAAW;CAChE,IAAI,uBAAuB,KAAK,WAAW,GAAG;CAC9C,MAAM,SAAS,MAAM,OAAO,CAAC,oBAAoB,cAAc,aAAa,GAAG,EAAE,OAAO,SAAS,CAAC;CAClG,IAAI,OAAO,OAAO,MAAM,IAAI,mBAAmB,oCAAoC,8CAA8C,YAAY,4BAA4B,OAAO,MAAM,QAAQ,IAAI,EAAE,OAAO,OAAO,MAAM,CAAC;CACzN,IAAI,OAAO,WAAW,GAAG,MAAM,IAAI,mBAAmB,8BAA8B,0BAA0B,YAAY,6EAA6E,YAAY,IAAI;AACxN"}
package/package.json CHANGED
@@ -1,18 +1,16 @@
1
1
  {
2
2
  "name": "@prisma/composer",
3
- "version": "0.39.0-dev.12",
3
+ "version": "0.39.0-dev.14",
4
4
  "type": "module",
5
5
  "description": "Prisma Composer — build a Prisma App by composing Modules. Core authoring, deploy pipeline, and the service-rpc/http/node/nextjs authoring surfaces. The command family the `prisma` CLI mounts lives in @prisma/composer-cli.",
6
6
  "exports": {
7
7
  ".": "./dist/index.mjs",
8
8
  "./config": "./dist/config.mjs",
9
- "./internal/app-configuration-file": "./dist/internal-app-configuration-file.mjs",
10
9
  "./internal/converge": "./dist/internal-converge.mjs",
11
10
  "./internal/converge-contract": "./dist/internal-converge-contract.mjs",
12
11
  "./control": "./dist/control.mjs",
13
12
  "./deploy": "./dist/deploy.mjs",
14
13
  "./local-target": "./dist/local-target.mjs",
15
- "./report": "./dist/report.mjs",
16
14
  "./testing": "./dist/testing.mjs",
17
15
  "./casts": "./dist/casts.mjs",
18
16
  "./assertions": "./dist/assertions.mjs",
@@ -34,7 +32,6 @@
34
32
  "dependencies": {
35
33
  "@standard-schema/spec": "^1.1.0",
36
34
  "alchemy": "2.0.0-beta.87",
37
- "cross-spawn": "^7.0.6",
38
35
  "dotenv-flow": "4.1.0",
39
36
  "effect": "4.1.4",
40
37
  "esbuild": "^0.28.1",
@@ -53,16 +50,16 @@
53
50
  }
54
51
  },
55
52
  "devDependencies": {
56
- "@internal/assemble": "0.39.0-dev.12",
57
- "@internal/cli": "0.39.0-dev.12",
58
- "@internal/core": "0.39.0-dev.12",
59
- "@internal/foundation": "0.39.0-dev.12",
60
- "@internal/http": "0.39.0-dev.12",
61
- "@internal/lowering": "0.39.0-dev.12",
62
- "@internal/nextjs": "0.39.0-dev.12",
63
- "@internal/node": "0.39.0-dev.12",
64
- "@internal/service-rpc": "0.39.0-dev.12",
65
- "@internal/tsdown-config": "0.39.0-dev.12",
53
+ "@internal/assemble": "0.39.0-dev.14",
54
+ "@internal/cli": "0.39.0-dev.14",
55
+ "@internal/core": "0.39.0-dev.14",
56
+ "@internal/foundation": "0.39.0-dev.14",
57
+ "@internal/http": "0.39.0-dev.14",
58
+ "@internal/lowering": "0.39.0-dev.14",
59
+ "@internal/nextjs": "0.39.0-dev.14",
60
+ "@internal/node": "0.39.0-dev.14",
61
+ "@internal/service-rpc": "0.39.0-dev.14",
62
+ "@internal/tsdown-config": "0.39.0-dev.14",
66
63
  "@types/node": "^26.0.1",
67
64
  "tsdown": "^0.22.7",
68
65
  "typescript": "^6.0.3",
@@ -2,7 +2,7 @@
2
2
  name: prisma-composer-core-concepts
3
3
  metadata:
4
4
  library: "@prisma/composer"
5
- library_version: "0.39.0-dev.12"
5
+ library_version: "0.39.0-dev.14"
6
6
  version: 2026.9.1
7
7
  description: >-
8
8
  Use when deploying or managing an app that uses Prisma Composer
@@ -465,28 +465,11 @@ environment as production, so deploy and destroy refuse it with
465
465
 
466
466
  **The engine underneath is alchemy.** Convergence is executed by [alchemy](https://alchemy.run), a third-party infrastructure-as-code engine that arrives as an ordinary, exactly-pinned npm dependency of `@prisma/composer` (2.0.0-beta.87 at this library version). Your code never imports or configures it; consult alchemy's own docs for the engine itself. What matters operationally:
467
467
 
468
- `prisma deploy` runs alchemy inside the `prisma` process through alchemy's programmatic API: no generated file and no child process. Its progress prints as one step per resource, and a failure is `DEPLOY.ENGINE_FAILED` carrying the engine's own errors (credentials redacted, capped at 1000 characters), or `DEPLOY.INTERRUPTED` after Ctrl-C, which releases the environment's lease. `prisma dev` runs alchemy in the `prisma` process too, each converge in a new worker thread, so an edit to your app definition applies on the next rebuild. Three kinds of edit need `prisma dev` restarted, and it says so: adding or removing a node, making the root pass on an input field it did not pass on at start, and changing which platform variables the app reads. For `destroy`, Composer runs the alchemy package installed beside the app's `@prisma/composer` and starts it with Node (the first `node` on PATH when `prisma` runs under Bun; `DEPLOY.NODE_MISSING` if none), so the app needs no direct `alchemy` dependency and no `.bin` link. No global Alchemy installation is needed.
469
-
470
- 1. The destroy operation writes the pipeline's results to a generated, gitignored
471
- stack file at `.prisma-composer/alchemy.run.ts`, then runs the alchemy CLI
472
- against it as a child process. `dev` writes no stack file: it runs each
473
- converge in a worker thread of its own process, with local providers. The file
474
- carries the computed values as literals but reads credentials via
475
- `fromEnv()`, so nothing sensitive lands on disk, and it is regenerated
476
- every run: output, not configuration, never edited.
477
- 2. Failures are bisectable through that file. A failing destroy names its
478
- path and prints a reproduce command: Node running the bin of the `alchemy`
479
- Composer depends on, with `destroy .prisma-composer/alchemy.run.ts --yes
480
- --stage <stage>` (Alchemy's own flag; on Prisma Cloud its value is the
481
- environment's Branch id). Running it directly separates "the framework computed the wrong thing" from "the engine or
482
- platform rejected the right thing". An engine failure surfaces as
483
- `DEPLOY.ENGINE_FAILED` carrying the exit code, the engine's own error
484
- lines (credentials redacted, capped at 1000 characters) and that reproduce
485
- command; the child's live output streams to the terminal either way.
486
- 3. Destroy evaluates the same stack program as deploy, and evaluating it
487
- packages the assembled bundles, so **an app must be built before it can
488
- be torn down**.
489
- 4. alchemy is why the `effect` pin exists: it resolves the `effect`
468
+ `prisma deploy` runs alchemy inside the `prisma` process through alchemy's programmatic API: no generated file and no child process. Its progress prints as one step per resource, and a failure is `DEPLOY.ENGINE_FAILED` carrying the engine's own errors (credentials redacted, capped at 1000 characters), or `DEPLOY.INTERRUPTED` after Ctrl-C, which releases the environment's lease. `prisma dev` runs alchemy in the `prisma` process too, each converge in a new worker thread, so an edit to your app definition applies on the next rebuild. Three kinds of edit need `prisma dev` restarted, and it says so: adding or removing a node, making the root pass on an input field it did not pass on at start, and changing which platform variables the app reads. The `destroy` operation runs alchemy inside the process that calls it, the same way as deploy. The alchemy that runs is the one installed beside the app's `@prisma/composer`, so the app needs no direct `alchemy` dependency, and no global Alchemy installation is needed.
469
+
470
+ 1. No command writes a stack file or starts the alchemy CLI. An engine failure surfaces as `DEPLOY.ENGINE_FAILED` carrying the engine's own errors (credentials redacted, capped at 1000 characters), for deploy and destroy alike.
471
+ 2. Destroy runs the same preparation as deploy, assembly included, so **an app must be built before it can be torn down**.
472
+ 3. alchemy is why the `effect` pin exists: it resolves the `effect`
490
473
  constellation, and a hoisted newer `effect` halts every command (failure
491
474
  mode 1 below).
492
475
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-config-DriAu5RU-C8hYpR38.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/app-config-DriAu5RU.d.mts"],"mappings":";;;;;;;;;;;;;;UAaU,kBAAkB;;WAEj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