@wildo-ai/platform-config-lib 1.1.4 → 1.1.6

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 (230) hide show
  1. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  2. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  3. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +24 -1
  4. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  5. package/dist/esm/bootstrap/bootstrap.contracts.js +25 -0
  6. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  7. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +117 -1
  8. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  9. package/dist/esm/bootstrap/bootstrap.schemas.js +63 -4
  10. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  11. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +24 -1
  12. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  13. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +24 -0
  14. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  15. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +37 -0
  16. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -0
  17. package/dist/esm/bootstrap/platform-store-preconnect.js +43 -0
  18. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -0
  19. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/runtime-backing-service-access.js +8 -4
  21. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  22. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  25. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  26. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  27. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +36 -3
  28. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  29. package/dist/esm/bootstrap/runtime-topology.contracts.js +36 -13
  30. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  31. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts +29 -0
  32. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  33. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js +39 -0
  34. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  35. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  36. package/dist/esm/config-authoring.entry.js.map +1 -1
  37. package/dist/esm/index.d.ts +2 -0
  38. package/dist/esm/index.d.ts.map +1 -1
  39. package/dist/esm/index.js +2 -0
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/esm/lockfile/build-parallelism.d.ts +40 -0
  42. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -0
  43. package/dist/esm/lockfile/build-parallelism.js +64 -0
  44. package/dist/esm/lockfile/build-parallelism.js.map +1 -0
  45. package/dist/esm/lockfile/lockfile-io.d.ts +7 -1
  46. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  47. package/dist/esm/lockfile/lockfile-io.js +17 -3
  48. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  49. package/dist/esm/lockfile/materialize-infra-section.d.ts +28 -7
  50. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  51. package/dist/esm/lockfile/materialize-infra-section.js +24 -11
  52. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  53. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +455 -6
  54. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  55. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -0
  56. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  57. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts +13 -0
  58. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -0
  59. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +56 -0
  60. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -0
  61. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  62. package/dist/esm/project-config/define-infra-env-config.d.ts +886 -29
  63. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  64. package/dist/esm/project-config/define-infra-env-config.js +395 -16
  65. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  66. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  67. package/dist/esm/project-config/define-minion-config.js +1 -2
  68. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  69. package/dist/esm/project-config/define-saas-config.d.ts +142 -25
  70. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  71. package/dist/esm/project-config/define-saas-config.js +229 -26
  72. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  73. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  74. package/dist/esm/project-config/hosted-infra-env-config.d.ts +59 -0
  75. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -0
  76. package/dist/esm/project-config/hosted-infra-env-config.js +187 -0
  77. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -0
  78. package/dist/esm/project-config/index.d.ts +6 -0
  79. package/dist/esm/project-config/index.d.ts.map +1 -1
  80. package/dist/esm/project-config/index.js +6 -0
  81. package/dist/esm/project-config/index.js.map +1 -1
  82. package/dist/esm/project-config/loader.d.ts +35 -0
  83. package/dist/esm/project-config/loader.d.ts.map +1 -1
  84. package/dist/esm/project-config/loader.js +148 -8
  85. package/dist/esm/project-config/loader.js.map +1 -1
  86. package/dist/esm/project-config/npm-version-range.d.ts +23 -0
  87. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -0
  88. package/dist/esm/project-config/npm-version-range.js +175 -0
  89. package/dist/esm/project-config/npm-version-range.js.map +1 -0
  90. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  91. package/dist/esm/project-config/provider-companion-discovery.d.ts +288 -30
  92. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  93. package/dist/esm/project-config/provider-companion-discovery.js +795 -46
  94. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  95. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +192 -20
  96. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  97. package/dist/esm/project-config/provider-runtime-artifacts.js +381 -42
  98. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  99. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  100. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  101. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  102. package/dist/esm/project-config/shared/auth.schemas.d.ts +14 -35
  103. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  104. package/dist/esm/project-config/shared/auth.schemas.js +14 -35
  105. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  106. package/dist/esm/project-config/shared/backing-service-servability.d.ts +157 -0
  107. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -0
  108. package/dist/esm/project-config/shared/backing-service-servability.js +256 -0
  109. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -0
  110. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +66 -66
  111. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  112. package/dist/esm/project-config/shared/backing-services.schemas.js +75 -67
  113. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  114. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
  115. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  116. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  117. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  118. package/dist/esm/project-config/shared/csp-emit.js +41 -2
  119. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  120. package/dist/esm/project-config/shared/csp.schemas.d.ts +11 -12
  121. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  122. package/dist/esm/project-config/shared/csp.schemas.js +11 -12
  123. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  124. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  125. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  126. package/dist/esm/project-config/shared/environment.schemas.d.ts +152 -12
  127. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  128. package/dist/esm/project-config/shared/environment.schemas.js +186 -9
  129. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  130. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +185 -10
  131. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  132. package/dist/esm/project-config/shared/infra-providers.schemas.js +40 -3
  133. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  134. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  135. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  136. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  137. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  138. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  139. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  140. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  141. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +77 -47
  142. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  143. package/dist/esm/project-config/shared/minion-resource-access.validation.js +114 -52
  144. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  145. package/dist/esm/project-config/shared/platform-services.schemas.d.ts +50 -0
  146. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  147. package/dist/esm/project-config/shared/platform-services.schemas.js +57 -0
  148. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  149. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +35 -0
  150. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -0
  151. package/dist/esm/project-config/shared/platform-storage.schemas.js +37 -0
  152. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -0
  153. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
  154. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  155. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +81 -0
  156. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -0
  157. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js +74 -0
  158. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -0
  159. package/dist/esm/project-config/static-asset-import-noop.d.ts +26 -0
  160. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -0
  161. package/dist/esm/project-config/static-asset-import-noop.js +49 -0
  162. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -0
  163. package/dist/esm/registry/artifact-domain.schemas.d.ts +1 -1
  164. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  165. package/dist/esm/registry/companion-api.schemas.d.ts +0 -176
  166. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -1
  167. package/dist/esm/registry/companion-api.schemas.js.map +0 -1
  168. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  169. package/dist/esm/registry/index.d.ts +3 -1
  170. package/dist/esm/registry/index.d.ts.map +1 -1
  171. package/dist/esm/registry/index.js +3 -1
  172. package/dist/esm/registry/index.js.map +1 -1
  173. package/dist/esm/registry/local-checkout-source.d.ts +31 -0
  174. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -0
  175. package/dist/esm/registry/local-checkout-source.js +45 -0
  176. package/dist/esm/registry/local-checkout-source.js.map +1 -0
  177. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +174 -14
  178. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  179. package/dist/esm/registry/lockfile-modules-section.schemas.js +120 -11
  180. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  181. package/dist/esm/registry/module-artifact.schemas.d.ts +79 -0
  182. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  183. package/dist/esm/registry/module-artifact.schemas.js +36 -0
  184. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  185. package/dist/esm/registry/module-manifest.schemas.d.ts +403 -23
  186. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  187. package/dist/esm/registry/module-manifest.schemas.js +502 -60
  188. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  189. package/dist/esm/registry/module-search.schemas.d.ts +80 -0
  190. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -0
  191. package/dist/esm/registry/module-search.schemas.js +112 -0
  192. package/dist/esm/registry/module-search.schemas.js.map +1 -0
  193. package/dist/esm/registry/registry-config.schemas.d.ts +16 -0
  194. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  195. package/dist/esm/registry/registry-config.schemas.js +8 -0
  196. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  197. package/dist/esm/registry/registry-errors.d.ts +126 -2
  198. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  199. package/dist/esm/registry/registry-errors.js +183 -14
  200. package/dist/esm/registry/registry-errors.js.map +1 -1
  201. package/dist/esm/registry/registry-keys.schemas.d.ts +80 -0
  202. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -0
  203. package/dist/esm/registry/registry-keys.schemas.js +68 -0
  204. package/dist/esm/registry/registry-keys.schemas.js.map +1 -0
  205. package/dist/esm/registry/registry-section-schemas.constants.d.ts +25 -3
  206. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  207. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  208. package/dist/esm/release/framework-release.constants.js.map +1 -1
  209. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  210. package/dist/esm/schemas/framework-secrets.schemas.d.ts +12 -1
  211. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  212. package/dist/esm/schemas/framework-secrets.schemas.js +14 -1
  213. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  214. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  215. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  216. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  217. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  218. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  219. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  220. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +17 -14
  221. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  222. package/dist/esm/workspace-scope/workspace-homes.schemas.js +8 -7
  223. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  224. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +15 -6
  225. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  226. package/dist/esm/workspace-scope/workspace-scope.schemas.js +23 -9
  227. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  228. package/package.json +7 -7
  229. package/dist/esm/registry/companion-api.schemas.js +0 -165
  230. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -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;AACH,eAAO,MAAM,kCAAkC;;;;EAAyC,CAAC;AACzF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B;;;;OAIG;IACH,QAAQ,aAAa;IACrB;;;;;OAKG;IACH,cAAc,mBAAmB;CAClC;AAKD;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B;IACzC,oEAAoE;;IAEpE,uFAAuF;;IAEvF,sFAAsF;;IAEtF,uFAAuF;;IAEvF,uFAAuF;;IAEvF,mGAAmG;;IAEnG,uDAAuD;;IAEvD,gDAAgD;;IAEhD,oEAAoE;;IAEpE;;;;;OAKG;;IAEH,sDAAsD;;IAEtD;;;;;;;;;OASG;;IAIH;;;;;;;;;;;;;;;OAeG;;IAEH,oDAAoD;;;;;;IAEpD;;;;OAIG;;;;;;;;;;;;;;;;;;;kBAgBH,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAE3F,0CAA0C;AAC1C,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,gDAAgD;AAChD,MAAM,WAAW,6BAA6B;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,wBAAwB,GAAG,wBAAwB,CAQ9F;AAED,sGAAsG;AACtG,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,wBAAwB,GAAG,6BAA6B,CAKxG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC;;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,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAGzF;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3D,oEAAoE;IACpE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,uEAAuE;IACvE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,wEAAwE;IACxE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,uDAAuD;IACvD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,gDAAgD;IAChD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,oEAAoE;IACpE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C;;;;;OAKG;IACH,cAAc,EAAE,kBAAkB;IAClC,sDAAsD;IACtD,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7C,gEAAgE;IAChE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACtC,oDAAoD;IACpD,MAAM,EAAE,kCAAkC,CAAC,QAAQ,EAAE;CACtD,CAAC,CAAC;AAGH;;;;;;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","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,k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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"]}
