@ykdz/template 0.1.0-experimental.1 → 0.2.0

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 (1690) hide show
  1. package/dist/application.d.ts +18 -48
  2. package/dist/application.js +164 -111
  3. package/dist/input-schemas.d.ts +21 -44
  4. package/dist/input-schemas.js +46 -43
  5. package/dist/input-validation.js +3 -30
  6. package/dist/main.js +116 -218
  7. package/dist/preset-catalog.d.ts +410 -29
  8. package/dist/preset-catalog.js +4 -30
  9. package/dist/result-schemas.d.ts +146 -250
  10. package/dist/result-schemas.js +57 -59
  11. package/node_modules/@ykdz/default-content-authoring/dist/contracts.d.ts +240 -0
  12. package/node_modules/@ykdz/default-content-authoring/dist/environment-needs.d.ts +16 -0
  13. package/node_modules/@ykdz/default-content-authoring/dist/preset-root-contribution.d.ts +36 -0
  14. package/node_modules/@ykdz/default-content-authoring/dist/preset-root-contribution.js +1 -0
  15. package/node_modules/@ykdz/default-content-authoring/dist/reference-package.d.ts +65 -0
  16. package/node_modules/@ykdz/default-content-authoring/dist/reference-package.js +742 -0
  17. package/node_modules/@ykdz/default-content-authoring/package.json +59 -0
  18. package/node_modules/@ykdz/preset-rust-bin/native/package.json +2 -0
  19. package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.d.ts +2 -40
  20. package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.d.ts.map +1 -1
  21. package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.js +3 -2
  22. package/node_modules/@ykdz/preset-ts-cli/native/package.json +4 -0
  23. package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.d.ts +2 -15
  24. package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.d.ts.map +1 -1
  25. package/node_modules/@ykdz/preset-ts-lib/native/package.json +3 -0
  26. package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.d.ts +2 -15
  27. package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.d.ts.map +1 -1
  28. package/node_modules/@ykdz/preset-vike-app/native/package.json +3 -0
  29. package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts +40 -23
  30. package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts.map +1 -1
  31. package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.js +19 -36
  32. package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts +54 -17
  33. package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts.map +1 -1
  34. package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.js +393 -207
  35. package/node_modules/@ykdz/preset-vike-app/package.json +2 -1
  36. package/node_modules/@ykdz/preset-vue-app/native/package.json +2 -0
  37. package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.d.ts +2 -15
  38. package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.d.ts.map +1 -1
  39. package/node_modules/@ykdz/preset-vue-hono-app/native/package.json +4 -0
  40. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts +49 -23
  41. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts.map +1 -1
  42. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.js +31 -102
  43. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/joint-e2e.d.ts +42 -0
  44. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/joint-e2e.d.ts.map +1 -0
  45. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/joint-e2e.js +173 -0
  46. package/node_modules/@ykdz/reference-hono-api/native/package.json +3 -1
  47. package/node_modules/@ykdz/reference-hono-api/native/template-dist/definition.d.ts +1 -1
  48. package/node_modules/@ykdz/reference-hono-api/native/template-dist/definition.js +51 -18
  49. package/node_modules/@ykdz/reference-hono-api/native/tsconfig.json +1 -1
  50. package/node_modules/@ykdz/reference-hono-api/native/turbo.json +2 -2
  51. package/node_modules/@ykdz/reference-hono-api/package.json +3 -2
  52. package/node_modules/@ykdz/reference-npm-publication/native/README.md +14 -6
  53. package/node_modules/@ykdz/reference-npm-publication/native/package.json +2 -2
  54. package/node_modules/@ykdz/reference-npm-publication/native/resources/release.yml +4 -1
  55. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.d.ts +8 -4
  56. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.d.ts.map +1 -1
  57. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.js +68 -21
  58. package/node_modules/@ykdz/reference-npm-publication/package.json +1 -2
  59. package/node_modules/@ykdz/reference-rust-bin/native/package.json +13 -3
  60. package/node_modules/@ykdz/reference-rust-bin/native/resources/gitignore +5 -0
  61. package/node_modules/@ykdz/reference-rust-bin/native/resources/npmignore +1 -0
  62. package/node_modules/@ykdz/reference-rust-bin/native/template/rust-toolchain.toml +1 -1
  63. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.d.ts +86 -12
  64. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.d.ts.map +1 -1
  65. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.js +227 -106
  66. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/environment.d.ts +6 -0
  67. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/environment.d.ts.map +1 -0
  68. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/environment.js +44 -0
  69. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-package-projection.d.ts +19 -0
  70. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-package-projection.d.ts.map +1 -0
  71. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-package-projection.js +65 -0
  72. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-toolchain-projection.d.ts +15 -0
  73. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-toolchain-projection.d.ts.map +1 -0
  74. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-toolchain-projection.js +44 -0
  75. package/node_modules/@ykdz/reference-rust-bin/native/turbo.json +3 -1
  76. package/node_modules/@ykdz/reference-rust-bin/package.json +6 -1
  77. package/node_modules/@ykdz/reference-tooling-config/native/package.json +4 -5
  78. package/node_modules/@ykdz/reference-tooling-config/native/template/workspace/oxfmt.config.ts +1 -0
  79. package/node_modules/@ykdz/reference-tooling-config/native/template/workspace/oxlint.config.ts +4 -0
  80. package/node_modules/@ykdz/reference-tooling-config/native/template-dist/definition.d.ts +1 -27
  81. package/node_modules/@ykdz/reference-tooling-config/native/template-dist/definition.js +53 -11
  82. package/node_modules/@ykdz/reference-tooling-config/native/tsconfig.json +1 -1
  83. package/node_modules/@ykdz/reference-tooling-config/native/turbo.json +5 -4
  84. package/node_modules/@ykdz/reference-tooling-config/package.json +5 -1
  85. package/node_modules/@ykdz/reference-ts-cli/native/package.json +8 -8
  86. package/node_modules/@ykdz/reference-ts-cli/native/resources/gitignore +5 -0
  87. package/node_modules/@ykdz/reference-ts-cli/native/resources/npmignore +1 -0
  88. package/node_modules/@ykdz/reference-ts-cli/native/src/cli-command-identity.ts +18 -0
  89. package/node_modules/@ykdz/reference-ts-cli/native/src/cli.ts +1 -1
  90. package/node_modules/@ykdz/reference-ts-cli/native/src/main.ts +9 -19
  91. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.d.ts +8 -6
  92. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.d.ts.map +1 -1
  93. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.js +119 -59
  94. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.d.ts +7 -0
  95. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.d.ts.map +1 -0
  96. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.js +28 -0
  97. package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/journeys/lookup.journey.ts +1 -1
  98. package/node_modules/@ykdz/reference-ts-cli/native/test/integration/command.test.ts +1 -1
  99. package/node_modules/@ykdz/reference-ts-cli/native/test/unit/cli-command-identity.test.ts +7 -55
  100. package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.build.json +1 -1
  101. package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.node.json +8 -2
  102. package/node_modules/@ykdz/reference-ts-cli/native/turbo.json +11 -3
  103. package/node_modules/@ykdz/reference-ts-cli/package.json +3 -2
  104. package/node_modules/@ykdz/reference-ts-lib/native/package.json +4 -2
  105. package/node_modules/@ykdz/reference-ts-lib/native/resources/gitignore +3 -0
  106. package/node_modules/@ykdz/reference-ts-lib/native/resources/npmignore +1 -0
  107. package/node_modules/@ykdz/reference-ts-lib/native/src/index.ts +1 -3
  108. package/node_modules/@ykdz/reference-ts-lib/native/src/name-schema.ts +2 -2
  109. package/node_modules/@ykdz/reference-ts-lib/native/template-dist/definition.d.ts +1 -1
  110. package/node_modules/@ykdz/reference-ts-lib/native/template-dist/definition.js +70 -26
  111. package/node_modules/@ykdz/reference-ts-lib/native/tsconfig.node.json +1 -1
  112. package/node_modules/@ykdz/reference-ts-lib/native/turbo.json +3 -1
  113. package/node_modules/@ykdz/reference-ts-lib/package.json +3 -2
  114. package/node_modules/@ykdz/reference-vike-db/native/package.json +3 -1
  115. package/node_modules/@ykdz/reference-vike-db/native/template-dist/definition.d.ts +1 -1
  116. package/node_modules/@ykdz/reference-vike-db/native/template-dist/definition.js +70 -23
  117. package/node_modules/@ykdz/reference-vike-db/native/tsconfig.node.json +1 -1
  118. package/node_modules/@ykdz/reference-vike-db/native/turbo.json +3 -3
  119. package/node_modules/@ykdz/reference-vike-db/package.json +4 -2
  120. package/node_modules/@ykdz/reference-vike-migrations/native/package.json +3 -1
  121. package/node_modules/@ykdz/reference-vike-migrations/native/template-dist/definition.d.ts +2 -1
  122. package/node_modules/@ykdz/reference-vike-migrations/native/template-dist/definition.js +78 -23
  123. package/node_modules/@ykdz/reference-vike-migrations/native/tsconfig.json +1 -1
  124. package/node_modules/@ykdz/reference-vike-migrations/native/turbo.json +3 -3
  125. package/node_modules/@ykdz/reference-vike-migrations/package.json +4 -2
  126. package/node_modules/@ykdz/reference-vike-web/native/package.json +3 -1
  127. package/node_modules/@ykdz/reference-vike-web/native/template-dist/definition.d.ts +2 -1
  128. package/node_modules/@ykdz/reference-vike-web/native/template-dist/definition.js +137 -38
  129. package/node_modules/@ykdz/reference-vike-web/native/tsconfig.app.json +1 -1
  130. package/node_modules/@ykdz/reference-vike-web/native/tsconfig.node.json +1 -1
  131. package/node_modules/@ykdz/reference-vike-web/native/turbo.json +8 -4
  132. package/node_modules/@ykdz/reference-vike-web/package.json +4 -3
  133. package/node_modules/@ykdz/reference-vue-app/native/package.json +3 -1
  134. package/node_modules/@ykdz/reference-vue-app/native/template-dist/definition.d.ts +1 -1
  135. package/node_modules/@ykdz/reference-vue-app/native/template-dist/definition.js +72 -32
  136. package/node_modules/@ykdz/reference-vue-app/native/tsconfig.app.json +1 -1
  137. package/node_modules/@ykdz/reference-vue-app/native/tsconfig.node.json +1 -1
  138. package/node_modules/@ykdz/reference-vue-app/native/turbo.json +2 -2
  139. package/node_modules/@ykdz/reference-vue-app/package.json +3 -3
  140. package/node_modules/@ykdz/reference-vue-hono-web/native/package.json +3 -1
  141. package/node_modules/@ykdz/reference-vue-hono-web/native/template-dist/definition.d.ts +3 -1
  142. package/node_modules/@ykdz/reference-vue-hono-web/native/template-dist/definition.js +78 -28
  143. package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.app.json +1 -1
  144. package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.node.json +1 -1
  145. package/node_modules/@ykdz/reference-vue-hono-web/native/turbo.json +2 -2
  146. package/node_modules/@ykdz/reference-vue-hono-web/package.json +4 -3
  147. package/node_modules/@ykdz/reference-workspace-root/native/package.json +59 -0
  148. package/node_modules/@ykdz/reference-workspace-root/native/template/files/turbo.json +40 -0
  149. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/definition.d.ts +10 -0
  150. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/definition.d.ts.map +1 -0
  151. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/definition.js +140 -0
  152. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/editor-customization.d.ts +19 -0
  153. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/editor-customization.d.ts.map +1 -0
  154. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/editor-customization.js +82 -0
  155. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment-sources.d.ts +6 -0
  156. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment-sources.d.ts.map +1 -0
  157. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment-sources.js +10 -0
  158. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.d.ts +36 -0
  159. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.d.ts.map +1 -0
  160. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.js +210 -0
  161. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/project-github.d.ts +31 -0
  162. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/project-github.d.ts.map +1 -0
  163. package/node_modules/@ykdz/reference-workspace-root/native/template-dist/project-github.js +94 -0
  164. package/node_modules/@ykdz/reference-workspace-root/native/tsconfig.config.json +10 -0
  165. package/node_modules/@ykdz/reference-workspace-root/native/tsconfig.json +7 -0
  166. package/node_modules/@ykdz/reference-workspace-root/native/tsconfig.scripts.json +8 -0
  167. package/node_modules/@ykdz/reference-workspace-root/package.json +33 -0
  168. package/node_modules/@ykdz/template-content/dist/index.d.ts +10 -10
  169. package/node_modules/@ykdz/template-content/dist/index.js +3 -3
  170. package/node_modules/@ykdz/template-content/package.json +2 -1
  171. package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/dist/index.d.ts +3 -45
  172. package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/dist/index.js +18 -23
  173. package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/package.json +2 -2
  174. package/node_modules/@ykdz/template-core/dist/composition.d.ts +49 -0
  175. package/node_modules/@ykdz/template-core/dist/composition.js +1 -0
  176. package/node_modules/@ykdz/template-core/dist/content-identity.d.ts +10 -0
  177. package/node_modules/@ykdz/template-core/dist/content-identity.js +21 -2
  178. package/node_modules/@ykdz/template-core/dist/generation-record.d.ts +63 -28
  179. package/node_modules/@ykdz/template-core/dist/generation-record.js +104 -35
  180. package/node_modules/@ykdz/template-core/dist/json.d.ts +8 -0
  181. package/node_modules/@ykdz/template-core/dist/json.js +62 -0
  182. package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +29 -12
  183. package/node_modules/@ykdz/template-core/dist/package-contribution.js +164 -33
  184. package/node_modules/@ykdz/template-core/dist/preset-definition.d.ts +6 -33
  185. package/node_modules/@ykdz/template-core/dist/preset-definition.js +23 -6
  186. package/node_modules/@ykdz/template-core/dist/project-blueprint.d.ts +40 -30
  187. package/node_modules/@ykdz/template-core/dist/project-blueprint.js +145 -140
  188. package/node_modules/@ykdz/template-core/dist/project-projection.d.ts +91 -33
  189. package/node_modules/@ykdz/template-core/dist/project-projection.js +639 -323
  190. package/node_modules/@ykdz/template-core/dist/reference-package.d.ts +101 -0
  191. package/node_modules/@ykdz/template-core/dist/reference-package.js +14 -0
  192. package/node_modules/@ykdz/template-core/dist/template-source.d.ts +10 -0
  193. package/node_modules/@ykdz/template-core/dist/template-source.js +31 -0
  194. package/node_modules/@ykdz/template-core/package.json +5 -6
  195. package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.d.ts +2 -3
  196. package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.js +2 -6
  197. package/node_modules/@ykdz/template-environment/package.json +3 -3
  198. package/node_modules/@ykdz/template-generator/dist/content-source.d.ts +25 -3
  199. package/node_modules/@ykdz/template-generator/dist/content-source.js +28 -27
  200. package/node_modules/@ykdz/template-generator/dist/index.d.ts +191 -60
  201. package/node_modules/@ykdz/template-generator/dist/index.js +1868 -1000
  202. package/node_modules/@ykdz/template-generator/dist/owner-local-reference.d.ts +8 -0
  203. package/node_modules/@ykdz/template-generator/dist/owner-local-reference.js +80 -0
  204. package/node_modules/@ykdz/template-generator/package.json +2 -2
  205. package/node_modules/@ykdz/template-workspace/dist/application-requirements.d.ts +13 -3
  206. package/node_modules/@ykdz/template-workspace/dist/application-requirements.js +34 -0
  207. package/node_modules/@ykdz/template-workspace/dist/ci-diagnostic-artifact.d.ts +1 -6
  208. package/node_modules/@ykdz/template-workspace/dist/default-composition.d.ts +109 -0
  209. package/node_modules/@ykdz/template-workspace/dist/default-composition.js +1353 -0
  210. package/node_modules/@ykdz/template-workspace/dist/default-generation.d.ts +618 -0
  211. package/node_modules/@ykdz/template-workspace/dist/default-generation.js +638 -0
  212. package/node_modules/@ykdz/template-workspace/dist/default-package-identity.js +23 -19
  213. package/node_modules/@ykdz/template-workspace/dist/project-requirements.d.ts +23 -9
  214. package/node_modules/@ykdz/template-workspace/dist/project-requirements.js +16 -1
  215. package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.d.ts +1 -1
  216. package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.js +1 -1
  217. package/node_modules/@ykdz/template-workspace/dist/rust-toolchain-facts.d.ts +13 -7
  218. package/node_modules/@ykdz/template-workspace/dist/rust-toolchain-facts.js +35 -21
  219. package/node_modules/@ykdz/template-workspace/dist/shared-root-files.d.ts +7 -67
  220. package/node_modules/@ykdz/template-workspace/dist/shared-root-files.js +18 -50
  221. package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.d.ts +0 -1
  222. package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.js +7 -18
  223. package/node_modules/@ykdz/template-workspace/package.json +16 -58
  224. package/node_modules/@ykdz/template-workspace-authoring/dist/content-artifact.d.ts +38 -2
  225. package/node_modules/@ykdz/template-workspace-authoring/dist/content-artifact.js +95 -44
  226. package/node_modules/@ykdz/template-workspace-authoring/package.json +4 -3
  227. package/node_modules/@ykdz/tooling-config/base.json +15 -0
  228. package/node_modules/@ykdz/tooling-config/node.json +13 -0
  229. package/node_modules/@ykdz/tooling-config/oxfmt.config.ts +3 -0
  230. package/node_modules/@ykdz/tooling-config/oxlint.config.ts +8 -0
  231. package/node_modules/@ykdz/tooling-config/package.json +36 -0
  232. package/node_modules/zod/LICENSE +21 -0
  233. package/node_modules/zod/README.md +218 -0
  234. package/node_modules/zod/compile.cjs +96 -0
  235. package/node_modules/zod/compile.d.cts +1 -0
  236. package/node_modules/zod/compile.d.ts +1 -0
  237. package/node_modules/zod/compile.js +52 -0
  238. package/node_modules/zod/index.cjs +52 -0
  239. package/node_modules/zod/index.d.cts +3 -0
  240. package/node_modules/zod/index.d.ts +3 -0
  241. package/node_modules/zod/index.js +7 -0
  242. package/node_modules/zod/locales/index.cjs +36 -0
  243. package/node_modules/zod/locales/index.d.cts +1 -0
  244. package/node_modules/zod/locales/index.d.ts +1 -0
  245. package/node_modules/zod/locales/index.js +1 -0
  246. package/node_modules/zod/locales/package.json +7 -0
  247. package/node_modules/zod/mini/index.cjs +51 -0
  248. package/node_modules/zod/mini/index.d.cts +3 -0
  249. package/node_modules/zod/mini/index.d.ts +3 -0
  250. package/node_modules/zod/mini/index.js +3 -0
  251. package/node_modules/zod/mini/package.json +7 -0
  252. package/node_modules/zod/package.json +147 -0
  253. package/node_modules/zod/src/compile.ts +56 -0
  254. package/node_modules/zod/src/index.ts +7 -0
  255. package/node_modules/zod/src/locales/index.ts +1 -0
  256. package/node_modules/zod/src/mini/index.ts +3 -0
  257. package/node_modules/zod/src/v3/ZodError.ts +340 -0
  258. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  259. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  260. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  261. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  262. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  263. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  264. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  265. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  266. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  267. package/node_modules/zod/src/v3/errors.ts +13 -0
  268. package/node_modules/zod/src/v3/external.ts +6 -0
  269. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  270. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  271. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  272. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  273. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  274. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  275. package/node_modules/zod/src/v3/index.ts +4 -0
  276. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  277. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  278. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  279. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  280. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  281. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  282. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  283. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  284. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  285. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  286. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  287. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  288. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  289. package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  290. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  291. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  292. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  293. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  294. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  295. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  296. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  297. package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
  298. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  299. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  300. package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  301. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  302. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  303. package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
  304. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  305. package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
  306. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  307. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  308. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  309. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  310. package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  311. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  312. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  313. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  314. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  315. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  316. package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
  317. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  318. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  319. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  320. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  321. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  322. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  323. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  324. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  325. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  326. package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
  327. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  328. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  329. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  330. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  331. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  332. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  333. package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
  334. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  335. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  336. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  337. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  338. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  339. package/node_modules/zod/src/v3/types.ts +5138 -0
  340. package/node_modules/zod/src/v4/classic/checks.ts +33 -0
  341. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  342. package/node_modules/zod/src/v4/classic/compat.ts +78 -0
  343. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  344. package/node_modules/zod/src/v4/classic/errors.ts +97 -0
  345. package/node_modules/zod/src/v4/classic/external.ts +57 -0
  346. package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
  347. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  348. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  349. package/node_modules/zod/src/v4/classic/iso.ts +20 -0
  350. package/node_modules/zod/src/v4/classic/parse.ts +88 -0
  351. package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
  352. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  353. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
  354. package/node_modules/zod/src/v4/classic/tests/array.test.ts +291 -0
  355. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
  356. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  357. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  358. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  359. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
  360. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  361. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
  362. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  363. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
  364. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
  365. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  366. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  367. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  368. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  369. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  370. package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
  371. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
  372. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  373. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  374. package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
  375. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  376. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  377. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
  378. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
  379. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
  380. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
  381. package/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
  382. package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  383. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  384. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  385. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
  386. package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
  387. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  388. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
  389. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
  390. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  391. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  392. package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
  393. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  394. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
  395. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
  396. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  397. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
  398. package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  399. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
  400. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
  401. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  402. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  403. package/node_modules/zod/src/v4/classic/tests/map.test.ts +349 -0
  404. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  405. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  406. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  407. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  408. package/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
  409. package/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
  410. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  411. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
  412. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
  413. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  414. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  415. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
  416. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
  417. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  418. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  419. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  420. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  421. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  422. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
  423. package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
  424. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
  425. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  426. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
  427. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  428. package/node_modules/zod/src/v4/classic/tests/set.test.ts +196 -0
  429. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
  430. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  431. package/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
  432. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
  433. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
  434. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  435. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
  436. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  437. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
  438. package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
  439. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  440. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  441. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  442. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  443. package/node_modules/zod/src/v4/core/api.ts +1875 -0
  444. package/node_modules/zod/src/v4/core/checks.ts +1266 -0
  445. package/node_modules/zod/src/v4/core/compile.ts +2322 -0
  446. package/node_modules/zod/src/v4/core/core.ts +230 -0
  447. package/node_modules/zod/src/v4/core/doc.ts +52 -0
  448. package/node_modules/zod/src/v4/core/errors.ts +543 -0
  449. package/node_modules/zod/src/v4/core/index.ts +19 -0
  450. package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
  451. package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
  452. package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
  453. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  454. package/node_modules/zod/src/v4/core/parse.ts +309 -0
  455. package/node_modules/zod/src/v4/core/regexes.ts +217 -0
  456. package/node_modules/zod/src/v4/core/registries.ts +105 -0
  457. package/node_modules/zod/src/v4/core/schemas.ts +5226 -0
  458. package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  459. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  460. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  461. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  462. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  463. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  464. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  465. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  466. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  467. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  468. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  469. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  470. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
  471. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  472. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
  473. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  474. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  475. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  476. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  477. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  478. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  479. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  480. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  481. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  482. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  483. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  484. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  485. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  486. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  487. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  488. package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
  489. package/node_modules/zod/src/v4/core/util.ts +1293 -0
  490. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  491. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  492. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  493. package/node_modules/zod/src/v4/index.ts +4 -0
  494. package/node_modules/zod/src/v4/locales/ar.ts +120 -0
  495. package/node_modules/zod/src/v4/locales/az.ts +116 -0
  496. package/node_modules/zod/src/v4/locales/be.ts +188 -0
  497. package/node_modules/zod/src/v4/locales/bg.ts +133 -0
  498. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  499. package/node_modules/zod/src/v4/locales/ca.ts +121 -0
  500. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  501. package/node_modules/zod/src/v4/locales/cs.ts +123 -0
  502. package/node_modules/zod/src/v4/locales/da.ts +128 -0
  503. package/node_modules/zod/src/v4/locales/de.ts +121 -0
  504. package/node_modules/zod/src/v4/locales/el.ts +124 -0
  505. package/node_modules/zod/src/v4/locales/en.ts +136 -0
  506. package/node_modules/zod/src/v4/locales/eo.ts +123 -0
  507. package/node_modules/zod/src/v4/locales/es.ts +145 -0
  508. package/node_modules/zod/src/v4/locales/fa.ts +131 -0
  509. package/node_modules/zod/src/v4/locales/fi.ts +126 -0
  510. package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
  511. package/node_modules/zod/src/v4/locales/fr.ts +139 -0
  512. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  513. package/node_modules/zod/src/v4/locales/he.ts +253 -0
  514. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  515. package/node_modules/zod/src/v4/locales/hr.ts +135 -0
  516. package/node_modules/zod/src/v4/locales/hu.ts +122 -0
  517. package/node_modules/zod/src/v4/locales/hy.ts +175 -0
  518. package/node_modules/zod/src/v4/locales/id.ts +120 -0
  519. package/node_modules/zod/src/v4/locales/index.ts +63 -0
  520. package/node_modules/zod/src/v4/locales/is.ts +124 -0
  521. package/node_modules/zod/src/v4/locales/it.ts +121 -0
  522. package/node_modules/zod/src/v4/locales/ja.ts +119 -0
  523. package/node_modules/zod/src/v4/locales/ka.ts +128 -0
  524. package/node_modules/zod/src/v4/locales/kh.ts +7 -0
  525. package/node_modules/zod/src/v4/locales/km.ts +124 -0
  526. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  527. package/node_modules/zod/src/v4/locales/ko.ts +126 -0
  528. package/node_modules/zod/src/v4/locales/lt.ts +243 -0
  529. package/node_modules/zod/src/v4/locales/mk.ts +123 -0
  530. package/node_modules/zod/src/v4/locales/ms.ts +120 -0
  531. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  532. package/node_modules/zod/src/v4/locales/nl.ts +126 -0
  533. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  534. package/node_modules/zod/src/v4/locales/no.ts +121 -0
  535. package/node_modules/zod/src/v4/locales/ota.ts +122 -0
  536. package/node_modules/zod/src/v4/locales/pl.ts +123 -0
  537. package/node_modules/zod/src/v4/locales/ps.ts +131 -0
  538. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  539. package/node_modules/zod/src/v4/locales/pt.ts +159 -0
  540. package/node_modules/zod/src/v4/locales/ro.ts +132 -0
  541. package/node_modules/zod/src/v4/locales/ru.ts +188 -0
  542. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  543. package/node_modules/zod/src/v4/locales/sl.ts +123 -0
  544. package/node_modules/zod/src/v4/locales/sv.ts +124 -0
  545. package/node_modules/zod/src/v4/locales/ta.ts +123 -0
  546. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  547. package/node_modules/zod/src/v4/locales/th.ts +124 -0
  548. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  549. package/node_modules/zod/src/v4/locales/tr.ts +116 -0
  550. package/node_modules/zod/src/v4/locales/ua.ts +7 -0
  551. package/node_modules/zod/src/v4/locales/uk.ts +122 -0
  552. package/node_modules/zod/src/v4/locales/ur.ts +124 -0
  553. package/node_modules/zod/src/v4/locales/uz.ts +120 -0
  554. package/node_modules/zod/src/v4/locales/vi.ts +122 -0
  555. package/node_modules/zod/src/v4/locales/yo.ts +129 -0
  556. package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
  557. package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
  558. package/node_modules/zod/src/v4/mini/checks.ts +33 -0
  559. package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  560. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  561. package/node_modules/zod/src/v4/mini/external.ts +52 -0
  562. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  563. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  564. package/node_modules/zod/src/v4/mini/iso.ts +66 -0
  565. package/node_modules/zod/src/v4/mini/parse.ts +16 -0
  566. package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
  567. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
  568. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
  569. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  570. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
  571. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
  572. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
  573. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  574. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  575. package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
  576. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
  577. package/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
  578. package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
  579. package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
  580. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  581. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
  582. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  583. package/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
  584. package/node_modules/zod/src/v4-mini/index.ts +3 -0
  585. package/node_modules/zod/v3/ZodError.cjs +167 -0
  586. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  587. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  588. package/node_modules/zod/v3/ZodError.js +143 -0
  589. package/node_modules/zod/v3/errors.cjs +36 -0
  590. package/node_modules/zod/v3/errors.d.cts +5 -0
  591. package/node_modules/zod/v3/errors.d.ts +5 -0
  592. package/node_modules/zod/v3/errors.js +9 -0
  593. package/node_modules/zod/v3/external.cjs +41 -0
  594. package/node_modules/zod/v3/external.d.cts +6 -0
  595. package/node_modules/zod/v3/external.d.ts +6 -0
  596. package/node_modules/zod/v3/external.js +6 -0
  597. package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
  598. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  599. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  600. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  601. package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
  602. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  603. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  604. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  605. package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
  606. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  607. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  608. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  609. package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
  610. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  611. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  612. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  613. package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
  614. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  615. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  616. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  617. package/node_modules/zod/v3/helpers/util.cjs +156 -0
  618. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  619. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  620. package/node_modules/zod/v3/helpers/util.js +133 -0
  621. package/node_modules/zod/v3/index.cjs +52 -0
  622. package/node_modules/zod/v3/index.d.cts +4 -0
  623. package/node_modules/zod/v3/index.d.ts +4 -0
  624. package/node_modules/zod/v3/index.js +4 -0
  625. package/node_modules/zod/v3/locales/en.cjs +112 -0
  626. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  627. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  628. package/node_modules/zod/v3/locales/en.js +109 -0
  629. package/node_modules/zod/v3/package.json +7 -0
  630. package/node_modules/zod/v3/standard-schema.cjs +21 -0
  631. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  632. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  633. package/node_modules/zod/v3/standard-schema.js +1 -0
  634. package/node_modules/zod/v3/types.cjs +3798 -0
  635. package/node_modules/zod/v3/types.d.cts +1034 -0
  636. package/node_modules/zod/v3/types.d.ts +1034 -0
  637. package/node_modules/zod/v3/types.js +3697 -0
  638. package/node_modules/zod/v4/classic/checks.cjs +53 -0
  639. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  640. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  641. package/node_modules/zod/v4/classic/checks.js +1 -0
  642. package/node_modules/zod/v4/classic/coerce.cjs +66 -0
  643. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  644. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  645. package/node_modules/zod/v4/classic/coerce.js +17 -0
  646. package/node_modules/zod/v4/classic/compat.cjs +80 -0
  647. package/node_modules/zod/v4/classic/compat.d.cts +48 -0
  648. package/node_modules/zod/v4/classic/compat.d.ts +48 -0
  649. package/node_modules/zod/v4/classic/compat.js +31 -0
  650. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  651. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  652. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  653. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  654. package/node_modules/zod/v4/classic/errors.cjs +102 -0
  655. package/node_modules/zod/v4/classic/errors.d.cts +29 -0
  656. package/node_modules/zod/v4/classic/errors.d.ts +29 -0
  657. package/node_modules/zod/v4/classic/errors.js +57 -0
  658. package/node_modules/zod/v4/classic/external.cjs +97 -0
  659. package/node_modules/zod/v4/classic/external.d.cts +19 -0
  660. package/node_modules/zod/v4/classic/external.d.ts +19 -0
  661. package/node_modules/zod/v4/classic/external.js +17 -0
  662. package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
  663. package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  664. package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  665. package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
  666. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  667. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  668. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  669. package/node_modules/zod/v4/classic/in-out.js +36 -0
  670. package/node_modules/zod/v4/classic/index.cjs +52 -0
  671. package/node_modules/zod/v4/classic/index.d.cts +3 -0
  672. package/node_modules/zod/v4/classic/index.d.ts +3 -0
  673. package/node_modules/zod/v4/classic/index.js +4 -0
  674. package/node_modules/zod/v4/classic/iso.cjs +68 -0
  675. package/node_modules/zod/v4/classic/iso.d.cts +7 -0
  676. package/node_modules/zod/v4/classic/iso.d.ts +7 -0
  677. package/node_modules/zod/v4/classic/iso.js +15 -0
  678. package/node_modules/zod/v4/classic/package.json +7 -0
  679. package/node_modules/zod/v4/classic/parse.cjs +63 -0
  680. package/node_modules/zod/v4/classic/parse.d.cts +44 -0
  681. package/node_modules/zod/v4/classic/parse.d.ts +44 -0
  682. package/node_modules/zod/v4/classic/parse.js +16 -0
  683. package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
  684. package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
  685. package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
  686. package/node_modules/zod/v4/classic/schemas.js +1535 -0
  687. package/node_modules/zod/v4/core/api.cjs +1269 -0
  688. package/node_modules/zod/v4/core/api.d.cts +335 -0
  689. package/node_modules/zod/v4/core/api.d.ts +335 -0
  690. package/node_modules/zod/v4/core/api.js +1107 -0
  691. package/node_modules/zod/v4/core/checks.cjs +561 -0
  692. package/node_modules/zod/v4/core/checks.d.cts +294 -0
  693. package/node_modules/zod/v4/core/checks.d.ts +294 -0
  694. package/node_modules/zod/v4/core/checks.js +516 -0
  695. package/node_modules/zod/v4/core/compile.cjs +1916 -0
  696. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  697. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  698. package/node_modules/zod/v4/core/compile.js +1866 -0
  699. package/node_modules/zod/v4/core/core.cjs +167 -0
  700. package/node_modules/zod/v4/core/core.d.cts +82 -0
  701. package/node_modules/zod/v4/core/core.d.ts +82 -0
  702. package/node_modules/zod/v4/core/core.js +141 -0
  703. package/node_modules/zod/v4/core/doc.cjs +61 -0
  704. package/node_modules/zod/v4/core/doc.d.cts +16 -0
  705. package/node_modules/zod/v4/core/doc.d.ts +16 -0
  706. package/node_modules/zod/v4/core/doc.js +38 -0
  707. package/node_modules/zod/v4/core/errors.cjs +317 -0
  708. package/node_modules/zod/v4/core/errors.d.cts +225 -0
  709. package/node_modules/zod/v4/core/errors.d.ts +225 -0
  710. package/node_modules/zod/v4/core/errors.js +267 -0
  711. package/node_modules/zod/v4/core/index.cjs +70 -0
  712. package/node_modules/zod/v4/core/index.d.cts +19 -0
  713. package/node_modules/zod/v4/core/index.d.ts +19 -0
  714. package/node_modules/zod/v4/core/index.js +19 -0
  715. package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
  716. package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  717. package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  718. package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
  719. package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
  720. package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
  721. package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
  722. package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
  723. package/node_modules/zod/v4/core/json-schema.cjs +21 -0
  724. package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
  725. package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
  726. package/node_modules/zod/v4/core/json-schema.js +1 -0
  727. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  728. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  729. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  730. package/node_modules/zod/v4/core/memoizer.js +311 -0
  731. package/node_modules/zod/v4/core/package.json +7 -0
  732. package/node_modules/zod/v4/core/parse.cjs +233 -0
  733. package/node_modules/zod/v4/core/parse.d.cts +52 -0
  734. package/node_modules/zod/v4/core/parse.d.ts +52 -0
  735. package/node_modules/zod/v4/core/parse.js +175 -0
  736. package/node_modules/zod/v4/core/regexes.cjs +209 -0
  737. package/node_modules/zod/v4/core/regexes.d.cts +90 -0
  738. package/node_modules/zod/v4/core/regexes.d.ts +90 -0
  739. package/node_modules/zod/v4/core/regexes.js +156 -0
  740. package/node_modules/zod/v4/core/registries.cjs +75 -0
  741. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  742. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  743. package/node_modules/zod/v4/core/registries.js +51 -0
  744. package/node_modules/zod/v4/core/schemas.cjs +2699 -0
  745. package/node_modules/zod/v4/core/schemas.d.cts +1275 -0
  746. package/node_modules/zod/v4/core/schemas.d.ts +1275 -0
  747. package/node_modules/zod/v4/core/schemas.js +2636 -0
  748. package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
  749. package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  750. package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  751. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  752. package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
  753. package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
  754. package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
  755. package/node_modules/zod/v4/core/to-json-schema.js +651 -0
  756. package/node_modules/zod/v4/core/util.cjs +964 -0
  757. package/node_modules/zod/v4/core/util.d.cts +280 -0
  758. package/node_modules/zod/v4/core/util.d.ts +280 -0
  759. package/node_modules/zod/v4/core/util.js +873 -0
  760. package/node_modules/zod/v4/core/versions.cjs +27 -0
  761. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  762. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  763. package/node_modules/zod/v4/core/versions.js +5 -0
  764. package/node_modules/zod/v4/core/visit.cjs +214 -0
  765. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  766. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  767. package/node_modules/zod/v4/core/visit.js +169 -0
  768. package/node_modules/zod/v4/index.cjs +51 -0
  769. package/node_modules/zod/v4/index.d.cts +3 -0
  770. package/node_modules/zod/v4/index.d.ts +3 -0
  771. package/node_modules/zod/v4/index.js +4 -0
  772. package/node_modules/zod/v4/locales/ar.cjs +138 -0
  773. package/node_modules/zod/v4/locales/ar.d.cts +5 -0
  774. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  775. package/node_modules/zod/v4/locales/ar.js +111 -0
  776. package/node_modules/zod/v4/locales/az.cjs +137 -0
  777. package/node_modules/zod/v4/locales/az.d.cts +5 -0
  778. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  779. package/node_modules/zod/v4/locales/az.js +110 -0
  780. package/node_modules/zod/v4/locales/be.cjs +195 -0
  781. package/node_modules/zod/v4/locales/be.d.cts +5 -0
  782. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  783. package/node_modules/zod/v4/locales/be.js +168 -0
  784. package/node_modules/zod/v4/locales/bg.cjs +152 -0
  785. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  786. package/node_modules/zod/v4/locales/bg.d.ts +4 -0
  787. package/node_modules/zod/v4/locales/bg.js +125 -0
  788. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  789. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  790. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  791. package/node_modules/zod/v4/locales/bn.js +113 -0
  792. package/node_modules/zod/v4/locales/ca.cjs +139 -0
  793. package/node_modules/zod/v4/locales/ca.d.cts +5 -0
  794. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  795. package/node_modules/zod/v4/locales/ca.js +112 -0
  796. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  797. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  798. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  799. package/node_modules/zod/v4/locales/ckb.js +133 -0
  800. package/node_modules/zod/v4/locales/cs.cjs +143 -0
  801. package/node_modules/zod/v4/locales/cs.d.cts +5 -0
  802. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  803. package/node_modules/zod/v4/locales/cs.js +116 -0
  804. package/node_modules/zod/v4/locales/da.cjs +147 -0
  805. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  806. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  807. package/node_modules/zod/v4/locales/da.js +120 -0
  808. package/node_modules/zod/v4/locales/de.cjs +140 -0
  809. package/node_modules/zod/v4/locales/de.d.cts +5 -0
  810. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  811. package/node_modules/zod/v4/locales/de.js +113 -0
  812. package/node_modules/zod/v4/locales/el.cjs +139 -0
  813. package/node_modules/zod/v4/locales/el.d.cts +5 -0
  814. package/node_modules/zod/v4/locales/el.d.ts +4 -0
  815. package/node_modules/zod/v4/locales/el.js +112 -0
  816. package/node_modules/zod/v4/locales/en.cjs +152 -0
  817. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  818. package/node_modules/zod/v4/locales/en.d.ts +4 -0
  819. package/node_modules/zod/v4/locales/en.js +125 -0
  820. package/node_modules/zod/v4/locales/eo.cjs +141 -0
  821. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  822. package/node_modules/zod/v4/locales/eo.d.ts +4 -0
  823. package/node_modules/zod/v4/locales/eo.js +114 -0
  824. package/node_modules/zod/v4/locales/es.cjs +163 -0
  825. package/node_modules/zod/v4/locales/es.d.cts +5 -0
  826. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  827. package/node_modules/zod/v4/locales/es.js +136 -0
  828. package/node_modules/zod/v4/locales/fa.cjs +146 -0
  829. package/node_modules/zod/v4/locales/fa.d.cts +5 -0
  830. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  831. package/node_modules/zod/v4/locales/fa.js +119 -0
  832. package/node_modules/zod/v4/locales/fi.cjs +144 -0
  833. package/node_modules/zod/v4/locales/fi.d.cts +5 -0
  834. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  835. package/node_modules/zod/v4/locales/fi.js +117 -0
  836. package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
  837. package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  838. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  839. package/node_modules/zod/v4/locales/fr-CA.js +112 -0
  840. package/node_modules/zod/v4/locales/fr.cjs +156 -0
  841. package/node_modules/zod/v4/locales/fr.d.cts +5 -0
  842. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  843. package/node_modules/zod/v4/locales/fr.js +129 -0
  844. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  845. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  846. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  847. package/node_modules/zod/v4/locales/gu.js +113 -0
  848. package/node_modules/zod/v4/locales/he.cjs +248 -0
  849. package/node_modules/zod/v4/locales/he.d.cts +5 -0
  850. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  851. package/node_modules/zod/v4/locales/he.js +221 -0
  852. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  853. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  854. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  855. package/node_modules/zod/v4/locales/hi.js +111 -0
  856. package/node_modules/zod/v4/locales/hr.cjs +153 -0
  857. package/node_modules/zod/v4/locales/hr.d.cts +5 -0
  858. package/node_modules/zod/v4/locales/hr.d.ts +4 -0
  859. package/node_modules/zod/v4/locales/hr.js +126 -0
  860. package/node_modules/zod/v4/locales/hu.cjs +140 -0
  861. package/node_modules/zod/v4/locales/hu.d.cts +5 -0
  862. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  863. package/node_modules/zod/v4/locales/hu.js +113 -0
  864. package/node_modules/zod/v4/locales/hy.cjs +185 -0
  865. package/node_modules/zod/v4/locales/hy.d.cts +5 -0
  866. package/node_modules/zod/v4/locales/hy.d.ts +4 -0
  867. package/node_modules/zod/v4/locales/hy.js +158 -0
  868. package/node_modules/zod/v4/locales/id.cjs +138 -0
  869. package/node_modules/zod/v4/locales/id.d.cts +5 -0
  870. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  871. package/node_modules/zod/v4/locales/id.js +111 -0
  872. package/node_modules/zod/v4/locales/index.cjs +152 -0
  873. package/node_modules/zod/v4/locales/index.d.cts +63 -0
  874. package/node_modules/zod/v4/locales/index.d.ts +63 -0
  875. package/node_modules/zod/v4/locales/index.js +63 -0
  876. package/node_modules/zod/v4/locales/is.cjs +141 -0
  877. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  878. package/node_modules/zod/v4/locales/is.d.ts +4 -0
  879. package/node_modules/zod/v4/locales/is.js +114 -0
  880. package/node_modules/zod/v4/locales/it.cjs +140 -0
  881. package/node_modules/zod/v4/locales/it.d.cts +5 -0
  882. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  883. package/node_modules/zod/v4/locales/it.js +113 -0
  884. package/node_modules/zod/v4/locales/ja.cjs +139 -0
  885. package/node_modules/zod/v4/locales/ja.d.cts +5 -0
  886. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  887. package/node_modules/zod/v4/locales/ja.js +112 -0
  888. package/node_modules/zod/v4/locales/ka.cjs +144 -0
  889. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  890. package/node_modules/zod/v4/locales/ka.d.ts +4 -0
  891. package/node_modules/zod/v4/locales/ka.js +117 -0
  892. package/node_modules/zod/v4/locales/kh.cjs +12 -0
  893. package/node_modules/zod/v4/locales/kh.d.cts +5 -0
  894. package/node_modules/zod/v4/locales/kh.d.ts +5 -0
  895. package/node_modules/zod/v4/locales/kh.js +5 -0
  896. package/node_modules/zod/v4/locales/km.cjs +142 -0
  897. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  898. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  899. package/node_modules/zod/v4/locales/km.js +115 -0
  900. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  901. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  902. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  903. package/node_modules/zod/v4/locales/kn.js +116 -0
  904. package/node_modules/zod/v4/locales/ko.cjs +143 -0
  905. package/node_modules/zod/v4/locales/ko.d.cts +5 -0
  906. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  907. package/node_modules/zod/v4/locales/ko.js +116 -0
  908. package/node_modules/zod/v4/locales/lt.cjs +234 -0
  909. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  910. package/node_modules/zod/v4/locales/lt.d.ts +4 -0
  911. package/node_modules/zod/v4/locales/lt.js +207 -0
  912. package/node_modules/zod/v4/locales/mk.cjs +141 -0
  913. package/node_modules/zod/v4/locales/mk.d.cts +5 -0
  914. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  915. package/node_modules/zod/v4/locales/mk.js +114 -0
  916. package/node_modules/zod/v4/locales/ms.cjs +139 -0
  917. package/node_modules/zod/v4/locales/ms.d.cts +5 -0
  918. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  919. package/node_modules/zod/v4/locales/ms.js +112 -0
  920. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  921. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  922. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  923. package/node_modules/zod/v4/locales/ne.js +111 -0
  924. package/node_modules/zod/v4/locales/nl.cjs +142 -0
  925. package/node_modules/zod/v4/locales/nl.d.cts +5 -0
  926. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  927. package/node_modules/zod/v4/locales/nl.js +115 -0
  928. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  929. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  930. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  931. package/node_modules/zod/v4/locales/nn.js +113 -0
  932. package/node_modules/zod/v4/locales/no.cjs +140 -0
  933. package/node_modules/zod/v4/locales/no.d.cts +5 -0
  934. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  935. package/node_modules/zod/v4/locales/no.js +113 -0
  936. package/node_modules/zod/v4/locales/ota.cjs +141 -0
  937. package/node_modules/zod/v4/locales/ota.d.cts +5 -0
  938. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  939. package/node_modules/zod/v4/locales/ota.js +114 -0
  940. package/node_modules/zod/v4/locales/package.json +7 -0
  941. package/node_modules/zod/v4/locales/pl.cjs +141 -0
  942. package/node_modules/zod/v4/locales/pl.d.cts +5 -0
  943. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  944. package/node_modules/zod/v4/locales/pl.js +114 -0
  945. package/node_modules/zod/v4/locales/ps.cjs +146 -0
  946. package/node_modules/zod/v4/locales/ps.d.cts +5 -0
  947. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  948. package/node_modules/zod/v4/locales/ps.js +119 -0
  949. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  950. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  951. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  952. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  953. package/node_modules/zod/v4/locales/pt.cjs +169 -0
  954. package/node_modules/zod/v4/locales/pt.d.cts +5 -0
  955. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  956. package/node_modules/zod/v4/locales/pt.js +142 -0
  957. package/node_modules/zod/v4/locales/ro.cjs +149 -0
  958. package/node_modules/zod/v4/locales/ro.d.cts +5 -0
  959. package/node_modules/zod/v4/locales/ro.d.ts +4 -0
  960. package/node_modules/zod/v4/locales/ro.js +122 -0
  961. package/node_modules/zod/v4/locales/ru.cjs +195 -0
  962. package/node_modules/zod/v4/locales/ru.d.cts +5 -0
  963. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  964. package/node_modules/zod/v4/locales/ru.js +168 -0
  965. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  966. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  967. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  968. package/node_modules/zod/v4/locales/sk.js +116 -0
  969. package/node_modules/zod/v4/locales/sl.cjs +141 -0
  970. package/node_modules/zod/v4/locales/sl.d.cts +5 -0
  971. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  972. package/node_modules/zod/v4/locales/sl.js +114 -0
  973. package/node_modules/zod/v4/locales/sv.cjs +142 -0
  974. package/node_modules/zod/v4/locales/sv.d.cts +5 -0
  975. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  976. package/node_modules/zod/v4/locales/sv.js +115 -0
  977. package/node_modules/zod/v4/locales/ta.cjs +142 -0
  978. package/node_modules/zod/v4/locales/ta.d.cts +5 -0
  979. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  980. package/node_modules/zod/v4/locales/ta.js +115 -0
  981. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  982. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  983. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  984. package/node_modules/zod/v4/locales/tg.js +117 -0
  985. package/node_modules/zod/v4/locales/th.cjs +142 -0
  986. package/node_modules/zod/v4/locales/th.d.cts +5 -0
  987. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  988. package/node_modules/zod/v4/locales/th.js +115 -0
  989. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  990. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  991. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  992. package/node_modules/zod/v4/locales/tk.js +107 -0
  993. package/node_modules/zod/v4/locales/tr.cjs +137 -0
  994. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  995. package/node_modules/zod/v4/locales/tr.d.ts +4 -0
  996. package/node_modules/zod/v4/locales/tr.js +110 -0
  997. package/node_modules/zod/v4/locales/ua.cjs +12 -0
  998. package/node_modules/zod/v4/locales/ua.d.cts +5 -0
  999. package/node_modules/zod/v4/locales/ua.d.ts +5 -0
  1000. package/node_modules/zod/v4/locales/ua.js +5 -0
  1001. package/node_modules/zod/v4/locales/uk.cjs +140 -0
  1002. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  1003. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  1004. package/node_modules/zod/v4/locales/uk.js +113 -0
  1005. package/node_modules/zod/v4/locales/ur.cjs +142 -0
  1006. package/node_modules/zod/v4/locales/ur.d.cts +5 -0
  1007. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  1008. package/node_modules/zod/v4/locales/ur.js +115 -0
  1009. package/node_modules/zod/v4/locales/uz.cjs +140 -0
  1010. package/node_modules/zod/v4/locales/uz.d.cts +5 -0
  1011. package/node_modules/zod/v4/locales/uz.d.ts +4 -0
  1012. package/node_modules/zod/v4/locales/uz.js +113 -0
  1013. package/node_modules/zod/v4/locales/vi.cjs +140 -0
  1014. package/node_modules/zod/v4/locales/vi.d.cts +5 -0
  1015. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  1016. package/node_modules/zod/v4/locales/vi.js +113 -0
  1017. package/node_modules/zod/v4/locales/yo.cjs +139 -0
  1018. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  1019. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  1020. package/node_modules/zod/v4/locales/yo.js +112 -0
  1021. package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
  1022. package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  1023. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  1024. package/node_modules/zod/v4/locales/zh-CN.js +114 -0
  1025. package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
  1026. package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  1027. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  1028. package/node_modules/zod/v4/locales/zh-TW.js +112 -0
  1029. package/node_modules/zod/v4/mini/checks.cjs +54 -0
  1030. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  1031. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  1032. package/node_modules/zod/v4/mini/checks.js +1 -0
  1033. package/node_modules/zod/v4/mini/coerce.cjs +71 -0
  1034. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  1035. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  1036. package/node_modules/zod/v4/mini/coerce.js +22 -0
  1037. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  1038. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  1039. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  1040. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  1041. package/node_modules/zod/v4/mini/external.cjs +95 -0
  1042. package/node_modules/zod/v4/mini/external.d.cts +16 -0
  1043. package/node_modules/zod/v4/mini/external.d.ts +16 -0
  1044. package/node_modules/zod/v4/mini/external.js +16 -0
  1045. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  1046. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  1047. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  1048. package/node_modules/zod/v4/mini/in-out.js +36 -0
  1049. package/node_modules/zod/v4/mini/index.cjs +51 -0
  1050. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  1051. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  1052. package/node_modules/zod/v4/mini/index.js +3 -0
  1053. package/node_modules/zod/v4/mini/iso.cjs +83 -0
  1054. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  1055. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  1056. package/node_modules/zod/v4/mini/iso.js +34 -0
  1057. package/node_modules/zod/v4/mini/package.json +7 -0
  1058. package/node_modules/zod/v4/mini/parse.cjs +37 -0
  1059. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  1060. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  1061. package/node_modules/zod/v4/mini/parse.js +1 -0
  1062. package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
  1063. package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
  1064. package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
  1065. package/node_modules/zod/v4/mini/schemas.js +1002 -0
  1066. package/node_modules/zod/v4/package.json +7 -0
  1067. package/node_modules/zod/v4-mini/index.cjs +51 -0
  1068. package/node_modules/zod/v4-mini/index.d.cts +3 -0
  1069. package/node_modules/zod/v4-mini/index.d.ts +3 -0
  1070. package/node_modules/zod/v4-mini/index.js +3 -0
  1071. package/node_modules/zod/v4-mini/package.json +7 -0
  1072. package/package.json +15 -10
  1073. package/dist/standard-schema.d.ts +0 -3
  1074. package/dist/standard-schema.js +0 -21
  1075. package/node_modules/@typescript/typescript-linux-x64/LICENSE +0 -55
  1076. package/node_modules/@typescript/typescript-linux-x64/NOTICE.txt +0 -436
  1077. package/node_modules/@typescript/typescript-linux-x64/README.md +0 -3
  1078. package/node_modules/@typescript/typescript-linux-x64/lib/lib.d.ts +0 -20
  1079. package/node_modules/@typescript/typescript-linux-x64/lib/lib.decorators.d.ts +0 -382
  1080. package/node_modules/@typescript/typescript-linux-x64/lib/lib.decorators.legacy.d.ts +0 -20
  1081. package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.asynciterable.d.ts +0 -18
  1082. package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.d.ts +0 -45125
  1083. package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.iterable.d.ts +0 -18
  1084. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.collection.d.ts +0 -159
  1085. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.core.d.ts +0 -595
  1086. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.d.ts +0 -26
  1087. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.generator.d.ts +0 -75
  1088. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.iterable.d.ts +0 -603
  1089. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.promise.d.ts +0 -79
  1090. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.proxy.d.ts +0 -126
  1091. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.reflect.d.ts +0 -142
  1092. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.d.ts +0 -44
  1093. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.wellknown.d.ts +0 -324
  1094. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.array.include.d.ts +0 -114
  1095. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.d.ts +0 -19
  1096. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.full.d.ts +0 -21
  1097. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.intl.d.ts +0 -29
  1098. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.arraybuffer.d.ts +0 -19
  1099. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.d.ts +0 -24
  1100. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.date.d.ts +0 -29
  1101. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.full.d.ts +0 -21
  1102. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.intl.d.ts +0 -42
  1103. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.object.d.ts +0 -47
  1104. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.sharedmemory.d.ts +0 -133
  1105. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.string.d.ts +0 -47
  1106. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.typedarrays.d.ts +0 -51
  1107. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asyncgenerator.d.ts +0 -75
  1108. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asynciterable.d.ts +0 -51
  1109. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.d.ts +0 -22
  1110. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.full.d.ts +0 -22
  1111. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.intl.d.ts +0 -81
  1112. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.promise.d.ts +0 -28
  1113. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.regexp.d.ts +0 -35
  1114. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.array.d.ts +0 -77
  1115. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.d.ts +0 -22
  1116. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.full.d.ts +0 -22
  1117. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.intl.d.ts +0 -21
  1118. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.object.d.ts +0 -31
  1119. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.string.d.ts +0 -35
  1120. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.symbol.d.ts +0 -22
  1121. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.bigint.d.ts +0 -763
  1122. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.d.ts +0 -25
  1123. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.date.d.ts +0 -40
  1124. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.full.d.ts +0 -22
  1125. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.intl.d.ts +0 -472
  1126. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.number.d.ts +0 -26
  1127. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.promise.d.ts +0 -45
  1128. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.sharedmemory.d.ts +0 -97
  1129. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.string.d.ts +0 -42
  1130. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.symbol.wellknown.d.ts +0 -39
  1131. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.d.ts +0 -21
  1132. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.full.d.ts +0 -22
  1133. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.intl.d.ts +0 -164
  1134. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.promise.d.ts +0 -46
  1135. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.string.d.ts +0 -31
  1136. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.weakref.d.ts +0 -76
  1137. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.array.d.ts +0 -119
  1138. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.d.ts +0 -23
  1139. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.error.d.ts +0 -73
  1140. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.full.d.ts +0 -22
  1141. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.intl.d.ts +0 -143
  1142. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.object.d.ts +0 -24
  1143. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.regexp.d.ts +0 -37
  1144. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.string.d.ts +0 -23
  1145. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.array.d.ts +0 -922
  1146. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.collection.d.ts +0 -19
  1147. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.d.ts +0 -20
  1148. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.full.d.ts +0 -22
  1149. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.intl.d.ts +0 -62
  1150. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.arraybuffer.d.ts +0 -63
  1151. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.collection.d.ts +0 -27
  1152. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.d.ts +0 -24
  1153. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.full.d.ts +0 -22
  1154. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.object.d.ts +0 -27
  1155. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.promise.d.ts +0 -33
  1156. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.regexp.d.ts +0 -23
  1157. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.sharedmemory.d.ts +0 -66
  1158. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.string.d.ts +0 -27
  1159. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.collection.d.ts +0 -94
  1160. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.d.ts +0 -23
  1161. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.float16.d.ts +0 -443
  1162. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.full.d.ts +0 -22
  1163. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.intl.d.ts +0 -200
  1164. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.iterator.d.ts +0 -146
  1165. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.promise.d.ts +0 -32
  1166. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.regexp.d.ts +0 -30
  1167. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es5.d.ts +0 -4599
  1168. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es6.d.ts +0 -21
  1169. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.array.d.ts +0 -33
  1170. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.collection.d.ts +0 -47
  1171. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.d.ts +0 -27
  1172. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.date.d.ts +0 -21
  1173. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.decorators.d.ts +0 -26
  1174. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.disposable.d.ts +0 -191
  1175. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.error.d.ts +0 -22
  1176. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.full.d.ts +0 -22
  1177. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.intl.d.ts +0 -107
  1178. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.sharedmemory.d.ts +0 -23
  1179. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.temporal.d.ts +0 -485
  1180. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.typedarrays.d.ts +0 -90
  1181. package/node_modules/@typescript/typescript-linux-x64/lib/lib.scripthost.d.ts +0 -320
  1182. package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.asynciterable.d.ts +0 -18
  1183. package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.d.ts +0 -15606
  1184. package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.importscripts.d.ts +0 -21
  1185. package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.iterable.d.ts +0 -18
  1186. package/node_modules/@typescript/typescript-linux-x64/lib/tsc +0 -0
  1187. package/node_modules/@typescript/typescript-linux-x64/lib/tsc.sig +0 -11
  1188. package/node_modules/@typescript/typescript-linux-x64/package.json +0 -45
  1189. package/node_modules/@valibot/to-json-schema/LICENSE.md +0 -9
  1190. package/node_modules/@valibot/to-json-schema/README.md +0 -475
  1191. package/node_modules/@valibot/to-json-schema/dist/index.cjs +0 -800
  1192. package/node_modules/@valibot/to-json-schema/dist/index.d.cts +0 -991
  1193. package/node_modules/@valibot/to-json-schema/dist/index.d.mts +0 -991
  1194. package/node_modules/@valibot/to-json-schema/dist/index.min.cjs +0 -1
  1195. package/node_modules/@valibot/to-json-schema/dist/index.min.mjs +0 -1
  1196. package/node_modules/@valibot/to-json-schema/dist/index.mjs +0 -795
  1197. package/node_modules/@valibot/to-json-schema/package.json +0 -75
  1198. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.d.ts +0 -13
  1199. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.d.ts.map +0 -1
  1200. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.js +0 -30
  1201. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.d.ts +0 -11
  1202. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.d.ts.map +0 -1
  1203. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.js +0 -51
  1204. package/node_modules/@ykdz/reference-rust-bin/native/tsconfig.json +0 -8
  1205. package/node_modules/@ykdz/reference-ts-cli/native/src/publication/cli-command-identity.ts +0 -88
  1206. package/node_modules/@ykdz/template-content/dist/template-members.d.ts +0 -9
  1207. package/node_modules/@ykdz/template-content/dist/template-members.js +0 -16
  1208. package/node_modules/@ykdz/template-core/dist/renderer-policy-snapshot.d.ts +0 -1
  1209. package/node_modules/@ykdz/template-core/dist/renderer-policy-snapshot.js +0 -2
  1210. package/node_modules/@ykdz/template-core/dist/renderer.d.ts +0 -101
  1211. package/node_modules/@ykdz/template-core/dist/renderer.js +0 -386
  1212. package/node_modules/@ykdz/template-core/dist/workspace-strategy.d.ts +0 -188
  1213. package/node_modules/@ykdz/template-core/dist/workspace-strategy.js +0 -1
  1214. package/node_modules/@ykdz/template-workspace/assets/tsconfig.config.json +0 -6
  1215. package/node_modules/@ykdz/template-workspace/assets/tsconfig.json +0 -7
  1216. package/node_modules/@ykdz/template-workspace/assets/turbo.json +0 -64
  1217. package/node_modules/@ykdz/template-workspace/dist/default-environment-sources.d.ts +0 -5
  1218. package/node_modules/@ykdz/template-workspace/dist/default-environment-sources.js +0 -8
  1219. package/node_modules/@ykdz/template-workspace/dist/default-environment.d.ts +0 -9
  1220. package/node_modules/@ykdz/template-workspace/dist/default-environment.js +0 -5
  1221. package/node_modules/@ykdz/template-workspace/dist/default-workspace-strategy.d.ts +0 -89
  1222. package/node_modules/@ykdz/template-workspace/dist/default-workspace-strategy.js +0 -967
  1223. package/node_modules/@ykdz/template-workspace/dist/development-container.d.ts +0 -3
  1224. package/node_modules/@ykdz/template-workspace/dist/development-container.js +0 -36
  1225. package/node_modules/@ykdz/template-workspace/dist/development-environment.d.ts +0 -36
  1226. package/node_modules/@ykdz/template-workspace/dist/development-environment.js +0 -241
  1227. package/node_modules/@ykdz/template-workspace/dist/editor-customization.d.ts +0 -18
  1228. package/node_modules/@ykdz/template-workspace/dist/editor-customization.js +0 -83
  1229. package/node_modules/@ykdz/template-workspace/dist/environment-needs.d.ts +0 -51
  1230. package/node_modules/@ykdz/template-workspace/dist/generation-context.d.ts +0 -14
  1231. package/node_modules/@ykdz/template-workspace/dist/package-addition-facts.d.ts +0 -21
  1232. package/node_modules/@ykdz/template-workspace/dist/package-addition-facts.js +0 -90
  1233. package/node_modules/@ykdz/template-workspace/dist/package-contribution.d.ts +0 -64
  1234. package/node_modules/@ykdz/template-workspace/dist/package-contribution.js +0 -65
  1235. package/node_modules/@ykdz/template-workspace/dist/project-github.d.ts +0 -24
  1236. package/node_modules/@ykdz/template-workspace/dist/project-github.js +0 -98
  1237. package/node_modules/@ykdz/template-workspace/dist/project-linking.d.ts +0 -48
  1238. package/node_modules/@ykdz/template-workspace/dist/project-linking.js +0 -218
  1239. package/node_modules/@ykdz/template-workspace/dist/reference-package.d.ts +0 -146
  1240. package/node_modules/@ykdz/template-workspace/dist/reference-package.js +0 -521
  1241. package/node_modules/@ykdz/template-workspace/dist/root-projection.d.ts +0 -29
  1242. package/node_modules/@ykdz/template-workspace/dist/root-projection.js +0 -144
  1243. package/node_modules/@ykdz/template-workspace/dist/rust-target-projection.d.ts +0 -35
  1244. package/node_modules/@ykdz/template-workspace/dist/rust-target-projection.js +0 -74
  1245. package/node_modules/@ykdz/template-workspace/dist/workspace-resources.d.ts +0 -23
  1246. package/node_modules/@ykdz/template-workspace/dist/workspace-resources.js +0 -83
  1247. package/node_modules/@ykdz/template-workspace/resources/oxfmt.config.ts +0 -1
  1248. package/node_modules/@ykdz/template-workspace/resources/oxlint.config.ts +0 -4
  1249. package/node_modules/typescript-7/LICENSE +0 -55
  1250. package/node_modules/typescript-7/NOTICE.txt +0 -436
  1251. package/node_modules/typescript-7/README.md +0 -49
  1252. package/node_modules/typescript-7/bin/tsc +0 -2
  1253. package/node_modules/typescript-7/dist/api/async/api.d.ts +0 -529
  1254. package/node_modules/typescript-7/dist/api/async/api.d.ts.map +0 -1
  1255. package/node_modules/typescript-7/dist/api/async/api.js +0 -1657
  1256. package/node_modules/typescript-7/dist/api/async/api.js.map +0 -1
  1257. package/node_modules/typescript-7/dist/api/async/client.d.ts +0 -39
  1258. package/node_modules/typescript-7/dist/api/async/client.d.ts.map +0 -1
  1259. package/node_modules/typescript-7/dist/api/async/client.js +0 -211
  1260. package/node_modules/typescript-7/dist/api/async/client.js.map +0 -1
  1261. package/node_modules/typescript-7/dist/api/async/types.d.ts +0 -310
  1262. package/node_modules/typescript-7/dist/api/async/types.d.ts.map +0 -1
  1263. package/node_modules/typescript-7/dist/api/async/types.js +0 -2
  1264. package/node_modules/typescript-7/dist/api/async/types.js.map +0 -1
  1265. package/node_modules/typescript-7/dist/api/compilerOptions.d.ts +0 -109
  1266. package/node_modules/typescript-7/dist/api/compilerOptions.d.ts.map +0 -1
  1267. package/node_modules/typescript-7/dist/api/compilerOptions.js +0 -2
  1268. package/node_modules/typescript-7/dist/api/compilerOptions.js.map +0 -1
  1269. package/node_modules/typescript-7/dist/api/fs.d.ts +0 -23
  1270. package/node_modules/typescript-7/dist/api/fs.d.ts.map +0 -1
  1271. package/node_modules/typescript-7/dist/api/fs.js +0 -109
  1272. package/node_modules/typescript-7/dist/api/fs.js.map +0 -1
  1273. package/node_modules/typescript-7/dist/api/node/encoder.d.ts +0 -15
  1274. package/node_modules/typescript-7/dist/api/node/encoder.d.ts.map +0 -1
  1275. package/node_modules/typescript-7/dist/api/node/encoder.generated.d.ts +0 -5
  1276. package/node_modules/typescript-7/dist/api/node/encoder.generated.d.ts.map +0 -1
  1277. package/node_modules/typescript-7/dist/api/node/encoder.generated.js +0 -74
  1278. package/node_modules/typescript-7/dist/api/node/encoder.generated.js.map +0 -1
  1279. package/node_modules/typescript-7/dist/api/node/encoder.js +0 -287
  1280. package/node_modules/typescript-7/dist/api/node/encoder.js.map +0 -1
  1281. package/node_modules/typescript-7/dist/api/node/msgpack.d.ts +0 -32
  1282. package/node_modules/typescript-7/dist/api/node/msgpack.d.ts.map +0 -1
  1283. package/node_modules/typescript-7/dist/api/node/msgpack.js +0 -213
  1284. package/node_modules/typescript-7/dist/api/node/msgpack.js.map +0 -1
  1285. package/node_modules/typescript-7/dist/api/node/node.d.ts +0 -76
  1286. package/node_modules/typescript-7/dist/api/node/node.d.ts.map +0 -1
  1287. package/node_modules/typescript-7/dist/api/node/node.generated.d.ts +0 -182
  1288. package/node_modules/typescript-7/dist/api/node/node.generated.d.ts.map +0 -1
  1289. package/node_modules/typescript-7/dist/api/node/node.generated.js +0 -835
  1290. package/node_modules/typescript-7/dist/api/node/node.generated.js.map +0 -1
  1291. package/node_modules/typescript-7/dist/api/node/node.infrastructure.d.ts +0 -62
  1292. package/node_modules/typescript-7/dist/api/node/node.infrastructure.d.ts.map +0 -1
  1293. package/node_modules/typescript-7/dist/api/node/node.infrastructure.js +0 -122
  1294. package/node_modules/typescript-7/dist/api/node/node.infrastructure.js.map +0 -1
  1295. package/node_modules/typescript-7/dist/api/node/node.js +0 -298
  1296. package/node_modules/typescript-7/dist/api/node/node.js.map +0 -1
  1297. package/node_modules/typescript-7/dist/api/node/protocol.d.ts +0 -29
  1298. package/node_modules/typescript-7/dist/api/node/protocol.d.ts.map +0 -1
  1299. package/node_modules/typescript-7/dist/api/node/protocol.generated.d.ts +0 -4
  1300. package/node_modules/typescript-7/dist/api/node/protocol.generated.d.ts.map +0 -1
  1301. package/node_modules/typescript-7/dist/api/node/protocol.generated.js +0 -241
  1302. package/node_modules/typescript-7/dist/api/node/protocol.generated.js.map +0 -1
  1303. package/node_modules/typescript-7/dist/api/node/protocol.js +0 -30
  1304. package/node_modules/typescript-7/dist/api/node/protocol.js.map +0 -1
  1305. package/node_modules/typescript-7/dist/api/node/wtf8.d.ts +0 -6
  1306. package/node_modules/typescript-7/dist/api/node/wtf8.d.ts.map +0 -1
  1307. package/node_modules/typescript-7/dist/api/node/wtf8.js +0 -61
  1308. package/node_modules/typescript-7/dist/api/node/wtf8.js.map +0 -1
  1309. package/node_modules/typescript-7/dist/api/options.d.ts +0 -32
  1310. package/node_modules/typescript-7/dist/api/options.d.ts.map +0 -1
  1311. package/node_modules/typescript-7/dist/api/options.js +0 -11
  1312. package/node_modules/typescript-7/dist/api/options.js.map +0 -1
  1313. package/node_modules/typescript-7/dist/api/path.d.ts +0 -110
  1314. package/node_modules/typescript-7/dist/api/path.d.ts.map +0 -1
  1315. package/node_modules/typescript-7/dist/api/path.js +0 -508
  1316. package/node_modules/typescript-7/dist/api/path.js.map +0 -1
  1317. package/node_modules/typescript-7/dist/api/proto.d.ts +0 -239
  1318. package/node_modules/typescript-7/dist/api/proto.d.ts.map +0 -1
  1319. package/node_modules/typescript-7/dist/api/proto.js +0 -37
  1320. package/node_modules/typescript-7/dist/api/proto.js.map +0 -1
  1321. package/node_modules/typescript-7/dist/api/sourceFileCache.d.ts +0 -79
  1322. package/node_modules/typescript-7/dist/api/sourceFileCache.d.ts.map +0 -1
  1323. package/node_modules/typescript-7/dist/api/sourceFileCache.js +0 -169
  1324. package/node_modules/typescript-7/dist/api/sourceFileCache.js.map +0 -1
  1325. package/node_modules/typescript-7/dist/api/sync/api.d.ts +0 -529
  1326. package/node_modules/typescript-7/dist/api/sync/api.d.ts.map +0 -1
  1327. package/node_modules/typescript-7/dist/api/sync/api.js +0 -1665
  1328. package/node_modules/typescript-7/dist/api/sync/api.js.map +0 -1
  1329. package/node_modules/typescript-7/dist/api/sync/client.d.ts +0 -30
  1330. package/node_modules/typescript-7/dist/api/sync/client.d.ts.map +0 -1
  1331. package/node_modules/typescript-7/dist/api/sync/client.js +0 -124
  1332. package/node_modules/typescript-7/dist/api/sync/client.js.map +0 -1
  1333. package/node_modules/typescript-7/dist/api/sync/types.d.ts +0 -310
  1334. package/node_modules/typescript-7/dist/api/sync/types.d.ts.map +0 -1
  1335. package/node_modules/typescript-7/dist/api/sync/types.js +0 -2
  1336. package/node_modules/typescript-7/dist/api/sync/types.js.map +0 -1
  1337. package/node_modules/typescript-7/dist/api/syncChannel.d.ts +0 -114
  1338. package/node_modules/typescript-7/dist/api/syncChannel.d.ts.map +0 -1
  1339. package/node_modules/typescript-7/dist/api/syncChannel.js +0 -508
  1340. package/node_modules/typescript-7/dist/api/syncChannel.js.map +0 -1
  1341. package/node_modules/typescript-7/dist/api/timing.d.ts +0 -175
  1342. package/node_modules/typescript-7/dist/api/timing.d.ts.map +0 -1
  1343. package/node_modules/typescript-7/dist/api/timing.js +0 -149
  1344. package/node_modules/typescript-7/dist/api/timing.js.map +0 -1
  1345. package/node_modules/typescript-7/dist/ast/ast.d.ts +0 -100
  1346. package/node_modules/typescript-7/dist/ast/ast.d.ts.map +0 -1
  1347. package/node_modules/typescript-7/dist/ast/ast.generated.d.ts +0 -1161
  1348. package/node_modules/typescript-7/dist/ast/ast.generated.d.ts.map +0 -1
  1349. package/node_modules/typescript-7/dist/ast/ast.generated.js +0 -4
  1350. package/node_modules/typescript-7/dist/ast/ast.generated.js.map +0 -1
  1351. package/node_modules/typescript-7/dist/ast/ast.js +0 -7
  1352. package/node_modules/typescript-7/dist/ast/ast.js.map +0 -1
  1353. package/node_modules/typescript-7/dist/ast/astnav.d.ts +0 -19
  1354. package/node_modules/typescript-7/dist/ast/astnav.d.ts.map +0 -1
  1355. package/node_modules/typescript-7/dist/ast/astnav.js +0 -596
  1356. package/node_modules/typescript-7/dist/ast/astnav.js.map +0 -1
  1357. package/node_modules/typescript-7/dist/ast/clone.d.ts +0 -16
  1358. package/node_modules/typescript-7/dist/ast/clone.d.ts.map +0 -1
  1359. package/node_modules/typescript-7/dist/ast/clone.js +0 -104
  1360. package/node_modules/typescript-7/dist/ast/clone.js.map +0 -1
  1361. package/node_modules/typescript-7/dist/ast/factory.generated.d.ts +0 -520
  1362. package/node_modules/typescript-7/dist/ast/factory.generated.d.ts.map +0 -1
  1363. package/node_modules/typescript-7/dist/ast/factory.generated.js +0 -3057
  1364. package/node_modules/typescript-7/dist/ast/factory.generated.js.map +0 -1
  1365. package/node_modules/typescript-7/dist/ast/index.d.ts +0 -20
  1366. package/node_modules/typescript-7/dist/ast/index.d.ts.map +0 -1
  1367. package/node_modules/typescript-7/dist/ast/index.js +0 -20
  1368. package/node_modules/typescript-7/dist/ast/index.js.map +0 -1
  1369. package/node_modules/typescript-7/dist/ast/is.d.ts +0 -35
  1370. package/node_modules/typescript-7/dist/ast/is.d.ts.map +0 -1
  1371. package/node_modules/typescript-7/dist/ast/is.generated.d.ts +0 -329
  1372. package/node_modules/typescript-7/dist/ast/is.generated.d.ts.map +0 -1
  1373. package/node_modules/typescript-7/dist/ast/is.generated.js +0 -1103
  1374. package/node_modules/typescript-7/dist/ast/is.generated.js.map +0 -1
  1375. package/node_modules/typescript-7/dist/ast/is.js +0 -233
  1376. package/node_modules/typescript-7/dist/ast/is.js.map +0 -1
  1377. package/node_modules/typescript-7/dist/ast/jsdoc.d.ts +0 -11
  1378. package/node_modules/typescript-7/dist/ast/jsdoc.d.ts.map +0 -1
  1379. package/node_modules/typescript-7/dist/ast/jsdoc.js +0 -202
  1380. package/node_modules/typescript-7/dist/ast/jsdoc.js.map +0 -1
  1381. package/node_modules/typescript-7/dist/ast/scanner.d.ts +0 -97
  1382. package/node_modules/typescript-7/dist/ast/scanner.d.ts.map +0 -1
  1383. package/node_modules/typescript-7/dist/ast/scanner.js +0 -2230
  1384. package/node_modules/typescript-7/dist/ast/scanner.js.map +0 -1
  1385. package/node_modules/typescript-7/dist/ast/utils.d.ts +0 -17
  1386. package/node_modules/typescript-7/dist/ast/utils.d.ts.map +0 -1
  1387. package/node_modules/typescript-7/dist/ast/utils.js +0 -67
  1388. package/node_modules/typescript-7/dist/ast/utils.js.map +0 -1
  1389. package/node_modules/typescript-7/dist/ast/visitor.d.ts +0 -14
  1390. package/node_modules/typescript-7/dist/ast/visitor.d.ts.map +0 -1
  1391. package/node_modules/typescript-7/dist/ast/visitor.generated.d.ts +0 -50
  1392. package/node_modules/typescript-7/dist/ast/visitor.generated.d.ts.map +0 -1
  1393. package/node_modules/typescript-7/dist/ast/visitor.generated.js +0 -978
  1394. package/node_modules/typescript-7/dist/ast/visitor.generated.js.map +0 -1
  1395. package/node_modules/typescript-7/dist/ast/visitor.js +0 -47
  1396. package/node_modules/typescript-7/dist/ast/visitor.js.map +0 -1
  1397. package/node_modules/typescript-7/dist/enums/characterCodes.d.ts +0 -2
  1398. package/node_modules/typescript-7/dist/enums/characterCodes.d.ts.map +0 -1
  1399. package/node_modules/typescript-7/dist/enums/characterCodes.enum.d.ts +0 -129
  1400. package/node_modules/typescript-7/dist/enums/characterCodes.enum.d.ts.map +0 -1
  1401. package/node_modules/typescript-7/dist/enums/characterCodes.enum.js +0 -132
  1402. package/node_modules/typescript-7/dist/enums/characterCodes.enum.js.map +0 -1
  1403. package/node_modules/typescript-7/dist/enums/characterCodes.js +0 -130
  1404. package/node_modules/typescript-7/dist/enums/characterCodes.js.map +0 -1
  1405. package/node_modules/typescript-7/dist/enums/commentDirectiveType.d.ts +0 -2
  1406. package/node_modules/typescript-7/dist/enums/commentDirectiveType.d.ts.map +0 -1
  1407. package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.d.ts +0 -5
  1408. package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.d.ts.map +0 -1
  1409. package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.js +0 -6
  1410. package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.js.map +0 -1
  1411. package/node_modules/typescript-7/dist/enums/commentDirectiveType.js +0 -6
  1412. package/node_modules/typescript-7/dist/enums/commentDirectiveType.js.map +0 -1
  1413. package/node_modules/typescript-7/dist/enums/completionItemKind.d.ts +0 -2
  1414. package/node_modules/typescript-7/dist/enums/completionItemKind.d.ts.map +0 -1
  1415. package/node_modules/typescript-7/dist/enums/completionItemKind.enum.d.ts +0 -28
  1416. package/node_modules/typescript-7/dist/enums/completionItemKind.enum.d.ts.map +0 -1
  1417. package/node_modules/typescript-7/dist/enums/completionItemKind.enum.js +0 -30
  1418. package/node_modules/typescript-7/dist/enums/completionItemKind.enum.js.map +0 -1
  1419. package/node_modules/typescript-7/dist/enums/completionItemKind.js +0 -30
  1420. package/node_modules/typescript-7/dist/enums/completionItemKind.js.map +0 -1
  1421. package/node_modules/typescript-7/dist/enums/diagnosticCategory.d.ts +0 -2
  1422. package/node_modules/typescript-7/dist/enums/diagnosticCategory.d.ts.map +0 -1
  1423. package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.d.ts +0 -7
  1424. package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.d.ts.map +0 -1
  1425. package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.js +0 -9
  1426. package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.js.map +0 -1
  1427. package/node_modules/typescript-7/dist/enums/diagnosticCategory.js +0 -9
  1428. package/node_modules/typescript-7/dist/enums/diagnosticCategory.js.map +0 -1
  1429. package/node_modules/typescript-7/dist/enums/elementFlags.d.ts +0 -2
  1430. package/node_modules/typescript-7/dist/enums/elementFlags.d.ts.map +0 -1
  1431. package/node_modules/typescript-7/dist/enums/elementFlags.enum.d.ts +0 -12
  1432. package/node_modules/typescript-7/dist/enums/elementFlags.enum.d.ts.map +0 -1
  1433. package/node_modules/typescript-7/dist/enums/elementFlags.enum.js +0 -14
  1434. package/node_modules/typescript-7/dist/enums/elementFlags.enum.js.map +0 -1
  1435. package/node_modules/typescript-7/dist/enums/elementFlags.js +0 -14
  1436. package/node_modules/typescript-7/dist/enums/elementFlags.js.map +0 -1
  1437. package/node_modules/typescript-7/dist/enums/internalSymbolName.d.ts +0 -2
  1438. package/node_modules/typescript-7/dist/enums/internalSymbolName.d.ts.map +0 -1
  1439. package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.d.ts +0 -23
  1440. package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.d.ts.map +0 -1
  1441. package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.js +0 -25
  1442. package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.js.map +0 -1
  1443. package/node_modules/typescript-7/dist/enums/internalSymbolName.js +0 -25
  1444. package/node_modules/typescript-7/dist/enums/internalSymbolName.js.map +0 -1
  1445. package/node_modules/typescript-7/dist/enums/jsxEmit.d.ts +0 -2
  1446. package/node_modules/typescript-7/dist/enums/jsxEmit.d.ts.map +0 -1
  1447. package/node_modules/typescript-7/dist/enums/jsxEmit.enum.d.ts +0 -9
  1448. package/node_modules/typescript-7/dist/enums/jsxEmit.enum.d.ts.map +0 -1
  1449. package/node_modules/typescript-7/dist/enums/jsxEmit.enum.js +0 -11
  1450. package/node_modules/typescript-7/dist/enums/jsxEmit.enum.js.map +0 -1
  1451. package/node_modules/typescript-7/dist/enums/jsxEmit.js +0 -11
  1452. package/node_modules/typescript-7/dist/enums/jsxEmit.js.map +0 -1
  1453. package/node_modules/typescript-7/dist/enums/languageVariant.d.ts +0 -2
  1454. package/node_modules/typescript-7/dist/enums/languageVariant.d.ts.map +0 -1
  1455. package/node_modules/typescript-7/dist/enums/languageVariant.enum.d.ts +0 -5
  1456. package/node_modules/typescript-7/dist/enums/languageVariant.enum.d.ts.map +0 -1
  1457. package/node_modules/typescript-7/dist/enums/languageVariant.enum.js +0 -6
  1458. package/node_modules/typescript-7/dist/enums/languageVariant.enum.js.map +0 -1
  1459. package/node_modules/typescript-7/dist/enums/languageVariant.js +0 -6
  1460. package/node_modules/typescript-7/dist/enums/languageVariant.js.map +0 -1
  1461. package/node_modules/typescript-7/dist/enums/modifierFlags.d.ts +0 -2
  1462. package/node_modules/typescript-7/dist/enums/modifierFlags.d.ts.map +0 -1
  1463. package/node_modules/typescript-7/dist/enums/modifierFlags.enum.d.ts +0 -42
  1464. package/node_modules/typescript-7/dist/enums/modifierFlags.enum.d.ts.map +0 -1
  1465. package/node_modules/typescript-7/dist/enums/modifierFlags.enum.js +0 -44
  1466. package/node_modules/typescript-7/dist/enums/modifierFlags.enum.js.map +0 -1
  1467. package/node_modules/typescript-7/dist/enums/modifierFlags.js +0 -44
  1468. package/node_modules/typescript-7/dist/enums/modifierFlags.js.map +0 -1
  1469. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.d.ts +0 -2
  1470. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.d.ts.map +0 -1
  1471. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.d.ts +0 -7
  1472. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.d.ts.map +0 -1
  1473. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.js +0 -9
  1474. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.js.map +0 -1
  1475. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.js +0 -9
  1476. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.js.map +0 -1
  1477. package/node_modules/typescript-7/dist/enums/moduleKind.d.ts +0 -2
  1478. package/node_modules/typescript-7/dist/enums/moduleKind.d.ts.map +0 -1
  1479. package/node_modules/typescript-7/dist/enums/moduleKind.enum.d.ts +0 -17
  1480. package/node_modules/typescript-7/dist/enums/moduleKind.enum.d.ts.map +0 -1
  1481. package/node_modules/typescript-7/dist/enums/moduleKind.enum.js +0 -19
  1482. package/node_modules/typescript-7/dist/enums/moduleKind.enum.js.map +0 -1
  1483. package/node_modules/typescript-7/dist/enums/moduleKind.js +0 -19
  1484. package/node_modules/typescript-7/dist/enums/moduleKind.js.map +0 -1
  1485. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.d.ts +0 -2
  1486. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.d.ts.map +0 -1
  1487. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.d.ts +0 -9
  1488. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.d.ts.map +0 -1
  1489. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.js +0 -11
  1490. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.js.map +0 -1
  1491. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.js +0 -11
  1492. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.js.map +0 -1
  1493. package/node_modules/typescript-7/dist/enums/newLineKind.d.ts +0 -2
  1494. package/node_modules/typescript-7/dist/enums/newLineKind.d.ts.map +0 -1
  1495. package/node_modules/typescript-7/dist/enums/newLineKind.enum.d.ts +0 -6
  1496. package/node_modules/typescript-7/dist/enums/newLineKind.enum.d.ts.map +0 -1
  1497. package/node_modules/typescript-7/dist/enums/newLineKind.enum.js +0 -8
  1498. package/node_modules/typescript-7/dist/enums/newLineKind.enum.js.map +0 -1
  1499. package/node_modules/typescript-7/dist/enums/newLineKind.js +0 -8
  1500. package/node_modules/typescript-7/dist/enums/newLineKind.js.map +0 -1
  1501. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.d.ts +0 -2
  1502. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.d.ts.map +0 -1
  1503. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.d.ts +0 -36
  1504. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.d.ts.map +0 -1
  1505. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.js +0 -38
  1506. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.js.map +0 -1
  1507. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.js +0 -38
  1508. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.js.map +0 -1
  1509. package/node_modules/typescript-7/dist/enums/nodeFlags.d.ts +0 -2
  1510. package/node_modules/typescript-7/dist/enums/nodeFlags.d.ts.map +0 -1
  1511. package/node_modules/typescript-7/dist/enums/nodeFlags.enum.d.ts +0 -44
  1512. package/node_modules/typescript-7/dist/enums/nodeFlags.enum.d.ts.map +0 -1
  1513. package/node_modules/typescript-7/dist/enums/nodeFlags.enum.js +0 -46
  1514. package/node_modules/typescript-7/dist/enums/nodeFlags.enum.js.map +0 -1
  1515. package/node_modules/typescript-7/dist/enums/nodeFlags.js +0 -46
  1516. package/node_modules/typescript-7/dist/enums/nodeFlags.js.map +0 -1
  1517. package/node_modules/typescript-7/dist/enums/objectFlags.d.ts +0 -2
  1518. package/node_modules/typescript-7/dist/enums/objectFlags.d.ts.map +0 -1
  1519. package/node_modules/typescript-7/dist/enums/objectFlags.enum.d.ts +0 -50
  1520. package/node_modules/typescript-7/dist/enums/objectFlags.enum.d.ts.map +0 -1
  1521. package/node_modules/typescript-7/dist/enums/objectFlags.enum.js +0 -52
  1522. package/node_modules/typescript-7/dist/enums/objectFlags.enum.js.map +0 -1
  1523. package/node_modules/typescript-7/dist/enums/objectFlags.js +0 -52
  1524. package/node_modules/typescript-7/dist/enums/objectFlags.js.map +0 -1
  1525. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.d.ts +0 -2
  1526. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.d.ts.map +0 -1
  1527. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.d.ts +0 -16
  1528. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.d.ts.map +0 -1
  1529. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.js +0 -18
  1530. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.js.map +0 -1
  1531. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.js +0 -18
  1532. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.js.map +0 -1
  1533. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.d.ts +0 -2
  1534. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.d.ts.map +0 -1
  1535. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.d.ts +0 -13
  1536. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.d.ts.map +0 -1
  1537. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.js +0 -14
  1538. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.js.map +0 -1
  1539. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.js +0 -14
  1540. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.js.map +0 -1
  1541. package/node_modules/typescript-7/dist/enums/scriptKind.d.ts +0 -2
  1542. package/node_modules/typescript-7/dist/enums/scriptKind.d.ts.map +0 -1
  1543. package/node_modules/typescript-7/dist/enums/scriptKind.enum.d.ts +0 -11
  1544. package/node_modules/typescript-7/dist/enums/scriptKind.enum.d.ts.map +0 -1
  1545. package/node_modules/typescript-7/dist/enums/scriptKind.enum.js +0 -12
  1546. package/node_modules/typescript-7/dist/enums/scriptKind.enum.js.map +0 -1
  1547. package/node_modules/typescript-7/dist/enums/scriptKind.js +0 -12
  1548. package/node_modules/typescript-7/dist/enums/scriptKind.js.map +0 -1
  1549. package/node_modules/typescript-7/dist/enums/scriptTarget.d.ts +0 -2
  1550. package/node_modules/typescript-7/dist/enums/scriptTarget.d.ts.map +0 -1
  1551. package/node_modules/typescript-7/dist/enums/scriptTarget.enum.d.ts +0 -17
  1552. package/node_modules/typescript-7/dist/enums/scriptTarget.enum.d.ts.map +0 -1
  1553. package/node_modules/typescript-7/dist/enums/scriptTarget.enum.js +0 -18
  1554. package/node_modules/typescript-7/dist/enums/scriptTarget.enum.js.map +0 -1
  1555. package/node_modules/typescript-7/dist/enums/scriptTarget.js +0 -18
  1556. package/node_modules/typescript-7/dist/enums/scriptTarget.js.map +0 -1
  1557. package/node_modules/typescript-7/dist/enums/signatureFlags.d.ts +0 -2
  1558. package/node_modules/typescript-7/dist/enums/signatureFlags.d.ts.map +0 -1
  1559. package/node_modules/typescript-7/dist/enums/signatureFlags.enum.d.ts +0 -15
  1560. package/node_modules/typescript-7/dist/enums/signatureFlags.enum.d.ts.map +0 -1
  1561. package/node_modules/typescript-7/dist/enums/signatureFlags.enum.js +0 -17
  1562. package/node_modules/typescript-7/dist/enums/signatureFlags.enum.js.map +0 -1
  1563. package/node_modules/typescript-7/dist/enums/signatureFlags.js +0 -17
  1564. package/node_modules/typescript-7/dist/enums/signatureFlags.js.map +0 -1
  1565. package/node_modules/typescript-7/dist/enums/signatureKind.d.ts +0 -2
  1566. package/node_modules/typescript-7/dist/enums/signatureKind.d.ts.map +0 -1
  1567. package/node_modules/typescript-7/dist/enums/signatureKind.enum.d.ts +0 -5
  1568. package/node_modules/typescript-7/dist/enums/signatureKind.enum.d.ts.map +0 -1
  1569. package/node_modules/typescript-7/dist/enums/signatureKind.enum.js +0 -7
  1570. package/node_modules/typescript-7/dist/enums/signatureKind.enum.js.map +0 -1
  1571. package/node_modules/typescript-7/dist/enums/signatureKind.js +0 -7
  1572. package/node_modules/typescript-7/dist/enums/signatureKind.js.map +0 -1
  1573. package/node_modules/typescript-7/dist/enums/symbolFlags.d.ts +0 -2
  1574. package/node_modules/typescript-7/dist/enums/symbolFlags.d.ts.map +0 -1
  1575. package/node_modules/typescript-7/dist/enums/symbolFlags.enum.d.ts +0 -71
  1576. package/node_modules/typescript-7/dist/enums/symbolFlags.enum.d.ts.map +0 -1
  1577. package/node_modules/typescript-7/dist/enums/symbolFlags.enum.js +0 -73
  1578. package/node_modules/typescript-7/dist/enums/symbolFlags.enum.js.map +0 -1
  1579. package/node_modules/typescript-7/dist/enums/symbolFlags.js +0 -73
  1580. package/node_modules/typescript-7/dist/enums/symbolFlags.js.map +0 -1
  1581. package/node_modules/typescript-7/dist/enums/syntaxKind.d.ts +0 -2
  1582. package/node_modules/typescript-7/dist/enums/syntaxKind.d.ts.map +0 -1
  1583. package/node_modules/typescript-7/dist/enums/syntaxKind.enum.d.ts +0 -389
  1584. package/node_modules/typescript-7/dist/enums/syntaxKind.enum.d.ts.map +0 -1
  1585. package/node_modules/typescript-7/dist/enums/syntaxKind.enum.js +0 -391
  1586. package/node_modules/typescript-7/dist/enums/syntaxKind.enum.js.map +0 -1
  1587. package/node_modules/typescript-7/dist/enums/syntaxKind.js +0 -391
  1588. package/node_modules/typescript-7/dist/enums/syntaxKind.js.map +0 -1
  1589. package/node_modules/typescript-7/dist/enums/tokenFlags.d.ts +0 -2
  1590. package/node_modules/typescript-7/dist/enums/tokenFlags.d.ts.map +0 -1
  1591. package/node_modules/typescript-7/dist/enums/tokenFlags.enum.d.ts +0 -30
  1592. package/node_modules/typescript-7/dist/enums/tokenFlags.enum.d.ts.map +0 -1
  1593. package/node_modules/typescript-7/dist/enums/tokenFlags.enum.js +0 -32
  1594. package/node_modules/typescript-7/dist/enums/tokenFlags.enum.js.map +0 -1
  1595. package/node_modules/typescript-7/dist/enums/tokenFlags.js +0 -32
  1596. package/node_modules/typescript-7/dist/enums/tokenFlags.js.map +0 -1
  1597. package/node_modules/typescript-7/dist/enums/typeFlags.d.ts +0 -2
  1598. package/node_modules/typescript-7/dist/enums/typeFlags.d.ts.map +0 -1
  1599. package/node_modules/typescript-7/dist/enums/typeFlags.enum.d.ts +0 -76
  1600. package/node_modules/typescript-7/dist/enums/typeFlags.enum.d.ts.map +0 -1
  1601. package/node_modules/typescript-7/dist/enums/typeFlags.enum.js +0 -78
  1602. package/node_modules/typescript-7/dist/enums/typeFlags.enum.js.map +0 -1
  1603. package/node_modules/typescript-7/dist/enums/typeFlags.js +0 -78
  1604. package/node_modules/typescript-7/dist/enums/typeFlags.js.map +0 -1
  1605. package/node_modules/typescript-7/dist/enums/typePredicateKind.d.ts +0 -2
  1606. package/node_modules/typescript-7/dist/enums/typePredicateKind.d.ts.map +0 -1
  1607. package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.d.ts +0 -7
  1608. package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.d.ts.map +0 -1
  1609. package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.js +0 -9
  1610. package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.js.map +0 -1
  1611. package/node_modules/typescript-7/dist/enums/typePredicateKind.js +0 -9
  1612. package/node_modules/typescript-7/dist/enums/typePredicateKind.js.map +0 -1
  1613. package/node_modules/typescript-7/dist/internal/utils.d.ts +0 -23
  1614. package/node_modules/typescript-7/dist/internal/utils.d.ts.map +0 -1
  1615. package/node_modules/typescript-7/dist/internal/utils.js +0 -25
  1616. package/node_modules/typescript-7/dist/internal/utils.js.map +0 -1
  1617. package/node_modules/typescript-7/lib/getExePath.d.ts +0 -2
  1618. package/node_modules/typescript-7/lib/getExePath.js +0 -70
  1619. package/node_modules/typescript-7/lib/tsc.js +0 -28
  1620. package/node_modules/typescript-7/lib/version.cjs +0 -3
  1621. package/node_modules/typescript-7/lib/version.d.cts +0 -2
  1622. package/node_modules/typescript-7/package.json +0 -87
  1623. package/node_modules/typescript-7/vendor/vscode-jsonrpc/License.txt +0 -11
  1624. package/node_modules/typescript-7/vendor/vscode-jsonrpc/README.md +0 -54
  1625. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/main.d.ts +0 -17
  1626. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/main.js +0 -83
  1627. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +0 -22
  1628. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/ril.js +0 -210
  1629. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/api.d.ts +0 -14
  1630. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/api.js +0 -87
  1631. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +0 -32
  1632. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/cancellation.js +0 -132
  1633. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/connection.d.ts +0 -367
  1634. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/connection.js +0 -1271
  1635. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +0 -9
  1636. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/disposable.js +0 -16
  1637. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +0 -52
  1638. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/encoding.js +0 -70
  1639. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/events.d.ts +0 -39
  1640. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/events.js +0 -135
  1641. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/is.d.ts +0 -7
  1642. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/is.js +0 -34
  1643. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +0 -55
  1644. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/linkedMap.js +0 -412
  1645. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +0 -18
  1646. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +0 -155
  1647. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +0 -77
  1648. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageReader.js +0 -246
  1649. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +0 -60
  1650. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageWriter.js +0 -157
  1651. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messages.d.ts +0 -369
  1652. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messages.js +0 -436
  1653. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/ral.d.ts +0 -74
  1654. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/ral.js +0 -23
  1655. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +0 -10
  1656. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/semaphore.js +0 -74
  1657. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +0 -15
  1658. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -77
  1659. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/main.d.ts +0 -58
  1660. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/main.js +0 -289
  1661. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/ril.d.ts +0 -12
  1662. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/ril.js +0 -163
  1663. package/node_modules/typescript-7/vendor/vscode-jsonrpc/package.json +0 -54
  1664. package/node_modules/typescript-7/vendor/vscode-jsonrpc/typings/thenable.d.ts +0 -5
  1665. package/node_modules/valibot/LICENSE.md +0 -9
  1666. package/node_modules/valibot/README.md +0 -94
  1667. package/node_modules/valibot/dist/index.cjs +0 -7897
  1668. package/node_modules/valibot/dist/index.d.cts +0 -16579
  1669. package/node_modules/valibot/dist/index.d.mts +0 -16579
  1670. package/node_modules/valibot/dist/index.min.cjs +0 -2
  1671. package/node_modules/valibot/dist/index.min.mjs +0 -2
  1672. package/node_modules/valibot/dist/index.mjs +0 -7577
  1673. package/node_modules/valibot/package.json +0 -84
  1674. /package/node_modules/@ykdz/{template-workspace/dist/generation-context.js → default-content-authoring/dist/contracts.js} +0 -0
  1675. /package/node_modules/@ykdz/{template-workspace → default-content-authoring}/dist/environment-needs.js +0 -0
  1676. /package/node_modules/@ykdz/{template-workspace/dist/default-package-role.d.ts → default-content-authoring/dist/package-role.d.ts} +0 -0
  1677. /package/node_modules/@ykdz/{template-workspace/dist/default-package-role.js → default-content-authoring/dist/package-role.js} +0 -0
  1678. /package/node_modules/@ykdz/{template-workspace/assets/environment → reference-rust-bin/native/resources}/devcontainer/rust.Dockerfile +0 -0
  1679. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/agent-instructions.md +0 -0
  1680. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/base.Dockerfile +0 -0
  1681. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/devcontainer/browser-test.Dockerfile +0 -0
  1682. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/devcontainer/github-cli.Dockerfile +0 -0
  1683. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/devcontainer/shellcheck.Dockerfile +0 -0
  1684. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/devcontainer/workspace-template.json +0 -0
  1685. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/editor-customization/capabilities.json +0 -0
  1686. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/github/check.yml +0 -0
  1687. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/github/dependabot.yml +0 -0
  1688. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/gitignore +0 -0
  1689. /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/next-steps.md +0 -0
  1690. /package/node_modules/@ykdz/{template-workspace → reference-workspace-root/native}/scripts/task-gates.ts +0 -0
