@wildo-ai/platform-config-lib 1.1.9 → 1.1.11

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 (188) hide show
  1. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +1 -1
  2. package/dist/esm/_unimplemented/unimplemented-field-warning.js +1 -1
  3. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
  4. package/dist/esm/blueprint/anchored-region.d.ts +83 -0
  5. package/dist/esm/blueprint/anchored-region.d.ts.map +1 -0
  6. package/dist/esm/blueprint/anchored-region.js +263 -0
  7. package/dist/esm/blueprint/anchored-region.js.map +1 -0
  8. package/dist/esm/blueprint/blueprint.schemas.d.ts +689 -0
  9. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -0
  10. package/dist/esm/blueprint/blueprint.schemas.js +638 -0
  11. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -0
  12. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +13 -1
  13. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  14. package/dist/esm/bootstrap/bootstrap.contracts.js +6 -0
  15. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +21 -3
  17. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  18. package/dist/esm/bootstrap/bootstrap.schemas.js +14 -3
  19. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  20. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +121 -0
  21. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  22. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +129 -0
  23. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  24. package/dist/esm/bootstrap/runtime-response-integrity.d.ts +249 -0
  25. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -0
  26. package/dist/esm/bootstrap/runtime-response-integrity.js +353 -0
  27. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -0
  28. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts +32 -0
  29. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -0
  30. package/dist/esm/bootstrap/runtime-secret-env.contracts.js +43 -0
  31. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -0
  32. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts +51 -0
  33. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -0
  34. package/dist/esm/canonical-json/rfc8785-canonical-json.js +231 -0
  35. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -0
  36. package/dist/esm/index.d.ts +15 -0
  37. package/dist/esm/index.d.ts.map +1 -1
  38. package/dist/esm/index.js +15 -0
  39. package/dist/esm/index.js.map +1 -1
  40. package/dist/esm/key-management/approval-seal-verifier.d.ts +216 -0
  41. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -0
  42. package/dist/esm/key-management/approval-seal-verifier.js +233 -0
  43. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -0
  44. package/dist/esm/key-management/approval-seal.contracts.d.ts +131 -0
  45. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -0
  46. package/dist/esm/key-management/approval-seal.contracts.js +115 -0
  47. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -0
  48. package/dist/esm/key-management/data-key.contracts.d.ts +108 -0
  49. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -0
  50. package/dist/esm/key-management/data-key.contracts.js +54 -0
  51. package/dist/esm/key-management/data-key.contracts.js.map +1 -0
  52. package/dist/esm/key-management/es256-jws.d.ts +60 -0
  53. package/dist/esm/key-management/es256-jws.d.ts.map +1 -0
  54. package/dist/esm/key-management/es256-jws.js +135 -0
  55. package/dist/esm/key-management/es256-jws.js.map +1 -0
  56. package/dist/esm/key-management/key-provider.spi.d.ts +151 -0
  57. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -0
  58. package/dist/esm/key-management/key-provider.spi.js +38 -0
  59. package/dist/esm/key-management/key-provider.spi.js.map +1 -0
  60. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +93 -0
  61. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -0
  62. package/dist/esm/key-management/keyring-rotation.contracts.js +101 -0
  63. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -0
  64. package/dist/esm/key-management/keyring-status.contracts.d.ts +66 -0
  65. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -0
  66. package/dist/esm/key-management/keyring-status.contracts.js +45 -0
  67. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -0
  68. package/dist/esm/key-management/signature-request.contracts.d.ts +95 -0
  69. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -0
  70. package/dist/esm/key-management/signature-request.contracts.js +96 -0
  71. package/dist/esm/key-management/signature-request.contracts.js.map +1 -0
  72. package/dist/esm/key-management/signing-log-export.contracts.d.ts +216 -0
  73. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -0
  74. package/dist/esm/key-management/signing-log-export.contracts.js +268 -0
  75. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -0
  76. package/dist/esm/key-management/vault-custody.contracts.d.ts +55 -0
  77. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -0
  78. package/dist/esm/key-management/vault-custody.contracts.js +88 -0
  79. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -0
  80. package/dist/esm/lockfile/lockfile-io.d.ts +7 -9
  81. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  82. package/dist/esm/lockfile/lockfile-io.js +23 -22
  83. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  84. package/dist/esm/lockfile/materialize-infra-section.d.ts +17 -14
  85. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  86. package/dist/esm/lockfile/materialize-infra-section.js +9 -9
  87. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  88. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +26 -2
  89. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  90. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -2
  91. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  92. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  93. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +9 -2
  94. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  95. package/dist/esm/project-config/application-served-public-documents.loader.d.ts +26 -0
  96. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -0
  97. package/dist/esm/project-config/application-served-public-documents.loader.js +78 -0
  98. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -0
  99. package/dist/esm/project-config/define-infra-env-config.d.ts +236 -15
  100. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  101. package/dist/esm/project-config/define-infra-env-config.js +104 -91
  102. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  103. package/dist/esm/project-config/define-saas-config.d.ts +133 -3
  104. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  105. package/dist/esm/project-config/define-saas-config.js +170 -19
  106. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  107. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  108. package/dist/esm/project-config/hosted-infra-env-config.js +3 -0
  109. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  110. package/dist/esm/project-config/index.d.ts +3 -0
  111. package/dist/esm/project-config/index.d.ts.map +1 -1
  112. package/dist/esm/project-config/index.js +3 -0
  113. package/dist/esm/project-config/index.js.map +1 -1
  114. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  115. package/dist/esm/project-config/npm-version-range.js +39 -16
  116. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  117. package/dist/esm/project-config/owning-package-tsconfig.d.ts +15 -0
  118. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -0
  119. package/dist/esm/project-config/owning-package-tsconfig.js +29 -0
  120. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -0
  121. package/dist/esm/project-config/provider-companion-discovery.d.ts +4 -4
  122. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  123. package/dist/esm/project-config/provider-companion-discovery.js +13 -9
  124. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  125. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +32 -3
  126. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  127. package/dist/esm/project-config/provider-runtime-artifacts.js +67 -13
  128. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  129. package/dist/esm/project-config/shared/csp-defaults.d.ts +4 -5
  130. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  131. package/dist/esm/project-config/shared/csp-defaults.js +4 -5
  132. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  133. package/dist/esm/project-config/shared/csp.schemas.d.ts +1 -2
  134. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  135. package/dist/esm/project-config/shared/csp.schemas.js +1 -2
  136. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  137. package/dist/esm/project-config/shared/environment.schemas.d.ts +6 -0
  138. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  139. package/dist/esm/project-config/shared/environment.schemas.js +8 -1
  140. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  141. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -0
  142. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  143. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +3 -0
  144. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  145. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +4 -0
  146. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  147. package/dist/esm/project-config/shared/minion-resource-access.validation.js +6 -2
  148. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  149. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +250 -0
  150. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -0
  151. package/dist/esm/project-config/shared/platform-key-management.schemas.js +194 -0
  152. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -0
  153. package/dist/esm/registry/index.d.ts +1 -0
  154. package/dist/esm/registry/index.d.ts.map +1 -1
  155. package/dist/esm/registry/index.js +1 -0
  156. package/dist/esm/registry/index.js.map +1 -1
  157. package/dist/esm/registry/local-checkout-source.d.ts +22 -2
  158. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  159. package/dist/esm/registry/local-checkout-source.js +66 -3
  160. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  161. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +10 -0
  162. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  163. package/dist/esm/registry/module-artifact.schemas.d.ts +23 -0
  164. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  165. package/dist/esm/registry/module-manifest.schemas.d.ts +336 -18
  166. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  167. package/dist/esm/registry/module-manifest.schemas.js +245 -19
  168. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  169. package/dist/esm/registry/module-search.schemas.d.ts +2 -0
  170. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  171. package/dist/esm/registry/module-search.schemas.js +14 -1
  172. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  173. package/dist/esm/registry/registry-errors.d.ts +22 -2
  174. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  175. package/dist/esm/registry/registry-errors.js +28 -2
  176. package/dist/esm/registry/registry-errors.js.map +1 -1
  177. package/dist/esm/registry/registry-section-schemas.constants.d.ts +5 -0
  178. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  179. package/dist/esm/registry/registry-url-resolution.d.ts +72 -0
  180. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -0
  181. package/dist/esm/registry/registry-url-resolution.js +157 -0
  182. package/dist/esm/registry/registry-url-resolution.js.map +1 -0
  183. package/dist/esm/schemas/framework-secrets.schemas.d.ts +55 -0
  184. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  185. package/dist/esm/schemas/framework-secrets.schemas.js +53 -0
  186. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  187. package/dist/tsconfig.build.tsbuildinfo +1 -1
  188. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"module-manifest.schemas.js","sourceRoot":"","sources":["../../../../src/registry/module-manifest.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,EAAE,8BAA8B,EAAyB,MAAM,uBAAuB,CAAC;AAEhK;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAC7B,qLAAqL,CAAC;AACxL,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,EAAE;KACR,KAAK,CAAC,kBAAkB,EAAE,gEAAgE,CAAC;KAC3F,QAAQ,CAAC,sBAAsB,CAAC,CAAC;AACpC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,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C;YACpB,OAAO,EAAE,4EAA4E,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SAC9G,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Module manifest schema — `wildo.module.json` shipped inside every\n * registry artifact.\n *\n * Phase 1 fleshes out the dependency / boundary contract that Phase\n * 5+ install/update/remove flows need. The manifest is the single\n * cross-package contract every registry client signs against; new\n * fields require a plan amendment.\n *\n * Authoritative references (keep these in sync with edits below):\n * - KD-12 — modules cannot claim arbitrary top-level app ownership;\n * `boundaries` declares which app surfaces the artifact may write.\n * - KD-13 — npm + module + capability dependencies are explicit.\n * - KD-19 — runtime packages produced from installed module content\n * must NOT import `platform-config-lib`; this is enforced\n * downstream by Phase 5+ verification, not the manifest itself.\n */\n\nimport { z } from 'zod';\nimport { AppFrontendType, ProviderCatalogueProvenanceSchema, ProviderTier, engineSlotsBoundByCapabilities, type EngineCapability } from '@wildo-ai/saas-models';\n\n/**\n * Authoring shape for a nonempty version constraint. Registry release selectors\n * can resolve tags; manifest module/framework requirements instead use npm\n * semver ranges and are validated against the receiving application's recorded\n * module versions and installed framework packages before source adoption.\n */\nconst SemverRange = z.string().min(1).describe('npm-style semver range');\n\n/**\n * Exact `MAJOR.MINOR.PATCH[-prerelease][+build]` semver. The regex\n * mirrors the official semver.org grammar, so manifest authors\n * cannot publish version `^1.2.3` or `latest` and have install\n * silently treat it as concrete.\n */\nexport const SEMVER_EXACT_REGEX =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\nexport const SemverExactSchema = z\n .string()\n .regex(SEMVER_EXACT_REGEX, 'Expected exact semver `MAJOR.MINOR.PATCH` (no ranges, no tags)')\n .describe('Exact semver version');\nconst SemverExact = SemverExactSchema;\n\n/**\n * `dependsOn.modules.<moduleId>` — other Wildo modules that this\n * module requires. Install hard-fails by default if any required\n * module is missing (KD-13). Range resolution mirrors npm semver\n * semantics.\n */\nexport const ModuleManifestModuleDependenciesSchema = z.record(z.string().min(1), SemverRange);\nexport type ModuleManifestModuleDependencies = z.infer<typeof ModuleManifestModuleDependenciesSchema>;\n\n/**\n * `dependsOn.npm.dependencies` / `peerDependencies` — npm packages\n * the installed module imports at runtime. Install surfaces these\n * to the operator but does not edit `package.json` automatically\n * or install dependencies. The operator chooses the consuming package (KD-13).\n */\nexport const ModuleManifestNpmDependenciesSchema = z.strictObject({\n dependencies: z.record(z.string().min(1), SemverRange).default({}),\n peerDependencies: z.record(z.string().min(1), SemverRange).default({}),\n});\nexport type ModuleManifestNpmDependencies = z.infer<typeof ModuleManifestNpmDependenciesSchema>;\n\n/**\n * `dependsOn.capabilities` — required EngineCapability names. Adoption validates\n * each name against the canonical enum and requires enabled:true in the host's\n * authored engineCapabilities. This proves declared activation, not provider\n * health. Strings remain the artifact format; the CLI performs host comparison.\n */\nexport const ModuleManifestCapabilityDependenciesSchema = z.array(z.string().min(1));\nexport type ModuleManifestCapabilityDependencies = z.infer<typeof ModuleManifestCapabilityDependenciesSchema>;\n\nexport const ModuleManifestDependenciesSchema = z.strictObject({\n modules: ModuleManifestModuleDependenciesSchema.default({}),\n npm: ModuleManifestNpmDependenciesSchema.default({\n dependencies: {},\n peerDependencies: {},\n }),\n capabilities: ModuleManifestCapabilityDependenciesSchema.default([]),\n});\nexport type ModuleManifestDependencies = z.infer<typeof ModuleManifestDependenciesSchema>;\n\n/**\n * Engine compatibility — the framework version range this module\n * targets. Install hard-fails by default if the host app's framework\n * version is outside the range. Every installed saas-models copy reached from\n * application workspace framework dependencies must satisfy it; desired pins\n * and the running CLI version are not installed application evidence.\n */\nexport const ModuleManifestEngineSchema = z.strictObject({\n framework: SemverRange,\n});\nexport type ModuleManifestEngine = z.infer<typeof ModuleManifestEngineSchema>;\n\n/**\n * One registry NAME segment — a domain slug, or either half of a module id. Lowercase ASCII letters,\n * digits, `.`, `_`, `-`, not starting with `.`, `_` or `-` (npm's package-name alphabet).\n *\n * These names are not only identifiers: the CLI builds filesystem paths from them\n * (`.wildo-saas/generated/modules-artifacts/<domain>/<scope>/<name>/…`) and runs a RECURSIVE delete\n * on those paths to wipe a stale staging or extraction tree. Until 2026-09-25 the only rule on a\n * module id was \"contains a `/`\", so a manifest `id` of `a/../../../..` made `wildo registry publish`\n * resolve its staging root to the application root and delete it. The rule is total over both\n * places a name is authored: a module's manifest, and a domain created on the registry server.\n */\nconst REGISTRY_NAME_SEGMENT_REGEX = /^[a-z0-9][a-z0-9._-]*$/;\nconst REGISTRY_NAME_SEGMENT_MAX_LENGTH = 64;\n\nfunction isRegistryNameSegment(segment: string): boolean {\n return segment.length <= REGISTRY_NAME_SEGMENT_MAX_LENGTH && REGISTRY_NAME_SEGMENT_REGEX.test(segment);\n}\n\n/** A registry domain slug (`acme`, `internal`) — one {@link isRegistryNameSegment} segment. */\nexport const RegistryDomainSlugSchema = z.string().refine(isRegistryNameSegment, {\n error: 'a registry domain must be lowercase letters, digits, `.`, `_` or `-`, starting with a letter or digit (max 64)',\n});\n\n/** Whether `moduleId` is a well-formed `<scope>/<name>` module id. */\nexport function isModuleId(moduleId: string): boolean {\n const segments = moduleId.split('/');\n return segments.length === 2 && segments.every(isRegistryNameSegment);\n}\n\n/**\n * A module id: exactly `<scope>/<name>` (e.g. `acme/billing`), each half a registry name segment.\n * The id is also the lockfile key, the registry URL segment, and — through the CLI — a directory\n * path, so its shape is the path-safety rule, not a style preference.\n */\nexport const ModuleIdSchema = z.string().refine(isModuleId, {\n error: 'a module id must be `<scope>/<name>` (e.g. `acme/billing`), each half lowercase letters, digits, `.`, `_` or `-`',\n});\n\n/**\n * Where each layer's MODULE directories live in a Wildo SaaS application, relative to its root.\n *\n * Derived from the scaffold, not invented: the `add-module` scenario creates a module's directories\n * under `shared-lib/src/modules/<id>`, `specifications/src/modules/<id>`, `frontend/src/modules/<id>`\n * and `backend-api/src/modules/<id>`; `add-minion` and `add-worker-node` create a package directory\n * under `minions/<dir>` and `workers/<dir>`.\n *\n * A registry module may write only BELOW one of these roots, in a directory it names. That is the\n * whole of KD-12, stated positively. Until 2026-09-25 the boundary rule refused only absolute paths\n * and `..` segments, so `.`, `.git/hooks`, `.wildo-saas` and `wildo.saas.config.ts` were all valid\n * boundaries: a published module could overwrite the host's configuration or plant a git hook, and\n * `wildo registry publish` would ship the author's `.env` and `secrets.json`.\n */\nexport const MODULE_BOUNDARY_LAYER_ROOTS = {\n specifications: 'specifications/src/modules',\n shared: 'shared-lib/src/modules',\n frontend: 'frontend/src/modules',\n backend: 'backend-api/src/modules',\n minions: 'minions',\n workers: 'workers',\n /**\n * A PROVIDER module's directory, `providers/<ref>` (#2014), holding one workspace package per facet\n * (`providers/<ref>/backend`, `providers/<ref>/frontend`). Like a minion or a worker, each facet is its\n * own package, so the root is a top-level directory rather than a layer's `src/modules`: the facet's own\n * `package.json` is where its vendor SDK dependency lives, and a runtime depends only on the facet it runs.\n */\n providers: 'providers',\n} as const;\nexport type ModuleBoundaryLayer = keyof typeof MODULE_BOUNDARY_LAYER_ROOTS;\n\n/** Every boundary layer, in the canonical order of {@link MODULE_BOUNDARY_LAYER_ROOTS}. */\nexport const MODULE_BOUNDARY_LAYERS = Object.keys(MODULE_BOUNDARY_LAYER_ROOTS) as ModuleBoundaryLayer[];\n\n/**\n * Directory names a module artifact may never contain, at any depth: dependency installs are the\n * consumer's to produce, never the publisher's to ship.\n */\nconst MODULE_ARTIFACT_FORBIDDEN_SEGMENTS: ReadonlySet<string> = new Set(['node_modules']);\n\n/**\n * Whether one `/`-separated path segment may appear in a module boundary or a module artifact.\n *\n * A DOT-prefixed segment is refused outright. That single rule removes `.git` (hooks run code on the\n * next commit), `.env` (a minion or worker package carries its generated secrets there),\n * `.wildo-saas` (the companion and machine-local state) and `..` / `.` (traversal and \"the whole\n * root\"). npm applies the same default for the same reason: `.git` and the like never enter a\n * published package.\n */\nfunction isAllowedModulePathSegment(segment: string): boolean {\n return segment.length > 0 && !segment.startsWith('.') && !MODULE_ARTIFACT_FORBIDDEN_SEGMENTS.has(segment);\n}\n\n/**\n * Whether `appRelativePath` (POSIX separators, relative to the application root) may be carried by a\n * module artifact. Used on BOTH sides of the registry so they cannot disagree:\n *\n * - `wildo registry publish` skips a file that fails it, so a secret beside the module's source is\n * never packed;\n * - `wildo registry add` / `update` / `repair` refuse an artifact containing one, before writing\n * anything — a correctly published artifact cannot contain it, so its presence means the bytes\n * did not come from `publish`.\n */\nexport function isModuleArtifactPathAllowed(appRelativePath: string): boolean {\n if (appRelativePath.includes('\\\\') || appRelativePath.startsWith('/')) return false;\n return appRelativePath.split('/').every(isAllowedModulePathSegment);\n}\n\n/**\n * Whether `appRelativePath` is a file a registry module can OWN in an application: a path a module\n * artifact may carry ({@link isModuleArtifactPathAllowed}) that also sits strictly below one of the\n * layer roots ({@link MODULE_BOUNDARY_LAYER_ROOTS}) — because an install only ever writes inside a\n * boundary, and every boundary lives there.\n *\n * This is the rule for a path RECORDED as installed (`sections.modules.installed[*].files`), which\n * `remove` and `update` delete. `isModuleArtifactPathAllowed` alone would let a hand-edited or badly\n * merged entry name `wildo.saas.config.ts` or `backend-api/src/index.ts`, and removing the module would\n * then delete the application's own file.\n */\nexport function isModuleOwnedFilePath(appRelativePath: string): boolean {\n return isModuleArtifactPathAllowed(appRelativePath)\n && Object.values(MODULE_BOUNDARY_LAYER_ROOTS).some((root) => appRelativePath.startsWith(`${root}/`));\n}\n\n/**\n * One layer's `boundaries` entries: each a directory strictly BELOW that layer's root\n * ({@link MODULE_BOUNDARY_LAYER_ROOTS}), written with POSIX separators, every segment allowed by\n * {@link isModuleArtifactPathAllowed}. Validated at parse time, so the registry server refuses a\n * manifest declaring a wider boundary at publish and the CLI refuses one at install.\n */\nfunction moduleLayerBoundariesSchema(layer: ModuleBoundaryLayer) {\n const root = MODULE_BOUNDARY_LAYER_ROOTS[layer];\n return z.array(\n z.string().min(1).refine(\n (entry) => isModuleArtifactPathAllowed(entry) && entry.startsWith(`${root}/`) && entry.length > root.length + 1,\n {\n error:\n `boundaries.${layer} entries must name a directory below \\`${root}/\\` (e.g. \\`${root}/acme-billing\\`), ` +\n 'with `/` separators and no segment that starts with `.` or is `node_modules`',\n },\n ),\n ).default([]);\n}\n\n/**\n * `boundaries` — the per-layer surface the module is allowed to write into the host app source\n * (KD-12). Each layer is optional; modules typically declare only the layers they actually contain\n * (a backend-only module declares `backend` + `shared` and omits `frontend` / `specifications`).\n */\nexport const ModuleManifestBoundariesSchema = z.strictObject({\n specifications: moduleLayerBoundariesSchema('specifications'),\n shared: moduleLayerBoundariesSchema('shared'),\n frontend: moduleLayerBoundariesSchema('frontend'),\n backend: moduleLayerBoundariesSchema('backend'),\n minions: moduleLayerBoundariesSchema('minions'),\n workers: moduleLayerBoundariesSchema('workers'),\n providers: moduleLayerBoundariesSchema('providers'),\n});\nexport type ModuleManifestBoundaries = z.infer<typeof ModuleManifestBoundariesSchema>;\n\n/**\n * The boundaries schema declares every layer of {@link MODULE_BOUNDARY_LAYER_ROOTS} and nothing else: a\n * root added without its boundaries key (or the reverse) fails to compile here.\n */\nexport const BOUNDARIES_SCHEMA_COVERS_EVERY_LAYER: [keyof ModuleManifestBoundaries] extends [ModuleBoundaryLayer]\n ? [ModuleBoundaryLayer] extends [keyof ModuleManifestBoundaries] ? true : never\n : never = true;\n\n/**\n * Every boundary directory a manifest declares, across ALL layers, in canonical layer order.\n *\n * The one place a consumer turns `boundaries` into a list. Three consumers (the packager, `publish`, the\n * install fan-out) each used to spell the six layers out by hand, so a seventh layer — `providers`,\n * #2014 — would have been silently skipped by all three: an artifact that packs nothing, an install that\n * copies nothing, and a publish that reports success. Iterating the roots makes the next layer impossible\n * to forget.\n */\nexport function flattenModuleBoundaries(boundaries: ModuleManifestBoundaries | undefined): string[] {\n if (!boundaries) return [];\n return MODULE_BOUNDARY_LAYERS.flatMap((layer) => boundaries[layer] ?? []);\n}\n\n/**\n * How an installed module is REGISTERED in the host application — the composition scenario whose\n * registry edits make it a module the application knows about (#1755, #1773).\n *\n * Installing copies a module's files; registering it adds it to what the application declares. Without\n * registration the backend discovers `backend-api/src/modules/<dir>` by directory scan while every other\n * layer ignores the module, and a minion or worker is never declared at all, so it never runs.\n *\n * Each member is the framework scenario that IS the declaration of how that shape is registered, so\n * installation replays its edit steps rather than keeping a second copy of them:\n */\nexport enum ModuleRegistrationScenario {\n /** A domain module — its shared, specifications and frontend registries and `applicationModules`. */\n ADD_MODULE = 'add-module',\n /** A minion — `applicationMinions`, its provider scope, and the pnpm workspace member. */\n ADD_MINION = 'add-minion',\n /** A worker node — `applicationWorkers`, its provider scope, and the pnpm workspace member. */\n ADD_WORKER_NODE = 'add-worker-node',\n /**\n * A provider module (#2014): the pnpm workspace member, each facet package as a `workspace:*` dependency of the\n * runtimes that own that facet, and the provider's scope in each. Unlike the three above it is never carried by a\n * MANIFEST: the owners are the INSTALLING application's, so the installer derives the wiring and only its lockfile\n * records it ({@link ProviderWiringSchema}).\n */\n ADD_PROVIDER_PACKAGE = 'add-provider-package',\n}\n\n/**\n * An application-relative service directory as `wildo.saas.config.ts` declares it (`./backend-api`, `frontend`).\n * Restricted to plain path segments, with no `..`, because a wiring names files the installer and `remove` edit.\n */\nconst WIRED_SERVICE_PATH_PATTERN = /^(\\.\\/)?(?!\\.\\.?(\\/|$))[A-Za-z0-9_-][A-Za-z0-9._-]*(\\/(?!\\.\\.?(\\/|$))[A-Za-z0-9_-][A-Za-z0-9._-]*)*$/;\n\n/** A scoped provider facet package name: `@<scope>/provider-<ref>` or `@<scope>/provider-<ref>-frontend`. */\nconst PROVIDER_FACET_PACKAGE_NAME_PATTERN = /^@[a-z0-9][a-z0-9._-]*\\/provider-[a-z][a-z0-9-]*$/;\n\n/** One runtime a provider facet was wired into: its key in `services`, and its directory. */\nexport const ProviderWiringOwnerSchema = z.strictObject({\n serviceKey: z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),\n path: z.string().regex(WIRED_SERVICE_PATH_PATTERN),\n});\nexport type ProviderWiringOwner = z.infer<typeof ProviderWiringOwnerSchema>;\n\n/**\n * What an `add-provider-package` install wired, as the INSTALLER derived it from its own application (#2014):\n * - `backendOwners`: the backend services that depend on the backend facet and scope the provider;\n * - `frontendOwners`: the frontend services, of a type in the facet's `surfaces`, that depend on the browser facet\n * and scope the provider.\n *\n * Recorded so `remove` reverses exactly what install wrote, even after the application's services change.\n */\nexport const ProviderWiringSchema = z.strictObject({\n /** The backend facet's package name as installed (`@<scope>/provider-<ref>`); absent without a backend facet. */\n backendPackage: z.string().regex(PROVIDER_FACET_PACKAGE_NAME_PATTERN).optional(),\n backendOwners: z.array(ProviderWiringOwnerSchema),\n /** The browser facet's package name as installed; absent without a frontend facet. */\n frontendPackage: z.string().regex(PROVIDER_FACET_PACKAGE_NAME_PATTERN).optional(),\n frontendOwners: z.array(ProviderWiringOwnerSchema),\n});\nexport type ProviderWiring = z.infer<typeof ProviderWiringSchema>;\n\n/**\n * The four layers of a domain module, named as its manifest boundaries name them. A domain-module\n * registration may cover a SUBSET (#1773): a backend+shared module registers its shared entries and an\n * `applicationModules` entry bound to the backend only.\n */\nexport enum DomainModuleLayer {\n SHARED = 'shared',\n SPECIFICATIONS = 'specifications',\n FRONTEND = 'frontend',\n BACKEND = 'backend',\n}\n\n/**\n * Every domain layer is a boundary layer, spelled the same (#1773 review): the enum restates four keys of\n * `MODULE_BOUNDARY_LAYER_ROOTS`, so a member added or renamed on one side alone fails to compile here.\n */\nexport const DOMAIN_LAYERS_ARE_BOUNDARY_LAYERS: `${DomainModuleLayer}` extends ModuleBoundaryLayer ? true : never = true;\n\n/** Canonical order, so one set of layers has one spelling. */\nexport const DOMAIN_MODULE_LAYERS: readonly DomainModuleLayer[] = [\n DomainModuleLayer.SHARED,\n DomainModuleLayer.SPECIFICATIONS,\n DomainModuleLayer.FRONTEND,\n DomainModuleLayer.BACKEND,\n];\n\n/**\n * The scenarios' variable patterns for the directory and camelCase stem their REGISTRY edits use\n * (`moduleId`/`moduleCamel`, `minionDir`/`minionCamel`, `workerDir`/`workerCamel` share them). Mirrored\n * here because the manifest is validated where no scenario is loaded (the registry server); a test pins\n * them equal to the scenarios' own declarations.\n */\nexport const MODULE_REGISTRATION_MODULE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;\nexport const MODULE_REGISTRATION_MODULE_CAMEL_PATTERN = /^[a-z][A-Za-z0-9]*$/;\n\n/**\n * A module's registration: the scenario plus the ONLY values its registry edits read. It carries no\n * code — the installer renders the scenario's own edit steps with these values, both restricted to\n * identifier alphabets (and anything else a scenario needs is DERIVED by the installer, never read from\n * the manifest) — so a manifest cannot smuggle text into the host's files. Derived by\n * `wildo registry publish` from the publishing application (every edit already present), never authored.\n */\nexport const ModuleManifestRegistrationSchema = z\n .strictObject({\n scenario: z.enum(ModuleRegistrationScenario),\n /** The module's directory under its scenario's root: each layer's modules root, `minions/` or `workers/` (kebab-case). */\n moduleId: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN),\n /** The camelCase stem the scenario's entries are named from (`<stem>Module`, the minion/worker bucket key). */\n moduleCamel: z.string().regex(MODULE_REGISTRATION_MODULE_CAMEL_PATTERN),\n /**\n * `add-module` only: the layers the module covers, when it is NOT all four (absent = the whole module,\n * so one module has one spelling). Must include `backend` or `frontend`: an `applicationModules` entry\n * binds the module to at least one service.\n */\n layers: z.array(z.enum(DomainModuleLayer)).min(1).optional(),\n /** `add-provider-package` only, and required there: what the installer wired. */\n providerWiring: ProviderWiringSchema.optional(),\n })\n .superRefine((registration, context) => {\n const isProviderWiring = registration.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE;\n if (isProviderWiring !== (registration.providerWiring !== undefined)) {\n context.addIssue({ code: 'custom', path: ['providerWiring'], message: 'an add-provider-package registration carries its wiring, and no other registration does' });\n }\n const layers = registration.layers;\n if (layers === undefined) return;\n if (registration.scenario !== ModuleRegistrationScenario.ADD_MODULE) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'only an add-module registration covers layers' });\n return;\n }\n const canonical = DOMAIN_MODULE_LAYERS.filter((layer) => layers.includes(layer));\n if (canonical.length !== layers.length || canonical.some((layer, index) => layer !== layers[index])) {\n context.addIssue({ code: 'custom', path: ['layers'], message: `layers must be distinct and in canonical order (${DOMAIN_MODULE_LAYERS.join(', ')})` });\n }\n if (canonical.length === DOMAIN_MODULE_LAYERS.length) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'a whole module omits `layers`' });\n }\n if (!layers.includes(DomainModuleLayer.BACKEND) && !layers.includes(DomainModuleLayer.FRONTEND)) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'a registered module must include the backend or the frontend layer' });\n }\n });\nexport type ModuleManifestRegistration = z.infer<typeof ModuleManifestRegistrationSchema>;\n\n/**\n * What a registry module IS: the one discriminator every consumer branches on (#2014).\n *\n * The registry was built to carry application FEATURES. On 2026-09-29 Paul decided it also carries\n * PROVIDERS, distributed shadcn-style: a provider's source is copied into the application, which owns it\n * from then on. The Activepieces/Sim-generated catalogue that used to hold providers is archived (#2012).\n * The two kinds differ in what they may contain and in how they are registered, so the difference is\n * named rather than inferred from which boundaries happen to be present.\n */\nexport enum ModuleKind {\n /**\n * An application feature: domain module layers, a minion or a worker. Every module published before\n * #2014 is one, which is why a manifest that omits `kind` reads as FEATURE.\n */\n FEATURE = 'feature',\n /**\n * One vendor's integration, installed at `providers/<ref>/` with ONE workspace package per facet\n * ({@link ProviderModuleFacet}): each carries its own SDK dependencies in its own `package.json`, and\n * each runtime depends only on the facet it runs. It may fill an engine capability when its tier is\n * EXTENSION.\n *\n * What a provider module never is:\n * - system-of-record facets: a separate lane, delivered by `@wildo-ai/systems-of-record` (#2013);\n * - an INFRASTRUCTURE provider (object storage, databases, brokers, scanners): those are executed by the\n * PLATFORM (apps-manager) with platform administrator credentials, so application-owned code must never\n * be one. They stay in the platform's own package, selected by the application's declaration (#1692).\n */\n PROVIDER = 'provider',\n}\n\n/**\n * The runtime facets a provider module can ship, each as its own workspace package under\n * `providers/<ref>/<facet>/` (Paul, 2026-09-29).\n *\n * One package per facet, as the engine itself separates `external-connectors-private` (backend) from\n * `external-connectors-public` (browser):\n * - a Node SDK never reaches a frontend install, and a browser SDK never reaches a backend's;\n * - each runtime owner depends on exactly the facet it runs, so imports stay unambiguous;\n * - the browser facet cannot reach backend code unless its own manifest declares that dependency, which\n * publish refuses. Isolation is a property of the dependency graph, not of scanning import statements.\n *\n * There is deliberately no INFRASTRUCTURE member: see {@link ModuleKind.PROVIDER}.\n */\nexport enum ProviderModuleFacet {\n /** Loaded by the application backend, the companion and minions. Workers load no providers. */\n BACKEND = 'backend',\n /** Loaded by the frontend services whose type is listed in its `surfaces`. */\n FRONTEND = 'frontend',\n}\n\n/**\n * How far a published provider has been taken since it was adopted (#2012).\n *\n * There is deliberately no SEEDED member: a seed (a catalogue transposition in the archive) is never\n * published, so the registry only ever holds providers someone adopted.\n */\nexport enum ProviderModuleMaturity {\n /** Copied from a seed or written by hand, reviewed, and owned by Wildo. Not yet met the real vendor. */\n ADOPTED = 'adopted',\n /** Has executed against the real vendor it names, with the proof recorded on the tracker. */\n PROVEN = 'proven',\n}\n\n/**\n * The tiers a PROVIDER module may declare. MAIN is the engine's own set: its origin is always ENGINE,\n * and the tier rule (`provider-tier-rule.shared.utils.ts`) refuses MAIN from anywhere else.\n */\nconst PROVIDER_MODULE_TIERS = [ProviderTier.CATALOGUE, ProviderTier.EXTENSION] as const;\n\n/**\n * The `provider` block of a PROVIDER module: what the registry must know about the provider WITHOUT\n * executing its code, which is what server-side search and listing need.\n *\n * Deliberately NOT carried here, so there is one source for each fact:\n * - the ENGINE capabilities it fills: derived from `providerCapabilities` through the same closed map the\n * engine uses (`engineSlotsBoundByCapabilities`);\n * - the compliance profile, secrets contract, operations and auth: they live in the module's code\n * (`BackendProviderModule`), which discovery already reads. Publish checks that this block agrees\n * with that code (#2014).\n *\n * Fields for per-provider skills, OpenAPI binding and change monitoring are added by the issues that\n * read them (#2026, #2028, #2027), not before.\n */\nexport const ModuleManifestProviderSchema = z\n .strictObject({\n /**\n * The provider ref: the application's scope key, the directory under `providers/`, and the suffix of\n * the package name. One kebab-case segment, the same alphabet as a registration directory.\n */\n ref: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN),\n /** The vendor's identity, shared by every ref of one vendor. Defaults to the ref, as provider metadata does. */\n vendor: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN).optional(),\n /** CATALOGUE (operations only) or EXTENSION (fills an engine capability). */\n tier: z.enum(PROVIDER_MODULE_TIERS),\n /** The provider capability tokens the module declares, as its `BackendProviderModule` does. */\n providerCapabilities: z.array(z.string().min(1)).default([]),\n /**\n * The facets the module ships, each a package at `providers/<ref>/<facet>/`. At least one.\n * Keys are {@link ProviderModuleFacet} members.\n */\n facets: z.strictObject({\n [ProviderModuleFacet.BACKEND]: z.strictObject({}).optional(),\n [ProviderModuleFacet.FRONTEND]: z\n .strictObject({\n /**\n * Which frontend surfaces the browser facet serves: the application, the public website, the\n * documentation site. Installation adds the facet's package only to frontend services of these\n * types. The engine composes a separate provider registry per surface, which is why it is named.\n */\n surfaces: z.array(z.enum(AppFrontendType)).min(1),\n })\n .optional(),\n }),\n maturity: z.enum(ProviderModuleMaturity),\n /** Where the adopted source came from, when it came from a catalogue seed. */\n seed: ProviderCatalogueProvenanceSchema.optional(),\n })\n .superRefine((provider, context) => {\n if (providerModuleFacets(provider).length === 0) {\n context.addIssue({ code: 'custom', path: ['facets'], message: 'a provider module ships a backend facet, a frontend facet, or both' });\n }\n const surfaces = provider.facets[ProviderModuleFacet.FRONTEND]?.surfaces ?? [];\n if (new Set(surfaces).size !== surfaces.length) {\n context.addIssue({ code: 'custom', path: ['facets', ProviderModuleFacet.FRONTEND, 'surfaces'], message: 'each frontend surface is listed once' });\n }\n const boundSlots = engineSlotsBoundByCapabilities(provider.providerCapabilities);\n if (provider.tier === ProviderTier.CATALOGUE && boundSlots.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerCapabilities'],\n message:\n `tier CATALOGUE may claim only open capability tokens, but ${boundSlots.map((entry) => `\"${entry.capability}\" binds the ${entry.slot} engine slot`).join(', ')}. `\n + 'Declare EXTENSION to fill an engine capability.',\n });\n }\n if (provider.tier === ProviderTier.EXTENSION && boundSlots.length === 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerCapabilities'],\n message: 'tier EXTENSION fills an engine capability, so at least one provider capability must bind an engine slot',\n });\n }\n });\nexport type ModuleManifestProvider = z.infer<typeof ModuleManifestProviderSchema>;\n\n/**\n * The facets a provider module ships, in canonical enum order, and the package directory of each.\n * Install, publish and registration all read these rather than re-deriving the layout.\n */\nexport function providerModuleFacets(provider: Pick<ModuleManifestProvider, 'facets'>): ProviderModuleFacet[] {\n return Object.values(ProviderModuleFacet).filter((facet) => provider.facets[facet] !== undefined);\n}\n\n/** `providers/<ref>/<facet>`: where one facet's workspace package lives. */\nexport function providerModuleFacetDirectory(ref: string, facet: ProviderModuleFacet): string {\n return `${MODULE_BOUNDARY_LAYER_ROOTS.providers}/${ref}/${facet}`;\n}\n\n/** The engine capabilities a provider module fills, derived rather than declared. */\nexport function engineCapabilitiesFilledByProviderModule(provider: ModuleManifestProvider): EngineCapability[] {\n return [...new Set(engineSlotsBoundByCapabilities(provider.providerCapabilities).map((entry) => entry.slot))];\n}\n\n/** The file a module's manifest lives in: at the root of every artifact, of a checkout module, and of a publishing application. */\nexport const MODULE_MANIFEST_FILE_NAME = 'wildo.module.json';\n\n/**\n * Top-level manifest. Stored at `wildo.module.json` inside every\n * artifact zip and at the registry server alongside its version row.\n *\n * `id` semantics: `<scope>/<name>` (e.g. `acme/billing`), separate\n * from the registry domain (e.g. `internal`). The id is reused as the lockfile entry key\n * (`sections.modules.installed[<id>]`).\n */\nexport const ModuleManifestSchema = z.object({\n id: ModuleIdSchema,\n version: SemverExact,\n /** What the module is. Absent reads as FEATURE: every module published before #2014 is one. */\n kind: z.enum(ModuleKind).default(ModuleKind.FEATURE),\n /** Present exactly when `kind` is PROVIDER. */\n provider: ModuleManifestProviderSchema.optional(),\n description: z.string().optional(),\n /** Free-form description of what the module ships, for `wildo registry info`. */\n longDescription: z.string().optional(),\n engine: ModuleManifestEngineSchema.optional(),\n boundaries: ModuleManifestBoundariesSchema.optional(),\n dependsOn: ModuleManifestDependenciesSchema.optional(),\n /** How the module is registered in a host application — see {@link ModuleManifestRegistrationSchema}. */\n registration: ModuleManifestRegistrationSchema.optional(),\n /**\n * Free-form key/value bag for non-load-bearing metadata\n * (homepage, license, repository). Phase 1 keeps it open;\n * Phase 6 may tighten it for `wildo registry publish` UX.\n */\n meta: z.record(z.string().min(1), z.unknown()).optional(),\n}).catchall(z.unknown()).superRefine((manifest, context) => {\n const providerBoundaries = manifest.boundaries?.providers ?? [];\n if (manifest.kind !== ModuleKind.PROVIDER) {\n if (manifest.provider !== undefined) {\n context.addIssue({ code: 'custom', path: ['provider'], message: 'only a module of kind `provider` carries a provider block' });\n }\n if (providerBoundaries.length > 0) {\n context.addIssue({ code: 'custom', path: ['boundaries', 'providers'], message: 'only a module of kind `provider` writes below `providers/`' });\n }\n return;\n }\n if (manifest.provider === undefined) {\n context.addIssue({ code: 'custom', path: ['provider'], message: 'a module of kind `provider` carries a provider block' });\n return;\n }\n // A provider's owners are the INSTALLING application's, so the installer derives its wiring (#2014). A manifest\n // that carried one would be telling an installer which of its files to edit.\n if (manifest.registration !== undefined) {\n context.addIssue({ code: 'custom', path: ['registration'], message: 'a provider module carries no registration: each installing application derives its own wiring' });\n }\n // A provider module IS one package directory: exactly `providers/<ref>`, and nothing in any other layer,\n // so installing it can never write into the application's own modules, minions or workers.\n const expected = `${MODULE_BOUNDARY_LAYER_ROOTS.providers}/${manifest.provider.ref}`;\n if (providerBoundaries.length !== 1 || providerBoundaries[0] !== expected) {\n context.addIssue({\n code: 'custom',\n path: ['boundaries', 'providers'],\n message: `a provider module's boundaries are exactly [\\`${expected}\\`] (found ${JSON.stringify(providerBoundaries)})`,\n });\n }\n const otherLayers = MODULE_BOUNDARY_LAYERS.filter((layer) => layer !== 'providers' && (manifest.boundaries?.[layer] ?? []).length > 0);\n if (otherLayers.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['boundaries'],\n message: `a provider module writes only below \\`providers/\\`, but it also declares ${otherLayers.join(', ')}`,\n });\n }\n});\nexport type ModuleManifest = z.infer<typeof ModuleManifestSchema>;\n"]}
