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

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 (389) 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.map +1 -1
  6. package/dist/esm/blueprint/anchored-region.js.map +1 -1
  7. package/dist/esm/blueprint/blueprint.schemas.d.ts +0 -89
  8. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -1
  9. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -1
  10. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  12. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  13. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  18. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +8 -1
  19. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/bootstrap.schemas.js +15 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  22. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +10 -2
  23. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +10 -2
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  26. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  27. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  29. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  30. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  31. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  32. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  34. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  35. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  36. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  37. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  39. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  40. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  41. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  42. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  43. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  44. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  45. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  46. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  48. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  49. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  51. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  52. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -1
  53. package/dist/esm/bootstrap/runtime-response-integrity.js +3 -3
  54. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -1
  55. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -1
  56. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -1
  57. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  58. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  59. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  60. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  61. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -1
  62. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -1
  63. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  64. package/dist/esm/config-authoring.entry.js.map +1 -1
  65. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  66. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  67. package/dist/esm/index.d.ts +5 -1
  68. package/dist/esm/index.d.ts.map +1 -1
  69. package/dist/esm/index.js +5 -1
  70. package/dist/esm/index.js.map +1 -1
  71. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  72. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  73. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  74. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  75. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  76. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  78. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  79. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  80. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  81. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  82. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-verifier.d.ts +114 -40
  84. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
  85. package/dist/esm/key-management/approval-seal-verifier.js +143 -12
  86. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
  87. package/dist/esm/key-management/approval-seal.contracts.d.ts +12 -15
  88. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -1
  89. package/dist/esm/key-management/approval-seal.contracts.js +20 -0
  90. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -1
  91. package/dist/esm/key-management/data-key.contracts.d.ts +0 -2
  92. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -1
  93. package/dist/esm/key-management/data-key.contracts.js.map +1 -1
  94. package/dist/esm/key-management/es256-jws.d.ts.map +1 -1
  95. package/dist/esm/key-management/es256-jws.js.map +1 -1
  96. package/dist/esm/key-management/key-provider.spi.d.ts +8 -1
  97. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -1
  98. package/dist/esm/key-management/key-provider.spi.js.map +1 -1
  99. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +2 -12
  100. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -1
  101. package/dist/esm/key-management/keyring-rotation.contracts.js +3 -3
  102. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -1
  103. package/dist/esm/key-management/keyring-status.contracts.d.ts +0 -7
  104. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -1
  105. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -1
  106. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  107. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  108. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  109. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  110. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  111. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  112. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  113. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  114. package/dist/esm/key-management/qr-code.d.ts +38 -0
  115. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  116. package/dist/esm/key-management/qr-code.js +325 -0
  117. package/dist/esm/key-management/qr-code.js.map +1 -0
  118. package/dist/esm/key-management/signature-request.contracts.d.ts +0 -4
  119. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -1
  120. package/dist/esm/key-management/signature-request.contracts.js.map +1 -1
  121. package/dist/esm/key-management/signing-log-export.contracts.d.ts +0 -1
  122. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -1
  123. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -1
  124. package/dist/esm/key-management/vault-custody.contracts.d.ts +43 -0
  125. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -1
  126. package/dist/esm/key-management/vault-custody.contracts.js +66 -0
  127. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -1
  128. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  129. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  130. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  131. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  132. package/dist/esm/lockfile/canonical-json.js +1 -1
  133. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  134. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  135. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  136. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  137. package/dist/esm/lockfile/lockfile-io.d.ts +6 -8
  138. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  139. package/dist/esm/lockfile/lockfile-io.js +6 -8
  140. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  141. package/dist/esm/lockfile/materialize-infra-section.d.ts +5 -6
  142. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  143. package/dist/esm/lockfile/materialize-infra-section.js +4 -5
  144. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  145. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +1 -247
  146. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  147. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +1 -1
  148. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  149. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  150. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  151. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  152. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  153. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  154. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +15 -3
  155. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  156. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -1
  157. package/dist/esm/project-config/application-served-public-documents.loader.js +16 -8
  158. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -1
  159. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  160. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  161. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  162. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  163. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  164. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  165. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  166. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  167. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  168. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  169. package/dist/esm/project-config/config-module-resolution.js +33 -0
  170. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  171. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  172. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  173. package/dist/esm/project-config/define-infra-env-config.d.ts +146 -55
  174. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  175. package/dist/esm/project-config/define-infra-env-config.js +124 -71
  176. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  177. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  178. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  179. package/dist/esm/project-config/define-minion-config.js +64 -25
  180. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  181. package/dist/esm/project-config/define-saas-config.d.ts +41 -437
  182. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  183. package/dist/esm/project-config/define-saas-config.js +102 -94
  184. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  185. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  186. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  187. package/dist/esm/project-config/define-worker-config.js +10 -12
  188. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  189. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/hosted-infra-env-config.js +2 -1
  191. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  192. package/dist/esm/project-config/index.d.ts +2 -0
  193. package/dist/esm/project-config/index.d.ts.map +1 -1
  194. package/dist/esm/project-config/index.js +2 -0
  195. package/dist/esm/project-config/index.js.map +1 -1
  196. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  197. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  198. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  199. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  200. package/dist/esm/project-config/loader.d.ts +131 -14
  201. package/dist/esm/project-config/loader.d.ts.map +1 -1
  202. package/dist/esm/project-config/loader.js +226 -12
  203. package/dist/esm/project-config/loader.js.map +1 -1
  204. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  205. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  206. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  207. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  208. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  209. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  210. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  211. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  212. package/dist/esm/project-config/owning-package-tsconfig.d.ts +7 -7
  213. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -1
  214. package/dist/esm/project-config/owning-package-tsconfig.js +7 -7
  215. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -1
  216. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  217. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  218. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  219. package/dist/esm/project-config/provider-companion-discovery.js +3 -1
  220. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  221. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -46
  222. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  223. package/dist/esm/project-config/provider-runtime-artifacts.js +150 -4
  224. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  225. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  226. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  227. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  228. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  229. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  230. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  231. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  232. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  233. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  234. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  235. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
  236. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  237. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  238. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  240. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  242. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  243. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  244. package/dist/esm/project-config/shared/csp-defaults.d.ts +34 -6
  245. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  246. package/dist/esm/project-config/shared/csp-defaults.js +52 -8
  247. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  248. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  249. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  250. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  251. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  252. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -84
  253. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  254. package/dist/esm/project-config/shared/csp.schemas.js +40 -12
  255. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  256. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  257. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  258. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  259. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  260. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  261. package/dist/esm/project-config/shared/environment.schemas.d.ts +95 -8
  262. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/environment.schemas.js +122 -10
  264. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  266. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  270. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -1
  271. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +1 -1
  273. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  275. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  276. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  277. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  278. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +20 -0
  279. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/minion-resource-access.validation.js +21 -2
  281. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  282. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  284. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +67 -38
  285. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -1
  286. package/dist/esm/project-config/shared/platform-key-management.schemas.js +113 -5
  287. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -1
  288. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  289. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  290. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  291. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  292. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  293. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  294. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  295. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  296. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  297. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  298. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  299. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  300. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  301. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  302. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  303. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  304. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  305. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  306. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  307. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  308. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  309. package/dist/esm/registry/digest.schemas.js.map +1 -1
  310. package/dist/esm/registry/index.d.ts +2 -3
  311. package/dist/esm/registry/index.d.ts.map +1 -1
  312. package/dist/esm/registry/index.js +2 -3
  313. package/dist/esm/registry/index.js.map +1 -1
  314. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  315. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  316. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +1 -98
  317. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  318. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  319. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  320. package/dist/esm/registry/module-artifact.schemas.d.ts +17 -17
  321. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  322. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  323. package/dist/esm/registry/module-manifest.schemas.d.ts +151 -219
  324. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  325. package/dist/esm/registry/module-manifest.schemas.js +145 -13
  326. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  327. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  328. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  329. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  330. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  331. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  332. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  333. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  334. package/dist/esm/registry/registry-errors.d.ts +81 -3
  335. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  336. package/dist/esm/registry/registry-errors.js +185 -4
  337. package/dist/esm/registry/registry-errors.js.map +1 -1
  338. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
  339. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  340. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  342. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-url-resolution.js.map +1 -1
  344. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  345. package/dist/esm/release/framework-release.constants.js.map +1 -1
  346. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  347. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  348. package/dist/esm/schemas/framework-secrets.schemas.d.ts +0 -7
  349. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  350. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  351. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  352. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  353. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  354. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  355. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  356. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  357. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  358. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  359. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  360. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  361. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  362. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  363. package/dist/esm/workspace-scope/index.js.map +1 -1
  364. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  365. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  366. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  367. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  368. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  369. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  370. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  371. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  372. package/dist/tsconfig.build.tsbuildinfo +1 -1
  373. package/package.json +12 -12
  374. package/dist/esm/_unimplemented/index.d.ts +0 -3
  375. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  376. package/dist/esm/_unimplemented/index.js +0 -3
  377. package/dist/esm/_unimplemented/index.js.map +0 -1
  378. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  379. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  380. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  381. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  382. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  383. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  384. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  385. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  386. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  387. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  388. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  389. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -1,39 +1,28 @@
