@prisma/orm-framework 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +27 -0
  3. package/dist/abortable-CQO6uG9F.mjs +39 -0
  4. package/dist/abortable-CQO6uG9F.mjs.map +1 -0
  5. package/dist/abortable-DBbAaT_4.d.mts +29 -0
  6. package/dist/abortable-DBbAaT_4.d.mts.map +1 -0
  7. package/dist/apply-specifier-default-control-policy-CAxiXxKg.d.mts +7 -0
  8. package/dist/apply-specifier-default-control-policy-CAxiXxKg.d.mts.map +1 -0
  9. package/dist/apply-specifier-default-control-policy-CsYHsfTF.mjs +12 -0
  10. package/dist/apply-specifier-default-control-policy-CsYHsfTF.mjs.map +1 -0
  11. package/dist/array-equal-28xupwIB.mjs +26 -0
  12. package/dist/array-equal-28xupwIB.mjs.map +1 -0
  13. package/dist/array-equal-dUd-VPlk.d.mts +22 -0
  14. package/dist/array-equal-dUd-VPlk.d.mts.map +1 -0
  15. package/dist/assertions-BEQnOIQd.d.mts +31 -0
  16. package/dist/assertions-BEQnOIQd.d.mts.map +1 -0
  17. package/dist/assertions-Cz-GWH8P.mjs +36 -0
  18. package/dist/assertions-Cz-GWH8P.mjs.map +1 -0
  19. package/dist/authoring-Dd7p6pTS.d.mts +1 -0
  20. package/dist/canonical-stringify-Bl6agy_g.d.mts +51 -0
  21. package/dist/canonical-stringify-Bl6agy_g.d.mts.map +1 -0
  22. package/dist/canonical-stringify-DY4NaAJi.mjs +104 -0
  23. package/dist/canonical-stringify-DY4NaAJi.mjs.map +1 -0
  24. package/dist/canonicalization-DFpB09nP-4OdB2nsy.d.mts +69 -0
  25. package/dist/canonicalization-DFpB09nP-4OdB2nsy.d.mts.map +1 -0
  26. package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs +25 -0
  27. package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs.map +1 -0
  28. package/dist/capabilities-CPj7MfXO-GRkp0Q_D.mjs +64 -0
  29. package/dist/capabilities-CPj7MfXO-GRkp0Q_D.mjs.map +1 -0
  30. package/dist/capabilities-Cupq4-1--C71ORI3N.d.mts +34 -0
  31. package/dist/capabilities-Cupq4-1--C71ORI3N.d.mts.map +1 -0
  32. package/dist/casts-D29CHGrr.d.mts +78 -0
  33. package/dist/casts-D29CHGrr.d.mts.map +1 -0
  34. package/dist/casts-DpaahrlC-Bd5n2coI.mjs +82 -0
  35. package/dist/casts-DpaahrlC-Bd5n2coI.mjs.map +1 -0
  36. package/dist/codec-Cly9VPoA.mjs +78 -0
  37. package/dist/codec-Cly9VPoA.mjs.map +1 -0
  38. package/dist/codec-D3GVAkR_.d.mts +116 -0
  39. package/dist/codec-D3GVAkR_.d.mts.map +1 -0
  40. package/dist/codec-types-XJO6eC9U-B_K2q0zm.d.mts +221 -0
  41. package/dist/codec-types-XJO6eC9U-B_K2q0zm.d.mts.map +1 -0
  42. package/dist/components-CawuxTia.d.mts +1 -0
  43. package/dist/components.d.mts +20 -0
  44. package/dist/components.mjs +15 -0
  45. package/dist/components__authoring.d.mts +3 -0
  46. package/dist/components__authoring.mjs +2 -0
  47. package/dist/components__codec.d.mts +3 -0
  48. package/dist/components__codec.mjs +3 -0
  49. package/dist/components__components.d.mts +4 -0
  50. package/dist/components__components.mjs +3 -0
  51. package/dist/components__control.d.mts +4 -0
  52. package/dist/components__control.mjs +2 -0
  53. package/dist/components__emission.d.mts +4 -0
  54. package/dist/components__emission.mjs +2 -0
  55. package/dist/components__execution.d.mts +2 -0
  56. package/dist/components__execution.mjs +2 -0
  57. package/dist/components__ir.d.mts +3 -0
  58. package/dist/components__ir.mjs +3 -0
  59. package/dist/components__psl-ast.d.mts +4 -0
  60. package/dist/components__psl-ast.mjs +2 -0
  61. package/dist/components__runtime.d.mts +2 -0
  62. package/dist/components__runtime.mjs +3 -0
  63. package/dist/components__utils.d.mts +2 -0
  64. package/dist/components__utils.mjs +2 -0
  65. package/dist/config-errors-CBdiX587-DwIyJIX9.mjs +9 -0
  66. package/dist/config-errors-CBdiX587-DwIyJIX9.mjs.map +1 -0
  67. package/dist/config-types-Cf9lVsHR.mjs +62 -0
  68. package/dist/config-types-Cf9lVsHR.mjs.map +1 -0
  69. package/dist/config-types-W-87vhZ4-BgYaH8YO.d.mts +162 -0
  70. package/dist/config-types-W-87vhZ4-BgYaH8YO.d.mts.map +1 -0
  71. package/dist/config-types-zrHI32Om.d.mts +1 -0
  72. package/dist/config-validation-ByGTw6zQ.mjs +99 -0
  73. package/dist/config-validation-ByGTw6zQ.mjs.map +1 -0
  74. package/dist/config-validation-DXggMTZf.d.mts +14 -0
  75. package/dist/config-validation-DXggMTZf.d.mts.map +1 -0
  76. package/dist/config.d.mts +4 -0
  77. package/dist/config.mjs +3 -0
  78. package/dist/config__config-types.d.mts +3 -0
  79. package/dist/config__config-types.mjs +2 -0
  80. package/dist/config__config-validation.d.mts +2 -0
  81. package/dist/config__config-validation.mjs +2 -0
  82. package/dist/contract-authoring.d.mts +213 -0
  83. package/dist/contract-authoring.d.mts.map +1 -0
  84. package/dist/contract-authoring.mjs +133 -0
  85. package/dist/contract-authoring.mjs.map +1 -0
  86. package/dist/contract-types-CkdMH7F7-9EHXSwbH.d.mts +77 -0
  87. package/dist/contract-types-CkdMH7F7-9EHXSwbH.d.mts.map +1 -0
  88. package/dist/contract-validation-error-DEiWp_EI-CRwtUgRw.mjs +14 -0
  89. package/dist/contract-validation-error-DEiWp_EI-CRwtUgRw.mjs.map +1 -0
  90. package/dist/contract-validation-error-R7cMoK04.d.mts +11 -0
  91. package/dist/contract-validation-error-R7cMoK04.d.mts.map +1 -0
  92. package/dist/contract.d.mts +14 -0
  93. package/dist/contract.mjs +13 -0
  94. package/dist/contract__apply-specifier-default-control-policy.d.mts +2 -0
  95. package/dist/contract__apply-specifier-default-control-policy.mjs +2 -0
  96. package/dist/contract__contract-validation-error.d.mts +2 -0
  97. package/dist/contract__contract-validation-error.mjs +2 -0
  98. package/dist/contract__default-namespace.d.mts +2 -0
  99. package/dist/contract__default-namespace.mjs +2 -0
  100. package/dist/contract__enum-accessor.d.mts +2 -0
  101. package/dist/contract__enum-accessor.mjs +2 -0
  102. package/dist/contract__hashing-utils.d.mts +2 -0
  103. package/dist/contract__hashing-utils.mjs +3 -0
  104. package/dist/contract__hashing.d.mts +3 -0
  105. package/dist/contract__hashing.mjs +2 -0
  106. package/dist/contract__is-plain-record.d.mts +2 -0
  107. package/dist/contract__is-plain-record.mjs +2 -0
  108. package/dist/contract__resolve-domain-model.d.mts +2 -0
  109. package/dist/contract__resolve-domain-model.mjs +2 -0
  110. package/dist/contract__types.d.mts +6 -0
  111. package/dist/contract__types.mjs +5 -0
  112. package/dist/contract__validate-domain.d.mts +2 -0
  113. package/dist/contract__validate-domain.mjs +2 -0
  114. package/dist/control-B87KWI_K-C_R8WfEr.d.mts +213 -0
  115. package/dist/control-B87KWI_K-C_R8WfEr.d.mts.map +1 -0
  116. package/dist/control-CBvTj7Ia.d.mts +1383 -0
  117. package/dist/control-CBvTj7Ia.d.mts.map +1 -0
  118. package/dist/control-DTouE89s.mjs +621 -0
  119. package/dist/control-DTouE89s.mjs.map +1 -0
  120. package/dist/control-Ftiau058-CCeJcAVQ.mjs +284 -0
  121. package/dist/control-Ftiau058-CCeJcAVQ.mjs.map +1 -0
  122. package/dist/declarations-DR6To8_k-BFwkCGeP.mjs +1046 -0
  123. package/dist/declarations-DR6To8_k-BFwkCGeP.mjs.map +1 -0
  124. package/dist/default-namespace-D4vCwkXg-BaiW8LNK.mjs +39 -0
  125. package/dist/default-namespace-D4vCwkXg-BaiW8LNK.mjs.map +1 -0
  126. package/dist/default-namespace-D5X_k6hJ-GH8P1ror.d.mts +26 -0
  127. package/dist/default-namespace-D5X_k6hJ-GH8P1ror.d.mts.map +1 -0
  128. package/dist/defined-BQWA85QH-BRSBMULx.mjs +31 -0
  129. package/dist/defined-BQWA85QH-BRSBMULx.mjs.map +1 -0
  130. package/dist/defined-BSXuxrnl.d.mts +28 -0
  131. package/dist/defined-BSXuxrnl.d.mts.map +1 -0
  132. package/dist/domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts +359 -0
  133. package/dist/domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts.map +1 -0
  134. package/dist/emission-CeoAV9mj.mjs +26 -0
  135. package/dist/emission-CeoAV9mj.mjs.map +1 -0
  136. package/dist/emission-DeoQufVd.d.mts +1 -0
  137. package/dist/emission-types-hfRVB_Yw-DpQ3hISB.d.mts +75 -0
  138. package/dist/emission-types-hfRVB_Yw-DpQ3hISB.d.mts.map +1 -0
  139. package/dist/enum-accessor-Db5DaTNX.mjs +35 -0
  140. package/dist/enum-accessor-Db5DaTNX.mjs.map +1 -0
  141. package/dist/enum-accessor-PH5vjghI.d.mts +85 -0
  142. package/dist/enum-accessor-PH5vjghI.d.mts.map +1 -0
  143. package/dist/errors.d.mts +4 -0
  144. package/dist/errors.mjs +4 -0
  145. package/dist/errors__control.d.mts +2 -0
  146. package/dist/errors__control.mjs +2 -0
  147. package/dist/errors__execution.d.mts +2 -0
  148. package/dist/errors__execution.mjs +2 -0
  149. package/dist/errors__migration.d.mts +2 -0
  150. package/dist/errors__migration.mjs +2 -0
  151. package/dist/execution-BNwBzmRd.mjs +40 -0
  152. package/dist/execution-BNwBzmRd.mjs.map +1 -0
  153. package/dist/execution-BbOD4GyR.mjs +164 -0
  154. package/dist/execution-BbOD4GyR.mjs.map +1 -0
  155. package/dist/execution-Bo5Bu2Ys.d.mts +79 -0
  156. package/dist/execution-Bo5Bu2Ys.d.mts.map +1 -0
  157. package/dist/execution-MOde1lmD.d.mts +98 -0
  158. package/dist/execution-MOde1lmD.d.mts.map +1 -0
  159. package/dist/framework-authoring-7YMP9TwM-C9P-N6_a.d.mts +777 -0
  160. package/dist/framework-authoring-7YMP9TwM-C9P-N6_a.d.mts.map +1 -0
  161. package/dist/framework-authoring-CDEvlouU-mlMWSksD.mjs +698 -0
  162. package/dist/framework-authoring-CDEvlouU-mlMWSksD.mjs.map +1 -0
  163. package/dist/framework-components-D6j4Y5K7-RW9H184y.mjs +27 -0
  164. package/dist/framework-components-D6j4Y5K7-RW9H184y.mjs.map +1 -0
  165. package/dist/framework-components-MFoo0sYx-G_6k9jt4.d.mts +388 -0
  166. package/dist/framework-components-MFoo0sYx-G_6k9jt4.d.mts.map +1 -0
  167. package/dist/hash-content-Bugg_nZn.mjs +63 -0
  168. package/dist/hash-content-Bugg_nZn.mjs.map +1 -0
  169. package/dist/hash-content-DwEUh-Rx.d.mts +59 -0
  170. package/dist/hash-content-DwEUh-Rx.d.mts.map +1 -0
  171. package/dist/hashing-BtIZVNYX.mjs +199 -0
  172. package/dist/hashing-BtIZVNYX.mjs.map +1 -0
  173. package/dist/hashing-CccSPELN.d.mts +25 -0
  174. package/dist/hashing-CccSPELN.d.mts.map +1 -0
  175. package/dist/hashing-utils-DQgS3nOe.mjs +48 -0
  176. package/dist/hashing-utils-DQgS3nOe.mjs.map +1 -0
  177. package/dist/hashing-utils-qKu59RSC.d.mts +19 -0
  178. package/dist/hashing-utils-qKu59RSC.d.mts.map +1 -0
  179. package/dist/ids.d.mts +44 -0
  180. package/dist/ids.d.mts.map +1 -0
  181. package/dist/ids.mjs +96 -0
  182. package/dist/ids.mjs.map +1 -0
  183. package/dist/ids__runtime.d.mts +7 -0
  184. package/dist/ids__runtime.d.mts.map +1 -0
  185. package/dist/ids__runtime.mjs +31 -0
  186. package/dist/ids__runtime.mjs.map +1 -0
  187. package/dist/index-GY2oGH9L.d.mts +120 -0
  188. package/dist/index-GY2oGH9L.d.mts.map +1 -0
  189. package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs +24 -0
  190. package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs.map +1 -0
  191. package/dist/internal-error-kK8QvlDE.d.mts +19 -0
  192. package/dist/internal-error-kK8QvlDE.d.mts.map +1 -0
  193. package/dist/ir-BvE7L9FK.d.mts +359 -0
  194. package/dist/ir-BvE7L9FK.d.mts.map +1 -0
  195. package/dist/ir-ChmSSAhX.mjs +200 -0
  196. package/dist/ir-ChmSSAhX.mjs.map +1 -0
  197. package/dist/is-plain-record-C9BWiqcw.d.mts +12 -0
  198. package/dist/is-plain-record-C9BWiqcw.d.mts.map +1 -0
  199. package/dist/is-plain-record-CUofyVQ7-DWEzdhIx.mjs +16 -0
  200. package/dist/is-plain-record-CUofyVQ7-DWEzdhIx.mjs.map +1 -0
  201. package/dist/json-Dkqr3say.d.mts +26 -0
  202. package/dist/json-Dkqr3say.d.mts.map +1 -0
  203. package/dist/migration-4VOHVEzx.mjs +118 -0
  204. package/dist/migration-4VOHVEzx.mjs.map +1 -0
  205. package/dist/migration-DKbDzBwy.d.mts +74 -0
  206. package/dist/migration-DKbDzBwy.d.mts.map +1 -0
  207. package/dist/namespace-id-asbWpwMw-3yxn-tRe.mjs +9 -0
  208. package/dist/namespace-id-asbWpwMw-3yxn-tRe.mjs.map +1 -0
  209. package/dist/operations.d.mts +46 -0
  210. package/dist/operations.d.mts.map +1 -0
  211. package/dist/operations.mjs +28 -0
  212. package/dist/operations.mjs.map +1 -0
  213. package/dist/parse-0ZJjj_2N-WZZ1nlrv.d.mts +427 -0
  214. package/dist/parse-0ZJjj_2N-WZZ1nlrv.d.mts.map +1 -0
  215. package/dist/parse-GbZGfMUj-BFSrD2AN.mjs +621 -0
  216. package/dist/parse-GbZGfMUj-BFSrD2AN.mjs.map +1 -0
  217. package/dist/promise-D8meygPf.mjs +13 -0
  218. package/dist/promise-D8meygPf.mjs.map +1 -0
  219. package/dist/promise-DHJWZv49.d.mts +11 -0
  220. package/dist/promise-DHJWZv49.d.mts.map +1 -0
  221. package/dist/psl-ast-BEwO80EH.d.mts +37 -0
  222. package/dist/psl-ast-BEwO80EH.d.mts.map +1 -0
  223. package/dist/psl-ast-Chgi8e4o-rSlBk1UV.d.mts +259 -0
  224. package/dist/psl-ast-Chgi8e4o-rSlBk1UV.d.mts.map +1 -0
  225. package/dist/psl-ast-DUCvVXbB.mjs +239 -0
  226. package/dist/psl-ast-DUCvVXbB.mjs.map +1 -0
  227. package/dist/psl-parser.d.mts +158 -0
  228. package/dist/psl-parser.d.mts.map +1 -0
  229. package/dist/psl-parser.mjs +804 -0
  230. package/dist/psl-parser.mjs.map +1 -0
  231. package/dist/psl-parser__format.d.mts +12 -0
  232. package/dist/psl-parser__format.d.mts.map +1 -0
  233. package/dist/psl-parser__format.mjs +464 -0
  234. package/dist/psl-parser__format.mjs.map +1 -0
  235. package/dist/psl-parser__interpret.d.mts +40 -0
  236. package/dist/psl-parser__interpret.d.mts.map +1 -0
  237. package/dist/psl-parser__interpret.mjs +25 -0
  238. package/dist/psl-parser__interpret.mjs.map +1 -0
  239. package/dist/psl-parser__syntax.d.mts +31 -0
  240. package/dist/psl-parser__syntax.d.mts.map +1 -0
  241. package/dist/psl-parser__syntax.mjs +43 -0
  242. package/dist/psl-parser__syntax.mjs.map +1 -0
  243. package/dist/psl-parser__tokenizer.d.mts +2 -0
  244. package/dist/psl-parser__tokenizer.mjs +2 -0
  245. package/dist/psl-printer.d.mts +37 -0
  246. package/dist/psl-printer.d.mts.map +1 -0
  247. package/dist/psl-printer.mjs +393 -0
  248. package/dist/psl-printer.mjs.map +1 -0
  249. package/dist/redact-db-url-BlaloOwt.d.mts +22 -0
  250. package/dist/redact-db-url-BlaloOwt.d.mts.map +1 -0
  251. package/dist/redact-db-url-CRWJWdB1.mjs +26 -0
  252. package/dist/redact-db-url-CRWJWdB1.mjs.map +1 -0
  253. package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs +59 -0
  254. package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs.map +1 -0
  255. package/dist/resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts +17 -0
  256. package/dist/resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts.map +1 -0
  257. package/dist/resolve-domain-model-BovPAsW2-8rwyzjxp.mjs +20 -0
  258. package/dist/resolve-domain-model-BovPAsW2-8rwyzjxp.mjs.map +1 -0
  259. package/dist/result-Bpupv5vO.d.mts +54 -0
  260. package/dist/result-Bpupv5vO.d.mts.map +1 -0
  261. package/dist/result-CBZ8X9mU.mjs +92 -0
  262. package/dist/result-CBZ8X9mU.mjs.map +1 -0
  263. package/dist/runtime--RZXG1zP.d.mts +901 -0
  264. package/dist/runtime--RZXG1zP.d.mts.map +1 -0
  265. package/dist/runtime-DYTFHGwh.mjs +516 -0
  266. package/dist/runtime-DYTFHGwh.mjs.map +1 -0
  267. package/dist/runtime-error-BA9d7XjZ-BlT8t6LB.mjs +40 -0
  268. package/dist/runtime-error-BA9d7XjZ-BlT8t6LB.mjs.map +1 -0
  269. package/dist/simplify-deep-Dw9I_ZUl.d.mts +6 -0
  270. package/dist/simplify-deep-Dw9I_ZUl.d.mts.map +1 -0
  271. package/dist/structured-error-BVmv2aPB.d.mts +34 -0
  272. package/dist/structured-error-BVmv2aPB.d.mts.map +1 -0
  273. package/dist/structured-error-H6WU9Kjt.mjs +31 -0
  274. package/dist/structured-error-H6WU9Kjt.mjs.map +1 -0
  275. package/dist/symbol-table-CZ7EVCTL-oYQtrmzq.d.mts +125 -0
  276. package/dist/symbol-table-CZ7EVCTL-oYQtrmzq.d.mts.map +1 -0
  277. package/dist/tokenizer-1hAHZzmp-QGPORvmA.mjs +228 -0
  278. package/dist/tokenizer-1hAHZzmp-QGPORvmA.mjs.map +1 -0
  279. package/dist/tokenizer-DcYI0Xrq-C-nNE9mE.d.mts +16 -0
  280. package/dist/tokenizer-DcYI0Xrq-C-nNE9mE.d.mts.map +1 -0
  281. package/dist/ts-render.d.mts +2 -0
  282. package/dist/ts-render.mjs +240 -0
  283. package/dist/ts-render.mjs.map +1 -0
  284. package/dist/types-ByeQhU9p.d.mts +17 -0
  285. package/dist/types-ByeQhU9p.d.mts.map +1 -0
  286. package/dist/types-DGxlljKG.d.mts +7 -0
  287. package/dist/types-DGxlljKG.d.mts.map +1 -0
  288. package/dist/types-DgdgskBY.mjs +96 -0
  289. package/dist/types-DgdgskBY.mjs.map +1 -0
  290. package/dist/types-import-spec-DRKzrJ20-WYwyCtil.d.mts +14 -0
  291. package/dist/types-import-spec-DRKzrJ20-WYwyCtil.d.mts.map +1 -0
  292. package/dist/utils-DMAM0unR.mjs +20 -0
  293. package/dist/utils-DMAM0unR.mjs.map +1 -0
  294. package/dist/utils-DeWL_zD9.d.mts +11 -0
  295. package/dist/utils-DeWL_zD9.d.mts.map +1 -0
  296. package/dist/utils.d.mts +16 -0
  297. package/dist/utils.mjs +13 -0
  298. package/dist/utils__abortable.d.mts +2 -0
  299. package/dist/utils__abortable.mjs +2 -0
  300. package/dist/utils__array-equal.d.mts +2 -0
  301. package/dist/utils__array-equal.mjs +2 -0
  302. package/dist/utils__assertions.d.mts +2 -0
  303. package/dist/utils__assertions.mjs +2 -0
  304. package/dist/utils__canonical-stringify.d.mts +2 -0
  305. package/dist/utils__canonical-stringify.mjs +2 -0
  306. package/dist/utils__casts.d.mts +2 -0
  307. package/dist/utils__casts.mjs +2 -0
  308. package/dist/utils__defined.d.mts +2 -0
  309. package/dist/utils__defined.mjs +2 -0
  310. package/dist/utils__hash-content.d.mts +2 -0
  311. package/dist/utils__hash-content.mjs +2 -0
  312. package/dist/utils__internal-error.d.mts +2 -0
  313. package/dist/utils__internal-error.mjs +2 -0
  314. package/dist/utils__json.d.mts +2 -0
  315. package/dist/utils__json.mjs +1 -0
  316. package/dist/utils__promise.d.mts +2 -0
  317. package/dist/utils__promise.mjs +2 -0
  318. package/dist/utils__redact-db-url.d.mts +2 -0
  319. package/dist/utils__redact-db-url.mjs +2 -0
  320. package/dist/utils__result.d.mts +2 -0
  321. package/dist/utils__result.mjs +2 -0
  322. package/dist/utils__simplify-deep.d.mts +2 -0
  323. package/dist/utils__simplify-deep.mjs +1 -0
  324. package/dist/utils__structured-error.d.mts +2 -0
  325. package/dist/utils__structured-error.mjs +2 -0
  326. package/dist/utils__types.d.mts +2 -0
  327. package/dist/utils__types.mjs +1 -0
  328. package/dist/validate-domain-BNBs-TVv.d.mts +22 -0
  329. package/dist/validate-domain-BNBs-TVv.d.mts.map +1 -0
  330. package/dist/validate-domain-BkvFlY3B.mjs +143 -0
  331. package/dist/validate-domain-BkvFlY3B.mjs.map +1 -0
  332. package/package.json +109 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime--RZXG1zP.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;KAoBK;;;;;;;;;;;;UAYK,gBAAgB,SAAS,cAAc;WACtC;WACA;WACA,OAAO;WACP,cAAc,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2C3B,iBAAiB,SAAS,cAAc;GAC/C,OAAO,UAAU,gBAAgB,SAAS;WAClC;WACA,cAAc,YAAY;EACnC,KAAK;aACM;eACE,cAAc;;MAEvB;;;;;;;;;;;;;;;;;;;;;;;;UAwBI,wBAAwB,cAAc;WACrC;WACA,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCjB,iBAAiB,mBAAmB,cAAc,eAAe,SAAS,wBAAwB,WAAW,iBAAiB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsDnJ,iBAAiB,UAAU,eAAe,oBAAoB,yBAAyB,gCAAgC,WAAW,KAAK,GAAG,WAAW,sBAAsB,SAAS,SAAS,UAAU,QAAQ,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;iBAwBtN,4BAA4B,sBAAsB,yBAAyB,kBAAkB,MAAM,eAAe;;;cAGrH,oBAAoB,gBAAgB,cAAc,MAAM,YAAY;mBAC/D;UACT;UACA;UACA;EACR,YAAY,WAAW,eAAe;GACrC,OAAO,kBAAkB,cAAc;EACxC,WAAW,QAAQ;EACnB,SAAS,QAAQ;EACjB,gBAAgB,QAAQ;EACxB,KAAK,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B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkCjD,YAAY,UAAU;EAC9B,SAAS,GAAG,cAAc,eAAe,YAAY,UAAU,QAAQ,gBAAgB,GAAG;;;;;;;;;;;;UAYlF,gBAAgB,UAAU,uBAAuB,YAAY;WAC5D,aAAa,oBAAoB,yBAAyB;;;;;;;;;;;iBAWpD,kBAAkB,UAAU,eAAe,MAAM,GAAG,uBAAuB,gBAAgB"}