1
+ {"version":3,"file":"module-manifest.schemas.js","sourceRoot":"","sources":["../../../../src/registry/module-manifest.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,EAAE,8BAA8B,EAAyB,MAAM,uBAAuB,CAAC;AAEhK;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAC7B,qLAAqL,CAAC;AACxL,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,EAAE;KACR,KAAK,CAAC,kBAAkB,EAAE,gEAAgE,CAAC;KAC3F,QAAQ,CAAC,sBAAsB,CAAC,CAAC;AACpC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AAG/F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,mCAAm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AC;IACvI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,YAAY,CAAC;YACpB,OAAO,EAAE,4EAA4E,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SAC9G,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Module manifest schema — `wildo.module.json` shipped inside every\n * registry artifact.\n *\n * Phase 1 fleshes out the dependency / boundary contract that Phase\n * 5+ install/update/remove flows need. The manifest is the single\n * cross-package contract every registry client signs against; new\n * fields require a plan amendment.\n *\n * Authoritative references (keep these in sync with edits below):\n * - KD-12 — modules cannot claim arbitrary top-level app ownership;\n * `boundaries` declares which app surfaces the artifact may write.\n * - KD-13 — npm + module + capability dependencies are explicit.\n * - KD-19 — runtime packages produced from installed module content\n * must NOT import `platform-config-lib`; this is enforced\n * downstream by Phase 5+ verification, not the manifest itself.\n */\n\nimport { z } from 'zod';\nimport { AppFrontendType, ProviderCatalogueProvenanceSchema, ProviderTier, engineSlotsBoundByCapabilities, type EngineCapability } from '@wildo-ai/saas-models';\n\n/**\n * Authoring shape for a nonempty version constraint. Registry release selectors\n * can resolve tags; manifest module/framework requirements instead use npm\n * semver ranges and are validated against the receiving application's recorded\n * module versions and installed framework packages before source adoption.\n */\nconst SemverRange = z.string().min(1).describe('npm-style semver range');\n\n/**\n * Exact `MAJOR.MINOR.PATCH[-prerelease][+build]` semver. The regex\n * mirrors the official semver.org grammar, so manifest authors\n * cannot publish version `^1.2.3` or `latest` and have install\n * silently treat it as concrete.\n */\nexport const SEMVER_EXACT_REGEX =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\nexport const SemverExactSchema = z\n .string()\n .regex(SEMVER_EXACT_REGEX, 'Expected exact semver `MAJOR.MINOR.PATCH` (no ranges, no tags)')\n .describe('Exact semver version');\nconst SemverExact = SemverExactSchema;\n\n/**\n * `dependsOn.modules.<moduleId>` — other Wildo modules that this\n * module requires. Install hard-fails by default if any required\n * module is missing (KD-13). Range resolution mirrors npm semver\n * semantics.\n */\nexport const ModuleManifestModuleDependenciesSchema = z.record(z.string().min(1), SemverRange);\nexport type ModuleManifestModuleDependencies = z.infer<typeof ModuleManifestModuleDependenciesSchema>;\n\n/**\n * `dependsOn.npm.dependencies` / `peerDependencies` — npm packages the installed module imports at runtime (KD-13);\n * for a provider module, see below: `dependencies` is its vendor pins and `peerDependencies` must stay empty.\n *\n * For a PROVIDER module, `dependencies` is the module's VENDOR PINS (#2787, epic #2786): the third-party packages its\n * facets use to talk to the vendor (`posthog-js`, `posthog-node`), each at an EXACT version, recorded here once. The\n * facets declare them as `\"*\"`, and the version an application runs comes from this record. Both publishing doors\n * refuse a provider module whose record disagrees with its facets (`providerModuleVendorPackageRefusals` in the CLI):\n * a range, a name the framework itself owns (`zod`, `react`), a facet dependency not recorded here or a record no\n * facet declares, a vendor package a browser entry loads EAGERLY (a dynamic `import()` may reach one), a backend facet\n * whose vendor dependencies differ from its `requiredPackages`, a browser SDK descriptor naming a package the facet does\n * not declare, and any `peerDependencies` (a vendor package's optional peers are the application's to resolve). A\n * vendor SDK is never pinned at the framework root.\n *\n * For any other module kind the fields keep their original meaning: what the operator is told to declare.\n */\nexport const ModuleManifestNpmDependenciesSchema = z.strictObject({\n dependencies: z.record(z.string().min(1), SemverRange).default({}),\n peerDependencies: z.record(z.string().min(1), SemverRange).default({}),\n /**\n * The recorded `dependencies` whose install script pnpm must run (#2787). pnpm runs a dependency's install script\n * only when the name is in `onlyBuiltDependencies`, so a vendor package that needs one is listed here, and adoption\n * adds it to the application's allow-list. pnpm's v9 lockfile does not record which packages need a build, so publish\n * reads the INSTALLED package's own manifest (an install lifecycle script, or a `binding.gyp`) when the facet resolves it.\n *\n * Optional with NO default, deliberately: a manifest is sent to the registry and written into an artifact as PARSED,\n * so a default would add this key to every manifest, and a registry server or CLI still on the earlier strict schema\n * would refuse all of them. Absent reads as none.\n */\n onlyBuiltDependencies: z.array(z.string().min(1)).optional(),\n});\nexport type ModuleManifestNpmDependencies = z.infer<typeof ModuleManifestNpmDependenciesSchema>;\n\n/**\n * `dependsOn.capabilities` — required EngineCapability names. Adoption validates\n * each name against the canonical enum and requires enabled:true in the host's\n * authored engineCapabilities. This proves declared activation, not provider\n * health. Strings remain the artifact format; the CLI performs host comparison.\n */\nexport const ModuleManifestCapabilityDependenciesSchema = z.array(z.string().min(1));\nexport type ModuleManifestCapabilityDependencies = z.infer<typeof ModuleManifestCapabilityDependenciesSchema>;\n\nexport const ModuleManifestDependenciesSchema = z.strictObject({\n modules: ModuleManifestModuleDependenciesSchema.default({}),\n npm: ModuleManifestNpmDependenciesSchema.default({\n dependencies: {},\n peerDependencies: {},\n }),\n capabilities: ModuleManifestCapabilityDependenciesSchema.default([]),\n});\nexport type ModuleManifestDependencies = z.infer<typeof ModuleManifestDependenciesSchema>;\n\n/**\n * Engine compatibility — the framework version range this module\n * targets. Install hard-fails by default if the host app's framework\n * version is outside the range. Every installed saas-models copy reached from\n * application workspace framework dependencies must satisfy it; desired pins\n * and the running CLI version are not installed application evidence.\n */\nexport const ModuleManifestEngineSchema = z.strictObject({\n framework: SemverRange,\n});\nexport type ModuleManifestEngine = z.infer<typeof ModuleManifestEngineSchema>;\n\n/**\n * One registry NAME segment — a domain slug, or either half of a module id. Lowercase ASCII letters,\n * digits, `.`, `_`, `-`, not starting with `.`, `_` or `-` (npm's package-name alphabet).\n *\n * These names are not only identifiers: the CLI builds filesystem paths from them\n * (`.wildo-saas/generated/modules-artifacts/<domain>/<scope>/<name>/…`) and runs a RECURSIVE delete\n * on those paths to wipe a stale staging or extraction tree. Until 2026-09-25 the only rule on a\n * module id was \"contains a `/`\", so a manifest `id` of `a/../../../..` made `wildo registry publish`\n * resolve its staging root to the application root and delete it. The rule is total over both\n * places a name is authored: a module's manifest, and a domain created on the registry server.\n */\nconst REGISTRY_NAME_SEGMENT_REGEX = /^[a-z0-9][a-z0-9._-]*$/;\nconst REGISTRY_NAME_SEGMENT_MAX_LENGTH = 64;\n\nfunction isRegistryNameSegment(segment: string): boolean {\n return segment.length <= REGISTRY_NAME_SEGMENT_MAX_LENGTH && REGISTRY_NAME_SEGMENT_REGEX.test(segment);\n}\n\n/** A registry domain slug (`acme`, `internal`) — one {@link isRegistryNameSegment} segment. */\nexport const RegistryDomainSlugSchema = z.string().refine(isRegistryNameSegment, {\n error: 'a registry domain must be lowercase letters, digits, `.`, `_` or `-`, starting with a letter or digit (max 64)',\n});\n\n/** Whether `moduleId` is a well-formed `<scope>/<name>` module id. */\nexport function isModuleId(moduleId: string): boolean {\n const segments = moduleId.split('/');\n return segments.length === 2 && segments.every(isRegistryNameSegment);\n}\n\n/**\n * A module id: exactly `<scope>/<name>` (e.g. `acme/billing`), each half a registry name segment.\n * The id is also the lockfile key, the registry URL segment, and — through the CLI — a directory\n * path, so its shape is the path-safety rule, not a style preference.\n */\nexport const ModuleIdSchema = z.string().refine(isModuleId, {\n error: 'a module id must be `<scope>/<name>` (e.g. `acme/billing`), each half lowercase letters, digits, `.`, `_` or `-`',\n});\n\n/**\n * Where each layer's MODULE directories live in a Wildo SaaS application, relative to its root.\n *\n * Derived from the scaffold, not invented: the `add-module` scenario creates a module's directories\n * under `shared-lib/src/modules/<id>`, `specifications/src/modules/<id>`, `frontend/src/modules/<id>`\n * and `backend-api/src/modules/<id>`; `add-minion` and `add-worker-node` create a package directory\n * under `minions/<dir>` and `workers/<dir>`.\n *\n * A registry module may write only BELOW one of these roots, in a directory it names. That is the\n * whole of KD-12, stated positively. Until 2026-09-25 the boundary rule refused only absolute paths\n * and `..` segments, so `.`, `.git/hooks`, `.wildo-saas` and `wildo.saas.config.ts` were all valid\n * boundaries: a published module could overwrite the host's configuration or plant a git hook, and\n * `wildo registry publish` would ship the author's `.env` and `secrets.json`.\n */\nexport const MODULE_BOUNDARY_LAYER_ROOTS = {\n specifications: 'specifications/src/modules',\n shared: 'shared-lib/src/modules',\n frontend: 'frontend/src/modules',\n backend: 'backend-api/src/modules',\n minions: 'minions',\n workers: 'workers',\n /**\n * A PROVIDER module's directory, `providers/<ref>` (#2014), holding one workspace package per facet\n * (`providers/<ref>/backend`, `providers/<ref>/frontend`). Like a minion or a worker, each facet is its\n * own package, so the root is a top-level directory rather than a layer's `src/modules`: the facet's own\n * `package.json` is where its vendor SDK dependency lives, and a runtime depends only on the facet it runs.\n */\n providers: 'providers',\n} as const;\nexport type ModuleBoundaryLayer = keyof typeof MODULE_BOUNDARY_LAYER_ROOTS;\n\n/** Every boundary layer, in the canonical order of {@link MODULE_BOUNDARY_LAYER_ROOTS}. */\nexport const MODULE_BOUNDARY_LAYERS = Object.keys(MODULE_BOUNDARY_LAYER_ROOTS) as ModuleBoundaryLayer[];\n\n/**\n * Directory names a module artifact may never contain, at any depth: dependency installs are the\n * consumer's to produce, never the publisher's to ship.\n */\nconst MODULE_ARTIFACT_FORBIDDEN_SEGMENTS: ReadonlySet<string> = new Set(['node_modules']);\n\n/**\n * Whether one `/`-separated path segment may appear in a module boundary or a module artifact.\n *\n * A DOT-prefixed segment is refused outright. That single rule removes `.git` (hooks run code on the\n * next commit), `.env` (a minion or worker package carries its generated secrets there),\n * `.wildo-saas` (the companion and machine-local state) and `..` / `.` (traversal and \"the whole\n * root\"). npm applies the same default for the same reason: `.git` and the like never enter a\n * published package.\n */\nfunction isAllowedModulePathSegment(segment: string): boolean {\n return segment.length > 0 && !segment.startsWith('.') && !MODULE_ARTIFACT_FORBIDDEN_SEGMENTS.has(segment);\n}\n\n/**\n * Whether `appRelativePath` (POSIX separators, relative to the application root) may be carried by a\n * module artifact. Used on BOTH sides of the registry so they cannot disagree:\n *\n * - `wildo registry publish` skips a file that fails it, so a secret beside the module's source is\n * never packed;\n * - `wildo registry add` / `update` / `repair` refuse an artifact containing one, before writing\n * anything — a correctly published artifact cannot contain it, so its presence means the bytes\n * did not come from `publish`.\n */\nexport function isModuleArtifactPathAllowed(appRelativePath: string): boolean {\n if (appRelativePath.includes('\\\\') || appRelativePath.startsWith('/')) return false;\n return appRelativePath.split('/').every(isAllowedModulePathSegment);\n}\n\n/**\n * Whether `appRelativePath` is a file a registry module can OWN in an application: a path a module\n * artifact may carry ({@link isModuleArtifactPathAllowed}) that also sits strictly below one of the\n * layer roots ({@link MODULE_BOUNDARY_LAYER_ROOTS}) — because an install only ever writes inside a\n * boundary, and every boundary lives there.\n *\n * This is the rule for a path RECORDED as installed (`sections.modules.installed[*].files`), which\n * `remove` and `update` delete. `isModuleArtifactPathAllowed` alone would let a hand-edited or badly\n * merged entry name `wildo.saas.config.ts` or `backend-api/src/index.ts`, and removing the module would\n * then delete the application's own file.\n */\nexport function isModuleOwnedFilePath(appRelativePath: string): boolean {\n return isModuleArtifactPathAllowed(appRelativePath)\n && Object.values(MODULE_BOUNDARY_LAYER_ROOTS).some((root) => appRelativePath.startsWith(`${root}/`));\n}\n\n/**\n * One layer's `boundaries` entries: each a directory strictly BELOW that layer's root\n * ({@link MODULE_BOUNDARY_LAYER_ROOTS}), written with POSIX separators, every segment allowed by\n * {@link isModuleArtifactPathAllowed}. Validated at parse time, so the registry server refuses a\n * manifest declaring a wider boundary at publish and the CLI refuses one at install.\n */\nfunction moduleLayerBoundariesSchema(layer: ModuleBoundaryLayer) {\n const root = MODULE_BOUNDARY_LAYER_ROOTS[layer];\n return z.array(\n z.string().min(1).refine(\n (entry) => isModuleArtifactPathAllowed(entry) && entry.startsWith(`${root}/`) && entry.length > root.length + 1,\n {\n error:\n `boundaries.${layer} entries must name a directory below \\`${root}/\\` (e.g. \\`${root}/acme-billing\\`), ` +\n 'with `/` separators and no segment that starts with `.` or is `node_modules`',\n },\n ),\n ).default([]);\n}\n\n/**\n * `boundaries` — the per-layer surface the module is allowed to write into the host app source\n * (KD-12). Each layer is optional; modules typically declare only the layers they actually contain\n * (a backend-only module declares `backend` + `shared` and omits `frontend` / `specifications`).\n */\nexport const ModuleManifestBoundariesSchema = z.strictObject({\n specifications: moduleLayerBoundariesSchema('specifications'),\n shared: moduleLayerBoundariesSchema('shared'),\n frontend: moduleLayerBoundariesSchema('frontend'),\n backend: moduleLayerBoundariesSchema('backend'),\n minions: moduleLayerBoundariesSchema('minions'),\n workers: moduleLayerBoundariesSchema('workers'),\n providers: moduleLayerBoundariesSchema('providers'),\n});\nexport type ModuleManifestBoundaries = z.infer<typeof ModuleManifestBoundariesSchema>;\n\n/**\n * The boundaries schema declares every layer of {@link MODULE_BOUNDARY_LAYER_ROOTS} and nothing else: a\n * root added without its boundaries key (or the reverse) fails to compile here.\n */\nexport const BOUNDARIES_SCHEMA_COVERS_EVERY_LAYER: [keyof ModuleManifestBoundaries] extends [ModuleBoundaryLayer]\n ? [ModuleBoundaryLayer] extends [keyof ModuleManifestBoundaries] ? true : never\n : never = true;\n\n/**\n * Every boundary directory a manifest declares, across ALL layers, in canonical layer order.\n *\n * The one place a consumer turns `boundaries` into a list. Three consumers (the packager, `publish`, the\n * install fan-out) each used to spell the six layers out by hand, so a seventh layer — `providers`,\n * #2014 — would have been silently skipped by all three: an artifact that packs nothing, an install that\n * copies nothing, and a publish that reports success. Iterating the roots makes the next layer impossible\n * to forget.\n */\nexport function flattenModuleBoundaries(boundaries: ModuleManifestBoundaries | undefined): string[] {\n if (!boundaries) return [];\n return MODULE_BOUNDARY_LAYERS.flatMap((layer) => boundaries[layer] ?? []);\n}\n\n/**\n * How an installed module is REGISTERED in the host application — the composition scenario whose\n * registry edits make it a module the application knows about (#1755, #1773).\n *\n * Installing copies a module's files; registering it adds it to what the application declares. Without\n * registration the backend discovers `backend-api/src/modules/<dir>` by directory scan while every other\n * layer ignores the module, and a minion or worker is never declared at all, so it never runs.\n *\n * Each member is the framework scenario that IS the declaration of how that shape is registered, so\n * installation replays its edit steps rather than keeping a second copy of them:\n */\nexport enum ModuleRegistrationScenario {\n /** A domain module — its shared, specifications and frontend registries and `applicationModules`. */\n ADD_MODULE = 'add-module',\n /** A minion — `applicationMinions`, its provider scope, and the pnpm workspace member. */\n ADD_MINION = 'add-minion',\n /** A worker node — `applicationWorkers`, its provider scope, and the pnpm workspace member. */\n ADD_WORKER_NODE = 'add-worker-node',\n /**\n * A provider module (#2014): the pnpm workspace member, each facet package as a `workspace:*` dependency of the\n * runtimes that own that facet, and the provider's scope in each. Unlike the three above it is never carried by a\n * MANIFEST: the owners are the INSTALLING application's, so the installer derives the wiring and only its lockfile\n * records it ({@link ProviderWiringSchema}).\n */\n ADD_PROVIDER_PACKAGE = 'add-provider-package',\n}\n\n/**\n * An application-relative service directory as `wildo.saas.config.ts` declares it (`./backend-api`, `frontend`).\n * Restricted to plain path segments, with no `..`, because a wiring names files the installer and `remove` edit.\n */\nconst WIRED_SERVICE_PATH_PATTERN = /^(\\.\\/)?(?!\\.\\.?(\\/|$))[A-Za-z0-9_-][A-Za-z0-9._-]*(\\/(?!\\.\\.?(\\/|$))[A-Za-z0-9_-][A-Za-z0-9._-]*)*$/;\n\n/**\n * The scenarios' variable patterns for the directory and camelCase stem their REGISTRY edits use\n * (`moduleId`/`moduleCamel`, `minionDir`/`minionCamel`, `workerDir`/`workerCamel` share them). Mirrored\n * here because the manifest is validated where no scenario is loaded (the registry server); a test pins\n * them equal to the scenarios' own declarations.\n */\nexport const MODULE_REGISTRATION_MODULE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;\nexport const MODULE_REGISTRATION_MODULE_CAMEL_PATTERN = /^[a-z][A-Za-z0-9]*$/;\n\n/** A scoped provider facet package name: `@<scope>/provider-<ref>` or `@<scope>/provider-<ref>-frontend`. */\nconst PROVIDER_FACET_PACKAGE_NAME_PATTERN = /^@[a-z0-9][a-z0-9._-]*\\/provider-[a-z][a-z0-9-]*$/;\n\n/** One runtime a provider facet was wired into: its key in `services`, and its directory. */\nexport const ProviderWiringOwnerSchema = z.strictObject({\n serviceKey: z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),\n path: z.string().regex(WIRED_SERVICE_PATH_PATTERN),\n});\nexport type ProviderWiringOwner = z.infer<typeof ProviderWiringOwnerSchema>;\n\n/**\n * What an `add-provider-package` install wired, as the INSTALLER derived it from its own application (#2014):\n * - `backendOwners`: the backend services that depend on the backend facet and scope the provider;\n * - `frontendOwners`: the frontend services, of a type in the facet's `surfaces`, that depend on the browser facet.\n * The install does not scope the provider there (#2579): naming it in a frontend scope is what loads it.\n *\n * Recorded so `remove` reverses exactly what install wrote, even after the application's services change.\n */\nexport const ProviderWiringSchema = z.strictObject({\n /** The backend facet's package name as installed (`@<scope>/provider-<ref>`); absent without a backend facet. */\n backendPackage: z.string().regex(PROVIDER_FACET_PACKAGE_NAME_PATTERN).optional(),\n backendOwners: z.array(ProviderWiringOwnerSchema),\n /** The browser facet's package name as installed; absent without a frontend facet. */\n frontendPackage: z.string().regex(PROVIDER_FACET_PACKAGE_NAME_PATTERN).optional(),\n frontendOwners: z.array(ProviderWiringOwnerSchema),\n /**\n * The provider an AUGMENTATION module adds operations to (#2022). Present, the install wrote NO scope: the module owns\n * no ref an application scopes, and adding its operations is the application's opt-in under\n * `providers.augmentations.<augments>`, which an install never writes (it would activate what nobody chose).\n */\n augments: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN).optional(),\n /**\n * The module's vendor pins (#2789): its `dependsOn.npm.dependencies`, exact versions, written into the application's\n * root `pnpm.overrides` by the install, as a framework pin is. Absent when the module records none, so a module with\n * no vendor package keeps the wiring it always had. Recorded so an update moves them, a later install of another\n * module pinning one of them differently is refused naming this one, and `remove` takes out what this install WROTE.\n */\n vendorPins: z.record(z.string().min(1), z.string().min(1)).optional(),\n /**\n * The vendor pins the application already held, at the module's version, when the install met them (#2789): left as\n * written, never written by the install, so `remove` leaves them too. An application pinning the SDK may use it\n * itself; the module taking that pin away on removal would leave the application's own dependency floating. Absent\n * when the install met none; never compared when deciding whether a wiring changed.\n */\n heldVendorPins: z.array(z.string().min(1)).optional(),\n /**\n * The vendor packages whose install script pnpm must run (#2801): the module's `dependsOn.npm.onlyBuiltDependencies`,\n * written into the application's root `package.json` → `pnpm.onlyBuiltDependencies` by the install, as its pins are.\n * Absent when the module records none. Recorded so an update moves them and `remove` takes out what this install WROTE.\n * Measured on pnpm 10.6.4 (#2801): that list is honoured in a multi-package workspace, and when `pnpm-workspace.yaml`\n * carries one too, pnpm reads this one and ignores the YAML. So an application keeping its list in the YAML file gets\n * nothing written (that would switch its list off); the install names the entries to add there instead.\n */\n onlyBuiltDependencies: z.array(z.string().min(1)).optional(),\n /**\n * The names the application's list already held when the install met them (#2801): never written by the install, so\n * `remove` leaves them. Absent when the install met none; never compared when deciding whether a wiring changed.\n */\n heldOnlyBuiltDependencies: z.array(z.string().min(1)).optional(),\n});\nexport type ProviderWiring = z.infer<typeof ProviderWiringSchema>;\n\n/** The application's root manifest, relative to its root: where a provider module's vendor pins are written (#2789). */\nexport const PROVIDER_VENDOR_PINS_MANIFEST = 'package.json';\n\n/**\n * The application's workspace file, relative to its root. When it carries an `onlyBuiltDependencies` list and the root\n * manifest carries none, a provider install writes no allow-list (#2801): a list in the manifest would replace it.\n */\nexport const PROVIDER_WORKSPACE_FILE = 'pnpm-workspace.yaml';\n\n/**\n * The four layers of a domain module, named as its manifest boundaries name them. A domain-module\n * registration may cover a SUBSET (#1773): a backend+shared module registers its shared entries and an\n * `applicationModules` entry bound to the backend only.\n */\nexport enum DomainModuleLayer {\n SHARED = 'shared',\n SPECIFICATIONS = 'specifications',\n FRONTEND = 'frontend',\n BACKEND = 'backend',\n}\n\n/**\n * Every domain layer is a boundary layer, spelled the same (#1773 review): the enum restates four keys of\n * `MODULE_BOUNDARY_LAYER_ROOTS`, so a member added or renamed on one side alone fails to compile here.\n */\nexport const DOMAIN_LAYERS_ARE_BOUNDARY_LAYERS: `${DomainModuleLayer}` extends ModuleBoundaryLayer ? true : never = true;\n\n/** Canonical order, so one set of layers has one spelling. */\nexport const DOMAIN_MODULE_LAYERS: readonly DomainModuleLayer[] = [\n DomainModuleLayer.SHARED,\n DomainModuleLayer.SPECIFICATIONS,\n DomainModuleLayer.FRONTEND,\n DomainModuleLayer.BACKEND,\n];\n\n\n/**\n * A module's registration: the scenario plus the ONLY values its registry edits read. It carries no\n * code — the installer renders the scenario's own edit steps with these values, both restricted to\n * identifier alphabets (and anything else a scenario needs is DERIVED by the installer, never read from\n * the manifest) — so a manifest cannot smuggle text into the host's files. Derived by\n * `wildo registry publish` from the publishing application (every edit already present), never authored.\n */\nexport const ModuleManifestRegistrationSchema = z\n .strictObject({\n scenario: z.enum(ModuleRegistrationScenario),\n /** The module's directory under its scenario's root: each layer's modules root, `minions/` or `workers/` (kebab-case). */\n moduleId: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN),\n /** The camelCase stem the scenario's entries are named from (`<stem>Module`, the minion/worker bucket key). */\n moduleCamel: z.string().regex(MODULE_REGISTRATION_MODULE_CAMEL_PATTERN),\n /**\n * `add-module` only: the layers the module covers, when it is NOT all four (absent = the whole module,\n * so one module has one spelling). Must include `backend` or `frontend`: an `applicationModules` entry\n * binds the module to at least one service.\n */\n layers: z.array(z.enum(DomainModuleLayer)).min(1).optional(),\n /** `add-provider-package` only, and required there: what the installer wired. */\n providerWiring: ProviderWiringSchema.optional(),\n })\n .superRefine((registration, context) => {\n const isProviderWiring = registration.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE;\n if (isProviderWiring !== (registration.providerWiring !== undefined)) {\n context.addIssue({ code: 'custom', path: ['providerWiring'], message: 'an add-provider-package registration carries its wiring, and no other registration does' });\n }\n const layers = registration.layers;\n if (layers === undefined) return;\n if (registration.scenario !== ModuleRegistrationScenario.ADD_MODULE) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'only an add-module registration covers layers' });\n return;\n }\n const canonical = DOMAIN_MODULE_LAYERS.filter((layer) => layers.includes(layer));\n if (canonical.length !== layers.length || canonical.some((layer, index) => layer !== layers[index])) {\n context.addIssue({ code: 'custom', path: ['layers'], message: `layers must be distinct and in canonical order (${DOMAIN_MODULE_LAYERS.join(', ')})` });\n }\n if (canonical.length === DOMAIN_MODULE_LAYERS.length) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'a whole module omits `layers`' });\n }\n if (!layers.includes(DomainModuleLayer.BACKEND) && !layers.includes(DomainModuleLayer.FRONTEND)) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'a registered module must include the backend or the frontend layer' });\n }\n });\nexport type ModuleManifestRegistration = z.infer<typeof ModuleManifestRegistrationSchema>;\n\n/**\n * What a registry module IS: the one discriminator every consumer branches on (#2014).\n *\n * The registry was built to carry application FEATURES. On 2026-09-29 Paul decided it also carries\n * PROVIDERS, distributed shadcn-style: a provider's source is copied into the application, which owns it\n * from then on. The Activepieces/Sim-generated catalogue that used to hold providers is archived (#2012).\n * The two kinds differ in what they may contain and in how they are registered, so the difference is\n * named rather than inferred from which boundaries happen to be present.\n */\nexport enum ModuleKind {\n /**\n * An application feature: domain module layers, a minion or a worker. Every module published before\n * #2014 is one, which is why a manifest that omits `kind` reads as FEATURE.\n */\n FEATURE = 'feature',\n /**\n * One vendor's integration, installed at `providers/<ref>/` with ONE workspace package per facet\n * ({@link ProviderModuleFacet}): each carries its own SDK dependencies in its own `package.json`, and\n * each runtime depends only on the facet it runs. It may fill an engine capability when its tier is\n * EXTENSION.\n *\n * What a provider module never is:\n * - system-of-record facets: a separate lane, delivered by `@wildo-ai/systems-of-record` (#2013);\n * - an INFRASTRUCTURE provider (object storage, databases, brokers, scanners): those are executed by the\n * PLATFORM (apps-manager) with platform administrator credentials, so application-owned code must never\n * be one. They stay in the platform's own package, selected by the application's declaration (#1692).\n */\n PROVIDER = 'provider',\n /**\n * An application blueprint (epic #2856): a layer upon the `wildo init` base, published here so an organization's\n * blueprints are distributed exactly like its modules. Its zip holds the packed blueprint (`blueprint.json` +\n * `files/`) beside this manifest, which carries its identity and nothing an install would act on — no boundaries,\n * no registration, no provider block. It is never installed into an existing application: `wildo registry add`\n * refuses it, and `wildo init --blueprint` is the only door that applies one.\n */\n BLUEPRINT = 'blueprint',\n}\n\n/**\n * The runtime facets a provider module can ship, each as its own workspace package under\n * `providers/<ref>/<facet>/` (Paul, 2026-09-29).\n *\n * One package per facet, as the engine itself separates `external-connectors-private` (backend) from\n * `external-connectors-public` (browser):\n * - a Node SDK never reaches a frontend install, and a browser SDK never reaches a backend's;\n * - each runtime owner depends on exactly the facet it runs, so imports stay unambiguous;\n * - the browser facet cannot reach backend code unless its own manifest declares that dependency, which\n * publish refuses. Isolation is a property of the dependency graph, not of scanning import statements.\n *\n * There is deliberately no INFRASTRUCTURE member: see {@link ModuleKind.PROVIDER}.\n */\nexport enum ProviderModuleFacet {\n /** Loaded by the application backend, the companion and minions. Workers load no providers. */\n BACKEND = 'backend',\n /** Loaded by the frontend services whose type is listed in its `surfaces`. */\n FRONTEND = 'frontend',\n}\n\n/**\n * How far a published provider has been taken since it was adopted (#2012).\n *\n * There is deliberately no SEEDED member: a seed (a catalogue transposition in the archive) is never\n * published, so the registry only ever holds providers someone adopted.\n */\nexport enum ProviderModuleMaturity {\n /** Copied from a seed or written by hand, reviewed, and owned by Wildo. Not yet met the real vendor. */\n ADOPTED = 'adopted',\n /** Has executed against the real vendor it names, with the proof recorded on the tracker. Requires `proof` (#2515). */\n PROVEN = 'proven',\n}\n\n/**\n * Where a PROVEN provider module's proof is, and what it covered (#2515).\n *\n * `proven` used to be a word nobody checked: a module could claim it with no proof, and asana, which #333 drove\n * against Asana end to end, still read `adopted`. So the claim now names its evidence, and the manifest refuses\n * `proven` without it and a proof on an `adopted` module.\n *\n * - `issue` is the tracker issue whose closing evidence records the run. The tracker is where proof lives, by the\n * same rule that keeps every durable record there; a manifest field cannot hold a run's output.\n * - `operations` are the operations the run actually called, named as the module declares them: a REST operation id,\n * an augmentation's operation id, or a capability arm's operation (`extractDocumentText`). Publish refuses a name\n * the module does not declare (`providerModuleCodeRefusals`), so a proof cannot outlive a renamed operation. An\n * operation the run did not call is not proven, however similar it is.\n * - `provenAt` is the day the run happened. A vendor changes under a module that stays still, so the date is what\n * tells a reader how old the evidence is.\n *\n * Rejected: deriving maturity from the tracker at publish. Publish runs offline and from a commit, and a check that\n * needs the GitHub API to pass would fail closed on every machine without a token.\n */\nexport const ModuleManifestProviderProofSchema = z.strictObject({\n issue: z.number().int().positive(),\n provenAt: z.iso.date(),\n operations: z.array(z.string().min(1)).min(1),\n});\nexport type ModuleManifestProviderProof = z.infer<typeof ModuleManifestProviderProofSchema>;\n\n/**\n * What the OpenAPI conformance check (#2028) can find wrong with one declared operation, compared with the vendor's\n * own description. Each names a request the module would send that the vendor never described, because that is what\n * makes a call fail at the vendor while every Wildo check passes: the archive's first real socket test found 231 GET\n * operations declaring a body, all of which had passed schema checks.\n */\nexport enum ProviderOpenApiFindingKind {\n /** No operation of the description has this method and path. */\n OPERATION_NOT_DESCRIBED = 'operation-not-described',\n /** A query or header parameter the module sends, which the described operation does not take. */\n PARAMETER_NOT_DESCRIBED = 'parameter-not-described',\n /** A query or header parameter the description requires, which the module never sends. */\n REQUIRED_PARAMETER_NOT_DECLARED = 'required-parameter-not-declared',\n /** The module sends a body to an operation the description gives none. */\n BODY_NOT_DESCRIBED = 'body-not-described',\n /** The description requires a body, and the module sends none (a body it could not model and left out). */\n BODY_REQUIRED_NOT_SENT = 'body-required-not-sent',\n /** The module encodes its body as a media type the described operation does not accept. */\n BODY_ENCODING_NOT_DESCRIBED = 'body-encoding-not-described',\n /** A field of the module's body, which the described body schema does not have. */\n BODY_FIELD_NOT_DESCRIBED = 'body-field-not-described',\n}\n\n/**\n * A finding the module keeps on purpose, with the reason: the description is not always right, and a vendor that\n * accepts what it never described is common. Refused when it matches no finding, so it cannot outlive the deviation it\n * excuses. `subject` is the parameter or field the finding names; absent for a whole-operation finding.\n */\nexport const ModuleManifestProviderOpenApiDeviationSchema = z.strictObject({\n operationId: z.string().min(1),\n finding: z.enum(ProviderOpenApiFindingKind),\n subject: z.string().min(1).optional(),\n reason: z.string().min(1),\n});\nexport type ModuleManifestProviderOpenApiDeviation = z.infer<typeof ModuleManifestProviderOpenApiDeviationSchema>;\n\n/**\n * The vendor's own OpenAPI description a module's operations are checked against at publish (#2028).\n *\n * - `url` must not move: a commit-pinned raw URL, or a versioned path. The check is a statement about one document,\n * and a URL that changes under it would make the same commit pass on Monday and fail on Tuesday. Watching for a NEW\n * description is #2027's, a different question.\n * - `revision` is the description's own `info.version`, as read when the module was checked. Publish refuses a\n * document reporting another. That catches a moved URL only when the vendor bumps its version, and many never do\n * (Asana's is `1.0`), so it is not what keeps the URL fixed: the URL is. Publish refuses a GitHub raw URL on a\n * branch rather than a commit, the common way such a URL moves.\n *\n * Optional: about a quarter of the archived vendors had an official description at all. A module without one is\n * checked by its live proof only.\n */\nexport const ModuleManifestProviderOpenApiSchema = z.strictObject({\n url: z.url({ protocol: /^https$/ }),\n revision: z.string().min(1),\n deviations: z.array(ModuleManifestProviderOpenApiDeviationSchema).optional(),\n});\nexport type ModuleManifestProviderOpenApi = z.infer<typeof ModuleManifestProviderOpenApiSchema>;\n\n/**\n * The tiers a PROVIDER module may declare. MAIN is the engine's own set: its origin is always ENGINE,\n * and the tier rule (`provider-tier-rule.shared.utils.ts`) refuses MAIN from anywhere else.\n */\nconst PROVIDER_MODULE_TIERS = [ProviderTier.CATALOGUE, ProviderTier.EXTENSION] as const;\n\n/**\n * The `provider` block of a PROVIDER module: what the registry must know about the provider WITHOUT\n * executing its code, which is what server-side search and listing need.\n *\n * Deliberately NOT carried here, so there is one source for each fact:\n * - the ENGINE capabilities it fills: derived from `providerCapabilities` through the same closed map the\n * engine uses (`engineSlotsBoundByCapabilities`);\n * - the compliance profile, secrets contract, operations and auth: they live in the module's code\n * (`BackendProviderModule`), which discovery already reads. Publish checks that this block agrees\n * with that code (#2014).\n *\n * The OpenAPI binding is `openApi` (#2028); a field for change monitoring is added by the issue that reads it (#2027),\n * not before. Per-provider skills are `skills` (#2026).\n */\nexport const ModuleManifestProviderSchema = z\n .strictObject({\n /**\n * The provider ref: the application's scope key, the directory under `providers/`, and the suffix of\n * the package name. One kebab-case segment, the same alphabet as a registration directory.\n */\n ref: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN),\n /** The vendor's identity, shared by every ref of one vendor. Defaults to the ref, as provider metadata does. */\n vendor: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN).optional(),\n /** CATALOGUE (operations only) or EXTENSION (fills an engine capability). */\n tier: z.enum(PROVIDER_MODULE_TIERS),\n /** The provider capability tokens the module declares, as its `BackendProviderModule` does. */\n providerCapabilities: z.array(z.string().min(1)).default([]),\n /**\n * The facets the module ships, each a package at `providers/<ref>/<facet>/`. At least one.\n * Keys are {@link ProviderModuleFacet} members.\n */\n facets: z.strictObject({\n [ProviderModuleFacet.BACKEND]: z.strictObject({}).optional(),\n [ProviderModuleFacet.FRONTEND]: z\n .strictObject({\n /**\n * Which frontend surfaces the browser facet serves: the application, the public website, the\n * documentation site. Installation adds the facet's package only to frontend services of these\n * types. The engine composes a separate provider registry per surface, which is why it is named.\n */\n surfaces: z.array(z.enum(AppFrontendType)).min(1),\n })\n .optional(),\n }),\n maturity: z.enum(ProviderModuleMaturity),\n /** Present exactly when `maturity` is `proven`: where the proof is and what it covered. See {@link ModuleManifestProviderProofSchema}. */\n proof: ModuleManifestProviderProofSchema.optional(),\n /** The vendor's OpenAPI description the operations are checked against at publish. See {@link ModuleManifestProviderOpenApiSchema}. */\n openApi: ModuleManifestProviderOpenApiSchema.optional(),\n /** Where the adopted source came from, when it came from a catalogue seed. */\n seed: ProviderCatalogueProvenanceSchema.optional(),\n /**\n * Present when the module is an AUGMENTATION (#1672, #2022): it adds OPERATIONS to the provider `augments` names,\n * owned by the engine or by another package, and owns nothing else. The base keeps its identity, base URL,\n * credential, OAuth2 block and connections, so an augmentation module:\n * - ships the backend facet only (its operations run where the base's do);\n * - is tier CATALOGUE and declares no provider capabilities (it binds no engine slot);\n * - exports `providerAugmentations` from its backend facet instead of a `backendProviderFragment`.\n *\n * `ref` still names the module: its directory under `providers/` and its package name. Installing it adds\n * nothing to the base until the application opts it in under `providers.augmentations.<augments>`.\n */\n augments: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN).optional(),\n /**\n * The skills the module ships (#2026), each a folder `skills/<id>/SKILL.md` inside the module. Installing the module\n * installs them into the application's `.claude/skills/` (the skills sync reads the application's `providers/` tree),\n * and removing it removes them. Read by `wildo registry add` / `update`, which run the skills sync when a provider\n * carries skills, and by publish, which holds this list equal to the folders. An id is `provider-<ref>` or\n * `provider-<ref>-<topic>`.\n */\n skills: z.array(z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN)).optional(),\n })\n .superRefine((provider, context) => {\n if (provider.maturity === ProviderModuleMaturity.PROVEN && provider.proof === undefined) {\n context.addIssue({ code: 'custom', path: ['proof'], message: 'a `proven` provider names its proof: the tracker issue that records the run, the day, and the operations it called' });\n }\n if (provider.maturity !== ProviderModuleMaturity.PROVEN && provider.proof !== undefined) {\n context.addIssue({ code: 'custom', path: ['maturity'], message: 'a provider with a proof is `proven`; one that has not met its vendor carries no proof' });\n }\n const provenOperations = provider.proof?.operations ?? [];\n if (new Set(provenOperations).size !== provenOperations.length) {\n context.addIssue({ code: 'custom', path: ['proof', 'operations'], message: 'each proven operation is listed once' });\n }\n const skills = provider.skills ?? [];\n if (new Set(skills).size !== skills.length) {\n context.addIssue({ code: 'custom', path: ['skills'], message: 'each skill is listed once' });\n }\n for (const [index, skill] of skills.entries()) {\n if (skill !== `provider-${provider.ref}` && !skill.startsWith(`provider-${provider.ref}-`)) {\n context.addIssue({ code: 'custom', path: ['skills', index], message: `a skill of provider \"${provider.ref}\" is named \"provider-${provider.ref}\" or \"provider-${provider.ref}-<topic>\"` });\n }\n }\n if (provider.augments !== undefined) {\n const facets = providerModuleFacets(provider);\n if (facets.length !== 1 || facets[0] !== ProviderModuleFacet.BACKEND) {\n context.addIssue({ code: 'custom', path: ['facets'], message: 'an augmentation ships the backend facet only: its operations run where the base provider runs' });\n }\n if (provider.tier !== ProviderTier.CATALOGUE) {\n context.addIssue({ code: 'custom', path: ['tier'], message: 'an augmentation is tier CATALOGUE: it adds operations and binds no engine slot' });\n }\n if (provider.providerCapabilities.length > 0) {\n context.addIssue({ code: 'custom', path: ['providerCapabilities'], message: 'an augmentation declares no provider capabilities: the base provider owns them' });\n }\n if (provider.augments === provider.ref) {\n context.addIssue({ code: 'custom', path: ['augments'], message: 'an augmentation names another provider: its own ref is the module\\'s, the base is the one it adds operations to' });\n }\n }\n if (providerModuleFacets(provider).length === 0) {\n context.addIssue({ code: 'custom', path: ['facets'], message: 'a provider module ships a backend facet, a frontend facet, or both' });\n }\n const surfaces = provider.facets[ProviderModuleFacet.FRONTEND]?.surfaces ?? [];\n if (new Set(surfaces).size !== surfaces.length) {\n context.addIssue({ code: 'custom', path: ['facets', ProviderModuleFacet.FRONTEND, 'surfaces'], message: 'each frontend surface is listed once' });\n }\n const boundSlots = engineSlotsBoundByCapabilities(provider.providerCapabilities);\n if (provider.tier === ProviderTier.CATALOGUE && boundSlots.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerCapabilities'],\n message:\n `tier CATALOGUE may claim only open capability tokens, but ${boundSlots.map((entry) => `\"${entry.capability}\" binds the ${entry.slot} engine slot`).join(', ')}. `\n + 'Declare EXTENSION to fill an engine capability.',\n });\n }\n if (provider.tier === ProviderTier.EXTENSION && boundSlots.length === 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerCapabilities'],\n message: 'tier EXTENSION fills an engine capability, so at least one provider capability must bind an engine slot',\n });\n }\n });\nexport type ModuleManifestProvider = z.infer<typeof ModuleManifestProviderSchema>;\n\n/**\n * The facets a provider module ships, in canonical enum order, and the package directory of each.\n * Install, publish and registration all read these rather than re-deriving the layout.\n */\nexport function providerModuleFacets(provider: Pick<ModuleManifestProvider, 'facets'>): ProviderModuleFacet[] {\n return Object.values(ProviderModuleFacet).filter((facet) => provider.facets[facet] !== undefined);\n}\n\n/** `providers/<ref>/<facet>`: where one facet's workspace package lives. */\nexport function providerModuleFacetDirectory(ref: string, facet: ProviderModuleFacet): string {\n return `${MODULE_BOUNDARY_LAYER_ROOTS.providers}/${ref}/${facet}`;\n}\n\n/** The engine capabilities a provider module fills, derived rather than declared. */\nexport function engineCapabilitiesFilledByProviderModule(provider: ModuleManifestProvider): EngineCapability[] {\n return [...new Set(engineSlotsBoundByCapabilities(provider.providerCapabilities).map((entry) => entry.slot))];\n}\n\n/** The file a module's manifest lives in: at the root of every artifact, of a checkout module, and of a publishing application. */\nexport const MODULE_MANIFEST_FILE_NAME = 'wildo.module.json';\n\n/**\n * Top-level manifest. Stored at `wildo.module.json` inside every\n * artifact zip and at the registry server alongside its version row.\n *\n * `id` semantics: `<scope>/<name>` (e.g. `acme/billing`), separate\n * from the registry domain (e.g. `internal`). The id is reused as the lockfile entry key\n * (`sections.modules.installed[<id>]`).\n */\nexport const ModuleManifestSchema = z.object({\n id: ModuleIdSchema,\n version: SemverExact,\n /**\n * What the module is. Absent reads as FEATURE: every module published before #2014 is one.\n *\n * A kind this CLI does not know is a module published by a NEWER framework (`blueprint` reached CLIs that had only\n * `feature` and `provider`, #2861). It refuses with the upgrade to make, not a schema dump: nothing about the module\n * is wrong, the reader is old.\n */\n kind: z.enum(ModuleKind, {\n // Shared by the CLI and the registry server, so it names the reader generically and the CLI's upgrade as an example.\n error: (issue) => `module kind '${String(issue.input)}' is not known to this version of the Wildo CLI or registry (it knows ${Object.values(ModuleKind).join(', ')}); `\n + 'the module comes from a newer framework: upgrade the reader (for the CLI, `wildo update`)',\n }).default(ModuleKind.FEATURE),\n /** Present exactly when `kind` is PROVIDER. */\n provider: ModuleManifestProviderSchema.optional(),\n description: z.string().optional(),\n /** Free-form description of what the module ships, for `wildo registry info`. */\n longDescription: z.string().optional(),\n engine: ModuleManifestEngineSchema.optional(),\n boundaries: ModuleManifestBoundariesSchema.optional(),\n dependsOn: ModuleManifestDependenciesSchema.optional(),\n /** How the module is registered in a host application — see {@link ModuleManifestRegistrationSchema}. */\n registration: ModuleManifestRegistrationSchema.optional(),\n /**\n * Free-form key/value bag for non-load-bearing metadata\n * (homepage, license, repository). Phase 1 keeps it open;\n * Phase 6 may tighten it for `wildo registry publish` UX.\n */\n meta: z.record(z.string().min(1), z.unknown()).optional(),\n}).catchall(z.unknown()).superRefine((manifest, context) => {\n if (manifest.kind === ModuleKind.BLUEPRINT) {\n // A blueprint's content is its own artifact (`blueprint.json`), read by `wildo init --blueprint`; a manifest that\n // also declared boundaries or a registration would be telling a module install what to write.\n if (manifest.boundaries !== undefined) context.addIssue({ code: 'custom', path: ['boundaries'], message: 'a blueprint declares no boundaries: its content is its blueprint.json' });\n if (manifest.registration !== undefined) context.addIssue({ code: 'custom', path: ['registration'], message: 'a blueprint carries no registration' });\n if (manifest.provider !== undefined) context.addIssue({ code: 'custom', path: ['provider'], message: 'only a module of kind `provider` carries a provider block' });\n return;\n }\n const providerBoundaries = manifest.boundaries?.providers ?? [];\n if (manifest.kind !== ModuleKind.PROVIDER) {\n if (manifest.provider !== undefined) {\n context.addIssue({ code: 'custom', path: ['provider'], message: 'only a module of kind `provider` carries a provider block' });\n }\n if (providerBoundaries.length > 0) {\n context.addIssue({ code: 'custom', path: ['boundaries', 'providers'], message: 'only a module of kind `provider` writes below `providers/`' });\n }\n return;\n }\n if (manifest.provider === undefined) {\n context.addIssue({ code: 'custom', path: ['provider'], message: 'a module of kind `provider` carries a provider block' });\n return;\n }\n // A provider's owners are the INSTALLING application's, so the installer derives its wiring (#2014). A manifest\n // that carried one would be telling an installer which of its files to edit.\n if (manifest.registration !== undefined) {\n context.addIssue({ code: 'custom', path: ['registration'], message: 'a provider module carries no registration: each installing application derives its own wiring' });\n }\n // A provider module IS one package directory: exactly `providers/<ref>`, and nothing in any other layer,\n // so installing it can never write into the application's own modules, minions or workers.\n const expected = `${MODULE_BOUNDARY_LAYER_ROOTS.providers}/${manifest.provider.ref}`;\n if (providerBoundaries.length !== 1 || providerBoundaries[0] !== expected) {\n context.addIssue({\n code: 'custom',\n path: ['boundaries', 'providers'],\n message: `a provider module's boundaries are exactly [\\`${expected}\\`] (found ${JSON.stringify(providerBoundaries)})`,\n });\n }\n const otherLayers = MODULE_BOUNDARY_LAYERS.filter((layer) => layer !== 'providers' && (manifest.boundaries?.[layer] ?? []).length > 0);\n if (otherLayers.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['boundaries'],\n message: `a provider module writes only below \\`providers/\\`, but it also declares ${otherLayers.join(', ')}`,\n });\n }\n});\nexport type ModuleManifest = z.infer<typeof ModuleManifestSchema>;\n"]}
@@ -50,6 +50,7 @@ export declare const ModuleSearchHitProviderSchema: z.ZodObject<{
50
50
  ref: z.ZodString;
51
51
  maturity: z.ZodEnum<typeof ProviderModuleMaturity>;
52
52
  engineCapabilities: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<EngineCapability[], string[]>>;
53
+ augments: z.ZodOptional<z.ZodString>;
53
54
  }, z.core.$strip>;