1
1
  /**
2
- * @fileoverview Soft-warn utility — companion to
3
- * `unimplemented-field-warning.ts` for cross-cutting authoring concerns
4
- * that are NOT bound to a single `@unimplemented` field but still need
5
- * a noisy-yet-non-fatal `process.stderr` channel during the v1 minions
6
- * & workers rollout.
7
- *
8
- * Why a separate utility (and not just call `emitUnimplementedFieldWarning`)?
9
- *
10
- * - `@unimplemented` warnings are pinned to a SCHEMA FIELD — every
11
- * surface today appears in the `cli-dx.md` table and has a tracking
12
- * ID in the deferred backlog. Adding non-field-bound warnings to
13
- * that channel would dilute the contract that "every line in the
14
- * `@unimplemented` stream maps 1:1 to a deferred-backlog row".
15
- *
16
- * - The minions/workers slice (KD-11 / H-3 in
17
- * `.cursor/plans/minions-and-workers-implementation.md`) needs to
18
- * surface advisories like "your minion's `resourceAccess` whitelist
19
- * is empty — you'll get blocked at every repository call" that are
20
- * PER-MINION, not per-field. The natural authoring key is a
21
- * `(scope, key)` pair (e.g. `('minions.marketingScrapper', 'resourceAccess.empty')`),
22
- * not a dotted field path.
23
- *
24
- * - The dev watcher re-parses on every save, so without an in-process
25
- * repeat-cap a verbose minion ACL would spam the log on every
26
- * keystroke. The `@unimplemented` warner solves dedupe per parse
27
- * call (a fresh `Set` is captured per `defineSaasConfig` call); the
28
- * soft-warn utility solves dedupe + cap PER PROCESS so a noisy
29
- * advisory does not drown the watcher even under tight save loops.
2
+ * @fileoverview Soft-warn utility: a noisy-yet-non-fatal `process.stderr` channel for authoring advisories — a config
3
+ * shape that parses but is almost certainly not what the author meant (a minion with no `resourceAccess`, an enabled
4
+ * FAN_OUT capability no provider serves).
5
+ *
6
+ * It used to sit beside an `@unimplemented` field warner, which reported an authored field that parsed but had no
7
+ * runtime consumer. That warner was removed with its last field, the config `version` (#3496): a field nothing reads is
8
+ * now refused by the strict schemas instead of accepted with a warning. Soft-warns are a different thing and stay —
9
+ * they are not bound to an unread field, but to a shape the runtime will honour in a way the author probably did not
10
+ * intend.
11
+ *
12
+ * Why its shape:
13
+ *
14
+ * - Advisories like "your minion's `resourceAccess` whitelist is empty — you'll get blocked at every repository
15
+ * call" are PER-MINION, not per-field. The natural authoring key is a `(scope, key)` pair (e.g.
16
+ * `('minions.marketingScrapper', 'resourceAccess.empty')`), not a dotted field path.
17
+ *
18
+ * - The dev watcher re-parses on every save, so without an in-process repeat-cap a verbose minion ACL would spam the
19
+ * log on every keystroke. The soft-warn utility dedupes and caps PER PROCESS so a noisy advisory does not drown
20
+ * the watcher even under tight save loops.
30
21
  *
31
22
  * Design choices (all pinned by `__tests__/soft-warn.test.ts`):
32
23
  *
33
- * - **Channel = `process.stderr.write`** (parity with
34
- * `emitUnimplementedFieldWarning`). The dev watcher's
35
- * pretty-printer hijacks `console.warn`; writing to the FD keeps
36
- * the line raw and grep-friendly.
24
+ * - **Channel = `process.stderr.write`**. The dev watcher's pretty-printer hijacks `console.warn`; writing to the FD
25
+ * keeps the line raw and grep-friendly, and write order is call order.
37
26
  *
38
27
  * - **Dedupe = process-wide on `(scope, key)`** with a configurable
39
28
  * repeat cap (default 5, env override `WILDO_SOFT_WARN_LIMIT`).
@@ -44,28 +33,16 @@
44
33
  * call) because the SAME advisory firing on every dev-watcher save
45
34
  * is exactly the noise we're trying to suppress.
46
35
  *
47
- * - **Emit ordering vs `@unimplemented`** — soft-warns emit AFTER the
48
- * `@unimplemented` block in `defineSaasConfig`. The order is the
49
- * contract because operators read the stream top-to-bottom: the
50
- * "canonical" backlog warnings come first, the "soft authoring
51
- * advisory" lines come after. `__tests__/soft-warn.test.ts`
52
- * captures stderr writes in order and asserts the ordering by
53
- * interleaving an `@unimplemented` warning with a soft-warn and
54
- * pinning the resulting message sequence.
55
- *
56
36
  * - **Format = single-line with `[wildo-soft-warn:<scope>]` prefix**.
57
37
  * The `<scope>` is operator-supplied (e.g. `'minions.marketingScrapper'`,
58
38
  * `'workers'`) so a reader can grep `wildo-soft-warn:minions` to
59
- * isolate per-minion advisories. The prefix is intentionally
60
- * distinct from `[wildo-saas-config]` / `[wildo-infra-env-config]`
61
- * so the two streams never collide visually in the dev watcher.
39
+ * isolate per-minion advisories.
62
40
  *
63
41
  * - **Test reset hook = `__resetSoftWarnState`** — exported strictly
64
42
  * for test usage. The state is a module-level `Map` because the
65
43
  * "process-wide cap" semantic requires it; tests `vi.resetModules()`
66
44
  * is too heavy for the cross-test isolation needed in
67
- * `define-saas-config.unimplemented.test.ts` (which exercises both
68
- * warners interleaved). The reset hook is documented as
45
+ * `define-saas-config.authoring.test.ts`. The reset hook is documented as
69
46
  * test-only via the leading underscore convention used elsewhere
70
47
  * in this package.
71
48
  *
@@ -81,9 +58,7 @@
81
58
  *
82
59
  * Removal contract:
83
60
  *
84
- * - When the v1 minions & workers runtime ships and the advisories
85
- * become hard parse errors (or migrate into `@unimplemented`
86
- * surfaces because a backlog item is on file), the corresponding
61
+ * - When an advisory becomes a hard parse error, the corresponding
87
62
  * `emitSoftWarn(...)` call sites MUST be deleted in the same commit
88
63
  * as the new behaviour. Leaving a stale soft-warn is worse than
89
64
  * silence — operators will start ignoring the channel.
@@ -1 +1 @@
1
- {"version":3,"file":"soft-warn.d.ts","sourceRoot":"","sources":["../../../../src/_unimplemented/soft-warn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAkCH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAmB9E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
1
+ {"version":3,"file":"soft-warn.d.ts","sourceRoot":"","sources":["../../../src/_unimplemented/soft-warn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAkCH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAmB9E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
@@ -1,39 +1,28 @@
1
1
  /**
2
- * @fileoverview Soft-warn utility — companion to
3
- * `unimplemented-field-warning.ts` for cross-cutting authoring concerns
4
- * that are NOT bound to a single `@unimplemented` field but still need
5
- * a noisy-yet-non-fatal `process.stderr` channel during the v1 minions
6
- * & workers rollout.
7
- *
8
- * Why a separate utility (and not just call `emitUnimplementedFieldWarning`)?
9
- *
10
- * - `@unimplemented` warnings are pinned to a SCHEMA FIELD — every
11
- * surface today appears in the `cli-dx.md` table and has a tracking
12
- * ID in the deferred backlog. Adding non-field-bound warnings to
13
- * that channel would dilute the contract that "every line in the
14
- * `@unimplemented` stream maps 1:1 to a deferred-backlog row".
15
- *
16
- * - The minions/workers slice (KD-11 / H-3 in
17
- * `.cursor/plans/minions-and-workers-implementation.md`) needs to
18
- * surface advisories like "your minion's `resourceAccess` whitelist
19
- * is empty — you'll get blocked at every repository call" that are
20
- * PER-MINION, not per-field. The natural authoring key is a
21
- * `(scope, key)` pair (e.g. `('minions.marketingScrapper', 'resourceAccess.empty')`),
22
- * not a dotted field path.
23
- *
24
- * - The dev watcher re-parses on every save, so without an in-process
25
- * repeat-cap a verbose minion ACL would spam the log on every
26
- * keystroke. The `@unimplemented` warner solves dedupe per parse
27
- * call (a fresh `Set` is captured per `defineSaasConfig` call); the
28
- * soft-warn utility solves dedupe + cap PER PROCESS so a noisy
29
- * advisory does not drown the watcher even under tight save loops.
2
+ * @fileoverview Soft-warn utility: a noisy-yet-non-fatal `process.stderr` channel for authoring advisories — a config
3
+ * shape that parses but is almost certainly not what the author meant (a minion with no `resourceAccess`, an enabled
4
+ * FAN_OUT capability no provider serves).
5
+ *
6
+ * It used to sit beside an `@unimplemented` field warner, which reported an authored field that parsed but had no
7
+ * runtime consumer. That warner was removed with its last field, the config `version` (#3496): a field nothing reads is
8
+ * now refused by the strict schemas instead of accepted with a warning. Soft-warns are a different thing and stay —
9
+ * they are not bound to an unread field, but to a shape the runtime will honour in a way the author probably did not
10
+ * intend.
11
+ *
12
+ * Why its shape:
13
+ *
14
+ * - Advisories like "your minion's `resourceAccess` whitelist is empty — you'll get blocked at every repository
15
+ * call" are PER-MINION, not per-field. The natural authoring key is a `(scope, key)` pair (e.g.
16
+ * `('minions.marketingScrapper', 'resourceAccess.empty')`), not a dotted field path.
17
+ *
18
+ * - The dev watcher re-parses on every save, so without an in-process repeat-cap a verbose minion ACL would spam the
19
+ * log on every keystroke. The soft-warn utility dedupes and caps PER PROCESS so a noisy advisory does not drown
20
+ * the watcher even under tight save loops.
30
21
  *
31
22
  * Design choices (all pinned by `__tests__/soft-warn.test.ts`):
32
23
  *
33
- * - **Channel = `process.stderr.write`** (parity with
34
- * `emitUnimplementedFieldWarning`). The dev watcher's
35
- * pretty-printer hijacks `console.warn`; writing to the FD keeps
36
- * the line raw and grep-friendly.
24
+ * - **Channel = `process.stderr.write`**. The dev watcher's pretty-printer hijacks `console.warn`; writing to the FD
25
+ * keeps the line raw and grep-friendly, and write order is call order.
37
26
  *
38
27
  * - **Dedupe = process-wide on `(scope, key)`** with a configurable
39
28
  * repeat cap (default 5, env override `WILDO_SOFT_WARN_LIMIT`).
@@ -44,28 +33,16 @@
44
33
  * call) because the SAME advisory firing on every dev-watcher save
45
34
  * is exactly the noise we're trying to suppress.
46
35
  *
47
- * - **Emit ordering vs `@unimplemented`** — soft-warns emit AFTER the
48
- * `@unimplemented` block in `defineSaasConfig`. The order is the
49
- * contract because operators read the stream top-to-bottom: the
50
- * "canonical" backlog warnings come first, the "soft authoring
51
- * advisory" lines come after. `__tests__/soft-warn.test.ts`
52
- * captures stderr writes in order and asserts the ordering by
53
- * interleaving an `@unimplemented` warning with a soft-warn and
54
- * pinning the resulting message sequence.
55
- *
56
36
  * - **Format = single-line with `[wildo-soft-warn:<scope>]` prefix**.
57
37
  * The `<scope>` is operator-supplied (e.g. `'minions.marketingScrapper'`,
58
38
  * `'workers'`) so a reader can grep `wildo-soft-warn:minions` to
59
- * isolate per-minion advisories. The prefix is intentionally
60
- * distinct from `[wildo-saas-config]` / `[wildo-infra-env-config]`
61
- * so the two streams never collide visually in the dev watcher.
39
+ * isolate per-minion advisories.
62
40
  *
63
41
  * - **Test reset hook = `__resetSoftWarnState`** — exported strictly
64
42
  * for test usage. The state is a module-level `Map` because the
65
43
  * "process-wide cap" semantic requires it; tests `vi.resetModules()`
66
44
  * is too heavy for the cross-test isolation needed in
67
- * `define-saas-config.unimplemented.test.ts` (which exercises both
68
- * warners interleaved). The reset hook is documented as
45
+ * `define-saas-config.authoring.test.ts`. The reset hook is documented as
69
46
  * test-only via the leading underscore convention used elsewhere
70
47
  * in this package.
71
48
  *
@@ -81,9 +58,7 @@
81
58
  *
82
59
  * Removal contract:
83
60
  *
84
- * - When the v1 minions & workers runtime ships and the advisories
85
- * become hard parse errors (or migrate into `@unimplemented`
86
- * surfaces because a backlog item is on file), the corresponding
61
+ * - When an advisory becomes a hard parse error, the corresponding
87
62
  * `emitSoftWarn(...)` call sites MUST be deleted in the same commit
88
63
  * as the new behaviour. Leaving a stale soft-warn is worse than
89
64
  * silence — operators will start ignoring the channel.
@@ -1 +1 @@
1
- {"version":3,"file":"soft-warn.js","sourceRoot":"","sources":["../../../../src/_unimplemented/soft-warn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;;;;;;;;;;;;GAaG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEhD,SAAS,eAAe;IACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;IAC9C,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,oBAAoB,CAAC;IACjE,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,oBAAoB,CAAC;IAChE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,oBAAoB,CAAC;IAC7E,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,GAAW,EAAE,OAAe;IACtE,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAEnD,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC;IAC1B,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAEnC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,KAAK,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC;IAExE,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,oBAAoB,KAAK,KAAK,GAAG,kDAAkD,GAAG,0CAA0C,CACjI,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB;IAClC,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC","sourcesContent":["/**\n * @fileoverview Soft-warn utility — companion to\n * `unimplemented-field-warning.ts` for cross-cutting authoring concerns\n * that are NOT bound to a single `@unimplemented` field but still need\n * a noisy-yet-non-fatal `process.stderr` channel during the v1 minions\n * & workers rollout.\n *\n * Why a separate utility (and not just call `emitUnimplementedFieldWarning`)?\n *\n * - `@unimplemented` warnings are pinned to a SCHEMA FIELD — every\n * surface today appears in the `cli-dx.md` table and has a tracking\n * ID in the deferred backlog. Adding non-field-bound warnings to\n * that channel would dilute the contract that \"every line in the\n * `@unimplemented` stream maps 1:1 to a deferred-backlog row\".\n *\n * - The minions/workers slice (KD-11 / H-3 in\n * `.cursor/plans/minions-and-workers-implementation.md`) needs to\n * surface advisories like \"your minion's `resourceAccess` whitelist\n * is empty — you'll get blocked at every repository call\" that are\n * PER-MINION, not per-field. The natural authoring key is a\n * `(scope, key)` pair (e.g. `('minions.marketingScrapper', 'resourceAccess.empty')`),\n * not a dotted field path.\n *\n * - The dev watcher re-parses on every save, so without an in-process\n * repeat-cap a verbose minion ACL would spam the log on every\n * keystroke. The `@unimplemented` warner solves dedupe per parse\n * call (a fresh `Set` is captured per `defineSaasConfig` call); the\n * soft-warn utility solves dedupe + cap PER PROCESS so a noisy\n * advisory does not drown the watcher even under tight save loops.\n *\n * Design choices (all pinned by `__tests__/soft-warn.test.ts`):\n *\n * - **Channel = `process.stderr.write`** (parity with\n * `emitUnimplementedFieldWarning`). The dev watcher's\n * pretty-printer hijacks `console.warn`; writing to the FD keeps\n * the line raw and grep-friendly.\n *\n * - **Dedupe = process-wide on `(scope, key)`** with a configurable\n * repeat cap (default 5, env override `WILDO_SOFT_WARN_LIMIT`).\n * After the cap is reached the utility emits ONE final\n * `[wildo-soft-warn:<scope>] <key>: suppressed further occurrences\n * (cap reached: <N>; override via WILDO_SOFT_WARN_LIMIT).` line and\n * falls silent for that pair. The cap is per-process (not per parse\n * call) because the SAME advisory firing on every dev-watcher save\n * is exactly the noise we're trying to suppress.\n *\n * - **Emit ordering vs `@unimplemented`** — soft-warns emit AFTER the\n * `@unimplemented` block in `defineSaasConfig`. The order is the\n * contract because operators read the stream top-to-bottom: the\n * \"canonical\" backlog warnings come first, the \"soft authoring\n * advisory\" lines come after. `__tests__/soft-warn.test.ts`\n * captures stderr writes in order and asserts the ordering by\n * interleaving an `@unimplemented` warning with a soft-warn and\n * pinning the resulting message sequence.\n *\n * - **Format = single-line with `[wildo-soft-warn:<scope>]` prefix**.\n * The `<scope>` is operator-supplied (e.g. `'minions.marketingScrapper'`,\n * `'workers'`) so a reader can grep `wildo-soft-warn:minions` to\n * isolate per-minion advisories. The prefix is intentionally\n * distinct from `[wildo-saas-config]` / `[wildo-infra-env-config]`\n * so the two streams never collide visually in the dev watcher.\n *\n * - **Test reset hook = `__resetSoftWarnState`** — exported strictly\n * for test usage. The state is a module-level `Map` because the\n * \"process-wide cap\" semantic requires it; tests `vi.resetModules()`\n * is too heavy for the cross-test isolation needed in\n * `define-saas-config.unimplemented.test.ts` (which exercises both\n * warners interleaved). The reset hook is documented as\n * test-only via the leading underscore convention used elsewhere\n * in this package.\n *\n * NOT a replacement for schema validation:\n *\n * - Soft-warns DO NOT prevent parse — they are written AFTER the\n * `WildoSaasConfigSchema.parse()` returns successfully.\n * - The utility is intentionally NOT typed against a known list of\n * `(scope, key)` pairs. The caller owns the taxonomy — adding a\n * closed enum here would force a circular dep with\n * `define-saas-config.ts` and force every new advisory to touch\n * this file.\n *\n * Removal contract:\n *\n * - When the v1 minions & workers runtime ships and the advisories\n * become hard parse errors (or migrate into `@unimplemented`\n * surfaces because a backlog item is on file), the corresponding\n * `emitSoftWarn(...)` call sites MUST be deleted in the same commit\n * as the new behaviour. Leaving a stale soft-warn is worse than\n * silence — operators will start ignoring the channel.\n */\n\nconst DEFAULT_REPEAT_LIMIT = 5;\n\n/**\n * Module-level state — process-wide, deliberately so the dev watcher's\n * per-save re-parses do not re-emit the same advisory on every keystroke.\n *\n * Keys are a serialized tuple `[scope, key]`, not a raw concatenated\n * string. This keeps the dedupe channel robust even when either input\n * contains punctuation like `::` — author-authored identifiers must not\n * be able to make advisory emission throw after a successful config\n * parse.\n *\n * The value is the count of actual emitted advisory lines for the pair.\n * Once the count reaches the cap, the cap-reached suppression line is\n * written exactly once.\n */\nconst softWarnState = new Map<string, number>();\n\nfunction readRepeatLimit(): number {\n const raw = process.env.WILDO_SOFT_WARN_LIMIT;\n if (raw === undefined || raw === '') return DEFAULT_REPEAT_LIMIT;\n const normalized = raw.trim();\n if (!/^[1-9]\\d*$/.test(normalized)) return DEFAULT_REPEAT_LIMIT;\n const parsed = Number(normalized);\n if (!Number.isSafeInteger(parsed) || parsed < 1) return DEFAULT_REPEAT_LIMIT;\n return parsed;\n}\n\nfunction serializeDedupeKey(scope: string, key: string): string {\n return JSON.stringify([scope, key]);\n}\n\n/**\n * Emit a single-line soft-warn to `process.stderr`.\n *\n * @param scope - Authoring scope, surfaced verbatim in the prefix\n * (e.g. `'minions.marketingScrapper'`, `'workers'`).\n * @param key - Stable advisory id within the scope\n * (e.g. `'resourceAccess.empty-write'`,\n * `'resourceAccess.unknown-resource'`).\n * @param message - Free-form advisory text. Newline appended by the\n * utility (do not include trailing `\\n` in `message`).\n *\n * Behaviour:\n *\n * - Writes the formatted line to `process.stderr.write`.\n * - Increments the per-`(scope, key)` counter.\n * - When the counter reaches the configured cap, the formatted line\n * is written normally AND followed by a single\n * `[wildo-soft-warn:<scope>] <key>: suppressed further occurrences\n * (cap reached: <N>)` line. Subsequent calls to the same\n * `(scope, key)` pair are silent.\n * - Dedupe is driven by the serialized `(scope, key)` tuple, so\n * punctuation inside either input does NOT affect correctness.\n */\nexport function emitSoftWarn(scope: string, key: string, message: string): void {\n const cap = readRepeatLimit();\n const dedupeKey = serializeDedupeKey(scope, key);\n const previous = softWarnState.get(dedupeKey) ?? 0;\n\n if (previous >= cap) {\n return;\n }\n\n const next = previous + 1;\n softWarnState.set(dedupeKey, next);\n\n process.stderr.write(`[wildo-soft-warn:${scope}] ${key}: ${message}\\n`);\n\n if (next === cap) {\n process.stderr.write(\n `[wildo-soft-warn:${scope}] ${key}: suppressed further occurrences (cap reached: ${cap}; override via WILDO_SOFT_WARN_LIMIT).\\n`,\n );\n }\n}\n\n/**\n * Test-only reset hook. Clears the process-wide `(scope, key) → count`\n * map so each test starts from a clean slate. Production call sites\n * must NEVER invoke this — the cap is the contract.\n *\n * Named with a leading underscore to match the package-wide convention\n * for \"exported strictly for test usage\" hooks.\n */\nexport function __resetSoftWarnState(): void {\n softWarnState.clear();\n}\n"]}
1
+ {"version":3,"file":"soft-warn.js","sourceRoot":"","sources":["../../../src/_unimplemented/soft-warn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AQ,GAAG,CAAC,CAAC;IAC1B,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAEnC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,KAAK,KAAK,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC;IAExE,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,oBAAoB,KAAK,KAAK,GAAG,kDAAkD,GAAG,0CAA0C,CACjI,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB;IAClC,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC","sourcesContent":["/**\n * @fileoverview Soft-warn utility: a noisy-yet-non-fatal `process.stderr` channel for authoring advisories — a config\n * shape that parses but is almost certainly not what the author meant (a minion with no `resourceAccess`, an enabled\n * FAN_OUT capability no provider serves).\n *\n * It used to sit beside an `@unimplemented` field warner, which reported an authored field that parsed but had no\n * runtime consumer. That warner was removed with its last field, the config `version` (#3496): a field nothing reads is\n * now refused by the strict schemas instead of accepted with a warning. Soft-warns are a different thing and stay —\n * they are not bound to an unread field, but to a shape the runtime will honour in a way the author probably did not\n * intend.\n *\n * Why its shape:\n *\n * - Advisories like \"your minion's `resourceAccess` whitelist is empty — you'll get blocked at every repository\n * call\" are PER-MINION, not per-field. The natural authoring key is a `(scope, key)` pair (e.g.\n * `('minions.marketingScrapper', 'resourceAccess.empty')`), not a dotted field path.\n *\n * - The dev watcher re-parses on every save, so without an in-process repeat-cap a verbose minion ACL would spam the\n * log on every keystroke. The soft-warn utility dedupes and caps PER PROCESS so a noisy advisory does not drown\n * the watcher even under tight save loops.\n *\n * Design choices (all pinned by `__tests__/soft-warn.test.ts`):\n *\n * - **Channel = `process.stderr.write`**. The dev watcher's pretty-printer hijacks `console.warn`; writing to the FD\n * keeps the line raw and grep-friendly, and write order is call order.\n *\n * - **Dedupe = process-wide on `(scope, key)`** with a configurable\n * repeat cap (default 5, env override `WILDO_SOFT_WARN_LIMIT`).\n * After the cap is reached the utility emits ONE final\n * `[wildo-soft-warn:<scope>] <key>: suppressed further occurrences\n * (cap reached: <N>; override via WILDO_SOFT_WARN_LIMIT).` line and\n * falls silent for that pair. The cap is per-process (not per parse\n * call) because the SAME advisory firing on every dev-watcher save\n * is exactly the noise we're trying to suppress.\n *\n * - **Format = single-line with `[wildo-soft-warn:<scope>]` prefix**.\n * The `<scope>` is operator-supplied (e.g. `'minions.marketingScrapper'`,\n * `'workers'`) so a reader can grep `wildo-soft-warn:minions` to\n * isolate per-minion advisories.\n *\n * - **Test reset hook = `__resetSoftWarnState`** — exported strictly\n * for test usage. The state is a module-level `Map` because the\n * \"process-wide cap\" semantic requires it; tests `vi.resetModules()`\n * is too heavy for the cross-test isolation needed in\n * `define-saas-config.authoring.test.ts`. The reset hook is documented as\n * test-only via the leading underscore convention used elsewhere\n * in this package.\n *\n * NOT a replacement for schema validation:\n *\n * - Soft-warns DO NOT prevent parse — they are written AFTER the\n * `WildoSaasConfigSchema.parse()` returns successfully.\n * - The utility is intentionally NOT typed against a known list of\n * `(scope, key)` pairs. The caller owns the taxonomy — adding a\n * closed enum here would force a circular dep with\n * `define-saas-config.ts` and force every new advisory to touch\n * this file.\n *\n * Removal contract:\n *\n * - When an advisory becomes a hard parse error, the corresponding\n * `emitSoftWarn(...)` call sites MUST be deleted in the same commit\n * as the new behaviour. Leaving a stale soft-warn is worse than\n * silence — operators will start ignoring the channel.\n */\n\nconst DEFAULT_REPEAT_LIMIT = 5;\n\n/**\n * Module-level state — process-wide, deliberately so the dev watcher's\n * per-save re-parses do not re-emit the same advisory on every keystroke.\n *\n * Keys are a serialized tuple `[scope, key]`, not a raw concatenated\n * string. This keeps the dedupe channel robust even when either input\n * contains punctuation like `::` — author-authored identifiers must not\n * be able to make advisory emission throw after a successful config\n * parse.\n *\n * The value is the count of actual emitted advisory lines for the pair.\n * Once the count reaches the cap, the cap-reached suppression line is\n * written exactly once.\n */\nconst softWarnState = new Map<string, number>();\n\nfunction readRepeatLimit(): number {\n const raw = process.env.WILDO_SOFT_WARN_LIMIT;\n if (raw === undefined || raw === '') return DEFAULT_REPEAT_LIMIT;\n const normalized = raw.trim();\n if (!/^[1-9]\\d*$/.test(normalized)) return DEFAULT_REPEAT_LIMIT;\n const parsed = Number(normalized);\n if (!Number.isSafeInteger(parsed) || parsed < 1) return DEFAULT_REPEAT_LIMIT;\n return parsed;\n}\n\nfunction serializeDedupeKey(scope: string, key: string): string {\n return JSON.stringify([scope, key]);\n}\n\n/**\n * Emit a single-line soft-warn to `process.stderr`.\n *\n * @param scope - Authoring scope, surfaced verbatim in the prefix\n * (e.g. `'minions.marketingScrapper'`, `'workers'`).\n * @param key - Stable advisory id within the scope\n * (e.g. `'resourceAccess.empty-write'`,\n * `'resourceAccess.unknown-resource'`).\n * @param message - Free-form advisory text. Newline appended by the\n * utility (do not include trailing `\\n` in `message`).\n *\n * Behaviour:\n *\n * - Writes the formatted line to `process.stderr.write`.\n * - Increments the per-`(scope, key)` counter.\n * - When the counter reaches the configured cap, the formatted line\n * is written normally AND followed by a single\n * `[wildo-soft-warn:<scope>] <key>: suppressed further occurrences\n * (cap reached: <N>)` line. Subsequent calls to the same\n * `(scope, key)` pair are silent.\n * - Dedupe is driven by the serialized `(scope, key)` tuple, so\n * punctuation inside either input does NOT affect correctness.\n */\nexport function emitSoftWarn(scope: string, key: string, message: string): void {\n const cap = readRepeatLimit();\n const dedupeKey = serializeDedupeKey(scope, key);\n const previous = softWarnState.get(dedupeKey) ?? 0;\n\n if (previous >= cap) {\n return;\n }\n\n const next = previous + 1;\n softWarnState.set(dedupeKey, next);\n\n process.stderr.write(`[wildo-soft-warn:${scope}] ${key}: ${message}\\n`);\n\n if (next === cap) {\n process.stderr.write(\n `[wildo-soft-warn:${scope}] ${key}: suppressed further occurrences (cap reached: ${cap}; override via WILDO_SOFT_WARN_LIMIT).\\n`,\n );\n }\n}\n\n/**\n * Test-only reset hook. Clears the process-wide `(scope, key) → count`\n * map so each test starts from a clean slate. Production call sites\n * must NEVER invoke this — the cap is the contract.\n *\n * Named with a leading underscore to match the package-wide convention\n * for \"exported strictly for test usage\" hooks.\n */\nexport function __resetSoftWarnState(): void {\n softWarnState.clear();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"anchored-region.d.ts","sourceRoot":"","sources":["../../../../src/blueprint/anchored-region.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,8CAA8C;AAC9C,oBAAY,kBAAkB;IAC5B,mGAAmG;IACnG,IAAI,SAAS;IACb,yCAAyC;IACzC,UAAU,eAAe;IACzB,oDAAoD;IACpD,IAAI,SAAS;CACd;AAED,gDAAgD;AAChD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAM1E;AAkED,sGAAsG;AACtG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,qCAAqC;AACrC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACtD,iGAAiG;IACjG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAqCD,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,WAA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AC;IAC1E,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,qHAAqH;AACrH,MAAM,UAAU,gCAAgC,CAAC,OAAe,EAAE,KAAyB;IACzF,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QAC5G,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,CAAC,YAAY,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/**\n * Anchor SLOTS and blueprint CONTRIBUTIONS in free text (epic #2856, #2862) — the grammar, read and write.\n *\n * A slot is an extension point a base file declares; a blueprint writes its text inside it as a contribution span\n * of its own, so layers stack in order and each one's text stays identifiable:\n *\n * ```markdown\n * <!-- @wildo_anchor:slot:start application.guide -->\n * <!-- @wildo_anchor:contribution:start acme/internal-tool application.guide -->\n * The layer's text.\n * <!-- @wildo_anchor:contribution:end acme/internal-tool application.guide -->\n * <!-- @wildo_anchor:slot:end application.guide -->\n * ```\n *\n * Only free text needs this. A TypeScript base file exposes NAMED DECLARATIONS a blueprint sets instead\n * (`BlueprintDeclarationFile`), which is the preferred and far more common shape: measured on Wonder Procurement\n * (#2860), the agent guide was the one change to a base file that was not the value of a declaration.\n *\n * ## Strict, like the writer it is modelled on\n *\n * The rules are those of `rewriteNginxCspMarkerPairsString` (`project-config/shared/csp-emit.ts`): a marker is a\n * whole line; a nested slot, an end with no start, an unclosed span, a slot declared twice, a contribution outside its\n * slot or naming another slot all REFUSE, because a guess at a damaged boundary writes text into the wrong place. So\n * does any other comment line opening with `@wildo_anchor:` (a third argument, text after the marker): a damaged\n * marker never reads as plain text, while prose that only mentions the family does. In Markdown, lines inside a code fence are text, so a guide can SHOW the markers. A contribution body\n * may not contain a marker line, and every write re-reads its own result.\n *\n * Indentation is kept, every line keeps its own terminator (a file mixing `\\n` and `\\r\\n` stays mixed; added lines\n * take the more common one), and a write that changes nothing returns the input unchanged.\n *\n * The marker family is deliberately not `@wildo_source`: that one is an extraction contract for framework knowledge,\n * and a refactor of what knowledge extracts must never move a place applications are written into.\n */\n\n/** How a file writes a whole-line comment. */\nexport enum AnchorCommentStyle {\n /** Markdown and HTML: `<!-- … -->`. Survives a Handlebars render, which `{{!-- --}}` would not. */\n HTML = 'html',\n /** TypeScript and JavaScript: `// …`. */\n LINE_SLASH = 'line-slash',\n /** YAML, shell, Dockerfile, `.gitignore`: `# …`. */\n HASH = 'hash',\n}\n\n/** The comment style of a file, by its name. */\nexport function anchorCommentStyleForPath(path: string): AnchorCommentStyle {\n const name = path.split('/').pop() ?? path;\n if (/\\.(md|mdx|html?)$/i.test(name)) return AnchorCommentStyle.HTML;\n if (/\\.(ts|tsx|mts|cts|js|jsx|mjs|cjs)$/i.test(name)) return AnchorCommentStyle.LINE_SLASH;\n if (/\\.(ya?ml|sh|toml)$/i.test(name) || name === 'Dockerfile' || name.startsWith('.')) return AnchorCommentStyle.HASH;\n throw new Error(`No anchor comment style is defined for ${path}.`);\n}\n\n/** What a marker line opens or closes. */\nenum AnchorMarkerKind {\n SLOT = 'slot',\n CONTRIBUTION = 'contribution',\n}\n\n/** Which end of a span a marker line is. */\nenum AnchorMarkerEdge {\n START = 'start',\n END = 'end',\n}\n\ninterface MarkerLine {\n readonly kind: AnchorMarkerKind;\n readonly edge: AnchorMarkerEdge;\n /** Slot: `[slotId]`. Contribution: `[blueprintId, slotId]`. */\n readonly args: readonly string[];\n readonly indent: string;\n}\n\nconst MARKER_BODY = '@wildo_anchor:(slot|contribution):(start|end)\\\\s+(\\\\S+(?:\\\\s+\\\\S+)?)';\n/** The marker family, as text. A contribution body may not contain it at all. */\nconst MARKER_FAMILY = '@wildo_anchor:';\n/**\n * A line that OPENS a comment with the marker family — what a marker looks like. One that is not a well-formed marker\n * refuses rather than reading as text. Prose that merely MENTIONS the family (\"the `@wildo_anchor:slot` markers\") is\n * text, so a guide can talk about its own slots.\n */\nconst MARKER_SHAPED_LINES: Readonly<Record<AnchorCommentStyle, RegExp>> = {\n [AnchorCommentStyle.HTML]: /^\\s*<!--\\s*@wildo_anchor:/,\n [AnchorCommentStyle.LINE_SLASH]: /^\\s*\\/\\/\\s*@wildo_anchor:/,\n [AnchorCommentStyle.HASH]: /^\\s*#\\s*@wildo_anchor:/,\n};\n/** A Markdown code fence: markers shown inside one are an example, not a slot. */\nconst CODE_FENCE_PATTERN = /^\\s*(```|~~~)/;\nconst MARKER_PATTERNS: Readonly<Record<AnchorCommentStyle, RegExp>> = {\n [AnchorCommentStyle.HTML]: new RegExp(`^(\\\\s*)<!--\\\\s*${MARKER_BODY}\\\\s*-->\\\\s*$`),\n [AnchorCommentStyle.LINE_SLASH]: new RegExp(`^(\\\\s*)//\\\\s*${MARKER_BODY}\\\\s*$`),\n [AnchorCommentStyle.HASH]: new RegExp(`^(\\\\s*)#\\\\s*${MARKER_BODY}\\\\s*$`),\n};\n\nfunction parseMarker(line: string, style: AnchorCommentStyle): MarkerLine | null {\n const match = MARKER_PATTERNS[style].exec(line);\n if (match === null) return null;\n return {\n kind: match[2] as AnchorMarkerKind,\n edge: match[3] as AnchorMarkerEdge,\n args: (match[4] ?? '').split(/\\s+/),\n indent: match[1] ?? '',\n };\n}\n\nfunction renderMarker(style: AnchorCommentStyle, indent: string, kind: AnchorMarkerKind, edge: AnchorMarkerEdge, args: readonly string[]): string {\n const body = `@wildo_anchor:${kind}:${edge} ${args.join(' ')}`;\n switch (style) {\n case AnchorCommentStyle.HTML:\n return `${indent}<!-- ${body} -->`;\n case AnchorCommentStyle.LINE_SLASH:\n return `${indent}// ${body}`;\n case AnchorCommentStyle.HASH:\n return `${indent}# ${body}`;\n }\n}\n\n/** One contribution span inside a slot. Line numbers are zero-based indexes into the file's lines. */\nexport interface AnchorContribution {\n readonly blueprintId: string;\n readonly startLine: number;\n readonly endLine: number;\n /** The span's text, markers excluded. */\n readonly body: string;\n}\n\n/** One slot as the file holds it. */\nexport interface AnchorSlot {\n readonly id: string;\n readonly startLine: number;\n readonly endLine: number;\n readonly indent: string;\n readonly contributions: readonly AnchorContribution[];\n /** The slot's text OUTSIDE every contribution span — what the application wrote there itself. */\n readonly ownText: string;\n}\n\n/**\n * The file's lines, each line's own terminator (the last one's is `''`), and the terminator new lines get: the one\n * the file uses most. Keeping each terminator is what lets a write leave every line it did not add byte-identical,\n * even in a file that mixes `\\n` and `\\r\\n`.\n */\nfunction splitLines(content: string): { lines: string[]; terminators: string[]; eol: string } {\n const lines: string[] = [];\n const terminators: string[] = [];\n const pattern = /\\r?\\n/g;\n let start = 0;\n for (const match of content.matchAll(pattern)) {\n lines.push(content.slice(start, match.index));\n terminators.push(match[0]);\n start = (match.index ?? 0) + match[0].length;\n }\n lines.push(content.slice(start));\n terminators.push('');\n const crlf = terminators.filter((terminator) => terminator === '\\r\\n').length;\n const lf = terminators.filter((terminator) => terminator === '\\n').length;\n return { lines, terminators, eol: crlf > lf ? '\\r\\n' : '\\n' };\n}\n\nfunction joinLines(lines: readonly string[], terminators: readonly string[]): string {\n return lines.map((line, index) => `${line}${terminators[index] ?? ''}`).join('');\n}\n\n/** Drop blank lines at both ends of a text block. */\nfunction trimBlankLines(lines: readonly string[]): string {\n let start = 0;\n let end = lines.length;\n while (start < end && lines[start]?.trim() === '') start += 1;\n while (end > start && lines[end - 1]?.trim() === '') end -= 1;\n return lines.slice(start, end).join('\\n');\n}\n\n/** Every slot of a file, by id. Refuses a damaged structure rather than reading around it. */\nexport function readAnchorSlots(content: string, style: AnchorCommentStyle): ReadonlyMap<string, AnchorSlot> {\n const { lines } = splitLines(content);\n const slots = new Map<string, AnchorSlot>();\n let open: { id: string; startLine: number; indent: string; contributions: AnchorContribution[]; own: string[] } | null = null;\n let openContribution: { blueprintId: string; startLine: number; body: string[] } | null = null;\n let insideFence = false;\n lines.forEach((line, index) => {\n const where = `line ${index + 1}`;\n if (style === AnchorCommentStyle.HTML && CODE_FENCE_PATTERN.test(line)) insideFence = !insideFence;\n const marker = insideFence ? null : parseMarker(line, style);\n if (marker === null && !insideFence && MARKER_SHAPED_LINES[style].test(line)) {\n throw new Error(`The ${MARKER_FAMILY} line at ${where} is not a well-formed marker (a slot names one id, a contribution a blueprint and a slot, and the marker is the whole line).`);\n }\n if (marker === null) {\n if (openContribution !== null) openContribution.body.push(line);\n else if (open !== null) open.own.push(line);\n return;\n }\n if (marker.kind === AnchorMarkerKind.SLOT) {\n const [id] = marker.args;\n if (marker.args.length !== 1 || id === undefined) throw new Error(`Anchor slot marker at ${where} must name exactly one slot.`);\n if (marker.edge === AnchorMarkerEdge.START) {\n if (open !== null) throw new Error(`Anchor slot '${id}' at ${where} opens inside slot '${open.id}': slots do not nest.`);\n if (slots.has(id)) throw new Error(`Anchor slot '${id}' is declared twice (again at ${where}).`);\n open = { id, startLine: index, indent: marker.indent, contributions: [], own: [] };\n return;\n }\n if (open === null || open.id !== id) throw new Error(`Anchor slot end '${id}' at ${where} closes no open slot of that name.`);\n if (openContribution !== null) throw new Error(`Anchor slot '${id}' closes at ${where} inside an unclosed contribution of '${openContribution.blueprintId}'.`);\n slots.set(id, { id, startLine: open.startLine, endLine: index, indent: open.indent, contributions: open.contributions, ownText: trimBlankLines(open.own) });\n open = null;\n return;\n }\n const [blueprintId, slotId] = marker.args;\n if (marker.args.length !== 2 || blueprintId === undefined || slotId === undefined) {\n throw new Error(`Anchor contribution marker at ${where} must name a blueprint and a slot.`);\n }\n if (open === null || open.id !== slotId) throw new Error(`Contribution of '${blueprintId}' at ${where} names slot '${slotId}' but sits outside it.`);\n if (marker.edge === AnchorMarkerEdge.START) {\n if (openContribution !== null) throw new Error(`Contribution of '${blueprintId}' at ${where} opens inside the contribution of '${openContribution.blueprintId}'.`);\n if (open.contributions.some((contribution) => contribution.blueprintId === blueprintId)) {\n throw new Error(`Blueprint '${blueprintId}' contributes to slot '${slotId}' twice (again at ${where}).`);\n }\n openContribution = { blueprintId, startLine: index, body: [] };\n return;\n }\n if (openContribution === null || openContribution.blueprintId !== blueprintId) {\n throw new Error(`Contribution end of '${blueprintId}' at ${where} closes no open contribution of that blueprint.`);\n }\n open.contributions.push({ blueprintId, startLine: openContribution.startLine, endLine: index, body: openContribution.body.join('\\n') });\n openContribution = null;\n });\n if (open !== null) throw new Error(`Anchor slot '${(open as { id: string }).id}' is never closed.`);\n return slots;\n}\n\n/**\n * Write `body` as `blueprintId`'s contribution to `slotId`: replace its existing span, or add one just before the\n * slot's end marker (after every earlier layer's). Refuses a slot the file does not declare. Returns the content\n * unchanged when the span already holds exactly this body.\n */\nexport function writeAnchorContribution(\n content: string,\n style: AnchorCommentStyle,\n input: { readonly slotId: string; readonly blueprintId: string; readonly body: string },\n): string {\n const slot = readAnchorSlots(content, style).get(input.slotId);\n if (slot === undefined) throw new Error(`No anchor slot '${input.slotId}' is declared in this file.`);\n const { lines, terminators, eol } = splitLines(content);\n const bodyLines = input.body === '' ? [] : input.body.replace(/\\r?\\n$/, '').split(/\\r?\\n/);\n if (bodyLines.some((line) => line.includes(MARKER_FAMILY))) {\n throw new Error(`The contribution of '${input.blueprintId}' to slot '${input.slotId}' contains a ${MARKER_FAMILY} line, which would break the slot it is written into.`);\n }\n const span = [\n renderMarker(style, slot.indent, AnchorMarkerKind.CONTRIBUTION, AnchorMarkerEdge.START, [input.blueprintId, input.slotId]),\n ...bodyLines,\n renderMarker(style, slot.indent, AnchorMarkerKind.CONTRIBUTION, AnchorMarkerEdge.END, [input.blueprintId, input.slotId]),\n ];\n const spanTerminators = span.map(() => eol);\n const existing = slot.contributions.find((contribution) => contribution.blueprintId === input.blueprintId);\n const [from, to] = existing === undefined ? [slot.endLine, slot.endLine] : [existing.startLine, existing.endLine + 1];\n const written = joinLines(\n [...lines.slice(0, from), ...span, ...lines.slice(to)],\n [...terminators.slice(0, from), ...spanTerminators, ...terminators.slice(to)],\n );\n if (written === content) return content;\n // Re-read what is about to be written: a write must never leave a file the next read refuses.\n readAnchorSlots(written, style);\n return written;\n}\n\n/**\n * A slot's whole text with every contribution marker removed and blank lines trimmed at both ends: what a reader\n * sees there, whoever wrote it. Two files whose slots read the same this way say the same thing, which is how an\n * export compares the slot it reproduces with the one the defining application holds.\n */\nexport function readableAnchorSlotText(content: string, style: AnchorCommentStyle, slotId: string): string | undefined {\n const slot = readAnchorSlots(content, style).get(slotId);\n if (slot === undefined) return undefined;\n const { lines } = splitLines(content);\n return trimBlankLines(lines.slice(slot.startLine + 1, slot.endLine).filter((line) => {\n const marker = parseMarker(line, style);\n return marker === null || marker.kind !== AnchorMarkerKind.CONTRIBUTION;\n }));\n}\n\n/** The file's content with every contribution marker line removed — for comparing files that differ only by them. */\nexport function withoutAnchorContributionMarkers(content: string, style: AnchorCommentStyle): string {\n const { lines, terminators } = splitLines(content);\n const kept = lines.map((line, index) => ({ line, terminator: terminators[index] ?? '' })).filter(({ line }) => {\n const marker = parseMarker(line, style);\n return marker === null || marker.kind !== AnchorMarkerKind.CONTRIBUTION;\n });\n return joinLines(kept.map(({ line }) => line), kept.map(({ terminator }) => terminator));\n}\n"]}
1
+ {"version":3,"file":"anchored-region.js","sourceRoot":"","sources":["../../../src/blueprint/anchored-region.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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AAO,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAClF,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,CAAC,YAAY,CAAC;IAC1E,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AAED,qHAAqH;AACrH,MAAM,UAAU,gCAAgC,CAAC,OAAe,EAAE,KAAyB;IACzF,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QAC5G,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxC,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,CAAC,YAAY,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/**\n * Anchor SLOTS and blueprint CONTRIBUTIONS in free text (epic #2856, #2862) — the grammar, read and write.\n *\n * A slot is an extension point a base file declares; a blueprint writes its text inside it as a contribution span\n * of its own, so layers stack in order and each one's text stays identifiable:\n *\n * ```markdown\n * <!-- @wildo_anchor:slot:start application.guide -->\n * <!-- @wildo_anchor:contribution:start acme/internal-tool application.guide -->\n * The layer's text.\n * <!-- @wildo_anchor:contribution:end acme/internal-tool application.guide -->\n * <!-- @wildo_anchor:slot:end application.guide -->\n * ```\n *\n * Only free text needs this. A TypeScript base file exposes NAMED DECLARATIONS a blueprint sets instead\n * (`BlueprintDeclarationFile`), which is the preferred and far more common shape: measured on Wonder Procurement\n * (#2860), the agent guide was the one change to a base file that was not the value of a declaration.\n *\n * ## Strict, like the writer it is modelled on\n *\n * The rules are those of `rewriteNginxCspMarkerPairsString` (`project-config/shared/csp-emit.ts`): a marker is a\n * whole line; a nested slot, an end with no start, an unclosed span, a slot declared twice, a contribution outside its\n * slot or naming another slot all REFUSE, because a guess at a damaged boundary writes text into the wrong place. So\n * does any other comment line opening with `@wildo_anchor:` (a third argument, text after the marker): a damaged\n * marker never reads as plain text, while prose that only mentions the family does. In Markdown, lines inside a code fence are text, so a guide can SHOW the markers. A contribution body\n * may not contain a marker line, and every write re-reads its own result.\n *\n * Indentation is kept, every line keeps its own terminator (a file mixing `\\n` and `\\r\\n` stays mixed; added lines\n * take the more common one), and a write that changes nothing returns the input unchanged.\n *\n * The marker family is deliberately not `@wildo_source`: that one is an extraction contract for framework knowledge,\n * and a refactor of what knowledge extracts must never move a place applications are written into.\n */\n\n/** How a file writes a whole-line comment. */\nexport enum AnchorCommentStyle {\n /** Markdown and HTML: `<!-- … -->`. Survives a Handlebars render, which `{{!-- --}}` would not. */\n HTML = 'html',\n /** TypeScript and JavaScript: `// …`. */\n LINE_SLASH = 'line-slash',\n /** YAML, shell, Dockerfile, `.gitignore`: `# …`. */\n HASH = 'hash',\n}\n\n/** The comment style of a file, by its name. */\nexport function anchorCommentStyleForPath(path: string): AnchorCommentStyle {\n const name = path.split('/').pop() ?? path;\n if (/\\.(md|mdx|html?)$/i.test(name)) return AnchorCommentStyle.HTML;\n if (/\\.(ts|tsx|mts|cts|js|jsx|mjs|cjs)$/i.test(name)) return AnchorCommentStyle.LINE_SLASH;\n if (/\\.(ya?ml|sh|toml)$/i.test(name) || name === 'Dockerfile' || name.startsWith('.')) return AnchorCommentStyle.HASH;\n throw new Error(`No anchor comment style is defined for ${path}.`);\n}\n\n/** What a marker line opens or closes. */\nenum AnchorMarkerKind {\n SLOT = 'slot',\n CONTRIBUTION = 'contribution',\n}\n\n/** Which end of a span a marker line is. */\nenum AnchorMarkerEdge {\n START = 'start',\n END = 'end',\n}\n\ninterface MarkerLine {\n readonly kind: AnchorMarkerKind;\n readonly edge: AnchorMarkerEdge;\n /** Slot: `[slotId]`. Contribution: `[blueprintId, slotId]`. */\n readonly args: readonly string[];\n readonly indent: string;\n}\n\nconst MARKER_BODY = '@wildo_anchor:(slot|contribution):(start|end)\\\\s+(\\\\S+(?:\\\\s+\\\\S+)?)';\n/** The marker family, as text. A contribution body may not contain it at all. */\nconst MARKER_FAMILY = '@wildo_anchor:';\n/**\n * A line that OPENS a comment with the marker family — what a marker looks like. One that is not a well-formed marker\n * refuses rather than reading as text. Prose that merely MENTIONS the family (\"the `@wildo_anchor:slot` markers\") is\n * text, so a guide can talk about its own slots.\n */\nconst MARKER_SHAPED_LINES: Readonly<Record<AnchorCommentStyle, RegExp>> = {\n [AnchorCommentStyle.HTML]: /^\\s*<!--\\s*@wildo_anchor:/,\n [AnchorCommentStyle.LINE_SLASH]: /^\\s*\\/\\/\\s*@wildo_anchor:/,\n [AnchorCommentStyle.HASH]: /^\\s*#\\s*@wildo_anchor:/,\n};\n/** A Markdown code fence: markers shown inside one are an example, not a slot. */\nconst CODE_FENCE_PATTERN = /^\\s*(```|~~~)/;\nconst MARKER_PATTERNS: Readonly<Record<AnchorCommentStyle, RegExp>> = {\n [AnchorCommentStyle.HTML]: new RegExp(`^(\\\\s*)<!--\\\\s*${MARKER_BODY}\\\\s*-->\\\\s*$`),\n [AnchorCommentStyle.LINE_SLASH]: new RegExp(`^(\\\\s*)//\\\\s*${MARKER_BODY}\\\\s*$`),\n [AnchorCommentStyle.HASH]: new RegExp(`^(\\\\s*)#\\\\s*${MARKER_BODY}\\\\s*$`),\n};\n\nfunction parseMarker(line: string, style: AnchorCommentStyle): MarkerLine | null {\n const match = MARKER_PATTERNS[style].exec(line);\n if (match === null) return null;\n return {\n kind: match[2] as AnchorMarkerKind,\n edge: match[3] as AnchorMarkerEdge,\n args: (match[4] ?? '').split(/\\s+/),\n indent: match[1] ?? '',\n };\n}\n\nfunction renderMarker(style: AnchorCommentStyle, indent: string, kind: AnchorMarkerKind, edge: AnchorMarkerEdge, args: readonly string[]): string {\n const body = `@wildo_anchor:${kind}:${edge} ${args.join(' ')}`;\n switch (style) {\n case AnchorCommentStyle.HTML:\n return `${indent}<!-- ${body} -->`;\n case AnchorCommentStyle.LINE_SLASH:\n return `${indent}// ${body}`;\n case AnchorCommentStyle.HASH:\n return `${indent}# ${body}`;\n }\n}\n\n/** One contribution span inside a slot. Line numbers are zero-based indexes into the file's lines. */\nexport interface AnchorContribution {\n readonly blueprintId: string;\n readonly startLine: number;\n readonly endLine: number;\n /** The span's text, markers excluded. */\n readonly body: string;\n}\n\n/** One slot as the file holds it. */\nexport interface AnchorSlot {\n readonly id: string;\n readonly startLine: number;\n readonly endLine: number;\n readonly indent: string;\n readonly contributions: readonly AnchorContribution[];\n /** The slot's text OUTSIDE every contribution span — what the application wrote there itself. */\n readonly ownText: string;\n}\n\n/**\n * The file's lines, each line's own terminator (the last one's is `''`), and the terminator new lines get: the one\n * the file uses most. Keeping each terminator is what lets a write leave every line it did not add byte-identical,\n * even in a file that mixes `\\n` and `\\r\\n`.\n */\nfunction splitLines(content: string): { lines: string[]; terminators: string[]; eol: string } {\n const lines: string[] = [];\n const terminators: string[] = [];\n const pattern = /\\r?\\n/g;\n let start = 0;\n for (const match of content.matchAll(pattern)) {\n lines.push(content.slice(start, match.index));\n terminators.push(match[0]);\n start = (match.index ?? 0) + match[0].length;\n }\n lines.push(content.slice(start));\n terminators.push('');\n const crlf = terminators.filter((terminator) => terminator === '\\r\\n').length;\n const lf = terminators.filter((terminator) => terminator === '\\n').length;\n return { lines, terminators, eol: crlf > lf ? '\\r\\n' : '\\n' };\n}\n\nfunction joinLines(lines: readonly string[], terminators: readonly string[]): string {\n return lines.map((line, index) => `${line}${terminators[index] ?? ''}`).join('');\n}\n\n/** Drop blank lines at both ends of a text block. */\nfunction trimBlankLines(lines: readonly string[]): string {\n let start = 0;\n let end = lines.length;\n while (start < end && lines[start]?.trim() === '') start += 1;\n while (end > start && lines[end - 1]?.trim() === '') end -= 1;\n return lines.slice(start, end).join('\\n');\n}\n\n/** Every slot of a file, by id. Refuses a damaged structure rather than reading around it. */\nexport function readAnchorSlots(content: string, style: AnchorCommentStyle): ReadonlyMap<string, AnchorSlot> {\n const { lines } = splitLines(content);\n const slots = new Map<string, AnchorSlot>();\n let open: { id: string; startLine: number; indent: string; contributions: AnchorContribution[]; own: string[] } | null = null;\n let openContribution: { blueprintId: string; startLine: number; body: string[] } | null = null;\n let insideFence = false;\n lines.forEach((line, index) => {\n const where = `line ${index + 1}`;\n if (style === AnchorCommentStyle.HTML && CODE_FENCE_PATTERN.test(line)) insideFence = !insideFence;\n const marker = insideFence ? null : parseMarker(line, style);\n if (marker === null && !insideFence && MARKER_SHAPED_LINES[style].test(line)) {\n throw new Error(`The ${MARKER_FAMILY} line at ${where} is not a well-formed marker (a slot names one id, a contribution a blueprint and a slot, and the marker is the whole line).`);\n }\n if (marker === null) {\n if (openContribution !== null) openContribution.body.push(line);\n else if (open !== null) open.own.push(line);\n return;\n }\n if (marker.kind === AnchorMarkerKind.SLOT) {\n const [id] = marker.args;\n if (marker.args.length !== 1 || id === undefined) throw new Error(`Anchor slot marker at ${where} must name exactly one slot.`);\n if (marker.edge === AnchorMarkerEdge.START) {\n if (open !== null) throw new Error(`Anchor slot '${id}' at ${where} opens inside slot '${open.id}': slots do not nest.`);\n if (slots.has(id)) throw new Error(`Anchor slot '${id}' is declared twice (again at ${where}).`);\n open = { id, startLine: index, indent: marker.indent, contributions: [], own: [] };\n return;\n }\n if (open === null || open.id !== id) throw new Error(`Anchor slot end '${id}' at ${where} closes no open slot of that name.`);\n if (openContribution !== null) throw new Error(`Anchor slot '${id}' closes at ${where} inside an unclosed contribution of '${openContribution.blueprintId}'.`);\n slots.set(id, { id, startLine: open.startLine, endLine: index, indent: open.indent, contributions: open.contributions, ownText: trimBlankLines(open.own) });\n open = null;\n return;\n }\n const [blueprintId, slotId] = marker.args;\n if (marker.args.length !== 2 || blueprintId === undefined || slotId === undefined) {\n throw new Error(`Anchor contribution marker at ${where} must name a blueprint and a slot.`);\n }\n if (open === null || open.id !== slotId) throw new Error(`Contribution of '${blueprintId}' at ${where} names slot '${slotId}' but sits outside it.`);\n if (marker.edge === AnchorMarkerEdge.START) {\n if (openContribution !== null) throw new Error(`Contribution of '${blueprintId}' at ${where} opens inside the contribution of '${openContribution.blueprintId}'.`);\n if (open.contributions.some((contribution) => contribution.blueprintId === blueprintId)) {\n throw new Error(`Blueprint '${blueprintId}' contributes to slot '${slotId}' twice (again at ${where}).`);\n }\n openContribution = { blueprintId, startLine: index, body: [] };\n return;\n }\n if (openContribution === null || openContribution.blueprintId !== blueprintId) {\n throw new Error(`Contribution end of '${blueprintId}' at ${where} closes no open contribution of that blueprint.`);\n }\n open.contributions.push({ blueprintId, startLine: openContribution.startLine, endLine: index, body: openContribution.body.join('\\n') });\n openContribution = null;\n });\n if (open !== null) throw new Error(`Anchor slot '${(open as { id: string }).id}' is never closed.`);\n return slots;\n}\n\n/**\n * Write `body` as `blueprintId`'s contribution to `slotId`: replace its existing span, or add one just before the\n * slot's end marker (after every earlier layer's). Refuses a slot the file does not declare. Returns the content\n * unchanged when the span already holds exactly this body.\n */\nexport function writeAnchorContribution(\n content: string,\n style: AnchorCommentStyle,\n input: { readonly slotId: string; readonly blueprintId: string; readonly body: string },\n): string {\n const slot = readAnchorSlots(content, style).get(input.slotId);\n if (slot === undefined) throw new Error(`No anchor slot '${input.slotId}' is declared in this file.`);\n const { lines, terminators, eol } = splitLines(content);\n const bodyLines = input.body === '' ? [] : input.body.replace(/\\r?\\n$/, '').split(/\\r?\\n/);\n if (bodyLines.some((line) => line.includes(MARKER_FAMILY))) {\n throw new Error(`The contribution of '${input.blueprintId}' to slot '${input.slotId}' contains a ${MARKER_FAMILY} line, which would break the slot it is written into.`);\n }\n const span = [\n renderMarker(style, slot.indent, AnchorMarkerKind.CONTRIBUTION, AnchorMarkerEdge.START, [input.blueprintId, input.slotId]),\n ...bodyLines,\n renderMarker(style, slot.indent, AnchorMarkerKind.CONTRIBUTION, AnchorMarkerEdge.END, [input.blueprintId, input.slotId]),\n ];\n const spanTerminators = span.map(() => eol);\n const existing = slot.contributions.find((contribution) => contribution.blueprintId === input.blueprintId);\n const [from, to] = existing === undefined ? [slot.endLine, slot.endLine] : [existing.startLine, existing.endLine + 1];\n const written = joinLines(\n [...lines.slice(0, from), ...span, ...lines.slice(to)],\n [...terminators.slice(0, from), ...spanTerminators, ...terminators.slice(to)],\n );\n if (written === content) return content;\n // Re-read what is about to be written: a write must never leave a file the next read refuses.\n readAnchorSlots(written, style);\n return written;\n}\n\n/**\n * A slot's whole text with every contribution marker removed and blank lines trimmed at both ends: what a reader\n * sees there, whoever wrote it. Two files whose slots read the same this way say the same thing, which is how an\n * export compares the slot it reproduces with the one the defining application holds.\n */\nexport function readableAnchorSlotText(content: string, style: AnchorCommentStyle, slotId: string): string | undefined {\n const slot = readAnchorSlots(content, style).get(slotId);\n if (slot === undefined) return undefined;\n const { lines } = splitLines(content);\n return trimBlankLines(lines.slice(slot.startLine + 1, slot.endLine).filter((line) => {\n const marker = parseMarker(line, style);\n return marker === null || marker.kind !== AnchorMarkerKind.CONTRIBUTION;\n }));\n}\n\n/** The file's content with every contribution marker line removed — for comparing files that differ only by them. */\nexport function withoutAnchorContributionMarkers(content: string, style: AnchorCommentStyle): string {\n const { lines, terminators } = splitLines(content);\n const kept = lines.map((line, index) => ({ line, terminator: terminators[index] ?? '' })).filter(({ line }) => {\n const marker = parseMarker(line, style);\n return marker === null || marker.kind !== AnchorMarkerKind.CONTRIBUTION;\n });\n return joinLines(kept.map(({ line }) => line), kept.map(({ terminator }) => terminator));\n}\n"]}