@powerhousedao/host-core 6.2.3-dev.69 → 6.2.3-dev.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/compound-B6RZMA0Y.mjs +2804 -0
  2. package/dist/compound-B6RZMA0Y.mjs.map +1 -0
  3. package/dist/compound-PhoVeqe1.d.mts +2401 -0
  4. package/dist/compound-PhoVeqe1.d.mts.map +1 -0
  5. package/dist/env-substitution-C_fVirPh.d.mts +17 -0
  6. package/dist/env-substitution-C_fVirPh.d.mts.map +1 -0
  7. package/dist/env-substitution-Dj3pdsut.mjs +330 -0
  8. package/dist/env-substitution-Dj3pdsut.mjs.map +1 -0
  9. package/dist/host-schemas-mqOYNGot.d.mts +2153 -0
  10. package/dist/host-schemas-mqOYNGot.d.mts.map +1 -0
  11. package/dist/index.d.mts +908 -691
  12. package/dist/index.d.mts.map +1 -1
  13. package/dist/index.mjs +335 -109
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/plugins-XL6WsvTL.d.mts +182 -0
  16. package/dist/plugins-XL6WsvTL.d.mts.map +1 -0
  17. package/dist/plugins.d.mts +2 -120
  18. package/dist/plugins.mjs.map +1 -1
  19. package/dist/projection.d.mts +586 -0
  20. package/dist/projection.d.mts.map +1 -0
  21. package/dist/projection.mjs +1505 -0
  22. package/dist/projection.mjs.map +1 -0
  23. package/dist/runners/compound.d.mts +157 -12
  24. package/dist/runners/compound.d.mts.map +1 -1
  25. package/dist/runners/compound.mjs +5 -13
  26. package/dist/runners/compound.mjs.map +1 -1
  27. package/dist/schema.d.mts +105 -0
  28. package/dist/schema.d.mts.map +1 -0
  29. package/dist/schema.mjs +35 -0
  30. package/dist/schema.mjs.map +1 -0
  31. package/package.json +16 -4
  32. package/dist/compound-C8P0kvPJ.d.mts +0 -157
  33. package/dist/compound-C8P0kvPJ.d.mts.map +0 -1
  34. package/dist/host-schemas-CtPNRr5v.mjs +0 -720
  35. package/dist/host-schemas-CtPNRr5v.mjs.map +0 -1
  36. package/dist/plugins.d.mts.map +0 -1
