@powerhousedao/switchboard 6.2.3-dev.77 → 6.2.3-dev.78

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,24 @@
1
+ ## 6.2.3-dev.78 (2026-10-27)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **portle:** scaffold @powerhousedao/portle, the switchboard plugin that gates publication through Portle ([68ab561f7d](https://github.com/powerhouse-inc/powerhouse/commit/68ab561f7d))
6
+ - **reactor-api,reactor-browser,switchboard:** type-neutral drive node queries and read.drives on the remote client ([b8a09950c0](https://github.com/powerhouse-inc/powerhouse/commit/b8a09950c0))
7
+ - **reactor-api,switchboard:** vacuum full policy knob, no forced rewrite under load by default ([d6dcbf5cd0](https://github.com/powerhouse-inc/powerhouse/commit/d6dcbf5cd0))
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - **registry:** a failed tarball write no longer records its attachment ([5d3ae94bd8](https://github.com/powerhouse-inc/powerhouse/commit/5d3ae94bd8))
12
+ - **reactor-api:** the one-time VACUUM FULL is off by default; quiet and forced are opt-ins ([fd7c19e313](https://github.com/powerhouse-inc/powerhouse/commit/fd7c19e313))
13
+ - **switchboard:** port 0 reports the bound port ([3218c7105d](https://github.com/powerhouse-inc/powerhouse/commit/3218c7105d))
14
+
15
+ ### ❤️ Thank You
16
+
17
+ - Benjamin Jordan
18
+ - Claude Fable 5.1
19
+ - Claude Opus 5.5
20
+ - Wouter Kampmann
21
+
1
22
  ## 6.2.3-dev.77 (2026-10-26)
2
23
 
3
24
  ### 🚀 Features
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]="970d13d2-8fb1-53c8-819e-786cc25376f0")}catch(e){}}();
4
- import { a as startSwitchboard, d as initProfilerFromEnv, f as parseForcePgVersion, o as StoredDocumentsRefusedError } from "./server-BkL_NyGG.mjs";
4
+ import { a as startSwitchboard, d as initProfilerFromEnv, f as parseForcePgVersion, o as StoredDocumentsRefusedError } from "./server-Bdq8xquD.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,4 +1,4 @@
1
- import { c as attachmentsPlugin, l as attachmentsPluginConfigSchema } from "../server-BkL_NyGG.mjs";
1
+ import { c as attachmentsPlugin, l as attachmentsPluginConfigSchema } from "../server-Bdq8xquD.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]="0fc22757-862b-5bdd-856b-52378289a680")}catch(e){}}();
4
- //# debugId=0fc22757-862b-5bdd-856b-52378289a680
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]="4153b88d-7424-5d61-823d-fdde66aed53b")}catch(e){}}();
4
+ //# debugId=4153b88d-7424-5d61-823d-fdde66aed53b
@@ -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]="71696ff5-99ce-5369-9bed-524565c3481d")}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]="ca62b433-fc4f-5ba3-9edb-8b3b8985f35a")}catch(e){}}();
3
3
  import { _ as triggerFatalShutdown, a as workflowsPlugin, c as WORKFLOW_TELEMETRY_SCOPE, d as isWorkflowSingletonConflict, f as modelManifestSource, g as installFatalErrorShutdown, h as workflowSingletonLossHandler, l as assertWorkflowPackageLoadable, m as retryWorkflowSingleton, p as resolveWorkflowsEnabled, s as WORKFLOW_PACKAGE_NAME, u as composeWorkflowRuntime } from "./workflows-fsBcElEi.mjs";
4
4
  import { i as startPrivacy, r as resolvePrivacy, t as privacyPlugin } from "./privacy-BsFl7GzK.mjs";
5
5
  import { t as mcpPlugin } from "./mcp-SsBK14Jm.mjs";
@@ -20,10 +20,10 @@ import { pathToFileURL } from "node:url";
20
20
  import { CatchUpPriority, ChannelScheme, DriveCollectionId, EventBus, HardenedPGliteDialect, IN_MEMORY_PGLITE_STORAGE_FACTS, PGLITE_PATH_STORAGE_FACTS, POSTGRES_STORAGE_FACTS, REACTOR_SCHEMA, ReactorBuilder, ReactorClientBuilder, UnsupportedStoredProtocolError, createHybridProjectionCoordinatorFactory, instrumentPgPool, parseCatchUpPriority, parseDriveUrl, supportsLiveReadModelRegistration } from "@powerhousedao/reactor";
21
21
  import { HttpPackageLoader, ImportPackageLoader, NodeEventLoopDelay, PackageManagementService, PackagesSubgraph, RequestLoadRecorder, baseDocumentModels, getUniqueDocumentModels, initializeAndStartAPI, reportFailure, resolveRenownConfig, runDetached } from "@powerhousedao/reactor-api";
