@sixb/core 0.2.4 → 0.2.5

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 (562) hide show
  1. package/dist/actions/index.js +28 -28
  2. package/dist/agents/execution.d.ts +34 -2
  3. package/dist/agents/execution.d.ts.map +1 -1
  4. package/dist/agents/ids.d.ts +2 -0
  5. package/dist/agents/ids.d.ts.map +1 -1
  6. package/dist/agents/index.d.ts +6 -4
  7. package/dist/agents/index.d.ts.map +1 -1
  8. package/dist/agents/index.js +51 -33
  9. package/dist/agents/index.js.map +1 -1
  10. package/dist/agents/queued-turn.d.ts +16 -0
  11. package/dist/agents/queued-turn.d.ts.map +1 -0
  12. package/dist/agents/request.d.ts +79 -1
  13. package/dist/agents/request.d.ts.map +1 -1
  14. package/dist/agents/run-after-finish.d.ts +10 -0
  15. package/dist/agents/run-after-finish.d.ts.map +1 -1
  16. package/dist/agents/run-artifacts.d.ts +0 -38
  17. package/dist/agents/run-artifacts.d.ts.map +1 -1
  18. package/dist/agents/run-events.d.ts +6 -1
  19. package/dist/agents/run-events.d.ts.map +1 -1
  20. package/dist/agents/run-session-http.d.ts.map +1 -1
  21. package/dist/agents/run-session-serve.d.ts.map +1 -1
  22. package/dist/agents/run-session.d.ts +14 -1
  23. package/dist/agents/run-session.d.ts.map +1 -1
  24. package/dist/agents/run-turn.d.ts.map +1 -1
  25. package/dist/agents/streams/index.d.ts +1 -1
  26. package/dist/agents/streams/index.d.ts.map +1 -1
  27. package/dist/agents/streams/index.js +1 -1
  28. package/dist/agents/streams/internal.js +1 -1
  29. package/dist/agents/streams/protocol.d.ts +16 -0
  30. package/dist/agents/streams/protocol.d.ts.map +1 -1
  31. package/dist/agents/turn-answered.d.ts +7 -0
  32. package/dist/agents/turn-answered.d.ts.map +1 -0
  33. package/dist/agents/validation.d.ts +1 -1
  34. package/dist/agents/validation.d.ts.map +1 -1
  35. package/dist/artifacts/canvas-display.d.ts +3 -5
  36. package/dist/artifacts/canvas-display.d.ts.map +1 -1
  37. package/dist/artifacts/comments.d.ts +14 -3
  38. package/dist/artifacts/comments.d.ts.map +1 -1
  39. package/dist/artifacts/document-fill.d.ts +18 -0
  40. package/dist/artifacts/document-fill.d.ts.map +1 -0
  41. package/dist/artifacts/errors.d.ts +1 -1
  42. package/dist/artifacts/errors.d.ts.map +1 -1
  43. package/dist/artifacts/events.d.ts +3 -2
  44. package/dist/artifacts/events.d.ts.map +1 -1
  45. package/dist/artifacts/execution.d.ts +40 -4
  46. package/dist/artifacts/execution.d.ts.map +1 -1
  47. package/dist/artifacts/frames/assets.d.ts +8 -1
  48. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  49. package/dist/artifacts/frames/document-data.d.ts +98 -0
  50. package/dist/artifacts/frames/document-data.d.ts.map +1 -0
  51. package/dist/artifacts/frames/entries.d.ts +12 -7
  52. package/dist/artifacts/frames/entries.d.ts.map +1 -1
  53. package/dist/artifacts/frames/index.d.ts +2 -1
  54. package/dist/artifacts/frames/index.d.ts.map +1 -1
  55. package/dist/artifacts/frames/index.js +22 -13
  56. package/dist/artifacts/frames/index.js.map +4 -4
  57. package/dist/artifacts/frames/kit.d.ts +15 -0
  58. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  59. package/dist/artifacts/frames/protocol.d.ts +12 -1
  60. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  61. package/dist/artifacts/frames/runtime.d.ts +24 -4
  62. package/dist/artifacts/frames/runtime.d.ts.map +1 -1
  63. package/dist/artifacts/index.d.ts +3 -1
  64. package/dist/artifacts/index.d.ts.map +1 -1
  65. package/dist/artifacts/index.js +9 -3
  66. package/dist/artifacts/index.js.map +3 -3
  67. package/dist/artifacts/live/blocks.d.ts +62 -0
  68. package/dist/artifacts/live/blocks.d.ts.map +1 -0
  69. package/dist/artifacts/live/board.d.ts +6 -0
  70. package/dist/artifacts/live/board.d.ts.map +1 -1
  71. package/dist/artifacts/live/document.d.ts +12 -0
  72. package/dist/artifacts/live/document.d.ts.map +1 -1
  73. package/dist/artifacts/live/index.d.ts +2 -0
  74. package/dist/artifacts/live/index.d.ts.map +1 -1
  75. package/dist/artifacts/live/index.js +148 -44
  76. package/dist/artifacts/live/index.js.map +3 -3
  77. package/dist/artifacts/live/page.d.ts +49 -0
  78. package/dist/artifacts/live/page.d.ts.map +1 -0
  79. package/dist/artifacts/live/protocol.d.ts +5 -0
  80. package/dist/artifacts/live/protocol.d.ts.map +1 -1
  81. package/dist/artifacts/live/server.d.ts +2 -2
  82. package/dist/artifacts/live/server.d.ts.map +1 -1
  83. package/dist/artifacts/live/server.js +23 -19
  84. package/dist/artifacts/live/server.js.map +1 -1
  85. package/dist/artifacts/live/state.d.ts +4 -1
  86. package/dist/artifacts/live/state.d.ts.map +1 -1
  87. package/dist/artifacts/outline.d.ts +16 -0
  88. package/dist/artifacts/outline.d.ts.map +1 -1
  89. package/dist/artifacts/paper.d.ts +22 -0
  90. package/dist/artifacts/paper.d.ts.map +1 -0
  91. package/dist/artifacts/pdf-job.d.ts +9 -0
  92. package/dist/artifacts/pdf-job.d.ts.map +1 -0
  93. package/dist/artifacts/publish/fields.d.ts +25 -0
  94. package/dist/artifacts/publish/fields.d.ts.map +1 -0
  95. package/dist/artifacts/publish/index.d.ts +2 -1
  96. package/dist/artifacts/publish/index.d.ts.map +1 -1
  97. package/dist/artifacts/publish/index.js +26 -18
  98. package/dist/artifacts/publish/index.js.map +1 -1
  99. package/dist/artifacts/publish/merge.d.ts +5 -5
  100. package/dist/artifacts/publish/merge.d.ts.map +1 -1
  101. package/dist/artifacts/publish/pdf.d.ts +28 -0
  102. package/dist/artifacts/publish/pdf.d.ts.map +1 -0
  103. package/dist/artifacts/publish/previews.d.ts +12 -20
  104. package/dist/artifacts/publish/previews.d.ts.map +1 -1
  105. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  106. package/dist/artifacts/publish/queries.d.ts +6 -1
  107. package/dist/artifacts/publish/queries.d.ts.map +1 -1
  108. package/dist/artifacts/publish/query-answers.d.ts +5 -2
  109. package/dist/artifacts/publish/query-answers.d.ts.map +1 -1
  110. package/dist/artifacts/publish/validate/document-html.d.ts +24 -0
  111. package/dist/artifacts/publish/validate/document-html.d.ts.map +1 -0
  112. package/dist/artifacts/publish/validate/document.d.ts +5 -3
  113. package/dist/artifacts/publish/validate/document.d.ts.map +1 -1
  114. package/dist/artifacts/queries.d.ts +16 -2
  115. package/dist/artifacts/queries.d.ts.map +1 -1
  116. package/dist/auth/index.js +2 -2
  117. package/dist/authorization/event-visibility.d.ts.map +1 -1
  118. package/dist/authorization/index.js +1 -1
  119. package/dist/blob-storage/index.js +1 -1
  120. package/dist/bootstrap/index.js +38 -38
  121. package/dist/{chunk-8bns0y68.js → chunk-0hkdtwqk.js} +5 -5
  122. package/dist/{chunk-p8pgnq8d.js → chunk-0mvjpgvm.js} +5 -5
  123. package/dist/{chunk-2bn6813a.js → chunk-1yh6jgtz.js} +1 -1
  124. package/dist/{chunk-msyevpp3.js → chunk-5t9gm5tt.js} +4 -4
  125. package/dist/{chunk-a6fjkcne.js → chunk-60662fyv.js} +54 -28
  126. package/dist/{chunk-a6fjkcne.js.map → chunk-60662fyv.js.map} +7 -6
  127. package/dist/{chunk-e0hnbb1m.js → chunk-61zptves.js} +1 -1
  128. package/dist/{chunk-td26wjr5.js → chunk-68hm50qh.js} +3 -3
  129. package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
  130. package/dist/chunk-8tv3qd65.js.map +12 -0
  131. package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
  132. package/dist/{chunk-3z1vxzcm.js → chunk-aw1z0gre.js} +4 -4
  133. package/dist/{chunk-evj5jxz3.js → chunk-b4escq4c.js} +62 -14
  134. package/dist/{chunk-evj5jxz3.js.map → chunk-b4escq4c.js.map} +7 -7
  135. package/dist/chunk-bqr703h4.js +1799 -0
  136. package/dist/chunk-bqr703h4.js.map +13 -0
  137. package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
  138. package/dist/chunk-c29729me.js.map +12 -0
  139. package/dist/{chunk-t24yktqr.js → chunk-dvgc56n2.js} +20 -4
  140. package/dist/{chunk-t24yktqr.js.map → chunk-dvgc56n2.js.map} +5 -5
  141. package/dist/{chunk-3014rfjz.js → chunk-ewqn51gr.js} +25 -7
  142. package/dist/{chunk-3014rfjz.js.map → chunk-ewqn51gr.js.map} +3 -3
  143. package/dist/{chunk-t0s7b3d1.js → chunk-ey1p8w68.js} +173 -4
  144. package/dist/chunk-ey1p8w68.js.map +13 -0
  145. package/dist/{chunk-gxwy4c3s.js → chunk-fpf57gca.js} +316 -57
  146. package/dist/chunk-fpf57gca.js.map +47 -0
  147. package/dist/{chunk-r9rtavg9.js → chunk-fzae1jpq.js} +7 -7
  148. package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
  149. package/dist/chunk-fzbhybya.js.map +11 -0
  150. package/dist/{chunk-w1wq7gfr.js → chunk-gjhrz66x.js} +225 -17
  151. package/dist/{chunk-w1wq7gfr.js.map → chunk-gjhrz66x.js.map} +5 -5
  152. package/dist/chunk-hn2r7z41.js.map +1 -1
  153. package/dist/{chunk-vepea5c3.js → chunk-k29n4176.js} +6 -6
  154. package/dist/{chunk-48c1z8nj.js → chunk-k3jh8gsg.js} +10 -2
  155. package/dist/chunk-k3jh8gsg.js.map +10 -0
  156. package/dist/{chunk-yy914zfr.js → chunk-m3qx2pns.js} +751 -93
  157. package/dist/chunk-m3qx2pns.js.map +34 -0
  158. package/dist/{chunk-smnt672s.js → chunk-m9ketb51.js} +20 -4
  159. package/dist/chunk-m9ketb51.js.map +10 -0
  160. package/dist/chunk-mbwsgjn7.js +40 -0
  161. package/dist/chunk-mbwsgjn7.js.map +11 -0
  162. package/dist/{chunk-sysnvjce.js → chunk-naxjka9v.js} +2 -2
  163. package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
  164. package/dist/chunk-nxysqbt0.js.map +10 -0
  165. package/dist/{chunk-vzkxqf8h.js → chunk-paxabbqd.js} +49 -5
  166. package/dist/chunk-paxabbqd.js.map +23 -0
  167. package/dist/{chunk-8tqnsx3q.js → chunk-pc7kra3k.js} +5 -3
  168. package/dist/{chunk-8tqnsx3q.js.map → chunk-pc7kra3k.js.map} +3 -3
  169. package/dist/{chunk-6ef4esq4.js → chunk-pqvvqc65.js} +4 -4
  170. package/dist/chunk-pvpq483h.js.map +2 -2
  171. package/dist/{chunk-mzx71snp.js → chunk-q7g9cqwt.js} +7 -2
  172. package/dist/{chunk-mzx71snp.js.map → chunk-q7g9cqwt.js.map} +3 -3
  173. package/dist/{chunk-8t2ynwg0.js → chunk-q8d9p0tb.js} +24 -1
  174. package/dist/{chunk-8t2ynwg0.js.map → chunk-q8d9p0tb.js.map} +3 -3
  175. package/dist/{chunk-wa05txmk.js → chunk-qavwr628.js} +49 -5
  176. package/dist/chunk-qavwr628.js.map +12 -0
  177. package/dist/{chunk-rsrc7vtw.js → chunk-rg725hry.js} +174 -30
  178. package/dist/{chunk-rsrc7vtw.js.map → chunk-rg725hry.js.map} +9 -8
  179. package/dist/{chunk-rsxb14an.js → chunk-s1mqyqmm.js} +3 -3
  180. package/dist/{chunk-p351afzm.js → chunk-s5pj68fa.js} +2 -2
  181. package/dist/{chunk-855w9nvw.js → chunk-vehcr9eb.js} +1 -1
  182. package/dist/{chunk-hvbvq7p4.js → chunk-vs2s3p8n.js} +731 -10
  183. package/dist/chunk-vs2s3p8n.js.map +20 -0
  184. package/dist/chunk-vtjzwymr.js.map +2 -2
  185. package/dist/{chunk-n68vz95m.js → chunk-wqe9shx2.js} +1 -1
  186. package/dist/{chunk-0k3r5kb3.js → chunk-xcrnrpfh.js} +1 -1
  187. package/dist/{chunk-cwdzcv37.js → chunk-xrmbhap8.js} +2 -2
  188. package/dist/{chunk-cwdzcv37.js.map → chunk-xrmbhap8.js.map} +2 -2
  189. package/dist/{chunk-f6ahf5gf.js → chunk-xxfj0rr2.js} +20 -5
  190. package/dist/chunk-xxfj0rr2.js.map +13 -0
  191. package/dist/{chunk-3hzhcfsv.js → chunk-y8fwm3z2.js} +2 -2
  192. package/dist/{chunk-3hzhcfsv.js.map → chunk-y8fwm3z2.js.map} +3 -3
  193. package/dist/{chunk-rtm1jq00.js → chunk-z1njfqqs.js} +439 -48
  194. package/dist/{chunk-rtm1jq00.js.map → chunk-z1njfqqs.js.map} +10 -8
  195. package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
  196. package/dist/chunk-z4jqb44a.js.map +10 -0
  197. package/dist/{chunk-s7xqfxs9.js → chunk-zft9bzbc.js} +2 -1
  198. package/dist/{chunk-s7xqfxs9.js.map → chunk-zft9bzbc.js.map} +3 -3
  199. package/dist/{chunk-7kpqntgw.js → chunk-zxhym8tr.js} +1 -1
  200. package/dist/connectors/connection-handles.d.ts +9 -0
  201. package/dist/connectors/connection-handles.d.ts.map +1 -0
  202. package/dist/connectors/connections/authorizations.d.ts +9 -0
  203. package/dist/connectors/connections/authorizations.d.ts.map +1 -1
  204. package/dist/connectors/connections/events.d.ts +17 -0
  205. package/dist/connectors/connections/events.d.ts.map +1 -0
  206. package/dist/connectors/connections/runs.d.ts +3 -0
  207. package/dist/connectors/connections/runs.d.ts.map +1 -1
  208. package/dist/connectors/connections/service.d.ts +4 -0
  209. package/dist/connectors/connections/service.d.ts.map +1 -1
  210. package/dist/connectors/execution.d.ts +7 -1
  211. package/dist/connectors/execution.d.ts.map +1 -1
  212. package/dist/connectors/index.d.ts +1 -1
  213. package/dist/connectors/index.d.ts.map +1 -1
  214. package/dist/connectors/types.d.ts +22 -1
  215. package/dist/connectors/types.d.ts.map +1 -1
  216. package/dist/datasets/write.js +1 -1
  217. package/dist/deploy/index.d.ts +1 -1
  218. package/dist/deploy/index.d.ts.map +1 -1
  219. package/dist/deploy/internal.js +3 -2
  220. package/dist/deploy/internal.js.map +3 -3
  221. package/dist/deploy/services.d.ts.map +1 -1
  222. package/dist/deploy/types.d.ts +18 -1
  223. package/dist/deploy/types.d.ts.map +1 -1
  224. package/dist/events/definitions.d.ts +4 -0
  225. package/dist/events/definitions.d.ts.map +1 -1
  226. package/dist/events/execution.d.ts.map +1 -1
  227. package/dist/events/index.d.ts +2 -2
  228. package/dist/events/index.d.ts.map +1 -1
  229. package/dist/events/index.js +3 -3
  230. package/dist/events/outbox-dispatcher.d.ts +7 -0
  231. package/dist/events/outbox-dispatcher.d.ts.map +1 -1
  232. package/dist/events/scope.d.ts +1 -0
  233. package/dist/events/scope.d.ts.map +1 -1
  234. package/dist/events/scope.js +1 -1
  235. package/dist/events/selectors/builder.d.ts +9 -1
  236. package/dist/events/selectors/builder.d.ts.map +1 -1
  237. package/dist/events/selectors/index.d.ts +2 -2
  238. package/dist/events/selectors/index.d.ts.map +1 -1
  239. package/dist/events/selectors/index.js +2 -2
  240. package/dist/events/selectors/predicate.d.ts.map +1 -1
  241. package/dist/events/selectors/types.d.ts +18 -3
  242. package/dist/events/selectors/types.d.ts.map +1 -1
  243. package/dist/events/types/artifacts.d.ts +7 -1
  244. package/dist/events/types/artifacts.d.ts.map +1 -1
  245. package/dist/events/types/connectors.d.ts +32 -0
  246. package/dist/events/types/connectors.d.ts.map +1 -0
  247. package/dist/events/types/index.d.ts +3 -1
  248. package/dist/events/types/index.d.ts.map +1 -1
  249. package/dist/execution/agent.js +28 -28
  250. package/dist/execution/authorization.d.ts +5 -0
  251. package/dist/execution/authorization.d.ts.map +1 -1
  252. package/dist/execution/primitive.js +28 -28
  253. package/dist/execution/request.js +29 -29
  254. package/dist/execution/scopes.d.ts +8 -0
  255. package/dist/execution/scopes.d.ts.map +1 -1
  256. package/dist/execution/script.d.ts +7 -0
  257. package/dist/execution/script.d.ts.map +1 -0
  258. package/dist/execution/types.d.ts +16 -1
  259. package/dist/execution/types.d.ts.map +1 -1
  260. package/dist/http/api-routes.d.ts.map +1 -1
  261. package/dist/http/index.js +1 -1
  262. package/dist/index.d.ts +9 -8
  263. package/dist/index.d.ts.map +1 -1
  264. package/dist/index.js +46 -44
  265. package/dist/index.js.map +1 -1
  266. package/dist/lake-storage/index.js +1 -1
  267. package/dist/lineage/executors.d.ts +1 -1
  268. package/dist/lineage/executors.d.ts.map +1 -1
  269. package/dist/maintenance/index.js +1 -1
  270. package/dist/materialization/event-envelopes.d.ts +3 -3
  271. package/dist/materialization/event-envelopes.d.ts.map +1 -1
  272. package/dist/materialization/events.d.ts +6 -0
  273. package/dist/materialization/events.d.ts.map +1 -1
  274. package/dist/materialization/index.js +1 -1
  275. package/dist/materialization/model.d.ts +6 -0
  276. package/dist/materialization/model.d.ts.map +1 -1
  277. package/dist/materializer/index.js +13 -13
  278. package/dist/materializer/projections/replace.d.ts.map +1 -1
  279. package/dist/materializer/projections/replacement-plan.d.ts +2 -0
  280. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  281. package/dist/materializer/shared/normalize.d.ts +1 -0
  282. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  283. package/dist/models/execution/index.js +12 -12
  284. package/dist/objects/index.js +28 -28
  285. package/dist/objects/query/index.js +12 -12
  286. package/dist/pipelines/index.js +18 -18
  287. package/dist/projections/builders.d.ts +7 -1
  288. package/dist/projections/builders.d.ts.map +1 -1
  289. package/dist/projections/index.d.ts +1 -1
  290. package/dist/projections/index.d.ts.map +1 -1
  291. package/dist/projections/internal.js +13 -13
  292. package/dist/projections/types.d.ts +10 -0
  293. package/dist/projections/types.d.ts.map +1 -1
  294. package/dist/projections/validation.d.ts.map +1 -1
  295. package/dist/queues/in-memory.d.ts +2 -1
  296. package/dist/queues/in-memory.d.ts.map +1 -1
  297. package/dist/queues/index.d.ts +1 -1
  298. package/dist/queues/index.d.ts.map +1 -1
  299. package/dist/queues/index.js +1 -1
  300. package/dist/queues/types.d.ts +40 -13
  301. package/dist/queues/types.d.ts.map +1 -1
  302. package/dist/runtime/host.d.ts +13 -0
  303. package/dist/runtime/host.d.ts.map +1 -1
  304. package/dist/runtime/internal.d.ts +1 -0
  305. package/dist/runtime/internal.d.ts.map +1 -1
  306. package/dist/runtime/internal.js +39 -18
  307. package/dist/runtime/internal.js.map +4 -3
  308. package/dist/runtime/resolve-definitions.d.ts +1 -1
  309. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  310. package/dist/runtime/script.d.ts +39 -0
  311. package/dist/runtime/script.d.ts.map +1 -0
  312. package/dist/runtime/sixb.d.ts +2 -2
  313. package/dist/runtime/sixb.d.ts.map +1 -1
  314. package/dist/schedules/builders.d.ts.map +1 -1
  315. package/dist/schedules/index.js +3 -3
  316. package/dist/schedules/runtime.d.ts.map +1 -1
  317. package/dist/schedules/validation.d.ts +2 -0
  318. package/dist/schedules/validation.d.ts.map +1 -1
  319. package/dist/shares/internal.js +12 -12
  320. package/dist/storage/agents/errors.d.ts +1 -1
  321. package/dist/storage/agents/errors.d.ts.map +1 -1
  322. package/dist/storage/agents/in-memory.d.ts +26 -1
  323. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  324. package/dist/storage/agents/index.d.ts +2 -2
  325. package/dist/storage/agents/index.d.ts.map +1 -1
  326. package/dist/storage/agents/provider.d.ts +12 -3
  327. package/dist/storage/agents/provider.d.ts.map +1 -1
  328. package/dist/storage/agents/provider.js +25 -5
  329. package/dist/storage/agents/provider.js.map +1 -1
  330. package/dist/storage/agents/types.d.ts +155 -0
  331. package/dist/storage/agents/types.d.ts.map +1 -1
  332. package/dist/storage/artifacts/in-memory.d.ts +7 -1
  333. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  334. package/dist/storage/artifacts/index.d.ts +1 -1
  335. package/dist/storage/artifacts/index.d.ts.map +1 -1
  336. package/dist/storage/artifacts/record.d.ts +2 -1
  337. package/dist/storage/artifacts/record.d.ts.map +1 -1
  338. package/dist/storage/artifacts/types.d.ts +34 -0
  339. package/dist/storage/artifacts/types.d.ts.map +1 -1
  340. package/dist/storage/executions/provider.d.ts +3 -3
  341. package/dist/storage/executions/provider.d.ts.map +1 -1
  342. package/dist/storage/executions/provider.js +1 -1
  343. package/dist/storage/executions/types.d.ts +6 -0
  344. package/dist/storage/executions/types.d.ts.map +1 -1
  345. package/dist/storage/executions/validation.d.ts.map +1 -1
  346. package/dist/storage/file-upload-sessions/provider.js +3 -3
  347. package/dist/storage/index.d.ts +3 -3
  348. package/dist/storage/index.d.ts.map +1 -1
  349. package/dist/storage/index.js +18 -14
  350. package/dist/storage/index.js.map +1 -1
  351. package/dist/storage/internal.d.ts +1 -1
  352. package/dist/storage/internal.d.ts.map +1 -1
  353. package/dist/storage/internal.js +8 -6
  354. package/dist/storage/internal.js.map +2 -2
  355. package/dist/storage/ontology/in-memory/replacement-plans.d.ts +2 -0
  356. package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
  357. package/dist/storage/ontology/provider.js +1 -1
  358. package/dist/storage/ontology/replacement-plans.d.ts +8 -0
  359. package/dist/storage/ontology/replacement-plans.d.ts.map +1 -1
  360. package/dist/storage/operation-scope.d.ts.map +1 -1
  361. package/dist/storage/operation-scope.js +1 -1
  362. package/dist/storage/workflow-runs/provider.js +3 -3
  363. package/dist/syncs/index.js +19 -19
  364. package/dist/testing/agent-execution.d.ts +3 -0
  365. package/dist/testing/agent-execution.d.ts.map +1 -1
  366. package/dist/testing/agent-inbox-storage-contract.d.ts +15 -0
  367. package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -0
  368. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  369. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  370. package/dist/testing/execution-storage-contract.d.ts.map +1 -1
  371. package/dist/testing/index.d.ts +1 -0
  372. package/dist/testing/index.d.ts.map +1 -1
  373. package/dist/testing/index.js +5524 -4555
  374. package/dist/testing/index.js.map +10 -9
  375. package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
  376. package/dist/testing/queues-contract.d.ts.map +1 -1
  377. package/dist/webhooks/connections.d.ts +3 -4
  378. package/dist/webhooks/connections.d.ts.map +1 -1
  379. package/dist/webhooks/index.d.ts +1 -1
  380. package/dist/webhooks/index.d.ts.map +1 -1
  381. package/dist/webhooks/internal.js +16 -49
  382. package/dist/webhooks/internal.js.map +3 -3
  383. package/dist/webhooks/types.d.ts +2 -11
  384. package/dist/webhooks/types.d.ts.map +1 -1
  385. package/dist/workers/queued-run-dispatch.d.ts.map +1 -1
  386. package/dist/workflows/index.js +35 -35
  387. package/package.json +6 -1
  388. package/src/agents/README.md +6 -2
  389. package/src/agents/execution.ts +167 -29
  390. package/src/agents/ids.ts +5 -0
  391. package/src/agents/index.ts +18 -4
  392. package/src/agents/queued-turn.ts +46 -0
  393. package/src/agents/request.ts +517 -2
  394. package/src/agents/run-after-finish.ts +259 -2
  395. package/src/agents/run-artifacts.ts +3 -93
  396. package/src/agents/run-events.ts +26 -1
  397. package/src/agents/run-session-http.ts +9 -2
  398. package/src/agents/run-session-serve.ts +2 -8
  399. package/src/agents/run-session.ts +142 -3
  400. package/src/agents/run-turn.ts +8 -0
  401. package/src/agents/streams/index.ts +1 -0
  402. package/src/agents/streams/protocol.ts +41 -1
  403. package/src/agents/turn-answered.ts +31 -0
  404. package/src/agents/validation.ts +2 -0
  405. package/src/artifacts/canvas-display.ts +4 -6
  406. package/src/artifacts/comments.ts +70 -17
  407. package/src/artifacts/document-fill.ts +103 -0
  408. package/src/artifacts/errors.ts +2 -0
  409. package/src/artifacts/events.ts +4 -1
  410. package/src/artifacts/execution.ts +265 -31
  411. package/src/artifacts/frames/assets.ts +42 -7
  412. package/src/artifacts/frames/document-data.ts +353 -0
  413. package/src/artifacts/frames/entries.ts +22 -16
  414. package/src/artifacts/frames/grants.ts +2 -2
  415. package/src/artifacts/frames/index.ts +3 -0
  416. package/src/artifacts/frames/kit.ts +102 -0
  417. package/src/artifacts/frames/protocol.ts +12 -1
  418. package/src/artifacts/frames/runtime.ts +413 -6
  419. package/src/artifacts/index.ts +3 -0
  420. package/src/artifacts/live/blocks.ts +889 -0
  421. package/src/artifacts/live/board.ts +195 -42
  422. package/src/artifacts/live/document.ts +170 -5
  423. package/src/artifacts/live/index.ts +7 -0
  424. package/src/artifacts/live/page.ts +807 -0
  425. package/src/artifacts/live/protocol.ts +5 -0
  426. package/src/artifacts/live/server.ts +2 -2
  427. package/src/artifacts/live/state.ts +9 -4
  428. package/src/artifacts/outline.ts +17 -0
  429. package/src/artifacts/paper.ts +173 -0
  430. package/src/artifacts/pdf-job.ts +11 -0
  431. package/src/artifacts/publish/fields.ts +177 -0
  432. package/src/artifacts/publish/index.ts +6 -1
  433. package/src/artifacts/publish/merge.ts +14 -12
  434. package/src/artifacts/publish/pdf.ts +82 -0
  435. package/src/artifacts/publish/previews.ts +24 -34
  436. package/src/artifacts/publish/publish.ts +26 -3
  437. package/src/artifacts/publish/queries.ts +20 -4
  438. package/src/artifacts/publish/query-answers.ts +14 -3
  439. package/src/artifacts/publish/validate/document-html.ts +245 -0
  440. package/src/artifacts/publish/validate/document.ts +34 -3
  441. package/src/artifacts/queries.ts +59 -13
  442. package/src/authorization/event-visibility.ts +13 -0
  443. package/src/connectors/connection-handles.ts +71 -0
  444. package/src/connectors/connections/authorizations.ts +50 -2
  445. package/src/connectors/connections/events.ts +57 -0
  446. package/src/connectors/connections/runs.ts +5 -0
  447. package/src/connectors/connections/service.ts +19 -1
  448. package/src/connectors/execution.ts +30 -2
  449. package/src/connectors/index.ts +3 -0
  450. package/src/connectors/types.ts +29 -1
  451. package/src/deploy/index.ts +1 -0
  452. package/src/deploy/services.ts +1 -0
  453. package/src/deploy/types.ts +26 -1
  454. package/src/events/definitions.ts +14 -0
  455. package/src/events/execution.ts +9 -2
  456. package/src/events/index.ts +8 -0
  457. package/src/events/outbox-dispatcher.ts +12 -2
  458. package/src/events/scope.ts +3 -0
  459. package/src/events/selectors/builder.ts +49 -0
  460. package/src/events/selectors/index.ts +5 -0
  461. package/src/events/selectors/predicate.ts +2 -0
  462. package/src/events/selectors/types.ts +30 -1
  463. package/src/events/types/artifacts.ts +7 -1
  464. package/src/events/types/connectors.ts +36 -0
  465. package/src/events/types/index.ts +7 -0
  466. package/src/execution/authorization.ts +45 -0
  467. package/src/execution/durable.ts +2 -0
  468. package/src/execution/scopes.ts +24 -0
  469. package/src/execution/script.ts +27 -0
  470. package/src/execution/types.ts +7 -1
  471. package/src/http/api-routes.ts +25 -0
  472. package/src/index.ts +21 -2
  473. package/src/lineage/executors.ts +3 -1
  474. package/src/materialization/event-envelopes.ts +10 -5
  475. package/src/materialization/events.ts +2 -0
  476. package/src/materialization/model.ts +6 -0
  477. package/src/materializer/README.md +10 -0
  478. package/src/materializer/projections/replace.ts +42 -1
  479. package/src/materializer/projections/replacement-plan.ts +44 -4
  480. package/src/materializer/shared/normalize.ts +4 -0
  481. package/src/projections/builders.ts +20 -0
  482. package/src/projections/index.ts +1 -0
  483. package/src/projections/registry.ts +1 -0
  484. package/src/projections/revision.ts +2 -0
  485. package/src/projections/types.ts +11 -0
  486. package/src/projections/validation.ts +6 -0
  487. package/src/queues/in-memory.ts +5 -0
  488. package/src/queues/index.ts +3 -1
  489. package/src/queues/types.ts +45 -14
  490. package/src/runtime/host.ts +112 -4
  491. package/src/runtime/internal.ts +1 -0
  492. package/src/runtime/resolve-definitions.ts +4 -1
  493. package/src/runtime/script.ts +62 -0
  494. package/src/runtime/sixb.ts +3 -3
  495. package/src/schedules/builders.ts +4 -1
  496. package/src/schedules/runtime.ts +3 -0
  497. package/src/schedules/validation.ts +20 -2
  498. package/src/storage/agents/errors.ts +1 -0
  499. package/src/storage/agents/in-memory.ts +229 -1
  500. package/src/storage/agents/index.ts +16 -0
  501. package/src/storage/agents/provider.ts +284 -2
  502. package/src/storage/agents/types.ts +167 -0
  503. package/src/storage/artifacts/in-memory.ts +32 -1
  504. package/src/storage/artifacts/index.ts +2 -0
  505. package/src/storage/artifacts/record.ts +25 -2
  506. package/src/storage/artifacts/types.ts +37 -0
  507. package/src/storage/executions/provider.ts +22 -2
  508. package/src/storage/executions/types.ts +2 -0
  509. package/src/storage/executions/validation.ts +27 -0
  510. package/src/storage/index.ts +18 -0
  511. package/src/storage/internal.ts +1 -0
  512. package/src/storage/ontology/in-memory/replacement-plans.ts +22 -0
  513. package/src/storage/ontology/replacement-plans.ts +6 -0
  514. package/src/storage/operation-scope.ts +1 -0
  515. package/src/testing/agent-execution.ts +45 -2
  516. package/src/testing/agent-inbox-storage-contract.ts +815 -0
  517. package/src/testing/agent-storage-contract.ts +103 -0
  518. package/src/testing/artifact-storage-contract.ts +72 -4
  519. package/src/testing/execution-storage-contract.ts +31 -0
  520. package/src/testing/index.ts +5 -0
  521. package/src/testing/materializer-storage-contract.ts +139 -1
  522. package/src/testing/queues-contract.ts +22 -0
  523. package/src/webhooks/connections.ts +9 -50
  524. package/src/webhooks/index.ts +0 -2
  525. package/src/webhooks/types.ts +2 -13
  526. package/src/workers/queued-run-dispatch.ts +8 -1
  527. package/dist/chunk-48c1z8nj.js.map +0 -10
  528. package/dist/chunk-58geavnf.js +0 -29
  529. package/dist/chunk-58geavnf.js.map +0 -10
  530. package/dist/chunk-9nsjjd44.js.map +0 -12
  531. package/dist/chunk-b9qfh2ya.js.map +0 -11
  532. package/dist/chunk-eptrvnby.js.map +0 -12
  533. package/dist/chunk-f6ahf5gf.js.map +0 -13
  534. package/dist/chunk-gxwy4c3s.js.map +0 -47
  535. package/dist/chunk-hvbvq7p4.js.map +0 -18
  536. package/dist/chunk-m2jerfef.js +0 -474
  537. package/dist/chunk-m2jerfef.js.map +0 -11
  538. package/dist/chunk-n4zzaf6q.js.map +0 -10
  539. package/dist/chunk-smnt672s.js.map +0 -10
  540. package/dist/chunk-t0s7b3d1.js.map +0 -13
  541. package/dist/chunk-vzkxqf8h.js.map +0 -23
  542. package/dist/chunk-wa05txmk.js.map +0 -11
  543. package/dist/chunk-yv8hv4wq.js.map +0 -10
  544. package/dist/chunk-yy914zfr.js.map +0 -30
  545. /package/dist/{chunk-8bns0y68.js.map → chunk-0hkdtwqk.js.map} +0 -0
  546. /package/dist/{chunk-p8pgnq8d.js.map → chunk-0mvjpgvm.js.map} +0 -0
  547. /package/dist/{chunk-2bn6813a.js.map → chunk-1yh6jgtz.js.map} +0 -0
  548. /package/dist/{chunk-msyevpp3.js.map → chunk-5t9gm5tt.js.map} +0 -0
  549. /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
  550. /package/dist/{chunk-td26wjr5.js.map → chunk-68hm50qh.js.map} +0 -0
  551. /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
  552. /package/dist/{chunk-3z1vxzcm.js.map → chunk-aw1z0gre.js.map} +0 -0
  553. /package/dist/{chunk-r9rtavg9.js.map → chunk-fzae1jpq.js.map} +0 -0
  554. /package/dist/{chunk-vepea5c3.js.map → chunk-k29n4176.js.map} +0 -0
  555. /package/dist/{chunk-sysnvjce.js.map → chunk-naxjka9v.js.map} +0 -0
  556. /package/dist/{chunk-6ef4esq4.js.map → chunk-pqvvqc65.js.map} +0 -0
  557. /package/dist/{chunk-rsxb14an.js.map → chunk-s1mqyqmm.js.map} +0 -0
  558. /package/dist/{chunk-p351afzm.js.map → chunk-s5pj68fa.js.map} +0 -0
  559. /package/dist/{chunk-855w9nvw.js.map → chunk-vehcr9eb.js.map} +0 -0
  560. /package/dist/{chunk-n68vz95m.js.map → chunk-wqe9shx2.js.map} +0 -0
  561. /package/dist/{chunk-0k3r5kb3.js.map → chunk-xcrnrpfh.js.map} +0 -0
  562. /package/dist/{chunk-7kpqntgw.js.map → chunk-zxhym8tr.js.map} +0 -0
