@sixb/core 0.2.2 → 0.2.3

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 (1119) hide show
  1. package/dist/actions/index.js +55 -49
  2. package/dist/actions/index.js.map +1 -1
  3. package/dist/actions/request.d.ts.map +1 -1
  4. package/dist/actions/run/executor.d.ts +0 -2
  5. package/dist/actions/run/executor.d.ts.map +1 -1
  6. package/dist/actions/types/context.d.ts +5 -1
  7. package/dist/actions/types/context.d.ts.map +1 -1
  8. package/dist/agents/execution.d.ts +2 -1
  9. package/dist/agents/execution.d.ts.map +1 -1
  10. package/dist/agents/fork.d.ts.map +1 -1
  11. package/dist/agents/index.d.ts +1 -1
  12. package/dist/agents/index.d.ts.map +1 -1
  13. package/dist/agents/index.js +82 -75
  14. package/dist/agents/index.js.map +1 -1
  15. package/dist/agents/request.d.ts +7 -1
  16. package/dist/agents/request.d.ts.map +1 -1
  17. package/dist/agents/run-artifacts.d.ts +73 -10
  18. package/dist/agents/run-artifacts.d.ts.map +1 -1
  19. package/dist/agents/run-session-http.d.ts.map +1 -1
  20. package/dist/agents/run-session-serve.d.ts.map +1 -1
  21. package/dist/agents/run-session.d.ts +3 -0
  22. package/dist/agents/run-session.d.ts.map +1 -1
  23. package/dist/agents/streams/index.js +2 -2
  24. package/dist/agents/streams/internal.js +2 -2
  25. package/dist/agents/streams/protocol.d.ts.map +1 -1
  26. package/dist/agents/validation.d.ts +1 -1
  27. package/dist/agents/validation.d.ts.map +1 -1
  28. package/dist/artifacts/access.d.ts +37 -17
  29. package/dist/artifacts/access.d.ts.map +1 -1
  30. package/dist/artifacts/canvas-display.d.ts +65 -0
  31. package/dist/artifacts/canvas-display.d.ts.map +1 -0
  32. package/dist/artifacts/canvas.d.ts +6 -1
  33. package/dist/artifacts/canvas.d.ts.map +1 -1
  34. package/dist/artifacts/comment-text.d.ts +19 -0
  35. package/dist/artifacts/comment-text.d.ts.map +1 -0
  36. package/dist/artifacts/comments.d.ts +52 -0
  37. package/dist/artifacts/comments.d.ts.map +1 -0
  38. package/dist/artifacts/errors.d.ts +3 -3
  39. package/dist/artifacts/errors.d.ts.map +1 -1
  40. package/dist/artifacts/events.d.ts +14 -0
  41. package/dist/artifacts/events.d.ts.map +1 -0
  42. package/dist/artifacts/execution.d.ts +129 -22
  43. package/dist/artifacts/execution.d.ts.map +1 -1
  44. package/dist/artifacts/frames/assets.d.ts +12 -1
  45. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  46. package/dist/artifacts/frames/grants.d.ts +8 -5
  47. package/dist/artifacts/frames/grants.d.ts.map +1 -1
  48. package/dist/artifacts/frames/index.d.ts +1 -1
  49. package/dist/artifacts/frames/index.d.ts.map +1 -1
  50. package/dist/artifacts/frames/index.js +32 -964
  51. package/dist/artifacts/frames/index.js.map +4 -8
  52. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  53. package/dist/artifacts/frames/protocol.d.ts +78 -0
  54. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  55. package/dist/artifacts/frames/runtime.d.ts +17 -7
  56. package/dist/artifacts/frames/runtime.d.ts.map +1 -1
  57. package/dist/artifacts/holders.d.ts +23 -0
  58. package/dist/artifacts/holders.d.ts.map +1 -0
  59. package/dist/artifacts/ids.d.ts +2 -0
  60. package/dist/artifacts/ids.d.ts.map +1 -1
  61. package/dist/artifacts/index.d.ts +6 -4
  62. package/dist/artifacts/index.d.ts.map +1 -1
  63. package/dist/artifacts/index.js +108 -13
  64. package/dist/artifacts/index.js.map +5 -4
  65. package/dist/artifacts/limits.d.ts +24 -3
  66. package/dist/artifacts/limits.d.ts.map +1 -1
  67. package/dist/artifacts/live/board.d.ts +103 -0
  68. package/dist/artifacts/live/board.d.ts.map +1 -0
  69. package/dist/artifacts/live/diff.d.ts +43 -0
  70. package/dist/artifacts/live/diff.d.ts.map +1 -0
  71. package/dist/artifacts/live/document.d.ts +55 -0
  72. package/dist/artifacts/live/document.d.ts.map +1 -0
  73. package/dist/artifacts/live/files.d.ts +16 -0
  74. package/dist/artifacts/live/files.d.ts.map +1 -0
  75. package/dist/artifacts/live/index.d.ts +9 -0
  76. package/dist/artifacts/live/index.d.ts.map +1 -0
  77. package/dist/artifacts/live/index.js +593 -0
  78. package/dist/artifacts/live/index.js.map +10 -0
  79. package/dist/artifacts/live/presence.d.ts +55 -0
  80. package/dist/artifacts/live/presence.d.ts.map +1 -0
  81. package/dist/artifacts/live/protocol.d.ts +109 -0
  82. package/dist/artifacts/live/protocol.d.ts.map +1 -0
  83. package/dist/artifacts/live/protocol.js +21 -0
  84. package/dist/artifacts/live/protocol.js.map +9 -0
  85. package/dist/artifacts/live/server.d.ts +10 -0
  86. package/dist/artifacts/live/server.d.ts.map +1 -0
  87. package/dist/artifacts/live/server.js +86 -0
  88. package/dist/artifacts/live/server.js.map +9 -0
  89. package/dist/artifacts/live/state.d.ts +26 -0
  90. package/dist/artifacts/live/state.d.ts.map +1 -0
  91. package/dist/artifacts/outline.d.ts +11 -0
  92. package/dist/artifacts/outline.d.ts.map +1 -1
  93. package/dist/artifacts/publish/index.d.ts +8 -1
  94. package/dist/artifacts/publish/index.d.ts.map +1 -1
  95. package/dist/artifacts/publish/index.js +61 -33
  96. package/dist/artifacts/publish/index.js.map +1 -1
  97. package/dist/artifacts/publish/merge.d.ts +75 -0
  98. package/dist/artifacts/publish/merge.d.ts.map +1 -0
  99. package/dist/artifacts/publish/previews.d.ts +153 -0
  100. package/dist/artifacts/publish/previews.d.ts.map +1 -0
  101. package/dist/artifacts/publish/publish.d.ts +29 -8
  102. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  103. package/dist/artifacts/publish/query-answers.d.ts +20 -0
  104. package/dist/artifacts/publish/query-answers.d.ts.map +1 -0
  105. package/dist/artifacts/publish/references.d.ts +4 -3
  106. package/dist/artifacts/publish/references.d.ts.map +1 -1
  107. package/dist/artifacts/publish/validate/canvas.d.ts.map +1 -1
  108. package/dist/artifacts/theme.d.ts +5 -1
  109. package/dist/artifacts/theme.d.ts.map +1 -1
  110. package/dist/auth/directory.d.ts +33 -0
  111. package/dist/auth/directory.d.ts.map +1 -0
  112. package/dist/auth/index.js +13 -12
  113. package/dist/auth/index.js.map +1 -1
  114. package/dist/auth/member-events.d.ts +5 -1
  115. package/dist/auth/member-events.d.ts.map +1 -1
  116. package/dist/auth/runtime.d.ts +22 -1
  117. package/dist/auth/runtime.d.ts.map +1 -1
  118. package/dist/auth/strategy.d.ts +2 -2
  119. package/dist/auth/strategy.d.ts.map +1 -1
  120. package/dist/auth/types.d.ts +42 -1
  121. package/dist/auth/types.d.ts.map +1 -1
  122. package/dist/authorization/decision.d.ts +6 -5
  123. package/dist/authorization/decision.d.ts.map +1 -1
  124. package/dist/authorization/event-visibility.d.ts.map +1 -1
  125. package/dist/authorization/index.js +7 -6
  126. package/dist/authorization/index.js.map +1 -1
  127. package/dist/blob-storage/index.js +4 -4
  128. package/dist/blob-storage/index.js.map +1 -1
  129. package/dist/bootstrap/index.js +62 -56
  130. package/dist/bootstrap/index.js.map +2 -2
  131. package/dist/broker/in-memory.d.ts.map +1 -1
  132. package/dist/broker/index.js +1 -1
  133. package/dist/broker/types.d.ts +4 -0
  134. package/dist/broker/types.d.ts.map +1 -1
  135. package/dist/{chunk-s7j8ewqv.js → chunk-0k3r5kb3.js} +257 -43
  136. package/dist/{chunk-s7j8ewqv.js.map → chunk-0k3r5kb3.js.map} +14 -13
  137. package/dist/{chunk-e5wf5vz0.js → chunk-0kgrghqx.js} +13 -1
  138. package/dist/chunk-0kgrghqx.js.map +10 -0
  139. package/dist/{chunk-80gym75n.js → chunk-186k5yz3.js} +1 -1
  140. package/dist/chunk-191jz8a6.js +61 -0
  141. package/dist/chunk-191jz8a6.js.map +10 -0
  142. package/dist/{chunk-mmagke4x.js → chunk-22d3qg4x.js} +2 -2
  143. package/dist/{chunk-mmagke4x.js.map → chunk-22d3qg4x.js.map} +3 -3
  144. package/dist/{chunk-m2vh8gh0.js → chunk-26qet7wh.js} +62 -15
  145. package/dist/{chunk-m2vh8gh0.js.map → chunk-26qet7wh.js.map} +5 -5
  146. package/dist/{chunk-eqgr6nsa.js → chunk-2by73sm2.js} +982 -184
  147. package/dist/chunk-2by73sm2.js.map +75 -0
  148. package/dist/chunk-2c4j899j.js.map +2 -2
  149. package/dist/{chunk-e6xgz4h4.js → chunk-3014rfjz.js} +197 -18
  150. package/dist/chunk-3014rfjz.js.map +21 -0
  151. package/dist/chunk-38yvdqzd.js +70 -0
  152. package/dist/chunk-38yvdqzd.js.map +10 -0
  153. package/dist/{chunk-ytzcxtpt.js → chunk-3ba89vm7.js} +1 -1
  154. package/dist/chunk-3hzhcfsv.js +139 -0
  155. package/dist/chunk-3hzhcfsv.js.map +10 -0
  156. package/dist/chunk-3sgvd10b.js +69 -0
  157. package/dist/chunk-3sgvd10b.js.map +10 -0
  158. package/dist/{chunk-djs3hw9p.js → chunk-3zagkr6w.js} +73 -6
  159. package/dist/chunk-3zagkr6w.js.map +21 -0
  160. package/dist/{chunk-wkq3kvzd.js → chunk-48c1z8nj.js} +6 -6
  161. package/dist/chunk-48c1z8nj.js.map +10 -0
  162. package/dist/{chunk-3sqqhpr7.js → chunk-4j0sagwv.js} +134 -19
  163. package/dist/{chunk-3sqqhpr7.js.map → chunk-4j0sagwv.js.map} +11 -10
  164. package/dist/{chunk-d04g36fw.js → chunk-5qqmndhm.js} +1 -1
  165. package/dist/{chunk-scyq22td.js → chunk-5rqqp8cr.js} +19 -4
  166. package/dist/chunk-5rqqp8cr.js.map +12 -0
  167. package/dist/{chunk-f1h34y3r.js → chunk-6gtxshcc.js} +6 -6
  168. package/dist/{chunk-f1h34y3r.js.map → chunk-6gtxshcc.js.map} +1 -1
  169. package/dist/{chunk-jspskey0.js → chunk-7j4yydm2.js} +67 -45
  170. package/dist/chunk-7j4yydm2.js.map +11 -0
  171. package/dist/{chunk-5wtnmpze.js → chunk-7qe46788.js} +1 -1
  172. package/dist/{chunk-31kcqmhf.js → chunk-855w9nvw.js} +1 -1
  173. package/dist/{chunk-e7v3trpz.js → chunk-8a8k38tz.js} +4 -3
  174. package/dist/chunk-8a8k38tz.js.map +10 -0
  175. package/dist/{chunk-2ajw5rz0.js → chunk-8p7bze4c.js} +3 -3
  176. package/dist/{chunk-jftd33rc.js → chunk-8t2ynwg0.js} +105 -9
  177. package/dist/chunk-8t2ynwg0.js.map +11 -0
  178. package/dist/{chunk-9whfmsfk.js → chunk-8tqnsx3q.js} +1 -1
  179. package/dist/{chunk-s3we74h8.js → chunk-9nsjjd44.js} +38 -5
  180. package/dist/chunk-9nsjjd44.js.map +12 -0
  181. package/dist/{chunk-hz5d43gn.js → chunk-9vsc919v.js} +14 -6
  182. package/dist/chunk-9vsc919v.js.map +10 -0
  183. package/dist/{chunk-waqk73p1.js → chunk-a6fjkcne.js} +185 -341
  184. package/dist/{chunk-waqk73p1.js.map → chunk-a6fjkcne.js.map} +6 -7
  185. package/dist/{chunk-s038wa5v.js → chunk-b9qfh2ya.js} +1 -1
  186. package/dist/{chunk-5taem5aw.js → chunk-bc3y6gff.js} +13 -4
  187. package/dist/chunk-bc3y6gff.js.map +10 -0
  188. package/dist/{chunk-w1btn96n.js → chunk-bkmnd7zq.js} +523 -254
  189. package/dist/chunk-bkmnd7zq.js.map +49 -0
  190. package/dist/chunk-bz5bnjjt.js +358 -0
  191. package/dist/chunk-bz5bnjjt.js.map +12 -0
  192. package/dist/{chunk-w976a4me.js → chunk-czct88ht.js} +28 -4
  193. package/dist/chunk-czct88ht.js.map +10 -0
  194. package/dist/{chunk-5kyvrtjh.js → chunk-d9xbwh3h.js} +131 -32
  195. package/dist/chunk-d9xbwh3h.js.map +13 -0
  196. package/dist/{chunk-kfee1h52.js → chunk-dfveegqq.js} +28 -8
  197. package/dist/chunk-dfveegqq.js.map +13 -0
  198. package/dist/{chunk-2g0r46hy.js → chunk-dhkc9b23.js} +15 -2
  199. package/dist/chunk-dhkc9b23.js.map +12 -0
  200. package/dist/chunk-dmnd9ea6.js +106 -0
  201. package/dist/chunk-dmnd9ea6.js.map +10 -0
  202. package/dist/{chunk-nz7815t3.js → chunk-e0hnbb1m.js} +27 -2
  203. package/dist/chunk-e0hnbb1m.js.map +14 -0
  204. package/dist/chunk-e91fmg6t.js +288 -0
  205. package/dist/chunk-e91fmg6t.js.map +11 -0
  206. package/dist/{chunk-a5v4gjdx.js → chunk-e9w4mgdh.js} +308 -220
  207. package/dist/{chunk-a5v4gjdx.js.map → chunk-e9w4mgdh.js.map} +21 -19
  208. package/dist/{chunk-w122ymx4.js → chunk-f6ahf5gf.js} +15 -4
  209. package/dist/{chunk-w122ymx4.js.map → chunk-f6ahf5gf.js.map} +3 -3
  210. package/dist/{chunk-jjmggm9a.js → chunk-fe6r7yhg.js} +1 -1
  211. package/dist/{chunk-165c9wm6.js → chunk-g2ph4873.js} +1 -1
  212. package/dist/chunk-hgj98cbb.js +22 -0
  213. package/dist/chunk-hgj98cbb.js.map +10 -0
  214. package/dist/{chunk-mbc5hvnj.js → chunk-hkaa807g.js} +18 -7
  215. package/dist/{chunk-mbc5hvnj.js.map → chunk-hkaa807g.js.map} +3 -3
  216. package/dist/chunk-hn2r7z41.js.map +3 -3
  217. package/dist/chunk-j0wgh8gv.js +250 -0
  218. package/dist/chunk-j0wgh8gv.js.map +10 -0
  219. package/dist/{chunk-z8fx5cgb.js → chunk-j2zm215x.js} +37 -3
  220. package/dist/chunk-j2zm215x.js.map +12 -0
  221. package/dist/{chunk-j1ny5fwh.js → chunk-k1g14kk3.js} +11 -83
  222. package/dist/{chunk-j1ny5fwh.js.map → chunk-k1g14kk3.js.map} +4 -5
  223. package/dist/{chunk-ga63a3dz.js → chunk-k66rp2hr.js} +3 -3
  224. package/dist/chunk-kr6dx38r.js +25 -0
  225. package/dist/chunk-kr6dx38r.js.map +10 -0
  226. package/dist/{chunk-a7aa0nzj.js → chunk-kv0kvknv.js} +14 -14
  227. package/dist/{chunk-a7aa0nzj.js.map → chunk-kv0kvknv.js.map} +1 -1
  228. package/dist/chunk-m2jerfef.js +474 -0
  229. package/dist/chunk-m2jerfef.js.map +11 -0
  230. package/dist/chunk-m7b9q5dk.js +234 -0
  231. package/dist/chunk-m7b9q5dk.js.map +12 -0
  232. package/dist/{chunk-escedwyt.js → chunk-mvz89age.js} +6 -1
  233. package/dist/{chunk-escedwyt.js.map → chunk-mvz89age.js.map} +3 -3
  234. package/dist/chunk-mwcqz3e3.js +30 -0
  235. package/dist/chunk-mwcqz3e3.js.map +10 -0
  236. package/dist/chunk-n2ay51px.js +21 -0
  237. package/dist/chunk-n2ay51px.js.map +10 -0
  238. package/dist/{chunk-gkv8r794.js → chunk-n68vz95m.js} +5 -5
  239. package/dist/{chunk-gkv8r794.js.map → chunk-n68vz95m.js.map} +3 -3
  240. package/dist/{chunk-0j3crh1w.js → chunk-p351afzm.js} +14 -14
  241. package/dist/{chunk-0j3crh1w.js.map → chunk-p351afzm.js.map} +4 -4
  242. package/dist/chunk-pk539cwv.js +370 -0
  243. package/dist/chunk-pk539cwv.js.map +11 -0
  244. package/dist/{chunk-jbw70d6t.js → chunk-ppxf7gw2.js} +52 -10
  245. package/dist/chunk-ppxf7gw2.js.map +11 -0
  246. package/dist/{chunk-9x8dybsb.js → chunk-pvpq483h.js} +10 -2
  247. package/dist/chunk-pvpq483h.js.map +10 -0
  248. package/dist/chunk-qafng88v.js +225 -0
  249. package/dist/chunk-qafng88v.js.map +11 -0
  250. package/dist/chunk-qds484t8.js +1363 -0
  251. package/dist/chunk-qds484t8.js.map +18 -0
  252. package/dist/{chunk-4zm1k3xj.js → chunk-r2psmn42.js} +1 -1
  253. package/dist/{chunk-kkjfve0t.js → chunk-rt9deb92.js} +4 -3
  254. package/dist/{chunk-kkjfve0t.js.map → chunk-rt9deb92.js.map} +3 -3
  255. package/dist/{chunk-r1cxq7vv.js → chunk-rtdrm592.js} +2 -2
  256. package/dist/{chunk-c7cfe31p.js → chunk-s5n9617r.js} +15 -15
  257. package/dist/{chunk-c7cfe31p.js.map → chunk-s5n9617r.js.map} +1 -1
  258. package/dist/{chunk-4bm0caep.js → chunk-smnt672s.js} +1 -1
  259. package/dist/{chunk-21q0j5f2.js → chunk-stmxh0hv.js} +2 -2
  260. package/dist/{chunk-nh26e7c5.js → chunk-sysnvjce.js} +5 -5
  261. package/dist/{chunk-nh26e7c5.js.map → chunk-sysnvjce.js.map} +3 -3
  262. package/dist/{chunk-57g0215c.js → chunk-t24yktqr.js} +296 -7
  263. package/dist/{chunk-57g0215c.js.map → chunk-t24yktqr.js.map} +6 -3
  264. package/dist/{chunk-ff5xkv0p.js → chunk-tfzvjdms.js} +1 -1
  265. package/dist/chunk-tqa68kj7.js +1322 -0
  266. package/dist/chunk-tqa68kj7.js.map +25 -0
  267. package/dist/chunk-vtjzwymr.js +37 -0
  268. package/dist/chunk-vtjzwymr.js.map +10 -0
  269. package/dist/{chunk-twfreyxr.js → chunk-vzkxqf8h.js} +23 -13
  270. package/dist/{chunk-twfreyxr.js.map → chunk-vzkxqf8h.js.map} +6 -6
  271. package/dist/{chunk-6b61s40c.js → chunk-w3t94hm6.js} +1 -1
  272. package/dist/{chunk-j8thxj7w.js → chunk-w9s23r24.js} +1218 -101
  273. package/dist/chunk-w9s23r24.js.map +30 -0
  274. package/dist/{chunk-fwsvshr5.js → chunk-wa05txmk.js} +20 -7
  275. package/dist/{chunk-fwsvshr5.js.map → chunk-wa05txmk.js.map} +3 -3
  276. package/dist/chunk-whbwf3np.js +12 -0
  277. package/dist/chunk-whbwf3np.js.map +10 -0
  278. package/dist/{chunk-t5608tkq.js → chunk-yv8hv4wq.js} +3 -1
  279. package/dist/{chunk-t5608tkq.js.map → chunk-yv8hv4wq.js.map} +3 -3
  280. package/dist/{chunk-dsv783c3.js → chunk-z0t4p2sk.js} +169 -53
  281. package/dist/{chunk-dsv783c3.js.map → chunk-z0t4p2sk.js.map} +7 -7
  282. package/dist/connectors/builders.d.ts +2 -2
  283. package/dist/connectors/builders.d.ts.map +1 -1
  284. package/dist/connectors/connections/access.d.ts +11 -0
  285. package/dist/connectors/connections/access.d.ts.map +1 -0
  286. package/dist/connectors/connections/contracts.d.ts +6 -1
  287. package/dist/connectors/connections/contracts.d.ts.map +1 -1
  288. package/dist/connectors/connections/internal.js +1 -1
  289. package/dist/connectors/connections/runs.d.ts +6 -0
  290. package/dist/connectors/connections/runs.d.ts.map +1 -1
  291. package/dist/connectors/connections/service.d.ts +25 -0
  292. package/dist/connectors/connections/service.d.ts.map +1 -1
  293. package/dist/connectors/connections/views.d.ts +1 -1
  294. package/dist/connectors/connections/views.d.ts.map +1 -1
  295. package/dist/connectors/execution.d.ts.map +1 -1
  296. package/dist/connectors/index.d.ts +1 -1
  297. package/dist/connectors/index.d.ts.map +1 -1
  298. package/dist/connectors/service.d.ts +3 -0
  299. package/dist/connectors/service.d.ts.map +1 -1
  300. package/dist/connectors/types.d.ts +21 -2
  301. package/dist/connectors/types.d.ts.map +1 -1
  302. package/dist/datasets/execution.d.ts +12 -6
  303. package/dist/datasets/execution.d.ts.map +1 -1
  304. package/dist/datasets/ingest-flush-batch.d.ts +59 -0
  305. package/dist/datasets/ingest-flush-batch.d.ts.map +1 -0
  306. package/dist/datasets/ingest-flush-job.d.ts +33 -0
  307. package/dist/datasets/ingest-flush-job.d.ts.map +1 -0
  308. package/dist/datasets/ingest-flush.d.ts +66 -0
  309. package/dist/datasets/ingest-flush.d.ts.map +1 -0
  310. package/dist/datasets/produced-version.d.ts +21 -0
  311. package/dist/datasets/produced-version.d.ts.map +1 -0
  312. package/dist/datasets/write.d.ts +22 -1
  313. package/dist/datasets/write.d.ts.map +1 -1
  314. package/dist/datasets/write.js +8 -4
  315. package/dist/datasets/write.js.map +1 -1
  316. package/dist/deploy/internal.js +5 -4
  317. package/dist/deploy/internal.js.map +4 -4
  318. package/dist/deploy/types.d.ts +2 -3
  319. package/dist/deploy/types.d.ts.map +1 -1
  320. package/dist/error-reporting/capability.d.ts +8 -2
  321. package/dist/error-reporting/capability.d.ts.map +1 -1
  322. package/dist/error-reporting/internal.d.ts +1 -1
  323. package/dist/error-reporting/internal.d.ts.map +1 -1
  324. package/dist/error-reporting/internal.js +17 -5
  325. package/dist/error-reporting/internal.js.map +1 -1
  326. package/dist/error-reporting/reporter.d.ts.map +1 -1
  327. package/dist/error-reporting/reports.d.ts +55 -0
  328. package/dist/error-reporting/reports.d.ts.map +1 -1
  329. package/dist/error-reporting/types.d.ts +82 -1
  330. package/dist/error-reporting/types.d.ts.map +1 -1
  331. package/dist/errors/catalog.d.ts +5 -0
  332. package/dist/errors/catalog.d.ts.map +1 -1
  333. package/dist/errors/internal.js +1 -1
  334. package/dist/events/definitions.d.ts +4 -0
  335. package/dist/events/definitions.d.ts.map +1 -1
  336. package/dist/events/execution.d.ts +1 -0
  337. package/dist/events/execution.d.ts.map +1 -1
  338. package/dist/events/index.d.ts +1 -1
  339. package/dist/events/index.d.ts.map +1 -1
  340. package/dist/events/index.js +5 -5
  341. package/dist/events/scope.d.ts.map +1 -1
  342. package/dist/events/scope.js +1 -1
  343. package/dist/events/selectors/index.js +2 -2
  344. package/dist/events/types/artifacts.d.ts +38 -0
  345. package/dist/events/types/artifacts.d.ts.map +1 -0
  346. package/dist/events/types/index.d.ts +3 -1
  347. package/dist/events/types/index.d.ts.map +1 -1
  348. package/dist/events/types/users.d.ts +5 -2
  349. package/dist/events/types/users.d.ts.map +1 -1
  350. package/dist/execution/agent.js +57 -51
  351. package/dist/execution/agent.js.map +1 -1
  352. package/dist/execution/authorized-object-reader.d.ts +10 -0
  353. package/dist/execution/authorized-object-reader.d.ts.map +1 -1
  354. package/dist/execution/object-reader-clearance.d.ts +6 -0
  355. package/dist/execution/object-reader-clearance.d.ts.map +1 -1
  356. package/dist/execution/object-reader-security.d.ts +9 -2
  357. package/dist/execution/object-reader-security.d.ts.map +1 -1
  358. package/dist/execution/primitive.js +55 -49
  359. package/dist/execution/primitive.js.map +1 -1
  360. package/dist/execution/request.js +49 -43
  361. package/dist/execution/request.js.map +2 -2
  362. package/dist/http/api-routes.d.ts +1 -1
  363. package/dist/http/api-routes.d.ts.map +1 -1
  364. package/dist/http/index.js +1 -1
  365. package/dist/index.d.ts +10 -8
  366. package/dist/index.d.ts.map +1 -1
  367. package/dist/index.js +95 -87
  368. package/dist/index.js.map +1 -1
  369. package/dist/lake-storage/errors.d.ts +15 -0
  370. package/dist/lake-storage/errors.d.ts.map +1 -1
  371. package/dist/lake-storage/index.d.ts +3 -2
  372. package/dist/lake-storage/index.d.ts.map +1 -1
  373. package/dist/lake-storage/index.js +16 -10
  374. package/dist/lake-storage/index.js.map +1 -1
  375. package/dist/lake-storage/maintenance.d.ts +88 -0
  376. package/dist/lake-storage/maintenance.d.ts.map +1 -0
  377. package/dist/lake-storage/merge.d.ts +3 -1
  378. package/dist/lake-storage/merge.d.ts.map +1 -1
  379. package/dist/lake-storage/source-ordering.d.ts +23 -0
  380. package/dist/lake-storage/source-ordering.d.ts.map +1 -1
  381. package/dist/lake-storage/types.d.ts +10 -0
  382. package/dist/lake-storage/types.d.ts.map +1 -1
  383. package/dist/maintenance/heartbeat.d.ts +5 -0
  384. package/dist/maintenance/heartbeat.d.ts.map +1 -0
  385. package/dist/maintenance/index.d.ts +4 -2
  386. package/dist/maintenance/index.d.ts.map +1 -1
  387. package/dist/maintenance/index.js +515 -0
  388. package/dist/maintenance/index.js.map +16 -0
  389. package/dist/maintenance/lake-retention-status.d.ts +36 -0
  390. package/dist/maintenance/lake-retention-status.d.ts.map +1 -0
  391. package/dist/maintenance/lake-retention.d.ts +84 -0
  392. package/dist/maintenance/lake-retention.d.ts.map +1 -0
  393. package/dist/maintenance/loop.d.ts +95 -0
  394. package/dist/maintenance/loop.d.ts.map +1 -0
  395. package/dist/maintenance/ontology-maintenance.d.ts +17 -16
  396. package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
  397. package/dist/maintenance/passes/cron-pass.d.ts +21 -0
  398. package/dist/maintenance/passes/cron-pass.d.ts.map +1 -0
  399. package/dist/maintenance/passes/directory-pass.d.ts +12 -0
  400. package/dist/maintenance/passes/directory-pass.d.ts.map +1 -0
  401. package/dist/maintenance/passes/ingest-pass.d.ts +26 -0
  402. package/dist/maintenance/passes/ingest-pass.d.ts.map +1 -0
  403. package/dist/maintenance/passes/lake-change-feed.d.ts +38 -0
  404. package/dist/maintenance/passes/lake-change-feed.d.ts.map +1 -0
  405. package/dist/maintenance/passes/lake-retention-pass.d.ts +20 -0
  406. package/dist/maintenance/passes/lake-retention-pass.d.ts.map +1 -0
  407. package/dist/maintenance/passes/ontology-pass.d.ts +8 -0
  408. package/dist/maintenance/passes/ontology-pass.d.ts.map +1 -0
  409. package/dist/maintenance/passes/projections-pass.d.ts +26 -0
  410. package/dist/maintenance/passes/projections-pass.d.ts.map +1 -0
  411. package/dist/maintenance/passes/recovery-pass.d.ts +6 -0
  412. package/dist/maintenance/passes/recovery-pass.d.ts.map +1 -0
  413. package/dist/maintenance/passes/recovery-passes.d.ts +24 -0
  414. package/dist/maintenance/passes/recovery-passes.d.ts.map +1 -0
  415. package/dist/maintenance/passes/runs-pass.d.ts +6 -0
  416. package/dist/maintenance/passes/runs-pass.d.ts.map +1 -0
  417. package/dist/maintenance/passes/triggers-pass.d.ts +41 -0
  418. package/dist/maintenance/passes/triggers-pass.d.ts.map +1 -0
  419. package/dist/maintenance/status.d.ts +19 -0
  420. package/dist/maintenance/status.d.ts.map +1 -0
  421. package/dist/maintenance/types.d.ts +25 -24
  422. package/dist/maintenance/types.d.ts.map +1 -1
  423. package/dist/materialization/model.d.ts +11 -2
  424. package/dist/materialization/model.d.ts.map +1 -1
  425. package/dist/materializer/edits/artifact-refs.d.ts +33 -0
  426. package/dist/materializer/edits/artifact-refs.d.ts.map +1 -0
  427. package/dist/materializer/edits/commit.d.ts.map +1 -1
  428. package/dist/materializer/edits/operations.d.ts +7 -1
  429. package/dist/materializer/edits/operations.d.ts.map +1 -1
  430. package/dist/materializer/edits/plan.d.ts.map +1 -1
  431. package/dist/materializer/execution/work-records.d.ts +6 -0
  432. package/dist/materializer/execution/work-records.d.ts.map +1 -1
  433. package/dist/materializer/index.js +30 -27
  434. package/dist/materializer/index.js.map +1 -1
  435. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  436. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  437. package/dist/materializer/telemetry/plan.d.ts.map +1 -1
  438. package/dist/models/execution/index.js +29 -26
  439. package/dist/models/execution/index.js.map +1 -1
  440. package/dist/objects/artifact-refs.d.ts +5 -0
  441. package/dist/objects/artifact-refs.d.ts.map +1 -0
  442. package/dist/objects/index.js +58 -53
  443. package/dist/objects/index.js.map +1 -1
  444. package/dist/objects/materializer-adapter.d.ts +4 -3
  445. package/dist/objects/materializer-adapter.d.ts.map +1 -1
  446. package/dist/objects/object/upsert-batch.d.ts.map +1 -1
  447. package/dist/objects/object/upsert.d.ts.map +1 -1
  448. package/dist/objects/query/index.js +28 -25
  449. package/dist/objects/query/index.js.map +1 -1
  450. package/dist/objects/query/ir.d.ts +3 -1
  451. package/dist/objects/query/ir.d.ts.map +1 -1
  452. package/dist/objects/query/scalar-values.d.ts.map +1 -1
  453. package/dist/objects/runtime-batch.d.ts +2 -0
  454. package/dist/objects/runtime-batch.d.ts.map +1 -1
  455. package/dist/ontology/artifact-ref.d.ts +36 -0
  456. package/dist/ontology/artifact-ref.d.ts.map +1 -0
  457. package/dist/ontology/docs-markdown.d.ts.map +1 -1
  458. package/dist/ontology/index.d.ts +3 -1
  459. package/dist/ontology/index.d.ts.map +1 -1
  460. package/dist/ontology/index.js +8 -5
  461. package/dist/ontology/index.js.map +1 -1
  462. package/dist/ontology/inference/index.d.ts +2 -0
  463. package/dist/ontology/inference/index.d.ts.map +1 -1
  464. package/dist/ontology/internal.js +7 -6
  465. package/dist/ontology/internal.js.map +1 -1
  466. package/dist/ontology/json-schema.d.ts.map +1 -1
  467. package/dist/ontology/primitives.d.ts.map +1 -1
  468. package/dist/ontology/reference-values.d.ts +10 -0
  469. package/dist/ontology/reference-values.d.ts.map +1 -0
  470. package/dist/ontology/refs.d.ts +6 -1
  471. package/dist/ontology/refs.d.ts.map +1 -1
  472. package/dist/ontology/registry.d.ts +9 -1
  473. package/dist/ontology/registry.d.ts.map +1 -1
  474. package/dist/ontology/types.d.ts +2 -1
  475. package/dist/ontology/types.d.ts.map +1 -1
  476. package/dist/ontology/user-ref.d.ts +16 -0
  477. package/dist/ontology/user-ref.d.ts.map +1 -1
  478. package/dist/ontology/validation/normalize.d.ts.map +1 -1
  479. package/dist/ontology/validation/properties.d.ts.map +1 -1
  480. package/dist/ontology/validation/schema.d.ts.map +1 -1
  481. package/dist/pending-tasks.d.ts +17 -0
  482. package/dist/pending-tasks.d.ts.map +1 -0
  483. package/dist/pipelines/index.js +36 -33
  484. package/dist/pipelines/index.js.map +1 -1
  485. package/dist/pipelines/run-dispatch.d.ts +6 -0
  486. package/dist/pipelines/run-dispatch.d.ts.map +1 -1
  487. package/dist/predicates/types.d.ts +4 -0
  488. package/dist/predicates/types.d.ts.map +1 -1
  489. package/dist/projections/builders.d.ts +13 -11
  490. package/dist/projections/builders.d.ts.map +1 -1
  491. package/dist/projections/internal.js +29 -26
  492. package/dist/projections/internal.js.map +1 -1
  493. package/dist/projections/types.d.ts +1 -1
  494. package/dist/projections/types.d.ts.map +1 -1
  495. package/dist/projections/validation.d.ts +2 -2
  496. package/dist/projections/validation.d.ts.map +1 -1
  497. package/dist/queues/in-memory.d.ts +6 -1
  498. package/dist/queues/in-memory.d.ts.map +1 -1
  499. package/dist/queues/index.d.ts +1 -1
  500. package/dist/queues/index.d.ts.map +1 -1
  501. package/dist/queues/index.js +1 -1
  502. package/dist/queues/types.d.ts +55 -2
  503. package/dist/queues/types.d.ts.map +1 -1
  504. package/dist/runtime/create.d.ts +3 -0
  505. package/dist/runtime/create.d.ts.map +1 -1
  506. package/dist/runtime/host.d.ts +22 -5
  507. package/dist/runtime/host.d.ts.map +1 -1
  508. package/dist/runtime/index.d.ts +0 -1
  509. package/dist/runtime/index.d.ts.map +1 -1
  510. package/dist/runtime/internal.d.ts +6 -0
  511. package/dist/runtime/internal.d.ts.map +1 -1
  512. package/dist/runtime/internal.js +51 -30
  513. package/dist/runtime/internal.js.map +1 -1
  514. package/dist/runtime/sixb.d.ts +6 -1
  515. package/dist/runtime/sixb.d.ts.map +1 -1
  516. package/dist/sandboxes/index.js +8 -7
  517. package/dist/sandboxes/index.js.map +1 -1
  518. package/dist/scheduler/index.d.ts +0 -2
  519. package/dist/scheduler/index.d.ts.map +1 -1
  520. package/dist/scheduler/index.js +3 -6
  521. package/dist/scheduler/index.js.map +1 -1
  522. package/dist/schedules/index.js +9 -11
  523. package/dist/schedules/index.js.map +1 -1
  524. package/dist/security/internal.js +1 -1
  525. package/dist/shared/backoff.d.ts +12 -0
  526. package/dist/shared/backoff.d.ts.map +1 -0
  527. package/dist/shared/duration.d.ts +3 -0
  528. package/dist/shared/duration.d.ts.map +1 -0
  529. package/dist/shared/params/artifact-refs.d.ts +19 -0
  530. package/dist/shared/params/artifact-refs.d.ts.map +1 -0
  531. package/dist/shares/guest-name.d.ts +8 -0
  532. package/dist/shares/guest-name.d.ts.map +1 -0
  533. package/dist/shares/internal.d.ts +1 -0
  534. package/dist/shares/internal.d.ts.map +1 -1
  535. package/dist/shares/internal.js +68 -27
  536. package/dist/shares/internal.js.map +3 -3
  537. package/dist/shares/session-protocol.d.ts +13 -0
  538. package/dist/shares/session-protocol.d.ts.map +1 -1
  539. package/dist/storage/action-runs/failure.js +2 -2
  540. package/dist/storage/ai-limits/enforcement.js +2 -2
  541. package/dist/storage/artifacts/errors.d.ts +9 -4
  542. package/dist/storage/artifacts/errors.d.ts.map +1 -1
  543. package/dist/storage/artifacts/in-memory.d.ts +27 -4
  544. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  545. package/dist/storage/artifacts/index.d.ts +1 -1
  546. package/dist/storage/artifacts/index.d.ts.map +1 -1
  547. package/dist/storage/artifacts/record.d.ts +39 -2
  548. package/dist/storage/artifacts/record.d.ts.map +1 -1
  549. package/dist/storage/artifacts/types.d.ts +328 -39
  550. package/dist/storage/artifacts/types.d.ts.map +1 -1
  551. package/dist/storage/auth/in-memory/auth-storage.d.ts +2 -1
  552. package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
  553. package/dist/storage/auth/in-memory/identities.d.ts +4 -0
  554. package/dist/storage/auth/in-memory/identities.d.ts.map +1 -1
  555. package/dist/storage/auth/in-memory/shared.d.ts +3 -1
  556. package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
  557. package/dist/storage/auth/in-memory/users.d.ts.map +1 -1
  558. package/dist/storage/auth/index.d.ts +1 -1
  559. package/dist/storage/auth/index.d.ts.map +1 -1
  560. package/dist/storage/auth/types.d.ts +39 -0
  561. package/dist/storage/auth/types.d.ts.map +1 -1
  562. package/dist/storage/connector-connections/in-memory.d.ts +1 -1
  563. package/dist/storage/connector-connections/in-memory.d.ts.map +1 -1
  564. package/dist/storage/connector-connections/index.d.ts +1 -1
  565. package/dist/storage/connector-connections/index.d.ts.map +1 -1
  566. package/dist/storage/connector-connections/provider/runs.d.ts.map +1 -1
  567. package/dist/storage/connector-connections/provider/shared.d.ts +12 -2
  568. package/dist/storage/connector-connections/provider/shared.d.ts.map +1 -1
  569. package/dist/storage/connector-connections/provider.d.ts +1 -0
  570. package/dist/storage/connector-connections/provider.d.ts.map +1 -1
  571. package/dist/storage/connector-connections/provider.js +21 -5
  572. package/dist/storage/connector-connections/provider.js.map +5 -5
  573. package/dist/storage/connector-connections/types.d.ts +1 -1
  574. package/dist/storage/connector-connections/types.d.ts.map +1 -1
  575. package/dist/storage/dataset-ingest/codec.d.ts +6 -0
  576. package/dist/storage/dataset-ingest/codec.d.ts.map +1 -0
  577. package/dist/storage/dataset-ingest/in-memory.d.ts +28 -0
  578. package/dist/storage/dataset-ingest/in-memory.d.ts.map +1 -0
  579. package/dist/storage/dataset-ingest/index.d.ts +4 -0
  580. package/dist/storage/dataset-ingest/index.d.ts.map +1 -0
  581. package/dist/storage/dataset-ingest/provider.d.ts +157 -0
  582. package/dist/storage/dataset-ingest/provider.d.ts.map +1 -0
  583. package/dist/storage/dataset-ingest/provider.js +17 -0
  584. package/dist/storage/dataset-ingest/provider.js.map +9 -0
  585. package/dist/storage/dataset-ingest/types.d.ts +188 -0
  586. package/dist/storage/dataset-ingest/types.d.ts.map +1 -0
  587. package/dist/storage/file-upload-sessions/provider.js +12 -11
  588. package/dist/storage/file-upload-sessions/provider.js.map +1 -1
  589. package/dist/storage/in-memory/index.d.ts +12 -0
  590. package/dist/storage/in-memory/index.d.ts.map +1 -1
  591. package/dist/storage/index.d.ts +18 -11
  592. package/dist/storage/index.d.ts.map +1 -1
  593. package/dist/storage/index.js +55 -45
  594. package/dist/storage/index.js.map +1 -1
  595. package/dist/storage/internal.d.ts +4 -1
  596. package/dist/storage/internal.d.ts.map +1 -1
  597. package/dist/storage/internal.js +81 -5
  598. package/dist/storage/internal.js.map +4 -3
  599. package/dist/storage/lake-retention-runs/in-memory.d.ts +11 -0
  600. package/dist/storage/lake-retention-runs/in-memory.d.ts.map +1 -0
  601. package/dist/storage/lake-retention-runs/index.d.ts +3 -0
  602. package/dist/storage/lake-retention-runs/index.d.ts.map +1 -0
  603. package/dist/storage/lake-retention-runs/types.d.ts +21 -0
  604. package/dist/storage/lake-retention-runs/types.d.ts.map +1 -0
  605. package/dist/storage/maintenance-heartbeats/in-memory.d.ts +11 -0
  606. package/dist/storage/maintenance-heartbeats/in-memory.d.ts.map +1 -0
  607. package/dist/storage/maintenance-heartbeats/index.d.ts +3 -0
  608. package/dist/storage/maintenance-heartbeats/index.d.ts.map +1 -0
  609. package/dist/storage/maintenance-heartbeats/record.d.ts +11 -0
  610. package/dist/storage/maintenance-heartbeats/record.d.ts.map +1 -0
  611. package/dist/storage/maintenance-heartbeats/types.d.ts +30 -0
  612. package/dist/storage/maintenance-heartbeats/types.d.ts.map +1 -0
  613. package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
  614. package/dist/storage/objects/in-memory/storage.d.ts +15 -1
  615. package/dist/storage/objects/in-memory/storage.d.ts.map +1 -1
  616. package/dist/storage/objects/read-scope.d.ts.map +1 -1
  617. package/dist/storage/objects/types.d.ts +18 -1
  618. package/dist/storage/objects/types.d.ts.map +1 -1
  619. package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
  620. package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
  621. package/dist/storage/ontology/index.d.ts +1 -1
  622. package/dist/storage/ontology/index.d.ts.map +1 -1
  623. package/dist/storage/ontology/materializations.d.ts +20 -0
  624. package/dist/storage/ontology/materializations.d.ts.map +1 -1
  625. package/dist/storage/ontology/provider-work.d.ts +7 -1
  626. package/dist/storage/ontology/provider-work.d.ts.map +1 -1
  627. package/dist/storage/ontology/provider.js +1 -1
  628. package/dist/storage/pipeline-runs/in-memory.d.ts +8 -2
  629. package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -1
  630. package/dist/storage/pipeline-runs/index.d.ts +1 -1
  631. package/dist/storage/pipeline-runs/index.d.ts.map +1 -1
  632. package/dist/storage/pipeline-runs/provider.js +1 -1
  633. package/dist/storage/pipeline-runs/transitions.d.ts +2 -2
  634. package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -1
  635. package/dist/storage/pipeline-runs/types.d.ts +26 -6
  636. package/dist/storage/pipeline-runs/types.d.ts.map +1 -1
  637. package/dist/storage/projection-runs/errors.d.ts +6 -0
  638. package/dist/storage/projection-runs/errors.d.ts.map +1 -1
  639. package/dist/storage/projection-runs/in-memory.d.ts +5 -1
  640. package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
  641. package/dist/storage/projection-runs/index.d.ts +2 -2
  642. package/dist/storage/projection-runs/index.d.ts.map +1 -1
  643. package/dist/storage/projection-runs/lifecycle.d.ts +1 -0
  644. package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
  645. package/dist/storage/projection-runs/provider.js +2 -2
  646. package/dist/storage/projection-runs/types.d.ts +16 -0
  647. package/dist/storage/projection-runs/types.d.ts.map +1 -1
  648. package/dist/storage/run-claim.d.ts +132 -0
  649. package/dist/storage/run-claim.d.ts.map +1 -0
  650. package/dist/storage/share-grants/provider.js +3 -3
  651. package/dist/storage/share-sessions/in-memory.d.ts +2 -1
  652. package/dist/storage/share-sessions/in-memory.d.ts.map +1 -1
  653. package/dist/storage/share-sessions/index.d.ts +1 -1
  654. package/dist/storage/share-sessions/index.d.ts.map +1 -1
  655. package/dist/storage/share-sessions/provider.d.ts +1 -1
  656. package/dist/storage/share-sessions/provider.d.ts.map +1 -1
  657. package/dist/storage/share-sessions/provider.js +4 -2
  658. package/dist/storage/share-sessions/provider.js.map +1 -1
  659. package/dist/storage/share-sessions/record.d.ts +2 -1
  660. package/dist/storage/share-sessions/record.d.ts.map +1 -1
  661. package/dist/storage/share-sessions/types.d.ts +17 -1
  662. package/dist/storage/share-sessions/types.d.ts.map +1 -1
  663. package/dist/storage/sync-runs/in-memory.d.ts +10 -2
  664. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
  665. package/dist/storage/sync-runs/index.d.ts +1 -1
  666. package/dist/storage/sync-runs/index.d.ts.map +1 -1
  667. package/dist/storage/sync-runs/transitions.d.ts +2 -2
  668. package/dist/storage/sync-runs/transitions.d.ts.map +1 -1
  669. package/dist/storage/sync-runs/types.d.ts +29 -3
  670. package/dist/storage/sync-runs/types.d.ts.map +1 -1
  671. package/dist/storage/types.d.ts +12 -6
  672. package/dist/storage/types.d.ts.map +1 -1
  673. package/dist/storage/webhook-runs/in-memory.d.ts +2 -1
  674. package/dist/storage/webhook-runs/in-memory.d.ts.map +1 -1
  675. package/dist/storage/webhook-runs/index.d.ts +2 -2
  676. package/dist/storage/webhook-runs/index.d.ts.map +1 -1
  677. package/dist/storage/webhook-runs/types.d.ts +33 -2
  678. package/dist/storage/webhook-runs/types.d.ts.map +1 -1
  679. package/dist/storage/workflow-runs/in-memory.d.ts +6 -3
  680. package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -1
  681. package/dist/storage/workflow-runs/index.d.ts +1 -1
  682. package/dist/storage/workflow-runs/index.d.ts.map +1 -1
  683. package/dist/storage/workflow-runs/provider.js +12 -11
  684. package/dist/storage/workflow-runs/provider.js.map +1 -1
  685. package/dist/storage/workflow-runs/types.d.ts +11 -28
  686. package/dist/storage/workflow-runs/types.d.ts.map +1 -1
  687. package/dist/syncs/index.js +37 -34
  688. package/dist/syncs/index.js.map +1 -1
  689. package/dist/syncs/run-dispatch.d.ts +2 -0
  690. package/dist/syncs/run-dispatch.d.ts.map +1 -1
  691. package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
  692. package/dist/testing/artifact-holders-contract.d.ts +15 -0
  693. package/dist/testing/artifact-holders-contract.d.ts.map +1 -0
  694. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  695. package/dist/testing/auth-storage-contract.d.ts.map +1 -1
  696. package/dist/testing/broker-contract.d.ts.map +1 -1
  697. package/dist/testing/connector-connection-storage-contract.d.ts +1 -1
  698. package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
  699. package/dist/testing/dataset-ingest-storage-contract.d.ts +11 -0
  700. package/dist/testing/dataset-ingest-storage-contract.d.ts.map +1 -0
  701. package/dist/testing/dataset-sequence-contract.d.ts +1 -1
  702. package/dist/testing/dataset-sequence-contract.d.ts.map +1 -1
  703. package/dist/testing/execution.d.ts.map +1 -1
  704. package/dist/testing/index.d.ts +8 -0
  705. package/dist/testing/index.d.ts.map +1 -1
  706. package/dist/testing/index.js +6244 -3191
  707. package/dist/testing/index.js.map +28 -19
  708. package/dist/testing/lake-retention-run-storage-contract.d.ts +9 -0
  709. package/dist/testing/lake-retention-run-storage-contract.d.ts.map +1 -0
  710. package/dist/testing/maintenance-heartbeat-storage-contract.d.ts +9 -0
  711. package/dist/testing/maintenance-heartbeat-storage-contract.d.ts.map +1 -0
  712. package/dist/testing/object-query-contract.d.ts.map +1 -1
  713. package/dist/testing/pipeline-execution.d.ts.map +1 -1
  714. package/dist/testing/pipeline-run-read-contract.d.ts +13 -0
  715. package/dist/testing/pipeline-run-read-contract.d.ts.map +1 -0
  716. package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
  717. package/dist/testing/queues-contract.d.ts.map +1 -1
  718. package/dist/testing/run-claim-storage-contract.d.ts +12 -0
  719. package/dist/testing/run-claim-storage-contract.d.ts.map +1 -0
  720. package/dist/testing/run-claim.d.ts +30 -0
  721. package/dist/testing/run-claim.d.ts.map +1 -0
  722. package/dist/testing/run-recovery-contract.d.ts +49 -0
  723. package/dist/testing/run-recovery-contract.d.ts.map +1 -0
  724. package/dist/testing/share-session-storage-contract.d.ts.map +1 -1
  725. package/dist/testing/stored-artifacts.d.ts +10 -0
  726. package/dist/testing/stored-artifacts.d.ts.map +1 -0
  727. package/dist/testing/sync-execution.d.ts.map +1 -1
  728. package/dist/testing/webhook-execution.d.ts +1 -1
  729. package/dist/testing/webhook-execution.d.ts.map +1 -1
  730. package/dist/testing/webhook-run-storage-contract.d.ts.map +1 -1
  731. package/dist/users/execution.d.ts +18 -1
  732. package/dist/users/execution.d.ts.map +1 -1
  733. package/dist/users/index.d.ts +1 -1
  734. package/dist/users/index.d.ts.map +1 -1
  735. package/dist/webhooks/delivery-lease.d.ts +13 -0
  736. package/dist/webhooks/delivery-lease.d.ts.map +1 -0
  737. package/dist/webhooks/internal.d.ts +2 -0
  738. package/dist/webhooks/internal.d.ts.map +1 -1
  739. package/dist/webhooks/internal.js +67 -35
  740. package/dist/webhooks/internal.js.map +5 -4
  741. package/dist/webhooks/run-admission.d.ts.map +1 -1
  742. package/dist/workers/index.d.ts +5 -1
  743. package/dist/workers/index.d.ts.map +1 -1
  744. package/dist/workers/index.js +193 -58
  745. package/dist/workers/index.js.map +8 -7
  746. package/dist/workers/job-ids.d.ts +17 -0
  747. package/dist/workers/job-ids.d.ts.map +1 -0
  748. package/dist/workers/lost-projection-runs.d.ts +26 -0
  749. package/dist/workers/lost-projection-runs.d.ts.map +1 -0
  750. package/dist/workers/lost-runs.d.ts +51 -0
  751. package/dist/workers/lost-runs.d.ts.map +1 -0
  752. package/dist/workers/queue-delivery.d.ts.map +1 -1
  753. package/dist/workers/queue-worker.d.ts +1 -2
  754. package/dist/workers/queue-worker.d.ts.map +1 -1
  755. package/dist/workers/queued-run-dispatch.d.ts +90 -0
  756. package/dist/workers/queued-run-dispatch.d.ts.map +1 -0
  757. package/dist/workers/run-lease.d.ts +25 -0
  758. package/dist/workers/run-lease.d.ts.map +1 -0
  759. package/dist/workers/run-worker.d.ts +95 -0
  760. package/dist/workers/run-worker.d.ts.map +1 -0
  761. package/dist/workflows/index.js +63 -57
  762. package/dist/workflows/index.js.map +1 -1
  763. package/dist/workflows/request.d.ts.map +1 -1
  764. package/dist/workflows/run-dispatch.d.ts +6 -1
  765. package/dist/workflows/run-dispatch.d.ts.map +1 -1
  766. package/package.json +41 -3
  767. package/src/actions/request.ts +24 -7
  768. package/src/actions/run/executor.ts +9 -42
  769. package/src/actions/types/context.ts +8 -3
  770. package/src/agents/execution.ts +10 -2
  771. package/src/agents/fork.ts +12 -4
  772. package/src/agents/index.ts +7 -1
  773. package/src/agents/request.ts +42 -31
  774. package/src/agents/run-artifacts.ts +290 -46
  775. package/src/agents/run-session-http.ts +4 -0
  776. package/src/agents/run-session-serve.ts +10 -0
  777. package/src/agents/run-session.ts +8 -1
  778. package/src/agents/streams/protocol.ts +5 -10
  779. package/src/agents/validation.ts +3 -0
  780. package/src/artifacts/access.ts +71 -28
  781. package/src/artifacts/canvas-display.ts +160 -0
  782. package/src/artifacts/canvas.ts +26 -1
  783. package/src/artifacts/comment-text.ts +32 -0
  784. package/src/artifacts/comments.ts +275 -0
  785. package/src/artifacts/errors.ts +6 -1
  786. package/src/artifacts/events.ts +58 -0
  787. package/src/artifacts/execution.ts +496 -53
  788. package/src/artifacts/frames/assets.ts +20 -1
  789. package/src/artifacts/frames/grants.ts +31 -10
  790. package/src/artifacts/frames/index.ts +2 -0
  791. package/src/artifacts/frames/kit.ts +8 -5
  792. package/src/artifacts/frames/protocol.ts +149 -0
  793. package/src/artifacts/frames/runtime.ts +317 -29
  794. package/src/artifacts/holders.ts +120 -0
  795. package/src/artifacts/ids.ts +8 -0
  796. package/src/artifacts/index.ts +28 -2
  797. package/src/artifacts/limits.ts +28 -4
  798. package/src/artifacts/live/board.ts +759 -0
  799. package/src/artifacts/live/diff.ts +297 -0
  800. package/src/artifacts/live/document.ts +354 -0
  801. package/src/artifacts/live/files.ts +82 -0
  802. package/src/artifacts/live/index.ts +50 -0
  803. package/src/artifacts/live/presence.ts +144 -0
  804. package/src/artifacts/live/protocol.ts +134 -0
  805. package/src/artifacts/live/server.ts +16 -0
  806. package/src/artifacts/live/state.ts +115 -0
  807. package/src/artifacts/outline.ts +12 -0
  808. package/src/artifacts/publish/index.ts +26 -1
  809. package/src/artifacts/publish/merge.ts +271 -0
  810. package/src/artifacts/publish/previews.ts +485 -0
  811. package/src/artifacts/publish/publish.ts +92 -39
  812. package/src/artifacts/publish/query-answers.ts +85 -0
  813. package/src/artifacts/publish/references.ts +10 -4
  814. package/src/artifacts/publish/validate/canvas.ts +133 -1
  815. package/src/artifacts/theme.ts +9 -1
  816. package/src/auth/directory.ts +166 -0
  817. package/src/auth/member-events.ts +10 -3
  818. package/src/auth/runtime.ts +108 -8
  819. package/src/auth/strategy.ts +3 -1
  820. package/src/auth/types.ts +44 -0
  821. package/src/authorization/decision.ts +6 -5
  822. package/src/authorization/event-visibility.ts +4 -0
  823. package/src/broker/in-memory.ts +33 -6
  824. package/src/broker/types.ts +4 -0
  825. package/src/connectors/builders.ts +34 -2
  826. package/src/connectors/connections/access.ts +83 -0
  827. package/src/connectors/connections/contracts.ts +6 -1
  828. package/src/connectors/connections/execution.ts +2 -2
  829. package/src/connectors/connections/runs.ts +51 -2
  830. package/src/connectors/connections/service.ts +208 -41
  831. package/src/connectors/connections/views.ts +11 -4
  832. package/src/connectors/execution.ts +27 -3
  833. package/src/connectors/index.ts +2 -0
  834. package/src/connectors/service.ts +12 -0
  835. package/src/connectors/types.ts +37 -2
  836. package/src/datasets/execution.ts +74 -37
  837. package/src/datasets/ingest-flush-batch.ts +289 -0
  838. package/src/datasets/ingest-flush-job.ts +112 -0
  839. package/src/datasets/ingest-flush.ts +377 -0
  840. package/src/datasets/produced-version.ts +55 -0
  841. package/src/datasets/write.ts +65 -11
  842. package/src/deploy/services.ts +1 -1
  843. package/src/deploy/types.ts +2 -3
  844. package/src/deploy/validation.ts +1 -0
  845. package/src/error-reporting/capability.ts +66 -0
  846. package/src/error-reporting/internal.ts +12 -0
  847. package/src/error-reporting/reporter.ts +11 -35
  848. package/src/error-reporting/reports.ts +167 -0
  849. package/src/error-reporting/types.ts +99 -0
  850. package/src/errors/catalog.ts +6 -0
  851. package/src/events/definitions.ts +14 -0
  852. package/src/events/execution.ts +77 -28
  853. package/src/events/index.ts +3 -0
  854. package/src/events/scope.ts +2 -0
  855. package/src/events/types/artifacts.ts +40 -0
  856. package/src/events/types/index.ts +3 -0
  857. package/src/events/types/users.ts +5 -2
  858. package/src/execution/authorized-object-reader.ts +34 -0
  859. package/src/execution/object-reader-clearance.ts +31 -0
  860. package/src/execution/object-reader-security.ts +33 -13
  861. package/src/http/api-routes.ts +105 -4
  862. package/src/index.ts +22 -4
  863. package/src/lake-storage/errors.ts +21 -0
  864. package/src/lake-storage/index.ts +9 -1
  865. package/src/lake-storage/maintenance.ts +93 -0
  866. package/src/lake-storage/merge.ts +3 -1
  867. package/src/lake-storage/source-ordering.ts +28 -2
  868. package/src/lake-storage/types.ts +14 -0
  869. package/src/maintenance/heartbeat.ts +14 -0
  870. package/src/maintenance/index.ts +5 -3
  871. package/src/maintenance/lake-retention-status.ts +81 -0
  872. package/src/maintenance/lake-retention.ts +347 -0
  873. package/src/maintenance/loop.ts +365 -0
  874. package/src/maintenance/ontology-maintenance.ts +76 -229
  875. package/src/maintenance/passes/cron-pass.ts +217 -0
  876. package/src/maintenance/passes/directory-pass.ts +22 -0
  877. package/src/maintenance/passes/ingest-pass.ts +94 -0
  878. package/src/maintenance/passes/lake-change-feed.ts +112 -0
  879. package/src/maintenance/passes/lake-retention-pass.ts +71 -0
  880. package/src/maintenance/passes/ontology-pass.ts +19 -0
  881. package/src/maintenance/passes/projections-pass.ts +238 -0
  882. package/src/maintenance/passes/recovery-pass.ts +17 -0
  883. package/src/maintenance/passes/recovery-passes.ts +39 -0
  884. package/src/maintenance/passes/runs-pass.ts +12 -0
  885. package/src/maintenance/passes/triggers-pass.ts +332 -0
  886. package/src/maintenance/status.ts +75 -0
  887. package/src/maintenance/types.ts +27 -25
  888. package/src/materialization/model.ts +33 -21
  889. package/src/materializer/README.md +13 -2
  890. package/src/materializer/edits/artifact-refs.ts +140 -0
  891. package/src/materializer/edits/commit.ts +20 -7
  892. package/src/materializer/edits/operations.ts +23 -7
  893. package/src/materializer/edits/plan.ts +2 -0
  894. package/src/materializer/execution/work-records.ts +61 -0
  895. package/src/materializer/projections/replacement-plan.ts +2 -0
  896. package/src/materializer/shared/normalize.ts +14 -0
  897. package/src/materializer/telemetry/plan.ts +2 -0
  898. package/src/objects/artifact-refs.ts +34 -0
  899. package/src/objects/materializer-adapter.ts +8 -3
  900. package/src/objects/object/upsert-batch.ts +7 -0
  901. package/src/objects/object/upsert.ts +11 -2
  902. package/src/objects/query/ir.ts +2 -0
  903. package/src/objects/query/scalar-values.ts +5 -3
  904. package/src/objects/runtime-batch.ts +8 -1
  905. package/src/objects/vectors/README.md +4 -4
  906. package/src/ontology/artifact-ref.ts +83 -0
  907. package/src/ontology/docs-markdown.ts +17 -0
  908. package/src/ontology/index.ts +3 -1
  909. package/src/ontology/inference/index.ts +2 -0
  910. package/src/ontology/json-schema.ts +13 -0
  911. package/src/ontology/primitives.ts +14 -0
  912. package/src/ontology/reference-values.ts +62 -0
  913. package/src/ontology/refs.ts +7 -1
  914. package/src/ontology/registry.ts +26 -1
  915. package/src/ontology/types.ts +2 -0
  916. package/src/ontology/user-ref.ts +35 -45
  917. package/src/ontology/validation/normalize.ts +13 -0
  918. package/src/ontology/validation/properties.ts +9 -0
  919. package/src/ontology/validation/schema.ts +12 -0
  920. package/src/pending-tasks.ts +51 -0
  921. package/src/pipelines/run-dispatch.ts +120 -238
  922. package/src/predicates/types.ts +2 -1
  923. package/src/projections/builders.ts +28 -13
  924. package/src/projections/run-dispatch.ts +1 -1
  925. package/src/projections/types.ts +1 -1
  926. package/src/projections/validation.ts +22 -8
  927. package/src/queues/in-memory.ts +50 -3
  928. package/src/queues/index.ts +4 -0
  929. package/src/queues/types.ts +68 -1
  930. package/src/runtime/create.ts +4 -0
  931. package/src/runtime/host.ts +118 -13
  932. package/src/runtime/index.ts +0 -1
  933. package/src/runtime/internal.ts +13 -0
  934. package/src/runtime/ontology-mutations.ts +1 -1
  935. package/src/runtime/sixb.ts +14 -5
  936. package/src/scheduler/index.ts +0 -2
  937. package/src/shared/backoff.ts +34 -0
  938. package/src/shared/duration.ts +15 -0
  939. package/src/shared/params/artifact-refs.ts +42 -0
  940. package/src/shares/compiler.ts +1 -1
  941. package/src/shares/guest-name.ts +20 -0
  942. package/src/shares/internal.ts +1 -0
  943. package/src/shares/session-protocol.ts +63 -0
  944. package/src/storage/artifacts/errors.ts +10 -2
  945. package/src/storage/artifacts/in-memory.ts +579 -96
  946. package/src/storage/artifacts/index.ts +22 -1
  947. package/src/storage/artifacts/record.ts +255 -11
  948. package/src/storage/artifacts/types.ts +343 -40
  949. package/src/storage/auth/in-memory/auth-storage.ts +42 -5
  950. package/src/storage/auth/in-memory/identities.ts +16 -0
  951. package/src/storage/auth/in-memory/shared.ts +15 -0
  952. package/src/storage/auth/in-memory/users.ts +17 -16
  953. package/src/storage/auth/index.ts +3 -0
  954. package/src/storage/auth/types.ts +38 -0
  955. package/src/storage/connector-connections/in-memory.ts +4 -1
  956. package/src/storage/connector-connections/index.ts +1 -0
  957. package/src/storage/connector-connections/provider/runs.ts +3 -0
  958. package/src/storage/connector-connections/provider/shared.ts +30 -0
  959. package/src/storage/connector-connections/provider.ts +4 -0
  960. package/src/storage/connector-connections/types.ts +1 -0
  961. package/src/storage/dataset-ingest/codec.ts +90 -0
  962. package/src/storage/dataset-ingest/in-memory.ts +277 -0
  963. package/src/storage/dataset-ingest/index.ts +16 -0
  964. package/src/storage/dataset-ingest/provider.ts +592 -0
  965. package/src/storage/dataset-ingest/types.ts +191 -0
  966. package/src/storage/in-memory/index.ts +33 -0
  967. package/src/storage/index.ts +65 -5
  968. package/src/storage/internal.ts +20 -0
  969. package/src/storage/lake-retention-runs/in-memory.ts +22 -0
  970. package/src/storage/lake-retention-runs/index.ts +2 -0
  971. package/src/storage/lake-retention-runs/types.ts +19 -0
  972. package/src/storage/maintenance-heartbeats/in-memory.ts +24 -0
  973. package/src/storage/maintenance-heartbeats/index.ts +7 -0
  974. package/src/storage/maintenance-heartbeats/record.ts +50 -0
  975. package/src/storage/maintenance-heartbeats/types.ts +30 -0
  976. package/src/storage/objects/in-memory/query.ts +1 -0
  977. package/src/storage/objects/in-memory/storage.ts +81 -0
  978. package/src/storage/objects/read-scope.ts +1 -0
  979. package/src/storage/objects/types.ts +16 -1
  980. package/src/storage/ontology/in-memory/materializations.ts +8 -0
  981. package/src/storage/ontology/in-memory/replacement-plans.ts +4 -1
  982. package/src/storage/ontology/index.ts +2 -0
  983. package/src/storage/ontology/materializations.ts +18 -0
  984. package/src/storage/ontology/provider-work.ts +39 -0
  985. package/src/storage/pipeline-runs/in-memory.ts +97 -24
  986. package/src/storage/pipeline-runs/index.ts +0 -1
  987. package/src/storage/pipeline-runs/provider.ts +1 -1
  988. package/src/storage/pipeline-runs/transitions.ts +7 -4
  989. package/src/storage/pipeline-runs/types.ts +33 -7
  990. package/src/storage/projection-runs/errors.ts +10 -0
  991. package/src/storage/projection-runs/in-memory.ts +56 -1
  992. package/src/storage/projection-runs/index.ts +2 -1
  993. package/src/storage/projection-runs/lifecycle.ts +9 -1
  994. package/src/storage/projection-runs/types.ts +20 -1
  995. package/src/storage/run-claim.ts +224 -0
  996. package/src/storage/share-sessions/in-memory.ts +21 -0
  997. package/src/storage/share-sessions/index.ts +1 -0
  998. package/src/storage/share-sessions/provider.ts +1 -0
  999. package/src/storage/share-sessions/record.ts +28 -0
  1000. package/src/storage/share-sessions/types.ts +19 -1
  1001. package/src/storage/sync-runs/in-memory.ts +109 -29
  1002. package/src/storage/sync-runs/index.ts +1 -1
  1003. package/src/storage/sync-runs/transitions.ts +7 -4
  1004. package/src/storage/sync-runs/types.ts +36 -3
  1005. package/src/storage/types.ts +15 -5
  1006. package/src/storage/webhook-runs/in-memory.ts +26 -2
  1007. package/src/storage/webhook-runs/index.ts +3 -1
  1008. package/src/storage/webhook-runs/types.ts +44 -3
  1009. package/src/storage/workflow-runs/in-memory.ts +50 -36
  1010. package/src/storage/workflow-runs/index.ts +0 -2
  1011. package/src/storage/workflow-runs/types.ts +18 -30
  1012. package/src/syncs/run-dispatch.ts +118 -239
  1013. package/src/testing/ai-model-call-groups-contract.ts +2 -1
  1014. package/src/testing/artifact-holders-contract.ts +392 -0
  1015. package/src/testing/artifact-storage-contract.ts +1205 -151
  1016. package/src/testing/auth-storage-contract.ts +228 -1
  1017. package/src/testing/broker-contract.ts +56 -0
  1018. package/src/testing/connector-connection-storage-contract.ts +94 -5
  1019. package/src/testing/dataset-ingest-storage-contract.ts +480 -0
  1020. package/src/testing/dataset-sequence-contract.ts +97 -12
  1021. package/src/testing/execution.ts +23 -0
  1022. package/src/testing/index.ts +31 -0
  1023. package/src/testing/lake-retention-run-storage-contract.ts +75 -0
  1024. package/src/testing/maintenance-heartbeat-storage-contract.ts +99 -0
  1025. package/src/testing/object-query-contract.ts +93 -0
  1026. package/src/testing/pipeline-execution.ts +3 -1
  1027. package/src/testing/pipeline-run-read-contract.ts +123 -0
  1028. package/src/testing/projection-run-storage-contract.ts +113 -0
  1029. package/src/testing/queues-contract.ts +112 -0
  1030. package/src/testing/run-claim-storage-contract.ts +736 -0
  1031. package/src/testing/run-claim.ts +69 -0
  1032. package/src/testing/run-recovery-contract.ts +176 -0
  1033. package/src/testing/share-session-storage-contract.ts +43 -0
  1034. package/src/testing/stored-artifacts.ts +43 -0
  1035. package/src/testing/sync-execution.ts +3 -1
  1036. package/src/testing/webhook-execution.ts +7 -2
  1037. package/src/testing/webhook-run-storage-contract.ts +102 -5
  1038. package/src/users/execution.ts +50 -2
  1039. package/src/users/index.ts +1 -0
  1040. package/src/webhooks/delivery-lease.ts +40 -0
  1041. package/src/webhooks/internal.ts +2 -0
  1042. package/src/webhooks/run-admission.ts +22 -9
  1043. package/src/workers/README.md +169 -0
  1044. package/src/workers/index.ts +9 -1
  1045. package/src/workers/job-ids.ts +31 -0
  1046. package/src/workers/lost-projection-runs.ts +114 -0
  1047. package/src/workers/lost-runs.ts +397 -0
  1048. package/src/workers/queue-delivery.ts +2 -14
  1049. package/src/workers/queue-worker.ts +9 -17
  1050. package/src/workers/queued-run-dispatch.ts +308 -0
  1051. package/src/workers/run-lease.ts +46 -0
  1052. package/src/workers/run-worker.ts +312 -0
  1053. package/src/workers/worker.ts +4 -17
  1054. package/src/workflows/request.ts +2 -0
  1055. package/src/workflows/run-dispatch.ts +22 -4
  1056. package/src/workflows/snapshot.ts +1 -0
  1057. package/dist/chunk-2g0r46hy.js.map +0 -12
  1058. package/dist/chunk-3fqxbn31.js +0 -107
  1059. package/dist/chunk-3fqxbn31.js.map +0 -11
  1060. package/dist/chunk-4s753g3k.js +0 -314
  1061. package/dist/chunk-4s753g3k.js.map +0 -12
  1062. package/dist/chunk-5kyvrtjh.js.map +0 -12
  1063. package/dist/chunk-5taem5aw.js.map +0 -10
  1064. package/dist/chunk-65abf64x.js +0 -13
  1065. package/dist/chunk-65abf64x.js.map +0 -10
  1066. package/dist/chunk-9x8dybsb.js.map +0 -10
  1067. package/dist/chunk-az47zep4.js +0 -41
  1068. package/dist/chunk-az47zep4.js.map +0 -10
  1069. package/dist/chunk-c706qvyc.js +0 -299
  1070. package/dist/chunk-c706qvyc.js.map +0 -11
  1071. package/dist/chunk-djs3hw9p.js.map +0 -20
  1072. package/dist/chunk-e5wf5vz0.js.map +0 -10
  1073. package/dist/chunk-e6xgz4h4.js.map +0 -21
  1074. package/dist/chunk-e7v3trpz.js.map +0 -10
  1075. package/dist/chunk-eqgr6nsa.js.map +0 -72
  1076. package/dist/chunk-fb3feg1e.js +0 -298
  1077. package/dist/chunk-fb3feg1e.js.map +0 -12
  1078. package/dist/chunk-hz5d43gn.js.map +0 -10
  1079. package/dist/chunk-j8thxj7w.js.map +0 -22
  1080. package/dist/chunk-jbw70d6t.js.map +0 -10
  1081. package/dist/chunk-jftd33rc.js.map +0 -11
  1082. package/dist/chunk-jspskey0.js.map +0 -10
  1083. package/dist/chunk-kfee1h52.js.map +0 -13
  1084. package/dist/chunk-kwfhd1g0.js +0 -144
  1085. package/dist/chunk-kwfhd1g0.js.map +0 -13
  1086. package/dist/chunk-nz7815t3.js.map +0 -14
  1087. package/dist/chunk-s3we74h8.js.map +0 -12
  1088. package/dist/chunk-scyq22td.js.map +0 -12
  1089. package/dist/chunk-w1btn96n.js.map +0 -44
  1090. package/dist/chunk-w976a4me.js.map +0 -10
  1091. package/dist/chunk-wkq3kvzd.js.map +0 -10
  1092. package/dist/chunk-wrjx1fqz.js +0 -587
  1093. package/dist/chunk-wrjx1fqz.js.map +0 -18
  1094. package/dist/chunk-yw9pyg66.js +0 -143
  1095. package/dist/chunk-yw9pyg66.js.map +0 -11
  1096. package/dist/chunk-z8fx5cgb.js.map +0 -11
  1097. package/dist/scheduler/runtime.d.ts +0 -40
  1098. package/dist/scheduler/runtime.d.ts.map +0 -1
  1099. package/dist/workers/unstarted-run.d.ts +0 -10
  1100. package/dist/workers/unstarted-run.d.ts.map +0 -1
  1101. package/src/scheduler/runtime.ts +0 -214
  1102. package/src/workers/unstarted-run.ts +0 -18
  1103. /package/dist/{chunk-80gym75n.js.map → chunk-186k5yz3.js.map} +0 -0
  1104. /package/dist/{chunk-ytzcxtpt.js.map → chunk-3ba89vm7.js.map} +0 -0
  1105. /package/dist/{chunk-d04g36fw.js.map → chunk-5qqmndhm.js.map} +0 -0
  1106. /package/dist/{chunk-5wtnmpze.js.map → chunk-7qe46788.js.map} +0 -0
  1107. /package/dist/{chunk-31kcqmhf.js.map → chunk-855w9nvw.js.map} +0 -0
  1108. /package/dist/{chunk-2ajw5rz0.js.map → chunk-8p7bze4c.js.map} +0 -0
  1109. /package/dist/{chunk-9whfmsfk.js.map → chunk-8tqnsx3q.js.map} +0 -0
  1110. /package/dist/{chunk-s038wa5v.js.map → chunk-b9qfh2ya.js.map} +0 -0
  1111. /package/dist/{chunk-jjmggm9a.js.map → chunk-fe6r7yhg.js.map} +0 -0
  1112. /package/dist/{chunk-165c9wm6.js.map → chunk-g2ph4873.js.map} +0 -0
  1113. /package/dist/{chunk-ga63a3dz.js.map → chunk-k66rp2hr.js.map} +0 -0
  1114. /package/dist/{chunk-4zm1k3xj.js.map → chunk-r2psmn42.js.map} +0 -0
  1115. /package/dist/{chunk-r1cxq7vv.js.map → chunk-rtdrm592.js.map} +0 -0
  1116. /package/dist/{chunk-4bm0caep.js.map → chunk-smnt672s.js.map} +0 -0
  1117. /package/dist/{chunk-21q0j5f2.js.map → chunk-stmxh0hv.js.map} +0 -0
  1118. /package/dist/{chunk-ff5xkv0p.js.map → chunk-tfzvjdms.js.map} +0 -0
  1119. /package/dist/{chunk-6b61s40c.js.map → chunk-w3t94hm6.js.map} +0 -0
