@powerhousedao/host-core 6.2.3-dev.59 → 6.2.3-dev.61

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/index.d.mts CHANGED
@@ -167,12 +167,26 @@ interface SwitchboardReactorProjection {
167
167
  }
168
168
  /** Project the reactor block onto the switchboard's env + options. */
169
169
  export declare function projectReactorToSwitchboard(reactor: ReactorConfig | undefined): SwitchboardReactorProjection;
170
+ /** The four reactor-client shapes a Connect host can select (mirrors the
171
+ * shared PHReactorClientMode; kept local to avoid an import cycle). */
172
+ type ReactorClientMode = "in-process" | "worker" | "remote" | "router";
173
+ /**
174
+ * Which reactor client the backend topology asks for:
175
+ * - local (in-process/worker) AND remote backends -> `router`
176
+ * - remote backend(s) only -> `remote`
177
+ * - a worker backend -> `worker`
178
+ * - anything else local -> `in-process`
179
+ * `undefined` when no backends are declared — the caller then keeps the
180
+ * legacy reactorWorker/multiReactor behaviour untouched.
181
+ */
182
+ export declare function reactorClientMode(reactor: ReactorConfig | undefined): ReactorClientMode | undefined;
170
183
  interface ConnectReactorProjection {
171
184
  /** Patch merged into the connect runtime config (connect.*). */
172
185
  connect: {
173
186
  reactor?: ReactorProtocol;
174
187
  instance?: {
175
188
  reactorWorker?: boolean;
189
+ reactorClient?: ReactorClientMode;
176
190
  };
177
191
  app?: {
178
192
  workflowsEnabled?: boolean;
@@ -180,7 +194,8 @@ interface ConnectReactorProjection {
180
194
  };
181
195
  }
182
196
  /** Project the reactor block onto the Connect runtime config: protocol →
183
- * connect.reactor (same shape), backend kind → instance.reactorWorker,
197
+ * connect.reactor (same shape), backend topology → instance.reactorWorker
198
+ * (legacy) + instance.reactorClient (the explicit 4-way selector),
184
199
  * workflows → app.workflowsEnabled. */
185
200
  export declare function projectReactorToConnect(reactor: ReactorConfig | undefined): ConnectReactorProjection;
186
201
  /**
@@ -881,6 +896,6 @@ export declare function mergeDrivePlan(projectRoot: string, hostDeclared: readon
881
896
  }[]): DrivePlanEntry[];
882
897
  export declare function explainDrivePlan(plan: readonly DrivePlanEntry[]): string;
883
898
  //#endregion
884
- export { type CompoundMember, type CompoundWiring, type ConnectReactorProjection, type ContributionSource, type Contributions, type DriveDeclaration, type DrivePlanEntry, type DriveProjectionInput, type DriveSeederClient, type HostDefinition, HostLoadError, type HostPlugin, type HostPluginModule, type HostSchemaLike, type HostsFolderStatus, type LoadedHost, type MergedContribution, type NormalizedPluginEntry, type Observe, type PluginEntry, PluginError, type ProjectedDescriptor, type Provide, type ReactorBackend, type ReactorConfig, type ReactorProtocol, type ResolvedDrive, type ResolvedPlugin, type RunCompoundOptions, type RunCompoundResult, type RunProbe, type RunRecord, type RunRecordMember, type RunnerContext, RunnerError, type RunnerHandle, type RunnerModule, type RunnerVerb, type SeedResult, type SwitchboardReactorProjection, type Transform, entryActiveForVerb, findNonStaticValue, getVerb, hostTypeSatisfies, lintHostImports, listVerbs, loadHost, mergeContributions, normalizePluginEntries, normalizePluginEntry, pluginEntrySchema, probeHostsFolder, registerHostType, resolveOrder, resolveRunnerModule, runCompound, runObserveHook, runObserveHookSequential, runProvideHook, runTransformHook, validateHost };
899
+ export { type CompoundMember, type CompoundWiring, type ConnectReactorProjection, type ContributionSource, type Contributions, type DriveDeclaration, type DrivePlanEntry, type DriveProjectionInput, type DriveSeederClient, type HostDefinition, HostLoadError, type HostPlugin, type HostPluginModule, type HostSchemaLike, type HostsFolderStatus, type LoadedHost, type MergedContribution, type NormalizedPluginEntry, type Observe, type PluginEntry, PluginError, type ProjectedDescriptor, type Provide, type ReactorBackend, type ReactorClientMode, type ReactorConfig, type ReactorProtocol, type ResolvedDrive, type ResolvedPlugin, type RunCompoundOptions, type RunCompoundResult, type RunProbe, type RunRecord, type RunRecordMember, type RunnerContext, RunnerError, type RunnerHandle, type RunnerModule, type RunnerVerb, type SeedResult, type SwitchboardReactorProjection, type Transform, entryActiveForVerb, findNonStaticValue, getVerb, hostTypeSatisfies, lintHostImports, listVerbs, loadHost, mergeContributions, normalizePluginEntries, normalizePluginEntry, pluginEntrySchema, probeHostsFolder, registerHostType, resolveOrder, resolveRunnerModule, runCompound, runObserveHook, runObserveHookSequential, runProvideHook, runTransformHook, validateHost };
885
900
  export {};
886
901
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/connect-projection.ts","../src/run-record.ts","../src/placeholders.ts","../src/reactor-config.ts","../src/backend-projection.ts","../src/host-schemas.ts","../src/plugins-resolve.ts","../src/drives.ts"],"mappings":";;;;;;;;;;;;wBA+BgB,sBACX,QAAQ,4BACV;;;;;;;;wBAqBa,eAAe,kBAAkB;UAahC;;;EAGf;;EAEA,0BAA0B;;EAE1B;;;;;;;;wBASc,yBACd,OAAO,uBACN,KAAK;;;;;;;;;;UC3ES;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,SAAS,eAAe;;EAExB,QAAQ;;KAGE;EACN;;EACA;EAAiB,QAAQ;;EACzB;EAAgB,QAAQ;;EACxB;EAAmB,QAAQ;;wBAMjB,cACd,oBACA,mBACC;wBAUa,eAAe,oBAAoB,QAAQ;wBAM3C,eAAe,oBAAoB;wBAQnC,WAAW;;;;;;;;;;wBAmBX,SACd,oBACA,kBACA,sBACC;;;;;;;;;;wBC5Ea,mBACd,qBACA,MAAK;;;wBASS,4BAA4B,GAAG,OAAO,GAAG,mBAAmB;;;;;;;;;;;KCXhE;UAEK;EACf;EACA;EACA;;UAGe;EACf;EACA;;EAEA;;UAGe;EACf;EACA;;UAGe;EACf,OAAO;EACP,UAAU;EACV;IAAc;;EACd,WAAW;EACX,SAAS;;;UAIM;EACf;IACE;IACA;IACA;IACA;;EAEF;EACA;;UAGe;EACf,WAAW,eAAe;EAC1B;IACE;IACA,UAAU;;EAEZ;EACA,WAAW;;;;wBAKG,eACd,SAAS,4BACR;;;wBA2Ba,YACd,UAAU,8BACT;UAiBc;;EAEf,KAAK;;EAEL;IAAW;;;;wBAIG,4BACd,SA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM7B,EAAA,KAAA;;;;wBAOc,sBAAsB;;;;;;;;wBClIhB,mBAAmB,SAAS,yBAChD,qBACA,kBACA,cACA,kBAAkB,eAClB,gBACC,QAAQ,eAAe;;;;;;;;;;;;;;;;;;;;qBClBb,wBAAsB,EAAA;;;;;;;;;;;;;;;;;;GAYjC,EAAA,KAAA;KAEU,mBAAmB,EAAE,aAAa;qBAEjC,cAAY,EAAA,SAAA,EAAA;;;;;;;;;;;;;;;;;;GAAkC,EAAA,KAAA;wBAE3C,eAAe,qBAAqB;UASnC;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;wBAGc,wBACd,qBACA,MAAM,mBACL;;;UAkCc;;EAEf,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/connect-projection.ts","../src/run-record.ts","../src/placeholders.ts","../src/reactor-config.ts","../src/backend-projection.ts","../src/host-schemas.ts","../src/plugins-resolve.ts","../src/drives.ts"],"mappings":";;;;;;;;;;;;wBA+BgB,sBACX,QAAQ,4BACV;;;;;;;;wBAqBa,eAAe,kBAAkB;UAahC;;;EAGf;;EAEA,0BAA0B;;EAE1B;;;;;;;;wBASc,yBACd,OAAO,uBACN,KAAK;;;;;;;;;;UC3ES;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,SAAS,eAAe;;EAExB,QAAQ;;KAGE;EACN;;EACA;EAAiB,QAAQ;;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EAEf,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"}
package/dist/index.mjs CHANGED
@@ -115,14 +115,44 @@ function projectReactorToSwitchboard(reactor) {
115
115
  options
116
116
  };
117
117
  }
118
+ const LOCAL_BACKEND_KINDS = /* @__PURE__ */ new Set([
119
+ "in-process",
120
+ "worker",
121
+ void 0
122
+ ]);
123
+ /**
124
+ * Which reactor client the backend topology asks for:
125
+ * - local (in-process/worker) AND remote backends -> `router`
126
+ * - remote backend(s) only -> `remote`
127
+ * - a worker backend -> `worker`
128
+ * - anything else local -> `in-process`
129
+ * `undefined` when no backends are declared — the caller then keeps the
130
+ * legacy reactorWorker/multiReactor behaviour untouched.
131
+ */
132
+ function reactorClientMode(reactor) {
133
+ const backends = reactor?.backends;
134
+ if (!backends) return void 0;
135
+ const kinds = Object.values(backends).map((b) => b.kind);
136
+ if (kinds.length === 0) return void 0;
137
+ const hasLocal = kinds.some((k) => LOCAL_BACKEND_KINDS.has(k));
138
+ const hasRemote = kinds.some((k) => k === "remote");
139
+ if (hasLocal && hasRemote) return "router";
140
+ if (hasRemote) return "remote";
141
+ return primaryBackend(reactor)?.kind === "worker" ? "worker" : "in-process";
142
+ }
118
143
  /** Project the reactor block onto the Connect runtime config: protocol →
119
- * connect.reactor (same shape), backend kind → instance.reactorWorker,
144
+ * connect.reactor (same shape), backend topology → instance.reactorWorker
145
+ * (legacy) + instance.reactorClient (the explicit 4-way selector),
120
146
  * workflows → app.workflowsEnabled. */
121
147
  function projectReactorToConnect(reactor) {
122
148
  const connect = {};
123
149
  if (reactor?.protocol) connect.reactor = reactor.protocol;
124
150
  const backend = primaryBackend(reactor);
125
- if (backend?.kind !== void 0) connect.instance = { reactorWorker: backend.kind === "worker" };
151
+ const mode = reactorClientMode(reactor);
152
+ if (backend?.kind !== void 0 || mode !== void 0) connect.instance = {
153
+ ...backend?.kind !== void 0 ? { reactorWorker: backend.kind === "worker" } : {},
154
+ ...mode !== void 0 ? { reactorClient: mode } : {}
155
+ };
126
156
  if (reactor?.workflows !== void 0) connect.app = { workflowsEnabled: reactor.workflows };
127
157
  return { connect };
128
158
  }
@@ -190,6 +220,6 @@ async function resolveHostPlugins(projectRoot, hostType, verb, entries, where) {
190
220
  return resolved;
191
221
  }
192
222
  //#endregion
193
- export { HostLoadError, PluginError, RunnerError, assertProtocolConsistency, backendToDescriptor, backendsToDescriptors, childrenSchema, clearRunRecord, compoundHostSchema, defaultUserDataDir, driveDeclarationSchema, drivesSchema, emittedHostSchemas, entryActiveForVerb, explainDrivePlan, findNonStaticValue, getVerb, hostTypeSatisfies, isPidAlive, isStructuralMultiReactor, lintHostImports, listVerbs, loadHost, mergeContributions, mergeDefaultDrives, mergeDrivePlan, normalizePluginEntries, normalizePluginEntry, pluginEntrySchema, primaryBackend, probeHostsFolder, probeRun, profileSchema, projectDriveId, projectDrivesIntoConnect, projectReactorToConnect, projectReactorToSwitchboard, protocolEnv, reactorBackendSchema, reactorHostSchema, reactorProtocolSchema, reactorSchema, readRunRecord, rebaseDriveUrl, registerHostType, remoteBackendUrls, resolveDriveDeclaration, resolveHostPlugins, resolveOrder, resolveRunnerModule, resolveUserDataPlaceholders, runCompound, runObserveHook, runObserveHookSequential, runProvideHook, runTransformHook, runnerBaseSchema, seedDrives, validateHost, writeRunRecord };
223
+ export { HostLoadError, PluginError, RunnerError, assertProtocolConsistency, backendToDescriptor, backendsToDescriptors, childrenSchema, clearRunRecord, compoundHostSchema, defaultUserDataDir, driveDeclarationSchema, drivesSchema, emittedHostSchemas, entryActiveForVerb, explainDrivePlan, findNonStaticValue, getVerb, hostTypeSatisfies, isPidAlive, isStructuralMultiReactor, lintHostImports, listVerbs, loadHost, mergeContributions, mergeDefaultDrives, mergeDrivePlan, normalizePluginEntries, normalizePluginEntry, pluginEntrySchema, primaryBackend, probeHostsFolder, probeRun, profileSchema, projectDriveId, projectDrivesIntoConnect, projectReactorToConnect, projectReactorToSwitchboard, protocolEnv, reactorBackendSchema, reactorClientMode, reactorHostSchema, reactorProtocolSchema, reactorSchema, readRunRecord, rebaseDriveUrl, registerHostType, remoteBackendUrls, resolveDriveDeclaration, resolveHostPlugins, resolveOrder, resolveRunnerModule, resolveUserDataPlaceholders, runCompound, runObserveHook, runObserveHookSequential, runProvideHook, runTransformHook, runnerBaseSchema, seedDrives, validateHost, writeRunRecord };
194
224
 
195
225
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["factory"],"sources":["../src/backend-projection.ts","../src/reactor-config.ts","../src/plugins-resolve.ts"],"sourcesContent":["import type {\n ReactorBackend,\n ReactorConfig,\n ReactorProtocol,\n} from \"./reactor-config.js\";\n\n/**\n * Phase 4 (track R): project named host backends onto reactor-monitor's\n * `ReactorDescriptor` shape — the input `provision()` takes. Pure and\n * dependency-free; a type-assignability test pins the output to the real\n * `ReactorDescriptor` so an upstream field rename fails this package's tests\n * instead of silently drifting (D2.b: aligned locally, upstreaming not\n * blocked on).\n */\n\n/** The browser-provisionable storage union — reactor-monitor's\n * `ReactorStorageConfig` shape. `postgres` is the SERVER extension (D2.b): a\n * switchboard backend's storage, never a provisioned browser reactor's. */\nexport type ProjectedStorage =\n | { kind: \"idb\" }\n | { kind: \"memory\" }\n | { kind: \"path\"; dataDir: string };\n\nexport interface ProjectedDescriptor {\n kind: \"in-process\" | \"worker\" | \"remote\";\n name: string;\n storage?: ProjectedStorage;\n packages?: { cdnUrl?: string; specs?: string[]; dynamic?: boolean };\n featureFlags?: {\n documentDecisions?: boolean;\n authEnforcement?: boolean;\n authGroups?: boolean;\n authConditions?: boolean;\n };\n remote?: { url: string };\n}\n\nfunction projectStorage(\n name: string,\n storage: NonNullable<ReactorBackend[\"storage\"]>,\n): ProjectedStorage {\n switch (storage.kind) {\n case \"idb\":\n return { kind: \"idb\" };\n case \"memory\":\n return { kind: \"memory\" };\n case \"path\": {\n if (!storage.dataDir) {\n throw new Error(\n `Backend \"${name}\": storage kind \"path\" requires dataDir.`,\n );\n }\n return { kind: \"path\", dataDir: storage.dataDir };\n }\n case \"postgres\":\n throw new Error(\n `Backend \"${name}\": storage kind \"postgres\" is server-side only — ` +\n `a provisioned (in-process/worker) reactor cannot use it. Point a ` +\n `\"remote\" backend at the switchboard that owns that database instead.`,\n );\n }\n}\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. */\nexport function backendToDescriptor(\n name: string,\n backend: ReactorBackend,\n protocol?: ReactorProtocol,\n): ProjectedDescriptor {\n const descriptor: ProjectedDescriptor = {\n kind: backend.kind ?? \"in-process\",\n name,\n };\n if (descriptor.kind === \"remote\") {\n const url = backend.remote?.url;\n if (!url) {\n throw new Error(\n `Backend \"${name}\" is kind \"remote\" but has no remote.url — ` +\n `a remote descriptor attaches to an already-running reactor by URL.`,\n );\n }\n descriptor.remote = { url };\n // remote attaches; it builds nothing, so local-build fields do not apply\n return descriptor;\n }\n if (backend.storage) {\n descriptor.storage = projectStorage(name, backend.storage);\n }\n if (backend.packages) descriptor.packages = backend.packages;\n if (protocol?.featureFlags) descriptor.featureFlags = protocol.featureFlags;\n return descriptor;\n}\n\n/** All named backends, in placement-primary-first order (the order a\n * createReactorClients step would provision them). */\nexport function backendsToDescriptors(\n reactor: ReactorConfig | undefined,\n): ProjectedDescriptor[] {\n const backends = reactor?.backends;\n if (!backends) return [];\n const names = Object.keys(backends);\n const primary = reactor.placement?.primary;\n const ordered =\n primary && names.includes(primary)\n ? [primary, ...names.filter((n) => n !== primary)]\n : names;\n return ordered.map((name) =>\n backendToDescriptor(name, backends[name], reactor.protocol),\n );\n}\n\nconst LOCAL_KINDS = new Set([\"in-process\", \"worker\", undefined]);\n\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 */\nexport function isStructuralMultiReactor(\n reactor: ReactorConfig | undefined,\n): boolean {\n const backends = reactor?.backends;\n if (!backends) return false;\n const kinds = Object.values(backends).map((b) => b.kind);\n return (\n kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === \"remote\")\n );\n}\n\n/** The remote backends' urls, placement order — what the routing client dials. */\nexport function remoteBackendUrls(\n reactor: ReactorConfig | undefined,\n): string[] {\n return backendsToDescriptors(reactor)\n .filter((d) => d.kind === \"remote\")\n .map((d) => d.remote?.url)\n .filter((u): u is string => typeof u === \"string\");\n}\n","/**\n * The shared `reactor` host-config block and its projections onto today's\n * Switchboard env / Connect runtime config. Phase 2 of uniform-runners: makes\n * the reactor block live through the bridge runners, BEFORE track R replaces\n * the projection with reactor-monitor's provision(). The headline is\n * single-sourced `reactor.protocol` — both projections read the same block, so\n * client and server cannot diverge, and a contradicting pre-set env fails boot.\n */\n\nexport type ReactorBackendKind = \"in-process\" | \"worker\" | \"remote\";\n\nexport interface ReactorStorageConfig {\n kind: \"idb\" | \"memory\" | \"path\" | \"postgres\";\n dataDir?: string;\n url?: string;\n}\n\nexport interface ReactorPackageConfig {\n cdnUrl?: string;\n specs?: string[];\n /** on-demand model resolution (was DYNAMIC_MODEL_LOADING). */\n dynamic?: boolean;\n}\n\nexport interface ReactorRemoteConfig {\n host?: string;\n url?: string;\n}\n\nexport interface ReactorBackend {\n kind?: ReactorBackendKind;\n storage?: ReactorStorageConfig;\n readModel?: { url?: string };\n packages?: ReactorPackageConfig;\n remote?: ReactorRemoteConfig;\n}\n\n/** Replay/admission rules every sync peer must share. */\nexport interface ReactorProtocol {\n featureFlags?: {\n documentDecisions?: boolean;\n authEnforcement?: boolean;\n authGroups?: boolean;\n authConditions?: boolean;\n };\n createSignaturePolicy?: \"legacy\" | \"v2-required\";\n unsupportedStoredDocuments?: \"refuse\" | \"read-only\";\n}\n\nexport interface ReactorConfig {\n backends?: Record<string, ReactorBackend>;\n placement?: {\n primary?: string;\n default?: Record<string, unknown>;\n };\n workflows?: boolean;\n protocol?: ReactorProtocol;\n}\n\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. */\nexport function primaryBackend(\n reactor: ReactorConfig | undefined,\n): ReactorBackend | undefined {\n const backends = reactor?.backends;\n if (!backends) return undefined;\n const names = Object.keys(backends);\n if (names.length === 0) return undefined;\n const pick =\n reactor.placement?.primary ??\n (names.includes(\"main\")\n ? \"main\"\n : names.includes(\"local\")\n ? \"local\"\n : names[0]);\n return backends[pick];\n}\n\nconst FLAG_ENV: Record<\n keyof NonNullable<ReactorProtocol[\"featureFlags\"]>,\n string\n> = {\n documentDecisions: \"REACTOR_DOCUMENT_DECISIONS\",\n authEnforcement: \"REACTOR_AUTH_ENFORCEMENT\",\n authGroups: \"REACTOR_AUTH_GROUPS\",\n authConditions: \"REACTOR_AUTH_CONDITIONS\",\n};\n\n/** The env vars a protocol block maps onto, with their string values. Only\n * keys the block actually sets appear. */\nexport function protocolEnv(\n protocol: ReactorProtocol | undefined,\n): Record<string, string> {\n const env: Record<string, string> = {};\n if (!protocol) return env;\n for (const [key, varName] of Object.entries(FLAG_ENV)) {\n const value = protocol.featureFlags?.[key as keyof typeof FLAG_ENV];\n if (value !== undefined) env[varName] = value ? \"true\" : \"false\";\n }\n if (protocol.createSignaturePolicy !== undefined) {\n env.CREATE_SIGNATURE_POLICY = protocol.createSignaturePolicy;\n }\n if (protocol.unsupportedStoredDocuments !== undefined) {\n env.REACTOR_UNSUPPORTED_STORED_DOCUMENTS =\n protocol.unsupportedStoredDocuments;\n }\n return env;\n}\n\nexport interface SwitchboardReactorProjection {\n /** Env the switchboard server reads at boot. Only keys the block sets. */\n env: Record<string, string>;\n /** Options passed to startSwitchboard (DB path). */\n options: { dbPath?: string };\n}\n\n/** Project the reactor block onto the switchboard's env + options. */\nexport function projectReactorToSwitchboard(\n reactor: ReactorConfig | undefined,\n): SwitchboardReactorProjection {\n const env = protocolEnv(reactor?.protocol);\n const backend = primaryBackend(reactor);\n const options: { dbPath?: string } = {};\n\n if (backend?.storage) {\n const s = backend.storage;\n const dbUrl = s.kind === \"postgres\" ? s.url : s.dataDir;\n if (dbUrl) env.PH_REACTOR_DATABASE_URL = dbUrl;\n }\n if (backend?.readModel?.url) options.dbPath = backend.readModel.url;\n if (backend?.packages?.dynamic) env.DYNAMIC_MODEL_LOADING = \"true\";\n if (reactor?.workflows !== undefined) {\n env.PH_WORKFLOWS_ENABLED = reactor.workflows ? \"1\" : \"0\";\n }\n return { env, options };\n}\n\nexport interface ConnectReactorProjection {\n /** Patch merged into the connect runtime config (connect.*). */\n connect: {\n reactor?: ReactorProtocol;\n instance?: { reactorWorker?: boolean };\n app?: { workflowsEnabled?: boolean };\n };\n}\n\n/** Project the reactor block onto the Connect runtime config: protocol →\n * connect.reactor (same shape), backend kind → instance.reactorWorker,\n * workflows → app.workflowsEnabled. */\nexport function projectReactorToConnect(\n reactor: ReactorConfig | undefined,\n): ConnectReactorProjection {\n const connect: ConnectReactorProjection[\"connect\"] = {};\n if (reactor?.protocol) connect.reactor = reactor.protocol;\n const backend = primaryBackend(reactor);\n if (backend?.kind !== undefined) {\n connect.instance = { reactorWorker: backend.kind === \"worker\" };\n }\n if (reactor?.workflows !== undefined) {\n connect.app = { workflowsEnabled: reactor.workflows };\n }\n return { connect };\n}\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. An env var that merely matches, or is unset, is fine (phase-2\n * transition keeps an operator's explicit env as an escape hatch unless it\n * disagrees with the protocol — see the WBS precedence note).\n */\nexport function assertProtocolConsistency(\n protocol: ReactorProtocol | undefined,\n env: Record<string, string | undefined>,\n hostFile = \"the host file\",\n): void {\n if (!protocol) return;\n const expected = protocolEnv(protocol);\n for (const [varName, hostValue] of Object.entries(expected)) {\n const envValue = env[varName];\n if (envValue !== undefined && envValue !== hostValue) {\n throw new Error(\n `reactor.protocol conflict: ${varName} is \"${envValue}\" in the environment ` +\n `but \"${hostValue}\" in ${hostFile}. These are fleet-consensus settings — ` +\n `a mismatch would diverge replay. Remove the env override or align the host.`,\n );\n }\n }\n}\n","import { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { z } from \"zod\";\nimport {\n entryActiveForVerb,\n hostTypeSatisfies,\n normalizePluginEntries,\n PluginError,\n type HostPlugin,\n type PluginEntry,\n type ResolvedPlugin,\n} from \"./plugins.js\";\n\n/**\n * NODE-ONLY plugin resolution (split from plugins.ts so the pure runner core\n * stays browser-safe for ConnectCore — R3). Resolves host.js entries from the\n * PROJECT dependency tree, exactly like runner modules.\n */\n\nfunction isHostPluginShape(value: unknown): value is HostPlugin {\n return (\n value !== null &&\n typeof value === \"object\" &&\n typeof (value as HostPlugin).name === \"string\"\n );\n}\n\n/**\n * Resolve host.js plugin entries into live plugins for one host boot:\n * verb-filter → module resolution from the project tree (default condition,\n * like runners) → factory/object contract → config validation → appliesTo.\n */\nexport async function resolveHostPlugins<THooks = Record<string, unknown>>(\n projectRoot: string,\n hostType: string,\n verb: string,\n entries: readonly PluginEntry[],\n where: string,\n): Promise<ResolvedPlugin<THooks>[]> {\n const normalized = normalizePluginEntries(entries, where);\n const projectRequire = createRequire(\n pathToFileURL(path.join(projectRoot, \"package.json\")).href,\n );\n\n const resolved: ResolvedPlugin<THooks>[] = [];\n for (const entry of normalized) {\n if (!entryActiveForVerb(entry, verb)) continue;\n\n let file: string;\n try {\n file = projectRequire.resolve(entry.module);\n } catch {\n throw new PluginError(\n `${where}: cannot resolve plugin \"${entry.module}\" from ${projectRoot}.`,\n \"Plugins resolve from the project dependency tree, exactly like runner modules.\",\n );\n }\n const module = (await import(pathToFileURL(file).href)) as {\n default?: unknown;\n };\n const exported = module.default;\n\n let plugin: HostPlugin<THooks>;\n if (typeof exported === \"function\") {\n const factory = exported as (config: unknown) => HostPlugin<THooks>;\n plugin = factory(entry.config);\n } else if (isHostPluginShape(exported)) {\n if (Object.keys(entry.config).length > 0 && !exported.configSchema) {\n throw new PluginError(\n `${where}: plugin \"${entry.module}\" takes no config, but the entry passes one.`,\n );\n }\n plugin = exported as HostPlugin<THooks>;\n } else {\n throw new PluginError(\n `${where}: \"${entry.module}\" does not default-export a plugin object or factory.`,\n \"Export `{ name, hooks?, contributions? }` or `(config) => plugin`.\",\n );\n }\n\n if (plugin.configSchema) {\n const parsed = plugin.configSchema.safeParse(entry.config);\n if (!parsed.success) {\n throw new PluginError(\n `${where}: config for plugin \"${plugin.name}\" is invalid:\\n` +\n z.prettifyError(parsed.error),\n );\n }\n }\n\n const appliesTo = plugin.appliesTo ?? \"reactor\";\n if (!hostTypeSatisfies(hostType, appliesTo)) {\n throw new PluginError(\n `${where}: plugin \"${plugin.name}\" applies to \"${appliesTo}\" hosts, but this host is \"${hostType}\".`,\n );\n }\n\n resolved.push({ entry, plugin, provenance: \"dependency\" });\n }\n return resolved;\n}\n"],"mappings":";;;;;;;AAqCA,SAAS,eACP,MACA,SACkB;CAClB,QAAQ,QAAQ,MAAhB;EACE,KAAK,OACH,OAAO,EAAE,MAAM,MAAM;EACvB,KAAK,UACH,OAAO,EAAE,MAAM,SAAS;EAC1B,KAAK;GACH,IAAI,CAAC,QAAQ,SACX,MAAM,IAAI,MACR,YAAY,KAAK,yCACnB;GAEF,OAAO;IAAE,MAAM;IAAQ,SAAS,QAAQ;GAAQ;EAElD,KAAK,YACH,MAAM,IAAI,MACR,YAAY,KAAK,uLAGnB;CACJ;AACF;;;;AAKA,SAAgB,oBACd,MACA,SACA,UACqB;CACrB,MAAM,aAAkC;EACtC,MAAM,QAAQ,QAAQ;EACtB;CACF;CACA,IAA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,SAAQ,MAAM,MAAM;OACxB,IAAI,kBAAkB,QAAQ,GAAG;GACtC,IAAI,OAAO,KAAK,MAAM,MAAM,CAAC,CAAC,SAAS,KAAK,CAAC,SAAS,cACpD,MAAM,IAAI,YACR,GAAG,MAAM,YAAY,MAAM,OAAO,6CACpC;GAEF,SAAS;EACX,OACE,MAAM,IAAI,YACR,GAAG,MAAM,KAAK,MAAM,OAAO,wDAC3B,oEACF;EAGF,IAAI,OAAO,cAAc;GACvB,MAAM,SAAS,OAAO,aAAa,UAAU,MAAM,MAAM;GACzD,IAAI,CAAC,OAAO,SACV,MAAM,IAAI,YACR,GAAG,MAAM,uBAAuB,OAAO,KAAK,mBAC1C,EAAE,cAAc,OAAO,KAAK,CAChC;EAEJ;EAEA,MAAM,YAAY,OAAO,aAAa;EACtC,IAAI,CAAC,kBAAkB,UAAU,SAAS,GACxC,MAAM,IAAI,YACR,GAAG,MAAM,YAAY,OAAO,KAAK,gBAAgB,UAAU,6BAA6B,SAAS,GACnG;EAGF,SAAS,KAAK;GAAE;GAAO;GAAQ,YAAY;EAAa,CAAC;CAC3D;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"index.mjs","names":["factory"],"sources":["../src/backend-projection.ts","../src/reactor-config.ts","../src/plugins-resolve.ts"],"sourcesContent":["import type {\n ReactorBackend,\n ReactorConfig,\n ReactorProtocol,\n} from \"./reactor-config.js\";\n\n/**\n * Phase 4 (track R): project named host backends onto reactor-monitor's\n * `ReactorDescriptor` shape — the input `provision()` takes. Pure and\n * dependency-free; a type-assignability test pins the output to the real\n * `ReactorDescriptor` so an upstream field rename fails this package's tests\n * instead of silently drifting (D2.b: aligned locally, upstreaming not\n * blocked on).\n */\n\n/** The browser-provisionable storage union — reactor-monitor's\n * `ReactorStorageConfig` shape. `postgres` is the SERVER extension (D2.b): a\n * switchboard backend's storage, never a provisioned browser reactor's. */\nexport type ProjectedStorage =\n | { kind: \"idb\" }\n | { kind: \"memory\" }\n | { kind: \"path\"; dataDir: string };\n\nexport interface ProjectedDescriptor {\n kind: \"in-process\" | \"worker\" | \"remote\";\n name: string;\n storage?: ProjectedStorage;\n packages?: { cdnUrl?: string; specs?: string[]; dynamic?: boolean };\n featureFlags?: {\n documentDecisions?: boolean;\n authEnforcement?: boolean;\n authGroups?: boolean;\n authConditions?: boolean;\n };\n remote?: { url: string };\n}\n\nfunction projectStorage(\n name: string,\n storage: NonNullable<ReactorBackend[\"storage\"]>,\n): ProjectedStorage {\n switch (storage.kind) {\n case \"idb\":\n return { kind: \"idb\" };\n case \"memory\":\n return { kind: \"memory\" };\n case \"path\": {\n if (!storage.dataDir) {\n throw new Error(\n `Backend \"${name}\": storage kind \"path\" requires dataDir.`,\n );\n }\n return { kind: \"path\", dataDir: storage.dataDir };\n }\n case \"postgres\":\n throw new Error(\n `Backend \"${name}\": storage kind \"postgres\" is server-side only — ` +\n `a provisioned (in-process/worker) reactor cannot use it. Point a ` +\n `\"remote\" backend at the switchboard that owns that database instead.`,\n );\n }\n}\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. */\nexport function backendToDescriptor(\n name: string,\n backend: ReactorBackend,\n protocol?: ReactorProtocol,\n): ProjectedDescriptor {\n const descriptor: ProjectedDescriptor = {\n kind: backend.kind ?? \"in-process\",\n name,\n };\n if (descriptor.kind === \"remote\") {\n const url = backend.remote?.url;\n if (!url) {\n throw new Error(\n `Backend \"${name}\" is kind \"remote\" but has no remote.url — ` +\n `a remote descriptor attaches to an already-running reactor by URL.`,\n );\n }\n descriptor.remote = { url };\n // remote attaches; it builds nothing, so local-build fields do not apply\n return descriptor;\n }\n if (backend.storage) {\n descriptor.storage = projectStorage(name, backend.storage);\n }\n if (backend.packages) descriptor.packages = backend.packages;\n if (protocol?.featureFlags) descriptor.featureFlags = protocol.featureFlags;\n return descriptor;\n}\n\n/** All named backends, in placement-primary-first order (the order a\n * createReactorClients step would provision them). */\nexport function backendsToDescriptors(\n reactor: ReactorConfig | undefined,\n): ProjectedDescriptor[] {\n const backends = reactor?.backends;\n if (!backends) return [];\n const names = Object.keys(backends);\n const primary = reactor.placement?.primary;\n const ordered =\n primary && names.includes(primary)\n ? [primary, ...names.filter((n) => n !== primary)]\n : names;\n return ordered.map((name) =>\n backendToDescriptor(name, backends[name], reactor.protocol),\n );\n}\n\nconst LOCAL_KINDS = new Set([\"in-process\", \"worker\", undefined]);\n\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 */\nexport function isStructuralMultiReactor(\n reactor: ReactorConfig | undefined,\n): boolean {\n const backends = reactor?.backends;\n if (!backends) return false;\n const kinds = Object.values(backends).map((b) => b.kind);\n return (\n kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === \"remote\")\n );\n}\n\n/** The remote backends' urls, placement order — what the routing client dials. */\nexport function remoteBackendUrls(\n reactor: ReactorConfig | undefined,\n): string[] {\n return backendsToDescriptors(reactor)\n .filter((d) => d.kind === \"remote\")\n .map((d) => d.remote?.url)\n .filter((u): u is string => typeof u === \"string\");\n}\n","/**\n * The shared `reactor` host-config block and its projections onto today's\n * Switchboard env / Connect runtime config. Phase 2 of uniform-runners: makes\n * the reactor block live through the bridge runners, BEFORE track R replaces\n * the projection with reactor-monitor's provision(). The headline is\n * single-sourced `reactor.protocol` — both projections read the same block, so\n * client and server cannot diverge, and a contradicting pre-set env fails boot.\n */\n\nexport type ReactorBackendKind = \"in-process\" | \"worker\" | \"remote\";\n\nexport interface ReactorStorageConfig {\n kind: \"idb\" | \"memory\" | \"path\" | \"postgres\";\n dataDir?: string;\n url?: string;\n}\n\nexport interface ReactorPackageConfig {\n cdnUrl?: string;\n specs?: string[];\n /** on-demand model resolution (was DYNAMIC_MODEL_LOADING). */\n dynamic?: boolean;\n}\n\nexport interface ReactorRemoteConfig {\n host?: string;\n url?: string;\n}\n\nexport interface ReactorBackend {\n kind?: ReactorBackendKind;\n storage?: ReactorStorageConfig;\n readModel?: { url?: string };\n packages?: ReactorPackageConfig;\n remote?: ReactorRemoteConfig;\n}\n\n/** Replay/admission rules every sync peer must share. */\nexport interface ReactorProtocol {\n featureFlags?: {\n documentDecisions?: boolean;\n authEnforcement?: boolean;\n authGroups?: boolean;\n authConditions?: boolean;\n };\n createSignaturePolicy?: \"legacy\" | \"v2-required\";\n unsupportedStoredDocuments?: \"refuse\" | \"read-only\";\n}\n\nexport interface ReactorConfig {\n backends?: Record<string, ReactorBackend>;\n placement?: {\n primary?: string;\n default?: Record<string, unknown>;\n };\n workflows?: boolean;\n protocol?: ReactorProtocol;\n}\n\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. */\nexport function primaryBackend(\n reactor: ReactorConfig | undefined,\n): ReactorBackend | undefined {\n const backends = reactor?.backends;\n if (!backends) return undefined;\n const names = Object.keys(backends);\n if (names.length === 0) return undefined;\n const pick =\n reactor.placement?.primary ??\n (names.includes(\"main\")\n ? \"main\"\n : names.includes(\"local\")\n ? \"local\"\n : names[0]);\n return backends[pick];\n}\n\nconst FLAG_ENV: Record<\n keyof NonNullable<ReactorProtocol[\"featureFlags\"]>,\n string\n> = {\n documentDecisions: \"REACTOR_DOCUMENT_DECISIONS\",\n authEnforcement: \"REACTOR_AUTH_ENFORCEMENT\",\n authGroups: \"REACTOR_AUTH_GROUPS\",\n authConditions: \"REACTOR_AUTH_CONDITIONS\",\n};\n\n/** The env vars a protocol block maps onto, with their string values. Only\n * keys the block actually sets appear. */\nexport function protocolEnv(\n protocol: ReactorProtocol | undefined,\n): Record<string, string> {\n const env: Record<string, string> = {};\n if (!protocol) return env;\n for (const [key, varName] of Object.entries(FLAG_ENV)) {\n const value = protocol.featureFlags?.[key as keyof typeof FLAG_ENV];\n if (value !== undefined) env[varName] = value ? \"true\" : \"false\";\n }\n if (protocol.createSignaturePolicy !== undefined) {\n env.CREATE_SIGNATURE_POLICY = protocol.createSignaturePolicy;\n }\n if (protocol.unsupportedStoredDocuments !== undefined) {\n env.REACTOR_UNSUPPORTED_STORED_DOCUMENTS =\n protocol.unsupportedStoredDocuments;\n }\n return env;\n}\n\nexport interface SwitchboardReactorProjection {\n /** Env the switchboard server reads at boot. Only keys the block sets. */\n env: Record<string, string>;\n /** Options passed to startSwitchboard (DB path). */\n options: { dbPath?: string };\n}\n\n/** Project the reactor block onto the switchboard's env + options. */\nexport function projectReactorToSwitchboard(\n reactor: ReactorConfig | undefined,\n): SwitchboardReactorProjection {\n const env = protocolEnv(reactor?.protocol);\n const backend = primaryBackend(reactor);\n const options: { dbPath?: string } = {};\n\n if (backend?.storage) {\n const s = backend.storage;\n const dbUrl = s.kind === \"postgres\" ? s.url : s.dataDir;\n if (dbUrl) env.PH_REACTOR_DATABASE_URL = dbUrl;\n }\n if (backend?.readModel?.url) options.dbPath = backend.readModel.url;\n if (backend?.packages?.dynamic) env.DYNAMIC_MODEL_LOADING = \"true\";\n if (reactor?.workflows !== undefined) {\n env.PH_WORKFLOWS_ENABLED = reactor.workflows ? \"1\" : \"0\";\n }\n return { env, options };\n}\n\n/** The four reactor-client shapes a Connect host can select (mirrors the\n * shared PHReactorClientMode; kept local to avoid an import cycle). */\nexport type ReactorClientMode = \"in-process\" | \"worker\" | \"remote\" | \"router\";\n\nconst LOCAL_BACKEND_KINDS = new Set<ReactorBackendKind | undefined>([\n \"in-process\",\n \"worker\",\n undefined,\n]);\n\n/**\n * Which reactor client the backend topology asks for:\n * - local (in-process/worker) AND remote backends -> `router`\n * - remote backend(s) only -> `remote`\n * - a worker backend -> `worker`\n * - anything else local -> `in-process`\n * `undefined` when no backends are declared — the caller then keeps the\n * legacy reactorWorker/multiReactor behaviour untouched.\n */\nexport function reactorClientMode(\n reactor: ReactorConfig | undefined,\n): ReactorClientMode | undefined {\n const backends = reactor?.backends;\n if (!backends) return undefined;\n const kinds = Object.values(backends).map((b) => b.kind);\n if (kinds.length === 0) return undefined;\n const hasLocal = kinds.some((k) => LOCAL_BACKEND_KINDS.has(k));\n const hasRemote = kinds.some((k) => k === \"remote\");\n if (hasLocal && hasRemote) return \"router\";\n if (hasRemote) return \"remote\";\n return primaryBackend(reactor)?.kind === \"worker\" ? \"worker\" : \"in-process\";\n}\n\nexport interface ConnectReactorProjection {\n /** Patch merged into the connect runtime config (connect.*). */\n connect: {\n reactor?: ReactorProtocol;\n instance?: { reactorWorker?: boolean; reactorClient?: ReactorClientMode };\n app?: { workflowsEnabled?: boolean };\n };\n}\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. */\nexport function projectReactorToConnect(\n reactor: ReactorConfig | undefined,\n): ConnectReactorProjection {\n const connect: ConnectReactorProjection[\"connect\"] = {};\n if (reactor?.protocol) connect.reactor = reactor.protocol;\n const backend = primaryBackend(reactor);\n const mode = reactorClientMode(reactor);\n if (backend?.kind !== undefined || mode !== undefined) {\n connect.instance = {\n ...(backend?.kind !== undefined\n ? { reactorWorker: backend.kind === \"worker\" }\n : {}),\n ...(mode !== undefined ? { reactorClient: mode } : {}),\n };\n }\n if (reactor?.workflows !== undefined) {\n connect.app = { workflowsEnabled: reactor.workflows };\n }\n return { connect };\n}\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. An env var that merely matches, or is unset, is fine (phase-2\n * transition keeps an operator's explicit env as an escape hatch unless it\n * disagrees with the protocol — see the WBS precedence note).\n */\nexport function assertProtocolConsistency(\n protocol: ReactorProtocol | undefined,\n env: Record<string, string | undefined>,\n hostFile = \"the host file\",\n): void {\n if (!protocol) return;\n const expected = protocolEnv(protocol);\n for (const [varName, hostValue] of Object.entries(expected)) {\n const envValue = env[varName];\n if (envValue !== undefined && envValue !== hostValue) {\n throw new Error(\n `reactor.protocol conflict: ${varName} is \"${envValue}\" in the environment ` +\n `but \"${hostValue}\" in ${hostFile}. These are fleet-consensus settings — ` +\n `a mismatch would diverge replay. Remove the env override or align the host.`,\n );\n }\n }\n}\n","import { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { z } from \"zod\";\nimport {\n entryActiveForVerb,\n hostTypeSatisfies,\n normalizePluginEntries,\n PluginError,\n type HostPlugin,\n type PluginEntry,\n type ResolvedPlugin,\n} from \"./plugins.js\";\n\n/**\n * NODE-ONLY plugin resolution (split from plugins.ts so the pure runner core\n * stays browser-safe for ConnectCore — R3). Resolves host.js entries from the\n * PROJECT dependency tree, exactly like runner modules.\n */\n\nfunction isHostPluginShape(value: unknown): value is HostPlugin {\n return (\n value !== null &&\n typeof value === \"object\" &&\n typeof (value as HostPlugin).name === \"string\"\n );\n}\n\n/**\n * Resolve host.js plugin entries into live plugins for one host boot:\n * verb-filter → module resolution from the project tree (default condition,\n * like runners) → factory/object contract → config validation → appliesTo.\n */\nexport async function resolveHostPlugins<THooks = Record<string, unknown>>(\n projectRoot: string,\n hostType: string,\n verb: string,\n entries: readonly PluginEntry[],\n where: string,\n): Promise<ResolvedPlugin<THooks>[]> {\n const normalized = normalizePluginEntries(entries, where);\n const projectRequire = createRequire(\n pathToFileURL(path.join(projectRoot, \"package.json\")).href,\n );\n\n const resolved: ResolvedPlugin<THooks>[] = [];\n for (const entry of normalized) {\n if (!entryActiveForVerb(entry, verb)) continue;\n\n let file: string;\n try {\n file = projectRequire.resolve(entry.module);\n } catch {\n throw new PluginError(\n `${where}: cannot resolve plugin \"${entry.module}\" from ${projectRoot}.`,\n \"Plugins resolve from the project dependency tree, exactly like runner modules.\",\n );\n }\n const module = (await import(pathToFileURL(file).href)) as {\n default?: unknown;\n };\n const exported = module.default;\n\n let plugin: HostPlugin<THooks>;\n if (typeof exported === \"function\") {\n const factory = exported as (config: unknown) => HostPlugin<THooks>;\n plugin = factory(entry.config);\n } else if (isHostPluginShape(exported)) {\n if (Object.keys(entry.config).length > 0 && !exported.configSchema) {\n throw new PluginError(\n `${where}: plugin \"${entry.module}\" takes no config, but the entry passes one.`,\n );\n }\n plugin = exported as HostPlugin<THooks>;\n } else {\n throw new PluginError(\n `${where}: \"${entry.module}\" does not default-export a plugin object or factory.`,\n \"Export `{ name, hooks?, contributions? }` or `(config) => plugin`.\",\n );\n }\n\n if (plugin.configSchema) {\n const parsed = plugin.configSchema.safeParse(entry.config);\n if (!parsed.success) {\n throw new PluginError(\n `${where}: config for plugin \"${plugin.name}\" is invalid:\\n` +\n z.prettifyError(parsed.error),\n );\n }\n }\n\n const appliesTo = plugin.appliesTo ?? \"reactor\";\n if (!hostTypeSatisfies(hostType, appliesTo)) {\n throw new PluginError(\n `${where}: plugin \"${plugin.name}\" applies to \"${appliesTo}\" hosts, but this host is \"${hostType}\".`,\n );\n }\n\n resolved.push({ entry, plugin, provenance: \"dependency\" });\n }\n return resolved;\n}\n"],"mappings":";;;;;;;AAqCA,SAAS,eACP,MACA,SACkB;CAClB,QAAQ,QAAQ,MAAhB;EACE,KAAK,OACH,OAAO,EAAE,MAAM,MAAM;EACvB,KAAK,UACH,OAAO,EAAE,MAAM,SAAS;EAC1B,KAAK;GACH,IAAI,CAAC,QAAQ,SACX,MAAM,IAAI,MACR,YAAY,KAAK,yCACnB;GAEF,OAAO;IAAE,MAAM;IAAQ,SAAS,QAAQ;GAAQ;EAElD,KAAK,YACH,MAAM,IAAI,MACR,YAAY,KAAK,uLAGnB;CACJ;AACF;;;;AAKA,SAAgB,oBACd,MACA,SACA,UACqB;CACrB,MAAM,aAAkC;EACtC,MAAM,QAAQ,QAAQ;EACtB;CACF;CACA,IAAI,WAAW,SAAS,UAAU;EAChC,MAAM,MAAM,QAAQ,QAAQ;EAC5B,IAAI,CAAC,KACH,MAAM,IAAI,MACR,YAAY,KAAK,8GAEnB;EAEF,WAAW,SAAS,EAAE,IAAI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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/host-core",
3
- "version": "6.2.3-dev.59",
3
+ "version": "6.2.3-dev.61",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,13 +37,13 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@powerhousedao/shared": "6.2.3-dev.59",
40
+ "@powerhousedao/shared": "6.2.3-dev.61",
41
41
  "zod": "4.3.6"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsdown": "0.23.0",
45
45
  "vitest": "5.0.3",
46
- "@powerhousedao/reactor-monitor": "6.2.3-dev.59"
46
+ "@powerhousedao/reactor-monitor": "6.2.3-dev.61"
47
47
  },
48
48
  "scripts": {
49
49
  "tsc": "tsc",