@prisma/composer 0.36.0-dev.6 → 0.36.0-dev.7

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 (116) hide show
  1. package/dist/{app-config-RX-7kHbF-BroG2yMY.d.mts → app-config-Bf_y5R7o-BEZAnKqM.d.mts} +31 -31
  2. package/dist/app-config-Bf_y5R7o-BEZAnKqM.d.mts.map +1 -0
  3. package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs +221 -0
  4. package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +1 -0
  5. package/dist/arktype.mjs +1 -2
  6. package/dist/arktype.mjs.map +1 -1
  7. package/dist/config-CDkq5Ayl.d.mts +1 -0
  8. package/dist/config-adapters-DG-uhGfv-Bt1M9f8b.mjs +47 -0
  9. package/dist/config-adapters-DG-uhGfv-Bt1M9f8b.mjs.map +1 -0
  10. package/dist/config.d.mts +7 -9
  11. package/dist/config.d.mts.map +1 -1
  12. package/dist/config.mjs +1 -1
  13. package/dist/control.d.mts +6 -183
  14. package/dist/control.d.mts.map +1 -1
  15. package/dist/control.mjs +4 -4
  16. package/dist/control.mjs.map +1 -1
  17. package/dist/deploy-CmiYExQA.mjs +373 -0
  18. package/dist/deploy-CmiYExQA.mjs.map +1 -0
  19. package/dist/deploy-DQyaIoNe.d.mts +2 -0
  20. package/dist/deploy.d.mts +4 -3
  21. package/dist/deploy.mjs +3 -365
  22. package/dist/{deployment-summary-QkZexVIS-DqL4znd4.mjs → deployment-summary-BiBkPWlB-CyC2pudN.mjs} +9 -46
  23. package/dist/deployment-summary-BiBkPWlB-CyC2pudN.mjs.map +1 -0
  24. package/dist/{deployment-summary-Cm4lN6w9-CGdGdlFC.d.mts → deployment-summary-p88NV5m5-BJOosgmI.d.mts} +4 -5
  25. package/dist/deployment-summary-p88NV5m5-BJOosgmI.d.mts.map +1 -0
  26. package/dist/{secret-DoWGmN7m-CI5Yrldp.mjs → describe-kind-Cpm_euxo-CkhlGJUL.mjs} +13 -2
  27. package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +1 -0
  28. package/dist/{dev-current-BurA9uhA-DixUKm8W.mjs → dev-current-D0Kn6Mf4-DDWYu-3j.mjs} +5 -5
  29. package/dist/{dev-current-BurA9uhA-DixUKm8W.mjs.map → dev-current-D0Kn6Mf4-DDWYu-3j.mjs.map} +1 -1
  30. package/dist/{dev-environment-name-6eEr5PW8-BbNUVxlS.mjs → dev-environment-name-6eEr5PW8-BwusWVKi.mjs} +3 -3
  31. package/dist/{dev-environment-name-6eEr5PW8-BbNUVxlS.mjs.map → dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map} +1 -1
  32. package/dist/{dist-DiYPSVUE.mjs → dist-BtzrklYG.mjs} +2 -2
  33. package/dist/{dist-DiYPSVUE.mjs.map → dist-BtzrklYG.mjs.map} +1 -1
  34. package/dist/{dist-DLOn1x6Z.mjs → dist-C7SnNTD3.mjs} +2 -2
  35. package/dist/{dist-DLOn1x6Z.mjs.map → dist-C7SnNTD3.mjs.map} +1 -1
  36. package/dist/{execute-deploy-destroy-Cww6zOSC-D8eKSdMX.mjs → execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs} +59 -35
  37. package/dist/execute-deploy-destroy-Dh1CQ9X6-DY4c9egd.mjs.map +1 -0
  38. package/dist/{execute-dev-4KYkqSMh-Ny8ATEfU.mjs → execute-dev-Bl-5Q-Av-DILne6iY.mjs} +79 -48
  39. package/dist/execute-dev-Bl-5Q-Av-DILne6iY.mjs.map +1 -0
  40. package/dist/{execute-dev-current-Cd4YEUZk-DBj9y27X.mjs → execute-dev-current-D3USgHJ4-CNQe5ADb.mjs} +6 -6
  41. package/dist/{execute-dev-current-Cd4YEUZk-DBj9y27X.mjs.map → execute-dev-current-D3USgHJ4-CNQe5ADb.mjs.map} +1 -1
  42. package/dist/{execute-log-BC5o35wQ-photDb2l.mjs → execute-log-Dm3DkQQP-BSjoy6Wd.mjs} +6 -6
  43. package/dist/{execute-log-BC5o35wQ-photDb2l.mjs.map → execute-log-Dm3DkQQP-BSjoy6Wd.mjs.map} +1 -1
  44. package/dist/{graph-nazLWyK2-BBciBJje.mjs → graph-Bqr7PSGl-BM-M-TlO.mjs} +169 -40
  45. package/dist/graph-Bqr7PSGl-BM-M-TlO.mjs.map +1 -0
  46. package/dist/{graph-B_szUZs6--jpigkBW.d.mts → graph-DI1v3WKX-3g1lTRbh.d.mts} +8 -4
  47. package/dist/graph-DI1v3WKX-3g1lTRbh.d.mts.map +1 -0
  48. package/dist/{graph-types-CViux_yr-CVV2nQ0l.d.mts → graph-types-DRe9UUOp-C85Yr-sJ.d.mts} +60 -14
  49. package/dist/graph-types-DRe9UUOp-C85Yr-sJ.d.mts.map +1 -0
  50. package/dist/http.d.mts +2 -2
  51. package/dist/http.mjs +2 -2
  52. package/dist/{index-BNYl6MsF.d.mts → index-DWQ6BSgm.d.mts} +3 -3
  53. package/dist/{index-BNYl6MsF.d.mts.map → index-DWQ6BSgm.d.mts.map} +1 -1
  54. package/dist/index.d.mts +4 -4
  55. package/dist/index.mjs +3 -3
  56. package/dist/internal-app-configuration-file.d.mts +19 -0
  57. package/dist/internal-app-configuration-file.d.mts.map +1 -0
  58. package/dist/internal-app-configuration-file.mjs +2 -0
  59. package/dist/{local-target-zSdLvLyy.mjs → local-target-Dd8FJEb5.mjs} +4 -3
  60. package/dist/{local-target-zSdLvLyy.mjs.map → local-target-Dd8FJEb5.mjs.map} +1 -1
  61. package/dist/local-target.d.mts +2 -2
  62. package/dist/local-target.d.mts.map +1 -1
  63. package/dist/local-target.mjs +1 -1
  64. package/dist/{nextjs-DLyeRR7M-C9O2M7Z4.d.mts → nextjs-DLyeRR7M-RtoHcY1c.d.mts} +3 -3
  65. package/dist/{nextjs-DLyeRR7M-C9O2M7Z4.d.mts.map → nextjs-DLyeRR7M-RtoHcY1c.d.mts.map} +1 -1
  66. package/dist/nextjs-control.d.mts +4 -4
  67. package/dist/nextjs-control.mjs +2 -2
  68. package/dist/nextjs.d.mts +1 -1
  69. package/dist/node-control.d.mts +3 -3
  70. package/dist/node-control.mjs +2 -2
  71. package/dist/node.d.mts +2 -2
  72. package/dist/redaction-Bf8FvTFH-BTsKD9B5.d.mts +183 -0
  73. package/dist/redaction-Bf8FvTFH-BTsKD9B5.d.mts.map +1 -0
  74. package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs +295 -0
  75. package/dist/redaction-HnbkSFrK-BXRZ3B33.mjs.map +1 -0
  76. package/dist/report.d.mts +3 -3
  77. package/dist/report.mjs +1 -1
  78. package/dist/report.mjs.map +1 -1
  79. package/dist/{run-alchemy-B-Z6i3cD-C30mHT0u.mjs → run-alchemy-OS_ix5g0-DCvUYZ7T.mjs} +30 -13
  80. package/dist/run-alchemy-OS_ix5g0-DCvUYZ7T.mjs.map +1 -0
  81. package/dist/{run-report-CmBz2-xc-S50d4g5V.mjs → run-report-CmBz2-xc-Cc8rV1CX.mjs} +2 -2
  82. package/dist/{run-report-CmBz2-xc-S50d4g5V.mjs.map → run-report-CmBz2-xc-Cc8rV1CX.mjs.map} +1 -1
  83. package/dist/service-rpc.d.mts +2 -2
  84. package/dist/service-rpc.mjs +2 -2
  85. package/dist/testing.d.mts +1 -1
  86. package/dist/{validate-environment-BNZC6W46-CNGrBiHh.mjs → validate-environment-D_dECxgO-B-gqpVEf.mjs} +76 -13
  87. package/dist/validate-environment-D_dECxgO-B-gqpVEf.mjs.map +1 -0
  88. package/dist/zod.mjs +1 -2
  89. package/dist/zod.mjs.map +1 -1
  90. package/package.json +13 -13
  91. package/skills/prisma-composer-core-concepts/SKILL.md +4 -4
  92. package/src/exports/internal-app-configuration-file.ts +1 -0
  93. package/dist/app-config-RX-7kHbF-BroG2yMY.d.mts.map +0 -1
  94. package/dist/config-Dp3ZVNnN.d.mts +0 -1
  95. package/dist/config-adapters-BA_IeiX0-BiE51GeB.mjs +0 -84
  96. package/dist/config-adapters-BA_IeiX0-BiE51GeB.mjs.map +0 -1
  97. package/dist/config-pools-DiYw7wMu-DzeWrJdm.mjs +0 -63
  98. package/dist/config-pools-DiYw7wMu-DzeWrJdm.mjs.map +0 -1
  99. package/dist/deploy-Dp3ZVNnN.d.mts +0 -1
  100. package/dist/deploy.mjs.map +0 -1
  101. package/dist/deployment-summary-Cm4lN6w9-CGdGdlFC.d.mts.map +0 -1
  102. package/dist/deployment-summary-QkZexVIS-DqL4znd4.mjs.map +0 -1
  103. package/dist/describe-kind-Cpm_euxo-JFh8ejof.mjs +0 -14
  104. package/dist/describe-kind-Cpm_euxo-JFh8ejof.mjs.map +0 -1
  105. package/dist/execute-deploy-destroy-Cww6zOSC-D8eKSdMX.mjs.map +0 -1
  106. package/dist/execute-dev-4KYkqSMh-Ny8ATEfU.mjs.map +0 -1
  107. package/dist/graph-B_szUZs6--jpigkBW.d.mts.map +0 -1
  108. package/dist/graph-nazLWyK2-BBciBJje.mjs.map +0 -1
  109. package/dist/graph-types-CViux_yr-CVV2nQ0l.d.mts.map +0 -1
  110. package/dist/internal-pools.d.mts +0 -18
  111. package/dist/internal-pools.d.mts.map +0 -1
  112. package/dist/internal-pools.mjs +0 -2
  113. package/dist/run-alchemy-B-Z6i3cD-C30mHT0u.mjs.map +0 -1
  114. package/dist/secret-DoWGmN7m-CI5Yrldp.mjs.map +0 -1
  115. package/dist/validate-environment-BNZC6W46-CNGrBiHh.mjs.map +0 -1
  116. package/src/exports/internal-pools.ts +0 -1
