@prisma/orm-framework 8.0.0-rc.2-dev.3 → 8.0.0-rc.20-dev.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 (354) hide show
  1. package/README.md +1 -5
  2. package/dist/{apply-specifier-default-control-policy-CAxiXxKg.d.mts → apply-specifier-default-control-policy-Dlz0iwnK.d.mts} +2 -2
  3. package/dist/apply-specifier-default-control-policy-Dlz0iwnK.d.mts.map +1 -0
  4. package/dist/{assertions-Cz-GWH8P.mjs → assertions-Dw1lZz_Q.mjs} +2 -2
  5. package/dist/{assertions-Cz-GWH8P.mjs.map → assertions-Dw1lZz_Q.mjs.map} +1 -1
  6. package/dist/authoring-CNUti739.mjs +764 -0
  7. package/dist/authoring-CNUti739.mjs.map +1 -0
  8. package/dist/authoring-CjwinhU5.d.mts +206 -0
  9. package/dist/authoring-CjwinhU5.d.mts.map +1 -0
  10. package/dist/binder-D_4RBHbt-BJ6VKwEZ.d.mts +515 -0
  11. package/dist/binder-D_4RBHbt-BJ6VKwEZ.d.mts.map +1 -0
  12. package/dist/{canonicalization-DFpB09nP-4OdB2nsy.d.mts → canonicalization-CyrrXGmj-CeKUkht1.d.mts} +3 -3
  13. package/dist/{canonicalization-DFpB09nP-4OdB2nsy.d.mts.map → canonicalization-CyrrXGmj-CeKUkht1.d.mts.map} +1 -1
  14. package/dist/{hashing-utils-DQgS3nOe.mjs → canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs} +23 -3
  15. package/dist/canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs.map +1 -0
  16. package/dist/{utils-DMAM0unR.mjs → canonicalize-json-ZPawceQR-Dua1VNEB.mjs} +2 -2
  17. package/dist/canonicalize-json-ZPawceQR-Dua1VNEB.mjs.map +1 -0
  18. package/dist/codec-B4ypaota.d.mts +289 -0
  19. package/dist/codec-B4ypaota.d.mts.map +1 -0
  20. package/dist/codec-Do8tfXqk.mjs +457 -0
  21. package/dist/codec-Do8tfXqk.mjs.map +1 -0
  22. package/dist/codec-descriptor-D0oY-hgs-C5e11ola.mjs +93 -0
  23. package/dist/codec-descriptor-D0oY-hgs-C5e11ola.mjs.map +1 -0
  24. package/dist/codec-types-BXLUbk-Y-DpGfKGK0.mjs +22 -0
  25. package/dist/codec-types-BXLUbk-Y-DpGfKGK0.mjs.map +1 -0
  26. package/dist/codec-types-CPgEZoIq-BL9hisr8.d.mts +384 -0
  27. package/dist/codec-types-CPgEZoIq-BL9hisr8.d.mts.map +1 -0
  28. package/dist/{components-dZRz3T5y.mjs → components-BaV9iCkq.mjs} +34 -3
  29. package/dist/components-BaV9iCkq.mjs.map +1 -0
  30. package/dist/components-CRBcIta_.d.mts +86 -0
  31. package/dist/components-CRBcIta_.d.mts.map +1 -0
  32. package/dist/components.d.mts +19 -17
  33. package/dist/components.mjs +16 -12
  34. package/dist/components__authoring.d.mts +4 -3
  35. package/dist/components__authoring.mjs +3 -2
  36. package/dist/components__codec.d.mts +3 -3
  37. package/dist/components__codec.mjs +6 -4
  38. package/dist/components__components.d.mts +6 -4
  39. package/dist/components__components.mjs +4 -3
  40. package/dist/components__control.d.mts +5 -4
  41. package/dist/components__control.mjs +3 -2
  42. package/dist/components__emission.d.mts +4 -4
  43. package/dist/components__execution.d.mts +1 -1
  44. package/dist/components__ir.d.mts +1 -1
  45. package/dist/components__ir.mjs +2 -1
  46. package/dist/components__psl-ast.d.mts +4 -4
  47. package/dist/components__psl-ast.mjs +2 -2
  48. package/dist/components__runtime.d.mts +3 -2
  49. package/dist/components__runtime.mjs +2 -2
  50. package/dist/components__utils.mjs +1 -1
  51. package/dist/{config-types-CW4PDwMC.d.mts → config-types-BTFT7QfJ.d.mts} +73 -41
  52. package/dist/config-types-BTFT7QfJ.d.mts.map +1 -0
  53. package/dist/config-types-D0mYyP62.mjs +61 -0
  54. package/dist/config-types-D0mYyP62.mjs.map +1 -0
  55. package/dist/config.d.mts +2 -3
  56. package/dist/config.mjs +2 -3
  57. package/dist/config__config-types.d.mts +2 -2
  58. package/dist/config__config-types.mjs +2 -2
  59. package/dist/contract-authoring.d.mts +152 -17
  60. package/dist/contract-authoring.d.mts.map +1 -1
  61. package/dist/contract-authoring.mjs +190 -9
  62. package/dist/contract-authoring.mjs.map +1 -1
  63. package/dist/{contract-types-CkdMH7F7-9EHXSwbH.d.mts → contract-types-DEIEpzU_-DvAVuBr5.d.mts} +14 -8
  64. package/dist/contract-types-DEIEpzU_-DvAVuBr5.d.mts.map +1 -0
  65. package/dist/{contract-validation-error-DEiWp_EI-CRwtUgRw.mjs → contract-validation-error-CAnTGhkt-DSnujRaK.mjs} +6 -3
  66. package/dist/contract-validation-error-CAnTGhkt-DSnujRaK.mjs.map +1 -0
  67. package/dist/{contract-validation-error-R7cMoK04.d.mts → contract-validation-error-D1QAeOh5.d.mts} +4 -2
  68. package/dist/contract-validation-error-D1QAeOh5.d.mts.map +1 -0
  69. package/dist/contract.d.mts +13 -12
  70. package/dist/contract.mjs +9 -9
  71. package/dist/contract__apply-specifier-default-control-policy.d.mts +1 -1
  72. package/dist/contract__contract-validation-error.d.mts +1 -1
  73. package/dist/contract__contract-validation-error.mjs +1 -1
  74. package/dist/contract__default-namespace.mjs +1 -1
  75. package/dist/contract__enum-accessor.d.mts +2 -2
  76. package/dist/contract__enum-accessor.mjs +1 -1
  77. package/dist/contract__hashing-utils.d.mts +2 -2
  78. package/dist/contract__hashing-utils.mjs +2 -3
  79. package/dist/contract__hashing.d.mts +3 -3
  80. package/dist/contract__hashing.mjs +2 -2
  81. package/dist/contract__resolve-domain-model.d.mts +1 -1
  82. package/dist/contract__types.d.mts +5 -5
  83. package/dist/contract__types.mjs +3 -3
  84. package/dist/contract__validate-domain.d.mts +1 -1
  85. package/dist/contract__validate-domain.mjs +1 -1
  86. package/dist/contract__validate-once.d.mts +2 -0
  87. package/dist/contract__validate-once.mjs +2 -0
  88. package/dist/{control-ql9N9u4f-r3Vv41kZ.d.mts → control-B5ezUWD2-BIAYxeSk.d.mts} +34 -6
  89. package/dist/control-B5ezUWD2-BIAYxeSk.d.mts.map +1 -0
  90. package/dist/{control-DLEm6u5m.mjs → control-DMJqhnwU.mjs} +309 -36
  91. package/dist/control-DMJqhnwU.mjs.map +1 -0
  92. package/dist/control-DrDTlxCS.d.mts +1 -0
  93. package/dist/{control-BD96JZi8-NUhO5Kkw.mjs → control-KsXr4fYD-D2Ows0NI.mjs} +70 -24
  94. package/dist/control-KsXr4fYD-D2Ows0NI.mjs.map +1 -0
  95. package/dist/{control-BF8qzdnM.d.mts → control-s5ECUABR.d.mts} +635 -156
  96. package/dist/control-s5ECUABR.d.mts.map +1 -0
  97. package/dist/data-type-V6mcDhcG-DVQAPOQT.mjs +275 -0
  98. package/dist/data-type-V6mcDhcG-DVQAPOQT.mjs.map +1 -0
  99. package/dist/declarations-BgUAq1RG-Dz_-EI1Q.mjs +459 -0
  100. package/dist/declarations-BgUAq1RG-Dz_-EI1Q.mjs.map +1 -0
  101. package/dist/{default-namespace-D4vCwkXg-lzVN7gSc.mjs → default-namespace-D4vCwkXg-BEZbN38y.mjs} +2 -2
  102. package/dist/{default-namespace-D4vCwkXg-lzVN7gSc.mjs.map → default-namespace-D4vCwkXg-BEZbN38y.mjs.map} +1 -1
  103. package/dist/{dist-Dqbo77p7.mjs → dist-D1f6xr7F.mjs} +51 -24
  104. package/dist/dist-D1f6xr7F.mjs.map +1 -0
  105. package/dist/{domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts → domain-envelope-CN721GnP-4huRt7Wc.d.mts} +27 -13
  106. package/dist/domain-envelope-CN721GnP-4huRt7Wc.d.mts.map +1 -0
  107. package/dist/emission-BtJvV97M.d.mts +2 -0
  108. package/dist/{emission-types-DLXP34Ki-CFms3VrX.d.mts → emission-types-B-jKEbjI-D7BW8Gk1.d.mts} +17 -16
  109. package/dist/emission-types-B-jKEbjI-D7BW8Gk1.d.mts.map +1 -0
  110. package/dist/enum-accessor-2OZgavDX.d.mts +104 -0
  111. package/dist/enum-accessor-2OZgavDX.d.mts.map +1 -0
  112. package/dist/enum-accessor-B-A2wNok.mjs +122 -0
  113. package/dist/enum-accessor-B-A2wNok.mjs.map +1 -0
  114. package/dist/errors.d.mts +5 -4
  115. package/dist/errors.mjs +4 -4
  116. package/dist/errors__control.d.mts +3 -2
  117. package/dist/errors__control.mjs +2 -2
  118. package/dist/errors__execution.d.mts +2 -2
  119. package/dist/errors__execution.mjs +2 -2
  120. package/dist/errors__migration.d.mts +2 -2
  121. package/dist/errors__migration.mjs +2 -2
  122. package/dist/execution-CjX5CCTb.d.mts +76 -0
  123. package/dist/execution-CjX5CCTb.d.mts.map +1 -0
  124. package/dist/{execution-CSnQT8EX.d.mts → execution-lMPVFj5o.d.mts} +2 -2
  125. package/dist/{execution-CSnQT8EX.d.mts.map → execution-lMPVFj5o.d.mts.map} +1 -1
  126. package/dist/execution-vfY4d-SZ.mjs +138 -0
  127. package/dist/execution-vfY4d-SZ.mjs.map +1 -0
  128. package/dist/{declarations-DR6To8_k-BFwkCGeP.mjs → expressions-CMQzbnHk-BL2zN0Iv.mjs} +199 -350
  129. package/dist/expressions-CMQzbnHk-BL2zN0Iv.mjs.map +1 -0
  130. package/dist/framework-authoring-DDxddXZm-uZYdhoE0.d.mts +1096 -0
  131. package/dist/framework-authoring-DDxddXZm-uZYdhoE0.d.mts.map +1 -0
  132. package/dist/{framework-components-hZ2tO-KH-CdRXBOYd.d.mts → framework-components-DKoQnPdB-lax1COaf.d.mts} +28 -91
  133. package/dist/framework-components-DKoQnPdB-lax1COaf.d.mts.map +1 -0
  134. package/dist/generator-functions-CXbQfvYu-BIFU1Ryx.mjs +271 -0
  135. package/dist/generator-functions-CXbQfvYu-BIFU1Ryx.mjs.map +1 -0
  136. package/dist/{hash-content-DwEUh-Rx.d.mts → hash-content-Bde14N2-.d.mts} +2 -2
  137. package/dist/{hash-content-DwEUh-Rx.d.mts.map → hash-content-Bde14N2-.d.mts.map} +1 -1
  138. package/dist/{hash-content-Bugg_nZn.mjs → hash-content-Bdl-HSfq.mjs} +2 -2
  139. package/dist/hash-content-Bdl-HSfq.mjs.map +1 -0
  140. package/dist/{hashing-BtIZVNYX.mjs → hashing-CLRfNAxh.mjs} +28 -9
  141. package/dist/hashing-CLRfNAxh.mjs.map +1 -0
  142. package/dist/hashing-D-DHz0zl.d.mts +36 -0
  143. package/dist/hashing-D-DHz0zl.d.mts.map +1 -0
  144. package/dist/{hashing-utils-qKu59RSC.d.mts → hashing-utils-DiGHKd3b.d.mts} +4 -3
  145. package/dist/{hashing-utils-qKu59RSC.d.mts.map → hashing-utils-DiGHKd3b.d.mts.map} +1 -1
  146. package/dist/ids.d.mts +90 -13
  147. package/dist/ids.d.mts.map +1 -1
  148. package/dist/ids.mjs +45 -59
  149. package/dist/ids.mjs.map +1 -1
  150. package/dist/ids__runtime.d.mts +1 -1
  151. package/dist/ids__runtime.mjs +1 -1
  152. package/dist/{index-CDk9yEbw.d.mts → index-MU-ksXsh.d.mts} +23 -6
  153. package/dist/index-MU-ksXsh.d.mts.map +1 -0
  154. package/dist/{internal-error-kK8QvlDE.d.mts → internal-error-2fJ9fcZX.d.mts} +2 -2
  155. package/dist/{internal-error-kK8QvlDE.d.mts.map → internal-error-2fJ9fcZX.d.mts.map} +1 -1
  156. package/dist/{internal-error-BIc-ehme-ouBQPoEL.mjs → internal-error-ChGYPVpq-DhUD05u0.mjs} +3 -3
  157. package/dist/internal-error-ChGYPVpq-DhUD05u0.mjs.map +1 -0
  158. package/dist/{ir-BvE7L9FK.d.mts → ir-LV4tXsw3.d.mts} +6 -5
  159. package/dist/{ir-BvE7L9FK.d.mts.map → ir-LV4tXsw3.d.mts.map} +1 -1
  160. package/dist/{ir-ChmSSAhX.mjs → ir-uDGU9vaj.mjs} +7 -53
  161. package/dist/ir-uDGU9vaj.mjs.map +1 -0
  162. package/dist/{migration-BvrgDZXw.d.mts → migration-Dluwnqe9.d.mts} +20 -3
  163. package/dist/migration-Dluwnqe9.d.mts.map +1 -0
  164. package/dist/{migration-C57VKLUY.mjs → migration-uC-bSKA4.mjs} +30 -4
  165. package/dist/migration-uC-bSKA4.mjs.map +1 -0
  166. package/dist/namespace-VUH2dgnS-By5y75h9.mjs +53 -0
  167. package/dist/namespace-VUH2dgnS-By5y75h9.mjs.map +1 -0
  168. package/dist/operations.mjs +1 -1
  169. package/dist/{parse-GbZGfMUj-BFSrD2AN.mjs → parse-bZgfjovA-BNgYhylT.mjs} +311 -55
  170. package/dist/parse-bZgfjovA-BNgYhylT.mjs.map +1 -0
  171. package/dist/{parse-0ZJjj_2N-DhQpSVmQ.d.mts → parse-djL5wker-B610mXG4.d.mts} +181 -52
  172. package/dist/parse-djL5wker-B610mXG4.d.mts.map +1 -0
  173. package/dist/psl-ast-COcYtLlz.d.mts +2 -0
  174. package/dist/psl-ast-CyvE6CR-.mjs +116 -0
  175. package/dist/psl-ast-CyvE6CR-.mjs.map +1 -0
  176. package/dist/{psl-ast-CWJQF8LA-Vr5JNPdn.d.mts → psl-ast-rY25o3Ze-ClLY3CYt.d.mts} +10 -40
  177. package/dist/psl-ast-rY25o3Ze-ClLY3CYt.d.mts.map +1 -0
  178. package/dist/psl-parser.d.mts +415 -101
  179. package/dist/psl-parser.d.mts.map +1 -1
  180. package/dist/psl-parser.mjs +2451 -537
  181. package/dist/psl-parser.mjs.map +1 -1
  182. package/dist/psl-parser__format.d.mts +8 -2
  183. package/dist/psl-parser__format.d.mts.map +1 -1
  184. package/dist/psl-parser__format.mjs +65 -34
  185. package/dist/psl-parser__format.mjs.map +1 -1
  186. package/dist/psl-parser__interpret.d.mts +98 -10
  187. package/dist/psl-parser__interpret.d.mts.map +1 -1
  188. package/dist/psl-parser__interpret.mjs +393 -2
  189. package/dist/psl-parser__interpret.mjs.map +1 -1
  190. package/dist/psl-parser__syntax.d.mts +3 -3
  191. package/dist/psl-parser__syntax.mjs +4 -43
  192. package/dist/psl-parser__tokenizer.d.mts +1 -1
  193. package/dist/psl-parser__tokenizer.mjs +1 -1
  194. package/dist/psl-printer.d.mts +7 -17
  195. package/dist/psl-printer.d.mts.map +1 -1
  196. package/dist/psl-printer.mjs +35 -104
  197. package/dist/psl-printer.mjs.map +1 -1
  198. package/dist/resolve-codec-qqMjZrmn-Cok8elAo.mjs +74 -0
  199. package/dist/resolve-codec-qqMjZrmn-Cok8elAo.mjs.map +1 -0
  200. package/dist/{resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts → resolve-domain-model-BNr1glea-BLuR-phK.d.mts} +3 -3
  201. package/dist/resolve-domain-model-BNr1glea-BLuR-phK.d.mts.map +1 -0
  202. package/dist/{result-CBZ8X9mU.mjs → result-8OXF26MN.mjs} +14 -3
  203. package/dist/{result-CBZ8X9mU.mjs.map → result-8OXF26MN.mjs.map} +1 -1
  204. package/dist/{result-Bpupv5vO.d.mts → result-BYCOANWy.d.mts} +4 -2
  205. package/dist/result-BYCOANWy.d.mts.map +1 -0
  206. package/dist/runtime-B-YYuWy2.d.mts +899 -0
  207. package/dist/runtime-B-YYuWy2.d.mts.map +1 -0
  208. package/dist/runtime-DSYSc98Y.mjs +1059 -0
  209. package/dist/runtime-DSYSc98Y.mjs.map +1 -0
  210. package/dist/runtime-error-CO4MA3Px-YW5SCUcH.d.mts +19 -0
  211. package/dist/runtime-error-CO4MA3Px-YW5SCUcH.d.mts.map +1 -0
  212. package/dist/{structured-error-CgiSMpdU.mjs → structured-error-BXbihKQ-.mjs} +3 -3
  213. package/dist/{structured-error-CgiSMpdU.mjs.map → structured-error-BXbihKQ-.mjs.map} +1 -1
  214. package/dist/{structured-error-BsNT4Hun.d.mts → structured-error-Cc7AIRsp.d.mts} +19 -5
  215. package/dist/structured-error-Cc7AIRsp.d.mts.map +1 -0
  216. package/dist/suppress-idle-connection-errors-CKrTbp5P.d.mts +18 -0
  217. package/dist/suppress-idle-connection-errors-CKrTbp5P.d.mts.map +1 -0
  218. package/dist/suppress-idle-connection-errors-DzApeUb3.mjs +22 -0
  219. package/dist/suppress-idle-connection-errors-DzApeUb3.mjs.map +1 -0
  220. package/dist/temporal-presets-5TK1pTYJ-DmhrnMP1.mjs +1276 -0
  221. package/dist/temporal-presets-5TK1pTYJ-DmhrnMP1.mjs.map +1 -0
  222. package/dist/temporal-presets-BuMqk7h8-DZSuu4Z_.d.mts +258 -0
  223. package/dist/temporal-presets-BuMqk7h8-DZSuu4Z_.d.mts.map +1 -0
  224. package/dist/text-C3TTEtgd.mjs +35 -0
  225. package/dist/text-C3TTEtgd.mjs.map +1 -0
  226. package/dist/text-C8_-rheN.d.mts +15 -0
  227. package/dist/text-C8_-rheN.d.mts.map +1 -0
  228. package/dist/{tokenizer-1hAHZzmp-QGPORvmA.mjs → tokenizer-C-GTKKjR-B1vOzJy0.mjs} +54 -10
  229. package/dist/tokenizer-C-GTKKjR-B1vOzJy0.mjs.map +1 -0
  230. package/dist/{tokenizer-DcYI0Xrq-C-nNE9mE.d.mts → tokenizer-i8RaVWVa-7fRwlCPP.d.mts} +9 -4
  231. package/dist/tokenizer-i8RaVWVa-7fRwlCPP.d.mts.map +1 -0
  232. package/dist/ts-render.d.mts +2 -2
  233. package/dist/ts-render.mjs +2 -2
  234. package/dist/type-constructor-calls-BLf-HsFy-D_jbIqj8.mjs +261 -0
  235. package/dist/type-constructor-calls-BLf-HsFy-D_jbIqj8.mjs.map +1 -0
  236. package/dist/{types-BnH4zYvN.mjs → types-B8ULzMAX.mjs} +36 -3
  237. package/dist/types-B8ULzMAX.mjs.map +1 -0
  238. package/dist/types-GNXJ7xW2.d.mts +131 -0
  239. package/dist/types-GNXJ7xW2.d.mts.map +1 -0
  240. package/dist/{types-import-spec-3mjbVBhI-DQI6BvKU.d.mts → types-import-spec-DQjfX-gM-zVncuzs0.d.mts} +6 -6
  241. package/dist/types-import-spec-DQjfX-gM-zVncuzs0.d.mts.map +1 -0
  242. package/dist/utils.d.mts +7 -5
  243. package/dist/utils.mjs +9 -7
  244. package/dist/utils__assertions.mjs +1 -1
  245. package/dist/utils__hash-content.d.mts +1 -1
  246. package/dist/utils__hash-content.mjs +1 -1
  247. package/dist/utils__internal-error.d.mts +1 -1
  248. package/dist/utils__internal-error.mjs +1 -1
  249. package/dist/utils__result.d.mts +2 -2
  250. package/dist/utils__result.mjs +2 -2
  251. package/dist/utils__structured-error.d.mts +2 -2
  252. package/dist/utils__structured-error.mjs +1 -1
  253. package/dist/utils__suppress-idle-connection-errors.d.mts +2 -0
  254. package/dist/utils__suppress-idle-connection-errors.mjs +2 -0
  255. package/dist/utils__text.d.mts +2 -0
  256. package/dist/utils__text.mjs +2 -0
  257. package/dist/{validate-domain-BNBs-TVv.d.mts → validate-domain-B5kmlBFB.d.mts} +10 -6
  258. package/dist/validate-domain-B5kmlBFB.d.mts.map +1 -0
  259. package/dist/{validate-domain-BkvFlY3B.mjs → validate-domain-CbXHDYpF.mjs} +43 -22
  260. package/dist/validate-domain-CbXHDYpF.mjs.map +1 -0
  261. package/dist/validate-once-D-IwXHYP.mjs +42 -0
  262. package/dist/validate-once-D-IwXHYP.mjs.map +1 -0
  263. package/dist/validate-once-gfCOHsDh.d.mts +16 -0
  264. package/dist/validate-once-gfCOHsDh.d.mts.map +1 -0
  265. package/package.json +24 -20
  266. package/dist/apply-specifier-default-control-policy-CAxiXxKg.d.mts.map +0 -1
  267. package/dist/authoring-B2H-9qCv.d.mts +0 -1
  268. package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs +0 -25
  269. package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs.map +0 -1
  270. package/dist/capabilities-BCEONw9w-C-lo3rF8.mjs +0 -120
  271. package/dist/capabilities-BCEONw9w-C-lo3rF8.mjs.map +0 -1
  272. package/dist/codec-Cd0QcxAx.mjs +0 -63
  273. package/dist/codec-Cd0QcxAx.mjs.map +0 -1
  274. package/dist/codec-Ce07W3Mz.d.mts +0 -112
  275. package/dist/codec-Ce07W3Mz.d.mts.map +0 -1
  276. package/dist/codec-types-D6VRj2RE-BLElXc-O.d.mts +0 -223
  277. package/dist/codec-types-D6VRj2RE-BLElXc-O.d.mts.map +0 -1
  278. package/dist/codec-types-DcNvNeY1-BO6kUiH0.mjs +0 -30
  279. package/dist/codec-types-DcNvNeY1-BO6kUiH0.mjs.map +0 -1
  280. package/dist/components-CGA_WwEG.d.mts +0 -50
  281. package/dist/components-CGA_WwEG.d.mts.map +0 -1
  282. package/dist/components-dZRz3T5y.mjs.map +0 -1
  283. package/dist/config-types-BqhNxw0z.mjs +0 -67
  284. package/dist/config-types-BqhNxw0z.mjs.map +0 -1
  285. package/dist/config-types-CW4PDwMC.d.mts.map +0 -1
  286. package/dist/config-validation-DPt5hwQx.mjs +0 -168
  287. package/dist/config-validation-DPt5hwQx.mjs.map +0 -1
  288. package/dist/config-validation-Wiqew2J9.d.mts +0 -21
  289. package/dist/config-validation-Wiqew2J9.d.mts.map +0 -1
  290. package/dist/config__config-validation.d.mts +0 -2
  291. package/dist/config__config-validation.mjs +0 -2
  292. package/dist/contract-types-CkdMH7F7-9EHXSwbH.d.mts.map +0 -1
  293. package/dist/contract-validation-error-DEiWp_EI-CRwtUgRw.mjs.map +0 -1
  294. package/dist/contract-validation-error-R7cMoK04.d.mts.map +0 -1
  295. package/dist/control-BD96JZi8-NUhO5Kkw.mjs.map +0 -1
  296. package/dist/control-BF8qzdnM.d.mts.map +0 -1
  297. package/dist/control-DLEm6u5m.mjs.map +0 -1
  298. package/dist/control-ql9N9u4f-r3Vv41kZ.d.mts.map +0 -1
  299. package/dist/declarations-DR6To8_k-BFwkCGeP.mjs.map +0 -1
  300. package/dist/dist-Dqbo77p7.mjs.map +0 -1
  301. package/dist/domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts.map +0 -1
  302. package/dist/emission-CmUO03gQ.d.mts +0 -2
  303. package/dist/emission-types-DLXP34Ki-CFms3VrX.d.mts.map +0 -1
  304. package/dist/enum-accessor-Db5DaTNX.mjs +0 -35
  305. package/dist/enum-accessor-Db5DaTNX.mjs.map +0 -1
  306. package/dist/enum-accessor-PH5vjghI.d.mts +0 -85
  307. package/dist/enum-accessor-PH5vjghI.d.mts.map +0 -1
  308. package/dist/execution-Crk6IfTs.mjs +0 -218
  309. package/dist/execution-Crk6IfTs.mjs.map +0 -1
  310. package/dist/execution-Cyl2dXxX.d.mts +0 -115
  311. package/dist/execution-Cyl2dXxX.d.mts.map +0 -1
  312. package/dist/framework-authoring-BhctBwih-DQ_6noDM.d.mts +0 -777
  313. package/dist/framework-authoring-BhctBwih-DQ_6noDM.d.mts.map +0 -1
  314. package/dist/framework-authoring-CDEvlouU-DKklu-fL.mjs +0 -698
  315. package/dist/framework-authoring-CDEvlouU-DKklu-fL.mjs.map +0 -1
  316. package/dist/framework-components-hZ2tO-KH-CdRXBOYd.d.mts.map +0 -1
  317. package/dist/hash-content-Bugg_nZn.mjs.map +0 -1
  318. package/dist/hashing-BtIZVNYX.mjs.map +0 -1
  319. package/dist/hashing-CccSPELN.d.mts +0 -25
  320. package/dist/hashing-CccSPELN.d.mts.map +0 -1
  321. package/dist/hashing-utils-DQgS3nOe.mjs.map +0 -1
  322. package/dist/index-CDk9yEbw.d.mts.map +0 -1
  323. package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs.map +0 -1
  324. package/dist/ir-ChmSSAhX.mjs.map +0 -1
  325. package/dist/migration-BvrgDZXw.d.mts.map +0 -1
  326. package/dist/migration-C57VKLUY.mjs.map +0 -1
  327. package/dist/parse-0ZJjj_2N-DhQpSVmQ.d.mts.map +0 -1
  328. package/dist/parse-GbZGfMUj-BFSrD2AN.mjs.map +0 -1
  329. package/dist/psl-ast-BXZoFQBk.d.mts +0 -37
  330. package/dist/psl-ast-BXZoFQBk.d.mts.map +0 -1
  331. package/dist/psl-ast-CWJQF8LA-Vr5JNPdn.d.mts.map +0 -1
  332. package/dist/psl-ast-DUCvVXbB.mjs +0 -239
  333. package/dist/psl-ast-DUCvVXbB.mjs.map +0 -1
  334. package/dist/psl-parser__syntax.mjs.map +0 -1
  335. package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs +0 -59
  336. package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs.map +0 -1
  337. package/dist/resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts.map +0 -1
  338. package/dist/result-Bpupv5vO.d.mts.map +0 -1
  339. package/dist/runtime-BqzioOmU.mjs +0 -670
  340. package/dist/runtime-BqzioOmU.mjs.map +0 -1
  341. package/dist/runtime-Cuxw8obj.d.mts +0 -1038
  342. package/dist/runtime-Cuxw8obj.d.mts.map +0 -1
  343. package/dist/structured-error-BsNT4Hun.d.mts.map +0 -1
  344. package/dist/symbol-table-CZ7EVCTL-CR-ncCpD.d.mts +0 -125
  345. package/dist/symbol-table-CZ7EVCTL-CR-ncCpD.d.mts.map +0 -1
  346. package/dist/tokenizer-1hAHZzmp-QGPORvmA.mjs.map +0 -1
  347. package/dist/tokenizer-DcYI0Xrq-C-nNE9mE.d.mts.map +0 -1
  348. package/dist/types-BnH4zYvN.mjs.map +0 -1
  349. package/dist/types-ByeQhU9p.d.mts +0 -17
  350. package/dist/types-ByeQhU9p.d.mts.map +0 -1
  351. package/dist/types-import-spec-3mjbVBhI-DQI6BvKU.d.mts.map +0 -1
  352. package/dist/utils-DMAM0unR.mjs.map +0 -1
  353. package/dist/validate-domain-BNBs-TVv.d.mts.map +0 -1
  354. package/dist/validate-domain-BkvFlY3B.mjs.map +0 -1
