@sixb/core 0.2.3 → 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 (587) hide show
  1. package/dist/actions/index.js +28 -28
  2. package/dist/agents/cancel.d.ts +1 -1
  3. package/dist/agents/cancel.d.ts.map +1 -1
  4. package/dist/agents/child-question.d.ts +35 -2
  5. package/dist/agents/child-question.d.ts.map +1 -1
  6. package/dist/agents/execution.d.ts +35 -3
  7. package/dist/agents/execution.d.ts.map +1 -1
  8. package/dist/agents/ids.d.ts +4 -0
  9. package/dist/agents/ids.d.ts.map +1 -1
  10. package/dist/agents/index.d.ts +9 -7
  11. package/dist/agents/index.d.ts.map +1 -1
  12. package/dist/agents/index.js +59 -33
  13. package/dist/agents/index.js.map +1 -1
  14. package/dist/agents/model-loop.d.ts.map +1 -1
  15. package/dist/agents/queued-turn.d.ts +16 -0
  16. package/dist/agents/queued-turn.d.ts.map +1 -0
  17. package/dist/agents/request.d.ts +79 -1
  18. package/dist/agents/request.d.ts.map +1 -1
  19. package/dist/agents/run-after-finish.d.ts +10 -0
  20. package/dist/agents/run-after-finish.d.ts.map +1 -1
  21. package/dist/agents/run-artifacts.d.ts +0 -38
  22. package/dist/agents/run-artifacts.d.ts.map +1 -1
  23. package/dist/agents/run-events.d.ts +6 -1
  24. package/dist/agents/run-events.d.ts.map +1 -1
  25. package/dist/agents/run-session-children.d.ts +9 -0
  26. package/dist/agents/run-session-children.d.ts.map +1 -1
  27. package/dist/agents/run-session-http.d.ts.map +1 -1
  28. package/dist/agents/run-session-serve.d.ts.map +1 -1
  29. package/dist/agents/run-session.d.ts +14 -1
  30. package/dist/agents/run-session.d.ts.map +1 -1
  31. package/dist/agents/run-turn.d.ts.map +1 -1
  32. package/dist/agents/streams/index.d.ts +1 -1
  33. package/dist/agents/streams/index.d.ts.map +1 -1
  34. package/dist/agents/streams/index.js +1 -1
  35. package/dist/agents/streams/internal.js +1 -1
  36. package/dist/agents/streams/protocol.d.ts +16 -0
  37. package/dist/agents/streams/protocol.d.ts.map +1 -1
  38. package/dist/agents/tool-files.d.ts +1 -1
  39. package/dist/agents/tool-files.d.ts.map +1 -1
  40. package/dist/agents/tool-input-coercion.d.ts +20 -0
  41. package/dist/agents/tool-input-coercion.d.ts.map +1 -0
  42. package/dist/agents/turn-answered.d.ts +7 -0
  43. package/dist/agents/turn-answered.d.ts.map +1 -0
  44. package/dist/agents/validation.d.ts +1 -1
  45. package/dist/agents/validation.d.ts.map +1 -1
  46. package/dist/artifacts/canvas-display.d.ts +3 -5
  47. package/dist/artifacts/canvas-display.d.ts.map +1 -1
  48. package/dist/artifacts/comments.d.ts +14 -3
  49. package/dist/artifacts/comments.d.ts.map +1 -1
  50. package/dist/artifacts/document-fill.d.ts +18 -0
  51. package/dist/artifacts/document-fill.d.ts.map +1 -0
  52. package/dist/artifacts/errors.d.ts +1 -1
  53. package/dist/artifacts/errors.d.ts.map +1 -1
  54. package/dist/artifacts/events.d.ts +3 -2
  55. package/dist/artifacts/events.d.ts.map +1 -1
  56. package/dist/artifacts/execution.d.ts +40 -4
  57. package/dist/artifacts/execution.d.ts.map +1 -1
  58. package/dist/artifacts/frames/assets.d.ts +8 -1
  59. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  60. package/dist/artifacts/frames/document-data.d.ts +98 -0
  61. package/dist/artifacts/frames/document-data.d.ts.map +1 -0
  62. package/dist/artifacts/frames/entries.d.ts +12 -7
  63. package/dist/artifacts/frames/entries.d.ts.map +1 -1
  64. package/dist/artifacts/frames/index.d.ts +2 -1
  65. package/dist/artifacts/frames/index.d.ts.map +1 -1
  66. package/dist/artifacts/frames/index.js +22 -13
  67. package/dist/artifacts/frames/index.js.map +4 -4
  68. package/dist/artifacts/frames/kit.d.ts +15 -0
  69. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  70. package/dist/artifacts/frames/protocol.d.ts +65 -3
  71. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  72. package/dist/artifacts/frames/runtime.d.ts +32 -5
  73. package/dist/artifacts/frames/runtime.d.ts.map +1 -1
  74. package/dist/artifacts/index.d.ts +4 -2
  75. package/dist/artifacts/index.d.ts.map +1 -1
  76. package/dist/artifacts/index.js +35 -3
  77. package/dist/artifacts/index.js.map +3 -3
  78. package/dist/artifacts/live/blocks.d.ts +62 -0
  79. package/dist/artifacts/live/blocks.d.ts.map +1 -0
  80. package/dist/artifacts/live/board.d.ts +6 -0
  81. package/dist/artifacts/live/board.d.ts.map +1 -1
  82. package/dist/artifacts/live/document.d.ts +12 -0
  83. package/dist/artifacts/live/document.d.ts.map +1 -1
  84. package/dist/artifacts/live/index.d.ts +2 -0
  85. package/dist/artifacts/live/index.d.ts.map +1 -1
  86. package/dist/artifacts/live/index.js +148 -44
  87. package/dist/artifacts/live/index.js.map +3 -3
  88. package/dist/artifacts/live/page.d.ts +49 -0
  89. package/dist/artifacts/live/page.d.ts.map +1 -0
  90. package/dist/artifacts/live/protocol.d.ts +5 -0
  91. package/dist/artifacts/live/protocol.d.ts.map +1 -1
  92. package/dist/artifacts/live/server.d.ts +2 -2
  93. package/dist/artifacts/live/server.d.ts.map +1 -1
  94. package/dist/artifacts/live/server.js +23 -19
  95. package/dist/artifacts/live/server.js.map +1 -1
  96. package/dist/artifacts/live/state.d.ts +4 -1
  97. package/dist/artifacts/live/state.d.ts.map +1 -1
  98. package/dist/artifacts/outline.d.ts +16 -0
  99. package/dist/artifacts/outline.d.ts.map +1 -1
  100. package/dist/artifacts/paper.d.ts +22 -0
  101. package/dist/artifacts/paper.d.ts.map +1 -0
  102. package/dist/artifacts/pdf-job.d.ts +9 -0
  103. package/dist/artifacts/pdf-job.d.ts.map +1 -0
  104. package/dist/artifacts/publish/fields.d.ts +25 -0
  105. package/dist/artifacts/publish/fields.d.ts.map +1 -0
  106. package/dist/artifacts/publish/index.d.ts +2 -1
  107. package/dist/artifacts/publish/index.d.ts.map +1 -1
  108. package/dist/artifacts/publish/index.js +26 -18
  109. package/dist/artifacts/publish/index.js.map +1 -1
  110. package/dist/artifacts/publish/merge.d.ts +5 -5
  111. package/dist/artifacts/publish/merge.d.ts.map +1 -1
  112. package/dist/artifacts/publish/pdf.d.ts +28 -0
  113. package/dist/artifacts/publish/pdf.d.ts.map +1 -0
  114. package/dist/artifacts/publish/previews.d.ts +12 -20
  115. package/dist/artifacts/publish/previews.d.ts.map +1 -1
  116. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  117. package/dist/artifacts/publish/queries.d.ts +6 -1
  118. package/dist/artifacts/publish/queries.d.ts.map +1 -1
  119. package/dist/artifacts/publish/query-answers.d.ts +5 -2
  120. package/dist/artifacts/publish/query-answers.d.ts.map +1 -1
  121. package/dist/artifacts/publish/validate/document-html.d.ts +24 -0
  122. package/dist/artifacts/publish/validate/document-html.d.ts.map +1 -0
  123. package/dist/artifacts/publish/validate/document.d.ts +5 -3
  124. package/dist/artifacts/publish/validate/document.d.ts.map +1 -1
  125. package/dist/artifacts/queries.d.ts +16 -2
  126. package/dist/artifacts/queries.d.ts.map +1 -1
  127. package/dist/auth/index.js +2 -2
  128. package/dist/authorization/event-visibility.d.ts.map +1 -1
  129. package/dist/authorization/index.js +1 -1
  130. package/dist/blob-storage/index.js +1 -1
  131. package/dist/bootstrap/index.js +38 -38
  132. package/dist/{chunk-tqa68kj7.js → chunk-0hkdtwqk.js} +5 -5
  133. package/dist/{chunk-s5n9617r.js → chunk-0mvjpgvm.js} +5 -5
  134. package/dist/{chunk-k66rp2hr.js → chunk-1yh6jgtz.js} +1 -1
  135. package/dist/{chunk-26qet7wh.js → chunk-5t9gm5tt.js} +4 -4
  136. package/dist/{chunk-a6fjkcne.js → chunk-60662fyv.js} +54 -28
  137. package/dist/{chunk-a6fjkcne.js.map → chunk-60662fyv.js.map} +7 -6
  138. package/dist/{chunk-e0hnbb1m.js → chunk-61zptves.js} +1 -1
  139. package/dist/{chunk-hkaa807g.js → chunk-68hm50qh.js} +3 -3
  140. package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
  141. package/dist/chunk-8tv3qd65.js.map +12 -0
  142. package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
  143. package/dist/{chunk-m7b9q5dk.js → chunk-aw1z0gre.js} +4 -4
  144. package/dist/chunk-az95tsh3.js.map +2 -2
  145. package/dist/{chunk-4j0sagwv.js → chunk-b4escq4c.js} +62 -14
  146. package/dist/{chunk-4j0sagwv.js.map → chunk-b4escq4c.js.map} +7 -7
  147. package/dist/chunk-bqr703h4.js +1799 -0
  148. package/dist/chunk-bqr703h4.js.map +13 -0
  149. package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
  150. package/dist/chunk-c29729me.js.map +12 -0
  151. package/dist/{chunk-t24yktqr.js → chunk-dvgc56n2.js} +20 -4
  152. package/dist/{chunk-t24yktqr.js.map → chunk-dvgc56n2.js.map} +5 -5
  153. package/dist/{chunk-3014rfjz.js → chunk-ewqn51gr.js} +25 -7
  154. package/dist/{chunk-3014rfjz.js.map → chunk-ewqn51gr.js.map} +3 -3
  155. package/dist/{chunk-7z5rkf0m.js → chunk-ey1p8w68.js} +175 -5
  156. package/dist/chunk-ey1p8w68.js.map +13 -0
  157. package/dist/{chunk-z0t4p2sk.js → chunk-fpf57gca.js} +350 -61
  158. package/dist/chunk-fpf57gca.js.map +47 -0
  159. package/dist/{chunk-kv0kvknv.js → chunk-fzae1jpq.js} +7 -7
  160. package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
  161. package/dist/chunk-fzbhybya.js.map +11 -0
  162. package/dist/{chunk-2by73sm2.js → chunk-gjhrz66x.js} +225 -17
  163. package/dist/{chunk-2by73sm2.js.map → chunk-gjhrz66x.js.map} +5 -5
  164. package/dist/chunk-hn2r7z41.js.map +1 -1
  165. package/dist/{chunk-6gtxshcc.js → chunk-k29n4176.js} +6 -6
  166. package/dist/{chunk-48c1z8nj.js → chunk-k3jh8gsg.js} +10 -2
  167. package/dist/chunk-k3jh8gsg.js.map +10 -0
  168. package/dist/{chunk-w9s23r24.js → chunk-m3qx2pns.js} +751 -93
  169. package/dist/chunk-m3qx2pns.js.map +34 -0
  170. package/dist/{chunk-smnt672s.js → chunk-m9ketb51.js} +20 -4
  171. package/dist/chunk-m9ketb51.js.map +10 -0
  172. package/dist/chunk-mbwsgjn7.js +40 -0
  173. package/dist/chunk-mbwsgjn7.js.map +11 -0
  174. package/dist/{chunk-sysnvjce.js → chunk-naxjka9v.js} +2 -2
  175. package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
  176. package/dist/chunk-nxysqbt0.js.map +10 -0
  177. package/dist/{chunk-vzkxqf8h.js → chunk-paxabbqd.js} +49 -5
  178. package/dist/chunk-paxabbqd.js.map +23 -0
  179. package/dist/{chunk-8tqnsx3q.js → chunk-pc7kra3k.js} +5 -3
  180. package/dist/{chunk-8tqnsx3q.js.map → chunk-pc7kra3k.js.map} +3 -3
  181. package/dist/{chunk-qafng88v.js → chunk-pqvvqc65.js} +4 -4
  182. package/dist/chunk-pvpq483h.js.map +2 -2
  183. package/dist/{chunk-mzx71snp.js → chunk-q7g9cqwt.js} +7 -2
  184. package/dist/{chunk-mzx71snp.js.map → chunk-q7g9cqwt.js.map} +3 -3
  185. package/dist/{chunk-8t2ynwg0.js → chunk-q8d9p0tb.js} +24 -1
  186. package/dist/{chunk-8t2ynwg0.js.map → chunk-q8d9p0tb.js.map} +3 -3
  187. package/dist/{chunk-wa05txmk.js → chunk-qavwr628.js} +49 -5
  188. package/dist/chunk-qavwr628.js.map +12 -0
  189. package/dist/{chunk-bkmnd7zq.js → chunk-rg725hry.js} +174 -30
  190. package/dist/{chunk-bkmnd7zq.js.map → chunk-rg725hry.js.map} +9 -8
  191. package/dist/{chunk-8p7bze4c.js → chunk-s1mqyqmm.js} +3 -3
  192. package/dist/{chunk-p351afzm.js → chunk-s5pj68fa.js} +2 -2
  193. package/dist/{chunk-855w9nvw.js → chunk-vehcr9eb.js} +1 -1
  194. package/dist/{chunk-qds484t8.js → chunk-vs2s3p8n.js} +932 -21
  195. package/dist/chunk-vs2s3p8n.js.map +20 -0
  196. package/dist/chunk-vtjzwymr.js.map +2 -2
  197. package/dist/{chunk-n68vz95m.js → chunk-wqe9shx2.js} +1 -1
  198. package/dist/{chunk-0k3r5kb3.js → chunk-xcrnrpfh.js} +1 -1
  199. package/dist/{chunk-cwdzcv37.js → chunk-xrmbhap8.js} +2 -2
  200. package/dist/{chunk-cwdzcv37.js.map → chunk-xrmbhap8.js.map} +2 -2
  201. package/dist/{chunk-f6ahf5gf.js → chunk-xxfj0rr2.js} +20 -5
  202. package/dist/chunk-xxfj0rr2.js.map +13 -0
  203. package/dist/{chunk-3hzhcfsv.js → chunk-y8fwm3z2.js} +2 -2
  204. package/dist/{chunk-3hzhcfsv.js.map → chunk-y8fwm3z2.js.map} +3 -3
  205. package/dist/{chunk-e9w4mgdh.js → chunk-z1njfqqs.js} +589 -53
  206. package/dist/{chunk-e9w4mgdh.js.map → chunk-z1njfqqs.js.map} +14 -11
  207. package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
  208. package/dist/chunk-z4jqb44a.js.map +10 -0
  209. package/dist/{chunk-s7xqfxs9.js → chunk-zft9bzbc.js} +2 -1
  210. package/dist/{chunk-s7xqfxs9.js.map → chunk-zft9bzbc.js.map} +3 -3
  211. package/dist/{chunk-38yvdqzd.js → chunk-zxhym8tr.js} +1 -1
  212. package/dist/connectors/connection-handles.d.ts +9 -0
  213. package/dist/connectors/connection-handles.d.ts.map +1 -0
  214. package/dist/connectors/connections/authorizations.d.ts +9 -0
  215. package/dist/connectors/connections/authorizations.d.ts.map +1 -1
  216. package/dist/connectors/connections/events.d.ts +17 -0
  217. package/dist/connectors/connections/events.d.ts.map +1 -0
  218. package/dist/connectors/connections/runs.d.ts +3 -0
  219. package/dist/connectors/connections/runs.d.ts.map +1 -1
  220. package/dist/connectors/connections/service.d.ts +4 -0
  221. package/dist/connectors/connections/service.d.ts.map +1 -1
  222. package/dist/connectors/execution.d.ts +7 -1
  223. package/dist/connectors/execution.d.ts.map +1 -1
  224. package/dist/connectors/index.d.ts +1 -1
  225. package/dist/connectors/index.d.ts.map +1 -1
  226. package/dist/connectors/types.d.ts +22 -1
  227. package/dist/connectors/types.d.ts.map +1 -1
  228. package/dist/datasets/write.js +1 -1
  229. package/dist/deploy/index.d.ts +1 -1
  230. package/dist/deploy/index.d.ts.map +1 -1
  231. package/dist/deploy/internal.js +3 -2
  232. package/dist/deploy/internal.js.map +3 -3
  233. package/dist/deploy/services.d.ts.map +1 -1
  234. package/dist/deploy/types.d.ts +18 -1
  235. package/dist/deploy/types.d.ts.map +1 -1
  236. package/dist/events/definitions.d.ts +4 -0
  237. package/dist/events/definitions.d.ts.map +1 -1
  238. package/dist/events/execution.d.ts.map +1 -1
  239. package/dist/events/index.d.ts +2 -2
  240. package/dist/events/index.d.ts.map +1 -1
  241. package/dist/events/index.js +3 -3
  242. package/dist/events/outbox-dispatcher.d.ts +7 -0
  243. package/dist/events/outbox-dispatcher.d.ts.map +1 -1
  244. package/dist/events/scope.d.ts +1 -0
  245. package/dist/events/scope.d.ts.map +1 -1
  246. package/dist/events/scope.js +1 -1
  247. package/dist/events/selectors/builder.d.ts +9 -1
  248. package/dist/events/selectors/builder.d.ts.map +1 -1
  249. package/dist/events/selectors/index.d.ts +2 -2
  250. package/dist/events/selectors/index.d.ts.map +1 -1
  251. package/dist/events/selectors/index.js +2 -2
  252. package/dist/events/selectors/predicate.d.ts.map +1 -1
  253. package/dist/events/selectors/types.d.ts +18 -3
  254. package/dist/events/selectors/types.d.ts.map +1 -1
  255. package/dist/events/types/artifacts.d.ts +7 -1
  256. package/dist/events/types/artifacts.d.ts.map +1 -1
  257. package/dist/events/types/connectors.d.ts +32 -0
  258. package/dist/events/types/connectors.d.ts.map +1 -0
  259. package/dist/events/types/index.d.ts +3 -1
  260. package/dist/events/types/index.d.ts.map +1 -1
  261. package/dist/execution/agent.js +28 -28
  262. package/dist/execution/authorization.d.ts +5 -0
  263. package/dist/execution/authorization.d.ts.map +1 -1
  264. package/dist/execution/primitive.js +28 -28
  265. package/dist/execution/request.js +29 -29
  266. package/dist/execution/scopes.d.ts +8 -0
  267. package/dist/execution/scopes.d.ts.map +1 -1
  268. package/dist/execution/script.d.ts +7 -0
  269. package/dist/execution/script.d.ts.map +1 -0
  270. package/dist/execution/types.d.ts +16 -1
  271. package/dist/execution/types.d.ts.map +1 -1
  272. package/dist/http/api-routes.d.ts.map +1 -1
  273. package/dist/http/index.js +1 -1
  274. package/dist/index.d.ts +9 -8
  275. package/dist/index.d.ts.map +1 -1
  276. package/dist/index.js +46 -44
  277. package/dist/index.js.map +1 -1
  278. package/dist/lake-storage/index.js +1 -1
  279. package/dist/lineage/executors.d.ts +1 -1
  280. package/dist/lineage/executors.d.ts.map +1 -1
  281. package/dist/maintenance/index.js +1 -1
  282. package/dist/materialization/event-envelopes.d.ts +3 -3
  283. package/dist/materialization/event-envelopes.d.ts.map +1 -1
  284. package/dist/materialization/events.d.ts +6 -0
  285. package/dist/materialization/events.d.ts.map +1 -1
  286. package/dist/materialization/index.js +1 -1
  287. package/dist/materialization/model.d.ts +6 -0
  288. package/dist/materialization/model.d.ts.map +1 -1
  289. package/dist/materializer/index.js +13 -13
  290. package/dist/materializer/projections/replace.d.ts.map +1 -1
  291. package/dist/materializer/projections/replacement-plan.d.ts +2 -0
  292. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  293. package/dist/materializer/shared/normalize.d.ts +1 -0
  294. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  295. package/dist/models/execution/index.js +12 -12
  296. package/dist/models/language-model.d.ts +6 -0
  297. package/dist/models/language-model.d.ts.map +1 -1
  298. package/dist/models/tools.d.ts +2 -0
  299. package/dist/models/tools.d.ts.map +1 -1
  300. package/dist/objects/index.js +28 -28
  301. package/dist/objects/query/index.js +12 -12
  302. package/dist/pipelines/index.js +18 -18
  303. package/dist/projections/builders.d.ts +7 -1
  304. package/dist/projections/builders.d.ts.map +1 -1
  305. package/dist/projections/index.d.ts +1 -1
  306. package/dist/projections/index.d.ts.map +1 -1
  307. package/dist/projections/internal.js +13 -13
  308. package/dist/projections/types.d.ts +10 -0
  309. package/dist/projections/types.d.ts.map +1 -1
  310. package/dist/projections/validation.d.ts.map +1 -1
  311. package/dist/queues/in-memory.d.ts +2 -1
  312. package/dist/queues/in-memory.d.ts.map +1 -1
  313. package/dist/queues/index.d.ts +1 -1
  314. package/dist/queues/index.d.ts.map +1 -1
  315. package/dist/queues/index.js +1 -1
  316. package/dist/queues/types.d.ts +40 -13
  317. package/dist/queues/types.d.ts.map +1 -1
  318. package/dist/runtime/host.d.ts +13 -0
  319. package/dist/runtime/host.d.ts.map +1 -1
  320. package/dist/runtime/internal.d.ts +1 -0
  321. package/dist/runtime/internal.d.ts.map +1 -1
  322. package/dist/runtime/internal.js +39 -18
  323. package/dist/runtime/internal.js.map +4 -3
  324. package/dist/runtime/resolve-definitions.d.ts +1 -1
  325. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  326. package/dist/runtime/script.d.ts +39 -0
  327. package/dist/runtime/script.d.ts.map +1 -0
  328. package/dist/runtime/sixb.d.ts +2 -2
  329. package/dist/runtime/sixb.d.ts.map +1 -1
  330. package/dist/schedules/builders.d.ts.map +1 -1
  331. package/dist/schedules/index.js +3 -3
  332. package/dist/schedules/runtime.d.ts.map +1 -1
  333. package/dist/schedules/validation.d.ts +2 -0
  334. package/dist/schedules/validation.d.ts.map +1 -1
  335. package/dist/shares/internal.js +12 -12
  336. package/dist/storage/agents/errors.d.ts +1 -1
  337. package/dist/storage/agents/errors.d.ts.map +1 -1
  338. package/dist/storage/agents/in-memory.d.ts +26 -1
  339. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  340. package/dist/storage/agents/index.d.ts +2 -2
  341. package/dist/storage/agents/index.d.ts.map +1 -1
  342. package/dist/storage/agents/provider.d.ts +12 -3
  343. package/dist/storage/agents/provider.d.ts.map +1 -1
  344. package/dist/storage/agents/provider.js +25 -5
  345. package/dist/storage/agents/provider.js.map +1 -1
  346. package/dist/storage/agents/types.d.ts +156 -1
  347. package/dist/storage/agents/types.d.ts.map +1 -1
  348. package/dist/storage/artifacts/in-memory.d.ts +7 -1
  349. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  350. package/dist/storage/artifacts/index.d.ts +1 -1
  351. package/dist/storage/artifacts/index.d.ts.map +1 -1
  352. package/dist/storage/artifacts/record.d.ts +2 -1
  353. package/dist/storage/artifacts/record.d.ts.map +1 -1
  354. package/dist/storage/artifacts/types.d.ts +34 -0
  355. package/dist/storage/artifacts/types.d.ts.map +1 -1
  356. package/dist/storage/executions/provider.d.ts +3 -3
  357. package/dist/storage/executions/provider.d.ts.map +1 -1
  358. package/dist/storage/executions/provider.js +1 -1
  359. package/dist/storage/executions/types.d.ts +6 -0
  360. package/dist/storage/executions/types.d.ts.map +1 -1
  361. package/dist/storage/executions/validation.d.ts.map +1 -1
  362. package/dist/storage/file-upload-sessions/provider.js +3 -3
  363. package/dist/storage/index.d.ts +3 -3
  364. package/dist/storage/index.d.ts.map +1 -1
  365. package/dist/storage/index.js +18 -14
  366. package/dist/storage/index.js.map +1 -1
  367. package/dist/storage/internal.d.ts +1 -1
  368. package/dist/storage/internal.d.ts.map +1 -1
  369. package/dist/storage/internal.js +8 -6
  370. package/dist/storage/internal.js.map +2 -2
  371. package/dist/storage/ontology/in-memory/replacement-plans.d.ts +2 -0
  372. package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
  373. package/dist/storage/ontology/provider.js +1 -1
  374. package/dist/storage/ontology/replacement-plans.d.ts +8 -0
  375. package/dist/storage/ontology/replacement-plans.d.ts.map +1 -1
  376. package/dist/storage/operation-scope.d.ts.map +1 -1
  377. package/dist/storage/operation-scope.js +1 -1
  378. package/dist/storage/workflow-runs/provider.js +3 -3
  379. package/dist/syncs/index.js +19 -19
  380. package/dist/testing/agent-execution.d.ts +3 -0
  381. package/dist/testing/agent-execution.d.ts.map +1 -1
  382. package/dist/testing/agent-inbox-storage-contract.d.ts +15 -0
  383. package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -0
  384. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  385. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  386. package/dist/testing/execution-storage-contract.d.ts.map +1 -1
  387. package/dist/testing/index.d.ts +1 -0
  388. package/dist/testing/index.d.ts.map +1 -1
  389. package/dist/testing/index.js +5524 -4555
  390. package/dist/testing/index.js.map +10 -9
  391. package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
  392. package/dist/testing/queues-contract.d.ts.map +1 -1
  393. package/dist/webhooks/connections.d.ts +3 -4
  394. package/dist/webhooks/connections.d.ts.map +1 -1
  395. package/dist/webhooks/index.d.ts +1 -1
  396. package/dist/webhooks/index.d.ts.map +1 -1
  397. package/dist/webhooks/internal.js +16 -49
  398. package/dist/webhooks/internal.js.map +3 -3
  399. package/dist/webhooks/types.d.ts +2 -11
  400. package/dist/webhooks/types.d.ts.map +1 -1
  401. package/dist/workers/queued-run-dispatch.d.ts.map +1 -1
  402. package/dist/workflows/index.js +35 -35
  403. package/package.json +6 -1
  404. package/src/agents/README.md +6 -2
  405. package/src/agents/approval-outcome.ts +2 -2
  406. package/src/agents/cancel.ts +2 -2
  407. package/src/agents/child-question.ts +76 -8
  408. package/src/agents/execution.ts +168 -30
  409. package/src/agents/ids.ts +9 -1
  410. package/src/agents/index.ts +27 -6
  411. package/src/agents/model-loop.ts +3 -1
  412. package/src/agents/queued-turn.ts +46 -0
  413. package/src/agents/request.ts +517 -2
  414. package/src/agents/run-after-finish.ts +259 -2
  415. package/src/agents/run-artifacts.ts +3 -93
  416. package/src/agents/run-events.ts +26 -1
  417. package/src/agents/run-session-children.ts +33 -0
  418. package/src/agents/run-session-http.ts +10 -2
  419. package/src/agents/run-session-serve.ts +3 -8
  420. package/src/agents/run-session.ts +142 -3
  421. package/src/agents/run-turn.ts +8 -0
  422. package/src/agents/streams/index.ts +1 -0
  423. package/src/agents/streams/protocol.ts +41 -1
  424. package/src/agents/tool-files.ts +1 -1
  425. package/src/agents/tool-input-coercion.ts +140 -0
  426. package/src/agents/turn-answered.ts +31 -0
  427. package/src/agents/validation.ts +13 -3
  428. package/src/artifacts/canvas-display.ts +4 -6
  429. package/src/artifacts/comments.ts +70 -17
  430. package/src/artifacts/document-fill.ts +103 -0
  431. package/src/artifacts/errors.ts +2 -0
  432. package/src/artifacts/events.ts +4 -1
  433. package/src/artifacts/execution.ts +265 -31
  434. package/src/artifacts/frames/assets.ts +42 -7
  435. package/src/artifacts/frames/document-data.ts +353 -0
  436. package/src/artifacts/frames/entries.ts +22 -16
  437. package/src/artifacts/frames/grants.ts +2 -2
  438. package/src/artifacts/frames/index.ts +3 -0
  439. package/src/artifacts/frames/kit.ts +102 -0
  440. package/src/artifacts/frames/protocol.ts +96 -3
  441. package/src/artifacts/frames/runtime.ts +709 -19
  442. package/src/artifacts/index.ts +6 -0
  443. package/src/artifacts/live/blocks.ts +889 -0
  444. package/src/artifacts/live/board.ts +195 -42
  445. package/src/artifacts/live/document.ts +170 -5
  446. package/src/artifacts/live/index.ts +7 -0
  447. package/src/artifacts/live/page.ts +807 -0
  448. package/src/artifacts/live/protocol.ts +5 -0
  449. package/src/artifacts/live/server.ts +2 -2
  450. package/src/artifacts/live/state.ts +9 -4
  451. package/src/artifacts/outline.ts +17 -0
  452. package/src/artifacts/paper.ts +173 -0
  453. package/src/artifacts/pdf-job.ts +11 -0
  454. package/src/artifacts/publish/fields.ts +177 -0
  455. package/src/artifacts/publish/index.ts +6 -1
  456. package/src/artifacts/publish/merge.ts +14 -12
  457. package/src/artifacts/publish/pdf.ts +82 -0
  458. package/src/artifacts/publish/previews.ts +24 -34
  459. package/src/artifacts/publish/publish.ts +26 -3
  460. package/src/artifacts/publish/queries.ts +20 -4
  461. package/src/artifacts/publish/query-answers.ts +14 -3
  462. package/src/artifacts/publish/validate/document-html.ts +245 -0
  463. package/src/artifacts/publish/validate/document.ts +34 -3
  464. package/src/artifacts/queries.ts +59 -13
  465. package/src/authorization/event-visibility.ts +13 -0
  466. package/src/connectors/connection-handles.ts +71 -0
  467. package/src/connectors/connections/authorizations.ts +50 -2
  468. package/src/connectors/connections/events.ts +57 -0
  469. package/src/connectors/connections/runs.ts +5 -0
  470. package/src/connectors/connections/service.ts +19 -1
  471. package/src/connectors/execution.ts +30 -2
  472. package/src/connectors/index.ts +3 -0
  473. package/src/connectors/types.ts +29 -1
  474. package/src/deploy/index.ts +1 -0
  475. package/src/deploy/services.ts +1 -0
  476. package/src/deploy/types.ts +26 -1
  477. package/src/events/definitions.ts +14 -0
  478. package/src/events/execution.ts +9 -2
  479. package/src/events/index.ts +8 -0
  480. package/src/events/outbox-dispatcher.ts +12 -2
  481. package/src/events/scope.ts +3 -0
  482. package/src/events/selectors/builder.ts +49 -0
  483. package/src/events/selectors/index.ts +5 -0
  484. package/src/events/selectors/predicate.ts +2 -0
  485. package/src/events/selectors/types.ts +30 -1
  486. package/src/events/types/artifacts.ts +7 -1
  487. package/src/events/types/connectors.ts +36 -0
  488. package/src/events/types/index.ts +7 -0
  489. package/src/execution/authorization.ts +45 -0
  490. package/src/execution/durable.ts +2 -0
  491. package/src/execution/scopes.ts +24 -0
  492. package/src/execution/script.ts +27 -0
  493. package/src/execution/types.ts +7 -1
  494. package/src/http/api-routes.ts +26 -1
  495. package/src/index.ts +21 -2
  496. package/src/lineage/executors.ts +3 -1
  497. package/src/materialization/event-envelopes.ts +10 -5
  498. package/src/materialization/events.ts +2 -0
  499. package/src/materialization/model.ts +6 -0
  500. package/src/materializer/README.md +10 -0
  501. package/src/materializer/projections/replace.ts +42 -1
  502. package/src/materializer/projections/replacement-plan.ts +44 -4
  503. package/src/materializer/shared/normalize.ts +4 -0
  504. package/src/models/language-model.ts +6 -0
  505. package/src/models/tools.ts +2 -0
  506. package/src/projections/builders.ts +20 -0
  507. package/src/projections/index.ts +1 -0
  508. package/src/projections/registry.ts +1 -0
  509. package/src/projections/revision.ts +2 -0
  510. package/src/projections/types.ts +11 -0
  511. package/src/projections/validation.ts +6 -0
  512. package/src/queues/in-memory.ts +5 -0
  513. package/src/queues/index.ts +3 -1
  514. package/src/queues/types.ts +45 -14
  515. package/src/runtime/host.ts +112 -4
  516. package/src/runtime/internal.ts +1 -0
  517. package/src/runtime/resolve-definitions.ts +4 -1
  518. package/src/runtime/script.ts +62 -0
  519. package/src/runtime/sixb.ts +3 -3
  520. package/src/schedules/builders.ts +4 -1
  521. package/src/schedules/runtime.ts +3 -0
  522. package/src/schedules/validation.ts +20 -2
  523. package/src/storage/agents/errors.ts +1 -0
  524. package/src/storage/agents/in-memory.ts +229 -1
  525. package/src/storage/agents/index.ts +16 -0
  526. package/src/storage/agents/provider.ts +284 -2
  527. package/src/storage/agents/types.ts +168 -1
  528. package/src/storage/artifacts/in-memory.ts +32 -1
  529. package/src/storage/artifacts/index.ts +2 -0
  530. package/src/storage/artifacts/record.ts +25 -2
  531. package/src/storage/artifacts/types.ts +37 -0
  532. package/src/storage/executions/provider.ts +22 -2
  533. package/src/storage/executions/types.ts +2 -0
  534. package/src/storage/executions/validation.ts +27 -0
  535. package/src/storage/index.ts +18 -0
  536. package/src/storage/internal.ts +1 -0
  537. package/src/storage/ontology/in-memory/replacement-plans.ts +22 -0
  538. package/src/storage/ontology/replacement-plans.ts +6 -0
  539. package/src/storage/operation-scope.ts +1 -0
  540. package/src/testing/agent-execution.ts +45 -2
  541. package/src/testing/agent-inbox-storage-contract.ts +815 -0
  542. package/src/testing/agent-storage-contract.ts +103 -0
  543. package/src/testing/artifact-storage-contract.ts +72 -4
  544. package/src/testing/execution-storage-contract.ts +31 -0
  545. package/src/testing/index.ts +5 -0
  546. package/src/testing/materializer-storage-contract.ts +139 -1
  547. package/src/testing/queues-contract.ts +22 -0
  548. package/src/webhooks/connections.ts +9 -50
  549. package/src/webhooks/index.ts +0 -2
  550. package/src/webhooks/types.ts +2 -13
  551. package/src/workers/queued-run-dispatch.ts +8 -1
  552. package/dist/chunk-48c1z8nj.js.map +0 -10
  553. package/dist/chunk-58geavnf.js +0 -29
  554. package/dist/chunk-58geavnf.js.map +0 -10
  555. package/dist/chunk-7z5rkf0m.js.map +0 -13
  556. package/dist/chunk-9nsjjd44.js.map +0 -12
  557. package/dist/chunk-b9qfh2ya.js.map +0 -11
  558. package/dist/chunk-eptrvnby.js.map +0 -12
  559. package/dist/chunk-f6ahf5gf.js.map +0 -13
  560. package/dist/chunk-m2jerfef.js +0 -474
  561. package/dist/chunk-m2jerfef.js.map +0 -11
  562. package/dist/chunk-n4zzaf6q.js.map +0 -10
  563. package/dist/chunk-qds484t8.js.map +0 -18
  564. package/dist/chunk-smnt672s.js.map +0 -10
  565. package/dist/chunk-vzkxqf8h.js.map +0 -23
  566. package/dist/chunk-w9s23r24.js.map +0 -30
  567. package/dist/chunk-wa05txmk.js.map +0 -11
  568. package/dist/chunk-yv8hv4wq.js.map +0 -10
  569. package/dist/chunk-z0t4p2sk.js.map +0 -47
  570. /package/dist/{chunk-tqa68kj7.js.map → chunk-0hkdtwqk.js.map} +0 -0
  571. /package/dist/{chunk-s5n9617r.js.map → chunk-0mvjpgvm.js.map} +0 -0
  572. /package/dist/{chunk-k66rp2hr.js.map → chunk-1yh6jgtz.js.map} +0 -0
  573. /package/dist/{chunk-26qet7wh.js.map → chunk-5t9gm5tt.js.map} +0 -0
  574. /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
  575. /package/dist/{chunk-hkaa807g.js.map → chunk-68hm50qh.js.map} +0 -0
  576. /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
  577. /package/dist/{chunk-m7b9q5dk.js.map → chunk-aw1z0gre.js.map} +0 -0
  578. /package/dist/{chunk-kv0kvknv.js.map → chunk-fzae1jpq.js.map} +0 -0
  579. /package/dist/{chunk-6gtxshcc.js.map → chunk-k29n4176.js.map} +0 -0
  580. /package/dist/{chunk-sysnvjce.js.map → chunk-naxjka9v.js.map} +0 -0
  581. /package/dist/{chunk-qafng88v.js.map → chunk-pqvvqc65.js.map} +0 -0
  582. /package/dist/{chunk-8p7bze4c.js.map → chunk-s1mqyqmm.js.map} +0 -0
  583. /package/dist/{chunk-p351afzm.js.map → chunk-s5pj68fa.js.map} +0 -0
  584. /package/dist/{chunk-855w9nvw.js.map → chunk-vehcr9eb.js.map} +0 -0
  585. /package/dist/{chunk-n68vz95m.js.map → chunk-wqe9shx2.js.map} +0 -0
  586. /package/dist/{chunk-0k3r5kb3.js.map → chunk-xcrnrpfh.js.map} +0 -0
  587. /package/dist/{chunk-38yvdqzd.js.map → chunk-zxhym8tr.js.map} +0 -0
