@sixb/core 0.1.2 → 0.1.4

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 (383) hide show
  1. package/dist/actions/index.js +19 -17
  2. package/dist/actions/index.js.map +1 -1
  3. package/dist/actions/worker.js +4 -4
  4. package/dist/actions/worker.js.map +1 -1
  5. package/dist/agents/adapters.d.ts +11 -1
  6. package/dist/agents/adapters.d.ts.map +1 -1
  7. package/dist/agents/context-compaction.d.ts +40 -0
  8. package/dist/agents/context-compaction.d.ts.map +1 -0
  9. package/dist/agents/context.js +1 -1
  10. package/dist/agents/errors.d.ts +1 -1
  11. package/dist/agents/errors.d.ts.map +1 -1
  12. package/dist/agents/execution.d.ts +3 -0
  13. package/dist/agents/execution.d.ts.map +1 -1
  14. package/dist/agents/ids.d.ts +2 -0
  15. package/dist/agents/ids.d.ts.map +1 -1
  16. package/dist/agents/index.d.ts +10 -6
  17. package/dist/agents/index.d.ts.map +1 -1
  18. package/dist/agents/index.js +51 -35
  19. package/dist/agents/index.js.map +1 -1
  20. package/dist/agents/request.d.ts.map +1 -1
  21. package/dist/agents/streams.d.ts +17 -1
  22. package/dist/agents/streams.d.ts.map +1 -1
  23. package/dist/agents/streams.js +5 -3
  24. package/dist/agents/streams.js.map +1 -1
  25. package/dist/agents/thread-context-projection.d.ts +19 -0
  26. package/dist/agents/thread-context-projection.d.ts.map +1 -0
  27. package/dist/agents/tool-definition.d.ts.map +1 -1
  28. package/dist/agents/tool-result.d.ts +6 -0
  29. package/dist/agents/tool-result.d.ts.map +1 -0
  30. package/dist/agents/types.d.ts +46 -1
  31. package/dist/agents/types.d.ts.map +1 -1
  32. package/dist/agents/validation.d.ts +2 -2
  33. package/dist/agents/validation.d.ts.map +1 -1
  34. package/dist/auth/index.js +11 -5
  35. package/dist/auth/index.js.map +1 -1
  36. package/dist/authorization/index.js +6 -2
  37. package/dist/authorization/index.js.map +1 -1
  38. package/dist/bootstrap/index.js +33 -31
  39. package/dist/bootstrap/index.js.map +1 -1
  40. package/dist/{chunk-ys1nse2v.js → chunk-1wk20wn3.js} +438 -246
  41. package/dist/{chunk-ys1nse2v.js.map → chunk-1wk20wn3.js.map} +11 -11
  42. package/dist/{chunk-sa4340y1.js → chunk-1yz3x65y.js} +7 -7
  43. package/dist/{chunk-gqdd7508.js → chunk-4rh2m6zg.js} +1 -1
  44. package/dist/{chunk-fmx1sz2h.js → chunk-72q2y8hn.js} +3 -3
  45. package/dist/{chunk-fmx1sz2h.js.map → chunk-72q2y8hn.js.map} +4 -4
  46. package/dist/{chunk-nnyp53zt.js → chunk-7gw7mepb.js} +259 -9
  47. package/dist/chunk-7gw7mepb.js.map +14 -0
  48. package/dist/{chunk-nten49ta.js → chunk-819wnjz8.js} +11 -5
  49. package/dist/chunk-819wnjz8.js.map +12 -0
  50. package/dist/chunk-96swp2wd.js +47 -0
  51. package/dist/chunk-96swp2wd.js.map +10 -0
  52. package/dist/{chunk-4x43bkbp.js → chunk-a09jx26t.js} +1 -1
  53. package/dist/{chunk-st4xgxey.js → chunk-afjpa2hs.js} +205 -48
  54. package/dist/chunk-afjpa2hs.js.map +45 -0
  55. package/dist/{chunk-0mbx247x.js → chunk-c43qr6s0.js} +427 -99
  56. package/dist/chunk-c43qr6s0.js.map +46 -0
  57. package/dist/{chunk-zg9yryhz.js → chunk-cbkm2vam.js} +3 -3
  58. package/dist/{chunk-57zpb99z.js → chunk-dm72y8wt.js} +26 -3
  59. package/dist/chunk-dm72y8wt.js.map +10 -0
  60. package/dist/chunk-drjqm1aa.js +913 -0
  61. package/dist/chunk-drjqm1aa.js.map +15 -0
  62. package/dist/chunk-dysw7nsm.js.map +1 -1
  63. package/dist/{chunk-8ryen3p3.js → chunk-f6erf2vv.js} +1 -1
  64. package/dist/{chunk-34bqh420.js → chunk-f83ka50g.js} +188 -44
  65. package/dist/chunk-f83ka50g.js.map +23 -0
  66. package/dist/{chunk-bct7hmfc.js → chunk-g13869yf.js} +3 -3
  67. package/dist/{chunk-0k4avqr2.js → chunk-hbeh8j9w.js} +2 -2
  68. package/dist/{chunk-qvybnnpe.js → chunk-nzw7sm3b.js} +2 -2
  69. package/dist/{chunk-k9pts48t.js → chunk-pn8n8sba.js} +16 -15
  70. package/dist/{chunk-k9pts48t.js.map → chunk-pn8n8sba.js.map} +3 -3
  71. package/dist/{chunk-63te770v.js → chunk-qewtks41.js} +8 -8
  72. package/dist/{chunk-63te770v.js.map → chunk-qewtks41.js.map} +2 -2
  73. package/dist/{chunk-85j5ybfj.js → chunk-rdeagz6b.js} +2 -2
  74. package/dist/{chunk-85j5ybfj.js.map → chunk-rdeagz6b.js.map} +3 -3
  75. package/dist/chunk-rhrbz7d4.js +36 -0
  76. package/dist/chunk-rhrbz7d4.js.map +10 -0
  77. package/dist/{chunk-bh6k3nc6.js → chunk-rs1wbvy6.js} +1 -1
  78. package/dist/{chunk-88ppkr54.js → chunk-rte5sm3z.js} +26 -2
  79. package/dist/chunk-rte5sm3z.js.map +12 -0
  80. package/dist/{chunk-n8herkry.js → chunk-s31d0qmq.js} +57 -20
  81. package/dist/{chunk-n8herkry.js.map → chunk-s31d0qmq.js.map} +8 -7
  82. package/dist/{chunk-7pc8b818.js → chunk-sxwk41qa.js} +1 -1
  83. package/dist/{chunk-663csy96.js → chunk-t0jjkep3.js} +2 -1
  84. package/dist/chunk-t0jjkep3.js.map +10 -0
  85. package/dist/{chunk-c6qd89g5.js → chunk-tek1qwgm.js} +6 -6
  86. package/dist/{chunk-c6qd89g5.js.map → chunk-tek1qwgm.js.map} +1 -1
  87. package/dist/{chunk-jaj13078.js → chunk-tkdscva6.js} +3 -33
  88. package/dist/{chunk-jaj13078.js.map → chunk-tkdscva6.js.map} +3 -4
  89. package/dist/{chunk-5egfka8j.js → chunk-tycbzedm.js} +2 -2
  90. package/dist/{chunk-g9t3kdtx.js → chunk-x2yw73hy.js} +1 -1
  91. package/dist/{chunk-57r1cpxx.js → chunk-xc7hq65b.js} +3 -2
  92. package/dist/{chunk-57r1cpxx.js.map → chunk-xc7hq65b.js.map} +3 -3
  93. package/dist/chunk-xdf9yswn.js +133 -0
  94. package/dist/chunk-xdf9yswn.js.map +11 -0
  95. package/dist/execution/agent.js +29 -27
  96. package/dist/execution/agent.js.map +1 -1
  97. package/dist/execution/primitive.js +29 -27
  98. package/dist/execution/primitive.js.map +2 -2
  99. package/dist/execution/request.js +30 -28
  100. package/dist/execution/request.js.map +2 -2
  101. package/dist/http/index.js +1 -1
  102. package/dist/index.d.ts +6 -5
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +60 -58
  105. package/dist/index.js.map +1 -1
  106. package/dist/lake-storage/types.d.ts +2 -1
  107. package/dist/lake-storage/types.d.ts.map +1 -1
  108. package/dist/materialization/model.d.ts +4 -0
  109. package/dist/materialization/model.d.ts.map +1 -1
  110. package/dist/materializer/edits/apply.d.ts +6 -1
  111. package/dist/materializer/edits/apply.d.ts.map +1 -1
  112. package/dist/materializer/edits/working-state.d.ts +2 -0
  113. package/dist/materializer/edits/working-state.d.ts.map +1 -1
  114. package/dist/materializer/effective/resolve.d.ts +3 -1
  115. package/dist/materializer/effective/resolve.d.ts.map +1 -1
  116. package/dist/materializer/execution/work-records.d.ts.map +1 -1
  117. package/dist/materializer/index.js +19 -17
  118. package/dist/materializer/index.js.map +1 -1
  119. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  120. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  121. package/dist/models/index.d.ts +40 -0
  122. package/dist/models/index.d.ts.map +1 -0
  123. package/dist/objects/execution.d.ts +6 -1
  124. package/dist/objects/execution.d.ts.map +1 -1
  125. package/dist/objects/index.js +21 -19
  126. package/dist/objects/index.js.map +1 -1
  127. package/dist/objects/link/endpoints.d.ts.map +1 -1
  128. package/dist/objects/query/executor.d.ts +1 -0
  129. package/dist/objects/query/executor.d.ts.map +1 -1
  130. package/dist/objects/query/explain.d.ts +1 -0
  131. package/dist/objects/query/explain.d.ts.map +1 -1
  132. package/dist/objects/query/index.d.ts +3 -1
  133. package/dist/objects/query/index.d.ts.map +1 -1
  134. package/dist/objects/query/index.js +30 -5
  135. package/dist/objects/query/index.js.map +1 -1
  136. package/dist/objects/query/ir.d.ts +14 -1
  137. package/dist/objects/query/ir.d.ts.map +1 -1
  138. package/dist/objects/query/links.d.ts +25 -0
  139. package/dist/objects/query/links.d.ts.map +1 -0
  140. package/dist/objects/query/normalize.d.ts.map +1 -1
  141. package/dist/objects/query/planner.d.ts.map +1 -1
  142. package/dist/objects/query/validate.d.ts +1 -0
  143. package/dist/objects/query/validate.d.ts.map +1 -1
  144. package/dist/pipelines/index.js +16 -15
  145. package/dist/pipelines/index.js.map +1 -1
  146. package/dist/projections/builders.d.ts +52 -10
  147. package/dist/projections/builders.d.ts.map +1 -1
  148. package/dist/projections/index.d.ts +2 -1
  149. package/dist/projections/index.d.ts.map +1 -1
  150. package/dist/projections/internal.d.ts +4 -1
  151. package/dist/projections/internal.d.ts.map +1 -1
  152. package/dist/projections/internal.js +22 -17
  153. package/dist/projections/internal.js.map +1 -1
  154. package/dist/projections/run-dispatch.d.ts +1 -0
  155. package/dist/projections/run-dispatch.d.ts.map +1 -1
  156. package/dist/projections/timestamp.d.ts +3 -0
  157. package/dist/projections/timestamp.d.ts.map +1 -0
  158. package/dist/projections/types.d.ts +21 -9
  159. package/dist/projections/types.d.ts.map +1 -1
  160. package/dist/projections/validation.d.ts +6 -5
  161. package/dist/projections/validation.d.ts.map +1 -1
  162. package/dist/query.d.ts +2 -1
  163. package/dist/query.d.ts.map +1 -1
  164. package/dist/query.js +2 -2
  165. package/dist/queues/index.d.ts +1 -1
  166. package/dist/queues/index.d.ts.map +1 -1
  167. package/dist/queues/types.d.ts +7 -0
  168. package/dist/queues/types.d.ts.map +1 -1
  169. package/dist/runtime/ai-cost.d.ts +8 -0
  170. package/dist/runtime/ai-cost.d.ts.map +1 -0
  171. package/dist/runtime/create.d.ts +3 -0
  172. package/dist/runtime/create.d.ts.map +1 -1
  173. package/dist/runtime/definitions.d.ts +3 -0
  174. package/dist/runtime/definitions.d.ts.map +1 -1
  175. package/dist/runtime/host.d.ts +2 -0
  176. package/dist/runtime/host.d.ts.map +1 -1
  177. package/dist/runtime/resolve-definitions.d.ts +2 -0
  178. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  179. package/dist/storage/agents/in-memory.d.ts +22 -4
  180. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  181. package/dist/storage/agents/index.d.ts +1 -1
  182. package/dist/storage/agents/index.d.ts.map +1 -1
  183. package/dist/storage/agents/provider.d.ts +31 -0
  184. package/dist/storage/agents/provider.d.ts.map +1 -1
  185. package/dist/storage/agents/provider.js +22 -7
  186. package/dist/storage/agents/provider.js.map +1 -1
  187. package/dist/storage/agents/types.d.ts +75 -4
  188. package/dist/storage/agents/types.d.ts.map +1 -1
  189. package/dist/storage/ai-cost/analytics.d.ts +61 -0
  190. package/dist/storage/ai-cost/analytics.d.ts.map +1 -0
  191. package/dist/storage/ai-cost/codec.d.ts +14 -0
  192. package/dist/storage/ai-cost/codec.d.ts.map +1 -0
  193. package/dist/storage/ai-cost/errors.d.ts +7 -0
  194. package/dist/storage/ai-cost/errors.d.ts.map +1 -0
  195. package/dist/storage/ai-cost/in-memory.d.ts +32 -0
  196. package/dist/storage/ai-cost/in-memory.d.ts.map +1 -0
  197. package/dist/storage/ai-cost/index.d.ts +6 -0
  198. package/dist/storage/ai-cost/index.d.ts.map +1 -0
  199. package/dist/storage/ai-cost/provider.d.ts +7 -0
  200. package/dist/storage/ai-cost/provider.d.ts.map +1 -0
  201. package/dist/storage/ai-cost/provider.js +132 -0
  202. package/dist/storage/ai-cost/provider.js.map +10 -0
  203. package/dist/storage/ai-cost/types.d.ts +154 -0
  204. package/dist/storage/ai-cost/types.d.ts.map +1 -0
  205. package/dist/storage/ai-cost/validation.d.ts +7 -0
  206. package/dist/storage/ai-cost/validation.d.ts.map +1 -0
  207. package/dist/storage/ai-usage/in-memory.d.ts +2 -1
  208. package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
  209. package/dist/storage/ai-usage/index.d.ts +1 -1
  210. package/dist/storage/ai-usage/index.d.ts.map +1 -1
  211. package/dist/storage/ai-usage/types.d.ts +6 -0
  212. package/dist/storage/ai-usage/types.d.ts.map +1 -1
  213. package/dist/storage/in-memory/index.d.ts +5 -0
  214. package/dist/storage/in-memory/index.d.ts.map +1 -1
  215. package/dist/storage/index.d.ts +6 -3
  216. package/dist/storage/index.d.ts.map +1 -1
  217. package/dist/storage/index.js +33 -21
  218. package/dist/storage/index.js.map +1 -1
  219. package/dist/storage/objects/in-memory.d.ts +6 -3
  220. package/dist/storage/objects/in-memory.d.ts.map +1 -1
  221. package/dist/storage/objects/index.d.ts +3 -1
  222. package/dist/storage/objects/index.d.ts.map +1 -1
  223. package/dist/storage/objects/keys.d.ts +16 -0
  224. package/dist/storage/objects/keys.d.ts.map +1 -0
  225. package/dist/storage/objects/types.d.ts +33 -6
  226. package/dist/storage/objects/types.d.ts.map +1 -1
  227. package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
  228. package/dist/storage/ontology/materializations.d.ts +3 -0
  229. package/dist/storage/ontology/materializations.d.ts.map +1 -1
  230. package/dist/storage/ontology/provider.js +1 -1
  231. package/dist/storage/operation-scope.d.ts.map +1 -1
  232. package/dist/storage/operation-scope.js +1 -1
  233. package/dist/storage/types.d.ts +2 -0
  234. package/dist/storage/types.d.ts.map +1 -1
  235. package/dist/storage/workflow-runs/provider.js +10 -5
  236. package/dist/storage/workflow-runs/provider.js.map +1 -1
  237. package/dist/syncs/index.js +16 -15
  238. package/dist/syncs/index.js.map +1 -1
  239. package/dist/testing/agent-storage-contract.d.ts +3 -2
  240. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  241. package/dist/testing/ai-cost-storage-contract.d.ts +12 -0
  242. package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -0
  243. package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
  244. package/dist/testing/effective-storage-contract.d.ts +1 -1
  245. package/dist/testing/effective-storage-contract.d.ts.map +1 -1
  246. package/dist/testing/index.d.ts +1 -0
  247. package/dist/testing/index.d.ts.map +1 -1
  248. package/dist/testing/index.js +2525 -1480
  249. package/dist/testing/index.js.map +10 -9
  250. package/dist/testing/lake-storage-contract.d.ts.map +1 -1
  251. package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
  252. package/dist/testing/object-query-contract.d.ts +1 -1
  253. package/dist/testing/object-query-contract.d.ts.map +1 -1
  254. package/dist/webhooks/internal.js +14 -13
  255. package/dist/webhooks/internal.js.map +2 -2
  256. package/dist/workers/index.js +12 -2
  257. package/dist/workers/index.js.map +3 -3
  258. package/dist/workers/queue-worker.d.ts +2 -0
  259. package/dist/workers/queue-worker.d.ts.map +1 -1
  260. package/dist/workflows/execution.d.ts +3 -0
  261. package/dist/workflows/execution.d.ts.map +1 -1
  262. package/dist/workflows/index.js +30 -28
  263. package/dist/workflows/index.js.map +1 -1
  264. package/package.json +7 -1
  265. package/src/agents/adapters.ts +64 -23
  266. package/src/agents/builders.ts +3 -3
  267. package/src/agents/context-compaction.ts +261 -0
  268. package/src/agents/errors.ts +2 -2
  269. package/src/agents/execution.ts +14 -2
  270. package/src/agents/ids.ts +5 -0
  271. package/src/agents/index.ts +32 -6
  272. package/src/agents/request.ts +5 -0
  273. package/src/agents/streams.ts +56 -0
  274. package/src/agents/thread-context-projection.ts +93 -0
  275. package/src/agents/tool-definition.ts +17 -2
  276. package/src/agents/tool-result.ts +61 -0
  277. package/src/agents/types.ts +57 -1
  278. package/src/agents/validation.ts +36 -6
  279. package/src/http/api-routes.ts +7 -7
  280. package/src/index.ts +27 -0
  281. package/src/lake-storage/types.ts +2 -1
  282. package/src/materialization/model.ts +4 -0
  283. package/src/materializer/edits/apply.ts +55 -2
  284. package/src/materializer/edits/operations.ts +8 -1
  285. package/src/materializer/edits/working-state.ts +7 -0
  286. package/src/materializer/effective/resolve.ts +78 -9
  287. package/src/materializer/execution/work-records.ts +3 -1
  288. package/src/materializer/projections/entry-validator.ts +23 -1
  289. package/src/materializer/projections/replacement-plan.ts +2 -0
  290. package/src/materializer/shared/normalize.ts +16 -0
  291. package/src/materializer/telemetry/append.ts +33 -16
  292. package/src/models/index.ts +71 -0
  293. package/src/objects/execution.ts +20 -0
  294. package/src/objects/link/endpoints.ts +2 -1
  295. package/src/objects/query/executor.ts +42 -11
  296. package/src/objects/query/explain.ts +11 -0
  297. package/src/objects/query/index.ts +6 -0
  298. package/src/objects/query/ir.ts +16 -0
  299. package/src/objects/query/links.ts +308 -0
  300. package/src/objects/query/normalize.ts +40 -1
  301. package/src/objects/query/planner.ts +5 -0
  302. package/src/objects/query/validate.ts +58 -2
  303. package/src/projections/builders.ts +320 -50
  304. package/src/projections/index.ts +7 -0
  305. package/src/projections/internal.ts +4 -1
  306. package/src/projections/ownership.ts +5 -5
  307. package/src/projections/registry.ts +16 -3
  308. package/src/projections/revision.ts +35 -5
  309. package/src/projections/run-dispatch.ts +10 -1
  310. package/src/projections/timestamp.ts +66 -0
  311. package/src/projections/types.ts +20 -9
  312. package/src/projections/validation.ts +85 -19
  313. package/src/query.ts +2 -0
  314. package/src/queues/index.ts +1 -0
  315. package/src/queues/types.ts +8 -0
  316. package/src/runtime/ai-cost.ts +15 -0
  317. package/src/runtime/create.ts +4 -0
  318. package/src/runtime/definitions.ts +3 -0
  319. package/src/runtime/host.ts +2 -0
  320. package/src/runtime/resolve-definitions.ts +28 -0
  321. package/src/storage/agents/in-memory.ts +186 -4
  322. package/src/storage/agents/index.ts +5 -0
  323. package/src/storage/agents/provider.ts +225 -0
  324. package/src/storage/agents/types.ts +82 -3
  325. package/src/storage/ai-cost/analytics.ts +602 -0
  326. package/src/storage/ai-cost/codec.ts +136 -0
  327. package/src/storage/ai-cost/errors.ts +12 -0
  328. package/src/storage/ai-cost/in-memory.ts +164 -0
  329. package/src/storage/ai-cost/index.ts +35 -0
  330. package/src/storage/ai-cost/provider.ts +20 -0
  331. package/src/storage/ai-cost/types.ts +193 -0
  332. package/src/storage/ai-cost/validation.ts +337 -0
  333. package/src/storage/ai-usage/in-memory.ts +23 -0
  334. package/src/storage/ai-usage/index.ts +1 -0
  335. package/src/storage/ai-usage/types.ts +10 -0
  336. package/src/storage/in-memory/index.ts +50 -0
  337. package/src/storage/index.ts +48 -0
  338. package/src/storage/objects/in-memory.ts +103 -16
  339. package/src/storage/objects/index.ts +9 -0
  340. package/src/storage/objects/keys.ts +36 -0
  341. package/src/storage/objects/types.ts +34 -6
  342. package/src/storage/ontology/in-memory/materializations.ts +1 -0
  343. package/src/storage/ontology/materializations.ts +3 -0
  344. package/src/storage/ontology/provider-header-validation.ts +2 -2
  345. package/src/storage/operation-scope.ts +1 -0
  346. package/src/storage/types.ts +2 -0
  347. package/src/testing/agent-storage-contract.ts +353 -2
  348. package/src/testing/ai-cost-storage-contract.ts +320 -0
  349. package/src/testing/ai-usage-storage-contract.ts +35 -0
  350. package/src/testing/effective-storage-contract.ts +194 -4
  351. package/src/testing/index.ts +5 -0
  352. package/src/testing/lake-storage-contract.ts +56 -0
  353. package/src/testing/materializer-storage-contract.ts +120 -2
  354. package/src/testing/object-query-contract.ts +208 -1
  355. package/src/workers/queue-worker.ts +14 -1
  356. package/src/workflows/execution.ts +31 -10
  357. package/dist/agents/prompt.d.ts +0 -15
  358. package/dist/agents/prompt.d.ts.map +0 -1
  359. package/dist/chunk-0mbx247x.js.map +0 -43
  360. package/dist/chunk-34bqh420.js.map +0 -23
  361. package/dist/chunk-57zpb99z.js.map +0 -10
  362. package/dist/chunk-663csy96.js.map +0 -10
  363. package/dist/chunk-6wetht33.js +0 -89
  364. package/dist/chunk-6wetht33.js.map +0 -10
  365. package/dist/chunk-88ppkr54.js.map +0 -12
  366. package/dist/chunk-nnyp53zt.js.map +0 -13
  367. package/dist/chunk-nten49ta.js.map +0 -12
  368. package/dist/chunk-st4xgxey.js.map +0 -45
  369. package/dist/chunk-vp1vc6ee.js +0 -35
  370. package/dist/chunk-vp1vc6ee.js.map +0 -11
  371. package/src/agents/prompt.ts +0 -57
  372. /package/dist/{chunk-sa4340y1.js.map → chunk-1yz3x65y.js.map} +0 -0
  373. /package/dist/{chunk-gqdd7508.js.map → chunk-4rh2m6zg.js.map} +0 -0
  374. /package/dist/{chunk-4x43bkbp.js.map → chunk-a09jx26t.js.map} +0 -0
  375. /package/dist/{chunk-zg9yryhz.js.map → chunk-cbkm2vam.js.map} +0 -0
  376. /package/dist/{chunk-8ryen3p3.js.map → chunk-f6erf2vv.js.map} +0 -0
  377. /package/dist/{chunk-bct7hmfc.js.map → chunk-g13869yf.js.map} +0 -0
  378. /package/dist/{chunk-0k4avqr2.js.map → chunk-hbeh8j9w.js.map} +0 -0
  379. /package/dist/{chunk-qvybnnpe.js.map → chunk-nzw7sm3b.js.map} +0 -0
  380. /package/dist/{chunk-bh6k3nc6.js.map → chunk-rs1wbvy6.js.map} +0 -0
  381. /package/dist/{chunk-7pc8b818.js.map → chunk-sxwk41qa.js.map} +0 -0
  382. /package/dist/{chunk-5egfka8j.js.map → chunk-tycbzedm.js.map} +0 -0
  383. /package/dist/{chunk-g9t3kdtx.js.map → chunk-x2yw73hy.js.map} +0 -0
