@powerhousedao/host-core 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.
- package/dist/{compound-YHuVvCFd.mjs → compound-GhJAA2dK.mjs} +13 -1
- package/dist/compound-GhJAA2dK.mjs.map +1 -0
- package/dist/compound-NxCal3db.d.mts.map +1 -1
- package/dist/{env-substitution-DBkqQ6sX.mjs → env-substitution-CN_oSVVY.mjs} +13 -1
- package/dist/env-substitution-CN_oSVVY.mjs.map +1 -0
- package/dist/host-schemas-DtKFmLd0.d.mts.map +1 -1
- package/dist/index.d.mts +18 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +123 -65
- package/dist/index.mjs.map +1 -1
- package/dist/projection.d.mts +5 -1
- package/dist/projection.d.mts.map +1 -1
- package/dist/projection.mjs +80 -63
- package/dist/projection.mjs.map +1 -1
- package/dist/runners/compound.mjs +1 -1
- package/dist/schema.mjs +1 -1
- package/package.json +3 -3
- package/dist/compound-YHuVvCFd.mjs.map +0 -1
- package/dist/env-substitution-DBkqQ6sX.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compound-NxCal3db.d.mts","names":[],"sources":["../src/host-schemas.ts","../src/resolve/declared.ts","../src/runner-resolver.ts","../src/child-wrapper.ts","../src/runner-handle.ts","../src/compound.ts"],"mappings":";;;;;;;;;;;;;;;;cA2Ba,mBAAiB;cACjB;cACA;cAEA,gBAAc,EAAA;;;;;;cAWd,mBAAiB,EAAA,mBAAA,EAAA,QAAA,EAAA;cAOjB,eAAa,EAAA;;;;;GAKxB,EAAA,KAAA;cAEW,uBAAqB,EAAA;;;;;;;;;;;;;;;GAWhC,EAAA,KAAA;cAEW,kBAAgB,EAAA;;;;KACjB,aAAa,EAAE,aAAa;cAE3B,0BAAwB,EAAA;;;;;;;;cAiBxB,sBAAoB,EAAA;;;;GAY/B,EAAA,KAAA;;;;iBAKc,iBACd;EAAQ,UAAU;EAAyB,SAAS;GACpD,KAAK,EAAE;;;UAyBC;EACR,MAAM,UAAU,EAAE,SAAS,QAAQ,MAAM,gBAAgB;EACzD,MAAM,UAAU,EAAE,SAAS,QAAQ,MAAM,gBAAgB,GAAG;;;;;;
|
|
1
|
+
{"version":3,"file":"compound-NxCal3db.d.mts","names":[],"sources":["../src/host-schemas.ts","../src/resolve/declared.ts","../src/runner-resolver.ts","../src/child-wrapper.ts","../src/runner-handle.ts","../src/compound.ts"],"mappings":";;;;;;;;;;;;;;;;cA2Ba,mBAAiB;cACjB;cACA;cAEA,gBAAc,EAAA;;;;;;cAWd,mBAAiB,EAAA,mBAAA,EAAA,QAAA,EAAA;cAOjB,eAAa,EAAA;;;;;GAKxB,EAAA,KAAA;cAEW,uBAAqB,EAAA;;;;;;;;;;;;;;;GAWhC,EAAA,KAAA;cAEW,kBAAgB,EAAA;;;;KACjB,aAAa,EAAE,aAAa;cAE3B,0BAAwB,EAAA;;;;;;;;cAiBxB,sBAAoB,EAAA;;;;GAY/B,EAAA,KAAA;;;;iBAKc,iBACd;EAAQ,UAAU;EAAyB,SAAS;GACpD,KAAK,EAAE;;;UAyBC;EACR,MAAM,UAAU,EAAE,SAAS,QAAQ,MAAM,gBAAgB;EACzD,MAAM,UAAU,EAAE,SAAS,QAAQ,MAAM,gBAAgB,GAAG;;;;;;iBA8PrD,iBAAiB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,cAAc;;;EAGd;;EAEA,QAAQ;;UAGO;EACf,SAAS;;;EAGT,gBAAgB;;;;EAIhB,eAAe,iCAAiC;;iBAsB5B,YACpB,WAAW,gBACX,KAAK,eACL,SAAS,qBACR,QAAQ"}
|
|
@@ -198,8 +198,20 @@ function knownDriveSlugs(host) {
|
|
|
198
198
|
if (slug === void 0) return void 0;
|
|
199
199
|
slugs.push(slug);
|
|
200
200
|
}
|
|
201
|
+
for (const drive of connectDefaultDrives(host.config)) {
|
|
202
|
+
if (typeof drive !== "object" || drive === null || !("url" in drive)) continue;
|
|
203
|
+
const slug = linkedSlug(drive.url);
|
|
204
|
+
if (slug === void 0) return void 0;
|
|
205
|
+
slugs.push(slug);
|
|
206
|
+
}
|
|
201
207
|
return slugs;
|
|
202
208
|
}
|
|
209
|
+
/** A Connect host's `config.drives.defaultDrives`, unchecked. */
|
|
210
|
+
function connectDefaultDrives(config) {
|
|
211
|
+
const drives = typeof config === "object" && config !== null && "drives" in config ? config.drives : void 0;
|
|
212
|
+
const list = typeof drives === "object" && drives !== null && "defaultDrives" in drives ? drives.defaultDrives : void 0;
|
|
213
|
+
return Array.isArray(list) ? list : [];
|
|
214
|
+
}
|
|
203
215
|
/** Declared form, at host level so plugin drives are seen: a placement key
|
|
204
216
|
* must name a drive the host names, when every drive is knowable. A host
|
|
205
217
|
* with no remote backend is not checked: its plugins may contribute drives
|
|
@@ -556,4 +568,4 @@ function substituteValue(value, env) {
|
|
|
556
568
|
//#endregion
|
|
557
569
|
export { drivesSchema as A, itemTokenSchema as B, reactorProtocolSchema as C, runnerKindSchema as D, runnerBaseSchema as E, envTokenSchema as F, tokenKeyOf as G, mapTokenSchema as H, envTokenable as I, tokenSchema as K, findToken as L, TOKEN_ESCAPE_KEY as M, TOKEN_KEYS as N, buildDriveDeclarationSchema as O, concatTokenSchema as P, forbidRef as R, reactorHostSchema as S, refineStartOrder as T, outputTokenSchema as U, keyTokenSchema as V, ref as W, makeHostSchemas as _, HOST_NAME_PATTERN as a, reactorBackendKindSchema as b, compoundHostSchema as c, declaredHostSchemas as d, defineHostSchemas as f, hostNameSchema as g, genericCompoundHostSchema as h, HOST_NAME_MESSAGE as i, projectDriveIdWith as j, driveDeclarationSchema as k, compoundWiringSchema as l, emittedHostSchemas as m, substituteBuiltinEnv as n, childWrapperSchema as o, emitHostJsonSchema as p, tokenable as q, HOST_NAME_MAX_LENGTH as r, childrenSchema as s, isBuiltinEnvName as t, declaredGenericCompoundHostSchema as u, placementKeyIssues as v, reactorSchema as w, reactorBackendSchema as x, profileSchema as y, isToken as z };
|
|
558
570
|
|
|
559
|
-
//# sourceMappingURL=env-substitution-
|
|
571
|
+
//# sourceMappingURL=env-substitution-CN_oSVVY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-substitution-CN_oSVVY.mjs","names":[],"sources":["../src/drive-schema.ts","../src/host-schemas.ts","../src/env-substitution.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { tokenable, type TokenableSchema } from \"./tokens.js\";\n\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 */\nexport function buildDriveDeclarationSchema(\n urlField: (schema: z.ZodString) => TokenableSchema<z.ZodString>,\n) {\n return z.strictObject({\n slug: z.string().min(1),\n id: z.string().min(1).optional(),\n /** Derive the id from the project path, like generateProjectDriveId — the\n * same ids classic `ph vetra` produces. `true` serves the drive under the\n * hashed slug too (the vetra drive's slug IS its hashed id); `\"id\"` hashes\n * only the id and keeps the declared slug (the classic Workflows drive:\n * `/d/workflows`, id `workflows-<hash>`). */\n projectHash: z.union([z.boolean(), z.literal(\"id\")]).optional(),\n name: z.string().min(1).optional(),\n icon: z.string().optional(),\n preferredEditor: z.string().optional(),\n sharingType: z.enum([\"public\", \"private\", \"shared\"]).optional(),\n availableOffline: z.boolean().optional(),\n remote: z.strictObject({ url: urlField(z.string().min(1)) }).optional(),\n });\n}\n\nexport const driveDeclarationSchema = buildDriveDeclarationSchema(tokenable);\n\nexport type DriveDeclaration = z.infer<typeof driveDeclarationSchema>;\n\nexport const drivesSchema = z.array(driveDeclarationSchema);\n\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`. */\nexport function projectDriveIdWith(\n sha256Hex: (input: string) => string,\n projectRoot: string,\n slug: string,\n): string {\n return `${slug}-${sha256Hex(projectRoot).substring(0, 8)}`;\n}\n","import { switchboardOfDrive } from \"@powerhousedao/shared/host-tokens\";\nimport { isOriginPlaceholderUrl } from \"@powerhousedao/shared/connect/origin-placeholder\";\nimport { z } from \"zod\";\nimport { buildDriveDeclarationSchema } from \"./drive-schema.js\";\nimport { pluginEntrySchema } from \"./plugins.js\";\nimport {\n envTokenable,\n tokenable,\n type EnvToken,\n type TokenableSchema,\n type TokenMode,\n} from \"./tokens.js\";\n\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, a switchboard drive address), `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 */\n\n/** A host's `name` keys its run record, `.ph/run/<name>.json`, so it must be\n * one safe path segment. */\nexport const HOST_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;\nexport const HOST_NAME_MAX_LENGTH = 128;\nexport const HOST_NAME_MESSAGE =\n \"A host name is used as a file name, so use only letters, digits, '.', '_' and '-', start with a letter or digit, and keep it to 128 characters.\";\nexport const hostNameSchema = z\n .string()\n .min(1)\n .max(HOST_NAME_MAX_LENGTH, HOST_NAME_MESSAGE)\n .regex(HOST_NAME_PATTERN, HOST_NAME_MESSAGE);\n\n/**\n * A URL, or one written against the page origin (`${origin}/graphql`): the\n * browser resolves the placeholder when it loads Connect's config, for a\n * member whose own server proxies the switchboard's paths.\n */\nexport const originOrUrlSchema = z.union([\n z.url(),\n z.string().refine(isOriginPlaceholderUrl, {\n message: \"a URL, or ${origin}/<path> for a proxied sibling\",\n }),\n]);\n\nexport const profileSchema = z.strictObject({\n appId: z.string().min(1).optional(),\n name: z.string().min(1).optional(),\n description: z.string().optional(),\n icon: z.string().optional(),\n});\n\nexport const reactorProtocolSchema = z.strictObject({\n featureFlags: z\n .strictObject({\n documentDecisions: z.boolean().optional(),\n authEnforcement: z.boolean().optional(),\n authGroups: z.boolean().optional(),\n authConditions: z.boolean().optional(),\n })\n .optional(),\n createSignaturePolicy: z.enum([\"legacy\", \"v2-required\"]).optional(),\n unsupportedStoredDocuments: z.enum([\"refuse\", \"read-only\"]).optional(),\n});\n\nexport const runnerKindSchema = z.enum([\"reactor\", \"compound\"]);\nexport type RunnerKind = z.infer<typeof runnerKindSchema>;\n\nexport const reactorBackendKindSchema = z.enum([\n \"in-process\",\n \"worker\",\n \"remote\",\n]);\n\n// Path-equality for the one-dir guard: pure string normalisation (the host\n// core stays Node-free); the server repeats the check with path.resolve.\nconst samePath = (a: string, b: string): boolean => {\n const norm = (p: string) =>\n p.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\").replace(/^\\.\\//, \"\");\n return norm(a) === norm(b);\n};\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.) */\nexport const compoundWiringSchema = z.strictObject({\n /** Member start order; must name declared children and agree with the\n * output-token dependencies (resolve/plan.ts). Optional: without it the\n * order is derived from the tokens. Unnamed members start after the named\n * ones, in declaration order. */\n startOrder: z.array(z.string().min(1)).optional(),\n /** Write .ph/run/<host>.json (default true). */\n runtimeRecord: z.boolean().optional(),\n /** Patch the baked CSP for the runtime registry on a served Connect\n * member (forwarded as `runner.cspRegistrySync` to every member whose\n * runner is `@powerhousedao/ph-cli/runners/connect`). */\n cspRegistrySync: z.boolean().optional(),\n});\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. */\nexport function refineStartOrder(\n host: { children: Record<string, unknown>; config?: Record<string, unknown> },\n ctx: z.RefinementCtx,\n): void {\n const startOrder = host.config?.startOrder;\n if (!Array.isArray(startOrder)) return;\n const members = Object.keys(host.children);\n startOrder.forEach((name: unknown, index) => {\n if (startOrder.indexOf(name) !== index) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"config\", \"startOrder\", index],\n message: `startOrder names \"${String(name)}\" twice; each member starts once.`,\n });\n return;\n }\n if (typeof name === \"string\" && members.includes(name)) return;\n ctx.addIssue({\n code: \"custom\",\n path: [\"config\", \"startOrder\", index],\n message: `startOrder names \"${String(name)}\", which is not a member. Members: ${members.join(\", \") || \"(none)\"}.`,\n });\n });\n}\n\n/** How a schema set wraps its token-able fields. Both modes share one static\n * type (declared input, resolved output); they differ at runtime only. */\ninterface FieldWrappers {\n any: <S extends z.ZodType>(schema: S) => TokenableSchema<S>;\n env: <S extends z.ZodType>(schema: S) => TokenableSchema<S, EnvToken>;\n}\n\nconst ALLOW_TOKENS: FieldWrappers = { any: tokenable, env: envTokenable };\n// A one-option union: the same validation as `schema`, typed like the\n// \"allow\" wrappers so both modes share HostSchemas.\nconst FORBID_TOKENS: FieldWrappers = {\n any: (schema) => z.union([schema]),\n env: (schema) => z.union([schema]),\n};\n\n/** The replacement a non-drive `remote.url` message names. */\nfunction useDriveUrl(host = \"switchboard\", member?: string): string {\n const memberPart = member ? `, member: \"${member}\"` : \"\";\n return (\n `remote: { url: ${host}.drives.<slug>.url } with ${host} from ../${host}/outputs.js, ` +\n `or remote: { url: { $output: { host: \"${host}\"${memberPart}, path: [\"drives\", \"<slug>\", \"url\"] } } }`\n );\n}\n\n/** The `$output` of a declared `remote.url` that reads `endpoints.graphql`. */\nfunction endpointsGraphqlRef(\n url: unknown,\n): { host: string; member?: string } | undefined {\n if (typeof url !== \"object\" || url === null || !(\"$output\" in url)) {\n return undefined;\n }\n const ref = (url as { $output: unknown }).$output;\n if (typeof ref !== \"object\" || ref === null) return undefined;\n const { host, member, path } = ref as Record<string, unknown>;\n if (typeof host !== \"string\" || !Array.isArray(path)) return undefined;\n if (path.join(\".\") !== \"endpoints.graphql\") return undefined;\n return { host, ...(typeof member === \"string\" ? { member } : {}) };\n}\n\n/** The slug a drive link names: a `drives.<slug>.url` token's slug or a\n * literal address's served slug; undefined when only runtime knows it. */\nfunction linkedSlug(url: unknown): string | undefined {\n if (typeof url === \"string\") return switchboardOfDrive(url)?.slug;\n const ref =\n typeof url === \"object\" && url !== null && \"$output\" in url\n ? (url as { $output: { path?: unknown } }).$output\n : undefined;\n const path = Array.isArray(ref?.path) ? (ref.path as unknown[]) : [];\n return path.length === 3 &&\n path[0] === \"drives\" &&\n typeof path[1] === \"string\" &&\n path[2] === \"url\"\n ? path[1]\n : undefined;\n}\n\ninterface DeclaredReactorHost {\n runner?: { plugins?: unknown };\n config?: unknown;\n reactor?: {\n backends?: Record<string, { kind: string; remote?: { url: unknown } }>;\n placement?: { drives?: Record<string, string> };\n drives?: unknown;\n };\n}\n\n/** The drives a declared host names (home drives, `reactor.drives`, plugin\n * `config.drive` links), or undefined when one is known only at runtime. */\nfunction knownDriveSlugs(host: DeclaredReactorHost): string[] | undefined {\n const reactor = host.reactor ?? {};\n const slugs: string[] = [];\n for (const backend of Object.values(reactor.backends ?? {})) {\n if (backend.kind !== \"remote\") continue;\n const slug = linkedSlug(backend.remote?.url);\n if (slug === undefined) return undefined;\n slugs.push(slug);\n }\n if (reactor.drives !== undefined) {\n if (!Array.isArray(reactor.drives)) return undefined;\n for (const drive of reactor.drives as { slug?: unknown }[]) {\n if (typeof drive.slug === \"string\") slugs.push(drive.slug);\n }\n }\n const plugins = Array.isArray(host.runner?.plugins)\n ? (host.runner.plugins as unknown[])\n : [];\n for (const entry of plugins) {\n const config =\n typeof entry === \"object\" && entry !== null && \"config\" in entry\n ? (entry as { config: unknown }).config\n : undefined;\n if (typeof config !== \"object\" || config === null) continue;\n if (!(\"drive\" in config) || config.drive === undefined) continue;\n const slug = linkedSlug(config.drive);\n if (slug === undefined) return undefined;\n slugs.push(slug);\n }\n for (const drive of connectDefaultDrives(host.config)) {\n if (typeof drive !== \"object\" || drive === null || !(\"url\" in drive)) {\n continue;\n }\n const slug = linkedSlug(drive.url);\n if (slug === undefined) return undefined;\n slugs.push(slug);\n }\n return slugs;\n}\n\n/** A Connect host's `config.drives.defaultDrives`, unchecked. */\nfunction connectDefaultDrives(config: unknown): unknown[] {\n const drives =\n typeof config === \"object\" && config !== null && \"drives\" in config\n ? (config as { drives: unknown }).drives\n : undefined;\n const list =\n typeof drives === \"object\" && drives !== null && \"defaultDrives\" in drives\n ? (drives as { defaultDrives: unknown }).defaultDrives\n : undefined;\n return Array.isArray(list) ? list : [];\n}\n\n/** Declared form, at host level so plugin drives are seen: a placement key\n * must name a drive the host names, when every drive is knowable. A host\n * with no remote backend is not checked: its plugins may contribute drives\n * (a switchboard's workflows drive) that no field names. */\nfunction refineDeclaredPlacementKeys(\n host: DeclaredReactorHost,\n ctx: z.RefinementCtx,\n): void {\n const placed = Object.keys(host.reactor?.placement?.drives ?? {});\n if (placed.length === 0) return;\n const remote = Object.values(host.reactor?.backends ?? {}).some(\n (b) => b.kind === \"remote\",\n );\n if (!remote) return;\n const known = knownDriveSlugs(host);\n if (!known) return;\n // A literal address may carry the hashed slug of a `projectHash` drive.\n const names = (slug: string, served: string) =>\n served === slug ||\n (served.startsWith(`${slug}-`) &&\n /^[0-9a-f]{8}$/.test(served.slice(slug.length + 1)));\n for (const slug of placed) {\n if (known.some((served) => names(slug, served))) continue;\n ctx.addIssue({\n code: \"custom\",\n path: [\"reactor\", \"placement\", \"drives\", slug],\n message: `placement.drives.${slug} names no drive this host links to or declares (${[...new Set(known)].join(\", \") || \"none\"}).`,\n });\n }\n}\n\ninterface ResolvedReactorBlock {\n backends?: Record<string, { kind: string; remote?: { url: unknown } }>;\n placement?: { drives?: Record<string, string> };\n drives?: unknown;\n}\n\n/** Resolved-form checks across backends, drives and placement: one base is\n * one remote backend, and a drive placed on a remote is on its switchboard. */\nfunction refineResolvedReactor(\n reactor: ResolvedReactorBlock,\n ctx: z.RefinementCtx,\n): void {\n const backends = reactor.backends ?? {};\n const baseOf = new Map<string, string>();\n const byBase = new Map<string, string>();\n // Every switchboard a slug is linked on: one slug on two is ambiguous.\n const linked = new Map<string, Set<string>>();\n const link = (slug: string, base: string) =>\n linked.set(slug, (linked.get(slug) ?? new Set()).add(base));\n for (const [name, backend] of Object.entries(backends)) {\n const url = backend.remote?.url;\n if (backend.kind !== \"remote\" || typeof url !== \"string\") continue;\n const home = switchboardOfDrive(url);\n if (!home) continue;\n baseOf.set(name, home.base);\n link(home.slug, home.base);\n const first = byBase.get(home.base);\n if (first === undefined) {\n byBase.set(home.base, name);\n continue;\n }\n ctx.addIssue({\n code: \"custom\",\n path: [\"backends\", name, \"remote\", \"url\"],\n message: `backends \"${first}\" and \"${name}\" both open drives on the same switchboard (${home.base}). Keep \"${first}\", and list the second drive under reactor.drives with its remote.url instead.`,\n });\n }\n\n const kept = new Set<string>();\n const declared = Array.isArray(reactor.drives)\n ? (reactor.drives as { slug: string; remote?: { url: string } }[])\n : [];\n declared.forEach((drive, index) => {\n if (!drive.remote) {\n kept.add(drive.slug);\n return;\n }\n const at = switchboardOfDrive(drive.remote.url);\n // An empty url already fails the field's own check.\n if (at || drive.remote.url === \"\") {\n if (at) link(drive.slug, at.base);\n return;\n }\n ctx.addIssue({\n code: \"custom\",\n path: [\"drives\", index, \"remote\", \"url\"],\n message: `remote.url must be a switchboard drive address (<switchboard>/d/<slug>), not ${drive.remote.url}: sync needs the drive. Use url: switchboard.drives.<slug>.url, or url: { $output: { host: \"switchboard\", path: [\"drives\", \"<slug>\", \"url\"] } }.`,\n });\n });\n\n const nameOf = (base: string) => byBase.get(base) ?? base;\n for (const [slug, name] of Object.entries(reactor.placement?.drives ?? {})) {\n const at = [\"placement\", \"drives\", slug];\n const on = [...(linked.get(slug) ?? [])];\n // Two drives answer to the key, whichever backend it names.\n if (on.length > 0 && kept.has(slug)) {\n ctx.addIssue({\n code: \"custom\",\n path: at,\n message: `Drive \"${slug}\" is both this reactor's own drive and on ${on.map(nameOf).join(\" and \")}. Rename one, or link only one.`,\n });\n continue;\n }\n if (on.length > 1) {\n ctx.addIssue({\n code: \"custom\",\n path: at,\n message: `Drive \"${slug}\" is on both ${on.map(nameOf).join(\" and \")}. Rename one, or link only one.`,\n });\n continue;\n }\n const base = baseOf.get(name);\n if (base === undefined) continue;\n if (on.length === 0) {\n // A key that names no drive here (a hashed home drive) is not checked.\n if (!kept.has(slug)) continue;\n ctx.addIssue({\n code: \"custom\",\n path: at,\n message: `placement.drives.${slug} opens drive \"${slug}\" on \"${name}\", but this reactor keeps that drive itself. Only a drive on a switchboard can open there without a copy.`,\n });\n continue;\n }\n if (on[0] === base) continue;\n ctx.addIssue({\n code: \"custom\",\n path: at,\n message: `placement.drives.${slug} opens drive \"${slug}\" on \"${name}\" (${base}), but the drive is on ${on[0]}. Place it on the backend for that switchboard.`,\n });\n }\n}\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: FieldWrappers) {\n const resolved = tokenField === FORBID_TOKENS;\n const reactorBackendSchema = z\n .strictObject({\n kind: reactorBackendKindSchema,\n storage: z\n .strictObject({\n kind: z.enum([\"idb\", \"memory\", \"path\", \"postgres\"]),\n /** `\"${userData}/…\"` sugar or `{ $env: \"NAME\" }`. */\n dataDir: tokenField.env(z.string()).optional(),\n url: z.string().optional(),\n })\n .optional(),\n readModel: z.strictObject({ url: z.string().optional() }).optional(),\n packages: z\n .strictObject({\n cdnUrl: z.string().optional(),\n specs: z.array(z.string()).optional(),\n /** on-demand model resolution (was DYNAMIC_MODEL_LOADING). */\n dynamic: z.boolean().optional(),\n })\n .optional(),\n // A switchboard drive address, `<base>/d/<slug>`: typically a\n // producer's `drives.<slug>.url` output token. The backend is the\n // switchboard at `<base>`. `${origin}/d/<slug>` when the member's own\n // server proxies the switchboard (the browser then calls its page\n // origin; see `runner.proxy` on the connect runner).\n remote: z\n .strictObject({ url: tokenField.any(originOrUrlSchema) })\n .optional(),\n })\n // Two PGlite instances on one data dir corrupt it: the reactor store\n // (storage.dataDir) and the read-model store (readModel.url) must differ.\n // Postgres is exempt: one database legitimately serves both stores.\n .superRefine((backend, ctx) => {\n // 2.1 \"a remote backend needs url\": `remote` is optional for the\n // in-process/worker kinds, but a remote backend attaches by URL only.\n if (backend.kind === \"remote\" && !backend.remote) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"remote\", \"url\"],\n message: `a \"remote\" backend needs remote.url, a switchboard drive address: ${useDriveUrl()}.`,\n });\n }\n const url: unknown = backend.remote?.url;\n const graphqlRef = resolved ? undefined : endpointsGraphqlRef(url);\n if (graphqlRef) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"remote\", \"url\"],\n message: `remote.url reads ${graphqlRef.host}'s endpoints.graphql; it must be a switchboard drive address (<switchboard>/d/<slug>): sync needs the drive. Use ${useDriveUrl(graphqlRef.host, graphqlRef.member)}.`,\n });\n }\n if (resolved && typeof url === \"string\" && !switchboardOfDrive(url)) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"remote\", \"url\"],\n message: `remote.url must be a switchboard drive address (<switchboard>/d/<slug>), not ${url}: sync needs the drive. Use ${useDriveUrl()}.`,\n });\n }\n const store = backend.storage;\n const storeDir = store?.kind === \"path\" ? store.dataDir : undefined;\n const readModel = backend.readModel?.url;\n // In the declared form dataDir may still be a `$env` token: compare\n // only resolved strings (resolved validation re-runs this check).\n if (\n typeof storeDir === \"string\" &&\n readModel &&\n samePath(storeDir, readModel)\n ) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"readModel\", \"url\"],\n message:\n `readModel.url must not be the reactor's storage dir (${readModel}): ` +\n \"two PGlite instances on one data dir corrupt it. Omit readModel.url \" +\n \"to get the classic <root>/.ph/read-storage next to the reactor store.\",\n });\n }\n });\n\n const reactorSchema = z\n .strictObject({\n backends: z.record(z.string(), reactorBackendSchema).optional(),\n placement: z\n .strictObject({\n primary: z.string().optional(),\n /** Declared drive slug → backend name. A local backend keeps a\n * synced copy; the drive's own remote backend opens it there with\n * no copy. An unlisted drive keeps a synced copy. */\n drives: z.record(z.string().min(1), z.string().min(1)).optional(),\n })\n .optional(),\n protocol: reactorProtocolSchema.optional(),\n /** DEPRECATED (dies in R2): workflows become a listed plugin. */\n workflows: z.boolean().optional(),\n // R1 core keys: identity/signing and storage namespace.\n renown: z\n .strictObject({\n url: z.string().optional(),\n networkId: z.string().optional(),\n chainId: z.number().int().optional(),\n })\n .optional(),\n namespace: z.string().min(1).optional(),\n // Core-declared, seeded by the host runtime. Token-able as a whole\n // (3.3): a `$map` over a producer's `drives` output (or an `$output` of\n // an array of declarations) renders the list at resolve time.\n drives: tokenField\n .any(z.array(buildDriveDeclarationSchema(tokenField.any)))\n .optional(),\n })\n .superRefine((reactor, ctx) => {\n const backends = reactor.backends ?? {};\n for (const [slug, name] of Object.entries(\n reactor.placement?.drives ?? {},\n )) {\n if (Object.hasOwn(backends, name)) continue;\n ctx.addIssue({\n code: \"custom\",\n path: [\"placement\", \"drives\", slug],\n message: `placement.drives.${slug} names backend \"${name}\", which is not in backends (${Object.keys(backends).join(\", \") || \"none\"}).`,\n });\n }\n if (resolved) refineResolvedReactor(reactor, ctx);\n });\n\n /** Common runner options; runner modules extend it with their own. */\n const runnerBaseSchema = z.looseObject({\n module: z.string().min(1),\n defaultVerb: z.string().min(1).optional(),\n port: z.number().int().positive().optional(),\n /** Bind address; each runner documents its default. */\n host: z.string().min(1).optional(),\n /** THE COMPOSITION: plugin entries; presence is activation. */\n plugins: z.array(pluginEntrySchema).optional(),\n });\n\n /** A compound member wrapper. Sections are FULL STATEMENTS except `runner`,\n * which key-merges over the member's own. Plugins live in `runner.plugins`\n * (as on a standalone host); there is no wrapper-level `plugins`. */\n const childWrapperSchema = z.strictObject({\n host: z.string().min(1),\n // 0 passes here; the member runner's own schema decides whether it may.\n runner: runnerBaseSchema\n .partial()\n .extend({ port: z.number().int().min(0).max(65535).optional() })\n .optional(),\n config: z.looseObject({}).optional(),\n reactor: reactorSchema.optional(),\n });\n\n const childrenSchema = z.record(z.string(), childWrapperSchema);\n\n const reactorHostSchema = z.strictObject({\n name: hostNameSchema,\n runner: runnerBaseSchema,\n config: z.looseObject({}).optional(),\n profile: profileSchema.optional(),\n reactor: reactorSchema.optional(),\n });\n\n const compoundHostSchema = z.strictObject({\n name: hostNameSchema,\n runner: runnerBaseSchema,\n children: childrenSchema,\n config: z.looseObject({}).optional(),\n profile: profileSchema.optional(),\n });\n\n return {\n reactorBackendSchema,\n reactorSchema,\n runnerBaseSchema,\n childWrapperSchema,\n childrenSchema,\n reactorHostSchema,\n compoundHostSchema,\n /** This set's field wrapper, for a runner's OWN token-able fields inside\n * `defineHostSchemas`: declared, `T | Token` in and `T` out; resolved,\n * `T` only. Both modes share one static type. */\n tokenable: tokenField.any,\n /** As `tokenable`, but the only token accepted is `$env`. */\n envTokenable: tokenField.env,\n };\n}\n\nexport type HostSchemas = ReturnType<typeof buildHostSchemas>;\n\n/** The host schema set in declared (\"allow\": token-able fields take tokens)\n * or resolved (\"forbid\") form. */\nexport function makeHostSchemas(options: { tokens: TokenMode }): HostSchemas {\n return buildHostSchemas(\n options.tokens === \"allow\" ? ALLOW_TOKENS : FORBID_TOKENS,\n );\n}\n\nexport type PlacementKeyIssue = {\n path: (string | number)[];\n message: string;\n};\n\n/** withPlacementKeys' check, for a merged declared host parsed some other way. */\nexport function placementKeyIssues(host: unknown): PlacementKeyIssue[] {\n if (typeof host !== \"object\" || host === null || !(\"reactor\" in host)) {\n return [];\n }\n const issues: PlacementKeyIssue[] = [];\n const ctx = {\n addIssue: (issue: { path?: PropertyKey[]; message?: string }) => {\n issues.push({\n path: (issue.path ?? []).filter(\n (part): part is string | number => typeof part !== \"symbol\",\n ),\n message: issue.message ?? \"\",\n });\n },\n } as unknown as z.RefinementCtx;\n refineDeclaredPlacementKeys(host as DeclaredReactorHost, ctx);\n return issues;\n}\n\n/** Adds the host-level placement key check to a runner's declared schema. */\nfunction withPlacementKeys<T>(schema: T): T {\n if (!(schema instanceof z.ZodType)) return schema;\n return schema.superRefine((host, ctx) => {\n if (typeof host === \"object\" && host !== null && \"reactor\" in host) {\n refineDeclaredPlacementKeys(host as DeclaredReactorHost, ctx);\n }\n }) as T;\n}\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 */\nexport function defineHostSchemas<T>(build: (schemas: HostSchemas) => T): {\n declaredHostSchema: T;\n hostSchema: T;\n} {\n return {\n declaredHostSchema: withPlacementKeys(build(declaredSchemas)),\n hostSchema: build(resolvedSchemas),\n };\n}\n\nconst declaredSchemas = makeHostSchemas({ tokens: \"allow\" });\nconst resolvedSchemas = makeHostSchemas({ tokens: \"forbid\" });\n\n/* The exported base blocks are the RESOLVED form (what verbs receive). The\n * declared forms are `declaredHostSchemas` / `defineHostSchemas`. */\nexport const declaredHostSchemas: HostSchemas = declaredSchemas;\nexport const reactorBackendSchema = resolvedSchemas.reactorBackendSchema;\nexport const reactorSchema = resolvedSchemas.reactorSchema;\nexport const runnerBaseSchema = resolvedSchemas.runnerBaseSchema;\nexport const childWrapperSchema = resolvedSchemas.childWrapperSchema;\nexport const childrenSchema = resolvedSchemas.childrenSchema;\nexport const reactorHostSchema = resolvedSchemas.reactorHostSchema;\nexport const compoundHostSchema = resolvedSchemas.compoundHostSchema;\n\n/** The generic compound runner's host: the base with its wiring config. */\nconst genericCompound = defineHostSchemas((s) =>\n s.compoundHostSchema\n .extend({ config: compoundWiringSchema.optional() })\n .superRefine(refineStartOrder),\n);\nexport const genericCompoundHostSchema = genericCompound.hostSchema;\nexport const declaredGenericCompoundHostSchema =\n genericCompound.declaredHostSchema;\n\n/* -------------------------------------------------------------------- types */\n\nexport type Profile = z.infer<typeof profileSchema>;\nexport type ReactorProtocol = z.infer<typeof reactorProtocolSchema>;\nexport type ReactorBackend = z.infer<typeof reactorBackendSchema>;\nexport type ReactorBackendKind = ReactorBackend[\"kind\"];\nexport type ReactorStorageConfig = NonNullable<ReactorBackend[\"storage\"]>;\nexport type ReactorPackageConfig = NonNullable<ReactorBackend[\"packages\"]>;\nexport type ReactorRemoteConfig = NonNullable<ReactorBackend[\"remote\"]>;\nexport type ReactorConfig = z.infer<typeof reactorSchema>;\nexport type RunnerBase = z.infer<typeof runnerBaseSchema>;\nexport type ChildWrapper = z.infer<typeof childWrapperSchema>;\nexport type CompoundWiring = z.infer<typeof compoundWiringSchema>;\n\n/** What a host.js author writes (z.input), per runner kind. The `never`\n * sides make reactor XOR children a type error. */\nexport type ReactorHostInput = z.input<\n typeof declaredSchemas.reactorHostSchema\n> & {\n children?: never;\n};\nexport type CompoundHostInput = z.input<\n typeof declaredSchemas.compoundHostSchema\n> & {\n reactor?: never;\n};\nexport type HostDefinition = ReactorHostInput | CompoundHostInput;\n\n/** What a verb receives (z.output) from the base schemas. */\nexport type ReactorHost = z.output<typeof reactorHostSchema>;\nexport type CompoundHost = z.output<typeof compoundHostSchema>;\n\n/* --------------------------------------------------------------- JSON Schema */\n\nconst SCHEMA_BASE = \"https://powerhouse.inc/schemas\";\n\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). */\nexport function emitHostJsonSchema(\n name: string,\n schema: z.ZodType,\n): Record<string, unknown> {\n return {\n $id: `${SCHEMA_BASE}/${name}.schema.json`,\n ...z.toJSONSchema(schema, { io: \"input\" }),\n };\n}\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. */\nexport function emittedHostSchemas(): Record<string, unknown> {\n return {\n // Editor schemas describe what authors write: the declared form.\n \"host-reactor.schema.json\": emitHostJsonSchema(\n \"host-reactor\",\n declaredSchemas.reactorHostSchema,\n ),\n \"host-compound.schema.json\": emitHostJsonSchema(\n \"host-compound\",\n declaredSchemas.compoundHostSchema,\n ),\n };\n}\n","/**\n * Pure built-in `$env` substitution: the `\"${userData}\"` / `\"${projectRoot}\"`\n * string sugar, deep-applied to a JSON-shaped value. No node imports, so it\n * ships in `./schema`; the node default for userData is placeholders.ts.\n */\n\nexport interface BuiltinEnv {\n userData?: string;\n projectRoot?: string;\n}\n\n/** The always-resolvable `$env` names (also the `\"${name}\"` sugar). */\nexport const BUILTIN_ENV_NAMES: readonly (keyof BuiltinEnv)[] = [\n \"userData\",\n \"projectRoot\",\n];\n\nexport function isBuiltinEnvName(name: string): name is keyof BuiltinEnv {\n return (BUILTIN_ENV_NAMES as readonly string[]).includes(name);\n}\n\nconst BUILTIN = new RegExp(`\\\\$\\\\{(${BUILTIN_ENV_NAMES.join(\"|\")})\\\\}`, \"g\");\n\nfunction substitute(text: string, env: BuiltinEnv): string {\n return text.replace(\n BUILTIN,\n (match, name: keyof BuiltinEnv) => env[name] ?? match,\n );\n}\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. */\nexport function substituteBuiltinEnv<T>(value: T, env: BuiltinEnv): T {\n return substituteValue(value, env) as T;\n}\n\nfunction substituteValue(value: unknown, env: BuiltinEnv): unknown {\n if (typeof value === \"string\") return substitute(value, env);\n if (Array.isArray(value)) return value.map((v) => substituteValue(v, env));\n if (value !== null && typeof value === \"object\") {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value)) {\n out[k] = substituteValue(v, env);\n }\n return out;\n }\n return value;\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,4BACd,UACA;CACA,OAAO,EAAE,aAAa;EACpB,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EACtB,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;;;;;;EAM/B,aAAa,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,EAAE,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;EAC9D,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;EACjC,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;EAC1B,iBAAiB,EAAE,OAAO,CAAC,CAAC,SAAS;EACrC,aAAa,EAAE,KAAK;GAAC;GAAU;GAAW;EAAQ,CAAC,CAAC,CAAC,SAAS;EAC9D,kBAAkB,EAAE,QAAQ,CAAC,CAAC,SAAS;EACvC,QAAQ,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;CACxE,CAAC;AACH;AAEA,MAAa,yBAAyB,4BAA4B,SAAS;AAI3E,MAAa,eAAe,EAAE,MAAM,sBAAsB;;;;;AAM1D,SAAgB,mBACd,WACA,aACA,MACQ;CACR,OAAO,GAAG,KAAK,GAAG,UAAU,WAAW,CAAC,CAAC,UAAU,GAAG,CAAC;AACzD;;;;;;;;;;;;;;;;ACrBA,MAAa,oBAAoB;AACjC,MAAa,uBAAuB;AACpC,MAAa,oBACX;AACF,MAAa,iBAAiB,EAC3B,OA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,OAAO,UAAU,UAAU,OAAO,WAAW,OAAO,GAAG;CAC3D,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,KAAK,MAAM,gBAAgB,GAAG,GAAG,CAAC;CACzE,IAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;EAC/C,MAAM,MAA+B,CAAC;EACtC,KAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,KAAK,GACvC,IAAI,KAAK,gBAAgB,GAAG,GAAG;EAEjC,OAAO;CACT;CACA,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-schemas-DtKFmLd0.d.mts","names":[],"sources":["../src/host-schemas.ts"],"mappings":";;;;;;;;;;;;;;;;cA2Ba,mBAAiB;cACjB;cACA;cAEA,gBAAc,EAAA;cAkBd,eAAa,EAAA;;;;;GAKxB,EAAA,KAAA;cAEW,uBAAqB,EAAA;;;;;;;;;;;;;;;GAWhC,EAAA,KAAA;cAEW,kBAAgB,EAAA;;;;KACjB,aAAa,EAAE,aAAa;cAE3B,0BAAwB,EAAA;;;;;;;;cAiBxB,sBAAoB,EAAA;;;;GAY/B,EAAA,KAAA;;;;iBAKc,iBACd;EAAQ,UAAU;EAAyB,SAAS;GACpD,KAAK,EAAE;;;UAyBC;EACR,MAAM,UAAU,EAAE,SAAS,QAAQ,MAAM,gBAAgB;EACzD,MAAM,UAAU,EAAE,SAAS,QAAQ,MAAM,gBAAgB,GAAG;;;;;;
|
|
1
|
+
{"version":3,"file":"host-schemas-DtKFmLd0.d.mts","names":[],"sources":["../src/host-schemas.ts"],"mappings":";;;;;;;;;;;;;;;;cA2Ba,mBAAiB;cACjB;cACA;cAEA,gBAAc,EAAA;cAkBd,eAAa,EAAA;;;;;GAKxB,EAAA,KAAA;cAEW,uBAAqB,EAAA;;;;;;;;;;;;;;;GAWhC,EAAA,KAAA;cAEW,kBAAgB,EAAA;;;;KACjB,aAAa,EAAE,aAAa;cAE3B,0BAAwB,EAAA;;;;;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okenableSchema, A as knownVerbIssues, At as re
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { SwitchboardDrive, driveAddressMessage, switchboardOfDrive } from "@powerhousedao/shared/host-tokens";
|
|
4
4
|
import { ORIGIN_PLACEHOLDER, SWITCHBOARD_PROXY_PATHS, isHtmlNavigation, isOriginPlaceholderUrl, isSwitchboardProxyPath, resolveOriginPlaceholders, toOriginPlaceholder, withOriginPlaceholders } from "@powerhousedao/shared/connect/origin-placeholder";
|
|
5
|
-
import { PHConnectDefaultDrive, PHConnectRuntimeConfig } from "@powerhousedao/shared/clis";
|
|
5
|
+
import { PHConnectCollection, PHConnectDefaultDrive, PHConnectRuntimeConfig, PHConnectRuntimeDefaultDrive } from "@powerhousedao/shared/clis";
|
|
6
6
|
//#region src/host-loader.d.ts
|
|
7
7
|
export declare class HostLoadError extends Error {
|
|
8
8
|
constructor(message: string, hint?: string);
|
|
@@ -845,6 +845,10 @@ interface ConnectReactorProjection {
|
|
|
845
845
|
instance?: {
|
|
846
846
|
reactorWorker?: boolean;
|
|
847
847
|
reactorClient?: ReactorClientMode;
|
|
848
|
+
remoteBackends?: {
|
|
849
|
+
name: string;
|
|
850
|
+
url: string;
|
|
851
|
+
}[];
|
|
848
852
|
};
|
|
849
853
|
app?: {
|
|
850
854
|
workflowsEnabled?: boolean;
|
|
@@ -853,7 +857,7 @@ interface ConnectReactorProjection {
|
|
|
853
857
|
}
|
|
854
858
|
/** Project the reactor block onto the Connect runtime config: protocol →
|
|
855
859
|
* connect.reactor (same shape), backend topology → instance.reactorWorker
|
|
856
|
-
* (legacy)
|
|
860
|
+
* (legacy), instance.reactorClient and instance.remoteBackends,
|
|
857
861
|
* workflows → app.workflowsEnabled. */
|
|
858
862
|
export declare function projectReactorToConnect(reactor: ReactorConfig | undefined): ConnectReactorProjection;
|
|
859
863
|
/** Each pre-set env var that CONTRADICTS the host's protocol block, as a
|
|
@@ -924,6 +928,11 @@ export declare function backendsToDescriptors(reactor: ReactorConfig | undefined
|
|
|
924
928
|
export declare function isStructuralMultiReactor(reactor: ReactorConfig | undefined): boolean;
|
|
925
929
|
/** The remote backends' drive addresses, placement order. */
|
|
926
930
|
export declare function remoteBackendUrls(reactor: ReactorConfig | undefined): string[];
|
|
931
|
+
/** The remote backends by host key, placement order. */
|
|
932
|
+
export declare function remoteBackends(reactor: ReactorConfig | undefined): {
|
|
933
|
+
name: string;
|
|
934
|
+
url: string;
|
|
935
|
+
}[];
|
|
927
936
|
//#endregion
|
|
928
937
|
//#region src/connect-projection.d.ts
|
|
929
938
|
/**
|
|
@@ -958,6 +967,12 @@ interface DriveProjectionInput {
|
|
|
958
967
|
* launch context and must never detach drives the user added by hand.
|
|
959
968
|
*/
|
|
960
969
|
export declare function projectDrivesIntoConnect(input: DriveProjectionInput): Pick<PHConnectRuntimeConfig, "drives">;
|
|
970
|
+
interface PlacedConnectDrives {
|
|
971
|
+
defaultDrives: PHConnectRuntimeDefaultDrive[];
|
|
972
|
+
collections?: Record<string, PHConnectCollection>;
|
|
973
|
+
}
|
|
974
|
+
/** Annotates remote default drives with their backend (`sync: false` when placed on it); other remote placements become collections. */
|
|
975
|
+
export declare function placeConnectDrives(reactor: ReactorConfig | undefined, defaultDrives: readonly PHConnectDefaultDrive[]): PlacedConnectDrives;
|
|
961
976
|
//#endregion
|
|
962
977
|
//#region src/resolve/plan.d.ts
|
|
963
978
|
/**
|
|
@@ -1230,6 +1245,6 @@ interface MemberInput extends Omit<ExpectHostInput, "members" | "plan"> {
|
|
|
1230
1245
|
*/
|
|
1231
1246
|
export declare function expectHost(input: ExpectHostInput): HostExpectation;
|
|
1232
1247
|
//#endregion
|
|
1233
|
-
export { type ArrayMapToken, type BootCheckContext, type BootIssue, type BuiltinEnv, CONNECT_RUNNER, type CheckDeferred, type CheckHostOptions, type CheckHostResult, type CheckStage, type ChildWrapper, type CompoundHost, type CompoundHostInput, type CompoundPlan, type CompoundWiring, type ConcatToken, type ConnectPluginSlices, type ConnectReactorProjection, type ConsumedOutput, type ContributedDrive, type ContributedDriveInput, type ContributionSource, type Contributions, type DeadConfigWarning, type DeclaredHostOptions, type DeclaredIssue, type DeferredResolution, type DeferredToken, type DriveDeclaration, type DrivePlanEntry, type DriveProjectionInput, type DriveSeederClient, type EnvToken, type ExpectHostInput, type ExpectedBackend, type ExpectedDrive, HOST_NAME_MAX_LENGTH, HOST_NAME_MESSAGE, HOST_NAME_PATTERN, type HostDefinition, type HostExit, type HostExpectation, type HostExport, type HostImports, type HostIssue, type HostOutputsDescription, type HostPlugin, type HostPluginModule, type HostSchemaIssue, type HostSchemaIssues, type HostSchemaLike, type HostSchemas, type HostsFolderStatus, type ItemToken, type KeyToken, type LoadedHost, type MapToken, type MemberDraft, type MemberExpectation, type MemberInput, type MergedContribution, type NormalizedPluginEntry, ONE_SHOT_VERBS, ORIGIN_PLACEHOLDER, type Observe, type OutputLookup, type OutputPath, type OutputRef, type OutputSource, type OutputToken, type OutputsSchemaLookup, type OwnedConfigSlice, type PHHost, type PHHostOutputs, type PlacementKeyIssue, type PlanEdge, type PlanMember, type PluginContributionsPlan, type PluginEntry, type PluginEntryData, type ProducerInfo, type ProducerMap, type Profile, type ProjectedDescriptor, type ProjectedStorage, type Provide, type ReactorBackend, type ReactorBackendKind, type ReactorClientMode, type ReactorConfig, type ReactorHost, type ReactorHostInput, type ReactorPackageConfig, type ReactorProtocol, type ReactorRemoteConfig, type ReactorStorageConfig, type RecordMapToken, type RefFn, type RemovedForm, type ResolveOptions, type ResolveSources, type ResolvedDrive, type ResolvedPlugin, type RunCompoundOptions, type RunCompoundResult, type RunProbe, type RunRecord, type RunRecordMember, type RunnerBase, type RunnerContext, RunnerError, type RunnerHandle, type RunnerHandleData, type RunnerIssue, type RunnerKind, type RunnerModule, type RunnerVerb, SWITCHBOARD_PROXY_PATHS, type SchemaIssue, type SeedResult, type SelfMembers, type SpawnHostOptions, type SpawnHostPhase, type SpawnedHost, type StartedHandle, type SwitchboardDrive, type SwitchboardReactorLayer, TOKEN_ESCAPE_KEY, TOKEN_KEYS, type Template, type Token, type TokenFor, type TokenKey, type TokenMode, type TokenPosition, type TokenSite, type TokenableSchema, type Transform, type ValidateHostOptions, applyChildWrapper, checkOutputPaths, checkTokenSites, childWrapperSchema, childrenSchema, compoundHostSchema, compoundWiringSchema, concatTokenSchema, declaredGenericCompoundHostSchema, declaredHostSchemas, defineHostSchemas, driveAddressMessage, emitHostJsonSchema, emittedHostSchemas, envSitesOf, envTokenSchema, envTokenable, findToken, forbidRef, genericCompoundHostSchema, getVerb, hostNameSchema, hostSchemaIssues, isHtmlNavigation, isOriginPlaceholderUrl, isSchemaLike, isSwitchboardProxyPath, isToken, itemTokenSchema, keyTokenSchema, kindShapeIssues, knownVerbIssues, listVerbs, makeHostSchemas, mapTokenSchema, originOrUrlSchema, outputRefsOf, outputSitesOf, outputTokenSchema, placementKeyIssues, profileSchema, reactorBackendKindSchema, reactorBackendSchema, reactorHostSchema, reactorProtocolSchema, reactorSchema, ref, refKey, refineStartOrder, resolveOriginPlaceholders, resolveRunnerModule, runCompound, runnerBaseSchema, runnerHandleSchema, runnerKindSchema, schemaAtPath, switchboardOfDrive, toOriginPlaceholder, toStartedHandle, tokenKeyOf, tokenSchema, tokenable, validateDeclaredHost, validateHost, withOriginPlaceholders };
|
|
1248
|
+
export { type ArrayMapToken, type BootCheckContext, type BootIssue, type BuiltinEnv, CONNECT_RUNNER, type CheckDeferred, type CheckHostOptions, type CheckHostResult, type CheckStage, type ChildWrapper, type CompoundHost, type CompoundHostInput, type CompoundPlan, type CompoundWiring, type ConcatToken, type ConnectPluginSlices, type ConnectReactorProjection, type ConsumedOutput, type ContributedDrive, type ContributedDriveInput, type ContributionSource, type Contributions, type DeadConfigWarning, type DeclaredHostOptions, type DeclaredIssue, type DeferredResolution, type DeferredToken, type DriveDeclaration, type DrivePlanEntry, type DriveProjectionInput, type DriveSeederClient, type EnvToken, type ExpectHostInput, type ExpectedBackend, type ExpectedDrive, HOST_NAME_MAX_LENGTH, HOST_NAME_MESSAGE, HOST_NAME_PATTERN, type HostDefinition, type HostExit, type HostExpectation, type HostExport, type HostImports, type HostIssue, type HostOutputsDescription, type HostPlugin, type HostPluginModule, type HostSchemaIssue, type HostSchemaIssues, type HostSchemaLike, type HostSchemas, type HostsFolderStatus, type ItemToken, type KeyToken, type LoadedHost, type MapToken, type MemberDraft, type MemberExpectation, type MemberInput, type MergedContribution, type NormalizedPluginEntry, ONE_SHOT_VERBS, ORIGIN_PLACEHOLDER, type Observe, type OutputLookup, type OutputPath, type OutputRef, type OutputSource, type OutputToken, type OutputsSchemaLookup, type OwnedConfigSlice, type PHHost, type PHHostOutputs, type PlacedConnectDrives, type PlacementKeyIssue, type PlanEdge, type PlanMember, type PluginContributionsPlan, type PluginEntry, type PluginEntryData, type ProducerInfo, type ProducerMap, type Profile, type ProjectedDescriptor, type ProjectedStorage, type Provide, type ReactorBackend, type ReactorBackendKind, type ReactorClientMode, type ReactorConfig, type ReactorHost, type ReactorHostInput, type ReactorPackageConfig, type ReactorProtocol, type ReactorRemoteConfig, type ReactorStorageConfig, type RecordMapToken, type RefFn, type RemovedForm, type ResolveOptions, type ResolveSources, type ResolvedDrive, type ResolvedPlugin, type RunCompoundOptions, type RunCompoundResult, type RunProbe, type RunRecord, type RunRecordMember, type RunnerBase, type RunnerContext, RunnerError, type RunnerHandle, type RunnerHandleData, type RunnerIssue, type RunnerKind, type RunnerModule, type RunnerVerb, SWITCHBOARD_PROXY_PATHS, type SchemaIssue, type SeedResult, type SelfMembers, type SpawnHostOptions, type SpawnHostPhase, type SpawnedHost, type StartedHandle, type SwitchboardDrive, type SwitchboardReactorLayer, TOKEN_ESCAPE_KEY, TOKEN_KEYS, type Template, type Token, type TokenFor, type TokenKey, type TokenMode, type TokenPosition, type TokenSite, type TokenableSchema, type Transform, type ValidateHostOptions, applyChildWrapper, checkOutputPaths, checkTokenSites, childWrapperSchema, childrenSchema, compoundHostSchema, compoundWiringSchema, concatTokenSchema, declaredGenericCompoundHostSchema, declaredHostSchemas, defineHostSchemas, driveAddressMessage, emitHostJsonSchema, emittedHostSchemas, envSitesOf, envTokenSchema, envTokenable, findToken, forbidRef, genericCompoundHostSchema, getVerb, hostNameSchema, hostSchemaIssues, isHtmlNavigation, isOriginPlaceholderUrl, isSchemaLike, isSwitchboardProxyPath, isToken, itemTokenSchema, keyTokenSchema, kindShapeIssues, knownVerbIssues, listVerbs, makeHostSchemas, mapTokenSchema, originOrUrlSchema, outputRefsOf, outputSitesOf, outputTokenSchema, placementKeyIssues, profileSchema, reactorBackendKindSchema, reactorBackendSchema, reactorHostSchema, reactorProtocolSchema, reactorSchema, ref, refKey, refineStartOrder, resolveOriginPlaceholders, resolveRunnerModule, runCompound, runnerBaseSchema, runnerHandleSchema, runnerKindSchema, schemaAtPath, switchboardOfDrive, toOriginPlaceholder, toStartedHandle, tokenKeyOf, tokenSchema, tokenable, validateDeclaredHost, validateHost, withOriginPlaceholders };
|
|
1234
1249
|
export {};
|
|
1235
1250
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/host-loader.ts","../src/run-record-schema.ts","../src/run-record.ts","../src/spawn-host.ts","../src/host-issues.ts","../src/env-substitution.ts","../src/resolve/resolve.ts","../src/check-host.ts","../src/host-export-schema.ts","../src/host-export.ts","../src/placeholders.ts","../src/host-types.ts","../src/plugins.ts","../src/plugins-resolve.ts","../src/drive-schema.ts","../src/drives.ts","../src/reactor-config.ts","../src/backend-projection.ts","../src/connect-projection.ts","../src/resolve/plan.ts","../src/resolve/removed-forms.ts","../src/resolve/sources.ts","../src/resolve/walk.ts","../src/resolve/node.ts","../src/expect-host.ts"],"mappings":";;;;;;qBAiCa,sBAAsB;EACjC,YAAY,iBAAiB;;KAMnB;EACN;;EACA;EAAe;;EACf;EAAiB;EAAa;;;;;wBAKpB,iBAAiB,sBAAsB;;qBAwB1C;;;;wBAsGG,cAA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,gBAAgB,eAAe;;EAE/B,YAAY,OAAO,gBAAgB;;EAEnC,kBAAkB,cAAc;;UAGjB;EACf;EACA;EACA;;;;wBAKoB,WACpB,QAAQ,mBACR,iBAAiB,kBAChB,QAAQ;UAqBM;EACf,OAAO;;EAEP;;;;wBAKc,eACd,qBACA,uBAAuB,oBACvB;EAAwB,aAAa;EAAkB;MACtD;wBAaa,iBAAiB,eAAe;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/host-loader.ts","../src/run-record-schema.ts","../src/run-record.ts","../src/spawn-host.ts","../src/host-issues.ts","../src/env-substitution.ts","../src/resolve/resolve.ts","../src/check-host.ts","../src/host-export-schema.ts","../src/host-export.ts","../src/placeholders.ts","../src/host-types.ts","../src/plugins.ts","../src/plugins-resolve.ts","../src/drive-schema.ts","../src/drives.ts","../src/reactor-config.ts","../src/backend-projection.ts","../src/connect-projection.ts","../src/resolve/plan.ts","../src/resolve/removed-forms.ts","../src/resolve/sources.ts","../src/resolve/walk.ts","../src/resolve/node.ts","../src/expect-host.ts"],"mappings":";;;;;;qBAiCa,sBAAsB;EACjC,YAAY,iBAAiB;;KAMnB;EACN;;EACA;EAAe;;EACf;EAAiB;EAAa;;;;;wBAKpB,iBAAiB,sBAAsB;;qBAwB1C;;;;wBAsGG,cAAc;;UA8Bb;;EAEf;;EAEA;;;;;;;;wBASc,gBAAgB,mBAAmB,eAAe;;;wBAoClD,gBAAgB,mBAAmB;;;wBAMnC,gBAAgB,mBAAmB;;;;;wBAoBnC,oBACd,kBACA;;;wBA0Cc,mBACd,gBACA;UA8Be;EACf;EACA;EACA;EACA,MAAM;;wBA2Bc,SACpB,qBACA,mBACC,QAAQ;;;UAqEM;;EAEf;EACA;;EAEA,eAAe;;;;EAIf;EACA;;;wBAMc,oBAAoB;;;;wBAoBpB,mBAAmB;EACjC;EACA;EACA,eAAe;EACf;;;;;;;;;;;;;;;wBAiDoB,oBACpB,qBACA,mBACC,QAAQ;;;qBCzhBE,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AAM;EACN,KAAK;;EAEL,OAAO;EACP,UAAU;;;EAGV,iBAAiB;;;wBAcH,WAAW;;;;;wBAmBX,kBAAkB,iBAAiB;;wBA+DnC,cAAc;;;wBAuDd,aAAa,GAAG,OAAO,IAAI;;;wBAe3B,cAAc,GAAG,OAAO,IAAI;;;;;;;;;UCpM3B;;EAEf;;EAEA;EACA;EACA,QAAQ;;;KAIE,cAAc,oBAAoB;EAAiB;;;wBAGzC,cACpB,qBACA,eAAe,cACd,QAAQ;;wBAuBK,oBACd,QAAQ,cACR,mBACA,gBACC;;wBAWa,uBACd,WAAW,eACT,KAAK,cAAc;;;;;;;;;wBAsBP,sBACd,qBACA;EAAW;EAAkB,WAAW;EAAa;IACpD;;;wBA0Da,kBACd,qBACA,MAAK,SAAS,sCACb,KAAK;;;;;;;;;;;;;;UCjIS;EACf;EACA,MAAM;EACN,UAAU;;EAEV;;;;;EAKA;;;;;;UAOe;EACf;EACA;;EAEA;;EAEA;EACA;EACA;;;UAIe;;EAEf;EACA;EACA;EACA,MAAM;;UAGS;EACf;EACA,MAAM;;;EAGN;;EAEA,aAAa;;EAEb;EACA,WAAW;;EAEX;EACA,SAAS;;EAET;EACA,UAAU;;EAEV;;EAEA;;EAEA,UAAU,eAAe;;UAGV,0BAA0B,KACzC;;EAIA;;EAEA;;;;UAKe;EACf,aAAa;EACb;;UAGe;EACf,MAAM;;;EAGN,UAAU;;EAEV,WAAW;;EAEX,uBAAuB;;EAEvB,mBAAmB;;EAEnB,OAAO;;UAGQ,oBAAoB,KAAK;EACxC;EACA;;;;;;;;wBAgKc,WAAW,OAAO,kBAAkB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-GhJAA2dK.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
-
import { driveAddressMessage, switchboardOfDrive } from "@powerhousedao/shared/host-tokens";
|
|
8
|
+
import { driveAddressMessage, switchboardOfDrive, switchboardOfDrive as switchboardOfDrive$1 } from "@powerhousedao/shared/host-tokens";
|
|
9
9
|
import { ORIGIN_PLACEHOLDER, SWITCHBOARD_PROXY_PATHS, isHtmlNavigation, isOriginPlaceholderUrl, isSwitchboardProxyPath, resolveOriginPlaceholders, toOriginPlaceholder, withOriginPlaceholders } from "@powerhousedao/shared/connect/origin-placeholder";
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
11
11
|
import { DRIVE_ICON_MAX_BYTES, resolveImageRef } from "@powerhousedao/shared/connect/image-ref";
|
|
@@ -640,7 +640,82 @@ function explainDrivePlan(plan) {
|
|
|
640
640
|
})].join("\n");
|
|
641
641
|
}
|
|
642
642
|
//#endregion
|
|
643
|
+
//#region src/backend-projection.ts
|
|
644
|
+
function projectStorage(name, storage) {
|
|
645
|
+
switch (storage.kind) {
|
|
646
|
+
case "idb": return { kind: "idb" };
|
|
647
|
+
case "memory": return { kind: "memory" };
|
|
648
|
+
case "path":
|
|
649
|
+
if (!storage.dataDir) throw new Error(`Backend "${name}": storage kind "path" requires dataDir.`);
|
|
650
|
+
return {
|
|
651
|
+
kind: "path",
|
|
652
|
+
dataDir: storage.dataDir
|
|
653
|
+
};
|
|
654
|
+
case "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.`);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
/** One backend → one descriptor. The protocol's featureFlags ride every
|
|
658
|
+
* descriptor (they are fleet consensus, not per-backend). A remote backend
|
|
659
|
+
* must carry remote.url — provision() requires it. */
|
|
660
|
+
function backendToDescriptor(name, backend, protocol) {
|
|
661
|
+
const descriptor = {
|
|
662
|
+
kind: backend.kind,
|
|
663
|
+
name
|
|
664
|
+
};
|
|
665
|
+
if (descriptor.kind === "remote") {
|
|
666
|
+
const url = backend.remote?.url;
|
|
667
|
+
if (!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.`);
|
|
668
|
+
descriptor.remote = { url };
|
|
669
|
+
return descriptor;
|
|
670
|
+
}
|
|
671
|
+
if (backend.storage) descriptor.storage = projectStorage(name, backend.storage);
|
|
672
|
+
if (backend.packages) descriptor.packages = backend.packages;
|
|
673
|
+
if (protocol?.featureFlags) descriptor.featureFlags = protocol.featureFlags;
|
|
674
|
+
return descriptor;
|
|
675
|
+
}
|
|
676
|
+
/** All named backends, in placement-primary-first order (the order a
|
|
677
|
+
* createReactorClients step would provision them). */
|
|
678
|
+
function backendsToDescriptors(reactor) {
|
|
679
|
+
const backends = reactor?.backends;
|
|
680
|
+
if (!backends) return [];
|
|
681
|
+
const names = Object.keys(backends);
|
|
682
|
+
const primary = reactor.placement?.primary;
|
|
683
|
+
return (primary && names.includes(primary) ? [primary, ...names.filter((n) => n !== primary)] : names).map((name) => backendToDescriptor(name, backends[name], reactor.protocol));
|
|
684
|
+
}
|
|
685
|
+
const LOCAL_KINDS = /* @__PURE__ */ new Set(["in-process", "worker"]);
|
|
686
|
+
/**
|
|
687
|
+
* Structural multi-reactor (phase 4): true when the block names BOTH a local
|
|
688
|
+
* backend (in-process/worker — the tab's own reactor) and a remote one. This
|
|
689
|
+
* is the shape Connect's routing client serves; a lone remote backend is an
|
|
690
|
+
* attach-only host (assistant/agent shape), not a routed tab.
|
|
691
|
+
*/
|
|
692
|
+
function isStructuralMultiReactor(reactor) {
|
|
693
|
+
const backends = reactor?.backends;
|
|
694
|
+
if (!backends) return false;
|
|
695
|
+
const kinds = Object.values(backends).map((b) => b.kind);
|
|
696
|
+
return kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === "remote");
|
|
697
|
+
}
|
|
698
|
+
/** The remote backends' drive addresses, placement order. */
|
|
699
|
+
function remoteBackendUrls(reactor) {
|
|
700
|
+
return backendsToDescriptors(reactor).filter((d) => d.kind === "remote").map((d) => d.remote?.url).filter((u) => typeof u === "string");
|
|
701
|
+
}
|
|
702
|
+
/** The remote backends by host key, placement order. */
|
|
703
|
+
function remoteBackends(reactor) {
|
|
704
|
+
return backendsToDescriptors(reactor).flatMap((d) => d.kind === "remote" && d.remote ? [{
|
|
705
|
+
name: d.name,
|
|
706
|
+
url: d.remote.url
|
|
707
|
+
}] : []);
|
|
708
|
+
}
|
|
709
|
+
//#endregion
|
|
643
710
|
//#region src/reactor-config.ts
|
|
711
|
+
/**
|
|
712
|
+
* The shared `reactor` host-config block and its projections onto the
|
|
713
|
+
* Switchboard config / Connect runtime config. Phase 2 of uniform-runners: makes
|
|
714
|
+
* the reactor block live through the bridge runners, BEFORE track R replaces
|
|
715
|
+
* the projection with reactor-monitor's provision(). The headline is
|
|
716
|
+
* single-sourced `reactor.protocol` — both projections read the same block, so
|
|
717
|
+
* client and server cannot diverge, and a contradicting pre-set env fails boot.
|
|
718
|
+
*/
|
|
644
719
|
/** The single primary backend for phase-2 projection (multi-backend routing is
|
|
645
720
|
* track R). Prefers placement.primary, else "main"/"local", else the first. */
|
|
646
721
|
function primaryBackend(reactor) {
|
|
@@ -709,7 +784,7 @@ function reactorClientMode(reactor) {
|
|
|
709
784
|
}
|
|
710
785
|
/** Project the reactor block onto the Connect runtime config: protocol →
|
|
711
786
|
* connect.reactor (same shape), backend topology → instance.reactorWorker
|
|
712
|
-
* (legacy)
|
|
787
|
+
* (legacy), instance.reactorClient and instance.remoteBackends,
|
|
713
788
|
* workflows → app.workflowsEnabled. */
|
|
714
789
|
function projectReactorToConnect(reactor) {
|
|
715
790
|
const connect = {};
|
|
@@ -718,7 +793,8 @@ function projectReactorToConnect(reactor) {
|
|
|
718
793
|
const mode = reactorClientMode(reactor);
|
|
719
794
|
if (backend?.kind !== void 0 || mode !== void 0) connect.instance = {
|
|
720
795
|
...backend?.kind !== void 0 ? { reactorWorker: backend.kind === "worker" } : {},
|
|
721
|
-
...mode !== void 0 ? { reactorClient: mode } : {}
|
|
796
|
+
...mode !== void 0 ? { reactorClient: mode } : {},
|
|
797
|
+
...mode === "router" || mode === "remote" ? { remoteBackends: remoteBackends(reactor) } : {}
|
|
722
798
|
};
|
|
723
799
|
if (reactor?.workflows !== void 0) connect.app = { workflowsEnabled: reactor.workflows };
|
|
724
800
|
return { connect };
|
|
@@ -746,66 +822,6 @@ function assertProtocolConsistency(protocol, env, hostFile = "the host file") {
|
|
|
746
822
|
if (conflict) throw new Error(conflict);
|
|
747
823
|
}
|
|
748
824
|
//#endregion
|
|
749
|
-
//#region src/backend-projection.ts
|
|
750
|
-
function projectStorage(name, storage) {
|
|
751
|
-
switch (storage.kind) {
|
|
752
|
-
case "idb": return { kind: "idb" };
|
|
753
|
-
case "memory": return { kind: "memory" };
|
|
754
|
-
case "path":
|
|
755
|
-
if (!storage.dataDir) throw new Error(`Backend "${name}": storage kind "path" requires dataDir.`);
|
|
756
|
-
return {
|
|
757
|
-
kind: "path",
|
|
758
|
-
dataDir: storage.dataDir
|
|
759
|
-
};
|
|
760
|
-
case "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.`);
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
/** One backend → one descriptor. The protocol's featureFlags ride every
|
|
764
|
-
* descriptor (they are fleet consensus, not per-backend). A remote backend
|
|
765
|
-
* must carry remote.url — provision() requires it. */
|
|
766
|
-
function backendToDescriptor(name, backend, protocol) {
|
|
767
|
-
const descriptor = {
|
|
768
|
-
kind: backend.kind,
|
|
769
|
-
name
|
|
770
|
-
};
|
|
771
|
-
if (descriptor.kind === "remote") {
|
|
772
|
-
const url = backend.remote?.url;
|
|
773
|
-
if (!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.`);
|
|
774
|
-
descriptor.remote = { url };
|
|
775
|
-
return descriptor;
|
|
776
|
-
}
|
|
777
|
-
if (backend.storage) descriptor.storage = projectStorage(name, backend.storage);
|
|
778
|
-
if (backend.packages) descriptor.packages = backend.packages;
|
|
779
|
-
if (protocol?.featureFlags) descriptor.featureFlags = protocol.featureFlags;
|
|
780
|
-
return descriptor;
|
|
781
|
-
}
|
|
782
|
-
/** All named backends, in placement-primary-first order (the order a
|
|
783
|
-
* createReactorClients step would provision them). */
|
|
784
|
-
function backendsToDescriptors(reactor) {
|
|
785
|
-
const backends = reactor?.backends;
|
|
786
|
-
if (!backends) return [];
|
|
787
|
-
const names = Object.keys(backends);
|
|
788
|
-
const primary = reactor.placement?.primary;
|
|
789
|
-
return (primary && names.includes(primary) ? [primary, ...names.filter((n) => n !== primary)] : names).map((name) => backendToDescriptor(name, backends[name], reactor.protocol));
|
|
790
|
-
}
|
|
791
|
-
const LOCAL_KINDS = /* @__PURE__ */ new Set(["in-process", "worker"]);
|
|
792
|
-
/**
|
|
793
|
-
* Structural multi-reactor (phase 4): true when the block names BOTH a local
|
|
794
|
-
* backend (in-process/worker — the tab's own reactor) and a remote one. This
|
|
795
|
-
* is the shape Connect's routing client serves; a lone remote backend is an
|
|
796
|
-
* attach-only host (assistant/agent shape), not a routed tab.
|
|
797
|
-
*/
|
|
798
|
-
function isStructuralMultiReactor(reactor) {
|
|
799
|
-
const backends = reactor?.backends;
|
|
800
|
-
if (!backends) return false;
|
|
801
|
-
const kinds = Object.values(backends).map((b) => b.kind);
|
|
802
|
-
return kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === "remote");
|
|
803
|
-
}
|
|
804
|
-
/** The remote backends' drive addresses, placement order. */
|
|
805
|
-
function remoteBackendUrls(reactor) {
|
|
806
|
-
return backendsToDescriptors(reactor).filter((d) => d.kind === "remote").map((d) => d.remote?.url).filter((u) => typeof u === "string");
|
|
807
|
-
}
|
|
808
|
-
//#endregion
|
|
809
825
|
//#region src/connect-projection.ts
|
|
810
826
|
/**
|
|
811
827
|
* Instance-fact projection for compound hosts: the drives a compound's
|
|
@@ -872,6 +888,48 @@ function projectDrivesIntoConnect(input) {
|
|
|
872
888
|
preserveStrategy: "preserve-all"
|
|
873
889
|
} };
|
|
874
890
|
}
|
|
891
|
+
/** A served slug names a declared one as is, or hashed (`<slug>-<8 hex>`). */
|
|
892
|
+
function servesSlug(declared, served) {
|
|
893
|
+
return served === declared || served.startsWith(`${declared}-`) && /^[0-9a-f]{8}$/.test(served.slice(declared.length + 1));
|
|
894
|
+
}
|
|
895
|
+
/** Annotates remote default drives with their backend (`sync: false` when placed on it); other remote placements become collections. */
|
|
896
|
+
function placeConnectDrives(reactor, defaultDrives) {
|
|
897
|
+
const remotes = remoteBackends(reactor).flatMap(({ name, url }) => {
|
|
898
|
+
const at = switchboardOfDrive$1(url);
|
|
899
|
+
return at ? [{
|
|
900
|
+
name,
|
|
901
|
+
base: at.base
|
|
902
|
+
}] : [];
|
|
903
|
+
});
|
|
904
|
+
if (remotes.length === 0) return { defaultDrives: [...defaultDrives] };
|
|
905
|
+
const placement = Object.entries(reactor?.placement?.drives ?? {});
|
|
906
|
+
const matched = /* @__PURE__ */ new Set();
|
|
907
|
+
const placed = defaultDrives.map((drive) => {
|
|
908
|
+
if (!("url" in drive)) return drive;
|
|
909
|
+
const at = switchboardOfDrive$1(drive.url);
|
|
910
|
+
const backend = remotes.find((remote) => remote.base === at?.base)?.name;
|
|
911
|
+
if (!at || !backend) return drive;
|
|
912
|
+
const entry = placement.find(([slug]) => servesSlug(slug, at.slug));
|
|
913
|
+
if (entry) matched.add(entry[0]);
|
|
914
|
+
return entry?.[1] === backend ? {
|
|
915
|
+
...drive,
|
|
916
|
+
backend,
|
|
917
|
+
sync: false
|
|
918
|
+
} : {
|
|
919
|
+
...drive,
|
|
920
|
+
backend
|
|
921
|
+
};
|
|
922
|
+
});
|
|
923
|
+
const names = new Set(remotes.map((remote) => remote.name));
|
|
924
|
+
const collections = Object.fromEntries(placement.filter(([slug, backend]) => !matched.has(slug) && names.has(backend)).map(([slug, backend]) => [slug, {
|
|
925
|
+
backend,
|
|
926
|
+
sync: false
|
|
927
|
+
}]));
|
|
928
|
+
return Object.keys(collections).length > 0 ? {
|
|
929
|
+
defaultDrives: placed,
|
|
930
|
+
collections
|
|
931
|
+
} : { defaultDrives: placed };
|
|
932
|
+
}
|
|
875
933
|
//#endregion
|
|
876
934
|
//#region src/expect-host.ts
|
|
877
935
|
function isRecord(value) {
|
|
@@ -1008,6 +1066,6 @@ function expectHost(input) {
|
|
|
1008
1066
|
return expectation;
|
|
1009
1067
|
}
|
|
1010
1068
|
//#endregion
|
|
1011
|
-
export { 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 };
|
|
1069
|
+
export { 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, placeConnectDrives, 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, remoteBackends, 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 };
|
|
1012
1070
|
|
|
1013
1071
|
//# sourceMappingURL=index.mjs.map
|