@@ -26,6 +26,28 @@ export declare const ModuleVersionRecordSchema: z.ZodObject<{
26
26
  manifest: z.ZodObject<{
27
27
  id: z.ZodString;
28
28
  version: z.ZodString;
29
+ kind: z.ZodDefault<z.ZodEnum<typeof import("./module-manifest.schemas").ModuleKind>>;
30
+ provider: z.ZodOptional<z.ZodObject<{
31
+ ref: z.ZodString;
32
+ vendor: z.ZodOptional<z.ZodString>;
33
+ tier: z.ZodEnum<{
34
+ EXTENSION: import("@wildo-ai/saas-models").ProviderTier.EXTENSION;
35
+ CATALOGUE: import("@wildo-ai/saas-models").ProviderTier.CATALOGUE;
36
+ }>;
37
+ providerCapabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
38
+ facets: z.ZodObject<{
39
+ backend: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
40
+ frontend: z.ZodOptional<z.ZodObject<{
41
+ surfaces: z.ZodArray<z.ZodEnum<typeof import("@wildo-ai/saas-models").AppFrontendType>>;
42
+ }, z.core.$strict>>;
43
+ }, z.core.$strict>;
44
+ maturity: z.ZodEnum<typeof import("./module-manifest.schemas").ProviderModuleMaturity>;
45
+ seed: z.ZodOptional<z.ZodObject<{
46
+ source: z.ZodEnum<typeof import("@wildo-ai/saas-models").ProviderCatalogueSource>;
47
+ sourceRef: z.ZodString;
48
+ sourceVersion: z.ZodString;
49
+ }, z.core.$strip>>;
50
+ }, z.core.$strict>>;
29
51
  description: z.ZodOptional<z.ZodString>;
30
52
  longDescription: z.ZodOptional<z.ZodString>;
31
53
  engine: z.ZodOptional<z.ZodObject<{
@@ -38,6 +60,7 @@ export declare const ModuleVersionRecordSchema: z.ZodObject<{
38
60
  backend: z.ZodDefault<z.ZodArray<z.ZodString>>;
39
61
  minions: z.ZodDefault<z.ZodArray<z.ZodString>>;
40
62
  workers: z.ZodDefault<z.ZodArray<z.ZodString>>;
63
+ providers: z.ZodDefault<z.ZodArray<z.ZodString>>;
41
64
  }, z.core.$strict>>;
42
65
  dependsOn: z.ZodOptional<z.ZodObject<{
43
66
  modules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -47,6 +70,24 @@ export declare const ModuleVersionRecordSchema: z.ZodObject<{
47
70
  }, z.core.$strict>>;
48
71
  capabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
49
72
  }, z.core.$strict>>;
73
+ registration: z.ZodOptional<z.ZodObject<{
74
+ scenario: z.ZodEnum<typeof import("./module-manifest.schemas").ModuleRegistrationScenario>;
75
+ moduleId: z.ZodString;
76
+ moduleCamel: z.ZodString;
77
+ layers: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("./module-manifest.schemas").DomainModuleLayer>>>;
78
+ providerWiring: z.ZodOptional<z.ZodObject<{
79
+ backendPackage: z.ZodOptional<z.ZodString>;
80
+ backendOwners: z.ZodArray<z.ZodObject<{
81
+ serviceKey: z.ZodString;
82
+ path: z.ZodString;
83
+ }, z.core.$strict>>;
84
+ frontendPackage: z.ZodOptional<z.ZodString>;
85
+ frontendOwners: z.ZodArray<z.ZodObject<{
86
+ serviceKey: z.ZodString;
87
+ path: z.ZodString;
88
+ }, z.core.$strict>>;
89
+ }, z.core.$strict>>;
90
+ }, z.core.$strict>>;
50
91
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
51
92
  }, z.core.$catchall<z.ZodUnknown>>;
52
93
  /** Engine-`FILES`-resource id of the artifact zip in storage. */
@@ -76,6 +117,19 @@ export declare const ModuleVersionRecordSchema: z.ZodObject<{
76
117
  signatures: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
77
118
  }, z.core.$strict>;
78
119
  export type ModuleVersionRecord = z.infer<typeof ModuleVersionRecordSchema>;
120
+ /**
121
+ * A yanked release is still served by EXACT version (#1758): an application whose lockfile pins it
122
+ * must be able to reinstall. The artifact download then carries the yank in these two headers, and the
123
+ * resolve response carries it as {@link RegistryYankNoticeSchema}, so a client can warn.
124
+ * The reason is free text, so it travels percent-encoded (`encodeURIComponent`) — never raw in a header.
125
+ */
126
+ export declare const REGISTRY_YANKED_AT_HEADER = "x-wildo-yanked-at";
127
+ export declare const REGISTRY_YANK_REASON_HEADER = "x-wildo-yank-reason";
128
+ export declare const RegistryYankNoticeSchema: z.ZodObject<{
129
+ yankedAt: z.ZodISODateTime;
130
+ reason: z.ZodOptional<z.ZodString>;
131
+ }, z.core.$strip>;
132
+ export type RegistryYankNotice = z.infer<typeof RegistryYankNoticeSchema>;
79
133
  /**
80
134
  * 7th-pass S-M3: wire schema for the `PUT /v1/registry/:domain/modules/:moduleId/tags/:tag`
81
135
  * response. Documented so future CLI consumers can Zod-parse it
@@ -91,4 +145,29 @@ export declare const SetTagResponseSchema: z.ZodObject<{
91
145
  noChange: z.ZodOptional<z.ZodBoolean>;
92
146
  }, z.core.$strip>;
93
147
  export type SetTagResponse = z.infer<typeof SetTagResponseSchema>;
148
+ /**
149
+ * `GET /v1/auth/whoami` on the REGISTRY SERVER — the identity a bearer key resolves to, read by
150
+ * `wildo registry login` and `whoami --verify`. The CLI Zod-parses every required field so a misconfigured registry
151
+ * that omits `organizationId` cannot persist a credential with `org=?`.
152
+ *
153
+ * `roles` is optional because not every registry deployment models
154
+ * roles today; when supplied it lands on the per-machine credential
155
+ * blob for staleness UX.
156
+ *
157
+ * 4th-pass review M5: the schema is `.object({...})` (NOT `.strictObject`)
158
+ * so the registry server can add new optional response fields
159
+ * (`tokenIssuedAt`, `lastUsedAt`, etc.) WITHOUT every existing CLI
160
+ * version refusing to authenticate. The CLI still fails-closed on
161
+ * missing required fields; only unknown additional fields are
162
+ * silently dropped on the client side. Forward-compat is the priority
163
+ * here since CLI versions cannot be flushed in lockstep with server
164
+ * deployments.
165
+ */
166
+ export declare const RegistryWhoamiResponseSchema: z.ZodObject<{
167
+ organizationId: z.ZodString;
168
+ apiKeyId: z.ZodString;
169
+ apiKeyName: z.ZodOptional<z.ZodString>;
170
+ roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
171
+ }, z.core.$strip>;
172
+ export type RegistryWhoamiResponse = z.infer<typeof RegistryWhoamiResponseSchema>;
94
173
  //# sourceMappingURL=module-artifact.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module-artifact.schemas.d.ts","sourceRoot":"","sources":["../../../src/registry/module-artifact.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIpC,iEAAiE;;IAEjE,4DAA4D;;IAE5D,gEAAgE;;;IAGhE;;;;;;;OAOG;;IAEH,6EAA6E;;;IAG7E;;;;OAIG;;kBAEH,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAo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