@wildo-ai/platform-config-lib 1.1.10 → 1.1.12

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 (396) hide show
  1. package/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
  2. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.js +24 -49
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/blueprint/anchored-region.d.ts +83 -0
  6. package/dist/esm/blueprint/anchored-region.d.ts.map +1 -0
  7. package/dist/esm/blueprint/anchored-region.js +263 -0
  8. package/dist/esm/blueprint/anchored-region.js.map +1 -0
  9. package/dist/esm/blueprint/blueprint.schemas.d.ts +600 -0
  10. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -0
  11. package/dist/esm/blueprint/blueprint.schemas.js +638 -0
  12. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -0
  13. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +13 -1
  18. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/bootstrap.contracts.js +6 -0
  20. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +29 -4
  22. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/bootstrap.schemas.js +29 -4
  24. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +131 -2
  26. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  27. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +139 -2
  28. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  29. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  30. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  31. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  32. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  34. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  35. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  36. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  37. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  38. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  39. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  40. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  41. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  42. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  43. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  44. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  45. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  46. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  48. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  49. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  51. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  52. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  53. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  54. package/dist/esm/bootstrap/runtime-response-integrity.d.ts +249 -0
  55. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -0
  56. package/dist/esm/bootstrap/runtime-response-integrity.js +353 -0
  57. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -0
  58. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts +32 -0
  59. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -0
  60. package/dist/esm/bootstrap/runtime-secret-env.contracts.js +43 -0
  61. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -0
  62. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  63. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  64. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts +51 -0
  65. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -0
  66. package/dist/esm/canonical-json/rfc8785-canonical-json.js +231 -0
  67. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -0
  68. package/dist/esm/config-authoring.entry.js.map +1 -1
  69. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  70. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  71. package/dist/esm/index.d.ts +20 -1
  72. package/dist/esm/index.d.ts.map +1 -1
  73. package/dist/esm/index.js +20 -1
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  76. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  78. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  79. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  80. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  81. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  82. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  84. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  85. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  86. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  87. package/dist/esm/key-management/approval-seal-verifier.d.ts +278 -0
  88. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -0
  89. package/dist/esm/key-management/approval-seal-verifier.js +355 -0
  90. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -0
  91. package/dist/esm/key-management/approval-seal.contracts.d.ts +128 -0
  92. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -0
  93. package/dist/esm/key-management/approval-seal.contracts.js +135 -0
  94. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -0
  95. package/dist/esm/key-management/data-key.contracts.d.ts +106 -0
  96. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -0
  97. package/dist/esm/key-management/data-key.contracts.js +54 -0
  98. package/dist/esm/key-management/data-key.contracts.js.map +1 -0
  99. package/dist/esm/key-management/es256-jws.d.ts +60 -0
  100. package/dist/esm/key-management/es256-jws.d.ts.map +1 -0
  101. package/dist/esm/key-management/es256-jws.js +135 -0
  102. package/dist/esm/key-management/es256-jws.js.map +1 -0
  103. package/dist/esm/key-management/key-provider.spi.d.ts +158 -0
  104. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -0
  105. package/dist/esm/key-management/key-provider.spi.js +38 -0
  106. package/dist/esm/key-management/key-provider.spi.js.map +1 -0
  107. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +83 -0
  108. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -0
  109. package/dist/esm/key-management/keyring-rotation.contracts.js +101 -0
  110. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -0
  111. package/dist/esm/key-management/keyring-status.contracts.d.ts +59 -0
  112. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -0
  113. package/dist/esm/key-management/keyring-status.contracts.js +45 -0
  114. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -0
  115. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  116. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  117. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  118. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  119. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  120. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  121. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  122. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  123. package/dist/esm/key-management/qr-code.d.ts +38 -0
  124. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  125. package/dist/esm/key-management/qr-code.js +325 -0
  126. package/dist/esm/key-management/qr-code.js.map +1 -0
  127. package/dist/esm/key-management/signature-request.contracts.d.ts +91 -0
  128. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -0
  129. package/dist/esm/key-management/signature-request.contracts.js +96 -0
  130. package/dist/esm/key-management/signature-request.contracts.js.map +1 -0
  131. package/dist/esm/key-management/signing-log-export.contracts.d.ts +215 -0
  132. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -0
  133. package/dist/esm/key-management/signing-log-export.contracts.js +268 -0
  134. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -0
  135. package/dist/esm/key-management/vault-custody.contracts.d.ts +98 -0
  136. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -0
  137. package/dist/esm/key-management/vault-custody.contracts.js +154 -0
  138. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -0
  139. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  140. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  141. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  142. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  143. package/dist/esm/lockfile/canonical-json.js +1 -1
  144. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  145. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  146. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  147. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  148. package/dist/esm/lockfile/lockfile-io.d.ts +13 -17
  149. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  150. package/dist/esm/lockfile/lockfile-io.js +29 -30
  151. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  152. package/dist/esm/lockfile/materialize-infra-section.d.ts +22 -20
  153. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  154. package/dist/esm/lockfile/materialize-infra-section.js +13 -14
  155. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  156. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +27 -249
  157. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  158. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +28 -3
  159. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  160. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  161. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  162. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  163. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  164. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  165. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +22 -3
  166. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  167. package/dist/esm/project-config/application-served-public-documents.loader.d.ts +26 -0
  168. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -0
  169. package/dist/esm/project-config/application-served-public-documents.loader.js +86 -0
  170. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -0
  171. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  172. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  173. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  174. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  175. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  176. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  177. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  178. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  179. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  180. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  181. package/dist/esm/project-config/config-module-resolution.js +33 -0
  182. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  183. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  184. package/dist/esm/project-config/define-infra-env-config.d.ts +344 -69
  185. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  186. package/dist/esm/project-config/define-infra-env-config.js +194 -143
  187. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  188. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  189. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/define-minion-config.js +64 -25
  191. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  192. package/dist/esm/project-config/define-saas-config.d.ts +82 -348
  193. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  194. package/dist/esm/project-config/define-saas-config.js +262 -103
  195. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  196. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  197. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  198. package/dist/esm/project-config/define-worker-config.js +10 -12
  199. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  200. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  201. package/dist/esm/project-config/hosted-infra-env-config.js +4 -1
  202. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  203. package/dist/esm/project-config/index.d.ts +5 -0
  204. package/dist/esm/project-config/index.d.ts.map +1 -1
  205. package/dist/esm/project-config/index.js +5 -0
  206. package/dist/esm/project-config/index.js.map +1 -1
  207. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  208. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  209. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  210. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  211. package/dist/esm/project-config/loader.d.ts +131 -14
  212. package/dist/esm/project-config/loader.d.ts.map +1 -1
  213. package/dist/esm/project-config/loader.js +226 -12
  214. package/dist/esm/project-config/loader.js.map +1 -1
  215. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  216. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  217. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  218. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  219. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  220. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  221. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  222. package/dist/esm/project-config/npm-version-range.js +39 -16
  223. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  224. package/dist/esm/project-config/owning-package-tsconfig.d.ts +15 -0
  225. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -0
  226. package/dist/esm/project-config/owning-package-tsconfig.js +29 -0
  227. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -0
  228. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  229. package/dist/esm/project-config/provider-companion-discovery.d.ts +4 -4
  230. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  231. package/dist/esm/project-config/provider-companion-discovery.js +16 -10
  232. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  233. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +103 -49
  234. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  235. package/dist/esm/project-config/provider-runtime-artifacts.js +216 -16
  236. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  237. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  238. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  240. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  242. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  243. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  244. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  245. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  246. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  247. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  248. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  249. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  250. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  251. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  252. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  253. package/dist/esm/project-config/shared/csp-defaults.d.ts +36 -9
  254. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  255. package/dist/esm/project-config/shared/csp-defaults.js +54 -11
  256. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  257. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  258. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  259. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  260. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  261. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -85
  262. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/csp.schemas.js +40 -13
  264. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  266. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  270. package/dist/esm/project-config/shared/environment.schemas.d.ts +101 -8
  271. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/environment.schemas.js +128 -9
  273. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  275. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  276. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  277. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  278. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +2 -1
  279. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +4 -1
  281. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  282. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  284. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  285. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  286. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +24 -0
  287. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  288. package/dist/esm/project-config/shared/minion-resource-access.validation.js +25 -2
  289. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  290. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  291. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  292. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +276 -0
  293. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -0
  294. package/dist/esm/project-config/shared/platform-key-management.schemas.js +296 -0
  295. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -0
  296. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  297. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  298. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  299. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  300. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  301. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  302. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  303. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  304. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  305. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  306. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  307. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  308. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  309. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  310. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  311. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  312. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  313. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  314. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  315. package/dist/esm/registry/digest.schemas.js.map +1 -1
  316. package/dist/esm/registry/index.d.ts +3 -3
  317. package/dist/esm/registry/index.d.ts.map +1 -1
  318. package/dist/esm/registry/index.js +3 -3
  319. package/dist/esm/registry/index.js.map +1 -1
  320. package/dist/esm/registry/local-checkout-source.d.ts +22 -2
  321. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  322. package/dist/esm/registry/local-checkout-source.js +66 -3
  323. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  324. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +11 -98
  325. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  326. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  327. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  328. package/dist/esm/registry/module-artifact.schemas.d.ts +40 -17
  329. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  330. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  331. package/dist/esm/registry/module-manifest.schemas.d.ts +324 -74
  332. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  333. package/dist/esm/registry/module-manifest.schemas.js +377 -19
  334. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  335. package/dist/esm/registry/module-search.schemas.d.ts +2 -0
  336. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  337. package/dist/esm/registry/module-search.schemas.js +14 -1
  338. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  339. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  340. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  342. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  344. package/dist/esm/registry/registry-errors.d.ts +103 -5
  345. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  346. package/dist/esm/registry/registry-errors.js +213 -6
  347. package/dist/esm/registry/registry-errors.js.map +1 -1
  348. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  349. package/dist/esm/registry/registry-section-schemas.constants.d.ts +5 -0
  350. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  351. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  352. package/dist/esm/registry/registry-url-resolution.d.ts +72 -0
  353. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -0
  354. package/dist/esm/registry/registry-url-resolution.js +157 -0
  355. package/dist/esm/registry/registry-url-resolution.js.map +1 -0
  356. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  357. package/dist/esm/release/framework-release.constants.js.map +1 -1
  358. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  359. package/dist/esm/schemas/framework-secrets.schemas.d.ts +48 -0
  360. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  361. package/dist/esm/schemas/framework-secrets.schemas.js +53 -0
  362. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  363. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  364. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  365. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  366. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  367. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  368. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  369. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  370. package/dist/esm/workspace-scope/index.js.map +1 -1
  371. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  372. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  373. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  374. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  375. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  376. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  377. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  378. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  379. package/dist/tsconfig.build.tsbuildinfo +1 -1
  380. package/package.json +12 -12
  381. package/dist/esm/_unimplemented/index.d.ts +0 -3
  382. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  383. package/dist/esm/_unimplemented/index.js +0 -3
  384. package/dist/esm/_unimplemented/index.js.map +0 -1
  385. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  386. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  387. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  388. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  389. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  390. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  391. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  392. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  393. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  394. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  395. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  396. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -51,7 +51,9 @@ export declare enum RegistryErrorCode {
51
51
  /** A 2xx response carried a payload the contract cannot parse. */
52
52
  MALFORMED_PAYLOAD = "WILDO_REGISTRY_MALFORMED_PAYLOAD",
53
53
  /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */
54
- REQUEST_TIMEOUT = "WILDO_REGISTRY_REQUEST_TIMEOUT"
54
+ REQUEST_TIMEOUT = "WILDO_REGISTRY_REQUEST_TIMEOUT",
55
+ /** A domain with that slug already exists on the registry (#2024); whose it is takes a second question. */
56
+ DOMAIN_TAKEN = "WILDO_REGISTRY_DOMAIN_TAKEN"
55
57
  }