@@ -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,
@@ -219,28 +219,25 @@ export interface AgentAiUsageRecordRequestedQueueJob
219
219
  > {}
220
220
 
221
221
  /**
222
- * A canvas version's boards miss pictures: the agent worker renders them in a blank sandbox of
223
- * the project, with the data the version's author can see. One job per artifact, which each write
224
- * that asks replaces: it names the latest revision asked for.
222
+ * Someone asked for a designed document's PDF: the render worker prints the version in a blank
223
+ * sandbox of the project. One job per PDF, by its render key.
225
224
  */
226
- export interface AgentArtifactPreviewsRequestedQueueJob
225
+ export interface ArtifactPdfRequestedQueueJob
227
226
  extends QueueJob<
228
- "agent.artifact-previews.requested",
227
+ "artifact.pdf.requested",
229
228
  {
230
229
  readonly artifactId: string
231
230
  readonly version: number
232
231
  /**
233
- * When the version's content was last written as it was asked for, its `updatedAt` as ISO:
234
- * once its content is written again, the job renders nothing, and the write that asks for
235
- * it replaces it. Creating the version leaves its content, so its job still renders it.
236
- * Absent on jobs asked for before.
232
+ * What the version printed when it was asked for: once its content changes, the job prints
233
+ * nothing, and the next ask prints what it holds then.
237
234
  */
238
- readonly updatedAt?: string
235
+ readonly renderKey: string
239
236
  /**
240
- * The version's query answers as its publisher read them when publishing, by name: a JSON
241
- * blob the boards read their queries from. Absent for a version without queries.
237
+ * The `document.html` it prints instead of the version's own: with the values its fields
238
+ * read, as whoever asked reads them, written in.
242
239
  */
243
- readonly queries?: FileRef
240
+ readonly document?: FileRef
244
241
  }
