@powerhousedao/ph-cli 6.2.3-dev.82 → 6.2.3-dev.83

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 (48) hide show
  1. package/dist/{check-DkH9B91Z.mjs → check-D2r9Qbyf.mjs} +5 -5
  2. package/dist/{check-DkH9B91Z.mjs.map → check-D2r9Qbyf.mjs.map} +1 -1
  3. package/dist/{cli-connect-override-CpHjVMDt.mjs → cli-connect-override-Bv5y96A5.mjs} +4 -4
  4. package/dist/{cli-connect-override-CpHjVMDt.mjs.map → cli-connect-override-Bv5y96A5.mjs.map} +1 -1
  5. package/dist/cli.mjs +4 -4
  6. package/dist/{compound-YHuVvCFd-C5NLunJf.mjs → compound-GhJAA2dK-Cj36zhoQ.mjs} +16 -4
  7. package/dist/compound-GhJAA2dK-Cj36zhoQ.mjs.map +1 -0
  8. package/dist/{connect-build-BxFswE45.mjs → connect-build-_HyX7OUY.mjs} +4 -4
  9. package/dist/{connect-build-BxFswE45.mjs.map → connect-build-_HyX7OUY.mjs.map} +1 -1
  10. package/dist/{connect-config-4WOy_Zua.mjs → connect-config-BD1WzHpY.mjs} +4 -4
  11. package/dist/{connect-config-4WOy_Zua.mjs.map → connect-config-BD1WzHpY.mjs.map} +1 -1
  12. package/dist/{connect-plugin-configs-uOxnR-7b.mjs → connect-plugin-configs-tVn11Qb_.mjs} +4 -4
  13. package/dist/{connect-plugin-configs-uOxnR-7b.mjs.map → connect-plugin-configs-tVn11Qb_.mjs.map} +1 -1
  14. package/dist/{connect-studio-DrwbiFVf.mjs → connect-studio-7Bx53D6Z.mjs} +3 -3
  15. package/dist/{connect-studio-qmgFWSt8.mjs → connect-studio-C0LLX1TD.mjs} +4 -4
  16. package/dist/{connect-studio-qmgFWSt8.mjs.map → connect-studio-C0LLX1TD.mjs.map} +1 -1
  17. package/dist/{dist-BlpdH3RP.mjs → dist-BiB5aiS6.mjs} +124 -66
  18. package/dist/dist-BiB5aiS6.mjs.map +1 -0
  19. package/dist/{explain-DARxM6-8.mjs → explain-DnKF_KNm.mjs} +5 -5
  20. package/dist/{explain-DARxM6-8.mjs.map → explain-DnKF_KNm.mjs.map} +1 -1
  21. package/dist/{export-DCMLPFSh.mjs → export-1QvYpjR1.mjs} +4 -4
  22. package/dist/{export-DCMLPFSh.mjs.map → export-1QvYpjR1.mjs.map} +1 -1
  23. package/dist/{generate-all-tbCt5ty4.mjs → generate-all-BVRk64NX.mjs} +4 -4
  24. package/dist/{generate-all-tbCt5ty4.mjs.map → generate-all-BVRk64NX.mjs.map} +1 -1
  25. package/dist/{get-version-CeWPXpXy.mjs → get-version-D7KfXhrX.mjs} +4 -4
  26. package/dist/{get-version-CeWPXpXy.mjs.map → get-version-D7KfXhrX.mjs.map} +1 -1
  27. package/dist/{mcp-YVqVelqp.mjs → mcp-DxrRkBBm.mjs} +4 -4
  28. package/dist/{mcp-YVqVelqp.mjs.map → mcp-DxrRkBBm.mjs.map} +1 -1
  29. package/dist/{member-config-BMqPMA0P.mjs → member-config-ZEe4PlHE.mjs} +4 -4
  30. package/dist/{member-config-BMqPMA0P.mjs.map → member-config-ZEe4PlHE.mjs.map} +1 -1
  31. package/dist/{ph-cli-commands-DPINuS0Q.mjs → ph-cli-commands-D3NH12Ot.mjs} +13 -13
  32. package/dist/{ph-cli-commands-DPINuS0Q.mjs.map → ph-cli-commands-D3NH12Ot.mjs.map} +1 -1
  33. package/dist/ph-cli-commands-wRaHQaC5.mjs +4 -0
  34. package/dist/{run-sugar-BaVU46_Q.mjs → run-sugar-DWPDmuRj.mjs} +4 -4
  35. package/dist/{run-sugar-BaVU46_Q.mjs.map → run-sugar-DWPDmuRj.mjs.map} +1 -1
  36. package/dist/runners/connect.d.mts +88 -68
  37. package/dist/runners/connect.d.mts.map +1 -1
  38. package/dist/runners/connect.mjs +14 -17
  39. package/dist/runners/connect.mjs.map +1 -1
  40. package/dist/runners/switchboard.mjs +4 -4
  41. package/dist/{start-run-BogXSscB.mjs → start-run-CuQEMKRZ.mjs} +4 -4
  42. package/dist/{start-run-BogXSscB.mjs.map → start-run-CuQEMKRZ.mjs.map} +1 -1
  43. package/dist/{vetra-DUONHuYK.mjs → vetra-Ch4M1DtV.mjs} +6 -6
  44. package/dist/{vetra-DUONHuYK.mjs.map → vetra-Ch4M1DtV.mjs.map} +1 -1
  45. package/package.json +14 -14
  46. package/dist/compound-YHuVvCFd-C5NLunJf.mjs.map +0 -1
  47. package/dist/dist-BlpdH3RP.mjs.map +0 -1
  48. package/dist/ph-cli-commands-B5zSKfeX.mjs +0 -4