56
58
  export declare class RegistryError extends Error {
57
59
  readonly code: RegistryErrorCode;
@@ -135,8 +137,18 @@ export declare enum RegistryRefusalCode {
135
137
  * A yank of a yanked release, or an unyank of a live one: the release is ALREADY in the requested
136
138
  * state, so the request is a no-op a caller may report as done.
137
139
  */
138
- RELEASE_STATE = "registry_release_state"
140
+ RELEASE_STATE = "registry_release_state",
141
+ /**
142
+ * A publish of a version that already exists (#2024). Versions are immutable, so the remedy is a new version.
143
+ * Distinct from the engine's generic `version_conflict`, which a publish can also answer when it gives up after
144
+ * lost optimistic checks: there the version was NOT stored and a retry may succeed.
145
+ */
146
+ VERSION_IMMUTABLE = "registry_version_immutable",
147
+ /** A domain create whose slug is already registered (#2024), by the caller's organization or another. */
148
+ DOMAIN_TAKEN = "registry_domain_taken"
139
149
  }
150
+ /** Whether a refusal body carries the registry's own `code` (on `error.details.code`). */
151
+ export declare function hasRegistryRefusalCode(body: unknown, code: RegistryRefusalCode): boolean;
140
152
  /**
141
153
  * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict
142
154
  * (#1758 re-review R3).
@@ -148,6 +160,14 @@ export declare enum RegistryRefusalCode {
148
160
  * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.
149
161
  */
150
162
  export declare function isRegistryReleaseStateConflictBody(body: unknown): boolean;
163
+ /**
164
+ * A domain create refused because the slug is registered (#2024). Domains are first come, first served, so the
165
+ * caller asks its own domain list to tell "already ours" from "someone else's".
166
+ */
167
+ export declare class RegistryDomainTakenError extends RegistryError {
168
+ readonly domain: string;
169
+ constructor(domain: string);
170
+ }
151
171
  export declare class RegistryAuthForbiddenError extends RegistryError {
152
172
  readonly action: string;
153
173
  constructor(action: string);
@@ -161,8 +181,7 @@ export declare class RegistryLockfileRepairableError extends RegistryError {
161
181
  * materialization fails after the source mutation succeeded. The
162
182
  * companion-export discovery and `runtimeImport` reachability
163
183
  * failure modes are both surfaced via this error so module-registry
164
- * callers report them as first-class repairable integration errors
165
- * (`module-registry-analysis.md` / Provider Migration WIP Seams §1).
184
+ * callers report them as first-class repairable integration errors.
166
185
  */
167
186
  export declare class RegistryProviderSyncFailedError extends RegistryError {
168
187
  readonly failureKind: 'companion-discovery' | 'runtime-import-reachability' | 'invalid-scope' | 'timeout' | 'unknown';
@@ -183,8 +202,87 @@ export declare class RegistryUnexpectedStatusError extends RegistryError {
183
202
  readonly status: number;
184
203
  readonly statusText: string;
185
204
  readonly action: string;
186
- constructor(registryUrl: string, status: number, statusText: string, action: string);
205
+ /** What the refusal's body said (#3388), read with {@link readRegistryRefusalBody}; absent for an empty body. */
206
+ readonly refusal?: RegistryRefusal;
207
+ constructor(registryUrl: string, status: number, statusText: string, action: string,
208
+ /** What the refusal's body said (#3388), read with {@link readRegistryRefusalBody}; absent for an empty body. */
209
+ refusal?: RegistryRefusal);
210
+ }
211
+ /** One field a registry refusal names, as its error envelope lists it: the path into the request and what is wrong there. */
212
+ export interface RegistryRefusalIssue {
213
+ path: string;
214
+ message: string;
215
+ }
216
+ /**
217
+ * What a registry refusal SAID, read from its body (#3388). Until then every client of the registry reported a refusal
218
+ * as its HTTP status alone: `wildo fwk publish providers` printed `400 Bad Request at <url>` for a manifest the
219
+ * registry's schema refused, and the cause had to be inferred from the server's uptime and the schema's history.
220
+ *
221
+ * The registry answers through the engine's error envelope (`{ error: { type, message, code?, details?,
222
+ * validationErrors?, correlationId? } }`), sanitized at the wire: `error.message` is only the engine's generic
223
+ * reference (`validation`, `conflict`), the registry's own reason travels in `details.message` (the context key the
224
+ * sanitizer admits for a VALIDATION or CONFLICT refusal), and a schema refusal lists its paths in `validationErrors`.
225
+ * Every field is optional because a refusal may come from something that is not the registry: a proxy's HTML page
226
+ * becomes an {@link RegistryRefusal.excerpt}.
227
+ */
228
+ export interface RegistryRefusal {
229
+ /** The engine's error type (`VALIDATION`, `CONFLICT`, …). */
230
+ type?: string;
231
+ /** The registry's stable refusal code, when it set one (`error.code`, or `error.details.code`). */
232
+ code?: string;
233
+ /** The registry's reason (`error.details.message`). */
234
+ reason?: string;
235
+ /** The engine's generic reference (`error.message`), shown only when no reason came with it. */
236
+ reference?: string;
237
+ /** The fields a schema refusal names. */
238
+ issues: RegistryRefusalIssue[];
239
+ /** The id the registry logged this request under; quote it to find the server's own record. */
240
+ correlationId?: string;
241
+ /** A body that is not the error envelope, whitespace collapsed and cut to {@link REGISTRY_REFUSAL_EXCERPT_LENGTH}. */
242
+ excerpt?: string;
187
243
  }
244
+ /** How much of a body that is not the error envelope a refusal quotes. */
245
+ export declare const REGISTRY_REFUSAL_EXCERPT_LENGTH = 300;
246
+ /**
247
+ * How long a refusal's body may take to arrive once its headers have, when the caller supplies no deadline (#3388). A
248
+ * caller holding a request budget passes it instead (`RegistryServerClient` does, at every read). Either way the read
249
+ * HAS a deadline, which matters most for an artifact download: it clears its response timer when the headers arrive
250
+ * and arms its idle timer only when the transfer is read (#1763), so its refusal body would otherwise have none.
251
+ */
252
+ export declare const REGISTRY_REFUSAL_BODY_TIMEOUT_MS = 10000;
253
+ /** How much of a refusal's body is read. An error envelope is a few hundred bytes; anything longer is quoted, not parsed. */
254
+ export declare const REGISTRY_REFUSAL_BODY_MAX_BYTES: number;
255
+ /**
256
+ * Read a refusal's body ONCE, bounded, and never fail doing so: its JSON value, else its text, else `undefined` (an
257
+ * empty body, one that could not be read, or one that did not arrive within the deadline). The status is already a
258
+ * failure, so a body that cannot be read must not replace it with a second error; the caller reports the status alone.
259
+ *
260
+ * Every refusal that carries no typed meaning is read through this function: `RegistryServerClient`'s unexpected
261
+ * statuses and its 409s that are not the registry's own code, the CLI's publish request, and `wildo registry login` /
262
+ * `whoami`. A refusal a client maps to a typed error (401, 403, 404, 429) names its remedy already and is not read: the
263
+ * engine strips the context of an authentication, authorization or not-found refusal at the wire.
264
+ */
265
+ export declare function readRegistryRefusalBody(res: Response, bounds?: {
266
+ timeoutMs?: number;
267
+ maxBytes?: number;
268
+ }): Promise<unknown>;
269
+ /**
270
+ * What a refusal body says, from what {@link readRegistryRefusalBody} returned: the error envelope's fields, or an
271
+ * excerpt of a body that is not one. `undefined` when there was no body, so the caller reports the status alone
272
+ * rather than an empty reason.
273
+ */
274
+ export declare function parseRegistryRefusalBody(body: unknown): RegistryRefusal | undefined;
275
+ /** {@link readRegistryRefusalBody} then {@link parseRegistryRefusalBody}, for a caller that branches on nothing in the body. */
276
+ export declare function readRegistryRefusal(res: Response, bounds?: {
277
+ timeoutMs?: number;
278
+ maxBytes?: number;
279
+ }): Promise<RegistryRefusal | undefined>;
280
+ /**
281
+ * One line for a person: the reason (or the generic reference when the registry gave none), the fields it names, then
282
+ * the code and the correlation id. E.g. `invalid manifest; provider: Unrecognized key: "openApi" (VALIDATION,
283
+ * correlation id 7f3a…)`.
284
+ */
285
+ export declare function describeRegistryRefusal(refusal: RegistryRefusal): string;
188
286
  /**
189
287
  * Raised by `RegistryServerClient` when
190
288
  * a 2xx response carries a payload the canonical Zod schema can't parse.
@@ -1 +1 @@
1
- {"version":3,"file":"registry-errors.d.ts","sourceRoot":"","sources":["../../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,oBAAY,iBAAiB;IAC3B,wEAAwE;IACxE,2BAA2B,+CAA+C;IAC1E,4CAA4C;IAC5C,gBAAgB,oCAAoC;IACpD,uDAAuD;IACvD,iBAAiB,qCAAqC;IACtD,uCAAuC;IACvC,cAAc,kCAAkC;IAChD,uEAAuE;IACvE,sBAAsB,0CAA0C;IAChE,4DAA4D;IAC5D,kBAAkB,sCAAsC;IACxD,uEAAuE;IACvE,mBAAmB,uCAAuC;IAC1D,yDAAyD;IACzD,aAAa,iCAAiC;IAC9C;;;;OAIG;IACH,mBAAmB,uCAAuC;IAC1D;;;OAGG;IACH,YAAY,gCAAgC;IAC5C,4GAA4G;IAC5G,mBAAmB,uCAAuC;IAC1D,kEAAkE;IAClE,cAAc,kCAAkC;IAChD,8FAA8F;IAC9F,mBAAmB,uCAAuC;IAC1D,8GAA8G;IAC9G,oBAAoB,wCAAwC;IAC5D,+EAA+E;IAC/E,iBAAiB,qCAAqC;IACtD,kEAAkE;IAClE,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ALFORMED_PAYLOAD";
54
54
  /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */
55
55
  RegistryErrorCode["REQUEST_TIMEOUT"] = "WILDO_REGISTRY_REQUEST_TIMEOUT";
56
+ /** A domain with that slug already exists on the registry (#2024); whose it is takes a second question. */
57
+ RegistryErrorCode["DOMAIN_TAKEN"] = "WILDO_REGISTRY_DOMAIN_TAKEN";
56
58
  })(RegistryErrorCode || (RegistryErrorCode = {}));
57
59
  export class RegistryError extends Error {
58
60
  code;
@@ -206,7 +208,20 @@ export var RegistryRefusalCode;
206
208
  * state, so the request is a no-op a caller may report as done.
207
209
  */
208
210
  RegistryRefusalCode["RELEASE_STATE"] = "registry_release_state";
211
+ /**
212
+ * A publish of a version that already exists (#2024). Versions are immutable, so the remedy is a new version.
213
+ * Distinct from the engine's generic `version_conflict`, which a publish can also answer when it gives up after
214
+ * lost optimistic checks: there the version was NOT stored and a retry may succeed.
215
+ */
216
+ RegistryRefusalCode["VERSION_IMMUTABLE"] = "registry_version_immutable";
217
+ /** A domain create whose slug is already registered (#2024), by the caller's organization or another. */
218
+ RegistryRefusalCode["DOMAIN_TAKEN"] = "registry_domain_taken";
209
219
  })(RegistryRefusalCode || (RegistryRefusalCode = {}));
220
+ /** Whether a refusal body carries the registry's own `code` (on `error.details.code`). */
221
+ export function hasRegistryRefusalCode(body, code) {
222
+ const error = body?.error;
223
+ return error?.details?.code === code;
224
+ }
210
225
  /**
211
226
  * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict
212
227
  * (#1758 re-review R3).
@@ -218,8 +233,19 @@ export var RegistryRefusalCode;
218
233
  * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.
219
234
  */
220
235
  export function isRegistryReleaseStateConflictBody(body) {
221
- const error = body?.error;
222
- return error?.details?.code === RegistryRefusalCode.RELEASE_STATE;
236
+ return hasRegistryRefusalCode(body, RegistryRefusalCode.RELEASE_STATE);
237
+ }
238
+ /**
239
+ * A domain create refused because the slug is registered (#2024). Domains are first come, first served, so the
240
+ * caller asks its own domain list to tell "already ours" from "someone else's".
241
+ */
242
+ export class RegistryDomainTakenError extends RegistryError {
243
+ domain;
244
+ constructor(domain) {
245
+ super(RegistryErrorCode.DOMAIN_TAKEN, `The registry domain "${domain}" already exists.`);
246
+ this.domain = domain;
247
+ this.name = 'RegistryDomainTakenError';
248
+ }
223
249
  }
224
250
  export class RegistryAuthForbiddenError extends RegistryError {
225
251
  action;
@@ -242,8 +268,7 @@ export class RegistryLockfileRepairableError extends RegistryError {
242
268
  * materialization fails after the source mutation succeeded. The
243
269
  * companion-export discovery and `runtimeImport` reachability
244
270
  * failure modes are both surfaced via this error so module-registry
245
- * callers report them as first-class repairable integration errors
246
- * (`module-registry-analysis.md` / Provider Migration WIP Seams §1).
271
+ * callers report them as first-class repairable integration errors.
247
272
  */
248
273
  export class RegistryProviderSyncFailedError extends RegistryError {
249
274
  failureKind;
@@ -269,15 +294,197 @@ export class RegistryUnexpectedStatusError extends RegistryError {
269
294
  status;
270
295
  statusText;
271
296
  action;
272
- constructor(registryUrl, status, statusText, action) {
273
- super(RegistryErrorCode.UNEXPECTED_STATUS, `Registry "${action}" failed with HTTP ${status} ${statusText} at ${registryUrl}.`);
297
+ refusal;
298
+ constructor(registryUrl, status, statusText, action,
299
+ /** What the refusal's body said (#3388), read with {@link readRegistryRefusalBody}; absent for an empty body. */
300
+ refusal) {
301
+ super(RegistryErrorCode.UNEXPECTED_STATUS, `Registry "${action}" failed with HTTP ${status} ${statusText} at ${registryUrl}${refusal ? `: ${describeRegistryRefusal(refusal)}` : ''}.`);
274
302
  this.registryUrl = registryUrl;
275
303
  this.status = status;
276
304
  this.statusText = statusText;
277
305
  this.action = action;
306
+ this.refusal = refusal;
278
307
  this.name = 'RegistryUnexpectedStatusError';
279
308
  }
280
309
  }
310
+ /** How much of a body that is not the error envelope a refusal quotes. */
311
+ export const REGISTRY_REFUSAL_EXCERPT_LENGTH = 300;
312
+ /**
313
+ * How long a refusal's body may take to arrive once its headers have, when the caller supplies no deadline (#3388). A
314
+ * caller holding a request budget passes it instead (`RegistryServerClient` does, at every read). Either way the read
315
+ * HAS a deadline, which matters most for an artifact download: it clears its response timer when the headers arrive
316
+ * and arms its idle timer only when the transfer is read (#1763), so its refusal body would otherwise have none.
317
+ */
318
+ export const REGISTRY_REFUSAL_BODY_TIMEOUT_MS = 10_000;
319
+ /** How much of a refusal's body is read. An error envelope is a few hundred bytes; anything longer is quoted, not parsed. */
320
+ export const REGISTRY_REFUSAL_BODY_MAX_BYTES = 64 * 1024;
321
+ /**
322
+ * Read a refusal's body ONCE, bounded, and never fail doing so: its JSON value, else its text, else `undefined` (an
323
+ * empty body, one that could not be read, or one that did not arrive within the deadline). The status is already a
324
+ * failure, so a body that cannot be read must not replace it with a second error; the caller reports the status alone.
325
+ *
326
+ * Every refusal that carries no typed meaning is read through this function: `RegistryServerClient`'s unexpected
327
+ * statuses and its 409s that are not the registry's own code, the CLI's publish request, and `wildo registry login` /
328
+ * `whoami`. A refusal a client maps to a typed error (401, 403, 404, 429) names its remedy already and is not read: the
329
+ * engine strips the context of an authentication, authorization or not-found refusal at the wire.
330
+ */
331
+ export async function readRegistryRefusalBody(res, bounds = {}) {
332
+ let reader;
333
+ try {
334
+ // Inside the guard: a body already read or locked throws here, and that must not replace the status either.
335
+ reader = res.body?.getReader();
336
+ }
337
+ catch {
338
+ return undefined;
339
+ }
340
+ if (!reader)
341
+ return undefined;
342
+ const maxBytes = bounds.maxBytes ?? REGISTRY_REFUSAL_BODY_MAX_BYTES;
343
+ let timer;
344
+ const expired = new Promise((resolve) => {
345
+ timer = setTimeout(() => resolve('expired'), bounds.timeoutMs ?? REGISTRY_REFUSAL_BODY_TIMEOUT_MS);
346
+ });
347
+ const chunks = [];
348
+ let total = 0;
349
+ try {
350
+ for (;;) {
351
+ const next = await Promise.race([reader.read(), expired]);
352
+ if (next === 'expired')
353
+ return undefined;
354
+ if (next.done)
355
+ break;
356
+ chunks.push(next.value);
357
+ total += next.value.byteLength;
358
+ if (total >= maxBytes)
359
+ break;
360
+ }
361
+ }
362
+ catch {
363
+ return undefined;
364
+ }
365
+ finally {
366
+ clearTimeout(timer);
367
+ // Releases the connection whether the body ended, was cut at the cap, or stalled.
368
+ void reader.cancel().catch(() => undefined);
369
+ }
370
+ const bytes = new Uint8Array(total);
371
+ let offset = 0;
372
+ for (const chunk of chunks) {
373
+ bytes.set(chunk, offset);
374
+ offset += chunk.byteLength;
375
+ }
376
+ const text = new TextDecoder().decode(bytes.subarray(0, Math.min(total, maxBytes)));
377
+ if (text.trim() === '')
378
+ return undefined;
379
+ try {
380
+ return JSON.parse(text);
381
+ }
382
+ catch {
383
+ return text;
384
+ }
385
+ }
386
+ function nonEmptyString(value) {
387
+ return typeof value === 'string' && value.trim() !== '' ? value : undefined;
388
+ }
389
+ /** A `validationErrors` value: a plain message, or a coded entry (`{ code, params }`) the client has no words for. */
390
+ function describeValidationEntry(entry) {
391
+ const text = nonEmptyString(entry);
392
+ if (text)
393
+ return text;
394
+ if (entry && typeof entry === 'object' && typeof entry.code === 'string') {
395
+ const { code, params } = entry;
396
+ return params && typeof params === 'object' && Object.keys(params).length > 0 ? `${code} ${JSON.stringify(params)}` : code;
397
+ }
398
+ return undefined;
399
+ }
400
+ /**
401
+ * The fields a refusal names. `details.zodIssues` first: it is the full ordered list, while the envelope's
402
+ * `validationErrors` is a map the error handler keys by the joined path, so two issues on one path (every issue of a
403
+ * URL segment or a slug, whose path is empty) collapse to the last. `validationErrors` answers when there are no
404
+ * `zodIssues`: a coded entry (`not_unique`, `declared_refusal`) travels only there.
405
+ */
406
+ function refusalIssues(error, details) {
407
+ const zodIssues = details?.zodIssues;
408
+ if (Array.isArray(zodIssues)) {
409
+ const issues = zodIssues.flatMap((issue) => {
410
+ const { path, message } = (issue ?? {});
411
+ const text = nonEmptyString(message);
412
+ if (!text)
413
+ return [];
414
+ return [{ path: Array.isArray(path) ? path.map(String).join('.') : String(path ?? ''), message: text }];
415
+ });
416
+ if (issues.length > 0)
417
+ return issues;
418
+ }
419
+ const validationErrors = error.validationErrors;
420
+ if (!validationErrors || typeof validationErrors !== 'object')
421
+ return [];
422
+ const issues = [];
423
+ for (const [path, entry] of Object.entries(validationErrors)) {
424
+ const message = describeValidationEntry(entry);
425
+ if (message)
426
+ issues.push({ path, message });
427
+ }
428
+ return issues;
429
+ }
430
+ /**
431
+ * What a refusal body says, from what {@link readRegistryRefusalBody} returned: the error envelope's fields, or an
432
+ * excerpt of a body that is not one. `undefined` when there was no body, so the caller reports the status alone
433
+ * rather than an empty reason.
434
+ */
435
+ export function parseRegistryRefusalBody(body) {
436
+ if (body === undefined || body === null)
437
+ return undefined;
438
+ const envelope = typeof body === 'object' ? body.error : undefined;
439
+ if (envelope && typeof envelope === 'object') {
440
+ const error = envelope;
441
+ const details = error.details && typeof error.details === 'object' ? error.details : undefined;
442
+ const reason = nonEmptyString(details?.message);
443
+ const refusal = { issues: refusalIssues(error, details) };
444
+ const type = nonEmptyString(error.type);
445
+ const code = nonEmptyString(error.code) ?? nonEmptyString(details?.code);
446
+ const reference = nonEmptyString(error.message) ?? nonEmptyString(error.customMessageReference);
447
+ const correlationId = nonEmptyString(error.correlationId);
448
+ if (type)
449
+ refusal.type = type;
450
+ if (code)
451
+ refusal.code = code;
452
+ if (reason)
453
+ refusal.reason = reason;
454
+ if (reference)
455
+ refusal.reference = reference;
456
+ if (correlationId)
457
+ refusal.correlationId = correlationId;
458
+ return refusal;
459
+ }
460
+ // `{ error: "…" }`: a plain string under `error`, which a server that is not the engine may answer.
461
+ const flat = typeof envelope === 'string' ? envelope : typeof body === 'string' ? body : JSON.stringify(body);
462
+ const excerpt = flat.replace(/\s+/g, ' ').trim();
463
+ if (excerpt === '')
464
+ return undefined;
465
+ return {
466
+ issues: [],
467
+ excerpt: excerpt.length > REGISTRY_REFUSAL_EXCERPT_LENGTH ? `${excerpt.slice(0, REGISTRY_REFUSAL_EXCERPT_LENGTH)}…` : excerpt,
468
+ };
469
+ }
470
+ /** {@link readRegistryRefusalBody} then {@link parseRegistryRefusalBody}, for a caller that branches on nothing in the body. */
471
+ export async function readRegistryRefusal(res, bounds = {}) {
472
+ return parseRegistryRefusalBody(await readRegistryRefusalBody(res, bounds));
473
+ }
474
+ /**
475
+ * One line for a person: the reason (or the generic reference when the registry gave none), the fields it names, then
476
+ * the code and the correlation id. E.g. `invalid manifest; provider: Unrecognized key: "openApi" (VALIDATION,
477
+ * correlation id 7f3a…)`.
478
+ */
479
+ export function describeRegistryRefusal(refusal) {
480
+ if (refusal.excerpt !== undefined)
481
+ return `the response said: ${refusal.excerpt}`;
482
+ const parts = [refusal.reason ?? refusal.reference ?? 'the registry gave no reason'];
483
+ for (const issue of refusal.issues)
484
+ parts.push(issue.path ? `${issue.path}: ${issue.message}` : issue.message);
485
+ const labels = [refusal.code ?? refusal.type, refusal.correlationId ? `correlation id ${refusal.correlationId}` : undefined].filter((label) => label !== undefined);
486
+ return `${parts.join('; ')}${labels.length > 0 ? ` (${labels.join(', ')})` : ''}`;
487
+ }
281
488
  /**
282
489
  * Raised by `RegistryServerClient` when
283
490
  * a 2xx response carries a payload the canonical Zod schema can't parse.
@@ -1 +1 @@
1
- {"version":3,"file":"registry-errors.js","sourceRoot":"","sources":["../../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAN,IAAY,iBA0CX;AA1CD,WAAY,iBAAiB;IAC3B,wEAAwE;IACxE,+FAA0E,CAAA;IAC1E,4CAA4C;IAC5C,yEAAoD,CAAA;IACpD,uDAAuD;IACvD,2EAAsD,CAAA;IACtD,uCAAuC;IACvC,qEAAgD,CAAA;IAChD,uEAAuE;IACvE,qFAAgE,CAAA;IAChE,4DAA4D;IAC5D,6EAAwD,CAAA;IACxD,uEAAuE;IACvE,+EAA0D,CAAA;IAC1D,yDAAyD;IACzD,mEAA8C,CAAA;IAC9C;;;;OAIG;IACH,+EAA0D,CAAA;IAC1D;;;OAGG;IACH,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AW,GAAX,WAAW,CAAQ;QACnB,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAsB;QAC3B,cAAS,GAAT,SAAS,CAAQ;QAMjC,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC5C,CAAC;CACF;AAED,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,OAAO,GAAG,YAAY,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,YAAY,aAAa,CAAC;AACxC,CAAC","sourcesContent":["/**\n * Registry-typed error classes.\n *\n * Phase 1 ships the typed-error vocabulary that Phase 2+ services\n * raise. Each error carries a stable `code` so CLI callers can\n * map errors to UX-specific copy without parsing messages.\n *\n * Errors are intentionally minimal — they encode discriminators,\n * not full diagnostic envelopes. UX layers attach their own\n * context (operator instructions, links, retry hints) when they\n * surface these errors.\n */\n\nexport enum RegistryErrorCode {\n /** Downloaded bytes do not hash to the digest the registry resolved. */\n ARTIFACT_INTEGRITY_MISMATCH = 'WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH',\n /** No module with that id in the domain. */\n MODULE_NOT_FOUND = 'WILDO_REGISTRY_MODULE_NOT_FOUND',\n /** No release satisfies the requested range or tag. */\n VERSION_NOT_FOUND = 'WILDO_REGISTRY_VERSION_NOT_FOUND',\n /** The requested release is yanked. */\n VERSION_YANKED = 'WILDO_REGISTRY_VERSION_YANKED',\n /** A module requires dependencies the application does not provide. */\n DEPENDENCY_UNSATISFIED = 'WILDO_REGISTRY_DEPENDENCY_UNSATISFIED',\n /** A module would write outside its declared boundaries. */\n BOUNDARY_VIOLATION = 'WILDO_REGISTRY_BOUNDARY_VIOLATION',\n /** An installed file carries local edits an update would overwrite. */\n CONFLICT_LOCAL_EDIT = 'WILDO_REGISTRY_CONFLICT_LOCAL_EDIT',\n /** The request needs a registry key and carried none. */\n AUTH_REQUIRED = 'WILDO_REGISTRY_AUTH_REQUIRED',\n /**\n * The request carried a key and the registry refused it: revoked, expired, mistyped, or belonging to a\n * suspended organization. Distinct from `AUTH_REQUIRED` because the remedy differs: that one is \"log\n * in\", this one is \"the key you logged in with no longer works\".\n */\n CREDENTIAL_REJECTED = 'WILDO_REGISTRY_CREDENTIAL_REJECTED',\n /**\n * The registry refused the request for volume: most often the per-source failed-credential guard every\n * Wildo backend applies (#1759), after repeated rejected keys. Retrying immediately extends it.\n */\n RATE_LIMITED = 'WILDO_REGISTRY_RATE_LIMITED',\n /** A yank of a yanked release, or an unyank of a live one (#1758): the release is already in that state. */\n YANK_STATE_CONFLICT = 'WILDO_REGISTRY_YANK_STATE_CONFLICT',\n /** The key is valid but not allowed to perform this operation. */\n AUTH_FORBIDDEN = 'WILDO_REGISTRY_AUTH_FORBIDDEN',\n /** The modules lockfile is inconsistent in a way `wildo registry repair-lockfile` can fix. */\n LOCKFILE_REPAIRABLE = 'WILDO_REGISTRY_LOCKFILE_REPAIRABLE',\n /** The source change succeeded but provider materialization afterwards failed (install, update or remove). */\n PROVIDER_SYNC_FAILED = 'WILDO_REGISTRY_PROVIDER_SYNC_FAILED',\n /** The registry answered with an HTTP status the client has no meaning for. */\n UNEXPECTED_STATUS = 'WILDO_REGISTRY_UNEXPECTED_STATUS',\n /** A 2xx response carried a payload the contract cannot parse. */\n MALFORMED_PAYLOAD = 'WILDO_REGISTRY_MALFORMED_PAYLOAD',\n /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */\n REQUEST_TIMEOUT = 'WILDO_REGISTRY_REQUEST_TIMEOUT',\n}\n\nexport class RegistryError extends Error {\n readonly code: RegistryErrorCode;\n\n constructor(code: RegistryErrorCode, message: string) {\n super(message);\n // L13 (third-pass review): set `name = 'RegistryError'` defensively.\n // Subclasses still overwrite it in their constructors, but a future\n // subclass that forgets to set `name` would leave the default\n // `'Error'` in stack traces — misleading. With this base default,\n // even an undeclared subclass surfaces as a `RegistryError` in\n // logs.\n this.name = 'RegistryError';\n this.code = code;\n }\n}\n\nexport class RegistryArtifactIntegrityMismatchError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly expected: string,\n public readonly actual: string,\n ) {\n super(\n RegistryErrorCode.ARTIFACT_INTEGRITY_MISMATCH,\n `Artifact integrity mismatch for ${moduleId}@${version}: expected ${expected}, got ${actual}.`,\n );\n this.name = 'RegistryArtifactIntegrityMismatchError';\n }\n}\n\nexport class RegistryModuleNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string) {\n super(\n RegistryErrorCode.MODULE_NOT_FOUND,\n `Module not found: ${moduleId}.`,\n );\n this.name = 'RegistryModuleNotFoundError';\n }\n}\n\nexport class RegistryVersionNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly versionRange: string) {\n super(\n RegistryErrorCode.VERSION_NOT_FOUND,\n `No version of ${moduleId} satisfies \"${versionRange}\".`,\n );\n this.name = 'RegistryVersionNotFoundError';\n }\n}\n\nexport class RegistryVersionYankedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly version: string, reason?: string) {\n super(\n RegistryErrorCode.VERSION_YANKED,\n `Version ${moduleId}@${version} is yanked${reason ? `: ${reason}` : ''}.`,\n );\n this.name = 'RegistryVersionYankedError';\n }\n}\n\nexport class RegistryDependencyUnsatisfiedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly missing: readonly string[]) {\n super(\n RegistryErrorCode.DEPENDENCY_UNSATISFIED,\n `Module ${moduleId} requires unmet dependencies: ${missing.join(', ')}.`,\n );\n this.name = 'RegistryDependencyUnsatisfiedError';\n }\n}\n\nexport class RegistryBoundaryViolationError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly offendingPath: string) {\n super(\n RegistryErrorCode.BOUNDARY_VIOLATION,\n `Module ${moduleId} attempts to write outside its declared boundaries: ${offendingPath}.`,\n );\n this.name = 'RegistryBoundaryViolationError';\n }\n}\n\nexport class RegistryConflictLocalEditError extends RegistryError {\n constructor(public readonly filePath: string) {\n super(\n RegistryErrorCode.CONFLICT_LOCAL_EDIT,\n `Local edit detected at ${filePath}; refusing to overwrite without --force.`,\n );\n this.name = 'RegistryConflictLocalEditError';\n }\n}\n\nexport class RegistryAuthRequiredError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.AUTH_REQUIRED,\n `Authentication required for ${registryUrl}. Run \\`wildo registry login --registry ${registryUrl}\\`.`,\n );\n this.name = 'RegistryAuthRequiredError';\n }\n}\n\nexport class RegistryCredentialRejectedError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.CREDENTIAL_REJECTED,\n `The registry at ${registryUrl} rejected the stored key (revoked, expired or not recognised). ` +\n `Run \\`wildo registry login --registry ${registryUrl}\\` with a current key.`,\n );\n this.name = 'RegistryCredentialRejectedError';\n }\n}\n\nexport class RegistryRateLimitedError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n /** From `Retry-After`, when the registry sent one in seconds. */\n public readonly retryAfterSeconds: number | undefined,\n ) {\n super(\n RegistryErrorCode.RATE_LIMITED,\n `Registry \"${action}\" was rate-limited at ${registryUrl}` +\n (retryAfterSeconds !== undefined ? `; retry in ${retryAfterSeconds}s.` : '; wait before retrying.') +\n ' Repeated rejected keys from one source trigger this; check the key before retrying.',\n );\n this.name = 'RegistryRateLimitedError';\n }\n}\n\n/** The two release-state verbs (#1758); the value is also the route segment. */\nexport enum RegistryYankVerb {\n YANK = 'yank',\n UNYANK = 'unyank',\n}\n\n/**\n * The registry refused a yank or unyank because the release is already in the requested state (409).\n * Typed so a caller can report it as the no-op it is rather than a failure of the registry.\n */\nexport class RegistryYankStateConflictError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly verb: RegistryYankVerb,\n ) {\n super(\n RegistryErrorCode.YANK_STATE_CONFLICT,\n verb === RegistryYankVerb.YANK ? `${moduleId}@${version} is already yanked.` : `${moduleId}@${version} is not yanked.`,\n );\n this.name = 'RegistryYankStateConflictError';\n }\n}\n\n/**\n * Stable, client-branchable codes the registry server puts on a refusal, carried on the wire as\n * `error.details.code` (the engine's documented channel for a switch-on-code refusal: `code` is the one\n * context key its client sanitizer admits for that purpose). Server and client both import this enum, so\n * the value has one source.\n */\nexport enum RegistryRefusalCode {\n /**\n * A yank of a yanked release, or an unyank of a live one: the release is ALREADY in the requested\n * state, so the request is a no-op a caller may report as done.\n */\n RELEASE_STATE = 'registry_release_state',\n}\n\n/**\n * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict\n * (#1758 re-review R3).\n *\n * Both routes answer 409 for two different things: the release is already in the requested state, or the\n * registry gave up re-deciding after repeated lost optimistic checks (`version_conflict`). Only the first\n * is a no-op; reading every 409 as one told an operator yanking a compromised release that it was already\n * yanked. It keys on the registry's OWN code rather than the engine's generic `conflict` reference, which\n * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.\n */\nexport function isRegistryReleaseStateConflictBody(body: unknown): boolean {\n const error = (body as { error?: { details?: { code?: unknown } } } | null | undefined)?.error;\n return error?.details?.code === RegistryRefusalCode.RELEASE_STATE;\n}\n\nexport class RegistryAuthForbiddenError extends RegistryError {\n constructor(public readonly action: string) {\n super(\n RegistryErrorCode.AUTH_FORBIDDEN,\n `Action \"${action}\" is not permitted by the current credentials.`,\n );\n this.name = 'RegistryAuthForbiddenError';\n }\n}\n\nexport class RegistryLockfileRepairableError extends RegistryError {\n constructor(message: string, public readonly hints: readonly string[] = []) {\n super(RegistryErrorCode.LOCKFILE_REPAIRABLE, message);\n this.name = 'RegistryLockfileRepairableError';\n }\n}\n\n/**\n * Raised when post-install / post-update / post-remove provider\n * materialization fails after the source mutation succeeded. The\n * companion-export discovery and `runtimeImport` reachability\n * failure modes are both surfaced via this error so module-registry\n * callers report them as first-class repairable integration errors\n * (`module-registry-analysis.md` / Provider Migration WIP Seams §1).\n */\nexport class RegistryProviderSyncFailedError extends RegistryError {\n constructor(\n message: string,\n public readonly failureKind: 'companion-discovery' | 'runtime-import-reachability' | 'invalid-scope' | 'timeout' | 'unknown',\n public readonly stderrTail?: string,\n ) {\n super(RegistryErrorCode.PROVIDER_SYNC_FAILED, message);\n this.name = 'RegistryProviderSyncFailedError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when the server returns a non-2xx\n * status that doesn't map to a more specific typed error (404 →\n * `RegistryModuleNotFoundError`/`RegistryVersionNotFoundError`, 401 →\n * `RegistryAuthRequiredError`, 403 → `RegistryAuthForbiddenError`).\n * Carries the status code + URL so callers can discriminate \"registry\n * down / 5xx\" from authoritative client errors without re-parsing\n * `Error.message` strings.\n */\nexport class RegistryUnexpectedStatusError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly status: number,\n public readonly statusText: string,\n public readonly action: string,\n ) {\n super(\n RegistryErrorCode.UNEXPECTED_STATUS,\n `Registry \"${action}\" failed with HTTP ${status} ${statusText} at ${registryUrl}.`,\n );\n this.name = 'RegistryUnexpectedStatusError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when\n * a 2xx response carries a payload the canonical Zod schema can't parse.\n * Without this, malformed payloads previously surfaced as bare `Error`\n * (`'Registry resolve returned a malformed payload at ...'`), which\n * broke the `isRegistryError(err)` typed-handler contract every other\n * client surface honored.\n */\nexport class RegistryMalformedPayloadError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly detail: string,\n ) {\n super(\n RegistryErrorCode.MALFORMED_PAYLOAD,\n `Registry \"${action}\" returned a malformed payload at ${registryUrl}: ${detail}`,\n );\n this.name = 'RegistryMalformedPayloadError';\n }\n}\n\n/**\n * Where a registry exchange ran out of time (#1763). The two call for different remedies: no response\n * at all points at the registry or the network path; a transfer that STALLED part-way is a slow link,\n * and is measured as silence between chunks rather than as the size of the artifact.\n */\nexport enum RegistryTimeoutPhase {\n /** No response (status + headers) arrived within the request budget. */\n AWAITING_RESPONSE = 'awaiting_response',\n /** The response started, then no bytes arrived for the idle budget. */\n TRANSFER_STALLED = 'transfer_stalled',\n /**\n * The response (status + headers) arrived, but a small metadata body did not finish within the same\n * request budget. Not `TRANSFER_STALLED`: a metadata body has no idle budget, only the request's.\n */\n READING_BODY = 'reading_body',\n}\n\nfunction describeTimeout(phase: RegistryTimeoutPhase, action: string, registryUrl: string, timeoutMs: number): string {\n switch (phase) {\n case RegistryTimeoutPhase.AWAITING_RESPONSE:\n return `Registry \"${action}\" got no response within ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.TRANSFER_STALLED:\n return `Registry \"${action}\" stalled: no data for ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.READING_BODY:\n return `Registry \"${action}\" answered but its response did not finish within ${timeoutMs}ms at ${registryUrl}.`;\n }\n}\n\n/**\n * A registry request that timed out, in the typed vocabulary, so `isRegistryError(err)` handlers see it.\n * Before #1763 a timeout escaped as a bare `Error` (before the response) or a raw `AbortError` (during\n * the body), and a JSON body cut short was reported as a MALFORMED payload.\n */\nexport class RegistryRequestTimeoutError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly phase: RegistryTimeoutPhase,\n public readonly timeoutMs: number,\n ) {\n super(\n RegistryErrorCode.REQUEST_TIMEOUT,\n describeTimeout(phase, action, registryUrl, timeoutMs),\n );\n this.name = 'RegistryRequestTimeoutError';\n }\n}\n\n/** True for the error a fetch (or a body read) raises when its abort signal fires. */\nexport function isAbortLikeError(err: unknown): boolean {\n return err instanceof Error && (err.name === 'AbortError' || err.name === 'TimeoutError');\n}\n\nexport function isRegistryError(value: unknown): value is RegistryError {\n return value instanceof RegistryError;\n}\n"]}
1
+ {"version":3,"file":"registry-errors.js","sourceRoot":"","sources":["../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAN,IAAY,iBA4CX;AA5CD,WAAY,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AC5F,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,YAAY,aAAa,CAAC;AACxC,CAAC","sourcesContent":["/**\n * Registry-typed error classes.\n *\n * Phase 1 ships the typed-error vocabulary that Phase 2+ services\n * raise. Each error carries a stable `code` so CLI callers can\n * map errors to UX-specific copy without parsing messages.\n *\n * Errors are intentionally minimal — they encode discriminators,\n * not full diagnostic envelopes. UX layers attach their own\n * context (operator instructions, links, retry hints) when they\n * surface these errors.\n */\n\nexport enum RegistryErrorCode {\n /** Downloaded bytes do not hash to the digest the registry resolved. */\n ARTIFACT_INTEGRITY_MISMATCH = 'WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH',\n /** No module with that id in the domain. */\n MODULE_NOT_FOUND = 'WILDO_REGISTRY_MODULE_NOT_FOUND',\n /** No release satisfies the requested range or tag. */\n VERSION_NOT_FOUND = 'WILDO_REGISTRY_VERSION_NOT_FOUND',\n /** The requested release is yanked. */\n VERSION_YANKED = 'WILDO_REGISTRY_VERSION_YANKED',\n /** A module requires dependencies the application does not provide. */\n DEPENDENCY_UNSATISFIED = 'WILDO_REGISTRY_DEPENDENCY_UNSATISFIED',\n /** A module would write outside its declared boundaries. */\n BOUNDARY_VIOLATION = 'WILDO_REGISTRY_BOUNDARY_VIOLATION',\n /** An installed file carries local edits an update would overwrite. */\n CONFLICT_LOCAL_EDIT = 'WILDO_REGISTRY_CONFLICT_LOCAL_EDIT',\n /** The request needs a registry key and carried none. */\n AUTH_REQUIRED = 'WILDO_REGISTRY_AUTH_REQUIRED',\n /**\n * The request carried a key and the registry refused it: revoked, expired, mistyped, or belonging to a\n * suspended organization. Distinct from `AUTH_REQUIRED` because the remedy differs: that one is \"log\n * in\", this one is \"the key you logged in with no longer works\".\n */\n CREDENTIAL_REJECTED = 'WILDO_REGISTRY_CREDENTIAL_REJECTED',\n /**\n * The registry refused the request for volume: most often the per-source failed-credential guard every\n * Wildo backend applies (#1759), after repeated rejected keys. Retrying immediately extends it.\n */\n RATE_LIMITED = 'WILDO_REGISTRY_RATE_LIMITED',\n /** A yank of a yanked release, or an unyank of a live one (#1758): the release is already in that state. */\n YANK_STATE_CONFLICT = 'WILDO_REGISTRY_YANK_STATE_CONFLICT',\n /** The key is valid but not allowed to perform this operation. */\n AUTH_FORBIDDEN = 'WILDO_REGISTRY_AUTH_FORBIDDEN',\n /** The modules lockfile is inconsistent in a way `wildo registry repair-lockfile` can fix. */\n LOCKFILE_REPAIRABLE = 'WILDO_REGISTRY_LOCKFILE_REPAIRABLE',\n /** The source change succeeded but provider materialization afterwards failed (install, update or remove). */\n PROVIDER_SYNC_FAILED = 'WILDO_REGISTRY_PROVIDER_SYNC_FAILED',\n /** The registry answered with an HTTP status the client has no meaning for. */\n UNEXPECTED_STATUS = 'WILDO_REGISTRY_UNEXPECTED_STATUS',\n /** A 2xx response carried a payload the contract cannot parse. */\n MALFORMED_PAYLOAD = 'WILDO_REGISTRY_MALFORMED_PAYLOAD',\n /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */\n REQUEST_TIMEOUT = 'WILDO_REGISTRY_REQUEST_TIMEOUT',\n /** A domain with that slug already exists on the registry (#2024); whose it is takes a second question. */\n DOMAIN_TAKEN = 'WILDO_REGISTRY_DOMAIN_TAKEN',\n}\n\nexport class RegistryError extends Error {\n readonly code: RegistryErrorCode;\n\n constructor(code: RegistryErrorCode, message: string) {\n super(message);\n // L13 (third-pass review): set `name = 'RegistryError'` defensively.\n // Subclasses still overwrite it in their constructors, but a future\n // subclass that forgets to set `name` would leave the default\n // `'Error'` in stack traces — misleading. With this base default,\n // even an undeclared subclass surfaces as a `RegistryError` in\n // logs.\n this.name = 'RegistryError';\n this.code = code;\n }\n}\n\nexport class RegistryArtifactIntegrityMismatchError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly expected: string,\n public readonly actual: string,\n ) {\n super(\n RegistryErrorCode.ARTIFACT_INTEGRITY_MISMATCH,\n `Artifact integrity mismatch for ${moduleId}@${version}: expected ${expected}, got ${actual}.`,\n );\n this.name = 'RegistryArtifactIntegrityMismatchError';\n }\n}\n\nexport class RegistryModuleNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string) {\n super(\n RegistryErrorCode.MODULE_NOT_FOUND,\n `Module not found: ${moduleId}.`,\n );\n this.name = 'RegistryModuleNotFoundError';\n }\n}\n\nexport class RegistryVersionNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly versionRange: string) {\n super(\n RegistryErrorCode.VERSION_NOT_FOUND,\n `No version of ${moduleId} satisfies \"${versionRange}\".`,\n );\n this.name = 'RegistryVersionNotFoundError';\n }\n}\n\nexport class RegistryVersionYankedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly version: string, reason?: string) {\n super(\n RegistryErrorCode.VERSION_YANKED,\n `Version ${moduleId}@${version} is yanked${reason ? `: ${reason}` : ''}.`,\n );\n this.name = 'RegistryVersionYankedError';\n }\n}\n\nexport class RegistryDependencyUnsatisfiedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly missing: readonly string[]) {\n super(\n RegistryErrorCode.DEPENDENCY_UNSATISFIED,\n `Module ${moduleId} requires unmet dependencies: ${missing.join(', ')}.`,\n );\n this.name = 'RegistryDependencyUnsatisfiedError';\n }\n}\n\nexport class RegistryBoundaryViolationError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly offendingPath: string) {\n super(\n RegistryErrorCode.BOUNDARY_VIOLATION,\n `Module ${moduleId} attempts to write outside its declared boundaries: ${offendingPath}.`,\n );\n this.name = 'RegistryBoundaryViolationError';\n }\n}\n\nexport class RegistryConflictLocalEditError extends RegistryError {\n constructor(public readonly filePath: string) {\n super(\n RegistryErrorCode.CONFLICT_LOCAL_EDIT,\n `Local edit detected at ${filePath}; refusing to overwrite without --force.`,\n );\n this.name = 'RegistryConflictLocalEditError';\n }\n}\n\nexport class RegistryAuthRequiredError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.AUTH_REQUIRED,\n `Authentication required for ${registryUrl}. Run \\`wildo registry login --registry ${registryUrl}\\`.`,\n );\n this.name = 'RegistryAuthRequiredError';\n }\n}\n\nexport class RegistryCredentialRejectedError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.CREDENTIAL_REJECTED,\n `The registry at ${registryUrl} rejected the stored key (revoked, expired or not recognised). ` +\n `Run \\`wildo registry login --registry ${registryUrl}\\` with a current key.`,\n );\n this.name = 'RegistryCredentialRejectedError';\n }\n}\n\nexport class RegistryRateLimitedError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n /** From `Retry-After`, when the registry sent one in seconds. */\n public readonly retryAfterSeconds: number | undefined,\n ) {\n super(\n RegistryErrorCode.RATE_LIMITED,\n `Registry \"${action}\" was rate-limited at ${registryUrl}` +\n (retryAfterSeconds !== undefined ? `; retry in ${retryAfterSeconds}s.` : '; wait before retrying.') +\n ' Repeated rejected keys from one source trigger this; check the key before retrying.',\n );\n this.name = 'RegistryRateLimitedError';\n }\n}\n\n/** The two release-state verbs (#1758); the value is also the route segment. */\nexport enum RegistryYankVerb {\n YANK = 'yank',\n UNYANK = 'unyank',\n}\n\n/**\n * The registry refused a yank or unyank because the release is already in the requested state (409).\n * Typed so a caller can report it as the no-op it is rather than a failure of the registry.\n */\nexport class RegistryYankStateConflictError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly verb: RegistryYankVerb,\n ) {\n super(\n RegistryErrorCode.YANK_STATE_CONFLICT,\n verb === RegistryYankVerb.YANK ? `${moduleId}@${version} is already yanked.` : `${moduleId}@${version} is not yanked.`,\n );\n this.name = 'RegistryYankStateConflictError';\n }\n}\n\n/**\n * Stable, client-branchable codes the registry server puts on a refusal, carried on the wire as\n * `error.details.code` (the engine's documented channel for a switch-on-code refusal: `code` is the one\n * context key its client sanitizer admits for that purpose). Server and client both import this enum, so\n * the value has one source.\n */\nexport enum RegistryRefusalCode {\n /**\n * A yank of a yanked release, or an unyank of a live one: the release is ALREADY in the requested\n * state, so the request is a no-op a caller may report as done.\n */\n RELEASE_STATE = 'registry_release_state',\n /**\n * A publish of a version that already exists (#2024). Versions are immutable, so the remedy is a new version.\n * Distinct from the engine's generic `version_conflict`, which a publish can also answer when it gives up after\n * lost optimistic checks: there the version was NOT stored and a retry may succeed.\n */\n VERSION_IMMUTABLE = 'registry_version_immutable',\n /** A domain create whose slug is already registered (#2024), by the caller's organization or another. */\n DOMAIN_TAKEN = 'registry_domain_taken',\n}\n\n/** Whether a refusal body carries the registry's own `code` (on `error.details.code`). */\nexport function hasRegistryRefusalCode(body: unknown, code: RegistryRefusalCode): boolean {\n const error = (body as { error?: { details?: { code?: unknown } } } | null | undefined)?.error;\n return error?.details?.code === code;\n}\n\n/**\n * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict\n * (#1758 re-review R3).\n *\n * Both routes answer 409 for two different things: the release is already in the requested state, or the\n * registry gave up re-deciding after repeated lost optimistic checks (`version_conflict`). Only the first\n * is a no-op; reading every 409 as one told an operator yanking a compromised release that it was already\n * yanked. It keys on the registry's OWN code rather than the engine's generic `conflict` reference, which\n * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.\n */\nexport function isRegistryReleaseStateConflictBody(body: unknown): boolean {\n return hasRegistryRefusalCode(body, RegistryRefusalCode.RELEASE_STATE);\n}\n\n/**\n * A domain create refused because the slug is registered (#2024). Domains are first come, first served, so the\n * caller asks its own domain list to tell \"already ours\" from \"someone else's\".\n */\nexport class RegistryDomainTakenError extends RegistryError {\n constructor(public readonly domain: string) {\n super(RegistryErrorCode.DOMAIN_TAKEN, `The registry domain \"${domain}\" already exists.`);\n this.name = 'RegistryDomainTakenError';\n }\n}\n\nexport class RegistryAuthForbiddenError extends RegistryError {\n constructor(public readonly action: string) {\n super(\n RegistryErrorCode.AUTH_FORBIDDEN,\n `Action \"${action}\" is not permitted by the current credentials.`,\n );\n this.name = 'RegistryAuthForbiddenError';\n }\n}\n\nexport class RegistryLockfileRepairableError extends RegistryError {\n constructor(message: string, public readonly hints: readonly string[] = []) {\n super(RegistryErrorCode.LOCKFILE_REPAIRABLE, message);\n this.name = 'RegistryLockfileRepairableError';\n }\n}\n\n/**\n * Raised when post-install / post-update / post-remove provider\n * materialization fails after the source mutation succeeded. The\n * companion-export discovery and `runtimeImport` reachability\n * failure modes are both surfaced via this error so module-registry\n * callers report them as first-class repairable integration errors.\n */\nexport class RegistryProviderSyncFailedError extends RegistryError {\n constructor(\n message: string,\n public readonly failureKind: 'companion-discovery' | 'runtime-import-reachability' | 'invalid-scope' | 'timeout' | 'unknown',\n public readonly stderrTail?: string,\n ) {\n super(RegistryErrorCode.PROVIDER_SYNC_FAILED, message);\n this.name = 'RegistryProviderSyncFailedError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when the server returns a non-2xx\n * status that doesn't map to a more specific typed error (404 →\n * `RegistryModuleNotFoundError`/`RegistryVersionNotFoundError`, 401 →\n * `RegistryAuthRequiredError`, 403 → `RegistryAuthForbiddenError`).\n * Carries the status code + URL so callers can discriminate \"registry\n * down / 5xx\" from authoritative client errors without re-parsing\n * `Error.message` strings.\n */\nexport class RegistryUnexpectedStatusError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly status: number,\n public readonly statusText: string,\n public readonly action: string,\n /** What the refusal's body said (#3388), read with {@link readRegistryRefusalBody}; absent for an empty body. */\n public readonly refusal?: RegistryRefusal,\n ) {\n super(\n RegistryErrorCode.UNEXPECTED_STATUS,\n `Registry \"${action}\" failed with HTTP ${status} ${statusText} at ${registryUrl}${refusal ? `: ${describeRegistryRefusal(refusal)}` : ''}.`,\n );\n this.name = 'RegistryUnexpectedStatusError';\n }\n}\n\n/** One field a registry refusal names, as its error envelope lists it: the path into the request and what is wrong there. */\nexport interface RegistryRefusalIssue {\n path: string;\n message: string;\n}\n\n/**\n * What a registry refusal SAID, read from its body (#3388). Until then every client of the registry reported a refusal\n * as its HTTP status alone: `wildo fwk publish providers` printed `400 Bad Request at <url>` for a manifest the\n * registry's schema refused, and the cause had to be inferred from the server's uptime and the schema's history.\n *\n * The registry answers through the engine's error envelope (`{ error: { type, message, code?, details?,\n * validationErrors?, correlationId? } }`), sanitized at the wire: `error.message` is only the engine's generic\n * reference (`validation`, `conflict`), the registry's own reason travels in `details.message` (the context key the\n * sanitizer admits for a VALIDATION or CONFLICT refusal), and a schema refusal lists its paths in `validationErrors`.\n * Every field is optional because a refusal may come from something that is not the registry: a proxy's HTML page\n * becomes an {@link RegistryRefusal.excerpt}.\n */\nexport interface RegistryRefusal {\n /** The engine's error type (`VALIDATION`, `CONFLICT`, …). */\n type?: string;\n /** The registry's stable refusal code, when it set one (`error.code`, or `error.details.code`). */\n code?: string;\n /** The registry's reason (`error.details.message`). */\n reason?: string;\n /** The engine's generic reference (`error.message`), shown only when no reason came with it. */\n reference?: string;\n /** The fields a schema refusal names. */\n issues: RegistryRefusalIssue[];\n /** The id the registry logged this request under; quote it to find the server's own record. */\n correlationId?: string;\n /** A body that is not the error envelope, whitespace collapsed and cut to {@link REGISTRY_REFUSAL_EXCERPT_LENGTH}. */\n excerpt?: string;\n}\n\n/** How much of a body that is not the error envelope a refusal quotes. */\nexport const REGISTRY_REFUSAL_EXCERPT_LENGTH = 300;\n\n/**\n * How long a refusal's body may take to arrive once its headers have, when the caller supplies no deadline (#3388). A\n * caller holding a request budget passes it instead (`RegistryServerClient` does, at every read). Either way the read\n * HAS a deadline, which matters most for an artifact download: it clears its response timer when the headers arrive\n * and arms its idle timer only when the transfer is read (#1763), so its refusal body would otherwise have none.\n */\nexport const REGISTRY_REFUSAL_BODY_TIMEOUT_MS = 10_000;\n\n/** How much of a refusal's body is read. An error envelope is a few hundred bytes; anything longer is quoted, not parsed. */\nexport const REGISTRY_REFUSAL_BODY_MAX_BYTES = 64 * 1024;\n\n/**\n * Read a refusal's body ONCE, bounded, and never fail doing so: its JSON value, else its text, else `undefined` (an\n * empty body, one that could not be read, or one that did not arrive within the deadline). The status is already a\n * failure, so a body that cannot be read must not replace it with a second error; the caller reports the status alone.\n *\n * Every refusal that carries no typed meaning is read through this function: `RegistryServerClient`'s unexpected\n * statuses and its 409s that are not the registry's own code, the CLI's publish request, and `wildo registry login` /\n * `whoami`. A refusal a client maps to a typed error (401, 403, 404, 429) names its remedy already and is not read: the\n * engine strips the context of an authentication, authorization or not-found refusal at the wire.\n */\nexport async function readRegistryRefusalBody(\n res: Response,\n bounds: { timeoutMs?: number; maxBytes?: number } = {},\n): Promise<unknown> {\n let reader: ReadableStreamDefaultReader<Uint8Array> | undefined;\n try {\n // Inside the guard: a body already read or locked throws here, and that must not replace the status either.\n reader = res.body?.getReader();\n } catch {\n return undefined;\n }\n if (!reader) return undefined;\n const maxBytes = bounds.maxBytes ?? REGISTRY_REFUSAL_BODY_MAX_BYTES;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const expired = new Promise<'expired'>((resolve) => {\n timer = setTimeout(() => resolve('expired'), bounds.timeoutMs ?? REGISTRY_REFUSAL_BODY_TIMEOUT_MS);\n });\n const chunks: Uint8Array[] = [];\n let total = 0;\n try {\n for (;;) {\n const next = await Promise.race([reader.read(), expired]);\n if (next === 'expired') return undefined;\n if (next.done) break;\n chunks.push(next.value);\n total += next.value.byteLength;\n if (total >= maxBytes) break;\n }\n } catch {\n return undefined;\n } finally {\n clearTimeout(timer);\n // Releases the connection whether the body ended, was cut at the cap, or stalled.\n void reader.cancel().catch(() => undefined);\n }\n const bytes = new Uint8Array(total);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.byteLength;\n }\n const text = new TextDecoder().decode(bytes.subarray(0, Math.min(total, maxBytes)));\n if (text.trim() === '') return undefined;\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return text;\n }\n}\n\nfunction nonEmptyString(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() !== '' ? value : undefined;\n}\n\n/** A `validationErrors` value: a plain message, or a coded entry (`{ code, params }`) the client has no words for. */\nfunction describeValidationEntry(entry: unknown): string | undefined {\n const text = nonEmptyString(entry);\n if (text) return text;\n if (entry && typeof entry === 'object' && typeof (entry as { code?: unknown }).code === 'string') {\n const { code, params } = entry as { code: string; params?: unknown };\n return params && typeof params === 'object' && Object.keys(params).length > 0 ? `${code} ${JSON.stringify(params)}` : code;\n }\n return undefined;\n}\n\n/**\n * The fields a refusal names. `details.zodIssues` first: it is the full ordered list, while the envelope's\n * `validationErrors` is a map the error handler keys by the joined path, so two issues on one path (every issue of a\n * URL segment or a slug, whose path is empty) collapse to the last. `validationErrors` answers when there are no\n * `zodIssues`: a coded entry (`not_unique`, `declared_refusal`) travels only there.\n */\nfunction refusalIssues(error: Record<string, unknown>, details: Record<string, unknown> | undefined): RegistryRefusalIssue[] {\n const zodIssues = details?.zodIssues;\n if (Array.isArray(zodIssues)) {\n const issues = zodIssues.flatMap((issue: unknown) => {\n const { path, message } = (issue ?? {}) as { path?: unknown; message?: unknown };\n const text = nonEmptyString(message);\n if (!text) return [];\n return [{ path: Array.isArray(path) ? path.map(String).join('.') : String(path ?? ''), message: text }];\n });\n if (issues.length > 0) return issues;\n }\n const validationErrors = error.validationErrors;\n if (!validationErrors || typeof validationErrors !== 'object') return [];\n const issues: RegistryRefusalIssue[] = [];\n for (const [path, entry] of Object.entries(validationErrors as Record<string, unknown>)) {\n const message = describeValidationEntry(entry);\n if (message) issues.push({ path, message });\n }\n return issues;\n}\n\n/**\n * What a refusal body says, from what {@link readRegistryRefusalBody} returned: the error envelope's fields, or an\n * excerpt of a body that is not one. `undefined` when there was no body, so the caller reports the status alone\n * rather than an empty reason.\n */\nexport function parseRegistryRefusalBody(body: unknown): RegistryRefusal | undefined {\n if (body === undefined || body === null) return undefined;\n const envelope = typeof body === 'object' ? (body as { error?: unknown }).error : undefined;\n if (envelope && typeof envelope === 'object') {\n const error = envelope as Record<string, unknown>;\n const details = error.details && typeof error.details === 'object' ? (error.details as Record<string, unknown>) : undefined;\n const reason = nonEmptyString(details?.message);\n const refusal: RegistryRefusal = { issues: refusalIssues(error, details) };\n const type = nonEmptyString(error.type);\n const code = nonEmptyString(error.code) ?? nonEmptyString(details?.code);\n const reference = nonEmptyString(error.message) ?? nonEmptyString(error.customMessageReference);\n const correlationId = nonEmptyString(error.correlationId);\n if (type) refusal.type = type;\n if (code) refusal.code = code;\n if (reason) refusal.reason = reason;\n if (reference) refusal.reference = reference;\n if (correlationId) refusal.correlationId = correlationId;\n return refusal;\n }\n // `{ error: \"…\" }`: a plain string under `error`, which a server that is not the engine may answer.\n const flat = typeof envelope === 'string' ? envelope : typeof body === 'string' ? body : JSON.stringify(body);\n const excerpt = flat.replace(/\\s+/g, ' ').trim();\n if (excerpt === '') return undefined;\n return {\n issues: [],\n excerpt: excerpt.length > REGISTRY_REFUSAL_EXCERPT_LENGTH ? `${excerpt.slice(0, REGISTRY_REFUSAL_EXCERPT_LENGTH)}…` : excerpt,\n };\n}\n\n/** {@link readRegistryRefusalBody} then {@link parseRegistryRefusalBody}, for a caller that branches on nothing in the body. */\nexport async function readRegistryRefusal(res: Response, bounds: { timeoutMs?: number; maxBytes?: number } = {}): Promise<RegistryRefusal | undefined> {\n return parseRegistryRefusalBody(await readRegistryRefusalBody(res, bounds));\n}\n\n/**\n * One line for a person: the reason (or the generic reference when the registry gave none), the fields it names, then\n * the code and the correlation id. E.g. `invalid manifest; provider: Unrecognized key: \"openApi\" (VALIDATION,\n * correlation id 7f3a…)`.\n */\nexport function describeRegistryRefusal(refusal: RegistryRefusal): string {\n if (refusal.excerpt !== undefined) return `the response said: ${refusal.excerpt}`;\n const parts = [refusal.reason ?? refusal.reference ?? 'the registry gave no reason'];\n for (const issue of refusal.issues) parts.push(issue.path ? `${issue.path}: ${issue.message}` : issue.message);\n const labels = [refusal.code ?? refusal.type, refusal.correlationId ? `correlation id ${refusal.correlationId}` : undefined].filter(\n (label): label is string => label !== undefined,\n );\n return `${parts.join('; ')}${labels.length > 0 ? ` (${labels.join(', ')})` : ''}`;\n}\n\n/**\n * Raised by `RegistryServerClient` when\n * a 2xx response carries a payload the canonical Zod schema can't parse.\n * Without this, malformed payloads previously surfaced as bare `Error`\n * (`'Registry resolve returned a malformed payload at ...'`), which\n * broke the `isRegistryError(err)` typed-handler contract every other\n * client surface honored.\n */\nexport class RegistryMalformedPayloadError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly detail: string,\n ) {\n super(\n RegistryErrorCode.MALFORMED_PAYLOAD,\n `Registry \"${action}\" returned a malformed payload at ${registryUrl}: ${detail}`,\n );\n this.name = 'RegistryMalformedPayloadError';\n }\n}\n\n/**\n * Where a registry exchange ran out of time (#1763). The two call for different remedies: no response\n * at all points at the registry or the network path; a transfer that STALLED part-way is a slow link,\n * and is measured as silence between chunks rather than as the size of the artifact.\n */\nexport enum RegistryTimeoutPhase {\n /** No response (status + headers) arrived within the request budget. */\n AWAITING_RESPONSE = 'awaiting_response',\n /** The response started, then no bytes arrived for the idle budget. */\n TRANSFER_STALLED = 'transfer_stalled',\n /**\n * The response (status + headers) arrived, but a small metadata body did not finish within the same\n * request budget. Not `TRANSFER_STALLED`: a metadata body has no idle budget, only the request's.\n */\n READING_BODY = 'reading_body',\n}\n\nfunction describeTimeout(phase: RegistryTimeoutPhase, action: string, registryUrl: string, timeoutMs: number): string {\n switch (phase) {\n case RegistryTimeoutPhase.AWAITING_RESPONSE:\n return `Registry \"${action}\" got no response within ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.TRANSFER_STALLED:\n return `Registry \"${action}\" stalled: no data for ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.READING_BODY:\n return `Registry \"${action}\" answered but its response did not finish within ${timeoutMs}ms at ${registryUrl}.`;\n }\n}\n\n/**\n * A registry request that timed out, in the typed vocabulary, so `isRegistryError(err)` handlers see it.\n * Before #1763 a timeout escaped as a bare `Error` (before the response) or a raw `AbortError` (during\n * the body), and a JSON body cut short was reported as a MALFORMED payload.\n */\nexport class RegistryRequestTimeoutError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly phase: RegistryTimeoutPhase,\n public readonly timeoutMs: number,\n ) {\n super(\n RegistryErrorCode.REQUEST_TIMEOUT,\n describeTimeout(phase, action, registryUrl, timeoutMs),\n );\n this.name = 'RegistryRequestTimeoutError';\n }\n}\n\n/** True for the error a fetch (or a body read) raises when its abort signal fires. */\nexport function isAbortLikeError(err: unknown): boolean {\n return err instanceof Error && (err.name === 'AbortError' || err.name === 'TimeoutError');\n}\n\nexport function isRegistryError(value: unknown): value is RegistryError {\n return value instanceof RegistryError;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"registry-keys.schemas.js","sourceRoot":"","sources":["../../../../src/registry/registry-keys.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,uHAAuH;AACvH,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,qGAAqG;IACrG,gCAAa,CAAA;IACb,uFAAuF;IACvF,sCAAmB,CAAA;AACrB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,6BAA6B,EAAE;IACnF,KAAK,EAAE,iFAAiF;CACzF,CAAC,CAAC;AAEH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE9E,MAAM,C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C,IAAI,CAAC,YAAY,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;AAGxI,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAElH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAEtH,iDAAiD;AACjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,UAAU,0BAA0B,CAAC,QAAgB;IACzD,OAAO,GAAG,wBAAwB,IAAI,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Wire contract of the platform's module-registry key door (#1756): apps-manager\n * `/admin/registry/keys`, called by `wildo registry key`. Shared here because the two ends are\n * different packages and neither may import the other.\n *\n * ## A key belongs to an ORGANIZATION, and says so\n *\n * The registry authorizes against `ownerOrganizationId` on its domain and module rows, so a registry\n * key's authority is its organization: a publish key may publish into EVERY domain that organization\n * owns. The door therefore addresses an organization, not an application. An earlier draft took an\n * `appSlug` and resolved its owner, which read as a per-application key while narrowing nothing: every\n * application a platform registers is owned by the one platform owner organization\n * (`WILDO_OWNER_ORGANIZATION`), so a key \"for application A\" could publish into application B's domains.\n * A parameter that looks like a scope and scopes nothing is a false control, so it was removed.\n * Omit `organizationSlug` for the platform owner organization, the common case.\n */\n\nimport { z } from 'zod';\nimport { ApiKeyStatus, CORE_ORG_ROLES } from '@wildo-ai/saas-models';\n\n/** The roles a registry key may carry — mapped by apps-manager onto the two roles the registry's resources declare. */\nexport enum RegistryKeyRole {\n /** Read RESTRICTED modules (resolve, info, download) — an install / CI key. Carries `ORG_MEMBER`. */\n READ = 'read',\n /** Publish, yank and tag in the owning organization's domains. Carries `ORG_ADMIN`. */\n PUBLISH = 'publish',\n}\n\n/** A registry key always expires; the operator re-mints rather than extending. */\nexport const REGISTRY_KEY_DEFAULT_EXPIRY_DAYS = 90;\nexport const REGISTRY_KEY_MAX_EXPIRY_DAYS = 365;\n\n/** A key's operator-facing name: lowercase letters, digits, `.`, `_`, `-` (max 64). */\nexport const RegistryKeyNameSchema = z.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/, {\n error: 'a registry key name must be lowercase letters, digits, \".\", \"_\" or \"-\" (max 64)',\n});\n\n/** The organization a key belongs to, by slug. Absent = the platform owner organization. */\nexport const RegistryKeyOrganizationSlugSchema = z.string().min(1).optional();\n\nexport const RegistryKeyMintRequestSchema = z.strictObject({\n organizationSlug: RegistryKeyOrganizationSlugSchema,\n name: RegistryKeyNameSchema,\n role: z.enum(RegistryKeyRole),\n expiresInDays: z.number().int().min(1).max(REGISTRY_KEY_MAX_EXPIRY_DAYS).optional(),\n});\nexport type RegistryKeyMintRequest = z.infer<typeof RegistryKeyMintRequestSchema>;\n\nexport const RegistryKeyMintResponseSchema = z.object({\n apiKeyId: z.string().min(1),\n /** The secret — returned exactly once, never stored by the platform. */\n plainKey: z.string().min(1),\n keyPrefix: z.string().min(1),\n organizationId: z.string().min(1),\n organizationSlug: z.string().min(1),\n role: z.enum(RegistryKeyRole),\n expiresAt: z.iso.datetime(),\n});\nexport type RegistryKeyMintResponse = z.infer<typeof RegistryKeyMintResponseSchema>;\n\nexport const RegistryKeySummarySchema = z.object({\n apiKeyId: z.string().min(1),\n name: z.string(),\n keyPrefix: z.string(),\n roles: z.array(z.enum(CORE_ORG_ROLES)),\n status: z.enum(ApiKeyStatus),\n expiresAt: z.iso.datetime().optional(),\n});\nexport type RegistryKeySummary = z.infer<typeof RegistryKeySummarySchema>;\n\nexport const RegistryKeyListResponseSchema = z.object({ organizationSlug: z.string().min(1), keys: z.array(RegistryKeySummarySchema) });\nexport type RegistryKeyListResponse = z.infer<typeof RegistryKeyListResponseSchema>;\n\nexport const RegistryKeyListQuerySchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });\n\nexport const RegistryKeyRevokeRequestSchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });\n\n/** Admin-door paths, one place for both ends. */\nexport const REGISTRY_KEYS_ADMIN_PATH = '/admin/registry/keys';\nexport function buildRegistryKeyRevokePath(apiKeyId: string): string {\n return `${REGISTRY_KEYS_ADMIN_PATH}/${encodeURIComponent(apiKeyId)}/revoke`;\n}\n"]}
1
+ {"version":3,"file":"registry-keys.schemas.js","sourceRoot":"","sources":["../../../src/registry/registry-keys.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,uHAAuH;AACvH,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,qGAAqG;IACrG,gCAAa,CAAA;IACb,uFAAuF;IACvF,sCAAmB,CAAA;AACrB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,6BAA6B,EAAE;IACnF,KAAK,EAAE,iFAAiF;CACzF,CAAC,CAAC;AAEH,4FAA4F;AAC5F,MAAM,CAAC,MA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IACrB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;AAGxI,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAElH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAEtH,iDAAiD;AACjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,UAAU,0BAA0B,CAAC,QAAgB;IACzD,OAAO,GAAG,wBAAwB,IAAI,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Wire contract of the platform's module-registry key door (#1756): apps-manager\n * `/admin/registry/keys`, called by `wildo registry key`. Shared here because the two ends are\n * different packages and neither may import the other.\n *\n * ## A key belongs to an ORGANIZATION, and says so\n *\n * The registry authorizes against `ownerOrganizationId` on its domain and module rows, so a registry\n * key's authority is its organization: a publish key may publish into EVERY domain that organization\n * owns. The door therefore addresses an organization, not an application. An earlier draft took an\n * `appSlug` and resolved its owner, which read as a per-application key while narrowing nothing: every\n * application a platform registers is owned by the one platform owner organization\n * (`WILDO_OWNER_ORGANIZATION`), so a key \"for application A\" could publish into application B's domains.\n * A parameter that looks like a scope and scopes nothing is a false control, so it was removed.\n * Omit `organizationSlug` for the platform owner organization, the common case.\n */\n\nimport { z } from 'zod';\nimport { ApiKeyStatus, CORE_ORG_ROLES } from '@wildo-ai/saas-models';\n\n/** The roles a registry key may carry — mapped by apps-manager onto the two roles the registry's resources declare. */\nexport enum RegistryKeyRole {\n /** Read RESTRICTED modules (resolve, info, download) — an install / CI key. Carries `ORG_MEMBER`. */\n READ = 'read',\n /** Publish, yank and tag in the owning organization's domains. Carries `ORG_ADMIN`. */\n PUBLISH = 'publish',\n}\n\n/** A registry key always expires; the operator re-mints rather than extending. */\nexport const REGISTRY_KEY_DEFAULT_EXPIRY_DAYS = 90;\nexport const REGISTRY_KEY_MAX_EXPIRY_DAYS = 365;\n\n/** A key's operator-facing name: lowercase letters, digits, `.`, `_`, `-` (max 64). */\nexport const RegistryKeyNameSchema = z.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/, {\n error: 'a registry key name must be lowercase letters, digits, \".\", \"_\" or \"-\" (max 64)',\n});\n\n/** The organization a key belongs to, by slug. Absent = the platform owner organization. */\nexport const RegistryKeyOrganizationSlugSchema = z.string().min(1).optional();\n\nexport const RegistryKeyMintRequestSchema = z.strictObject({\n organizationSlug: RegistryKeyOrganizationSlugSchema,\n name: RegistryKeyNameSchema,\n role: z.enum(RegistryKeyRole),\n expiresInDays: z.number().int().min(1).max(REGISTRY_KEY_MAX_EXPIRY_DAYS).optional(),\n});\nexport type RegistryKeyMintRequest = z.infer<typeof RegistryKeyMintRequestSchema>;\n\nexport const RegistryKeyMintResponseSchema = z.object({\n apiKeyId: z.string().min(1),\n /** The secret — returned exactly once, never stored by the platform. */\n plainKey: z.string().min(1),\n keyPrefix: z.string().min(1),\n organizationId: z.string().min(1),\n organizationSlug: z.string().min(1),\n role: z.enum(RegistryKeyRole),\n expiresAt: z.iso.datetime(),\n});\nexport type RegistryKeyMintResponse = z.infer<typeof RegistryKeyMintResponseSchema>;\n\nexport const RegistryKeySummarySchema = z.object({\n apiKeyId: z.string().min(1),\n name: z.string(),\n keyPrefix: z.string(),\n roles: z.array(z.enum(CORE_ORG_ROLES)),\n status: z.enum(ApiKeyStatus),\n expiresAt: z.iso.datetime().optional(),\n});\nexport type RegistryKeySummary = z.infer<typeof RegistryKeySummarySchema>;\n\nexport const RegistryKeyListResponseSchema = z.object({ organizationSlug: z.string().min(1), keys: z.array(RegistryKeySummarySchema) });\nexport type RegistryKeyListResponse = z.infer<typeof RegistryKeyListResponseSchema>;\n\nexport const RegistryKeyListQuerySchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });\n\nexport const RegistryKeyRevokeRequestSchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });\n\n/** Admin-door paths, one place for both ends. */\nexport const REGISTRY_KEYS_ADMIN_PATH = '/admin/registry/keys';\nexport function buildRegistryKeyRevokePath(apiKeyId: string): string {\n return `${REGISTRY_KEYS_ADMIN_PATH}/${encodeURIComponent(apiKeyId)}/revoke`;\n}\n"]}
@@ -52,6 +52,11 @@ export declare const DEFAULT_REGISTRY_SECTION_SCHEMAS: {
52
52
  serviceKey: import("zod").ZodString;
53
53
  path: import("zod").ZodString;
54
54
  }, import("zod/v4/core").$strict>>;
55
+ augments: import("zod").ZodOptional<import("zod").ZodString>;
56
+ vendorPins: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
57
+ heldVendorPins: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
58
+ onlyBuiltDependencies: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
59
+ heldOnlyBuiltDependencies: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
55
60
  }, import("zod/v4/core").$strict>>;
56
61
  }, import("zod/v4/core").$strict>>;
57
62
  }, import("zod/v4/core").$strict>>>;