@@ -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;;;;;;;;;;UC1ES;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,SAAS,eAAe;;EAExB,QAAQ;;KAGE;EACN;;EACA;EAAiB,QAAQ;;EACzB;EAAgB,QAAQ;;EACxB;EAAmB,QAAQ;;wBAQjB,cACd,oBACA,mBACC;wBAUa,eAAe,oBAAoB,QAAQ;wBAM3C,eAAe,oBAAoB;wBAQnC,WAAW;;;;;;;;;;wBAmBX,SACd,oBACA,kBACA,sBACC;;;;;;;;;;;;;;wBC3Ea,mBACd,qBACA,MAAK;;;wBASS,4BAA4B,GAAG,OAAO,GAAG,mBAAmB;;;;;;;;;;;KCfhE;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,SAAS,4BACR;;;KAoBS;;;;;;;;;;wBAiBI,kBACd,SAAS,4BACR;UAYc;;EAEf;IACE,UAAU;IACV;MAAa;MAAyB,gBAAgB;;IAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM7B,EAAA,KAAA;;;;wBAOc,sBAAsB;;;;;;;;wBChKhB,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/host-loader.ts","../src/run-record-schema.ts","../src/run-record.ts","../src/placeholders.ts","../src/host-types.ts","../src/plugins.ts","../src/plugins-resolve.ts","../src/drive-schema.ts","../src/drives.ts","../src/env-substitution.ts","../src/reactor-config.ts","../src/backend-projection.ts","../src/connect-projection.ts","../src/resolve/plan.ts","../src/resolve/resolve.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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;;;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,71 +1,87 @@
1
- import { A as HostLoadError, C as readRunRecord, D as listVerbs, E as getVerb, F as mergeDefaultDrives, I as projectDrivesIntoConnect, L as rebaseDriveUrl, M as lintHostImports, N as loadHost, O as resolveRunnerModule, P as probeHostsFolder, S as probeRun, T as RunnerError, _ as runCompound, a as reactorBackendSchema, b as clearRunRecord, c as reactorSchema, d as drivesSchema, f as explainDrivePlan, g as seedDrives, h as resolveDriveDeclaration, i as profileSchema, j as findNonStaticValue, k as validateHost, l as runnerBaseSchema, m as projectDriveId, n as compoundHostSchema, o as reactorHostSchema, p as mergeDrivePlan, r as emittedHostSchemas, s as reactorProtocolSchema, t as childrenSchema, u as driveDeclarationSchema, v as defaultUserDataDir, w as writeRunRecord, x as isPidAlive, y as resolveUserDataPlaceholders } from "./host-schemas-CtPNRr5v.mjs";
2
- import { PluginError, entryActiveForVerb, hostTypeSatisfies, mergeContributions, normalizePluginEntries, normalizePluginEntry, pluginEntrySchema, registerHostType, resolveOrder, runObserveHook, runObserveHookSequential, runProvideHook, runTransformHook } from "./plugins.mjs";
3
- import { createRequire } from "node:module";
4
- import path from "node:path";
5
- import { pathToFileURL } from "node:url";
6
- import { z } from "zod";
7
- //#region src/backend-projection.ts
8
- function projectStorage(name, storage) {
9
- switch (storage.kind) {
10
- case "idb": return { kind: "idb" };
11
- case "memory": return { kind: "memory" };
12
- case "path":
13
- if (!storage.dataDir) throw new Error(`Backend "${name}": storage kind "path" requires dataDir.`);
14
- return {
15
- kind: "path",
16
- dataDir: storage.dataDir
17
- };
18
- 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.`);
19
- }
1
+ import { $ as envSitesOf, $t as PluginError, A as probeHostsFolder, At as driveDeclarationSchema, B as resolveRunnerModule, Bt as isToken, C as computeOutputsHash, Ct as reactorHostSchema, D as lintHostImports, Dt as runnerBaseSchema, E as lintHostImportGraph, Et as refineStartOrder, F as ONE_SHOT_VERBS, Ft as concatTokenSchema, G as resolveHostOutputs, Gt as ref, H as validateHost, Ht as keyTokenSchema, I as RunnerError, It as envTokenSchema, J as planCompound, Jt as tokenable, K as PlanError, Kt as tokenKeyOf, L as getVerb, Lt as envTokenable, M as scanHostImports, Mt as projectDriveIdWith, N as stripComments, Nt as TOKEN_ESCAPE_KEY, O as lintOutputsFile, Ot as runnerKindSchema, P as CONNECT_RUNNER, Pt as TOKEN_KEYS, Q as checkTokenSites, Qt as resolvePluginContributions, R as isSchemaLike, Rt as findToken, S as OUTPUTS_FILE, St as reactorBackendSchema, T as findNonStaticValue, Tt as reactorSchema, U as TokenResolutionError, Ut as mapTokenSchema, V as validateDeclaredHost, Vt as itemTokenSchema, W as describeMapElements, Wt as outputTokenSchema, X as findRemovedForms, Xt as findDeadConnectConfig, Y as substituteBuiltinEnv, Yt as CONNECT_PLUGIN_OWNED_SLICES, Z as checkOutputPaths, Zt as resolveHostPlugins, _ as readRunRecord, _t as emittedHostSchemas, a as loadProducers, an as pluginEntryObjectSchema, at as describeToken, b as runRecordSchema, bt as profileSchema, c as runRecordOutputSource, cn as resolveOrder, ct as unwrapEscapes, d as resolveUserDataPlaceholders, dn as runProvideHook, dt as compoundHostSchema, en as entryActiveForVerb, et as outputRefsOf, f as clearRunRecord, fn as runTransformHook, ft as compoundWiringSchema, g as readProjectName, gt as emitHostJsonSchema, h as probeRun, ht as defineHostSchemas, i as compoundOutputSource, in as normalizePluginEntry, it as collectTokenSites, j as readOutputsFileHash, jt as drivesSchema, k as loadHost, kt as buildDriveDeclarationSchema, l as runnerOutputsSchema, ln as runObserveHook, lt as childWrapperSchema, m as listRunRecords, mt as declaredHostSchemas, n as runnerHandleSchema, nn as mergeContributions, nt as refKey, o as processResolveEnv, on as pluginEntrySchema, ot as formatPath, p as isPidAlive, pt as declaredGenericCompoundHostSchema, q as memberForRef, qt as tokenSchema, r as toStartedHandle, rn as normalizePluginEntries, rt as schemaAtPath, s as producerOutputsSchemas, sn as registerHostType, st as renderTokens, t as runCompound, tn as hostTypeSatisfies, tt as outputSitesOf, u as defaultUserDataDir, un as runObserveHookSequential, ut as childrenSchema, v as writeRunRecord, vt as genericCompoundHostSchema, w as describeHostOutputs, wt as reactorProtocolSchema, x as HostLoadError, xt as reactorBackendKindSchema, y as runRecordMemberSchema, yt as makeHostSchemas, z as listVerbs, zt as forbidRef } from "./compound-B6RZMA0Y.mjs";
2
+ import crypto from "node:crypto";
3
+ import { DRIVE_ICON_MAX_BYTES, resolveImageRef } from "@powerhousedao/shared/connect/image-ref";
4
+ //#region src/drives.ts
5
+ const sha256Hex = (input) => crypto.createHash("sha256").update(input).digest("hex");
6
+ function projectDriveId(projectRoot, slug) {
7
+ return projectDriveIdWith(sha256Hex, projectRoot, slug);
20
8
  }
21
- /** One backend → one descriptor. The protocol's featureFlags ride every
22
- * descriptor (they are fleet consensus, not per-backend). A remote backend
23
- * must carry remote.url — provision() requires it. */
24
- function backendToDescriptor(name, backend, protocol) {
25
- const descriptor = {
26
- kind: backend.kind ?? "in-process",
27
- name
9
+ function resolveDriveDeclaration(projectRoot, decl) {
10
+ const id = decl.projectHash ? projectDriveId(projectRoot, decl.slug) : decl.id ?? decl.slug;
11
+ const slug = decl.projectHash === true ? id : decl.slug;
12
+ if (decl.remote) return {
13
+ kind: "remote",
14
+ id,
15
+ slug,
16
+ name: decl.name ?? decl.slug,
17
+ remoteUrl: decl.remote.url,
18
+ sharingType: decl.sharingType ?? "public",
19
+ availableOffline: decl.availableOffline ?? true
20
+ };
21
+ return {
22
+ kind: "local",
23
+ id,
24
+ slug,
25
+ name: decl.name ?? decl.slug,
26
+ icon: resolveImageRef(projectRoot, decl.icon, {
27
+ maxBytes: DRIVE_ICON_MAX_BYTES,
28
+ warn: (m) => console.warn(m)
29
+ }),
30
+ preferredEditor: decl.preferredEditor,
31
+ sharingType: decl.sharingType ?? "public",
32
+ availableOffline: decl.availableOffline ?? true
28
33
  };
29
- if (descriptor.kind === "remote") {
30
- const url = backend.remote?.url;
31
- 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.`);
32
- descriptor.remote = { url };
33
- return descriptor;
34
- }
35
- if (backend.storage) descriptor.storage = projectStorage(name, backend.storage);
36
- if (backend.packages) descriptor.packages = backend.packages;
37
- if (protocol?.featureFlags) descriptor.featureFlags = protocol.featureFlags;
38
- return descriptor;
39
34
  }