54
55
  export type ModuleSearchHitProvider = z.infer<typeof ModuleSearchHitProviderSchema>;
55
56
  /**
@@ -65,6 +66,7 @@ export declare const ModuleSearchHitSchema: z.ZodObject<{
65
66
  ref: z.ZodString;
66
67
  maturity: z.ZodEnum<typeof ProviderModuleMaturity>;
67
68
  engineCapabilities: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<EngineCapability[], string[]>>;
69
+ augments: z.ZodOptional<z.ZodString>;
68
70
  }, z.core.$strip>>;
69
71
  }, z.core.$strip>;
70
72
  export type ModuleSearchHit = z.infer<typeof ModuleSearchHitSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"module-search.schemas.d.ts","sourceRoot":"","sources":["../../../../src/registry/module-search.schemas.ts"],"names":[],"mapp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Ae,EAAE,MAAM,GAAG,UAAU,CAAC,CAgBzG"}
@@ -66,6 +66,12 @@ export const ModuleSearchHitProviderSchema = z.object({
66
66
  ref: z.string().min(1),
67
67
  maturity: z.enum(ProviderModuleMaturity),
68
68
  engineCapabilities: z.array(z.string()).transform((values) => values.filter((value) => KNOWN_ENGINE_CAPABILITIES.has(value))),
69
+ /**
70
+ * The provider an AUGMENTATION adds its operations to (#1672, #2022), so a reader can tell from the hit that the
71
+ * module owns no connection and is bound as that base ref. Optional on the wire: a registry deployed before #2025
72
+ * sends none, and the hit then reads like any provider's.
73
+ */
74
+ augments: z.string().min(1).optional(),
69
75
  });