@@ -1,1147 +1,2015 @@
1
1
  import { createHash } from "node:crypto";
2
- import { readFile } from "node:fs/promises";
2
+ import { lstat, readFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { isDeepStrictEqual } from "node:util";
5
5
  import { assertContentIdentity, contentIdentityKey, contentIdentityLabel, createContentIndex, } from "@ykdz/template-core/content-identity";
6
- import { assertPackageContribution, } from "@ykdz/template-core/package-contribution";
7
- import { assertProjectBlueprint, } from "@ykdz/template-core/project-blueprint";
8
- import { reconcileAndApplyProjectProjections, materializeProjectProjection, } from "@ykdz/template-core/project-projection";
9
- import { renderNewProject } from "@ykdz/template-core/renderer";
10
- import { parseGenerationRecordStructure } from "@ykdz/template-core/workspace-strategy";
11
- export { generationRecordSchema } from "@ykdz/template-core/workspace-strategy";
12
- function packageIdentity(definition) {
6
+ import { assertGenerationRecordMatchesBlueprint, parseGenerationRecordStructure, } from "@ykdz/template-core/generation-record";
7
+ import { assertJsonValue, printCanonicalJson, } from "@ykdz/template-core/json";
8
+ import { projectPackageContributions, } from "@ykdz/template-core/package-contribution";
9
+ import { assertProjectBlueprint, ProjectBlueprintValidationError, } from "@ykdz/template-core/project-blueprint";
10
+ import { commitProjectProjectionPlan, planProjectProjections, readProjectProjectionCurrent, } from "@ykdz/template-core/project-projection";
11
+ import { resolveReferenceDependencyIdentity } from "./owner-local-reference.js";
12
+ export { generationRecordSchema, parseGenerationRecordStructure, } from "@ykdz/template-core/generation-record";
13
+ export const generatorMetadataPaths = Object.freeze({
14
+ blueprint: ".template/blueprint.json",
15
+ generationRecord: ".template/generation.json",
16
+ });
17
+ export { resolveReferenceDependencyIdentity } from "./owner-local-reference.js";
18
+ function isRecord(value) {
19
+ return typeof value === "object" && value !== null && !Array.isArray(value);
20
+ }
21
+ function packageId(value) {
22
+ const digest = createHash("sha256")
23
+ .update(printCanonicalJson(value))
24
+ .digest("hex");
25
+ return `package-${digest}`;
26
+ }
27
+ function selectionId(value) {
28
+ const digest = createHash("sha256")
29
+ .update(printCanonicalJson(value))
30
+ .digest("hex");
31
+ return `selection-${digest}`;
32
+ }
33
+ function comparePaths(left, right) {
34
+ return left < right ? -1 : left > right ? 1 : 0;
35
+ }
36
+ function mergeProjectionSources(...groups) {
37
+ const sources = new Map();
38
+ for (const group of groups) {
39
+ for (const source of group ?? []) {
40
+ if (!sources.has(source.identity)) {
41
+ sources.set(source.identity, { ...source });
42
+ }
43
+ }
44
+ }
45
+ return [...sources.values()];
46
+ }
47
+ function projectionPath(packagePath, relativePath) {
48
+ return packagePath === "." ? relativePath : `${packagePath}/${relativePath}`;
49
+ }
50
+ function errorMessage(error) {
51
+ return error instanceof Error ? error.message : String(error);
52
+ }
53
+ function dependencyIdentityCacheKey(consumer, dependencyKey) {
54
+ return JSON.stringify([contentIdentityKey(consumer), dependencyKey]);
55
+ }
56
+ function conflictReason(conflicts) {
57
+ return conflicts.map((conflict) => conflict.reason).join("\n");
58
+ }
59
+ function preserveProjectionPaths(before, after) {
60
+ const entries = new Map(after.entries.map((entry) => [entry.path, entry]));
61
+ for (const entry of before.entries) {
62
+ if (!entries.has(entry.path))
63
+ entries.set(entry.path, entry);
64
+ }
65
+ const reconciliation = new Map(after.reconciliation.map((policy) => [policy.path, policy]));
66
+ for (const policy of before.reconciliation) {
67
+ if (!reconciliation.has(policy.path)) {
68
+ reconciliation.set(policy.path, policy);
69
+ }
70
+ }
13
71
  return {
14
- name: definition.name,
15
- path: definition.path,
16
- role: definition.role,
72
+ entries: [...entries.values()].toSorted((left, right) => comparePaths(left.path, right.path)),
73
+ reconciliation: [...reconciliation.values()].toSorted((left, right) => comparePaths(left.path, right.path)),
17
74
  };
18
75
  }
19
- function isRecord(value) {
20
- return typeof value === "object" && value !== null && !Array.isArray(value);
76
+ function isCanonicalRelativeFilePath(value) {
77
+ return (value.length > 0 &&
78
+ !value.includes("\0") &&
79
+ !value.includes("\\") &&
80
+ !value.startsWith("/") &&
81
+ value !== "." &&
82
+ value
83
+ .split("/")
84
+ .every((part) => part.length > 0 && part !== "." && part !== ".."));
21
85
  }
22
- function isPresetDefinition(value) {
23
- return isRecord(value) && value.kind === "preset" && isRecord(value.nodes);
86
+ function isNestedDirectory(parent, child) {
87
+ return parent === "." ? child !== "." : child.startsWith(`${parent}/`);
24
88
  }
25
- function isLoadedPreset(value) {
26
- return (isRecord(value) &&
27
- value.kind === "preset" &&
28
- isRecord(value.definition) &&
29
- isPresetDefinition(value.definition));
89
+ function packageDefinition(value) {
90
+ assertProjectBlueprint({
91
+ schemaVersion: 4,
92
+ packages: [{ packageDefinitionId: `package-${"0".repeat(64)}`, ...value }],
93
+ packageLinkIntents: [],
94
+ });
95
+ return { ...value };
96
+ }
97
+ function preparationSnapshot(value) {
98
+ if (!isRecord(value) || !Array.isArray(value.resources)) {
99
+ throw new Error("参考包准备结果必须是资源快照");
100
+ }
101
+ const paths = new Set();
102
+ const resources = value.resources.map((resource) => {
103
+ if (!isRecord(resource) ||
104
+ typeof resource.path !== "string" ||
105
+ !isCanonicalRelativeFilePath(resource.path) ||
106
+ !(resource.content instanceof Uint8Array) ||
107
+ !Number.isInteger(resource.mode) ||
108
+ resource.mode < 0 ||
109
+ (resource.mode & ~0o111) !== 0) {
110
+ throw new Error("参考包准备结果包含无效资源文件");
111
+ }
112
+ if (paths.has(resource.path)) {
113
+ throw new Error(`参考包准备结果包含重复资源:${resource.path}`);
114
+ }
115
+ paths.add(resource.path);
116
+ return {
117
+ path: resource.path,
118
+ content: resource.content.slice(),
119
+ mode: resource.mode,
120
+ };
121
+ });
122
+ return {
123
+ resources,
124
+ facts: structuredClone(value.facts),
125
+ };
126
+ }
127
+ function clonePreparation(value) {
128
+ return {
129
+ resources: value.resources.map((resource) => ({
130
+ path: resource.path,
131
+ content: resource.content.slice(),
132
+ mode: resource.mode,
133
+ })),
134
+ facts: structuredClone(value.facts),
135
+ };
136
+ }
137
+ function requireParsedCreationInput(content, value) {
138
+ if (value === undefined)
139
+ return undefined;
140
+ const parsed = content.definition.parseCreationInput(value);
141
+ assertJsonValue(parsed, "包创建输入");
142
+ return parsed;
30
143
  }
31
144
  function mergeCreationInput(defaults, supplied) {
32
145
  if (defaults === undefined)
33
146
  return supplied;
34
147
  if (supplied === undefined)
35
148
  return defaults;
149
+ if (!isRecord(defaults) || !isRecord(supplied)) {
150
+ throw new Error("预设创建输入只能通过对象进行补充");
151
+ }
36
152
  return { ...defaults, ...supplied };
37
153
  }
38
- function fail(phase, error, diagnostic) {
39
- return {
40
- status: "operation-failure",
41
- phase,
42
- error: {
43
- message: error instanceof Error ? error.message : String(error),
44
- ...(diagnostic === undefined ? {} : { diagnostic }),
45
- },
154
+ function excludedPackagePaths(definition, selectedPaths) {
155
+ return selectedPaths
156
+ .filter((candidate) => isNestedDirectory(definition.path, candidate))
157
+ .map((candidate) => definition.path === "."
158
+ ? candidate
159
+ : candidate.slice(definition.path.length + 1));
160
+ }
161
+ function packageNodePaths(roots) {
162
+ const paths = [];
163
+ const visited = new Set();
164
+ const visit = (root) => {
165
+ if (visited.has(root))
166
+ return;
167
+ visited.add(root);
168
+ paths.push(root.definition.path);
169
+ for (const dependency of root.dependencies) {
170
+ visit(dependency.package);
171
+ }
46
172
  };
173
+ for (const root of roots)
174
+ visit(root);
175
+ return paths;
47
176
  }
48
- class AdditionPlanningFailure extends Error {
49
- constructor(error) {
50
- super(error instanceof Error ? error.message : String(error), {
51
- cause: error,
177
+ function assertAcyclicPackageDrafts(roots, explicitlySelectedSharedReferences) {
178
+ const visiting = new Set();
179
+ const completed = new Map();
180
+ const packageIdFor = (node, parentId, dependencyKey) => {
181
+ if (node.restored !== undefined) {
182
+ return node.restored.packageDefinitionId;
183
+ }
184
+ const identityKey = contentIdentityKey(node.content.identity);
185
+ const shared = node.content.definition.instance === "shared";
186
+ const explicitRoot = shared ? undefined : node.explicitRoot;
187
+ const createdBy = explicitRoot?.createdBy ??
188
+ (shared
189
+ ? explicitlySelectedSharedReferences.get(identityKey)
190
+ : undefined) ??
191
+ (parentId === undefined ? "initialization" : "shared-dependency");
192
+ const discriminator = shared
193
+ ? "shared-reference"
194
+ : explicitRoot === undefined
195
+ ? parentId === undefined || dependencyKey === undefined
196
+ ? undefined
197
+ : `${parentId}:${dependencyKey}`
198
+ : `${explicitRoot.selectionId}:${explicitRoot.nodeIdentity}`;
199
+ if (discriminator === undefined) {
200
+ throw new Error("参考包实例缺少明确的创建地址");
201
+ }
202
+ return packageId({
203
+ contentIdentity: node.content.identity,
204
+ definition: node.definition,
205
+ creationInput: node.creationInput ?? null,
206
+ createdBy,
207
+ discriminator,
52
208
  });
53
- }
54
- }
55
- function readJson(value, label) {
56
- if (!isRecord(value))
57
- throw new Error(label + " must be an object");
58
- return value;
59
- }
60
- function presetSelectionKey(identity) {
61
- return contentIdentityKey(identity);
62
- }
63
- function parsePresetSelections(value) {
64
- if (!Array.isArray(value))
65
- throw new Error("生成记录的预设选择无效");
66
- const seen = new Set();
67
- return value.map((item) => {
68
- const selection = readJson(item, "生成记录预设选择");
69
- assertContentIdentity(selection);
70
- const key = presetSelectionKey(selection);
71
- if (seen.has(key))
72
- throw new Error("生成记录的预设选择重复");
73
- seen.add(key);
74
- return { ...selection };
75
- });
76
- }
77
- export function parseGenerationRecord(value) {
78
- const record = parseGenerationRecordStructure(value);
79
- const nodeInstances = record.nodeInstances;
80
- const packageIds = new Set();
81
- for (const packageRecord of record.packages) {
82
- assertContentIdentity(packageRecord.contentIdentity);
83
- if (packageIds.has(packageRecord.packageDefinitionId)) {
84
- throw new Error("生成记录包含重复包实例:" + packageRecord.packageDefinitionId);
85
- }
86
- packageIds.add(packageRecord.packageDefinitionId);
87
- }
88
- for (const packageRecord of record.packages) {
89
- for (const [identity, packageDefinitionId] of Object.entries(packageRecord.bindings)) {
90
- if (identity.length === 0 || !packageIds.has(packageDefinitionId)) {
91
- throw new Error(`生成记录中的内容 ${contentIdentityLabel(packageRecord.contentIdentity)} 包含无效实例绑定:${identity}`);
209
+ };
210
+ const visit = (node, parentId, dependencyKey) => {
211
+ const id = packageIdFor(node, parentId, dependencyKey);
212
+ if (visiting.has(id)) {
213
+ throw new Error("预设节点依赖形成循环");
214
+ }
215
+ const edges = node.dependencies.map((dependency) => ({
216
+ key: dependency.key,
217
+ packageId: packageIdFor(dependency.package, id, dependency.key),
218
+ }));
219
+ const previousEdges = completed.get(id);
220
+ if (previousEdges !== undefined) {
221
+ if (!isDeepStrictEqual(previousEdges, edges)) {
222
+ throw new Error("共享参考包的依赖绑定不一致");
92
223
  }
224
+ return;
93
225
  }
94
- }
95
- for (const [nodeIdentity, packageDefinitionId] of Object.entries(nodeInstances)) {
96
- if (nodeIdentity.length === 0 ||
97
- typeof packageDefinitionId !== "string" ||
98
- !packageIds.has(packageDefinitionId)) {
99
- throw new Error("生成记录的节点实例映射无效");
226
+ visiting.add(id);
227
+ for (const dependency of node.dependencies) {
228
+ visit(dependency.package, id, dependency.key);
100
229
  }
101
- }
102
- const presetSelections = parsePresetSelections(record.presetSelections);
103
- return {
104
- schemaVersion: 4,
105
- strategyIdentity: record.strategyIdentity,
106
- strategyState: record.strategyState,
107
- packages: record.packages,
108
- nodeInstances: nodeInstances,
109
- presetSelections,
230
+ visiting.delete(id);
231
+ completed.set(id, edges);
110
232
  };
233
+ for (const root of roots)
234
+ visit(root);
111
235
  }
112
- function packageId(options) {
113
- const facts = {
114
- domain: "ykdz.template.generator.package-instance.v1",
115
- contentIdentity: options.contentIdentity,
116
- createdBy: options.createdBy,
117
- definition: options.definition,
118
- };
119
- let nonce = 0;
120
- for (;;) {
121
- const value = nonce === 0
122
- ? facts
123
- : { facts, occupied: [...options.occupied].toSorted(), nonce };
124
- const candidate = "package-" +
125
- createHash("sha256").update(JSON.stringify(value)).digest("hex");
126
- if (!options.occupied.has(candidate)) {
127
- return candidate;
128
- }
129
- nonce += 1;
236
+ function requireUniqueNodes(roots) {
237
+ const seen = new Set();
238
+ for (const root of roots) {
239
+ if (!/^[a-z][a-z0-9-]*$/u.test(root.nodeIdentity)) {
240
+ throw new Error(`选择节点标识无效:${root.nodeIdentity}`);
241
+ }
242
+ if (seen.has(root.nodeIdentity)) {
243
+ throw new Error(`选择节点标识必须唯一:${root.nodeIdentity}`);
244
+ }
245
+ seen.add(root.nodeIdentity);
130
246
  }
131
247
  }
132
248
  export function createGenerator(options) {
249
+ assertContentIdentity(options.composition.identity);
133
250
  const contentIndex = createContentIndex(options.content);
134
- const contentMembers = contentIndex.members.filter((member) => member.kind === "reference");
135
- const presetMembers = contentIndex.members.filter(isLoadedPreset);
136
- const contentByIdentity = new Map(contentMembers.map((content) => [
137
- contentIdentityKey(content.identity),
138
- content,
139
- ]));
140
- const preparations = new WeakMap();
141
- const preparedDefinitions = new WeakSet();
142
- const prepareContent = (content) => {
143
- const definition = content.definition;
144
- if (preparedDefinitions.has(definition))
145
- return preparations.get(definition);
146
- const preparation = definition.prepare?.();
147
- preparations.set(definition, preparation);
148
- preparedDefinitions.add(definition);
149
- return preparation;
251
+ const composition = options.composition;
252
+ const emptyProjectProjection = {
253
+ entries: [],
254
+ reconciliation: [],
150
255
  };
151
- const presetsByIdentity = new Map();
152
- for (const presetMember of presetMembers) {
153
- const preset = presetMember.definition;
154
- const identityKey = contentIdentityKey(presetMember.identity);
155
- if (presetsByIdentity.has(identityKey)) {
156
- throw new Error(`预设规范身份重复:${contentIdentityLabel(presetMember.identity)}`);
157
- }
158
- presetsByIdentity.set(identityKey, presetMember);
159
- for (const node of Object.values(preset.nodes)) {
160
- try {
161
- contentIndex.fromDefinition(node.reference, "reference", {
162
- namespace: presetMember.identity.namespace,
256
+ const pendingPlans = new WeakMap();
257
+ const readMetadataFact = async (targetRoot, metadataPath) => {
258
+ const filePath = path.join(targetRoot, metadataPath);
259
+ try {
260
+ const stat = await lstat(filePath);
261
+ if (!stat.isFile()) {
262
+ return {
263
+ path: metadataPath,
264
+ kind: stat.isDirectory()
265
+ ? "directory"
266
+ : stat.isSymbolicLink()
267
+ ? "symbolic-link"
268
+ : "other",
269
+ };
270
+ }
271
+ return {
272
+ path: metadataPath,
273
+ kind: "file",
274
+ content: new Uint8Array(await readFile(filePath)),
275
+ mode: stat.mode & 0o111,
276
+ };
277
+ }
278
+ catch (error) {
279
+ if (error instanceof Error &&
280
+ "code" in error &&
281
+ (error.code === "ENOENT" || error.code === "ENOTDIR")) {
282
+ return { path: metadataPath, kind: "missing" };
283
+ }
284
+ throw error;
285
+ }
286
+ };
287
+ const readRestoredProject = async (targetRoot) => {
288
+ const paths = [
289
+ generatorMetadataPaths.blueprint,
290
+ generatorMetadataPaths.generationRecord,
291
+ ];
292
+ const readFacts = await Promise.all(paths.map((metadataPath) => readMetadataFact(targetRoot, metadataPath)));
293
+ const [blueprintFact, generationRecordFact] = readFacts;
294
+ if (blueprintFact?.kind !== "file" ||
295
+ generationRecordFact?.kind !== "file") {
296
+ throw new Error("目标项目缺少可读取的 schema4 蓝图或 schema6 生成记录");
297
+ }
298
+ let blueprintValue;
299
+ let generationRecordValue;
300
+ try {
301
+ blueprintValue = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(blueprintFact.content));
302
+ generationRecordValue = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(generationRecordFact.content));
303
+ }
304
+ catch (error) {
305
+ throw new Error(`生成元数据不是有效 JSON:${errorMessage(error)}`, {
306
+ cause: error,
307
+ });
308
+ }
309
+ const blueprint = assertProjectBlueprint(blueprintValue);
310
+ const generationRecord = parseGenerationRecordStructure(generationRecordValue);
311
+ assertGenerationRecordMatchesBlueprint(generationRecord, blueprint);
312
+ return { restored: { blueprint, generationRecord }, readFacts };
313
+ };
314
+ const resolveReference = (selector) => contentIndex.resolve(selector, "reference");
315
+ const normalizeDependencyIdentity = (consumer, dependency, cache) => {
316
+ const cacheKey = dependencyIdentityCacheKey(consumer.identity, dependency.key);
317
+ const cached = cache.get(cacheKey);
318
+ if (cached !== undefined)
319
+ return cached.contentIdentity;
320
+ const identity = resolveReferenceDependencyIdentity({
321
+ consumerIdentity: consumer.identity,
322
+ dependency,
323
+ members: contentIndex.members,
324
+ });
325
+ cache.set(cacheKey, {
326
+ consumerContentIdentity: consumer.identity,
327
+ key: dependency.key,
328
+ contentIdentity: identity,
329
+ });
330
+ return identity;
331
+ };
332
+ const createPackageNodeDraft = (request) => {
333
+ const identityKey = contentIdentityKey(request.content.identity);
334
+ const sharedKey = request.content.definition.instance === "shared"
335
+ ? identityKey
336
+ : undefined;
337
+ const cached = sharedKey === undefined
338
+ ? undefined
339
+ : request.sharedDrafts?.get(sharedKey);
340
+ if (cached !== undefined) {
341
+ if (!isDeepStrictEqual(cached.definition, request.definition) ||
342
+ !isDeepStrictEqual(cached.creationInput ?? null, request.creationInput ?? null)) {
343
+ throw new Error(`共享参考包的创建事实不一致:${contentIdentityLabel(request.content.identity)}`);
344
+ }
345
+ return {
346
+ ...cached,
347
+ nodeIdentity: request.nodeIdentity,
348
+ layout: request.layout,
349
+ ...(request.explicitRoot === undefined
350
+ ? {}
351
+ : { explicitRoot: request.explicitRoot }),
352
+ dependencies: [...cached.dependencies],
353
+ };
354
+ }
355
+ const draft = {
356
+ content: request.content,
357
+ definition: request.definition,
358
+ creationInput: request.creationInput,
359
+ layout: request.layout,
360
+ nodeIdentity: request.nodeIdentity,
361
+ ...(request.explicitRoot === undefined
362
+ ? {}
363
+ : { explicitRoot: request.explicitRoot }),
364
+ ...(request.restored === undefined ? {} : { restored: request.restored }),
365
+ dependencies: [],
366
+ };
367
+ if (sharedKey !== undefined)
368
+ request.sharedDrafts?.set(sharedKey, draft);
369
+ return draft;
370
+ };
371
+ const populatePackageNodeDraft = (options) => {
372
+ const { draft } = options;
373
+ const identityKey = contentIdentityKey(draft.content.identity);
374
+ if (options.ancestry.includes(identityKey)) {
375
+ throw new Error(`参考包依赖形成循环:${[...options.ancestry, identityKey].join(" → ")}`);
376
+ }
377
+ const dependencies = draft.content.definition.dependencies ?? [];
378
+ const dependencyKeys = new Set();
379
+ const bindings = options.dependencyBindings ?? {};
380
+ const bindingEntries = Object.entries(bindings);
381
+ for (const [key, target] of bindingEntries) {
382
+ if (key.trim().length === 0) {
383
+ throw new Error(`选择节点依赖绑定无效:${draft.nodeIdentity}/${key}`);
384
+ }
385
+ if (typeof target === "string") {
386
+ if (target.trim().length === 0 ||
387
+ !options.explicitTargets?.has(target)) {
388
+ throw new Error(`选择节点依赖绑定目标不存在:${draft.nodeIdentity}/${key}`);
389
+ }
390
+ }
391
+ else if (!isRecord(target) ||
392
+ typeof target.packageDefinitionId !== "string" ||
393
+ target.packageDefinitionId.trim().length === 0 ||
394
+ !options.restoredTargets?.has(target.packageDefinitionId)) {
395
+ throw new Error(`选择节点依赖绑定目标不存在:${draft.nodeIdentity}/${key}`);
396
+ }
397
+ }
398
+ const populated = [];
399
+ const restoredDependencies = draft.restored === undefined
400
+ ? new Map()
401
+ : new Map(draft.dependencies.map((dependency) => [
402
+ dependency.key,
403
+ dependency.package,
404
+ ]));
405
+ for (const dependency of dependencies) {
406
+ if (dependency.key.trim().length === 0 ||
407
+ dependencyKeys.has(dependency.key)) {
408
+ throw new Error(`参考包依赖键不能为空且不能重复:${dependency.key}`);
409
+ }
410
+ dependencyKeys.add(dependency.key);
411
+ const providerIdentity = normalizeDependencyIdentity(draft.content, dependency, options.dependencyIdentities);
412
+ const restoredDependency = restoredDependencies.get(dependency.key);
413
+ const bindingTarget = bindings[dependency.key];
414
+ if (bindingTarget !== undefined) {
415
+ const selectedTarget = typeof bindingTarget === "string"
416
+ ? options.explicitTargets?.get(bindingTarget)
417
+ : options.restoredTargets?.get(bindingTarget.packageDefinitionId);
418
+ if (selectedTarget === undefined) {
419
+ throw new Error(`选择节点依赖绑定目标不存在:${draft.nodeIdentity}/${dependency.key}`);
420
+ }
421
+ if (contentIdentityKey(selectedTarget.content.identity) !==
422
+ contentIdentityKey(providerIdentity)) {
423
+ throw new Error(`选择节点依赖绑定身份不一致:${draft.nodeIdentity}/${dependency.key}`);
424
+ }
425
+ if (dependency.creationInput !== undefined) {
426
+ const expectedInput = requireParsedCreationInput(selectedTarget.content, dependency.creationInput);
427
+ if (!isDeepStrictEqual(selectedTarget.creationInput ?? null, expectedInput ?? null)) {
428
+ throw new Error(`选择节点依赖创建输入不一致:${draft.nodeIdentity}/${dependency.key}`);
429
+ }
430
+ }
431
+ const selectedTargetNode = selectedTarget.explicitRoot;
432
+ const existingSelection = options.existingSelection;
433
+ const selectedTargetId = selectedTarget.restored?.packageDefinitionId ??
434
+ (selectedTargetNode !== undefined &&
435
+ existingSelection !== undefined &&
436
+ selectedTargetNode.selectionId === existingSelection.selectionId
437
+ ? existingSelection.recordedNodeIds?.[selectedTargetNode.nodeIdentity]
438
+ : undefined);
439
+ if (restoredDependency !== undefined &&
440
+ selectedTargetId !== restoredDependency.restored?.packageDefinitionId) {
441
+ throw new Error(`生成记录中的依赖绑定不一致:${draft.nodeIdentity} → ${dependency.key}`);
442
+ }
443
+ populated.push({
444
+ key: dependency.key,
445
+ package: restoredDependency ?? selectedTarget,
163
446
  });
447
+ continue;
448
+ }
449
+ if (restoredDependency !== undefined) {
450
+ if (contentIdentityKey(restoredDependency.content.identity) !==
451
+ contentIdentityKey(providerIdentity)) {
452
+ throw new Error(`生成记录包含无效依赖绑定:${draft.nodeIdentity} → ${dependency.key}`);
453
+ }
454
+ if (dependency.creationInput !== undefined) {
455
+ const expectedInput = requireParsedCreationInput(restoredDependency.content, dependency.creationInput);
456
+ if (!isDeepStrictEqual(restoredDependency.creationInput ?? null, expectedInput ?? null)) {
457
+ throw new Error(`生成记录中的依赖创建事实不一致:${draft.nodeIdentity} → ${dependency.key}`);
458
+ }
459
+ }
460
+ populated.push({ key: dependency.key, package: restoredDependency });
461
+ continue;
462
+ }
463
+ const provider = resolveReference(providerIdentity);
464
+ const providerCreationInput = requireParsedCreationInput(provider, dependency.creationInput);
465
+ const providerDefinition = packageDefinition(provider.definition.createDefinition({
466
+ conventions: options.conventions,
467
+ creationInput: providerCreationInput,
468
+ }));
469
+ const providerNode = createPackageNodeDraft({
470
+ content: provider,
471
+ nodeIdentity: `${draft.nodeIdentity}-${dependency.key}`,
472
+ creationInput: providerCreationInput,
473
+ definition: providerDefinition,
474
+ layout: undefined,
475
+ sharedDrafts: options.sharedDrafts,
476
+ });
477
+ populatePackageNodeDraft({
478
+ draft: providerNode,
479
+ conventions: options.conventions,
480
+ ancestry: [...options.ancestry, identityKey],
481
+ sharedDrafts: options.sharedDrafts,
482
+ dependencyIdentities: options.dependencyIdentities,
483
+ ...(options.existingSelection === undefined
484
+ ? {}
485
+ : { existingSelection: options.existingSelection }),
486
+ });
487
+ populated.push({ key: dependency.key, package: providerNode });
488
+ }
489
+ if (draft.restored !== undefined) {
490
+ for (const dependency of draft.dependencies) {
491
+ if (!dependencyKeys.has(dependency.key))
492
+ populated.push(dependency);
164
493
  }
165
- catch (error) {
166
- throw new Error(`预设${contentIdentityLabel(presetMember.identity)}引用未装载的来源定义:${error instanceof Error ? error.message : String(error)}`, { cause: error });
494
+ }
495
+ for (const [key] of bindingEntries) {
496
+ if (!dependencyKeys.has(key)) {
497
+ throw new Error(`选择节点依赖绑定键不存在:${draft.nodeIdentity}/${key}`);
167
498
  }
168
499
  }
169
- }
170
- function requireContent(selector) {
171
- return contentIndex.resolve(selector, "reference");
172
- }
173
- function resolvePreset(selector) {
174
- const member = isPresetDefinition(selector)
175
- ? contentIndex.fromDefinition(selector, "preset")
176
- : contentIndex.resolve(selector, "preset");
177
- return member;
178
- }
179
- function expandPreset(options_) {
180
- const preset = options_.preset.definition;
181
- if (!preset.operations.includes(options_.operation)) {
182
- throw new Error(`预设不支持${options_.operation}操作`);
183
- }
184
- const nodes = Object.entries(preset.nodes);
185
- if ((options_.creationInput !== undefined ||
186
- options_.configuration !== undefined) &&
187
- nodes.length !== 1) {
188
- throw new Error("多节点预设不能接收单一包创建输入");
189
- }
190
- return nodes.map(([nodeIdentity, node]) => {
191
- const creationInput = mergeCreationInput(node.creationInput?.[options_.operation], options_.creationInput);
192
- const reference = contentIndex.fromDefinition(node.reference, "reference", { namespace: options_.preset.identity.namespace });
500
+ draft.dependencies = populated;
501
+ };
502
+ const preparePackageNode = async (draft, selectedPaths, preparedDrafts) => {
503
+ const existing = preparedDrafts.get(draft);
504
+ if (existing !== undefined)
505
+ return existing;
506
+ const pending = (async () => {
507
+ const preparedDependencies = [];
508
+ for (const dependency of draft.dependencies) {
509
+ preparedDependencies.push({
510
+ key: dependency.key,
511
+ package: await preparePackageNode(dependency.package, selectedPaths, preparedDrafts),
512
+ });
513
+ }
514
+ const prepared = preparationSnapshot(await draft.content.definition.prepare({
515
+ excludedPackagePaths: excludedPackagePaths(draft.definition, selectedPaths),
516
+ }));
193
517
  return {
194
- nodeIdentity,
195
- contentIdentity: reference.identity,
196
- ...(node.layout === undefined ? {} : { layout: node.layout }),
197
- ...(creationInput === undefined ? {} : { creationInput }),
198
- configuration: options_.configuration === undefined
199
- ? node.configuration?.[options_.operation]
200
- : options_.configuration,
518
+ content: draft.content,
519
+ preparation: prepared,
520
+ definition: draft.definition,
521
+ creationInput: draft.creationInput,
522
+ layout: draft.layout,
523
+ nodeIdentity: draft.nodeIdentity,
524
+ ...(draft.explicitRoot === undefined
525
+ ? {}
526
+ : { explicitRoot: draft.explicitRoot }),
527
+ ...(draft.restored === undefined ? {} : { restored: draft.restored }),
528
+ dependencies: preparedDependencies,
201
529
  };
202
- });
203
- }
204
- function findByPackageId(records, id) {
205
- const record = records.find((candidate) => candidate.packageDefinitionId === id);
206
- if (record === undefined) {
207
- throw new Error("生成记录引用了不存在的包实例:" + id);
530
+ })();
531
+ preparedDrafts.set(draft, pending);
532
+ return pending;
533
+ };
534
+ const restoredSelectionDrafts = (restored, dependencyIdentities = new Map()) => {
535
+ const { generationRecord, blueprint } = restored;
536
+ for (const requirement of restored.normalizedDependencies ?? []) {
537
+ const key = dependencyIdentityCacheKey(requirement.consumerContentIdentity, requirement.key);
538
+ const existing = dependencyIdentities.get(key);
539
+ if (existing !== undefined &&
540
+ contentIdentityKey(existing.contentIdentity) !==
541
+ contentIdentityKey(requirement.contentIdentity)) {
542
+ throw new Error("缓存的内容依赖身份不一致");
543
+ }
544
+ dependencyIdentities.set(key, requirement);
208
545
  }
209
- return record;
210
- }
211
- function normalizeConfiguration(content, input) {
212
- if (content.definition.normalizeConfiguration !== undefined)
213
- return content.definition.normalizeConfiguration(input) ?? null;
214
- if (input !== undefined && input !== null)
215
- throw new Error(`内容 ${contentIdentityLabel(content.identity)} 不支持实例配置`);
216
- return null;
217
- }
218
- function resolvePackageStates(records, blueprint) {
546
+ if (contentIdentityKey(generationRecord.composition.identity) !==
547
+ contentIdentityKey(composition.identity)) {
548
+ throw new Error("目标项目使用了不兼容的组合定义");
549
+ }
550
+ assertGenerationRecordMatchesBlueprint(generationRecord, blueprint);
551
+ const conventions = composition.parseConventions(generationRecord.composition.conventions);
552
+ assertJsonValue(conventions, "组合约定");
553
+ if (!isDeepStrictEqual(conventions, generationRecord.composition.conventions)) {
554
+ throw new Error("生成记录中的组合约定不符合当前组合定义");
555
+ }
556
+ const recordsById = new Map(generationRecord.packages.map((item) => [item.packageDefinitionId, item]));
219
557
  const definitionsById = new Map(blueprint.packages.map((definition) => [
220
558
  definition.packageDefinitionId,
221
559
  definition,
222
560
  ]));
223
- if (definitionsById.size !== records.length) {
224
- throw new Error("生成记录与蓝图的包实例数量不一致");
561
+ const contentsById = new Map();
562
+ const inputsById = new Map();
563
+ const draftsById = new Map();
564
+ const sharedIdentities = new Set();
565
+ for (const item of generationRecord.packages) {
566
+ const content = resolveReference(item.contentIdentity);
567
+ const definition = definitionsById.get(item.packageDefinitionId);
568
+ if (definition === undefined) {
569
+ throw new Error(`项目蓝图缺少包实例:${item.packageDefinitionId}`);
570
+ }
571
+ const creationInput = item.creationInput === null
572
+ ? undefined
573
+ : requireParsedCreationInput(content, item.creationInput);
574
+ if (!isDeepStrictEqual(creationInput ?? null, item.creationInput)) {
575
+ throw new Error(`生成记录中的创建事实不规范:${item.packageDefinitionId}`);
576
+ }
577
+ contentsById.set(item.packageDefinitionId, content);
578
+ inputsById.set(item.packageDefinitionId, creationInput);
579
+ if (content.definition.instance === "shared") {
580
+ const identity = contentIdentityKey(content.identity);
581
+ if (sharedIdentities.has(identity)) {
582
+ throw new Error(`共享参考包必须只有一个实例:${contentIdentityLabel(content.identity)}`);
583
+ }
584
+ sharedIdentities.add(identity);
585
+ }
225
586
  }
226
- for (const definition of blueprint.packages) {
227
- if (!records.some((record) => record.packageDefinitionId === definition.packageDefinitionId)) {
228
- throw new Error(`蓝图包实例缺少生成记录事实:${definition.packageDefinitionId}`);
587
+ const explicitBindingsByConsumer = new Map();
588
+ for (const selection of generationRecord.selections) {
589
+ if (selection.presetIdentity === null)
590
+ continue;
591
+ const preset = contentIndex.resolve(selection.presetIdentity, "preset");
592
+ const definition = preset.definition;
593
+ if (!isRecord(definition) ||
594
+ definition.kind !== "preset" ||
595
+ !isRecord(definition.nodes)) {
596
+ throw new Error(`预设定义无效:${contentIdentityLabel(preset.identity)}`);
229
597
  }
598
+ const presetNodes = Object.entries(definition.nodes);
599
+ if (presetNodes.length !== Object.keys(selection.nodes).length ||
600
+ presetNodes.some(([nodeIdentity]) => !Object.hasOwn(selection.nodes, nodeIdentity))) {
601
+ throw new Error(`生成记录中的预设选择与当前定义不一致:${contentIdentityLabel(preset.identity)}`);
602
+ }
603
+ for (const [nodeIdentity, rawNode] of presetNodes) {
604
+ if (!isRecord(rawNode) || !isRecord(rawNode.reference)) {
605
+ throw new Error(`预设节点定义无效:${nodeIdentity}`);
606
+ }
607
+ const consumerId = selection.nodes[nodeIdentity];
608
+ const consumerRecord = consumerId === undefined ? undefined : recordsById.get(consumerId);
609
+ const consumer = consumerId === undefined ? undefined : contentsById.get(consumerId);
610
+ const expected = resolveReference({
611
+ alias: String(rawNode.reference.alias),
612
+ namespace: preset.identity.namespace,
613
+ });
614
+ if (consumerId === undefined ||
615
+ consumerRecord === undefined ||
616
+ consumer === undefined ||
617
+ contentIdentityKey(consumer.identity) !==
618
+ contentIdentityKey(expected.identity)) {
619
+ throw new Error(`生成记录中的预设节点引用不一致:${nodeIdentity}`);
620
+ }
621
+ const rawBindings = rawNode.dependencyBindings;
622
+ if (rawBindings === undefined)
623
+ continue;
624
+ if (!isRecord(rawBindings)) {
625
+ throw new Error(`预设节点依赖绑定无效:${nodeIdentity}`);
626
+ }
627
+ const declarations = consumer.definition.dependencies ?? [];
628
+ const declaredKeys = new Set(declarations.map(({ key }) => key));
629
+ for (const [key, targetNodeIdentity] of Object.entries(rawBindings)) {
630
+ if (key.trim().length === 0 ||
631
+ typeof targetNodeIdentity !== "string" ||
632
+ targetNodeIdentity.trim().length === 0) {
633
+ throw new Error(`预设节点依赖绑定无效:${nodeIdentity}/${key}`);
634
+ }
635
+ if (!declaredKeys.has(key)) {
636
+ throw new Error(`预设节点依赖绑定键不存在:${nodeIdentity}/${key}`);
637
+ }
638
+ const providerId = selection.nodes[targetNodeIdentity];
639
+ const providerRecord = providerId === undefined ? undefined : recordsById.get(providerId);
640
+ const provider = providerId === undefined ? undefined : contentsById.get(providerId);
641
+ const dependency = declarations.find((item) => item.key === key);
642
+ if (providerId === undefined ||
643
+ providerRecord === undefined ||
644
+ provider === undefined ||
645
+ dependency === undefined) {
646
+ throw new Error(`预设节点依赖绑定目标不存在:${nodeIdentity}/${key}`);
647
+ }
648
+ const expectedIdentity = normalizeDependencyIdentity(consumer, dependency, dependencyIdentities);
649
+ if (contentIdentityKey(provider.identity) !==
650
+ contentIdentityKey(expectedIdentity) ||
651
+ consumerRecord.dependencyBindings[key] !== providerId) {
652
+ throw new Error(`生成记录中的预设节点依赖绑定不一致:${consumerId} → ${key}`);
653
+ }
654
+ const bindings = explicitBindingsByConsumer.get(consumerId) ?? new Map();
655
+ const existingProviderId = bindings.get(key);
656
+ if (existingProviderId !== undefined &&
657
+ existingProviderId !== providerId) {
658
+ throw new Error(`生成记录中的预设节点依赖绑定不一致:${consumerId} → ${key}`);
659
+ }
660
+ bindings.set(key, providerId);
661
+ explicitBindingsByConsumer.set(consumerId, bindings);
662
+ }
663
+ }
664
+ }
665
+ const visiting = new Set();
666
+ const buildDraft = (id) => {
667
+ const existing = draftsById.get(id);
668
+ if (existing !== undefined)
669
+ return existing;
670
+ if (visiting.has(id))
671
+ throw new Error("生成记录依赖包含循环");
672
+ const item = recordsById.get(id);
673
+ const persistedDefinition = definitionsById.get(id);
674
+ const content = contentsById.get(id);
675
+ if (item === undefined ||
676
+ persistedDefinition === undefined ||
677
+ content === undefined) {
678
+ throw new Error(`生成记录引用了未知包实例:${id}`);
679
+ }
680
+ visiting.add(id);
681
+ const declarations = content.definition.dependencies ?? [];
682
+ const declaredKeys = new Set();
683
+ for (const dependency of declarations) {
684
+ if (dependency.key.trim().length === 0 ||
685
+ declaredKeys.has(dependency.key)) {
686
+ throw new Error(`参考包依赖键不能为空且不能重复:${dependency.key}`);
687
+ }
688
+ declaredKeys.add(dependency.key);
689
+ }
690
+ const recordedBindings = Object.entries(item.dependencyBindings);
691
+ if (recordedBindings.some(([key]) => key.trim().length === 0)) {
692
+ throw new Error(`生成记录中的依赖绑定与当前参考包不一致:${id}`);
693
+ }
694
+ const recordedKeys = new Set(recordedBindings.map(([key]) => key));
695
+ if (declarations.some(({ key }) => !recordedKeys.has(key))) {
696
+ throw new Error(`生成记录中的依赖绑定与当前参考包不一致:${id}`);
697
+ }
698
+ const dependencies = recordedBindings.map(([key, providerId]) => {
699
+ const providerRecord = providerId === undefined ? undefined : recordsById.get(providerId);
700
+ const providerContent = providerId === undefined ? undefined : contentsById.get(providerId);
701
+ if (providerId === undefined ||
702
+ providerRecord === undefined ||
703
+ providerContent === undefined) {
704
+ throw new Error(`生成记录包含无效依赖绑定:${id} → ${key}`);
705
+ }
706
+ const dependency = declarations.find((item) => item.key === key);
707
+ if (dependency !== undefined) {
708
+ const consumer = contentsById.get(id);
709
+ if (consumer === undefined) {
710
+ throw new Error(`生成记录引用了未知内容实例:${id}`);
711
+ }
712
+ const declaredIdentity = normalizeDependencyIdentity(consumer, dependency, dependencyIdentities);
713
+ if (contentIdentityKey(providerContent.identity) !==
714
+ contentIdentityKey(declaredIdentity)) {
715
+ throw new Error(`生成记录包含无效依赖绑定:${id} → ${key}`);
716
+ }
717
+ const explicitProviderId = explicitBindingsByConsumer
718
+ .get(id)
719
+ ?.get(key);
720
+ if (explicitProviderId !== undefined &&
721
+ providerId !== explicitProviderId) {
722
+ throw new Error(`生成记录中的预设节点依赖绑定不一致:${id} → ${key}`);
723
+ }
724
+ const expectedInput = requireParsedCreationInput(providerContent, dependency.creationInput);
725
+ if (dependency.creationInput !== undefined &&
726
+ !isDeepStrictEqual(inputsById.get(providerId) ?? null, expectedInput ?? null)) {
727
+ throw new Error(`生成记录中的依赖创建事实不一致:${id} → ${key}`);
728
+ }
729
+ }
730
+ return { key, package: buildDraft(providerId) };
731
+ });
732
+ visiting.delete(id);
733
+ const { packageDefinitionId: _id, ...definition } = persistedDefinition;
734
+ const draft = {
735
+ content,
736
+ definition,
737
+ creationInput: inputsById.get(id),
738
+ layout: undefined,
739
+ nodeIdentity: `restored-${id}`,
740
+ restored: {
741
+ packageDefinitionId: id,
742
+ createdBy: item.createdBy,
743
+ },
744
+ dependencies,
745
+ };
746
+ draftsById.set(id, draft);
747
+ return draft;
748
+ };
749
+ const reachable = new Set();
750
+ const collectReachable = (id) => {
751
+ if (reachable.has(id))
752
+ return;
753
+ reachable.add(id);
754
+ const item = recordsById.get(id);
755
+ if (item === undefined)
756
+ throw new Error(`未知包实例:${id}`);
757
+ for (const providerId of Object.values(item.dependencyBindings)) {
758
+ collectReachable(providerId);
759
+ }
760
+ };
761
+ const result = generationRecord.selections.map((selection) => {
762
+ const nodeEntries = Object.entries(selection.nodes);
763
+ requireUniqueNodes(nodeEntries.map(([nodeIdentity]) => ({ nodeIdentity })));
764
+ if (selection.presetIdentity !== null) {
765
+ const preset = contentIndex.resolve(selection.presetIdentity, "preset");
766
+ const definition = preset.definition;
767
+ if (!isRecord(definition) ||
768
+ definition.kind !== "preset" ||
769
+ !isRecord(definition.nodes)) {
770
+ throw new Error(`预设定义无效:${contentIdentityLabel(preset.identity)}`);
771
+ }
772
+ const presetNodes = Object.entries(definition.nodes);
773
+ if (presetNodes.length !== nodeEntries.length ||
774
+ presetNodes.some(([nodeIdentity]) => !Object.hasOwn(selection.nodes, nodeIdentity))) {
775
+ throw new Error(`生成记录中的预设选择与当前定义不一致:${contentIdentityLabel(preset.identity)}`);
776
+ }
777
+ for (const [nodeIdentity, node] of presetNodes) {
778
+ if (!isRecord(node) || !isRecord(node.reference)) {
779
+ throw new Error(`预设节点定义无效:${nodeIdentity}`);
780
+ }
781
+ const rootRecord = recordsById.get(selection.nodes[nodeIdentity]);
782
+ const rootContent = rootRecord === undefined
783
+ ? undefined
784
+ : contentsById.get(rootRecord.packageDefinitionId);
785
+ const expected = resolveReference({
786
+ alias: String(node.reference.alias),
787
+ namespace: preset.identity.namespace,
788
+ });
789
+ if (rootContent === undefined ||
790
+ contentIdentityKey(rootContent.identity) !==
791
+ contentIdentityKey(expected.identity)) {
792
+ throw new Error(`生成记录中的预设节点引用不一致:${nodeIdentity}`);
793
+ }
794
+ }
795
+ }
796
+ const roots = nodeEntries.map(([nodeIdentity, id]) => {
797
+ collectReachable(id);
798
+ return { ...buildDraft(id), nodeIdentity };
799
+ });
800
+ // 规范化 JSON 会按键名排序 nodes,无法从记录恢复原始根数组顺序。
801
+ return {
802
+ presetIdentity: selection.presetIdentity,
803
+ selectionId: selection.selectionId,
804
+ recordedNodeIds: selection.nodes,
805
+ roots,
806
+ };
807
+ });
808
+ if (reachable.size !== recordsById.size) {
809
+ throw new Error("生成记录包含未被选择引用的包实例");
810
+ }
811
+ return result;
812
+ };
813
+ async function prepareProjectInternal(prepareOptions) {
814
+ const parsedConventions = prepareOptions.restored
815
+ ? composition.parseConventions(prepareOptions.restored.generationRecord.composition.conventions)
816
+ : composition.parseConventions(prepareOptions.conventions);
817
+ const conventions = parsedConventions;
818
+ assertJsonValue(conventions, "组合约定");
819
+ if (prepareOptions.restored &&
820
+ !isDeepStrictEqual(conventions, prepareOptions.restored.generationRecord.composition.conventions)) {
821
+ throw new Error("生成记录中的组合约定不符合当前组合定义");
822
+ }
823
+ const dependencyIdentities = prepareOptions.dependencyIdentities ??
824
+ new Map();
825
+ const selectionDrafts = prepareOptions.restored
826
+ ? restoredSelectionDrafts(prepareOptions.restored, dependencyIdentities)
827
+ : [];
828
+ const restoredTargetsById = new Map();
829
+ const indexRestoredTargets = (roots) => {
830
+ for (const root of roots) {
831
+ if (root.restored !== undefined) {
832
+ restoredTargetsById.set(root.restored.packageDefinitionId, root);
833
+ }
834
+ indexRestoredTargets(root.dependencies.map(({ package: item }) => item));
835
+ }
836
+ };
837
+ for (const selectionDraft of selectionDrafts) {
838
+ indexRestoredTargets(selectionDraft.roots);
839
+ }
840
+ const sharedDrafts = new Map();
841
+ const indexSharedDrafts = (roots) => {
842
+ for (const root of roots) {
843
+ if (root.content.definition.instance === "shared") {
844
+ sharedDrafts.set(contentIdentityKey(root.content.identity), root);
845
+ }
846
+ indexSharedDrafts(root.dependencies.map((item) => item.package));
847
+ }
848
+ };
849
+ for (const selectionDraft of selectionDrafts) {
850
+ indexSharedDrafts(selectionDraft.roots);
851
+ }
852
+ const operation = prepareOptions.operation;
853
+ const createdBy = operation === "init" ? "initialization" : "addition";
854
+ const identifyDraftSelection = (presetIdentity, roots) => selectionId({
855
+ compositionIdentity: composition.identity,
856
+ presetIdentity,
857
+ roots: roots.map((root) => ({
858
+ nodeIdentity: root.nodeIdentity,
859
+ contentIdentity: root.content.identity,
860
+ creationInput: root.creationInput ?? null,
861
+ definition: root.definition,
862
+ })),
863
+ });
864
+ const selectionRootFacts = (root, existingSelection) => {
865
+ const declaredKeys = new Set((root.content.definition.dependencies ?? []).map(({ key }) => key));
866
+ return {
867
+ nodeIdentity: root.nodeIdentity,
868
+ identity: contentIdentityKey(root.content.identity),
869
+ creationInput: root.creationInput ?? null,
870
+ definition: root.definition,
871
+ dependencies: root.dependencies
872
+ .filter(({ key }) => declaredKeys.has(key))
873
+ .map(({ key, package: dependency }) => {
874
+ if (dependency.restored !== undefined) {
875
+ return {
876
+ key,
877
+ target: {
878
+ packageDefinitionId: dependency.restored.packageDefinitionId,
879
+ },
880
+ };
881
+ }
882
+ if (dependency.explicitRoot !== undefined) {
883
+ const packageDefinitionId = dependency.explicitRoot.selectionId ===
884
+ existingSelection.selectionId
885
+ ? existingSelection.recordedNodeIds?.[dependency.explicitRoot.nodeIdentity]
886
+ : undefined;
887
+ return {
888
+ key,
889
+ target: packageDefinitionId === undefined
890
+ ? {
891
+ selectionId: dependency.explicitRoot.selectionId,
892
+ nodeIdentity: dependency.explicitRoot.nodeIdentity,
893
+ }
894
+ : { packageDefinitionId },
895
+ };
896
+ }
897
+ const existingRoot = existingSelection.roots.find((candidate) => candidate.nodeIdentity === root.nodeIdentity);
898
+ const existingDependency = existingRoot?.dependencies.find((candidate) => candidate.key === key)?.package;
899
+ const recordedPackageDefinitionId = existingDependency?.restored?.packageDefinitionId;
900
+ if (existingDependency !== undefined &&
901
+ recordedPackageDefinitionId !== undefined &&
902
+ contentIdentityKey(existingDependency.content.identity) ===
903
+ contentIdentityKey(dependency.content.identity) &&
904
+ isDeepStrictEqual(existingDependency.creationInput ?? null, dependency.creationInput ?? null) &&
905
+ isDeepStrictEqual(existingDependency.definition, dependency.definition)) {
906
+ return {
907
+ key,
908
+ target: { packageDefinitionId: recordedPackageDefinitionId },
909
+ };
910
+ }
911
+ return {
912
+ key,
913
+ target: {
914
+ identity: contentIdentityKey(dependency.content.identity),
915
+ creationInput: dependency.creationInput ?? null,
916
+ definition: dependency.definition,
917
+ },
918
+ };
919
+ })
920
+ .toSorted((left, right) => left.key < right.key ? -1 : left.key > right.key ? 1 : 0),
921
+ };
922
+ };
923
+ const appendSelection = (group) => {
924
+ const existing = selectionDrafts.find((candidate) => candidate.selectionId === group.selectionId);
925
+ if (existing !== undefined) {
926
+ const existingRoots = existing.roots
927
+ .map((root) => selectionRootFacts(root, existing))
928
+ .toSorted((left, right) => left.nodeIdentity < right.nodeIdentity
929
+ ? -1
930
+ : left.nodeIdentity > right.nodeIdentity
931
+ ? 1
932
+ : 0);
933
+ const requestedRoots = group.roots
934
+ .map((root) => selectionRootFacts(root, existing))
935
+ .toSorted((left, right) => left.nodeIdentity < right.nodeIdentity
936
+ ? -1
937
+ : left.nodeIdentity > right.nodeIdentity
938
+ ? 1
939
+ : 0);
940
+ const existingPresetIdentity = existing.presetIdentity === null
941
+ ? null
942
+ : contentIdentityKey(existing.presetIdentity);
943
+ const requestedPresetIdentity = group.presetIdentity === null
944
+ ? null
945
+ : contentIdentityKey(group.presetIdentity);
946
+ if (existingPresetIdentity === requestedPresetIdentity) {
947
+ if (!isDeepStrictEqual(existingRoots, requestedRoots)) {
948
+ throw new Error("相同选择标识对应不同的包创建事实");
949
+ }
950
+ return;
951
+ }
952
+ throw new Error("生成记录包含重复选择标识");
953
+ }
954
+ selectionDrafts.push(group);
955
+ };
956
+ const selection = prepareOptions.selection;
957
+ const directRoots = selection?.roots ?? [];
958
+ if (directRoots.length > 0) {
959
+ const selectedRoots = directRoots.map((root) => ({
960
+ content: resolveReference(root.contentIdentity),
961
+ nodeIdentity: root.nodeIdentity,
962
+ rawCreationInput: root.creationInput,
963
+ layout: root.layout,
964
+ dependencyBindings: root.dependencyBindings,
965
+ }));
966
+ const preparedRoots = selectedRoots.map((root) => {
967
+ const creationInput = requireParsedCreationInput(root.content, root.rawCreationInput);
968
+ return {
969
+ ...root,
970
+ creationInput,
971
+ definition: packageDefinition(root.content.definition.createDefinition({
972
+ conventions,
973
+ creationInput,
974
+ ...(root.layout === undefined ? {} : { layout: root.layout }),
975
+ })),
976
+ };
977
+ });
978
+ const id = identifyDraftSelection(null, preparedRoots);
979
+ const matchedSelection = selectionDrafts.find((candidate) => candidate.selectionId === id);
980
+ const existingSelection = matchedSelection?.selectionId === undefined
981
+ ? undefined
982
+ : {
983
+ selectionId: matchedSelection.selectionId,
984
+ ...(matchedSelection.recordedNodeIds === undefined
985
+ ? {}
986
+ : { recordedNodeIds: matchedSelection.recordedNodeIds }),
987
+ };
988
+ const roots = preparedRoots.map((root) => {
989
+ const explicitRoot = root.content.definition.instance === "independent"
990
+ ? {
991
+ selectionId: id,
992
+ nodeIdentity: root.nodeIdentity,
993
+ createdBy,
994
+ }
995
+ : undefined;
996
+ return createPackageNodeDraft({
997
+ ...root,
998
+ sharedDrafts,
999
+ ...(explicitRoot === undefined ? {} : { explicitRoot }),
1000
+ });
1001
+ });
1002
+ requireUniqueNodes(roots);
1003
+ const rootsByIdentity = new Map(roots.map((root) => [root.nodeIdentity, root]));
1004
+ for (const root of roots) {
1005
+ const dependencyBindings = directRoots.find(({ nodeIdentity }) => nodeIdentity === root.nodeIdentity)?.dependencyBindings;
1006
+ if (dependencyBindings !== undefined && !isRecord(dependencyBindings)) {
1007
+ throw new Error(`选择节点依赖绑定无效:${root.nodeIdentity}`);
1008
+ }
1009
+ populatePackageNodeDraft({
1010
+ draft: root,
1011
+ conventions,
1012
+ ancestry: [],
1013
+ sharedDrafts,
1014
+ dependencyIdentities,
1015
+ explicitTargets: rootsByIdentity,
1016
+ restoredTargets: restoredTargetsById,
1017
+ ...(existingSelection === undefined ? {} : { existingSelection }),
1018
+ ...(dependencyBindings === undefined ? {} : { dependencyBindings }),
1019
+ });
1020
+ }
1021
+ appendSelection({
1022
+ presetIdentity: null,
1023
+ selectionId: id,
1024
+ createdBy: operation === "init" ? "initialization" : "addition",
1025
+ roots,
1026
+ });
1027
+ }
1028
+ for (const presetRequest of selection?.presets ?? []) {
1029
+ const presetMember = contentIndex.resolve(presetRequest.contentIdentity, "preset");
1030
+ const preset = presetMember.definition;
1031
+ if (!isRecord(preset) ||
1032
+ preset.kind !== "preset" ||
1033
+ !isRecord(preset.nodes)) {
1034
+ throw new Error(`预设定义无效:${contentIdentityLabel(presetMember.identity)}`);
1035
+ }
1036
+ const definition = preset;
1037
+ if (!definition.operations.includes(operation)) {
1038
+ throw new Error(`预设不支持${operation === "init" ? "初始化" : "加包"}:${contentIdentityLabel(presetMember.identity)}`);
1039
+ }
1040
+ const entries = Object.entries(definition.nodes);
1041
+ if (entries.length === 0)
1042
+ throw new Error("预设必须至少选择一个软件包节点");
1043
+ if (presetRequest.creationInput !== undefined && entries.length !== 1) {
1044
+ throw new Error("多节点预设不能接收单个软件包创建输入");
1045
+ }
1046
+ const presetRoots = [];
1047
+ for (const [nodeIdentity, node] of entries) {
1048
+ const selectedInput = mergeCreationInput(node.creationInput?.[operation], presetRequest.creationInput);
1049
+ const content = resolveReference({
1050
+ alias: node.reference.alias,
1051
+ namespace: presetMember.identity.namespace,
1052
+ });
1053
+ presetRoots.push({
1054
+ content,
1055
+ nodeIdentity,
1056
+ rawCreationInput: selectedInput,
1057
+ ...(node.layout === undefined ? {} : { layout: node.layout }),
1058
+ });
1059
+ }
1060
+ const preparedRoots = presetRoots.map((root) => {
1061
+ const creationInput = requireParsedCreationInput(root.content, root.rawCreationInput);
1062
+ return {
1063
+ ...root,
1064
+ creationInput,
1065
+ definition: packageDefinition(root.content.definition.createDefinition({
1066
+ conventions,
1067
+ creationInput,
1068
+ ...(root.layout === undefined ? {} : { layout: root.layout }),
1069
+ })),
1070
+ };
1071
+ });
1072
+ const id = identifyDraftSelection(presetMember.identity, preparedRoots);
1073
+ const matchedSelection = selectionDrafts.find((candidate) => candidate.selectionId === id);
1074
+ const existingSelection = matchedSelection?.selectionId === undefined
1075
+ ? undefined
1076
+ : {
1077
+ selectionId: matchedSelection.selectionId,
1078
+ ...(matchedSelection.recordedNodeIds === undefined
1079
+ ? {}
1080
+ : { recordedNodeIds: matchedSelection.recordedNodeIds }),
1081
+ };
1082
+ const rootsByIdentity = new Map();
1083
+ const roots = preparedRoots.map((root) => {
1084
+ const declaration = preset.nodes[root.nodeIdentity];
1085
+ const dependencyBindings = declaration !== undefined && isRecord(declaration)
1086
+ ? declaration.dependencyBindings
1087
+ : undefined;
1088
+ if (dependencyBindings !== undefined && !isRecord(dependencyBindings)) {
1089
+ throw new Error(`预设节点依赖绑定无效:${root.nodeIdentity}`);
1090
+ }
1091
+ const explicitRoot = root.content.definition.instance === "independent"
1092
+ ? {
1093
+ selectionId: id,
1094
+ nodeIdentity: root.nodeIdentity,
1095
+ createdBy,
1096
+ }
1097
+ : undefined;
1098
+ const draft = createPackageNodeDraft({
1099
+ ...root,
1100
+ sharedDrafts,
1101
+ ...(explicitRoot === undefined ? {} : { explicitRoot }),
1102
+ });
1103
+ rootsByIdentity.set(root.nodeIdentity, draft);
1104
+ return draft;
1105
+ });
1106
+ requireUniqueNodes(roots);
1107
+ for (const root of roots) {
1108
+ const declaration = preset.nodes[root.nodeIdentity];
1109
+ const dependencyBindings = declaration !== undefined && isRecord(declaration)
1110
+ ? declaration.dependencyBindings
1111
+ : undefined;
1112
+ populatePackageNodeDraft({
1113
+ draft: root,
1114
+ conventions,
1115
+ ancestry: [],
1116
+ sharedDrafts,
1117
+ dependencyIdentities,
1118
+ explicitTargets: rootsByIdentity,
1119
+ ...(existingSelection === undefined ? {} : { existingSelection }),
1120
+ ...(dependencyBindings === undefined ? {} : { dependencyBindings }),
1121
+ });
1122
+ }
1123
+ appendSelection({
1124
+ presetIdentity: presetMember.identity,
1125
+ selectionId: id,
1126
+ createdBy: operation === "init" ? "initialization" : "addition",
1127
+ roots,
1128
+ });
1129
+ }
1130
+ if (selectionDrafts.length === 0) {
1131
+ throw new Error(prepareOptions.restored
1132
+ ? "生成记录至少需要一个选择"
1133
+ : operation === "init"
1134
+ ? "初始化至少需要选择一个参考包或预设"
1135
+ : "加包至少需要选择一个参考包或预设");
1136
+ }
1137
+ const explicitlySelectedSharedReferences = new Map();
1138
+ for (const selectionDraft of selectionDrafts) {
1139
+ if (selectionDraft.createdBy === undefined)
1140
+ continue;
1141
+ for (const root of selectionDraft.roots) {
1142
+ if (root.content.definition.instance === "shared") {
1143
+ explicitlySelectedSharedReferences.set(contentIdentityKey(root.content.identity), selectionDraft.createdBy);
1144
+ }
1145
+ }
1146
+ }
1147
+ assertAcyclicPackageDrafts(selectionDrafts.flatMap((item) => item.roots), explicitlySelectedSharedReferences);
1148
+ const selectedPaths = [
1149
+ ...new Set(selectionDrafts.flatMap((selection) => packageNodePaths(selection.roots))),
1150
+ ];
1151
+ const selections = [];
1152
+ const preparedDrafts = new WeakMap();
1153
+ for (const selection of selectionDrafts) {
1154
+ const roots = [];
1155
+ for (const root of selection.roots) {
1156
+ roots.push(await preparePackageNode(root, selectedPaths, preparedDrafts));
1157
+ }
1158
+ selections.push({
1159
+ presetIdentity: selection.presetIdentity,
1160
+ ...(selection.selectionId === undefined
1161
+ ? {}
1162
+ : { selectionId: selection.selectionId }),
1163
+ ...(selection.recordedNodeIds === undefined
1164
+ ? {}
1165
+ : { recordedNodeIds: selection.recordedNodeIds }),
1166
+ ...(selection.createdBy === undefined
1167
+ ? {}
1168
+ : { createdBy: selection.createdBy }),
1169
+ roots,
1170
+ });
230
1171
  }
231
- return records.map((record) => {
232
- const definition = definitionsById.get(record.packageDefinitionId);
1172
+ return {
1173
+ conventions,
1174
+ composition: options.composition,
1175
+ selections,
1176
+ operationFacts: prepareOptions.operationFacts,
1177
+ ...(prepareOptions.restored === undefined
1178
+ ? {}
1179
+ : { restored: prepareOptions.restored }),
1180
+ };
1181
+ }
1182
+ async function prepareProject(prepareOptions) {
1183
+ return prepareProjectInternal({ ...prepareOptions, operation: "init" });
1184
+ }
1185
+ async function restoreProject(restoreOptions) {
1186
+ const targetRoot = path.resolve(restoreOptions.repositoryRoot);
1187
+ const { restored, readFacts } = await readRestoredProject(targetRoot);
1188
+ const dependencyIdentities = new Map();
1189
+ restoredSelectionDrafts(restored, dependencyIdentities);
1190
+ const normalizedDependencies = [...dependencyIdentities.values()];
1191
+ const definitionsById = new Map(restored.blueprint.packages.map((definition) => [
1192
+ definition.packageDefinitionId,
1193
+ definition,
1194
+ ]));
1195
+ const packages = restored.generationRecord.packages.map((item) => {
1196
+ const definition = definitionsById.get(item.packageDefinitionId);
233
1197
  if (definition === undefined) {
234
- throw new Error(`蓝图缺少内容 ${contentIdentityLabel(record.contentIdentity)} 对应的包实例:${record.packageDefinitionId}`);
1198
+ throw new Error(`项目蓝图缺少包实例:${item.packageDefinitionId}`);
235
1199
  }
236
- const configuration = normalizeConfiguration(requireContent(record.contentIdentity), record.configuration);
237
- if (!isDeepStrictEqual(configuration, record.configuration))
238
- throw new Error(`生成记录包含未规范化的实例配置:${definition.path}`);
239
- return { ...record, definition };
1200
+ return {
1201
+ ...item,
1202
+ definition,
1203
+ };
1204
+ });
1205
+ return {
1206
+ ...restored,
1207
+ targetRoot,
1208
+ packages,
1209
+ selections: restored.generationRecord.selections,
1210
+ readFacts,
1211
+ normalizedDependencies,
1212
+ };
1213
+ }
1214
+ const additionSelection = (selection) => "preset" in selection
1215
+ ? {
1216
+ presets: [
1217
+ {
1218
+ contentIdentity: selection.preset,
1219
+ ...(selection.creationInput === undefined
1220
+ ? {}
1221
+ : { creationInput: selection.creationInput }),
1222
+ },
1223
+ ],
1224
+ }
1225
+ : {
1226
+ roots: [
1227
+ {
1228
+ nodeIdentity: selection.nodeIdentity ?? "addition",
1229
+ contentIdentity: selection.contentIdentity,
1230
+ ...(selection.creationInput === undefined
1231
+ ? {}
1232
+ : { creationInput: selection.creationInput }),
1233
+ ...(selection.layout === undefined
1234
+ ? {}
1235
+ : { layout: selection.layout }),
1236
+ ...(selection.dependencyBindings === undefined
1237
+ ? {}
1238
+ : { dependencyBindings: selection.dependencyBindings }),
1239
+ },
1240
+ ],
1241
+ };
1242
+ async function prepareAddProject(prepareOptions) {
1243
+ const restored = {
1244
+ blueprint: prepareOptions.restored.blueprint,
1245
+ generationRecord: prepareOptions.restored.generationRecord,
1246
+ normalizedDependencies: prepareOptions.restored.normalizedDependencies,
1247
+ };
1248
+ const dependencyIdentities = new Map(restored.normalizedDependencies?.map((requirement) => [
1249
+ dependencyIdentityCacheKey(requirement.consumerContentIdentity, requirement.key),
1250
+ requirement,
1251
+ ]));
1252
+ const common = {
1253
+ restored,
1254
+ operation: "add",
1255
+ operationFacts: prepareOptions.operationFacts,
1256
+ dependencyIdentities,
1257
+ };
1258
+ const before = await prepareProjectInternal(common);
1259
+ const after = await prepareProjectInternal({
1260
+ ...common,
1261
+ selection: additionSelection(prepareOptions.selection),
240
1262
  });
1263
+ return {
1264
+ restored: prepareOptions.restored,
1265
+ before,
1266
+ after,
1267
+ readFacts: prepareOptions.restored.readFacts,
1268
+ };
241
1269
  }
242
- function requiredDependencyIdentities(records) {
243
- const dependenciesByPackageId = new Map();
244
- for (const record of records) {
245
- const content = requireContent(record.contentIdentity);
246
- dependenciesByPackageId.set(record.definition.packageDefinitionId, options.strategy.dependencies({
247
- content,
248
- contentByIdentity,
249
- configuration: record.configuration,
250
- ...(record.creationInput === null
251
- ? {}
252
- : { creationInput: record.creationInput }),
253
- }));
1270
+ function computeProject(preparedProject) {
1271
+ if (preparedProject.composition !== composition) {
1272
+ throw new Error("准备结果属于另一个组合定义");
254
1273
  }
255
- return dependenciesByPackageId;
256
- }
257
- function validateRequiredBindings(records, dependenciesByPackageId = requiredDependencyIdentities(records), providers = records) {
258
- for (const record of records) {
259
- const dependencies = dependenciesByPackageId.get(record.definition.packageDefinitionId);
260
- if (dependencies === undefined) {
261
- throw new Error("生成记录缺少已准备的内容依赖:" +
262
- contentIdentityLabel(record.contentIdentity));
263
- }
264
- for (const dependency of dependencies) {
265
- const dependencyKey = contentIdentityKey(dependency);
266
- const packageDefinitionId = record.bindings[dependencyKey];
267
- if (packageDefinitionId === undefined) {
268
- throw new Error(`生成记录中的内容 ${contentIdentityLabel(record.contentIdentity)} 缺少必要实例绑定:${contentIdentityLabel(dependency)}`);
269
- }
270
- const provider = findByPackageId(providers, packageDefinitionId);
271
- if (contentIdentityKey(provider.contentIdentity) !== dependencyKey) {
272
- throw new Error(`生成记录中的内容 ${contentIdentityLabel(record.contentIdentity)} 将依赖绑定到错误实例:${contentIdentityLabel(dependency)}`);
1274
+ const nodes = [];
1275
+ const sharedNodes = new Map();
1276
+ const nodesById = new Map();
1277
+ const nodesByPrepared = new WeakMap();
1278
+ const wiringNodes = new Set();
1279
+ const selectionRecords = [];
1280
+ const explicitlySelectedSharedReferences = new Map();
1281
+ for (const selection of preparedProject.selections) {
1282
+ if (selection.createdBy === undefined)
1283
+ continue;
1284
+ for (const root of selection.roots) {
1285
+ if (root.content.definition.instance === "shared") {
1286
+ explicitlySelectedSharedReferences.set(contentIdentityKey(root.content.identity), selection.createdBy);
273
1287
  }
274
1288
  }
275
1289
  }
276
- }
277
- function validateNodeInstances(records, nodeInstances) {
278
- const mappedIds = new Set(Object.values(nodeInstances));
279
- for (const record of records) {
280
- if (record.createdBy === "initialization" &&
281
- !mappedIds.has(record.packageDefinitionId)) {
282
- throw new Error(`生成记录中的内容 ${contentIdentityLabel(record.contentIdentity)} 缺少必要节点实例映射:${record.packageDefinitionId}`);
1290
+ const makeNode = (prepared, createdBy, discriminator) => {
1291
+ const preparedNode = nodesByPrepared.get(prepared);
1292
+ if (preparedNode !== undefined)
1293
+ return preparedNode;
1294
+ const identityKey = contentIdentityKey(prepared.content.identity);
1295
+ const restoredId = prepared.restored?.packageDefinitionId;
1296
+ if (restoredId !== undefined) {
1297
+ const restored = nodesById.get(restoredId);
1298
+ if (restored !== undefined) {
1299
+ if (contentIdentityKey(restored.content.identity) !== identityKey ||
1300
+ !isDeepStrictEqual(restored.definition, {
1301
+ ...prepared.definition,
1302
+ packageDefinitionId: restoredId,
1303
+ }) ||
1304
+ !isDeepStrictEqual(restored.creationInput, prepared.creationInput ?? null) ||
1305
+ !isDeepStrictEqual(restored.preparation, prepared.preparation)) {
1306
+ throw new Error(`生成记录中的包实例事实不一致:${restoredId}`);
1307
+ }
1308
+ nodesByPrepared.set(prepared, restored);
1309
+ return restored;
1310
+ }
283
1311
  }
284
- }
285
- }
286
- function validatePresetSelections(selections) {
287
- for (const selection of selections) {
288
- if (!presetsByIdentity.has(presetSelectionKey(selection))) {
289
- throw new Error(`生成记录所选预设不可用:${contentIdentityLabel(selection)}`);
1312
+ const sharedKey = prepared.content.definition.instance === "shared"
1313
+ ? identityKey
1314
+ : undefined;
1315
+ if (sharedKey !== undefined) {
1316
+ const existing = sharedNodes.get(sharedKey);
1317
+ if (existing !== undefined) {
1318
+ if (!isDeepStrictEqual({
1319
+ name: existing.definition.name,
1320
+ path: existing.definition.path,
1321
+ role: existing.definition.role,
1322
+ }, prepared.definition) ||
1323
+ !isDeepStrictEqual(existing.creationInput, prepared.creationInput ?? null) ||
1324
+ !isDeepStrictEqual(existing.preparation, prepared.preparation)) {
1325
+ throw new Error(`共享参考包的创建事实不一致:${contentIdentityLabel(prepared.content.identity)}`);
1326
+ }
1327
+ if (restoredId !== undefined && existing.id !== restoredId) {
1328
+ throw new Error(`共享实例标识与生成记录不一致:${restoredId}`);
1329
+ }
1330
+ if (wiringNodes.has(existing)) {
1331
+ throw new Error("预设节点依赖形成循环");
1332
+ }
1333
+ wiringNodes.add(existing);
1334
+ const proposedDependencies = prepared.dependencies.map((dependency) => ({
1335
+ key: dependency.key,
1336
+ package: makeNode(dependency.package, "shared-dependency", `${existing.id}:${dependency.key}`),
1337
+ }));
1338
+ wiringNodes.delete(existing);
1339
+ if (proposedDependencies.length !== existing.dependencies.size ||
1340
+ proposedDependencies.some(({ key, package: provider }) => existing.dependencies.get(key)?.id !== provider.id)) {
1341
+ throw new Error("共享参考包的依赖绑定不一致");
1342
+ }
1343
+ nodesByPrepared.set(prepared, existing);
1344
+ return existing;
1345
+ }
290
1346
  }
291
- }
292
- }
293
- function resolveNodeInstances(records, nodeInstances) {
294
- return new Map(Object.entries(nodeInstances).map(([nodeIdentity, packageDefinitionId]) => [
295
- nodeIdentity,
296
- findByPackageId(records, packageDefinitionId).definition,
297
- ]));
298
- }
299
- function nodesFromRecords(records) {
300
- return records.map((record) => {
301
- return {
302
- content: requireContent(record.contentIdentity),
303
- definition: record.definition,
304
- createdBy: record.createdBy,
305
- configuration: record.configuration,
306
- preparation: preparations.get(requireContent(record.contentIdentity).definition),
307
- preparationComplete: preparedDefinitions.has(requireContent(record.contentIdentity).definition),
308
- ...(record.creationInput === null
309
- ? {}
310
- : { creationInput: record.creationInput }),
311
- providers: new Map(),
312
- record,
1347
+ const explicitRoot = sharedKey === undefined ? prepared.explicitRoot : undefined;
1348
+ const effectiveCreatedBy = prepared.restored?.createdBy ??
1349
+ (sharedKey === undefined
1350
+ ? undefined
1351
+ : explicitlySelectedSharedReferences.get(sharedKey)) ??
1352
+ explicitRoot?.createdBy ??
1353
+ createdBy;
1354
+ const definition = {
1355
+ ...prepared.definition,
1356
+ packageDefinitionId: restoredId ??
1357
+ packageId({
1358
+ contentIdentity: prepared.content.identity,
1359
+ definition: prepared.definition,
1360
+ creationInput: prepared.creationInput ?? null,
1361
+ createdBy: effectiveCreatedBy,
1362
+ discriminator: sharedKey !== undefined
1363
+ ? "shared-reference"
1364
+ : explicitRoot === undefined
1365
+ ? discriminator
1366
+ : `${explicitRoot.selectionId}:${explicitRoot.nodeIdentity}`,
1367
+ }),
313
1368
  };
314
- });
315
- }
316
- function createContribution(node, context, allRecords, nodeInstances) {
317
- if (node.contribution !== undefined)
318
- return node.contribution;
319
- const providerDefinitions = new Map();
320
- const bindings = node.record?.bindings;
321
- if (bindings !== undefined) {
322
- for (const [identity, id] of Object.entries(bindings)) {
323
- const record = findByPackageId(allRecords, id);
324
- providerDefinitions.set(identity, record.definition);
1369
+ const node = {
1370
+ id: definition.packageDefinitionId,
1371
+ content: prepared.content,
1372
+ definition,
1373
+ createdBy: effectiveCreatedBy,
1374
+ creationInput: prepared.creationInput ?? null,
1375
+ preparation: prepared.preparation,
1376
+ dependencies: new Map(),
1377
+ };
1378
+ nodes.push(node);
1379
+ nodesById.set(node.id, node);
1380
+ nodesByPrepared.set(prepared, node);
1381
+ if (sharedKey !== undefined)
1382
+ sharedNodes.set(sharedKey, node);
1383
+ wiringNodes.add(node);
1384
+ for (const dependency of prepared.dependencies) {
1385
+ const provider = makeNode(dependency.package, "shared-dependency", `${definition.packageDefinitionId}:${dependency.key}`);
1386
+ node.dependencies.set(dependency.key, provider);
325
1387
  }
326
- }
327
- else {
328
- for (const [identity, provider] of node.providers) {
329
- if (provider.record === undefined) {
330
- throw new Error("内容闭包的包实例尚未登记:" + identity);
1388
+ wiringNodes.delete(node);
1389
+ return node;
1390
+ };
1391
+ for (const selection of preparedProject.selections) {
1392
+ const id = selection.selectionId ??
1393
+ selectionId({
1394
+ compositionIdentity: composition.identity,
1395
+ presetIdentity: selection.presetIdentity,
1396
+ roots: selection.roots.map((root) => ({
1397
+ nodeIdentity: root.nodeIdentity,
1398
+ contentIdentity: root.content.identity,
1399
+ creationInput: root.creationInput ?? null,
1400
+ definition: root.definition,
1401
+ })),
1402
+ });
1403
+ const nodeIds = {};
1404
+ for (const root of selection.roots) {
1405
+ const node = makeNode(root, selection.createdBy ?? "initialization", `${id}:${root.nodeIdentity}`);
1406
+ const expected = selection.recordedNodeIds?.[root.nodeIdentity];
1407
+ if (expected !== undefined && expected !== node.id) {
1408
+ throw new Error(`生成记录中的选择节点实例不一致:${root.nodeIdentity}`);
331
1409
  }
332
- providerDefinitions.set(identity, provider.definition);
1410
+ nodeIds[root.nodeIdentity] = node.id;
333
1411
  }
1412
+ if (selection.recordedNodeIds !== undefined &&
1413
+ Object.keys(selection.recordedNodeIds).length !==
1414
+ Object.keys(nodeIds).length) {
1415
+ throw new Error(`生成记录中的选择节点数量不一致:${id}`);
1416
+ }
1417
+ selectionRecords.push({
1418
+ selectionId: id,
1419
+ presetIdentity: selection.presetIdentity,
1420
+ nodes: nodeIds,
1421
+ });
334
1422
  }
335
- const nativeBindings = options.strategy.bindings({
336
- content: node.content,
337
- contentByIdentity,
338
- providers: providerDefinitions,
339
- });
340
- const contributionOptions = {
341
- context,
342
- configuration: node.configuration,
1423
+ if (preparedProject.restored !== undefined) {
1424
+ const recordedOrder = new Map(preparedProject.restored.generationRecord.packages.map((item, index) => [item.packageDefinitionId, index]));
1425
+ nodes.sort((left, right) => (recordedOrder.get(left.id) ?? Number.MAX_SAFE_INTEGER) -
1426
+ (recordedOrder.get(right.id) ?? Number.MAX_SAFE_INTEGER));
1427
+ }
1428
+ const packageRecords = nodes.map((node) => ({
1429
+ packageDefinitionId: node.id,
1430
+ contentIdentity: node.content.identity,
1431
+ createdBy: node.createdBy,
1432
+ creationInput: node.creationInput,
1433
+ dependencyBindings: Object.fromEntries([...node.dependencies.entries()].map(([key, provider]) => [
1434
+ key,
1435
+ provider.id,
1436
+ ])),
1437
+ }));
1438
+ const packages = nodes.map((node) => ({
1439
+ packageDefinitionId: node.id,
1440
+ contentIdentity: node.content.identity,
343
1441
  definition: node.definition,
344
- bindings: nativeBindings,
345
1442
  createdBy: node.createdBy,
346
- nodeInstances,
347
- ...(node.preparationComplete ? { preparation: node.preparation } : {}),
348
- ...(node.creationInput === undefined
349
- ? {}
350
- : { creationInput: node.creationInput }),
1443
+ creationInput: node.creationInput,
1444
+ dependencyBindings: Object.fromEntries([...node.dependencies.entries()].map(([key, provider]) => [
1445
+ key,
1446
+ provider.id,
1447
+ ])),
1448
+ }));
1449
+ const bindingsFor = (node) => {
1450
+ const bindings = new Map();
1451
+ for (const { key } of node.content.definition.dependencies ?? []) {
1452
+ const provider = node.dependencies.get(key);
1453
+ if (provider === undefined) {
1454
+ throw new Error(`参考包依赖尚未绑定:${node.id} → ${key}`);
1455
+ }
1456
+ if (provider.contribution === undefined) {
1457
+ throw new Error(`依赖包尚未求值:${provider.id}`);
1458
+ }
1459
+ bindings.set(key, {
1460
+ packageDefinitionId: provider.id,
1461
+ contentIdentity: provider.content.identity,
1462
+ definition: provider.definition,
1463
+ facts: structuredClone(provider.contribution.facts),
1464
+ });
1465
+ }
1466
+ return bindings;
351
1467
  };
352
- const contribution = node.content.definition.contribute(contributionOptions);
353
- const contributionDefinition = contribution.definition;
354
- if (contributionDefinition.name !== node.definition.name ||
355
- contributionDefinition.path !== node.definition.path ||
356
- contributionDefinition.role !== node.definition.role ||
357
- ("packageDefinitionId" in contributionDefinition &&
358
- contributionDefinition.packageDefinitionId !==
359
- node.record?.packageDefinitionId)) {
360
- throw new Error(`内容 ${contentIdentityLabel(node.content.identity)} 返回的包定义与已分配实例不一致:${node.definition.path}`);
361
- }
362
- assertPackageContribution({
363
- definition: node.definition,
364
- operations: contribution.operations,
365
- }, {
366
- definitionName: contentIdentityLabel(node.content.identity),
367
- planner: "内容贡献",
368
- });
369
- node.contribution = contribution;
370
- return node.contribution;
371
- }
372
- function storedRecord(state, records, nodeInstances, presetSelections) {
373
- return {
1468
+ const provisionalBlueprint = assertProjectBlueprint({
374
1469
  schemaVersion: 4,
375
- strategyIdentity: options.strategy.identity,
376
- strategyState: state,
377
- packages: records.map(({ definition: _definition, ...record }) => record),
378
- nodeInstances,
379
- presetSelections,
380
- };
381
- }
382
- function selectedPreset(preset) {
383
- return preset.identity;
384
- }
385
- function mergePresetSelections(existing, added) {
386
- const selections = new Map();
387
- for (const selection of [...existing, ...added]) {
388
- selections.set(presetSelectionKey(selection), selection);
1470
+ packages: nodes.map((node) => node.definition),
1471
+ packageLinkIntents: [],
1472
+ });
1473
+ const resolution = composition.resolve({
1474
+ conventions: preparedProject.conventions,
1475
+ blueprint: provisionalBlueprint,
1476
+ selections: selectionRecords,
1477
+ packages,
1478
+ operationFacts: preparedProject.operationFacts,
1479
+ });
1480
+ for (const id of resolution.packageInputs.keys()) {
1481
+ if (!nodes.some((node) => node.id === id)) {
1482
+ throw new Error(`组合输入引用了未知软件包实例:${id}`);
1483
+ }
389
1484
  }
390
- return [...selections.values()];
391
- }
392
- async function validatePresetUpdate(targetRoot, context, contributions, nodeInstances, presetSelections) {
393
- for (const selection of presetSelections) {
394
- const presetMember = presetsByIdentity.get(presetSelectionKey(selection));
395
- if (presetMember === undefined) {
396
- throw new Error(`生成记录所选预设不可用:${contentIdentityLabel(selection)}`);
1485
+ const blueprint = assertProjectBlueprint({
1486
+ ...provisionalBlueprint,
1487
+ packageLinkIntents: resolution.packageLinkIntents ?? [],
1488
+ });
1489
+ if (preparedProject.restored !== undefined) {
1490
+ const existingIds = new Set(preparedProject.restored.generationRecord.packages.map((item) => item.packageDefinitionId));
1491
+ const existingBlueprintPackages = blueprint.packages.filter((item) => existingIds.has(item.packageDefinitionId));
1492
+ const recordedBlueprintPackages = preparedProject.restored.blueprint.packages.filter((item) => existingIds.has(item.packageDefinitionId));
1493
+ if (!isDeepStrictEqual(existingBlueprintPackages, recordedBlueprintPackages)) {
1494
+ throw new Error("回放后的包定义与持久蓝图不一致");
1495
+ }
1496
+ const existingLinks = blueprint.packageLinkIntents.filter(({ consumerId, providerId }) => existingIds.has(consumerId) && existingIds.has(providerId));
1497
+ if (!isDeepStrictEqual(existingLinks, preparedProject.restored.blueprint.packageLinkIntents)) {
1498
+ throw new Error("回放后的显式包连接与持久蓝图不一致");
397
1499
  }
398
- await presetMember.definition.validateUpdate?.({
399
- targetRoot,
400
- context,
401
- contributions,
402
- nodeInstances,
403
- });
404
1500
  }
405
- }
406
- function computePresetProjectContributions(context, contributions, nodeInstances, presetSelections) {
407
- return presetSelections.flatMap((selection) => {
408
- const presetMember = presetsByIdentity.get(presetSelectionKey(selection));
409
- if (presetMember === undefined) {
410
- throw new Error(`生成记录所选预设不可用:${contentIdentityLabel(selection)}`);
1501
+ const visiting = new Set();
1502
+ const complete = new Set();
1503
+ const evaluate = (node) => {
1504
+ if (node.contribution !== undefined)
1505
+ return node.contribution;
1506
+ if (visiting.has(node.id))
1507
+ throw new Error("软件包依赖图包含循环");
1508
+ visiting.add(node.id);
1509
+ for (const provider of node.dependencies.values()) {
1510
+ evaluate(provider);
411
1511
  }
412
- if (presetMember.definition.project === undefined)
413
- return [];
414
- return presetMember.definition.project({
415
- context,
416
- contributions,
417
- nodeInstances,
1512
+ const contentPreparation = clonePreparation(node.preparation);
1513
+ const contribution = node.content.definition.evaluate({
1514
+ packageDefinitionId: node.id,
1515
+ definition: node.definition,
1516
+ createdBy: node.createdBy,
1517
+ creationInput: node.creationInput,
1518
+ prepared: contentPreparation,
1519
+ bindings: bindingsFor(node),
1520
+ conventions: structuredClone(preparedProject.conventions),
1521
+ stableCommon: structuredClone(resolution.stableCommon),
1522
+ packageInput: structuredClone(resolution.packageInputs.get(node.id)),
418
1523
  });
1524
+ if (contribution.packageDefinitionId !== node.id) {
1525
+ throw new Error(`包贡献返回了错误的软件包实例标识:${node.id}`);
1526
+ }
1527
+ node.contribution = contribution;
1528
+ visiting.delete(node.id);
1529
+ complete.add(node.id);
1530
+ return contribution;
1531
+ };
1532
+ for (const node of nodes)
1533
+ evaluate(node);
1534
+ if (complete.size !== nodes.length)
1535
+ throw new Error("部分软件包贡献尚未求值");
1536
+ const compositionPackages = nodes.map((node) => ({
1537
+ package: packages.find((item) => item.packageDefinitionId === node.id),
1538
+ bindings: bindingsFor(node),
1539
+ contribution: node.contribution,
1540
+ }));
1541
+ const combined = composition.combine({
1542
+ conventions: preparedProject.conventions,
1543
+ stableCommon: structuredClone(resolution.stableCommon),
1544
+ blueprint,
1545
+ selections: selectionRecords,
1546
+ packages: compositionPackages,
419
1547
  });
420
- }
421
- function project(context, state, blueprint, records, contributions, nodeInstances, presetSelections) {
422
- const resolvedNodeInstances = resolveNodeInstances(records, nodeInstances);
423
- const presetProjectContributions = computePresetProjectContributions(context, contributions, resolvedNodeInstances, presetSelections);
424
- const projection = options.strategy.project({
425
- context,
426
- state,
1548
+ const projection = projectPackageContributions({
427
1549
  blueprint,
428
- packages: records,
429
- contributions,
430
- nodeInstances: resolvedNodeInstances,
431
- presetProjectContributions,
1550
+ contributions: nodes.map((node) => node.contribution),
1551
+ ...(combined.files === undefined
1552
+ ? {}
1553
+ : { compositionFiles: combined.files }),
1554
+ ...(combined.reconciliation === undefined
1555
+ ? {}
1556
+ : { compositionReconciliation: combined.reconciliation }),
432
1557
  });
433
- const projectedBlueprint = assertProjectBlueprint(projection.blueprint ?? blueprint);
434
- const allocatedDefinitions = new Map(records.map((record) => [record.packageDefinitionId, record.definition]));
435
- if (projectedBlueprint.packages.length !== allocatedDefinitions.size) {
436
- throw new Error("策略蓝图必须引用完整且唯一的已分配包实例");
437
- }
438
- for (const projectedDefinition of projectedBlueprint.packages) {
439
- const allocated = allocatedDefinitions.get(projectedDefinition.packageDefinitionId);
440
- if (allocated === undefined ||
441
- allocated.name !== projectedDefinition.name ||
442
- allocated.path !== projectedDefinition.path ||
443
- allocated.role !== projectedDefinition.role) {
444
- throw new Error("策略蓝图中的包定义必须与生成器分配的包实例一致:" +
445
- projectedDefinition.path);
1558
+ const sourcesByPackage = new Map(nodes.map((node) => [
1559
+ node.id,
1560
+ {
1561
+ identity: `content:${contentIdentityKey(node.content.identity)}:${node.id}`,
1562
+ label: `${contentIdentityLabel(node.content.identity)}(${node.definition.path})`,
1563
+ },
1564
+ ]));
1565
+ const packageSources = [...sourcesByPackage.values()];
1566
+ const compositionSource = {
1567
+ identity: `composition:${contentIdentityKey(composition.identity)}`,
1568
+ label: `组合${contentIdentityLabel(composition.identity)}`,
1569
+ };
1570
+ const sourcesByPath = new Map();
1571
+ const addPathSources = (targetPath, sources) => {
1572
+ const existing = sourcesByPath.get(targetPath) ?? [];
1573
+ const definedSources = sources.filter((source) => source !== undefined);
1574
+ sourcesByPath.set(targetPath, mergeProjectionSources(existing, definedSources));
1575
+ };
1576
+ for (const node of nodes) {
1577
+ const source = sourcesByPackage.get(node.id);
1578
+ for (const file of node.contribution.files) {
1579
+ addPathSources(projectionPath(node.definition.path, file.path), [
1580
+ source,
1581
+ ]);
1582
+ }
1583
+ for (const policy of node.contribution.reconciliation ?? []) {
1584
+ addPathSources(projectionPath(node.definition.path, policy.path), [
1585
+ source,
1586
+ ]);
446
1587
  }
447
- allocatedDefinitions.delete(projectedDefinition.packageDefinitionId);
448
1588
  }
449
- if (allocatedDefinitions.size > 0) {
450
- throw new Error("策略蓝图遗漏了已分配的包实例");
1589
+ const combinedSources = [compositionSource, ...packageSources];
1590
+ for (const item of combined.files ?? []) {
1591
+ const definition = blueprint.packages.find((candidate) => candidate.packageDefinitionId === item.packageDefinitionId);
1592
+ addPathSources(projectionPath(definition.path, item.file.path), combinedSources);
1593
+ }
1594
+ for (const item of combined.reconciliation ?? []) {
1595
+ const definition = blueprint.packages.find((candidate) => candidate.packageDefinitionId === item.packageDefinitionId);
1596
+ addPathSources(projectionPath(definition.path, item.reconciliation.path), combinedSources);
451
1597
  }
452
- const generationRecord = storedRecord(state, records, nodeInstances, presetSelections);
1598
+ const annotatedProjection = {
1599
+ entries: projection.entries.map((entry) => {
1600
+ const sources = mergeProjectionSources(entry.sources, sourcesByPath.get(entry.path));
1601
+ return sources.length === 0 ? entry : { ...entry, sources };
1602
+ }),
1603
+ reconciliation: projection.reconciliation.map((policy) => {
1604
+ const sources = mergeProjectionSources(policy.sources, sourcesByPath.get(policy.path));
1605
+ return sources.length === 0 ? policy : { ...policy, sources };
1606
+ }),
1607
+ };
1608
+ const metadataSources = mergeProjectionSources(packageSources, [
1609
+ compositionSource,
1610
+ ]);
1611
+ const generationRecord = {
1612
+ schemaVersion: 6,
1613
+ composition: {
1614
+ identity: composition.identity,
1615
+ conventions: preparedProject.conventions,
1616
+ },
1617
+ packages: packageRecords,
1618
+ selections: selectionRecords,
1619
+ };
1620
+ assertGenerationRecordMatchesBlueprint(generationRecord, blueprint);
1621
+ const metadataEntries = [
1622
+ {
1623
+ path: generatorMetadataPaths.blueprint,
1624
+ kind: "file",
1625
+ content: printCanonicalJson(blueprint),
1626
+ mode: 0,
1627
+ sources: metadataSources,
1628
+ },
1629
+ {
1630
+ path: generatorMetadataPaths.generationRecord,
1631
+ kind: "file",
1632
+ content: printCanonicalJson(generationRecord),
1633
+ mode: 0,
1634
+ sources: metadataSources,
1635
+ },
1636
+ ];
1637
+ const metadataReconciliation = metadataEntries.map((entry) => ({
1638
+ path: entry.path,
1639
+ driver: "canonical",
1640
+ ...(entry.sources === undefined ? {} : { sources: entry.sources }),
1641
+ }));
1642
+ const finalProjection = {
1643
+ entries: [...annotatedProjection.entries, ...metadataEntries].toSorted((left, right) => comparePaths(left.path, right.path)),
1644
+ reconciliation: [
1645
+ ...annotatedProjection.reconciliation,
1646
+ ...metadataReconciliation,
1647
+ ].toSorted((left, right) => comparePaths(left.path, right.path)),
1648
+ };
453
1649
  return {
454
- ...projection,
455
- blueprint: projectedBlueprint,
456
- operations: [
457
- ...projection.operations,
458
- {
459
- kind: "writeJson",
460
- to: ".template/generation.json",
461
- value: generationRecord,
462
- },
463
- ],
1650
+ blueprint,
464
1651
  generationRecord,
1652
+ projection: finalProjection,
1653
+ packages: nodes.map((node) => ({
1654
+ package: packages.find((item) => item.packageDefinitionId === node.id),
1655
+ bindings: bindingsFor(node),
1656
+ contribution: node.contribution,
1657
+ })),
1658
+ ownerFacts: combined.facts,
465
1659
  };
466
1660
  }
467
- function expandDependencies(options_) {
468
- const newNodes = new Map();
469
- const visiting = new Set();
470
- const expanded = new Set();
471
- const visit = (node) => {
472
- const identity = contentIdentityKey(node.content.identity);
473
- const key = identity + "\u0000" + node.definition.path;
474
- if (visiting.has(key)) {
475
- throw new Error("显式内容依赖形成循环:" +
476
- contentIdentityLabel(node.content.identity));
477
- }
478
- if (expanded.has(key))
479
- return;
480
- visiting.add(key);
481
- if (node.record === undefined)
482
- newNodes.set(key, node);
483
- node.preparation = prepareContent(node.content);
484
- node.preparationComplete = true;
485
- const dependencies = options.strategy.dependencies({
486
- content: node.content,
487
- contentByIdentity,
488
- configuration: node.configuration,
489
- ...(node.creationInput === undefined
490
- ? {}
491
- : { creationInput: node.creationInput }),
1661
+ async function planInit(initOptions) {
1662
+ let prepared;
1663
+ try {
1664
+ prepared = await prepareProject({
1665
+ selection: initOptions.selection,
1666
+ conventions: initOptions.conventions,
1667
+ operationFacts: initOptions.operationFacts,
492
1668
  });
493
- for (const dependencyIdentity of dependencies) {
494
- const dependencyKey = contentIdentityKey(dependencyIdentity);
495
- const dependency = requireContent(dependencyIdentity);
496
- const candidates = [...options_.existing, ...newNodes.values()].filter((candidate) => contentIdentityKey(candidate.content.identity) === dependencyKey);
497
- const boundId = node.record?.bindings[dependencyKey];
498
- const bound = boundId === undefined
499
- ? undefined
500
- : candidates.find((candidate) => candidate.record?.packageDefinitionId === boundId);
501
- if (bound === undefined && candidates.length > 1) {
502
- throw new Error("依赖内容有多个持久实例,无法唯一绑定:" +
503
- contentIdentityLabel(dependencyIdentity));
504
- }
505
- let provider = bound ?? candidates[0];
506
- if (provider === undefined) {
507
- if (dependency.definition.instance !== "shared") {
508
- throw new Error("缺少明确的独立依赖实例:" +
509
- contentIdentityLabel(dependencyIdentity));
510
- }
511
- const definition = options.strategy.createDefinition({
512
- context: options_.context,
513
- content: dependency,
514
- });
515
- const occupied = [...options_.existing, ...newNodes.values()].find((candidate) => candidate.definition.name === definition.name ||
516
- candidate.definition.path === definition.path);
517
- if (occupied !== undefined) {
518
- throw new Error("共享依赖默认身份已被占用:" + definition.path);
519
- }
520
- provider = {
521
- content: dependency,
522
- definition,
523
- createdBy: "shared-dependency",
524
- configuration: normalizeConfiguration(dependency, undefined),
525
- providers: new Map(),
526
- };
527
- newNodes.set(dependencyKey + "\u0000" + definition.path, provider);
528
- }
529
- node.providers.set(dependencyKey, provider);
530
- visit(provider);
531
- }
532
- visiting.delete(key);
533
- expanded.add(key);
534
- };
535
- const explicitByContent = new Set();
536
- const explicitByPath = new Set();
537
- const explicitByNode = new Set();
538
- for (const root of options_.roots) {
539
- const identity = contentIdentityKey(root.content.identity);
540
- const key = identity + "\u0000" + root.definition.path;
541
- if (explicitByNode.has(root.nodeIdentity ?? "")) {
542
- throw new Error("显式初始化节点身份重复:" + root.nodeIdentity);
543
- }
544
- explicitByNode.add(root.nodeIdentity ?? "");
545
- if (root.content.definition.instance === "independent" &&
546
- explicitByContent.has(identity)) {
547
- throw new Error("同一独立内容不能重复作为显式根:" +
548
- contentIdentityLabel(root.content.identity));
549
- }
550
- explicitByContent.add(identity);
551
- if (explicitByPath.has(root.definition.path)) {
552
- throw new Error("显式初始化根路径重复:" + root.definition.path);
553
- }
554
- explicitByPath.add(root.definition.path);
555
- if (root.record === undefined)
556
- newNodes.set(key, root);
557
1669
  }
558
- for (const root of options_.roots)
559
- visit(root);
560
- const nodes = [...newNodes.values()];
561
- for (const node of nodes) {
562
- const persisted = {
563
- ...node.definition,
564
- packageDefinitionId: packageId({
565
- contentIdentity: node.content.identity,
566
- createdBy: node.createdBy,
567
- definition: node.definition,
568
- occupied: options_.occupiedIds,
569
- }),
570
- };
571
- options_.occupiedIds.add(persisted.packageDefinitionId);
572
- node.definition = persisted;
573
- node.record = {
574
- contentIdentity: node.content.identity,
575
- createdBy: node.createdBy,
576
- packageDefinitionId: persisted.packageDefinitionId,
577
- creationInput: node.creationInput ?? null,
578
- configuration: node.configuration,
579
- bindings: {},
1670
+ catch (error) {
1671
+ return {
1672
+ status: "operation-failure",
1673
+ phase: "preparation",
1674
+ error: { message: errorMessage(error) },
580
1675
  };
581
1676
  }
582
- for (const node of new Set([...nodes, ...options_.roots])) {
583
- const bindings = Object.fromEntries([...node.providers].map(([identity, provider]) => {
584
- if (provider.record === undefined) {
585
- throw new Error("内容闭包绑定缺少包实例:" + identity);
586
- }
587
- return [identity, provider.record.packageDefinitionId];
588
- }));
589
- node.record = { ...node.record, bindings };
590
- }
591
- return nodes;
592
- }
593
- function persistedContributions(nodes, context, records, nodeInstances) {
594
- return nodes.map((node) => createContribution(node, context, records, nodeInstances));
595
- }
596
- async function init(initOptions) {
1677
+ let computed;
597
1678
  try {
598
- const selectedPresets = [];
599
- for (const root of initOptions.selection.roots) {
600
- if (!("preset" in root))
601
- continue;
602
- selectedPresets.push(selectedPreset(resolvePreset(root.preset)));
603
- }
604
- const presetSelections = mergePresetSelections([], selectedPresets);
605
- const selectionRoots = initOptions.selection.roots.flatMap((root) => "preset" in root
606
- ? expandPreset({
607
- preset: resolvePreset(root.preset),
608
- operation: "init",
609
- configuration: root.configuration,
610
- ...(root.creationInput === undefined
1679
+ computed = computeProject(prepared);
1680
+ }
1681
+ catch (error) {
1682
+ const packageIdentityIssues = error instanceof ProjectBlueprintValidationError
1683
+ ? error.packageIdentityIssues
1684
+ : [];
1685
+ return {
1686
+ status: "operation-failure",
1687
+ phase: "calculation",
1688
+ error: {
1689
+ message: errorMessage(error),
1690
+ ...(packageIdentityIssues.length === 0
611
1691
  ? {}
612
- : { creationInput: root.creationInput }),
613
- })
614
- : [
615
- {
616
- ...root,
617
- contentIdentity: requireContent(root.contentIdentity).identity,
618
- },
619
- ]);
620
- if (selectionRoots.length === 0) {
621
- throw new Error("初始化至少需要一个显式内容根");
622
- }
623
- const rootsByIdentity = new Set();
624
- for (const root of selectionRoots) {
625
- if (root.nodeIdentity.length === 0) {
626
- throw new Error("显式初始化节点身份不能为空");
627
- }
628
- if (rootsByIdentity.has(root.nodeIdentity)) {
629
- throw new Error("显式初始化节点身份重复:" + root.nodeIdentity);
630
- }
631
- rootsByIdentity.add(root.nodeIdentity);
632
- requireContent(root.contentIdentity);
633
- }
634
- const prepared = options.strategy.initialize({
1692
+ : { packageIdentityIssues }),
1693
+ },
1694
+ };
1695
+ }
1696
+ try {
1697
+ const sources = mergeProjectionSources(...computed.projection.entries.map((entry) => entry.sources), ...computed.projection.reconciliation.map((policy) => policy.sources));
1698
+ const preconditions = [
1699
+ {
1700
+ path: ".",
1701
+ kind: "directory-empty-or-missing",
1702
+ reason: "初始化要求目标目录为空或不存在",
1703
+ ...(sources.length === 0 ? {} : { sources }),
1704
+ },
1705
+ ];
1706
+ const current = await readProjectProjectionCurrent({
635
1707
  targetRoot: initOptions.targetRoot,
636
- input: initOptions.strategyInput,
637
- selection: selectionRoots,
638
- contentByIdentity,
1708
+ before: emptyProjectProjection,
1709
+ after: computed.projection,
1710
+ preconditions,
639
1711
  });
640
- const roots = selectionRoots.map((root) => {
641
- const content = requireContent(root.contentIdentity);
642
- const definition = options.strategy.createDefinition({
643
- context: prepared.context,
644
- content,
645
- ...(root.layout === undefined ? {} : { layout: root.layout }),
646
- ...(root.creationInput === undefined
647
- ? {}
648
- : { creationInput: root.creationInput }),
649
- });
1712
+ const planning = planProjectProjections({
1713
+ before: emptyProjectProjection,
1714
+ current,
1715
+ after: computed.projection,
1716
+ preconditions,
1717
+ });
1718
+ if (!planning.ok) {
650
1719
  return {
651
- content,
652
- definition,
653
- nodeIdentity: root.nodeIdentity,
654
- createdBy: "initialization",
655
- configuration: normalizeConfiguration(content, root.configuration),
656
- ...(root.creationInput === undefined
657
- ? {}
658
- : { creationInput: root.creationInput }),
659
- providers: new Map(),
1720
+ status: "conflict",
1721
+ reason: conflictReason(planning.conflicts),
1722
+ conflicts: planning.conflicts,
1723
+ actions: [],
660
1724
  };
661
- });
662
- const nodes = expandDependencies({
663
- roots,
664
- existing: [],
665
- context: prepared.context,
666
- occupiedIds: new Set(),
667
- });
668
- const records = nodes.flatMap((node) => node.record === undefined ? [] : [node.record]);
669
- const nodeInstances = Object.fromEntries(roots.map((root) => {
670
- if (root.record === undefined) {
671
- throw new Error("显式初始化节点没有持久实例:" + root.nodeIdentity);
672
- }
673
- return [root.nodeIdentity, root.record.packageDefinitionId];
674
- }));
675
- const blueprint = assertProjectBlueprint({
676
- schemaVersion: 3,
677
- packages: nodes.map((node) => node.definition),
678
- });
679
- const packageStates = resolvePackageStates(records, blueprint);
680
- validateRequiredBindings(packageStates);
681
- validateNodeInstances(packageStates, nodeInstances);
682
- const contributions = persistedContributions(nodes, prepared.context, packageStates, resolveNodeInstances(packageStates, nodeInstances));
683
- const projectPlan = project(prepared.context, prepared.state, blueprint, packageStates, contributions, nodeInstances, presetSelections);
684
- await materializeProjectProjection({
685
- operations: projectPlan.operations,
686
- reconciliation: projectPlan.reconciliation,
687
- });
688
- if (!initOptions.dryRun) {
689
- try {
690
- await renderNewProject({
691
- targetRoot: path.resolve(initOptions.targetRoot),
692
- operations: [...projectPlan.operations],
693
- });
694
- }
695
- catch (error) {
696
- return fail("render", error);
697
- }
698
1725
  }
1726
+ pendingPlans.set(planning.plan, {
1727
+ targetRoot: current.targetRoot,
1728
+ computed,
1729
+ });
699
1730
  return {
700
- status: "success",
701
- dryRun: initOptions.dryRun ?? false,
702
- blueprint: projectPlan.blueprint,
703
- generationRecord: projectPlan.generationRecord,
704
- projection: projectPlan,
705
- actions: [],
1731
+ status: "planned",
1732
+ plan: planning.plan,
1733
+ blueprint: computed.blueprint,
1734
+ generationRecord: computed.generationRecord,
1735
+ projection: computed.projection,
1736
+ ownerFacts: computed.ownerFacts,
1737
+ actions: planning.plan.actions,
706
1738
  };
707
1739
  }
708
1740
  catch (error) {
709
- return fail("planning", error);
1741
+ return {
1742
+ status: "operation-failure",
1743
+ phase: "planning",
1744
+ error: { message: errorMessage(error) },
1745
+ };
710
1746
  }
711
1747
  }
712
- async function restoreRepository(repositoryRoot) {
713
- const blueprintValue = JSON.parse(await readFile(path.join(repositoryRoot, ".template/blueprint.json"), "utf8"));
714
- const blueprint = assertProjectBlueprint(blueprintValue);
715
- const record = parseGenerationRecord(JSON.parse(await readFile(path.join(repositoryRoot, ".template/generation.json"), "utf8")));
716
- if (record.strategyIdentity !== options.strategy.identity) {
717
- throw new Error("目标仓库使用了不兼容的工作区策略");
718
- }
719
- const state = options.strategy.parseState(record.strategyState);
720
- const packageStates = resolvePackageStates(record.packages, blueprint);
721
- validateNodeInstances(packageStates, record.nodeInstances);
722
- validatePresetSelections(record.presetSelections);
723
- return { blueprint, record, state, packageStates };
724
- }
725
- async function add(addOptions) {
1748
+ async function planComputedAdd(options) {
1749
+ const { preparation, before } = options;
1750
+ let after;
726
1751
  try {
727
- const repositoryRoot = path.resolve(addOptions.repositoryRoot);
728
- let blueprint;
729
- let record;
730
- let packageStates;
731
- let state;
732
- try {
733
- ({ blueprint, record, state, packageStates } =
734
- await restoreRepository(repositoryRoot));
1752
+ if (!isDeepStrictEqual(before.generationRecord, preparation.restored.generationRecord) ||
1753
+ !isDeepStrictEqual(before.blueprint, preparation.restored.blueprint)) {
1754
+ throw new Error("Before 计算结果与恢复的项目记录不一致");
735
1755
  }
736
- catch (error) {
737
- return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
738
- }
739
- let requiredDependencies;
740
- try {
741
- for (const packageRecord of packageStates) {
742
- prepareContent(requireContent(packageRecord.contentIdentity));
1756
+ const afterPackages = new Map(options.after.generationRecord.packages.map((item) => [
1757
+ item.packageDefinitionId,
1758
+ item,
1759
+ ]));
1760
+ const afterDefinitions = new Map(options.after.blueprint.packages.map((item) => [
1761
+ item.packageDefinitionId,
1762
+ item,
1763
+ ]));
1764
+ for (const item of before.generationRecord.packages) {
1765
+ if (!isDeepStrictEqual(afterPackages.get(item.packageDefinitionId), item)) {
1766
+ throw new Error(`After 未保留既有包实例事实:${item.packageDefinitionId}`);
743
1767
  }
744
- requiredDependencies = requiredDependencyIdentities(packageStates);
745
- }
746
- catch (error) {
747
- return fail("planning", error);
748
- }
749
- try {
750
- validateRequiredBindings(packageStates, requiredDependencies);
751
- }
752
- catch (error) {
753
- return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
754
- }
755
- const additionRoots = "preset" in addOptions
756
- ? expandPreset({
757
- preset: resolvePreset(addOptions.preset),
758
- operation: "add",
759
- configuration: addOptions.configuration,
760
- ...(addOptions.creationInput === undefined
761
- ? {}
762
- : { creationInput: addOptions.creationInput }),
763
- })
764
- : [
765
- {
766
- nodeIdentity: "addition",
767
- configuration: addOptions.configuration,
768
- contentIdentity: addOptions.contentIdentity,
769
- ...(addOptions.creationInput === undefined
770
- ? {}
771
- : { creationInput: addOptions.creationInput }),
772
- },
773
- ];
774
- if (additionRoots.length !== 1) {
775
- throw new Error("加包预设必须恰好包含一个节点");
776
- }
777
- const selectionRoot = additionRoots[0];
778
- if (selectionRoot === undefined) {
779
- throw new Error("加包预设必须恰好包含一个节点");
780
1768
  }
781
- const selected = requireContent(selectionRoot.contentIdentity);
782
- const creationInput = selectionRoot.creationInput;
783
- const configuration = normalizeConfiguration(selected, selectionRoot.configuration);
784
- const addedPresetMember = "preset" in addOptions ? resolvePreset(addOptions.preset) : undefined;
785
- const addedPreset = addedPresetMember === undefined
786
- ? undefined
787
- : selectedPreset(addedPresetMember);
788
- const addedProjectPreset = addedPresetMember?.definition.project === undefined
789
- ? undefined
790
- : addedPreset;
791
- const existingNodes = nodesFromRecords(packageStates);
792
- const currentNodeInstances = resolveNodeInstances(packageStates, record.nodeInstances);
793
- try {
794
- prepareContent(selected);
795
- }
796
- catch (error) {
797
- return fail("planning", error);
798
- }
799
- let context;
800
- try {
801
- context = await options.strategy.prepareUpdate({
802
- targetRoot: repositoryRoot,
803
- state,
804
- content: selected,
805
- contentByIdentity,
806
- configuration,
807
- packages: packageStates,
808
- nodeInstances: currentNodeInstances,
809
- ...(creationInput === undefined ? {} : { creationInput }),
810
- });
811
- }
812
- catch (error) {
813
- return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
814
- }
815
- const existingContributions = existingNodes.map((node) => createContribution(node, context, packageStates, currentNodeInstances));
816
- const definition = options.strategy.createDefinition({
817
- context,
818
- content: selected,
819
- ...(selectionRoot.layout === undefined
820
- ? {}
821
- : { layout: selectionRoot.layout }),
822
- ...(creationInput === undefined ? {} : { creationInput }),
823
- });
824
- const requested = {
825
- content: selected,
826
- definition,
827
- createdBy: "addition",
828
- configuration,
829
- ...(addedProjectPreset !== undefined
830
- ? { nodeIdentity: selectionRoot.nodeIdentity }
831
- : {}),
832
- ...(creationInput === undefined ? {} : { creationInput }),
833
- providers: new Map(),
834
- };
835
- let preparedAddition;
836
- const prepareAdditionNodes = () => {
837
- if (preparedAddition !== undefined)
838
- return preparedAddition;
839
- try {
840
- const nodes = expandDependencies({
841
- roots: [requested],
842
- existing: existingNodes,
843
- context,
844
- occupiedIds: new Set(record.packages.map((item) => item.packageDefinitionId)),
845
- });
846
- const records = nodes.flatMap((node) => node.record === undefined ? [] : [node.record]);
847
- const allRecords = [...record.packages, ...records];
848
- const afterBlueprint = {
849
- ...blueprint,
850
- packages: [
851
- ...blueprint.packages,
852
- ...nodes.map((node) => node.definition),
853
- ],
854
- };
855
- const packages = resolvePackageStates(allRecords, afterBlueprint);
856
- const addedPackageIds = new Set(records.map((item) => item.packageDefinitionId));
857
- const addedPackages = packages.filter((item) => addedPackageIds.has(item.packageDefinitionId));
858
- validateRequiredBindings(addedPackages, requiredDependencyIdentities(addedPackages), packages);
859
- const nodeInstanceIds = {
860
- ...record.nodeInstances,
861
- };
862
- if (addedProjectPreset !== undefined &&
863
- !Object.hasOwn(nodeInstanceIds, selectionRoot.nodeIdentity)) {
864
- const addedRoot = nodes.find((node) => node.nodeIdentity === selectionRoot.nodeIdentity);
865
- if (addedRoot?.record === undefined) {
866
- throw new Error("加包预设节点没有持久实例:" + selectionRoot.nodeIdentity);
867
- }
868
- nodeInstanceIds[selectionRoot.nodeIdentity] =
869
- addedRoot.record.packageDefinitionId;
870
- }
871
- const nodeInstances = resolveNodeInstances(packages, nodeInstanceIds);
872
- preparedAddition = {
873
- nodes,
874
- records,
875
- packages,
876
- blueprint: afterBlueprint,
877
- nodeInstances,
878
- contributions: persistedContributions(nodes, context, packages, nodeInstances),
879
- };
880
- return preparedAddition;
881
- }
882
- catch (error) {
883
- throw new AdditionPlanningFailure(error);
884
- }
885
- };
886
- try {
887
- await validatePresetUpdate(repositoryRoot, context, existingContributions, currentNodeInstances, record.presetSelections);
888
- const currentPresetProjectContributions = computePresetProjectContributions(context, existingContributions, currentNodeInstances, record.presetSelections);
889
- const validation = await options.strategy.validateAddition?.({
890
- targetRoot: repositoryRoot,
891
- blueprint,
892
- content: selected,
893
- definition,
894
- ...(creationInput === undefined ? {} : { creationInput }),
895
- packages: packageStates,
896
- contributions: existingContributions,
897
- getAdditionContributions: () => prepareAdditionNodes().contributions,
898
- nodeInstances: currentNodeInstances,
899
- presetProjectContributions: currentPresetProjectContributions,
900
- });
901
- if (validation?.status === "input-invalid")
902
- return validation;
903
- if (validation?.status === "conflict") {
904
- return {
905
- status: "conflict",
906
- dryRun: addOptions.dryRun ?? false,
907
- reason: "工作区策略报告了包加法冲突。",
908
- conflicts: [],
909
- ownerConflict: validation.conflict,
910
- actions: [],
911
- };
1769
+ for (const item of before.blueprint.packages) {
1770
+ if (!isDeepStrictEqual(afterDefinitions.get(item.packageDefinitionId), item)) {
1771
+ throw new Error(`After 未保留既有包定义:${item.packageDefinitionId}`);
912
1772
  }
913
1773
  }
914
- catch (error) {
915
- if (error instanceof AdditionPlanningFailure) {
916
- return fail("planning", error);
1774
+ for (const selection of before.generationRecord.selections) {
1775
+ if (!isDeepStrictEqual(options.after.generationRecord.selections.find((item) => item.selectionId === selection.selectionId), selection)) {
1776
+ throw new Error(`After 未保留既有内容选择:${selection.selectionId}`);
917
1777
  }
918
- return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
919
1778
  }
920
- const conflicting = blueprint.packages.find((candidate) => candidate.name === definition.name ||
921
- candidate.path === definition.path);
922
- if (conflicting !== undefined) {
923
- const prior = packageStates.find((item) => item.packageDefinitionId === conflicting.packageDefinitionId);
924
- if (prior !== undefined &&
925
- contentIdentityKey(prior.contentIdentity) ===
926
- contentIdentityKey(selected.identity) &&
927
- prior.definition.name === definition.name &&
928
- prior.definition.path === definition.path &&
929
- isDeepStrictEqual(prior.configuration, configuration) &&
930
- isDeepStrictEqual(prior.creationInput ?? undefined, selectionRoot.creationInput)) {
931
- return {
932
- status: "success",
933
- dryRun: addOptions.dryRun ?? false,
934
- blueprint,
935
- generationRecord: record,
936
- projection: null,
937
- actions: [],
938
- };
939
- }
940
- const samePackageIdentity = prior !== undefined &&
941
- contentIdentityKey(prior.contentIdentity) ===
942
- contentIdentityKey(selected.identity) &&
943
- prior.definition.name === definition.name &&
944
- prior.definition.path === definition.path;
945
- return {
946
- status: "conflict",
947
- dryRun: addOptions.dryRun ?? false,
948
- reason: samePackageIdentity
949
- ? "已存在的包实例不能接受不同的加包输入。"
950
- : "目标包名称或路径已被其他实例占用。",
951
- conflicts: [],
952
- identityConflict: {
953
- existing: packageIdentity(conflicting),
954
- requested: packageIdentity(definition),
955
- },
956
- actions: [],
957
- };
1779
+ if (!isDeepStrictEqual(options.after.generationRecord.composition, before.generationRecord.composition)) {
1780
+ throw new Error("After 未保留既有组合事实");
958
1781
  }
959
- const prepared = prepareAdditionNodes();
960
- const additions = prepared.nodes;
961
- const allRecords = prepared.packages;
962
- const afterBlueprint = assertProjectBlueprint(prepared.blueprint);
963
- const afterNodeInstanceIds = {
964
- ...record.nodeInstances,
1782
+ after = {
1783
+ ...options.after,
1784
+ projection: preserveProjectionPaths(before.projection, options.after.projection),
965
1785
  };
966
- if (addedProjectPreset !== undefined) {
967
- if (Object.hasOwn(record.nodeInstances, selectionRoot.nodeIdentity)) {
968
- throw new Error("加包预设节点身份已存在:" + selectionRoot.nodeIdentity);
969
- }
970
- const addedRoot = additions.find((node) => node.nodeIdentity === selectionRoot.nodeIdentity);
971
- if (addedRoot?.record === undefined) {
972
- throw new Error("加包预设节点没有持久实例:" + selectionRoot.nodeIdentity);
973
- }
974
- afterNodeInstanceIds[selectionRoot.nodeIdentity] =
975
- addedRoot.record.packageDefinitionId;
976
- }
977
- const afterPresetSelections = mergePresetSelections(record.presetSelections, addedPreset === undefined ? [] : [addedPreset]);
978
- const beforeContributions = persistedContributions(existingNodes, context, packageStates, currentNodeInstances);
979
- const afterNodes = [...existingNodes, ...additions];
980
- const afterContributions = persistedContributions(afterNodes, context, allRecords, resolveNodeInstances(allRecords, afterNodeInstanceIds));
981
- const before = project(context, state, blueprint, packageStates, beforeContributions, record.nodeInstances, record.presetSelections);
982
- const after = project(context, state, afterBlueprint, allRecords, afterContributions, afterNodeInstanceIds, afterPresetSelections);
983
- const projectedBlueprint = after.blueprint;
984
- const preconditions = additions.map((node) => ({
985
- path: node.definition.path,
1786
+ }
1787
+ catch (error) {
1788
+ return {
1789
+ status: "operation-failure",
1790
+ phase: "calculation",
1791
+ error: { message: errorMessage(error) },
1792
+ };
1793
+ }
1794
+ try {
1795
+ const existingIds = new Set(before.blueprint.packages.map((item) => item.packageDefinitionId));
1796
+ const newPackages = after.blueprint.packages.filter((item) => !existingIds.has(item.packageDefinitionId));
1797
+ const sourcesById = new Map(after.packages.map(({ package: item }) => [
1798
+ item.packageDefinitionId,
1799
+ {
1800
+ identity: `content:${contentIdentityKey(item.contentIdentity)}:${item.packageDefinitionId}`,
1801
+ label: `${contentIdentityLabel(item.contentIdentity)}(${item.definition.path})`,
1802
+ },
1803
+ ]));
1804
+ const preconditions = newPackages
1805
+ .filter((item) => item.path !== ".")
1806
+ .map((item) => ({
1807
+ path: item.path,
986
1808
  kind: "must-not-exist",
987
- reason: "新包路径已存在:" + node.definition.path,
1809
+ reason: `新包路径必须不存在:${item.path}`,
1810
+ ...(sourcesById.get(item.packageDefinitionId) === undefined
1811
+ ? {}
1812
+ : { sources: [sourcesById.get(item.packageDefinitionId)] }),
988
1813
  }));
989
- const reconciliation = await reconcileAndApplyProjectProjections({
990
- targetRoot: repositoryRoot,
991
- before: {
992
- operations: before.operations,
993
- reconciliation: before.reconciliation,
994
- },
995
- after: {
996
- operations: after.operations,
997
- reconciliation: after.reconciliation,
998
- },
1814
+ const current = await readProjectProjectionCurrent({
1815
+ targetRoot: preparation.restored.targetRoot,
1816
+ before: before.projection,
1817
+ after: after.projection,
999
1818
  preconditions,
1000
- ...(addOptions.dryRun === undefined
1001
- ? {}
1002
- : { dryRun: addOptions.dryRun }),
1003
1819
  });
1004
- if (!reconciliation.ok) {
1820
+ const planning = planProjectProjections({
1821
+ before: before.projection,
1822
+ current,
1823
+ after: after.projection,
1824
+ preconditions,
1825
+ readFacts: [...preparation.readFacts, ...(options.readFacts ?? [])],
1826
+ });
1827
+ if (!planning.ok) {
1005
1828
  return {
1006
1829
  status: "conflict",
1007
- dryRun: addOptions.dryRun ?? false,
1008
- reason: "目标工作区的现行内容与新增投影发生冲突。",
1009
- conflicts: reconciliation.conflicts,
1830
+ reason: conflictReason(planning.conflicts),
1831
+ conflicts: planning.conflicts,
1010
1832
  actions: [],
1011
1833
  };
1012
1834
  }
1835
+ pendingPlans.set(planning.plan, {
1836
+ targetRoot: current.targetRoot,
1837
+ computed: after,
1838
+ });
1013
1839
  return {
1014
- status: "success",
1015
- dryRun: addOptions.dryRun ?? false,
1016
- blueprint: projectedBlueprint,
1840
+ status: "planned",
1841
+ plan: planning.plan,
1842
+ blueprint: after.blueprint,
1017
1843
  generationRecord: after.generationRecord,
1018
- projection: after,
1019
- actions: reconciliation.actions,
1844
+ projection: after.projection,
1845
+ ownerFacts: after.ownerFacts,
1846
+ actions: planning.plan.actions,
1020
1847
  };
1021
1848
  }
1022
1849
  catch (error) {
1023
- return fail(error instanceof AdditionPlanningFailure
1024
- ? "planning"
1025
- : "reconciliation", error);
1850
+ return {
1851
+ status: "operation-failure",
1852
+ phase: "planning",
1853
+ error: { message: errorMessage(error) },
1854
+ };
1026
1855
  }
1027
1856
  }
1028
- async function configure(configureOptions) {
1029
- const repositoryRoot = path.resolve(configureOptions.repositoryRoot);
1857
+ async function planAdd(addOptions) {
1858
+ const targetRoot = path.resolve(addOptions.repositoryRoot);
1030
1859
  let restored;
1031
1860
  try {
1032
- restored = await restoreRepository(repositoryRoot);
1861
+ restored = await restoreProject({ repositoryRoot: targetRoot });
1033
1862
  }
1034
1863
  catch (error) {
1035
- return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
1036
- }
1037
- const { blueprint, record, state, packageStates } = restored;
1038
- const target = packageStates.find((item) => item.packageDefinitionId === configureOptions.packageDefinitionId);
1039
- if (target === undefined)
1040
1864
  return {
1041
- status: "input-invalid",
1042
- issues: [{ code: "UNKNOWN_GENERATED_INSTANCE" }],
1865
+ status: "operation-failure",
1866
+ phase: "metadata",
1867
+ error: { message: errorMessage(error) },
1043
1868
  };
1869
+ }
1870
+ let preparation;
1044
1871
  try {
1045
- for (const item of packageStates)
1046
- prepareContent(requireContent(item.contentIdentity));
1047
- validateRequiredBindings(packageStates);
1872
+ preparation = await prepareAddProject({
1873
+ restored,
1874
+ selection: addOptions,
1875
+ operationFacts: addOptions.operationFacts,
1876
+ });
1048
1877
  }
1049
1878
  catch (error) {
1050
- return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
1879
+ return {
1880
+ status: "operation-failure",
1881
+ phase: "preparation",
1882
+ error: { message: errorMessage(error) },
1883
+ };
1051
1884
  }
1052
- let phase = "planning";
1885
+ let before;
1886
+ let after;
1053
1887
  try {
1054
- const selected = requireContent(target.contentIdentity);
1055
- const configuration = normalizeConfiguration(selected, configureOptions.configuration);
1056
- if (isDeepStrictEqual(target.configuration, configuration)) {
1057
- return {
1058
- status: "success",
1059
- dryRun: configureOptions.dryRun ?? false,
1060
- blueprint,
1061
- generationRecord: record,
1062
- projection: null,
1063
- actions: [],
1064
- };
1065
- }
1066
- const currentNodeInstances = resolveNodeInstances(packageStates, record.nodeInstances);
1067
- const context = await options.strategy.prepareUpdate({
1068
- targetRoot: repositoryRoot,
1069
- state,
1070
- content: selected,
1071
- contentByIdentity,
1072
- configuration,
1073
- packages: packageStates,
1074
- nodeInstances: currentNodeInstances,
1075
- ...(target.creationInput === null
1076
- ? {}
1077
- : { creationInput: target.creationInput }),
1078
- });
1079
- const beforeNodes = nodesFromRecords(packageStates);
1080
- const beforeContributions = persistedContributions(beforeNodes, context, packageStates, currentNodeInstances);
1081
- await validatePresetUpdate(repositoryRoot, context, beforeContributions, currentNodeInstances, record.presetSelections);
1082
- const before = project(context, state, blueprint, packageStates, beforeContributions, record.nodeInstances, record.presetSelections);
1083
- const afterNodes = nodesFromRecords(packageStates.map((item) => item.packageDefinitionId === target.packageDefinitionId
1084
- ? { ...item, configuration }
1085
- : item));
1086
- const changed = afterNodes.find((node) => node.record?.packageDefinitionId === target.packageDefinitionId);
1087
- const additions = expandDependencies({
1088
- roots: [changed],
1089
- existing: afterNodes,
1090
- context,
1091
- occupiedIds: new Set(record.packages.map((item) => item.packageDefinitionId)),
1092
- });
1093
- const allNodes = [...afterNodes, ...additions];
1094
- const afterBlueprint = assertProjectBlueprint({
1095
- ...blueprint,
1096
- packages: [
1097
- ...blueprint.packages,
1098
- ...additions.map((node) => node.definition),
1099
- ],
1100
- });
1101
- const afterPackages = resolvePackageStates(allNodes.map((node) => node.record), afterBlueprint);
1102
- validateRequiredBindings(afterPackages);
1103
- const afterNodeInstances = resolveNodeInstances(afterPackages, record.nodeInstances);
1104
- const after = project(context, state, afterBlueprint, afterPackages, persistedContributions(allNodes, context, afterPackages, afterNodeInstances), record.nodeInstances, record.presetSelections);
1105
- phase = "reconciliation";
1106
- const reconciliation = await reconcileAndApplyProjectProjections({
1107
- targetRoot: repositoryRoot,
1108
- before: {
1109
- operations: before.operations,
1110
- reconciliation: before.reconciliation,
1888
+ before = computeProject(preparation.before);
1889
+ after = computeProject(preparation.after);
1890
+ }
1891
+ catch (error) {
1892
+ const packageIdentityIssues = error instanceof ProjectBlueprintValidationError
1893
+ ? error.packageIdentityIssues
1894
+ : [];
1895
+ return {
1896
+ status: "operation-failure",
1897
+ phase: "calculation",
1898
+ error: {
1899
+ message: errorMessage(error),
1900
+ ...(packageIdentityIssues.length === 0
1901
+ ? {}
1902
+ : { packageIdentityIssues }),
1111
1903
  },
1112
- after: {
1113
- operations: after.operations,
1114
- reconciliation: after.reconciliation,
1904
+ };
1905
+ }
1906
+ return planComputedAdd({
1907
+ preparation,
1908
+ before,
1909
+ after,
1910
+ ...(addOptions.readFacts === undefined
1911
+ ? {}
1912
+ : { readFacts: addOptions.readFacts }),
1913
+ });
1914
+ }
1915
+ async function commitPlan(plan) {
1916
+ const pending = pendingPlans.get(plan);
1917
+ if (pending === undefined) {
1918
+ return {
1919
+ status: "operation-failure",
1920
+ phase: "commit",
1921
+ error: {
1922
+ message: "提交计划必须由当前生成器的 planInit、planAdd 或 planComputedAdd 创建",
1115
1923
  },
1116
- preconditions: additions.map((node) => ({
1117
- path: node.definition.path,
1118
- kind: "must-not-exist",
1119
- reason: "新共享依赖路径已存在:" + node.definition.path,
1120
- })),
1121
- ...(configureOptions.dryRun === undefined
1122
- ? {}
1123
- : { dryRun: configureOptions.dryRun }),
1924
+ };
1925
+ }
1926
+ try {
1927
+ const committed = await commitProjectProjectionPlan({
1928
+ targetRoot: pending.targetRoot,
1929
+ plan,
1124
1930
  });
1125
- if (!reconciliation.ok)
1931
+ if (!committed.ok) {
1126
1932
  return {
1127
1933
  status: "conflict",
1128
- dryRun: configureOptions.dryRun ?? false,
1129
- reason: "目标工作区的现行内容与配置投影发生冲突。",
1130
- conflicts: reconciliation.conflicts,
1934
+ dryRun: false,
1935
+ reason: conflictReason(committed.conflicts),
1936
+ conflicts: committed.conflicts,
1131
1937
  actions: [],
1132
1938
  };
1939
+ }
1133
1940
  return {
1134
1941
  status: "success",
1135
- dryRun: configureOptions.dryRun ?? false,
1136
- blueprint: after.blueprint,
1137
- generationRecord: after.generationRecord,
1138
- projection: after,
1139
- actions: reconciliation.actions,
1942
+ dryRun: false,
1943
+ blueprint: pending.computed.blueprint,
1944
+ generationRecord: pending.computed.generationRecord,
1945
+ projection: pending.computed.projection,
1946
+ ownerFacts: pending.computed.ownerFacts,
1947
+ actions: committed.actions,
1140
1948
  };
1141
1949
  }
1142
1950
  catch (error) {
1143
- return fail(phase, error, options.strategy.diagnoseFailure?.(error));
1951
+ return {
1952
+ status: "operation-failure",
1953
+ phase: "commit",
1954
+ error: { message: errorMessage(error) },
1955
+ };
1956
+ }
1957
+ }
1958
+ async function init(initOptions) {
1959
+ const dryRun = initOptions.dryRun ?? false;
1960
+ const planned = await planInit({
1961
+ targetRoot: initOptions.targetRoot,
1962
+ selection: initOptions.selection,
1963
+ conventions: initOptions.conventions,
1964
+ operationFacts: initOptions.operationFacts,
1965
+ });
1966
+ if (planned.status === "operation-failure")
1967
+ return planned;
1968
+ if (planned.status === "conflict") {
1969
+ return { ...planned, dryRun, actions: [] };
1970
+ }
1971
+ if (!dryRun)
1972
+ return commitPlan(planned.plan);
1973
+ return {
1974
+ status: "success",
1975
+ dryRun: true,
1976
+ blueprint: planned.blueprint,
1977
+ generationRecord: planned.generationRecord,
1978
+ projection: planned.projection,
1979
+ ownerFacts: planned.ownerFacts,
1980
+ actions: planned.actions,
1981
+ };
1982
+ }
1983
+ async function add(addOptions) {
1984
+ const { dryRun = false, ...planningOptions } = addOptions;
1985
+ const planned = await planAdd(planningOptions);
1986
+ if (planned.status === "operation-failure")
1987
+ return planned;
1988
+ if (planned.status === "conflict") {
1989
+ return { ...planned, dryRun, actions: [] };
1144
1990
  }
1991
+ if (!dryRun)
1992
+ return commitPlan(planned.plan);
1993
+ return {
1994
+ status: "success",
1995
+ dryRun: true,
1996
+ blueprint: planned.blueprint,
1997
+ generationRecord: planned.generationRecord,
1998
+ projection: planned.projection,
1999
+ ownerFacts: planned.ownerFacts,
2000
+ actions: planned.actions,
2001
+ };
1145
2002
  }
1146
- return { init, add, configure };
2003
+ return {
2004
+ init,
2005
+ add,
2006
+ planInit,
2007
+ planAdd,
2008
+ planComputedAdd,
2009
+ commitPlan,
2010
+ restoreProject,
2011
+ prepareAddProject,
2012
+ prepareProject,
2013
+ computeProject,
2014
+ };
1147
2015
  }