@powerhousedao/switchboard 6.3.0-dev.9 → 6.4.0-next.0

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 (68) hide show
  1. package/.tsbuild/test/boot-helpers.d.ts +2 -1
  2. package/.tsbuild/test/boot-helpers.d.ts.map +1 -1
  3. package/.tsbuild/test/boot-identity-files.test.d.ts +2 -0
  4. package/.tsbuild/test/boot-identity-files.test.d.ts.map +1 -0
  5. package/.tsbuild/tsconfig.tsbuildinfo +1 -1
  6. package/CHANGELOG.md +48 -0
  7. package/README.md +11 -9
  8. package/dist/boot.d.mts +1 -1
  9. package/dist/boot.mjs +1 -1
  10. package/dist/config/from-env.d.mts +1 -1
  11. package/dist/config/from-env.d.mts.map +1 -1
  12. package/dist/config/from-env.mjs +3 -3
  13. package/dist/config/schema.d.mts +1 -1
  14. package/dist/config/schema.mjs +3 -3
  15. package/dist/{from-env-DKK_wPrO.mjs → from-env-CLImR6qa.mjs} +4 -28
  16. package/dist/from-env-CLImR6qa.mjs.map +1 -0
  17. package/dist/index.mjs +3 -3
  18. package/dist/migrate.mjs +9 -4
  19. package/dist/migrate.mjs.map +1 -1
  20. package/dist/{plugin-host-tTjDTNz0.d.mts → plugin-host-Z-4Ruypj.d.mts} +19 -2
  21. package/dist/plugin-host-Z-4Ruypj.d.mts.map +1 -0
  22. package/dist/plugins/ai.d.mts +1 -1
  23. package/dist/plugins/attachments.d.mts +1 -1
  24. package/dist/plugins/attachments.mjs +3 -3
  25. package/dist/plugins/mcp.d.mts +1 -1
  26. package/dist/plugins/privacy.d.mts +1 -1
  27. package/dist/plugins/workflows.d.mts +2 -2
  28. package/dist/plugins/workflows.mjs +3 -3
  29. package/dist/{schema-BJ-OFAox.mjs → schema-BbwISVSO.mjs} +15 -13
  30. package/dist/schema-BbwISVSO.mjs.map +1 -0
  31. package/dist/{schema-w1lShimw.d.mts → schema-CZsLzAZg.d.mts} +9 -4
  32. package/dist/schema-CZsLzAZg.d.mts.map +1 -0
  33. package/dist/{server-BS-PFzoK.mjs → server-BMRdMNvC.mjs} +172 -244
  34. package/dist/server-BMRdMNvC.mjs.map +1 -0
  35. package/dist/server.d.mts +2 -2
  36. package/dist/server.d.mts.map +1 -1
  37. package/dist/server.mjs +4 -4
  38. package/dist/{types-Bk4T4D9F.d.mts → types-D-QK3xhO.d.mts} +12 -7
  39. package/dist/types-D-QK3xhO.d.mts.map +1 -0
  40. package/dist/{utils-Cm0TE6dP.mjs → utils-D8yHRVjT.mjs} +4 -18
  41. package/dist/{utils-Cm0TE6dP.mjs.map → utils-D8yHRVjT.mjs.map} +1 -1
  42. package/dist/utils.d.mts +1 -6
  43. package/dist/utils.d.mts.map +1 -1
  44. package/dist/utils.mjs +4 -4
  45. package/dist/{workflows-mdYUh3Us.mjs → workflows-D2r6IKou.mjs} +4 -4
  46. package/dist/{workflows-mdYUh3Us.mjs.map → workflows-D2r6IKou.mjs.map} +1 -1
  47. package/package.json +17 -17
  48. package/test/ai-gateway.test.ts +0 -2
  49. package/test/boot-auth-config.test.ts +1 -1
  50. package/test/boot-helpers.ts +3 -1
  51. package/test/boot-identity-files.test.ts +68 -0
  52. package/test/boot-mcp-auth.test.ts +0 -1
  53. package/test/boot-mcp-enabled.test.ts +0 -2
  54. package/test/boot-port-zero.test.ts +1 -2
  55. package/test/boot-ready-drives.test.ts +1 -2
  56. package/test/config-from-env.test.ts +0 -9
  57. package/test/config-merge.test.ts +47 -47
  58. package/test/config-schema.test.ts +16 -4
  59. package/test/default-composition.test.ts +61 -65
  60. package/test/default-drive-protocol-versions.test.ts +13 -6
  61. package/test/default-drive-slug.test.ts +6 -11
  62. package/test/plugin-presence.test.ts +15 -16
  63. package/dist/from-env-DKK_wPrO.mjs.map +0 -1
  64. package/dist/plugin-host-tTjDTNz0.d.mts.map +0 -1
  65. package/dist/schema-BJ-OFAox.mjs.map +0 -1
  66. package/dist/schema-w1lShimw.d.mts.map +0 -1
  67. package/dist/server-BS-PFzoK.mjs.map +0 -1
  68. package/dist/types-Bk4T4D9F.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.mts","names":[],"sources":["../src/pglite-version.ts","../src/pglite-store.mts","../src/builder-defaults.mts","../src/unsupported-stored-documents.mts","../src/server.mts"],"mappings":";;;;;;;;;;;cAYa;KACD,2BAA2B;;;;UCuHtB;EACf;EACA,cAAc;EACd;;;;KClHU;EAIV,iBAAiB;;EAEjB,mBAAmB;;EAEnB;;;;;;;EAOA,gBAAgB;;EAEhB;;EAEA;IACE;IACA,eAAe,QAAQ;;;EAGzB,sBAAsB;EACtB,SAAS;;;;;;EAMT,SAAS;;;;;EAKT,cAAc,KAAK;;EAEnB,wBAAwB;;wBAiBV,gCACd,gBAAgB,gBAChB,eAAe,sBACf,UAAS;;;;wBCrEK,kCACd,OAAO,wCACP,KAAK,OAAO,aACX;;qBAaU,oCAAoC;WACtC,mBAAmB;WACnB;EAET,YAAY,OAAO;SAYH,QACd,iBACC,SAAS;;;;;wBCiKE,uBACd,UAAS,KAAK;;;;;;wBAgCM,gBAAgB,eAAe;;wBA6ErC,iBACd,YAAY,2CACZ,mBACA,qBACC;;;;;;KA2CE;EACH,QAAQ,OAAO;EACf,qBAAqB;EACrB,cAAc;;EAEd,mBAAmB;;wBAGC,oBAAoB;EACxC;EACA;EACA,oBAAoB;EACpB;;EAEA;;EAEA;EACA,iBAAiB;;EAEjB,eAAe;EACf,QAAQ;IACN,QAAQ;iBAkEK;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;wBAcc,yBAAyB;EACvC;EACA;;EAEA;;EAEA;EACA;IACE;;wBAmCY,8BACd,SAAS,KAAK,uDACd,oBACA,QAAQ;EACL;EAAmB,YAAY;;;;;;;;;;;;;;;;;;;;qBAs3CvB,mBAAgB,QACpB,wBAAsB,OACvB,oBACL,QAAQ"}