22
22
  import { httpsHooksPath } from "@powerhousedao/reactor-api/https-hooks";
23
- import { PGLITE_UTC_PARSERS, ThreadedPGlite, createDurableNodeFs, pgliteWorkerEntryPath, preparePgliteDataDir, removeStalePgliteFiles, resolvePgliteFsync, resolvePgliteWorkerMemoryMb, syncTree } from "@powerhousedao/reactor-api/pglite-node";
23
+ import { PGLITE_UTC_PARSERS, ThreadedPGlite, createDurableNodeFs, pgliteWorkerEntryPath, preparePgliteDataDir, removeStalePgliteFiles, resolvePgliteFsync, resolvePgliteMaintenance, resolvePgliteWorkerMemoryMb, syncTree } from "@powerhousedao/reactor-api/pglite-node";
24
24
  import { AttachmentAlreadyExists, AttachmentNotFound, AttachmentPending, AttachmentReferenceReadModel, AttachmentSchemaCompiler, HashMismatch, InvalidAttachmentMetadata, InvalidAttachmentRef, ReservationNotFound, SizeMismatch, UploadTooLarge, createRef, createRemoteAttachmentService, parseAttachmentDownloadTarget, validateReserveMetadata } from "@powerhousedao/reactor-attachments";
25
25
  import { createAttachmentClient } from "@powerhousedao/reactor-attachments/client";
26
- import { DriveNodeView, NodeProcessor, ReactorDriveClient } from "@powerhousedao/reactor-drive";
26
+ import { DriveNodeView, NodeProcessor, REACTOR_DRIVE_DOCUMENT_TYPE, ReactorDriveClient, createReactorDriveWriteStrategy } from "@powerhousedao/reactor-drive";
27
27
  import { REACTOR_DRIVE_SUBGRAPH_NAME, createReactorDriveResolvers, reactorDriveSubgraphTypeDefs } from "@powerhousedao/reactor-drive/subgraph";
28
28
  import { DEFAULT_KEYPAIR_PATH, DEFAULT_RENOWN_URL, NodeKeyStorage, RENOWN_READ_MODEL_SUBGRAPH, RenownBuilder, RenownCryptoBuilder, createLocalCredentialVerifier, createRenownTrustPolicy, resolveSwitchboardEndpoint } from "@renown/sdk/node";
29
29
  import { Kysely, PostgresDialect, sql } from "kysely";
@@ -1488,20 +1488,8 @@ function pgliteFsyncFor(major, dir, logger) {
1488
1488
  if (wanted && major === 16) logger.warn(`PGlite data dir ${dir} is PG16 on pglite-legacy-02, which does not sync commits to disk; only checkpoints are synced until --migrate-pglite upgrades it.`);
1489
1489
  return wanted;
1490
1490
  }
1491
- /** VACUUM FULL timing from the environment; unset or invalid keeps the defaults. */
1492
- function vacuumFullTimingFromEnv(env) {
1493
- const ms = (value) => {
1494
- if (value === void 0 || value.trim() === "") return void 0;
1495
- const parsed = Number(value);
1496
- return Number.isFinite(parsed) && parsed >= 0 ? parsed : void 0;
1497
- };
1498
- const quiet = ms(env.PH_PGLITE_VACUUM_FULL_QUIET_MS);
1499
- const maxDefer = ms(env.PH_PGLITE_VACUUM_FULL_MAX_DEFER_MS);
1500
- return {
1501
- ...quiet === void 0 ? {} : { vacuumFullQuietMs: quiet },
1502
- ...maxDefer === void 0 ? {} : { vacuumFullMaxDeferMs: maxDefer }
1503
- };
1504
- }
1491
+ /** The VACUUM FULL settings from the environment; see `resolvePgliteMaintenance`. */
1492
+ const vacuumFullTimingFromEnv = resolvePgliteMaintenance;
1505
1493
  /** Preloads the module's NodeFS so the returned factory can be synchronous. */
1506
1494
  async function loadDurableFsFactory(major, logger, proc) {
1507
1495
  const NodeFS = await loadNodeFsClass(major);
@@ -1842,7 +1830,7 @@ function readConfigWorkflowsEnabled(configPath) {
1842
1830
  }
1843
1831
  }
1844
1832
  async function resolveServerPort(requested, strictPort, logger) {
1845
- if (strictPort) return requested;
1833
+ if (requested === 0 || strictPort) return requested;
1846
1834
  for (let i = 0; i < PORT_FALLBACK_ATTEMPTS; i++) {
1847
1835
  const candidate = requested + i;
1848
1836
  if (await isPortAvailable(candidate)) {
@@ -1924,7 +1912,7 @@ function deriveAttachmentServiceConfig(options, serverPort, renown) {
1924
1912
  }) : void 0 : void 0
1925
1913
  };
1926
1914
  }
