@powerhousedao/ph-cli 6.2.3-dev.70 → 6.2.3-dev.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/{cli-connect-override-Cf7WutqU.mjs → cli-connect-override-CEJhQWRX.mjs} +5 -5
  2. package/dist/cli-connect-override-CEJhQWRX.mjs.map +1 -0
  3. package/dist/cli.mjs +4 -4
  4. package/dist/compound-B6RZMA0Y-Cv3XMQ3Y.mjs +2459 -0
  5. package/dist/compound-B6RZMA0Y-Cv3XMQ3Y.mjs.map +1 -0
  6. package/dist/{connect-build-BtKpvcQK.mjs → connect-build-BfhOGbha.mjs} +4 -4
  7. package/dist/{connect-build-BtKpvcQK.mjs.map → connect-build-BfhOGbha.mjs.map} +1 -1
  8. package/dist/{connect-config-9EZB_0H_.mjs → connect-config-DblqJgxR.mjs} +4 -4
  9. package/dist/{connect-config-9EZB_0H_.mjs.map → connect-config-DblqJgxR.mjs.map} +1 -1
  10. package/dist/connect-plugin-configs-D2fwYpMw.mjs +50 -0
  11. package/dist/connect-plugin-configs-D2fwYpMw.mjs.map +1 -0
  12. package/dist/{connect-studio-Bhlc77WI.mjs → connect-studio-B1_4TNEb.mjs} +8 -6
  13. package/dist/connect-studio-B1_4TNEb.mjs.map +1 -0
  14. package/dist/{connect-studio-BehPZzN7.mjs → connect-studio-BS26pchr.mjs} +3 -3
  15. package/dist/{dist-BqeDFgEy.mjs → dist-CCLkwpTS.mjs} +199 -109
  16. package/dist/dist-CCLkwpTS.mjs.map +1 -0
  17. package/dist/explain-DUXbB9jf.mjs +241 -0
  18. package/dist/explain-DUXbB9jf.mjs.map +1 -0
  19. package/dist/{generate-all-C_sPGBuk.mjs → generate-all-Dgyy_kT-.mjs} +7 -3
  20. package/dist/generate-all-Dgyy_kT-.mjs.map +1 -0
  21. package/dist/{generate-desktop-shell-BBSGpmud.mjs → generate-desktop-shell-BdXDiS5o.mjs} +113 -7
  22. package/dist/generate-desktop-shell-BdXDiS5o.mjs.map +1 -0
  23. package/dist/generate-hosts-BFmPIW2X.mjs +18 -0
  24. package/dist/generate-hosts-BFmPIW2X.mjs.map +1 -0
  25. package/dist/generate-hosts-RWj7WPHZ.mjs +4 -0
  26. package/dist/{index-CspiP73o.d.mts → index-BIbx17vt.d.mts} +178 -14
  27. package/dist/index-BIbx17vt.d.mts.map +1 -0
  28. package/dist/{ph-cli-commands-3ptdQ0NI.mjs → ph-cli-commands-DSAhaETu.mjs} +156 -139
  29. package/dist/ph-cli-commands-DSAhaETu.mjs.map +1 -0
  30. package/dist/ph-cli-commands-d5XjMWW0.mjs +4 -0
  31. package/dist/{run-sugar-BdjKTPGO.mjs → run-sugar-Ns53R6lU.mjs} +4 -4
  32. package/dist/{run-sugar-BdjKTPGO.mjs.map → run-sugar-Ns53R6lU.mjs.map} +1 -1
  33. package/dist/runners/connect.d.mts +1054 -26
  34. package/dist/runners/connect.d.mts.map +1 -1
  35. package/dist/runners/connect.mjs +127 -50
  36. package/dist/runners/connect.mjs.map +1 -1
  37. package/dist/runners/switchboard.d.mts +170 -28
  38. package/dist/runners/switchboard.d.mts.map +1 -1
  39. package/dist/runners/switchboard.mjs +171 -49
  40. package/dist/runners/switchboard.mjs.map +1 -1
  41. package/dist/{schemas-BQSPev1x.mjs → schemas-D5N5U_Mf.mjs} +205 -4
  42. package/dist/{schemas-BQSPev1x.mjs.map → schemas-D5N5U_Mf.mjs.map} +1 -1
  43. package/dist/scripts/emit-runner-schemas.ts +24 -0
  44. package/dist/start-run-BIaYSpHh.mjs +124 -0
  45. package/dist/start-run-BIaYSpHh.mjs.map +1 -0
  46. package/dist/{superseded-config-9D7BdLvd.mjs → superseded-config-CbSTFun2.mjs} +4 -4
  47. package/dist/superseded-config-CbSTFun2.mjs.map +1 -0
  48. package/dist/switchboard-h4-XgP1h.mjs +2 -2
  49. package/dist/switchboard-h4-XgP1h.mjs.map +1 -1
  50. package/dist/utils-DAux4Ga7.mjs +4 -0
  51. package/dist/{vetra-BD-34wGs.mjs → vetra-UQsfYM_Q.mjs} +10 -10
  52. package/dist/vetra-UQsfYM_Q.mjs.map +1 -0
  53. package/package.json +15 -20
  54. package/dist/cli-connect-override-Cf7WutqU.mjs.map +0 -1
  55. package/dist/connect-studio-Bhlc77WI.mjs.map +0 -1
  56. package/dist/dist-BqeDFgEy.mjs.map +0 -1
  57. package/dist/explain-BDHmXgw3.mjs +0 -27
  58. package/dist/explain-BDHmXgw3.mjs.map +0 -1
  59. package/dist/generate-all-C_sPGBuk.mjs.map +0 -1
  60. package/dist/generate-desktop-shell-BBSGpmud.mjs.map +0 -1
  61. package/dist/host-schemas-CtPNRr5v-BQyKKFbS.mjs +0 -493
  62. package/dist/host-schemas-CtPNRr5v-BQyKKFbS.mjs.map +0 -1
  63. package/dist/index-CspiP73o.d.mts.map +0 -1
  64. package/dist/ph-cli-commands-3ptdQ0NI.mjs.map +0 -1
  65. package/dist/ph-cli-commands-Dx8hNj6W.mjs +0 -4
  66. package/dist/plugins-CHVv4qup.mjs +0 -91
  67. package/dist/plugins-CHVv4qup.mjs.map +0 -1
  68. package/dist/reactor-env-BbR86_Li.mjs +0 -29
  69. package/dist/reactor-env-BbR86_Li.mjs.map +0 -1
  70. package/dist/reactor-env-D_EvBtLB.mjs +0 -4
  71. package/dist/runners/compound.d.mts +0 -127
  72. package/dist/runners/compound.d.mts.map +0 -1
  73. package/dist/runners/compound.mjs +0 -72
  74. package/dist/runners/compound.mjs.map +0 -1
  75. package/dist/start-run-CmDxyMw0.mjs +0 -36
  76. package/dist/start-run-CmDxyMw0.mjs.map +0 -1
  77. package/dist/superseded-config-9D7BdLvd.mjs.map +0 -1
  78. package/dist/utils-TO9lB8Xs.mjs +0 -4
  79. package/dist/vetra-BD-34wGs.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compound-B6RZMA0Y-Cv3XMQ3Y.mjs","sources":["../../../packages/host-core/dist/compound-B6RZMA0Y.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { createHash } from \"node:crypto\";\nimport fs, { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { z } from \"zod\";\nimport { TOKEN_ESCAPE_KEY, TOKEN_KEYS, concatTokenSchema, envTokenSchema, envTokenable, findToken, forbidRef, isToken, itemTokenSchema, keyTokenSchema, mapTokenSchema, outputTokenSchema, ref, tokenKeyOf, tokenSchema, tokenable } from \"@powerhousedao/shared/host-tokens\";\nimport { resolvePhDir } from \"@powerhousedao/shared/clis/ph-dir\";\n//#region src/plugins.ts\n/**\n* R1 — the host plugin framework (bridge-runners-to-plugins plan,\n* customization-references/host-core as the blueprint).\n*\n* A plugin is hooks + contributions; hooks are boot wiring (main realm only),\n* contributions are declarative, serializable surface. Host RUNTIMES define\n* the hook vocabulary and interleave their own wiring between stages — they\n* are never plugins themselves.\n*\n* host.js carries the COMPOSITION as `runner.plugins` entries:\n* string | { module, enabled?, verbs?, config? }\n* Presence is activation (enabled defaults true); `verbs` scopes an entry to\n* matching run verbs; `config` is validated against the plugin's declared\n* zod schema. Entries resolve from the PROJECT's dependency tree exactly\n* like runner modules.\n*/\nvar PluginError = class extends Error {\n\tconstructor(message, hint) {\n\t\tsuper(hint ? `${message}\\n Hint: ${hint}` : message);\n\t\tthis.name = \"PluginError\";\n\t}\n};\nconst pluginEntryObjectSchema = z.strictObject({\n\tmodule: z.string().min(1),\n\t/** Presence is activation BY DEFAULT; false is the explicit off-switch. */\n\tenabled: z.boolean().optional(),\n\t/** \"*\" (default) or the run verbs this entry is active for. */\n\tverbs: z.union([z.literal(\"*\"), z.array(z.string().min(1)).min(1)]).optional(),\n\t/** Validated against the plugin's declared configSchema at resolution. */\n\tconfig: z.record(z.string(), z.unknown()).optional()\n});\nconst pluginEntrySchema = z.union([z.string().min(1), pluginEntryObjectSchema]);\nfunction normalizePluginEntry(entry) {\n\tif (typeof entry === \"string\") return {\n\t\tmodule: entry,\n\t\tenabled: true,\n\t\tverbs: \"*\",\n\t\tconfig: {}\n\t};\n\treturn {\n\t\tmodule: entry.module,\n\t\tenabled: entry.enabled ?? true,\n\t\tverbs: entry.verbs ?? \"*\",\n\t\tconfig: entry.config ?? {}\n\t};\n}\n/** Module is the identity key: a duplicate makes override targeting and\n* ordering ambiguous, so it fails loudly. */\nfunction normalizePluginEntries(entries, where) {\n\tconst normalized = entries.map(normalizePluginEntry);\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const entry of normalized) {\n\t\tif (seen.has(entry.module)) throw new PluginError(`${where}: plugin \"${entry.module}\" is listed twice.`, \"Module specifiers are the identity key of a composition; a plugin meant to run twice needs distinct subpath specifiers.\");\n\t\tseen.add(entry.module);\n\t}\n\treturn normalized;\n}\nfunction entryActiveForVerb(entry, verb) {\n\tif (!entry.enabled) return false;\n\treturn entry.verbs === \"*\" || entry.verbs.includes(verb);\n}\n/**\n* The appliesTo hierarchy. \"reactor\" is the base every reactor host extends;\n* \"compound\" is its own branch (plugins over the member set — e.g. the clint\n* proxy). Host runtimes register their id with a parent; compatibility walks\n* the parent chain.\n*/\nconst HOST_TYPE_PARENTS = {\n\treactor: null,\n\tcompound: null,\n\tconnect: \"reactor\",\n\tswitchboard: \"reactor\",\n\tmastra: \"reactor\"\n};\nfunction registerHostType(id, parent) {\n\tif (id in HOST_TYPE_PARENTS && HOST_TYPE_PARENTS[id] !== parent) throw new PluginError(`Host type \"${id}\" is already registered with parent \"${String(HOST_TYPE_PARENTS[id])}\".`);\n\tHOST_TYPE_PARENTS[id] = parent;\n}\nfunction hostTypeSatisfies(hostType, appliesTo) {\n\tlet current = hostType;\n\twhile (current !== null) {\n\t\tif (current === appliesTo) return true;\n\t\tcurrent = current in HOST_TYPE_PARENTS ? HOST_TYPE_PARENTS[current] : null;\n\t}\n\treturn false;\n}\n/** Registration order, bucketed pre → normal → post (stable within buckets),\n* then dependsOn topo-sorted within the bucketed order. */\nfunction resolveOrder(plugins) {\n\tconst buckets = {\n\t\tpre: [],\n\t\tnormal: [],\n\t\tpost: []\n\t};\n\tfor (const plugin of plugins) buckets[plugin.enforce ?? \"normal\"].push(plugin);\n\tconst bucketed = [\n\t\t...buckets.pre,\n\t\t...buckets.normal,\n\t\t...buckets.post\n\t];\n\tconst byName = new Map(bucketed.map((p) => [p.name, p]));\n\tfor (const plugin of bucketed) for (const dep of plugin.dependsOn ?? []) if (!byName.has(dep)) throw new PluginError(`Plugin \"${plugin.name}\" depends on missing plugin \"${dep}\".`, \"dependsOn names PLUGINS only — the host runtime is implied and never named.\");\n\tconst ordered = [];\n\tconst state = /* @__PURE__ */ new Map();\n\tconst visit = (plugin, chain) => {\n\t\tconst mark = state.get(plugin.name);\n\t\tif (mark === \"done\") return;\n\t\tif (mark === \"visiting\") throw new PluginError(`Plugin dependency cycle: ${[...chain, plugin.name].join(\" -> \")}.`);\n\t\tstate.set(plugin.name, \"visiting\");\n\t\tfor (const dep of plugin.dependsOn ?? []) visit(byName.get(dep), [...chain, plugin.name]);\n\t\tstate.set(plugin.name, \"done\");\n\t\tordered.push(plugin);\n\t};\n\tfor (const plugin of bucketed) visit(plugin, []);\n\treturn ordered;\n}\nasync function runProvideHook(name, plugins, ctx) {\n\tconst impls = plugins.filter((p) => typeof p.hooks?.[name] === \"function\");\n\tif (impls.length > 1) throw new PluginError(`Hook \"${name}\" is provided by ${impls.map((p) => `\"${p.name}\"`).join(\" and \")} — provide hooks have one winner.`);\n\tconst impl = impls[0]?.hooks?.[name];\n\treturn impl ? await impl(ctx) : void 0;\n}\nasync function runTransformHook(name, plugins, ctx, seed) {\n\tlet value = seed;\n\tfor (const plugin of plugins) {\n\t\tconst impl = plugin.hooks?.[name];\n\t\tif (typeof impl === \"function\") value = await impl(value, ctx);\n\t}\n\treturn value;\n}\n/** Sequential observe, in plugin order — for lifecycle moments whose order\n* is load-bearing (teardown: the switchboard stops privacy before workflows\n* before the api, per the carve map). */\nasync function runObserveHookSequential(name, plugins, ctx) {\n\tfor (const plugin of plugins) {\n\t\tconst impl = plugin.hooks?.[name];\n\t\tif (typeof impl === \"function\") await impl(ctx);\n\t}\n}\nasync function runObserveHook(name, plugins, ctx) {\n\tawait Promise.all(plugins.map(async (plugin) => {\n\t\tconst impl = plugin.hooks?.[name];\n\t\tif (typeof impl === \"function\") await impl(ctx);\n\t}));\n}\n/** Array kinds concatenate in provenance-then-order sequence (built-in first,\n* so later sources read as overrides where consumers want last-wins). */\nfunction mergeContributions(resolved) {\n\tconst rank = {\n\t\t\"built-in\": 0,\n\t\tlocal: 1,\n\t\tdependency: 2\n\t};\n\tconst sorted = [...resolved].sort((a, b) => rank[a.provenance] - rank[b.provenance]);\n\tconst merged = {};\n\tfor (const { plugin, provenance } of sorted) for (const [kind, values] of Object.entries(plugin.contributions ?? {})) {\n\t\tif (!values) continue;\n\t\tconst bucket = merged[kind] ??= [];\n\t\tfor (const value of values) bucket.push({\n\t\t\tvalue,\n\t\t\tsource: {\n\t\t\t\tpluginName: plugin.name,\n\t\t\t\tprovenance\n\t\t\t}\n\t\t});\n\t}\n\treturn merged;\n}\n//#endregion\n//#region src/plugins-resolve.ts\n/**\n* NODE-ONLY plugin resolution (split from plugins.ts so the pure runner core\n* stays browser-safe for ConnectCore — R3). Resolves host.js entries from the\n* PROJECT dependency tree, exactly like runner modules.\n*/\nfunction isHostPluginShape(value) {\n\treturn value !== null && typeof value === \"object\" && typeof value.name === \"string\";\n}\n/**\n* Resolve host.js plugin entries into live plugins for one host boot:\n* verb-filter → module resolution from the project tree (default condition,\n* like runners) → factory/object contract → config validation → appliesTo.\n*/\nasync function resolveHostPlugins(projectRoot, hostType, verb, entries, where) {\n\tconst normalized = normalizePluginEntries(entries, where);\n\tconst projectRequire = createRequire(pathToFileURL(path.join(projectRoot, \"package.json\")).href);\n\tconst resolved = [];\n\tfor (const entry of normalized) {\n\t\tif (!entryActiveForVerb(entry, verb)) continue;\n\t\tlet file;\n\t\ttry {\n\t\t\tfile = projectRequire.resolve(entry.module);\n\t\t} catch {\n\t\t\tthrow new PluginError(`${where}: cannot resolve plugin \"${entry.module}\" from ${projectRoot}.`, \"Plugins resolve from the project dependency tree, exactly like runner modules.\");\n\t\t}\n\t\tconst exported = (await import(pathToFileURL(file).href)).default;\n\t\tlet plugin;\n\t\tif (typeof exported === \"function\") plugin = exported(entry.config);\n\t\telse if (isHostPluginShape(exported)) {\n\t\t\tif (Object.keys(entry.config).length > 0 && !exported.configSchema) throw new PluginError(`${where}: plugin \"${entry.module}\" takes no config, but the entry passes one.`);\n\t\t\tplugin = exported;\n\t\t} else throw new PluginError(`${where}: \"${entry.module}\" does not default-export a plugin object or factory.`, \"Export `{ name, hooks?, contributions? }` or `(config) => plugin`.\");\n\t\tif (plugin.configSchema) {\n\t\t\tconst parsed = plugin.configSchema.safeParse(entry.config);\n\t\t\tif (!parsed.success) throw new PluginError(`${where}: config for plugin \"${plugin.name}\" is invalid:\\n` + z.prettifyError(parsed.error));\n\t\t}\n\t\tconst appliesTo = plugin.appliesTo ?? \"reactor\";\n\t\tif (!hostTypeSatisfies(hostType, appliesTo)) throw new PluginError(`${where}: plugin \"${plugin.name}\" applies to \"${appliesTo}\" hosts, but this host is \"${hostType}\".`);\n\t\tresolved.push({\n\t\t\tentry,\n\t\t\tplugin,\n\t\t\tprovenance: \"dependency\"\n\t\t});\n\t}\n\treturn resolved;\n}\n/**\n* LENIENT resolution for diagnostics (`ph run <host> --explain drives`):\n* collects the drive contributions of the entries active for `verb`. Unlike\n* resolveHostPlugins it does not know the host type (so appliesTo is not\n* checked) and does not fail on a specifier the project tree cannot resolve\n* — the entry is listed under `unresolved` instead. Config is still validated\n* against the plugin's schema, so a bad entry surfaces here too.\n*/\nasync function resolvePluginContributions(projectRoot, verb, entries, where) {\n\tconst normalized = normalizePluginEntries(entries, where);\n\tconst projectRequire = createRequire(pathToFileURL(path.join(projectRoot, \"package.json\")).href);\n\tconst plan = {\n\t\tdrives: [],\n\t\tunresolved: []\n\t};\n\tfor (const entry of normalized) {\n\t\tif (!entryActiveForVerb(entry, verb)) continue;\n\t\tlet file;\n\t\ttry {\n\t\t\tfile = projectRequire.resolve(entry.module);\n\t\t} catch {\n\t\t\tplan.unresolved.push(entry.module);\n\t\t\tcontinue;\n\t\t}\n\t\tconst exported = (await import(pathToFileURL(file).href)).default;\n\t\tlet plugin;\n\t\tif (typeof exported === \"function\") plugin = exported(entry.config);\n\t\telse if (isHostPluginShape(exported)) plugin = exported;\n\t\telse {\n\t\t\tplan.unresolved.push(entry.module);\n\t\t\tcontinue;\n\t\t}\n\t\tif (plugin.configSchema) {\n\t\t\tconst parsed = plugin.configSchema.safeParse(entry.config);\n\t\t\tif (!parsed.success) throw new PluginError(`${where}: config for plugin \"${plugin.name}\" is invalid:\\n` + z.prettifyError(parsed.error));\n\t\t}\n\t\tfor (const declaration of plugin.contributions?.drives ?? []) plan.drives.push({\n\t\t\tdeclaration,\n\t\t\tsource: plugin.name\n\t\t});\n\t}\n\treturn plan;\n}\n/**\n* The connect config slices each built-in Connect plugin owns, by specifier\n* (typed-host-configs 1.6). Under a declared composition Connect zeroes a\n* slice whose plugin is absent — presence is activation — so an authored\n* value there is dead config. Connect's built-ins are browser modules with no\n* Node-resolvable identity, so their ownership is declared here as data; a\n* Connect test pins it to plugin-host's zeroing.\n*/\nconst CONNECT_PLUGIN_OWNED_SLICES = {\n\t\"@powerhousedao/connect/plugins/generic\": { slices: [\n\t\t{\n\t\t\tpath: \"drives.allowAddDrive\",\n\t\t\tabsent: false,\n\t\t\tentryKey: \"allowAddDrive\"\n\t\t},\n\t\t{\n\t\t\tpath: \"drives.sections\",\n\t\t\tabsent: {\n\t\t\t\tremote: {\n\t\t\t\t\tenabled: false,\n\t\t\t\t\tallowAdd: false,\n\t\t\t\t\tallowDelete: false\n\t\t\t\t},\n\t\t\t\tlocal: {\n\t\t\t\t\tenabled: false,\n\t\t\t\t\tallowAdd: false,\n\t\t\t\t\tallowDelete: false\n\t\t\t\t}\n\t\t\t},\n\t\t\tentryKey: \"sections\"\n\t\t},\n\t\t{\n\t\t\tpath: \"drives.icons\",\n\t\t\tabsent: null,\n\t\t\tentryKey: \"icons\"\n\t\t},\n\t\t{\n\t\t\tpath: \"home.background\",\n\t\t\tabsent: null,\n\t\t\tentryKey: \"homeBackground\"\n\t\t}\n\t] },\n\t\"@powerhousedao/connect/plugins/sentry\": { slices: [{\n\t\tpath: \"sentry.dsn\",\n\t\tabsent: null,\n\t\tentryKey: \"dsn\"\n\t}] },\n\t\"@powerhousedao/connect/plugins/openpanel\": {\n\t\tslices: [\n\t\t\t{\n\t\t\t\tpath: \"openPanel.clientId\",\n\t\t\t\tabsent: \"\",\n\t\t\t\tentryKey: \"clientId\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: \"openPanel.trackUiEvents\",\n\t\t\t\tabsent: false,\n\t\t\t\tentryKey: \"trackUiEvents\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: \"openPanel.trackOperations\",\n\t\t\t\tabsent: false,\n\t\t\t\tentryKey: \"trackOperations\"\n\t\t\t}\n\t\t],\n\t\tinertUnless: \"openPanel.clientId\"\n\t},\n\t\"@powerhousedao/connect/plugins/assistant\": { slices: [{\n\t\tpath: \"ai.assistantEnabled\",\n\t\tabsent: false\n\t}] },\n\t\"@powerhousedao/vetra-studio/connect\": { slices: [{\n\t\tpath: \"app.studioMode\",\n\t\tabsent: false\n\t}] },\n\t\"@powerhousedao/connect/plugins/workflows\": { slices: [{\n\t\tpath: \"app.workflowsEnabled\",\n\t\tabsent: false\n\t}] }\n};\nfunction valueAt$1(root, dotted) {\n\tlet current = root;\n\tfor (const key of dotted.split(\".\")) {\n\t\tif (current === null || typeof current !== \"object\") return void 0;\n\t\tcurrent = current[key];\n\t}\n\treturn current;\n}\n/** Whether Connect already serves what the author wrote: every authored leaf\n* equals the served one. An unset leaf asks for nothing, so a partial object\n* (`sections: { remote: { enabled: false } }`) is satisfied by the zeroed\n* slice. */\nfunction alreadyServed(authored, served) {\n\tif (authored === void 0 || Object.is(authored, served)) return true;\n\tif (authored === null || served === null || typeof authored !== \"object\" || typeof served !== \"object\" || Array.isArray(authored) !== Array.isArray(served)) return false;\n\tif (Array.isArray(authored) && authored.length !== served.length) return false;\n\tconst want = authored;\n\tconst have = served;\n\treturn Object.keys(want).every((key) => alreadyServed(want[key], have[key]));\n}\n/**\n* Dead-config warnings for a Connect host (typed-host-configs 1.6): an\n* authored connect config value whose owning plugin is not in the\n* composition active for `verb`. Connect zeroes such a slice, so the value\n* has no effect — e.g. Sektar's `connect.drives.allowAddDrive: true` without\n* the generic plugin.\n*\n* Nothing is reported when the host declares no composition\n* (`runner.plugins` absent: the classic boot serves the config as is), or\n* when Connect already serves every leaf of the authored value. Warnings, not\n* errors: the host still boots, it just does not do what the value says.\n*/\nfunction findDeadConnectConfig(config, entries, verb, where) {\n\tif (!config || entries === void 0) return [];\n\tconst active = new Set(normalizePluginEntries(entries, where).filter((entry) => entryActiveForVerb(entry, verb)).map((entry) => entry.module));\n\tconst warnings = [];\n\tfor (const [owner, { slices, inertUnless }] of Object.entries(CONNECT_PLUGIN_OWNED_SLICES)) {\n\t\tif (active.has(owner)) continue;\n\t\tif (inertUnless !== void 0) {\n\t\t\tconst gate = slices.find((slice) => slice.path === inertUnless);\n\t\t\tif (alreadyServed(valueAt$1(config, inertUnless), gate?.absent)) continue;\n\t\t}\n\t\tfor (const { path: slicePath, absent, entryKey } of slices) {\n\t\t\tconst value = valueAt$1(config, slicePath);\n\t\t\tif (alreadyServed(value, absent)) continue;\n\t\t\tconst move = entryKey === void 0 ? `compose \"${owner}\" (presence is the switch)` : `compose \"${owner}\" and set \\`${entryKey}\\` in its entry config`;\n\t\t\twarnings.push({\n\t\t\t\tpath: slicePath,\n\t\t\t\tvalue,\n\t\t\t\tserved: absent,\n\t\t\t\towner,\n\t\t\t\tmessage: `${where}: config.${slicePath} is dead config: it is owned by plugin \"${owner}\", which this host does not compose for verb \"${verb}\", so Connect serves ${JSON.stringify(absent)} instead of ${JSON.stringify(value)}.\\n Hint: ${move}, or delete the value.`\n\t\t\t});\n\t\t}\n\t}\n\treturn warnings;\n}\n//#endregion\n//#region src/drive-schema.ts\n/**\n* The schema half of drives.ts, zod only so `./schema` stays neutral.\n* - slug: the SEEDING KEY (idempotence); id optional (stable identity).\n* - preferredEditor: stored at header.meta.preferredEditor; Connect config's\n* `app` is the legacy alias.\n* - remote.url: a drive served elsewhere; local fields are ignored for it.\n* Token-able (`$output` on a producer's `drives.<slug>.url`).\n*/\nfunction buildDriveDeclarationSchema(urlField) {\n\treturn z.strictObject({\n\t\tslug: z.string().min(1),\n\t\tid: z.string().min(1).optional(),\n\t\t/** Derive the id from the project path, like generateProjectDriveId — the\n\t\t* same ids classic `ph vetra` produces. `true` serves the drive under the\n\t\t* hashed slug too (the vetra drive's slug IS its hashed id); `\"id\"` hashes\n\t\t* only the id and keeps the declared slug (the classic Workflows drive:\n\t\t* `/d/workflows`, id `workflows-<hash>`). */\n\t\tprojectHash: z.union([z.boolean(), z.literal(\"id\")]).optional(),\n\t\tname: z.string().min(1).optional(),\n\t\ticon: z.string().optional(),\n\t\tpreferredEditor: z.string().optional(),\n\t\tsharingType: z.enum([\n\t\t\t\"public\",\n\t\t\t\"private\",\n\t\t\t\"shared\"\n\t\t]).optional(),\n\t\tavailableOffline: z.boolean().optional(),\n\t\tremote: z.strictObject({ url: urlField(z.string().min(1)) }).optional()\n\t});\n}\nconst driveDeclarationSchema = buildDriveDeclarationSchema(tokenable);\nconst drivesSchema = z.array(driveDeclarationSchema);\n/** The project-hashed drive id (`${slug}-${sha256(projectRoot)[0..8]}`) with\n* the hash function injected, so neutral consumers (a browser monitor) can\n* pass `crypto.subtle`-derived or precomputed hex. drives.ts binds it to\n* node:crypto as `projectDriveId`. */\nfunction projectDriveIdWith(sha256Hex, projectRoot, slug) {\n\treturn `${slug}-${sha256Hex(projectRoot).substring(0, 8)}`;\n}\n//#endregion\n//#region src/host-schemas.ts\n/**\n* The zod single source for host.js blocks (typed-host-configs G1). Every\n* host type is z.input/z.output of these schemas; nothing is hand-mirrored.\n* Top-level host objects and the `reactor` block are STRICT (a typo fails);\n* `runner` stays loose until each runner declares its options (T2), and\n* `config` is runner-defined.\n*\n* Token-able fields (typed-host-configs 3.5): `reactor.backends.*.remote.url`\n* (required), `reactor.drives` (whole list, e.g. `$map`),\n* `reactor.drives[].remote.url` and `storage.dataDir` (`$env` only). Their z.input admits tokens, their z.output is the resolved type.\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});\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 runnerKindSchema = z.enum([\"reactor\", \"compound\"]);\nconst reactorBackendKindSchema = z.enum([\n\t\"in-process\",\n\t\"worker\",\n\t\"remote\"\n]);\nconst samePath = (a, b) => {\n\tconst norm = (p) => p.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\").replace(/^\\.\\//, \"\");\n\treturn norm(a) === norm(b);\n};\n/** Compound wiring: the generic compound runner's `config` block.\n* (`projectDrivesIntoConnect` and `drivesPublicBase` were removed in T3: a\n* member consumes another member's drives through `$output` tokens.) */\nconst compoundWiringSchema = z.strictObject({\n\t/** Member start order; must name declared children and agree with the\n\t* output-token dependencies (resolve/plan.ts). Optional: without it the\n\t* order is derived from the tokens. Unnamed members start after the named\n\t* ones, in declaration order. */\n\tstartOrder: z.array(z.string().min(1)).optional(),\n\t/** Write .ph/run/<host>.json (default true). */\n\truntimeRecord: z.boolean().optional(),\n\t/** Patch the baked CSP for the runtime registry on a served Connect\n\t* member (forwarded as `runner.cspRegistrySync` to every member whose\n\t* runner is `@powerhousedao/ph-cli/runners/connect`). */\n\tcspRegistrySync: z.boolean().optional()\n});\n/** `config.startOrder ⊆ keys(children)`, checked where both are visible.\n* Apply it LAST (`.superRefine(refineStartOrder)`) to a runner's final host\n* schema: zod refuses to `.extend()` a refined object. */\nfunction refineStartOrder(host, ctx) {\n\tconst startOrder = host.config?.startOrder;\n\tif (!Array.isArray(startOrder)) return;\n\tconst members = Object.keys(host.children);\n\tstartOrder.forEach((name, index) => {\n\t\tif (startOrder.indexOf(name) !== index) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: \"custom\",\n\t\t\t\tpath: [\n\t\t\t\t\t\"config\",\n\t\t\t\t\t\"startOrder\",\n\t\t\t\t\tindex\n\t\t\t\t],\n\t\t\t\tmessage: `startOrder names \"${String(name)}\" twice; each member starts once.`\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (typeof name === \"string\" && members.includes(name)) return;\n\t\tctx.addIssue({\n\t\t\tcode: \"custom\",\n\t\t\tpath: [\n\t\t\t\t\"config\",\n\t\t\t\t\"startOrder\",\n\t\t\t\tindex\n\t\t\t],\n\t\t\tmessage: `startOrder names \"${String(name)}\", which is not a member. Members: ${members.join(\", \") || \"(none)\"}.`\n\t\t});\n\t});\n}\nconst ALLOW_TOKENS = {\n\tany: tokenable,\n\tenv: envTokenable\n};\nconst FORBID_TOKENS = {\n\tany: (schema) => z.union([schema]),\n\tenv: (schema) => z.union([schema])\n};\n/**\n* Builds the host schema set. \"allow\" (declared form) accepts `T | Token` in\n* every token-able field; \"forbid\" (resolved form) accepts `T` only.\n*/\nfunction buildHostSchemas(tokenField) {\n\tconst reactorBackendSchema = z.strictObject({\n\t\tkind: reactorBackendKindSchema,\n\t\tstorage: z.strictObject({\n\t\t\tkind: z.enum([\n\t\t\t\t\"idb\",\n\t\t\t\t\"memory\",\n\t\t\t\t\"path\",\n\t\t\t\t\"postgres\"\n\t\t\t]),\n\t\t\t/** `\"${userData}/…\"` sugar or `{ $env: \"NAME\" }`. */\n\t\t\tdataDir: tokenField.env(z.string()).optional(),\n\t\t\turl: z.string().optional()\n\t\t}).optional(),\n\t\treadModel: z.strictObject({ url: z.string().optional() }).optional(),\n\t\tpackages: z.strictObject({\n\t\t\tcdnUrl: z.string().optional(),\n\t\t\tspecs: z.array(z.string()).optional(),\n\t\t\t/** on-demand model resolution (was DYNAMIC_MODEL_LOADING). */\n\t\t\tdynamic: z.boolean().optional()\n\t\t}).optional(),\n\t\tremote: z.strictObject({ url: tokenField.any(z.url()) }).optional(),\n\t\tprojection: z.strictObject({\n\t\t\tenabled: z.boolean().optional(),\n\t\t\tdbPoolSize: z.number().int().positive().optional()\n\t\t}).optional(),\n\t\texecutors: z.strictObject({ numWorkers: z.union([z.number().int().positive(), z.literal(\"auto\")]).optional() }).optional()\n\t}).superRefine((backend, ctx) => {\n\t\tif (backend.kind === \"remote\" && !backend.remote) ctx.addIssue({\n\t\t\tcode: \"custom\",\n\t\t\tpath: [\"remote\", \"url\"],\n\t\t\tmessage: \"a \\\"remote\\\" backend needs remote.url: remote: { url: switchboard.endpoints.graphql } with switchboard from ../switchboard/outputs.js, or remote: { url: { $output: { host: \\\"switchboard\\\", path: [\\\"endpoints\\\", \\\"graphql\\\"] } } }.\"\n\t\t});\n\t\tconst store = backend.storage;\n\t\tconst storeDir = store?.kind === \"path\" ? store.dataDir : void 0;\n\t\tconst readModel = backend.readModel?.url;\n\t\tif (typeof storeDir === \"string\" && readModel && samePath(storeDir, readModel)) ctx.addIssue({\n\t\t\tcode: \"custom\",\n\t\t\tpath: [\"readModel\", \"url\"],\n\t\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\t});\n\t});\n\tconst reactorSchema = z.strictObject({\n\t\tbackends: z.record(z.string(), reactorBackendSchema).optional(),\n\t\tplacement: z.strictObject({\n\t\t\tprimary: z.string().optional(),\n\t\t\tdefault: z.looseObject({}).optional()\n\t\t}).optional(),\n\t\tprotocol: reactorProtocolSchema.optional(),\n\t\t/** DEPRECATED (dies in R2): workflows become a listed plugin. */\n\t\tworkflows: z.boolean().optional(),\n\t\trenown: z.strictObject({\n\t\t\turl: z.string().optional(),\n\t\t\tnetworkId: z.string().optional(),\n\t\t\tchainId: z.number().int().optional()\n\t\t}).optional(),\n\t\tpackages: z.strictObject({ registryUrl: z.string().optional() }).optional(),\n\t\tnamespace: z.string().min(1).optional(),\n\t\tauth: z.strictObject({\n\t\t\tenabled: z.boolean().optional(),\n\t\t\tadmins: z.array(z.string()).optional(),\n\t\t\trenown: z.looseObject({}).optional()\n\t\t}).optional(),\n\t\tdrives: tokenField.any(z.array(buildDriveDeclarationSchema(tokenField.any))).optional()\n\t});\n\t/** Common runner options; runner modules extend it with their own. */\n\tconst runnerBaseSchema = z.looseObject({\n\t\tmodule: z.string().min(1),\n\t\tdefaultVerb: z.string().min(1).optional(),\n\t\tport: z.number().int().positive().optional(),\n\t\t/** Bind address; each runner documents its default. */\n\t\thost: z.string().min(1).optional(),\n\t\t/** THE COMPOSITION: plugin entries; presence is activation. */\n\t\tplugins: z.array(pluginEntrySchema).optional()\n\t});\n\t/** A compound member wrapper. Sections are FULL STATEMENTS except `runner`,\n\t* which key-merges over the member's own. Plugins live in `runner.plugins`\n\t* (as on a standalone host); there is no wrapper-level `plugins`. */\n\tconst childWrapperSchema = z.strictObject({\n\t\thost: z.string().min(1),\n\t\trunner: runnerBaseSchema.partial().optional(),\n\t\tconfig: z.looseObject({}).optional(),\n\t\treactor: reactorSchema.optional()\n\t});\n\tconst childrenSchema = z.record(z.string(), childWrapperSchema);\n\treturn {\n\t\treactorBackendSchema,\n\t\treactorSchema,\n\t\trunnerBaseSchema,\n\t\tchildWrapperSchema,\n\t\tchildrenSchema,\n\t\treactorHostSchema: z.strictObject({\n\t\t\tname: z.string().min(1),\n\t\t\trunner: runnerBaseSchema,\n\t\t\tconfig: z.looseObject({}).optional(),\n\t\t\tprofile: profileSchema.optional(),\n\t\t\treactor: reactorSchema.optional()\n\t\t}),\n\t\tcompoundHostSchema: z.strictObject({\n\t\t\tname: z.string().min(1),\n\t\t\trunner: runnerBaseSchema,\n\t\t\tchildren: childrenSchema,\n\t\t\tconfig: z.looseObject({}).optional(),\n\t\t\tprofile: profileSchema.optional()\n\t\t}),\n\t\t/** This set's field wrapper, for a runner's OWN token-able fields inside\n\t\t* `defineHostSchemas`: declared, `T | Token` in and `T` out; resolved,\n\t\t* `T` only. Both modes share one static type. */\n\t\ttokenable: tokenField.any,\n\t\t/** As `tokenable`, but the only token accepted is `$env`. */\n\t\tenvTokenable: tokenField.env\n\t};\n}\n/** The host schema set in declared (\"allow\": token-able fields take tokens)\n* or resolved (\"forbid\") form. */\nfunction makeHostSchemas(options) {\n\treturn buildHostSchemas(options.tokens === \"allow\" ? ALLOW_TOKENS : FORBID_TOKENS);\n}\n/**\n* One runner definition, two schemas (3.5): `build` runs over the DECLARED\n* set (tokens allowed; its z.input types host files) and the RESOLVED set\n* (no tokens; `validateHost` checks it before the verb). Export both, type\n* the host as `z.input<typeof declaredHostSchema>`, refine last inside the\n* builder (zod can't extend a refined object), and wrap the runner's own\n* token-able fields with `s.tokenable` / `s.envTokenable`.\n*/\nfunction defineHostSchemas(build) {\n\treturn {\n\t\tdeclaredHostSchema: build(declaredSchemas),\n\t\thostSchema: build(resolvedSchemas)\n\t};\n}\nconst declaredSchemas = makeHostSchemas({ tokens: \"allow\" });\nconst resolvedSchemas = makeHostSchemas({ tokens: \"forbid\" });\nconst declaredHostSchemas = declaredSchemas;\nconst reactorBackendSchema = resolvedSchemas.reactorBackendSchema;\nconst reactorSchema = resolvedSchemas.reactorSchema;\nconst runnerBaseSchema = resolvedSchemas.runnerBaseSchema;\nconst childWrapperSchema = resolvedSchemas.childWrapperSchema;\nconst childrenSchema = resolvedSchemas.childrenSchema;\nconst reactorHostSchema = resolvedSchemas.reactorHostSchema;\nconst compoundHostSchema = resolvedSchemas.compoundHostSchema;\n/** The generic compound runner's host: the base with its wiring config. */\nconst genericCompound = defineHostSchemas((s) => s.compoundHostSchema.extend({ config: compoundWiringSchema.optional() }).superRefine(refineStartOrder));\nconst genericCompoundHostSchema = genericCompound.hostSchema;\nconst declaredGenericCompoundHostSchema = genericCompound.declaredHostSchema;\nconst SCHEMA_BASE = \"https://powerhouse.inc/schemas\";\n/** One host schema as an editor JSON Schema with a stable `$id` — the\n* per-runner emission helper (runner packages emit their own hostSchema). */\nfunction emitHostJsonSchema(name, schema) {\n\treturn {\n\t\t$id: `${SCHEMA_BASE}/${name}.schema.json`,\n\t\t...z.toJSONSchema(schema, { io: \"input\" })\n\t};\n}\n/** The emitted-schema set, keyed by published filename. Pure — the\n* emit-schemas script writes these and the drift test re-derives them. */\nfunction emittedHostSchemas() {\n\treturn {\n\t\t\"host-reactor.schema.json\": emitHostJsonSchema(\"host-reactor\", declaredSchemas.reactorHostSchema),\n\t\t\"host-compound.schema.json\": emitHostJsonSchema(\"host-compound\", declaredSchemas.compoundHostSchema)\n\t};\n}\n//#endregion\n//#region src/resolve/walk.ts\nfunction isPlainObject(value) {\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value)) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\n/** `a.b[2].c` (or `<root>`). */\nfunction formatPath(path) {\n\tlet out = \"\";\n\tfor (const segment of path) if (typeof segment === \"number\") out += `[${segment}]`;\n\telse out += out ? `.${segment}` : segment;\n\treturn out || \"<root>\";\n}\n/** Is this object a `$$` escape (`{ $$: literal }`)? */\nfunction isEscape(value) {\n\tconst keys = Object.keys(value);\n\treturn keys.length === 1 && keys[0] === TOKEN_ESCAPE_KEY;\n}\n/** Every token in `value`, in document order. `$concat` parts and `$map`\n* operands (`over`, then the `to` template) are visited: they may hold tokens\n* themselves. Each site carries the `$map` scopes it sits in. A `$$` escape\n* hides its operand. */\nfunction collectTokenSites(value) {\n\tconst sites = [];\n\tvisit(value, [], \"root\", [], sites);\n\treturn sites;\n}\nfunction visit(value, path, position, scopes, sites) {\n\tconst key = tokenKeyOf(value);\n\tif (key && isPlainObject(value)) {\n\t\tsites.push({\n\t\t\tpath,\n\t\t\tkey,\n\t\t\ttoken: value,\n\t\t\tposition,\n\t\t\tscopes\n\t\t});\n\t\tconst operand = value[key];\n\t\tif (key === \"$concat\" && Array.isArray(operand)) operand.forEach((part, index) => visit(part, [\n\t\t\t...path,\n\t\t\t\"$concat\",\n\t\t\tindex\n\t\t], \"concat\", scopes, sites));\n\t\tif (key === \"$map\" && isPlainObject(operand)) {\n\t\t\tconst at = [...path, \"$map\"];\n\t\t\tif (\"over\" in operand) visit(operand.over, [...at, \"over\"], \"over\", scopes, sites);\n\t\t\tif (\"to\" in operand) {\n\t\t\t\tconst scope = {\n\t\t\t\t\tpath,\n\t\t\t\t\ttoken: value,\n\t\t\t\t\t...typeof operand.as === \"string\" ? { as: operand.as } : {}\n\t\t\t\t};\n\t\t\t\tvisit(operand.to, [...at, \"to\"], \"template\", [...scopes, scope], sites);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tvalue.forEach((child, index) => visit(child, [...path, index], \"element\", scopes, sites));\n\t\treturn;\n\t}\n\tif (!isPlainObject(value) || isEscape(value)) return;\n\tfor (const [childKey, child] of Object.entries(value)) visit(child, [...path, childKey], \"property\", scopes, sites);\n}\n/** An `$item` path as text: `url`, `drives.x`, `<element>` for `[]`. */\nfunction pathText(path) {\n\tif (path.length === 0) return \"<element>\";\n\treturn formatPath(path.filter((p) => typeof p === \"string\" || typeof p === \"number\"));\n}\n/** A one-line human rendering of a token, for `--explain` and messages. */\nfunction describeToken(token) {\n\tconst key = tokenKeyOf(token);\n\tif (!key || !isPlainObject(token)) return JSON.stringify(token);\n\tconst operand = token[key];\n\tif (key === \"$output\" && isPlainObject(operand)) return `$output ${typeof operand.host === \"string\" ? operand.host : \"?\"}${typeof operand.member === \"string\" ? ` (member ${operand.member})` : \"\"} › ${Array.isArray(operand.path) ? formatPath(operand.path.filter((p) => typeof p === \"string\" || typeof p === \"number\")) : \"?\"}`;\n\tif (key === \"$env\") {\n\t\tif (typeof operand === \"string\") return `$env ${operand}`;\n\t\tif (isPlainObject(operand) && typeof operand.name === \"string\") return `$env ${operand.name} (optional)`;\n\t}\n\tif (key === \"$item\") {\n\t\tconst named = isPlainObject(operand) ? operand : void 0;\n\t\tconst raw = named ? named.path : operand;\n\t\tconst path = Array.isArray(raw) ? pathText(raw) : \"?\";\n\t\treturn `$item${named && typeof named.as === \"string\" ? `(${named.as})` : \"\"} ${path}`;\n\t}\n\tif (key === \"$key\") return typeof operand === \"string\" ? `$key(${operand})` : \"$key\";\n\tif (key === \"$map\" && isPlainObject(operand)) {\n\t\tconst as = typeof operand.as === \"string\" ? ` as ${operand.as}` : \"\";\n\t\tconst into = operand.into === \"record\" ? \" into record\" : \"\";\n\t\treturn `$map over [${describeToken(operand.over)}]${as}${into} → ${JSON.stringify(render(operand.to))}`;\n\t}\n\tif (key === \"$concat\" && Array.isArray(operand)) return `$concat ${operand.map((part) => typeof part === \"string\" ? JSON.stringify(part) : typeof part === \"number\" ? String(part) : `[${describeToken(part)}]`).join(\" + \")}`;\n\treturn `${key} ${JSON.stringify(operand)}`;\n}\n/** A display copy of `value` with every token replaced by `«description»`\n* (for printing declared hosts, e.g. `--explain drives`). */\nfunction renderTokens(value) {\n\treturn render(value);\n}\nfunction render(value) {\n\tif (tokenKeyOf(value)) return `«${describeToken(value)}»`;\n\tif (Array.isArray(value)) return value.map(render);\n\tif (!isPlainObject(value) || isEscape(value)) return value;\n\tconst out = {};\n\tfor (const [key, child] of Object.entries(value)) out[key] = render(child);\n\treturn out;\n}\n/** A copy of `value` with every `$$` escape replaced by its operand (the\n* literal it protects). Run after the no-token walk. */\nfunction unwrapEscapes(value) {\n\treturn unwrap(value);\n}\nfunction unwrap(value) {\n\tif (Array.isArray(value)) return value.map(unwrap);\n\tif (!isPlainObject(value)) return value;\n\tif (isEscape(value)) return structuredClone(value[TOKEN_ESCAPE_KEY]);\n\tconst out = {};\n\tfor (const [key, child] of Object.entries(value)) out[key] = unwrap(child);\n\treturn out;\n}\n//#endregion\n//#region src/resolve/declared.ts\nfunction refOf(site) {\n\tconst operand = site.token.$output;\n\tif (!isPlainObject(operand) || typeof operand.host !== \"string\") return;\n\treturn typeof operand.member === \"string\" ? {\n\t\thost: operand.host,\n\t\tmember: operand.member\n\t} : { host: operand.host };\n}\nfunction pathOf(site) {\n\tconst operand = site.token.$output;\n\tif (!isPlainObject(operand) || !Array.isArray(operand.path)) return [];\n\treturn operand.path.filter((p) => typeof p === \"string\" || typeof p === \"number\");\n}\nfunction refKey(ref) {\n\treturn ref.member ? `${ref.host}#${ref.member}` : ref.host;\n}\n/** The distinct producers a host's `$output` tokens name, in document order. */\nfunction outputRefsOf(host) {\n\tconst seen = /* @__PURE__ */ new Map();\n\tfor (const site of collectTokenSites(host)) {\n\t\tif (site.key !== \"$output\") continue;\n\t\tconst ref = refOf(site);\n\t\tif (ref && !seen.has(refKey(ref))) seen.set(refKey(ref), ref);\n\t}\n\treturn [...seen.values()];\n}\n/** Every `$output` token with its host path and producer (for the plan and\n* `--explain outputs`). */\nfunction outputSitesOf(host) {\n\treturn collectTokenSites(host).flatMap((site) => {\n\t\tif (site.key !== \"$output\") return [];\n\t\tconst ref = refOf(site);\n\t\treturn ref ? [{\n\t\t\tpath: formatPath(site.path),\n\t\t\tref,\n\t\t\toutputPath: pathOf(site)\n\t\t}] : [];\n\t});\n}\n/** Every `$env` token with its host path (for `--explain outputs`). */\nfunction envSitesOf(host) {\n\treturn collectTokenSites(host).flatMap((site) => {\n\t\tif (site.key !== \"$env\") return [];\n\t\tconst operand = site.token.$env;\n\t\tif (typeof operand === \"string\") return [{\n\t\t\tpath: formatPath(site.path),\n\t\t\tname: operand,\n\t\t\toptional: false\n\t\t}];\n\t\tif (isPlainObject(operand) && typeof operand.name === \"string\") return [{\n\t\t\tpath: formatPath(site.path),\n\t\t\tname: operand.name,\n\t\t\toptional: true\n\t\t}];\n\t\treturn [];\n\t});\n}\n/** The binding name an `$item`/`$key` site names (undefined: innermost). */\nfunction bindingNameOf(site) {\n\tconst operand = site.token[site.key];\n\tif (site.key === \"$key\") return typeof operand === \"string\" ? operand : void 0;\n\tif (site.key === \"$item\" && isPlainObject(operand)) return typeof operand.as === \"string\" ? operand.as : void 0;\n}\n/** The enclosing `$map` an `$item`/`$key` site binds to, or why none. */\nfunction scopeOf(site) {\n\tconst name = bindingNameOf(site);\n\tif (site.scopes.length === 0) return { error: `${site.key} is used outside any $map; it reads the element a $map template is rendering, so it is legal only inside a $map's \\`to\\` (or a nested $map's \\`over\\`).` };\n\tif (name === void 0) return site.scopes[site.scopes.length - 1];\n\tfor (let i = site.scopes.length - 1; i >= 0; i--) if (site.scopes[i].as === name) return site.scopes[i];\n\tconst named = site.scopes.flatMap((s) => s.as ? [`\"${s.as}\"`] : []);\n\treturn { error: `${describeToken(site.token)} names the $map binding \"${name}\", which no enclosing $map declares (enclosing bindings: ${named.join(\", \") || \"none; add as: \\\"\" + name + \"\\\" to the outer $map\"}).` };\n}\n/** Item path of an `$item` site. */\nfunction itemPathOf(site) {\n\tconst operand = site.token.$item;\n\tconst raw = isPlainObject(operand) ? operand.path : operand;\n\treturn Array.isArray(raw) ? raw.filter((p) => typeof p === \"string\" || typeof p === \"number\") : [];\n}\n/** Operator shapes and placement: malformed operands, `$item`/`$key`\n* outside any `$map` or naming an unknown binding, and\n* `{ $env: { name, optional: true } }` anywhere but the direct value of an\n* object property (it omits that property when unset). */\nfunction checkTokenSites(host) {\n\tconst issues = [];\n\tfor (const site of collectTokenSites(host)) {\n\t\tconst path = formatPath(site.path);\n\t\tif (!tokenSchema.safeParse(site.token).success) {\n\t\t\tissues.push({\n\t\t\t\tpath,\n\t\t\t\tmessage: `malformed ${site.key} token ${JSON.stringify(site.token)}. Shapes: { $output: { host, member?, path: [...] } }, { $concat: [string | number | token, ...] }, { $env: \"NAME\" } or { $env: { name: \"NAME\", optional: true } }, { $map: { over: $output | $item, as?: \"name\", to: template, into?: \"record\" } }, { $item: [path] } or { $item: { as: \"name\", path: [...] } }, { $key: true } or { $key: \"name\" }.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (site.key === \"$item\" || site.key === \"$key\") {\n\t\t\tconst scope = scopeOf(site);\n\t\t\tif (\"error\" in scope) issues.push({\n\t\t\t\tpath,\n\t\t\t\tmessage: scope.error\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst operand = site.token.$env;\n\t\tif (site.key === \"$env\" && isPlainObject(operand) && site.position !== \"property\") {\n\t\t\tconst where = site.position === \"concat\" ? \"a $concat part\" : site.position === \"element\" ? \"an array element\" : site.position === \"template\" ? \"the whole $map template\" : \"the whole host\";\n\t\t\tissues.push({\n\t\t\t\tpath,\n\t\t\t\tmessage: `{ $env: { name, optional: true } } is legal only as the direct value of an object property (it omits that property when ${String(operand.name)} is unset), not as ${where}. Use { $env: ${JSON.stringify(operand.name)} } here.`\n\t\t\t});\n\t\t}\n\t}\n\treturn issues;\n}\nfunction defOf(schema) {\n\tif (!isPlainObjectLike(schema)) return void 0;\n\tconst internals = schema._zod;\n\tif (!isPlainObjectLike(internals)) return void 0;\n\tconst def = internals.def;\n\tif (!isPlainObjectLike(def) || typeof def.type !== \"string\") return void 0;\n\treturn {\n\t\t...def,\n\t\ttype: def.type\n\t};\n}\nfunction isPlainObjectLike(value) {\n\treturn (typeof value === \"object\" || typeof value === \"function\") && value !== null;\n}\nconst WRAPPERS = /* @__PURE__ */ new Set([\n\t\"optional\",\n\t\"nullable\",\n\t\"default\",\n\t\"prefault\",\n\t\"readonly\",\n\t\"nonoptional\",\n\t\"catch\",\n\t\"success\"\n]);\n/** The schema at `path` inside a zod schema (walking objects, records,\n* arrays, tuples, unions and wrappers), or why the path does not exist. */\nfunction schemaAtPath(schema, path) {\n\tlet current = schema;\n\tfor (let i = 0; i <= path.length; i++) {\n\t\tfor (let guard = 0; guard < 32; guard++) {\n\t\t\tconst def = defOf(current);\n\t\t\tif (!def) break;\n\t\t\tif (WRAPPERS.has(def.type)) current = def.innerType;\n\t\t\telse if (def.type === \"lazy\" && typeof def.getter === \"function\") {\n\t\t\t\tconst getter = def.getter;\n\t\t\t\tcurrent = getter();\n\t\t\t} else if (def.type === \"pipe\") {\n\t\t\t\tconst out = defOf(def.out);\n\t\t\t\tcurrent = out && out.type !== \"transform\" ? def.out : def.in;\n\t\t\t} else break;\n\t\t}\n\t\tif (i === path.length) return {\n\t\t\tok: true,\n\t\t\tschema: current\n\t\t};\n\t\tconst segment = path[i];\n\t\tconst def = defOf(current);\n\t\tif (!def) return {\n\t\t\tok: false,\n\t\t\tat: i,\n\t\t\treason: \"is not a schema\"\n\t\t};\n\t\tswitch (def.type) {\n\t\t\tcase \"any\":\n\t\t\tcase \"unknown\": return {\n\t\t\t\tok: true,\n\t\t\t\tschema: current\n\t\t\t};\n\t\t\tcase \"object\": {\n\t\t\t\tconst shape = isPlainObjectLike(def.shape) ? def.shape : {};\n\t\t\t\tif (typeof segment === \"string\" && segment in shape) {\n\t\t\t\t\tcurrent = shape[segment];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst catchall = defOf(def.catchall);\n\t\t\t\tif (catchall && catchall.type !== \"never\") {\n\t\t\t\t\tcurrent = def.catchall;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst keys = Object.keys(shape);\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\tat: i,\n\t\t\t\t\treason: `has no key ${JSON.stringify(segment)} (keys: ${keys.join(\", \") || \"none\"})`\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"record\":\n\t\t\t\tif (typeof segment !== \"string\") return {\n\t\t\t\t\tok: false,\n\t\t\t\t\tat: i,\n\t\t\t\t\treason: \"is a record (string keys)\"\n\t\t\t\t};\n\t\t\t\tcurrent = def.valueType;\n\t\t\t\tbreak;\n\t\t\tcase \"array\":\n\t\t\t\tif (typeof segment !== \"number\") return {\n\t\t\t\t\tok: false,\n\t\t\t\t\tat: i,\n\t\t\t\t\treason: \"is an array (numeric index)\"\n\t\t\t\t};\n\t\t\t\tcurrent = def.element;\n\t\t\t\tbreak;\n\t\t\tcase \"tuple\": {\n\t\t\t\tconst items = Array.isArray(def.items) ? def.items : [];\n\t\t\t\tif (typeof segment !== \"number\" || segment >= items.length) return {\n\t\t\t\t\tok: false,\n\t\t\t\t\tat: i,\n\t\t\t\t\treason: `is a ${items.length}-tuple`\n\t\t\t\t};\n\t\t\t\tcurrent = items[segment];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"union\": {\n\t\t\t\tconst options = Array.isArray(def.options) ? def.options : [];\n\t\t\t\tfor (const option of options) {\n\t\t\t\t\tconst hit = schemaAtPath(option, path.slice(i));\n\t\t\t\t\tif (hit.ok) return hit;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\tat: i,\n\t\t\t\t\treason: \"matches no union member\"\n\t\t\t\t};\n\t\t\t}\n\t\t\tdefault: return {\n\t\t\t\tok: false,\n\t\t\t\tat: i,\n\t\t\t\treason: `is a ${def.type}, not a container`\n\t\t\t};\n\t\t}\n\t}\n\treturn {\n\t\tok: true,\n\t\tschema: current\n\t};\n}\n/** Whether the object schema at `path` names `key` in its shape (a\n* catchall does not count): what a runner's schema explicitly declares,\n* e.g. `runner.cspRegistrySync`. A union declares a key any member does. */\nfunction declaresKey(schema, path, key) {\n\tconst at = schemaAtPath(schema, path);\n\tif (!at.ok) return false;\n\tconst def = defOf(at.schema);\n\tif (def?.type === \"object\") return isPlainObjectLike(def.shape) && key in def.shape;\n\tif (def?.type === \"union\" && Array.isArray(def.options)) return def.options.some((option) => declaresKey(option, [], key));\n\treturn false;\n}\n/** Whether a (property) schema admits an absent value on the OUTPUT side:\n* `.optional()` does; `.default()`/`.prefault()` fill it in, and\n* `.nonoptional()` forbids it. */\nfunction mayBeAbsent(schema) {\n\tlet current = schema;\n\tfor (let guard = 0; guard < 32; guard++) {\n\t\tconst internals = isPlainObjectLike(current) ? current._zod : void 0;\n\t\tif (isPlainObjectLike(internals) && internals.optout === \"optional\") return true;\n\t\tconst def = defOf(current);\n\t\tif (!def) return false;\n\t\tif (def.type === \"optional\") return true;\n\t\tif (def.type === \"default\" || def.type === \"prefault\" || def.type === \"nonoptional\" || !WRAPPERS.has(def.type)) return false;\n\t\tcurrent = def.innerType;\n\t}\n\treturn false;\n}\n/** Whether `key` may be absent from a value of the object schema `schema`:\n* an optional property, or (in a union) one some member makes optional or\n* lacks. A record value or an array element is never optional. */\nfunction optionalKeyIn(schema, key) {\n\tconst unwrapped = schemaAtPath(schema, []);\n\tconst def = unwrapped.ok ? defOf(unwrapped.schema) : void 0;\n\tif (def?.type === \"object\") {\n\t\tconst shape = isPlainObjectLike(def.shape) ? def.shape : {};\n\t\treturn key in shape && mayBeAbsent(shape[key]);\n\t}\n\tif (def?.type === \"union\" && Array.isArray(def.options)) return def.options.some((option) => {\n\t\tconst inner = schemaAtPath(option, []);\n\t\tconst optionDef = inner.ok ? defOf(inner.schema) : void 0;\n\t\tconst shape = optionDef?.type === \"object\" && isPlainObjectLike(optionDef.shape) ? optionDef.shape : void 0;\n\t\treturn shape !== void 0 && (!(key in shape) || mayBeAbsent(shape[key]));\n\t});\n\treturn false;\n}\n/**\n* Whether the field `path[at]` is OPTIONAL in `schema` (a producer's\n* `outputsSchema`, or a `$map` element schema), given that `path[0..at-1]`\n* exists: the codegen'd `OutputToken<T | undefined>` / `ItemToken<T |\n* undefined>` positions, whose rendered property the resolver omits when\n* the field is absent. False for a record key, an array index, or a path\n* the schema does not describe.\n*/\nfunction isOptionalField(schema, path, at) {\n\tconst key = path[at];\n\tif (typeof key !== \"string\") return false;\n\tconst parent = schemaAtPath(schema, path.slice(0, at));\n\treturn parent.ok && optionalKeyIn(parent.schema, key);\n}\n/** The element schema of a collection schema (array element, record\n* value), or undefined when the schema does not say. */\nfunction elementSchemaOf(schema) {\n\tconst collection = collectionOf(schema);\n\treturn collection.kind === \"array\" || collection.kind === \"record\" ? collection.element : void 0;\n}\n/** The collection kind of a schema (unwrapped): array, record, unknown (no\n* check possible) or something else. */\nfunction collectionOf(schema) {\n\tconst unwrapped = schemaAtPath(schema, []);\n\tconst def = unwrapped.ok ? defOf(unwrapped.schema) : void 0;\n\tif (!def) return { kind: \"unknown\" };\n\tif (def.type === \"array\") return {\n\t\tkind: \"array\",\n\t\telement: def.element\n\t};\n\tif (def.type === \"record\") return {\n\t\tkind: \"record\",\n\t\telement: def.valueType\n\t};\n\tif (def.type === \"object\") {\n\t\tconst catchall = defOf(def.catchall);\n\t\tif (catchall && catchall.type !== \"never\") {\n\t\t\tconst shape = isPlainObjectLike(def.shape) ? def.shape : {};\n\t\t\treturn Object.keys(shape).length === 0 ? {\n\t\t\t\tkind: \"record\",\n\t\t\t\telement: def.catchall\n\t\t\t} : {\n\t\t\t\tkind: \"record\",\n\t\t\t\telement: void 0\n\t\t\t};\n\t\t}\n\t}\n\tif (def.type === \"tuple\") return {\n\t\tkind: \"array\",\n\t\telement: void 0\n\t};\n\tif (def.type === \"any\" || def.type === \"unknown\" || def.type === \"union\") return { kind: \"unknown\" };\n\treturn {\n\t\tkind: \"other\",\n\t\ttype: def.type\n\t};\n}\n/** Every `$output` token's producer exists and its path is valid against\n* the producer's `outputsSchema`; every `$map`'s `over` is a collection\n* there (a record under `into: \"record\"`), and every `$item` path exists\n* in the element schema of the map it binds. */\nfunction checkOutputPaths(host, outputsSchemaOf) {\n\tconst issues = [];\n\tconst elements = /* @__PURE__ */ new Map();\n\tconst elementOf = (scope) => \"error\" in scope ? void 0 : elements.get(scope.token);\n\tfor (const site of collectTokenSites(host)) {\n\t\tif (!tokenSchema.safeParse(site.token).success) continue;\n\t\tif (site.key === \"$map\") {\n\t\t\telements.set(site.token, checkMap(site, outputsSchemaOf, elementOf, issues));\n\t\t\tcontinue;\n\t\t}\n\t\tif (site.key === \"$item\") {\n\t\t\tconst scope = scopeOf(site);\n\t\t\tconst element = elementOf(scope);\n\t\t\tif (!element || element.element === void 0 || \"error\" in scope) continue;\n\t\t\tconst itemPath = itemPathOf(site);\n\t\t\tconst hit = schemaAtPath(element.element, itemPath);\n\t\t\tif (!hit.ok) {\n\t\t\t\tconst parent = itemPath.slice(0, hit.at);\n\t\t\t\tissues.push({\n\t\t\t\t\tpath: formatPath(site.path),\n\t\t\t\t\tmessage: `${describeToken(site.token)}: the element${parent.length ? `'s ${formatPath(parent)}` : \"\"} of the $map at ${formatPath(scope.path)}${scope.as ? ` (as \"${scope.as}\")` : \"\"} ${hit.reason} (element of ${element.label}).`\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (site.key !== \"$output\") continue;\n\t\tconst ref = refOf(site);\n\t\tif (!ref) continue;\n\t\tconst path = formatPath(site.path);\n\t\tconst lookup = outputsSchemaOf(ref);\n\t\tif (\"error\" in lookup) {\n\t\t\tissues.push({\n\t\t\t\tpath,\n\t\t\t\tmessage: lookup.error\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst outputPath = pathOf(site);\n\t\tconst hit = schemaAtPath(lookup.schema, outputPath);\n\t\tif (!hit.ok) {\n\t\t\tconst parent = outputPath.slice(0, hit.at);\n\t\t\tconst where = parent.length ? `outputs.${formatPath(parent)}` : \"the outputs\";\n\t\t\tissues.push({\n\t\t\t\tpath,\n\t\t\t\tmessage: `${describeToken(site.token)}: ${where} ${hit.reason} in the outputsSchema of ${lookup.label}.`\n\t\t\t});\n\t\t}\n\t}\n\treturn issues;\n}\n/** A `$map`'s `over` against its schema: a collection (a record under\n* `into: \"record\"`). Returns the element schema for the map's `$item`s. */\nfunction checkMap(site, outputsSchemaOf, elementOf, issues) {\n\tconst operand = site.token.$map;\n\tif (!isPlainObject(operand)) return void 0;\n\tconst over = operand.over;\n\tconst into = operand.into === \"record\";\n\tlet schema;\n\tlet label;\n\tif (isPlainObject(over) && \"$output\" in over) {\n\t\tconst overSite = {\n\t\t\t...site,\n\t\t\tkey: \"$output\",\n\t\t\ttoken: over\n\t\t};\n\t\tconst ref = refOf(overSite);\n\t\tif (!ref) return void 0;\n\t\tconst lookup = outputsSchemaOf(ref);\n\t\tif (\"error\" in lookup) return void 0;\n\t\tconst hit = schemaAtPath(lookup.schema, pathOf(overSite));\n\t\tif (!hit.ok) return void 0;\n\t\tschema = hit.schema;\n\t\tlabel = `${describeToken(over)} in the outputsSchema of ${lookup.label}`;\n\t} else if (isPlainObject(over) && \"$item\" in over) {\n\t\tconst overSite = {\n\t\t\t...site,\n\t\t\tkey: \"$item\",\n\t\t\ttoken: over\n\t\t};\n\t\tconst outer = elementOf(scopeOf(overSite));\n\t\tif (!outer || outer.element === void 0) return void 0;\n\t\tconst hit = schemaAtPath(outer.element, itemPathOf(overSite));\n\t\tif (!hit.ok) return void 0;\n\t\tschema = hit.schema;\n\t\tlabel = `${describeToken(over)} (element of ${outer.label})`;\n\t} else return;\n\tconst path = formatPath(site.path);\n\tconst collection = collectionOf(schema);\n\tif (collection.kind === \"unknown\") return void 0;\n\tif (collection.kind === \"other\") {\n\t\tissues.push({\n\t\t\tpath,\n\t\t\tmessage: `$map over ${label} is a ${collection.type}, not an array or a record; a $map iterates a collection.`\n\t\t});\n\t\treturn;\n\t}\n\tif (into && collection.kind === \"array\") {\n\t\tissues.push({\n\t\t\tpath,\n\t\t\tmessage: `$map with into: \"record\" maps over ${label}, which is an array: an array has no keys to keep. Drop into: \"record\" (the result is an array) or map over a record.`\n\t\t});\n\t\treturn;\n\t}\n\treturn {\n\t\telement: collection.element,\n\t\tlabel\n\t};\n}\n//#endregion\n//#region src/resolve/removed-forms.ts\nfunction outputToken(host, path, member) {\n\treturn `{ $output: { host: \"${host}\"${member ? `, member: \"${member}\"` : \"\"}, path: [${path.map((p) => JSON.stringify(p)).join(\", \")}] } }`;\n}\nfunction isDriveReference(value) {\n\tif (!isPlainObject(value)) return false;\n\tconst keys = Object.keys(value).sort();\n\treturn keys.length === 2 && keys[0] === \"from\" && keys[1] === \"slug\" && typeof value.from === \"string\" && typeof value.slug === \"string\";\n}\nfunction checkReactor(reactor, base, found) {\n\tif (!isPlainObject(reactor) || !isPlainObject(reactor.backends)) return;\n\tfor (const [name, backend] of Object.entries(reactor.backends)) {\n\t\tif (!isPlainObject(backend) || !isPlainObject(backend.remote)) continue;\n\t\tconst host = backend.remote.host;\n\t\tif (host === void 0) continue;\n\t\tconst producer = typeof host === \"string\" ? host : \"switchboard\";\n\t\tfound.push({\n\t\t\tpath: `${base}reactor.backends.${name}.remote.host`,\n\t\t\tmessage: `remote: { host } was removed; use remote: { url: ${producer}.endpoints.graphql } with ${producer} from ../${producer}/outputs.js, or remote: { url: ${outputToken(producer, [\"endpoints\", \"graphql\"])} }.`\n\t\t});\n\t}\n}\nfunction checkPlugins(runner, base, memberHosts, found) {\n\tif (!isPlainObject(runner) || !Array.isArray(runner.plugins)) return;\n\trunner.plugins.forEach((entry, index) => {\n\t\tif (!isPlainObject(entry) || !isPlainObject(entry.config)) return;\n\t\tfor (const [key, value] of Object.entries(entry.config)) {\n\t\t\tif (!isDriveReference(value)) continue;\n\t\t\tconst host = memberHosts[value.from] ?? value.from;\n\t\t\tconst member = memberHosts[value.from] ? value.from : void 0;\n\t\t\tfound.push({\n\t\t\t\tpath: `${base}runner.plugins[${index}].config.${key}`,\n\t\t\t\tmessage: `${key}: { from, slug } was removed; use ${host}.drives.${value.slug}.url from ../${host}/outputs.js, or ${outputToken(host, [\n\t\t\t\t\t\"drives\",\n\t\t\t\t\tvalue.slug,\n\t\t\t\t\t\"url\"\n\t\t\t\t])}${member ? ` (add member: \"${member}\" if two members run host \"${host}\")` : \"\"}.`\n\t\t\t});\n\t\t}\n\t});\n}\n/** Every removed form in a host file (reactor or compound), in document\n* order. Compound wrappers are checked too. */\nfunction findRemovedForms(host) {\n\tconst found = [];\n\tif (!isPlainObject(host)) return found;\n\tconst children = isPlainObject(host.children) ? host.children : void 0;\n\tconst memberHosts = {};\n\tfor (const [key, wrapper] of Object.entries(children ?? {})) if (isPlainObject(wrapper) && typeof wrapper.host === \"string\") memberHosts[key] = wrapper.host;\n\tcheckReactor(host.reactor, \"\", found);\n\tcheckPlugins(host.runner, \"\", memberHosts, found);\n\tfor (const [key, wrapper] of Object.entries(children ?? {})) {\n\t\tif (!isPlainObject(wrapper)) continue;\n\t\tcheckReactor(wrapper.reactor, `children.${key}.`, found);\n\t\tcheckPlugins(wrapper.runner, `children.${key}.`, memberHosts, found);\n\t}\n\tif (children && isPlainObject(host.config)) for (const key of [\"projectDrivesIntoConnect\", \"drivesPublicBase\"]) {\n\t\tif (host.config[key] === void 0) continue;\n\t\tfound.push({\n\t\t\tpath: `config.${key}`,\n\t\t\tmessage: `config.${key} was removed; declare the drives on the member that consumes them, by output token: reactor.drives: [{ slug: \"<slug>\", remote: { url: ${outputToken(\"switchboard\", [\n\t\t\t\t\"drives\",\n\t\t\t\t\"<slug>\",\n\t\t\t\t\"url\"\n\t\t\t])} } }].`\n\t\t});\n\t}\n\treturn found;\n}\n//#endregion\n//#region src/env-substitution.ts\nconst BUILTIN = /\\$\\{(userData|projectRoot)\\}/g;\nfunction substitute(text, env) {\n\treturn text.replace(BUILTIN, (match, name) => env[name] ?? match);\n}\n/** Deep-substitute the built-ins that `env` provides in every string; an\n* absent built-in is left as written. The input is never mutated. */\nfunction substituteBuiltinEnv(value, env) {\n\treturn substituteValue(value, env);\n}\nfunction substituteValue(value, env) {\n\tif (typeof value === \"string\") return substitute(value, env);\n\tif (Array.isArray(value)) return value.map((v) => substituteValue(v, env));\n\tif (value !== null && typeof value === \"object\") {\n\t\tconst out = {};\n\t\tfor (const [k, v] of Object.entries(value)) out[k] = substituteValue(v, env);\n\t\treturn out;\n\t}\n\treturn value;\n}\n//#endregion\n//#region src/resolve/plan.ts\n/**\n* The dependency plan (pipeline step 4): which compound member consumes\n* which member's outputs, and the start order that follows. Producers start\n* before consumers; `config.startOrder` is optional and, when given, must\n* agree with the tokens. Cycles fail. Pure.\n*/\nvar PlanError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"PlanError\";\n\t}\n};\n/** The member a ref names: the unique member running `ref.host`, or the\n* member `ref.member` when given (it must run `ref.host`). */\nfunction memberForRef(ref, members) {\n\tif (ref.member !== void 0) {\n\t\tconst named = members.find((m) => m.key === ref.member);\n\t\tif (!named) return { error: `names member \"${ref.member}\", which this compound does not declare (members: ${members.map((m) => m.key).join(\", \")}).` };\n\t\tif (named.host !== ref.host) return { error: `names member \"${ref.member}\" of host \"${ref.host}\", but that member runs host \"${named.host}\".` };\n\t\treturn { key: named.key };\n\t}\n\tconst running = members.filter((m) => m.host === ref.host);\n\tif (running.length === 1) return { key: running[0].key };\n\tif (running.length === 0) return { error: `names host \"${ref.host}\", which no member of this compound runs (members run: ${[...new Set(members.map((m) => m.host))].join(\", \")}).` };\n\treturn { error: `names host \"${ref.host}\", which members ${running.map((m) => `\"${m.key}\"`).join(\" and \")} both run; add member: \"<key>\" to pick one.` };\n}\nfunction edgesOf(members) {\n\tconst edges = [];\n\tconst problems = [];\n\tfor (const member of members) {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const { ref, path } of member.refs) {\n\t\t\tconst target = memberForRef(ref, members);\n\t\t\tif (\"error\" in target) {\n\t\t\t\tproblems.push(`${member.key}: ${path} ${target.error}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (target.key === member.key) {\n\t\t\t\tproblems.push(`${member.key}: ${path} reads ${refKey(ref)}'s outputs, which is this member itself.`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (seen.has(target.key)) continue;\n\t\t\tseen.add(target.key);\n\t\t\tedges.push({\n\t\t\t\tconsumer: member.key,\n\t\t\t\tproducer: target.key,\n\t\t\t\tpath\n\t\t\t});\n\t\t}\n\t}\n\tif (problems.length > 0) throw new PlanError(problems.join(\"\\n\"));\n\treturn edges;\n}\n/** Declared start order: the named members first, then the rest in\n* declaration order. */\nfunction declaredOrder(members, startOrder) {\n\tconst keys = members.map((m) => m.key);\n\tconst named = [...new Set(startOrder)].filter((k) => keys.includes(k));\n\treturn [...named, ...keys.filter((k) => !named.includes(k))];\n}\nfunction planCompound(members, startOrder) {\n\tconst edges = edgesOf(members);\n\tif (startOrder) {\n\t\tconst order = declaredOrder(members, startOrder);\n\t\tconst index = new Map(order.map((k, i) => [k, i]));\n\t\tconst bad = edges.filter((e) => (index.get(e.producer) ?? 0) > (index.get(e.consumer) ?? 0));\n\t\tif (bad.length > 0) throw new PlanError(bad.map((e) => `config.startOrder starts \"${e.consumer}\" before \"${e.producer}\", but ${e.consumer}.${e.path} consumes \"${e.producer}\"'s outputs. Reorder startOrder (or omit it: the order follows the tokens).`).join(\"\\n\"));\n\t\treturn {\n\t\t\torder,\n\t\t\tedges,\n\t\t\tsource: \"startOrder\"\n\t\t};\n\t}\n\tconst pending = new Map(members.map((m) => [m.key, /* @__PURE__ */ new Set()]));\n\tfor (const e of edges) pending.get(e.consumer)?.add(e.producer);\n\tconst order = [];\n\twhile (order.length < members.length) {\n\t\tconst next = members.find((m) => !order.includes(m.key) && pending.get(m.key)?.size === 0);\n\t\tif (!next) {\n\t\t\tconst stuck = members.filter((m) => !order.includes(m.key));\n\t\t\tthrow new PlanError(`output tokens form a cycle between ${stuck.map((m) => `\"${m.key}\"`).join(\", \")}: ${edges.filter((e) => stuck.some((m) => m.key === e.consumer) && stuck.some((m) => m.key === e.producer)).map((e) => `${e.consumer} (${e.path}) needs ${e.producer}`).join(\"; \")}.`);\n\t\t}\n\t\torder.push(next.key);\n\t\tfor (const set of pending.values()) set.delete(next.key);\n\t}\n\treturn {\n\t\torder,\n\t\tedges,\n\t\tsource: \"tokens\"\n\t};\n}\n//#endregion\n//#region src/resolve/resolve.ts\nvar TokenResolutionError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"TokenResolutionError\";\n\t}\n};\n/** A resolved `{ $env: { name, optional: true } }` whose variable is unset,\n* or an `$output`/`$item` reading an absent optional field: its enclosing\n* property is omitted. */\nconst OMIT = Symbol(\"omit\");\n/** `reactor.drives[\"workflows\"]` (or `…[2]` for an array element). */\nfunction elementText(binding) {\n\tconst key = typeof binding.key === \"number\" ? `[${binding.key}]` : `[${JSON.stringify(binding.key)}]`;\n\treturn `${formatPath(binding.path)}${key}`;\n}\n/** Provenance of `$map`-rendered arrays: element index → the input key\n* (record key, or array index) it was rendered from. Lets resolved\n* validation name the element key, not just the result index. */\nconst renderedKeys = /* @__PURE__ */ new WeakMap();\n/**\n* The `$map` elements an issue path (from resolved validation of a resolved\n* host) passes through, as text: `$map element \"workflows\"`. Undefined when\n* the path crosses no `$map`-rendered array. Walk the SAME object\n* `resolveHostOutputs` returned (provenance is by identity).\n*/\nfunction describeMapElements(host, path) {\n\tconst found = [];\n\tlet current = host;\n\tfor (const segment of path) if (Array.isArray(current) && typeof segment === \"number\") {\n\t\tconst key = renderedKeys.get(current)?.[segment];\n\t\tif (key !== void 0) found.push(`$map element ${typeof key === \"number\" ? `[${key}]` : JSON.stringify(key)}`);\n\t\tcurrent = current[segment];\n\t} else if (isPlainObject(current) && typeof segment === \"string\") current = current[segment];\n\telse break;\n\treturn found.length ? found.join(\" › \") : void 0;\n}\n/** A deep copy of a resolved (JSON-shaped) value that keeps the `$map`\n* provenance of its rendered arrays (structuredClone would drop it). */\nfunction cloneWithProvenance(value) {\n\tif (Array.isArray(value)) {\n\t\tconst copy = value.map(cloneWithProvenance);\n\t\tconst keys = renderedKeys.get(value);\n\t\tif (keys) renderedKeys.set(copy, keys);\n\t\treturn copy;\n\t}\n\tif (isPlainObject(value)) {\n\t\tconst copy = {};\n\t\tfor (const [key, child] of Object.entries(value)) copy[key] = cloneWithProvenance(child);\n\t\treturn copy;\n\t}\n\treturn value;\n}\n/** The value at `path` inside `root` (output data: records and arrays). */\nfunction walkPath(root, path) {\n\tlet current = root;\n\tfor (let i = 0; i < path.length; i++) {\n\t\tconst segment = path[i];\n\t\tconst next = Array.isArray(current) ? typeof segment === \"number\" ? current[segment] : void 0 : isPlainObject(current) && typeof segment === \"string\" ? current[segment] : void 0;\n\t\tif (next === void 0) {\n\t\t\tconst has = isPlainObject(current) ? Object.keys(current).join(\", \") || \"nothing\" : Array.isArray(current) ? `${current.length} elements` : JSON.stringify(current);\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\tat: i,\n\t\t\t\thas\n\t\t\t};\n\t\t}\n\t\tcurrent = next;\n\t}\n\treturn {\n\t\tok: true,\n\t\tvalue: current\n\t};\n}\n/** The schema at `path` inside `schema`, when both are known. */\nfunction schemaOf(schema, path) {\n\tif (schema === void 0) return void 0;\n\tconst hit = schemaAtPath(schema, path);\n\treturn hit.ok ? hit.schema : void 0;\n}\nfunction pathSegments(path) {\n\treturn path.filter((p) => typeof p === \"string\" || typeof p === \"number\");\n}\nvar Resolver = class {\n\tsources;\n\tself;\n\tdeferred = [];\n\t/** What the last OMIT stood for, for the \"nothing to omit\" errors. */\n\tomitted = \"an optional $env\";\n\tconstructor(sources, self) {\n\t\tthis.sources = sources;\n\t\tthis.self = self;\n\t}\n\t/** The member keys a token reads (`$output` on a member's host), when\n\t* resolving a compound's own fields with `deferSelf`. */\n\tselfRefs(token, trail) {\n\t\tif (!this.self) return [];\n\t\tconst keys = /* @__PURE__ */ new Set();\n\t\tfor (const site of collectTokenSites(token)) {\n\t\t\tconst operand = site.token.$output;\n\t\t\tif (site.key !== \"$output\" || !isPlainObject(operand)) continue;\n\t\t\tif (typeof operand.host !== \"string\") continue;\n\t\t\tconst ref = typeof operand.member === \"string\" ? {\n\t\t\t\thost: operand.host,\n\t\t\t\tmember: operand.member\n\t\t\t} : { host: operand.host };\n\t\t\tif (!this.self.members.some((m) => m.host === ref.host)) continue;\n\t\t\tconst target = memberForRef(ref, this.self.members);\n\t\t\tif (\"error\" in target) this.fail([...trail, ...site.path], `in a compound ${target.error}`);\n\t\t\tkeys.add(target.key);\n\t\t}\n\t\treturn [...keys];\n\t}\n\tfail(trail, message, scope = []) {\n\t\tconst where = this.sources.where ? `${this.sources.where}: ` : \"\";\n\t\tconst inside = scope.length ? ` (rendering $map element ${scope.map(elementText).join(\" › \")})` : \"\";\n\t\tthrow new TokenResolutionError(`${where}\\`${formatPath(trail)}\\` ${message}${inside}`);\n\t}\n\tvalue(value, trail, scope = []) {\n\t\tif (typeof value === \"string\") return this.sources.builtins ? substituteBuiltinEnv(value, this.sources.builtins) : value;\n\t\tif (Array.isArray(value)) return value.map((child, index) => {\n\t\t\tconst out = this.value(child, [...trail, index], scope);\n\t\t\tif (out === OMIT) this.fail([...trail, index], `is ${this.omitted} inside an array.`, scope);\n\t\t\treturn out;\n\t\t});\n\t\tif (!isPlainObject(value)) return value;\n\t\tif (isEscape(value)) return structuredClone(value);\n\t\tif (tokenKeyOf(value)) {\n\t\t\tconst members = scope.length === 0 ? this.selfRefs(value, trail) : [];\n\t\t\tif (members.length > 0) {\n\t\t\t\tthis.deferred.push({\n\t\t\t\t\ttrail,\n\t\t\t\t\ttoken: value,\n\t\t\t\t\tmembers\n\t\t\t\t});\n\t\t\t\treturn structuredClone(value);\n\t\t\t}\n\t\t\treturn this.token(value, trail, scope);\n\t\t}\n\t\tconst out = {};\n\t\tfor (const [key, child] of Object.entries(value)) {\n\t\t\tif (this.self && trail.length === 0 && key === \"children\") {\n\t\t\t\tout[key] = child;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = this.value(child, [...trail, key], scope);\n\t\t\tif (resolved !== OMIT) out[key] = resolved;\n\t\t}\n\t\treturn out;\n\t}\n\ttoken(token, trail, scope = []) {\n\t\tif (!tokenSchema.safeParse(token).success) this.fail(trail, `is a malformed token: ${JSON.stringify(token)}.`, scope);\n\t\tswitch (tokenKeyOf(token)) {\n\t\t\tcase \"$output\": return this.output(token, trail, scope);\n\t\t\tcase \"$env\": return this.env(token.$env, trail, scope);\n\t\t\tcase \"$concat\": return this.concat(token.$concat, trail, scope);\n\t\t\tcase \"$map\": return this.map(token.$map, trail, scope);\n\t\t\tcase \"$item\": return this.item(token.$item, trail, scope);\n\t\t\tcase \"$key\": return this.key(token.$key, trail, scope);\n\t\t\tdefault: return this.fail(trail, `is not a token.`, scope);\n\t\t}\n\t}\n\t/** The binding an `$item`/`$key` names: the innermost map, or the\n\t* enclosing map whose `as` is `name`. */\n\tbinding(name, operator, trail, scope) {\n\t\tif (scope.length === 0) return this.fail(trail, `uses ${operator} outside any $map; ${operator} reads the element a $map template is rendering.`);\n\t\tif (name === void 0) return scope[scope.length - 1];\n\t\tfor (let i = scope.length - 1; i >= 0; i--) if (scope[i].as === name) return scope[i];\n\t\tconst named = scope.flatMap((b) => b.as ? [`\"${b.as}\"`] : []);\n\t\treturn this.fail(trail, `uses ${operator} with binding \"${name}\", which no enclosing $map declares (as: ${named.join(\", \") || \"none\"}).`, scope);\n\t}\n\tmap(operand, trail, scope) {\n\t\tif (!isPlainObject(operand)) return this.fail(trail, \"is a malformed $map token.\", scope);\n\t\tconst into = operand.into === \"record\";\n\t\tconst as = typeof operand.as === \"string\" ? operand.as : void 0;\n\t\tconst read = this.readWithSchema(operand.over, [\n\t\t\t...trail,\n\t\t\t\"$map\",\n\t\t\t\"over\"\n\t\t], scope);\n\t\tconst over = read.value;\n\t\tif (over === OMIT) return OMIT;\n\t\tconst element = read.schema === void 0 ? void 0 : elementSchemaOf(read.schema);\n\t\tconst render = (key, item) => {\n\t\t\tconst inner = [...scope, {\n\t\t\t\tpath: trail,\n\t\t\t\tkey,\n\t\t\t\titem,\n\t\t\t\t...as !== void 0 ? { as } : {},\n\t\t\t\t...element !== void 0 ? { schema: element } : {}\n\t\t\t}];\n\t\t\tconst at = [\n\t\t\t\t...trail,\n\t\t\t\t\"$map\",\n\t\t\t\t\"to\"\n\t\t\t];\n\t\t\tconst out = this.value(operand.to, at, inner);\n\t\t\tif (out === OMIT) return this.fail(at, `is ${this.omitted} as the whole $map template; there is no property to omit.`, inner);\n\t\t\treturn out;\n\t\t};\n\t\tif (Array.isArray(over)) {\n\t\t\tif (into) return this.fail(trail, `is a $map with into: \"record\", but its over (${describeToken(operand.over)}) resolved to an array, which has no keys to keep. Drop into: \"record\" (the result is an array) or map over a record.`, scope);\n\t\t\tconst rendered = over.map((item, index) => render(index, item));\n\t\t\trenderedKeys.set(rendered, over.map((_, index) => index));\n\t\t\treturn rendered;\n\t\t}\n\t\tif (isPlainObject(over)) {\n\t\t\tconst keys = Object.keys(over).sort();\n\t\t\tif (!into) {\n\t\t\t\tconst rendered = keys.map((key) => render(key, over[key]));\n\t\t\t\trenderedKeys.set(rendered, keys);\n\t\t\t\treturn rendered;\n\t\t\t}\n\t\t\tconst out = {};\n\t\t\tfor (const key of keys) out[key] = render(key, over[key]);\n\t\t\treturn out;\n\t\t}\n\t\treturn this.fail(trail, `is a $map whose over (${describeToken(operand.over)}) resolved to ${JSON.stringify(over)}${into ? `; into: \"record\" needs a record` : \", which is not an array or a record\"}.`, scope);\n\t}\n\titem(operand, trail, scope) {\n\t\treturn this.readItem(operand, trail, scope).value;\n\t}\n\t/** A `$map`'s `over` with the schema describing it, when it reads a\n\t* schema'd `$output` (or an `$item` of a schema'd element). */\n\treadWithSchema(value, trail, scope) {\n\t\tconst key = tokenKeyOf(value);\n\t\tif (isPlainObject(value) && (key === \"$output\" || key === \"$item\") && tokenSchema.safeParse(value).success) return key === \"$output\" ? this.readOutput(value, trail, scope) : this.readItem(value.$item, trail, scope);\n\t\treturn { value: this.value(value, trail, scope) };\n\t}\n\tomit(what) {\n\t\tthis.omitted = what;\n\t\treturn { value: OMIT };\n\t}\n\treadItem(operand, trail, scope) {\n\t\tconst named = isPlainObject(operand) ? operand : void 0;\n\t\tconst name = named && typeof named.as === \"string\" ? named.as : void 0;\n\t\tconst raw = named ? named.path : operand;\n\t\tconst path = pathSegments(Array.isArray(raw) ? raw : []);\n\t\tconst binding = this.binding(name, \"$item\", trail, scope);\n\t\tconst hit = walkPath(binding.item, path);\n\t\tif (!hit.ok) {\n\t\t\tif (binding.schema !== void 0 && isOptionalField(binding.schema, path, hit.at)) return this.omit(\"an absent optional $item field\");\n\t\t\tconst missing = formatPath(path.slice(0, hit.at + 1));\n\t\t\treturn this.fail(trail, `reads $item ${formatPath(path)}, but $map element ${elementText(binding)} has no ${missing} (it has: ${hit.has}).`, scope);\n\t\t}\n\t\treturn {\n\t\t\tvalue: structuredClone(hit.value),\n\t\t\tschema: schemaOf(binding.schema, path)\n\t\t};\n\t}\n\tkey(operand, trail, scope) {\n\t\tconst name = typeof operand === \"string\" ? operand : void 0;\n\t\treturn this.binding(name, \"$key\", trail, scope).key;\n\t}\n\toutput(token, trail, scope = []) {\n\t\treturn this.readOutput(token, trail, scope).value;\n\t}\n\treadOutput(token, trail, scope) {\n\t\tconst operand = token.$output;\n\t\tif (!isPlainObject(operand) || typeof operand.host !== \"string\") return this.fail(trail, \"is a malformed $output token.\", scope);\n\t\tconst ref = typeof operand.member === \"string\" ? {\n\t\t\thost: operand.host,\n\t\t\tmember: operand.member\n\t\t} : { host: operand.host };\n\t\tconst path = pathSegments(Array.isArray(operand.path) ? operand.path : []);\n\t\tif (!this.sources.outputs) return this.fail(trail, `reads ${describeToken(token)}, but no outputs are available here.`, scope);\n\t\tconst lookup = this.sources.outputs.lookup(ref);\n\t\tif (lookup.status === \"unavailable\") throw new TokenResolutionError(`${this.sources.where ? `${this.sources.where}: ` : \"\"}${lookup.message}\\n (needed by \\`${formatPath(trail)}\\`: ${describeToken(token)})`);\n\t\tconst hit = walkPath(lookup.outputs, path);\n\t\tif (!hit.ok) {\n\t\t\tif (lookup.schema !== void 0 && isOptionalField(lookup.schema, path, hit.at)) return this.omit(\"an absent optional output\");\n\t\t\tconst parent = path.slice(0, hit.at);\n\t\t\tconst container = parent.length ? `outputs.${formatPath(parent)}` : \"its outputs\";\n\t\t\tconst missing = formatPath(path.slice(0, hit.at + 1));\n\t\t\treturn this.fail(trail, `reads ${describeToken(token)}, but host \"${ref.host}\" has no output at ${missing} (${container} has: ${hit.has}).`, scope);\n\t\t}\n\t\treturn {\n\t\t\tvalue: structuredClone(hit.value),\n\t\t\tschema: schemaOf(lookup.schema, path)\n\t\t};\n\t}\n\tenv(operand, trail, scope = []) {\n\t\tconst optional = isPlainObject(operand);\n\t\tconst name = optional ? operand.name : operand;\n\t\tif (typeof name !== \"string\") return this.fail(trail, \"is a malformed $env token.\", scope);\n\t\tconst builtins = this.sources.builtins;\n\t\tif ((name === \"userData\" || name === \"projectRoot\") && builtins?.[name]) return builtins[name];\n\t\tconst value = this.sources.env?.[name];\n\t\tif (value !== void 0) return value;\n\t\tif (optional) return this.omit(\"an optional $env\").value;\n\t\treturn this.fail(trail, `reads $env ${name}, which is not set. Set ${name} in the environment of the process that resolves this host (or declare { $env: { name: \"${name}\", optional: true } } to omit the property when unset).`, scope);\n\t}\n\tconcat(parts, trail, scope = []) {\n\t\tif (!Array.isArray(parts)) return this.fail(trail, \"is a malformed $concat token.\", scope);\n\t\treturn parts.map((part, index) => {\n\t\t\tconst at = [\n\t\t\t\t...trail,\n\t\t\t\t\"$concat\",\n\t\t\t\tindex\n\t\t\t];\n\t\t\tconst value = this.value(part, at, scope);\n\t\t\tif (value === OMIT) return this.fail(at, `is ${this.omitted} inside $concat.`, scope);\n\t\t\tif (typeof value === \"string\") return value;\n\t\t\tif (typeof value === \"number\") return String(value);\n\t\t\treturn this.fail(at, `resolved to ${JSON.stringify(value)}; every $concat part must be a string or a number.`, scope);\n\t\t}).join(\"\");\n\t}\n};\nfunction resolveHostOutputs(host, sources, options) {\n\tconst resolver = new Resolver(sources, options?.deferSelf);\n\tconst out = resolver.value(host, []);\n\tif (out === OMIT) resolver.fail([], `is ${resolver.omitted} with nothing to omit it from.`);\n\tconst partial = out;\n\tif (!options) return partial;\n\tconst sites = resolver.deferred;\n\treturn {\n\t\thost: partial,\n\t\tdeferred: sites.map((d) => ({\n\t\t\tpath: formatPath(d.trail),\n\t\t\tmembers: d.members\n\t\t})),\n\t\tneeds: [...new Set(sites.flatMap((d) => d.members))],\n\t\tfinish(outputs) {\n\t\t\tconst done = cloneWithProvenance(partial);\n\t\t\tconst late = new Resolver({\n\t\t\t\t...sources,\n\t\t\t\toutputs\n\t\t\t});\n\t\t\tfor (const site of sites) {\n\t\t\t\tconst value = late.token(site.token, site.trail);\n\t\t\t\tif (value === OMIT && typeof site.trail.at(-1) === \"number\") late.fail(site.trail, `is ${late.omitted} inside an array.`);\n\t\t\t\tsetAt(done, site.trail, value === OMIT ? void 0 : value, value === OMIT);\n\t\t\t}\n\t\t\treturn done;\n\t\t}\n\t};\n}\nfunction setAt(root, trail, value, omit) {\n\tlet current = root;\n\tfor (const key of trail.slice(0, -1)) if (Array.isArray(current) && typeof key === \"number\") current = current[key];\n\telse if (isPlainObject(current) && typeof key === \"string\") current = current[key];\n\telse return;\n\tconst last = trail[trail.length - 1];\n\tif (Array.isArray(current) && typeof last === \"number\") current[last] = value;\n\telse if (isPlainObject(current) && typeof last === \"string\") {\n\t\tif (omit) delete current[last];\n\t\telse current[last] = value;\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, outputsSchema?, verbs?, ...optionalVerbs }`.\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/** Whether a value is zod-shaped (has a `safeParse` function): a runner's\n* `outputsSchema`, a plugin's config schema. */\nfunction isSchemaLike(value) {\n\treturn typeof value === \"object\" && value !== null && \"safeParse\" in value && typeof value.safeParse === \"function\";\n}\n/** The Connect runner's specifier: compounds forward `cspRegistrySync` to\n* it, and `--explain` prints its dead-config warnings. */\nconst CONNECT_RUNNER = \"@powerhousedao/ph-cli/runners/connect\";\n/** Exports that are part of the contract but are not verbs. */\nconst NON_VERB_EXPORTS = /* @__PURE__ */ new Set([\n\t\"hostSchema\",\n\t\"declaredHostSchema\",\n\t\"outputsSchema\",\n\t\"verbs\",\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\tconst declared = module.declaredHostSchema;\n\tif (declared !== void 0 && typeof declared.safeParse !== \"function\") throw new RunnerError(`Runner \"${specifier}\" exports a \\`declaredHostSchema\\` without safeParse.`);\n\tconst verbs = module.verbs;\n\tif (verbs !== void 0 && (!Array.isArray(verbs) || !verbs.every((verb) => typeof verb === \"string\" && typeof module[verb] === \"function\"))) throw new RunnerError(`Runner \"${specifier}\" exports \\`verbs\\` ${JSON.stringify(verbs)}, which must list names of exported functions.`);\n\tif (!runnerKindSchema.safeParse(module.kind).success) throw new RunnerError(`Runner \"${specifier}\" does not export a valid \\`kind\\` (got ${JSON.stringify(module.kind)}; expected \"reactor\" | \"compound\").`);\n\treturn module;\n}\n/** Verbs that produce something and start nothing (`build`): no outputs, no\n* record, no lock — and no token resolution, since what they read (output\n* dirs, packages) never comes from another host's outputs. Their verb gets\n* the declared host (tokens may remain in token-able fields). */\nconst ONE_SHOT_VERBS = /* @__PURE__ */ new Set([\"build\"]);\nfunction listVerbs(runner) {\n\tif (runner.verbs) return runner.verbs.filter((name) => typeof runner[name] === \"function\").toSorted();\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\" || !listVerbs(runner).includes(verb)) throw new RunnerError(`Runner \"${specifier}\" does not support the verb \"${verb}\". Supported verbs: ${listVerbs(runner).join(\", \")}.`);\n\treturn candidate;\n}\nfunction isRecord$2(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** reactor XOR children, decided by the runner's declared `kind`. */\nfunction assertKindShape(kind, specifier, host, file) {\n\tif (kind === \"reactor\" && host.children !== void 0) throw new RunnerError(`${file}: \"${specifier}\" is a reactor runner, so the host must not declare \\`children\\`.`, \"`children` belongs to compound hosts; a reactor host configures its own `reactor` block.\");\n\tif (kind === \"compound\" && host.reactor !== void 0) throw new RunnerError(`${file}: \"${specifier}\" is a compound runner, so the host must not declare \\`reactor\\`.`, \"A compound's reactors are its members': configure them in the member host or a wrapper's `reactor` override.\");\n}\n/** `runner.defaultVerb` and every plugin entry's `verbs` must name verbs\n* this runner exports. */\nfunction assertKnownVerbs(runner, specifier, host, file) {\n\tconst options = host.runner;\n\tif (!isRecord$2(options)) return;\n\tconst verbs = listVerbs(runner);\n\tconst unknownVerb = (verb) => typeof verb === \"string\" && !verbs.includes(verb);\n\tif (unknownVerb(options.defaultVerb)) throw new RunnerError(`${file}: runner.defaultVerb \"${options.defaultVerb}\" is not a verb of \"${specifier}\". Supported verbs: ${verbs.join(\", \")}.`);\n\tconst plugins = Array.isArray(options.plugins) ? options.plugins : [];\n\tfor (const entry of plugins) {\n\t\tif (!isRecord$2(entry) || !Array.isArray(entry.verbs)) continue;\n\t\tconst bad = entry.verbs.find(unknownVerb);\n\t\tif (bad !== void 0) throw new RunnerError(`${file}: plugin \"${String(entry.module)}\" is scoped to verb \"${bad}\", which \"${specifier}\" does not export. Supported verbs: ${verbs.join(\", \")}.`);\n\t}\n}\nfunction formatIssues(issues) {\n\treturn issues.map((i) => ` - ${i.path}: ${i.message}`).join(\"\\n\");\n}\nfunction valueAt(host, path) {\n\tlet current = host;\n\tfor (const key of path) if (Array.isArray(current) && typeof key === \"number\") current = current[key];\n\telse if (isRecord$2(current) && typeof key === \"string\") current = current[key];\n\telse return;\n\treturn current;\n}\n/**\n* Resolved validation (pipeline step 6): validate a RESOLVED host against\n* its runner's `hostSchema` and return the PARSED host (what the verb\n* receives). Run `resolveHostOutputs` first; a token still present fails\n* with its path.\n*/\nfunction validateHost(runner, specifier, host, file, options = {}) {\n\treturn parseHost(runner, options.tokens === \"allow\" ? runner.declaredHostSchema ?? runner.hostSchema : runner.hostSchema, specifier, host, file, options);\n}\nfunction parseHost(runner, schema, specifier, host, file, options) {\n\tif (isRecord$2(host)) {\n\t\tassertKindShape(runner.kind, specifier, host, file);\n\t\tif (options.tokens !== \"allow\") {\n\t\t\tconst token = findToken(host);\n\t\t\tif (token) throw new RunnerError(`${file}: \\`${token.path}\\` is an unresolved output token (${token.key}).`, \"Resolve the host (resolveHostOutputs) before validating it for a verb; `ph run` does this.\");\n\t\t}\n\t\tassertKnownVerbs(runner, specifier, host, file);\n\t}\n\tconst result = schema.safeParse(unwrapEscapes(host));\n\tif (!result.success) throw new RunnerError(`${file} failed validation against the hostSchema of \"${specifier}\":\\n${result.error.issues.map((issue) => {\n\t\tconst element = describeMapElements(host, issue.path);\n\t\treturn ` - ${(issue.path.map(String).join(\".\") || \"<root>\") + (element ? ` (${element})` : \"\")}: ${tokenKeyOf(valueAt(host, issue.path)) ? \"this field does not take an output token (it is not token-able); spell the value literally.\" : issue.message}`;\n\t}).join(\"\\n\") || \" (no details reported)\"}`);\n\treturn result.data;\n}\n/**\n* Declared validation (pipeline step 3): the removed cross-host forms\n* (each error names its token form), token shapes and `$env` `optional`\n* placement, `$output` paths against the producers' `outputsSchema`s, then\n* the runner's `declaredHostSchema` (tokens allowed in token-able fields).\n* Reads no environment value and needs no producer running. Throws on the\n* first failing stage; resolve, then `validateHost`, before a verb runs.\n*/\nfunction validateDeclaredHost(runner, specifier, host, file, options = {}) {\n\tconst removed = findRemovedForms(host);\n\tif (removed.length > 0) throw new RunnerError(`${file}: removed form:\\n${formatIssues(removed)}`);\n\tconst issues = checkTokenSites(host);\n\tif (options.outputsSchemaOf) issues.push(...checkOutputPaths(host, options.outputsSchemaOf));\n\tif (issues.length > 0) throw new RunnerError(`${file}: invalid output token:\\n${formatIssues(issues)}`);\n\tif (isRecord$2(host)) assertKindShape(runner.kind, specifier, host, file);\n\tif (!runner.declaredHostSchema) return;\n\tparseHost(runner, runner.declaredHostSchema, specifier, host, file, { tokens: \"allow\" });\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 imports are the project's\n* powerhouse.config.json, sibling `../<host>/host.js` files and sibling\n* generated `../<host>/outputs.js` token trees (host files are data, not\n* programs; `process.` is banned, environment values go through `$env`).\n* An imported outputs.js whose schema hash no longer matches its\n* producer fails here (\"run `ph generate hosts`\");\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 imports: `../<host>/host.js` — source material for derived\n* compositions (full-inclusion wrappers compute over them with plain JS) —\n* and `../<host>/outputs.js`, the generated `$output` token tree. */\nconst SIBLING_IMPORT = /^\\.\\.\\/([A-Za-z0-9_-]+)\\/(host\\.js|outputs\\.js)$/;\n/** The generated per-host token tree (`ph generate hosts`). */\nconst OUTPUTS_FILE = \"outputs.js\";\nconst GENERATE_HINT = \"Run `ph generate hosts` to (re)generate hosts/<name>/outputs.js from the producer's runner outputsSchema and declared drives.\";\n/**\n* One pass over JS source that blanks every comment and, with\n* `literals: \"blank\"`, the CONTENTS of string literals and template-literal\n* text (quotes, backticks and `${`/`}` kept). A template's `${…}` holes are\n* code: they are scanned like the rest (strings, nested templates and braces\n* inside them included). Every newline survives, so line-anchored checks and\n* line numbers still match the original source. Regex literals are not\n* recognised (host files are data; a regex is not one).\n*/\nfunction scanSource(source, literals) {\n\tconst blank = (text) => text.replace(/[^\\n]/g, \" \");\n\tconst literal = (text) => literals === \"blank\" ? blank(text) : text;\n\tlet out = \"\";\n\tlet i = 0;\n\tconst holes = [];\n\t/** Template text from `i` (just after a backtick or a hole's `}`) up to\n\t* and including its closing backtick, or up to and including the next\n\t* `${` (pushing a hole). */\n\tconst templateText = () => {\n\t\tlet j = i;\n\t\twhile (j < source.length) {\n\t\t\tconst ch = source[j];\n\t\t\tif (ch === \"\\\\\") {\n\t\t\t\tj += 2;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (ch === \"`\") break;\n\t\t\tif (ch === \"$\" && source[j + 1] === \"{\") break;\n\t\t\tj++;\n\t\t}\n\t\tout += literal(source.slice(i, Math.min(j, source.length)));\n\t\tif (j >= source.length) i = source.length;\n\t\telse if (source[j] === \"`\") {\n\t\t\tout += \"`\";\n\t\t\ti = j + 1;\n\t\t} else {\n\t\t\tout += \"${\";\n\t\t\tholes.push(0);\n\t\t\ti = j + 2;\n\t\t}\n\t};\n\twhile (i < source.length) {\n\t\tconst ch = source[i];\n\t\tconst next = source[i + 1];\n\t\tif (ch === \"/\" && next === \"/\") {\n\t\t\tconst end = source.indexOf(\"\\n\", i);\n\t\t\tconst stop = end === -1 ? source.length : end;\n\t\t\tout += blank(source.slice(i, stop));\n\t\t\ti = stop;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"/\" && next === \"*\") {\n\t\t\tconst end = source.indexOf(\"*/\", i + 2);\n\t\t\tconst stop = end === -1 ? source.length : end + 2;\n\t\t\tout += blank(source.slice(i, stop));\n\t\t\ti = stop;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"\\\"\" || ch === \"'\") {\n\t\t\tlet j = i + 1;\n\t\t\twhile (j < source.length && source[j] !== ch && source[j] !== \"\\n\") j += source[j] === \"\\\\\" ? 2 : 1;\n\t\t\tconst close = source[j] === ch ? ch : \"\";\n\t\t\tout += ch + literal(source.slice(i + 1, Math.min(j, source.length)));\n\t\t\tout += close;\n\t\t\ti = close ? j + 1 : j;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"`\") {\n\t\t\tout += \"`\";\n\t\t\ti++;\n\t\t\ttemplateText();\n\t\t\tcontinue;\n\t\t}\n\t\tif (holes.length > 0 && ch === \"{\") holes[holes.length - 1]++;\n\t\tif (holes.length > 0 && ch === \"}\") {\n\t\t\tif (holes[holes.length - 1] === 0) {\n\t\t\t\tholes.pop();\n\t\t\t\tout += \"}\";\n\t\t\t\ti++;\n\t\t\t\ttemplateText();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tholes[holes.length - 1]--;\n\t\t}\n\t\tout += ch;\n\t\ti++;\n\t}\n\treturn out;\n}\n/** Blank out `//` and block comments, keeping string and template literals\n* (URLs contain `//`) and every newline, so line-anchored checks still see\n* the code's own lines. A JSDoc `import(\"…\")` type is a comment, not code. */\nfunction stripComments(source) {\n\treturn scanSource(source, \"keep\");\n}\n/** Blank out comments and the contents of string literals and\n* template-literal text, so a word inside a string (a URL, a description,\n* an apostrophe in template text) is neither mistaken for code nor able to\n* hide code. Template `${…}` holes are code and are kept. */\nfunction blankLiterals(source) {\n\treturn scanSource(source, \"blank\");\n}\nconst PROCESS_ACCESS = /(?<![.\\w$])process\\s*(?:\\?\\.|\\.|\\[)/;\n/** Host files and generated outputs.js are data: reading the environment\n* through `process.` is banned (typed-host-configs decision 9). Environment\n* values go through `$env`, which resolves at start in the resolving\n* process. Comments are already stripped, so a mention there is fine. */\nfunction rejectProcessAccess(source, file) {\n\tconst match = PROCESS_ACCESS.exec(blankLiterals(source));\n\tif (!match) return;\n\tconst line = source.slice(0, match.index).split(\"\\n\").length;\n\tthrow new HostLoadError(`${file}:${line} reads \\`process.\\` — host files cannot read the environment directly.`, \"Use an $env token instead: { $env: \\\"NAME\\\" } (fails when unset), or { $env: { name: \\\"NAME\\\", optional: true } } as a property value to omit the property when unset. It resolves when the host starts.\");\n}\n/** Lints a host file and returns what it imports. Rejects every import\n* except the project's powerhouse.config.json, SIBLING host files (R1:\n* derived compositions) and sibling generated outputs.js token trees; any\n* dynamic `import(...)` or `require(...)`; and any `process.` access.\n* Source-level enforcement: the JSON round trip below is the hard gate; this\n* one produces the better error. */\nfunction scanHostImports(rawSource, file) {\n\tconst source = stripComments(rawSource);\n\tconst imports = {\n\t\thosts: [],\n\t\toutputs: []\n\t};\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\t(sibling[2] === HOST_FILE ? imports.hosts : imports.outputs).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, sibling hosts/<name>/host.js files or generated hosts/<name>/${OUTPUTS_FILE} token trees.`, \"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\trejectProcessAccess(source, file);\n\treturn imports;\n}\n/** {@link scanHostImports}, returning only the sibling host names (for cycle\n* detection). */\nfunction lintHostImports(rawSource, file) {\n\treturn scanHostImports(rawSource, file).hosts;\n}\n/** A generated `outputs.js` is plain data: no imports of any kind, no\n* dynamic import/require, no `process.`. */\nfunction lintOutputsFile(rawSource, file) {\n\tconst source = stripComments(rawSource);\n\tif (/^\\s*import\\b/m.test(source) || /^\\s*export\\b[^;]*?\\bfrom\\s+[\"']/m.test(source) || /\\bimport\\s*\\(/.test(source) || /\\brequire\\s*\\(/.test(source)) throw new HostLoadError(`${file} imports a module — a generated ${OUTPUTS_FILE} is plain data.`, \"Regenerate it with `ph generate hosts` instead of editing it.\");\n\trejectProcessAccess(source, file);\n}\n/** Walks the sibling-import graph from `hostName`, linting every visited file\n* (and every outputs.js it imports) and failing on a cycle (an ESM circular\n* would otherwise surface as an undefined default export with no useful\n* message). Returns the hosts whose outputs.js the graph imports, sorted. */\nfunction lintHostImportGraph(hostsDir, hostName) {\n\tconst state = /* @__PURE__ */ new Map();\n\tconst producers = /* @__PURE__ */ new Set();\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 imports = scanHostImports(readFileSync(file, \"utf8\"), file);\n\t\tfor (const producer of imports.outputs) {\n\t\t\tif (producers.has(producer)) continue;\n\t\t\tconst outputsFile = path.join(hostsDir, producer, OUTPUTS_FILE);\n\t\t\tif (!existsSync(outputsFile)) throw new HostLoadError(`hosts/${name}/host.js imports \"hosts/${producer}/${OUTPUTS_FILE}\", which does not exist.`, GENERATE_HINT);\n\t\t\tlintOutputsFile(readFileSync(outputsFile, \"utf8\"), outputsFile);\n\t\t\tproducers.add(producer);\n\t\t}\n\t\tfor (const sibling of imports.hosts) visit(sibling, [...chain, name]);\n\t\tstate.set(name, \"done\");\n\t};\n\tvisit(hostName, []);\n\treturn [...producers].sort();\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\treturn importHost(projectRoot, hostName, true);\n}\nasync function importHost(projectRoot, hostName, checkOutputs) {\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\tconst producers = lintHostImportGraph(probe.dir, hostName);\n\tif (checkOutputs) for (const producer of producers) await assertOutputsFileFresh(projectRoot, probe.dir, hostName, producer);\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}\nconst OUTPUTS_HASH_EXPORT = /^export const outputsHash = \"([^\"]+)\";$/m;\n/** The hash a generated outputs.js carries, or undefined. */\nfunction readOutputsFileHash(source) {\n\treturn OUTPUTS_HASH_EXPORT.exec(source)?.[1];\n}\nfunction canonicalJson(value) {\n\tif (Array.isArray(value)) return `[${value.map(canonicalJson).join(\",\")}]`;\n\tif (value !== null && typeof value === \"object\") return `{${Object.entries(value).filter(([, child]) => child !== void 0).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, child]) => `${JSON.stringify(key)}:${canonicalJson(child)}`).join(\",\")}}`;\n\treturn JSON.stringify(value);\n}\n/** sha256 over the canonical JSON of the generator's inputs. The host name\n* is one: every token in the file carries it, so a copied or renamed host\n* folder makes its outputs.js stale. */\nfunction computeOutputsHash(input) {\n\treturn `sha256:${createHash(\"sha256\").update(canonicalJson({\n\t\tv: 1,\n\t\thost: input.host,\n\t\trunnerModule: input.runnerModule,\n\t\toutputsSchema: input.outputsSchema,\n\t\tdrives: [...new Set(input.drives)].sort()\n\t})).digest(\"hex\").slice(0, 32)}`;\n}\nfunction isZodSchema(value) {\n\treturn value !== null && typeof value === \"object\" && \"_zod\" in value;\n}\nfunction isRecord$1(value) {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n/** Local (non-remote) slugs from a drive declaration list. */\nfunction localDriveSlugs(drives) {\n\tif (!Array.isArray(drives)) return [];\n\treturn drives.flatMap((drive) => isRecord$1(drive) && typeof drive.slug === \"string\" && drive.remote === void 0 ? [drive.slug] : []);\n}\n/**\n* Describes the outputs a host's creation produces, for `ph generate hosts`\n* and the loader's staleness check: the runner's `outputsSchema` as JSON\n* Schema and the host's declared local drives (the keys `drives.<slug>` of a\n* switchboard-like runner). Returns undefined when the runner exports no\n* `outputsSchema` (the host produces nothing a token can reference).\n*\n* Plugin-contributed drives are collected across every verb (verb scoping\n* is ignored: a drive any verb serves is referenceable). Plugins the project\n* tree cannot resolve contribute nothing, exactly as at boot. The implicit\n* default drive a switchboard serves when it declares none is NOT a known\n* key (it is not declared); reach it with a literal `$output` token.\n*/\nasync function describeHostOutputs(projectRoot, hostName) {\n\tconst { host, file } = await importHost(projectRoot, hostName, false);\n\tconst runnerModule = host.runner.module;\n\tconst schema = (await resolveRunnerModule(projectRoot, runnerModule)).outputsSchema;\n\tif (!isZodSchema(schema)) return void 0;\n\tconst { $schema: _dialect, ...outputsSchema } = z.toJSONSchema(schema, {\n\t\tio: \"output\",\n\t\tunrepresentable: \"any\"\n\t});\n\tconst reactor = host.reactor;\n\tconst drives = localDriveSlugs(isRecord$1(reactor) ? reactor.drives : []);\n\tconst entries = (host.runner.plugins ?? []).map((entry) => typeof entry === \"string\" ? entry : {\n\t\t...entry,\n\t\tverbs: \"*\"\n\t});\n\tif (entries.length > 0) {\n\t\tconst plan = await resolvePluginContributions(projectRoot, \"*\", entries, path.relative(projectRoot, file));\n\t\tdrives.push(...localDriveSlugs(plan.drives.map((drive) => drive.declaration)));\n\t}\n\tconst sortedDrives = [...new Set(drives)].sort();\n\treturn {\n\t\thost: hostName,\n\t\trunnerModule,\n\t\toutputsSchema,\n\t\tdrives: sortedDrives,\n\t\thash: computeOutputsHash({\n\t\t\thost: hostName,\n\t\t\trunnerModule,\n\t\t\toutputsSchema,\n\t\t\tdrives: sortedDrives\n\t\t})\n\t};\n}\nasync function assertOutputsFileFresh(projectRoot, hostsDir, consumer, producer) {\n\tconst rel = `hosts/${producer}/${OUTPUTS_FILE}`;\n\tconst actual = readOutputsFileHash(readFileSync(path.join(hostsDir, producer, OUTPUTS_FILE), \"utf8\"));\n\tif (!existsSync(path.join(hostsDir, producer, HOST_FILE))) throw new HostLoadError(`hosts/${consumer} imports ${rel}, but there is no hosts/${producer}/host.js to produce it.`, \"Delete the orphaned outputs.js and fix the import.\");\n\tconst description = await describeHostOutputs(projectRoot, producer);\n\tif (!description) throw new HostLoadError(`hosts/${consumer} imports ${rel}, but hosts/${producer}'s runner declares no outputsSchema, so it produces no outputs.`);\n\tif (actual !== description.hash) throw new HostLoadError(`${rel} is stale (its producer's outputsSchema or declared drives changed since it was generated); run \\`ph generate hosts\\`.`, actual === void 0 ? `${rel} carries no outputsHash export; it was not generated by \\`ph generate hosts\\`.` : `expected ${description.hash}, found ${actual}.`);\n}\n//#endregion\n//#region src/run-record-schema.ts\n/**\n* `.ph/run/<host>.json`, version 2 (typed-host-configs 3.6): what a running\n* host and its members produced. Validated on read; a v1 (or any invalid)\n* record reads as \"not running\". `projectName` is kept beyond the plan's\n* sketch because the live/foreign probe needs it. `host` is the host's\n* `name` (the file key), not its folder.\n*/\nconst outputsSchema = z.record(z.string(), z.unknown());\nconst runRecordMemberSchema = z.strictObject({\n\t/** The member's host folder (`children.<key>.host`). */\n\thost: z.string().min(1),\n\trunnerModule: z.string().min(1),\n\tkind: runnerKindSchema,\n\tverb: z.string().min(1),\n\toutputs: outputsSchema\n});\nconst runRecordSchema = z.strictObject({\n\tversion: z.literal(2),\n\thost: z.string().min(1),\n\tprojectName: z.string(),\n\tkind: runnerKindSchema,\n\tverb: z.string().min(1),\n\tpid: z.number().int(),\n\tstartedAt: z.string(),\n\t/** Standalone hosts: the runner's outputs. */\n\toutputs: outputsSchema.optional(),\n\t/** Compounds: one entry per started member, keyed by member name. */\n\tmembers: z.record(z.string(), runRecordMemberSchema).optional(),\n\t/** Host-specific extras (e.g. mcpUrl) a runner wants in the record. */\n\textra: z.record(z.string(), z.unknown()).optional()\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\tlet raw;\n\ttry {\n\t\traw = JSON.parse(fs.readFileSync(recordPath(projectDir, hostName), \"utf8\"));\n\t} catch {\n\t\treturn;\n\t}\n\tconst parsed = runRecordSchema.safeParse(raw);\n\treturn parsed.success ? parsed.data : void 0;\n}\n/** Every valid v2 record under `.ph/run/` (invalid and v1 files skipped). */\nfunction listRunRecords(projectDir) {\n\tlet files;\n\ttry {\n\t\tfiles = fs.readdirSync(runDir(projectDir));\n\t} catch {\n\t\treturn [];\n\t}\n\treturn files.filter((file) => file.endsWith(\".json\")).flatMap((file) => {\n\t\tconst record = readRunRecord(projectDir, file.slice(0, -5));\n\t\treturn record ? [record] : [];\n\t});\n}\n/** The project identity the live/foreign probe compares: package.json\n* `name`, else the folder name. */\nfunction readProjectName(projectDir) {\n\ttry {\n\t\tconst pkg = JSON.parse(fs.readFileSync(path.join(projectDir, \"package.json\"), \"utf8\"));\n\t\tif (typeof pkg.name === \"string\" && pkg.name) return pkg.name;\n\t} catch {}\n\treturn path.basename(path.resolve(projectDir));\n}\nfunction writeRunRecord(projectDir, record) {\n\tconst target = recordPath(projectDir, record.host);\n\tconst valid = runRecordSchema.parse(record);\n\tfs.mkdirSync(path.dirname(target), { recursive: true });\n\tfs.writeFileSync(target, `${JSON.stringify(valid, 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}\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\treturn substituteBuiltinEnv(value, { userData });\n}\n//#endregion\n//#region src/resolve/node.ts\n/** Load every producer host a set of refs names (each once). */\nasync function loadProducers(projectRoot, refs) {\n\tconst producers = /* @__PURE__ */ new Map();\n\tfor (const { host: folder } of refs) {\n\t\tif (producers.has(folder)) continue;\n\t\ttry {\n\t\t\tconst loaded = await loadHost(projectRoot, folder);\n\t\t\tconst specifier = loaded.host.runner.module;\n\t\t\tproducers.set(folder, {\n\t\t\t\tfolder,\n\t\t\t\tname: loaded.host.name,\n\t\t\t\tspecifier,\n\t\t\t\trunner: await resolveRunnerModule(projectRoot, specifier)\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tproducers.set(folder, { error: `names host \"${folder}\", which cannot be loaded: ${error instanceof Error ? error.message : String(error)}` });\n\t\t}\n\t}\n\treturn producers;\n}\n/** The outputs schema of a runner module, or why it has none. */\nfunction runnerOutputsSchema(runner, specifier, label) {\n\tconst schema = runner.outputsSchema;\n\tif (schema === void 0 || schema === null) return { error: `${label} runs \"${specifier}\", which exports no outputsSchema, so it produces no outputs a token can read.` };\n\treturn {\n\t\tschema,\n\t\tlabel: `\"${specifier}\" (${label})`\n\t};\n}\n/** Declared-validation lookup for a standalone host's producers. */\nfunction producerOutputsSchemas(producers) {\n\treturn (ref) => {\n\t\tconst info = producers.get(ref.host);\n\t\tif (!info) return { error: `names host \"${ref.host}\", which was not loaded.` };\n\t\tif (\"error\" in info) return { error: info.error };\n\t\treturn runnerOutputsSchema(info.runner, info.specifier, `host \"${ref.host}\"`);\n\t};\n}\n/**\n* Standalone `$output` source: the producer's live v2 run record. Its own\n* standalone record first (keyed by the producer's `name`); else a live\n* compound of this project with exactly one member running that host. A\n* missing, stale, foreign or output-less record means \"not running\", and the\n* lookup fails naming the producer and how to start it (no fallback to the\n* producer's declared config, no waiting).\n*/\nfunction runRecordOutputSource(projectRoot, options) {\n\tconst { consumer, producers, projectName } = options;\n\treturn { lookup(ref) {\n\t\tconst notRunning = `${consumer} needs outputs from host \"${ref.host}\", which is not running. Start it first: ph run ${ref.host} (or run a compound that includes it).`;\n\t\tconst info = producers.get(ref.host);\n\t\tconst schema = info && !(\"error\" in info) ? info.runner.outputsSchema : void 0;\n\t\tconst withSchema = schema !== void 0 && schema !== null ? { schema } : {};\n\t\tif (ref.member === void 0 && info && !(\"error\" in info)) {\n\t\t\tconst probe = probeRun(projectRoot, info.name, projectName);\n\t\t\tif (probe.status === \"live\" && probe.record.outputs) return {\n\t\t\t\tstatus: \"available\",\n\t\t\t\toutputs: probe.record.outputs,\n\t\t\t\t...withSchema\n\t\t\t};\n\t\t}\n\t\tconst members = listRunRecords(projectRoot).filter((record) => record.members !== void 0 && record.projectName === projectName && isPidAlive(record.pid)).flatMap((record) => Object.entries(record.members ?? {}).filter(([key, member]) => member.host === ref.host && (ref.member === void 0 || key === ref.member)).map(([key, member]) => ({\n\t\t\tcompound: record.host,\n\t\t\tkey,\n\t\t\tmember\n\t\t})));\n\t\tif (members.length === 1) return {\n\t\t\tstatus: \"available\",\n\t\t\toutputs: members[0].member.outputs,\n\t\t\t...withSchema\n\t\t};\n\t\tif (members.length > 1) return {\n\t\t\tstatus: \"unavailable\",\n\t\t\tmessage: `${consumer} needs outputs from host \"${ref.host}\", which runs as ${members.map((m) => `member \"${m.key}\" of \"${m.compound}\"`).join(\" and \")}; stop all but one, or run ${ref.host} on its own.`\n\t\t};\n\t\treturn {\n\t\t\tstatus: \"unavailable\",\n\t\t\tmessage: notRunning\n\t\t};\n\t} };\n}\n/** The resolving process's `$env` inputs: its environment plus the\n* always-resolvable built-ins (`userData` honours PH_USER_DATA_DIR). */\nfunction processResolveEnv(projectRoot, env = process.env) {\n\treturn {\n\t\tenv,\n\t\tbuiltins: {\n\t\t\tuserData: defaultUserDataDir(projectRoot, env),\n\t\t\tprojectRoot: path.resolve(projectRoot)\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resolve/sources.ts\n/**\n* The compound output source: a member's `$output` tokens read the live\n* `RunnerHandle.outputs` of the members started before it. `schemas` (member\n* key → its runner's `outputsSchema`) lets an absent optional output field\n* omit the consuming property. Pure (the run-record source for standalone\n* hosts is node: ./node.ts).\n*/\nfunction compoundOutputSource(members, started, compound, schemas) {\n\treturn { lookup(ref) {\n\t\tconst target = memberForRef(ref, members);\n\t\tif (\"error\" in target) return {\n\t\t\tstatus: \"unavailable\",\n\t\t\tmessage: `compound \"${compound}\": a token ${target.error}`\n\t\t};\n\t\tif (!started.has(target.key)) return {\n\t\t\tstatus: \"unavailable\",\n\t\t\tmessage: `compound \"${compound}\": member \"${target.key}\" (host \"${ref.host}\") has not started yet; a producer must start before its consumers.`\n\t\t};\n\t\tconst schema = schemas?.get(target.key);\n\t\treturn {\n\t\t\tstatus: \"available\",\n\t\t\toutputs: started.get(target.key),\n\t\t\t...schema !== void 0 ? { schema } : {}\n\t\t};\n\t} };\n}\n//#endregion\n//#region src/runner-handle.ts\n/** The data half of a handle, validated by the compound. `ready`/`shutdown`\n* are functions and promises, so they are checked as TS fields, not here. */\nconst runnerHandleSchema = z.looseObject({ outputs: z.record(z.string(), z.unknown()).optional() });\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction isPromiseLike(value) {\n\treturn isRecord(value) && typeof value.then === \"function\";\n}\nfunction isCallable(value) {\n\treturn typeof value === \"function\";\n}\n/** Normalize what a verb returned. `undefined` (a self-sustaining bridge)\n* is an empty handle; anything else must match runnerHandleSchema. */\nfunction toStartedHandle(value, where) {\n\tif (value === void 0 || value === null) return { outputs: {} };\n\tconst parsed = runnerHandleSchema.safeParse(value);\n\tif (!parsed.success) throw new Error(`${where} returned an invalid runner handle:\\n${z.prettifyError(parsed.error)}`);\n\tconst live = isRecord(value) ? value : {};\n\tconst shutdown = live.shutdown;\n\treturn {\n\t\t...parsed.data,\n\t\toutputs: parsed.data.outputs ?? {},\n\t\t...isPromiseLike(live.ready) ? { ready: live.ready } : {},\n\t\t...isCallable(shutdown) ? { shutdown: () => shutdown.call(value) } : {}\n\t};\n}\n//#endregion\n//#region src/compound.ts\n/** Build the member host object the member runner sees: the member's own\n* host.js with the wrapper applied. A wrapper SECTION is a FULL STATEMENT —\n* `reactor` and `config`, when present on the wrapper, replace the member's\n* wholesale; `runner` key-merges (wrappers override port, host, plugins…). */\nasync function memberDraft(projectRoot, member) {\n\tconst base = (await loadHost(projectRoot, member.host)).host;\n\tconst reactor = member.reactor ?? base.reactor;\n\tconst config = member.config ?? base.config;\n\treturn {\n\t\t...base,\n\t\trunner: {\n\t\t\t...base.runner,\n\t\t\t...member.runner\n\t\t},\n\t\t...config !== void 0 ? { config } : {},\n\t\t...reactor !== void 0 ? { reactor } : {}\n\t};\n}\n/** Whether a member receives the compound's `cspRegistrySync` wiring (as\n* `runner.cspRegistrySync`): its runner declares that option (any specifier\n* that reaches the Connect runner), or it names the Connect runner. A\n* member's role is its runner, not its folder. */\nfunction takesCspRegistrySync(m) {\n\treturn m.specifier === \"@powerhousedao/ph-cli/runners/connect\" || declaresKey(m.runner.hostSchema, [\"runner\"], \"cspRegistrySync\");\n}\n/** At compound verb \"run\" each member runs its own (merged) defaultVerb —\n* what lets a desktop compound pair a switchboard at `run` with a connect at\n* `serve`. An explicit forwarded verb stays uniform across members. */\nfunction memberVerbOf(compoundVerb, runner) {\n\treturn compoundVerb === \"run\" ? runner.defaultVerb ?? \"run\" : compoundVerb;\n}\nasync function runCompound(hostInput, ctx, options) {\n\tconst compoundFile = `hosts/${hostInput.name}`;\n\tconst removed = findRemovedForms(hostInput);\n\tif (removed.length > 0) throw new RunnerError(`${compoundFile}: removed form:\\n${removed.map((r) => ` - ${r.path}: ${r.message}`).join(\"\\n\")}`);\n\tconst parsed = declaredGenericCompoundHostSchema.safeParse(hostInput);\n\tif (!parsed.success) throw new Error(`${compoundFile}: invalid compound host:\\n${z.prettifyError(parsed.error)}`);\n\tconst host = parsed.data;\n\tconst projectRoot = ctx.projectRoot;\n\tconst wiring = host.config ?? {};\n\tconst verb = ctx.verb;\n\tconst oneShotCompound = ONE_SHOT_VERBS.has(verb);\n\tconst keepsRecord = wiring.runtimeRecord !== false && !oneShotCompound;\n\tconst probe = oneShotCompound ? void 0 : 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 prepared = await prepareMembers(projectRoot, host.children);\n\tconst plan = planCompound(prepared.map((m) => ({\n\t\tkey: m.key,\n\t\thost: m.member.host,\n\t\trefs: outputSitesOf(m.draft).map(({ ref, path }) => ({\n\t\t\tref,\n\t\t\tpath\n\t\t}))\n\t})), wiring.startOrder);\n\tconst byKey = new Map(prepared.map((m) => [m.key, m]));\n\tconst members = prepared.map((m) => ({\n\t\tkey: m.key,\n\t\thost: m.member.host\n\t}));\n\tfor (const m of prepared) validateDeclaredHost(m.runner, m.specifier, m.draft, m.file, { 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\tif (wiring.cspRegistrySync && !prepared.some(takesCspRegistrySync)) console.warn(`${compoundFile}: config.cspRegistrySync is set, but no member's runner declares runner.cspRegistrySync (members run: ${prepared.map((m) => m.specifier).join(\", \")}); the baked Connect CSP is not patched for the runtime registry.`);\n\tconst started = [];\n\tconst liveOutputs = /* @__PURE__ */ new Map();\n\tconst outputs = compoundOutputSource(members, liveOutputs, host.name, new Map(prepared.map((m) => [m.key, m.runner.outputsSchema])));\n\tconst resolveEnv = processResolveEnv(projectRoot, ctx.env);\n\tlet stopping;\n\tconst shutdown = () => stopping ??= (async () => {\n\t\tfor (const m of [...started].reverse()) try {\n\t\t\tawait m.handle.shutdown?.();\n\t\t} catch {}\n\t\tif (keepsRecord) clearRunRecord(projectRoot, host.name);\n\t})();\n\ttry {\n\t\tfor (const name of plan.order) {\n\t\t\tconst m = byKey.get(name);\n\t\t\tif (!m) continue;\n\t\t\tconst memberVerb = memberVerbOf(verb, m.draft.runner);\n\t\t\tconst oneShot = ONE_SHOT_VERBS.has(memberVerb);\n\t\t\tconst resolved = oneShot ? substituteBuiltinEnv(m.draft, resolveEnv.builtins ?? {}) : resolveHostOutputs(m.draft, {\n\t\t\t\toutputs,\n\t\t\t\t...resolveEnv,\n\t\t\t\twhere: m.file\n\t\t\t});\n\t\t\tif (wiring.cspRegistrySync && takesCspRegistrySync(m)) resolved.runner = {\n\t\t\t\t...resolved.runner,\n\t\t\t\tcspRegistrySync: true\n\t\t\t};\n\t\t\tconst validated = validateHost(m.runner, m.specifier, resolved, m.file, oneShot ? { tokens: \"allow\" } : {});\n\t\t\tconst fn = getVerb(m.runner, m.specifier, memberVerb);\n\t\t\tconst where = `${name} (${m.specifier} ${memberVerb})`;\n\t\t\tconst handle = toStartedHandle(await fn(validated, {\n\t\t\t\tprojectRoot,\n\t\t\t\tenv: ctx.env,\n\t\t\t\tverb: memberVerb,\n\t\t\t\tparent: {\n\t\t\t\t\thost: host.name,\n\t\t\t\t\tverb\n\t\t\t\t}\n\t\t\t}), where);\n\t\t\tstarted.push({\n\t\t\t\tname,\n\t\t\t\tmember: m.member,\n\t\t\t\tspecifier: m.specifier,\n\t\t\t\tkind: m.runner.kind,\n\t\t\t\tverb: memberVerb,\n\t\t\t\thandle,\n\t\t\t\toutputs: handle.outputs\n\t\t\t});\n\t\t\tif (handle.ready) await handle.ready;\n\t\t\tlet memberOutputs = handle.outputs;\n\t\t\tif (!oneShot && isSchemaLike(m.runner.outputsSchema)) {\n\t\t\t\tconst checked = m.runner.outputsSchema.safeParse(handle.outputs);\n\t\t\t\tif (!checked.success) throw new Error(`${where} reported outputs that fail its outputsSchema:\\n${checked.error.issues.map((i) => ` - ${i.path.map(String).join(\".\") || \"<root>\"}: ${i.message}`).join(\"\\n\")}`);\n\t\t\t\tif (!isPlainObject(checked.data)) throw new Error(`${where}: its outputsSchema parsed the outputs to ${JSON.stringify(checked.data)}, not an object.`);\n\t\t\t\tmemberOutputs = checked.data;\n\t\t\t}\n\t\t\tstarted[started.length - 1].outputs = memberOutputs;\n\t\t\tliveOutputs.set(name, memberOutputs);\n\t\t}\n\t} catch (error) {\n\t\tawait shutdown();\n\t\tthrow error;\n\t}\n\tif (keepsRecord) {\n\t\tconst recordMembers = {};\n\t\tfor (const m of started) recordMembers[m.name] = {\n\t\t\thost: m.member.host,\n\t\t\trunnerModule: m.specifier,\n\t\t\tkind: m.kind,\n\t\t\tverb: m.verb,\n\t\t\toutputs: m.outputs\n\t\t};\n\t\twriteRunRecord(projectRoot, {\n\t\t\tversion: 2,\n\t\t\thost: host.name,\n\t\t\tprojectName: options.projectName,\n\t\t\tkind: \"compound\",\n\t\t\tverb,\n\t\t\tpid: process.pid,\n\t\t\tstartedAt: (/* @__PURE__ */ new Date()).toISOString(),\n\t\t\tmembers: recordMembers,\n\t\t\t...options.recordExtra ? { extra: options.recordExtra } : {}\n\t\t});\n\t}\n\tconst exit = options.exit ?? ((code) => process.exit(code));\n\tlet signalled;\n\tconst handleSignal = (signal) => {\n\t\tif (signalled) return signalled;\n\t\tconst code = signal === \"SIGINT\" ? 130 : 143;\n\t\tsignalled = shutdown().finally(() => exit(code));\n\t\treturn signalled;\n\t};\n\tif (options.installSignalHandlers !== false) {\n\t\tprocess.on(\"exit\", () => {\n\t\t\tif (keepsRecord) clearRunRecord(projectRoot, host.name);\n\t\t});\n\t\tprocess.on(\"SIGINT\", () => void handleSignal(\"SIGINT\"));\n\t\tprocess.on(\"SIGTERM\", () => void handleSignal(\"SIGTERM\"));\n\t}\n\treturn {\n\t\tstarted,\n\t\tshutdown,\n\t\thandleSignal\n\t};\n}\n/** Load every member's draft and runner, in declaration order. */\nasync function prepareMembers(projectRoot, children) {\n\tconst out = [];\n\tfor (const [key, member] of Object.entries(children)) {\n\t\tconst draft = await memberDraft(projectRoot, member);\n\t\tconst specifier = draft.runner.module;\n\t\tout.push({\n\t\t\tkey,\n\t\t\tmember,\n\t\t\tdraft,\n\t\t\tspecifier,\n\t\t\trunner: await resolveRunnerModule(projectRoot, specifier),\n\t\t\tfile: `hosts/${member.host}/host.js`\n\t\t});\n\t}\n\treturn out;\n}\n//#endregion\nexport { envSitesOf as $, PluginError as $t, probeHostsFolder as A, driveDeclarationSchema as At, resolveRunnerModule as B, isToken as Bt, computeOutputsHash as C, reactorHostSchema as Ct, lintHostImports as D, runnerBaseSchema as Dt, lintHostImportGraph as E, refineStartOrder as Et, ONE_SHOT_VERBS as F, concatTokenSchema as Ft, resolveHostOutputs as G, ref as Gt, validateHost as H, keyTokenSchema as Ht, RunnerError as I, envTokenSchema as It, planCompound as J, tokenable as Jt, PlanError as K, tokenKeyOf as Kt, getVerb as L, envTokenable as Lt, scanHostImports as M, projectDriveIdWith as Mt, stripComments as N, TOKEN_ESCAPE_KEY as Nt, lintOutputsFile as O, runnerKindSchema as Ot, CONNECT_RUNNER as P, TOKEN_KEYS as Pt, checkTokenSites as Q, resolvePluginContributions as Qt, isSchemaLike as R, findToken as Rt, OUTPUTS_FILE as S, reactorBackendSchema as St, findNonStaticValue as T, reactorSchema as Tt, TokenResolutionError as U, mapTokenSchema as Ut, validateDeclaredHost as V, itemTokenSchema as Vt, describeMapElements as W, outputTokenSchema as Wt, findRemovedForms as X, findDeadConnectConfig as Xt, substituteBuiltinEnv as Y, CONNECT_PLUGIN_OWNED_SLICES as Yt, checkOutputPaths as Z, resolveHostPlugins as Zt, readRunRecord as _, emittedHostSchemas as _t, loadProducers as a, pluginEntryObjectSchema as an, describeToken as at, runRecordSchema as b, profileSchema as bt, runRecordOutputSource as c, resolveOrder as cn, unwrapEscapes as ct, resolveUserDataPlaceholders as d, runProvideHook as dn, compoundHostSchema as dt, entryActiveForVerb as en, outputRefsOf as et, clearRunRecord as f, runTransformHook as fn, compoundWiringSchema as ft, readProjectName as g, emitHostJsonSchema as gt, probeRun as h, defineHostSchemas as ht, compoundOutputSource as i, normalizePluginEntry as in, collectTokenSites as it, readOutputsFileHash as j, drivesSchema as jt, loadHost as k, buildDriveDeclarationSchema as kt, runnerOutputsSchema as l, runObserveHook as ln, childWrapperSchema as lt, listRunRecords as m, declaredHostSchemas as mt, runnerHandleSchema as n, mergeContributions as nn, refKey as nt, processResolveEnv as o, pluginEntrySchema as on, formatPath as ot, isPidAlive as p, declaredGenericCompoundHostSchema as pt, memberForRef as q, tokenSchema as qt, toStartedHandle as r, normalizePluginEntries as rn, schemaAtPath as rt, producerOutputsSchemas as s, registerHostType as sn, renderTokens as st, runCompound as t, hostTypeSatisfies as tn, outputSitesOf as tt, defaultUserDataDir as u, runObserveHookSequential as un, childrenSchema as ut, writeRunRecord as v, genericCompoundHostSchema as vt, describeHostOutputs as w, reactorProtocolSchema as wt, HostLoadError as x, reactorBackendKindSchema as xt, runRecordMemberSchema as y, makeHostSchemas as yt, listVerbs as z, forbidRef as zt };\n\n//# sourceMappingURL=compound-B6RZMA0Y.mjs.map"],"names":["z.strictObject","z.string","z.boolean","z.union","z.literal","z.array","z.record","z.unknown","z.prettifyError","z.enum","z.url","z.number","z.looseObject","z.toJSONSchema"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAI,cAAc,cAAc,MAAM;CACrC,YAAY,SAAS,MAAM;EAC1B,MAAM,OAAO,GAAG,QAAQ,YAAY,SAAS,OAAO;EACpD,KAAK,OAAO;CACb;AACD;AACA,MAAM,0BAA0BA,aAAe;CAC9C,QAAQC,OAAS,CAAC,CAAC,IAAI,CAAC;;CAExB,SAASC,QAAU,CAAC,CAAC,SAAS;;CAE9B,OAAOC,MAAQ,CAACC,QAAU,GAAG,GAAGC,MAAQJ,OAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;;CAE7E,QAAQK,OAASL,OAAS,GAAGM,QAAU,CAAC,CAAC,CAAC,SAAS;AACpD,CAAC;AACD,MAAM,oBAAoBJ,MAAQ,CAACF,OAAS,CAAC,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC;AAC9E,SAAS,qBAAqB,OAAO;CACpC,IAAI,OAAO,UAAU,UAAU,OAAO;EACrC,QAAQ;EACR,SAAS;EACT,OAAO;EACP,QAAQ,CAAC;CACV;CACA,OAAO;EACN,QAAQ,MAAM;EACd,SAAS,MAAM,WAAW;EAC1B,OAAO,MAAM,SAAS;EACtB,QAAQ,MAAM,UAAU,CAAC;CAC1B;AACD;;;AAGA,SAAS,uBAAuB,SAAS,OAAO;CAC/C,MAAM,aAAa,QAAQ,IAAI,oBAAoB;CACnD,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,MAAM,SAAS,YAAY;EAC/B,IAAI,KAAK,IAAI,MAAM,MAAM,GAAG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C/C;AACA,SAAS,cAAc,OAAO;CAC7B,OAAO,SAAS,KAAK,KAAK,OAAO,MAAM,SAAS;AACjD;AACA,SAAS,WAAW,OAAO;CAC1B,OAAO,OAAO,UAAU;AACzB;;;AAGA,SAAS,gBAAgB,OAAO,OAAO;CACtC,IAAI,UAAU,KAAK,KAAK,UAAU,MAAM,OAAO,EAAE,SAAS,CAAC,EAAE;CAC7D,MAAM,SAAS,mBAAmB,UAAU,KAAK;CACjD,IAAI,CAAC,OAAO,SAAS,MAAM,IAAI,MAAM,GAAG,MAAM,uCAAuCC,cAAgB,OAAO,KAAK,GAAG;CACpH,MAAM,OAAO,SAAS,KAAK,IAAI,QAAQ,CAAC;CACxC,MAAM,WAAW,KAAK;CACtB,OAAO;EACN,GAAG,OAAO;EACV,SAAS,OAAO,KAAK,WAAW,CAAC;EACjC,GAAG,cAAc,KAAK,KAAK,IAAI,EAAE,OAAO,KAAK,MAAM,IAAI,CAAC;EACxD,GAAG,WAAW,QAAQ,IAAI,EAAE,gBAAgB,SAAS,KAAK,KAAK,EAAE,IAAI,CAAC;CACvE;AACD","debug_id":"4521b21a-8bc8-5253-a45e-5f2575622f79"}
@@ -1,7 +1,7 @@
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]="ac5e13d8-e48c-551e-be3c-5634ce89d62e")}catch(e){}}();
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]="5497a7c8-8c65-59a9-b087-4231887964da")}catch(e){}}();
3
3
  import { s as runBuild } from "./build-Dj8qfSSe.mjs";
