@sixb/core 0.1.14 → 0.1.16

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 (259) hide show
  1. package/dist/actions/index.js +26 -26
  2. package/dist/actions/worker.js +1 -1
  3. package/dist/agents/index.js +41 -41
  4. package/dist/agents/index.js.map +1 -1
  5. package/dist/agents/streams/index.js +2 -2
  6. package/dist/agents/streams/internal.js +2 -2
  7. package/dist/auth/index.js +6 -6
  8. package/dist/authorization/index.js +3 -3
  9. package/dist/bootstrap/index.js +44 -44
  10. package/dist/{chunk-6rzb1g6h.js → chunk-2xvgy3x5.js} +2 -2
  11. package/dist/{chunk-16jenmzw.js → chunk-3q7z9hd4.js} +33 -33
  12. package/dist/{chunk-16jenmzw.js.map → chunk-3q7z9hd4.js.map} +1 -1
  13. package/dist/{chunk-hxgj4kzd.js → chunk-40qb8wpe.js} +11 -11
  14. package/dist/{chunk-hxgj4kzd.js.map → chunk-40qb8wpe.js.map} +3 -3
  15. package/dist/{chunk-vn3yh259.js → chunk-4gmng3vf.js} +1 -1
  16. package/dist/{chunk-znw0zvy4.js → chunk-4wn7bxxa.js} +25 -7
  17. package/dist/chunk-4wn7bxxa.js.map +12 -0
  18. package/dist/{chunk-gct3m1da.js → chunk-667x4drs.js} +3 -3
  19. package/dist/{chunk-rzcjp5m2.js → chunk-69kt9q43.js} +2 -2
  20. package/dist/{chunk-3qpcrcj8.js → chunk-6aawea28.js} +2 -4
  21. package/dist/chunk-6aawea28.js.map +10 -0
  22. package/dist/{chunk-rzkr70gr.js → chunk-6fsr7y93.js} +5 -1
  23. package/dist/{chunk-rzkr70gr.js.map → chunk-6fsr7y93.js.map} +3 -3
  24. package/dist/{chunk-3fpgxpsq.js → chunk-6z1q7j19.js} +144 -73
  25. package/dist/{chunk-3fpgxpsq.js.map → chunk-6z1q7j19.js.map} +6 -6
  26. package/dist/{chunk-ypj2wqtj.js → chunk-70jmg2zx.js} +2 -2
  27. package/dist/{chunk-m8zkvep1.js → chunk-7g2gjvah.js} +1 -1
  28. package/dist/{chunk-pvgpckm1.js → chunk-8x74221e.js} +10 -10
  29. package/dist/{chunk-ma1mhh7w.js → chunk-a7ne02hk.js} +6 -6
  30. package/dist/{chunk-bxx3ms5t.js → chunk-b9y8hcm2.js} +2 -2
  31. package/dist/{chunk-ww185kt6.js → chunk-chdg6eqq.js} +2 -2
  32. package/dist/{chunk-y487ywrv.js → chunk-cq44v1a6.js} +4 -4
  33. package/dist/{chunk-4ypbe95r.js → chunk-cxj8y8t0.js} +2 -2
  34. package/dist/{chunk-3a338wrp.js → chunk-dp7yk20b.js} +1 -1
  35. package/dist/{chunk-dv4ct8mp.js → chunk-dsv8kdgk.js} +4 -4
  36. package/dist/{chunk-dsfw1bdr.js → chunk-f72rbvsb.js} +2 -2
  37. package/dist/{chunk-4tnrzqqh.js → chunk-fj1dvp37.js} +1 -1
  38. package/dist/{chunk-ht4a7mjg.js → chunk-g4rbm4a6.js} +42 -8
  39. package/dist/{chunk-ht4a7mjg.js.map → chunk-g4rbm4a6.js.map} +3 -3
  40. package/dist/{chunk-wnxabtn4.js → chunk-gkxsenvp.js} +19 -11
  41. package/dist/{chunk-wnxabtn4.js.map → chunk-gkxsenvp.js.map} +4 -4
  42. package/dist/{chunk-vef6qa14.js → chunk-gmdvns8f.js} +2 -2
  43. package/dist/{chunk-728fp090.js → chunk-h044jb97.js} +1072 -1075
  44. package/dist/chunk-h044jb97.js.map +15 -0
  45. package/dist/{chunk-00pfcqh4.js → chunk-h4138ww2.js} +130 -71
  46. package/dist/{chunk-00pfcqh4.js.map → chunk-h4138ww2.js.map} +5 -5
  47. package/dist/{chunk-yvf2jqj8.js → chunk-h866d223.js} +1 -1
  48. package/dist/{chunk-qma80ych.js → chunk-hn2r7z41.js} +3 -2
  49. package/dist/chunk-hn2r7z41.js.map +11 -0
  50. package/dist/{chunk-bdhfn0ww.js → chunk-kkqwzy6h.js} +1 -1
  51. package/dist/{chunk-wn7mznxc.js → chunk-kttr5ftm.js} +5 -5
  52. package/dist/{chunk-kxea54yg.js → chunk-kvysp909.js} +3 -3
  53. package/dist/{chunk-p1683c0v.js → chunk-kyjcwqz6.js} +5 -2
  54. package/dist/{chunk-p1683c0v.js.map → chunk-kyjcwqz6.js.map} +3 -3
  55. package/dist/{chunk-ffwvdgk1.js → chunk-nj0020ay.js} +1 -1
  56. package/dist/{chunk-q2xghyft.js → chunk-nkbev3tr.js} +5 -5
  57. package/dist/{chunk-cbn96bve.js → chunk-nvymebc1.js} +2 -2
  58. package/dist/{chunk-2fv8sajb.js → chunk-qnd7ehe5.js} +2 -2
  59. package/dist/{chunk-jfdggg1p.js → chunk-sbcm1b92.js} +5 -5
  60. package/dist/{chunk-d8yes9yx.js → chunk-swxzncrv.js} +1 -1
  61. package/dist/{chunk-drz59ve0.js → chunk-tkdbge6v.js} +1 -1
  62. package/dist/{chunk-ky7zpbtt.js → chunk-tnvafr7g.js} +1 -1
  63. package/dist/{chunk-y6vnvayj.js → chunk-vjcd8d27.js} +1 -1
  64. package/dist/{chunk-hj0n3c2p.js → chunk-vjqt7q3a.js} +45 -27
  65. package/dist/{chunk-hj0n3c2p.js.map → chunk-vjqt7q3a.js.map} +3 -3
  66. package/dist/{chunk-z9h698s8.js → chunk-vsvrv7n8.js} +1 -1
  67. package/dist/{chunk-xgptywp0.js → chunk-y2aq6ag9.js} +1 -1
  68. package/dist/{chunk-e2c5yxfe.js → chunk-zb47r1c8.js} +2 -2
  69. package/dist/{chunk-3nx8vj5a.js → chunk-zvmr2hqk.js} +3 -2
  70. package/dist/chunk-zvmr2hqk.js.map +12 -0
  71. package/dist/deploy/define.d.ts +4 -0
  72. package/dist/deploy/define.d.ts.map +1 -0
  73. package/dist/deploy/index.d.ts +3 -0
  74. package/dist/deploy/index.d.ts.map +1 -0
  75. package/dist/deploy/index.js +10 -0
  76. package/dist/deploy/index.js.map +10 -0
  77. package/dist/deploy/internal.d.ts +3 -0
  78. package/dist/deploy/internal.d.ts.map +1 -0
  79. package/dist/deploy/internal.js +244 -0
  80. package/dist/deploy/internal.js.map +11 -0
  81. package/dist/deploy/services.d.ts +8 -0
  82. package/dist/deploy/services.d.ts.map +1 -0
  83. package/dist/deploy/types.d.ts +309 -0
  84. package/dist/deploy/types.d.ts.map +1 -0
  85. package/dist/deploy/validation.d.ts +7 -0
  86. package/dist/deploy/validation.d.ts.map +1 -0
  87. package/dist/error-reporting/internal.js +3 -3
  88. package/dist/errors/catalog.d.ts +4 -0
  89. package/dist/errors/catalog.d.ts.map +1 -1
  90. package/dist/errors/internal.js +1 -1
  91. package/dist/events/index.js +3 -3
  92. package/dist/execution/agent.js +38 -38
  93. package/dist/execution/primitive.js +34 -34
  94. package/dist/execution/request.js +36 -36
  95. package/dist/execution/request.js.map +1 -1
  96. package/dist/index.js +56 -56
  97. package/dist/index.js.map +1 -1
  98. package/dist/maintenance/ontology-maintenance.d.ts +2 -0
  99. package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
  100. package/dist/maintenance/types.d.ts +8 -2
  101. package/dist/maintenance/types.d.ts.map +1 -1
  102. package/dist/materialization/dataset-watermark.d.ts +6 -1
  103. package/dist/materialization/dataset-watermark.d.ts.map +1 -1
  104. package/dist/materialization/index.js +1 -1
  105. package/dist/materialization/model.d.ts +6 -0
  106. package/dist/materialization/model.d.ts.map +1 -1
  107. package/dist/materializer/index.js +22 -22
  108. package/dist/materializer/index.js.map +1 -1
  109. package/dist/materializer/projections/finish-run.d.ts.map +1 -1
  110. package/dist/materializer/projections/replace.d.ts.map +1 -1
  111. package/dist/materializer/projections/source-materialization.d.ts +6 -2
  112. package/dist/materializer/projections/source-materialization.d.ts.map +1 -1
  113. package/dist/models/embedding-model.d.ts +4 -0
  114. package/dist/models/embedding-model.d.ts.map +1 -1
  115. package/dist/models/execution/index.js +19 -19
  116. package/dist/models/index.js +2 -2
  117. package/dist/objects/index.js +25 -25
  118. package/dist/objects/query/index.js +21 -21
  119. package/dist/objects/query/index.js.map +1 -1
  120. package/dist/objects/vectors/indexing-generate.d.ts.map +1 -1
  121. package/dist/objects/vectors/profile.d.ts.map +1 -1
  122. package/dist/objects/vectors/query.d.ts +1 -1
  123. package/dist/objects/vectors/query.d.ts.map +1 -1
  124. package/dist/objects/vectors/resolve-query.d.ts.map +1 -1
  125. package/dist/objects/vectors/types.d.ts +1 -1
  126. package/dist/objects/vectors/types.d.ts.map +1 -1
  127. package/dist/ontology/builders.d.ts +13 -4
  128. package/dist/ontology/builders.d.ts.map +1 -1
  129. package/dist/ontology/index.js +3 -3
  130. package/dist/ontology/internal.js +2 -2
  131. package/dist/ontology/vector-profiles.d.ts.map +1 -1
  132. package/dist/pipelines/index.js +23 -23
  133. package/dist/projections/internal.js +20 -20
  134. package/dist/projections/types.d.ts +1 -1
  135. package/dist/projections/types.d.ts.map +1 -1
  136. package/dist/queues/in-memory.d.ts +1 -1
  137. package/dist/queues/in-memory.d.ts.map +1 -1
  138. package/dist/runtime/internal.js +23 -23
  139. package/dist/sandboxes/index.js +5 -5
  140. package/dist/shares/internal.js +18 -18
  141. package/dist/shares/internal.js.map +1 -1
  142. package/dist/storage/action-runs/failure.js +2 -2
  143. package/dist/storage/agents/provider.js +1 -1
  144. package/dist/storage/ai-limits/enforcement.js +2 -2
  145. package/dist/storage/connector-connections/provider.js +1 -1
  146. package/dist/storage/file-upload-sessions/provider.js +7 -7
  147. package/dist/storage/index.d.ts +2 -2
  148. package/dist/storage/index.d.ts.map +1 -1
  149. package/dist/storage/index.js +33 -33
  150. package/dist/storage/index.js.map +1 -1
  151. package/dist/storage/internal.js +1 -1
  152. package/dist/storage/ontology/in-memory/sources.d.ts +6 -3
  153. package/dist/storage/ontology/in-memory/sources.d.ts.map +1 -1
  154. package/dist/storage/ontology/index.d.ts +1 -1
  155. package/dist/storage/ontology/index.d.ts.map +1 -1
  156. package/dist/storage/ontology/provider.d.ts +16 -3
  157. package/dist/storage/ontology/provider.d.ts.map +1 -1
  158. package/dist/storage/ontology/provider.js +8 -4
  159. package/dist/storage/ontology/provider.js.map +1 -1
  160. package/dist/storage/ontology/sources.d.ts +36 -8
  161. package/dist/storage/ontology/sources.d.ts.map +1 -1
  162. package/dist/storage/projection-runs/in-memory.d.ts +3 -1
  163. package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
  164. package/dist/storage/projection-runs/index.d.ts +1 -1
  165. package/dist/storage/projection-runs/index.d.ts.map +1 -1
  166. package/dist/storage/projection-runs/lifecycle.d.ts +12 -0
  167. package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
  168. package/dist/storage/projection-runs/provider.js +10 -4
  169. package/dist/storage/projection-runs/provider.js.map +1 -1
  170. package/dist/storage/projection-runs/types.d.ts +32 -1
  171. package/dist/storage/projection-runs/types.d.ts.map +1 -1
  172. package/dist/storage/workflow-runs/provider.js +7 -7
  173. package/dist/syncs/index.js +24 -24
  174. package/dist/testing/index.js +306 -64
  175. package/dist/testing/index.js.map +4 -4
  176. package/dist/testing/ontology-storage-contract.d.ts.map +1 -1
  177. package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
  178. package/dist/webhooks/internal.js +19 -19
  179. package/dist/webhooks/internal.js.map +1 -1
  180. package/dist/workers/index.js +1 -1
  181. package/dist/workflows/index.js +41 -41
  182. package/package.json +13 -1
  183. package/src/deploy/define.ts +6 -0
  184. package/src/deploy/index.ts +41 -0
  185. package/src/deploy/internal.ts +7 -0
  186. package/src/deploy/services.ts +51 -0
  187. package/src/deploy/types.ts +338 -0
  188. package/src/deploy/validation.ts +261 -0
  189. package/src/errors/catalog.ts +4 -0
  190. package/src/maintenance/ontology-maintenance.ts +32 -2
  191. package/src/maintenance/types.ts +8 -2
  192. package/src/materialization/dataset-watermark.ts +6 -4
  193. package/src/materialization/model.ts +7 -0
  194. package/src/materializer/README.md +26 -6
  195. package/src/materializer/projections/finish-run.ts +129 -26
  196. package/src/materializer/projections/replace.ts +67 -49
  197. package/src/materializer/projections/source-materialization.ts +11 -6
  198. package/src/models/embedding-model.ts +12 -0
  199. package/src/models/execution/embedding.ts +5 -1
  200. package/src/objects/query/validate.ts +1 -10
  201. package/src/objects/vectors/README.md +8 -0
  202. package/src/objects/vectors/handle.ts +1 -1
  203. package/src/objects/vectors/indexing-generate.ts +5 -1
  204. package/src/objects/vectors/profile.ts +2 -0
  205. package/src/objects/vectors/query.ts +18 -4
  206. package/src/objects/vectors/resolve-query.ts +9 -5
  207. package/src/objects/vectors/types.ts +3 -1
  208. package/src/ontology/builders.ts +21 -7
  209. package/src/ontology/vector-profiles.ts +1 -0
  210. package/src/projections/types.ts +1 -0
  211. package/src/storage/index.ts +6 -1
  212. package/src/storage/ontology/in-memory/sources.ts +119 -55
  213. package/src/storage/ontology/index.ts +4 -1
  214. package/src/storage/ontology/provider.ts +64 -7
  215. package/src/storage/ontology/sources.ts +42 -8
  216. package/src/storage/projection-runs/in-memory.ts +41 -2
  217. package/src/storage/projection-runs/index.ts +2 -0
  218. package/src/storage/projection-runs/lifecycle.ts +61 -4
  219. package/src/storage/projection-runs/types.ts +41 -1
  220. package/src/testing/ontology-storage-contract.ts +141 -15
  221. package/src/testing/projection-run-storage-contract.ts +174 -1
  222. package/dist/chunk-3nx8vj5a.js.map +0 -12
  223. package/dist/chunk-3qpcrcj8.js.map +0 -10
  224. package/dist/chunk-728fp090.js.map +0 -15
  225. package/dist/chunk-qma80ych.js.map +0 -11
  226. package/dist/chunk-znw0zvy4.js.map +0 -12
  227. /package/dist/{chunk-6rzb1g6h.js.map → chunk-2xvgy3x5.js.map} +0 -0
  228. /package/dist/{chunk-vn3yh259.js.map → chunk-4gmng3vf.js.map} +0 -0
  229. /package/dist/{chunk-gct3m1da.js.map → chunk-667x4drs.js.map} +0 -0
  230. /package/dist/{chunk-rzcjp5m2.js.map → chunk-69kt9q43.js.map} +0 -0
  231. /package/dist/{chunk-ypj2wqtj.js.map → chunk-70jmg2zx.js.map} +0 -0
  232. /package/dist/{chunk-m8zkvep1.js.map → chunk-7g2gjvah.js.map} +0 -0
  233. /package/dist/{chunk-pvgpckm1.js.map → chunk-8x74221e.js.map} +0 -0
  234. /package/dist/{chunk-ma1mhh7w.js.map → chunk-a7ne02hk.js.map} +0 -0
  235. /package/dist/{chunk-bxx3ms5t.js.map → chunk-b9y8hcm2.js.map} +0 -0
  236. /package/dist/{chunk-ww185kt6.js.map → chunk-chdg6eqq.js.map} +0 -0
  237. /package/dist/{chunk-y487ywrv.js.map → chunk-cq44v1a6.js.map} +0 -0
  238. /package/dist/{chunk-4ypbe95r.js.map → chunk-cxj8y8t0.js.map} +0 -0
  239. /package/dist/{chunk-3a338wrp.js.map → chunk-dp7yk20b.js.map} +0 -0
  240. /package/dist/{chunk-dv4ct8mp.js.map → chunk-dsv8kdgk.js.map} +0 -0
  241. /package/dist/{chunk-dsfw1bdr.js.map → chunk-f72rbvsb.js.map} +0 -0
  242. /package/dist/{chunk-4tnrzqqh.js.map → chunk-fj1dvp37.js.map} +0 -0
  243. /package/dist/{chunk-vef6qa14.js.map → chunk-gmdvns8f.js.map} +0 -0
  244. /package/dist/{chunk-yvf2jqj8.js.map → chunk-h866d223.js.map} +0 -0
  245. /package/dist/{chunk-bdhfn0ww.js.map → chunk-kkqwzy6h.js.map} +0 -0
  246. /package/dist/{chunk-wn7mznxc.js.map → chunk-kttr5ftm.js.map} +0 -0
  247. /package/dist/{chunk-kxea54yg.js.map → chunk-kvysp909.js.map} +0 -0
  248. /package/dist/{chunk-ffwvdgk1.js.map → chunk-nj0020ay.js.map} +0 -0
  249. /package/dist/{chunk-q2xghyft.js.map → chunk-nkbev3tr.js.map} +0 -0
  250. /package/dist/{chunk-cbn96bve.js.map → chunk-nvymebc1.js.map} +0 -0
  251. /package/dist/{chunk-2fv8sajb.js.map → chunk-qnd7ehe5.js.map} +0 -0
  252. /package/dist/{chunk-jfdggg1p.js.map → chunk-sbcm1b92.js.map} +0 -0
  253. /package/dist/{chunk-d8yes9yx.js.map → chunk-swxzncrv.js.map} +0 -0
  254. /package/dist/{chunk-drz59ve0.js.map → chunk-tkdbge6v.js.map} +0 -0
  255. /package/dist/{chunk-ky7zpbtt.js.map → chunk-tnvafr7g.js.map} +0 -0
  256. /package/dist/{chunk-y6vnvayj.js.map → chunk-vjcd8d27.js.map} +0 -0
  257. /package/dist/{chunk-z9h698s8.js.map → chunk-vsvrv7n8.js.map} +0 -0
  258. /package/dist/{chunk-xgptywp0.js.map → chunk-y2aq6ag9.js.map} +0 -0
  259. /package/dist/{chunk-e2c5yxfe.js.map → chunk-zb47r1c8.js.map} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-cd234ba4.js";
