@powerhousedao/switchboard 6.2.3-dev.104 → 6.2.3-dev.106

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.
Files changed (34) hide show
  1. package/.tsbuild/tsconfig.tsbuildinfo +1 -1
  2. package/Auth.md +58 -0
  3. package/CHANGELOG.md +20 -0
  4. package/dist/boot.d.mts +1 -1
  5. package/dist/boot.mjs +1 -1
  6. package/dist/config/from-env.d.mts +1 -1
  7. package/dist/config/from-env.mjs +3 -3
  8. package/dist/config/schema.d.mts +1 -1
  9. package/dist/config/schema.mjs +3 -3
  10. package/dist/{from-env-FH4fPeIE.mjs → from-env-D9dRZUQY.mjs} +4 -4
  11. package/dist/{from-env-FH4fPeIE.mjs.map → from-env-D9dRZUQY.mjs.map} +1 -1
  12. package/dist/index.mjs +3 -3
  13. package/dist/{plugin-host-CK9_tVak.d.mts → plugin-host-piahVvKb.d.mts} +2 -2
  14. package/dist/{plugin-host-CK9_tVak.d.mts.map → plugin-host-piahVvKb.d.mts.map} +1 -1
  15. package/dist/plugins/ai.d.mts +1 -1
  16. package/dist/plugins/attachments.d.mts +1 -1
  17. package/dist/plugins/attachments.mjs +3 -3
  18. package/dist/plugins/mcp.d.mts +1 -1
  19. package/dist/plugins/privacy.d.mts +1 -1
  20. package/dist/plugins/workflows.d.mts +1 -1
  21. package/dist/{schema-CsY8bjsu.mjs → schema-68ZKLRVg.mjs} +25 -3
  22. package/dist/schema-68ZKLRVg.mjs.map +1 -0
  23. package/dist/{schema-MAUTnmj1.d.mts → schema-D-Ahyq6C.d.mts} +9 -2
  24. package/dist/schema-D-Ahyq6C.d.mts.map +1 -0
  25. package/dist/{server-CirQ9hyu.mjs → server-C1jP38fW.mjs} +5 -5
  26. package/dist/{server-CirQ9hyu.mjs.map → server-C1jP38fW.mjs.map} +1 -1
  27. package/dist/server.d.mts +1 -1
  28. package/dist/server.mjs +4 -4
  29. package/package.json +17 -17
  30. package/test/boot-auth-config.test.ts +38 -1
  31. package/test/config-merge.test.ts +31 -0
  32. package/test/config-schema.test.ts +15 -0
  33. package/dist/schema-CsY8bjsu.mjs.map +0 -1
  34. package/dist/schema-MAUTnmj1.d.mts.map +0 -1