@@ -0,0 +1,22 @@
1
+ //#region ../../../1-framework/1-core/framework-components/dist/codec-types-BXLUbk-Y.mjs
2
+ /** Every semantic trait a codec may advertise. The runtime tuple backs validation of trait-keyed contributions arriving from JavaScript. */
3
+ const CODEC_TRAITS = [
4
+ "equality",
5
+ "order",
6
+ "boolean",
7
+ "numeric",
8
+ "textual"
9
+ ];
10
+ /** Whether `value` names one of the {@link CODEC_TRAITS}. */
11
+ function isCodecTrait(value) {
12
+ return CODEC_TRAITS.some((trait) => trait === value);
13
+ }
14
+ /** A lookup with no codecs. It has no `descriptorFor`, so a stub that adds codecs to it through `get` cannot pass for a lookup of descriptors that answers nothing. */
15
+ const emptyCodecLookup = {
16
+ get: () => void 0,
17
+ renderOutputTypeFor: () => void 0
18
+ };
19
+ //#endregion
20
+ export { isCodecTrait as n, emptyCodecLookup as t };
21
+
22
+ //# sourceMappingURL=codec-types-BXLUbk-Y-DpGfKGK0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-types-BXLUbk-Y-DpGfKGK0.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec-types-BXLUbk-Y.mjs"],"sourcesContent":["//#region src/shared/codec-types.ts\n/** Every semantic trait a codec may advertise. The runtime tuple backs validation of trait-keyed contributions arriving from JavaScript. */\nconst CODEC_TRAITS = [\n\t\"equality\",\n\t\"order\",\n\t\"boolean\",\n\t\"numeric\",\n\t\"textual\"\n];\n/** Whether `value` names one of the {@link CODEC_TRAITS}. */\nfunction isCodecTrait(value) {\n\treturn CODEC_TRAITS.some((trait) => trait === value);\n}\n/** A lookup with no codecs. It has no `descriptorFor`, so a stub that adds codecs to it through `get` cannot pass for a lookup of descriptors that answers nothing. */\nconst emptyCodecLookup = {\n\tget: () => void 0,\n\trenderOutputTypeFor: () => void 0\n};\n//#endregion\nexport { isCodecTrait as n, emptyCodecLookup as t };\n\n//# sourceMappingURL=codec-types-BXLUbk-Y.mjs.map"],"mappings":";;AAEA,MAAM,eAAe;CACpB;CACA;CACA;CACA;CACA;AACD;;AAEA,SAAS,aAAa,OAAO;CAC5B,OAAO,aAAa,MAAM,UAAU,UAAU,KAAK;AACpD;;AAEA,MAAM,mBAAmB;CACxB,WAAW,KAAK;CAChB,2BAA2B,KAAK;AACjC"}
@@ -0,0 +1,384 @@
1
+ import { B as JsonValue } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
2
+ import { Type } from "arktype";
3
+ import { StandardSchemaV1 } from "@standard-schema/spec";
4
+ //#region ../../../1-framework/1-core/framework-components/dist/codec-types-CPgEZoIq.d.mts
5
+ //#region src/shared/data-type.d.ts
6
+ /**
7
+ * The identity of a data type: `owner/name`, with no version. A type's identity does not change;
8
+ * what changes over time is a representation of it, which is a codec, and codec ids carry a
9
+ * version. The two forms differ visibly so that one string never names both.
10
+ */
11
+ type DataTypeId = string & {
12
+ readonly __dataTypeId: 'DataTypeId';
13
+ };
14
+ /**
15
+ * A pure function from the stored form of a value of the type it casts from to JSON the type that
16
+ * declares it constructs its value from. It may throw a structured error for a value it cannot
17
+ * convert.
18
+ */
19
+ type Cast = (value: JsonValue) => JsonValue;
20
+ /**
21
+ * How a type whose single value holds several elements takes a written list: each element's type
22
+ * must be one of `of`, `cast` receives the elements' stored forms in written order, and the type
23
+ * constructs its value from what it returns.
24
+ */
25
+ interface ListCast {
26
+ readonly of: readonly DataTypeId[];
27
+ readonly cast: (elements: readonly JsonValue[]) => JsonValue;
28
+ }
29
+ /** A data type's parameters: an empty object for a type without any. */
30
+ type DataTypeParams = Readonly<Record<string, unknown>>;
31
+ declare class DataTypeValueRecord<J extends JsonValue> {
32
+ #private;
33
+ readonly type: DataTypeId;
34
+ readonly params: DataTypeParams;
35
+ readonly value: J;
36
+ constructor(type: DataTypeId, params: DataTypeParams, value: J);
37
+ static isConstructed(value: unknown): boolean;
38
+ }
39
+ /**
40
+ * A value of a data type: the type's id, the parameters it holds the value under, and `value`, the JSON form `contract.json` stores. Only a data type constructs one, through {@link DataType.fromContract} and {@link DataType.valueFrom}. ADR 254.
41
+ */
42
+ type DataTypeValue<J extends JsonValue = JsonValue> = DataTypeValueRecord<J>;
43
+ /** Reads JSON the type stores, under the type's parameters, and returns it; it refuses any other JSON, and a value the parameters exclude, with `refuseJsonValue`. */
44
+ type DataTypeReader = (json: JsonValue, params: DataTypeParams) => JsonValue;
45
+ /** The one spelling of a value the reader accepted, under the column's parameters: the type's whole spelling step, whether or not parameters change it, as `pg/uuid` writes lower case and `numeric(10,2)` two fraction digits. A stored value in another spelling is refused, and a value a codec hands over is written in this one. */
46
+ type DataTypeSpelling = (json: JsonValue, params: DataTypeParams) => JsonValue;
47
+ interface DataType {
48
+ readonly id: DataTypeId;
49
+ /** An arktype object schema of the type's parameters. A type without one has no parameters. */
50
+ readonly params?: Type<unknown>;
51
+ /** Keyed by the id of the type each cast takes values of. */
52
+ readonly casts: Readonly<Record<DataTypeId, Cast>>;
53
+ readonly listCast?: ListCast;
54
+ /** The value `json` stores under `params`. It refuses JSON the type does not store in that form, a value the parameters exclude, and JSON in a spelling other than the one the parameters give. */
55
+ fromContract(json: JsonValue, params: DataTypeParams): DataTypeValue;
56
+ /** A value of the type built from `json`: read under `params`, which refuse a value they exclude, and written in the spelling they give. Every producer of a value that is not reading `contract.json` builds it here: a codec, a written default, a cast. */
57
+ valueFrom<J extends JsonValue>(json: J, params: DataTypeParams): DataTypeValue<J>;
58
+ /** The JSON `contract.json` stores for `value`. */
59
+ toContract(value: DataTypeValue): JsonValue;
60
+ /** A key two stored forms share exactly when the type's equality holds them equal. Declared by a type whose equal values have more than one stored form, as `numeric` stores `0.5` and `0.50`; for every other type, values are equal when their stored forms are. */
61
+ readonly equalityKey?: (json: JsonValue) => string;
62
+ }
63
+ interface DataTypeSpec {
64
+ readonly params?: Type<unknown>;
65
+ readonly casts?: Readonly<Record<string, Cast>>;
66
+ readonly listCast?: {
67
+ readonly of: readonly string[];
68
+ readonly cast: ListCast['cast'];
69
+ };
70
+ /** Accepts every spelling of a value the type holds, and refuses anything else. */
71
+ readonly read: DataTypeReader;
72
+ /** Gives an accepted value its one spelling; a type whose values have one spelling only declares none. */
73
+ readonly spell?: DataTypeSpelling;
74
+ /** See {@link DataType.equalityKey}. */
75
+ readonly equalityKey?: (json: JsonValue) => string;
76
+ /** The one form of parameters that mean the same type, such as `numeric(10)` and `numeric(10,0)`; a value stores its parameters in it. A type whose parameters have one form only declares none. */
77
+ normalize?(params: DataTypeParams): DataTypeParams;
78
+ }
79
+ /** The assembled types of one stack, by id. */
80
+ interface DataTypeLookup {
81
+ get(id: string): DataType | undefined;
82
+ has(id: string): boolean;
83
+ }
84
+ /** Read `id` as a data type id, refusing anything that is not `owner/name` in lower case. */
85
+ declare function dataTypeId(id: string): DataTypeId;
86
+ /** Declare a data type. Every id it names, its own and each cast's source, is validated here. */
87
+ declare function dataType(id: string, spec: DataTypeSpec): DataType;
88
+ /** What is wrong with the parameters given a data type: the message to report and each parameter it refuses. */
89
+ interface DataTypeParamsProblem {
90
+ readonly dataType: DataTypeId;
91
+ readonly message: string;
92
+ readonly parameters: readonly string[];
93
+ }
94
+ /** What is wrong with `params` for `type`, or undefined when `type` accepts them or has no parameter schema. */
95
+ declare function dataTypeParamsProblem(type: DataType, params: Readonly<Record<string, unknown>>): DataTypeParamsProblem | undefined;
96
+ /** Refuses `params` that `type` does not accept with `CONTRACT.TYPE_PARAMS_INVALID`, naming the data type and each parameter it refuses, plus the facts in `meta`. */
97
+ declare function assertDataTypeParams(type: DataType, params: Readonly<Record<string, unknown>>, meta?: Readonly<Record<string, unknown>>): void;
98
+ /** `value`, when it is a value of `type` that a data type constructed; anything else is a bug in `holder`'s caller. */
99
+ declare function requireValueOf(type: DataTypeId, value: DataTypeValue, holder: string): DataTypeValue;
100
+ /** The parameters in `typeParams` that `type` declares; keys a codec keeps for itself are dropped. */
101
+ declare function dataTypeParams(type: DataType, typeParams: unknown): DataTypeParams;
102
+ /** Whether two values are one: the same type, equal parameters, and JSON equal as canonical JSON. */
103
+ declare function dataTypeValuesEqual(a: DataTypeValue, b: DataTypeValue): boolean;
104
+ /** The keys an arktype object schema declares, or undefined when `schema` is not one. */
105
+ declare function objectSchemaKeys(schema: unknown): readonly string[] | undefined;
106
+ /** The required keys an arktype object schema declares, or undefined when `schema` is not one. */
107
+ declare function requiredSchemaKeys(schema: unknown): readonly string[] | undefined;
108
+ /** The keys of an arktype object schema whose own schema accepts `value`, or undefined when `schema` is not one. */
109
+ declare function schemaKeysAllowing(schema: unknown, value: unknown): readonly string[] | undefined;
110
+ /** The parameters a data type requires. */
111
+ declare function requiredParamKeys(type: DataType): readonly string[];
112
+ declare function createDataTypeLookup(types: readonly DataType[]): DataTypeLookup;
113
+ /** Collect every data type the composed components register, refusing two declarations of one id. */
114
+ declare function assembleDataTypes(descriptors: ReadonlyArray<{
115
+ readonly id?: string;
116
+ readonly dataTypes?: ReadonlyArray<DataType>;
117
+ }>): {
118
+ readonly lookup: DataTypeLookup;
119
+ readonly declared: ReadonlyArray<{
120
+ readonly type: DataType;
121
+ readonly contributedBy: string;
122
+ }>;
123
+ };
124
+ //#endregion
125
+ //#region src/shared/codec-descriptor.d.ts
126
+ /**
127
+ * Unified codec descriptor. Every codec in the framework registers through this shape — non-parameterized codecs use `P = void` and a constant factory that returns the same shared codec instance for every column; parameterized codecs use a non-empty `P` and a curried higher-order factory that returns a per-instance codec.
128
+ *
129
+ * The descriptor is the codec-id-keyed source of truth for static metadata (`traits`) and registration concerns (`paramsSchema` for JSON-boundary validation; `renderOutputType` for the rare codec whose `contract.d.ts` output type no type can compute from its params). The runtime `Codec` instance returned by `factory(params)(ctx)` carries only the conversion behavior.
130
+ *
131
+ * Whether a codec id "is parameterized" stops being a registration-time distinction — it's a property of `P` on the descriptor. The descriptor map indexes every descriptor by `codecId`; both `descriptorFor(codecId)` and `forColumn(table, column)` resolve through the same map without branching on parameterization.
132
+ *
133
+ * @template P - The shape of the params accepted by the factory (`void` for non-parameterized codecs; a record like `{ length: number }` for parameterized codecs).
134
+ *
135
+ * Codec-registry-unification project § Decision.
136
+ */
137
+ interface CodecDescriptorTemplate<P = void> {
138
+ /** The codec ID this descriptor applies to (e.g. `pg/vector@1`, `pg/text@1`). */
139
+ readonly codecId: string;
140
+ /** Semantic traits for operator gating (e.g. equality, order, numeric). */
141
+ readonly traits: readonly CodecTrait[];
142
+ /** Standard Schema validator for the factory's params. Validates JSON-sourced params at the contract boundary (PSL → IR; `contract.json` → runtime). `undefined` for a codec that takes no params (`P = void`), which then rejects any `typeParams`. */
143
+ readonly paramsSchema: StandardSchemaV1<P> | undefined;
144
+ /** Whether this descriptor takes params, i.e. has a `paramsSchema`. Consumers that need to gate column-aware dispatch read this directly rather than threading a free-floating `(codecId) => boolean` callback. */
145
+ readonly isParameterized: boolean;
146
+ /**
147
+ * Emit-path string renderer for `contract.d.ts`: the TypeScript output type expression for given params. Only for a codec whose output type no type can compute from its params, such as `arktype/json@1`, whose type is its schema's expression text. A codec whose output type is a function of its params declares it as a type instead, in its pack's `ParameterizedOutputTypesFunction` (`types.codecTypes.parameterizedOutputTypes`), which both the emitted `contract.d.ts` and `defineContract` apply. Absent, the emitter uses that type function or the codec's base output type.
148
+ */
149
+ readonly renderOutputType?: (params: P) => string | undefined;
150
+ /** Emit-path string renderer for the `contract.d.ts` *input* position (create/update values). Returns the TypeScript input type expression for given params. Optional; absent renderers fall back to the codec's base input type. A codec supplies this when its write type is narrower than the generic codec input — e.g. an enum whose input should be the literal member union, not `string`. */
151
+ readonly renderInputType?: (params: P) => string | undefined;
152
+ /**
153
+ * Given one stored (codec-encoded) value, return the TypeScript literal type to print for it
154
+ * (e.g. `'low'`, `1`), or `undefined` if this codec's output isn't literal-expressible (e.g. a
155
+ * Date-output codec).
156
+ *
157
+ * `value` is the stored JSON of a value in the value set, as the codec's data type stores it. `side` selects which type to print:
158
+ * `output` = the read/SELECT type; `input` = the create/update type. Most codecs render the same
159
+ * literal for both, but a codec whose read and write types differ can render per side. Called once
160
+ * per permitted value; the caller joins the results with `|`.
161
+ */
162
+ readonly renderValueLiteral?: (value: JsonValue, side: 'output' | 'input') => string | undefined;
163
+ /** Why an enum cannot use this codec, as sentences an enum's refusal quotes, ending with what to use instead. A codec with the `equality` trait sets it when no value a query reads back equals a member as the contract stores it. A codec without the trait may set it to give a more specific reason than the generic one. Read it through {@link enumRefusalOf}, which also refuses a codec without the `equality` trait. */
164
+ readonly enumRefusal?: string;
165
+ /** `true` for a codec whose application value keeps the form a value was written in, so two values its data type's `equalityKey` holds equal can read back as different application values, as a decimal codec reads `0.50` and `0.5` as two strings. Such a codec renders no literal, its codec type map entry carries the same flag, and an enum on it is typed by the codec's output type on every type path. Only a codec whose data type declares an `equalityKey` sets it; each target's tests check this. */
166
+ readonly keepsWrittenForm?: true;
167
+ /** The curried higher-order codec. For non-parameterized codecs, the factory is constant — every call returns the same shared codec instance. For parameterized codecs, the factory is called once per `storage.types` instance (or once per inline-`typeParams` column), with `ctx` carrying the column set the resulting codec serves. */
168
+ readonly factory: (params: P) => (ctx: CodecInstanceContext) => Codec;
169
+ }
170
+ /**
171
+ * A codec descriptor: a {@link CodecDescriptorTemplate} that names the data type it represents.
172
+ *
173
+ * Several codecs may represent one type, differing in the value they produce in memory; all of them
174
+ * read and write that type's stored form. A descriptor whose data type is not registered in the
175
+ * assembled stack is an assembly error. ADR 254.
176
+ */
177
+ interface CodecDescriptor<P = void> extends CodecDescriptorTemplate<P> {
178
+ /** The data type this codec is one representation of. */
179
+ readonly dataType: DataTypeId;
180
+ }
181
+ /**
182
+ * Why an enum cannot use the codec `descriptor` describes, or `undefined` when one can: the codec's own {@link CodecDescriptorTemplate.enumRefusal}, else the missing `equality` trait. Every enum authoring surface refuses a codec through this.
183
+ */
184
+ declare function enumRefusalOf(descriptor: Pick<CodecDescriptorTemplate, 'traits' | 'enumRefusal'>): string | undefined;
185
+ /**
186
+ * Variance-erased {@link CodecDescriptorTemplate} alias, for the same reason as
187
+ * {@link AnyCodecDescriptor}.
188
+ */
189
+ type AnyCodecDescriptorTemplate = CodecDescriptorTemplate<any>;
190
+ /**
191
+ * Variance-erased {@link CodecDescriptor} alias. `CodecDescriptor<P>` is invariant in `P` (the `factory` and `renderOutputType` slots use `P` contravariantly), so `CodecDescriptor<P>` does not extend `CodecDescriptor<unknown>` for specific `P`. Heterogeneous descriptor collections — e.g. `SqlStaticContributions.codecs:` returning a list that mixes parameterized and non-parameterized descriptors — type against this alias and narrow per codec id at the consumer.
192
+ *
193
+ * Codec-registry-unification spec § Decision: every codec resolves through one descriptor map; reads are non-branching.
194
+ */
195
+ type AnyCodecDescriptor = CodecDescriptor<any>;
196
+ /**
197
+ * Abstract base class for concrete codec descriptors.
198
+ *
199
+ * Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `paramsSchema`, and the curried `factory(params)`.
200
+ *
201
+ * Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.
202
+ */
203
+ declare abstract class CodecDescriptorTemplateImpl<TParams = void> implements CodecDescriptorTemplate<TParams> {
204
+ abstract readonly codecId: string;
205
+ abstract readonly traits: readonly CodecTrait[];
206
+ abstract readonly paramsSchema: StandardSchemaV1<TParams> | undefined;
207
+ get isParameterized(): boolean;
208
+ /** Optional emit-path string renderer for `contract.d.ts`. See {@link CodecDescriptorTemplate.renderOutputType}: only for an output type that no type can compute from the params. */
209
+ renderOutputType?(params: TParams): string | undefined;
210
+ /** Optional emit-path string renderer for the `contract.d.ts` input position. Returns the TypeScript input type expression for the given params; supplied when the write type is narrower than the generic codec input (e.g. an enum's literal member union). */
211
+ renderInputType?(params: TParams): string | undefined;
212
+ /** Optional emit-path renderer for a single stored value. See {@link CodecDescriptor.renderValueLiteral}. */
213
+ renderValueLiteral?(value: JsonValue, side: 'output' | 'input'): string | undefined;
214
+ /** See {@link CodecDescriptorTemplate.enumRefusal}. */
215
+ readonly enumRefusal?: string;
216
+ /** See {@link CodecDescriptorTemplate.keepsWrittenForm}. */
217
+ readonly keepsWrittenForm?: true;
218
+ /**
219
+ * Materialize a curried codec factory for the given params. Concrete subclasses override with a typed return type (e.g. `factory<N>(params: { length: N }): (ctx) => VectorCodec<N>`); per-codec helpers read the typed return at the *direct* call site, which is what preserves method-level generics. Type extraction (e.g. `ReturnType<D['factory']>`) widens method generics to their constraint — that's why the column-helper surface is per-codec, not polymorphic.
220
+ */
221
+ abstract factory(params: TParams): (ctx: CodecInstanceContext) => Codec<string, readonly CodecTrait[], unknown, unknown>;
222
+ }
223
+ /**
224
+ * Abstract base for a concrete codec descriptor: a {@link CodecDescriptorTemplateImpl} that also
225
+ * names the data type its codec represents.
226
+ *
227
+ * A codec whose data type depends on the target that adopts it extends
228
+ * {@link CodecDescriptorTemplateImpl} instead, and the target names the type when it adapts the
229
+ * template.
230
+ */
231
+ declare abstract class CodecDescriptorImpl<TParams = void> extends CodecDescriptorTemplateImpl<TParams> implements CodecDescriptor<TParams> {
232
+ abstract readonly dataType: DataTypeId;
233
+ }
234
+ //#endregion
235
+ //#region src/shared/codec.d.ts
236
+ /**
237
+ * A codec converts a value of one data type to the value an application holds, and that application value to and from what the database driver exchanges (ADR 254).
238
+ *
239
+ * `TInput` is the application value and `TWire` the wire value. The runtime instance carries its `id` (the descriptor's `codecId`), the {@link DataType} it converts values of, and four methods. Static metadata (`traits`) and the build-time `renderOutputType` renderer live on the {@link CodecDescriptor} keyed by `codecId`; consumers that need them resolve through `descriptorFor(codecId)`.
240
+ *
241
+ * Target-family codec interfaces extend this base; family-specific concerns (e.g. the SQL `column?` per-call context) layer on through the `CodecCallContext` extension pattern.
242
+ */
243
+ interface Codec<Id extends string = string, TTraits extends readonly CodecTrait[] = readonly CodecTrait[], TWire = unknown, TInput = unknown> {
244
+ /** Unique codec identifier in `namespace/name@version` format (e.g. `pg/timestamptz-temporal@1`). The factory sets this to the descriptor's `codecId`; consumers use it as a back-reference for descriptor lookups and for decode-error diagnostics. */
245
+ readonly id: Id;
246
+ /** Phantom carrier for the `TTraits` generic; type-only, undefined at runtime. Runtime traits live on {@link CodecDescriptor.traits}. Implemented as a string-key phantom (`__codecTraits`) rather than `unique symbol` so bundlers that split `.d.ts` chunks do not strand symbol identity on chunk-private paths (the same `TS2742` family that the public re-export of `CodecTypes` works around). */
247
+ readonly __codecTraits?: TTraits;
248
+ /** The data type whose values this codec converts. */
249
+ readonly dataType: DataType;
250
+ /**
251
+ * Returns the application value for a value of the codec's data type. It refuses only a value the application value cannot hold exactly, such as digit text past 2^53 for a `number`, because the data type has already refused every value it does not hold; it is synchronous.
252
+ */
253
+ fromDataTypeValue(value: DataTypeValue): TInput;
254
+ /**
255
+ * Returns the value of the codec's data type that an application value is, under the codec's parameters. It builds the value through the data type, so it cannot return a value its type does not hold; it is synchronous.
256
+ */
257
+ toDataTypeValue(input: TInput): DataTypeValue;
258
+ /**
259
+ * Reads a value the database driver returns into the application value. It is asynchronous and receives the per-call {@link CodecCallContext}, which family layers may narrow (SQL adds `column`).
260
+ */
261
+ fromWire(wire: TWire, ctx: CodecCallContext): Promise<TInput>;
262
+ /**
263
+ * Writes an application value as the value the database driver takes. It is asynchronous and receives the per-call {@link CodecCallContext}, which family layers may narrow.
264
+ */
265
+ toWire(input: TInput, ctx: CodecCallContext): Promise<TWire>;
266
+ }
267
+ /**
268
+ * The application value `codec` gives for `json`, a value a contract stores for a column with the column's `typeParams`: the codec's data type reads it with the parameters it declares, and the codec converts the value.
269
+ */
270
+ declare function readContractValue(codec: Pick<Codec, 'dataType' | 'fromDataTypeValue'>, json: JsonValue, typeParams: unknown): unknown;
271
+ /**
272
+ * Abstract base class for concrete codec implementations.
273
+ *
274
+ * A codec is built with its descriptor, the data type it converts values of and the column's parameters of that type. The constructor makes `fromDataTypeValue` refuse a value of another data type before the subclass's conversion runs. `fromDataTypeValue` and `toDataTypeValue` convert between a value of the type and the application value, and `toDataTypeValue` finishes with {@link CodecImpl.dataTypeValueOf}, which constructs the value through the type. `fromWire` and `toWire` read and write what the driver exchanges, asynchronously.
275
+ */
276
+ declare abstract class CodecImpl<Id extends string = string, TTraits extends readonly CodecTrait[] = readonly CodecTrait[], TWire = unknown, TInput = unknown> implements Codec<Id, TTraits, TWire, TInput> {
277
+ readonly descriptor: CodecDescriptorTemplate<any>;
278
+ readonly dataType: DataType;
279
+ protected readonly dataTypeParams: DataTypeParams;
280
+ /**
281
+ * The descriptor is variance-erased: concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor, dataType, params)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.
282
+ */
283
+ constructor(descriptor: CodecDescriptorTemplate<any>, dataType: DataType, dataTypeParams?: DataTypeParams);
284
+ get id(): Id;
285
+ /** The value of the codec's data type that `json` stores, under the codec's parameters. */
286
+ protected dataTypeValueOf<J extends JsonValue>(json: J): DataTypeValue<J>;
287
+ abstract fromDataTypeValue(value: DataTypeValue): TInput;
288
+ abstract toDataTypeValue(input: TInput): DataTypeValue;
289
+ abstract fromWire(wire: TWire, ctx: CodecCallContext): Promise<TInput>;
290
+ abstract toWire(input: TInput, ctx: CodecCallContext): Promise<TWire>;
291
+ }
292
+ //#endregion
293
+ //#region src/shared/codec-types.d.ts
294
+ /** Every semantic trait a codec may advertise. The runtime tuple backs validation of trait-keyed contributions arriving from JavaScript. */
295
+ declare const CODEC_TRAITS: readonly ["equality", "order", "boolean", "numeric", "textual"];
296
+ type CodecTrait = (typeof CODEC_TRAITS)[number];
297
+ /**
298
+ * Serializable codec identity carried by every codec-bearing AST node.
299
+ *
300
+ * `(codecId, typeParams?)` is the single fact the runtime needs to materialize a codec via `descriptorFor(codecId).factory(typeParams)(ctx)`. The pair is content-keyed: two refs with the same `codecId` and structurally equal `typeParams` (regardless of object key ordering) resolve to the same memoized {@link Codec} instance.
301
+ *
302
+ * `typeParams` is `JsonValue`-constrained so the ref survives JSON serialization (relevant for AST-embedded migration ops). Non-parameterized codecs leave `typeParams` undefined or empty; a parameterized codec's `paramsSchema` validates the value at the JSON boundary.
303
+ *
304
+ * `many` marks a scalar-array (list-typed) column. When `true`, the encode/decode paths map the element codec over array elements rather than applying the codec to the whole value. The element codec id is `codecId`; each family or target owns how its stored list frame is traversed. For Postgres, inbound list framing is target-owned while outbound parameters still rely on the driver/library's array serialization under the adapter-emitted SQL type context. Absent for scalar columns.
305
+ *
306
+ * Family-agnostic by design — both SQL and Mongo AST nodes carry `codec: CodecRef | undefined`, and the resolver is the only dispatch path that survives serialization.
307
+ */
308
+ interface CodecRef {
309
+ readonly codecId: string;
310
+ readonly typeParams?: JsonValue;
311
+ readonly many?: boolean;
312
+ }
313
+ /**
314
+ * Per-call context the runtime threads to every `codec.encode` / `codec.decode` invocation for a single runtime operation (`query()`, `PreparedStatement.query()`, or `execute()`).
315
+ *
316
+ * The framework-level shape is family-agnostic and carries one field:
317
+ *
318
+ * - `signal?: AbortSignal` — per-query cancellation. The runtime returns a `RUNTIME.ABORTED` envelope when the signal aborts; codec authors who forward `signal` to their underlying SDK get true cancellation of in-flight network calls.
319
+ *
320
+ * Family layers extend this base with their own shape-of-call metadata: the SQL family adds `column?: SqlColumnRef` via `SqlCodecCallContext` (see `@internal/sql-relational-core`). Mongo currently uses this framework type unchanged. Column metadata is intentionally **not** on the framework type — it is a SQL-family concept rooted in SQL's `(table, column)` addressing model and would not generalise to other families.
321
+ *
322
+ * The interface is named explicitly (not inlined) so future framework fields and family extensions can land additively without breaking codec author signatures.
323
+ */
324
+ interface CodecCallContext {
325
+ readonly signal?: AbortSignal;
326
+ }
327
+ /**
328
+ * Codec-id-keyed read surface threaded into emit and authoring paths.
329
+ *
330
+ * - `get(id)` returns a representative {@link Codec} instance for the codec id (used where a caller reads or encodes a value by codec id and the codec takes no type parameters). For parameterized codecs whose factory requires concrete params, this may return `undefined` — use `CodecRegistry.forCodecRef` instead.
331
+ * - `renderOutputTypeFor(id, params)` exposes the codec-id-keyed `renderOutputType` renderer the runtime instance no longer carries. Returns `undefined` when the codec doesn't render a custom type or when the codec id is unknown.
332
+ */
333
+ interface CodecLookup {
334
+ get(id: string): Codec | undefined;
335
+ renderOutputTypeFor(id: string, params: Record<string, unknown>): string | undefined;
336
+ /** Codec-id-keyed `renderInputType` renderer for the `contract.d.ts` input position. Optional so existing lookups need not provide it; returns `undefined` when the codec renders no custom input type or the id is unknown. */
337
+ renderInputTypeFor?(id: string, params: Record<string, unknown>): string | undefined;
338
+ /** Codec-id-keyed `renderValueLiteral` renderer for the emit path (`side`: `output` = read type, `input` = create/update type). Optional so existing lookups need not provide it; returns `undefined` when the codec's output isn't literal-expressible or the id is unknown. */
339
+ renderValueLiteralFor?(id: string, value: JsonValue, side: 'output' | 'input'): string | undefined;
340
+ }
341
+ /** A {@link CodecLookup} that resolves codec descriptors, which building a column's codec with its type parameters needs. */
342
+ interface CodecLookupWithDescriptors extends CodecLookup {
343
+ /**
344
+ * The registered {@link AnyCodecDescriptor} for `id`, or `undefined` if none is registered. A consumer that needs more than the per-id readers above, such as a column's codec built with its type parameters or an authoring hook a target's descriptor exposes, fetches the descriptor itself. It answers from the same registrations as `get`.
345
+ */
346
+ descriptorFor(id: string): AnyCodecDescriptor | undefined;
347
+ }
348
+ /** The codecs and the data types of one stack, which together find the data type a codec represents. ADR 254. */
349
+ interface TypeLookups<Codecs extends Pick<CodecLookupWithDescriptors, 'descriptorFor'> = Pick<CodecLookupWithDescriptors, 'descriptorFor'>, DataTypes extends Pick<DataTypeLookup, 'get'> = Pick<DataTypeLookup, 'get'>> {
350
+ readonly codecLookup: Codecs;
351
+ readonly dataTypeLookup: DataTypes;
352
+ }
353
+ /**
354
+ * Full codec registry — the read surface of {@link CodecLookup} plus codec resolution by ref or
355
+ * column coordinate. Built once by `extractCodecLookup` and passed by reference to adapters and
356
+ * other consumers that need to materialise codecs at runtime.
357
+ *
358
+ * - `forCodecRef(ref)` materialises a codec from a {@link CodecRef}. Throws
359
+ * `RUNTIME.CODEC_DESCRIPTOR_MISSING` for unknown ids and `RUNTIME.TYPE_PARAMS_INVALID` on param
360
+ * schema rejection.
361
+ * - `forColumn(namespaceId, table, column)` returns the codec for a specific column coordinate, or
362
+ * `undefined` when no column-to-codec mapping is present. This registry is contract-free so it
363
+ * always returns `undefined` — the method exists so the object structurally satisfies the SQL
364
+ * `ContractCodecRegistry` interface.
365
+ */
366
+ interface CodecRegistry extends CodecLookupWithDescriptors {
367
+ forCodecRef(ref: CodecRef): Codec;
368
+ forColumn(namespaceId: string, table: string, column: string): Codec | undefined;
369
+ }
370
+ /** A lookup with no codecs. It has no `descriptorFor`, so a stub that adds codecs to it through `get` cannot pass for a lookup of descriptors that answers nothing. */
371
+ declare const emptyCodecLookup: CodecLookup;
372
+ /**
373
+ * Family-agnostic per-instance context supplied by the framework when applying a higher-order codec factory. Allows stateful codecs (e.g. column-scoped encryption) to derive per-instance state from the materialization site.
374
+ *
375
+ * - `name` — the family-agnostic instance identity. For SQL, the runtime populates this as an inline-column sentinel (`<col:Document.embedding>`) for columns with `typeParams`, a shared codec-id sentinel (`<codec:pg/text@1>`) for non-parameterized codec ids, or the canonical cache key (`<codecId>:<canonicalizeJson(typeParams)>`) for ad-hoc refs the contract walk did not pre-populate. Other families pick the analogous identity for their materialization sites.
376
+ *
377
+ * Family-specific extensions (e.g. {@link import('@prisma/orm-family-sql/relational-core/ast').SqlCodecInstanceContext} in the SQL layer) augment this base with domain-shaped column-set metadata. Codec authors target the base when they don't read family-specific metadata; they target the family extension when they do.
378
+ */
379
+ interface CodecInstanceContext {
380
+ readonly name: string;
381
+ }
382
+ //#endregion
383
+ export { createDataTypeLookup as A, requireValueOf as B, DataTypeSpec as C, TypeLookups as D, ListCast as E, dataTypeValuesEqual as F, requiredSchemaKeys as H, emptyCodecLookup as I, enumRefusalOf as L, dataTypeId as M, dataTypeParams as N, assembleDataTypes as O, dataTypeParamsProblem as P, objectSchemaKeys as R, DataTypeReader as S, DataTypeValue as T, schemaKeysAllowing as U, requiredParamKeys as V, DataType as _, CodecCallContext as a, DataTypeParams as b, CodecDescriptorTemplate as c, CodecInstanceContext as d, CodecLookup as f, CodecTrait as g, CodecRegistry as h, Codec as i, dataType as j, assertDataTypeParams as k, CodecDescriptorTemplateImpl as l, CodecRef as m, AnyCodecDescriptorTemplate as n, CodecDescriptor as o, CodecLookupWithDescriptors as p, Cast as r, CodecDescriptorImpl as s, AnyCodecDescriptor as t, CodecImpl as u, DataTypeId as v, DataTypeSpelling as w, DataTypeParamsProblem as x, DataTypeLookup as y, readContractValue as z };
384
+ //# sourceMappingURL=codec-types-CPgEZoIq-BL9hisr8.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-types-CPgEZoIq-BL9hisr8.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec-types-CPgEZoIq.d.mts"],"mappings":"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"}
@@ -1,4 +1,6 @@
1
- import { t as aggregateDescriptorKey } from "./capabilities-BCEONw9w-C-lo3rF8.mjs";
1
+ import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
2
+ import { c as createDataTypeLookup } from "./data-type-V6mcDhcG-DVQAPOQT.mjs";
3
+ import { n as aggregateDescriptorKey } from "./generator-functions-CXbQfvYu-BIFU1Ryx.mjs";
2
4
  //#region ../../../1-framework/1-core/framework-components/dist/components.mjs
