@sixb/core 0.2.4 → 0.2.6

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 (763) hide show
  1. package/dist/actions/index.js +41 -40
  2. package/dist/actions/index.js.map +1 -1
  3. package/dist/actions/validation.d.ts.map +1 -1
  4. package/dist/agents/errors.d.ts +1 -1
  5. package/dist/agents/errors.d.ts.map +1 -1
  6. package/dist/agents/execution.d.ts +50 -3
  7. package/dist/agents/execution.d.ts.map +1 -1
  8. package/dist/agents/ids.d.ts +2 -0
  9. package/dist/agents/ids.d.ts.map +1 -1
  10. package/dist/agents/index.d.ts +7 -5
  11. package/dist/agents/index.d.ts.map +1 -1
  12. package/dist/agents/index.js +74 -50
  13. package/dist/agents/index.js.map +1 -1
  14. package/dist/agents/model-routing.d.ts +5 -2
  15. package/dist/agents/model-routing.d.ts.map +1 -1
  16. package/dist/agents/queued-turn.d.ts +16 -0
  17. package/dist/agents/queued-turn.d.ts.map +1 -0
  18. package/dist/agents/request.d.ts +120 -1
  19. package/dist/agents/request.d.ts.map +1 -1
  20. package/dist/agents/run-after-finish.d.ts +10 -0
  21. package/dist/agents/run-after-finish.d.ts.map +1 -1
  22. package/dist/agents/run-artifacts.d.ts +0 -38
  23. package/dist/agents/run-artifacts.d.ts.map +1 -1
  24. package/dist/agents/run-events.d.ts +10 -1
  25. package/dist/agents/run-events.d.ts.map +1 -1
  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 +9 -1
  32. package/dist/agents/run-turn.d.ts.map +1 -1
  33. package/dist/agents/streams/index.d.ts +1 -1
  34. package/dist/agents/streams/index.d.ts.map +1 -1
  35. package/dist/agents/streams/index.js +1 -1
  36. package/dist/agents/streams/internal.d.ts +2 -1
  37. package/dist/agents/streams/internal.d.ts.map +1 -1
  38. package/dist/agents/streams/internal.js +22 -2
  39. package/dist/agents/streams/internal.js.map +1 -1
  40. package/dist/agents/streams/protocol.d.ts +53 -0
  41. package/dist/agents/streams/protocol.d.ts.map +1 -1
  42. package/dist/agents/streams/steps.d.ts +24 -0
  43. package/dist/agents/streams/steps.d.ts.map +1 -0
  44. package/dist/agents/thread-access.d.ts +44 -2
  45. package/dist/agents/thread-access.d.ts.map +1 -1
  46. package/dist/agents/turn-answered.d.ts +7 -0
  47. package/dist/agents/turn-answered.d.ts.map +1 -0
  48. package/dist/agents/validation.d.ts +1 -1
  49. package/dist/agents/validation.d.ts.map +1 -1
  50. package/dist/artifacts/canvas-display.d.ts +3 -5
  51. package/dist/artifacts/canvas-display.d.ts.map +1 -1
  52. package/dist/artifacts/comments.d.ts +14 -3
  53. package/dist/artifacts/comments.d.ts.map +1 -1
  54. package/dist/artifacts/document-fill.d.ts +18 -0
  55. package/dist/artifacts/document-fill.d.ts.map +1 -0
  56. package/dist/artifacts/errors.d.ts +1 -1
  57. package/dist/artifacts/errors.d.ts.map +1 -1
  58. package/dist/artifacts/events.d.ts +3 -2
  59. package/dist/artifacts/events.d.ts.map +1 -1
  60. package/dist/artifacts/execution.d.ts +40 -4
  61. package/dist/artifacts/execution.d.ts.map +1 -1
  62. package/dist/artifacts/frames/assets.d.ts +8 -1
  63. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  64. package/dist/artifacts/frames/document-data.d.ts +98 -0
  65. package/dist/artifacts/frames/document-data.d.ts.map +1 -0
  66. package/dist/artifacts/frames/entries.d.ts +12 -7
  67. package/dist/artifacts/frames/entries.d.ts.map +1 -1
  68. package/dist/artifacts/frames/index.d.ts +2 -1
  69. package/dist/artifacts/frames/index.d.ts.map +1 -1
  70. package/dist/artifacts/frames/index.js +22 -13
  71. package/dist/artifacts/frames/index.js.map +4 -4
  72. package/dist/artifacts/frames/kit.d.ts +15 -0
  73. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  74. package/dist/artifacts/frames/protocol.d.ts +12 -1
  75. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  76. package/dist/artifacts/frames/runtime.d.ts +24 -4
  77. package/dist/artifacts/frames/runtime.d.ts.map +1 -1
  78. package/dist/artifacts/index.d.ts +3 -1
  79. package/dist/artifacts/index.d.ts.map +1 -1
  80. package/dist/artifacts/index.js +9 -3
  81. package/dist/artifacts/index.js.map +3 -3
  82. package/dist/artifacts/live/blocks.d.ts +62 -0
  83. package/dist/artifacts/live/blocks.d.ts.map +1 -0
  84. package/dist/artifacts/live/board.d.ts +6 -0
  85. package/dist/artifacts/live/board.d.ts.map +1 -1
  86. package/dist/artifacts/live/document.d.ts +12 -0
  87. package/dist/artifacts/live/document.d.ts.map +1 -1
  88. package/dist/artifacts/live/index.d.ts +2 -0
  89. package/dist/artifacts/live/index.d.ts.map +1 -1
  90. package/dist/artifacts/live/index.js +148 -44
  91. package/dist/artifacts/live/index.js.map +3 -3
  92. package/dist/artifacts/live/page.d.ts +49 -0
  93. package/dist/artifacts/live/page.d.ts.map +1 -0
  94. package/dist/artifacts/live/protocol.d.ts +5 -0
  95. package/dist/artifacts/live/protocol.d.ts.map +1 -1
  96. package/dist/artifacts/live/server.d.ts +2 -2
  97. package/dist/artifacts/live/server.d.ts.map +1 -1
  98. package/dist/artifacts/live/server.js +29 -24
  99. package/dist/artifacts/live/server.js.map +1 -1
  100. package/dist/artifacts/live/state.d.ts +4 -1
  101. package/dist/artifacts/live/state.d.ts.map +1 -1
  102. package/dist/artifacts/outline.d.ts +16 -0
  103. package/dist/artifacts/outline.d.ts.map +1 -1
  104. package/dist/artifacts/paper.d.ts +22 -0
  105. package/dist/artifacts/paper.d.ts.map +1 -0
  106. package/dist/artifacts/pdf-job.d.ts +9 -0
  107. package/dist/artifacts/pdf-job.d.ts.map +1 -0
  108. package/dist/artifacts/publish/fields.d.ts +25 -0
  109. package/dist/artifacts/publish/fields.d.ts.map +1 -0
  110. package/dist/artifacts/publish/index.d.ts +2 -1
  111. package/dist/artifacts/publish/index.d.ts.map +1 -1
  112. package/dist/artifacts/publish/index.js +32 -23
  113. package/dist/artifacts/publish/index.js.map +1 -1
  114. package/dist/artifacts/publish/merge.d.ts +7 -6
  115. package/dist/artifacts/publish/merge.d.ts.map +1 -1
  116. package/dist/artifacts/publish/pdf.d.ts +28 -0
  117. package/dist/artifacts/publish/pdf.d.ts.map +1 -0
  118. package/dist/artifacts/publish/previews.d.ts +12 -20
  119. package/dist/artifacts/publish/previews.d.ts.map +1 -1
  120. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  121. package/dist/artifacts/publish/queries.d.ts +6 -1
  122. package/dist/artifacts/publish/queries.d.ts.map +1 -1
  123. package/dist/artifacts/publish/query-answers.d.ts +5 -2
  124. package/dist/artifacts/publish/query-answers.d.ts.map +1 -1
  125. package/dist/artifacts/publish/validate/document-html.d.ts +24 -0
  126. package/dist/artifacts/publish/validate/document-html.d.ts.map +1 -0
  127. package/dist/artifacts/publish/validate/document.d.ts +5 -3
  128. package/dist/artifacts/publish/validate/document.d.ts.map +1 -1
  129. package/dist/artifacts/queries.d.ts +16 -2
  130. package/dist/artifacts/queries.d.ts.map +1 -1
  131. package/dist/artifacts/run-query.d.ts.map +1 -1
  132. package/dist/auth/index.js +6 -6
  133. package/dist/authorization/event-visibility.d.ts.map +1 -1
  134. package/dist/authorization/index.js +2 -2
  135. package/dist/blob-storage/index.js +1 -1
  136. package/dist/bootstrap/index.js +50 -48
  137. package/dist/bootstrap/index.js.map +2 -2
  138. package/dist/calendar.d.ts +55 -0
  139. package/dist/calendar.d.ts.map +1 -0
  140. package/dist/calendar.js +19 -0
  141. package/dist/calendar.js.map +9 -0
  142. package/dist/{chunk-5a4a52tq.js → chunk-0pmpwn3g.js} +18 -2
  143. package/dist/chunk-0pmpwn3g.js.map +10 -0
  144. package/dist/{chunk-0k3r5kb3.js → chunk-394zjzjs.js} +20 -10
  145. package/dist/{chunk-0k3r5kb3.js.map → chunk-394zjzjs.js.map} +5 -5
  146. package/dist/{chunk-stmxh0hv.js → chunk-3neam1y5.js} +2 -2
  147. package/dist/{chunk-zeykm8my.js → chunk-3qtk0070.js} +16 -42
  148. package/dist/chunk-3qtk0070.js.map +14 -0
  149. package/dist/{chunk-p8pgnq8d.js → chunk-425ydk65.js} +5 -5
  150. package/dist/{chunk-p351afzm.js → chunk-5sswe5ej.js} +2 -2
  151. package/dist/{chunk-a6fjkcne.js → chunk-60662fyv.js} +54 -28
  152. package/dist/{chunk-a6fjkcne.js.map → chunk-60662fyv.js.map} +7 -6
  153. package/dist/{chunk-e0hnbb1m.js → chunk-61zptves.js} +1 -1
  154. package/dist/chunk-6hfbz4d0.js +98 -0
  155. package/dist/chunk-6hfbz4d0.js.map +10 -0
  156. package/dist/{chunk-3zagkr6w.js → chunk-7mhbs9yy.js} +4 -4
  157. package/dist/{chunk-3zagkr6w.js.map → chunk-7mhbs9yy.js.map} +1 -1
  158. package/dist/{chunk-gxwy4c3s.js → chunk-7r9mqpva.js} +570 -104
  159. package/dist/chunk-7r9mqpva.js.map +47 -0
  160. package/dist/{chunk-3014rfjz.js → chunk-88xeh6zx.js} +28 -8
  161. package/dist/{chunk-3014rfjz.js.map → chunk-88xeh6zx.js.map} +4 -4
  162. package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
  163. package/dist/chunk-8tv3qd65.js.map +12 -0
  164. package/dist/chunk-90nqenq8.js +386 -0
  165. package/dist/chunk-90nqenq8.js.map +14 -0
  166. package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
  167. package/dist/{chunk-w1wq7gfr.js → chunk-9c9yknwt.js} +464 -29
  168. package/dist/{chunk-w1wq7gfr.js.map → chunk-9c9yknwt.js.map} +7 -7
  169. package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
  170. package/dist/chunk-9wr3yajk.js.map +2 -2
  171. package/dist/{chunk-rtm1jq00.js → chunk-ats8y3d9.js} +1202 -246
  172. package/dist/{chunk-rtm1jq00.js.map → chunk-ats8y3d9.js.map} +16 -14
  173. package/dist/{chunk-td26wjr5.js → chunk-bcz9dxtf.js} +17 -47
  174. package/dist/chunk-bcz9dxtf.js.map +12 -0
  175. package/dist/chunk-bqr703h4.js +1799 -0
  176. package/dist/chunk-bqr703h4.js.map +13 -0
  177. package/dist/{chunk-sysnvjce.js → chunk-brhp9d97.js} +2 -2
  178. package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
  179. package/dist/{chunk-rsxb14an.js → chunk-bs1sd0e0.js} +12 -8
  180. package/dist/chunk-bs1sd0e0.js.map +18 -0
  181. package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
  182. package/dist/chunk-c29729me.js.map +12 -0
  183. package/dist/{chunk-855w9nvw.js → chunk-cg7cygfj.js} +1 -1
  184. package/dist/chunk-dq3t5sr3.js +114 -0
  185. package/dist/chunk-dq3t5sr3.js.map +11 -0
  186. package/dist/{chunk-t24yktqr.js → chunk-dvgc56n2.js} +20 -4
  187. package/dist/{chunk-t24yktqr.js.map → chunk-dvgc56n2.js.map} +5 -5
  188. package/dist/{chunk-r2psmn42.js → chunk-eg6xqef7.js} +1 -1
  189. package/dist/{chunk-7kpqntgw.js → chunk-f05994as.js} +1 -1
  190. package/dist/{chunk-msyevpp3.js → chunk-fmgf9h5e.js} +38 -14
  191. package/dist/chunk-fmgf9h5e.js.map +22 -0
  192. package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
  193. package/dist/chunk-fzbhybya.js.map +11 -0
  194. package/dist/{chunk-t0s7b3d1.js → chunk-gaj8djsw.js} +251 -6
  195. package/dist/chunk-gaj8djsw.js.map +13 -0
  196. package/dist/{chunk-2bn6813a.js → chunk-grt2j5vp.js} +2 -2
  197. package/dist/{chunk-s7xqfxs9.js → chunk-hkbks1xm.js} +3 -1
  198. package/dist/{chunk-s7xqfxs9.js.map → chunk-hkbks1xm.js.map} +3 -3
  199. package/dist/chunk-hn2r7z41.js.map +1 -1
  200. package/dist/{chunk-rtdrm592.js → chunk-htdzx40w.js} +2 -2
  201. package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
  202. package/dist/{chunk-yy914zfr.js → chunk-jt012fxq.js} +772 -98
  203. package/dist/chunk-jt012fxq.js.map +34 -0
  204. package/dist/{chunk-48c1z8nj.js → chunk-kft7mp7z.js} +28 -3
  205. package/dist/chunk-kft7mp7z.js.map +10 -0
  206. package/dist/chunk-mbwsgjn7.js +40 -0
  207. package/dist/chunk-mbwsgjn7.js.map +11 -0
  208. package/dist/{chunk-wa05txmk.js → chunk-n1hbwc6y.js} +51 -8
  209. package/dist/chunk-n1hbwc6y.js.map +12 -0
  210. package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
  211. package/dist/chunk-nxysqbt0.js.map +10 -0
  212. package/dist/{chunk-6ef4esq4.js → chunk-pqj8vff9.js} +4 -4
  213. package/dist/chunk-pvpq483h.js.map +2 -2
  214. package/dist/{chunk-mzx71snp.js → chunk-q7g9cqwt.js} +7 -2
  215. package/dist/{chunk-mzx71snp.js.map → chunk-q7g9cqwt.js.map} +3 -3
  216. package/dist/{chunk-n68vz95m.js → chunk-qbd282aa.js} +2 -2
  217. package/dist/{chunk-e91fmg6t.js → chunk-qsa7nw6f.js} +2 -1
  218. package/dist/{chunk-e91fmg6t.js.map → chunk-qsa7nw6f.js.map} +3 -3
  219. package/dist/{chunk-rsrc7vtw.js → chunk-s8xxef60.js} +240 -46
  220. package/dist/chunk-s8xxef60.js.map +50 -0
  221. package/dist/{chunk-r9rtavg9.js → chunk-t19wjmnc.js} +7 -7
  222. package/dist/{chunk-vzkxqf8h.js → chunk-tapdssb5.js} +50 -6
  223. package/dist/chunk-tapdssb5.js.map +23 -0
  224. package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
  225. package/dist/{chunk-hvbvq7p4.js → chunk-vs2s3p8n.js} +731 -10
  226. package/dist/chunk-vs2s3p8n.js.map +20 -0
  227. package/dist/chunk-vtjzwymr.js.map +2 -2
  228. package/dist/{chunk-8t2ynwg0.js → chunk-wzcjhv54.js} +31 -1
  229. package/dist/{chunk-8t2ynwg0.js.map → chunk-wzcjhv54.js.map} +3 -3
  230. package/dist/{chunk-8tqnsx3q.js → chunk-xavet0qs.js} +5 -3
  231. package/dist/{chunk-8tqnsx3q.js.map → chunk-xavet0qs.js.map} +3 -3
  232. package/dist/{chunk-8bns0y68.js → chunk-xf76csps.js} +5 -5
  233. package/dist/{chunk-cwdzcv37.js → chunk-xrmbhap8.js} +2 -2
  234. package/dist/{chunk-cwdzcv37.js.map → chunk-xrmbhap8.js.map} +2 -2
  235. package/dist/{chunk-f6ahf5gf.js → chunk-xxfj0rr2.js} +20 -5
  236. package/dist/chunk-xxfj0rr2.js.map +13 -0
  237. package/dist/{chunk-3hzhcfsv.js → chunk-y8fwm3z2.js} +2 -2
  238. package/dist/{chunk-3hzhcfsv.js.map → chunk-y8fwm3z2.js.map} +3 -3
  239. package/dist/{chunk-smnt672s.js → chunk-ygvay56w.js} +20 -4
  240. package/dist/chunk-ygvay56w.js.map +10 -0
  241. package/dist/{chunk-evj5jxz3.js → chunk-ykchk644.js} +63 -15
  242. package/dist/{chunk-evj5jxz3.js.map → chunk-ykchk644.js.map} +7 -7
  243. package/dist/{chunk-vepea5c3.js → chunk-ym1bqd98.js} +6 -6
  244. package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
  245. package/dist/chunk-z4jqb44a.js.map +10 -0
  246. package/dist/connectors/connection-handles.d.ts +9 -0
  247. package/dist/connectors/connection-handles.d.ts.map +1 -0
  248. package/dist/connectors/connections/authorizations.d.ts +9 -0
  249. package/dist/connectors/connections/authorizations.d.ts.map +1 -1
  250. package/dist/connectors/connections/capability.d.ts +11 -0
  251. package/dist/connectors/connections/capability.d.ts.map +1 -1
  252. package/dist/connectors/connections/events.d.ts +17 -0
  253. package/dist/connectors/connections/events.d.ts.map +1 -0
  254. package/dist/connectors/connections/internal.d.ts +2 -1
  255. package/dist/connectors/connections/internal.d.ts.map +1 -1
  256. package/dist/connectors/connections/internal.js +8 -4
  257. package/dist/connectors/connections/internal.js.map +1 -1
  258. package/dist/connectors/connections/runs.d.ts +3 -0
  259. package/dist/connectors/connections/runs.d.ts.map +1 -1
  260. package/dist/connectors/connections/service.d.ts +13 -1
  261. package/dist/connectors/connections/service.d.ts.map +1 -1
  262. package/dist/connectors/execution.d.ts +14 -2
  263. package/dist/connectors/execution.d.ts.map +1 -1
  264. package/dist/connectors/index.d.ts +1 -1
  265. package/dist/connectors/index.d.ts.map +1 -1
  266. package/dist/connectors/service.d.ts +5 -1
  267. package/dist/connectors/service.d.ts.map +1 -1
  268. package/dist/connectors/types.d.ts +22 -1
  269. package/dist/connectors/types.d.ts.map +1 -1
  270. package/dist/datasets/write.js +1 -1
  271. package/dist/deploy/index.d.ts +1 -1
  272. package/dist/deploy/index.d.ts.map +1 -1
  273. package/dist/deploy/internal.js +3 -2
  274. package/dist/deploy/internal.js.map +3 -3
  275. package/dist/deploy/services.d.ts.map +1 -1
  276. package/dist/deploy/types.d.ts +22 -2
  277. package/dist/deploy/types.d.ts.map +1 -1
  278. package/dist/events/definitions.d.ts +4 -0
  279. package/dist/events/definitions.d.ts.map +1 -1
  280. package/dist/events/execution.d.ts +8 -1
  281. package/dist/events/execution.d.ts.map +1 -1
  282. package/dist/events/index.d.ts +2 -2
  283. package/dist/events/index.d.ts.map +1 -1
  284. package/dist/events/index.js +3 -3
  285. package/dist/events/outbox-dispatcher.d.ts +7 -0
  286. package/dist/events/outbox-dispatcher.d.ts.map +1 -1
  287. package/dist/events/scope.d.ts +1 -0
  288. package/dist/events/scope.d.ts.map +1 -1
  289. package/dist/events/scope.js +1 -1
  290. package/dist/events/selectors/builder.d.ts +9 -1
  291. package/dist/events/selectors/builder.d.ts.map +1 -1
  292. package/dist/events/selectors/index.d.ts +2 -2
  293. package/dist/events/selectors/index.d.ts.map +1 -1
  294. package/dist/events/selectors/index.js +2 -2
  295. package/dist/events/selectors/predicate.d.ts.map +1 -1
  296. package/dist/events/selectors/types.d.ts +18 -3
  297. package/dist/events/selectors/types.d.ts.map +1 -1
  298. package/dist/events/types/artifacts.d.ts +7 -1
  299. package/dist/events/types/artifacts.d.ts.map +1 -1
  300. package/dist/events/types/connectors.d.ts +32 -0
  301. package/dist/events/types/connectors.d.ts.map +1 -0
  302. package/dist/events/types/index.d.ts +3 -1
  303. package/dist/events/types/index.d.ts.map +1 -1
  304. package/dist/events/types/syncs.d.ts +4 -0
  305. package/dist/events/types/syncs.d.ts.map +1 -1
  306. package/dist/execution/agent.js +43 -42
  307. package/dist/execution/agent.js.map +1 -1
  308. package/dist/execution/authorization.d.ts +5 -0
  309. package/dist/execution/authorization.d.ts.map +1 -1
  310. package/dist/execution/authorized-object-reader.d.ts +4 -0
  311. package/dist/execution/authorized-object-reader.d.ts.map +1 -1
  312. package/dist/execution/object-reader-ontology.d.ts +3 -0
  313. package/dist/execution/object-reader-ontology.d.ts.map +1 -1
  314. package/dist/execution/primitive.js +41 -40
  315. package/dist/execution/primitive.js.map +1 -1
  316. package/dist/execution/request.d.ts +1 -1
  317. package/dist/execution/request.d.ts.map +1 -1
  318. package/dist/execution/request.js +39 -38
  319. package/dist/execution/request.js.map +3 -3
  320. package/dist/execution/scopes.d.ts +8 -0
  321. package/dist/execution/scopes.d.ts.map +1 -1
  322. package/dist/execution/script.d.ts +7 -0
  323. package/dist/execution/script.d.ts.map +1 -0
  324. package/dist/execution/types.d.ts +16 -1
  325. package/dist/execution/types.d.ts.map +1 -1
  326. package/dist/http/api-routes.d.ts.map +1 -1
  327. package/dist/http/index.js +1 -1
  328. package/dist/index.d.ts +13 -12
  329. package/dist/index.d.ts.map +1 -1
  330. package/dist/index.js +74 -70
  331. package/dist/index.js.map +1 -1
  332. package/dist/lake-storage/index.js +1 -1
  333. package/dist/lineage/executors.d.ts +1 -1
  334. package/dist/lineage/executors.d.ts.map +1 -1
  335. package/dist/maintenance/index.js +2 -2
  336. package/dist/materialization/event-envelopes.d.ts +3 -3
  337. package/dist/materialization/event-envelopes.d.ts.map +1 -1
  338. package/dist/materialization/events.d.ts +6 -0
  339. package/dist/materialization/events.d.ts.map +1 -1
  340. package/dist/materialization/index.js +1 -1
  341. package/dist/materialization/model.d.ts +6 -0
  342. package/dist/materialization/model.d.ts.map +1 -1
  343. package/dist/materializer/index.js +24 -23
  344. package/dist/materializer/index.js.map +1 -1
  345. package/dist/materializer/projections/replace.d.ts.map +1 -1
  346. package/dist/materializer/projections/replacement-plan.d.ts +2 -0
  347. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  348. package/dist/materializer/shared/normalize.d.ts +1 -0
  349. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  350. package/dist/models/audio/runtime.d.ts.map +1 -1
  351. package/dist/models/audio/types.d.ts +19 -0
  352. package/dist/models/audio/types.d.ts.map +1 -1
  353. package/dist/models/execution/index.js +22 -21
  354. package/dist/models/execution/index.js.map +1 -1
  355. package/dist/models/index.d.ts +1 -1
  356. package/dist/models/index.d.ts.map +1 -1
  357. package/dist/objects/index.js +41 -40
  358. package/dist/objects/index.js.map +1 -1
  359. package/dist/objects/query/executor.d.ts +3 -1
  360. package/dist/objects/query/executor.d.ts.map +1 -1
  361. package/dist/objects/query/explain.d.ts +3 -1
  362. package/dist/objects/query/explain.d.ts.map +1 -1
  363. package/dist/objects/query/index.d.ts +1 -1
  364. package/dist/objects/query/index.d.ts.map +1 -1
  365. package/dist/objects/query/index.js +21 -20
  366. package/dist/objects/query/index.js.map +1 -1
  367. package/dist/objects/query/link-query-clearance.d.ts +3 -0
  368. package/dist/objects/query/link-query-clearance.d.ts.map +1 -1
  369. package/dist/objects/query/links.d.ts +1 -1
  370. package/dist/objects/query/links.d.ts.map +1 -1
  371. package/dist/objects/query/validate.d.ts +17 -0
  372. package/dist/objects/query/validate.d.ts.map +1 -1
  373. package/dist/objects/sdk/runtime-query-executor.d.ts +1 -1
  374. package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
  375. package/dist/ontology/index.js +3 -3
  376. package/dist/ontology/internal.js +3 -3
  377. package/dist/pipelines/index.js +27 -26
  378. package/dist/pipelines/index.js.map +1 -1
  379. package/dist/projections/builders.d.ts +7 -1
  380. package/dist/projections/builders.d.ts.map +1 -1
  381. package/dist/projections/index.d.ts +1 -1
  382. package/dist/projections/index.d.ts.map +1 -1
  383. package/dist/projections/internal.js +22 -21
  384. package/dist/projections/internal.js.map +1 -1
  385. package/dist/projections/types.d.ts +10 -0
  386. package/dist/projections/types.d.ts.map +1 -1
  387. package/dist/projections/validation.d.ts.map +1 -1
  388. package/dist/queues/in-memory.d.ts +3 -2
  389. package/dist/queues/in-memory.d.ts.map +1 -1
  390. package/dist/queues/index.d.ts +1 -1
  391. package/dist/queues/index.d.ts.map +1 -1
  392. package/dist/queues/index.js +1 -1
  393. package/dist/queues/types.d.ts +40 -13
  394. package/dist/queues/types.d.ts.map +1 -1
  395. package/dist/runtime/host.d.ts +13 -0
  396. package/dist/runtime/host.d.ts.map +1 -1
  397. package/dist/runtime/internal.d.ts +1 -0
  398. package/dist/runtime/internal.d.ts.map +1 -1
  399. package/dist/runtime/internal.js +47 -25
  400. package/dist/runtime/internal.js.map +4 -3
  401. package/dist/runtime/locale.d.ts +0 -2
  402. package/dist/runtime/locale.d.ts.map +1 -1
  403. package/dist/runtime/resolve-definitions.d.ts +1 -1
  404. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  405. package/dist/runtime/script.d.ts +39 -0
  406. package/dist/runtime/script.d.ts.map +1 -0
  407. package/dist/runtime/sixb.d.ts +2 -2
  408. package/dist/runtime/sixb.d.ts.map +1 -1
  409. package/dist/sandboxes/auth.d.ts +26 -4
  410. package/dist/sandboxes/auth.d.ts.map +1 -1
  411. package/dist/sandboxes/index.d.ts +3 -1
  412. package/dist/sandboxes/index.d.ts.map +1 -1
  413. package/dist/sandboxes/index.js +5 -5
  414. package/dist/schedules/builders.d.ts.map +1 -1
  415. package/dist/schedules/index.js +3 -3
  416. package/dist/schedules/runtime.d.ts.map +1 -1
  417. package/dist/schedules/validation.d.ts +2 -0
  418. package/dist/schedules/validation.d.ts.map +1 -1
  419. package/dist/security/view-conditions.d.ts.map +1 -1
  420. package/dist/shares/internal.js +19 -18
  421. package/dist/shares/internal.js.map +2 -2
  422. package/dist/storage/agents/errors.d.ts +1 -1
  423. package/dist/storage/agents/errors.d.ts.map +1 -1
  424. package/dist/storage/agents/in-memory.d.ts +43 -1
  425. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  426. package/dist/storage/agents/index.d.ts +2 -2
  427. package/dist/storage/agents/index.d.ts.map +1 -1
  428. package/dist/storage/agents/provider.d.ts +54 -11
  429. package/dist/storage/agents/provider.d.ts.map +1 -1
  430. package/dist/storage/agents/provider.js +41 -5
  431. package/dist/storage/agents/provider.js.map +1 -1
  432. package/dist/storage/agents/types.d.ts +291 -3
  433. package/dist/storage/agents/types.d.ts.map +1 -1
  434. package/dist/storage/ai-cost/analytics.d.ts +3 -2
  435. package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
  436. package/dist/storage/ai-cost/provider.js +4 -3
  437. package/dist/storage/ai-cost/provider.js.map +1 -1
  438. package/dist/storage/ai-cost/types.d.ts +5 -1
  439. package/dist/storage/ai-cost/types.d.ts.map +1 -1
  440. package/dist/storage/artifacts/in-memory.d.ts +7 -1
  441. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  442. package/dist/storage/artifacts/index.d.ts +1 -1
  443. package/dist/storage/artifacts/index.d.ts.map +1 -1
  444. package/dist/storage/artifacts/record.d.ts +5 -2
  445. package/dist/storage/artifacts/record.d.ts.map +1 -1
  446. package/dist/storage/artifacts/types.d.ts +41 -0
  447. package/dist/storage/artifacts/types.d.ts.map +1 -1
  448. package/dist/storage/executions/provider.d.ts +3 -3
  449. package/dist/storage/executions/provider.d.ts.map +1 -1
  450. package/dist/storage/executions/provider.js +1 -1
  451. package/dist/storage/executions/types.d.ts +6 -0
  452. package/dist/storage/executions/types.d.ts.map +1 -1
  453. package/dist/storage/executions/validation.d.ts.map +1 -1
  454. package/dist/storage/file-upload-sessions/provider.js +7 -7
  455. package/dist/storage/index.d.ts +4 -4
  456. package/dist/storage/index.d.ts.map +1 -1
  457. package/dist/storage/index.js +30 -25
  458. package/dist/storage/index.js.map +1 -1
  459. package/dist/storage/internal.d.ts +1 -1
  460. package/dist/storage/internal.d.ts.map +1 -1
  461. package/dist/storage/internal.js +12 -10
  462. package/dist/storage/internal.js.map +2 -2
  463. package/dist/storage/ontology/in-memory/replacement-plans.d.ts +2 -0
  464. package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
  465. package/dist/storage/ontology/provider.js +1 -1
  466. package/dist/storage/ontology/replacement-plans.d.ts +8 -0
  467. package/dist/storage/ontology/replacement-plans.d.ts.map +1 -1
  468. package/dist/storage/operation-scope.d.ts.map +1 -1
  469. package/dist/storage/operation-scope.js +1 -1
  470. package/dist/storage/sync-runs/idempotency.d.ts.map +1 -1
  471. package/dist/storage/sync-runs/in-memory.d.ts +2 -1
  472. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
  473. package/dist/storage/sync-runs/index.d.ts +1 -1
  474. package/dist/storage/sync-runs/index.d.ts.map +1 -1
  475. package/dist/storage/sync-runs/types.d.ts +27 -2
  476. package/dist/storage/sync-runs/types.d.ts.map +1 -1
  477. package/dist/storage/workflow-runs/provider.js +7 -7
  478. package/dist/syncs/accounts.d.ts +36 -0
  479. package/dist/syncs/accounts.d.ts.map +1 -0
  480. package/dist/syncs/builders.d.ts.map +1 -1
  481. package/dist/syncs/connections.d.ts +36 -0
  482. package/dist/syncs/connections.d.ts.map +1 -0
  483. package/dist/syncs/execution.d.ts +14 -4
  484. package/dist/syncs/execution.d.ts.map +1 -1
  485. package/dist/syncs/index.d.ts +2 -1
  486. package/dist/syncs/index.d.ts.map +1 -1
  487. package/dist/syncs/index.js +28 -27
  488. package/dist/syncs/index.js.map +1 -1
  489. package/dist/syncs/request.d.ts +16 -2
  490. package/dist/syncs/request.d.ts.map +1 -1
  491. package/dist/syncs/run-dispatch.d.ts +14 -2
  492. package/dist/syncs/run-dispatch.d.ts.map +1 -1
  493. package/dist/testing/agent-approval-storage-contract.d.ts.map +1 -1
  494. package/dist/testing/agent-execution.d.ts +3 -0
  495. package/dist/testing/agent-execution.d.ts.map +1 -1
  496. package/dist/testing/agent-inbox-storage-contract.d.ts +15 -0
  497. package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -0
  498. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  499. package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
  500. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  501. package/dist/testing/execution-storage-contract.d.ts.map +1 -1
  502. package/dist/testing/index.d.ts +1 -0
  503. package/dist/testing/index.d.ts.map +1 -1
  504. package/dist/testing/index.js +6589 -4627
  505. package/dist/testing/index.js.map +13 -12
  506. package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
  507. package/dist/testing/queues-contract.d.ts.map +1 -1
  508. package/dist/testing/run-claim-storage-contract.d.ts.map +1 -1
  509. package/dist/webhooks/connections.d.ts +3 -4
  510. package/dist/webhooks/connections.d.ts.map +1 -1
  511. package/dist/webhooks/index.d.ts +1 -1
  512. package/dist/webhooks/index.d.ts.map +1 -1
  513. package/dist/webhooks/internal.js +22 -54
  514. package/dist/webhooks/internal.js.map +3 -3
  515. package/dist/webhooks/types.d.ts +2 -11
  516. package/dist/webhooks/types.d.ts.map +1 -1
  517. package/dist/workers/index.js +66 -13
  518. package/dist/workers/index.js.map +4 -4
  519. package/dist/workers/queue-worker.d.ts +5 -0
  520. package/dist/workers/queue-worker.d.ts.map +1 -1
  521. package/dist/workers/queued-run-dispatch.d.ts.map +1 -1
  522. package/dist/workers/worker.d.ts +8 -0
  523. package/dist/workers/worker.d.ts.map +1 -1
  524. package/dist/workflows/index.js +50 -48
  525. package/dist/workflows/index.js.map +1 -1
  526. package/package.json +12 -1
  527. package/src/actions/validation.ts +3 -1
  528. package/src/agents/README.md +6 -2
  529. package/src/agents/children.ts +6 -0
  530. package/src/agents/errors.ts +3 -0
  531. package/src/agents/execution.ts +331 -43
  532. package/src/agents/ids.ts +5 -0
  533. package/src/agents/index.ts +22 -4
  534. package/src/agents/model-routing.ts +25 -9
  535. package/src/agents/queued-turn.ts +46 -0
  536. package/src/agents/request.ts +1444 -210
  537. package/src/agents/run-after-finish.ts +259 -2
  538. package/src/agents/run-artifacts.ts +3 -93
  539. package/src/agents/run-events.ts +256 -34
  540. package/src/agents/run-session-children.ts +13 -2
  541. package/src/agents/run-session-http.ts +9 -2
  542. package/src/agents/run-session-serve.ts +2 -8
  543. package/src/agents/run-session.ts +142 -3
  544. package/src/agents/run-turn.ts +148 -23
  545. package/src/agents/streams/index.ts +3 -0
  546. package/src/agents/streams/internal.ts +12 -0
  547. package/src/agents/streams/protocol.ts +109 -1
  548. package/src/agents/streams/steps.ts +131 -0
  549. package/src/agents/thread-access.ts +57 -2
  550. package/src/agents/turn-answered.ts +31 -0
  551. package/src/agents/validation.ts +2 -0
  552. package/src/artifacts/canvas-display.ts +4 -6
  553. package/src/artifacts/comments.ts +70 -17
  554. package/src/artifacts/document-fill.ts +103 -0
  555. package/src/artifacts/errors.ts +2 -0
  556. package/src/artifacts/events.ts +4 -1
  557. package/src/artifacts/execution.ts +265 -31
  558. package/src/artifacts/frames/assets.ts +42 -7
  559. package/src/artifacts/frames/document-data.ts +353 -0
  560. package/src/artifacts/frames/entries.ts +22 -16
  561. package/src/artifacts/frames/grants.ts +2 -2
  562. package/src/artifacts/frames/index.ts +3 -0
  563. package/src/artifacts/frames/kit.ts +102 -0
  564. package/src/artifacts/frames/protocol.ts +12 -1
  565. package/src/artifacts/frames/runtime.ts +413 -6
  566. package/src/artifacts/index.ts +3 -0
  567. package/src/artifacts/live/blocks.ts +889 -0
  568. package/src/artifacts/live/board.ts +195 -42
  569. package/src/artifacts/live/document.ts +170 -5
  570. package/src/artifacts/live/index.ts +7 -0
  571. package/src/artifacts/live/page.ts +807 -0
  572. package/src/artifacts/live/protocol.ts +5 -0
  573. package/src/artifacts/live/server.ts +2 -2
  574. package/src/artifacts/live/state.ts +9 -4
  575. package/src/artifacts/outline.ts +17 -0
  576. package/src/artifacts/paper.ts +173 -0
  577. package/src/artifacts/pdf-job.ts +11 -0
  578. package/src/artifacts/publish/fields.ts +177 -0
  579. package/src/artifacts/publish/index.ts +6 -1
  580. package/src/artifacts/publish/merge.ts +28 -15
  581. package/src/artifacts/publish/pdf.ts +82 -0
  582. package/src/artifacts/publish/previews.ts +24 -34
  583. package/src/artifacts/publish/publish.ts +26 -3
  584. package/src/artifacts/publish/queries.ts +20 -4
  585. package/src/artifacts/publish/query-answers.ts +14 -3
  586. package/src/artifacts/publish/validate/document-html.ts +245 -0
  587. package/src/artifacts/publish/validate/document.ts +34 -3
  588. package/src/artifacts/queries.ts +59 -13
  589. package/src/artifacts/run-query.ts +5 -2
  590. package/src/authorization/event-visibility.ts +13 -0
  591. package/src/calendar.ts +195 -0
  592. package/src/connectors/connection-handles.ts +71 -0
  593. package/src/connectors/connections/authorizations.ts +50 -2
  594. package/src/connectors/connections/capability.ts +40 -0
  595. package/src/connectors/connections/events.ts +57 -0
  596. package/src/connectors/connections/internal.ts +3 -0
  597. package/src/connectors/connections/runs.ts +5 -0
  598. package/src/connectors/connections/service.ts +93 -6
  599. package/src/connectors/execution.ts +35 -8
  600. package/src/connectors/index.ts +3 -0
  601. package/src/connectors/service.ts +23 -0
  602. package/src/connectors/types.ts +29 -1
  603. package/src/deploy/index.ts +1 -0
  604. package/src/deploy/services.ts +1 -0
  605. package/src/deploy/types.ts +30 -2
  606. package/src/events/definitions.ts +14 -0
  607. package/src/events/execution.ts +51 -4
  608. package/src/events/index.ts +8 -0
  609. package/src/events/outbox-dispatcher.ts +12 -2
  610. package/src/events/scope.ts +3 -0
  611. package/src/events/selectors/builder.ts +49 -0
  612. package/src/events/selectors/index.ts +5 -0
  613. package/src/events/selectors/predicate.ts +2 -0
  614. package/src/events/selectors/types.ts +30 -1
  615. package/src/events/types/artifacts.ts +7 -1
  616. package/src/events/types/connectors.ts +36 -0
  617. package/src/events/types/index.ts +7 -0
  618. package/src/events/types/syncs.ts +4 -0
  619. package/src/execution/authorization.ts +45 -0
  620. package/src/execution/authorized-object-reader.ts +33 -5
  621. package/src/execution/durable.ts +2 -0
  622. package/src/execution/object-reader-ontology.ts +6 -0
  623. package/src/execution/request.ts +1 -0
  624. package/src/execution/scopes.ts +24 -0
  625. package/src/execution/script.ts +27 -0
  626. package/src/execution/types.ts +7 -1
  627. package/src/http/api-routes.ts +33 -0
  628. package/src/index.ts +39 -4
  629. package/src/lineage/executors.ts +3 -1
  630. package/src/materialization/event-envelopes.ts +10 -5
  631. package/src/materialization/events.ts +2 -0
  632. package/src/materialization/model.ts +6 -0
  633. package/src/materializer/README.md +10 -0
  634. package/src/materializer/projections/replace.ts +42 -1
  635. package/src/materializer/projections/replacement-plan.ts +44 -4
  636. package/src/materializer/shared/normalize.ts +4 -0
  637. package/src/models/audio/runtime.ts +57 -14
  638. package/src/models/audio/types.ts +20 -0
  639. package/src/models/index.ts +1 -0
  640. package/src/objects/query/executor.ts +4 -0
  641. package/src/objects/query/explain.ts +5 -0
  642. package/src/objects/query/index.ts +1 -0
  643. package/src/objects/query/link-query-clearance.ts +4 -1
  644. package/src/objects/query/links.ts +5 -1
  645. package/src/objects/query/validate.ts +33 -1
  646. package/src/objects/sdk/runtime-query-executor.ts +7 -3
  647. package/src/projections/builders.ts +20 -0
  648. package/src/projections/index.ts +1 -0
  649. package/src/projections/registry.ts +1 -0
  650. package/src/projections/revision.ts +2 -0
  651. package/src/projections/types.ts +11 -0
  652. package/src/projections/validation.ts +6 -0
  653. package/src/queues/in-memory.ts +5 -0
  654. package/src/queues/index.ts +3 -1
  655. package/src/queues/types.ts +45 -14
  656. package/src/runtime/host.ts +125 -11
  657. package/src/runtime/internal.ts +1 -0
  658. package/src/runtime/locale.ts +0 -10
  659. package/src/runtime/resolve-definitions.ts +4 -1
  660. package/src/runtime/script.ts +62 -0
  661. package/src/runtime/sixb.ts +15 -5
  662. package/src/sandboxes/README.md +3 -1
  663. package/src/sandboxes/auth.ts +32 -4
  664. package/src/sandboxes/index.ts +15 -1
  665. package/src/schedules/builders.ts +4 -1
  666. package/src/schedules/runtime.ts +3 -0
  667. package/src/schedules/validation.ts +20 -2
  668. package/src/security/view-conditions.ts +2 -1
  669. package/src/storage/agents/errors.ts +1 -0
  670. package/src/storage/agents/in-memory.ts +500 -7
  671. package/src/storage/agents/index.ts +26 -0
  672. package/src/storage/agents/provider.ts +454 -15
  673. package/src/storage/agents/types.ts +315 -3
  674. package/src/storage/ai-cost/analytics.ts +22 -43
  675. package/src/storage/ai-cost/types.ts +5 -1
  676. package/src/storage/artifacts/in-memory.ts +52 -6
  677. package/src/storage/artifacts/index.ts +2 -0
  678. package/src/storage/artifacts/record.ts +33 -4
  679. package/src/storage/artifacts/types.ts +44 -0
  680. package/src/storage/executions/provider.ts +22 -2
  681. package/src/storage/executions/types.ts +2 -0
  682. package/src/storage/executions/validation.ts +27 -0
  683. package/src/storage/index.ts +29 -0
  684. package/src/storage/internal.ts +1 -0
  685. package/src/storage/ontology/in-memory/replacement-plans.ts +22 -0
  686. package/src/storage/ontology/replacement-plans.ts +6 -0
  687. package/src/storage/operation-scope.ts +2 -0
  688. package/src/storage/sync-runs/idempotency.ts +1 -0
  689. package/src/storage/sync-runs/in-memory.ts +43 -1
  690. package/src/storage/sync-runs/index.ts +1 -0
  691. package/src/storage/sync-runs/types.ts +30 -1
  692. package/src/syncs/accounts.ts +85 -0
  693. package/src/syncs/builders.ts +18 -1
  694. package/src/syncs/connections.ts +123 -0
  695. package/src/syncs/execution.ts +64 -22
  696. package/src/syncs/index.ts +3 -0
  697. package/src/syncs/request.ts +81 -23
  698. package/src/syncs/run-dispatch.ts +69 -7
  699. package/src/testing/agent-approval-storage-contract.ts +123 -0
  700. package/src/testing/agent-execution.ts +45 -2
  701. package/src/testing/agent-inbox-storage-contract.ts +874 -0
  702. package/src/testing/agent-storage-contract.ts +965 -103
  703. package/src/testing/ai-cost-storage-contract.ts +80 -0
  704. package/src/testing/artifact-storage-contract.ts +201 -4
  705. package/src/testing/execution-storage-contract.ts +31 -0
  706. package/src/testing/index.ts +5 -0
  707. package/src/testing/materializer-storage-contract.ts +139 -1
  708. package/src/testing/queues-contract.ts +22 -0
  709. package/src/testing/run-claim-storage-contract.ts +116 -0
  710. package/src/webhooks/connections.ts +9 -50
  711. package/src/webhooks/index.ts +0 -2
  712. package/src/webhooks/types.ts +2 -13
  713. package/src/workers/README.md +4 -1
  714. package/src/workers/lost-runs.ts +1 -0
  715. package/src/workers/queue-worker.ts +16 -5
  716. package/src/workers/queued-run-dispatch.ts +8 -1
  717. package/src/workers/worker.ts +67 -7
  718. package/dist/chunk-3z1vxzcm.js +0 -234
  719. package/dist/chunk-3z1vxzcm.js.map +0 -12
  720. package/dist/chunk-48c1z8nj.js.map +0 -10
  721. package/dist/chunk-58geavnf.js +0 -29
  722. package/dist/chunk-58geavnf.js.map +0 -10
  723. package/dist/chunk-5a4a52tq.js.map +0 -10
  724. package/dist/chunk-9nsjjd44.js.map +0 -12
  725. package/dist/chunk-b9qfh2ya.js.map +0 -11
  726. package/dist/chunk-eptrvnby.js.map +0 -12
  727. package/dist/chunk-f6ahf5gf.js.map +0 -13
  728. package/dist/chunk-gxwy4c3s.js.map +0 -47
  729. package/dist/chunk-hvbvq7p4.js.map +0 -18
  730. package/dist/chunk-m2jerfef.js +0 -474
  731. package/dist/chunk-m2jerfef.js.map +0 -11
  732. package/dist/chunk-msyevpp3.js.map +0 -22
  733. package/dist/chunk-n4zzaf6q.js.map +0 -10
  734. package/dist/chunk-rsrc7vtw.js.map +0 -49
  735. package/dist/chunk-rsxb14an.js.map +0 -18
  736. package/dist/chunk-smnt672s.js.map +0 -10
  737. package/dist/chunk-t0s7b3d1.js.map +0 -13
  738. package/dist/chunk-td26wjr5.js.map +0 -13
  739. package/dist/chunk-vzkxqf8h.js.map +0 -23
  740. package/dist/chunk-wa05txmk.js.map +0 -11
  741. package/dist/chunk-yv8hv4wq.js.map +0 -10
  742. package/dist/chunk-yy914zfr.js.map +0 -30
  743. package/dist/chunk-zeykm8my.js.map +0 -14
  744. /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
  745. /package/dist/{chunk-p8pgnq8d.js.map → chunk-425ydk65.js.map} +0 -0
  746. /package/dist/{chunk-p351afzm.js.map → chunk-5sswe5ej.js.map} +0 -0
  747. /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
  748. /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
  749. /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
  750. /package/dist/{chunk-sysnvjce.js.map → chunk-brhp9d97.js.map} +0 -0
  751. /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
  752. /package/dist/{chunk-855w9nvw.js.map → chunk-cg7cygfj.js.map} +0 -0
  753. /package/dist/{chunk-r2psmn42.js.map → chunk-eg6xqef7.js.map} +0 -0
  754. /package/dist/{chunk-7kpqntgw.js.map → chunk-f05994as.js.map} +0 -0
  755. /package/dist/{chunk-2bn6813a.js.map → chunk-grt2j5vp.js.map} +0 -0
  756. /package/dist/{chunk-rtdrm592.js.map → chunk-htdzx40w.js.map} +0 -0
  757. /package/dist/{chunk-bc3y6gff.js.map → chunk-jka26v8c.js.map} +0 -0
  758. /package/dist/{chunk-6ef4esq4.js.map → chunk-pqj8vff9.js.map} +0 -0
  759. /package/dist/{chunk-n68vz95m.js.map → chunk-qbd282aa.js.map} +0 -0
  760. /package/dist/{chunk-r9rtavg9.js.map → chunk-t19wjmnc.js.map} +0 -0
  761. /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
  762. /package/dist/{chunk-8bns0y68.js.map → chunk-xf76csps.js.map} +0 -0
  763. /package/dist/{chunk-vepea5c3.js.map → chunk-ym1bqd98.js.map} +0 -0
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/storage/executions/errors.ts", "../src/storage/executions/validation.ts", "../src/storage/executions/provider.ts"],
4
+ "sourcesContent": [
5
+ "export type ExecutionStorageErrorCode =\n | \"duplicate_execution\"\n | \"invalid_credential\"\n | \"invalid_input\"\n | \"invalid_parent_execution\"\n | \"missing_credential\"\n | \"missing_parent_execution\"\n | \"missing_principal\"\n\n/** Stable error raised when an execution record would violate ledger invariants. */\nexport class ExecutionStorageError extends Error {\n readonly name = \"ExecutionStorageError\"\n\n constructor(\n readonly code: ExecutionStorageErrorCode,\n message: string,\n options: ErrorOptions = {}\n ) {\n super(message, options)\n }\n}\n",
6
+ "import { isDeepStrictEqual } from \"node:util\"\nimport { normalizeRequesterGroupIds, snapshotRequesterGroupIds } from \"../../auth/attribution\"\nimport { kernelOperationId } from \"../../execution/kernel-operation\"\nimport { isScriptPath } from \"../../execution/script\"\nimport type {\n AuthorizablePrincipal,\n AuthorizationRef,\n KernelOperation,\n} from \"../../execution/types\"\nimport type { AuthStorage } from \"../auth\"\nimport { ExecutionStorageError } from \"./errors\"\nimport type {\n CreateExecutionInput,\n DurableExecutionExecutor,\n DurableExecutionSource,\n ExecutionRecord,\n} from \"./types\"\n\nexport interface ExecutionValidationLookup {\n readonly auth: AuthStorage\n getExecution(params: {\n readonly projectId: string\n readonly id: string\n }): Promise<ExecutionRecord | null>\n getShareSession(params: {\n readonly projectId: string\n readonly id: string\n }): Promise<{ readonly grantId: string } | null>\n}\n\n/** Capture accounting attribution at the same storage boundary that admits the execution. */\nexport async function prepareExecutionRecord(\n input: CreateExecutionInput,\n lookup: ExecutionValidationLookup\n): Promise<ExecutionRecord> {\n let groups = input.requesterGroupIds\n if (groups === undefined && input.source.type === \"execution\") {\n const parent = await lookup.getExecution({\n projectId: input.projectId,\n id: input.source.executionId,\n })\n groups = parent?.requesterGroupIds\n } else if (groups === undefined && input.requestedBy) {\n groups = await snapshotRequesterGroupIds({\n auth: lookup.auth,\n projectId: input.projectId,\n principal: input.requestedBy,\n })\n }\n const record = normalizeExecutionRecord({ ...input, requesterGroupIds: groups ?? [] })\n await validateExecutionRecordReferences(record, lookup)\n return record\n}\n\nexport function normalizeExecutionRecord(\n input: CreateExecutionInput,\n createdAt: Date = new Date()\n): ExecutionRecord {\n const record: ExecutionRecord = {\n id: input.id,\n projectId: input.projectId,\n requesterGroupIds: normalizeRequesterGroupIds(input.requesterGroupIds ?? []),\n ...(input.requestedBy === undefined ? {} : { requestedBy: structuredClone(input.requestedBy) }),\n executor: structuredClone(input.executor),\n source: structuredClone(input.source),\n correlationId: input.correlationId,\n authorizationRef: structuredClone(input.authorizationRef),\n createdAt: new Date(createdAt),\n }\n\n assertRecordShape(record)\n assertExecutorAuthority(record)\n return record\n}\n\nexport async function validateExecutionRecordReferences(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n await validatePrincipal(record.requestedBy, record.projectId, \"Requested-by principal\", lookup)\n\n if (record.authorizationRef.type === \"principal\") {\n await validatePrincipal(\n record.authorizationRef.principal,\n record.projectId,\n \"Authority principal\",\n lookup\n )\n await validateCredential(record, lookup)\n }\n if (record.authorizationRef.type === \"delegated\") {\n await validateDelegation(record, lookup)\n }\n\n await validateParent(record, lookup)\n}\n\nexport function cloneExecutionRecord(record: ExecutionRecord): ExecutionRecord {\n return structuredClone(record)\n}\n\nfunction assertRecordShape(record: ExecutionRecord): void {\n assertNonBlank(record.id, \"Execution id\")\n assertNonBlank(record.projectId, \"Execution project id\")\n assertNonBlank(record.correlationId, \"Execution correlation id\")\n assertValidDate(record.createdAt, \"Execution createdAt\")\n\n if (record.requestedBy) {\n assertPrincipal(record.requestedBy, \"Requested-by principal\")\n }\n\n assertExecutor(record.executor)\n assertSource(record.source)\n assertAuthorizationRef(record.authorizationRef)\n}\n\nfunction assertExecutor(executor: DurableExecutionExecutor): void {\n switch (executor.type) {\n case \"request\":\n assertNonBlank(executor.requestId, \"Executor request id\")\n return\n case \"primitive\":\n assertTrustedPrimitiveKind(executor.kind, \"Executor primitive kind\")\n assertNonBlank(executor.runId, \"Executor primitive run id\")\n return\n case \"agent\":\n assertNonBlank(executor.runId, \"Executor agent run id\")\n return\n case \"kernel\":\n assertKernelOperation(executor.operation, \"Executor kernel operation\")\n return\n case \"script\":\n assertNonBlank(executor.runId, \"Executor script run id\")\n return\n default:\n invalid(`Unknown execution executor type '${String((executor as { type?: unknown }).type)}'.`)\n }\n}\n\nfunction assertSource(source: DurableExecutionSource): void {\n switch (source.type) {\n case \"ontologyCommit\":\n assertNonBlank(source.commitId, \"Execution source commit id\")\n return\n case \"http\":\n assertNonBlank(source.requestId, \"Execution source request id\")\n return\n case \"webhook\":\n assertNonBlank(source.deliveryId, \"Execution source delivery id\")\n return\n case \"schedule\":\n case \"event\":\n assertNonBlank(source.eventId, \"Execution source event id\")\n return\n case \"datasetVersion\":\n assertNonBlank(source.datasetId, \"Execution source dataset id\")\n assertNonBlank(source.versionId, \"Execution source dataset version id\")\n return\n case \"execution\":\n assertNonBlank(source.executionId, \"Execution source execution id\")\n return\n case \"script\":\n if (!isScriptPath(source.path)) {\n invalid(\"Execution source script path must be relative to the project.\")\n }\n return\n default:\n invalid(\n `Execution source type '${String((source as { type?: unknown }).type)}' is not durable.`\n )\n }\n}\n\nfunction assertAuthorizationRef(ref: AuthorizationRef): void {\n switch (ref.type) {\n case \"principal\":\n assertPrincipal(ref.principal, \"Authority principal\")\n if (ref.credential) {\n if (ref.credential.type !== \"session\" && ref.credential.type !== \"accessToken\") {\n invalid(\n `Unknown authority credential type '${String(\n (ref.credential as { type?: unknown }).type\n )}'.`\n )\n }\n assertNonBlank(ref.credential.id, \"Authority credential id\")\n }\n return\n case \"trustedPrimitive\":\n assertTrustedPrimitiveKind(ref.primitive.kind, \"Authority primitive kind\")\n assertNonBlank(ref.primitive.id, \"Authority primitive id\")\n assertNonBlank(ref.primitive.runId, \"Authority primitive run id\")\n return\n case \"delegated\":\n if (ref.delegation.kind !== \"share\") {\n invalid(\n `Unknown authority delegation kind '${String(\n (ref.delegation as { kind?: unknown }).kind\n )}'.`\n )\n }\n assertNonBlank(ref.delegation.grantId, \"Authority delegation grant id\")\n assertNonBlank(ref.delegation.sessionId, \"Authority delegation session id\")\n return\n case \"kernel\":\n assertKernelOperation(ref.operation, \"Authority kernel operation\")\n return\n case \"script\":\n assertNonBlank(ref.runId, \"Authority script run id\")\n return\n case \"disabled\":\n return\n default:\n invalid(`Unknown authorization reference type '${String((ref as { type?: unknown }).type)}'.`)\n }\n}\n\nfunction assertExecutorAuthority(record: ExecutionRecord): void {\n const { executor, authorizationRef, requestedBy, source } = record\n if (source.type === \"script\" && executor.type !== \"script\") {\n invalid(\"Only a script execution has a script source.\")\n }\n\n switch (executor.type) {\n case \"request\": {\n if (source.type !== \"http\" || source.requestId !== executor.requestId) {\n invalid(\"Request executions require a matching HTTP source request id.\")\n }\n if (authorizationRef.type === \"principal\") {\n if (!principalsEqual(requestedBy, authorizationRef.principal)) {\n invalid(\"Request authority must match its requested-by principal.\")\n }\n return\n }\n if (authorizationRef.type === \"disabled\") {\n if (requestedBy !== undefined) {\n invalid(\"Auth-disabled request executions cannot have a requested-by principal.\")\n }\n return\n }\n if (authorizationRef.type === \"delegated\") {\n if (requestedBy !== undefined) {\n invalid(\"Delegated request executions cannot have a requested-by principal.\")\n }\n return\n }\n invalid(\"Request executions require principal, delegated, or explicitly disabled authority.\")\n break\n }\n case \"primitive\": {\n if (authorizationRef.type !== \"trustedPrimitive\") {\n invalid(\"Primitive executions require trusted primitive authority.\")\n }\n if (\n authorizationRef.primitive.kind !== executor.kind ||\n authorizationRef.primitive.runId !== executor.runId\n ) {\n invalid(\"Trusted primitive authority must match the executor kind and run id.\")\n }\n return\n }\n case \"agent\": {\n if (source.type !== \"execution\") {\n invalid(\"Agent executions require a parent execution source.\")\n }\n if (\n authorizationRef.type === \"principal\" &&\n authorizationRef.principal.type === \"serviceAccount\" &&\n authorizationRef.credential === undefined\n ) {\n return\n }\n if (\n authorizationRef.type === \"principal\" &&\n authorizationRef.principal.type === \"user\" &&\n authorizationRef.credential !== undefined\n ) {\n return\n }\n if (authorizationRef.type === \"disabled\") return\n invalid(\n \"Agent executions require managed service-account, credentialed user, or explicitly disabled authority.\"\n )\n break\n }\n case \"kernel\": {\n if (\n authorizationRef.type !== \"kernel\" ||\n !kernelOperationsEqual(authorizationRef.operation, executor.operation)\n ) {\n invalid(\"Kernel authority must match the executor operation.\")\n }\n if (requestedBy !== undefined) {\n invalid(\"Kernel executions cannot have a requested-by principal.\")\n }\n return\n }\n case \"script\": {\n if (source.type !== \"script\") {\n invalid(\"Script executions require a script source.\")\n }\n if (authorizationRef.type !== \"script\" || authorizationRef.runId !== executor.runId) {\n invalid(\"Script authority must match the executor run id.\")\n }\n if (requestedBy !== undefined) {\n invalid(\"Script executions cannot have a requested-by principal.\")\n }\n return\n }\n }\n}\n\nasync function validatePrincipal(\n principal: AuthorizablePrincipal | undefined,\n projectId: string,\n label: string,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (!principal) return\n\n const record =\n principal.type === \"user\"\n ? await lookup.auth.users.getById({ projectId, id: principal.id })\n : await lookup.auth.serviceAccounts.getById({ projectId, id: principal.id })\n if (!record) {\n throw new ExecutionStorageError(\n \"missing_principal\",\n `[Sixb] ${label} '${principal.id}' does not exist in project '${projectId}'.`\n )\n }\n}\n\nasync function validateCredential(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.authorizationRef.type !== \"principal\" || !record.authorizationRef.credential) return\n\n const { principal, credential } = record.authorizationRef\n if (credential.type === \"session\") {\n const session = await lookup.auth.sessions.getById({\n projectId: record.projectId,\n id: credential.id,\n })\n if (!session) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority session '${credential.id}' does not exist in project '${record.projectId}'.`\n )\n }\n if (principal.type !== \"user\" || session.userId !== principal.id) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority session '${credential.id}' does not belong to principal '${principal.id}'.`\n )\n }\n return\n }\n\n const token = await lookup.auth.accessTokens.getById({\n projectId: record.projectId,\n id: credential.id,\n })\n if (!token) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority access token '${credential.id}' does not exist in project '${record.projectId}'.`\n )\n }\n if (!principalsEqual(token.subject, principal)) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority access token '${credential.id}' does not belong to principal '${principal.id}'.`\n )\n }\n}\n\nasync function validateDelegation(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.authorizationRef.type !== \"delegated\") return\n const { grantId, sessionId } = record.authorizationRef.delegation\n const session = await lookup.getShareSession({ projectId: record.projectId, id: sessionId })\n if (!session) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority shared session '${sessionId}' does not exist in project '${record.projectId}'.`\n )\n }\n if (session.grantId !== grantId) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority shared session '${sessionId}' does not belong to grant '${grantId}'.`\n )\n }\n}\n\nasync function validateParent(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.source.type !== \"execution\") return\n const parentExecutionId = record.source.executionId\n\n const parent = await lookup.getExecution({\n projectId: record.projectId,\n id: parentExecutionId,\n })\n if (!parent) {\n throw new ExecutionStorageError(\n \"missing_parent_execution\",\n `[Sixb] Parent execution '${parentExecutionId}' does not exist in project '${record.projectId}'.`\n )\n }\n if (parent.correlationId !== record.correlationId) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child execution '${record.id}' must preserve its parent correlation id.`\n )\n }\n if (!principalsEqual(parent.requestedBy, record.requestedBy)) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child execution '${record.id}' must preserve its parent requested-by principal.`\n )\n }\n if (!isDeepStrictEqual(parent.requesterGroupIds, record.requesterGroupIds)) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child execution '${record.id}' must preserve its parent requester-group snapshot.`\n )\n }\n if (\n record.executor.type === \"agent\" &&\n isInheritedAgentAuthority(record.authorizationRef) &&\n !isDeepStrictEqual(parent.authorizationRef, record.authorizationRef)\n ) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child Agent execution '${record.id}' must inherit its parent's authorization reference.`\n )\n }\n}\n\nfunction isInheritedAgentAuthority(ref: AuthorizationRef): boolean {\n return (\n ref.type === \"disabled\" ||\n (ref.type === \"principal\" && ref.principal.type === \"user\" && ref.credential !== undefined)\n )\n}\n\nfunction assertPrincipal(principal: AuthorizablePrincipal, label: string): void {\n if (principal.type !== \"user\" && principal.type !== \"serviceAccount\") {\n invalid(`${label} has unsupported type '${String((principal as { type?: unknown }).type)}'.`)\n }\n assertNonBlank(principal.id, `${label} id`)\n}\n\nfunction assertKernelOperation(operation: KernelOperation, label: string): void {\n if (operation.type !== \"ontology.recover\" && operation.type !== \"ontology.indexVectors\") {\n invalid(`${label} has unsupported type '${String((operation as { type?: unknown }).type)}'.`)\n }\n assertNonBlank(kernelOperationId(operation), `${label} operation id`)\n}\n\nfunction assertTrustedPrimitiveKind(value: string, label: string): void {\n if (!TRUSTED_PRIMITIVE_KINDS.has(value)) {\n invalid(`${label} '${value}' is not supported.`)\n }\n}\n\nfunction assertNonBlank(value: string, label: string): void {\n if (typeof value !== \"string\" || !value.trim()) {\n invalid(`${label} must be a non-empty string.`)\n }\n}\n\nfunction assertValidDate(value: Date, label: string): void {\n if (!(value instanceof Date) || !Number.isFinite(value.getTime())) {\n invalid(`${label} must be a valid date.`)\n }\n}\n\nfunction principalsEqual(\n left: AuthorizablePrincipal | undefined,\n right: AuthorizablePrincipal | undefined\n): boolean {\n return left?.type === right?.type && left?.id === right?.id\n}\n\nfunction kernelOperationsEqual(left: KernelOperation, right: KernelOperation): boolean {\n return left.type === right.type && kernelOperationId(left) === kernelOperationId(right)\n}\n\nfunction invalid(message: string): never {\n throw new ExecutionStorageError(\"invalid_input\", `[Sixb] ${message}`)\n}\n\nconst TRUSTED_PRIMITIVE_KINDS = new Set([\n \"action\",\n \"pipeline\",\n \"projection\",\n \"rule\",\n \"sync\",\n \"webhook\",\n \"workflow\",\n])\n",
7
+ "import { kernelOperationFromId, kernelOperationId } from \"../../execution/kernel-operation\"\nimport type { KernelOperation, TrustedPrimitiveKind } from \"../../execution/types\"\nimport { ExecutionStorageError } from \"./errors\"\nimport type { CreateExecutionInput, ExecutionRecord } from \"./types\"\nimport { normalizeExecutionRecord } from \"./validation\"\n\nexport {\n type ExecutionValidationLookup,\n normalizeExecutionRecord,\n prepareExecutionRecord,\n validateExecutionRecordReferences,\n} from \"./validation\"\n\n/** Oldest first, then by id compared byte by byte: the order `listBySession` returns. */\nexport function compareExecutionCreation(\n left: Pick<ExecutionRecord, \"createdAt\" | \"id\">,\n right: Pick<ExecutionRecord, \"createdAt\" | \"id\">\n): number {\n const byTime = left.createdAt.getTime() - right.createdAt.getTime()\n if (byTime !== 0) {\n return byTime\n }\n return left.id < right.id ? -1 : left.id > right.id ? 1 : 0\n}\n\n/** Provider-neutral flattened representation used by the SQL adapters. */\nexport interface ExecutionStorageRow {\n readonly projectId: string\n readonly id: string\n readonly executorKind: \"agent\" | \"kernel\" | \"request\" | \"script\" | TrustedPrimitiveKind\n readonly executorId: string\n readonly sourceKind:\n | \"ontologyCommit\"\n | \"datasetVersion\"\n | \"event\"\n | \"execution\"\n | \"http\"\n | \"schedule\"\n | \"script\"\n | \"webhook\"\n readonly sourceId: string\n readonly requestedByUserId: string | null\n readonly requestedByServiceAccountId: string | null\n readonly requesterGroupIds: readonly string[]\n readonly correlationId: string\n /** SQL-only projection of an execution source, used to enforce the parent foreign key. */\n readonly parentExecutionId: string | null\n readonly authorityKind:\n | \"delegated\"\n | \"disabled\"\n | \"kernel\"\n | \"principal\"\n | \"script\"\n | \"trustedPrimitive\"\n readonly authorityUserId: string | null\n readonly authorityServiceAccountId: string | null\n readonly authoritySessionId: string | null\n readonly authorityAccessTokenId: string | null\n readonly authorityPrimitiveKind: TrustedPrimitiveKind | null\n readonly authorityPrimitiveId: string | null\n readonly authorityKernelOperation: KernelOperation[\"type\"] | null\n readonly authorityDelegationKind: \"share\" | null\n readonly authorityDelegationId: string | null\n readonly authorityDelegationSessionId: string | null\n readonly createdAt: Date\n}\n\nexport function executionRecordToStorageRow(record: ExecutionRecord): ExecutionStorageRow {\n const executor = flattenExecutor(record)\n const source = flattenSource(record)\n const authority = flattenAuthority(record)\n return {\n projectId: record.projectId,\n id: record.id,\n requesterGroupIds: [...record.requesterGroupIds],\n ...executor,\n ...source,\n requestedByUserId: record.requestedBy?.type === \"user\" ? record.requestedBy.id : null,\n requestedByServiceAccountId:\n record.requestedBy?.type === \"serviceAccount\" ? record.requestedBy.id : null,\n correlationId: record.correlationId,\n parentExecutionId: record.source.type === \"execution\" ? record.source.executionId : null,\n ...authority,\n createdAt: new Date(record.createdAt),\n }\n}\n\nexport function executionRecordFromStorageRow(row: ExecutionStorageRow): ExecutionRecord {\n const executor = inflateExecutor(row)\n const source = inflateSource(row)\n assertStoredParent(row, source)\n const authorizationRef = inflateAuthority(row)\n const requestedBy = row.requestedByUserId\n ? ({ type: \"user\", id: row.requestedByUserId } as const)\n : row.requestedByServiceAccountId\n ? ({ type: \"serviceAccount\", id: row.requestedByServiceAccountId } as const)\n : undefined\n\n return normalizeExecutionRecord(\n {\n id: row.id,\n projectId: row.projectId,\n requesterGroupIds: row.requesterGroupIds,\n ...(requestedBy === undefined ? {} : { requestedBy }),\n executor,\n source,\n correlationId: row.correlationId,\n authorizationRef,\n },\n row.createdAt\n )\n}\n\nfunction assertStoredParent(\n row: ExecutionStorageRow,\n source: CreateExecutionInput[\"source\"]\n): void {\n const expected = source.type === \"execution\" ? source.executionId : null\n if (row.parentExecutionId !== expected) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Stored execution '${row.id}' has inconsistent parent execution provenance.`\n )\n }\n}\n\nfunction flattenExecutor(\n record: ExecutionRecord\n): Pick<ExecutionStorageRow, \"executorId\" | \"executorKind\"> {\n switch (record.executor.type) {\n case \"request\":\n return { executorKind: \"request\", executorId: record.executor.requestId }\n case \"primitive\":\n return { executorKind: record.executor.kind, executorId: record.executor.runId }\n case \"agent\":\n return { executorKind: \"agent\", executorId: record.executor.runId }\n case \"kernel\":\n return { executorKind: \"kernel\", executorId: kernelOperationId(record.executor.operation) }\n case \"script\":\n return { executorKind: \"script\", executorId: record.executor.runId }\n }\n}\n\nfunction flattenSource(\n record: ExecutionRecord\n): Pick<ExecutionStorageRow, \"sourceId\" | \"sourceKind\"> {\n switch (record.source.type) {\n case \"ontologyCommit\":\n return { sourceKind: \"ontologyCommit\", sourceId: record.source.commitId }\n case \"http\":\n return { sourceKind: \"http\", sourceId: record.source.requestId }\n case \"webhook\":\n return { sourceKind: \"webhook\", sourceId: record.source.deliveryId }\n case \"schedule\":\n case \"event\":\n return { sourceKind: record.source.type, sourceId: record.source.eventId }\n case \"datasetVersion\":\n return {\n sourceKind: \"datasetVersion\",\n sourceId: JSON.stringify([record.source.datasetId, record.source.versionId]),\n }\n case \"execution\":\n return { sourceKind: \"execution\", sourceId: record.source.executionId }\n case \"script\":\n return { sourceKind: \"script\", sourceId: record.source.path }\n }\n}\n\nfunction flattenAuthority(\n record: ExecutionRecord\n): Pick<\n ExecutionStorageRow,\n | \"authorityAccessTokenId\"\n | \"authorityKernelOperation\"\n | \"authorityDelegationKind\"\n | \"authorityDelegationId\"\n | \"authorityDelegationSessionId\"\n | \"authorityKind\"\n | \"authorityPrimitiveId\"\n | \"authorityPrimitiveKind\"\n | \"authorityServiceAccountId\"\n | \"authoritySessionId\"\n | \"authorityUserId\"\n> {\n const empty = {\n authorityUserId: null,\n authorityServiceAccountId: null,\n authoritySessionId: null,\n authorityAccessTokenId: null,\n authorityPrimitiveKind: null,\n authorityPrimitiveId: null,\n authorityKernelOperation: null,\n authorityDelegationKind: null,\n authorityDelegationId: null,\n authorityDelegationSessionId: null,\n }\n\n switch (record.authorizationRef.type) {\n case \"principal\":\n return {\n ...empty,\n authorityKind: \"principal\",\n authorityUserId:\n record.authorizationRef.principal.type === \"user\"\n ? record.authorizationRef.principal.id\n : null,\n authorityServiceAccountId:\n record.authorizationRef.principal.type === \"serviceAccount\"\n ? record.authorizationRef.principal.id\n : null,\n authoritySessionId:\n record.authorizationRef.credential?.type === \"session\"\n ? record.authorizationRef.credential.id\n : null,\n authorityAccessTokenId:\n record.authorizationRef.credential?.type === \"accessToken\"\n ? record.authorizationRef.credential.id\n : null,\n }\n case \"trustedPrimitive\":\n return {\n ...empty,\n authorityKind: \"trustedPrimitive\",\n authorityPrimitiveKind: record.authorizationRef.primitive.kind,\n authorityPrimitiveId: record.authorizationRef.primitive.id,\n }\n case \"delegated\":\n return {\n ...empty,\n authorityKind: \"delegated\",\n authorityDelegationKind: record.authorizationRef.delegation.kind,\n authorityDelegationId: record.authorizationRef.delegation.grantId,\n authorityDelegationSessionId: record.authorizationRef.delegation.sessionId,\n }\n case \"kernel\":\n return {\n ...empty,\n authorityKind: \"kernel\",\n authorityKernelOperation: record.authorizationRef.operation.type,\n }\n case \"script\":\n // The run id is the executor's, which the row already holds.\n return { ...empty, authorityKind: \"script\" }\n case \"disabled\":\n return { ...empty, authorityKind: \"disabled\" }\n }\n}\n\nfunction inflateExecutor(row: ExecutionStorageRow): CreateExecutionInput[\"executor\"] {\n switch (row.executorKind) {\n case \"request\":\n return { type: \"request\", requestId: row.executorId }\n case \"agent\":\n return { type: \"agent\", runId: row.executorId }\n case \"kernel\":\n return {\n type: \"kernel\",\n operation: kernelOperationFromId(\n requireValue(row.authorityKernelOperation, \"authority kernel operation\"),\n row.executorId\n ),\n }\n case \"script\":\n return { type: \"script\", runId: row.executorId }\n default:\n return { type: \"primitive\", kind: row.executorKind, runId: row.executorId }\n }\n}\n\nfunction inflateSource(row: ExecutionStorageRow): CreateExecutionInput[\"source\"] {\n switch (row.sourceKind) {\n case \"ontologyCommit\":\n return { type: \"ontologyCommit\", commitId: row.sourceId }\n case \"http\":\n return { type: \"http\", requestId: row.sourceId }\n case \"webhook\":\n return { type: \"webhook\", deliveryId: row.sourceId }\n case \"schedule\":\n case \"event\":\n return { type: row.sourceKind, eventId: row.sourceId }\n case \"datasetVersion\": {\n const [datasetId, versionId] = parseDatasetVersionSourceId(row.sourceId)\n return { type: \"datasetVersion\", datasetId, versionId }\n }\n case \"execution\":\n return { type: \"execution\", executionId: row.sourceId }\n case \"script\":\n return { type: \"script\", path: row.sourceId }\n }\n}\n\nfunction parseDatasetVersionSourceId(sourceId: string): readonly [string, string] {\n try {\n const parsed: unknown = JSON.parse(sourceId)\n if (\n Array.isArray(parsed) &&\n parsed.length === 2 &&\n parsed.every((value) => typeof value === \"string\" && value.trim().length > 0)\n ) {\n return parsed as unknown as readonly [string, string]\n }\n } catch {\n // Fall through to the provider-corruption error below.\n }\n throw new Error(\"[Sixb] Stored dataset-version execution source is malformed.\")\n}\n\nfunction inflateAuthority(row: ExecutionStorageRow): CreateExecutionInput[\"authorizationRef\"] {\n switch (row.authorityKind) {\n case \"principal\": {\n const principal = row.authorityUserId\n ? ({ type: \"user\", id: row.authorityUserId } as const)\n : ({\n type: \"serviceAccount\",\n id: requireValue(row.authorityServiceAccountId, \"authority service account id\"),\n } as const)\n const credential = row.authoritySessionId\n ? ({ type: \"session\", id: row.authoritySessionId } as const)\n : row.authorityAccessTokenId\n ? ({ type: \"accessToken\", id: row.authorityAccessTokenId } as const)\n : undefined\n return {\n type: \"principal\",\n principal,\n ...(credential === undefined ? {} : { credential }),\n }\n }\n case \"trustedPrimitive\":\n return {\n type: \"trustedPrimitive\",\n primitive: {\n kind: requireValue(row.authorityPrimitiveKind, \"authority primitive kind\"),\n id: requireValue(row.authorityPrimitiveId, \"authority primitive id\"),\n runId: row.executorId,\n },\n }\n case \"delegated\":\n return {\n type: \"delegated\",\n delegation: {\n kind: requireValue(row.authorityDelegationKind, \"authority delegation kind\"),\n grantId: requireValue(row.authorityDelegationId, \"authority delegation id\"),\n sessionId: requireValue(\n row.authorityDelegationSessionId,\n \"authority delegation session id\"\n ),\n },\n }\n case \"kernel\":\n return {\n type: \"kernel\",\n operation: kernelOperationFromId(\n requireValue(row.authorityKernelOperation, \"authority kernel operation\"),\n row.executorId\n ),\n }\n case \"script\":\n return { type: \"script\", runId: row.executorId }\n case \"disabled\":\n return { type: \"disabled\" }\n }\n}\n\nfunction requireValue<T>(value: T | null, label: string): T {\n if (value === null) {\n throw new Error(`[Sixb] Stored execution is missing ${label}.`)\n }\n return value\n}\n"
8
+ ],
9
+ "mappings": ";;;;;;;;;;;;AAUO,MAAM,+BAA8B,MAAM;AAAA,EAIpC;AAAA,EAHF,OAAO;AAAA,EAEhB,WAAW,CACA,MACT,SACA,UAAwB,CAAC,GACzB;AAAA,IACA,MAAM,SAAS,OAAO;AAAA,IAJb;AAAA;AAMb;;;ACpBA;AA+BO,eAAe,uBAAsB,CAC1C,OACA,QAC0B;AAAA,EAC1B,IAAI,SAAS,MAAM;AAAA,EACnB,IAAI,WAAW,aAAa,MAAM,OAAO,SAAS,aAAa;AAAA,IAC7D,MAAM,SAAS,MAAM,OAAO,aAAa;AAAA,MACvC,WAAW,MAAM;AAAA,MACjB,IAAI,MAAM,OAAO;AAAA,IACnB,CAAC;AAAA,IACD,SAAS,QAAQ;AAAA,EACnB,EAAE,KAAK,IAAI,WAAW,aAAa,MAAM,aAAa;AAAA,IACpD,SAAS,MAAM,0BAA0B;AAAA,MACvC,MAAM,OAAO;AAAA,MACb,WAAW,MAAM;AAAA,MACjB,WAAW,MAAM;AAAA,IACnB,CAAC;AAAA,EACH;AAAA,EACA,MAAM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AAM,aAAa,IAAI,wBAAwB,0BAA0B;AAAA,UACzE,IAAI,aAAa,IAAI,sBAAsB,wBAAwB;AAAA,UACnE,OAAO,IAAI;AAAA,QACb;AAAA,MACF;AAAA,IACF,KAAK;AAAA,MACH,OAAO;AAAA,QACL,MAAM;AAAA,QACN,YAAY;AAAA,UACV,MAAM,aAAa,IAAI,yBAAyB,2BAA2B;AAAA,UAC3E,SAAS,aAAa,IAAI,uBAAuB,yBAAyB;AAAA,UAC1E,WAAW,aACT,IAAI,8BACJ,iCACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,KAAK;AAAA,MACH,OAAO;AAAA,QACL,MAAM;AAAA,QACN,WAAW,sBACT,aAAa,IAAI,0BAA0B,4BAA4B,GACvE,IAAI,UACN;AAAA,MACF;AAAA,IACF,KAAK;AAAA,MACH,OAAO,EAAE,MAAM,UAAU,OAAO,IAAI,WAAW;AAAA,IACjD,KAAK;AAAA,MACH,OAAO,EAAE,MAAM,WAAW;AAAA;AAAA;AAIhC,SAAS,YAAe,CAAC,OAAiB,OAAkB;AAAA,EAC1D,IAAI,UAAU,MAAM;AAAA,IAClB,MAAM,IAAI,MAAM,sCAAsC,QAAQ;AAAA,EAChE;AAAA,EACA,OAAO;AAAA;",
10
+ "debugId": "01707C5F6D7E3F9564756E2164756E21",
11
+ "names": []
12
+ }
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  principalsEqual2
4
- } from "./chunk-0k3r5kb3.js";
4
+ } from "./chunk-394zjzjs.js";
5
5
  import {
6
6
  createFileUploadId2,
7
7
  isFileUploadSessionExpired,
@@ -0,0 +1,114 @@
1
+ // @bun
2
+ // src/runtime/locale.ts
3
+ var DEFAULT_PROJECT_LOCALE = "en";
4
+ var DEFAULT_PROJECT_TIME_ZONE = "UTC";
5
+ function canonicalLocale(value) {
6
+ if (typeof value !== "string")
7
+ return;
8
+ try {
9
+ const [locale] = Intl.getCanonicalLocales(value);
10
+ return locale;
11
+ } catch {
12
+ return;
13
+ }
14
+ }
15
+
16
+ // src/calendar.ts
17
+ var MAX_PERIODS = 1e4;
18
+ var hourMs = 60 * 60 * 1000;
19
+ var dayMs = 24 * hourMs;
20
+ function canonicalTimeZone2(value) {
21
+ if (typeof value !== "string" || value.trim() !== value || value === "")
22
+ return;
23
+ let timeZone;
24
+ try {
25
+ timeZone = new Intl.DateTimeFormat("en-US", { timeZone: value }).resolvedOptions().timeZone;
26
+ } catch {
27
+ return;
28
+ }
29
+ return /^[+-]/.test(timeZone) ? undefined : timeZone;
30
+ }
31
+ var formatters = new Map;
32
+ function formatterFor(timeZone) {
33
+ let formatter = formatters.get(timeZone);
34
+ if (!formatter) {
35
+ formatter = new Intl.DateTimeFormat("en-US", {
36
+ timeZone,
37
+ year: "numeric",
38
+ month: "numeric",
39
+ day: "numeric",
40
+ hour: "numeric",
41
+ minute: "numeric",
42
+ second: "numeric",
43
+ hourCycle: "h23"
44
+ });
45
+ formatters.set(timeZone, formatter);
46
+ }
47
+ return formatter;
48
+ }
49
+ function wallClockOf(at, timeZone) {
50
+ const parts = formatterFor(timeZone).formatToParts(at);
51
+ const field = (type) => {
52
+ const part = parts.find((candidate) => candidate.type === type);
53
+ if (!part)
54
+ throw new TypeError(`[Sixb] ${timeZone} did not read back a ${type}.`);
55
+ return Number(part.value);
56
+ };
57
+ return Date.UTC(field("year"), field("month") - 1, field("day"), field("hour"), field("minute"), field("second"));
58
+ }
59
+ function offsetOf(at, timeZone) {
60
+ return wallClockOf(at, timeZone) - Math.floor(at.getTime() / 1000) * 1000;
61
+ }
62
+ function instantOf(wallClock, timeZone) {
63
+ const before = offsetOf(new Date(wallClock - dayMs), timeZone);
64
+ const after = offsetOf(new Date(wallClock + dayMs), timeZone);
65
+ if (before === after)
66
+ return new Date(wallClock - before);
67
+ const candidates = [wallClock - before, wallClock - after].sort((left, right) => left - right);
68
+ const found = candidates.find((instant) => wallClockOf(new Date(instant), timeZone) >= wallClock);
69
+ return new Date(found ?? candidates[candidates.length - 1]);
70
+ }
71
+ function wallClockAt2(at, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
72
+ return new Date(wallClockOf(at, timeZone)).toISOString();
73
+ }
74
+ function wallClockInstant2(wallClock, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
75
+ const wall = Date.parse(wallClock);
76
+ if (Number.isNaN(wall)) {
77
+ throw new TypeError(`[Sixb] ${JSON.stringify(wallClock)} is not a wall clock time.`);
78
+ }
79
+ return instantOf(wall, timeZone);
80
+ }
81
+ function periodWallClock(wallClock, period) {
82
+ if (period === "hour")
83
+ return wallClock - wallClock % hourMs;
84
+ const midnight = wallClock - wallClock % dayMs;
85
+ if (period === "day")
86
+ return midnight;
87
+ const mondayOffset = (new Date(midnight).getUTCDay() + 6) % 7;
88
+ return midnight - mondayOffset * dayMs;
89
+ }
90
+ function calendarPeriodStart2(at, period, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
91
+ return instantOf(periodWallClock(wallClockOf(at, timeZone), period), timeZone);
92
+ }
93
+ function addCalendarPeriods2(at, period, count, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
94
+ const step = period === "hour" ? hourMs : period === "week" ? 7 * dayMs : dayMs;
95
+ const start = periodWallClock(wallClockOf(at, timeZone), period);
96
+ return instantOf(start + count * step, timeZone);
97
+ }
98
+ function calendarPeriods2(from, to, period, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
99
+ const periods = [];
100
+ let start = calendarPeriodStart2(from, period, timeZone);
101
+ while (start.getTime() < to.getTime()) {
102
+ if (periods.length >= MAX_PERIODS) {
103
+ throw new RangeError(`[Sixb] The range holds more than ${MAX_PERIODS} ${period} periods.`);
104
+ }
105
+ const end = addCalendarPeriods2(start, period, 1, timeZone);
106
+ periods.push({ start, end });
107
+ start = end;
108
+ }
109
+ return periods;
110
+ }
111
+
112
+ export { DEFAULT_PROJECT_LOCALE, DEFAULT_PROJECT_TIME_ZONE, canonicalLocale, canonicalTimeZone2, wallClockAt2, wallClockInstant2, calendarPeriodStart2, addCalendarPeriods2, calendarPeriods2 };
113
+
114
+ //# debugId=B253CA3F513E540B64756E2164756E21
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/runtime/locale.ts", "../src/calendar.ts"],
4
+ "sourcesContent": [
5
+ "/** Language assumed when a project sets none. */\nexport const DEFAULT_PROJECT_LOCALE = \"en\"\n\n/** Time zone assumed when a project sets none; cron schedules have always used it. */\nexport const DEFAULT_PROJECT_TIME_ZONE = \"UTC\"\n\n/** The canonical form of a BCP 47 language tag (`fr-fr` → `fr-FR`), or `undefined` if invalid. */\nexport function canonicalLocale(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined\n try {\n const [locale] = Intl.getCanonicalLocales(value)\n return locale\n } catch {\n return undefined\n }\n}\n",
6
+ "/**\n * Calendar arithmetic in an IANA time zone.\n *\n * A period of a zone's calendar is not a fixed number of milliseconds: where a zone changes its\n * clocks a day lasts 23 or 25 hours, and a zone such as Asia/Kolkata starts its hours half past a\n * UTC hour. Usage buckets are whole periods of the reader's calendar, so the queried range, the\n * bars and the calls in them all go through these functions.\n *\n * It is `@sixb/core/calendar` rather than `internal/*` because `@sixb/app` draws the bars with it,\n * and the app installs core by a compatible range, which `internal/*` refuses. It is not part of\n * the documented API: export only what the app calls.\n */\n\nimport { DEFAULT_PROJECT_TIME_ZONE } from \"./runtime/locale\"\n\n/** An hour, a day, or a week starting Monday: the periods a usage chart is drawn in. */\nexport type CalendarPeriod = \"hour\" | \"day\" | \"week\"\n\n/** A period of the calendar: a start and the start of the one after it. */\nexport interface CalendarPeriodRange {\n readonly start: Date\n readonly end: Date\n}\n\n/** A period wider than this many is a caller's mistake, not a chart. */\nconst MAX_PERIODS = 10_000\n\nconst hourMs = 60 * 60 * 1000\nconst dayMs = 24 * hourMs\n\n/**\n * The canonical IANA name of a time zone (`europe/paris` → `Europe/Paris`), or `undefined`.\n *\n * A UTC offset such as `+05:30` is refused even where `Intl` takes it: it names no zone, and\n * PostgreSQL reads it the POSIX way, five and a half hours west of UTC.\n */\nexport function canonicalTimeZone(value: unknown): string | undefined {\n if (typeof value !== \"string\" || value.trim() !== value || value === \"\") return undefined\n let timeZone: string\n try {\n timeZone = new Intl.DateTimeFormat(\"en-US\", { timeZone: value }).resolvedOptions().timeZone\n } catch {\n return undefined\n }\n return /^[+-]/.test(timeZone) ? undefined : timeZone\n}\n\n// Buckets are formatted for every call and every period of a range, so one formatter per zone is\n// built once: constructing one costs more than reading several of them.\nconst formatters = new Map<string, Intl.DateTimeFormat>()\n\nfunction formatterFor(timeZone: string): Intl.DateTimeFormat {\n let formatter = formatters.get(timeZone)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(\"en-US\", {\n timeZone,\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n hourCycle: \"h23\",\n })\n formatters.set(timeZone, formatter)\n }\n return formatter\n}\n\n/** The zone's wall clock at an instant, as the milliseconds `Date.UTC` gives for its fields. */\nfunction wallClockOf(at: Date, timeZone: string): number {\n const parts = formatterFor(timeZone).formatToParts(at)\n const field = (type: Intl.DateTimeFormatPartTypes) => {\n const part = parts.find((candidate) => candidate.type === type)\n if (!part) throw new TypeError(`[Sixb] ${timeZone} did not read back a ${type}.`)\n return Number(part.value)\n }\n return Date.UTC(\n field(\"year\"),\n field(\"month\") - 1,\n field(\"day\"),\n field(\"hour\"),\n field(\"minute\"),\n field(\"second\")\n )\n}\n\n/** How far the zone's wall clock runs ahead of UTC at an instant. */\nfunction offsetOf(at: Date, timeZone: string): number {\n return wallClockOf(at, timeZone) - Math.floor(at.getTime() / 1000) * 1000\n}\n\n/**\n * The instant a zone's wall clock reads `wallClock`.\n *\n * A wall clock the zone skips is met at the jump that skipped it, and one it reads twice starts the\n * period at its first reading, so periods stay in order and whole.\n */\nfunction instantOf(wallClock: number, timeZone: string): Date {\n const before = offsetOf(new Date(wallClock - dayMs), timeZone)\n const after = offsetOf(new Date(wallClock + dayMs), timeZone)\n if (before === after) return new Date(wallClock - before)\n const candidates = [wallClock - before, wallClock - after].sort((left, right) => left - right)\n const found = candidates.find((instant) => wallClockOf(new Date(instant), timeZone) >= wallClock)\n return new Date(found ?? candidates[candidates.length - 1]!)\n}\n\n/**\n * The zone's wall clock at an instant, spelled as `wallClockInstant` reads it back:\n * `2026-11-14T05:00:00.000Z` in America/New_York is `2026-11-14T00:00:00.000Z`.\n */\nexport function wallClockAt(at: Date, timeZone = DEFAULT_PROJECT_TIME_ZONE): string {\n return new Date(wallClockOf(at, timeZone)).toISOString()\n}\n\n/**\n * The instant a zone's wall clock names.\n *\n * `wallClock` is an ISO 8601 string whose `Z` marks the wall clock rather than UTC, as a provider\n * reads it out of a query without a time zone: `2026-11-14T00:00:00Z` is midnight in the zone.\n */\nexport function wallClockInstant(wallClock: string, timeZone = DEFAULT_PROJECT_TIME_ZONE): Date {\n const wall = Date.parse(wallClock)\n if (Number.isNaN(wall)) {\n throw new TypeError(`[Sixb] ${JSON.stringify(wallClock)} is not a wall clock time.`)\n }\n return instantOf(wall, timeZone)\n}\n\n/**\n * The wall clock a period of the calendar is named by: its hour, its midnight, or its Monday's.\n *\n * It is the name even where the zone skips it, so a period that began at the jump still steps to\n * the next midnight rather than to the next 1 am.\n */\nfunction periodWallClock(wallClock: number, period: CalendarPeriod): number {\n if (period === \"hour\") return wallClock - (wallClock % hourMs)\n const midnight = wallClock - (wallClock % dayMs)\n if (period === \"day\") return midnight\n\n // Weeks begin on Monday, which is what a date truncated to its week gives everywhere else.\n const mondayOffset = (new Date(midnight).getUTCDay() + 6) % 7\n return midnight - mondayOffset * dayMs\n}\n\n/** The start of the period an instant falls in, on the zone's calendar. */\nexport function calendarPeriodStart(\n at: Date,\n period: CalendarPeriod,\n timeZone = DEFAULT_PROJECT_TIME_ZONE\n): Date {\n return instantOf(periodWallClock(wallClockOf(at, timeZone), period), timeZone)\n}\n\n/**\n * The start of the period `count` periods away from the one `at` falls in.\n *\n * Stepping the zone's wall clock keeps every period whole across a change of clocks, where adding\n * milliseconds would land an hour off a boundary.\n */\nexport function addCalendarPeriods(\n at: Date,\n period: CalendarPeriod,\n count: number,\n timeZone = DEFAULT_PROJECT_TIME_ZONE\n): Date {\n const step = period === \"hour\" ? hourMs : period === \"week\" ? 7 * dayMs : dayMs\n const start = periodWallClock(wallClockOf(at, timeZone), period)\n return instantOf(start + count * step, timeZone)\n}\n\n/**\n * Every period of [from, to), starting with the one `from` falls in.\n *\n * A wall clock the zone skips begins its period where the clocks jump, which keeps the periods\n * contiguous through the hour the zone never had.\n */\nexport function calendarPeriods(\n from: Date,\n to: Date,\n period: CalendarPeriod,\n timeZone = DEFAULT_PROJECT_TIME_ZONE\n): readonly CalendarPeriodRange[] {\n const periods: CalendarPeriodRange[] = []\n let start = calendarPeriodStart(from, period, timeZone)\n while (start.getTime() < to.getTime()) {\n if (periods.length >= MAX_PERIODS) {\n throw new RangeError(`[Sixb] The range holds more than ${MAX_PERIODS} ${period} periods.`)\n }\n const end = addCalendarPeriods(start, period, 1, timeZone)\n periods.push({ start, end })\n start = end\n }\n return periods\n}\n"
7
+ ],
8
+ "mappings": ";;AACO,IAAM,yBAAyB;AAG/B,IAAM,4BAA4B;AAGlC,SAAS,eAAe,CAAC,OAAoC;AAAA,EAClE,IAAI,OAAO,UAAU;AAAA,IAAU;AAAA,EAC/B,IAAI;AAAA,IACF,OAAO,UAAU,KAAK,oBAAoB,KAAK;AAAA,IAC/C,OAAO;AAAA,IACP,MAAM;AAAA,IACN;AAAA;AAAA;;;ACYJ,IAAM,cAAc;AAEpB,IAAM,SAAS,KAAK,KAAK;AACzB,IAAM,QAAQ,KAAK;AAQZ,SAAS,kBAAiB,CAAC,OAAoC;AAAA,EACpE,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM,SAAS,UAAU;AAAA,IAAI;AAAA,EACzE,IAAI;AAAA,EACJ,IAAI;AAAA,IACF,WAAW,IAAI,KAAK,eAAe,SAAS,EAAE,UAA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AA,EACN,MAAM,OAAO,WAAW,SAAS,SAAS,WAAW,SAAS,IAAI,QAAQ;AAAA,EAC1E,MAAM,QAAQ,gBAAgB,YAAY,IAAI,QAAQ,GAAG,MAAM;AAAA,EAC/D,OAAO,UAAU,QAAQ,QAAQ,MAAM,QAAQ;AAAA;AAS1C,SAAS,gBAAe,CAC7B,MACA,IACA,QACA,WAAW,2BACqB;AAAA,EAChC,MAAM,UAAiC,CAAC;AAAA,EACxC,IAAI,QAAQ,qBAAoB,MAAM,QAAQ,QAAQ;AAAA,EACtD,OAAO,MAAM,QAAQ,IAAI,GAAG,QAAQ,GAAG;AAAA,IACrC,IAAI,QAAQ,UAAU,aAAa;AAAA,MACjC,MAAM,IAAI,WAAW,oCAAoC,eAAe,iBAAiB;AAAA,IAC3F;AAAA,IACA,MAAM,MAAM,oBAAmB,OAAO,QAAQ,GAAG,QAAQ;AAAA,IACzD,QAAQ,KAAK,EAAE,OAAO,IAAI,CAAC;AAAA,IAC3B,QAAQ;AAAA,EACV;AAAA,EACA,OAAO;AAAA;",
9
+ "debugId": "B253CA3F513E540B64756E2164756E21",
10
+ "names": []
11
+ }
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  eventSelectorSpec2,
4
4
  buildEventSelectorPredicate2