@@ -141,6 +141,13 @@ declare const switchboardConfigSchema: z.ZodObject<{
141
141
  wsRecheckMs: z.ZodOptional<z.ZodNumber>;
142
142
  ownerClaim: z.ZodDefault<z.ZodBoolean>;
143
143
  offlineCredentials: z.ZodDefault<z.ZodBoolean>;
144
+ access: z.ZodPrefault<z.ZodObject<{
145
+ mode: z.ZodDefault<z.ZodString>;
146
+ gateUrl: z.ZodOptional<z.ZodString>;
147
+ gateToken: z.ZodOptional<z.ZodString>;
148
+ appId: z.ZodOptional<z.ZodString>;
149
+ graceMs: z.ZodOptional<z.ZodNumber>;
150
+ }, z.core.$strip>>;
144
151
  renown: z.ZodPrefault<z.ZodObject<{
145
152
  source: z.ZodOptional<z.ZodEnum<{
146
153
  kept: "kept";
@@ -244,8 +251,8 @@ type Section<T> = NonNullable<T>;
244
251
  type MissingKeys<Api, Ours> = Exclude<keyof Section<Api>, keyof Ours>;
245
252
  type Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;
246
253
  type Assert<T extends true> = T;
247
- type ReactorApiSectionsMatch = [Assert<Same<MissingKeys<ReactorApiConfig["server"], SwitchboardConfig["server"]>, never>>, Assert<Same<MissingKeys<ReactorApiConfig["auth"], SwitchboardConfig["auth"]>, never>>, Assert<Same<MissingKeys<Section<ReactorApiConfig["auth"]>["documentPermissions"], SwitchboardConfig["auth"]["documentPermissions"]>, never>>, Assert<Same<MissingKeys<ReactorApiConfig["inspection"], SwitchboardConfig["inspection"]>, never>>, Assert<Same<MissingKeys<ReactorApiConfig["attachments"], SwitchboardConfig["attachments"]>, never>>, Assert<ReactorApiConfig extends SwitchboardConfigInput ? true : false>, Assert<Pick<SwitchboardConfig, "server" | "auth" | "inspection" | "attachments"> extends ReactorApiConfig ? true : false>, Assert<Same<SwitchboardConfig["server"]["gatewayAdapter"], NonNullable<Section<ReactorApiConfig["server"]>["gatewayAdapter"]>>>, Assert<Same<SwitchboardConfig["attachments"]["storage"], AttachmentStorageConfig>>];
254
+ type ReactorApiSectionsMatch = [Assert<Same<MissingKeys<ReactorApiConfig["server"], SwitchboardConfig["server"]>, never>>, Assert<Same<MissingKeys<ReactorApiConfig["auth"], SwitchboardConfig["auth"]>, never>>, Assert<Same<MissingKeys<Section<ReactorApiConfig["auth"]>["documentPermissions"], SwitchboardConfig["auth"]["documentPermissions"]>, never>>, Assert<Same<MissingKeys<Section<ReactorApiConfig["auth"]>["access"], SwitchboardConfig["auth"]["access"]>, never>>, Assert<Same<MissingKeys<ReactorApiConfig["inspection"], SwitchboardConfig["inspection"]>, never>>, Assert<Same<MissingKeys<ReactorApiConfig["attachments"], SwitchboardConfig["attachments"]>, never>>, Assert<ReactorApiConfig extends SwitchboardConfigInput ? true : false>, Assert<Pick<SwitchboardConfig, "server" | "auth" | "inspection" | "attachments"> extends ReactorApiConfig ? true : false>, Assert<Same<SwitchboardConfig["server"]["gatewayAdapter"], NonNullable<Section<ReactorApiConfig["server"]>["gatewayAdapter"]>>>, Assert<Same<SwitchboardConfig["attachments"]["storage"], AttachmentStorageConfig>>];
248
255
  //#endregion
249
256
  export { SwitchboardConfigInput as a, callerOverEnv as c, SwitchboardConfig as i, mergeSwitchboardConfig as l, SWITCHBOARD_DRIVE_DOCUMENT_TYPES as n, switchboardConfigLayerSchema as o, SWITCHBOARD_LOG_LEVELS as r, switchboardConfigSchema as s, ReactorApiSectionsMatch as t };
250
257
  export {};
251
- //# sourceMappingURL=schema-MAUTnmj1.d.mts.map
258
+ //# sourceMappingURL=schema-D-Ahyq6C.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-D-Ahyq6C.d.mts","names":[],"sources":["../src/config/merge.ts","../src/config/schema.ts"],"mappings":";;;;KAEK,QAAQ;;iBAuCG,0BAA0B,QAAQ,UAAU;;iBAO5C,cAAc,KAAK,OAAO,QAAQ,QAAQ;;;cC1C7C;cAQA;;cAqRA,yBAAuB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBlC,EAAA,KAAA;;;;;;iBAOc,6BACd,2BACC,EAAE,QAAQ,wBAAwB;KAoCzB,oBAAoB,EAAE,cAAc;;KAGpC,yBAAyB,EAAE,aAAa;KAG/C,QAAQ,KAAK,YAAY;KACzB,YAAY,KAAK,QAAQ,cAAc,QAAQ,YAAY;KAC3D,KAAK,GAAG,MAAM,YAAY,OAAO,YAAY;KAC7C,OAAO,kBAAkB;KAClB,2BACV,OACE,KACE,YAAY,4BAA4B,uCAI5C,OACE,KACE,YAAY,0BAA0B,qCAI1C,OACE,KACE,YACE,QAAQ,kDACR,4DAKN,OACE,KACE,YACE,QAAQ,qCACR,+CAKN,OACE,KACE,YACE,gCACA,2CAKN,OACE,KACE,YACE,iCACA,4CAKN,OAAO,yBAAyB,wCAChC,OACE,KACE,6EAEQ,kCAIZ,OACE,KACE,+CACA,YAAY,QAAQ,kDAGxB,OACE,KAAK,6CAA6C"}
@@ -1,10 +1,10 @@
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]="4384c5e3-87ee-52b5-bdec-eaf98e7a2b57")}catch(e){}}();
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-FH4fPeIE.mjs";
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]="1217172f-316f-5882-a2d8-120040a088fe")}catch(e){}}();
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-D9dRZUQY.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";
6
6
  import { n as resolvePrivacy, r as startPrivacy } from "./privacy-DxIJGH4P.mjs";
7
- import { i as switchboardConfigSchema, o as mergeSwitchboardConfig } from "./schema-CsY8bjsu.mjs";
7
+ import { i as switchboardConfigSchema, o as mergeSwitchboardConfig } from "./schema-68ZKLRVg.mjs";
8
8
  import { _ as triggerFatalShutdown, a as workflowsPlugin, c as WORKFLOW_TELEMETRY_SCOPE, d as isWorkflowSingletonConflict, f as modelManifestSource, g as raiseSigterm, h as installFatalErrorShutdown, l as assertWorkflowPackageLoadable, m as workflowSingletonLossHandler, p as retryWorkflowSingleton, s as WORKFLOW_PACKAGE_NAME, u as composeWorkflowRuntime } from "./workflows-C9BQlyT0.mjs";
9
9
  import { t as privacyPlugin } from "./privacy-BO8Q25xI.mjs";
10
10
  import { t as mcpPlugin } from "./mcp-SsBK14Jm.mjs";
@@ -2728,5 +2728,5 @@ function feedCatchUpPriority(priority, server) {
2728
2728
  //#endregion
2729
2729
  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 };
2730
2730
 
2731
- //# sourceMappingURL=server-CirQ9hyu.mjs.map
2732
- //# debugId=4384c5e3-87ee-52b5-bdec-eaf98e7a2b57
2731
+ //# sourceMappingURL=server-C1jP38fW.mjs.map
2732
+ //# debugId=1217172f-316f-5882-a2d8-120040a088fe