@@ -1 +0,0 @@
1
- {"version":3,"file":"dist-BlpdH3RP.mjs","sources":["../../../packages/host-core/dist/index.mjs"],"sourcesContent":["import { $ as resolveHostOutputs, $t as concatTokenSchema, A as findNonStaticValue, An as runTransformHook, At as defineHostSchemas, B as ONE_SHOT_VERBS, Bt as reactorBackendSchema, C as writeRunRecord, Cn as pluginEntryObjectSchema, Ct as HOST_NAME_PATTERN, D as OUTPUTS_FILE, Dn as runObserveHook, Dt as compoundWiringSchema, E as HostLoadError, En as resolveOrder, Et as compoundHostSchema, F as probeHostsFolder, Ft as makeHostSchemas, G as kindShapeIssues, Gt as runnerBaseSchema, H as getVerb, Ht as reactorProtocolSchema, I as readOutputsFileHash, It as originOrUrlSchema, J as resolveRunnerModule, Jt as driveDeclarationSchema, K as knownVerbIssues, Kt as runnerKindSchema, L as scanHostImports, Lt as placementKeyIssues, M as lintHostImports, Mt as emittedHostSchemas, N as lintOutputsFile, Nt as genericCompoundHostSchema, O as computeOutputsHash, On as runObserveHookSequential, Ot as declaredGenericCompoundHostSchema, P as loadHost, Pt as hostNameSchema, Q as describeMapElements, Qt as TOKEN_KEYS, R as stripComments, Rt as profileSchema, S as readRunRecord, Sn as normalizePluginEntry, St as HOST_NAME_MESSAGE, T as runRecordSchema, Tn as registerHostType, Tt as childrenSchema, U as hostSchemaIssues, Ut as reactorSchema, V as RunnerError, Vt as reactorHostSchema, W as isSchemaLike, Wt as refineStartOrder, X as validateHost, Xt as projectDriveIdWith, Y as validateDeclaredHost, Yt as drivesSchema, Z as TokenResolutionError, Zt as TOKEN_ESCAPE_KEY, _ as clearRunRecord, _n as PluginError, _t as formatPath, a as takesCspRegistrySync, an as itemTokenSchema, at as isBuiltinEnvName, b as probeRun, bn as mergeContributions, bt as unwrapEscapes, c as compoundOutputSource, cn as outputTokenSchema, ct as checkOutputPaths, d as producerOutputsSchemas, dn as tokenSchema, dt as outputRefsOf, en as envTokenSchema, et as unsetEnvMessage, f as runRecordOutputSource, fn as tokenable, ft as outputSitesOf, g as applyChildWrapper, gn as resolvePluginContributions, gt as describeToken, h as resolveUserDataPlaceholders, hn as resolveHostPlugins, ht as collectTokenSites, i as runCompound, in as isToken, it as BUILTIN_ENV_NAMES, j as lintHostImportGraph, jt as emitHostJsonSchema, k as describeHostOutputs, kn as runProvideHook, kt as declaredHostSchemas, l as loadProducers, ln as ref, lt as checkTokenSites, m as defaultUserDataDir, mn as findDeadConnectConfig, mt as schemaAtPath, n as memberVerbOf, nn as findToken, nt as memberForRef, o as runnerHandleSchema, on as keyTokenSchema, ot as substituteBuiltinEnv, p as runnerOutputsSchema, pn as CONNECT_PLUGIN_OWNED_SLICES, pt as refKey, q as listVerbs, qt as buildDriveDeclarationSchema, r as prepareMember, rn as forbidRef, rt as planCompound, s as toStartedHandle, sn as mapTokenSchema, st as findRemovedForms, t as compoundStartVerb, tn as envTokenable, tt as PlanError, u as processResolveEnv, un as tokenKeyOf, ut as envSitesOf, v as isPidAlive, vn as entryActiveForVerb, vt as isPlainObject, w as runRecordMemberSchema, wn as pluginEntrySchema, wt as childWrapperSchema, x as readProjectName, xn as normalizePluginEntries, xt as HOST_NAME_MAX_LENGTH, y as listRunRecords, yn as hostTypeSatisfies, yt as renderTokens, z as CONNECT_RUNNER, zt as reactorBackendKindSchema } from \"./compound-YHuVvCFd.mjs\";\nimport { createRequire } from \"node:module\";\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { z } from \"zod\";\nimport { driveAddressMessage, switchboardOfDrive } from \"@powerhousedao/shared/host-tokens\";\nimport { ORIGIN_PLACEHOLDER, SWITCHBOARD_PROXY_PATHS, isHtmlNavigation, isOriginPlaceholderUrl, isSwitchboardProxyPath, resolveOriginPlaceholders, toOriginPlaceholder, withOriginPlaceholders } from \"@powerhousedao/shared/connect/origin-placeholder\";\nimport { spawn } from \"node:child_process\";\nimport { DRIVE_ICON_MAX_BYTES, resolveImageRef } from \"@powerhousedao/shared/connect/image-ref\";\n//#region src/spawn-host.ts\nvar SpawnHostError = class extends Error {\n\tphase;\n\toutputTail;\n\texit;\n\tconstructor(message, phase, outputTail, exit) {\n\t\tsuper(outputTail ? `${message}\\n--- output tail ---\\n${outputTail}` : message);\n\t\tthis.phase = phase;\n\t\tthis.outputTail = outputTail;\n\t\tthis.exit = exit;\n\t\tthis.name = \"SpawnHostError\";\n\t}\n};\nconst READY_TIMEOUT_MS = 12e4;\nconst STOP_TIMEOUT_MS = 3e4;\nconst POLL_MS = 100;\nconst CLOSE_WAIT_MS = 1e3;\nconst BASE_ENV_KEYS = [\n\t\"PATH\",\n\t\"HOME\",\n\t\"TMPDIR\"\n];\nconst WIN32_ENV_KEYS = [\n\t\"SystemRoot\",\n\t\"USERPROFILE\",\n\t\"APPDATA\",\n\t\"LOCALAPPDATA\",\n\t\"TEMP\",\n\t\"TMP\",\n\t\"ComSpec\",\n\t\"PATHEXT\"\n];\n/** The child's whole env: no other `process.env` key reaches it. */\nfunction childEnv(dataDir, env = {}) {\n\tif (\"PH_USER_DATA_DIR\" in env) throw new Error(\"spawnHost: set the data dir with `dataDir`, not env.PH_USER_DATA_DIR.\");\n\tconst keys = process.platform === \"win32\" ? [...BASE_ENV_KEYS, ...WIN32_ENV_KEYS] : BASE_ENV_KEYS;\n\tconst base = {};\n\tfor (const key of keys) {\n\t\tconst value = process.env[key];\n\t\tif (value !== void 0) base[key] = value;\n\t}\n\treturn {\n\t\t...base,\n\t\tFEATURE_UNIFORM_RUNNERS_ENABLED: \"1\",\n\t\tPH_USER_DATA_DIR: dataDir,\n\t\tPH_NO_TELEMETRY: \"1\",\n\t\tPH_NO_DOTENV: \"1\",\n\t\t...env\n\t};\n}\nfunction resolvePhCliEntry(projectRoot) {\n\tconst pkgPath = createRequire(pathToFileURL(path.join(projectRoot, \"package.json\")).href).resolve(\"@powerhousedao/ph-cli/package.json\");\n\treturn path.join(path.dirname(pkgPath), \"dist\", \"cli.mjs\");\n}\n/** Readiness waits for a record; refuse a host/verb that writes none. */\nasync function assertWritesRecord(projectRoot, host, verb) {\n\tif (verb !== void 0 && ONE_SHOT_VERBS.has(verb)) throw new Error(`spawnHost: \"${verb}\" is a one-shot verb; it writes no run record to wait for.`);\n\tconst loaded = await loadHost(projectRoot, host);\n\tconst specifier = loaded.host.runner.module;\n\tconst runner = await resolveRunnerModule(projectRoot, specifier);\n\tif (runner.kind === \"compound\") {\n\t\tif (loaded.host.config?.runtimeRecord === false) throw new Error(`spawnHost: hosts/${host} sets config.runtimeRecord: false, so it writes no run record to wait for.`);\n\t\treturn;\n\t}\n\tif (!isSchemaLike(runner.outputsSchema)) throw new Error(`spawnHost: hosts/${host} runs \"${specifier}\", which exports no outputsSchema, so it writes no run record to wait for.`);\n}\nconst sleep = (ms) => new Promise((resolve) => {\n\tsetTimeout(resolve, ms).unref();\n});\nconst live = /* @__PURE__ */ new Set();\nlet exitHookInstalled = false;\nfunction track(child) {\n\tlive.add(child);\n\tchild.once(\"exit\", () => live.delete(child));\n\tif (exitHookInstalled) return;\n\texitHookInstalled = true;\n\tprocess.once(\"exit\", () => {\n\t\tfor (const running of live) running.kill(\"SIGTERM\");\n\t});\n}\n/**\n* `ph run <host> [verb]` as a child; ready when its run record appears.\n*\n* The child shares this process's group, so a terminal Ctrl-C reaches both.\n* It runs the project's own ph-cli: one older than PH_NO_DOTENV reads the\n* project's `.env` anyway.\n*/\nasync function spawnHost(options) {\n\tconst projectRoot = path.resolve(options.projectRoot);\n\tconst dataDir = path.resolve(options.dataDir);\n\tconst env = childEnv(dataDir, options.env);\n\tconst readerEnv = { PH_USER_DATA_DIR: dataDir };\n\tconst readyTimeoutMs = options.readyTimeoutMs ?? READY_TIMEOUT_MS;\n\tconst stopTimeoutMs = options.stopTimeoutMs ?? STOP_TIMEOUT_MS;\n\tconst { signal } = options;\n\tif (signal?.aborted) throw new SpawnHostError(\"spawnHost: aborted before start.\", \"aborted\", \"\");\n\tawait assertWritesRecord(projectRoot, options.host, options.verb);\n\tconst cli = options.cli ?? resolvePhCliEntry(projectRoot);\n\tfs.mkdirSync(dataDir, { recursive: true });\n\tconst log = options.logFile ? fs.createWriteStream(options.logFile, { flags: \"a\" }) : void 0;\n\tlet tail = \"\";\n\tlog?.on(\"error\", (error) => {\n\t\ttail = (tail + `logFile: ${error.message}\\n`).slice(-8192);\n\t});\n\tconst args = [\n\t\tcli,\n\t\t\"run\",\n\t\toptions.host\n\t];\n\tif (options.verb !== void 0) args.push(options.verb);\n\tconst child = spawn(process.execPath, args, {\n\t\tcwd: projectRoot,\n\t\tenv,\n\t\tstdio: [\n\t\t\t\"ignore\",\n\t\t\t\"pipe\",\n\t\t\t\"pipe\"\n\t\t],\n\t\twindowsHide: true\n\t});\n\ttrack(child);\n\tconst onChunk = (stream) => (chunk) => {\n\t\ttail = (tail + chunk).slice(-8192);\n\t\tlog?.write(chunk);\n\t\ttry {\n\t\t\toptions.onOutput?.(stream, chunk);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\ttail = (tail + `onOutput: ${message}\\n`).slice(-8192);\n\t\t}\n\t};\n\tchild.stdout.setEncoding(\"utf8\").on(\"data\", onChunk(\"stdout\"));\n\tchild.stderr.setEncoding(\"utf8\").on(\"data\", onChunk(\"stderr\"));\n\tlet forced = false;\n\tlet exit;\n\tconst exited = new Promise((resolve) => {\n\t\tconst done = (code, sig) => {\n\t\t\tif (exit) return;\n\t\t\texit = {\n\t\t\t\tcode,\n\t\t\t\tsignal: sig,\n\t\t\t\tforced\n\t\t\t};\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\tresolve(exit);\n\t\t};\n\t\tchild.once(\"exit\", done);\n\t\tchild.once(\"error\", (error) => {\n\t\t\ttail = (tail + `${error.message}\\n`).slice(-8192);\n\t\t\tif (child.pid === void 0) done(null, null);\n\t\t});\n\t});\n\tconst closed = new Promise((resolve) => {\n\t\tchild.once(\"close\", () => {\n\t\t\tlog?.end();\n\t\t\tresolve();\n\t\t});\n\t});\n\tconst pid = child.pid;\n\tconst ownRecords = () => pid === void 0 ? [] : listRunRecords(projectRoot, readerEnv).filter((r) => r.pid === pid);\n\tconst kill = (sig) => {\n\t\tif (pid === void 0) return;\n\t\ttry {\n\t\t\tprocess.kill(pid, sig);\n\t\t} catch {}\n\t};\n\tconst clearOwnRecords = () => {\n\t\tfor (const record of ownRecords()) clearRunRecord(projectRoot, record.host, readerEnv);\n\t};\n\tlet stopping;\n\tconst stop = () => {\n\t\tstopping ??= (async () => {\n\t\t\tif (!exit) {\n\t\t\t\tkill(\"SIGTERM\");\n\t\t\t\tlet timer;\n\t\t\t\tconst timedOut = await Promise.race([exited.then(() => false), new Promise((resolve) => {\n\t\t\t\t\ttimer = setTimeout(() => resolve(true), stopTimeoutMs);\n\t\t\t\t})]);\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tif (timedOut) {\n\t\t\t\t\tforced = true;\n\t\t\t\t\tkill(\"SIGKILL\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst result = await exited;\n\t\t\tclearOwnRecords();\n\t\t\treturn result;\n\t\t})();\n\t\treturn stopping;\n\t};\n\tfunction onAbort() {\n\t\tstop();\n\t}\n\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\tconst deadline = Date.now() + readyTimeoutMs;\n\tfor (;;) {\n\t\tconst aborted = signal?.aborted ?? false;\n\t\tif (exit && !aborted) {\n\t\t\tclearOwnRecords();\n\t\t\tlet timer;\n\t\t\tawait Promise.race([closed, new Promise((resolve) => {\n\t\t\t\ttimer = setTimeout(resolve, CLOSE_WAIT_MS);\n\t\t\t})]);\n\t\t\tclearTimeout(timer);\n\t\t\tconst how = exit.signal !== null ? `signal ${exit.signal}` : `code ${exit.code}`;\n\t\t\tthrow new SpawnHostError(`spawnHost: ph run ${options.host} exited (${how}) before writing its run record.`, \"exited\", tail, exit);\n\t\t}\n\t\tconst record = aborted ? void 0 : ownRecords().at(0);\n\t\tif (record) return {\n\t\t\tpid: record.pid,\n\t\t\tdataDir,\n\t\t\trecord,\n\t\t\toutputs: record.outputs,\n\t\t\tmembers: record.members,\n\t\t\texited,\n\t\t\tstop\n\t\t};\n\t\tif (aborted || Date.now() >= deadline) {\n\t\t\tconst phase = aborted ? \"aborted\" : \"timeout\";\n\t\t\tconst stopped = await stop();\n\t\t\tthrow new SpawnHostError(phase === \"aborted\" ? `spawnHost: aborted before ph run ${options.host} was ready.` : `spawnHost: ph run ${options.host} wrote no run record within ${readyTimeoutMs} ms.`, phase, tail, stopped);\n\t\t}\n\t\tawait Promise.race([sleep(POLL_MS), exited]);\n\t}\n}\n//#endregion\n//#region src/check-host.ts\n/** The `ph run` pipeline up to the verb, collecting every issue; starts nothing. */\nasync function checkHost(name, options) {\n\tconst result = {\n\t\tissues: [],\n\t\tdeferred: []\n\t};\n\tconst file = `hosts/${name}/host.js`;\n\tconst issue = issuer(result, file);\n\tconst verb = options.verb ?? \"run\";\n\tlet host;\n\tlet runner;\n\ttry {\n\t\thost = (await loadHost(options.projectRoot, name)).host;\n\t\trunner = await resolveRunnerModule(options.projectRoot, host.runner.module);\n\t} catch (error) {\n\t\tissue(\"load\", \"\", error);\n\t\treturn result;\n\t}\n\tconst specifier = host.runner.module;\n\tif (runner.kind === \"compound\") {\n\t\tawait checkCompound(result, options, {\n\t\t\tfile,\n\t\t\thost,\n\t\t\trunner,\n\t\t\tspecifier,\n\t\t\tverb\n\t\t});\n\t\treturn result;\n\t}\n\tconst refs = outputRefsOf(host);\n\tconst producers = await loadProducers(options.projectRoot, refs);\n\tawait checkSubject(result, options, {\n\t\tfile,\n\t\thost,\n\t\trunner,\n\t\tspecifier,\n\t\tverb,\n\t\toutputsSchemaOf: producerOutputsSchemas(producers),\n\t\tself: \"outputs\"\n\t});\n\treturn result;\n}\n/** Declared validation; returns whether its tokens and its shape passed. */\nfunction checkDeclared(result, subject, outputsSchemaOf) {\n\tconst issue = issuer(result, subject.file);\n\tconst { host, runner, specifier } = subject;\n\ttry {\n\t\tgetVerb(runner, specifier, subject.verb);\n\t} catch (error) {\n\t\tissue(\"declared\", \"\", error);\n\t}\n\tconst tokenIssues = [\n\t\t...findRemovedForms(host),\n\t\t...checkTokenSites(host),\n\t\t...outputsSchemaOf ? checkOutputPaths(host, outputsSchemaOf) : []\n\t];\n\tfor (const i of tokenIssues) issue(\"declared\", i);\n\tconst shapeIssues = runner.declaredHostSchema ? schemaIssuesOf(runner, runner.declaredHostSchema, specifier, host, true) : kindShapeIssues(runner.kind, specifier, host);\n\tfor (const i of shapeIssues) issue(\"declared\", i);\n\treturn {\n\t\ttokens: tokenIssues.length === 0,\n\t\tshape: shapeIssues.length === 0\n\t};\n}\nfunction schemaIssuesOf(runner, schema, specifier, host, allowTokens) {\n\tconst checked = hostSchemaIssues(runner, schema, specifier, host, { tokens: allowTokens ? \"allow\" : \"forbid\" });\n\treturn [...checked.issues, ...checked.schemaIssues ?? []];\n}\nasync function checkSubject(result, options, subject) {\n\tconst issue = issuer(result, subject.file);\n\tconst { runner, specifier, file } = subject;\n\tconst declared = checkDeclared(result, subject, subject.outputsSchemaOf);\n\tconst resolveEnv = processResolveEnv(options.projectRoot, options.env);\n\tconst patch = subject.patch ?? ((host) => host);\n\tif (ONE_SHOT_VERBS.has(subject.verb)) {\n\t\tif (!declared.tokens || !declared.shape) return;\n\t\tconst host = patch(substituteBuiltinEnv(subject.host, resolveEnv.builtins ?? {}));\n\t\tconst schema = runner.declaredHostSchema ?? runner.hostSchema;\n\t\tfor (const i of schemaIssuesOf(runner, schema, specifier, host, true)) issue(\"resolved\", i);\n\t\treturn;\n\t}\n\tconst unset = envSitesOf(subject.host).filter((site) => !site.optional && !isBuiltinEnvName(site.name) && options.env[site.name] === void 0);\n\tfor (const site of unset) issue(\"resolve\", {\n\t\tpath: site.path,\n\t\tmessage: unsetEnvMessage(site.name)\n\t});\n\tif (!declared.tokens || unset.length > 0) return;\n\tlet resolved;\n\tlet deferred = [];\n\ttry {\n\t\tif (options.outputs) resolved = resolveHostOutputs(subject.host, {\n\t\t\toutputs: options.outputs,\n\t\t\t...resolveEnv\n\t\t});\n\t\telse {\n\t\t\tconst partial = resolveHostOutputs(subject.host, resolveEnv, { deferSelf: subject.self });\n\t\t\tresolved = partial.host;\n\t\t\tdeferred = partial.deferred;\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof TokenResolutionError && error.detail) issue(\"resolve\", {\n\t\t\tpath: error.detail.path,\n\t\t\tmessage: error.detail.reason\n\t\t});\n\t\telse issue(\"resolve\", \"\", error);\n\t\treturn;\n\t}\n\tresult.deferred.push(...deferred.map((d) => ({\n\t\t...d,\n\t\tfile\n\t})));\n\tif (!declared.shape) return;\n\tconst allow = deferred.length > 0;\n\tconst schema = allow ? runner.declaredHostSchema ?? runner.hostSchema : runner.hostSchema;\n\tconst checked = hostSchemaIssues(runner, schema, specifier, patch(resolved), { tokens: allow ? \"allow\" : \"forbid\" });\n\tconst resolvedIssues = [...checked.issues, ...checked.schemaIssues ?? []];\n\tfor (const i of resolvedIssues) issue(\"resolved\", i);\n\tif (resolvedIssues.length > 0 || !runner.checkBoot) return;\n\ttry {\n\t\tconst boot = await runner.checkBoot(checked.data, {\n\t\t\tprojectRoot: options.projectRoot,\n\t\t\tverb: subject.verb,\n\t\t\tenv: options.env,\n\t\t\tfile\n\t\t});\n\t\tfor (const i of boot) issue(\"boot\", {\n\t\t\t...i,\n\t\t\tpath: i.path ?? \"\"\n\t\t});\n\t} catch (error) {\n\t\tissue(\"boot\", \"\", error);\n\t}\n}\nasync function checkCompound(result, options, subject) {\n\tconst issue = issuer(result, subject.file);\n\tconst { host, runner, specifier } = subject;\n\tconst declared = checkDeclared(result, subject);\n\tif (!declared.tokens || !declared.shape) return;\n\tif (!runner.declaredHostSchema) {\n\t\tconst own = schemaIssuesOf(runner, runner.hostSchema, specifier, host, true);\n\t\tfor (const i of own) issue(\"resolved\", i);\n\t\tif (own.length > 0) return;\n\t}\n\tconst children = isPlainObject(host.children) ? host.children : {};\n\tconst wiring = isPlainObject(host.config) ? host.config : {};\n\tconst verb = compoundStartVerb(subject.verb, host.runner);\n\tconst prepared = [];\n\tfor (const [key, member] of Object.entries(children)) try {\n\t\tprepared.push(await prepareMember(options.projectRoot, key, member));\n\t} catch (error) {\n\t\tissuer(result, `hosts/${member.host}/host.js`)(\"load\", \"\", error);\n\t}\n\tconst members = Object.entries(children).map(([key, m]) => ({\n\t\tkey,\n\t\thost: m.host\n\t}));\n\tif (prepared.length === members.length) try {\n\t\tplanCompound(prepared.map((m) => ({\n\t\t\tkey: m.key,\n\t\t\thost: m.member.host,\n\t\t\trefs: outputSitesOf(m.draft).map(({ ref, path }) => ({\n\t\t\t\tref,\n\t\t\t\tpath\n\t\t\t}))\n\t\t})), wiring.startOrder);\n\t} catch (error) {\n\t\tissue(\"declared\", \"\", error);\n\t}\n\tconst byKey = new Map(prepared.map((m) => [m.key, m]));\n\tconst outputsSchemaOf = (ref) => {\n\t\tconst target = memberForRef(ref, members);\n\t\tif (\"error\" in target) return { error: target.error };\n\t\tconst producer = byKey.get(target.key);\n\t\treturn producer ? runnerOutputsSchema(producer.runner, producer.specifier, `member \"${target.key}\"`) : { error: `names member \"${target.key}\", which was not prepared.` };\n\t};\n\tfor (const m of prepared) {\n\t\tconst csp = wiring.cspRegistrySync === true && takesCspRegistrySync(m);\n\t\tawait checkSubject(result, options, {\n\t\t\tfile: m.file,\n\t\t\thost: m.draft,\n\t\t\trunner: m.runner,\n\t\t\tspecifier: m.specifier,\n\t\t\tverb: memberVerbOf(verb, m.draft.runner),\n\t\t\toutputsSchemaOf,\n\t\t\tself: { members },\n\t\t\t...csp ? { patch: (resolved) => ({\n\t\t\t\t...resolved,\n\t\t\t\trunner: {\n\t\t\t\t\t...resolved.runner,\n\t\t\t\t\tcspRegistrySync: true\n\t\t\t\t}\n\t\t\t}) } : {}\n\t\t});\n\t}\n}\nfunction issuer(result, file) {\n\treturn (stage, found, error) => {\n\t\tif (typeof found !== \"string\") {\n\t\t\tconst { path, message, hint } = found;\n\t\t\tresult.issues.push({\n\t\t\t\tstage,\n\t\t\t\tfile,\n\t\t\t\tpath,\n\t\t\t\tmessage,\n\t\t\t\t...hint ? { hint } : {}\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst [message, hint] = (error instanceof Error ? error.message : String(error)).split(\"\\n Hint: \");\n\t\tresult.issues.push({\n\t\t\tstage,\n\t\t\tfile,\n\t\t\tpath: found,\n\t\t\tmessage,\n\t\t\t...hint ? { hint } : {}\n\t\t});\n\t};\n}\n//#endregion\n//#region src/host-export-schema.ts\nfunction isRecord$1(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction childFolders$1(host) {\n\tif (!isRecord$1(host) || !isRecord$1(host.children)) return [];\n\treturn Object.entries(host.children).flatMap(([key, child]) => isRecord$1(child) && typeof child.host === \"string\" ? [[key, child.host]] : []);\n}\nconst declaredHostSchema = z.custom().superRefine((host, ctx) => {\n\tconst result = (isRecord$1(host) && \"children\" in host ? declaredHostSchemas.compoundHostSchema : declaredHostSchemas.reactorHostSchema).safeParse(host);\n\tif (result.success) return;\n\tfor (const issue of result.error.issues) ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: issue.message,\n\t\tpath: issue.path\n\t});\n});\n/** `ph host export`: a declared host plus its members, keyed by folder. */\nconst hostExportSchema = z.strictObject({\n\tformat: z.literal(\"ph-host-export\"),\n\tversion: z.literal(1),\n\tproject: z.strictObject({\n\t\tname: z.string().min(1),\n\t\troot: z.string().min(1)\n\t}),\n\tname: z.string().min(1),\n\thost: declaredHostSchema,\n\tmembers: z.record(z.string(), declaredHostSchema)\n}).superRefine((value, ctx) => {\n\tconst reached = /* @__PURE__ */ new Set();\n\tconst pending = [[[\"host\"], value.host]];\n\tfor (let next = pending.shift(); next; next = pending.shift()) {\n\t\tconst [at, host] = next;\n\t\tfor (const [key, folder] of childFolders$1(host)) {\n\t\t\tif (!(folder in value.members)) {\n\t\t\t\tctx.addIssue({\n\t\t\t\t\tcode: \"custom\",\n\t\t\t\t\tpath: [\n\t\t\t\t\t\t...at,\n\t\t\t\t\t\t\"children\",\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\"host\"\n\t\t\t\t\t],\n\t\t\t\t\tmessage: `Member folder \"${folder}\" is missing from members.`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (reached.has(folder)) continue;\n\t\t\treached.add(folder);\n\t\t\tpending.push([[\"members\", folder], value.members[folder]]);\n\t\t}\n\t}\n\tfor (const folder of Object.keys(value.members)) {\n\t\tif (reached.has(folder)) continue;\n\t\tctx.addIssue({\n\t\t\tcode: \"custom\",\n\t\t\tpath: [\"members\", folder],\n\t\t\tmessage: `Member \"${folder}\" is not reached from the host's children.`\n\t\t});\n\t}\n});\n//#endregion\n//#region src/host-export.ts\nfunction checkHint(name) {\n\treturn `Run \\`ph host check ${name}\\`.`;\n}\nfunction childFolders(host, name) {\n\tif (!(\"children\" in host)) return [];\n\tconst parsed = declaredHostSchemas.childrenSchema.safeParse(host.children);\n\tif (!parsed.success) throw new HostLoadError(`hosts/${name}/host.js: invalid \\`children\\`:\\n${z.prettifyError(parsed.error)}`, checkHint(name));\n\treturn Object.values(parsed.data).map((child) => child.host);\n}\n/** A host as declared and every member it reaches, raw `loadHost` bodies. */\nasync function exportHost(projectRoot, name) {\n\tconst root = path.resolve(projectRoot);\n\tconst { host } = await loadHost(root, name);\n\tconst members = {};\n\tconst visit = async (folders) => {\n\t\tfor (const folder of folders) {\n\t\t\tif (folder in members) continue;\n\t\t\tconst member = (await loadHost(root, folder)).host;\n\t\t\tmembers[folder] = member;\n\t\t\tawait visit(childFolders(member, folder));\n\t\t}\n\t};\n\tawait visit(childFolders(host, name));\n\tconst envelope = {\n\t\tformat: \"ph-host-export\",\n\t\tversion: 1,\n\t\tproject: {\n\t\t\tname: readProjectName(root),\n\t\t\troot\n\t\t},\n\t\tname,\n\t\thost,\n\t\tmembers\n\t};\n\tconst parsed = hostExportSchema.safeParse(JSON.parse(JSON.stringify(envelope)));\n\tif (!parsed.success) throw new HostLoadError(`hosts/${name}/host.js: the export is not a valid host export:\\n${z.prettifyError(parsed.error)}`, checkHint(name));\n\treturn envelope;\n}\n//#endregion\n//#region src/drives.ts\nconst sha256Hex = (input) => crypto.createHash(\"sha256\").update(input).digest(\"hex\");\nfunction projectDriveId(projectRoot, slug) {\n\treturn projectDriveIdWith(sha256Hex, projectRoot, slug);\n}\nfunction resolveDriveDeclaration(projectRoot, decl) {\n\tconst id = decl.projectHash ? projectDriveId(projectRoot, decl.slug) : decl.id ?? decl.slug;\n\tconst slug = decl.projectHash === true ? id : decl.slug;\n\tif (decl.remote) return {\n\t\tkind: \"remote\",\n\t\tid,\n\t\tslug,\n\t\tname: decl.name ?? decl.slug,\n\t\tremoteUrl: decl.remote.url,\n\t\tsharingType: decl.sharingType ?? \"public\",\n\t\tavailableOffline: decl.availableOffline ?? true\n\t};\n\treturn {\n\t\tkind: \"local\",\n\t\tid,\n\t\tslug,\n\t\tname: decl.name ?? decl.slug,\n\t\ticon: resolveImageRef(projectRoot, decl.icon, {\n\t\t\tmaxBytes: DRIVE_ICON_MAX_BYTES,\n\t\t\twarn: (m) => console.warn(m)\n\t\t}),\n\t\tpreferredEditor: decl.preferredEditor,\n\t\tsharingType: decl.sharingType ?? \"public\",\n\t\tavailableOffline: decl.availableOffline ?? true\n\t};\n}\n/** Idempotent, slug-keyed: an existing slug is left untouched (never\n* recreated, never mutated — preserveStrategy refinements live here later). */\nasync function seedDrives(client, drives) {\n\tconst result = {\n\t\tcreated: [],\n\t\texisting: [],\n\t\tattached: []\n\t};\n\tfor (const drive of drives) {\n\t\tif (drive.kind === \"remote\") {\n\t\t\tawait client.attachRemoteDrive(drive.remoteUrl);\n\t\t\tresult.attached.push(drive.slug);\n\t\t\tcontinue;\n\t\t}\n\t\tif (await client.findDriveBySlug(drive.slug) !== void 0) {\n\t\t\tresult.existing.push(drive.slug);\n\t\t\tcontinue;\n\t\t}\n\t\tawait client.createDrive(drive);\n\t\tresult.created.push(drive.slug);\n\t}\n\treturn result;\n}\n/** Merge host-declared drives with plugin contributions, slug-keyed — the\n* host file wins on conflicts (it is the most explicit source). */\nfunction mergeDrivePlan(projectRoot, hostDeclared, contributed) {\n\tconst plan = /* @__PURE__ */ new Map();\n\tfor (const { declaration, source } of contributed) {\n\t\tconst drive = resolveDriveDeclaration(projectRoot, declaration);\n\t\tplan.set(drive.slug, {\n\t\t\tdrive,\n\t\t\tsource\n\t\t});\n\t}\n\tfor (const declaration of hostDeclared) {\n\t\tconst drive = resolveDriveDeclaration(projectRoot, declaration);\n\t\tplan.set(drive.slug, {\n\t\t\tdrive,\n\t\t\tsource: \"host\"\n\t\t});\n\t}\n\treturn [...plan.values()];\n}\nfunction explainDrivePlan(plan) {\n\tif (plan.length === 0) return \"(no drives declared)\";\n\treturn [\"drives:\", ...plan.map(({ drive, source }) => {\n\t\tconst kind = drive.kind === \"remote\" ? `remote ${drive.remoteUrl}` : \"local\";\n\t\tconst editor = drive.preferredEditor ? ` editor=${drive.preferredEditor}` : \"\";\n\t\treturn ` ${drive.slug} (${kind}, id=${drive.id}${editor}) [${source}]`;\n\t})].join(\"\\n\");\n}\n//#endregion\n//#region src/reactor-config.ts\n/** The single primary backend for phase-2 projection (multi-backend routing is\n* track R). Prefers placement.primary, else \"main\"/\"local\", else the first. */\nfunction primaryBackend(reactor) {\n\tconst backends = reactor?.backends;\n\tif (!backends) return void 0;\n\tconst names = Object.keys(backends);\n\tif (names.length === 0) return void 0;\n\treturn backends[reactor.placement?.primary ?? (names.includes(\"main\") ? \"main\" : names.includes(\"local\") ? \"local\" : names[0])];\n}\nconst FLAG_ENV = {\n\tdocumentDecisions: \"REACTOR_DOCUMENT_DECISIONS\",\n\tauthEnforcement: \"REACTOR_AUTH_ENFORCEMENT\",\n\tauthGroups: \"REACTOR_AUTH_GROUPS\",\n\tauthConditions: \"REACTOR_AUTH_CONDITIONS\"\n};\n/** The env vars a protocol block maps onto, with their string values. Only\n* keys the block actually sets appear. */\nfunction protocolEnv(protocol) {\n\tconst env = {};\n\tif (!protocol) return env;\n\tfor (const [key, varName] of Object.entries(FLAG_ENV)) {\n\t\tconst value = protocol.featureFlags?.[key];\n\t\tif (value !== void 0) env[varName] = value ? \"true\" : \"false\";\n\t}\n\tif (protocol.createSignaturePolicy !== void 0) env.CREATE_SIGNATURE_POLICY = protocol.createSignaturePolicy;\n\tif (protocol.unsupportedStoredDocuments !== void 0) env.REACTOR_UNSUPPORTED_STORED_DOCUMENTS = protocol.unsupportedStoredDocuments;\n\treturn env;\n}\n/** The reactor block as a switchboard config layer. The reactor store and the\n* read model are separate fields: `readModel.url` never moves the reactor. */\nfunction reactorBlockToSwitchboardConfig(reactor) {\n\tconst layer = {};\n\tconst backend = primaryBackend(reactor);\n\tconst storage = backend?.storage;\n\tconst reactorUrl = storage?.kind === \"postgres\" ? storage.url : storage?.dataDir;\n\tconst readModelUrl = backend?.readModel?.url;\n\tif (reactorUrl || readModelUrl) layer.storage = {\n\t\t...reactorUrl ? { reactor: { url: reactorUrl } } : {},\n\t\t...readModelUrl ? { readModel: { url: readModelUrl } } : {}\n\t};\n\tif (reactor?.protocol) layer.protocol = reactor.protocol;\n\tif (backend?.packages?.dynamic) layer.packages = { dynamic: true };\n\tif (reactor?.workflows !== void 0) layer.features = { workflows: reactor.workflows };\n\treturn layer;\n}\nconst LOCAL_BACKEND_KINDS = /* @__PURE__ */ new Set([\"in-process\", \"worker\"]);\n/**\n* Which reactor client the backend topology asks for:\n* - local (in-process/worker) AND remote backends -> `router`\n* - remote backend(s) only -> `remote`\n* - a worker backend -> `worker`\n* - anything else local -> `in-process`\n* `undefined` when no backends are declared — the caller then keeps the\n* legacy reactorWorker/multiReactor behaviour untouched.\n*/\nfunction reactorClientMode(reactor) {\n\tconst backends = reactor?.backends;\n\tif (!backends) return void 0;\n\tconst kinds = Object.values(backends).map((b) => b.kind);\n\tif (kinds.length === 0) return void 0;\n\tconst hasLocal = kinds.some((k) => LOCAL_BACKEND_KINDS.has(k));\n\tconst hasRemote = kinds.some((k) => k === \"remote\");\n\tif (hasLocal && hasRemote) return \"router\";\n\tif (hasRemote) return \"remote\";\n\treturn primaryBackend(reactor)?.kind === \"worker\" ? \"worker\" : \"in-process\";\n}\n/** Project the reactor block onto the Connect runtime config: protocol →\n* connect.reactor (same shape), backend topology → instance.reactorWorker\n* (legacy) + instance.reactorClient (the explicit 4-way selector),\n* workflows → app.workflowsEnabled. */\nfunction projectReactorToConnect(reactor) {\n\tconst connect = {};\n\tif (reactor?.protocol) connect.reactor = reactor.protocol;\n\tconst backend = primaryBackend(reactor);\n\tconst mode = reactorClientMode(reactor);\n\tif (backend?.kind !== void 0 || mode !== void 0) connect.instance = {\n\t\t...backend?.kind !== void 0 ? { reactorWorker: backend.kind === \"worker\" } : {},\n\t\t...mode !== void 0 ? { reactorClient: mode } : {}\n\t};\n\tif (reactor?.workflows !== void 0) connect.app = { workflowsEnabled: reactor.workflows };\n\treturn { connect };\n}\n/** Each pre-set env var that CONTRADICTS the host's protocol block, as a\n* message naming the var, the host value and the env value. An env var that\n* merely matches, or is unset, is fine. */\nfunction protocolConflicts(protocol, env, hostFile = \"the host file\") {\n\tif (!protocol) return [];\n\treturn Object.entries(protocolEnv(protocol)).flatMap(([varName, hostValue]) => {\n\t\tconst envValue = env[varName];\n\t\tif (envValue === void 0 || envValue === hostValue) return [];\n\t\treturn [`reactor.protocol conflict: ${varName} is \"${envValue}\" in the environment but \"${hostValue}\" in ${hostFile}. These are fleet-consensus settings — a mismatch would diverge replay. Remove the env override or align the host.`];\n\t});\n}\n/**\n* The enforcement teeth of single-sourcing: if a pre-set env var CONTRADICTS\n* the host's protocol block, fail loudly naming the var, the host value, and\n* the env value (phase-2 transition keeps an operator's explicit env as an\n* escape hatch unless it disagrees with the protocol — see the WBS\n* precedence note).\n*/\nfunction assertProtocolConsistency(protocol, env, hostFile = \"the host file\") {\n\tconst conflict = protocolConflicts(protocol, env, hostFile).at(0);\n\tif (conflict) throw new Error(conflict);\n}\n//#endregion\n//#region src/backend-projection.ts\nfunction projectStorage(name, storage) {\n\tswitch (storage.kind) {\n\t\tcase \"idb\": return { kind: \"idb\" };\n\t\tcase \"memory\": return { kind: \"memory\" };\n\t\tcase \"path\":\n\t\t\tif (!storage.dataDir) throw new Error(`Backend \"${name}\": storage kind \"path\" requires dataDir.`);\n\t\t\treturn {\n\t\t\t\tkind: \"path\",\n\t\t\t\tdataDir: storage.dataDir\n\t\t\t};\n\t\tcase \"postgres\": throw new Error(`Backend \"${name}\": storage kind \"postgres\" is server-side only — a provisioned (in-process/worker) reactor cannot use it. Point a \"remote\" backend at the switchboard that owns that database instead.`);\n\t}\n}\n/** One backend → one descriptor. The protocol's featureFlags ride every\n* descriptor (they are fleet consensus, not per-backend). A remote backend\n* must carry remote.url — provision() requires it. */\nfunction backendToDescriptor(name, backend, protocol) {\n\tconst descriptor = {\n\t\tkind: backend.kind,\n\t\tname\n\t};\n\tif (descriptor.kind === \"remote\") {\n\t\tconst url = backend.remote?.url;\n\t\tif (!url) throw new Error(`Backend \"${name}\" is kind \"remote\" but has no remote.url — a remote descriptor attaches to an already-running reactor by URL.`);\n\t\tdescriptor.remote = { url };\n\t\treturn descriptor;\n\t}\n\tif (backend.storage) descriptor.storage = projectStorage(name, backend.storage);\n\tif (backend.packages) descriptor.packages = backend.packages;\n\tif (protocol?.featureFlags) descriptor.featureFlags = protocol.featureFlags;\n\treturn descriptor;\n}\n/** All named backends, in placement-primary-first order (the order a\n* createReactorClients step would provision them). */\nfunction backendsToDescriptors(reactor) {\n\tconst backends = reactor?.backends;\n\tif (!backends) return [];\n\tconst names = Object.keys(backends);\n\tconst primary = reactor.placement?.primary;\n\treturn (primary && names.includes(primary) ? [primary, ...names.filter((n) => n !== primary)] : names).map((name) => backendToDescriptor(name, backends[name], reactor.protocol));\n}\nconst LOCAL_KINDS = /* @__PURE__ */ new Set([\"in-process\", \"worker\"]);\n/**\n* Structural multi-reactor (phase 4): true when the block names BOTH a local\n* backend (in-process/worker — the tab's own reactor) and a remote one. This\n* is the shape Connect's routing client serves; a lone remote backend is an\n* attach-only host (assistant/agent shape), not a routed tab.\n*/\nfunction isStructuralMultiReactor(reactor) {\n\tconst backends = reactor?.backends;\n\tif (!backends) return false;\n\tconst kinds = Object.values(backends).map((b) => b.kind);\n\treturn kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === \"remote\");\n}\n/** The remote backends' drive addresses, placement order. */\nfunction remoteBackendUrls(reactor) {\n\treturn backendsToDescriptors(reactor).filter((d) => d.kind === \"remote\").map((d) => d.remote?.url).filter((u) => typeof u === \"string\");\n}\n//#endregion\n//#region src/connect-projection.ts\n/**\n* Instance-fact projection for compound hosts: the drives a compound's\n* reactor member created, projected into the Connect member's runtime-config\n* override. Pure functions, moved from ph-cli's vetra service so the generic\n* compound and the classic path share one implementation.\n*/\nfunction isLocalDrive(drive) {\n\treturn \"local\" in drive;\n}\nconst driveKey = (drive) => isLocalDrive(drive) ? `local:${drive.id}` : drive.url;\n/**\n* Concatenate groups of `connect.drives.defaultDrives` in the order given,\n* de-duplicating by drive identity (URL for remote entries, id for local\n* ones). The first occurrence of a drive wins, so earlier groups keep their\n* position and metadata — e.g. the Vetra drive `ph vetra` starts stays first\n* even when the project's `powerhouse.config.json` lists the same drive.\n*/\nfunction mergeDefaultDrives(...groups) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst out = [];\n\tfor (const group of groups) for (const drive of group) {\n\t\tconst key = driveKey(drive);\n\t\tif (seen.has(key)) continue;\n\t\tseen.add(key);\n\t\tout.push(drive);\n\t}\n\treturn out;\n}\n/**\n* Rebase a local drive URL onto a public base: keeps the /d/<slug> path,\n* swaps the loopback origin for the public base. Browser clients behind a\n* reverse proxy can't reach http://localhost:<port>. Non-loopback URLs\n* (e.g. a remote drive) are already public and pass through unchanged, as do\n* unparseable ones.\n*/\nfunction rebaseDriveUrl(driveUrl, publicBase) {\n\tlet url;\n\ttry {\n\t\turl = new URL(driveUrl);\n\t} catch {\n\t\treturn driveUrl;\n\t}\n\tif (![\n\t\t\"localhost\",\n\t\t\"127.0.0.1\",\n\t\t\"[::1]\"\n\t].includes(url.hostname)) return driveUrl;\n\treturn `${publicBase.replace(/\\/+$/, \"\")}${url.pathname}`;\n}\n/**\n* The compound's drives projection: created drives first (rebased onto the\n* public base when given), then the project's configured drives, de-duplicated\n* — and `preserve-all`, because compound-injected drive lists change per\n* launch context and must never detach drives the user added by hand.\n*/\nfunction projectDrivesIntoConnect(input) {\n\treturn { drives: {\n\t\tdefaultDrives: mergeDefaultDrives(input.createdDriveUrls.filter((url) => typeof url === \"string\" && url.length > 0).map((url) => ({\n\t\t\turl: input.publicBase ? rebaseDriveUrl(url, input.publicBase) : url,\n\t\t\tname: null,\n\t\t\ticon: null\n\t\t})), input.configuredDefaultDrives ?? []),\n\t\tpreserveStrategy: \"preserve-all\"\n\t} };\n}\n//#endregion\n//#region src/expect-host.ts\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction runnerOf(host) {\n\treturn isRecord(host.runner) ? host.runner : {};\n}\nfunction defaultVerbOf(host) {\n\tconst verb = runnerOf(host).defaultVerb;\n\treturn typeof verb === \"string\" ? verb : void 0;\n}\n/** At compound verb \"run\" each member runs its own defaultVerb; any other\n* compound verb is forwarded uniformly (compound.ts `memberVerbOf`). */\nfunction memberVerb(compoundVerb, member) {\n\treturn compoundVerb === \"run\" ? defaultVerbOf(member) ?? \"run\" : compoundVerb;\n}\n/** Backend names, placement-primary first (`backendsToDescriptors` order). */\nfunction orderedBackends(reactor) {\n\tconst backends = Object.entries(reactor.backends ?? {});\n\tconst primary = reactor.placement?.primary;\n\treturn [...backends.filter(([name]) => name === primary), ...backends.filter(([name]) => name !== primary)];\n}\nfunction expectBackend(name, backend, reactor) {\n\tconst out = {\n\t\tname,\n\t\tkind: backend.kind\n\t};\n\tif (backend.storage) out.storage = backend.storage.kind;\n\tif (typeof backend.storage?.dataDir === \"string\") out.dataDir = backend.storage.dataDir;\n\ttry {\n\t\tbackendToDescriptor(name, backend, reactor.protocol);\n\t} catch (error) {\n\t\tout.provisionError = error instanceof Error ? error.message : String(error);\n\t}\n\treturn out;\n}\nfunction expectDrive(declaration, source) {\n\tif (typeof declaration.slug !== \"string\") return void 0;\n\tconst remote = isRecord(declaration.remote) ? declaration.remote : void 0;\n\tconst drive = {\n\t\tslug: declaration.slug,\n\t\tkind: remote ? \"remote\" : \"local\",\n\t\tsource\n\t};\n\tif (remote && typeof remote.url === \"string\") drive.url = remote.url;\n\tif (typeof declaration.id === \"string\") drive.id = declaration.id;\n\tconst projectHash = declaration.projectHash;\n\tif (typeof projectHash === \"boolean\" || projectHash === \"id\") drive.projectHash = projectHash;\n\treturn drive;\n}\n/** The key `mergeDrivePlan` merges on: the SERVED slug, which for\n* `projectHash: true` is the hashed id (never equal to a plain slug). */\nfunction servedSlugKey(drive) {\n\treturn drive.projectHash === true ? `${drive.slug}\\0hashed` : drive.slug;\n}\n/** Contributions first, then host declarations; keyed by served slug, the\n* host wins (and keeps the contribution's position), like `mergeDrivePlan`. */\nfunction drivePlan(reactor, contributed) {\n\tconst plan = /* @__PURE__ */ new Map();\n\tfor (const { declaration, source } of contributed) {\n\t\tconst drive = expectDrive(declaration, source);\n\t\tif (drive) plan.set(servedSlugKey(drive), drive);\n\t}\n\tfor (const declaration of reactor?.drives ?? []) {\n\t\tconst drive = expectDrive(declaration, \"host\");\n\t\tif (drive) plan.set(servedSlugKey(drive), drive);\n\t}\n\treturn [...plan.values()];\n}\n/** Token facts of the host's OWN fields (a compound's `children` are its\n* members' own). */\nfunction tokenFacts(declared, kind) {\n\tconst own = kind === \"compound\" ? Object.fromEntries(Object.entries(declared).filter(([key]) => key !== \"children\")) : declared;\n\tconst sites = outputSitesOf(own);\n\tconst consumes = sites.map(({ path, ref, outputPath }) => ({\n\t\tat: path,\n\t\thost: ref.host,\n\t\t...ref.member !== void 0 ? { member: ref.member } : {},\n\t\tpath: outputPath\n\t}));\n\treturn {\n\t\tdependsOn: [...new Set(sites.map(({ ref }) => refKey(ref)))].sort(),\n\t\tconsumes,\n\t\tenv: [...new Set(envSitesOf(own).map(({ name }) => name))].sort()\n\t};\n}\nfunction expectOwn(input, verb) {\n\tconst resolved = input.resolved ?? input.declared;\n\tconst expectation = {\n\t\tname: typeof resolved.name === \"string\" ? resolved.name : \"\",\n\t\tkind: input.kind,\n\t\tverb,\n\t\t...tokenFacts(input.declared, input.kind)\n\t};\n\tif (input.kind !== \"reactor\") return expectation;\n\tconst reactor = isRecord(resolved.reactor) ? resolved.reactor : void 0;\n\tconst mode = reactorClientMode(reactor);\n\tif (mode !== void 0) expectation.clientMode = mode;\n\texpectation.multiReactor = isStructuralMultiReactor(reactor);\n\tconst backends = reactor ? orderedBackends(reactor) : [];\n\tif (reactor && backends.length > 0) {\n\t\texpectation.backends = backends.map(([name, backend]) => expectBackend(name, backend, reactor));\n\t\texpectation.remotes = backends.flatMap(([, backend]) => backend.kind === \"remote\" && typeof backend.remote?.url === \"string\" ? [backend.remote.url] : []);\n\t}\n\texpectation.drives = drivePlan(reactor, input.contributed ?? []);\n\treturn expectation;\n}\n/**\n* The expectation for one host. A reactor host's comes from its resolved\n* reactor block and contributed drives; a compound's lists its members in\n* plan order, each with the verb it runs at under the compound's own verb\n* and the members it starts after.\n*/\nfunction expectHost(input) {\n\tconst verb = defaultVerbOf(input.declared) ?? \"run\";\n\tconst expectation = expectOwn(input, verb);\n\tif (input.kind !== \"compound\" || !input.members) return expectation;\n\tconst order = input.plan?.order ?? input.members.map((m) => m.key);\n\tconst edges = input.plan?.edges ?? [];\n\tconst byKey = new Map(input.members.map((m) => [m.key, m]));\n\tconst members = {};\n\tfor (const key of order) {\n\t\tconst member = byKey.get(key);\n\t\tif (!member) continue;\n\t\tmembers[key] = {\n\t\t\thost: member.host,\n\t\t\t...expectOwn(member, memberVerb(verb, member.declared)),\n\t\t\tafter: [...new Set(edges.filter((e) => e.consumer === key).map((e) => e.producer))].sort()\n\t\t};\n\t}\n\texpectation.startOrder = order.filter((key) => byKey.has(key));\n\texpectation.members = members;\n\treturn expectation;\n}\n//#endregion\nexport { BUILTIN_ENV_NAMES, CONNECT_PLUGIN_OWNED_SLICES, CONNECT_RUNNER, HOST_NAME_MAX_LENGTH, HOST_NAME_MESSAGE, HOST_NAME_PATTERN, HostLoadError, ONE_SHOT_VERBS, ORIGIN_PLACEHOLDER, OUTPUTS_FILE, PlanError, PluginError, RunnerError, SWITCHBOARD_PROXY_PATHS, SpawnHostError, TOKEN_ESCAPE_KEY, TOKEN_KEYS, TokenResolutionError, applyChildWrapper, assertProtocolConsistency, backendToDescriptor, backendsToDescriptors, buildDriveDeclarationSchema, checkHost, checkOutputPaths, checkTokenSites, childWrapperSchema, childrenSchema, clearRunRecord, collectTokenSites, compoundHostSchema, compoundOutputSource, compoundWiringSchema, computeOutputsHash, concatTokenSchema, declaredGenericCompoundHostSchema, declaredHostSchemas, defaultUserDataDir, defineHostSchemas, describeHostOutputs, describeMapElements, describeToken, driveAddressMessage, driveDeclarationSchema, drivesSchema, emitHostJsonSchema, emittedHostSchemas, entryActiveForVerb, envSitesOf, envTokenSchema, envTokenable, expectHost, explainDrivePlan, exportHost, findDeadConnectConfig, findNonStaticValue, findRemovedForms, findToken, forbidRef, formatPath, genericCompoundHostSchema, getVerb, hostExportSchema, hostNameSchema, hostSchemaIssues, hostTypeSatisfies, isBuiltinEnvName, isHtmlNavigation, isOriginPlaceholderUrl, isPidAlive, isSchemaLike, isStructuralMultiReactor, isSwitchboardProxyPath, isToken, itemTokenSchema, keyTokenSchema, kindShapeIssues, knownVerbIssues, lintHostImportGraph, lintHostImports, lintOutputsFile, listRunRecords, listVerbs, loadHost, loadProducers, makeHostSchemas, mapTokenSchema, memberForRef, mergeContributions, mergeDefaultDrives, mergeDrivePlan, normalizePluginEntries, normalizePluginEntry, originOrUrlSchema, outputRefsOf, outputSitesOf, outputTokenSchema, placementKeyIssues, planCompound, pluginEntryObjectSchema, pluginEntrySchema, primaryBackend, probeHostsFolder, probeRun, processResolveEnv, producerOutputsSchemas, profileSchema, projectDriveId, projectDriveIdWith, projectDrivesIntoConnect, projectReactorToConnect, protocolConflicts, protocolEnv, reactorBackendKindSchema, reactorBackendSchema, reactorBlockToSwitchboardConfig, reactorClientMode, reactorHostSchema, reactorProtocolSchema, reactorSchema, readOutputsFileHash, readProjectName, readRunRecord, rebaseDriveUrl, ref, refKey, refineStartOrder, registerHostType, remoteBackendUrls, renderTokens, resolveDriveDeclaration, resolveHostOutputs, resolveHostPlugins, resolveOrder, resolveOriginPlaceholders, resolvePluginContributions, resolveRunnerModule, resolveUserDataPlaceholders, runCompound, runObserveHook, runObserveHookSequential, runProvideHook, runRecordMemberSchema, runRecordOutputSource, runRecordSchema, runTransformHook, runnerBaseSchema, runnerHandleSchema, runnerKindSchema, runnerOutputsSchema, scanHostImports, schemaAtPath, seedDrives, spawnHost, stripComments, substituteBuiltinEnv, switchboardOfDrive, toOriginPlaceholder, toStartedHandle, tokenKeyOf, tokenSchema, tokenable, unwrapEscapes, validateDeclaredHost, validateHost, withOriginPlaceholders, writeRunRecord };\n\n//# sourceMappingURL=index.mjs.map"],"names":["z.custom","z.strictObject","z.literal","z.string","z.record","z.prettifyError"],"mappings":";;;;;;;;;;;;;;;AA+OA,eAAe,UAAU,MAAM,SAAS;CACvC,MAAM,SAAS;EACd,QAAQ,C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AO,EAAE,QAAQ;EAChB,eAAe,mBAAmB,MAAM,iBAAiB,QAAQ,QAAQ,OAAO,QAAQ,YAAY,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,SAAS;GACjI,KAAK,MAAM,aAAa,eAAe,KAAK,MAAM,UAAU,IAAI;GAChE,MAAM;GACN,MAAM;EACP,EAAE,GAAG,MAAM,2BAA2B,CAAC,CAAC;EACxC,kBAAkB;CACnB,EAAE;AACH","debug_id":"90281515-fbc7-5ef6-a96b-c1bf0052a971"}
@@ -1,4 +0,0 @@
1
- import { n as phCliCommands } from "./ph-cli-commands-DPINuS0Q.mjs";
2
- export { phCliCommands };
3
- !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]="c8a24844-5b7e-5060-85b9-e4487fb2c088")}catch(e){}}();
4
- //# debugId=c8a24844-5b7e-5060-85b9-e4487fb2c088