@sixb/core 0.0.1

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 (1582) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +470 -0
  3. package/dist/actions/builders/define-action.d.ts +7 -0
  4. package/dist/actions/builders/define-action.d.ts.map +1 -0
  5. package/dist/actions/builders/params.d.ts +23 -0
  6. package/dist/actions/builders/params.d.ts.map +1 -0
  7. package/dist/actions/builders.d.ts +3 -0
  8. package/dist/actions/builders.d.ts.map +1 -0
  9. package/dist/actions/commit-edits.d.ts +54 -0
  10. package/dist/actions/commit-edits.d.ts.map +1 -0
  11. package/dist/actions/errors.d.ts +9 -0
  12. package/dist/actions/errors.d.ts.map +1 -0
  13. package/dist/actions/index.d.ts +14 -0
  14. package/dist/actions/index.d.ts.map +1 -0
  15. package/dist/actions/index.js +73 -0
  16. package/dist/actions/index.js.map +9 -0
  17. package/dist/actions/read-facade.d.ts +56 -0
  18. package/dist/actions/read-facade.d.ts.map +1 -0
  19. package/dist/actions/registry.d.ts +17 -0
  20. package/dist/actions/registry.d.ts.map +1 -0
  21. package/dist/actions/request.d.ts +37 -0
  22. package/dist/actions/request.d.ts.map +1 -0
  23. package/dist/actions/run-id.d.ts +3 -0
  24. package/dist/actions/run-id.d.ts.map +1 -0
  25. package/dist/actions/runtime.d.ts +11 -0
  26. package/dist/actions/runtime.d.ts.map +1 -0
  27. package/dist/actions/types/context.d.ts +147 -0
  28. package/dist/actions/types/context.d.ts.map +1 -0
  29. package/dist/actions/types/definitions.d.ts +67 -0
  30. package/dist/actions/types/definitions.d.ts.map +1 -0
  31. package/dist/actions/types/handlers.d.ts +19 -0
  32. package/dist/actions/types/handlers.d.ts.map +1 -0
  33. package/dist/actions/types/params.d.ts +45 -0
  34. package/dist/actions/types/params.d.ts.map +1 -0
  35. package/dist/actions/types.d.ts +5 -0
  36. package/dist/actions/types.d.ts.map +1 -0
  37. package/dist/actions/validation.d.ts +33 -0
  38. package/dist/actions/validation.d.ts.map +1 -0
  39. package/dist/actions/validators.d.ts +8 -0
  40. package/dist/actions/validators.d.ts.map +1 -0
  41. package/dist/actions/worker.d.ts +3 -0
  42. package/dist/actions/worker.d.ts.map +1 -0
  43. package/dist/actions/worker.js +324 -0
  44. package/dist/actions/worker.js.map +11 -0
  45. package/dist/agents/adapters.d.ts +185 -0
  46. package/dist/agents/adapters.d.ts.map +1 -0
  47. package/dist/agents/api-gateway.d.ts +21 -0
  48. package/dist/agents/api-gateway.d.ts.map +1 -0
  49. package/dist/agents/builders.d.ts +10 -0
  50. package/dist/agents/builders.d.ts.map +1 -0
  51. package/dist/agents/context-model.d.ts +4 -0
  52. package/dist/agents/context-model.d.ts.map +1 -0
  53. package/dist/agents/context-resolution.d.ts +5 -0
  54. package/dist/agents/context-resolution.d.ts.map +1 -0
  55. package/dist/agents/context.d.ts +57 -0
  56. package/dist/agents/context.d.ts.map +1 -0
  57. package/dist/agents/context.js +23 -0
  58. package/dist/agents/context.js.map +9 -0
  59. package/dist/agents/dispatch.d.ts +36 -0
  60. package/dist/agents/dispatch.d.ts.map +1 -0
  61. package/dist/agents/errors.d.ts +27 -0
  62. package/dist/agents/errors.d.ts.map +1 -0
  63. package/dist/agents/ids.d.ts +11 -0
  64. package/dist/agents/ids.d.ts.map +1 -0
  65. package/dist/agents/index.d.ts +24 -0
  66. package/dist/agents/index.d.ts.map +1 -0
  67. package/dist/agents/index.js +121 -0
  68. package/dist/agents/index.js.map +9 -0
  69. package/dist/agents/message.d.ts +78 -0
  70. package/dist/agents/message.d.ts.map +1 -0
  71. package/dist/agents/prompt.d.ts +15 -0
  72. package/dist/agents/prompt.d.ts.map +1 -0
  73. package/dist/agents/request.d.ts +42 -0
  74. package/dist/agents/request.d.ts.map +1 -0
  75. package/dist/agents/runtime.d.ts +41 -0
  76. package/dist/agents/runtime.d.ts.map +1 -0
  77. package/dist/agents/streams.d.ts +72 -0
  78. package/dist/agents/streams.d.ts.map +1 -0
  79. package/dist/agents/streams.js +32 -0
  80. package/dist/agents/streams.js.map +9 -0
  81. package/dist/agents/types.d.ts +52 -0
  82. package/dist/agents/types.d.ts.map +1 -0
  83. package/dist/agents/validation.d.ts +10 -0
  84. package/dist/agents/validation.d.ts.map +1 -0
  85. package/dist/auth/access-tokens.d.ts +19 -0
  86. package/dist/auth/access-tokens.d.ts.map +1 -0
  87. package/dist/auth/audience.d.ts +8 -0
  88. package/dist/auth/audience.d.ts.map +1 -0
  89. package/dist/auth/cookies.d.ts +50 -0
  90. package/dist/auth/cookies.d.ts.map +1 -0
  91. package/dist/auth/csrf.d.ts +8 -0
  92. package/dist/auth/csrf.d.ts.map +1 -0
  93. package/dist/auth/errors.d.ts +7 -0
  94. package/dist/auth/errors.d.ts.map +1 -0
  95. package/dist/auth/index.d.ts +15 -0
  96. package/dist/auth/index.d.ts.map +1 -0
  97. package/dist/auth/index.js +101 -0
  98. package/dist/auth/index.js.map +9 -0
  99. package/dist/auth/runtime.d.ts +129 -0
  100. package/dist/auth/runtime.d.ts.map +1 -0
  101. package/dist/auth/session-cache.d.ts +44 -0
  102. package/dist/auth/session-cache.d.ts.map +1 -0
  103. package/dist/auth/sessions.d.ts +16 -0
  104. package/dist/auth/sessions.d.ts.map +1 -0
  105. package/dist/auth/strategy.d.ts +11 -0
  106. package/dist/auth/strategy.d.ts.map +1 -0
  107. package/dist/auth/strategy.js +14 -0
  108. package/dist/auth/strategy.js.map +9 -0
  109. package/dist/auth/types.d.ts +460 -0
  110. package/dist/auth/types.d.ts.map +1 -0
  111. package/dist/auth/validation.d.ts +26 -0
  112. package/dist/auth/validation.d.ts.map +1 -0
  113. package/dist/authorization/application-access.d.ts +18 -0
  114. package/dist/authorization/application-access.d.ts.map +1 -0
  115. package/dist/authorization/decision.d.ts +104 -0
  116. package/dist/authorization/decision.d.ts.map +1 -0
  117. package/dist/authorization/errors.d.ts +10 -0
  118. package/dist/authorization/errors.d.ts.map +1 -0
  119. package/dist/authorization/event-visibility.d.ts +16 -0
  120. package/dist/authorization/event-visibility.d.ts.map +1 -0
  121. package/dist/authorization/grant-kinds.d.ts +48 -0
  122. package/dist/authorization/grant-kinds.d.ts.map +1 -0
  123. package/dist/authorization/index.d.ts +11 -0
  124. package/dist/authorization/index.d.ts.map +1 -0
  125. package/dist/authorization/index.js +48 -0
  126. package/dist/authorization/index.js.map +9 -0
  127. package/dist/authorization/resolve.d.ts +28 -0
  128. package/dist/authorization/resolve.d.ts.map +1 -0
  129. package/dist/authorization/run-visibility.d.ts +15 -0
  130. package/dist/authorization/run-visibility.d.ts.map +1 -0
  131. package/dist/authorization/types.d.ts +46 -0
  132. package/dist/authorization/types.d.ts.map +1 -0
  133. package/dist/blob-storage/browser.d.ts +14 -0
  134. package/dist/blob-storage/browser.d.ts.map +1 -0
  135. package/dist/blob-storage/browser.js +22 -0
  136. package/dist/blob-storage/browser.js.map +9 -0
  137. package/dist/blob-storage/constants.d.ts +10 -0
  138. package/dist/blob-storage/constants.d.ts.map +1 -0
  139. package/dist/blob-storage/derive.d.ts +4 -0
  140. package/dist/blob-storage/derive.d.ts.map +1 -0
  141. package/dist/blob-storage/errors.d.ts +7 -0
  142. package/dist/blob-storage/errors.d.ts.map +1 -0
  143. package/dist/blob-storage/in-memory.d.ts +10 -0
  144. package/dist/blob-storage/in-memory.d.ts.map +1 -0
  145. package/dist/blob-storage/index.d.ts +8 -0
  146. package/dist/blob-storage/index.d.ts.map +1 -0
  147. package/dist/blob-storage/index.js +44 -0
  148. package/dist/blob-storage/index.js.map +9 -0
  149. package/dist/blob-storage/types.d.ts +126 -0
  150. package/dist/blob-storage/types.d.ts.map +1 -0
  151. package/dist/blob-storage/utils.d.ts +9 -0
  152. package/dist/blob-storage/utils.d.ts.map +1 -0
  153. package/dist/blob-storage/validation.d.ts +6 -0
  154. package/dist/blob-storage/validation.d.ts.map +1 -0
  155. package/dist/bootstrap/discovery.d.ts +34 -0
  156. package/dist/bootstrap/discovery.d.ts.map +1 -0
  157. package/dist/bootstrap/index.d.ts +4 -0
  158. package/dist/bootstrap/index.d.ts.map +1 -0
  159. package/dist/bootstrap/index.js +80 -0
  160. package/dist/bootstrap/index.js.map +9 -0
  161. package/dist/bootstrap/ontology-type-manifest.d.ts +22 -0
  162. package/dist/bootstrap/ontology-type-manifest.d.ts.map +1 -0
  163. package/dist/broker/errors.d.ts +12 -0
  164. package/dist/broker/errors.d.ts.map +1 -0
  165. package/dist/broker/in-memory.d.ts +53 -0
  166. package/dist/broker/in-memory.d.ts.map +1 -0
  167. package/dist/broker/index.d.ts +5 -0
  168. package/dist/broker/index.d.ts.map +1 -0
  169. package/dist/broker/index.js +15 -0
  170. package/dist/broker/index.js.map +9 -0
  171. package/dist/broker/types.d.ts +119 -0
  172. package/dist/broker/types.d.ts.map +1 -0
  173. package/dist/chunk-04b07a9q.js +89 -0
  174. package/dist/chunk-04b07a9q.js.map +10 -0
  175. package/dist/chunk-0fygrz37.js +354 -0
  176. package/dist/chunk-0fygrz37.js.map +17 -0
  177. package/dist/chunk-0psb6kdw.js +989 -0
  178. package/dist/chunk-0psb6kdw.js.map +15 -0
  179. package/dist/chunk-1evzqhks.js +76 -0
  180. package/dist/chunk-1evzqhks.js.map +10 -0
  181. package/dist/chunk-1vffvydj.js +109 -0
  182. package/dist/chunk-1vffvydj.js.map +10 -0
  183. package/dist/chunk-2ab72m2h.js +59 -0
  184. package/dist/chunk-2ab72m2h.js.map +10 -0
  185. package/dist/chunk-2gpr6jsz.js +1968 -0
  186. package/dist/chunk-2gpr6jsz.js.map +13 -0
  187. package/dist/chunk-2s6sydsh.js +368 -0
  188. package/dist/chunk-2s6sydsh.js.map +12 -0
  189. package/dist/chunk-45tw90k7.js +72 -0
  190. package/dist/chunk-45tw90k7.js.map +11 -0
  191. package/dist/chunk-4pycxcj3.js +35 -0
  192. package/dist/chunk-4pycxcj3.js.map +11 -0
  193. package/dist/chunk-50kv63vj.js +523 -0
  194. package/dist/chunk-50kv63vj.js.map +12 -0
  195. package/dist/chunk-51fjndv0.js +17 -0
  196. package/dist/chunk-51fjndv0.js.map +11 -0
  197. package/dist/chunk-590dejbp.js +49 -0
  198. package/dist/chunk-590dejbp.js.map +10 -0
  199. package/dist/chunk-5yny9z0e.js +60 -0
  200. package/dist/chunk-5yny9z0e.js.map +10 -0
  201. package/dist/chunk-6wetht33.js +89 -0
  202. package/dist/chunk-6wetht33.js.map +10 -0
  203. package/dist/chunk-74drx9gd.js +362 -0
  204. package/dist/chunk-74drx9gd.js.map +11 -0
  205. package/dist/chunk-867jxh7c.js +1156 -0
  206. package/dist/chunk-867jxh7c.js.map +19 -0
  207. package/dist/chunk-88ppkr54.js +257 -0
  208. package/dist/chunk-88ppkr54.js.map +12 -0
  209. package/dist/chunk-8r8cw2xw.js +373 -0
  210. package/dist/chunk-8r8cw2xw.js.map +11 -0
  211. package/dist/chunk-8ydjhh27.js +95 -0
  212. package/dist/chunk-8ydjhh27.js.map +11 -0
  213. package/dist/chunk-9dzba0f2.js +43 -0
  214. package/dist/chunk-9dzba0f2.js.map +10 -0
  215. package/dist/chunk-aebzcsxr.js +5272 -0
  216. package/dist/chunk-aebzcsxr.js.map +48 -0
  217. package/dist/chunk-b49dgvsj.js +49 -0
  218. package/dist/chunk-b49dgvsj.js.map +10 -0
  219. package/dist/chunk-btpe64e4.js +554 -0
  220. package/dist/chunk-btpe64e4.js.map +13 -0
  221. package/dist/chunk-c3zd880g.js +629 -0
  222. package/dist/chunk-c3zd880g.js.map +14 -0
  223. package/dist/chunk-dcgrzj1t.js +2954 -0
  224. package/dist/chunk-dcgrzj1t.js.map +36 -0
  225. package/dist/chunk-dhmj53mx.js +501 -0
  226. package/dist/chunk-dhmj53mx.js.map +16 -0
  227. package/dist/chunk-dktq02ne.js +16 -0
  228. package/dist/chunk-dktq02ne.js.map +10 -0
  229. package/dist/chunk-f2b5e2gf.js +141 -0
  230. package/dist/chunk-f2b5e2gf.js.map +11 -0
  231. package/dist/chunk-gqdd7508.js +273 -0
  232. package/dist/chunk-gqdd7508.js.map +11 -0
  233. package/dist/chunk-hsv43v58.js +1390 -0
  234. package/dist/chunk-hsv43v58.js.map +21 -0
  235. package/dist/chunk-jdwx7vzs.js +454 -0
  236. package/dist/chunk-jdwx7vzs.js.map +14 -0
  237. package/dist/chunk-k25jm1x5.js +102 -0
  238. package/dist/chunk-k25jm1x5.js.map +10 -0
  239. package/dist/chunk-k41ajtz7.js +352 -0
  240. package/dist/chunk-k41ajtz7.js.map +13 -0
  241. package/dist/chunk-k6j72mtt.js +9 -0
  242. package/dist/chunk-k6j72mtt.js.map +10 -0
  243. package/dist/chunk-mx84y05q.js +426 -0
  244. package/dist/chunk-mx84y05q.js.map +11 -0
  245. package/dist/chunk-nvamz5dv.js +819 -0
  246. package/dist/chunk-nvamz5dv.js.map +21 -0
  247. package/dist/chunk-p6r5g77m.js +113 -0
  248. package/dist/chunk-p6r5g77m.js.map +10 -0
  249. package/dist/chunk-pv1yad91.js +1165 -0
  250. package/dist/chunk-pv1yad91.js.map +27 -0
  251. package/dist/chunk-q4qzq0ea.js +832 -0
  252. package/dist/chunk-q4qzq0ea.js.map +14 -0
  253. package/dist/chunk-r65yscvk.js +187 -0
  254. package/dist/chunk-r65yscvk.js.map +11 -0
  255. package/dist/chunk-ry24jbr1.js +50 -0
  256. package/dist/chunk-ry24jbr1.js.map +10 -0
  257. package/dist/chunk-t358gywy.js +991 -0
  258. package/dist/chunk-t358gywy.js.map +34 -0
  259. package/dist/chunk-t72dvahb.js +167 -0
  260. package/dist/chunk-t72dvahb.js.map +12 -0
  261. package/dist/chunk-tsk2bxs3.js +1254 -0
  262. package/dist/chunk-tsk2bxs3.js.map +17 -0
  263. package/dist/chunk-v5c085yp.js +49 -0
  264. package/dist/chunk-v5c085yp.js.map +10 -0
  265. package/dist/chunk-vj723r3p.js +146 -0
  266. package/dist/chunk-vj723r3p.js.map +12 -0
  267. package/dist/chunk-wj01s5hr.js +363 -0
  268. package/dist/chunk-wj01s5hr.js.map +11 -0
  269. package/dist/chunk-wxhdnwh4.js +37 -0
  270. package/dist/chunk-wxhdnwh4.js.map +10 -0
  271. package/dist/chunk-xqbtf4wn.js +170 -0
  272. package/dist/chunk-xqbtf4wn.js.map +10 -0
  273. package/dist/chunk-xwnf87e1.js +324 -0
  274. package/dist/chunk-xwnf87e1.js.map +13 -0
  275. package/dist/chunk-xz5g49bp.js +239 -0
  276. package/dist/chunk-xz5g49bp.js.map +11 -0
  277. package/dist/chunk-y64skrwp.js +19 -0
  278. package/dist/chunk-y64skrwp.js.map +9 -0
  279. package/dist/chunk-ya6brh8a.js +136 -0
  280. package/dist/chunk-ya6brh8a.js.map +11 -0
  281. package/dist/chunk-yt8wphsx.js +12 -0
  282. package/dist/chunk-yt8wphsx.js.map +10 -0
  283. package/dist/chunk-yvef9xwc.js +3842 -0
  284. package/dist/chunk-yvef9xwc.js.map +44 -0
  285. package/dist/chunk-yxss87qa.js +821 -0
  286. package/dist/chunk-yxss87qa.js.map +14 -0
  287. package/dist/connectors/builders.d.ts +10 -0
  288. package/dist/connectors/builders.d.ts.map +1 -0
  289. package/dist/connectors/errors.d.ts +14 -0
  290. package/dist/connectors/errors.d.ts.map +1 -0
  291. package/dist/connectors/index.d.ts +5 -0
  292. package/dist/connectors/index.d.ts.map +1 -0
  293. package/dist/connectors/runtime.d.ts +13 -0
  294. package/dist/connectors/runtime.d.ts.map +1 -0
  295. package/dist/connectors/types.d.ts +39 -0
  296. package/dist/connectors/types.d.ts.map +1 -0
  297. package/dist/datasets/builders.d.ts +54 -0
  298. package/dist/datasets/builders.d.ts.map +1 -0
  299. package/dist/datasets/errors.d.ts +4 -0
  300. package/dist/datasets/errors.d.ts.map +1 -0
  301. package/dist/datasets/index.d.ts +5 -0
  302. package/dist/datasets/index.d.ts.map +1 -0
  303. package/dist/datasets/types.d.ts +23 -0
  304. package/dist/datasets/types.d.ts.map +1 -0
  305. package/dist/datasets/validation.d.ts +8 -0
  306. package/dist/datasets/validation.d.ts.map +1 -0
  307. package/dist/edits/errors.d.ts +4 -0
  308. package/dist/edits/errors.d.ts.map +1 -0
  309. package/dist/edits/index.d.ts +4 -0
  310. package/dist/edits/index.d.ts.map +1 -0
  311. package/dist/edits/index.js +14 -0
  312. package/dist/edits/index.js.map +9 -0
  313. package/dist/edits/normalize.d.ts +14 -0
  314. package/dist/edits/normalize.d.ts.map +1 -0
  315. package/dist/edits/properties.d.ts +25 -0
  316. package/dist/edits/properties.d.ts.map +1 -0
  317. package/dist/edits/recorder.d.ts +4 -0
  318. package/dist/edits/recorder.d.ts.map +1 -0
  319. package/dist/edits/types.d.ts +159 -0
  320. package/dist/edits/types.d.ts.map +1 -0
  321. package/dist/error-reporting/capability.d.ts +57 -0
  322. package/dist/error-reporting/capability.d.ts.map +1 -0
  323. package/dist/error-reporting/internal.d.ts +4 -0
  324. package/dist/error-reporting/internal.d.ts.map +1 -0
  325. package/dist/error-reporting/internal.js +24 -0
  326. package/dist/error-reporting/internal.js.map +9 -0
  327. package/dist/error-reporting/normalize.d.ts +3 -0
  328. package/dist/error-reporting/normalize.d.ts.map +1 -0
  329. package/dist/error-reporting/reporter.d.ts +10 -0
  330. package/dist/error-reporting/reporter.d.ts.map +1 -0
  331. package/dist/error-reporting/types.d.ts +112 -0
  332. package/dist/error-reporting/types.d.ts.map +1 -0
  333. package/dist/events/definitions.d.ts +76 -0
  334. package/dist/events/definitions.d.ts.map +1 -0
  335. package/dist/events/envelope.d.ts +56 -0
  336. package/dist/events/envelope.d.ts.map +1 -0
  337. package/dist/events/errors.d.ts +8 -0
  338. package/dist/events/errors.d.ts.map +1 -0
  339. package/dist/events/index.d.ts +11 -0
  340. package/dist/events/index.d.ts.map +1 -0
  341. package/dist/events/index.js +68 -0
  342. package/dist/events/index.js.map +9 -0
  343. package/dist/events/outbox-dispatcher.d.ts +82 -0
  344. package/dist/events/outbox-dispatcher.d.ts.map +1 -0
  345. package/dist/events/property-changes.d.ts +16 -0
  346. package/dist/events/property-changes.d.ts.map +1 -0
  347. package/dist/events/runtime.d.ts +87 -0
  348. package/dist/events/runtime.d.ts.map +1 -0
  349. package/dist/events/scope.d.ts +25 -0
  350. package/dist/events/scope.d.ts.map +1 -0
  351. package/dist/events/scope.js +10 -0
  352. package/dist/events/scope.js.map +9 -0
  353. package/dist/events/selectors/builder.d.ts +64 -0
  354. package/dist/events/selectors/builder.d.ts.map +1 -0
  355. package/dist/events/selectors/index.d.ts +5 -0
  356. package/dist/events/selectors/index.d.ts.map +1 -0
  357. package/dist/events/selectors/index.js +15 -0
  358. package/dist/events/selectors/index.js.map +9 -0
  359. package/dist/events/selectors/predicate.d.ts +5 -0
  360. package/dist/events/selectors/predicate.d.ts.map +1 -0
  361. package/dist/events/selectors/types.d.ts +141 -0
  362. package/dist/events/selectors/types.d.ts.map +1 -0
  363. package/dist/events/toStoredEvent.d.ts +10 -0
  364. package/dist/events/toStoredEvent.d.ts.map +1 -0
  365. package/dist/events/types/actions.d.ts +39 -0
  366. package/dist/events/types/actions.d.ts.map +1 -0
  367. package/dist/events/types/datasets.d.ts +20 -0
  368. package/dist/events/types/datasets.d.ts.map +1 -0
  369. package/dist/events/types/index.d.ts +137 -0
  370. package/dist/events/types/index.d.ts.map +1 -0
  371. package/dist/events/types/links.d.ts +37 -0
  372. package/dist/events/types/links.d.ts.map +1 -0
  373. package/dist/events/types/objects.d.ts +33 -0
  374. package/dist/events/types/objects.d.ts.map +1 -0
  375. package/dist/events/types/pipelines.d.ts +59 -0
  376. package/dist/events/types/pipelines.d.ts.map +1 -0
  377. package/dist/events/types/rules.d.ts +28 -0
  378. package/dist/events/types/rules.d.ts.map +1 -0
  379. package/dist/events/types/schedules.d.ts +14 -0
  380. package/dist/events/types/schedules.d.ts.map +1 -0
  381. package/dist/events/types/syncs.d.ts +25 -0
  382. package/dist/events/types/syncs.d.ts.map +1 -0
  383. package/dist/events/types/telemetry.d.ts +17 -0
  384. package/dist/events/types/telemetry.d.ts.map +1 -0
  385. package/dist/events/types/workflows.d.ts +150 -0
  386. package/dist/events/types/workflows.d.ts.map +1 -0
  387. package/dist/http/api-routes.d.ts +24 -0
  388. package/dist/http/api-routes.d.ts.map +1 -0
  389. package/dist/http/index.d.ts +4 -0
  390. package/dist/http/index.d.ts.map +1 -0
  391. package/dist/http/index.js +16 -0
  392. package/dist/http/index.js.map +9 -0
  393. package/dist/http/route-pattern.d.ts +14 -0
  394. package/dist/http/route-pattern.d.ts.map +1 -0
  395. package/dist/index.d.ts +70 -0
  396. package/dist/index.d.ts.map +1 -0
  397. package/dist/index.js +430 -0
  398. package/dist/index.js.map +9 -0
  399. package/dist/json.d.ts +14 -0
  400. package/dist/json.d.ts.map +1 -0
  401. package/dist/lake-storage/definition-updates.d.ts +40 -0
  402. package/dist/lake-storage/definition-updates.d.ts.map +1 -0
  403. package/dist/lake-storage/errors.d.ts +7 -0
  404. package/dist/lake-storage/errors.d.ts.map +1 -0
  405. package/dist/lake-storage/in-memory.d.ts +25 -0
  406. package/dist/lake-storage/in-memory.d.ts.map +1 -0
  407. package/dist/lake-storage/index.d.ts +9 -0
  408. package/dist/lake-storage/index.d.ts.map +1 -0
  409. package/dist/lake-storage/index.js +24 -0
  410. package/dist/lake-storage/index.js.map +9 -0
  411. package/dist/lake-storage/sql-transforms.d.ts +45 -0
  412. package/dist/lake-storage/sql-transforms.d.ts.map +1 -0
  413. package/dist/lake-storage/types.d.ts +114 -0
  414. package/dist/lake-storage/types.d.ts.map +1 -0
  415. package/dist/logging/console-logger.d.ts +17 -0
  416. package/dist/logging/console-logger.d.ts.map +1 -0
  417. package/dist/logging/index.d.ts +5 -0
  418. package/dist/logging/index.d.ts.map +1 -0
  419. package/dist/logging/index.js +45 -0
  420. package/dist/logging/index.js.map +9 -0
  421. package/dist/logging/record.d.ts +10 -0
  422. package/dist/logging/record.d.ts.map +1 -0
  423. package/dist/logging/run-logger.d.ts +61 -0
  424. package/dist/logging/run-logger.d.ts.map +1 -0
  425. package/dist/logging/runtime.d.ts +87 -0
  426. package/dist/logging/runtime.d.ts.map +1 -0
  427. package/dist/logging/stream.d.ts +24 -0
  428. package/dist/logging/stream.d.ts.map +1 -0
  429. package/dist/logging/types.d.ts +82 -0
  430. package/dist/logging/types.d.ts.map +1 -0
  431. package/dist/logging/types.js +27 -0
  432. package/dist/logging/types.js.map +9 -0
  433. package/dist/maintenance/index.d.ts +3 -0
  434. package/dist/maintenance/index.d.ts.map +1 -0
  435. package/dist/maintenance/ontology-maintenance.d.ts +48 -0
  436. package/dist/maintenance/ontology-maintenance.d.ts.map +1 -0
  437. package/dist/maintenance/types.d.ts +53 -0
  438. package/dist/maintenance/types.d.ts.map +1 -0
  439. package/dist/materialization/dataset-watermark.d.ts +5 -0
  440. package/dist/materialization/dataset-watermark.d.ts.map +1 -0
  441. package/dist/materialization/errors.d.ts +37 -0
  442. package/dist/materialization/errors.d.ts.map +1 -0
  443. package/dist/materialization/events.d.ts +57 -0
  444. package/dist/materialization/events.d.ts.map +1 -0
  445. package/dist/materialization/identity.d.ts +8 -0
  446. package/dist/materialization/identity.d.ts.map +1 -0
  447. package/dist/materialization/index.d.ts +13 -0
  448. package/dist/materialization/index.d.ts.map +1 -0
  449. package/dist/materialization/index.js +56 -0
  450. package/dist/materialization/index.js.map +9 -0
  451. package/dist/materialization/model.d.ts +342 -0
  452. package/dist/materialization/model.d.ts.map +1 -0
  453. package/dist/materialization/refs.d.ts +24 -0
  454. package/dist/materialization/refs.d.ts.map +1 -0
  455. package/dist/materializer/context.d.ts +34 -0
  456. package/dist/materializer/context.d.ts.map +1 -0
  457. package/dist/materializer/edits/apply.d.ts +35 -0
  458. package/dist/materializer/edits/apply.d.ts.map +1 -0
  459. package/dist/materializer/edits/commit.d.ts +4 -0
  460. package/dist/materializer/edits/commit.d.ts.map +1 -0
  461. package/dist/materializer/edits/execution-units.d.ts +14 -0
  462. package/dist/materializer/edits/execution-units.d.ts.map +1 -0
  463. package/dist/materializer/edits/load-state.d.ts +6 -0
  464. package/dist/materializer/edits/load-state.d.ts.map +1 -0
  465. package/dist/materializer/edits/operations.d.ts +32 -0
  466. package/dist/materializer/edits/operations.d.ts.map +1 -0
  467. package/dist/materializer/edits/plan.d.ts +18 -0
  468. package/dist/materializer/edits/plan.d.ts.map +1 -0
  469. package/dist/materializer/edits/read-set.d.ts +8 -0
  470. package/dist/materializer/edits/read-set.d.ts.map +1 -0
  471. package/dist/materializer/edits/working-state.d.ts +30 -0
  472. package/dist/materializer/edits/working-state.d.ts.map +1 -0
  473. package/dist/materializer/effective/build-events.d.ts +26 -0
  474. package/dist/materializer/effective/build-events.d.ts.map +1 -0
  475. package/dist/materializer/effective/diff.d.ts +15 -0
  476. package/dist/materializer/effective/diff.d.ts.map +1 -0
  477. package/dist/materializer/effective/load-state.d.ts +7 -0
  478. package/dist/materializer/effective/load-state.d.ts.map +1 -0
  479. package/dist/materializer/effective/resolve.d.ts +26 -0
  480. package/dist/materializer/effective/resolve.d.ts.map +1 -0
  481. package/dist/materializer/effective/validate.d.ts +11 -0
  482. package/dist/materializer/effective/validate.d.ts.map +1 -0
  483. package/dist/materializer/execution/commit-lifecycle.d.ts +8 -0
  484. package/dist/materializer/execution/commit-lifecycle.d.ts.map +1 -0
  485. package/dist/materializer/execution/plan-stream.d.ts +8 -0
  486. package/dist/materializer/execution/plan-stream.d.ts.map +1 -0
  487. package/dist/materializer/execution/run-correlation.d.ts +19 -0
  488. package/dist/materializer/execution/run-correlation.d.ts.map +1 -0
  489. package/dist/materializer/execution/work-executor.d.ts +13 -0
  490. package/dist/materializer/execution/work-executor.d.ts.map +1 -0
  491. package/dist/materializer/execution/work-records.d.ts +15 -0
  492. package/dist/materializer/execution/work-records.d.ts.map +1 -0
  493. package/dist/materializer/index.d.ts +15 -0
  494. package/dist/materializer/index.d.ts.map +1 -0
  495. package/dist/materializer/index.js +134 -0
  496. package/dist/materializer/index.js.map +9 -0
  497. package/dist/materializer/materializer.d.ts +27 -0
  498. package/dist/materializer/materializer.d.ts.map +1 -0
  499. package/dist/materializer/projections/entry-validator.d.ts +8 -0
  500. package/dist/materializer/projections/entry-validator.d.ts.map +1 -0
  501. package/dist/materializer/projections/finish-run.d.ts +4 -0
  502. package/dist/materializer/projections/finish-run.d.ts.map +1 -0
  503. package/dist/materializer/projections/replace.d.ts +4 -0
  504. package/dist/materializer/projections/replace.d.ts.map +1 -0
  505. package/dist/materializer/projections/replacement-plan.d.ts +14 -0
  506. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -0
  507. package/dist/materializer/projections/source-materialization.d.ts +27 -0
  508. package/dist/materializer/projections/source-materialization.d.ts.map +1 -0
  509. package/dist/materializer/shared/abort.d.ts +2 -0
  510. package/dist/materializer/shared/abort.d.ts.map +1 -0
  511. package/dist/materializer/shared/batching.d.ts +11 -0
  512. package/dist/materializer/shared/batching.d.ts.map +1 -0
  513. package/dist/materializer/shared/chunking.d.ts +6 -0
  514. package/dist/materializer/shared/chunking.d.ts.map +1 -0
  515. package/dist/materializer/shared/identity.d.ts +38 -0
  516. package/dist/materializer/shared/identity.d.ts.map +1 -0
  517. package/dist/materializer/shared/normalize.d.ts +10 -0
  518. package/dist/materializer/shared/normalize.d.ts.map +1 -0
  519. package/dist/materializer/shared/projection-run.d.ts +19 -0
  520. package/dist/materializer/shared/projection-run.d.ts.map +1 -0
  521. package/dist/materializer/telemetry/append.d.ts +4 -0
  522. package/dist/materializer/telemetry/append.d.ts.map +1 -0
  523. package/dist/materializer/telemetry/plan.d.ts +12 -0
  524. package/dist/materializer/telemetry/plan.d.ts.map +1 -0
  525. package/dist/objects/action/errors.d.ts +39 -0
  526. package/dist/objects/action/errors.d.ts.map +1 -0
  527. package/dist/objects/action/index.d.ts +4 -0
  528. package/dist/objects/action/index.d.ts.map +1 -0
  529. package/dist/objects/action/request.d.ts +23 -0
  530. package/dist/objects/action/request.d.ts.map +1 -0
  531. package/dist/objects/context/index.d.ts +3 -0
  532. package/dist/objects/context/index.d.ts.map +1 -0
  533. package/dist/objects/context/resolve.d.ts +27 -0
  534. package/dist/objects/context/resolve.d.ts.map +1 -0
  535. package/dist/objects/context/types.d.ts +28 -0
  536. package/dist/objects/context/types.d.ts.map +1 -0
  537. package/dist/objects/contexts.d.ts +45 -0
  538. package/dist/objects/contexts.d.ts.map +1 -0
  539. package/dist/objects/errors.d.ts +8 -0
  540. package/dist/objects/errors.d.ts.map +1 -0
  541. package/dist/objects/helpers.d.ts +7 -0
  542. package/dist/objects/helpers.d.ts.map +1 -0
  543. package/dist/objects/index.d.ts +18 -0
  544. package/dist/objects/index.d.ts.map +1 -0
  545. package/dist/objects/index.js +71 -0
  546. package/dist/objects/index.js.map +9 -0
  547. package/dist/objects/link/authorization.d.ts +25 -0
  548. package/dist/objects/link/authorization.d.ts.map +1 -0
  549. package/dist/objects/link/endpoints.d.ts +28 -0
  550. package/dist/objects/link/endpoints.d.ts.map +1 -0
  551. package/dist/objects/link/index.d.ts +4 -0
  552. package/dist/objects/link/index.d.ts.map +1 -0
  553. package/dist/objects/link/remove.d.ts +8 -0
  554. package/dist/objects/link/remove.d.ts.map +1 -0
  555. package/dist/objects/link/upsert-batch.d.ts +11 -0
  556. package/dist/objects/link/upsert-batch.d.ts.map +1 -0
  557. package/dist/objects/link/upsert.d.ts +12 -0
  558. package/dist/objects/link/upsert.d.ts.map +1 -0
  559. package/dist/objects/materializer-adapter.d.ts +114 -0
  560. package/dist/objects/materializer-adapter.d.ts.map +1 -0
  561. package/dist/objects/object/delete.d.ts +17 -0
  562. package/dist/objects/object/delete.d.ts.map +1 -0
  563. package/dist/objects/object/index.d.ts +4 -0
  564. package/dist/objects/object/index.d.ts.map +1 -0
  565. package/dist/objects/object/upsert-batch.d.ts +7 -0
  566. package/dist/objects/object/upsert-batch.d.ts.map +1 -0
  567. package/dist/objects/object/upsert.d.ts +7 -0
  568. package/dist/objects/object/upsert.d.ts.map +1 -0
  569. package/dist/objects/query/errors.d.ts +23 -0
  570. package/dist/objects/query/errors.d.ts.map +1 -0
  571. package/dist/objects/query/executor.d.ts +63 -0
  572. package/dist/objects/query/executor.d.ts.map +1 -0
  573. package/dist/objects/query/explain-format.d.ts +10 -0
  574. package/dist/objects/query/explain-format.d.ts.map +1 -0
  575. package/dist/objects/query/explain.d.ts +26 -0
  576. package/dist/objects/query/explain.d.ts.map +1 -0
  577. package/dist/objects/query/index.d.ts +14 -0
  578. package/dist/objects/query/index.d.ts.map +1 -0
  579. package/dist/objects/query/index.js +54 -0
  580. package/dist/objects/query/index.js.map +9 -0
  581. package/dist/objects/query/ir.d.ts +166 -0
  582. package/dist/objects/query/ir.d.ts.map +1 -0
  583. package/dist/objects/query/normalize.d.ts +12 -0
  584. package/dist/objects/query/normalize.d.ts.map +1 -0
  585. package/dist/objects/query/planner.d.ts +32 -0
  586. package/dist/objects/query/planner.d.ts.map +1 -0
  587. package/dist/objects/query/scalar-values.d.ts +6 -0
  588. package/dist/objects/query/scalar-values.d.ts.map +1 -0
  589. package/dist/objects/query/validate.d.ts +23 -0
  590. package/dist/objects/query/validate.d.ts.map +1 -0
  591. package/dist/objects/runtime-batch.d.ts +29 -0
  592. package/dist/objects/runtime-batch.d.ts.map +1 -0
  593. package/dist/objects/sdk/index.d.ts +3 -0
  594. package/dist/objects/sdk/index.d.ts.map +1 -0
  595. package/dist/objects/sdk/object-handle.d.ts +6 -0
  596. package/dist/objects/sdk/object-handle.d.ts.map +1 -0
  597. package/dist/objects/sdk/object-set.d.ts +14 -0
  598. package/dist/objects/sdk/object-set.d.ts.map +1 -0
  599. package/dist/objects/sdk/query-builder.d.ts +20 -0
  600. package/dist/objects/sdk/query-builder.d.ts.map +1 -0
  601. package/dist/objects/sdk/query-executor.d.ts +51 -0
  602. package/dist/objects/sdk/query-executor.d.ts.map +1 -0
  603. package/dist/objects/sdk/runtime-query-executor.d.ts +16 -0
  604. package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -0
  605. package/dist/objects/sdk/telemetry-channel.d.ts +6 -0
  606. package/dist/objects/sdk/telemetry-channel.d.ts.map +1 -0
  607. package/dist/objects/sdk/where.d.ts +15 -0
  608. package/dist/objects/sdk/where.d.ts.map +1 -0
  609. package/dist/objects/service/action-service.d.ts +12 -0
  610. package/dist/objects/service/action-service.d.ts.map +1 -0
  611. package/dist/objects/service/index.d.ts +7 -0
  612. package/dist/objects/service/index.d.ts.map +1 -0
  613. package/dist/objects/service/link-service.d.ts +26 -0
  614. package/dist/objects/service/link-service.d.ts.map +1 -0
  615. package/dist/objects/service/list-service.d.ts +24 -0
  616. package/dist/objects/service/list-service.d.ts.map +1 -0
  617. package/dist/objects/service/object-service.d.ts +12 -0
  618. package/dist/objects/service/object-service.d.ts.map +1 -0
  619. package/dist/objects/service/telemetry-service.d.ts +12 -0
  620. package/dist/objects/service/telemetry-service.d.ts.map +1 -0
  621. package/dist/objects/telemetry/append-batch.d.ts +10 -0
  622. package/dist/objects/telemetry/append-batch.d.ts.map +1 -0
  623. package/dist/objects/telemetry/history.d.ts +8 -0
  624. package/dist/objects/telemetry/history.d.ts.map +1 -0
  625. package/dist/objects/telemetry/index.d.ts +5 -0
  626. package/dist/objects/telemetry/index.d.ts.map +1 -0
  627. package/dist/objects/telemetry/write-batch.d.ts +8 -0
  628. package/dist/objects/telemetry/write-batch.d.ts.map +1 -0
  629. package/dist/ontology/builders.d.ts +323 -0
  630. package/dist/ontology/builders.d.ts.map +1 -0
  631. package/dist/ontology/decimal.d.ts +28 -0
  632. package/dist/ontology/decimal.d.ts.map +1 -0
  633. package/dist/ontology/errors.d.ts +20 -0
  634. package/dist/ontology/errors.d.ts.map +1 -0
  635. package/dist/ontology/index.d.ts +23 -0
  636. package/dist/ontology/index.d.ts.map +1 -0
  637. package/dist/ontology/index.js +120 -0
  638. package/dist/ontology/index.js.map +9 -0
  639. package/dist/ontology/inference/index.d.ts +112 -0
  640. package/dist/ontology/inference/index.d.ts.map +1 -0
  641. package/dist/ontology/internal.d.ts +4 -0
  642. package/dist/ontology/internal.d.ts.map +1 -0
  643. package/dist/ontology/internal.js +118 -0
  644. package/dist/ontology/internal.js.map +10 -0
  645. package/dist/ontology/json-schema.d.ts +9 -0
  646. package/dist/ontology/json-schema.d.ts.map +1 -0
  647. package/dist/ontology/refs.d.ts +16 -0
  648. package/dist/ontology/refs.d.ts.map +1 -0
  649. package/dist/ontology/registry.d.ts +82 -0
  650. package/dist/ontology/registry.d.ts.map +1 -0
  651. package/dist/ontology/tokens.d.ts +54 -0
  652. package/dist/ontology/tokens.d.ts.map +1 -0
  653. package/dist/ontology/types.d.ts +402 -0
  654. package/dist/ontology/types.d.ts.map +1 -0
  655. package/dist/ontology/units/index.d.ts +74 -0
  656. package/dist/ontology/units/index.d.ts.map +1 -0
  657. package/dist/ontology/units/quantitative-types.d.ts +1605 -0
  658. package/dist/ontology/units/quantitative-types.d.ts.map +1 -0
  659. package/dist/ontology/units/types.d.ts +26 -0
  660. package/dist/ontology/units/types.d.ts.map +1 -0
  661. package/dist/ontology/validation/index.d.ts +7 -0
  662. package/dist/ontology/validation/index.d.ts.map +1 -0
  663. package/dist/ontology/validation/links.d.ts +18 -0
  664. package/dist/ontology/validation/links.d.ts.map +1 -0
  665. package/dist/ontology/validation/normalize.d.ts +21 -0
  666. package/dist/ontology/validation/normalize.d.ts.map +1 -0
  667. package/dist/ontology/validation/properties.d.ts +19 -0
  668. package/dist/ontology/validation/properties.d.ts.map +1 -0
  669. package/dist/ontology/validation/query.d.ts +3 -0
  670. package/dist/ontology/validation/query.d.ts.map +1 -0
  671. package/dist/ontology/validation/schema.d.ts +7 -0
  672. package/dist/ontology/validation/schema.d.ts.map +1 -0
  673. package/dist/ontology/validation/telemetry.d.ts +7 -0
  674. package/dist/ontology/validation/telemetry.d.ts.map +1 -0
  675. package/dist/pipelines/builders.d.ts +14 -0
  676. package/dist/pipelines/builders.d.ts.map +1 -0
  677. package/dist/pipelines/errors.d.ts +4 -0
  678. package/dist/pipelines/errors.d.ts.map +1 -0
  679. package/dist/pipelines/index.d.ts +7 -0
  680. package/dist/pipelines/index.d.ts.map +1 -0
  681. package/dist/pipelines/request.d.ts +31 -0
  682. package/dist/pipelines/request.d.ts.map +1 -0
  683. package/dist/pipelines/types.d.ts +84 -0
  684. package/dist/pipelines/types.d.ts.map +1 -0
  685. package/dist/predicates/builders.d.ts +24 -0
  686. package/dist/predicates/builders.d.ts.map +1 -0
  687. package/dist/predicates/evaluate.d.ts +8 -0
  688. package/dist/predicates/evaluate.d.ts.map +1 -0
  689. package/dist/predicates/index.d.ts +5 -0
  690. package/dist/predicates/index.d.ts.map +1 -0
  691. package/dist/predicates/types.d.ts +69 -0
  692. package/dist/predicates/types.d.ts.map +1 -0
  693. package/dist/predicates/validation.d.ts +15 -0
  694. package/dist/predicates/validation.d.ts.map +1 -0
  695. package/dist/projections/builders.d.ts +212 -0
  696. package/dist/projections/builders.d.ts.map +1 -0
  697. package/dist/projections/errors.d.ts +4 -0
  698. package/dist/projections/errors.d.ts.map +1 -0
  699. package/dist/projections/index.d.ts +5 -0
  700. package/dist/projections/index.d.ts.map +1 -0
  701. package/dist/projections/internal.d.ts +24 -0
  702. package/dist/projections/internal.d.ts.map +1 -0
  703. package/dist/projections/internal.js +26 -0
  704. package/dist/projections/internal.js.map +9 -0
  705. package/dist/projections/ownership.d.ts +9 -0
  706. package/dist/projections/ownership.d.ts.map +1 -0
  707. package/dist/projections/registry.d.ts +30 -0
  708. package/dist/projections/registry.d.ts.map +1 -0
  709. package/dist/projections/revision.d.ts +7 -0
  710. package/dist/projections/revision.d.ts.map +1 -0
  711. package/dist/projections/types.d.ts +153 -0
  712. package/dist/projections/types.d.ts.map +1 -0
  713. package/dist/projections/validation.d.ts +97 -0
  714. package/dist/projections/validation.d.ts.map +1 -0
  715. package/dist/provider-scope.d.ts +12 -0
  716. package/dist/provider-scope.d.ts.map +1 -0
  717. package/dist/query.d.ts +17 -0
  718. package/dist/query.d.ts.map +1 -0
  719. package/dist/query.js +21 -0
  720. package/dist/query.js.map +9 -0
  721. package/dist/queues/errors.d.ts +7 -0
  722. package/dist/queues/errors.d.ts.map +1 -0
  723. package/dist/queues/in-memory.d.ts +73 -0
  724. package/dist/queues/in-memory.d.ts.map +1 -0
  725. package/dist/queues/index.d.ts +5 -0
  726. package/dist/queues/index.d.ts.map +1 -0
  727. package/dist/queues/index.js +12 -0
  728. package/dist/queues/index.js.map +9 -0
  729. package/dist/queues/types.d.ts +182 -0
  730. package/dist/queues/types.d.ts.map +1 -0
  731. package/dist/rules/builders.d.ts +10 -0
  732. package/dist/rules/builders.d.ts.map +1 -0
  733. package/dist/rules/dependencies.d.ts +9 -0
  734. package/dist/rules/dependencies.d.ts.map +1 -0
  735. package/dist/rules/errors.d.ts +11 -0
  736. package/dist/rules/errors.d.ts.map +1 -0
  737. package/dist/rules/index.d.ts +6 -0
  738. package/dist/rules/index.d.ts.map +1 -0
  739. package/dist/rules/internal.d.ts +9 -0
  740. package/dist/rules/internal.d.ts.map +1 -0
  741. package/dist/rules/internal.js +10 -0
  742. package/dist/rules/internal.js.map +9 -0
  743. package/dist/rules/types.d.ts +72 -0
  744. package/dist/rules/types.d.ts.map +1 -0
  745. package/dist/rules/validation.d.ts +23 -0
  746. package/dist/rules/validation.d.ts.map +1 -0
  747. package/dist/runtime/create.d.ts +68 -0
  748. package/dist/runtime/create.d.ts.map +1 -0
  749. package/dist/runtime/errors.d.ts +9 -0
  750. package/dist/runtime/errors.d.ts.map +1 -0
  751. package/dist/runtime/index.d.ts +26 -0
  752. package/dist/runtime/index.d.ts.map +1 -0
  753. package/dist/runtime/internal.d.ts +3 -0
  754. package/dist/runtime/internal.d.ts.map +1 -0
  755. package/dist/runtime/internal.js +16 -0
  756. package/dist/runtime/internal.js.map +9 -0
  757. package/dist/runtime/ontology-mutations.d.ts +16 -0
  758. package/dist/runtime/ontology-mutations.d.ts.map +1 -0
  759. package/dist/runtime/scoped.d.ts +158 -0
  760. package/dist/runtime/scoped.d.ts.map +1 -0
  761. package/dist/runtime/sixb.d.ts +226 -0
  762. package/dist/runtime/sixb.d.ts.map +1 -0
  763. package/dist/runtime/storage-readiness.d.ts +20 -0
  764. package/dist/runtime/storage-readiness.d.ts.map +1 -0
  765. package/dist/runtime/types.d.ts +840 -0
  766. package/dist/runtime/types.d.ts.map +1 -0
  767. package/dist/sandboxes/errors.d.ts +20 -0
  768. package/dist/sandboxes/errors.d.ts.map +1 -0
  769. package/dist/sandboxes/exec.d.ts +17 -0
  770. package/dist/sandboxes/exec.d.ts.map +1 -0
  771. package/dist/sandboxes/index.d.ts +5 -0
  772. package/dist/sandboxes/index.d.ts.map +1 -0
  773. package/dist/sandboxes/index.js +18 -0
  774. package/dist/sandboxes/index.js.map +9 -0
  775. package/dist/sandboxes/sandbox.d.ts +110 -0
  776. package/dist/sandboxes/sandbox.d.ts.map +1 -0
  777. package/dist/scheduler/errors.d.ts +7 -0
  778. package/dist/scheduler/errors.d.ts.map +1 -0
  779. package/dist/scheduler/index.d.ts +4 -0
  780. package/dist/scheduler/index.d.ts.map +1 -0
  781. package/dist/scheduler/index.js +18 -0
  782. package/dist/scheduler/index.js.map +9 -0
  783. package/dist/scheduler/runtime.d.ts +32 -0
  784. package/dist/scheduler/runtime.d.ts.map +1 -0
  785. package/dist/schedules/builders.d.ts +4 -0
  786. package/dist/schedules/builders.d.ts.map +1 -0
  787. package/dist/schedules/cron.d.ts +14 -0
  788. package/dist/schedules/cron.d.ts.map +1 -0
  789. package/dist/schedules/errors.d.ts +7 -0
  790. package/dist/schedules/errors.d.ts.map +1 -0
  791. package/dist/schedules/index.d.ts +12 -0
  792. package/dist/schedules/index.d.ts.map +1 -0
  793. package/dist/schedules/index.js +37 -0
  794. package/dist/schedules/index.js.map +9 -0
  795. package/dist/schedules/next-occurrence.d.ts +11 -0
  796. package/dist/schedules/next-occurrence.d.ts.map +1 -0
  797. package/dist/schedules/runtime.d.ts +17 -0
  798. package/dist/schedules/runtime.d.ts.map +1 -0
  799. package/dist/schedules/types.d.ts +99 -0
  800. package/dist/schedules/types.d.ts.map +1 -0
  801. package/dist/schedules/validation.d.ts +13 -0
  802. package/dist/schedules/validation.d.ts.map +1 -0
  803. package/dist/security/applications.d.ts +15 -0
  804. package/dist/security/applications.d.ts.map +1 -0
  805. package/dist/security/builders.d.ts +20 -0
  806. package/dist/security/builders.d.ts.map +1 -0
  807. package/dist/security/errors.d.ts +4 -0
  808. package/dist/security/errors.d.ts.map +1 -0
  809. package/dist/security/every.d.ts +68 -0
  810. package/dist/security/every.d.ts.map +1 -0
  811. package/dist/security/grants.d.ts +40 -0
  812. package/dist/security/grants.d.ts.map +1 -0
  813. package/dist/security/index.d.ts +12 -0
  814. package/dist/security/index.d.ts.map +1 -0
  815. package/dist/security/membership-policies.d.ts +17 -0
  816. package/dist/security/membership-policies.d.ts.map +1 -0
  817. package/dist/security/runtime.d.ts +16 -0
  818. package/dist/security/runtime.d.ts.map +1 -0
  819. package/dist/security/types.d.ts +133 -0
  820. package/dist/security/types.d.ts.map +1 -0
  821. package/dist/security/validation.d.ts +36 -0
  822. package/dist/security/validation.d.ts.map +1 -0
  823. package/dist/storage/action-runs/errors.d.ts +10 -0
  824. package/dist/storage/action-runs/errors.d.ts.map +1 -0
  825. package/dist/storage/action-runs/idempotency.d.ts +10 -0
  826. package/dist/storage/action-runs/idempotency.d.ts.map +1 -0
  827. package/dist/storage/action-runs/in-memory.d.ts +28 -0
  828. package/dist/storage/action-runs/in-memory.d.ts.map +1 -0
  829. package/dist/storage/action-runs/index.d.ts +6 -0
  830. package/dist/storage/action-runs/index.d.ts.map +1 -0
  831. package/dist/storage/action-runs/types.d.ts +138 -0
  832. package/dist/storage/action-runs/types.d.ts.map +1 -0
  833. package/dist/storage/agents/errors.d.ts +11 -0
  834. package/dist/storage/agents/errors.d.ts.map +1 -0
  835. package/dist/storage/agents/in-memory.d.ts +70 -0
  836. package/dist/storage/agents/in-memory.d.ts.map +1 -0
  837. package/dist/storage/agents/index.d.ts +7 -0
  838. package/dist/storage/agents/index.d.ts.map +1 -0
  839. package/dist/storage/agents/types.d.ts +295 -0
  840. package/dist/storage/agents/types.d.ts.map +1 -0
  841. package/dist/storage/auth/errors.d.ts +10 -0
  842. package/dist/storage/auth/errors.d.ts.map +1 -0
  843. package/dist/storage/auth/in-memory/access-tokens.d.ts +32 -0
  844. package/dist/storage/auth/in-memory/access-tokens.d.ts.map +1 -0
  845. package/dist/storage/auth/in-memory/auth-storage.d.ts +36 -0
  846. package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -0
  847. package/dist/storage/auth/in-memory/group-memberships.d.ts +21 -0
  848. package/dist/storage/auth/in-memory/group-memberships.d.ts.map +1 -0
  849. package/dist/storage/auth/in-memory/identities.d.ts +17 -0
  850. package/dist/storage/auth/in-memory/identities.d.ts.map +1 -0
  851. package/dist/storage/auth/in-memory/index.d.ts +2 -0
  852. package/dist/storage/auth/in-memory/index.d.ts.map +1 -0
  853. package/dist/storage/auth/in-memory/invitations.d.ts +28 -0
  854. package/dist/storage/auth/in-memory/invitations.d.ts.map +1 -0
  855. package/dist/storage/auth/in-memory/magic-links.d.ts +28 -0
  856. package/dist/storage/auth/in-memory/magic-links.d.ts.map +1 -0
  857. package/dist/storage/auth/in-memory/oidc-attempts.d.ts +18 -0
  858. package/dist/storage/auth/in-memory/oidc-attempts.d.ts.map +1 -0
  859. package/dist/storage/auth/in-memory/service-account-group-memberships.d.ts +17 -0
  860. package/dist/storage/auth/in-memory/service-account-group-memberships.d.ts.map +1 -0
  861. package/dist/storage/auth/in-memory/service-accounts.d.ts +14 -0
  862. package/dist/storage/auth/in-memory/service-accounts.d.ts.map +1 -0
  863. package/dist/storage/auth/in-memory/sessions.d.ts +55 -0
  864. package/dist/storage/auth/in-memory/sessions.d.ts.map +1 -0
  865. package/dist/storage/auth/in-memory/shared.d.ts +71 -0
  866. package/dist/storage/auth/in-memory/shared.d.ts.map +1 -0
  867. package/dist/storage/auth/in-memory/users.d.ts +19 -0
  868. package/dist/storage/auth/in-memory/users.d.ts.map +1 -0
  869. package/dist/storage/auth/in-memory.d.ts +2 -0
  870. package/dist/storage/auth/in-memory.d.ts.map +1 -0
  871. package/dist/storage/auth/index.d.ts +5 -0
  872. package/dist/storage/auth/index.d.ts.map +1 -0
  873. package/dist/storage/auth/types.d.ts +584 -0
  874. package/dist/storage/auth/types.d.ts.map +1 -0
  875. package/dist/storage/errors.d.ts +27 -0
  876. package/dist/storage/errors.d.ts.map +1 -0
  877. package/dist/storage/file-upload-sessions/errors.d.ts +15 -0
  878. package/dist/storage/file-upload-sessions/errors.d.ts.map +1 -0
  879. package/dist/storage/file-upload-sessions/in-memory.d.ts +27 -0
  880. package/dist/storage/file-upload-sessions/in-memory.d.ts.map +1 -0
  881. package/dist/storage/file-upload-sessions/index.d.ts +6 -0
  882. package/dist/storage/file-upload-sessions/index.d.ts.map +1 -0
  883. package/dist/storage/file-upload-sessions/types.d.ts +53 -0
  884. package/dist/storage/file-upload-sessions/types.d.ts.map +1 -0
  885. package/dist/storage/file-upload-sessions/utils.d.ts +11 -0
  886. package/dist/storage/file-upload-sessions/utils.d.ts.map +1 -0
  887. package/dist/storage/in-memory/index.d.ts +105 -0
  888. package/dist/storage/in-memory/index.d.ts.map +1 -0
  889. package/dist/storage/in-memory/testing.d.ts +8 -0
  890. package/dist/storage/in-memory/testing.d.ts.map +1 -0
  891. package/dist/storage/index.d.ts +44 -0
  892. package/dist/storage/index.d.ts.map +1 -0
  893. package/dist/storage/index.js +144 -0
  894. package/dist/storage/index.js.map +9 -0
  895. package/dist/storage/migrations/check-schema.d.ts +19 -0
  896. package/dist/storage/migrations/check-schema.d.ts.map +1 -0
  897. package/dist/storage/migrations/index.d.ts +5 -0
  898. package/dist/storage/migrations/index.d.ts.map +1 -0
  899. package/dist/storage/migrations/migrate-storage.d.ts +6 -0
  900. package/dist/storage/migrations/migrate-storage.d.ts.map +1 -0
  901. package/dist/storage/migrations/migration-set.d.ts +27 -0
  902. package/dist/storage/migrations/migration-set.d.ts.map +1 -0
  903. package/dist/storage/migrations/types.d.ts +115 -0
  904. package/dist/storage/migrations/types.d.ts.map +1 -0
  905. package/dist/storage/objects/in-memory.d.ts +126 -0
  906. package/dist/storage/objects/in-memory.d.ts.map +1 -0
  907. package/dist/storage/objects/index.d.ts +2 -0
  908. package/dist/storage/objects/index.d.ts.map +1 -0
  909. package/dist/storage/objects/types.d.ts +222 -0
  910. package/dist/storage/objects/types.d.ts.map +1 -0
  911. package/dist/storage/ontology/commits.d.ts +117 -0
  912. package/dist/storage/ontology/commits.d.ts.map +1 -0
  913. package/dist/storage/ontology/in-memory/commits.d.ts +12 -0
  914. package/dist/storage/ontology/in-memory/commits.d.ts.map +1 -0
  915. package/dist/storage/ontology/in-memory/index.d.ts +36 -0
  916. package/dist/storage/ontology/in-memory/index.d.ts.map +1 -0
  917. package/dist/storage/ontology/in-memory/materializations-finalization.d.ts +5 -0
  918. package/dist/storage/ontology/in-memory/materializations-finalization.d.ts.map +1 -0
  919. package/dist/storage/ontology/in-memory/materializations-state.d.ts +20 -0
  920. package/dist/storage/ontology/in-memory/materializations-state.d.ts.map +1 -0
  921. package/dist/storage/ontology/in-memory/materializations-work.d.ts +6 -0
  922. package/dist/storage/ontology/in-memory/materializations-work.d.ts.map +1 -0
  923. package/dist/storage/ontology/in-memory/materializations.d.ts +101 -0
  924. package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -0
  925. package/dist/storage/ontology/in-memory/outbox.d.ts +19 -0
  926. package/dist/storage/ontology/in-memory/outbox.d.ts.map +1 -0
  927. package/dist/storage/ontology/in-memory/shared-state.d.ts +48 -0
  928. package/dist/storage/ontology/in-memory/shared-state.d.ts.map +1 -0
  929. package/dist/storage/ontology/in-memory/sources.d.ts +23 -0
  930. package/dist/storage/ontology/in-memory/sources.d.ts.map +1 -0
  931. package/dist/storage/ontology/in-memory/testing.d.ts +11 -0
  932. package/dist/storage/ontology/in-memory/testing.d.ts.map +1 -0
  933. package/dist/storage/ontology/index.d.ts +16 -0
  934. package/dist/storage/ontology/index.d.ts.map +1 -0
  935. package/dist/storage/ontology/materializations.d.ts +333 -0
  936. package/dist/storage/ontology/materializations.d.ts.map +1 -0
  937. package/dist/storage/ontology/outbox.d.ts +66 -0
  938. package/dist/storage/ontology/outbox.d.ts.map +1 -0
  939. package/dist/storage/ontology/provider-header-validation.d.ts +4 -0
  940. package/dist/storage/ontology/provider-header-validation.d.ts.map +1 -0
  941. package/dist/storage/ontology/provider-validation.d.ts +6 -0
  942. package/dist/storage/ontology/provider-validation.d.ts.map +1 -0
  943. package/dist/storage/ontology/provider-work.d.ts +12 -0
  944. package/dist/storage/ontology/provider-work.d.ts.map +1 -0
  945. package/dist/storage/ontology/provider.d.ts +191 -0
  946. package/dist/storage/ontology/provider.d.ts.map +1 -0
  947. package/dist/storage/ontology/provider.js +115 -0
  948. package/dist/storage/ontology/provider.js.map +9 -0
  949. package/dist/storage/ontology/sources.d.ts +151 -0
  950. package/dist/storage/ontology/sources.d.ts.map +1 -0
  951. package/dist/storage/operation-scope.d.ts +32 -0
  952. package/dist/storage/operation-scope.d.ts.map +1 -0
  953. package/dist/storage/operation-scope.js +22 -0
  954. package/dist/storage/operation-scope.js.map +9 -0
  955. package/dist/storage/pagination.d.ts +11 -0
  956. package/dist/storage/pagination.d.ts.map +1 -0
  957. package/dist/storage/pipeline-runs/errors.d.ts +7 -0
  958. package/dist/storage/pipeline-runs/errors.d.ts.map +1 -0
  959. package/dist/storage/pipeline-runs/in-memory.d.ts +26 -0
  960. package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -0
  961. package/dist/storage/pipeline-runs/index.d.ts +4 -0
  962. package/dist/storage/pipeline-runs/index.d.ts.map +1 -0
  963. package/dist/storage/pipeline-runs/types.d.ts +133 -0
  964. package/dist/storage/pipeline-runs/types.d.ts.map +1 -0
  965. package/dist/storage/projection-runs/errors.d.ts +9 -0
  966. package/dist/storage/projection-runs/errors.d.ts.map +1 -0
  967. package/dist/storage/projection-runs/in-memory.d.ts +42 -0
  968. package/dist/storage/projection-runs/in-memory.d.ts.map +1 -0
  969. package/dist/storage/projection-runs/index.d.ts +5 -0
  970. package/dist/storage/projection-runs/index.d.ts.map +1 -0
  971. package/dist/storage/projection-runs/lifecycle.d.ts +93 -0
  972. package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -0
  973. package/dist/storage/projection-runs/lifecycle.js +64 -0
  974. package/dist/storage/projection-runs/lifecycle.js.map +9 -0
  975. package/dist/storage/projection-runs/types.d.ts +175 -0
  976. package/dist/storage/projection-runs/types.d.ts.map +1 -0
  977. package/dist/storage/rules/in-memory.d.ts +26 -0
  978. package/dist/storage/rules/in-memory.d.ts.map +1 -0
  979. package/dist/storage/rules/index.d.ts +3 -0
  980. package/dist/storage/rules/index.d.ts.map +1 -0
  981. package/dist/storage/rules/types.d.ts +60 -0
  982. package/dist/storage/rules/types.d.ts.map +1 -0
  983. package/dist/storage/run-listing.d.ts +36 -0
  984. package/dist/storage/run-listing.d.ts.map +1 -0
  985. package/dist/storage/sync-runs/errors.d.ts +8 -0
  986. package/dist/storage/sync-runs/errors.d.ts.map +1 -0
  987. package/dist/storage/sync-runs/in-memory.d.ts +16 -0
  988. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -0
  989. package/dist/storage/sync-runs/index.d.ts +4 -0
  990. package/dist/storage/sync-runs/index.d.ts.map +1 -0
  991. package/dist/storage/sync-runs/types.d.ts +85 -0
  992. package/dist/storage/sync-runs/types.d.ts.map +1 -0
  993. package/dist/storage/timeseries/index.d.ts +2 -0
  994. package/dist/storage/timeseries/index.d.ts.map +1 -0
  995. package/dist/storage/timeseries/store.d.ts +46 -0
  996. package/dist/storage/timeseries/store.d.ts.map +1 -0
  997. package/dist/storage/timeseries/types.d.ts +50 -0
  998. package/dist/storage/timeseries/types.d.ts.map +1 -0
  999. package/dist/storage/transaction.d.ts +4 -0
  1000. package/dist/storage/transaction.d.ts.map +1 -0
  1001. package/dist/storage/types.d.ts +78 -0
  1002. package/dist/storage/types.d.ts.map +1 -0
  1003. package/dist/storage/webhook-deliveries/in-memory.d.ts +18 -0
  1004. package/dist/storage/webhook-deliveries/in-memory.d.ts.map +1 -0
  1005. package/dist/storage/webhook-deliveries/index.d.ts +3 -0
  1006. package/dist/storage/webhook-deliveries/index.d.ts.map +1 -0
  1007. package/dist/storage/webhook-deliveries/types.d.ts +43 -0
  1008. package/dist/storage/webhook-deliveries/types.d.ts.map +1 -0
  1009. package/dist/storage/webhook-runs/errors.d.ts +7 -0
  1010. package/dist/storage/webhook-runs/errors.d.ts.map +1 -0
  1011. package/dist/storage/webhook-runs/in-memory.d.ts +16 -0
  1012. package/dist/storage/webhook-runs/in-memory.d.ts.map +1 -0
  1013. package/dist/storage/webhook-runs/index.d.ts +4 -0
  1014. package/dist/storage/webhook-runs/index.d.ts.map +1 -0
  1015. package/dist/storage/webhook-runs/types.d.ts +66 -0
  1016. package/dist/storage/webhook-runs/types.d.ts.map +1 -0
  1017. package/dist/storage/workflow-interventions/errors.d.ts +7 -0
  1018. package/dist/storage/workflow-interventions/errors.d.ts.map +1 -0
  1019. package/dist/storage/workflow-interventions/in-memory.d.ts +18 -0
  1020. package/dist/storage/workflow-interventions/in-memory.d.ts.map +1 -0
  1021. package/dist/storage/workflow-interventions/index.d.ts +4 -0
  1022. package/dist/storage/workflow-interventions/index.d.ts.map +1 -0
  1023. package/dist/storage/workflow-interventions/types.d.ts +94 -0
  1024. package/dist/storage/workflow-interventions/types.d.ts.map +1 -0
  1025. package/dist/storage/workflow-runs/errors.d.ts +7 -0
  1026. package/dist/storage/workflow-runs/errors.d.ts.map +1 -0
  1027. package/dist/storage/workflow-runs/in-memory.d.ts +83 -0
  1028. package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -0
  1029. package/dist/storage/workflow-runs/index.d.ts +4 -0
  1030. package/dist/storage/workflow-runs/index.d.ts.map +1 -0
  1031. package/dist/storage/workflow-runs/types.d.ts +305 -0
  1032. package/dist/storage/workflow-runs/types.d.ts.map +1 -0
  1033. package/dist/syncs/builders.d.ts +9 -0
  1034. package/dist/syncs/builders.d.ts.map +1 -0
  1035. package/dist/syncs/errors.d.ts +4 -0
  1036. package/dist/syncs/errors.d.ts.map +1 -0
  1037. package/dist/syncs/index.d.ts +7 -0
  1038. package/dist/syncs/index.d.ts.map +1 -0
  1039. package/dist/syncs/request.d.ts +41 -0
  1040. package/dist/syncs/request.d.ts.map +1 -0
  1041. package/dist/syncs/types.d.ts +76 -0
  1042. package/dist/syncs/types.d.ts.map +1 -0
  1043. package/dist/testing/agent-storage-contract.d.ts +16 -0
  1044. package/dist/testing/agent-storage-contract.d.ts.map +1 -0
  1045. package/dist/testing/auth-storage-contract.d.ts +16 -0
  1046. package/dist/testing/auth-storage-contract.d.ts.map +1 -0
  1047. package/dist/testing/blob-storage-contract.d.ts +10 -0
  1048. package/dist/testing/blob-storage-contract.d.ts.map +1 -0
  1049. package/dist/testing/broker-contract.d.ts +39 -0
  1050. package/dist/testing/broker-contract.d.ts.map +1 -0
  1051. package/dist/testing/effective-storage-contract.d.ts +7 -0
  1052. package/dist/testing/effective-storage-contract.d.ts.map +1 -0
  1053. package/dist/testing/index.d.ts +15 -0
  1054. package/dist/testing/index.d.ts.map +1 -0
  1055. package/dist/testing/index.js +7000 -0
  1056. package/dist/testing/index.js.map +24 -0
  1057. package/dist/testing/lake-storage-contract.d.ts +29 -0
  1058. package/dist/testing/lake-storage-contract.d.ts.map +1 -0
  1059. package/dist/testing/materialization-failure-contract.d.ts +26 -0
  1060. package/dist/testing/materialization-failure-contract.d.ts.map +1 -0
  1061. package/dist/testing/materializer-fixture.d.ts +35 -0
  1062. package/dist/testing/materializer-fixture.d.ts.map +1 -0
  1063. package/dist/testing/materializer-storage-contract.d.ts +7 -0
  1064. package/dist/testing/materializer-storage-contract.d.ts.map +1 -0
  1065. package/dist/testing/object-query-contract.d.ts +21 -0
  1066. package/dist/testing/object-query-contract.d.ts.map +1 -0
  1067. package/dist/testing/ontology-contract-fixture.d.ts +33 -0
  1068. package/dist/testing/ontology-contract-fixture.d.ts.map +1 -0
  1069. package/dist/testing/ontology-storage-contract.d.ts +21 -0
  1070. package/dist/testing/ontology-storage-contract.d.ts.map +1 -0
  1071. package/dist/testing/projection-run-storage-contract.d.ts +10 -0
  1072. package/dist/testing/projection-run-storage-contract.d.ts.map +1 -0
  1073. package/dist/testing/queues-contract.d.ts +31 -0
  1074. package/dist/testing/queues-contract.d.ts.map +1 -0
  1075. package/dist/testing/sandboxes-contract.d.ts +31 -0
  1076. package/dist/testing/sandboxes-contract.d.ts.map +1 -0
  1077. package/dist/tsconfig.json +5 -0
  1078. package/dist/webhooks/builders.d.ts +41 -0
  1079. package/dist/webhooks/builders.d.ts.map +1 -0
  1080. package/dist/webhooks/connector.d.ts +10 -0
  1081. package/dist/webhooks/connector.d.ts.map +1 -0
  1082. package/dist/webhooks/errors.d.ts +4 -0
  1083. package/dist/webhooks/errors.d.ts.map +1 -0
  1084. package/dist/webhooks/index.d.ts +9 -0
  1085. package/dist/webhooks/index.d.ts.map +1 -0
  1086. package/dist/webhooks/registry.d.ts +7 -0
  1087. package/dist/webhooks/registry.d.ts.map +1 -0
  1088. package/dist/webhooks/types.d.ts +79 -0
  1089. package/dist/webhooks/types.d.ts.map +1 -0
  1090. package/dist/webhooks/unverified.d.ts +57 -0
  1091. package/dist/webhooks/unverified.d.ts.map +1 -0
  1092. package/dist/workers/errors.d.ts +17 -0
  1093. package/dist/workers/errors.d.ts.map +1 -0
  1094. package/dist/workers/index.d.ts +7 -0
  1095. package/dist/workers/index.d.ts.map +1 -0
  1096. package/dist/workers/index.js +506 -0
  1097. package/dist/workers/index.js.map +13 -0
  1098. package/dist/workers/queue-delivery.d.ts +38 -0
  1099. package/dist/workers/queue-delivery.d.ts.map +1 -0
  1100. package/dist/workers/queue-worker.d.ts +30 -0
  1101. package/dist/workers/queue-worker.d.ts.map +1 -0
  1102. package/dist/workers/worker.d.ts +14 -0
  1103. package/dist/workers/worker.d.ts.map +1 -0
  1104. package/dist/workflows/builders.d.ts +27 -0
  1105. package/dist/workflows/builders.d.ts.map +1 -0
  1106. package/dist/workflows/errors.d.ts +11 -0
  1107. package/dist/workflows/errors.d.ts.map +1 -0
  1108. package/dist/workflows/index.d.ts +9 -0
  1109. package/dist/workflows/index.d.ts.map +1 -0
  1110. package/dist/workflows/index.js +108 -0
  1111. package/dist/workflows/index.js.map +9 -0
  1112. package/dist/workflows/request.d.ts +29 -0
  1113. package/dist/workflows/request.d.ts.map +1 -0
  1114. package/dist/workflows/runtime.d.ts +33 -0
  1115. package/dist/workflows/runtime.d.ts.map +1 -0
  1116. package/dist/workflows/snapshot.d.ts +55 -0
  1117. package/dist/workflows/snapshot.d.ts.map +1 -0
  1118. package/dist/workflows/types.d.ts +288 -0
  1119. package/dist/workflows/types.d.ts.map +1 -0
  1120. package/dist/workflows/validation.d.ts +66 -0
  1121. package/dist/workflows/validation.d.ts.map +1 -0
  1122. package/package.json +312 -0
  1123. package/src/actions/builders/define-action.ts +243 -0
  1124. package/src/actions/builders/params.ts +48 -0
  1125. package/src/actions/builders.ts +2 -0
  1126. package/src/actions/commit-edits.ts +110 -0
  1127. package/src/actions/errors.ts +15 -0
  1128. package/src/actions/index.ts +75 -0
  1129. package/src/actions/read-facade.ts +224 -0
  1130. package/src/actions/registry.ts +135 -0
  1131. package/src/actions/request.ts +407 -0
  1132. package/src/actions/run-id.ts +17 -0
  1133. package/src/actions/runtime.ts +31 -0
  1134. package/src/actions/types/context.ts +224 -0
  1135. package/src/actions/types/definitions.ts +181 -0
  1136. package/src/actions/types/handlers.ts +68 -0
  1137. package/src/actions/types/params.ts +82 -0
  1138. package/src/actions/types.ts +4 -0
  1139. package/src/actions/validation.ts +186 -0
  1140. package/src/actions/validators.ts +56 -0
  1141. package/src/actions/worker.ts +2 -0
  1142. package/src/agents/adapters.ts +647 -0
  1143. package/src/agents/api-gateway.ts +57 -0
  1144. package/src/agents/builders.ts +46 -0
  1145. package/src/agents/context-model.ts +41 -0
  1146. package/src/agents/context-resolution.ts +43 -0
  1147. package/src/agents/context.ts +185 -0
  1148. package/src/agents/dispatch.ts +107 -0
  1149. package/src/agents/errors.ts +40 -0
  1150. package/src/agents/ids.ts +24 -0
  1151. package/src/agents/index.ts +122 -0
  1152. package/src/agents/message.ts +91 -0
  1153. package/src/agents/prompt.ts +45 -0
  1154. package/src/agents/request.ts +198 -0
  1155. package/src/agents/runtime.ts +124 -0
  1156. package/src/agents/streams.ts +194 -0
  1157. package/src/agents/types.ts +70 -0
  1158. package/src/agents/validation.ts +151 -0
  1159. package/src/auth/access-tokens.ts +125 -0
  1160. package/src/auth/audience.ts +28 -0
  1161. package/src/auth/cookies.ts +263 -0
  1162. package/src/auth/csrf.ts +41 -0
  1163. package/src/auth/errors.ts +19 -0
  1164. package/src/auth/index.ts +149 -0
  1165. package/src/auth/runtime.ts +1642 -0
  1166. package/src/auth/session-cache.ts +112 -0
  1167. package/src/auth/sessions.ts +55 -0
  1168. package/src/auth/strategy.ts +46 -0
  1169. package/src/auth/types.ts +573 -0
  1170. package/src/auth/validation.ts +241 -0
  1171. package/src/authorization/application-access.ts +34 -0
  1172. package/src/authorization/decision.ts +215 -0
  1173. package/src/authorization/errors.ts +12 -0
  1174. package/src/authorization/event-visibility.ts +99 -0
  1175. package/src/authorization/grant-kinds.ts +149 -0
  1176. package/src/authorization/index.ts +24 -0
  1177. package/src/authorization/resolve.ts +101 -0
  1178. package/src/authorization/run-visibility.ts +78 -0
  1179. package/src/authorization/types.ts +52 -0
  1180. package/src/blob-storage/browser.ts +28 -0
  1181. package/src/blob-storage/constants.ts +9 -0
  1182. package/src/blob-storage/derive.ts +13 -0
  1183. package/src/blob-storage/errors.ts +6 -0
  1184. package/src/blob-storage/in-memory.ts +74 -0
  1185. package/src/blob-storage/index.ts +37 -0
  1186. package/src/blob-storage/types.ts +143 -0
  1187. package/src/blob-storage/utils.ts +126 -0
  1188. package/src/blob-storage/validation.ts +58 -0
  1189. package/src/bootstrap/discovery.ts +507 -0
  1190. package/src/bootstrap/index.ts +26 -0
  1191. package/src/bootstrap/ontology-type-manifest.ts +316 -0
  1192. package/src/broker/errors.ts +15 -0
  1193. package/src/broker/in-memory.ts +511 -0
  1194. package/src/broker/index.ts +12 -0
  1195. package/src/broker/types.ts +129 -0
  1196. package/src/connectors/builders.ts +33 -0
  1197. package/src/connectors/errors.ts +15 -0
  1198. package/src/connectors/index.ts +9 -0
  1199. package/src/connectors/runtime.ts +100 -0
  1200. package/src/connectors/types.ts +64 -0
  1201. package/src/datasets/builders.ts +233 -0
  1202. package/src/datasets/errors.ts +3 -0
  1203. package/src/datasets/index.ts +13 -0
  1204. package/src/datasets/types.ts +52 -0
  1205. package/src/datasets/validation.ts +251 -0
  1206. package/src/edits/errors.ts +6 -0
  1207. package/src/edits/index.ts +24 -0
  1208. package/src/edits/normalize.ts +87 -0
  1209. package/src/edits/properties.ts +153 -0
  1210. package/src/edits/recorder.ts +312 -0
  1211. package/src/edits/types.ts +275 -0
  1212. package/src/error-reporting/capability.ts +160 -0
  1213. package/src/error-reporting/internal.ts +13 -0
  1214. package/src/error-reporting/normalize.ts +35 -0
  1215. package/src/error-reporting/reporter.ts +65 -0
  1216. package/src/error-reporting/types.ts +125 -0
  1217. package/src/events/definitions.ts +241 -0
  1218. package/src/events/envelope.ts +68 -0
  1219. package/src/events/errors.ts +7 -0
  1220. package/src/events/index.ts +167 -0
  1221. package/src/events/outbox-dispatcher.ts +534 -0
  1222. package/src/events/property-changes.ts +9 -0
  1223. package/src/events/runtime.ts +401 -0
  1224. package/src/events/scope.ts +71 -0
  1225. package/src/events/selectors/builder.ts +531 -0
  1226. package/src/events/selectors/index.ts +42 -0
  1227. package/src/events/selectors/predicate.ts +91 -0
  1228. package/src/events/selectors/types.ts +258 -0
  1229. package/src/events/toStoredEvent.ts +35 -0
  1230. package/src/events/types/actions.ts +42 -0
  1231. package/src/events/types/datasets.ts +21 -0
  1232. package/src/events/types/index.ts +206 -0
  1233. package/src/events/types/links.ts +42 -0
  1234. package/src/events/types/objects.ts +38 -0
  1235. package/src/events/types/pipelines.ts +67 -0
  1236. package/src/events/types/rules.ts +31 -0
  1237. package/src/events/types/schedules.ts +15 -0
  1238. package/src/events/types/syncs.ts +27 -0
  1239. package/src/events/types/telemetry.ts +19 -0
  1240. package/src/events/types/workflows.ts +172 -0
  1241. package/src/http/api-routes.ts +384 -0
  1242. package/src/http/index.ts +3 -0
  1243. package/src/http/route-pattern.ts +37 -0
  1244. package/src/index.ts +916 -0
  1245. package/src/json.ts +137 -0
  1246. package/src/lake-storage/definition-updates.ts +263 -0
  1247. package/src/lake-storage/errors.ts +6 -0
  1248. package/src/lake-storage/in-memory.ts +348 -0
  1249. package/src/lake-storage/index.ts +48 -0
  1250. package/src/lake-storage/sql-transforms.ts +67 -0
  1251. package/src/lake-storage/types.ts +135 -0
  1252. package/src/logging/console-logger.ts +63 -0
  1253. package/src/logging/index.ts +43 -0
  1254. package/src/logging/record.ts +126 -0
  1255. package/src/logging/run-logger.ts +350 -0
  1256. package/src/logging/runtime.ts +341 -0
  1257. package/src/logging/stream.ts +38 -0
  1258. package/src/logging/types.ts +156 -0
  1259. package/src/maintenance/index.ts +9 -0
  1260. package/src/maintenance/ontology-maintenance.ts +351 -0
  1261. package/src/maintenance/types.ts +57 -0
  1262. package/src/materialization/dataset-watermark.ts +52 -0
  1263. package/src/materialization/errors.ts +73 -0
  1264. package/src/materialization/events.ts +92 -0
  1265. package/src/materialization/identity.ts +36 -0
  1266. package/src/materialization/index.ts +75 -0
  1267. package/src/materialization/model.ts +394 -0
  1268. package/src/materialization/refs.ts +134 -0
  1269. package/src/materializer/README.md +130 -0
  1270. package/src/materializer/context.ts +75 -0
  1271. package/src/materializer/edits/apply.ts +241 -0
  1272. package/src/materializer/edits/commit.ts +311 -0
  1273. package/src/materializer/edits/execution-units.ts +32 -0
  1274. package/src/materializer/edits/load-state.ts +148 -0
  1275. package/src/materializer/edits/operations.ts +298 -0
  1276. package/src/materializer/edits/plan.ts +192 -0
  1277. package/src/materializer/edits/read-set.ts +79 -0
  1278. package/src/materializer/edits/working-state.ts +171 -0
  1279. package/src/materializer/effective/build-events.ts +197 -0
  1280. package/src/materializer/effective/diff.ts +169 -0
  1281. package/src/materializer/effective/load-state.ts +75 -0
  1282. package/src/materializer/effective/resolve.ts +96 -0
  1283. package/src/materializer/effective/validate.ts +180 -0
  1284. package/src/materializer/execution/commit-lifecycle.ts +57 -0
  1285. package/src/materializer/execution/plan-stream.ts +97 -0
  1286. package/src/materializer/execution/run-correlation.ts +73 -0
  1287. package/src/materializer/execution/work-executor.ts +143 -0
  1288. package/src/materializer/execution/work-records.ts +186 -0
  1289. package/src/materializer/index.ts +109 -0
  1290. package/src/materializer/materializer.ts +64 -0
  1291. package/src/materializer/projections/entry-validator.ts +162 -0
  1292. package/src/materializer/projections/finish-run.ts +194 -0
  1293. package/src/materializer/projections/replace.ts +447 -0
  1294. package/src/materializer/projections/replacement-plan.ts +376 -0
  1295. package/src/materializer/projections/source-materialization.ts +99 -0
  1296. package/src/materializer/shared/abort.ts +7 -0
  1297. package/src/materializer/shared/batching.ts +32 -0
  1298. package/src/materializer/shared/chunking.ts +27 -0
  1299. package/src/materializer/shared/identity.ts +141 -0
  1300. package/src/materializer/shared/normalize.ts +527 -0
  1301. package/src/materializer/shared/projection-run.ts +61 -0
  1302. package/src/materializer/telemetry/append.ts +503 -0
  1303. package/src/materializer/telemetry/plan.ts +363 -0
  1304. package/src/objects/action/errors.ts +56 -0
  1305. package/src/objects/action/index.ts +3 -0
  1306. package/src/objects/action/request.ts +63 -0
  1307. package/src/objects/context/index.ts +6 -0
  1308. package/src/objects/context/resolve.ts +51 -0
  1309. package/src/objects/context/types.ts +31 -0
  1310. package/src/objects/contexts.ts +64 -0
  1311. package/src/objects/errors.ts +7 -0
  1312. package/src/objects/helpers.ts +18 -0
  1313. package/src/objects/index.ts +26 -0
  1314. package/src/objects/link/authorization.ts +26 -0
  1315. package/src/objects/link/endpoints.ts +66 -0
  1316. package/src/objects/link/index.ts +3 -0
  1317. package/src/objects/link/remove.ts +42 -0
  1318. package/src/objects/link/upsert-batch.ts +80 -0
  1319. package/src/objects/link/upsert.ts +56 -0
  1320. package/src/objects/materializer-adapter.ts +307 -0
  1321. package/src/objects/object/delete.ts +47 -0
  1322. package/src/objects/object/index.ts +3 -0
  1323. package/src/objects/object/upsert-batch.ts +57 -0
  1324. package/src/objects/object/upsert.ts +38 -0
  1325. package/src/objects/query/errors.ts +55 -0
  1326. package/src/objects/query/executor.ts +1345 -0
  1327. package/src/objects/query/explain-format.ts +34 -0
  1328. package/src/objects/query/explain.ts +215 -0
  1329. package/src/objects/query/index.ts +77 -0
  1330. package/src/objects/query/ir.ts +211 -0
  1331. package/src/objects/query/normalize.ts +245 -0
  1332. package/src/objects/query/planner.ts +538 -0
  1333. package/src/objects/query/scalar-values.ts +100 -0
  1334. package/src/objects/query/validate.ts +1276 -0
  1335. package/src/objects/runtime-batch.ts +105 -0
  1336. package/src/objects/sdk/index.ts +2 -0
  1337. package/src/objects/sdk/object-handle.ts +139 -0
  1338. package/src/objects/sdk/object-set.ts +224 -0
  1339. package/src/objects/sdk/query-builder.ts +386 -0
  1340. package/src/objects/sdk/query-executor.ts +62 -0
  1341. package/src/objects/sdk/runtime-query-executor.ts +88 -0
  1342. package/src/objects/sdk/telemetry-channel.ts +81 -0
  1343. package/src/objects/sdk/where.ts +87 -0
  1344. package/src/objects/service/action-service.ts +40 -0
  1345. package/src/objects/service/index.ts +6 -0
  1346. package/src/objects/service/link-service.ts +74 -0
  1347. package/src/objects/service/list-service.ts +89 -0
  1348. package/src/objects/service/object-service.ts +28 -0
  1349. package/src/objects/service/telemetry-service.ts +17 -0
  1350. package/src/objects/telemetry/append-batch.ts +74 -0
  1351. package/src/objects/telemetry/history.ts +32 -0
  1352. package/src/objects/telemetry/index.ts +4 -0
  1353. package/src/objects/telemetry/write-batch.ts +52 -0
  1354. package/src/ontology/builders.ts +695 -0
  1355. package/src/ontology/decimal.ts +120 -0
  1356. package/src/ontology/errors.ts +25 -0
  1357. package/src/ontology/index.ts +80 -0
  1358. package/src/ontology/inference/index.ts +215 -0
  1359. package/src/ontology/internal.ts +3 -0
  1360. package/src/ontology/json-schema.ts +123 -0
  1361. package/src/ontology/refs.ts +80 -0
  1362. package/src/ontology/registry.ts +417 -0
  1363. package/src/ontology/tokens.ts +113 -0
  1364. package/src/ontology/types.ts +436 -0
  1365. package/src/ontology/units/index.ts +115 -0
  1366. package/src/ontology/units/quantitative-types.ts +608 -0
  1367. package/src/ontology/units/types.ts +27 -0
  1368. package/src/ontology/validation/index.ts +36 -0
  1369. package/src/ontology/validation/links.ts +126 -0
  1370. package/src/ontology/validation/normalize.ts +215 -0
  1371. package/src/ontology/validation/properties.ts +235 -0
  1372. package/src/ontology/validation/query.ts +300 -0
  1373. package/src/ontology/validation/schema.ts +174 -0
  1374. package/src/ontology/validation/telemetry.ts +53 -0
  1375. package/src/pipelines/builders.ts +155 -0
  1376. package/src/pipelines/errors.ts +3 -0
  1377. package/src/pipelines/index.ts +26 -0
  1378. package/src/pipelines/request.ts +71 -0
  1379. package/src/pipelines/types.ts +199 -0
  1380. package/src/predicates/builders.ts +152 -0
  1381. package/src/predicates/evaluate.ts +107 -0
  1382. package/src/predicates/index.ts +28 -0
  1383. package/src/predicates/types.ts +124 -0
  1384. package/src/predicates/validation.ts +152 -0
  1385. package/src/projections/builders.ts +770 -0
  1386. package/src/projections/errors.ts +3 -0
  1387. package/src/projections/index.ts +32 -0
  1388. package/src/projections/internal.ts +75 -0
  1389. package/src/projections/ownership.ts +134 -0
  1390. package/src/projections/registry.ts +269 -0
  1391. package/src/projections/revision.ts +245 -0
  1392. package/src/projections/types.ts +165 -0
  1393. package/src/projections/validation.ts +531 -0
  1394. package/src/provider-scope.ts +11 -0
  1395. package/src/query.ts +75 -0
  1396. package/src/queues/errors.ts +6 -0
  1397. package/src/queues/in-memory.ts +364 -0
  1398. package/src/queues/index.ts +23 -0
  1399. package/src/queues/types.ts +230 -0
  1400. package/src/rules/builders.ts +126 -0
  1401. package/src/rules/dependencies.ts +76 -0
  1402. package/src/rules/errors.ts +11 -0
  1403. package/src/rules/index.ts +30 -0
  1404. package/src/rules/internal.ts +8 -0
  1405. package/src/rules/types.ts +113 -0
  1406. package/src/rules/validation.ts +153 -0
  1407. package/src/runtime/create.ts +163 -0
  1408. package/src/runtime/errors.ts +8 -0
  1409. package/src/runtime/index.ts +67 -0
  1410. package/src/runtime/internal.ts +7 -0
  1411. package/src/runtime/ontology-mutations.ts +90 -0
  1412. package/src/runtime/scoped.ts +436 -0
  1413. package/src/runtime/sixb.ts +822 -0
  1414. package/src/runtime/storage-readiness.ts +91 -0
  1415. package/src/runtime/types.ts +1401 -0
  1416. package/src/sandboxes/errors.ts +22 -0
  1417. package/src/sandboxes/exec.ts +102 -0
  1418. package/src/sandboxes/index.ts +19 -0
  1419. package/src/sandboxes/sandbox.ts +124 -0
  1420. package/src/scheduler/errors.ts +7 -0
  1421. package/src/scheduler/index.ts +3 -0
  1422. package/src/scheduler/runtime.ts +174 -0
  1423. package/src/schedules/builders.ts +257 -0
  1424. package/src/schedules/cron.ts +166 -0
  1425. package/src/schedules/errors.ts +7 -0
  1426. package/src/schedules/index.ts +44 -0
  1427. package/src/schedules/next-occurrence.ts +217 -0
  1428. package/src/schedules/runtime.ts +241 -0
  1429. package/src/schedules/types.ts +212 -0
  1430. package/src/schedules/validation.ts +398 -0
  1431. package/src/security/applications.ts +11 -0
  1432. package/src/security/builders.ts +128 -0
  1433. package/src/security/errors.ts +3 -0
  1434. package/src/security/every.ts +108 -0
  1435. package/src/security/grants.ts +215 -0
  1436. package/src/security/index.ts +51 -0
  1437. package/src/security/membership-policies.ts +101 -0
  1438. package/src/security/runtime.ts +101 -0
  1439. package/src/security/types.ts +156 -0
  1440. package/src/security/validation.ts +430 -0
  1441. package/src/storage/action-runs/errors.ts +13 -0
  1442. package/src/storage/action-runs/idempotency.ts +68 -0
  1443. package/src/storage/action-runs/in-memory.ts +420 -0
  1444. package/src/storage/action-runs/index.ts +31 -0
  1445. package/src/storage/action-runs/types.ts +169 -0
  1446. package/src/storage/agents/errors.ts +22 -0
  1447. package/src/storage/agents/in-memory.ts +498 -0
  1448. package/src/storage/agents/index.ts +42 -0
  1449. package/src/storage/agents/types.ts +348 -0
  1450. package/src/storage/auth/errors.ts +40 -0
  1451. package/src/storage/auth/in-memory/access-tokens.ts +123 -0
  1452. package/src/storage/auth/in-memory/auth-storage.ts +559 -0
  1453. package/src/storage/auth/in-memory/group-memberships.ts +46 -0
  1454. package/src/storage/auth/in-memory/identities.ts +66 -0
  1455. package/src/storage/auth/in-memory/index.ts +1 -0
  1456. package/src/storage/auth/in-memory/invitations.ts +165 -0
  1457. package/src/storage/auth/in-memory/magic-links.ts +98 -0
  1458. package/src/storage/auth/in-memory/oidc-attempts.ts +75 -0
  1459. package/src/storage/auth/in-memory/service-account-group-memberships.ts +102 -0
  1460. package/src/storage/auth/in-memory/service-accounts.ts +80 -0
  1461. package/src/storage/auth/in-memory/sessions.ts +177 -0
  1462. package/src/storage/auth/in-memory/shared.ts +602 -0
  1463. package/src/storage/auth/in-memory/users.ts +139 -0
  1464. package/src/storage/auth/in-memory.ts +1 -0
  1465. package/src/storage/auth/index.ts +58 -0
  1466. package/src/storage/auth/types.ts +639 -0
  1467. package/src/storage/errors.ts +45 -0
  1468. package/src/storage/file-upload-sessions/errors.ts +24 -0
  1469. package/src/storage/file-upload-sessions/in-memory.ts +161 -0
  1470. package/src/storage/file-upload-sessions/index.ts +19 -0
  1471. package/src/storage/file-upload-sessions/types.ts +61 -0
  1472. package/src/storage/file-upload-sessions/utils.ts +49 -0
  1473. package/src/storage/in-memory/index.ts +297 -0
  1474. package/src/storage/in-memory/testing.ts +21 -0
  1475. package/src/storage/index.ts +489 -0
  1476. package/src/storage/migrations/check-schema.ts +49 -0
  1477. package/src/storage/migrations/index.ts +23 -0
  1478. package/src/storage/migrations/migrate-storage.ts +24 -0
  1479. package/src/storage/migrations/migration-set.ts +270 -0
  1480. package/src/storage/migrations/types.ts +129 -0
  1481. package/src/storage/objects/in-memory.ts +1154 -0
  1482. package/src/storage/objects/index.ts +24 -0
  1483. package/src/storage/objects/types.ts +244 -0
  1484. package/src/storage/ontology/commits.ts +132 -0
  1485. package/src/storage/ontology/in-memory/commits.ts +122 -0
  1486. package/src/storage/ontology/in-memory/index.ts +94 -0
  1487. package/src/storage/ontology/in-memory/materializations-finalization.ts +484 -0
  1488. package/src/storage/ontology/in-memory/materializations-state.ts +183 -0
  1489. package/src/storage/ontology/in-memory/materializations-work.ts +62 -0
  1490. package/src/storage/ontology/in-memory/materializations.ts +1192 -0
  1491. package/src/storage/ontology/in-memory/outbox.ts +227 -0
  1492. package/src/storage/ontology/in-memory/shared-state.ts +161 -0
  1493. package/src/storage/ontology/in-memory/sources.ts +566 -0
  1494. package/src/storage/ontology/in-memory/testing.ts +29 -0
  1495. package/src/storage/ontology/index.ts +119 -0
  1496. package/src/storage/ontology/materializations.ts +414 -0
  1497. package/src/storage/ontology/outbox.ts +79 -0
  1498. package/src/storage/ontology/provider-header-validation.ts +173 -0
  1499. package/src/storage/ontology/provider-validation.ts +36 -0
  1500. package/src/storage/ontology/provider-work.ts +330 -0
  1501. package/src/storage/ontology/provider.ts +852 -0
  1502. package/src/storage/ontology/sources.ts +195 -0
  1503. package/src/storage/operation-scope.ts +248 -0
  1504. package/src/storage/pagination.ts +23 -0
  1505. package/src/storage/pipeline-runs/errors.ts +6 -0
  1506. package/src/storage/pipeline-runs/in-memory.ts +307 -0
  1507. package/src/storage/pipeline-runs/index.ts +19 -0
  1508. package/src/storage/pipeline-runs/types.ts +148 -0
  1509. package/src/storage/projection-runs/errors.ts +15 -0
  1510. package/src/storage/projection-runs/in-memory.ts +321 -0
  1511. package/src/storage/projection-runs/index.ts +36 -0
  1512. package/src/storage/projection-runs/lifecycle.ts +793 -0
  1513. package/src/storage/projection-runs/types.ts +254 -0
  1514. package/src/storage/rules/in-memory.ts +191 -0
  1515. package/src/storage/rules/index.ts +12 -0
  1516. package/src/storage/rules/types.ts +80 -0
  1517. package/src/storage/run-listing.ts +107 -0
  1518. package/src/storage/sync-runs/errors.ts +7 -0
  1519. package/src/storage/sync-runs/in-memory.ts +181 -0
  1520. package/src/storage/sync-runs/index.ts +14 -0
  1521. package/src/storage/sync-runs/types.ts +93 -0
  1522. package/src/storage/timeseries/index.ts +7 -0
  1523. package/src/storage/timeseries/store.ts +214 -0
  1524. package/src/storage/timeseries/types.ts +57 -0
  1525. package/src/storage/transaction.ts +56 -0
  1526. package/src/storage/types.ts +299 -0
  1527. package/src/storage/webhook-deliveries/in-memory.ts +108 -0
  1528. package/src/storage/webhook-deliveries/index.ts +9 -0
  1529. package/src/storage/webhook-deliveries/types.ts +41 -0
  1530. package/src/storage/webhook-runs/errors.ts +6 -0
  1531. package/src/storage/webhook-runs/in-memory.ts +131 -0
  1532. package/src/storage/webhook-runs/index.ts +12 -0
  1533. package/src/storage/webhook-runs/types.ts +69 -0
  1534. package/src/storage/workflow-interventions/errors.ts +6 -0
  1535. package/src/storage/workflow-interventions/in-memory.ts +192 -0
  1536. package/src/storage/workflow-interventions/index.ts +14 -0
  1537. package/src/storage/workflow-interventions/types.ts +100 -0
  1538. package/src/storage/workflow-runs/errors.ts +6 -0
  1539. package/src/storage/workflow-runs/in-memory.ts +777 -0
  1540. package/src/storage/workflow-runs/index.ts +45 -0
  1541. package/src/storage/workflow-runs/types.ts +344 -0
  1542. package/src/syncs/builders.ts +101 -0
  1543. package/src/syncs/errors.ts +3 -0
  1544. package/src/syncs/index.ts +22 -0
  1545. package/src/syncs/request.ts +91 -0
  1546. package/src/syncs/types.ts +136 -0
  1547. package/src/testing/agent-storage-contract.ts +824 -0
  1548. package/src/testing/auth-storage-contract.ts +1932 -0
  1549. package/src/testing/blob-storage-contract.ts +108 -0
  1550. package/src/testing/broker-contract.ts +819 -0
  1551. package/src/testing/effective-storage-contract.ts +182 -0
  1552. package/src/testing/index.ts +65 -0
  1553. package/src/testing/lake-storage-contract.ts +699 -0
  1554. package/src/testing/materialization-failure-contract.ts +66 -0
  1555. package/src/testing/materializer-fixture.ts +119 -0
  1556. package/src/testing/materializer-storage-contract.ts +389 -0
  1557. package/src/testing/object-query-contract.ts +1205 -0
  1558. package/src/testing/ontology-contract-fixture.ts +192 -0
  1559. package/src/testing/ontology-storage-contract.ts +922 -0
  1560. package/src/testing/projection-run-storage-contract.ts +372 -0
  1561. package/src/testing/queues-contract.ts +634 -0
  1562. package/src/testing/sandboxes-contract.ts +404 -0
  1563. package/src/webhooks/builders.ts +154 -0
  1564. package/src/webhooks/connector.ts +19 -0
  1565. package/src/webhooks/errors.ts +3 -0
  1566. package/src/webhooks/index.ts +25 -0
  1567. package/src/webhooks/registry.ts +127 -0
  1568. package/src/webhooks/types.ts +98 -0
  1569. package/src/webhooks/unverified.ts +82 -0
  1570. package/src/workers/errors.ts +25 -0
  1571. package/src/workers/index.ts +6 -0
  1572. package/src/workers/queue-delivery.ts +309 -0
  1573. package/src/workers/queue-worker.ts +260 -0
  1574. package/src/workers/worker.ts +87 -0
  1575. package/src/workflows/builders.ts +471 -0
  1576. package/src/workflows/errors.ts +13 -0
  1577. package/src/workflows/index.ts +94 -0
  1578. package/src/workflows/request.ts +161 -0
  1579. package/src/workflows/runtime.ts +68 -0
  1580. package/src/workflows/snapshot.ts +383 -0
  1581. package/src/workflows/types.ts +781 -0
  1582. package/src/workflows/validation.ts +572 -0