9
9
  import {
10
10
  PipelineError2
11
- } from "./chunk-jfdggg1p.js";
11
+ } from "./chunk-sbcm1b92.js";
12
12
 
13
13
  // src/lake-storage/sql-transforms.ts
14
14
  var SQL_DIALECT = {
@@ -4,7 +4,8 @@ var PROJECTION_RUN_FAILURE_CODES2 = [
4
4
  "internal.unexpected",
5
5
  "runtime.cancelled",
6
6
  "queue.enqueue_failed",
7
- "projection.execution_failed"
7
+ "projection.execution_failed",
8
+ "storage.unavailable"
8
9
  ];
9
10
 
10
11
  // src/storage/projection-runs/types.ts
@@ -27,4 +28,4 @@ function projectionRunObjectTypesVisible2(run, canView) {
27
28
 
28
29
  export { PROJECTION_RUN_FAILURE_CODES2, PROJECTION_RUN_PROGRESS_KEYS2, zeroProjectionRunProgress2, projectionRunObjectTypesVisible2 };
29
30
 
30
- //# debugId=20098923B6EB738064756E2164756E21
31
+ //# debugId=6E88BA6849E66AE464756E2164756E21
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/projections/types.ts", "../src/storage/projection-runs/types.ts"],
4
+ "sourcesContent": [
5
+ "import type { SixbErrorCode } from \"../errors/types\"\n\n/** Error codes a projection run can persist and expose through its public contract. */\nexport const PROJECTION_RUN_FAILURE_CODES = [\n \"internal.unexpected\",\n \"runtime.cancelled\",\n \"queue.enqueue_failed\",\n \"projection.execution_failed\",\n \"storage.unavailable\",\n] as const satisfies readonly [SixbErrorCode, ...SixbErrorCode[]]\n\nexport type ProjectionRunFailureCode = (typeof PROJECTION_RUN_FAILURE_CODES)[number]\n\n/**\n * Lowered, serializable definition interfaces for projection DSL.\n *\n * These are the runtime-inspectable data structures that projection builders\n * lower into. They use plain string ids (no tokens, no methods) so they can\n * be stored, serialized, and introspected by tooling.\n */\n\n/**\n * Describes how a foreign key column in a dataset resolves to a link target.\n *\n * The source can be either a projected source property or a raw dataset field.\n * Its value equals the target object's primary property value, creating an\n * implicit link between source and target.\n *\n * `targetObjectTypeId` declares the concrete target type for this projection.\n * It must be the same type or a subtype (via `extends`) of the link's declared\n * target at the ontology level. Validation of the subtype relationship happens\n * at Sixb startup (Increment 7), not at DSL build time.\n */\nexport interface ForeignKeyDescriptor {\n readonly linkId: string\n /** Object property holding the target id. Mutually exclusive with sourceField. */\n readonly sourcePropertyId?: string\n /** Dataset column holding the target id. Mutually exclusive with sourcePropertyId. */\n readonly sourceField?: string\n readonly targetObjectTypeId: string\n}\n\n/** Resolves competing source-projection and managed-edit values for projected properties. */\nexport type SourceEditConflictResolution =\n | { readonly strategy: \"editsWin\" }\n | { readonly strategy: \"mostRecent\"; readonly sourceTimestamp: string }\n\n/**\n * Lowered, serializable definition for projecting a dataset into object instances.\n *\n * Each row contributes one complete object root to an authoritative replacement snapshot, with\n * properties mapped from dataset columns to object type properties. Duplicate roots are rejected.\n * FK links are resolved from source property or dataset field values to target object primary\n * values.\n */\nexport interface ObjectProjectionDefinition {\n readonly _tag: \"ObjectProjectionDefinition\"\n readonly id: string\n readonly objectTypeId: string\n readonly datasetId: string\n /** Maps object type property id -> dataset column name. */\n readonly properties: Readonly<Record<string, string>>\n /** Maps link id -> FK descriptor. Empty `{}` when no FK links are projected. */\n readonly links: Readonly<Record<string, ForeignKeyDescriptor>>\n /** Defaults to `editsWin` when omitted by a legacy lowered definition. */\n readonly conflictResolution?: SourceEditConflictResolution\n}\n\n/**\n * Lowered, serializable definition for projecting a join dataset into link instances.\n *\n * Each row in the join dataset contributes one complete link root to an authoritative replacement\n * snapshot, identified by its source, link id, and target. Duplicate roots are rejected.\n */\nexport interface LinkProjectionDefinition {\n readonly _tag: \"LinkProjectionDefinition\"\n readonly id: string\n readonly linkId: string\n readonly sourceObjectTypeId: string\n readonly targetObjectTypeId: string\n readonly datasetId: string\n /** Dataset column holding the source object's primary property value. */\n readonly sourceField: string\n /** Dataset column holding the target object's primary property value. */\n readonly targetField: string\n}\n\n/** Dataset columns that produce one telemetry property value. */\nexport interface TelemetryProjectionPropertyMapping {\n /** Dataset column holding the telemetry value. */\n readonly valueField: string\n /** Dataset column holding the telemetry unit, when the property requires one. */\n readonly unitField?: string\n}\n\n/**\n * Lowered, serializable definition for projecting dataset rows into telemetry history.\n *\n * Each row shares one target object id and observation timestamp, then contributes up to one\n * telemetry point for every mapped property. A property-token projection is lowered to the same\n * shape with one entry, so execution and ownership have one canonical contract.\n */\nexport interface TelemetryProjectionDefinition {\n readonly _tag: \"TelemetryProjectionDefinition\"\n readonly id: string\n readonly objectTypeId: string\n readonly datasetId: string\n /** Dataset column holding the target object's primary id. */\n readonly objectIdField: string\n /** Dataset column holding the telemetry observation timestamp. */\n readonly atField: string\n /** Maps telemetry property id -> value and optional unit dataset columns. */\n readonly properties: Readonly<Record<string, TelemetryProjectionPropertyMapping>>\n}\n\n/** Union of all projection definition types. */\nexport type ProjectionDefinition =\n | ObjectProjectionDefinition\n | LinkProjectionDefinition\n | TelemetryProjectionDefinition\n\nexport interface ProjectionOwnership {\n readonly objects: readonly {\n readonly objectTypeId: string\n readonly existence: boolean\n readonly propertyIds: readonly string[]\n }[]\n readonly links: readonly {\n readonly sourceObjectTypeId: string\n readonly linkId: string\n }[]\n readonly telemetry: readonly {\n readonly objectTypeId: string\n readonly propertyId: string\n }[]\n}\n\n/** Canonical correlation between a projection kind and its materialization protocol. */\nexport type ProjectionProtocolIdentity =\n | { readonly projectionKind: \"object\"; readonly protocol: \"replacement\" }\n | { readonly projectionKind: \"link\"; readonly protocol: \"replacement\" }\n | { readonly projectionKind: \"telemetry\"; readonly protocol: \"telemetry\" }\n\nexport type ProjectionKind = ProjectionProtocolIdentity[\"projectionKind\"]\n\nexport interface ObjectProjectionTarget {\n readonly objectTypeId: string\n}\n\nexport interface LinkProjectionTarget {\n readonly sourceObjectTypeId: string\n readonly targetObjectTypeId: string\n}\n\nexport interface ProjectionTargetByKind {\n readonly object: ObjectProjectionTarget\n readonly link: LinkProjectionTarget\n readonly telemetry: ObjectProjectionTarget\n}\n\n/** Object types affected by one projection, correlated with its projection kind. */\nexport type ProjectionTarget<TKind extends ProjectionKind = ProjectionKind> =\n ProjectionTargetByKind[TKind]\n\n/**\n * Frozen semantic identity used to dispatch one registered projection.\n *\n * Dataset version metadata is attached only when a committed dataset event is routed. Keeping the\n * registry-owned fields together prevents the orchestrator from recomputing ontology semantics.\n */\nexport type ProjectionDispatchDescriptor = ProjectionDispatchDescriptorBase &\n ProjectionProtocolIdentity\n\ninterface ProjectionDispatchDescriptorBase {\n readonly projectionId: string\n readonly datasetId: string\n readonly ontologyRevision: string\n readonly projectionRevision: string\n readonly ownershipHash: string\n}\n\nexport interface ResolvedProjection<TDefinition extends ProjectionDefinition> {\n readonly projectionId: string\n readonly datasetId: string\n readonly projectionRevision: string\n readonly ownershipHash: string\n readonly ownership: ProjectionOwnership\n readonly definition: TDefinition\n}\n",
6
+ "import type { SixbFailure } from \"../../errors/types\"\nimport type {\n PinnedDatasetVersion,\n ProjectionExecution,\n ProjectionMaterializationIdentity,\n ProjectionRunTerminalDecision,\n} from \"../../materialization/model\"\nimport type {\n LinkProjectionTarget,\n ObjectProjectionTarget,\n ProjectionKind,\n ProjectionRunFailureCode,\n ProjectionTarget,\n} from \"../../projections/types\"\n\nexport type { ProjectionRunFailureCode } from \"../../projections/types\"\nexport { PROJECTION_RUN_FAILURE_CODES } from \"../../projections/types\"\n\n/**\n * `superseded` ends a replacement run whose output would be stale on arrival: a run of the same\n * projection pinned to a later dataset version exists and has not failed. Telemetry runs append\n * readings rather than replace a source, so none is ever superseded.\n */\nexport type ProjectionRunStatus =\n | \"queued\"\n | \"running\"\n | \"succeeded\"\n | \"failed\"\n | \"cancelled\"\n | \"superseded\"\n\nexport interface ProjectionRunProgress {\n /** Physical immutable-version rows consumed, before normalization or semantic materialization. */\n readonly sourceRowsRead: number\n /** Physical rows intentionally skipped because a required mapped value was blank. */\n readonly sourceRowsSkipped: number\n /** Maximum complete change records consumed by one incremental attempt; not a recovery cursor. */\n readonly sourceChangesRead?: number\n}\n\nconst progressKeyFlags: Record<keyof ProjectionRunProgress, true> = {\n sourceRowsRead: true,\n sourceRowsSkipped: true,\n sourceChangesRead: true,\n}\n\nexport const PROJECTION_RUN_PROGRESS_KEYS = Object.keys(\n progressKeyFlags\n) as readonly (keyof ProjectionRunProgress)[]\n\nexport function zeroProjectionRunProgress(): ProjectionRunProgress {\n return { sourceRowsRead: 0, sourceRowsSkipped: 0 }\n}\n\nexport interface ProjectionTelemetryCheckpoint {\n readonly fixedBatchSize: number\n readonly nextBatchOrdinal: number\n readonly nextRowOffset: number\n readonly inputExhausted: boolean\n}\n\n/**\n * The object a telemetry batch is waiting for, and when this run first found it missing.\n *\n * A projection's dataset can legitimately be materialized before the objects it references, so\n * the run waits instead of failing. The wait needs a start, and the run has no other durable one:\n * `startedAt` is when the run began, which on a batched projection is long before the batch that\n * cannot commit, and `attempt` counts every reclaim including the ones an unreachable queue caused.\n *\n * Cleared by any committed batch, so a run that is making progress never carries a stale wait.\n */\nexport interface ProjectionMissingTarget {\n readonly objectTypeId: string\n readonly objectId: string\n /** The batch that could not commit because of it. */\n readonly batchOrdinal: number\n readonly firstSeenAt: Date\n}\n\ninterface ProjectionRunRecordBase {\n readonly id: string\n readonly projectId: string\n readonly executionId: string\n readonly status: ProjectionRunStatus\n readonly attempt: number\n readonly progress: ProjectionRunProgress\n readonly queuedAt: Date\n readonly startedAt?: Date\n readonly finishedAt?: Date\n /**\n * The run's most recent failure, read with its status: on a `running` run, why its last attempt\n * failed while the queue retries it; on a `failed` or `cancelled` run, why it ended. Cleared when\n * the run succeeds or is superseded, so a present error always describes something current.\n */\n readonly error?: SixbFailure<ProjectionRunFailureCode>\n}\n\ntype ProjectionIdentity<TKind extends ProjectionKind> = Extract<\n ProjectionMaterializationIdentity,\n { readonly projectionKind: TKind }\n>\n\nexport type ObjectProjectionRunRecord = ProjectionRunRecordBase & {\n readonly identity: ProjectionIdentity<\"object\">\n readonly target: ObjectProjectionTarget\n readonly telemetryCheckpoint?: never\n readonly missingTarget?: never\n}\n\nexport type LinkProjectionRunRecord = ProjectionRunRecordBase & {\n readonly identity: ProjectionIdentity<\"link\">\n readonly target: LinkProjectionTarget\n readonly telemetryCheckpoint?: never\n readonly missingTarget?: never\n}\n\nexport type TelemetryProjectionRunRecord = ProjectionRunRecordBase & {\n readonly identity: ProjectionIdentity<\"telemetry\">\n readonly target: ObjectProjectionTarget\n readonly telemetryCheckpoint: ProjectionTelemetryCheckpoint\n /**\n * Only telemetry carries this: `MaterializationObjectNotFoundError` is raised by telemetry\n * validation alone, and only a batched protocol has a checkpoint to anchor the wait to.\n */\n readonly missingTarget?: ProjectionMissingTarget\n}\n\n/** Durable projection lifecycle state. The execution token is deliberately returned separately. */\nexport type ProjectionRunRecord =\n | ObjectProjectionRunRecord\n | LinkProjectionRunRecord\n | TelemetryProjectionRunRecord\n\nexport function projectionRunObjectTypesVisible(\n run: ProjectionRunRecord,\n canView: (objectTypeId: string) => boolean\n): boolean {\n const target: ProjectionTarget = run.target\n if (\"sourceObjectTypeId\" in target) {\n return canView(target.sourceObjectTypeId) && canView(target.targetObjectTypeId)\n }\n return canView(target.objectTypeId)\n}\n\ninterface ProjectionRunAdmissionBase {\n readonly id: string\n readonly projectId: string\n readonly executionId: string\n readonly queuedAt?: Date\n}\n\nexport type QueueProjectionRunInput =\n | (ProjectionRunAdmissionBase & {\n readonly identity: ProjectionIdentity<\"object\">\n readonly target: ObjectProjectionRunRecord[\"target\"]\n readonly fixedBatchSize?: never\n })\n | (ProjectionRunAdmissionBase & {\n readonly identity: ProjectionIdentity<\"link\">\n readonly target: LinkProjectionRunRecord[\"target\"]\n readonly fixedBatchSize?: never\n })\n | (ProjectionRunAdmissionBase & {\n readonly identity: ProjectionIdentity<\"telemetry\">\n readonly target: TelemetryProjectionRunRecord[\"target\"]\n readonly fixedBatchSize: number\n })\n\nexport type StartOrReclaimProjectionRunInput = QueueProjectionRunInput extends infer TInput\n ? TInput extends QueueProjectionRunInput\n ? Omit<TInput, \"executionId\" | \"queuedAt\"> & { readonly startedAt?: Date }\n : never\n : never\n\nexport interface FailProjectionRunEnqueueInput {\n readonly id: string\n readonly projectId: string\n readonly finishedAt?: Date\n readonly error: SixbFailure<ProjectionRunFailureCode>\n}\n\nexport interface ProjectionRunClaim {\n readonly run: ProjectionRunRecord\n readonly execution: ProjectionExecution\n}\n\nexport interface LockProjectionRunForMaterializationInput {\n readonly id: string\n readonly projectId: string\n readonly executionToken: string\n readonly identity: ProjectionMaterializationIdentity\n}\n\nexport interface UpdateProjectionRunInput extends LockProjectionRunForMaterializationInput {\n readonly progress: Partial<ProjectionRunProgress>\n}\n\nexport type FinishProjectionRunInput = ProjectionRunTerminalDecision &\n LockProjectionRunForMaterializationInput & {\n readonly finishedAt?: Date\n readonly progress?: Partial<ProjectionRunProgress>\n }\n\nexport interface AdvanceProjectionTelemetryCheckpointInput\n extends LockProjectionRunForMaterializationInput {\n /** Must equal the run's current nextBatchOrdinal. */\n readonly batchOrdinal: number\n /** Physical dataset rows consumed by this batch, including skipped rows. */\n readonly batchRowCount: number\n /** Physical rows intentionally skipped inside this batch. */\n readonly batchRowsSkipped: number\n /** True when this batch consumed the final row of the immutable dataset version. */\n readonly inputExhausted: boolean\n}\n\nexport interface RecordProjectionMissingTargetInput\n extends LockProjectionRunForMaterializationInput {\n readonly missingTarget: ProjectionMissingTarget\n}\n\nexport interface RecordProjectionAttemptFailureInput\n extends LockProjectionRunForMaterializationInput {\n readonly error: SixbFailure<ProjectionRunFailureCode>\n}\n\nexport interface FindSupersedingProjectionRunInput {\n readonly projectId: string\n /** The run that may be superseded. */\n readonly id: string\n}\n\nexport interface ListProjectionRunsInput {\n readonly projectId: string\n readonly projectionId?: string\n readonly projectionKind?: ProjectionKind\n readonly datasetId?: string\n readonly datasetVersionId?: string\n /**\n * Viewable object type ids. A run is included only if every target type is present. Omit for an\n * unrestricted internal execution; an empty set matches no runs.\n */\n readonly objectTypeIds?: readonly string[]\n readonly statuses?: readonly ProjectionRunStatus[]\n readonly startedAfter?: Date\n readonly startedBefore?: Date\n readonly limit?: number\n readonly offset?: number\n readonly order?: \"asc\" | \"desc\"\n}\n\nexport interface ListProjectionRunsResult {\n readonly runs: readonly ProjectionRunRecord[]\n readonly hasMore: boolean\n readonly total: number\n}\n\nexport interface ListLatestProjectionRunsInput {\n readonly projectId: string\n readonly projectionIds: readonly string[]\n}\n\nexport interface ListLatestProjectionRunsResult {\n readonly runs: readonly ProjectionRunRecord[]\n}\n\nexport interface ProjectionRunStorage {\n queue(input: QueueProjectionRunInput): Promise<ProjectionRunRecord>\n startOrReclaim(input: StartOrReclaimProjectionRunInput): Promise<ProjectionRunClaim>\n failEnqueue(input: FailProjectionRunEnqueueInput): Promise<ProjectionRunRecord>\n /** Transactionally fences the current execution before ontology materialization writes. */\n lockForMaterialization(\n input: LockProjectionRunForMaterializationInput\n ): Promise<ProjectionRunRecord>\n /** Updates physical source progress only. */\n update(input: UpdateProjectionRunInput): Promise<ProjectionRunRecord>\n /**\n * Advances telemetry progress atomically with the corresponding ontology commit.\n *\n * Clears any recorded missing target: a batch that commits is a batch that was not waiting.\n */\n advanceTelemetryCheckpoint(\n input: AdvanceProjectionTelemetryCheckpointInput\n ): Promise<TelemetryProjectionRunRecord>\n /** Records the object a telemetry batch is waiting for, so the wait has a durable start. */\n recordMissingTarget(\n input: RecordProjectionMissingTargetInput\n ): Promise<TelemetryProjectionRunRecord>\n /**\n * Records the failure of the current attempt as the `error` of a run that stays `running` to be\n * retried. Fenced like every other write: a delivery that lost the run cannot overwrite the\n * failure of the one that holds it now. A reclaim keeps it until the run ends.\n */\n recordAttemptFailure(input: RecordProjectionAttemptFailureInput): Promise<ProjectionRunRecord>\n /** Telemetry success also records the worker's EOF observation atomically. */\n finish(input: FinishProjectionRunInput): Promise<ProjectionRunRecord>\n /**\n * The newest replacement run of the same projection that makes this one stale: pinned to a\n * later dataset version, and queued, running, or succeeded. A failed or cancelled run replaces\n * nothing, so it supersedes nothing either. Null for a telemetry run.\n */\n findSupersedingRun(input: FindSupersedingProjectionRunInput): Promise<ProjectionRunRecord | null>\n getById(params: { projectId: string; id: string }): Promise<ProjectionRunRecord | null>\n list(input: ListProjectionRunsInput): Promise<ListProjectionRunsResult>\n /** Superseded runs are skipped: the run that superseded them is the one that matters. */\n listLatestByProjectionIds(\n input: ListLatestProjectionRunsInput\n ): Promise<ListLatestProjectionRunsResult>\n}\n\nexport type {\n LinkProjectionTarget,\n ObjectProjectionTarget,\n PinnedDatasetVersion,\n ProjectionExecution,\n ProjectionKind,\n ProjectionMaterializationIdentity,\n ProjectionTarget,\n}\n"
7
+ ],
8
+ "mappings": ";;AAGO,IAAM,gCAA+B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;AC+BA,IAAM,mBAA8D;AAAA,EAClE,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,mBAAmB;AACrB;AAEO,IAAM,gCAA+B,OAAO,KACjD,gBACF;AAEO,SAAS,0BAAyB,GAA0B;AAAA,EACjE,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,EAAE;AAAA;AAkF5C,SAAS,gCAA+B,CAC7C,KACA,SACS;AAAA,EACT,MAAM,SAA2B,IAAI;AAAA,EACrC,IAAI,wBAAwB,QAAQ;AAAA,IAClC,OAAO,QAAQ,OAAO,kBAAkB,KAAK,QAAQ,OAAO,kBAAkB;AAAA,EAChF;AAAA,EACA,OAAO,QAAQ,OAAO,YAAY;AAAA;",
9
+ "debugId": "6E88BA6849E66AE464756E2164756E21",
10
+ "names": []
11
+ }
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  captureSixbFailure2
4
- } from "./chunk-rzkr70gr.js";
4
+ } from "./chunk-6fsr7y93.js";
5
5
 
