@powerhousedao/switchboard 6.2.3-dev.40 → 6.2.3-dev.42

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,25 @@
1
+ ## 6.2.3-dev.42 (2026-10-04)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **registry:** stop a tarball stream's late fstat from crashing the registry ([84f56c54bf](https://github.com/powerhouse-inc/powerhouse/commit/84f56c54bf))
6
+ - **reactor:** let executor workers load document models from the registry ([8ae1911d44](https://github.com/powerhouse-inc/powerhouse/commit/8ae1911d44))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - acaldas
11
+
12
+ ## 6.2.3-dev.41 (2026-10-03)
13
+
14
+ ### 🩹 Fixes
15
+
16
+ - **registry:** stop a tarball stream's late fstat from crashing the registry ([84f56c54bf](https://github.com/powerhouse-inc/powerhouse/commit/84f56c54bf))
17
+ - **reactor:** let executor workers load document models from the registry ([8ae1911d44](https://github.com/powerhouse-inc/powerhouse/commit/8ae1911d44))
18
+
19
+ ### ❤️ Thank You
20
+
21
+ - acaldas
22
+
1
23
  ## 6.2.3-dev.40 (2026-10-02)
2
24
 
3
25
  ### 🩹 Fixes
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
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]="691165f8-a729-5658-bf22-e7b2440e6156")}catch(e){}}();
4
- import { i as StoredDocumentsRefusedError, r as startSwitchboard, s as parseForcePgVersion } from "./server-D3CYuEka.mjs";
4
+ import { i as StoredDocumentsRefusedError, r as startSwitchboard, s as parseForcePgVersion } from "./server-CMAxYG6D.mjs";
5
5
  import { metrics } from "@opentelemetry/api";
6
6
  import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
7
7
  import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
@@ -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]="98e9dab8-b145-5eb1-8457-7a9d38dda98e")}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]="e04a905d-8b84-5d81-aff7-5e3f6387cda0")}catch(e){}}();
3
3
  import { n as addDefaultReactorDrive, r as isPostgresUrl, t as addDefaultDrive } from "./utils-uaBlzyjS.mjs";
4
4
  import { createRequire, register } from "node:module";
5
5
  import { ReactorInstrumentation } from "@powerhousedao/opentelemetry-instrumentation-reactor";
@@ -1043,10 +1043,10 @@ const BASE_MODEL_SPECIFIERS = [
1043
1043
  * packages. Unresolvable identifiers are skipped with a warning; the builder
1044
1044
  * fails the boot if a registered model ends up without an importable source.
1045
1045
  */
1046
- async function resolveWorkerModelSources(packages, logger) {
1046
+ async function resolveWorkerModelSources(packages, logger, options = {}) {
1047
1047
  const sources = [];
1048
1048
  for (const identifier of [...BASE_MODEL_SPECIFIERS, ...packages]) {
1049
- const filePath = await resolveModelModuleFile(identifier);
1049
+ const filePath = await resolveModelModuleFile(identifier) ?? await resolveRemoteSafely(identifier, options.resolveRemote, logger);
1050
1050
  if (!filePath) {
1051
1051
  logger.warn(`Worker model sources: no importable document-models entry for "${identifier}", skipping`);
1052
1052
  continue;
@@ -1055,6 +1055,15 @@ async function resolveWorkerModelSources(packages, logger) {
1055
1055
  }
1056
1056
  return sources;
1057
1057
  }
1058
+ async function resolveRemoteSafely(identifier, resolveRemote, logger) {
1059
+ if (!resolveRemote) return null;
1060
+ try {
1061
+ return await resolveRemote(identifier);
1062
+ } catch (error) {
1063
+ logger.warn(`Worker model sources: could not cache "${identifier}" from the registry: ${String(error)}`);
1064
+ return null;
1065
+ }
1066
+ }
1058
1067
  /**
1059
1068
  * Absolute file path of a source's models barrel. Mirrors reactor-api's
1060
1069
  * import-resolver: import.meta.resolve, then the project's node_modules via
@@ -2588,6 +2597,8 @@ async function initServer(serverPort, options, renown, renownConfig) {
2588
2597
  if (!packages.includes(name)) packages.push(name);
2589
2598
  });
2590
2599
  }
2600
+ const registryPackageNames = new Set((registryPackages ?? "").split(",").map((p) => p.trim()).filter(Boolean));
2601
+ const resolveRegistryModels = async (identifier) => httpLoader && registryPackageNames.has(identifier) ? (await httpLoader.cachePackage(identifier)).entries.documentModels ?? null : null;
2591
2602
  const reactorLogger = logger.child(["reactor"]);
2592
2603
  let projectionWorkerFatalFired = false;
2593
2604
  const onProjectionWorkerFatal = (shardId, reason) => {
@@ -2659,7 +2670,7 @@ async function initServer(serverPort, options, renown, renownConfig) {
2659
2670
  });
2660
2671
  if (workerPool) {
2661
2672
  if (!reactorDbUrl) throw new Error("unreachable: worker pool enabled without a reactor database URL");
2662
- const workerSources = await resolveWorkerModelSources(packages, reactorLogger);
2673
+ const workerSources = await resolveWorkerModelSources(packages, reactorLogger, { resolveRemote: resolveRegistryModels });
2663
2674
  reactorBuilder.withDocumentModelSources(workerSources).withWorkerPool({
2664
2675
  numWorkers: workerPool.numWorkers,
2665
2676
  db: buildWorkerDbConfig(reactorDbUrl, workerPool)
@@ -2678,7 +2689,7 @@ async function initServer(serverPort, options, renown, renownConfig) {
2678
2689
  if (projectionWorker) {
2679
2690
  if (!reactorDbUrl) throw new Error("unreachable: projection worker enabled without a reactor database URL");
2680
2691
  if (!workerPool) {
2681
- const workerSources = await resolveWorkerModelSources(packages, reactorLogger);
2692
+ const workerSources = await resolveWorkerModelSources(packages, reactorLogger, { resolveRemote: resolveRegistryModels });
2682
2693
  reactorBuilder.withDocumentModelSources(workerSources);
2683
2694
  }
2684
2695
  const db = {
@@ -3037,5 +3048,5 @@ if (import.meta.main) await startSwitchboard({ fatalErrorShutdown: true });
3037
3048
  //#endregion
3038
3049
  export { resolveUnsupportedStoredDocuments as a, StoredDocumentsRefusedError as i, isPortAvailable as n, applySwitchboardReactorDefaults as o, startSwitchboard as r, parseForcePgVersion as s, deriveAttachmentServiceConfig as t };
3039
3050
 
3040
- //# sourceMappingURL=server-D3CYuEka.mjs.map
3041
- //# debugId=98e9dab8-b145-5eb1-8457-7a9d38dda98e
3051
+ //# sourceMappingURL=server-CMAxYG6D.mjs.map
3052
+ //# debugId=e04a905d-8b84-5d81-aff7-5e3f6387cda0