@powerhousedao/ph-cli 6.2.3-dev.70 → 6.2.3-dev.71
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/{cli-connect-override-Cf7WutqU.mjs → cli-connect-override-CEJhQWRX.mjs} +5 -5
- package/dist/cli-connect-override-CEJhQWRX.mjs.map +1 -0
- package/dist/cli.mjs +4 -4
- package/dist/compound-B6RZMA0Y-Cv3XMQ3Y.mjs +2459 -0
- package/dist/compound-B6RZMA0Y-Cv3XMQ3Y.mjs.map +1 -0
- package/dist/{connect-build-BtKpvcQK.mjs → connect-build-BfhOGbha.mjs} +4 -4
- package/dist/{connect-build-BtKpvcQK.mjs.map → connect-build-BfhOGbha.mjs.map} +1 -1
- package/dist/{connect-config-9EZB_0H_.mjs → connect-config-DblqJgxR.mjs} +4 -4
- package/dist/{connect-config-9EZB_0H_.mjs.map → connect-config-DblqJgxR.mjs.map} +1 -1
- package/dist/connect-plugin-configs-D2fwYpMw.mjs +50 -0
- package/dist/connect-plugin-configs-D2fwYpMw.mjs.map +1 -0
- package/dist/{connect-studio-Bhlc77WI.mjs → connect-studio-DX7r4iyI.mjs} +5 -4
- package/dist/{connect-studio-Bhlc77WI.mjs.map → connect-studio-DX7r4iyI.mjs.map} +1 -1
- package/dist/{connect-studio-BehPZzN7.mjs → connect-studio-DmjcV8I2.mjs} +3 -3
- package/dist/{dist-BqeDFgEy.mjs → dist-CCLkwpTS.mjs} +199 -109
- package/dist/dist-CCLkwpTS.mjs.map +1 -0
- package/dist/explain-DUXbB9jf.mjs +241 -0
- package/dist/explain-DUXbB9jf.mjs.map +1 -0
- package/dist/{generate-all-C_sPGBuk.mjs → generate-all-Dgyy_kT-.mjs} +7 -3
- package/dist/generate-all-Dgyy_kT-.mjs.map +1 -0
- package/dist/{generate-desktop-shell-BBSGpmud.mjs → generate-desktop-shell-Bj_3bJDL.mjs} +112 -7
- package/dist/generate-desktop-shell-Bj_3bJDL.mjs.map +1 -0
- package/dist/generate-hosts-BFmPIW2X.mjs +18 -0
- package/dist/generate-hosts-BFmPIW2X.mjs.map +1 -0
- package/dist/generate-hosts-RWj7WPHZ.mjs +4 -0
- package/dist/{index-CspiP73o.d.mts → index-BIbx17vt.d.mts} +178 -14
- package/dist/index-BIbx17vt.d.mts.map +1 -0
- package/dist/ph-cli-commands-BhzvcuzR.mjs +4 -0
- package/dist/{ph-cli-commands-3ptdQ0NI.mjs → ph-cli-commands-pyxDifSE.mjs} +155 -138
- package/dist/ph-cli-commands-pyxDifSE.mjs.map +1 -0
- package/dist/{run-sugar-BdjKTPGO.mjs → run-sugar-Ns53R6lU.mjs} +4 -4
- package/dist/{run-sugar-BdjKTPGO.mjs.map → run-sugar-Ns53R6lU.mjs.map} +1 -1
- package/dist/runners/connect.d.mts +1054 -26
- package/dist/runners/connect.d.mts.map +1 -1
- package/dist/runners/connect.mjs +121 -49
- package/dist/runners/connect.mjs.map +1 -1
- package/dist/runners/switchboard.d.mts +170 -28
- package/dist/runners/switchboard.d.mts.map +1 -1
- package/dist/runners/switchboard.mjs +171 -49
- package/dist/runners/switchboard.mjs.map +1 -1
- package/dist/{schemas-BQSPev1x.mjs → schemas-D5N5U_Mf.mjs} +205 -4
- package/dist/{schemas-BQSPev1x.mjs.map → schemas-D5N5U_Mf.mjs.map} +1 -1
- package/dist/scripts/emit-runner-schemas.ts +24 -0
- package/dist/start-run-BIaYSpHh.mjs +124 -0
- package/dist/start-run-BIaYSpHh.mjs.map +1 -0
- package/dist/{superseded-config-9D7BdLvd.mjs → superseded-config-CbSTFun2.mjs} +4 -4
- package/dist/superseded-config-CbSTFun2.mjs.map +1 -0
- package/dist/switchboard-h4-XgP1h.mjs +2 -2
- package/dist/switchboard-h4-XgP1h.mjs.map +1 -1
- package/dist/utils-DAux4Ga7.mjs +4 -0
- package/dist/{vetra-BD-34wGs.mjs → vetra-CnrGDPX0.mjs} +10 -10
- package/dist/vetra-CnrGDPX0.mjs.map +1 -0
- package/package.json +15 -20
- package/dist/cli-connect-override-Cf7WutqU.mjs.map +0 -1
- package/dist/dist-BqeDFgEy.mjs.map +0 -1
- package/dist/explain-BDHmXgw3.mjs +0 -27
- package/dist/explain-BDHmXgw3.mjs.map +0 -1
- package/dist/generate-all-C_sPGBuk.mjs.map +0 -1
- package/dist/generate-desktop-shell-BBSGpmud.mjs.map +0 -1
- package/dist/host-schemas-CtPNRr5v-BQyKKFbS.mjs +0 -493
- package/dist/host-schemas-CtPNRr5v-BQyKKFbS.mjs.map +0 -1
- package/dist/index-CspiP73o.d.mts.map +0 -1
- package/dist/ph-cli-commands-3ptdQ0NI.mjs.map +0 -1
- package/dist/ph-cli-commands-Dx8hNj6W.mjs +0 -4
- package/dist/plugins-CHVv4qup.mjs +0 -91
- package/dist/plugins-CHVv4qup.mjs.map +0 -1
- package/dist/reactor-env-BbR86_Li.mjs +0 -29
- package/dist/reactor-env-BbR86_Li.mjs.map +0 -1
- package/dist/reactor-env-D_EvBtLB.mjs +0 -4
- package/dist/runners/compound.d.mts +0 -127
- package/dist/runners/compound.d.mts.map +0 -1
- package/dist/runners/compound.mjs +0 -72
- package/dist/runners/compound.mjs.map +0 -1
- package/dist/start-run-CmDxyMw0.mjs +0 -36
- package/dist/start-run-CmDxyMw0.mjs.map +0 -1
- package/dist/superseded-config-9D7BdLvd.mjs.map +0 -1
- package/dist/utils-TO9lB8Xs.mjs +0 -4
- package/dist/vetra-BD-34wGs.mjs.map +0 -1
|
@@ -1,493 +0,0 @@
|
|
|
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]="8b037b72-27ec-544b-9928-7e9ec61810d6")}catch(e){}}();
|
|
3
|
-
import { a as looseObject, c as strictObject, i as literal, l as string, n as array, o as number, r as boolean, s as record, t as _enum, u as union } from "./schemas-BQSPev1x.mjs";
|
|
4
|
-
import { a as pluginEntrySchema } from "./plugins-CHVv4qup.mjs";
|
|
5
|
-
import { createRequire } from "node:module";
|
|
6
|
-
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
import { pathToFileURL } from "node:url";
|
|
9
|
-
import "@powerhousedao/shared/clis/ph-dir";
|
|
10
|
-
import crypto from "node:crypto";
|
|
11
|
-
//#region ../../packages/host-core/dist/host-schemas-CtPNRr5v.mjs
|
|
12
|
-
/**
|
|
13
|
-
* Instance-fact projection for compound hosts: the drives a compound's
|
|
14
|
-
* reactor member created, projected into the Connect member's runtime-config
|
|
15
|
-
* override. Pure functions, moved from ph-cli's vetra service so the generic
|
|
16
|
-
* compound and the classic path share one implementation.
|
|
17
|
-
*/
|
|
18
|
-
function isLocalDrive(drive) {
|
|
19
|
-
return "local" in drive;
|
|
20
|
-
}
|
|
21
|
-
const driveKey = (drive) => isLocalDrive(drive) ? `local:${drive.id}` : drive.url;
|
|
22
|
-
/**
|
|
23
|
-
* Concatenate groups of `connect.drives.defaultDrives` in the order given,
|
|
24
|
-
* de-duplicating by drive identity (URL for remote entries, id for local
|
|
25
|
-
* ones). The first occurrence of a drive wins, so earlier groups keep their
|
|
26
|
-
* position and metadata — e.g. the Vetra drive `ph vetra` starts stays first
|
|
27
|
-
* even when the project's `powerhouse.config.json` lists the same drive.
|
|
28
|
-
*/
|
|
29
|
-
function mergeDefaultDrives(...groups) {
|
|
30
|
-
const seen = /* @__PURE__ */ new Set();
|
|
31
|
-
const out = [];
|
|
32
|
-
for (const group of groups) for (const drive of group) {
|
|
33
|
-
const key = driveKey(drive);
|
|
34
|
-
if (seen.has(key)) continue;
|
|
35
|
-
seen.add(key);
|
|
36
|
-
out.push(drive);
|
|
37
|
-
}
|
|
38
|
-
return out;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Rebase a local drive URL onto a public base: keeps the /d/<slug> path,
|
|
42
|
-
* swaps the loopback origin for the public base. Browser clients behind a
|
|
43
|
-
* reverse proxy can't reach http://localhost:<port>. Non-loopback URLs
|
|
44
|
-
* (e.g. a remote drive) are already public and pass through unchanged, as do
|
|
45
|
-
* unparseable ones.
|
|
46
|
-
*/
|
|
47
|
-
function rebaseDriveUrl(driveUrl, publicBase) {
|
|
48
|
-
let url;
|
|
49
|
-
try {
|
|
50
|
-
url = new URL(driveUrl);
|
|
51
|
-
} catch {
|
|
52
|
-
return driveUrl;
|
|
53
|
-
}
|
|
54
|
-
if (![
|
|
55
|
-
"localhost",
|
|
56
|
-
"127.0.0.1",
|
|
57
|
-
"[::1]"
|
|
58
|
-
].includes(url.hostname)) return driveUrl;
|
|
59
|
-
return `${publicBase.replace(/\/+$/, "")}${url.pathname}`;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* The compound's drives projection: created drives first (rebased onto the
|
|
63
|
-
* public base when given), then the project's configured drives, de-duplicated
|
|
64
|
-
* — and `preserve-all`, because compound-injected drive lists change per
|
|
65
|
-
* launch context and must never detach drives the user added by hand.
|
|
66
|
-
*/
|
|
67
|
-
function projectDrivesIntoConnect(input) {
|
|
68
|
-
return { drives: {
|
|
69
|
-
defaultDrives: mergeDefaultDrives(input.createdDriveUrls.filter((url) => typeof url === "string" && url.length > 0).map((url) => ({
|
|
70
|
-
url: input.publicBase ? rebaseDriveUrl(url, input.publicBase) : url,
|
|
71
|
-
name: null,
|
|
72
|
-
icon: null
|
|
73
|
-
})), input.configuredDefaultDrives ?? []),
|
|
74
|
-
preserveStrategy: "preserve-all"
|
|
75
|
-
} };
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Loads and pre-validates a `hosts/<name>/host.js` definition.
|
|
79
|
-
*
|
|
80
|
-
* A host file is a static PROJECTION of powerhouse.config.json: plain ESM,
|
|
81
|
-
* default-exporting a data object. Three gates run before any runner sees it:
|
|
82
|
-
* 1. import lint — the only legal import is the project's
|
|
83
|
-
* powerhouse.config.json (host files are data, not programs);
|
|
84
|
-
* 2. static check — the exported object must survive a JSON round trip
|
|
85
|
-
* (functions, undefined, class instances, Dates etc. are rejected,
|
|
86
|
-
* reporting the offending path);
|
|
87
|
-
* 3. shape pre-check — `name`, `runner.module`, and the reactor XOR children
|
|
88
|
-
* rule. Full validation is the runner's `hostSchema` (phase 2).
|
|
89
|
-
*
|
|
90
|
-
* This module never exits the process — callers own error presentation.
|
|
91
|
-
*/
|
|
92
|
-
const HOST_FILE = "host.js";
|
|
93
|
-
const CONFIG_IMPORT_SUFFIX = "powerhouse.config.json";
|
|
94
|
-
var HostLoadError = class extends Error {
|
|
95
|
-
constructor(message, hint) {
|
|
96
|
-
super(hint ? `${message}\n Hint: ${hint}` : message);
|
|
97
|
-
this.name = "HostLoadError";
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
/** A `hosts/` folder with no `<name>/host.js` inside is "empty" — the guard
|
|
101
|
-
* state: callers warn loudly and fall back to legacy rather than activating
|
|
102
|
-
* the new architecture off a stray `mkdir hosts`. */
|
|
103
|
-
function probeHostsFolder(projectRoot) {
|
|
104
|
-
const dir = path.join(projectRoot, "hosts");
|
|
105
|
-
if (!existsSync(dir) || !statSync(dir).isDirectory()) return { kind: "absent" };
|
|
106
|
-
const hosts = readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && existsSync(path.join(dir, entry.name, HOST_FILE))).map((entry) => entry.name).sort();
|
|
107
|
-
return hosts.length === 0 ? {
|
|
108
|
-
kind: "empty",
|
|
109
|
-
dir
|
|
110
|
-
} : {
|
|
111
|
-
kind: "present",
|
|
112
|
-
dir,
|
|
113
|
-
hosts
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
/** Sibling host imports: `../<host>/host.js` — source material for derived
|
|
117
|
-
* compositions (full-inclusion wrappers compute over them with plain JS). */
|
|
118
|
-
const SIBLING_IMPORT = /^\.\.\/([A-Za-z0-9_-]+)\/host\.js$/;
|
|
119
|
-
/** Rejects every import except the project's powerhouse.config.json and
|
|
120
|
-
* SIBLING host files (R1: derived compositions), plus any dynamic
|
|
121
|
-
* `import(...)` or `require(...)`. Source-level enforcement: the JSON round
|
|
122
|
-
* trip below is the hard gate; this one produces the better error. Returns
|
|
123
|
-
* the sibling host names the file imports, for cycle detection. */
|
|
124
|
-
function lintHostImports(source, file) {
|
|
125
|
-
const siblings = [];
|
|
126
|
-
for (const match of source.matchAll(/^\s*import\b[^;'"]*?from\s+["']([^"']+)["']/gm)) {
|
|
127
|
-
const specifier = match[1];
|
|
128
|
-
if (specifier.endsWith(CONFIG_IMPORT_SUFFIX)) continue;
|
|
129
|
-
const sibling = SIBLING_IMPORT.exec(specifier);
|
|
130
|
-
if (sibling) {
|
|
131
|
-
siblings.push(sibling[1]);
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
throw new HostLoadError(`${file} imports "${specifier}" — a host file may only import the project's powerhouse.config.json or sibling hosts/<name>/host.js files.`, "Host files are static projections; code belongs in plugins or the runner.");
|
|
135
|
-
}
|
|
136
|
-
if (/^\s*import\s+["']/m.test(source)) throw new HostLoadError(`${file} contains a side-effect import — a host file may only import the project's powerhouse.config.json or sibling host files.`);
|
|
137
|
-
if (/\bimport\s*\(/.test(source) || /\brequire\s*\(/.test(source)) throw new HostLoadError(`${file} uses dynamic import()/require() — host files are static data.`);
|
|
138
|
-
return siblings;
|
|
139
|
-
}
|
|
140
|
-
/** Walks the sibling-import graph from `hostName`, linting every visited file
|
|
141
|
-
* and failing on a cycle (an ESM circular would otherwise surface as an
|
|
142
|
-
* undefined default export with no useful message). */
|
|
143
|
-
function lintHostImportGraph(hostsDir, hostName) {
|
|
144
|
-
const state = /* @__PURE__ */ new Map();
|
|
145
|
-
const visit = (name, chain) => {
|
|
146
|
-
const mark = state.get(name);
|
|
147
|
-
if (mark === "done") return;
|
|
148
|
-
if (mark === "visiting") throw new HostLoadError(`Host import cycle: ${[...chain, name].map((n) => `hosts/${n}`).join(" -> ")}.`, "Hoist the shared data into one host (or powerhouse.config.json) instead of importing both ways.");
|
|
149
|
-
const file = path.join(hostsDir, name, HOST_FILE);
|
|
150
|
-
if (!existsSync(file)) throw new HostLoadError(`hosts/${chain[chain.length - 1] ?? name} imports sibling "hosts/${name}/host.js", which does not exist.`);
|
|
151
|
-
state.set(name, "visiting");
|
|
152
|
-
const siblings = lintHostImports(readFileSync(file, "utf8"), file);
|
|
153
|
-
for (const sibling of siblings) visit(sibling, [...chain, name]);
|
|
154
|
-
state.set(name, "done");
|
|
155
|
-
};
|
|
156
|
-
visit(hostName, []);
|
|
157
|
-
}
|
|
158
|
-
/** Returns the path of the first value that would not survive a JSON round
|
|
159
|
-
* trip, or undefined when the object is fully static. */
|
|
160
|
-
function findNonStaticValue(value, trail = "") {
|
|
161
|
-
if (value === null) return void 0;
|
|
162
|
-
const kind = typeof value;
|
|
163
|
-
if (kind === "string" || kind === "number" || kind === "boolean") return;
|
|
164
|
-
if (kind !== "object") return `${trail || "<root>"} (${kind})`;
|
|
165
|
-
if (Array.isArray(value)) {
|
|
166
|
-
for (let i = 0; i < value.length; i++) {
|
|
167
|
-
const hit = findNonStaticValue(value[i], `${trail}[${i}]`);
|
|
168
|
-
if (hit) return hit;
|
|
169
|
-
}
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const proto = Object.getPrototypeOf(value);
|
|
173
|
-
if (proto !== Object.prototype && proto !== null) return `${trail || "<root>"} (non-plain object)`;
|
|
174
|
-
for (const [key, child] of Object.entries(value)) {
|
|
175
|
-
const hit = findNonStaticValue(child, trail ? `${trail}.${key}` : key);
|
|
176
|
-
if (hit) return hit;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function assertHostShape(host, file) {
|
|
180
|
-
if (typeof host.name !== "string" || host.name.length === 0) throw new HostLoadError(`${file}: \`name\` must be a non-empty string.`);
|
|
181
|
-
const runner = host.runner;
|
|
182
|
-
if (runner === null || typeof runner !== "object" || typeof runner.module !== "string") throw new HostLoadError(`${file}: \`runner\` must be an object with a \`module\` specifier string.`);
|
|
183
|
-
if (host.reactor !== void 0 && host.children !== void 0) throw new HostLoadError(`${file}: \`reactor\` and \`children\` are mutually exclusive — a host is a reactor runner or a compound runner, never both.`);
|
|
184
|
-
}
|
|
185
|
-
async function loadHost(projectRoot, hostName) {
|
|
186
|
-
const probe = probeHostsFolder(projectRoot);
|
|
187
|
-
if (probe.kind === "absent") throw new HostLoadError(`No hosts/ folder found in ${projectRoot}.`, "Scaffold one with `ph init --uniform-runners` (or create hosts/<name>/host.js).");
|
|
188
|
-
if (probe.kind === "empty") throw new HostLoadError(`hosts/ exists at ${probe.dir} but contains no <name>/host.js.`, "An empty hosts/ folder does not activate the uniform-runners architecture; add a host definition or remove the folder.");
|
|
189
|
-
if (!probe.hosts.includes(hostName)) throw new HostLoadError(`Unknown host "${hostName}". Available hosts: ${probe.hosts.join(", ")}.`);
|
|
190
|
-
const file = path.join(probe.dir, hostName, HOST_FILE);
|
|
191
|
-
lintHostImportGraph(probe.dir, hostName);
|
|
192
|
-
const host = (await import(pathToFileURL(file).href)).default;
|
|
193
|
-
if (host === null || typeof host !== "object" || Array.isArray(host)) throw new HostLoadError(`${file} must default-export the host object (\`export default { name, runner, ... }\`).`);
|
|
194
|
-
const nonStatic = findNonStaticValue(host);
|
|
195
|
-
if (nonStatic) throw new HostLoadError(`${file} exports a non-static value at \`${nonStatic}\` — host files must survive a JSON round trip.`, "Runtime behavior belongs in the runner; host files only carry data.");
|
|
196
|
-
assertHostShape(host, file);
|
|
197
|
-
return {
|
|
198
|
-
name: hostName,
|
|
199
|
-
dir: path.dirname(file),
|
|
200
|
-
file,
|
|
201
|
-
host
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Resolves a host's `runner.module` specifier from the PROJECT's dependency
|
|
206
|
-
* tree (not ph-cli's), imports it, and checks the runner-module contract:
|
|
207
|
-
* `{ run, hostSchema, kind, ...optionalVerbs }`. Phase-0 home is ph-cli; the
|
|
208
|
-
* uniform-runners plan moves this into @powerhousedao/host-core with the
|
|
209
|
-
* generic compound (phase 1).
|
|
210
|
-
*/
|
|
211
|
-
var RunnerError = class extends Error {
|
|
212
|
-
constructor(message, hint) {
|
|
213
|
-
super(hint ? `${message}\n Hint: ${hint}` : message);
|
|
214
|
-
this.name = "RunnerError";
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
/** Exports that are part of the contract but are not verbs. */
|
|
218
|
-
const NON_VERB_EXPORTS = /* @__PURE__ */ new Set([
|
|
219
|
-
"hostSchema",
|
|
220
|
-
"kind",
|
|
221
|
-
"default"
|
|
222
|
-
]);
|
|
223
|
-
async function resolveRunnerModule(projectRoot, specifier) {
|
|
224
|
-
const projectRequire = createRequire(pathToFileURL(path.join(projectRoot, "package.json")).href);
|
|
225
|
-
let resolved;
|
|
226
|
-
try {
|
|
227
|
-
resolved = projectRequire.resolve(specifier);
|
|
228
|
-
} catch {
|
|
229
|
-
throw new RunnerError(`Cannot resolve runner module "${specifier}" from ${projectRoot}.`, "The runner must be a dependency of the project (install it, then retry).");
|
|
230
|
-
}
|
|
231
|
-
const module = await import(pathToFileURL(resolved).href);
|
|
232
|
-
if (typeof module.run !== "function") throw new RunnerError(`Runner "${specifier}" does not export a \`run\` function (required verb).`);
|
|
233
|
-
const hostSchema = module.hostSchema;
|
|
234
|
-
if (!hostSchema || typeof hostSchema.safeParse !== "function") throw new RunnerError(`Runner "${specifier}" does not export a \`hostSchema\` — runners validate their own host shape.`);
|
|
235
|
-
if (typeof module.kind !== "string") throw new RunnerError(`Runner "${specifier}" does not export \`kind\` (e.g. "reactor" | "compound").`);
|
|
236
|
-
return module;
|
|
237
|
-
}
|
|
238
|
-
function listVerbs(runner) {
|
|
239
|
-
return Object.entries(runner).filter(([name, value]) => typeof value === "function" && !NON_VERB_EXPORTS.has(name)).map(([name]) => name).sort();
|
|
240
|
-
}
|
|
241
|
-
function getVerb(runner, specifier, verb) {
|
|
242
|
-
const candidate = runner[verb];
|
|
243
|
-
if (typeof candidate !== "function" || NON_VERB_EXPORTS.has(verb)) throw new RunnerError(`Runner "${specifier}" does not support the verb "${verb}". Supported verbs: ${listVerbs(runner).join(", ")}.`);
|
|
244
|
-
return candidate;
|
|
245
|
-
}
|
|
246
|
-
function validateHost(runner, specifier, host, file) {
|
|
247
|
-
const result = runner.hostSchema.safeParse(host);
|
|
248
|
-
if (!result.success) throw new RunnerError(`${file} failed validation against the hostSchema of "${specifier}":\n${(result.error?.issues ?? []).map((issue) => ` - ${issue.path.join(".") || "<root>"}: ${issue.message}`).join("\n") || " (no details reported)"}`);
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* R1 — core drive declarations. A reactor without drives is not a running
|
|
252
|
-
* reactor, so declaring + seeding them is HOST RUNTIME work (not a plugin):
|
|
253
|
-
* onReactorReady → idempotent slug-keyed seeding → onDrivesReady. Plugins
|
|
254
|
-
* CONTRIBUTE declarations into the same merged list (Contributions.drives);
|
|
255
|
-
* `--explain drives` prints the merged set with provenance.
|
|
256
|
-
*
|
|
257
|
-
* Field semantics (union of the three existing creation sites — vetra,
|
|
258
|
-
* preview, workflows — plus Connect's PHConnectDefaultDrive):
|
|
259
|
-
* - slug: the SEEDING KEY (idempotence); id optional (stable identity),
|
|
260
|
-
* projectHash derives both from the project path (generateProjectDriveId
|
|
261
|
-
* semantics: `${slug}-${sha256(projectPath).slice(0, 8)}`).
|
|
262
|
-
* - preferredEditor: binds the drive to its drive app — stored at
|
|
263
|
-
* header.meta.preferredEditor; Connect config's `app` is the legacy alias.
|
|
264
|
-
* - remote.url: an attachment to a drive served elsewhere (Connect default
|
|
265
|
-
* drives, switchboard remoteDrives); local fields are ignored for remotes.
|
|
266
|
-
*/
|
|
267
|
-
const driveDeclarationSchema = strictObject({
|
|
268
|
-
slug: string().min(1),
|
|
269
|
-
id: string().min(1).optional(),
|
|
270
|
-
/** Derive id (and the served slug) from the project path, like
|
|
271
|
-
* generateProjectDriveId — same ids classic `ph vetra` produces. */
|
|
272
|
-
projectHash: boolean().optional(),
|
|
273
|
-
name: string().min(1).optional(),
|
|
274
|
-
icon: string().optional(),
|
|
275
|
-
preferredEditor: string().optional(),
|
|
276
|
-
sharingType: _enum([
|
|
277
|
-
"public",
|
|
278
|
-
"private",
|
|
279
|
-
"shared"
|
|
280
|
-
]).optional(),
|
|
281
|
-
availableOffline: boolean().optional(),
|
|
282
|
-
remote: strictObject({ url: string().min(1) }).optional()
|
|
283
|
-
});
|
|
284
|
-
const drivesSchema = array(driveDeclarationSchema);
|
|
285
|
-
function projectDriveId(projectRoot, slug) {
|
|
286
|
-
return `${slug}-${crypto.createHash("sha256").update(projectRoot).digest("hex").substring(0, 8)}`;
|
|
287
|
-
}
|
|
288
|
-
function resolveDriveDeclaration(projectRoot, decl) {
|
|
289
|
-
const id = decl.projectHash ? projectDriveId(projectRoot, decl.slug) : decl.id ?? decl.slug;
|
|
290
|
-
const slug = decl.projectHash ? id : decl.slug;
|
|
291
|
-
if (decl.remote) return {
|
|
292
|
-
kind: "remote",
|
|
293
|
-
id,
|
|
294
|
-
slug,
|
|
295
|
-
name: decl.name ?? decl.slug,
|
|
296
|
-
remoteUrl: decl.remote.url,
|
|
297
|
-
sharingType: decl.sharingType ?? "public",
|
|
298
|
-
availableOffline: decl.availableOffline ?? true
|
|
299
|
-
};
|
|
300
|
-
return {
|
|
301
|
-
kind: "local",
|
|
302
|
-
id,
|
|
303
|
-
slug,
|
|
304
|
-
name: decl.name ?? decl.slug,
|
|
305
|
-
icon: decl.icon,
|
|
306
|
-
preferredEditor: decl.preferredEditor,
|
|
307
|
-
sharingType: decl.sharingType ?? "public",
|
|
308
|
-
availableOffline: decl.availableOffline ?? true
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
/** Idempotent, slug-keyed: an existing slug is left untouched (never
|
|
312
|
-
* recreated, never mutated — preserveStrategy refinements live here later). */
|
|
313
|
-
async function seedDrives(client, drives) {
|
|
314
|
-
const result = {
|
|
315
|
-
created: [],
|
|
316
|
-
existing: [],
|
|
317
|
-
attached: []
|
|
318
|
-
};
|
|
319
|
-
for (const drive of drives) {
|
|
320
|
-
if (drive.kind === "remote") {
|
|
321
|
-
await client.attachRemoteDrive(drive.remoteUrl);
|
|
322
|
-
result.attached.push(drive.slug);
|
|
323
|
-
continue;
|
|
324
|
-
}
|
|
325
|
-
if (await client.findDriveBySlug(drive.slug) !== void 0) {
|
|
326
|
-
result.existing.push(drive.slug);
|
|
327
|
-
continue;
|
|
328
|
-
}
|
|
329
|
-
await client.createDrive(drive);
|
|
330
|
-
result.created.push(drive.slug);
|
|
331
|
-
}
|
|
332
|
-
return result;
|
|
333
|
-
}
|
|
334
|
-
/** Merge host-declared drives with plugin contributions, slug-keyed — the
|
|
335
|
-
* host file wins on conflicts (it is the most explicit source). */
|
|
336
|
-
function mergeDrivePlan(projectRoot, hostDeclared, contributed) {
|
|
337
|
-
const plan = /* @__PURE__ */ new Map();
|
|
338
|
-
for (const { declaration, source } of contributed) {
|
|
339
|
-
const drive = resolveDriveDeclaration(projectRoot, declaration);
|
|
340
|
-
plan.set(drive.slug, {
|
|
341
|
-
drive,
|
|
342
|
-
source
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
for (const declaration of hostDeclared) {
|
|
346
|
-
const drive = resolveDriveDeclaration(projectRoot, declaration);
|
|
347
|
-
plan.set(drive.slug, {
|
|
348
|
-
drive,
|
|
349
|
-
source: "host"
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
return [...plan.values()];
|
|
353
|
-
}
|
|
354
|
-
function explainDrivePlan(plan) {
|
|
355
|
-
if (plan.length === 0) return "(no drives declared)";
|
|
356
|
-
return ["drives:", ...plan.map(({ drive, source }) => {
|
|
357
|
-
const kind = drive.kind === "remote" ? `remote ${drive.remoteUrl}` : "local";
|
|
358
|
-
const editor = drive.preferredEditor ? ` editor=${drive.preferredEditor}` : "";
|
|
359
|
-
return ` ${drive.slug} (${kind}, id=${drive.id}${editor}) [${source}]`;
|
|
360
|
-
})].join("\n");
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* The shared zod schemas for host.js blocks (D2.a). The `reactor` block
|
|
364
|
-
* validates STRICTLY (D2.d — phase 0's tolerated-unknown-keys notice ends
|
|
365
|
-
* here): a typo'd protocol key must fail, not silently not-apply, because
|
|
366
|
-
* these are fleet-consensus settings. `config` stays loose — it is
|
|
367
|
-
* runner-defined by design.
|
|
368
|
-
*/
|
|
369
|
-
const profileSchema = strictObject({
|
|
370
|
-
appId: string().min(1).optional(),
|
|
371
|
-
name: string().min(1).optional(),
|
|
372
|
-
description: string().optional(),
|
|
373
|
-
icon: string().optional()
|
|
374
|
-
}).optional();
|
|
375
|
-
const reactorProtocolSchema = strictObject({
|
|
376
|
-
featureFlags: strictObject({
|
|
377
|
-
documentDecisions: boolean().optional(),
|
|
378
|
-
authEnforcement: boolean().optional(),
|
|
379
|
-
authGroups: boolean().optional(),
|
|
380
|
-
authConditions: boolean().optional()
|
|
381
|
-
}).optional(),
|
|
382
|
-
createSignaturePolicy: _enum(["legacy", "v2-required"]).optional(),
|
|
383
|
-
unsupportedStoredDocuments: _enum(["refuse", "read-only"]).optional()
|
|
384
|
-
});
|
|
385
|
-
const samePath = (a, b) => {
|
|
386
|
-
const norm = (p) => p.replace(/\\/g, "/").replace(/\/+$/, "").replace(/^\.\//, "");
|
|
387
|
-
return norm(a) === norm(b);
|
|
388
|
-
};
|
|
389
|
-
const reactorBackendSchema = strictObject({
|
|
390
|
-
kind: _enum([
|
|
391
|
-
"in-process",
|
|
392
|
-
"worker",
|
|
393
|
-
"remote"
|
|
394
|
-
]).optional(),
|
|
395
|
-
storage: strictObject({
|
|
396
|
-
kind: _enum([
|
|
397
|
-
"idb",
|
|
398
|
-
"memory",
|
|
399
|
-
"path",
|
|
400
|
-
"postgres"
|
|
401
|
-
]),
|
|
402
|
-
dataDir: string().optional(),
|
|
403
|
-
url: string().optional()
|
|
404
|
-
}).optional(),
|
|
405
|
-
readModel: strictObject({ url: string().optional() }).optional(),
|
|
406
|
-
packages: strictObject({
|
|
407
|
-
cdnUrl: string().optional(),
|
|
408
|
-
specs: array(string()).optional(),
|
|
409
|
-
dynamic: boolean().optional()
|
|
410
|
-
}).optional(),
|
|
411
|
-
remote: strictObject({
|
|
412
|
-
host: string().optional(),
|
|
413
|
-
url: string().optional()
|
|
414
|
-
}).optional(),
|
|
415
|
-
projection: strictObject({
|
|
416
|
-
enabled: boolean().optional(),
|
|
417
|
-
dbPoolSize: number().int().positive().optional()
|
|
418
|
-
}).optional(),
|
|
419
|
-
executors: strictObject({ numWorkers: union([number().int().positive(), literal("auto")]).optional() }).optional()
|
|
420
|
-
}).superRefine((backend, ctx) => {
|
|
421
|
-
const store = backend.storage;
|
|
422
|
-
const storeDir = store?.kind === "path" ? store.dataDir : void 0;
|
|
423
|
-
const readModel = backend.readModel?.url;
|
|
424
|
-
if (storeDir && readModel && samePath(storeDir, readModel)) ctx.addIssue({
|
|
425
|
-
code: "custom",
|
|
426
|
-
path: ["readModel", "url"],
|
|
427
|
-
message: `readModel.url must not be the reactor's storage dir (${readModel}): two PGlite instances on one data dir corrupt it. Omit readModel.url to get the classic <root>/.ph/read-storage next to the reactor store.`
|
|
428
|
-
});
|
|
429
|
-
});
|
|
430
|
-
const reactorSchema = strictObject({
|
|
431
|
-
backends: record(string(), reactorBackendSchema).optional(),
|
|
432
|
-
placement: strictObject({
|
|
433
|
-
primary: string().optional(),
|
|
434
|
-
default: looseObject({}).optional()
|
|
435
|
-
}).optional(),
|
|
436
|
-
protocol: reactorProtocolSchema.optional(),
|
|
437
|
-
/** DEPRECATED (dies in R2): workflows become a listed plugin — presence is
|
|
438
|
-
* activation. Kept parsing until the switchboard rewire lands. */
|
|
439
|
-
workflows: boolean().optional(),
|
|
440
|
-
renown: strictObject({
|
|
441
|
-
url: string().optional(),
|
|
442
|
-
networkId: string().optional(),
|
|
443
|
-
chainId: number().int().optional()
|
|
444
|
-
}).optional(),
|
|
445
|
-
packages: strictObject({ registryUrl: string().optional() }).optional(),
|
|
446
|
-
namespace: string().min(1).optional(),
|
|
447
|
-
auth: strictObject({
|
|
448
|
-
enabled: boolean().optional(),
|
|
449
|
-
admins: array(string()).optional(),
|
|
450
|
-
renown: looseObject({}).optional()
|
|
451
|
-
}).optional(),
|
|
452
|
-
drives: drivesSchema.optional()
|
|
453
|
-
});
|
|
454
|
-
/** Common runner options every host.runner carries; runner modules extend it
|
|
455
|
-
* loosely with their own process options. */
|
|
456
|
-
const runnerBaseSchema = looseObject({
|
|
457
|
-
module: string().min(1),
|
|
458
|
-
defaultVerb: string().optional(),
|
|
459
|
-
port: number().int().positive().optional(),
|
|
460
|
-
/** Bind address; each runner documents its default (0.0.0.0 for servers,
|
|
461
|
-
* localhost for vite dev, 127.0.0.1 for serve). */
|
|
462
|
-
host: string().min(1).optional(),
|
|
463
|
-
/** THE COMPOSITION: the plugin entries this host boots with. Presence is
|
|
464
|
-
* activation; see plugins.ts for entry semantics. */
|
|
465
|
-
plugins: array(pluginEntrySchema).optional()
|
|
466
|
-
});
|
|
467
|
-
/** A compound's children map (mutually exclusive with `reactor` — the XOR is
|
|
468
|
-
* structural, enforced by the loader; schemas validate each side's shape). */
|
|
469
|
-
const childrenSchema = record(string(), strictObject({
|
|
470
|
-
host: string().min(1),
|
|
471
|
-
runner: looseObject({}).optional(),
|
|
472
|
-
config: looseObject({}).optional(),
|
|
473
|
-
reactor: reactorSchema.optional()
|
|
474
|
-
}));
|
|
475
|
-
looseObject({
|
|
476
|
-
name: string().min(1),
|
|
477
|
-
runner: runnerBaseSchema,
|
|
478
|
-
config: looseObject({}).optional(),
|
|
479
|
-
profile: profileSchema,
|
|
480
|
-
reactor: reactorSchema.optional()
|
|
481
|
-
});
|
|
482
|
-
looseObject({
|
|
483
|
-
name: string().min(1),
|
|
484
|
-
runner: runnerBaseSchema,
|
|
485
|
-
children: childrenSchema,
|
|
486
|
-
config: looseObject({}).optional(),
|
|
487
|
-
profile: profileSchema
|
|
488
|
-
});
|
|
489
|
-
//#endregion
|
|
490
|
-
export { mergeDefaultDrives as a, profileSchema as c, rebaseDriveUrl as d, resolveDriveDeclaration as f, validateHost as h, loadHost as i, projectDrivesIntoConnect as l, seedDrives as m, explainDrivePlan as n, mergeDrivePlan as o, resolveRunnerModule as p, getVerb as r, probeHostsFolder as s, childrenSchema as t, reactorSchema as u };
|
|
491
|
-
|
|
492
|
-
//# sourceMappingURL=host-schemas-CtPNRr5v-BQyKKFbS.mjs.map
|
|
493
|
-
//# debugId=8b037b72-27ec-544b-9928-7e9ec61810d6
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-schemas-CtPNRr5v-BQyKKFbS.mjs","sources":["../../../packages/host-core/dist/host-schemas-CtPNRr5v.mjs"],"sourcesContent":["import { pluginEntrySchema } from \"./plugins.mjs\";\nimport { createRequire } from \"node:module\";\nimport fs, { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { resolvePhDir } from \"@powerhousedao/shared/clis/ph-dir\";\nimport { z } from \"zod\";\nimport crypto from \"node:crypto\";\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 vetra` 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//#endregion\n//#region src/host-loader.ts\n/**\n* Loads and pre-validates a `hosts/<name>/host.js` definition.\n*\n* A host file is a static PROJECTION of powerhouse.config.json: plain ESM,\n* default-exporting a data object. Three gates run before any runner sees it:\n* 1. import lint — the only legal import is the project's\n* powerhouse.config.json (host files are data, not programs);\n* 2. static check — the exported object must survive a JSON round trip\n* (functions, undefined, class instances, Dates etc. are rejected,\n* reporting the offending path);\n* 3. shape pre-check — `name`, `runner.module`, and the reactor XOR children\n* rule. Full validation is the runner's `hostSchema` (phase 2).\n*\n* This module never exits the process — callers own error presentation.\n*/\nconst HOST_FILE = \"host.js\";\nconst CONFIG_IMPORT_SUFFIX = \"powerhouse.config.json\";\nvar HostLoadError = class extends Error {\n\tconstructor(message, hint) {\n\t\tsuper(hint ? `${message}\\n Hint: ${hint}` : message);\n\t\tthis.name = \"HostLoadError\";\n\t}\n};\n/** A `hosts/` folder with no `<name>/host.js` inside is \"empty\" — the guard\n* state: callers warn loudly and fall back to legacy rather than activating\n* the new architecture off a stray `mkdir hosts`. */\nfunction probeHostsFolder(projectRoot) {\n\tconst dir = path.join(projectRoot, \"hosts\");\n\tif (!existsSync(dir) || !statSync(dir).isDirectory()) return { kind: \"absent\" };\n\tconst hosts = readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && existsSync(path.join(dir, entry.name, HOST_FILE))).map((entry) => entry.name).sort();\n\treturn hosts.length === 0 ? {\n\t\tkind: \"empty\",\n\t\tdir\n\t} : {\n\t\tkind: \"present\",\n\t\tdir,\n\t\thosts\n\t};\n}\n/** Sibling host imports: `../<host>/host.js` — source material for derived\n* compositions (full-inclusion wrappers compute over them with plain JS). */\nconst SIBLING_IMPORT = /^\\.\\.\\/([A-Za-z0-9_-]+)\\/host\\.js$/;\n/** Rejects every import except the project's powerhouse.config.json and\n* SIBLING host files (R1: derived compositions), plus any dynamic\n* `import(...)` or `require(...)`. Source-level enforcement: the JSON round\n* trip below is the hard gate; this one produces the better error. Returns\n* the sibling host names the file imports, for cycle detection. */\nfunction lintHostImports(source, file) {\n\tconst siblings = [];\n\tfor (const match of source.matchAll(/^\\s*import\\b[^;'\"]*?from\\s+[\"']([^\"']+)[\"']/gm)) {\n\t\tconst specifier = match[1];\n\t\tif (specifier.endsWith(CONFIG_IMPORT_SUFFIX)) continue;\n\t\tconst sibling = SIBLING_IMPORT.exec(specifier);\n\t\tif (sibling) {\n\t\t\tsiblings.push(sibling[1]);\n\t\t\tcontinue;\n\t\t}\n\t\tthrow new HostLoadError(`${file} imports \"${specifier}\" — a host file may only import the project's powerhouse.config.json or sibling hosts/<name>/host.js files.`, \"Host files are static projections; code belongs in plugins or the runner.\");\n\t}\n\tif (/^\\s*import\\s+[\"']/m.test(source)) throw new HostLoadError(`${file} contains a side-effect import — a host file may only import the project's powerhouse.config.json or sibling host files.`);\n\tif (/\\bimport\\s*\\(/.test(source) || /\\brequire\\s*\\(/.test(source)) throw new HostLoadError(`${file} uses dynamic import()/require() — host files are static data.`);\n\treturn siblings;\n}\n/** Walks the sibling-import graph from `hostName`, linting every visited file\n* and failing on a cycle (an ESM circular would otherwise surface as an\n* undefined default export with no useful message). */\nfunction lintHostImportGraph(hostsDir, hostName) {\n\tconst state = /* @__PURE__ */ new Map();\n\tconst visit = (name, chain) => {\n\t\tconst mark = state.get(name);\n\t\tif (mark === \"done\") return;\n\t\tif (mark === \"visiting\") throw new HostLoadError(`Host import cycle: ${[...chain, name].map((n) => `hosts/${n}`).join(\" -> \")}.`, \"Hoist the shared data into one host (or powerhouse.config.json) instead of importing both ways.\");\n\t\tconst file = path.join(hostsDir, name, HOST_FILE);\n\t\tif (!existsSync(file)) throw new HostLoadError(`hosts/${chain[chain.length - 1] ?? name} imports sibling \"hosts/${name}/host.js\", which does not exist.`);\n\t\tstate.set(name, \"visiting\");\n\t\tconst siblings = lintHostImports(readFileSync(file, \"utf8\"), file);\n\t\tfor (const sibling of siblings) visit(sibling, [...chain, name]);\n\t\tstate.set(name, \"done\");\n\t};\n\tvisit(hostName, []);\n}\n/** Returns the path of the first value that would not survive a JSON round\n* trip, or undefined when the object is fully static. */\nfunction findNonStaticValue(value, trail = \"\") {\n\tif (value === null) return void 0;\n\tconst kind = typeof value;\n\tif (kind === \"string\" || kind === \"number\" || kind === \"boolean\") return;\n\tif (kind !== \"object\") return `${trail || \"<root>\"} (${kind})`;\n\tif (Array.isArray(value)) {\n\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\tconst hit = findNonStaticValue(value[i], `${trail}[${i}]`);\n\t\t\tif (hit) return hit;\n\t\t}\n\t\treturn;\n\t}\n\tconst proto = Object.getPrototypeOf(value);\n\tif (proto !== Object.prototype && proto !== null) return `${trail || \"<root>\"} (non-plain object)`;\n\tfor (const [key, child] of Object.entries(value)) {\n\t\tconst hit = findNonStaticValue(child, trail ? `${trail}.${key}` : key);\n\t\tif (hit) return hit;\n\t}\n}\nfunction assertHostShape(host, file) {\n\tif (typeof host.name !== \"string\" || host.name.length === 0) throw new HostLoadError(`${file}: \\`name\\` must be a non-empty string.`);\n\tconst runner = host.runner;\n\tif (runner === null || typeof runner !== \"object\" || typeof runner.module !== \"string\") throw new HostLoadError(`${file}: \\`runner\\` must be an object with a \\`module\\` specifier string.`);\n\tif (host.reactor !== void 0 && host.children !== void 0) throw new HostLoadError(`${file}: \\`reactor\\` and \\`children\\` are mutually exclusive — a host is a reactor runner or a compound runner, never both.`);\n}\nasync function loadHost(projectRoot, hostName) {\n\tconst probe = probeHostsFolder(projectRoot);\n\tif (probe.kind === \"absent\") throw new HostLoadError(`No hosts/ folder found in ${projectRoot}.`, \"Scaffold one with `ph init --uniform-runners` (or create hosts/<name>/host.js).\");\n\tif (probe.kind === \"empty\") throw new HostLoadError(`hosts/ exists at ${probe.dir} but contains no <name>/host.js.`, \"An empty hosts/ folder does not activate the uniform-runners architecture; add a host definition or remove the folder.\");\n\tif (!probe.hosts.includes(hostName)) throw new HostLoadError(`Unknown host \"${hostName}\". Available hosts: ${probe.hosts.join(\", \")}.`);\n\tconst file = path.join(probe.dir, hostName, HOST_FILE);\n\tlintHostImportGraph(probe.dir, hostName);\n\tconst host = (await import(pathToFileURL(file).href)).default;\n\tif (host === null || typeof host !== \"object\" || Array.isArray(host)) throw new HostLoadError(`${file} must default-export the host object (\\`export default { name, runner, ... }\\`).`);\n\tconst nonStatic = findNonStaticValue(host);\n\tif (nonStatic) throw new HostLoadError(`${file} exports a non-static value at \\`${nonStatic}\\` — host files must survive a JSON round trip.`, \"Runtime behavior belongs in the runner; host files only carry data.\");\n\tassertHostShape(host, file);\n\treturn {\n\t\tname: hostName,\n\t\tdir: path.dirname(file),\n\t\tfile,\n\t\thost\n\t};\n}\n//#endregion\n//#region src/runner-resolver.ts\n/**\n* Resolves a host's `runner.module` specifier from the PROJECT's dependency\n* tree (not ph-cli's), imports it, and checks the runner-module contract:\n* `{ run, hostSchema, kind, ...optionalVerbs }`. Phase-0 home is ph-cli; the\n* uniform-runners plan moves this into @powerhousedao/host-core with the\n* generic compound (phase 1).\n*/\nvar RunnerError = class extends Error {\n\tconstructor(message, hint) {\n\t\tsuper(hint ? `${message}\\n Hint: ${hint}` : message);\n\t\tthis.name = \"RunnerError\";\n\t}\n};\n/** Exports that are part of the contract but are not verbs. */\nconst NON_VERB_EXPORTS = /* @__PURE__ */ new Set([\n\t\"hostSchema\",\n\t\"kind\",\n\t\"default\"\n]);\nasync function resolveRunnerModule(projectRoot, specifier) {\n\tconst projectRequire = createRequire(pathToFileURL(path.join(projectRoot, \"package.json\")).href);\n\tlet resolved;\n\ttry {\n\t\tresolved = projectRequire.resolve(specifier);\n\t} catch {\n\t\tthrow new RunnerError(`Cannot resolve runner module \"${specifier}\" from ${projectRoot}.`, \"The runner must be a dependency of the project (install it, then retry).\");\n\t}\n\tconst module = await import(pathToFileURL(resolved).href);\n\tif (typeof module.run !== \"function\") throw new RunnerError(`Runner \"${specifier}\" does not export a \\`run\\` function (required verb).`);\n\tconst hostSchema = module.hostSchema;\n\tif (!hostSchema || typeof hostSchema.safeParse !== \"function\") throw new RunnerError(`Runner \"${specifier}\" does not export a \\`hostSchema\\` — runners validate their own host shape.`);\n\tif (typeof module.kind !== \"string\") throw new RunnerError(`Runner \"${specifier}\" does not export \\`kind\\` (e.g. \"reactor\" | \"compound\").`);\n\treturn module;\n}\nfunction listVerbs(runner) {\n\treturn Object.entries(runner).filter(([name, value]) => typeof value === \"function\" && !NON_VERB_EXPORTS.has(name)).map(([name]) => name).sort();\n}\nfunction getVerb(runner, specifier, verb) {\n\tconst candidate = runner[verb];\n\tif (typeof candidate !== \"function\" || NON_VERB_EXPORTS.has(verb)) throw new RunnerError(`Runner \"${specifier}\" does not support the verb \"${verb}\". Supported verbs: ${listVerbs(runner).join(\", \")}.`);\n\treturn candidate;\n}\nfunction validateHost(runner, specifier, host, file) {\n\tconst result = runner.hostSchema.safeParse(host);\n\tif (!result.success) throw new RunnerError(`${file} failed validation against the hostSchema of \"${specifier}\":\\n${(result.error?.issues ?? []).map((issue) => ` - ${issue.path.join(\".\") || \"<root>\"}: ${issue.message}`).join(\"\\n\") || \" (no details reported)\"}`);\n}\n//#endregion\n//#region src/run-record.ts\nconst runDir = (projectDir) => path.join(resolvePhDir(projectDir), \"run\");\nconst recordPath = (projectDir, hostName) => path.join(runDir(projectDir), `${hostName}.json`);\nfunction readRunRecord(projectDir, hostName) {\n\ttry {\n\t\treturn JSON.parse(fs.readFileSync(recordPath(projectDir, hostName), \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction writeRunRecord(projectDir, record) {\n\tconst target = recordPath(projectDir, record.hostName);\n\tfs.mkdirSync(path.dirname(target), { recursive: true });\n\tfs.writeFileSync(target, `${JSON.stringify(record, null, 2)}\\n`);\n}\nfunction clearRunRecord(projectDir, hostName) {\n\ttry {\n\t\tfs.rmSync(recordPath(projectDir, hostName));\n\t} catch {}\n}\nfunction isPidAlive(pid) {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (error) {\n\t\treturn error.code === \"EPERM\";\n\t}\n}\n/**\n* Decide whether the recorded instance is this project's live host.\n*\n* pid liveness alone proves nothing (pids are reused), and the recorded\n* projectName is what separates \"my instance\" from \"a different project that\n* happens to hold this storage root\" — the confusion the vetra lock exists to\n* prevent. A stale record (dead pid) is reported so the caller can clear it; a\n* foreign one (live pid, different project) is left alone.\n*/\nfunction probeRun(projectDir, hostName, projectName) {\n\tconst record = readRunRecord(projectDir, hostName);\n\tif (!record) return { status: \"none\" };\n\tif (!isPidAlive(record.pid)) return {\n\t\tstatus: \"stale\",\n\t\trecord\n\t};\n\tif (record.projectName !== projectName) return {\n\t\tstatus: \"foreign\",\n\t\trecord\n\t};\n\treturn {\n\t\tstatus: \"live\",\n\t\trecord\n\t};\n}\n//#endregion\n//#region src/placeholders.ts\n/**\n* `${userData}` resolution for host files (desktop shape): storage paths in a\n* host must not derive from the instance name (renames must stay safe), so\n* the host file writes `${userData}/.ph/reactor-storage` and the RUNNER\n* resolves it at start. `${userData}` is a PROJECT-SHAPED root: its `.ph`\n* subtree carries the same names the classic commands use under\n* `<project>/.ph` (see `resolvePhDir`). In the CLI it IS the project root, so\n* `ph run desktop` in a project shares the one `.ph` tree `ph vetra` uses;\n* a shell (Tauri) points it at the OS profile via PH_USER_DATA_DIR, and the\n* whole `.ph` tree — stores, identity, run records — follows.\n*/\nfunction defaultUserDataDir(projectRoot, env = process.env) {\n\treturn env.PH_USER_DATA_DIR ?? path.resolve(projectRoot);\n}\nconst PLACEHOLDER = /\\$\\{userData\\}/g;\n/** Deep-substitute `${userData}` in every string of a JSON-shaped value.\n* Non-strings pass through; the input is never mutated. */\nfunction resolveUserDataPlaceholders(value, userData) {\n\tif (typeof value === \"string\") return value.replace(PLACEHOLDER, userData);\n\tif (Array.isArray(value)) return value.map((v) => resolveUserDataPlaceholders(v, userData));\n\tif (value !== null && typeof value === \"object\") {\n\t\tconst out = {};\n\t\tfor (const [k, v] of Object.entries(value)) out[k] = resolveUserDataPlaceholders(v, userData);\n\t\treturn out;\n\t}\n\treturn value;\n}\n//#endregion\n//#region src/compound.ts\nfunction memberEntries(host) {\n\tconst children = host.children ?? {};\n\treturn Object.entries(children);\n}\nfunction orderedMembers(host, wiring) {\n\tconst entries = memberEntries(host);\n\tif (!wiring.startOrder) return entries;\n\tconst byName = new Map(entries);\n\tconst out = [];\n\tfor (const name of wiring.startOrder) {\n\t\tconst m = byName.get(name);\n\t\tif (m) {\n\t\t\tout.push([name, m]);\n\t\t\tbyName.delete(name);\n\t\t}\n\t}\n\tfor (const [name, m] of entries) if (byName.has(name)) out.push([name, m]);\n\treturn out;\n}\n/** Build the member host object the member runner sees: the member's own\n* host.js with the wrapper applied. R1 semantics (rewire plan): a wrapper\n* SECTION is a FULL STATEMENT — `reactor` and `config`, when present on the\n* wrapper, replace the member's wholesale (host files derive keeps explicitly\n* by spreading the sibling import: `{ ...switchboard.reactor, drives }`).\n* `runner` stays key-merged: wrappers never restate `module`/`defaultVerb`,\n* they override individual keys (port, host, plugins — the plugins LIST\n* itself is a full statement computed in the file). */\nasync function resolveMemberHost(projectRoot, member, userData, configPatch) {\n\tconst base = (await loadHost(projectRoot, member.host)).host;\n\treturn resolveUserDataPlaceholders({\n\t\t...base,\n\t\trunner: {\n\t\t\t...base.runner,\n\t\t\t...member.runner ?? {}\n\t\t},\n\t\tconfig: {\n\t\t\t...member.config !== void 0 ? member.config : base.config ?? {},\n\t\t\t...configPatch ?? {}\n\t\t},\n\t\treactor: member.reactor !== void 0 ? member.reactor : base.reactor\n\t}, userData);\n}\nfunction isConnectMember(member) {\n\treturn member.host === \"connect\";\n}\nfunction isReactorFactMember(member) {\n\treturn member.host === \"switchboard\";\n}\nasync function runCompound(host, ctx, options) {\n\tconst projectRoot = ctx.projectRoot;\n\tconst wiring = host.config ?? {};\n\tconst verb = ctx.verb;\n\tconst probe = probeRun(projectRoot, host.name, options.projectName);\n\tif (probe.status === \"live\") throw new Error(`${host.name} is already running for this project (pid ${probe.record.pid}). Stop it before starting another.`);\n\tif (probe.status === \"foreign\") throw new Error(`.ph/run/${host.name}.json describes a live \"${probe.record.projectName}\", but this project is \"${options.projectName}\". Refusing to start a second instance.`);\n\tconst userData = defaultUserDataDir(projectRoot, ctx.env);\n\tconst started = [];\n\tconst reactorFacts = { driveUrls: [] };\n\tconst shutdown = async () => {\n\t\tfor (const m of [...started].reverse()) try {\n\t\t\tawait m.handle.shutdown?.();\n\t\t} catch {}\n\t\tif (wiring.runtimeRecord !== false) clearRunRecord(projectRoot, host.name);\n\t};\n\tfor (const [name, member] of orderedMembers(host, wiring)) {\n\t\tlet configPatch;\n\t\tif (isConnectMember(member) && wiring.projectDrivesIntoConnect && reactorFacts.driveUrls.length > 0) {\n\t\t\tconst configuredDefaultDrives = (member.config?.drives)?.defaultDrives;\n\t\t\tconfigPatch = projectDrivesIntoConnect({\n\t\t\t\tcreatedDriveUrls: reactorFacts.driveUrls,\n\t\t\t\tconfiguredDefaultDrives,\n\t\t\t\tpublicBase: wiring.drivesPublicBase\n\t\t\t});\n\t\t}\n\t\tconst memberHost = await resolveMemberHost(projectRoot, member, userData, configPatch);\n\t\tif (isConnectMember(member) && wiring.cspRegistrySync) memberHost.runner = {\n\t\t\t...memberHost.runner,\n\t\t\tcspRegistrySync: true\n\t\t};\n\t\tconst specifier = memberHost.runner.module;\n\t\tconst runner = await resolveRunnerModule(projectRoot, specifier);\n\t\tvalidateHost(runner, specifier, memberHost, `hosts/${member.host}/host.js`);\n\t\tconst handle = await getVerb(runner, specifier, verb === \"run\" ? memberHost.runner.defaultVerb ?? \"run\" : verb)(memberHost, ctx) ?? {};\n\t\tif (handle.ready) await handle.ready;\n\t\tstarted.push({\n\t\t\tname,\n\t\t\thandle\n\t\t});\n\t\tif (isReactorFactMember(member) && handle.driveUrls) reactorFacts.driveUrls.push(...handle.driveUrls);\n\t}\n\tif (wiring.runtimeRecord !== false) {\n\t\tconst members = {};\n\t\tfor (const m of started) members[m.name] = {\n\t\t\tport: m.handle.port,\n\t\t\turl: m.handle.endpoints?.graphql ?? m.handle.endpoints?.connect\n\t\t};\n\t\twriteRunRecord(projectRoot, {\n\t\t\tpid: process.pid,\n\t\t\thostName: host.name,\n\t\t\tprojectName: options.projectName,\n\t\t\tstartedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\tmembers,\n\t\t\textra: options.recordExtra\n\t\t});\n\t}\n\tif (options.installSignalHandlers !== false) {\n\t\tconst onSignal = (code) => {\n\t\t\tshutdown().finally(() => process.exit(code));\n\t\t};\n\t\tprocess.on(\"exit\", () => {\n\t\t\tif (wiring.runtimeRecord !== false) clearRunRecord(projectRoot, host.name);\n\t\t});\n\t\tprocess.on(\"SIGINT\", () => onSignal(130));\n\t\tprocess.on(\"SIGTERM\", () => onSignal(143));\n\t}\n\treturn {\n\t\tstarted,\n\t\tshutdown\n\t};\n}\n//#endregion\n//#region src/drives.ts\n/**\n* R1 — core drive declarations. A reactor without drives is not a running\n* reactor, so declaring + seeding them is HOST RUNTIME work (not a plugin):\n* onReactorReady → idempotent slug-keyed seeding → onDrivesReady. Plugins\n* CONTRIBUTE declarations into the same merged list (Contributions.drives);\n* `--explain drives` prints the merged set with provenance.\n*\n* Field semantics (union of the three existing creation sites — vetra,\n* preview, workflows — plus Connect's PHConnectDefaultDrive):\n* - slug: the SEEDING KEY (idempotence); id optional (stable identity),\n* projectHash derives both from the project path (generateProjectDriveId\n* semantics: `${slug}-${sha256(projectPath).slice(0, 8)}`).\n* - preferredEditor: binds the drive to its drive app — stored at\n* header.meta.preferredEditor; Connect config's `app` is the legacy alias.\n* - remote.url: an attachment to a drive served elsewhere (Connect default\n* drives, switchboard remoteDrives); local fields are ignored for remotes.\n*/\nconst driveDeclarationSchema = z.strictObject({\n\tslug: z.string().min(1),\n\tid: z.string().min(1).optional(),\n\t/** Derive id (and the served slug) from the project path, like\n\t* generateProjectDriveId — same ids classic `ph vetra` produces. */\n\tprojectHash: z.boolean().optional(),\n\tname: z.string().min(1).optional(),\n\ticon: z.string().optional(),\n\tpreferredEditor: z.string().optional(),\n\tsharingType: z.enum([\n\t\t\"public\",\n\t\t\"private\",\n\t\t\"shared\"\n\t]).optional(),\n\tavailableOffline: z.boolean().optional(),\n\tremote: z.strictObject({ url: z.string().min(1) }).optional()\n});\nconst drivesSchema = z.array(driveDeclarationSchema);\nfunction projectDriveId(projectRoot, slug) {\n\treturn `${slug}-${crypto.createHash(\"sha256\").update(projectRoot).digest(\"hex\").substring(0, 8)}`;\n}\nfunction resolveDriveDeclaration(projectRoot, decl) {\n\tconst id = decl.projectHash ? projectDriveId(projectRoot, decl.slug) : decl.id ?? decl.slug;\n\tconst slug = decl.projectHash ? 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\tname: decl.name ?? decl.slug,\n\t\ticon: decl.icon,\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\treturn ` ${drive.slug} (${kind}, id=${drive.id}${editor}) [${source}]`;\n\t})].join(\"\\n\");\n}\n//#endregion\n//#region src/host-schemas.ts\n/**\n* The shared zod schemas for host.js blocks (D2.a). The `reactor` block\n* validates STRICTLY (D2.d — phase 0's tolerated-unknown-keys notice ends\n* here): a typo'd protocol key must fail, not silently not-apply, because\n* these are fleet-consensus settings. `config` stays loose — it is\n* runner-defined by design.\n*/\nconst profileSchema = z.strictObject({\n\tappId: z.string().min(1).optional(),\n\tname: z.string().min(1).optional(),\n\tdescription: z.string().optional(),\n\ticon: z.string().optional()\n}).optional();\nconst reactorProtocolSchema = z.strictObject({\n\tfeatureFlags: z.strictObject({\n\t\tdocumentDecisions: z.boolean().optional(),\n\t\tauthEnforcement: z.boolean().optional(),\n\t\tauthGroups: z.boolean().optional(),\n\t\tauthConditions: z.boolean().optional()\n\t}).optional(),\n\tcreateSignaturePolicy: z.enum([\"legacy\", \"v2-required\"]).optional(),\n\tunsupportedStoredDocuments: z.enum([\"refuse\", \"read-only\"]).optional()\n});\nconst samePath = (a, b) => {\n\tconst norm = (p) => p.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\").replace(/^\\.\\//, \"\");\n\treturn norm(a) === norm(b);\n};\nconst reactorBackendSchema = z.strictObject({\n\tkind: z.enum([\n\t\t\"in-process\",\n\t\t\"worker\",\n\t\t\"remote\"\n\t]).optional(),\n\tstorage: z.strictObject({\n\t\tkind: z.enum([\n\t\t\t\"idb\",\n\t\t\t\"memory\",\n\t\t\t\"path\",\n\t\t\t\"postgres\"\n\t\t]),\n\t\tdataDir: z.string().optional(),\n\t\turl: z.string().optional()\n\t}).optional(),\n\treadModel: z.strictObject({ url: z.string().optional() }).optional(),\n\tpackages: z.strictObject({\n\t\tcdnUrl: z.string().optional(),\n\t\tspecs: z.array(z.string()).optional(),\n\t\tdynamic: z.boolean().optional()\n\t}).optional(),\n\tremote: z.strictObject({\n\t\thost: z.string().optional(),\n\t\turl: z.string().optional()\n\t}).optional(),\n\tprojection: z.strictObject({\n\t\tenabled: z.boolean().optional(),\n\t\tdbPoolSize: z.number().int().positive().optional()\n\t}).optional(),\n\texecutors: z.strictObject({ numWorkers: z.union([z.number().int().positive(), z.literal(\"auto\")]).optional() }).optional()\n}).superRefine((backend, ctx) => {\n\tconst store = backend.storage;\n\tconst storeDir = store?.kind === \"path\" ? store.dataDir : void 0;\n\tconst readModel = backend.readModel?.url;\n\tif (storeDir && readModel && samePath(storeDir, readModel)) ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tpath: [\"readModel\", \"url\"],\n\t\tmessage: `readModel.url must not be the reactor's storage dir (${readModel}): two PGlite instances on one data dir corrupt it. Omit readModel.url to get the classic <root>/.ph/read-storage next to the reactor store.`\n\t});\n});\nconst reactorSchema = z.strictObject({\n\tbackends: z.record(z.string(), reactorBackendSchema).optional(),\n\tplacement: z.strictObject({\n\t\tprimary: z.string().optional(),\n\t\tdefault: z.looseObject({}).optional()\n\t}).optional(),\n\tprotocol: reactorProtocolSchema.optional(),\n\t/** DEPRECATED (dies in R2): workflows become a listed plugin — presence is\n\t* activation. Kept parsing until the switchboard rewire lands. */\n\tworkflows: z.boolean().optional(),\n\trenown: z.strictObject({\n\t\turl: z.string().optional(),\n\t\tnetworkId: z.string().optional(),\n\t\tchainId: z.number().int().optional()\n\t}).optional(),\n\tpackages: z.strictObject({ registryUrl: z.string().optional() }).optional(),\n\tnamespace: z.string().min(1).optional(),\n\tauth: z.strictObject({\n\t\tenabled: z.boolean().optional(),\n\t\tadmins: z.array(z.string()).optional(),\n\t\trenown: z.looseObject({}).optional()\n\t}).optional(),\n\tdrives: drivesSchema.optional()\n});\n/** Common runner options every host.runner carries; runner modules extend it\n* loosely with their own process options. */\nconst runnerBaseSchema = z.looseObject({\n\tmodule: z.string().min(1),\n\tdefaultVerb: z.string().optional(),\n\tport: z.number().int().positive().optional(),\n\t/** Bind address; each runner documents its default (0.0.0.0 for servers,\n\t* localhost for vite dev, 127.0.0.1 for serve). */\n\thost: z.string().min(1).optional(),\n\t/** THE COMPOSITION: the plugin entries this host boots with. Presence is\n\t* activation; see plugins.ts for entry semantics. */\n\tplugins: z.array(pluginEntrySchema).optional()\n});\n/** A compound's children map (mutually exclusive with `reactor` — the XOR is\n* structural, enforced by the loader; schemas validate each side's shape). */\nconst childrenSchema = z.record(z.string(), z.strictObject({\n\thost: z.string().min(1),\n\trunner: z.looseObject({}).optional(),\n\tconfig: z.looseObject({}).optional(),\n\treactor: reactorSchema.optional()\n}));\n/** Composed generic host shapes — the basis for the emitted editor schemas\n* (D2.a). Runner packages extend these with their own runner options; `config`\n* stays loose by design. */\nconst reactorHostSchema = z.looseObject({\n\tname: z.string().min(1),\n\trunner: runnerBaseSchema,\n\tconfig: z.looseObject({}).optional(),\n\tprofile: profileSchema,\n\treactor: reactorSchema.optional()\n});\nconst compoundHostSchema = z.looseObject({\n\tname: z.string().min(1),\n\trunner: runnerBaseSchema,\n\tchildren: childrenSchema,\n\tconfig: z.looseObject({}).optional(),\n\tprofile: profileSchema\n});\nconst SCHEMA_BASE = \"https://powerhouse.inc/schemas\";\n/** The emitted-schema set, keyed by published filename. Pure — the\n* emit-schemas script writes these to disk and the drift test re-derives\n* them, per the runtime-config-schema pattern. */\nfunction emittedHostSchemas() {\n\tconst emit = (name, schema) => ({\n\t\t$id: `${SCHEMA_BASE}/${name}.schema.json`,\n\t\t...z.toJSONSchema(schema, { io: \"input\" })\n\t});\n\treturn {\n\t\t\"host-reactor.schema.json\": emit(\"host-reactor\", reactorHostSchema),\n\t\t\"host-compound.schema.json\": emit(\"host-compound\", compoundHostSchema)\n\t};\n}\n//#endregion\nexport { HostLoadError as A, readRunRecord as C, listVerbs as D, getVerb as E, mergeDefaultDrives as F, projectDrivesIntoConnect as I, rebaseDriveUrl as L, lintHostImports as M, loadHost as N, resolveRunnerModule as O, probeHostsFolder as P, probeRun as S, RunnerError as T, runCompound as _, reactorBackendSchema as a, clearRunRecord as b, reactorSchema as c, drivesSchema as d, explainDrivePlan as f, seedDrives as g, resolveDriveDeclaration as h, profileSchema as i, findNonStaticValue as j, validateHost as k, runnerBaseSchema as l, projectDriveId as m, compoundHostSchema as n, reactorHostSchema as o, mergeDrivePlan as p, emittedHostSchemas as r, reactorProtocolSchema as s, childrenSchema as t, driveDeclarationSchema as u, defaultUserDataDir as v, writeRunRecord as w, isPidAlive as x, resolveUserDataPlaceholders as y };\n\n//# sourceMappingURL=host-schemas-CtPNRr5v.mjs.map"],"names":["z.strictObject","z.string","z.boolean","z.enum","z.array","z.number","z.union","z.literal","z.record","z.looseObject"],"mappings":";;;;;;;;;;;;;;;;;AAeA,SAAS,aAAa,OAAO;CAC5B,OAAO,WAAW;AACnB;AACA,MAAM,YAAY,UAAU,aAAa,KAAK,IAAI,SAAS,MAAM,OAAO,MAAM;;;;;;;;AAQ9E,SAAS,mBAAmB,GAAG,QAAQ;CACtC,MAAM,uBAAuB,IAAI,IAAI;CACrC,MAAM,MAAM,CAAC;CACb,KAAK,MAAM,SAAS,QAAQ,KAAK,MAAM,SAAS,OAAO;EACtD,MAAM,MAAM,SAAS,KAAK;EAC1B,IAAI,KAAK,IAAI,GAAG,GAAG;EACnB,KAAK,IAAI,GAAG;EACZ,IAAI,KAAK,KAAK;CACf;CACA,OAAO;AACR;;;;;;;;AAQA,SAAS,eAAe,UAAU,YAAY;CAC7C,IAAI;CACJ,IAAI;EACH,MAAM,IAAI,IAAI,QAAQ;CACvB,QAAQ;EACP,OAAO;CACR;CACA,IAAI,CAAC;EACJ;EACA;EACA;CACD,CAAC,CAAC,SAAS,IAAI,QAAQ,GAAG,OAAO;CACjC,OAAO,GAAG,WAAW,QA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