6
6
  // src/error-reporting/normalize.ts
7
7
  function safeString(value) {
@@ -6,11 +6,11 @@ import {
6
6
  createSixbError2,
7
7
  isSixbError2,
8
8
  summarizeErrorMessage2
9
- } from "./chunk-rzkr70gr.js";
9
+ } from "./chunk-6fsr7y93.js";
10
10
  import {
11
11
  isActionDefinition2,
12
12
  isGroupDefinition
13
- } from "./chunk-6rzb1g6h.js";
13
+ } from "./chunk-2xvgy3x5.js";
14
14
  import {
15
15
  isModelReasoning2
16
16
  } from "./chunk-pqajwytd.js";
@@ -19,14 +19,14 @@ import {
19
19
  } from "./chunk-69266efg.js";
20
20
  import {
21
21
  isAgentToolDefinition2
22
- } from "./chunk-dsfw1bdr.js";
22
+ } from "./chunk-f72rbvsb.js";
23
23
  import {
24
24
  WorkflowDefinitionError2,
25
25
  assertNonEmpty,
26
26
  isStepDefinition2,
27
27
  isAgentStepDefinition2,
28
28
  isInterventionDefinition2
29
- } from "./chunk-16jenmzw.js";
29
+ } from "./chunk-3q7z9hd4.js";
30
30
  import {
31
31
  isScheduleDefinition2
32
32
  } from "./chunk-e1c18xjx.js";