3
5
  /**
4
6
  * Settle every contributed overload against `codecs`.
@@ -82,7 +84,36 @@ function settleAggregateOverloads(descriptors, codecs) {
82
84
  duplicates
83
85
  };
84
86
  }
87
+ /** The data types of a stack that registers none, which a signature written as a function of them is built against to read its parameter keys. */
88
+ const NO_DATA_TYPES = {
89
+ entries: {},
90
+ lookup: createDataTypeLookup([]),
91
+ dataTypeOfCodec: () => void 0
92
+ };
93
+ function positionalKeys(declared) {
94
+ const signature = typeof declared === "function" ? declared(NO_DATA_TYPES) : declared;
95
+ if (typeof signature !== "object" || signature === null || !("positional" in signature)) return [];
96
+ const positional = signature.positional;
97
+ if (!Array.isArray(positional)) return [];
98
+ return positional.flatMap((param) => typeof param === "object" && param !== null && "key" in param && typeof param.key === "string" ? [param.key] : []);
99
+ }
100
+ /**
101
+ * The `gen` helpers of a composed stack: one per generator function its components declare, taking the positional arguments of the function's signature. A call is resolved by the field's codec when the contract is built.
102
+ */
103
+ function createGeneratorHelpers(components) {
104
+ const helpers = {};
105
+ for (const component of components) for (const contribution of component.generatorFunctions ?? []) {
106
+ if (contribution.signature === void 0) continue;
107
+ const keys = positionalKeys(contribution.signature);
108
+ const name = contribution.name;
109
+ helpers[name] = (...values) => ({
110
+ name,
111
+ args: Object.fromEntries(keys.flatMap((key, index) => values[index] === void 0 ? [] : [[key, values[index]]]))
112
+ });
113
+ }
114
+ return blindCast(helpers);
115
+ }
85
116
  //#endregion
