@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.
- package/dist/compound-B6RZMA0Y.mjs +2804 -0
- package/dist/compound-B6RZMA0Y.mjs.map +1 -0
- package/dist/compound-PhoVeqe1.d.mts +2401 -0
- package/dist/compound-PhoVeqe1.d.mts.map +1 -0
- package/dist/env-substitution-C_fVirPh.d.mts +17 -0
- package/dist/env-substitution-C_fVirPh.d.mts.map +1 -0
- package/dist/env-substitution-Dj3pdsut.mjs +330 -0
- package/dist/env-substitution-Dj3pdsut.mjs.map +1 -0
- package/dist/host-schemas-mqOYNGot.d.mts +2153 -0
- package/dist/host-schemas-mqOYNGot.d.mts.map +1 -0
- package/dist/index.d.mts +908 -691
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +335 -109
- package/dist/index.mjs.map +1 -1
- package/dist/plugins-XL6WsvTL.d.mts +182 -0
- package/dist/plugins-XL6WsvTL.d.mts.map +1 -0
- package/dist/plugins.d.mts +2 -120
- package/dist/plugins.mjs.map +1 -1
- package/dist/projection.d.mts +586 -0
- package/dist/projection.d.mts.map +1 -0
- package/dist/projection.mjs +1505 -0
- package/dist/projection.mjs.map +1 -0
- package/dist/runners/compound.d.mts +157 -12
- package/dist/runners/compound.d.mts.map +1 -1
- package/dist/runners/compound.mjs +5 -13
- package/dist/runners/compound.mjs.map +1 -1
- package/dist/schema.d.mts +105 -0
- package/dist/schema.d.mts.map +1 -0
- package/dist/schema.mjs +35 -0
- package/dist/schema.mjs.map +1 -0
- package/package.json +16 -4
- package/dist/compound-C8P0kvPJ.d.mts +0 -157
- package/dist/compound-C8P0kvPJ.d.mts.map +0 -1
- package/dist/host-schemas-CtPNRr5v.mjs +0 -720
- package/dist/host-schemas-CtPNRr5v.mjs.map +0 -1
- package/dist/plugins.d.mts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,62 +1,148 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { ContributionSource, Contributions, HostPlugin, HostPluginModule, MergedContribution, NormalizedPluginEntry, Observe, PluginEntry, PluginError, Provide, ResolvedPlugin, Transform, entryActiveForVerb, hostTypeSatisfies, mergeContributions, normalizePluginEntries, normalizePluginEntry, pluginEntrySchema, registerHostType, resolveOrder, runObserveHook, runObserveHookSequential, runProvideHook, runTransformHook } from "./plugins.mjs";
|
|
1
|
+
import { $ as childWrapperSchema, A as envSitesOf, At as TOKEN_KEYS, B as HostSchemas, Bt as findToken, C as validateDeclaredHost, Ct as KeyToken, D as OutputsSchemaLookup, Dt as RecordMapToken, E as OutputRef, Et as OutputToken, F as ChildWrapper, Ft as TokenMode, G as ReactorHost, Gt as mapTokenSchema, H as ReactorBackend, Ht as isToken, I as CompoundHost, It as TokenableSchema, J as ReactorProtocol, Jt as tokenKeyOf, K as ReactorHostInput, Kt as outputTokenSchema, L as CompoundHostInput, Lt as concatTokenSchema, M as outputSitesOf, Mt as Token, N as refKey, Nt as TokenFor, O as checkOutputPaths, Ot as RefFn, P as schemaAtPath, Pt as TokenKey, Q as RunnerKind, R as CompoundWiring, Rt as envTokenSchema, S as resolveRunnerModule, St as ItemToken, T as DeclaredIssue, Tt as OutputPath, U as ReactorBackendKind, Ut as itemTokenSchema, V as Profile, Vt as forbidRef, W as ReactorConfig, Wt as keyTokenSchema, X as ReactorStorageConfig, Xt as tokenable, Y as ReactorRemoteConfig, Yt as tokenSchema, Z as RunnerBase, _ as RunnerVerb, _t as runnerBaseSchema, a as RunnerHandleData, at as defineHostSchemas, b as isSchemaLike, bt as ConcatToken, c as toStartedHandle, ct as genericCompoundHostSchema, d as HostSchemaIssue, dt as reactorBackendKindSchema, et as childrenSchema, f as HostSchemaLike, ft as reactorBackendSchema, g as RunnerModule, gt as refineStartOrder, h as RunnerError, ht as reactorSchema, i as RunnerHandle, it as declaredHostSchemas, j as outputRefsOf, jt as Template, k as checkTokenSites, kt as TOKEN_ESCAPE_KEY, l as CONNECT_RUNNER, lt as makeHostSchemas, m as RunnerContext, mt as reactorProtocolSchema, n as RunCompoundResult, nt as compoundWiringSchema, o as StartedHandle, ot as emitHostJsonSchema, p as ONE_SHOT_VERBS, pt as reactorHostSchema, q as ReactorPackageConfig, qt as ref, r as runCompound, rt as declaredGenericCompoundHostSchema, s as runnerHandleSchema, st as emittedHostSchemas, t as RunCompoundOptions, tt as compoundHostSchema, u as DeclaredHostOptions, ut as profileSchema, v as ValidateHostOptions, vt as runnerKindSchema, w as validateHost, wt as MapToken, x as listVerbs, xt as EnvToken, y as getVerb, yt as ArrayMapToken, z as HostDefinition, zt as envTokenable } from "./compound-PhoVeqe1.mjs";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { PHConnectDefaultDrive, PHConnectRuntimeConfig } from "@powerhousedao/shared/clis";
|
|
5
|
-
//#region src/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* de-duplicating by drive identity (URL for remote entries, id for local
|
|
9
|
-
* ones). The first occurrence of a drive wins, so earlier groups keep their
|
|
10
|
-
* position and metadata — e.g. the Vetra drive `ph vetra` starts stays first
|
|
11
|
-
* even when the project's `powerhouse.config.json` lists the same drive.
|
|
12
|
-
*/
|
|
13
|
-
export declare function mergeDefaultDrives(...groups: PHConnectDefaultDrive[][]): PHConnectDefaultDrive[];
|
|
14
|
-
/**
|
|
15
|
-
* Rebase a local drive URL onto a public base: keeps the /d/<slug> path,
|
|
16
|
-
* swaps the loopback origin for the public base. Browser clients behind a
|
|
17
|
-
* reverse proxy can't reach http://localhost:<port>. Non-loopback URLs
|
|
18
|
-
* (e.g. a remote drive) are already public and pass through unchanged, as do
|
|
19
|
-
* unparseable ones.
|
|
20
|
-
*/
|
|
21
|
-
export declare function rebaseDriveUrl(driveUrl: string, publicBase: string): string;
|
|
22
|
-
interface DriveProjectionInput {
|
|
23
|
-
/** Drive URLs the compound's reactor member created, in display order
|
|
24
|
-
* (e.g. vetra, preview, workflows). Null/undefined entries are skipped. */
|
|
25
|
-
createdDriveUrls: (string | null | undefined)[];
|
|
26
|
-
/** The project's configured `connect.drives.defaultDrives`. */
|
|
27
|
-
configuredDefaultDrives?: PHConnectDefaultDrive[];
|
|
28
|
-
/** `--drives-public-base`: advertise proxy-reachable URLs to the browser. */
|
|
29
|
-
publicBase?: string | null;
|
|
4
|
+
//#region src/host-loader.d.ts
|
|
5
|
+
export declare class HostLoadError extends Error {
|
|
6
|
+
constructor(message: string, hint?: string);
|
|
30
7
|
}
|
|
8
|
+
type HostsFolderStatus = {
|
|
9
|
+
kind: "absent";
|
|
10
|
+
} | {
|
|
11
|
+
kind: "empty";
|
|
12
|
+
dir: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "present";
|
|
15
|
+
dir: string;
|
|
16
|
+
hosts: string[];
|
|
17
|
+
};
|
|
18
|
+
/** A `hosts/` folder with no `<name>/host.js` inside is "empty" — the guard
|
|
19
|
+
* state: callers warn loudly and fall back to legacy rather than activating
|
|
20
|
+
* the new architecture off a stray `mkdir hosts`. */
|
|
21
|
+
export declare function probeHostsFolder(projectRoot: string): HostsFolderStatus;
|
|
22
|
+
/** The generated per-host token tree (`ph generate hosts`). */
|
|
23
|
+
export declare const OUTPUTS_FILE = "outputs.js";
|
|
24
|
+
/** Blank out `//` and block comments, keeping string and template literals
|
|
25
|
+
* (URLs contain `//`) and every newline, so line-anchored checks still see
|
|
26
|
+
* the code's own lines. A JSDoc `import("…")` type is a comment, not code. */
|
|
27
|
+
export declare function stripComments(source: string): string;
|
|
28
|
+
/** The imports a host file makes, after linting it. */
|
|
29
|
+
interface HostImports {
|
|
30
|
+
/** Sibling hosts whose `host.js` the file imports. */
|
|
31
|
+
hosts: string[];
|
|
32
|
+
/** Sibling hosts whose generated `outputs.js` the file imports. */
|
|
33
|
+
outputs: string[];
|
|
34
|
+
}
|
|
35
|
+
/** Lints a host file and returns what it imports. Rejects every import
|
|
36
|
+
* except the project's powerhouse.config.json, SIBLING host files (R1:
|
|
37
|
+
* derived compositions) and sibling generated outputs.js token trees; any
|
|
38
|
+
* dynamic `import(...)` or `require(...)`; and any `process.` access.
|
|
39
|
+
* Source-level enforcement: the JSON round trip below is the hard gate; this
|
|
40
|
+
* one produces the better error. */
|
|
41
|
+
export declare function scanHostImports(rawSource: string, file: string): HostImports;
|
|
42
|
+
/** {@link scanHostImports}, returning only the sibling host names (for cycle
|
|
43
|
+
* detection). */
|
|
44
|
+
export declare function lintHostImports(rawSource: string, file: string): string[];
|
|
45
|
+
/** A generated `outputs.js` is plain data: no imports of any kind, no
|
|
46
|
+
* dynamic import/require, no `process.`. */
|
|
47
|
+
export declare function lintOutputsFile(rawSource: string, file: string): void;
|
|
48
|
+
/** Walks the sibling-import graph from `hostName`, linting every visited file
|
|
49
|
+
* (and every outputs.js it imports) and failing on a cycle (an ESM circular
|
|
50
|
+
* would otherwise surface as an undefined default export with no useful
|
|
51
|
+
* message). Returns the hosts whose outputs.js the graph imports, sorted. */
|
|
52
|
+
export declare function lintHostImportGraph(hostsDir: string, hostName: string): string[];
|
|
53
|
+
/** Returns the path of the first value that would not survive a JSON round
|
|
54
|
+
* trip, or undefined when the object is fully static. */
|
|
55
|
+
export declare function findNonStaticValue(value: unknown, trail?: string): string | undefined;
|
|
56
|
+
interface LoadedHost {
|
|
57
|
+
name: string;
|
|
58
|
+
dir: string;
|
|
59
|
+
file: string;
|
|
60
|
+
host: HostDefinition;
|
|
61
|
+
}
|
|
62
|
+
export declare function loadHost(projectRoot: string, hostName: string): Promise<LoadedHost>;
|
|
63
|
+
/** What `ph generate hosts` derives a host's outputs.js from, plus the hash
|
|
64
|
+
* of exactly those inputs (embedded in the file; the loader recomputes it). */
|
|
65
|
+
interface HostOutputsDescription {
|
|
66
|
+
/** The producer's folder name: the `host` of every `$output` token. */
|
|
67
|
+
host: string;
|
|
68
|
+
runnerModule: string;
|
|
69
|
+
/** JSON Schema of the runner's `outputsSchema` (output side, no `$schema`). */
|
|
70
|
+
outputsSchema: Record<string, unknown>;
|
|
71
|
+
/** Declared LOCAL drive slugs: `reactor.drives` without remote drives,
|
|
72
|
+
* plus drives the host's plugins contribute (any verb). Sorted, unique.
|
|
73
|
+
* These are the known keys of the `drives` record output. */
|
|
74
|
+
drives: string[];
|
|
75
|
+
hash: string;
|
|
76
|
+
}
|
|
77
|
+
/** The hash a generated outputs.js carries, or undefined. */
|
|
78
|
+
export declare function readOutputsFileHash(source: string): string | undefined;
|
|
79
|
+
/** sha256 over the canonical JSON of the generator's inputs. The host name
|
|
80
|
+
* is one: every token in the file carries it, so a copied or renamed host
|
|
81
|
+
* folder makes its outputs.js stale. */
|
|
82
|
+
export declare function computeOutputsHash(input: {
|
|
83
|
+
host: string;
|
|
84
|
+
runnerModule: string;
|
|
85
|
+
outputsSchema: Record<string, unknown>;
|
|
86
|
+
drives: readonly string[];
|
|
87
|
+
}): string;
|
|
31
88
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
89
|
+
* Describes the outputs a host's creation produces, for `ph generate hosts`
|
|
90
|
+
* and the loader's staleness check: the runner's `outputsSchema` as JSON
|
|
91
|
+
* Schema and the host's declared local drives (the keys `drives.<slug>` of a
|
|
92
|
+
* switchboard-like runner). Returns undefined when the runner exports no
|
|
93
|
+
* `outputsSchema` (the host produces nothing a token can reference).
|
|
94
|
+
*
|
|
95
|
+
* Plugin-contributed drives are collected across every verb (verb scoping
|
|
96
|
+
* is ignored: a drive any verb serves is referenceable). Plugins the project
|
|
97
|
+
* tree cannot resolve contribute nothing, exactly as at boot. The implicit
|
|
98
|
+
* default drive a switchboard serves when it declares none is NOT a known
|
|
99
|
+
* key (it is not declared); reach it with a literal `$output` token.
|
|
36
100
|
*/
|
|
37
|
-
export declare function
|
|
101
|
+
export declare function describeHostOutputs(projectRoot: string, hostName: string): Promise<HostOutputsDescription | undefined>;
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/run-record-schema.d.ts
|
|
104
|
+
export declare const runRecordMemberSchema: z.ZodObject<{
|
|
105
|
+
host: z.ZodString;
|
|
106
|
+
runnerModule: z.ZodString;
|
|
107
|
+
kind: z.ZodEnum<{
|
|
108
|
+
compound: "compound";
|
|
109
|
+
reactor: "reactor";
|
|
110
|
+
}>;
|
|
111
|
+
verb: z.ZodString;
|
|
112
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export declare const runRecordSchema: z.ZodObject<{
|
|
115
|
+
version: z.ZodLiteral<2>;
|
|
116
|
+
host: z.ZodString;
|
|
117
|
+
projectName: z.ZodString;
|
|
118
|
+
kind: z.ZodEnum<{
|
|
119
|
+
compound: "compound";
|
|
120
|
+
reactor: "reactor";
|
|
121
|
+
}>;
|
|
122
|
+
verb: z.ZodString;
|
|
123
|
+
pid: z.ZodNumber;
|
|
124
|
+
startedAt: z.ZodString;
|
|
125
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
126
|
+
members: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
127
|
+
host: z.ZodString;
|
|
128
|
+
runnerModule: z.ZodString;
|
|
129
|
+
kind: z.ZodEnum<{
|
|
130
|
+
compound: "compound";
|
|
131
|
+
reactor: "reactor";
|
|
132
|
+
}>;
|
|
133
|
+
verb: z.ZodString;
|
|
134
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
135
|
+
}, z.core.$strict>>>;
|
|
136
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
type RunRecord = z.infer<typeof runRecordSchema>;
|
|
139
|
+
type RunRecordMember = z.infer<typeof runRecordMemberSchema>;
|
|
38
140
|
//#endregion
|
|
39
141
|
//#region src/run-record.d.ts
|
|
40
142
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* the generic form of ph-cli's vetra-runtime record; the compound writes one
|
|
44
|
-
* per supervised host and (for compatibility) keeps the legacy
|
|
45
|
-
* vetra-runtime.json in step while agent tooling still reads it (D1.c).
|
|
143
|
+
* Record I/O for `.ph/run/<host>.json`, keyed by host name so N hosts
|
|
144
|
+
* (vetra, desktop, …) coexist. The record shape is run-record-schema.ts (v2).
|
|
46
145
|
*/
|
|
47
|
-
interface RunRecordMember {
|
|
48
|
-
port?: number;
|
|
49
|
-
url?: string;
|
|
50
|
-
}
|
|
51
|
-
interface RunRecord {
|
|
52
|
-
pid: number;
|
|
53
|
-
hostName: string;
|
|
54
|
-
projectName: string;
|
|
55
|
-
startedAt: string;
|
|
56
|
-
members: Record<string, RunRecordMember>;
|
|
57
|
-
/** Host-specific extras (e.g. mcpUrl) a runner wants in the record. */
|
|
58
|
-
extra?: Record<string, unknown>;
|
|
59
|
-
}
|
|
60
146
|
type RunProbe = {
|
|
61
147
|
status: "none";
|
|
62
148
|
} | {
|
|
@@ -70,6 +156,11 @@ type RunProbe = {
|
|
|
70
156
|
record: RunRecord;
|
|
71
157
|
};
|
|
72
158
|
export declare function readRunRecord(projectDir: string, hostName: string): RunRecord | undefined;
|
|
159
|
+
/** Every valid v2 record under `.ph/run/` (invalid and v1 files skipped). */
|
|
160
|
+
export declare function listRunRecords(projectDir: string): RunRecord[];
|
|
161
|
+
/** The project identity the live/foreign probe compares: package.json
|
|
162
|
+
* `name`, else the folder name. */
|
|
163
|
+
export declare function readProjectName(projectDir: string): string;
|
|
73
164
|
export declare function writeRunRecord(projectDir: string, record: RunRecord): void;
|
|
74
165
|
export declare function clearRunRecord(projectDir: string, hostName: string): void;
|
|
75
166
|
export declare function isPidAlive(pid: number): boolean;
|
|
@@ -101,60 +192,390 @@ export declare function defaultUserDataDir(projectRoot: string, env?: Record<str
|
|
|
101
192
|
* Non-strings pass through; the input is never mutated. */
|
|
102
193
|
export declare function resolveUserDataPlaceholders<T>(value: T, userData: string): T;
|
|
103
194
|
//#endregion
|
|
104
|
-
//#region src/
|
|
195
|
+
//#region src/host-types.d.ts
|
|
196
|
+
declare global {
|
|
197
|
+
/** `"<runner specifier>": { host: <z.input of its hostSchema>; outputs:
|
|
198
|
+
* <z.infer of its outputsSchema> }`, one entry per runner module. */
|
|
199
|
+
interface PHHostRunners {}
|
|
200
|
+
/** `"<plugin specifier>": <z.input of its configSchema>`. */
|
|
201
|
+
interface PHPluginConfigs {}
|
|
202
|
+
}
|
|
203
|
+
type RunnerSpecifier = keyof PHHostRunners & string;
|
|
204
|
+
type PluginSpecifier = keyof PHPluginConfigs & string;
|
|
205
|
+
/** A runner's host input with `runner.plugins` typed as authoring
|
|
206
|
+
* {@link PluginEntry}s (the zod input type only knows the untyped data
|
|
207
|
+
* shape), so a known plugin's config is checked against its own type. */
|
|
208
|
+
type WithTypedPlugins<H, M extends string> = H extends {
|
|
209
|
+
runner: infer R;
|
|
210
|
+
} ? Omit<H, "runner"> & {
|
|
211
|
+
runner: Omit<R, "module" | "plugins"> & {
|
|
212
|
+
module: M;
|
|
213
|
+
plugins?: PluginEntry[];
|
|
214
|
+
};
|
|
215
|
+
} : never;
|
|
216
|
+
/** Any host file, discriminated by `runner.module`. `never` until a runner
|
|
217
|
+
* package augments PHHostRunners. */
|
|
218
|
+
type PHHost = { [M in RunnerSpecifier]: PHHostRunners[M] extends {
|
|
219
|
+
host: infer H;
|
|
220
|
+
} ? WithTypedPlugins<H, M> : never; }[RunnerSpecifier];
|
|
221
|
+
/** The outputs a runner's creation produces, by specifier. */
|
|
222
|
+
type PHHostOutputs<M extends RunnerSpecifier> = PHHostRunners[M] extends {
|
|
223
|
+
outputs: infer O;
|
|
224
|
+
} ? O : never;
|
|
225
|
+
interface PluginEntryObject<M extends string, C> {
|
|
226
|
+
module: M;
|
|
227
|
+
/** Presence is activation by default; false is the explicit off-switch. */
|
|
228
|
+
enabled?: boolean;
|
|
229
|
+
/** "*" (default) or the run verbs this entry is active for. */
|
|
230
|
+
verbs?: "*" | string[];
|
|
231
|
+
config?: C;
|
|
232
|
+
}
|
|
233
|
+
type KnownPluginEntry = { [M in PluginSpecifier]: M | PluginEntryObject<M, PHPluginConfigs[M]>; }[PluginSpecifier];
|
|
234
|
+
/** A `runner.plugins` entry as an author writes it. A known specifier (one
|
|
235
|
+
* a package augments PHPluginConfigs with) carries its plugin's config type,
|
|
236
|
+
* and only that: the object fallback for other specifiers takes no config,
|
|
237
|
+
* because TS cannot express "any string but the known ones" and a
|
|
238
|
+
* `Record<string, unknown>` fallback would admit a known specifier with a
|
|
239
|
+
* wrong config. Any specifier may still be named bare, or as an object
|
|
240
|
+
* without config; a third-party plugin that takes config augments
|
|
241
|
+
* PHPluginConfigs (in its package, or in the project's hosts/types.d.ts). */
|
|
242
|
+
type PluginEntry = KnownPluginEntry | string | PluginEntryObject<string, undefined>;
|
|
243
|
+
declare global {
|
|
244
|
+
interface PHHostRunners {
|
|
245
|
+
"@powerhousedao/host-core/runners/compound": {
|
|
246
|
+
host: z.input<typeof declaredGenericCompoundHostSchema>;
|
|
247
|
+
outputs: Record<string, never>;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/plugins.d.ts
|
|
105
253
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
254
|
+
* R1 — the host plugin framework (bridge-runners-to-plugins plan,
|
|
255
|
+
* customization-references/host-core as the blueprint).
|
|
256
|
+
*
|
|
257
|
+
* A plugin is hooks + contributions; hooks are boot wiring (main realm only),
|
|
258
|
+
* contributions are declarative, serializable surface. Host RUNTIMES define
|
|
259
|
+
* the hook vocabulary and interleave their own wiring between stages — they
|
|
260
|
+
* are never plugins themselves.
|
|
261
|
+
*
|
|
262
|
+
* host.js carries the COMPOSITION as `runner.plugins` entries:
|
|
263
|
+
* string | { module, enabled?, verbs?, config? }
|
|
264
|
+
* Presence is activation (enabled defaults true); `verbs` scopes an entry to
|
|
265
|
+
* matching run verbs; `config` is validated against the plugin's declared
|
|
266
|
+
* zod schema. Entries resolve from the PROJECT's dependency tree exactly
|
|
267
|
+
* like runner modules.
|
|
112
268
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
kind: "idb" | "memory" | "path" | "postgres";
|
|
116
|
-
dataDir?: string;
|
|
117
|
-
url?: string;
|
|
269
|
+
export declare class PluginError extends Error {
|
|
270
|
+
constructor(message: string, hint?: string);
|
|
118
271
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
272
|
+
export declare const pluginEntryObjectSchema: z.ZodObject<{
|
|
273
|
+
module: z.ZodString;
|
|
274
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
275
|
+
verbs: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
|
|
276
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
277
|
+
}, z.core.$strict>;
|
|
278
|
+
export declare const pluginEntrySchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
279
|
+
module: z.ZodString;
|
|
280
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
+
verbs: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
|
|
282
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
283
|
+
}, z.core.$strict>]>;
|
|
284
|
+
/** The validated (runtime) entry shape. Authors write `PluginEntry`
|
|
285
|
+
* (host-types.ts), which types known plugins' configs. */
|
|
286
|
+
type PluginEntryData = z.infer<typeof pluginEntrySchema>;
|
|
287
|
+
interface NormalizedPluginEntry {
|
|
288
|
+
module: string;
|
|
289
|
+
enabled: boolean;
|
|
290
|
+
verbs: "*" | string[];
|
|
291
|
+
config: Record<string, unknown>;
|
|
124
292
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
293
|
+
export declare function normalizePluginEntry(entry: PluginEntryData): NormalizedPluginEntry;
|
|
294
|
+
/** Module is the identity key: a duplicate makes override targeting and
|
|
295
|
+
* ordering ambiguous, so it fails loudly. */
|
|
296
|
+
export declare function normalizePluginEntries(entries: readonly PluginEntryData[], where: string): NormalizedPluginEntry[];
|
|
297
|
+
export declare function entryActiveForVerb(entry: NormalizedPluginEntry, verb: string): boolean;
|
|
298
|
+
export declare function registerHostType(id: string, parent: string | null): void;
|
|
299
|
+
export declare function hostTypeSatisfies(hostType: string, appliesTo: string): boolean;
|
|
300
|
+
/** Hook kinds (v1 §2.2). The hook VOCABULARY is defined by host runtimes;
|
|
301
|
+
* plugins implement subsets of it. */
|
|
302
|
+
type Provide<T, C> = (ctx: C) => T | Promise<T>;
|
|
303
|
+
type Transform<T, C> = (value: T, ctx: C) => T | Promise<T>;
|
|
304
|
+
type Observe<C> = (ctx: C) => void | Promise<void>;
|
|
305
|
+
/**
|
|
306
|
+
* Core contributions — declarative, serializable, realm-crossing. Host
|
|
307
|
+
* runtimes extend this with their own kinds (UI slots live in connect-host,
|
|
308
|
+
* never here). `drives` entries use the drive declaration shape from
|
|
309
|
+
* drives.ts; kept as unknown here to avoid a cycle — the merge is shape-blind.
|
|
310
|
+
*/
|
|
311
|
+
interface Contributions {
|
|
312
|
+
drives?: unknown[];
|
|
313
|
+
packages?: string[];
|
|
314
|
+
configDeclarations?: {
|
|
315
|
+
name: string;
|
|
316
|
+
type?: string;
|
|
317
|
+
description?: string;
|
|
318
|
+
}[];
|
|
319
|
+
[kind: string]: unknown[] | undefined;
|
|
128
320
|
}
|
|
129
|
-
interface
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
321
|
+
interface HostPlugin<THooks = Record<string, unknown>, TConfig = unknown> {
|
|
322
|
+
/** Stable id; used in ordering, dependsOn, and every diagnostic. */
|
|
323
|
+
name: string;
|
|
324
|
+
/** Host-type requirement; the entry is rejected on a host outside the
|
|
325
|
+
* hierarchy branch. Default: "reactor". */
|
|
326
|
+
appliesTo?: string;
|
|
327
|
+
/** Coarse ordering bucket (Vite-style). Default: "normal". */
|
|
328
|
+
enforce?: "pre" | "post";
|
|
329
|
+
/** Hard dependencies on OTHER PLUGINS — the host runtime is implied and
|
|
330
|
+
* never named. Missing dependency or cycle fails boot naming both sides. */
|
|
331
|
+
dependsOn?: string[];
|
|
332
|
+
/** Declared config shape; entry config is validated against it. A plugin
|
|
333
|
+
* without a schema accepts no config (passing one is a boot error). */
|
|
334
|
+
configSchema?: z.ZodType<TConfig>;
|
|
335
|
+
hooks?: Partial<THooks>;
|
|
336
|
+
contributions?: Contributions;
|
|
137
337
|
}
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
338
|
+
/** A plugin module default-exports either a HostPlugin object (no config
|
|
339
|
+
* accepted) or a factory `(config) => HostPlugin`. */
|
|
340
|
+
type HostPluginModule<THooks = Record<string, unknown>, TConfig = unknown> = HostPlugin<THooks, TConfig> | ((config: TConfig) => HostPlugin<THooks, TConfig>);
|
|
341
|
+
interface ResolvedPlugin<THooks = Record<string, unknown>> {
|
|
342
|
+
entry: NormalizedPluginEntry;
|
|
343
|
+
plugin: HostPlugin<THooks>;
|
|
344
|
+
/** Provenance for contribution merge ordering. */
|
|
345
|
+
provenance: "built-in" | "local" | "dependency";
|
|
346
|
+
}
|
|
347
|
+
/** Registration order, bucketed pre → normal → post (stable within buckets),
|
|
348
|
+
* then dependsOn topo-sorted within the bucketed order. */
|
|
349
|
+
export declare function resolveOrder<THooks>(plugins: readonly HostPlugin<THooks>[]): HostPlugin<THooks>[];
|
|
350
|
+
export declare function runProvideHook<T, C>(name: string, plugins: readonly HostPlugin[], ctx: C): Promise<T | undefined>;
|
|
351
|
+
export declare function runTransformHook<T, C>(name: string, plugins: readonly HostPlugin[], ctx: C, seed: T): Promise<T>;
|
|
352
|
+
/** Sequential observe, in plugin order — for lifecycle moments whose order
|
|
353
|
+
* is load-bearing (teardown: the switchboard stops privacy before workflows
|
|
354
|
+
* before the api, per the carve map). */
|
|
355
|
+
export declare function runObserveHookSequential<C>(name: string, plugins: readonly HostPlugin[], ctx: C): Promise<void>;
|
|
356
|
+
export declare function runObserveHook<C>(name: string, plugins: readonly HostPlugin[], ctx: C): Promise<void>;
|
|
357
|
+
interface ContributionSource {
|
|
358
|
+
pluginName: string;
|
|
359
|
+
provenance: "built-in" | "local" | "dependency";
|
|
360
|
+
}
|
|
361
|
+
interface MergedContribution<T = unknown> {
|
|
362
|
+
value: T;
|
|
363
|
+
source: ContributionSource;
|
|
364
|
+
}
|
|
365
|
+
/** Array kinds concatenate in provenance-then-order sequence (built-in first,
|
|
366
|
+
* so later sources read as overrides where consumers want last-wins). */
|
|
367
|
+
export declare function mergeContributions(resolved: readonly {
|
|
368
|
+
plugin: HostPlugin;
|
|
369
|
+
provenance: ContributionSource["provenance"];
|
|
370
|
+
}[]): Record<string, MergedContribution[]>;
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/plugins-resolve.d.ts
|
|
373
|
+
/**
|
|
374
|
+
* Resolve host.js plugin entries into live plugins for one host boot:
|
|
375
|
+
* verb-filter → module resolution from the project tree (default condition,
|
|
376
|
+
* like runners) → factory/object contract → config validation → appliesTo.
|
|
377
|
+
*/
|
|
378
|
+
export declare function resolveHostPlugins<THooks = Record<string, unknown>>(projectRoot: string, hostType: string, verb: string, entries: readonly PluginEntryData[], where: string): Promise<ResolvedPlugin<THooks>[]>;
|
|
379
|
+
/** A drive a plugin contributes: its declaration (drives.ts shape, validated
|
|
380
|
+
* by the consumer) and the plugin it came from. */
|
|
381
|
+
interface ContributedDrive {
|
|
382
|
+
declaration: Record<string, unknown>;
|
|
383
|
+
source: string;
|
|
384
|
+
}
|
|
385
|
+
interface PluginContributionsPlan {
|
|
386
|
+
drives: ContributedDrive[];
|
|
387
|
+
/** Entries whose module the project tree cannot resolve (e.g. Connect's
|
|
388
|
+
* browser built-ins, which have no Node-resolvable identity module). */
|
|
389
|
+
unresolved: string[];
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* LENIENT resolution for diagnostics (`ph run <host> --explain drives`):
|
|
393
|
+
* collects the drive contributions of the entries active for `verb`. Unlike
|
|
394
|
+
* resolveHostPlugins it does not know the host type (so appliesTo is not
|
|
395
|
+
* checked) and does not fail on a specifier the project tree cannot resolve
|
|
396
|
+
* — the entry is listed under `unresolved` instead. Config is still validated
|
|
397
|
+
* against the plugin's schema, so a bad entry surfaces here too.
|
|
398
|
+
*/
|
|
399
|
+
export declare function resolvePluginContributions(projectRoot: string, verb: string, entries: readonly PluginEntryData[], where: string): Promise<PluginContributionsPlan>;
|
|
400
|
+
/** One Connect config value a built-in Connect plugin owns. */
|
|
401
|
+
interface OwnedConfigSlice {
|
|
402
|
+
/** Dot path inside the connect config block, e.g. "drives.allowAddDrive". */
|
|
403
|
+
path: string;
|
|
404
|
+
/** What Connect serves at `path` while the owning plugin is absent from a
|
|
405
|
+
* declared composition (apps/connect plugin-host.ts zeroAbsentSlices). */
|
|
406
|
+
absent: unknown;
|
|
407
|
+
/** The owning plugin's entry config key that sets this value, when the
|
|
408
|
+
* plugin takes it as config; omitted where presence alone is the switch. */
|
|
409
|
+
entryKey?: string;
|
|
410
|
+
}
|
|
411
|
+
interface ConnectPluginSlices {
|
|
412
|
+
slices: OwnedConfigSlice[];
|
|
413
|
+
/** A slice whose unset or `absent` value leaves every slice of this plugin
|
|
414
|
+
* inert (OpenPanel tracking does nothing without a clientId), so nothing
|
|
415
|
+
* of it is reported as dead. */
|
|
416
|
+
inertUnless?: string;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* The connect config slices each built-in Connect plugin owns, by specifier
|
|
420
|
+
* (typed-host-configs 1.6). Under a declared composition Connect zeroes a
|
|
421
|
+
* slice whose plugin is absent — presence is activation — so an authored
|
|
422
|
+
* value there is dead config. Connect's built-ins are browser modules with no
|
|
423
|
+
* Node-resolvable identity, so their ownership is declared here as data; a
|
|
424
|
+
* Connect test pins it to plugin-host's zeroing.
|
|
425
|
+
*/
|
|
426
|
+
export declare const CONNECT_PLUGIN_OWNED_SLICES: Readonly<Record<string, ConnectPluginSlices>>;
|
|
427
|
+
interface DeadConfigWarning {
|
|
428
|
+
/** Dot path inside the connect config block. */
|
|
429
|
+
path: string;
|
|
430
|
+
/** The authored value. */
|
|
431
|
+
value: unknown;
|
|
432
|
+
/** What Connect serves instead. */
|
|
433
|
+
served: unknown;
|
|
434
|
+
/** The specifier of the plugin that owns the slice. */
|
|
435
|
+
owner: string;
|
|
436
|
+
message: string;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Dead-config warnings for a Connect host (typed-host-configs 1.6): an
|
|
440
|
+
* authored connect config value whose owning plugin is not in the
|
|
441
|
+
* composition active for `verb`. Connect zeroes such a slice, so the value
|
|
442
|
+
* has no effect — e.g. Sektar's `connect.drives.allowAddDrive: true` without
|
|
443
|
+
* the generic plugin.
|
|
444
|
+
*
|
|
445
|
+
* Nothing is reported when the host declares no composition
|
|
446
|
+
* (`runner.plugins` absent: the classic boot serves the config as is), or
|
|
447
|
+
* when Connect already serves every leaf of the authored value. Warnings, not
|
|
448
|
+
* errors: the host still boots, it just does not do what the value says.
|
|
449
|
+
*/
|
|
450
|
+
export declare function findDeadConnectConfig(config: Record<string, unknown> | undefined, entries: readonly PluginEntryData[] | undefined, verb: string, where: string): DeadConfigWarning[];
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region src/drive-schema.d.ts
|
|
453
|
+
/**
|
|
454
|
+
* The schema half of drives.ts, zod only so `./schema` stays neutral.
|
|
455
|
+
* - slug: the SEEDING KEY (idempotence); id optional (stable identity).
|
|
456
|
+
* - preferredEditor: stored at header.meta.preferredEditor; Connect config's
|
|
457
|
+
* `app` is the legacy alias.
|
|
458
|
+
* - remote.url: a drive served elsewhere; local fields are ignored for it.
|
|
459
|
+
* Token-able (`$output` on a producer's `drives.<slug>.url`).
|
|
460
|
+
*/
|
|
461
|
+
export declare function buildDriveDeclarationSchema(urlField: (schema: z.ZodString) => TokenableSchema<z.ZodString>): z.ZodObject<{
|
|
462
|
+
slug: z.ZodString;
|
|
463
|
+
id: z.ZodOptional<z.ZodString>;
|
|
464
|
+
projectHash: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"id">]>>;
|
|
465
|
+
name: z.ZodOptional<z.ZodString>;
|
|
466
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
467
|
+
preferredEditor: z.ZodOptional<z.ZodString>;
|
|
468
|
+
sharingType: z.ZodOptional<z.ZodEnum<{
|
|
469
|
+
private: "private";
|
|
470
|
+
public: "public";
|
|
471
|
+
shared: "shared";
|
|
472
|
+
}>>;
|
|
473
|
+
availableOffline: z.ZodOptional<z.ZodBoolean>;
|
|
474
|
+
remote: z.ZodOptional<z.ZodObject<{
|
|
475
|
+
url: TokenableSchema<z.ZodString>;
|
|
476
|
+
}, z.core.$strict>>;
|
|
477
|
+
}, z.core.$strict>;
|
|
478
|
+
export declare const driveDeclarationSchema: z.ZodObject<{
|
|
479
|
+
slug: z.ZodString;
|
|
480
|
+
id: z.ZodOptional<z.ZodString>;
|
|
481
|
+
projectHash: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"id">]>>;
|
|
482
|
+
name: z.ZodOptional<z.ZodString>;
|
|
483
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
484
|
+
preferredEditor: z.ZodOptional<z.ZodString>;
|
|
485
|
+
sharingType: z.ZodOptional<z.ZodEnum<{
|
|
486
|
+
private: "private";
|
|
487
|
+
public: "public";
|
|
488
|
+
shared: "shared";
|
|
489
|
+
}>>;
|
|
490
|
+
availableOffline: z.ZodOptional<z.ZodBoolean>;
|
|
491
|
+
remote: z.ZodOptional<z.ZodObject<{
|
|
492
|
+
url: TokenableSchema<z.ZodString>;
|
|
493
|
+
}, z.core.$strict>>;
|
|
494
|
+
}, z.core.$strict>;
|
|
495
|
+
type DriveDeclaration = z.infer<typeof driveDeclarationSchema>;
|
|
496
|
+
export declare const drivesSchema: z.ZodArray<z.ZodObject<{
|
|
497
|
+
slug: z.ZodString;
|
|
498
|
+
id: z.ZodOptional<z.ZodString>;
|
|
499
|
+
projectHash: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"id">]>>;
|
|
500
|
+
name: z.ZodOptional<z.ZodString>;
|
|
501
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
502
|
+
preferredEditor: z.ZodOptional<z.ZodString>;
|
|
503
|
+
sharingType: z.ZodOptional<z.ZodEnum<{
|
|
504
|
+
private: "private";
|
|
505
|
+
public: "public";
|
|
506
|
+
shared: "shared";
|
|
507
|
+
}>>;
|
|
508
|
+
availableOffline: z.ZodOptional<z.ZodBoolean>;
|
|
509
|
+
remote: z.ZodOptional<z.ZodObject<{
|
|
510
|
+
url: TokenableSchema<z.ZodString>;
|
|
511
|
+
}, z.core.$strict>>;
|
|
512
|
+
}, z.core.$strict>>;
|
|
513
|
+
/** The project-hashed drive id (`${slug}-${sha256(projectRoot)[0..8]}`) with
|
|
514
|
+
* the hash function injected, so neutral consumers (a browser monitor) can
|
|
515
|
+
* pass `crypto.subtle`-derived or precomputed hex. drives.ts binds it to
|
|
516
|
+
* node:crypto as `projectDriveId`. */
|
|
517
|
+
export declare function projectDriveIdWith(sha256Hex: (input: string) => string, projectRoot: string, slug: string): string;
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region src/drives.d.ts
|
|
520
|
+
export declare function projectDriveId(projectRoot: string, slug: string): string;
|
|
521
|
+
interface ResolvedDrive {
|
|
522
|
+
kind: "local" | "remote";
|
|
523
|
+
id: string;
|
|
524
|
+
slug: string;
|
|
525
|
+
name: string;
|
|
526
|
+
icon?: string;
|
|
527
|
+
preferredEditor?: string;
|
|
528
|
+
sharingType: "public" | "private" | "shared";
|
|
529
|
+
availableOffline: boolean;
|
|
530
|
+
remoteUrl?: string;
|
|
531
|
+
}
|
|
532
|
+
export declare function resolveDriveDeclaration(projectRoot: string, decl: DriveDeclaration): ResolvedDrive;
|
|
533
|
+
/** The minimal client surface the seeder needs — runners adapt their reactor
|
|
534
|
+
* clients (IReactorClient, addDefaultDrive-style helpers) onto it. */
|
|
535
|
+
interface DriveSeederClient {
|
|
536
|
+
/** Return the existing drive's id for a slug, or undefined. */
|
|
537
|
+
findDriveBySlug(slug: string): Promise<string | undefined>;
|
|
538
|
+
/** Create a local drive; preferredEditor lands on header.meta. */
|
|
539
|
+
createDrive(drive: ResolvedDrive): Promise<void>;
|
|
540
|
+
/** Attach a remote drive by URL (idempotent on the client side). */
|
|
541
|
+
attachRemoteDrive(url: string): Promise<void>;
|
|
542
|
+
}
|
|
543
|
+
interface SeedResult {
|
|
544
|
+
created: string[];
|
|
545
|
+
existing: string[];
|
|
546
|
+
attached: string[];
|
|
547
|
+
}
|
|
548
|
+
/** Idempotent, slug-keyed: an existing slug is left untouched (never
|
|
549
|
+
* recreated, never mutated — preserveStrategy refinements live here later). */
|
|
550
|
+
export declare function seedDrives(client: DriveSeederClient, drives: readonly ResolvedDrive[]): Promise<SeedResult>;
|
|
551
|
+
interface DrivePlanEntry {
|
|
552
|
+
drive: ResolvedDrive;
|
|
553
|
+
/** "host" for host.js declarations; a plugin name for contributions. */
|
|
554
|
+
source: string;
|
|
555
|
+
}
|
|
556
|
+
/** Merge host-declared drives with plugin contributions, slug-keyed — the
|
|
557
|
+
* host file wins on conflicts (it is the most explicit source). */
|
|
558
|
+
export declare function mergeDrivePlan(projectRoot: string, hostDeclared: readonly DriveDeclaration[], contributed: readonly {
|
|
559
|
+
declaration: DriveDeclaration;
|
|
560
|
+
source: string;
|
|
561
|
+
}[]): DrivePlanEntry[];
|
|
562
|
+
export declare function explainDrivePlan(plan: readonly DrivePlanEntry[]): string;
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region src/env-substitution.d.ts
|
|
565
|
+
/**
|
|
566
|
+
* Pure built-in `$env` substitution: the `"${userData}"` / `"${projectRoot}"`
|
|
567
|
+
* string sugar, deep-applied to a JSON-shaped value. No node imports, so it
|
|
568
|
+
* ships in `./schema`; the node default for userData is placeholders.ts.
|
|
569
|
+
*/
|
|
570
|
+
interface BuiltinEnv {
|
|
571
|
+
userData?: string;
|
|
572
|
+
projectRoot?: string;
|
|
157
573
|
}
|
|
574
|
+
/** Deep-substitute the built-ins that `env` provides in every string; an
|
|
575
|
+
* absent built-in is left as written. The input is never mutated. */
|
|
576
|
+
export declare function substituteBuiltinEnv<T>(value: T, env: BuiltinEnv): T;
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region src/reactor-config.d.ts
|
|
158
579
|
/** The single primary backend for phase-2 projection (multi-backend routing is
|
|
159
580
|
* track R). Prefers placement.primary, else "main"/"local", else the first. */
|
|
160
581
|
export declare function primaryBackend(reactor: ReactorConfig | undefined): ReactorBackend | undefined;
|
|
@@ -267,615 +688,411 @@ export declare function isStructuralMultiReactor(reactor: ReactorConfig | undefi
|
|
|
267
688
|
/** The remote backends' urls, placement order — what the routing client dials. */
|
|
268
689
|
export declare function remoteBackendUrls(reactor: ReactorConfig | undefined): string[];
|
|
269
690
|
//#endregion
|
|
270
|
-
//#region src/
|
|
691
|
+
//#region src/connect-projection.d.ts
|
|
271
692
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
693
|
+
* Concatenate groups of `connect.drives.defaultDrives` in the order given,
|
|
694
|
+
* de-duplicating by drive identity (URL for remote entries, id for local
|
|
695
|
+
* ones). The first occurrence of a drive wins, so earlier groups keep their
|
|
696
|
+
* position and metadata — e.g. the Vetra drive `ph vetra` starts stays first
|
|
697
|
+
* even when the project's `powerhouse.config.json` lists the same drive.
|
|
277
698
|
*/
|
|
278
|
-
export declare
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
remote: "remote";
|
|
304
|
-
worker: "worker";
|
|
305
|
-
}>>;
|
|
306
|
-
storage: z.ZodOptional<z.ZodObject<{
|
|
307
|
-
kind: z.ZodEnum<{
|
|
308
|
-
idb: "idb";
|
|
309
|
-
memory: "memory";
|
|
310
|
-
path: "path";
|
|
311
|
-
postgres: "postgres";
|
|
312
|
-
}>;
|
|
313
|
-
dataDir: z.ZodOptional<z.ZodString>;
|
|
314
|
-
url: z.ZodOptional<z.ZodString>;
|
|
315
|
-
}, z.core.$strict>>;
|
|
316
|
-
readModel: z.ZodOptional<z.ZodObject<{
|
|
317
|
-
url: z.ZodOptional<z.ZodString>;
|
|
318
|
-
}, z.core.$strict>>;
|
|
319
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
320
|
-
cdnUrl: z.ZodOptional<z.ZodString>;
|
|
321
|
-
specs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
322
|
-
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
323
|
-
}, z.core.$strict>>;
|
|
324
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
325
|
-
host: z.ZodOptional<z.ZodString>;
|
|
326
|
-
url: z.ZodOptional<z.ZodString>;
|
|
327
|
-
}, z.core.$strict>>;
|
|
328
|
-
projection: z.ZodOptional<z.ZodObject<{
|
|
329
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
330
|
-
dbPoolSize: z.ZodOptional<z.ZodNumber>;
|
|
331
|
-
}, z.core.$strict>>;
|
|
332
|
-
executors: z.ZodOptional<z.ZodObject<{
|
|
333
|
-
numWorkers: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>>;
|
|
334
|
-
}, z.core.$strict>>;
|
|
335
|
-
}, z.core.$strict>;
|
|
336
|
-
export declare const reactorSchema: z.ZodObject<{
|
|
337
|
-
backends: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
338
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
339
|
-
"in-process": "in-process";
|
|
340
|
-
remote: "remote";
|
|
341
|
-
worker: "worker";
|
|
342
|
-
}>>;
|
|
343
|
-
storage: z.ZodOptional<z.ZodObject<{
|
|
344
|
-
kind: z.ZodEnum<{
|
|
345
|
-
idb: "idb";
|
|
346
|
-
memory: "memory";
|
|
347
|
-
path: "path";
|
|
348
|
-
postgres: "postgres";
|
|
349
|
-
}>;
|
|
350
|
-
dataDir: z.ZodOptional<z.ZodString>;
|
|
351
|
-
url: z.ZodOptional<z.ZodString>;
|
|
352
|
-
}, z.core.$strict>>;
|
|
353
|
-
readModel: z.ZodOptional<z.ZodObject<{
|
|
354
|
-
url: z.ZodOptional<z.ZodString>;
|
|
355
|
-
}, z.core.$strict>>;
|
|
356
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
357
|
-
cdnUrl: z.ZodOptional<z.ZodString>;
|
|
358
|
-
specs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
359
|
-
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
360
|
-
}, z.core.$strict>>;
|
|
361
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
362
|
-
host: z.ZodOptional<z.ZodString>;
|
|
363
|
-
url: z.ZodOptional<z.ZodString>;
|
|
364
|
-
}, z.core.$strict>>;
|
|
365
|
-
projection: z.ZodOptional<z.ZodObject<{
|
|
366
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
367
|
-
dbPoolSize: z.ZodOptional<z.ZodNumber>;
|
|
368
|
-
}, z.core.$strict>>;
|
|
369
|
-
executors: z.ZodOptional<z.ZodObject<{
|
|
370
|
-
numWorkers: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>>;
|
|
371
|
-
}, z.core.$strict>>;
|
|
372
|
-
}, z.core.$strict>>>;
|
|
373
|
-
placement: z.ZodOptional<z.ZodObject<{
|
|
374
|
-
primary: z.ZodOptional<z.ZodString>;
|
|
375
|
-
default: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
376
|
-
}, z.core.$strict>>;
|
|
377
|
-
protocol: z.ZodOptional<z.ZodObject<{
|
|
378
|
-
featureFlags: z.ZodOptional<z.ZodObject<{
|
|
379
|
-
documentDecisions: z.ZodOptional<z.ZodBoolean>;
|
|
380
|
-
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
381
|
-
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
382
|
-
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
383
|
-
}, z.core.$strict>>;
|
|
384
|
-
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
385
|
-
legacy: "legacy";
|
|
386
|
-
"v2-required": "v2-required";
|
|
387
|
-
}>>;
|
|
388
|
-
unsupportedStoredDocuments: z.ZodOptional<z.ZodEnum<{
|
|
389
|
-
"read-only": "read-only";
|
|
390
|
-
refuse: "refuse";
|
|
391
|
-
}>>;
|
|
392
|
-
}, z.core.$strict>>;
|
|
393
|
-
workflows: z.ZodOptional<z.ZodBoolean>;
|
|
394
|
-
renown: z.ZodOptional<z.ZodObject<{
|
|
395
|
-
url: z.ZodOptional<z.ZodString>;
|
|
396
|
-
networkId: z.ZodOptional<z.ZodString>;
|
|
397
|
-
chainId: z.ZodOptional<z.ZodNumber>;
|
|
398
|
-
}, z.core.$strict>>;
|
|
399
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
400
|
-
registryUrl: z.ZodOptional<z.ZodString>;
|
|
401
|
-
}, z.core.$strict>>;
|
|
402
|
-
namespace: z.ZodOptional<z.ZodString>;
|
|
403
|
-
auth: z.ZodOptional<z.ZodObject<{
|
|
404
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
405
|
-
admins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
406
|
-
renown: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
407
|
-
}, z.core.$strict>>;
|
|
408
|
-
drives: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
409
|
-
slug: z.ZodString;
|
|
410
|
-
id: z.ZodOptional<z.ZodString>;
|
|
411
|
-
projectHash: z.ZodOptional<z.ZodBoolean>;
|
|
412
|
-
name: z.ZodOptional<z.ZodString>;
|
|
413
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
414
|
-
preferredEditor: z.ZodOptional<z.ZodString>;
|
|
415
|
-
sharingType: z.ZodOptional<z.ZodEnum<{
|
|
416
|
-
private: "private";
|
|
417
|
-
public: "public";
|
|
418
|
-
shared: "shared";
|
|
419
|
-
}>>;
|
|
420
|
-
availableOffline: z.ZodOptional<z.ZodBoolean>;
|
|
421
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
422
|
-
url: z.ZodString;
|
|
423
|
-
}, z.core.$strict>>;
|
|
424
|
-
}, z.core.$strict>>>;
|
|
425
|
-
}, z.core.$strict>;
|
|
426
|
-
/** Common runner options every host.runner carries; runner modules extend it
|
|
427
|
-
* loosely with their own process options. */
|
|
428
|
-
export declare const runnerBaseSchema: z.ZodObject<{
|
|
429
|
-
module: z.ZodString;
|
|
430
|
-
defaultVerb: z.ZodOptional<z.ZodString>;
|
|
431
|
-
port: z.ZodOptional<z.ZodNumber>;
|
|
432
|
-
host: z.ZodOptional<z.ZodString>;
|
|
433
|
-
plugins: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
434
|
-
module: z.ZodString;
|
|
435
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
436
|
-
verbs: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
|
|
437
|
-
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
438
|
-
}, z.core.$strict>]>>>;
|
|
439
|
-
}, z.core.$loose>;
|
|
440
|
-
/** A compound's children map (mutually exclusive with `reactor` — the XOR is
|
|
441
|
-
* structural, enforced by the loader; schemas validate each side's shape). */
|
|
442
|
-
export declare const childrenSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
443
|
-
host: z.ZodString;
|
|
444
|
-
runner: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
445
|
-
config: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
446
|
-
reactor: z.ZodOptional<z.ZodObject<{
|
|
447
|
-
backends: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
448
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
449
|
-
"in-process": "in-process";
|
|
450
|
-
remote: "remote";
|
|
451
|
-
worker: "worker";
|
|
452
|
-
}>>;
|
|
453
|
-
storage: z.ZodOptional<z.ZodObject<{
|
|
454
|
-
kind: z.ZodEnum<{
|
|
455
|
-
idb: "idb";
|
|
456
|
-
memory: "memory";
|
|
457
|
-
path: "path";
|
|
458
|
-
postgres: "postgres";
|
|
459
|
-
}>;
|
|
460
|
-
dataDir: z.ZodOptional<z.ZodString>;
|
|
461
|
-
url: z.ZodOptional<z.ZodString>;
|
|
462
|
-
}, z.core.$strict>>;
|
|
463
|
-
readModel: z.ZodOptional<z.ZodObject<{
|
|
464
|
-
url: z.ZodOptional<z.ZodString>;
|
|
465
|
-
}, z.core.$strict>>;
|
|
466
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
467
|
-
cdnUrl: z.ZodOptional<z.ZodString>;
|
|
468
|
-
specs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
469
|
-
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
470
|
-
}, z.core.$strict>>;
|
|
471
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
472
|
-
host: z.ZodOptional<z.ZodString>;
|
|
473
|
-
url: z.ZodOptional<z.ZodString>;
|
|
474
|
-
}, z.core.$strict>>;
|
|
475
|
-
projection: z.ZodOptional<z.ZodObject<{
|
|
476
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
477
|
-
dbPoolSize: z.ZodOptional<z.ZodNumber>;
|
|
478
|
-
}, z.core.$strict>>;
|
|
479
|
-
executors: z.ZodOptional<z.ZodObject<{
|
|
480
|
-
numWorkers: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>>;
|
|
481
|
-
}, z.core.$strict>>;
|
|
482
|
-
}, z.core.$strict>>>;
|
|
483
|
-
placement: z.ZodOptional<z.ZodObject<{
|
|
484
|
-
primary: z.ZodOptional<z.ZodString>;
|
|
485
|
-
default: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
486
|
-
}, z.core.$strict>>;
|
|
487
|
-
protocol: z.ZodOptional<z.ZodObject<{
|
|
488
|
-
featureFlags: z.ZodOptional<z.ZodObject<{
|
|
489
|
-
documentDecisions: z.ZodOptional<z.ZodBoolean>;
|
|
490
|
-
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
491
|
-
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
492
|
-
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
493
|
-
}, z.core.$strict>>;
|
|
494
|
-
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
495
|
-
legacy: "legacy";
|
|
496
|
-
"v2-required": "v2-required";
|
|
497
|
-
}>>;
|
|
498
|
-
unsupportedStoredDocuments: z.ZodOptional<z.ZodEnum<{
|
|
499
|
-
"read-only": "read-only";
|
|
500
|
-
refuse: "refuse";
|
|
501
|
-
}>>;
|
|
502
|
-
}, z.core.$strict>>;
|
|
503
|
-
workflows: z.ZodOptional<z.ZodBoolean>;
|
|
504
|
-
renown: z.ZodOptional<z.ZodObject<{
|
|
505
|
-
url: z.ZodOptional<z.ZodString>;
|
|
506
|
-
networkId: z.ZodOptional<z.ZodString>;
|
|
507
|
-
chainId: z.ZodOptional<z.ZodNumber>;
|
|
508
|
-
}, z.core.$strict>>;
|
|
509
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
510
|
-
registryUrl: z.ZodOptional<z.ZodString>;
|
|
511
|
-
}, z.core.$strict>>;
|
|
512
|
-
namespace: z.ZodOptional<z.ZodString>;
|
|
513
|
-
auth: z.ZodOptional<z.ZodObject<{
|
|
514
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
515
|
-
admins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
516
|
-
renown: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
517
|
-
}, z.core.$strict>>;
|
|
518
|
-
drives: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
519
|
-
slug: z.ZodString;
|
|
520
|
-
id: z.ZodOptional<z.ZodString>;
|
|
521
|
-
projectHash: z.ZodOptional<z.ZodBoolean>;
|
|
522
|
-
name: z.ZodOptional<z.ZodString>;
|
|
523
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
524
|
-
preferredEditor: z.ZodOptional<z.ZodString>;
|
|
525
|
-
sharingType: z.ZodOptional<z.ZodEnum<{
|
|
526
|
-
private: "private";
|
|
527
|
-
public: "public";
|
|
528
|
-
shared: "shared";
|
|
529
|
-
}>>;
|
|
530
|
-
availableOffline: z.ZodOptional<z.ZodBoolean>;
|
|
531
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
532
|
-
url: z.ZodString;
|
|
533
|
-
}, z.core.$strict>>;
|
|
534
|
-
}, z.core.$strict>>>;
|
|
535
|
-
}, z.core.$strict>>;
|
|
536
|
-
}, z.core.$strict>>;
|
|
537
|
-
/** Composed generic host shapes — the basis for the emitted editor schemas
|
|
538
|
-
* (D2.a). Runner packages extend these with their own runner options; `config`
|
|
539
|
-
* stays loose by design. */
|
|
540
|
-
export declare const reactorHostSchema: z.ZodObject<{
|
|
541
|
-
name: z.ZodString;
|
|
542
|
-
runner: z.ZodObject<{
|
|
543
|
-
module: z.ZodString;
|
|
544
|
-
defaultVerb: z.ZodOptional<z.ZodString>;
|
|
545
|
-
port: z.ZodOptional<z.ZodNumber>;
|
|
546
|
-
host: z.ZodOptional<z.ZodString>;
|
|
547
|
-
plugins: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
548
|
-
module: z.ZodString;
|
|
549
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
550
|
-
verbs: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
|
|
551
|
-
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
552
|
-
}, z.core.$strict>]>>>;
|
|
553
|
-
}, z.core.$loose>;
|
|
554
|
-
config: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
555
|
-
profile: z.ZodOptional<z.ZodObject<{
|
|
556
|
-
appId: z.ZodOptional<z.ZodString>;
|
|
557
|
-
name: z.ZodOptional<z.ZodString>;
|
|
558
|
-
description: z.ZodOptional<z.ZodString>;
|
|
559
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
560
|
-
}, z.core.$strict>>;
|
|
561
|
-
reactor: z.ZodOptional<z.ZodObject<{
|
|
562
|
-
backends: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
563
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
564
|
-
"in-process": "in-process";
|
|
565
|
-
remote: "remote";
|
|
566
|
-
worker: "worker";
|
|
567
|
-
}>>;
|
|
568
|
-
storage: z.ZodOptional<z.ZodObject<{
|
|
569
|
-
kind: z.ZodEnum<{
|
|
570
|
-
idb: "idb";
|
|
571
|
-
memory: "memory";
|
|
572
|
-
path: "path";
|
|
573
|
-
postgres: "postgres";
|
|
574
|
-
}>;
|
|
575
|
-
dataDir: z.ZodOptional<z.ZodString>;
|
|
576
|
-
url: z.ZodOptional<z.ZodString>;
|
|
577
|
-
}, z.core.$strict>>;
|
|
578
|
-
readModel: z.ZodOptional<z.ZodObject<{
|
|
579
|
-
url: z.ZodOptional<z.ZodString>;
|
|
580
|
-
}, z.core.$strict>>;
|
|
581
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
582
|
-
cdnUrl: z.ZodOptional<z.ZodString>;
|
|
583
|
-
specs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
584
|
-
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
585
|
-
}, z.core.$strict>>;
|
|
586
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
587
|
-
host: z.ZodOptional<z.ZodString>;
|
|
588
|
-
url: z.ZodOptional<z.ZodString>;
|
|
589
|
-
}, z.core.$strict>>;
|
|
590
|
-
projection: z.ZodOptional<z.ZodObject<{
|
|
591
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
592
|
-
dbPoolSize: z.ZodOptional<z.ZodNumber>;
|
|
593
|
-
}, z.core.$strict>>;
|
|
594
|
-
executors: z.ZodOptional<z.ZodObject<{
|
|
595
|
-
numWorkers: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>>;
|
|
596
|
-
}, z.core.$strict>>;
|
|
597
|
-
}, z.core.$strict>>>;
|
|
598
|
-
placement: z.ZodOptional<z.ZodObject<{
|
|
599
|
-
primary: z.ZodOptional<z.ZodString>;
|
|
600
|
-
default: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
601
|
-
}, z.core.$strict>>;
|
|
602
|
-
protocol: z.ZodOptional<z.ZodObject<{
|
|
603
|
-
featureFlags: z.ZodOptional<z.ZodObject<{
|
|
604
|
-
documentDecisions: z.ZodOptional<z.ZodBoolean>;
|
|
605
|
-
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
606
|
-
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
607
|
-
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
608
|
-
}, z.core.$strict>>;
|
|
609
|
-
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
610
|
-
legacy: "legacy";
|
|
611
|
-
"v2-required": "v2-required";
|
|
612
|
-
}>>;
|
|
613
|
-
unsupportedStoredDocuments: z.ZodOptional<z.ZodEnum<{
|
|
614
|
-
"read-only": "read-only";
|
|
615
|
-
refuse: "refuse";
|
|
616
|
-
}>>;
|
|
617
|
-
}, z.core.$strict>>;
|
|
618
|
-
workflows: z.ZodOptional<z.ZodBoolean>;
|
|
619
|
-
renown: z.ZodOptional<z.ZodObject<{
|
|
620
|
-
url: z.ZodOptional<z.ZodString>;
|
|
621
|
-
networkId: z.ZodOptional<z.ZodString>;
|
|
622
|
-
chainId: z.ZodOptional<z.ZodNumber>;
|
|
623
|
-
}, z.core.$strict>>;
|
|
624
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
625
|
-
registryUrl: z.ZodOptional<z.ZodString>;
|
|
626
|
-
}, z.core.$strict>>;
|
|
627
|
-
namespace: z.ZodOptional<z.ZodString>;
|
|
628
|
-
auth: z.ZodOptional<z.ZodObject<{
|
|
629
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
630
|
-
admins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
631
|
-
renown: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
632
|
-
}, z.core.$strict>>;
|
|
633
|
-
drives: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
634
|
-
slug: z.ZodString;
|
|
635
|
-
id: z.ZodOptional<z.ZodString>;
|
|
636
|
-
projectHash: z.ZodOptional<z.ZodBoolean>;
|
|
637
|
-
name: z.ZodOptional<z.ZodString>;
|
|
638
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
639
|
-
preferredEditor: z.ZodOptional<z.ZodString>;
|
|
640
|
-
sharingType: z.ZodOptional<z.ZodEnum<{
|
|
641
|
-
private: "private";
|
|
642
|
-
public: "public";
|
|
643
|
-
shared: "shared";
|
|
644
|
-
}>>;
|
|
645
|
-
availableOffline: z.ZodOptional<z.ZodBoolean>;
|
|
646
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
647
|
-
url: z.ZodString;
|
|
648
|
-
}, z.core.$strict>>;
|
|
649
|
-
}, z.core.$strict>>>;
|
|
650
|
-
}, z.core.$strict>>;
|
|
651
|
-
}, z.core.$loose>;
|
|
652
|
-
export declare const compoundHostSchema: z.ZodObject<{
|
|
653
|
-
name: z.ZodString;
|
|
654
|
-
runner: z.ZodObject<{
|
|
655
|
-
module: z.ZodString;
|
|
656
|
-
defaultVerb: z.ZodOptional<z.ZodString>;
|
|
657
|
-
port: z.ZodOptional<z.ZodNumber>;
|
|
658
|
-
host: z.ZodOptional<z.ZodString>;
|
|
659
|
-
plugins: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
660
|
-
module: z.ZodString;
|
|
661
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
662
|
-
verbs: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>;
|
|
663
|
-
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
664
|
-
}, z.core.$strict>]>>>;
|
|
665
|
-
}, z.core.$loose>;
|
|
666
|
-
children: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
667
|
-
host: z.ZodString;
|
|
668
|
-
runner: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
669
|
-
config: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
670
|
-
reactor: z.ZodOptional<z.ZodObject<{
|
|
671
|
-
backends: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
672
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
673
|
-
"in-process": "in-process";
|
|
674
|
-
remote: "remote";
|
|
675
|
-
worker: "worker";
|
|
676
|
-
}>>;
|
|
677
|
-
storage: z.ZodOptional<z.ZodObject<{
|
|
678
|
-
kind: z.ZodEnum<{
|
|
679
|
-
idb: "idb";
|
|
680
|
-
memory: "memory";
|
|
681
|
-
path: "path";
|
|
682
|
-
postgres: "postgres";
|
|
683
|
-
}>;
|
|
684
|
-
dataDir: z.ZodOptional<z.ZodString>;
|
|
685
|
-
url: z.ZodOptional<z.ZodString>;
|
|
686
|
-
}, z.core.$strict>>;
|
|
687
|
-
readModel: z.ZodOptional<z.ZodObject<{
|
|
688
|
-
url: z.ZodOptional<z.ZodString>;
|
|
689
|
-
}, z.core.$strict>>;
|
|
690
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
691
|
-
cdnUrl: z.ZodOptional<z.ZodString>;
|
|
692
|
-
specs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
693
|
-
dynamic: z.ZodOptional<z.ZodBoolean>;
|
|
694
|
-
}, z.core.$strict>>;
|
|
695
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
696
|
-
host: z.ZodOptional<z.ZodString>;
|
|
697
|
-
url: z.ZodOptional<z.ZodString>;
|
|
698
|
-
}, z.core.$strict>>;
|
|
699
|
-
projection: z.ZodOptional<z.ZodObject<{
|
|
700
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
701
|
-
dbPoolSize: z.ZodOptional<z.ZodNumber>;
|
|
702
|
-
}, z.core.$strict>>;
|
|
703
|
-
executors: z.ZodOptional<z.ZodObject<{
|
|
704
|
-
numWorkers: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"auto">]>>;
|
|
705
|
-
}, z.core.$strict>>;
|
|
706
|
-
}, z.core.$strict>>>;
|
|
707
|
-
placement: z.ZodOptional<z.ZodObject<{
|
|
708
|
-
primary: z.ZodOptional<z.ZodString>;
|
|
709
|
-
default: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
710
|
-
}, z.core.$strict>>;
|
|
711
|
-
protocol: z.ZodOptional<z.ZodObject<{
|
|
712
|
-
featureFlags: z.ZodOptional<z.ZodObject<{
|
|
713
|
-
documentDecisions: z.ZodOptional<z.ZodBoolean>;
|
|
714
|
-
authEnforcement: z.ZodOptional<z.ZodBoolean>;
|
|
715
|
-
authGroups: z.ZodOptional<z.ZodBoolean>;
|
|
716
|
-
authConditions: z.ZodOptional<z.ZodBoolean>;
|
|
717
|
-
}, z.core.$strict>>;
|
|
718
|
-
createSignaturePolicy: z.ZodOptional<z.ZodEnum<{
|
|
719
|
-
legacy: "legacy";
|
|
720
|
-
"v2-required": "v2-required";
|
|
721
|
-
}>>;
|
|
722
|
-
unsupportedStoredDocuments: z.ZodOptional<z.ZodEnum<{
|
|
723
|
-
"read-only": "read-only";
|
|
724
|
-
refuse: "refuse";
|
|
725
|
-
}>>;
|
|
726
|
-
}, z.core.$strict>>;
|
|
727
|
-
workflows: z.ZodOptional<z.ZodBoolean>;
|
|
728
|
-
renown: z.ZodOptional<z.ZodObject<{
|
|
729
|
-
url: z.ZodOptional<z.ZodString>;
|
|
730
|
-
networkId: z.ZodOptional<z.ZodString>;
|
|
731
|
-
chainId: z.ZodOptional<z.ZodNumber>;
|
|
732
|
-
}, z.core.$strict>>;
|
|
733
|
-
packages: z.ZodOptional<z.ZodObject<{
|
|
734
|
-
registryUrl: z.ZodOptional<z.ZodString>;
|
|
735
|
-
}, z.core.$strict>>;
|
|
736
|
-
namespace: z.ZodOptional<z.ZodString>;
|
|
737
|
-
auth: z.ZodOptional<z.ZodObject<{
|
|
738
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
739
|
-
admins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
740
|
-
renown: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
741
|
-
}, z.core.$strict>>;
|
|
742
|
-
drives: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
743
|
-
slug: z.ZodString;
|
|
744
|
-
id: z.ZodOptional<z.ZodString>;
|
|
745
|
-
projectHash: z.ZodOptional<z.ZodBoolean>;
|
|
746
|
-
name: z.ZodOptional<z.ZodString>;
|
|
747
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
748
|
-
preferredEditor: z.ZodOptional<z.ZodString>;
|
|
749
|
-
sharingType: z.ZodOptional<z.ZodEnum<{
|
|
750
|
-
private: "private";
|
|
751
|
-
public: "public";
|
|
752
|
-
shared: "shared";
|
|
753
|
-
}>>;
|
|
754
|
-
availableOffline: z.ZodOptional<z.ZodBoolean>;
|
|
755
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
756
|
-
url: z.ZodString;
|
|
757
|
-
}, z.core.$strict>>;
|
|
758
|
-
}, z.core.$strict>>>;
|
|
759
|
-
}, z.core.$strict>>;
|
|
760
|
-
}, z.core.$strict>>;
|
|
761
|
-
config: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
762
|
-
profile: z.ZodOptional<z.ZodObject<{
|
|
763
|
-
appId: z.ZodOptional<z.ZodString>;
|
|
764
|
-
name: z.ZodOptional<z.ZodString>;
|
|
765
|
-
description: z.ZodOptional<z.ZodString>;
|
|
766
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
767
|
-
}, z.core.$strict>>;
|
|
768
|
-
}, z.core.$loose>;
|
|
769
|
-
/** The emitted-schema set, keyed by published filename. Pure — the
|
|
770
|
-
* emit-schemas script writes these to disk and the drift test re-derives
|
|
771
|
-
* them, per the runtime-config-schema pattern. */
|
|
772
|
-
export declare function emittedHostSchemas(): Record<string, unknown>;
|
|
699
|
+
export declare function mergeDefaultDrives(...groups: PHConnectDefaultDrive[][]): PHConnectDefaultDrive[];
|
|
700
|
+
/**
|
|
701
|
+
* Rebase a local drive URL onto a public base: keeps the /d/<slug> path,
|
|
702
|
+
* swaps the loopback origin for the public base. Browser clients behind a
|
|
703
|
+
* reverse proxy can't reach http://localhost:<port>. Non-loopback URLs
|
|
704
|
+
* (e.g. a remote drive) are already public and pass through unchanged, as do
|
|
705
|
+
* unparseable ones.
|
|
706
|
+
*/
|
|
707
|
+
export declare function rebaseDriveUrl(driveUrl: string, publicBase: string): string;
|
|
708
|
+
interface DriveProjectionInput {
|
|
709
|
+
/** Drive URLs the compound's reactor member created, in display order
|
|
710
|
+
* (e.g. vetra, preview, workflows). Null/undefined entries are skipped. */
|
|
711
|
+
createdDriveUrls: (string | null | undefined)[];
|
|
712
|
+
/** The project's configured `connect.drives.defaultDrives`. */
|
|
713
|
+
configuredDefaultDrives?: PHConnectDefaultDrive[];
|
|
714
|
+
/** `--drives-public-base`: advertise proxy-reachable URLs to the browser. */
|
|
715
|
+
publicBase?: string | null;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* The compound's drives projection: created drives first (rebased onto the
|
|
719
|
+
* public base when given), then the project's configured drives, de-duplicated
|
|
720
|
+
* — and `preserve-all`, because compound-injected drive lists change per
|
|
721
|
+
* launch context and must never detach drives the user added by hand.
|
|
722
|
+
*/
|
|
723
|
+
export declare function projectDrivesIntoConnect(input: DriveProjectionInput): Pick<PHConnectRuntimeConfig, "drives">;
|
|
773
724
|
//#endregion
|
|
774
|
-
//#region src/
|
|
725
|
+
//#region src/resolve/plan.d.ts
|
|
775
726
|
/**
|
|
776
|
-
*
|
|
777
|
-
*
|
|
778
|
-
*
|
|
727
|
+
* The dependency plan (pipeline step 4): which compound member consumes
|
|
728
|
+
* which member's outputs, and the start order that follows. Producers start
|
|
729
|
+
* before consumers; `config.startOrder` is optional and, when given, must
|
|
730
|
+
* agree with the tokens. Cycles fail. Pure.
|
|
779
731
|
*/
|
|
780
|
-
export declare
|
|
732
|
+
export declare class PlanError extends Error {
|
|
733
|
+
constructor(message: string);
|
|
734
|
+
}
|
|
735
|
+
interface PlanMember {
|
|
736
|
+
/** The member key (`children.<key>`). */
|
|
737
|
+
key: string;
|
|
738
|
+
/** The member's host folder (`children.<key>.host`). */
|
|
739
|
+
host: string;
|
|
740
|
+
/** The producers its tokens name, with the host path of one token each. */
|
|
741
|
+
refs: {
|
|
742
|
+
ref: OutputRef;
|
|
743
|
+
path: string;
|
|
744
|
+
}[];
|
|
745
|
+
}
|
|
746
|
+
interface PlanEdge {
|
|
747
|
+
consumer: string;
|
|
748
|
+
producer: string;
|
|
749
|
+
/** Host path in the consumer of the (first) token behind this edge. */
|
|
750
|
+
path: string;
|
|
751
|
+
}
|
|
752
|
+
interface CompoundPlan {
|
|
753
|
+
/** Member keys in start order. */
|
|
754
|
+
order: string[];
|
|
755
|
+
edges: PlanEdge[];
|
|
756
|
+
/** "tokens": derived from the dependencies; "startOrder": the declared
|
|
757
|
+
* order, checked against them. */
|
|
758
|
+
source: "tokens" | "startOrder";
|
|
759
|
+
}
|
|
760
|
+
/** The member a ref names: the unique member running `ref.host`, or the
|
|
761
|
+
* member `ref.member` when given (it must run `ref.host`). */
|
|
762
|
+
export declare function memberForRef(ref: OutputRef, members: readonly Pick<PlanMember, "key" | "host">[]): {
|
|
763
|
+
key: string;
|
|
764
|
+
} | {
|
|
765
|
+
error: string;
|
|
766
|
+
};
|
|
767
|
+
export declare function planCompound(members: readonly PlanMember[], startOrder?: readonly string[]): CompoundPlan;
|
|
781
768
|
//#endregion
|
|
782
|
-
//#region src/
|
|
769
|
+
//#region src/resolve/resolve.d.ts
|
|
770
|
+
/**
|
|
771
|
+
* The resolver (pipeline step 5): replaces every token in a declared host
|
|
772
|
+
* with its value. `$output` reads the producer's outputs through an
|
|
773
|
+
* `OutputSource` (live compound members, or a standalone run record: the
|
|
774
|
+
* node adapters in ./node.ts); `$env` reads the environment map of the
|
|
775
|
+
* resolving process; `$map` renders its `to` template once per element of
|
|
776
|
+
* its `over` (arrays in order, records key-sorted; `$item`/`$key` read the
|
|
777
|
+
* element being rendered); the `"${userData}"`/`"${projectRoot}"` string
|
|
778
|
+
* sugar is substituted on the way. An `$output`/`$item` that reads a field
|
|
779
|
+
* absent from the data but optional in the producer's schema (codegen's
|
|
780
|
+
* `OutputToken<T | undefined>`) omits its enclosing property, like an unset
|
|
781
|
+
* optional `$env`. Pure and browser-safe.
|
|
782
|
+
*/
|
|
783
|
+
type OutputLookup = {
|
|
784
|
+
status: "available";
|
|
785
|
+
outputs: unknown;
|
|
786
|
+
/** The producer's `outputsSchema`, when known: an absent field it
|
|
787
|
+
* marks optional omits the consuming property instead of failing. */
|
|
788
|
+
schema?: unknown;
|
|
789
|
+
} |
|
|
790
|
+
/** `message` is the complete, user-facing reason (e.g. "connect needs
|
|
791
|
+
* outputs from host "switchboard", which is not running. …"). */
|
|
792
|
+
{
|
|
793
|
+
status: "unavailable";
|
|
794
|
+
message: string;
|
|
795
|
+
};
|
|
796
|
+
interface OutputSource {
|
|
797
|
+
lookup(ref: OutputRef): OutputLookup;
|
|
798
|
+
}
|
|
799
|
+
interface ResolveSources {
|
|
800
|
+
/** Where `$output` tokens read. Absent: any `$output` fails. */
|
|
801
|
+
outputs?: OutputSource;
|
|
802
|
+
/** The resolving process's environment (`$env`). */
|
|
803
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
804
|
+
/** `userData`/`projectRoot`: always resolvable `$env` names and string
|
|
805
|
+
* sugar. */
|
|
806
|
+
builtins?: BuiltinEnv;
|
|
807
|
+
/** The host file named in errors (`hosts/connect/host.js`). */
|
|
808
|
+
where?: string;
|
|
809
|
+
}
|
|
810
|
+
export declare class TokenResolutionError extends Error {
|
|
811
|
+
constructor(message: string);
|
|
812
|
+
}
|
|
783
813
|
/**
|
|
784
|
-
*
|
|
785
|
-
*
|
|
786
|
-
*
|
|
787
|
-
*
|
|
788
|
-
|
|
814
|
+
* The `$map` elements an issue path (from resolved validation of a resolved
|
|
815
|
+
* host) passes through, as text: `$map element "workflows"`. Undefined when
|
|
816
|
+
* the path crosses no `$map`-rendered array. Walk the SAME object
|
|
817
|
+
* `resolveHostOutputs` returned (provenance is by identity).
|
|
818
|
+
*/
|
|
819
|
+
export declare function describeMapElements(host: unknown, path: readonly PropertyKey[]): string | undefined;
|
|
820
|
+
/** A compound's own member set, for `deferSelf`. */
|
|
821
|
+
interface SelfMembers {
|
|
822
|
+
/** The compound's members: key (`children.<key>`) and host folder. */
|
|
823
|
+
members: readonly {
|
|
824
|
+
key: string;
|
|
825
|
+
host: string;
|
|
826
|
+
}[];
|
|
827
|
+
}
|
|
828
|
+
/** A token in a compound's own fields that reads one of its members. */
|
|
829
|
+
interface DeferredToken {
|
|
830
|
+
/** Host path (`config.agents.assistant.url`). */
|
|
831
|
+
path: string;
|
|
832
|
+
/** The member keys whose outputs it needs. */
|
|
833
|
+
members: string[];
|
|
834
|
+
}
|
|
835
|
+
interface DeferredResolution<T> {
|
|
836
|
+
/** The host with every token resolved EXCEPT the deferred ones (still in
|
|
837
|
+
* place) and the `children` wrappers (member-level: each member resolves
|
|
838
|
+
* its own). */
|
|
839
|
+
host: T;
|
|
840
|
+
deferred: DeferredToken[];
|
|
841
|
+
/** The member keys any deferred token needs (start them first). */
|
|
842
|
+
needs: string[];
|
|
843
|
+
/** Resolve the deferred tokens once those members have started, from
|
|
844
|
+
* their live outputs (e.g. `compoundOutputSource`); returns the fully
|
|
845
|
+
* resolved host (children still untouched). */
|
|
846
|
+
finish(outputs: OutputSource): T;
|
|
847
|
+
}
|
|
848
|
+
interface ResolveOptions {
|
|
849
|
+
/** Resolving a COMPOUND's own fields: tokens that read one of its members
|
|
850
|
+
* are deferred until those members have started (see
|
|
851
|
+
* `DeferredResolution`); `children` is left for the members. */
|
|
852
|
+
deferSelf: SelfMembers;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Resolve every token in a declared host (or any JSON-shaped value): the
|
|
856
|
+
* result has the same shape with tokens replaced by values, optional unset
|
|
857
|
+
* `$env` properties omitted and the built-in string sugar substituted (`$$`
|
|
858
|
+
* escapes are kept; validateHost unwraps them). Throws `TokenResolutionError` naming the host path;
|
|
859
|
+
* an `$output` whose producer is not running fails with the source's
|
|
860
|
+
* message (no fallback, no waiting).
|
|
789
861
|
*
|
|
790
|
-
*
|
|
791
|
-
*
|
|
792
|
-
*
|
|
793
|
-
* projectHash derives both from the project path (generateProjectDriveId
|
|
794
|
-
* semantics: `${slug}-${sha256(projectPath).slice(0, 8)}`).
|
|
795
|
-
* - preferredEditor: binds the drive to its drive app — stored at
|
|
796
|
-
* header.meta.preferredEditor; Connect config's `app` is the legacy alias.
|
|
797
|
-
* - remote.url: an attachment to a drive served elsewhere (Connect default
|
|
798
|
-
* drives, switchboard remoteDrives); local fields are ignored for remotes.
|
|
862
|
+
* With `{ deferSelf }` (a compound resolving its own fields), returns a
|
|
863
|
+
* `DeferredResolution` instead: everything but the self-references now,
|
|
864
|
+
* and `finish(outputs)` for the rest once the members it needs run.
|
|
799
865
|
*/
|
|
800
|
-
export declare
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
url: z.ZodString;
|
|
815
|
-
}, z.core.$strict>>;
|
|
816
|
-
}, z.core.$strict>;
|
|
817
|
-
type DriveDeclaration = z.infer<typeof driveDeclarationSchema>;
|
|
818
|
-
export declare const drivesSchema: z.ZodArray<z.ZodObject<{
|
|
819
|
-
slug: z.ZodString;
|
|
820
|
-
id: z.ZodOptional<z.ZodString>;
|
|
821
|
-
projectHash: z.ZodOptional<z.ZodBoolean>;
|
|
822
|
-
name: z.ZodOptional<z.ZodString>;
|
|
823
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
824
|
-
preferredEditor: z.ZodOptional<z.ZodString>;
|
|
825
|
-
sharingType: z.ZodOptional<z.ZodEnum<{
|
|
826
|
-
private: "private";
|
|
827
|
-
public: "public";
|
|
828
|
-
shared: "shared";
|
|
829
|
-
}>>;
|
|
830
|
-
availableOffline: z.ZodOptional<z.ZodBoolean>;
|
|
831
|
-
remote: z.ZodOptional<z.ZodObject<{
|
|
832
|
-
url: z.ZodString;
|
|
833
|
-
}, z.core.$strict>>;
|
|
834
|
-
}, z.core.$strict>>;
|
|
835
|
-
export declare function projectDriveId(projectRoot: string, slug: string): string;
|
|
836
|
-
interface ResolvedDrive {
|
|
837
|
-
kind: "local" | "remote";
|
|
838
|
-
id: string;
|
|
839
|
-
slug: string;
|
|
840
|
-
name: string;
|
|
841
|
-
icon?: string;
|
|
842
|
-
preferredEditor?: string;
|
|
843
|
-
sharingType: "public" | "private" | "shared";
|
|
844
|
-
availableOffline: boolean;
|
|
845
|
-
remoteUrl?: string;
|
|
866
|
+
export declare function resolveHostOutputs<T>(host: T, sources: ResolveSources): T;
|
|
867
|
+
export declare function resolveHostOutputs<T>(host: T, sources: ResolveSources, options: ResolveOptions): DeferredResolution<T>;
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region src/resolve/removed-forms.d.ts
|
|
870
|
+
/**
|
|
871
|
+
* The cross-host forms removed in T3 (typed-host-configs 3.7), detected
|
|
872
|
+
* before schema validation so the error names the token form that replaces
|
|
873
|
+
* each one instead of a bare "Unrecognized key". clint's `agents.*.host` and
|
|
874
|
+
* proxy `routes.*.member` are checked by the clint runner schemas.
|
|
875
|
+
*/
|
|
876
|
+
interface RemovedForm {
|
|
877
|
+
/** Host path of the removed value. */
|
|
878
|
+
path: string;
|
|
879
|
+
message: string;
|
|
846
880
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
881
|
+
/** Every removed form in a host file (reactor or compound), in document
|
|
882
|
+
* order. Compound wrappers are checked too. */
|
|
883
|
+
export declare function findRemovedForms(host: unknown): RemovedForm[];
|
|
884
|
+
//#endregion
|
|
885
|
+
//#region src/resolve/sources.d.ts
|
|
886
|
+
/**
|
|
887
|
+
* The compound output source: a member's `$output` tokens read the live
|
|
888
|
+
* `RunnerHandle.outputs` of the members started before it. `schemas` (member
|
|
889
|
+
* key → its runner's `outputsSchema`) lets an absent optional output field
|
|
890
|
+
* omit the consuming property. Pure (the run-record source for standalone
|
|
891
|
+
* hosts is node: ./node.ts).
|
|
892
|
+
*/
|
|
893
|
+
export declare function compoundOutputSource(members: readonly {
|
|
894
|
+
key: string;
|
|
895
|
+
host: string;
|
|
896
|
+
}[], started: ReadonlyMap<string, unknown>, compound: string, schemas?: ReadonlyMap<string, unknown>): OutputSource;
|
|
897
|
+
//#endregion
|
|
898
|
+
//#region src/resolve/walk.d.ts
|
|
899
|
+
/**
|
|
900
|
+
* Token discovery over a declared (JSON-shaped) host: where every operator
|
|
901
|
+
* sits and in which syntactic position, which is what declared validation
|
|
902
|
+
* (`$env` optional placement), the dependency plan and `--explain outputs`
|
|
903
|
+
* read. Pure: no node imports.
|
|
904
|
+
*/
|
|
905
|
+
/** Where a token sits: the direct value of an object property, an array
|
|
906
|
+
* element, the whole value, a `$concat` part, a `$map`'s `over`, or the
|
|
907
|
+
* whole `to` template of a `$map` (the top of the rendered element). */
|
|
908
|
+
type TokenPosition = "property" | "element" | "root" | "concat" | "over" | "template";
|
|
909
|
+
/** An enclosing `$map`, as seen from a token inside its `to` template. */
|
|
910
|
+
interface MapScope {
|
|
911
|
+
/** Host path of the `$map` token. */
|
|
912
|
+
path: OutputPath;
|
|
913
|
+
/** Its binding name (`$map.as`), if any. */
|
|
914
|
+
as?: string;
|
|
915
|
+
/** The `$map` token itself. */
|
|
916
|
+
token: Record<string, unknown>;
|
|
857
917
|
}
|
|
858
|
-
interface
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
918
|
+
interface TokenSite {
|
|
919
|
+
/** Property keys and array indices from the host root to the token
|
|
920
|
+
* (`$map` operands appear as `…$map.over` / `…$map.to…`). */
|
|
921
|
+
path: OutputPath;
|
|
922
|
+
key: TokenKey;
|
|
923
|
+
/** The token object itself (`{ $output: … }`, …). */
|
|
924
|
+
token: Record<string, unknown>;
|
|
925
|
+
position: TokenPosition;
|
|
926
|
+
/** The `$map`s whose template holds this token, outermost first (the
|
|
927
|
+
* innermost binding is last). A map's own `over` is in its OUTER scope. */
|
|
928
|
+
scopes: readonly MapScope[];
|
|
862
929
|
}
|
|
863
|
-
/**
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
930
|
+
/** `a.b[2].c` (or `<root>`). */
|
|
931
|
+
export declare function formatPath(path: readonly (string | number)[]): string;
|
|
932
|
+
/** Every token in `value`, in document order. `$concat` parts and `$map`
|
|
933
|
+
* operands (`over`, then the `to` template) are visited: they may hold tokens
|
|
934
|
+
* themselves. Each site carries the `$map` scopes it sits in. A `$$` escape
|
|
935
|
+
* hides its operand. */
|
|
936
|
+
export declare function collectTokenSites(value: unknown): TokenSite[];
|
|
937
|
+
/** A one-line human rendering of a token, for `--explain` and messages. */
|
|
938
|
+
export declare function describeToken(token: unknown): string;
|
|
939
|
+
/** A display copy of `value` with every token replaced by `«description»`
|
|
940
|
+
* (for printing declared hosts, e.g. `--explain drives`). */
|
|
941
|
+
export declare function renderTokens<T>(value: T): T;
|
|
942
|
+
/** A copy of `value` with every `$$` escape replaced by its operand (the
|
|
943
|
+
* literal it protects). Run after the no-token walk. */
|
|
944
|
+
export declare function unwrapEscapes<T>(value: T): T;
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/resolve/node.d.ts
|
|
947
|
+
/**
|
|
948
|
+
* Node adapters for the resolver: producer discovery (a token names a host
|
|
949
|
+
* by FOLDER; run records are keyed by the host's `name`, so the producer's
|
|
950
|
+
* host.js is loaded to map one to the other), the standalone run-record
|
|
951
|
+
* output source, and the process environment.
|
|
952
|
+
*/
|
|
953
|
+
interface ProducerInfo {
|
|
954
|
+
/** The folder a token names (`hosts/<folder>/`). */
|
|
955
|
+
folder: string;
|
|
956
|
+
/** The producer host's `name` (its run-record key). */
|
|
957
|
+
name: string;
|
|
958
|
+
specifier: string;
|
|
959
|
+
runner: RunnerModule;
|
|
960
|
+
}
|
|
961
|
+
/** Producers by folder; a folder that fails to load carries its error. */
|
|
962
|
+
type ProducerMap = ReadonlyMap<string, ProducerInfo | {
|
|
963
|
+
error: string;
|
|
964
|
+
}>;
|
|
965
|
+
/** Load every producer host a set of refs names (each once). */
|
|
966
|
+
export declare function loadProducers(projectRoot: string, refs: readonly OutputRef[]): Promise<ProducerMap>;
|
|
967
|
+
/** The outputs schema of a runner module, or why it has none. */
|
|
968
|
+
export declare function runnerOutputsSchema(runner: RunnerModule, specifier: string, label: string): OutputsSchemaLookup;
|
|
969
|
+
/** Declared-validation lookup for a standalone host's producers. */
|
|
970
|
+
export declare function producerOutputsSchemas(producers: ProducerMap): (ref: OutputRef) => OutputsSchemaLookup;
|
|
971
|
+
/**
|
|
972
|
+
* Standalone `$output` source: the producer's live v2 run record. Its own
|
|
973
|
+
* standalone record first (keyed by the producer's `name`); else a live
|
|
974
|
+
* compound of this project with exactly one member running that host. A
|
|
975
|
+
* missing, stale, foreign or output-less record means "not running", and the
|
|
976
|
+
* lookup fails naming the producer and how to start it (no fallback to the
|
|
977
|
+
* producer's declared config, no waiting).
|
|
978
|
+
*/
|
|
979
|
+
export declare function runRecordOutputSource(projectRoot: string, options: {
|
|
980
|
+
consumer: string;
|
|
981
|
+
producers: ProducerMap;
|
|
982
|
+
projectName: string;
|
|
983
|
+
}): OutputSource;
|
|
984
|
+
/** The resolving process's `$env` inputs: its environment plus the
|
|
985
|
+
* always-resolvable built-ins (`userData` honours PH_USER_DATA_DIR). */
|
|
986
|
+
export declare function processResolveEnv(projectRoot: string, env?: Readonly<Record<string, string | undefined>>): Pick<ResolveSources, "env" | "builtins">;
|
|
987
|
+
//#endregion
|
|
988
|
+
//#region src/expect-host.d.ts
|
|
989
|
+
/**
|
|
990
|
+
* What a host amounts to once its pipeline has run (typed-host-configs G2,
|
|
991
|
+
* 2.2): the reactor-client shape its backends select, the drives it serves
|
|
992
|
+
* or attaches, the producers whose outputs it consumes and, for a compound,
|
|
993
|
+
* the start order and each member's expectation. Pure and platform-neutral:
|
|
994
|
+
* the caller runs load → declared validation → resolve → resolved
|
|
995
|
+
* validation (and plugin contribution discovery) and hands over the
|
|
996
|
+
* results. The returned value is JSON-only, so it can be pinned in a test
|
|
997
|
+
* table or shipped to another process (a future reactor-monitor).
|
|
998
|
+
*/
|
|
999
|
+
/** One backend, in placement-primary-first order. */
|
|
1000
|
+
interface ExpectedBackend {
|
|
1001
|
+
name: string;
|
|
1002
|
+
kind: ReactorBackendKind;
|
|
1003
|
+
storage?: ReactorStorageConfig["kind"];
|
|
1004
|
+
/** The RESOLVED storage dir (`"${userData}"` sugar and `$env` applied). */
|
|
1005
|
+
dataDir?: string;
|
|
1006
|
+
/** Why a provisioned reactor (a browser tab, reactor-monitor) cannot be
|
|
1007
|
+
* built from this backend (`backendToDescriptor`): e.g. postgres storage
|
|
1008
|
+
* is server-side only, a remote backend needs `remote.url`. Absent when
|
|
1009
|
+
* it can. A switchboard's own backend may legitimately carry one. */
|
|
1010
|
+
provisionError?: string;
|
|
1011
|
+
}
|
|
1012
|
+
/** One drive of the merged plan: plugin contributions first, then the
|
|
1013
|
+
* host's own declarations (the host wins a slug). Identity is the DECLARED
|
|
1014
|
+
* slug: a `projectHash` drive reports the flag, not a hashed id, so the
|
|
1015
|
+
* expectation does not depend on where the project lives. */
|
|
1016
|
+
interface ExpectedDrive {
|
|
1017
|
+
slug: string;
|
|
1018
|
+
kind: "local" | "remote";
|
|
1019
|
+
/** "host" for `reactor.drives`; the plugin name for a contribution. */
|
|
869
1020
|
source: string;
|
|
1021
|
+
/** A remote drive's resolved URL. */
|
|
1022
|
+
url?: string;
|
|
1023
|
+
id?: string;
|
|
1024
|
+
projectHash?: boolean | "id";
|
|
870
1025
|
}
|
|
871
|
-
/**
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1026
|
+
/** One `$output` token in the declared host. */
|
|
1027
|
+
interface ConsumedOutput {
|
|
1028
|
+
/** Host path of the token (`reactor.backends.sb.remote.url`). */
|
|
1029
|
+
at: string;
|
|
1030
|
+
host: string;
|
|
1031
|
+
member?: string;
|
|
1032
|
+
path: OutputPath;
|
|
1033
|
+
}
|
|
1034
|
+
interface HostExpectation {
|
|
1035
|
+
name: string;
|
|
1036
|
+
kind: RunnerKind;
|
|
1037
|
+
/** The verb this host runs at: `runner.defaultVerb ?? "run"` standalone;
|
|
1038
|
+
* for a compound member, its own effective verb under the compound's. */
|
|
1039
|
+
verb: string;
|
|
1040
|
+
/** Reactor hosts with backends: `reactorClientMode`. */
|
|
1041
|
+
clientMode?: ReactorClientMode;
|
|
1042
|
+
/** Reactor hosts: local AND remote backends (Connect's routing client). */
|
|
1043
|
+
multiReactor?: boolean;
|
|
1044
|
+
backends?: ExpectedBackend[];
|
|
1045
|
+
/** The resolved URLs of the remote backends, placement order. */
|
|
1046
|
+
remotes?: string[];
|
|
1047
|
+
drives?: ExpectedDrive[];
|
|
1048
|
+
/** Producers its own tokens read (`host` or `host#member`), sorted. */
|
|
1049
|
+
dependsOn: string[];
|
|
1050
|
+
consumes: ConsumedOutput[];
|
|
1051
|
+
/** `$env` names its own tokens read, sorted (values are not recorded). */
|
|
1052
|
+
env: string[];
|
|
1053
|
+
/** Compound: member keys in start order. */
|
|
1054
|
+
startOrder?: string[];
|
|
1055
|
+
/** Compound: each member's expectation. */
|
|
1056
|
+
members?: Record<string, MemberExpectation>;
|
|
1057
|
+
}
|
|
1058
|
+
interface MemberExpectation extends Omit<HostExpectation, "startOrder" | "members"> {
|
|
1059
|
+
/** The member's host folder (`children.<key>.host`). */
|
|
1060
|
+
host: string;
|
|
1061
|
+
/** Member keys this member consumes (it starts after them), sorted. */
|
|
1062
|
+
after: string[];
|
|
1063
|
+
}
|
|
1064
|
+
/** A drive a plugin contributes, as plugin contribution discovery reports
|
|
1065
|
+
* it (`resolvePluginContributions`). */
|
|
1066
|
+
interface ContributedDriveInput {
|
|
1067
|
+
declaration: Record<string, unknown>;
|
|
875
1068
|
source: string;
|
|
876
|
-
}
|
|
877
|
-
|
|
1069
|
+
}
|
|
1070
|
+
interface ExpectHostInput {
|
|
1071
|
+
kind: RunnerKind;
|
|
1072
|
+
/** The host as declared (tokens in place); a compound member's draft
|
|
1073
|
+
* (its host.js with the wrapper applied). */
|
|
1074
|
+
declared: Record<string, unknown>;
|
|
1075
|
+
/** The resolved (and parsed) host. Default: `declared`. */
|
|
1076
|
+
resolved?: Record<string, unknown>;
|
|
1077
|
+
/** Drives the host's plugins contribute at its verb. */
|
|
1078
|
+
contributed?: readonly ContributedDriveInput[];
|
|
1079
|
+
/** Compound: its members, any order (the plan orders them). */
|
|
1080
|
+
members?: readonly MemberInput[];
|
|
1081
|
+
/** Compound: the dependency plan (`planCompound`). */
|
|
1082
|
+
plan?: CompoundPlan;
|
|
1083
|
+
}
|
|
1084
|
+
interface MemberInput extends Omit<ExpectHostInput, "members" | "plan"> {
|
|
1085
|
+
key: string;
|
|
1086
|
+
host: string;
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* The expectation for one host. A reactor host's comes from its resolved
|
|
1090
|
+
* reactor block and contributed drives; a compound's lists its members in
|
|
1091
|
+
* plan order, each with the verb it runs at under the compound's own verb
|
|
1092
|
+
* and the members it starts after.
|
|
1093
|
+
*/
|
|
1094
|
+
export declare function expectHost(input: ExpectHostInput): HostExpectation;
|
|
878
1095
|
//#endregion
|
|
879
|
-
export { type
|
|
1096
|
+
export { type ArrayMapToken, type BuiltinEnv, CONNECT_RUNNER, type ChildWrapper, type CompoundHost, type CompoundHostInput, type CompoundPlan, type CompoundWiring, type ConcatToken, type ConnectPluginSlices, type ConnectReactorProjection, type ConsumedOutput, type ContributedDrive, type ContributedDriveInput, type ContributionSource, type Contributions, type DeadConfigWarning, type DeclaredHostOptions, type DeclaredIssue, type DeferredResolution, type DeferredToken, type DriveDeclaration, type DrivePlanEntry, type DriveProjectionInput, type DriveSeederClient, type EnvToken, type ExpectHostInput, type ExpectedBackend, type ExpectedDrive, type HostDefinition, type HostExpectation, type HostImports, type HostOutputsDescription, type HostPlugin, type HostPluginModule, type HostSchemaIssue, type HostSchemaLike, type HostSchemas, type HostsFolderStatus, type ItemToken, type KeyToken, type LoadedHost, type MapToken, type MemberExpectation, type MemberInput, type MergedContribution, type NormalizedPluginEntry, ONE_SHOT_VERBS, type Observe, type OutputLookup, type OutputPath, type OutputRef, type OutputSource, type OutputToken, type OutputsSchemaLookup, type OwnedConfigSlice, type PHHost, type PHHostOutputs, type PlanEdge, type PlanMember, type PluginContributionsPlan, type PluginEntry, type PluginEntryData, type ProducerInfo, type ProducerMap, type Profile, type ProjectedDescriptor, type ProjectedStorage, type Provide, type ReactorBackend, type ReactorBackendKind, type ReactorClientMode, type ReactorConfig, type ReactorHost, type ReactorHostInput, type ReactorPackageConfig, type ReactorProtocol, type ReactorRemoteConfig, type ReactorStorageConfig, type RecordMapToken, type RefFn, type RemovedForm, type ResolveOptions, type ResolveSources, type ResolvedDrive, type ResolvedPlugin, type RunCompoundOptions, type RunCompoundResult, type RunProbe, type RunRecord, type RunRecordMember, type RunnerBase, type RunnerContext, RunnerError, type RunnerHandle, type RunnerHandleData, type RunnerKind, type RunnerModule, type RunnerVerb, type SeedResult, type SelfMembers, type StartedHandle, type SwitchboardReactorProjection, TOKEN_ESCAPE_KEY, TOKEN_KEYS, type Template, type Token, type TokenFor, type TokenKey, type TokenMode, type TokenPosition, type TokenSite, type TokenableSchema, type Transform, type ValidateHostOptions, checkOutputPaths, checkTokenSites, childWrapperSchema, childrenSchema, compoundHostSchema, compoundWiringSchema, concatTokenSchema, declaredGenericCompoundHostSchema, declaredHostSchemas, defineHostSchemas, emitHostJsonSchema, emittedHostSchemas, envSitesOf, envTokenSchema, envTokenable, findToken, forbidRef, genericCompoundHostSchema, getVerb, isSchemaLike, isToken, itemTokenSchema, keyTokenSchema, listVerbs, makeHostSchemas, mapTokenSchema, outputRefsOf, outputSitesOf, outputTokenSchema, profileSchema, reactorBackendKindSchema, reactorBackendSchema, reactorHostSchema, reactorProtocolSchema, reactorSchema, ref, refKey, refineStartOrder, resolveRunnerModule, runCompound, runnerBaseSchema, runnerHandleSchema, runnerKindSchema, schemaAtPath, toStartedHandle, tokenKeyOf, tokenSchema, tokenable, validateDeclaredHost, validateHost };
|
|
880
1097
|
export {};
|
|
881
1098
|
//# sourceMappingURL=index.d.mts.map
|