@@ -2,22 +2,14 @@
2
2
  import {
3
3
  withFailureMessage2
4
4
  } from "./chunk-6eqsgvxk.js";
5
+ import {
6
+ isActionDefinition2
7
+ } from "./chunk-0k3r5kb3.js";
5
8
  import {
6
9
  createSixbError2,
7
10
  isSixbError2,
8
11
  summarizeErrorMessage2
9
- } from "./chunk-escedwyt.js";
10
- import {
11
- isActionDefinition2
12
- } from "./chunk-s7j8ewqv.js";
13
- import {
14
- WorkflowDefinitionError2,
15
- assertNonEmpty,
16
- isStepDefinition2,
17
- isAgentStepDefinition2,
18
- isInterventionDefinition2,
19
- assertAgentStepSandbox
20
- } from "./chunk-a5v4gjdx.js";
12
+ } from "./chunk-mvz89age.js";
21
13
  import {
22
14
  isGroupDefinition
23
15
  } from "./chunk-frsz8wxd.js";
@@ -31,12 +23,20 @@ import {
31
23
  import {
32
24
  AGENT_REASONING_LEVELS2
33
25
  } from "./chunk-7z5rkf0m.js";
26
+ import {
27
+ WorkflowDefinitionError2,
28
+ assertNonEmpty,
29
+ isStepDefinition2,
30
+ isAgentStepDefinition2,
31
+ isInterventionDefinition2,
32
+ assertAgentStepSandbox
33
+ } from "./chunk-e9w4mgdh.js";
34
34
  import {
35
35
  isAgentToolDefinition2
36
- } from "./chunk-dsv783c3.js";
36
+ } from "./chunk-z0t4p2sk.js";
37
37
  import {
38
38
  isScheduleDefinition2
39
- } from "./chunk-57g0215c.js";
39
+ } from "./chunk-t24yktqr.js";
40
40
  import {
41
41
  ModelProviderError2,
42
42
  UnsupportedModelFeatureError2,
@@ -470,4 +470,4 @@ function workflowNodeFailureDetails(identity) {
470
470
  }
471
471
  export { workflowAgentStepActorId2, interventionField2, defineWorkflowStep2, defineAgentStep2, defineIntervention2, defineWorkflow2, createWorkflowNodeFailure2, unwrapWorkflowNodeFailure2 };
472
472
 
473
- //# debugId=C0763B465A2130CB64756E2164756E21
473
+ //# debugId=E01FC203124534F264756E2164756E21
@@ -7,6 +7,6 @@
7
7
  "import { withFailureMessage } from \"../errors/failure-message\"\nimport { createSixbError, isSixbError, summarizeErrorMessage } from \"../errors/internal\"\nimport {\n ModelProviderError,\n StructuredOutputError,\n UnsupportedModelFeatureError,\n} from \"../models/errors\"\n\ninterface WorkflowNodeFailureIdentityBase {\n readonly workflowId: string\n readonly workflowRunId: string\n readonly nodeId: string\n readonly nodeRunId?: string\n readonly failurePhase?: \"output-preflight\" | \"agent-loop\" | \"structured-finalizer\"\n readonly modelId?: string\n}\n\nexport interface WorkflowNodeFailureIdentity extends WorkflowNodeFailureIdentityBase {\n readonly child:\n | { readonly type: \"step\"; readonly stepId: string }\n | {\n readonly type: \"action\"\n readonly actionId: string\n readonly actionRunId?: string\n }\n | { readonly type: \"agent\"; readonly agentStepId: string }\n | { readonly type: \"intervention\"; readonly interventionId: string }\n}\n\n/** Translate a node-local failure into the workflow primitive's durable vocabulary. */\nexport function createWorkflowNodeFailure(error: unknown, identity: WorkflowNodeFailureIdentity) {\n const modelDetails = safeModelFailureDetails(error)\n const failure = createSixbError(\n \"workflow.node_failed\",\n summarizeErrorMessage(error, \"Workflow node execution failed.\"),\n {\n cause: error,\n details: {\n ...workflowNodeFailureDetails(identity),\n ...modelDetails,\n },\n }\n )\n return modelDetails.modelFailure\n ? withFailureMessage(failure, modelDetails.modelFailure.message)\n : failure\n}\n\n/** Only controlled diagnostics cross the durable boundary; provider messages/output stay private. */\nfunction safeModelFailureDetails(error: unknown): {\n modelFailure?: { source: string; reason: string; message: string; status?: number }\n} {\n if (error instanceof UnsupportedModelFeatureError) {\n const reason = error.reason ?? \"unsupported-feature\"\n const messages = {\n \"unsupported-feature\":\n \"The adapter cannot support a requested model feature. Check provider configuration.\",\n \"unsupported-model\":\n \"The model is configured without structured-output support. Choose a supported model.\",\n \"unsupported-schema\":\n \"The output schema is incompatible with the adapter. Use valid JSON Schema types, require every property, and disallow additional properties.\",\n }\n return { modelFailure: { source: \"adapter\", reason, message: messages[reason] } }\n }\n if (error instanceof ModelProviderError) {\n // Interpret only known machine codes, never provider prose (which can echo private inputs).\n const schemaRejected = error.code === \"invalid_json_schema\" || error.code === \"invalid_schema\"\n const modelRejected = error.code === \"model_not_supported\" || error.code === \"unsupported_model\"\n return {\n modelFailure: {\n source: \"provider\",\n reason: schemaRejected\n ? \"unsupported-schema\"\n : modelRejected\n ? \"unsupported-model\"\n : \"provider-rejection\",\n message: schemaRejected\n ? \"The model endpoint rejected the supplied schema. Check the routed provider's supported JSON Schema subset.\"\n : modelRejected\n ? \"The model endpoint does not support the requested model configuration. Choose a supported model or route.\"\n : \"The model endpoint rejected the request or failed its response. Check provider diagnostics for model, schema, authentication, or availability errors.\",\n ...(error.status === undefined ? {} : { status: error.status }),\n },\n }\n }\n if (error instanceof StructuredOutputError) {\n return {\n modelFailure: {\n source: \"validation\",\n reason: \"invalid-output\",\n message:\n \"The model response did not complete with valid output matching the workflow schema.\",\n },\n }\n }\n return {}\n}\n\n/** Recover the native child error for direct callers and error-monitoring integrations. */\nexport function unwrapWorkflowNodeFailure(error: unknown): unknown {\n return isSixbError(error) && error.code === \"workflow.node_failed\" && error.cause !== undefined\n ? error.cause\n : error\n}\n\nfunction workflowNodeFailureDetails(identity: WorkflowNodeFailureIdentity) {\n const base = {\n workflowId: identity.workflowId,\n workflowRunId: identity.workflowRunId,\n nodeId: identity.nodeId,\n ...(identity.nodeRunId ? { nodeRunId: identity.nodeRunId } : {}),\n ...(identity.failurePhase ? { failurePhase: identity.failurePhase } : {}),\n ...(identity.modelId ? { modelId: identity.modelId } : {}),\n }\n\n switch (identity.child.type) {\n case \"step\":\n return { ...base, stepId: identity.child.stepId }\n case \"action\":\n return {\n ...base,\n actionId: identity.child.actionId,\n ...(identity.child.actionRunId ? { actionRunId: identity.child.actionRunId } : {}),\n }\n case \"agent\":\n return { ...base, agentStepId: identity.child.agentStepId }\n case \"intervention\":\n return { ...base, interventionId: identity.child.interventionId }\n }\n}\n"
8
8
  ],