70
76
  /**
71
77
  * One search hit on the wire. `kind` and `provider` are optional because a registry deployed before #2014 sends
@@ -105,7 +111,14 @@ export function moduleSearchHitFacts(manifest) {
105
111
  return {
106
112
  kind,
107
113
  ...(kind === ModuleKind.PROVIDER && provider !== undefined
108
- ? { provider: { ref: provider.ref, maturity: provider.maturity, engineCapabilities: engineCapabilitiesFilledByProviderModule(provider) } }
114
+ ? {
115
+ provider: {
116
+ ref: provider.ref,
117
+ maturity: provider.maturity,
118
+ engineCapabilities: engineCapabilitiesFilledByProviderModule(provider),
119
+ ...(provider.augments !== undefined ? { augments: provider.augments } : {}),
120
+ },
121
+ }
109
122
  : {}),
110
123
  };
111
124
  }
@@ -1 +1 @@
1
- {"version":3,"file":"module-search.schemas.js","sourceRoot":"","sources":["../../../../src/registry/module-search.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,wCAAwC,GAEzC,MAAM,2BAA2B,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,IAA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What a registry search may filter on, and what a hit says about the module (#2014, epic #2012).\n *\n * Once providers are distributed through the registry, \"find me a module\" becomes \"find me a provider that fills\n * this engine capability\". The three filters are the manifest's own axes: its KIND, the ENGINE CAPABILITY a provider\n * fills (derived from its provider capabilities, never declared twice), and a provider's MATURITY.\n *\n * One predicate, {@link moduleManifestMatchesSearchFilter}, answers the question for every source a search reads —\n * the registry server's stored manifests and a framework checkout's `providers-registry/` (#2015) — so the two\n * cannot disagree about what a filter means.\n */\nimport { z } from 'zod';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport {\n ModuleKind,\n ProviderModuleMaturity,\n engineCapabilitiesFilledByProviderModule,\n type ModuleManifest,\n} from './module-manifest.schemas';\n\n/**\n * The filters a search accepts. Each absent filter matches everything.\n *\n * `engineCapability` and `maturity` are provider axes, so either one excludes every FEATURE module: a feature module\n * fills no engine capability and has no maturity.\n */\nexport const ModuleSearchFilterSchema = z.strictObject({\n kind: z.enum(ModuleKind).optional(),\n engineCapability: z.enum(EngineCapability).optional(),\n maturity: z.enum(ProviderModuleMaturity).optional(),\n});\nexport type ModuleSearchFilter = z.infer<typeof ModuleSearchFilterSchema>;\n\n/** The query-string keys, in the order a client writes them. One list, so the server and the client name them alike. */\nexport const MODULE_SEARCH_FILTER_KEYS = ['kind', 'engineCapability', 'maturity'] as const satisfies readonly (keyof ModuleSearchFilter)[];\n\n/** Whether a manifest passes every filter given. */\nexport function moduleManifestMatchesSearchFilter(manifest: ModuleManifest, filter: ModuleSearchFilter): boolean {\n const kind = manifest.kind ?? ModuleKind.FEATURE;\n if (filter.kind !== undefined && kind !== filter.kind) return false;\n if (filter.engineCapability === undefined && filter.maturity === undefined) return true;\n const provider = manifest.provider;\n if (kind !== ModuleKind.PROVIDER || provider === undefined) return false;\n if (filter.maturity !== undefined && provider.maturity !== filter.maturity) return false;\n if (filter.engineCapability !== undefined && !engineCapabilitiesFilledByProviderModule(provider).includes(filter.engineCapability)) return false;\n return true;\n}\n\n/**\n * A search's filters as query-string pairs, only for the filters given. The client writes them; the server reads them\n * back through {@link ModuleSearchFilterSchema}, which refuses an unknown value rather than ignoring it: a filter that\n * silently matched everything would answer \"every module\" to a question about one kind.\n */\nexport function moduleSearchFilterQueryPairs(filter: ModuleSearchFilter): Array<[string, string]> {\n return MODULE_SEARCH_FILTER_KEYS.flatMap((key) => (filter[key] === undefined ? [] : [[key, String(filter[key])] as [string, string]]));\n}\n\nconst KNOWN_ENGINE_CAPABILITIES: ReadonlySet<string> = new Set(Object.values(EngineCapability));\n\n/**\n * What a search hit says about a provider module, so a list can be read without an `info` per hit.\n *\n * `engineCapabilities` is read as strings and narrowed to the members THIS client knows (#2014 re-review I1): a\n * registry newer than the client may name a capability added since, and refusing the whole search over it would turn\n * a vocabulary step into an outage. A member the client does not know is dropped from the hit, which is also the only\n * thing the client could do with it: no filter it can express names that member.\n *\n * Known limit, kept deliberately: `kind` and `maturity` stay strict. An unknown member there is not a detail to drop\n * but a module the client cannot classify at all (a kind it would install how? a maturity it would rank where?), so a\n * newer registry adding one still fails the search, and the remedy is updating the CLI.\n */\nexport const ModuleSearchHitProviderSchema = z.object({\n ref: z.string().min(1),\n maturity: z.enum(ProviderModuleMaturity),\n engineCapabilities: z.array(z.string()).transform((values) => values.filter((value): value is EngineCapability => KNOWN_ENGINE_CAPABILITIES.has(value))),\n});\nexport type ModuleSearchHitProvider = z.infer<typeof ModuleSearchHitProviderSchema>;\n\n/**\n * One search hit on the wire. `kind` and `provider` are optional because a registry deployed before #2014 sends\n * neither; a client reads an absent `kind` as FEATURE, as the manifest does.\n */\nexport const ModuleSearchHitSchema = z.object({\n moduleId: z.string().min(1),\n description: z.string().optional(),\n latestVersion: z.string(),\n kind: z.enum(ModuleKind).optional(),\n provider: ModuleSearchHitProviderSchema.optional(),\n});\nexport type ModuleSearchHit = z.infer<typeof ModuleSearchHitSchema>;\n\n/**\n * Whether a HIT passes the filters, read from the facts the hit carries. The client re-applies it to what a server\n * answers (#2014 review F9): a registry deployed before #2014 ignores the filter parameters and answers every module,\n * and a filtered search must not then fail open. A hit with no `kind` is a FEATURE module, and one with no `provider`\n * facts matches no provider filter, so an old server's answer to a provider search is empty rather than everything.\n */\nexport function moduleSearchHitMatchesFilter(hit: Pick<ModuleSearchHit, 'kind' | 'provider'>, filter: ModuleSearchFilter): boolean {\n const kind = hit.kind ?? ModuleKind.FEATURE;\n if (filter.kind !== undefined && kind !== filter.kind) return false;\n if (filter.engineCapability === undefined && filter.maturity === undefined) return true;\n if (kind !== ModuleKind.PROVIDER || hit.provider === undefined) return false;\n if (filter.maturity !== undefined && hit.provider.maturity !== filter.maturity) return false;\n if (filter.engineCapability !== undefined && !hit.provider.engineCapabilities.includes(filter.engineCapability)) return false;\n return true;\n}\n\n/** The `kind` and `provider` fields of a hit, from the module's manifest. */\nexport function moduleSearchHitFacts(manifest: ModuleManifest): Pick<ModuleSearchHit, 'kind' | 'provider'> {\n const kind = manifest.kind ?? ModuleKind.FEATURE;\n const provider = manifest.provider;\n return {\n kind,\n ...(kind === ModuleKind.PROVIDER && provider !== undefined\n ? { provider: { ref: provider.ref, maturity: provider.maturity, engineCapabilities: engineCapabilitiesFilledByProviderModule(provider) } }\n : {}),\n };\n}\n"]}
1
+ {"version":3,"file":"module-search.schemas.js","sourceRoot":"","sources":["../../../../src/registry/module-search.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,wCAAwC,GAEzC,MAAM,2BAA2B,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;IACnC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC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AC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAC5E;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC","sourcesContent":["/**\n * What a registry search may filter on, and what a hit says about the module (#2014, epic #2012).\n *\n * Once providers are distributed through the registry, \"find me a module\" becomes \"find me a provider that fills\n * this engine capability\". The three filters are the manifest's own axes: its KIND, the ENGINE CAPABILITY a provider\n * fills (derived from its provider capabilities, never declared twice), and a provider's MATURITY.\n *\n * One predicate, {@link moduleManifestMatchesSearchFilter}, answers the question for every source a search reads —\n * the registry server's stored manifests and a framework checkout's `providers-registry/` (#2015) — so the two\n * cannot disagree about what a filter means.\n */\nimport { z } from 'zod';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport {\n ModuleKind,\n ProviderModuleMaturity,\n engineCapabilitiesFilledByProviderModule,\n type ModuleManifest,\n} from './module-manifest.schemas';\n\n/**\n * The filters a search accepts. Each absent filter matches everything.\n *\n * `engineCapability` and `maturity` are provider axes, so either one excludes every FEATURE module: a feature module\n * fills no engine capability and has no maturity.\n */\nexport const ModuleSearchFilterSchema = z.strictObject({\n kind: z.enum(ModuleKind).optional(),\n engineCapability: z.enum(EngineCapability).optional(),\n maturity: z.enum(ProviderModuleMaturity).optional(),\n});\nexport type ModuleSearchFilter = z.infer<typeof ModuleSearchFilterSchema>;\n\n/** The query-string keys, in the order a client writes them. One list, so the server and the client name them alike. */\nexport const MODULE_SEARCH_FILTER_KEYS = ['kind', 'engineCapability', 'maturity'] as const satisfies readonly (keyof ModuleSearchFilter)[];\n\n/** Whether a manifest passes every filter given. */\nexport function moduleManifestMatchesSearchFilter(manifest: ModuleManifest, filter: ModuleSearchFilter): boolean {\n const kind = manifest.kind ?? ModuleKind.FEATURE;\n if (filter.kind !== undefined && kind !== filter.kind) return false;\n if (filter.engineCapability === undefined && filter.maturity === undefined) return true;\n const provider = manifest.provider;\n if (kind !== ModuleKind.PROVIDER || provider === undefined) return false;\n if (filter.maturity !== undefined && provider.maturity !== filter.maturity) return false;\n if (filter.engineCapability !== undefined && !engineCapabilitiesFilledByProviderModule(provider).includes(filter.engineCapability)) return false;\n return true;\n}\n\n/**\n * A search's filters as query-string pairs, only for the filters given. The client writes them; the server reads them\n * back through {@link ModuleSearchFilterSchema}, which refuses an unknown value rather than ignoring it: a filter that\n * silently matched everything would answer \"every module\" to a question about one kind.\n */\nexport function moduleSearchFilterQueryPairs(filter: ModuleSearchFilter): Array<[string, string]> {\n return MODULE_SEARCH_FILTER_KEYS.flatMap((key) => (filter[key] === undefined ? [] : [[key, String(filter[key])] as [string, string]]));\n}\n\nconst KNOWN_ENGINE_CAPABILITIES: ReadonlySet<string> = new Set(Object.values(EngineCapability));\n\n/**\n * What a search hit says about a provider module, so a list can be read without an `info` per hit.\n *\n * `engineCapabilities` is read as strings and narrowed to the members THIS client knows (#2014 re-review I1): a\n * registry newer than the client may name a capability added since, and refusing the whole search over it would turn\n * a vocabulary step into an outage. A member the client does not know is dropped from the hit, which is also the only\n * thing the client could do with it: no filter it can express names that member.\n *\n * Known limit, kept deliberately: `kind` and `maturity` stay strict. An unknown member there is not a detail to drop\n * but a module the client cannot classify at all (a kind it would install how? a maturity it would rank where?), so a\n * newer registry adding one still fails the search, and the remedy is updating the CLI.\n */\nexport const ModuleSearchHitProviderSchema = z.object({\n ref: z.string().min(1),\n maturity: z.enum(ProviderModuleMaturity),\n engineCapabilities: z.array(z.string()).transform((values) => values.filter((value): value is EngineCapability => KNOWN_ENGINE_CAPABILITIES.has(value))),\n /**\n * The provider an AUGMENTATION adds its operations to (#1672, #2022), so a reader can tell from the hit that the\n * module owns no connection and is bound as that base ref. Optional on the wire: a registry deployed before #2025\n * sends none, and the hit then reads like any provider's.\n */\n augments: z.string().min(1).optional(),\n});\nexport type ModuleSearchHitProvider = z.infer<typeof ModuleSearchHitProviderSchema>;\n\n/**\n * One search hit on the wire. `kind` and `provider` are optional because a registry deployed before #2014 sends\n * neither; a client reads an absent `kind` as FEATURE, as the manifest does.\n */\nexport const ModuleSearchHitSchema = z.object({\n moduleId: z.string().min(1),\n description: z.string().optional(),\n latestVersion: z.string(),\n kind: z.enum(ModuleKind).optional(),\n provider: ModuleSearchHitProviderSchema.optional(),\n});\nexport type ModuleSearchHit = z.infer<typeof ModuleSearchHitSchema>;\n\n/**\n * Whether a HIT passes the filters, read from the facts the hit carries. The client re-applies it to what a server\n * answers (#2014 review F9): a registry deployed before #2014 ignores the filter parameters and answers every module,\n * and a filtered search must not then fail open. A hit with no `kind` is a FEATURE module, and one with no `provider`\n * facts matches no provider filter, so an old server's answer to a provider search is empty rather than everything.\n */\nexport function moduleSearchHitMatchesFilter(hit: Pick<ModuleSearchHit, 'kind' | 'provider'>, filter: ModuleSearchFilter): boolean {\n const kind = hit.kind ?? ModuleKind.FEATURE;\n if (filter.kind !== undefined && kind !== filter.kind) return false;\n if (filter.engineCapability === undefined && filter.maturity === undefined) return true;\n if (kind !== ModuleKind.PROVIDER || hit.provider === undefined) return false;\n if (filter.maturity !== undefined && hit.provider.maturity !== filter.maturity) return false;\n if (filter.engineCapability !== undefined && !hit.provider.engineCapabilities.includes(filter.engineCapability)) return false;\n return true;\n}\n\n/** The `kind` and `provider` fields of a hit, from the module's manifest. */\nexport function moduleSearchHitFacts(manifest: ModuleManifest): Pick<ModuleSearchHit, 'kind' | 'provider'> {\n const kind = manifest.kind ?? ModuleKind.FEATURE;\n const provider = manifest.provider;\n return {\n kind,\n ...(kind === ModuleKind.PROVIDER && provider !== undefined\n ? {\n provider: {\n ref: provider.ref,\n maturity: provider.maturity,\n engineCapabilities: engineCapabilitiesFilledByProviderModule(provider),\n ...(provider.augments !== undefined ? { augments: provider.augments } : {}),\n },\n }\n : {}),\n };\n}\n"]}
@@ -51,7 +51,9 @@ export declare enum RegistryErrorCode {
51
51
  /** A 2xx response carried a payload the contract cannot parse. */
52
52
  MALFORMED_PAYLOAD = "WILDO_REGISTRY_MALFORMED_PAYLOAD",
53
53
  /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */
54
- REQUEST_TIMEOUT = "WILDO_REGISTRY_REQUEST_TIMEOUT"
54
+ REQUEST_TIMEOUT = "WILDO_REGISTRY_REQUEST_TIMEOUT",
55
+ /** A domain with that slug already exists on the registry (#2024); whose it is takes a second question. */
56
+ DOMAIN_TAKEN = "WILDO_REGISTRY_DOMAIN_TAKEN"
55
57
  }
56
58
  export declare class RegistryError extends Error {
57
59
  readonly code: RegistryErrorCode;
@@ -135,8 +137,18 @@ export declare enum RegistryRefusalCode {
135
137
  * A yank of a yanked release, or an unyank of a live one: the release is ALREADY in the requested
136
138
  * state, so the request is a no-op a caller may report as done.
137
139
  */
138
- RELEASE_STATE = "registry_release_state"
140
+ RELEASE_STATE = "registry_release_state",
141
+ /**
142
+ * A publish of a version that already exists (#2024). Versions are immutable, so the remedy is a new version.
143
+ * Distinct from the engine's generic `version_conflict`, which a publish can also answer when it gives up after
144
+ * lost optimistic checks: there the version was NOT stored and a retry may succeed.
145
+ */
146
+ VERSION_IMMUTABLE = "registry_version_immutable",
147
+ /** A domain create whose slug is already registered (#2024), by the caller's organization or another. */
148
+ DOMAIN_TAKEN = "registry_domain_taken"
139
149
  }
150
+ /** Whether a refusal body carries the registry's own `code` (on `error.details.code`). */
151
+ export declare function hasRegistryRefusalCode(body: unknown, code: RegistryRefusalCode): boolean;
140
152
  /**
141
153
  * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict
142
154
  * (#1758 re-review R3).
@@ -148,6 +160,14 @@ export declare enum RegistryRefusalCode {
148
160
  * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.
149
161
  */
150
162
  export declare function isRegistryReleaseStateConflictBody(body: unknown): boolean;
163
+ /**
164
+ * A domain create refused because the slug is registered (#2024). Domains are first come, first served, so the
165
+ * caller asks its own domain list to tell "already ours" from "someone else's".
166
+ */
167
+ export declare class RegistryDomainTakenError extends RegistryError {
168
+ readonly domain: string;
169
+ constructor(domain: string);
170
+ }
151
171
  export declare class RegistryAuthForbiddenError extends RegistryError {
152
172
  readonly action: string;
153
173
  constructor(action: string);
@@ -1 +1 @@
1
- {"version":3,"file":"registry-errors.d.ts","sourceRoot":"","sources":["../../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,oBAAY,iBAAiB;IAC3B,wEAAwE;IACxE,2BAA2B,+CAA+C;IAC1E,4CAA4C;IAC5C,gBAAgB,oCAAoC;IACpD,uDAAuD;IACvD,iBAAiB,qCAAqC;IACtD,uCAAuC;IACvC,cAAc,kCAAkC;IAChD,uEAAuE;IACvE,sBAAsB,0CAA0C;IAChE,4DAA4D;IAC5D,kBAAkB,sCAAsC;IACxD,uEAAuE;IACvE,mBAAmB,uCAAuC;IAC1D,yDAAyD;IACzD,aAAa,iCAAiC;IAC9C;;;;OAIG;IACH,mBAAmB,uCAAuC;IAC1D;;;OAGG;IACH,YAAY,gCAAgC;IAC5C,4GAA4G;IAC5G,mBAAmB,uCAAuC;IAC1D,kEAAkE;IAClE,cAAc,kCAAkC;IAChD,8FAA8F;IAC9F,mBAAmB,uCAAuC;IAC1D,8GAA8G;IAC9G,oBAAoB,wCAAwC;IAC5D,+EAA+E;IAC/E,iBAAiB,qCAAqC;IACtD,kEAAkE;IAClE,iBAAiB,qCAAqC;IACtD,+EAA+E;IAC/E,eAAe,mCAAmC;CACnD;AAED,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;gBAErB,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM;CAWrD;AAED,qBAAa,sCAAuC,SAAQ,aAAa;aAErD,QAAQ,EAAE,MAAM;aAChB,OAAO,EAAE,MAAM;aACf,QAAQ,EAAE,MAAM;aAChB,MAAM,EAAE,MAAM;gBAHd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MA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M,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM;CAQjC;AAED;;;;;;;GAOG;AACH,qBAAa,6BAA8B,SAAQ,aAAa;aAE5C,WAAW,EAAE,MAAM;aACnB,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,MAAM;gBAFd,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM;CAQjC;AAED;;;;GAIG;AACH,oBAAY,oBAAoB;IAC9B,wEAAwE;IACxE,iBAAiB,sBAAsB;IACvC,uEAAuE;IACvE,gBAAgB,qBAAqB;IACrC;;;OAGG;IACH,YAAY,iBAAiB;CAC9B;AAaD;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,aAAa;aAE1C,WAAW,EAAE,MAAM;aACnB,MAAM,EAAE,MAAM;aACd,KAAK,EAAE,oBAAoB;aAC3B,SAAS,EAAE,MAAM;gBAHjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM;CAQpC;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE"}
1
+ {"version":3,"file":"registry-errors.d.ts","sourceRoot":"","sources":["../../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,oBAAY,iBAAiB;IAC3B,wEAAwE;IACxE,2BAA2B,+CAA+C;IAC1E,4CAA4C;IAC5C,gBAAgB,oCAAoC;IACpD,uDAAuD;IACvD,iBAAiB,qCAAqC;IACtD,uCAAuC;IACvC,cAAc,kCAAkC;IAChD,uEAAuE;IACvE,sBAAsB,0CAA0C;IAChE,4DAA4D;IAC5D,kBAAkB,sCAAsC;IACxD,uEAAuE;IACvE,mBAAmB,uCAAuC;IAC1D,yDAAyD;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EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM;CAQjC;AAED;;;;GAIG;AACH,oBAAY,oBAAoB;IAC9B,wEAAwE;IACxE,iBAAiB,sBAAsB;IACvC,uEAAuE;IACvE,gBAAgB,qBAAqB;IACrC;;;OAGG;IACH,YAAY,iBAAiB;CAC9B;AAaD;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,aAAa;aAE1C,WAAW,EAAE,MAAM;aACnB,MAAM,EAAE,MAAM;aACd,KAAK,EAAE,oBAAoB;aAC3B,SAAS,EAAE,MAAM;gBAHjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM;CAQpC;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE"}
@@ -53,6 +53,8 @@ export var RegistryErrorCode;
53
53
  RegistryErrorCode["MALFORMED_PAYLOAD"] = "WILDO_REGISTRY_MALFORMED_PAYLOAD";
54
54
  /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */
55
55
  RegistryErrorCode["REQUEST_TIMEOUT"] = "WILDO_REGISTRY_REQUEST_TIMEOUT";
56
+ /** A domain with that slug already exists on the registry (#2024); whose it is takes a second question. */
57
+ RegistryErrorCode["DOMAIN_TAKEN"] = "WILDO_REGISTRY_DOMAIN_TAKEN";
56
58
  })(RegistryErrorCode || (RegistryErrorCode = {}));
57
59
  export class RegistryError extends Error {
58
60
  code;
@@ -206,7 +208,20 @@ export var RegistryRefusalCode;
206
208
  * state, so the request is a no-op a caller may report as done.
207
209
  */
208
210
  RegistryRefusalCode["RELEASE_STATE"] = "registry_release_state";
211
+ /**
212
+ * A publish of a version that already exists (#2024). Versions are immutable, so the remedy is a new version.
213
+ * Distinct from the engine's generic `version_conflict`, which a publish can also answer when it gives up after
214
+ * lost optimistic checks: there the version was NOT stored and a retry may succeed.
215
+ */
216
+ RegistryRefusalCode["VERSION_IMMUTABLE"] = "registry_version_immutable";
217
+ /** A domain create whose slug is already registered (#2024), by the caller's organization or another. */
218
+ RegistryRefusalCode["DOMAIN_TAKEN"] = "registry_domain_taken";
209
219
  })(RegistryRefusalCode || (RegistryRefusalCode = {}));
220
+ /** Whether a refusal body carries the registry's own `code` (on `error.details.code`). */
221
+ export function hasRegistryRefusalCode(body, code) {
222
+ const error = body?.error;
223
+ return error?.details?.code === code;
224
+ }
210
225
  /**
211
226
  * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict
212
227
  * (#1758 re-review R3).
@@ -218,8 +233,19 @@ export var RegistryRefusalCode;
218
233
  * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.
219
234
  */
220
235
  export function isRegistryReleaseStateConflictBody(body) {
221
- const error = body?.error;
222
- return error?.details?.code === RegistryRefusalCode.RELEASE_STATE;
236
+ return hasRegistryRefusalCode(body, RegistryRefusalCode.RELEASE_STATE);
237
+ }
238
+ /**
239
+ * A domain create refused because the slug is registered (#2024). Domains are first come, first served, so the
240
+ * caller asks its own domain list to tell "already ours" from "someone else's".
241
+ */
242
+ export class RegistryDomainTakenError extends RegistryError {
243
+ domain;
244
+ constructor(domain) {
245
+ super(RegistryErrorCode.DOMAIN_TAKEN, `The registry domain "${domain}" already exists.`);
246
+ this.domain = domain;
247
+ this.name = 'RegistryDomainTakenError';
248
+ }
223
249
  }
224
250
  export class RegistryAuthForbiddenError extends RegistryError {
225
251
  action;