@@ -41,6 +41,8 @@ export type ExecutionExecutor =
41
41
  }
42
42
  | { readonly type: "agent"; readonly actorId?: string; readonly runId: string }
43
43
  | { readonly type: "kernel"; readonly operation: KernelOperation }
44
+ /** A script someone ran with `sixb run`. */
45
+ | { readonly type: "script"; readonly runId: string }
44
46
 
45
47
  /**
46
48
  * Occurrence that directly triggered an execution.
@@ -55,8 +57,10 @@ export type ExecutionSource =
55
57
  | { readonly type: "event"; readonly eventId: string }
56
58
  | { readonly type: "datasetVersion"; readonly datasetId: string; readonly versionId: string }
57
59
  | { readonly type: "execution"; readonly executionId: string }
60
+ /** The script file, relative to the project, that `sixb run` ran. */
61
+ | { readonly type: "script"; readonly path: string }
58
62
 
59
- /** Immutable provenance for one request, primitive run, agent run, or kernel operation. */
63
+ /** Immutable provenance for one request, primitive run, agent run, kernel operation, or script. */
60
64
  export interface ExecutionContext {
61
65
  readonly id: string
62
66
  readonly projectId: string
@@ -78,6 +82,8 @@ export type AuthorizationRef =
78
82
  | { readonly type: "trustedPrimitive"; readonly primitive: TrustedPrimitiveRef }
79
83
  | { readonly type: "delegated"; readonly delegation: SharedAccessDelegationRef }
80
84
  | { readonly type: "kernel"; readonly operation: KernelOperation }
85
+ /** Unrestricted: whoever runs a script already holds the project's storage credentials. */
86
+ | { readonly type: "script"; readonly runId: string }
81
87
  | { readonly type: "disabled" }
82
88
 
83
89
  class RuntimeAuthorizationCapability {
@@ -444,6 +444,15 @@ export const SIXB_API_ROUTES: readonly SixbApiRoute[] = [
444
444
  accessToken: true,
445
445
  agentApi: true,
446
446
  },
447
+ // What waits beside the turn that runs, for the people reading and writing the thread. A run token
448
+ // reaches none of it: a steer arrives in the turn by itself, and the Agent has no inbox to read.
449
+ {
450
+ operationId: "listAgentThreadInbox",
451
+ method: "GET",
452
+ path: "/api/agent-threads/:threadId/inbox",
453
+ accessToken: true,
454
+ agentApi: false,
455
+ },
447
456
  {
448
457
  operationId: "getAgentMessageFileContent",
449
458
  method: "GET",
@@ -660,6 +669,22 @@ export const SIXB_API_ROUTES: readonly SixbApiRoute[] = [
660
669
  agentApi: true,
661
670
  sharedSession: true,
662
671
  },
672
+ {
673
+ operationId: "printArtifactPdf",
674
+ method: "POST",
675
+ path: "/api/artifacts/:artifactId/versions/:version/pdf",
676
+ accessToken: true,
677
+ agentApi: false,
678
+ sharedSession: true,
679
+ },
680
+ {
681
+ operationId: "getArtifactPdf",
682
+ method: "GET",
683
+ path: "/api/artifacts/:artifactId/versions/:version/pdf",
684
+ accessToken: true,
685
+ agentApi: false,
686
+ sharedSession: true,
687
+ },
663
688
  {
664
689
  operationId: "getArtifactBoardPreview",
665
690
  method: "GET",
package/src/index.ts CHANGED
@@ -235,6 +235,14 @@ export type {
235
235
  ArtifactCommentedEvent,
236
236
  ArtifactEvent,
237
237
  ArtifactUpdatedEvent,
238
+ ConnectorConnectionConnectedEvent,
239
+ ConnectorConnectionDisconnectedEvent,
240
+ ConnectorEvent,
241
+ ConnectorEventSelectorBuilder,
242
+ ConnectorEventSelectorContext,
243
+ ConnectorEventSelectorEvent,
244
+ ConnectorEventSelectorOperation,
245
+ ConnectorEventToken,
238
246
  DatasetEvent,
239
247
  DatasetEventSelectorBuilder,
240
248
  DatasetEventSelectorContext,
@@ -682,16 +690,19 @@ export type {
682
690
  ConnectorAdapter,
683
691
  ConnectorClient,
684
692
  ConnectorConnectionClientContext,
693
+ ConnectorConnectionHandle,
685
694
  ConnectorConnectionMetadata,
686
695
  ConnectorConnectionOptions,
687
696
  ConnectorConnectionOwner,
688
697
  ConnectorConnectionSelector,
698
+ ConnectorConnections,
689
699
  ConnectorContext,
690
700
  ConnectorDefinition,
691
701
  ConnectorDefinitionOptions,
692
702
  ConnectorOAuth2Authentication,
693
703
  ConnectorOAuthCredentials,
694
704
  ConnectorOAuthErrorKind,
705
+ ConnectorOAuthRevocation,
695
706
  ConnectorTokenSource,
696
707
  OAuthConnectorAdapter,
697
708
  OAuthConnectorAuthorizationContext,
@@ -710,8 +721,6 @@ export type {
710
721
  WebhookBodyFormat,
711
722
  WebhookBodyParser,
712
723
  WebhookBodySchema,
713
- WebhookConnection,
714
- WebhookConnections,
715
724
  WebhookConnectorClient,
716
725
  WebhookDefinition,
717
726
  WebhookHandlerContext,
@@ -946,6 +955,8 @@ export type {
946
955
  AgentApprovalDecision,
947
956
  AgentApprovalsRuntime,
948
957
  AgentChildListResult,
958
+ AgentInboxMessageUpdate,
959
+ AgentInboxRuntime,
949
960
  AgentPreferences,
950
961
  AgentPreferencesRuntime,
951
962
  AgentRunListResult,
@@ -957,6 +968,7 @@ export type {
957
968
  ConversationAgentRunView,
958
969
  DecideExecutionAgentApprovalInput,
959
970
  ExecutionAgentRunResult,
971
+ ExecutionAgentSendResult,
960
972
  ListAgentChildrenInput,
961
973
  ListAgentThreadViewsResult,
962
974
  ListExecutionAgentApprovalsInput,
@@ -981,6 +993,7 @@ export type {
981
993
  ArtifactContentInput,
982
994
  ArtifactHolderObject,
983
995
  ArtifactHolders,
996
+ ArtifactPdf,
984
997
  ArtifactQueryInput,
985
998
  ArtifactStateRuntime,
986
999
  ArtifactStateValue,
@@ -1142,6 +1155,7 @@ export {
1142
1155
  SixbHost,
1143
1156
  SyncValidationError,
1144
1157
  } from "./runtime"
1158
+ export type { ScriptContext } from "./runtime/script"
1145
1159
  export type { SchedulesRuntime } from "./schedules/execution"
1146
1160
  export type {
1147
1161
  ActionRunFailure,
@@ -1211,6 +1225,7 @@ export type {
1211
1225
  AgentMailPart,
1212
1226
  AgentMemoryReference,
1213
1227
  AgentMessage,
1228
+ AgentMessageDelivery,
1214
1229
  AgentMessagePart,
1215
1230
  AgentMessagePartType,
1216
1231
  AgentMessageRole,
@@ -1257,8 +1272,11 @@ export type {
1257
1272
  InferAgentToolOutput,
1258
1273
  RequestAgentRunInput,
1259
1274
  RequestAgentRunResult,
1275
+ SendAgentMessageInput,
1276
+ SendAgentMessageResult,
1260
1277
  } from "./agents"
1261
1278
  export {
1279
+ AGENT_MESSAGE_DELIVERIES,
1262
1280
  AGENT_REASONING_LEVELS,
1263
1281
  AgentDefinitionError,
1264
1282
  AgentRequestError,
@@ -1398,6 +1416,7 @@ export type {
1398
1416
  ObjectProjectionBuilder,
1399
1417
  ObjectProjectionConflictResolution,
1400
1418
  ObjectProjectionDefinition,
1419
+ ObjectProjectionMissingPolicy,
1401
1420
  ObjectProjectionTarget,
1402
1421
  ProjectionDefinition,
1403
1422
  ProjectionDefinitionCatalog,
@@ -7,7 +7,7 @@ import type { LineageReader } from "./reader"
7
7
 
8
8
  /**
9
9
  * The key a run is counted under once hidden, for an executor that names one: a primitive's run or
10
- * an Agent run. A request or a kernel operation names none.
10
+ * an Agent run. A request, a kernel operation, or a script names none.
11
11
  */
12
12
  export function executorRunKey(executor: EventExecutor): string | undefined {
13
13
  switch (executor.type) {
@@ -17,6 +17,7 @@ export function executorRunKey(executor: EventExecutor): string | undefined {
17
17
  return `agent-run:${executor.runId}`
18
18
  case "request":
19
19
  case "kernel":
20
+ case "script":
20
21
  return undefined
21
22
  }
22
23
  }
@@ -56,6 +57,7 @@ async function canViewExecutorRun(
56
57
  switch (executor.type) {
57
58
  case "request":
58
59
  case "kernel":
60
+ case "script":
59
61
  return true
60
62
  case "agent":
61
63
  return canViewAgentRun(reader, executor.runId)
@@ -116,13 +116,13 @@ export function materializationEvent(
116
116
 
117
117
  /**
118
118
  * What the events of a commit say about who asked for it and what wrote it, read from the
119
- * execution it ran under. A primitive's id lives in the execution's authority, the only place the
120
- * durable record keeps it.
119
+ * execution it ran under. A primitive's id lives in the execution's authority and a script's path
120
+ * in its source, the only places the durable record keeps them.
121
121
  */
122
122
  export function eventAttribution(
123
123
  execution: Pick<
124
124
  ExecutionRecord,
125
- "id" | "correlationId" | "requestedBy" | "executor" | "authorizationRef"
125
+ "id" | "correlationId" | "requestedBy" | "executor" | "authorizationRef" | "source"
126
126
  >
127
127
  ): OntologyMaterializationEventAttribution {
128
128
  const attribution = {
@@ -135,9 +135,9 @@ export function eventAttribution(
135
135
  }
136
136
 
137
137
  function eventExecutor(
138
- execution: Pick<ExecutionRecord, "id" | "executor" | "authorizationRef">
138
+ execution: Pick<ExecutionRecord, "id" | "executor" | "authorizationRef" | "source">
139
139
  ): EventExecutor {
140
- const { executor, authorizationRef } = execution
140
+ const { executor, authorizationRef, source } = execution
141
141
  switch (executor.type) {
142
142
  case "request":
143
143
  return { type: "request", requestId: executor.requestId }
@@ -145,6 +145,11 @@ function eventExecutor(
145
145
  return { type: "agent", runId: executor.runId }
146
146
  case "kernel":
147
147
  return { type: "kernel", operation: structuredClone(executor.operation) }
148
+ case "script":
149
+ if (source.type !== "script") {
150
+ throw new Error(`[Sixb] Script execution '${execution.id}' has no script source.`)
151
+ }
152
+ return { type: "script", runId: executor.runId, path: source.path }
148
153
  case "primitive":
149
154
  if (
150
155
  authorizationRef.type !== "trustedPrimitive" ||
@@ -29,6 +29,8 @@ export type EventExecutor =
29
29
  }
30
30
  | { readonly type: "agent"; readonly runId: string }
31
31
  | { readonly type: "kernel"; readonly operation: KernelOperation }
32
+ /** A `sixb run` script, by its path relative to the project. */
33
+ | { readonly type: "script"; readonly runId: string; readonly path: string }
32
34
 
33
35
  interface OntologyMaterializationEventBase {
34
36
  readonly id: string
@@ -230,6 +230,12 @@ export interface ProjectionSourceReplacement {
230
230
  /** Without a base, entries replace the whole source. With a base, unchanged roots are retained. */
231
231
  readonly entries: AsyncIterable<ProjectionSourceEntry | ProjectionSourceDeletion>
232
232
  readonly base?: ProjectionSourceBase
233
+ /**
234
+ * When the data of `datasetVersion` started being read from its source: the earliest start of
235
+ * the sync runs it comes from, through every pipeline in between. Omitted when unknown. A
236
+ * projection that removes what its dataset misses removes nothing an edit wrote after it.
237
+ */
238
+ readonly sourceReadAt?: string
233
239
  readonly signal?: AbortSignal
234
240
  }
235
241
 
@@ -112,6 +112,16 @@ of the run, unless the active source the plan replaces moved meanwhile: the plan
112
112
  Storage keeps a plan while its candidate is ready and maintenance deletes it afterwards, before the
113
113
  candidate itself, along with the touches no ready plan still needs.
114
114
 
115
+ An object an edit created exists through its `create` override, whatever the source holds. A
116
+ projection with `.whenMissing("remove")` hands that existence to its source once the source was
117
+ read after the edit: given the read time (`sourceReadAt`, which the worker resolves from the
118
+ dataset version's lineage), the plan rewrites the `create` of an object written before it, and
119
+ missing from the candidate, as a `patch`, in the same commit. The object then goes like any object
120
+ its source withdraws, and its edited values stay dormant until the row comes back. `open` adds the
121
+ created objects no live root asserts; those a live root asserts are planned with their root. That
122
+ holds for a delta too: an object no live root asserts is missing from the whole version unless the
123
+ delta adds it, and one a live root asserts is decided only when the delta replaces that root.
124
+
115
125
  The commit time is fixed when the plan opens: every planned row carries it as `updatedAt`, every
116
126
  planned event as `occurredAt`. A resumed plan keeps it, so a publication that commits later than
117
127
  it opened, after retries, stamps its writes with that earlier time, even over an edit committed in
@@ -23,6 +23,7 @@ import type {
23
23
  OntologyMaterializationStorage,
24
24
  OntologySourceRecord,
25
25
  OntologyStorage,
26
+ OpenReplacementPlanInput,
26
27
  ReplacementPlanRef,
27
28
  ReplacementPlanStatus,
28
29
  } from "../../storage/ontology"
@@ -50,6 +51,7 @@ import {
50
51
  normalizePinnedDatasetVersion,
51
52
  normalizeProjectionExecution,
52
53
  normalizeProjectionSourceRef,
54
+ normalizeSourceReadAt,
53
55
  } from "../shared/normalize"
54
56
  import { createProjectionRunMaterializationIdentity } from "../shared/projection-run"
55
57
  import { createProjectionEntryValidator } from "./entry-validator"
@@ -67,6 +69,11 @@ interface PreparedProjectionReplacement {
67
69
  readonly execution: ProjectionExecution
68
70
  readonly entries: AsyncIterable<ProjectionSourceEntry | ProjectionSourceDeletion>
69
71
  readonly base?: ProjectionSourceBase
72
+ /**
73
+ * Set when the projection removes what its dataset misses and its source read time is known:
74
+ * an object an edit created before it, which the dataset does not hold, is withdrawn.
75
+ */
76
+ readonly withdrawCreatesBefore?: string
70
77
  readonly signal?: AbortSignal
71
78
  readonly resolved: ResolvedSourceProjection
72
79
  readonly projectionKind: "object" | "link"
@@ -127,12 +134,14 @@ function prepareProjectionReplacement(
127
134
  idempotencyKey: createProjectionIdempotencyKey(runIdentity),
128
135
  normalizedCallerIntent: { source, datasetVersion },
129
136
  })
137
+ const withdrawCreatesBefore = missingRemovalReadAt(resolved, raw.input.sourceReadAt)
130
138
  const command = {
131
139
  source,
132
140
  datasetVersion,
133
141
  execution,
134
142
  entries: raw.input.entries,
135
143
  ...(raw.input.base ? { base: Object.freeze({ ...raw.input.base }) } : {}),
144
+ ...(withdrawCreatesBefore ? { withdrawCreatesBefore } : {}),
136
145
  resolved,
137
146
  projectionKind,
138
147
  runIdentity,
@@ -143,6 +152,21 @@ function prepareProjectionReplacement(
143
152
  return { ...command, signal: raw.input.signal }
144
153
  }
145
154
 
155
+ /**
156
+ * A read time matters only to a projection that removes what its dataset misses. An unknown one
157
+ * withdraws nothing: the projection keeps what edits created, as it does without the policy.
158
+ */
159
+ function missingRemovalReadAt(
160
+ resolved: ResolvedSourceProjection,
161
+ sourceReadAt: string | undefined
162
+ ): string | undefined {
163
+ if (sourceReadAt === undefined) return undefined
164
+ if (resolved.definition._tag !== "ObjectProjectionDefinition") return undefined
165
+ if (resolved.definition.missing !== "remove") return undefined
166
+
167
+ return normalizeSourceReadAt(sourceReadAt)
168
+ }
169
+
146
170
  function validateProjectionDataset(
147
171
  resolved: ResolvedSourceProjection,
148
172
  datasetVersion: PinnedDatasetVersion
@@ -351,6 +375,7 @@ async function commitProjectionCandidate(
351
375
  const { committedAt } = await plans.open({
352
376
  ...plan,
353
377
  commit: projectionCommit(context.projectId, command, ready.identity),
378
+ ...createdObjectsToPlan(command),
354
379
  })
355
380
  const commit = projectionCommit(context.projectId, command, { ...ready.identity, committedAt })
356
381
  for (let round = 1; ; round += 1) {
@@ -510,11 +535,27 @@ function projectionCommit(
510
535
  }
511
536
  }
512
537
 
538
+ /** The objects edits created, which only a projection that withdraws them has to decide. */
539
+ function createdObjectsToPlan(
540
+ command: PreparedProjectionReplacement
541
+ ): Pick<OpenReplacementPlanInput, "createdObjects"> {
542
+ const { definition } = command.resolved
543
+ if (!command.withdrawCreatesBefore || definition._tag !== "ObjectProjectionDefinition") return {}
544
+
545
+ return { createdObjects: { objectTypeId: definition.objectTypeId } }
546
+ }
547
+
513
548
  function planInput(
514
549
  command: PreparedProjectionReplacement,
515
550
  commit: OntologyCommitWrite
516
551
  ): ProjectionReplacementPlanInput {
517
- const input = { projectionKind: command.projectionKind, commit }
552
+ const input = {
553
+ projectionKind: command.projectionKind,
554
+ commit,
555
+ ...(command.withdrawCreatesBefore
556
+ ? { withdrawCreatesBefore: command.withdrawCreatesBefore }
557
+ : {}),
558
+ }
518
559
  return command.signal === undefined ? input : { ...input, signal: command.signal }
519
560
  }
520
561
 
@@ -1,4 +1,8 @@
1
- import type { EffectiveLinkChange, EffectiveObjectChange } from "../../materialization/model"
1
+ import type {
2
+ EffectiveLinkChange,
3
+ EffectiveObjectChange,
4
+ ObjectOverride,
5
+ } from "../../materialization/model"
2
6
  import {
3
7
  linkRefKey,
4
8
  linkRefSortKey,
@@ -8,6 +12,7 @@ import {
8
12
  utf8JsonByteLength,
9
13
  } from "../../materialization/refs"
10
14
  import type {
15
+ ExactObjectOverrideWrite,
11
16
  MaterializationPlanWorkItem,
12
17
  MaterializationWorkRecord,
13
18
  OntologyCommitWrite,
@@ -48,6 +53,8 @@ export interface ProjectionReplacementPlanInput {
48
53
  readonly projectionKind: "object" | "link"
49
54
  /** The commit the plan carries, timed as the plan was opened. */
50
55
  readonly commit: OntologyCommitWrite
56
+ /** An object an edit created before this instant, and that the dataset misses, is withdrawn. */
57
+ readonly withdrawCreatesBefore?: string
51
58
  readonly signal?: AbortSignal
52
59
  }
53
60
 
@@ -121,7 +128,9 @@ function planReplacementObject(
121
128
  input: ProjectionReplacementPlanInput,
122
129
  state: SourceReplacementObjectState
123
130
  ): MaterializationWorkRecord[] {
124
- const resolved = resolveReplacementObject(context, state)
131
+ const withdrawn = withdrawnCreate(input, state)
132
+ const override = withdrawn ? withdrawn.value : (state.override?.value ?? null)
133
+ const resolved = resolveReplacementObject(context, state, override)
125
134
  if (resolved) validateEffectiveObject(context.ontology, resolved.ref, resolved.properties)
126
135
 
127
136
  const change = diffEffectiveObject({
@@ -144,6 +153,10 @@ function planReplacementObject(
144
153
  work.push({ kind: "incident-object", recordKey: `incident:${sortKey}`, ref: state.ref })
145
154
  }
146
155
 
156
+ if (withdrawn) {
157
+ work.push(planWork({ kind: "object-override-upsert", value: withdrawn }, sortKey))
158
+ }
159
+
147
160
  if (!change) return work
148
161
  appendObjectChangeWork(context, work, sortKey, change)
149
162
  return work
@@ -257,15 +270,42 @@ function appendLinkChangeWork(
257
270
  work.push(eventWork(buildLinkMaterializationEventDraft(change)))
258
271
  }
259
272
 
273
+ /**
274
+ * An edit's create gives its object existence until the source is read after it. A dataset read
275
+ * later that does not hold the object decides: the create becomes a patch, as an edit of a source
276
+ * object would. It keeps every value the edits set and leaves existence to the source, so the
277
+ * object goes like any object its projection withdraws, and comes back with those values if the
278
+ * dataset holds it again. An edit after the read keeps the create until the next one.
279
+ */
280
+ function withdrawnCreate(
281
+ input: ProjectionReplacementPlanInput,
282
+ state: SourceReplacementObjectState
283
+ ): ExactObjectOverrideWrite | null {
284
+ const { withdrawCreatesBefore } = input
285
+ const override = state.override
286
+ if (!withdrawCreatesBefore || state.candidateSource) return null
287
+ if (override?.value.kind !== "create" || override.updatedAt >= withdrawCreatesBefore) return null
288
+
289
+ return {
290
+ ref: state.ref,
291
+ value: { kind: "patch", set: override.value.properties, unset: [] },
292
+ editedAt: storedObjectEditedAt(override),
293
+ expectedLastCommitId: override.lastCommitId,
294
+ lastCommitId: input.commit.id,
295
+ updatedAt: input.commit.committedAt,
296
+ }
297
+ }
298
+
260
299
  function resolveReplacementObject(
261
300
  context: Pick<MaterializerContext, "ontology">,
262
- state: SourceReplacementObjectState
301
+ state: SourceReplacementObjectState,
302
+ override: ObjectOverride | null
263
303
  ) {
264
304
  return resolveEffectiveObject({
265
305
  ref: state.ref,
266
306
  primaryPropertyId: context.ontology.getPrimaryPropertyId(state.ref.objectTypeId),
267
307
  source: state.candidateSource,
268
- override: state.override?.value ?? null,
308
+ override,
269
309
  editedAt: storedObjectEditedAt(state.override),
270
310
  latestTelemetry: state.latestTelemetry,
271
311
  })
@@ -400,6 +400,10 @@ export function normalizePinnedDatasetVersion(version: PinnedDatasetVersion): Pi
400
400
  })
401
401
  }
402
402
 
403
+ export function normalizeSourceReadAt(value: string): string {
404
+ return normalizeTimestamp(value, "Projection source read time")
405
+ }
406
+
403
407
  export function normalizeProjectionRunId(runId: string): string {
404
408
  return normalizeNonblank(runId, "Projection run id")
405
409
  }
@@ -25,6 +25,7 @@ import type {
25
25
  LinkProjectionDefinition,
26
26
  LinkProjectionTarget,
27
27
  ObjectProjectionDefinition,
28
+ ObjectProjectionMissingPolicy,
28
29
  ObjectProjectionTarget,
29
30
  ProjectionDefinition,
30
31
  ProjectionTarget,
@@ -433,6 +434,12 @@ export interface ObjectProjectionBuilder<
433
434
  resolveConflicts(
434
435
  resolution: ObjectProjectionConflictResolution<TDataset>
435
436
  ): ObjectProjectionBuilder<TObjectType, TDataset>
437
+ /**
438
+ * `remove`: an object an Action created is removed too once the dataset, read after the Action
439
+ * last wrote it, does not hold it. A dataset read before then keeps it: the sync has not caught
440
+ * up yet. Without it, such an object stays until it is deleted.
441
+ */
442
+ whenMissing(policy: ObjectProjectionMissingPolicy): ObjectProjectionBuilder<TObjectType, TDataset>
436
443
  }
437
444
 
438
445
  /**
@@ -576,6 +583,7 @@ function objectProjectionBuilder<
576
583
  readonly users: Readonly<Record<string, ProjectionUserKey>>
577
584
  readonly links: Readonly<Record<string, ForeignKeyDescriptor>>
578
585
  readonly conflictResolution: SourceEditConflictResolution
586
+ readonly missing?: ObjectProjectionMissingPolicy
579
587
  }): ObjectProjectionBuilder<TObjectType, TDataset> {
580
588
  const definition: ObjectProjectionDefinition & {
581
589
  readonly conflictResolution: SourceEditConflictResolution
@@ -588,6 +596,7 @@ function objectProjectionBuilder<
588
596
  ...(Object.keys(input.users).length > 0 ? { users: { ...input.users } } : {}),
589
597
  links: { ...input.links },
590
598
  conflictResolution: { ...input.conflictResolution },
599
+ ...(input.missing ? { missing: input.missing } : {}),
591
600
  }
592
601
 
593
602
  return Object.assign(definition, {
@@ -613,6 +622,17 @@ function objectProjectionBuilder<
613
622
  conflictResolution: resolution as SourceEditConflictResolution,
614
623
  })
615
624
  },
625
+ whenMissing(
626
+ policy: ObjectProjectionMissingPolicy
627
+ ): ObjectProjectionBuilder<TObjectType, TDataset> {
628
+ if (policy !== "remove") {
629
+ throw new ProjectionValidationError(
630
+ `whenMissing() takes "remove", received ${JSON.stringify(policy)}.`
631
+ )
632
+ }
633
+
634
+ return objectProjectionBuilder({ ...input, missing: policy })
635
+ },
616
636
  })
617
637
  }
618
638
 
@@ -24,6 +24,7 @@ export type {
24
24
  LinkProjectionDefinition,
25
25
  LinkProjectionTarget,
26
26
  ObjectProjectionDefinition,
27
+ ObjectProjectionMissingPolicy,
27
28
  ObjectProjectionTarget,
28
29
  ProjectionDefinition,
29
30
  ProjectionKind,
@@ -255,6 +255,7 @@ function cloneObjectProjectionDefinition(
255
255
  sourceTimestamp: projection.conflictResolution.sourceTimestamp,
256
256
  }
257
257
  : { strategy: "editsWin" },
258
+ ...(projection.missing ? { missing: projection.missing } : {}),
258
259
  }
259
260
  }
260
261
 
@@ -222,6 +222,8 @@ function normalizeProjectionDefinition(projection: ProjectionDefinition): JsonVa
222
222
  ])
223
223
  ),
224
224
  conflictResolution: projection.conflictResolution ?? { strategy: "editsWin" },
225
+ // Written only when set: projections that keep what their dataset misses keep their revision.
226
+ ...(projection.missing ? { missing: projection.missing } : {}),
225
227
  }
226
228
  }
227
229
  if (projection._tag === "LinkProjectionDefinition") {
@@ -48,6 +48,12 @@ export type SourceEditConflictResolution =
48
48
  | { readonly strategy: "editsWin" }
49
49
  | { readonly strategy: "mostRecent"; readonly sourceTimestamp: string }
50
50
 
51
+ /**
52
+ * What an object projection does with an object an Action created once its dataset no longer
53
+ * holds it. `remove`: the object is removed, as an object the projection created would be.
54
+ */
55
+ export type ObjectProjectionMissingPolicy = "remove"
56
+
51
57
  /**
52
58
  * Lowered, serializable definition for projecting a dataset into object instances.
53
59
  *
@@ -72,6 +78,11 @@ export interface ObjectProjectionDefinition {
72
78
  readonly links: Readonly<Record<string, ForeignKeyDescriptor>>
73
79
  /** Defaults to `editsWin` when omitted by a legacy lowered definition. */
74
80
  readonly conflictResolution?: SourceEditConflictResolution
81
+ /**
82
+ * Set by `.whenMissing()`. Omitted, an object an Action created stays until it is deleted, even
83
+ * when the dataset never holds it.
84
+ */
85
+ readonly missing?: ObjectProjectionMissingPolicy
75
86
  }
76
87
 
77
88
  /**
@@ -377,6 +377,12 @@ export function validateProjectionsAtStartup(
377
377
  )
378
378
  }
379
379
  }
380
+ if (projection.missing !== undefined && projection.missing !== "remove") {
381
+ throw new ProjectionValidationError(
382
+ `${prefix}: unknown missing policy "${String(projection.missing)}". Use "remove".`
383
+ )
384
+ }
385
+
380
386
  const propertyIds = new Set(objectType.properties.map((p) => p.id))
381
387
  for (const [propId, columnName] of Object.entries(projection.properties)) {
382
388
  if (!propertyIds.has(propId)) {
@@ -16,6 +16,7 @@ import type {
16
16
  QueueJob,
17
17
  QueueJobFailure,
18
18
  Queues,
19
+ RenderQueueJob,
19
20
  SyncQueueJobFailureCode,
20
21
  SyncRunRequestedQueueJob,
21
22
  VectorIndexingQueueJob,
@@ -486,6 +487,10 @@ export class InMemoryQueues implements Queues {
486
487
  this.store,
487
488
  "lake"
488
489
  )
490
+ readonly renders = new InMemoryQueue<RenderQueueJob, "internal.unexpected" | "runtime.cancelled">(
491
+ this.store,
492
+ "renders"
493
+ )
489
494
  readonly syncRuns = new InMemoryQueue<SyncRunRequestedQueueJob, SyncQueueJobFailureCode>(
490
495
  this.store,
491
496
  "sync.runs"
@@ -16,11 +16,12 @@ export { QueueError } from "./errors"
16
16
  export { InMemoryQueues } from "./in-memory"
17
17
  export type {
18
18
  AgentAiUsageRecordRequestedQueueJob,
19
- AgentArtifactPreviewsRequestedQueueJob,
20
19
  AgentQueueJob,
21
20
  AgentQueueJobFailureCode,
22
21
  AgentRunRequestedQueueJob,
23
22
  AgentWorkflowNodeRequestedQueueJob,
23
+ ArtifactPdfRequestedQueueJob,
24
+ ArtifactPreviewsRequestedQueueJob,
24
25
  ClaimedQueueJob,
25
26
  DatasetIngestFlushRequestedQueueJob,
26
27
  LakeQueueJob,
@@ -35,6 +36,7 @@ export type {
35
36
  QueueJobEnvelope,
36
37
  QueueJobFailure,
37
38
  Queues,
39
+ RenderQueueJob,
38
40
  SyncQueueJobFailureCode,
39
41
  SyncRunRequestedQueueJob,
40
42
  VectorIndexingQueueJob,