@powerhousedao/shared 6.2.3-dev.70 → 6.2.3-dev.71

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 (80) hide show
  1. package/dist/clis/args/common-BXabdhiO.mjs.map +1 -1
  2. package/dist/clis/args/{connect-BG3HkYBk.mjs → connect-BLAht4dO.mjs} +2 -2
  3. package/dist/clis/args/connect-BLAht4dO.mjs.map +1 -0
  4. package/dist/clis/args/connect.mjs +1 -1
  5. package/dist/clis/args/{help-BfAqpYvC.mjs → help-Dejwe6Bz.mjs} +3 -3
  6. package/dist/clis/args/{help-BfAqpYvC.mjs.map → help-Dejwe6Bz.mjs.map} +1 -1
  7. package/dist/clis/args/help.mjs +1 -1
  8. package/dist/clis/args/index.d.mts +1 -1
  9. package/dist/clis/args/index.mjs +2 -2
  10. package/dist/clis/args/{run-CYp5t1xU.mjs → run-l_LiMplO.mjs} +2 -2
  11. package/dist/clis/args/{run-CYp5t1xU.mjs.map → run-l_LiMplO.mjs.map} +1 -1
  12. package/dist/clis/args/run.mjs +1 -1
  13. package/dist/clis/args/{service-CHjY5epu.d.mts → service-DiTFThbn.d.mts} +2 -2
  14. package/dist/clis/args/service-DiTFThbn.d.mts.map +1 -0
  15. package/dist/clis/args/service.d.mts +1 -1
  16. package/dist/clis/{build-config-DwRi23zQ.mjs → build-config-tJhHVdPm.mjs} +17 -2
  17. package/dist/clis/{build-config-DwRi23zQ.mjs.map → build-config-tJhHVdPm.mjs.map} +1 -1
  18. package/dist/clis/build-config.d.mts +1 -0
  19. package/dist/clis/build-config.d.mts.map +1 -1
  20. package/dist/clis/build-config.mjs +2 -2
  21. package/dist/clis/build-pieces.d.mts +1 -1
  22. package/dist/clis/build-pieces.mjs +1 -1
  23. package/dist/clis/constants.d.mts +1 -1
  24. package/dist/clis/constants.mjs +2 -1
  25. package/dist/clis/constants.mjs.map +1 -1
  26. package/dist/clis/index.d.mts +2059 -889
  27. package/dist/clis/index.d.mts.map +1 -1
  28. package/dist/clis/index.mjs +431 -585
  29. package/dist/clis/index.mjs.map +1 -1
  30. package/dist/clis/rolldown-runtime-B4iAMlE-.mjs +35 -0
  31. package/dist/clis/types-DT6KawYx.d.mts +2317 -0
  32. package/dist/clis/types-DT6KawYx.d.mts.map +1 -0
  33. package/dist/{config-loader-DBJolZd0.js → config-loader-BWt0c0eU.js} +6 -3
  34. package/dist/config-loader-BWt0c0eU.js.map +1 -0
  35. package/dist/connect/config-loader.d.ts +1 -1
  36. package/dist/connect/config-loader.js +1 -1
  37. package/dist/connect/connect-config-schema.d.ts +3 -0
  38. package/dist/connect/connect-config-schema.js +445 -0
  39. package/dist/connect/connect-config-schema.js.map +1 -0
  40. package/dist/connect/image-ref.d.ts +32 -0
  41. package/dist/connect/image-ref.d.ts.map +1 -0
  42. package/dist/connect/image-ref.js +80 -0
  43. package/dist/connect/image-ref.js.map +1 -0
  44. package/dist/connect/index.d.ts +60 -641
  45. package/dist/connect/index.d.ts.map +1 -1
  46. package/dist/connect/index.js +175 -560
  47. package/dist/connect/index.js.map +1 -1
  48. package/dist/connect-config-schema-1-O1CQ4v.d.ts +1731 -0
  49. package/dist/connect-config-schema-1-O1CQ4v.d.ts.map +1 -0
  50. package/dist/document-drive/index.d.ts +3 -3
  51. package/dist/document-drive/index.js +1 -12
  52. package/dist/document-drive/index.js.map +1 -1
  53. package/dist/document-model/errors.d.ts +1 -1
  54. package/dist/document-model/index.d.ts +1 -1
  55. package/dist/document-model/index.js.map +1 -1
  56. package/dist/host-tokens/index.d.ts +3 -0
  57. package/dist/host-tokens/index.js +278 -0
  58. package/dist/host-tokens/index.js.map +1 -0
  59. package/dist/index-DIM6qtzj.d.ts +227 -0
  60. package/dist/index-DIM6qtzj.d.ts.map +1 -0
  61. package/dist/{index-DeEVCeve.d.ts → index-DvbhwImT.d.ts} +2 -2
  62. package/dist/{index-DeEVCeve.d.ts.map → index-DvbhwImT.d.ts.map} +1 -1
  63. package/dist/index.d.ts +4 -4
  64. package/dist/processors/index.d.ts +1 -1
  65. package/dist/registry/index.d.ts +2 -2
  66. package/dist/registry/index.js +1 -1
  67. package/dist/registry/index.js.map +1 -1
  68. package/dist/registry/manifest-slim.d.ts +2 -2
  69. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  70. package/dist/{types-PM0i4vns.d.ts → types-BpO4LIKj.d.ts} +180 -255
  71. package/dist/types-BpO4LIKj.d.ts.map +1 -0
  72. package/dist/{types-f_wMStgZ.d.ts → types-OXIqeH8W.d.ts} +2 -2
  73. package/dist/{types-f_wMStgZ.d.ts.map → types-OXIqeH8W.d.ts.map} +1 -1
  74. package/package.json +5 -1
  75. package/dist/clis/args/connect-BG3HkYBk.mjs.map +0 -1
  76. package/dist/clis/args/service-CHjY5epu.d.mts.map +0 -1
  77. package/dist/clis/types-BxOUzRvH.d.mts +0 -588
  78. package/dist/clis/types-BxOUzRvH.d.mts.map +0 -1
  79. package/dist/config-loader-DBJolZd0.js.map +0 -1
  80. package/dist/types-PM0i4vns.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DT6KawYx.d.mts","names":[],"sources":["../../host-tokens/index.ts","../../connect/connect-config-schema.ts","../../clis/constants.ts","../../clis/types.ts","../../document-model/schemas.ts","../../document-model/types.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;KAeY;;;UAWK,YAAY;EAC3B;IAAW;IAAc;IAAiB,MAAM;;WACvC,WAAW;;;UAIL;EACf,4BAA4B;;;;UAKb,UAAU;EACzB,OAAO;IAAe;IAAY,MAAM;;WAC/B,WAAW;;;UAIL;EACf;;;;;UAMe,SAAS;EACxB;IACE,MAAM,cAAc;IACpB;IACA,IAAI;IACJ;;;;UAKa;EACf;IAAiB;IAAc;;;KAGrB,QACR,cACA,cACA,WACA,YACA,WACA;;;KAoBC,UAAU,KAAK,QAAQ,GAAG;;;KAI1B;;KAGA,YACD,kCACA;;KAEC,aACD,YAAY,SAAS,4BACrB,UAAU,SAAS;;;;;;;;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BAAuB,EAAE,cAAc;;;cC/2BtC;cAQA;cACA;cACA;cAEA;cAKA;cAQA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAqBA;cACA;cACA;cACA;;;;;;;;;;;;cAaA;cAGA;cAEA;cACA;cACA;cACA;cAEA;cAEA;cAEA;cAGA;cAOA;cACA;cAEA;cACA;cACA;cAQA;;aACU;aAAa;;;aACT;aAAY;;;aAC5B;aAAa;;;aACP;aAAa;;;aACrB;aAAY;;;cAKR;;aAET;aACA;aACA;;;aAKA;aACA;aACA;;;cAWS;cAUA;cAiBA;WACC;WACN;WACI;;cAGC;cAkBA;WACX;aACE;aACA;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;;WAGF;aACE;;WAEF;aACE;aACA;aACA;;WAKF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA;;cAGW;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WAEA;;cAIW;cAIA;cAcA;cAwBA;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;cAGW,iBAAiB;cAuBjB,gBAAgB;;;KC/VjB,mBAAmB;KACnB,WAAW;KAOX;KAGA;EACV;EACA;EACA,WAAW;EACX;;;;KAgHU,yBAAyB,EAAE,aAC9B;;KAIG;;;EAGV;;EAEA;;EAEA;;KAGU;EAEV,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;IACE;IACA;MAIM;MACA;;IAEN;MACE;MACA;MACA;;;EAGJ;IACE;IACA;IACA,SAAS;;EAEX;IACE;MACE;;IAEF;;EAEF;IACE;IACA;IACA;IACA;;EAEF,WAAW;EACX;IACE;IACA;IACA;;EAGF;IACE;;EAIF;IACE;;EAEF;EACA,UAAU;;;;cCkoBC,gBAAc,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuBzB,EAAA,KAAA;;;KCg3BU,WAAW,EAAE,aAAa"}
