@sixb/core 0.2.2 → 0.2.4

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 (1155) hide show
  1. package/dist/actions/index.js +56 -50
  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/cancel.d.ts +1 -1
  9. package/dist/agents/cancel.d.ts.map +1 -1
  10. package/dist/agents/child-question.d.ts +35 -2
  11. package/dist/agents/child-question.d.ts.map +1 -1
  12. package/dist/agents/execution.d.ts +3 -2
  13. package/dist/agents/execution.d.ts.map +1 -1
  14. package/dist/agents/fork.d.ts.map +1 -1
  15. package/dist/agents/ids.d.ts +2 -0
  16. package/dist/agents/ids.d.ts.map +1 -1
  17. package/dist/agents/index.d.ts +4 -4
  18. package/dist/agents/index.d.ts.map +1 -1
  19. package/dist/agents/index.js +91 -76
  20. package/dist/agents/index.js.map +1 -1
  21. package/dist/agents/model-loop.d.ts.map +1 -1
  22. package/dist/agents/request.d.ts +7 -1
  23. package/dist/agents/request.d.ts.map +1 -1
  24. package/dist/agents/run-artifacts.d.ts +73 -10
  25. package/dist/agents/run-artifacts.d.ts.map +1 -1
  26. package/dist/agents/run-session-children.d.ts +9 -0
  27. package/dist/agents/run-session-children.d.ts.map +1 -1
  28. package/dist/agents/run-session-http.d.ts.map +1 -1
  29. package/dist/agents/run-session-serve.d.ts.map +1 -1
  30. package/dist/agents/run-session.d.ts +3 -0
  31. package/dist/agents/run-session.d.ts.map +1 -1
  32. package/dist/agents/streams/index.js +2 -2
  33. package/dist/agents/streams/internal.js +2 -2
  34. package/dist/agents/streams/protocol.d.ts.map +1 -1
  35. package/dist/agents/tool-files.d.ts +1 -1
  36. package/dist/agents/tool-files.d.ts.map +1 -1
  37. package/dist/agents/tool-input-coercion.d.ts +20 -0
  38. package/dist/agents/tool-input-coercion.d.ts.map +1 -0
  39. package/dist/agents/validation.d.ts +1 -1
  40. package/dist/agents/validation.d.ts.map +1 -1
  41. package/dist/artifacts/access.d.ts +37 -17
  42. package/dist/artifacts/access.d.ts.map +1 -1
  43. package/dist/artifacts/canvas-display.d.ts +65 -0
  44. package/dist/artifacts/canvas-display.d.ts.map +1 -0
  45. package/dist/artifacts/canvas.d.ts +6 -1
  46. package/dist/artifacts/canvas.d.ts.map +1 -1
  47. package/dist/artifacts/comment-text.d.ts +19 -0
  48. package/dist/artifacts/comment-text.d.ts.map +1 -0
  49. package/dist/artifacts/comments.d.ts +52 -0
  50. package/dist/artifacts/comments.d.ts.map +1 -0
  51. package/dist/artifacts/errors.d.ts +3 -3
  52. package/dist/artifacts/errors.d.ts.map +1 -1
  53. package/dist/artifacts/events.d.ts +14 -0
  54. package/dist/artifacts/events.d.ts.map +1 -0
  55. package/dist/artifacts/execution.d.ts +129 -22
  56. package/dist/artifacts/execution.d.ts.map +1 -1
  57. package/dist/artifacts/frames/assets.d.ts +12 -1
  58. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  59. package/dist/artifacts/frames/grants.d.ts +8 -5
  60. package/dist/artifacts/frames/grants.d.ts.map +1 -1
  61. package/dist/artifacts/frames/index.d.ts +1 -1
  62. package/dist/artifacts/frames/index.d.ts.map +1 -1
  63. package/dist/artifacts/frames/index.js +32 -964
  64. package/dist/artifacts/frames/index.js.map +4 -8
  65. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  66. package/dist/artifacts/frames/protocol.d.ts +129 -0
  67. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  68. package/dist/artifacts/frames/runtime.d.ts +24 -7
  69. package/dist/artifacts/frames/runtime.d.ts.map +1 -1
  70. package/dist/artifacts/holders.d.ts +23 -0
  71. package/dist/artifacts/holders.d.ts.map +1 -0
  72. package/dist/artifacts/ids.d.ts +2 -0
  73. package/dist/artifacts/ids.d.ts.map +1 -1
  74. package/dist/artifacts/index.d.ts +6 -4
  75. package/dist/artifacts/index.d.ts.map +1 -1
  76. package/dist/artifacts/index.js +134 -13
  77. package/dist/artifacts/index.js.map +5 -4
  78. package/dist/artifacts/limits.d.ts +24 -3
  79. package/dist/artifacts/limits.d.ts.map +1 -1
  80. package/dist/artifacts/live/board.d.ts +103 -0
  81. package/dist/artifacts/live/board.d.ts.map +1 -0
  82. package/dist/artifacts/live/diff.d.ts +43 -0
  83. package/dist/artifacts/live/diff.d.ts.map +1 -0
  84. package/dist/artifacts/live/document.d.ts +55 -0
  85. package/dist/artifacts/live/document.d.ts.map +1 -0
  86. package/dist/artifacts/live/files.d.ts +16 -0
  87. package/dist/artifacts/live/files.d.ts.map +1 -0
  88. package/dist/artifacts/live/index.d.ts +9 -0
  89. package/dist/artifacts/live/index.d.ts.map +1 -0
  90. package/dist/artifacts/live/index.js +593 -0
  91. package/dist/artifacts/live/index.js.map +10 -0
  92. package/dist/artifacts/live/presence.d.ts +55 -0
  93. package/dist/artifacts/live/presence.d.ts.map +1 -0
  94. package/dist/artifacts/live/protocol.d.ts +109 -0
  95. package/dist/artifacts/live/protocol.d.ts.map +1 -0
  96. package/dist/artifacts/live/protocol.js +21 -0
  97. package/dist/artifacts/live/protocol.js.map +9 -0
  98. package/dist/artifacts/live/server.d.ts +10 -0
  99. package/dist/artifacts/live/server.d.ts.map +1 -0
  100. package/dist/artifacts/live/server.js +86 -0
  101. package/dist/artifacts/live/server.js.map +9 -0
  102. package/dist/artifacts/live/state.d.ts +26 -0
  103. package/dist/artifacts/live/state.d.ts.map +1 -0
  104. package/dist/artifacts/outline.d.ts +11 -0
  105. package/dist/artifacts/outline.d.ts.map +1 -1
  106. package/dist/artifacts/publish/index.d.ts +8 -1
  107. package/dist/artifacts/publish/index.d.ts.map +1 -1
  108. package/dist/artifacts/publish/index.js +62 -34
  109. package/dist/artifacts/publish/index.js.map +1 -1
  110. package/dist/artifacts/publish/merge.d.ts +75 -0
  111. package/dist/artifacts/publish/merge.d.ts.map +1 -0
  112. package/dist/artifacts/publish/previews.d.ts +153 -0
  113. package/dist/artifacts/publish/previews.d.ts.map +1 -0
  114. package/dist/artifacts/publish/publish.d.ts +29 -8
  115. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  116. package/dist/artifacts/publish/query-answers.d.ts +20 -0
  117. package/dist/artifacts/publish/query-answers.d.ts.map +1 -0
  118. package/dist/artifacts/publish/references.d.ts +4 -3
  119. package/dist/artifacts/publish/references.d.ts.map +1 -1
  120. package/dist/artifacts/publish/validate/canvas.d.ts.map +1 -1
  121. package/dist/artifacts/theme.d.ts +5 -1
  122. package/dist/artifacts/theme.d.ts.map +1 -1
  123. package/dist/auth/directory.d.ts +33 -0
  124. package/dist/auth/directory.d.ts.map +1 -0
  125. package/dist/auth/index.js +13 -12
  126. package/dist/auth/index.js.map +1 -1
  127. package/dist/auth/member-events.d.ts +5 -1
  128. package/dist/auth/member-events.d.ts.map +1 -1
  129. package/dist/auth/runtime.d.ts +22 -1
  130. package/dist/auth/runtime.d.ts.map +1 -1
  131. package/dist/auth/strategy.d.ts +2 -2
  132. package/dist/auth/strategy.d.ts.map +1 -1
  133. package/dist/auth/types.d.ts +42 -1
  134. package/dist/auth/types.d.ts.map +1 -1
  135. package/dist/authorization/decision.d.ts +6 -5
  136. package/dist/authorization/decision.d.ts.map +1 -1
  137. package/dist/authorization/event-visibility.d.ts.map +1 -1
  138. package/dist/authorization/index.js +7 -6
  139. package/dist/authorization/index.js.map +1 -1
  140. package/dist/blob-storage/index.js +4 -4
  141. package/dist/blob-storage/index.js.map +1 -1
  142. package/dist/bootstrap/index.js +63 -57
  143. package/dist/bootstrap/index.js.map +2 -2
  144. package/dist/broker/in-memory.d.ts.map +1 -1
  145. package/dist/broker/index.js +1 -1
  146. package/dist/broker/types.d.ts +4 -0
  147. package/dist/broker/types.d.ts.map +1 -1
  148. package/dist/{chunk-s7j8ewqv.js → chunk-0k3r5kb3.js} +257 -43
  149. package/dist/{chunk-s7j8ewqv.js.map → chunk-0k3r5kb3.js.map} +14 -13
  150. package/dist/{chunk-e5wf5vz0.js → chunk-0kgrghqx.js} +13 -1
  151. package/dist/chunk-0kgrghqx.js.map +10 -0
  152. package/dist/{chunk-80gym75n.js → chunk-186k5yz3.js} +1 -1
  153. package/dist/chunk-191jz8a6.js +61 -0
  154. package/dist/chunk-191jz8a6.js.map +10 -0
  155. package/dist/{chunk-mmagke4x.js → chunk-22d3qg4x.js} +2 -2
  156. package/dist/{chunk-mmagke4x.js.map → chunk-22d3qg4x.js.map} +3 -3
  157. package/dist/{chunk-ga63a3dz.js → chunk-2bn6813a.js} +3 -3
  158. package/dist/chunk-2c4j899j.js.map +2 -2
  159. package/dist/{chunk-e6xgz4h4.js → chunk-3014rfjz.js} +197 -18
  160. package/dist/chunk-3014rfjz.js.map +21 -0
  161. package/dist/{chunk-ytzcxtpt.js → chunk-3ba89vm7.js} +1 -1
  162. package/dist/chunk-3hzhcfsv.js +139 -0
  163. package/dist/chunk-3hzhcfsv.js.map +10 -0
  164. package/dist/chunk-3sgvd10b.js +69 -0
  165. package/dist/chunk-3sgvd10b.js.map +10 -0
  166. package/dist/chunk-3z1vxzcm.js +234 -0
  167. package/dist/chunk-3z1vxzcm.js.map +12 -0
  168. package/dist/{chunk-djs3hw9p.js → chunk-3zagkr6w.js} +73 -6
  169. package/dist/chunk-3zagkr6w.js.map +21 -0
  170. package/dist/{chunk-wkq3kvzd.js → chunk-48c1z8nj.js} +6 -6
  171. package/dist/chunk-48c1z8nj.js.map +10 -0
  172. package/dist/{chunk-d04g36fw.js → chunk-5qqmndhm.js} +1 -1
  173. package/dist/{chunk-scyq22td.js → chunk-5rqqp8cr.js} +19 -4
  174. package/dist/chunk-5rqqp8cr.js.map +12 -0
  175. package/dist/chunk-6ef4esq4.js +225 -0
  176. package/dist/chunk-6ef4esq4.js.map +11 -0
  177. package/dist/{chunk-jspskey0.js → chunk-7j4yydm2.js} +67 -45
  178. package/dist/chunk-7j4yydm2.js.map +11 -0
  179. package/dist/chunk-7kpqntgw.js +70 -0
  180. package/dist/chunk-7kpqntgw.js.map +10 -0
  181. package/dist/{chunk-5wtnmpze.js → chunk-7qe46788.js} +1 -1
  182. package/dist/{chunk-31kcqmhf.js → chunk-855w9nvw.js} +1 -1
  183. package/dist/{chunk-e7v3trpz.js → chunk-8a8k38tz.js} +4 -3
  184. package/dist/chunk-8a8k38tz.js.map +10 -0
  185. package/dist/chunk-8bns0y68.js +1322 -0
  186. package/dist/chunk-8bns0y68.js.map +25 -0
  187. package/dist/{chunk-jftd33rc.js → chunk-8t2ynwg0.js} +105 -9
  188. package/dist/chunk-8t2ynwg0.js.map +11 -0
  189. package/dist/{chunk-9whfmsfk.js → chunk-8tqnsx3q.js} +1 -1
  190. package/dist/{chunk-s3we74h8.js → chunk-9nsjjd44.js} +38 -5
  191. package/dist/chunk-9nsjjd44.js.map +12 -0
  192. package/dist/{chunk-hz5d43gn.js → chunk-9vsc919v.js} +14 -6
  193. package/dist/chunk-9vsc919v.js.map +10 -0
  194. package/dist/{chunk-waqk73p1.js → chunk-a6fjkcne.js} +185 -341
  195. package/dist/{chunk-waqk73p1.js.map → chunk-a6fjkcne.js.map} +6 -7
  196. package/dist/chunk-az95tsh3.js.map +2 -2
  197. package/dist/{chunk-s038wa5v.js → chunk-b9qfh2ya.js} +1 -1
  198. package/dist/{chunk-5taem5aw.js → chunk-bc3y6gff.js} +13 -4
  199. package/dist/chunk-bc3y6gff.js.map +10 -0
  200. package/dist/chunk-bz5bnjjt.js +358 -0
  201. package/dist/chunk-bz5bnjjt.js.map +12 -0
  202. package/dist/{chunk-w976a4me.js → chunk-czct88ht.js} +28 -4
  203. package/dist/chunk-czct88ht.js.map +10 -0
  204. package/dist/{chunk-5kyvrtjh.js → chunk-d9xbwh3h.js} +131 -32
  205. package/dist/chunk-d9xbwh3h.js.map +13 -0
  206. package/dist/{chunk-kfee1h52.js → chunk-dfveegqq.js} +28 -8
  207. package/dist/chunk-dfveegqq.js.map +13 -0
  208. package/dist/{chunk-2g0r46hy.js → chunk-dhkc9b23.js} +15 -2
  209. package/dist/chunk-dhkc9b23.js.map +12 -0
  210. package/dist/chunk-dmnd9ea6.js +106 -0
  211. package/dist/chunk-dmnd9ea6.js.map +10 -0
  212. package/dist/{chunk-nz7815t3.js → chunk-e0hnbb1m.js} +27 -2
  213. package/dist/chunk-e0hnbb1m.js.map +14 -0
  214. package/dist/chunk-e91fmg6t.js +288 -0
  215. package/dist/chunk-e91fmg6t.js.map +11 -0
  216. package/dist/{chunk-3sqqhpr7.js → chunk-evj5jxz3.js} +134 -19
  217. package/dist/{chunk-3sqqhpr7.js.map → chunk-evj5jxz3.js.map} +11 -10
  218. package/dist/{chunk-w122ymx4.js → chunk-f6ahf5gf.js} +15 -4
  219. package/dist/{chunk-w122ymx4.js.map → chunk-f6ahf5gf.js.map} +3 -3
  220. package/dist/{chunk-jjmggm9a.js → chunk-fe6r7yhg.js} +1 -1
  221. package/dist/{chunk-165c9wm6.js → chunk-g2ph4873.js} +1 -1
  222. package/dist/{chunk-dsv783c3.js → chunk-gxwy4c3s.js} +203 -57
  223. package/dist/chunk-gxwy4c3s.js.map +47 -0
  224. package/dist/chunk-hgj98cbb.js +22 -0
  225. package/dist/chunk-hgj98cbb.js.map +10 -0
  226. package/dist/chunk-hn2r7z41.js.map +3 -3
  227. package/dist/chunk-hvbvq7p4.js +1553 -0
  228. package/dist/chunk-hvbvq7p4.js.map +18 -0
  229. package/dist/chunk-j0wgh8gv.js +250 -0
  230. package/dist/chunk-j0wgh8gv.js.map +10 -0
  231. package/dist/{chunk-z8fx5cgb.js → chunk-j2zm215x.js} +37 -3
  232. package/dist/chunk-j2zm215x.js.map +12 -0
  233. package/dist/{chunk-j1ny5fwh.js → chunk-k1g14kk3.js} +11 -83
  234. package/dist/{chunk-j1ny5fwh.js.map → chunk-k1g14kk3.js.map} +4 -5
  235. package/dist/chunk-kr6dx38r.js +25 -0
  236. package/dist/chunk-kr6dx38r.js.map +10 -0
  237. package/dist/chunk-m2jerfef.js +474 -0
  238. package/dist/chunk-m2jerfef.js.map +11 -0
  239. package/dist/{chunk-m2vh8gh0.js → chunk-msyevpp3.js} +62 -15
  240. package/dist/{chunk-m2vh8gh0.js.map → chunk-msyevpp3.js.map} +5 -5
  241. package/dist/{chunk-escedwyt.js → chunk-mvz89age.js} +6 -1
  242. package/dist/{chunk-escedwyt.js.map → chunk-mvz89age.js.map} +3 -3
  243. package/dist/chunk-mwcqz3e3.js +30 -0
  244. package/dist/chunk-mwcqz3e3.js.map +10 -0
  245. package/dist/chunk-n2ay51px.js +21 -0
  246. package/dist/chunk-n2ay51px.js.map +10 -0
  247. package/dist/chunk-n4zzaf6q.js.map +1 -1
  248. package/dist/{chunk-gkv8r794.js → chunk-n68vz95m.js} +5 -5
  249. package/dist/{chunk-gkv8r794.js.map → chunk-n68vz95m.js.map} +3 -3
  250. package/dist/{chunk-0j3crh1w.js → chunk-p351afzm.js} +14 -14
  251. package/dist/{chunk-0j3crh1w.js.map → chunk-p351afzm.js.map} +4 -4
  252. package/dist/{chunk-c7cfe31p.js → chunk-p8pgnq8d.js} +16 -16
  253. package/dist/{chunk-c7cfe31p.js.map → chunk-p8pgnq8d.js.map} +1 -1
  254. package/dist/chunk-pk539cwv.js +370 -0
  255. package/dist/chunk-pk539cwv.js.map +11 -0
  256. package/dist/{chunk-jbw70d6t.js → chunk-ppxf7gw2.js} +52 -10
  257. package/dist/chunk-ppxf7gw2.js.map +11 -0
  258. package/dist/{chunk-9x8dybsb.js → chunk-pvpq483h.js} +10 -2
  259. package/dist/chunk-pvpq483h.js.map +10 -0
  260. package/dist/{chunk-4zm1k3xj.js → chunk-r2psmn42.js} +1 -1
  261. package/dist/{chunk-a7aa0nzj.js → chunk-r9rtavg9.js} +14 -14
  262. package/dist/{chunk-a7aa0nzj.js.map → chunk-r9rtavg9.js.map} +1 -1
  263. package/dist/{chunk-w1btn96n.js → chunk-rsrc7vtw.js} +523 -254
  264. package/dist/chunk-rsrc7vtw.js.map +49 -0
  265. package/dist/{chunk-2ajw5rz0.js → chunk-rsxb14an.js} +3 -3
  266. package/dist/{chunk-kkjfve0t.js → chunk-rt9deb92.js} +4 -3
  267. package/dist/{chunk-kkjfve0t.js.map → chunk-rt9deb92.js.map} +3 -3
  268. package/dist/{chunk-r1cxq7vv.js → chunk-rtdrm592.js} +2 -2
  269. package/dist/{chunk-a5v4gjdx.js → chunk-rtm1jq00.js} +460 -227
  270. package/dist/{chunk-a5v4gjdx.js.map → chunk-rtm1jq00.js.map} +25 -22
  271. package/dist/{chunk-4bm0caep.js → chunk-smnt672s.js} +1 -1
  272. package/dist/{chunk-21q0j5f2.js → chunk-stmxh0hv.js} +2 -2
  273. package/dist/{chunk-nh26e7c5.js → chunk-sysnvjce.js} +5 -5
  274. package/dist/{chunk-nh26e7c5.js.map → chunk-sysnvjce.js.map} +3 -3
  275. package/dist/{chunk-7z5rkf0m.js → chunk-t0s7b3d1.js} +4 -3
  276. package/dist/{chunk-7z5rkf0m.js.map → chunk-t0s7b3d1.js.map} +3 -3
  277. package/dist/{chunk-57g0215c.js → chunk-t24yktqr.js} +296 -7
  278. package/dist/{chunk-57g0215c.js.map → chunk-t24yktqr.js.map} +6 -3
  279. package/dist/{chunk-mbc5hvnj.js → chunk-td26wjr5.js} +18 -7
  280. package/dist/{chunk-mbc5hvnj.js.map → chunk-td26wjr5.js.map} +3 -3
  281. package/dist/{chunk-ff5xkv0p.js → chunk-tfzvjdms.js} +1 -1
  282. package/dist/{chunk-f1h34y3r.js → chunk-vepea5c3.js} +6 -6
  283. package/dist/{chunk-f1h34y3r.js.map → chunk-vepea5c3.js.map} +1 -1
  284. package/dist/chunk-vtjzwymr.js +37 -0
  285. package/dist/chunk-vtjzwymr.js.map +10 -0
  286. package/dist/{chunk-twfreyxr.js → chunk-vzkxqf8h.js} +23 -13
  287. package/dist/{chunk-twfreyxr.js.map → chunk-vzkxqf8h.js.map} +6 -6
  288. package/dist/{chunk-eqgr6nsa.js → chunk-w1wq7gfr.js} +983 -185
  289. package/dist/chunk-w1wq7gfr.js.map +75 -0
  290. package/dist/{chunk-6b61s40c.js → chunk-w3t94hm6.js} +1 -1
  291. package/dist/{chunk-fwsvshr5.js → chunk-wa05txmk.js} +20 -7
  292. package/dist/{chunk-fwsvshr5.js.map → chunk-wa05txmk.js.map} +3 -3
  293. package/dist/chunk-whbwf3np.js +12 -0
  294. package/dist/chunk-whbwf3np.js.map +10 -0
  295. package/dist/{chunk-t5608tkq.js → chunk-yv8hv4wq.js} +3 -1
  296. package/dist/{chunk-t5608tkq.js.map → chunk-yv8hv4wq.js.map} +3 -3
  297. package/dist/{chunk-j8thxj7w.js → chunk-yy914zfr.js} +1218 -101
  298. package/dist/chunk-yy914zfr.js.map +30 -0
  299. package/dist/connectors/builders.d.ts +2 -2
  300. package/dist/connectors/builders.d.ts.map +1 -1
  301. package/dist/connectors/connections/access.d.ts +11 -0
  302. package/dist/connectors/connections/access.d.ts.map +1 -0
  303. package/dist/connectors/connections/contracts.d.ts +6 -1
  304. package/dist/connectors/connections/contracts.d.ts.map +1 -1
  305. package/dist/connectors/connections/internal.js +1 -1
  306. package/dist/connectors/connections/runs.d.ts +6 -0
  307. package/dist/connectors/connections/runs.d.ts.map +1 -1
  308. package/dist/connectors/connections/service.d.ts +25 -0
  309. package/dist/connectors/connections/service.d.ts.map +1 -1
  310. package/dist/connectors/connections/views.d.ts +1 -1
  311. package/dist/connectors/connections/views.d.ts.map +1 -1
  312. package/dist/connectors/execution.d.ts.map +1 -1
  313. package/dist/connectors/index.d.ts +1 -1
  314. package/dist/connectors/index.d.ts.map +1 -1
  315. package/dist/connectors/service.d.ts +3 -0
  316. package/dist/connectors/service.d.ts.map +1 -1
  317. package/dist/connectors/types.d.ts +21 -2
  318. package/dist/connectors/types.d.ts.map +1 -1
  319. package/dist/datasets/execution.d.ts +12 -6
  320. package/dist/datasets/execution.d.ts.map +1 -1
  321. package/dist/datasets/ingest-flush-batch.d.ts +59 -0
  322. package/dist/datasets/ingest-flush-batch.d.ts.map +1 -0
  323. package/dist/datasets/ingest-flush-job.d.ts +33 -0
  324. package/dist/datasets/ingest-flush-job.d.ts.map +1 -0
  325. package/dist/datasets/ingest-flush.d.ts +66 -0
  326. package/dist/datasets/ingest-flush.d.ts.map +1 -0
  327. package/dist/datasets/produced-version.d.ts +21 -0
  328. package/dist/datasets/produced-version.d.ts.map +1 -0
  329. package/dist/datasets/write.d.ts +22 -1
  330. package/dist/datasets/write.d.ts.map +1 -1
  331. package/dist/datasets/write.js +8 -4
  332. package/dist/datasets/write.js.map +1 -1
  333. package/dist/deploy/internal.js +5 -4
  334. package/dist/deploy/internal.js.map +4 -4
  335. package/dist/deploy/types.d.ts +2 -3
  336. package/dist/deploy/types.d.ts.map +1 -1
  337. package/dist/error-reporting/capability.d.ts +8 -2
  338. package/dist/error-reporting/capability.d.ts.map +1 -1
  339. package/dist/error-reporting/internal.d.ts +1 -1
  340. package/dist/error-reporting/internal.d.ts.map +1 -1
  341. package/dist/error-reporting/internal.js +17 -5
  342. package/dist/error-reporting/internal.js.map +1 -1
  343. package/dist/error-reporting/reporter.d.ts.map +1 -1
  344. package/dist/error-reporting/reports.d.ts +55 -0
  345. package/dist/error-reporting/reports.d.ts.map +1 -1
  346. package/dist/error-reporting/types.d.ts +82 -1
  347. package/dist/error-reporting/types.d.ts.map +1 -1
  348. package/dist/errors/catalog.d.ts +5 -0
  349. package/dist/errors/catalog.d.ts.map +1 -1
  350. package/dist/errors/internal.js +1 -1
  351. package/dist/events/definitions.d.ts +4 -0
  352. package/dist/events/definitions.d.ts.map +1 -1
  353. package/dist/events/execution.d.ts +1 -0
  354. package/dist/events/execution.d.ts.map +1 -1
  355. package/dist/events/index.d.ts +1 -1
  356. package/dist/events/index.d.ts.map +1 -1
  357. package/dist/events/index.js +5 -5
  358. package/dist/events/scope.d.ts.map +1 -1
  359. package/dist/events/scope.js +1 -1
  360. package/dist/events/selectors/index.js +2 -2
  361. package/dist/events/types/artifacts.d.ts +38 -0
  362. package/dist/events/types/artifacts.d.ts.map +1 -0
  363. package/dist/events/types/index.d.ts +3 -1
  364. package/dist/events/types/index.d.ts.map +1 -1
  365. package/dist/events/types/users.d.ts +5 -2
  366. package/dist/events/types/users.d.ts.map +1 -1
  367. package/dist/execution/agent.js +58 -52
  368. package/dist/execution/agent.js.map +1 -1
  369. package/dist/execution/authorized-object-reader.d.ts +10 -0
  370. package/dist/execution/authorized-object-reader.d.ts.map +1 -1
  371. package/dist/execution/object-reader-clearance.d.ts +6 -0
  372. package/dist/execution/object-reader-clearance.d.ts.map +1 -1
  373. package/dist/execution/object-reader-security.d.ts +9 -2
  374. package/dist/execution/object-reader-security.d.ts.map +1 -1
  375. package/dist/execution/primitive.js +56 -50
  376. package/dist/execution/primitive.js.map +1 -1
  377. package/dist/execution/request.js +50 -44
  378. package/dist/execution/request.js.map +2 -2
  379. package/dist/http/api-routes.d.ts +1 -1
  380. package/dist/http/api-routes.d.ts.map +1 -1
  381. package/dist/http/index.js +1 -1
  382. package/dist/index.d.ts +10 -8
  383. package/dist/index.d.ts.map +1 -1
  384. package/dist/index.js +96 -88
  385. package/dist/index.js.map +1 -1
  386. package/dist/lake-storage/errors.d.ts +15 -0
  387. package/dist/lake-storage/errors.d.ts.map +1 -1
  388. package/dist/lake-storage/index.d.ts +3 -2
  389. package/dist/lake-storage/index.d.ts.map +1 -1
  390. package/dist/lake-storage/index.js +16 -10
  391. package/dist/lake-storage/index.js.map +1 -1
  392. package/dist/lake-storage/maintenance.d.ts +88 -0
  393. package/dist/lake-storage/maintenance.d.ts.map +1 -0
  394. package/dist/lake-storage/merge.d.ts +3 -1
  395. package/dist/lake-storage/merge.d.ts.map +1 -1
  396. package/dist/lake-storage/source-ordering.d.ts +23 -0
  397. package/dist/lake-storage/source-ordering.d.ts.map +1 -1
  398. package/dist/lake-storage/types.d.ts +10 -0
  399. package/dist/lake-storage/types.d.ts.map +1 -1
  400. package/dist/maintenance/heartbeat.d.ts +5 -0
  401. package/dist/maintenance/heartbeat.d.ts.map +1 -0
  402. package/dist/maintenance/index.d.ts +4 -2
  403. package/dist/maintenance/index.d.ts.map +1 -1
  404. package/dist/maintenance/index.js +515 -0
  405. package/dist/maintenance/index.js.map +16 -0
  406. package/dist/maintenance/lake-retention-status.d.ts +36 -0
  407. package/dist/maintenance/lake-retention-status.d.ts.map +1 -0
  408. package/dist/maintenance/lake-retention.d.ts +84 -0
  409. package/dist/maintenance/lake-retention.d.ts.map +1 -0
  410. package/dist/maintenance/loop.d.ts +95 -0
  411. package/dist/maintenance/loop.d.ts.map +1 -0
  412. package/dist/maintenance/ontology-maintenance.d.ts +17 -16
  413. package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
  414. package/dist/maintenance/passes/cron-pass.d.ts +21 -0
  415. package/dist/maintenance/passes/cron-pass.d.ts.map +1 -0
  416. package/dist/maintenance/passes/directory-pass.d.ts +12 -0
  417. package/dist/maintenance/passes/directory-pass.d.ts.map +1 -0
  418. package/dist/maintenance/passes/ingest-pass.d.ts +26 -0
  419. package/dist/maintenance/passes/ingest-pass.d.ts.map +1 -0
  420. package/dist/maintenance/passes/lake-change-feed.d.ts +38 -0
  421. package/dist/maintenance/passes/lake-change-feed.d.ts.map +1 -0
  422. package/dist/maintenance/passes/lake-retention-pass.d.ts +20 -0
  423. package/dist/maintenance/passes/lake-retention-pass.d.ts.map +1 -0
  424. package/dist/maintenance/passes/ontology-pass.d.ts +8 -0
  425. package/dist/maintenance/passes/ontology-pass.d.ts.map +1 -0
  426. package/dist/maintenance/passes/projections-pass.d.ts +26 -0
  427. package/dist/maintenance/passes/projections-pass.d.ts.map +1 -0
  428. package/dist/maintenance/passes/recovery-pass.d.ts +6 -0
  429. package/dist/maintenance/passes/recovery-pass.d.ts.map +1 -0
  430. package/dist/maintenance/passes/recovery-passes.d.ts +24 -0
  431. package/dist/maintenance/passes/recovery-passes.d.ts.map +1 -0
  432. package/dist/maintenance/passes/runs-pass.d.ts +6 -0
  433. package/dist/maintenance/passes/runs-pass.d.ts.map +1 -0
  434. package/dist/maintenance/passes/triggers-pass.d.ts +41 -0
  435. package/dist/maintenance/passes/triggers-pass.d.ts.map +1 -0
  436. package/dist/maintenance/status.d.ts +19 -0
  437. package/dist/maintenance/status.d.ts.map +1 -0
  438. package/dist/maintenance/types.d.ts +25 -24
  439. package/dist/maintenance/types.d.ts.map +1 -1
  440. package/dist/materialization/model.d.ts +11 -2
  441. package/dist/materialization/model.d.ts.map +1 -1
  442. package/dist/materializer/edits/artifact-refs.d.ts +33 -0
  443. package/dist/materializer/edits/artifact-refs.d.ts.map +1 -0
  444. package/dist/materializer/edits/commit.d.ts.map +1 -1
  445. package/dist/materializer/edits/operations.d.ts +7 -1
  446. package/dist/materializer/edits/operations.d.ts.map +1 -1
  447. package/dist/materializer/edits/plan.d.ts.map +1 -1
  448. package/dist/materializer/execution/work-records.d.ts +6 -0
  449. package/dist/materializer/execution/work-records.d.ts.map +1 -1
  450. package/dist/materializer/index.js +31 -28
  451. package/dist/materializer/index.js.map +1 -1
  452. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  453. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  454. package/dist/materializer/telemetry/plan.d.ts.map +1 -1
  455. package/dist/models/execution/index.js +30 -27
  456. package/dist/models/execution/index.js.map +1 -1
  457. package/dist/models/language-model.d.ts +6 -0
  458. package/dist/models/language-model.d.ts.map +1 -1
  459. package/dist/models/tools.d.ts +2 -0
  460. package/dist/models/tools.d.ts.map +1 -1
  461. package/dist/objects/artifact-refs.d.ts +5 -0
  462. package/dist/objects/artifact-refs.d.ts.map +1 -0
  463. package/dist/objects/index.js +59 -54
  464. package/dist/objects/index.js.map +1 -1
  465. package/dist/objects/materializer-adapter.d.ts +4 -3
  466. package/dist/objects/materializer-adapter.d.ts.map +1 -1
  467. package/dist/objects/object/upsert-batch.d.ts.map +1 -1
  468. package/dist/objects/object/upsert.d.ts.map +1 -1
  469. package/dist/objects/query/index.js +29 -26
  470. package/dist/objects/query/index.js.map +1 -1
  471. package/dist/objects/query/ir.d.ts +3 -1
  472. package/dist/objects/query/ir.d.ts.map +1 -1
  473. package/dist/objects/query/scalar-values.d.ts.map +1 -1
  474. package/dist/objects/runtime-batch.d.ts +2 -0
  475. package/dist/objects/runtime-batch.d.ts.map +1 -1
  476. package/dist/ontology/artifact-ref.d.ts +36 -0
  477. package/dist/ontology/artifact-ref.d.ts.map +1 -0
  478. package/dist/ontology/docs-markdown.d.ts.map +1 -1
  479. package/dist/ontology/index.d.ts +3 -1
  480. package/dist/ontology/index.d.ts.map +1 -1
  481. package/dist/ontology/index.js +8 -5
  482. package/dist/ontology/index.js.map +1 -1
  483. package/dist/ontology/inference/index.d.ts +2 -0
  484. package/dist/ontology/inference/index.d.ts.map +1 -1
  485. package/dist/ontology/internal.js +7 -6
  486. package/dist/ontology/internal.js.map +1 -1
  487. package/dist/ontology/json-schema.d.ts.map +1 -1
  488. package/dist/ontology/primitives.d.ts.map +1 -1
  489. package/dist/ontology/reference-values.d.ts +10 -0
  490. package/dist/ontology/reference-values.d.ts.map +1 -0
  491. package/dist/ontology/refs.d.ts +6 -1
  492. package/dist/ontology/refs.d.ts.map +1 -1
  493. package/dist/ontology/registry.d.ts +9 -1
  494. package/dist/ontology/registry.d.ts.map +1 -1
  495. package/dist/ontology/types.d.ts +2 -1
  496. package/dist/ontology/types.d.ts.map +1 -1
  497. package/dist/ontology/user-ref.d.ts +16 -0
  498. package/dist/ontology/user-ref.d.ts.map +1 -1
  499. package/dist/ontology/validation/normalize.d.ts.map +1 -1
  500. package/dist/ontology/validation/properties.d.ts.map +1 -1
  501. package/dist/ontology/validation/schema.d.ts.map +1 -1
  502. package/dist/pending-tasks.d.ts +17 -0
  503. package/dist/pending-tasks.d.ts.map +1 -0
  504. package/dist/pipelines/index.js +37 -34
  505. package/dist/pipelines/index.js.map +1 -1
  506. package/dist/pipelines/run-dispatch.d.ts +6 -0
  507. package/dist/pipelines/run-dispatch.d.ts.map +1 -1
  508. package/dist/predicates/types.d.ts +4 -0
  509. package/dist/predicates/types.d.ts.map +1 -1
  510. package/dist/projections/builders.d.ts +13 -11
  511. package/dist/projections/builders.d.ts.map +1 -1
  512. package/dist/projections/internal.js +30 -27
  513. package/dist/projections/internal.js.map +1 -1
  514. package/dist/projections/types.d.ts +1 -1
  515. package/dist/projections/types.d.ts.map +1 -1
  516. package/dist/projections/validation.d.ts +2 -2
  517. package/dist/projections/validation.d.ts.map +1 -1
  518. package/dist/queues/in-memory.d.ts +6 -1
  519. package/dist/queues/in-memory.d.ts.map +1 -1
  520. package/dist/queues/index.d.ts +1 -1
  521. package/dist/queues/index.d.ts.map +1 -1
  522. package/dist/queues/index.js +1 -1
  523. package/dist/queues/types.d.ts +55 -2
  524. package/dist/queues/types.d.ts.map +1 -1
  525. package/dist/runtime/create.d.ts +3 -0
  526. package/dist/runtime/create.d.ts.map +1 -1
  527. package/dist/runtime/host.d.ts +22 -5
  528. package/dist/runtime/host.d.ts.map +1 -1
  529. package/dist/runtime/index.d.ts +0 -1
  530. package/dist/runtime/index.d.ts.map +1 -1
  531. package/dist/runtime/internal.d.ts +6 -0
  532. package/dist/runtime/internal.d.ts.map +1 -1
  533. package/dist/runtime/internal.js +52 -31
  534. package/dist/runtime/internal.js.map +1 -1
  535. package/dist/runtime/sixb.d.ts +6 -1
  536. package/dist/runtime/sixb.d.ts.map +1 -1
  537. package/dist/sandboxes/index.js +8 -7
  538. package/dist/sandboxes/index.js.map +1 -1
  539. package/dist/scheduler/index.d.ts +0 -2
  540. package/dist/scheduler/index.d.ts.map +1 -1
  541. package/dist/scheduler/index.js +3 -6
  542. package/dist/scheduler/index.js.map +1 -1
  543. package/dist/schedules/index.js +9 -11
  544. package/dist/schedules/index.js.map +1 -1
  545. package/dist/security/internal.js +1 -1
  546. package/dist/shared/backoff.d.ts +12 -0
  547. package/dist/shared/backoff.d.ts.map +1 -0
  548. package/dist/shared/duration.d.ts +3 -0
  549. package/dist/shared/duration.d.ts.map +1 -0
  550. package/dist/shared/params/artifact-refs.d.ts +19 -0
  551. package/dist/shared/params/artifact-refs.d.ts.map +1 -0
  552. package/dist/shares/guest-name.d.ts +8 -0
  553. package/dist/shares/guest-name.d.ts.map +1 -0
  554. package/dist/shares/internal.d.ts +1 -0
  555. package/dist/shares/internal.d.ts.map +1 -1
  556. package/dist/shares/internal.js +69 -28
  557. package/dist/shares/internal.js.map +3 -3
  558. package/dist/shares/session-protocol.d.ts +13 -0
  559. package/dist/shares/session-protocol.d.ts.map +1 -1
  560. package/dist/storage/action-runs/failure.js +2 -2
  561. package/dist/storage/agents/provider.js +1 -1
  562. package/dist/storage/agents/types.d.ts +1 -1
  563. package/dist/storage/agents/types.d.ts.map +1 -1
  564. package/dist/storage/ai-limits/enforcement.js +2 -2
  565. package/dist/storage/artifacts/errors.d.ts +9 -4
  566. package/dist/storage/artifacts/errors.d.ts.map +1 -1
  567. package/dist/storage/artifacts/in-memory.d.ts +27 -4
  568. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  569. package/dist/storage/artifacts/index.d.ts +1 -1
  570. package/dist/storage/artifacts/index.d.ts.map +1 -1
  571. package/dist/storage/artifacts/record.d.ts +39 -2
  572. package/dist/storage/artifacts/record.d.ts.map +1 -1
  573. package/dist/storage/artifacts/types.d.ts +328 -39
  574. package/dist/storage/artifacts/types.d.ts.map +1 -1
  575. package/dist/storage/auth/in-memory/auth-storage.d.ts +2 -1
  576. package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
  577. package/dist/storage/auth/in-memory/identities.d.ts +4 -0
  578. package/dist/storage/auth/in-memory/identities.d.ts.map +1 -1
  579. package/dist/storage/auth/in-memory/shared.d.ts +3 -1
  580. package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
  581. package/dist/storage/auth/in-memory/users.d.ts.map +1 -1
  582. package/dist/storage/auth/index.d.ts +1 -1
  583. package/dist/storage/auth/index.d.ts.map +1 -1
  584. package/dist/storage/auth/types.d.ts +39 -0
  585. package/dist/storage/auth/types.d.ts.map +1 -1
  586. package/dist/storage/connector-connections/in-memory.d.ts +1 -1
  587. package/dist/storage/connector-connections/in-memory.d.ts.map +1 -1
  588. package/dist/storage/connector-connections/index.d.ts +1 -1
  589. package/dist/storage/connector-connections/index.d.ts.map +1 -1
  590. package/dist/storage/connector-connections/provider/runs.d.ts.map +1 -1
  591. package/dist/storage/connector-connections/provider/shared.d.ts +12 -2
  592. package/dist/storage/connector-connections/provider/shared.d.ts.map +1 -1
  593. package/dist/storage/connector-connections/provider.d.ts +1 -0
  594. package/dist/storage/connector-connections/provider.d.ts.map +1 -1
  595. package/dist/storage/connector-connections/provider.js +21 -5
  596. package/dist/storage/connector-connections/provider.js.map +5 -5
  597. package/dist/storage/connector-connections/types.d.ts +1 -1
  598. package/dist/storage/connector-connections/types.d.ts.map +1 -1
  599. package/dist/storage/dataset-ingest/codec.d.ts +6 -0
  600. package/dist/storage/dataset-ingest/codec.d.ts.map +1 -0
  601. package/dist/storage/dataset-ingest/in-memory.d.ts +28 -0
  602. package/dist/storage/dataset-ingest/in-memory.d.ts.map +1 -0
  603. package/dist/storage/dataset-ingest/index.d.ts +4 -0
  604. package/dist/storage/dataset-ingest/index.d.ts.map +1 -0
  605. package/dist/storage/dataset-ingest/provider.d.ts +157 -0
  606. package/dist/storage/dataset-ingest/provider.d.ts.map +1 -0
  607. package/dist/storage/dataset-ingest/provider.js +17 -0
  608. package/dist/storage/dataset-ingest/provider.js.map +9 -0
  609. package/dist/storage/dataset-ingest/types.d.ts +188 -0
  610. package/dist/storage/dataset-ingest/types.d.ts.map +1 -0
  611. package/dist/storage/file-upload-sessions/provider.js +12 -11
  612. package/dist/storage/file-upload-sessions/provider.js.map +1 -1
  613. package/dist/storage/in-memory/index.d.ts +12 -0
  614. package/dist/storage/in-memory/index.d.ts.map +1 -1
  615. package/dist/storage/index.d.ts +18 -11
  616. package/dist/storage/index.d.ts.map +1 -1
  617. package/dist/storage/index.js +56 -46
  618. package/dist/storage/index.js.map +1 -1
  619. package/dist/storage/internal.d.ts +4 -1
  620. package/dist/storage/internal.d.ts.map +1 -1
  621. package/dist/storage/internal.js +81 -5
  622. package/dist/storage/internal.js.map +4 -3
  623. package/dist/storage/lake-retention-runs/in-memory.d.ts +11 -0
  624. package/dist/storage/lake-retention-runs/in-memory.d.ts.map +1 -0
  625. package/dist/storage/lake-retention-runs/index.d.ts +3 -0
  626. package/dist/storage/lake-retention-runs/index.d.ts.map +1 -0
  627. package/dist/storage/lake-retention-runs/types.d.ts +21 -0
  628. package/dist/storage/lake-retention-runs/types.d.ts.map +1 -0
  629. package/dist/storage/maintenance-heartbeats/in-memory.d.ts +11 -0
  630. package/dist/storage/maintenance-heartbeats/in-memory.d.ts.map +1 -0
  631. package/dist/storage/maintenance-heartbeats/index.d.ts +3 -0
  632. package/dist/storage/maintenance-heartbeats/index.d.ts.map +1 -0
  633. package/dist/storage/maintenance-heartbeats/record.d.ts +11 -0
  634. package/dist/storage/maintenance-heartbeats/record.d.ts.map +1 -0
  635. package/dist/storage/maintenance-heartbeats/types.d.ts +30 -0
  636. package/dist/storage/maintenance-heartbeats/types.d.ts.map +1 -0
  637. package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
  638. package/dist/storage/objects/in-memory/storage.d.ts +15 -1
  639. package/dist/storage/objects/in-memory/storage.d.ts.map +1 -1
  640. package/dist/storage/objects/read-scope.d.ts.map +1 -1
  641. package/dist/storage/objects/types.d.ts +18 -1
  642. package/dist/storage/objects/types.d.ts.map +1 -1
  643. package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
  644. package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
  645. package/dist/storage/ontology/index.d.ts +1 -1
  646. package/dist/storage/ontology/index.d.ts.map +1 -1
  647. package/dist/storage/ontology/materializations.d.ts +20 -0
  648. package/dist/storage/ontology/materializations.d.ts.map +1 -1
  649. package/dist/storage/ontology/provider-work.d.ts +7 -1
  650. package/dist/storage/ontology/provider-work.d.ts.map +1 -1
  651. package/dist/storage/ontology/provider.js +1 -1
  652. package/dist/storage/pipeline-runs/in-memory.d.ts +8 -2
  653. package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -1
  654. package/dist/storage/pipeline-runs/index.d.ts +1 -1
  655. package/dist/storage/pipeline-runs/index.d.ts.map +1 -1
  656. package/dist/storage/pipeline-runs/provider.js +1 -1
  657. package/dist/storage/pipeline-runs/transitions.d.ts +2 -2
  658. package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -1
  659. package/dist/storage/pipeline-runs/types.d.ts +26 -6
  660. package/dist/storage/pipeline-runs/types.d.ts.map +1 -1
  661. package/dist/storage/projection-runs/errors.d.ts +6 -0
  662. package/dist/storage/projection-runs/errors.d.ts.map +1 -1
  663. package/dist/storage/projection-runs/in-memory.d.ts +5 -1
  664. package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
  665. package/dist/storage/projection-runs/index.d.ts +2 -2
  666. package/dist/storage/projection-runs/index.d.ts.map +1 -1
  667. package/dist/storage/projection-runs/lifecycle.d.ts +1 -0
  668. package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
  669. package/dist/storage/projection-runs/provider.js +2 -2
  670. package/dist/storage/projection-runs/types.d.ts +16 -0
  671. package/dist/storage/projection-runs/types.d.ts.map +1 -1
  672. package/dist/storage/run-claim.d.ts +132 -0
  673. package/dist/storage/run-claim.d.ts.map +1 -0
  674. package/dist/storage/share-grants/provider.js +3 -3
  675. package/dist/storage/share-sessions/in-memory.d.ts +2 -1
  676. package/dist/storage/share-sessions/in-memory.d.ts.map +1 -1
  677. package/dist/storage/share-sessions/index.d.ts +1 -1
  678. package/dist/storage/share-sessions/index.d.ts.map +1 -1
  679. package/dist/storage/share-sessions/provider.d.ts +1 -1
  680. package/dist/storage/share-sessions/provider.d.ts.map +1 -1
  681. package/dist/storage/share-sessions/provider.js +4 -2
  682. package/dist/storage/share-sessions/provider.js.map +1 -1
  683. package/dist/storage/share-sessions/record.d.ts +2 -1
  684. package/dist/storage/share-sessions/record.d.ts.map +1 -1
  685. package/dist/storage/share-sessions/types.d.ts +17 -1
  686. package/dist/storage/share-sessions/types.d.ts.map +1 -1
  687. package/dist/storage/sync-runs/in-memory.d.ts +10 -2
  688. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
  689. package/dist/storage/sync-runs/index.d.ts +1 -1
  690. package/dist/storage/sync-runs/index.d.ts.map +1 -1
  691. package/dist/storage/sync-runs/transitions.d.ts +2 -2
  692. package/dist/storage/sync-runs/transitions.d.ts.map +1 -1
  693. package/dist/storage/sync-runs/types.d.ts +29 -3
  694. package/dist/storage/sync-runs/types.d.ts.map +1 -1
  695. package/dist/storage/types.d.ts +12 -6
  696. package/dist/storage/types.d.ts.map +1 -1
  697. package/dist/storage/webhook-runs/in-memory.d.ts +2 -1
  698. package/dist/storage/webhook-runs/in-memory.d.ts.map +1 -1
  699. package/dist/storage/webhook-runs/index.d.ts +2 -2
  700. package/dist/storage/webhook-runs/index.d.ts.map +1 -1
  701. package/dist/storage/webhook-runs/types.d.ts +33 -2
  702. package/dist/storage/webhook-runs/types.d.ts.map +1 -1
  703. package/dist/storage/workflow-runs/in-memory.d.ts +6 -3
  704. package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -1
  705. package/dist/storage/workflow-runs/index.d.ts +1 -1
  706. package/dist/storage/workflow-runs/index.d.ts.map +1 -1
  707. package/dist/storage/workflow-runs/provider.js +12 -11
  708. package/dist/storage/workflow-runs/provider.js.map +1 -1
  709. package/dist/storage/workflow-runs/types.d.ts +11 -28
  710. package/dist/storage/workflow-runs/types.d.ts.map +1 -1
  711. package/dist/syncs/index.js +38 -35
  712. package/dist/syncs/index.js.map +1 -1
  713. package/dist/syncs/run-dispatch.d.ts +2 -0
  714. package/dist/syncs/run-dispatch.d.ts.map +1 -1
  715. package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
  716. package/dist/testing/artifact-holders-contract.d.ts +15 -0
  717. package/dist/testing/artifact-holders-contract.d.ts.map +1 -0
  718. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  719. package/dist/testing/auth-storage-contract.d.ts.map +1 -1
  720. package/dist/testing/broker-contract.d.ts.map +1 -1
  721. package/dist/testing/connector-connection-storage-contract.d.ts +1 -1
  722. package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
  723. package/dist/testing/dataset-ingest-storage-contract.d.ts +11 -0
  724. package/dist/testing/dataset-ingest-storage-contract.d.ts.map +1 -0
  725. package/dist/testing/dataset-sequence-contract.d.ts +1 -1
  726. package/dist/testing/dataset-sequence-contract.d.ts.map +1 -1
  727. package/dist/testing/execution.d.ts.map +1 -1
  728. package/dist/testing/index.d.ts +8 -0
  729. package/dist/testing/index.d.ts.map +1 -1
  730. package/dist/testing/index.js +6245 -3192
  731. package/dist/testing/index.js.map +28 -19
  732. package/dist/testing/lake-retention-run-storage-contract.d.ts +9 -0
  733. package/dist/testing/lake-retention-run-storage-contract.d.ts.map +1 -0
  734. package/dist/testing/maintenance-heartbeat-storage-contract.d.ts +9 -0
  735. package/dist/testing/maintenance-heartbeat-storage-contract.d.ts.map +1 -0
  736. package/dist/testing/object-query-contract.d.ts.map +1 -1
  737. package/dist/testing/pipeline-execution.d.ts.map +1 -1
  738. package/dist/testing/pipeline-run-read-contract.d.ts +13 -0
  739. package/dist/testing/pipeline-run-read-contract.d.ts.map +1 -0
  740. package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
  741. package/dist/testing/queues-contract.d.ts.map +1 -1
  742. package/dist/testing/run-claim-storage-contract.d.ts +12 -0
  743. package/dist/testing/run-claim-storage-contract.d.ts.map +1 -0
  744. package/dist/testing/run-claim.d.ts +30 -0
  745. package/dist/testing/run-claim.d.ts.map +1 -0
  746. package/dist/testing/run-recovery-contract.d.ts +49 -0
  747. package/dist/testing/run-recovery-contract.d.ts.map +1 -0
  748. package/dist/testing/share-session-storage-contract.d.ts.map +1 -1
  749. package/dist/testing/stored-artifacts.d.ts +10 -0
  750. package/dist/testing/stored-artifacts.d.ts.map +1 -0
  751. package/dist/testing/sync-execution.d.ts.map +1 -1
  752. package/dist/testing/webhook-execution.d.ts +1 -1
  753. package/dist/testing/webhook-execution.d.ts.map +1 -1
  754. package/dist/testing/webhook-run-storage-contract.d.ts.map +1 -1
  755. package/dist/users/execution.d.ts +18 -1
  756. package/dist/users/execution.d.ts.map +1 -1
  757. package/dist/users/index.d.ts +1 -1
  758. package/dist/users/index.d.ts.map +1 -1
  759. package/dist/webhooks/delivery-lease.d.ts +13 -0
  760. package/dist/webhooks/delivery-lease.d.ts.map +1 -0
  761. package/dist/webhooks/internal.d.ts +2 -0
  762. package/dist/webhooks/internal.d.ts.map +1 -1
  763. package/dist/webhooks/internal.js +68 -36
  764. package/dist/webhooks/internal.js.map +5 -4
  765. package/dist/webhooks/run-admission.d.ts.map +1 -1
  766. package/dist/workers/index.d.ts +5 -1
  767. package/dist/workers/index.d.ts.map +1 -1
  768. package/dist/workers/index.js +193 -58
  769. package/dist/workers/index.js.map +8 -7
  770. package/dist/workers/job-ids.d.ts +17 -0
  771. package/dist/workers/job-ids.d.ts.map +1 -0
  772. package/dist/workers/lost-projection-runs.d.ts +26 -0
  773. package/dist/workers/lost-projection-runs.d.ts.map +1 -0
  774. package/dist/workers/lost-runs.d.ts +51 -0
  775. package/dist/workers/lost-runs.d.ts.map +1 -0
  776. package/dist/workers/queue-delivery.d.ts.map +1 -1
  777. package/dist/workers/queue-worker.d.ts +1 -2
  778. package/dist/workers/queue-worker.d.ts.map +1 -1
  779. package/dist/workers/queued-run-dispatch.d.ts +90 -0
  780. package/dist/workers/queued-run-dispatch.d.ts.map +1 -0
  781. package/dist/workers/run-lease.d.ts +25 -0
  782. package/dist/workers/run-lease.d.ts.map +1 -0
  783. package/dist/workers/run-worker.d.ts +95 -0
  784. package/dist/workers/run-worker.d.ts.map +1 -0
  785. package/dist/workflows/index.js +64 -58
  786. package/dist/workflows/index.js.map +1 -1
  787. package/dist/workflows/request.d.ts.map +1 -1
  788. package/dist/workflows/run-dispatch.d.ts +6 -1
  789. package/dist/workflows/run-dispatch.d.ts.map +1 -1
  790. package/package.json +41 -3
  791. package/src/actions/request.ts +24 -7
  792. package/src/actions/run/executor.ts +9 -42
  793. package/src/actions/types/context.ts +8 -3
  794. package/src/agents/approval-outcome.ts +2 -2
  795. package/src/agents/cancel.ts +2 -2
  796. package/src/agents/child-question.ts +76 -8
  797. package/src/agents/execution.ts +11 -3
  798. package/src/agents/fork.ts +12 -4
  799. package/src/agents/ids.ts +4 -1
  800. package/src/agents/index.ts +16 -3
  801. package/src/agents/model-loop.ts +3 -1
  802. package/src/agents/request.ts +42 -31
  803. package/src/agents/run-artifacts.ts +290 -46
  804. package/src/agents/run-session-children.ts +33 -0
  805. package/src/agents/run-session-http.ts +5 -0
  806. package/src/agents/run-session-serve.ts +11 -0
  807. package/src/agents/run-session.ts +8 -1
  808. package/src/agents/streams/protocol.ts +5 -10
  809. package/src/agents/tool-files.ts +1 -1
  810. package/src/agents/tool-input-coercion.ts +140 -0
  811. package/src/agents/validation.ts +12 -1
  812. package/src/artifacts/access.ts +71 -28
  813. package/src/artifacts/canvas-display.ts +160 -0
  814. package/src/artifacts/canvas.ts +26 -1
  815. package/src/artifacts/comment-text.ts +32 -0
  816. package/src/artifacts/comments.ts +275 -0
  817. package/src/artifacts/errors.ts +6 -1
  818. package/src/artifacts/events.ts +58 -0
  819. package/src/artifacts/execution.ts +496 -53
  820. package/src/artifacts/frames/assets.ts +20 -1
  821. package/src/artifacts/frames/grants.ts +31 -10
  822. package/src/artifacts/frames/index.ts +2 -0
  823. package/src/artifacts/frames/kit.ts +8 -5
  824. package/src/artifacts/frames/protocol.ts +231 -0
  825. package/src/artifacts/frames/runtime.ts +600 -29
  826. package/src/artifacts/holders.ts +120 -0
  827. package/src/artifacts/ids.ts +8 -0
  828. package/src/artifacts/index.ts +31 -2
  829. package/src/artifacts/limits.ts +28 -4
  830. package/src/artifacts/live/board.ts +759 -0
  831. package/src/artifacts/live/diff.ts +297 -0
  832. package/src/artifacts/live/document.ts +354 -0
  833. package/src/artifacts/live/files.ts +82 -0
  834. package/src/artifacts/live/index.ts +50 -0
  835. package/src/artifacts/live/presence.ts +144 -0
  836. package/src/artifacts/live/protocol.ts +134 -0
  837. package/src/artifacts/live/server.ts +16 -0
  838. package/src/artifacts/live/state.ts +115 -0
  839. package/src/artifacts/outline.ts +12 -0
  840. package/src/artifacts/publish/index.ts +26 -1
  841. package/src/artifacts/publish/merge.ts +271 -0
  842. package/src/artifacts/publish/previews.ts +485 -0
  843. package/src/artifacts/publish/publish.ts +92 -39
  844. package/src/artifacts/publish/query-answers.ts +85 -0
  845. package/src/artifacts/publish/references.ts +10 -4
  846. package/src/artifacts/publish/validate/canvas.ts +133 -1
  847. package/src/artifacts/theme.ts +9 -1
  848. package/src/auth/directory.ts +166 -0
  849. package/src/auth/member-events.ts +10 -3
  850. package/src/auth/runtime.ts +108 -8
  851. package/src/auth/strategy.ts +3 -1
  852. package/src/auth/types.ts +44 -0
  853. package/src/authorization/decision.ts +6 -5
  854. package/src/authorization/event-visibility.ts +4 -0
  855. package/src/broker/in-memory.ts +33 -6
  856. package/src/broker/types.ts +4 -0
  857. package/src/connectors/builders.ts +34 -2
  858. package/src/connectors/connections/access.ts +83 -0
  859. package/src/connectors/connections/contracts.ts +6 -1
  860. package/src/connectors/connections/execution.ts +2 -2
  861. package/src/connectors/connections/runs.ts +51 -2
  862. package/src/connectors/connections/service.ts +208 -41
  863. package/src/connectors/connections/views.ts +11 -4
  864. package/src/connectors/execution.ts +27 -3
  865. package/src/connectors/index.ts +2 -0
  866. package/src/connectors/service.ts +12 -0
  867. package/src/connectors/types.ts +37 -2
  868. package/src/datasets/execution.ts +74 -37
  869. package/src/datasets/ingest-flush-batch.ts +289 -0
  870. package/src/datasets/ingest-flush-job.ts +112 -0
  871. package/src/datasets/ingest-flush.ts +377 -0
  872. package/src/datasets/produced-version.ts +55 -0
  873. package/src/datasets/write.ts +65 -11
  874. package/src/deploy/services.ts +1 -1
  875. package/src/deploy/types.ts +2 -3
  876. package/src/deploy/validation.ts +1 -0
  877. package/src/error-reporting/capability.ts +66 -0
  878. package/src/error-reporting/internal.ts +12 -0
  879. package/src/error-reporting/reporter.ts +11 -35
  880. package/src/error-reporting/reports.ts +167 -0
  881. package/src/error-reporting/types.ts +99 -0
  882. package/src/errors/catalog.ts +6 -0
  883. package/src/events/definitions.ts +14 -0
  884. package/src/events/execution.ts +77 -28
  885. package/src/events/index.ts +3 -0
  886. package/src/events/scope.ts +2 -0
  887. package/src/events/types/artifacts.ts +40 -0
  888. package/src/events/types/index.ts +3 -0
  889. package/src/events/types/users.ts +5 -2
  890. package/src/execution/authorized-object-reader.ts +34 -0
  891. package/src/execution/object-reader-clearance.ts +31 -0
  892. package/src/execution/object-reader-security.ts +33 -13
  893. package/src/http/api-routes.ts +106 -5
  894. package/src/index.ts +22 -4
  895. package/src/lake-storage/errors.ts +21 -0
  896. package/src/lake-storage/index.ts +9 -1
  897. package/src/lake-storage/maintenance.ts +93 -0
  898. package/src/lake-storage/merge.ts +3 -1
  899. package/src/lake-storage/source-ordering.ts +28 -2
  900. package/src/lake-storage/types.ts +14 -0
  901. package/src/maintenance/heartbeat.ts +14 -0
  902. package/src/maintenance/index.ts +5 -3
  903. package/src/maintenance/lake-retention-status.ts +81 -0
  904. package/src/maintenance/lake-retention.ts +347 -0
  905. package/src/maintenance/loop.ts +365 -0
  906. package/src/maintenance/ontology-maintenance.ts +76 -229
  907. package/src/maintenance/passes/cron-pass.ts +217 -0
  908. package/src/maintenance/passes/directory-pass.ts +22 -0
  909. package/src/maintenance/passes/ingest-pass.ts +94 -0
  910. package/src/maintenance/passes/lake-change-feed.ts +112 -0
  911. package/src/maintenance/passes/lake-retention-pass.ts +71 -0
  912. package/src/maintenance/passes/ontology-pass.ts +19 -0
  913. package/src/maintenance/passes/projections-pass.ts +238 -0
  914. package/src/maintenance/passes/recovery-pass.ts +17 -0
  915. package/src/maintenance/passes/recovery-passes.ts +39 -0
  916. package/src/maintenance/passes/runs-pass.ts +12 -0
  917. package/src/maintenance/passes/triggers-pass.ts +332 -0
  918. package/src/maintenance/status.ts +75 -0
  919. package/src/maintenance/types.ts +27 -25
  920. package/src/materialization/model.ts +33 -21
  921. package/src/materializer/README.md +13 -2
  922. package/src/materializer/edits/artifact-refs.ts +140 -0
  923. package/src/materializer/edits/commit.ts +20 -7
  924. package/src/materializer/edits/operations.ts +23 -7
  925. package/src/materializer/edits/plan.ts +2 -0
  926. package/src/materializer/execution/work-records.ts +61 -0
  927. package/src/materializer/projections/replacement-plan.ts +2 -0
  928. package/src/materializer/shared/normalize.ts +14 -0
  929. package/src/materializer/telemetry/plan.ts +2 -0
  930. package/src/models/language-model.ts +6 -0
  931. package/src/models/tools.ts +2 -0
  932. package/src/objects/artifact-refs.ts +34 -0
  933. package/src/objects/materializer-adapter.ts +8 -3
  934. package/src/objects/object/upsert-batch.ts +7 -0
  935. package/src/objects/object/upsert.ts +11 -2
  936. package/src/objects/query/ir.ts +2 -0
  937. package/src/objects/query/scalar-values.ts +5 -3
  938. package/src/objects/runtime-batch.ts +8 -1
  939. package/src/objects/vectors/README.md +4 -4
  940. package/src/ontology/artifact-ref.ts +83 -0
  941. package/src/ontology/docs-markdown.ts +17 -0
  942. package/src/ontology/index.ts +3 -1
  943. package/src/ontology/inference/index.ts +2 -0
  944. package/src/ontology/json-schema.ts +13 -0
  945. package/src/ontology/primitives.ts +14 -0
  946. package/src/ontology/reference-values.ts +62 -0
  947. package/src/ontology/refs.ts +7 -1
  948. package/src/ontology/registry.ts +26 -1
  949. package/src/ontology/types.ts +2 -0
  950. package/src/ontology/user-ref.ts +35 -45
  951. package/src/ontology/validation/normalize.ts +13 -0
  952. package/src/ontology/validation/properties.ts +9 -0
  953. package/src/ontology/validation/schema.ts +12 -0
  954. package/src/pending-tasks.ts +51 -0
  955. package/src/pipelines/run-dispatch.ts +120 -238
  956. package/src/predicates/types.ts +2 -1
  957. package/src/projections/builders.ts +28 -13
  958. package/src/projections/run-dispatch.ts +1 -1
  959. package/src/projections/types.ts +1 -1
  960. package/src/projections/validation.ts +22 -8
  961. package/src/queues/in-memory.ts +50 -3
  962. package/src/queues/index.ts +4 -0
  963. package/src/queues/types.ts +68 -1
  964. package/src/runtime/create.ts +4 -0
  965. package/src/runtime/host.ts +118 -13
  966. package/src/runtime/index.ts +0 -1
  967. package/src/runtime/internal.ts +13 -0
  968. package/src/runtime/ontology-mutations.ts +1 -1
  969. package/src/runtime/sixb.ts +14 -5
  970. package/src/scheduler/index.ts +0 -2
  971. package/src/shared/backoff.ts +34 -0
  972. package/src/shared/duration.ts +15 -0
  973. package/src/shared/params/artifact-refs.ts +42 -0
  974. package/src/shares/compiler.ts +1 -1
  975. package/src/shares/guest-name.ts +20 -0
  976. package/src/shares/internal.ts +1 -0
  977. package/src/shares/session-protocol.ts +63 -0
  978. package/src/storage/agents/types.ts +1 -1
  979. package/src/storage/artifacts/errors.ts +10 -2
  980. package/src/storage/artifacts/in-memory.ts +579 -96
  981. package/src/storage/artifacts/index.ts +22 -1
  982. package/src/storage/artifacts/record.ts +255 -11
  983. package/src/storage/artifacts/types.ts +343 -40
  984. package/src/storage/auth/in-memory/auth-storage.ts +42 -5
  985. package/src/storage/auth/in-memory/identities.ts +16 -0
  986. package/src/storage/auth/in-memory/shared.ts +15 -0
  987. package/src/storage/auth/in-memory/users.ts +17 -16
  988. package/src/storage/auth/index.ts +3 -0
  989. package/src/storage/auth/types.ts +38 -0
  990. package/src/storage/connector-connections/in-memory.ts +4 -1
  991. package/src/storage/connector-connections/index.ts +1 -0
  992. package/src/storage/connector-connections/provider/runs.ts +3 -0
  993. package/src/storage/connector-connections/provider/shared.ts +30 -0
  994. package/src/storage/connector-connections/provider.ts +4 -0
  995. package/src/storage/connector-connections/types.ts +1 -0
  996. package/src/storage/dataset-ingest/codec.ts +90 -0
  997. package/src/storage/dataset-ingest/in-memory.ts +277 -0
  998. package/src/storage/dataset-ingest/index.ts +16 -0
  999. package/src/storage/dataset-ingest/provider.ts +592 -0
  1000. package/src/storage/dataset-ingest/types.ts +191 -0
  1001. package/src/storage/in-memory/index.ts +33 -0
  1002. package/src/storage/index.ts +65 -5
  1003. package/src/storage/internal.ts +20 -0
  1004. package/src/storage/lake-retention-runs/in-memory.ts +22 -0
  1005. package/src/storage/lake-retention-runs/index.ts +2 -0
  1006. package/src/storage/lake-retention-runs/types.ts +19 -0
  1007. package/src/storage/maintenance-heartbeats/in-memory.ts +24 -0
  1008. package/src/storage/maintenance-heartbeats/index.ts +7 -0
  1009. package/src/storage/maintenance-heartbeats/record.ts +50 -0
  1010. package/src/storage/maintenance-heartbeats/types.ts +30 -0
  1011. package/src/storage/objects/in-memory/query.ts +1 -0
  1012. package/src/storage/objects/in-memory/storage.ts +81 -0
  1013. package/src/storage/objects/read-scope.ts +1 -0
  1014. package/src/storage/objects/types.ts +16 -1
  1015. package/src/storage/ontology/in-memory/materializations.ts +8 -0
  1016. package/src/storage/ontology/in-memory/replacement-plans.ts +4 -1
  1017. package/src/storage/ontology/index.ts +2 -0
  1018. package/src/storage/ontology/materializations.ts +18 -0
  1019. package/src/storage/ontology/provider-work.ts +39 -0
  1020. package/src/storage/pipeline-runs/in-memory.ts +97 -24
  1021. package/src/storage/pipeline-runs/index.ts +0 -1
  1022. package/src/storage/pipeline-runs/provider.ts +1 -1
  1023. package/src/storage/pipeline-runs/transitions.ts +7 -4
  1024. package/src/storage/pipeline-runs/types.ts +33 -7
  1025. package/src/storage/projection-runs/errors.ts +10 -0
  1026. package/src/storage/projection-runs/in-memory.ts +56 -1
  1027. package/src/storage/projection-runs/index.ts +2 -1
  1028. package/src/storage/projection-runs/lifecycle.ts +9 -1
  1029. package/src/storage/projection-runs/types.ts +20 -1
  1030. package/src/storage/run-claim.ts +224 -0
  1031. package/src/storage/share-sessions/in-memory.ts +21 -0
  1032. package/src/storage/share-sessions/index.ts +1 -0
  1033. package/src/storage/share-sessions/provider.ts +1 -0
  1034. package/src/storage/share-sessions/record.ts +28 -0
  1035. package/src/storage/share-sessions/types.ts +19 -1
  1036. package/src/storage/sync-runs/in-memory.ts +109 -29
  1037. package/src/storage/sync-runs/index.ts +1 -1
  1038. package/src/storage/sync-runs/transitions.ts +7 -4
  1039. package/src/storage/sync-runs/types.ts +36 -3
  1040. package/src/storage/types.ts +15 -5
  1041. package/src/storage/webhook-runs/in-memory.ts +26 -2
  1042. package/src/storage/webhook-runs/index.ts +3 -1
  1043. package/src/storage/webhook-runs/types.ts +44 -3
  1044. package/src/storage/workflow-runs/in-memory.ts +50 -36
  1045. package/src/storage/workflow-runs/index.ts +0 -2
  1046. package/src/storage/workflow-runs/types.ts +18 -30
  1047. package/src/syncs/run-dispatch.ts +118 -239
  1048. package/src/testing/ai-model-call-groups-contract.ts +2 -1
  1049. package/src/testing/artifact-holders-contract.ts +392 -0
  1050. package/src/testing/artifact-storage-contract.ts +1205 -151
  1051. package/src/testing/auth-storage-contract.ts +228 -1
  1052. package/src/testing/broker-contract.ts +56 -0
  1053. package/src/testing/connector-connection-storage-contract.ts +94 -5
  1054. package/src/testing/dataset-ingest-storage-contract.ts +480 -0
  1055. package/src/testing/dataset-sequence-contract.ts +97 -12
  1056. package/src/testing/execution.ts +23 -0
  1057. package/src/testing/index.ts +31 -0
  1058. package/src/testing/lake-retention-run-storage-contract.ts +75 -0
  1059. package/src/testing/maintenance-heartbeat-storage-contract.ts +99 -0
  1060. package/src/testing/object-query-contract.ts +93 -0
  1061. package/src/testing/pipeline-execution.ts +3 -1
  1062. package/src/testing/pipeline-run-read-contract.ts +123 -0
  1063. package/src/testing/projection-run-storage-contract.ts +113 -0
  1064. package/src/testing/queues-contract.ts +112 -0
  1065. package/src/testing/run-claim-storage-contract.ts +736 -0
  1066. package/src/testing/run-claim.ts +69 -0
  1067. package/src/testing/run-recovery-contract.ts +176 -0
  1068. package/src/testing/share-session-storage-contract.ts +43 -0
  1069. package/src/testing/stored-artifacts.ts +43 -0
  1070. package/src/testing/sync-execution.ts +3 -1
  1071. package/src/testing/webhook-execution.ts +7 -2
  1072. package/src/testing/webhook-run-storage-contract.ts +102 -5
  1073. package/src/users/execution.ts +50 -2
  1074. package/src/users/index.ts +1 -0
  1075. package/src/webhooks/delivery-lease.ts +40 -0
  1076. package/src/webhooks/internal.ts +2 -0
  1077. package/src/webhooks/run-admission.ts +22 -9
  1078. package/src/workers/README.md +169 -0
  1079. package/src/workers/index.ts +9 -1
  1080. package/src/workers/job-ids.ts +31 -0
  1081. package/src/workers/lost-projection-runs.ts +114 -0
  1082. package/src/workers/lost-runs.ts +397 -0
  1083. package/src/workers/queue-delivery.ts +2 -14
  1084. package/src/workers/queue-worker.ts +9 -17
  1085. package/src/workers/queued-run-dispatch.ts +308 -0
  1086. package/src/workers/run-lease.ts +46 -0
  1087. package/src/workers/run-worker.ts +312 -0
  1088. package/src/workers/worker.ts +4 -17
  1089. package/src/workflows/request.ts +2 -0
  1090. package/src/workflows/run-dispatch.ts +22 -4
  1091. package/src/workflows/snapshot.ts +1 -0
  1092. package/dist/chunk-2g0r46hy.js.map +0 -12
  1093. package/dist/chunk-3fqxbn31.js +0 -107
  1094. package/dist/chunk-3fqxbn31.js.map +0 -11
  1095. package/dist/chunk-4s753g3k.js +0 -314
  1096. package/dist/chunk-4s753g3k.js.map +0 -12
  1097. package/dist/chunk-5kyvrtjh.js.map +0 -12
  1098. package/dist/chunk-5taem5aw.js.map +0 -10
  1099. package/dist/chunk-65abf64x.js +0 -13
  1100. package/dist/chunk-65abf64x.js.map +0 -10
  1101. package/dist/chunk-9x8dybsb.js.map +0 -10
  1102. package/dist/chunk-az47zep4.js +0 -41
  1103. package/dist/chunk-az47zep4.js.map +0 -10
  1104. package/dist/chunk-c706qvyc.js +0 -299
  1105. package/dist/chunk-c706qvyc.js.map +0 -11
  1106. package/dist/chunk-djs3hw9p.js.map +0 -20
  1107. package/dist/chunk-dsv783c3.js.map +0 -47
  1108. package/dist/chunk-e5wf5vz0.js.map +0 -10
  1109. package/dist/chunk-e6xgz4h4.js.map +0 -21
  1110. package/dist/chunk-e7v3trpz.js.map +0 -10
  1111. package/dist/chunk-eqgr6nsa.js.map +0 -72
  1112. package/dist/chunk-fb3feg1e.js +0 -298
  1113. package/dist/chunk-fb3feg1e.js.map +0 -12
  1114. package/dist/chunk-hz5d43gn.js.map +0 -10
  1115. package/dist/chunk-j8thxj7w.js.map +0 -22
  1116. package/dist/chunk-jbw70d6t.js.map +0 -10
  1117. package/dist/chunk-jftd33rc.js.map +0 -11
  1118. package/dist/chunk-jspskey0.js.map +0 -10
  1119. package/dist/chunk-kfee1h52.js.map +0 -13
  1120. package/dist/chunk-kwfhd1g0.js +0 -144
  1121. package/dist/chunk-kwfhd1g0.js.map +0 -13
  1122. package/dist/chunk-nz7815t3.js.map +0 -14
  1123. package/dist/chunk-s3we74h8.js.map +0 -12
  1124. package/dist/chunk-scyq22td.js.map +0 -12
  1125. package/dist/chunk-w1btn96n.js.map +0 -44
  1126. package/dist/chunk-w976a4me.js.map +0 -10
  1127. package/dist/chunk-wkq3kvzd.js.map +0 -10
  1128. package/dist/chunk-wrjx1fqz.js +0 -587
  1129. package/dist/chunk-wrjx1fqz.js.map +0 -18
  1130. package/dist/chunk-yw9pyg66.js +0 -143
  1131. package/dist/chunk-yw9pyg66.js.map +0 -11
  1132. package/dist/chunk-z8fx5cgb.js.map +0 -11
  1133. package/dist/scheduler/runtime.d.ts +0 -40
  1134. package/dist/scheduler/runtime.d.ts.map +0 -1
  1135. package/dist/workers/unstarted-run.d.ts +0 -10
  1136. package/dist/workers/unstarted-run.d.ts.map +0 -1
  1137. package/src/scheduler/runtime.ts +0 -214
  1138. package/src/workers/unstarted-run.ts +0 -18
  1139. /package/dist/{chunk-80gym75n.js.map → chunk-186k5yz3.js.map} +0 -0
  1140. /package/dist/{chunk-ga63a3dz.js.map → chunk-2bn6813a.js.map} +0 -0
  1141. /package/dist/{chunk-ytzcxtpt.js.map → chunk-3ba89vm7.js.map} +0 -0
  1142. /package/dist/{chunk-d04g36fw.js.map → chunk-5qqmndhm.js.map} +0 -0
  1143. /package/dist/{chunk-5wtnmpze.js.map → chunk-7qe46788.js.map} +0 -0
  1144. /package/dist/{chunk-31kcqmhf.js.map → chunk-855w9nvw.js.map} +0 -0
  1145. /package/dist/{chunk-9whfmsfk.js.map → chunk-8tqnsx3q.js.map} +0 -0
  1146. /package/dist/{chunk-s038wa5v.js.map → chunk-b9qfh2ya.js.map} +0 -0
  1147. /package/dist/{chunk-jjmggm9a.js.map → chunk-fe6r7yhg.js.map} +0 -0
  1148. /package/dist/{chunk-165c9wm6.js.map → chunk-g2ph4873.js.map} +0 -0
  1149. /package/dist/{chunk-4zm1k3xj.js.map → chunk-r2psmn42.js.map} +0 -0
  1150. /package/dist/{chunk-2ajw5rz0.js.map → chunk-rsxb14an.js.map} +0 -0
  1151. /package/dist/{chunk-r1cxq7vv.js.map → chunk-rtdrm592.js.map} +0 -0
  1152. /package/dist/{chunk-4bm0caep.js.map → chunk-smnt672s.js.map} +0 -0
  1153. /package/dist/{chunk-21q0j5f2.js.map → chunk-stmxh0hv.js.map} +0 -0
  1154. /package/dist/{chunk-ff5xkv0p.js.map → chunk-tfzvjdms.js.map} +0 -0
  1155. /package/dist/{chunk-6b61s40c.js.map → chunk-w3t94hm6.js.map} +0 -0