@@ -0,0 +1,516 @@
1
+ import { n as runtimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
2
+ //#region ../../../1-framework/1-core/framework-components/dist/runtime.mjs
3
+ /**
4
+ * Stable code emitted by the runtime when an in-flight `execute()`
5
+ * is cancelled via the per-query `AbortSignal`. The envelope's
6
+ * `details.phase` distinguishes where the abort was observed:
7
+ *
8
+ * - `'encode'` — abort fired during `encodeParams` (SQL) or
9
+ * `resolveValue` (Mongo).
10
+ * - `'decode'` — abort fired during `decodeRow` / `decodeField`.
11
+ * - `'stream'` — abort fired between rows or before any codec call
12
+ * (already-aborted at entry).
13
+ * - `'beforeExecute'` / `'afterExecute'` / `'onRow'` — abort fired
14
+ * on entry to or during the corresponding middleware phase
15
+ * (cooperative cancellation per the param-transform seam).
16
+ */
17
+ const RUNTIME_ABORTED = "RUNTIME.ABORTED";
18
+ /**
19
+ * Construct a `RUNTIME.ABORTED` envelope. Phase distinguishes where the
20
+ * abort was observed — codec call sites (`encode` / `decode` / `stream`)
21
+ * or middleware seams (`beforeExecute` / `afterExecute` / `onRow`), as
22
+ * enumerated on {@link RuntimeAbortedPhase}. Cause carries
23
+ * `signal.reason` verbatim from the platform — native abort produces a
24
+ * `DOMException`, explicit `controller.abort(reason)` produces whatever
25
+ * the caller passed. No synthesis happens here.
26
+ */
27
+ function runtimeAborted(phase, cause) {
28
+ const envelope = runtimeError(RUNTIME_ABORTED, `Operation aborted during ${phase}`, { phase });
29
+ return Object.assign(envelope, { cause });
30
+ }
31
+ /**
32
+ * Defines a typed annotation handle.
33
+ *
34
+ * Two-step call form. The first step takes the `Payload` type argument
35
+ * (TypeScript cannot infer `Payload` from anything in the options, so it
36
+ * must be supplied explicitly); the second step takes the runtime options
37
+ * and infers `Kinds` from the `applicableTo` array via a `const` type
38
+ * parameter, so the operation kinds appear exactly once at the call site.
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * // Read-only annotation. Lane terminals like `db.User.first(...)` accept
43
+ * // it; `db.User.create(...)` rejects it at the type level.
44
+ * const cacheAnnotation = defineAnnotation<{ ttl?: number; skip?: boolean }>()({
45
+ * namespace: 'cache',
46
+ * applicableTo: ['read'],
47
+ * }); // Kinds inferred as 'read'
48
+ *
49
+ * // Write-only annotation. Mirror image.
50
+ * const auditAnnotation = defineAnnotation<{ actor: string }>()({
51
+ * namespace: 'audit',
52
+ * applicableTo: ['write'],
53
+ * }); // Kinds inferred as 'write'
54
+ *
55
+ * // Annotation applicable to both kinds (e.g. tracing).
56
+ * const otelAnnotation = defineAnnotation<{ traceId: string }>()({
57
+ * namespace: 'otel',
58
+ * applicableTo: ['read', 'write'],
59
+ * }); // Kinds inferred as 'read' | 'write'
60
+ * ```
61
+ *
62
+ * **Reserved namespaces.** See `DefineAnnotationOptions.namespace` for the
63
+ * list of framework-internal namespaces (`codecs`, target-specific keys).
64
+ * `defineAnnotation` does not structurally prevent a user from naming a
65
+ * reserved namespace, but the framework makes no compatibility guarantee
66
+ * about handles that do.
67
+ */
68
+ function defineAnnotation() {
69
+ return (options) => {
70
+ const namespace = options.namespace;
71
+ const applicableTo = Object.freeze(new Set(options.applicableTo));
72
+ function handle(value) {
73
+ return Object.freeze({
74
+ __annotation: true,
75
+ namespace,
76
+ value,
77
+ applicableTo
78
+ });
79
+ }
80
+ function read(plan) {
81
+ const stored = plan.meta.annotations?.[namespace];
82
+ if (!isAnnotationValue(stored)) return;
83
+ if (stored.namespace !== namespace) return;
84
+ return stored.value;
85
+ }
86
+ return Object.freeze(Object.assign(handle, {
87
+ namespace,
88
+ applicableTo,
89
+ read
90
+ }));
91
+ };
92
+ }
93
+ /**
94
+ * Runtime applicability gate. Throws `RUNTIME.ANNOTATION_INAPPLICABLE` if
95
+ * any annotation in `annotations` declares an `applicableTo` set that does
96
+ * not include `kind`. Used by lane terminals (SQL DSL builders' `.build()`,
97
+ * ORM `Collection` terminals) to fail closed when the type-level
98
+ * `ValidAnnotations` gate is bypassed via cast / `any` / dynamic
99
+ * invocation.
100
+ *
101
+ * Passes silently on:
102
+ * - empty arrays
103
+ * - annotations whose `applicableTo` includes `kind`
104
+ *
105
+ * Throws on:
106
+ * - any annotation whose `applicableTo` does not include `kind`. The
107
+ * error names the offending annotation's `namespace` and the
108
+ * `terminalName` so users can locate the misuse.
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * // Inside an ORM read terminal:
113
+ * assertAnnotationsApplicable(annotations, 'read', 'first');
114
+ * ```
115
+ */
116
+ function assertAnnotationsApplicable(annotations, kind, terminalName) {
117
+ for (const annotation of annotations) if (!annotation.applicableTo.has(kind)) throw runtimeError("RUNTIME.ANNOTATION_INAPPLICABLE", `Annotation '${annotation.namespace}' is not applicable to '${kind}' operations (terminal: '${terminalName}'). The annotation declares applicableTo = [${Array.from(annotation.applicableTo).map((k) => `'${k}'`).join(", ")}].`, {
118
+ namespace: annotation.namespace,
119
+ terminalName,
120
+ kind,
121
+ applicableTo: Array.from(annotation.applicableTo)
122
+ });
123
+ }
124
+ /**
125
+ * Type guard for branded annotation values stored in `plan.meta.annotations`.
126
+ *
127
+ * Internal — used by `AnnotationHandle.read` to distinguish user
128
+ * annotations (created by calling a handle returned from
129
+ * `defineAnnotation(...)`) from framework-internal metadata that may
130
+ * happen to live under the same namespace key.
131
+ */
132
+ function isAnnotationValue(value) {
133
+ if (value === null || typeof value !== "object") return false;
134
+ return value.__annotation === true;
135
+ }
136
+ var AsyncIterableResult = class {
137
+ generator;
138
+ consumed = false;
139
+ consumedBy;
140
+ bufferedArrayPromise;
141
+ constructor(generator) {
142
+ this.generator = generator;
143
+ }
144
+ [Symbol.asyncIterator]() {
145
+ if (this.consumed) throw runtimeError("RUNTIME.ITERATOR_CONSUMED", `AsyncIterableResult iterator has already been consumed via ${this.consumedBy === "bufferedArray" ? "toArray()/then()" : "for-await loop"}. Each AsyncIterableResult can only be iterated once.`, {
146
+ consumedBy: this.consumedBy,
147
+ suggestion: this.consumedBy === "bufferedArray" ? "If you need to iterate multiple times, store the results from toArray() in a variable and reuse that." : "If you need to iterate multiple times, use toArray() to collect all results first."
148
+ });
149
+ this.consumed = true;
150
+ this.consumedBy = "iterator";
151
+ return this.generator;
152
+ }
153
+ toArray() {
154
+ if (this.consumedBy === "iterator") return Promise.reject(runtimeError("RUNTIME.ITERATOR_CONSUMED", "AsyncIterableResult iterator has already been consumed via for-await loop. Each AsyncIterableResult can only be iterated once.", {
155
+ consumedBy: this.consumedBy,
156
+ suggestion: "The iterator was already consumed by a for-await loop. Use toArray() or await the result before iterating."
157
+ }));
158
+ if (this.bufferedArrayPromise) return this.bufferedArrayPromise;
159
+ this.consumed = true;
160
+ this.consumedBy = "bufferedArray";
161
+ this.bufferedArrayPromise = (async () => {
162
+ const out = [];
163
+ for await (const item of this.generator) out.push(item);
164
+ return out;
165
+ })();
166
+ return this.bufferedArrayPromise;
167
+ }
168
+ async first() {
169
+ return (await this.toArray())[0] ?? null;
170
+ }
171
+ async firstOrThrow() {
172
+ const row = await this.first();
173
+ if (row === null) throw runtimeError("RUNTIME.NO_ROWS", "Expected at least one row, but none were returned", {});
174
+ return row;
175
+ }
176
+ then(onfulfilled, onrejected) {
177
+ return this.toArray().then(onfulfilled, onrejected);
178
+ }
179
+ };
180
+ /**
181
+ * Throw a phase-tagged `RUNTIME.ABORTED` envelope if the supplied
182
+ * context is already aborted at the precheck site. Centralises the
183
+ * `if (ctx.signal?.aborted) throw runtimeAborted(...)` pattern that
184
+ * every codec dispatch site (and the `beforeExecute` middleware phase)
185
+ * repeats. Accepts both the framework `CodecCallContext` and the
186
+ * `RuntimeMiddlewareContext`; both expose `signal?: AbortSignal`.
187
+ */
188
+ function checkAborted(ctx, phase) {
189
+ if (ctx.signal?.aborted) throw runtimeAborted(phase, ctx.signal.reason);
190
+ }
191
+ /**
192
+ * Race a per-cell `Promise.all` (or any other in-flight work promise) against
193
+ * the supplied abort signal so the runtime returns `RUNTIME.ABORTED` promptly
194
+ * even when codec bodies ignore the signal. In-flight bodies that ignore the
195
+ * signal are abandoned and run to completion in the background — the
196
+ * cooperative-cancellation contract documented in ADR 204.
197
+ *
198
+ * Call sites still SHOULD pre-check `signal.aborted` and short-circuit with
199
+ * a phase-tagged `RUNTIME.ABORTED` envelope before invoking this helper —
200
+ * that path is the canonical "aborted at entry" surface and avoids
201
+ * scheduling the work promise. As a defensive belt-and-braces, this helper
202
+ * also handles the already-aborted case internally: `AbortSignal` does not
203
+ * replay past abort events to listeners registered after the abort, so we
204
+ * inspect `signal.aborted` synchronously and reject with the sentinel
205
+ * before installing the listener. The rejection is still attributed to the
206
+ * abort path via the sentinel-identity check.
207
+ *
208
+ * Distinguishing the rejection source is load-bearing for AC-ERR4
209
+ * (`RUNTIME.ENCODE_FAILED` / `RUNTIME.DECODE_FAILED` pass through unchanged).
210
+ * The semantically equivalent `abortable(signal)` helper in
211
+ * `@internal/utils` rejects with `signal.reason ?? new DOMException(...)`,
212
+ * which is not stably distinguishable from a codec-thrown error by identity
213
+ * alone (a fresh fallback DOMException is allocated per call). We instead
214
+ * track abort attribution with a unique sentinel: only the `onAbort` listener
215
+ * installed here ever rejects with the sentinel, so an `error === sentinel`
216
+ * identity check after the race is unambiguous.
217
+ *
218
+ * Lives in `framework-components` (rather than the SQL family, where it
219
+ * originated in m2) so every family runtime that needs cooperative
220
+ * cancellation around a codec-dispatch `Promise.all` (SQL encode + decode
221
+ * today, Mongo encode in m3) shares the same attribution logic.
222
+ */
223
+ async function raceAgainstAbort(work, signal, phase) {
224
+ if (signal === void 0) return await work;
225
+ const sentinel = { reason: void 0 };
226
+ let onAbort;
227
+ const abortPromise = new Promise((_, reject) => {
228
+ if (signal.aborted) {
229
+ sentinel.reason = signal.reason;
230
+ reject(sentinel);
231
+ return;
232
+ }
233
+ onAbort = () => {
234
+ sentinel.reason = signal.reason;
235
+ reject(sentinel);
236
+ };
237
+ signal.addEventListener("abort", onAbort, { once: true });
238
+ });
239
+ try {
240
+ return await Promise.race([work, abortPromise]);
241
+ } catch (error) {
242
+ if (error === sentinel) throw runtimeAborted(phase, sentinel.reason);
243
+ throw error;
244
+ } finally {
245
+ if (onAbort) signal.removeEventListener("abort", onAbort);
246
+ }
247
+ }
248
+ /**
249
+ * Runs every middleware's `beforeExecute` hook in registration order,
250
+ * threading through the (optional) family-specific `paramsMutator`.
251
+ *
252
+ * Why this lives outside {@link runWithMiddleware}: middleware that
253
+ * mutates parameter values (e.g. cipherstash's bulk-encrypt SDK
254
+ * round-trip) must run *before* the family runtime encodes those
255
+ * parameters to driver wire format. Family runtimes call
256
+ * `runBeforeExecuteChain` between the AST → plan lowering step and
257
+ * the parameter encode step; the encode then observes the mutator's
258
+ * `currentParams()` view. `runWithMiddleware` retains the rest of
259
+ * the lifecycle (`intercept`, driver/row source loop, `onRow`,
260
+ * `afterExecute`) but no longer fires `beforeExecute` itself.
261
+ *
262
+ * Lifecycle within this helper:
263
+ *
264
+ * 1. For each middleware in registration order, if `beforeExecute`
265
+ * is implemented:
266
+ * - `checkAborted(ctx, 'beforeExecute')` short-circuits if the
267
+ * caller already aborted at entry.
268
+ * - The hook is invoked with `(plan, ctx, paramsMutator)`. A
269
+ * middleware body that ignores the mutator stays compatible —
270
+ * JavaScript allows extra positional arguments.
271
+ * - If the hook returns a Promise, it is raced against
272
+ * `ctx.signal` via {@link raceAgainstAbort} so cooperative
273
+ * cancellation surfaces a `RUNTIME.ABORTED { phase:
274
+ * 'beforeExecute' }` envelope even when the body itself
275
+ * ignores the signal.
276
+ *
277
+ * Error propagation: any error thrown by a `beforeExecute` body
278
+ * (or surfaced by the abort race) propagates out of this helper
279
+ * unchanged. The family runtime is responsible for converting it
280
+ * into the appropriate `afterExecute(completed: false)` notification
281
+ * once `runWithMiddleware` runs.
282
+ *
283
+ * Relationship to {@link runWithMiddleware}: the framework's
284
+ * `RuntimeCore.execute` template calls this helper between
285
+ * `lower(plan)` and `runWithMiddleware(...)`. Family runtimes that
286
+ * override `execute` (e.g. SQL, which inlines lower + encode for
287
+ * direct mutator threading) call this helper themselves at the
288
+ * equivalent point — between the family's AST → draft-plan
289
+ * lowering and the parameter-encode step.
290
+ *
291
+ * Intercept ordering: this helper fires unconditionally before
292
+ * `runWithMiddleware`. `intercept` (inside `runWithMiddleware`)
293
+ * therefore observes the post-`beforeExecute` plan — mutator
294
+ * mutations are visible in the params interceptors see. The
295
+ * trade-off is documented on `RuntimeMiddleware.intercept`.
296
+ */
297
+ async function runBeforeExecuteChain(plan, middleware, ctx, paramsMutator) {
298
+ for (const mw of middleware) {
299
+ if (!mw.beforeExecute) continue;
300
+ checkAborted(ctx, "beforeExecute");
301
+ const work = mw.beforeExecute(plan, ctx, paramsMutator);
302
+ if (work !== void 0) await raceAgainstAbort(Promise.resolve(work), ctx.signal, "beforeExecute");
303
+ }
304
+ }
305
+ /**
306
+ * Drives a single execution of `runDriver()` through the middleware
307
+ * lifecycle's intercept + row-source + termination phases.
308
+ *
309
+ * Lifecycle, in order:
310
+ * 1. For each middleware in registration order: `intercept(exec, ctx)`. The
311
+ * first non-`undefined` result wins; subsequent middleware's `intercept`
312
+ * does not fire. On a hit, the runtime emits a `middleware.intercept`
313
+ * debug event naming the winning middleware, switches the row source to
314
+ * the intercepted rows, and proceeds with `source: 'middleware'`. On
315
+ * all-passthrough (every `intercept` returns `undefined` or is omitted),
316
+ * `source: 'driver'` is used and the row source is `runDriver()`.
317
+ * 2. Iterate the row source. On the driver path, for each row, for each
318
+ * middleware in registration order: `onRow(row, exec, ctx)`; then yield
319
+ * the row. On the intercepted hit path, `onRow` is skipped — intercepted
320
+ * rows did not originate from a driver row stream — but rows are still
321
+ * yielded to the consumer in order.
322
+ * 3. On successful completion: for each middleware in registration order:
323
+ * `afterExecute(exec, { rowCount, latencyMs, completed: true, source },
324
+ * ctx)`.
325
+ * 4. On any error thrown during steps 1–2: for each middleware in
326
+ * registration order: `afterExecute(exec, { rowCount, latencyMs,
327
+ * completed: false, source }, ctx)`. Errors thrown by `afterExecute`
328
+ * during the error path are swallowed so they do not mask the original
329
+ * error. The original error is then rethrown.
330
+ *
331
+ * `beforeExecute` is **not** fired here — see
332
+ * {@link runBeforeExecuteChain} in `before-execute-chain.ts`. Family
333
+ * runtimes call that helper between the AST → plan lowering step and
334
+ * the parameter encode step so middleware that mutates ParamRef
335
+ * values (e.g. cipherstash bulk-encrypt) can have its mutations
336
+ * visible to encode. `runWithMiddleware` operates on the fully-
337
+ * encoded plan; interceptors therefore observe a fully-mutated,
338
+ * encoded plan.
339
+ *
340
+ * The `source` field on `AfterExecuteResult` lets observers (telemetry,
341
+ * lints, budgets) distinguish driver-served from middleware-served
342
+ * executions without needing their own out-of-band signal.
343
+ *
344
+ * This helper is the single canonical implementation of the
345
+ * intercept-and-row-source loop; family runtimes should not
346
+ * reimplement it.
347
+ */
348
+ function runWithMiddleware(exec, middleware, ctx, runDriver) {
349
+ const iterator = async function* () {
350
+ const startedAt = Date.now();
351
+ let rowCount = 0;
352
+ let completed = false;
353
+ let source = "driver";
354
+ let rowSource;
355
+ try {
356
+ for (const mw of middleware) {
357
+ if (!mw.intercept) continue;
358
+ source = "middleware";
359
+ const result = await mw.intercept(exec, ctx);
360
+ if (result === void 0) {
361
+ source = "driver";
362
+ continue;
363
+ }
364
+ ctx.log.debug?.({
365
+ event: "middleware.intercept",
366
+ middleware: mw.name
367
+ });
368
+ rowSource = result.rows;
369
+ break;
370
+ }
371
+ if (source === "driver") rowSource = runDriver();
372
+ for await (const row of rowSource) {
373
+ if (source === "driver") {
374
+ for (const mw of middleware) if (mw.onRow) await mw.onRow(row, exec, ctx);
375
+ }
376
+ rowCount++;
377
+ yield row;
378
+ }
379
+ completed = true;
380
+ } catch (error) {
381
+ const latencyMs = Date.now() - startedAt;
382
+ for (const mw of middleware) if (mw.afterExecute) try {
383
+ await mw.afterExecute(exec, {
384
+ rowCount,
385
+ latencyMs,
386
+ completed,
387
+ source
388
+ }, ctx);
389
+ } catch {}
390
+ throw error;
391
+ }
392
+ const latencyMs = Date.now() - startedAt;
393
+ for (const mw of middleware) if (mw.afterExecute) await mw.afterExecute(exec, {
394
+ rowCount,
395
+ latencyMs,
396
+ completed,
397
+ source
398
+ }, ctx);
399
+ };
400
+ return new AsyncIterableResult(iterator());
401
+ }
402
+ /**
403
+ * Family-agnostic abstract runtime base.
404
+ *
405
+ * Defines the entire `execute(plan)` template in one place:
406
+ *
407
+ * 1. `runBeforeCompile(plan)` — concrete; defaults to identity. SQL overrides
408
+ * this to run its `beforeCompile` middleware-hook chain.
409
+ * 2. `lower(plan)` — abstract. Each family produces its `*ExecutionPlan`
410
+ * (SQL via `lowerSqlPlan`, Mongo via `adapter.lower`).
411
+ * 3. `runBeforeExecuteChain(exec, this.middleware, this.ctx)` — concrete;
412
+ * runs every middleware's `beforeExecute` hook after lowering but
413
+ * before the row source is opened. Family runtimes that need a
414
+ * params mutator visible to a downstream encode step (SQL) override
415
+ * `execute` and call this helper themselves at the equivalent
416
+ * pre-encode point.
417
+ * 4. `runWithMiddleware(exec, this.middleware, this.ctx,
418
+ * () => runDriver(exec))` — concrete; runs the intercept chain,
419
+ * drives the row source, fires `onRow` / `afterExecute`. Does
420
+ * **not** fire `beforeExecute` — see step 3.
421
+ *
422
+ * Concrete subclasses must implement `lower`, `runDriver`, and `close`.
423
+ *
424
+ * The class is generic over:
425
+ * - `TPlan` — the family's pre-lowering plan type.
426
+ * - `TExec` — the family's post-lowering (executable) plan type.
427
+ * - `TMiddleware` — the family's middleware type. Constrained to
428
+ * `RuntimeMiddleware<TExec>` because `runWithMiddleware` invokes the
429
+ * `beforeExecute` / `onRow` / `afterExecute` hooks with the lowered
430
+ * `TExec`. (The spec/plan wording "RuntimeMiddleware<TPlan>" is
431
+ * tightened to `<TExec>` here so the helper call typechecks; the
432
+ * intent is unchanged — middleware sees the post-lowering plan.)
433
+ */
434
+ var RuntimeCore = class {
435
+ middleware;
436
+ ctx;
437
+ constructor(options) {
438
+ this.middleware = options.middleware;
439
+ this.ctx = options.ctx;
440
+ }
441
+ /**
442
+ * Pre-lowering hook for plan rewriting. Defaults to identity. Subclasses
443
+ * may override to run a `beforeCompile` middleware chain (SQL does this
444
+ * to support typed AST rewrites — see `before-compile-chain.ts`).
445
+ */
446
+ runBeforeCompile(plan) {
447
+ return plan;
448
+ }
449
+ execute(plan, options) {
450
+ const self = this;
451
+ const signal = options?.signal;
452
+ const codecCtx = signal === void 0 ? {} : { signal };
453
+ const execCtx = {
454
+ ...self.ctx,
455
+ planExecutionId: crypto.randomUUID()
456
+ };
457
+ async function* generator() {
458
+ checkAborted(codecCtx, "stream");
459
+ const compiled = await self.runBeforeCompile(plan);
460
+ const exec = await self.lower(compiled, codecCtx);
461
+ await runBeforeExecuteChain(exec, self.middleware, execCtx);
462
+ yield* runWithMiddleware(exec, self.middleware, execCtx, () => self.runDriver(exec));
463
+ }
464
+ return new AsyncIterableResult(generator());
465
+ }
466
+ };
467
+ function checkMiddlewareCompatibility(middleware, runtimeFamilyId, runtimeTargetId) {
468
+ if (middleware.targetId !== void 0 && middleware.familyId === void 0) throw runtimeError("RUNTIME.MIDDLEWARE_INCOMPATIBLE", `Middleware '${middleware.name}' specifies targetId '${middleware.targetId}' without familyId`, {
469
+ middleware: middleware.name,
470
+ targetId: middleware.targetId
471
+ });
472
+ if (middleware.familyId !== void 0 && middleware.familyId !== runtimeFamilyId) throw runtimeError("RUNTIME.MIDDLEWARE_FAMILY_MISMATCH", `Middleware '${middleware.name}' requires family '${middleware.familyId}' but the runtime is configured for family '${runtimeFamilyId}'`, {
473
+ middleware: middleware.name,
474
+ middlewareFamilyId: middleware.familyId,
475
+ runtimeFamilyId
476
+ });
477
+ if (middleware.targetId !== void 0 && middleware.targetId !== runtimeTargetId) throw runtimeError("RUNTIME.MIDDLEWARE_TARGET_MISMATCH", `Middleware '${middleware.name}' requires target '${middleware.targetId}' but the runtime is configured for target '${runtimeTargetId}'`, {
478
+ middleware: middleware.name,
479
+ middlewareTargetId: middleware.targetId,
480
+ runtimeTargetId
481
+ });
482
+ }
483
+ var MetaBuilderImpl = class {
484
+ #kind;
485
+ #terminalName;
486
+ #annotations = /* @__PURE__ */ new Map();
487
+ constructor(kind, terminalName) {
488
+ this.#kind = kind;
489
+ this.#terminalName = terminalName;
490
+ }
491
+ get annotations() {
492
+ return this.#annotations;
493
+ }
494
+ annotate(annotation) {
495
+ const value = annotation;
496
+ assertAnnotationsApplicable([value], this.#kind, this.#terminalName);
497
+ this.#annotations.set(value.namespace, value);
498
+ return this;
499
+ }
500
+ };
501
+ /**
502
+ * Construct a lane-side meta builder for a terminal of operation kind `K`.
503
+ *
504
+ * Lane terminals call this with their `kind` (`'read'` or `'write'`) and a
505
+ * `terminalName` for error messages, hand the resulting builder to the
506
+ * user-supplied configurator callback (typed as `MetaBuilder<K>`, the
507
+ * narrower public view), and read `meta.annotations` afterwards to thread
508
+ * the recorded values into `plan.meta.annotations`.
509
+ */
510
+ function createMetaBuilder(kind, terminalName) {
511
+ return new MetaBuilderImpl(kind, terminalName);
512
+ }
513
+ //#endregion
514
+ export { checkAborted as a, defineAnnotation as c, runWithMiddleware as d, runtimeAborted as f, assertAnnotationsApplicable as i, raceAgainstAbort as l, RUNTIME_ABORTED as n, checkMiddlewareCompatibility as o, RuntimeCore as r, createMetaBuilder as s, AsyncIterableResult as t, runBeforeExecuteChain as u };
515
+
516
+ //# sourceMappingURL=runtime-DYTFHGwh.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-DYTFHGwh.mjs","names":["#kind","#terminalName","#annotations"],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime.mjs"],"sourcesContent":["import { n as runtimeError, t as isRuntimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\n//#region src/execution/runtime-error.ts\n/**\n* Stable code emitted by the runtime when an in-flight `execute()`\n* is cancelled via the per-query `AbortSignal`. The envelope's\n* `details.phase` distinguishes where the abort was observed:\n*\n* - `'encode'` — abort fired during `encodeParams` (SQL) or\n* `resolveValue` (Mongo).\n* - `'decode'` — abort fired during `decodeRow` / `decodeField`.\n* - `'stream'` — abort fired between rows or before any codec call\n* (already-aborted at entry).\n* - `'beforeExecute'` / `'afterExecute'` / `'onRow'` — abort fired\n* on entry to or during the corresponding middleware phase\n* (cooperative cancellation per the param-transform seam).\n*/\nconst RUNTIME_ABORTED = \"RUNTIME.ABORTED\";\n/**\n* Construct a `RUNTIME.ABORTED` envelope. Phase distinguishes where the\n* abort was observed — codec call sites (`encode` / `decode` / `stream`)\n* or middleware seams (`beforeExecute` / `afterExecute` / `onRow`), as\n* enumerated on {@link RuntimeAbortedPhase}. Cause carries\n* `signal.reason` verbatim from the platform — native abort produces a\n* `DOMException`, explicit `controller.abort(reason)` produces whatever\n* the caller passed. No synthesis happens here.\n*/\nfunction runtimeAborted(phase, cause) {\n\tconst envelope = runtimeError(RUNTIME_ABORTED, `Operation aborted during ${phase}`, { phase });\n\treturn Object.assign(envelope, { cause });\n}\n//#endregion\n//#region src/annotations.ts\n/**\n* Defines a typed annotation handle.\n*\n* Two-step call form. The first step takes the `Payload` type argument\n* (TypeScript cannot infer `Payload` from anything in the options, so it\n* must be supplied explicitly); the second step takes the runtime options\n* and infers `Kinds` from the `applicableTo` array via a `const` type\n* parameter, so the operation kinds appear exactly once at the call site.\n*\n* @example\n* ```typescript\n* // Read-only annotation. Lane terminals like `db.User.first(...)` accept\n* // it; `db.User.create(...)` rejects it at the type level.\n* const cacheAnnotation = defineAnnotation<{ ttl?: number; skip?: boolean }>()({\n* namespace: 'cache',\n* applicableTo: ['read'],\n* }); // Kinds inferred as 'read'\n*\n* // Write-only annotation. Mirror image.\n* const auditAnnotation = defineAnnotation<{ actor: string }>()({\n* namespace: 'audit',\n* applicableTo: ['write'],\n* }); // Kinds inferred as 'write'\n*\n* // Annotation applicable to both kinds (e.g. tracing).\n* const otelAnnotation = defineAnnotation<{ traceId: string }>()({\n* namespace: 'otel',\n* applicableTo: ['read', 'write'],\n* }); // Kinds inferred as 'read' | 'write'\n* ```\n*\n* **Reserved namespaces.** See `DefineAnnotationOptions.namespace` for the\n* list of framework-internal namespaces (`codecs`, target-specific keys).\n* `defineAnnotation` does not structurally prevent a user from naming a\n* reserved namespace, but the framework makes no compatibility guarantee\n* about handles that do.\n*/\nfunction defineAnnotation() {\n\treturn (options) => {\n\t\tconst namespace = options.namespace;\n\t\tconst applicableTo = Object.freeze(new Set(options.applicableTo));\n\t\tfunction handle(value) {\n\t\t\treturn Object.freeze({\n\t\t\t\t__annotation: true,\n\t\t\t\tnamespace,\n\t\t\t\tvalue,\n\t\t\t\tapplicableTo\n\t\t\t});\n\t\t}\n\t\tfunction read(plan) {\n\t\t\tconst stored = plan.meta.annotations?.[namespace];\n\t\t\tif (!isAnnotationValue(stored)) return;\n\t\t\tif (stored.namespace !== namespace) return;\n\t\t\treturn stored.value;\n\t\t}\n\t\treturn Object.freeze(Object.assign(handle, {\n\t\t\tnamespace,\n\t\t\tapplicableTo,\n\t\t\tread\n\t\t}));\n\t};\n}\n/**\n* Runtime applicability gate. Throws `RUNTIME.ANNOTATION_INAPPLICABLE` if\n* any annotation in `annotations` declares an `applicableTo` set that does\n* not include `kind`. Used by lane terminals (SQL DSL builders' `.build()`,\n* ORM `Collection` terminals) to fail closed when the type-level\n* `ValidAnnotations` gate is bypassed via cast / `any` / dynamic\n* invocation.\n*\n* Passes silently on:\n* - empty arrays\n* - annotations whose `applicableTo` includes `kind`\n*\n* Throws on:\n* - any annotation whose `applicableTo` does not include `kind`. The\n* error names the offending annotation's `namespace` and the\n* `terminalName` so users can locate the misuse.\n*\n* @example\n* ```typescript\n* // Inside an ORM read terminal:\n* assertAnnotationsApplicable(annotations, 'read', 'first');\n* ```\n*/\nfunction assertAnnotationsApplicable(annotations, kind, terminalName) {\n\tfor (const annotation of annotations) if (!annotation.applicableTo.has(kind)) throw runtimeError(\"RUNTIME.ANNOTATION_INAPPLICABLE\", `Annotation '${annotation.namespace}' is not applicable to '${kind}' operations (terminal: '${terminalName}'). The annotation declares applicableTo = [${Array.from(annotation.applicableTo).map((k) => `'${k}'`).join(\", \")}].`, {\n\t\tnamespace: annotation.namespace,\n\t\tterminalName,\n\t\tkind,\n\t\tapplicableTo: Array.from(annotation.applicableTo)\n\t});\n}\n/**\n* Type guard for branded annotation values stored in `plan.meta.annotations`.\n*\n* Internal — used by `AnnotationHandle.read` to distinguish user\n* annotations (created by calling a handle returned from\n* `defineAnnotation(...)`) from framework-internal metadata that may\n* happen to live under the same namespace key.\n*/\nfunction isAnnotationValue(value) {\n\tif (value === null || typeof value !== \"object\") return false;\n\treturn value.__annotation === true;\n}\n//#endregion\n//#region src/execution/async-iterable-result.ts\nvar AsyncIterableResult = class {\n\tgenerator;\n\tconsumed = false;\n\tconsumedBy;\n\tbufferedArrayPromise;\n\tconstructor(generator) {\n\t\tthis.generator = generator;\n\t}\n\t[Symbol.asyncIterator]() {\n\t\tif (this.consumed) throw runtimeError(\"RUNTIME.ITERATOR_CONSUMED\", `AsyncIterableResult iterator has already been consumed via ${this.consumedBy === \"bufferedArray\" ? \"toArray()/then()\" : \"for-await loop\"}. Each AsyncIterableResult can only be iterated once.`, {\n\t\t\tconsumedBy: this.consumedBy,\n\t\t\tsuggestion: this.consumedBy === \"bufferedArray\" ? \"If you need to iterate multiple times, store the results from toArray() in a variable and reuse that.\" : \"If you need to iterate multiple times, use toArray() to collect all results first.\"\n\t\t});\n\t\tthis.consumed = true;\n\t\tthis.consumedBy = \"iterator\";\n\t\treturn this.generator;\n\t}\n\ttoArray() {\n\t\tif (this.consumedBy === \"iterator\") return Promise.reject(runtimeError(\"RUNTIME.ITERATOR_CONSUMED\", \"AsyncIterableResult iterator has already been consumed via for-await loop. Each AsyncIterableResult can only be iterated once.\", {\n\t\t\tconsumedBy: this.consumedBy,\n\t\t\tsuggestion: \"The iterator was already consumed by a for-await loop. Use toArray() or await the result before iterating.\"\n\t\t}));\n\t\tif (this.bufferedArrayPromise) return this.bufferedArrayPromise;\n\t\tthis.consumed = true;\n\t\tthis.consumedBy = \"bufferedArray\";\n\t\tthis.bufferedArrayPromise = (async () => {\n\t\t\tconst out = [];\n\t\t\tfor await (const item of this.generator) out.push(item);\n\t\t\treturn out;\n\t\t})();\n\t\treturn this.bufferedArrayPromise;\n\t}\n\tasync first() {\n\t\treturn (await this.toArray())[0] ?? null;\n\t}\n\tasync firstOrThrow() {\n\t\tconst row = await this.first();\n\t\tif (row === null) throw runtimeError(\"RUNTIME.NO_ROWS\", \"Expected at least one row, but none were returned\", {});\n\t\treturn row;\n\t}\n\tthen(onfulfilled, onrejected) {\n\t\treturn this.toArray().then(onfulfilled, onrejected);\n\t}\n};\n//#endregion\n//#region src/execution/race-against-abort.ts\n/**\n* Throw a phase-tagged `RUNTIME.ABORTED` envelope if the supplied\n* context is already aborted at the precheck site. Centralises the\n* `if (ctx.signal?.aborted) throw runtimeAborted(...)` pattern that\n* every codec dispatch site (and the `beforeExecute` middleware phase)\n* repeats. Accepts both the framework `CodecCallContext` and the\n* `RuntimeMiddlewareContext`; both expose `signal?: AbortSignal`.\n*/\nfunction checkAborted(ctx, phase) {\n\tif (ctx.signal?.aborted) throw runtimeAborted(phase, ctx.signal.reason);\n}\n/**\n* Race a per-cell `Promise.all` (or any other in-flight work promise) against\n* the supplied abort signal so the runtime returns `RUNTIME.ABORTED` promptly\n* even when codec bodies ignore the signal. In-flight bodies that ignore the\n* signal are abandoned and run to completion in the background — the\n* cooperative-cancellation contract documented in ADR 204.\n*\n* Call sites still SHOULD pre-check `signal.aborted` and short-circuit with\n* a phase-tagged `RUNTIME.ABORTED` envelope before invoking this helper —\n* that path is the canonical \"aborted at entry\" surface and avoids\n* scheduling the work promise. As a defensive belt-and-braces, this helper\n* also handles the already-aborted case internally: `AbortSignal` does not\n* replay past abort events to listeners registered after the abort, so we\n* inspect `signal.aborted` synchronously and reject with the sentinel\n* before installing the listener. The rejection is still attributed to the\n* abort path via the sentinel-identity check.\n*\n* Distinguishing the rejection source is load-bearing for AC-ERR4\n* (`RUNTIME.ENCODE_FAILED` / `RUNTIME.DECODE_FAILED` pass through unchanged).\n* The semantically equivalent `abortable(signal)` helper in\n* `@internal/utils` rejects with `signal.reason ?? new DOMException(...)`,\n* which is not stably distinguishable from a codec-thrown error by identity\n* alone (a fresh fallback DOMException is allocated per call). We instead\n* track abort attribution with a unique sentinel: only the `onAbort` listener\n* installed here ever rejects with the sentinel, so an `error === sentinel`\n* identity check after the race is unambiguous.\n*\n* Lives in `framework-components` (rather than the SQL family, where it\n* originated in m2) so every family runtime that needs cooperative\n* cancellation around a codec-dispatch `Promise.all` (SQL encode + decode\n* today, Mongo encode in m3) shares the same attribution logic.\n*/\nasync function raceAgainstAbort(work, signal, phase) {\n\tif (signal === void 0) return await work;\n\tconst sentinel = { reason: void 0 };\n\tlet onAbort;\n\tconst abortPromise = new Promise((_, reject) => {\n\t\tif (signal.aborted) {\n\t\t\tsentinel.reason = signal.reason;\n\t\t\treject(sentinel);\n\t\t\treturn;\n\t\t}\n\t\tonAbort = () => {\n\t\t\tsentinel.reason = signal.reason;\n\t\t\treject(sentinel);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\ttry {\n\t\treturn await Promise.race([work, abortPromise]);\n\t} catch (error) {\n\t\tif (error === sentinel) throw runtimeAborted(phase, sentinel.reason);\n\t\tthrow error;\n\t} finally {\n\t\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\t}\n}\n//#endregion\n//#region src/execution/before-execute-chain.ts\n/**\n* Runs every middleware's `beforeExecute` hook in registration order,\n* threading through the (optional) family-specific `paramsMutator`.\n*\n* Why this lives outside {@link runWithMiddleware}: middleware that\n* mutates parameter values (e.g. cipherstash's bulk-encrypt SDK\n* round-trip) must run *before* the family runtime encodes those\n* parameters to driver wire format. Family runtimes call\n* `runBeforeExecuteChain` between the AST → plan lowering step and\n* the parameter encode step; the encode then observes the mutator's\n* `currentParams()` view. `runWithMiddleware` retains the rest of\n* the lifecycle (`intercept`, driver/row source loop, `onRow`,\n* `afterExecute`) but no longer fires `beforeExecute` itself.\n*\n* Lifecycle within this helper:\n*\n* 1. For each middleware in registration order, if `beforeExecute`\n* is implemented:\n* - `checkAborted(ctx, 'beforeExecute')` short-circuits if the\n* caller already aborted at entry.\n* - The hook is invoked with `(plan, ctx, paramsMutator)`. A\n* middleware body that ignores the mutator stays compatible —\n* JavaScript allows extra positional arguments.\n* - If the hook returns a Promise, it is raced against\n* `ctx.signal` via {@link raceAgainstAbort} so cooperative\n* cancellation surfaces a `RUNTIME.ABORTED { phase:\n* 'beforeExecute' }` envelope even when the body itself\n* ignores the signal.\n*\n* Error propagation: any error thrown by a `beforeExecute` body\n* (or surfaced by the abort race) propagates out of this helper\n* unchanged. The family runtime is responsible for converting it\n* into the appropriate `afterExecute(completed: false)` notification\n* once `runWithMiddleware` runs.\n*\n* Relationship to {@link runWithMiddleware}: the framework's\n* `RuntimeCore.execute` template calls this helper between\n* `lower(plan)` and `runWithMiddleware(...)`. Family runtimes that\n* override `execute` (e.g. SQL, which inlines lower + encode for\n* direct mutator threading) call this helper themselves at the\n* equivalent point — between the family's AST → draft-plan\n* lowering and the parameter-encode step.\n*\n* Intercept ordering: this helper fires unconditionally before\n* `runWithMiddleware`. `intercept` (inside `runWithMiddleware`)\n* therefore observes the post-`beforeExecute` plan — mutator\n* mutations are visible in the params interceptors see. The\n* trade-off is documented on `RuntimeMiddleware.intercept`.\n*/\nasync function runBeforeExecuteChain(plan, middleware, ctx, paramsMutator) {\n\tfor (const mw of middleware) {\n\t\tif (!mw.beforeExecute) continue;\n\t\tcheckAborted(ctx, \"beforeExecute\");\n\t\tconst work = mw.beforeExecute(plan, ctx, paramsMutator);\n\t\tif (work !== void 0) await raceAgainstAbort(Promise.resolve(work), ctx.signal, \"beforeExecute\");\n\t}\n}\n//#endregion\n//#region src/execution/run-with-middleware.ts\n/**\n* Drives a single execution of `runDriver()` through the middleware\n* lifecycle's intercept + row-source + termination phases.\n*\n* Lifecycle, in order:\n* 1. For each middleware in registration order: `intercept(exec, ctx)`. The\n* first non-`undefined` result wins; subsequent middleware's `intercept`\n* does not fire. On a hit, the runtime emits a `middleware.intercept`\n* debug event naming the winning middleware, switches the row source to\n* the intercepted rows, and proceeds with `source: 'middleware'`. On\n* all-passthrough (every `intercept` returns `undefined` or is omitted),\n* `source: 'driver'` is used and the row source is `runDriver()`.\n* 2. Iterate the row source. On the driver path, for each row, for each\n* middleware in registration order: `onRow(row, exec, ctx)`; then yield\n* the row. On the intercepted hit path, `onRow` is skipped — intercepted\n* rows did not originate from a driver row stream — but rows are still\n* yielded to the consumer in order.\n* 3. On successful completion: for each middleware in registration order:\n* `afterExecute(exec, { rowCount, latencyMs, completed: true, source },\n* ctx)`.\n* 4. On any error thrown during steps 1–2: for each middleware in\n* registration order: `afterExecute(exec, { rowCount, latencyMs,\n* completed: false, source }, ctx)`. Errors thrown by `afterExecute`\n* during the error path are swallowed so they do not mask the original\n* error. The original error is then rethrown.\n*\n* `beforeExecute` is **not** fired here — see\n* {@link runBeforeExecuteChain} in `before-execute-chain.ts`. Family\n* runtimes call that helper between the AST → plan lowering step and\n* the parameter encode step so middleware that mutates ParamRef\n* values (e.g. cipherstash bulk-encrypt) can have its mutations\n* visible to encode. `runWithMiddleware` operates on the fully-\n* encoded plan; interceptors therefore observe a fully-mutated,\n* encoded plan.\n*\n* The `source` field on `AfterExecuteResult` lets observers (telemetry,\n* lints, budgets) distinguish driver-served from middleware-served\n* executions without needing their own out-of-band signal.\n*\n* This helper is the single canonical implementation of the\n* intercept-and-row-source loop; family runtimes should not\n* reimplement it.\n*/\nfunction runWithMiddleware(exec, middleware, ctx, runDriver) {\n\tconst iterator = async function* () {\n\t\tconst startedAt = Date.now();\n\t\tlet rowCount = 0;\n\t\tlet completed = false;\n\t\tlet source = \"driver\";\n\t\tlet rowSource;\n\t\ttry {\n\t\t\tfor (const mw of middleware) {\n\t\t\t\tif (!mw.intercept) continue;\n\t\t\t\tsource = \"middleware\";\n\t\t\t\tconst result = await mw.intercept(exec, ctx);\n\t\t\t\tif (result === void 0) {\n\t\t\t\t\tsource = \"driver\";\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tctx.log.debug?.({\n\t\t\t\t\tevent: \"middleware.intercept\",\n\t\t\t\t\tmiddleware: mw.name\n\t\t\t\t});\n\t\t\t\trowSource = result.rows;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (source === \"driver\") rowSource = runDriver();\n\t\t\tfor await (const row of rowSource) {\n\t\t\t\tif (source === \"driver\") {\n\t\t\t\t\tfor (const mw of middleware) if (mw.onRow) await mw.onRow(row, exec, ctx);\n\t\t\t\t}\n\t\t\t\trowCount++;\n\t\t\t\tyield row;\n\t\t\t}\n\t\t\tcompleted = true;\n\t\t} catch (error) {\n\t\t\tconst latencyMs = Date.now() - startedAt;\n\t\t\tfor (const mw of middleware) if (mw.afterExecute) try {\n\t\t\t\tawait mw.afterExecute(exec, {\n\t\t\t\t\trowCount,\n\t\t\t\t\tlatencyMs,\n\t\t\t\t\tcompleted,\n\t\t\t\t\tsource\n\t\t\t\t}, ctx);\n\t\t\t} catch {}\n\t\t\tthrow error;\n\t\t}\n\t\tconst latencyMs = Date.now() - startedAt;\n\t\tfor (const mw of middleware) if (mw.afterExecute) await mw.afterExecute(exec, {\n\t\t\trowCount,\n\t\t\tlatencyMs,\n\t\t\tcompleted,\n\t\t\tsource\n\t\t}, ctx);\n\t};\n\treturn new AsyncIterableResult(iterator());\n}\n//#endregion\n//#region src/execution/runtime-core.ts\n/**\n* Family-agnostic abstract runtime base.\n*\n* Defines the entire `execute(plan)` template in one place:\n*\n* 1. `runBeforeCompile(plan)` — concrete; defaults to identity. SQL overrides\n* this to run its `beforeCompile` middleware-hook chain.\n* 2. `lower(plan)` — abstract. Each family produces its `*ExecutionPlan`\n* (SQL via `lowerSqlPlan`, Mongo via `adapter.lower`).\n* 3. `runBeforeExecuteChain(exec, this.middleware, this.ctx)` — concrete;\n* runs every middleware's `beforeExecute` hook after lowering but\n* before the row source is opened. Family runtimes that need a\n* params mutator visible to a downstream encode step (SQL) override\n* `execute` and call this helper themselves at the equivalent\n* pre-encode point.\n* 4. `runWithMiddleware(exec, this.middleware, this.ctx,\n* () => runDriver(exec))` — concrete; runs the intercept chain,\n* drives the row source, fires `onRow` / `afterExecute`. Does\n* **not** fire `beforeExecute` — see step 3.\n*\n* Concrete subclasses must implement `lower`, `runDriver`, and `close`.\n*\n* The class is generic over:\n* - `TPlan` — the family's pre-lowering plan type.\n* - `TExec` — the family's post-lowering (executable) plan type.\n* - `TMiddleware` — the family's middleware type. Constrained to\n* `RuntimeMiddleware<TExec>` because `runWithMiddleware` invokes the\n* `beforeExecute` / `onRow` / `afterExecute` hooks with the lowered\n* `TExec`. (The spec/plan wording \"RuntimeMiddleware<TPlan>\" is\n* tightened to `<TExec>` here so the helper call typechecks; the\n* intent is unchanged — middleware sees the post-lowering plan.)\n*/\nvar RuntimeCore = class {\n\tmiddleware;\n\tctx;\n\tconstructor(options) {\n\t\tthis.middleware = options.middleware;\n\t\tthis.ctx = options.ctx;\n\t}\n\t/**\n\t* Pre-lowering hook for plan rewriting. Defaults to identity. Subclasses\n\t* may override to run a `beforeCompile` middleware chain (SQL does this\n\t* to support typed AST rewrites — see `before-compile-chain.ts`).\n\t*/\n\trunBeforeCompile(plan) {\n\t\treturn plan;\n\t}\n\texecute(plan, options) {\n\t\tconst self = this;\n\t\tconst signal = options?.signal;\n\t\tconst codecCtx = signal === void 0 ? {} : { signal };\n\t\tconst execCtx = {\n\t\t\t...self.ctx,\n\t\t\tplanExecutionId: crypto.randomUUID()\n\t\t};\n\t\tasync function* generator() {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\tconst compiled = await self.runBeforeCompile(plan);\n\t\t\tconst exec = await self.lower(compiled, codecCtx);\n\t\t\tawait runBeforeExecuteChain(exec, self.middleware, execCtx);\n\t\t\tyield* runWithMiddleware(exec, self.middleware, execCtx, () => self.runDriver(exec));\n\t\t}\n\t\treturn new AsyncIterableResult(generator());\n\t}\n};\n//#endregion\n//#region src/execution/runtime-middleware.ts\nfunction checkMiddlewareCompatibility(middleware, runtimeFamilyId, runtimeTargetId) {\n\tif (middleware.targetId !== void 0 && middleware.familyId === void 0) throw runtimeError(\"RUNTIME.MIDDLEWARE_INCOMPATIBLE\", `Middleware '${middleware.name}' specifies targetId '${middleware.targetId}' without familyId`, {\n\t\tmiddleware: middleware.name,\n\t\ttargetId: middleware.targetId\n\t});\n\tif (middleware.familyId !== void 0 && middleware.familyId !== runtimeFamilyId) throw runtimeError(\"RUNTIME.MIDDLEWARE_FAMILY_MISMATCH\", `Middleware '${middleware.name}' requires family '${middleware.familyId}' but the runtime is configured for family '${runtimeFamilyId}'`, {\n\t\tmiddleware: middleware.name,\n\t\tmiddlewareFamilyId: middleware.familyId,\n\t\truntimeFamilyId\n\t});\n\tif (middleware.targetId !== void 0 && middleware.targetId !== runtimeTargetId) throw runtimeError(\"RUNTIME.MIDDLEWARE_TARGET_MISMATCH\", `Middleware '${middleware.name}' requires target '${middleware.targetId}' but the runtime is configured for target '${runtimeTargetId}'`, {\n\t\tmiddleware: middleware.name,\n\t\tmiddlewareTargetId: middleware.targetId,\n\t\truntimeTargetId\n\t});\n}\n//#endregion\n//#region src/meta-builder.ts\nvar MetaBuilderImpl = class {\n\t#kind;\n\t#terminalName;\n\t#annotations = /* @__PURE__ */ new Map();\n\tconstructor(kind, terminalName) {\n\t\tthis.#kind = kind;\n\t\tthis.#terminalName = terminalName;\n\t}\n\tget annotations() {\n\t\treturn this.#annotations;\n\t}\n\tannotate(annotation) {\n\t\tconst value = annotation;\n\t\tassertAnnotationsApplicable([value], this.#kind, this.#terminalName);\n\t\tthis.#annotations.set(value.namespace, value);\n\t\treturn this;\n\t}\n};\n/**\n* Construct a lane-side meta builder for a terminal of operation kind `K`.\n*\n* Lane terminals call this with their `kind` (`'read'` or `'write'`) and a\n* `terminalName` for error messages, hand the resulting builder to the\n* user-supplied configurator callback (typed as `MetaBuilder<K>`, the\n* narrower public view), and read `meta.annotations` afterwards to thread\n* the recorded values into `plan.meta.annotations`.\n*/\nfunction createMetaBuilder(kind, terminalName) {\n\treturn new MetaBuilderImpl(kind, terminalName);\n}\n//#endregion\nexport { AsyncIterableResult, RUNTIME_ABORTED, RuntimeCore, assertAnnotationsApplicable, checkAborted, checkMiddlewareCompatibility, createMetaBuilder, defineAnnotation, isRuntimeError, raceAgainstAbort, runBeforeExecuteChain, runWithMiddleware, runtimeAborted, runtimeError };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,kBAAkB;;;;;;;;;;AAUxB,SAAS,eAAe,OAAO,OAAO;CACrC,MAAM,WAAW,aAAa,iBAAiB,4BAA4B,SAAS,EAAE,MAAM,CAAC;CAC7F,OAAO,OAAO,OAAO,UAAU,EAAE,MAAM,CAAC;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,mBAAmB;CAC3B,QAAQ,YAAY;EACnB,MAAM,YAAY,QAAQ;EAC1B,MAAM,eAAe,OAAO,OAAO,IAAI,IAAI,QAAQ,YAAY,CAAC;EAChE,SAAS,OAAO,OAAO;GACtB,OAAO,OAAO,OAAO;IACpB,cAAc;IACd;IACA;IACA;GACD,CAAC;EACF;EACA,SAAS,KAAK,MAAM;GACnB,MAAM,SAAS,KAAK,KAAK,cAAc;GACvC,IAAI,CAAC,kBAAkB,MAAM,GAAG;GAChC,IAAI,OAAO,cAAc,WAAW;GACpC,OAAO,OAAO;EACf;EACA,OAAO,OAAO,OAAO,OAAO,OAAO,QAAQ;GAC1C;GACA;GACA;EACD,CAAC,CAAC;CACH;AACD;;;;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qBAAqB,WAAW,SAAS,8CAA8C,gBAAgB,IAAI;EACjR,YAAY,WAAW;EACvB,oBAAoB,WAAW;EAC/B;CACD,CAAC;AACF;AAGA,IAAI,kBAAkB,MAAM;CAC3B;CACA;CACA,+BAA+B,IAAI,IAAI;CACvC,YAAY,MAAM,cAAc;EAC/B,KAAKA,QAAQ;EACb,KAAKC,gBAAgB;CACtB;CACA,IAAI,cAAc;EACjB,OAAO,KAAKC;CACb;CACA,SAAS,YAAY;EACpB,MAAM,QAAQ;EACd,4BAA4B,CAAC,KAAK,GAAG,KAAKF,OAAO,KAAKC,aAAa;EACnE,KAAKC,aAAa,IAAI,MAAM,WAAW,KAAK;EAC5C,OAAO;CACR;AACD;;;;;;;;;;AAUA,SAAS,kBAAkB,MAAM,cAAc;CAC9C,OAAO,IAAI,gBAAgB,MAAM,YAAY;AAC9C"}
@@ -0,0 +1,40 @@
1
+ //#region ../../../1-framework/1-core/framework-components/dist/runtime-error-BA9d7XjZ.mjs
2
+ /**
3
+ * Type guard for the runtime-error envelope produced by `runtimeError`.
4
+ *
5
+ * Prefer this over duck-typing on `error.code` directly so consumers stay
6
+ * insulated from the envelope's internal shape.
7
+ */
8
+ function isRuntimeError(error) {
9
+ return error instanceof Error && "code" in error && typeof error.code === "string" && "category" in error && "severity" in error;
10
+ }
11
+ function runtimeError(code, message, details) {
12
+ const error = Object.assign(new Error(message), {
13
+ code,
14
+ category: resolveCategory(code),
15
+ severity: "error",
16
+ ...details !== void 0 ? { details } : {}
17
+ });
18
+ Object.defineProperty(error, "name", {
19
+ value: "RuntimeError",
20
+ configurable: true
21
+ });
22
+ return error;
23
+ }
24
+ function resolveCategory(code) {
25
+ const prefix = code.split(".")[0] ?? "RUNTIME";
26
+ switch (prefix) {
27
+ case "PLAN":
28
+ case "CONTRACT":
29
+ case "LINT":
30
+ case "BUDGET":
31
+ case "DRIVER":
32
+ case "MIGRATION":
33
+ case "ORM": return prefix;
34
+ default: return "RUNTIME";
35
+ }
36
+ }
37
+ //#endregion
38
+ export { runtimeError as n, isRuntimeError as t };
39
+
40
+ //# sourceMappingURL=runtime-error-BA9d7XjZ-BlT8t6LB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-error-BA9d7XjZ-BlT8t6LB.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime-error-BA9d7XjZ.mjs"],"sourcesContent":["//#region src/shared/runtime-error.ts\n/**\n* Type guard for the runtime-error envelope produced by `runtimeError`.\n*\n* Prefer this over duck-typing on `error.code` directly so consumers stay\n* insulated from the envelope's internal shape.\n*/\nfunction isRuntimeError(error) {\n\treturn error instanceof Error && \"code\" in error && typeof error.code === \"string\" && \"category\" in error && \"severity\" in error;\n}\nfunction runtimeError(code, message, details) {\n\tconst error = Object.assign(new Error(message), {\n\t\tcode,\n\t\tcategory: resolveCategory(code),\n\t\tseverity: \"error\",\n\t\t...details !== void 0 ? { details } : {}\n\t});\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"RuntimeError\",\n\t\tconfigurable: true\n\t});\n\treturn error;\n}\nfunction resolveCategory(code) {\n\tconst prefix = code.split(\".\")[0] ?? \"RUNTIME\";\n\tswitch (prefix) {\n\t\tcase \"PLAN\":\n\t\tcase \"CONTRACT\":\n\t\tcase \"LINT\":\n\t\tcase \"BUDGET\":\n\t\tcase \"DRIVER\":\n\t\tcase \"MIGRATION\":\n\t\tcase \"ORM\": return prefix;\n\t\tdefault: return \"RUNTIME\";\n\t}\n}\n//#endregion\nexport { runtimeError as n, isRuntimeError as t };\n\n//# sourceMappingURL=runtime-error-BA9d7XjZ.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,eAAe,OAAO;CAC9B,OAAO,iBAAiB,SAAS,UAAU,SAAS,OAAO,MAAM,SAAS,YAAY,cAAc,SAAS,cAAc;AAC5H;AACA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,MAAM,QAAQ,OAAO,OAAO,IAAI,MAAM,OAAO,GAAG;EAC/C;EACA,UAAU,gBAAgB,IAAI;EAC9B,UAAU;EACV,GAAG,YAAY,KAAK,IAAI,EAAE,QAAQ,IAAI,CAAC;CACxC,CAAC;CACD,OAAO,eAAe,OAAO,QAAQ;EACpC,OAAO;EACP,cAAc;CACf,CAAC;CACD,OAAO;AACR;AACA,SAAS,gBAAgB,MAAM;CAC9B,MAAM,SAAS,KAAK,MAAM,GAAG,CAAC,CAAC,MAAM;CACrC,QAAQ,QAAR;EACC,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,OAAO,OAAO;EACnB,SAAS,OAAO;CACjB;AACD"}
@@ -0,0 +1,6 @@
1
+ //#region ../../../1-framework/0-foundation/utils/dist/simplify-deep.d.mts
2
+ //#region src/simplify-deep.d.ts
3
+ type SimplifyDeep<T> = T extends readonly (infer Element)[] ? T extends unknown[] ? SimplifyDeep<Element>[] : readonly SimplifyDeep<Element>[] : T extends string | number | boolean | bigint | symbol | Date | RegExp | Uint8Array | ((...args: never[]) => unknown) ? T : T extends object ? { [K in keyof T]: SimplifyDeep<T[K]>; } : T;
4
+ //#endregion
5
+ export { SimplifyDeep as t };
6
+ //# sourceMappingURL=simplify-deep-Dw9I_ZUl.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simplify-deep-Dw9I_ZUl.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/utils/dist/simplify-deep.d.mts"],"mappings":";;KACK,aAAa,KAAK,0BAA0B,aAAa,sBAAsB,aAAa,sBAAsB,aAAa,aAAa,wDAAwD,OAAO,SAAS,kBAAkB,6BAA6B,IAAI,sBAAsB,WAAW,IAAI,aAAa,EAAE,SAAS"}