@powerhousedao/switchboard 6.2.3-dev.10 → 6.2.3-dev.100
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/ai-gateway.test.d.ts +2 -0
- package/.tsbuild/test/ai-gateway.test.d.ts.map +1 -0
- package/.tsbuild/test/attachments/byte-grants.test.d.ts +2 -0
- package/.tsbuild/test/attachments/byte-grants.test.d.ts.map +1 -0
- package/.tsbuild/test/attachments/byte-routes-read-gate.integration.test.d.ts +2 -0
- package/.tsbuild/test/attachments/byte-routes-read-gate.integration.test.d.ts.map +1 -0
- package/.tsbuild/test/attachments/reserve-metadata-parity.test.d.ts +2 -0
- package/.tsbuild/test/attachments/reserve-metadata-parity.test.d.ts.map +1 -0
- package/.tsbuild/test/attachments/url-signer.test.d.ts +2 -0
- package/.tsbuild/test/attachments/url-signer.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-auth-config.test.d.ts +2 -0
- package/.tsbuild/test/boot-auth-config.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-create-signature-policy.test.d.ts +2 -0
- package/.tsbuild/test/boot-create-signature-policy.test.d.ts.map +1 -0
- 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/boot-env-isolation.test.d.ts +2 -0
- package/.tsbuild/test/boot-env-isolation.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-helpers.d.ts +5 -0
- package/.tsbuild/test/boot-helpers.d.ts.map +1 -0
- package/.tsbuild/test/boot-inspection-enabled.test.d.ts +2 -0
- package/.tsbuild/test/boot-inspection-enabled.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-mcp-auth.test.d.ts +2 -0
- package/.tsbuild/test/boot-mcp-auth.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-mcp-enabled.test.d.ts +2 -0
- package/.tsbuild/test/boot-mcp-enabled.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-port-zero.test.d.ts +2 -0
- package/.tsbuild/test/boot-port-zero.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-preconditions.test.d.ts +2 -0
- package/.tsbuild/test/boot-preconditions.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-privacy.test.d.ts +2 -0
- package/.tsbuild/test/boot-privacy.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-ready-drives.test.d.ts +2 -0
- package/.tsbuild/test/boot-ready-drives.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-undo-v3-flag.test.d.ts +2 -0
- package/.tsbuild/test/boot-undo-v3-flag.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-unsupported-stored-documents.test.d.ts +2 -0
- package/.tsbuild/test/boot-unsupported-stored-documents.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-without-renown.test.d.ts +2 -0
- package/.tsbuild/test/boot-without-renown.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-without-require-signatures.test.d.ts +2 -0
- package/.tsbuild/test/boot-without-require-signatures.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-worker-trust-policy.test.d.ts +2 -0
- package/.tsbuild/test/boot-worker-trust-policy.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-workflow-singleton-conflict.test.d.ts +2 -0
- package/.tsbuild/test/boot-workflow-singleton-conflict.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-workflow-singleton-retry.test.d.ts +2 -0
- package/.tsbuild/test/boot-workflow-singleton-retry.test.d.ts.map +1 -0
- package/.tsbuild/test/builder-defaults.test.d.ts +2 -0
- package/.tsbuild/test/builder-defaults.test.d.ts.map +1 -0
- package/.tsbuild/test/config-from-env.test.d.ts +2 -0
- package/.tsbuild/test/config-from-env.test.d.ts.map +1 -0
- package/.tsbuild/test/config-merge.test.d.ts +2 -0
- package/.tsbuild/test/config-merge.test.d.ts.map +1 -0
- package/.tsbuild/test/config-schema.test.d.ts +2 -0
- package/.tsbuild/test/config-schema.test.d.ts.map +1 -0
- package/.tsbuild/test/create-signature-policy.test.d.ts +2 -0
- package/.tsbuild/test/create-signature-policy.test.d.ts.map +1 -0
- package/.tsbuild/test/default-drive-protocol-versions.test.d.ts +2 -0
- package/.tsbuild/test/default-drive-protocol-versions.test.d.ts.map +1 -0
- package/.tsbuild/test/default-drive-slug.test.d.ts +2 -0
- package/.tsbuild/test/default-drive-slug.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/test/durable-node-fs-pg16.test.d.ts +2 -0
- package/.tsbuild/test/durable-node-fs-pg16.test.d.ts.map +1 -0
- package/.tsbuild/test/fatal-shutdown.test.d.ts +2 -0
- package/.tsbuild/test/fatal-shutdown.test.d.ts.map +1 -0
- package/.tsbuild/test/inspection-throttle.test.d.ts +2 -0
- package/.tsbuild/test/inspection-throttle.test.d.ts.map +1 -0
- package/.tsbuild/test/keyframe-reclaim-store.test.d.ts +2 -0
- package/.tsbuild/test/keyframe-reclaim-store.test.d.ts.map +1 -0
- package/.tsbuild/test/observability-signals.test.d.ts +2 -0
- package/.tsbuild/test/observability-signals.test.d.ts.map +1 -0
- package/.tsbuild/test/permissions-backfill.test.d.ts +2 -0
- package/.tsbuild/test/permissions-backfill.test.d.ts.map +1 -0
- package/.tsbuild/test/pglite-preflight.test.d.ts +2 -0
- package/.tsbuild/test/pglite-preflight.test.d.ts.map +1 -0
- 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/test/pglite-store.test.d.ts +2 -0
- package/.tsbuild/test/pglite-store.test.d.ts.map +1 -0
- package/.tsbuild/test/plugin-config-schemas.test.d.ts +2 -0
- package/.tsbuild/test/plugin-config-schemas.test.d.ts.map +1 -0
- package/.tsbuild/test/plugin-presence.test.d.ts +2 -0
- package/.tsbuild/test/plugin-presence.test.d.ts.map +1 -0
- package/.tsbuild/test/port-probe.test.d.ts +2 -0
- package/.tsbuild/test/port-probe.test.d.ts.map +1 -0
- package/.tsbuild/test/processor-timing-log.test.d.ts +2 -0
- package/.tsbuild/test/processor-timing-log.test.d.ts.map +1 -0
- package/.tsbuild/test/renown-storage-path.test.d.ts +2 -0
- package/.tsbuild/test/renown-storage-path.test.d.ts.map +1 -0
- package/.tsbuild/test/renown-trust-policy.test.d.ts +2 -0
- package/.tsbuild/test/renown-trust-policy.test.d.ts.map +1 -0
- package/.tsbuild/test/served-schemas.test.d.ts +2 -0
- package/.tsbuild/test/served-schemas.test.d.ts.map +1 -0
- package/.tsbuild/test/shutdown.test.d.ts +2 -0
- package/.tsbuild/test/shutdown.test.d.ts.map +1 -0
- package/.tsbuild/test/snapshot-writer.d.ts +18 -0
- package/.tsbuild/test/snapshot-writer.d.ts.map +1 -0
- package/.tsbuild/test/store-lock.test.d.ts +2 -0
- package/.tsbuild/test/store-lock.test.d.ts.map +1 -0
- package/.tsbuild/test/two-switchboards.test.d.ts +2 -0
- package/.tsbuild/test/two-switchboards.test.d.ts.map +1 -0
- package/.tsbuild/test/unsupported-stored-documents.test.d.ts +2 -0
- package/.tsbuild/test/unsupported-stored-documents.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/harness.d.ts +56 -0
- package/.tsbuild/test/workflow/harness.d.ts.map +1 -0
- package/.tsbuild/test/workflow/oauth-apps-config.test.d.ts +2 -0
- package/.tsbuild/test/workflow/oauth-apps-config.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/oauth.test.d.ts +2 -0
- package/.tsbuild/test/workflow/oauth.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/resolvers.test.d.ts +2 -0
- package/.tsbuild/test/workflow/resolvers.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/runtime-host.test.d.ts +2 -0
- package/.tsbuild/test/workflow/runtime-host.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/waitpoint-routes.test.d.ts +2 -0
- package/.tsbuild/test/workflow/waitpoint-routes.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/waitpoint-runtime.test.d.ts +2 -0
- package/.tsbuild/test/workflow/waitpoint-runtime.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-dedupe.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-dedupe.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-signed.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-signed.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-trigger-test.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-trigger-test.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-unsigned.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-unsigned.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow-reactor-access.test.d.ts +2 -0
- package/.tsbuild/test/workflow-reactor-access.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow-reactor-enforcement.test.d.ts +2 -0
- package/.tsbuild/test/workflow-reactor-enforcement.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow-read-gate.test.d.ts +2 -0
- package/.tsbuild/test/workflow-read-gate.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow-runtime.test.d.ts +2 -0
- package/.tsbuild/test/workflow-runtime.test.d.ts.map +1 -0
- package/.tsbuild/test/workflows-plugin-config.test.d.ts +2 -0
- package/.tsbuild/test/workflows-plugin-config.test.d.ts.map +1 -0
- package/.tsbuild/tsconfig.tsbuildinfo +1 -1
- package/.tsbuild/tsdown.config.d.ts.map +1 -1
- package/.tsbuild/vitest.config.d.ts.map +1 -1
- package/Auth.md +144 -2
- package/CHANGELOG.md +1284 -0
- package/README.md +102 -22
- package/dist/boot.d.mts +46 -0
- package/dist/boot.d.mts.map +1 -0
- package/dist/boot.mjs +67 -0
- package/dist/boot.mjs.map +1 -0
- package/dist/config/from-env.d.mts +15 -0
- package/dist/config/from-env.d.mts.map +1 -0
- package/dist/config/from-env.mjs +4 -0
- package/dist/config/schema.d.mts +3 -0
- package/dist/config/schema.mjs +4 -0
- package/dist/from-env-FH4fPeIE.mjs +481 -0
- package/dist/from-env-FH4fPeIE.mjs.map +1 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +84 -84
- package/dist/index.mjs.map +1 -1
- package/dist/install-packages.d.mts +2 -1
- package/dist/install-packages.mjs +2 -2
- package/dist/install-packages.mjs.map +1 -1
- package/dist/mcp-SsBK14Jm.mjs +32 -0
- package/dist/mcp-SsBK14Jm.mjs.map +1 -0
- package/dist/migrate.d.mts +2 -1
- package/dist/migrate.mjs +7 -5
- package/dist/migrate.mjs.map +1 -1
- package/dist/plugin-host-CK9_tVak.d.mts +46 -0
- package/dist/plugin-host-CK9_tVak.d.mts.map +1 -0
- package/dist/plugins/ai.d.mts +37 -0
- package/dist/plugins/ai.d.mts.map +1 -0
- package/dist/plugins/ai.mjs +400 -0
- package/dist/plugins/ai.mjs.map +1 -0
- package/dist/plugins/attachments.d.mts +33 -0
- package/dist/plugins/attachments.d.mts.map +1 -0
- package/dist/plugins/attachments.mjs +4 -0
- package/dist/plugins/mcp.d.mts +31 -0
- package/dist/plugins/mcp.d.mts.map +1 -0
- package/dist/plugins/mcp.mjs +4 -0
- package/dist/plugins/privacy.d.mts +22 -0
- package/dist/plugins/privacy.d.mts.map +1 -0
- package/dist/plugins/privacy.mjs +4 -0
- package/dist/plugins/workflows.d.mts +79 -0
- package/dist/plugins/workflows.d.mts.map +1 -0
- package/dist/plugins/workflows.mjs +4 -0
- package/dist/postgres-url-DTDhBjXX.mjs +11 -0
- package/dist/postgres-url-DTDhBjXX.mjs.map +1 -0
- package/dist/privacy-BO8Q25xI.mjs +44 -0
- package/dist/privacy-BO8Q25xI.mjs.map +1 -0
- package/dist/privacy-DxIJGH4P.mjs +91 -0
- package/dist/privacy-DxIJGH4P.mjs.map +1 -0
- package/dist/renown-layers-DmbWLt46.mjs +42 -0
- package/dist/renown-layers-DmbWLt46.mjs.map +1 -0
- package/dist/schema-CsY8bjsu.mjs +329 -0
- package/dist/schema-CsY8bjsu.mjs.map +1 -0
- package/dist/schema-MAUTnmj1.d.mts +251 -0
- package/dist/schema-MAUTnmj1.d.mts.map +1 -0
- package/dist/server-CirQ9hyu.mjs +2732 -0
- package/dist/server-CirQ9hyu.mjs.map +1 -0
- package/dist/server.d.mts +129 -189
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +5 -5
- package/dist/types-CidZdkhU.d.mts +314 -0
- package/dist/types-CidZdkhU.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 +30 -5
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs +5 -4
- package/dist/worker-pool-gyxJnCxA.mjs +304 -0
- package/dist/worker-pool-gyxJnCxA.mjs.map +1 -0
- package/dist/workflow-runtime-CF5pc8mt.d.mts +33 -0
- package/dist/workflow-runtime-CF5pc8mt.d.mts.map +1 -0
- package/dist/workflows-C9BQlyT0.mjs +1943 -0
- package/dist/workflows-C9BQlyT0.mjs.map +1 -0
- package/package.json +85 -24
- package/scripts/install-packages.sh +0 -0
- package/test/ai-gateway.test.ts +612 -0
- package/test/attachment-reference-read-model.test.ts +28 -20
- package/test/attachments/auth.test.ts +85 -0
- package/test/attachments/byte-grants.test.ts +290 -0
- package/test/attachments/byte-routes-read-gate.integration.test.ts +314 -0
- package/test/attachments/download-target.test.ts +211 -32
- package/test/attachments/index.test.ts +47 -4
- package/test/attachments/reserve-metadata-parity.test.ts +96 -0
- package/test/attachments/routes-integration.test.ts +60 -4
- package/test/attachments/routes.test.ts +297 -35
- package/test/attachments/service-config.test.ts +41 -19
- package/test/attachments/url-signer.test.ts +105 -0
- package/test/boot-auth-config.test.ts +109 -0
- package/test/boot-create-signature-policy.test.ts +110 -0
- package/test/boot-desktop-auth.test.ts +278 -0
- package/test/boot-env-isolation.test.ts +26 -0
- package/test/boot-helpers.ts +19 -0
- package/test/boot-inspection-enabled.test.ts +140 -0
- package/test/boot-mcp-auth.test.ts +449 -0
- package/test/boot-mcp-enabled.test.ts +119 -0
- package/test/boot-port-zero.test.ts +101 -0
- package/test/boot-preconditions.test.ts +213 -0
- package/test/boot-privacy.test.ts +232 -0
- package/test/boot-ready-drives.test.ts +141 -0
- package/test/boot-undo-v3-flag.test.ts +120 -0
- package/test/boot-unsupported-stored-documents.test.ts +214 -0
- package/test/boot-without-renown.test.ts +83 -0
- package/test/boot-without-require-signatures.test.ts +76 -0
- package/test/boot-worker-trust-policy.test.ts +91 -0
- package/test/boot-workflow-singleton-conflict.test.ts +109 -0
- package/test/boot-workflow-singleton-retry.test.ts +122 -0
- package/test/builder-defaults.test.ts +80 -0
- package/test/config-from-env.test.ts +963 -0
- package/test/config-merge.test.ts +248 -0
- package/test/config-schema.test.ts +167 -0
- package/test/create-signature-policy.test.ts +69 -0
- package/test/default-drive-protocol-versions.test.ts +79 -0
- package/test/default-drive-slug.test.ts +265 -0
- package/test/delegated-publish.test.ts +435 -0
- package/test/durable-node-fs-pg16.test.ts +80 -0
- package/test/fatal-shutdown.test.ts +205 -0
- package/test/goldens/packages.graphql +797 -0
- package/test/goldens/privacy.graphql +853 -0
- package/test/goldens/reactor-drive-nodes.graphql +827 -0
- package/test/goldens/resolvers.json +327 -0
- package/test/goldens/supergraph.graphql +5918 -0
- package/test/goldens/workflow-runtime.graphql +1548 -0
- package/test/inspection-throttle.test.ts +23 -0
- package/test/keyframe-reclaim-store.test.ts +156 -0
- package/test/observability-signals.test.ts +131 -0
- package/test/permissions-backfill.test.ts +486 -0
- package/test/pglite-dialect.test.ts +237 -2
- package/test/pglite-preflight.test.ts +313 -0
- package/test/pglite-storage-dirs.test.ts +113 -0
- package/test/pglite-store.test.ts +441 -0
- package/test/pglite-version.test.ts +9 -1
- package/test/plugin-config-schemas.test.ts +83 -0
- package/test/plugin-presence.test.ts +262 -0
- package/test/port-probe.test.ts +45 -0
- package/test/processor-timing-log.test.ts +109 -0
- package/test/reactor-feature-flags.test.ts +20 -0
- package/test/redact-webhook-path.test.ts +9 -0
- package/test/renown-storage-path.test.ts +40 -0
- package/test/renown-trust-policy.test.ts +313 -0
- package/test/served-schemas.test.ts +134 -0
- package/test/shutdown.test.ts +278 -0
- package/test/snapshot-writer.ts +94 -0
- package/test/store-lock.test.ts +65 -0
- package/test/two-switchboards.test.ts +146 -0
- package/test/unsupported-stored-documents.test.ts +72 -0
- package/test/worker-pool.test.ts +27 -1
- package/test/workflow/harness.ts +289 -0
- package/test/workflow/oauth-apps-config.test.ts +66 -0
- package/test/workflow/oauth.test.ts +286 -0
- package/test/workflow/resolvers.test.ts +488 -0
- package/test/workflow/runtime-host.test.ts +19 -0
- package/test/workflow/waitpoint-routes.test.ts +306 -0
- package/test/workflow/waitpoint-runtime.test.ts +204 -0
- package/test/workflow/webhook-dedupe.test.ts +295 -0
- package/test/workflow/webhook-signed.test.ts +509 -0
- package/test/workflow/webhook-trigger-test.test.ts +82 -0
- package/test/workflow/webhook-unsigned.test.ts +345 -0
- package/test/workflow-reactor-access.test.ts +384 -0
- package/test/workflow-reactor-enforcement.test.ts +808 -0
- package/test/workflow-read-gate.test.ts +213 -0
- package/test/workflow-runtime.test.ts +1254 -0
- package/test/workflows-plugin-config.test.ts +77 -0
- package/tsconfig.json +11 -2
- package/tsdown.config.ts +13 -1
- package/vitest.config.ts +65 -0
- package/dist/server-CiKkVE6g.mjs +0 -1555
- package/dist/server-CiKkVE6g.mjs.map +0 -1
- package/dist/utils-Baw7rThP.mjs +0 -80
- package/dist/utils-Baw7rThP.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -100,16 +100,20 @@ pnpm add -g @powerhousedao/switchboard
|
|
|
100
100
|
|
|
101
101
|
### Environment Variables
|
|
102
102
|
|
|
103
|
-
| Variable
|
|
104
|
-
|
|
|
105
|
-
| `PORT`
|
|
106
|
-
| `DATABASE_URL`
|
|
107
|
-
| `PH_REACTOR_DATABASE_URL`
|
|
108
|
-
| `REACTOR_DB_POOL_SIZE_HOST`
|
|
109
|
-
| `REDIS_URL`
|
|
110
|
-
| `REDIS_TLS_URL`
|
|
111
|
-
| `PYROSCOPE_SERVER_ADDRESS`
|
|
112
|
-
| `FEATURE_REACTORV2_ENABLED`
|
|
103
|
+
| Variable | Description | Default |
|
|
104
|
+
| -------------------------------- | ------------------------------------------------------------------------------ | --------------------- |
|
|
105
|
+
| `PORT` | Server port | `4001` |
|
|
106
|
+
| `DATABASE_URL` | Database connection string | `./.ph/drive-storage` |
|
|
107
|
+
| `PH_REACTOR_DATABASE_URL` | PostgreSQL URL (takes precedence) | - |
|
|
108
|
+
| `REACTOR_DB_POOL_SIZE_HOST` | Reactor host Postgres pool size | `16` |
|
|
109
|
+
| `REDIS_URL` | Redis connection URL | - |
|
|
110
|
+
| `REDIS_TLS_URL` | Redis TLS connection URL | - |
|
|
111
|
+
| `PYROSCOPE_SERVER_ADDRESS` | Pyroscope server address | - |
|
|
112
|
+
| `FEATURE_REACTORV2_ENABLED` | Enable Reactor v2 subgraph feature | `false` |
|
|
113
|
+
| `MCP_ENABLED` | `false` keeps `/mcp` unmounted | `true` |
|
|
114
|
+
| `INSPECTION_ENABLED` | `false` keeps inspection unmounted | `true` |
|
|
115
|
+
| `PH_INSPECTION_CALLS_PER_MINUTE` | `validateDocument`/`driveIntegrity` calls per caller per minute; admins exempt | `6` |
|
|
116
|
+
| `PH_HOST_VALIDATION` | `refuse` leaves out a model host validation flags; `log` serves it | `log` |
|
|
113
117
|
|
|
114
118
|
See [Observability](#observability) below for Sentry and OpenTelemetry variables.
|
|
115
119
|
|
|
@@ -158,8 +162,11 @@ ph switchboard
|
|
|
158
162
|
```
|
|
159
163
|
|
|
160
164
|
The same settings are available programmatically via
|
|
161
|
-
`startSwitchboard({
|
|
162
|
-
|
|
165
|
+
`startSwitchboard({ workers: { executor: { count, poolSize, acquireTimeoutMs } } })`.
|
|
166
|
+
`startSwitchboard` reads only its config: map the environment with
|
|
167
|
+
`switchboardConfigFromEnv` (`@powerhousedao/switchboard/config/env`) and lay
|
|
168
|
+
your own layer over it with `callerOverEnv` (`@powerhousedao/switchboard/config`)
|
|
169
|
+
to keep the environment variables working.
|
|
163
170
|
|
|
164
171
|
### Projection Worker
|
|
165
172
|
|
|
@@ -184,9 +191,43 @@ initialize at all — an unreachable database, an exhausted pooler, an
|
|
|
184
191
|
unmigrated schema — boot fails immediately with the worker's own error and
|
|
185
192
|
exits non-zero instead of waiting out the init timeout.
|
|
186
193
|
|
|
187
|
-
Programmatically: `startSwitchboard({
|
|
194
|
+
Programmatically: `startSwitchboard({ workers: { projection: { enabled, poolSize } } })`.
|
|
188
195
|
|
|
189
|
-
###
|
|
196
|
+
### Creation Signature Policy
|
|
197
|
+
|
|
198
|
+
| Variable | Description | Default |
|
|
199
|
+
| ------------------------- | ------------------------------------------------------------ | ------------- |
|
|
200
|
+
| `CREATE_SIGNATURE_POLICY` | What new documents are created as: `legacy` or `v2-required` | `v2-required` |
|
|
201
|
+
|
|
202
|
+
A v2-required document accepts only v2 action signatures and takes a
|
|
203
|
+
content-addressed id. Set `legacy` while any reactor that syncs with this one
|
|
204
|
+
predates v2-required documents. It only decides what new documents are born
|
|
205
|
+
as; existing documents keep their policy, and it does not change what the
|
|
206
|
+
switchboard accepts. Without a Renown identity the switchboard has no signer,
|
|
207
|
+
so it creates legacy documents and logs a warning. A default drive configured
|
|
208
|
+
with a fixed `id` is always created legacy.
|
|
209
|
+
|
|
210
|
+
### Stored Documents This Build Does Not Run
|
|
211
|
+
|
|
212
|
+
| Variable | Description | Default |
|
|
213
|
+
| -------------------------------------- | -------------------------------------------------------------------------------------- | -------- |
|
|
214
|
+
| `REACTOR_UNSUPPORTED_STORED_DOCUMENTS` | Stored documents at protocol versions this build does not run: `refuse` or `read-only` | `refuse` |
|
|
215
|
+
|
|
216
|
+
Before it starts, the reactor reads the protocol versions its stored documents
|
|
217
|
+
were created with. If this build does not run one of them, for example after a
|
|
218
|
+
rollback, switchboard logs this and exits with code 1:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
Refusing to start: 12 stored document(s) require base-reducer 3, which this switchboard does not run. Either start a switchboard build that runs base-reducer 3, or set REACTOR_UNSUPPORTED_STORED_DOCUMENTS=read-only to start with those documents read-only.
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
With `read-only` it starts and logs a warning. Every write into those documents
|
|
225
|
+
and every operation received for them is refused; the rest of the store works
|
|
226
|
+
as usual. The check runs once on the host, so it covers the executor worker
|
|
227
|
+
pool too. Any other value fails the boot. Programmatically:
|
|
228
|
+
`startSwitchboard({ protocol: { unsupportedStoredDocuments: "read-only" } })`.
|
|
229
|
+
|
|
230
|
+
### Reactor Feature Flags
|
|
190
231
|
|
|
191
232
|
| Variable | Description | Default |
|
|
192
233
|
| ------------------------------ | ------------------------------------------------------------------ | ------- |
|
|
@@ -194,16 +235,22 @@ Programmatically: `startSwitchboard({ projectionWorker: { enabled, dbPoolSize }
|
|
|
194
235
|
| `REACTOR_AUTH_ENFORCEMENT` | Enforce the auth scope's policy at admission, replay and read | `false` |
|
|
195
236
|
| `REACTOR_AUTH_GROUPS` | Let `{ group }` principals match against group-document rosters | `false` |
|
|
196
237
|
| `REACTOR_AUTH_CONDITIONS` | Evaluate `where` / `match` conditions on grants | `false` |
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
238
|
+
| `REACTOR_UNDO_V3` | Support base-reducer 3 (id-targeted undo) | `true` |
|
|
239
|
+
|
|
240
|
+
Set an enforcement flag to the literal `true` to enable it. Each requires the one
|
|
241
|
+
above it, and switchboard refuses to start on a set that skips one — a partially
|
|
242
|
+
enforcing reactor would apply less than the operator asked for.
|
|
243
|
+
`REACTOR_UNDO_V3` has no prerequisites and is on unless set to the literal
|
|
244
|
+
`false` (an empty value counts as on). New documents then take base-reducer 3,
|
|
245
|
+
and a peer without it is held from those documents until it upgrades.
|
|
246
|
+
Programmatically: `protocol.featureFlags.undoV3`.
|
|
247
|
+
|
|
248
|
+
The enforcement flags change replay outcomes, which are consensus outcomes, so
|
|
249
|
+
**a flag flips for a whole document-sharing fleet, never per node**. Two nodes that share
|
|
204
250
|
documents and disagree on the flags diverge, exactly as two nodes on
|
|
205
251
|
incompatible versions would. Connect carries the same flags in
|
|
206
|
-
`connect.reactor.featureFlags` (see
|
|
252
|
+
`connect.reactor.featureFlags` (see
|
|
253
|
+
`apps/connect/skills/customize-connect/references/runtime-config.md`); a fleet
|
|
207
254
|
that includes browser replicas has to set them there too.
|
|
208
255
|
|
|
209
256
|
Sweep the store before enabling either auth flag — neither unsafe condition is
|
|
@@ -244,6 +291,39 @@ Switchboard supports multiple storage backends:
|
|
|
244
291
|
- **PostgreSQL**: Persistent database storage
|
|
245
292
|
- **Redis**: Caching layer (optional)
|
|
246
293
|
|
|
294
|
+
### Keyframes
|
|
295
|
+
|
|
296
|
+
A keyframe is a stored copy of a whole document that saves a cold read from replaying its full history. Set how often one is written and how many a document stream keeps, per document type, in `powerhouse.config.json`:
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"reactor": {
|
|
301
|
+
"keyframes": {
|
|
302
|
+
"default": { "interval": 10, "keep": 4 },
|
|
303
|
+
"types": {
|
|
304
|
+
"acme/email": { "interval": 50, "keep": 1 },
|
|
305
|
+
"acme/invoice": { "keep": 12 }
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
A rule takes what it leaves out from `default`. `"keep": null` keeps every keyframe. Without this block a keyframe is written every 10 revisions and all of them stay. `PH_KEYFRAMES` holds the same JSON and replaces the block whole.
|
|
313
|
+
|
|
314
|
+
New keyframes then stay within `keep` on their own. To apply a `keep` to keyframes already stored, and to remove all keyframes of deleted documents, use the reactor monitor's Keyframes tab or the CLI. Both need `INSPECTION_ADMIN_ENABLED=true` and a caller in the host's `ADMINS`:
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
ph keyframes preview --url http://localhost:4001/graphql # reads only
|
|
318
|
+
ph keyframes clean --yes --url http://localhost:4001/graphql
|
|
319
|
+
ph keyframes reclaim --yes --url http://localhost:4001/graphql
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
A clean-up deletes in small paced statements beside live traffic and can be run again at any time. It frees space inside the table, which new rows reuse; the disk only shrinks after `reclaim`, which rewrites the `Keyframe` table:
|
|
323
|
+
|
|
324
|
+
- **PGlite:** runs in the store's maintenance lane at the first second without a statement, and reports the store as busy after 15 minutes. The store answers nothing during the rewrite. It needs free disk of about twice the table's live size.
|
|
325
|
+
- **Postgres:** `reclaim` only says what to do. Run `VACUUM FULL reactor."Keyframe"` in a quiet moment; it takes an `ACCESS EXCLUSIVE` lock, so writes that add a keyframe wait for it. `pg_repack` does the same without holding the lock.
|
|
326
|
+
|
|
247
327
|
### Observability
|
|
248
328
|
|
|
249
329
|
Switchboard bootstraps Sentry and OpenTelemetry from a single module (`src/observability.mts`) that is imported as the very first thing in `src/index.mts`. The OpenTelemetry instrumentations (`http`, `express`, `pg`, `graphql`) register require-time hooks at load, so the import order must not be changed.
|
package/dist/boot.d.mts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { a as SwitchboardConfigInput } from "./schema-MAUTnmj1.mjs";
|
|
2
|
+
import { RenownConfig } from "@powerhousedao/reactor-api";
|
|
3
|
+
//#region src/boot-preconditions.d.mts
|
|
4
|
+
/** What the server refuses to boot with; it throws the first, `ph host check` reports all. */
|
|
5
|
+
interface SwitchboardBootFacts {
|
|
6
|
+
dev: boolean;
|
|
7
|
+
/** Executor pool size; 0 when the pool is off. */
|
|
8
|
+
workers: number;
|
|
9
|
+
projectionWorker: boolean;
|
|
10
|
+
reactorDbUrl: string | undefined;
|
|
11
|
+
authEnforcement: boolean;
|
|
12
|
+
renownSource: "self" | "remote" | "kept";
|
|
13
|
+
}
|
|
14
|
+
/** The reactor database the server boots with: its `dbPath` option, then the env. */
|
|
15
|
+
export declare function reactorDbUrlOf(dbPath: string | undefined, env: Readonly<Record<string, string | undefined>>): string | undefined;
|
|
16
|
+
export declare function workerTrustPolicyIssue(facts: Pick<SwitchboardBootFacts, "workers" | "authEnforcement" | "renownSource">): string | undefined;
|
|
17
|
+
/** In the order the server checks them; empty when the pool is off. */
|
|
18
|
+
export declare function workerPoolIssues(facts: SwitchboardBootFacts): string[];
|
|
19
|
+
/** The projection worker's preconditions, assuming it is enabled. */
|
|
20
|
+
export declare function projectionWorkerIssues(facts: Pick<SwitchboardBootFacts, "dev" | "reactorDbUrl">): string[];
|
|
21
|
+
export declare function switchboardBootIssues(facts: SwitchboardBootFacts): string[];
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/boot.d.mts
|
|
24
|
+
export interface BootFactsOptions {
|
|
25
|
+
dev: boolean;
|
|
26
|
+
/** The server's `dbPath` option (a host's readModel.url). */
|
|
27
|
+
dbPath?: string;
|
|
28
|
+
/** powerhouse.config.json `auth.renown`. */
|
|
29
|
+
configuredRenown?: RenownConfig;
|
|
30
|
+
}
|
|
31
|
+
/** The server's boot facts from `env`; a parser error becomes an issue and its fact stays off. */
|
|
32
|
+
export declare function switchboardBootFactsFromEnv(env: NodeJS.ProcessEnv, options: BootFactsOptions): Promise<{
|
|
33
|
+
facts: SwitchboardBootFacts;
|
|
34
|
+
issues: string[];
|
|
35
|
+
}>;
|
|
36
|
+
export interface BootFactsOfOptions {
|
|
37
|
+
dev: boolean;
|
|
38
|
+
/** powerhouse.config.json `auth.renown`. */
|
|
39
|
+
configuredRenown?: RenownConfig;
|
|
40
|
+
}
|
|
41
|
+
/** The server's boot facts from the config it would start with. */
|
|
42
|
+
export declare function switchboardBootFactsOf(input: SwitchboardConfigInput, options: BootFactsOfOptions): Promise<SwitchboardBootFacts>;
|
|
43
|
+
//#endregion
|
|
44
|
+
export type { SwitchboardBootFacts };
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=boot.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.d.mts","names":[],"sources":["../src/boot-preconditions.mts","../src/boot.mts"],"mappings":";;;;UAGiB;EACf;;EAEA;EACA;EACA;EACA;EACA;;;wBAIc,eACd,4BACA,KAAK,SAAS;wBAOA,uBACd,OAAO,KACL;;wBAsBY,iBAAiB,OAAO;;wBAmBxB,uBACd,OAAO,KAAK;wBAgBE,sBAAsB,OAAO;;;iBCrC5B;EACf;;EAEA;;EAEA,mBAAmB;;;wBAIC,4BACpB,KAAK,OAAO,YACZ,SAAS,mBACR;EAAU,OAAO;EAAsB;;iBA2BzB;EACf;;EAEA,mBAAmB;;;wBAIC,uBACpB,OAAO,wBACP,SAAS,qBACR,QAAQ"}
|
package/dist/boot.mjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
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]="a17538e0-6085-5bb6-9d91-8f8c2a2b1c82")}catch(e){}}();
|
|
3
|
+
import { d as reactorDbUrlOf, f as switchboardBootIssues, l as resolveProjectionWorkerOptions, m as workerTrustPolicyIssue, o as resolveWorkerPoolOptions, p as workerPoolIssues, u as projectionWorkerIssues } from "./worker-pool-gyxJnCxA.mjs";
|
|
4
|
+
import { i as switchboardConfigSchema } from "./schema-CsY8bjsu.mjs";
|
|
5
|
+
import { r as resolveReactorFeatureFlags, t as renownLayers } from "./renown-layers-DmbWLt46.mjs";
|
|
6
|
+
//#region src/boot.mts
|
|
7
|
+
const noop = () => {};
|
|
8
|
+
const silent = {
|
|
9
|
+
level: "error",
|
|
10
|
+
verbose: noop,
|
|
11
|
+
debug: noop,
|
|
12
|
+
info: noop,
|
|
13
|
+
warn: noop,
|
|
14
|
+
error: noop,
|
|
15
|
+
errorHandler: noop,
|
|
16
|
+
child: () => silent
|
|
17
|
+
};
|
|
18
|
+
async function loadResolveRenownConfig() {
|
|
19
|
+
return (await import("@powerhousedao/reactor-api")).resolveRenownConfig;
|
|
20
|
+
}
|
|
21
|
+
/** The server's boot facts from `env`; a parser error becomes an issue and its fact stays off. */
|
|
22
|
+
async function switchboardBootFactsFromEnv(env, options) {
|
|
23
|
+
const resolveRenown = await loadResolveRenownConfig();
|
|
24
|
+
const issues = [];
|
|
25
|
+
let workers = 0;
|
|
26
|
+
try {
|
|
27
|
+
workers = resolveWorkerPoolOptions(void 0, env)?.numWorkers ?? 0;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
issues.push(error instanceof Error ? error.message : String(error));
|
|
30
|
+
}
|
|
31
|
+
let projectionWorker = false;
|
|
32
|
+
try {
|
|
33
|
+
projectionWorker = resolveProjectionWorkerOptions(void 0, env) !== null;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
issues.push(error instanceof Error ? error.message : String(error));
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
facts: {
|
|
39
|
+
dev: options.dev,
|
|
40
|
+
workers,
|
|
41
|
+
projectionWorker,
|
|
42
|
+
reactorDbUrl: reactorDbUrlOf(options.dbPath, env),
|
|
43
|
+
authEnforcement: resolveReactorFeatureFlags(env).flags.authEnforcement === true,
|
|
44
|
+
renownSource: resolveRenown(options.configuredRenown, env, silent).source
|
|
45
|
+
},
|
|
46
|
+
issues
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** The server's boot facts from the config it would start with. */
|
|
50
|
+
async function switchboardBootFactsOf(input, options) {
|
|
51
|
+
const resolveRenown = await loadResolveRenownConfig();
|
|
52
|
+
const config = switchboardConfigSchema.parse(input);
|
|
53
|
+
const pool = resolveWorkerPoolOptions({ numWorkers: config.workers.executor.count }, {});
|
|
54
|
+
return {
|
|
55
|
+
dev: options.dev || config.server.dev,
|
|
56
|
+
workers: pool?.numWorkers ?? 0,
|
|
57
|
+
projectionWorker: config.workers.projection.enabled,
|
|
58
|
+
reactorDbUrl: config.storage.reactor.url,
|
|
59
|
+
authEnforcement: config.protocol.featureFlags.authEnforcement,
|
|
60
|
+
renownSource: resolveRenown(renownLayers(options.configuredRenown, config.auth.renown), {}, silent).source
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { projectionWorkerIssues, reactorDbUrlOf, switchboardBootFactsFromEnv, switchboardBootFactsOf, switchboardBootIssues, workerPoolIssues, workerTrustPolicyIssue };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=boot.mjs.map
|
|
67
|
+
//# debugId=a17538e0-6085-5bb6-9d91-8f8c2a2b1c82
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.mjs","sources":["../src/boot.mts"],"sourcesContent":["import type {\n RenownConfig,\n resolveRenownConfig,\n} from \"@powerhousedao/reactor-api\";\nimport type { ILogger } from \"document-model\";\nimport {\n reactorDbUrlOf,\n type SwitchboardBootFacts,\n} from \"./boot-preconditions.mjs\";\nimport {\n switchboardConfigSchema,\n type SwitchboardConfigInput,\n} from \"./config/schema.js\";\nimport { resolveProjectionWorkerOptions } from \"./projection-worker.mjs\";\nimport { resolveReactorFeatureFlags } from \"./reactor-feature-flags.mjs\";\nimport { renownLayers } from \"./renown-layers.mjs\";\nimport { resolveWorkerPoolOptions } from \"./worker-pool.mjs\";\n\n// The boot preconditions without the server: importing this reads no .env.\n\nexport {\n projectionWorkerIssues,\n reactorDbUrlOf,\n switchboardBootIssues,\n workerPoolIssues,\n workerTrustPolicyIssue,\n type SwitchboardBootFacts,\n} from \"./boot-preconditions.mjs\";\n\nconst noop = () => {};\nconst silent: ILogger = {\n level: \"error\",\n verbose: noop,\n debug: noop,\n info: noop,\n warn: noop,\n error: noop,\n errorHandler: noop,\n child: () => silent,\n};\n\n// Loaded lazily: the boot preconditions stay importable without reactor-api.\nasync function loadResolveRenownConfig(): Promise<typeof resolveRenownConfig> {\n return (await import(\"@powerhousedao/reactor-api\")).resolveRenownConfig;\n}\n\nexport interface BootFactsOptions {\n dev: boolean;\n /** The server's `dbPath` option (a host's readModel.url). */\n dbPath?: string;\n /** powerhouse.config.json `auth.renown`. */\n configuredRenown?: RenownConfig;\n}\n\n/** The server's boot facts from `env`; a parser error becomes an issue and its fact stays off. */\nexport async function switchboardBootFactsFromEnv(\n env: NodeJS.ProcessEnv,\n options: BootFactsOptions,\n): Promise<{ facts: SwitchboardBootFacts; issues: string[] }> {\n const resolveRenown = await loadResolveRenownConfig();\n const issues: string[] = [];\n let workers = 0;\n try {\n workers = resolveWorkerPoolOptions(undefined, env)?.numWorkers ?? 0;\n } catch (error) {\n issues.push(error instanceof Error ? error.message : String(error));\n }\n let projectionWorker = false;\n try {\n projectionWorker = resolveProjectionWorkerOptions(undefined, env) !== null;\n } catch (error) {\n issues.push(error instanceof Error ? error.message : String(error));\n }\n const facts: SwitchboardBootFacts = {\n dev: options.dev,\n workers,\n projectionWorker,\n reactorDbUrl: reactorDbUrlOf(options.dbPath, env),\n authEnforcement:\n resolveReactorFeatureFlags(env).flags.authEnforcement === true,\n renownSource: resolveRenown(options.configuredRenown, env, silent).source,\n };\n return { facts, issues };\n}\n\nexport interface BootFactsOfOptions {\n dev: boolean;\n /** powerhouse.config.json `auth.renown`. */\n configuredRenown?: RenownConfig;\n}\n\n/** The server's boot facts from the config it would start with. */\nexport async function switchboardBootFactsOf(\n input: SwitchboardConfigInput,\n options: BootFactsOfOptions,\n): Promise<SwitchboardBootFacts> {\n const resolveRenown = await loadResolveRenownConfig();\n const config = switchboardConfigSchema.parse(input);\n const pool = resolveWorkerPoolOptions(\n { numWorkers: config.workers.executor.count },\n {},\n );\n return {\n dev: options.dev || config.server.dev,\n workers: pool?.numWorkers ?? 0,\n projectionWorker: config.workers.projection.enabled,\n reactorDbUrl: config.storage.reactor.url,\n authEnforcement: config.protocol.featureFlags.authEnforcement,\n renownSource: resolveRenown(\n renownLayers(options.configuredRenown, config.auth.renown),\n {},\n silent,\n ).source,\n };\n}\n"],"names":[],"mappings":";;;;;;AA6BA,MAAM,aAAa,CAAC;AACpB,MAAM,SAAkB;CACtB,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACP,cAAc;CACd,aAAa;AACf;AAGA,eAAe,0BAA+D;CAC5E,QAAQ,MAAM,OAAO,8BAAA,CAA+B;AACtD;;AAWA,eAAsB,4BACpB,KACA,SAC4D;CAC5D,MAAM,gBAAgB,MAAM,wBAAwB;CACpD,MAAM,SAAmB,CAAC;CAC1B,IAAI,UAAU;CACd,IAAI;EACF,UAAU,yBAAyB,KAAA,GAAW,GAAG,CAAC,EAAE,cAAc;CACpE,SAAS,OAAO;EACd,OAAO,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;CACpE;CACA,IAAI,mBAAmB;CACvB,IAAI;EACF,mBAAmB,+BAA+B,KAAA,GAAW,GAAG,MAAM;CACxE,SAAS,OAAO;EACd,OAAO,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;CACpE;CAUA,OAAO;EAAE,OAAA;GARP,KAAK,QAAQ;GACb;GACA;GACA,cAAc,eAAe,QAAQ,QAAQ,GAAG;GAChD,iBACE,2BAA2B,GAAG,CAAC,CAAC,MAAM,oBAAoB;GAC5D,cAAc,cAAc,QAAQ,kBAAkB,KAAK,MAAM,CAAC,CAAC;EAExD;EAAG;CAAO;AACzB;;AASA,eAAsB,uBACpB,OACA,SAC+B;CAC/B,MAAM,gBAAgB,MAAM,wBAAwB;CACpD,MAAM,SAAS,wBAAwB,MAAM,KAAK;CAClD,MAAM,OAAO,yBACX,EAAE,YAAY,OAAO,QAAQ,SAAS,MAAM,GAC5C,CAAC,CACH;CACA,OAAO;EACL,KAAK,QAAQ,OAAO,OAAO,OAAO;EAClC,SAAS,MAAM,cAAc;EAC7B,kBAAkB,OAAO,QAAQ,WAAW;EAC5C,cAAc,OAAO,QAAQ,QAAQ;EACrC,iBAAiB,OAAO,SAAS,aAAa;EAC9C,cAAc,cACZ,aAAa,QAAQ,kBAAkB,OAAO,KAAK,MAAM,GACzD,CAAC,GACD,MACF,CAAC,CAAC;CACJ;AACF","debug_id":"a17538e0-6085-5bb6-9d91-8f8c2a2b1c82"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a as SwitchboardConfigInput } from "../schema-MAUTnmj1.mjs";
|
|
2
|
+
import { ILogger } from "document-model";
|
|
3
|
+
//#region src/config/from-env.d.ts
|
|
4
|
+
type Env = Readonly<Record<string, string | undefined>>;
|
|
5
|
+
type Logger = ILogger;
|
|
6
|
+
export interface SwitchboardConfigFromEnvOptions {
|
|
7
|
+
/** The bin's own keys (sb/config.ts) instead of PORT. */
|
|
8
|
+
bin?: boolean;
|
|
9
|
+
logger?: Logger;
|
|
10
|
+
}
|
|
11
|
+
/** Only the keys the env sets; today's boot errors throw with their messages. */
|
|
12
|
+
export declare function switchboardConfigFromEnv(env: Env, options?: SwitchboardConfigFromEnvOptions): SwitchboardConfigInput;
|
|
13
|
+
//#endregion
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=from-env.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"from-env.d.mts","names":[],"sources":["../../src/config/from-env.ts"],"mappings":";;;KAqCK,MAAM,SAAS;KACf,SAAS;iBAEG;;EAEf;EACA,SAAS;;;wBAIK,yBACd,KAAK,KACL,UAAS,kCACR"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { t as switchboardConfigFromEnv } from "../from-env-FH4fPeIE.mjs";
|
|
2
|
+
export { switchboardConfigFromEnv };
|
|
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]="47e3437f-1455-580e-99ef-e43cf6260bfe")}catch(e){}}();
|
|
4
|
+
//# debugId=47e3437f-1455-580e-99ef-e43cf6260bfe
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as SwitchboardConfigInput, c as callerOverEnv, i as SwitchboardConfig, l as mergeSwitchboardConfig, n as SWITCHBOARD_DRIVE_DOCUMENT_TYPES, o as switchboardConfigLayerSchema, r as SWITCHBOARD_LOG_LEVELS, s as switchboardConfigSchema, t as ReactorApiSectionsMatch } from "../schema-MAUTnmj1.mjs";
|
|
2
|
+
export { ReactorApiSectionsMatch, SWITCHBOARD_DRIVE_DOCUMENT_TYPES, SWITCHBOARD_LOG_LEVELS, SwitchboardConfig, SwitchboardConfigInput, callerOverEnv, mergeSwitchboardConfig, switchboardConfigLayerSchema, switchboardConfigSchema };
|
|
3
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { a as callerOverEnv, i as switchboardConfigSchema, n as SWITCHBOARD_LOG_LEVELS, o as mergeSwitchboardConfig, r as switchboardConfigLayerSchema, t as SWITCHBOARD_DRIVE_DOCUMENT_TYPES } from "../schema-CsY8bjsu.mjs";
|
|
2
|
+
export { SWITCHBOARD_DRIVE_DOCUMENT_TYPES, SWITCHBOARD_LOG_LEVELS, callerOverEnv, mergeSwitchboardConfig, switchboardConfigLayerSchema, switchboardConfigSchema };
|
|
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]="3d14d041-438a-5640-b7ed-999dfc43cf7e")}catch(e){}}();
|
|
4
|
+
//# debugId=3d14d041-438a-5640-b7ed-999dfc43cf7e
|