1
+ {"version":3,"file":"server.d.mts","names":[],"sources":["../src/pglite-version.ts","../src/pglite-store.mts","../src/builder-defaults.mts","../src/unsupported-stored-documents.mts","../src/server.mts"],"mappings":";;;;;;;;;;;cAYa;KACD,2BAA2B;;;;UCuHtB;EACf;EACA,cAAc;EACd;;;;KClHU;EAIV,iBAAiB;;EAEjB,mBAAmB;;EAEnB;;;;;;;EAOA,gBAAgB;;EAEhB;;EAEA;IACE;IACA,eAAe,QAAQ;;;EAGzB,sBAAsB;EACtB,SAAS;;;;;;EAMT,SAAS;;;;;EAKT,cAAc,KAAK;;EAEnB,wBAAwB;;wBAiBV,gCACd,gBAAgB,gBAChB,eAAe,sBACf,UAAS;;;;wBCrEK,kCACd,OAAO,wCACP,KAAK,OAAO,aACX;;qBAaU,oCAAoC;WACtC,mBAAmB;WACnB;EAET,YAAY,OAAO;SAYH,QACd,iBACC,SAAS;;;;;wBCyJE,uBACd,UAAS,KAAK;;;;;;wBAgCM,gBAAgB,eAAe;;wBA2ErC,iBACd,YAAY,2CACZ,mBACA,qBACC;;;;;;KAmCE;EACH,QAAQ,OAAO;EACf,qBAAqB;EACrB,cAAc;;EAEd,mBAAmB;;wBAGC,oBAAoB;EACxC;EACA;EACA,oBAAoB;EACpB;;EAEA;;EAEA;EACA,iBAAiB;;EAEjB,eAAe;EACf,QAAQ;IACN,QAAQ;iBAkEK;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;;;wBAcc,yBAAyB;EACvC;EACA;;EAEA;;EAEA;EACA;IACE;;wBAmCY,8BACd,SAAS,KAAK,uDACd,oBACA,QAAQ;EACL;EAAmB,YAAY;;;;;;;;;;;;;;;;;;;;qBA6vCvB,mBAAgB,QACpB,wBAAsB,OACvB,oBACL,QAAQ"}
package/dist/server.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { n as StoredDocumentsRefusedError, r as resolveUnsupportedStoredDocuments } from "./from-env-DKK_wPrO.mjs";
3
- import { a as resolveKeyframes, i as isPortAvailable, n as deriveAttachmentServiceConfig, o as resolvePgliteStorageDirs, r as initSwitchboardProcess, s as startSwitchboard, t as createReactorKysely, u as applySwitchboardReactorDefaults } from "./server-BS-PFzoK.mjs";
2
+ import { n as StoredDocumentsRefusedError, r as resolveUnsupportedStoredDocuments } from "./from-env-CLImR6qa.mjs";
3
+ import { a as resolveKeyframes, i as isPortAvailable, n as deriveAttachmentServiceConfig, o as resolvePgliteStorageDirs, r as initSwitchboardProcess, s as startSwitchboard, t as createReactorKysely, u as applySwitchboardReactorDefaults } from "./server-BMRdMNvC.mjs";
4
4
  export { StoredDocumentsRefusedError, applySwitchboardReactorDefaults, createReactorKysely, deriveAttachmentServiceConfig, initSwitchboardProcess, isPortAvailable, resolveKeyframes, resolvePgliteStorageDirs, resolveUnsupportedStoredDocuments, startSwitchboard };