9
9
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACO,SAAS,yBAAwB,CAAC,YAAoB,QAAwB;AAAA,EACnF,OAAO,YAAY,mBAAmB,UAAU,UAAU,mBAAmB,MAAM;AAAA;;ACqF9E,SAAS,kBAAiB,CAC/B,QACA,SACyB;AAAA,EACzB,OAAO;AAAA,IACL;AAAA,IACA,UAAU,SAAS,YAAY;AAAA,OAC3B,SAAS,gBAAgB,YAAY,EAAE,aAAa,QAAQ,YAAY,IAAI,CAAC;AAAA,EACnF;AAAA;AAGK,SAAS,mBAA4C,CAAC,IAA2B;AAAA,EACtF,eAAe,IAAI,QAAQ,IAAI;AAAA,EAE/B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AAIH,SAAS,0BAAyB,CAAC,OAAyB;AAAA,EACjE,OAAO,aAAY,KAAK,KAAK,MAAM,SAAS,0BAA0B,MAAM,UAAU,YAClF,MAAM,QACN;AAAA;AAGN,SAAS,0BAA0B,CAAC,UAAuC;AAAA,EACzE,MAAM,OAAO;AAAA,IACX,YAAY,SAAS;AAAA,IACrB,eAAe,SAAS;AAAA,IACxB,QAAQ,SAAS;AAAA,OACb,SAAS,YAAY,EAAE,WAAW,SAAS,UAAU,IAAI,CAAC;AAAA,OAC1D,SAAS,eAAe,EAAE,cAAc,SAAS,aAAa,IAAI,CAAC;AAAA,OACnE,SAAS,UAAU,EAAE,SAAS,SAAS,QAAQ,IAAI,CAAC;AAAA,EAC1D;AAAA,EAEA,QAAQ,SAAS,MAAM;AAAA,IACrB,KAAK;AAAA,MACH,OAAO,KAAK,MAAM,QAAQ,SAAS,MAAM,OAAO;AAAA,IAClD,KAAK;AAAA,MACH,OAAO;AAAA,WACF;AAAA,QACH,UAAU,SAAS,MAAM;AAAA,WACrB,SAAS,MAAM,cAAc,EAAE,aAAa,SAAS,MAAM,YAAY,IAAI,CAAC;AAAA,MAClF;AAAA,IACF,KAAK;AAAA,MACH,OAAO,KAAK,MAAM,aAAa,SAAS,MAAM,YAAY;AAAA,IAC5D,KAAK;AAAA,MACH,OAAO,KAAK,MAAM,gBAAgB,SAAS,MAAM,eAAe;AAAA;AAAA;",
10
- "debugId": "C0763B465A2130CB64756E2164756E21",
10
+ "debugId": "E01FC203124534F264756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -3,7 +3,7 @@ import {
3
3
  createPrincipalRuntimeAuthorization,