@@ -34,7 +34,7 @@ import {
34
34
  ModelProviderError2,
35
35
  UnsupportedModelFeatureError2,
36
36
  StructuredOutputError2
37
- } from "./chunk-p1683c0v.js";
37
+ } from "./chunk-kyjcwqz6.js";
38
38
 
39
39
  // src/workflows/agent-step-identity.ts
40
40
  function workflowAgentStepActorId2(workflowId, stepId) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createSixbError2,
4
4
  isSixbError2
5
- } from "./chunk-rzkr70gr.js";
5
+ } from "./chunk-6fsr7y93.js";
6
6
  import {
7
7
  AiLimitStorageError2
8
8
  } from "./chunk-jgwb25gc.js";
@@ -11,7 +11,7 @@ import {
11
11
  applicableAiLimitPolicies2,
12
12
  aiUsageLimitExceededError2,
13
13
  aiUsageLimitUnavailableError2
14
- } from "./chunk-4tnrzqqh.js";
14
+ } from "./chunk-fj1dvp37.js";
15
15
  import {
16
16
  AiUsageStorageError2,
17
17
  normalizeAiModelCallCostRecord2,
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-xnx96gfy.js";
20
20
  import {
21
21
  AiCostStorageError2
22
- } from "./chunk-3fpgxpsq.js";
22
+ } from "./chunk-6z1q7j19.js";
23
23
  import {
24
24
  normalizeAiModelCallRecord2
25
25
  } from "./chunk-s3csryxe.js";