1927
- async function initServer(serverPort, options, renown, renownConfig) {
1915
+ async function initServer(requestedPort, options, renown, renownConfig) {
1928
1916
  const { dev, packages = [], remoteDrives = [], logger = defaultLogger } = options;
1929
1917
  const pluginHost = isPluginHostEnabled() ? createSwitchboardPluginHost({
1930
1918
  logger,
@@ -2122,6 +2110,10 @@ async function initServer(serverPort, options, renown, renownConfig) {
2122
2110
  reactorBuilder.withShutdownHook(async () => {
2123
2111
  if (apiRef.current) await apiRef.current.dispose();
2124
2112
  });
2113
+ const reactorDriveSchemaDb = baseKysely.withSchema(REACTOR_SCHEMA);
2114
+ const nodeView = new DriveNodeView(reactorDriveSchemaDb);
2115
+ driveNodeView = nodeView;
2116
+ clientBuilder.withDriveNodeSource(nodeView).withDriveWriteStrategy(REACTOR_DRIVE_DOCUMENT_TYPE, createReactorDriveWriteStrategy);
2125
2117
  let module;
2126
2118
  try {
2127
2119
  module = await clientBuilder.buildModule();
@@ -2138,12 +2130,10 @@ async function initServer(serverPort, options, renown, renownConfig) {
2138
2130
  new ReactorInstrumentation(module.reactorModule).start();
2139
2131
  reactorLogger.info("Reactor metrics instrumentation started");
2140
2132
  }
2141
- const reactorDriveSchemaDb = baseKysely.withSchema(REACTOR_SCHEMA);
2142
- driveNodeView = new DriveNodeView(reactorDriveSchemaDb);
2143
2133
  const reactorDriveClient = new ReactorDriveClient({
2144
2134
  read: module.read,
2145
2135
  write: module.write,
2146
- readModel: driveNodeView
2136
+ readModel: nodeView
2147
2137
  });
2148
2138
  ownedReactorModule = module;
2149
2139
  if (options.fatalErrorShutdown) installFatalErrorShutdown(logger);
@@ -2162,6 +2152,7 @@ async function initServer(serverPort, options, renown, renownConfig) {
2162
2152
  return {
2163
2153
  module,
2164
2154
  reactorDriveClient,
2155
+ driveNodes: nodeView,
2165
2156
  attachmentReferenceProjection: { status: "available" },
2166
2157
  permissionsDb
2167
2158
  };
@@ -2234,7 +2225,7 @@ async function initServer(serverPort, options, renown, renownConfig) {
2234
2225
  pgliteFactory = (connectionString) => openReadStore(connectionString ?? readModelPgliteDir);
2235
2226
  }
2236
2227
  const api = await initializeAndStartAPI(initializeClient, {
2237
- port: serverPort,
2228
+ port: requestedPort,
2238
2229
  dbPath: readModelPath,
2239
2230
  pgliteFactory,
2240
2231
  https: options.https,
@@ -2252,6 +2243,7 @@ async function initServer(serverPort, options, renown, renownConfig) {
2252
2243
  verifyCredential
2253
2244
  }, "switchboard");
2254
2245
  apiRef.current = api;
2246
+ const serverPort = api.port;
2255
2247
  if (renownConfig.source === "self") {
2256
2248
  const { graphqlManager: manager } = api;
2257
2249
  if (!manager.hasSubgraphHandler(RENOWN_READ_MODEL_SUBGRAPH)) {
@@ -2625,5 +2617,5 @@ function feedCatchUpPriority(priority, server) {
2625
2617
  //#endregion
2626
2618
  export { startSwitchboard as a, attachmentsPlugin as c, initProfilerFromEnv as d, parseForcePgVersion as f, resolvePgliteStorageDirs as i, attachmentsPluginConfigSchema as l, deriveAttachmentServiceConfig as n, StoredDocumentsRefusedError as o, isPortAvailable as r, resolveUnsupportedStoredDocuments as s, createReactorKysely as t, applySwitchboardReactorDefaults as u };
2627
2619
 
2628
- //# sourceMappingURL=server-BkL_NyGG.mjs.map
2629
- //# debugId=71696ff5-99ce-5369-9bed-524565c3481d
2620
+ //# sourceMappingURL=server-Bdq8xquD.mjs.map
2621
+ //# debugId=ca62b433-fc4f-5ba3-9edb-8b3b8985f35a