@metaobjectsdev/metadata 0.9.0 → 0.11.0-rc.1

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 (392) hide show
  1. package/dist/attr-schema-validate.d.ts +1 -1
  2. package/dist/attr-schema-validate.d.ts.map +1 -1
  3. package/dist/attr-schema-validate.js +96 -11
  4. package/dist/attr-schema-validate.js.map +1 -1
  5. package/dist/constraint-merge.d.ts +18 -0
  6. package/dist/constraint-merge.d.ts.map +1 -0
  7. package/dist/constraint-merge.js +0 -0
  8. package/dist/constraint-merge.js.map +1 -0
  9. package/dist/constraint-validate.d.ts +6 -0
  10. package/dist/constraint-validate.d.ts.map +1 -0
  11. package/dist/constraint-validate.js +274 -0
  12. package/dist/constraint-validate.js.map +1 -0
  13. package/dist/core/attr/attr-constants.d.ts +13 -3
  14. package/dist/core/attr/attr-constants.d.ts.map +1 -1
  15. package/dist/core/attr/attr-constants.js +11 -2
  16. package/dist/core/attr/attr-constants.js.map +1 -1
  17. package/dist/core/attr/attr-definition.embedded.d.ts +3 -0
  18. package/dist/core/attr/attr-definition.embedded.d.ts.map +1 -0
  19. package/dist/core/attr/attr-definition.embedded.js +60 -0
  20. package/dist/core/attr/attr-definition.embedded.js.map +1 -0
  21. package/dist/core/documentation/doc-constants.d.ts +3 -2
  22. package/dist/core/documentation/doc-constants.d.ts.map +1 -1
  23. package/dist/core/documentation/doc-constants.js +3 -1
  24. package/dist/core/documentation/doc-constants.js.map +1 -1
  25. package/dist/core/documentation/doc-provider.d.ts.map +1 -1
  26. package/dist/core/documentation/doc-provider.js +6 -2
  27. package/dist/core/documentation/doc-provider.js.map +1 -1
  28. package/dist/core/documentation/documentation-definition.embedded.d.ts +3 -0
  29. package/dist/core/documentation/documentation-definition.embedded.d.ts.map +1 -0
  30. package/dist/core/documentation/documentation-definition.embedded.js +79 -0
  31. package/dist/core/documentation/documentation-definition.embedded.js.map +1 -0
  32. package/dist/core/field/field-constants.d.ts +7 -4
  33. package/dist/core/field/field-constants.d.ts.map +1 -1
  34. package/dist/core/field/field-constants.js +7 -7
  35. package/dist/core/field/field-constants.js.map +1 -1
  36. package/dist/core/field/field-definition.embedded.d.ts +3 -0
  37. package/dist/core/field/field-definition.embedded.d.ts.map +1 -0
  38. package/dist/core/field/field-definition.embedded.js +236 -0
  39. package/dist/core/field/field-definition.embedded.js.map +1 -0
  40. package/dist/core/field/meta-field.d.ts.map +1 -1
  41. package/dist/core/field/meta-field.js +7 -5
  42. package/dist/core/field/meta-field.js.map +1 -1
  43. package/dist/core/identity/identity-constants.d.ts.map +1 -1
  44. package/dist/core/identity/identity-constants.js +3 -0
  45. package/dist/core/identity/identity-constants.js.map +1 -1
  46. package/dist/core/identity/identity-definition.embedded.d.ts +3 -0
  47. package/dist/core/identity/identity-definition.embedded.d.ts.map +1 -0
  48. package/dist/core/identity/identity-definition.embedded.js +93 -0
  49. package/dist/core/identity/identity-definition.embedded.js.map +1 -0
  50. package/dist/core/identity/meta-identity.d.ts.map +1 -1
  51. package/dist/core/identity/meta-identity.js +8 -1
  52. package/dist/core/identity/meta-identity.js.map +1 -1
  53. package/dist/core/identity/validate-identity-passthrough.d.ts +42 -0
  54. package/dist/core/identity/validate-identity-passthrough.d.ts.map +1 -0
  55. package/dist/core/identity/validate-identity-passthrough.js +158 -0
  56. package/dist/core/identity/validate-identity-passthrough.js.map +1 -0
  57. package/dist/core/object/object-constants.d.ts +2 -1
  58. package/dist/core/object/object-constants.d.ts.map +1 -1
  59. package/dist/core/object/object-constants.js +3 -0
  60. package/dist/core/object/object-constants.js.map +1 -1
  61. package/dist/core/object/object-definition.embedded.d.ts +3 -0
  62. package/dist/core/object/object-definition.embedded.d.ts.map +1 -0
  63. package/dist/core/object/object-definition.embedded.js +110 -0
  64. package/dist/core/object/object-definition.embedded.js.map +1 -0
  65. package/dist/core/object/validate-discriminator.d.ts.map +1 -1
  66. package/dist/core/object/validate-discriminator.js +1 -3
  67. package/dist/core/object/validate-discriminator.js.map +1 -1
  68. package/dist/core/query/query-constants.d.ts.map +1 -1
  69. package/dist/core/query/query-constants.js +5 -3
  70. package/dist/core/query/query-constants.js.map +1 -1
  71. package/dist/core/relationship/derive-m2m-fields.d.ts +26 -0
  72. package/dist/core/relationship/derive-m2m-fields.d.ts.map +1 -0
  73. package/dist/core/relationship/derive-m2m-fields.js +102 -0
  74. package/dist/core/relationship/derive-m2m-fields.js.map +1 -0
  75. package/dist/core/relationship/meta-relationship.d.ts +6 -4
  76. package/dist/core/relationship/meta-relationship.d.ts.map +1 -1
  77. package/dist/core/relationship/meta-relationship.js +12 -8
  78. package/dist/core/relationship/meta-relationship.js.map +1 -1
  79. package/dist/core/relationship/relationship-constants.d.ts +6 -2
  80. package/dist/core/relationship/relationship-constants.d.ts.map +1 -1
  81. package/dist/core/relationship/relationship-constants.js +6 -2
  82. package/dist/core/relationship/relationship-constants.js.map +1 -1
  83. package/dist/core/relationship/relationship-definition.embedded.d.ts +3 -0
  84. package/dist/core/relationship/relationship-definition.embedded.d.ts.map +1 -0
  85. package/dist/core/relationship/relationship-definition.embedded.js +310 -0
  86. package/dist/core/relationship/relationship-definition.embedded.js.map +1 -0
  87. package/dist/core/validator/validator-constants.d.ts +14 -1
  88. package/dist/core/validator/validator-constants.d.ts.map +1 -1
  89. package/dist/core/validator/validator-constants.js +20 -1
  90. package/dist/core/validator/validator-constants.js.map +1 -1
  91. package/dist/core/validator/validator-definition.embedded.d.ts +3 -0
  92. package/dist/core/validator/validator-definition.embedded.d.ts.map +1 -0
  93. package/dist/core/validator/validator-definition.embedded.js +255 -0
  94. package/dist/core/validator/validator-definition.embedded.js.map +1 -0
  95. package/dist/core/yaml-desugar.d.ts.map +1 -1
  96. package/dist/core/yaml-desugar.js +88 -10
  97. package/dist/core/yaml-desugar.js.map +1 -1
  98. package/dist/core-types.d.ts +5 -2
  99. package/dist/core-types.d.ts.map +1 -1
  100. package/dist/core-types.js +285 -116
  101. package/dist/core-types.js.map +1 -1
  102. package/dist/errors.d.ts +3 -3
  103. package/dist/errors.d.ts.map +1 -1
  104. package/dist/errors.js +87 -0
  105. package/dist/errors.js.map +1 -1
  106. package/dist/index.d.ts +17 -2
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +26 -1
  109. package/dist/index.js.map +1 -1
  110. package/dist/library/embedded-library.generated.d.ts +2 -0
  111. package/dist/library/embedded-library.generated.d.ts.map +1 -0
  112. package/dist/library/embedded-library.generated.js +11 -0
  113. package/dist/library/embedded-library.generated.js.map +1 -0
  114. package/dist/library/library-sources.d.ts +12 -0
  115. package/dist/library/library-sources.d.ts.map +1 -0
  116. package/dist/library/library-sources.js +88 -0
  117. package/dist/library/library-sources.js.map +1 -0
  118. package/dist/loader/meta-data-loader.d.ts +10 -2
  119. package/dist/loader/meta-data-loader.d.ts.map +1 -1
  120. package/dist/loader/meta-data-loader.js +57 -6
  121. package/dist/loader/meta-data-loader.js.map +1 -1
  122. package/dist/loader/shortcuts.d.ts +2 -5
  123. package/dist/loader/shortcuts.d.ts.map +1 -1
  124. package/dist/loader/shortcuts.js.map +1 -1
  125. package/dist/loader/validation-passes.d.ts +3 -0
  126. package/dist/loader/validation-passes.d.ts.map +1 -1
  127. package/dist/loader/validation-passes.js +519 -34
  128. package/dist/loader/validation-passes.js.map +1 -1
  129. package/dist/loader/validation-registry.d.ts +10 -0
  130. package/dist/loader/validation-registry.d.ts.map +1 -0
  131. package/dist/loader/validation-registry.js +84 -0
  132. package/dist/loader/validation-registry.js.map +1 -0
  133. package/dist/metamodel-docs/index.d.ts +19 -0
  134. package/dist/metamodel-docs/index.d.ts.map +1 -0
  135. package/dist/metamodel-docs/index.js +37 -0
  136. package/dist/metamodel-docs/index.js.map +1 -0
  137. package/dist/metamodel-docs/provenance.d.ts +42 -0
  138. package/dist/metamodel-docs/provenance.d.ts.map +1 -0
  139. package/dist/metamodel-docs/provenance.js +148 -0
  140. package/dist/metamodel-docs/provenance.js.map +1 -0
  141. package/dist/metamodel-docs/provider-definitions.d.ts +8 -0
  142. package/dist/metamodel-docs/provider-definitions.d.ts.map +1 -0
  143. package/dist/metamodel-docs/provider-definitions.js +48 -0
  144. package/dist/metamodel-docs/provider-definitions.js.map +1 -0
  145. package/dist/metamodel-docs/render.d.ts +12 -0
  146. package/dist/metamodel-docs/render.d.ts.map +1 -0
  147. package/dist/metamodel-docs/render.js +252 -0
  148. package/dist/metamodel-docs/render.js.map +1 -0
  149. package/dist/naming-refs.d.ts +41 -0
  150. package/dist/naming-refs.d.ts.map +1 -0
  151. package/dist/naming-refs.js +144 -0
  152. package/dist/naming-refs.js.map +1 -0
  153. package/dist/naming.d.ts.map +1 -1
  154. package/dist/naming.js +10 -2
  155. package/dist/naming.js.map +1 -1
  156. package/dist/parser-core.d.ts.map +1 -1
  157. package/dist/parser-core.js +84 -9
  158. package/dist/parser-core.js.map +1 -1
  159. package/dist/persistence/db/db-constants.d.ts +10 -0
  160. package/dist/persistence/db/db-constants.d.ts.map +1 -1
  161. package/dist/persistence/db/db-constants.js +14 -0
  162. package/dist/persistence/db/db-constants.js.map +1 -1
  163. package/dist/persistence/db/db-definition.embedded.d.ts +3 -0
  164. package/dist/persistence/db/db-definition.embedded.d.ts.map +1 -0
  165. package/dist/persistence/db/db-definition.embedded.js +227 -0
  166. package/dist/persistence/db/db-definition.embedded.js.map +1 -0
  167. package/dist/persistence/db/db-provider.d.ts.map +1 -1
  168. package/dist/persistence/db/db-provider.js +13 -18
  169. package/dist/persistence/db/db-provider.js.map +1 -1
  170. package/dist/persistence/origin/origin-definition.embedded.d.ts +3 -0
  171. package/dist/persistence/origin/origin-definition.embedded.d.ts.map +1 -0
  172. package/dist/persistence/origin/origin-definition.embedded.js +88 -0
  173. package/dist/persistence/origin/origin-definition.embedded.js.map +1 -0
  174. package/dist/persistence/source/source-definition.embedded.d.ts +3 -0
  175. package/dist/persistence/source/source-definition.embedded.d.ts.map +1 -0
  176. package/dist/persistence/source/source-definition.embedded.js +17 -0
  177. package/dist/persistence/source/source-definition.embedded.js.map +1 -0
  178. package/dist/persistence/source/validate-source-parameter-ref.d.ts.map +1 -1
  179. package/dist/persistence/source/validate-source-parameter-ref.js +7 -1
  180. package/dist/persistence/source/validate-source-parameter-ref.js.map +1 -1
  181. package/dist/persistence/source/validate-source-roles.d.ts.map +1 -1
  182. package/dist/persistence/source/validate-source-roles.js +16 -1
  183. package/dist/persistence/source/validate-source-roles.js.map +1 -1
  184. package/dist/presentation/layout/layout-definition.embedded.d.ts +3 -0
  185. package/dist/presentation/layout/layout-definition.embedded.d.ts.map +1 -0
  186. package/dist/presentation/layout/layout-definition.embedded.js +16 -0
  187. package/dist/presentation/layout/layout-definition.embedded.js.map +1 -0
  188. package/dist/presentation/ui/ui-definition.embedded.d.ts +3 -0
  189. package/dist/presentation/ui/ui-definition.embedded.d.ts.map +1 -0
  190. package/dist/presentation/ui/ui-definition.embedded.js +114 -0
  191. package/dist/presentation/ui/ui-definition.embedded.js.map +1 -0
  192. package/dist/presentation/ui/ui-provider.d.ts +3 -0
  193. package/dist/presentation/ui/ui-provider.d.ts.map +1 -0
  194. package/dist/presentation/ui/ui-provider.js +21 -0
  195. package/dist/presentation/ui/ui-provider.js.map +1 -0
  196. package/dist/presentation/view/view-definition.embedded.d.ts +3 -0
  197. package/dist/presentation/view/view-definition.embedded.d.ts.map +1 -0
  198. package/dist/presentation/view/view-definition.embedded.js +76 -0
  199. package/dist/presentation/view/view-definition.embedded.js.map +1 -0
  200. package/dist/provider-data.d.ts +184 -0
  201. package/dist/provider-data.d.ts.map +1 -0
  202. package/dist/provider-data.js +271 -0
  203. package/dist/provider-data.js.map +1 -0
  204. package/dist/provider.d.ts +3 -1
  205. package/dist/provider.d.ts.map +1 -1
  206. package/dist/provider.js +15 -1
  207. package/dist/provider.js.map +1 -1
  208. package/dist/registry-coverage.d.ts +99 -0
  209. package/dist/registry-coverage.d.ts.map +1 -0
  210. package/dist/registry-coverage.js +294 -0
  211. package/dist/registry-coverage.js.map +1 -0
  212. package/dist/registry-manifest-exclusions.d.ts +62 -0
  213. package/dist/registry-manifest-exclusions.d.ts.map +1 -0
  214. package/dist/registry-manifest-exclusions.js +163 -0
  215. package/dist/registry-manifest-exclusions.js.map +1 -0
  216. package/dist/registry-manifest.d.ts +117 -0
  217. package/dist/registry-manifest.d.ts.map +1 -0
  218. package/dist/registry-manifest.js +242 -0
  219. package/dist/registry-manifest.js.map +1 -0
  220. package/dist/registry.d.ts +76 -2
  221. package/dist/registry.d.ts.map +1 -1
  222. package/dist/registry.js +37 -1
  223. package/dist/registry.js.map +1 -1
  224. package/dist/shared/structural.d.ts +7 -0
  225. package/dist/shared/structural.d.ts.map +1 -1
  226. package/dist/shared/structural.js +7 -0
  227. package/dist/shared/structural.js.map +1 -1
  228. package/dist/subtype-rules.d.ts.map +1 -1
  229. package/dist/subtype-rules.js +97 -13
  230. package/dist/subtype-rules.js.map +1 -1
  231. package/dist/super-resolve.d.ts +49 -2
  232. package/dist/super-resolve.d.ts.map +1 -1
  233. package/dist/super-resolve.js +128 -43
  234. package/dist/super-resolve.js.map +1 -1
  235. package/dist/template/meta-template.d.ts +3 -2
  236. package/dist/template/meta-template.d.ts.map +1 -1
  237. package/dist/template/meta-template.js +3 -2
  238. package/dist/template/meta-template.js.map +1 -1
  239. package/dist/template/prompt-definition.embedded.d.ts +3 -0
  240. package/dist/template/prompt-definition.embedded.d.ts.map +1 -0
  241. package/dist/template/prompt-definition.embedded.js +368 -0
  242. package/dist/template/prompt-definition.embedded.js.map +1 -0
  243. package/dist/template/prompt-provider.d.ts +3 -0
  244. package/dist/template/prompt-provider.d.ts.map +1 -0
  245. package/dist/template/prompt-provider.js +25 -0
  246. package/dist/template/prompt-provider.js.map +1 -0
  247. package/dist/template/template-constants.d.ts +2 -0
  248. package/dist/template/template-constants.d.ts.map +1 -1
  249. package/dist/template/template-constants.js +7 -0
  250. package/dist/template/template-constants.js.map +1 -1
  251. package/dist/template/template-definition.embedded.d.ts +3 -0
  252. package/dist/template/template-definition.embedded.d.ts.map +1 -0
  253. package/dist/template/template-definition.embedded.js +30 -0
  254. package/dist/template/template-definition.embedded.js.map +1 -0
  255. package/dist/validate-max-occurs.d.ts +5 -0
  256. package/dist/validate-max-occurs.d.ts.map +1 -0
  257. package/dist/validate-max-occurs.js +28 -0
  258. package/dist/validate-max-occurs.js.map +1 -0
  259. package/dist/validation-types.d.ts +36 -0
  260. package/dist/validation-types.d.ts.map +1 -0
  261. package/dist/validation-types.js +7 -0
  262. package/dist/validation-types.js.map +1 -0
  263. package/package.json +33 -22
  264. package/src/attr-schema-validate.ts +108 -8
  265. package/src/constraint-merge.ts +0 -0
  266. package/src/constraint-validate.ts +363 -0
  267. package/src/core/attr/attr-constants.ts +15 -3
  268. package/src/core/attr/attr-definition.embedded.ts +67 -0
  269. package/src/core/documentation/doc-constants.ts +3 -1
  270. package/src/core/documentation/doc-provider.ts +6 -2
  271. package/src/core/documentation/documentation-definition.embedded.ts +86 -0
  272. package/src/core/field/field-constants.ts +8 -7
  273. package/src/core/field/field-definition.embedded.ts +243 -0
  274. package/src/core/field/meta-field.ts +6 -7
  275. package/src/core/identity/identity-constants.ts +4 -0
  276. package/src/core/identity/identity-definition.embedded.ts +100 -0
  277. package/src/core/identity/meta-identity.ts +8 -1
  278. package/src/core/identity/validate-identity-passthrough.ts +194 -0
  279. package/src/core/object/object-constants.ts +3 -0
  280. package/src/core/object/object-definition.embedded.ts +117 -0
  281. package/src/core/object/validate-discriminator.ts +0 -4
  282. package/src/core/query/query-constants.ts +5 -3
  283. package/src/core/relationship/derive-m2m-fields.ts +145 -0
  284. package/src/core/relationship/meta-relationship.ts +15 -9
  285. package/src/core/relationship/relationship-constants.ts +6 -2
  286. package/src/core/relationship/relationship-definition.embedded.ts +317 -0
  287. package/src/core/validator/validator-constants.ts +22 -1
  288. package/src/core/validator/validator-definition.embedded.ts +262 -0
  289. package/src/core/yaml-desugar.ts +96 -7
  290. package/src/core-types.ts +314 -150
  291. package/src/errors.ts +89 -2
  292. package/src/index.ts +47 -2
  293. package/src/library/embedded-library.generated.ts +10 -0
  294. package/src/library/library-sources.ts +97 -0
  295. package/src/loader/meta-data-loader.ts +78 -7
  296. package/src/loader/shortcuts.ts +2 -2
  297. package/src/loader/validation-passes.ts +690 -34
  298. package/src/loader/validation-registry.ts +93 -0
  299. package/src/metamodel-docs/index.ts +41 -0
  300. package/src/metamodel-docs/provenance.ts +187 -0
  301. package/src/metamodel-docs/provider-definitions.ts +50 -0
  302. package/src/metamodel-docs/render.ts +309 -0
  303. package/src/naming-refs.ts +162 -0
  304. package/src/naming.ts +10 -2
  305. package/src/parser-core.ts +96 -9
  306. package/src/persistence/db/db-constants.ts +16 -0
  307. package/src/persistence/db/db-definition.embedded.ts +234 -0
  308. package/src/persistence/db/db-provider.ts +13 -18
  309. package/src/persistence/origin/origin-definition.embedded.ts +95 -0
  310. package/src/persistence/source/source-definition.embedded.ts +24 -0
  311. package/src/persistence/source/validate-source-parameter-ref.ts +7 -1
  312. package/src/persistence/source/validate-source-roles.ts +22 -1
  313. package/src/presentation/layout/layout-definition.embedded.ts +23 -0
  314. package/src/presentation/ui/ui-definition.embedded.ts +121 -0
  315. package/src/presentation/ui/ui-provider.ts +25 -0
  316. package/src/presentation/view/view-definition.embedded.ts +83 -0
  317. package/src/provider-data.ts +463 -0
  318. package/src/provider.ts +18 -0
  319. package/src/registry-coverage.ts +430 -0
  320. package/src/registry-manifest-exclusions.ts +176 -0
  321. package/src/registry-manifest.ts +334 -0
  322. package/src/registry.ts +106 -3
  323. package/src/shared/structural.ts +8 -0
  324. package/src/subtype-rules.ts +135 -18
  325. package/src/super-resolve.ts +153 -43
  326. package/src/template/meta-template.ts +3 -2
  327. package/src/template/prompt-definition.embedded.ts +375 -0
  328. package/src/template/prompt-provider.ts +29 -0
  329. package/src/template/template-constants.ts +8 -0
  330. package/src/template/template-definition.embedded.ts +37 -0
  331. package/src/validate-max-occurs.ts +39 -0
  332. package/src/validation-types.ts +57 -0
  333. package/dist/core/documentation/doc-schema.d.ts +0 -8
  334. package/dist/core/documentation/doc-schema.d.ts.map +0 -1
  335. package/dist/core/documentation/doc-schema.js +0 -53
  336. package/dist/core/documentation/doc-schema.js.map +0 -1
  337. package/dist/core/field/field-schema.d.ts +0 -22
  338. package/dist/core/field/field-schema.d.ts.map +0 -1
  339. package/dist/core/field/field-schema.js +0 -171
  340. package/dist/core/field/field-schema.js.map +0 -1
  341. package/dist/core/identity/identity-schema.d.ts +0 -6
  342. package/dist/core/identity/identity-schema.d.ts.map +0 -1
  343. package/dist/core/identity/identity-schema.js +0 -55
  344. package/dist/core/identity/identity-schema.js.map +0 -1
  345. package/dist/core/object/object-schema.d.ts +0 -4
  346. package/dist/core/object/object-schema.d.ts.map +0 -1
  347. package/dist/core/object/object-schema.js +0 -28
  348. package/dist/core/object/object-schema.js.map +0 -1
  349. package/dist/core/relationship/relationship-schema.d.ts +0 -4
  350. package/dist/core/relationship/relationship-schema.d.ts.map +0 -1
  351. package/dist/core/relationship/relationship-schema.js +0 -51
  352. package/dist/core/relationship/relationship-schema.js.map +0 -1
  353. package/dist/core/validator/validator-schema.d.ts +0 -4
  354. package/dist/core/validator/validator-schema.d.ts.map +0 -1
  355. package/dist/core/validator/validator-schema.js +0 -38
  356. package/dist/core/validator/validator-schema.js.map +0 -1
  357. package/dist/persistence/db/db-schema.d.ts +0 -14
  358. package/dist/persistence/db/db-schema.d.ts.map +0 -1
  359. package/dist/persistence/db/db-schema.js +0 -35
  360. package/dist/persistence/db/db-schema.js.map +0 -1
  361. package/dist/persistence/origin/origin-schema.d.ts +0 -4
  362. package/dist/persistence/origin/origin-schema.d.ts.map +0 -1
  363. package/dist/persistence/origin/origin-schema.js +0 -59
  364. package/dist/persistence/origin/origin-schema.js.map +0 -1
  365. package/dist/persistence/source/source-schema.d.ts +0 -4
  366. package/dist/persistence/source/source-schema.d.ts.map +0 -1
  367. package/dist/persistence/source/source-schema.js +0 -98
  368. package/dist/persistence/source/source-schema.js.map +0 -1
  369. package/dist/presentation/layout/layout-schema.d.ts +0 -4
  370. package/dist/presentation/layout/layout-schema.d.ts.map +0 -1
  371. package/dist/presentation/layout/layout-schema.js +0 -46
  372. package/dist/presentation/layout/layout-schema.js.map +0 -1
  373. package/dist/presentation/view/view-schema.d.ts +0 -4
  374. package/dist/presentation/view/view-schema.d.ts.map +0 -1
  375. package/dist/presentation/view/view-schema.js +0 -15
  376. package/dist/presentation/view/view-schema.js.map +0 -1
  377. package/dist/template/template-schema.d.ts +0 -3
  378. package/dist/template/template-schema.d.ts.map +0 -1
  379. package/dist/template/template-schema.js +0 -173
  380. package/dist/template/template-schema.js.map +0 -1
  381. package/src/core/documentation/doc-schema.ts +0 -64
  382. package/src/core/field/field-schema.ts +0 -228
  383. package/src/core/identity/identity-schema.ts +0 -80
  384. package/src/core/object/object-schema.ts +0 -35
  385. package/src/core/relationship/relationship-schema.ts +0 -67
  386. package/src/core/validator/validator-schema.ts +0 -50
  387. package/src/persistence/db/db-schema.ts +0 -50
  388. package/src/persistence/origin/origin-schema.ts +0 -80
  389. package/src/persistence/source/source-schema.ts +0 -129
  390. package/src/presentation/layout/layout-schema.ts +0 -62
  391. package/src/presentation/view/view-schema.ts +0 -21
  392. package/src/template/template-schema.ts +0 -211