4
4
  createDisabledRuntimeAuthorization,
5
5
  createDelegatedRuntimeAuthorization
6
- } from "./chunk-twfreyxr.js";
6
+ } from "./chunk-vzkxqf8h.js";
7
7
 
8
8
  // src/execution/scopes.ts
9
9
  import { randomUUID } from "crypto";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  normalizeSchemaValue2,
4
4
  coerceSchemaValueToTyped2
5
- } from "./chunk-djs3hw9p.js";
5
+ } from "./chunk-3zagkr6w.js";
6
6
  import {
7
7
  validateSchemaOrRefValue2
8
- } from "./chunk-e7v3trpz.js";
8
+ } from "./chunk-8a8k38tz.js";
9
9
  import {
10
10
  OntologyValidationError2
11
11
  } from "./chunk-cqr3acm1.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ProjectionValidationError2
4
- } from "./chunk-twfreyxr.js";
4
+ } from "./chunk-vzkxqf8h.js";
5
5
  import {
6
6
  sha256Canonical2
7
7
  } from "./chunk-zrvhsq7f.js";
@@ -9,10 +9,10 @@ import {
9
9
  ProjectionRunError2,
10
10
  assertProjectionRunIdentityMatches2,
11
11
  assertProjectionRunDurableExecution2
12
- } from "./chunk-scyq22td.js";
12
+ } from "./chunk-5rqqp8cr.js";
13
13
  import {
14
14
  createPrimitiveExecutionRecord
15
- } from "./chunk-9whfmsfk.js";
15
+ } from "./chunk-8tqnsx3q.js";
16
16
  import {
17
17
  findPrimitiveRunExecution
18
18
  } from "./chunk-ey1nk510.js";