5
- } from "./chunk-b9qfh2ya.js";
5
+ } from "./chunk-fzbhybya.js";
6
6
  import {
7
7
  isDecimalValue2,
8
8
  compareDecimalValues2
@@ -508,8 +508,11 @@ function assertEventSource(source) {
508
508
  return;
509
509
  case "users":
510
510
  return;
511
+ case "connectors":
512
+ assertNonEmpty(source.connectorId ?? "", "event source connectorId");
513
+ return;
511
514
  default:
512
- throw new ScheduleValidationError2("Schedule event source must select object, link, rule, dataset, sync, pipeline, or member events.");
515
+ throw new ScheduleValidationError2("Schedule event source must select object, link, rule, dataset, sync, pipeline, member, or connection events.");
513
516
  }
514
517
  }
515
518
  function defineSchedule2(id) {
@@ -813,6 +816,9 @@ function buildEventScheduleContext2(event) {
813
816
  case "user.invited":
814
817
  case "user.profile.updated":
815
818
  return { ...event.payload };
819
+ case "connector.connection.connected":
820
+ case "connector.connection.disconnected":
821
+ return { ...event.payload };
816
822
  default:
817
823
  return null;
818
824
  }
@@ -893,6 +899,10 @@ var userEventTypes = new Set([
893
899
  "user.invited",
894
900
  "user.profile.updated"
895
901
  ]);
902
+ var connectorEventTypes = new Set([
903
+ "connector.connection.connected",
904
+ "connector.connection.disconnected"
905
+ ]);
896
906
  var runStatuses = new Set(["succeeded", "failed", "cancelled"]);
897
907
  var linkIdentityFields = new Set(["target.objectTypeId", "target.primaryId"]);
898
908
  function isRecord2(value) {
@@ -989,8 +999,11 @@ function assertEventSourceShape(value, path, createError) {
989
999
  return;
990
1000
  case "users":
991
1001
  return;
1002
+ case "connectors":
1003
+ assertNonEmptyString2(value.connectorId, `${path} connectorId`, createError);
1004
+ return;
992
1005
  default:
993
- throw createError(`${path} must select object, link, rule, dataset, sync, pipeline, or member events.`);
1006
+ throw createError(`${path} must select object, link, rule, dataset, sync, pipeline, member, or connection events.`);
994
1007
  }
995
1008
  }
996
1009
  function assertRunStatus(value, path, createError) {
@@ -1039,6 +1052,9 @@ function validateEventSchedule(schedule, ontology, options) {
1039
1052
  case "users":
1040
1053
  validateMemberSource(schedule);
1041
1054
  return;
1055
+ case "connectors":
1056
+ validateRegisteredSource(schedule, source.connectorId, options.registeredOAuthConnectorIds, connectorEventTypes, "OAuth connector");
1057
+ return;
1042
1058
  }
1043
1059
  }
1044
1060
  function validateObjectSource(schedule, objectType) {
@@ -1138,4 +1154,4 @@ function validateConditionPredicate(schedule, propertyIds, predicate, link) {
1138
1154
  }
1139
1155
  export { assertPredicateShape, createPropertyPredicateBuilder, createLinkPredicateBuilder, allPredicates, anyPredicates, notPredicate, ScheduleValidationError2, CronValidationError2, createCronFieldMatcher2, createCronMatcher2, defineSchedule2, nextCronOccurrence2, eventScheduleSubscribedEventTypes2, evaluateEventSchedule2, buildEventScheduleContext2, isScheduleReference2, assertScheduleDefinition2, isScheduleDefinition2, validateSchedulesAtStartup2 };
1140
1156
 
1141
- //# debugId=C051D76BC17640E164756E2164756E21
1157
+ //# debugId=3A7ADE46E66C011364756E2164756E21