@powerhousedao/switchboard 6.4.0-next.2 → 6.4.0-next.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ ## 6.4.0-next.3 (2026-11-23)
2
+
3
+ ### 🚀 Features
4
+
5
+ - ⚠️ **switchboard,connect:** no built-in vetra package ([1e9b9ba2c6](https://github.com/powerhouse-inc/powerhouse/commit/1e9b9ba2c6))
6
+ - ⚠️ **ph-cli:** generate stubs only, no dependency on the vetra package ([329d9de807](https://github.com/powerhouse-inc/powerhouse/commit/329d9de807))
7
+ - **switchboard:** add the inspector plugin that reports loaded document models ([d286a0f1ce](https://github.com/powerhouse-inc/powerhouse/commit/d286a0f1ce))
8
+
9
+ ### ⚠️ Breaking Changes
10
+
11
+ - **switchboard,connect:** no built-in vetra package ([1e9b9ba2c6](https://github.com/powerhouse-inc/powerhouse/commit/1e9b9ba2c6))
12
+ switchboard dev mode and Connect studio mode no longer
13
+ load @powerhousedao/vetra by themselves.
14
+ Co-Authored-By: Claude <noreply@anthropic.com>
15
+ Claude-Session: https://claude.ai/code/session_016fHjTMdimGetqa3JnGXsnE
16
+ - **ph-cli:** generate stubs only, no dependency on the vetra package ([329d9de807](https://github.com/powerhouse-inc/powerhouse/commit/329d9de807))
17
+ ph generate --document and --extract are removed.
18
+ Co-Authored-By: Claude <noreply@anthropic.com>
19
+ Claude-Session: https://claude.ai/code/session_016fHjTMdimGetqa3JnGXsnE
20
+
21
+ ### ❤️ Thank You
22
+
23
+ - Claude
24
+ - Wouter Kampmann
25
+
1
26
  ## 6.4.0-next.2 (2026-11-23)
2
27
 
3
28
  ### 🚀 Features
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@
4
4
  import { n as installObservabilitySignals } from "./observability-CldagyT_.mjs";
5
5
  import { n as StoredDocumentsRefusedError, t as switchboardConfigFromEnv } from "./from-env-CLImR6qa.mjs";
6
6
  import { a as callerOverEnv, o as mergeSwitchboardConfig } from "./schema-BbwISVSO.mjs";
7
- import { d as initProfilerFromEnv, r as initSwitchboardProcess, s as startSwitchboard } from "./server-CbKdygtT.mjs";
7
+ import { d as initProfilerFromEnv, r as initSwitchboardProcess, s as startSwitchboard } from "./server-CrAdM6CN.mjs";
8
8
  import * as Sentry from "@sentry/node";
9
9
  import { childLogger } from "document-model";
10
10
  import { getConfig } from "@powerhousedao/config/node";
@@ -1,4 +1,4 @@
1
- import { c as attachmentsPlugin, l as attachmentsPluginConfigSchema } from "../server-CbKdygtT.mjs";
1
+ import { c as attachmentsPlugin, l as attachmentsPluginConfigSchema } from "../server-CrAdM6CN.mjs";
2
2
  export { attachmentsPlugin, attachmentsPlugin as default, attachmentsPluginConfigSchema };
3
- !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]="e9cb264f-88de-5ad2-8c4c-bfa38e7f72df")}catch(e){}}();
4
- //# debugId=e9cb264f-88de-5ad2-8c4c-bfa38e7f72df
3
+ !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]="7fb10f42-4b1a-587d-bad9-adf4411696bf")}catch(e){}}();
4
+ //# debugId=7fb10f42-4b1a-587d-bad9-adf4411696bf
@@ -41,7 +41,6 @@ export interface InspectorReport {
41
41
  packages: InspectorPackageReport[];
42
42
  }
43
43
  export type InspectorPlugin = HostPlugin<{
44
- transformServerOptions: (options: Record<string, unknown>, ctx: SwitchboardHostContext) => Record<string, unknown>;
45
44
  onReactorReady: (ctx: SwitchboardHostContext) => void;
46
45
  onShutdown: (ctx: SwitchboardHostContext) => void;
47
46
  }, InspectorPluginConfig>;
@@ -1 +1 @@
1
- {"version":3,"file":"inspector.d.mts","names":[],"sources":["../../src/plugins/inspector.mts"],"mappings":";;;;;qBAOa,6BAA2B,EAAA;;;GAUtC,EAAA,KAAA;YAEU,wBAAwB,EAAE,aAAa;;YAGvC,6BAA6B,EAAE,aAClC;QAGD;YACI;IACR,gDAAgD;;;qBAIvC;;iBAGI;EACf;EACA;;EAEA;;EAEA,eAAe;;iBAGA;;EAEf;;EAEA;EACA,QAAQ;;iBAGO;EACf,gBAAgB;;EAEhB;EACA;EACA;EACA,UAAU;;YAGA,kBAAkB;EAE1B,yBACE,SAAS,yBACT,KAAK,2BACF;EACL,iBAAiB,KAAK;EACtB,aAAa,KAAK;GAEpB;;wBAqBc,kBACd,UAAU,oCAAoC,yBAC9C;EAAQ;EAAkB;EAAuB,MAAM;IACtD;;wBA2Ba,qBACd,cACA,QAAQ;;;;;;;;;wBAqBM,sBAAsB,qBAAqB"}
1
+ {"version":3,"file":"inspector.d.mts","names":[],"sources":["../../src/plugins/inspector.mts"],"mappings":";;;;;qBAOa,6BAA2B,EAAA;;;GAOtC,EAAA,KAAA;YAEU,wBAAwB,EAAE,aAAa;;YAGvC,6BAA6B,EAAE,aAClC;QAGD;YACI;IACR,gDAAgD;;;qBAIvC;;iBAGI;EACf;EACA;;EAEA;;EAEA,eAAe;;iBAGA;;EAEf;;EAEA;EACA,QAAQ;;iBAGO;EACf,gBAAgB;;EAEhB;EACA;EACA;EACA,UAAU;;YAGA,kBAAkB;EAE1B,iBAAiB,KAAK;EACtB,aAAa,KAAK;GAEpB;;wBAqBc,kBACd,UAAU,oCAAoC,yBAC9C;EAAQ;EAAkB;EAAuB,MAAM;IACtD;;wBA2Ba,qBACd,cACA,QAAQ;;;;;;;;;wBAqBM,sBAAsB,qBAAqB"}
@@ -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]="9e644745-0f0c-57a8-9ad4-8b0648fa99be")}catch(e){}}();
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]="ab14949e-ae8b-5503-8f6c-1a80a6ea6fc0")}catch(e){}}();
3
3
  import { mkdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
4
4
  import path from "node:path";
5
5
  import { z } from "zod";
@@ -8,11 +8,8 @@ const inspectorPluginConfigSchema = z.strictObject({
8
8
  /** Where the report is written: an absolute path, or one relative to the
9
9
  * working directory. */
10
10
  reportFile: z.string().min(1),
11
- /**
12
- * Whether a dev switchboard keeps the Vetra codegen processor, which
13
- * rewrites the project's code from documents on `vetra` drives. Off: a
14
- * switchboard that reports its runtime only reads the project.
15
- */
11
+ /** @deprecated Accepted and ignored: no switchboard brings a codegen
12
+ * processor of its own. */
16
13
  codegen: z.boolean().default(false)
17
14
  });
18
15
  const INSPECTOR_REPORT_VERSION = 1;
@@ -70,10 +67,6 @@ function createInspectorPlugin(rawConfig) {
70
67
  appliesTo: "switchboard",
71
68
  configSchema: inspectorPluginConfigSchema,
72
69
  hooks: {
73
- transformServerOptions: (options) => config.codegen ? options : {
74
- ...options,
75
- codegenProcessor: false
76
- },
77
70
  onReactorReady: (ctx) => {
78
71
  const { packageManager } = ctx.api;
79
72
  const logger = ctx.logger;
@@ -104,4 +97,4 @@ function createInspectorPlugin(rawConfig) {
104
97
  export { INSPECTOR_REPORT_VERSION, createInspectorPlugin, createInspectorPlugin as default, inspectorPluginConfigSchema, inspectorReportOf, writeInspectorReport };
105
98
 
106
99
  //# sourceMappingURL=inspector.mjs.map
107
- //# debugId=9e644745-0f0c-57a8-9ad4-8b0648fa99be
100
+ //# debugId=ab14949e-ae8b-5503-8f6c-1a80a6ea6fc0
@@ -1 +1 @@
1
- {"version":3,"file":"inspector.mjs","sources":["../../src/plugins/inspector.mts"],"sourcesContent":["import type { HostPlugin } from \"@powerhousedao/host-core\";\nimport type { DocumentModelModule, ILogger } from \"document-model\";\nimport { mkdirSync, renameSync, rmSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { z } from \"zod\";\nimport type { SwitchboardHostContext } from \"../plugin-host.mjs\";\n\nexport const inspectorPluginConfigSchema = z.strictObject({\n /** Where the report is written: an absolute path, or one relative to the\n * working directory. */\n reportFile: z.string().min(1),\n /**\n * Whether a dev switchboard keeps the Vetra codegen processor, which\n * rewrites the project's code from documents on `vetra` drives. Off: a\n * switchboard that reports its runtime only reads the project.\n */\n codegen: z.boolean().default(false),\n});\n\nexport type InspectorPluginConfig = z.infer<typeof inspectorPluginConfigSchema>;\n\n/** What a host.js entry writes. */\nexport type InspectorPluginConfigInput = z.input<\n typeof inspectorPluginConfigSchema\n>;\n\ndeclare global {\n interface PHPluginConfigs {\n \"@powerhousedao/switchboard/plugins/inspector\": InspectorPluginConfigInput;\n }\n}\n\nexport const INSPECTOR_REPORT_VERSION = 1;\n\n/** One loaded document model module: one version of one document type. */\nexport interface InspectorModelReport {\n documentType: string;\n name: string;\n /** The module's version; absent on a model that is not versioned. */\n version?: number;\n /** The module's `documentModel` global state: every specification. */\n documentModel: DocumentModelModule[\"documentModel\"][\"global\"];\n}\n\nexport interface InspectorPackageReport {\n /** The package as the package manager keys it: a name, or a folder. */\n name: string;\n /** The project itself: the working directory, loaded as a package. */\n local: boolean;\n models: InspectorModelReport[];\n}\n\nexport interface InspectorReport {\n version: typeof INSPECTOR_REPORT_VERSION;\n /** Counts the reports of this process: 1 at ready, +1 per reload. */\n sequence: number;\n writtenAt: string;\n pid: number;\n packages: InspectorPackageReport[];\n}\n\nexport type InspectorPlugin = HostPlugin<\n {\n transformServerOptions: (\n options: Record<string, unknown>,\n ctx: SwitchboardHostContext,\n ) => Record<string, unknown>;\n onReactorReady: (ctx: SwitchboardHostContext) => void;\n onShutdown: (ctx: SwitchboardHostContext) => void;\n },\n InspectorPluginConfig\n>;\n\n/** What the plugin reads of the started API. */\ninterface InspectedApi {\n packageManager: {\n getDocumentModels(): Map<string, DocumentModelModule[]>;\n onDocumentModelsChange(\n handler: (packages: Record<string, DocumentModelModule[]>) => unknown,\n ): void;\n };\n}\n\nconst samePath = (a: string, b: string) => {\n const [left, right] = [path.resolve(a), path.resolve(b)];\n return process.platform === \"win32\"\n ? left.toLowerCase() === right.toLowerCase()\n : left === right;\n};\n\n/** The report of what the package manager holds, packages and models sorted. */\nexport function inspectorReportOf(\n packages: Iterable<readonly [string, readonly DocumentModelModule[]]>,\n meta: { sequence: number; localPackage?: string; now?: Date },\n): InspectorReport {\n const reported = Array.from(packages, ([name, modules]) => ({\n name,\n local: meta.localPackage ? samePath(name, meta.localPackage) : false,\n models: modules\n .map((module) => ({\n documentType: module.documentModel.global.id,\n name: module.documentModel.global.name,\n ...(module.version === undefined ? {} : { version: module.version }),\n documentModel: module.documentModel.global,\n }))\n .sort(\n (a, b) =>\n a.documentType.localeCompare(b.documentType) ||\n (a.version ?? 0) - (b.version ?? 0),\n ),\n })).sort((a, b) => a.name.localeCompare(b.name));\n return {\n version: INSPECTOR_REPORT_VERSION,\n sequence: meta.sequence,\n writtenAt: (meta.now ?? new Date()).toISOString(),\n pid: process.pid,\n packages: reported,\n };\n}\n\n/** Readers never see half a report: written beside the file, then renamed. */\nexport function writeInspectorReport(\n file: string,\n report: InspectorReport,\n): void {\n mkdirSync(path.dirname(file), { recursive: true });\n const temp = `${file}.${process.pid}.tmp`;\n writeFileSync(temp, JSON.stringify(report));\n try {\n renameSync(temp, file);\n } catch (error) {\n rmSync(temp, { force: true });\n throw error;\n }\n}\n\n/**\n * The inspector: reports the runtime this switchboard loaded to whoever\n * started it. Once the reactor is ready, and again each time a package\n * reloads, it writes every loaded document model module's `documentModel`\n * (all specification versions) to `reportFile`. A file, as the run record\n * is: the reader needs no address, and either side restarts alone. The file\n * goes when the switchboard stops.\n */\nexport function createInspectorPlugin(rawConfig: unknown): InspectorPlugin {\n const config = inspectorPluginConfigSchema.parse(rawConfig ?? {});\n const file = path.resolve(config.reportFile);\n let sequence = 0;\n let stopped = false;\n return {\n name: \"switchboard-inspector\",\n appliesTo: \"switchboard\",\n configSchema: inspectorPluginConfigSchema,\n hooks: {\n transformServerOptions: (options) =>\n config.codegen ? options : { ...options, codegenProcessor: false },\n onReactorReady: (ctx) => {\n const { packageManager } = ctx.api as InspectedApi;\n const logger = ctx.logger as ILogger;\n const { disableLocalPackages } = ctx.options as {\n disableLocalPackages?: boolean;\n };\n const localPackage = disableLocalPackages ? undefined : process.cwd();\n const report = (\n packages: Iterable<readonly [string, readonly DocumentModelModule[]]>,\n ) => {\n if (stopped) return;\n try {\n writeInspectorReport(\n file,\n inspectorReportOf(packages, {\n sequence: ++sequence,\n localPackage,\n }),\n );\n } catch (error) {\n logger.warn(\n \"The inspector could not write its report to @file: @error\",\n file,\n error,\n );\n }\n };\n report(packageManager.getDocumentModels());\n packageManager.onDocumentModelsChange((packages) =>\n report(Object.entries(packages)),\n );\n },\n onShutdown: () => {\n stopped = true;\n rmSync(file, { force: true });\n },\n },\n };\n}\n\n// resolveHostPlugins consumes the DEFAULT export (plugin object or factory).\nexport default createInspectorPlugin;\n"],"names":[],"mappings":";;;;;;AAOA,MAAa,8BAA8B,EAAE,aAAa;;;CAGxD,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;;;;;;CAM5B,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,KAAK;AACpC,CAAC;AAeD,MAAa,2BAA2B;AAmDxC,MAAM,YAAY,GAAW,MAAc;CACzC,MAAM,CAAC,MAAM,SAAS,CAAC,KAAK,QAAQ,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC;CACvD,OAAO,QAAQ,aAAa,UACxB,KAAK,YAAY,MAAM,MAAM,YAAY,IACzC,SAAS;AACf;;AA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AS,kBAAkB;GAAM;GACnE,iBAAiB,QAAQ;IACvB,MAAM,EAAE,mBAAmB,IAAI;IAC/B,MAAM,SAAS,IAAI;IACnB,MAAM,EAAE,yBAAyB,IAAI;IAGrC,MAAM,eAAe,uBAAuB,KAAA,IAAY,QAAQ,IAAI;IACpE,MAAM,UACJ,aACG;KACH,IAAI,SAAS;KACb,IAAI;MACF,qBACE,MACA,kBAAkB,UAAU;OAC1B,UAAU,EAAE;OACZ;MACF,CAAC,CACH;KACF,SAAS,OAAO;MACd,OAAO,KACL,6DACA,MACA,KACF;KACF;IACF;IACA,OAAO,eAAe,kBAAkB,CAAC;IACzC,eAAe,wBAAwB,aACrC,OAAO,OAAO,QAAQ,QAAQ,CAAC,CACjC;GACF;GACA,kBAAkB;IAChB,UAAU;IACV,OAAO,MAAM,EAAE,OAAO,KAAK,CAAC;GAC9B;EACF;CACF;AACF","debug_id":"9e644745-0f0c-57a8-9ad4-8b0648fa99be"}
1
+ {"version":3,"file":"inspector.mjs","sources":["../../src/plugins/inspector.mts"],"sourcesContent":["import type { HostPlugin } from \"@powerhousedao/host-core\";\nimport type { DocumentModelModule, ILogger } from \"document-model\";\nimport { mkdirSync, renameSync, rmSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { z } from \"zod\";\nimport type { SwitchboardHostContext } from \"../plugin-host.mjs\";\n\nexport const inspectorPluginConfigSchema = z.strictObject({\n /** Where the report is written: an absolute path, or one relative to the\n * working directory. */\n reportFile: z.string().min(1),\n /** @deprecated Accepted and ignored: no switchboard brings a codegen\n * processor of its own. */\n codegen: z.boolean().default(false),\n});\n\nexport type InspectorPluginConfig = z.infer<typeof inspectorPluginConfigSchema>;\n\n/** What a host.js entry writes. */\nexport type InspectorPluginConfigInput = z.input<\n typeof inspectorPluginConfigSchema\n>;\n\ndeclare global {\n interface PHPluginConfigs {\n \"@powerhousedao/switchboard/plugins/inspector\": InspectorPluginConfigInput;\n }\n}\n\nexport const INSPECTOR_REPORT_VERSION = 1;\n\n/** One loaded document model module: one version of one document type. */\nexport interface InspectorModelReport {\n documentType: string;\n name: string;\n /** The module's version; absent on a model that is not versioned. */\n version?: number;\n /** The module's `documentModel` global state: every specification. */\n documentModel: DocumentModelModule[\"documentModel\"][\"global\"];\n}\n\nexport interface InspectorPackageReport {\n /** The package as the package manager keys it: a name, or a folder. */\n name: string;\n /** The project itself: the working directory, loaded as a package. */\n local: boolean;\n models: InspectorModelReport[];\n}\n\nexport interface InspectorReport {\n version: typeof INSPECTOR_REPORT_VERSION;\n /** Counts the reports of this process: 1 at ready, +1 per reload. */\n sequence: number;\n writtenAt: string;\n pid: number;\n packages: InspectorPackageReport[];\n}\n\nexport type InspectorPlugin = HostPlugin<\n {\n onReactorReady: (ctx: SwitchboardHostContext) => void;\n onShutdown: (ctx: SwitchboardHostContext) => void;\n },\n InspectorPluginConfig\n>;\n\n/** What the plugin reads of the started API. */\ninterface InspectedApi {\n packageManager: {\n getDocumentModels(): Map<string, DocumentModelModule[]>;\n onDocumentModelsChange(\n handler: (packages: Record<string, DocumentModelModule[]>) => unknown,\n ): void;\n };\n}\n\nconst samePath = (a: string, b: string) => {\n const [left, right] = [path.resolve(a), path.resolve(b)];\n return process.platform === \"win32\"\n ? left.toLowerCase() === right.toLowerCase()\n : left === right;\n};\n\n/** The report of what the package manager holds, packages and models sorted. */\nexport function inspectorReportOf(\n packages: Iterable<readonly [string, readonly DocumentModelModule[]]>,\n meta: { sequence: number; localPackage?: string; now?: Date },\n): InspectorReport {\n const reported = Array.from(packages, ([name, modules]) => ({\n name,\n local: meta.localPackage ? samePath(name, meta.localPackage) : false,\n models: modules\n .map((module) => ({\n documentType: module.documentModel.global.id,\n name: module.documentModel.global.name,\n ...(module.version === undefined ? {} : { version: module.version }),\n documentModel: module.documentModel.global,\n }))\n .sort(\n (a, b) =>\n a.documentType.localeCompare(b.documentType) ||\n (a.version ?? 0) - (b.version ?? 0),\n ),\n })).sort((a, b) => a.name.localeCompare(b.name));\n return {\n version: INSPECTOR_REPORT_VERSION,\n sequence: meta.sequence,\n writtenAt: (meta.now ?? new Date()).toISOString(),\n pid: process.pid,\n packages: reported,\n };\n}\n\n/** Readers never see half a report: written beside the file, then renamed. */\nexport function writeInspectorReport(\n file: string,\n report: InspectorReport,\n): void {\n mkdirSync(path.dirname(file), { recursive: true });\n const temp = `${file}.${process.pid}.tmp`;\n writeFileSync(temp, JSON.stringify(report));\n try {\n renameSync(temp, file);\n } catch (error) {\n rmSync(temp, { force: true });\n throw error;\n }\n}\n\n/**\n * The inspector: reports the runtime this switchboard loaded to whoever\n * started it. Once the reactor is ready, and again each time a package\n * reloads, it writes every loaded document model module's `documentModel`\n * (all specification versions) to `reportFile`. A file, as the run record\n * is: the reader needs no address, and either side restarts alone. The file\n * goes when the switchboard stops.\n */\nexport function createInspectorPlugin(rawConfig: unknown): InspectorPlugin {\n const config = inspectorPluginConfigSchema.parse(rawConfig ?? {});\n const file = path.resolve(config.reportFile);\n let sequence = 0;\n let stopped = false;\n return {\n name: \"switchboard-inspector\",\n appliesTo: \"switchboard\",\n configSchema: inspectorPluginConfigSchema,\n hooks: {\n onReactorReady: (ctx) => {\n const { packageManager } = ctx.api as InspectedApi;\n const logger = ctx.logger as ILogger;\n const { disableLocalPackages } = ctx.options as {\n disableLocalPackages?: boolean;\n };\n const localPackage = disableLocalPackages ? undefined : process.cwd();\n const report = (\n packages: Iterable<readonly [string, readonly DocumentModelModule[]]>,\n ) => {\n if (stopped) return;\n try {\n writeInspectorReport(\n file,\n inspectorReportOf(packages, {\n sequence: ++sequence,\n localPackage,\n }),\n );\n } catch (error) {\n logger.warn(\n \"The inspector could not write its report to @file: @error\",\n file,\n error,\n );\n }\n };\n report(packageManager.getDocumentModels());\n packageManager.onDocumentModelsChange((packages) =>\n report(Object.entries(packages)),\n );\n },\n onShutdown: () => {\n stopped = true;\n rmSync(file, { force: true });\n },\n },\n };\n}\n\n// resolveHostPlugins consumes the DEFAULT export (plugin object or factory).\nexport default createInspectorPlugin;\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C;CAC1C,IAAI;EACF,WAAW,MAAM,IAAI;CACvB,SAAS,OAAO;EACd,OAAO,MAAM,EAAE,OAAO,KAAK,CAAC;EAC5B,MAAM;CACR;AACF;;;;;;;;;AAUA,SAAgB,sBAAsB,WAAqC;CACzE,MAAM,SAAS,4BAA4B,MAAM,aAAa,CAAC,CAAC;CAChE,MAAM,OAAO,KAAK,QAAQ,OAAO,UAAU;CAC3C,IAAI,WAAW;CACf,IAAI,UAAU;CACd,OAAO;EACL,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;GACL,iBAAiB,QAAQ;IACvB,MAAM,EAAE,mBAAmB,IAAI;IAC/B,MAAM,SAAS,IAAI;IACnB,MAAM,EAAE,yBAAyB,IAAI;IAGrC,MAAM,eAAe,uBAAuB,KAAA,IAAY,QAAQ,IAAI;IACpE,MAAM,UACJ,aACG;KACH,IAAI,SAAS;KACb,IAAI;MACF,qBACE,MACA,kBAAkB,UAAU;OAC1B,UAAU,EAAE;OACZ;MACF,CAAC,CACH;KACF,SAAS,OAAO;MACd,OAAO,KACL,6DACA,MACA,KACF;KACF;IACF;IACA,OAAO,eAAe,kBAAkB,CAAC;IACzC,eAAe,wBAAwB,aACrC,OAAO,OAAO,QAAQ,QAAQ,CAAC,CACjC;GACF;GACA,kBAAkB;IAChB,UAAU;IACV,OAAO,MAAM,EAAE,OAAO,KAAK,CAAC;GAC9B;EACF;CACF;AACF","debug_id":"ab14949e-ae8b-5503-8f6c-1a80a6ea6fc0"}
@@ -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]="ef1186cf-3af2-530c-8354-5415967a19a6")}catch(e){}}();
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]="4dee3ffc-f391-52fa-bbd4-cffb550be07a")}catch(e){}}();
3
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-CLImR6qa.mjs";
4
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";
@@ -2014,10 +2014,9 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
2014
2014
  if (storeMaintenance) reactorBuilder.withStoreMaintenance(storeMaintenance);
