@sixb/core 0.1.26 → 0.2.0

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 (555) hide show
  1. package/dist/actions/index.js +47 -47
  2. package/dist/actions/request.d.ts.map +1 -1
  3. package/dist/actions/run/context.d.ts +1 -0
  4. package/dist/actions/run/context.d.ts.map +1 -1
  5. package/dist/actions/run/execute.d.ts +3 -0
  6. package/dist/actions/run/execute.d.ts.map +1 -1
  7. package/dist/actions/run/executor.d.ts +3 -0
  8. package/dist/actions/run/executor.d.ts.map +1 -1
  9. package/dist/actions/run/types.d.ts +5 -0
  10. package/dist/actions/run/types.d.ts.map +1 -1
  11. package/dist/actions/types/context.d.ts +11 -0
  12. package/dist/actions/types/context.d.ts.map +1 -1
  13. package/dist/agents/adapters.d.ts +30 -4
  14. package/dist/agents/adapters.d.ts.map +1 -1
  15. package/dist/agents/approvals.d.ts +8 -0
  16. package/dist/agents/approvals.d.ts.map +1 -1
  17. package/dist/agents/context-budget.d.ts +48 -0
  18. package/dist/agents/context-budget.d.ts.map +1 -0
  19. package/dist/agents/context-compaction.d.ts +89 -9
  20. package/dist/agents/context-compaction.d.ts.map +1 -1
  21. package/dist/agents/context-files.d.ts +12 -0
  22. package/dist/agents/context-files.d.ts.map +1 -0
  23. package/dist/agents/context-parts.d.ts +41 -0
  24. package/dist/agents/context-parts.d.ts.map +1 -0
  25. package/dist/agents/context-request.d.ts +47 -0
  26. package/dist/agents/context-request.d.ts.map +1 -0
  27. package/dist/agents/context-token-rate.d.ts +98 -0
  28. package/dist/agents/context-token-rate.d.ts.map +1 -0
  29. package/dist/agents/context-use.d.ts +51 -0
  30. package/dist/agents/context-use.d.ts.map +1 -0
  31. package/dist/agents/dispatch.d.ts.map +1 -1
  32. package/dist/agents/execution.d.ts +13 -1
  33. package/dist/agents/execution.d.ts.map +1 -1
  34. package/dist/agents/index.d.ts +21 -7
  35. package/dist/agents/index.d.ts.map +1 -1
  36. package/dist/agents/index.js +109 -55
  37. package/dist/agents/index.js.map +1 -1
  38. package/dist/agents/inline-images.d.ts +17 -0
  39. package/dist/agents/inline-images.d.ts.map +1 -0
  40. package/dist/agents/message.d.ts +55 -0
  41. package/dist/agents/message.d.ts.map +1 -1
  42. package/dist/agents/model-loop.d.ts +23 -3
  43. package/dist/agents/model-loop.d.ts.map +1 -1
  44. package/dist/agents/request.d.ts +6 -1
  45. package/dist/agents/request.d.ts.map +1 -1
  46. package/dist/agents/run-events.d.ts +3 -2
  47. package/dist/agents/run-events.d.ts.map +1 -1
  48. package/dist/agents/run-plan.d.ts +12 -2
  49. package/dist/agents/run-plan.d.ts.map +1 -1
  50. package/dist/agents/run-session-http.d.ts +6 -3
  51. package/dist/agents/run-session-http.d.ts.map +1 -1
  52. package/dist/agents/run-session-serve.d.ts +18 -2
  53. package/dist/agents/run-session-serve.d.ts.map +1 -1
  54. package/dist/agents/run-session.d.ts +3 -1
  55. package/dist/agents/run-session.d.ts.map +1 -1
  56. package/dist/agents/run-tools.d.ts +7 -0
  57. package/dist/agents/run-tools.d.ts.map +1 -1
  58. package/dist/agents/run-turn.d.ts +39 -4
  59. package/dist/agents/run-turn.d.ts.map +1 -1
  60. package/dist/agents/skills.d.ts +9 -2
  61. package/dist/agents/skills.d.ts.map +1 -1
  62. package/dist/agents/step-limits.d.ts +18 -0
  63. package/dist/agents/step-limits.d.ts.map +1 -0
  64. package/dist/agents/streams/index.d.ts +1 -1
  65. package/dist/agents/streams/index.d.ts.map +1 -1
  66. package/dist/agents/streams/index.js +2 -2
  67. package/dist/agents/streams/internal.d.ts +1 -1
  68. package/dist/agents/streams/internal.d.ts.map +1 -1
  69. package/dist/agents/streams/internal.js +7 -3
  70. package/dist/agents/streams/internal.js.map +1 -1
  71. package/dist/agents/streams/protocol.d.ts +36 -1
  72. package/dist/agents/streams/protocol.d.ts.map +1 -1
  73. package/dist/agents/thread-context-projection.d.ts +10 -0
  74. package/dist/agents/thread-context-projection.d.ts.map +1 -1
  75. package/dist/agents/tool-files.d.ts +22 -0
  76. package/dist/agents/tool-files.d.ts.map +1 -1
  77. package/dist/artifacts/publish/index.js +26 -26
  78. package/dist/auth/index.js +12 -12
  79. package/dist/auth/index.js.map +1 -1
  80. package/dist/auth/runtime.d.ts +2 -0
  81. package/dist/auth/runtime.d.ts.map +1 -1
  82. package/dist/auth/types.d.ts +5 -0
  83. package/dist/auth/types.d.ts.map +1 -1
  84. package/dist/authorization/decision.d.ts +2 -0
  85. package/dist/authorization/decision.d.ts.map +1 -1
  86. package/dist/authorization/grant-kinds.d.ts +2 -2
  87. package/dist/authorization/grant-kinds.d.ts.map +1 -1
  88. package/dist/authorization/index.d.ts +1 -1
  89. package/dist/authorization/index.d.ts.map +1 -1
  90. package/dist/authorization/index.js +7 -5
  91. package/dist/authorization/index.js.map +1 -1
  92. package/dist/authorization/run-visibility.d.ts +17 -0
  93. package/dist/authorization/run-visibility.d.ts.map +1 -1
  94. package/dist/bootstrap/index.js +53 -53
  95. package/dist/{chunk-t3brw0wd.js → chunk-0g5nyx0k.js} +181 -30
  96. package/dist/chunk-0g5nyx0k.js.map +14 -0
  97. package/dist/{chunk-fakrpfy3.js → chunk-0k1h5hmr.js} +2 -1
  98. package/dist/{chunk-fakrpfy3.js.map → chunk-0k1h5hmr.js.map} +3 -3
  99. package/dist/{chunk-c0vk1djt.js → chunk-165c9wm6.js} +1 -1
  100. package/dist/{chunk-8mb7mt8n.js → chunk-21q0j5f2.js} +2 -2
  101. package/dist/{chunk-hn76sanm.js → chunk-23s66j86.js} +1 -1
  102. package/dist/{chunk-h1na2cxc.js → chunk-2g0r46hy.js} +2 -2
  103. package/dist/{chunk-8v6xzwgr.js → chunk-3x3bebz7.js} +95 -19
  104. package/dist/{chunk-8v6xzwgr.js.map → chunk-3x3bebz7.js.map} +10 -9
  105. package/dist/{chunk-tdxfsg1c.js → chunk-47e09r7z.js} +2 -2
  106. package/dist/{chunk-73j0v4qv.js → chunk-4zm1k3xj.js} +14 -2
  107. package/dist/{chunk-73j0v4qv.js.map → chunk-4zm1k3xj.js.map} +3 -3
  108. package/dist/{chunk-npcr0228.js → chunk-5kyvrtjh.js} +1 -1
  109. package/dist/{chunk-zhh1jd89.js → chunk-5taem5aw.js} +1 -1
  110. package/dist/{chunk-tnhqtfea.js → chunk-6b61s40c.js} +1 -1
  111. package/dist/{chunk-4ymrcdbm.js → chunk-7hd2ez3q.js} +1 -1
  112. package/dist/{chunk-315qye3g.js → chunk-80nh73br.js} +1 -1
  113. package/dist/{chunk-phm3c7b9.js → chunk-855n80en.js} +1 -1
  114. package/dist/{chunk-qst145py.js → chunk-8dcfj58k.js} +24 -14
  115. package/dist/chunk-8dcfj58k.js.map +18 -0
  116. package/dist/{chunk-7wn5z7mq.js → chunk-8hvfs0fr.js} +5 -5
  117. package/dist/{chunk-2vjnyz1s.js → chunk-9rh8ncs5.js} +2 -2
  118. package/dist/{chunk-pgrf64hp.js → chunk-agn8d8ys.js} +1 -1
  119. package/dist/{chunk-mqx25wwh.js → chunk-c78jjzhy.js} +12 -10
  120. package/dist/{chunk-mqx25wwh.js.map → chunk-c78jjzhy.js.map} +3 -3
  121. package/dist/{chunk-7ex2p3zp.js → chunk-cgznz22f.js} +2 -2
  122. package/dist/{chunk-06sg8s4z.js → chunk-d3t26vah.js} +2 -2
  123. package/dist/{chunk-vhbw5sqm.js → chunk-d7v97qxq.js} +7 -1
  124. package/dist/chunk-d7v97qxq.js.map +10 -0
  125. package/dist/chunk-de5sfbc3.js +3 -0
  126. package/dist/{chunk-ratkv4zc.js.map → chunk-de5sfbc3.js.map} +1 -1
  127. package/dist/{chunk-qgvbxfqv.js → chunk-djs3hw9p.js} +1 -1
  128. package/dist/{chunk-ye5c8016.js → chunk-dz7a4t3a.js} +26 -5
  129. package/dist/{chunk-ye5c8016.js.map → chunk-dz7a4t3a.js.map} +4 -4
  130. package/dist/{chunk-dgtd0836.js → chunk-e7v3trpz.js} +1 -1
  131. package/dist/{chunk-8v5a54qz.js → chunk-e99kp9jh.js} +161 -38
  132. package/dist/{chunk-8v5a54qz.js.map → chunk-e99kp9jh.js.map} +10 -10
  133. package/dist/{chunk-z9mg7wya.js → chunk-edx8xcsm.js} +111 -11
  134. package/dist/chunk-edx8xcsm.js.map +13 -0
  135. package/dist/{chunk-0bc3w0zq.js → chunk-ekkpzcka.js} +5 -5
  136. package/dist/{chunk-zbc929zg.js → chunk-escedwyt.js} +9 -1
  137. package/dist/{chunk-zbc929zg.js.map → chunk-escedwyt.js.map} +3 -3
  138. package/dist/{chunk-4jq2bg8t.js → chunk-f2w6328x.js} +6 -6
  139. package/dist/{chunk-b6ghvap7.js → chunk-fb3m4sa1.js} +7 -7
  140. package/dist/{chunk-yavhtnac.js → chunk-fdkpkkpw.js} +89 -43
  141. package/dist/{chunk-yavhtnac.js.map → chunk-fdkpkkpw.js.map} +3 -3
  142. package/dist/{chunk-jt3r6thp.js → chunk-fg1db9xx.js} +46 -6
  143. package/dist/chunk-fg1db9xx.js.map +10 -0
  144. package/dist/{chunk-73v685wb.js → chunk-frsz8wxd.js} +4 -4
  145. package/dist/{chunk-73v685wb.js.map → chunk-frsz8wxd.js.map} +3 -3
  146. package/dist/{chunk-jn3ysaf2.js → chunk-he7g39e5.js} +11 -11
  147. package/dist/{chunk-jn3ysaf2.js.map → chunk-he7g39e5.js.map} +1 -1
  148. package/dist/{chunk-yd00vzqr.js → chunk-hjy3dsws.js} +1009 -354
  149. package/dist/chunk-hjy3dsws.js.map +45 -0
  150. package/dist/{chunk-59kf345w.js → chunk-jbw70d6t.js} +2 -2
  151. package/dist/{chunk-cbcgs9f7.js → chunk-jftd33rc.js} +21 -21
  152. package/dist/chunk-jftd33rc.js.map +11 -0
  153. package/dist/{chunk-78ymxrn0.js → chunk-jhbk10wf.js} +1 -1
  154. package/dist/{chunk-18sk89cg.js → chunk-jk97v21j.js} +7 -2
  155. package/dist/chunk-jk97v21j.js.map +10 -0
  156. package/dist/chunk-kcqpk9w1.js.map +2 -2
  157. package/dist/{chunk-ft3w5ahs.js → chunk-m3qe54bb.js} +1 -1
  158. package/dist/{chunk-8xnz9vvp.js → chunk-n54k068r.js} +22 -18
  159. package/dist/chunk-n54k068r.js.map +12 -0
  160. package/dist/{chunk-y7j6x4h0.js → chunk-neftrg0n.js} +3 -3
  161. package/dist/{chunk-07kkp2e1.js → chunk-nghc7eq0.js} +2 -2
  162. package/dist/{chunk-1xvqgg88.js → chunk-nz7815t3.js} +18 -2
  163. package/dist/chunk-nz7815t3.js.map +14 -0
  164. package/dist/{chunk-fe8zwt8b.js → chunk-peggaard.js} +2 -2
  165. package/dist/{chunk-e24fvw8g.js → chunk-qbrmpgvv.js} +1 -1
  166. package/dist/{chunk-dp0cdtj2.js → chunk-qsg8rw04.js} +2 -2
  167. package/dist/{chunk-mdxmt0n3.js → chunk-qya541bk.js} +1071 -121
  168. package/dist/chunk-qya541bk.js.map +129 -0
  169. package/dist/{chunk-0kk2wt0h.js → chunk-r1cxq7vv.js} +2 -2
  170. package/dist/{chunk-kyjcwqz6.js → chunk-rtkqczbr.js} +3 -1
  171. package/dist/{chunk-kyjcwqz6.js.map → chunk-rtkqczbr.js.map} +3 -3
  172. package/dist/{chunk-2adz0h75.js → chunk-s7xqfxs9.js} +35 -3
  173. package/dist/chunk-s7xqfxs9.js.map +11 -0
  174. package/dist/{chunk-g663fahq.js → chunk-scyq22td.js} +1 -1
  175. package/dist/{chunk-xm8qgbqm.js → chunk-semf1yqn.js} +54 -44
  176. package/dist/{chunk-xm8qgbqm.js.map → chunk-semf1yqn.js.map} +5 -5
  177. package/dist/{chunk-pdt5cw8z.js → chunk-tvefbgvw.js} +5 -2
  178. package/dist/{chunk-pdt5cw8z.js.map → chunk-tvefbgvw.js.map} +3 -3
  179. package/dist/{chunk-vx4e4zv4.js → chunk-vkweppkw.js} +3 -3
  180. package/dist/{chunk-45ngkxkp.js → chunk-w122ymx4.js} +2 -2
  181. package/dist/{chunk-48jezz3j.js → chunk-w976a4me.js} +1 -1
  182. package/dist/{chunk-qtzftvxa.js → chunk-wx7smkn2.js} +1 -1
  183. package/dist/{chunk-6qn7nmd3.js → chunk-xj97s5js.js} +9 -9
  184. package/dist/{chunk-c14ap3s9.js → chunk-y2x2935j.js} +3 -3
  185. package/dist/{chunk-7hf6tkgs.js → chunk-ytzcxtpt.js} +5 -5
  186. package/dist/{chunk-7hf6tkgs.js.map → chunk-ytzcxtpt.js.map} +1 -1
  187. package/dist/{chunk-axb4ss9a.js → chunk-ztf5vtmp.js} +5 -5
  188. package/dist/datasets/execution.d.ts +26 -1
  189. package/dist/datasets/execution.d.ts.map +1 -1
  190. package/dist/datasets/index.d.ts +1 -1
  191. package/dist/datasets/index.d.ts.map +1 -1
  192. package/dist/datasets/lineage.d.ts +55 -0
  193. package/dist/datasets/lineage.d.ts.map +1 -0
  194. package/dist/datasets/write.js +5 -5
  195. package/dist/deploy/types.d.ts +8 -1
  196. package/dist/deploy/types.d.ts.map +1 -1
  197. package/dist/env/index.d.ts +36 -0
  198. package/dist/env/index.d.ts.map +1 -0
  199. package/dist/env/index.js +17 -0
  200. package/dist/env/index.js.map +10 -0
  201. package/dist/error-reporting/internal.js +3 -3
  202. package/dist/errors/catalog.d.ts +8 -0
  203. package/dist/errors/catalog.d.ts.map +1 -1
  204. package/dist/errors/internal.js +1 -1
  205. package/dist/events/index.js +3 -3
  206. package/dist/execution/agent.js +47 -47
  207. package/dist/execution/index.d.ts +1 -0
  208. package/dist/execution/index.d.ts.map +1 -1
  209. package/dist/execution/primitive.js +47 -47
  210. package/dist/execution/request-client.d.ts +21 -0
  211. package/dist/execution/request-client.d.ts.map +1 -0
  212. package/dist/execution/request.d.ts.map +1 -1
  213. package/dist/execution/request.js +49 -47
  214. package/dist/execution/request.js.map +3 -3
  215. package/dist/http/api-routes.d.ts.map +1 -1
  216. package/dist/http/index.js +1 -1
  217. package/dist/index.d.ts +7 -5
  218. package/dist/index.d.ts.map +1 -1
  219. package/dist/index.js +65 -65
  220. package/dist/index.js.map +1 -1
  221. package/dist/lake-storage/index.js +5 -5
  222. package/dist/lineage/commits.d.ts +45 -0
  223. package/dist/lineage/commits.d.ts.map +1 -0
  224. package/dist/lineage/executors.d.ts +14 -0
  225. package/dist/lineage/executors.d.ts.map +1 -0
  226. package/dist/lineage/link.d.ts +10 -0
  227. package/dist/lineage/link.d.ts.map +1 -0
  228. package/dist/lineage/object.d.ts +10 -0
  229. package/dist/lineage/object.d.ts.map +1 -0
  230. package/dist/lineage/projections.d.ts +34 -0
  231. package/dist/lineage/projections.d.ts.map +1 -0
  232. package/dist/lineage/reader.d.ts +34 -0
  233. package/dist/lineage/reader.d.ts.map +1 -0
  234. package/dist/lineage/sources.d.ts +62 -0
  235. package/dist/lineage/sources.d.ts.map +1 -0
  236. package/dist/lineage/types.d.ts +140 -0
  237. package/dist/lineage/types.d.ts.map +1 -0
  238. package/dist/materializer/effective/resolve.d.ts +63 -6
  239. package/dist/materializer/effective/resolve.d.ts.map +1 -1
  240. package/dist/materializer/index.js +27 -27
  241. package/dist/models/errors.d.ts +8 -0
  242. package/dist/models/errors.d.ts.map +1 -1
  243. package/dist/models/events.d.ts +10 -0
  244. package/dist/models/events.d.ts.map +1 -1
  245. package/dist/models/execution/index.d.ts +1 -0
  246. package/dist/models/execution/index.d.ts.map +1 -1
  247. package/dist/models/execution/index.js +34 -31
  248. package/dist/models/execution/index.js.map +1 -1
  249. package/dist/models/execution/model-call-recorder.d.ts +2 -0
  250. package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
  251. package/dist/models/index.d.ts +2 -1
  252. package/dist/models/index.d.ts.map +1 -1
  253. package/dist/models/index.js +3 -3
  254. package/dist/models/language-model.d.ts +29 -2
  255. package/dist/models/language-model.d.ts.map +1 -1
  256. package/dist/objects/execution.d.ts +4 -1
  257. package/dist/objects/execution.d.ts.map +1 -1
  258. package/dist/objects/index.js +47 -47
  259. package/dist/objects/query/executor.d.ts.map +1 -1
  260. package/dist/objects/query/index.d.ts +1 -0
  261. package/dist/objects/query/index.d.ts.map +1 -1
  262. package/dist/objects/query/index.js +30 -28
  263. package/dist/objects/query/index.js.map +1 -1
  264. package/dist/objects/query/ir.d.ts +16 -0
  265. package/dist/objects/query/ir.d.ts.map +1 -1
  266. package/dist/objects/query/link-endpoints.d.ts +11 -0
  267. package/dist/objects/query/link-endpoints.d.ts.map +1 -0
  268. package/dist/objects/query/normalize.d.ts.map +1 -1
  269. package/dist/objects/query/planner.d.ts +5 -0
  270. package/dist/objects/query/planner.d.ts.map +1 -1
  271. package/dist/objects/query/validate.d.ts +2 -0
  272. package/dist/objects/query/validate.d.ts.map +1 -1
  273. package/dist/objects/sdk/object-set.d.ts +2 -0
  274. package/dist/objects/sdk/object-set.d.ts.map +1 -1
  275. package/dist/ontology/index.js +5 -5
  276. package/dist/ontology/internal.js +3 -3
  277. package/dist/pipelines/index.js +31 -31
  278. package/dist/projections/internal.js +27 -27
  279. package/dist/query.js +2 -2
  280. package/dist/queues/in-memory.d.ts +1 -1
  281. package/dist/queues/in-memory.d.ts.map +1 -1
  282. package/dist/runtime/create.d.ts +3 -0
  283. package/dist/runtime/create.d.ts.map +1 -1
  284. package/dist/runtime/internal.js +33 -33
  285. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  286. package/dist/runtime/types.d.ts +16 -0
  287. package/dist/runtime/types.d.ts.map +1 -1
  288. package/dist/sandboxes/exec.d.ts.map +1 -1
  289. package/dist/sandboxes/index.js +5 -5
  290. package/dist/security/grants.d.ts +1 -1
  291. package/dist/security/grants.d.ts.map +1 -1
  292. package/dist/security/internal.js +1 -1
  293. package/dist/security/project.d.ts.map +1 -1
  294. package/dist/security/public.js +2 -2
  295. package/dist/security/types.d.ts +10 -3
  296. package/dist/security/types.d.ts.map +1 -1
  297. package/dist/security/validation.d.ts.map +1 -1
  298. package/dist/shares/execution.d.ts +9 -0
  299. package/dist/shares/execution.d.ts.map +1 -1
  300. package/dist/shares/index.d.ts +1 -1
  301. package/dist/shares/index.d.ts.map +1 -1
  302. package/dist/shares/internal.js +24 -24
  303. package/dist/storage/action-runs/failure.js +2 -2
  304. package/dist/storage/agents/in-memory.d.ts +38 -1
  305. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  306. package/dist/storage/agents/index.d.ts +1 -1
  307. package/dist/storage/agents/index.d.ts.map +1 -1
  308. package/dist/storage/agents/provider.d.ts +43 -5
  309. package/dist/storage/agents/provider.d.ts.map +1 -1
  310. package/dist/storage/agents/provider.js +30 -6
  311. package/dist/storage/agents/provider.js.map +1 -1
  312. package/dist/storage/agents/types.d.ts +132 -10
  313. package/dist/storage/agents/types.d.ts.map +1 -1
  314. package/dist/storage/ai-cost/analytics.d.ts +13 -5
  315. package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
  316. package/dist/storage/ai-cost/groups.d.ts +19 -2
  317. package/dist/storage/ai-cost/groups.d.ts.map +1 -1
  318. package/dist/storage/ai-cost/in-memory.d.ts +6 -1
  319. package/dist/storage/ai-cost/in-memory.d.ts.map +1 -1
  320. package/dist/storage/ai-cost/index.d.ts +1 -1
  321. package/dist/storage/ai-cost/index.d.ts.map +1 -1
  322. package/dist/storage/ai-cost/provider.d.ts +1 -1
  323. package/dist/storage/ai-cost/provider.d.ts.map +1 -1
  324. package/dist/storage/ai-cost/provider.js +7 -5
  325. package/dist/storage/ai-cost/provider.js.map +1 -1
  326. package/dist/storage/ai-cost/types.d.ts +65 -9
  327. package/dist/storage/ai-cost/types.d.ts.map +1 -1
  328. package/dist/storage/ai-limits/enforcement.js +4 -4
  329. package/dist/storage/ai-limits/provider.js +2 -2
  330. package/dist/storage/connector-connections/provider.js +1 -1
  331. package/dist/storage/file-upload-sessions/provider.js +10 -10
  332. package/dist/storage/in-memory/index.d.ts.map +1 -1
  333. package/dist/storage/index.d.ts +3 -3
  334. package/dist/storage/index.d.ts.map +1 -1
  335. package/dist/storage/index.js +31 -31
  336. package/dist/storage/index.js.map +1 -1
  337. package/dist/storage/internal.js +6 -6
  338. package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
  339. package/dist/storage/objects/query-preparation.d.ts +5 -0
  340. package/dist/storage/objects/query-preparation.d.ts.map +1 -1
  341. package/dist/storage/ontology/commits.d.ts +6 -1
  342. package/dist/storage/ontology/commits.d.ts.map +1 -1
  343. package/dist/storage/ontology/in-memory/commits.d.ts.map +1 -1
  344. package/dist/storage/ontology/in-memory/materializations.d.ts +2 -1
  345. package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
  346. package/dist/storage/ontology/index.d.ts +1 -1
  347. package/dist/storage/ontology/index.d.ts.map +1 -1
  348. package/dist/storage/ontology/materializations.d.ts +16 -0
  349. package/dist/storage/ontology/materializations.d.ts.map +1 -1
  350. package/dist/storage/ontology/provider.d.ts +6 -1
  351. package/dist/storage/ontology/provider.d.ts.map +1 -1
  352. package/dist/storage/ontology/provider.js +4 -2
  353. package/dist/storage/ontology/provider.js.map +1 -1
  354. package/dist/storage/operation-scope.d.ts +10 -0
  355. package/dist/storage/operation-scope.d.ts.map +1 -1
  356. package/dist/storage/operation-scope.js +7 -3
  357. package/dist/storage/operation-scope.js.map +1 -1
  358. package/dist/storage/projection-runs/provider.js +2 -2
  359. package/dist/storage/workflow-runs/provider.js +10 -10
  360. package/dist/syncs/index.js +32 -32
  361. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  362. package/dist/testing/agent-token-rate-storage-contract.d.ts +14 -0
  363. package/dist/testing/agent-token-rate-storage-contract.d.ts.map +1 -0
  364. package/dist/testing/ai-model-call-groups-contract.d.ts +1 -1
  365. package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
  366. package/dist/testing/index.d.ts +1 -0
  367. package/dist/testing/index.d.ts.map +1 -1
  368. package/dist/testing/index.js +4365 -3518
  369. package/dist/testing/index.js.map +10 -9
  370. package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
  371. package/dist/testing/object-query-contract.d.ts.map +1 -1
  372. package/dist/testing/ontology-contract-fixture.d.ts +3 -3
  373. package/dist/testing/ontology-contract-fixture.d.ts.map +1 -1
  374. package/dist/testing/ontology-storage-contract.d.ts.map +1 -1
  375. package/dist/webhooks/internal.js +25 -25
  376. package/dist/workers/index.js +1 -1
  377. package/dist/workflows/builders.d.ts.map +1 -1
  378. package/dist/workflows/index.js +52 -52
  379. package/dist/workflows/types.d.ts +6 -0
  380. package/dist/workflows/types.d.ts.map +1 -1
  381. package/dist/workflows/validation.d.ts.map +1 -1
  382. package/package.json +7 -1
  383. package/src/actions/request.ts +6 -0
  384. package/src/actions/run/context.ts +6 -0
  385. package/src/actions/run/execute.ts +8 -2
  386. package/src/actions/run/executor.ts +4 -0
  387. package/src/actions/run/types.ts +5 -0
  388. package/src/actions/types/context.ts +11 -0
  389. package/src/agents/README.md +11 -3
  390. package/src/agents/adapters.ts +73 -23
  391. package/src/agents/approvals.ts +22 -0
  392. package/src/agents/context-budget.ts +121 -0
  393. package/src/agents/context-compaction.ts +317 -150
  394. package/src/agents/context-files.ts +48 -0
  395. package/src/agents/context-parts.ts +219 -0
  396. package/src/agents/context-request.ts +100 -0
  397. package/src/agents/context-token-rate.ts +224 -0
  398. package/src/agents/context-use.ts +187 -0
  399. package/src/agents/dispatch.ts +2 -0
  400. package/src/agents/execution.ts +105 -0
  401. package/src/agents/index.ts +46 -2
  402. package/src/agents/inline-images.ts +17 -0
  403. package/src/agents/message.ts +70 -1
  404. package/src/agents/model-loop.ts +192 -61
  405. package/src/agents/request.ts +18 -1
  406. package/src/agents/run-events.ts +3 -2
  407. package/src/agents/run-plan.ts +22 -3
  408. package/src/agents/run-session-http.ts +8 -5
  409. package/src/agents/run-session-serve.ts +133 -9
  410. package/src/agents/run-session.ts +30 -4
  411. package/src/agents/run-tools.ts +10 -2
  412. package/src/agents/run-turn.ts +116 -26
  413. package/src/agents/skills.ts +9 -2
  414. package/src/agents/step-limits.ts +27 -0
  415. package/src/agents/streams/index.ts +2 -0
  416. package/src/agents/streams/internal.ts +2 -0
  417. package/src/agents/streams/protocol.ts +125 -2
  418. package/src/agents/thread-context-projection.ts +25 -17
  419. package/src/agents/tool-files.ts +41 -3
  420. package/src/auth/runtime.ts +30 -1
  421. package/src/auth/types.ts +5 -0
  422. package/src/authorization/decision.ts +5 -0
  423. package/src/authorization/grant-kinds.ts +8 -0
  424. package/src/authorization/index.ts +2 -0
  425. package/src/authorization/run-visibility.ts +37 -0
  426. package/src/datasets/execution.ts +89 -2
  427. package/src/datasets/index.ts +1 -0
  428. package/src/datasets/lineage.ts +194 -0
  429. package/src/deploy/types.ts +8 -1
  430. package/src/env/index.ts +46 -0
  431. package/src/errors/catalog.ts +12 -0
  432. package/src/execution/index.ts +1 -0
  433. package/src/execution/request-client.ts +44 -0
  434. package/src/execution/request.ts +2 -0
  435. package/src/http/api-routes.ts +24 -25
  436. package/src/index.ts +32 -0
  437. package/src/lineage/README.md +107 -0
  438. package/src/lineage/commits.ts +173 -0
  439. package/src/lineage/executors.ts +103 -0
  440. package/src/lineage/link.ts +138 -0
  441. package/src/lineage/object.ts +218 -0
  442. package/src/lineage/projections.ts +174 -0
  443. package/src/lineage/reader.ts +89 -0
  444. package/src/lineage/sources.ts +156 -0
  445. package/src/lineage/types.ts +149 -0
  446. package/src/materializer/effective/resolve.ts +198 -50
  447. package/src/models/errors.ts +10 -0
  448. package/src/models/events.ts +13 -1
  449. package/src/models/execution/index.ts +1 -0
  450. package/src/models/execution/model-call-recorder.ts +7 -1
  451. package/src/models/index.ts +3 -0
  452. package/src/models/language-model.ts +34 -2
  453. package/src/objects/execution.ts +6 -1
  454. package/src/objects/query/executor.ts +28 -13
  455. package/src/objects/query/index.ts +1 -0
  456. package/src/objects/query/ir.ts +16 -0
  457. package/src/objects/query/link-endpoints.ts +29 -0
  458. package/src/objects/query/normalize.ts +3 -0
  459. package/src/objects/query/planner.ts +5 -0
  460. package/src/objects/query/validate.ts +73 -3
  461. package/src/objects/sdk/object-set.ts +33 -1
  462. package/src/runtime/create.ts +6 -0
  463. package/src/runtime/resolve-definitions.ts +7 -0
  464. package/src/runtime/sixb.ts +4 -1
  465. package/src/runtime/types.ts +18 -0
  466. package/src/sandboxes/exec.ts +19 -0
  467. package/src/security/grants.ts +3 -0
  468. package/src/security/project.ts +1 -0
  469. package/src/security/types.ts +8 -3
  470. package/src/security/validation.ts +5 -4
  471. package/src/shares/execution.ts +35 -3
  472. package/src/shares/index.ts +1 -0
  473. package/src/storage/agents/in-memory.ts +179 -8
  474. package/src/storage/agents/index.ts +8 -0
  475. package/src/storage/agents/provider.ts +219 -6
  476. package/src/storage/agents/types.ts +145 -9
  477. package/src/storage/ai-cost/analytics.ts +177 -10
  478. package/src/storage/ai-cost/groups.ts +122 -35
  479. package/src/storage/ai-cost/in-memory.ts +10 -4
  480. package/src/storage/ai-cost/index.ts +5 -0
  481. package/src/storage/ai-cost/provider.ts +5 -1
  482. package/src/storage/ai-cost/types.ts +65 -9
  483. package/src/storage/in-memory/index.ts +10 -0
  484. package/src/storage/index.ts +15 -0
  485. package/src/storage/objects/in-memory/query.ts +5 -1
  486. package/src/storage/objects/query-preparation.ts +10 -0
  487. package/src/storage/ontology/commits.ts +6 -1
  488. package/src/storage/ontology/in-memory/commits.ts +7 -0
  489. package/src/storage/ontology/in-memory/materializations.ts +24 -0
  490. package/src/storage/ontology/index.ts +2 -0
  491. package/src/storage/ontology/materializations.ts +21 -0
  492. package/src/storage/ontology/provider.ts +41 -1
  493. package/src/storage/operation-scope.ts +41 -0
  494. package/src/testing/agent-storage-contract.ts +426 -20
  495. package/src/testing/agent-token-rate-storage-contract.ts +171 -0
  496. package/src/testing/ai-model-call-groups-contract.ts +225 -7
  497. package/src/testing/index.ts +5 -0
  498. package/src/testing/materializer-storage-contract.ts +294 -10
  499. package/src/testing/object-query-contract.ts +48 -0
  500. package/src/testing/ontology-contract-fixture.ts +18 -7
  501. package/src/testing/ontology-storage-contract.ts +42 -0
  502. package/src/workflows/builders.ts +8 -1
  503. package/src/workflows/types.ts +6 -0
  504. package/src/workflows/validation.ts +1 -0
  505. package/dist/chunk-18sk89cg.js.map +0 -10
  506. package/dist/chunk-1xvqgg88.js.map +0 -14
  507. package/dist/chunk-2adz0h75.js.map +0 -11
  508. package/dist/chunk-8xnz9vvp.js.map +0 -12
  509. package/dist/chunk-cbcgs9f7.js.map +0 -11
  510. package/dist/chunk-jt3r6thp.js.map +0 -10
  511. package/dist/chunk-mdxmt0n3.js.map +0 -120
  512. package/dist/chunk-qst145py.js.map +0 -18
  513. package/dist/chunk-ratkv4zc.js +0 -3
  514. package/dist/chunk-t3brw0wd.js.map +0 -14
  515. package/dist/chunk-vhbw5sqm.js.map +0 -10
  516. package/dist/chunk-yd00vzqr.js.map +0 -37
  517. package/dist/chunk-z9mg7wya.js.map +0 -13
  518. /package/dist/{chunk-c0vk1djt.js.map → chunk-165c9wm6.js.map} +0 -0
  519. /package/dist/{chunk-8mb7mt8n.js.map → chunk-21q0j5f2.js.map} +0 -0
  520. /package/dist/{chunk-hn76sanm.js.map → chunk-23s66j86.js.map} +0 -0
  521. /package/dist/{chunk-h1na2cxc.js.map → chunk-2g0r46hy.js.map} +0 -0
  522. /package/dist/{chunk-tdxfsg1c.js.map → chunk-47e09r7z.js.map} +0 -0
  523. /package/dist/{chunk-npcr0228.js.map → chunk-5kyvrtjh.js.map} +0 -0
  524. /package/dist/{chunk-zhh1jd89.js.map → chunk-5taem5aw.js.map} +0 -0
  525. /package/dist/{chunk-tnhqtfea.js.map → chunk-6b61s40c.js.map} +0 -0
  526. /package/dist/{chunk-4ymrcdbm.js.map → chunk-7hd2ez3q.js.map} +0 -0
  527. /package/dist/{chunk-315qye3g.js.map → chunk-80nh73br.js.map} +0 -0
  528. /package/dist/{chunk-phm3c7b9.js.map → chunk-855n80en.js.map} +0 -0
  529. /package/dist/{chunk-7wn5z7mq.js.map → chunk-8hvfs0fr.js.map} +0 -0
  530. /package/dist/{chunk-2vjnyz1s.js.map → chunk-9rh8ncs5.js.map} +0 -0
  531. /package/dist/{chunk-pgrf64hp.js.map → chunk-agn8d8ys.js.map} +0 -0
  532. /package/dist/{chunk-7ex2p3zp.js.map → chunk-cgznz22f.js.map} +0 -0
  533. /package/dist/{chunk-06sg8s4z.js.map → chunk-d3t26vah.js.map} +0 -0
  534. /package/dist/{chunk-qgvbxfqv.js.map → chunk-djs3hw9p.js.map} +0 -0
  535. /package/dist/{chunk-dgtd0836.js.map → chunk-e7v3trpz.js.map} +0 -0
  536. /package/dist/{chunk-0bc3w0zq.js.map → chunk-ekkpzcka.js.map} +0 -0
  537. /package/dist/{chunk-4jq2bg8t.js.map → chunk-f2w6328x.js.map} +0 -0
  538. /package/dist/{chunk-b6ghvap7.js.map → chunk-fb3m4sa1.js.map} +0 -0
  539. /package/dist/{chunk-59kf345w.js.map → chunk-jbw70d6t.js.map} +0 -0
  540. /package/dist/{chunk-78ymxrn0.js.map → chunk-jhbk10wf.js.map} +0 -0
  541. /package/dist/{chunk-ft3w5ahs.js.map → chunk-m3qe54bb.js.map} +0 -0
  542. /package/dist/{chunk-y7j6x4h0.js.map → chunk-neftrg0n.js.map} +0 -0
  543. /package/dist/{chunk-07kkp2e1.js.map → chunk-nghc7eq0.js.map} +0 -0
  544. /package/dist/{chunk-fe8zwt8b.js.map → chunk-peggaard.js.map} +0 -0
  545. /package/dist/{chunk-e24fvw8g.js.map → chunk-qbrmpgvv.js.map} +0 -0
  546. /package/dist/{chunk-dp0cdtj2.js.map → chunk-qsg8rw04.js.map} +0 -0
  547. /package/dist/{chunk-0kk2wt0h.js.map → chunk-r1cxq7vv.js.map} +0 -0
  548. /package/dist/{chunk-g663fahq.js.map → chunk-scyq22td.js.map} +0 -0
  549. /package/dist/{chunk-vx4e4zv4.js.map → chunk-vkweppkw.js.map} +0 -0
  550. /package/dist/{chunk-45ngkxkp.js.map → chunk-w122ymx4.js.map} +0 -0
  551. /package/dist/{chunk-48jezz3j.js.map → chunk-w976a4me.js.map} +0 -0
  552. /package/dist/{chunk-qtzftvxa.js.map → chunk-wx7smkn2.js.map} +0 -0
  553. /package/dist/{chunk-6qn7nmd3.js.map → chunk-xj97s5js.js.map} +0 -0
  554. /package/dist/{chunk-c14ap3s9.js.map → chunk-y2x2935j.js.map} +0 -0
  555. /package/dist/{chunk-axb4ss9a.js.map → chunk-ztf5vtmp.js.map} +0 -0