@@ -259,7 +259,7 @@ async function requireProducerExecution(input) {
259
259
  projectId: input.projectId,
260
260
  executionId: input.executionId,
261
261
  primitive: input.primitive,
262
- sourceTypes: ["execution", "schedule", "event"]
262
+ sourceTypes: ["execution", "schedule", "event", "datasetVersion"]
263
263
  });
264
264
  if (execution)
265
265
  return execution;
@@ -380,4 +380,4 @@ function assertDispatchInput(input) {
380
380
  }
381
381
  export { registerProjectionRegistry2, getProjectionRegistry2, getProjectionDispatchDescriptors2, shareProjectionRegistry2, createProjectionRunId2, PROJECTION_TELEMETRY_BATCH_SIZE2, ProjectionRunDispatcher2 };
382
382
 
383
- //# debugId=E1FE0EDF76192F4364756E2164756E21
383
+ //# debugId=E3D5CD1F7253B5AC64756E2164756E21
@@ -3,10 +3,10 @@
3
3
  "sources": ["../src/projections/capability.ts", "../src/projections/run-dispatch.ts", "../src/projections/run-id.ts"],
4
4
  "sourcesContent": [
5
5
  "import type { ProjectionRegistry } from \"./registry\"\nimport type { ProjectionDispatchDescriptor } from \"./types\"\n\nconst projectionRegistryKey: unique symbol = Symbol(\"sixb.projectionRegistry\")\n\ninterface ProjectionRegistryOwner {\n readonly [projectionRegistryKey]?: ProjectionRegistry\n}\n\nexport function registerProjectionRegistry(owner: object, registry: ProjectionRegistry): void {\n const registered = (owner as ProjectionRegistryOwner)[projectionRegistryKey]\n if (registered && registered !== registry) {\n throw new Error(\"[Sixb] Projection registry is already registered for this owner.\")\n }\n Object.defineProperty(owner, projectionRegistryKey, {\n configurable: false,\n enumerable: false,\n value: registry,\n writable: false,\n })\n}\n\nexport function getProjectionRegistry(owner: object): ProjectionRegistry {\n const registry = (owner as ProjectionRegistryOwner)[projectionRegistryKey]\n if (registry) return registry\n throw new Error(\"[Sixb] Projection registry is not registered for this runtime.\")\n}\n\nexport function getProjectionDispatchDescriptors(\n owner: object\n): readonly ProjectionDispatchDescriptor[] {\n return getProjectionRegistry(owner).getDispatchDescriptors()\n}\n\nexport function shareProjectionRegistry(source: object, target: object): void {\n registerProjectionRegistry(target, getProjectionRegistry(source))\n}\n",
6
- "import { randomUUID } from \"node:crypto\"\nimport type { RunDispatcher } from \"../execution/dispatch\"\nimport { createPrimitiveExecutionRecord } from \"../execution/durable\"\nimport type { DatasetProducer, LakeStorage } from \"../lake-storage\"\nimport type { Queues } from \"../queues\"\nimport type { SixbDefinitions } from \"../runtime/definitions\"\nimport type { ExecutionRecord, ProjectionRunRecord, Storage } from \"../storage\"\nimport { ProjectionRunError } from \"../storage\"\nimport { findPrimitiveRunExecution } from \"../storage/executions/run-link\"\nimport {\n assertProjectionRunDurableExecution,\n assertProjectionRunIdentityMatches,\n} from \"../storage/projection-runs/provider\"\nimport { getProjectionRegistry } from \"./capability\"\nimport { ProjectionValidationError } from \"./errors\"\nimport { createProjectionRunId } from \"./run-id\"\nimport type { ProjectionDefinition } from \"./types\"\n\n/** Target maximum mapped points per telemetry commit; a single-property projection reads 500 rows. */\nexport const PROJECTION_TELEMETRY_BATCH_SIZE = 500\n\nexport interface ProjectionRunDispatchInput {\n readonly projectionId: string\n readonly datasetVersion: {\n readonly datasetId: string\n readonly versionId: string\n readonly createdAt: string\n }\n readonly metadata?: Readonly<Record<string, string>>\n}\n\nexport interface ProjectionRunDispatchResult {\n readonly projectionId: string\n readonly runId: string\n readonly queuedAt: string\n readonly jobId?: string\n readonly created: boolean\n}\n\nexport type ProjectionRunDispatchPort = RunDispatcher<\n ProjectionRunDispatchInput,\n ProjectionRunDispatchResult\n>\n\nexport interface ProjectionRunDispatcherDependencies {\n readonly id: string\n readonly definitions: Pick<SixbDefinitions, \"projections\">\n readonly lakeStorage: Pick<LakeStorage, \"getVersion\">\n readonly storage: Storage\n readonly queues: Pick<Queues, \"projections\">\n}\n\ntype PersistedProjectionRun =\n | { readonly publish: false; readonly run: ProjectionRunRecord }\n | {\n readonly publish: true\n readonly run: ProjectionRunRecord\n readonly queuedAt: Date\n readonly created: boolean\n }\n\n/** Core-owned durable dispatch boundary for immutable dataset-version materialization. */\nexport class ProjectionRunDispatcher implements ProjectionRunDispatchPort {\n constructor(private readonly dependencies: ProjectionRunDispatcherDependencies) {}\n\n async dispatch(input: ProjectionRunDispatchInput): Promise<ProjectionRunDispatchResult> {\n assertDispatchInput(input)\n const registry = getProjectionRegistry(this.dependencies)\n const descriptor = registry.resolveDispatch(input.projectionId)\n if (descriptor.datasetId !== input.datasetVersion.datasetId) {\n throw new ProjectionValidationError(\n `[Sixb] Projection '${input.projectionId}' consumes dataset '${descriptor.datasetId}', not '${input.datasetVersion.datasetId}'.`\n )\n }\n const projection = this.dependencies.definitions.projections.getById(input.projectionId)\n if (!projection) {\n throw new ProjectionValidationError(`[Sixb] Unknown projection '${input.projectionId}'.`)\n }\n\n const { datasetId: _datasetId, ...semanticIdentity } = descriptor\n const identity = {\n ...semanticIdentity,\n datasetVersion: structuredClone(input.datasetVersion),\n }\n const runId = createProjectionRunId(this.dependencies.id, identity)\n const projectionRuns = requireProjectionRunStorage(this.dependencies.storage)\n // Most dispatches repeat an admitted one: the live commit event and the reconciler both\n // dispatch each version. Only admitProjectionRun creates a run, once the lake confirms its\n // version, and the run id hashes that version's dataset, id and creation time. An existing run\n // therefore needs no lake read.\n const existing = await projectionRuns.getById({ projectId: this.dependencies.id, id: runId })\n let persisted = existing\n ? await reuseProjectionRun(this.dependencies, existing, identity)\n : await admitProjectionRun(this.dependencies, input, { runId, identity, projection })\n\n if (!persisted.publish && persisted.run.status === \"queued\") {\n persisted = await reuseProjectionRun(this.dependencies, persisted.run, identity)\n }\n if (!persisted.publish) return existingResult(persisted.run)\n return publishProjectionRun(this.dependencies, input.metadata, persisted)\n }\n}\n\n/** Persists a new run once the lake confirms the dispatched version is one it can materialize. */\nasync function admitProjectionRun(\n dependencies: ProjectionRunDispatcherDependencies,\n input: ProjectionRunDispatchInput,\n run: {\n readonly runId: string\n readonly identity: ProjectionRunRecord[\"identity\"]\n readonly projection: ProjectionDefinition\n }\n): Promise<PersistedProjectionRun> {\n const { datasetId, versionId, createdAt } = input.datasetVersion\n const version = await dependencies.lakeStorage.getVersion(datasetId, versionId)\n if (!version || version.createdAt.toISOString() !== createdAt) {\n throw new ProjectionValidationError(\n `[Sixb] Dataset '${datasetId}' version '${versionId}' does not match its immutable metadata.`\n )\n }\n if (version.mode === \"schema\") {\n throw new ProjectionValidationError(\n `[Sixb] Projection '${input.projectionId}' cannot materialize a schema-only dataset version.`\n )\n }\n return persistProjectionRun({\n dependencies,\n ...run,\n producerExecution: await resolveProducerExecution(\n dependencies.storage,\n dependencies.id,\n version.producer\n ),\n })\n}\n\nasync function persistProjectionRun(input: {\n readonly dependencies: ProjectionRunDispatcherDependencies\n readonly runId: string\n readonly identity: ProjectionRunRecord[\"identity\"]\n readonly projection: ProjectionDefinition\n readonly producerExecution: ExecutionRecord | null\n}): Promise<PersistedProjectionRun> {\n const execution = createPrimitiveExecutionRecord({\n id: `exec_${randomUUID()}`,\n primitive: { kind: \"projection\", id: input.identity.projectionId, runId: input.runId },\n origin: {\n type: \"automatic\",\n projectId: input.dependencies.id,\n source: {\n type: \"datasetVersion\",\n datasetId: input.identity.datasetVersion.datasetId,\n versionId: input.identity.datasetVersion.versionId,\n },\n correlationId: input.producerExecution?.correlationId ?? input.runId,\n requesterGroupIds: input.producerExecution?.requesterGroupIds,\n ...(input.producerExecution?.requestedBy === undefined\n ? {}\n : { requestedBy: input.producerExecution.requestedBy }),\n },\n })\n const queuedAt = new Date()\n\n try {\n return await input.dependencies.storage.transaction(\n async (tx): Promise<PersistedProjectionRun> => {\n const projectionRuns = requireProjectionRunStorage(tx)\n const raced = await projectionRuns.getById({\n projectId: input.dependencies.id,\n id: input.runId,\n })\n if (raced) {\n await assertExistingRun(tx, raced, input.identity)\n return { publish: false, run: raced }\n }\n await tx.executions.create(execution)\n const run = await queueProjectionRun(projectionRuns, {\n id: input.runId,\n projectId: input.dependencies.id,\n executionId: execution.id,\n identity: input.identity,\n projection: input.projection,\n queuedAt,\n })\n return { publish: true, run, queuedAt, created: true }\n },\n { isolation: \"serializable\" }\n )\n } catch (error) {\n if (!(error instanceof ProjectionRunError)) throw error\n const raced = await requireProjectionRunStorage(input.dependencies.storage).getById({\n projectId: input.dependencies.id,\n id: input.runId,\n })\n if (!raced) throw error\n await assertExistingRun(input.dependencies.storage, raced, input.identity)\n return { publish: false, run: raced }\n }\n}\n\nasync function reuseProjectionRun(\n dependencies: ProjectionRunDispatcherDependencies,\n existing: ProjectionRunRecord,\n identity: ProjectionRunRecord[\"identity\"]\n): Promise<PersistedProjectionRun> {\n await assertExistingRun(dependencies.storage, existing, identity)\n if (existing.status === \"queued\") {\n return { publish: true, run: existing, queuedAt: existing.queuedAt, created: false }\n }\n if (\n existing.status !== \"failed\" ||\n existing.error?.code !== \"queue.enqueue_failed\" ||\n !existing.error.retryable\n ) {\n return { publish: false, run: existing }\n }\n const queuedAt = new Date()\n const projectionRuns = requireProjectionRunStorage(dependencies.storage)\n try {\n const run = await requeueProjectionRun(projectionRuns, existing, queuedAt)\n return { publish: true, run, queuedAt, created: false }\n } catch (error) {\n if (!(error instanceof ProjectionRunError)) throw error\n const raced = await projectionRuns.getById({ projectId: existing.projectId, id: existing.id })\n if (\n !raced ||\n (raced.status === \"failed\" &&\n raced.error?.code === \"queue.enqueue_failed\" &&\n raced.error.retryable)\n ) {\n throw error\n }\n await assertExistingRun(dependencies.storage, raced, identity)\n return { publish: false, run: raced }\n }\n}\n\nasync function publishProjectionRun(\n dependencies: ProjectionRunDispatcherDependencies,\n metadata: Readonly<Record<string, string>> | undefined,\n persisted: Extract<PersistedProjectionRun, { readonly publish: true }>\n): Promise<ProjectionRunDispatchResult> {\n // Keep the run queued on uncertain publication; the caller retries the same identity.\n const [job] = await dependencies.queues.projections.enqueue({\n projectId: dependencies.id,\n jobs: [\n {\n id: persisted.run.id,\n type: \"projection.run.requested\",\n payload: { runId: persisted.run.id },\n ...(metadata === undefined ? {} : { metadata }),\n },\n ],\n })\n if (!job || job.id !== persisted.run.id) {\n throw new ProjectionRunError(\n `[Sixb] Queue did not acknowledge Projection run '${persisted.run.id}'.`\n )\n }\n return {\n projectionId: persisted.run.identity.projectionId,\n runId: persisted.run.id,\n queuedAt: persisted.queuedAt.toISOString(),\n ...(job?.id ? { jobId: job.id } : {}),\n created: persisted.created,\n }\n}\n\nasync function assertExistingRun(\n storage: Storage,\n run: ProjectionRunRecord,\n identity: ProjectionRunRecord[\"identity\"]\n): Promise<void> {\n assertProjectionRunIdentityMatches(run, identity)\n await assertProjectionRunDurableExecution({\n executions: storage.executions,\n projectId: run.projectId,\n executionId: run.executionId,\n runId: run.id,\n projectionId: run.identity.projectionId,\n datasetId: run.identity.datasetVersion.datasetId,\n datasetVersionId: run.identity.datasetVersion.versionId,\n })\n}\n\nasync function resolveProducerExecution(\n storage: Storage,\n projectId: string,\n producer: DatasetProducer | undefined\n): Promise<ExecutionRecord | null> {\n if (producer?.kind === \"ingest\") {\n return producer.id ? storage.executions.getById({ projectId, id: producer.id }) : null\n }\n if (!producer?.runId) return null\n if (producer.kind === \"sync\") {\n const run = await storage.syncRuns?.getById({ projectId, id: producer.runId })\n if (!run) return null\n assertProducerId(producer, run.syncId)\n return requireProducerExecution({\n executions: storage.executions,\n projectId,\n executionId: run.executionId,\n primitive: { kind: \"sync\", id: run.syncId, runId: run.id },\n })\n }\n\n const run = await storage.pipelineRuns?.getById({ projectId, id: producer.runId })\n if (!run) return null\n assertProducerId(producer, run.pipelineId)\n return requireProducerExecution({\n executions: storage.executions,\n projectId,\n executionId: run.executionId,\n primitive: { kind: \"pipeline\", id: run.pipelineId, runId: run.id },\n })\n}\n\nasync function requireProducerExecution(input: {\n readonly executions: Storage[\"executions\"]\n readonly projectId: string\n readonly executionId: string\n readonly primitive:\n | { readonly kind: \"sync\"; readonly id: string; readonly runId: string }\n | { readonly kind: \"pipeline\"; readonly id: string; readonly runId: string }\n}): Promise<ExecutionRecord> {\n const execution = await findPrimitiveRunExecution({\n executions: input.executions,\n projectId: input.projectId,\n executionId: input.executionId,\n primitive: input.primitive,\n sourceTypes: [\"execution\", \"schedule\", \"event\"],\n })\n if (execution) return execution\n throw new ProjectionValidationError(\n `[Sixb] Dataset producer run '${input.primitive.runId}' references an invalid execution.`\n )\n}\n\nfunction assertProducerId(producer: DatasetProducer, runOwnerId: string): void {\n if (producer.id === undefined || producer.id === runOwnerId) return\n throw new ProjectionValidationError(\n `[Sixb] Dataset producer '${producer.kind}:${producer.id}' does not match run '${producer.runId}'.`\n )\n}\n\nfunction requireProjectionRunStorage(storage: Storage): NonNullable<Storage[\"projectionRuns\"]> {\n if (storage.projectionRuns) return storage.projectionRuns\n throw new ProjectionValidationError(\"[Sixb] Projection run storage is not configured.\")\n}\n\nfunction queueProjectionRun(\n storage: NonNullable<Storage[\"projectionRuns\"]>,\n input: {\n readonly id: string\n readonly projectId: string\n readonly executionId: string\n readonly identity: ProjectionRunRecord[\"identity\"]\n readonly projection: ProjectionDefinition\n readonly queuedAt: Date\n }\n): Promise<ProjectionRunRecord> {\n const common = {\n id: input.id,\n projectId: input.projectId,\n executionId: input.executionId,\n queuedAt: input.queuedAt,\n }\n switch (input.projection._tag) {\n case \"ObjectProjectionDefinition\":\n if (input.identity.projectionKind !== \"object\") {\n throw invalidProjectionDefinition(input.id)\n }\n return storage.queue({\n ...common,\n identity: input.identity,\n target: { objectTypeId: input.projection.objectTypeId },\n })\n case \"LinkProjectionDefinition\":\n if (input.identity.projectionKind !== \"link\") {\n throw invalidProjectionDefinition(input.id)\n }\n return storage.queue({\n ...common,\n identity: input.identity,\n target: {\n sourceObjectTypeId: input.projection.sourceObjectTypeId,\n targetObjectTypeId: input.projection.targetObjectTypeId,\n },\n })\n case \"TelemetryProjectionDefinition\":\n if (input.identity.projectionKind !== \"telemetry\") {\n throw invalidProjectionDefinition(input.id)\n }\n return storage.queue({\n ...common,\n identity: input.identity,\n target: { objectTypeId: input.projection.objectTypeId },\n fixedBatchSize: telemetryProjectionBatchRowCount(input.projection),\n })\n }\n}\n\nfunction telemetryProjectionBatchRowCount(\n projection: Extract<ProjectionDefinition, { readonly _tag: \"TelemetryProjectionDefinition\" }>\n): number {\n const mappedPropertyCount = Object.keys(projection.properties).length\n if (mappedPropertyCount === 0) throw invalidProjectionDefinition(projection.id)\n return Math.max(1, Math.floor(PROJECTION_TELEMETRY_BATCH_SIZE / mappedPropertyCount))\n}\n\nfunction requeueProjectionRun(\n storage: NonNullable<Storage[\"projectionRuns\"]>,\n run: ProjectionRunRecord,\n queuedAt: Date\n): Promise<ProjectionRunRecord> {\n const common = {\n id: run.id,\n projectId: run.projectId,\n executionId: run.executionId,\n queuedAt,\n }\n switch (run.identity.projectionKind) {\n case \"object\": {\n if (!(\"objectTypeId\" in run.target)) throw invalidProjectionDefinition(run.id)\n return storage.queue({ ...common, identity: run.identity, target: run.target })\n }\n case \"link\": {\n if (!(\"sourceObjectTypeId\" in run.target)) throw invalidProjectionDefinition(run.id)\n return storage.queue({ ...common, identity: run.identity, target: run.target })\n }\n case \"telemetry\": {\n if (!(\"objectTypeId\" in run.target) || !run.telemetryCheckpoint) {\n throw invalidProjectionDefinition(run.id)\n }\n return storage.queue({\n ...common,\n identity: run.identity,\n target: run.target,\n fixedBatchSize: run.telemetryCheckpoint.fixedBatchSize,\n })\n }\n }\n}\n\nfunction invalidProjectionDefinition(runId: string): ProjectionValidationError {\n return new ProjectionValidationError(\n `[Sixb] Projection run '${runId}' has inconsistent definition metadata.`\n )\n}\n\nfunction existingResult(run: ProjectionRunRecord): ProjectionRunDispatchResult {\n return {\n projectionId: run.identity.projectionId,\n runId: run.id,\n queuedAt: run.queuedAt.toISOString(),\n created: false,\n }\n}\n\nfunction assertDispatchInput(input: ProjectionRunDispatchInput): void {\n for (const [field, value] of [\n [\"projectionId\", input.projectionId],\n [\"datasetId\", input.datasetVersion.datasetId],\n [\"versionId\", input.datasetVersion.versionId],\n ] as const) {\n if (!value.trim())\n throw new ProjectionValidationError(`[Sixb] Projection ${field} is required.`)\n }\n const timestamp = Date.parse(input.datasetVersion.createdAt)\n if (\n !Number.isFinite(timestamp) ||\n new Date(timestamp).toISOString() !== input.datasetVersion.createdAt\n ) {\n throw new ProjectionValidationError(\"[Sixb] Projection dataset version timestamp is invalid.\")\n }\n}\n",
6
+ "import { randomUUID } from \"node:crypto\"\nimport type { RunDispatcher } from \"../execution/dispatch\"\nimport { createPrimitiveExecutionRecord } from \"../execution/durable\"\nimport type { DatasetProducer, LakeStorage } from \"../lake-storage\"\nimport type { Queues } from \"../queues\"\nimport type { SixbDefinitions } from \"../runtime/definitions\"\nimport type { ExecutionRecord, ProjectionRunRecord, Storage } from \"../storage\"\nimport { ProjectionRunError } from \"../storage\"\nimport { findPrimitiveRunExecution } from \"../storage/executions/run-link\"\nimport {\n assertProjectionRunDurableExecution,\n assertProjectionRunIdentityMatches,\n} from \"../storage/projection-runs/provider\"\nimport { getProjectionRegistry } from \"./capability\"\nimport { ProjectionValidationError } from \"./errors\"\nimport { createProjectionRunId } from \"./run-id\"\nimport type { ProjectionDefinition } from \"./types\"\n\n/** Target maximum mapped points per telemetry commit; a single-property projection reads 500 rows. */\nexport const PROJECTION_TELEMETRY_BATCH_SIZE = 500\n\nexport interface ProjectionRunDispatchInput {\n readonly projectionId: string\n readonly datasetVersion: {\n readonly datasetId: string\n readonly versionId: string\n readonly createdAt: string\n }\n readonly metadata?: Readonly<Record<string, string>>\n}\n\nexport interface ProjectionRunDispatchResult {\n readonly projectionId: string\n readonly runId: string\n readonly queuedAt: string\n readonly jobId?: string\n readonly created: boolean\n}\n\nexport type ProjectionRunDispatchPort = RunDispatcher<\n ProjectionRunDispatchInput,\n ProjectionRunDispatchResult\n>\n\nexport interface ProjectionRunDispatcherDependencies {\n readonly id: string\n readonly definitions: Pick<SixbDefinitions, \"projections\">\n readonly lakeStorage: Pick<LakeStorage, \"getVersion\">\n readonly storage: Storage\n readonly queues: Pick<Queues, \"projections\">\n}\n\ntype PersistedProjectionRun =\n | { readonly publish: false; readonly run: ProjectionRunRecord }\n | {\n readonly publish: true\n readonly run: ProjectionRunRecord\n readonly queuedAt: Date\n readonly created: boolean\n }\n\n/** Core-owned durable dispatch boundary for immutable dataset-version materialization. */\nexport class ProjectionRunDispatcher implements ProjectionRunDispatchPort {\n constructor(private readonly dependencies: ProjectionRunDispatcherDependencies) {}\n\n async dispatch(input: ProjectionRunDispatchInput): Promise<ProjectionRunDispatchResult> {\n assertDispatchInput(input)\n const registry = getProjectionRegistry(this.dependencies)\n const descriptor = registry.resolveDispatch(input.projectionId)\n if (descriptor.datasetId !== input.datasetVersion.datasetId) {\n throw new ProjectionValidationError(\n `[Sixb] Projection '${input.projectionId}' consumes dataset '${descriptor.datasetId}', not '${input.datasetVersion.datasetId}'.`\n )\n }\n const projection = this.dependencies.definitions.projections.getById(input.projectionId)\n if (!projection) {\n throw new ProjectionValidationError(`[Sixb] Unknown projection '${input.projectionId}'.`)\n }\n\n const { datasetId: _datasetId, ...semanticIdentity } = descriptor\n const identity = {\n ...semanticIdentity,\n datasetVersion: structuredClone(input.datasetVersion),\n }\n const runId = createProjectionRunId(this.dependencies.id, identity)\n const projectionRuns = requireProjectionRunStorage(this.dependencies.storage)\n // Most dispatches repeat an admitted one: the live commit event and the reconciler both\n // dispatch each version. Only admitProjectionRun creates a run, once the lake confirms its\n // version, and the run id hashes that version's dataset, id and creation time. An existing run\n // therefore needs no lake read.\n const existing = await projectionRuns.getById({ projectId: this.dependencies.id, id: runId })\n let persisted = existing\n ? await reuseProjectionRun(this.dependencies, existing, identity)\n : await admitProjectionRun(this.dependencies, input, { runId, identity, projection })\n\n if (!persisted.publish && persisted.run.status === \"queued\") {\n persisted = await reuseProjectionRun(this.dependencies, persisted.run, identity)\n }\n if (!persisted.publish) return existingResult(persisted.run)\n return publishProjectionRun(this.dependencies, input.metadata, persisted)\n }\n}\n\n/** Persists a new run once the lake confirms the dispatched version is one it can materialize. */\nasync function admitProjectionRun(\n dependencies: ProjectionRunDispatcherDependencies,\n input: ProjectionRunDispatchInput,\n run: {\n readonly runId: string\n readonly identity: ProjectionRunRecord[\"identity\"]\n readonly projection: ProjectionDefinition\n }\n): Promise<PersistedProjectionRun> {\n const { datasetId, versionId, createdAt } = input.datasetVersion\n const version = await dependencies.lakeStorage.getVersion(datasetId, versionId)\n if (!version || version.createdAt.toISOString() !== createdAt) {\n throw new ProjectionValidationError(\n `[Sixb] Dataset '${datasetId}' version '${versionId}' does not match its immutable metadata.`\n )\n }\n if (version.mode === \"schema\") {\n throw new ProjectionValidationError(\n `[Sixb] Projection '${input.projectionId}' cannot materialize a schema-only dataset version.`\n )\n }\n return persistProjectionRun({\n dependencies,\n ...run,\n producerExecution: await resolveProducerExecution(\n dependencies.storage,\n dependencies.id,\n version.producer\n ),\n })\n}\n\nasync function persistProjectionRun(input: {\n readonly dependencies: ProjectionRunDispatcherDependencies\n readonly runId: string\n readonly identity: ProjectionRunRecord[\"identity\"]\n readonly projection: ProjectionDefinition\n readonly producerExecution: ExecutionRecord | null\n}): Promise<PersistedProjectionRun> {\n const execution = createPrimitiveExecutionRecord({\n id: `exec_${randomUUID()}`,\n primitive: { kind: \"projection\", id: input.identity.projectionId, runId: input.runId },\n origin: {\n type: \"automatic\",\n projectId: input.dependencies.id,\n source: {\n type: \"datasetVersion\",\n datasetId: input.identity.datasetVersion.datasetId,\n versionId: input.identity.datasetVersion.versionId,\n },\n correlationId: input.producerExecution?.correlationId ?? input.runId,\n requesterGroupIds: input.producerExecution?.requesterGroupIds,\n ...(input.producerExecution?.requestedBy === undefined\n ? {}\n : { requestedBy: input.producerExecution.requestedBy }),\n },\n })\n const queuedAt = new Date()\n\n try {\n return await input.dependencies.storage.transaction(\n async (tx): Promise<PersistedProjectionRun> => {\n const projectionRuns = requireProjectionRunStorage(tx)\n const raced = await projectionRuns.getById({\n projectId: input.dependencies.id,\n id: input.runId,\n })\n if (raced) {\n await assertExistingRun(tx, raced, input.identity)\n return { publish: false, run: raced }\n }\n await tx.executions.create(execution)\n const run = await queueProjectionRun(projectionRuns, {\n id: input.runId,\n projectId: input.dependencies.id,\n executionId: execution.id,\n identity: input.identity,\n projection: input.projection,\n queuedAt,\n })\n return { publish: true, run, queuedAt, created: true }\n },\n { isolation: \"serializable\" }\n )\n } catch (error) {\n if (!(error instanceof ProjectionRunError)) throw error\n const raced = await requireProjectionRunStorage(input.dependencies.storage).getById({\n projectId: input.dependencies.id,\n id: input.runId,\n })\n if (!raced) throw error\n await assertExistingRun(input.dependencies.storage, raced, input.identity)\n return { publish: false, run: raced }\n }\n}\n\nasync function reuseProjectionRun(\n dependencies: ProjectionRunDispatcherDependencies,\n existing: ProjectionRunRecord,\n identity: ProjectionRunRecord[\"identity\"]\n): Promise<PersistedProjectionRun> {\n await assertExistingRun(dependencies.storage, existing, identity)\n if (existing.status === \"queued\") {\n return { publish: true, run: existing, queuedAt: existing.queuedAt, created: false }\n }\n if (\n existing.status !== \"failed\" ||\n existing.error?.code !== \"queue.enqueue_failed\" ||\n !existing.error.retryable\n ) {\n return { publish: false, run: existing }\n }\n const queuedAt = new Date()\n const projectionRuns = requireProjectionRunStorage(dependencies.storage)\n try {\n const run = await requeueProjectionRun(projectionRuns, existing, queuedAt)\n return { publish: true, run, queuedAt, created: false }\n } catch (error) {\n if (!(error instanceof ProjectionRunError)) throw error\n const raced = await projectionRuns.getById({ projectId: existing.projectId, id: existing.id })\n if (\n !raced ||\n (raced.status === \"failed\" &&\n raced.error?.code === \"queue.enqueue_failed\" &&\n raced.error.retryable)\n ) {\n throw error\n }\n await assertExistingRun(dependencies.storage, raced, identity)\n return { publish: false, run: raced }\n }\n}\n\nasync function publishProjectionRun(\n dependencies: ProjectionRunDispatcherDependencies,\n metadata: Readonly<Record<string, string>> | undefined,\n persisted: Extract<PersistedProjectionRun, { readonly publish: true }>\n): Promise<ProjectionRunDispatchResult> {\n // Keep the run queued on uncertain publication; the caller retries the same identity.\n const [job] = await dependencies.queues.projections.enqueue({\n projectId: dependencies.id,\n jobs: [\n {\n id: persisted.run.id,\n type: \"projection.run.requested\",\n payload: { runId: persisted.run.id },\n ...(metadata === undefined ? {} : { metadata }),\n },\n ],\n })\n if (!job || job.id !== persisted.run.id) {\n throw new ProjectionRunError(\n `[Sixb] Queue did not acknowledge Projection run '${persisted.run.id}'.`\n )\n }\n return {\n projectionId: persisted.run.identity.projectionId,\n runId: persisted.run.id,\n queuedAt: persisted.queuedAt.toISOString(),\n ...(job?.id ? { jobId: job.id } : {}),\n created: persisted.created,\n }\n}\n\nasync function assertExistingRun(\n storage: Storage,\n run: ProjectionRunRecord,\n identity: ProjectionRunRecord[\"identity\"]\n): Promise<void> {\n assertProjectionRunIdentityMatches(run, identity)\n await assertProjectionRunDurableExecution({\n executions: storage.executions,\n projectId: run.projectId,\n executionId: run.executionId,\n runId: run.id,\n projectionId: run.identity.projectionId,\n datasetId: run.identity.datasetVersion.datasetId,\n datasetVersionId: run.identity.datasetVersion.versionId,\n })\n}\n\nasync function resolveProducerExecution(\n storage: Storage,\n projectId: string,\n producer: DatasetProducer | undefined\n): Promise<ExecutionRecord | null> {\n if (producer?.kind === \"ingest\") {\n return producer.id ? storage.executions.getById({ projectId, id: producer.id }) : null\n }\n if (!producer?.runId) return null\n if (producer.kind === \"sync\") {\n const run = await storage.syncRuns?.getById({ projectId, id: producer.runId })\n if (!run) return null\n assertProducerId(producer, run.syncId)\n return requireProducerExecution({\n executions: storage.executions,\n projectId,\n executionId: run.executionId,\n primitive: { kind: \"sync\", id: run.syncId, runId: run.id },\n })\n }\n\n const run = await storage.pipelineRuns?.getById({ projectId, id: producer.runId })\n if (!run) return null\n assertProducerId(producer, run.pipelineId)\n return requireProducerExecution({\n executions: storage.executions,\n projectId,\n executionId: run.executionId,\n primitive: { kind: \"pipeline\", id: run.pipelineId, runId: run.id },\n })\n}\n\nasync function requireProducerExecution(input: {\n readonly executions: Storage[\"executions\"]\n readonly projectId: string\n readonly executionId: string\n readonly primitive:\n | { readonly kind: \"sync\"; readonly id: string; readonly runId: string }\n | { readonly kind: \"pipeline\"; readonly id: string; readonly runId: string }\n}): Promise<ExecutionRecord> {\n const execution = await findPrimitiveRunExecution({\n executions: input.executions,\n projectId: input.projectId,\n executionId: input.executionId,\n primitive: input.primitive,\n sourceTypes: [\"execution\", \"schedule\", \"event\", \"datasetVersion\"],\n })\n if (execution) return execution\n throw new ProjectionValidationError(\n `[Sixb] Dataset producer run '${input.primitive.runId}' references an invalid execution.`\n )\n}\n\nfunction assertProducerId(producer: DatasetProducer, runOwnerId: string): void {\n if (producer.id === undefined || producer.id === runOwnerId) return\n throw new ProjectionValidationError(\n `[Sixb] Dataset producer '${producer.kind}:${producer.id}' does not match run '${producer.runId}'.`\n )\n}\n\nfunction requireProjectionRunStorage(storage: Storage): NonNullable<Storage[\"projectionRuns\"]> {\n if (storage.projectionRuns) return storage.projectionRuns\n throw new ProjectionValidationError(\"[Sixb] Projection run storage is not configured.\")\n}\n\nfunction queueProjectionRun(\n storage: NonNullable<Storage[\"projectionRuns\"]>,\n input: {\n readonly id: string\n readonly projectId: string\n readonly executionId: string\n readonly identity: ProjectionRunRecord[\"identity\"]\n readonly projection: ProjectionDefinition\n readonly queuedAt: Date\n }\n): Promise<ProjectionRunRecord> {\n const common = {\n id: input.id,\n projectId: input.projectId,\n executionId: input.executionId,\n queuedAt: input.queuedAt,\n }\n switch (input.projection._tag) {\n case \"ObjectProjectionDefinition\":\n if (input.identity.projectionKind !== \"object\") {\n throw invalidProjectionDefinition(input.id)\n }\n return storage.queue({\n ...common,\n identity: input.identity,\n target: { objectTypeId: input.projection.objectTypeId },\n })\n case \"LinkProjectionDefinition\":\n if (input.identity.projectionKind !== \"link\") {\n throw invalidProjectionDefinition(input.id)\n }\n return storage.queue({\n ...common,\n identity: input.identity,\n target: {\n sourceObjectTypeId: input.projection.sourceObjectTypeId,\n targetObjectTypeId: input.projection.targetObjectTypeId,\n },\n })\n case \"TelemetryProjectionDefinition\":\n if (input.identity.projectionKind !== \"telemetry\") {\n throw invalidProjectionDefinition(input.id)\n }\n return storage.queue({\n ...common,\n identity: input.identity,\n target: { objectTypeId: input.projection.objectTypeId },\n fixedBatchSize: telemetryProjectionBatchRowCount(input.projection),\n })\n }\n}\n\nfunction telemetryProjectionBatchRowCount(\n projection: Extract<ProjectionDefinition, { readonly _tag: \"TelemetryProjectionDefinition\" }>\n): number {\n const mappedPropertyCount = Object.keys(projection.properties).length\n if (mappedPropertyCount === 0) throw invalidProjectionDefinition(projection.id)\n return Math.max(1, Math.floor(PROJECTION_TELEMETRY_BATCH_SIZE / mappedPropertyCount))\n}\n\nfunction requeueProjectionRun(\n storage: NonNullable<Storage[\"projectionRuns\"]>,\n run: ProjectionRunRecord,\n queuedAt: Date\n): Promise<ProjectionRunRecord> {\n const common = {\n id: run.id,\n projectId: run.projectId,\n executionId: run.executionId,\n queuedAt,\n }\n switch (run.identity.projectionKind) {\n case \"object\": {\n if (!(\"objectTypeId\" in run.target)) throw invalidProjectionDefinition(run.id)\n return storage.queue({ ...common, identity: run.identity, target: run.target })\n }\n case \"link\": {\n if (!(\"sourceObjectTypeId\" in run.target)) throw invalidProjectionDefinition(run.id)\n return storage.queue({ ...common, identity: run.identity, target: run.target })\n }\n case \"telemetry\": {\n if (!(\"objectTypeId\" in run.target) || !run.telemetryCheckpoint) {\n throw invalidProjectionDefinition(run.id)\n }\n return storage.queue({\n ...common,\n identity: run.identity,\n target: run.target,\n fixedBatchSize: run.telemetryCheckpoint.fixedBatchSize,\n })\n }\n }\n}\n\nfunction invalidProjectionDefinition(runId: string): ProjectionValidationError {\n return new ProjectionValidationError(\n `[Sixb] Projection run '${runId}' has inconsistent definition metadata.`\n )\n}\n\nfunction existingResult(run: ProjectionRunRecord): ProjectionRunDispatchResult {\n return {\n projectionId: run.identity.projectionId,\n runId: run.id,\n queuedAt: run.queuedAt.toISOString(),\n created: false,\n }\n}\n\nfunction assertDispatchInput(input: ProjectionRunDispatchInput): void {\n for (const [field, value] of [\n [\"projectionId\", input.projectionId],\n [\"datasetId\", input.datasetVersion.datasetId],\n [\"versionId\", input.datasetVersion.versionId],\n ] as const) {\n if (!value.trim())\n throw new ProjectionValidationError(`[Sixb] Projection ${field} is required.`)\n }\n const timestamp = Date.parse(input.datasetVersion.createdAt)\n if (\n !Number.isFinite(timestamp) ||\n new Date(timestamp).toISOString() !== input.datasetVersion.createdAt\n ) {\n throw new ProjectionValidationError(\"[Sixb] Projection dataset version timestamp is invalid.\")\n }\n}\n",
7
7
  "import { sha256Canonical } from \"../materialization/identity\"\nimport type { ProjectionMaterializationIdentity } from \"../materialization/model\"\n\nexport function createProjectionRunId(\n projectId: string,\n identity: ProjectionMaterializationIdentity\n): string {\n return sha256Canonical({\n projectId,\n projectionId: identity.projectionId,\n projectionKind: identity.projectionKind,\n protocol: identity.protocol,\n datasetId: identity.datasetVersion.datasetId,\n versionId: identity.datasetVersion.versionId,\n createdAt: identity.datasetVersion.createdAt,\n ontologyRevision: identity.ontologyRevision,\n projectionRevision: identity.projectionRevision,\n ownershipHash: identity.ownershipHash,\n })\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AM,eAAe,SAAS;AAAA,EAC3D,IACE,CAAC,OAAO,SAAS,SAAS,KAC1B,IAAI,KAAK,SAAS,EAAE,YAAY,MAAM,MAAM,eAAe,WAC3D;AAAA,IACA,MAAM,IAAI,2BAA0B,yDAAyD;AAAA,EAC/F;AAAA;",
10
+ "debugId": "E3D5CD1F7253B5AC64756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -2,11 +2,7 @@
2
2
  import {
3
3
  eventSelectorSpec2,
4
4
  buildEventSelectorPredicate2
5
- } from "./chunk-s038wa5v.js";
6
- import {
7
- ScheduleValidationError2,
8
- createCronMatcher2
9
- } from "./chunk-fb3feg1e.js";
5
+ } from "./chunk-b9qfh2ya.js";
10
6
  import {
11
7
  isDecimalValue2,
12
8
  compareDecimalValues2
@@ -274,6 +270,139 @@ function compareOrderedValues(left, right, matches) {
274
270
  }
275
271
  return false;
276
272
  }