@@ -16,7 +16,7 @@ eligible set after link and property authorization; it never filters a global to
16
16
 
17
17
  ```text
18
18
  Effective object change → invalidate stale vector + persist latest intent (one transaction)
19
- Commit wake-up (or API maintenance pass) → durable queue
19
+ Commit wake-up (or orchestrator maintenance pass) → durable queue
20
20
  ProjectionWorker → project AI admission → provider → save result → fenced commit
21
21
  ```
22
22
 
@@ -28,9 +28,9 @@ There is no historical scan or configuration-only backfill.
28
28
  The queue owns delivery leases. Ontology storage owns intent keyed by project/object/profile, plus
29
29
  its generation id and `pending → running → ready` state. Dispatch has a separate due time so long
30
30
  queues cannot starve later entries. `indexing-dispatch.ts` enqueues due intent after every commit
31
- in the committing process and pushes its due time 30 seconds out; the API's maintenance pass
32
- drains the same path, so intent a crash left undispatched waits at most one pass. Enqueueing the
33
- same generation twice is safe.
31
+ in the committing process and pushes its due time 30 seconds out; the orchestrator's maintenance
32
+ pass drains the same path, so intent a crash left undispatched waits at most one pass. Enqueueing
33
+ the same generation twice is safe.
34
34
 