5
- !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]="eb798b23-f32c-5ff0-ae0c-21c9fe293a6d")}catch(e){}}();
6
- //# debugId=eb798b23-f32c-5ff0-ae0c-21c9fe293a6d
5
+ !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]="19c1cf15-cfa8-5947-8353-50ac7ed846c4")}catch(e){}}();
6
+ //# debugId=19c1cf15-cfa8-5947-8353-50ac7ed846c4
@@ -43,6 +43,12 @@ type StorageOptions = {
43
43
  type IdentityOptions = {
44
44
  /** Path to the keypair file. Defaults to ~/.ph/keypair.json */
45
45
  keypairPath?: string;
46
+ /**
47
+ * Path to the Renown user file (`.renown.json`), which Renown writes when
48
+ * it is missing. With `keypairPath`, nothing of the identity lands in the
49
+ * working directory's `.ph`.
50
+ */
51
+ storagePath?: string;
46
52
  /**
47
53
  * If true, won't start without an existing keypair.
48
54
  * Use this to ensure the switchboard only runs with an authenticated identity.
@@ -141,10 +147,9 @@ type StartServerOptions = {
141
147
  mcp?: boolean;
142
148
  /** The declared plugin composition to boot with: the resolved host.js
143
149
  * runner.plugins entries, supplied by the uniform-runners switchboard
144
- * runner (R2 step 2) or a test. Read only under `features.pluginHost: true`
145
- * (FEATURE_PLUGIN_HOST_ENABLED=1), where omitted = every built-in plugin.
146
- * Without that the default composition boots: the subsystems MCP_ENABLED,
147
- * PH_WORKFLOWS_ENABLED and the config file turn on. Resolved plugins, not
150
+ * runner (R2 step 2) or a test. A plugin's presence is the switch. Omitted:
151
+ * the default composition boots, the subsystems MCP_ENABLED and
152
+ * PH_WORKFLOWS_ENABLED turn on. Resolved plugins, not
148
153
  * specifiers — resolution happens at the runner against the PROJECT
149
154
  * dependency tree. */
150
155
  pluginComposition?: ResolvedPlugin[];
@@ -156,7 +161,7 @@ type StartServerOptions = {
156
161
  * decides, then PGLITE_WORKERS_DEFAULT. */
157
162
  pgliteWorkers?: boolean;
158
163
  /** Powerhouse workflows: the runtime, its subgraph, its webhooks and its
159
- * document models. Wins over PH_WORKFLOWS_ENABLED and the config file. */
164
+ * document models. Wins over PH_WORKFLOWS_ENABLED. */
160
165
  workflows?: {
161
166
  enabled?: boolean;
162
167
  /** OAuth2 apps the publisher owns (`oauth_app` on a connection): per app,
@@ -282,7 +287,7 @@ type SwitchboardReactor = {
282
287
  /** Whether the workflow runtime's operation intake is indexing. Undefined
283
288
  * when workflows are off; unavailable means no document trigger fires. */
284
289
  workflowTriggers?: WorkflowTriggersCapability;
285
- /** Whether workflows are on, after the option, PH_WORKFLOWS_ENABLED and the config file. */
290
+ /** Whether workflows are on, after the option and PH_WORKFLOWS_ENABLED. */
286
291
  workflowsEnabled: boolean;
287
292
  /** The boot list of importable models workers and workflow pieces load; empty when none are resolved. */
288
293
  modelManifest(): ModelManifestEntry[];
@@ -315,4 +320,4 @@ type SwitchboardReactor = {
315
320
  //#endregion
316
321
  export { SwitchboardDriveDocumentType as a, SwitchboardDeps as i, StartServerOptions as n, SwitchboardDriveInput as o, StorageOptions as r, SwitchboardReactor as s, IdentityOptions as t };
317
322
  export {};
318
- //# sourceMappingURL=types-Bk4T4D9F.d.mts.map
323
+ //# sourceMappingURL=types-D-QK3xhO.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-D-QK3xhO.d.mts","names":[],"sources":["../src/privacy.mts","../src/types.ts"],"mappings":";;;;;;;;;;;KAyBY;;EAEV;;EAEA;;EAEA,SAAS;;EAET;EACA;EACA;EACA;;;;;;;;;;KCRU;;KAKA,wBAAwB;EAClC,eAAe;;KAGL;EACV;EACA;EACA;;KAGU;;EAEV;;;;;;EAMA;;;;;EAKA;;EAGA;;;;;;;KAQU;;;;;;;;;;;;;;;;;;;;;EAqBV,UAAU;;;;;;;;EAQV;;;;;;;EAOA;;;;;EAKA,aAAa;;;;;;;EAOb;EACA;;;;;;;EAOA;;;;;;EAMA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;IAEM;IACA;;;;;;;EASN,WAAW;;EAEX;;;EAGA;;;;;;;;EAQA,oBAAoB;;;EAGpB;;;;EAIA;;;EAGA;IACE;;;;;;;IAOA;MACE;MACA;QAAW;QAAkB;;MAC7B;QAAU;QAAkB;QAAqB;;;;;EAIrD,UAAU;EACV,kBAAkB;EAClB;EACA;;;;;;EAMA;;;;;;EAMA,iBAAiB;EACjB,SAAS;;;;;;;;;;EAUT;;;;;;;;;;EAUA;;;;;;;;;EASA;IACE;IACA;IACA;;;;;;;;;;;EAWF;IACE;IACA;;;;;;;;;EASF,6BAA6B;;;KAInB;EACV,SAAS;;EAET,UAAU;;EAEV,oBAAoB;;EAEpB,eAAe;;EAEf;;EAEA;;EAEA,aAAa;;EAEb,gBAAgB;;KAGN;EACV;EACA,SAAS;;;;;EAKT,mBAAmB;;EAEnB,+BAA+B;;;EAG/B,mBAAmB;;EAEnB;;EAEA,iBAAiB;;EAEjB;IAAY,SAAS;;;EAErB;;EAEA;;EAEA,WAAW;;EAEX,QAAQ;;;;;EAKR;;;;;;;;EAQA,gBAAgB"}
@@ -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]="aa01e979-2da2-5a91-8bd6-514c16afd3b2")}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]="d9335116-1bb0-50b3-a551-d0d2a45628cb")}catch(e){}}();
3
3
  import { REACTOR_DRIVE_DOCUMENT_TYPE, reactorDriveCreateState } from "@powerhousedao/reactor-drive";
