@powerhousedao/host-core 6.2.3-dev.78 → 6.2.3-dev.80
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-Cfqa5Jal.mjs → compound-C7GuPnTP.mjs} +249 -14
- package/dist/compound-C7GuPnTP.mjs.map +1 -0
- package/dist/{compound-DXcOFNcC.d.mts → compound-fPleFc-P.d.mts} +53 -23
- package/dist/compound-fPleFc-P.d.mts.map +1 -0
- package/dist/{env-substitution-qS_lDcbn.mjs → env-substitution-CzlXbvQJ.mjs} +236 -10
- package/dist/env-substitution-CzlXbvQJ.mjs.map +1 -0
- package/dist/{host-schemas-B6DsXA0Y.d.mts → host-schemas-ByrS_x_Z.d.mts} +47 -24
- package/dist/host-schemas-ByrS_x_Z.d.mts.map +1 -0
- package/dist/index.d.mts +25 -11
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +19 -18
- package/dist/index.mjs.map +1 -1
- package/dist/{plugins-EFYLaYQi.d.mts → plugins-CUY86XvH.d.mts} +2 -2
- package/dist/{plugins-EFYLaYQi.d.mts.map → plugins-CUY86XvH.d.mts.map} +1 -1
- package/dist/plugins.d.mts +1 -1
- package/dist/projection.d.mts +23 -11
- package/dist/projection.d.mts.map +1 -1
- package/dist/projection.mjs +23 -20
- package/dist/projection.mjs.map +1 -1
- package/dist/runners/compound.d.mts +5 -3
- package/dist/runners/compound.d.mts.map +1 -1
- package/dist/runners/compound.mjs +1 -1
- package/dist/schema.d.mts +4 -3
- package/dist/schema.d.mts.map +1 -1
- package/dist/schema.mjs +3 -2
- package/dist/schema.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/compound-Cfqa5Jal.mjs.map +0 -1
- package/dist/compound-DXcOFNcC.d.mts.map +0 -1
- package/dist/env-substitution-qS_lDcbn.mjs.map +0 -1
- package/dist/host-schemas-B6DsXA0Y.d.mts.map +0 -1
package/dist/projection.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as OutputPath, _ as ReactorProtocol, c as HostDefinition, d as ReactorBackend, f as ReactorBackendKind, it as TokenKey, p as ReactorConfig, t as ChildWrapper, x as RunnerKind, y as ReactorStorageConfig } from "./host-schemas-ByrS_x_Z.mjs";
|
|
2
2
|
import { t as BuiltinEnv } from "./env-substitution-C_fVirPh.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { PHConnectDefaultDrive, PHConnectRuntimeConfig } from "@powerhousedao/shared/clis";
|
|
@@ -9,16 +9,28 @@ export declare function primaryBackend(reactor: ReactorConfig | undefined): Reac
|
|
|
9
9
|
/** The env vars a protocol block maps onto, with their string values. Only
|
|
10
10
|
* keys the block actually sets appear. */
|
|
11
11
|
export declare function protocolEnv(protocol: ReactorProtocol | undefined): Record<string, string>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
/** The switchboard config layer a reactor block maps to (the shape of
|
|
13
|
+
* `@powerhousedao/switchboard/config`'s input). Only keys the block sets. */
|
|
14
|
+
interface SwitchboardReactorLayer {
|
|
15
|
+
storage?: {
|
|
16
|
+
reactor?: {
|
|
17
|
+
url: string;
|
|
18
|
+
};
|
|
19
|
+
readModel?: {
|
|
20
|
+
url: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
protocol?: ReactorProtocol;
|
|
24
|
+
packages?: {
|
|
25
|
+
dynamic: true;
|
|
26
|
+
};
|
|
27
|
+
features?: {
|
|
28
|
+
workflows: boolean;
|
|
18
29
|
};
|
|
19
30
|
}
|
|
20
|
-
/**
|
|
21
|
-
|
|
31
|
+
/** The reactor block as a switchboard config layer. The reactor store and the
|
|
32
|
+
* read model are separate fields: `readModel.url` never moves the reactor. */
|
|
33
|
+
export declare function reactorBlockToSwitchboardConfig(reactor: ReactorConfig | undefined): SwitchboardReactorLayer;
|
|
22
34
|
/** The four reactor-client shapes a Connect host can select (mirrors the
|
|
23
35
|
* shared PHReactorClientMode; kept local to avoid an import cycle). */
|
|
24
36
|
type ReactorClientMode = "in-process" | "worker" | "remote" | "router";
|
|
@@ -116,7 +128,7 @@ export declare function backendsToDescriptors(reactor: ReactorConfig | undefined
|
|
|
116
128
|
* attach-only host (assistant/agent shape), not a routed tab.
|
|
117
129
|
*/
|
|
118
130
|
export declare function isStructuralMultiReactor(reactor: ReactorConfig | undefined): boolean;
|
|
119
|
-
/** The remote backends'
|
|
131
|
+
/** The remote backends' drive addresses, placement order. */
|
|
120
132
|
export declare function remoteBackendUrls(reactor: ReactorConfig | undefined): string[];
|
|
121
133
|
//#endregion
|
|
122
134
|
//#region src/child-wrapper.d.ts
|
|
@@ -603,6 +615,6 @@ interface MemberInput extends Omit<ExpectHostInput, "members" | "plan"> {
|
|
|
603
615
|
*/
|
|
604
616
|
export declare function expectHost(input: ExpectHostInput): HostExpectation;
|
|
605
617
|
//#endregion
|
|
606
|
-
export type { CompoundPlan, ConnectReactorProjection, ConsumedOutput, ContributedDriveInput, DeclaredIssue, DeferredResolution, DeferredToken, DriveProjectionInput, ExpectHostInput, ExpectedBackend, ExpectedDrive, HostExpectation, MemberDraft, MemberExpectation, MemberInput, OutputLookup, OutputRef, OutputSource, OutputsSchemaLookup, PlanEdge, PlanMember, ProjectedDescriptor, ProjectedStorage, ReactorClientMode, RemovedForm, ResolveOptions, ResolveSources, RunRecord, RunRecordMember, SelfMembers,
|
|
618
|
+
export type { CompoundPlan, ConnectReactorProjection, ConsumedOutput, ContributedDriveInput, DeclaredIssue, DeferredResolution, DeferredToken, DriveProjectionInput, ExpectHostInput, ExpectedBackend, ExpectedDrive, HostExpectation, MemberDraft, MemberExpectation, MemberInput, OutputLookup, OutputRef, OutputSource, OutputsSchemaLookup, PlanEdge, PlanMember, ProjectedDescriptor, ProjectedStorage, ReactorClientMode, RemovedForm, ResolveOptions, ResolveSources, RunRecord, RunRecordMember, SelfMembers, SwitchboardReactorLayer, TokenPosition, TokenSite };
|
|
607
619
|
export {};
|
|
608
620
|
//# sourceMappingURL=projection.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.mts","names":[],"sources":["../src/reactor-config.ts","../src/backend-projection.ts","../src/child-wrapper.ts","../src/connect-projection.ts","../src/run-record-schema.ts","../src/resolve/declared.ts","../src/resolve/plan.ts","../src/resolve/resolve.ts","../src/resolve/removed-forms.ts","../src/resolve/sources.ts","../src/resolve/walk.ts","../src/expect-host.ts"],"mappings":";;;;;;;wBA4BgB,eACd,SAAS,4BACR;;;wBA2Ba,YACd,UAAU,8BACT;
|
|
1
|
+
{"version":3,"file":"projection.d.mts","names":[],"sources":["../src/reactor-config.ts","../src/backend-projection.ts","../src/child-wrapper.ts","../src/connect-projection.ts","../src/run-record-schema.ts","../src/resolve/declared.ts","../src/resolve/plan.ts","../src/resolve/resolve.ts","../src/resolve/removed-forms.ts","../src/resolve/sources.ts","../src/resolve/walk.ts","../src/expect-host.ts"],"mappings":";;;;;;;wBA4BgB,eACd,SAAS,4BACR;;;wBA2Ba,YACd,UAAU,8BACT;;;UAmBc;EACf;IAAY;MAAY;;IAAe;MAAc;;;EACrD,WAAW;EACX;IAAa;;EACb;IAAa;;;;;wBAKC,gCACd,SAAS,4BACR;;;KAuBS;;;;;;;;;;wBAgBI,kBACd,SAAS,4BACR;UAYc;;EAEf;IACE,UAAU;IACV;MAAa;MAAyB,gBAAgB;;IACtD;MAAQ;;;;;;;;wBAQI,wBACd,SAAS,4BACR;;;;wBAsBa,kBACd,UAAU,6BACV,KAAK,SAAS,qCACd;;;;;;;;wBAuBc,0BACd,UAAU,6BACV,KAAK,oCACL;;;;;;;;;;;;;;KC7LU;EACN;;EACA;;EACA;EAAc;;UAEH;EACf;EACA;EACA,UAAU;EACV;IAAa;IAAiB;IAAkB;;EAChD;IACE;IACA;IACA;IACA;;EAEF;IAAW;;;;;;wBAgCG,oBACd,cACA,SAAS,gBACT,WAAW,kBACV;;;wBA2Ba,sB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;;;;;;wBAgKc,WAAW,OAAO,kBAAkB"}
|
package/dist/projection.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as runnerKindSchema, G as tokenSchema, W as tokenKeyOf, g as hostNameSchema, j as TOKEN_ESCAPE_KEY, n as substituteBuiltinEnv, t as isBuiltinEnvName } from "./env-substitution-CzlXbvQJ.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/reactor-config.ts
|
|
4
4
|
/** The single primary backend for phase-2 projection (multi-backend routing is
|
|
@@ -29,23 +29,22 @@ function protocolEnv(protocol) {
|
|
|
29
29
|
if (protocol.unsupportedStoredDocuments !== void 0) env.REACTOR_UNSUPPORTED_STORED_DOCUMENTS = protocol.unsupportedStoredDocuments;
|
|
30
30
|
return env;
|
|
31
31
|
}
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
/** The reactor block as a switchboard config layer. The reactor store and the
|
|
33
|
+
* read model are separate fields: `readModel.url` never moves the reactor. */
|
|
34
|
+
function reactorBlockToSwitchboardConfig(reactor) {
|
|
35
|
+
const layer = {};
|
|
35
36
|
const backend = primaryBackend(reactor);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (backend?.readModel?.url) options.dbPath = backend.readModel.url;
|
|
43
|
-
if (backend?.packages?.dynamic) env.DYNAMIC_MODEL_LOADING = "true";
|
|
44
|
-
if (reactor?.workflows !== void 0) env.PH_WORKFLOWS_ENABLED = reactor.workflows ? "1" : "0";
|
|
45
|
-
return {
|
|
46
|
-
env,
|
|
47
|
-
options
|
|
37
|
+
const storage = backend?.storage;
|
|
38
|
+
const reactorUrl = storage?.kind === "postgres" ? storage.url : storage?.dataDir;
|
|
39
|
+
const readModelUrl = backend?.readModel?.url;
|
|
40
|
+
if (reactorUrl || readModelUrl) layer.storage = {
|
|
41
|
+
...reactorUrl ? { reactor: { url: reactorUrl } } : {},
|
|
42
|
+
...readModelUrl ? { readModel: { url: readModelUrl } } : {}
|
|
48
43
|
};
|
|
44
|
+
if (reactor?.protocol) layer.protocol = reactor.protocol;
|
|
45
|
+
if (backend?.packages?.dynamic) layer.packages = { dynamic: true };
|
|
46
|
+
if (reactor?.workflows !== void 0) layer.features = { workflows: reactor.workflows };
|
|
47
|
+
return layer;
|
|
49
48
|
}
|
|
50
49
|
const LOCAL_BACKEND_KINDS = /* @__PURE__ */ new Set(["in-process", "worker"]);
|
|
51
50
|
/**
|
|
@@ -162,7 +161,7 @@ function isStructuralMultiReactor(reactor) {
|
|
|
162
161
|
const kinds = Object.values(backends).map((b) => b.kind);
|
|
163
162
|
return kinds.some((k) => LOCAL_KINDS.has(k)) && kinds.some((k) => k === "remote");
|
|
164
163
|
}
|
|
165
|
-
/** The remote backends'
|
|
164
|
+
/** The remote backends' drive addresses, placement order. */
|
|
166
165
|
function remoteBackendUrls(reactor) {
|
|
167
166
|
return backendsToDescriptors(reactor).filter((d) => d.kind === "remote").map((d) => d.remote?.url).filter((u) => typeof u === "string");
|
|
168
167
|
}
|
|
@@ -269,7 +268,7 @@ const runRecordMemberSchema = z.strictObject({
|
|
|
269
268
|
});
|
|
270
269
|
const runRecordSchema = z.strictObject({
|
|
271
270
|
version: z.literal(2),
|
|
272
|
-
host:
|
|
271
|
+
host: hostNameSchema,
|
|
273
272
|
projectName: z.string(),
|
|
274
273
|
kind: runnerKindSchema,
|
|
275
274
|
verb: z.string().min(1),
|
|
@@ -1331,7 +1330,11 @@ function checkReactor(reactor, base, found) {
|
|
|
1331
1330
|
const producer = typeof host === "string" ? host : "switchboard";
|
|
1332
1331
|
found.push({
|
|
1333
1332
|
path: `${base}reactor.backends.${name}.remote.host`,
|
|
1334
|
-
message: `remote: { host } was removed; use remote: { url: ${producer}.
|
|
1333
|
+
message: `remote: { host } was removed; use a drive address: remote: { url: ${producer}.drives.<slug>.url } with ${producer} from ../${producer}/outputs.js, or remote: { url: ${outputToken(producer, [
|
|
1334
|
+
"drives",
|
|
1335
|
+
"<slug>",
|
|
1336
|
+
"url"
|
|
1337
|
+
])} }.`
|
|
1335
1338
|
});
|
|
1336
1339
|
}
|
|
1337
1340
|
}
|
|
@@ -1546,6 +1549,6 @@ function expectHost(input) {
|
|
|
1546
1549
|
return expectation;
|
|
1547
1550
|
}
|
|
1548
1551
|
//#endregion
|
|
1549
|
-
export { PlanError, TokenResolutionError, applyChildWrapper, assertProtocolConsistency, backendToDescriptor, backendsToDescriptors, checkOutputPaths, checkTokenSites, collectTokenSites, compoundOutputSource, describeMapElements, describeToken, envSitesOf, expectHost, findRemovedForms, formatPath, isStructuralMultiReactor, memberForRef, mergeDefaultDrives, outputRefsOf, outputSitesOf, planCompound, primaryBackend, projectDrivesIntoConnect, projectReactorToConnect,
|
|
1552
|
+
export { PlanError, TokenResolutionError, applyChildWrapper, assertProtocolConsistency, backendToDescriptor, backendsToDescriptors, checkOutputPaths, checkTokenSites, collectTokenSites, compoundOutputSource, describeMapElements, describeToken, envSitesOf, expectHost, findRemovedForms, formatPath, isStructuralMultiReactor, memberForRef, mergeDefaultDrives, outputRefsOf, outputSitesOf, planCompound, primaryBackend, projectDrivesIntoConnect, projectReactorToConnect, protocolConflicts, protocolEnv, reactorBlockToSwitchboardConfig, reactorClientMode, rebaseDriveUrl, refKey, remoteBackendUrls, renderTokens, resolveHostOutputs, runRecordMemberSchema, runRecordSchema, schemaAtPath, unwrapEscapes };
|
|
1550
1553
|
|
|
1551
1554
|
//# sourceMappingURL=projection.mjs.map
|