@@ -30,11 +30,11 @@ import {
30
30
  normalizeLinkProperties2,
31
31
  validateLinkProperties2,
32
32
  assertTelemetryProperty2
33
- } from "./chunk-qgvbxfqv.js";
33
+ } from "./chunk-djs3hw9p.js";
34
34
  import {
35
35
  isObjectRefSchema2,
36
36
  validateSchemaOrRefValue2
37
- } from "./chunk-dgtd0836.js";
37
+ } from "./chunk-e7v3trpz.js";
38
38
  import {
39
39
  ActionValidationError2,
40
40
  SIXB_ERROR_CODES2,
@@ -43,7 +43,7 @@ import {
43
43
  isSixbError2,
44
44
  toSixbFailure2,
45
45
  summarizeErrorMessage2
46
- } from "./chunk-zbc929zg.js";
46
+ } from "./chunk-escedwyt.js";
47
47
  import {
48
48
  agentServiceAccountId2,
49
49
  ObjectReadLimitExceededError2,
@@ -65,19 +65,17 @@ import {
65
65
  assertModelAccess2,
66
66
  canAccessModels2,
67
67
  canViewEvent2,
68
+ projectionTargetOf2,
68
69
  canViewWorkflowRun2,
69
70
  canViewWorkflowIntervention2,
70
71
  canViewPipelineRun2,
71
72
  canViewProjectionRun2,
73
+ canViewPrimitiveRun2,
72
74
  canViewProjection2
73
- } from "./chunk-ye5c8016.js";
75
+ } from "./chunk-dz7a4t3a.js";
74
76
  import {
75
77
  compileSelectedObjectReadScope2
76
78
  } from "./chunk-31khg3g0.js";