40
- /** All named backends, in placement-primary-first order (the order a
41
- * createReactorClients step would provision them). */
42
- function backendsToDescriptors(reactor) {
43
- const backends = reactor?.backends;
44
- if (!backends) return [];
45
- const names = Object.keys(backends);
46
- const primary = reactor.placement?.primary;
47
- return (primary && names.includes(primary) ? [primary, ...names.filter((n) => n !== primary)] : names).map((name) => backendToDescriptor(name, backends[name], reactor.protocol));
35
+ /** Idempotent, slug-keyed: an existing slug is left untouched (never
36
+ * recreated, never mutated — preserveStrategy refinements live here later). */
37
+ async function seedDrives(client, drives) {
38
+ const result = {
39
+ created: [],
40
+ existing: [],
41
+ attached: []
42
+ };
43
+ for (const drive of drives) {
44
+ if (drive.kind === "remote") {
45
+ await client.attachRemoteDrive(drive.remoteUrl);
46
+ result.attached.push(drive.slug);
47
+ continue;
48
+ }
49
+ if (await client.findDriveBySlug(drive.slug) !== void 0) {
50
+ result.existing.push(drive.slug);
51
+ continue;
52
+ }
53
+ await client.createDrive(drive);
54
+ result.created.push(drive.slug);
55
+ }
56
+ return result;
48
57
  }
49
- const LOCAL_KINDS = /* @__PURE__ */ new Set([
50
- "in-process",
51
- "worker",
52
- void 0
53
- ]);
54
- /**
55
- * Structural multi-reactor (phase 4): true when the block names BOTH a local
56
- * backend (in-process/worker — the tab's own reactor) and a remote one. This
57
- * is the shape Connect's routing client serves; a lone remote backend is an
58
- * attach-only host (assistant/agent shape), not a routed tab.
59
- */
60
- function isStructuralMultiReactor(reactor) {
61
- const backends = reactor?.backends;
62
- if (!backends) return false;
63
- const kinds = Object.values(backends).map((b) => b.kind);
64
- return kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === "remote");
58
+ /** Merge host-declared drives with plugin contributions, slug-keyed — the
59
+ * host file wins on conflicts (it is the most explicit source). */
60
+ function mergeDrivePlan(projectRoot, hostDeclared, contributed) {
61
+ const plan = /* @__PURE__ */ new Map();
62
+ for (const { declaration, source } of contributed) {
63
+ const drive = resolveDriveDeclaration(projectRoot, declaration);
64
+ plan.set(drive.slug, {
65
+ drive,
66
+ source
67
+ });
68
+ }
69
+ for (const declaration of hostDeclared) {
70
+ const drive = resolveDriveDeclaration(projectRoot, declaration);
71
+ plan.set(drive.slug, {
72
+ drive,
73
+ source: "host"
74
+ });
75
+ }
76
+ return [...plan.values()];
65
77
  }
66
- /** The remote backends' urls, placement order — what the routing client dials. */
67
- function remoteBackendUrls(reactor) {
68
- return backendsToDescriptors(reactor).filter((d) => d.kind === "remote").map((d) => d.remote?.url).filter((u) => typeof u === "string");
78
+ function explainDrivePlan(plan) {
79
+ if (plan.length === 0) return "(no drives declared)";
80
+ return ["drives:", ...plan.map(({ drive, source }) => {
81
+ const kind = drive.kind === "remote" ? `remote ${drive.remoteUrl}` : "local";
82
+ const editor = drive.preferredEditor ? ` editor=${drive.preferredEditor}` : "";
83
+ return ` ${drive.slug} (${kind}, id=${drive.id}${editor}) [${source}]`;
84
+ })].join("\n");
69
85
  }
70
86
  //#endregion
71
87
  //#region src/reactor-config.ts
@@ -115,11 +131,7 @@ function projectReactorToSwitchboard(reactor) {
115
131
  options
116
132
  };
117
133
  }
118
- const LOCAL_BACKEND_KINDS = /* @__PURE__ */ new Set([
119
- "in-process",
120
- "worker",
121
- void 0
122
- ]);
134
+ const LOCAL_BACKEND_KINDS = /* @__PURE__ */ new Set(["in-process", "worker"]);
123
135
  /**
124
136
  * Which reactor client the backend topology asks for:
125
137
  * - local (in-process/worker) AND remote backends -> `router`
@@ -172,54 +184,268 @@ function assertProtocolConsistency(protocol, env, hostFile = "the host file") {
172
184
  }
173
185
  }
174
186
  //#endregion
175
- //#region src/plugins-resolve.ts
187
+ //#region src/backend-projection.ts
188
+ function projectStorage(name, storage) {
189
+ switch (storage.kind) {
190
+ case "idb": return { kind: "idb" };
191
+ case "memory": return { kind: "memory" };
192
+ case "path":
193
+ if (!storage.dataDir) throw new Error(`Backend "${name}": storage kind "path" requires dataDir.`);
194
+ return {
195
+ kind: "path",
196
+ dataDir: storage.dataDir
197
+ };
198
+ 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.`);
199
+ }
200
+ }
201
+ /** One backend → one descriptor. The protocol's featureFlags ride every
202
+ * descriptor (they are fleet consensus, not per-backend). A remote backend
203
+ * must carry remote.url — provision() requires it. */
204
+ function backendToDescriptor(name, backend, protocol) {
205
+ const descriptor = {
206
+ kind: backend.kind,
207
+ name
208
+ };
209
+ if (descriptor.kind === "remote") {
210
+ const url = backend.remote?.url;
211
+ 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.`);
212
+ descriptor.remote = { url };
213
+ return descriptor;
214
+ }
215
+ if (backend.storage) descriptor.storage = projectStorage(name, backend.storage);
216
+ if (backend.packages) descriptor.packages = backend.packages;
217
+ if (protocol?.featureFlags) descriptor.featureFlags = protocol.featureFlags;
218
+ return descriptor;
219
+ }
220
+ /** All named backends, in placement-primary-first order (the order a
221
+ * createReactorClients step would provision them). */
222
+ function backendsToDescriptors(reactor) {
223
+ const backends = reactor?.backends;
224
+ if (!backends) return [];
225
+ const names = Object.keys(backends);
226
+ const primary = reactor.placement?.primary;
227
+ return (primary && names.includes(primary) ? [primary, ...names.filter((n) => n !== primary)] : names).map((name) => backendToDescriptor(name, backends[name], reactor.protocol));
228
+ }
229
+ const LOCAL_KINDS = /* @__PURE__ */ new Set(["in-process", "worker"]);
230
+ /**
231
+ * Structural multi-reactor (phase 4): true when the block names BOTH a local
232
+ * backend (in-process/worker — the tab's own reactor) and a remote one. This
233
+ * is the shape Connect's routing client serves; a lone remote backend is an
234
+ * attach-only host (assistant/agent shape), not a routed tab.
235
+ */
236
+ function isStructuralMultiReactor(reactor) {
237
+ const backends = reactor?.backends;
238
+ if (!backends) return false;
239
+ const kinds = Object.values(backends).map((b) => b.kind);
240
+ return kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === "remote");
241
+ }
242
+ /** The remote backends' urls, placement order — what the routing client dials. */
243
+ function remoteBackendUrls(reactor) {
244
+ return backendsToDescriptors(reactor).filter((d) => d.kind === "remote").map((d) => d.remote?.url).filter((u) => typeof u === "string");
245
+ }
246
+ //#endregion
247
+ //#region src/connect-projection.ts
176
248
  /**
177
- * NODE-ONLY plugin resolution (split from plugins.ts so the pure runner core
178
- * stays browser-safe for ConnectCore — R3). Resolves host.js entries from the
179
- * PROJECT dependency tree, exactly like runner modules.
249
+ * Instance-fact projection for compound hosts: the drives a compound's
250
+ * reactor member created, projected into the Connect member's runtime-config
251
+ * override. Pure functions, moved from ph-cli's vetra service so the generic
252
+ * compound and the classic path share one implementation.
180
253
  */
181
- function isHostPluginShape(value) {
182
- return value !== null && typeof value === "object" && typeof value.name === "string";
254
+ function isLocalDrive(drive) {
255
+ return "local" in drive;
183
256
  }
257
+ const driveKey = (drive) => isLocalDrive(drive) ? `local:${drive.id}` : drive.url;
184
258
  /**
185
- * Resolve host.js plugin entries into live plugins for one host boot:
186
- * verb-filter → module resolution from the project tree (default condition,
187
- * like runners) → factory/object contract → config validation → appliesTo.
259
+ * Concatenate groups of `connect.drives.defaultDrives` in the order given,
260
+ * de-duplicating by drive identity (URL for remote entries, id for local
261
+ * ones). The first occurrence of a drive wins, so earlier groups keep their
262
+ * position and metadata — e.g. the Vetra drive `ph vetra` starts stays first
263
+ * even when the project's `powerhouse.config.json` lists the same drive.
188
264
  */
189
- async function resolveHostPlugins(projectRoot, hostType, verb, entries, where) {
190
- const normalized = normalizePluginEntries(entries, where);
191
- const projectRequire = createRequire(pathToFileURL(path.join(projectRoot, "package.json")).href);
192
- const resolved = [];
193
- for (const entry of normalized) {
194
- if (!entryActiveForVerb(entry, verb)) continue;
195
- let file;
196
- try {
197
- file = projectRequire.resolve(entry.module);
198
- } catch {
199
- throw new PluginError(`${where}: cannot resolve plugin "${entry.module}" from ${projectRoot}.`, "Plugins resolve from the project dependency tree, exactly like runner modules.");
200
- }
201
- const exported = (await import(pathToFileURL(file).href)).default;
202
- let plugin;
203
- if (typeof exported === "function") plugin = exported(entry.config);
204
- else if (isHostPluginShape(exported)) {
205
- if (Object.keys(entry.config).length > 0 && !exported.configSchema) throw new PluginError(`${where}: plugin "${entry.module}" takes no config, but the entry passes one.`);
206
- plugin = exported;
207
- } else throw new PluginError(`${where}: "${entry.module}" does not default-export a plugin object or factory.`, "Export `{ name, hooks?, contributions? }` or `(config) => plugin`.");
208
- if (plugin.configSchema) {
209
- const parsed = plugin.configSchema.safeParse(entry.config);
210
- if (!parsed.success) throw new PluginError(`${where}: config for plugin "${plugin.name}" is invalid:\n` + z.prettifyError(parsed.error));
211
- }
212
- const appliesTo = plugin.appliesTo ?? "reactor";
213
- if (!hostTypeSatisfies(hostType, appliesTo)) throw new PluginError(`${where}: plugin "${plugin.name}" applies to "${appliesTo}" hosts, but this host is "${hostType}".`);
214
- resolved.push({
215
- entry,
216
- plugin,
217
- provenance: "dependency"
218
- });
265
+ function mergeDefaultDrives(...groups) {
266
+ const seen = /* @__PURE__ */ new Set();
267
+ const out = [];
268
+ for (const group of groups) for (const drive of group) {
269
+ const key = driveKey(drive);
270
+ if (seen.has(key)) continue;
271
+ seen.add(key);
272
+ out.push(drive);
273
+ }
274
+ return out;
275
+ }
276
+ /**
277
+ * Rebase a local drive URL onto a public base: keeps the /d/<slug> path,
278
+ * swaps the loopback origin for the public base. Browser clients behind a
279
+ * reverse proxy can't reach http://localhost:<port>. Non-loopback URLs
280
+ * (e.g. a remote drive) are already public and pass through unchanged, as do
281
+ * unparseable ones.
282
+ */
283
+ function rebaseDriveUrl(driveUrl, publicBase) {
284
+ let url;
285
+ try {
286
+ url = new URL(driveUrl);
287
+ } catch {
288
+ return driveUrl;
289
+ }
290
+ if (![
291
+ "localhost",
292
+ "127.0.0.1",
293
+ "[::1]"
294
+ ].includes(url.hostname)) return driveUrl;
295
+ return `${publicBase.replace(/\/+$/, "")}${url.pathname}`;
296
+ }
297
+ /**
298
+ * The compound's drives projection: created drives first (rebased onto the
299
+ * public base when given), then the project's configured drives, de-duplicated
300
+ * — and `preserve-all`, because compound-injected drive lists change per
301
+ * launch context and must never detach drives the user added by hand.
302
+ */
303
+ function projectDrivesIntoConnect(input) {
304
+ return { drives: {
305
+ defaultDrives: mergeDefaultDrives(input.createdDriveUrls.filter((url) => typeof url === "string" && url.length > 0).map((url) => ({
306
+ url: input.publicBase ? rebaseDriveUrl(url, input.publicBase) : url,
307
+ name: null,
308
+ icon: null
309
+ })), input.configuredDefaultDrives ?? []),
310
+ preserveStrategy: "preserve-all"
311
+ } };
312
+ }
313
+ //#endregion
314
+ //#region src/expect-host.ts
315
+ function isRecord(value) {
316
+ return typeof value === "object" && value !== null && !Array.isArray(value);
317
+ }
318
+ function runnerOf(host) {
319
+ return isRecord(host.runner) ? host.runner : {};
320
+ }
321
+ function defaultVerbOf(host) {
322
+ const verb = runnerOf(host).defaultVerb;
323
+ return typeof verb === "string" ? verb : void 0;
324
+ }
325
+ /** At compound verb "run" each member runs its own defaultVerb; any other
326
+ * compound verb is forwarded uniformly (compound.ts `memberVerbOf`). */
327
+ function memberVerb(compoundVerb, member) {
328
+ return compoundVerb === "run" ? defaultVerbOf(member) ?? "run" : compoundVerb;
329
+ }
330
+ /** Backend names, placement-primary first (`backendsToDescriptors` order). */
331
+ function orderedBackends(reactor) {
332
+ const backends = Object.entries(reactor.backends ?? {});
333
+ const primary = reactor.placement?.primary;
334
+ return [...backends.filter(([name]) => name === primary), ...backends.filter(([name]) => name !== primary)];
335
+ }
336
+ function expectBackend(name, backend, reactor) {
337
+ const out = {
338
+ name,
339
+ kind: backend.kind
340
+ };
341
+ if (backend.storage) out.storage = backend.storage.kind;
342
+ if (typeof backend.storage?.dataDir === "string") out.dataDir = backend.storage.dataDir;
343
+ try {
344
+ backendToDescriptor(name, backend, reactor.protocol);
345
+ } catch (error) {
346
+ out.provisionError = error instanceof Error ? error.message : String(error);
347
+ }
348
+ return out;
349
+ }
350
+ function expectDrive(declaration, source) {
351
+ if (typeof declaration.slug !== "string") return void 0;
352
+ const remote = isRecord(declaration.remote) ? declaration.remote : void 0;
353
+ const drive = {
354
+ slug: declaration.slug,
355
+ kind: remote ? "remote" : "local",
356
+ source
357
+ };
358
+ if (remote && typeof remote.url === "string") drive.url = remote.url;
359
+ if (typeof declaration.id === "string") drive.id = declaration.id;
360
+ const projectHash = declaration.projectHash;
361
+ if (typeof projectHash === "boolean" || projectHash === "id") drive.projectHash = projectHash;
362
+ return drive;
363
+ }
364
+ /** The key `mergeDrivePlan` merges on: the SERVED slug, which for
365
+ * `projectHash: true` is the hashed id (never equal to a plain slug). */
366
+ function servedSlugKey(drive) {
367
+ return drive.projectHash === true ? `${drive.slug}\0hashed` : drive.slug;
368
+ }
369
+ /** Contributions first, then host declarations; keyed by served slug, the
370
+ * host wins (and keeps the contribution's position), like `mergeDrivePlan`. */
371
+ function drivePlan(reactor, contributed) {
372
+ const plan = /* @__PURE__ */ new Map();
373
+ for (const { declaration, source } of contributed) {
374
+ const drive = expectDrive(declaration, source);
375
+ if (drive) plan.set(servedSlugKey(drive), drive);
376
+ }
377
+ for (const declaration of reactor?.drives ?? []) {
378
+ const drive = expectDrive(declaration, "host");
379
+ if (drive) plan.set(servedSlugKey(drive), drive);
380
+ }
381
+ return [...plan.values()];
382
+ }
383
+ /** Token facts of the host's OWN fields (a compound's `children` are its
384
+ * members' own). */
385
+ function tokenFacts(declared, kind) {
386
+ const own = kind === "compound" ? Object.fromEntries(Object.entries(declared).filter(([key]) => key !== "children")) : declared;
387
+ const sites = outputSitesOf(own);
388
+ const consumes = sites.map(({ path, ref, outputPath }) => ({
389
+ at: path,
390
+ host: ref.host,
391
+ ...ref.member !== void 0 ? { member: ref.member } : {},
392
+ path: outputPath
393
+ }));
394
+ return {
395
+ dependsOn: [...new Set(sites.map(({ ref }) => refKey(ref)))].sort(),
396
+ consumes,
397
+ env: [...new Set(envSitesOf(own).map(({ name }) => name))].sort()
398
+ };
399
+ }
400
+ function expectOwn(input, verb) {
401
+ const resolved = input.resolved ?? input.declared;
402
+ const expectation = {
403
+ name: typeof resolved.name === "string" ? resolved.name : "",
404
+ kind: input.kind,
405
+ verb,
406
+ ...tokenFacts(input.declared, input.kind)
407
+ };
408
+ if (input.kind !== "reactor") return expectation;
409
+ const reactor = isRecord(resolved.reactor) ? resolved.reactor : void 0;
410
+ const mode = reactorClientMode(reactor);
411
+ if (mode !== void 0) expectation.clientMode = mode;
412
+ expectation.multiReactor = isStructuralMultiReactor(reactor);
413
+ const backends = reactor ? orderedBackends(reactor) : [];
414
+ if (reactor && backends.length > 0) {
415
+ expectation.backends = backends.map(([name, backend]) => expectBackend(name, backend, reactor));
416
+ expectation.remotes = backends.flatMap(([, backend]) => backend.kind === "remote" && typeof backend.remote?.url === "string" ? [backend.remote.url] : []);
417
+ }
418
+ expectation.drives = drivePlan(reactor, input.contributed ?? []);
419
+ return expectation;
420
+ }
421
+ /**
422
+ * The expectation for one host. A reactor host's comes from its resolved
423
+ * reactor block and contributed drives; a compound's lists its members in
424
+ * plan order, each with the verb it runs at under the compound's own verb
425
+ * and the members it starts after.
426
+ */
427
+ function expectHost(input) {
428
+ const verb = defaultVerbOf(input.declared) ?? "run";
429
+ const expectation = expectOwn(input, verb);
430
+ if (input.kind !== "compound" || !input.members) return expectation;
431
+ const order = input.plan?.order ?? input.members.map((m) => m.key);
432
+ const edges = input.plan?.edges ?? [];
433
+ const byKey = new Map(input.members.map((m) => [m.key, m]));
434
+ const members = {};
435
+ for (const key of order) {
436
+ const member = byKey.get(key);
437
+ if (!member) continue;
438
+ members[key] = {
439
+ host: member.host,
440
+ ...expectOwn(member, memberVerb(verb, member.declared)),
441
+ after: [...new Set(edges.filter((e) => e.consumer === key).map((e) => e.producer))].sort()
442
+ };
219
443
  }
220
- return resolved;
444
+ expectation.startOrder = order.filter((key) => byKey.has(key));
445
+ expectation.members = members;
446
+ return expectation;
221
447
  }
222
448
  //#endregion
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 };
449
+ export { CONNECT_PLUGIN_OWNED_SLICES, CONNECT_RUNNER, HostLoadError, ONE_SHOT_VERBS, OUTPUTS_FILE, PlanError, PluginError, RunnerError, TOKEN_ESCAPE_KEY, TOKEN_KEYS, TokenResolutionError, assertProtocolConsistency, backendToDescriptor, backendsToDescriptors, buildDriveDeclarationSchema, checkOutputPaths, checkTokenSites, childWrapperSchema, childrenSchema, clearRunRecord, collectTokenSites, compoundHostSchema, compoundOutputSource, compoundWiringSchema, computeOutputsHash, concatTokenSchema, declaredGenericCompoundHostSchema, declaredHostSchemas, defaultUserDataDir, defineHostSchemas, describeHostOutputs, describeMapElements, describeToken, driveDeclarationSchema, drivesSchema, emitHostJsonSchema, emittedHostSchemas, entryActiveForVerb, envSitesOf, envTokenSchema, envTokenable, expectHost, explainDrivePlan, findDeadConnectConfig, findNonStaticValue, findRemovedForms, findToken, forbidRef, formatPath, genericCompoundHostSchema, getVerb, hostTypeSatisfies, isPidAlive, isSchemaLike, isStructuralMultiReactor, isToken, itemTokenSchema, keyTokenSchema, lintHostImportGraph, lintHostImports, lintOutputsFile, listRunRecords, listVerbs, loadHost, loadProducers, makeHostSchemas, mapTokenSchema, memberForRef, mergeContributions, mergeDefaultDrives, mergeDrivePlan, normalizePluginEntries, normalizePluginEntry, outputRefsOf, outputSitesOf, outputTokenSchema, planCompound, pluginEntryObjectSchema, pluginEntrySchema, primaryBackend, probeHostsFolder, probeRun, processResolveEnv, producerOutputsSchemas, profileSchema, projectDriveId, projectDriveIdWith, projectDrivesIntoConnect, projectReactorToConnect, projectReactorToSwitchboard, protocolEnv, reactorBackendKindSchema, reactorBackendSchema, reactorClientMode, reactorHostSchema, reactorProtocolSchema, reactorSchema, readOutputsFileHash, readProjectName, readRunRecord, rebaseDriveUrl, ref, refKey, refineStartOrder, registerHostType, remoteBackendUrls, renderTokens, resolveDriveDeclaration, resolveHostOutputs, resolveHostPlugins, resolveOrder, resolvePluginContributions, resolveRunnerModule, resolveUserDataPlaceholders, runCompound, runObserveHook, runObserveHookSequential, runProvideHook, runRecordMemberSchema, runRecordOutputSource, runRecordSchema, runTransformHook, runnerBaseSchema, runnerHandleSchema, runnerKindSchema, runnerOutputsSchema, scanHostImports, schemaAtPath, seedDrives, stripComments, substituteBuiltinEnv, toStartedHandle, tokenKeyOf, tokenSchema, tokenable, unwrapEscapes, validateDeclaredHost, validateHost, writeRunRecord };
224
450
 
225
451
  //# sourceMappingURL=index.mjs.map