273
+ // src/schedules/errors.ts
274
+ class ScheduleValidationError2 extends Error {
275
+ name = "ScheduleValidationError";
276
+ }
277
+
278
+ class CronValidationError2 extends Error {
279
+ name = "CronValidationError";
280
+ }
281
+
282
+ // src/schedules/cron.ts
283
+ function parseInteger(input, fieldName) {
284
+ if (!/^\d+$/.test(input)) {
285
+ throw new CronValidationError2(`Invalid ${fieldName}: '${input}'.`);
286
+ }
287
+ return Number.parseInt(input, 10);
288
+ }
289
+ function createCronFieldMatcher2(params) {
290
+ const { field, min, max, fieldName } = params;
291
+ const normalize = params.normalize ?? ((value) => value);
292
+ const input = field.trim();
293
+ if (!input) {
294
+ throw new CronValidationError2(`Empty cron ${fieldName} field.`);
295
+ }
296
+ if (input === "*") {
297
+ return {
298
+ isAny: true,
299
+ values: null,
300
+ matches: () => true
301
+ };
302
+ }
303
+ const allowed = new Set;
304
+ const segments = input.split(",");
305
+ for (const segment of segments) {
306
+ if (!segment) {
307
+ throw new CronValidationError2(`Invalid cron ${fieldName} field: '${input}'.`);
308
+ }
309
+ const stepParts = segment.split("/");
310
+ if (stepParts.length > 2) {
311
+ throw new CronValidationError2(`Invalid cron ${fieldName} segment: '${segment}'.`);
312
+ }
313
+ const base = stepParts[0];
314
+ const step = stepParts[1] === undefined ? 1 : parseInteger(stepParts[1], `cron ${fieldName} step for '${segment}'`);
315
+ if (step <= 0) {
316
+ throw new CronValidationError2(`Cron ${fieldName} step must be > 0 in segment '${segment}'.`);
317
+ }
318
+ let rangeStart;
319
+ let rangeEnd;
320
+ if (base === "*") {
321
+ rangeStart = min;
322
+ rangeEnd = max;
323
+ } else if (base.includes("-")) {
324
+ const [rawStart, rawEnd] = base.split("-");
325
+ if (!rawStart || !rawEnd) {
326
+ throw new CronValidationError2(`Invalid cron ${fieldName} range: '${base}'.`);
327
+ }
328
+ rangeStart = parseInteger(rawStart, `cron ${fieldName} range start for '${base}'`);
329
+ rangeEnd = parseInteger(rawEnd, `cron ${fieldName} range end for '${base}'`);
330
+ } else {
331
+ const value = parseInteger(base, `cron ${fieldName} value '${base}'`);
332
+ rangeStart = value;
333
+ rangeEnd = value;
334
+ }
335
+ if (rangeStart > rangeEnd) {
336
+ throw new CronValidationError2(`Cron ${fieldName} range start must be <= end in segment '${segment}'.`);
337
+ }
338
+ for (let value = rangeStart;value <= rangeEnd; value += step) {
339
+ const normalized = normalize(value);
340
+ if (normalized < min || normalized > max) {
341
+ throw new CronValidationError2(`Cron ${fieldName} value ${value} is outside range ${min}-${max}.`);
342
+ }
343
+ allowed.add(normalized);
344
+ }
345
+ }
346
+ return {
347
+ isAny: false,
348
+ values: allowed,
349
+ matches(value) {
350
+ const normalized = normalize(value);
351
+ return allowed.has(normalized);
352
+ }
353
+ };
354
+ }
355
+ function createCronMatcher2(expression) {
356
+ const parts = expression.trim().split(/\s+/);
357
+ if (parts.length !== 5) {
358
+ throw new CronValidationError2(`Invalid cron expression '${expression}'. Expected 5 fields (minute hour day month weekday).`);
359
+ }
360
+ const [minuteField, hourField, dayOfMonthField, monthField, dayOfWeekField] = parts;
361
+ const minute = createCronFieldMatcher2({
362
+ field: minuteField,
363
+ min: 0,
364
+ max: 59,
365
+ fieldName: "minute"
366
+ });
367
+ const hour = createCronFieldMatcher2({
368
+ field: hourField,
369
+ min: 0,
370
+ max: 23,
371
+ fieldName: "hour"
372
+ });
373
+ const dayOfMonth = createCronFieldMatcher2({
374
+ field: dayOfMonthField,
375
+ min: 1,
376
+ max: 31,
377
+ fieldName: "day-of-month"
378
+ });
379
+ const month = createCronFieldMatcher2({
380
+ field: monthField,
381
+ min: 1,
382
+ max: 12,
383
+ fieldName: "month"
384
+ });
385
+ const dayOfWeek = createCronFieldMatcher2({
386
+ field: dayOfWeekField,
387
+ min: 0,
388
+ max: 6,
389
+ fieldName: "day-of-week",
390
+ normalize: (value) => value === 7 ? 0 : value
391
+ });
392
+ return (now) => {
393
+ if (!minute.matches(now.getMinutes()))
394
+ return false;
395
+ if (!hour.matches(now.getHours()))
396
+ return false;
397
+ if (!month.matches(now.getMonth() + 1))
398
+ return false;
399
+ const dayOfMonthMatches = dayOfMonth.matches(now.getDate());
400
+ const dayOfWeekMatches = dayOfWeek.matches(now.getDay());
401
+ const dayMatches = dayOfMonth.isAny || dayOfWeek.isAny ? dayOfMonthMatches && dayOfWeekMatches : dayOfMonthMatches || dayOfWeekMatches;
402
+ return dayMatches;
403
+ };
404
+ }
405
+
277
406
  // src/schedules/builders.ts
