@prisma/composer 0.39.0-dev.2 → 0.39.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app-config-_XNdvjus-DcCvJysR.d.mts → app-config-Ubi4CftJ-DUSDjI2i.d.mts} +62 -60
- package/dist/app-config-Ubi4CftJ-DUSDjI2i.d.mts.map +1 -0
- package/dist/{app-configuration-file-Cw9autUL-DebaEvDz.mjs → app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs} +40 -40
- package/dist/app-configuration-file-Bbfq5PR3-D4DUNKUM.mjs.map +1 -0
- package/dist/config-BmRE_eTa.d.mts +1 -0
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -2
- package/dist/control.d.mts +21 -8
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +3 -3
- package/dist/control.mjs.map +1 -1
- package/dist/converge-in-process-BBBeood8-C7VG5b35.d.mts +67 -0
- package/dist/converge-in-process-BBBeood8-C7VG5b35.d.mts.map +1 -0
- package/dist/deploy-BW_F4Y9W.d.mts +12 -0
- package/dist/deploy-BW_F4Y9W.d.mts.map +1 -0
- package/dist/{deploy-C_PZEjcg.mjs → deploy-NArSOken.mjs} +66 -17
- package/dist/deploy-NArSOken.mjs.map +1 -0
- package/dist/deploy.d.mts +3 -3
- package/dist/deploy.mjs +3 -3
- package/dist/{deployment-summary-p88NV5m5-k9oQRopA.d.mts → deployment-summary-6LgQDUuu-DtCvw9UQ.d.mts} +7 -4
- package/dist/deployment-summary-6LgQDUuu-DtCvw9UQ.d.mts.map +1 -0
- package/dist/{deployment-summary-B6rYxEZe-E4IIcngK.mjs → deployment-summary-YP7eMPJI-CQsj7BHh.mjs} +16 -44
- package/dist/deployment-summary-YP7eMPJI-CQsj7BHh.mjs.map +1 -0
- package/dist/{dev-current-D8GwJQex-BqMILWv-.mjs → dev-current-Ce4Zhfiy-TY0NjkOZ.mjs} +5 -5
- package/dist/{dev-current-D8GwJQex-BqMILWv-.mjs.map → dev-current-Ce4Zhfiy-TY0NjkOZ.mjs.map} +1 -1
- package/dist/{dist-BN9EXWWX.mjs → dist-BxtsHOfP.mjs} +2 -2
- package/dist/{dist-BN9EXWWX.mjs.map → dist-BxtsHOfP.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-1SIH5uAu-lMyvQ0el.mjs → execute-deploy-destroy-D2Ok1xun-DuY58xzA.mjs} +272 -36
- package/dist/execute-deploy-destroy-D2Ok1xun-DuY58xzA.mjs.map +1 -0
- package/dist/{execute-dev-xPaS5SAl-BTzRomlR.mjs → execute-dev-BBPgDWzf-BCSle0Mw.mjs} +10 -11
- package/dist/{execute-dev-xPaS5SAl-BTzRomlR.mjs.map → execute-dev-BBPgDWzf-BCSle0Mw.mjs.map} +1 -1
- package/dist/{execute-dev-current-DsAsDBB1-DhnVrBHM.mjs → execute-dev-current-DNIwPfcW-uOHywz_h.mjs} +4 -4
- package/dist/{execute-dev-current-DsAsDBB1-DhnVrBHM.mjs.map → execute-dev-current-DNIwPfcW-uOHywz_h.mjs.map} +1 -1
- package/dist/{execute-log-Be9DYRI6-CCRtbIwA.mjs → execute-log-CEH820Un-i9u7t1Bw.mjs} +4 -4
- package/dist/{execute-log-Be9DYRI6-CCRtbIwA.mjs.map → execute-log-CEH820Un-i9u7t1Bw.mjs.map} +1 -1
- package/dist/{graph-K7VOpCAj-D6UHSltu.mjs → graph-C6Fqe2gn-DMa2udEA.mjs} +4 -4
- package/dist/graph-C6Fqe2gn-DMa2udEA.mjs.map +1 -0
- package/dist/http.mjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/internal-app-configuration-file.d.mts +4 -4
- package/dist/internal-app-configuration-file.d.mts.map +1 -1
- package/dist/internal-app-configuration-file.mjs +1 -1
- package/dist/internal-converge-contract.d.mts +14 -0
- package/dist/internal-converge-contract.d.mts.map +1 -0
- package/dist/internal-converge-contract.mjs +14 -0
- package/dist/internal-converge-contract.mjs.map +1 -0
- package/dist/internal-converge.d.mts +4 -0
- package/dist/internal-converge.mjs +228 -0
- package/dist/internal-converge.mjs.map +1 -0
- package/dist/local-target.d.mts +1 -1
- package/dist/nextjs-control.d.mts +3 -3
- package/dist/node-control.d.mts +3 -3
- package/dist/{preflight-transport-DJjTWvyH-CEJ9WlaN.mjs → preflight-transport-C7_3abXW-Bza_hn9G.mjs} +3 -39
- package/dist/preflight-transport-C7_3abXW-Bza_hn9G.mjs.map +1 -0
- package/dist/{redaction-CqdeMBKw-BAOFeUYp.d.mts → redaction-CIaE4m9U-DJGrkcn3.d.mts} +7 -6
- package/dist/redaction-CIaE4m9U-DJGrkcn3.d.mts.map +1 -0
- package/dist/{redaction-C-NnlVUh-B1nJc6rb.mjs → redaction-CjMYXtGp-CEQ5z1PK.mjs} +17 -6
- package/dist/redaction-CjMYXtGp-CEQ5z1PK.mjs.map +1 -0
- package/dist/report.d.mts +3 -3
- package/dist/report.mjs +2 -2
- package/dist/report.mjs.map +1 -1
- package/dist/{run-alchemy-CyciV8i0-BxPAyrch.mjs → run-alchemy-BlYyc4Oh-mIzYC4lq.mjs} +3 -3
- package/dist/{run-alchemy-CyciV8i0-BxPAyrch.mjs.map → run-alchemy-BlYyc4Oh-mIzYC4lq.mjs.map} +1 -1
- package/dist/service-rpc.mjs +2 -2
- package/dist/{validate-environment-DyW59rJ7-DTFBmAno.mjs → validate-environment-XwVDifWN-BhPOzWN8.mjs} +6 -6
- package/dist/{validate-environment-DyW59rJ7-DTFBmAno.mjs.map → validate-environment-XwVDifWN-BhPOzWN8.mjs.map} +1 -1
- package/package.json +15 -13
- package/skills/prisma-composer-core-concepts/SKILL.md +10 -24
- package/src/exports/internal-converge-contract.ts +1 -0
- package/src/exports/internal-converge.ts +1 -0
- package/dist/app-config-_XNdvjus-DcCvJysR.d.mts.map +0 -1
- package/dist/app-configuration-file-Cw9autUL-DebaEvDz.mjs.map +0 -1
- package/dist/config-Czql2X9e.d.mts +0 -1
- package/dist/deploy-C_PZEjcg.mjs.map +0 -1
- package/dist/deploy-aDxtc_ck.d.mts +0 -2
- package/dist/deployment-summary-B6rYxEZe-E4IIcngK.mjs.map +0 -1
- package/dist/deployment-summary-p88NV5m5-k9oQRopA.d.mts.map +0 -1
- package/dist/execute-deploy-destroy-1SIH5uAu-lMyvQ0el.mjs.map +0 -1
- package/dist/graph-K7VOpCAj-D6UHSltu.mjs.map +0 -1
- package/dist/preflight-transport-DJjTWvyH-CEJ9WlaN.mjs.map +0 -1
- package/dist/redaction-C-NnlVUh-B1nJc6rb.mjs.map +0 -1
- package/dist/redaction-CqdeMBKw-BAOFeUYp.d.mts.map +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { _t as lower } from "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
|
|
2
|
+
import "./deploy-BW_F4Y9W.mjs";
|
|
3
|
+
import "alchemy/Alchemist";
|
|
4
|
+
import "effect/Cause";
|
|
5
|
+
//#region ../../0-framework/3-tooling/cli/dist/converge-in-process-BBBeood8.d.mts
|
|
6
|
+
//#region src/converge-in-process.d.ts
|
|
7
|
+
/** What `lower()` returns: the stack value `Alchemist.plan` takes. */
|
|
8
|
+
type LoweredStack = ReturnType<typeof lower>;
|
|
9
|
+
/** Where a resource is in its apply. `pending` is planned but not yet touched. */
|
|
10
|
+
type ResourcePhase = 'pending' | 'running' | 'done' | 'failed';
|
|
11
|
+
type ConvergeEvent = {
|
|
12
|
+
readonly kind: 'resource';
|
|
13
|
+
readonly fqn: string;
|
|
14
|
+
readonly resourceType: string;
|
|
15
|
+
/** Alchemy's own status word, such as `creating` or `updated`. */
|
|
16
|
+
readonly status: string;
|
|
17
|
+
readonly phase: ResourcePhase;
|
|
18
|
+
readonly message?: string | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
readonly kind: 'log';
|
|
21
|
+
readonly severity: 'info' | 'warn' | 'verbose';
|
|
22
|
+
readonly text: string;
|
|
23
|
+
};
|
|
24
|
+
interface ConvergeRequest {
|
|
25
|
+
readonly operation: 'deploy';
|
|
26
|
+
readonly stack: LoweredStack;
|
|
27
|
+
readonly stage: string;
|
|
28
|
+
/** The directory Alchemy runs in: where it reads `.env` and keeps `.alchemy`. */
|
|
29
|
+
readonly cwd: string;
|
|
30
|
+
/** Set in `process.env` while Alchemy plans and applies, and restored after; `undefined` removes the variable for that time. Alchemy reads its configuration only from there. */
|
|
31
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
32
|
+
readonly signal?: AbortSignal | undefined;
|
|
33
|
+
readonly onEvent?: ((event: ConvergeEvent) => void) | undefined;
|
|
34
|
+
/** Receives what Alchemy writes to the terminal itself. A throw from it is ignored. Absent means stderr. */
|
|
35
|
+
readonly output?: ((text: string) => void) | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** One error a failed converge ended with: the error's tag or class name, and its message. */
|
|
38
|
+
interface ConvergeFailureReason {
|
|
39
|
+
readonly tag: string;
|
|
40
|
+
readonly message: string;
|
|
41
|
+
}
|
|
42
|
+
type ConvergeOutcome = {
|
|
43
|
+
readonly kind: 'applied';
|
|
44
|
+
} | {
|
|
45
|
+
readonly kind: 'interrupted';
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: 'failed';
|
|
48
|
+
readonly reasons: readonly ConvergeFailureReason[];
|
|
49
|
+
} |
|
|
50
|
+
/** Nothing ran: another converge holds this process's environment and working directory, or this is a worker thread that cannot change directory. */
|
|
51
|
+
{
|
|
52
|
+
readonly kind: 'refused';
|
|
53
|
+
readonly reason: 'already-running' | 'worker-thread';
|
|
54
|
+
};
|
|
55
|
+
/** Plans and applies a lowered stack. The deploy executor's default is {@link convergeInProcess}. */
|
|
56
|
+
type Converge = (request: ConvergeRequest) => Promise<ConvergeOutcome>;
|
|
57
|
+
/**
|
|
58
|
+
* Plans and applies `stack` in this process, as `alchemy deploy --yes` would.
|
|
59
|
+
* The plan's scope, and the state-store lease it holds, closes before this
|
|
60
|
+
* returns, including when `signal` interrupts it. One converge runs at a time
|
|
61
|
+
* per process, across every install of this module: a second call while one
|
|
62
|
+
* runs is refused.
|
|
63
|
+
*/
|
|
64
|
+
declare const convergeInProcess: Converge;
|
|
65
|
+
//#endregion
|
|
66
|
+
export { ConvergeRequest as a, ConvergeOutcome as i, ConvergeEvent as n, LoweredStack as o, ConvergeFailureReason as r, convergeInProcess as s, Converge as t };
|
|
67
|
+
//# sourceMappingURL=converge-in-process-BBBeood8-C7VG5b35.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"converge-in-process-BBBeood8-C7VG5b35.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/converge-in-process-BBBeood8.d.mts"],"mappings":";;;;;;;KAKK,eAAe,kBAAkB;;KAEjC;KACA;WACM;WACA;WACA;;WAEA;WACA,OAAO;WACP;;WAEA;WACA;WACA;;UAED;WACC;WACA,OAAO;WACP;;WAEA;;WAEA,KAAK,SAAS;WACd,SAAS;WACT,YAAY,OAAO;;WAEnB,WAAW;;;UAGZ;WACC;WACA;;KAEN;WACM;;WAEA;;WAEA;WACA,kBAAkB;;;;WAIlB;WACA;;;KAGN,YAAY,SAAS,oBAAoB,QAAQ;;;;;;;;cAQxC,mBAAmB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./graph-DU0omY5O-BHO71z0F.mjs";
|
|
2
|
+
import "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
|
|
3
|
+
import * as Provider from "alchemy/Provider";
|
|
4
|
+
//#region ../../0-framework/1-core/core/dist/deploy.d.mts
|
|
5
|
+
//#region src/control/provider-error.d.ts
|
|
6
|
+
/** What a provider operation threw, as the error Alchemy's lifecycle methods fail with: an error with a `_tag` as it is, anything else wrapped in a `ProviderFailure`. */
|
|
7
|
+
declare function toProviderError(cause: unknown): Provider.ProviderError;
|
|
8
|
+
/** The original error of a provider failure `toProviderError` wrapped, or `undefined` for any other error. */
|
|
9
|
+
declare function wrappedProviderError(error: unknown): unknown;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { wrappedProviderError as n, toProviderError as t };
|
|
12
|
+
//# sourceMappingURL=deploy-BW_F4Y9W.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-BW_F4Y9W.d.mts","names":[],"sources":["../../../0-framework/1-core/core/dist/deploy.d.mts"],"mappings":";;;;;;iBAKiB,gBAAgB,iBAAiB,SAAS;;iBAE1C,qBAAqB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
-
import { T as slotsOf, _ as nodeAddresses, h as isValueResource, n as Load } from "./graph-
|
|
3
|
-
import {
|
|
2
|
+
import { T as slotsOf, _ as nodeAddresses, h as isValueResource, n as Load } from "./graph-C6Fqe2gn-DMa2udEA.mjs";
|
|
3
|
+
import { r as deserializeContainers, s as readPreflightPayload } from "./preflight-transport-C7_3abXW-Bza_hn9G.mjs";
|
|
4
4
|
import * as Alchemy from "alchemy";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Layer from "effect/Layer";
|
|
7
|
+
import * as Data from "effect/Data";
|
|
8
|
+
import * as Predicate from "effect/Predicate";
|
|
7
9
|
//#region ../../0-framework/1-core/core/dist/deploy.mjs
|
|
8
10
|
/** Routes each graph node to its extension descriptor (by node.extension/type) and runs provision → serialize → package → deploy in dependency order. */
|
|
9
11
|
var LowerError = class extends Error {
|
|
@@ -17,7 +19,7 @@ function assertSameNodeAddresses(built, firstProcess) {
|
|
|
17
19
|
const onlyFirst = firstProcess.filter((address) => !built.includes(address));
|
|
18
20
|
if (onlyBuilt.length === 0 && onlyFirst.length === 0) return;
|
|
19
21
|
const list = (addresses) => addresses.length === 0 ? "none" : addresses.map((address) => `"${address}"`).join(", ");
|
|
20
|
-
throw new LowerError(`
|
|
22
|
+
throw new LowerError(`lower() built a different graph from the one Composer checked first. Only in the graph lower() built: ${list(onlyBuilt)}. Only in the graph Composer checked: ${list(onlyFirst)}. A module body must build the same graph every time; one that reads the process environment, a file or the clock can build a different one.`);
|
|
21
23
|
}
|
|
22
24
|
/** A service's own param: its binding, else its `default`, else absent when optional. A `provision` need (ADR-0031) is filled per edge in `buildConfig`, never here. */
|
|
23
25
|
function resolveParam(node, serviceId, name, param, bound) {
|
|
@@ -113,7 +115,7 @@ function joinDeployment(graph, entries) {
|
|
|
113
115
|
}
|
|
114
116
|
return nodes;
|
|
115
117
|
}
|
|
116
|
-
/** The deploy report: every deployed node joined with its graph node, and the
|
|
118
|
+
/** The deploy report: every deployed node joined with its graph node, and the deploy preflight's findings. */
|
|
117
119
|
function deploymentResult(app, graph, entries, findings) {
|
|
118
120
|
return {
|
|
119
121
|
app,
|
|
@@ -189,15 +191,15 @@ function descriptorFor(extensions, node, id) {
|
|
|
189
191
|
* testable without booting Alchemy.
|
|
190
192
|
*/
|
|
191
193
|
function resolveStateLayer(opts, config, containers) {
|
|
192
|
-
return opts.state ?? config.state.create(containers.get(config.state.extension));
|
|
194
|
+
return opts.state ?? config.state.create(containers.get(config.state.extension), opts.credentials);
|
|
193
195
|
}
|
|
194
196
|
/**
|
|
195
197
|
* All configured extensions' providers merged, config array order — an
|
|
196
198
|
* extension without `providers` is skipped; no used-extensions-only
|
|
197
199
|
* filtering (ADR-0017's pinned providers rule).
|
|
198
200
|
*/
|
|
199
|
-
function mergedProviders(config) {
|
|
200
|
-
const [first, ...rest] = config.extensions.flatMap((extension) => extension.providers !== void 0 ? [extension.providers()] : []);
|
|
201
|
+
function mergedProviders(config, credentials) {
|
|
202
|
+
const [first, ...rest] = config.extensions.flatMap((extension) => extension.providers !== void 0 ? [extension.providers({ credentials })] : []);
|
|
201
203
|
return first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);
|
|
202
204
|
}
|
|
203
205
|
/**
|
|
@@ -213,8 +215,8 @@ function lowering(root, config, opts) {
|
|
|
213
215
|
});
|
|
214
216
|
if (opts.firstProcessNodeAddresses !== void 0) assertSameNodeAddresses(nodeAddresses(graph), opts.firstProcessNodeAddresses);
|
|
215
217
|
const extensions = yield* extensionsById(config);
|
|
216
|
-
const containers =
|
|
217
|
-
const
|
|
218
|
+
const { containers, preflightPayloads, findings } = lowerInputs(config, opts);
|
|
219
|
+
const preflightOf = (extensionId) => preflightPayloads.get(extensionId);
|
|
218
220
|
const lowered = /* @__PURE__ */ new Map();
|
|
219
221
|
const entries = [];
|
|
220
222
|
const provisioned = /* @__PURE__ */ new Map();
|
|
@@ -229,6 +231,7 @@ function lowering(root, config, opts) {
|
|
|
229
231
|
opts,
|
|
230
232
|
application: void 0,
|
|
231
233
|
container: containers.get(descriptor.id),
|
|
234
|
+
preflight: preflightOf(descriptor.id),
|
|
232
235
|
lowered,
|
|
233
236
|
provisioned
|
|
234
237
|
};
|
|
@@ -278,6 +281,7 @@ function lowering(root, config, opts) {
|
|
|
278
281
|
opts,
|
|
279
282
|
application: applications.get(node.extension),
|
|
280
283
|
container: containers.get(node.extension),
|
|
284
|
+
preflight: preflightOf(node.extension),
|
|
281
285
|
lowered,
|
|
282
286
|
provisioned,
|
|
283
287
|
services
|
|
@@ -325,7 +329,7 @@ function lowering(root, config, opts) {
|
|
|
325
329
|
entry: bundle.entry
|
|
326
330
|
},
|
|
327
331
|
address: id
|
|
328
|
-
});
|
|
332
|
+
}, serialized);
|
|
329
333
|
const result = yield* descriptor.deploy(ctx, provisionedNode, artifact, serialized);
|
|
330
334
|
lowered.set(id, result.outputs);
|
|
331
335
|
entries.push({
|
|
@@ -344,21 +348,66 @@ function lowering(root, config, opts) {
|
|
|
344
348
|
}
|
|
345
349
|
}));
|
|
346
350
|
}
|
|
351
|
+
/** The containers and preflight payloads a host wrote into the environment of a stack file it runs as a child. */
|
|
352
|
+
function transportedLowerInputs(config) {
|
|
353
|
+
const env = process.env;
|
|
354
|
+
const preflightPayloads = /* @__PURE__ */ new Map();
|
|
355
|
+
for (const { id } of config.extensions) {
|
|
356
|
+
const payload = readPreflightPayload(id, env);
|
|
357
|
+
if (payload !== void 0) preflightPayloads.set(id, payload);
|
|
358
|
+
}
|
|
359
|
+
return {
|
|
360
|
+
containers: deserializeContainers(config.extensions, env),
|
|
361
|
+
preflightPayloads
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
function lowerInputs(config, opts) {
|
|
365
|
+
const { containers, preflightPayloads } = opts;
|
|
366
|
+
const findings = opts.findings ?? { unset: [] };
|
|
367
|
+
if (containers !== void 0 && preflightPayloads !== void 0) return {
|
|
368
|
+
containers,
|
|
369
|
+
preflightPayloads,
|
|
370
|
+
findings
|
|
371
|
+
};
|
|
372
|
+
if (containers === void 0 && preflightPayloads === void 0) return {
|
|
373
|
+
...transportedLowerInputs(config),
|
|
374
|
+
findings
|
|
375
|
+
};
|
|
376
|
+
const missing = containers === void 0 ? "containers" : "preflightPayloads";
|
|
377
|
+
throw new Error(`lower() was passed ${missing === "containers" ? "preflightPayloads" : "containers"} without ${missing}. Pass both, or neither to read both from the environment.`);
|
|
378
|
+
}
|
|
347
379
|
/**
|
|
348
380
|
* The whole-stack wrapper: Load → route each node through the config's
|
|
349
|
-
* extension registries → an Alchemy Stack
|
|
350
|
-
* CLI
|
|
381
|
+
* extension registries → an Alchemy Stack, which `deploy` hands to
|
|
382
|
+
* `Alchemist.plan` and a generated stack file exports for the alchemy CLI.
|
|
351
383
|
*/
|
|
352
384
|
function lower(root, config, opts) {
|
|
353
385
|
const stackEffect = blindCast(Effect.orDie(lowering(root, config, opts)));
|
|
354
|
-
const
|
|
355
|
-
const providers = opts.providers ?? mergedProviders(config);
|
|
386
|
+
const providers = opts.providers ?? mergedProviders(config, opts.credentials);
|
|
356
387
|
return Alchemy.Stack(opts.name, {
|
|
357
388
|
providers,
|
|
358
|
-
state: resolveStateLayer(opts, config, containers)
|
|
389
|
+
state: resolveStateLayer(opts, config, lowerInputs(config, opts).containers)
|
|
359
390
|
}, stackEffect);
|
|
360
391
|
}
|
|
392
|
+
const PROVIDER_FAILURE_TAG = "ProviderFailure";
|
|
393
|
+
/** A provider operation failed with an error that carries no `_tag` of its own; `cause` is that error. */
|
|
394
|
+
var ProviderFailure = class extends Data.TaggedError(PROVIDER_FAILURE_TAG) {};
|
|
395
|
+
function isProviderError(cause) {
|
|
396
|
+
return Predicate.hasProperty(cause, "_tag") && typeof cause._tag === "string";
|
|
397
|
+
}
|
|
398
|
+
/** What a provider operation threw, as the error Alchemy's lifecycle methods fail with: an error with a `_tag` as it is, anything else wrapped in a `ProviderFailure`. */
|
|
399
|
+
function toProviderError(cause) {
|
|
400
|
+
if (isProviderError(cause)) return cause;
|
|
401
|
+
return new ProviderFailure({
|
|
402
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
403
|
+
cause
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
/** The original error of a provider failure `toProviderError` wrapped, or `undefined` for any other error. */
|
|
407
|
+
function wrappedProviderError(error) {
|
|
408
|
+
return Predicate.isTagged(error, PROVIDER_FAILURE_TAG) && "cause" in error ? error.cause : void 0;
|
|
409
|
+
}
|
|
361
410
|
//#endregion
|
|
362
|
-
export { joinDeployment as a, mergedProviders as c, deploymentResult as i, resolveStateLayer as l, buildConfig as n, lower as o, connectionInputs as r, lowering as s, LowerError as t };
|
|
411
|
+
export { joinDeployment as a, mergedProviders as c, transportedLowerInputs as d, wrappedProviderError as f, deploymentResult as i, resolveStateLayer as l, buildConfig as n, lower as o, connectionInputs as r, lowering as s, LowerError as t, toProviderError as u };
|
|
363
412
|
|
|
364
|
-
//# sourceMappingURL=deploy-
|
|
413
|
+
//# sourceMappingURL=deploy-NArSOken.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-NArSOken.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/deploy.mjs"],"sourcesContent":["import { b as slotsOf, i as secretsKeys, p as isValueResource, r as nodeAddresses, t as Load } from \"./graph-C6Fqe2gn.mjs\";\nimport { i as readPreflightPayload, s as deserializeContainers } from \"./preflight-transport-C7_3abXW.mjs\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport * as Alchemy from \"alchemy\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Data from \"effect/Data\";\nimport * as Predicate from \"effect/Predicate\";\n//#region src/control/deploy.ts\n/** Routes each graph node to its extension descriptor (by node.extension/type) and runs provision → serialize → package → deploy in dependency order. */\nvar LowerError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"LowerError\";\n\t}\n};\nfunction assertSameNodeAddresses(built, firstProcess) {\n\tconst onlyBuilt = built.filter((address) => !firstProcess.includes(address));\n\tconst onlyFirst = firstProcess.filter((address) => !built.includes(address));\n\tif (onlyBuilt.length === 0 && onlyFirst.length === 0) return;\n\tconst list = (addresses) => addresses.length === 0 ? \"none\" : addresses.map((address) => `\"${address}\"`).join(\", \");\n\tthrow new LowerError(`lower() built a different graph from the one Composer checked first. Only in the graph lower() built: ${list(onlyBuilt)}. Only in the graph Composer checked: ${list(onlyFirst)}. A module body must build the same graph every time; one that reads the process environment, a file or the clock can build a different one.`);\n}\n/** A service's own param: its binding, else its `default`, else absent when optional. A `provision` need (ADR-0031) is filled per edge in `buildConfig`, never here. */\nfunction resolveParam(node, serviceId, name, param, bound) {\n\tif (bound !== void 0) {\n\t\tif (param.provision !== void 0) throw new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") is bound at provision and also declares a framework provision need (\"${String(param.provision.brand)}\"). Remove the binding or the \\`provision\\` facet.`);\n\t\tconst result = param.schema[\"~standard\"].validate(bound);\n\t\tif (result instanceof Promise) throw new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") uses an async Standard Schema — a provision-time literal value requires a synchronous validator.`);\n\t\tif (result.issues !== void 0) {\n\t\t\tconst messages = result.issues.map((issue) => issue.message).join(\"; \");\n\t\t\tthrow new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") received an invalid provision-time value: ${messages}`);\n\t\t}\n\t\treturn result.value;\n\t}\n\tif (param.default !== void 0) return param.default;\n\tif (param.optional === true) return void 0;\n\tthrow new LowerError(`Param \"${name}\" of \"${serviceId}\" (service \"${node.name}\") has no default, is not optional, and was not bound at provision — bind it on its provision() call with a literal value or a value the deploy has, or give it a default.`);\n}\n/**\n* Assembles a service's typed Config. Connection params come from the\n* dependency edge's lowered outputs — or, for a param carrying a `provision`\n* need (ADR-0031), from `provisioned` (keyed by edge id): the framework mints\n* it, the producer hands nothing over. The service's own params resolve via\n* `resolveParam` (provision-time binding, then default, then loud\n* unbound-required failure).\n*\n* This is also where the connection contract is enforced: a producer that fails to\n* supply a required param its consumer's connection declares fails the deploy\n* here, naming the edge, rather than reaching the consumer as `undefined`.\n*/\nfunction buildConfig(node, id, graph, lowered, provisioned) {\n\tconst inputs = slotConnectionParams(node, id, graph, lowered, provisioned);\n\tconst boundParams = new Map(graph.params.filter((binding) => binding.serviceAddress === id).map((b) => [b.slot, b.binding]));\n\tconst service = {};\n\tfor (const [name, param] of Object.entries(node.params)) {\n\t\tconst value = resolveParam(node, id, name, param, boundParams.get(name));\n\t\tif (value !== void 0) service[name] = value;\n\t}\n\treturn {\n\t\tservice,\n\t\tinputs\n\t};\n}\n/**\n* The connection params of each of a service's or resource's dependency\n* slots, resolved against the producer's lowered outputs or the minted\n* `provisioned` value, with the connection contract enforced (see `buildConfig`).\n*/\nfunction connectionInputs(ctx) {\n\treturn slotConnectionParams(ctx.node, ctx.id, ctx.graph, ctx.lowered, ctx.provisioned);\n}\nfunction slotConnectionParams(node, id, graph, lowered, provisioned) {\n\tconst inputs = {};\n\tfor (const [inputName, inputNode] of Object.entries(node.inputs)) {\n\t\tconst edge = graph.edges.find((e) => e.to === id && e.input === inputName && e.kind === \"dependency\");\n\t\tconst producedOutputs = edge !== void 0 ? lowered.get(edge.from) ?? {} : {};\n\t\tconst values = {};\n\t\tfor (const [name, param] of Object.entries(inputNode.connection.params)) {\n\t\t\tif (param.provision !== void 0) {\n\t\t\t\tvalues[name] = provisioned.get(`${id}.${inputName}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = producedOutputs[name];\n\t\t\tif (value === void 0 && param.optional !== true && edge !== void 0) throw new LowerError(`Connection input \"${id}.${inputName}\" declares param \"${name}\", but its producer \"${edge.from}\" did not supply it — the producer's outputs carry [${Object.keys(producedOutputs).join(\", \") || \"nothing\"}]. Add \"${name}\" to the outputs the producer returns from its lowering, or declare the param optional on the connection.`);\n\t\t\tvalues[name] = value;\n\t\t}\n\t\tinputs[inputName] = values;\n\t}\n\treturn inputs;\n}\n/**\n* Joins resolved report entries back to their graph nodes — the last step of a\n* deploy report, run inside the Action with apply's resolved values.\n*\n* The entries cross Alchemy's action-input boundary, so they carry addresses\n* and plain entities only; the graph is held by closure on this side. That\n* split is why this join exists at all, and it is what keeps functions and\n* Standard Schemas (which a node carries, and which the plan's input hash\n* would have to serialize) out of the input.\n*\n* Skips an address the graph no longer holds: entries are data, the graph is\n* truth.\n*/\nfunction joinDeployment(graph, entries) {\n\tconst nodes = [];\n\tfor (const entry of entries) {\n\t\tconst node = graph.nodes.find((n) => n.id === entry.address)?.node;\n\t\tif (node === void 0 || node.kind !== \"service\" && node.kind !== \"resource\") continue;\n\t\tnodes.push({\n\t\t\taddress: entry.address,\n\t\t\tnode,\n\t\t\tentities: entry.entities\n\t\t});\n\t}\n\treturn nodes;\n}\n/** The deploy report: every deployed node joined with its graph node, and the deploy preflight's findings. */\nfunction deploymentResult(app, graph, entries, findings) {\n\treturn {\n\t\tapp,\n\t\tnodes: joinDeployment(graph, entries),\n\t\tfindings\n\t};\n}\nfunction missingBundleError(id) {\n\treturn new LowerError(`No bundle provided for service \"${id}\" (opts.bundles[\"${id}\"] is required).`);\n}\n/** The message `prisma dev` structures as `DEV.DEV_SERVER_UNSUPPORTED` (ADR-0056). */\nfunction noReserveError(id, extension, type) {\n\treturn new LowerError(`service \"${id}\" runs a dev server but its descriptor (${extension}/${type}) has no \\`reserve\\` step`);\n}\nfunction unassembledWithBundleError(address) {\n\treturn new LowerError(`\"${address}\" is listed in opts.unassembled and also has a bundle in opts.bundles — a service is either assembled or not.`);\n}\nfunction unassembledNotServiceError(address) {\n\treturn new LowerError(`\"${address}\" is listed in opts.unassembled but is not a service in the graph.`);\n}\nfunction duplicateExtensionError(id) {\n\treturn new LowerError(`Extension \"${id}\" is listed more than once in \\`extensions\\` — each extension id must be unique.`);\n}\n/** Registries as extension id → descriptor. Fails on a duplicate id — the CLI validates config, but lowering() is the programmatic escape hatch that doesn't. */\nfunction extensionsById(config) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (const extension of config.extensions) {\n\t\tif (map.has(extension.id)) return Effect.fail(duplicateExtensionError(extension.id));\n\t\tmap.set(extension.id, extension);\n\t}\n\treturn Effect.succeed(map);\n}\nfunction unknownExtensionError(extension, id) {\n\treturn new LowerError(`No extension \"${extension}\" is configured (needed by node \"${id}\") — add it to \\`extensions\\` in the \\`composer\\` section of prisma.config.ts (import its /control entry and list its descriptor).`);\n}\nfunction unknownNodeTypeError(extension, type) {\n\treturn new LowerError(`Extension \"${extension.id}\" has no descriptor for node type \"${type}\" (known: ${Object.keys(extension.nodes).join(\", \")}).`);\n}\n/** A provisioned param's need brand isn't registered by the consumer's extension (ADR-0031). */\nfunction unknownProvisionerError(extension, brand, edgeId) {\n\tconst known = extension.provisions !== void 0 && extension.provisions.size > 0 ? Array.from(extension.provisions.keys(), String).join(\", \") : \"(none registered)\";\n\treturn new LowerError(`Extension \"${extension.id}\" has no provisioner for need \"${String(brand)}\" (needed by edge \"${edgeId}\") (known: ${known}).`);\n}\n/** A provisioned edge whose consumer and provider nodes belong to different extensions (ADR-0031). */\nfunction crossExtensionProvisionError(edgeId) {\n\treturn new LowerError(`Provisioned edge \"${edgeId}\" spans two extensions — cross-extension provisioned edges aren't supported yet.`);\n}\n/**\n* More than one provisioned param on one connection (ADR-0031). One edge mints\n* ONE value, keyed by edge id, so a second need on the same connection would\n* silently receive the first's value under the first's brand.\n*/\nfunction multipleProvisionedParamsError(edgeId, names) {\n\treturn new LowerError(`Connection input \"${edgeId}\" declares more than one provisioned param (${names.join(\", \")}) — only one provisioned param per connection is supported.`);\n}\nfunction wrongKindError(extension, type, expected, got) {\n\treturn new LowerError(`Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${got}\" descriptor — this node needs a \"${expected}\" descriptor.`);\n}\n/** Looks up one node's descriptor: extension by `node.extension`, then descriptor by `node.type`, then the kind check. */\nfunction descriptorFor(extensions, node, id) {\n\tconst extension = extensions.get(node.extension);\n\tif (extension === void 0) return Effect.fail(unknownExtensionError(node.extension, id));\n\tconst descriptor = extension.nodes[node.type];\n\tif (descriptor === void 0) return Effect.fail(unknownNodeTypeError(extension, node.type));\n\tif (descriptor.kind !== node.kind) return Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));\n\treturn Effect.succeed(descriptor);\n}\n/**\n* The state-layer precedence a deploy resolves to: an explicit opts.state\n* always wins; failing that, the config's own (required) state descriptor,\n* created with its owning extension's resolved container (`undefined` when\n* that extension declared none). A pure function so the precedence is\n* testable without booting Alchemy.\n*/\nfunction resolveStateLayer(opts, config, containers) {\n\treturn opts.state ?? config.state.create(containers.get(config.state.extension), opts.credentials);\n}\n/**\n* All configured extensions' providers merged, config array order — an\n* extension without `providers` is skipped; no used-extensions-only\n* filtering (ADR-0017's pinned providers rule).\n*/\nfunction mergedProviders(config, credentials) {\n\tconst [first, ...rest] = config.extensions.flatMap((extension) => extension.providers !== void 0 ? [extension.providers({ credentials })] : []);\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n/**\n* Composable form for mixed stacks: hand-wired Alchemy resources alongside Prisma App nodes in one stack effect.\n* Fails with LowerError or whatever an extension's lowering raises — the error type is open.\n*/\nfunction lowering(root, config, opts) {\n\treturn blindCast(Effect.gen(function* () {\n\t\tconst graph = Load(root, {\n\t\t\tid: opts.name,\n\t\t\t...opts.environment !== void 0 ? { environment: { name: opts.environment } } : {},\n\t\t\t...opts.appConfigurationRead !== void 0 ? { appConfigurationRead: opts.appConfigurationRead } : {}\n\t\t});\n\t\tif (opts.firstProcessNodeAddresses !== void 0) assertSameNodeAddresses(nodeAddresses(graph), opts.firstProcessNodeAddresses);\n\t\tconst extensions = yield* extensionsById(config);\n\t\tconst { containers, preflightPayloads, findings } = lowerInputs(config, opts);\n\t\tconst preflightOf = (extensionId) => preflightPayloads.get(extensionId);\n\t\tconst lowered = /* @__PURE__ */ new Map();\n\t\tconst entries = [];\n\t\tconst provisioned = /* @__PURE__ */ new Map();\n\t\tconst applications = /* @__PURE__ */ new Map();\n\t\tfor (const descriptor of config.extensions) {\n\t\t\tif (descriptor.application === void 0) continue;\n\t\t\tconst appCtx = {\n\t\t\t\tid: graph.root.id,\n\t\t\t\taddress: \"\",\n\t\t\t\tnode: graph.root.node,\n\t\t\t\tgraph,\n\t\t\t\topts,\n\t\t\t\tapplication: void 0,\n\t\t\t\tcontainer: containers.get(descriptor.id),\n\t\t\t\tpreflight: preflightOf(descriptor.id),\n\t\t\t\tlowered,\n\t\t\t\tprovisioned\n\t\t\t};\n\t\t\tapplications.set(descriptor.id, yield* descriptor.application.provision(appCtx));\n\t\t}\n\t\tfor (const edge of graph.edges) {\n\t\t\tif (edge.kind !== \"dependency\") continue;\n\t\t\tconst consumer = graph.nodes.find((n) => n.id === edge.to)?.node;\n\t\t\tif (consumer === void 0 || consumer.kind !== \"service\" && consumer.kind !== \"resource\") continue;\n\t\t\tconst slot = slotsOf(consumer)[edge.input];\n\t\t\tif (slot === void 0) continue;\n\t\t\tconst provisionedParams = Object.entries(slot.connection.params).filter(([, param]) => param.provision !== void 0);\n\t\t\tif (provisionedParams.length === 0) continue;\n\t\t\tconst edgeId = `${edge.to}.${edge.input}`;\n\t\t\tif (provisionedParams.length > 1) return yield* Effect.fail(multipleProvisionedParamsError(edgeId, provisionedParams.map(([name]) => name)));\n\t\t\tconst need = provisionedParams[0]?.[1].provision;\n\t\t\tif (need === void 0) continue;\n\t\t\tconst provider = graph.nodes.find((n) => n.id === edge.from)?.node;\n\t\t\tif (provider === void 0 || provider.kind !== \"service\" && provider.kind !== \"resource\") continue;\n\t\t\tif (consumer.extension !== provider.extension) return yield* Effect.fail(crossExtensionProvisionError(edgeId));\n\t\t\tconst extension = extensions.get(consumer.extension);\n\t\t\tif (extension === void 0) return yield* Effect.fail(unknownExtensionError(consumer.extension, edge.to));\n\t\t\tconst provisioner = extension.provisions?.get(need.brand);\n\t\t\tif (provisioner === void 0) return yield* Effect.fail(unknownProvisionerError(extension, need.brand, edgeId));\n\t\t\tconst ref = yield* provisioner.provision({\n\t\t\t\tapp: graph.root.id,\n\t\t\t\tedgeId,\n\t\t\t\tconsumerAddress: edge.to,\n\t\t\t\tproviderAddress: edge.from,\n\t\t\t\tinput: edge.input,\n\t\t\t\tneed\n\t\t\t});\n\t\t\tprovisioned.set(edgeId, ref);\n\t\t}\n\t\tconst unassembled = new Set(opts.unassembled ?? []);\n\t\tfor (const address of unassembled) {\n\t\t\tif (address in opts.bundles) return yield* Effect.fail(unassembledWithBundleError(address));\n\t\t\tconst found = graph.nodes.find((n) => n.id === address);\n\t\t\tif (found === void 0 || found.node.kind !== \"service\") return yield* Effect.fail(unassembledNotServiceError(address));\n\t\t}\n\t\tconst services = /* @__PURE__ */ new Map();\n\t\tconst ctxFor = (id, node) => ({\n\t\t\tid,\n\t\t\taddress: id,\n\t\t\tnode,\n\t\t\tgraph,\n\t\t\topts,\n\t\t\tapplication: applications.get(node.extension),\n\t\t\tcontainer: containers.get(node.extension),\n\t\t\tpreflight: preflightOf(node.extension),\n\t\t\tlowered,\n\t\t\tprovisioned,\n\t\t\tservices\n\t\t});\n\t\tfor (const { id, node } of graph.nodes) {\n\t\t\tif (node.kind !== \"service\") continue;\n\t\t\tconst descriptor = yield* descriptorFor(extensions, node, id);\n\t\t\tif (descriptor.kind !== \"service\") continue;\n\t\t\tservices.set(id, yield* descriptor.provision(ctxFor(id, node)));\n\t\t}\n\t\tfor (const { id, node } of graph.nodes) {\n\t\t\tif (node.kind === \"module\") continue;\n\t\t\tif (node.kind === \"dependency\") continue;\n\t\t\tconst ctx = ctxFor(id, node);\n\t\t\tconst descriptor = yield* descriptorFor(extensions, node, id);\n\t\t\tif (descriptor.kind === \"resource\") {\n\t\t\t\tconst result = yield* descriptor(ctx);\n\t\t\t\tlowered.set(id, result.outputs);\n\t\t\t\tif (!isValueResource(node)) entries.push({\n\t\t\t\t\taddress: id,\n\t\t\t\t\tentities: result.entities\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (descriptor.kind !== \"service\") return yield* Effect.fail(wrongKindError(node.extension, node.type, node.kind, descriptor.kind));\n\t\t\tconst service = node;\n\t\t\tconst provisionedNode = services.get(id);\n\t\t\tconst typedConfig = buildConfig(service, id, graph, lowered, provisioned);\n\t\t\tconst serialized = yield* descriptor.serialize(ctx, provisionedNode, typedConfig);\n\t\t\tif (unassembled.has(id)) {\n\t\t\t\tif (descriptor.reserve === void 0) return yield* Effect.fail(noReserveError(id, node.extension, node.type));\n\t\t\t\tconst result = yield* descriptor.reserve(ctx, provisionedNode, serialized);\n\t\t\t\tlowered.set(id, result.outputs);\n\t\t\t\tentries.push({\n\t\t\t\t\taddress: id,\n\t\t\t\t\tentities: result.entities\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst bundle = opts.bundles[id];\n\t\t\tif (bundle === void 0) return yield* Effect.fail(missingBundleError(id));\n\t\t\tconst artifact = yield* descriptor.package(ctx, {\n\t\t\t\tassembled: {\n\t\t\t\t\tdir: bundle.dir,\n\t\t\t\t\tentry: bundle.entry\n\t\t\t\t},\n\t\t\t\taddress: id\n\t\t\t}, serialized);\n\t\t\tconst result = yield* descriptor.deploy(ctx, provisionedNode, artifact, serialized);\n\t\t\tlowered.set(id, result.outputs);\n\t\t\tentries.push({\n\t\t\t\taddress: id,\n\t\t\t\tentities: result.entities\n\t\t\t});\n\t\t}\n\t\tif (opts.report !== void 0) {\n\t\t\tconst report = opts.report;\n\t\t\tyield* Alchemy.Action(\"composer-deployment-report\", (input) => Effect.sync(() => {\n\t\t\t\treport(deploymentResult(opts.name, graph, input.entries, findings));\n\t\t\t}))({\n\t\t\t\tnonce: Date.now(),\n\t\t\t\tentries\n\t\t\t});\n\t\t}\n\t}));\n}\n/** The containers and preflight payloads a host wrote into the environment of a stack file it runs as a child. */\nfunction transportedLowerInputs(config) {\n\tconst env = process.env;\n\tconst preflightPayloads = /* @__PURE__ */ new Map();\n\tfor (const { id } of config.extensions) {\n\t\tconst payload = readPreflightPayload(id, env);\n\t\tif (payload !== void 0) preflightPayloads.set(id, payload);\n\t}\n\treturn {\n\t\tcontainers: deserializeContainers(config.extensions, env),\n\t\tpreflightPayloads\n\t};\n}\nfunction lowerInputs(config, opts) {\n\tconst { containers, preflightPayloads } = opts;\n\tconst findings = opts.findings ?? { unset: [] };\n\tif (containers !== void 0 && preflightPayloads !== void 0) return {\n\t\tcontainers,\n\t\tpreflightPayloads,\n\t\tfindings\n\t};\n\tif (containers === void 0 && preflightPayloads === void 0) return {\n\t\t...transportedLowerInputs(config),\n\t\tfindings\n\t};\n\tconst missing = containers === void 0 ? \"containers\" : \"preflightPayloads\";\n\tthrow new Error(`lower() was passed ${missing === \"containers\" ? \"preflightPayloads\" : \"containers\"} without ${missing}. Pass both, or neither to read both from the environment.`);\n}\n/**\n* The whole-stack wrapper: Load → route each node through the config's\n* extension registries → an Alchemy Stack, which `deploy` hands to\n* `Alchemist.plan` and a generated stack file exports for the alchemy CLI.\n*/\nfunction lower(root, config, opts) {\n\tconst stackEffect = blindCast(Effect.orDie(lowering(root, config, opts)));\n\tconst providers = opts.providers ?? mergedProviders(config, opts.credentials);\n\treturn Alchemy.Stack(opts.name, {\n\t\tproviders,\n\t\tstate: resolveStateLayer(opts, config, lowerInputs(config, opts).containers)\n\t}, stackEffect);\n}\n//#endregion\n//#region src/control/provider-error.ts\nconst PROVIDER_FAILURE_TAG = \"ProviderFailure\";\n/** A provider operation failed with an error that carries no `_tag` of its own; `cause` is that error. */\nvar ProviderFailure = class extends Data.TaggedError(PROVIDER_FAILURE_TAG) {};\nfunction isProviderError(cause) {\n\treturn Predicate.hasProperty(cause, \"_tag\") && typeof cause._tag === \"string\";\n}\n/** What a provider operation threw, as the error Alchemy's lifecycle methods fail with: an error with a `_tag` as it is, anything else wrapped in a `ProviderFailure`. */\nfunction toProviderError(cause) {\n\tif (isProviderError(cause)) return cause;\n\treturn new ProviderFailure({\n\t\tmessage: cause instanceof Error ? cause.message : String(cause),\n\t\tcause\n\t});\n}\n/** The original error of a provider failure `toProviderError` wrapped, or `undefined` for any other error. */\nfunction wrappedProviderError(error) {\n\treturn Predicate.isTagged(error, PROVIDER_FAILURE_TAG) && \"cause\" in error ? error.cause : void 0;\n}\n//#endregion\nexport { LowerError, buildConfig, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys, toProviderError, transportedLowerInputs, wrappedProviderError };\n\n//# sourceMappingURL=deploy.mjs.map"],"mappings":";;;;;;;;;;AAUA,IAAI,aAAa,cAAc,MAAM;CACpC,YAAY,SAAS;EACpB,MAAM,OAAO;EACb,KAAK,OAAO;CACb;AACD;AACA,SAAS,wBAAwB,OAAO,cAAc;CACrD,MAAM,YAAY,MAAM,QAAQ,YAAY,CAAC,aAAa,SAAS,OAAO,CAAC;CAC3E,MAAM,YAAY,aAAa,QAAQ,YAAY,CAAC,MAAM,SAAS,OAAO,CAAC;CAC3E,IAAI,UAAU,WAAW,KAAK,UAAU,WAAW,GAAG;CACtD,MAAM,QAAQ,cAAc,UAAU,WAAW,IAAI,SAAS,UAAU,KAAK,YAAY,IAAI,QAAQ,EAAE,CAAC,CAAC,KAAK,IAAI;CAClH,MAAM,IAAI,WAAW,yGAAyG,KAAK,SAAS,EAAE,wCAAwC,KAAK,SAAS,EAAE,6IAA6I;AACpV;;AAEA,SAAS,aAAa,MAAM,WAAW,MAAM,OAAO,OAA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AACtE;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,gBAAgB,KAAK,GAAG,OAAO;CACnC,OAAO,IAAI,gBAAgB;EAC1B,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAC9D;CACD,CAAC;AACF;;AAEA,SAAS,qBAAqB,OAAO;CACpC,OAAO,UAAU,SAAS,OAAO,oBAAoB,KAAK,WAAW,QAAQ,MAAM,QAAQ,KAAK;AACjG"}
|
package/dist/deploy.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { i as secretsKeys, r as nodeAddresses } from "./graph-DU0omY5O-BHO71z0F.mjs";
|
|
2
|
-
import { B as Outputs,
|
|
3
|
-
import "./deploy-
|
|
4
|
-
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServeInput, ServiceLowering, buildConfig, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };
|
|
2
|
+
import { B as Outputs, F as LowerOptions, I as LoweredResult, L as Lowering, N as LowerContext, P as LowerError, Tt as transportedLowerInputs, V as PackageInput, X as ProvisionerDescriptor, Y as ProvisionEdge, _ as DeployedNode, _t as lower, a as Artifact, b as DevServer, ct as connectionInputs, ft as deploymentResult, g as DeployedEntity, gt as joinDeployment, i as ApplicationDescriptor, nt as ServeInput, o as AssembleInput, rt as ServiceLowering, s as Bundle, st as buildConfig, t as AlchemyStateLayer, v as DeploymentResult, vt as lowering, wt as resolveStateLayer, yt as mergedProviders } from "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
|
|
3
|
+
import { n as wrappedProviderError, t as toProviderError } from "./deploy-BW_F4Y9W.mjs";
|
|
4
|
+
export { AlchemyStateLayer, ApplicationDescriptor, Artifact, AssembleInput, Bundle, DeployedEntity, DeployedNode, DeploymentResult, DevServer, LowerContext, LowerError, LowerOptions, LoweredResult, Lowering, Outputs, PackageInput, ProvisionEdge, ProvisionerDescriptor, ServeInput, ServiceLowering, buildConfig, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys, toProviderError, transportedLowerInputs, wrappedProviderError };
|
package/dist/deploy.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as secretsKeys, _ as nodeAddresses } from "./graph-
|
|
2
|
-
import { a as joinDeployment, c as mergedProviders, i as deploymentResult, l as resolveStateLayer, n as buildConfig, o as lower, r as connectionInputs, s as lowering, t as LowerError } from "./deploy-
|
|
3
|
-
export { LowerError, buildConfig, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys };
|
|
1
|
+
import { C as secretsKeys, _ as nodeAddresses } from "./graph-C6Fqe2gn-DMa2udEA.mjs";
|
|
2
|
+
import { a as joinDeployment, c as mergedProviders, d as transportedLowerInputs, f as wrappedProviderError, i as deploymentResult, l as resolveStateLayer, n as buildConfig, o as lower, r as connectionInputs, s as lowering, t as LowerError, u as toProviderError } from "./deploy-NArSOken.mjs";
|
|
3
|
+
export { LowerError, buildConfig, connectionInputs, deploymentResult, joinDeployment, lower, lowering, mergedProviders, nodeAddresses, resolveStateLayer, secretsKeys, toProviderError, transportedLowerInputs, wrappedProviderError };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { g as DeployedEntity } from "./app-config-
|
|
2
|
-
import "./
|
|
3
|
-
|
|
1
|
+
import { W as PreflightFindings, g as DeployedEntity } from "./app-config-Ubi4CftJ-DUSDjI2i.mjs";
|
|
2
|
+
import "./config-BmRE_eTa.mjs";
|
|
3
|
+
import "./deploy-BW_F4Y9W.mjs";
|
|
4
|
+
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-6LgQDUuu.d.mts
|
|
4
5
|
//#region src/deployment-summary.d.ts
|
|
5
6
|
/** The serializable projection of DeploymentResult — what CAN cross the process
|
|
6
7
|
* boundary. Writer (report hook) and reader (deploy operation) share this shape. */
|
|
@@ -11,6 +12,8 @@ interface DeployedNodeSummary {
|
|
|
11
12
|
interface DeploymentSummary {
|
|
12
13
|
readonly app: string;
|
|
13
14
|
readonly nodes: readonly DeployedNodeSummary[];
|
|
15
|
+
/** The platform variables with no value that the deploy preflight found. */
|
|
16
|
+
readonly findings: PreflightFindings;
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Child half of the failure protocol, called by the generated stack file.
|
|
@@ -27,4 +30,4 @@ interface DeploymentSummary {
|
|
|
27
30
|
declare function captureEngineFailure(): void;
|
|
28
31
|
//#endregion
|
|
29
32
|
export { DeploymentSummary as n, captureEngineFailure as r, DeployedNodeSummary as t };
|
|
30
|
-
//# sourceMappingURL=deployment-summary-
|
|
33
|
+
//# sourceMappingURL=deployment-summary-6LgQDUuu-DtCvw9UQ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-summary-6LgQDUuu-DtCvw9UQ.d.mts","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-6LgQDUuu.d.mts"],"mappings":";;;;;;;UAKU;WACC;WACA,mBAAmB;;UAEpB;WACC;WACA,gBAAgB;;WAEhB,UAAU;;;;;;;;;;;;;;iBAcJ"}
|
package/dist/{deployment-summary-B6rYxEZe-E4IIcngK.mjs → deployment-summary-YP7eMPJI-CQsj7BHh.mjs}
RENAMED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as redactCredentialLooking } from "./redaction-C-NnlVUh-B1nJc6rb.mjs";
|
|
1
|
+
import { i as redactCredentialLooking } from "./redaction-CjMYXtGp-CEQ5z1PK.mjs";
|
|
3
2
|
import * as fs$1 from "node:fs";
|
|
4
3
|
import { format, stripVTControlCharacters } from "node:util";
|
|
5
|
-
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-
|
|
4
|
+
//#region ../../0-framework/3-tooling/cli/dist/deployment-summary-YP7eMPJI.mjs
|
|
6
5
|
/**
|
|
7
|
-
* The deploy result
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* references (ADR-0033) — so the writer projects it down to what CAN.
|
|
13
|
-
*
|
|
14
|
-
* The summary is best-effort by contract: the writer never fails the child
|
|
15
|
-
* over it, and the reader maps absent or malformed to `undefined`. So is the
|
|
16
|
-
* failure cause the child leaves beside it when it exits non-zero.
|
|
6
|
+
* The deploy result as data, and what a stack file run as a child hands back
|
|
7
|
+
* to the CLI: the summary file the report hook writes, and the failure cause
|
|
8
|
+
* the child records when it exits non-zero. `DeploymentResult` holds live
|
|
9
|
+
* graph nodes (ADR-0033), so the summary keeps only what can be serialized.
|
|
10
|
+
* Both files are best-effort: a write failure never fails the child.
|
|
17
11
|
*/
|
|
18
12
|
/** Env var the deploy operation sets on the alchemy child: when present,
|
|
19
13
|
* the report hook also writes the JSON DeploymentSummary there. */
|
|
20
14
|
const DEPLOYMENT_RESULT_FILE_ENV = "PRISMA_COMPOSER_DEPLOYMENT_RESULT_FILE";
|
|
21
|
-
/** Pure projection: keeps app
|
|
15
|
+
/** Pure projection: keeps app, each node's address/entities and the findings, drops the in-process `node`. */
|
|
22
16
|
function toDeploymentSummary(result) {
|
|
23
17
|
return {
|
|
24
18
|
app: result.app,
|
|
25
19
|
nodes: result.nodes.map((node) => ({
|
|
26
20
|
address: node.address,
|
|
27
21
|
entities: node.entities
|
|
28
|
-
}))
|
|
22
|
+
})),
|
|
23
|
+
findings: result.findings
|
|
29
24
|
};
|
|
30
25
|
}
|
|
31
26
|
/**
|
|
@@ -40,33 +35,6 @@ function writeDeploymentSummaryFile(result) {
|
|
|
40
35
|
fs$1.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));
|
|
41
36
|
} catch {}
|
|
42
37
|
}
|
|
43
|
-
function isRecord(value) {
|
|
44
|
-
return typeof value === "object" && value !== null;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Reader half, run by the deploy operation after the child exits. Absent or
|
|
48
|
-
* malformed → undefined — the summary is best-effort, never a deploy failure.
|
|
49
|
-
*/
|
|
50
|
-
function readDeploymentSummary(resultFilePath) {
|
|
51
|
-
let raw;
|
|
52
|
-
try {
|
|
53
|
-
raw = fs$1.readFileSync(resultFilePath, "utf8");
|
|
54
|
-
} catch {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
let parsed;
|
|
58
|
-
try {
|
|
59
|
-
parsed = JSON.parse(raw);
|
|
60
|
-
} catch {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (!isRecord(parsed) || typeof parsed["app"] !== "string" || !Array.isArray(parsed["nodes"])) return;
|
|
64
|
-
for (const node of parsed["nodes"]) {
|
|
65
|
-
if (!isRecord(node) || typeof node["address"] !== "string" || !Array.isArray(node["entities"])) return;
|
|
66
|
-
for (const entity of node["entities"]) if (!isRecord(entity) || typeof entity["kind"] !== "string" || typeof entity["id"] !== "string") return;
|
|
67
|
-
}
|
|
68
|
-
return blindCast(parsed);
|
|
69
|
-
}
|
|
70
38
|
/** The child's failure cause rides beside the result file, so the one env var names both and the parent's cleanup removes both. */
|
|
71
39
|
function engineFailureFilePath(resultFilePath) {
|
|
72
40
|
return `${resultFilePath}.failure.txt`;
|
|
@@ -175,7 +143,11 @@ function engineFailureCause(output, env) {
|
|
|
175
143
|
const cause = redactCredentialLooking(kept.map((line) => line.text).join("\n"), env);
|
|
176
144
|
return cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;
|
|
177
145
|
}
|
|
146
|
+
/** A failure cause capped to fit the platform build's error message. */
|
|
147
|
+
function capFailureCause(cause) {
|
|
148
|
+
return cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;
|
|
149
|
+
}
|
|
178
150
|
//#endregion
|
|
179
|
-
export { readEngineFailureCause as a,
|
|
151
|
+
export { readEngineFailureCause as a, writeDeploymentSummaryFile as c, engineFailureFilePath as i, capFailureCause as n, toDeploymentSummary as o, captureEngineFailure as r, withComposerAdvice as s, DEPLOYMENT_RESULT_FILE_ENV as t };
|
|
180
152
|
|
|
181
|
-
//# sourceMappingURL=deployment-summary-
|
|
153
|
+
//# sourceMappingURL=deployment-summary-YP7eMPJI-CQsj7BHh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-summary-YP7eMPJI-CQsj7BHh.mjs","names":["fs"],"sources":["../../../0-framework/3-tooling/cli/dist/deployment-summary-YP7eMPJI.mjs"],"sourcesContent":["import { a as redactCredentialLooking } from \"./redaction-CjMYXtGp.mjs\";\nimport * as fs from \"node:fs\";\nimport { format, stripVTControlCharacters } from \"node:util\";\n//#region src/deployment-summary.ts\n/**\n* The deploy result as data, and what a stack file run as a child hands back\n* to the CLI: the summary file the report hook writes, and the failure cause\n* the child records when it exits non-zero. `DeploymentResult` holds live\n* graph nodes (ADR-0033), so the summary keeps only what can be serialized.\n* Both files are best-effort: a write failure never fails the child.\n*/\n/** Env var the deploy operation sets on the alchemy child: when present,\n* the report hook also writes the JSON DeploymentSummary there. */\nconst DEPLOYMENT_RESULT_FILE_ENV = \"PRISMA_COMPOSER_DEPLOYMENT_RESULT_FILE\";\n/** Pure projection: keeps app, each node's address/entities and the findings, drops the in-process `node`. */\nfunction toDeploymentSummary(result) {\n\treturn {\n\t\tapp: result.app,\n\t\tnodes: result.nodes.map((node) => ({\n\t\t\taddress: node.address,\n\t\t\tentities: node.entities\n\t\t})),\n\t\tfindings: result.findings\n\t};\n}\n/**\n* Writer half, called by the report hook inside the alchemy child: when the\n* env var names a file, write the summary there. Best-effort — a write\n* failure must not fail a deploy that already converged, so it is swallowed.\n*/\nfunction writeDeploymentSummaryFile(result) {\n\tconst file = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (file === void 0 || file.length === 0) return;\n\ttry {\n\t\tfs.writeFileSync(file, JSON.stringify(toDeploymentSummary(result)));\n\t} catch {}\n}\n/** The child's failure cause rides beside the result file, so the one env var names both and the parent's cleanup removes both. */\nfunction engineFailureFilePath(resultFilePath) {\n\treturn `${resultFilePath}.failure.txt`;\n}\n/** Fits the platform's 5000-character build `errorMessage` with room for the exit-status prefix. */\nconst ENGINE_FAILURE_CAUSE_LIMIT = 1e3;\n/** Alchemy's advice to rerun its own CLI with `--adopt` or to import a resource with adoption, which a Composer user has no way to do. */\nconst ALCHEMY_ADOPT_ADVICE = [\n\t[/Re-run with `--adopt` \\(or wrap the effect in `adopt\\(true\\)`\\) to take it over\\./g, \"Something other than this app holds it. Remove that resource, then deploy again.\"],\n\t[/Re-run with `--adopt` \\(or wrap the effect in `adopt\\(true\\)`\\) to replace it anyway\\./g, \"Remove that resource, then deploy again.\"],\n\t[/\\(re-deploy with --adopt to take ownership, then destroy\\)/g, \"(remove it by hand)\"],\n\t[/Import it with explicit adoption (?:instead of silently taking it over|or choose a different [\\w ]+ name)\\./g, \"Something other than this app holds it. Remove that resource, then deploy again.\"],\n\t[/; rerun with adoption enabled if it is the intended [\\w ]+\\./g, \". Remove that resource, then deploy again.\"]\n];\n/** Replaces Alchemy CLI advice in engine output with steps that work from Composer. */\nfunction withComposerAdvice(text) {\n\treturn ALCHEMY_ADOPT_ADVICE.reduce((current, [advice, replacement]) => current.replace(advice, replacement), text);\n}\nconst STDOUT_CONSOLE_METHODS = /* @__PURE__ */ new Set([\n\t\"log\",\n\t\"info\",\n\t\"debug\"\n]);\n/**\n* Child half of the failure protocol, called by the generated stack file.\n* Keeps a bounded tail of everything this process logs through `console`,\n* passing every call through except Alchemy's CLI advice (see\n* {@link withComposerAdvice}), and on a non-zero exit writes the\n* redacted cause beside the result file. `console`, not the output streams:\n* alchemy's logger and its error reporting both go through it, and under Bun\n* `console` does not reach `process.stdout.write`.\n*\n* When stdout is not a terminal it carries the parent's data lines, so\n* everything this process prints goes to stderr instead.\n*/\nfunction captureEngineFailure() {\n\tconst resultFile = process.env[DEPLOYMENT_RESULT_FILE_ENV];\n\tif (resultFile === void 0 || resultFile.length === 0) return;\n\tconst stdoutToStderr = process.stdout.isTTY !== true;\n\tif (stdoutToStderr) process.stdout.write = process.stderr.write.bind(process.stderr);\n\tlet tail = \"\";\n\tfor (const method of [\n\t\t\"log\",\n\t\t\"info\",\n\t\t\"warn\",\n\t\t\"error\",\n\t\t\"debug\"\n\t]) {\n\t\tconst original = stdoutToStderr && STDOUT_CONSOLE_METHODS.has(method) ? console.error : console[method];\n\t\tconsole[method] = (...args) => {\n\t\t\tconst text = format(...args);\n\t\t\tconst shown = withComposerAdvice(text);\n\t\t\ttail = `${tail}${redactCredentialLooking(shown, process.env)}\\n`.slice(-65536);\n\t\t\tif (shown === text) original.apply(console, args);\n\t\t\telse original.call(console, shown);\n\t\t};\n\t}\n\tprocess.once(\"exit\", (code) => {\n\t\tif (code === 0) return;\n\t\tconst cause = engineFailureCause(tail, process.env);\n\t\tif (cause === void 0) return;\n\t\ttry {\n\t\t\tfs.writeFileSync(engineFailureFilePath(resultFile), cause);\n\t\t} catch {}\n\t});\n}\n/** Parent half: the cause the child recorded, passed through `redact`, or undefined when it recorded none. The child redacts only what its own environment names as a credential; the parent also knows the known secrets. */\nfunction readEngineFailureCause(resultFilePath, redact) {\n\tlet cause;\n\ttry {\n\t\tcause = fs.readFileSync(engineFailureFilePath(resultFilePath), \"utf8\");\n\t} catch {\n\t\treturn;\n\t}\n\treturn cause.length > 0 ? redact(cause) : void 0;\n}\n/** Effect's pretty log prefix, e.g. `[10:29:16.556] INFO (#53): `. */\nconst LOG_PREFIX = /^\\[[\\d:.]+\\] ([A-Z]+) \\(#\\d+\\): ?/;\n/** Alchemy's per-resource failure row, e.g. `[web] fail — UnknownError: …`. */\nconst RESOURCE_FAIL_ROW = /^\\[[^\\]]+\\] fail\\b/;\nconst STACK_FRAME = /^\\s*at /;\n/**\n* The failure the output describes: every line from the first failure line\n* (a failed resource row, an ERROR log, or an `error:` line) to the end, minus\n* blank lines, stack frames and info logs; the last five lines when there is no\n* failure line. Redacted, then capped.\n*/\nfunction engineFailureCause(output, env) {\n\tconst lines = [];\n\tfor (const raw of stripVTControlCharacters(output).split(/\\r\\n|\\r|\\n/)) {\n\t\tconst clean = raw.replace(/(?![\\t])\\p{Cc}/gu, \"\").trimEnd();\n\t\tconst prefix = LOG_PREFIX.exec(clean);\n\t\tconst text = (prefix === null ? clean : clean.slice(prefix[0].length)).trim();\n\t\tif (text.length === 0 || text === \"{\" || text === \"}\" || STACK_FRAME.test(text)) continue;\n\t\tconst level = prefix?.[1];\n\t\tconst failure = level === \"ERROR\" || level === \"FATAL\" || RESOURCE_FAIL_ROW.test(text) || /^\\W*error:/i.test(text);\n\t\tlines.push({\n\t\t\ttext,\n\t\t\tfailure,\n\t\t\tinfo: !failure && level !== void 0\n\t\t});\n\t}\n\tconst start = lines.findIndex((line) => line.failure);\n\tconst kept = start === -1 ? lines.slice(-5) : lines.slice(start).filter((line) => !line.info);\n\tif (kept.length === 0) return void 0;\n\tconst cause = redactCredentialLooking(kept.map((line) => line.text).join(\"\\n\"), env);\n\treturn cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;\n}\n/** A failure cause capped to fit the platform build's error message. */\nfunction capFailureCause(cause) {\n\treturn cause.length <= ENGINE_FAILURE_CAUSE_LIMIT ? cause : `${cause.slice(0, ENGINE_FAILURE_CAUSE_LIMIT - 1)}…`;\n}\n//#endregion\nexport { readEngineFailureCause as a, writeDeploymentSummaryFile as c, engineFailureFilePath as i, capFailureCause as n, toDeploymentSummary as o, captureEngineFailure as r, withComposerAdvice as s, DEPLOYMENT_RESULT_FILE_ENV as t };\n\n//# sourceMappingURL=deployment-summary-YP7eMPJI.mjs.map"],"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,WAAW,UAAU,WAAW,kBAAkB,KAAK,IAAI,KAAK,cAAc,KAAK,IAAI;EACjH,MAAM,KAAK;GACV;GACA;GACA,MAAM,CAAC,WAAW,UAAU,KAAK;EAClC,CAAC;CACF;CACA,MAAM,QAAQ,MAAM,WAAW,SAAS,KAAK,OAAO;CACpD,MAAM,OAAO,UAAU,KAAK,MAAM,MAAM,EAAE,IAAI,MAAM,MAAM,KAAK,CAAC,CAAC,QAAQ,SAAS,CAAC,KAAK,IAAI;CAC5F,IAAI,KAAK,WAAW,GAAG,OAAO,KAAK;CACnC,MAAM,QAAQ,wBAAwB,KAAK,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG;CACnF,OAAO,MAAM,UAAU,6BAA6B,QAAQ,GAAG,MAAM,MAAM,GAAG,6BAA6B,CAAC,EAAE;AAC/G;;AAEA,SAAS,gBAAgB,OAAO;CAC/B,OAAO,MAAM,UAAU,6BAA6B,QAAQ,GAAG,MAAM,MAAM,GAAG,6BAA6B,CAAC,EAAE;AAC/G"}
|
|
@@ -88,7 +88,7 @@ function okVoid() {
|
|
|
88
88
|
return OK_VOID;
|
|
89
89
|
}
|
|
90
90
|
//#endregion
|
|
91
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-current-
|
|
91
|
+
//#region ../../0-framework/3-tooling/cli/dist/dev-current-Ce4Zhfiy.mjs
|
|
92
92
|
/**
|
|
93
93
|
* Reads the execution diagnostics an engine-failure error carries in
|
|
94
94
|
* `meta.diagnostics`; undefined for every other failure.
|
|
@@ -161,7 +161,7 @@ async function deployWithDeps(input, deps) {
|
|
|
161
161
|
const cwd = input.cwd ?? process.cwd();
|
|
162
162
|
let executor;
|
|
163
163
|
try {
|
|
164
|
-
executor = await import("./execute-deploy-destroy-
|
|
164
|
+
executor = await import("./execute-deploy-destroy-D2Ok1xun-DuY58xzA.mjs");
|
|
165
165
|
} catch (error) {
|
|
166
166
|
return notOk(executorLoadFailure("deploy", error));
|
|
167
167
|
}
|
|
@@ -182,7 +182,7 @@ async function devWithDeps(input, deps) {
|
|
|
182
182
|
const cwd = input.cwd ?? process.cwd();
|
|
183
183
|
let executor;
|
|
184
184
|
try {
|
|
185
|
-
executor = await import("./execute-dev-
|
|
185
|
+
executor = await import("./execute-dev-BBPgDWzf-BCSle0Mw.mjs");
|
|
186
186
|
} catch (error) {
|
|
187
187
|
return notOk(executorLoadFailure("dev", error));
|
|
188
188
|
}
|
|
@@ -190,7 +190,7 @@ async function devWithDeps(input, deps) {
|
|
|
190
190
|
}
|
|
191
191
|
async function loadExecutor(operation) {
|
|
192
192
|
try {
|
|
193
|
-
return ok(await import("./execute-dev-current-
|
|
193
|
+
return ok(await import("./execute-dev-current-DNIwPfcW-uOHywz_h.mjs"));
|
|
194
194
|
} catch (error) {
|
|
195
195
|
return notOk(executorLoadFailure(operation, error));
|
|
196
196
|
}
|
|
@@ -210,4 +210,4 @@ async function devStop(input) {
|
|
|
210
210
|
//#endregion
|
|
211
211
|
export { executionDiagnostics as a, toStructured as c, okVoid as d, devUrl as i, notOk as l, dev as n, executorLoadFailure as o, devStop as r, requireContainerForEnvironment as s, deploy as t, ok as u };
|
|
212
212
|
|
|
213
|
-
//# sourceMappingURL=dev-current-
|
|
213
|
+
//# sourceMappingURL=dev-current-Ce4Zhfiy-TY0NjkOZ.mjs.map
|
package/dist/{dev-current-D8GwJQex-BqMILWv-.mjs.map → dev-current-Ce4Zhfiy-TY0NjkOZ.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-current-D8GwJQex-BqMILWv-.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.mjs","../../../0-framework/3-tooling/cli/dist/dev-current-D8GwJQex.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\nconst RUN_OF = {\n\tdeploy: {\n\t\trunning: \"this deploy\",\n\t\truns: \"the deploy\"\n\t},\n\tdestroy: {\n\t\trunning: \"this destroy\",\n\t\truns: \"the destroy\"\n\t},\n\tdev: {\n\t\trunning: \"`prisma dev`\",\n\t\truns: \"`prisma dev`\"\n\t}\n};\n/**\n* An extension older than this Composer stores the input it is given but\n* resolves from a key without `environment`, so it may read every name as\n* production, or, locally, put every environment in one copy. Its\n* `deserialize` rebuilds only the fields it knows, so the container the\n* Alchemy child rebuilds shows which environment it really resolved.\n* Refusing here keeps a mismatched install from deploying into, destroying\n* or running the wrong place.\n*/\nfunction requireContainerForEnvironment(action, extensionId, descriptor, instance, environment) {\n\tlet rebuiltEnvironment;\n\ttry {\n\t\trebuiltEnvironment = descriptor.deserialize(instance.serialize()).input.environment;\n\t} catch {\n\t\trebuiltEnvironment = void 0;\n\t}\n\tif (rebuiltEnvironment === environment) return;\n\tconst { running, runs } = RUN_OF[action];\n\tthrow new CliStructuredError(\"DEPS.EXTENSION_INCOMPATIBLE\", `The extension ${extensionId} is older than the Composer running ${running}, so it would not resolve the environment ${environment}.`, { fix: `Install the same Composer version of ${extensionId} as the Composer that runs ${runs}.` });\n}\n//#endregion\n//#region src/operations/deploy.ts\n/** The environment `deploy` targets when none is named. */\nconst DEFAULT_DEPLOY_ENVIRONMENT = \"production\";\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-1SIH5uAu.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-xPaS5SAl.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev-current.ts\nasync function loadExecutor(operation) {\n\ttry {\n\t\treturn ok(await import(\"./execute-dev-current-DsAsDBB1.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` runs locally in the environment. */\nasync function devUrl(input) {\n\tconst executor = await loadExecutor(\"dev url\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevUrl(input, input.cwd ?? process.cwd());\n}\n/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */\nasync function devStop(input) {\n\tconst executor = await loadExecutor(\"dev stop\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevStop(input, input.cwd ?? process.cwd());\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT as a, executionDiagnostics as c, toStructured as d, devWithDeps as i, executorLoadFailure as l, devUrl as n, deploy as o, dev as r, deployWithDeps as s, devStop as t, requireContainerForEnvironment as u };\n\n//# sourceMappingURL=dev-current-D8GwJQex.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAI,aAAa,MAAM,WAAW;CACjC;CACA;CACA;CACA,YAAY,IAAI,gBAAgB;EAC/B,KAAK,KAAK;EACV,IAAI,IAAI,KAAK,SAAS,UAAU,cAAc;OACzC,KAAK,WAAW,UAAU,cAAc;EAC7C,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAA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,eAAe,IAAI,OAAO;CACzB,OAAO,YAAY,OAAO,CAAC,CAAC;AAC7B;;;;AAIA,eAAe,YAAY,OAAO,MAAM;CACvC,MAAM,MAAM,MAAM,OAAO,QAAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;AAGA,eAAe,aAAa,WAAW;CACtC,IAAI;EACH,OAAO,GAAG,MAAM,OAAO,8CAAqC;CAC7D,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;AACD;;AAEA,eAAe,OAAO,OAAO;CAC5B,MAAM,WAAW,MAAM,aAAa,SAAS;CAC7C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,cAAc,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACtE;;AAEA,eAAe,QAAQ,OAAO;CAC7B,MAAM,WAAW,MAAM,aAAa,UAAU;CAC9C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,eAAe,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACvE"}
|
|
1
|
+
{"version":3,"file":"dev-current-Ce4Zhfiy-TY0NjkOZ.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.mjs","../../../0-framework/3-tooling/cli/dist/dev-current-Ce4Zhfiy.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-Dfur7Zqt.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\nconst RUN_OF = {\n\tdeploy: {\n\t\trunning: \"this deploy\",\n\t\truns: \"the deploy\"\n\t},\n\tdestroy: {\n\t\trunning: \"this destroy\",\n\t\truns: \"the destroy\"\n\t},\n\tdev: {\n\t\trunning: \"`prisma dev`\",\n\t\truns: \"`prisma dev`\"\n\t}\n};\n/**\n* An extension older than this Composer stores the input it is given but\n* resolves from a key without `environment`, so it may read every name as\n* production, or, locally, put every environment in one copy. Its\n* `deserialize` rebuilds only the fields it knows, so the container the\n* Alchemy child rebuilds shows which environment it really resolved.\n* Refusing here keeps a mismatched install from deploying into, destroying\n* or running the wrong place.\n*/\nfunction requireContainerForEnvironment(action, extensionId, descriptor, instance, environment) {\n\tlet rebuiltEnvironment;\n\ttry {\n\t\trebuiltEnvironment = descriptor.deserialize(instance.serialize()).input.environment;\n\t} catch {\n\t\trebuiltEnvironment = void 0;\n\t}\n\tif (rebuiltEnvironment === environment) return;\n\tconst { running, runs } = RUN_OF[action];\n\tthrow new CliStructuredError(\"DEPS.EXTENSION_INCOMPATIBLE\", `The extension ${extensionId} is older than the Composer running ${running}, so it would not resolve the environment ${environment}.`, { fix: `Install the same Composer version of ${extensionId} as the Composer that runs ${runs}.` });\n}\n//#endregion\n//#region src/operations/deploy.ts\n/** The environment `deploy` targets when none is named. */\nconst DEFAULT_DEPLOY_ENVIRONMENT = \"production\";\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-D2Ok1xun.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-BBPgDWzf.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev-current.ts\nasync function loadExecutor(operation) {\n\ttry {\n\t\treturn ok(await import(\"./execute-dev-current-DNIwPfcW.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` runs locally in the environment. */\nasync function devUrl(input) {\n\tconst executor = await loadExecutor(\"dev url\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevUrl(input, input.cwd ?? process.cwd());\n}\n/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */\nasync function devStop(input) {\n\tconst executor = await loadExecutor(\"dev stop\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevStop(input, input.cwd ?? process.cwd());\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT as a, executionDiagnostics as c, toStructured as d, devWithDeps as i, executorLoadFailure as l, devUrl as n, deploy as o, dev as r, deployWithDeps as s, devStop as t, requireContainerForEnvironment as u };\n\n//# sourceMappingURL=dev-current-Ce4Zhfiy.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAI,aAAa,MAAM,WAAW;CACjC;CACA;CACA;CACA,YAAY,IAAI,gBAAgB;EAC/B,KAAK,KAAK;EACV,IAAI,IAAI,KAAK,SAAS,UAAU,cAAc;OACzC,KAAK,WAAW,UAAU,cAAc;EAC7C,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,qCAAqC;EAC3E,OAAO,KAAK;CACb;CACA,IAAI,UAAU;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,oCAAoC;EACzE,OAAO,KAAK;CACb;;;;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AAQ,IAAI;CACrC,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,OAAO;CACzB,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,OAAO,KAAK,CAAC;CAC/C;CACA,OAAO,SAAS,WAAW,OAAO,MAAM,GAAG;AAC5C;AAGA,eAAe,aAAa,WAAW;CACtC,IAAI;EACH,OAAO,GAAG,MAAM,OAAO,8CAAqC;CAC7D,SAAS,OAAO;EACf,OAAO,MAAM,oBAAoB,WAAW,KAAK,CAAC;CACnD;AACD;;AAEA,eAAe,OAAO,OAAO;CAC5B,MAAM,WAAW,MAAM,aAAa,SAAS;CAC7C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,cAAc,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACtE;;AAEA,eAAe,QAAQ,OAAO;CAC7B,MAAM,WAAW,MAAM,aAAa,UAAU;CAC9C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,eAAe,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACvE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./graph-
|
|
1
|
+
import "./graph-C6Fqe2gn-DMa2udEA.mjs";
|
|
2
2
|
//#region ../../0-framework/1-core/core/dist/index.mjs
|
|
3
3
|
/**
|
|
4
4
|
* A data-only descriptor of a param's schema for introspection — the
|
|
@@ -111,4 +111,4 @@ function hydrateSync(root, config) {
|
|
|
111
111
|
//#endregion
|
|
112
112
|
export { number as a, inputManifest as i, hydrate as n, param as o, hydrateSync as r, string as s, configOf as t };
|
|
113
113
|
|
|
114
|
-
//# sourceMappingURL=dist-
|
|
114
|
+
//# sourceMappingURL=dist-BxtsHOfP.mjs.map
|