@@ -93,11 +93,13 @@ function applyObjectOperation(
93
93
  operation,
94
94
  sourceProperties: working.source?.assertion.properties ?? null,
95
95
  authority: working.override,
96
+ editedAt: working.editedAt,
97
+ committedAt: identity.committedAt,
96
98
  effectiveExists: currentEffective !== null,
97
99
  ...normalized,
98
100
  })
99
101
 
100
- applyObjectTransition(context, state, working, transition.next, journal)
102
+ applyObjectTransition(context, state, working, transition.next, transition.editedAt, journal)
101
103
 
102
104
  return objectOperationOutcome(operation, working, transition.changed, context, identity)
103
105
  }
@@ -146,21 +148,26 @@ function applyObjectTransition(
146
148
  state: EditWorkingState,
147
149
  working: WorkingObject,
148
150
  next: WorkingObject["override"],
151
+ nextEditedAt: Readonly<Record<string, string>>,
149
152
  journal?: EditUndoJournal
150
153
  ): void {
151
154
  const previous = working.override
155
+ const previousEditedAt = working.editedAt
152
156
  working.override = next
157
+ working.editedAt = { ...nextEditedAt }
153
158
  try {
154
159
  const resolved = resolveObject(context.ontology, working)
155
160
  if (resolved) validateEffectiveObject(context.ontology, resolved.ref, resolved.properties)
156
161
  validateWorkingCardinality(state.links.slots)
157
162
  } catch (error) {
158
163
  working.override = previous
164
+ working.editedAt = previousEditedAt
159
165
  throw error
160
166
  }
161
167
  journal?.push({
162
168
  restore: () => {
163
169
  working.override = previous
170
+ working.editedAt = previousEditedAt
164
171
  },
165
172
  })
166
173
  }