@@ -78,6 +78,9 @@ function assertEmbeddingModel(model) {
78
78
  function assertEmbeddingModelRef(model) {
79
79
  const definition = model?.definition;
80
80
  const representation = definition?.representation;
81
+ if (definition?.inputMode !== undefined && definition.inputMode !== "symmetric" && definition.inputMode !== "asymmetric") {
82
+ throw new TypeError("[Sixb] Invalid embedding input mode.");
83
+ }
81
84
  if (representation !== undefined && (!representation || typeof representation !== "object" || !validIdentityPart(representation.name) || representation.version !== undefined && !validIdentityPart(representation.version)))
82
85
  throw new TypeError("[Sixb] Invalid embedding model representation.");
83
86
  if (!definition || definition.kind !== "embedding" || definition.providerId !== model.providerId || definition.modelId !== model.modelId || typeof model.providerId !== "string" || !model.providerId || model.providerId.trim() !== model.providerId || typeof model.modelId !== "string" || !model.modelId || model.modelId.trim() !== model.modelId || !Number.isSafeInteger(definition.dimensions) || definition.dimensions < 1 || definition.dimensions > 16000) {
@@ -85,7 +88,7 @@ function assertEmbeddingModelRef(model) {
85
88
  }
86
89
  }
87
90
  function sameEmbeddingModel(left, right) {
88
- return left.providerId === right.providerId && left.modelId === right.modelId && left.definition.dimensions === right.definition.dimensions && (left.definition.representation?.name ?? left.modelId) === (right.definition.representation?.name ?? right.modelId) && left.definition.representation?.version === right.definition.representation?.version;
91
+ return left.providerId === right.providerId && left.modelId === right.modelId && left.definition.dimensions === right.definition.dimensions && (left.definition.inputMode ?? "symmetric") === (right.definition.inputMode ?? "symmetric") && (left.definition.representation?.name ?? left.modelId) === (right.definition.representation?.name ?? right.modelId) && left.definition.representation?.version === right.definition.representation?.version;
89
92
  }
90
93
  function validIdentityPart(value) {
91
94
  return typeof value === "string" && value.length > 0 && value.trim() === value;
@@ -101,4 +104,4 @@ class EmbeddingModelResponseError2 extends ModelProviderError2 {
101
104
 
102
105
  export { ModelCatalogUnavailableError2, ModelProviderError2, ModelStreamError2, UnsupportedModelFeatureError2, StructuredOutputError2, assertEmbeddingModel, assertEmbeddingModelRef, sameEmbeddingModel, EmbeddingModelResponseError2 };
103
106
 
104
- //# debugId=7C7075E45C9223F364756E2164756E21
107
+ //# debugId=5948F3F6BD60B08464756E2164756E21
@@ -3,9 +3,9 @@
3
3
  "sources": ["../src/models/errors.ts", "../src/models/embedding-model.ts"],
4
4
  "sourcesContent": [
5
5
  "import type { ModelFinishReason, ModelUsage } from \"./events\"\nimport type { ModelCallCost } from \"./pricing\"\n\n/** Catalog transport/access failed; callers may use local metadata without masking invalid definitions. */\nexport class ModelCatalogUnavailableError extends Error {\n readonly name = \"ModelCatalogUnavailableError\"\n}\n\n/** A provider or provider protocol rejected a model request. */\nexport class ModelProviderError extends Error {\n readonly name = \"ModelProviderError\"\n\n constructor(\n message: string,\n readonly providerId: string,\n readonly modelId: string,\n options?: ErrorOptions & {\n readonly status?: number\n readonly code?: string\n readonly requestId?: string\n readonly retryAfterMs?: number\n readonly retryable?: boolean\n }\n ) {\n super(message, options)\n this.status = options?.status\n this.code = options?.code\n this.requestId = options?.requestId\n this.retryAfterMs = options?.retryAfterMs\n this.retryable = options?.retryable ?? false\n }\n\n readonly status?: number\n readonly code?: string\n readonly requestId?: string\n readonly retryAfterMs?: number\n readonly retryable: boolean\n}\n\nexport class ModelStreamError extends Error {\n readonly name = \"ModelStreamError\"\n}\n\nexport class UnsupportedModelFeatureError extends Error {\n readonly name = \"UnsupportedModelFeatureError\"\n\n constructor(\n message?: string,\n options?: ErrorOptions & {\n readonly reason?: \"unsupported-model\" | \"unsupported-schema\"\n }\n ) {\n super(message, options)\n this.reason = options?.reason\n }\n\n readonly reason?: \"unsupported-model\" | \"unsupported-schema\"\n}\n\nexport class StructuredOutputError extends Error {\n readonly name = \"StructuredOutputError\"\n\n constructor(\n message: string,\n options?: ErrorOptions & {\n readonly text?: string\n readonly providerId?: string\n readonly modelId?: string\n readonly responseId?: string\n readonly responseModelId?: string\n readonly finishReason?: ModelFinishReason\n readonly usage?: ModelUsage\n readonly cost?: ModelCallCost\n }\n ) {\n super(message, options)\n this.text = options?.text\n this.providerId = options?.providerId\n this.modelId = options?.modelId\n this.responseId = options?.responseId\n this.responseModelId = options?.responseModelId\n this.finishReason = options?.finishReason\n this.usage = options?.usage\n this.cost = options?.cost\n }\n\n readonly text?: string\n readonly providerId?: string\n readonly modelId?: string\n readonly responseId?: string\n readonly responseModelId?: string\n readonly finishReason?: ModelFinishReason\n readonly usage?: ModelUsage\n readonly cost?: ModelCallCost\n}\n",
6
- "import type { ModelDefinition } from \"./definitions\"\nimport { ModelProviderError } from \"./errors\"\nimport type { ModelProviderIds, ModelRoute, ModelUsage } from \"./events\"\nimport type { ModelCostEstimator, ModelReportedCost } from \"./pricing\"\n\n/** The identity includes the configured output dimension, not only the vendor's model id. */\nexport interface EmbeddingModelDefinition extends ModelDefinition {\n readonly kind: \"embedding\"\n readonly dimensions: number\n /** Actual representation behind a routing alias. Omit only when modelId identifies it directly. */\n readonly representation?: { readonly name: string; readonly version?: string }\n}\n\nexport interface EmbeddingModelRequest {\n readonly texts: readonly string[]\n /** Providers must honor cancellation and propagate this signal to their transport. */\n readonly signal?: AbortSignal\n}\n\n/** Provider accounting facts; absent meters or prices remain unknown. */\nexport interface EmbeddingModelResponseMetadata {\n readonly usage?: ModelUsage\n readonly providerIds?: ModelProviderIds\n readonly responseModelId?: string\n readonly reportedCost?: ModelReportedCost\n readonly route?: ModelRoute\n}\n\nexport interface EmbeddingModelResult extends EmbeddingModelResponseMetadata {\n readonly vectors: readonly (readonly number[])[]\n}\n\n/** Serializable profile reference; executable providers stay on the server. */\nexport interface EmbeddingModelRef {\n readonly providerId: string\n readonly modelId: string\n readonly definition: EmbeddingModelDefinition\n}\n\n/** Conservative transport bounds for automatic projection batching, not token estimates. */\nexport interface EmbeddingBatchLimits {\n readonly maxInputs: number\n readonly maxInputBytes: number\n readonly maxTotalInputBytes: number\n}\n\nexport interface EmbeddingModel extends EmbeddingModelRef {\n /** Omit when safe multi-input bounds are unknown; automatic indexing then calls one at a time. */\n readonly batching?: EmbeddingBatchLimits\n readonly costEstimator?: ModelCostEstimator\n /** Resolve and pin optional pricing before admission, without an inference call. */\n resolve?(): Promise<EmbeddingModel>\n embed(request: EmbeddingModelRequest): Promise<EmbeddingModelResult>\n}\n\nexport function assertEmbeddingModel(model: EmbeddingModel): void {\n if (!model || typeof model !== \"object\" || typeof model.embed !== \"function\") {\n throw new TypeError(\"[Sixb] Expected an EmbeddingModel with an embed method.\")\n }\n assertEmbeddingModelRef(model)\n if (\n model.batching &&\n [\n model.batching.maxInputs,\n model.batching.maxInputBytes,\n model.batching.maxTotalInputBytes,\n ].some((value) => !Number.isSafeInteger(value) || value < 1)\n ) {\n throw new TypeError(\"[Sixb] Embedding batch limits must be positive safe integers.\")\n }\n}\n\nexport function assertEmbeddingModelRef(model: EmbeddingModelRef): void {\n const definition = model?.definition\n const representation = definition?.representation\n if (\n representation !== undefined &&\n (!representation ||\n typeof representation !== \"object\" ||\n !validIdentityPart(representation.name) ||\n (representation.version !== undefined && !validIdentityPart(representation.version)))\n )\n throw new TypeError(\"[Sixb] Invalid embedding model representation.\")\n if (\n !definition ||\n definition.kind !== \"embedding\" ||\n definition.providerId !== model.providerId ||\n definition.modelId !== model.modelId ||\n typeof model.providerId !== \"string\" ||\n !model.providerId ||\n model.providerId.trim() !== model.providerId ||\n typeof model.modelId !== \"string\" ||\n !model.modelId ||\n model.modelId.trim() !== model.modelId ||\n !Number.isSafeInteger(definition.dimensions) ||\n definition.dimensions < 1 ||\n definition.dimensions > 16000\n ) {\n throw new TypeError(\"[Sixb] Invalid embedding model identity or dimensions (expected 1–16000).\")\n }\n}\n\n/** Routing identity, representation and dimensions must agree before any inference. */\nexport function sameEmbeddingModel(left: EmbeddingModelRef, right: EmbeddingModelRef): boolean {\n return (\n left.providerId === right.providerId &&\n left.modelId === right.modelId &&\n left.definition.dimensions === right.definition.dimensions &&\n (left.definition.representation?.name ?? left.modelId) ===\n (right.definition.representation?.name ?? right.modelId) &&\n left.definition.representation?.version === right.definition.representation?.version\n )\n}\n\nfunction validIdentityPart(value: unknown): value is string {\n return typeof value === \"string\" && value.length > 0 && value.trim() === value\n}\n\n/** A completed provider response whose vectors are unusable, but may still be billable. */\nexport class EmbeddingModelResponseError extends ModelProviderError {\n constructor(\n message: string,\n providerId: string,\n modelId: string,\n readonly metadata: EmbeddingModelResponseMetadata\n ) {\n super(message, providerId, modelId, { code: \"invalid_embedding_response\", retryable: false })\n }\n}\n"
6
+ "import type { ModelDefinition } from \"./definitions\"\nimport { ModelProviderError } from \"./errors\"\nimport type { ModelProviderIds, ModelRoute, ModelUsage } from \"./events\"\nimport type { ModelCostEstimator, ModelReportedCost } from \"./pricing\"\n\n/** The identity includes the configured output dimension, not only the vendor's model id. */\nexport interface EmbeddingModelDefinition extends ModelDefinition {\n readonly kind: \"embedding\"\n readonly dimensions: number\n /** Asymmetric models use distinct document/query modes. Omission means symmetric. */\n readonly inputMode?: \"symmetric\" | \"asymmetric\"\n /** Actual representation behind a routing alias. Omit only when modelId identifies it directly. */\n readonly representation?: { readonly name: string; readonly version?: string }\n}\n\nexport interface EmbeddingModelRequest {\n readonly texts: readonly string[]\n /** Retrieval role. Sixb sets this for indexing and search; symmetric models may ignore it. */\n readonly purpose?: \"document\" | \"query\"\n /** Providers must honor cancellation and propagate this signal to their transport. */\n readonly signal?: AbortSignal\n}\n\n/** Provider accounting facts; absent meters or prices remain unknown. */\nexport interface EmbeddingModelResponseMetadata {\n readonly usage?: ModelUsage\n readonly providerIds?: ModelProviderIds\n readonly responseModelId?: string\n readonly reportedCost?: ModelReportedCost\n readonly route?: ModelRoute\n}\n\nexport interface EmbeddingModelResult extends EmbeddingModelResponseMetadata {\n readonly vectors: readonly (readonly number[])[]\n}\n\n/** Serializable profile reference; executable providers stay on the server. */\nexport interface EmbeddingModelRef {\n readonly providerId: string\n readonly modelId: string\n readonly definition: EmbeddingModelDefinition\n}\n\n/** Conservative transport bounds for automatic projection batching, not token estimates. */\nexport interface EmbeddingBatchLimits {\n readonly maxInputs: number\n readonly maxInputBytes: number\n readonly maxTotalInputBytes: number\n}\n\nexport interface EmbeddingModel extends EmbeddingModelRef {\n /** Omit when safe multi-input bounds are unknown; automatic indexing then calls one at a time. */\n readonly batching?: EmbeddingBatchLimits\n readonly costEstimator?: ModelCostEstimator\n /** Resolve and pin optional pricing before admission, without an inference call. */\n resolve?(): Promise<EmbeddingModel>\n embed(request: EmbeddingModelRequest): Promise<EmbeddingModelResult>\n}\n\nexport function assertEmbeddingModel(model: EmbeddingModel): void {\n if (!model || typeof model !== \"object\" || typeof model.embed !== \"function\") {\n throw new TypeError(\"[Sixb] Expected an EmbeddingModel with an embed method.\")\n }\n assertEmbeddingModelRef(model)\n if (\n model.batching &&\n [\n model.batching.maxInputs,\n model.batching.maxInputBytes,\n model.batching.maxTotalInputBytes,\n ].some((value) => !Number.isSafeInteger(value) || value < 1)\n ) {\n throw new TypeError(\"[Sixb] Embedding batch limits must be positive safe integers.\")\n }\n}\n\nexport function assertEmbeddingModelRef(model: EmbeddingModelRef): void {\n const definition = model?.definition\n const representation = definition?.representation\n if (\n definition?.inputMode !== undefined &&\n definition.inputMode !== \"symmetric\" &&\n definition.inputMode !== \"asymmetric\"\n ) {\n throw new TypeError(\"[Sixb] Invalid embedding input mode.\")\n }\n if (\n representation !== undefined &&\n (!representation ||\n typeof representation !== \"object\" ||\n !validIdentityPart(representation.name) ||\n (representation.version !== undefined && !validIdentityPart(representation.version)))\n )\n throw new TypeError(\"[Sixb] Invalid embedding model representation.\")\n if (\n !definition ||\n definition.kind !== \"embedding\" ||\n definition.providerId !== model.providerId ||\n definition.modelId !== model.modelId ||\n typeof model.providerId !== \"string\" ||\n !model.providerId ||\n model.providerId.trim() !== model.providerId ||\n typeof model.modelId !== \"string\" ||\n !model.modelId ||\n model.modelId.trim() !== model.modelId ||\n !Number.isSafeInteger(definition.dimensions) ||\n definition.dimensions < 1 ||\n definition.dimensions > 16000\n ) {\n throw new TypeError(\"[Sixb] Invalid embedding model identity or dimensions (expected 1–16000).\")\n }\n}\n\n/** Routing identity, representation and dimensions must agree before any inference. */\nexport function sameEmbeddingModel(left: EmbeddingModelRef, right: EmbeddingModelRef): boolean {\n return (\n left.providerId === right.providerId &&\n left.modelId === right.modelId &&\n left.definition.dimensions === right.definition.dimensions &&\n (left.definition.inputMode ?? \"symmetric\") === (right.definition.inputMode ?? \"symmetric\") &&\n (left.definition.representation?.name ?? left.modelId) ===\n (right.definition.representation?.name ?? right.modelId) &&\n left.definition.representation?.version === right.definition.representation?.version\n )\n}\n\nfunction validIdentityPart(value: unknown): value is string {\n return typeof value === \"string\" && value.length > 0 && value.trim() === value\n}\n\n/** A completed provider response whose vectors are unusable, but may still be billable. */\nexport class EmbeddingModelResponseError extends ModelProviderError {\n constructor(\n message: string,\n providerId: string,\n modelId: string,\n readonly metadata: EmbeddingModelResponseMetadata\n ) {\n super(message, providerId, modelId, { code: \"invalid_embedding_response\", retryable: false })\n }\n}\n"
7
7
  ],
8
- "mappings": ";;AAIO,MAAM,sCAAqC,MAAM;AAAA,EAC7C,OAAO;AAClB;AAAA;AAGO,MAAM,4BAA2B,MAAM;AAAA,EAKjC;AAAA,EACA;AAAA,EALF,OAAO;AAAA,EAEhB,WAAW,CACT,SACS,YACA,SACT,SAOA;AAAA,IACA,MAAM,SAAS,OAAO;AAAA,IAVb;AAAA,IACA;AAAA,IAUT,KAAK,SAAS,S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gFAA2E;AAAA,EACjG;AAAA;AAIK,SAAS,kBAAkB,CAAC,MAAyB,OAAmC;AAAA,EAC7F,OACE,KAAK,eAAe,MAAM,cAC1B,KAAK,YAAY,MAAM,WACvB,KAAK,WAAW,eAAe,MAAM,WAAW,eAC/C,KAAK,WAAW,aAAa,kBAAkB,MAAM,WAAW,aAAa,iBAC7E,KAAK,WAAW,gBAAgB,QAAQ,KAAK,cAC3C,MAAM,WAAW,gBAAgB,QAAQ,MAAM,YAClD,KAAK,WAAW,gBAAgB,YAAY,MAAM,WAAW,gBAAgB;AAAA;AAIjF,SAAS,iBAAiB,CAAC,OAAiC;AAAA,EAC1D,OAAO,OAAO,UAAU,YAAY,MAAM,SAAS,KAAK,MAAM,KAAK,MAAM;AAAA;AAAA;AAIpE,MAAM,qCAAoC,oBAAmB;AAAA,EAKvD;AAAA,EAJX,WAAW,CACT,SACA,YACA,SACS,UACT;AAAA,IACA,MAAM,SAAS,YAAY,SAAS,EAAE,MAAM,8BAA8B,WAAW,MAAM,CAAC;AAAA,IAFnF;AAAA;AAIb;",
9
+ "debugId": "5948F3F6BD60B08464756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  isPrimitiveSchema
4
- } from "./chunk-d8yes9yx.js";
4
+ } from "./chunk-swxzncrv.js";
5
5
  import {
6
6
  isPlainRecord
7
7
  } from "./chunk-wy0qdqfm.js";
@@ -2,17 +2,17 @@
2
2
  import {
3
3
  createSixbError2,
4
4
  toSixbFailure2
5
- } from "./chunk-rzkr70gr.js";
5
+ } from "./chunk-6fsr7y93.js";
6
6
  import {
7
7
  reportRunFailure2
8
- } from "./chunk-y6vnvayj.js";
8
+ } from "./chunk-vjcd8d27.js";
9
9
  import {
10
10
  resolveExecutionScopeAuthorization,
11
11
  assertAuthorized2
12
- } from "./chunk-rzcjp5m2.js";
12
+ } from "./chunk-69kt9q43.js";
13
13
  import {
14
14
  SYNC_RUN_FAILURE_CODES2
15
- } from "./chunk-3fpgxpsq.js";
15
+ } from "./chunk-6z1q7j19.js";
16
16
  import {
17
17
  SyncRunError2
18
18
  } from "./chunk-jmfet9r4.js";