4
4
  import { driveCreateState, driveDocumentType } from "@powerhousedao/shared/document-drive";
5
5
  //#region src/utils.mts
@@ -127,22 +127,8 @@ async function ensureDrive(client, drive, serverPort, logger = console) {
127
127
  }
128
128
  return `http://localhost:${serverPort}/d/${drive.id || drive.slug}`;
129
129
  }
130
- /** @deprecated Use {@link ensureDrive}. */
131
- function addDefaultDrive(client, drive, serverPort, logger = console) {
132
- return ensureDrive(client, {
133
- ...drive,
134
- documentType: driveDocumentType
135
- }, serverPort, logger);
136
- }
137
- /** @deprecated Use {@link ensureDrive} with `documentType`. */
138
- function addDefaultReactorDrive(client, drive, serverPort, logger = console) {
139
- return ensureDrive(client, {
140
- ...drive,
141
- documentType: REACTOR_DRIVE_DOCUMENT_TYPE
142
- }, serverPort, logger);
143
- }
144
130
  //#endregion
145
- export { addDefaultReactorDrive as n, ensureDrive as r, addDefaultDrive as t };
131
+ export { ensureDrive as t };
146
132
 
147
- //# sourceMappingURL=utils-Cm0TE6dP.mjs.map
148
- //# debugId=aa01e979-2da2-5a91-8bd6-514c16afd3b2
133
+ //# sourceMappingURL=utils-D8yHRVjT.mjs.map
134
+ //# debugId=d9335116-1bb0-50b3-a551-d0d2a45628cb
@@ -1 +1 @@
1
- {"version":3,"file":"utils-Cm0TE6dP.mjs","sources":["../src/utils.mts"],"sourcesContent":["import type { IReactorClient } from \"@powerhousedao/reactor\";\nimport {\n REACTOR_DRIVE_DOCUMENT_TYPE,\n reactorDriveCreateState,\n} from \"@powerhousedao/reactor-drive\";\nimport {\n driveCreateState,\n driveDocumentType,\n} from \"@powerhousedao/shared/document-drive\";\nimport type { DriveInput } from \"@powerhousedao/shared/document-drive\";\nimport type {\n PHBaseState,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\nimport type {\n SwitchboardDriveDocumentType,\n SwitchboardDriveInput,\n} from \"./types.js\";\n\nconst isDriveDocumentType = (documentType: string): boolean =>\n documentType === driveDocumentType ||\n documentType === REACTOR_DRIVE_DOCUMENT_TYPE;\n\n/**\n * Only a legacy drive can take a chosen id; without one the client's creation\n * default applies.\n */\nfunction newDrive<TDocument extends PHDocument>(\n client: IReactorClient,\n documentType: string,\n initialState: Partial<PHBaseState>,\n id: string | undefined,\n): Promise<TDocument> {\n return client.newDocument<TDocument>(documentType, {\n initialState,\n ...(id ? { signaturePolicy: \"legacy\" as const, id } : {}),\n });\n}\n\ntype DefaultDriveLogger = { error: (message: string) => void };\n\n/** The document a slug names, unless someone deleted it and kept the slug. */\nasync function liveHolder(\n client: IReactorClient,\n id: string,\n): Promise<PHDocument | \"deleted\"> {\n let document: PHDocument;\n try {\n document = await client.get(id);\n } catch (error) {\n // A slug resolved to it, so it exists: which error depends on the host.\n const gone =\n error instanceof Error &&\n (error.name === \"DocumentDeletedError\" ||\n error.name === \"DocumentNotFoundError\");\n if (gone) return \"deleted\";\n throw error;\n }\n return document.state.document?.isDeleted ? \"deleted\" : document;\n}\n\n/** The document that already holds `slug`; null when two do (an id and a slug). */\nasync function slugHolder(\n client: IReactorClient,\n slug: string,\n): Promise<PHDocument | \"deleted\" | null | undefined> {\n let id: string;\n try {\n id = await client.resolveIdOrSlug(slug);\n } catch (error) {\n const notFound =\n error instanceof Error && error.name === \"DocumentNotFoundError\";\n return notFound ? undefined : null;\n }\n const holder = await liveHolder(client, id);\n // The slug matched a deleted document's id, which leaves the slug free.\n return holder === \"deleted\" && id === slug ? undefined : holder;\n}\n\nasync function existingDrive(\n client: IReactorClient,\n id: string,\n): Promise<PHDocument | undefined> {\n try {\n const document = await client.get(id);\n return document.state.document?.isDeleted ? undefined : document;\n } catch {\n return undefined;\n }\n}\n\nconst driveState = (\n drive: SwitchboardDriveInput,\n documentType: SwitchboardDriveDocumentType,\n): Partial<PHBaseState> => {\n if (documentType === REACTOR_DRIVE_DOCUMENT_TYPE) {\n const { global, local } = reactorDriveCreateState();\n return {\n global: {\n ...global,\n name: drive.global.name,\n icon: drive.global.icon ?? global.icon,\n },\n local: {\n ...local,\n availableOffline:\n drive.local?.availableOffline ?? local.availableOffline,\n sharingType: drive.local?.sharingType ?? local.sharingType,\n },\n } as Partial<PHBaseState>;\n }\n const { global } = driveCreateState();\n return {\n global: {\n ...global,\n name: drive.global.name,\n icon: drive.global.icon ?? global.icon,\n },\n local: {\n availableOffline: drive.local?.availableOffline ?? false,\n sharingType: drive.local?.sharingType ?? \"public\",\n listeners: drive.local?.listeners ?? [],\n triggers: drive.local?.triggers ?? [],\n },\n } as Partial<PHBaseState>;\n};\n\n/**\n * Makes sure the drive `drive.slug` names exists, and returns the URL it is\n * served at, or undefined when it could not be made (logged, so the server\n * still starts).\n *\n * The slug is the drive's name, and the only thing an existing drive is found\n * by: everything else is what a missing drive is created with, so a drive of\n * another type or id under that slug is left as it is. `drive.id` is found too,\n * for a drive declared by an id it already has. Without one the reactor\n * generates the id, so nothing here may rely on it equalling the slug.\n *\n * A deleted drive frees its slug, so the next call makes a new empty drive and\n * the slug names that one from then on. Its id stays taken, so a declared id\n * that a deleted drive holds gives way to a generated one. A delete with\n * `keepSlug` is someone deciding the drive is gone: the slug stays on it and\n * nothing is created.\n */\nexport async function ensureDrive(\n client: IReactorClient,\n drive: SwitchboardDriveInput,\n serverPort: number,\n logger: DefaultDriveLogger = console,\n): Promise<string | undefined> {\n if (!drive.slug && !drive.id) {\n throw new Error(\"A drive needs a slug\");\n }\n const documentType = drive.documentType ?? driveDocumentType;\n\n if (drive.slug) {\n const holder = await slugHolder(client, drive.slug);\n if (holder === \"deleted\") {\n logger.error(\n `The default drive \"${drive.slug}\" was not created: it was deleted, and its slug kept.`,\n );\n return undefined;\n }\n if (holder?.header && isDriveDocumentType(holder.header.documentType)) {\n return `http://localhost:${serverPort}/d/${holder.header.id}`;\n }\n if (holder !== undefined) {\n const owner = holder\n ? `${holder.header.documentType} document ${holder.header.id}`\n : \"two documents\";\n logger.error(\n `The default drive \"${drive.slug}\" was not created: the slug belongs to ${owner}.`,\n );\n return undefined;\n }\n }\n if (drive.id && (await existingDrive(client, drive.id))) {\n return `http://localhost:${serverPort}/d/${drive.id}`;\n }\n\n const document = await newDrive(\n client,\n documentType,\n driveState(drive, documentType),\n drive.id,\n );\n if (drive.slug) {\n document.header.slug = drive.slug;\n }\n if (drive.global.name) {\n document.header.name = drive.global.name;\n }\n if (drive.preferredEditor) {\n document.header.meta = { preferredEditor: drive.preferredEditor };\n }\n\n try {\n await (\n await client.write.create(document)\n ).readable;\n } catch (e) {\n const errorMessage = e instanceof Error ? e.message : String(e);\n if (!errorMessage.includes(\"already exists\")) {\n throw e;\n }\n if (drive.slug && drive.id && !(await existingDrive(client, drive.id))) {\n return ensureDrive(\n client,\n { ...drive, id: undefined },\n serverPort,\n logger,\n );\n }\n }\n\n return `http://localhost:${serverPort}/d/${drive.id || drive.slug}`;\n}\n\n/** @deprecated Use {@link ensureDrive}. */\nexport function addDefaultDrive(\n client: IReactorClient,\n drive: DriveInput,\n serverPort: number,\n logger: DefaultDriveLogger = console,\n): Promise<string | undefined> {\n return ensureDrive(\n client,\n { ...drive, documentType: driveDocumentType },\n serverPort,\n logger,\n );\n}\n\n/** @deprecated Use {@link ensureDrive} with `documentType`. */\nexport function addDefaultReactorDrive(\n client: IReactorClient,\n drive: DriveInput,\n serverPort: number,\n logger: DefaultDriveLogger = console,\n): Promise<string | undefined> {\n return ensureDrive(\n client,\n { ...drive, documentType: REACTOR_DRIVE_DOCUMENT_TYPE },\n serverPort,\n logger,\n );\n}\n\nexport { isPostgresUrl } from \"./postgres-url.mjs\";\n"],"names":[],"mappings":"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","debug_id":"aa01e979-2da2-5a91-8bd6-514c16afd3b2"}
1
+ {"version":3,"file":"utils-D8yHRVjT.mjs","sources":["../src/utils.mts"],"sourcesContent":["import type { IReactorClient } from \"@powerhousedao/reactor\";\nimport {\n REACTOR_DRIVE_DOCUMENT_TYPE,\n reactorDriveCreateState,\n} from \"@powerhousedao/reactor-drive\";\nimport {\n driveCreateState,\n driveDocumentType,\n} from \"@powerhousedao/shared/document-drive\";\nimport type { DriveInput } from \"@powerhousedao/shared/document-drive\";\nimport type {\n PHBaseState,\n PHDocument,\n} from \"@powerhousedao/shared/document-model\";\nimport type {\n SwitchboardDriveDocumentType,\n SwitchboardDriveInput,\n} from \"./types.js\";\n\nconst isDriveDocumentType = (documentType: string): boolean =>\n documentType === driveDocumentType ||\n documentType === REACTOR_DRIVE_DOCUMENT_TYPE;\n\n/**\n * Only a legacy drive can take a chosen id; without one the client's creation\n * default applies.\n */\nfunction newDrive<TDocument extends PHDocument>(\n client: IReactorClient,\n documentType: string,\n initialState: Partial<PHBaseState>,\n id: string | undefined,\n): Promise<TDocument> {\n return client.newDocument<TDocument>(documentType, {\n initialState,\n ...(id ? { signaturePolicy: \"legacy\" as const, id } : {}),\n });\n}\n\ntype DefaultDriveLogger = { error: (message: string) => void };\n\n/** The document a slug names, unless someone deleted it and kept the slug. */\nasync function liveHolder(\n client: IReactorClient,\n id: string,\n): Promise<PHDocument | \"deleted\"> {\n let document: PHDocument;\n try {\n document = await client.get(id);\n } catch (error) {\n // A slug resolved to it, so it exists: which error depends on the host.\n const gone =\n error instanceof Error &&\n (error.name === \"DocumentDeletedError\" ||\n error.name === \"DocumentNotFoundError\");\n if (gone) return \"deleted\";\n throw error;\n }\n return document.state.document?.isDeleted ? \"deleted\" : document;\n}\n\n/** The document that already holds `slug`; null when two do (an id and a slug). */\nasync function slugHolder(\n client: IReactorClient,\n slug: string,\n): Promise<PHDocument | \"deleted\" | null | undefined> {\n let id: string;\n try {\n id = await client.resolveIdOrSlug(slug);\n } catch (error) {\n const notFound =\n error instanceof Error && error.name === \"DocumentNotFoundError\";\n return notFound ? undefined : null;\n }\n const holder = await liveHolder(client, id);\n // The slug matched a deleted document's id, which leaves the slug free.\n return holder === \"deleted\" && id === slug ? undefined : holder;\n}\n\nasync function existingDrive(\n client: IReactorClient,\n id: string,\n): Promise<PHDocument | undefined> {\n try {\n const document = await client.get(id);\n return document.state.document?.isDeleted ? undefined : document;\n } catch {\n return undefined;\n }\n}\n\nconst driveState = (\n drive: SwitchboardDriveInput,\n documentType: SwitchboardDriveDocumentType,\n): Partial<PHBaseState> => {\n if (documentType === REACTOR_DRIVE_DOCUMENT_TYPE) {\n const { global, local } = reactorDriveCreateState();\n return {\n global: {\n ...global,\n name: drive.global.name,\n icon: drive.global.icon ?? global.icon,\n },\n local: {\n ...local,\n availableOffline:\n drive.local?.availableOffline ?? local.availableOffline,\n sharingType: drive.local?.sharingType ?? local.sharingType,\n },\n } as Partial<PHBaseState>;\n }\n const { global } = driveCreateState();\n return {\n global: {\n ...global,\n name: drive.global.name,\n icon: drive.global.icon ?? global.icon,\n },\n local: {\n availableOffline: drive.local?.availableOffline ?? false,\n sharingType: drive.local?.sharingType ?? \"public\",\n listeners: drive.local?.listeners ?? [],\n triggers: drive.local?.triggers ?? [],\n },\n } as Partial<PHBaseState>;\n};\n\n/**\n * Makes sure the drive `drive.slug` names exists, and returns the URL it is\n * served at, or undefined when it could not be made (logged, so the server\n * still starts).\n *\n * The slug is the drive's name, and the only thing an existing drive is found\n * by: everything else is what a missing drive is created with, so a drive of\n * another type or id under that slug is left as it is. `drive.id` is found too,\n * for a drive declared by an id it already has. Without one the reactor\n * generates the id, so nothing here may rely on it equalling the slug.\n *\n * A deleted drive frees its slug, so the next call makes a new empty drive and\n * the slug names that one from then on. Its id stays taken, so a declared id\n * that a deleted drive holds gives way to a generated one. A delete with\n * `keepSlug` is someone deciding the drive is gone: the slug stays on it and\n * nothing is created.\n */\nexport async function ensureDrive(\n client: IReactorClient,\n drive: SwitchboardDriveInput,\n serverPort: number,\n logger: DefaultDriveLogger = console,\n): Promise<string | undefined> {\n if (!drive.slug && !drive.id) {\n throw new Error(\"A drive needs a slug\");\n }\n const documentType = drive.documentType ?? driveDocumentType;\n\n if (drive.slug) {\n const holder = await slugHolder(client, drive.slug);\n if (holder === \"deleted\") {\n logger.error(\n `The default drive \"${drive.slug}\" was not created: it was deleted, and its slug kept.`,\n );\n return undefined;\n }\n if (holder?.header && isDriveDocumentType(holder.header.documentType)) {\n return `http://localhost:${serverPort}/d/${holder.header.id}`;\n }\n if (holder !== undefined) {\n const owner = holder\n ? `${holder.header.documentType} document ${holder.header.id}`\n : \"two documents\";\n logger.error(\n `The default drive \"${drive.slug}\" was not created: the slug belongs to ${owner}.`,\n );\n return undefined;\n }\n }\n if (drive.id && (await existingDrive(client, drive.id))) {\n return `http://localhost:${serverPort}/d/${drive.id}`;\n }\n\n const document = await newDrive(\n client,\n documentType,\n driveState(drive, documentType),\n drive.id,\n );\n if (drive.slug) {\n document.header.slug = drive.slug;\n }\n if (drive.global.name) {\n document.header.name = drive.global.name;\n }\n if (drive.preferredEditor) {\n document.header.meta = { preferredEditor: drive.preferredEditor };\n }\n\n try {\n await (\n await client.write.create(document)\n ).readable;\n } catch (e) {\n const errorMessage = e instanceof Error ? e.message : String(e);\n if (!errorMessage.includes(\"already exists\")) {\n throw e;\n }\n if (drive.slug && drive.id && !(await existingDrive(client, drive.id))) {\n return ensureDrive(\n client,\n { ...drive, id: undefined },\n serverPort,\n logger,\n );\n }\n }\n\n return `http://localhost:${serverPort}/d/${drive.id || drive.slug}`;\n}\n\nexport { isPostgresUrl } from \"./postgres-url.mjs\";\n"],"names":[],"mappings":"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","debug_id":"d9335116-1bb0-50b3-a551-d0d2a45628cb"}
package/dist/utils.d.mts CHANGED
@@ -1,6 +1,5 @@
1
- import { o as SwitchboardDriveInput } from "./types-Bk4T4D9F.mjs";
1
+ import { o as SwitchboardDriveInput } from "./types-D-QK3xhO.mjs";
2
2
  import { IReactorClient } from "@powerhousedao/reactor";