4
- import { t as buildCliConnectOverride } from "./cli-connect-override-Cf7WutqU.mjs";
4
+ import { t as buildCliConnectOverride } from "./cli-connect-override-CEJhQWRX.mjs";
5
5
  import { n as isPrecompressEnabled, r as precompressAssets } from "./precompress-P6cJDPVC.mjs";
6
6
  import { existsSync, mkdirSync, readdirSync, rmSync } from "node:fs";
7
7
  import { join, resolve } from "node:path";
@@ -249,5 +249,5 @@ function assertLocalPackagesInstalled(projectPath) {
249
249
  //#endregion
250
250
  export { runConnectBuild };
251
251
 
252
- //# sourceMappingURL=connect-build-BtKpvcQK.mjs.map
253
- //# debugId=ac5e13d8-e48c-551e-be3c-5634ce89d62e
252
+ //# sourceMappingURL=connect-build-BfhOGbha.mjs.map
253
+ //# debugId=5497a7c8-8c65-59a9-b087-4231887964da
@@ -1 +1 @@
1
- {"version":3,"file":"connect-build-BtKpvcQK.mjs","sources":["../src/services/connect-build.ts"],"sourcesContent":["import {\n DEFAULT_VENDOR_INCLUDE,\n DYNAMIC_BASE_PLACEHOLDER,\n directoryContentDigest,\n findPackageRoot,\n getConnectBaseViteConfig,\n missingVendorEntries,\n prebuildConnectVendor,\n ownProjectPackage,\n prebuildReactorWorker,\n prebuildWorkerPackages,\n resolveReactorWorkerSource,\n type PrebuiltReactorWorker,\n type PrebuiltVendor,\n} from \"@powerhousedao/builder-tools\";\nimport { getConfig } from \"@powerhousedao/shared/clis\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport {\n deepMerge,\n normalizeBasePath,\n SHARED_DEP_SPECIFIERS,\n SHARED_SUBPATHS,\n} from \"@powerhousedao/shared/connect\";\nimport { existsSync, mkdirSync, readdirSync, rmSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport type { InlineConfig } from \"vite\";\nimport { build, mergeConfig } from \"vite\";\nimport type { ConnectBuildArgs } from \"../types.js\";\nimport { buildCliConnectOverride } from \"../utils/cli-connect-override.js\";\nimport {\n isPrecompressEnabled,\n precompressAssets,\n} from \"../utils/precompress.js\";\nimport { runBuild } from \"./build.js\";\n\nexport async function runConnectBuild(\n args: ConnectBuildArgs,\n callerOverride?: PHConnectRuntimeConfig,\n { routes }: { routes?: string | false } = {},\n) {\n const { outDir, debug, dynamicBase, favicon } = args;\n\n const mode = \"production\";\n const dirname = process.cwd();\n\n // Build has no read mode; a bare positional `<key>` is a user error. The\n // 2-positional `<key> <value>` form is handled inside buildCliConnectOverride\n // so it layers on top of --json + flags like any other override input.\n if (args.keyPositional !== undefined && args.valuePositional === undefined) {\n throw new Error(\n \"ph connect build: positional override requires both <key> and <value> (e.g. `ph connect build connect.renown.url https://renown.staging`). To read a value, use `ph connect config <key>`.\",\n );\n }\n\n // Fail fast if any package marked as provider: \"local\" is missing from\n // node_modules — the Vite plugin that bundles them needs them on disk.\n assertLocalPackagesInstalled(dirname);\n\n // Build the CLI override layers (--json + individual flags + positional)\n // once here so a bad payload fails before we waste a build.\n // `--packages-registry` lands at the top-level `packageRegistryUrl`\n // (mirrors source-config shape); every other flag feeds the connect-block\n // precedence ladder.\n const cli = buildCliConnectOverride(args);\n const { packageRegistryUrl } = cli;\n // A runner's host config sits under the CLI's flags.\n const connectOverride = callerOverride\n ? deepMerge(callerOverride, cli.connectOverride ?? {})\n : cli.connectOverride;\n\n await runBuild({\n outDir: \"dist\",\n debug,\n // Local packages built for Connect share deps with the app vendor, same\n // as a plain `ph build`.\n noSharedDeps: false,\n ignoreTypeErrors: false,\n });\n\n // Production shared-dependency vendor: prebuilt into <outDir>/__vendor__\n // before the app build. On by default; PH_CONNECT_VENDOR=0|false disables\n // it. A failed prebuild fails the build — production must not ship import\n // map entries pointing at a vendor that was never built (the dev server\n // keeps its own soft fallback in the dev plugin).\n const outDirAbs = resolve(dirname, outDir);\n let vendor: PrebuiltVendor | null = null;\n // The deploy base the vendor's import-map addresses are written against.\n // Only meaningful when the vendor is built; \"/\" is the inert default.\n let appBase = \"/\";\n // The prebuild out dirs' parent must exist before the prebuilds: their\n // build locks are siblings of the out dirs, and the package build\n // (runBuild) writes to a different out dir, so nothing else creates it yet.\n mkdirSync(outDirAbs, { recursive: true });\n if (isVendorEnabled()) {\n const errorRef: { message?: string } = {};\n // The same base string the app build uses below: the dynamic-base\n // placeholder, or the normalized deploy base (CLI override wins over the\n // source config). The vendor worker appends its own segment.\n const phConfig = getConfig(join(dirname, \"powerhouse.config.json\"));\n const connectBasePath =\n connectOverride?.app?.basePath ?? phConfig.connect?.app?.basePath;\n appBase = dynamicBase\n ? DYNAMIC_BASE_PLACEHOLDER\n : connectBasePath\n ? normalizeBasePath(connectBasePath)\n : \"/\";\n vendor = await prebuildConnectVendor({\n dirname,\n include: productionVendorInclude(),\n vendorDir: join(outDirAbs, \"__vendor__\"),\n base: appBase,\n nodeEnv: \"production\",\n errorRef,\n ...connectOwnVendorDeps(dirname),\n });\n if (!vendor) {\n console.error(\n `ph connect build: the shared-dependency vendor failed to build${\n errorRef.message ? `:\\n${errorRef.message}` : \"\"\n }`,\n );\n throw new Error(\"shared-dependency vendor prebuild failed\");\n }\n }\n\n // Reactor SharedWorker bundle: the dist worker is a library artifact whose\n // bare imports no worker can resolve (import maps do not apply to workers),\n // so the deployable form is prebuilt here. With a vendor, its shared deps\n // are externalized onto ../__vendor__/ so page and worker share one cache\n // entry per dep; without one it is fully self-contained.\n const reactorWorker = await prebuildReactorWorkerBundle(\n dirname,\n outDirAbs,\n vendor,\n connectOverride,\n );\n\n // Local project models the worker cannot get from the registry, built into\n // the worker bundle's own directory so they share its vendor.\n if (reactorWorker) {\n await prebuildLocalWorkerPackages(\n dirname,\n outDirAbs,\n vendor,\n reactorWorker.vendorImports,\n );\n }\n\n const keepDirs = [\n ...(vendor ? [\"__vendor__\"] : []),\n ...(reactorWorker ? [\"__reactor_worker__\"] : []),\n ];\n // Stale top-level output goes, the prebuilt dirs stay: the app build below\n // runs with emptyOutDir: false and must not wipe them.\n if (keepDirs.length > 0) {\n cleanDistExcept(outDirAbs, keepDirs);\n }\n\n const baseConfig = getConnectBaseViteConfig({\n mode,\n dirname,\n cliConnectOverride: connectOverride,\n cliPackageRegistryUrl: packageRegistryUrl,\n dynamicBase,\n favicon,\n routes,\n // Vendor import-map entries are relative (leading slash stripped) so\n // they resolve against the page URL under any deploy base — root or\n // subpath, dynamic or concrete.\n vendor: vendor\n ? {\n imports: vendorImportMapEntries(vendor.imports, appBase),\n versions: vendor.versions,\n sharedDeps: vendorImportMapEntries(\n { sharedDeps: vendor.sharedDeps },\n appBase,\n ).sharedDeps,\n }\n : undefined,\n reactorWorkerVersion: reactorWorker\n ? directoryContentDigest(join(outDirAbs, \"__reactor_worker__\"))\n : undefined,\n });\n\n const buildConfig: InlineConfig = {\n build: {\n outDir,\n // The vendor / worker dirs were prebuilt into the out dir above; the\n // build must not empty them.\n ...(keepDirs.length > 0 ? { emptyOutDir: false } : {}),\n },\n };\n\n const config = mergeConfig(baseConfig, buildConfig);\n\n await build(config);\n\n // Last word on the shipped artifact: every specifier the page's import map\n // publishes must have a file next to it. The prebuild verifies its own\n // output, but it can return a cache hit it never rebuilt, and both the\n // stale-output clean and the app build run afterwards. An entry with no\n // file behind it ships as a URL that 404s, and a SPA answers that with\n // index.html — so the browser reports only an opaque MIME-type error with\n // no filename. Fail here instead, naming the entries.\n if (vendor) {\n const unbacked = missingVendorEntries(\n join(outDirAbs, \"__vendor__\"),\n vendor.imports,\n );\n if (unbacked.length > 0) {\n throw new Error(\n `ph connect build: the shared-dependency vendor is missing ` +\n `${unbacked.length} of the ${Object.keys(vendor.imports).length} ` +\n `entries its import map publishes:\\n` +\n unbacked.map((e) => ` ${e.spec} -> ${e.url}`).join(\"\\n\"),\n );\n }\n }\n\n // Runs after the PWA plugin, so the siblings never enter the precache list.\n if (isPrecompressEnabled()) {\n const r = await precompressAssets(outDirAbs);\n console.log(\n `ph connect build: precompressed ${r.files} wasm/data files ` +\n `(${r.written} .gz written, ${(r.outputBytes / 1e6).toFixed(1)} MB) in ${(r.ms / 1000).toFixed(1)}s`,\n );\n }\n}\n\n/**\n * The specifier set the production vendor bundles: the dev-proven heavy set\n * ∪ the package-shared set — everything the app and loaded packages\n * externalize onto the vendor.\n *\n * Two specifiers are deliberately dropped:\n *\n * - `@powerhousedao/connect`. It is in DEFAULT_VENDOR_INCLUDE because the dev\n * server vendors the app to keep rebuilds cheap, but in a production build\n * the app *is* Connect: `SHARED_DEP_SPECIFIERS` omits it, so the app build\n * never externalizes it and nothing would ever resolve its import-map\n * entry. Vendoring it is not merely dead weight — bundling Connect's dist\n * for the browser pulls in its node-only `@powerhousedao/config/node`\n * import, and so `read-pkg` -> `unicorn-magic`, whose browser entry has no\n * `toPath`. That fails the vendor build, and a failed prebuild fails\n * `ph connect build`.\n * - the bare `@powerhousedao/shared` root, whose barrel likewise reaches\n * node-only modules. Its browser-safe subpaths (SHARED_SUBPATHS) are\n * listed instead; a package importing the bare root bundles its own copy.\n */\nexport function productionVendorInclude(): string[] {\n return [\n ...new Set([\n ...DEFAULT_VENDOR_INCLUDE.filter((s) => s !== \"@powerhousedao/connect\"),\n ...SHARED_DEP_SPECIFIERS.filter((s) => s !== \"@powerhousedao/shared\"),\n ...SHARED_SUBPATHS.map((s) => `@powerhousedao/shared/${s}`),\n // Connect imports these roots too; unvendored, the app re-bundles their shared chunks.\n \"@powerhousedao/design-system\",\n \"@powerhousedao/reactor\",\n ]),\n ];\n}\n\n/** Connect's own deps that vendored packages also bundle; projects don't install them. */\nexport const CONNECT_OWN_VENDOR_DEPS = [\n \"kysely\",\n \"tailwind-merge\",\n \"@renown/sdk\",\n \"@renown/sdk/crypto\",\n \"@renown/sdk/trust\",\n \"@powerhousedao/reactor-attachments/client\",\n // One core and router for Connect and packages; the route tree, config and\n // embedded subpaths stay with the app.\n \"@powerhousedao/connect-core\",\n \"@powerhousedao/connect-core/router\",\n \"@powerhousedao/connect-core/plugins\",\n \"@powerhousedao/connect-core/runtime\",\n \"@powerhousedao/connect-core/views\",\n \"@tanstack/react-router\",\n];\n\nexport function connectOwnVendorDeps(dirname: string): {\n ownDeps?: { specs: string[]; from: string };\n} {\n const from = findPackageRoot(dirname, \"@powerhousedao/connect\");\n return from ? { ownDeps: { specs: CONNECT_OWN_VENDOR_DEPS, from } } : {};\n}\n\n/**\n * Turn the vendor's base-less URLs (`/__vendor__/x.js`) into the addresses\n * the page's import map ships, by prefixing the deploy base.\n *\n * An import map *address* must be a URL or begin with `/`, `./` or `../`;\n * anything else is a bare specifier, which the browser rejects — it drops the\n * entry, resolves the specifier to null, and every shared import then fails\n * with \"blocked by a null value\". So the base is applied rather than the\n * leading slash stripped: a root-relative address is both valid and correct\n * under a subpath deploy, and a dynamic-base build keeps its placeholder for\n * the serving proxy to substitute (the dynamic-base plugin leaves HTML\n * tokens alone by design).\n */\nexport function vendorImportMapEntries(\n imports: Record<string, string>,\n appBase: string,\n): Record<string, string> {\n return Object.fromEntries(\n Object.entries(imports).map(([spec, url]) => [\n spec,\n `${appBase}/${url}`.replace(/\\/{2,}/g, \"/\"),\n ]),\n );\n}\n\n/**\n * The production vendor prebuild runs on every `ph connect build` unless\n * disabled with PH_CONNECT_VENDOR=0 or false.\n */\nexport function isVendorEnabled(env: NodeJS.ProcessEnv = process.env): boolean {\n const raw = env.PH_CONNECT_VENDOR ?? \"1\";\n return raw !== \"0\" && raw !== \"false\";\n}\n\n/**\n * The reactor worker bundle prebuild runs on every `ph connect build` unless\n * disabled with PH_CONNECT_REACTOR_WORKER=0 or false. It is built even when\n * `connect.instance.reactorWorker` is off, because the `?reactorWorker=true`\n * runtime override can enable the feature on a flag-off deployment.\n */\nexport function isReactorWorkerBundleEnabled(\n env: NodeJS.ProcessEnv = process.env,\n): boolean {\n const raw = env.PH_CONNECT_REACTOR_WORKER ?? \"1\";\n return raw !== \"0\" && raw !== \"false\";\n}\n\n/**\n * Prebuild the reactor SharedWorker bundle into `<dist>/__reactor_worker__`.\n * Returns null when the prebuild is disabled, the installed Connect ships no\n * worker entry, or the build fails. A failure only fails `ph connect build`\n * when the project explicitly enables `connect.instance.reactorWorker` —\n * otherwise the feature degrades to unavailable and the build goes on.\n */\nasync function prebuildReactorWorkerBundle(\n dirname: string,\n outDirAbs: string,\n vendor: PrebuiltVendor | null,\n connectOverride: PHConnectRuntimeConfig | undefined,\n): Promise<PrebuiltReactorWorker | null> {\n if (!isReactorWorkerBundleEnabled()) return null;\n if (!resolveReactorWorkerSource(dirname)) return null;\n\n const errorRef: { message?: string } = {};\n const bundle = await prebuildReactorWorker({\n dirname,\n outDir: join(outDirAbs, \"__reactor_worker__\"),\n vendor: vendor\n ? { imports: vendor.imports, dir: join(outDirAbs, \"__vendor__\") }\n : undefined,\n nodeEnv: \"production\",\n errorRef,\n });\n if (bundle) return bundle;\n\n const message = `ph connect build: the reactor worker bundle failed to build${\n errorRef.message ? `:\\n${errorRef.message}` : \"\"\n }`;\n const phConfig = getConfig(join(dirname, \"powerhouse.config.json\"));\n const required =\n connectOverride?.instance?.reactorWorker ??\n phConfig.connect?.instance?.reactorWorker ??\n false;\n if (required) {\n throw new Error(message);\n }\n console.warn(\n `${message}\\nThe reactorWorker feature will be unavailable in this build.`,\n );\n return null;\n}\n\n/**\n * Build the project's `provider: \"local\"` packages into worker-loadable model\n * bundles beside the worker. A failure is a warning, not a build failure: the\n * worker still runs, and documents of registry types still work - only the\n * project's own types would be unavailable in worker mode.\n */\nasync function prebuildLocalWorkerPackages(\n dirname: string,\n outDirAbs: string,\n vendor: PrebuiltVendor | null,\n safeVendorImports: Record<string, string>,\n): Promise<void> {\n const config = getConfig(join(dirname, \"powerhouse.config.json\"));\n const configured = (config.packages ?? [])\n .filter((p) => p.provider === \"local\")\n .map((p) => p.packageName);\n // The project itself is a local package in all but name: a vetra project\n // declares no entry for itself, and its models are the ones the worker\n // cannot otherwise get.\n const own = ownProjectPackage(dirname);\n const localPackages = [...new Set([...configured, ...(own ? [own] : [])])];\n\n const errorRef: { message?: string } = {};\n const built = await prebuildWorkerPackages({\n dirname,\n packages: localPackages,\n outDir: join(outDirAbs, \"__reactor_worker__\", \"packages\"),\n vendor: vendor\n ? { imports: vendor.imports, dir: join(outDirAbs, \"__vendor__\") }\n : undefined,\n safeVendorImports,\n nodeEnv: \"production\",\n errorRef,\n });\n if (!built) {\n console.warn(\n `ph connect build: the reactor worker's local package bundles failed to build${\n errorRef.message ? `:\\n${errorRef.message}` : \"\"\n }\\nDocuments of this project's own types will not load in worker mode.`,\n );\n }\n}\n\n/**\n * Remove every top-level entry of `dist` except the kept names. Used between\n * the vendor prebuild and the app build so stale app output goes but the\n * just-built vendor stays (the build then runs with emptyOutDir: false).\n * Returns the number of entries removed.\n */\nexport function cleanDistExcept(dist: string, keep: string[] = []): number {\n if (!existsSync(dist)) return 0;\n let removed = 0;\n for (const entry of readdirSync(dist)) {\n if (keep.includes(entry)) continue;\n rmSync(join(dist, entry), { recursive: true, force: true });\n removed += 1;\n }\n return removed;\n}\n\nfunction assertLocalPackagesInstalled(projectPath: string) {\n const config = getConfig(join(projectPath, \"powerhouse.config.json\"));\n const localPackages = (config.packages ?? []).filter(\n (p) => p.provider === \"local\",\n );\n if (localPackages.length === 0) return;\n\n const missing = localPackages.filter(\n (p) =>\n !existsSync(\n join(projectPath, \"node_modules\", p.packageName, \"package.json\"),\n ),\n );\n if (missing.length === 0) return;\n\n const names = missing.map((p) => p.packageName);\n throw new Error(\n `ph connect build requires these packages to be installed in node_modules (they are declared with provider: \"local\" in powerhouse.config.json):\\n` +\n names.map((n) => ` - ${n}`).join(\"\\n\") +\n `\\n\\nInstall them with:\\n ph install --local ${names.join(\" \")}`,\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAmCA,eAAsB,gBACpB,MACA,gBACA,EAAE,WAAwC,CAAC,GAC3C;CACA,MAAM,EAAE,QAAQ,OAAO,aAAa,YAAY;CAEhD,MAAM,OAAO;CACb,MAAM,UAAU,QAAQ,IAAI;CAK5B,IAAI,KAAK,kBAAkB,KAAA,KAAa,KAAK,oBAAoB,KAAA,GAC/D,MAAM,IAAI,MACR,4LACF;CAKF,6BAA6B,OAAO;CAOpC,MAAM,MAAM,wBAAwB,IAAI;CACxC,MAAM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E,WAAW;CAC9C,MAAM,IAAI,MACR,qJACE,MAAM,KAAK,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,IAAI,IACtC,gDAAgD,MAAM,KAAK,GAAG,GAClE;AACF","debug_id":"ac5e13d8-e48c-551e-be3c-5634ce89d62e"}
1
+ {"version":3,"file":"connect-build-BfhOGbha.mjs","sources":["../src/services/connect-build.ts"],"sourcesContent":["import {\n DEFAULT_VENDOR_INCLUDE,\n DYNAMIC_BASE_PLACEHOLDER,\n directoryContentDigest,\n findPackageRoot,\n getConnectBaseViteConfig,\n missingVendorEntries,\n prebuildConnectVendor,\n ownProjectPackage,\n prebuildReactorWorker,\n prebuildWorkerPackages,\n resolveReactorWorkerSource,\n type PrebuiltReactorWorker,\n type PrebuiltVendor,\n} from \"@powerhousedao/builder-tools\";\nimport { getConfig } from \"@powerhousedao/shared/clis\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport {\n deepMerge,\n normalizeBasePath,\n SHARED_DEP_SPECIFIERS,\n SHARED_SUBPATHS,\n} from \"@powerhousedao/shared/connect\";\nimport { existsSync, mkdirSync, readdirSync, rmSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport type { InlineConfig } from \"vite\";\nimport { build, mergeConfig } from \"vite\";\nimport type { ConnectBuildArgs } from \"../types.js\";\nimport { buildCliConnectOverride } from \"../utils/cli-connect-override.js\";\nimport {\n isPrecompressEnabled,\n precompressAssets,\n} from \"../utils/precompress.js\";\nimport { runBuild } from \"./build.js\";\n\nexport async function runConnectBuild(\n args: ConnectBuildArgs,\n callerOverride?: PHConnectRuntimeConfig,\n { routes }: { routes?: string | false } = {},\n) {\n const { outDir, debug, dynamicBase, favicon } = args;\n\n const mode = \"production\";\n const dirname = process.cwd();\n\n // Build has no read mode; a bare positional `<key>` is a user error. The\n // 2-positional `<key> <value>` form is handled inside buildCliConnectOverride\n // so it layers on top of --json + flags like any other override input.\n if (args.keyPositional !== undefined && args.valuePositional === undefined) {\n throw new Error(\n \"ph connect build: positional override requires both <key> and <value> (e.g. `ph connect build connect.renown.url https://renown.staging`). To read a value, use `ph connect config <key>`.\",\n );\n }\n\n // Fail fast if any package marked as provider: \"local\" is missing from\n // node_modules — the Vite plugin that bundles them needs them on disk.\n assertLocalPackagesInstalled(dirname);\n\n // Build the CLI override layers (--json + individual flags + positional)\n // once here so a bad payload fails before we waste a build.\n // `--packages-registry` lands at the top-level `packageRegistryUrl`\n // (mirrors source-config shape); every other flag feeds the connect-block\n // precedence ladder.\n const cli = buildCliConnectOverride(args);\n const { packageRegistryUrl } = cli;\n // A runner's host config sits under the CLI's flags.\n const connectOverride = callerOverride\n ? deepMerge(callerOverride, cli.connectOverride ?? {})\n : cli.connectOverride;\n\n await runBuild({\n outDir: \"dist\",\n debug,\n // Local packages built for Connect share deps with the app vendor, same\n // as a plain `ph build`.\n noSharedDeps: false,\n ignoreTypeErrors: false,\n });\n\n // Production shared-dependency vendor: prebuilt into <outDir>/__vendor__\n // before the app build. On by default; PH_CONNECT_VENDOR=0|false disables\n // it. A failed prebuild fails the build — production must not ship import\n // map entries pointing at a vendor that was never built (the dev server\n // keeps its own soft fallback in the dev plugin).\n const outDirAbs = resolve(dirname, outDir);\n let vendor: PrebuiltVendor | null = null;\n // The deploy base the vendor's import-map addresses are written against.\n // Only meaningful when the vendor is built; \"/\" is the inert default.\n let appBase = \"/\";\n // The prebuild out dirs' parent must exist before the prebuilds: their\n // build locks are siblings of the out dirs, and the package build\n // (runBuild) writes to a different out dir, so nothing else creates it yet.\n mkdirSync(outDirAbs, { recursive: true });\n if (isVendorEnabled()) {\n const errorRef: { message?: string } = {};\n // The same base string the app build uses below: the dynamic-base\n // placeholder, or the normalized deploy base (CLI override wins over the\n // source config). The vendor worker appends its own segment.\n const phConfig = getConfig(join(dirname, \"powerhouse.config.json\"));\n const connectBasePath =\n connectOverride?.app?.basePath ?? phConfig.connect?.app?.basePath;\n appBase = dynamicBase\n ? DYNAMIC_BASE_PLACEHOLDER\n : connectBasePath\n ? normalizeBasePath(connectBasePath)\n : \"/\";\n vendor = await prebuildConnectVendor({\n dirname,\n include: productionVendorInclude(),\n vendorDir: join(outDirAbs, \"__vendor__\"),\n base: appBase,\n nodeEnv: \"production\",\n errorRef,\n ...connectOwnVendorDeps(dirname),\n });\n if (!vendor) {\n console.error(\n `ph connect build: the shared-dependency vendor failed to build${\n errorRef.message ? `:\\n${errorRef.message}` : \"\"\n }`,\n );\n throw new Error(\"shared-dependency vendor prebuild failed\");\n }\n }\n\n // Reactor SharedWorker bundle: the dist worker is a library artifact whose\n // bare imports no worker can resolve (import maps do not apply to workers),\n // so the deployable form is prebuilt here. With a vendor, its shared deps\n // are externalized onto ../__vendor__/ so page and worker share one cache\n // entry per dep; without one it is fully self-contained.\n const reactorWorker = await prebuildReactorWorkerBundle(\n dirname,\n outDirAbs,\n vendor,\n connectOverride,\n );\n\n // Local project models the worker cannot get from the registry, built into\n // the worker bundle's own directory so they share its vendor.\n if (reactorWorker) {\n await prebuildLocalWorkerPackages(\n dirname,\n outDirAbs,\n vendor,\n reactorWorker.vendorImports,\n );\n }\n\n const keepDirs = [\n ...(vendor ? [\"__vendor__\"] : []),\n ...(reactorWorker ? [\"__reactor_worker__\"] : []),\n ];\n // Stale top-level output goes, the prebuilt dirs stay: the app build below\n // runs with emptyOutDir: false and must not wipe them.\n if (keepDirs.length > 0) {\n cleanDistExcept(outDirAbs, keepDirs);\n }\n\n const baseConfig = getConnectBaseViteConfig({\n mode,\n dirname,\n cliConnectOverride: connectOverride,\n cliPackageRegistryUrl: packageRegistryUrl,\n dynamicBase,\n favicon,\n routes,\n // Vendor import-map entries are relative (leading slash stripped) so\n // they resolve against the page URL under any deploy base — root or\n // subpath, dynamic or concrete.\n vendor: vendor\n ? {\n imports: vendorImportMapEntries(vendor.imports, appBase),\n versions: vendor.versions,\n sharedDeps: vendorImportMapEntries(\n { sharedDeps: vendor.sharedDeps },\n appBase,\n ).sharedDeps,\n }\n : undefined,\n reactorWorkerVersion: reactorWorker\n ? directoryContentDigest(join(outDirAbs, \"__reactor_worker__\"))\n : undefined,\n });\n\n const buildConfig: InlineConfig = {\n build: {\n outDir,\n // The vendor / worker dirs were prebuilt into the out dir above; the\n // build must not empty them.\n ...(keepDirs.length > 0 ? { emptyOutDir: false } : {}),\n },\n };\n\n const config = mergeConfig(baseConfig, buildConfig);\n\n await build(config);\n\n // Last word on the shipped artifact: every specifier the page's import map\n // publishes must have a file next to it. The prebuild verifies its own\n // output, but it can return a cache hit it never rebuilt, and both the\n // stale-output clean and the app build run afterwards. An entry with no\n // file behind it ships as a URL that 404s, and a SPA answers that with\n // index.html — so the browser reports only an opaque MIME-type error with\n // no filename. Fail here instead, naming the entries.\n if (vendor) {\n const unbacked = missingVendorEntries(\n join(outDirAbs, \"__vendor__\"),\n vendor.imports,\n );\n if (unbacked.length > 0) {\n throw new Error(\n `ph connect build: the shared-dependency vendor is missing ` +\n `${unbacked.length} of the ${Object.keys(vendor.imports).length} ` +\n `entries its import map publishes:\\n` +\n unbacked.map((e) => ` ${e.spec} -> ${e.url}`).join(\"\\n\"),\n );\n }\n }\n\n // Runs after the PWA plugin, so the siblings never enter the precache list.\n if (isPrecompressEnabled()) {\n const r = await precompressAssets(outDirAbs);\n console.log(\n `ph connect build: precompressed ${r.files} wasm/data files ` +\n `(${r.written} .gz written, ${(r.outputBytes / 1e6).toFixed(1)} MB) in ${(r.ms / 1000).toFixed(1)}s`,\n );\n }\n}\n\n/**\n * The specifier set the production vendor bundles: the dev-proven heavy set\n * ∪ the package-shared set — everything the app and loaded packages\n * externalize onto the vendor.\n *\n * Two specifiers are deliberately dropped:\n *\n * - `@powerhousedao/connect`. It is in DEFAULT_VENDOR_INCLUDE because the dev\n * server vendors the app to keep rebuilds cheap, but in a production build\n * the app *is* Connect: `SHARED_DEP_SPECIFIERS` omits it, so the app build\n * never externalizes it and nothing would ever resolve its import-map\n * entry. Vendoring it is not merely dead weight — bundling Connect's dist\n * for the browser pulls in its node-only `@powerhousedao/config/node`\n * import, and so `read-pkg` -> `unicorn-magic`, whose browser entry has no\n * `toPath`. That fails the vendor build, and a failed prebuild fails\n * `ph connect build`.\n * - the bare `@powerhousedao/shared` root, whose barrel likewise reaches\n * node-only modules. Its browser-safe subpaths (SHARED_SUBPATHS) are\n * listed instead; a package importing the bare root bundles its own copy.\n */\nexport function productionVendorInclude(): string[] {\n return [\n ...new Set([\n ...DEFAULT_VENDOR_INCLUDE.filter((s) => s !== \"@powerhousedao/connect\"),\n ...SHARED_DEP_SPECIFIERS.filter((s) => s !== \"@powerhousedao/shared\"),\n ...SHARED_SUBPATHS.map((s) => `@powerhousedao/shared/${s}`),\n // Connect imports these roots too; unvendored, the app re-bundles their shared chunks.\n \"@powerhousedao/design-system\",\n \"@powerhousedao/reactor\",\n ]),\n ];\n}\n\n/** Connect's own deps that vendored packages also bundle; projects don't install them. */\nexport const CONNECT_OWN_VENDOR_DEPS = [\n \"kysely\",\n \"tailwind-merge\",\n \"@renown/sdk\",\n \"@renown/sdk/crypto\",\n \"@renown/sdk/trust\",\n \"@powerhousedao/reactor-attachments/client\",\n // One core and router for Connect and packages; the route tree, config and\n // embedded subpaths stay with the app.\n \"@powerhousedao/connect-core\",\n \"@powerhousedao/connect-core/router\",\n \"@powerhousedao/connect-core/plugins\",\n \"@powerhousedao/connect-core/runtime\",\n \"@powerhousedao/connect-core/views\",\n \"@tanstack/react-router\",\n];\n\nexport function connectOwnVendorDeps(dirname: string): {\n ownDeps?: { specs: string[]; from: string };\n} {\n const from = findPackageRoot(dirname, \"@powerhousedao/connect\");\n return from ? { ownDeps: { specs: CONNECT_OWN_VENDOR_DEPS, from } } : {};\n}\n\n/**\n * Turn the vendor's base-less URLs (`/__vendor__/x.js`) into the addresses\n * the page's import map ships, by prefixing the deploy base.\n *\n * An import map *address* must be a URL or begin with `/`, `./` or `../`;\n * anything else is a bare specifier, which the browser rejects — it drops the\n * entry, resolves the specifier to null, and every shared import then fails\n * with \"blocked by a null value\". So the base is applied rather than the\n * leading slash stripped: a root-relative address is both valid and correct\n * under a subpath deploy, and a dynamic-base build keeps its placeholder for\n * the serving proxy to substitute (the dynamic-base plugin leaves HTML\n * tokens alone by design).\n */\nexport function vendorImportMapEntries(\n imports: Record<string, string>,\n appBase: string,\n): Record<string, string> {\n return Object.fromEntries(\n Object.entries(imports).map(([spec, url]) => [\n spec,\n `${appBase}/${url}`.replace(/\\/{2,}/g, \"/\"),\n ]),\n );\n}\n\n/**\n * The production vendor prebuild runs on every `ph connect build` unless\n * disabled with PH_CONNECT_VENDOR=0 or false.\n */\nexport function isVendorEnabled(env: NodeJS.ProcessEnv = process.env): boolean {\n const raw = env.PH_CONNECT_VENDOR ?? \"1\";\n return raw !== \"0\" && raw !== \"false\";\n}\n\n/**\n * The reactor worker bundle prebuild runs on every `ph connect build` unless\n * disabled with PH_CONNECT_REACTOR_WORKER=0 or false. It is built even when\n * `connect.instance.reactorWorker` is off, because the `?reactorWorker=true`\n * runtime override can enable the feature on a flag-off deployment.\n */\nexport function isReactorWorkerBundleEnabled(\n env: NodeJS.ProcessEnv = process.env,\n): boolean {\n const raw = env.PH_CONNECT_REACTOR_WORKER ?? \"1\";\n return raw !== \"0\" && raw !== \"false\";\n}\n\n/**\n * Prebuild the reactor SharedWorker bundle into `<dist>/__reactor_worker__`.\n * Returns null when the prebuild is disabled, the installed Connect ships no\n * worker entry, or the build fails. A failure only fails `ph connect build`\n * when the project explicitly enables `connect.instance.reactorWorker` —\n * otherwise the feature degrades to unavailable and the build goes on.\n */\nasync function prebuildReactorWorkerBundle(\n dirname: string,\n outDirAbs: string,\n vendor: PrebuiltVendor | null,\n connectOverride: PHConnectRuntimeConfig | undefined,\n): Promise<PrebuiltReactorWorker | null> {\n if (!isReactorWorkerBundleEnabled()) return null;\n if (!resolveReactorWorkerSource(dirname)) return null;\n\n const errorRef: { message?: string } = {};\n const bundle = await prebuildReactorWorker({\n dirname,\n outDir: join(outDirAbs, \"__reactor_worker__\"),\n vendor: vendor\n ? { imports: vendor.imports, dir: join(outDirAbs, \"__vendor__\") }\n : undefined,\n nodeEnv: \"production\",\n errorRef,\n });\n if (bundle) return bundle;\n\n const message = `ph connect build: the reactor worker bundle failed to build${\n errorRef.message ? `:\\n${errorRef.message}` : \"\"\n }`;\n const phConfig = getConfig(join(dirname, \"powerhouse.config.json\"));\n const required =\n connectOverride?.instance?.reactorWorker ??\n phConfig.connect?.instance?.reactorWorker ??\n false;\n if (required) {\n throw new Error(message);\n }\n console.warn(\n `${message}\\nThe reactorWorker feature will be unavailable in this build.`,\n );\n return null;\n}\n\n/**\n * Build the project's `provider: \"local\"` packages into worker-loadable model\n * bundles beside the worker. A failure is a warning, not a build failure: the\n * worker still runs, and documents of registry types still work - only the\n * project's own types would be unavailable in worker mode.\n */\nasync function prebuildLocalWorkerPackages(\n dirname: string,\n outDirAbs: string,\n vendor: PrebuiltVendor | null,\n safeVendorImports: Record<string, string>,\n): Promise<void> {\n const config = getConfig(join(dirname, \"powerhouse.config.json\"));\n const configured = (config.packages ?? [])\n .filter((p) => p.provider === \"local\")\n .map((p) => p.packageName);\n // The project itself is a local package in all but name: a vetra project\n // declares no entry for itself, and its models are the ones the worker\n // cannot otherwise get.\n const own = ownProjectPackage(dirname);\n const localPackages = [...new Set([...configured, ...(own ? [own] : [])])];\n\n const errorRef: { message?: string } = {};\n const built = await prebuildWorkerPackages({\n dirname,\n packages: localPackages,\n outDir: join(outDirAbs, \"__reactor_worker__\", \"packages\"),\n vendor: vendor\n ? { imports: vendor.imports, dir: join(outDirAbs, \"__vendor__\") }\n : undefined,\n safeVendorImports,\n nodeEnv: \"production\",\n errorRef,\n });\n if (!built) {\n console.warn(\n `ph connect build: the reactor worker's local package bundles failed to build${\n errorRef.message ? `:\\n${errorRef.message}` : \"\"\n }\\nDocuments of this project's own types will not load in worker mode.`,\n );\n }\n}\n\n/**\n * Remove every top-level entry of `dist` except the kept names. Used between\n * the vendor prebuild and the app build so stale app output goes but the\n * just-built vendor stays (the build then runs with emptyOutDir: false).\n * Returns the number of entries removed.\n */\nexport function cleanDistExcept(dist: string, keep: string[] = []): number {\n if (!existsSync(dist)) return 0;\n let removed = 0;\n for (const entry of readdirSync(dist)) {\n if (keep.includes(entry)) continue;\n rmSync(join(dist, entry), { recursive: true, force: true });\n removed += 1;\n }\n return removed;\n}\n\nfunction assertLocalPackagesInstalled(projectPath: string) {\n const config = getConfig(join(projectPath, \"powerhouse.config.json\"));\n const localPackages = (config.packages ?? []).filter(\n (p) => p.provider === \"local\",\n );\n if (localPackages.length === 0) return;\n\n const missing = localPackages.filter(\n (p) =>\n !existsSync(\n join(projectPath, \"node_modules\", p.packageName, \"package.json\"),\n ),\n );\n if (missing.length === 0) return;\n\n const names = missing.map((p) => p.packageName);\n throw new Error(\n `ph connect build requires these packages to be installed in node_modules (they are declared with provider: \"local\" in powerhouse.config.json):\\n` +\n names.map((n) => ` - ${n}`).join(\"\\n\") +\n `\\n\\nInstall them with:\\n ph install --local ${names.join(\" \")}`,\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAmCA,eAAsB,gBACpB,MACA,gBACA,EAAE,WAAwC,CAAC,GAC3C;CACA,MAAM,EAAE,QAAQ,OAAO,aAAa,YAAY;CAEhD,MAAM,OAAO;CACb,MAAM,UAAU,QAAQ,IAAI;CAK5B,IAAI,KAAK,kBAAkB,KAAA,KAAa,KAAK,oBAAoB,KAAA,GAC/D,MAAM,IAAI,MACR,4LACF;CAKF,6BAA6B,OAAO;CAOpC,MAAM,MAAM,wBAAwB,IAAI;CACxC,MAAM,EAAE,uBAAuB;CAE/B,MAAM,kBAAkB,iBACpB,UAAU,gBAAgB,IAAI,mBAAmB,CAAC,CAAC,IACnD,IAAI;CAER,MAAM,SAAS;EACb,QAAQ;EACR;EAGA,cAAc;EACd,kBAAkB;CACpB,CAAC;CAOD,MAAM,YAAY,QAAQ,SAAS,MAAM;CACzC,IAAI,SAAgC;CAGpC,IAAI,UAAU;CAId,UAAU,WAAW,EAAE,WAAW,KAAK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