@@ -20,7 +20,7 @@ import {
20
20
  executionRecordInputFromRuntime,
21
21
  ensureExecutionRecord2,
22
22
  createPrimitiveExecutionRecord
23
- } from "./chunk-m8zkvep1.js";
23
+ } from "./chunk-7g2gjvah.js";
24
24
 
25
25
  // src/syncs/errors.ts
26
26
  class SyncValidationError2 extends Error {
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  createSixbError2,
4
4
  isSixbError2
5
- } from "./chunk-rzkr70gr.js";
5
+ } from "./chunk-6fsr7y93.js";
6
6
  import {
7
7
  resolveExecutionScopeAuthorization,
8
8
  AuthorizationError2,
9
9
  assertProviderAccess2
10
- } from "./chunk-rzcjp5m2.js";
10
+ } from "./chunk-69kt9q43.js";
11
11
  import {
12
12
  isOAuthConnectorDefinition2
13
13
  } from "./chunk-9x8dybsb.js";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  normalizeSchemaValue2,
4
4
  coerceSchemaValueToTyped2
5
- } from "./chunk-d8yes9yx.js";
5
+ } from "./chunk-swxzncrv.js";
6
6
  import {
7
7
  validateSchemaOrRefValue2
8
- } from "./chunk-drz59ve0.js";
8
+ } from "./chunk-tkdbge6v.js";
9
9
  import {
10
10
  OntologyValidationError2
11
11
  } from "./chunk-cqr3acm1.js";