245
242
  > {}
246
243
 
@@ -248,7 +245,6 @@ export type AgentQueueJob =
248
245
  | AgentRunRequestedQueueJob
249
246
  | AgentWorkflowNodeRequestedQueueJob
250
247
  | AgentAiUsageRecordRequestedQueueJob
251
- | AgentArtifactPreviewsRequestedQueueJob
252
248
 
253
249
  /** Internal lane hosted by ProjectionWorker. */
254
250
  export type VectorIndexingQueueJob = QueueJob<
@@ -276,6 +272,35 @@ export interface DatasetIngestFlushRequestedQueueJob
276
272
 
277
273
  export type LakeQueueJob = LakeRetentionRequestedQueueJob | DatasetIngestFlushRequestedQueueJob
278
274
 
275
+ /**
276
+ * A canvas version's boards miss pictures: the render worker renders them in a blank sandbox of
277
+ * the project, with the data the version's author can see. One job per artifact, which each write
278
+ * that asks replaces: it names the latest revision asked for.
279
+ */
280
+ export interface ArtifactPreviewsRequestedQueueJob
281
+ extends QueueJob<
282
+ "artifact.previews.requested",
283
+ {
284
+ readonly artifactId: string
285
+ readonly version: number
286
+ /**
287
+ * When the version's content was last written as it was asked for, its `updatedAt` as ISO:
288
+ * once its content is written again, the job renders nothing, and the write that asks for
289
+ * it replaces it. Creating the version leaves its content, so its job still renders it.
290
+ * Absent on jobs asked for before.
291
+ */
292
+ readonly updatedAt?: string
293
+ /**
294
+ * The version's query answers as its publisher read them when publishing, by name: a JSON
295
+ * blob the boards read their queries from. Absent for a version without queries.
296
+ */
297
+ readonly queries?: FileRef
298
+ }
299
+ > {}
300
+
301
+ /** What renders in a browser, in a sandbox of the project: RenderWorker consumes it. */
302
+ export type RenderQueueJob = ArtifactPdfRequestedQueueJob | ArtifactPreviewsRequestedQueueJob
303
+
279
304
  export interface Queues {
280
305
  readonly vectorIndexing: Queue<
281
306
  VectorIndexingQueueJob,
@@ -287,6 +312,12 @@ export interface Queues {
287
312
  * LakeWorker consumes this lane, so lake work never waits behind a sync or takes its slot.
288
313
  */
289
314
  readonly lake: Queue<LakeQueueJob, "internal.unexpected" | "runtime.cancelled">
315
+ /**
316
+ * What the framework renders in a browser, in a sandbox of the project: a designed document's
317
+ * PDF, and the pictures of a canvas's boards. RenderWorker consumes this lane, so a render never waits behind an agent's run or takes
318
+ * its slot.
319
+ */
320
+ readonly renders: Queue<RenderQueueJob, "internal.unexpected" | "runtime.cancelled">
290
321
  readonly syncRuns: Queue<SyncRunRequestedQueueJob, SyncQueueJobFailureCode>
291
322
  readonly pipelines: Queue<PipelineRunRequestedQueueJob, PipelineQueueJobFailureCode>
292
323
  readonly projections: Queue<ProjectionRunRequestedQueueJob, ProjectionQueueJobFailureCode>
@@ -38,6 +38,7 @@ import {
38
38
  } from "../datasets/ingest-flush"
39
39
  import type { DatasetDefinition } from "../datasets/types"
40
40
  import { attachSixbErrorReporter, shareSixbErrorReporter } from "../error-reporting/capability"
41
+ import type { ErrorReporter } from "../error-reporting/reporter"
41
42
  import {
42
43
  reportEventDeliveryFailure,
43
44
  reportMaintenancePassFailure,
@@ -47,6 +48,7 @@ import {
47
48
  createDomainEventService,
48
49
  type DomainEventLog,
49
50
  type DomainEventService,
51
+ type EventsAppendInput,
50
52
  OntologyOutboxDispatcher,
51
53
  } from "../events"
52
54
  import {
@@ -225,10 +227,15 @@ export class SixbHost<in out TParams extends ParamsConfig = ParamsConfig> {
225
227
  readonly sandboxes?: Pick<SandboxFactory, "create" | "resume">
226
228
  readonly projectRoot: string
227
229
  private readonly cron: MaintenancePass
230
+ private readonly errorReporter: ErrorReporter
231
+ /** What every execution in this process runs on once it has bound a script; see `withScope`. */
232
+ private scriptProcess: { readonly context: SixbHostContext; readonly enqueues: boolean } | null =
233
+ null
228
234
  readonly auth: AuthRuntime
229
235
 
230
236
  constructor(options: SixbHostOptions<TParams>) {
231
237
  const errorReporter = attachSixbErrorReporter(this, options.onError)
238
+ this.errorReporter = errorReporter
232
239
  this.projectId = options.id ?? "default"
233
240
  this.locale = resolveProjectLocale(options.locale)
234
241
  this.timeZone = resolveProjectTimeZone(options.timeZone)
@@ -306,6 +313,7 @@ export class SixbHost<in out TParams extends ParamsConfig = ParamsConfig> {
306
313
  this.connectorService = new ConnectorService(this.projectId, connectors, {
307
314
  storage: this.storage,
308
315
  credentialProtector,
316
+ events: this.eventService,
309
317
  })
310
318
  if (this.connectorService.connectionProcess) {
311
319
  registerConnectorConnectionCallbackProcess(
@@ -421,8 +429,12 @@ export class SixbHost<in out TParams extends ParamsConfig = ParamsConfig> {
421
429
  throw new Error("[Sixb] Kernel authority cannot be bound to the domain SDK.")
422
430
  }
423
431
 
432
+ if (capturedScope.execution.executor.type === "script") this.enterScriptProcess()
433
+ const hostContext = this.scriptProcess?.context ?? this.hostContext
434
+ const enqueues = this.scriptProcess?.enqueues ?? true
435
+
424
436
  const modelExecution = new ModelExecutionSession(
425
- { ...this.hostContext, runtimeAuthorization: capturedScope.authorization },
437
+ { ...hostContext, runtimeAuthorization: capturedScope.authorization },
426
438
  capturedScope.execution
427
439
  )
428
440
  const embeddingModels = bindEmbeddingModels(this.hostContext.embeddingModels, modelExecution)
@@ -438,7 +450,7 @@ export class SixbHost<in out TParams extends ParamsConfig = ParamsConfig> {
438
450
  })
439
451
 
440
452
  const runtime: SixbRuntimeContext = {
441
- ...this.hostContext,
453
+ ...hostContext,
442
454
  embeddingModels,
443
455
  rerankingModels,
444
456
  modelExecution,
@@ -452,7 +464,8 @@ export class SixbHost<in out TParams extends ParamsConfig = ParamsConfig> {
452
464
  materializer: this.materializer.withScope(capturedScope),
453
465
  notifyCommittedFacts: () => {
454
466
  this.committedFacts.notify()
455
- this.vectorIndexing?.notify()
467
+ // Pending indexing waits for the instance's maintenance pass to dispatch it.
468
+ if (enqueues) this.vectorIndexing?.notify()
456
469
  },
457
470
  // A projection this process applies is visible to its next read.
458
471
  onProjectionApplied: () => this.appliedMarkings.invalidate(),
@@ -465,6 +478,32 @@ export class SixbHost<in out TParams extends ParamsConfig = ParamsConfig> {
465
478
  )
466
479
  }
467
480
 
481
+ /**
482
+ * A script runs in a process of its own, beside the project's running instance, and everything
483
+ * this process runs from now on, such as an action the script applies, is the script's doing.
484
+ *
485
+ * With a process-scoped broker, the instance holds the subscribers: ontology changes stay in the
486
+ * outbox for it to publish, and appending any other event is refused rather than delivered to
487
+ * nobody. With process-scoped queues, nothing here would ever claim a job, so enqueueing is
488
+ * refused.
489
+ */
490
+ private enterScriptProcess(): void {
491
+ if (this.scriptProcess) return
492
+ const publishes = this.broker.scope !== "process"
493
+ const enqueues = this.queues.scope !== "process"
494
+ if (!publishes) this.committedFacts.relinquish()
495
+ this.scriptProcess = {
496
+ enqueues,
497
+ context: {
498
+ ...this.hostContext,
499
+ ...(publishes
500
+ ? {}
501
+ : { events: refuseScriptEvents(this.eventService, this.projectId, this.errorReporter) }),
502
+ ...(enqueues ? {} : { queues: refuseScriptEnqueues(this.queues) }),
503
+ },
504
+ }
505
+ }
506
+
468
507
  get id(): string {
469
508
  return this.projectId
470
509
  }
@@ -574,7 +613,7 @@ export class SixbHost<in out TParams extends ParamsConfig = ParamsConfig> {
574
613
  definition: this.sandboxDefinition,
575
614
  supportsPersistence: typeof this.sandboxes?.resume === "function",
576
615
  },
577
- rendersBoardPreviews: this.sandboxes !== undefined,
616
+ rendersInSandboxes: this.sandboxes !== undefined,
578
617
  logging: this.logging,
579
618
  activity: this.activity,
580
619
  connectorService: this.connectorService,
@@ -671,3 +710,72 @@ function assertSandboxCredentials<TParams extends ParamsConfig>(
671
710
  })
672
711
  if (issue) throw new SandboxError(`[Sixb] ${issue}`)
673
712
  }
713
+
714
+ const QUEUE_LANES = [
715
+ "vectorIndexing",
716
+ "lake",
717
+ "syncRuns",
718
+ "pipelines",
719
+ "projections",
720
+ "workflows",
721
+ "agents",
722
+ ] as const satisfies readonly Exclude<keyof Queues, "scope" | "health" | "close">[]
723
+
724
+ /** The event log with appends refused, for a script whose broker nobody else here listens to. */
725
+ function refuseScriptEvents(
726
+ events: DomainEventService,
727
+ projectId: string,
728
+ errorReporter: ErrorReporter
729
+ ): DomainEventService {
730
+ const refusal = () =>
731
+ new Error(
732
+ "[Sixb] A script cannot append events on this project's broker: it only works inside one " +
733
+ "process. Append them from the app or the API, or configure a shared broker."
734
+ )
735
+ return delegate(events, (property) => {
736
+ if (property === "append") {
737
+ return async (): Promise<never> => {
738
+ throw refusal()
739
+ }
740
+ }
741
+ if (property === "emit") {
742
+ // `emit` never rejects: the work behind it already succeeded, so the loss is reported.
743
+ return async (input: EventsAppendInput): Promise<void> => {
744
+ reportEventDeliveryFailure(errorReporter, refusal(), {
745
+ projectId,
746
+ eventTypes: input.events.map((event) => event.type),
747
+ })
748
+ }
749
+ }
750
+ return undefined
751
+ })
752
+ }
753
+
754
+ /** The project's queues with every `enqueue` refused, for a script that cannot reach their workers. */
755
+ function refuseScriptEnqueues(queues: Queues): Queues {
756
+ const refused = async (): Promise<never> => {
757
+ throw new Error(
758
+ "[Sixb] A script cannot start work on this project's queues: they only work inside one " +
759
+ "process. Start it from the app or the API, or configure shared queues."
760
+ )
761
+ }
762
+ const lanes = new Map<PropertyKey, unknown>(
763
+ QUEUE_LANES.map((lane) => [
764
+ lane,
765
+ delegate(queues[lane], (property) => (property === "enqueue" ? refused : undefined)),
766
+ ])
767
+ )
768
+ return delegate(queues, (property) => lanes.get(property))
769
+ }
770
+
771
+ /** `target`, with the members `override` returns replaced and every other method bound to it. */
772
+ function delegate<T extends object>(target: T, override: (property: PropertyKey) => unknown): T {
773
+ return new Proxy(target, {
774
+ get(object, property) {
775
+ const replaced = override(property)
776
+ if (replaced !== undefined) return replaced
777
+ const value: unknown = Reflect.get(object, property, object)
778
+ return typeof value === "function" ? value.bind(object) : value
779
+ },
780
+ })
781
+ }
@@ -36,4 +36,5 @@ export {
36
36
  shareOntologyMutationRuntime,
37
37
  } from "./ontology-mutations"
38
38
  export { setApiPublicOrigin } from "./public-origin"
39
+ export { bindScript } from "./script"
39
40
  export type { SixbHostContext, SixbRuntimeContext } from "./types"
@@ -7,7 +7,7 @@ import { createAgentSkillCatalog } from "../agents/skills"
7
7
  import { assertMaxSteps } from "../agents/step-limits"
8
8
  import { createAgentToolCatalog } from "../agents/tool-catalog"
9
9
  import { assertNoProviderWebTools, resolveAgentWebOptions } from "../agents/web"
10
- import type { ConnectorDefinition } from "../connectors"
10
+ import { type ConnectorDefinition, isOAuthConnectorDefinition } from "../connectors"
11
11
  import { isDatasetPick } from "../datasets/builders"
12
12
  import { columnsByName } from "../datasets/column-index"
13
13
  import type { DatasetDefinition } from "../datasets/types"
@@ -163,6 +163,9 @@ export function resolveDefinitions(options: DefinitionOptions): ResolvedDefiniti
163
163
  registeredDatasetIds: new Set(datasetsById.keys()),
164
164
  registeredSyncIds: new Set(syncsById.keys()),
165
165
  registeredPipelineIds: new Set(pipelinesById.keys()),
166
+ registeredOAuthConnectorIds: new Set(
167
+ [...connectorsById.values()].filter(isOAuthConnectorDefinition).map(({ id }) => id)
168
+ ),
166
169
  })
167
170
  for (const sync of syncs) {
168
171
  validateScheduleReferences("Sync", sync.id, sync.triggers, schedulesById)
@@ -0,0 +1,62 @@
1
+ import { createScriptScope } from "../execution/scopes"
2
+ import type { SixbHostView } from "./host"
3
+ import type { Sixb } from "./sixb"
4
+
5
+ /**
6
+ * What `sixb run` passes a script's default export.
7
+ *
8
+ * ```ts
9
+ * import type { ScriptContext } from "@sixb/core"
10
+ *
11
+ * export default async function ({ sixb, args, signal }: ScriptContext) {
12
+ * // ...
13
+ * }
14
+ * ```
15
+ */
16
+ export interface ScriptContext {
17
+ /** The project's SDK, with full access. Its writes are attributed to this script. */
18
+ readonly sixb: Sixb
19
+ /** Everything after the script's path on the command line, untouched. */
20
+ readonly args: readonly string[]
21
+ /**
22
+ * Aborts on Ctrl-C or SIGTERM, so the script can stop between steps; a second one exits at once.
23
+ * A closed SSH connection exits at once.
24
+ */
25
+ readonly signal: AbortSignal
26
+ }
27
+
28
+ /**
29
+ * Binds a new script execution, recorded under `path` (the script's path relative to the project),
30
+ * and returns what calls the script's default export with it. Call it as soon as the host loads:
31
+ * from then on this process leaves the outbox and queues to the project's instance, which matters
32
+ * even when the script never runs, since closing the broker would otherwise publish that
33
+ * instance's events here.
34
+ */
35
+ export function bindScript(
36
+ host: SixbHostView,
37
+ path: string
38
+ ): {
39
+ run(input: {
40
+ readonly main: unknown
41
+ readonly args: readonly string[]
42
+ readonly signal: AbortSignal
43
+ }): Promise<void>
44
+ } {
45
+ const sixb = host.withScope(createScriptScope({ projectId: host.id, path })) as Sixb
46
+ return {
47
+ async run({ main, args, signal }) {
48
+ if (typeof main !== "function") {
49
+ throw new Error(
50
+ `[Sixb] ${path} must export a function as its default export: ` +
51
+ "`export default async function ({ sixb, args, signal }: ScriptContext) { ... }`."
52
+ )
53
+ }
54
+ const context: ScriptContext = Object.freeze({
55
+ sixb,
56
+ args: Object.freeze([...args]),
57
+ signal,
58
+ })
59
+ await main(context)
60
+ },
61
+ }
62
+ }
@@ -77,8 +77,8 @@ export interface SixbDependencies {
77
77
  readonly definition: SandboxDefinition
78
78
  readonly supportsPersistence: boolean
79
79
  }
80
- /** The project has sandboxes, where the agent worker renders the pictures of canvas boards. */
81
- readonly rendersBoardPreviews: boolean
80
+ /** The project has sandboxes, where canvas boards are pictured and documents print to PDF. */
81
+ readonly rendersInSandboxes: boolean
82
82
  readonly definitions: SixbDefinitions
83
83
  readonly logging: LoggingService
84
84
  readonly activity: ActivityService
@@ -176,7 +176,7 @@ function createExecutionFacades<TParams extends Record<string, unknown>>(
176
176
  rules: createRulesRuntime(runtime, dependencies.definitions.rules),
177
177
  agent,
178
178
  artifacts: createArtifactsRuntime(runtime, dependencies.blobStorage, {
179
- rendersBoardPreviews: dependencies.rendersBoardPreviews,
179
+ rendersInSandboxes: dependencies.rendersInSandboxes,
180
180
  }),
181
181
  models: createModelsRuntime(
182
182
  runtime,
@@ -180,9 +180,12 @@ function assertEventSource(source: EventSelectorSpec): void {
180
180
  return
181
181
  case "users":
182
182
  return
183
+ case "connectors":
184
+ assertNonEmpty(source.connectorId ?? "", "event source connectorId")
185
+ return
183
186
  default:
184
187
  throw new ScheduleValidationError(
185
- "Schedule event source must select object, link, rule, dataset, sync, pipeline, or member events."
188
+ "Schedule event source must select object, link, rule, dataset, sync, pipeline, member, or connection events."
186
189
  )
187
190
  }
188
191
  }
@@ -112,6 +112,9 @@ export function buildEventScheduleContext(event: DomainEvent): RuntimeEventSched
112
112
  case "user.invited":
113
113
  case "user.profile.updated":
114
114
  return { ...event.payload }
115
+ case "connector.connection.connected":
116
+ case "connector.connection.disconnected":
117
+ return { ...event.payload }
115
118
  default:
116
119
  return null
117
120
  }
@@ -18,6 +18,10 @@ const userEventTypes = new Set([
18
18
  "user.invited",
19
19
  "user.profile.updated",
20
20
  ])
21
+ const connectorEventTypes = new Set([
22
+ "connector.connection.connected",
23
+ "connector.connection.disconnected",
24
+ ])
21
25
  const runStatuses = new Set(["succeeded", "failed", "cancelled"])
22
26
  const linkIdentityFields = new Set(["target.objectTypeId", "target.primaryId"])
23
27
 
@@ -26,6 +30,8 @@ export interface ValidateSchedulesAtStartupOptions {
26
30
  readonly registeredDatasetIds?: ReadonlySet<string>
27
31
  readonly registeredSyncIds?: ReadonlySet<string>
28
32
  readonly registeredPipelineIds?: ReadonlySet<string>
33
+ /** OAuth connectors only: a static connector has no connections, so no connection events. */
34
+ readonly registeredOAuthConnectorIds?: ReadonlySet<string>
29
35
  }
30
36
 
31
37
  function isRecord(value: unknown): value is Record<string, unknown> {
@@ -156,9 +162,12 @@ function assertEventSourceShape(
156
162
  return
157
163
  case "users":
158
164
  return
165
+ case "connectors":
166
+ assertNonEmptyString(value.connectorId, `${path} connectorId`, createError)
167
+ return
159
168
  default:
160
169
  throw createError(
161
- `${path} must select object, link, rule, dataset, sync, pipeline, or member events.`
170
+ `${path} must select object, link, rule, dataset, sync, pipeline, member, or connection events.`
162
171
  )
163
172
  }
164
173
  }
@@ -246,6 +255,15 @@ function validateEventSchedule(
246
255
  case "users":
247
256
  validateMemberSource(schedule)
248
257
  return
258
+ case "connectors":
259
+ validateRegisteredSource(
260
+ schedule,
261
+ source.connectorId,
262
+ options.registeredOAuthConnectorIds,
263
+ connectorEventTypes,
264
+ "OAuth connector"
265
+ )
266
+ return
249
267
  }
250
268
  }
251
269
 
@@ -292,7 +310,7 @@ function validateRegisteredSource(
292
310
  sourceId: string | undefined,
293
311
  registeredIds: ReadonlySet<string> | undefined,
294
312
  supportedTypes: ReadonlySet<string>,
295
- sourceKind: "rule" | "dataset" | "sync" | "pipeline"
313
+ sourceKind: "rule" | "dataset" | "sync" | "pipeline" | "OAuth connector"
296
314
  ): void {
297
315
  validateEventTypes(schedule, supportedTypes, sourceKind)
298
316
  if (!registeredIds?.has(sourceId ?? "")) {
@@ -10,6 +10,7 @@ export type AgentStorageErrorCode =
10
10
  | "execution_lost"
11
11
  | "duplicate_id"
12
12
  | "participant_limit"
13
+ | "inbox_limit"
13
14
 
14
15
  /**
15
16
  * Error for agent-storage invariants and invalid state transitions (single-flight, execution