35
35
  `indexing.ts` exposes only a core-owned processing capability. Kernel authority cannot bind the
36
36
  public domain SDK. `ontology.indexVectors` authorizes only the persisted results of its work item or durable group.
@@ -0,0 +1,83 @@
1
+ import { isArtifactId } from "../artifacts/ids"
2
+ import { OntologyValidationError } from "./errors"
3
+ import { visitPrimitiveValues } from "./reference-values"
4
+ import type { Schema, ValueType } from "./types"
5
+
6
+ /**
7
+ * Value of a `ref.artifact()` (`"artifactRef"`) schema: one artifact, followed at its latest
8
+ * version.
9
+ *
10
+ * Like a user reference, it carries no title or kind: a writer could make them up, and the
11
+ * artifact keeps its own.
12
+ */
13
+ export interface ArtifactRef {
14
+ readonly type: "artifact"
15
+ readonly id: string
16
+ }
17
+
18
+ /**
19
+ * Build a reference to one artifact, for writes and query predicates:
20
+ * `where(({ p }) => p.kickoffDoc.eq(artifactRef("art_k3m9q2x7tp")))`.
21
+ */
22
+ export function artifactRef(id: string): ArtifactRef {
23
+ if (typeof id !== "string" || !isArtifactId(id)) {
24
+ throw new OntologyValidationError(
25
+ `[Sixb] Artifact reference id must be an artifact id such as 'art_k3m9q2x7tp', got ${JSON.stringify(id)}.`
26
+ )
27
+ }
28
+
29
+ return Object.freeze({ type: "artifact" as const, id })
30
+ }
31
+
32
+ /** Exactly `{ type: "artifact", id }` with an artifact id and no other field. */
33
+ export function isArtifactRef(value: unknown): value is ArtifactRef {
34
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false
35
+
36
+ const record = value as Record<string, unknown>
37
+ return (
38
+ Object.keys(record).every((key) => key === "type" || key === "id") &&
39
+ record.type === "artifact" &&
40
+ typeof record.id === "string" &&
41
+ isArtifactId(record.id)
42
+ )
43
+ }
44
+
45
+ /** A `ref.artifact()` schema, or an array of them. */
46
+ export function isArtifactRefPropertySchema(schema: Schema): boolean {
47
+ if (schema === "artifactRef") return true
48
+ return typeof schema === "object" && schema.type === "array" && schema.items === "artifactRef"
49
+ }
50
+
51
+ /**
52
+ * Collect the artifact ids a value holds at `artifactRef` positions of its schema, however deeply
53
+ * nested.
54
+ *
55
+ * Positions whose value does not match the schema are skipped: shape validation reports them.
56
+ */
57
+ export function collectArtifactRefIds(
58
+ schema: Schema,
59
+ value: unknown,
60
+ valueTypesById: ReadonlyMap<string, ValueType>,
61
+ into: Set<string>,
62
+ seenValueTypeIds: ReadonlySet<string> = new Set()
63
+ ): Set<string> {
64
+ const collect = (held: unknown) => {
65
+ if (isArtifactRef(held)) into.add(held.id)
66
+ }
67
+
68
+ visitPrimitiveValues(schema, "artifactRef", value, valueTypesById, collect, seenValueTypeIds)
69
+ return into
70
+ }
71
+
72
+ /**
73
+ * Why `path` cannot newly reference artifact `id`. A missing artifact and one the writer may not
74
+ * change get this same message, so a write never tells them apart.
75
+ */
76
+ export function artifactReferenceProblem(path: string, id: string): string {
77
+ return `[Sixb] ${path} references artifact '${id}', which does not exist.`
78
+ }
79
+
80
+ /** Why `path` cannot reference artifacts at all: this runtime has nowhere to look them up. */
81
+ export function artifactsUnverifiableProblem(path: string, id: string): string {
82
+ return `[Sixb] ${path} references artifact '${id}', but this runtime has no artifact storage to verify it. Configure storage with artifacts to write artifact references.`
83
+ }
@@ -5,6 +5,7 @@
5
5
 
