@powerhousedao/ph-cli 6.3.0-dev.9 → 6.4.0-next.1
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/README.md +1 -1
- package/dist/{build-DuNe06I0.mjs → build-C490lBnu.mjs} +90 -18
- package/dist/build-C490lBnu.mjs.map +1 -0
- package/dist/build-DblrRe4z.mjs +4 -0
- package/dist/{check-EzkmRLx6.mjs → check-D84ta1Dh.mjs} +4 -4
- package/dist/{check-EzkmRLx6.mjs.map → check-D84ta1Dh.mjs.map} +1 -1
- package/dist/{check-B8oqVMg7.mjs → check-DIK1LTss.mjs} +5 -5
- package/dist/{check-B8oqVMg7.mjs.map → check-DIK1LTss.mjs.map} +1 -1
- package/dist/{check-VOIkykDt.mjs → check-F3nwJiG-.mjs} +3 -3
- package/dist/{cli-connect-override-D22yFWlC.mjs → cli-connect-override-BMU4Qldg.mjs} +8 -8
- package/dist/cli-connect-override-BMU4Qldg.mjs.map +1 -0
- package/dist/cli.mjs +21 -31
- package/dist/cli.mjs.map +1 -1
- package/dist/{compound-DKi56SSx-CXQHhS6t.mjs → compound-BWLJ0KBw-8hKyrfjG.mjs} +659 -276
- package/dist/compound-BWLJ0KBw-8hKyrfjG.mjs.map +1 -0
- package/dist/{connect-build-Be8C4skj.mjs → connect-build-DW1fFVbU.mjs} +6 -6
- package/dist/{connect-build-Be8C4skj.mjs.map → connect-build-DW1fFVbU.mjs.map} +1 -1
- package/dist/{connect-config-CVU4xhti.mjs → connect-config-DVubBBLb.mjs} +4 -4
- package/dist/{connect-config-CVU4xhti.mjs.map → connect-config-DVubBBLb.mjs.map} +1 -1
- package/dist/{connect-preview-CdFvlANO.mjs → connect-preview-BvxXGo_W.mjs} +7 -6
- package/dist/connect-preview-BvxXGo_W.mjs.map +1 -0
- package/dist/{connect-studio-BnfhpIv8.mjs → connect-studio-CQC-LDSg.mjs} +16 -7
- package/dist/connect-studio-CQC-LDSg.mjs.map +1 -0
- package/dist/definitions-worker.mjs +1 -1
- package/dist/{dist-DXcB8fAF.mjs → dist-BFMRL5C0.mjs} +52 -105
- package/dist/dist-BFMRL5C0.mjs.map +1 -0
- package/dist/{explain-8OEXF2Dy.mjs → explain-YPD3n6t8.mjs} +67 -21
- package/dist/explain-YPD3n6t8.mjs.map +1 -0
- package/dist/{export-DqbcbFU5.mjs → export-DjQL6zkr.mjs} +5 -5
- package/dist/{export-DqbcbFU5.mjs.map → export-DjQL6zkr.mjs.map} +1 -1
- package/dist/{generate-all-0YOnlZM0.mjs → generate-all-BLot_H9Z.mjs} +4 -4
- package/dist/{generate-all-0YOnlZM0.mjs.map → generate-all-BLot_H9Z.mjs.map} +1 -1
- package/dist/{generate-desktop-shell-BovoRsR6.mjs → generate-desktop-shell-CTrfzM9P.mjs} +6 -16
- package/dist/generate-desktop-shell-CTrfzM9P.mjs.map +1 -0
- package/dist/{get-version-JkZQOcO1.mjs → get-version-CcYVboCW.mjs} +4 -4
- package/dist/{get-version-JkZQOcO1.mjs.map → get-version-CcYVboCW.mjs.map} +1 -1
- package/dist/{index-H3AYe65i.d.mts → index-D3H9pQ8u.d.mts} +58 -4
- package/dist/index-D3H9pQ8u.d.mts.map +1 -0
- package/dist/{init-Ltg4cJzm.mjs → init-IQ0VS0JK.mjs} +4 -4
- package/dist/{init-Ltg4cJzm.mjs.map → init-IQ0VS0JK.mjs.map} +1 -1
- package/dist/{inspect-zWJnBDMJ.mjs → inspect-Bxa9y7zM.mjs} +4 -4
- package/dist/{inspect-zWJnBDMJ.mjs.map → inspect-Bxa9y7zM.mjs.map} +1 -1
- package/dist/{mcp-vSCc5KHI.mjs → mcp-B3l1mtBq.mjs} +7 -7
- package/dist/mcp-B3l1mtBq.mjs.map +1 -0
- package/dist/{migrate-C27-tFFC.mjs → migrate-CzcBEypc.mjs} +6 -6
- package/dist/{migrate-C27-tFFC.mjs.map → migrate-CzcBEypc.mjs.map} +1 -1
- package/dist/{migrate-document-models-CKnqQnRh.mjs → migrate-document-models-D0HSo4WN.mjs} +4 -4
- package/dist/{migrate-document-models-CKnqQnRh.mjs.map → migrate-document-models-D0HSo4WN.mjs.map} +1 -1
- package/dist/{migrate-subgraphs-B2nTiJ-j.mjs → migrate-subgraphs-CfSMlcJD.mjs} +55 -15
- package/dist/migrate-subgraphs-CfSMlcJD.mjs.map +1 -0
- package/dist/migrate-subgraphs-Hc5w9Mpk.mjs +4 -0
- package/dist/{ph-cli-commands-DhoNXWGf.mjs → ph-cli-commands-CQXdWQ74.mjs} +52 -184
- package/dist/ph-cli-commands-CQXdWQ74.mjs.map +1 -0
- package/dist/ph-cli-commands-YE0ciOSX.mjs +4 -0
- package/dist/run-sugar-BfnRBv7h.mjs +4 -0
- package/dist/run-sugar-hGKprsKz.mjs +96 -0
- package/dist/run-sugar-hGKprsKz.mjs.map +1 -0
- package/dist/runners/connect.d.mts +2 -2
- package/dist/runners/connect.d.mts.map +1 -1
- package/dist/runners/connect.mjs +30 -18
- package/dist/runners/connect.mjs.map +1 -1
- package/dist/runners/switchboard.d.mts +3 -3
- package/dist/runners/switchboard.mjs +11 -11
- package/dist/runners/switchboard.mjs.map +1 -1
- package/dist/scripts/generate-commands-docs.ts +3 -7
- package/dist/service-args-D6y3L0bm.mjs +49 -0
- package/dist/service-args-D6y3L0bm.mjs.map +1 -0
- package/dist/sugar-checks-CTCsK5DJ.mjs +175 -0
- package/dist/sugar-checks-CTCsK5DJ.mjs.map +1 -0
- package/dist/{switchboard-reset-MtTB_GAI.mjs → switchboard-reset-BP7KwUc_.mjs} +5 -5
- package/dist/switchboard-reset-BP7KwUc_.mjs.map +1 -0
- package/dist/utils-BU25LHRE.mjs +4 -0
- package/dist/{utils-9KyRM0mf.mjs → utils-D5VlY5AZ.mjs} +4 -15
- package/dist/utils-D5VlY5AZ.mjs.map +1 -0
- package/dist/{verify-DCf_nRt8.mjs → verify-NK6a_7j8.mjs} +4 -4
- package/dist/{verify-DCf_nRt8.mjs.map → verify-NK6a_7j8.mjs.map} +1 -1
- package/dist/vetra-gateway-Bpe50oGk.mjs +4 -0
- package/dist/vetra-gateway-BxcduYAI.mjs +173 -0
- package/dist/vetra-gateway-BxcduYAI.mjs.map +1 -0
- package/dist/{vetra-host-ChTpJiBJ.mjs → vetra-host-BrLdIMRP.mjs} +24 -9
- package/dist/vetra-host-BrLdIMRP.mjs.map +1 -0
- package/dist/{vetra-instance-CzhYIjxL.mjs → vetra-instance-CPNIsaxh.mjs} +9 -17
- package/dist/vetra-instance-CPNIsaxh.mjs.map +1 -0
- package/dist/vetra-launcher-BtDWQBuh.mjs +4 -0
- package/dist/{vetra-launch-qi10Unax.mjs → vetra-launcher-Dokr1aDK.mjs} +14 -32
- package/dist/vetra-launcher-Dokr1aDK.mjs.map +1 -0
- package/dist/{vetra-switchboard-tzdc14KA.mjs → vetra-switchboard-Ctje6iR1.mjs} +4 -4
- package/dist/{vetra-switchboard-tzdc14KA.mjs.map → vetra-switchboard-Ctje6iR1.mjs.map} +1 -1
- package/package.json +16 -16
- package/dist/build-CnTFRBft.mjs +0 -4
- package/dist/build-DuNe06I0.mjs.map +0 -1
- package/dist/classic-args-mH_DVsgC.mjs +0 -48
- package/dist/classic-args-mH_DVsgC.mjs.map +0 -1
- package/dist/classic-warnings-BR0S6lr5.mjs +0 -179
- package/dist/classic-warnings-BR0S6lr5.mjs.map +0 -1
- package/dist/cli-connect-override-D22yFWlC.mjs.map +0 -1
- package/dist/compound-DKi56SSx-CXQHhS6t.mjs.map +0 -1
- package/dist/connect-preview-CdFvlANO.mjs.map +0 -1
- package/dist/connect-studio-BnfhpIv8.mjs.map +0 -1
- package/dist/connect-studio-D58ByAAn.mjs +0 -4
- package/dist/dist-DXcB8fAF.mjs.map +0 -1
- package/dist/explain-8OEXF2Dy.mjs.map +0 -1
- package/dist/generate-desktop-shell-BovoRsR6.mjs.map +0 -1
- package/dist/index-H3AYe65i.d.mts.map +0 -1
- package/dist/mcp-vSCc5KHI.mjs.map +0 -1
- package/dist/migrate-subgraphs-B1_NRwV7.mjs +0 -4
- package/dist/migrate-subgraphs-B2nTiJ-j.mjs.map +0 -1
- package/dist/ph-cli-commands-DhoNXWGf.mjs.map +0 -1
- package/dist/ph-cli-commands-LIME9alJ.mjs +0 -4
- package/dist/run-sugar-DpznOP1e.mjs +0 -56
- package/dist/run-sugar-DpznOP1e.mjs.map +0 -1
- package/dist/scripts/manage-environment +0 -199
- package/dist/scripts/setup-environment +0 -423
- package/dist/scripts/setup-environment.ps1 +0 -313
- package/dist/switchboard-reset-MtTB_GAI.mjs.map +0 -1
- package/dist/utils-9KyRM0mf.mjs.map +0 -1
- package/dist/utils-TO9lB8Xs.mjs +0 -4
- package/dist/vetra-CVNZ46pK.mjs +0 -352
- package/dist/vetra-CVNZ46pK.mjs.map +0 -1
- package/dist/vetra-host-ChTpJiBJ.mjs.map +0 -1
- package/dist/vetra-instance-CzhYIjxL.mjs.map +0 -1
- package/dist/vetra-launch-qi10Unax.mjs.map +0 -1
- package/dist/vetra-switchboard-BrkozIm7.mjs +0 -4
|
@@ -1,118 +1,62 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d7a0be1b-2030-5dcc-a1b0-cdac076dacbe")}catch(e){}}();
|
|
3
3
|
import { a as custom, b as prettifyError, c as literal, f as record, m as string, p as strictObject } from "./schemas-DzgKfQIx.mjs";
|
|
4
|
-
import { B as
|
|
5
|
-
import "node:module";
|
|
4
|
+
import { A as memberCycle, B as planCompound, C as hostSchemaIssues, D as kindShapeIssues, G as processResolveEnv, H as prepareMember, J as readProjectName, K as producerOutputsSchemas, L as outputRefsOf, N as memberVerbOf, O as loadHost, P as moduleRootOf, R as outputSitesOf, S as hostFileLabel, T as isPlainObject, V as planForeground, Z as resolveHostOutputs, _ as envSitesOf, at as substituteBuiltinEnv, c as checkOutputPaths, et as resolveRunnerModule, f as compoundStartVerb, j as memberForRef, k as loadProducers, l as checkTokenSites, n as HostLoadError, o as TokenResolutionError, ot as takesCspRegistrySync, p as declaredHostSchemas, q as projectDriveIdWith, r as ONE_SHOT_VERBS, rt as runnerOutputsSchema, st as unsetEnvMessage, w as isBuiltinEnvName, x as getVerb, y as findRemovedForms, z as packageBuildRefusal } from "./compound-BWLJ0KBw-8hKyrfjG.mjs";
|
|
6
5
|
import { DEFAULT_CONNECT_STUDIO_PORT, DEFAULT_SWITCHBOARD_PORT } from "@powerhousedao/shared/clis/constants";
|
|
7
|
-
import "node:fs";
|
|
8
6
|
import path from "node:path";
|
|
9
|
-
import "node:child_process";
|
|
10
7
|
import crypto from "node:crypto";
|
|
11
|
-
import "node:url";
|
|
12
8
|
import "@powerhousedao/shared/host-tokens";
|
|
13
9
|
import "@powerhousedao/shared/connect/origin-placeholder";
|
|
14
|
-
import net from "node:net";
|
|
15
10
|
import { DRIVE_ICON_MAX_BYTES, resolveImageRef } from "@powerhousedao/shared/connect/image-ref";
|
|
16
11
|
//#region ../../packages/host-core/dist/index.mjs
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* once, so no handler runs and a stack's stores are left as a crash leaves
|
|
20
|
-
* them. A started host therefore listens on a pipe named after its pid, and
|
|
21
|
-
* a connection to it is delivered as the SIGTERM it stands for. Elsewhere
|
|
22
|
-
* the signal itself does this, and there is no channel.
|
|
23
|
-
*/
|
|
24
|
-
function stopChannelPath(pid, platform = process.platform) {
|
|
25
|
-
return platform === "win32" ? `\\\\.\\pipe\\ph-stop-${pid}` : void 0;
|
|
26
|
-
}
|
|
27
|
-
/** Calls `onStop` for each connection to `channel`. The server holds no
|
|
28
|
-
* process open, and one that cannot listen leaves the host running without
|
|
29
|
-
* a channel rather than not running. */
|
|
30
|
-
function listenForStop(channel, onStop) {
|
|
31
|
-
const server = net.createServer((socket) => {
|
|
32
|
-
socket.on("error", () => void 0);
|
|
33
|
-
socket.end();
|
|
34
|
-
onStop();
|
|
35
|
-
});
|
|
36
|
-
server.on("error", () => void 0);
|
|
37
|
-
server.listen(channel);
|
|
38
|
-
server.unref();
|
|
39
|
-
return server;
|
|
40
|
-
}
|
|
41
|
-
let installed = false;
|
|
42
|
-
/** What a host's process calls once before it starts anything: from then on
|
|
43
|
-
* {@link requestStop} reaches its SIGTERM handlers on every platform. */
|
|
44
|
-
function installStopChannel() {
|
|
45
|
-
const channel = stopChannelPath(process.pid);
|
|
46
|
-
if (!channel || installed) return;
|
|
47
|
-
installed = true;
|
|
48
|
-
listenForStop(channel, () => {
|
|
49
|
-
if (!process.emit("SIGTERM", "SIGTERM")) process.exit(143);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
const ASK_TIMEOUT_MS = 2e3;
|
|
53
|
-
/** Connects to a stop channel; true once the listener took the request. */
|
|
54
|
-
function askToStop(channel, timeoutMs = ASK_TIMEOUT_MS) {
|
|
55
|
-
return new Promise((resolve) => {
|
|
56
|
-
let connected = false;
|
|
57
|
-
const socket = net.connect(channel);
|
|
58
|
-
socket.setTimeout(timeoutMs, () => socket.destroy());
|
|
59
|
-
socket.once("connect", () => connected = true);
|
|
60
|
-
socket.on("error", () => void 0);
|
|
61
|
-
socket.once("close", () => resolve(connected));
|
|
62
|
-
socket.resume();
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Asks the process to stop as SIGTERM would. False when it could not be
|
|
67
|
-
* asked: on Windows a process without a stop channel (started by an older
|
|
68
|
-
* version, or not a host), which only a kill ends.
|
|
69
|
-
*/
|
|
70
|
-
async function requestStop(pid, platform = process.platform) {
|
|
71
|
-
const channel = stopChannelPath(pid, platform);
|
|
72
|
-
if (channel) return askToStop(channel);
|
|
73
|
-
try {
|
|
74
|
-
process.kill(pid, "SIGTERM");
|
|
75
|
-
} catch {}
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
/** The `ph run` pipeline up to the verb, collecting every issue; starts nothing. */
|
|
12
|
+
/** The `ph run` pipeline up to the verb, collecting every issue; starts
|
|
13
|
+
* nothing. `name` is a ref: a project host, or `<package>/<host>`. */
|
|
79
14
|
async function checkHost(name, options) {
|
|
80
15
|
const result = {
|
|
81
16
|
issues: [],
|
|
82
17
|
warnings: [],
|
|
83
18
|
deferred: []
|
|
84
19
|
};
|
|
85
|
-
|
|
86
|
-
const issue = issuer(result, file);
|
|
20
|
+
let file = `hosts/${name}/host.js`;
|
|
87
21
|
const verb = options.verb ?? "run";
|
|
88
22
|
let host;
|
|
89
23
|
let runner;
|
|
24
|
+
let hostPackage;
|
|
90
25
|
try {
|
|
91
|
-
|
|
92
|
-
|
|
26
|
+
const loaded = await loadHost(options.projectRoot, name);
|
|
27
|
+
host = loaded.host;
|
|
28
|
+
hostPackage = loaded.package;
|
|
29
|
+
file = hostFileLabel(loaded.name, hostPackage);
|
|
30
|
+
runner = await resolveRunnerModule(moduleRootOf(options.projectRoot, loaded), host.runner.module);
|
|
93
31
|
} catch (error) {
|
|
94
|
-
|
|
32
|
+
issuer(result, file)("load", "", error);
|
|
95
33
|
return result;
|
|
96
34
|
}
|
|
97
35
|
const specifier = host.runner.module;
|
|
36
|
+
if (hostPackage && ONE_SHOT_VERBS.has(verb)) {
|
|
37
|
+
issuer(result, file)("declared", packageBuildRefusal(name, hostPackage, verb));
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
98
40
|
if (runner.kind === "compound") {
|
|
99
41
|
await checkCompound(result, options, {
|
|
100
42
|
file,
|
|
101
43
|
host,
|
|
102
44
|
runner,
|
|
103
45
|
specifier,
|
|
104
|
-
verb
|
|
46
|
+
verb,
|
|
47
|
+
hostPackage
|
|
105
48
|
});
|
|
106
49
|
return result;
|
|
107
50
|
}
|
|
108
51
|
const refs = outputRefsOf(host);
|
|
109
|
-
const producers = await loadProducers(options.projectRoot, refs);
|
|
52
|
+
const producers = await loadProducers(options.projectRoot, refs, hostPackage);
|
|
110
53
|
await checkSubject(result, options, {
|
|
111
54
|
file,
|
|
112
55
|
host,
|
|
113
56
|
runner,
|
|
114
57
|
specifier,
|
|
115
58
|
verb,
|
|
59
|
+
hostPackage,
|
|
116
60
|
outputsSchemaOf: producerOutputsSchemas(producers),
|
|
117
61
|
self: "outputs"
|
|
118
62
|
});
|
|
@@ -148,7 +92,7 @@ async function checkSubject(result, options, subject) {
|
|
|
148
92
|
const issue = issuer(result, subject.file);
|
|
149
93
|
const { runner, specifier, file } = subject;
|
|
150
94
|
const declared = checkDeclared(result, subject, subject.outputsSchemaOf);
|
|
151
|
-
const resolveEnv = processResolveEnv(options.projectRoot, options.env);
|
|
95
|
+
const resolveEnv = processResolveEnv(options.projectRoot, options.env, subject.hostPackage);
|
|
152
96
|
const patch = subject.patch ?? ((host) => host);
|
|
153
97
|
if (ONE_SHOT_VERBS.has(subject.verb)) {
|
|
154
98
|
if (!declared.tokens || !declared.shape) return;
|
|
@@ -224,16 +168,27 @@ async function checkCompound(result, options, subject) {
|
|
|
224
168
|
const verb = compoundStartVerb(subject.verb, host.runner);
|
|
225
169
|
const prepared = [];
|
|
226
170
|
for (const [key, member] of Object.entries(children)) try {
|
|
227
|
-
prepared.push(await prepareMember(options.projectRoot, key, member));
|
|
171
|
+
prepared.push(await prepareMember(options.projectRoot, key, member, subject.hostPackage));
|
|
228
172
|
} catch (error) {
|
|
229
173
|
issuer(result, `hosts/${member.host}/host.js`)("load", "", error);
|
|
230
174
|
}
|
|
175
|
+
try {
|
|
176
|
+
const cycle = await memberCycle(options.projectRoot, prepared);
|
|
177
|
+
if (cycle) issue("declared", {
|
|
178
|
+
path: "children",
|
|
179
|
+
message: `compound member cycle: ${cycle.join(" -> ")}.`,
|
|
180
|
+
hint: "A compound cannot run itself, directly or through another compound."
|
|
181
|
+
});
|
|
182
|
+
} catch (error) {
|
|
183
|
+
issue("load", "children", error);
|
|
184
|
+
}
|
|
231
185
|
const members = Object.entries(children).map(([key, m]) => ({
|
|
232
186
|
key,
|
|
233
187
|
host: m.host
|
|
234
188
|
}));
|
|
189
|
+
let foreground;
|
|
235
190
|
if (prepared.length === members.length) try {
|
|
236
|
-
planCompound(prepared.map((m) => ({
|
|
191
|
+
const plan = planCompound(prepared.map((m) => ({
|
|
237
192
|
key: m.key,
|
|
238
193
|
host: m.member.host,
|
|
239
194
|
refs: outputSitesOf(m.draft).map(({ ref, path }) => ({
|
|
@@ -241,6 +196,9 @@ async function checkCompound(result, options, subject) {
|
|
|
241
196
|
path
|
|
242
197
|
}))
|
|
243
198
|
})), wiring.startOrder);
|
|
199
|
+
const planned = planForeground(prepared, plan, wiring);
|
|
200
|
+
for (const i of planned.issues) issue("declared", i);
|
|
201
|
+
foreground = planned.foreground;
|
|
244
202
|
} catch (error) {
|
|
245
203
|
issue("declared", "", error);
|
|
246
204
|
}
|
|
@@ -253,13 +211,23 @@ async function checkCompound(result, options, subject) {
|
|
|
253
211
|
return producer ? runnerOutputsSchema(producer.runner, producer.specifier, `member "${target.key}"`) : { error: `names member "${target.key}", which was not prepared.` };
|
|
254
212
|
};
|
|
255
213
|
for (const m of prepared) {
|
|
214
|
+
const isForeground = m.key === foreground;
|
|
215
|
+
if (isForeground && ONE_SHOT_VERBS.has(verb)) continue;
|
|
216
|
+
if (m.hostPackage && ONE_SHOT_VERBS.has(verb)) {
|
|
217
|
+
issue("declared", {
|
|
218
|
+
...packageBuildRefusal(m.ref, m.hostPackage, verb),
|
|
219
|
+
path: `children.${m.key}`
|
|
220
|
+
});
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
256
223
|
const csp = wiring.cspRegistrySync === true && takesCspRegistrySync(m);
|
|
257
224
|
await checkSubject(result, options, {
|
|
258
225
|
file: m.file,
|
|
259
226
|
host: m.draft,
|
|
260
227
|
runner: m.runner,
|
|
261
228
|
specifier: m.specifier,
|
|
262
|
-
|
|
229
|
+
...m.hostPackage ? { hostPackage: m.hostPackage } : {},
|
|
230
|
+
verb: isForeground ? m.draft.runner.defaultVerb ?? "run" : memberVerbOf(verb, m.draft.runner),
|
|
263
231
|
outputsSchemaOf,
|
|
264
232
|
self: { members },
|
|
265
233
|
...csp ? { patch: (resolved) => ({
|
|
@@ -500,7 +468,7 @@ const driveKey = (drive) => isLocalDrive(drive) ? `local:${drive.id}` : drive.ur
|
|
|
500
468
|
* Concatenate groups of `connect.drives.defaultDrives` in the order given,
|
|
501
469
|
* de-duplicating by drive identity (URL for remote entries, id for local
|
|
502
470
|
* ones). The first occurrence of a drive wins, so earlier groups keep their
|
|
503
|
-
* position and metadata — e.g. the Vetra drive `ph
|
|
471
|
+
* position and metadata — e.g. the Vetra drive `ph dev` starts stays first
|
|
504
472
|
* even when the project's `powerhouse.config.json` lists the same drive.
|
|
505
473
|
*/
|
|
506
474
|
function mergeDefaultDrives(...groups) {
|
|
@@ -514,29 +482,8 @@ function mergeDefaultDrives(...groups) {
|
|
|
514
482
|
}
|
|
515
483
|
return out;
|
|
516
484
|
}
|
|
517
|
-
/**
|
|
518
|
-
* Rebase a local drive URL onto a public base: keeps the /d/<slug> path,
|
|
519
|
-
* swaps the loopback origin for the public base. Browser clients behind a
|
|
520
|
-
* reverse proxy can't reach http://localhost:<port>. Non-loopback URLs
|
|
521
|
-
* (e.g. a remote drive) are already public and pass through unchanged, as do
|
|
522
|
-
* unparseable ones.
|
|
523
|
-
*/
|
|
524
|
-
function rebaseDriveUrl(driveUrl, publicBase) {
|
|
525
|
-
let url;
|
|
526
|
-
try {
|
|
527
|
-
url = new URL(driveUrl);
|
|
528
|
-
} catch {
|
|
529
|
-
return driveUrl;
|
|
530
|
-
}
|
|
531
|
-
if (![
|
|
532
|
-
"localhost",
|
|
533
|
-
"127.0.0.1",
|
|
534
|
-
"[::1]"
|
|
535
|
-
].includes(url.hostname)) return driveUrl;
|
|
536
|
-
return `${publicBase.replace(/\/+$/, "")}${url.pathname}`;
|
|
537
|
-
}
|
|
538
485
|
//#endregion
|
|
539
|
-
export {
|
|
486
|
+
export { mergeDrivePlan as a, mergeDefaultDrives as i, explainDrivePlan as n, projectDriveId as o, exportHost as r, resolveDriveDeclaration as s, checkHost as t };
|
|
540
487
|
|
|
541
|
-
//# sourceMappingURL=dist-
|
|
542
|
-
//# debugId=
|
|
488
|
+
//# sourceMappingURL=dist-BFMRL5C0.mjs.map
|
|
489
|
+
//# debugId=d7a0be1b-2030-5dcc-a1b0-cdac076dacbe
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-BFMRL5C0.mjs","sources":["../../../packages/host-core/dist/index.mjs"],"sourcesContent":["import { $ as computeOutputsHash, $n as runProvideHook, $t as resolveHostPlugins, A as STOP_RUN_TIMEOUT_MS, An as placementKeyIssues, At as resolveHostOutputs, B as probeRun, Bn as runnerKindSchema, Bt as checkTokenSites, C as applyChildWrapper, Cn as emitHostJsonSchema, Ct as packageBuildRefusal, D as COMPOUND_MEMBER_ENV, Dn as makeHostSchemas, Dt as TokenResolutionError, E as spawnHost, En as hostNameSchema, Et as validateHost, F as stopChannelPath, Fn as reactorProtocolSchema, Ft as BUILTIN_ENV_NAMES, G as writeRunRecord, Gn as normalizePluginEntries, Gt as schemaAtPath, H as readRunRecord, Hn as entryActiveForVerb, Ht as outputRefsOf, I as stopRun, In as reactorSchema, It as isBuiltinEnvName, J as checkRunnerArgv, Jn as pluginEntrySchema, Jt as formatPath, K as runRecordMemberSchema, Kn as normalizePluginEntry, Kt as collectTokenSites, L as clearRunRecord, Ln as refineConnectReactor, Lt as substituteBuiltinEnv, M as installStopChannel, Mn as reactorBackendKindSchema, Mt as PlanError, N as listenForStop, Nn as reactorBackendSchema, Nt as memberForRef, O as takeCompoundMember, On as memberProcessSchema, Ot as describeMapElements, P as requestStop, Pn as reactorHostSchema, Pt as planCompound, Q as OUTPUTS_FILE, Qn as runObserveHookSequential, Qt as findDeadConnectConfig, R as isPidAlive, Rn as refineStartOrder, Rt as findRemovedForms, S as resolveUserDataPlaceholders, Sn as defineHostSchemas, Sr as tokenable, St as listVerbs, T as SpawnHostError, Tn as genericCompoundHostSchema, Tt as validateDeclaredHost, U as recordKeyOf, Un as hostTypeSatisfies, Ut as outputSitesOf, V as readProjectName, Vn as PluginError, Vt as envSitesOf, W as runRecordKey, Wn as mergeContributions, Wt as refKey, X as splitCompoundArgv, Xn as resolveOrder, Xt as renderTokens, Y as isRunnerArgsSchema, Yn as registerHostType, Yt as isPlainObject, Z as splitRunArgv, Zn as runObserveHook, Zt as unwrapEscapes, _ as processResolveEnv, _n as compoundHostSchema, _r as mapTokenSchema, _t as getVerb, a as memberProcessOf, an as locateHost, ar as drivesSchema, at as loadHost, b as runnerOutputsSchema, bn as declaredGenericCompoundHostSchema, br as tokenKeyOf, bt as kindShapeIssues, c as prepareMember, cn as CONNECT_PRIMARY_MESSAGE, cr as TOKEN_KEYS, ct as probeHostsFolder, d as takesCspRegistrySync, dn as HOST_NAME_PATTERN, dr as envTokenable, dt as stripComments, en as resolvePluginContributions, er as runTransformHook, et as describeHostOutputs, f as runnerHandleSchema, fn as HOST_REF_MESSAGE, fr as findToken, ft as withoutHostsMessage, g as loadProducers, gn as childrenSchema, gr as keyTokenSchema, gt as STORE_VERBS, h as OUTPUT_DATA_DIRS_ENV, hn as childWrapperSchema, hr as itemTokenSchema, ht as RunnerError, i as memberCycle, in as hostFileLabel, ir as driveDeclarationSchema, it as lintOutputsFile, j as askToStop, jn as profileSchema, jt as unsetEnvMessage, k as STOP_ON_STDIN_ENV, kn as originOrUrlSchema, kt as emptyMaps, l as runCompound, ln as HOST_NAME_MAX_LENGTH, lr as concatTokenSchema, lt as readOutputsFileHash, m as compoundOutputSource, mn as PACKAGE_NAME_PATTERN, mr as isToken, mt as ONE_SHOT_VERBS, n as compoundStartVerb, nn as findHostPackage, nr as defaultConnectComposition, nt as lintHostImportGraph, o as memberVerbOf, on as parseHostRef, or as projectDriveIdWith, ot as loadHostFresh, p as toStartedHandle, pn as HOST_REF_PATTERN, pr as forbidRef, pt as CONNECT_RUNNER, q as runRecordSchema, qn as pluginEntryObjectSchema, qt as describeToken, r as holdStopRequests, rn as formatHostRef, rr as buildDriveDeclarationSchema, rt as lintHostImports, s as planForeground, sn as resolvePackageRoot, sr as TOKEN_ESCAPE_KEY, st as moduleRootOf, t as STOP_STREAM_LIMIT_MS, tn as HostLoadError, tr as CONNECT_PLUGIN_OWNED_SLICES, tt as findNonStaticValue, u as stopStreamOf, un as HOST_NAME_MESSAGE, ur as envTokenSchema, ut as scanHostImports, v as producerOutputsSchemas, vn as compoundWiringSchema, vr as outputTokenSchema, vt as hostSchemaIssues, w as SPAWN_STOPPING_NOTE, wn as emittedHostSchemas, wt as resolveRunnerModule, x as defaultUserDataDir, xn as declaredHostSchemas, xr as tokenSchema, xt as knownVerbIssues, y as runRecordOutputSource, yn as connectReactorIssues, yr as ref, yt as isSchemaLike, z as listRunRecords, zn as runnerBaseSchema, zt as checkOutputPaths } from \"./compound-BWLJ0KBw.mjs\";\nimport { killTree } from \"./kill-tree.mjs\";\nimport crypto from \"node:crypto\";\nimport path from \"node:path\";\nimport { z } from \"zod\";\nimport { driveAddressMessage, switchboardOfDrive, switchboardOfDrive as switchboardOfDrive$1 } from \"@powerhousedao/shared/host-tokens\";\nimport { ORIGIN_PLACEHOLDER, SWITCHBOARD_PROXY_PATHS, isHtmlNavigation, isOriginPlaceholderUrl, isSwitchboardProxyPath, resolveOriginPlaceholders, toOriginPlaceholder, withOriginPlaceholders } from \"@powerhousedao/shared/connect/origin-placeholder\";\nimport { DEFAULT_CONNECT_STUDIO_PORT, DEFAULT_SWITCHBOARD_PORT } from \"@powerhousedao/shared/clis/constants\";\nimport { DRIVE_ICON_MAX_BYTES, resolveImageRef } from \"@powerhousedao/shared/connect/image-ref\";\n//#region src/check-host.ts\n/** The `ph run` pipeline up to the verb, collecting every issue; starts\n* nothing. `name` is a ref: a project host, or `<package>/<host>`. */\nasync function checkHost(name, options) {\n\tconst result = {\n\t\tissues: [],\n\t\twarnings: [],\n\t\tdeferred: []\n\t};\n\tlet file = `hosts/${name}/host.js`;\n\tconst verb = options.verb ?? \"run\";\n\tlet host;\n\tlet runner;\n\tlet hostPackage;\n\ttry {\n\t\tconst loaded = await loadHost(options.projectRoot, name);\n\t\thost = loaded.host;\n\t\thostPackage = loaded.package;\n\t\tfile = hostFileLabel(loaded.name, hostPackage);\n\t\trunner = await resolveRunnerModule(moduleRootOf(options.projectRoot, loaded), host.runner.module);\n\t} catch (error) {\n\t\tissuer(result, file)(\"load\", \"\", error);\n\t\treturn result;\n\t}\n\tconst specifier = host.runner.module;\n\tif (hostPackage && ONE_SHOT_VERBS.has(verb)) {\n\t\tissuer(result, file)(\"declared\", packageBuildRefusal(name, hostPackage, verb));\n\t\treturn result;\n\t}\n\tif (runner.kind === \"compound\") {\n\t\tawait checkCompound(result, options, {\n\t\t\tfile,\n\t\t\thost,\n\t\t\trunner,\n\t\t\tspecifier,\n\t\t\tverb,\n\t\t\thostPackage\n\t\t});\n\t\treturn result;\n\t}\n\tconst refs = outputRefsOf(host);\n\tconst producers = await loadProducers(options.projectRoot, refs, hostPackage);\n\tawait checkSubject(result, options, {\n\t\tfile,\n\t\thost,\n\t\trunner,\n\t\tspecifier,\n\t\tverb,\n\t\thostPackage,\n\t\toutputsSchemaOf: producerOutputsSchemas(producers),\n\t\tself: \"outputs\"\n\t});\n\treturn result;\n}\n/** Declared validation; returns whether its tokens and its shape passed. */\nfunction checkDeclared(result, subject, outputsSchemaOf) {\n\tconst issue = issuer(result, subject.file);\n\tconst { host, runner, specifier } = subject;\n\ttry {\n\t\tgetVerb(runner, specifier, subject.verb);\n\t} catch (error) {\n\t\tissue(\"declared\", \"\", error);\n\t}\n\tconst tokenIssues = [\n\t\t...findRemovedForms(host),\n\t\t...checkTokenSites(host),\n\t\t...outputsSchemaOf ? checkOutputPaths(host, outputsSchemaOf) : []\n\t];\n\tfor (const i of tokenIssues) issue(\"declared\", i);\n\tconst shapeIssues = runner.declaredHostSchema ? schemaIssuesOf(runner, runner.declaredHostSchema, specifier, host, true) : kindShapeIssues(runner.kind, specifier, host);\n\tfor (const i of shapeIssues) issue(\"declared\", i);\n\treturn {\n\t\ttokens: tokenIssues.length === 0,\n\t\tshape: shapeIssues.length === 0\n\t};\n}\nfunction schemaIssuesOf(runner, schema, specifier, host, allowTokens) {\n\tconst checked = hostSchemaIssues(runner, schema, specifier, host, { tokens: allowTokens ? \"allow\" : \"forbid\" });\n\treturn [...checked.issues, ...checked.schemaIssues ?? []];\n}\nasync function checkSubject(result, options, subject) {\n\tconst issue = issuer(result, subject.file);\n\tconst { runner, specifier, file } = subject;\n\tconst declared = checkDeclared(result, subject, subject.outputsSchemaOf);\n\tconst resolveEnv = processResolveEnv(options.projectRoot, options.env, subject.hostPackage);\n\tconst patch = subject.patch ?? ((host) => host);\n\tif (ONE_SHOT_VERBS.has(subject.verb)) {\n\t\tif (!declared.tokens || !declared.shape) return;\n\t\tconst host = patch(substituteBuiltinEnv(subject.host, resolveEnv.builtins ?? {}));\n\t\tconst schema = runner.declaredHostSchema ?? runner.hostSchema;\n\t\tfor (const i of schemaIssuesOf(runner, schema, specifier, host, true)) issue(\"resolved\", i);\n\t\treturn;\n\t}\n\tconst unset = envSitesOf(subject.host).filter((site) => !site.optional && !isBuiltinEnvName(site.name) && options.env[site.name] === void 0);\n\tfor (const site of unset) issue(\"resolve\", {\n\t\tpath: site.path,\n\t\tmessage: unsetEnvMessage(site.name)\n\t});\n\tif (!declared.tokens || unset.length > 0) return;\n\tlet resolved;\n\tlet deferred = [];\n\ttry {\n\t\tif (options.outputs) resolved = resolveHostOutputs(subject.host, {\n\t\t\toutputs: options.outputs,\n\t\t\t...resolveEnv\n\t\t});\n\t\telse {\n\t\t\tconst partial = resolveHostOutputs(subject.host, resolveEnv, { deferSelf: subject.self });\n\t\t\tresolved = partial.host;\n\t\t\tdeferred = partial.deferred;\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof TokenResolutionError && error.detail) issue(\"resolve\", {\n\t\t\tpath: error.detail.path,\n\t\t\tmessage: error.detail.reason\n\t\t});\n\t\telse issue(\"resolve\", \"\", error);\n\t\treturn;\n\t}\n\tresult.deferred.push(...deferred.map((d) => ({\n\t\t...d,\n\t\tfile\n\t})));\n\tif (!declared.shape) return;\n\tconst allow = deferred.length > 0;\n\tconst schema = allow ? runner.declaredHostSchema ?? runner.hostSchema : runner.hostSchema;\n\tconst checked = hostSchemaIssues(runner, schema, specifier, patch(resolved), { tokens: allow ? \"allow\" : \"forbid\" });\n\tconst resolvedIssues = [...checked.issues, ...checked.schemaIssues ?? []];\n\tfor (const i of resolvedIssues) issue(\"resolved\", i);\n\tif (resolvedIssues.length > 0 || !runner.checkBoot) return;\n\ttry {\n\t\tconst boot = await runner.checkBoot(checked.data, {\n\t\t\tprojectRoot: options.projectRoot,\n\t\t\tverb: subject.verb,\n\t\t\tenv: options.env,\n\t\t\tfile\n\t\t});\n\t\tfor (const i of boot) issue(\"boot\", {\n\t\t\t...i,\n\t\t\tpath: i.path ?? \"\"\n\t\t});\n\t} catch (error) {\n\t\tissue(\"boot\", \"\", error);\n\t}\n}\nasync function checkCompound(result, options, subject) {\n\tconst issue = issuer(result, subject.file);\n\tconst { host, runner, specifier } = subject;\n\tconst declared = checkDeclared(result, subject);\n\tif (!declared.tokens || !declared.shape) return;\n\tif (!runner.declaredHostSchema) {\n\t\tconst own = schemaIssuesOf(runner, runner.hostSchema, specifier, host, true);\n\t\tfor (const i of own) issue(\"resolved\", i);\n\t\tif (own.length > 0) return;\n\t}\n\tconst children = isPlainObject(host.children) ? host.children : {};\n\tconst wiring = isPlainObject(host.config) ? host.config : {};\n\tconst verb = compoundStartVerb(subject.verb, host.runner);\n\tconst prepared = [];\n\tfor (const [key, member] of Object.entries(children)) try {\n\t\tprepared.push(await prepareMember(options.projectRoot, key, member, subject.hostPackage));\n\t} catch (error) {\n\t\tissuer(result, `hosts/${member.host}/host.js`)(\"load\", \"\", error);\n\t}\n\ttry {\n\t\tconst cycle = await memberCycle(options.projectRoot, prepared);\n\t\tif (cycle) issue(\"declared\", {\n\t\t\tpath: \"children\",\n\t\t\tmessage: `compound member cycle: ${cycle.join(\" -> \")}.`,\n\t\t\thint: \"A compound cannot run itself, directly or through another compound.\"\n\t\t});\n\t} catch (error) {\n\t\tissue(\"load\", \"children\", error);\n\t}\n\tconst members = Object.entries(children).map(([key, m]) => ({\n\t\tkey,\n\t\thost: m.host\n\t}));\n\tlet foreground;\n\tif (prepared.length === members.length) try {\n\t\tconst plan = planCompound(prepared.map((m) => ({\n\t\t\tkey: m.key,\n\t\t\thost: m.member.host,\n\t\t\trefs: outputSitesOf(m.draft).map(({ ref, path }) => ({\n\t\t\t\tref,\n\t\t\t\tpath\n\t\t\t}))\n\t\t})), wiring.startOrder);\n\t\tconst planned = planForeground(prepared, plan, wiring);\n\t\tfor (const i of planned.issues) issue(\"declared\", i);\n\t\tforeground = planned.foreground;\n\t} catch (error) {\n\t\tissue(\"declared\", \"\", error);\n\t}\n\tresult.warnings.push(...sharedPortWarnings(subject.file, prepared));\n\tconst byKey = new Map(prepared.map((m) => [m.key, m]));\n\tconst outputsSchemaOf = (ref) => {\n\t\tconst target = memberForRef(ref, members);\n\t\tif (\"error\" in target) return { error: target.error };\n\t\tconst producer = byKey.get(target.key);\n\t\treturn producer ? runnerOutputsSchema(producer.runner, producer.specifier, `member \"${target.key}\"`) : { error: `names member \"${target.key}\", which was not prepared.` };\n\t};\n\tfor (const m of prepared) {\n\t\tconst isForeground = m.key === foreground;\n\t\tif (isForeground && ONE_SHOT_VERBS.has(verb)) continue;\n\t\tif (m.hostPackage && ONE_SHOT_VERBS.has(verb)) {\n\t\t\tissue(\"declared\", {\n\t\t\t\t...packageBuildRefusal(m.ref, m.hostPackage, verb),\n\t\t\t\tpath: `children.${m.key}`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst csp = wiring.cspRegistrySync === true && takesCspRegistrySync(m);\n\t\tawait checkSubject(result, options, {\n\t\t\tfile: m.file,\n\t\t\thost: m.draft,\n\t\t\trunner: m.runner,\n\t\t\tspecifier: m.specifier,\n\t\t\t...m.hostPackage ? { hostPackage: m.hostPackage } : {},\n\t\t\tverb: isForeground ? m.draft.runner.defaultVerb ?? \"run\" : memberVerbOf(verb, m.draft.runner),\n\t\t\toutputsSchemaOf,\n\t\t\tself: { members },\n\t\t\t...csp ? { patch: (resolved) => ({\n\t\t\t\t...resolved,\n\t\t\t\trunner: {\n\t\t\t\t\t...resolved.runner,\n\t\t\t\t\tcspRegistrySync: true\n\t\t\t\t}\n\t\t\t}) } : {}\n\t\t});\n\t}\n}\nconst SWITCHBOARD_RUNNER = \"@powerhousedao/ph-cli/runners/switchboard\";\n/** The port a member binds: its own literal, else its ph-cli runner's default. */\nfunction boundPortOf(m) {\n\tconst port = m.draft.runner.port;\n\tif (port === void 0) {\n\t\tif (m.specifier === \"@powerhousedao/ph-cli/runners/connect\") return DEFAULT_CONNECT_STUDIO_PORT;\n\t\tif (m.specifier === SWITCHBOARD_RUNNER) return DEFAULT_SWITCHBOARD_PORT;\n\t\treturn;\n\t}\n\treturn typeof port === \"number\" && Number.isInteger(port) && port > 0 ? port : void 0;\n}\n/** Members binding one port: under `ph run` the later one moves or fails. */\nfunction sharedPortWarnings(file, prepared) {\n\tconst owners = /* @__PURE__ */ new Map();\n\tconst warnings = [];\n\tfor (const m of prepared) {\n\t\tconst port = boundPortOf(m);\n\t\tif (port === void 0) continue;\n\t\tconst other = owners.get(port);\n\t\tif (!other) {\n\t\t\towners.set(port, m);\n\t\t\tcontinue;\n\t\t}\n\t\tconst connects = m.specifier === \"@powerhousedao/ph-cli/runners/connect\" && other.specifier === \"@powerhousedao/ph-cli/runners/connect\";\n\t\twarnings.push({\n\t\t\tstage: \"declared\",\n\t\t\tfile,\n\t\t\tpath: `children.${m.key}.runner.port`,\n\t\t\tmessage: connects ? `${other.key} and ${m.key} both use port ${port}. One will move to the next free port and lose its browser data.` : `${other.key} and ${m.key} both use port ${port}. One will move to the next free port or fail to start.`\n\t\t});\n\t}\n\treturn warnings;\n}\nfunction issuer(result, file) {\n\treturn (stage, found, error) => {\n\t\tif (typeof found !== \"string\") {\n\t\t\tconst { path, message, hint } = found;\n\t\t\tresult.issues.push({\n\t\t\t\tstage,\n\t\t\t\tfile,\n\t\t\t\tpath,\n\t\t\t\tmessage,\n\t\t\t\t...hint ? { hint } : {}\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst [message, hint] = (error instanceof Error ? error.message : String(error)).split(\"\\n Hint: \");\n\t\tresult.issues.push({\n\t\t\tstage,\n\t\t\tfile,\n\t\t\tpath: found,\n\t\t\tmessage,\n\t\t\t...hint ? { hint } : {}\n\t\t});\n\t};\n}\n//#endregion\n//#region src/host-export-schema.ts\nfunction isRecord$1(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction childFolders$1(host) {\n\tif (!isRecord$1(host) || !isRecord$1(host.children)) return [];\n\treturn Object.entries(host.children).flatMap(([key, child]) => isRecord$1(child) && typeof child.host === \"string\" ? [[key, child.host]] : []);\n}\nconst declaredHostSchema = z.custom().superRefine((host, ctx) => {\n\tconst result = (isRecord$1(host) && \"children\" in host ? declaredHostSchemas.compoundHostSchema : declaredHostSchemas.reactorHostSchema).safeParse(host);\n\tif (result.success) return;\n\tfor (const issue of result.error.issues) ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: issue.message,\n\t\tpath: issue.path\n\t});\n});\n/** `ph host export`: a declared host plus its members, keyed by folder. */\nconst hostExportSchema = z.strictObject({\n\tformat: z.literal(\"ph-host-export\"),\n\tversion: z.literal(1),\n\tproject: z.strictObject({\n\t\tname: z.string().min(1),\n\t\troot: z.string().min(1)\n\t}),\n\tname: z.string().min(1),\n\thost: declaredHostSchema,\n\tmembers: z.record(z.string(), declaredHostSchema)\n}).superRefine((value, ctx) => {\n\tconst reached = /* @__PURE__ */ new Set();\n\tconst pending = [[[\"host\"], value.host]];\n\tfor (let next = pending.shift(); next; next = pending.shift()) {\n\t\tconst [at, host] = next;\n\t\tfor (const [key, folder] of childFolders$1(host)) {\n\t\t\tif (!(folder in value.members)) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tpath: [\n\t\t\t\t\t\t...at,\n\t\t\t\t\t\t\"children\",\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\"host\"\n\t\t\t\t\t],\n\t\t\t\t\tmessage: `Member folder \"${folder}\" is missing from members.`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (reached.has(folder)) continue;\n\t\t\treached.add(folder);\n\t\t\tpending.push([[\"members\", folder], value.members[folder]]);\n\t\t}\n\t}\n\tfor (const folder of Object.keys(value.members)) {\n\t\tif (reached.has(folder)) continue;\n\t\tctx.addIssue({\n\t\t\tcode: \"custom\",\n\t\t\tpath: [\"members\", folder],\n\t\t\tmessage: `Member \"${folder}\" is not reached from the host's children.`\n\t\t});\n\t}\n});\n//#endregion\n//#region src/host-export.ts\nfunction checkHint(name) {\n\treturn `Run \\`ph host check ${name}\\`.`;\n}\nfunction childFolders(host, name) {\n\tif (!(\"children\" in host)) return [];\n\tconst parsed = declaredHostSchemas.childrenSchema.safeParse(host.children);\n\tif (!parsed.success) throw new HostLoadError(`hosts/${name}/host.js: invalid \\`children\\`:\\n${z.prettifyError(parsed.error)}`, checkHint(name));\n\treturn Object.values(parsed.data).map((child) => child.host);\n}\n/** A host as declared and every member it reaches, raw `loadHost` bodies. */\nasync function exportHost(projectRoot, name) {\n\tconst root = path.resolve(projectRoot);\n\tconst { host } = await loadHost(root, name);\n\tconst members = {};\n\tconst visit = async (folders) => {\n\t\tfor (const folder of folders) {\n\t\t\tif (folder in members) continue;\n\t\t\tconst member = (await loadHost(root, folder)).host;\n\t\t\tmembers[folder] = member;\n\t\t\tawait visit(childFolders(member, folder));\n\t\t}\n\t};\n\tawait visit(childFolders(host, name));\n\tconst envelope = {\n\t\tformat: \"ph-host-export\",\n\t\tversion: 1,\n\t\tproject: {\n\t\t\tname: readProjectName(root),\n\t\t\troot\n\t\t},\n\t\tname,\n\t\thost,\n\t\tmembers\n\t};\n\tconst parsed = hostExportSchema.safeParse(JSON.parse(JSON.stringify(envelope)));\n\tif (!parsed.success) throw new HostLoadError(`hosts/${name}/host.js: the export is not a valid host export:\\n${z.prettifyError(parsed.error)}`, checkHint(name));\n\treturn envelope;\n}\n//#endregion\n//#region src/drives.ts\nconst sha256Hex = (input) => crypto.createHash(\"sha256\").update(input).digest(\"hex\");\nfunction projectDriveId(projectRoot, slug) {\n\treturn projectDriveIdWith(sha256Hex, projectRoot, slug);\n}\nfunction resolveDriveDeclaration(projectRoot, decl) {\n\tconst id = decl.projectHash ? projectDriveId(projectRoot, decl.slug) : decl.id;\n\tconst slug = decl.projectHash === true ? id : decl.slug;\n\tif (decl.remote) return {\n\t\tkind: \"remote\",\n\t\tid,\n\t\tslug,\n\t\tname: decl.name ?? decl.slug,\n\t\tremoteUrl: decl.remote.url,\n\t\tsharingType: decl.sharingType ?? \"public\",\n\t\tavailableOffline: decl.availableOffline ?? true\n\t};\n\treturn {\n\t\tkind: \"local\",\n\t\tid,\n\t\tslug,\n\t\tdocumentType: decl.documentType,\n\t\tname: decl.name ?? decl.slug,\n\t\ticon: resolveImageRef(projectRoot, decl.icon, {\n\t\t\tmaxBytes: DRIVE_ICON_MAX_BYTES,\n\t\t\twarn: (m) => console.warn(m)\n\t\t}),\n\t\tpreferredEditor: decl.preferredEditor,\n\t\tsharingType: decl.sharingType ?? \"public\",\n\t\tavailableOffline: decl.availableOffline ?? true\n\t};\n}\n/** Idempotent, slug-keyed: an existing slug is left untouched (never\n* recreated, never mutated — preserveStrategy refinements live here later). */\nasync function seedDrives(client, drives) {\n\tconst result = {\n\t\tcreated: [],\n\t\texisting: [],\n\t\tattached: []\n\t};\n\tfor (const drive of drives) {\n\t\tif (drive.kind === \"remote\") {\n\t\t\tawait client.attachRemoteDrive(drive.remoteUrl);\n\t\t\tresult.attached.push(drive.slug);\n\t\t\tcontinue;\n\t\t}\n\t\tif (await client.findDriveBySlug(drive.slug) !== void 0) {\n\t\t\tresult.existing.push(drive.slug);\n\t\t\tcontinue;\n\t\t}\n\t\tawait client.createDrive(drive);\n\t\tresult.created.push(drive.slug);\n\t}\n\treturn result;\n}\n/** Merge host-declared drives with plugin contributions, slug-keyed — the\n* host file wins on conflicts (it is the most explicit source). */\nfunction mergeDrivePlan(projectRoot, hostDeclared, contributed) {\n\tconst plan = /* @__PURE__ */ new Map();\n\tfor (const { declaration, source } of contributed) {\n\t\tconst drive = resolveDriveDeclaration(projectRoot, declaration);\n\t\tplan.set(drive.slug, {\n\t\t\tdrive,\n\t\t\tsource\n\t\t});\n\t}\n\tfor (const declaration of hostDeclared) {\n\t\tconst drive = resolveDriveDeclaration(projectRoot, declaration);\n\t\tplan.set(drive.slug, {\n\t\t\tdrive,\n\t\t\tsource: \"host\"\n\t\t});\n\t}\n\treturn [...plan.values()];\n}\nfunction explainDrivePlan(plan) {\n\tif (plan.length === 0) return \"(no drives declared)\";\n\treturn [\"drives:\", ...plan.map(({ drive, source }) => {\n\t\tconst kind = drive.kind === \"remote\" ? `remote ${drive.remoteUrl}` : \"local\";\n\t\tconst editor = drive.preferredEditor ? ` editor=${drive.preferredEditor}` : \"\";\n\t\tconst id = drive.id ?? \"generated\";\n\t\treturn ` ${drive.slug} (${kind}, id=${id}${editor}) [${source}]`;\n\t})].join(\"\\n\");\n}\n//#endregion\n//#region src/backend-projection.ts\nfunction projectStorage(name, storage) {\n\tswitch (storage.kind) {\n\t\tcase \"idb\": return { kind: \"idb\" };\n\t\tcase \"memory\": return { kind: \"memory\" };\n\t\tcase \"path\":\n\t\t\tif (!storage.dataDir) throw new Error(`Backend \"${name}\": storage kind \"path\" requires dataDir.`);\n\t\t\treturn {\n\t\t\t\tkind: \"path\",\n\t\t\t\tdataDir: storage.dataDir\n\t\t\t};\n\t\tcase \"postgres\": throw new Error(`Backend \"${name}\": storage kind \"postgres\" is server-side only — a provisioned (in-process/worker) reactor cannot use it. Point a \"remote\" backend at the switchboard that owns that database instead.`);\n\t}\n}\n/** One backend → one descriptor. The protocol's featureFlags ride every\n* descriptor (they are fleet consensus, not per-backend). A remote backend\n* must carry remote.url — provision() requires it. */\nfunction backendToDescriptor(name, backend, protocol) {\n\tconst descriptor = {\n\t\tkind: backend.kind,\n\t\tname\n\t};\n\tif (descriptor.kind === \"remote\") {\n\t\tconst url = backend.remote?.url;\n\t\tif (!url) throw new Error(`Backend \"${name}\" is kind \"remote\" but has no remote.url — a remote descriptor attaches to an already-running reactor by URL.`);\n\t\tdescriptor.remote = { url };\n\t\treturn descriptor;\n\t}\n\tif (backend.storage) descriptor.storage = projectStorage(name, backend.storage);\n\tif (backend.packages) descriptor.packages = backend.packages;\n\tif (protocol?.featureFlags) descriptor.featureFlags = protocol.featureFlags;\n\treturn descriptor;\n}\n/** All named backends, in placement-primary-first order (the order a\n* createReactorClients step would provision them). */\nfunction backendsToDescriptors(reactor) {\n\tconst backends = reactor?.backends;\n\tif (!backends) return [];\n\tconst names = Object.keys(backends);\n\tconst primary = reactor.placement?.primary;\n\treturn (primary && names.includes(primary) ? [primary, ...names.filter((n) => n !== primary)] : names).map((name) => backendToDescriptor(name, backends[name], reactor.protocol));\n}\nconst LOCAL_KINDS = /* @__PURE__ */ new Set([\"in-process\", \"worker\"]);\n/**\n* Structural multi-reactor (phase 4): true when the block names BOTH a local\n* backend (in-process/worker — the tab's own reactor) and a remote one. This\n* is the shape Connect's routing client serves; a lone remote backend is an\n* attach-only host (assistant/agent shape), not a routed tab.\n*/\nfunction isStructuralMultiReactor(reactor) {\n\tconst backends = reactor?.backends;\n\tif (!backends) return false;\n\tconst kinds = Object.values(backends).map((b) => b.kind);\n\treturn kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === \"remote\");\n}\n/** The remote backends' drive addresses, placement order. */\nfunction remoteBackendUrls(reactor) {\n\treturn backendsToDescriptors(reactor).filter((d) => d.kind === \"remote\").map((d) => d.remote?.url).filter((u) => typeof u === \"string\");\n}\n/**\n* The remote backends by host key, placement order, each with the\n* connection settings it sets. A url that is not a string yet (an output\n* token, unresolved when a host builds) is skipped, as in remoteBackendUrls.\n*/\nfunction remoteBackends(reactor) {\n\treturn backendsToDescriptors(reactor).flatMap((d) => {\n\t\tconst remote = reactor?.backends?.[d.name]?.remote;\n\t\tif (d.kind !== \"remote\" || typeof d.remote?.url !== \"string\" || !remote) return [];\n\t\tconst { requestTimeoutMs, breaker, realtime } = remote;\n\t\treturn [{\n\t\t\tname: d.name,\n\t\t\turl: d.remote.url,\n\t\t\t...requestTimeoutMs !== void 0 ? { requestTimeoutMs } : {},\n\t\t\t...breaker !== void 0 ? { breaker } : {},\n\t\t\t...realtime !== void 0 ? { realtime } : {}\n\t\t}];\n\t});\n}\n//#endregion\n//#region src/reactor-config.ts\n/**\n* The shared `reactor` host-config block and its projections onto the\n* Switchboard config / Connect runtime config. Phase 2 of uniform-runners: makes\n* the reactor block live through the bridge runners, BEFORE track R replaces\n* the projection with reactor-monitor's provision(). The headline is\n* single-sourced `reactor.protocol` — both projections read the same block, so\n* client and server cannot diverge, and a contradicting pre-set env fails boot.\n*/\n/** A switchboard host's own store. Prefers placement.primary, else\n* \"main\"/\"local\", else the first. Connect refuses placement.primary: its\n* reactor is {@link browserBackend}. */\nfunction primaryBackend(reactor) {\n\tconst backends = reactor?.backends;\n\tif (!backends) return void 0;\n\tconst names = Object.keys(backends);\n\tif (names.length === 0) return void 0;\n\treturn backends[reactor.placement?.primary ?? (names.includes(\"main\") ? \"main\" : names.includes(\"local\") ? \"local\" : names[0])];\n}\nconst FLAG_ENV = {\n\tdocumentDecisions: \"REACTOR_DOCUMENT_DECISIONS\",\n\tauthEnforcement: \"REACTOR_AUTH_ENFORCEMENT\",\n\tauthGroups: \"REACTOR_AUTH_GROUPS\",\n\tauthConditions: \"REACTOR_AUTH_CONDITIONS\",\n\tundoV3: \"REACTOR_UNDO_V3\"\n};\n/** The env vars a protocol block maps onto, with their string values. Only\n* keys the block actually sets appear. */\nfunction protocolEnv(protocol) {\n\tconst env = {};\n\tif (!protocol) return env;\n\tfor (const [key, varName] of Object.entries(FLAG_ENV)) {\n\t\tconst value = protocol.featureFlags?.[key];\n\t\tif (value !== void 0) env[varName] = value ? \"true\" : \"false\";\n\t}\n\tif (protocol.createSignaturePolicy !== void 0) env.CREATE_SIGNATURE_POLICY = protocol.createSignaturePolicy;\n\tif (protocol.unsupportedStoredDocuments !== void 0) env.REACTOR_UNSUPPORTED_STORED_DOCUMENTS = protocol.unsupportedStoredDocuments;\n\treturn env;\n}\n/** The reactor block as a switchboard config layer. The reactor store and the\n* read model are separate fields: `readModel.url` never moves the reactor. */\nfunction reactorBlockToSwitchboardConfig(reactor) {\n\tconst layer = {};\n\tconst backend = primaryBackend(reactor);\n\tconst storage = backend?.storage;\n\tconst reactorUrl = storage?.kind === \"postgres\" ? storage.url : storage?.dataDir;\n\tconst readModelUrl = backend?.readModel?.url;\n\tif (reactorUrl || readModelUrl) layer.storage = {\n\t\t...reactorUrl ? { reactor: { url: reactorUrl } } : {},\n\t\t...readModelUrl ? { readModel: { url: readModelUrl } } : {}\n\t};\n\tif (reactor?.protocol) layer.protocol = reactor.protocol;\n\tif (backend?.packages?.dynamic) layer.packages = { dynamic: true };\n\treturn layer;\n}\nconst LOCAL_BACKEND_KINDS = /* @__PURE__ */ new Set([\"in-process\", \"worker\"]);\n/** Connect's browser reactor: its first in-process or worker backend. */\nfunction browserBackend(reactor) {\n\tconst entry = Object.entries(reactor?.backends ?? {}).find(([, backend]) => LOCAL_BACKEND_KINDS.has(backend.kind));\n\treturn entry ? {\n\t\t...entry[1],\n\t\tname: entry[0]\n\t} : void 0;\n}\n/**\n* Which reactor client the backend topology asks for:\n* - local (in-process/worker) AND remote backends -> `router`\n* - remote backend(s) only -> `remote`\n* - a worker backend -> `worker`\n* - anything else local -> `in-process`\n* `undefined` when no backends are declared: Connect then runs `in-process`.\n*/\nfunction reactorClientMode(reactor) {\n\tconst backends = reactor?.backends;\n\tif (!backends) return void 0;\n\tconst kinds = Object.values(backends).map((b) => b.kind);\n\tif (kinds.length === 0) return void 0;\n\tconst hasLocal = kinds.some((k) => LOCAL_BACKEND_KINDS.has(k));\n\tconst hasRemote = kinds.some((k) => k === \"remote\");\n\tif (hasLocal && hasRemote) return \"router\";\n\tif (hasRemote) return \"remote\";\n\treturn browserBackend(reactor)?.kind === \"worker\" ? \"worker\" : \"in-process\";\n}\n/** Served only when `newDrives` names a served remote backend: a local one\n* is the default, and Connect refuses one it has no address for. */\nfunction connectRouterSettings(reactor, served) {\n\tconst newDrives = reactor?.placement?.newDrives;\n\tconst { probeTimeoutMs, provisionalRouteMs } = reactor?.router ?? {};\n\tconst router = {\n\t\t...newDrives !== void 0 && served.some((remote) => remote.name === newDrives) ? { newDrives } : {},\n\t\t...probeTimeoutMs !== void 0 ? { probeTimeoutMs } : {},\n\t\t...provisionalRouteMs !== void 0 ? { provisionalRouteMs } : {}\n\t};\n\treturn Object.keys(router).length > 0 ? router : void 0;\n}\nfunction connectStorage(backend) {\n\tconst kind = backend?.storage?.kind;\n\treturn kind === \"idb\" || kind === \"memory\" ? kind : void 0;\n}\n/** Why the browser reactor's declared store can't be served: Connect keeps\n* IndexedDB instead of a folder or Postgres. */\nfunction unservedConnectStorage(reactor) {\n\tconst browser = browserBackend(reactor);\n\tconst kind = browser?.storage?.kind;\n\tif (!browser || !kind || connectStorage(browser)) return void 0;\n\treturn `reactor.backends.${browser.name}.storage \"${kind}\": Connect's browser reactor can't use it and keeps IndexedDB instead.`;\n}\n/** Project the reactor block onto the Connect runtime config: protocol →\n* connect.reactor (same shape), backend topology → instance.reactorWorker\n* (the browser reactor's kind), instance.reactorClient, instance.storage\n* (the browser reactor's store), and with a\n* switchboard instance.remoteBackends and instance.router. */\nfunction projectReactorToConnect(reactor) {\n\tconst connect = {};\n\tif (reactor?.protocol) connect.reactor = reactor.protocol;\n\tconst mode = reactorClientMode(reactor);\n\tif (mode !== void 0) {\n\t\tconst routed = mode === \"router\" || mode === \"remote\";\n\t\tconst served = routed ? remoteBackends(reactor) : [];\n\t\tconst router = routed ? connectRouterSettings(reactor, served) : void 0;\n\t\tconst browser = browserBackend(reactor);\n\t\tconst storage = connectStorage(browser);\n\t\tconnect.instance = {\n\t\t\treactorWorker: browser?.kind === \"worker\",\n\t\t\treactorClient: mode,\n\t\t\t...storage ? { storage } : {},\n\t\t\t...routed ? { remoteBackends: served } : {},\n\t\t\t...router ? { router } : {}\n\t\t};\n\t}\n\treturn { connect };\n}\n/** Whether an env value means what the host's value does. The switchboard\n* reads REACTOR_UNDO_V3 as on unless it is exactly \"false\". */\nfunction protocolEnvAgrees(varName, envValue, hostValue) {\n\tif (varName === FLAG_ENV.undoV3) return envValue !== \"false\" === (hostValue === \"true\");\n\treturn envValue === hostValue;\n}\n/** Each pre-set env var that CONTRADICTS the host's protocol block, as a\n* message naming the var, the host value and the env value. An env var that\n* merely matches, or is unset, is fine. */\nfunction protocolConflicts(protocol, env, hostFile = \"the host file\") {\n\tif (!protocol) return [];\n\treturn Object.entries(protocolEnv(protocol)).flatMap(([varName, hostValue]) => {\n\t\tconst envValue = env[varName];\n\t\tif (envValue === void 0 || protocolEnvAgrees(varName, envValue, hostValue)) return [];\n\t\treturn [`reactor.protocol conflict: ${varName} is \"${envValue}\" in the environment but \"${hostValue}\" in ${hostFile}. These are fleet-consensus settings — a mismatch would diverge replay. Remove the env override or align the host.`];\n\t});\n}\n/**\n* The enforcement teeth of single-sourcing: if a pre-set env var CONTRADICTS\n* the host's protocol block, fail loudly naming the var, the host value, and\n* the env value (phase-2 transition keeps an operator's explicit env as an\n* escape hatch unless it disagrees with the protocol — see the WBS\n* precedence note).\n*/\nfunction assertProtocolConsistency(protocol, env, hostFile = \"the host file\") {\n\tconst conflict = protocolConflicts(protocol, env, hostFile).at(0);\n\tif (conflict) throw new Error(conflict);\n}\n//#endregion\n//#region src/connect-projection.ts\n/**\n* Instance-fact projection for compound hosts: the drives a compound's\n* reactor member created, projected into the Connect member's runtime-config\n* override. Pure functions, moved from ph-cli's vetra service so the generic\n* compound and the classic path share one implementation.\n*/\nfunction isLocalDrive(drive) {\n\treturn \"local\" in drive;\n}\nconst driveKey = (drive) => isLocalDrive(drive) ? `local:${drive.id}` : drive.url;\n/**\n* Concatenate groups of `connect.drives.defaultDrives` in the order given,\n* de-duplicating by drive identity (URL for remote entries, id for local\n* ones). The first occurrence of a drive wins, so earlier groups keep their\n* position and metadata — e.g. the Vetra drive `ph dev` starts stays first\n* even when the project's `powerhouse.config.json` lists the same drive.\n*/\nfunction mergeDefaultDrives(...groups) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst out = [];\n\tfor (const group of groups) for (const drive of group) {\n\t\tconst key = driveKey(drive);\n\t\tif (seen.has(key)) continue;\n\t\tseen.add(key);\n\t\tout.push(drive);\n\t}\n\treturn out;\n}\n/**\n* Rebase a local drive URL onto a public base: keeps the /d/<slug> path,\n* swaps the loopback origin for the public base. Browser clients behind a\n* reverse proxy can't reach http://localhost:<port>. Non-loopback URLs\n* (e.g. a remote drive) are already public and pass through unchanged, as do\n* unparseable ones.\n*/\nfunction rebaseDriveUrl(driveUrl, publicBase) {\n\tlet url;\n\ttry {\n\t\turl = new URL(driveUrl);\n\t} catch {\n\t\treturn driveUrl;\n\t}\n\tif (![\n\t\t\"localhost\",\n\t\t\"127.0.0.1\",\n\t\t\"[::1]\"\n\t].includes(url.hostname)) return driveUrl;\n\treturn `${publicBase.replace(/\\/+$/, \"\")}${url.pathname}`;\n}\n/**\n* The compound's drives projection: created drives first (rebased onto the\n* public base when given), then the project's configured drives, de-duplicated\n* — and `preserve-all`, because compound-injected drive lists change per\n* launch context and must never detach drives the user added by hand.\n*/\nfunction projectDrivesIntoConnect(input) {\n\treturn { drives: {\n\t\tdefaultDrives: mergeDefaultDrives(input.createdDriveUrls.filter((url) => typeof url === \"string\" && url.length > 0).map((url) => ({\n\t\t\turl: input.publicBase ? rebaseDriveUrl(url, input.publicBase) : url,\n\t\t\tname: null,\n\t\t\ticon: null\n\t\t})), input.configuredDefaultDrives ?? []),\n\t\tpreserveStrategy: \"preserve-all\"\n\t} };\n}\n/** A served slug names a declared one as is, or hashed (`<slug>-<8 hex>`). */\nfunction servesSlug(declared, served) {\n\treturn served === declared || served.startsWith(`${declared}-`) && /^[0-9a-f]{8}$/.test(served.slice(declared.length + 1));\n}\n/** Annotates remote default drives with their backend (`sync: false` when placed on it); other remote placements become collections. */\nfunction placeConnectDrives(reactor, defaultDrives) {\n\tconst remotes = remoteBackends(reactor).flatMap(({ name, url }) => {\n\t\tconst at = switchboardOfDrive$1(url);\n\t\treturn at ? [{\n\t\t\tname,\n\t\t\tbase: at.base\n\t\t}] : [];\n\t});\n\tif (remotes.length === 0) return { defaultDrives: [...defaultDrives] };\n\tconst placement = Object.entries(reactor?.placement?.drives ?? {});\n\tconst matched = /* @__PURE__ */ new Set();\n\tconst placed = defaultDrives.map((drive) => {\n\t\tif (!(\"url\" in drive)) return drive;\n\t\tconst at = switchboardOfDrive$1(drive.url);\n\t\tconst backend = remotes.find((remote) => remote.base === at?.base)?.name;\n\t\tif (!at || !backend) return drive;\n\t\tconst entry = placement.find(([slug]) => servesSlug(slug, at.slug));\n\t\tif (entry) matched.add(entry[0]);\n\t\treturn entry?.[1] === backend ? {\n\t\t\t...drive,\n\t\t\tbackend,\n\t\t\tsync: false\n\t\t} : {\n\t\t\t...drive,\n\t\t\tbackend\n\t\t};\n\t});\n\tconst names = new Set(remotes.map((remote) => remote.name));\n\tconst collections = Object.fromEntries(placement.filter(([slug, backend]) => !matched.has(slug) && names.has(backend)).map(([slug, backend]) => [slug, {\n\t\tbackend,\n\t\tsync: false\n\t}]));\n\treturn Object.keys(collections).length > 0 ? {\n\t\tdefaultDrives: placed,\n\t\tcollections\n\t} : { defaultDrives: placed };\n}\n//#endregion\n//#region src/expect-host.ts\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction runnerOf(host) {\n\treturn isRecord(host.runner) ? host.runner : {};\n}\nfunction defaultVerbOf(host) {\n\tconst verb = runnerOf(host).defaultVerb;\n\treturn typeof verb === \"string\" ? verb : void 0;\n}\n/** At compound verb \"run\" each member runs its own defaultVerb; any other\n* compound verb is forwarded uniformly (compound.ts `memberVerbOf`). */\nfunction memberVerb(compoundVerb, member) {\n\treturn compoundVerb === \"run\" ? defaultVerbOf(member) ?? \"run\" : compoundVerb;\n}\n/** Backend names, placement-primary first (`backendsToDescriptors` order). */\nfunction orderedBackends(reactor) {\n\tconst backends = Object.entries(reactor.backends ?? {});\n\tconst primary = reactor.placement?.primary;\n\treturn [...backends.filter(([name]) => name === primary), ...backends.filter(([name]) => name !== primary)];\n}\nfunction expectBackend(name, backend, reactor) {\n\tconst out = {\n\t\tname,\n\t\tkind: backend.kind\n\t};\n\tif (backend.storage) out.storage = backend.storage.kind;\n\tif (typeof backend.storage?.dataDir === \"string\") out.dataDir = backend.storage.dataDir;\n\ttry {\n\t\tbackendToDescriptor(name, backend, reactor.protocol);\n\t} catch (error) {\n\t\tout.provisionError = error instanceof Error ? error.message : String(error);\n\t}\n\treturn out;\n}\nfunction expectDrive(declaration, source) {\n\tif (typeof declaration.slug !== \"string\") return void 0;\n\tconst remote = isRecord(declaration.remote) ? declaration.remote : void 0;\n\tconst drive = {\n\t\tslug: declaration.slug,\n\t\tkind: remote ? \"remote\" : \"local\",\n\t\tsource\n\t};\n\tif (remote && typeof remote.url === \"string\") drive.url = remote.url;\n\tif (typeof declaration.id === \"string\") drive.id = declaration.id;\n\tconst projectHash = declaration.projectHash;\n\tif (typeof projectHash === \"boolean\" || projectHash === \"id\") drive.projectHash = projectHash;\n\treturn drive;\n}\n/** The key `mergeDrivePlan` merges on: the SERVED slug, which for\n* `projectHash: true` is the hashed id (never equal to a plain slug). */\nfunction servedSlugKey(drive) {\n\treturn drive.projectHash === true ? `${drive.slug}\\0hashed` : drive.slug;\n}\n/** Contributions first, then host declarations; keyed by served slug, the\n* host wins (and keeps the contribution's position), like `mergeDrivePlan`. */\nfunction drivePlan(reactor, contributed) {\n\tconst plan = /* @__PURE__ */ new Map();\n\tfor (const { declaration, source } of contributed) {\n\t\tconst drive = expectDrive(declaration, source);\n\t\tif (drive) plan.set(servedSlugKey(drive), drive);\n\t}\n\tfor (const declaration of reactor?.drives ?? []) {\n\t\tconst drive = expectDrive(declaration, \"host\");\n\t\tif (drive) plan.set(servedSlugKey(drive), drive);\n\t}\n\treturn [...plan.values()];\n}\n/** Token facts of the host's OWN fields (a compound's `children` are its\n* members' own). */\nfunction tokenFacts(declared, kind) {\n\tconst own = kind === \"compound\" ? Object.fromEntries(Object.entries(declared).filter(([key]) => key !== \"children\")) : declared;\n\tconst sites = outputSitesOf(own);\n\tconst consumes = sites.map(({ path, ref, outputPath }) => ({\n\t\tat: path,\n\t\thost: ref.host,\n\t\t...ref.member !== void 0 ? { member: ref.member } : {},\n\t\tpath: outputPath\n\t}));\n\treturn {\n\t\tdependsOn: [...new Set(sites.map(({ ref }) => refKey(ref)))].sort(),\n\t\tconsumes,\n\t\tenv: [...new Set(envSitesOf(own).map(({ name }) => name))].sort()\n\t};\n}\nfunction expectOwn(input, verb) {\n\tconst resolved = input.resolved ?? input.declared;\n\tconst expectation = {\n\t\tname: typeof resolved.name === \"string\" ? resolved.name : \"\",\n\t\tkind: input.kind,\n\t\tverb,\n\t\t...tokenFacts(input.declared, input.kind)\n\t};\n\tif (input.kind !== \"reactor\") return expectation;\n\tconst reactor = isRecord(resolved.reactor) ? resolved.reactor : void 0;\n\tconst mode = reactorClientMode(reactor);\n\tif (mode !== void 0) expectation.clientMode = mode;\n\texpectation.multiReactor = isStructuralMultiReactor(reactor);\n\tconst backends = reactor ? orderedBackends(reactor) : [];\n\tif (reactor && backends.length > 0) {\n\t\texpectation.backends = backends.map(([name, backend]) => expectBackend(name, backend, reactor));\n\t\texpectation.remotes = backends.flatMap(([, backend]) => backend.kind === \"remote\" && typeof backend.remote?.url === \"string\" ? [backend.remote.url] : []);\n\t}\n\texpectation.drives = drivePlan(reactor, input.contributed ?? []);\n\treturn expectation;\n}\n/**\n* The expectation for one host. A reactor host's comes from its resolved\n* reactor block and contributed drives; a compound's lists its members in\n* plan order, each with the verb it runs at under the compound's own verb\n* and the members it starts after.\n*/\nfunction expectHost(input) {\n\tconst verb = defaultVerbOf(input.declared) ?? \"run\";\n\tconst expectation = expectOwn(input, verb);\n\tif (input.kind !== \"compound\" || !input.members) return expectation;\n\tconst order = input.plan?.order ?? input.members.map((m) => m.key);\n\tconst edges = input.plan?.edges ?? [];\n\tconst byKey = new Map(input.members.map((m) => [m.key, m]));\n\tconst members = {};\n\tfor (const key of order) {\n\t\tconst member = byKey.get(key);\n\t\tif (!member) continue;\n\t\tmembers[key] = {\n\t\t\thost: member.host,\n\t\t\t...expectOwn(member, memberVerb(verb, member.declared)),\n\t\t\tafter: [...new Set(edges.filter((e) => e.consumer === key).map((e) => e.producer))].sort()\n\t\t};\n\t}\n\texpectation.startOrder = order.filter((key) => byKey.has(key));\n\texpectation.members = members;\n\treturn expectation;\n}\n//#endregion\nexport { BUILTIN_ENV_NAMES, COMPOUND_MEMBER_ENV, CONNECT_PLUGIN_OWNED_SLICES, CONNECT_PRIMARY_MESSAGE, CONNECT_RUNNER, HOST_NAME_MAX_LENGTH, HOST_NAME_MESSAGE, HOST_NAME_PATTERN, HOST_REF_MESSAGE, HOST_REF_PATTERN, HostLoadError, ONE_SHOT_VERBS, ORIGIN_PLACEHOLDER, OUTPUTS_FILE, OUTPUT_DATA_DIRS_ENV, PACKAGE_NAME_PATTERN, PlanError, PluginError, RunnerError, SPAWN_STOPPING_NOTE, STOP_ON_STDIN_ENV, STOP_RUN_TIMEOUT_MS, STOP_STREAM_LIMIT_MS, STORE_VERBS, SWITCHBOARD_PROXY_PATHS, SpawnHostError, TOKEN_ESCAPE_KEY, TOKEN_KEYS, TokenResolutionError, applyChildWrapper, askToStop, assertProtocolConsistency, backendToDescriptor, backendsToDescriptors, browserBackend, buildDriveDeclarationSchema, checkHost, checkOutputPaths, checkRunnerArgv, checkTokenSites, childWrapperSchema, childrenSchema, clearRunRecord, collectTokenSites, compoundHostSchema, compoundOutputSource, compoundWiringSchema, computeOutputsHash, concatTokenSchema, connectReactorIssues, declaredGenericCompoundHostSchema, declaredHostSchemas, defaultConnectComposition, defaultUserDataDir, defineHostSchemas, describeHostOutputs, describeMapElements, describeToken, driveAddressMessage, driveDeclarationSchema, drivesSchema, emitHostJsonSchema, emittedHostSchemas, emptyMaps, entryActiveForVerb, envSitesOf, envTokenSchema, envTokenable, expectHost, explainDrivePlan, exportHost, findDeadConnectConfig, findHostPackage, findNonStaticValue, findRemovedForms, findToken, forbidRef, formatHostRef, formatPath, genericCompoundHostSchema, getVerb, holdStopRequests, hostExportSchema, hostFileLabel, hostNameSchema, hostSchemaIssues, hostTypeSatisfies, installStopChannel, isBuiltinEnvName, isHtmlNavigation, isOriginPlaceholderUrl, isPidAlive, isRunnerArgsSchema, isSchemaLike, isStructuralMultiReactor, isSwitchboardProxyPath, isToken, itemTokenSchema, keyTokenSchema, killTree, kindShapeIssues, knownVerbIssues, lintHostImportGraph, lintHostImports, lintOutputsFile, listRunRecords, listVerbs, listenForStop, loadHost, loadHostFresh, loadProducers, locateHost, makeHostSchemas, mapTokenSchema, memberCycle, memberForRef, memberProcessOf, memberProcessSchema, mergeContributions, mergeDefaultDrives, mergeDrivePlan, moduleRootOf, normalizePluginEntries, normalizePluginEntry, originOrUrlSchema, outputRefsOf, outputSitesOf, outputTokenSchema, packageBuildRefusal, parseHostRef, placeConnectDrives, placementKeyIssues, planCompound, planForeground, pluginEntryObjectSchema, pluginEntrySchema, primaryBackend, probeHostsFolder, probeRun, processResolveEnv, producerOutputsSchemas, profileSchema, projectDriveId, projectDriveIdWith, projectDrivesIntoConnect, projectReactorToConnect, protocolConflicts, protocolEnv, protocolEnvAgrees, reactorBackendKindSchema, reactorBackendSchema, reactorBlockToSwitchboardConfig, reactorClientMode, reactorHostSchema, reactorProtocolSchema, reactorSchema, readOutputsFileHash, readProjectName, readRunRecord, rebaseDriveUrl, recordKeyOf, ref, refKey, refineConnectReactor, refineStartOrder, registerHostType, remoteBackendUrls, remoteBackends, renderTokens, requestStop, resolveDriveDeclaration, resolveHostOutputs, resolveHostPlugins, resolveOrder, resolveOriginPlaceholders, resolvePackageRoot, resolvePluginContributions, resolveRunnerModule, resolveUserDataPlaceholders, runCompound, runObserveHook, runObserveHookSequential, runProvideHook, runRecordKey, runRecordMemberSchema, runRecordOutputSource, runRecordSchema, runTransformHook, runnerBaseSchema, runnerHandleSchema, runnerKindSchema, runnerOutputsSchema, scanHostImports, schemaAtPath, seedDrives, spawnHost, splitCompoundArgv, splitRunArgv, stopChannelPath, stopRun, stopStreamOf, stripComments, substituteBuiltinEnv, switchboardOfDrive, takeCompoundMember, toOriginPlaceholder, toStartedHandle, tokenKeyOf, tokenSchema, tokenable, unservedConnectStorage, unwrapEscapes, validateDeclaredHost, validateHost, withOriginPlaceholders, withoutHostsMessage, writeRunRecord };\n\n//# sourceMappingURL=index.mjs.map"],"names":["z.custom","z.strictObject","z.literal","z.string","z.record","z.prettifyError"],"mappings":";;;;;;;;;;;;;AAYA,eAAe,UAAU,MAAM,SAAS;CACvC,MAAM,SAAS;EACd,QAAQ,CAAC;EACT,UAAU,CAAC;EACX,UAAU,CAAC;CACZ;CACA,IAAI,OAAO,SAAS,KAAK;CACzB,MAAM,OAAO,QAAQ,QAAQ;CAC7B,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;EACH,MAAM,SAAS,MAAM,SAAS,QAAQ,aAAa,IAAI;EACvD,OAAO,OAAO;EACd,cAAc,OAAO;EACrB,OAAO,cAAc,OAAO,MAAM,WAAW;EAC7C,SAAS,MAAM,oBAAoB,aAAa,QAA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,MAAM,SAAS,KAAK;EAC1B,IAAI,KAAK,IAAI,GAAG,GAAG;EACnB,KAAK,IAAI,GAAG;EACZ,IAAI,KAAK,KAAK;CACf;CACA,OAAO;AACR","debug_id":"d7a0be1b-2030-5dcc-a1b0-cdac076dacbe"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { $ as
|
|
4
|
-
import {
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2de60ffc-44fc-5443-869a-bb41f0f94d0b")}catch(e){}}();
|
|
3
|
+
import { $ as resolvePluginContributions, B as planCompound, E as isToken, G as processResolveEnv, J as readProjectName, K as producerOutputsSchemas, L as outputRefsOf, M as memberProcessOf, O as loadHost, P as moduleRootOf, R as outputSitesOf, S as hostFileLabel, V as planForeground, W as probeRun, Y as renderTokens, Z as resolveHostOutputs, _ as envSitesOf, b as formatPath, ct as validateDeclaredHost, d as compoundOutputSource, et as resolveRunnerModule, h as drivesSchema, i as RunnerError, j as memberForRef, k as loadProducers, lt as validateHost, m as describeToken, nt as runRecordOutputSource, p as declaredHostSchemas, rt as runnerOutputsSchema, s as applyChildWrapper, tt as runRecordKey, u as collectTokenSites, v as findDeadConnectConfig, w as isBuiltinEnvName } from "./compound-BWLJ0KBw-8hKyrfjG.mjs";
|
|
4
|
+
import { a as mergeDrivePlan, n as explainDrivePlan } from "./dist-BFMRL5C0.mjs";
|
|
5
5
|
//#region src/services/run/explain.ts
|
|
6
6
|
const TOPICS = ["drives", "outputs"];
|
|
7
7
|
async function loadView(projectRoot, name) {
|
|
8
8
|
const loaded = await loadHost(projectRoot, name);
|
|
9
|
+
const scope = loaded.package;
|
|
10
|
+
const moduleRoot = moduleRootOf(projectRoot, loaded);
|
|
9
11
|
const specifier = loaded.host.runner.module;
|
|
10
|
-
const runner = await resolveRunnerModule(
|
|
11
|
-
const file =
|
|
12
|
+
const runner = await resolveRunnerModule(moduleRoot, specifier);
|
|
13
|
+
const file = hostFileLabel(loaded.name, scope);
|
|
12
14
|
if (runner.kind !== "compound") {
|
|
13
|
-
const producers = await loadProducers(projectRoot, outputRefsOf(loaded.host));
|
|
15
|
+
const producers = await loadProducers(projectRoot, outputRefsOf(loaded.host), scope);
|
|
14
16
|
validateDeclaredHost(runner, specifier, loaded.host, file, { outputsSchemaOf: producerOutputsSchemas(producers) });
|
|
15
17
|
const source = runRecordOutputSource(projectRoot, {
|
|
16
18
|
consumer: name,
|
|
@@ -22,6 +24,8 @@ async function loadView(projectRoot, name) {
|
|
|
22
24
|
runner,
|
|
23
25
|
specifier,
|
|
24
26
|
file,
|
|
27
|
+
moduleRoot,
|
|
28
|
+
...scope ? { packageName: scope.name } : {},
|
|
25
29
|
source
|
|
26
30
|
};
|
|
27
31
|
}
|
|
@@ -30,16 +34,21 @@ async function loadView(projectRoot, name) {
|
|
|
30
34
|
const children = declaredHostSchemas.childrenSchema.parse(loaded.host.children);
|
|
31
35
|
const members = [];
|
|
32
36
|
for (const [key, wrapper] of Object.entries(children)) {
|
|
33
|
-
const
|
|
37
|
+
const member = await loadHost(projectRoot, wrapper.host, { scope });
|
|
38
|
+
const host = applyChildWrapper(member.host, wrapper);
|
|
34
39
|
const memberSpecifier = host.runner.module;
|
|
40
|
+
const memberRoot = moduleRootOf(projectRoot, member);
|
|
41
|
+
const memberFile = hostFileLabel(member.name, member.package);
|
|
35
42
|
members.push({
|
|
36
43
|
key,
|
|
37
44
|
wrapper,
|
|
38
45
|
host,
|
|
39
|
-
runner: await resolveRunnerModule(
|
|
46
|
+
runner: await resolveRunnerModule(memberRoot, memberSpecifier),
|
|
40
47
|
specifier: memberSpecifier,
|
|
41
|
-
file:
|
|
42
|
-
|
|
48
|
+
file: memberFile,
|
|
49
|
+
moduleRoot: memberRoot,
|
|
50
|
+
...member.package ? { packageName: member.package.name } : {},
|
|
51
|
+
configWhere: wrapper.config !== void 0 ? `${file} (children.${key}.config)` : memberFile
|
|
43
52
|
});
|
|
44
53
|
}
|
|
45
54
|
const refs = members.map((m) => ({
|
|
@@ -52,7 +61,7 @@ async function loadView(projectRoot, name) {
|
|
|
52
61
|
const producer = members.find((p) => p.key === target.key);
|
|
53
62
|
return producer ? runnerOutputsSchema(producer.runner, producer.specifier, `member "${producer.key}"`) : { error: `names member "${target.key}", which is not declared.` };
|
|
54
63
|
} });
|
|
55
|
-
const probe = probeRun(projectRoot, loaded.host.name, readProjectName(projectRoot));
|
|
64
|
+
const probe = probeRun(projectRoot, runRecordKey(loaded.host.name, scope?.name), readProjectName(projectRoot));
|
|
56
65
|
const live = /* @__PURE__ */ new Map();
|
|
57
66
|
if (probe.status === "live") for (const [key, member] of Object.entries(probe.record.members ?? {})) live.set(key, member.outputs);
|
|
58
67
|
const source = probe.status === "live" ? compoundOutputSource(refs, live, loaded.host.name) : void 0;
|
|
@@ -61,6 +70,8 @@ async function loadView(projectRoot, name) {
|
|
|
61
70
|
runner,
|
|
62
71
|
specifier,
|
|
63
72
|
file,
|
|
73
|
+
moduleRoot,
|
|
74
|
+
...scope ? { packageName: scope.name } : {},
|
|
64
75
|
members,
|
|
65
76
|
source
|
|
66
77
|
};
|
|
@@ -87,14 +98,21 @@ async function explainHost(options) {
|
|
|
87
98
|
}
|
|
88
99
|
if (view.members) {
|
|
89
100
|
const verb = view.host.runner.defaultVerb ?? "run";
|
|
90
|
-
for (const m of view.members) await explainDrives(
|
|
101
|
+
for (const m of view.members) await explainDrives({
|
|
102
|
+
projectRoot,
|
|
103
|
+
moduleRoot: m.moduleRoot
|
|
104
|
+
}, `${options.host} › ${m.key} (${m.wrapper.host})`, m.host, verb, m.file, m.configWhere, view.source);
|
|
91
105
|
return;
|
|
92
106
|
}
|
|
93
|
-
await explainDrives(
|
|
107
|
+
await explainDrives({
|
|
108
|
+
projectRoot,
|
|
109
|
+
moduleRoot: view.moduleRoot
|
|
110
|
+
}, options.host, view.host, "run", view.file, view.file, view.source);
|
|
94
111
|
}
|
|
95
|
-
async function explainDrives(
|
|
112
|
+
async function explainDrives(roots, label, host, verb, where, configWhere, source) {
|
|
113
|
+
const { projectRoot } = roots;
|
|
96
114
|
const entries = host.runner.plugins ?? [];
|
|
97
|
-
const contributions = entries.length > 0 ? await resolvePluginContributions(
|
|
115
|
+
const contributions = entries.length > 0 ? await resolvePluginContributions(roots.moduleRoot, verb, entries, where) : {
|
|
98
116
|
drives: [],
|
|
99
117
|
unresolved: []
|
|
100
118
|
};
|
|
@@ -161,15 +179,23 @@ function printConsumes(host, indent, producerNote, source) {
|
|
|
161
179
|
}
|
|
162
180
|
const { env: processEnv } = processResolveEnv(process.cwd());
|
|
163
181
|
for (const site of env) {
|
|
164
|
-
const state = site.name
|
|
182
|
+
const state = isBuiltinEnvName(site.name) || processEnv?.[site.name] !== void 0 ? "set" : site.optional ? "unset: the property is omitted" : "UNSET: ph run fails";
|
|
165
183
|
console.log(`${indent}${site.path} ← $env ${site.name}${site.optional ? " (optional)" : ""} [${state}]`);
|
|
166
184
|
}
|
|
167
185
|
}
|
|
186
|
+
/** Where `${package}` points, for a host that names it (as `"${package}"`
|
|
187
|
+
* sugar or `{ $env: "package" }`): a path, never a secret. */
|
|
188
|
+
function printPackageRoot(host, indent, view) {
|
|
189
|
+
if (!(JSON.stringify(host).includes("${package}") || envSitesOf(host).some((site) => site.name === "package"))) return;
|
|
190
|
+
const whose = view.packageName ? `the root of ${view.packageName}, which supplies the host` : "the project root: a project host";
|
|
191
|
+
console.log(`${indent}\${package} = ${view.moduleRoot} (${whose})`);
|
|
192
|
+
}
|
|
168
193
|
function explainOutputs(name, view) {
|
|
169
194
|
if (!view.members) {
|
|
170
195
|
const source = view.source;
|
|
171
196
|
console.log(`[${name}] ${view.specifier}`);
|
|
172
197
|
console.log(` produces: ${outputKeys(view.runner)}`);
|
|
198
|
+
printPackageRoot(view.host, " ", view);
|
|
173
199
|
printConsumes(view.host, " ", (folder, member) => {
|
|
174
200
|
const ref = member === void 0 ? { host: folder } : {
|
|
175
201
|
host: folder,
|
|
@@ -194,18 +220,38 @@ function explainOutputs(name, view) {
|
|
|
194
220
|
path
|
|
195
221
|
}))
|
|
196
222
|
})), startOrder);
|
|
223
|
+
const planned = planForeground(members.map((m) => ({
|
|
224
|
+
key: m.key,
|
|
225
|
+
specifier: m.specifier,
|
|
226
|
+
member: m.wrapper,
|
|
227
|
+
runner: m.runner
|
|
228
|
+
})), plan, startOrder ? { startOrder } : {});
|
|
229
|
+
const broken = planned.issues.at(0);
|
|
230
|
+
if (broken) throw new RunnerError(`hosts/${name}: ${broken.message}`, broken.hint);
|
|
231
|
+
const processes = new Map(members.map((m) => [m.key, memberProcessOf(m.wrapper, {
|
|
232
|
+
foreground: m.key === planned.foreground,
|
|
233
|
+
besideForeground: planned.foreground !== void 0,
|
|
234
|
+
oneShot: false
|
|
235
|
+
})]));
|
|
236
|
+
const showWhere = planned.foreground !== void 0 || [...processes.values()].includes("own");
|
|
237
|
+
const whereOf = (key) => {
|
|
238
|
+
if (!showWhere) return "";
|
|
239
|
+
if (key === planned.foreground) return " [in front: owns the terminal; its end ends the stack]";
|
|
240
|
+
return processes.get(key) === "own" ? " [own process]" : " [in the compound's process]";
|
|
241
|
+
};
|
|
197
242
|
console.log(`[${name}] start order (${plan.source === "tokens" ? "from the output tokens" : "config.startOrder, checked against the tokens"}):`);
|
|
198
|
-
|
|
243
|
+
planned.order.forEach((key, index) => {
|
|
199
244
|
const m = members.find((x) => x.key === key);
|
|
200
245
|
const needs = plan.edges.filter((e) => e.consumer === key).map((e) => e.producer);
|
|
201
|
-
console.log(` ${index + 1}. ${key} (${m?.wrapper.host ?? "?"})${needs.length ? ` after ${needs.join(", ")}` : ""}`);
|
|
246
|
+
console.log(` ${index + 1}. ${key} (${m?.wrapper.host ?? "?"})${needs.length ? ` after ${needs.join(", ")}` : ""}${whereOf(key)}`);
|
|
202
247
|
});
|
|
203
248
|
console.log(" Ctrl-C stops members in reverse order (consumers first).");
|
|
204
|
-
for (const key of
|
|
249
|
+
for (const key of planned.order) {
|
|
205
250
|
const m = members.find((x) => x.key === key);
|
|
206
251
|
if (!m) continue;
|
|
207
252
|
console.log(`[${name} › ${key} (${m.wrapper.host})] ${m.specifier}`);
|
|
208
253
|
console.log(` produces: ${outputKeys(m.runner)}`);
|
|
254
|
+
printPackageRoot(m.host, " ", m);
|
|
209
255
|
printConsumes(m.host, " ", (folder, member) => {
|
|
210
256
|
const target = memberForRef(member === void 0 ? { host: folder } : {
|
|
211
257
|
host: folder,
|
|
@@ -226,5 +272,5 @@ function explainOutputs(name, view) {
|
|
|
226
272
|
//#endregion
|
|
227
273
|
export { explainHost };
|
|
228
274
|
|
|
229
|
-
//# sourceMappingURL=explain-
|
|
230
|
-
//# debugId=
|
|
275
|
+
//# sourceMappingURL=explain-YPD3n6t8.mjs.map
|
|
276
|
+
//# debugId=2de60ffc-44fc-5443-869a-bb41f0f94d0b
|