77
- import {
78
- ACTION_RUN_FAILURE_CODES2,
79
- parseActionRunFailure2
80
- } from "./chunk-c0vk1djt.js";
81
79
  import {
82
80
  ActionDefinitionError2,
83
81
  missingActionMutationMessage,
@@ -89,6 +87,7 @@ import {
89
87
  coerceActionParamsToTyped,
90
88
  validateActionSubject,
91
89
  resolveObjectActionSubject,
90
+ getRequestClientAddress2,
92
91
  INDEXING_EMBEDDING_TIMEOUT_MS,
93
92
  vectorConfiguration,
94
93
  vectorSources,
@@ -97,11 +96,15 @@ import {
97
96
  createUsersRuntime,
98
97
  SYSTEM_PRINCIPAL2,
99
98
  principalsEqual2
100
- } from "./chunk-8v6xzwgr.js";
99
+ } from "./chunk-3x3bebz7.js";
100
+ import {
101
+ ACTION_RUN_FAILURE_CODES2,
102
+ parseActionRunFailure2
103
+ } from "./chunk-165c9wm6.js";
101
104
  import {
102
105
  isModelReasoning2,
103
106
  modelReasoningSupportIssue2
104
- } from "./chunk-pdt5cw8z.js";
107
+ } from "./chunk-tvefbgvw.js";
105
108
  import {
106
109
  TranscriptionModelResponseError2,
107
110
  SpeechModelResponseError2,
@@ -122,7 +125,7 @@ import {
122
125
  question2,
123
126
  ImageModelResponseError2,
124
127
  estimateModelCall
125
- } from "./chunk-tdxfsg1c.js";
128
+ } from "./chunk-47e09r7z.js";
126
129
  import {
127
130
  AgentStorageError2,
128
131
  createAgentThreadId2,
@@ -130,14 +133,15 @@ import {
130
133
  createAgentRunId2,
131
134
  createAgentMessageId2,
132
135
  AGENT_REASONING_LEVELS2,
136
+ movesComputerPlace2,
133
137
  isAgentApprovalMode2,
134
138
  agentApprovalHoldsRun2
135
- } from "./chunk-z9mg7wya.js";
139
+ } from "./chunk-edx8xcsm.js";
136
140
  import {
137
141
  actionRunRequestsEqual,
138
142
  ObjectNotFoundError2,
139
143
  ArtifactStorageError
140
- } from "./chunk-fe8zwt8b.js";
144
+ } from "./chunk-peggaard.js";
141
145
  import {
142
146
  ExecutionStorageError2
143
147
  } from "./chunk-eptrvnby.js";
@@ -151,17 +155,17 @@ import {
151
155
  objectBatchKey2,
152
156
  matchesPredicate,
153
157
  WORKFLOW_RUN_FAILURE_CODES2
154
- } from "./chunk-8v5a54qz.js";
158
+ } from "./chunk-e99kp9jh.js";
155
159
  import {
156
160
  WorkflowRunError2,
157
161
  missingClearanceRedactions,
158
162
  resolveAgentExecutionAuthorization2,
159
163
  userCanRunAgent2,
160
164
  resolveInheritedAgentExecutionAuthorization2
161
- } from "./chunk-y7j6x4h0.js";
165
+ } from "./chunk-neftrg0n.js";
162
166
  import {
163
167
  explainObjectQuery2
164
- } from "./chunk-qst145py.js";
168
+ } from "./chunk-8dcfj58k.js";
165
169
  import {
166
170
  redactDomainEvent,
167
171
  uniqueLookupKeyOf,
@@ -170,12 +174,12 @@ import {
170
174
  readerClearance,
171
175
  readerEventClearance,
172
176
  readerViewConditions
173
- } from "./chunk-b6ghvap7.js";
177
+ } from "./chunk-fb3m4sa1.js";
174
178
  import {
175
179
  shareSixbErrorReporter2,
176
180
  reportActionPhaseFailure2,
177
181
  reportRunFailure2
178
- } from "./chunk-48jezz3j.js";
182
+ } from "./chunk-w976a4me.js";
179
183
  import {
180
184
  getOntologyMutationRuntime2,
181
185
  shareOntologyMutationRuntime2,
@@ -192,13 +196,14 @@ import {
192
196
  createActivityCaptureRuntime,
193
197
  registerActivityCaptureRuntime,
194
198
  ModelExecutionSession
195
- } from "./chunk-4jq2bg8t.js";
199
+ } from "./chunk-f2w6328x.js";
196
200
  import {
201
+ publishAgentThreadMoved2,
197
202
  publishAgentApprovalActivity,
198
203
  publishAgentRunActivity2,
199
204
  publishAgentRunCancel2,
200
205
  publishAgentRunFinished2
201
- } from "./chunk-jt3r6thp.js";
206
+ } from "./chunk-fg1db9xx.js";
202
207
  import {
203
208
  createArtifactId
204
209
  } from "./chunk-3fqxbn31.js";
@@ -208,13 +213,13 @@ import {
208
213
  agentThreadViews,
209
214
  createRuntimeArtifactAccessRule,
210
215
  createArtifactsRuntime
211
- } from "./chunk-7wn5z7mq.js";
216
+ } from "./chunk-8hvfs0fr.js";
212
217
  import {
213
218
  aiLimitSubjectsFromAttribution2,
214
219
  applicableAiLimitPolicyStatuses2,
215
220
  aiUsageLimitExceededError2,
216
221
  aiUsageLimitUnavailableError2
217
- } from "./chunk-dp0cdtj2.js";
222
+ } from "./chunk-qsg8rw04.js";
218
223
  import {
219
224
  normalizeAgentContextEntries2
220
225
  } from "./chunk-sgx82nnt.js";
@@ -227,20 +232,26 @@ import {
227
232
  } from "./chunk-5a4a52tq.js";
228
233
  import {
229
234
  createConnectorRuntime
230
- } from "./chunk-2vjnyz1s.js";
235
+ } from "./chunk-9rh8ncs5.js";
231
236
  import {
232
237
  writeDataset2
233
- } from "./chunk-59kf345w.js";
238
+ } from "./chunk-jbw70d6t.js";
234
239
  import {
235
240
  AI_MODEL_CALL_OUTPUT_TOKEN_ALLOWANCE,
236
241
  aiModelCallOutputTokenAllowance,
237
242
  ModelUsageRecordingError2,
238
243
  LanguageModelCallMeter
239
- } from "./chunk-mqx25wwh.js";
244
+ } from "./chunk-c78jjzhy.js";
240
245
  import {
241
246
  createLinkScopeFingerprint2,
242
- normalizeJsonProperties2
243
- } from "./chunk-yavhtnac.js";
247
+ normalizeJsonProperties2,
248
+ usableLinkSlotOverride,
249
+ explainEffectiveObject,
250
+ storedObjectEditedAt,
251
+ resolveEffectiveLink,
252
+ resolveEffectiveLinkSlotMember,
253
+ linkCardinality
254
+ } from "./chunk-fdkpkkpw.js";
244
255
  import {
245
256
  resolveLoggingService2
246
257
  } from "./chunk-1vg43g9q.js";
@@ -251,61 +262,69 @@ import {
251
262
  import {
252
263
  SyncValidationError2,
253
264
  requestSyncRun2
254
- } from "./chunk-axb4ss9a.js";
265
+ } from "./chunk-ztf5vtmp.js";
255
266
  import {
256
267
  SandboxError2,
257
268
  sandboxCredentialIssue2,
258
269
  staticSandboxRecipe2
259
- } from "./chunk-0kk2wt0h.js";
270
+ } from "./chunk-r1cxq7vv.js";
260
271
  import {
261
272
  compileShareAccessPlan
262
- } from "./chunk-7ex2p3zp.js";
273
+ } from "./chunk-cgznz22f.js";
263
274
  import {
264
275
  schemaRecordToJsonSchema2
265
276
  } from "./chunk-e5wf5vz0.js";