@@ -0,0 +1,375 @@
1
+ // AUTO-GENERATED by scripts/generate-embedded-metamodel.ts — DO NOT EDIT.
2
+ // Canonical source: repo-root spec/metamodel/prompt.json
3
+ // Regenerate: bun run scripts/generate-embedded-metamodel.ts
4
+ //
5
+ // Embeds the canonical FR-033 ProviderDefinition so the provider can register
6
+ // itself wherever the on-disk spec/ tree is unavailable (bundled builds).
7
+ import type { ProviderDefinition } from "../provider-data.js";
8
+
9
+ export const PROMPT_DEFINITION: ProviderDefinition = {
10
+ "provider": "metaobjects-prompt",
11
+ "extends": [
12
+ {
13
+ "type": "field",
14
+ "subType": "*",
15
+ "children": [
16
+ {
17
+ "type": "attr",
18
+ "subType": "boolean",
19
+ "name": "xmlText",
20
+ "min": 0,
21
+ "max": 1,
22
+ "description": "When true, this field receives its element's XML TEXT CONTENT during tolerant extract (JAXB @XmlValue / Jackson @JacksonXmlText / .NET [XmlText]) instead of a same-named child. No effect for @format: json."
23
+ },
24
+ {
25
+ "type": "attr",
26
+ "subType": "string",
27
+ "name": "example",
28
+ "min": 0,
29
+ "max": 1,
30
+ "description": "FR-010: an example value for this field, shown in the generated output-format prompt fragment."
31
+ },
32
+ {
33
+ "type": "attr",
34
+ "subType": "string",
35
+ "name": "instruction",
36
+ "min": 0,
37
+ "max": 1,
38
+ "description": "FR-010: a short instruction for this field, shown in the generated output-format prompt fragment."
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "type": "field",
44
+ "subType": "enum",
45
+ "children": [
46
+ {
47
+ "type": "attr",
48
+ "subType": "properties",
49
+ "name": "enumAlias",
50
+ "min": 0,
51
+ "max": 1,
52
+ "description": "Map of alternate/off-vocabulary tokens to canonical enum members; feeds the FR-010 tolerant extract alias-fold."
53
+ },
54
+ {
55
+ "type": "attr",
56
+ "subType": "properties",
57
+ "name": "enumDoc",
58
+ "min": 0,
59
+ "max": 1,
60
+ "description": "Map of enum member to a human-readable description; shown per-member in the FR-010 'guide'-style prompt fragment."
61
+ },
62
+ {
63
+ "type": "attr",
64
+ "subType": "string",
65
+ "name": "coerceDefault",
66
+ "min": 0,
67
+ "max": 1,
68
+ "description": "Fallback enum member used by tolerant extract when a present value cannot be coerced; must be one of the field's @values."
69
+ },
70
+ {
71
+ "type": "attr",
72
+ "subType": "string",
73
+ "name": "normalize",
74
+ "min": 0,
75
+ "max": 1,
76
+ "default": "strip",
77
+ "allowedValues": [
78
+ "none",
79
+ "collapse",
80
+ "strip"
81
+ ],
82
+ "description": "ASCII normalization mode for tolerant enum extract (none|collapse|strip, default strip). On field.enum it is per-field; on object.value it is the default for the object's enum fields."
83
+ }
84
+ ]
85
+ },
86
+ {
87
+ "type": "object",
88
+ "subType": "value",
89
+ "children": [
90
+ {
91
+ "type": "attr",
92
+ "subType": "string",
93
+ "name": "normalize",
94
+ "min": 0,
95
+ "max": 1,
96
+ "default": "strip",
97
+ "allowedValues": [
98
+ "none",
99
+ "collapse",
100
+ "strip"
101
+ ],
102
+ "description": "ASCII normalization mode for tolerant enum extract (none|collapse|strip, default strip). On field.enum it is per-field; on object.value it is the default for the object's enum fields."
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "type": "template",
108
+ "subType": "prompt",
109
+ "children": [
110
+ {
111
+ "type": "attr",
112
+ "subType": "string",
113
+ "name": "payloadRef",
114
+ "min": 1,
115
+ "max": 1,
116
+ "description": "Reference to the payload (a view-object / projection) this template renders against."
117
+ },
118
+ {
119
+ "type": "attr",
120
+ "subType": "string",
121
+ "name": "textRef",
122
+ "min": 0,
123
+ "max": 1,
124
+ "description": "2-layer logical reference (group/source) to the body text, resolved by a provider at render time."
125
+ },
126
+ {
127
+ "type": "attr",
128
+ "subType": "string",
129
+ "name": "format",
130
+ "min": 0,
131
+ "max": 1,
132
+ "default": "text",
133
+ "allowedValues": [
134
+ "text",
135
+ "html",
136
+ "xml",
137
+ "csv",
138
+ "json",
139
+ "markdown",
140
+ "spreadsheet"
141
+ ],
142
+ "description": "Output format; drives the render engine's escaping/whitespace behavior."
143
+ },
144
+ {
145
+ "type": "attr",
146
+ "subType": "int",
147
+ "name": "maxChars",
148
+ "min": 0,
149
+ "max": 1,
150
+ "description": "Size budget for the rendered output, in characters."
151
+ },
152
+ {
153
+ "type": "attr",
154
+ "subType": "string",
155
+ "name": "owner",
156
+ "min": 0,
157
+ "max": 1,
158
+ "description": "Governance: the owner of this template."
159
+ },
160
+ {
161
+ "type": "attr",
162
+ "subType": "string",
163
+ "name": "since",
164
+ "min": 0,
165
+ "max": 1,
166
+ "description": "Governance: the version this template was introduced in."
167
+ },
168
+ {
169
+ "type": "attr",
170
+ "subType": "string",
171
+ "name": "requiredTags",
172
+ "isArray": true,
173
+ "min": 0,
174
+ "max": 1,
175
+ "description": "Output tags the rendered text must contain (drives the verify output-tag check)."
176
+ },
177
+ {
178
+ "type": "attr",
179
+ "subType": "int",
180
+ "name": "maxTokens",
181
+ "min": 0,
182
+ "max": 1,
183
+ "description": "Token budget for the rendered prompt (LLM-specific)."
184
+ },
185
+ {
186
+ "type": "attr",
187
+ "subType": "string",
188
+ "name": "requiredSlots",
189
+ "isArray": true,
190
+ "min": 0,
191
+ "max": 1,
192
+ "description": "Slots that must resolve at render time (drives the verify check)."
193
+ },
194
+ {
195
+ "type": "attr",
196
+ "subType": "string",
197
+ "name": "model",
198
+ "min": 0,
199
+ "max": 1,
200
+ "description": "Target model id (LLM-specific)."
201
+ },
202
+ {
203
+ "type": "attr",
204
+ "subType": "string",
205
+ "name": "responseRef",
206
+ "min": 0,
207
+ "max": 1,
208
+ "description": "Optional ref to the response value-object this prompt expects (peer of @payloadRef; drives typed LLM-call trace derivation)."
209
+ }
210
+ ]
211
+ },
212
+ {
213
+ "type": "template",
214
+ "subType": "output",
215
+ "children": [
216
+ {
217
+ "type": "attr",
218
+ "subType": "string",
219
+ "name": "payloadRef",
220
+ "min": 1,
221
+ "max": 1,
222
+ "description": "Reference to the payload (a view-object / projection) this template renders against."
223
+ },
224
+ {
225
+ "type": "attr",
226
+ "subType": "string",
227
+ "name": "textRef",
228
+ "min": 0,
229
+ "max": 1,
230
+ "description": "2-layer logical reference (group/source) to the body text, resolved by a provider at render time."
231
+ },
232
+ {
233
+ "type": "attr",
234
+ "subType": "string",
235
+ "name": "format",
236
+ "min": 0,
237
+ "max": 1,
238
+ "default": "text",
239
+ "allowedValues": [
240
+ "text",
241
+ "html",
242
+ "xml",
243
+ "csv",
244
+ "json",
245
+ "markdown",
246
+ "spreadsheet"
247
+ ],
248
+ "description": "Output format; drives the render engine's escaping/whitespace behavior."
249
+ },
250
+ {
251
+ "type": "attr",
252
+ "subType": "int",
253
+ "name": "maxChars",
254
+ "min": 0,
255
+ "max": 1,
256
+ "description": "Size budget for the rendered output, in characters."
257
+ },
258
+ {
259
+ "type": "attr",
260
+ "subType": "string",
261
+ "name": "owner",
262
+ "min": 0,
263
+ "max": 1,
264
+ "description": "Governance: the owner of this template."
265
+ },
266
+ {
267
+ "type": "attr",
268
+ "subType": "string",
269
+ "name": "since",
270
+ "min": 0,
271
+ "max": 1,
272
+ "description": "Governance: the version this template was introduced in."
273
+ },
274
+ {
275
+ "type": "attr",
276
+ "subType": "string",
277
+ "name": "requiredTags",
278
+ "isArray": true,
279
+ "min": 0,
280
+ "max": 1,
281
+ "description": "Output tags the rendered text must contain (drives the verify output-tag check)."
282
+ },
283
+ {
284
+ "type": "attr",
285
+ "subType": "string",
286
+ "name": "promptStyle",
287
+ "min": 0,
288
+ "max": 1,
289
+ "default": "guide",
290
+ "allowedValues": [
291
+ "guide",
292
+ "inline",
293
+ "exampleOnly"
294
+ ],
295
+ "description": "FR-010 output-format prompt presentation: 'guide' (prose list + example), 'inline' (inline placeholders / enum choices), or 'exampleOnly' (filled skeleton). Guidance is never emitted as comments."
296
+ },
297
+ {
298
+ "type": "attr",
299
+ "subType": "string",
300
+ "name": "kind",
301
+ "min": 0,
302
+ "max": 1,
303
+ "default": "document",
304
+ "allowedValues": [
305
+ "document",
306
+ "email"
307
+ ],
308
+ "description": "Output shape: 'document' (renders @textRef in @format → one string) or 'email' (renders subject + html + optional text → a structured EmailDocument)."
309
+ },
310
+ {
311
+ "type": "attr",
312
+ "subType": "string",
313
+ "name": "subjectRef",
314
+ "min": 0,
315
+ "max": 1,
316
+ "description": "Email only: 2-layer logical reference (group/source) to the subject-line text. Required when @kind=\"email\"."
317
+ },
318
+ {
319
+ "type": "attr",
320
+ "subType": "string",
321
+ "name": "htmlBodyRef",
322
+ "min": 0,
323
+ "max": 1,
324
+ "description": "Email only: 2-layer logical reference (group/source) to the HTML body text. Required when @kind=\"email\"."
325
+ },
326
+ {
327
+ "type": "attr",
328
+ "subType": "string",
329
+ "name": "textBodyRef",
330
+ "min": 0,
331
+ "max": 1,
332
+ "description": "Email only: 2-layer logical reference (group/source) to the optional plain-text alternative body."
333
+ }
334
+ ]
335
+ },
336
+ {
337
+ "type": "template",
338
+ "subType": "toolcall",
339
+ "children": [
340
+ {
341
+ "type": "attr",
342
+ "subType": "string",
343
+ "name": "toolName",
344
+ "min": 1,
345
+ "max": 1,
346
+ "description": "Wire tool name surfaced to the LLM (vendor-specific format)."
347
+ },
348
+ {
349
+ "type": "attr",
350
+ "subType": "string",
351
+ "name": "payloadRef",
352
+ "min": 1,
353
+ "max": 1,
354
+ "description": "Output value-object the tool produces (resolved against the metamodel)."
355
+ },
356
+ {
357
+ "type": "attr",
358
+ "subType": "string",
359
+ "name": "owner",
360
+ "min": 0,
361
+ "max": 1,
362
+ "description": "Governance: the owner of this toolcall."
363
+ },
364
+ {
365
+ "type": "attr",
366
+ "subType": "string",
367
+ "name": "since",
368
+ "min": 0,
369
+ "max": 1,
370
+ "description": "Governance: the version this toolcall was introduced in."
371
+ }
372
+ ]
373
+ }
374
+ ]
375
+ };
@@ -0,0 +1,29 @@
1
+ // promptProvider — the prompt / AI + serialization MetaDataTypeProvider
2
+ // (FR-004/006/010/011). EXTENDS the core-registered field types with the
3
+ // AI-domain markers that are NOT core field properties:
4
+ // - every field subtype: @xmlText (XML text-content extract), @example,
5
+ // @instruction (FR-010 field-teaching prompt fragment);
6
+ // - field.enum only: @enumAlias / @enumDoc / @coerceDefault / @normalize
7
+ // (FR-010/FR-011 tolerant-extract overlays);
8
+ // - object.value only: @normalize (the object-level default normalization mode
9
+ // for its enum fields' tolerant extract).
10
+ //
11
+ // FR-033 S1.5-B: the attrs + their descriptions are now DATA — read from
12
+ // spec/metamodel/prompt.json (embedded as PROMPT_DEFINITION) via the unified
13
+ // applyProviderDefinition apply path's `extends` handling. The provider declares
14
+ // no new types, so the factory map is empty.
15
+
16
+ import type { MetaDataTypeProvider } from "../provider.js";
17
+ import type { TypeRegistry } from "../registry.js";
18
+ import { applyProviderDefinition } from "../provider-data.js";
19
+ import { PROMPT_DEFINITION } from "./prompt-definition.embedded.js";
20
+
21
+ export const promptProvider: MetaDataTypeProvider = {
22
+ id: "metaobjects-prompt",
23
+ dependencies: ["metaobjects-core-types"],
24
+ description:
25
+ "Prompt / AI + serialization domain — @xmlText / @example / @instruction field markers on every field subtype, the @enumAlias/@enumDoc/@coerceDefault/@normalize tolerant-extract overlays on field.enum, and the object-level @normalize default on object.value.",
26
+ registerTypes(registry: TypeRegistry): void {
27
+ applyProviderDefinition(registry, PROMPT_DEFINITION, {});
28
+ },
29
+ };
@@ -65,6 +65,7 @@ export const TEMPLATE_ATTR_HTML_BODY_REF = "htmlBodyRef";
65
65
  export const TEMPLATE_ATTR_TEXT_BODY_REF = "textBodyRef";
66
66
 
67
67
  // Prompt-overlay attrs (template.prompt only).
68
+ export const TEMPLATE_ATTR_RESPONSE_REF = "responseRef";
68
69
  export const TEMPLATE_ATTR_MAX_TOKENS = "maxTokens";
69
70
  export const TEMPLATE_ATTR_REQUIRED_SLOTS = "requiredSlots";
70
71
  export const TEMPLATE_ATTR_MODEL = "model";
@@ -107,3 +108,10 @@ export const PROMPT_STYLES = [
107
108
  PROMPT_STYLE_EXAMPLE_ONLY,
108
109
  ] as const;
109
110
  export type PromptStyle = (typeof PROMPT_STYLES)[number];
111
+
112
+ // @xmlText — a FIELD-level marker (boolean) for the tolerant extract engine: this field
113
+ // receives its element's TEXT CONTENT when a template.output response is parsed from XML
114
+ // (JAXB @XmlValue / Jackson @JacksonXmlText / .NET [XmlText]). Registered on field.* by
115
+ // promptProvider (the prompt / AI + serialization domain owns this extract concern — NOT a
116
+ // core field property). No effect for @format: json. Mirrors Java TemplateConstants.ATTR_XML_TEXT.
117
+ export const FIELD_ATTR_XML_TEXT = "xmlText";
@@ -0,0 +1,37 @@
1
+ // AUTO-GENERATED by scripts/generate-embedded-metamodel.ts — DO NOT EDIT.
2
+ // Canonical source: repo-root spec/metamodel/template.json
3
+ // Regenerate: bun run scripts/generate-embedded-metamodel.ts
4
+ //
5
+ // Embeds the canonical FR-033 ProviderDefinition so the provider can register
6
+ // itself wherever the on-disk spec/ tree is unavailable (bundled builds).
7
+ import type { ProviderDefinition } from "../provider-data.js";
8
+
9
+ export const TEMPLATE_DEFINITION: ProviderDefinition = {
10
+ "provider": "metaobjects-core-types",
11
+ "types": [
12
+ {
13
+ "type": "template",
14
+ "subType": "base",
15
+ "description": "Abstract base template — the shared root subtype for the fourth pillar (FR-004, ADR-0011). A template is a typed payload bound to either a rendered text artifact (prompt/output) or a tool-call envelope. The base carries no attrs of its own; concrete subtypes add their reference + governance attrs.",
16
+ "rules": "A single MetaTemplate node class backs every template subtype (no subType→class dispatch); the subtype selects which reserved-attr set applies. @format (a closed-enum ATTRIBUTE, never a subtype) drives the render engine's escaper/whitespace behavior, so a new format costs one escaper + one enum value rather than a new subtype + cross-language port."
17
+ },
18
+ {
19
+ "type": "template",
20
+ "subType": "prompt",
21
+ "description": "An LLM-targeted renderable prompt template (FR-004). Carries the generic reference + governance attrs plus the LLM overlay (@maxTokens / @requiredSlots / @model / @responseRef). Its renderable body is required via @textRef.",
22
+ "rules": "prompt requires @payloadRef (the typed payload it renders against) AND @textRef (the body text, provider-resolved at render time — enforced in the loader's validateTemplatePayloadRefs pass, not at the attr layer where @textRef is relaxed to optional so template.output email can omit it). @format is a closed enum keyed by the render engine's escaper. @responseRef (optional) names the response value-object the prompt expects and drives typed LLM-call trace derivation."
23
+ },
24
+ {
25
+ "type": "template",
26
+ "subType": "output",
27
+ "description": "An output / serialization template (FR-004): every rendered artifact other than an LLM prompt — a document (email, export, docs, config) or an email. Carries the generic reference + governance attrs, the FR-010 @promptStyle, and the @kind + email part-refs.",
28
+ "rules": "output is either a document (@kind=\"document\" or absent → renders @textRef in @format to one string) or an email (@kind=\"email\" → renders subject + html + optional text to a structured EmailDocument). The cross-field presence rule is enforced in the loader's validateTemplatePayloadRefs pass: document requires @textRef; email requires @subjectRef AND @htmlBodyRef (with @textBodyRef optional) and carries NO @textRef. @format is a closed enum keyed by the render engine's escaper; @promptStyle (FR-010) selects the output-format prompt presentation and is never emitted as comments."
29
+ },
30
+ {
31
+ "type": "template",
32
+ "subType": "toolcall",
33
+ "description": "A vendor-agnostic LLM tool-call envelope (ADR-0011). Unlike prompt/output it has NO renderable text body — the body IS the structured output schema resolved via @payloadRef. This is why toolcall is its own subtype rather than template.output + @toolName. Does NOT inherit the generic attrs.",
34
+ "rules": "toolcall requires @toolName (the wire tool name surfaced to the LLM) AND @payloadRef (the output value-object the tool produces). @textRef is intentionally absent — a tool-call has no renderable text. Core keeps toolcall vendor-agnostic; vendor wire details (retry semantics, fallback shapes, parallel invocation, cache hints) are added by consumer providers via registry.extend(TYPE_TEMPLATE, \"toolcall\", { attributes: [...] }). The LLM-facing tool description reuses the @description documentation common attr (added to every type by docProvider), so it is not redeclared here."
35
+ }
36
+ ]
37
+ };
@@ -0,0 +1,39 @@
1
+ // maxOccurs enforcement — a type definition may declare `maxOccurs` (the max
2
+ // number of children of that `type.subType` permitted under one parent; `1` =
3
+ // singleton, e.g. identity.primary). This pass enforces it. It is the safety
4
+ // complement to config-driven `defaultName`: a singleton's static default name is
5
+ // only collision-free if the singleton constraint is actually enforced (two
6
+ // nameless identity.primary nodes would otherwise both default to "primary").
7
+ import type { MetaData } from "./shared/meta-data.js";
8
+ import type { TypeRegistry } from "./registry.js";
9
+ import { ParseError } from "./errors.js";
10
+
11
+ export function validateMaxOccurs(root: MetaData, registry: TypeRegistry): ParseError[] {
12
+ const errors: ParseError[] = [];
13
+ walk(root, registry, errors);
14
+ return errors;
15
+ }
16
+
17
+ function walk(node: MetaData, registry: TypeRegistry, errors: ParseError[]): void {
18
+ const counts = new Map<string, MetaData[]>();
19
+ for (const child of node.ownChildren()) {
20
+ const key = `${child.type}.${child.subType}`;
21
+ const list = counts.get(key);
22
+ if (list === undefined) counts.set(key, [child]);
23
+ else list.push(child);
24
+ }
25
+ for (const [key, group] of counts) {
26
+ const [type, subType] = key.split(".") as [string, string];
27
+ const max = registry.find(type, subType)?.maxOccurs;
28
+ if (max !== undefined && group.length > max) {
29
+ const owner = node.name !== "" ? ` under '${node.name}'` : "";
30
+ errors.push(
31
+ new ParseError(
32
+ `${key} appears ${group.length} times${owner} but at most ${max} is allowed`,
33
+ { code: "ERR_TOO_MANY_OCCURRENCES", source: group[max]!.source },
34
+ ),
35
+ );
36
+ }
37
+ }
38
+ for (const child of node.ownChildren()) walk(child, registry, errors);
39
+ }
@@ -0,0 +1,57 @@
1
+ // The validation contract — the small, dependency-light types that a TypeDefinition (and
2
+ // thus a provider) carries so its types validate themselves. Kept separate from the
3
+ // implementation (loader/validation-registry.ts) so registry.ts can reference these on
4
+ // TypeDefinition without an import cycle. See
5
+ // docs/superpowers/specs/2026-06-19-metadata-validation-architecture-design.md.
6
+
7
+ import type { MetaData } from "./shared/meta-data.js";
8
+ import type { ErrorCode } from "./errors.js";
9
+
10
+ /** A loader error code. Widened to allow DOWNSTREAM providers their own codes — the core
11
+ * union still surfaces in editor suggestions via the `string & {}` idiom. */
12
+ export type LoaderCode = ErrorCode | (string & {});
13
+
14
+ /**
15
+ * Declares that one attribute on a node is a cross-reference to another node. A provider
16
+ * attaches these to its TypeDefinition; the generic resolver enforces them against the
17
+ * symbol table — so a new reference attr validates for free, present and future.
18
+ */
19
+ export interface ReferenceDescriptor {
20
+ /** Attr name carrying the reference value (e.g. "objectRef", "references"). */
21
+ readonly attr: string;
22
+ /** Required resolved-node type (e.g. "object"). */
23
+ readonly targetType: string;
24
+ /** Required resolved-node subType (e.g. "value" for a payload ref), or any. */
25
+ readonly targetSubType?: string;
26
+ /** When true the value is `Entity.field`; resolve the entity segment (before the
27
+ * first ".", since packages use "::"). */
28
+ readonly dottedFieldPath?: boolean;
29
+ /** Code emitted on unresolved / kind-mismatch (may be a downstream code). */
30
+ readonly errorCode: LoaderCode;
31
+ }
32
+
33
+ /** Resolve a ref string to its object node. */
34
+ export interface SymbolTable {
35
+ resolveObject(ref: string): MetaData | undefined;
36
+ }
37
+
38
+ /** Handed to every validator: the symbol table + an error sink. */
39
+ export interface ValidationContext {
40
+ readonly symbols: SymbolTable;
41
+ error(code: LoaderCode, node: MetaData, message: string): void;
42
+ }
43
+
44
+ /**
45
+ * An imperative validator for a node of a given (type, subType), carried by its
46
+ * TypeDefinition — the provider that owns the type owns its validation.
47
+ *
48
+ * INTENTIONALLY UNUSED BY CORE — do not remove as "dead code". This is an EXTENSION
49
+ * POINT: a downstream provider registers a new type WITH its own validator (+ its own
50
+ * error codes) and it runs via the registry with zero core changes — see the
51
+ * `widget.gauge` proof in test/validation-registry.test.ts (the ADR-0023 thesis). It is
52
+ * also the documented escape hatch in the config-driven-validation design (issue #51) for
53
+ * novel cross-field rules that fit no declarative shape. Core's own per-type validation
54
+ * lives in reference descriptors (live) + declarative rule-shapes (#51, planned), NOT in
55
+ * this imperative per-node hook — putting a core rule here would contradict #51.
56
+ */
57
+ export type NodeValidator = (node: MetaData, ctx: ValidationContext) => void;
@@ -1,8 +0,0 @@
1
- import { type AttrSchema } from "../../registry.js";
2
- /**
3
- * The 7 universal documentation common attrs. Registered via the
4
- * registry.registerCommonAttrs() hook by the documentation provider.
5
- * Per ADR-0006, attr names are bare here; the serializer prefixes with @.
6
- */
7
- export declare const commonDocAttrs: AttrSchema[];
8
- //# sourceMappingURL=doc-schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc-schema.d.ts","sourceRoot":"","sources":["../../../src/core/documentation/doc-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAepD;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,UAAU,EA2CtC,CAAC"}
@@ -1,53 +0,0 @@
1
- import {} from "../../registry.js";
2
- import { ATTR_SUBTYPE_STRING, ATTR_SUBTYPE_STRINGARRAY, } from "../attr/attr-constants.js";
3
- import { DOC_ATTR_ALIASES, DOC_ATTR_DEPRECATED, DOC_ATTR_DESCRIPTION, DOC_ATTR_NOTES, DOC_ATTR_REPLACED_BY, DOC_ATTR_SEE_ALSO, DOC_ATTR_TITLE, } from "./doc-constants.js";
4
- /**
5
- * The 7 universal documentation common attrs. Registered via the
6
- * registry.registerCommonAttrs() hook by the documentation provider.
7
- * Per ADR-0006, attr names are bare here; the serializer prefixes with @.
8
- */
9
- export const commonDocAttrs = [
10
- {
11
- name: DOC_ATTR_DESCRIPTION,
12
- valueType: ATTR_SUBTYPE_STRING,
13
- required: false,
14
- description: "Free-form user-facing prose. Markdown allowed, multi-line via YAML '|' block scalar. Flows into doc-gen surfaces (JSDoc / XML-doc / Postgres COMMENT / Mermaid prose).",
15
- },
16
- {
17
- name: DOC_ATTR_TITLE,
18
- valueType: ATTR_SUBTYPE_STRING,
19
- required: false,
20
- description: "Short single-line human label (e.g. 'Email' for a `field.string email`). Optional supplement to description.",
21
- },
22
- {
23
- name: DOC_ATTR_NOTES,
24
- valueType: ATTR_SUBTYPE_STRING,
25
- required: false,
26
- description: "Internal-only rationale. Stays in metadata; never emitted to user-facing docs.",
27
- },
28
- {
29
- name: DOC_ATTR_DEPRECATED,
30
- valueType: ATTR_SUBTYPE_STRING,
31
- required: false,
32
- description: "Text reason for deprecation. Presence ⇒ deprecated. Codegen emits @deprecated / [Obsolete] with this reason.",
33
- },
34
- {
35
- name: DOC_ATTR_REPLACED_BY,
36
- valueType: ATTR_SUBTYPE_STRING,
37
- required: false,
38
- description: "FQN reference to the replacement element. Only meaningful with `deprecated`. Codegen appends 'Replaced by <ref>' to deprecation messages.",
39
- },
40
- {
41
- name: DOC_ATTR_SEE_ALSO,
42
- valueType: ATTR_SUBTYPE_STRINGARRAY,
43
- required: false,
44
- description: "External documentation URLs. Codegen emits @see / <seealso href=...>.",
45
- },
46
- {
47
- name: DOC_ATTR_ALIASES,
48
- valueType: ATTR_SUBTYPE_STRINGARRAY,
49
- required: false,
50
- description: "Alternate names for this element. Aids AI authoring disambiguation, search, migration.",
51
- },
52
- ];
53
- //# sourceMappingURL=doc-schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doc-schema.js","sourceRoot":"","sources":["../../../src/core/documentation/doc-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C;QACE,IAAI,EAAE,oBAAoB;QAC1B,SAAS,EAAE,mBAAmB;QAC9B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,wKAAwK;KACtL;IACD;QACE,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,mBAAmB;QAC9B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,8GAA8G;KAC5H;IACD;QACE,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,mBAAmB;QAC9B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,gFAAgF;KAC9F;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,SAAS,EAAE,mBAAmB;QAC9B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,8GAA8G;KAC5H;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,SAAS,EAAE,mBAAmB;QAC9B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,2IAA2I;KACzJ;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,SAAS,EAAE,wBAAwB;QACnC,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,uEAAuE;KACrF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,wBAAwB;QACnC,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,wFAAwF;KACtG;CACF,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { AttrSchema } from "../../registry.js";
2
- /** Attrs common to every field subtype (codegen-ts column mapper + Project D filter/sort). */
3
- export declare const commonFieldAttrs: AttrSchema[];
4
- /** The @currency attr — only on field.currency. */
5
- export declare const currencyFieldAttr: AttrSchema;
6
- /** The @values attr — only on field.enum. Required string array. */
7
- export declare const enumFieldAttr: AttrSchema;
8
- /** The @enumAlias attr — only on field.enum. Map of off-vocabulary token → canonical
9
- * member, feeding the FR-010 tolerant extract alias-fold (runtime aliases win on conflict). */
10
- export declare const enumAliasAttr: AttrSchema;
11
- /** The @enumDoc attr — only on field.enum. Map of member → human-readable description,
12
- * shown per-member in the FR-010 'guide'-style output-format prompt fragment. */
13
- export declare const enumDocAttr: AttrSchema;
14
- /** FR-011: the @coerceDefault attr — only on field.enum. String member symbol used as
15
- * the extract fallback when an LLM sends a present-but-uncoercible value. Loader-validated
16
- * to be one of the field's @values (ERR_BAD_ATTR_VALUE otherwise). */
17
- export declare const coerceDefaultAttr: AttrSchema;
18
- /** FR-011: the @normalize attr — on field.enum (per-field) and object.value (object default).
19
- * Closed enum (none|collapse|strip); controls the ASCII normalization applied during tolerant
20
- * enum extract. Resolved field → owning object.value → global default (strip). */
21
- export declare const normalizeAttr: AttrSchema;
22
- //# sourceMappingURL=field-schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-schema.d.ts","sourceRoot":"","sources":["../../../src/core/field/field-schema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAsCpD,8FAA8F;AAC9F,eAAO,MAAM,gBAAgB,EAAE,UAAU,EAyHxC,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,iBAAiB,EAAE,UAO/B,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,aAAa,EAAE,UAM3B,CAAC;AAEF;gGACgG;AAChG,eAAO,MAAM,aAAa,EAAE,UAM3B,CAAC;AAEF;kFACkF;AAClF,eAAO,MAAM,WAAW,EAAE,UAMzB,CAAC;AAEF;;uEAEuE;AACvE,eAAO,MAAM,iBAAiB,EAAE,UAM/B,CAAC;AAEF;;mFAEmF;AACnF,eAAO,MAAM,aAAa,EAAE,UAS3B,CAAC"}