@@ -0,0 +1,1276 @@
1
+ import type { ObjectType, OntologyRegistry, Property, Schema, ValueType } from "../../ontology"
2
+ import { normalizeDecimalValue } from "../../ontology"
3
+ import { formatUnknownObjectTypeMessage } from "../../ontology/errors"
4
+ import { validatePropertyValue, validateSchemaValue } from "../../ontology/validation"
5
+ import { ObjectQueryValidationError } from "./errors"
6
+ import type {
7
+ ObjectExpansion,
8
+ ObjectQuery,
9
+ ObjectQueryPredicate,
10
+ ObjectQueryResultShape,
11
+ ObjectQuerySortField,
12
+ QueryScalarKind,
13
+ } from "./ir"
14
+ import { normalizeObjectQuery } from "./normalize"
15
+
16
+ export interface ObjectQueryValidationIssue {
17
+ path: string
18
+ code: string
19
+ message: string
20
+ }
21
+
22
+ export interface ValidatedObjectQuery {
23
+ query: ObjectQuery
24
+ result: ObjectQueryResultShape
25
+ /** Every object type the query touches, including intermediate traversal types. */
26
+ touchedObjectTypeIds: readonly string[]
27
+ }
28
+
29
+ export interface ObjectQueryValidationOptions {
30
+ ontology: OntologyRegistry
31
+ maxLimit?: number
32
+ maxPageSize?: number
33
+ normalize?: boolean
34
+ }
35
+
36
+ type QueryValidationContext = Required<
37
+ Pick<ObjectQueryValidationOptions, "maxLimit" | "maxPageSize">
38
+ > & {
39
+ ontology: OntologyRegistry
40
+ valueTypesById: ReadonlyMap<string, ValueType>
41
+ issues: ObjectQueryValidationIssue[]
42
+ touchedObjectTypeIds: Set<string>
43
+ }
44
+
45
+ interface QueryValidationResult {
46
+ result: ObjectQueryResultShape
47
+ query: ObjectQuery
48
+ }
49
+
50
+ interface TextFieldResolution {
51
+ fieldsByObjectType?: Record<string, string[]>
52
+ }
53
+
54
+ const DEFAULT_MAX_LIMIT = 1_000
55
+ const DEFAULT_MAX_PAGE_SIZE = 1_000
56
+
57
+ export function validateObjectQuery(
58
+ query: ObjectQuery,
59
+ options: ObjectQueryValidationOptions
60
+ ): ValidatedObjectQuery {
61
+ const normalized = options.normalize === false ? query : normalizeObjectQuery(query)
62
+ const ctx = createValidationContext(options)
63
+ const validation = validateQueryNode(normalized, "$", ctx)
64
+
65
+ if (ctx.issues.length > 0) {
66
+ throw new ObjectQueryValidationError(ctx.issues)
67
+ }
68
+
69
+ return {
70
+ query: validation.query,
71
+ result: validation.result,
72
+ touchedObjectTypeIds: [...ctx.touchedObjectTypeIds],
73
+ }
74
+ }
75
+
76
+ export function collectObjectQueryValidationIssues(
77
+ query: ObjectQuery,
78
+ options: ObjectQueryValidationOptions
79
+ ): readonly ObjectQueryValidationIssue[] {
80
+ const normalized = options.normalize === false ? query : normalizeObjectQuery(query)
81
+ const ctx = createValidationContext(options)
82
+ validateQueryNode(normalized, "$", ctx)
83
+ return ctx.issues
84
+ }
85
+
86
+ export function resolveObjectQueryResultShape(
87
+ query: ObjectQuery,
88
+ options: ObjectQueryValidationOptions
89
+ ): ObjectQueryResultShape {
90
+ return validateObjectQuery(query, options).result
91
+ }
92
+
93
+ function createValidationContext(options: ObjectQueryValidationOptions): QueryValidationContext {
94
+ return {
95
+ ontology: options.ontology,
96
+ valueTypesById: options.ontology.getValueTypesById(),
97
+ maxLimit: options.maxLimit ?? DEFAULT_MAX_LIMIT,
98
+ maxPageSize: options.maxPageSize ?? DEFAULT_MAX_PAGE_SIZE,
99
+ issues: [],
100
+ touchedObjectTypeIds: new Set<string>(),
101
+ }
102
+ }
103
+
104
+ function validateQueryNode(
105
+ query: ObjectQuery,
106
+ path: string,
107
+ ctx: QueryValidationContext
108
+ ): QueryValidationResult {
109
+ const validation = dispatchQueryNode(query, path, ctx)
110
+
111
+ // Record every intermediate result shape so callers can authorize all
112
+ // object types a query touches, not just the types it returns.
113
+ for (const objectTypeId of validation.result.objectTypeIds) {
114
+ ctx.touchedObjectTypeIds.add(objectTypeId)
115
+ }
116
+
117
+ return validation
118
+ }
119
+
120
+ function dispatchQueryNode(
121
+ query: ObjectQuery,
122
+ path: string,
123
+ ctx: QueryValidationContext
124
+ ): QueryValidationResult {
125
+ switch (query.kind) {
126
+ case "start":
127
+ return validateStart(query.objectTypeId, query.includeSubtypes, path, ctx)
128
+ case "filter": {
129
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
130
+ const predicate = validatePredicate(query.predicate, input.result, `${path}.predicate`, ctx)
131
+ return { result: input.result, query: { ...query, input: input.query, predicate } }
132
+ }
133
+ case "text": {
134
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
135
+ const textFields = validateTextQuery(query.query, query.fields, input.result, path, ctx)
136
+ return {
137
+ result: input.result,
138
+ query: {
139
+ ...query,
140
+ input: input.query,
141
+ fields: query.fields,
142
+ fieldsByObjectType: query.fields ? undefined : textFields.fieldsByObjectType,
143
+ },
144
+ }
145
+ }
146
+ case "vector": {
147
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
148
+ validateVectorQuery(query.vector, query.propertyId, query.k, input.result, path, ctx)
149
+ return { result: input.result, query: { ...query, input: input.query } }
150
+ }
151
+ case "traverse": {
152
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
153
+ return {
154
+ result: validateTraverse(
155
+ query.linkId,
156
+ query.direction,
157
+ query.sourceObjectTypeId,
158
+ input.result,
159
+ path,
160
+ ctx
161
+ ),
162
+ query: { ...query, input: input.query },
163
+ }
164
+ }
165
+ case "set":
166
+ return validateSet(query.inputs, query.op, path, ctx)
167
+ case "sort": {
168
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
169
+ const fields = validateSortFields(query.fields, input.result, path, ctx)
170
+ return { result: input.result, query: { ...query, input: input.query, fields } }
171
+ }
172
+ case "limit": {
173
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
174
+ validateLimit(query.limit, path, ctx)
175
+ return { result: input.result, query: { ...query, input: input.query } }
176
+ }
177
+ case "page": {
178
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
179
+ validatePage(query.pageSize, query.pageToken, path, ctx)
180
+ return { result: input.result, query: { ...query, input: input.query } }
181
+ }
182
+ case "project": {
183
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
184
+ validateProjection(query.properties, input.result, path, ctx)
185
+ return { result: input.result, query: { ...query, input: input.query } }
186
+ }
187
+ case "expand": {
188
+ const input = validateQueryNode(query.input, `${path}.input`, ctx)
189
+ // expand is output-shaping: it attaches links without changing the matched
190
+ // set, so the result type is the input's result type.
191
+ const expansions = validateExpansions(
192
+ query.expansions,
193
+ input.result,
194
+ `${path}.expansions`,
195
+ ctx
196
+ )
197
+ return { result: input.result, query: { ...query, input: input.query, expansions } }
198
+ }
199
+ }
200
+ }
201
+
202
+ function validateStart(
203
+ objectTypeId: string,
204
+ includeSubtypes: boolean | undefined,
205
+ path: string,
206
+ ctx: QueryValidationContext
207
+ ): QueryValidationResult {
208
+ if (!objectTypeId) {
209
+ addIssue(ctx, path, "missing_object_type", "start.objectTypeId is required")
210
+ return { result: { objectTypeIds: [] }, query: { kind: "start", objectTypeId } }
211
+ }
212
+
213
+ if (!ctx.ontology.getObjectTypeById(objectTypeId)) {
214
+ addIssue(ctx, path, "unknown_object_type", formatUnknownObjectTypeMessage(objectTypeId))
215
+ return { result: { objectTypeIds: [] }, query: { kind: "start", objectTypeId } }
216
+ }
217
+
218
+ const objectTypeIds = includeSubtypes
219
+ ? uniqueStrings([objectTypeId, ...ctx.ontology.listSubTypes(objectTypeId)])
220
+ : [objectTypeId]
221
+
222
+ return { result: { objectTypeIds }, query: { kind: "start", objectTypeId, includeSubtypes } }
223
+ }
224
+
225
+ function validatePredicate(
226
+ predicate: ObjectQueryPredicate,
227
+ shape: ObjectQueryResultShape,
228
+ path: string,
229
+ ctx: QueryValidationContext
230
+ ): ObjectQueryPredicate {
231
+ switch (predicate.op) {
232
+ case "and":
233
+ case "or":
234
+ if (predicate.items.length === 0) {
235
+ addIssue(
236
+ ctx,
237
+ path,
238
+ "empty_predicate_group",
239
+ `Predicate '${predicate.op}' must not be empty`
240
+ )
241
+ }
242
+ return {
243
+ ...predicate,
244
+ items: predicate.items.map((item, index) =>
245
+ validatePredicate(item, shape, `${path}.items[${index}]`, ctx)
246
+ ),
247
+ }
248
+ case "not":
249
+ return {
250
+ ...predicate,
251
+ item: validatePredicate(predicate.item, shape, `${path}.item`, ctx),
252
+ }
253
+ case "eq":
254
+ case "neq":
255
+ case "lt":
256
+ case "lte":
257
+ case "gt":
258
+ case "gte": {
259
+ const { scalarKind: _authoredScalarKind, ...authoredPredicate } = predicate
260
+ const scalarKind = resolveAndValidatePredicateProperty(
261
+ predicate.propertyId,
262
+ predicate.op,
263
+ shape,
264
+ path,
265
+ ctx
266
+ )
267
+ validatePredicateValue(predicate.propertyId, predicate.value, shape, path, ctx)
268
+ return {
269
+ ...authoredPredicate,
270
+ value: normalizeObjectQueryValue(predicate.value, scalarKind),
271
+ ...(scalarKind ? { scalarKind } : {}),
272
+ }
273
+ }
274
+ case "in": {
275
+ const { scalarKind: _authoredScalarKind, ...authoredPredicate } = predicate
276
+ const scalarKind = resolveAndValidatePredicateProperty(
277
+ predicate.propertyId,
278
+ predicate.op,
279
+ shape,
280
+ path,
281
+ ctx
282
+ )
283
+ if (predicate.values.length === 0) {
284
+ addIssue(ctx, path, "empty_in_values", "Predicate 'in' must include at least one value")
285
+ }
286
+ predicate.values.forEach((value, index) => {
287
+ validatePredicateValue(predicate.propertyId, value, shape, `${path}.values[${index}]`, ctx)
288
+ })
289
+ return {
290
+ ...authoredPredicate,
291
+ values: predicate.values.map((value) => normalizeObjectQueryValue(value, scalarKind)),
292
+ ...(scalarKind ? { scalarKind } : {}),
293
+ }
294
+ }
295
+ case "exists":
296
+ resolveAndValidatePredicateProperty(predicate.propertyId, predicate.op, shape, path, ctx)
297
+ if (typeof predicate.value !== "boolean") {
298
+ addIssue(ctx, path, "invalid_exists_value", "Predicate 'exists' value must be boolean")
299
+ }
300
+ return predicate
301
+ case "contains":
302
+ resolveAndValidatePredicateProperty(predicate.propertyId, predicate.op, shape, path, ctx)
303
+ validateContainsValue(predicate.propertyId, predicate.value, shape, path, ctx)
304
+ return predicate
305
+ }
306
+ }
307
+
308
+ function resolveAndValidatePredicateProperty(
309
+ propertyId: string,
310
+ op: ObjectQueryPredicate["op"],
311
+ shape: ObjectQueryResultShape,
312
+ path: string,
313
+ ctx: QueryValidationContext
314
+ ): QueryScalarKind | undefined {
315
+ const properties = getPropertiesForResult(propertyId, shape, path, ctx)
316
+ if (properties.length === 0) return undefined
317
+ const schemas: Schema[] = []
318
+
319
+ for (const { objectType, property } of properties) {
320
+ const schema = resolveSchemaForProperty(property, objectType.id, ctx, path)
321
+ if (schema) schemas.push(schema)
322
+
323
+ if (isPrimaryExactPredicate(property, op)) {
324
+ continue
325
+ }
326
+
327
+ if (property.query?.searchable !== true || property.query.filterable !== true) {
328
+ addIssue(
329
+ ctx,
330
+ path,
331
+ "property_not_filterable",
332
+ `Property '${propertyId}' on '${objectType.id}' must set query.searchable: true and query.filterable: true before it can be used in predicates`
333
+ )
334
+ continue
335
+ }
336
+
337
+ if (!schema) continue
338
+
339
+ if ((op === "lt" || op === "lte" || op === "gt" || op === "gte") && !isSortableSchema(schema)) {
340
+ addIssue(
341
+ ctx,
342
+ path,
343
+ "operator_not_supported_for_schema",
344
+ `Predicate '${op}' cannot be used with property '${propertyId}' on '${objectType.id}' because its schema is not orderable`
345
+ )
346
+ }
347
+
348
+ if ((op === "eq" || op === "neq" || op === "in" || op === "exists") && !isExactSchema(schema)) {
349
+ addIssue(
350
+ ctx,
351
+ path,
352
+ "operator_not_supported_for_schema",
353
+ `Predicate '${op}' cannot be used with property '${propertyId}' on '${objectType.id}' because its schema cannot be exact-matched`
354
+ )
355
+ }
356
+
357
+ if (op === "contains" && !isContainsSchema(schema)) {
358
+ addIssue(
359
+ ctx,
360
+ path,
361
+ "operator_not_supported_for_schema",
362
+ `Predicate 'contains' cannot be used with property '${propertyId}' on '${objectType.id}' because its schema is not string, array, or map`
363
+ )
364
+ }
365
+ }
366
+
367
+ if (op === "exists" || op === "contains") return undefined
368
+ return resolveCommonQueryScalarKind(schemas, propertyId, path, ctx)
369
+ }
370
+
371
+ function normalizeObjectQueryValue(value: unknown, scalarKind: QueryScalarKind | undefined) {
372
+ if (scalarKind !== "decimal" || typeof value !== "string") return value
373
+ try {
374
+ return normalizeDecimalValue(value)
375
+ } catch {
376
+ return value
377
+ }
378
+ }
379
+
380
+ function resolveCommonQueryScalarKind(
381
+ schemas: readonly Schema[],
382
+ propertyId: string,
383
+ path: string,
384
+ ctx: QueryValidationContext
385
+ ): QueryScalarKind | undefined {
386
+ const scalarKinds = schemas.map(queryScalarKindForSchema)
387
+ if (scalarKinds.length === 0 || scalarKinds.some((kind) => kind === undefined)) {
388
+ return undefined
389
+ }
390
+
391
+ const resolvedKinds = new Set(scalarKinds)
392
+ if (resolvedKinds.size === 1) return scalarKinds[0]
393
+
394
+ addIssue(
395
+ ctx,
396
+ path,
397
+ "incompatible_property_scalar_kinds",
398
+ `Property '${propertyId}' resolves to incompatible scalar schemas: ${[...resolvedKinds].join(
399
+ ", "
400
+ )}`
401
+ )
402
+ return undefined
403
+ }
404
+
405
+ function queryScalarKindForSchema(schema: Schema): QueryScalarKind | undefined {
406
+ if (typeof schema === "string") return schema === "fileRef" ? undefined : schema
407
+ if (schema.type === "enum") return schema.valueType === "integer" ? "integer" : "string"
408
+ return undefined
409
+ }
410
+
411
+ function validatePredicateValue(
412
+ propertyId: string,
413
+ value: unknown,
414
+ shape: ObjectQueryResultShape,
415
+ path: string,
416
+ ctx: QueryValidationContext
417
+ ): void {
418
+ for (const { objectType, property } of getPropertiesForResult(propertyId, shape, path, ctx, {
419
+ reportMissing: false,
420
+ })) {
421
+ try {
422
+ validatePropertyValue(property, value, `${objectType.id}.${property.id}`, ctx.valueTypesById)
423
+ } catch (error) {
424
+ addIssue(
425
+ ctx,
426
+ path,
427
+ "invalid_predicate_value",
428
+ error instanceof Error
429
+ ? error.message
430
+ : `Invalid value for property '${property.id}' on '${objectType.id}'`
431
+ )
432
+ }
433
+ }
434
+ }
435
+
436
+ function validateContainsValue(
437
+ propertyId: string,
438
+ value: unknown,
439
+ shape: ObjectQueryResultShape,
440
+ path: string,
441
+ ctx: QueryValidationContext
442
+ ): void {
443
+ for (const { objectType, property } of getPropertiesForResult(propertyId, shape, path, ctx, {
444
+ reportMissing: false,
445
+ })) {
446
+ const schema = resolveSchemaForProperty(property, objectType.id, ctx, path)
447
+ if (!schema) continue
448
+
449
+ if (typeof schema === "string") {
450
+ if (schema === "string" || schema === "uuid") {
451
+ if (typeof value !== "string") {
452
+ addIssue(
453
+ ctx,
454
+ path,
455
+ "invalid_contains_value",
456
+ `Predicate 'contains' value for '${objectType.id}.${property.id}' must be a string`
457
+ )
458
+ }
459
+ }
460
+ continue
461
+ }
462
+
463
+ if (schema.type === "array") {
464
+ try {
465
+ validateSchemaValue(
466
+ schema.items,
467
+ value,
468
+ `${objectType.id}.${property.id}[]`,
469
+ ctx.valueTypesById
470
+ )
471
+ } catch (error) {
472
+ addIssue(
473
+ ctx,
474
+ path,
475
+ "invalid_contains_value",
476
+ error instanceof Error
477
+ ? error.message
478
+ : `Invalid contains value for '${objectType.id}.${property.id}'`
479
+ )
480
+ }
481
+ continue
482
+ }
483
+
484
+ if (schema.type === "map" && typeof value !== "string") {
485
+ addIssue(
486
+ ctx,
487
+ path,
488
+ "invalid_contains_value",
489
+ `Predicate 'contains' value for '${objectType.id}.${property.id}' must be a map key string`
490
+ )
491
+ }
492
+ }
493
+ }
494
+
495
+ function validateTextQuery(
496
+ query: string,
497
+ fields: readonly string[] | undefined,
498
+ shape: ObjectQueryResultShape,
499
+ path: string,
500
+ ctx: QueryValidationContext
501
+ ): TextFieldResolution {
502
+ if (query.trim().length === 0) {
503
+ addIssue(ctx, path, "empty_text_query", "Text query must not be empty")
504
+ }
505
+
506
+ const fieldsByObjectType: Record<string, string[]> | undefined = fields ? undefined : {}
507
+
508
+ for (const objectType of getObjectTypesForResult(shape, ctx)) {
509
+ const fieldIds = fields ?? objectType.search?.defaultText
510
+ if (!fieldIds || fieldIds.length === 0) {
511
+ addIssue(
512
+ ctx,
513
+ path,
514
+ "missing_text_fields",
515
+ `Object type '${objectType.id}' must define search.defaultText or the text query must specify fields`
516
+ )
517
+ continue
518
+ }
519
+
520
+ if (fieldsByObjectType) fieldsByObjectType[objectType.id] = uniqueStrings(fieldIds)
521
+
522
+ for (const fieldId of fieldIds) {
523
+ const property = getProperty(objectType, fieldId)
524
+ if (!property) {
525
+ addIssue(
526
+ ctx,
527
+ path,
528
+ "unknown_text_field",
529
+ `Text query references unknown property '${fieldId}' on '${objectType.id}'`
530
+ )
531
+ continue
532
+ }
533
+
534
+ assertStaticSearchProperty(objectType.id, property, "text query", path, ctx)
535
+ assertQueryFlag(objectType.id, property, "text", "text query", path, ctx)
536
+ const schema = resolveSchemaForProperty(property, objectType.id, ctx, path)
537
+ if (schema && !isTextSchema(schema)) {
538
+ addIssue(
539
+ ctx,
540
+ path,
541
+ "text_field_not_string_like",
542
+ `Text query field '${fieldId}' on '${objectType.id}' must be string-like`
543
+ )
544
+ }
545
+ }
546
+ }
547
+
548
+ return fieldsByObjectType ? { fieldsByObjectType } : {}
549
+ }
550
+
551
+ function validateVectorQuery(
552
+ vector: readonly number[],
553
+ propertyId: string,
554
+ k: number,
555
+ shape: ObjectQueryResultShape,
556
+ path: string,
557
+ ctx: QueryValidationContext
558
+ ): void {
559
+ if (!Number.isInteger(k) || k <= 0) {
560
+ addIssue(ctx, path, "invalid_vector_k", "Vector query k must be a positive integer")
561
+ }
562
+
563
+ if (vector.length === 0) {
564
+ addIssue(ctx, path, "empty_vector", "Vector query vector must not be empty")
565
+ }
566
+
567
+ if (vector.some((value) => typeof value !== "number" || !Number.isFinite(value))) {
568
+ addIssue(ctx, path, "invalid_vector_value", "Vector query vector values must be finite numbers")
569
+ }
570
+
571
+ for (const objectType of getObjectTypesForResult(shape, ctx)) {
572
+ const property = getProperty(objectType, propertyId)
573
+ if (!property) {
574
+ addIssue(
575
+ ctx,
576
+ path,
577
+ "unknown_vector_property",
578
+ `Vector query references unknown property '${propertyId}' on '${objectType.id}'`
579
+ )
580
+ continue
581
+ }
582
+
583
+ assertStaticSearchProperty(objectType.id, property, "vector query", path, ctx)
584
+ assertQueryFlag(objectType.id, property, "vector", "vector query", path, ctx)
585
+
586
+ if (objectType.search?.vector?.property !== propertyId) {
587
+ addIssue(
588
+ ctx,
589
+ path,
590
+ "vector_profile_missing",
591
+ `Object type '${objectType.id}' must declare search.vector.property '${propertyId}' before vector search can use it`
592
+ )
593
+ }
594
+
595
+ const schema = resolveSchemaForProperty(property, objectType.id, ctx, path)
596
+ if (schema && !isVectorSchema(schema, ctx)) {
597
+ addIssue(
598
+ ctx,
599
+ path,
600
+ "vector_property_not_numeric_array",
601
+ `Vector query property '${propertyId}' on '${objectType.id}' must be a numeric array`
602
+ )
603
+ }
604
+ }
605
+ }
606
+
607
+ function validateTraverse(
608
+ linkId: string,
609
+ direction: "outgoing" | "incoming",
610
+ sourceObjectTypeId: string | undefined,
611
+ shape: ObjectQueryResultShape,
612
+ path: string,
613
+ ctx: QueryValidationContext
614
+ ): ObjectQueryResultShape {
615
+ if (!linkId) {
616
+ addIssue(ctx, path, "missing_link_id", "traverse.linkId is required")
617
+ return { objectTypeIds: [] }
618
+ }
619
+
620
+ if (direction === "outgoing") {
621
+ if (sourceObjectTypeId !== undefined) {
622
+ addIssue(
623
+ ctx,
624
+ path,
625
+ "traverse_source_not_applicable",
626
+ "traverse.sourceObjectTypeId only applies to incoming traversal"
627
+ )
628
+ }
629
+ return validateOutgoingTraverse(linkId, shape, path, ctx)
630
+ }
631
+
632
+ return validateIncomingTraverse(linkId, sourceObjectTypeId, shape, path, ctx)
633
+ }
634
+
635
+ function validateOutgoingTraverse(
636
+ linkId: string,
637
+ shape: ObjectQueryResultShape,
638
+ path: string,
639
+ ctx: QueryValidationContext
640
+ ): ObjectQueryResultShape {
641
+ const targetTypeIds: string[] = []
642
+
643
+ for (const objectType of getObjectTypesForResult(shape, ctx)) {
644
+ const link = objectType.links.find((candidate) => candidate.id === linkId)
645
+ if (!link) {
646
+ addIssue(
647
+ ctx,
648
+ path,
649
+ "unknown_link",
650
+ `Outgoing traversal references unknown link '${linkId}' on '${objectType.id}'`
651
+ )
652
+ continue
653
+ }
654
+
655
+ if (link.targetObjectTypeId === "*") {
656
+ addIssue(
657
+ ctx,
658
+ path,
659
+ "wildcard_traverse_target",
660
+ `Outgoing traversal over wildcard link '${objectType.id}.${linkId}' cannot infer a target object type`
661
+ )
662
+ continue
663
+ }
664
+
665
+ const declaredTargets = Array.isArray(link.targetObjectTypeId)
666
+ ? link.targetObjectTypeId
667
+ : [link.targetObjectTypeId]
668
+
669
+ for (const targetId of declaredTargets) {
670
+ if (!ctx.ontology.getObjectTypeById(targetId)) {
671
+ addIssue(
672
+ ctx,
673
+ path,
674
+ "unknown_link_target",
675
+ `Outgoing traversal over '${objectType.id}.${linkId}' targets unknown object type '${targetId}'`
676
+ )
677
+ } else {
678
+ targetTypeIds.push(targetId)
679
+ }
680
+ }
681
+ }
682
+
683
+ return { objectTypeIds: uniqueStrings(targetTypeIds) }
684
+ }
685
+
686
+ function validateIncomingTraverse(
687
+ linkId: string,
688
+ sourceObjectTypeId: string | undefined,
689
+ shape: ObjectQueryResultShape,
690
+ path: string,
691
+ ctx: QueryValidationContext
692
+ ): ObjectQueryResultShape {
693
+ let candidateTypes = ctx.ontology.listObjectTypes()
694
+ if (sourceObjectTypeId !== undefined) {
695
+ const sourceType = ctx.ontology.getObjectTypeById(sourceObjectTypeId)
696
+ if (!sourceType) {
697
+ addIssue(
698
+ ctx,
699
+ path,
700
+ "unknown_traverse_source",
701
+ `Incoming traversal references unknown source object type '${sourceObjectTypeId}'`
702
+ )
703
+ return { objectTypeIds: [] }
704
+ }
705
+ candidateTypes = [sourceType]
706
+ }
707
+
708
+ const sourceTypeIds: string[] = []
709
+
710
+ for (const sourceType of candidateTypes) {
711
+ const link = sourceType.links.find((candidate) => candidate.id === linkId)
712
+ if (!link) continue
713
+
714
+ if (link.targetObjectTypeId === "*") {
715
+ sourceTypeIds.push(sourceType.id)
716
+ continue
717
+ }
718
+
719
+ const matches = shape.objectTypeIds.some((targetTypeId) =>
720
+ ctx.ontology.isValidLinkTarget(link.targetObjectTypeId, targetTypeId)
721
+ )
722
+ if (matches) sourceTypeIds.push(sourceType.id)
723
+ }
724
+
725
+ if (sourceTypeIds.length === 0) {
726
+ addIssue(
727
+ ctx,
728
+ path,
729
+ "incoming_link_not_found",
730
+ `Incoming traversal found no source object types with link '${linkId}' targeting ${shape.objectTypeIds.join(
731
+ " | "
732
+ )}`
733
+ )
734
+ }
735
+
736
+ return { objectTypeIds: uniqueStrings(sourceTypeIds) }
737
+ }
738
+
739
+ function validateExpansions(
740
+ expansions: readonly ObjectExpansion[],
741
+ shape: ObjectQueryResultShape,
742
+ path: string,
743
+ ctx: QueryValidationContext
744
+ ): ObjectExpansion[] {
745
+ return expansions.map((expansion, index) =>
746
+ validateExpansion(expansion, shape, `${path}[${index}]`, ctx)
747
+ )
748
+ }
749
+
750
+ function validateExpansion(
751
+ expansion: ObjectExpansion,
752
+ shape: ObjectQueryResultShape,
753
+ path: string,
754
+ ctx: QueryValidationContext
755
+ ): ObjectExpansion {
756
+ if (!expansion.linkId) {
757
+ addIssue(ctx, path, "missing_expand_link", "expand.linkId is required")
758
+ return expansion
759
+ }
760
+
761
+ const targetShape =
762
+ expansion.direction === "incoming"
763
+ ? resolveIncomingExpansionTargets(
764
+ expansion.linkId,
765
+ expansion.sourceObjectTypeId,
766
+ shape,
767
+ path,
768
+ ctx
769
+ )
770
+ : resolveOutgoingExpansionTargets(
771
+ expansion.linkId,
772
+ expansion.sourceObjectTypeId,
773
+ shape,
774
+ path,
775
+ ctx
776
+ )
777
+
778
+ // Expansion targets are touched types: the principal must be able to `view`
779
+ // every type a query hydrates, exactly like `start`/`traverse`. `dispatch`'s
780
+ // automatic fold only covers result types, and expansion targets are not in
781
+ // the result — so add them here (recursively, via the nested call below).
782
+ for (const targetTypeId of targetShape.objectTypeIds) {
783
+ ctx.touchedObjectTypeIds.add(targetTypeId)
784
+ }
785
+
786
+ validateExpansionLimit(expansion.limit, path, ctx)
787
+ const orderBy = expansion.orderBy
788
+ ? validateSortFields(expansion.orderBy, targetShape, `${path}.orderBy`, ctx)
789
+ : undefined
790
+ const expand = expansion.expand
791
+ ? validateExpansions(expansion.expand, targetShape, `${path}.expand`, ctx)
792
+ : undefined
793
+
794
+ return { ...expansion, orderBy, expand }
795
+ }
796
+
797
+ function resolveOutgoingExpansionTargets(
798
+ linkId: string,
799
+ sourceObjectTypeId: string | undefined,
800
+ shape: ObjectQueryResultShape,
801
+ path: string,
802
+ ctx: QueryValidationContext
803
+ ): ObjectQueryResultShape {
804
+ if (sourceObjectTypeId !== undefined) {
805
+ addIssue(
806
+ ctx,
807
+ path,
808
+ "expand_source_not_applicable",
809
+ "expand.sourceObjectTypeId only applies to incoming expansion"
810
+ )
811
+ }
812
+
813
+ const targetTypeIds: string[] = []
814
+ let foundOnAnyType = false
815
+
816
+ for (const objectType of getObjectTypesForResult(shape, ctx)) {
817
+ const link = objectType.links.find((candidate) => candidate.id === linkId)
818
+ if (!link) continue
819
+ foundOnAnyType = true
820
+
821
+ if (link.targetObjectTypeId === "*") {
822
+ addIssue(
823
+ ctx,
824
+ path,
825
+ "wildcard_expand_target",
826
+ `Expansion over wildcard link '${objectType.id}.${linkId}' cannot infer a target object type`
827
+ )
828
+ continue
829
+ }
830
+
831
+ const declaredTargets = Array.isArray(link.targetObjectTypeId)
832
+ ? link.targetObjectTypeId
833
+ : [link.targetObjectTypeId]
834
+
835
+ for (const targetId of declaredTargets) {
836
+ if (!ctx.ontology.getObjectTypeById(targetId)) {
837
+ addIssue(
838
+ ctx,
839
+ path,
840
+ "unknown_expand_target",
841
+ `Expansion over '${objectType.id}.${linkId}' targets unknown object type '${targetId}'`
842
+ )
843
+ } else {
844
+ targetTypeIds.push(targetId)
845
+ }
846
+ }
847
+ }
848
+
849
+ // A link absent from every result type is the "abandoned by a later traverse"
850
+ // case: expands hoist above traverse, so an expand on a type the traverse
851
+ // replaced cannot resolve its link on the final result type.
852
+ if (!foundOnAnyType) {
853
+ addIssue(
854
+ ctx,
855
+ path,
856
+ "unknown_expand_link",
857
+ `Expansion references link '${linkId}' not present on result type ${shape.objectTypeIds.join(
858
+ " | "
859
+ )} (an expand abandoned by a later traverse?)`
860
+ )
861
+ }
862
+
863
+ return { objectTypeIds: uniqueStrings(targetTypeIds) }
864
+ }
865
+
866
+ function resolveIncomingExpansionTargets(
867
+ linkId: string,
868
+ sourceObjectTypeId: string | undefined,
869
+ shape: ObjectQueryResultShape,
870
+ path: string,
871
+ ctx: QueryValidationContext
872
+ ): ObjectQueryResultShape {
873
+ let candidateTypes = ctx.ontology.listObjectTypes()
874
+ if (sourceObjectTypeId !== undefined) {
875
+ const sourceType = ctx.ontology.getObjectTypeById(sourceObjectTypeId)
876
+ if (!sourceType) {
877
+ addIssue(
878
+ ctx,
879
+ path,
880
+ "unknown_expand_source",
881
+ `Incoming expansion references unknown source object type '${sourceObjectTypeId}'`
882
+ )
883
+ return { objectTypeIds: [] }
884
+ }
885
+ candidateTypes = [sourceType]
886
+ }
887
+
888
+ const sourceTypeIds: string[] = []
889
+
890
+ for (const sourceType of candidateTypes) {
891
+ const link = sourceType.links.find((candidate) => candidate.id === linkId)
892
+ if (!link) continue
893
+
894
+ if (link.targetObjectTypeId === "*") {
895
+ sourceTypeIds.push(sourceType.id)
896
+ continue
897
+ }
898
+
899
+ const matches = shape.objectTypeIds.some((targetTypeId) =>
900
+ ctx.ontology.isValidLinkTarget(link.targetObjectTypeId, targetTypeId)
901
+ )
902
+ if (matches) sourceTypeIds.push(sourceType.id)
903
+ }
904
+
905
+ if (sourceTypeIds.length === 0) {
906
+ addIssue(
907
+ ctx,
908
+ path,
909
+ "incoming_expand_link_not_found",
910
+ `Incoming expansion found no source object types with link '${linkId}' targeting ${shape.objectTypeIds.join(
911
+ " | "
912
+ )}`
913
+ )
914
+ }
915
+
916
+ return { objectTypeIds: uniqueStrings(sourceTypeIds) }
917
+ }
918
+
919
+ function validateExpansionLimit(
920
+ limit: number | undefined,
921
+ path: string,
922
+ ctx: QueryValidationContext
923
+ ): void {
924
+ if (limit === undefined) return
925
+ if (!Number.isInteger(limit) || limit < 0) {
926
+ addIssue(
927
+ ctx,
928
+ `${path}.limit`,
929
+ "invalid_expand_limit",
930
+ "expand.limit must be a non-negative integer"
931
+ )
932
+ }
933
+ }
934
+
935
+ function validateSet(
936
+ inputs: readonly ObjectQuery[],
937
+ op: "union" | "intersect" | "subtract",
938
+ path: string,
939
+ ctx: QueryValidationContext
940
+ ): QueryValidationResult {
941
+ if (inputs.length === 0) {
942
+ addIssue(ctx, path, "empty_set", `Set operation '${op}' must include at least one input`)
943
+ return { result: { objectTypeIds: [] }, query: { kind: "set", op, inputs } }
944
+ }
945
+
946
+ const results = inputs.map((input, index) =>
947
+ validateQueryNode(input, `${path}.inputs[${index}]`, ctx)
948
+ )
949
+ const first = results[0]?.result ?? { objectTypeIds: [] }
950
+ const expected = keyForTypeIds(first.objectTypeIds)
951
+
952
+ results.forEach((result, index) => {
953
+ if (keyForTypeIds(result.result.objectTypeIds) !== expected) {
954
+ addIssue(
955
+ ctx,
956
+ `${path}.inputs[${index}]`,
957
+ "incompatible_set_input",
958
+ `Set operation '${op}' inputs must produce the same object type set`
959
+ )
960
+ }
961
+ })
962
+
963
+ return {
964
+ result: first,
965
+ query: { kind: "set", op, inputs: results.map((result) => result.query) },
966
+ }
967
+ }
968
+
969
+ function validateSortFields(
970
+ fields: readonly ObjectQuerySortField[],
971
+ shape: ObjectQueryResultShape,
972
+ path: string,
973
+ ctx: QueryValidationContext
974
+ ): ObjectQuerySortField[] {
975
+ if (fields.length === 0) {
976
+ addIssue(ctx, path, "empty_sort", "Sort must include at least one field")
977
+ return []
978
+ }
979
+
980
+ const seen = new Set<string>()
981
+ return fields.map((field, index) => {
982
+ if (field.direction && field.direction !== "asc" && field.direction !== "desc") {
983
+ addIssue(
984
+ ctx,
985
+ `${path}.fields[${index}]`,
986
+ "invalid_sort_direction",
987
+ "Sort direction must be asc or desc"
988
+ )
989
+ }
990
+
991
+ const key = field.kind === "property" ? `property:${field.propertyId}` : "relevance"
992
+ if (seen.has(key)) {
993
+ addIssue(
994
+ ctx,
995
+ `${path}.fields[${index}]`,
996
+ "duplicate_sort_field",
997
+ `Duplicate sort field '${key}'`
998
+ )
999
+ }
1000
+ seen.add(key)
1001
+
1002
+ if (field.kind === "relevance") return field
1003
+
1004
+ const { scalarKind: _authoredScalarKind, ...authoredField } = field
1005
+
1006
+ const schemas: Schema[] = []
1007
+
1008
+ for (const { objectType, property } of getPropertiesForResult(
1009
+ field.propertyId,
1010
+ shape,
1011
+ `${path}.fields[${index}]`,
1012
+ ctx
1013
+ )) {
1014
+ if (property.query?.searchable !== true || property.query.sortable !== true) {
1015
+ addIssue(
1016
+ ctx,
1017
+ `${path}.fields[${index}]`,
1018
+ "property_not_sortable",
1019
+ `Property '${property.id}' on '${objectType.id}' must set query.searchable: true and query.sortable: true before it can be sorted`
1020
+ )
1021
+ continue
1022
+ }
1023
+
1024
+ const schema = resolveSchemaForProperty(
1025
+ property,
1026
+ objectType.id,
1027
+ ctx,
1028
+ `${path}.fields[${index}]`
1029
+ )
1030
+ if (schema) schemas.push(schema)
1031
+ if (schema && !isSortableSchema(schema)) {
1032
+ addIssue(
1033
+ ctx,
1034
+ `${path}.fields[${index}]`,
1035
+ "sort_field_not_orderable",
1036
+ `Sort field '${property.id}' on '${objectType.id}' is not orderable`
1037
+ )
1038
+ }
1039
+ }
1040
+
1041
+ const scalarKind = resolveCommonQueryScalarKind(
1042
+ schemas,
1043
+ field.propertyId,
1044
+ `${path}.fields[${index}]`,
1045
+ ctx
1046
+ )
1047
+ return { ...authoredField, ...(scalarKind ? { scalarKind } : {}) }
1048
+ })
1049
+ }
1050
+
1051
+ function validateLimit(limit: number, path: string, ctx: QueryValidationContext): void {
1052
+ if (!Number.isInteger(limit) || limit < 0) {
1053
+ addIssue(ctx, path, "invalid_limit", "limit must be a non-negative integer")
1054
+ } else if (limit > ctx.maxLimit) {
1055
+ addIssue(ctx, path, "limit_too_large", `limit must be <= ${ctx.maxLimit}`)
1056
+ }
1057
+ }
1058
+
1059
+ function validatePage(
1060
+ pageSize: number,
1061
+ pageToken: string | undefined,
1062
+ path: string,
1063
+ ctx: QueryValidationContext
1064
+ ): void {
1065
+ if (!Number.isInteger(pageSize) || pageSize <= 0) {
1066
+ addIssue(ctx, path, "invalid_page_size", "pageSize must be a positive integer")
1067
+ } else if (pageSize > ctx.maxPageSize) {
1068
+ addIssue(ctx, path, "page_size_too_large", `pageSize must be <= ${ctx.maxPageSize}`)
1069
+ }
1070
+
1071
+ if (pageToken !== undefined && pageToken.length === 0) {
1072
+ addIssue(ctx, path, "empty_page_token", "pageToken must not be empty when provided")
1073
+ }
1074
+ }
1075
+
1076
+ function validateProjection(
1077
+ properties: readonly string[] | undefined,
1078
+ shape: ObjectQueryResultShape,
1079
+ path: string,
1080
+ ctx: QueryValidationContext
1081
+ ): void {
1082
+ if (!properties) return
1083
+ if (properties.length === 0) {
1084
+ addIssue(ctx, path, "empty_projection", "project.properties must not be empty when provided")
1085
+ }
1086
+
1087
+ const seen = new Set<string>()
1088
+ properties.forEach((propertyId, index) => {
1089
+ if (seen.has(propertyId)) {
1090
+ addIssue(
1091
+ ctx,
1092
+ `${path}.properties[${index}]`,
1093
+ "duplicate_projection_property",
1094
+ `Duplicate projected property '${propertyId}'`
1095
+ )
1096
+ }
1097
+ seen.add(propertyId)
1098
+ getPropertiesForResult(propertyId, shape, `${path}.properties[${index}]`, ctx)
1099
+ })
1100
+ }
1101
+
1102
+ function getObjectTypesForResult(
1103
+ shape: ObjectQueryResultShape,
1104
+ ctx: QueryValidationContext
1105
+ ): ObjectType[] {
1106
+ const objectTypes: ObjectType[] = []
1107
+ for (const objectTypeId of shape.objectTypeIds) {
1108
+ const objectType = ctx.ontology.getObjectTypeById(objectTypeId)
1109
+ if (objectType) objectTypes.push(objectType)
1110
+ }
1111
+ return objectTypes
1112
+ }
1113
+
1114
+ function getPropertiesForResult(
1115
+ propertyId: string,
1116
+ shape: ObjectQueryResultShape,
1117
+ path: string,
1118
+ ctx: QueryValidationContext,
1119
+ options: { reportMissing?: boolean } = {}
1120
+ ): { objectType: ObjectType; property: Property }[] {
1121
+ const results: { objectType: ObjectType; property: Property }[] = []
1122
+
1123
+ for (const objectType of getObjectTypesForResult(shape, ctx)) {
1124
+ const property = getProperty(objectType, propertyId)
1125
+ if (!property) {
1126
+ if (options.reportMissing === false) {
1127
+ continue
1128
+ }
1129
+ addIssue(
1130
+ ctx,
1131
+ path,
1132
+ "unknown_property",
1133
+ `Property '${propertyId}' does not exist on object type '${objectType.id}'`
1134
+ )
1135
+ continue
1136
+ }
1137
+ results.push({ objectType, property })
1138
+ }
1139
+
1140
+ return results
1141
+ }
1142
+
1143
+ function getProperty(objectType: ObjectType, propertyId: string): Property | undefined {
1144
+ return objectType.properties.find((property) => property.id === propertyId)
1145
+ }
1146
+
1147
+ function assertStaticSearchProperty(
1148
+ objectTypeId: string,
1149
+ property: Property,
1150
+ context: string,
1151
+ path: string,
1152
+ ctx: QueryValidationContext
1153
+ ): void {
1154
+ if (property.mode === "telemetry") {
1155
+ addIssue(
1156
+ ctx,
1157
+ path,
1158
+ "telemetry_search_property",
1159
+ `${context} references telemetry property '${property.id}' on '${objectTypeId}'. Search can only reference static properties because telemetry latest values are not object-query indexed.`
1160
+ )
1161
+ }
1162
+ }
1163
+
1164
+ function assertQueryFlag(
1165
+ objectTypeId: string,
1166
+ property: Property,
1167
+ flag: "text" | "vector",
1168
+ context: string,
1169
+ path: string,
1170
+ ctx: QueryValidationContext
1171
+ ): void {
1172
+ if (property.query?.searchable === true && property.query[flag] === true) return
1173
+ addIssue(
1174
+ ctx,
1175
+ path,
1176
+ "query_field_not_enabled",
1177
+ `${context} field '${property.id}' on '${objectTypeId}' must set query.searchable: true and query.${flag}: true`
1178
+ )
1179
+ }
1180
+
1181
+ function resolveSchemaForProperty(
1182
+ property: Property,
1183
+ objectTypeId: string,
1184
+ ctx: QueryValidationContext,
1185
+ path: string
1186
+ ): Schema | null {
1187
+ try {
1188
+ return resolveSchema(property.schema, ctx.valueTypesById)
1189
+ } catch (error) {
1190
+ addIssue(
1191
+ ctx,
1192
+ path,
1193
+ "unresolved_property_schema",
1194
+ error instanceof Error
1195
+ ? error.message
1196
+ : `Could not resolve schema for '${objectTypeId}.${property.id}'`
1197
+ )
1198
+ return null
1199
+ }
1200
+ }
1201
+
1202
+ function resolveSchema(
1203
+ schema: Schema,
1204
+ valueTypesById: ReadonlyMap<string, ValueType>,
1205
+ seenValueTypeIds = new Set<string>()
1206
+ ): Schema {
1207
+ if (typeof schema === "string") return schema
1208
+ if (schema.type !== "valueTypeRef") return schema
1209
+ if (seenValueTypeIds.has(schema.valueTypeId)) {
1210
+ throw new Error(`Circular valueTypeRef '${schema.valueTypeId}'`)
1211
+ }
1212
+
1213
+ const resolved = schema._resolved ?? valueTypesById.get(schema.valueTypeId)?.schema
1214
+ if (!resolved) {
1215
+ throw new Error(`Unknown valueTypeRef '${schema.valueTypeId}'`)
1216
+ }
1217
+
1218
+ seenValueTypeIds.add(schema.valueTypeId)
1219
+ return resolveSchema(resolved, valueTypesById, seenValueTypeIds)
1220
+ }
1221
+
1222
+ function isPrimaryExactPredicate(property: Property, op: ObjectQueryPredicate["op"]): boolean {
1223
+ return property.primary === true && (op === "eq" || op === "in")
1224
+ }
1225
+
1226
+ function isTextSchema(schema: Schema): boolean {
1227
+ if (schema === "string") return true
1228
+ return typeof schema !== "string" && schema.type === "enum" && schema.valueType === "string"
1229
+ }
1230
+
1231
+ function isExactSchema(schema: Schema): boolean {
1232
+ if (typeof schema === "string") return schema !== "fileRef"
1233
+ return schema.type === "enum"
1234
+ }
1235
+
1236
+ function isSortableSchema(schema: Schema): boolean {
1237
+ if (typeof schema === "string") {
1238
+ return (
1239
+ schema === "string" ||
1240
+ schema === "uuid" ||
1241
+ schema === "integer" ||
1242
+ schema === "double" ||
1243
+ schema === "decimal" ||
1244
+ schema === "date" ||
1245
+ schema === "timestamp"
1246
+ )
1247
+ }
1248
+ return schema.type === "enum"
1249
+ }
1250
+
1251
+ function isContainsSchema(schema: Schema): boolean {
1252
+ return (
1253
+ schema === "string" ||
1254
+ schema === "uuid" ||
1255
+ (typeof schema !== "string" && (schema.type === "array" || schema.type === "map"))
1256
+ )
1257
+ }
1258
+
1259
+ function isVectorSchema(schema: Schema, ctx: QueryValidationContext): boolean {
1260
+ if (typeof schema === "string") return false
1261
+ if (schema.type !== "array") return false
1262
+ const itemSchema = resolveSchema(schema.items, ctx.valueTypesById)
1263
+ return itemSchema === "integer" || itemSchema === "double" || itemSchema === "decimal"
1264
+ }
1265
+
1266
+ function keyForTypeIds(typeIds: readonly string[]): string {
1267
+ return uniqueStrings(typeIds).sort().join("\0")
1268
+ }
1269
+
1270
+ function uniqueStrings(values: readonly string[]): string[] {
1271
+ return [...new Set(values)]
1272
+ }
1273
+
1274
+ function addIssue(ctx: QueryValidationContext, path: string, code: string, message: string): void {
1275
+ ctx.issues.push({ path, code, message })
1276
+ }