3
- import { DriveInput } from "@powerhousedao/shared/document-drive";
4
3
  //#region src/postgres-url.d.mts
5
4
  export declare function isPostgresUrl(url: string): boolean;
6
5
  //#endregion
@@ -26,10 +25,6 @@ type DefaultDriveLogger = {
26
25
  * nothing is created.
27
26
  */
28
27
  export declare function ensureDrive(client: IReactorClient, drive: SwitchboardDriveInput, serverPort: number, logger?: DefaultDriveLogger): Promise<string | undefined>;
29
- /** @deprecated Use {@link ensureDrive}. */
30
- export declare function addDefaultDrive(client: IReactorClient, drive: DriveInput, serverPort: number, logger?: DefaultDriveLogger): Promise<string | undefined>;
31
- /** @deprecated Use {@link ensureDrive} with `documentType`. */
32
- export declare function addDefaultReactorDrive(client: IReactorClient, drive: DriveInput, serverPort: number, logger?: DefaultDriveLogger): Promise<string | undefined>;
33
28
  //#endregion
34
29
  export {};
35
30
  //# sourceMappingURL=utils.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.mts","names":[],"sources":["../src/postgres-url.mts","../src/utils.mts"],"mappings":";;;;wBAAgB,cAAc;;;KCuCzB;EAAuB,QAAQ;;;;;;;;;;;;;;;;;;;wBAyGd,YACpB,QAAQ,gBACR,OAAO,uBACP,oBACA,SAAQ,qBACP;;wBAsEa,gBACd,QAAQ,gBACR,OAAO,YACP,oBACA,SAAQ,qBACP;;wBAUa,uBACd,QAAQ,gBACR,OAAO,YACP,oBACA,SAAQ,qBACP"}
1
+ {"version":3,"file":"utils.d.mts","names":[],"sources":["../src/postgres-url.mts","../src/utils.mts"],"mappings":";;;wBAAgB,cAAc;;;KCuCzB;EAAuB,QAAQ;;;;;;;;;;;;;;;;;;;wBAyGd,YACpB,QAAQ,gBACR,OAAO,uBACP,oBACA,SAAQ,qBACP"}
package/dist/utils.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as isPostgresUrl } from "./postgres-url-DTDhBjXX.mjs";
2
- import { n as addDefaultReactorDrive, r as ensureDrive, t as addDefaultDrive } from "./utils-Cm0TE6dP.mjs";
3
- export { addDefaultDrive, addDefaultReactorDrive, ensureDrive, isPostgresUrl };
4
- !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]="88a1492b-20ef-5063-8ee1-40e31754cbd9")}catch(e){}}();
5
- //# debugId=88a1492b-20ef-5063-8ee1-40e31754cbd9
2
+ import { t as ensureDrive } from "./utils-D8yHRVjT.mjs";
3
+ export { ensureDrive, isPostgresUrl };
4
+ !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]="5a6fb59d-80f9-5238-a590-ca8f859c487b")}catch(e){}}();
5
+ //# debugId=5a6fb59d-80f9-5238-a590-ca8f859c487b
@@ -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]="c9a4d238-312b-50e4-86c0-d888f00a2e3d")}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]="f2a3e20e-0c0c-5972-9d41-a38d1bb03eed")}catch(e){}}();
3
3
  import { REACTOR_SCHEMA, supportsLiveReadModelRegistration, withProgressHeartbeat } from "@powerhousedao/reactor";