@@ -2,17 +2,17 @@
2
2
  import {
3
3
  createSixbError2,
4
4
  toSixbFailure2
5
- } from "./chunk-rzkr70gr.js";
5
+ } from "./chunk-6fsr7y93.js";
6
6
  import {
7
7
  reportRunFailure2
8
- } from "./chunk-y6vnvayj.js";
8
+ } from "./chunk-vjcd8d27.js";
9
9
  import {
10
10
  resolveExecutionScopeAuthorization,
11
11
  assertAuthorized2
12
- } from "./chunk-rzcjp5m2.js";
12
+ } from "./chunk-69kt9q43.js";
13
13
  import {
14
14
  PIPELINE_RUN_FAILURE_CODES2
15
- } from "./chunk-3fpgxpsq.js";
15
+ } from "./chunk-6z1q7j19.js";
16
16
  import {
17
17
  PipelineRunError2
18
18
  } from "./chunk-mmagke4x.js";
@@ -20,7 +20,7 @@ import {
20
20
  executionRecordInputFromRuntime,
21
21
  ensureExecutionRecord2,
22
22
  createPrimitiveExecutionRecord
23
- } from "./chunk-m8zkvep1.js";
23
+ } from "./chunk-7g2gjvah.js";
24
24
 
25
25
  // src/pipelines/errors.ts
26
26
  class PipelineError2 extends Error {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-z3y5kg1x.js";
5
5
  import {
6
6
  assertEmbeddingModelRef
7
- } from "./chunk-p1683c0v.js";
7
+ } from "./chunk-kyjcwqz6.js";
8
8
  import {
9
9
  OntologyValidationError2
10
10
  } from "./chunk-cqr3acm1.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  validateSchemaValue2,
4
4
  isRecord2
5
- } from "./chunk-d8yes9yx.js";
5
+ } from "./chunk-swxzncrv.js";
6
6
  import {
7
7
  OntologyValidationError2
8
8
  } from "./chunk-cqr3acm1.js";
@@ -9,7 +9,7 @@ import {
9
9
  ModelProviderError2,
10
10
  UnsupportedModelFeatureError2,
11
11
  assertEmbeddingModel
12
- } from "./chunk-p1683c0v.js";
12
+ } from "./chunk-kyjcwqz6.js";
13
13
  import {
14
14
  assertJsonValue2,
15
15
  cloneJsonValue2
@@ -6,7 +6,7 @@ import {
6
6
  reportEventDeliveryFailure3,
7
7
  reportRuleEvaluationFailure3,
8
8
  reportVectorIndexingFailure2
9
- } from "./chunk-bdhfn0ww.js";
9
+ } from "./chunk-kkqwzy6h.js";
10
10
 
11
11
  // src/error-reporting/capability.ts