@@ -0,0 +1,295 @@
1
+ import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
+ //#region ../../0-framework/3-tooling/cli/dist/redaction-HnbkSFrK.mjs
3
+ const REDACTED = "[redacted]";
4
+ /** Env var names whose values are credentials: the service token, preflight payloads, and the usual secret spellings. */
5
+ const SECRET_ENV_NAME = /TOKEN|SECRET|PASSWORD|PASSWD|PRIVATE|CREDENTIAL|AUTH|API_?KEY|ACCESS_?KEY|_KEY$|DATABASE_URL|_DSN$|^PRISMA_COMPOSER_PREFLIGHT_/i;
6
+ /**
7
+ * The credential-looking values in `variables`: text of eight characters or more under a name
8
+ * that looks like a credential's. The length limit keeps a one-letter placeholder from blanking
9
+ * every matching letter.
10
+ */
11
+ function credentialLookingValues(variables) {
12
+ return Object.entries(variables).flatMap(([name, value]) => SECRET_ENV_NAME.test(name) && typeof value === "string" && value.length >= 8 ? [value] : []);
13
+ }
14
+ /**
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.
18
+ */
19
+ var SecretMatcher = class {
20
+ starts;
21
+ prefixes = /* @__PURE__ */ new Set();
22
+ longestPrefix;
23
+ constructor(values) {
24
+ const sorted = [...new Set(values)].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);
25
+ this.starts = sorted.length === 0 ? void 0 : new RegExp(`(?=(${sorted.map((value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")}))`, "g");
26
+ for (const value of sorted) for (let length = 1; length < value.length; length++) this.prefixes.add(value.slice(0, length));
27
+ this.longestPrefix = Math.max(0, (sorted[0]?.length ?? 0) - 1);
28
+ }
29
+ /** The merged spans of every secret in `text`, in order, as `[start, end)`. */
30
+ spans(text) {
31
+ const spans = [];
32
+ if (this.starts === void 0) return spans;
33
+ for (const match of text.matchAll(this.starts)) {
34
+ const start = match.index;
35
+ const end = start + (match[1]?.length ?? 0);
36
+ const last = spans.at(-1);
37
+ if (last !== void 0 && start < last[1]) last[1] = Math.max(last[1], end);
38
+ else spans.push([start, end]);
39
+ }
40
+ return spans;
41
+ }
42
+ /** The length of the longest end of `text` that is the start, not the whole, of a secret. */
43
+ startOfSecretAtEnd(text) {
44
+ for (let length = Math.min(this.longestPrefix, text.length); length > 0; length--) if (this.prefixes.has(text.slice(text.length - length))) return length;
45
+ return 0;
46
+ }
47
+ /** `text` with each span replaced by `[redacted]`. */
48
+ redact(text) {
49
+ let out = "";
50
+ let from = 0;
51
+ for (const [start, end] of this.spans(text)) {
52
+ out += text.slice(from, start) + REDACTED;
53
+ from = end;
54
+ }
55
+ return from === 0 ? text : out + text.slice(from);
56
+ }
57
+ };
58
+ /** `text` with each value in `values` replaced by `[redacted]`, at any length; an empty one is skipped. Overlapping values are hidden whole. */
59
+ function redactValues(text, values) {
60
+ return new SecretMatcher(values).redact(text);
61
+ }
62
+ /** `text` with bearer and basic tokens, JWTs, the password in a URL, and `token=…`-style pairs replaced by `[redacted]`. */
63
+ function redactShapes(text) {
64
+ 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*["']?)[^\s"',;&]+/gi, `$1${REDACTED}`);
65
+ }
66
+ /**
67
+ * `text` with the credential-looking values of `env` and the credential shapes replaced by
68
+ * `[redacted]`. For a process that has no `SecretRedaction`; `SecretRedaction.redact` hides
69
+ * the known secrets too.
70
+ */
71
+ function redactCredentialLooking(text, env) {
72
+ return redactShapes(redactValues(text, credentialLookingValues(env)));
73
+ }
74
+ /**
75
+ * The known secrets of one command: the values under the secrets keys the graph names, in the app
76
+ * secrets and the app configuration (ADR-0062). The app configuration file must not hold any of them.
77
+ */
78
+ var KnownSecrets = class {
79
+ #names = /* @__PURE__ */ new Map();
80
+ constructor(secrets = []) {
81
+ this.add(secrets);
82
+ }
83
+ /** Adds each secret whose value is not empty. A value already known keeps its first name. */
84
+ add(secrets) {
85
+ for (const { name, value } of secrets) if (value.length > 0 && !this.#names.has(value)) this.#names.set(value, name);
86
+ }
87
+ values() {
88
+ return new Set(this.#names.keys());
89
+ }
90
+ /**
91
+ * The name of a known secret `text` holds, or undefined. A secret of
92
+ * `MIN_SECRET_LENGTH_INSIDE_A_VALUE` characters or more is found anywhere in `text`; a shorter
93
+ * one only when it is all of `text`.
94
+ */
95
+ nameIn(text) {
96
+ for (const [value, name] of this.#names) if (value.length >= 8 ? text.includes(value) : text === value) return name;
97
+ }
98
+ };
99
+ /**
100
+ * What one command hides from everything it prints, returns or reports (ADR-0062): its known
101
+ * secrets, and the credential-looking values, which only look like secrets by the name of the
102
+ * variable they are under. It starts with the credential-looking values of the process
103
+ * environment.
104
+ */
105
+ var SecretRedaction = class {
106
+ knownSecrets = new KnownSecrets();
107
+ credentialLooking = /* @__PURE__ */ new Set();
108
+ matcher;
109
+ constructor(env) {
110
+ this.addCredentialLookingValues(credentialLookingValues(env));
111
+ }
112
+ addKnownSecrets(secrets) {
113
+ this.knownSecrets.add(secrets);
114
+ }
115
+ addCredentialLookingValues(values) {
116
+ for (const value of values) if (value.length > 0) this.credentialLooking.add(value);
117
+ }
118
+ /** The known secrets and the credential-looking values, longest first. */
119
+ allValues() {
120
+ return [.../* @__PURE__ */ new Set([...this.knownSecrets.values(), ...this.credentialLooking])].sort((a, b) => b.length - a.length);
121
+ }
122
+ /** `text` with every known secret and credential-looking value replaced by `[redacted]` at any length, then bearer tokens, JWTs, URL passwords and `token=…` pairs. */
123
+ redact(text) {
124
+ const size = this.knownSecrets.values().size + this.credentialLooking.size;
125
+ if (this.matcher?.size !== size) this.matcher = {
126
+ size,
127
+ matcher: new SecretMatcher(this.allValues())
128
+ };
129
+ return redactShapes(this.matcher.matcher.redact(text));
130
+ }
131
+ };
132
+ /** The text under each name in `secretsKeys`, in the app configuration and in the app secrets, at any length. */
133
+ function valuesUnderSecretsKeys(configuration, secrets, secretsKeys) {
134
+ return secretsKeys.flatMap((name) => [configuration[name], secrets[name]].flatMap((value) => typeof value === "string" ? [{
135
+ name,
136
+ value
137
+ }] : []));
138
+ }
139
+ function redactData(value, redaction) {
140
+ if (typeof value === "string") return redaction.redact(value);
141
+ if (Array.isArray(value)) return value.map((member) => redactData(member, redaction));
142
+ if (typeof value === "object" && value !== null && Object.getPrototypeOf(value) === Object.prototype) return Object.fromEntries(Object.entries(value).map(([key, member]) => [key, redactData(member, redaction)]));
143
+ return value;
144
+ }
145
+ /**
146
+ * `error` with every value `redaction` hides removed from its summary, `why`, `fix` and every string in
147
+ * its `meta`. The code, severity, `where` and docs link are kept. The cause is dropped, because
148
+ * it holds the same text unredacted and a renderer may print it.
149
+ */
150
+ function redactError(error, redaction) {
151
+ return new CliStructuredError(error.code, redaction.redact(error.message), {
152
+ severity: error.severity,
153
+ ...error.why === void 0 ? {} : { why: redaction.redact(error.why) },
154
+ ...error.fix === void 0 ? {} : { fix: redaction.redact(error.fix) },
155
+ ...error.where === void 0 ? {} : { where: error.where },
156
+ ...error.meta === void 0 ? {} : { meta: Object.fromEntries(Object.entries(error.meta).map(([key, value]) => [key, redactData(value, redaction)])) },
157
+ ...error.docsUrl === void 0 ? {} : { docsUrl: error.docsUrl }
158
+ });
159
+ }
160
+ function setOwn(error, name, value) {
161
+ Object.defineProperty(error, name, {
162
+ value,
163
+ writable: true,
164
+ configurable: true
165
+ });
166
+ }
167
+ const UNPRINTABLE = "A value was thrown that cannot be turned into text.";
168
+ function safeString(value) {
169
+ try {
170
+ return String(value);
171
+ } catch {
172
+ try {
173
+ return Object.prototype.toString.call(value);
174
+ } catch {
175
+ return UNPRINTABLE;
176
+ }
177
+ }
178
+ }
179
+ /**
180
+ * The error to rethrow in place of a thrown defect, with every secret removed from its message
181
+ * and stack, and from those of each error in its `cause` chain and in an `AggregateError`'s
182
+ * `errors`. A cause that is text or plain data becomes a redacted copy. Each error is redacted
183
+ * in place where it can be. One whose properties cannot change, such as a frozen error, is
184
+ * replaced by a new error with the redacted message, stack and cause. A thrown value that is not
185
+ * an `Error` becomes an `Error` whose message is its redacted text. Never throws: when reading
186
+ * the error fails, the result is a new `Error` holding the redacted text of what was thrown.
187
+ */
188
+ function redactThrown(thrown, redaction) {
189
+ try {
190
+ return thrown instanceof Error ? redactErrorChain(thrown, redaction, /* @__PURE__ */ new Map()) : new Error(redaction.redact(safeString(thrown)));
191
+ } catch {
192
+ return new Error(redaction.redact(safeString(thrown)));
193
+ }
194
+ }
195
+ function redactErrorChain(error, redaction, seen) {
196
+ const done = seen.get(error);
197
+ if (done !== void 0) return done;
198
+ seen.set(error, error);
199
+ const message = redaction.redact(typeof error.message === "string" ? error.message : safeString(error.message));
200
+ const stack = typeof error.stack === "string" ? redaction.redact(error.stack) : void 0;
201
+ const cause = error.cause instanceof Error ? redactErrorChain(error.cause, redaction, seen) : redactData(error.cause, redaction);
202
+ const members = error instanceof AggregateError ? error.errors.map((member) => member instanceof Error ? redactErrorChain(member, redaction, seen) : redactData(member, redaction)) : void 0;
203
+ try {
204
+ setOwn(error, "message", message);
205
+ if (stack !== void 0) setOwn(error, "stack", stack);
206
+ if (error.cause !== void 0) setOwn(error, "cause", cause);
207
+ if (members !== void 0) setOwn(error, "errors", members);
208
+ return error;
209
+ } catch {
210
+ const options = cause === void 0 ? void 0 : { cause };
211
+ const copy = members === void 0 ? new Error(message, options) : new AggregateError(members, message, options);
212
+ copy.name = error.name;
213
+ setOwn(copy, "stack", stack ?? `${error.name}: ${message}`);
214
+ seen.set(error, copy);
215
+ return copy;
216
+ }
217
+ }
218
+ /** `event` with every value `redaction` hides removed from the text it carries: a message, or a dev server's output line. */
219
+ function redactDevEvent(event, redaction) {
220
+ switch (event.kind) {
221
+ case "target-warning":
222
+ case "rebuild-failed":
223
+ case "watch-error":
224
+ case "stop-error": return {
225
+ ...event,
226
+ message: redaction.redact(event.message)
227
+ };
228
+ case "dev-server-output": return {
229
+ ...event,
230
+ line: redaction.redact(event.line)
231
+ };
232
+ default: return event;
233
+ }
234
+ }
235
+ /** `summary` with every value `redaction` hides removed from each entity's id, url and details. */
236
+ function redactSummary(summary, redaction) {
237
+ if (summary === void 0) return void 0;
238
+ return {
239
+ app: summary.app,
240
+ nodes: summary.nodes.map((node) => ({
241
+ address: node.address,
242
+ entities: node.entities.map((entity) => ({
243
+ ...entity,
244
+ id: redaction.redact(entity.id),
245
+ ...entity.url === void 0 ? {} : { url: redaction.redact(entity.url) },
246
+ ...entity.details === void 0 ? {} : { details: Object.fromEntries(Object.entries(entity.details).map(([key, value]) => [key, redaction.redact(value)])) }
247
+ }))
248
+ }))
249
+ };
250
+ }
251
+ function isHighSurrogate(code) {
252
+ return code >= 55296 && code <= 56319;
253
+ }
254
+ /**
255
+ * Redacts a stream of text chunk by chunk: every value in `values` becomes `[redacted]`, and
256
+ * overlapping values are hidden whole. It holds back only the end of the text that could still
257
+ * be part of a value: the longest end that could start one, or a match that a later value could
258
+ * extend. So a value split across two chunks is still replaced, and text that cannot start one,
259
+ * such as a prompt, is returned at once. It never splits a surrogate pair. `push` returns the
260
+ * text that is ready; `end` returns the rest.
261
+ */
262
+ var StreamRedactor = class {
263
+ held = "";
264
+ matcher;
265
+ constructor(values) {
266
+ this.matcher = new SecretMatcher(values);
267
+ }
268
+ push(chunk) {
269
+ const text = this.held + chunk;
270
+ const cut = text.length - this.matcher.startOfSecretAtEnd(text);
271
+ let out = "";
272
+ let from = 0;
273
+ let ready = cut;
274
+ for (const [start, end] of this.matcher.spans(text)) {
275
+ if (end > cut) {
276
+ ready = Math.min(cut, start);
277
+ break;
278
+ }
279
+ out += text.slice(from, start) + REDACTED;
280
+ from = end;
281
+ }
282
+ if (ready > from && ready < text.length && isHighSurrogate(text.charCodeAt(ready - 1))) ready -= 1;
283
+ this.held = text.slice(ready);
284
+ return out + text.slice(from, ready);
285
+ }
286
+ end() {
287
+ const text = this.held;
288
+ this.held = "";
289
+ return this.matcher.redact(text);
290
+ }
291
+ };
292
+ //#endregion
293
+ export { redactDevEvent as a, redactThrown as c, redactCredentialLooking as i, valuesUnderSecretsKeys as l, StreamRedactor as n, redactError as o, credentialLookingValues as r, redactSummary as s, SecretRedaction as t };
294
+
295
+ //# sourceMappingURL=redaction-HnbkSFrK-BXRZ3B33.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redaction-HnbkSFrK-BXRZ3B33.mjs","names":["#names"],"sources":["../../../0-framework/3-tooling/cli/dist/redaction-HnbkSFrK.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\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/**\n* Finds every secret in a text: one regular expression for all of them, built once. A match\n* is the span of the longest secret that starts at a position, and spans that overlap are\n* merged, so two overlapping 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)].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]`. */\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*[\"']?)[^\\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 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\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, credentialLookingValues as i, redactThrown as l, SecretRedaction as n, redactDevEvent as o, StreamRedactor as r, redactError as s, KnownSecrets as t, valuesUnderSecretsKeys as u };\n\n//# sourceMappingURL=redaction-HnbkSFrK.mjs.map"],"mappings":";;AAEA,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;;;;;;AAMA,IAAI,gBAAgB,MAAM;CACzB;CACA,2BAA2B,IAAI,IAAI;CACnC;CACA,YAAY,QAAQ;EACnB,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,QAAQ,UAAU,MAAM,SAAS,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM;EAC1G,KAAK,SAAS,OAAO,WAAW,IAAI,KAAK,IAAI,IAAI,OAAO,OAAO,OAAO,KAAK,UAAU,MAAM,QAAQ,uBAAuB,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,KAAK,GAAG;EACrJ,KAAK,MAAM,SAAS,QAAQ,KAAK,IAAI,SAAS,GAAG,SAAS,MAAM,QAAQ,UAAU,KAAK,SAAS,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC;EAC1H,KAAK,gBAAgB,KAAK,IAAI,IAAI,OAAO,EAAE,EAAE,UAAU,KAAK,CAAC;CAC9D;;CAEA,MAA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zJ,EAAE;EACH,EAAE;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-RX-7kHbF-BroG2yMY.mjs";
2
- import "./deploy-Dp3ZVNnN.mjs";
3
- import { r as captureEngineFailure } from "./deployment-summary-Cm4lN6w9-CGdGdlFC.mjs";
1
+ import { v as DeploymentResult } from "./app-config-Bf_y5R7o-BEZAnKqM.mjs";
2
+ import "./deploy-DQyaIoNe.mjs";
3
+ import { r as captureEngineFailure } from "./deployment-summary-p88NV5m5-BJOosgmI.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,4 +1,4 @@
1
- import { n as captureEngineFailure, s as writeDeploymentSummaryFile } from "./deployment-summary-QkZexVIS-DqL4znd4.mjs";
1
+ import { n as captureEngineFailure, o as writeDeploymentSummaryFile } from "./deployment-summary-BiBkPWlB-CyC2pudN.mjs";
2
2
  //#region ../../0-framework/3-tooling/cli/dist/report.mjs
3
3
  /** Gap between the deepest tree label and the entity column. */
4
4
  const LABEL_GAP = 3;
@@ -1 +1 @@
1
- {"version":3,"file":"report.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/report.mjs"],"sourcesContent":["import { n as captureEngineFailure, s as writeDeploymentSummaryFile } from \"./deployment-summary-QkZexVIS.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\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":";;;AAGA,MAAM,YAAY;AAClB,MAAM,aAAa,aAAa;CAC/B;CACA,0BAA0B,IAAI,IAAI;AAC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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,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/report.mjs"],"sourcesContent":["import { n as captureEngineFailure, o as writeDeploymentSummaryFile } from \"./deployment-summary-BiBkPWlB.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\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":";;;AAGA,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,IAAI,OAAO;EACX,KAAK,MAAM,WAAW,SAAS,QAAQ,MAAM,GAAG,GAAG;GAClD,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO;GACrC,IAAI,UAAU,KAAK,GAAG;IACrB,QAAQ,UAAU,OAAO;IACzB,KAAK,SAAS,IAAI,SAAS,KAAK;GACjC;GACA,OAAO;EACR;EACA,KAAK,WAAW;CACjB;CACA,OAAO;AACR;;AAEA,SAAS,OAAO,MAAM,QAAQ,MAAM;CACnC,MAAM,WAAW,MAAM,KAAK,KAAK,SAAS,OAAO,CAAC;CAClD,SAAS,SAAS,OAAO,UAAU;EAClC,MAAM,SAAS,UAAU,SAAS,SAAS;EAC3C,KAAK,KAAK;GACT,OAAO,GAAG,SAAS,SAAS,QAAQ,QAAQ,MAAM;GAClD,cAAc,GAAG,SAAS,SAAS,QAAQ;GAC3C,UAAU,MAAM;EACjB,CAAC;EACD,OAAO,OAAO,GAAG,SAAS,SAAS,QAAQ,SAAS,IAAI;CACzD,CAAC;AACF;;AAEA,MAAM,cAAc,WAAW,GAAG,OAAO,KAAK,GAAG,OAAO;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1,10 +1,10 @@
1
1
  import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
2
- import { t as childEnvironment } from "./config-adapters-BA_IeiX0-BiE51GeB.mjs";
2
+ import { n as StreamRedactor } from "./redaction-HnbkSFrK-BXRZ3B33.mjs";
3
3
  import { createRequire } from "node:module";
4
- import * as fs$1 from "node:fs";
5
4
  import * as path$1 from "node:path";
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-B-Z6i3cD.mjs
7
+ //#region ../../0-framework/3-tooling/cli/dist/run-alchemy-OS_ix5g0.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
@@ -67,7 +67,8 @@ function resolveAlchemyBin(appDir) {
67
67
  }
68
68
  /**
69
69
  * Pipeline step 9 (deploy-cli.md § The pipeline; design-notes.md's "Driving
70
- * Alchemy" call): hand the terminal to the generated stack file.
70
+ * Alchemy" call): run the generated stack file and, for programmatic hosts, pipe its
71
+ * output through redaction.
71
72
  *
72
73
  * Runs the bin of the `alchemy` the app's `@prisma/composer` depends on
73
74
  * (`resolveAlchemyBin`), started with Node (`nodeExecutable`). Never a
@@ -78,7 +79,9 @@ function resolveAlchemyBin(appDir) {
78
79
  * started. Under the CLI the engine starts it (`ctx.spawn`), which is what
79
80
  * makes Ctrl-C reach the child natively and keeps signal policy in one place.
80
81
  * `spawnAlchemy` is the default for programmatic hosts driving
81
- * `@prisma/composer/control`, which have no engine to borrow.
82
+ * `@prisma/composer/control`, which have no engine to borrow. Only
83
+ * `spawnAlchemy` redacts the child's output; under the CLI the child gets the
84
+ * terminal and its output is not redacted (ADR-0062).
82
85
  */
83
86
  function currentRuntime() {
84
87
  return {
@@ -147,15 +150,16 @@ function alchemyInvocation(input) {
147
150
  stackFileRelativePath: input.stackFileRelativePath,
148
151
  cwd: input.cwd,
149
152
  stage: input.stage,
150
- env: childEnvironment({
153
+ env: {
151
154
  ...input.containerEnv,
152
155
  ...input.preflightEnv,
153
156
  ...input.env
154
- })
157
+ },
158
+ redactedValues: input.redactedValues
155
159
  };
156
160
  }
157
161
  /**
158
- * The default runner for hosts with no engine: inherited stdio, the caller's
162
+ * The default runner for hosts with no engine: stdin inherited and output piped through redaction, the caller's
159
163
  * own process group, and the child's status returned verbatim. It does not
160
164
  * collapse a signal into an exit code — that collapse is what made a
161
165
  * Ctrl-C'd deploy report itself as a failure.
@@ -163,7 +167,7 @@ function alchemyInvocation(input) {
163
167
  const spawnAlchemy = async (invocation) => {
164
168
  const commandLine = alchemyCommandLine(invocation);
165
169
  return {
166
- ...await spawnCommandLine(commandLine),
170
+ ...await spawnCommandLine(commandLine, invocation.redactedValues),
167
171
  commandLine
168
172
  };
169
173
  };
@@ -193,19 +197,32 @@ function reproduceCommand(invocation, outcome, platform = process.platform) {
193
197
  invocation.stage
194
198
  ] : [outcome.commandLine.command, ...outcome.commandLine.args]).map((arg) => shellArg(arg, platform)).join(" ");
195
199
  }
196
- /** Starts a resolved command line with inherited stdio and returns how it ended. */
197
- function spawnCommandLine(line) {
200
+ /** Starts a resolved command line with stdin inherited and its output piped through redaction, and returns how it ended. */
201
+ function spawnCommandLine(line, redactedValues, outputs = process) {
198
202
  return new Promise((resolve, reject) => {
199
203
  const child = spawn(line.command, [...line.args], {
200
204
  cwd: line.cwd,
201
- stdio: "inherit",
205
+ stdio: [
206
+ "inherit",
207
+ "pipe",
208
+ "pipe"
209
+ ],
202
210
  env: {
203
211
  ...process.env,
204
212
  ...line.env
205
213
  }
206
214
  });
215
+ const stdout = new StreamRedactor(redactedValues);
216
+ const stderr = new StreamRedactor(redactedValues);
217
+ const write = (stream, text) => {
218
+ if (text.length > 0) stream.write(text);
219
+ };
220
+ child.stdout?.setEncoding("utf8").on("data", (chunk) => write(outputs.stdout, stdout.push(chunk)));
221
+ child.stderr?.setEncoding("utf8").on("data", (chunk) => write(outputs.stderr, stderr.push(chunk)));
207
222
  child.on("error", reject);
208
223
  child.on("close", (exitCode, signal) => {
224
+ write(outputs.stdout, stdout.end());
225
+ write(outputs.stderr, stderr.end());
209
226
  resolve({
210
227
  exitCode,
211
228
  signal
@@ -216,4 +233,4 @@ function spawnCommandLine(line) {
216
233
  //#endregion
217
234
  export { reproduceCommand as n, spawnAlchemy as r, alchemyInvocation as t };
218
235
 
219
- //# sourceMappingURL=run-alchemy-B-Z6i3cD-C30mHT0u.mjs.map
236
+ //# sourceMappingURL=run-alchemy-OS_ix5g0-DCvUYZ7T.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-alchemy-OS_ix5g0-DCvUYZ7T.mjs","names":["path","fs"],"sources":["../../../0-framework/3-tooling/cli/dist/run-alchemy-OS_ix5g0.mjs"],"sourcesContent":["import { r as StreamRedactor } from \"./redaction-HnbkSFrK.mjs\";\nimport { createRequire } from \"node:module\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport spawn from \"cross-spawn\";\n//#region src/alchemy-bin.ts\n/**\n* Which Alchemy CLI runs a generated stack file: the `alchemy` that\n* `@prisma/composer` depends on, found from the app the way the stack file's\n* own `@prisma/composer/...` imports are. The CLI and the stack code then\n* come from one install, so the child loads one copy of `alchemy`.\n*\n* Node's resolver finds `@prisma/composer` from the app. It cannot find\n* `alchemy` from there: alchemy exports neither its `package.json` nor its\n* bin, and has no `require` condition. Bun has no `module.findPackageJSON`.\n* So the last step is Node's own lookup written out: each `node_modules`\n* above `@prisma/composer`'s real location, nearest first.\n*/\nconst FIX = \"Check that the app depends on @prisma/composer and that `alchemy`, which @prisma/composer depends on, is installed in a node_modules directory. Layouts without one, such as Yarn Plug'n'Play, are not supported.\";\nfunction binMissing(message) {\n\treturn new CliStructuredError(\"DEPLOY.ALCHEMY_BIN_MISSING\", message, { fix: FIX });\n}\nfunction composerPackageDir(appDir) {\n\ttry {\n\t\tconst manifest = createRequire(path.join(appDir, \"package.json\")).resolve(\"@prisma/composer/package.json\");\n\t\treturn path.dirname(fs.realpathSync(manifest));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction alchemyPackageDirAbove(dir) {\n\tfor (let current = dir;; current = path.dirname(current)) {\n\t\tconst candidate = path.join(current, \"node_modules\", \"alchemy\");\n\t\tif (fs.existsSync(path.join(candidate, \"package.json\"))) return candidate;\n\t\tif (path.dirname(current) === current) return void 0;\n\t}\n}\nfunction readPackageJson(packageDir) {\n\ttry {\n\t\treturn JSON.parse(fs.readFileSync(path.join(packageDir, \"package.json\"), \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction binOf(packageDir) {\n\tconst manifest = readPackageJson(packageDir);\n\tif (typeof manifest !== \"object\" || manifest === null || !(\"bin\" in manifest)) return void 0;\n\tconst bin = manifest.bin;\n\tconst relative = typeof bin === \"string\" ? bin : typeof bin === \"object\" && bin !== null && \"alchemy\" in bin ? bin.alchemy : void 0;\n\tif (typeof relative !== \"string\") return void 0;\n\tconst entry = path.join(packageDir, relative);\n\treturn fs.existsSync(entry) ? entry : void 0;\n}\n/**\n* The JavaScript file `alchemy`'s `bin` names, for the app in `appDir`.\n* Raises DEPLOY.ALCHEMY_BIN_MISSING when the app does not resolve\n* `@prisma/composer` or no usable `alchemy` is installed beside it.\n*/\nfunction resolveAlchemyBin(appDir) {\n\tconst composerDir = composerPackageDir(appDir);\n\tif (composerDir === void 0) throw binMissing(`Could not resolve @prisma/composer from \"${appDir}\".`);\n\tconst alchemyDir = alchemyPackageDirAbove(composerDir);\n\tconst entry = alchemyDir === void 0 ? void 0 : binOf(alchemyDir);\n\tif (entry === void 0) throw binMissing(`Could not resolve the bin of the \\`alchemy\\` package @prisma/composer depends on, from \"${composerDir}\".`);\n\treturn entry;\n}\n//#endregion\n//#region src/run-alchemy.ts\n/**\n* Pipeline step 9 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): run the generated stack file and, for programmatic hosts, pipe its\n* output through redaction.\n*\n* Runs the bin of the `alchemy` the app's `@prisma/composer` depends on\n* (`resolveAlchemyBin`), started with Node (`nodeExecutable`). Never a\n* `node_modules/.bin` link, which pnpm creates only for an app's direct\n* dependencies.\n*\n* This module composes the invocation; it does not decide how the child is\n* started. Under the CLI the engine starts it (`ctx.spawn`), which is what\n* makes Ctrl-C reach the child natively and keeps signal policy in one place.\n* `spawnAlchemy` is the default for programmatic hosts driving\n* `@prisma/composer/control`, which have no engine to borrow. Only\n* `spawnAlchemy` redacts the child's output; under the CLI the child gets the\n* terminal and its output is not redacted (ADR-0062).\n*/\nfunction currentRuntime() {\n\treturn {\n\t\tbun: process.versions.bun !== void 0,\n\t\texecPath: process.execPath,\n\t\tenv: process.env,\n\t\tplatform: process.platform,\n\t\texists: fs.existsSync\n\t};\n}\nfunction envValue(env, name) {\n\treturn Object.entries(env).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];\n}\n/** The file names `node` may have in a PATH directory: PATHEXT's extensions on Windows. */\nfunction nodeFileNames(runtime) {\n\tif (runtime.platform !== \"win32\") return [\"node\"];\n\treturn (envValue(runtime.env, \"PATHEXT\") ?? \".COM;.EXE;.BAT;.CMD\").split(\";\").filter((extension) => extension.length > 0).map((extension) => `node${extension}`);\n}\n/**\n* The Node that starts Alchemy's launcher: this process's own runtime under\n* Node, and the first `node` on PATH under Bun. Alchemy's launcher may still\n* move itself to Bun when the package-manager environment says Bun invoked\n* it (`bunx`, `bun run`), so the runtime Alchemy ends up on follows how\n* `prisma` was invoked.\n*/\nfunction nodeExecutable(runtime = currentRuntime()) {\n\tif (!runtime.bun) return runtime.execPath;\n\tconst paths = runtime.platform === \"win32\" ? path.win32 : path.posix;\n\tconst names = nodeFileNames(runtime);\n\tfor (const rawDir of (envValue(runtime.env, \"PATH\") ?? \"\").split(paths.delimiter)) {\n\t\tconst dir = rawDir.replace(/^\"(.*)\"$/, \"$1\");\n\t\tif (dir.length === 0) continue;\n\t\tfor (const name of names) {\n\t\t\tconst candidate = paths.join(dir, name);\n\t\t\tif (runtime.exists(candidate)) return candidate;\n\t\t}\n\t}\n\tthrow new CliStructuredError(\"DEPLOY.NODE_MISSING\", \"Composer starts Alchemy with Node, and no `node` was found on PATH.\", { fix: \"Install Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer, and put it on PATH, or run `prisma` under Node.\" });\n}\n/**\n* Resolves the invocation against this machine — the step every adapter takes\n* and no caller should. Runs alchemy's JavaScript entry with Node, so no shell\n* shim is involved on any platform. Raises DEPLOY.ALCHEMY_BIN_MISSING when\n* Composer's alchemy cannot be resolved, and DEPLOY.NODE_MISSING when no Node\n* can run it.\n*/\nfunction alchemyCommandLine(invocation, alchemyBin = resolveAlchemyBin(invocation.cwd), node = nodeExecutable()) {\n\treturn {\n\t\tcommand: node,\n\t\targs: [\n\t\t\talchemyBin,\n\t\t\tinvocation.action,\n\t\t\tinvocation.stackFileRelativePath,\n\t\t\t\"--yes\",\n\t\t\t\"--stage\",\n\t\t\tinvocation.stage\n\t\t],\n\t\tcwd: invocation.cwd,\n\t\tenv: invocation.env\n\t};\n}\n/** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */\nfunction alchemyInvocation(input) {\n\treturn {\n\t\taction: input.command,\n\t\tstackFileRelativePath: input.stackFileRelativePath,\n\t\tcwd: input.cwd,\n\t\tstage: input.stage,\n\t\tenv: {\n\t\t\t...input.containerEnv,\n\t\t\t...input.preflightEnv,\n\t\t\t...input.env\n\t\t},\n\t\tredactedValues: input.redactedValues\n\t};\n}\n/**\n* The default runner for hosts with no engine: stdin inherited and output piped through redaction, the caller's\n* own process group, and the child's status returned verbatim. It does not\n* collapse a signal into an exit code — that collapse is what made a\n* Ctrl-C'd deploy report itself as a failure.\n*/\nconst spawnAlchemy = async (invocation) => {\n\tconst commandLine = alchemyCommandLine(invocation);\n\treturn {\n\t\t...await spawnCommandLine(commandLine, invocation.redactedValues),\n\t\tcommandLine\n\t};\n};\n/**\n* One argument as the platform's shell reads it literally: single quotes for\n* POSIX shells, double quotes for cmd.exe. cmd.exe expands `%VAR%` inside\n* double quotes, and strips or expands `!` when delayed expansion is on; no\n* quoting prevents either, so an argument containing them is not fully\n* literal there.\n*/\nfunction shellArg(arg, platform) {\n\tif (platform === \"win32\") return /^[\\w@+=:,./\\\\~-]+$/.test(arg) ? arg : `\"${arg.replaceAll(\"\\\"\", \"\\\"\\\"\")}\"`;\n\treturn /^[\\w@%+=:,./-]+$/.test(arg) ? arg : `'${arg.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n/**\n* The command a user runs from the invocation's directory to repeat a\n* converge: the command line the adapter started, or, from an adapter that\n* does not report one, `alchemy` with the same arguments.\n*/\nfunction reproduceCommand(invocation, outcome, platform = process.platform) {\n\treturn (outcome?.commandLine === void 0 ? [\n\t\t\"alchemy\",\n\t\tinvocation.action,\n\t\tinvocation.stackFileRelativePath,\n\t\t\"--yes\",\n\t\t\"--stage\",\n\t\tinvocation.stage\n\t] : [outcome.commandLine.command, ...outcome.commandLine.args]).map((arg) => shellArg(arg, platform)).join(\" \");\n}\n/** Starts a resolved command line with stdin inherited and its output piped through redaction, and returns how it ended. */\nfunction spawnCommandLine(line, redactedValues, outputs = process) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(line.command, [...line.args], {\n\t\t\tcwd: line.cwd,\n\t\t\tstdio: [\n\t\t\t\t\"inherit\",\n\t\t\t\t\"pipe\",\n\t\t\t\t\"pipe\"\n\t\t\t],\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\t...line.env\n\t\t\t}\n\t\t});\n\t\tconst stdout = new StreamRedactor(redactedValues);\n\t\tconst stderr = new StreamRedactor(redactedValues);\n\t\tconst write = (stream, text) => {\n\t\t\tif (text.length > 0) stream.write(text);\n\t\t};\n\t\tchild.stdout?.setEncoding(\"utf8\").on(\"data\", (chunk) => write(outputs.stdout, stdout.push(chunk)));\n\t\tchild.stderr?.setEncoding(\"utf8\").on(\"data\", (chunk) => write(outputs.stderr, stderr.push(chunk)));\n\t\tchild.on(\"error\", reject);\n\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\twrite(outputs.stdout, stdout.end());\n\t\t\twrite(outputs.stderr, stderr.end());\n\t\t\tresolve({\n\t\t\t\texitCode,\n\t\t\t\tsignal\n\t\t\t});\n\t\t});\n\t});\n}\n//#endregion\nexport { spawnAlchemy as i, alchemyInvocation as n, reproduceCommand as r, alchemyCommandLine as t };\n\n//# sourceMappingURL=run-alchemy-OS_ix5g0.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,MAAM;AACZ,SAAS,WAAW,SAAS;CAC5B,OAAO,IAAI,mBAAmB,8BAA8B,SAAS,EAAE,KAAK,IAAI,CAAC;AAClF;AACA,SAAS,mBAAmB,QAAQ;CACnC,IAAI;EACH,MAAM,WAAW,cAAcA,OAAK,KAAK,QAAQ,cAAc,CAAC,CAAC,CAAC,QAAQ,+BAA+B;EACzG,OAAOA,OAAK,QAAQC,KAAG,aAAa,QAAQ,CAAC;CAC9C,QAAQ;EACP;CACD;AACD;AACA,SAAS,uBAAuB,KAAK;CACpC,KAAK,IAAI,UAAU,MAAM,UAAUD,OAAK,QAAQ,OAAO,GAAG;EACzD,MAAM,YAAYA,OAAK,KAAK,SAAS,gBAAgB,SAAS;EAC9D,IAAIC,KAAG,WAAWD,OAAK,KAAK,WAAW,cAAc,CAAC,GAAG,OAAO;EAChE,IAAIA,OAAK,QAAQ,OAAO,MAAM,SAAS,OAAO,KAAK;CACpD;AACD;AACA,SAAS,gBAAgB,YAAY;CACpC,IAAI;EACH,OAAO,KAAK,MAAMC,KAAG,aAAaD,OAAK,KAAK,YAAY,cAAc,GAAG,MAAM,CAAC;CACjF,QAAQ;EACP;CACD;AACD;AACA,SAAS,MAAM,YAAY;CAC1B,MAAM,WAAW,gBAAgB,UAAU;CAC3C,IAAI,OAAO,aAAa,YAAY,aAAa,QAAQ,EAAE,SAAS,WAAW,OAAO,KAAK;C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from "node:path";
2
+ import * as fs$1 from "node:fs";
3
3
  //#region ../../0-framework/3-tooling/cli/dist/run-report-CmBz2-xc.mjs
4
4
  /**
5
5
  * The run report: one deploy's outcome as JSON, for tools that consume a
@@ -57,4 +57,4 @@ function writeRunReport(filePath, report) {
57
57
  //#endregion
58
58
  export { writeRunReport as a, toRunReport as i, RUN_REPORT_VERSION as n, resolveRunReportPath as r, RUN_REPORT_FILE_ENV as t };
59
59
 
60
- //# sourceMappingURL=run-report-CmBz2-xc-S50d4g5V.mjs.map
60
+ //# sourceMappingURL=run-report-CmBz2-xc-Cc8rV1CX.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-report-CmBz2-xc-S50d4g5V.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/run-report-CmBz2-xc.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/run-report.ts\n/**\n* The run report: one deploy's outcome as JSON, for tools that consume a\n* deploy rather than watch one — the Prisma GitHub Action reads it to build a\n* pull-request comment carrying preview links.\n*\n* Deliberately separate from `deployment-summary.ts`. That file is a private\n* carrier between the alchemy child and this process, written to a\n* per-run path the parent deletes in a `finally` so resource ids and URLs do\n* not accumulate on disk. This one is written where the operator asked for\n* it, survives the run, is written on the failure path too, and carries a\n* version so a consumer can depend on its shape.\n*/\n/** Bump when a change would break a consumer that reads the current shape. */\nconst RUN_REPORT_VERSION = 2;\n/** Names the file to write the run report to, when `--report` is not passed. */\nconst RUN_REPORT_FILE_ENV = \"PRISMA_COMPOSER_REPORT_FILE\";\nfunction toRunReport(input) {\n\treturn {\n\t\tversion: 2,\n\t\toutcome: input.failure === void 0 ? \"succeeded\" : \"failed\",\n\t\tapp: input.summary?.app ?? null,\n\t\tenvironment: input.environment,\n\t\tnodes: input.summary?.nodes ?? [],\n\t\tfailure: input.failure ?? null\n\t};\n}\n/**\n* The path to write to: the `--report` flag first, then the env var. Relative\n* paths resolve against the deploy's cwd. `undefined` means no report was\n* asked for, which is the common case and writes nothing.\n*/\nfunction resolveRunReportPath(flag, env, cwd) {\n\tconst requested = flag !== void 0 && flag.length > 0 ? flag : env;\n\tif (requested === void 0 || requested.length === 0) return void 0;\n\treturn path.resolve(cwd, requested);\n}\n/**\n* Writes the report, creating the parent directory if needed. A write failure\n* warns and returns false rather than failing a deploy that already\n* converged — but it is never silent, because the operator asked for this\n* file and a consumer is waiting on it.\n*/\nfunction writeRunReport(filePath, report) {\n\ttry {\n\t\tfs.mkdirSync(path.dirname(filePath), { recursive: true });\n\t\tfs.writeFileSync(filePath, `${JSON.stringify(report, null, 2)}\\n`);\n\t\treturn true;\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not write the run report to ${filePath}: ${detail}`);\n\t\treturn false;\n\t}\n}\n//#endregion\nexport { writeRunReport as a, toRunReport as i, RUN_REPORT_VERSION as n, resolveRunReportPath as r, RUN_REPORT_FILE_ENV as t };\n\n//# sourceMappingURL=run-report-CmBz2-xc.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,qBAAqB;;AAE3B,MAAM,sBAAsB;AAC5B,SAAS,YAAY,OAAO;CAC3B,OAAO;EACN,SAAS;EACT,SAAS,MAAM,YAAY,KAAK,IAAI,cAAc;EAClD,KAAK,MAAM,SAAS,OAAO;EAC3B,aAAa,MAAM;EACnB,OAAO,MAAM,SAAS,SAAS,CAAC;EAChC,SAAS,MAAM,WAAW;CAC3B;AACD;;;;;;AAMA,SAAS,qBAAqB,MAAM,KAAK,KAAK;CAC7C,MAAM,YAAY,SAAS,KAAK,KAAK,KAAK,SAAS,IAAI,OAAO;CAC9D,IAAI,cAAc,KAAK,KAAK,UAAU,WAAW,GAAG,OAAO,KAAK;CAChE,OAAOA,OAAK,QAAQ,KAAK,SAAS;AACnC;;;;;;;AAOA,SAAS,eAAe,UAAU,QAAQ;CACzC,IAAI;EACH,KAAG,UAAUA,OAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;EACxD,KAAG,cAAc,UAAU,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,GAAG;EACjE,OAAO;CACR,SAAS,OAAO;EACf,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACpE,QAAQ,KAAK,uCAAuC,SAAS,IAAI,QAAQ;EACzE,OAAO;CACR;AACD"}
1
+ {"version":3,"file":"run-report-CmBz2-xc-Cc8rV1CX.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/run-report-CmBz2-xc.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n//#region src/run-report.ts\n/**\n* The run report: one deploy's outcome as JSON, for tools that consume a\n* deploy rather than watch one — the Prisma GitHub Action reads it to build a\n* pull-request comment carrying preview links.\n*\n* Deliberately separate from `deployment-summary.ts`. That file is a private\n* carrier between the alchemy child and this process, written to a\n* per-run path the parent deletes in a `finally` so resource ids and URLs do\n* not accumulate on disk. This one is written where the operator asked for\n* it, survives the run, is written on the failure path too, and carries a\n* version so a consumer can depend on its shape.\n*/\n/** Bump when a change would break a consumer that reads the current shape. */\nconst RUN_REPORT_VERSION = 2;\n/** Names the file to write the run report to, when `--report` is not passed. */\nconst RUN_REPORT_FILE_ENV = \"PRISMA_COMPOSER_REPORT_FILE\";\nfunction toRunReport(input) {\n\treturn {\n\t\tversion: 2,\n\t\toutcome: input.failure === void 0 ? \"succeeded\" : \"failed\",\n\t\tapp: input.summary?.app ?? null,\n\t\tenvironment: input.environment,\n\t\tnodes: input.summary?.nodes ?? [],\n\t\tfailure: input.failure ?? null\n\t};\n}\n/**\n* The path to write to: the `--report` flag first, then the env var. Relative\n* paths resolve against the deploy's cwd. `undefined` means no report was\n* asked for, which is the common case and writes nothing.\n*/\nfunction resolveRunReportPath(flag, env, cwd) {\n\tconst requested = flag !== void 0 && flag.length > 0 ? flag : env;\n\tif (requested === void 0 || requested.length === 0) return void 0;\n\treturn path.resolve(cwd, requested);\n}\n/**\n* Writes the report, creating the parent directory if needed. A write failure\n* warns and returns false rather than failing a deploy that already\n* converged — but it is never silent, because the operator asked for this\n* file and a consumer is waiting on it.\n*/\nfunction writeRunReport(filePath, report) {\n\ttry {\n\t\tfs.mkdirSync(path.dirname(filePath), { recursive: true });\n\t\tfs.writeFileSync(filePath, `${JSON.stringify(report, null, 2)}\\n`);\n\t\treturn true;\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`\\nCould not write the run report to ${filePath}: ${detail}`);\n\t\treturn false;\n\t}\n}\n//#endregion\nexport { writeRunReport as a, toRunReport as i, RUN_REPORT_VERSION as n, resolveRunReportPath as r, RUN_REPORT_FILE_ENV as t };\n\n//# sourceMappingURL=run-report-CmBz2-xc.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,qBAAqB;;AAE3B,MAAM,sBAAsB;AAC5B,SAAS,YAAY,OAAO;CAC3B,OAAO;EACN,SAAS;EACT,SAAS,MAAM,YAAY,KAAK,IAAI,cAAc;EAClD,KAAK,MAAM,SAAS,OAAO;EAC3B,aAAa,MAAM;EACnB,OAAO,MAAM,SAAS,SAAS,CAAC;EAChC,SAAS,MAAM,WAAW;CAC3B;AACD;;;;;;AAMA,SAAS,qBAAqB,MAAM,KAAK,KAAK;CAC7C,MAAM,YAAY,SAAS,KAAK,KAAK,KAAK,SAAS,IAAI,OAAO;CAC9D,IAAI,cAAc,KAAK,KAAK,UAAU,WAAW,GAAG,OAAO,KAAK;CAChE,OAAOA,OAAK,QAAQ,KAAK,SAAS;AACnC;;;;;;;AAOA,SAAS,eAAe,UAAU,QAAQ;CACzC,IAAI;EACH,KAAG,UAAUA,OAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAK,CAAC;EACxD,KAAG,cAAc,UAAU,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,GAAG;EACjE,OAAO;CACR,SAAS,OAAO;EACf,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACpE,QAAQ,KAAK,uCAAuC,SAAS,IAAI,QAAQ;EACzE,OAAO;CACR;AACD"}
@@ -1,5 +1,5 @@
1
- import { H as ProvisionNeed, Z as RunnableServiceNode, c as Contract, d as DependencyEnd } from "./graph-types-CViux_yr-CVV2nQ0l.mjs";
2
- import "./index-BNYl6MsF.mjs";
1
+ import { $ as RunnableServiceNode, U as ProvisionNeed, f as DependencyEnd, l as Contract } from "./graph-types-DRe9UUOp-C85Yr-sJ.mjs";
2
+ import "./index-DWQ6BSgm.mjs";
3
3
  import { StandardSchemaV1 } from "@standard-schema/spec";
4
4
  //#region ../../0-framework/2-authoring/service-rpc/dist/index.d.mts
5
5
  //#region src/rpc.d.ts
@@ -1,6 +1,6 @@
1
1
  import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
2
- import { h as provisionNeed, o as dependency } from "./graph-nazLWyK2-BBciBJje.mjs";
3
- import { l as string } from "./dist-DLOn1x6Z.mjs";
2
+ import { g as provisionNeed, o as dependency } from "./graph-Bqr7PSGl-BM-M-TlO.mjs";
3
+ import { l as string } from "./dist-C7SnNTD3.mjs";
4
4
  //#region ../../0-framework/2-authoring/service-rpc/dist/index.mjs
5
5
  /** Bounded jittered backoff for retrying a dropped call. `maxRetries` is retries after the first attempt. */
6
6
  const RETRY = {
@@ -1,4 +1,4 @@
1
- import { Z as RunnableServiceNode, f as Deps, h as Expose, w as InputValueOf, y as HydratedDeps, z as Params } from "./graph-types-CViux_yr-CVV2nQ0l.mjs";
1
+ import { $ as RunnableServiceNode, B as Params, T as InputValueOf, b as HydratedDeps, g as Expose, p as Deps } from "./graph-types-DRe9UUOp-C85Yr-sJ.mjs";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  //#region ../../0-framework/1-core/core/dist/testing.d.mts
4
4
  //#region src/testing.d.ts