@sixb/core 0.2.0 → 0.2.2

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 (337) hide show
  1. package/dist/actions/index.js +30 -30
  2. package/dist/agents/cancel.d.ts.map +1 -1
  3. package/dist/agents/index.d.ts +5 -3
  4. package/dist/agents/index.d.ts.map +1 -1
  5. package/dist/agents/index.js +39 -33
  6. package/dist/agents/index.js.map +1 -1
  7. package/dist/agents/run-plan.d.ts +15 -1
  8. package/dist/agents/run-plan.d.ts.map +1 -1
  9. package/dist/agents/run-session-http.d.ts.map +1 -1
  10. package/dist/agents/run-session-serve.d.ts.map +1 -1
  11. package/dist/agents/run-session.d.ts +14 -2
  12. package/dist/agents/run-session.d.ts.map +1 -1
  13. package/dist/agents/skills.d.ts +3 -0
  14. package/dist/agents/skills.d.ts.map +1 -1
  15. package/dist/agents/step-limits.d.ts +6 -0
  16. package/dist/agents/step-limits.d.ts.map +1 -1
  17. package/dist/agents/streams/index.js +1 -1
  18. package/dist/agents/streams/internal.js +1 -1
  19. package/dist/agents/streams/protocol.d.ts +8 -2
  20. package/dist/agents/streams/protocol.d.ts.map +1 -1
  21. package/dist/agents/tool-files.d.ts +3 -1
  22. package/dist/agents/tool-files.d.ts.map +1 -1
  23. package/dist/agents/validation.d.ts +1 -1
  24. package/dist/agents/validation.d.ts.map +1 -1
  25. package/dist/agents/web.d.ts +47 -0
  26. package/dist/agents/web.d.ts.map +1 -0
  27. package/dist/artifacts/publish/index.js +17 -17
  28. package/dist/auth/index.js +3 -3
  29. package/dist/authorization/index.js +2 -2
  30. package/dist/authorization/resolve.d.ts +4 -3
  31. package/dist/authorization/resolve.d.ts.map +1 -1
  32. package/dist/authorization/types.d.ts +5 -5
  33. package/dist/authorization/types.d.ts.map +1 -1
  34. package/dist/bootstrap/index.js +38 -38
  35. package/dist/{chunk-neftrg0n.js → chunk-0j3crh1w.js} +2 -2
  36. package/dist/{chunk-8dcfj58k.js → chunk-2ajw5rz0.js} +14 -10
  37. package/dist/chunk-2ajw5rz0.js.map +18 -0
  38. package/dist/{chunk-23s66j86.js → chunk-31kcqmhf.js} +1 -1
  39. package/dist/{chunk-nghc7eq0.js → chunk-3723kgba.js} +1 -1
  40. package/dist/{chunk-fdkpkkpw.js → chunk-3sqqhpr7.js} +5 -5
  41. package/dist/{chunk-m3qe54bb.js → chunk-4bm0caep.js} +1 -1
  42. package/dist/{chunk-ztf5vtmp.js → chunk-4s753g3k.js} +41 -10
  43. package/dist/chunk-4s753g3k.js.map +12 -0
  44. package/dist/{chunk-fntqb7qy.js → chunk-57g0215c.js} +1 -1
  45. package/dist/{chunk-8wsjr52f.js → chunk-5wtnmpze.js} +1 -1
  46. package/dist/{chunk-edx8xcsm.js → chunk-7z5rkf0m.js} +29 -6
  47. package/dist/chunk-7z5rkf0m.js.map +13 -0
  48. package/dist/{chunk-2pk5hjj9.js → chunk-80gym75n.js} +1 -1
  49. package/dist/{chunk-qbrmpgvv.js → chunk-9whfmsfk.js} +1 -1
  50. package/dist/{chunk-qya541bk.js → chunk-a5v4gjdx.js} +31 -28
  51. package/dist/{chunk-qya541bk.js.map → chunk-a5v4gjdx.js.map} +4 -4
  52. package/dist/{chunk-he7g39e5.js → chunk-a7aa0nzj.js} +7 -7
  53. package/dist/{chunk-tvefbgvw.js → chunk-az95tsh3.js} +4 -2
  54. package/dist/chunk-az95tsh3.js.map +11 -0
  55. package/dist/{chunk-7hd2ez3q.js → chunk-c4nrycdy.js} +1 -1
  56. package/dist/{chunk-ekkpzcka.js → chunk-c706qvyc.js} +36 -9
  57. package/dist/chunk-c706qvyc.js.map +11 -0
  58. package/dist/{chunk-n54k068r.js → chunk-c7cfe31p.js} +7 -7
  59. package/dist/{chunk-qsg8rw04.js → chunk-d04g36fw.js} +1 -1
  60. package/dist/{chunk-hjy3dsws.js → chunk-dsv783c3.js} +305 -32
  61. package/dist/{chunk-hjy3dsws.js.map → chunk-dsv783c3.js.map} +12 -10
  62. package/dist/{chunk-peggaard.js → chunk-e6xgz4h4.js} +20 -2
  63. package/dist/{chunk-peggaard.js.map → chunk-e6xgz4h4.js.map} +5 -3
  64. package/dist/{chunk-e99kp9jh.js → chunk-eqgr6nsa.js} +86 -30
  65. package/dist/{chunk-e99kp9jh.js.map → chunk-eqgr6nsa.js.map} +10 -9
  66. package/dist/{chunk-f2w6328x.js → chunk-f1h34y3r.js} +6 -6
  67. package/dist/{chunk-9rh8ncs5.js → chunk-fwsvshr5.js} +1 -1
  68. package/dist/{chunk-c78jjzhy.js → chunk-ga63a3dz.js} +6 -6
  69. package/dist/{chunk-c78jjzhy.js.map → chunk-ga63a3dz.js.map} +2 -2
  70. package/dist/{chunk-cgznz22f.js → chunk-gkv8r794.js} +2 -2
  71. package/dist/{chunk-d3t26vah.js → chunk-j1ny5fwh.js} +35 -11
  72. package/dist/chunk-j1ny5fwh.js.map +15 -0
  73. package/dist/{chunk-8hvfs0fr.js → chunk-j8thxj7w.js} +4 -4
  74. package/dist/{chunk-855n80en.js → chunk-jjmggm9a.js} +1 -1
  75. package/dist/{chunk-31khg3g0.js → chunk-kkjfve0t.js} +73 -2
  76. package/dist/{chunk-31khg3g0.js.map → chunk-kkjfve0t.js.map} +3 -3
  77. package/dist/{chunk-fb3m4sa1.js → chunk-m2vh8gh0.js} +8 -14
  78. package/dist/{chunk-fb3m4sa1.js.map → chunk-m2vh8gh0.js.map} +3 -3
  79. package/dist/{chunk-vkweppkw.js → chunk-mbc5hvnj.js} +3 -3
  80. package/dist/{chunk-jk97v21j.js → chunk-n4zzaf6q.js} +3 -2
  81. package/dist/chunk-n4zzaf6q.js.map +10 -0
  82. package/dist/{chunk-y2x2935j.js → chunk-nh26e7c5.js} +2 -2
  83. package/dist/{chunk-jhbk10wf.js → chunk-q9nkpr8k.js} +1 -1
  84. package/dist/{chunk-47e09r7z.js → chunk-qttqe1ah.js} +86 -6
  85. package/dist/{chunk-47e09r7z.js.map → chunk-qttqe1ah.js.map} +5 -4
  86. package/dist/{chunk-9mab3dvg.js → chunk-s038wa5v.js} +9 -1
  87. package/dist/{chunk-9mab3dvg.js.map → chunk-s038wa5v.js.map} +3 -3
  88. package/dist/{chunk-3x3bebz7.js → chunk-s7j8ewqv.js} +161 -62
  89. package/dist/{chunk-3x3bebz7.js.map → chunk-s7j8ewqv.js.map} +7 -6
  90. package/dist/{chunk-dz7a4t3a.js → chunk-twfreyxr.js} +5 -10
  91. package/dist/{chunk-dz7a4t3a.js.map → chunk-twfreyxr.js.map} +4 -4
  92. package/dist/{chunk-semf1yqn.js → chunk-w1btn96n.js} +51 -26
  93. package/dist/{chunk-semf1yqn.js.map → chunk-w1btn96n.js.map} +6 -6
  94. package/dist/{chunk-fg1db9xx.js → chunk-wkq3kvzd.js} +5 -5
  95. package/dist/chunk-wkq3kvzd.js.map +10 -0
  96. package/dist/{chunk-xj97s5js.js → chunk-wrjx1fqz.js} +6 -6
  97. package/dist/{chunk-agn8d8ys.js → chunk-xtztwpkh.js} +1 -1
  98. package/dist/{chunk-0g5nyx0k.js → chunk-zeykm8my.js} +2 -2
  99. package/dist/connectors/connections/runs.d.ts +7 -0
  100. package/dist/connectors/connections/runs.d.ts.map +1 -1
  101. package/dist/datasets/execution.d.ts.map +1 -1
  102. package/dist/events/index.js +1 -1
  103. package/dist/events/selectors/index.js +1 -1
  104. package/dist/events/selectors/predicate.d.ts.map +1 -1
  105. package/dist/events/types/datasets.d.ts +6 -0
  106. package/dist/events/types/datasets.d.ts.map +1 -1
  107. package/dist/execution/agent.js +30 -30
  108. package/dist/execution/object-reader-security.d.ts.map +1 -1
  109. package/dist/execution/primitive.js +30 -30
  110. package/dist/execution/request.js +31 -31
  111. package/dist/index.d.ts +2 -2
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +42 -42
  114. package/dist/lake-storage/in-memory.d.ts.map +1 -1
  115. package/dist/lake-storage/index.d.ts +2 -2
  116. package/dist/lake-storage/index.d.ts.map +1 -1
  117. package/dist/lake-storage/index.js +6 -2
  118. package/dist/lake-storage/index.js.map +1 -1
  119. package/dist/lake-storage/source-ordering.d.ts +7 -0
  120. package/dist/lake-storage/source-ordering.d.ts.map +1 -1
  121. package/dist/lake-storage/types.d.ts +18 -0
  122. package/dist/lake-storage/types.d.ts.map +1 -1
  123. package/dist/lake-storage/version-inputs.d.ts +11 -3
  124. package/dist/lake-storage/version-inputs.d.ts.map +1 -1
  125. package/dist/materializer/index.js +16 -16
  126. package/dist/models/catalog.d.ts +16 -0
  127. package/dist/models/catalog.d.ts.map +1 -1
  128. package/dist/models/definitions.d.ts +1 -1
  129. package/dist/models/definitions.d.ts.map +1 -1
  130. package/dist/models/execution/index.js +18 -18
  131. package/dist/models/execution/model-call-recorder.d.ts +1 -1
  132. package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
  133. package/dist/models/execution/web-search.d.ts +7 -0
  134. package/dist/models/execution/web-search.d.ts.map +1 -0
  135. package/dist/models/index.d.ts +3 -1
  136. package/dist/models/index.d.ts.map +1 -1
  137. package/dist/models/index.js +5 -3
  138. package/dist/models/index.js.map +1 -1
  139. package/dist/models/language-model.d.ts +12 -0
  140. package/dist/models/language-model.d.ts.map +1 -1
  141. package/dist/models/web-search-model.d.ts +66 -0
  142. package/dist/models/web-search-model.d.ts.map +1 -0
  143. package/dist/objects/index.js +30 -30
  144. package/dist/objects/query/executor.d.ts.map +1 -1
  145. package/dist/objects/query/index.d.ts +1 -0
  146. package/dist/objects/query/index.d.ts.map +1 -1
  147. package/dist/objects/query/index.js +19 -16
  148. package/dist/objects/query/index.js.map +1 -1
  149. package/dist/objects/query/sort-ties.d.ts +11 -0
  150. package/dist/objects/query/sort-ties.d.ts.map +1 -0
  151. package/dist/pipelines/index.js +19 -19
  152. package/dist/pipelines/run-dispatch.d.ts +2 -0
  153. package/dist/pipelines/run-dispatch.d.ts.map +1 -1
  154. package/dist/projections/internal.js +16 -16
  155. package/dist/runtime/create.d.ts +1 -1
  156. package/dist/runtime/create.d.ts.map +1 -1
  157. package/dist/runtime/internal.js +22 -22
  158. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  159. package/dist/schedules/index.js +2 -2
  160. package/dist/security/index.d.ts +1 -0
  161. package/dist/security/index.d.ts.map +1 -1
  162. package/dist/security/registry.d.ts +2 -0
  163. package/dist/security/registry.d.ts.map +1 -1
  164. package/dist/security/view-conditions.d.ts.map +1 -1
  165. package/dist/security/visibility-keys.d.ts +19 -0
  166. package/dist/security/visibility-keys.d.ts.map +1 -0
  167. package/dist/shares/internal.js +16 -16
  168. package/dist/storage/agents/in-memory.d.ts +8 -2
  169. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  170. package/dist/storage/agents/index.d.ts +1 -1
  171. package/dist/storage/agents/index.d.ts.map +1 -1
  172. package/dist/storage/agents/provider.d.ts +8 -2
  173. package/dist/storage/agents/provider.d.ts.map +1 -1
  174. package/dist/storage/agents/provider.js +12 -6
  175. package/dist/storage/agents/provider.js.map +1 -1
  176. package/dist/storage/agents/types.d.ts +42 -2
  177. package/dist/storage/agents/types.d.ts.map +1 -1
  178. package/dist/storage/ai-cost/provider.js +4 -4
  179. package/dist/storage/ai-limits/enforcement.js +3 -3
  180. package/dist/storage/ai-limits/provider.js +2 -2
  181. package/dist/storage/connector-connections/provider.js +3 -3
  182. package/dist/storage/connector-connections/provider.js.map +3 -3
  183. package/dist/storage/file-upload-sessions/provider.js +4 -4
  184. package/dist/storage/index.d.ts +2 -2
  185. package/dist/storage/index.d.ts.map +1 -1
  186. package/dist/storage/index.js +15 -15
  187. package/dist/storage/internal.d.ts +2 -0
  188. package/dist/storage/internal.d.ts.map +1 -1
  189. package/dist/storage/internal.js +8 -4
  190. package/dist/storage/internal.js.map +1 -1
  191. package/dist/storage/migrations/types.d.ts +6 -0
  192. package/dist/storage/migrations/types.d.ts.map +1 -1
  193. package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
  194. package/dist/storage/objects/index.d.ts +1 -1
  195. package/dist/storage/objects/index.d.ts.map +1 -1
  196. package/dist/storage/objects/query-preparation.d.ts +13 -0
  197. package/dist/storage/objects/query-preparation.d.ts.map +1 -1
  198. package/dist/storage/objects/read-scope.d.ts.map +1 -1
  199. package/dist/storage/objects/types.d.ts +52 -0
  200. package/dist/storage/objects/types.d.ts.map +1 -1
  201. package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -1
  202. package/dist/storage/pipeline-runs/transitions.d.ts +7 -0
  203. package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -0
  204. package/dist/storage/share-grants/provider.js +2 -2
  205. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
  206. package/dist/storage/sync-runs/transitions.d.ts +7 -0
  207. package/dist/storage/sync-runs/transitions.d.ts.map +1 -0
  208. package/dist/storage/workflow-runs/provider.js +4 -4
  209. package/dist/syncs/index.js +20 -20
  210. package/dist/syncs/run-dispatch.d.ts +2 -0
  211. package/dist/syncs/run-dispatch.d.ts.map +1 -1
  212. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  213. package/dist/testing/ai-limit-storage-contract.d.ts.map +1 -1
  214. package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
  215. package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
  216. package/dist/testing/dataset-sequence-contract.d.ts.map +1 -1
  217. package/dist/testing/index.js +552 -61
  218. package/dist/testing/index.js.map +11 -11
  219. package/dist/testing/lake-changes-contract.d.ts.map +1 -1
  220. package/dist/testing/lake-storage-contract.d.ts.map +1 -1
  221. package/dist/testing/object-conditional-read-scope-contract.d.ts.map +1 -1
  222. package/dist/testing/object-query-contract.d.ts.map +1 -1
  223. package/dist/webhooks/internal.js +16 -16
  224. package/dist/workers/index.d.ts +1 -0
  225. package/dist/workers/index.d.ts.map +1 -1
  226. package/dist/workers/index.js +12 -2
  227. package/dist/workers/index.js.map +5 -4
  228. package/dist/workers/unstarted-run.d.ts +10 -0
  229. package/dist/workers/unstarted-run.d.ts.map +1 -0
  230. package/dist/workflows/index.js +34 -34
  231. package/package.json +1 -1
  232. package/src/agents/README.md +2 -1
  233. package/src/agents/cancel.ts +7 -1
  234. package/src/agents/index.ts +9 -1
  235. package/src/agents/run-plan.ts +31 -0
  236. package/src/agents/run-session-http.ts +15 -12
  237. package/src/agents/run-session-serve.ts +8 -2
  238. package/src/agents/run-session.ts +31 -11
  239. package/src/agents/skills.ts +3 -0
  240. package/src/agents/step-limits.ts +6 -0
  241. package/src/agents/streams/protocol.ts +9 -4
  242. package/src/agents/tool-files.ts +11 -3
  243. package/src/agents/validation.ts +9 -0
  244. package/src/agents/web.ts +218 -0
  245. package/src/authorization/resolve.ts +9 -11
  246. package/src/authorization/types.ts +5 -5
  247. package/src/connectors/connections/runs.ts +42 -5
  248. package/src/datasets/execution.ts +2 -0
  249. package/src/events/selectors/predicate.ts +15 -0
  250. package/src/events/types/datasets.ts +6 -0
  251. package/src/execution/object-reader-security.ts +4 -9
  252. package/src/index.ts +2 -0
  253. package/src/lake-storage/in-memory.ts +30 -20
  254. package/src/lake-storage/index.ts +2 -1
  255. package/src/lake-storage/source-ordering.ts +31 -4
  256. package/src/lake-storage/types.ts +18 -0
  257. package/src/lake-storage/version-inputs.ts +21 -5
  258. package/src/models/catalog.ts +52 -3
  259. package/src/models/definitions.ts +2 -0
  260. package/src/models/execution/README.md +22 -2
  261. package/src/models/execution/model-call-recorder.ts +1 -1
  262. package/src/models/execution/web-search.ts +186 -0
  263. package/src/models/index.ts +12 -0
  264. package/src/models/language-model.ts +12 -0
  265. package/src/models/web-search-model.ts +152 -0
  266. package/src/objects/query/executor.ts +7 -3
  267. package/src/objects/query/index.ts +1 -0
  268. package/src/objects/query/sort-ties.ts +16 -0
  269. package/src/pipelines/run-dispatch.ts +53 -6
  270. package/src/runtime/create.ts +3 -2
  271. package/src/runtime/resolve-definitions.ts +4 -0
  272. package/src/security/index.ts +1 -0
  273. package/src/security/registry.ts +2 -0
  274. package/src/security/view-conditions.ts +4 -3
  275. package/src/security/visibility-keys.ts +144 -0
  276. package/src/storage/agents/in-memory.ts +29 -2
  277. package/src/storage/agents/index.ts +2 -0
  278. package/src/storage/agents/provider.ts +57 -1
  279. package/src/storage/agents/types.ts +45 -2
  280. package/src/storage/connector-connections/in-memory.ts +2 -2
  281. package/src/storage/connector-connections/provider/connections.ts +2 -2
  282. package/src/storage/index.ts +4 -0
  283. package/src/storage/internal.ts +2 -0
  284. package/src/storage/migrations/types.ts +6 -0
  285. package/src/storage/objects/in-memory/query.ts +5 -2
  286. package/src/storage/objects/index.ts +2 -0
  287. package/src/storage/objects/query-preparation.ts +59 -1
  288. package/src/storage/objects/read-scope.ts +108 -2
  289. package/src/storage/objects/types.ts +43 -0
  290. package/src/storage/pipeline-runs/in-memory.ts +2 -5
  291. package/src/storage/pipeline-runs/transitions.ts +14 -0
  292. package/src/storage/sync-runs/in-memory.ts +2 -5
  293. package/src/storage/sync-runs/transitions.ts +11 -0
  294. package/src/syncs/run-dispatch.ts +68 -13
  295. package/src/testing/agent-storage-contract.ts +70 -0
  296. package/src/testing/ai-limit-storage-contract.ts +11 -1
  297. package/src/testing/ai-usage-storage-contract.ts +15 -2
  298. package/src/testing/connector-connection-storage-contract.ts +23 -0
  299. package/src/testing/dataset-sequence-contract.ts +81 -0
  300. package/src/testing/lake-changes-contract.ts +2 -1
  301. package/src/testing/lake-storage-contract.ts +112 -0
  302. package/src/testing/object-conditional-read-scope-contract.ts +267 -5
  303. package/src/testing/object-query-contract.ts +75 -0
  304. package/src/workers/index.ts +1 -0
  305. package/src/workers/unstarted-run.ts +18 -0
  306. package/dist/chunk-8dcfj58k.js.map +0 -18
  307. package/dist/chunk-d3t26vah.js.map +0 -15
  308. package/dist/chunk-edx8xcsm.js.map +0 -13
  309. package/dist/chunk-ekkpzcka.js.map +0 -11
  310. package/dist/chunk-fg1db9xx.js.map +0 -10
  311. package/dist/chunk-jk97v21j.js.map +0 -10
  312. package/dist/chunk-tvefbgvw.js.map +0 -11
  313. package/dist/chunk-ztf5vtmp.js.map +0 -12
  314. /package/dist/{chunk-neftrg0n.js.map → chunk-0j3crh1w.js.map} +0 -0
  315. /package/dist/{chunk-23s66j86.js.map → chunk-31kcqmhf.js.map} +0 -0
  316. /package/dist/{chunk-nghc7eq0.js.map → chunk-3723kgba.js.map} +0 -0
  317. /package/dist/{chunk-fdkpkkpw.js.map → chunk-3sqqhpr7.js.map} +0 -0
  318. /package/dist/{chunk-m3qe54bb.js.map → chunk-4bm0caep.js.map} +0 -0
  319. /package/dist/{chunk-fntqb7qy.js.map → chunk-57g0215c.js.map} +0 -0
  320. /package/dist/{chunk-8wsjr52f.js.map → chunk-5wtnmpze.js.map} +0 -0
  321. /package/dist/{chunk-2pk5hjj9.js.map → chunk-80gym75n.js.map} +0 -0
  322. /package/dist/{chunk-qbrmpgvv.js.map → chunk-9whfmsfk.js.map} +0 -0
  323. /package/dist/{chunk-he7g39e5.js.map → chunk-a7aa0nzj.js.map} +0 -0
  324. /package/dist/{chunk-7hd2ez3q.js.map → chunk-c4nrycdy.js.map} +0 -0
  325. /package/dist/{chunk-n54k068r.js.map → chunk-c7cfe31p.js.map} +0 -0
  326. /package/dist/{chunk-qsg8rw04.js.map → chunk-d04g36fw.js.map} +0 -0
  327. /package/dist/{chunk-f2w6328x.js.map → chunk-f1h34y3r.js.map} +0 -0
  328. /package/dist/{chunk-9rh8ncs5.js.map → chunk-fwsvshr5.js.map} +0 -0
  329. /package/dist/{chunk-cgznz22f.js.map → chunk-gkv8r794.js.map} +0 -0
  330. /package/dist/{chunk-8hvfs0fr.js.map → chunk-j8thxj7w.js.map} +0 -0
  331. /package/dist/{chunk-855n80en.js.map → chunk-jjmggm9a.js.map} +0 -0
  332. /package/dist/{chunk-vkweppkw.js.map → chunk-mbc5hvnj.js.map} +0 -0
  333. /package/dist/{chunk-y2x2935j.js.map → chunk-nh26e7c5.js.map} +0 -0
  334. /package/dist/{chunk-jhbk10wf.js.map → chunk-q9nkpr8k.js.map} +0 -0
  335. /package/dist/{chunk-xj97s5js.js.map → chunk-wrjx1fqz.js.map} +0 -0
  336. /package/dist/{chunk-agn8d8ys.js.map → chunk-xtztwpkh.js.map} +0 -0
  337. /package/dist/{chunk-0g5nyx0k.js.map → chunk-zeykm8my.js.map} +0 -0
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/models/language-model.ts", "../src/models/definitions.ts"],
4
- "sourcesContent": [
5
- "import type { JsonObject, ReadonlyJsonObject } from \"../json\"\nimport type { LanguageModelDefinitionCatalog, ModelDefinitionCatalog } from \"./catalog\"\nimport type { LanguageModelDefinition } from \"./definitions\"\nimport type { LanguageModelStreamEvent } from \"./events\"\nimport type { ModelMessage } from \"./messages\"\nimport type { ModelCostEstimator } from \"./pricing\"\nimport type { ModelRateCard } from \"./rate-card\"\n\nexport const MODEL_REASONING_EFFORTS = [\"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const\n\nexport type ModelReasoningEffort = (typeof MODEL_REASONING_EFFORTS)[number]\n\nexport const MODEL_REASONING_LEVELS = [\n \"provider-default\",\n \"none\",\n ...MODEL_REASONING_EFFORTS,\n] as const\n\nexport type ModelReasoningLevel = (typeof MODEL_REASONING_LEVELS)[number]\n\n/** Exact provider-native reasoning budget, expressed in tokens. */\nexport interface ModelReasoningBudget extends ReadonlyJsonObject {\n readonly budgetTokens: number\n}\n\n/** Provider-neutral reasoning preference accepted by every language-model runtime. */\nexport type ModelReasoning = ModelReasoningLevel | ModelReasoningBudget\n\nexport interface ModelReasoningBudgetCapabilities {\n readonly min?: number\n readonly max?: number\n}\n\n/** Controls exposed by one concrete model offering through one provider. */\nexport interface ModelReasoningCapabilities {\n readonly canDisable?: boolean\n readonly efforts?: readonly ModelReasoningEffort[]\n readonly budgetTokens?: ModelReasoningBudgetCapabilities\n}\n\nexport interface ModelCapabilities {\n readonly inputMediaTypes?: readonly string[] | \"any\"\n /** `undefined` is unknown, `false` is unsupported, and an object describes supported controls. */\n readonly reasoning?: false | ModelReasoningCapabilities\n readonly localTools?: boolean\n readonly parallelToolCalls?: boolean\n /** `undefined` is unknown, not an assertion that schema-constrained output is unsupported. */\n readonly nativeStructuredOutput?: boolean\n readonly providerExecutedTools?: boolean\n}\n\nexport interface ModelToolSpecification {\n readonly name: string\n readonly description: string\n readonly inputSchema: JsonObject\n}\n\nexport interface ModelResponseFormat {\n readonly type: \"json\"\n readonly name: string\n readonly description?: string\n readonly schema: JsonObject\n}\n\nexport interface LanguageModelRequest {\n readonly callId: string\n readonly messages: readonly ModelMessage[]\n readonly tools: readonly ModelToolSpecification[]\n readonly reasoning?: ModelReasoning\n /** Per-call output ceiling; providers must not exceed a stricter configured model limit. */\n readonly maxOutputTokens?: number\n /**\n * How the provider caches the request's prompt, never over explicit provider configuration.\n * Absent, it caches what it expects to be read again.\n */\n readonly caching?: ModelCaching\n readonly responseFormat?: ModelResponseFormat\n readonly signal: AbortSignal\n}\n\n/**\n * `\"off\"` caches nothing and `\"auto\"` caches the request even when it is read once. An intent\n * caches what an absent choice would, and says how the prompt is read again: each provider\n * translates it, or ignores what it has no equivalent for.\n */\nexport type ModelCaching = \"auto\" | \"off\" | ModelCachingIntent\n\nexport interface ModelCachingIntent {\n /**\n * `\"long\"`: the prompt is read again after a human pause, as by a conversation's next turn, so\n * its cache should outlive the provider's default lifetime. `\"default\"` keeps that lifetime.\n */\n readonly lifetime?: \"default\" | \"long\"\n /**\n * An opaque id the requests that share a prompt prefix share, such as one conversation's, for a\n * provider that routes them to where that prefix is cached. Never personal data.\n */\n readonly key?: string\n}\n\n/**\n * How long a prompt stays cached after the last call that read it, by its intent's lifetime: the\n * hour providers keep a `\"long\"` one for, else the five minutes Anthropic keeps by default, the\n * shortest of theirs.\n */\nexport function modelCacheLifetimeMs(lifetime: ModelCachingIntent[\"lifetime\"]): number {\n return lifetime === \"long\" ? 60 * 60_000 : 5 * 60_000\n}\n\nexport interface LanguageModelStream {\n readonly events: AsyncIterable<LanguageModelStreamEvent>\n}\n\nexport interface LanguageModel {\n readonly providerId: string\n readonly modelId: string\n readonly definition: LanguageModelDefinition\n readonly costEstimator?: ModelCostEstimator\n /**\n * The prices this binding bills by, for people and agents choosing a model. Pricing itself\n * goes through costEstimator; absent when the price is unknown.\n */\n readonly rateCard?: ModelRateCard\n /**\n * Reasoning Sixb applies whenever this model runs without an explicit choice: chat turns, AI\n * workflow steps, subagents, and direct generation. Providers set it from their model options;\n * Sixb checks it against `definition.capabilities` at startup.\n */\n readonly defaultReasoning?: ModelReasoningLevel\n /**\n * Output limit the binding sets for every call, agent calls included. Unlike\n * `definition.maxOutputTokens`, the most the model itself can produce, this is the developer's\n * choice. Providers set it from their model options; Sixb checks it against that maximum at\n * startup.\n */\n readonly maxOutputTokens?: number\n /**\n * Return an executable model pinned to operational metadata, preserving model identity.\n * `offline` requires a local snapshot without catalog I/O. Workers retain this model\n * for generation and compaction; later catalog refreshes must not change its capabilities/limits.\n * Throw ModelCatalogUnavailableError for catalog transport/access failures to allow workers to\n * retry with an offline snapshot. Invalid definitions and other resolver errors remain fatal.\n */\n resolve?(options?: { readonly offline?: boolean }): Promise<LanguageModel>\n /** Validate known output constraints without inference. Success does not certify endpoint support. */\n validateResponseFormat?(format: ModelResponseFormat): void | Promise<void>\n stream(request: LanguageModelRequest): Promise<LanguageModelStream>\n}\n\n/** The common callable provider shape. Provider packages may accept additional model options. */\nexport interface ModelProvider<TCatalog extends ModelDefinitionCatalog = ModelDefinitionCatalog> {\n readonly providerId: string\n readonly catalog: TCatalog\n}\n\nexport interface LanguageModelProvider extends ModelProvider<LanguageModelDefinitionCatalog> {\n (modelId: string): LanguageModel\n}\n\nexport function isModelReasoning(value: unknown): value is ModelReasoning {\n if (typeof value === \"string\") {\n return (MODEL_REASONING_LEVELS as readonly string[]).includes(value)\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return false\n if (Object.keys(value).length !== 1) return false\n const budgetTokens = (value as { readonly budgetTokens?: unknown }).budgetTokens\n return typeof budgetTokens === \"number\" && Number.isSafeInteger(budgetTokens) && budgetTokens >= 0\n}\n\n/** Explain why a request cannot be represented by known model capabilities. Unknown is allowed. */\nexport function modelReasoningSupportIssue(\n capabilities: ModelCapabilities[\"reasoning\"],\n reasoning: unknown\n): string | undefined {\n if (reasoning === undefined) return undefined\n if (!isModelReasoning(reasoning)) return \"the reasoning preference is invalid\"\n if (reasoning === \"provider-default\") return undefined\n if (capabilities === undefined) return undefined\n if (capabilities === false) return \"reasoning is not supported\"\n if (reasoning === \"none\") {\n return capabilities.canDisable === true ? undefined : \"reasoning cannot be disabled\"\n }\n if (typeof reasoning === \"string\") {\n return capabilities.efforts?.includes(reasoning) === true\n ? undefined\n : `reasoning effort '${reasoning}' is not supported`\n }\n const budget = capabilities.budgetTokens\n if (budget === undefined) return \"reasoning token budgets are not supported\"\n if (budget.min !== undefined && reasoning.budgetTokens < budget.min) {\n return `reasoning token budget must be at least ${budget.min}`\n }\n if (budget.max !== undefined && reasoning.budgetTokens > budget.max) {\n return `reasoning token budget must not exceed ${budget.max}`\n }\n return undefined\n}\n",
6
- "import {\n MODEL_REASONING_EFFORTS,\n type ModelCapabilities,\n type ModelReasoningBudgetCapabilities,\n type ModelReasoningCapabilities,\n} from \"./language-model\"\n\n/** @internal Every model kind, for validating stored values. */\nexport const MODEL_KINDS = [\n \"language\",\n \"image\",\n \"video\",\n \"embedding\",\n \"decision\",\n \"transcription\",\n \"speech\",\n \"reranking\",\n] as const\n\nexport type ModelKind = (typeof MODEL_KINDS)[number]\n\n/**\n * @internal Kinds billed per audio second, search, image or character, whose providers mostly\n * report no tokens. Token limits skip them, and a missing token count from one is not a gap.\n */\nexport const TOKENLESS_MODEL_KINDS: readonly ModelKind[] = [\n \"transcription\",\n \"reranking\",\n \"image\",\n \"speech\",\n]\n\n/** Common catalog identity shared by every present and future model runtime. */\nexport interface ModelDefinition {\n readonly kind: ModelKind\n readonly providerId: string\n readonly modelId: string\n readonly name?: string\n readonly description?: string\n /** Model author for display; does not change the provider/model routing identity. */\n readonly publisher?: { readonly id: string; readonly name: string }\n /** Hosting service label, when the model is offered through an intermediary. */\n readonly via?: string\n readonly family?: string\n readonly tags?: readonly string[]\n readonly releaseDate?: string\n}\n\n/** Serializable facts about one concrete model offering from one provider. */\nexport interface LanguageModelDefinition extends ModelDefinition {\n readonly kind: \"language\"\n readonly knowledgeCutoff?: string\n readonly contextWindow?: number\n /** Maximum input tokens, distinct from a shared input/output context window. */\n readonly maxInputTokens?: number\n readonly maxOutputTokens?: number\n readonly capabilities: ModelCapabilities\n}\n\n/** The name and description a project gives a language model, in place of the provider's. */\nexport interface LanguageModelLabel {\n /** Shown in the chat's model picker and to the Agent. */\n readonly name?: string\n /** When the model is useful, for the people choosing it and for the Agent delegating to it. */\n readonly description?: string\n}\n\n/**\n * The label a model binding sets, checked and reported with the provider's error prefix. A provider\n * spreads it over every definition it builds for the binding, its resolved ones included.\n *\n * Stricter than `defineLanguageModel`, which takes a provider's catalog text as it comes: the\n * project types a label by hand, so an empty or padded value is a mistake to report.\n */\nexport function defineLanguageModelLabel(\n label: LanguageModelLabel,\n prefix: string\n): LanguageModelLabel {\n for (const field of [\"name\", \"description\"] as const) {\n const value: unknown = label[field]\n\n if (value !== undefined && (typeof value !== \"string\" || !value || value !== value.trim())) {\n throw new TypeError(`${prefix} ${field} must be a nonempty trimmed string.`)\n }\n }\n\n return {\n ...(label.name === undefined ? {} : { name: label.name }),\n ...(label.description === undefined ? {} : { description: label.description }),\n }\n}\n\nexport function defineLanguageModel(definition: LanguageModelDefinition): LanguageModelDefinition {\n if (definition.kind !== \"language\") {\n throw new TypeError(\"[Sixb] Language model definitions must use kind 'language'.\")\n }\n assertModelId(definition.providerId, \"providerId\")\n assertModelId(definition.modelId, \"modelId\")\n assertOptionalString(definition.name, \"name\")\n assertOptionalString(definition.description, \"description\")\n assertOptionalString(definition.via, \"via\")\n if (definition.via !== undefined && !definition.via.trim())\n throw new TypeError(\"[Sixb] Model via must not be empty.\")\n const publisher = definition.publisher\n if (publisher !== undefined) {\n assertRecord(publisher, \"publisher\")\n for (const [field, value] of Object.entries({ id: publisher.id, name: publisher.name })) {\n if (typeof value !== \"string\" || !value.trim() || value !== value.trim())\n throw new TypeError(`[Sixb] Model publisher.${field} must be a nonempty trimmed string.`)\n }\n }\n assertOptionalString(definition.family, \"family\")\n assertOptionalString(definition.releaseDate, \"releaseDate\")\n assertOptionalString(definition.knowledgeCutoff, \"knowledgeCutoff\")\n const tags = freezeStrings(definition.tags, \"tags\")\n const capabilities = defineModelCapabilities(definition.capabilities)\n assertOptionalPositiveInteger(definition.contextWindow, \"contextWindow\")\n assertOptionalPositiveInteger(definition.maxInputTokens, \"maxInputTokens\")\n assertOptionalPositiveInteger(definition.maxOutputTokens, \"maxOutputTokens\")\n return Object.freeze({\n kind: \"language\",\n providerId: definition.providerId,\n modelId: definition.modelId,\n ...(definition.name === undefined ? {} : { name: definition.name }),\n ...(definition.description === undefined ? {} : { description: definition.description }),\n ...(publisher === undefined\n ? {}\n : { publisher: Object.freeze({ id: publisher.id, name: publisher.name }) }),\n ...(definition.via === undefined ? {} : { via: definition.via }),\n ...(definition.family === undefined ? {} : { family: definition.family }),\n ...(tags === undefined ? {} : { tags }),\n ...(definition.releaseDate === undefined ? {} : { releaseDate: definition.releaseDate }),\n ...(definition.knowledgeCutoff === undefined\n ? {}\n : { knowledgeCutoff: definition.knowledgeCutoff }),\n ...(definition.contextWindow === undefined ? {} : { contextWindow: definition.contextWindow }),\n ...(definition.maxInputTokens === undefined\n ? {}\n : { maxInputTokens: definition.maxInputTokens }),\n ...(definition.maxOutputTokens === undefined\n ? {}\n : { maxOutputTokens: definition.maxOutputTokens }),\n capabilities,\n })\n}\n\nfunction defineModelCapabilities(capabilities: unknown): ModelCapabilities {\n assertRecord(capabilities, \"capabilities\")\n const inputMediaTypes =\n capabilities.inputMediaTypes === \"any\"\n ? \"any\"\n : freezeStrings(capabilities.inputMediaTypes, \"capabilities.inputMediaTypes\")\n for (const [field, value] of Object.entries(capabilities)) {\n if (field === \"inputMediaTypes\" || field === \"reasoning\") continue\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new TypeError(`[Sixb] Model capability '${field}' must be boolean.`)\n }\n }\n const reasoning = freezeReasoningCapabilities(capabilities.reasoning)\n const flags: {\n localTools?: boolean\n parallelToolCalls?: boolean\n nativeStructuredOutput?: boolean\n providerExecutedTools?: boolean\n } = {}\n for (const key of [\n \"localTools\",\n \"parallelToolCalls\",\n \"nativeStructuredOutput\",\n \"providerExecutedTools\",\n ] as const) {\n const value = capabilities[key]\n if (typeof value === \"boolean\") flags[key] = value\n }\n return Object.freeze({\n ...(inputMediaTypes === undefined ? {} : { inputMediaTypes }),\n ...(reasoning === undefined ? {} : { reasoning }),\n ...flags,\n })\n}\n\nfunction freezeReasoningCapabilities(reasoning: unknown): ModelCapabilities[\"reasoning\"] {\n if (reasoning === undefined || reasoning === false) return reasoning\n assertRecord(reasoning, \"reasoning\")\n if (reasoning.canDisable !== undefined && typeof reasoning.canDisable !== \"boolean\") {\n throw new TypeError(\"[Sixb] Model reasoning capability 'canDisable' must be boolean.\")\n }\n const efforts = freezeReasoningEfforts(reasoning.efforts)\n const budgetTokens = freezeReasoningBudgetCapabilities(reasoning.budgetTokens)\n return Object.freeze({\n ...(reasoning.canDisable === undefined ? {} : { canDisable: reasoning.canDisable }),\n ...(efforts === undefined ? {} : { efforts }),\n ...(budgetTokens === undefined ? {} : { budgetTokens }),\n } satisfies ModelReasoningCapabilities)\n}\n\nfunction freezeReasoningEfforts(\n efforts: unknown\n): readonly (typeof MODEL_REASONING_EFFORTS)[number][] | undefined {\n if (efforts === undefined) return undefined\n if (!Array.isArray(efforts)) {\n throw new TypeError(\"[Sixb] Model reasoning capability 'efforts' must be an array.\")\n }\n const seen = new Set<string>()\n return Object.freeze(\n efforts.map((value: unknown) => {\n const effort = MODEL_REASONING_EFFORTS.find((allowed) => allowed === value)\n if (effort === undefined) {\n throw new TypeError(`[Sixb] Model reasoning effort '${String(value)}' is invalid.`)\n }\n if (seen.has(effort)) {\n throw new TypeError(`[Sixb] Model reasoning effort '${effort}' is duplicated.`)\n }\n seen.add(effort)\n return effort\n })\n )\n}\n\nfunction freezeReasoningBudgetCapabilities(\n budget: unknown\n): ModelReasoningBudgetCapabilities | undefined {\n if (budget === undefined) return undefined\n assertRecord(budget, \"reasoning budgetTokens\")\n assertOptionalNonnegativeInteger(budget.min, \"capabilities.reasoning.budgetTokens.min\")\n assertOptionalNonnegativeInteger(budget.max, \"capabilities.reasoning.budgetTokens.max\")\n if (budget.min !== undefined && budget.max !== undefined && budget.max < budget.min) {\n throw new TypeError(\n \"[Sixb] Model reasoning token budget maximum must not be below its minimum.\"\n )\n }\n return Object.freeze({\n ...(budget.min === undefined ? {} : { min: budget.min }),\n ...(budget.max === undefined ? {} : { max: budget.max }),\n })\n}\n\nfunction assertModelId(value: string, field: string): void {\n if (!value.trim()) throw new TypeError(`[Sixb] Model ${field} must not be empty.`)\n}\n\nfunction assertOptionalPositiveInteger(value: number | undefined, field: string): void {\n if (value !== undefined && (!Number.isSafeInteger(value) || value <= 0)) {\n throw new TypeError(`[Sixb] Model ${field} must be a positive safe integer.`)\n }\n}\n\nfunction assertOptionalNonnegativeInteger(\n value: unknown,\n field: string\n): asserts value is number | undefined {\n if (\n value !== undefined &&\n (typeof value !== \"number\" || !Number.isSafeInteger(value) || value < 0)\n ) {\n throw new TypeError(`[Sixb] Model ${field} must be a nonnegative safe integer.`)\n }\n}\n\nfunction assertOptionalString(value: string | undefined, field: string): void {\n if (value !== undefined && typeof value !== \"string\") {\n throw new TypeError(`[Sixb] Model ${field} must be a string.`)\n }\n}\n\nfunction freezeStrings(value: unknown, field: string): readonly string[] | undefined {\n if (value === undefined) return undefined\n if (!Array.isArray(value) || value.some((entry) => typeof entry !== \"string\" || !entry.trim())) {\n throw new TypeError(`[Sixb] Model ${field} must contain nonempty strings.`)\n }\n return Object.freeze([...value])\n}\n\nfunction assertRecord(value: unknown, field: string): asserts value is Record<string, unknown> {\n if (value === null || typeof value !== \"object\" || Array.isArray(value))\n throw new TypeError(`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C5E;AAAA,EACA,OAAO,OAAO,OAAO,CAAC,GAAG,KAAK,CAAC;AAAA;AAGjC,SAAS,YAAY,CAAC,OAAgB,OAAyD;AAAA,EAC7F,IAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK;AAAA,IACpE,MAAM,IAAI,UAAU,gBAAgB,0BAA0B;AAAA;",
9
- "debugId": "95CA4929301E25FD64756E2164756E21",
10
- "names": []
11
- }
@@ -1,12 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/syncs/errors.ts", "../src/syncs/run-dispatch.ts", "../src/syncs/request.ts"],
4
- "sourcesContent": [
5
- "export class SyncValidationError extends Error {\n readonly name = \"SyncValidationError\"\n}\n",
6
- "import { randomUUID } from \"node:crypto\"\nimport { reportRunFailure } from \"../error-reporting/capability\"\nimport { createSixbError, toSixbFailure } from \"../errors/internal\"\nimport type { SixbFailure } from \"../errors/types\"\nimport type { RunDispatcher } from \"../execution/dispatch\"\nimport { createPrimitiveExecutionRecord } from \"../execution/durable\"\nimport type { Queues } from \"../queues\"\nimport type { SixbDefinitions } from \"../runtime/definitions\"\nimport type { CreateExecutionInput, Storage, SyncRunFailureCode, SyncRunRecord } from \"../storage\"\nimport { SYNC_RUN_FAILURE_CODES, SyncRunError } from \"../storage\"\nimport { SyncValidationError } from \"./errors\"\nimport type { SyncRunRequestOptions, SyncRunRequestResult } from \"./request\"\nimport type { SyncDefinition } from \"./types\"\n\nexport type AutomaticSyncExecutionSource =\n | { readonly type: \"schedule\"; readonly eventId: string }\n | { readonly type: \"event\"; readonly eventId: string }\n\nexport interface AutomaticSyncRunDispatchInput extends SyncRunRequestOptions {\n readonly syncId: string\n readonly runId: string\n readonly source: AutomaticSyncExecutionSource\n readonly correlationId: string\n readonly metadata?: Readonly<Record<string, string>>\n}\n\nexport type SyncRunDispatchPort = RunDispatcher<AutomaticSyncRunDispatchInput, SyncRunRequestResult>\n\nexport interface SyncRunDispatcherDependencies {\n readonly id: string\n readonly definitions: Pick<SixbDefinitions, \"syncs\">\n readonly storage: Storage\n readonly queues: Pick<Queues, \"syncRuns\">\n}\n\ninterface DispatchSyncRunInput extends SyncRunRequestOptions {\n readonly errorReporterHost: object\n readonly projectId: string\n readonly sync: SyncDefinition\n readonly storage: Storage\n readonly queue: Queues[\"syncRuns\"]\n readonly metadata?: Readonly<Record<string, string>>\n readonly createExecution: (executionId: string, runId: string) => Promise<CreateExecutionInput>\n readonly validateExistingRun?: (run: SyncRunRecord, storage: Storage) => Promise<void>\n}\n\ntype PersistedSyncRun =\n | { readonly publish: false; readonly run: SyncRunRecord }\n | {\n readonly publish: true\n readonly run: SyncRunRecord\n readonly execution: CreateExecutionInput\n readonly queuedAt: Date\n readonly created: boolean\n }\n\n/** Core-owned durable dispatch boundary used by automatic Sync triggers. */\nexport class SyncRunDispatcher implements SyncRunDispatchPort {\n constructor(private readonly dependencies: SyncRunDispatcherDependencies) {}\n\n async dispatch(input: AutomaticSyncRunDispatchInput): Promise<SyncRunRequestResult> {\n assertAutomaticDispatchInput(input)\n const sync = this.dependencies.definitions.syncs.getById(input.syncId)\n if (!sync) throw new SyncValidationError(`[Sixb] Unknown sync '${input.syncId}'`)\n\n return dispatchSyncRun({\n errorReporterHost: this.dependencies,\n projectId: this.dependencies.id,\n sync,\n storage: this.dependencies.storage,\n queue: this.dependencies.queues.syncRuns,\n runId: input.runId,\n expectedLatestVersionId: input.expectedLatestVersionId,\n commitMessage: input.commitMessage,\n metadata: input.metadata,\n validateExistingRun: (run, storage) =>\n assertAutomaticExecutionIdentity(storage, this.dependencies.id, input, run),\n createExecution: async (executionId, runId) =>\n createPrimitiveExecutionRecord({\n id: executionId,\n primitive: { kind: \"sync\", id: sync.id, runId },\n origin: {\n type: \"automatic\",\n projectId: this.dependencies.id,\n source: input.source,\n correlationId: input.correlationId,\n },\n }),\n })\n }\n}\n\n/** Persist a Sync execution and queued run before publishing its queue job. */\nexport async function dispatchSyncRun(input: DispatchSyncRunInput): Promise<SyncRunRequestResult> {\n const runId = createSyncRunId(input.runId)\n let persisted = await persistSyncRun(input, runId)\n if (!persisted.publish && input.validateExistingRun && persisted.run.status === \"queued\") {\n persisted = await reuseSyncRun(input, persisted.run)\n }\n if (!persisted.publish) return existingSyncRunResult(persisted.run)\n return publishSyncRun(input, persisted)\n}\n\nasync function persistSyncRun(\n input: DispatchSyncRunInput,\n runId: string\n): Promise<PersistedSyncRun> {\n const syncRuns = requireSyncRunStorage(input.storage)\n const existing = await syncRuns.getById({ projectId: input.projectId, id: runId })\n if (existing) return reuseSyncRun(input, existing)\n\n const execution = await input.createExecution(`exec_${randomUUID()}`, runId)\n const queuedAt = new Date()\n try {\n return await input.storage.transaction(\n async (tx): Promise<PersistedSyncRun> => {\n const transactionalRuns = requireSyncRunStorage(tx)\n const raced = await transactionalRuns.getById({ projectId: input.projectId, id: runId })\n if (raced) {\n assertExistingRunMatchesRequest(raced, input)\n await input.validateExistingRun?.(raced, tx)\n return { publish: false, run: raced }\n }\n\n await tx.executions.create(execution)\n const run = await transactionalRuns.queue({\n projectId: input.projectId,\n id: runId,\n executionId: execution.id,\n syncId: input.sync.id,\n datasetId: input.sync.target.dataset.id,\n mode: input.sync.config.mode,\n queuedAt,\n expectedLatestVersionId: input.expectedLatestVersionId,\n commitMessage: input.commitMessage,\n })\n return { publish: true, run, execution, queuedAt, created: true }\n },\n { isolation: \"serializable\" }\n )\n } catch (error) {\n if (!(error instanceof SyncRunError)) throw error\n const raced = await syncRuns.getById({ projectId: input.projectId, id: runId })\n if (!raced) throw error\n assertExistingRunMatchesRequest(raced, input)\n await input.validateExistingRun?.(raced, input.storage)\n return { publish: false, run: raced }\n }\n}\n\nasync function reuseSyncRun(\n input: DispatchSyncRunInput,\n existing: SyncRunRecord\n): Promise<PersistedSyncRun> {\n assertExistingRunMatchesRequest(existing, input)\n await input.validateExistingRun?.(existing, input.storage)\n if (input.validateExistingRun && existing.status === \"queued\") {\n const execution = await input.storage.executions.getById({\n projectId: input.projectId,\n id: existing.executionId,\n })\n if (!execution)\n throw new SyncRunError(`[Sixb] Execution '${existing.executionId}' was not found.`)\n return { publish: true, run: existing, execution, queuedAt: existing.queuedAt, created: false }\n }\n if (\n existing.status !== \"failed\" ||\n existing.error?.code !== \"queue.enqueue_failed\" ||\n !existing.error.retryable\n ) {\n return { publish: false, run: existing }\n }\n\n const execution = await input.storage.executions.getById({\n projectId: input.projectId,\n id: existing.executionId,\n })\n if (!execution) {\n throw new SyncRunError(\n `[Sixb] Execution '${existing.executionId}' for Sync run '${existing.id}' was not found.`\n )\n }\n\n const queuedAt = new Date()\n const run = await requireSyncRunStorage(input.storage).queue({\n projectId: input.projectId,\n id: existing.id,\n executionId: existing.executionId,\n syncId: existing.syncId,\n datasetId: existing.datasetId,\n mode: existing.mode,\n queuedAt,\n expectedLatestVersionId: existing.expectedLatestVersionId,\n commitMessage: existing.commitMessage,\n })\n return { publish: true, run, execution, queuedAt, created: false }\n}\n\nasync function publishSyncRun(\n input: DispatchSyncRunInput,\n persisted: Extract<PersistedSyncRun, { readonly publish: true }>\n): Promise<SyncRunRequestResult> {\n try {\n const [job] = await input.queue.enqueue({\n projectId: input.projectId,\n jobs: [\n {\n id: persisted.run.id,\n type: \"sync.run.requested\",\n payload: { runId: persisted.run.id },\n ...(input.metadata === undefined ? {} : { metadata: input.metadata }),\n },\n ],\n })\n if (!job || job.id !== persisted.run.id) {\n throw new SyncRunError(`[Sixb] Queue did not acknowledge Sync run '${persisted.run.id}'.`)\n }\n return {\n syncId: persisted.run.syncId,\n runId: persisted.run.id,\n queuedAt: persisted.queuedAt.toISOString(),\n ...(job?.id ? { jobId: job.id } : {}),\n created: persisted.created,\n }\n } catch (error) {\n // Automatic consumers retain the batch and retry. Keep uncertain delivery queued:\n // a lost reply does not prove that the queue rejected the job.\n if (input.validateExistingRun) throw error\n const failedAt = new Date()\n const failure = toEnqueueFailure(error, persisted.run, failedAt)\n const failed = await requireSyncRunStorage(input.storage).finish({\n projectId: input.projectId,\n id: persisted.run.id,\n status: \"failed\",\n finishedAt: failedAt,\n error: failure,\n })\n reportRunFailure(input.errorReporterHost, error, {\n projectId: input.projectId,\n runKind: \"sync\",\n run: { runId: failed.id, syncId: failed.syncId },\n failure,\n })\n throw error\n }\n}\n\nfunction assertExistingRunMatchesRequest(\n existing: SyncRunRecord,\n input: Pick<DispatchSyncRunInput, \"sync\" | \"expectedLatestVersionId\" | \"commitMessage\">\n): void {\n if (\n existing.syncId !== input.sync.id ||\n existing.datasetId !== input.sync.target.dataset.id ||\n existing.mode !== input.sync.config.mode ||\n existing.expectedLatestVersionId !== input.expectedLatestVersionId ||\n existing.commitMessage !== input.commitMessage\n ) {\n throw new SyncRunError(\n `[Sixb] Sync run '${existing.id}' already exists with a different request payload.`\n )\n }\n}\n\nfunction existingSyncRunResult(existing: SyncRunRecord): SyncRunRequestResult {\n return {\n syncId: existing.syncId,\n runId: existing.id,\n queuedAt: existing.queuedAt.toISOString(),\n created: false,\n }\n}\n\nfunction requireSyncRunStorage(storage: Storage): NonNullable<Storage[\"syncRuns\"]> {\n if (!storage.syncRuns) throw new SyncValidationError(\"[Sixb] Sync run storage is not configured.\")\n return storage.syncRuns\n}\n\nfunction createSyncRunId(runId: string | undefined): string {\n if (runId === undefined) return `run_${randomUUID()}`\n if (!runId.trim()) throw new SyncValidationError(\"[Sixb] Sync run id must not be empty\")\n return runId\n}\n\nfunction assertAutomaticDispatchInput(input: AutomaticSyncRunDispatchInput): void {\n assertNonBlank(input.syncId, \"Sync id\")\n assertNonBlank(input.runId, \"Sync run id\")\n assertNonBlank(input.source.eventId, \"Sync source event id\")\n assertNonBlank(input.correlationId, \"Sync correlation id\")\n}\n\nasync function assertAutomaticExecutionIdentity(\n storage: Storage,\n projectId: string,\n input: AutomaticSyncRunDispatchInput,\n run: SyncRunRecord\n): Promise<void> {\n const execution = await storage.executions.getById({ projectId, id: run.executionId })\n if (\n !execution ||\n execution.source.type !== input.source.type ||\n execution.source.eventId !== input.source.eventId ||\n execution.correlationId !== input.correlationId ||\n execution.requestedBy !== undefined\n ) {\n throw new SyncValidationError(\n `[Sixb] Sync run '${run.id}' already exists with different automatic provenance.`\n )\n }\n}\n\nfunction toEnqueueFailure(\n error: unknown,\n run: SyncRunRecord,\n at: Date\n): SixbFailure<SyncRunFailureCode> {\n const enqueueError = createSixbError(\n \"queue.enqueue_failed\",\n `[Sixb] Could not enqueue Sync run '${run.id}'.`,\n {\n cause: error,\n details: { syncId: run.syncId, runId: run.id, phase: \"enqueue\" },\n }\n )\n return toSixbFailure(enqueueError, { allowedCodes: SYNC_RUN_FAILURE_CODES, at })\n}\n\nfunction assertNonBlank(value: string, label: string): void {\n if (!value.trim()) throw new SyncValidationError(`[Sixb] ${label} must not be empty.`)\n}\n",
7
- "import { assertAuthorized } from \"../authorization\"\nimport { resolveExecutionScopeAuthorization } from \"../execution/authorization\"\nimport {\n createPrimitiveExecutionRecord,\n ensureExecutionRecord,\n executionRecordInputFromRuntime,\n} from \"../execution/durable\"\nimport type { ExecutionContext } from \"../execution/types\"\nimport type { SixbRuntimeContext } from \"../runtime/types\"\nimport { SyncValidationError } from \"./errors\"\nimport { dispatchSyncRun } from \"./run-dispatch\"\nimport type { SyncDefinition } from \"./types\"\n\nexport interface SyncRunRequestOptions {\n /** Stable identity used to make dispatch idempotent. */\n readonly runId?: string\n /** Optimistic concurrency guard: fail the run if the dataset moved past this version. */\n readonly expectedLatestVersionId?: string\n readonly commitMessage?: string\n}\n\nexport interface RequestSyncRunInput extends SyncRunRequestOptions {\n readonly syncId: string\n}\n\nexport interface SyncRunRequestResult {\n readonly syncId: string\n readonly runId: string\n /** Durable time at which the run entered the queue. */\n readonly queuedAt: string\n readonly jobId?: string\n readonly created: boolean\n}\n\n/**\n * Authorize and queue a sync run request.\n *\n * Operates on an already-resolved definition and the shared runtime context, so the HTTP route and\n * the runtime verb cannot drift apart.\n *\n * The immutable child execution and queued run are persisted before queue publication.\n */\nexport async function requestSyncRun(\n runtime: SixbRuntimeContext,\n execution: ExecutionContext,\n sync: SyncDefinition,\n options: SyncRunRequestOptions = {}\n): Promise<SyncRunRequestResult> {\n resolveExecutionScopeAuthorization(runtime.projectId, {\n execution,\n authorization: runtime.runtimeAuthorization,\n })\n assertAuthorized(runtime, { kind: \"sync.run\", syncId: sync.id })\n if (!runtime.storage.syncRuns) {\n throw new SyncValidationError(\"[Sixb] Sync run storage is not configured.\")\n }\n\n const queue = runtime.queues.syncRuns\n if (!queue) {\n throw new SyncValidationError(\"[Sixb] Sync run queue is not configured.\")\n }\n\n return dispatchSyncRun({\n errorReporterHost: runtime,\n projectId: runtime.projectId,\n sync,\n storage: runtime.storage,\n queue,\n ...options,\n createExecution: async (executionId, runId) => {\n const caller = await ensureExecutionRecord(\n runtime.storage.executions,\n executionRecordInputFromRuntime({\n execution,\n runtimeAuthorization: runtime.runtimeAuthorization,\n })\n )\n return createPrimitiveExecutionRecord({\n id: executionId,\n primitive: { kind: \"sync\", id: sync.id, runId },\n origin: { type: \"execution\", parent: caller },\n })\n },\n })\n}\n"
8
- ],
9
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,6BAA4B,MAAM;AAAA,EACpC,OAAO;AAClB;;;ACFA;AAyDO,MAAM,mBAAiD;AAAA,EAC/B;AAAA,EAA7B,WAAW,CAAkB,cAA6C;AAAA,IAA7C;AAAA;AAAA,QAEvB,QAAQ,CAAC,OAAqE;AAAA,IAClF,6BAA6B,KAAK;AAAA,IAClC,MAAM,OAAO,KAAK,aAAa,YAAY,MAAM,QAAQ,MAAM,MAAM;AAAA,IACrE,IAAI,CAAC;AAAA,MAAM,MAAM,IAAI,qBAAoB,wBAAwB,MAAM,SAAS;AAAA,IAEhF,OAAO,gBAAgB;AAAA,MACrB,mBAAmB,KAAK;AAAA,MACxB,WAAW,KAAK,aAAa;AAAA,MAC7B;AAAA,MACA,SAAS,KAAK,aAAa;AAAA,MAC3B,OAAO,KAAK,aAAa,OAAO;AAAA,MAChC,OAAO,MAAM;AAAA,MACb,yB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