@@ -25,6 +25,7 @@ import {
25
25
  resolveEffectiveLink,
26
26
  resolveEffectiveLinkSlot,
27
27
  resolveEffectiveObject,
28
+ storedObjectEditedAt,
28
29
  usableLinkSlotOverride,
29
30
  } from "../effective/resolve"
30
31
  import { linkCardinality } from "./read-set"
@@ -33,6 +34,8 @@ export interface WorkingObject {
33
34
  source: MaterializationObjectState["source"]
34
35
  originalOverride: StoredObjectOverride | null
35
36
  override: ObjectOverride | null
37
+ originalEditedAt: Readonly<Record<string, string>>
38
+ editedAt: Record<string, string>
36
39
  before: MaterializationObjectState["effective"]
37
40
  latestTelemetry: StoredTelemetryPoint[]
38
41
  }
@@ -112,11 +115,14 @@ function workingLinkSlotFromState(scope: MaterializationLinkScopeState): Working
112
115
  }
113
116
 
114
117
  export function workingObjectFromState(object: MaterializationObjectState): WorkingObject {
118
+ const editedAt = storedObjectEditedAt(object.override)
115
119
  return {
116
120
  ref: object.ref,
117
121
  source: object.source,
118
122
  originalOverride: object.override,
119
123
  override: object.override?.value ?? null,
124
+ originalEditedAt: editedAt,
125
+ editedAt: { ...editedAt },
120
126
  before: object.effective,
121
127
  latestTelemetry: [...object.latestTelemetry],
122
128
  }
@@ -141,6 +147,7 @@ export function resolveObject(
141
147
  primaryPropertyId: ontology.getPrimaryPropertyId(working.ref.objectTypeId),
142
148
  source: working.source,
143
149
  override: working.override,
150
+ editedAt: working.editedAt,
144
151
  latestTelemetry: working.latestTelemetry,
145
152
  })