266
277
  import {
267
278
  requestPipelineRun2
268
- } from "./chunk-0bc3w0zq.js";
279
+ } from "./chunk-ekkpzcka.js";
269
280
  import {
270
281
  PipelineError2
271
282
  } from "./chunk-hke9aeen.js";
272
283
  import {
273
284
  createObjectQueryBuilder2,
274
285
  decorateObjectQueryExecutor
275
- } from "./chunk-315qye3g.js";
286
+ } from "./chunk-80nh73br.js";
287
+ import {
288
+ lineageColumn,
289
+ isUnknownLineage,
290
+ versionLineage
291
+ } from "./chunk-ff5xkv0p.js";
276
292
  import {
277
293
  executionRecordInputFromRuntime,
278
294
  ensureExecutionRecord2,
279
295
  createPrimitiveExecutionRecord,
280
296
  restoreTrustedPrimitiveExecutionScope
281
- } from "./chunk-e24fvw8g.js";
297
+ } from "./chunk-qbrmpgvv.js";
282
298
  import {
283
299
  resolveLanguageModel2
284
- } from "./chunk-07kkp2e1.js";
300
+ } from "./chunk-nghc7eq0.js";
285
301
  import {
286
302
  getDatasetPrimaryKeyColumns2
287
- } from "./chunk-tnhqtfea.js";
303
+ } from "./chunk-6b61s40c.js";
288
304
  import {
289
305
  ShareGrantStorageError2,
290
306
  objectReadScopeForAccessPlan
291
307
  } from "./chunk-2pk5hjj9.js";
308
+ import {
309
+ ActionRunError2
310
+ } from "./chunk-3gbefjg5.js";
292
311
  import {
293
312
  AI_USAGE_FIELDS,
294
313
  normalizeAiModelCallUsage2,
295
314
  aggregateAiModelCallUsage2
296
- } from "./chunk-pgrf64hp.js";
297
- import {
298
- ActionRunError2
299
- } from "./chunk-3gbefjg5.js";
315
+ } from "./chunk-agn8d8ys.js";
300
316
  import {
301
317
  RuntimeError2
302
318
  } from "./chunk-m4ehq95f.js";
319
+ import {
320
+ eventAttribution2
321
+ } from "./chunk-mzx71snp.js";
303
322
  import {
304
323
  normalizeParams
305
- } from "./chunk-8mb7mt8n.js";
324
+ } from "./chunk-21q0j5f2.js";
306
325
  import {
307
326
  ObjectQueryPlanningError2
308
- } from "./chunk-fakrpfy3.js";
327
+ } from "./chunk-0k1h5hmr.js";
309
328
  import {
310
329
  MaterializationValidationError2,
311
330
  MaterializationObjectNotFoundError2,
@@ -322,14 +341,14 @@ import {
322
341
  UnsupportedModelFeatureError2,
323
342
  StructuredOutputError2,
324
343
  sameEmbeddingModel
325
- } from "./chunk-kyjcwqz6.js";
344
+ } from "./chunk-rtkqczbr.js";
326
345
  import {
327
346
  AgentRequestError2,
328
347
  AgentMemoryError2
329
348
  } from "./chunk-9wr3yajk.js";
330
349
  import {
331
350
  AGENT_APPROVAL_MODES2
332
- } from "./chunk-18sk89cg.js";
351
+ } from "./chunk-jk97v21j.js";
333
352
  import {
334
353
  resolveFileRefAtPath2,
335
354
  openFileRef2,
@@ -633,6 +652,23 @@ class ActionRegistry2 {
633
652
  return null;
634
653
  }
635
654
  }
655
+ // src/execution/request-client.ts
656
+ var MAX_USER_AGENT_LENGTH = 512;
657
+ var requestClients = new WeakMap;
658
+ function bindRequestClient(execution, request) {
659
+ if (execution.executor.type !== "request") {
660
+ throw new Error("[Sixb] Only a request execution has a request client.");
661
+ }
662
+ const userAgent = request.headers.get("user-agent")?.trim();
663
+ requestClients.set(execution, Object.freeze({
664
+ address: getRequestClientAddress2(request),
665
+ userAgent: userAgent ? userAgent.slice(0, MAX_USER_AGENT_LENGTH) : undefined
666
+ }));
667
+ }
668
+ function getRequestClient(execution) {
669
+ return requestClients.get(execution);
670
+ }
671
+
636
672
  // src/shared/params/user-refs.ts