6
6
  import type { ActionDescriptor, ActionParamDescriptor } from "../actions/descriptor"
7
7
  import type { AgentProjectFile } from "../agents/skills"
8
+ import { isArtifactRefPropertySchema } from "./artifact-ref"
8
9
  import type { OntologyDoc, OntologyDocsCatalog } from "./docs"
9
10
  import {
10
11
  type PropertyQueryOperator,
@@ -127,6 +128,11 @@ function renderProperties(
127
128
  const userPropertyIds = objectType.properties
128
129
  .filter((property) => !restricted.has(property.id) && isUserRefPropertySchema(property.schema))
129
130
  .map((property) => code(property.id))
131
+ const artifactPropertyIds = objectType.properties
132
+ .filter(
133
+ (property) => !restricted.has(property.id) && isArtifactRefPropertySchema(property.schema)
134
+ )
135
+ .map((property) => code(property.id))
130
136
  return [
131
137
  "## Properties",
132
138
  "",
@@ -150,6 +156,9 @@ function renderProperties(
150
156
  ])
151
157
  ),
152
158
  ...(userPropertyIds.length === 0 ? [] : ["", renderUserProperties(userPropertyIds)]),
159
+ ...(artifactPropertyIds.length === 0
160
+ ? []
161
+ : ["", renderArtifactProperties(artifactPropertyIds)]),
153
162
  ].join("\n")