86
- export { settleAggregateOverloads as t };
117
+ export { settleAggregateOverloads as n, createGeneratorHelpers as t };
87
118
 
88
- //# sourceMappingURL=components-dZRz3T5y.mjs.map
119
+ //# sourceMappingURL=components-BaV9iCkq.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-BaV9iCkq.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/components.mjs"],"sourcesContent":["import { r as createDataTypeLookup } from \"./data-type-V6mcDhcG.mjs\";\nimport { n as runtimeError, t as isRuntimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { a as mergeCapabilityMatrices, c as isAnyInputAggregateDescriptor, i as singleGeneratorBinding, l as isNoInputAggregateDescriptor, n as assembleGeneratorFunctions, o as aggregateDescriptorKey, s as isAggregateDescriptor, t as EMPTY_GENERATOR_FUNCTIONS } from \"./generator-functions-CXbQfvYu.mjs\";\nimport { t as checkContractComponentRequirements } from \"./framework-components-D6j4Y5K7.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/shared/aggregate-overloads.ts\n/**\n* Settle every contributed overload against `codecs`.\n*\n* Exact codec overloads win over trait overloads, and trait overloads are expanded only over the codecs given — so a caller that passes the codecs a stack actually composes cannot end up with a row for one it does not. An exact overload survives even for a codec outside that set, because naming a codec id is a claim that stands on its own.\n*\n* The input-agnostic overload is left unexpanded: it answers whatever the other two rungs do not, so materializing it per codec would say the same thing once per codec.\n*\n* A second claim on one `(operation, input)` key is reported as a duplicate and does not unseat the first; both production callers reject duplicates before settling, so the report guards a consumer that calls this directly.\n*/\nfunction settleAggregateOverloads(descriptors, codecs) {\n\tconst byOperation = /* @__PURE__ */ new Map();\n\tconst firstClaims = /* @__PURE__ */ new Map();\n\tconst duplicates = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst key = aggregateDescriptorKey(descriptor);\n\t\tconst first = firstClaims.get(key);\n\t\tif (first !== void 0) {\n\t\t\tduplicates.push({\n\t\t\t\toperation: descriptor.operation,\n\t\t\t\tkey,\n\t\t\t\tfirst,\n\t\t\t\tsecond: descriptor\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tfirstClaims.set(key, descriptor);\n\t\tconst entry = byOperation.get(descriptor.operation) ?? {\n\t\t\texact: /* @__PURE__ */ new Map(),\n\t\t\ttraits: [],\n\t\t\tnoInput: void 0,\n\t\t\tanyInput: void 0\n\t\t};\n\t\tswitch (descriptor.input.kind) {\n\t\t\tcase \"none\":\n\t\t\t\tentry.noInput = descriptor;\n\t\t\t\tbreak;\n\t\t\tcase \"any\":\n\t\t\t\tentry.anyInput = descriptor;\n\t\t\t\tbreak;\n\t\t\tcase \"codec\":\n\t\t\t\tentry.exact.set(descriptor.input.codecId, descriptor);\n\t\t\t\tbreak;\n\t\t\tcase \"trait\":\n\t\t\t\tentry.traits.push({\n\t\t\t\t\tdescriptor,\n\t\t\t\t\ttrait: descriptor.input.trait\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t}\n\t\tbyOperation.set(descriptor.operation, entry);\n\t}\n\tconst codecList = [...codecs];\n\tconst operations = /* @__PURE__ */ new Map();\n\tconst ambiguities = [];\n\tfor (const [operation, entry] of byOperation) {\n\t\tconst byCodecId = new Map(entry.exact);\n\t\tfor (const codec of codecList) {\n\t\t\tif (byCodecId.has(codec.codecId)) continue;\n\t\t\tconst claims = entry.traits.filter((candidate) => codec.traits.includes(candidate.trait));\n\t\t\tif (claims.length > 1) {\n\t\t\t\tambiguities.push({\n\t\t\t\t\toperation,\n\t\t\t\t\tcodecId: codec.codecId,\n\t\t\t\t\ttraits: claims.map((claim) => claim.trait)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst claim = claims[0];\n\t\t\tif (claim !== void 0) byCodecId.set(codec.codecId, claim.descriptor);\n\t\t}\n\t\toperations.set(operation, {\n\t\t\tbyCodecId,\n\t\t\tnoInput: entry.noInput,\n\t\t\tanyInput: entry.anyInput\n\t\t});\n\t}\n\treturn {\n\t\toperations,\n\t\tambiguities,\n\t\tduplicates\n\t};\n}\n//#endregion\n//#region src/shared/generator-helpers.ts\n/** The data types of a stack that registers none, which a signature written as a function of them is built against to read its parameter keys. */\nconst NO_DATA_TYPES = {\n\tentries: {},\n\tlookup: createDataTypeLookup([]),\n\tdataTypeOfCodec: () => void 0\n};\nfunction positionalKeys(declared) {\n\tconst signature = typeof declared === \"function\" ? declared(NO_DATA_TYPES) : declared;\n\tif (typeof signature !== \"object\" || signature === null || !(\"positional\" in signature)) return [];\n\tconst positional = signature.positional;\n\tif (!Array.isArray(positional)) return [];\n\treturn positional.flatMap((param) => typeof param === \"object\" && param !== null && \"key\" in param && typeof param.key === \"string\" ? [param.key] : []);\n}\n/**\n* The `gen` helpers of a composed stack: one per generator function its components declare, taking the positional arguments of the function's signature. A call is resolved by the field's codec when the contract is built.\n*/\nfunction createGeneratorHelpers(components) {\n\tconst helpers = {};\n\tfor (const component of components) for (const contribution of component.generatorFunctions ?? []) {\n\t\tif (contribution.signature === void 0) continue;\n\t\tconst keys = positionalKeys(contribution.signature);\n\t\tconst name = contribution.name;\n\t\thelpers[name] = (...values) => ({\n\t\t\tname,\n\t\t\targs: Object.fromEntries(keys.flatMap((key, index) => values[index] === void 0 ? [] : [[key, values[index]]]))\n\t\t});\n\t}\n\treturn blindCast(helpers);\n}\n//#endregion\nexport { EMPTY_GENERATOR_FUNCTIONS, aggregateDescriptorKey, assembleGeneratorFunctions, checkContractComponentRequirements, createGeneratorHelpers, isAggregateDescriptor, isAnyInputAggregateDescriptor, isNoInputAggregateDescriptor, isRuntimeError, mergeCapabilityMatrices, runtimeError, settleAggregateOverloads, singleGeneratorBinding };\n\n//# sourceMappingURL=components.mjs.map"],"mappings":"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"}
@@ -0,0 +1,86 @@
1
+ import { g as CodecTrait } from "./codec-types-CPgEZoIq-BL9hisr8.mjs";
2
+ import { Q as GeneratorFunctionComponent, Z as GeneratorFunctionCall } from "./framework-authoring-DDxddXZm-uZYdhoE0.mjs";
3
+ import { t as AggregateDescriptor } from "./types-import-spec-DQjfX-gM-zVncuzs0.mjs";
4
+ import "./framework-components-DKoQnPdB-lax1COaf.mjs";
5
+ //#region ../../../1-framework/1-core/framework-components/dist/components.d.mts
6
+ //#region src/shared/aggregate-overloads.d.ts
7
+ /** What settling needs to know about a codec: its id, and the traits an overload can claim it by. */
8
+ interface AggregateCodecTraits {
9
+ readonly codecId: string;
10
+ readonly traits: readonly CodecTrait[];
11
+ }
12
+ /** The overloads of one operation, settled: one per codec, plus the two that answer without a specific input. */
13
+ interface SettledAggregateOperation<TDescriptor extends AggregateDescriptor> {
14
+ /** The overload that serves each codec — its exact one where it has one, otherwise the single trait overload whose trait it carries. */
15
+ readonly byCodecId: ReadonlyMap<string, TDescriptor>;
16
+ /** The overload for a call that carries no input at all. */
17
+ readonly noInput: TDescriptor | undefined;
18
+ /** The overload for any input no exact or trait overload claims. */
19
+ readonly anyInput: TDescriptor | undefined;
20
+ }
21
+ /** A codec that two trait overloads of one operation both claim, leaving its result codec undetermined. */
22
+ interface AggregateOverloadAmbiguity {
23
+ readonly operation: string;
24
+ readonly codecId: string;
25
+ readonly traits: readonly CodecTrait[];
26
+ }
27
+ /** An `(operation, input)` key two overloads both claim. The first claim is the one settled; the second is reported here. */
28
+ interface AggregateOverloadDuplicate<TDescriptor extends AggregateDescriptor> {
29
+ readonly operation: string;
30
+ readonly key: string;
31
+ readonly first: TDescriptor;
32
+ readonly second: TDescriptor;
33
+ }
34
+ interface SettledAggregateOverloads<TDescriptor extends AggregateDescriptor> {
35
+ readonly operations: ReadonlyMap<string, SettledAggregateOperation<TDescriptor>>;
36
+ readonly ambiguities: readonly AggregateOverloadAmbiguity[];
37
+ readonly duplicates: readonly AggregateOverloadDuplicate<TDescriptor>[];
38
+ }
39
+ /**
40
+ * Settle every contributed overload against `codecs`.
41
+ *
42
+ * Exact codec overloads win over trait overloads, and trait overloads are expanded only over the codecs given — so a caller that passes the codecs a stack actually composes cannot end up with a row for one it does not. An exact overload survives even for a codec outside that set, because naming a codec id is a claim that stands on its own.
43
+ *
44
+ * The input-agnostic overload is left unexpanded: it answers whatever the other two rungs do not, so materializing it per codec would say the same thing once per codec.
45
+ *
46
+ * A second claim on one `(operation, input)` key is reported as a duplicate and does not unseat the first; both production callers reject duplicates before settling, so the report guards a consumer that calls this directly.
47
+ */
48
+ declare function settleAggregateOverloads<TDescriptor extends AggregateDescriptor>(descriptors: readonly TDescriptor[], codecs: Iterable<AggregateCodecTraits>): SettledAggregateOverloads<TDescriptor>;
49
+ //#endregion
50
+ //#region src/shared/generator-helpers.d.ts
51
+ /** The value type an argument type of a signature parses to. psl-parser's `ArgTypeOutput` extends it, so `gen` reads the argument types of a `FuncCallSig` through this one definition. */
52
+ interface SignatureArgumentOutput<T> {
53
+ readonly _out?: T;
54
+ }
55
+ /** The mark psl-parser's `optional(...)` puts on an argument type; its `OptionalArgumentMarks` extends it. It makes the `gen` argument optional. */
56
+ interface SignatureOptionalArgument {
57
+ readonly optional: true;
58
+ }
59
+ type ArgumentOut<Type> = Type extends SignatureArgumentOutput<infer Out> ? Exclude<Out, undefined> : unknown;
60
+ type PositionalArguments<Params> = Params extends readonly [infer Head, ...infer Rest] ? Head extends {
61
+ readonly type: infer Type;
62
+ } ? Type extends SignatureOptionalArgument ? [argument?: ArgumentOut<Type>, ...PositionalArguments<Rest>] : [argument: ArgumentOut<Type>, ...PositionalArguments<Rest>] : [] : [];
63
+ /** A signature, or what a signature written as a function of the stack's data types returns. */
64
+ type SignatureObject<Signature> = Signature extends ((...args: never) => infer Built) ? Built : Signature;
65
+ /** The `gen` helper of one generator function, typed by the positional arguments of its signature. */
66
+ type GeneratorHelper<Signature> = (...args: SignatureObject<Signature> extends {
67
+ readonly positional: infer Params;
68
+ } ? PositionalArguments<Params> : []) => GeneratorFunctionCall;
69
+ type ContributionsOf<Component> = Component extends {
70
+ readonly generatorFunctions?: infer Contributions;
71
+ } ? Contributions extends readonly (infer Contribution)[] ? Contribution : never : never;
72
+ type Declared<Contribution> = Contribution extends {
73
+ readonly name: string;
74
+ readonly signature: object;
75
+ } ? Contribution : never;
76
+ /** The pack refs of a record of extension packs, as a union. */
77
+ type ExtensionPackValues<Extensions> = Extensions extends Record<string, infer Pack> ? Pack : never;
78
+ /** The `gen` helpers of a set of components: one per generator function they declare. */
79
+ type GeneratorHelpersOf<Component> = { readonly [Contribution in Declared<ContributionsOf<Component>> as Contribution['name']]: GeneratorHelper<Contribution['signature']>; };
80
+ /**
81
+ * The `gen` helpers of a composed stack: one per generator function its components declare, taking the positional arguments of the function's signature. A call is resolved by the field's codec when the contract is built.
82
+ */
83
+ declare function createGeneratorHelpers<const Component extends GeneratorFunctionComponent>(components: readonly Component[]): GeneratorHelpersOf<Component>;
84
+ //#endregion
85
+ export { GeneratorHelper as a, SettledAggregateOverloads as c, createGeneratorHelpers as d, settleAggregateOverloads as f, ExtensionPackValues as i, SignatureArgumentOutput as l, AggregateOverloadAmbiguity as n, GeneratorHelpersOf as o, AggregateOverloadDuplicate as r, SettledAggregateOperation as s, AggregateCodecTraits as t, SignatureOptionalArgument as u };
86
+ //# sourceMappingURL=components-CRBcIta_.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-CRBcIta_.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/components.d.mts"],"mappings":";;;;;;;UAQU;WACC;WACA,iBAAiB;;;UAGlB,0BAA0B,oBAAoB;;WAE7C,WAAW,oBAAoB;;WAE/B,SAAS;;WAET,UAAU;;;UAGX;WACC;WACA;WACA,iBAAiB;;;UAGlB,2BAA2B,oBAAoB;WAC9C;WACA;WACA,OAAO;WACP,QAAQ;;UAET,0BAA0B,oBAAoB;WAC7C,YAAY,oBAAoB,0BAA0B;WAC1D,sBAAsB;WACtB,qBAAqB,2BAA2B;;;;;;;;;;;iBAW1C,yBAAyB,oBAAoB,qBAAqB,sBAAsB,eAAe,QAAQ,SAAS,wBAAwB,0BAA0B;;;;UAIjL,wBAAwB;WACvB,OAAO;;;UAGR;WACC;;KAEN,YAAY,QAAQ,aAAa,8BAA8B,OAAO,QAAQ;KAC9E,oBAAoB,UAAU,+BAA+B,eAAe,QAAQ;WAC9E,YAAY;IACnB,aAAa,6BAA6B,WAAW,YAAY,UAAU,oBAAoB,UAAU,UAAU,YAAY,UAAU,oBAAoB;;KAE5J,gBAAgB,aAAa,uBAAuB,sBAAsB,SAAS,QAAQ;;KAE3F,gBAAgB,iBAAiB,MAAM,gBAAgB;WACjD,kBAAkB;IACzB,oBAAoB,iBAAiB;KACpC,gBAAgB,aAAa;WACvB,2BAA2B;IAClC,sCAAsC,kBAAkB;KACvD,SAAS,gBAAgB;WACnB;WACA;IACP;;KAEC,oBAAoB,cAAc,mBAAmB,qBAAqB,QAAQ;;KAElF,mBAAmB,yBAAyB,gBAAgB,SAAS,gBAAgB,eAAe,uBAAuB,gBAAgB;;;;iBAI/H,6BAA6B,kBAAkB,4BAA4B,qBAAqB,cAAc,mBAAmB"}