12
12
  var ERROR_REPORTER = Symbol("sixb.error-reporter");
@@ -1,24 +1,24 @@
1
1
  // @bun
2
2
  import {
3
3
  OntologyRegistry2
4
- } from "./chunk-3nx8vj5a.js";
4
+ } from "./chunk-zvmr2hqk.js";
5
5
  import {
6
6
  ProjectionRegistry2,
7
7
  createOntologyMaterializer2
8
- } from "./chunk-00pfcqh4.js";
8
+ } from "./chunk-h4138ww2.js";
9
9
  import {
10
10
  captureSixbFailure2,
11
11
  isSixbError2
12
- } from "./chunk-rzkr70gr.js";
12
+ } from "./chunk-6fsr7y93.js";
13
13
  import {
14
14
  SecurityRegistry,
15
15
  AuthRuntime2
16
- } from "./chunk-6rzb1g6h.js";
16
+ } from "./chunk-2xvgy3x5.js";
17
17
  import {
18
18
  captureExecutionScope,
19
19
  resolveExecutionScopeAuthorization,
20
20
  AuthorizationError2
21
- } from "./chunk-rzcjp5m2.js";
21
+ } from "./chunk-69kt9q43.js";
22
22
  import {
23
23
  AuthRuntimeError2,
24
24
  isMagicLinkAuthStrategy2,
@@ -26,37 +26,37 @@ import {
26
26
  } from "./chunk-2jntasmh.js";
27
27
  import {
28
28
  createModelCatalog2
29
- } from "./chunk-ky7zpbtt.js";
29
+ } from "./chunk-tnvafr7g.js";
30
30
  import {
31
31
  FileUploadSessionError2
32
- } from "./chunk-3a338wrp.js";
32
+ } from "./chunk-dp7yk20b.js";
33
33
  import {
34
34
  isMigrationCapableStorage2,
35
35
  checkStorageSchema2
36
- } from "./chunk-3fpgxpsq.js";
36
+ } from "./chunk-6z1q7j19.js";
37
37
  import {
38
38
  createAuthorizedObjectReader
39
- } from "./chunk-pvgpckm1.js";
39
+ } from "./chunk-8x74221e.js";
40
40
  import {
41
41
  attachSixbErrorReporter2,
42
42
  shareSixbErrorReporter2
43
- } from "./chunk-y6vnvayj.js";
43
+ } from "./chunk-vjcd8d27.js";
44
44
  import {
45
45
  ActionRegistry2
46
- } from "./chunk-dv4ct8mp.js";
46
+ } from "./chunk-dsv8kdgk.js";
47
47
  import {
48
48
  assertDatasetDefinition2
49
49
  } from "./chunk-cd234ba4.js";
50
50
  import {
51
51
  OntologyOutboxDispatcher2,
52
52
  createDomainEventService2
53
- } from "./chunk-ypj2wqtj.js";
53
+ } from "./chunk-70jmg2zx.js";
54
54
  import {
55
55
  validateSchedulesAtStartup2
56
56
  } from "./chunk-e1c18xjx.js";
57
57
  import {
58
58
  createSandboxDefinition
59
- } from "./chunk-vef6qa14.js";
59
+ } from "./chunk-gmdvns8f.js";
60
60
  import {
61
61
  ConnectorError2,
62
62
  ConnectorNotFoundError2,
@@ -68,16 +68,16 @@ import {
68
68
  isConnectorStorageError,
69
69
  storageBoundaryError,
70
70
  recoverConnectorFailure
71
- } from "./chunk-cbn96bve.js";
71
+ } from "./chunk-nvymebc1.js";
72
72
  import {
73
73
  toolsFromProjectConfig
74
- } from "./chunk-dsfw1bdr.js";
74
+ } from "./chunk-f72rbvsb.js";
75
75
  import {
76
76
  assertNoAgentDefinitions,
77
77
  validateWorkflowsAtStartup2,
78
78
  validateWorkflowAgentStepGroupReferences2,
79
79
  createBoundSixb
80
- } from "./chunk-16jenmzw.js";
80
+ } from "./chunk-3q7z9hd4.js";
81
81
  import {
82
82
  registerConnectorConnectionCallbackProcess
83
83
  } from "./chunk-5a4a52tq.js";
@@ -93,7 +93,7 @@ import {
93
93
  validateSharesAtStartup,
94
94
  discoverOntologySources2,
95
95
  discoverProjectDefinitions2
96
- } from "./chunk-ma1mhh7w.js";
96
+ } from "./chunk-a7ne02hk.js";
97
97
  import {
98
98
  LoggingService2
99
99
  } from "./chunk-3qms4nax.js";
@@ -101,22 +101,22 @@ import {
101
101
  bindEmbeddingModels,
102
102
  createVectorIndexingRuntime,
103
103
  registerVectorIndexingRuntime
104
- } from "./chunk-wnxabtn4.js";
104
+ } from "./chunk-gkxsenvp.js";
105
105
  import {
106
106
  registerProjectionRegistry2
107
- } from "./chunk-y487ywrv.js";
107
+ } from "./chunk-cq44v1a6.js";
108
108
  import {
109
109
  SyncValidationError2
110
- } from "./chunk-q2xghyft.js";
110
+ } from "./chunk-nkbev3tr.js";
111
111
  import {
112
112
  ModelExecutionSession
113
- } from "./chunk-ww185kt6.js";
113
+ } from "./chunk-chdg6eqq.js";
114
114
  import {
115
115
  isOAuthConnectorDefinition2
116
116
  } from "./chunk-9x8dybsb.js";
117
117
  import {
118
118
  ensureExecutionRecord2
119
- } from "./chunk-m8zkvep1.js";
119
+ } from "./chunk-7g2gjvah.js";
120
120
  import {
121
121
  ConnectorConnectionStorageError2,
122
122
  CONNECTOR_CONNECTION_RUN_FAILURE_CODES2
@@ -126,10 +126,10 @@ import {
126
126
  } from "./chunk-m4ehq95f.js";
127
127
  import {
128
128
  reportEventDeliveryFailure3
129
- } from "./chunk-bdhfn0ww.js";
129
+ } from "./chunk-kkqwzy6h.js";
130
130
  import {
131
131
  sameEmbeddingModel
132
- } from "./chunk-p1683c0v.js";
132
+ } from "./chunk-kyjcwqz6.js";
133
133
  import {
134
134
  supportsDirectUpload2
135
135
  } from "./chunk-h3v76ams.js";
@@ -2700,6 +2700,7 @@ var DEGRADED_ATTEMPT_THRESHOLD = 3;
2700
2700
  var DEGRADED_FAILURE_THRESHOLD = 2;
2701
2701
  var ABANDONED_UPLOAD_SWEEP_DELAY_MS = 5 * 60000;
2702
2702
  var ABANDONED_UPLOAD_ABORT_GRACE_MS = 15 * 60000;
2703
+ var ABANDONED_SOURCE_PURGE_BATCH = 50000;
2703
2704
 
2704
2705
  class OntologyMaintenance {
2705
2706
  projectId;
@@ -2802,6 +2803,7 @@ class OntologyMaintenance {
2802
2803
  terminalBefore: new Date(started.getTime() - this.terminalSourceRetentionMs).toISOString(),
2803
2804
  limit: this.cleanupLimit
2804
2805
  }), failures, { rowsDeleted: 0, materializationsDeleted: 0 });
2806
+ const abandonedSources = await captureFailure(() => this.purgeAbandonedSources(started), failures, { rowsDeleted: 0, materializationsDeleted: 0 });
2805
2807
  const uploads = this.storage.fileUploadSessions;
2806
2808
  if (uploads) {
2807
2809
  await captureFailure(() => this.retireAbandonedUploads(uploads, started, failures), failures);
@@ -2809,10 +2811,26 @@ class OntologyMaintenance {
2809
2811
  }
2810
2812
  return {
2811
2813
  publishedOutboxRowsDeleted,
2812
- terminalSourceRowsDeleted: terminalSources.rowsDeleted,
2813
- terminalSourceMaterializationsDeleted: terminalSources.materializationsDeleted
2814
+ terminalSourceRowsDeleted: terminalSources.rowsDeleted + abandonedSources.rowsDeleted,
2815
+ terminalSourceMaterializationsDeleted: terminalSources.materializationsDeleted + abandonedSources.materializationsDeleted
2814
2816
  };
2815
2817
  }
2818
+ async purgeAbandonedSources(started) {
2819
+ let rowsDeleted = 0;
2820
+ let materializationsDeleted = 0;
2821
+ while (true) {
2822
+ const purged = await this.storage.ontology.sources.purgeAbandoned({
2823
+ projectId: this.projectId,
2824
+ limit: ABANDONED_SOURCE_PURGE_BATCH
2825
+ });
2826
+ rowsDeleted += purged.rowsDeleted;
2827
+ materializationsDeleted += purged.materializationsDeleted;
2828
+ const exhausted = purged.rowsDeleted + purged.materializationsDeleted < ABANDONED_SOURCE_PURGE_BATCH;
2829
+ if (exhausted || this.now().getTime() - started.getTime() >= this.intervalMs) {
2830
+ return { rowsDeleted, materializationsDeleted };
2831
+ }
2832
+ }
2833
+ }
2816
2834
  async retireAbandonedUploads(uploads, now, failures) {
2817
2835
  const abandoned = await uploads.listAbandoned({
2818
2836
  projectId: this.projectId,
@@ -3509,4 +3527,4 @@ async function createSixb2(options) {
3509
3527
  }
3510
3528
  export { WebhookValidationError2, defineWebhook2, webhookConnector2, UnverifiedWebhookError2, resolveWebhookVerification2, warnUnverifiedWebhook2, SixbHost2, createSixb2 };
3511
3529
 
3512
- //# debugId=FBC82C2E302A490764756E2164756E21
3530
+ //# debugId=5D4C3D731AF4BC5E64756E2164756E21