@@ -5,8 +5,10 @@ import { isPlainObject } from "remeda";
5
5
  const DEFAULT_CONNECT_CONFIG = {
6
6
  branding: {
7
7
  appName: "Powerhouse Connect",
8
- homeBackground: null
8
+ icon: null,
9
+ loader: null
9
10
  },
11
+ home: { background: null },
10
12
  app: {
11
13
  logLevel: "info",
12
14
  basePath: "/",
@@ -32,7 +34,8 @@ const DEFAULT_CONNECT_CONFIG = {
32
34
  allowAdd: true,
33
35
  allowDelete: true
34
36
  }
35
- }
37
+ },
38
+ icons: null
36
39
  },
37
40
  renown: {
38
41
  url: "https://www.renown.id",
@@ -178,4 +181,4 @@ var ConfigLoader = class {
178
181
  //#endregion
179
182
  export { DEFAULT_CONNECT_CONFIG as a, workflowsSettingConflict as i, deepMerge as n, buildRuntimeConfig as o, resolveSourceConnect as r, ConfigLoader as t };
180
183
 
181
- //# sourceMappingURL=config-loader-DBJolZd0.js.map
184
+ //# sourceMappingURL=config-loader-BWt0c0eU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-loader-BWt0c0eU.js","names":[],"sources":["../connect/runtime-config.ts","../connect/config-loader.ts"],"sourcesContent":["import type {\n PHConnectRuntimeConfig,\n PowerhouseConfig,\n PowerhousePackage,\n} from \"../clis/types.js\";\n\nexport type RuntimePowerhouseConfig = {\n schemaVersion: 2;\n packages: PowerhousePackage[];\n packageRegistryUrl?: string;\n localPackage: { name: string; version: string } | null;\n connect: PHConnectRuntimeConfig;\n};\n\n/** Defaults for every field Connect reads at runtime, merged into the\n * `connect.*` block at boot; also the dist emitter's and the scaffold's base. */\nexport const DEFAULT_CONNECT_CONFIG: PHConnectRuntimeConfig = {\n // null = the default; the scaffold lists every branding field this way.\n branding: {\n appName: \"Powerhouse Connect\",\n icon: null,\n loader: null,\n },\n // The generic plugin's (its entry `homeBackground`); null = the bundled\n // gradient.\n home: {\n background: null,\n },\n app: {\n logLevel: \"info\",\n basePath: \"/\",\n offline: true,\n studioMode: false,\n },\n ai: {\n assistantEnabled: false,\n },\n packages: {\n externalEnabled: true,\n liveReload: false,\n },\n drives: {\n allowAddDrive: true,\n defaultDrives: [],\n sections: {\n remote: { enabled: true, allowAdd: true, allowDelete: true },\n local: { enabled: true, allowAdd: true, allowDelete: true },\n },\n // The explorer's icons: the generic plugin's; null = the built-in icons.\n icons: null,\n },\n renown: {\n url: \"https://www.renown.id\",\n networkId: \"eip155\",\n chainId: 1,\n },\n sentry: {\n // `dsn: null` is the disabled-Sentry state — the SPA never loads the\n // Sentry SDK chunk. Override via `ph connect config --sentry-dsn ...`\n // or by including `connect.sentry.dsn` in PH_CONNECT_CONFIG_JSON.\n dsn: null,\n env: \"dev\",\n tracing: false,\n },\n openPanel: {\n // An empty `clientId` keeps OpenPanel disabled. Enable it per deploy by\n // including `connect.openPanel.clientId` in PH_CONNECT_CONFIG_JSON.\n // `apiUrl` has no default: unset means OpenPanel's hosted API.\n clientId: \"\",\n trackUiEvents: true,\n trackOperations: true,\n },\n instance: {\n namespace: null,\n reactorWorker: false,\n multiReactor: false,\n },\n reactor: {\n featureFlags: {\n documentDecisions: false,\n authEnforcement: false,\n authGroups: false,\n authConditions: false,\n },\n createSignaturePolicy: \"v2-required\",\n unsupportedStoredDocuments: \"refuse\",\n },\n};\n\nexport function buildRuntimeConfig(\n source: Pick<PowerhouseConfig, \"packages\" | \"connect\" | \"packageRegistryUrl\">,\n projectInfo: { name: string; version: string } | null,\n): RuntimePowerhouseConfig {\n const result: RuntimePowerhouseConfig = {\n schemaVersion: 2,\n packages: source.packages ?? [],\n localPackage: projectInfo,\n connect: source.connect ?? {},\n };\n if (\n typeof source.packageRegistryUrl === \"string\" &&\n source.packageRegistryUrl !== \"\"\n ) {\n result.packageRegistryUrl = source.packageRegistryUrl;\n }\n return result;\n}\n","// Environment-neutral config loader. Wraps a `ConfigAdapter` (the IO layer)\n// with in-process caching and deep-merge-with-defaults reads.\n//\n// No validation. The loader trusts that whatever bytes the adapter returns\n// can be merged into the default Connect config; missing or partial fields\n// fall back to DEFAULT_CONNECT_CONFIG, so the SPA always sees a complete\n// `connect.*` block.\n//\n// Top-level fields outside `connect.*` (e.g. `studio.port` in the source\n// powerhouse.config.json) pass through untouched on both read and write.\n// They're not Connect's concern, but a write-back round-trip preserves\n// them so editing tools don't accidentally drop them.\n\nimport { isPlainObject } from \"remeda\";\nimport type {\n PHConnectRuntimeConfig,\n PowerhouseConfig,\n} from \"../clis/types.js\";\nimport { DEFAULT_CONNECT_CONFIG } from \"./runtime-config.js\";\n\n/** Recursive Partial. Arrays are leaves — `write({ packages: [...] })`\n * replaces the array, it doesn't merge. */\nexport type DeepPartial<T> =\n T extends Array<infer U>\n ? Array<U>\n : T extends object\n ? { [K in keyof T]?: DeepPartial<T[K]> }\n : T;\n\n/**\n * Shape returned by `ConfigLoader.read()`. The loader is Connect-scoped:\n * it guarantees `connect` is present and fully populated from\n * DEFAULT_CONNECT_CONFIG, but lets any other top-level fields pass\n * through unchanged so source-config-only fields (studio, reactor, auth,\n * documentModelsDir, etc.) survive a read+write round-trip.\n */\nexport type ConfigShape = Record<string, unknown> & {\n connect: PHConnectRuntimeConfig;\n};\n\n/**\n * Abstract IO layer for `powerhouse.config.json`.\n *\n * Implementations decide where bytes come from and go to. The shipped\n * adapter is `JsonConfigAdapter` (reads via fetch in the browser, fs in\n * Node; writes via fs in Node, throws in the browser). Future adapters\n * (remote-JSON, GraphQL) plug in without changing the loader or any\n * consumer.\n */\nexport interface ConfigAdapter {\n /** Read raw JSON-parsed payload from the backing store. */\n read(): Promise<unknown>;\n /** Persist a fully-formed config. */\n write(next: ConfigShape): Promise<void>;\n /** Human-readable description used in errors and logs. */\n readonly source: string;\n}\n\n/**\n * Deep-merge `patch` into `base`. Object fields recurse; arrays and\n * primitives replace. `undefined` in patch leaves the base value\n * untouched (no unset). `null` in patch overwrites with null.\n *\n * Exported for unit tests; consumers use ConfigLoader.write() which\n * applies this internally.\n */\nexport function deepMerge<T>(base: T, patch: DeepPartial<T>): T {\n if (!isPlainObject(base) || !isPlainObject(patch)) {\n return patch as T;\n }\n const result: Record<string, unknown> = { ...base };\n for (const [key, patchValue] of Object.entries(patch)) {\n if (patchValue === undefined) continue;\n const baseValue = result[key];\n if (isPlainObject(baseValue) && isPlainObject(patchValue)) {\n result[key] = deepMerge(\n baseValue,\n patchValue as DeepPartial<typeof baseValue>,\n );\n } else {\n result[key] = patchValue;\n }\n }\n return result as T;\n}\n\n/**\n * The effective `connect.*` block of a source `powerhouse.config.json`:\n * defaults < project-wide settings Connect follows < `connect.*`. So\n * `connect.app.workflowsEnabled` falls back to `workflows.enabled`, and\n * wins when set.\n */\nexport function resolveSourceConnect(\n source: Pick<PowerhouseConfig, \"connect\" | \"workflows\">,\n defaults: PHConnectRuntimeConfig = DEFAULT_CONNECT_CONFIG,\n): PHConnectRuntimeConfig {\n const projectWide = deepMerge(defaults, {\n app: { workflowsEnabled: source.workflows?.enabled },\n });\n return deepMerge(projectWide, source.connect ?? {});\n}\n\n// Projects scaffolded before workflows.enabled reached Connect carry an explicit\n// `false` from the old defaults, which then keeps Workflow Studio off\nexport function workflowsSettingConflict(\n source: Pick<PowerhouseConfig, \"connect\" | \"workflows\">,\n): string | undefined {\n if (source.workflows?.enabled !== true) return undefined;\n if (source.connect?.app?.workflowsEnabled !== false) return undefined;\n return 'powerhouse.config.json sets workflows.enabled but also connect.app.workflowsEnabled: false, so Workflow Studio stays off in Connect. Remove \"workflowsEnabled\" from connect.app to follow workflows.enabled.';\n}\n\n/**\n * Pluggable loader on top of a `ConfigAdapter`.\n *\n * Responsibilities:\n * - merge-with-defaults on read (so consumers never see a partial connect block)\n * - in-process caching (call `invalidate()` to force re-read)\n * - deep-merge for partial writes; writes the merged whole back through the adapter\n *\n * The cache is module-instance scoped — every `new ConfigLoader(...)` has\n * its own cache. The browser SPA constructs the loader once at boot; the\n * CLI typically constructs a fresh loader per command.\n */\nexport class ConfigLoader {\n private cache: ConfigShape | undefined;\n\n constructor(\n private readonly adapter: ConfigAdapter,\n private readonly defaults: PHConnectRuntimeConfig = DEFAULT_CONNECT_CONFIG,\n ) {}\n\n /** Returns the config with the default connect block merged in.\n * Cached after the first successful call. */\n async read(): Promise<ConfigShape> {\n if (this.cache) return this.cache;\n const raw = await this.adapter.read();\n const obj = isPlainObject(raw) ? raw : {};\n const connectRaw = isPlainObject(obj.connect) ? obj.connect : {};\n this.cache = {\n ...obj,\n connect: deepMerge(\n this.defaults,\n connectRaw as DeepPartial<PHConnectRuntimeConfig>,\n ),\n };\n return this.cache;\n }\n\n /**\n * Replace the cached config — used by the plugin pipeline (rewire R3) to\n * install the composition-transformed config so every later getCached()\n * reader sees it. Call only during boot, before the app graph imports.\n */\n prime(config: ConfigShape): void {\n this.cache = config;\n }\n\n /**\n * Returns the cached config synchronously. Throws if `read()` has not\n * resolved yet — matches Connect's `getRuntimeConfig()` shape.\n */\n getCached(): ConfigShape {\n if (!this.cache) {\n throw new Error(\n `ConfigLoader (${this.adapter.source}): cache empty; call read() first.`,\n );\n }\n return this.cache;\n }\n\n /** Drop the in-memory cache. Next `read()` re-fetches from the adapter. */\n invalidate(): void {\n this.cache = undefined;\n }\n\n /**\n * Deep-merge `patch` into the current config and persist via the adapter.\n * Returns the new full config (also updates the cache). Arrays in `patch`\n * replace — they do NOT append.\n */\n async write(patch: DeepPartial<ConfigShape>): Promise<ConfigShape> {\n const current = await this.read();\n const next = deepMerge(current, patch);\n await this.adapter.write(next);\n this.cache = next;\n return next;\n }\n}\n"],"mappings":";;;;AAgBA,MAAa,yBAAiD;CAE5D,UAAU;EACR,SAAS;EACT,MAAM;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ConnectRuntimeConfig, z as PowerhouseConfig } from "../types-PM0i4vns.js";
1
+ import { F as PHConnectRuntimeConfig, X as PowerhouseConfig } from "../types-BpO4LIKj.js";
2
2
  //#region connect/config-loader.d.ts
3
3
  /** Recursive Partial. Arrays are leaves — `write({ packages: [...] })`
4
4
  * replaces the array, it doesn't merge. */
@@ -1,2 +1,2 @@
1
- import { i as workflowsSettingConflict, n as deepMerge, r as resolveSourceConnect, t as ConfigLoader } from "../config-loader-DBJolZd0.js";
1
+ import { i as workflowsSettingConflict, n as deepMerge, r as resolveSourceConnect, t as ConfigLoader } from "../config-loader-BWt0c0eU.js";
2
2
  export { ConfigLoader, deepMerge, resolveSourceConnect, workflowsSettingConflict };
@@ -0,0 +1,3 @@
1
+ import { A as connectPwaCacheStrategySchema, B as connectRenownAdaptersSchema, C as connectHomeSchema, D as connectLoaderSchema, E as connectLengthSchema, F as connectPwaSchema, G as connectRuntimeInstanceSchema, H as connectRenownRainbowAdapterSchema, I as connectPwaUrlPatternSchema, J as connectSchemedColorSchema, K as connectRuntimePwaManifestSchema, L as connectReactorClientModeSchema, M as connectPwaIconSchema, N as connectPwaManifestSchema, O as connectOpenPanelSchema, P as connectPwaRuntimeCachingSchema, Q as declaredConnectConfigSchema, R as connectReactorFeatureFlagsSchema, S as connectExplorerIconsSchema, T as connectInstanceSchema, U as connectRenownSchema, V as connectRenownPrivyAdapterSchema, W as connectRuntimeConfigSchema, X as connectSentrySchema, Y as connectSchemedImageSchema, _ as connectDrivePreserveStrategySchema, a as connectAiSchema, b as connectDrivesSchema, c as connectBackgroundLayersSchema, d as connectCompositionEntrySchema, f as connectConfigSchema, g as connectDefaultDriveSchema, h as connectDefaultDriveRemoteSchema, i as DeclaredConnectConfigInput, j as connectPwaFileHandlerSchema, k as connectPackagesSchema, l as connectBackgroundSchema, m as connectDefaultDriveLocalSchema, n as ConnectConfigInput, o as connectAppSchema, p as connectConfigSchemaWith, q as connectRuntimePwaSchema, r as ConnectRuntimeConfig, s as connectBackgroundLayerSchema, t as ConnectConfig, u as connectBrandingSchema, v as connectDriveSectionSchema, w as connectImageRefSchema, x as connectEdgesSchema, y as connectDriveSectionsSchema, z as connectReactorSchema } from "../connect-config-schema-1-O1CQ4v.js";
2
+ export { ConnectConfig, ConnectConfigInput, ConnectRuntimeConfig, DeclaredConnectConfigInput, connectAiSchema, connectAppSchema, connectBackgroundLayerSchema, connectBackgroundLayersSchema, connectBackgroundSchema, connectBrandingSchema, connectCompositionEntrySchema, connectConfigSchema, connectConfigSchemaWith, connectDefaultDriveLocalSchema, connectDefaultDriveRemoteSchema, connectDefaultDriveSchema, connectDrivePreserveStrategySchema, connectDriveSectionSchema, connectDriveSectionsSchema, connectDrivesSchema, connectEdgesSchema, connectExplorerIconsSchema, connectHomeSchema, connectImageRefSchema, connectInstanceSchema, connectLengthSchema, connectLoaderSchema, connectOpenPanelSchema, connectPackagesSchema, connectPwaCacheStrategySchema, connectPwaFileHandlerSchema, connectPwaIconSchema, connectPwaManifestSchema, connectPwaRuntimeCachingSchema, connectPwaSchema, connectPwaUrlPatternSchema, connectReactorClientModeSchema, connectReactorFeatureFlagsSchema, connectReactorSchema, connectRenownAdaptersSchema, connectRenownPrivyAdapterSchema, connectRenownRainbowAdapterSchema, connectRenownSchema, connectRuntimeConfigSchema, connectRuntimeInstanceSchema, connectRuntimePwaManifestSchema, connectRuntimePwaSchema, connectSchemedColorSchema, connectSchemedImageSchema, connectSentrySchema, declaredConnectConfigSchema };
3
+ export {};
@@ -0,0 +1,445 @@
1
+ import { tokenable } from "../host-tokens/index.js";
2
+ import { z } from "zod";
3
+ //#region connect/connect-config-schema.ts
4
+ const IMAGE_REF = "Image reference: a project-relative file path, a URL, or a data URI.";
5
+ const IMAGE_REF_OR_DEFAULT = "Image reference: a project-relative file path (resolved by the Connect build), a URL, or a data URI. null keeps the default.";
6
+ /** An image reference: a project-relative file path (the Connect build turns
7
+ * it into a data URI or an emitted file), a URL, or a data URI. */
8
+ const connectImageRefSchema = z.string().describe(IMAGE_REF);
9
+ /** An image reference where `null` (or omitting it) keeps the default. */
10
+ const optionalImageRef = (description = IMAGE_REF_OR_DEFAULT) => connectImageRefSchema.nullable().optional().describe(description);
11
+ /** An image per colour scheme: one reference for both, or `{ light, dark }`
12
+ * (`dark` falls back to `light`). */
13
+ const connectSchemedImageSchema = z.union([connectImageRefSchema, z.strictObject({
14
+ light: connectImageRefSchema,
15
+ dark: connectImageRefSchema.nullable().optional()
16
+ })]).describe("One image for both colour schemes, or { light, dark } (dark falls back to light).");
17
+ /** A CSS colour per colour scheme (`dark` falls back to `light`). */
18
+ const connectSchemedColorSchema = z.union([z.string(), z.strictObject({
19
+ light: z.string(),
20
+ dark: z.string().nullable().optional()
21
+ })]);
22
+ /** A CSS length: a number is px, a string is passed through as written. */
23
+ const connectLengthSchema = z.union([z.number(), z.string()]);
24
+ const optionalLength = () => connectLengthSchema.nullable().optional().describe("A CSS length: a number is px; a string is used as written (\"40%\", \"min(55%, 880px)\", \"calc(50% - 120px)\").");
25
+ /** Distances to the four edges; each is optional. */
26
+ const connectEdgesSchema = z.strictObject({
27
+ top: optionalLength(),
28
+ right: optionalLength(),
29
+ bottom: optionalLength(),
30
+ left: optionalLength()
31
+ });
32
+ /** One image of a decorated pane, absolutely positioned inside it. */
33
+ const connectBackgroundLayerSchema = z.strictObject({
34
+ src: connectSchemedImageSchema,
35
+ position: connectEdgesSchema.nullable().optional().describe("Distances to the pane's edges; at most one per axis. Omitted: centred both ways."),
36
+ width: optionalLength(),
37
+ height: optionalLength(),
38
+ minWidth: optionalLength(),
39
+ minHeight: optionalLength(),
40
+ maxWidth: optionalLength(),
41
+ maxHeight: optionalLength(),
42
+ opacity: z.number().min(0).max(1).nullable().optional().describe("0 to 1 (default 1)."),
43
+ fade: connectEdgesSchema.nullable().optional().describe("Feather depth per edge, fading the layer into the page colour.")
44
+ }).describe("An image laid over the page, absolutely positioned: the edges set in `position` pin it, an axis with neither edge set is centred.");
45
+ /** A decorated pane: the page colour and the images laid over it. */
46
+ const connectBackgroundLayersSchema = z.strictObject({
47
+ color: connectSchemedColorSchema.nullable().optional().describe("The page colour, or { light, dark }. Omitted or null: the theme's page background."),
48
+ layers: z.array(connectBackgroundLayerSchema).describe("Painted in order; the first is at the back.")
49
+ });
50
+ /** A pane's background: layers over a page colour, or one image as
51
+ * shorthand for a single layer pinned bottom-right. */
52
+ const connectBackgroundSchema = z.union([connectImageRefSchema, connectBackgroundLayersSchema]).describe("Layered images over a page colour, or a single image pinned to the bottom-right corner. null keeps the default.");
53
+ /** The loading image and the motion applied to it. */
54
+ const connectLoaderSchema = z.strictObject({
55
+ src: connectImageRefSchema,
56
+ animation: z.enum([
57
+ "pulse",
58
+ "spin",
59
+ "none"
60
+ ]).nullable().optional().describe("Motion applied to the image (default pulse)."),
61
+ size: z.number().min(16).max(512).nullable().optional().describe("Rendered width in CSS pixels (default 96); the height follows the image.")
62
+ });
63
+ /** `connect.branding`: Connect's identity and look. */
64
+ const connectBrandingSchema = z.strictObject({
65
+ appName: z.string().nullable().optional().describe("Browser tab title, installed-app name and in-app brand text. null or omitted: 'Powerhouse Connect'."),
66
+ icon: optionalImageRef("App icon master (1024x1024 PNG recommended, or an SVG). The favicons and installed-app icons are found next to it as <name>_16x16.png, _32x32, _64x64, _192x192 and _512x512; the 64 px one is the in-app logo. null or omitted: Connect's icon."),
67
+ favicon: z.string().nullable().optional().describe("The browser tab icon: a file (.ico, .svg or .png) relative to the project, served and built as icon.ico. A build input; the built runtime config leaves it out. `ph connect build --favicon` wins over it."),
68
+ loader: z.union([connectImageRefSchema, connectLoaderSchema]).nullable().optional().describe("The loading image (first paint, app start, drive and editor loading). A path gets a gentle pulse; { src, animation, size } says otherwise, with animation \"none\" for an image that animates itself (animated SVG, GIF or WebP). null or omitted: Connect's animated logo.")
69
+ }).describe("App identity and visual branding. Every field is optional; null means the default.");
70
+ /** `connect.home`: the home screen (the generic chrome's landing page). */
71
+ const connectHomeSchema = z.strictObject({ background: connectBackgroundSchema.nullable().optional().describe("The home screen's background: { color, layers } with each image positioned and sized, or one image pinned bottom-right. null or omitted: the bundled gradient.") }).describe("The home screen (the generic chrome's landing page).");
72
+ const connectAppSchema = z.strictObject({
73
+ logLevel: z.enum([
74
+ "debug",
75
+ "info",
76
+ "warn",
77
+ "error"
78
+ ]).optional().meta({
79
+ description: "Log level applied by Connect's logger at boot. Affects browser-side output only.",
80
+ default: "info"
81
+ }),
82
+ basePath: z.string().optional().meta({
83
+ description: "Base path Connect is mounted under (e.g. '/connect' for subpath deploys). Normalised at runtime to start and end with '/'. Defaults to the build-time BASE_URL.",
84
+ default: "/"
85
+ }),
86
+ offline: z.boolean().optional().meta({
87
+ description: "When true (default), the build emits a precaching service worker so Connect's app shell works offline, and the SPA registers it at boot. Set false to opt this deployment out: no service worker is built, the SPA skips registration, and any previously-installed worker is unregistered.",
88
+ default: true
89
+ }),
90
+ studioMode: z.boolean().optional().meta({
91
+ description: "Studio mode. Enables builder-only capabilities: Connect loads the vetra package and exposes DocumentModel (and vetra spec types) as creatable documents. Forced on by `ph vetra` / `ph connect studio`; false by default.",
92
+ default: false
93
+ }),
94
+ workflowsEnabled: z.boolean().optional().describe("Powerhouse workflows in Connect. When true the tab loads the @powerhousedao/workflow package (workflow + connection documents, their editors and Workflow Studio) and the reactor worker registers its document models. Falls back to the top-level `workflows.enabled`; set it to override that for Connect. Independent of studioMode. False when neither is set.")
95
+ }).describe("Top-level Connect application behaviour.");
96
+ const connectAiSchema = z.strictObject({ assistantEnabled: z.boolean().optional().meta({
97
+ description: "When true, Connect mounts the in-browser AI assistant (bottom-right chat FAB that talks to a user-configured OpenAI-compatible endpoint and acts on the reactor). Disabled by default.",
98
+ default: false
99
+ }) }).describe("AI assistant (chat) behaviour.");
100
+ const connectPackagesSchema = z.strictObject({
101
+ externalEnabled: z.boolean().optional().meta({
102
+ description: "When false, Connect refuses to load any package that wasn't bundled at build time. Affirmative replacement for the legacy PH_CONNECT_EXTERNAL_PACKAGES_DISABLED env var.",
103
+ default: true
104
+ }),
105
+ liveReload: z.boolean().optional().meta({
106
+ description: "When true, Connect subscribes to the static-mode `/__packages` SSE channel so live publishes flow into the running tab without a page reload. Only works under hosting that serves this channel (e.g. ph-clint static mode).",
107
+ default: false
108
+ })
109
+ }).describe("Runtime behaviour for the Connect package manager (separate from top-level `packages[]`, which lists which packages to load).");
110
+ const EXPLORER_ICONS_DESCRIPTION = "The drive explorer's icons (the generic plugin's); each null keeps the built-in icon.";
111
+ /** The drive explorer's icons: the generic chrome's, owned by the generic
112
+ * plugin. Each `null` keeps the built-in icon. */
113
+ const connectExplorerIconsSchema = z.strictObject({
114
+ localDrive: optionalImageRef("Local drives without an icon of their own."),
115
+ remoteDrive: optionalImageRef("Remote drives without an icon of their own."),
116
+ folder: optionalImageRef("Folders."),
117
+ document: optionalImageRef("Documents whose type has no icon in `documents`."),
118
+ documents: z.record(z.string(), connectImageRefSchema).nullable().optional().describe("Per document type, e.g. \"acme/invoice\".")
119
+ }).describe(EXPLORER_ICONS_DESCRIPTION);
120
+ const connectDefaultDriveRemoteSchema = z.strictObject({
121
+ url: z.string(),
122
+ name: z.string().nullable().optional(),
123
+ icon: z.string().nullable().optional()
124
+ });
125
+ const connectDefaultDriveLocalSchema = z.strictObject({
126
+ local: z.literal(true).describe("Discriminator: this entry is a local drive created on first boot."),
127
+ id: z.string().describe("Stable drive id. The drive is created with this id on first boot and is not re-created on later boots."),
128
+ name: z.string().nullable().optional(),
129
+ icon: z.string().nullable().optional(),
130
+ app: z.string().optional().describe("Drive app (preferred editor) to open on the drive.")
131
+ });
132
+ const connectDefaultDriveSchema = z.union([connectDefaultDriveRemoteSchema, connectDefaultDriveLocalSchema]);
133
+ /** `connect.drives.sections.{remote,local}`: three affirmative toggles. */
134
+ const connectDriveSectionSchema = z.strictObject({
135
+ enabled: z.boolean().optional().meta({
136
+ description: "When false, the section is hidden in the sidebar.",
137
+ default: true
138
+ }),
139
+ allowAdd: z.boolean().optional().meta({
140
+ description: "When false, the section's 'add drive' affordance is hidden.",
141
+ default: true
142
+ }),
143
+ allowDelete: z.boolean().optional().meta({
144
+ description: "When false, drives in this section cannot be deleted from the UI.",
145
+ default: true
146
+ })
147
+ }).describe("Visibility and add/delete affordances for a drive section in the sidebar.");
148
+ const connectDriveSectionsSchema = z.strictObject({
149
+ remote: connectDriveSectionSchema.optional(),
150
+ local: connectDriveSectionSchema.optional()
151
+ }).describe("Per-section visibility and affordance toggles. `remote` covers what was historically split into 'public' + 'cloud'; `local` is browser-local drives.");
152
+ /** Mirrors DRIVES_PRESERVE_STRATEGIES (../clis/constants.ts, which imports
153
+ * node: modules, so it is not imported here); a test pins the two. */
154
+ const connectDrivePreserveStrategySchema = z.enum(["preserve-all", "preserve-by-url-and-detach"]);
155
+ const connectDrivesSchema = z.strictObject({
156
+ allowAddDrive: z.boolean().optional().meta({
157
+ description: "When false, the SPA hides the 'add drive' affordance entirely (top-level). Per-section overrides live in `sections.{remote,local}.allowAdd`.",
158
+ default: true
159
+ }),
160
+ defaultDrives: z.array(connectDefaultDriveSchema).optional().meta({
161
+ description: "Drives the SPA auto-connects to on first load. Each entry is either a remote drive (a URL, with optional name/icon overrides) or a local drive (created locally on first boot, with a stable id and optional name/icon/app).",
162
+ default: []
163
+ }),
164
+ preserveStrategy: connectDrivePreserveStrategySchema.optional().describe("Strategy applied when defaultDrives change between deploys. 'preserve-all' keeps user-added drives untouched; 'preserve-by-url-and-detach' detaches removed default drives. No schema default — opt-in only."),
165
+ sections: connectDriveSectionsSchema.optional(),
166
+ icons: connectExplorerIconsSchema.nullable().optional().describe(EXPLORER_ICONS_DESCRIPTION)
167
+ }).describe("Default-drive and add-drive UI behaviour.");
168
+ const connectRenownRainbowAdapterSchema = z.strictObject({
169
+ walletConnectProjectId: z.string().optional().describe("WalletConnect project id; required for this adapter to function."),
170
+ infuraProjectId: z.string().optional().describe("Optional Infura project id used to build RPC transports.")
171
+ }).describe("wagmi + RainbowKit external-wallet adapter config.");
172
+ const connectRenownPrivyAdapterSchema = z.strictObject({
173
+ appId: z.string().optional().describe("Privy application id; required for this adapter to function."),
174
+ clientId: z.string().optional().describe("Optional Privy client id."),
175
+ methods: z.array(z.string()).optional().describe("Login methods this adapter offers; default per adapter when omitted.")
176
+ }).describe("Privy embedded/social adapter config.");
177
+ const connectRenownAdaptersSchema = z.strictObject({
178
+ rainbow: connectRenownRainbowAdapterSchema.optional(),
179
+ privy: connectRenownPrivyAdapterSchema.optional()
180
+ }).describe("Per-adapter wallet config for in-page auth. Presence of an adapter key enables it; omit or leave empty for redirect-only behaviour.");
181
+ const connectRenownSchema = z.strictObject({
182
+ url: z.string().optional().meta({
183
+ description: "Renown auth service URL.",
184
+ default: "https://www.renown.id"
185
+ }),
186
+ networkId: z.string().optional().meta({
187
+ description: "CAIP-2 network namespace (e.g. 'eip155').",
188
+ default: "eip155"
189
+ }),
190
+ chainId: z.number().optional().meta({
191
+ description: "CAIP-2 chain reference within the network namespace.",
192
+ default: 1
193
+ }),
194
+ namespace: z.string().optional().describe("Renown localStorage namespace; share it across Connects to share login."),
195
+ switchboardUrl: z.string().optional().describe("Switchboard GraphQL URL. When set, Connect enables in-page (no-redirect) Renown sign-in; otherwise it falls back to the redirect flow via `url`."),
196
+ adapters: connectRenownAdaptersSchema.optional()
197
+ }).describe("Renown identity / authentication coordinates.");
198
+ const connectSentrySchema = z.strictObject({
199
+ dsn: z.string().nullable().optional().meta({
200
+ description: "Sentry DSN URL. `null` disables Sentry entirely; the SPA never loads the Sentry SDK chunk.",
201
+ default: null
202
+ }),
203
+ env: z.string().optional().meta({
204
+ description: "Sentry environment label, surfaced as the `environment` tag on every event.",
205
+ default: "dev"
206
+ }),
207
+ tracing: z.boolean().optional().meta({
208
+ description: "Enable Sentry performance tracing.",
209
+ default: false
210
+ })
211
+ }).describe("Sentry error-tracking coordinates. Set `dsn` to enable Sentry; leave `dsn` null to disable. The Sentry release tag stays build-time (stamped via Vite's `define` from WORKSPACE_VERSION) so it always matches the sourcemaps uploaded by CI.");
212
+ const connectOpenPanelSchema = z.strictObject({
213
+ clientId: z.string().optional().meta({
214
+ description: "OpenPanel client id. Empty string disables OpenPanel entirely.",
215
+ default: ""
216
+ }),
217
+ apiUrl: z.string().optional().describe("OpenPanel API URL for self-hosted instances (e.g. 'https://openpanel.example/api'). Omit to use OpenPanel's hosted API."),
218
+ trackUiEvents: z.boolean().optional().meta({
219
+ description: "Track UI events.",
220
+ default: true
221
+ }),
222
+ trackOperations: z.boolean().optional().meta({
223
+ description: "Track document operations.",
224
+ default: true
225
+ })
226
+ }).describe("OpenPanel product analytics. Set `clientId` to enable; an empty `clientId` disables it. Events are only sent after the user accepts analytics cookies. Takes precedence over the build-time PH_CONNECT_OPENPANEL_* env vars.");
227
+ /** Which reactor client Connect runs (see PHReactorClientMode). */
228
+ const connectReactorClientModeSchema = z.enum([
229
+ "in-process",
230
+ "worker",
231
+ "remote",
232
+ "router"
233
+ ]);
234
+ const connectInstanceSchema = z.strictObject({
235
+ namespace: z.string().nullable().meta({
236
+ description: "Explicit storage/SharedWorker namespace for this instance. `null` derives it from the base path (and, later, the configured endpoint), so root deployments stay byte-identical.",
237
+ default: null
238
+ }),
239
+ reactorWorker: z.boolean().meta({
240
+ description: "Host the reactor in a shared worker instead of on the main thread. Off by default; the main-thread reactor stays the proven path until cutover is verified. Packaged deployments load the worker from the prebuilt bundle `ph connect build` emits under __reactor_worker__/ (the dev server builds it lazily at the same path); when that bundle is absent the feature reports itself unavailable instead of starting a worker that cannot load.",
241
+ default: false
242
+ }),
243
+ multiReactor: z.boolean().optional().meta({
244
+ description: "Opt-in multi-reactor routing. When on, Connect routes through the in-browser reactor plus remote backends instead of the single in-browser reactor. Off by default; the single-reactor path is unchanged.",
245
+ default: false
246
+ })
247
+ }).describe("Per-instance identity. Lets one origin host multiple isolated Connect instances, each with its own storage + SharedWorker namespace.");
248
+ const connectReactorFeatureFlagsSchema = z.strictObject({
249
+ documentDecisions: z.boolean().optional().meta({
250
+ description: "Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.",
251
+ default: false
252
+ }),
253
+ authEnforcement: z.boolean().optional().meta({
254
+ description: "Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.",
255
+ default: false
256
+ }),
257
+ authGroups: z.boolean().optional().meta({
258
+ description: "Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.",
259
+ default: false
260
+ }),
261
+ authConditions: z.boolean().optional().meta({
262
+ description: "Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.",
263
+ default: false
264
+ })
265
+ }).describe("Enforcement flags. Each implies its predecessors, and the reactor refuses to boot on a set that names a later flag without an earlier one. These are consensus settings: a Connect syncing with a fleet must carry the same flags the fleet does, or the two reach different replay outcomes for the same history and diverge.");
266
+ const connectReactorSchema = z.strictObject({
267
+ featureFlags: connectReactorFeatureFlagsSchema.optional(),
268
+ createSignaturePolicy: z.enum(["legacy", "v2-required"]).optional().meta({
269
+ description: "What new documents are created as. `v2-required` documents accept only v2 action signatures and take content-addressed ids; set `legacy` while any peer Connect syncs with predates them. Existing documents keep their policy.",
270
+ default: "v2-required"
271
+ }),
272
+ unsupportedStoredDocuments: z.enum(["refuse", "read-only"]).optional().meta({
273
+ description: "What the reactor does when this browser's store holds documents at protocol versions this build does not run. `refuse` fails the boot and names the versions; `read-only` boots and keeps those documents read-only.",
274
+ default: "refuse"
275
+ })
276
+ }).describe("Settings for the reactor Connect runs in the browser, on the main thread or in the shared worker alike.");
277
+ /** A runtime-caching / denylist URL match. A string is handed to Workbox
278
+ * verbatim; `{ source, flags }` is rebuilt into a RegExp at build time. */
279
+ const connectPwaUrlPatternSchema = z.union([z.string(), z.strictObject({
280
+ source: z.string().describe("RegExp source."),
281
+ flags: z.string().optional().describe("RegExp flags (e.g. 'i').")
282
+ }).refine((p) => {
283
+ try {
284
+ new RegExp(p.source, p.flags);
285
+ return true;
286
+ } catch {
287
+ return false;
288
+ }
289
+ }, { message: "source/flags do not compile to a valid RegExp" })]).describe("URL match. A string is matched verbatim by Workbox; { source, flags } is rebuilt into a RegExp at build time.");
290
+ const connectPwaCacheStrategySchema = z.enum([
291
+ "CacheFirst",
292
+ "CacheOnly",
293
+ "NetworkFirst",
294
+ "NetworkOnly",
295
+ "StaleWhileRevalidate"
296
+ ]);
297
+ /** Serialisable subset of a Workbox `RuntimeCaching` rule. */
298
+ const connectPwaRuntimeCachingSchema = z.strictObject({
299
+ urlPattern: connectPwaUrlPatternSchema,
300
+ handler: connectPwaCacheStrategySchema,
301
+ method: z.enum([
302
+ "GET",
303
+ "POST",
304
+ "PUT",
305
+ "DELETE",
306
+ "HEAD",
307
+ "PATCH"
308
+ ]).optional(),
309
+ options: z.strictObject({
310
+ cacheName: z.string().optional(),
311
+ networkTimeoutSeconds: z.number().optional().describe("Seconds a NetworkFirst rule waits for the network before falling back to the cache."),
312
+ expiration: z.strictObject({
313
+ maxEntries: z.number().optional(),
314
+ maxAgeSeconds: z.number().optional()
315
+ }).optional(),
316
+ cacheableResponse: z.strictObject({
317
+ statuses: z.array(z.number()).optional(),
318
+ headers: z.record(z.string(), z.string()).optional()
319
+ }).optional()
320
+ }).optional()
321
+ });
322
+ const connectPwaIconSchema = z.strictObject({
323
+ src: z.string(),
324
+ sizes: z.string().optional(),
325
+ type: z.string().optional(),
326
+ purpose: z.string().optional()
327
+ });
328
+ /** A File Handling API entry. No `action`: every handler opens at Connect's
329
+ * app root, because consuming launched files needs Connect's own code. */
330
+ const connectPwaFileHandlerSchema = z.strictObject({
331
+ accept: z.record(z.string(), z.array(z.string().regex(/^\./, "file extensions must start with '.'"))).describe("MIME type → file extensions. Each extension must start with '.'; browsers ignore entries without it."),
332
+ icons: z.array(connectPwaIconSchema).optional().describe("OS-level file-type icons."),
333
+ launch_type: z.enum(["single-client", "multiple-clients"]).optional()
334
+ });
335
+ /** Web-app-manifest fields a package or project may override. */
336
+ const connectPwaManifestSchema = z.strictObject({
337
+ name: z.string().optional(),
338
+ short_name: z.string().optional(),
339
+ description: z.string().optional(),
340
+ theme_color: z.string().optional(),
341
+ background_color: z.string().optional(),
342
+ display: z.enum([
343
+ "fullscreen",
344
+ "standalone",
345
+ "minimal-ui",
346
+ "browser"
347
+ ]).optional(),
348
+ start_url: z.string().optional(),
349
+ scope: z.string().optional(),
350
+ icons: z.array(connectPwaIconSchema).optional().describe("Icons appended to the built-in set and de-duplicated by (src, sizes, purpose)."),
351
+ file_handlers: z.array(connectPwaFileHandlerSchema).optional().describe("File associations appended after Connect's built-in .phd/.phdm handler and de-duplicated on the whole entry. Entries only declare accepted types; there is no action field, because opening the files requires Connect's own runtime handling, so every handler opens at the app root."),
352
+ launch_handler: z.strictObject({ client_mode: z.enum([
353
+ "auto",
354
+ "focus-existing",
355
+ "navigate-existing",
356
+ "navigate-new"
357
+ ]) }).optional().describe("How the OS launches the app for handled files/links. Connect defaults to focus-existing.")
358
+ }).describe("Web-app-manifest field overrides.");
359
+ const pwaShape = {
360
+ globPatterns: z.array(z.string()).optional().describe("Extra Workbox precache globs, unioned with the built-ins."),
361
+ globIgnores: z.array(z.string()).optional().describe("Extra precache ignore globs, unioned with the built-ins."),
362
+ maximumFileSizeToCacheInBytes: z.number().optional().describe("Raise the precache file-size ceiling. The max across all contributors wins, so no contributor can shrink another's limit."),
363
+ runtimeCaching: z.array(connectPwaRuntimeCachingSchema).optional().describe("Runtime-caching rules appended after the built-in rules. Workbox is first-match-wins, so these cannot override a built-in rule matching the same URL."),
364
+ navigateFallbackDenylist: z.array(connectPwaUrlPatternSchema).optional().describe("Extra SPA navigate-fallback denylist patterns, unioned with the built-ins.")
365
+ };
366
+ const PWA_DESCRIPTION = "Progressive-web-app / service-worker overrides, layered on Connect's built-in PWA defaults at build time. Scalar fields deep-merge (this layer wins); the array members (icons, file_handlers, globs, runtimeCaching and denylist patterns) are additive; maximumFileSizeToCacheInBytes takes the max across contributors. (categories is not set here — it is derived from the manifest's category field.) Only applied when connect.app.offline is true.";
367
+ /** `connect.pwa` as authored. */
368
+ const connectPwaSchema = z.strictObject({
369
+ manifest: connectPwaManifestSchema.optional(),
370
+ ...pwaShape
371
+ }).describe(PWA_DESCRIPTION);
372
+ /**
373
+ * The `connect` block as authored: powerhouse.config.json's `connect`, the
374
+ * connect host's `config`, and `ph connect config` writes. Every field is
375
+ * optional; omit the section entirely for default behaviour.
376
+ */
377
+ const connectConfigSchema = z.strictObject({
378
+ branding: connectBrandingSchema.optional(),
379
+ home: connectHomeSchema.optional(),
380
+ app: connectAppSchema.optional(),
381
+ ai: connectAiSchema.optional(),
382
+ packages: connectPackagesSchema.optional(),
383
+ drives: connectDrivesSchema.optional(),
384
+ renown: connectRenownSchema.optional(),
385
+ sentry: connectSentrySchema.optional(),
386
+ openPanel: connectOpenPanelSchema.optional(),
387
+ instance: connectInstanceSchema.optional(),
388
+ reactor: connectReactorSchema.optional(),
389
+ pwa: connectPwaSchema.optional()
390
+ }).describe("Connect-specific UI customisations. All fields optional; omit the section entirely for default behaviour.");
391
+ /** `schema` carrying `source`'s description and meta (zod keeps them per
392
+ * instance, so `.extend()` and a rebuilt field drop them). */
393
+ function withMetaOf(schema, source) {
394
+ const meta = source.meta();
395
+ return meta ? schema.meta(meta) : schema;
396
+ }
397
+ /**
398
+ * The `connect` block with its token-able fields wrapped by `field`: the
399
+ * fields that name another host's outputs, which a connect host's `config`
400
+ * may write as output tokens (`ph run` resolves them before the verb).
401
+ *
402
+ * - `drives.defaultDrives[].url` (a remote entry): e.g. a switchboard's
403
+ * `drives.<slug>.url` output.
404
+ * - `renown.switchboardUrl`: a switchboard's `endpoints.graphql` output.
405
+ *
406
+ * The connect runner builds it with host-core's `s.tokenable` (declared:
407
+ * tokens in; resolved: plain values only). The output type is
408
+ * {@link ConnectConfig} either way. powerhouse.config.json's `connect` block,
409
+ * the served config and their JSON Schemas stay {@link connectConfigSchema},
410
+ * which takes no tokens.
411
+ */
412
+ function connectConfigSchemaWith(field) {
413
+ const remoteDrive = connectDefaultDriveRemoteSchema.extend({ url: field(z.string()) });
414
+ const shape = connectDrivesSchema.shape;
415
+ const drives = withMetaOf(connectDrivesSchema.extend({ defaultDrives: withMetaOf(z.array(z.union([remoteDrive, connectDefaultDriveLocalSchema])).optional(), shape.defaultDrives) }), connectDrivesSchema);
416
+ const renown = withMetaOf(connectRenownSchema.extend({ switchboardUrl: withMetaOf(field(z.string()).optional(), connectRenownSchema.shape.switchboardUrl) }), connectRenownSchema);
417
+ return withMetaOf(connectConfigSchema.extend({
418
+ drives: drives.optional(),
419
+ renown: renown.optional()
420
+ }), connectConfigSchema);
421
+ }
422
+ /** The declared `connect` block: {@link connectConfigSchemaWith} with every
423
+ * token accepted in its token-able fields. */
424
+ const declaredConnectConfigSchema = /* @__PURE__ */ connectConfigSchemaWith(tokenable);
425
+ /** One entry of the host.js composition, projected into the served config as
426
+ * data (module specifier + validated config). */
427
+ const connectCompositionEntrySchema = z.strictObject({
428
+ module: z.string(),
429
+ config: z.record(z.string(), z.unknown()).optional()
430
+ });
431
+ /** `instance` plus `reactorClient`, derived from the host's reactor backends. */
432
+ const connectRuntimeInstanceSchema = connectInstanceSchema.extend({ reactorClient: connectReactorClientModeSchema.optional() });
433
+ /** The manifest plus `categories`, derived from contributors' `category`. */
434
+ const connectRuntimePwaManifestSchema = connectPwaManifestSchema.extend({ categories: z.array(z.string()).optional() });
435
+ const connectRuntimePwaSchema = connectPwaSchema.extend({ manifest: connectRuntimePwaManifestSchema.optional() });
436
+ /** The served `connect` block (runtime powerhouse.config.json). */
437
+ const connectRuntimeConfigSchema = connectConfigSchema.extend({
438
+ composition: z.array(connectCompositionEntrySchema).optional(),
439
+ instance: connectRuntimeInstanceSchema.optional(),
440
+ pwa: connectRuntimePwaSchema.optional()
441
+ });
442
+ //#endregion
443
+ export { connectAiSchema, connectAppSchema, connectBackgroundLayerSchema, connectBackgroundLayersSchema, connectBackgroundSchema, connectBrandingSchema, connectCompositionEntrySchema, connectConfigSchema, connectConfigSchemaWith, connectDefaultDriveLocalSchema, connectDefaultDriveRemoteSchema, connectDefaultDriveSchema, connectDrivePreserveStrategySchema, connectDriveSectionSchema, connectDriveSectionsSchema, connectDrivesSchema, connectEdgesSchema, connectExplorerIconsSchema, connectHomeSchema, connectImageRefSchema, connectInstanceSchema, connectLengthSchema, connectLoaderSchema, connectOpenPanelSchema, connectPackagesSchema, connectPwaCacheStrategySchema, connectPwaFileHandlerSchema, connectPwaIconSchema, connectPwaManifestSchema, connectPwaRuntimeCachingSchema, connectPwaSchema, connectPwaUrlPatternSchema, connectReactorClientModeSchema, connectReactorFeatureFlagsSchema, connectReactorSchema, connectRenownAdaptersSchema, connectRenownPrivyAdapterSchema, connectRenownRainbowAdapterSchema, connectRenownSchema, connectRuntimeConfigSchema, connectRuntimeInstanceSchema, connectRuntimePwaManifestSchema, connectRuntimePwaSchema, connectSchemedColorSchema, connectSchemedImageSchema, connectSentrySchema, declaredConnectConfigSchema };
444
+
445
+ //# sourceMappingURL=connect-config-schema.js.map