2015
2015
  if (poolInstrumentation) reactorBuilder.withInstrumentedPool(poolInstrumentation);
2016
2016
  const clientBuilder = new ReactorClientBuilder().withReactorBuilder(reactorBuilder);
2017
- const vetraDocumentModels = dev ? Object.values(await import("@powerhousedao/vetra/document-models")).filter((m) => typeof m === "object" && m !== null && "documentModel" in m && "reducer" in m) : [];
2018
2017
  applySwitchboardReactorDefaults(reactorBuilder, clientBuilder, {
2019
2018
  signalHandlers: options.signalHandlers,
2020
- documentModels: [...documentModels, ...vetraDocumentModels],
2019
+ documentModels,
2021
2020
  upgradeManifests,
2022
2021
  executorConfig: {
2023
2022
  ...hasSkipThreshold ? { maxSkipThreshold } : {},
@@ -2182,7 +2181,6 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
2182
2181
  reportError
2183
2182
  });
2184
2183
  }
2185
- const vetraProcessorFactory = dev && options.codegenProcessor !== false ? (await import("@powerhousedao/vetra/processors")).processorFactory : void 0;
2186
2184
  if (!options.disableLocalPackages) packages.push(basePath);
2187
2185
  const packageLoaders = [];
2188
2186
  if (viteLoader) packageLoaders.push(viteLoader);
@@ -2232,7 +2230,6 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
2232
2230
  packages,
2233
2231
  processorConfig: options.processorConfig,
2234
2232
  ...renown ? { hostSigner: renown.signer } : {},
2235
- processors: vetraProcessorFactory ? { "@powerhousedao/vetra": [vetraProcessorFactory] } : {},
2236
2233
  configFile: configPath,
2237
2234
  server: {
2238
2235
  basePath: config.server.basePath,
@@ -2676,5 +2673,5 @@ function feedCatchUpPriority(priority, server) {
2676
2673
  //#endregion
2677
2674
  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 };
2678
2675
 
2679
- //# sourceMappingURL=server-CbKdygtT.mjs.map
2680
- //# debugId=ef1186cf-3af2-530c-8354-5415967a19a6
2676
+ //# sourceMappingURL=server-CrAdM6CN.mjs.map
2677
+ //# debugId=4dee3ffc-f391-52fa-bbd4-cffb550be07a