@wildo-ai/platform-config-lib 1.1.5 → 1.1.7

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 (253) hide show
  1. package/dist/esm/_unimplemented/index.d.ts.map +1 -1
  2. package/dist/esm/_unimplemented/index.js.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -1
  6. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
  7. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  8. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  9. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  10. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  11. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  12. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  13. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +3 -2
  14. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap.contracts.js +3 -2
  16. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +47 -0
  18. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/bootstrap.schemas.js +8 -0
  20. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  21. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -1
  22. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
  24. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  25. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +37 -0
  26. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -0
  27. package/dist/esm/bootstrap/platform-store-preconnect.js +43 -0
  28. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -0
  29. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  30. package/dist/esm/bootstrap/runtime-backing-service-access.js +8 -4
  31. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  32. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  33. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  34. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  35. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  36. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  37. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  39. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  40. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +36 -3
  41. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  42. package/dist/esm/bootstrap/runtime-topology.contracts.js +36 -13
  43. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  44. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  45. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  46. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  47. package/dist/esm/config-authoring.entry.js.map +1 -1
  48. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  49. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  50. package/dist/esm/index.d.ts +1 -0
  51. package/dist/esm/index.d.ts.map +1 -1
  52. package/dist/esm/index.js +1 -0
  53. package/dist/esm/index.js.map +1 -1
  54. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  55. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  56. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  57. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  58. package/dist/esm/lockfile/lockfile-io.d.ts +7 -1
  59. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  60. package/dist/esm/lockfile/lockfile-io.js +17 -3
  61. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  62. package/dist/esm/lockfile/materialize-infra-section.d.ts +27 -6
  63. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  64. package/dist/esm/lockfile/materialize-infra-section.js +23 -10
  65. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  66. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +455 -6
  67. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  68. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -0
  69. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  70. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts +13 -0
  71. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -0
  72. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +56 -0
  73. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -0
  74. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  75. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  76. package/dist/esm/project-config/define-infra-env-config.d.ts +0 -27
  77. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  78. package/dist/esm/project-config/define-infra-env-config.js +0 -2
  79. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  80. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  81. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  82. package/dist/esm/project-config/define-saas-config.d.ts +52 -0
  83. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  84. package/dist/esm/project-config/define-saas-config.js +65 -15
  85. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  86. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  87. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  88. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  89. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  90. package/dist/esm/project-config/index.d.ts +3 -0
  91. package/dist/esm/project-config/index.d.ts.map +1 -1
  92. package/dist/esm/project-config/index.js +3 -0
  93. package/dist/esm/project-config/index.js.map +1 -1
  94. package/dist/esm/project-config/loader.d.ts +11 -0
  95. package/dist/esm/project-config/loader.d.ts.map +1 -1
  96. package/dist/esm/project-config/loader.js +34 -7
  97. package/dist/esm/project-config/loader.js.map +1 -1
  98. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  99. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  100. package/dist/esm/project-config/npm-version-range.d.ts +23 -0
  101. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -0
  102. package/dist/esm/project-config/npm-version-range.js +175 -0
  103. package/dist/esm/project-config/npm-version-range.js.map +1 -0
  104. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  105. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  106. package/dist/esm/project-config/provider-companion-discovery.d.ts +256 -30
  107. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  108. package/dist/esm/project-config/provider-companion-discovery.js +719 -40
  109. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  110. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +125 -2
  111. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  112. package/dist/esm/project-config/provider-runtime-artifacts.js +283 -66
  113. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  114. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  115. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  116. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  117. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  118. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  119. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  120. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  121. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  122. package/dist/esm/project-config/shared/backing-service-servability.d.ts +157 -0
  123. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -0
  124. package/dist/esm/project-config/shared/backing-service-servability.js +256 -0
  125. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -0
  126. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +62 -67
  127. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  128. package/dist/esm/project-config/shared/backing-services.schemas.js +71 -68
  129. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  130. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
  131. package/dist/esm/project-config/shared/cdn.example.js.map +1 -1
  132. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  133. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  134. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  135. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  136. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  137. package/dist/esm/project-config/shared/csp-emit.js +41 -2
  138. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  139. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  140. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  141. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  142. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  143. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  144. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  145. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  146. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  147. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +180 -4
  148. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  149. package/dist/esm/project-config/shared/infra-providers.schemas.js +40 -0
  150. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  151. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  152. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  153. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  154. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  155. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  156. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  157. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  158. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  159. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  160. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  161. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  162. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  163. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  164. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  165. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  166. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  167. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
  168. package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -1
  169. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  170. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  171. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  172. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  173. package/dist/esm/project-config/static-asset-import-noop.d.ts +26 -0
  174. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -0
  175. package/dist/esm/project-config/static-asset-import-noop.js +49 -0
  176. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -0
  177. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  178. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  179. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  180. package/dist/esm/registry/digest.schemas.js.map +1 -1
  181. package/dist/esm/registry/index.d.ts +3 -1
  182. package/dist/esm/registry/index.d.ts.map +1 -1
  183. package/dist/esm/registry/index.js +3 -1
  184. package/dist/esm/registry/index.js.map +1 -1
  185. package/dist/esm/registry/local-checkout-source.d.ts +31 -0
  186. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -0
  187. package/dist/esm/registry/local-checkout-source.js +45 -0
  188. package/dist/esm/registry/local-checkout-source.js.map +1 -0
  189. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +174 -14
  190. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  191. package/dist/esm/registry/lockfile-modules-section.schemas.js +120 -11
  192. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  193. package/dist/esm/registry/module-artifact.schemas.d.ts +79 -0
  194. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  195. package/dist/esm/registry/module-artifact.schemas.js +36 -0
  196. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  197. package/dist/esm/registry/module-manifest.schemas.d.ts +393 -7
  198. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  199. package/dist/esm/registry/module-manifest.schemas.js +488 -40
  200. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  201. package/dist/esm/registry/module-search.schemas.d.ts +80 -0
  202. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -0
  203. package/dist/esm/registry/module-search.schemas.js +112 -0
  204. package/dist/esm/registry/module-search.schemas.js.map +1 -0
  205. package/dist/esm/registry/registry-config.schemas.d.ts +16 -0
  206. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  207. package/dist/esm/registry/registry-config.schemas.js +8 -0
  208. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  209. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  210. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  211. package/dist/esm/registry/registry-errors.d.ts +126 -2
  212. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  213. package/dist/esm/registry/registry-errors.js +183 -14
  214. package/dist/esm/registry/registry-errors.js.map +1 -1
  215. package/dist/esm/registry/registry-keys.schemas.d.ts +80 -0
  216. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -0
  217. package/dist/esm/registry/registry-keys.schemas.js +68 -0
  218. package/dist/esm/registry/registry-keys.schemas.js.map +1 -0
  219. package/dist/esm/registry/registry-section-schemas.constants.d.ts +25 -3
  220. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  221. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  222. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  223. package/dist/esm/release/framework-release.constants.js.map +1 -1
  224. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  225. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  226. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  227. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  228. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  229. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  230. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  231. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  232. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  233. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  234. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  235. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  236. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  237. package/dist/esm/workspace-scope/index.js.map +1 -1
  238. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  239. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  240. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +13 -11
  241. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  242. package/dist/esm/workspace-scope/workspace-homes.schemas.js +2 -2
  243. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  244. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  245. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  246. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  247. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  248. package/dist/tsconfig.build.tsbuildinfo +1 -1
  249. package/package.json +7 -7
  250. package/dist/esm/registry/companion-api.schemas.d.ts +0 -176
  251. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -1
  252. package/dist/esm/registry/companion-api.schemas.js +0 -165
  253. package/dist/esm/registry/companion-api.schemas.js.map +0 -1
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Local-checkout source for registry modules (#2015, epic #2012).
3
+ *
4
+ * Paul, 2026-09-29: in framework development the registry is fetched LOCALLY, from the checkout, with no
5
+ * server and no publish step. Wildo's own providers are authored in the monorepo under
6
+ * `providers-registry/<ref>/`; a dogfood application inside the checkout installs them from there, and an
7
+ * application anywhere else installs them from the public registry (#2024).
8
+ *
9
+ * This file owns only the LAYOUT: which domain the checkout answers for, and where one of its modules
10
+ * lives. Reading and staging a module is the CLI's job (`local-checkout-module-source.service.ts`).
11
+ */
12
+ import * as path from 'node:path';
13
+ import { isModuleId } from './module-manifest.schemas.js';
14
+ /**
15
+ * The registry domain Wildo publishes its own modules under, on `registry.wildo.ai`. Inside a framework
16
+ * checkout the same domain is answered by the checkout itself, so one install spec
17
+ * (`wildo/providers/asana`) means the same module in both places.
18
+ */
19
+ export const WILDO_REGISTRY_DOMAIN = 'wildo';
20
+ /**
21
+ * Where each module-id SCOPE of the `wildo` domain is authored in the framework checkout.
22
+ *
23
+ * A module `<scope>/<name>` lives at `<frameworkRoot>/<root>/<name>/`, holding its `wildo.module.json` and
24
+ * the content of its single boundary directory: for a provider (`providers/<ref>`) that is one folder per
25
+ * facet (`backend/`, `frontend/`). A scope absent from this table has no local source.
26
+ */
27
+ export const LOCAL_CHECKOUT_MODULE_ROOTS = {
28
+ providers: 'providers-registry',
29
+ };
30
+ /**
31
+ * The checkout directory of `<domain>/<moduleId>`, or `undefined` when the checkout does not author it
32
+ * (another domain, or a scope with no local root). Never resolves outside its scope root.
33
+ */
34
+ export function localCheckoutModuleDirectory(frameworkRoot, domain, moduleId) {
35
+ if (domain !== WILDO_REGISTRY_DOMAIN || !isModuleId(moduleId))
36
+ return undefined;
37
+ const [scope, name] = moduleId.split('/');
38
+ const rootName = LOCAL_CHECKOUT_MODULE_ROOTS[scope];
39
+ if (rootName === undefined)
40
+ return undefined;
41
+ const scopeRoot = path.resolve(frameworkRoot, rootName);
42
+ const directory = path.resolve(scopeRoot, name);
43
+ return directory.startsWith(scopeRoot + path.sep) ? directory : undefined;
44
+ }
45
+ //# sourceMappingURL=local-checkout-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-checkout-source.js","sourceRoot":"","sources":["../../../src/registry/local-checkout-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAqC;IAC3E,SAAS,EAAE,oBAAoB;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,aAAqB,EAAE,MAAc,EAAE,QAAgB;IAClG,IAAI,MAAM,KAAK,qBAAqB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IAChF,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;IAC9D,MAAM,QAAQ,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAChD,OAAO,SAAS,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5E,CAAC","sourcesContent":["/**\n * Local-checkout source for registry modules (#2015, epic #2012).\n *\n * Paul, 2026-09-29: in framework development the registry is fetched LOCALLY, from the checkout, with no\n * server and no publish step. Wildo's own providers are authored in the monorepo under\n * `providers-registry/<ref>/`; a dogfood application inside the checkout installs them from there, and an\n * application anywhere else installs them from the public registry (#2024).\n *\n * This file owns only the LAYOUT: which domain the checkout answers for, and where one of its modules\n * lives. Reading and staging a module is the CLI's job (`local-checkout-module-source.service.ts`).\n */\n\nimport * as path from 'node:path';\nimport { isModuleId } from './module-manifest.schemas';\n\n/**\n * The registry domain Wildo publishes its own modules under, on `registry.wildo.ai`. Inside a framework\n * checkout the same domain is answered by the checkout itself, so one install spec\n * (`wildo/providers/asana`) means the same module in both places.\n */\nexport const WILDO_REGISTRY_DOMAIN = 'wildo';\n\n/**\n * Where each module-id SCOPE of the `wildo` domain is authored in the framework checkout.\n *\n * A module `<scope>/<name>` lives at `<frameworkRoot>/<root>/<name>/`, holding its `wildo.module.json` and\n * the content of its single boundary directory: for a provider (`providers/<ref>`) that is one folder per\n * facet (`backend/`, `frontend/`). A scope absent from this table has no local source.\n */\nexport const LOCAL_CHECKOUT_MODULE_ROOTS: Readonly<Record<string, string>> = {\n providers: 'providers-registry',\n};\n\n/**\n * The checkout directory of `<domain>/<moduleId>`, or `undefined` when the checkout does not author it\n * (another domain, or a scope with no local root). Never resolves outside its scope root.\n */\nexport function localCheckoutModuleDirectory(frameworkRoot: string, domain: string, moduleId: string): string | undefined {\n if (domain !== WILDO_REGISTRY_DOMAIN || !isModuleId(moduleId)) return undefined;\n const [scope, name] = moduleId.split('/') as [string, string];\n const rootName = LOCAL_CHECKOUT_MODULE_ROOTS[scope];\n if (rootName === undefined) return undefined;\n const scopeRoot = path.resolve(frameworkRoot, rootName);\n const directory = path.resolve(scopeRoot, name);\n return directory.startsWith(scopeRoot + path.sep) ? directory : undefined;\n}\n"]}
@@ -27,17 +27,48 @@ export declare const RegistryModulesInstallSourceSchema: z.ZodEnum<{
27
27
  adopt: "adopt";
28
28
  }>;
29
29
  export type RegistryModulesInstallSource = z.infer<typeof RegistryModulesInstallSourceSchema>;
30
+ /**
31
+ * Where an installed module's bytes came from (#2015). Distinct from `source` (install | update | adopt),
32
+ * which records the ACTION that wrote the entry; this records the ORIGIN, and each origin carries
33
+ * different provenance.
34
+ */
35
+ export declare enum ModuleDistribution {
36
+ /**
37
+ * Downloaded from a registry server. Provenance: `registryId`, `registryUrl` and `artifactDigest` (the
38
+ * pinned artifact, whose bytes never change for a version). The kind of every entry written before
39
+ * #2015, which is why an entry that omits `distribution` reads as REGISTRY.
40
+ */
41
+ REGISTRY = "registry",
42
+ /**
43
+ * Staged from the framework checkout's own source (`providers-registry/<ref>/`, see
44
+ * `local-checkout-source.ts`) in framework development. There is no artifact and no digest: the
45
+ * provenance is the checkout commit, plus whether the module's source had uncommitted changes when it
46
+ * was staged, because then the commit alone does not describe the bytes.
47
+ */
48
+ LOCAL_CHECKOUT = "local-checkout"
49
+ }
30
50
  /**
31
51
  * One installed-module record. Keyed by module id in
32
52
  * `RegistryModulesLockSectionSchema.installed`.
53
+ *
54
+ * The provenance fields depend on {@link ModuleDistribution}: a REGISTRY entry carries `registryId`,
55
+ * `registryUrl` and `artifactDigest`; a LOCAL_CHECKOUT entry carries `checkoutCommit` and
56
+ * `checkoutDirty` and none of the registry fields. Read them through {@link registryProvenanceOf} /
57
+ * {@link localCheckoutProvenanceOf}, which refuse the other kind rather than returning `undefined`.
33
58
  */
34
59
  export declare const RegistryModulesLockEntrySchema: z.ZodObject<{
35
60
  /** Module id, mirrors the manifest's `id` (e.g. `acme/billing`). */
36
61
  moduleId: z.ZodString;
37
- /** Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */
38
- registryId: z.ZodString;
39
- /** Resolved registry URL at install time. Stored for audit + repair. */
40
- registryUrl: z.ZodString;
62
+ /** Where the module came from. Absent reads as REGISTRY (every entry before #2015). */
63
+ distribution: z.ZodDefault<z.ZodEnum<typeof ModuleDistribution>>;
64
+ /** REGISTRY only. Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */
65
+ registryId: z.ZodOptional<z.ZodString>;
66
+ /** REGISTRY only. Resolved registry URL at install time. Stored for audit + repair. */
67
+ registryUrl: z.ZodOptional<z.ZodString>;
68
+ /** LOCAL_CHECKOUT only. The framework checkout's commit when the module was staged. */
69
+ checkoutCommit: z.ZodOptional<z.ZodString>;
70
+ /** LOCAL_CHECKOUT only. Whether the module's source had uncommitted changes when it was staged. */
71
+ checkoutDirty: z.ZodOptional<z.ZodBoolean>;
41
72
  /** Domain segment under the registry (e.g. `acme`). */
42
73
  domain: z.ZodString;
43
74
  /** Concrete resolved semver — never a range. */
@@ -45,24 +76,98 @@ export declare const RegistryModulesLockEntrySchema: z.ZodObject<{
45
76
  /** Original CLI input (e.g. `^1.2.0`), kept for diff visibility. */
46
77
  requestedRange: z.ZodOptional<z.ZodString>;
47
78
  /**
48
- * Artifact integrity digest, format `sha256:<64-hex-lowercase>`.
79
+ * REGISTRY only. Artifact integrity digest, format `sha256:<64-hex-lowercase>`.
49
80
  * Must match `ModuleVersionRecord.integrity` for the same artifact
50
81
  * — both fields share `Sha256DigestSchema` so a Phase 5 install
51
82
  * compares like-for-like (M-2.5).
52
83
  */
53
- artifactDigest: z.ZodString;
84
+ artifactDigest: z.ZodOptional<z.ZodString>;
54
85
  /** ISO datetime of install for audit-log purposes. */
55
86
  installedAt: z.ZodISODateTime;
56
- /** File paths copied into app source, relative to saas-root. */
87
+ /**
88
+ * File paths copied into app source, relative to saas-root (POSIX separators).
89
+ *
90
+ * Each entry must be a file a module can own ({@link isModuleOwnedFilePath}): below a layer root,
91
+ * with no dot-segment or `node_modules`. `wildo registry remove` and `update` DELETE these paths.
92
+ * The lockfile is committed, merged and hand-edited, so an unconstrained string here — `"."`,
93
+ * `".."`, `"/"`, `"wildo.saas.config.ts"` — was a delete of the application's own files waiting for
94
+ * one bad merge. Refusing at parse time means a poisoned entry stops every registry command before
95
+ * any file is touched.
96
+ */
57
97
  files: z.ZodDefault<z.ZodArray<z.ZodString>>;
98
+ /**
99
+ * The SHA-256 of each file as the installer last WROTE it (#2016), keyed by the paths in `files`.
100
+ *
101
+ * A copied module is the application's to edit (the shadcn model), so `update`, `remove` and `repair`
102
+ * must know which files the user changed before they overwrite or delete one: equal to this hash
103
+ * means untouched and safe to replace; different means edited and kept, with a warning.
104
+ *
105
+ * Deliberately a separate map beside `files` rather than a reshape of it. `files` is OWNERSHIP, a
106
+ * security rule (`remove` deletes those paths), and stays strictly validated; this is a fingerprint,
107
+ * and is read TOLERANTLY: a malformed map reads as absent, and a path with no valid hash is treated as
108
+ * edited. A bad fingerprint can only make a command more careful, never unable to run.
109
+ *
110
+ * Not a ledger in the one-source-of-truth sense: it lives in the committed lockfile, so it branches
111
+ * and merges with the files it describes, and it never gates boot, `config sync` or a build.
112
+ * Precedent: Debian and RPM conffile handling.
113
+ */
114
+ installedFileHashes: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
58
115
  /** Provenance flag — install vs update vs adopt. */
59
116
  source: z.ZodOptional<z.ZodEnum<{
60
117
  install: "install";
61
118
  update: "update";
62
119
  adopt: "adopt";
63
120
  }>>;
121
+ /**
122
+ * The registration the install APPLIED to the host's registries, so `remove` reverses exactly those
123
+ * edits and `update` can tell whether it changed. Absent = nothing was registered (the module has no
124
+ * registration, or it was installed before registration existed).
125
+ */
126
+ registration: z.ZodOptional<z.ZodObject<{
127
+ scenario: z.ZodEnum<typeof import("./module-manifest.schemas").ModuleRegistrationScenario>;
128
+ moduleId: z.ZodString;
129
+ moduleCamel: z.ZodString;
130
+ layers: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("./module-manifest.schemas").DomainModuleLayer>>>;
131
+ providerWiring: z.ZodOptional<z.ZodObject<{
132
+ backendPackage: z.ZodOptional<z.ZodString>;
133
+ backendOwners: z.ZodArray<z.ZodObject<{
134
+ serviceKey: z.ZodString;
135
+ path: z.ZodString;
136
+ }, z.core.$strict>>;
137
+ frontendPackage: z.ZodOptional<z.ZodString>;
138
+ frontendOwners: z.ZodArray<z.ZodObject<{
139
+ serviceKey: z.ZodString;
140
+ path: z.ZodString;
141
+ }, z.core.$strict>>;
142
+ }, z.core.$strict>>;
143
+ }, z.core.$strict>>;
64
144
  }, z.core.$strict>;
65
145
  export type RegistryModulesLockEntry = z.infer<typeof RegistryModulesLockEntrySchema>;
146
+ /**
147
+ * What a writer supplies: the entry BEFORE parsing, where defaulted fields (`distribution`, `files`) may
148
+ * be omitted. Writers go through `RegistryLockfileService.upsertEntry`, which parses it, so a default is
149
+ * applied in one place rather than restated at every call site.
150
+ */
151
+ export type RegistryModulesLockEntryInput = z.input<typeof RegistryModulesLockEntrySchema>;
152
+ /** The provenance of a REGISTRY entry. */
153
+ export interface RegistryModuleProvenance {
154
+ registryId: string;
155
+ registryUrl: string;
156
+ artifactDigest: string;
157
+ }
158
+ /** The provenance of a LOCAL_CHECKOUT entry. */
159
+ export interface LocalCheckoutModuleProvenance {
160
+ checkoutCommit: string;
161
+ checkoutDirty: boolean;
162
+ }
163
+ /**
164
+ * The registry an entry was downloaded from, or a refusal naming the entry's real origin. The one way
165
+ * a command reads the registry fields: a local-checkout entry has none, and silently treating it as a
166
+ * registry install would send `update` or `repair` to a server that never served it.
167
+ */
168
+ export declare function registryProvenanceOf(entry: RegistryModulesLockEntry): RegistryModuleProvenance;
169
+ /** The checkout provenance of a LOCAL_CHECKOUT entry, or a refusal naming the entry's real origin. */
170
+ export declare function localCheckoutProvenanceOf(entry: RegistryModulesLockEntry): LocalCheckoutModuleProvenance;
66
171
  /**
67
172
  * `sections.modules` payload. `installed` is keyed by module id.
68
173
  *
@@ -74,10 +179,16 @@ export declare const RegistryModulesLockSectionSchema: z.ZodObject<{
74
179
  installed: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
75
180
  /** Module id, mirrors the manifest's `id` (e.g. `acme/billing`). */
76
181
  moduleId: z.ZodString;
77
- /** Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */
78
- registryId: z.ZodString;
79
- /** Resolved registry URL at install time. Stored for audit + repair. */
80
- registryUrl: z.ZodString;
182
+ /** Where the module came from. Absent reads as REGISTRY (every entry before #2015). */
183
+ distribution: z.ZodDefault<z.ZodEnum<typeof ModuleDistribution>>;
184
+ /** REGISTRY only. Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */
185
+ registryId: z.ZodOptional<z.ZodString>;
186
+ /** REGISTRY only. Resolved registry URL at install time. Stored for audit + repair. */
187
+ registryUrl: z.ZodOptional<z.ZodString>;
188
+ /** LOCAL_CHECKOUT only. The framework checkout's commit when the module was staged. */
189
+ checkoutCommit: z.ZodOptional<z.ZodString>;
190
+ /** LOCAL_CHECKOUT only. Whether the module's source had uncommitted changes when it was staged. */
191
+ checkoutDirty: z.ZodOptional<z.ZodBoolean>;
81
192
  /** Domain segment under the registry (e.g. `acme`). */
82
193
  domain: z.ZodString;
83
194
  /** Concrete resolved semver — never a range. */
@@ -85,22 +196,71 @@ export declare const RegistryModulesLockSectionSchema: z.ZodObject<{
85
196
  /** Original CLI input (e.g. `^1.2.0`), kept for diff visibility. */
86
197
  requestedRange: z.ZodOptional<z.ZodString>;
87
198
  /**
88
- * Artifact integrity digest, format `sha256:<64-hex-lowercase>`.
199
+ * REGISTRY only. Artifact integrity digest, format `sha256:<64-hex-lowercase>`.
89
200
  * Must match `ModuleVersionRecord.integrity` for the same artifact
90
201
  * — both fields share `Sha256DigestSchema` so a Phase 5 install
91
202
  * compares like-for-like (M-2.5).
92
203
  */
93
- artifactDigest: z.ZodString;
204
+ artifactDigest: z.ZodOptional<z.ZodString>;
94
205
  /** ISO datetime of install for audit-log purposes. */
95
206
  installedAt: z.ZodISODateTime;
96
- /** File paths copied into app source, relative to saas-root. */
207
+ /**
208
+ * File paths copied into app source, relative to saas-root (POSIX separators).
209
+ *
210
+ * Each entry must be a file a module can own ({@link isModuleOwnedFilePath}): below a layer root,
211
+ * with no dot-segment or `node_modules`. `wildo registry remove` and `update` DELETE these paths.
212
+ * The lockfile is committed, merged and hand-edited, so an unconstrained string here — `"."`,
213
+ * `".."`, `"/"`, `"wildo.saas.config.ts"` — was a delete of the application's own files waiting for
214
+ * one bad merge. Refusing at parse time means a poisoned entry stops every registry command before
215
+ * any file is touched.
216
+ */
97
217
  files: z.ZodDefault<z.ZodArray<z.ZodString>>;
218
+ /**
219
+ * The SHA-256 of each file as the installer last WROTE it (#2016), keyed by the paths in `files`.
220
+ *
221
+ * A copied module is the application's to edit (the shadcn model), so `update`, `remove` and `repair`
222
+ * must know which files the user changed before they overwrite or delete one: equal to this hash
223
+ * means untouched and safe to replace; different means edited and kept, with a warning.
224
+ *
225
+ * Deliberately a separate map beside `files` rather than a reshape of it. `files` is OWNERSHIP, a
226
+ * security rule (`remove` deletes those paths), and stays strictly validated; this is a fingerprint,
227
+ * and is read TOLERANTLY: a malformed map reads as absent, and a path with no valid hash is treated as
228
+ * edited. A bad fingerprint can only make a command more careful, never unable to run.
229
+ *
230
+ * Not a ledger in the one-source-of-truth sense: it lives in the committed lockfile, so it branches
231
+ * and merges with the files it describes, and it never gates boot, `config sync` or a build.
232
+ * Precedent: Debian and RPM conffile handling.
233
+ */
234
+ installedFileHashes: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
98
235
  /** Provenance flag — install vs update vs adopt. */
99
236
  source: z.ZodOptional<z.ZodEnum<{
100
237
  install: "install";
101
238
  update: "update";
102
239
  adopt: "adopt";
103
240
  }>>;
241
+ /**
242
+ * The registration the install APPLIED to the host's registries, so `remove` reverses exactly those
243
+ * edits and `update` can tell whether it changed. Absent = nothing was registered (the module has no
244
+ * registration, or it was installed before registration existed).
245
+ */
246
+ registration: z.ZodOptional<z.ZodObject<{
247
+ scenario: z.ZodEnum<typeof import("./module-manifest.schemas").ModuleRegistrationScenario>;
248
+ moduleId: z.ZodString;
249
+ moduleCamel: z.ZodString;
250
+ layers: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("./module-manifest.schemas").DomainModuleLayer>>>;
251
+ providerWiring: z.ZodOptional<z.ZodObject<{
252
+ backendPackage: z.ZodOptional<z.ZodString>;
253
+ backendOwners: z.ZodArray<z.ZodObject<{
254
+ serviceKey: z.ZodString;
255
+ path: z.ZodString;
256
+ }, z.core.$strict>>;
257
+ frontendPackage: z.ZodOptional<z.ZodString>;
258
+ frontendOwners: z.ZodArray<z.ZodObject<{
259
+ serviceKey: z.ZodString;
260
+ path: z.ZodString;
261
+ }, z.core.$strict>>;
262
+ }, z.core.$strict>>;
263
+ }, z.core.$strict>>;
104
264
  }, z.core.$strict>>>;
105
265
  }, z.core.$strict>;
106
266
  export type RegistryModulesLockSection = z.infer<typeof RegistryModulesLockSectionSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"lockfile-modules-section.schemas.d.ts","sourceRoot":"","sources":["../../../../src/registry/lockfile-modules-section.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC;;;;EAAyC,CAAC;AACzF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;;GAGG;AACH,eAAO,MAAM,8BAA8B;IACzC,oEAAoE;;IAEpE,uEAAuE;;IAEvE,wEAAwE;;IAExE,uDAAuD;;IAEvD,gDAAgD;;IAEhD,oEAAoE;;IAEpE;;;;;OAKG;;IAEH,sDAAsD;;IAEtD,gEAAgE;;IAEhE,oDAAoD;;;;;;kBAEpD,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC;;QAnC3C,oEAAoE;;QAEpE,uEAAuE;;QAEvE,wEAAwE;;QAExE,uDAAuD;;QAEvD,gDAAgD;;QAEhD,oEAAoE;;QAEpE;;;;;WAKG;;QAEH,sDAAsD;;QAEtD,gEAAgE;;QAEhE,oDAAoD;;;;;;;kBAcpD,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
1
+ {"version":3,"file":"lockfile-modules-section.schemas.d.ts","sourceRoot":"","sources":["../../../src/registry/lockfile-modules-section.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;GAKG;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C;;QAnI3C,oEAAoE;;QAEpE,uFAAuF;;QAEvF,sFAAsF;;QAEtF,uFAAuF;;QAEvF,uFAAuF;;QAEvF,mGAAmG;;QAEnG,uDAAuD;;QAEvD,gDAAgD;;QAEhD,oEAAoE;;QAEpE;;;;;WAKG;;QAEH,sDAAsD;;QAEtD;;;;;;;;;WASG;;QAIH;;;;;;;;;;;;;;;WAeG;;QAEH,oDAAoD;;;;;;QAEpD;;;;WAIG;;;;;;;;;;;;;;;;;;;;kBA2EJ,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { z } from 'zod';
18
18
  import { Sha256DigestSchema } from './digest.schemas.js';
19
+ import { isModuleOwnedFilePath, ModuleIdSchema, ModuleManifestRegistrationSchema, RegistryDomainSlugSchema } from './module-manifest.schemas.js';
19
20
  /**
20
21
  * Source label recorded with each lockfile entry. Distinguishes
21
22
  * registry-installed code from `adopt`-promoted local code; lets the
@@ -23,37 +24,142 @@ import { Sha256DigestSchema } from './digest.schemas.js';
23
24
  * round-trip or a destructive operation.
24
25
  */
25
26
  export const RegistryModulesInstallSourceSchema = z.enum(['install', 'update', 'adopt']);
27
+ /**
28
+ * Where an installed module's bytes came from (#2015). Distinct from `source` (install | update | adopt),
29
+ * which records the ACTION that wrote the entry; this records the ORIGIN, and each origin carries
30
+ * different provenance.
31
+ */
32
+ export var ModuleDistribution;
33
+ (function (ModuleDistribution) {
34
+ /**
35
+ * Downloaded from a registry server. Provenance: `registryId`, `registryUrl` and `artifactDigest` (the
36
+ * pinned artifact, whose bytes never change for a version). The kind of every entry written before
37
+ * #2015, which is why an entry that omits `distribution` reads as REGISTRY.
38
+ */
39
+ ModuleDistribution["REGISTRY"] = "registry";
40
+ /**
41
+ * Staged from the framework checkout's own source (`providers-registry/<ref>/`, see
42
+ * `local-checkout-source.ts`) in framework development. There is no artifact and no digest: the
43
+ * provenance is the checkout commit, plus whether the module's source had uncommitted changes when it
44
+ * was staged, because then the commit alone does not describe the bytes.
45
+ */
46
+ ModuleDistribution["LOCAL_CHECKOUT"] = "local-checkout";
47
+ })(ModuleDistribution || (ModuleDistribution = {}));
48
+ /** A full git commit id, as `git rev-parse HEAD` prints it. */
49
+ const GIT_COMMIT_REGEX = /^[0-9a-f]{40}$/;
26
50
  /**
27
51
  * One installed-module record. Keyed by module id in
28
52
  * `RegistryModulesLockSectionSchema.installed`.
53
+ *
54
+ * The provenance fields depend on {@link ModuleDistribution}: a REGISTRY entry carries `registryId`,
55
+ * `registryUrl` and `artifactDigest`; a LOCAL_CHECKOUT entry carries `checkoutCommit` and
56
+ * `checkoutDirty` and none of the registry fields. Read them through {@link registryProvenanceOf} /
57
+ * {@link localCheckoutProvenanceOf}, which refuse the other kind rather than returning `undefined`.
29
58
  */
30
59
  export const RegistryModulesLockEntrySchema = z.strictObject({
31
60
  /** Module id, mirrors the manifest's `id` (e.g. `acme/billing`). */
32
- moduleId: z.string().min(1),
33
- /** Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */
34
- registryId: z.string().min(1),
35
- /** Resolved registry URL at install time. Stored for audit + repair. */
36
- registryUrl: z.string().min(1),
61
+ moduleId: ModuleIdSchema,
62
+ /** Where the module came from. Absent reads as REGISTRY (every entry before #2015). */
63
+ distribution: z.enum(ModuleDistribution).default(ModuleDistribution.REGISTRY),
64
+ /** REGISTRY only. Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */
65
+ registryId: z.string().min(1).optional(),
66
+ /** REGISTRY only. Resolved registry URL at install time. Stored for audit + repair. */
67
+ registryUrl: z.string().min(1).optional(),
68
+ /** LOCAL_CHECKOUT only. The framework checkout's commit when the module was staged. */
69
+ checkoutCommit: z.string().regex(GIT_COMMIT_REGEX).optional(),
70
+ /** LOCAL_CHECKOUT only. Whether the module's source had uncommitted changes when it was staged. */
71
+ checkoutDirty: z.boolean().optional(),
37
72
  /** Domain segment under the registry (e.g. `acme`). */
38
- domain: z.string().min(1),
73
+ domain: RegistryDomainSlugSchema,
39
74
  /** Concrete resolved semver — never a range. */
40
75
  version: z.string().min(1),
41
76
  /** Original CLI input (e.g. `^1.2.0`), kept for diff visibility. */
42
77
  requestedRange: z.string().min(1).optional(),
43
78
  /**
44
- * Artifact integrity digest, format `sha256:<64-hex-lowercase>`.
79
+ * REGISTRY only. Artifact integrity digest, format `sha256:<64-hex-lowercase>`.
45
80
  * Must match `ModuleVersionRecord.integrity` for the same artifact
46
81
  * — both fields share `Sha256DigestSchema` so a Phase 5 install
47
82
  * compares like-for-like (M-2.5).
48
83
  */
49
- artifactDigest: Sha256DigestSchema,
84
+ artifactDigest: Sha256DigestSchema.optional(),
50
85
  /** ISO datetime of install for audit-log purposes. */
51
86
  installedAt: z.iso.datetime({ offset: true }),
52
- /** File paths copied into app source, relative to saas-root. */
53
- files: z.array(z.string()).default([]),
87
+ /**
88
+ * File paths copied into app source, relative to saas-root (POSIX separators).
89
+ *
90
+ * Each entry must be a file a module can own ({@link isModuleOwnedFilePath}): below a layer root,
91
+ * with no dot-segment or `node_modules`. `wildo registry remove` and `update` DELETE these paths.
92
+ * The lockfile is committed, merged and hand-edited, so an unconstrained string here — `"."`,
93
+ * `".."`, `"/"`, `"wildo.saas.config.ts"` — was a delete of the application's own files waiting for
94
+ * one bad merge. Refusing at parse time means a poisoned entry stops every registry command before
95
+ * any file is touched.
96
+ */
97
+ files: z.array(z.string().min(1).refine(isModuleOwnedFilePath, {
98
+ error: 'module file entries must be application-relative POSIX paths below a module layer root, with no segment that starts with `.` or is `node_modules`',
99
+ })).default([]),
100
+ /**
101
+ * The SHA-256 of each file as the installer last WROTE it (#2016), keyed by the paths in `files`.
102
+ *
103
+ * A copied module is the application's to edit (the shadcn model), so `update`, `remove` and `repair`
104
+ * must know which files the user changed before they overwrite or delete one: equal to this hash
105
+ * means untouched and safe to replace; different means edited and kept, with a warning.
106
+ *
107
+ * Deliberately a separate map beside `files` rather than a reshape of it. `files` is OWNERSHIP, a
108
+ * security rule (`remove` deletes those paths), and stays strictly validated; this is a fingerprint,
109
+ * and is read TOLERANTLY: a malformed map reads as absent, and a path with no valid hash is treated as
110
+ * edited. A bad fingerprint can only make a command more careful, never unable to run.
111
+ *
112
+ * Not a ledger in the one-source-of-truth sense: it lives in the committed lockfile, so it branches
113
+ * and merges with the files it describes, and it never gates boot, `config sync` or a build.
114
+ * Precedent: Debian and RPM conffile handling.
115
+ */
116
+ installedFileHashes: z.record(z.string(), z.string()).optional().catch(undefined),
54
117
  /** Provenance flag — install vs update vs adopt. */
55
118
  source: RegistryModulesInstallSourceSchema.optional(),
119
+ /**
120
+ * The registration the install APPLIED to the host's registries, so `remove` reverses exactly those
121
+ * edits and `update` can tell whether it changed. Absent = nothing was registered (the module has no
122
+ * registration, or it was installed before registration existed).
123
+ */
124
+ registration: ModuleManifestRegistrationSchema.optional(),
125
+ }).superRefine((entry, context) => {
126
+ const registryFields = ['registryId', 'registryUrl', 'artifactDigest'].filter((field) => entry[field] !== undefined);
127
+ const checkoutFields = ['checkoutCommit', 'checkoutDirty'].filter((field) => entry[field] !== undefined);
128
+ if (entry.distribution === ModuleDistribution.REGISTRY) {
129
+ for (const field of ['registryId', 'registryUrl', 'artifactDigest']) {
130
+ if (entry[field] === undefined)
131
+ context.addIssue({ code: 'custom', path: [field], message: `a registry-distributed entry records its ${field}` });
132
+ }
133
+ for (const field of checkoutFields)
134
+ context.addIssue({ code: 'custom', path: [field], message: `${field} belongs to a local-checkout entry` });
135
+ return;
136
+ }
137
+ for (const field of ['checkoutCommit', 'checkoutDirty']) {
138
+ if (entry[field] === undefined)
139
+ context.addIssue({ code: 'custom', path: [field], message: `a local-checkout entry records its ${field}` });
140
+ }
141
+ for (const field of registryFields)
142
+ context.addIssue({ code: 'custom', path: [field], message: `${field} belongs to a registry-distributed entry` });
56
143
  });
144
+ /**
145
+ * The registry an entry was downloaded from, or a refusal naming the entry's real origin. The one way
146
+ * a command reads the registry fields: a local-checkout entry has none, and silently treating it as a
147
+ * registry install would send `update` or `repair` to a server that never served it.
148
+ */
149
+ export function registryProvenanceOf(entry) {
150
+ if (entry.distribution !== ModuleDistribution.REGISTRY || !entry.registryId || !entry.registryUrl || !entry.artifactDigest) {
151
+ throw new Error(`"${entry.moduleId}" was installed from the framework checkout (${entry.distribution}), not from a registry, `
152
+ + 'so it has no registry to return to. Run the command inside the framework checkout, or remove it and add it from a registry.');
153
+ }
154
+ return { registryId: entry.registryId, registryUrl: entry.registryUrl, artifactDigest: entry.artifactDigest };
155
+ }
156
+ /** The checkout provenance of a LOCAL_CHECKOUT entry, or a refusal naming the entry's real origin. */
157
+ export function localCheckoutProvenanceOf(entry) {
158
+ if (entry.distribution !== ModuleDistribution.LOCAL_CHECKOUT || entry.checkoutCommit === undefined || entry.checkoutDirty === undefined) {
159
+ throw new Error(`"${entry.moduleId}" was installed from a registry (${entry.distribution}), not from the framework checkout.`);
160
+ }
161
+ return { checkoutCommit: entry.checkoutCommit, checkoutDirty: entry.checkoutDirty };
162
+ }
57
163
  /**
58
164
  * `sections.modules` payload. `installed` is keyed by module id.
59
165
  *
@@ -63,5 +169,8 @@ export const RegistryModulesLockEntrySchema = z.strictObject({
63
169
  */
64
170
  export const RegistryModulesLockSectionSchema = z.strictObject({
65
171
  installed: z.record(z.string().min(1), RegistryModulesLockEntrySchema).default({}),
66
- });
172
+ }).refine(
173
+ // Commands look an entry up by its KEY and then build paths from it, so a key that disagrees with
174
+ // the validated `moduleId` inside would smuggle an unvalidated name into a path.
175
+ (section) => Object.entries(section.installed).every(([key, entry]) => key === entry.moduleId), { error: 'every sections.modules.installed key must equal its entry\'s moduleId' });
67
176
  //# sourceMappingURL=lockfile-modules-section.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lockfile-modules-section.schemas.js","sourceRoot":"","sources":["../../../../src/registry/lockfile-modules-section.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,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gC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,8BAA8B,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACnF,CAAC,CAAC","sourcesContent":["/**\n * `sections.modules` lockfile section — installed-code state for the\n * Wildo module registry.\n *\n * Owns the durable record of which modules a SaaS app has installed,\n * which exact version + artifact digest is on disk, and which files\n * the registry copied in. Sibling lockfile sections (`providers`,\n * `i18n`) live next to this one under the canonical\n * `wildo-saas.lock.json` envelope and are NEVER touched by code that\n * mutates `sections.modules`.\n *\n * The shape mirrors `module-registry-analysis.md` KD-4 / \"Lockfile\n * Shape\". Fields are intentionally minimal at Phase 0.5 — additional\n * fields must be justified by install/update behavior rather than\n * added preemptively.\n */\n\nimport { z } from 'zod';\nimport { Sha256DigestSchema } from './digest.schemas';\n\n/**\n * Source label recorded with each lockfile entry. Distinguishes\n * registry-installed code from `adopt`-promoted local code; lets the\n * `update`/`remove` flows decide whether overwriting is a safe\n * round-trip or a destructive operation.\n */\nexport const RegistryModulesInstallSourceSchema = z.enum(['install', 'update', 'adopt']);\nexport type RegistryModulesInstallSource = z.infer<typeof RegistryModulesInstallSourceSchema>;\n\n/**\n * One installed-module record. Keyed by module id in\n * `RegistryModulesLockSectionSchema.installed`.\n */\nexport const RegistryModulesLockEntrySchema = z.strictObject({\n /** Module id, mirrors the manifest's `id` (e.g. `acme/billing`). */\n moduleId: z.string().min(1),\n /** Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */\n registryId: z.string().min(1),\n /** Resolved registry URL at install time. Stored for audit + repair. */\n registryUrl: z.string().min(1),\n /** Domain segment under the registry (e.g. `acme`). */\n domain: z.string().min(1),\n /** Concrete resolved semver — never a range. */\n version: z.string().min(1),\n /** Original CLI input (e.g. `^1.2.0`), kept for diff visibility. */\n requestedRange: z.string().min(1).optional(),\n /**\n * Artifact integrity digest, format `sha256:<64-hex-lowercase>`.\n * Must match `ModuleVersionRecord.integrity` for the same artifact\n * — both fields share `Sha256DigestSchema` so a Phase 5 install\n * compares like-for-like (M-2.5).\n */\n artifactDigest: Sha256DigestSchema,\n /** ISO datetime of install for audit-log purposes. */\n installedAt: z.iso.datetime({ offset: true }),\n /** File paths copied into app source, relative to saas-root. */\n files: z.array(z.string()).default([]),\n /** Provenance flag — install vs update vs adopt. */\n source: RegistryModulesInstallSourceSchema.optional(),\n});\nexport type RegistryModulesLockEntry = z.infer<typeof RegistryModulesLockEntrySchema>;\n\n/**\n * `sections.modules` payload. `installed` is keyed by module id.\n *\n * Wrapper kept as a `z.strictObject` so reviewers can find every\n * place that adds a new top-level field; future extensions stay\n * explicit.\n */\nexport const RegistryModulesLockSectionSchema = z.strictObject({\n installed: z.record(z.string().min(1), RegistryModulesLockEntrySchema).default({}),\n});\nexport type RegistryModulesLockSection = z.infer<typeof RegistryModulesLockSectionSchema>;\n"]}
1
+ {"version":3,"file":"lockfile-modules-section.schemas.js","sourceRoot":"","sources":["../../../src/registry/lockfile-modules-section.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAE9I;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAGzF;;;;GAIG;AACH,MAAM,CAAN,IAAY,kBAcX;AAdD,WAAY,kBAAkB;IAC5B;;;;OAIG;IACH,2CAAqB,CAAA;IACrB;;;;;OAKG;IACH,uDAAiC,CAAA;AACnC,CAAC,EAdW,kBAAkB,KA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AAc,IAAI,KAAK,CAAC,cAAc,KAAK,SAAS,IAAI,KAAK,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QACxI,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,oCAAoC,KAAK,CAAC,YAAY,qCAAqC,CAAC,CAAC;IACjI,CAAC;IACD,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC;AACtF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,8BAA8B,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACnF,CAAC,CAAC,MAAM;AACP,kGAAkG;AAClG,iFAAiF;AACjF,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,KAAK,CAAC,QAAQ,CAAC,EAC9F,EAAE,KAAK,EAAE,uEAAuE,EAAE,CACnF,CAAC","sourcesContent":["/**\n * `sections.modules` lockfile section — installed-code state for the\n * Wildo module registry.\n *\n * Owns the durable record of which modules a SaaS app has installed,\n * which exact version + artifact digest is on disk, and which files\n * the registry copied in. Sibling lockfile sections (`providers`,\n * `i18n`) live next to this one under the canonical\n * `wildo-saas.lock.json` envelope and are NEVER touched by code that\n * mutates `sections.modules`.\n *\n * The shape mirrors `module-registry-analysis.md` KD-4 / \"Lockfile\n * Shape\". Fields are intentionally minimal at Phase 0.5 — additional\n * fields must be justified by install/update behavior rather than\n * added preemptively.\n */\n\nimport { z } from 'zod';\nimport { Sha256DigestSchema } from './digest.schemas';\nimport { isModuleOwnedFilePath, ModuleIdSchema, ModuleManifestRegistrationSchema, RegistryDomainSlugSchema } from './module-manifest.schemas';\n\n/**\n * Source label recorded with each lockfile entry. Distinguishes\n * registry-installed code from `adopt`-promoted local code; lets the\n * `update`/`remove` flows decide whether overwriting is a safe\n * round-trip or a destructive operation.\n */\nexport const RegistryModulesInstallSourceSchema = z.enum(['install', 'update', 'adopt']);\nexport type RegistryModulesInstallSource = z.infer<typeof RegistryModulesInstallSourceSchema>;\n\n/**\n * Where an installed module's bytes came from (#2015). Distinct from `source` (install | update | adopt),\n * which records the ACTION that wrote the entry; this records the ORIGIN, and each origin carries\n * different provenance.\n */\nexport enum ModuleDistribution {\n /**\n * Downloaded from a registry server. Provenance: `registryId`, `registryUrl` and `artifactDigest` (the\n * pinned artifact, whose bytes never change for a version). The kind of every entry written before\n * #2015, which is why an entry that omits `distribution` reads as REGISTRY.\n */\n REGISTRY = 'registry',\n /**\n * Staged from the framework checkout's own source (`providers-registry/<ref>/`, see\n * `local-checkout-source.ts`) in framework development. There is no artifact and no digest: the\n * provenance is the checkout commit, plus whether the module's source had uncommitted changes when it\n * was staged, because then the commit alone does not describe the bytes.\n */\n LOCAL_CHECKOUT = 'local-checkout',\n}\n\n/** A full git commit id, as `git rev-parse HEAD` prints it. */\nconst GIT_COMMIT_REGEX = /^[0-9a-f]{40}$/;\n\n/**\n * One installed-module record. Keyed by module id in\n * `RegistryModulesLockSectionSchema.installed`.\n *\n * The provenance fields depend on {@link ModuleDistribution}: a REGISTRY entry carries `registryId`,\n * `registryUrl` and `artifactDigest`; a LOCAL_CHECKOUT entry carries `checkoutCommit` and\n * `checkoutDirty` and none of the registry fields. Read them through {@link registryProvenanceOf} /\n * {@link localCheckoutProvenanceOf}, which refuse the other kind rather than returning `undefined`.\n */\nexport const RegistryModulesLockEntrySchema = z.strictObject({\n /** Module id, mirrors the manifest's `id` (e.g. `acme/billing`). */\n moduleId: ModuleIdSchema,\n /** Where the module came from. Absent reads as REGISTRY (every entry before #2015). */\n distribution: z.enum(ModuleDistribution).default(ModuleDistribution.REGISTRY),\n /** REGISTRY only. Registry id from `wildo.saas.config.ts > moduleRegistries[].id`. */\n registryId: z.string().min(1).optional(),\n /** REGISTRY only. Resolved registry URL at install time. Stored for audit + repair. */\n registryUrl: z.string().min(1).optional(),\n /** LOCAL_CHECKOUT only. The framework checkout's commit when the module was staged. */\n checkoutCommit: z.string().regex(GIT_COMMIT_REGEX).optional(),\n /** LOCAL_CHECKOUT only. Whether the module's source had uncommitted changes when it was staged. */\n checkoutDirty: z.boolean().optional(),\n /** Domain segment under the registry (e.g. `acme`). */\n domain: RegistryDomainSlugSchema,\n /** Concrete resolved semver — never a range. */\n version: z.string().min(1),\n /** Original CLI input (e.g. `^1.2.0`), kept for diff visibility. */\n requestedRange: z.string().min(1).optional(),\n /**\n * REGISTRY only. Artifact integrity digest, format `sha256:<64-hex-lowercase>`.\n * Must match `ModuleVersionRecord.integrity` for the same artifact\n * — both fields share `Sha256DigestSchema` so a Phase 5 install\n * compares like-for-like (M-2.5).\n */\n artifactDigest: Sha256DigestSchema.optional(),\n /** ISO datetime of install for audit-log purposes. */\n installedAt: z.iso.datetime({ offset: true }),\n /**\n * File paths copied into app source, relative to saas-root (POSIX separators).\n *\n * Each entry must be a file a module can own ({@link isModuleOwnedFilePath}): below a layer root,\n * with no dot-segment or `node_modules`. `wildo registry remove` and `update` DELETE these paths.\n * The lockfile is committed, merged and hand-edited, so an unconstrained string here — `\".\"`,\n * `\"..\"`, `\"/\"`, `\"wildo.saas.config.ts\"` — was a delete of the application's own files waiting for\n * one bad merge. Refusing at parse time means a poisoned entry stops every registry command before\n * any file is touched.\n */\n files: z.array(z.string().min(1).refine(isModuleOwnedFilePath, {\n error: 'module file entries must be application-relative POSIX paths below a module layer root, with no segment that starts with `.` or is `node_modules`',\n })).default([]),\n /**\n * The SHA-256 of each file as the installer last WROTE it (#2016), keyed by the paths in `files`.\n *\n * A copied module is the application's to edit (the shadcn model), so `update`, `remove` and `repair`\n * must know which files the user changed before they overwrite or delete one: equal to this hash\n * means untouched and safe to replace; different means edited and kept, with a warning.\n *\n * Deliberately a separate map beside `files` rather than a reshape of it. `files` is OWNERSHIP, a\n * security rule (`remove` deletes those paths), and stays strictly validated; this is a fingerprint,\n * and is read TOLERANTLY: a malformed map reads as absent, and a path with no valid hash is treated as\n * edited. A bad fingerprint can only make a command more careful, never unable to run.\n *\n * Not a ledger in the one-source-of-truth sense: it lives in the committed lockfile, so it branches\n * and merges with the files it describes, and it never gates boot, `config sync` or a build.\n * Precedent: Debian and RPM conffile handling.\n */\n installedFileHashes: z.record(z.string(), z.string()).optional().catch(undefined),\n /** Provenance flag — install vs update vs adopt. */\n source: RegistryModulesInstallSourceSchema.optional(),\n /**\n * The registration the install APPLIED to the host's registries, so `remove` reverses exactly those\n * edits and `update` can tell whether it changed. Absent = nothing was registered (the module has no\n * registration, or it was installed before registration existed).\n */\n registration: ModuleManifestRegistrationSchema.optional(),\n}).superRefine((entry, context) => {\n const registryFields = (['registryId', 'registryUrl', 'artifactDigest'] as const).filter((field) => entry[field] !== undefined);\n const checkoutFields = (['checkoutCommit', 'checkoutDirty'] as const).filter((field) => entry[field] !== undefined);\n if (entry.distribution === ModuleDistribution.REGISTRY) {\n for (const field of ['registryId', 'registryUrl', 'artifactDigest'] as const) {\n if (entry[field] === undefined) context.addIssue({ code: 'custom', path: [field], message: `a registry-distributed entry records its ${field}` });\n }\n for (const field of checkoutFields) context.addIssue({ code: 'custom', path: [field], message: `${field} belongs to a local-checkout entry` });\n return;\n }\n for (const field of ['checkoutCommit', 'checkoutDirty'] as const) {\n if (entry[field] === undefined) context.addIssue({ code: 'custom', path: [field], message: `a local-checkout entry records its ${field}` });\n }\n for (const field of registryFields) context.addIssue({ code: 'custom', path: [field], message: `${field} belongs to a registry-distributed entry` });\n});\nexport type RegistryModulesLockEntry = z.infer<typeof RegistryModulesLockEntrySchema>;\n/**\n * What a writer supplies: the entry BEFORE parsing, where defaulted fields (`distribution`, `files`) may\n * be omitted. Writers go through `RegistryLockfileService.upsertEntry`, which parses it, so a default is\n * applied in one place rather than restated at every call site.\n */\nexport type RegistryModulesLockEntryInput = z.input<typeof RegistryModulesLockEntrySchema>;\n\n/** The provenance of a REGISTRY entry. */\nexport interface RegistryModuleProvenance {\n registryId: string;\n registryUrl: string;\n artifactDigest: string;\n}\n\n/** The provenance of a LOCAL_CHECKOUT entry. */\nexport interface LocalCheckoutModuleProvenance {\n checkoutCommit: string;\n checkoutDirty: boolean;\n}\n\n/**\n * The registry an entry was downloaded from, or a refusal naming the entry's real origin. The one way\n * a command reads the registry fields: a local-checkout entry has none, and silently treating it as a\n * registry install would send `update` or `repair` to a server that never served it.\n */\nexport function registryProvenanceOf(entry: RegistryModulesLockEntry): RegistryModuleProvenance {\n if (entry.distribution !== ModuleDistribution.REGISTRY || !entry.registryId || !entry.registryUrl || !entry.artifactDigest) {\n throw new Error(\n `\"${entry.moduleId}\" was installed from the framework checkout (${entry.distribution}), not from a registry, `\n + 'so it has no registry to return to. Run the command inside the framework checkout, or remove it and add it from a registry.',\n );\n }\n return { registryId: entry.registryId, registryUrl: entry.registryUrl, artifactDigest: entry.artifactDigest };\n}\n\n/** The checkout provenance of a LOCAL_CHECKOUT entry, or a refusal naming the entry's real origin. */\nexport function localCheckoutProvenanceOf(entry: RegistryModulesLockEntry): LocalCheckoutModuleProvenance {\n if (entry.distribution !== ModuleDistribution.LOCAL_CHECKOUT || entry.checkoutCommit === undefined || entry.checkoutDirty === undefined) {\n throw new Error(`\"${entry.moduleId}\" was installed from a registry (${entry.distribution}), not from the framework checkout.`);\n }\n return { checkoutCommit: entry.checkoutCommit, checkoutDirty: entry.checkoutDirty };\n}\n\n/**\n * `sections.modules` payload. `installed` is keyed by module id.\n *\n * Wrapper kept as a `z.strictObject` so reviewers can find every\n * place that adds a new top-level field; future extensions stay\n * explicit.\n */\nexport const RegistryModulesLockSectionSchema = z.strictObject({\n installed: z.record(z.string().min(1), RegistryModulesLockEntrySchema).default({}),\n}).refine(\n // Commands look an entry up by its KEY and then build paths from it, so a key that disagrees with\n // the validated `moduleId` inside would smuggle an unvalidated name into a path.\n (section) => Object.entries(section.installed).every(([key, entry]) => key === entry.moduleId),\n { error: 'every sections.modules.installed key must equal its entry\\'s moduleId' },\n);\nexport type RegistryModulesLockSection = z.infer<typeof RegistryModulesLockSectionSchema>;\n"]}