@powerhousedao/switchboard 6.2.3-dev.64 → 6.2.3-dev.65
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/pglite-storage-dirs.test.d.ts +2 -0
- package/.tsbuild/test/pglite-storage-dirs.test.d.ts.map +1 -0
- package/.tsbuild/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +24 -1
- package/dist/index.mjs +1 -1
- package/dist/plugins/attachments.mjs +3 -3
- package/dist/{server-C9RQTWTA.mjs → server-CYkOmpxa.mjs} +41 -10
- package/dist/{server-C9RQTWTA.mjs.map → server-CYkOmpxa.mjs.map} +1 -1
- package/dist/server.d.mts +32 -0
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +4 -4
- package/package.json +17 -17
- package/test/pglite-storage-dirs.test.ts +103 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
## 6.2.3-dev.
|
|
1
|
+
## 6.2.3-dev.65 (2026-10-20)
|
|
2
2
|
|
|
3
3
|
This was a version bump only for @powerhousedao/switchboard to align it with other projects, there were no code changes.
|
|
4
4
|
|
|
5
|
+
## 6.2.3-dev.64 (2026-10-20)
|
|
6
|
+
|
|
7
|
+
### 🚀 Features
|
|
8
|
+
|
|
9
|
+
- **shared,switchboard,ph-cli,host-core,reactor-api:** one .ph root, user data under PH_USER_DATA_DIR (A3, A4b) ([19d53aeb36](https://github.com/powerhouse-inc/powerhouse/commit/19d53aeb36))
|
|
10
|
+
|
|
11
|
+
### 🩹 Fixes
|
|
12
|
+
|
|
13
|
+
- **reactor-api:** complete a removed subgraph's supergraph SSE streams ([9eac161e3c](https://github.com/powerhouse-inc/powerhouse/commit/9eac161e3c))
|
|
14
|
+
- **reactor-api:** complete a replaced or removed subgraph's SSE streams ([2cacef8d1d](https://github.com/powerhouse-inc/powerhouse/commit/2cacef8d1d))
|
|
15
|
+
- **releases:** parse pnpm publish output when packed paths contain braces ([a30562aeca](https://github.com/powerhouse-inc/powerhouse/commit/a30562aeca))
|
|
16
|
+
|
|
17
|
+
### 🔥 Performance
|
|
18
|
+
|
|
19
|
+
- **ph-cli,docker:** serve precompressed wasm and data in connect preview and nginx ([85db6ff307](https://github.com/powerhouse-inc/powerhouse/commit/85db6ff307))
|
|
20
|
+
|
|
21
|
+
### ❤️ Thank You
|
|
22
|
+
|
|
23
|
+
- acaldas
|
|
24
|
+
- Benjamin Jordan
|
|
25
|
+
- Claude Opus 5.5
|
|
26
|
+
- Wouter Kampmann
|
|
27
|
+
|
|
5
28
|
## 6.2.3-dev.63 (2026-10-18)
|
|
6
29
|
|
|
7
30
|
### 🚀 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]="c9eef974-47b1-5e45-aad6-5ebb1885b76a")}catch(e){}}();
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as startSwitchboard, d as parseForcePgVersion, o as StoredDocumentsRefusedError, u as initProfilerFromEnv } from "./server-CYkOmpxa.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 {
|
|
1
|
+
import { c as attachmentsPlugin } from "../server-CYkOmpxa.mjs";
|
|
2
2
|
export { attachmentsPlugin, attachmentsPlugin as default };
|
|
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]="
|
|
4
|
-
//# debugId=
|
|
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]="5b0a09a8-7777-57c2-a0d0-9c722bbb3178")}catch(e){}}();
|
|
4
|
+
//# debugId=5b0a09a8-7777-57c2-a0d0-9c722bbb3178
|
|
@@ -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]="66d04e41-6128-57fa-b59b-1811237f2169")}catch(e){}}();
|
|
3
3
|
import { a as composeWorkflowRuntime, c as resolveWorkflowsEnabled, d as installFatalErrorShutdown, f as triggerFatalShutdown, i as assertWorkflowPackageLoadable, l as retryWorkflowSingleton, n as WORKFLOW_PACKAGE_NAME, o as isWorkflowSingletonConflict, r as WORKFLOW_TELEMETRY_SCOPE, s as modelManifestSource, t as workflowsPlugin, u as workflowSingletonLossHandler } from "./workflows-qKtqZhn3.mjs";
|
|
4
4
|
import { n as resolvePrivacy, r as startPrivacy, t as privacyPlugin } from "./privacy-C8KVimKF.mjs";
|
|
5
5
|
import { t as mcpPlugin } from "./mcp-cNWW82NH.mjs";
|
|
@@ -34,6 +34,7 @@ import os from "node:os";
|
|
|
34
34
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
35
35
|
import { EnvVarProvider } from "@openfeature/env-var-provider";
|
|
36
36
|
import { OpenFeature } from "@openfeature/server-sdk";
|
|
37
|
+
import { defaultStoreDirs, resolvePhDir } from "@powerhousedao/shared/clis/ph-dir";
|
|
37
38
|
//#region src/pglite-version.ts
|
|
38
39
|
const SUPPORTED_PG_MAJORS = [16, 17];
|
|
39
40
|
async function readPgVersionFile(dataDir) {
|
|
@@ -1816,6 +1817,34 @@ async function createReactorKysely(opts) {
|
|
|
1816
1817
|
storageFacts: inMemory ? IN_MEMORY_PGLITE_STORAGE_FACTS : PGLITE_PATH_STORAGE_FACTS
|
|
1817
1818
|
};
|
|
1818
1819
|
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Where the two stores live — the classic resolution, relocated verbatim.
|
|
1822
|
+
* Classic layout: `./.ph/reactor-storage` for the reactor and
|
|
1823
|
+
* `.ph/read-storage` for the read model (the same names inside
|
|
1824
|
+
* `${userData}/.ph` under a shell's PH_USER_DATA_DIR). `dbPath` also names
|
|
1825
|
+
* the reactor store unless PH_REACTOR_DATABASE_URL does: with `dbPath` alone
|
|
1826
|
+
* both stores share one location. That is the long-standing contract of
|
|
1827
|
+
* `--db-path` and fine for one Postgres database, but for PGlite it is two
|
|
1828
|
+
* postmasters on one data dir — reported via `sharedPgliteDir` so the caller
|
|
1829
|
+
* warns. Not refused: changing that contract is a separate decision.
|
|
1830
|
+
*/
|
|
1831
|
+
function resolvePgliteStorageDirs(opts) {
|
|
1832
|
+
const { dbPath, reactorDbUrl, callerReactor } = opts;
|
|
1833
|
+
const defaults = defaultStoreDirs(process.env, opts.phDir);
|
|
1834
|
+
const readModelPath = dbPath || defaults.readModel;
|
|
1835
|
+
const reactorPath = reactorDbUrl || defaults.reactor;
|
|
1836
|
+
const reactorPgliteDir = callerReactor ? null : !reactorDbUrl || !isPostgresUrl(reactorDbUrl) ? reactorPath : null;
|
|
1837
|
+
const readModelPgliteDir = !dbPath || !isPostgresUrl(dbPath) ? readModelPath : null;
|
|
1838
|
+
const sharedPgliteDir = reactorPgliteDir !== null && readModelPgliteDir !== null && path$1.resolve(reactorPgliteDir) === path$1.resolve(readModelPgliteDir) ? path$1.resolve(reactorPgliteDir) : null;
|
|
1839
|
+
return {
|
|
1840
|
+
readModelPath,
|
|
1841
|
+
reactorPath,
|
|
1842
|
+
reactorPgliteDir,
|
|
1843
|
+
readModelPgliteDir,
|
|
1844
|
+
pgliteDirs: [reactorPgliteDir, readModelPgliteDir].filter((d) => d !== null),
|
|
1845
|
+
sharedPgliteDir
|
|
1846
|
+
};
|
|
1847
|
+
}
|
|
1819
1848
|
/** Derive the remote attachment service config for switchboard's own `/attachments/*` API. */
|
|
1820
1849
|
function deriveAttachmentServiceConfig(options, serverPort, renown) {
|
|
1821
1850
|
const protocol = options.https ? "https" : "http";
|
|
@@ -1841,12 +1870,13 @@ async function initServer(serverPort, options, renown, renownConfig) {
|
|
|
1841
1870
|
}
|
|
1842
1871
|
logger.level = LogLevel;
|
|
1843
1872
|
const dbPath = options.dbPath ?? process.env.DATABASE_URL ?? process.env.PH_SWITCHBOARD_DATABASE_URL;
|
|
1844
|
-
const readModelPath = dbPath || ".ph/read-storage";
|
|
1845
1873
|
const reactorDbUrl = options.dbPath ?? process.env.PH_REACTOR_DATABASE_URL ?? process.env.PH_SWITCHBOARD_DATABASE_URL;
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1874
|
+
const { readModelPath, reactorPgliteDir, readModelPgliteDir, pgliteDirs, sharedPgliteDir } = resolvePgliteStorageDirs({
|
|
1875
|
+
dbPath,
|
|
1876
|
+
reactorDbUrl,
|
|
1877
|
+
callerReactor: options.reactor !== void 0
|
|
1878
|
+
});
|
|
1879
|
+
if (sharedPgliteDir !== null) logger.warn(`The reactor and read-model PGlite stores share one directory (${sharedPgliteDir}): two PGlite instances on one data dir can abort at the first checkpoint and leave the store unopenable. Set PH_REACTOR_DATABASE_URL to a separate directory, or leave dbPath unset for the classic ./.ph/reactor-storage + .ph/read-storage layout.`);
|
|
1850
1880
|
warnIgnoredFlushInterval(logger);
|
|
1851
1881
|
const detectedMajors = await runPglitePreflight({
|
|
1852
1882
|
dirs: pgliteDirs,
|
|
@@ -2433,7 +2463,8 @@ const startSwitchboard = async (options = {}) => {
|
|
|
2433
2463
|
const renownConfig = resolveRenownConfig(getConfig(resolveConfigPath(options.configFile)).auth?.renown, process.env, logger);
|
|
2434
2464
|
options.identity = {
|
|
2435
2465
|
...options.identity,
|
|
2436
|
-
baseUrl: options.identity?.baseUrl ?? renownConfig.url
|
|
2466
|
+
baseUrl: options.identity?.baseUrl ?? renownConfig.url,
|
|
2467
|
+
keypairPath: options.identity?.keypairPath ?? (process.env.PH_USER_DATA_DIR ? path$1.join(resolvePhDir(), ".keypair.json") : void 0)
|
|
2437
2468
|
};
|
|
2438
2469
|
logger.info("Feature flags: @flags", JSON.stringify({
|
|
2439
2470
|
DOCUMENT_MODEL_SUBGRAPHS_ENABLED: enableDocumentModelSubgraphs,
|
|
@@ -2459,7 +2490,7 @@ const startSwitchboard = async (options = {}) => {
|
|
|
2459
2490
|
};
|
|
2460
2491
|
if (import.meta.main) await startSwitchboard({ fatalErrorShutdown: true });
|
|
2461
2492
|
//#endregion
|
|
2462
|
-
export {
|
|
2493
|
+
export { startSwitchboard as a, attachmentsPlugin as c, parseForcePgVersion as d, resolvePgliteStorageDirs as i, applySwitchboardReactorDefaults as l, deriveAttachmentServiceConfig as n, StoredDocumentsRefusedError as o, isPortAvailable as r, resolveUnsupportedStoredDocuments as s, createReactorKysely as t, initProfilerFromEnv as u };
|
|
2463
2494
|
|
|
2464
|
-
//# sourceMappingURL=server-
|
|
2465
|
-
//# debugId=
|
|
2495
|
+
//# sourceMappingURL=server-CYkOmpxa.mjs.map
|
|
2496
|
+
//# debugId=66d04e41-6128-57fa-b59b-1811237f2169
|