278
407
  function assertNonEmpty(value, field) {
279
408
  if (!value.trim()) {
@@ -439,6 +568,166 @@ function defineSchedule2(id) {
439
568
  }
440
569
  };
441
570
  }
571
+ // src/schedules/next-occurrence.ts
572
+ var MAX_SEARCH_MS = 4 * 365.25 * 24 * 60 * 60 * 1000;
573
+ var timezoneFormatterCache = new Map;
574
+ function getTimezoneFormatter(timezone) {
575
+ let formatter = timezoneFormatterCache.get(timezone);
576
+ if (!formatter) {
577
+ formatter = new Intl.DateTimeFormat("en-US", {
578
+ timeZone: timezone,
579
+ year: "numeric",
580
+ month: "numeric",
581
+ day: "numeric",
582
+ hour: "numeric",
583
+ minute: "numeric",
584
+ weekday: "short",
585
+ hour12: false
586
+ });
587
+ timezoneFormatterCache.set(timezone, formatter);
588
+ }
589
+ return formatter;
590
+ }
591
+ function getLocalComponents(date, timezone) {
592
+ if (timezone === undefined) {
593
+ return {
594
+ minute: date.getUTCMinutes(),
595
+ hour: date.getUTCHours(),
596
+ dayOfMonth: date.getUTCDate(),
597
+ month: date.getUTCMonth() + 1,
598
+ dayOfWeek: date.getUTCDay()
599
+ };
600
+ }
601
+ const formatter = getTimezoneFormatter(timezone);
602
+ const parts = formatter.formatToParts(date);
603
+ const get = (type) => {
604
+ const part = parts.find((p) => p.type === type);
605
+ if (!part)
606
+ throw new CronValidationError2(`Failed to extract ${type} for timezone ${timezone}.`);
607
+ return part.value;
608
+ };
609
+ const weekdayStr = get("weekday");
610
+ const weekdayMap = {
611
+ Sun: 0,
612
+ Mon: 1,
613
+ Tue: 2,
614
+ Wed: 3,
615
+ Thu: 4,
616
+ Fri: 5,
617
+ Sat: 6
618
+ };
619
+ return {
620
+ minute: Number.parseInt(get("minute"), 10),
621
+ hour: Number.parseInt(get("hour"), 10) % 24,
622
+ dayOfMonth: Number.parseInt(get("day"), 10),
623
+ month: Number.parseInt(get("month"), 10),
624
+ dayOfWeek: weekdayMap[weekdayStr] ?? 0
625
+ };
626
+ }
627
+ function matchesDay(dayOfMonth, dayOfWeek, comp) {
628
+ const domMatches = dayOfMonth.matches(comp.dayOfMonth);
629
+ const dowMatches = dayOfWeek.matches(comp.dayOfWeek);
630
+ if (dayOfMonth.isAny || dayOfWeek.isAny) {
631
+ return domMatches && dowMatches;
632
+ }
633
+ return domMatches || dowMatches;
634
+ }
635
+ function nextCronOccurrence2(expression, after, timezone) {
636
+ const parts = expression.trim().split(/\s+/);
637
+ if (parts.length !== 5) {
638
+ throw new CronValidationError2(`Invalid cron expression '${expression}'. Expected 5 fields (minute hour day month weekday).`);
639
+ }
640
+ const [minuteField, hourField, dayOfMonthField, monthField, dayOfWeekField] = parts;
641
+ const minuteMatcher = createCronFieldMatcher2({
642
+ field: minuteField,
643
+ min: 0,
644
+ max: 59,
645
+ fieldName: "minute"
646
+ });
647
+ const hourMatcher = createCronFieldMatcher2({
648
+ field: hourField,
649
+ min: 0,
650
+ max: 23,
651
+ fieldName: "hour"
652
+ });
653
+ const dayOfMonthMatcher = createCronFieldMatcher2({
654
+ field: dayOfMonthField,
655
+ min: 1,
656
+ max: 31,
657
+ fieldName: "day-of-month"
658
+ });
659
+ const monthMatcher = createCronFieldMatcher2({
660
+ field: monthField,
661
+ min: 1,
662
+ max: 12,
663
+ fieldName: "month"
664
+ });
665
+ const dayOfWeekMatcher = createCronFieldMatcher2({
666
+ field: dayOfWeekField,
667
+ min: 0,
668
+ max: 6,
669
+ fieldName: "day-of-week",
670
+ normalize: (value) => value === 7 ? 0 : value
671
+ });
672
+ const startMs = after.getTime();
673
+ let candidateMs = Math.ceil(startMs / 60000) * 60000;
674
+ if (candidateMs <= startMs)
675
+ candidateMs += 60000;
676
+ const limitMs = startMs + MAX_SEARCH_MS;
677
+ while (candidateMs <= limitMs) {
678
+ const candidate = new Date(candidateMs);
679
+ const comp = getLocalComponents(candidate, timezone);
680
+ if (!monthMatcher.matches(comp.month)) {
681
+ if (timezone === undefined) {
682
+ const next = findNextMatchingMonth(candidate, monthMatcher);
683
+ candidateMs = next.getTime();
684
+ } else {
685
+ candidateMs += ((24 - comp.hour) * 60 - comp.minute) * 60000;
686
+ }
687
+ continue;
688
+ }
689
+ if (!matchesDay(dayOfMonthMatcher, dayOfWeekMatcher, comp)) {
690
+ if (timezone === undefined) {
691
+ const next = new Date(candidateMs);
692
+ next.setUTCDate(next.getUTCDate() + 1);
693
+ next.setUTCHours(0, 0, 0, 0);
694
+ candidateMs = next.getTime();
695
+ } else {
696
+ candidateMs += ((24 - comp.hour) * 60 - comp.minute) * 60000;
697
+ }
698
+ continue;
699
+ }
700
+ if (!hourMatcher.matches(comp.hour)) {
701
+ if (timezone === undefined) {
702
+ const next = new Date(candidateMs);
703
+ next.setUTCHours(next.getUTCHours() + 1, 0, 0, 0);
704
+ candidateMs = next.getTime();
705
+ } else {
706
+ candidateMs += (60 - comp.minute) * 60000;
707
+ }
708
+ continue;
709
+ }
710
+ if (!minuteMatcher.matches(comp.minute)) {
711
+ candidateMs += 60000;
712
+ continue;
713
+ }
714
+ return candidate;
715
+ }
716
+ throw new CronValidationError2(`No matching occurrence found for '${expression}' within 4 years.`);
717
+ }
718
+ function findNextMatchingMonth(current, monthMatcher) {
719
+ const d = new Date(current);
720
+ d.setUTCDate(1);
721
+ d.setUTCHours(0, 0, 0, 0);
722
+ d.setUTCMonth(d.getUTCMonth() + 1);
723
+ for (let i = 0;i < 48; i++) {
724
+ if (monthMatcher.matches(d.getUTCMonth() + 1)) {
725
+ return d;
726
+ }
727
+ d.setUTCMonth(d.getUTCMonth() + 1);
728
+ }
729
+ return d;
730
+ }
442
731
  // src/schedules/runtime.ts