4
4
  import { AuthorizationPolicy, BaseSubgraph, ForbiddenError, callerSubject, createCanonicalDocumentIdResolver } from "@powerhousedao/reactor-api";
5
5
  import { hostname } from "node:os";
@@ -1941,7 +1941,7 @@ function createWorkflowsPlugin(rawConfig = {}) {
1941
1941
  /** The default-config instance: the built-in composition's entry. */
1942
1942
  const workflowsPlugin = createWorkflowsPlugin({});
1943
1943
  //#endregion
1944
- export { triggerFatalShutdown as _, workflowsPlugin as a, WORKFLOW_TELEMETRY_SCOPE as c, isWorkflowSingletonConflict as d, modelManifestSource as f, raiseSigterm as g, installFatalErrorShutdown as h, workflowsDriveDeclaration as i, assertWorkflowPackageLoadable as l, workflowSingletonLossHandler as m, WORKFLOW_STUDIO_EDITOR_ID as n, workflowsPluginConfigSchema as o, retryWorkflowSingleton as p, createWorkflowsPlugin as r, WORKFLOW_PACKAGE_NAME as s, DEFAULT_WORKFLOWS_DRIVE as t, composeWorkflowRuntime as u };
1944
+ export { workflowsPlugin as a, WORKFLOW_TELEMETRY_SCOPE as c, modelManifestSource as d, workflowSingletonLossHandler as f, triggerFatalShutdown as h, workflowsDriveDeclaration as i, assertWorkflowPackageLoadable as l, raiseSigterm as m, WORKFLOW_STUDIO_EDITOR_ID as n, workflowsPluginConfigSchema as o, installFatalErrorShutdown as p, createWorkflowsPlugin as r, WORKFLOW_PACKAGE_NAME as s, DEFAULT_WORKFLOWS_DRIVE as t, composeWorkflowRuntime as u };
1945
1945
 
1946
- //# sourceMappingURL=workflows-mdYUh3Us.mjs.map
1947
- //# debugId=c9a4d238-312b-50e4-86c0-d888f00a2e3d
1946
+ //# sourceMappingURL=workflows-D2r6IKou.mjs.map
1947
+ //# debugId=f2a3e20e-0c0c-5972-9d41-a38d1bb03eed