146
153
  }
@@ -11,6 +11,7 @@ import type {
11
11
  import { linkRefKey } from "../../materialization/refs"
12
12
  import type {
13
13
  StoredLinkSlotOverride,
14
+ StoredObjectOverride,
14
15
  StoredSourceLinkAssertion,
15
16
  StoredSourceObjectAssertion,
16
17
  StoredTelemetryPoint,
@@ -46,9 +47,10 @@ export function resolveEffectiveObject(input: {
46
47
  readonly primaryPropertyId: string
47
48
  readonly source: StoredSourceObjectAssertion | null
48
49
  readonly override: ObjectOverride | null
50
+ readonly editedAt: Readonly<Record<string, string>>
49
51
  readonly latestTelemetry: readonly StoredTelemetryPoint[]
50
52
  }): ResolvedObjectValue | null {
51
- const properties = resolveObjectAuthority(input.source, input.override)
53
+ const properties = resolveObjectAuthority(input.source, input.override, input.editedAt)
52
54
  if (!properties) return null
53
55
 
54
56
  properties[input.primaryPropertyId] = input.ref.primaryId
@@ -58,31 +60,98 @@ export function resolveEffectiveObject(input: {
58
60
 
59
61
  function resolveObjectAuthority(
60
62
  source: StoredSourceObjectAssertion | null,
61
- override: ObjectOverride | null
63
+ override: ObjectOverride | null,
64
+ editedAt: Readonly<Record<string, string>>
62
65
  ): Record<string, JsonValue> | null {
63
66
  switch (override?.kind) {
64
67
  case "delete":
65
68
  return null
66
69
  case "create":
67
- return { ...override.properties }
70
+ if (!source) return { ...override.properties }
71
+ return resolveSourceAndEdits(source, override, editedAt)
68
72
  case "patch":
69
73
  if (!source) return null
70
- return applyObjectPatch(source.assertion.properties, override)
74
+ return resolveSourceAndEdits(source, override, editedAt)
71
75
  default:
72
76
  if (!source) return null
73
77
  return { ...source.assertion.properties }
74
78
  }
75
79
  }
76
80
 
77
- function applyObjectPatch(
78
- sourceProperties: Readonly<Record<string, JsonValue>>,
79
- override: Extract<ObjectOverride, { readonly kind: "patch" }>
81
+ function resolveSourceAndEdits(
82
+ source: StoredSourceObjectAssertion,
83
+ override: Exclude<ObjectOverride, { readonly kind: "delete" }>,
84
+ editedAt: Readonly<Record<string, string>>
80
85
  ): Record<string, JsonValue> {
81
- const properties = { ...sourceProperties, ...override.set }
82
- for (const propertyId of override.unset) delete properties[propertyId]
86
+ const properties = { ...source.assertion.properties }
87
+ const absentSourcePropertyIds = new Set(source.assertion.absentSourcePropertyIds ?? [])
88
+
89
+ for (const propertyId of objectEditCandidateIds(override, editedAt)) {
90
+ const edit = objectEditCandidate(override, propertyId)
91
+ const editTimestamp = editedAt[propertyId]
92
+ const hasSourceCandidate =
93
+ Object.hasOwn(source.assertion.properties, propertyId) ||
94
+ absentSourcePropertyIds.has(propertyId)
95
+ const sourceWins =
96
+ hasSourceCandidate &&
97
+ source.assertion.sourceUpdatedAt !== undefined &&
98
+ editTimestamp !== undefined &&
99
+ source.assertion.sourceUpdatedAt.localeCompare(editTimestamp) >= 0
100
+
101
+ if (!sourceWins) applyObjectEditCandidate(properties, propertyId, edit)
102
+ }
83
103
  return properties
84
104
  }
85
105
 
106
+ interface ObjectPropertyCandidate {
107
+ readonly present: boolean
108
+ readonly value?: JsonValue
109
+ }
110
+
111
+ function objectEditCandidateIds(
112
+ override: Exclude<ObjectOverride, { readonly kind: "delete" }>,
113
+ editedAt: Readonly<Record<string, string>>
114
+ ): string[] {
115
+ const ids = new Set(Object.keys(editedAt))
116
+ if (override.kind === "create") {
117
+ for (const propertyId of Object.keys(override.properties)) ids.add(propertyId)
118
+ } else {
119
+ for (const propertyId of Object.keys(override.set)) ids.add(propertyId)
120
+ for (const propertyId of override.unset) ids.add(propertyId)
121
+ }
122
+ return [...ids]
123
+ }
124
+
125
+ function objectEditCandidate(
126
+ override: Exclude<ObjectOverride, { readonly kind: "delete" }>,
127
+ propertyId: string
128
+ ): ObjectPropertyCandidate {
129
+ const values = override.kind === "create" ? override.properties : override.set
130
+ return Object.hasOwn(values, propertyId)
131
+ ? { present: true, value: values[propertyId] }
132
+ : { present: false }
133
+ }
134
+
135
+ function applyObjectEditCandidate(
136
+ properties: Record<string, JsonValue>,
137
+ propertyId: string,
138
+ candidate: ObjectPropertyCandidate
139
+ ): void {
140
+ if (candidate.present) properties[propertyId] = candidate.value as JsonValue
141
+ else delete properties[propertyId]
142
+ }
143
+
144
+ export function storedObjectEditedAt(stored: StoredObjectOverride | null): Record<string, string> {
145
+ if (!stored || stored.value.kind === "delete") return {}
146
+ const editedAt = { ...(stored.editedAt ?? {}) }
147
+ const candidateIds =
148
+ stored.value.kind === "create"
149
+ ? Object.keys(stored.value.properties)
150
+ : [...Object.keys(stored.value.set), ...stored.value.unset]
151
+ for (const propertyId of candidateIds) editedAt[propertyId] ??= stored.updatedAt
152
+ return editedAt
153
+ }
154
+
86
155
  function applyLatestTelemetry(
87
156
  properties: Record<string, JsonValue>,
88
157
  latestTelemetry: readonly StoredTelemetryPoint[]
@@ -22,7 +22,8 @@ export function appendObjectOverrideWork(
22
22
  ): void {
23
23
  if (
24
24
  stableJsonStringify(working.originalOverride?.value ?? null) ===
25
- stableJsonStringify(working.override)
25
+ stableJsonStringify(working.override) &&
26
+ stableJsonStringify(working.originalEditedAt) === stableJsonStringify(working.editedAt)
26
27
  ) {
27
28
  return
28
29
  }
@@ -32,6 +33,7 @@ export function appendObjectOverrideWork(
32
33
  value: {
33
34
  ref: working.ref,
34
35
  value: working.override,
36
+ editedAt: working.editedAt,
35
37
  expectedLastCommitId: working.originalOverride?.lastCommitId ?? null,
36
38
  lastCommitId: identity.commitId,
37
39
  updatedAt: identity.committedAt,
@@ -118,7 +118,29 @@ function validateObjectAssertion(
118
118
  `Projection '${resolved.projectionId}' asserted unowned property '${assertion.ref.objectTypeId}.${propertyId}'.`
119
119
  )
120
120
  }
121
- return { ...assertion, properties }
121
+ const conflictResolution = resolved.definition.conflictResolution ?? { strategy: "editsWin" }
122
+ if (conflictResolution.strategy !== "mostRecent") {
123
+ return { kind: "object", ref: assertion.ref, properties }
124
+ }
125
+ if (assertion.sourceUpdatedAt === undefined) {
126
+ throw new MaterializationValidationError(
127
+ `Projection '${resolved.projectionId}' requires source update timestamp ` +
128
+ `'${conflictResolution.sourceTimestamp}' on every object assertion.`
129
+ )
130
+ }
131
+ const primaryPropertyId = ontology.getPrimaryPropertyId(assertion.ref.objectTypeId)
132
+ const absentSourcePropertyIds = [...owned]
133
+ .filter(
134
+ (propertyId) => propertyId !== primaryPropertyId && !Object.hasOwn(properties, propertyId)
135
+ )
136
+ .sort()
137
+ return {
138
+ kind: "object",
139
+ ref: assertion.ref,
140
+ properties,
141
+ sourceUpdatedAt: assertion.sourceUpdatedAt,
142
+ ...(absentSourcePropertyIds.length === 0 ? {} : { absentSourcePropertyIds }),
143
+ }
122
144
  }
123
145
 
124
146
  function validateLinkAssertion(
@@ -33,6 +33,7 @@ import {
33
33
  resolveEffectiveLink,
34
34
  resolveEffectiveLinkSlotMember,
35
35
  resolveEffectiveObject,
36
+ storedObjectEditedAt,
36
37
  usableLinkSlotOverride,
37
38
  } from "../effective/resolve"
38
39
  import { validateEffectiveObject } from "../effective/validate"
@@ -374,6 +375,7 @@ function resolveReplacementObject(
374
375
  primaryPropertyId: context.ontology.getPrimaryPropertyId(state.ref.objectTypeId),
375
376
  source: state.candidateSource,
376
377
  override: state.override?.value ?? null,
378
+ editedAt: storedObjectEditedAt(state.override),
377
379
  latestTelemetry: state.latestTelemetry,
378
380
  })
379
381
  }
@@ -25,6 +25,7 @@ import {
25
25
  projectionEntityKey,
26
26
  telemetryPointKey,
27
27
  } from "../../materialization/refs"
28
+ import { parseDatasetTimestamp } from "../../projections/timestamp"
28
29
 
29
30
  export function normalizeJsonProperties(
30
31
  properties: Readonly<Record<string, unknown>>,
@@ -67,6 +68,16 @@ function normalizeTimestamp(value: string, label: string): string {
67
68
  return new Date(milliseconds).toISOString()
68
69
  }
69
70
 
71
+ function normalizeProjectionSourceTimestamp(value: string): string {
72
+ const timestamp = parseDatasetTimestamp(value)
73
+ if (!timestamp) {
74
+ throw new MaterializationValidationError(
75
+ "Projection source update timestamp must be a valid timestamp."
76
+ )
77
+ }
78
+ return timestamp.toISOString()
79
+ }
80
+
70
81
  function normalizePropertyIds(values: readonly string[], label: string): readonly string[] {
71
82
  const seen = new Set<string>()
72
83
  const normalized: string[] = []
@@ -347,6 +358,11 @@ function normalizeProjectionAssertion(
347
358
  kind: "object",
348
359
  ref: normalizeObjectRef(assertion.ref),
349
360
  properties: normalizeJsonProperties(assertion.properties),
361
+ ...(assertion.sourceUpdatedAt !== undefined
362
+ ? {
363
+ sourceUpdatedAt: normalizeProjectionSourceTimestamp(assertion.sourceUpdatedAt),
364
+ }
365
+ : {}),
350
366
  })
351
367
  : Object.freeze({
352
368
  kind: "link",
@@ -90,7 +90,6 @@ function prepareTelemetryAppend(
90
90
  points: raw.input.points.map((point) => validateTelemetryPoint(context.ontology, point)),
91
91
  })
92
92
  const inputPointCount = telemetryInputPointCount(input, rawInputPointCount)
93
- validateTelemetryBatch(input, inputPointCount)
94
93
 
95
94
  const ontologyRevision = context.projectionRegistry.ontologyRevision
96
95
  const execution = prepareMaterializerExecution(context.projectId, raw.scope)
@@ -114,21 +113,6 @@ function telemetryInputPointCount(
114
113
  return input.points.length
115
114
  }
116
115
 
117
- function validateTelemetryBatch(input: NormalizedTelemetryAppend, inputPointCount: number): void {
118
- if (input.source.kind === "projection") {
119
- if (input.source.sourceRowCount === 0) {
120
- throw new MaterializationValidationError(
121
- "Projection telemetry batches must consume at least one source row; an empty dataset produces no batch commit."
122
- )
123
- }
124
- if (input.source.sourceRowCount !== inputPointCount + input.source.sourceRowsSkipped) {
125
- throw new MaterializationValidationError(
126
- "Projection telemetry sourceRowCount must equal input points plus skipped rows."
127
- )
128
- }
129
- }
130
- }
131
-
132
116
  function prepareRuntimeTelemetry(
133
117
  context: Pick<MaterializerContext, "projectId" | "clock">,
134
118
  input: NormalizedTelemetryAppend,
@@ -157,6 +141,7 @@ function prepareProjectionTelemetry(
157
141
  )
158
142
  validateTelemetryProjectionDataset(resolvedProjection, source)
159
143
  validateTelemetryOwnership(resolvedProjection, input)
144
+ validateTelemetryBatchCardinality(resolvedProjection, source, inputPointCount)
160
145
 
161
146
  const runIdentity = createProjectionRunMaterializationIdentity({
162
147
  resolved: resolvedProjection,
@@ -182,6 +167,38 @@ function prepareProjectionTelemetry(
182
167
  }
183
168
  }
184
169
 
170
+ function validateTelemetryBatchCardinality(
171
+ resolved: ResolvedTelemetryProjection,
172
+ source: ProjectionTelemetrySource,
173
+ inputPointCount: number
174
+ ): void {
175
+ if (source.sourceRowCount === 0) {
176
+ throw new MaterializationValidationError(
177
+ "Projection telemetry batches must consume at least one source row; an empty dataset produces no batch commit."
178
+ )
179
+ }
180
+
181
+ const mappedPropertyCount = resolved.ownership.telemetry.length
182
+ if (mappedPropertyCount === 0) {
183
+ throw new MaterializationValidationError(
184
+ `Telemetry projection '${resolved.projectionId}' must own at least one telemetry property.`
185
+ )
186
+ }
187
+
188
+ const sourceRowsEmitted = source.sourceRowCount - source.sourceRowsSkipped
189
+ const maximumPointCount = sourceRowsEmitted * mappedPropertyCount
190
+ if (!Number.isSafeInteger(maximumPointCount)) {
191
+ throw new MaterializationValidationError(
192
+ `Telemetry projection '${resolved.projectionId}' batch point capacity exceeds the safe integer range.`
193
+ )
194
+ }
195
+ if (inputPointCount < sourceRowsEmitted || inputPointCount > maximumPointCount) {
196
+ throw new MaterializationValidationError(
197
+ `Telemetry projection '${resolved.projectionId}' must emit between ${sourceRowsEmitted} and ${maximumPointCount} points for ${source.sourceRowCount} source rows with ${source.sourceRowsSkipped} skipped.`
198
+ )
199
+ }
200
+ }
201
+
185
202
  function validateTelemetryProjectionDataset(
186
203
  resolved: ResolvedTelemetryProjection,
187
204
  source: ProjectionTelemetrySource
@@ -0,0 +1,71 @@
1
+ import type { LanguageModelV4 } from "@ai-sdk/provider"
2
+ import { createDefinitionCatalog, type DefinitionCatalog } from "../runtime/definitions"
3
+ import { RuntimeError } from "../runtime/errors"
4
+
5
+ /** The configured language models, with the project default. */
6
+ export interface LanguageModelCatalog extends DefinitionCatalog<LanguageModelEntry> {
7
+ readonly default: LanguageModelEntry
8
+ }
9
+
10
+ /**
11
+ * One configured language model.
12
+ *
13
+ * `ref` is derived, never author-supplied, and stays internal to the runtime: it identifies the
14
+ * configured binding, not a vendor model. The AI SDK's `provider` names the binding, so
15
+ * `openai.chat(...)` and `openai.responses(...)` are distinct entries even for one vendor model,
16
+ * and neither matches the canonical id the worker resolves for billing
17
+ * (`SDK_PROVIDER_BINDINGS` in `@sixb/agent-worker`). Anything user-facing should key on
18
+ * `provider` + `modelId` instead.
19
+ */
20
+ export interface LanguageModelEntry {
21
+ readonly ref: string
22
+ readonly provider: string
23
+ readonly modelId: string
24
+ readonly model: LanguageModelV4
25
+ }
26
+
27
+ /** Models a project allows Sixb to use, organized by technical model kind. */
28
+ export interface ModelCatalog {
29
+ readonly language: LanguageModelCatalog
30
+ }
31
+
32
+ export interface ModelCatalogInput {
33
+ /** Ordered; the first entry is the project default. */
34
+ readonly language: readonly LanguageModelV4[]
35
+ }
36
+
37
+ /**
38
+ * Identify a catalog entry by the binding its model was constructed from.
39
+ *
40
+ * `gateway("openai/gpt-5.4")` and `openai("gpt-5.4")` are different entries on purpose: they route
41
+ * differently and bill differently. See {@link LanguageModelEntry}.
42
+ */
43
+ export function modelRef(model: LanguageModelV4): string {
44
+ return `${model.provider}/${model.modelId}`
45
+ }
46
+
47
+ /** Build the immutable project model catalog. Rejects duplicates and an empty catalog. */
48
+ export function createModelCatalog(input: ModelCatalogInput): ModelCatalog {
49
+ const byRef = new Map<string, LanguageModelEntry>()
50
+
51
+ for (const model of input.language) {
52
+ const ref = modelRef(model)
53
+ if (byRef.has(ref)) {
54
+ throw new RuntimeError(
55
+ `[Sixb] Duplicate language model '${ref}' in 'models'. Each provider and model id pair may be configured once.`
56
+ )
57
+ }
58
+ byRef.set(ref, Object.freeze({ ref, provider: model.provider, modelId: model.modelId, model }))
59
+ }
60
+
61
+ const [defaultEntry] = byRef.values()
62
+ if (defaultEntry === undefined) {
63
+ throw new RuntimeError(
64
+ "[Sixb] 'models.language' needs at least one model. Configure one or omit 'models' from createSixb()."
65
+ )
66
+ }
67
+
68
+ return Object.freeze({
69
+ language: Object.freeze({ ...createDefinitionCatalog(byRef), default: defaultEntry }),
70
+ })
71
+ }
@@ -29,8 +29,11 @@ import {
29
29
  type ExecuteObjectFacetsInput,
30
30
  type ExecuteObjectFacetsResult,
31
31
  type ExecuteObjectQueryInput,
32
+ type ExecuteObjectQueryLinksInput,
33
+ type ExecuteObjectQueryLinksResult,
32
34
  type ExecuteObjectQueryResult,
33
35
  executeObjectQuery,
36
+ executeObjectQueryLinks,
34
37
  existsObjects,
35
38
  facetObjects,
36
39
  } from "./query"
@@ -121,6 +124,12 @@ export interface ExecutionObjectSet<
121
124
  byId(id: string): ExecutionObjectByIdHandle<TObjectType, TValueTypes>
122
125
  }
123
126
 
127
+ /** Public input for querying physical links incident to an object query result. */
128
+ export type ObjectQueryLinksInput = Omit<ExecuteObjectQueryLinksInput, "projectId">
129
+
130
+ /** Public result returned by {@link ObjectsRuntime.queryLinks}. */
131
+ export type ObjectQueryLinksResult = ExecuteObjectQueryLinksResult
132
+
124
133
  export interface ObjectsRuntime<TOntologySources extends readonly OntologySource[]>
125
134
  extends ExecutionObjectOperations {
126
135
  <TObjectType extends RegisteredObjectType<TOntologySources>>(
@@ -131,6 +140,7 @@ export interface ObjectsRuntime<TOntologySources extends readonly OntologySource
131
140
  RegisteredObjectType<TOntologySources>
132
141
  >
133
142
  executeQuery(input: Omit<ExecuteObjectQueryInput, "projectId">): Promise<ExecuteObjectQueryResult>
143
+ queryLinks(input: ObjectQueryLinksInput): Promise<ObjectQueryLinksResult>
134
144
  count(input: Omit<ExecuteObjectCountInput, "projectId">): Promise<ExecuteObjectCountResult>
135
145
  exists(input: Omit<ExecuteObjectExistsInput, "projectId">): Promise<ExecuteObjectExistsResult>
136
146
  facet(input: Omit<ExecuteObjectFacetsInput, "projectId">): Promise<ExecuteObjectFacetsResult>
@@ -208,6 +218,16 @@ export function createObjectsRuntime<TOntologySources extends readonly OntologyS
208
218
  authorization: runtime.authorization,
209
219
  }
210
220
  ),
221
+ queryLinks: (input: ObjectQueryLinksInput) =>
222
+ executeObjectQueryLinks(
223
+ { projectId: runtime.projectId, ...input },
224
+ {
225
+ ontology: runtime.ontology,
226
+ storage: runtime.storage.objects,
227
+ runtimeAuthorization: runtime.runtimeAuthorization,
228
+ authorization: runtime.authorization,
229
+ }
230
+ ),
211
231
  count: (input: Omit<ExecuteObjectCountInput, "projectId">) =>
212
232
  countObjects(
213
233
  { projectId: runtime.projectId, ...input },
@@ -7,6 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { SixbRuntimeContext } from "../../runtime/types"
10
+ import { objectBatchKey } from "../../storage"
10
11
  import { ObjectNotFoundError } from "../../storage/errors"
11
12
 
12
13
  export interface LinkEndpointItem {
@@ -62,5 +63,5 @@ export function requireEndpoints(item: LinkEndpointItem, existing: EndpointExist
62
63
  }
63
64
 
64
65
  function endpointKey(objectTypeId: string, primaryId: string): string {
65
- return `${objectTypeId}:${primaryId}`
66
+ return objectBatchKey(objectTypeId, primaryId)
66
67
  }