443
732
  function eventScheduleSubscribedEventTypes2(schedule) {
444
733
  return schedule.trigger.source.types ?? [];
@@ -847,6 +1136,6 @@ function validateConditionPredicate(schedule, propertyIds, predicate, link) {
847
1136
  throw new ScheduleValidationError2(`Schedule "${schedule.id}": unknown property "${predicate.propertyId}" on ${subject}.`);
848
1137
  }
849
1138
  }
850
- export { assertPredicateShape, createPropertyPredicateBuilder, createLinkPredicateBuilder, allPredicates, anyPredicates, notPredicate, defineSchedule2, eventScheduleSubscribedEventTypes2, evaluateEventSchedule2, buildEventScheduleContext2, isScheduleReference2, assertScheduleDefinition2, isScheduleDefinition2, validateSchedulesAtStartup2 };
1139
+ export { assertPredicateShape, createPropertyPredicateBuilder, createLinkPredicateBuilder, allPredicates, anyPredicates, notPredicate, ScheduleValidationError2, CronValidationError2, createCronFieldMatcher2, createCronMatcher2, defineSchedule2, nextCronOccurrence2, eventScheduleSubscribedEventTypes2, evaluateEventSchedule2, buildEventScheduleContext2, isScheduleReference2, assertScheduleDefinition2, isScheduleDefinition2, validateSchedulesAtStartup2 };
851
1140
 
852
- //# debugId=5FA1F6A50899183464756E2164756E21
1141
+ //# debugId=C051D76BC17640E164756E2164756E21