154
163
  }
155
164
 
@@ -162,6 +171,14 @@ function renderUserProperties(propertyIds: readonly string[]): string {
162
171
  ].join(" ")
163
172
  }
164
173
 
174
+ /** How to fill the properties that hold artifacts: with an artifact the writer may change. */
175
+ function renderArtifactProperties(propertyIds: readonly string[]): string {
176
+ return [
177
+ `Artifact properties (${propertyIds.join(", ")}) hold \`{"type":"artifact","id":"<artifact-id>"}\`.`,
178
+ "Write the id of an artifact you can change, such as one you published (`art_k3m9q2x7tp`).",
179
+ ].join(" ")
180
+ }
181
+
165
182
  function queryLabel(property: Property, valueTypesById: ReadonlyMap<string, ValueType>): string {
166
183
  const capabilities = resolvePropertyQueryCapabilities(property, valueTypesById)
167
184
  const schema = resolveQuerySchema(property.schema, valueTypesById)
@@ -11,6 +11,8 @@
11
11
  // ── Types ───────────────────────────────────────────────────
12
12
 
13
13
  export type { EmbeddingModelDefinition, EmbeddingModelRef } from "../models/embedding-model"
14
+ export type { ArtifactRef } from "./artifact-ref"
15
+ export { artifactRef } from "./artifact-ref"
14
16
  export type { DecimalValue } from "./decimal"
15
17
  export {
16
18
  compareDecimalValues,
@@ -64,7 +66,7 @@ export type {
64
66
  ValueType,
65
67
  ValueTypeRefSchema,
66
68
  } from "./types"
67
- export type { CurrentUserRef, UserEmailColumn, UserRef } from "./user-ref"
69
+ export type { CurrentUserRef, UserEmailColumn, UserIdColumn, UserRef } from "./user-ref"
68
70
  export { currentUser, userRef } from "./user-ref"
69
71
 
70
72
  // ── Registry ──────────────────────────────────────────────
@@ -12,6 +12,7 @@ import type {
12
12
  ValueType,
13
13
  ValueTypeRefSchema,
14
14
  } from ".."
15
+ import type { ArtifactRef } from "../artifact-ref"
15
16
  import type { DecimalValue } from "../decimal"
16
17
  import type { RegisteredValueTypes } from "../registered"
17
18
  import type { QuantitativeTypeId, UnitsOf } from "../units"
@@ -76,6 +77,7 @@ type InferObjectFields<
76
77
  interface PrimitiveSchemaValueMap {
77
78
  fileRef: FileRef
78
79
  userRef: UserRef
80
+ artifactRef: ArtifactRef
79
81
  string: string
80
82
  uuid: string
81
83
  boolean: boolean
@@ -5,6 +5,8 @@ import type { Schema, ValueType } from "./types"
5
5
 
6
6
  // A user reference carries no name, so whoever reads the schema is told how one is written.
7
7
  const USER_REF_DESCRIPTION = 'A Sixb user, written {"type":"user","id":"<user-id>"}.'
8
+ const ARTIFACT_REF_DESCRIPTION =
9
+ 'A Sixb artifact, written {"type":"artifact","id":"<artifact-id>"}, such as "art_k3m9q2x7tp".'
8
10
 
9
11
  type DeepReadonly<T> = T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T
10
12
 
@@ -115,6 +117,17 @@ function schemaJsonSchema(
115
117
  required: ["type", "id"],
116
118
  additionalProperties: false,
117
119
  }
120
+ case "artifactRef":
121
+ return {
122
+ type: "object",
123
+ description: ARTIFACT_REF_DESCRIPTION,
124
+ properties: {
125
+ type: { type: "string", enum: ["artifact"] },
126
+ id: { type: "string", pattern: "^art_[0-9a-z]{10}$" },
127
+ },
128
+ required: ["type", "id"],
129
+ additionalProperties: false,
130
+ }
118
131
  default:
119
132
  schema satisfies never
120
133
  }
@@ -88,6 +88,20 @@ const PRIMITIVE_TRAITS = {
88
88
  shareableParam: false,
89
89
  unique: "userRef",
90
90
  },
91
+ // Artifact references match by identity alone. An artifact is reached through the object that
92
+ // holds it, so a reference stays out of telemetry, shared sessions, facets and unique values.
93
+ artifactRef: {
94
+ queryScalarKind: "artifactRef",
95
+ exact: true,
96
+ exactSearch: false,
97
+ sortable: false,
98
+ text: false,
99
+ contains: false,
100
+ facet: false,
101
+ telemetry: false,
102
+ shareableParam: false,
103
+ unique: undefined,
104
+ },
91
105
  } as const satisfies Record<PrimitiveSchema, PrimitiveTraits>
92
106
 
93
107
  export function isPrimitiveSchema(schema: unknown): schema is PrimitiveSchema {
@@ -0,0 +1,62 @@
1
+ import type { PrimitiveSchema, Schema, ValueType } from "./types"
2
+
3
+ /**
4
+ * Visit each value a schema holds at positions of one primitive, however deeply nested: array
5
+ * items, map values, object fields, and through value types.
6
+ *
7
+ * Positions whose value does not match the schema are skipped: shape validation reports them. A
8
+ * value type that refers to itself is followed once.
9
+ */
10
+ export function visitPrimitiveValues(
11
+ schema: Schema,
12
+ primitive: PrimitiveSchema,
13
+ value: unknown,
14
+ valueTypesById: ReadonlyMap<string, ValueType>,
15
+ visit: (value: unknown) => void,
16
+ seenValueTypeIds: ReadonlySet<string> = new Set()
17
+ ): void {
18
+ if (value === null || value === undefined) return
19
+
20
+ if (typeof schema === "string") {
21
+ if (schema === primitive) visit(value)
22
+ return
23
+ }
24
+
25
+ const visitBelow = (below: Schema, belowValue: unknown, seen = seenValueTypeIds) =>
26
+ visitPrimitiveValues(below, primitive, belowValue, valueTypesById, visit, seen)
27
+
28
+ switch (schema.type) {
29
+ case "array":
30
+ if (Array.isArray(value)) {
31
+ for (const item of value) visitBelow(schema.items, item)
32
+ }
33
+ return
34
+ case "map":
35
+ if (isRecord(value)) {
36
+ for (const item of Object.values(value)) visitBelow(schema.valueSchema, item)
37
+ }
38
+ return
39
+ case "object":
40
+ if (isRecord(value)) {
41
+ for (const [fieldId, field] of Object.entries(schema.properties)) {
42
+ visitBelow(field.schema, value[fieldId])
43
+ }
44
+ }
45
+ return
46
+ case "valueTypeRef": {
47
+ if (seenValueTypeIds.has(schema.valueTypeId)) return
48
+
49
+ const resolved = schema._resolved ?? valueTypesById.get(schema.valueTypeId)?.schema
50
+ if (!resolved) return
51
+
52
+ visitBelow(resolved, value, new Set([...seenValueTypeIds, schema.valueTypeId]))
53
+ return
54
+ }
55
+ case "enum":
56
+ return
57
+ }
58
+ }
59
+
60
+ function isRecord(value: unknown): value is Record<string, unknown> {
61
+ return typeof value === "object" && value !== null && !Array.isArray(value)
62
+ }
@@ -40,13 +40,18 @@ interface RefBuilder {
40
40
  user(): "userRef"
41
41
  /** Reference to a stored file, valued as a `FileRef`. Serialized as `"fileRef"`. */
42
42
  file(): "fileRef"
43
+ /**
44
+ * Reference to an artifact, valued `{ type: "artifact", id }` and followed at its latest
45
+ * version. Serialized as `"artifactRef"`.
46
+ */
47
+ artifact(): "artifactRef"
43
48
  }
44
49
 
45
50
  /**
46
51
  * Schemas that point outside the value itself.
47
52
  *
48
53
  * Scalars are plain strings (`"string"`, `"timestamp"`); anything that points elsewhere or takes
49
- * parameters is a builder: `ref(Customer)`, `ref.user()`, `ref.file()`.
54
+ * parameters is a builder: `ref(Customer)`, `ref.user()`, `ref.file()`, `ref.artifact()`.
50
55
  */
51
56
  export const ref: RefBuilder = Object.assign(
52
57
  <const TObjectType extends ObjectType>(
@@ -58,6 +63,7 @@ export const ref: RefBuilder = Object.assign(
58
63
  {
59
64
  user: (): "userRef" => "userRef",
60
65
  file: (): "fileRef" => "fileRef",
66
+ artifact: (): "artifactRef" => "artifactRef",
61
67
  }
62
68
  )
63
69
 
@@ -13,9 +13,10 @@ import {
13
13
  } from "./errors"
14
14
  import type { ObjectTypeWithPropertyTokens } from "./tokens"
15
15
  import { createLinkTokenMap, createPropertyTokenMap } from "./tokens"
16
- import type { ObjectType, Schema, ValueType } from "./types"
16
+ import type { ObjectType, Property, Schema, ValueType } from "./types"
17
17
  import { type UniquePropertyDefinition, uniquePropertiesOf } from "./unique-values"
18
18
  import {
19
+ findPrimitiveSchema,
19
20
  validatePrimaryProperties,
20
21
  validatePropertyDefinitions,
21
22
  validateQueryMetadata,
@@ -181,6 +182,7 @@ export class OntologyRegistry implements OntologyDefinitionCatalog {
181
182
  private readonly subTypesById = new Map<string, Set<string>>()
182
183
  private readonly primaryByTypeId: Map<string, string>
183
184
  private readonly uniqueByTypeId = new Map<string, readonly UniquePropertyDefinition[]>()
185
+ private readonly artifactRefsByTypeId = new Map<string, readonly Property[]>()
184
186
 
185
187
  constructor(options: OntologyRegistryOptions) {
186
188
  const { objectTypes, valueTypes } = collectOntology(options.sources)
@@ -212,6 +214,7 @@ export class OntologyRegistry implements OntologyDefinitionCatalog {
212
214
  }
213
215
  this.primaryByTypeId = validatePrimaryProperties(this.objectTypesById)
214
216
  this.indexUniqueProperties()
217
+ this.indexArtifactRefProperties()
215
218
  }
216
219
 
217
220
  // ── Public read API ──────────────────────────────────────
@@ -252,6 +255,14 @@ export class OntologyRegistry implements OntologyDefinitionCatalog {
252
255
  return this.uniqueByTypeId.get(objectTypeId) ?? []
253
256
  }
254
257
 
258
+ /**
259
+ * The properties of a type that can hold artifact references, however deeply nested, its
260
+ * inherited ones included. Empty for an unknown type.
261
+ */
262
+ listArtifactRefProperties(objectTypeId: string): readonly Property[] {
263
+ return this.artifactRefsByTypeId.get(objectTypeId) ?? []
264
+ }
265
+
255
266
  /** Collect all transitive sub-types of the given object type id. */
256
267
  listSubTypes(objectTypeId: string): string[] {
257
268
  const result: string[] = []
@@ -330,6 +341,20 @@ export class OntologyRegistry implements OntologyDefinitionCatalog {
330
341
  }
331
342
  }
332
343
 
344
+ /** Every object write records the artifacts its type's properties hold: find those once. */
345
+ private indexArtifactRefProperties(): void {
346
+ for (const [typeId, objectType] of this.objectTypesById) {
347
+ const properties = objectType.properties.filter((property) =>
348
+ findPrimitiveSchema(
349
+ property.schema,
350
+ this.valueTypesById,
351
+ (schema) => schema === "artifactRef"
352
+ )
353
+ )
354
+ if (properties.length > 0) this.artifactRefsByTypeId.set(typeId, properties)
355
+ }
356
+ }
357
+
333
358
  /**
334
359
  * Build the subtype graph from `extends` and `parents` declarations.
335
360
  *
@@ -23,6 +23,7 @@ import type { QuantitativeTypeId } from "./units"
23
23
  * - `"timestamp"` for `lastObservedAt`.
24
24
  * - `"fileRef"` for blob-backed documents, images, and attachments.
25
25
  * - `"userRef"` for a Sixb user, such as a task's assignee (author it with `ref.user()`).
26
+ * - `"artifactRef"` for an artifact, such as a meeting's kick-off canvas (`ref.artifact()`).
26
27
  * - `"double"` for telemetry such as temperature or humidity.
27
28
  */
28
29
  export type PrimitiveSchema =
@@ -36,6 +37,7 @@ export type PrimitiveSchema =
36
37
  | "uuid"
37
38
  | "fileRef"
38
39
  | "userRef"
40
+ | "artifactRef"
39
41
 
40
42
  export interface ValueTypeRefSchema {
41
43
  type: "valueTypeRef"
@@ -1,6 +1,7 @@
1
1
  import type { Principal } from "../auth/types"
2
2
  import type { UserStatus } from "../storage/auth/types"
3
3
  import { OntologyValidationError } from "./errors"
4
+ import { visitPrimitiveValues } from "./reference-values"
4
5
  import type { Schema, ValueType } from "./types"
5
6
 
6
7
  /**
@@ -21,6 +22,15 @@ export interface UserEmailColumn<TColumn extends string = string> {
21
22
  readonly column: TColumn
22
23
  }
23
24
 
25
+ /**
26
+ * A dataset column that names a member by user id, mapped to a `ref.user()` property of a
27
+ * projection. Built with `userRef.fromId(column)`.
28
+ */
29
+ export interface UserIdColumn<TColumn extends string = string> {
30
+ readonly kind: "userIdColumn"
31
+ readonly column: TColumn
32
+ }
33
+
24
34
  export const userRef: {
25
35
  /**
26
36
  * Build a reference to one user, for writes and query predicates:
@@ -34,6 +44,13 @@ export const userRef: {
34
44
  * The match ignores case. A row whose email no member has leaves the property empty.
35
45
  */
36
46
  fromEmail<const TColumn extends string>(column: TColumn): UserEmailColumn<TColumn>
47
+ /**
48
+ * Map a `ref.user()` property of a projection from a string column holding the member's user id:
49
+ * `.properties({ owner: userRef.fromId("owner_id") })`.
50
+ *
51
+ * A row whose id no member has leaves the property empty.
52
+ */
53
+ fromId<const TColumn extends string>(column: TColumn): UserIdColumn<TColumn>
37
54
  } = Object.assign(
38
55
  (id: string): UserRef => {
39
56
  if (typeof id !== "string" || !id.trim()) {
@@ -48,6 +65,13 @@ export const userRef: {
48
65
  }
49
66
  return Object.freeze({ kind: "userEmailColumn" as const, column })
50
67
  },
68
+
69
+ fromId<const TColumn extends string>(column: TColumn): UserIdColumn<TColumn> {
70
+ if (typeof column !== "string" || !column.trim()) {
71
+ throw new OntologyValidationError("[Sixb] userRef.fromId() needs a dataset column name.")
72
+ }
73
+ return Object.freeze({ kind: "userIdColumn" as const, column })
74
+ },
51
75
  }
52
76
  )
53
77
 
@@ -57,6 +81,12 @@ export function isUserEmailColumn(value: unknown): value is UserEmailColumn {
57
81
  return record.kind === "userEmailColumn" && typeof record.column === "string"
58
82
  }
59
83
 
84
+ export function isUserIdColumn(value: unknown): value is UserIdColumn {
85
+ if (typeof value !== "object" || value === null) return false
86
+ const record = value as Record<string, unknown>
87
+ return record.kind === "userIdColumn" && typeof record.column === "string"
88
+ }
89
+
60
90
  /** Exactly `{ type: "user", id }` with a nonblank id and no other field. */
61
91
  export function isUserRef(value: unknown): value is UserRef {
62
92
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false
@@ -120,48 +150,12 @@ export function collectUserRefIds(
120
150
  into: Set<string>,
121
151
  seenValueTypeIds: ReadonlySet<string> = new Set()
122
152
  ): Set<string> {
123
- if (value === null || value === undefined) return into
124
- if (typeof schema === "string") {
125
- if (schema === "userRef" && isUserRef(value)) into.add(value.id)
126
- return into
127
- }
128
- switch (schema.type) {
129
- case "array":
130
- if (Array.isArray(value)) {
131
- for (const item of value) {
132
- collectUserRefIds(schema.items, item, valueTypesById, into, seenValueTypeIds)
133
- }
134
- }
135
- return into
136
- case "map":
137
- if (isRecord(value)) {
138
- for (const item of Object.values(value)) {
139
- collectUserRefIds(schema.valueSchema, item, valueTypesById, into, seenValueTypeIds)
140
- }
141
- }
142
- return into
143
- case "object":
144
- if (isRecord(value)) {
145
- for (const [fieldId, field] of Object.entries(schema.properties)) {
146
- collectUserRefIds(field.schema, value[fieldId], valueTypesById, into, seenValueTypeIds)
147
- }
148
- }
149
- return into
150
- case "valueTypeRef": {
151
- if (seenValueTypeIds.has(schema.valueTypeId)) return into
152
- const resolved = schema._resolved ?? valueTypesById.get(schema.valueTypeId)?.schema
153
- if (!resolved) return into
154
- return collectUserRefIds(
155
- resolved,
156
- value,
157
- valueTypesById,
158
- into,
159
- new Set([...seenValueTypeIds, schema.valueTypeId])
160
- )
161
- }
162
- case "enum":
163
- return into
153
+ const collect = (held: unknown) => {
154
+ if (isUserRef(held)) into.add(held.id)
164
155
  }
156
+
157
+ visitPrimitiveValues(schema, "userRef", value, valueTypesById, collect, seenValueTypeIds)
158
+ return into
165
159
  }
166
160
 
167
161
  /**
@@ -187,7 +181,3 @@ export function userReferenceProblem(
187
181
  return `[Sixb] ${path} references user '${id}', who is ${status}. Only active users can be newly referenced; existing references are kept.`
188
182
  }
189
183
  }
190
-
191
- function isRecord(value: unknown): value is Record<string, unknown> {
192
- return typeof value === "object" && value !== null && !Array.isArray(value)
193
- }
@@ -1,5 +1,6 @@
1
1
  import { assertJsonValue, cloneJsonValue, type JsonValue } from "../../json"
2
2
  import type { ObjectFieldSchema, Property, Schema, ValueType } from ".."
3
+ import { isArtifactRef } from "../artifact-ref"
3
4
  import { normalizeDecimalValue } from "../decimal"
4
5
  import { OntologyValidationError } from "../errors"
5
6
  import { isUserRef } from "../user-ref"
@@ -55,6 +56,8 @@ export function normalizeSchemaValue(
55
56
  return cloneJsonValue(value)
56
57
  case "userRef":
57
58
  return normalizeUserRef(value, path)
59
+ case "artifactRef":
60
+ return normalizeArtifactRef(value, path)
58
61
  default:
59
62
  // Untyped definitions can still carry an unknown string; it keeps the JSON pass-through.
60
63
  schema satisfies never
@@ -162,6 +165,15 @@ function normalizeUserRef(value: unknown, path: string): JsonValue {
162
165
  return { type: "user", id: value.id }
163
166
  }
164
167
 
168
+ function normalizeArtifactRef(value: unknown, path: string): JsonValue {
169
+ if (!isArtifactRef(value)) {
170
+ throw new OntologyValidationError(
171
+ `[Sixb] Property ${path} must be an artifact reference { type: "artifact", id }`
172
+ )
173
+ }
174
+ return { type: "artifact", id: value.id }
175
+ }
176
+
165
177
  function normalizeDateLike(value: unknown, path: string): Date {
166
178
  const date = value instanceof Date ? value : new Date(String(value))
167
179
  if (Number.isNaN(date.getTime())) {
@@ -199,6 +211,7 @@ export function coerceSchemaValueToTyped(
199
211
  case "boolean":
200
212
  case "fileRef":
201
213
  case "userRef":
214
+ case "artifactRef":
202
215
  return value
203
216
  default:
204
217
  schema satisfies never
@@ -202,6 +202,15 @@ export function validatePropertyDefinitions(
202
202
  `[Sixb] ${path} cannot use ref.user(). User references are supported on object properties only.`
203
203
  )
204
204
  }
205
+
206
+ // Nor that referenced artifacts exist, and no index records the links that hold one.
207
+ if (
208
+ findPrimitiveSchema(property.schema, valueTypesById, (schema) => schema === "artifactRef")
209
+ ) {
210
+ throw new OntologyValidationError(
211
+ `[Sixb] ${path} cannot use ref.artifact(). Artifact references are supported on object properties only.`
212
+ )
213
+ }
205
214
  }
206
215
  }
207
216
  }
@@ -1,6 +1,7 @@
1
1
  import { isFileRef, isValidFileRef } from "../../blob-storage/validation"
2
2
  import { withFailureMessage } from "../../errors/failure-message"
3
3
  import type { ObjectFieldSchema, Schema, ValueType, ValueTypeRefSchema } from ".."
4
+ import { isArtifactRef } from "../artifact-ref"
4
5
  import { isDecimalString } from "../decimal"
5
6
  import { OntologyValidationError } from "../errors"
6
7
  import { currentUserNotStorableMessage, isCurrentUser, isUserRef } from "../user-ref"
@@ -99,6 +100,17 @@ export function validateSchemaValue(
99
100
  }
100
101
  return
101
102
  }
103
+ case "artifactRef": {
104
+ if (!isArtifactRef(value)) {
105
+ throw withFailureMessage(
106
+ new OntologyValidationError(
107
+ `[Sixb] Property ${path} must be an artifact reference { type: "artifact", id }`
108
+ ),
109
+ `Property ${diagnosticPath} must be an artifact reference.`
110
+ )
111
+ }
112
+ return
113
+ }
102
114
  default:
103
115
  // Every primitive validates its values above. Untyped definitions can still carry an
104
116
  // unknown string; it keeps falling through without a check.
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Work that was started and has not finished, so shutdown can wait for it without waiting forever.
3
+ *
4
+ * Whoever started the work handles how it ends; this only waits, so a rejection is not reported here.
5
+ */
6
+ export class PendingTasks {
7
+ private readonly tasks = new Set<Promise<void>>()
8
+
9
+ get size(): number {
10
+ return this.tasks.size
11
+ }
12
+
13
+ track(task: Promise<unknown>): void {
14
+ const settled: Promise<void> = task
15
+ .then(
16
+ () => undefined,
17
+ () => undefined
18
+ )
19
+ .finally(() => {
20
+ this.tasks.delete(settled)
21
+ })
22
+ this.tasks.add(settled)
23
+ }
24
+
25
+ /**
26
+ * Wait for the tracked work, and for work tracked meanwhile, for at most `timeoutMs`. Resolves
27
+ * `false` when time ran out first: a task that never settles must not stop shutdown.
28
+ */
29
+ async drain(timeoutMs: number): Promise<boolean> {
30
+ const deadline = Date.now() + Math.max(0, timeoutMs)
31
+ while (this.tasks.size > 0) {
32
+ const remainingMs = deadline - Date.now()
33
+ if (remainingMs <= 0 || !(await this.settleWithin(remainingMs))) return false
34
+ }
35
+ return true
36
+ }
37
+
38
+ private async settleWithin(timeoutMs: number): Promise<boolean> {
39
+ let timeout: ReturnType<typeof setTimeout> | undefined
40
+ try {
41
+ return await Promise.race([
42
+ Promise.all([...this.tasks]).then(() => true),
43
+ new Promise<false>((resolve) => {
44
+ timeout = setTimeout(() => resolve(false), timeoutMs)
45
+ }),
46
+ ])
47
+ } finally {
48
+ if (timeout) clearTimeout(timeout)
49
+ }
50
+ }
51
+ }