@powerhousedao/switchboard 6.2.3-dev.89 → 6.2.3-dev.90
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/.tsbuild/test/boot-desktop-auth.test.d.ts +2 -0
- package/.tsbuild/test/boot-desktop-auth.test.d.ts.map +1 -0
- package/.tsbuild/test/delegated-publish.test.d.ts +2 -0
- package/.tsbuild/test/delegated-publish.test.d.ts.map +1 -0
- package/.tsbuild/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +35 -0
- package/dist/boot.d.mts +2 -2
- package/dist/boot.mjs +2 -2
- package/dist/config/from-env.d.mts +1 -1
- package/dist/config/from-env.mjs +3 -3
- package/dist/config/schema.d.mts +1 -1
- package/dist/config/schema.mjs +3 -3
- package/dist/{from-env-DuUwngOC.mjs → from-env-DJ4iQ3QZ.mjs} +5 -5
- package/dist/from-env-DJ4iQ3QZ.mjs.map +1 -0
- package/dist/index.mjs +3 -3
- package/dist/{plugin-host-C0bSz1Oe.d.mts → plugin-host-BHEUSn9G.d.mts} +2 -2
- package/dist/{plugin-host-C0bSz1Oe.d.mts.map → plugin-host-BHEUSn9G.d.mts.map} +1 -1
- package/dist/plugins/ai.d.mts +1 -1
- package/dist/plugins/ai.d.mts.map +1 -1
- package/dist/plugins/ai.mjs +68 -20
- package/dist/plugins/ai.mjs.map +1 -1
- package/dist/plugins/attachments.d.mts +1 -1
- package/dist/plugins/attachments.mjs +3 -3
- package/dist/plugins/mcp.d.mts +1 -1
- package/dist/plugins/privacy.d.mts +1 -1
- package/dist/plugins/workflows.d.mts +3 -3
- package/dist/plugins/workflows.mjs +3 -3
- package/dist/{schema-XEZrdmag.mjs → schema-1yj85yQD.mjs} +15 -5
- package/dist/schema-1yj85yQD.mjs.map +1 -0
- package/dist/{schema-DhempFjb.d.mts → schema-ugrJupVH.d.mts} +5 -1
- package/dist/schema-ugrJupVH.d.mts.map +1 -0
- package/dist/{server-BJk9-9n4.mjs → server-CgDvrUqE.mjs} +129 -30
- package/dist/server-CgDvrUqE.mjs.map +1 -0
- package/dist/server.d.mts +8 -306
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +4 -4
- package/dist/types-DzO3_320.d.mts +308 -0
- package/dist/types-DzO3_320.d.mts.map +1 -0
- package/dist/utils-Cm0TE6dP.mjs +148 -0
- package/dist/utils-Cm0TE6dP.mjs.map +1 -0
- package/dist/utils.d.mts +21 -3
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs +4 -4
- package/dist/{worker-pool-BWHBLBJd.mjs → worker-pool-gyxJnCxA.mjs} +4 -4
- package/dist/worker-pool-gyxJnCxA.mjs.map +1 -0
- package/dist/workflow-runtime-CF5pc8mt.d.mts.map +1 -1
- package/dist/{workflows-krankcQT.mjs → workflows-C9BQlyT0.mjs} +31 -7
- package/dist/workflows-C9BQlyT0.mjs.map +1 -0
- package/package.json +29 -19
- package/test/ai-gateway.test.ts +58 -1
- package/test/boot-desktop-auth.test.ts +278 -0
- package/test/boot-preconditions.test.ts +13 -0
- package/test/config-merge.test.ts +11 -0
- package/test/default-drive-protocol-versions.test.ts +1 -24
- package/test/default-drive-slug.test.ts +170 -2
- package/test/delegated-publish.test.ts +435 -0
- package/test/fatal-shutdown.test.ts +40 -0
- package/test/pglite-store.test.ts +179 -2
- package/test/workflow-runtime.test.ts +119 -0
- package/dist/from-env-DuUwngOC.mjs.map +0 -1
- package/dist/schema-DhempFjb.d.mts.map +0 -1
- package/dist/schema-XEZrdmag.mjs.map +0 -1
- package/dist/server-BJk9-9n4.mjs.map +0 -1
- package/dist/utils-C6AIF38Z.mjs +0 -133
- package/dist/utils-C6AIF38Z.mjs.map +0 -1
- package/dist/worker-pool-BWHBLBJd.mjs.map +0 -1
- package/dist/workflows-krankcQT.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="049a05ee-286e-51fd-8e2d-19f7a2180b11")}catch(e){}}();
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/config/merge.ts
|
|
5
5
|
const REPLACED_WHOLE = /* @__PURE__ */ new Set(["attachments.storage", "storage.keyframes"]);
|
|
@@ -43,7 +43,7 @@ function callerOverEnv(env, caller) {
|
|
|
43
43
|
if (env.inspection?.enabled === false || caller.inspection?.enabled === false) inspection.enabled = false;
|
|
44
44
|
if (features.pluginHost === true) {
|
|
45
45
|
features.mcp = caller.features?.mcp;
|
|
46
|
-
features.workflows = caller.features?.workflows;
|
|
46
|
+
features.workflows = env.features?.workflows === false ? false : caller.features?.workflows;
|
|
47
47
|
}
|
|
48
48
|
return {
|
|
49
49
|
...merged,
|
|
@@ -73,6 +73,8 @@ const serverSchema = z.object({
|
|
|
73
73
|
basePath: z.string().default("/"),
|
|
74
74
|
/** Origin advertised in webhook URLs; a bare domain gets a scheme at use. */
|
|
75
75
|
publicUrl: z.string().optional(),
|
|
76
|
+
/** Address to bind; unset binds every interface. */
|
|
77
|
+
host: z.string().min(1).optional(),
|
|
76
78
|
gatewayAdapter: z.enum([
|
|
77
79
|
"apollo",
|
|
78
80
|
"mercurius",
|
|
@@ -190,8 +192,16 @@ const authSchema = z.object({
|
|
|
190
192
|
/** Unset: 0 with a "self" renown source, else the AuthService default. */
|
|
191
193
|
credentialCacheTtlMs: nonNegative.optional(),
|
|
192
194
|
wsRecheckMs: nonNegative.optional(),
|
|
195
|
+
/** The first verified caller becomes the admin of a host with none. */
|
|
196
|
+
ownerClaim: z.boolean().default(false),
|
|
197
|
+
/** Keep verified credentials, and rely on them while Renown is away. */
|
|
198
|
+
offlineCredentials: z.boolean().default(false),
|
|
193
199
|
renown: z.object({
|
|
194
|
-
source: z.enum([
|
|
200
|
+
source: z.enum([
|
|
201
|
+
"self",
|
|
202
|
+
"remote",
|
|
203
|
+
"kept"
|
|
204
|
+
]).optional(),
|
|
195
205
|
url: z.string().min(1).optional(),
|
|
196
206
|
switchboardUrl: z.string().min(1).optional()
|
|
197
207
|
}).prefault({})
|
|
@@ -312,5 +322,5 @@ function layerOf(schema, path, omit) {
|
|
|
312
322
|
//#endregion
|
|
313
323
|
export { callerOverEnv as a, switchboardConfigSchema as i, SWITCHBOARD_LOG_LEVELS as n, mergeSwitchboardConfig as o, switchboardConfigLayerSchema as r, SWITCHBOARD_DRIVE_DOCUMENT_TYPES as t };
|
|
314
324
|
|
|
315
|
-
//# sourceMappingURL=schema-
|
|
316
|
-
//# debugId=
|
|
325
|
+
//# sourceMappingURL=schema-1yj85yQD.mjs.map
|
|
326
|
+
//# debugId=049a05ee-286e-51fd-8e2d-19f7a2180b11
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-1yj85yQD.mjs","sources":["../src/config/merge.ts","../src/config/schema.ts"],"sourcesContent":["import type { SwitchboardConfigInput } from \"./schema.js\";\n\ntype Layer = SwitchboardConfigInput;\ntype Section = Record<string, unknown>;\n\n// A union, not a section: its variants do not share keys.\nconst REPLACED_WHOLE = new Set([\"attachments.storage\", \"storage.keyframes\"]);\n\n// The reactor-api auth keys whose env vars override a caller's option.\nconst ENV_WINS_AUTH = [\n \"enabled\",\n \"admins\",\n \"resolveIdentity\",\n \"requireAuthenticatedCaller\",\n \"requireAuthenticatedCallerExemptPaths\",\n \"attachmentReadsFollowDocumentPolicy\",\n] as const;\n\nfunction isPlainObject(value: unknown): value is Section {\n return (\n typeof value === \"object\" &&\n value !== null &&\n Object.getPrototypeOf(value) === Object.prototype\n );\n}\n\nfunction mergeSection(base: Section, over: Section, path: string): Section {\n const result: Section = { ...base };\n for (const [key, value] of Object.entries(over)) {\n if (value === undefined) continue;\n const at = path ? `${path}.${key}` : key;\n const current = result[key];\n result[key] =\n isPlainObject(value) && isPlainObject(current) && !REPLACED_WHOLE.has(at)\n ? mergeSection(current, value, at)\n : value;\n }\n return result;\n}\n\n/** Later layers win per key; arrays, maps and unions are replaced whole. */\nexport function mergeSwitchboardConfig(...layers: Layer[]): Layer {\n let merged: Section = {};\n for (const layer of layers) merged = mergeSection(merged, layer, \"\");\n return merged as Layer;\n}\n\n/** A caller's layer over the env's, keeping each key's pre-config precedence. */\nexport function callerOverEnv(env: Layer, caller: Layer): Layer {\n const merged = mergeSwitchboardConfig(env, caller);\n const features: Section = { ...merged.features };\n const inspection: Section = { ...merged.inspection };\n const auth: Section = { ...merged.auth };\n\n const envAuth: Section = env.auth ?? {};\n for (const key of ENV_WINS_AUTH) {\n if (envAuth[key] !== undefined) auth[key] = envAuth[key];\n }\n if (env.features?.documentModelSubgraphs !== undefined) {\n features.documentModelSubgraphs = env.features.documentModelSubgraphs;\n }\n if (env.features?.mcp === false || caller.features?.mcp === false) {\n features.mcp = false;\n }\n if (\n env.inspection?.enabled === false ||\n caller.inspection?.enabled === false\n ) {\n inspection.enabled = false;\n }\n // Under the plugin host a plugin's presence decides these, not their env vars,\n // except that workflows can be switched off, for when one stops the host starting.\n if (features.pluginHost === true) {\n features.mcp = caller.features?.mcp;\n features.workflows =\n env.features?.workflows === false ? false : caller.features?.workflows;\n }\n\n return { ...merged, features, inspection, auth } as Layer;\n}\n","import type { ReactorApiConfig } from \"@powerhousedao/reactor-api\";\nimport type { AttachmentStorageConfig } from \"@powerhousedao/reactor-attachments\";\nimport { z } from \"zod\";\n\n// Zod at runtime only: the monitor, workers and host validation load this without the server.\n\nexport const SWITCHBOARD_LOG_LEVELS = [\n \"verbose\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n] as const;\n\nexport const SWITCHBOARD_DRIVE_DOCUMENT_TYPES = [\n \"powerhouse/document-drive\",\n \"powerhouse/reactor-drive\",\n] as const;\n\nconst port = z.number().int().min(0).max(65535);\nconst nonNegativeInt = z.number().int().min(0);\nconst positiveInt = z.number().int().min(1);\nconst nonNegative = z.number().min(0);\nconst positive = z.number().positive();\n\nconst serverSchema = z.object({\n port: port.default(4001),\n strictPort: z.boolean().default(false),\n basePath: z.string().default(\"/\"),\n /** Origin advertised in webhook URLs; a bare domain gets a scheme at use. */\n publicUrl: z.string().optional(),\n /** Address to bind; unset binds every interface. */\n host: z.string().min(1).optional(),\n gatewayAdapter: z\n .enum([\"apollo\", \"mercurius\", \"stitching\"])\n .default(\"apollo\"),\n https: z\n .union([\n z.boolean(),\n z.object({ keyPath: z.string(), certPath: z.string() }),\n ])\n .optional(),\n dev: z.boolean().default(false),\n});\n\nconst vacuumFullSchema = z.object({\n mode: z.enum([\"off\", \"quiet\", \"forced\"]).default(\"off\"),\n aboveMb: nonNegative.optional(),\n quietMs: nonNegative.optional(),\n maxDeferMs: nonNegative.optional(),\n});\n\nconst keyframeRuleSchema = z.strictObject({\n interval: positiveInt.optional(),\n /** Null keeps every keyframe. */\n keep: positiveInt.nullable().optional(),\n});\n\n/** See `KeyframeSettings` in the reactor. */\nconst keyframesSchema = z.strictObject({\n default: keyframeRuleSchema.optional(),\n types: z.record(z.string(), keyframeRuleSchema).optional(),\n});\n\nconst storageSchema = z.object({\n /** Postgres URL or PGlite data dir; unset uses the default dir. */\n reactor: z.object({ url: z.string().min(1).optional() }).prefault({}),\n /** Postgres URL or PGlite data dir; unset uses the default dir. */\n readModel: z.object({ url: z.string().min(1).optional() }).prefault({}),\n inMemory: z.boolean().default(false),\n /** Relocates the `.ph` tree (stores, identity) under this root. */\n userDataDir: z.string().min(1).optional(),\n pglite: z\n .object({\n fsync: z.boolean().default(true),\n workers: z.boolean().default(true),\n workerMemoryMb: positiveInt.optional(),\n vacuumFull: vacuumFullSchema.prefault({}),\n })\n .prefault({}),\n migratePglite: z.boolean().default(false),\n forcePgVersion: z.union([z.literal(16), z.literal(17)]).optional(),\n /** Unset: `reactor.keyframes` of the project config, then the built-in rule. */\n keyframes: keyframesSchema.optional(),\n});\n\nconst protocolSchema = z.object({\n featureFlags: z\n .object({\n documentDecisions: z.boolean().default(false),\n authEnforcement: z.boolean().default(false),\n authGroups: z.boolean().default(false),\n authConditions: z.boolean().default(false),\n })\n .prefault({}),\n /** Requested policy; without a signer the boot still falls back to legacy. */\n createSignaturePolicy: z\n .enum([\"legacy\", \"v2-required\"])\n .default(\"v2-required\"),\n unsupportedStoredDocuments: z.enum([\"refuse\", \"read-only\"]).default(\"refuse\"),\n legacyProcessorIds: z.boolean().default(true),\n maxSkipThreshold: positiveInt.optional(),\n catchUpPriority: z\n .union([z.literal(\"dynamic\"), z.number().int().min(0).max(7)])\n .default(\"dynamic\"),\n /** What processors record about their time. */\n processorTiming: z.enum([\"off\", \"basic\", \"detailed\"]).default(\"basic\"),\n processorTimingWindowMs: positiveInt.default(60_000),\n /** At `detailed`: an `onOperations` call over this logs a warning. */\n processorSlowBatchMs: positiveInt.default(1_000),\n /** Above 0: logs the slowest processors this often while catching up. */\n processorTimingLogMs: nonNegativeInt.default(0),\n});\n\nconst memoryTelemetrySchema = z.object({\n enabled: z.boolean().default(false),\n intervalMs: z.number().int().min(1000).default(30_000),\n /** `memory`, the ring, is always on while telemetry runs. */\n outputs: z\n .array(z.enum([\"memory\", \"file\", \"console\"]))\n .default([\"memory\", \"file\"]),\n file: z\n .object({\n path: z.string().min(1).optional(),\n maxMb: positiveInt.default(10),\n keep: positiveInt.default(5),\n })\n .prefault({}),\n ringSize: positiveInt.default(720),\n consoleIntervalMs: positiveInt.default(300_000),\n workers: z.boolean().default(true),\n windowMin: positiveInt.default(30),\n});\n\nconst telemetrySchema = z.object({\n memory: memoryTelemetrySchema.prefault({}),\n /** Under it go the JSONL files and heap snapshots; unset: `<phDir>/telemetry`. */\n dir: z.string().min(1).optional(),\n heapSnapshotDir: z.string().min(1).optional(),\n});\n\nconst authSchema = z.object({\n enabled: z.boolean().default(false),\n /** Unset follows `enabled`. */\n resolveIdentity: z.boolean().optional(),\n requireAuthenticatedCaller: z.boolean().default(false),\n requireAuthenticatedCallerExemptPaths: z.array(z.string()).default([]),\n admins: z.array(z.string()).default([]),\n defaultProtection: z.boolean().default(false),\n attachmentReadsFollowDocumentPolicy: z.boolean().default(false),\n documentPermissions: z\n .object({\n enabled: z.boolean().default(false),\n cacheTtlMs: nonNegativeInt.optional(),\n })\n .prefault({}),\n skipCredentialVerification: z.boolean().default(false),\n /** Unset: 0 with a \"self\" renown source, else the AuthService default. */\n credentialCacheTtlMs: nonNegative.optional(),\n wsRecheckMs: nonNegative.optional(),\n /** The first verified caller becomes the admin of a host with none. */\n ownerClaim: z.boolean().default(false),\n /** Keep verified credentials, and rely on them while Renown is away. */\n offlineCredentials: z.boolean().default(false),\n renown: z\n .object({\n source: z.enum([\"self\", \"remote\", \"kept\"]).optional(),\n url: z.string().min(1).optional(),\n switchboardUrl: z.string().min(1).optional(),\n })\n .prefault({}),\n});\n\nconst inspectionSchema = z.object({\n enabled: z.boolean().default(true),\n admin: z.boolean().default(false),\n callsPerMinute: positiveInt.optional(),\n});\n\nconst workersSchema = z.object({\n executor: z\n .object({\n count: z.union([nonNegativeInt, z.literal(\"auto\")]).default(0),\n poolSize: nonNegativeInt.default(2),\n acquireTimeoutMs: nonNegativeInt.default(5000),\n })\n .prefault({}),\n hostPoolSize: positiveInt.default(16),\n projection: z\n .object({\n enabled: z.boolean().default(false),\n poolSize: positiveInt.default(8),\n })\n .prefault({}),\n});\n\nconst packagesSchema = z.object({\n registryUrl: z.string().optional(),\n registryPackages: z.array(z.string()).default([]),\n dynamic: z.boolean().default(false),\n list: z.array(z.string()).default([]),\n disableLocal: z.boolean().default(false),\n});\n\nconst privacySchema = z.object({\n enabled: z.boolean().default(false),\n deploymentSecret: z.string().optional(),\n intervalMs: positive.optional(),\n deadlineMs: positive.optional(),\n markerGraceMs: positive.optional(),\n purgeTimeoutMs: positive.optional(),\n});\n\nconst featuresSchema = z.object({\n /** Unset: on unless a plugin composition leaves it out. */\n mcp: z.boolean().optional(),\n /** Unset: the config file's `workflows.enabled`, then off. */\n workflows: z.boolean().optional(),\n documentModelSubgraphs: z.boolean().default(true),\n pluginHost: z.boolean().default(false),\n privacy: privacySchema.prefault({}),\n});\n\nconst s3Schema = z.object({\n endpoint: z.string(),\n region: z.string(),\n bucket: z.string(),\n accessKeyId: z.string(),\n secretAccessKey: z.string(),\n prefix: z.string(),\n forcePathStyle: z.boolean(),\n uploadTtlSeconds: positiveInt,\n downloadTtlSeconds: positiveInt,\n});\n\nconst attachmentsSchema = z.object({\n storage: z\n .discriminatedUnion(\"kind\", [\n z.object({ kind: z.literal(\"filesystem\") }),\n z.object({ kind: z.literal(\"s3\"), s3: s3Schema }),\n ])\n .default({ kind: \"filesystem\" }),\n /** Unset: production refuses signed downloads, elsewhere a per-process secret. */\n urlSigningSecret: z.string().optional(),\n downloadTargetMaxTtlSeconds: positiveInt.optional(),\n /** Unset: `http(s)://localhost:<port>`. */\n serviceUrl: z.string().optional(),\n});\n\nconst identitySchema = z.object({\n keypairPath: z.string().optional(),\n requireExisting: z.boolean().optional(),\n baseUrl: z.string().optional(),\n});\n\nconst driveSchema = z.looseObject({\n id: z.string().optional(),\n slug: z.string().optional(),\n documentType: z.enum(SWITCHBOARD_DRIVE_DOCUMENT_TYPES).optional(),\n});\n\n/** Every field is optional on input, so `z.input` is one configuration layer. */\nexport const switchboardConfigSchema = z.object({\n logLevel: z.enum(SWITCHBOARD_LOG_LEVELS).default(\"info\"),\n server: serverSchema.prefault({}),\n storage: storageSchema.prefault({}),\n protocol: protocolSchema.prefault({}),\n telemetry: telemetrySchema.prefault({}),\n auth: authSchema.prefault({}),\n inspection: inspectionSchema.prefault({}),\n workers: workersSchema.prefault({}),\n packages: packagesSchema.prefault({}),\n features: featuresSchema.prefault({}),\n attachments: attachmentsSchema.prefault({}),\n identity: identitySchema.optional(),\n drive: driveSchema.optional(),\n remoteDrives: z.array(z.string()).default([]),\n configFile: z.string().optional(),\n processorConfig: z.map(z.string(), z.unknown()).optional(),\n});\n\n/**\n * One layer's own schema: every key optional, no defaults (they would\n * override the layers below), unknown keys refused. `omit` drops dotted\n * paths the caller sets elsewhere.\n */\nexport function switchboardConfigLayerSchema(\n omit: readonly string[] = [],\n): z.ZodType<SwitchboardConfigInput, SwitchboardConfigInput> {\n return layerOf(switchboardConfigSchema, \"\", new Set(omit)) as z.ZodType<\n SwitchboardConfigInput,\n SwitchboardConfigInput\n >;\n}\n\nfunction layerOf(\n schema: z.ZodType,\n path: string,\n omit: Set<string>,\n): z.ZodType {\n const def = schema.def as { type: string; innerType?: z.ZodType };\n if (\n (def.type === \"default\" ||\n def.type === \"prefault\" ||\n def.type === \"optional\") &&\n def.innerType\n ) {\n return layerOf(def.innerType, path, omit);\n }\n if (!(schema instanceof z.ZodObject)) return schema;\n const shape: Record<string, z.ZodType> = {};\n for (const [key, field] of Object.entries(\n schema.shape as Record<string, z.ZodType>,\n )) {\n const at = path ? `${path}.${key}` : key;\n if (omit.has(at)) continue;\n shape[key] = layerOf(field, at, omit).optional();\n }\n const catchall = schema.def.catchall as z.ZodType | undefined;\n return catchall && catchall.def.type !== \"never\"\n ? z.looseObject(shape)\n : z.strictObject(shape);\n}\n\nexport type SwitchboardConfig = z.output<typeof switchboardConfigSchema>;\n\n/** One configuration layer: any subset of {@link SwitchboardConfig}. */\nexport type SwitchboardConfigInput = z.input<typeof switchboardConfigSchema>;\n\n// The sections reactor-api reads are ReactorApiConfig's, under its names.\ntype Section<T> = NonNullable<T>;\ntype MissingKeys<Api, Ours> = Exclude<keyof Section<Api>, keyof Ours>;\ntype Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;\ntype Assert<T extends true> = T;\nexport type ReactorApiSectionsMatch = [\n Assert<\n Same<\n MissingKeys<ReactorApiConfig[\"server\"], SwitchboardConfig[\"server\"]>,\n never\n >\n >,\n Assert<\n Same<\n MissingKeys<ReactorApiConfig[\"auth\"], SwitchboardConfig[\"auth\"]>,\n never\n >\n >,\n Assert<\n Same<\n MissingKeys<\n Section<ReactorApiConfig[\"auth\"]>[\"documentPermissions\"],\n SwitchboardConfig[\"auth\"][\"documentPermissions\"]\n >,\n never\n >\n >,\n Assert<\n Same<\n MissingKeys<\n ReactorApiConfig[\"inspection\"],\n SwitchboardConfig[\"inspection\"]\n >,\n never\n >\n >,\n Assert<\n Same<\n MissingKeys<\n ReactorApiConfig[\"attachments\"],\n SwitchboardConfig[\"attachments\"]\n >,\n never\n >\n >,\n Assert<ReactorApiConfig extends SwitchboardConfigInput ? true : false>,\n Assert<\n Pick<\n SwitchboardConfig,\n \"server\" | \"auth\" | \"inspection\" | \"attachments\"\n > extends ReactorApiConfig\n ? true\n : false\n >,\n Assert<\n Same<\n SwitchboardConfig[\"server\"][\"gatewayAdapter\"],\n NonNullable<Section<ReactorApiConfig[\"server\"]>[\"gatewayAdapter\"]>\n >\n >,\n Assert<\n Same<SwitchboardConfig[\"attachments\"][\"storage\"], AttachmentStorageConfig>\n >,\n];\n\nexport { callerOverEnv, mergeSwitchboardConfig } from \"./merge.js\";\n"],"names":[],"mappings":";;;;AAMA,MAAM,iCAAiB,IAAI,IAAI,CAAC,uBAAuB,mBAAmB,CAAC;AAG3E,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAS,cAAc,OAAkC;CACvD,OACE,OAAO,UAAU,YACjB,UAAU,QACV,OAAO,eAAe,KAAK,MAAM,OAAO;AAE5C;AAEA,SAAS,aAAa,MAAe,MAAe,MAAuB;CACzE,MAAM,SAAkB,EAAE,GAAG,KAAK;CAClC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,IAAI,GAAG;EAC/C,IAAI,UAAU,KAAA,GAAW;EACzB,MAAM,KAAK,OAAO,GAAG,KAAK,GAAG,QAAQ;EACrC,MAAM,UAAU,OAAO;EACvB,OAAO,O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AClB,MAAM,OAAO,QAAQ,OAAO,IAAI,IAAI,CAAC,CAAC,SAAS;CACjD;CACA,MAAM,WAAW,OAAO,IAAI;CAC5B,OAAO,YAAY,SAAS,IAAI,SAAS,UACrC,EAAE,YAAY,KAAK,IACnB,EAAE,aAAa,KAAK;AAC1B","debug_id":"049a05ee-286e-51fd-8e2d-19f7a2180b11"}
|
|
@@ -25,6 +25,7 @@ declare const switchboardConfigSchema: z.ZodObject<{
|
|
|
25
25
|
strictPort: z.ZodDefault<z.ZodBoolean>;
|
|
26
26
|
basePath: z.ZodDefault<z.ZodString>;
|
|
27
27
|
publicUrl: z.ZodOptional<z.ZodString>;
|
|
28
|
+
host: z.ZodOptional<z.ZodString>;
|
|
28
29
|
gatewayAdapter: z.ZodDefault<z.ZodEnum<{
|
|
29
30
|
apollo: "apollo";
|
|
30
31
|
mercurius: "mercurius";
|
|
@@ -137,8 +138,11 @@ declare const switchboardConfigSchema: z.ZodObject<{
|
|
|
137
138
|
skipCredentialVerification: z.ZodDefault<z.ZodBoolean>;
|
|
138
139
|
credentialCacheTtlMs: z.ZodOptional<z.ZodNumber>;
|
|
139
140
|
wsRecheckMs: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
ownerClaim: z.ZodDefault<z.ZodBoolean>;
|
|
142
|
+
offlineCredentials: z.ZodDefault<z.ZodBoolean>;
|
|
140
143
|
renown: z.ZodPrefault<z.ZodObject<{
|
|
141
144
|
source: z.ZodOptional<z.ZodEnum<{
|
|
145
|
+
kept: "kept";
|
|
142
146
|
remote: "remote";
|
|
143
147
|
self: "self";
|
|
144
148
|
}>>;
|
|
@@ -239,4 +243,4 @@ type ReactorApiSectionsMatch = [Assert<Same<MissingKeys<ReactorApiConfig["server
|
|
|
239
243
|
//#endregion
|
|
240
244
|
export { SwitchboardConfigInput as a, callerOverEnv as c, SwitchboardConfig as i, mergeSwitchboardConfig as l, SWITCHBOARD_DRIVE_DOCUMENT_TYPES as n, switchboardConfigLayerSchema as o, SWITCHBOARD_LOG_LEVELS as r, switchboardConfigSchema as s, ReactorApiSectionsMatch as t };
|
|
241
245
|
export {};
|
|
242
|
-
//# sourceMappingURL=schema-
|
|
246
|
+
//# sourceMappingURL=schema-ugrJupVH.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-ugrJupVH.d.mts","names":[],"sources":["../src/config/merge.ts","../src/config/schema.ts"],"mappings":";;;;KAEK,QAAQ;;iBAuCG,0BAA0B,QAAQ,UAAU;;iBAO5C,cAAc,KAAK,OAAO,QAAQ,QAAQ;;;cC1C7C;cAQA;;cAwPA,yBAAuB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBlC,EAAA,KAAA;;;;;;iBAOc,6BACd,2BACC,EAAE,QAAQ,wBAAwB;KAoCzB,oBAAoB,EAAE,cAAc;;KAGpC,yBAAyB,EAAE,aAAa;KAG/C,QAAQ,KAAK,YAAY;KACzB,YAAY,KAAK,QAAQ,cAAc,QAAQ,YAAY;KAC3D,KAAK,GAAG,MAAM,YAAY,OAAO,YAAY;KAC7C,OAAO,kBAAkB;KAClB,2BACV,OACE,KACE,YAAY,4BAA4B,uCAI5C,OACE,KACE,YAAY,0BAA0B,qCAI1C,OACE,KACE,YACE,QAAQ,kDACR,4DAKN,OACE,KACE,YACE,gCACA,2CAKN,OACE,KACE,YACE,iCACA,4CAKN,OAAO,yBAAyB,wCAChC,OACE,KACE,6EAEQ,kCAIZ,OACE,KACE,+CACA,YAAY,QAAQ,kDAGxB,OACE,KAAK,6CAA6C"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { a as loadNodeFsClass, c as openForVerify, d as ATTACHMENT_URL_SIGNING_SECRET_ENV, f as resolveAttachmentUrlSigning, i as isSupportedMajor, l as pgliteModuleSpec, n as StoredDocumentsRefusedError, o as loadPGliteModule, r as resolveUnsupportedStoredDocuments, s as loadPgDump, t as switchboardConfigFromEnv, u as readPgVersionFile } from "./from-env-
|
|
4
|
-
import { a as resolveWorkerModelSources, l as resolveProjectionWorkerOptions, n as keepImportableSources, o as resolveWorkerPoolOptions, p as workerPoolIssues, s as assertProjectionWorkerSupported, t as buildWorkerDbConfig } from "./worker-pool-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="08a37d5f-b2a6-5d24-8e7b-2bea210aa270")}catch(e){}}();
|
|
3
|
+
import { a as loadNodeFsClass, c as openForVerify, d as ATTACHMENT_URL_SIGNING_SECRET_ENV, f as resolveAttachmentUrlSigning, i as isSupportedMajor, l as pgliteModuleSpec, n as StoredDocumentsRefusedError, o as loadPGliteModule, r as resolveUnsupportedStoredDocuments, s as loadPgDump, t as switchboardConfigFromEnv, u as readPgVersionFile } from "./from-env-DJ4iQ3QZ.mjs";
|
|
4
|
+
import { a as resolveWorkerModelSources, l as resolveProjectionWorkerOptions, n as keepImportableSources, o as resolveWorkerPoolOptions, p as workerPoolIssues, s as assertProjectionWorkerSupported, t as buildWorkerDbConfig } from "./worker-pool-gyxJnCxA.mjs";
|
|
5
5
|
import { t as isPostgresUrl } from "./postgres-url-DTDhBjXX.mjs";
|
|
6
6
|
import { n as resolvePrivacy, r as startPrivacy } from "./privacy-DxIJGH4P.mjs";
|
|
7
|
-
import { i as switchboardConfigSchema, o as mergeSwitchboardConfig } from "./schema-
|
|
8
|
-
import { a as workflowsPlugin, c as WORKFLOW_TELEMETRY_SCOPE, d as isWorkflowSingletonConflict, f as modelManifestSource, g as
|
|
7
|
+
import { i as switchboardConfigSchema, o as mergeSwitchboardConfig } from "./schema-1yj85yQD.mjs";
|
|
8
|
+
import { _ as triggerFatalShutdown, a as workflowsPlugin, c as WORKFLOW_TELEMETRY_SCOPE, d as isWorkflowSingletonConflict, f as modelManifestSource, g as raiseSigterm, h as installFatalErrorShutdown, l as assertWorkflowPackageLoadable, m as workflowSingletonLossHandler, p as retryWorkflowSingleton, s as WORKFLOW_PACKAGE_NAME, u as composeWorkflowRuntime } from "./workflows-C9BQlyT0.mjs";
|
|
9
9
|
import { t as privacyPlugin } from "./privacy-BO8Q25xI.mjs";
|
|
10
10
|
import { t as mcpPlugin } from "./mcp-SsBK14Jm.mjs";
|
|
11
11
|
import { n as reactorFeatureFlagsOf, t as renownLayers } from "./renown-layers-COZsrGQT.mjs";
|
|
12
|
-
import {
|
|
12
|
+
import { r as ensureDrive } from "./utils-Cm0TE6dP.mjs";
|
|
13
13
|
import { createRequire, register } from "node:module";
|
|
14
14
|
import { metrics, trace } from "@opentelemetry/api";
|
|
15
15
|
import { ReactorInstrumentation } from "@powerhousedao/opentelemetry-instrumentation-reactor";
|
|
16
|
-
import * as Sentry from "@sentry/node";
|
|
17
16
|
import { childLogger, setLogLevel } from "document-model";
|
|
18
17
|
import { getConfig } from "@powerhousedao/config/node";
|
|
19
18
|
import { CatchUpPriority, ChannelScheme, DriveCollectionId, EventBus, HardenedPGliteDialect, IN_MEMORY_PGLITE_STORAGE_FACTS, MemoryTelemetry, PGLITE_PATH_STORAGE_FACTS, POSTGRES_STORAGE_FACTS, ProcessorTimingSettings, REACTOR_SCHEMA, ReactorBuilder, ReactorClientBuilder, UnsupportedStoredProtocolError, computeProcessorTiming, createHybridProjectionCoordinatorFactory, instrumentPgPool, isCatchingUp, parseDriveUrl, parseKeyframeSettings, rankSlowest, renderDoneSummary, renderSlowLine, startProgressHeartbeat, supportsLiveReadModelRegistration, withProgressHeartbeat } from "@powerhousedao/reactor";
|
|
@@ -1369,6 +1368,44 @@ async function loadDurableFsFactory(major, logger, proc, settings = {}) {
|
|
|
1369
1368
|
onAbort: (what) => onPgliteAbort(logger, what, proc)
|
|
1370
1369
|
});
|
|
1371
1370
|
}
|
|
1371
|
+
const REACTOR_STORE = {
|
|
1372
|
+
label: "reactor-storage",
|
|
1373
|
+
parsers: "none"
|
|
1374
|
+
};
|
|
1375
|
+
const READ_STORE = {
|
|
1376
|
+
label: "read-storage",
|
|
1377
|
+
parsers: "utc-timestamps"
|
|
1378
|
+
};
|
|
1379
|
+
/**
|
|
1380
|
+
* Starts both stores at once, so the wait is the slower of the two rather than
|
|
1381
|
+
* their sum. A store left by a crash spends seconds recovering in its thread.
|
|
1382
|
+
* If one can't open, the other is closed, not left recovering for nobody.
|
|
1383
|
+
*/
|
|
1384
|
+
function openStoresTogether(openReactor, openReadModel) {
|
|
1385
|
+
const reactor = openReactor();
|
|
1386
|
+
let readModel;
|
|
1387
|
+
try {
|
|
1388
|
+
readModel = openReadModel();
|
|
1389
|
+
} catch (error) {
|
|
1390
|
+
reactor.close().catch(() => void 0);
|
|
1391
|
+
throw error;
|
|
1392
|
+
}
|
|
1393
|
+
const close = async () => {
|
|
1394
|
+
await Promise.allSettled([reactor.close(), readModel.close()]);
|
|
1395
|
+
};
|
|
1396
|
+
const stays = () => new Promise(() => void 0);
|
|
1397
|
+
const failed = Promise.race([reactor.waitReady.then(stays), readModel.waitReady.then(stays)]).catch(async (error) => {
|
|
1398
|
+
await close();
|
|
1399
|
+
throw error;
|
|
1400
|
+
});
|
|
1401
|
+
failed.catch(() => void 0);
|
|
1402
|
+
return {
|
|
1403
|
+
reactor,
|
|
1404
|
+
readModel,
|
|
1405
|
+
failed,
|
|
1406
|
+
close
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1372
1409
|
/**
|
|
1373
1410
|
* The factory for one PGlite store: in a worker thread when `threaded` (and a
|
|
1374
1411
|
* worker script exists here), else in the main thread as before. Either way
|
|
@@ -1497,6 +1534,31 @@ function getRenownWorkerSignerSpec(renown, keypairPath) {
|
|
|
1497
1534
|
};
|
|
1498
1535
|
}
|
|
1499
1536
|
/**
|
|
1537
|
+
* What a host with `authEnforcement` off installs: a delegated signer is
|
|
1538
|
+
* verified from what it carries, and every other signer is accepted as the
|
|
1539
|
+
* default would. No lookup, so it needs no network, at boot or after.
|
|
1540
|
+
*/
|
|
1541
|
+
function getDelegationTrustPolicyConfig(renown) {
|
|
1542
|
+
const ownSigner = renown?.signer;
|
|
1543
|
+
const self = ownIdentity(renown);
|
|
1544
|
+
return {
|
|
1545
|
+
trustPolicy: createRenownTrustPolicy({
|
|
1546
|
+
delegationOnly: true,
|
|
1547
|
+
ownSigner
|
|
1548
|
+
}),
|
|
1549
|
+
workerTrustPolicy: {
|
|
1550
|
+
module: {
|
|
1551
|
+
filePath: createRequire(import.meta.url).resolve("@renown/sdk/node"),
|
|
1552
|
+
exportName: "createRenownTrustPolicy"
|
|
1553
|
+
},
|
|
1554
|
+
initArgs: {
|
|
1555
|
+
delegationOnly: true,
|
|
1556
|
+
...self ? { self } : {}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1500
1562
|
* Admits a key as a signer for an address a Renown credential binds it to; a
|
|
1501
1563
|
* `self` source has no worker spec. In process, the switchboard's own key is
|
|
1502
1564
|
* matched against its current user; the worker spec carries the user known now.
|
|
@@ -1702,7 +1764,7 @@ async function resolveServerPort(requested, strictPort, logger) {
|
|
|
1702
1764
|
return requested;
|
|
1703
1765
|
}
|
|
1704
1766
|
async function createReactorKysely(opts) {
|
|
1705
|
-
const { reactorDbUrl, reactorPgliteDir, reactorPgliteMajor, inMemory, hostPoolSize, pgliteWorkers, pgliteSettings, logger } = opts;
|
|
1767
|
+
const { reactorDbUrl, reactorPgliteDir, reactorPgliteMajor, inMemory, hostPoolSize, pgliteWorkers, pgliteSettings, openingStore, logger } = opts;
|
|
1706
1768
|
if (reactorDbUrl && isPostgresUrl(reactorDbUrl)) {
|
|
1707
1769
|
const connectionString = reactorDbUrl.includes("?") ? reactorDbUrl : `${reactorDbUrl}?sslmode=disable`;
|
|
1708
1770
|
const poolSize = hostPoolSize();
|
|
@@ -1719,10 +1781,9 @@ async function createReactorKysely(opts) {
|
|
|
1719
1781
|
};
|
|
1720
1782
|
}
|
|
1721
1783
|
if (!reactorPgliteDir || reactorPgliteMajor === null) throw new Error("Reactor PGLite directory not resolved");
|
|
1722
|
-
const pglite = (await createPgliteStoreFactory({
|
|
1723
|
-
|
|
1784
|
+
const pglite = openingStore ?? (await createPgliteStoreFactory({
|
|
1785
|
+
...REACTOR_STORE,
|
|
1724
1786
|
major: reactorPgliteMajor,
|
|
1725
|
-
parsers: "none",
|
|
1726
1787
|
inMemory,
|
|
1727
1788
|
threaded: pgliteWorkers,
|
|
1728
1789
|
settings: pgliteSettings,
|
|
@@ -1775,7 +1836,12 @@ function deriveAttachmentServiceConfig(options, serverPort, renown) {
|
|
|
1775
1836
|
}) : void 0 : void 0
|
|
1776
1837
|
};
|
|
1777
1838
|
}
|
|
1778
|
-
|
|
1839
|
+
/** Sentry starts only under SENTRY_DSN (observability.mts), and is a lot to load. */
|
|
1840
|
+
async function captureInSentry(error) {
|
|
1841
|
+
if (!process.env.SENTRY_DSN) return;
|
|
1842
|
+
(await import("@sentry/node")).captureException(error);
|
|
1843
|
+
}
|
|
1844
|
+
async function initServer(requestedPort, options, config, renown, renownConfig, reportError, opening) {
|
|
1779
1845
|
const { dev, packages = [], remoteDrives = [], logger = defaultLogger } = options;
|
|
1780
1846
|
const pluginHost = config.features.pluginHost ? createSwitchboardPluginHost({
|
|
1781
1847
|
logger,
|
|
@@ -1876,7 +1942,7 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
1876
1942
|
if (projectionWorkerFatalFired) return;
|
|
1877
1943
|
projectionWorkerFatalFired = true;
|
|
1878
1944
|
reactorLogger.error(`Projection worker ${shardId} died; shutting down so the supervisor restarts a healthy process`, reason);
|
|
1879
|
-
|
|
1945
|
+
raiseSigterm();
|
|
1880
1946
|
};
|
|
1881
1947
|
const workflowsEnabled = options.workflows?.enabled === true;
|
|
1882
1948
|
const privacyConfig = pluginHost ? { enabled: false } : resolvePrivacy(options.privacy, {});
|
|
@@ -1917,6 +1983,7 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
1917
1983
|
hostPoolSize: () => config.workers.hostPoolSize,
|
|
1918
1984
|
pgliteWorkers: options.pgliteWorkers === true,
|
|
1919
1985
|
pgliteSettings,
|
|
1986
|
+
openingStore: opening.stores?.reactor,
|
|
1920
1987
|
logger
|
|
1921
1988
|
});
|
|
1922
1989
|
const maxSkipThreshold = config.protocol.maxSkipThreshold;
|
|
@@ -1956,7 +2023,7 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
1956
2023
|
source: "remote",
|
|
1957
2024
|
renownUrl: renownConfig.url,
|
|
1958
2025
|
switchboardUrl: renownConfig.switchboardUrl
|
|
1959
|
-
}, renown) :
|
|
2026
|
+
}, renown) : getDelegationTrustPolicyConfig(renown)
|
|
1960
2027
|
});
|
|
1961
2028
|
if (workerPool || projectionWorker || workflowsEnabled) {
|
|
1962
2029
|
const sources = await resolveWorkerModelSources(packages, reactorLogger, { resolveRemote: resolveRegistryModels });
|
|
@@ -2105,19 +2172,37 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
2105
2172
|
}
|
|
2106
2173
|
const apiLogger = logger.child(["reactor-api"]);
|
|
2107
2174
|
let pgliteFactory;
|
|
2175
|
+
let storeFailed = () => void 0;
|
|
2176
|
+
const storesFailed = new Promise((_, reject) => {
|
|
2177
|
+
storeFailed = reject;
|
|
2178
|
+
});
|
|
2179
|
+
storesFailed.catch(() => void 0);
|
|
2108
2180
|
if (readModelPgliteDir && readModelPgliteMajor !== null) {
|
|
2109
|
-
const
|
|
2110
|
-
label: "read-storage",
|
|
2111
|
-
major: readModelPgliteMajor,
|
|
2112
|
-
parsers: "utc-timestamps",
|
|
2181
|
+
const storeOptions = {
|
|
2113
2182
|
inMemory,
|
|
2114
2183
|
threaded: options.pgliteWorkers === true,
|
|
2115
2184
|
settings: pgliteSettings,
|
|
2116
2185
|
logger
|
|
2186
|
+
};
|
|
2187
|
+
const openReadStore = await createPgliteStoreFactory({
|
|
2188
|
+
...storeOptions,
|
|
2189
|
+
...READ_STORE,
|
|
2190
|
+
major: readModelPgliteMajor
|
|
2117
2191
|
});
|
|
2118
|
-
|
|
2192
|
+
const openReactorStore = storeOptions.threaded && pgliteWorkerEntryPath !== null && sharedPgliteDir === null && reactorPgliteDir && reactorPgliteMajor !== null ? await createPgliteStoreFactory({
|
|
2193
|
+
...storeOptions,
|
|
2194
|
+
...REACTOR_STORE,
|
|
2195
|
+
major: reactorPgliteMajor
|
|
2196
|
+
}) : void 0;
|
|
2197
|
+
pgliteFactory = (connectionString) => {
|
|
2198
|
+
const dir = connectionString ?? readModelPgliteDir;
|
|
2199
|
+
if (!openReactorStore || !reactorPgliteDir || dir !== readModelPgliteDir) return openReadStore(dir);
|
|
2200
|
+
opening.stores ??= openStoresTogether(() => openReactorStore(reactorPgliteDir), () => openReadStore(dir));
|
|
2201
|
+
opening.stores.failed.catch(storeFailed);
|
|
2202
|
+
return opening.stores.readModel;
|
|
2203
|
+
};
|
|
2119
2204
|
}
|
|
2120
|
-
const
|
|
2205
|
+
const startingApi = initializeAndStartAPI(initializeClient, {
|
|
2121
2206
|
port: requestedPort,
|
|
2122
2207
|
dbPath: readModelPath,
|
|
2123
2208
|
pgliteFactory,
|
|
@@ -2125,14 +2210,19 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
2125
2210
|
packageLoaders: packageLoaders.length > 0 ? packageLoaders : void 0,
|
|
2126
2211
|
packages,
|
|
2127
2212
|
processorConfig: options.processorConfig,
|
|
2213
|
+
...renown ? { hostSigner: renown.signer } : {},
|
|
2128
2214
|
processors: vetraProcessorFactory ? { "@powerhousedao/vetra": [vetraProcessorFactory] } : {},
|
|
2129
2215
|
configFile: configPath,
|
|
2130
2216
|
server: {
|
|
2131
2217
|
basePath: config.server.basePath,
|
|
2132
2218
|
gatewayAdapter: config.server.gatewayAdapter,
|
|
2133
|
-
publicUrl: config.server.publicUrl
|
|
2219
|
+
publicUrl: config.server.publicUrl,
|
|
2220
|
+
host: config.server.host
|
|
2221
|
+
},
|
|
2222
|
+
auth: {
|
|
2223
|
+
...authSectionOf(config.auth),
|
|
2224
|
+
stateDir: resolvePhDir(void 0, config.storage.userDataDir ? { PH_USER_DATA_DIR: config.storage.userDataDir } : process.env)
|
|
2134
2225
|
},
|
|
2135
|
-
auth: authSectionOf(config.auth),
|
|
2136
2226
|
attachments: { storage: config.attachments.storage },
|
|
2137
2227
|
mcp: options.mcp ?? true,
|
|
2138
2228
|
inspection: options.inspection === false ? false : {
|
|
@@ -2142,13 +2232,21 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
2142
2232
|
logger: apiLogger,
|
|
2143
2233
|
reportError,
|
|
2144
2234
|
enableDocumentModelSubgraphs: options.enableDocumentModelSubgraphs,
|
|
2235
|
+
hostRefreshesSupergraph: true,
|
|
2145
2236
|
renown: renownConfig,
|
|
2146
2237
|
verifyCredential
|
|
2147
2238
|
}, "switchboard");
|
|
2239
|
+
const api = await Promise.race([startingApi, storesFailed]);
|
|
2148
2240
|
apiRef.current = api;
|
|
2149
2241
|
const serverPort = api.port;
|
|
2150
2242
|
if (renownConfig.source === "self") {
|
|
2151
2243
|
const { graphqlManager: manager } = api;
|
|
2244
|
+
if (!manager.hasSubgraphHandler(RENOWN_READ_MODEL_SUBGRAPH) && manager.getSubgraphByName(RENOWN_READ_MODEL_SUBGRAPH)) try {
|
|
2245
|
+
await manager.updateRouter(true);
|
|
2246
|
+
} catch (error) {
|
|
2247
|
+
await abortBoot(api);
|
|
2248
|
+
throw error;
|
|
2249
|
+
}
|
|
2152
2250
|
if (!manager.hasSubgraphHandler(RENOWN_READ_MODEL_SUBGRAPH)) {
|
|
2153
2251
|
await abortBoot(api);
|
|
2154
2252
|
throw new Error(`Renown credential verification is set to "self" (auth.renown.source or RENOWN_SOURCE) but no loaded package serves the "${RENOWN_READ_MODEL_SUBGRAPH}" subgraph. Install one (@powerhousedao/renown-package) or set RENOWN_SOURCE=remote.`);
|
|
@@ -2167,7 +2265,7 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
2167
2265
|
registerAttachmentRoutes(api, { config: config.attachments });
|
|
2168
2266
|
attachmentService = createRemoteAttachmentService(deriveAttachmentServiceConfig(options, serverPort, renown));
|
|
2169
2267
|
}
|
|
2170
|
-
if (process.env.SENTRY_DSN) api.httpAdapter.setupSentryErrorHandler(
|
|
2268
|
+
if (process.env.SENTRY_DSN) api.httpAdapter.setupSentryErrorHandler(await import("@sentry/node"));
|
|
2171
2269
|
const { client, read, write, graphqlManager, documentModelRegistry } = api;
|
|
2172
2270
|
const lateSubgraphs = [];
|
|
2173
2271
|
if (pluginHost) {
|
|
@@ -2371,8 +2469,7 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
2371
2469
|
}
|
|
2372
2470
|
if (options.drive) {
|
|
2373
2471
|
if (!renown) throw new Error("Cannot create default drive without Renown identity");
|
|
2374
|
-
|
|
2375
|
-
else defaultDriveUrl = await addDefaultDrive(client, options.drive, serverPort, logger);
|
|
2472
|
+
defaultDriveUrl = await ensureDrive(client, options.drive, serverPort, logger);
|
|
2376
2473
|
}
|
|
2377
2474
|
runDetached("Marking the API ready", async () => {
|
|
2378
2475
|
await Promise.allSettled(lateSubgraphs);
|
|
@@ -2495,12 +2592,14 @@ const startSwitchboard = async (input = {}, deps = {}) => {
|
|
|
2495
2592
|
if (options.identity.requireExisting) throw new Error("Identity required but failed to initialize. Run \"ph login\" first.", { cause: e });
|
|
2496
2593
|
}
|
|
2497
2594
|
const reportError = deps.reportError ?? ((error) => {
|
|
2498
|
-
|
|
2595
|
+
captureInSentry(error);
|
|
2499
2596
|
});
|
|
2597
|
+
const opening = {};
|
|
2500
2598
|
try {
|
|
2501
|
-
return await initServer(serverPort, options, config, renown, renownConfig, reportError);
|
|
2599
|
+
return await initServer(serverPort, options, config, renown, renownConfig, reportError, opening);
|
|
2502
2600
|
} catch (e) {
|
|
2503
|
-
|
|
2601
|
+
await opening.stores?.close();
|
|
2602
|
+
await captureInSentry(e);
|
|
2504
2603
|
if (StoredDocumentsRefusedError.isError(e)) logger.error(e.message);
|
|
2505
2604
|
else logger.error("App crashed: @error", e);
|
|
2506
2605
|
throw e;
|
|
@@ -2626,5 +2725,5 @@ function feedCatchUpPriority(priority, server) {
|
|
|
2626
2725
|
//#endregion
|
|
2627
2726
|
export { resolveKeyframes as a, attachmentsPlugin as c, initProfilerFromEnv as d, isPortAvailable as i, attachmentsPluginConfigSchema as l, deriveAttachmentServiceConfig as n, resolvePgliteStorageDirs as o, initSwitchboardProcess as r, startSwitchboard as s, createReactorKysely as t, applySwitchboardReactorDefaults as u };
|
|
2628
2727
|
|
|
2629
|
-
//# sourceMappingURL=server-
|
|
2630
|
-
//# debugId=
|
|
2728
|
+
//# sourceMappingURL=server-CgDvrUqE.mjs.map
|
|
2729
|
+
//# debugId=08a37d5f-b2a6-5d24-8e7b-2bea210aa270
|