@powerhousedao/host-core 6.2.3-dev.70 → 6.2.3-dev.72
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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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B,MAAM;;;EAGN;;;EAGA;GACC;;iBAamB,oBACpB,qBACA,oBACC,QAAQ;;;;;cA6DE,gBAAgB;iBAEb,UAAU,GAAG,QAAQ,aAAa;iBAelC,QAAQ,GACtB,QAAQ,aAAa,IACrB,mBACA,eACC,WAAW;UAwFG;;;;;EAKf,SAAS;;;;;;;;iBASK,aAAa,GAC3B,QAAQ,aAAa,IACrB,mBACA,eACA,cACA,UAAS,sBACR;UAgEc;;;EAGf,mBAAmB,KAAK,cAAc;;;;;;;;;;iBAWxB,qBACd,QAAQ,cACR,mBACA,eACA,cACA,UAAS;;;;;;;;;UCrXM,aAAa,IAAI;EAChC,SAAS;;EAET,OAAO;;EAEP,YAAY;;;;cAKD,oBAAkB,EAAA;;GAE7B,EAAA,KAAA;KAEU,mBAAmB,EAAE,aAAa;;;UAI7B,sBAAsB;EACrC,SAAS;EACT,QAAQ;EACR;;;;iBAiBc,gBAAgB,gBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;UCUtD;EACR;EACA,QAAQ;EACR;EACA,MAAM;EACN;EACA,QAAQ;;;EAGR,SAAS;;UAiDM;;EAEf;;EAEA,cAAc;;;EAGd;;EAEA,QAAQ;;UAGO;EACf,SAAS;;;EAGT,gBAAgB;;;;EAIhB,eAAe,iCAAiC;;iBAa5B,YACpB,WAAW,gBACX,KAAK,eACL,SAAS,qBACR,QAAQ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/env-substitution.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pure built-in `$env` substitution: the `"${userData}"` / `"${projectRoot}"`
|
|
4
|
+
* string sugar, deep-applied to a JSON-shaped value. No node imports, so it
|
|
5
|
+
* ships in `./schema`; the node default for userData is placeholders.ts.
|
|
6
|
+
*/
|
|
7
|
+
interface BuiltinEnv {
|
|
8
|
+
userData?: string;
|
|
9
|
+
projectRoot?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Deep-substitute the built-ins that `env` provides in every string; an
|
|
12
|
+
* absent built-in is left as written. The input is never mutated. */
|
|
13
|
+
declare function substituteBuiltinEnv<T>(value: T, env: BuiltinEnv): T;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { substituteBuiltinEnv as n, BuiltinEnv as t };
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=env-substitution-C_fVirPh.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-substitution-C_fVirPh.d.mts","names":[],"sources":["../src/env-substitution.ts"],"mappings":";;;;;;UAMiB;EACf;EACA;;;;iBAcc,qBAAqB,GAAG,OAAO,GAAG,KAAK,aAAa"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { pluginEntrySchema } from "./plugins.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { TOKEN_ESCAPE_KEY, TOKEN_KEYS, concatTokenSchema, envTokenSchema, envTokenable, findToken, forbidRef, isToken, itemTokenSchema, keyTokenSchema, mapTokenSchema, outputTokenSchema, ref, tokenKeyOf, tokenSchema, tokenable } from "@powerhousedao/shared/host-tokens";
|
|
4
|
+
//#region src/drive-schema.ts
|
|
5
|
+
/**
|
|
6
|
+
* The schema half of drives.ts, zod only so `./schema` stays neutral.
|
|
7
|
+
* - slug: the SEEDING KEY (idempotence); id optional (stable identity).
|
|
8
|
+
* - preferredEditor: stored at header.meta.preferredEditor; Connect config's
|
|
9
|
+
* `app` is the legacy alias.
|
|
10
|
+
* - remote.url: a drive served elsewhere; local fields are ignored for it.
|
|
11
|
+
* Token-able (`$output` on a producer's `drives.<slug>.url`).
|
|
12
|
+
*/
|
|
13
|
+
function buildDriveDeclarationSchema(urlField) {
|
|
14
|
+
return z.strictObject({
|
|
15
|
+
slug: z.string().min(1),
|
|
16
|
+
id: z.string().min(1).optional(),
|
|
17
|
+
/** Derive the id from the project path, like generateProjectDriveId — the
|
|
18
|
+
* same ids classic `ph vetra` produces. `true` serves the drive under the
|
|
19
|
+
* hashed slug too (the vetra drive's slug IS its hashed id); `"id"` hashes
|
|
20
|
+
* only the id and keeps the declared slug (the classic Workflows drive:
|
|
21
|
+
* `/d/workflows`, id `workflows-<hash>`). */
|
|
22
|
+
projectHash: z.union([z.boolean(), z.literal("id")]).optional(),
|
|
23
|
+
name: z.string().min(1).optional(),
|
|
24
|
+
icon: z.string().optional(),
|
|
25
|
+
preferredEditor: z.string().optional(),
|
|
26
|
+
sharingType: z.enum([
|
|
27
|
+
"public",
|
|
28
|
+
"private",
|
|
29
|
+
"shared"
|
|
30
|
+
]).optional(),
|
|
31
|
+
availableOffline: z.boolean().optional(),
|
|
32
|
+
remote: z.strictObject({ url: urlField(z.string().min(1)) }).optional()
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const driveDeclarationSchema = buildDriveDeclarationSchema(tokenable);
|
|
36
|
+
const drivesSchema = z.array(driveDeclarationSchema);
|
|
37
|
+
/** The project-hashed drive id (`${slug}-${sha256(projectRoot)[0..8]}`) with
|
|
38
|
+
* the hash function injected, so neutral consumers (a browser monitor) can
|
|
39
|
+
* pass `crypto.subtle`-derived or precomputed hex. drives.ts binds it to
|
|
40
|
+
* node:crypto as `projectDriveId`. */
|
|
41
|
+
function projectDriveIdWith(sha256Hex, projectRoot, slug) {
|
|
42
|
+
return `${slug}-${sha256Hex(projectRoot).substring(0, 8)}`;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/host-schemas.ts
|
|
46
|
+
/**
|
|
47
|
+
* The zod single source for host.js blocks (typed-host-configs G1). Every
|
|
48
|
+
* host type is z.input/z.output of these schemas; nothing is hand-mirrored.
|
|
49
|
+
* Top-level host objects and the `reactor` block are STRICT (a typo fails);
|
|
50
|
+
* `runner` stays loose until each runner declares its options (T2), and
|
|
51
|
+
* `config` is runner-defined.
|
|
52
|
+
*
|
|
53
|
+
* Token-able fields (typed-host-configs 3.5): `reactor.backends.*.remote.url`
|
|
54
|
+
* (required), `reactor.drives` (whole list, e.g. `$map`),
|
|
55
|
+
* `reactor.drives[].remote.url` and `storage.dataDir` (`$env` only). Their z.input admits tokens, their z.output is the resolved type.
|
|
56
|
+
*/
|
|
57
|
+
const profileSchema = z.strictObject({
|
|
58
|
+
appId: z.string().min(1).optional(),
|
|
59
|
+
name: z.string().min(1).optional(),
|
|
60
|
+
description: z.string().optional(),
|
|
61
|
+
icon: z.string().optional()
|
|
62
|
+
});
|
|
63
|
+
const reactorProtocolSchema = z.strictObject({
|
|
64
|
+
featureFlags: z.strictObject({
|
|
65
|
+
documentDecisions: z.boolean().optional(),
|
|
66
|
+
authEnforcement: z.boolean().optional(),
|
|
67
|
+
authGroups: z.boolean().optional(),
|
|
68
|
+
authConditions: z.boolean().optional()
|
|
69
|
+
}).optional(),
|
|
70
|
+
createSignaturePolicy: z.enum(["legacy", "v2-required"]).optional(),
|
|
71
|
+
unsupportedStoredDocuments: z.enum(["refuse", "read-only"]).optional()
|
|
72
|
+
});
|
|
73
|
+
const runnerKindSchema = z.enum(["reactor", "compound"]);
|
|
74
|
+
const reactorBackendKindSchema = z.enum([
|
|
75
|
+
"in-process",
|
|
76
|
+
"worker",
|
|
77
|
+
"remote"
|
|
78
|
+
]);
|
|
79
|
+
const samePath = (a, b) => {
|
|
80
|
+
const norm = (p) => p.replace(/\\/g, "/").replace(/\/+$/, "").replace(/^\.\//, "");
|
|
81
|
+
return norm(a) === norm(b);
|
|
82
|
+
};
|
|
83
|
+
/** Compound wiring: the generic compound runner's `config` block.
|
|
84
|
+
* (`projectDrivesIntoConnect` and `drivesPublicBase` were removed in T3: a
|
|
85
|
+
* member consumes another member's drives through `$output` tokens.) */
|
|
86
|
+
const compoundWiringSchema = z.strictObject({
|
|
87
|
+
/** Member start order; must name declared children and agree with the
|
|
88
|
+
* output-token dependencies (resolve/plan.ts). Optional: without it the
|
|
89
|
+
* order is derived from the tokens. Unnamed members start after the named
|
|
90
|
+
* ones, in declaration order. */
|
|
91
|
+
startOrder: z.array(z.string().min(1)).optional(),
|
|
92
|
+
/** Write .ph/run/<host>.json (default true). */
|
|
93
|
+
runtimeRecord: z.boolean().optional(),
|
|
94
|
+
/** Patch the baked CSP for the runtime registry on a served Connect
|
|
95
|
+
* member (forwarded as `runner.cspRegistrySync` to every member whose
|
|
96
|
+
* runner is `@powerhousedao/ph-cli/runners/connect`). */
|
|
97
|
+
cspRegistrySync: z.boolean().optional()
|
|
98
|
+
});
|
|
99
|
+
/** `config.startOrder ⊆ keys(children)`, checked where both are visible.
|
|
100
|
+
* Apply it LAST (`.superRefine(refineStartOrder)`) to a runner's final host
|
|
101
|
+
* schema: zod refuses to `.extend()` a refined object. */
|
|
102
|
+
function refineStartOrder(host, ctx) {
|
|
103
|
+
const startOrder = host.config?.startOrder;
|
|
104
|
+
if (!Array.isArray(startOrder)) return;
|
|
105
|
+
const members = Object.keys(host.children);
|
|
106
|
+
startOrder.forEach((name, index) => {
|
|
107
|
+
if (startOrder.indexOf(name) !== index) {
|
|
108
|
+
ctx.addIssue({
|
|
109
|
+
code: "custom",
|
|
110
|
+
path: [
|
|
111
|
+
"config",
|
|
112
|
+
"startOrder",
|
|
113
|
+
index
|
|
114
|
+
],
|
|
115
|
+
message: `startOrder names "${String(name)}" twice; each member starts once.`
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (typeof name === "string" && members.includes(name)) return;
|
|
120
|
+
ctx.addIssue({
|
|
121
|
+
code: "custom",
|
|
122
|
+
path: [
|
|
123
|
+
"config",
|
|
124
|
+
"startOrder",
|
|
125
|
+
index
|
|
126
|
+
],
|
|
127
|
+
message: `startOrder names "${String(name)}", which is not a member. Members: ${members.join(", ") || "(none)"}.`
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
const ALLOW_TOKENS = {
|
|
132
|
+
any: tokenable,
|
|
133
|
+
env: envTokenable
|
|
134
|
+
};
|
|
135
|
+
const FORBID_TOKENS = {
|
|
136
|
+
any: (schema) => z.union([schema]),
|
|
137
|
+
env: (schema) => z.union([schema])
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Builds the host schema set. "allow" (declared form) accepts `T | Token` in
|
|
141
|
+
* every token-able field; "forbid" (resolved form) accepts `T` only.
|
|
142
|
+
*/
|
|
143
|
+
function buildHostSchemas(tokenField) {
|
|
144
|
+
const reactorBackendSchema = z.strictObject({
|
|
145
|
+
kind: reactorBackendKindSchema,
|
|
146
|
+
storage: z.strictObject({
|
|
147
|
+
kind: z.enum([
|
|
148
|
+
"idb",
|
|
149
|
+
"memory",
|
|
150
|
+
"path",
|
|
151
|
+
"postgres"
|
|
152
|
+
]),
|
|
153
|
+
/** `"${userData}/…"` sugar or `{ $env: "NAME" }`. */
|
|
154
|
+
dataDir: tokenField.env(z.string()).optional(),
|
|
155
|
+
url: z.string().optional()
|
|
156
|
+
}).optional(),
|
|
157
|
+
readModel: z.strictObject({ url: z.string().optional() }).optional(),
|
|
158
|
+
packages: z.strictObject({
|
|
159
|
+
cdnUrl: z.string().optional(),
|
|
160
|
+
specs: z.array(z.string()).optional(),
|
|
161
|
+
/** on-demand model resolution (was DYNAMIC_MODEL_LOADING). */
|
|
162
|
+
dynamic: z.boolean().optional()
|
|
163
|
+
}).optional(),
|
|
164
|
+
remote: z.strictObject({ url: tokenField.any(z.url()) }).optional(),
|
|
165
|
+
projection: z.strictObject({
|
|
166
|
+
enabled: z.boolean().optional(),
|
|
167
|
+
dbPoolSize: z.number().int().positive().optional()
|
|
168
|
+
}).optional(),
|
|
169
|
+
executors: z.strictObject({ numWorkers: z.union([z.number().int().positive(), z.literal("auto")]).optional() }).optional()
|
|
170
|
+
}).superRefine((backend, ctx) => {
|
|
171
|
+
if (backend.kind === "remote" && !backend.remote) ctx.addIssue({
|
|
172
|
+
code: "custom",
|
|
173
|
+
path: ["remote", "url"],
|
|
174
|
+
message: "a \"remote\" backend needs remote.url: remote: { url: switchboard.endpoints.graphql } with switchboard from ../switchboard/outputs.js, or remote: { url: { $output: { host: \"switchboard\", path: [\"endpoints\", \"graphql\"] } } }."
|
|
175
|
+
});
|
|
176
|
+
const store = backend.storage;
|
|
177
|
+
const storeDir = store?.kind === "path" ? store.dataDir : void 0;
|
|
178
|
+
const readModel = backend.readModel?.url;
|
|
179
|
+
if (typeof storeDir === "string" && readModel && samePath(storeDir, readModel)) ctx.addIssue({
|
|
180
|
+
code: "custom",
|
|
181
|
+
path: ["readModel", "url"],
|
|
182
|
+
message: `readModel.url must not be the reactor's storage dir (${readModel}): two PGlite instances on one data dir corrupt it. Omit readModel.url to get the classic <root>/.ph/read-storage next to the reactor store.`
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
const reactorSchema = z.strictObject({
|
|
186
|
+
backends: z.record(z.string(), reactorBackendSchema).optional(),
|
|
187
|
+
placement: z.strictObject({
|
|
188
|
+
primary: z.string().optional(),
|
|
189
|
+
default: z.looseObject({}).optional()
|
|
190
|
+
}).optional(),
|
|
191
|
+
protocol: reactorProtocolSchema.optional(),
|
|
192
|
+
/** DEPRECATED (dies in R2): workflows become a listed plugin. */
|
|
193
|
+
workflows: z.boolean().optional(),
|
|
194
|
+
renown: z.strictObject({
|
|
195
|
+
url: z.string().optional(),
|
|
196
|
+
networkId: z.string().optional(),
|
|
197
|
+
chainId: z.number().int().optional()
|
|
198
|
+
}).optional(),
|
|
199
|
+
packages: z.strictObject({ registryUrl: z.string().optional() }).optional(),
|
|
200
|
+
namespace: z.string().min(1).optional(),
|
|
201
|
+
auth: z.strictObject({
|
|
202
|
+
enabled: z.boolean().optional(),
|
|
203
|
+
admins: z.array(z.string()).optional(),
|
|
204
|
+
renown: z.looseObject({}).optional()
|
|
205
|
+
}).optional(),
|
|
206
|
+
drives: tokenField.any(z.array(buildDriveDeclarationSchema(tokenField.any))).optional()
|
|
207
|
+
});
|
|
208
|
+
/** Common runner options; runner modules extend it with their own. */
|
|
209
|
+
const runnerBaseSchema = z.looseObject({
|
|
210
|
+
module: z.string().min(1),
|
|
211
|
+
defaultVerb: z.string().min(1).optional(),
|
|
212
|
+
port: z.number().int().positive().optional(),
|
|
213
|
+
/** Bind address; each runner documents its default. */
|
|
214
|
+
host: z.string().min(1).optional(),
|
|
215
|
+
/** THE COMPOSITION: plugin entries; presence is activation. */
|
|
216
|
+
plugins: z.array(pluginEntrySchema).optional()
|
|
217
|
+
});
|
|
218
|
+
/** A compound member wrapper. Sections are FULL STATEMENTS except `runner`,
|
|
219
|
+
* which key-merges over the member's own. Plugins live in `runner.plugins`
|
|
220
|
+
* (as on a standalone host); there is no wrapper-level `plugins`. */
|
|
221
|
+
const childWrapperSchema = z.strictObject({
|
|
222
|
+
host: z.string().min(1),
|
|
223
|
+
runner: runnerBaseSchema.partial().optional(),
|
|
224
|
+
config: z.looseObject({}).optional(),
|
|
225
|
+
reactor: reactorSchema.optional()
|
|
226
|
+
});
|
|
227
|
+
const childrenSchema = z.record(z.string(), childWrapperSchema);
|
|
228
|
+
return {
|
|
229
|
+
reactorBackendSchema,
|
|
230
|
+
reactorSchema,
|
|
231
|
+
runnerBaseSchema,
|
|
232
|
+
childWrapperSchema,
|
|
233
|
+
childrenSchema,
|
|
234
|
+
reactorHostSchema: z.strictObject({
|
|
235
|
+
name: z.string().min(1),
|
|
236
|
+
runner: runnerBaseSchema,
|
|
237
|
+
config: z.looseObject({}).optional(),
|
|
238
|
+
profile: profileSchema.optional(),
|
|
239
|
+
reactor: reactorSchema.optional()
|
|
240
|
+
}),
|
|
241
|
+
compoundHostSchema: z.strictObject({
|
|
242
|
+
name: z.string().min(1),
|
|
243
|
+
runner: runnerBaseSchema,
|
|
244
|
+
children: childrenSchema,
|
|
245
|
+
config: z.looseObject({}).optional(),
|
|
246
|
+
profile: profileSchema.optional()
|
|
247
|
+
}),
|
|
248
|
+
/** This set's field wrapper, for a runner's OWN token-able fields inside
|
|
249
|
+
* `defineHostSchemas`: declared, `T | Token` in and `T` out; resolved,
|
|
250
|
+
* `T` only. Both modes share one static type. */
|
|
251
|
+
tokenable: tokenField.any,
|
|
252
|
+
/** As `tokenable`, but the only token accepted is `$env`. */
|
|
253
|
+
envTokenable: tokenField.env
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/** The host schema set in declared ("allow": token-able fields take tokens)
|
|
257
|
+
* or resolved ("forbid") form. */
|
|
258
|
+
function makeHostSchemas(options) {
|
|
259
|
+
return buildHostSchemas(options.tokens === "allow" ? ALLOW_TOKENS : FORBID_TOKENS);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* One runner definition, two schemas (3.5): `build` runs over the DECLARED
|
|
263
|
+
* set (tokens allowed; its z.input types host files) and the RESOLVED set
|
|
264
|
+
* (no tokens; `validateHost` checks it before the verb). Export both, type
|
|
265
|
+
* the host as `z.input<typeof declaredHostSchema>`, refine last inside the
|
|
266
|
+
* builder (zod can't extend a refined object), and wrap the runner's own
|
|
267
|
+
* token-able fields with `s.tokenable` / `s.envTokenable`.
|
|
268
|
+
*/
|
|
269
|
+
function defineHostSchemas(build) {
|
|
270
|
+
return {
|
|
271
|
+
declaredHostSchema: build(declaredSchemas),
|
|
272
|
+
hostSchema: build(resolvedSchemas)
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
const declaredSchemas = makeHostSchemas({ tokens: "allow" });
|
|
276
|
+
const resolvedSchemas = makeHostSchemas({ tokens: "forbid" });
|
|
277
|
+
const declaredHostSchemas = declaredSchemas;
|
|
278
|
+
const reactorBackendSchema = resolvedSchemas.reactorBackendSchema;
|
|
279
|
+
const reactorSchema = resolvedSchemas.reactorSchema;
|
|
280
|
+
const runnerBaseSchema = resolvedSchemas.runnerBaseSchema;
|
|
281
|
+
const childWrapperSchema = resolvedSchemas.childWrapperSchema;
|
|
282
|
+
const childrenSchema = resolvedSchemas.childrenSchema;
|
|
283
|
+
const reactorHostSchema = resolvedSchemas.reactorHostSchema;
|
|
284
|
+
const compoundHostSchema = resolvedSchemas.compoundHostSchema;
|
|
285
|
+
/** The generic compound runner's host: the base with its wiring config. */
|
|
286
|
+
const genericCompound = defineHostSchemas((s) => s.compoundHostSchema.extend({ config: compoundWiringSchema.optional() }).superRefine(refineStartOrder));
|
|
287
|
+
const genericCompoundHostSchema = genericCompound.hostSchema;
|
|
288
|
+
const declaredGenericCompoundHostSchema = genericCompound.declaredHostSchema;
|
|
289
|
+
const SCHEMA_BASE = "https://powerhouse.inc/schemas";
|
|
290
|
+
/** One host schema as an editor JSON Schema with a stable `$id` — the
|
|
291
|
+
* per-runner emission helper (runner packages emit their own hostSchema). */
|
|
292
|
+
function emitHostJsonSchema(name, schema) {
|
|
293
|
+
return {
|
|
294
|
+
$id: `${SCHEMA_BASE}/${name}.schema.json`,
|
|
295
|
+
...z.toJSONSchema(schema, { io: "input" })
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
/** The emitted-schema set, keyed by published filename. Pure — the
|
|
299
|
+
* emit-schemas script writes these and the drift test re-derives them. */
|
|
300
|
+
function emittedHostSchemas() {
|
|
301
|
+
return {
|
|
302
|
+
"host-reactor.schema.json": emitHostJsonSchema("host-reactor", declaredSchemas.reactorHostSchema),
|
|
303
|
+
"host-compound.schema.json": emitHostJsonSchema("host-compound", declaredSchemas.compoundHostSchema)
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/env-substitution.ts
|
|
308
|
+
const BUILTIN = /\$\{(userData|projectRoot)\}/g;
|
|
309
|
+
function substitute(text, env) {
|
|
310
|
+
return text.replace(BUILTIN, (match, name) => env[name] ?? match);
|
|
311
|
+
}
|
|
312
|
+
/** Deep-substitute the built-ins that `env` provides in every string; an
|
|
313
|
+
* absent built-in is left as written. The input is never mutated. */
|
|
314
|
+
function substituteBuiltinEnv(value, env) {
|
|
315
|
+
return substituteValue(value, env);
|
|
316
|
+
}
|
|
317
|
+
function substituteValue(value, env) {
|
|
318
|
+
if (typeof value === "string") return substitute(value, env);
|
|
319
|
+
if (Array.isArray(value)) return value.map((v) => substituteValue(v, env));
|
|
320
|
+
if (value !== null && typeof value === "object") {
|
|
321
|
+
const out = {};
|
|
322
|
+
for (const [k, v] of Object.entries(value)) out[k] = substituteValue(v, env);
|
|
323
|
+
return out;
|
|
324
|
+
}
|
|
325
|
+
return value;
|
|
326
|
+
}
|
|
327
|
+
//#endregion
|
|
328
|
+
export { envTokenable as A, tokenSchema as B, driveDeclarationSchema as C, TOKEN_KEYS as D, TOKEN_ESCAPE_KEY as E, keyTokenSchema as F, mapTokenSchema as I, outputTokenSchema as L, forbidRef as M, isToken as N, concatTokenSchema as O, itemTokenSchema as P, ref as R, buildDriveDeclarationSchema as S, projectDriveIdWith as T, tokenable as V, reactorProtocolSchema as _, compoundWiringSchema as a, runnerBaseSchema as b, defineHostSchemas as c, genericCompoundHostSchema as d, makeHostSchemas as f, reactorHostSchema as g, reactorBackendSchema as h, compoundHostSchema as i, findToken as j, envTokenSchema as k, emitHostJsonSchema as l, reactorBackendKindSchema as m, childWrapperSchema as n, declaredGenericCompoundHostSchema as o, profileSchema as p, childrenSchema as r, declaredHostSchemas as s, substituteBuiltinEnv as t, emittedHostSchemas as u, reactorSchema as v, drivesSchema as w, runnerKindSchema as x, refineStartOrder as y, tokenKeyOf as z };
|
|
329
|
+
|
|
330
|
+
//# sourceMappingURL=env-substitution-Dj3pdsut.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-substitution-Dj3pdsut.mjs","names":[],"sources":["../src/drive-schema.ts","../src/host-schemas.ts","../src/env-substitution.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { tokenable, type TokenableSchema } from \"./tokens.js\";\n\n/**\n * The schema half of drives.ts, zod only so `./schema` stays neutral.\n * - slug: the SEEDING KEY (idempotence); id optional (stable identity).\n * - preferredEditor: stored at header.meta.preferredEditor; Connect config's\n * `app` is the legacy alias.\n * - remote.url: a drive served elsewhere; local fields are ignored for it.\n * Token-able (`$output` on a producer's `drives.<slug>.url`).\n */\nexport function buildDriveDeclarationSchema(\n urlField: (schema: z.ZodString) => TokenableSchema<z.ZodString>,\n) {\n return z.strictObject({\n slug: z.string().min(1),\n id: z.string().min(1).optional(),\n /** Derive the id from the project path, like generateProjectDriveId — the\n * same ids classic `ph vetra` produces. `true` serves the drive under the\n * hashed slug too (the vetra drive's slug IS its hashed id); `\"id\"` hashes\n * only the id and keeps the declared slug (the classic Workflows drive:\n * `/d/workflows`, id `workflows-<hash>`). */\n projectHash: z.union([z.boolean(), z.literal(\"id\")]).optional(),\n name: z.string().min(1).optional(),\n icon: z.string().optional(),\n preferredEditor: z.string().optional(),\n sharingType: z.enum([\"public\", \"private\", \"shared\"]).optional(),\n availableOffline: z.boolean().optional(),\n remote: z.strictObject({ url: urlField(z.string().min(1)) }).optional(),\n });\n}\n\nexport const driveDeclarationSchema = buildDriveDeclarationSchema(tokenable);\n\nexport type DriveDeclaration = z.infer<typeof driveDeclarationSchema>;\n\nexport const drivesSchema = z.array(driveDeclarationSchema);\n\n/** The project-hashed drive id (`${slug}-${sha256(projectRoot)[0..8]}`) with\n * the hash function injected, so neutral consumers (a browser monitor) can\n * pass `crypto.subtle`-derived or precomputed hex. drives.ts binds it to\n * node:crypto as `projectDriveId`. */\nexport function projectDriveIdWith(\n sha256Hex: (input: string) => string,\n projectRoot: string,\n slug: string,\n): string {\n return `${slug}-${sha256Hex(projectRoot).substring(0, 8)}`;\n}\n","import { z } from \"zod\";\nimport { buildDriveDeclarationSchema } from \"./drive-schema.js\";\nimport { pluginEntrySchema } from \"./plugins.js\";\nimport {\n envTokenable,\n tokenable,\n type EnvToken,\n type TokenableSchema,\n type TokenMode,\n} from \"./tokens.js\";\n\n/**\n * The zod single source for host.js blocks (typed-host-configs G1). Every\n * host type is z.input/z.output of these schemas; nothing is hand-mirrored.\n * Top-level host objects and the `reactor` block are STRICT (a typo fails);\n * `runner` stays loose until each runner declares its options (T2), and\n * `config` is runner-defined.\n *\n * Token-able fields (typed-host-configs 3.5): `reactor.backends.*.remote.url`\n * (required), `reactor.drives` (whole list, e.g. `$map`),\n * `reactor.drives[].remote.url` and `storage.dataDir` (`$env` only). Their z.input admits tokens, their z.output is the resolved type.\n */\n\nexport const profileSchema = z.strictObject({\n appId: z.string().min(1).optional(),\n name: z.string().min(1).optional(),\n description: z.string().optional(),\n icon: z.string().optional(),\n});\n\nexport const reactorProtocolSchema = z.strictObject({\n featureFlags: z\n .strictObject({\n documentDecisions: z.boolean().optional(),\n authEnforcement: z.boolean().optional(),\n authGroups: z.boolean().optional(),\n authConditions: z.boolean().optional(),\n })\n .optional(),\n createSignaturePolicy: z.enum([\"legacy\", \"v2-required\"]).optional(),\n unsupportedStoredDocuments: z.enum([\"refuse\", \"read-only\"]).optional(),\n});\n\nexport const runnerKindSchema = z.enum([\"reactor\", \"compound\"]);\nexport type RunnerKind = z.infer<typeof runnerKindSchema>;\n\nexport const reactorBackendKindSchema = z.enum([\n \"in-process\",\n \"worker\",\n \"remote\",\n]);\n\n// Path-equality for the one-dir guard: pure string normalisation (the host\n// core stays Node-free); the server repeats the check with path.resolve.\nconst samePath = (a: string, b: string): boolean => {\n const norm = (p: string) =>\n p.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\").replace(/^\\.\\//, \"\");\n return norm(a) === norm(b);\n};\n\n/** Compound wiring: the generic compound runner's `config` block.\n * (`projectDrivesIntoConnect` and `drivesPublicBase` were removed in T3: a\n * member consumes another member's drives through `$output` tokens.) */\nexport const compoundWiringSchema = z.strictObject({\n /** Member start order; must name declared children and agree with the\n * output-token dependencies (resolve/plan.ts). Optional: without it the\n * order is derived from the tokens. Unnamed members start after the named\n * ones, in declaration order. */\n startOrder: z.array(z.string().min(1)).optional(),\n /** Write .ph/run/<host>.json (default true). */\n runtimeRecord: z.boolean().optional(),\n /** Patch the baked CSP for the runtime registry on a served Connect\n * member (forwarded as `runner.cspRegistrySync` to every member whose\n * runner is `@powerhousedao/ph-cli/runners/connect`). */\n cspRegistrySync: z.boolean().optional(),\n});\n\n/** `config.startOrder ⊆ keys(children)`, checked where both are visible.\n * Apply it LAST (`.superRefine(refineStartOrder)`) to a runner's final host\n * schema: zod refuses to `.extend()` a refined object. */\nexport function refineStartOrder(\n host: { children: Record<string, unknown>; config?: Record<string, unknown> },\n ctx: z.RefinementCtx,\n): void {\n const startOrder = host.config?.startOrder;\n if (!Array.isArray(startOrder)) return;\n const members = Object.keys(host.children);\n startOrder.forEach((name: unknown, index) => {\n if (startOrder.indexOf(name) !== index) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"config\", \"startOrder\", index],\n message: `startOrder names \"${String(name)}\" twice; each member starts once.`,\n });\n return;\n }\n if (typeof name === \"string\" && members.includes(name)) return;\n ctx.addIssue({\n code: \"custom\",\n path: [\"config\", \"startOrder\", index],\n message: `startOrder names \"${String(name)}\", which is not a member. Members: ${members.join(\", \") || \"(none)\"}.`,\n });\n });\n}\n\n/** How a schema set wraps its token-able fields. Both modes share one static\n * type (declared input, resolved output); they differ at runtime only. */\ninterface FieldWrappers {\n any: <S extends z.ZodType>(schema: S) => TokenableSchema<S>;\n env: <S extends z.ZodType>(schema: S) => TokenableSchema<S, EnvToken>;\n}\n\nconst ALLOW_TOKENS: FieldWrappers = { any: tokenable, env: envTokenable };\n// A one-option union: the same validation as `schema`, typed like the\n// \"allow\" wrappers so both modes share HostSchemas.\nconst FORBID_TOKENS: FieldWrappers = {\n any: (schema) => z.union([schema]),\n env: (schema) => z.union([schema]),\n};\n\n/**\n * Builds the host schema set. \"allow\" (declared form) accepts `T | Token` in\n * every token-able field; \"forbid\" (resolved form) accepts `T` only.\n */\nfunction buildHostSchemas(tokenField: FieldWrappers) {\n const reactorBackendSchema = z\n .strictObject({\n kind: reactorBackendKindSchema,\n storage: z\n .strictObject({\n kind: z.enum([\"idb\", \"memory\", \"path\", \"postgres\"]),\n /** `\"${userData}/…\"` sugar or `{ $env: \"NAME\" }`. */\n dataDir: tokenField.env(z.string()).optional(),\n url: z.string().optional(),\n })\n .optional(),\n readModel: z.strictObject({ url: z.string().optional() }).optional(),\n packages: z\n .strictObject({\n cdnUrl: z.string().optional(),\n specs: z.array(z.string()).optional(),\n /** on-demand model resolution (was DYNAMIC_MODEL_LOADING). */\n dynamic: z.boolean().optional(),\n })\n .optional(),\n // The reactor to attach to, by URL: typically a producer's\n // `endpoints.graphql` output token. (`remote.host` was removed in T3.)\n remote: z.strictObject({ url: tokenField.any(z.url()) }).optional(),\n // Deployment topology (R1): field names match the real switchboard\n // options (projectionWorker / workerPool).\n projection: z\n .strictObject({\n enabled: z.boolean().optional(),\n dbPoolSize: z.number().int().positive().optional(),\n })\n .optional(),\n executors: z\n .strictObject({\n numWorkers: z\n .union([z.number().int().positive(), z.literal(\"auto\")])\n .optional(),\n })\n .optional(),\n })\n // Two PGlite instances on one data dir corrupt it: the reactor store\n // (storage.dataDir) and the read-model store (readModel.url) must differ.\n // Postgres is exempt: one database legitimately serves both stores.\n .superRefine((backend, ctx) => {\n // 2.1 \"a remote backend needs url\": `remote` is optional for the\n // in-process/worker kinds, but a remote backend attaches by URL only.\n if (backend.kind === \"remote\" && !backend.remote) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"remote\", \"url\"],\n message:\n 'a \"remote\" backend needs remote.url: remote: { url: switchboard.endpoints.graphql } ' +\n 'with switchboard from ../switchboard/outputs.js, or remote: { url: { $output: { host: \"switchboard\", path: [\"endpoints\", \"graphql\"] } } }.',\n });\n }\n const store = backend.storage;\n const storeDir = store?.kind === \"path\" ? store.dataDir : undefined;\n const readModel = backend.readModel?.url;\n // In the declared form dataDir may still be a `$env` token: compare\n // only resolved strings (resolved validation re-runs this check).\n if (\n typeof storeDir === \"string\" &&\n readModel &&\n samePath(storeDir, readModel)\n ) {\n ctx.addIssue({\n code: \"custom\",\n path: [\"readModel\", \"url\"],\n message:\n `readModel.url must not be the reactor's storage dir (${readModel}): ` +\n \"two PGlite instances on one data dir corrupt it. Omit readModel.url \" +\n \"to get the classic <root>/.ph/read-storage next to the reactor store.\",\n });\n }\n });\n\n const reactorSchema = z.strictObject({\n backends: z.record(z.string(), reactorBackendSchema).optional(),\n placement: z\n .strictObject({\n primary: z.string().optional(),\n default: z.looseObject({}).optional(),\n })\n .optional(),\n protocol: reactorProtocolSchema.optional(),\n /** DEPRECATED (dies in R2): workflows become a listed plugin. */\n workflows: z.boolean().optional(),\n // R1 core keys: identity/signing, package registry, storage namespace,\n // access control — capabilities and intrinsics of the reactor.\n renown: z\n .strictObject({\n url: z.string().optional(),\n networkId: z.string().optional(),\n chainId: z.number().int().optional(),\n })\n .optional(),\n packages: z.strictObject({ registryUrl: z.string().optional() }).optional(),\n namespace: z.string().min(1).optional(),\n auth: z\n .strictObject({\n enabled: z.boolean().optional(),\n admins: z.array(z.string()).optional(),\n renown: z.looseObject({}).optional(),\n })\n .optional(),\n // Core-declared, seeded by the host runtime. Token-able as a whole\n // (3.3): a `$map` over a producer's `drives` output (or an `$output` of\n // an array of declarations) renders the list at resolve time.\n drives: tokenField\n .any(z.array(buildDriveDeclarationSchema(tokenField.any)))\n .optional(),\n });\n\n /** Common runner options; runner modules extend it with their own. */\n const runnerBaseSchema = z.looseObject({\n module: z.string().min(1),\n defaultVerb: z.string().min(1).optional(),\n port: z.number().int().positive().optional(),\n /** Bind address; each runner documents its default. */\n host: z.string().min(1).optional(),\n /** THE COMPOSITION: plugin entries; presence is activation. */\n plugins: z.array(pluginEntrySchema).optional(),\n });\n\n /** A compound member wrapper. Sections are FULL STATEMENTS except `runner`,\n * which key-merges over the member's own. Plugins live in `runner.plugins`\n * (as on a standalone host); there is no wrapper-level `plugins`. */\n const childWrapperSchema = z.strictObject({\n host: z.string().min(1),\n runner: runnerBaseSchema.partial().optional(),\n config: z.looseObject({}).optional(),\n reactor: reactorSchema.optional(),\n });\n\n const childrenSchema = z.record(z.string(), childWrapperSchema);\n\n const reactorHostSchema = z.strictObject({\n name: z.string().min(1),\n runner: runnerBaseSchema,\n config: z.looseObject({}).optional(),\n profile: profileSchema.optional(),\n reactor: reactorSchema.optional(),\n });\n\n const compoundHostSchema = z.strictObject({\n name: z.string().min(1),\n runner: runnerBaseSchema,\n children: childrenSchema,\n config: z.looseObject({}).optional(),\n profile: profileSchema.optional(),\n });\n\n return {\n reactorBackendSchema,\n reactorSchema,\n runnerBaseSchema,\n childWrapperSchema,\n childrenSchema,\n reactorHostSchema,\n compoundHostSchema,\n /** This set's field wrapper, for a runner's OWN token-able fields inside\n * `defineHostSchemas`: declared, `T | Token` in and `T` out; resolved,\n * `T` only. Both modes share one static type. */\n tokenable: tokenField.any,\n /** As `tokenable`, but the only token accepted is `$env`. */\n envTokenable: tokenField.env,\n };\n}\n\nexport type HostSchemas = ReturnType<typeof buildHostSchemas>;\n\n/** The host schema set in declared (\"allow\": token-able fields take tokens)\n * or resolved (\"forbid\") form. */\nexport function makeHostSchemas(options: { tokens: TokenMode }): HostSchemas {\n return buildHostSchemas(\n options.tokens === \"allow\" ? ALLOW_TOKENS : FORBID_TOKENS,\n );\n}\n\n/**\n * One runner definition, two schemas (3.5): `build` runs over the DECLARED\n * set (tokens allowed; its z.input types host files) and the RESOLVED set\n * (no tokens; `validateHost` checks it before the verb). Export both, type\n * the host as `z.input<typeof declaredHostSchema>`, refine last inside the\n * builder (zod can't extend a refined object), and wrap the runner's own\n * token-able fields with `s.tokenable` / `s.envTokenable`.\n */\nexport function defineHostSchemas<T>(build: (schemas: HostSchemas) => T): {\n declaredHostSchema: T;\n hostSchema: T;\n} {\n return {\n declaredHostSchema: build(declaredSchemas),\n hostSchema: build(resolvedSchemas),\n };\n}\n\nconst declaredSchemas = makeHostSchemas({ tokens: \"allow\" });\nconst resolvedSchemas = makeHostSchemas({ tokens: \"forbid\" });\n\n/* The exported base blocks are the RESOLVED form (what verbs receive). The\n * declared forms are `declaredHostSchemas` / `defineHostSchemas`. */\nexport const declaredHostSchemas: HostSchemas = declaredSchemas;\nexport const reactorBackendSchema = resolvedSchemas.reactorBackendSchema;\nexport const reactorSchema = resolvedSchemas.reactorSchema;\nexport const runnerBaseSchema = resolvedSchemas.runnerBaseSchema;\nexport const childWrapperSchema = resolvedSchemas.childWrapperSchema;\nexport const childrenSchema = resolvedSchemas.childrenSchema;\nexport const reactorHostSchema = resolvedSchemas.reactorHostSchema;\nexport const compoundHostSchema = resolvedSchemas.compoundHostSchema;\n\n/** The generic compound runner's host: the base with its wiring config. */\nconst genericCompound = defineHostSchemas((s) =>\n s.compoundHostSchema\n .extend({ config: compoundWiringSchema.optional() })\n .superRefine(refineStartOrder),\n);\nexport const genericCompoundHostSchema = genericCompound.hostSchema;\nexport const declaredGenericCompoundHostSchema =\n genericCompound.declaredHostSchema;\n\n/* -------------------------------------------------------------------- types */\n\nexport type Profile = z.infer<typeof profileSchema>;\nexport type ReactorProtocol = z.infer<typeof reactorProtocolSchema>;\nexport type ReactorBackend = z.infer<typeof reactorBackendSchema>;\nexport type ReactorBackendKind = ReactorBackend[\"kind\"];\nexport type ReactorStorageConfig = NonNullable<ReactorBackend[\"storage\"]>;\nexport type ReactorPackageConfig = NonNullable<ReactorBackend[\"packages\"]>;\nexport type ReactorRemoteConfig = NonNullable<ReactorBackend[\"remote\"]>;\nexport type ReactorConfig = z.infer<typeof reactorSchema>;\nexport type RunnerBase = z.infer<typeof runnerBaseSchema>;\nexport type ChildWrapper = z.infer<typeof childWrapperSchema>;\nexport type CompoundWiring = z.infer<typeof compoundWiringSchema>;\n\n/** What a host.js author writes (z.input), per runner kind. The `never`\n * sides make reactor XOR children a type error. */\nexport type ReactorHostInput = z.input<\n typeof declaredSchemas.reactorHostSchema\n> & {\n children?: never;\n};\nexport type CompoundHostInput = z.input<\n typeof declaredSchemas.compoundHostSchema\n> & {\n reactor?: never;\n};\nexport type HostDefinition = ReactorHostInput | CompoundHostInput;\n\n/** What a verb receives (z.output) from the base schemas. */\nexport type ReactorHost = z.output<typeof reactorHostSchema>;\nexport type CompoundHost = z.output<typeof compoundHostSchema>;\n\n/* --------------------------------------------------------------- JSON Schema */\n\nconst SCHEMA_BASE = \"https://powerhouse.inc/schemas\";\n\n/** One host schema as an editor JSON Schema with a stable `$id` — the\n * per-runner emission helper (runner packages emit their own hostSchema). */\nexport function emitHostJsonSchema(\n name: string,\n schema: z.ZodType,\n): Record<string, unknown> {\n return {\n $id: `${SCHEMA_BASE}/${name}.schema.json`,\n ...z.toJSONSchema(schema, { io: \"input\" }),\n };\n}\n\n/** The emitted-schema set, keyed by published filename. Pure — the\n * emit-schemas script writes these and the drift test re-derives them. */\nexport function emittedHostSchemas(): Record<string, unknown> {\n return {\n // Editor schemas describe what authors write: the declared form.\n \"host-reactor.schema.json\": emitHostJsonSchema(\n \"host-reactor\",\n declaredSchemas.reactorHostSchema,\n ),\n \"host-compound.schema.json\": emitHostJsonSchema(\n \"host-compound\",\n declaredSchemas.compoundHostSchema,\n ),\n };\n}\n","/**\n * Pure built-in `$env` substitution: the `\"${userData}\"` / `\"${projectRoot}\"`\n * string sugar, deep-applied to a JSON-shaped value. No node imports, so it\n * ships in `./schema`; the node default for userData is placeholders.ts.\n */\n\nexport interface BuiltinEnv {\n userData?: string;\n projectRoot?: string;\n}\n\nconst BUILTIN = /\\$\\{(userData|projectRoot)\\}/g;\n\nfunction substitute(text: string, env: BuiltinEnv): string {\n return text.replace(\n BUILTIN,\n (match, name: keyof BuiltinEnv) => env[name] ?? match,\n );\n}\n\n/** Deep-substitute the built-ins that `env` provides in every string; an\n * absent built-in is left as written. The input is never mutated. */\nexport function substituteBuiltinEnv<T>(value: T, env: BuiltinEnv): T {\n return substituteValue(value, env) as T;\n}\n\nfunction substituteValue(value: unknown, env: BuiltinEnv): unknown {\n if (typeof value === \"string\") return substitute(value, env);\n if (Array.isArray(value)) return value.map((v) => substituteValue(v, env));\n if (value !== null && typeof value === \"object\") {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value)) {\n out[k] = substituteValue(v, env);\n }\n return out;\n }\n return value;\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,4BACd,UACA;CACA,OAAO,EAAE,aAAa;EACpB,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;EACtB,IAAI,E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