637
673
  async function assertParamUsersActive(input) {
638
674
  const references = [];
@@ -1222,6 +1258,21 @@ async function turnPausesOnHeldCalls2(agents, run) {
1222
1258
  return true;
1223
1259
  return !await hasActiveChildren2(agents, run);
1224
1260
  }
1261
+ async function threadHoldsPausedTurn(agents, thread) {
1262
+ const { projectId, id: threadId } = thread;
1263
+ const { runs } = await agents.runs.list({
1264
+ projectId,
1265
+ threadId,
1266
+ kinds: ["conversation"],
1267
+ order: "desc",
1268
+ limit: 1
1269
+ });
1270
+ const latest = runs[0];
1271
+ if (!isAwaitingApprovalRun2(latest) || !latest)
1272
+ return false;
1273
+ const approvals = await listTurnApprovals2(agents, { projectId, runId: latest.id });
1274
+ return turnResumeReadiness2(approvals) !== "closed";
1275
+ }
1225
1276
  async function hasActiveChildren2(agents, run) {
1226
1277
  const active = await agents.runs.list({
1227
1278
  projectId: run.projectId,
@@ -2457,7 +2508,8 @@ async function dispatchQueuedAgentRuns2(input) {
2457
2508
  kinds: ["conversation"],
2458
2509
  statuses: ["queued"],
2459
2510
  order: "asc",
2460
- limit
2511
+ limit,
2512
+ excludeComputerTurns: true
2461
2513
  })).runs;
2462
2514
  const queued = runs.filter((run) => run.kind === "conversation" && run.status === "queued" && run.spec?.runsOn !== "computer");
2463
2515
  if (queued.length === 0) {
@@ -2544,6 +2596,8 @@ async function requestAgentRun2(runtime, execution, models, input) {
2544
2596
  if (input.runsOn !== undefined && input.runsOn !== "computer") {
2545
2597
  throw new AgentRequestError2("invalid_message", `[Sixb] 'runsOn' must be "computer" or omitted.`);
2546
2598
  }
2599
+ if (!existingThread)
2600
+ assertComputerPlaceRequest(input.runsOn, input.computer);
2547
2601
  const runsOn = existingThread ? existingThread.runsOn : input.runsOn;
2548
2602
  const approvalMode = input.approvalMode ?? (await resolveAgentApprovalMode(agents, { projectId, principal, threadId: existingThread?.id })).approvalMode;
2549
2603
  const selected = "router" in requested ? await routedConversationRunSpec(agents, {
@@ -2564,7 +2618,8 @@ async function requestAgentRun2(runtime, execution, models, input) {
2564
2618
  threadId: input.threadId,
2565
2619
  title: input.title,
2566
2620
  principal,
2567
- runsOn
2621
+ runsOn,
2622
+ ...input.computer === undefined ? {} : { computer: input.computer }
2568
2623
  });
2569
2624
  const triggerMessageId = input.messageId ?? createAgentMessageId2();
2570
2625
  let run;
@@ -3005,9 +3060,15 @@ function createThread(agents, params) {
3005
3060
  projectId: params.projectId,
3006
3061
  ownerPrincipal: params.principal,
3007
3062
  ...params.title === undefined ? {} : { title: params.title },
3008
- ...params.runsOn === undefined ? {} : { runsOn: params.runsOn }
3063
+ ...params.runsOn === undefined ? {} : { runsOn: params.runsOn },
3064
+ ...params.computer === undefined ? {} : { computer: params.computer }
3009
3065
  });
3010
3066
  }
3067
+ function assertComputerPlaceRequest(runsOn, computer) {
3068
+ if (runsOn === "computer" !== (computer !== undefined)) {
3069
+ throw new AgentRequestError2("invalid_message", `[Sixb] A thread that runs on a computer names it and its folder: send 'runsOn: "computer"' with 'computer', or neither.`);
3070
+ }
3071
+ }
3011
3072
  function requireAgentStorage(runtime) {
3012
3073
  const agents = runtime.storage.agents;
3013
3074
  if (!agents) {
@@ -3289,6 +3350,40 @@ function createAgentRuntime(runtime, execution, models, decision, sandbox, secur
3289
3350
  return preferences.get();
3290
3351
  }
3291
3352
  };
3353
+ const ownedComputerThread = async (threadId) => {
3354
+ const readable = await rule.read(threadId);
3355
+ if (!readable)
3356
+ throw new AgentRequestError2("thread_not_found", "[Sixb] Agent thread not found.");
3357
+ if (readable.access !== "owner") {
3358
+ throw new AgentRequestError2("not_thread_owner", `[Sixb] Only the owner of Agent thread '${threadId}' moves it.`);
3359
+ }
3360
+ if (readable.thread.runsOn !== "computer") {
3361
+ throw new AgentRequestError2("invalid_message", `[Sixb] Agent thread '${threadId}' runs in the cloud, on no computer.`);
3362
+ }
3363
+ return readable.thread;
3364
+ };
3365
+ const moveThread = (thread, moves, move) => runtime.storage.transaction(async (tx) => {
3366
+ const agents = tx.agents;
3367
+ if (!agents) {
3368
+ throw new AgentRequestError2("storage_unavailable", "[Sixb] Agent storage is not configured.");
3369
+ }
3370
+ const moved = await move(agents).catch((error) => {
3371
+ throw error instanceof AgentStorageError2 && error.code === "active_run_exists" ? new AgentRequestError2("active_run_exists", "[Sixb] A turn is running on the computer: stop it, or let it end, first.") : error;
3372
+ });
3373
+ if (moves && await threadHoldsPausedTurn(agents, thread)) {
3374
+ throw new AgentRequestError2("active_run_exists", "[Sixb] A turn is waiting for your approval: answer or stop it first.");
3375
+ }
3376
+ return moved;
3377
+ });
3378
+ const announceThreadMoved = async (thread) => {
3379
+ await publishAgentThreadMoved2(runtime.broker, {
3380
+ projectId: runtime.projectId,
3381
+ ownerPrincipal: thread.ownerPrincipal,
3382
+ threadId: thread.id
3383
+ }).catch((error) => {
3384
+ console.error(`[Sixb] Could not announce the move of Agent thread '${thread.id}'.`, error);
3385
+ });
3386
+ };
3292
3387
  const agentRuntime = {
3293
3388
  get: getAgent,
3294
3389
  memory: createAgentMemoryRuntime(runtime),
@@ -3317,6 +3412,24 @@ function createAgentRuntime(runtime, execution, models, decision, sandbox, secur
3317
3412
  const [view] = await agentThreadViews(runtime, [{ ...thread, sandboxState }]);
3318
3413
  return view ?? thread;
3319
3414
  },
3415
+ moveToComputer: async (threadId, computer) => {
3416
+ const thread = await ownedComputerThread(threadId);
3417
+ const moves = movesComputerPlace2(thread, computer);
3418
+ const moved = await moveThread(thread, moves, (agents) => agents.threads.assignComputer({ projectId: runtime.projectId, id: threadId, computer }));
3419
+ if (moves)
3420
+ await announceThreadMoved(thread);
3421
+ const [view] = await agentThreadViews(runtime, [moved]);
3422
+ return view ?? moved;
3423
+ },
3424
+ moveToCloud: async (threadId) => {
3425
+ const thread = await ownedComputerThread(threadId);
3426
+ const { thread: moved, queued } = await moveThread(thread, true, (agents) => agents.threads.moveToCloud({ projectId: runtime.projectId, id: threadId }));
3427
+ if (queued)
3428
+ await dispatchAgentRun(runtime, requireAgents(), queued.id);
3429
+ await announceThreadMoved(thread);
3430
+ const [view] = await agentThreadViews(runtime, [moved]);
3431
+ return view ?? moved;
3432
+ },
3320
3433
  create: async (input) => {
3321
3434
  assertNoAgentSelector(input);
3322
3435
  const agent = getAgent();
@@ -3330,6 +3443,7 @@ function createAgentRuntime(runtime, execution, models, decision, sandbox, secur
3330
3443
  if (input.runsOn !== undefined && input.runsOn !== "computer") {
3331
3444
  throw new AgentRequestError2("invalid_message", `[Sixb] 'runsOn' must be "computer" or omitted.`);
3332
3445
  }
3446
+ assertComputerPlaceRequest(input.runsOn, input.computer);
3333
3447
  if (input.runsOn === "computer" && input.sandbox !== undefined) {
3334
3448
  throw new AgentRequestError2("invalid_sandbox_params", "[Sixb] A thread that runs on a computer works in its folder: it takes no sandbox.");
3335
3449
  }
@@ -3343,7 +3457,8 @@ function createAgentRuntime(runtime, execution, models, decision, sandbox, secur
3343
3457
  projectId: runtime.projectId,
3344
3458
  ownerPrincipal: principal,
3345
3459
  ...input.title === undefined ? {} : { title: input.title },
3346
- ...input.runsOn === undefined ? {} : { runsOn: input.runsOn }
3460
+ ...input.runsOn === undefined ? {} : { runsOn: input.runsOn },
3461
+ ...input.computer === undefined ? {} : { computer: input.computer }
3347
3462
  });
3348
3463
  return { ...created, participants: [] };
3349
3464
  },
@@ -3759,6 +3874,95 @@ function commandContext(runtime, execution, connectorId) {
3759
3874
  });
3760
3875
  }
3761
3876
 
3877
+ // src/datasets/lineage.ts
3878
+ var DEFAULT_LINEAGE_DEPTH = 5;
3879
+ var MAX_LINEAGE_DEPTH = 20;
3880
+ var MAX_DATASET_LINEAGE_NODES = 100;
3881
+ function datasetLineageDepth(depth) {
3882
+ if (depth === undefined)
3883
+ return DEFAULT_LINEAGE_DEPTH;
3884
+ if (!Number.isInteger(depth) || depth < 1 || depth > MAX_LINEAGE_DEPTH) {
3885
+ throw new Error(`[Sixb] Dataset lineage depth must be an integer between 1 and ${MAX_LINEAGE_DEPTH}, received ${depth}.`);
3886
+ }
3887
+ return depth;
3888
+ }
3889
+ async function walkDatasetLineage(runtime, lakeStorage, root, depth) {
3890
+ const canViewDataset = (datasetId) => isRuntimeAllowed2(runtime, { kind: "dataset.view", datasetId });
3891
+ const nodes = new Map([
3892
+ [versionKey(root), lineageVersion(runtime, root)]
3893
+ ]);
3894
+ const hidden = new Set;
3895
+ const edges = [];
3896
+ let truncated = false;
3897
+ let frontier = [root];
3898
+ for (let step = 1;frontier.length > 0; step++) {
3899
+ const reached = new Map;
3900
+ for (const version of frontier) {
3901
+ for (const input of distinctInputs(version)) {
3902
+ const key = versionKey(input);
3903
+ if (hidden.has(key))
3904
+ continue;
3905
+ if (!nodes.has(key) && !reached.has(key)) {
3906
+ if (step > depth || nodes.size + reached.size >= MAX_DATASET_LINEAGE_NODES) {
3907
+ truncated = true;
3908
+ continue;
3909
+ }
3910
+ if (!canViewDataset(input.datasetId)) {
3911
+ hidden.add(key);
3912
+ continue;
3913
+ }
3914
+ reached.set(key, input);
3915
+ }
3916
+ edges.push({ from: versionRef(input), to: versionRef(version) });
3917
+ }
3918
+ }
3919
+ const refs = [...reached.values()];
3920
+ const versions = await Promise.all(refs.map((ref) => lakeStorage.getVersion(ref.datasetId, ref.versionId)));
3921
+ frontier = versions.filter((version) => version !== null);
3922
+ refs.forEach((ref, index) => {
3923
+ const version = versions[index];
3924
+ nodes.set(versionKey(ref), version ? lineageVersion(runtime, version) : { ...versionRef(ref), expired: true });
3925
+ });
3926
+ }
3927
+ return { nodes: [...nodes.values()], edges, restricted: hidden.size, truncated };
3928
+ }
3929
+ function lineageVersion(runtime, version) {
3930
+ return {
3931
+ ...versionRef(version),
3932
+ mode: version.mode,
3933
+ createdAt: version.createdAt,
3934
+ ...version.parentVersionId === undefined ? {} : { parentVersionId: version.parentVersionId },
3935
+ ...version.producer === undefined ? {} : { producer: visibleProducer(runtime, version.producer) }
3936
+ };
3937
+ }
3938
+ function visibleProducer(runtime, producer) {
3939
+ const { kind, id } = producer;
3940
+ if (id === undefined || kind === "ingest")
3941
+ return { kind };
3942
+ const authority = resolveRuntimeAuthorizationForProject(runtime);
3943
+ const visible = authority.type === "unrestricted" || authority.type === "principal" && canViewPrimitiveRun2(authority.context, { kind, id });
3944
+ if (!visible)
3945
+ return { kind };
3946
+ return {
3947
+ kind,
3948
+ id,
3949
+ ...producer.runId === undefined ? {} : { runId: producer.runId },
3950
+ ...producer.stepId === undefined ? {} : { stepId: producer.stepId }
3951
+ };
3952
+ }
3953
+ function distinctInputs(version) {
3954
+ const inputs = new Map;
3955
+ for (const input of version.inputs ?? [])
3956
+ inputs.set(versionKey(input), input);
3957
+ return [...inputs.values()];
3958
+ }
3959
+ function versionRef(ref) {
3960
+ return { datasetId: ref.datasetId, versionId: ref.versionId };
3961
+ }
3962
+ function versionKey(ref) {
3963
+ return JSON.stringify([ref.datasetId, ref.versionId]);
3964
+ }
3965
+
3762
3966
  // src/datasets/execution.ts
3763
3967
  function createDatasetsRuntime(runtime, execution, source, lakeStorage, blobStorage, versionMarkings) {
3764
3968
  const authority = resolveRuntimeAuthorizationForProject(runtime);
@@ -3771,6 +3975,22 @@ function createDatasetsRuntime(runtime, execution, source, lakeStorage, blobStor
3771
3975
  const dataset = source.getById(datasetId);
3772
3976
  return dataset && allowed(datasetId) ? dataset : null;
3773
3977
  },
3978
+ async listVersions(dataset, input = {}) {
3979
+ assertAuthorized2(runtime, { kind: "dataset.view", datasetId: dataset.id });
3980
+ const registered = source.getById(dataset.id);
3981
+ if (!registered)
3982
+ throw new Error(`[Sixb] Dataset '${dataset.id}' is not registered.`);
3983
+ const versions = await lakeStorage.listVersions(registered.id, input.limit);
3984
+ return versions.map((version) => readerVersion(runtime, version));
3985
+ },
3986
+ async getVersion(dataset, versionId) {
3987
+ assertAuthorized2(runtime, { kind: "dataset.view", datasetId: dataset.id });
3988
+ const registered = source.getById(dataset.id);
3989
+ if (!registered)
3990
+ throw new Error(`[Sixb] Dataset '${dataset.id}' is not registered.`);
3991
+ const version = await lakeStorage.getVersion(registered.id, versionId);
3992
+ return version && readerVersion(runtime, version);
3993
+ },
3774
3994
  async readRows(dataset, input = {}) {
3775
3995
  assertAuthorized2(runtime, { kind: "dataset.view", datasetId: dataset.id });
3776
3996
  const registered = source.getById(dataset.id);
@@ -3792,12 +4012,24 @@ function createDatasetsRuntime(runtime, execution, source, lakeStorage, blobStor
3792
4012
  });
3793
4013
  const rows = columns.length === selected.length ? read(input.columns) : columns.length > 0 ? read(columns) : emptyRows(read(selected.slice(0, 1)));
3794
4014
  return {
3795
- version,
4015
+ version: readerVersion(runtime, version),
3796
4016
  columns,
3797
4017
  ...redacted.size > 0 ? { redactions: missingClearanceRedactions(redacted) } : {},
3798
4018
  rows
3799
4019
  };
3800
4020
  },
4021
+ async lineage(dataset, input = {}) {
4022
+ const depth = datasetLineageDepth(input.depth);
4023
+ if (!allowed(dataset.id))
4024
+ return null;
4025
+ const registered = source.getById(dataset.id);
4026
+ if (!registered)
4027
+ throw new Error(`[Sixb] Dataset '${dataset.id}' is not registered.`);
4028
+ const version = input.versionId === undefined ? await lakeStorage.getLatestVersion(registered.id) : await lakeStorage.getVersion(registered.id, input.versionId);
4029
+ if (!version)
4030
+ return null;
4031
+ return walkDatasetLineage(runtime, lakeStorage, version, depth);
4032
+ },
3801
4033
  async ingest(dataset, input) {
3802
4034
  assertPrivileged2(runtime, "datasets.ingest");
3803
4035
  const registered = source.getById(dataset.id);
@@ -3842,6 +4074,16 @@ function createDatasetsRuntime(runtime, execution, source, lakeStorage, blobStor
3842
4074
  }
3843
4075
  };
3844
4076
  }
4077
+ function readerVersion(runtime, version) {
4078
+ const { lineage: _lineage, producer, inputs, ...rest } = version;
4079
+ return {
4080
+ ...rest,
4081
+ ...producer === undefined ? {} : { producer: visibleProducer(runtime, producer) },
4082
+ ...inputs === undefined ? {} : {
4083
+ inputs: inputs.filter((input) => isRuntimeAllowed2(runtime, { kind: "dataset.view", datasetId: input.datasetId }))
4084
+ }
4085
+ };
4086
+ }
3845
4087
  function selectColumns(version, requested) {
3846
4088
  const available = version.schema.columns.map((column) => column.name);
3847
4089
  if (requested === undefined || requested.length === 0)
@@ -4156,7 +4398,7 @@ function isStepDefinition2(value) {
4156
4398
  return isRecord(value) && value.kind === "step" && typeof value.id === "string" && isRecord(value.input) && isRecord(value.output) && typeof value.handler === "function";
4157
4399
  }
4158
4400
  function isAgentStepDefinition2(value) {
4159
- return isRecord(value) && value.kind === "agentStep" && typeof value.id === "string" && (value.model === undefined || isLanguageModelTier2(value.model) || isLanguageModel(value.model)) && (value.reasoning === undefined || isModelReasoning2(value.reasoning)) && typeof value.instructions === "string" && isStringArray(value.groupIds) && isStringArray(value.toolNames) && isStringArray(value.skillNames) && isRecord(value.input) && isRecord(value.output) && typeof value.prompt === "function";
4401
+ return isRecord(value) && value.kind === "agentStep" && typeof value.id === "string" && (value.model === undefined || isLanguageModelTier2(value.model) || isLanguageModel(value.model)) && (value.reasoning === undefined || isModelReasoning2(value.reasoning)) && (value.maxSteps === undefined || Number.isSafeInteger(value.maxSteps)) && typeof value.instructions === "string" && isStringArray(value.groupIds) && isStringArray(value.toolNames) && isStringArray(value.skillNames) && isRecord(value.input) && isRecord(value.output) && typeof value.prompt === "function";
4160
4402
  }
4161
4403
  function isInterventionDefinition2(value) {
4162
4404
  return isRecord(value) && value.kind === "intervention" && typeof value.id === "string" && isRecord(value.input) && isRecord(value.response) && (value.defaults === undefined || typeof value.defaults === "function");
@@ -5288,14 +5530,17 @@ async function runModelLoop2(input) {
5288
5530
  }
5289
5531
  await input.onEvent?.({ type: "start-step" });
5290
5532
  let requestMessages;
5533
+ let requestMaxOutputTokens;
5291
5534
  try {
5292
5535
  const prepared = await input.prepareStep?.({
5293
5536
  stepIndex,
5294
5537
  messages,
5538
+ steps,
5295
5539
  model: input.model,
5296
5540
  signal: input.signal
5297
5541
  });
5298
5542
  requestMessages = prepared?.messages ?? messages;
5543
+ requestMaxOutputTokens = prepared?.maxOutputTokens;
5299
5544
  } catch (error) {
5300
5545
  if (!input.signal.aborted && !isAbortError2(error))
5301
5546
  throw error;
@@ -5304,64 +5549,64 @@ async function runModelLoop2(input) {
5304
5549
  if (input.signal.aborted) {
5305
5550
  return { status: "aborted", steps, partialContent: [] };
5306
5551
  }
5307
- const callId = generateCallId();
5308
- if (!callId || callIds.has(callId)) {
5309
- throw new ModelStreamError2(`[SixbModels] Model call IDs must be nonempty and unique.`);
5310
- }
5311
- callIds.add(callId);
5312
- const accumulator = new StreamAccumulator(input.onEvent);
5313
- let accepted = false;
5314
- let cost = { status: "unpriceable", reason: "missing-usage" };
5315
- let terminalStreamError;
5316
- try {
5317
- const stream = await input.model.stream({
5552
+ let callId;
5553
+ let cost;
5554
+ let completed;
5555
+ for (let attempt = 0;; attempt += 1) {
5556
+ callId = generateCallId();
5557
+ if (!callId || callIds.has(callId)) {
5558
+ throw new ModelStreamError2(`[SixbModels] Model call IDs must be nonempty and unique.`);
5559
+ }
5560
+ callIds.add(callId);
5561
+ const accumulator = new StreamAccumulator(input.onEvent);
5562
+ const call = await callModel(input, {
5318
5563
  callId,
5319
5564
  messages: requestMessages,
5320
5565
  tools: toolSpecifications,
5321
- ...input.reasoning === undefined ? {} : { reasoning: input.reasoning },
5322
- ...input.maxOutputTokens === undefined ? {} : { maxOutputTokens: input.maxOutputTokens },
5323
- ...input.caching === undefined ? {} : { caching: input.caching },
5324
- ...input.output === undefined ? {} : {
5325
- responseFormat: {
5326
- type: "json",
5327
- name: input.output.name,
5328
- ...input.output.description === undefined ? {} : { description: input.output.description },
5329
- schema: input.output.schema
5330
- }
5331
- },
5332
- signal: input.signal
5566
+ accumulator,
5567
+ ...requestMaxOutputTokens === undefined ? {} : { maxOutputTokens: requestMaxOutputTokens }
5333
5568
  });
5334
- accepted = true;
5335
- for await (const event of stream.events) {
5336
- await accumulator.accept(event);
5569
+ cost = call.cost;
5570
+ if (call.aborted) {
5571
+ return { status: "aborted", steps, partialContent: accumulator.partialContent() };
5337
5572
  }
5338
- } catch (error) {
5339
- if (error instanceof ModelUsageRecordingError2)
5340
- throw error;
5341
- const aborted = input.signal.aborted || isAbortError2(error);
5342
- if (accumulator.isFinished()) {
5343
- if (!aborted)
5344
- terminalStreamError = { error };
5345
- } else if (!aborted) {
5346
- throw error;
5347
- } else {
5348
- return {
5349
- status: "aborted",
5350
- steps,
5351
- partialContent: accumulator.partialContent()
5352
- };
5573
+ const finished = call.failure && !accumulator.isFinished() ? undefined : accumulator.complete();
5574
+ const failure = call.failure ?? (finished?.finishReason === "length" && finished.contextWindowExceeded ? {
5575
+ error: new ModelProviderError2("[SixbModels] The answer filled the model's context window.", input.model.providerId, input.model.modelId, { reason: "context-window-exceeded" })
5576
+ } : undefined);
5577
+ if (failure && attempt === 0 && input.recoverStep) {
5578
+ let recovered;
5579
+ try {
5580
+ recovered = await input.recoverStep({
5581
+ stepIndex,
5582
+ messages: requestMessages,
5583
+ steps,
5584
+ model: input.model,
5585
+ signal: input.signal,
5586
+ error: failure.error,
5587
+ ...finished ? { usage: finished.usage } : {}
5588
+ });
5589
+ } catch (error) {
5590
+ if (!input.signal.aborted && !isAbortError2(error))
5591
+ throw error;
5592
+ return { status: "aborted", steps, partialContent: [] };
5593
+ }
5594
+ if (input.signal.aborted)
5595
+ return { status: "aborted", steps, partialContent: [] };
5596
+ if (recovered?.messages) {
5597
+ requestMessages = recovered.messages;
5598
+ requestMaxOutputTokens = recovered.maxOutputTokens;
5599
+ if (accumulator.streamed)
5600
+ await input.onEvent?.({ type: "start-step", retry: true });
5601
+ continue;
5602
+ }
5353
5603
  }
5354
- } finally {
5355
- if (accepted)
5356
- cost = accumulator.meter.end({ model: input.model, callId }).cost;
5357
- }
5358
- if (input.signal.aborted && !accumulator.isFinished()) {
5359
- return { status: "aborted", steps, partialContent: accumulator.partialContent() };
5604
+ if (call.failure)
5605
+ throw call.failure.error;
5606
+ completed = finished;
5607
+ break;
5360
5608
  }
5361
- const completed = accumulator.complete();
5362
5609
  const responseId = completed.responseId ?? `${callId}:response`;
5363
- if (terminalStreamError)
5364
- throw terminalStreamError.error;
5365
5610
  if (completed.projectionError)
5366
5611
  throw completed.projectionError;
5367
5612
  if (input.signal.aborted) {
@@ -5462,11 +5707,63 @@ async function runModelLoop2(input) {
5462
5707
  throw new StructuredOutputError2("[SixbModels] Model reached the step limit without structured output.", structuredOutputErrorContext(input, response, responseId, cost, responseText(response)));
5463
5708
  }
5464
5709
  const output = responseText(response);
5465
- return { status: "completed", output, steps, finishReason: response.finishReason };
5710
+ return {
5711
+ status: "completed",
5712
+ output,
5713
+ steps,
5714
+ finishReason: response.finishReason,
5715
+ stepLimitReached: true
5716
+ };
5466
5717
  }
5467
5718
  }
5468
5719
  throw new ModelStreamError2("[SixbModels] Model loop exited without a terminal result.");
5469
5720
  }
5721
+ async function callModel(input, call) {
5722
+ const { accumulator } = call;
5723
+ const maxOutputTokens = call.maxOutputTokens === undefined ? input.maxOutputTokens : Math.min(call.maxOutputTokens, input.maxOutputTokens ?? Number.POSITIVE_INFINITY);
5724
+ let accepted = false;
5725
+ let cost = { status: "unpriceable", reason: "missing-usage" };
5726
+ let failure;
5727
+ let cancelled = false;
5728
+ try {
5729
+ const stream = await input.model.stream({
5730
+ callId: call.callId,
5731
+ messages: call.messages,
5732
+ tools: call.tools,
5733
+ ...input.reasoning === undefined ? {} : { reasoning: input.reasoning },
5734
+ ...maxOutputTokens === undefined ? {} : { maxOutputTokens },
5735
+ ...input.caching === undefined ? {} : { caching: input.caching },
5736
+ ...input.output === undefined ? {} : {
5737
+ responseFormat: {
5738
+ type: "json",
5739
+ name: input.output.name,
5740
+ ...input.output.description === undefined ? {} : { description: input.output.description },
5741
+ schema: input.output.schema
5742
+ }
5743
+ },
5744
+ signal: input.signal
5745
+ });
5746
+ accepted = true;
5747
+ for await (const event of stream.events) {
5748
+ await accumulator.accept(event);
5749
+ }
5750
+ } catch (error) {
5751
+ if (error instanceof ModelUsageRecordingError2)
5752
+ throw error;
5753
+ if (input.signal.aborted || isAbortError2(error))
5754
+ cancelled = true;
5755
+ else
5756
+ failure = { error };
5757
+ } finally {
5758
+ if (accepted)
5759
+ cost = accumulator.meter.end({ model: input.model, callId: call.callId }).cost;
5760
+ }
5761
+ return {
5762
+ cost,
5763
+ aborted: (cancelled || input.signal.aborted) && !accumulator.isFinished(),
5764
+ ...failure === undefined ? {} : { failure }
5765
+ };
5766
+ }
5470
5767
  function assertLoopInput(input) {
5471
5768
  if (input.maxOutputTokens !== undefined && (!Number.isSafeInteger(input.maxOutputTokens) || input.maxOutputTokens <= 0)) {
5472
5769
  throw new TypeError("[SixbModels] maxOutputTokens must be a positive safe integer.");
@@ -5648,7 +5945,7 @@ function toolErrorResult(part, errorText) {
5648
5945
  }
5649
5946
 
5650
5947
  class StreamAccumulator {
5651
- onEvent;
5948
+ reader;
5652
5949
  parts = [];
5653
5950
  spans = new Map;
5654
5951
  toolCalls = new Map;
@@ -5656,10 +5953,16 @@ class StreamAccumulator {
5656
5953
  finished = false;
5657
5954
  finishReason;
5658
5955
  rawFinishReason;
5956
+ contextWindowExceeded = false;
5957
+ streamed = false;
5659
5958
  meter = new LanguageModelCallMeter;
5660
5959
  projectionError;
5661
- constructor(onEvent) {
5662
- this.onEvent = onEvent;
5960
+ constructor(reader) {
5961
+ this.reader = reader;
5962
+ }
5963
+ async onEvent(chunk) {
5964
+ this.streamed = true;
5965
+ await this.reader?.(chunk);
5663
5966
  }
5664
5967
  isFinished() {
5665
5968
  return this.finished;
@@ -5731,6 +6034,7 @@ class StreamAccumulator {
5731
6034
  this.finished = true;
5732
6035
  this.finishReason = event.finishReason;
5733
6036
  this.rawFinishReason = event.rawFinishReason;
6037
+ this.contextWindowExceeded = event.contextWindowExceeded === true;
5734
6038
  this.meter.accept(event);
5735
6039
  return;
5736
6040
  case "error":
@@ -5758,6 +6062,7 @@ class StreamAccumulator {
5758
6062
  toolCalls: parsed.toolCalls,
5759
6063
  finishReason: this.finishReason,
5760
6064
  ...this.rawFinishReason === undefined ? {} : { rawFinishReason: this.rawFinishReason },
6065
+ ...this.contextWindowExceeded ? { contextWindowExceeded: true } : {},
5761
6066
  ...this.meter.facts(),
5762
6067
  ...this.projectionError === undefined ? {} : { projectionError: this.projectionError }
5763
6068
  };
@@ -5840,7 +6145,7 @@ class StreamAccumulator {
5840
6145
  };
5841
6146
  this.spans.set(event.id, part);
5842
6147
  this.parts.push(part);
5843
- await this.onEvent?.({ type: "text-start", id: event.id });
6148
+ await this.onEvent({ type: "text-start", id: event.id });
5844
6149
  }
5845
6150
  async startReasoning(event) {
5846
6151
  this.requireStarted(event.type);
@@ -5854,7 +6159,7 @@ class StreamAccumulator {
5854
6159
  };
5855
6160
  this.spans.set(event.id, part);
5856
6161
  this.parts.push(part);
5857
- await this.onEvent?.({ type: "reasoning-start", id: event.id });
6162
+ await this.onEvent({ type: "reasoning-start", id: event.id });
5858
6163
  }
5859
6164
  async appendText(event, expected) {
5860
6165
  const part = this.spans.get(event.id);
@@ -5862,7 +6167,7 @@ class StreamAccumulator {
5862
6167
  throw new ModelStreamError2(`[SixbModels] ${event.type} references unopened ${expected} span '${event.id}'.`);
5863
6168
  }
5864
6169
  part.text += event.delta;
5865
- await this.onEvent?.({ type: event.type, id: event.id, delta: event.delta });
6170
+ await this.onEvent({ type: event.type, id: event.id, delta: event.delta });
5866
6171
  }
5867
6172
  async endText(event, expected) {
5868
6173
  const part = this.spans.get(event.id);
@@ -5872,7 +6177,7 @@ class StreamAccumulator {
5872
6177
  part.providerData = mergeProviderData(part.providerData, this.captureProviderData(event.providerData));
5873
6178
  part.complete = true;
5874
6179
  this.spans.delete(event.id);
5875
- await this.onEvent?.({ type: event.type, id: event.id });
6180
+ await this.onEvent({ type: event.type, id: event.id });
5876
6181
  }
5877
6182
  async startTool(event) {
5878
6183
  this.requireStarted(event.type);
@@ -5895,7 +6200,7 @@ class StreamAccumulator {
5895
6200
  };
5896
6201
  this.toolCalls.set(event.id, part);
5897
6202
  this.parts.push(part);
5898
- await this.onEvent?.({
6203
+ await this.onEvent({
5899
6204
  type: "tool-input-start",
5900
6205
  toolCallId: event.id,
5901
6206
  toolName: event.toolName
@@ -5907,7 +6212,7 @@ class StreamAccumulator {
5907
6212
  throw new ModelStreamError2(`[SixbModels] tool-input-delta references unopened tool call '${event.id}'.`);
5908
6213
  }
5909
6214
  part.inputText += event.delta;
5910
- await this.onEvent?.({
6215
+ await this.onEvent({
5911
6216
  type: "tool-input-delta",
5912
6217
  toolCallId: event.id,
5913
6218
  toolName: part.toolName,
@@ -7820,6 +8125,612 @@ function createObjectByIdHandle(ctx, primaryId) {
7820
8125
  };
7821
8126
  return objectHandle;
7822
8127
  }
8128
+ // src/lineage/reader.ts
8129
+ class LineageReader {
8130
+ runtime;
8131
+ authority;
8132
+ #restricted = new Set;
8133
+ constructor(runtime, authority) {
8134
+ this.runtime = runtime;
8135
+ this.authority = authority;
8136
+ }
8137
+ static for(runtime) {
8138
+ const authority = resolveRuntimeAuthorizationForProject(runtime);
8139
+ switch (authority.type) {
8140
+ case "denied":
8141
+ case "delegated":
8142
+ return null;
8143
+ case "principal":
8144
+ case "unrestricted":
8145
+ return new LineageReader(runtime, authority);
8146
+ }
8147
+ }
8148
+ get restricted() {
8149
+ return this.#restricted.size;
8150
+ }
8151
+ restrict(step) {
8152
+ this.#restricted.add(step);
8153
+ }
8154
+ canViewDataset(datasetId) {
8155
+ return isRuntimeAllowed2(this.runtime, { kind: "dataset.view", datasetId });
8156
+ }
8157
+ canViewRun(run) {
8158
+ return this.authority.type === "unrestricted" || canViewPrimitiveRun2(this.authority.context, run);
8159
+ }
8160
+ async readObjects(refs) {
8161
+ try {
8162
+ const rows = await this.runtime.objectReader.getByPrimaryIdBatch({ items: refs });
8163
+ const found = refs.map((ref) => rows.get(objectBatchKey2(ref.objectTypeId, ref.primaryId)));
8164
+ return found.every((row) => row !== undefined) ? found : null;
8165
+ } catch (error) {
8166
+ if (error instanceof AuthorizationError2)
8167
+ return null;
8168
+ throw error;
8169
+ }
8170
+ }
8171
+ async canReadLink(sourceTypeId, linkId) {
8172
+ try {
8173
+ await this.runtime.objectReader.assertReadable({
8174
+ objectTypeIds: [],
8175
+ links: [{ objectTypeId: sourceTypeId, linkId }]
8176
+ });
8177
+ return true;
8178
+ } catch (error) {
8179
+ if (error instanceof AuthorizationError2)
8180
+ return false;
8181
+ throw error;
8182
+ }
8183
+ }
8184
+ }
8185
+
8186
+ // src/lineage/executors.ts
8187
+ function executorRunKey(executor) {
8188
+ switch (executor.type) {
8189
+ case "primitive":
8190
+ return `${executor.kind}-run:${executor.runId}`;
8191
+ case "agent":
8192
+ return `agent-run:${executor.runId}`;
8193
+ case "request":
8194
+ case "kernel":
8195
+ return;
8196
+ }
8197
+ }
8198
+ async function viewableExecutorRuns(reader, projections, executors) {
8199
+ const runs = new Map;
8200
+ for (const executor of executors) {
8201
+ const key = executorRunKey(executor);
8202
+ if (key !== undefined)
8203
+ runs.set(key, executor);
8204
+ }
8205
+ const decided = await Promise.all([...runs].map(async ([key, executor]) => {
8206
+ const viewable = await canViewExecutorRun(reader, projections, executor);
8207
+ return viewable ? [key] : [];
8208
+ }));
8209
+ return new Set(decided.flat());
8210
+ }
8211
+ async function canViewExecutorRun(reader, projections, executor) {
8212
+ if (reader.authority.type === "unrestricted")
8213
+ return true;
8214
+ switch (executor.type) {
8215
+ case "request":
8216
+ case "kernel":
8217
+ return true;
8218
+ case "agent":
8219
+ return canViewAgentRun(reader, executor.runId);
8220
+ case "primitive":
8221
+ break;
8222
+ }
8223
+ switch (executor.kind) {
8224
+ case "action":
8225
+ return canViewActionRun(reader, executor.runId);
8226
+ case "projection": {
8227
+ const definition = projections.getById(executor.id);
8228
+ return definition !== null && reader.canViewRun({ kind: "projection", target: projectionTargetOf2(definition) });
8229
+ }
8230
+ default:
8231
+ return reader.canViewRun({ kind: executor.kind, id: executor.id });
8232
+ }
8233
+ }
8234
+ async function canViewActionRun(reader, runId) {
8235
+ const { projectId, storage, objectReader } = reader.runtime;
8236
+ if (reader.authority.type !== "principal")
8237
+ return false;
8238
+ const run = await storage.actionRuns?.getById({ projectId, id: runId });
8239
+ if (!run)
8240
+ return false;
8241
+ const [viewable] = await viewableActionRuns(objectReader, reader.authority.context, [run]);
8242
+ return viewable !== undefined && await canReadActionRunSubject(objectReader, run);
8243
+ }
8244
+ async function canViewAgentRun(reader, runId) {
8245
+ const { projectId, storage } = reader.runtime;
8246
+ const run = await storage.agents?.runs.getById({ projectId, id: runId });
8247
+ if (!run)
8248
+ return false;
8249
+ const rule = createAgentThreadAccessRule(reader.runtime, reader.authority);
8250
+ return await rule.read(run.threadId) !== null;
8251
+ }
8252
+
8253
+ // src/lineage/commits.ts
8254
+ async function editCommitsAt(reader, instants) {
8255
+ const { projectId, storage } = reader.runtime;
8256
+ const found = await Promise.all([...instants].map(async (committedAt) => {
8257
+ const { commits } = await storage.ontology.commits.list({ projectId, committedAt });
8258
+ return [committedAt, commits.filter(isEditCommit)];
8259
+ }));
8260
+ return new Map(found);
8261
+ }
8262
+ function editCommitFor(commits, object, change) {
8263
+ const objectKey = objectRefKey2(object);
8264
+ const made = commits.filter((commit) => commit.result.changes.objects.some((effective) => objectRefKey2(effective.ref) === objectKey && (change === "created" ? effective.kind === "created" : Object.hasOwn(effective.propertyChanges, change.propertyId))));
8265
+ const candidates = made.length > 0 ? made : commits;
8266
+ return candidates.length === 1 ? candidates[0] : null;
8267
+ }
8268
+ async function commitsById(reader, commitIds) {
8269
+ const { projectId, storage } = reader.runtime;
8270
+ const found = await Promise.all([...commitIds].map(async (id) => {
8271
+ const commit = await storage.ontology.commits.getById({ projectId, id });
8272
+ if (!commit)
8273
+ throw new Error(`[Sixb] Ontology commit '${id}', which state names, is missing.`);
8274
+ return [id, commit];
8275
+ }));
8276
+ return new Map(found);
8277
+ }
8278
+ async function attributeCommits(reader, projections, commits) {
8279
+ const { projectId, storage } = reader.runtime;
8280
+ const distinct = [...new Map(commits.map((commit) => [commit.id, commit])).values()];
8281
+ const executionIds = [...new Set(distinct.map((commit) => commit.executionId))];
8282
+ const executions = await Promise.all(executionIds.map((id) => storage.executions.getById({ projectId, id })));
8283
+ const attributions = new Map(executions.flatMap((execution) => execution ? [[execution.id, eventAttribution2(execution)]] : []));
8284
+ const executors = [...attributions.values()].map(({ executor }) => executor);
8285
+ const viewable = await viewableExecutorRuns(reader, projections, executors);
8286
+ const shows = (executor) => {
8287
+ const key = executorRunKey(executor);
8288
+ if (key === undefined || viewable.has(key))
8289
+ return true;
8290
+ reader.restrict(key);
8291
+ return false;
8292
+ };
8293
+ return new Map(distinct.map((commit) => {
8294
+ const attribution = attributions.get(commit.executionId);
8295
+ if (!attribution) {
8296
+ throw new Error(`[Sixb] Ontology commit '${commit.id}' has no execution '${commit.executionId}'.`);
8297
+ }
8298
+ const { requestedBy, executor } = attribution;
8299
+ const requester = requestedBy === undefined ? {} : { requestedBy };
8300
+ if (!shows(executor))
8301
+ return [commit.id, requester];
8302
+ const origin = commit.origin;
8303
+ if (origin.kind !== "action")
8304
+ return [commit.id, { ...requester, executor }];
8305
+ const action = { actionId: origin.actionId, runId: origin.runId };
8306
+ return [commit.id, { ...requester, executor, action }];
8307
+ }));
8308
+ }
8309
+ function editSource(commit, attribution) {
8310
+ return { kind: "edit", commitId: commit.id, committedAt: commit.committedAt, ...attribution };
8311
+ }
8312
+ function telemetrySource(commit, attribution) {
8313
+ const projectionId = commit.intent.kind === "telemetry" && commit.intent.source.kind === "projection" ? commit.intent.source.projection.projectionId : undefined;
8314
+ return {
8315
+ kind: "telemetry",
8316
+ commitId: commit.id,
8317
+ committedAt: commit.committedAt,
8318
+ ...projectionId === undefined ? {} : { projectionId },
8319
+ ...attribution
8320
+ };
8321
+ }
8322
+ function isEditCommit(commit) {
8323
+ return commit.intent.kind === "edit";
8324
+ }
8325
+
8326
+ // src/lineage/projections.ts
8327
+ async function describeProjection(reader, dependencies, stored) {
8328
+ const { projectId, storage } = reader.runtime;
8329
+ const { projectionId } = stored.source;
8330
+ const active = await storage.ontology.sources.getActive({ projectId, source: stored.source });
8331
+ const definition = dependencies.projections.getById(projectionId);
8332
+ const target = definition ? projectionTargetOf2(definition) : rootTarget(stored.root);
8333
+ const showsRun = active !== null && reader.canViewRun({ kind: "projection", target });
8334
+ if (active && !showsRun)
8335
+ reader.restrict(`projection-run:${active.projectionRunId}`);
8336
+ const version = active?.datasetVersion;
8337
+ const showsVersion = version !== undefined && reader.canViewDataset(version.datasetId);
8338
+ if (version && !showsVersion) {
8339
+ reader.restrict(`dataset-version:${version.datasetId}:${version.versionId}`);
8340
+ }
8341
+ const lineage = showsVersion ? await columnLineage(dependencies.lakeStorage, version) : undefined;
8342
+ const rowOrigins = lineage && visibleRefs(reader, lineage.rows);
8343
+ const columns = showsVersion && definition?.datasetId === version.datasetId ? definition : null;
8344
+ return {
8345
+ key: `projection:${projectionId}`,
8346
+ source: {
8347
+ kind: "projection",
8348
+ projectionId,
8349
+ ...showsRun ? { projectionRunId: active.projectionRunId } : {},
8350
+ ...showsVersion ? { datasetVersion: { datasetId: version.datasetId, versionId: version.versionId } } : {},
8351
+ ...rowOrigins === undefined ? {} : { rowOrigins }
8352
+ },
8353
+ propertyColumn: (propertyId) => columns?._tag === "ObjectProjectionDefinition" ? ownValue(columns.properties, propertyId) : undefined,
8354
+ linkColumns: (linkId) => columns ? linkColumns(columns, linkId) : undefined,
8355
+ origins: (names) => lineage ? visibleOrigins(reader, lineage, names) : undefined
8356
+ };
8357
+ }
8358
+ async function columnLineage(lakeStorage, pinned) {
8359
+ const version = await lakeStorage.getVersion(pinned.datasetId, pinned.versionId);
8360
+ if (!version)
8361
+ return;
8362
+ const lineage = versionLineage(version, lakeStorage);
8363
+ return isUnknownLineage(lineage) ? undefined : lineage;
8364
+ }
8365
+ function visibleOrigins(reader, lineage, columns) {
8366
+ const origins = new Map;
8367
+ for (const column of columns) {
8368
+ const refs = lineageColumn(lineage, column);
8369
+ if (refs === undefined)
8370
+ return;
8371
+ for (const ref of refs) {
8372
+ origins.set(JSON.stringify([ref.datasetId, ref.column]), ref);
8373
+ }
8374
+ }
8375
+ return visibleRefs(reader, [...origins.values()]);
8376
+ }
8377
+ function visibleRefs(reader, refs) {
8378
+ return refs.filter((ref) => {
8379
+ if (reader.canViewDataset(ref.datasetId))
8380
+ return true;
8381
+ reader.restrict(`dataset:${ref.datasetId}`);
8382
+ return false;
8383
+ });
8384
+ }
8385
+ function linkColumns(definition, linkId) {
8386
+ switch (definition._tag) {
8387
+ case "ObjectProjectionDefinition": {
8388
+ const foreignKey = ownValue(definition.links, linkId);
8389
+ if (!foreignKey)
8390
+ return;
8391
+ const column = foreignKey.sourceField ?? (foreignKey.sourcePropertyId === undefined ? undefined : ownValue(definition.properties, foreignKey.sourcePropertyId));
8392
+ return column === undefined ? undefined : [column];
8393
+ }
8394
+ case "LinkProjectionDefinition":
8395
+ return definition.linkId === linkId ? [definition.sourceField, definition.targetField] : undefined;
8396
+ case "TelemetryProjectionDefinition":
8397
+ return;
8398
+ }
8399
+ }
8400
+ function rootTarget(root) {
8401
+ return root.kind === "object" ? { objectTypeId: root.ref.objectTypeId } : {
8402
+ sourceObjectTypeId: root.ref.source.objectTypeId,
8403
+ targetObjectTypeId: root.ref.target.objectTypeId
8404
+ };
8405
+ }
8406
+ function ownValue(record, key) {
8407
+ return Object.hasOwn(record, key) ? record[key] : undefined;
8408
+ }
8409
+
8410
+ // src/lineage/sources.ts
8411
+ class LineageCommitReads {
8412
+ instants = new Set;
8413
+ commitIds = new Set;
8414
+ edit(lookup) {
8415
+ if (lookup.kind === "at")
8416
+ this.instants.add(lookup.instant);
8417
+ if (lookup.kind === "named")
8418
+ this.commitIds.add(lookup.commitId);
8419
+ }
8420
+ telemetry(commitId) {
8421
+ this.commitIds.add(commitId);
8422
+ }
8423
+ }
8424
+
8425
+ class LineageSources {
8426
+ projection;
8427
+ object;
8428
+ commitsAt;
8429
+ commitsNamed;
8430
+ attributions;
8431
+ #cited = {};
8432
+ constructor(projection, object, commitsAt, commitsNamed, attributions) {
8433
+ this.projection = projection;
8434
+ this.object = object;
8435
+ this.commitsAt = commitsAt;
8436
+ this.commitsNamed = commitsNamed;
8437
+ this.attributions = attributions;
8438
+ }
8439
+ static async read(input) {
8440
+ const { reader, dependencies, object, stored, reads } = input;
8441
+ const [projection, commitsAt, commitsNamed] = await Promise.all([
8442
+ stored ? describeProjection(reader, dependencies, stored) : null,
8443
+ editCommitsAt(reader, reads.instants),
8444
+ commitsById(reader, reads.commitIds)
8445
+ ]);
8446
+ const commits = [...[...commitsAt.values()].flat(), ...commitsNamed.values()];
8447
+ const attributions = await attributeCommits(reader, dependencies.projections, commits);
8448
+ return new LineageSources(projection, object, commitsAt, commitsNamed, attributions);
8449
+ }
8450
+ get cited() {
8451
+ return this.#cited;
8452
+ }
8453
+ citeProjection() {
8454
+ const projection = this.projection;
8455
+ if (!projection)
8456
+ throw new Error("[Sixb] Lineage cites a source row it did not read.");
8457
+ return this.#cite(projection.key, () => projection.source);
8458
+ }
8459
+ citeEdit(lookup) {
8460
+ switch (lookup.kind) {
8461
+ case "named":
8462
+ return this.#citeEditCommit(this.#named(lookup.commitId));
8463
+ case "at": {
8464
+ const commits = this.commitsAt.get(lookup.instant) ?? [];
8465
+ const commit = editCommitFor(commits, this.object, lookup.change);
8466
+ return commit ? this.#citeEditCommit(commit) : this.#citeUnknownEdit(lookup.instant);
8467
+ }
8468
+ case "unknown":
8469
+ return this.#citeUnknownEdit(lookup.instant);
8470
+ }
8471
+ }
8472
+ citeTelemetry(commitId) {
8473
+ const commit = this.#named(commitId);
8474
+ return this.#cite(`telemetry:${commit.id}`, () => telemetrySource(commit, this.attributions.get(commit.id)));
8475
+ }
8476
+ citeIdentity() {
8477
+ return this.#cite("identity", () => ({ kind: "identity" }));
8478
+ }
8479
+ #citeEditCommit(commit) {
8480
+ return this.#cite(`commit:${commit.id}`, () => editSource(commit, this.attributions.get(commit.id)));
8481
+ }
8482
+ #citeUnknownEdit(instant) {
8483
+ return this.#cite(`commit@${instant}`, () => ({
8484
+ kind: "edit",
8485
+ commitId: null,
8486
+ committedAt: instant
8487
+ }));
8488
+ }
8489
+ #cite(key, describe) {
8490
+ this.#cited[key] ??= describe();
8491
+ return key;
8492
+ }
8493
+ #named(commitId) {
8494
+ const commit = this.commitsNamed.get(commitId);
8495
+ if (!commit)
8496
+ throw new Error(`[Sixb] Lineage cites commit '${commitId}' it did not read.`);
8497
+ return commit;
8498
+ }
8499
+ }
8500
+
8501
+ // src/lineage/link.ts
8502
+ async function explainLink(runtime, dependencies, ref) {
8503
+ const reader = LineageReader.for(runtime);
8504
+ if (!reader)
8505
+ return null;
8506
+ const endpoints = await reader.readObjects([ref.source, ref.target]);
8507
+ if (!endpoints || !await reader.canReadLink(ref.source.objectTypeId, ref.linkId))
8508
+ return null;
8509
+ const state = await runtime.storage.ontology.materializations.readState({
8510
+ projectId: runtime.projectId,
8511
+ objects: [ref.source, ref.target],
8512
+ links: [ref],
8513
+ linkScopes: []
8514
+ });
8515
+ const link = state.links[0];
8516
+ if (!link)
8517
+ return null;
8518
+ const effective = new Set(state.objects.flatMap((object) => object.effective ? [objectRefKey2(object.ref)] : []));
8519
+ const cardinality = linkCardinality(runtime.ontology, ref);
8520
+ const authority = linkAuthority(cardinality, link, (object) => effective.has(objectRefKey2(object)));
8521
+ if (!authority)
8522
+ return null;
8523
+ const override = cardinality === "one" ? link.slotOverride : link.override;
8524
+ const reads = new LineageCommitReads;
8525
+ if (authority === "override" && override) {
8526
+ reads.edit({ kind: "named", commitId: override.lastCommitId });
8527
+ }
8528
+ const sources = await LineageSources.read({
8529
+ reader,
8530
+ dependencies,
8531
+ object: ref.source,
8532
+ stored: authority === "source" ? link.source : null,
8533
+ reads
8534
+ });
8535
+ return {
8536
+ sourceTypeId: ref.source.objectTypeId,
8537
+ sourceId: ref.source.primaryId,
8538
+ linkId: ref.linkId,
8539
+ targetTypeId: ref.target.objectTypeId,
8540
+ targetId: ref.target.primaryId,
8541
+ existence: existence(sources, authority, override?.lastCommitId, ref.linkId),
8542
+ sources: sources.cited,
8543
+ restricted: reader.restricted
8544
+ };
8545
+ }
8546
+ function linkAuthority(cardinality, link, endpointExists) {
8547
+ let authority = null;
8548
+ const record = (decided) => {
8549
+ authority = decided;
8550
+ };
8551
+ const resolved = cardinality === "one" ? resolveEffectiveLinkSlotMember({
8552
+ ref: link.ref,
8553
+ source: link.source,
8554
+ override: usableLinkSlotOverride(link.slotOverride),
8555
+ endpointExists
8556
+ }, record) : resolveEffectiveLink({
8557
+ ref: link.ref,
8558
+ source: link.source,
8559
+ override: link.override?.value ?? null,
8560
+ sourceEndpointExists: endpointExists(link.ref.source),
8561
+ targetEndpointExists: endpointExists(link.ref.target)
8562
+ }, record);
8563
+ return resolved ? authority : null;
8564
+ }
8565
+ function existence(sources, authority, overrideCommitId, linkId) {
8566
+ if (authority === "override") {
8567
+ if (overrideCommitId === undefined) {
8568
+ throw new Error("[Sixb] Lineage found a link override authority without its override.");
8569
+ }
8570
+ return { source: sources.citeEdit({ kind: "named", commitId: overrideCommitId }) };
8571
+ }
8572
+ const columns = sources.projection?.linkColumns(linkId);
8573
+ const origins = columns === undefined ? undefined : sources.projection?.origins(columns);
8574
+ return {
8575
+ source: sources.citeProjection(),
8576
+ ...columns === undefined ? {} : { columns },
8577
+ ...origins === undefined ? {} : { origins }
8578
+ };
8579
+ }
8580
+
8581
+ // src/lineage/object.ts
8582
+ async function explainObject(runtime, dependencies, ref) {
8583
+ const reader = LineageReader.for(runtime);
8584
+ if (!reader)
8585
+ return null;
8586
+ const [row] = await reader.readObjects([ref]) ?? [];
8587
+ if (!row)
8588
+ return null;
8589
+ const { objects } = await runtime.storage.ontology.materializations.readState({
8590
+ projectId: runtime.projectId,
8591
+ objects: [ref],
8592
+ links: [],
8593
+ linkScopes: []
8594
+ });
8595
+ const state = objects[0];
8596
+ if (!state?.effective)
8597
+ return null;
8598
+ const explained = explainEffectiveObject({
8599
+ ref,
8600
+ primaryPropertyId: runtime.ontology.getPrimaryPropertyId(ref.objectTypeId),
8601
+ source: state.source,
8602
+ override: state.override?.value ?? null,
8603
+ editedAt: storedObjectEditedAt(state.override),
8604
+ latestTelemetry: state.latestTelemetry
8605
+ });
8606
+ if (!explained)
8607
+ return null;
8608
+ const redacted = new Set(Object.keys(row.redactions ?? {}));
8609
+ const decided = inTypeOrder(runtime, ref.objectTypeId, explained.properties).filter(([propertyId]) => !redacted.has(propertyId));
8610
+ const override = state.override;
8611
+ const created = {
8612
+ kind: "at",
8613
+ instant: state.effective.createdAt,
8614
+ change: "created"
8615
+ };
8616
+ const reads = new LineageCommitReads;
8617
+ if (explained.existence === "create")
8618
+ reads.edit(created);
8619
+ for (const [propertyId, authority] of decided) {
8620
+ if (authority.kind === "telemetry")
8621
+ reads.telemetry(authority.point.lastCommitId);
8622
+ if (authority.kind === "edit" || authority.kind === "source" && authority.wonOver) {
8623
+ reads.edit(editLookup(override, propertyId));
8624
+ }
8625
+ }
8626
+ const sources = await LineageSources.read({
8627
+ reader,
8628
+ dependencies,
8629
+ object: ref,
8630
+ stored: state.source,
8631
+ reads
8632
+ });
8633
+ const existence = explained.existence === "source" ? sources.citeProjection() : sources.citeEdit(created);
8634
+ const properties = Object.fromEntries(decided.map(([propertyId, authority]) => [
8635
+ propertyId,
8636
+ propertyLineage({ sources, explained, override, propertyId, authority })
8637
+ ]));
8638
+ return {
8639
+ objectTypeId: ref.objectTypeId,
8640
+ primaryId: ref.primaryId,
8641
+ existence: { source: existence },
8642
+ sources: sources.cited,
8643
+ properties,
8644
+ restricted: reader.restricted
8645
+ };
8646
+ }
8647
+ function propertyLineage(input) {
8648
+ const { sources, explained, override, propertyId, authority } = input;
8649
+ const edit = () => sources.citeEdit(editLookup(override, propertyId));
8650
+ const removed = Object.hasOwn(explained.value.properties, propertyId) ? {} : { removed: true };
8651
+ switch (authority.kind) {
8652
+ case "identity":
8653
+ return { source: sources.citeIdentity() };
8654
+ case "telemetry":
8655
+ return {
8656
+ source: sources.citeTelemetry(authority.point.lastCommitId),
8657
+ at: authority.point.at
8658
+ };
8659
+ case "source": {
8660
+ const column = sources.projection?.propertyColumn(propertyId);
8661
+ const origins = column === undefined ? undefined : sources.projection?.origins([column]);
8662
+ const lineage = {
8663
+ source: sources.citeProjection(),
8664
+ ...column === undefined ? {} : { column },
8665
+ ...origins === undefined ? {} : { origins },
8666
+ ...removed
8667
+ };
8668
+ const { wonOver } = authority;
8669
+ if (!wonOver)
8670
+ return lineage;
8671
+ return {
8672
+ ...lineage,
8673
+ replaced: { source: edit(), ...candidateValue(wonOver.candidate) },
8674
+ resolution: {
8675
+ strategy: "mostRecent",
8676
+ sourceUpdatedAt: wonOver.sourceUpdatedAt,
8677
+ editedAt: wonOver.editedAt
8678
+ }
8679
+ };
8680
+ }
8681
+ case "edit": {
8682
+ const { wonOver } = authority;
8683
+ if (!wonOver)
8684
+ return { source: edit(), ...removed };
8685
+ const column = sources.projection?.propertyColumn(propertyId);
8686
+ return {
8687
+ source: edit(),
8688
+ ...removed,
8689
+ replaced: {
8690
+ source: sources.citeProjection(),
8691
+ ...column === undefined ? {} : { column },
8692
+ ...candidateValue(wonOver.candidate)
8693
+ },
8694
+ resolution: resolution(wonOver.sourceUpdatedAt, authority.editedAt)
8695
+ };
8696
+ }
8697
+ }
8698
+ }
8699
+ function editLookup(override, propertyId) {
8700
+ if (!override) {
8701
+ throw new Error(`[Sixb] Lineage found an edit of '${propertyId}' with no override.`);
8702
+ }
8703
+ const instant = override.editedAt?.[propertyId];
8704
+ if (instant === undefined)
8705
+ return { kind: "unknown", instant: override.updatedAt };
8706
+ return { kind: "at", instant, change: { propertyId } };
8707
+ }
8708
+ function resolution(sourceUpdatedAt, editedAt) {
8709
+ if (sourceUpdatedAt === undefined)
8710
+ return { strategy: "editsWin" };
8711
+ return {
8712
+ strategy: "mostRecent",
8713
+ sourceUpdatedAt,
8714
+ ...editedAt === undefined ? {} : { editedAt }
8715
+ };
8716
+ }
8717
+ function candidateValue(candidate) {
8718
+ return candidate.present ? { value: candidate.value } : {};
8719
+ }
8720
+ function inTypeOrder(runtime, objectTypeId, properties) {
8721
+ const ordered = new Map;
8722
+ for (const { id } of runtime.ontology.resolveObjectType(objectTypeId).properties) {
8723
+ const authority = properties.get(id);
8724
+ if (authority)
8725
+ ordered.set(id, authority);
8726
+ }
8727
+ for (const [id, authority] of properties) {
8728
+ if (!ordered.has(id))
8729
+ ordered.set(id, authority);
8730
+ }
8731
+ return [...ordered];
8732
+ }
8733
+
7823
8734
  // src/objects/context/resolve.ts
7824
8735
  function requireLinkDefinition2(objectType, linkId) {
7825
8736
  const def = objectType.links.find((l) => l.id === linkId);
@@ -8019,6 +8930,16 @@ function createObjectSet2(params) {
8019
8930
  targetTypeId: input.targetTypeId,
8020
8931
  targetId: input.targetId
8021
8932
  });
8933
+ },
8934
+ lineage: (id) => explainObject(params, params.lineage, { objectTypeId: objectType.id, primaryId: id }),
8935
+ linkLineage: async (input) => {
8936
+ const linkDefinition = requireLinkDefinition2(objectType, input.linkId);
8937
+ assertLinkTargetType2(objectType.id, input.linkId, linkDefinition, input.targetTypeId, (expected, actual) => ontology.isValidLinkTarget(expected, actual));
8938
+ return explainLink(params, params.lineage, {
8939
+ source: { objectTypeId: objectType.id, primaryId: input.sourceId },
8940
+ linkId: input.linkId,
8941
+ target: { objectTypeId: input.targetTypeId, primaryId: input.targetId }
8942
+ });
8022
8943
  }
8023
8944
  };
8024
8945
  return objectSet;
@@ -8108,7 +9029,7 @@ async function appendTelemetry(runtime, objectTypeId, items) {
8108
9029
  await appendTelemetryBatch2(ctx, items);
8109
9030
  }
8110
9031
  // src/objects/execution.ts
8111
- function createObjectsRuntime(runtime, execution, blobStorage) {
9032
+ function createObjectsRuntime(runtime, execution, blobStorage, lineage) {
8112
9033
  const runtimeAuthorization = runtime.runtimeAuthorization;
8113
9034
  const objectReader = runtime.objectReader;
8114
9035
  assertAuthorizedObjectReaderBinding({
@@ -8140,7 +9061,8 @@ function createObjectsRuntime(runtime, execution, blobStorage) {
8140
9061
  ...capturedRuntime,
8141
9062
  execution,
8142
9063
  objectType,
8143
- blobStorage
9064
+ blobStorage,
9065
+ lineage
8144
9066
  });
8145
9067
  }, {
8146
9068
  listTypes: () => ontologyView().listObjectTypes(),
@@ -8470,6 +9392,7 @@ class ShareError2 extends Error {
8470
9392
  this.reason = reason;
8471
9393
  }
8472
9394
  }
9395
+ var REVOKING_PRIMITIVE_KINDS = new Set(["action", "workflow"]);
8473
9396
  function createSharesRuntime(runtime, execution, definitions) {
8474
9397
  const managementPrincipal = () => {
8475
9398
  const authority = resolveExecutionScopeAuthorization(runtime.projectId, {
@@ -8484,6 +9407,18 @@ function createSharesRuntime(runtime, execution, definitions) {
8484
9407
  id: authority.context.principal.id
8485
9408
  };
8486
9409
  };
9410
+ const revocationActor = () => {
9411
+ const authority = resolveExecutionScopeAuthorization(runtime.projectId, {
9412
+ execution,
9413
+ authorization: runtime.runtimeAuthorization
9414
+ });
9415
+ if (authority.type === "unrestricted" && authority.ref.type === "trustedPrimitive") {
9416
+ const { kind, id } = authority.ref.primitive;
9417
+ if (REVOKING_PRIMITIVE_KINDS.has(kind))
9418
+ return { type: "system", id: `${kind}:${id}` };
9419
+ }
9420
+ return managementPrincipal();
9421
+ };
8487
9422
  const canManage = (shareId) => {
8488
9423
  try {
8489
9424
  managementPrincipal();
@@ -8607,7 +9542,7 @@ function createSharesRuntime(runtime, execution, definitions) {
8607
9542
  });
8608
9543
  },
8609
9544
  revoke: async (grantId) => {
8610
- const actor = managementPrincipal();
9545
+ const actor = revocationActor();
8611
9546
  const storage = requireShareStorage(runtime);
8612
9547
  if (typeof grantId !== "string" || !grantId.trim()) {
8613
9548
  throw new ShareError2("invalid_input", "[Sixb] Shared access grant id must not be empty.");
@@ -8620,7 +9555,7 @@ function createSharesRuntime(runtime, execution, definitions) {
8620
9555
  }
8621
9556
  if (!current)
8622
9557
  return null;
8623
- if (!definitions.getById(current.definitionId) || !canManage(current.definitionId)) {
9558
+ if (!definitions.getById(current.definitionId) || actor.type !== "system" && !canManage(current.definitionId)) {
8624
9559
  return null;
8625
9560
  }
8626
9561
  try {
@@ -9009,7 +9944,10 @@ function createExecutionFacades(runtime, execution, dependencies) {
9009
9944
  const session = runtime.modelExecution ?? new ModelExecutionSession(runtime, execution);
9010
9945
  const agent = createAgentRuntime(runtime, execution, dependencies.definitions.models, createDecisionRuntime(runtime, execution, dependencies.definitions.models, session, "agent.run"), dependencies.sandbox, dependencies.definitions.security);
9011
9946
  return {
9012
- objects: createObjectsRuntime(runtime, execution, dependencies.blobStorage),
9947
+ objects: createObjectsRuntime(runtime, execution, dependencies.blobStorage, {
9948
+ projections: dependencies.definitions.projections,
9949
+ lakeStorage: dependencies.lakeStorage
9950
+ }),
9013
9951
  actions,
9014
9952
  datasets: createDatasetsRuntime(runtime, execution, dependencies.definitions.datasets, dependencies.lakeStorage, dependencies.blobStorage, dependencies.datasetVersionMarkings),
9015
9953
  workflows,
@@ -9324,6 +10262,11 @@ function toActionRuntimeFacade(runtime) {
9324
10262
  connector: runtime.sixb.connector,
9325
10263
  models: runtime.sixb.models,
9326
10264
  users: runtime.sixb.users,
10265
+ shares: {
10266
+ revoke(grantId) {
10267
+ return runtime.sixb.shares.revoke(grantId);
10268
+ }
10269
+ },
9327
10270
  objects(objectType) {
9328
10271
  return {
9329
10272
  appendTelemetryBatch(items) {
@@ -9364,7 +10307,8 @@ function createBasePhaseContext(input) {
9364
10307
  logger: input.logger,
9365
10308
  params: coerceActionParamsToTyped(input.action.params, run.params, input.runtime.sixb.objects.getValueTypesById()),
9366
10309
  subject: run.subject,
9367
- requestedBy: input.runtime.requestedBy
10310
+ requestedBy: input.runtime.requestedBy,
10311
+ client: input.runtime.client
9368
10312
  };
9369
10313
  }
9370
10314
  async function loadObjectTarget(input) {
@@ -10319,7 +11263,7 @@ async function executeActionRun(host, input) {
10319
11263
  primitive: { kind: "action", id: run.actionId, runId: run.id }
10320
11264
  });
10321
11265
  return await runAction({
10322
- runtime: buildActionContext(host, actionRuns, bound, input.readSubjectAsRequester),
11266
+ runtime: buildActionContext(host, actionRuns, bound, input),
10323
11267
  run,
10324
11268
  signals
10325
11269
  });
@@ -10334,14 +11278,16 @@ function requireActionRunStorage(host, runId) {
10334
11278
  }
10335
11279
  return actionRuns;
10336
11280
  }
10337
- function buildActionContext(host, actionRunsStorage, execution, readSubjectAsRequester) {
11281
+ function buildActionContext(host, actionRunsStorage, execution, input) {
11282
+ const { readSubjectAsRequester } = input;
10338
11283
  const sixb = {
10339
11284
  models: execution.sixb.models,
10340
11285
  objects: execution.sixb.objects,
10341
11286
  actions: execution.sixb.actions,
10342
11287
  connector: execution.sixb.connector,
10343
11288
  blobs: execution.sixb.blobs,
10344
- users: execution.sixb.users
11289
+ users: execution.sixb.users,
11290
+ shares: execution.sixb.shares
10345
11291
  };
10346
11292
  return {
10347
11293
  id: host.id,
@@ -10353,6 +11299,7 @@ function buildActionContext(host, actionRunsStorage, execution, readSubjectAsReq
10353
11299
  sixb,
10354
11300
  actions: host.definitions.actions,
10355
11301
  requestedBy: execution.sixb.execution.requestedBy,
11302
+ client: input.client,
10356
11303
  ...readSubjectAsRequester === undefined ? {} : { readSubjectAsRequester }
10357
11304
  };
10358
11305
  }
@@ -10440,7 +11387,8 @@ class ActionRunExecutor {
10440
11387
  run,
10441
11388
  execution,
10442
11389
  signal: request.signal,
10443
- ...request.readSubjectAsRequester === undefined ? {} : { readSubjectAsRequester: request.readSubjectAsRequester }
11390
+ ...request.readSubjectAsRequester === undefined ? {} : { readSubjectAsRequester: request.readSubjectAsRequester },
11391
+ ...request.client === undefined ? {} : { client: request.client }
10444
11392
  });
10445
11393
  } catch (error) {
10446
11394
  throw this.failRequest(run, error);
@@ -10573,6 +11521,7 @@ async function requestAction3(runtime, execution, input) {
10573
11521
  }
10574
11522
  });
10575
11523
  const conditioned = authorization.type === "principal" && subject.kind === "object" && objectReader.viewsThroughCondition(subject.objectTypeId);
11524
+ const client = getRequestClient(execution);
10576
11525
  const run = await executor.request({
10577
11526
  runId,
10578
11527
  payload,
@@ -10580,6 +11529,7 @@ async function requestAction3(runtime, execution, input) {
10580
11529
  assertCanReuse,
10581
11530
  signal: request.signal,
10582
11531
  onRequested: request.onRequested,
11532
+ ...client === undefined ? {} : { client },
10583
11533
  ...conditioned ? {
10584
11534
  readSubjectAsRequester: ({ objectTypeId, primaryId }) => objectReader.getByPrimaryId({ objectTypeId, primaryId })
10585
11535
  } : {}
@@ -10747,6 +11697,6 @@ function snapshotActionRequest(input) {
10747
11697
  ...onRequested === undefined ? {} : { onRequested }
10748
11698
  };
10749
11699
  }
10750
- export { defineAction2, param2, optional2, ActionRegistry2, bindModelExecutionAttempt, canInheritAgentRequestAuthorization2, createAgentExecutionRecord2, createInheritedAgentExecutionRecord2, bindDurableAgentExecution2, bindAgentRunRequestExecution2, bindAgentModelExecution2, restoreAgentExecutionScope2, assertAgentExecutionRecord2, resumeDecidedAgentTurn2, agentRunApprovalMode2, holdAgentApprovalCall2, approvalCallSummary2, listChildApprovalsAwaiting2, isAwaitingApprovalRun2, isPausedSubagentRun2, AGENT_APPROVAL_EXECUTION_LEASE_MS2, turnResumeReadiness2, turnPausesOnHeldCalls2, hasActiveChildren2, listTurnApprovals2, stopAgentTurn2, announceAgentApprovals2, agentApprovalCallers2, AgentRunScopeError2, resolveAgentRunExecutionScope2, createAgentApprovalExecutor, registerAgentApprovalExecutor, getAgentApprovalExecutor2, requestAgentRunCancel2, isAwaitingAnswerRun2, deferredChildQuestion2, listSubagentThreadRuns2, subagentSandboxFiles2, assertTurnModelRouting, DEFAULT_PROJECT_LOCALE, DEFAULT_PROJECT_TIME_ZONE, canonicalLocale, canonicalTimeZone, resolveAgentContextParts2, agentRunQueueJobId2, workflowAgentNodeQueueJobId2, dispatchQueuedAgentRuns2, assertNoAgentDefinitions, requestAgentRun2, isRetryableAgentRun2, retryAgentRun2, WorkflowDefinitionError2, WorkflowValidationError2, assertNonEmpty, isStepDefinition2, isAgentStepDefinition2, isInterventionDefinition2, isWorkflowDefinition2, validateWorkflowDefinition2, validateWorkflowsAtStartup2, validateWorkflowAgentStepGroupReferences2, validateWorkflowInput2, validateWorkflowStepInput2, validateWorkflowStepOutput2, validateWorkflowInterventionInput2, validateWorkflowInterventionResponse2, validateWorkflowInterventionDefaultResponse2, assertAgentStepSandbox, validateWorkflowAgentStepInput2, validateWorkflowAgentStepOutput2, snapshotWorkflowAgentStepInput2, snapshotWorkflowAgentStepOutput2, snapshotWorkflowInput2, snapshotWorkflowStepInput2, snapshotWorkflowStepOutput2, snapshotWorkflowInterventionInput2, snapshotWorkflowInterventionResponse2, snapshotWorkflowInterventionDefaultResponse2, snapshotWorkflowActionInput2, WorkflowRunDispatcher2, requestWorkflowRun2, prepareBoundActionRequest2, prepareBoundWorkflowRequest2, runModelLoop2, requestAction2, ObjectError2, removeLink2, upsertLink2, upsertLinkBatch2, deleteObject2, restoreObject2, upsertObject2, upsertObjectBatch2, writeTelemetryBatch2, appendTelemetryBatch2, getTelemetryHistoryBatch2, requireLinkDefinition2, resolveObjectContext2, resolveLinkContext2, createObjectSet2, exports_service, ShareError2, createBoundSixb, isBoundSixb, bindDurablePrimitiveExecution2, ACTION_RUN_DRAIN_TIMEOUT_MS2, ActionRunExecutor, registerActionRunExecutor, drainActionRuns2, requestAction3 };
11700
+ export { defineAction2, param2, optional2, ActionRegistry2, bindRequestClient, bindModelExecutionAttempt, canInheritAgentRequestAuthorization2, createAgentExecutionRecord2, createInheritedAgentExecutionRecord2, bindDurableAgentExecution2, bindAgentRunRequestExecution2, bindAgentModelExecution2, restoreAgentExecutionScope2, assertAgentExecutionRecord2, resumeDecidedAgentTurn2, agentRunApprovalMode2, holdAgentApprovalCall2, approvalCallSummary2, listChildApprovalsAwaiting2, isAwaitingApprovalRun2, isPausedSubagentRun2, AGENT_APPROVAL_EXECUTION_LEASE_MS2, turnResumeReadiness2, turnPausesOnHeldCalls2, hasActiveChildren2, listTurnApprovals2, stopAgentTurn2, announceAgentApprovals2, agentApprovalCallers2, AgentRunScopeError2, resolveAgentRunExecutionScope2, createAgentApprovalExecutor, registerAgentApprovalExecutor, getAgentApprovalExecutor2, requestAgentRunCancel2, isAwaitingAnswerRun2, deferredChildQuestion2, listSubagentThreadRuns2, subagentSandboxFiles2, assertTurnModelRouting, DEFAULT_PROJECT_LOCALE, DEFAULT_PROJECT_TIME_ZONE, canonicalLocale, canonicalTimeZone, resolveAgentContextParts2, agentRunQueueJobId2, workflowAgentNodeQueueJobId2, dispatchQueuedAgentRuns2, assertNoAgentDefinitions, requestAgentRun2, isRetryableAgentRun2, retryAgentRun2, WorkflowDefinitionError2, WorkflowValidationError2, assertNonEmpty, isStepDefinition2, isAgentStepDefinition2, isInterventionDefinition2, isWorkflowDefinition2, validateWorkflowDefinition2, validateWorkflowsAtStartup2, validateWorkflowAgentStepGroupReferences2, validateWorkflowInput2, validateWorkflowStepInput2, validateWorkflowStepOutput2, validateWorkflowInterventionInput2, validateWorkflowInterventionResponse2, validateWorkflowInterventionDefaultResponse2, assertAgentStepSandbox, validateWorkflowAgentStepInput2, validateWorkflowAgentStepOutput2, snapshotWorkflowAgentStepInput2, snapshotWorkflowAgentStepOutput2, snapshotWorkflowInput2, snapshotWorkflowStepInput2, snapshotWorkflowStepOutput2, snapshotWorkflowInterventionInput2, snapshotWorkflowInterventionResponse2, snapshotWorkflowInterventionDefaultResponse2, snapshotWorkflowActionInput2, WorkflowRunDispatcher2, requestWorkflowRun2, prepareBoundActionRequest2, prepareBoundWorkflowRequest2, runModelLoop2, requestAction2, ObjectError2, removeLink2, upsertLink2, upsertLinkBatch2, deleteObject2, restoreObject2, upsertObject2, upsertObjectBatch2, writeTelemetryBatch2, appendTelemetryBatch2, getTelemetryHistoryBatch2, requireLinkDefinition2, resolveObjectContext2, resolveLinkContext2, createObjectSet2, exports_service, ShareError2, createBoundSixb, isBoundSixb, bindDurablePrimitiveExecution2, ACTION_RUN_DRAIN_TIMEOUT_MS2, ActionRunExecutor, registerActionRunExecutor, drainActionRuns2, requestAction3 };
10751
11701
 
10752
- //# debugId=0B9B06CB5085066064756E2164756E21
11702
+ //# debugId=085F7BE3ABE9572264756E2164756E21