@sixb/core 0.2.5 → 0.2.6

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 (385) hide show
  1. package/dist/actions/index.js +36 -35
  2. package/dist/actions/index.js.map +1 -1
  3. package/dist/actions/validation.d.ts.map +1 -1
  4. package/dist/agents/errors.d.ts +1 -1
  5. package/dist/agents/errors.d.ts.map +1 -1
  6. package/dist/agents/execution.d.ts +17 -2
  7. package/dist/agents/execution.d.ts.map +1 -1
  8. package/dist/agents/index.d.ts +2 -2
  9. package/dist/agents/index.d.ts.map +1 -1
  10. package/dist/agents/index.js +50 -44
  11. package/dist/agents/index.js.map +1 -1
  12. package/dist/agents/model-routing.d.ts +5 -2
  13. package/dist/agents/model-routing.d.ts.map +1 -1
  14. package/dist/agents/request.d.ts +45 -4
  15. package/dist/agents/request.d.ts.map +1 -1
  16. package/dist/agents/run-events.d.ts +4 -0
  17. package/dist/agents/run-events.d.ts.map +1 -1
  18. package/dist/agents/run-session-children.d.ts.map +1 -1
  19. package/dist/agents/run-turn.d.ts +9 -1
  20. package/dist/agents/run-turn.d.ts.map +1 -1
  21. package/dist/agents/streams/index.d.ts +1 -1
  22. package/dist/agents/streams/index.d.ts.map +1 -1
  23. package/dist/agents/streams/index.js +1 -1
  24. package/dist/agents/streams/internal.d.ts +2 -1
  25. package/dist/agents/streams/internal.d.ts.map +1 -1
  26. package/dist/agents/streams/internal.js +22 -2
  27. package/dist/agents/streams/internal.js.map +1 -1
  28. package/dist/agents/streams/protocol.d.ts +37 -0
  29. package/dist/agents/streams/protocol.d.ts.map +1 -1
  30. package/dist/agents/streams/steps.d.ts +24 -0
  31. package/dist/agents/streams/steps.d.ts.map +1 -0
  32. package/dist/agents/thread-access.d.ts +44 -2
  33. package/dist/agents/thread-access.d.ts.map +1 -1
  34. package/dist/artifacts/live/server.js +19 -18
  35. package/dist/artifacts/live/server.js.map +1 -1
  36. package/dist/artifacts/publish/index.js +18 -17
  37. package/dist/artifacts/publish/index.js.map +1 -1
  38. package/dist/artifacts/publish/merge.d.ts +2 -1
  39. package/dist/artifacts/publish/merge.d.ts.map +1 -1
  40. package/dist/artifacts/run-query.d.ts.map +1 -1
  41. package/dist/auth/index.js +6 -6
  42. package/dist/authorization/index.js +2 -2
  43. package/dist/bootstrap/index.js +40 -38
  44. package/dist/bootstrap/index.js.map +2 -2
  45. package/dist/calendar.d.ts +55 -0
  46. package/dist/calendar.d.ts.map +1 -0
  47. package/dist/calendar.js +19 -0
  48. package/dist/calendar.js.map +9 -0
  49. package/dist/{chunk-5a4a52tq.js → chunk-0pmpwn3g.js} +18 -2
  50. package/dist/chunk-0pmpwn3g.js.map +10 -0
  51. package/dist/{chunk-xcrnrpfh.js → chunk-394zjzjs.js} +20 -10
  52. package/dist/{chunk-xcrnrpfh.js.map → chunk-394zjzjs.js.map} +5 -5
  53. package/dist/{chunk-stmxh0hv.js → chunk-3neam1y5.js} +2 -2
  54. package/dist/{chunk-zeykm8my.js → chunk-3qtk0070.js} +16 -42
  55. package/dist/chunk-3qtk0070.js.map +14 -0
  56. package/dist/{chunk-0mvjpgvm.js → chunk-425ydk65.js} +4 -4
  57. package/dist/{chunk-s5pj68fa.js → chunk-5sswe5ej.js} +2 -2
  58. package/dist/chunk-6hfbz4d0.js +98 -0
  59. package/dist/chunk-6hfbz4d0.js.map +10 -0
  60. package/dist/{chunk-3zagkr6w.js → chunk-7mhbs9yy.js} +4 -4
  61. package/dist/{chunk-3zagkr6w.js.map → chunk-7mhbs9yy.js.map} +1 -1
  62. package/dist/{chunk-fpf57gca.js → chunk-7r9mqpva.js} +273 -66
  63. package/dist/{chunk-fpf57gca.js.map → chunk-7r9mqpva.js.map} +5 -5
  64. package/dist/{chunk-ewqn51gr.js → chunk-88xeh6zx.js} +6 -4
  65. package/dist/{chunk-ewqn51gr.js.map → chunk-88xeh6zx.js.map} +4 -4
  66. package/dist/chunk-90nqenq8.js +386 -0
  67. package/dist/chunk-90nqenq8.js.map +14 -0
  68. package/dist/{chunk-gjhrz66x.js → chunk-9c9yknwt.js} +247 -20
  69. package/dist/{chunk-gjhrz66x.js.map → chunk-9c9yknwt.js.map} +6 -6
  70. package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
  71. package/dist/chunk-9wr3yajk.js.map +2 -2
  72. package/dist/{chunk-z1njfqqs.js → chunk-ats8y3d9.js} +721 -156
  73. package/dist/{chunk-z1njfqqs.js.map → chunk-ats8y3d9.js.map} +13 -13
  74. package/dist/{chunk-68hm50qh.js → chunk-bcz9dxtf.js} +16 -46
  75. package/dist/chunk-bcz9dxtf.js.map +12 -0
  76. package/dist/{chunk-naxjka9v.js → chunk-brhp9d97.js} +2 -2
  77. package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
  78. package/dist/{chunk-s1mqyqmm.js → chunk-bs1sd0e0.js} +12 -8
  79. package/dist/chunk-bs1sd0e0.js.map +18 -0
  80. package/dist/{chunk-vehcr9eb.js → chunk-cg7cygfj.js} +1 -1
  81. package/dist/chunk-dq3t5sr3.js +114 -0
  82. package/dist/chunk-dq3t5sr3.js.map +11 -0
  83. package/dist/{chunk-r2psmn42.js → chunk-eg6xqef7.js} +1 -1
  84. package/dist/{chunk-zxhym8tr.js → chunk-f05994as.js} +1 -1
  85. package/dist/{chunk-5t9gm5tt.js → chunk-fmgf9h5e.js} +38 -14
  86. package/dist/chunk-fmgf9h5e.js.map +22 -0
  87. package/dist/{chunk-ey1p8w68.js → chunk-gaj8djsw.js} +80 -4
  88. package/dist/chunk-gaj8djsw.js.map +13 -0
  89. package/dist/{chunk-1yh6jgtz.js → chunk-grt2j5vp.js} +2 -2
  90. package/dist/{chunk-zft9bzbc.js → chunk-hkbks1xm.js} +2 -1
  91. package/dist/{chunk-zft9bzbc.js.map → chunk-hkbks1xm.js.map} +3 -3
  92. package/dist/{chunk-rtdrm592.js → chunk-htdzx40w.js} +2 -2
  93. package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
  94. package/dist/{chunk-m3qx2pns.js → chunk-jt012fxq.js} +28 -12
  95. package/dist/{chunk-m3qx2pns.js.map → chunk-jt012fxq.js.map} +5 -5
  96. package/dist/{chunk-k3jh8gsg.js → chunk-kft7mp7z.js} +20 -3
  97. package/dist/chunk-kft7mp7z.js.map +10 -0
  98. package/dist/{chunk-qavwr628.js → chunk-n1hbwc6y.js} +5 -6
  99. package/dist/chunk-n1hbwc6y.js.map +12 -0
  100. package/dist/chunk-nxysqbt0.js.map +2 -2
  101. package/dist/{chunk-pqvvqc65.js → chunk-pqj8vff9.js} +3 -3
  102. package/dist/{chunk-wqe9shx2.js → chunk-qbd282aa.js} +2 -2
  103. package/dist/{chunk-e91fmg6t.js → chunk-qsa7nw6f.js} +2 -1
  104. package/dist/{chunk-e91fmg6t.js.map → chunk-qsa7nw6f.js.map} +3 -3
  105. package/dist/{chunk-rg725hry.js → chunk-s8xxef60.js} +83 -33
  106. package/dist/{chunk-rg725hry.js.map → chunk-s8xxef60.js.map} +5 -5
  107. package/dist/{chunk-fzae1jpq.js → chunk-t19wjmnc.js} +5 -5
  108. package/dist/{chunk-paxabbqd.js → chunk-tapdssb5.js} +1 -1
  109. package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
  110. package/dist/{chunk-q8d9p0tb.js → chunk-wzcjhv54.js} +8 -1
  111. package/dist/{chunk-q8d9p0tb.js.map → chunk-wzcjhv54.js.map} +3 -3
  112. package/dist/{chunk-pc7kra3k.js → chunk-xavet0qs.js} +1 -1
  113. package/dist/{chunk-0hkdtwqk.js → chunk-xf76csps.js} +5 -5
  114. package/dist/{chunk-m9ketb51.js → chunk-ygvay56w.js} +1 -1
  115. package/dist/{chunk-b4escq4c.js → chunk-ykchk644.js} +6 -6
  116. package/dist/{chunk-k29n4176.js → chunk-ym1bqd98.js} +6 -6
  117. package/dist/connectors/connections/capability.d.ts +11 -0
  118. package/dist/connectors/connections/capability.d.ts.map +1 -1
  119. package/dist/connectors/connections/internal.d.ts +2 -1
  120. package/dist/connectors/connections/internal.d.ts.map +1 -1
  121. package/dist/connectors/connections/internal.js +8 -4
  122. package/dist/connectors/connections/internal.js.map +1 -1
  123. package/dist/connectors/connections/service.d.ts +9 -1
  124. package/dist/connectors/connections/service.d.ts.map +1 -1
  125. package/dist/connectors/execution.d.ts +7 -1
  126. package/dist/connectors/execution.d.ts.map +1 -1
  127. package/dist/connectors/service.d.ts +5 -1
  128. package/dist/connectors/service.d.ts.map +1 -1
  129. package/dist/deploy/types.d.ts +4 -1
  130. package/dist/deploy/types.d.ts.map +1 -1
  131. package/dist/events/execution.d.ts +8 -1
  132. package/dist/events/execution.d.ts.map +1 -1
  133. package/dist/events/types/syncs.d.ts +4 -0
  134. package/dist/events/types/syncs.d.ts.map +1 -1
  135. package/dist/execution/agent.js +37 -36
  136. package/dist/execution/agent.js.map +1 -1
  137. package/dist/execution/authorized-object-reader.d.ts +4 -0
  138. package/dist/execution/authorized-object-reader.d.ts.map +1 -1
  139. package/dist/execution/object-reader-ontology.d.ts +3 -0
  140. package/dist/execution/object-reader-ontology.d.ts.map +1 -1
  141. package/dist/execution/primitive.js +36 -35
  142. package/dist/execution/primitive.js.map +1 -1
  143. package/dist/execution/request.d.ts +1 -1
  144. package/dist/execution/request.d.ts.map +1 -1
  145. package/dist/execution/request.js +33 -32
  146. package/dist/execution/request.js.map +3 -3
  147. package/dist/http/api-routes.d.ts.map +1 -1
  148. package/dist/http/index.js +1 -1
  149. package/dist/index.d.ts +5 -5
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +61 -59
  152. package/dist/index.js.map +1 -1
  153. package/dist/maintenance/index.js +1 -1
  154. package/dist/materializer/index.js +22 -21
  155. package/dist/materializer/index.js.map +1 -1
  156. package/dist/models/audio/runtime.d.ts.map +1 -1
  157. package/dist/models/audio/types.d.ts +19 -0
  158. package/dist/models/audio/types.d.ts.map +1 -1
  159. package/dist/models/execution/index.js +20 -19
  160. package/dist/models/execution/index.js.map +1 -1
  161. package/dist/models/index.d.ts +1 -1
  162. package/dist/models/index.d.ts.map +1 -1
  163. package/dist/objects/index.js +36 -35
  164. package/dist/objects/index.js.map +1 -1
  165. package/dist/objects/query/executor.d.ts +3 -1
  166. package/dist/objects/query/executor.d.ts.map +1 -1
  167. package/dist/objects/query/explain.d.ts +3 -1
  168. package/dist/objects/query/explain.d.ts.map +1 -1
  169. package/dist/objects/query/index.d.ts +1 -1
  170. package/dist/objects/query/index.d.ts.map +1 -1
  171. package/dist/objects/query/index.js +19 -18
  172. package/dist/objects/query/index.js.map +1 -1
  173. package/dist/objects/query/link-query-clearance.d.ts +3 -0
  174. package/dist/objects/query/link-query-clearance.d.ts.map +1 -1
  175. package/dist/objects/query/links.d.ts +1 -1
  176. package/dist/objects/query/links.d.ts.map +1 -1
  177. package/dist/objects/query/validate.d.ts +17 -0
  178. package/dist/objects/query/validate.d.ts.map +1 -1
  179. package/dist/objects/sdk/runtime-query-executor.d.ts +1 -1
  180. package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
  181. package/dist/ontology/index.js +3 -3
  182. package/dist/ontology/internal.js +3 -3
  183. package/dist/pipelines/index.js +21 -20
  184. package/dist/pipelines/index.js.map +1 -1
  185. package/dist/projections/internal.js +20 -19
  186. package/dist/projections/internal.js.map +1 -1
  187. package/dist/queues/in-memory.d.ts +1 -1
  188. package/dist/queues/in-memory.d.ts.map +1 -1
  189. package/dist/runtime/host.d.ts.map +1 -1
  190. package/dist/runtime/internal.js +24 -23
  191. package/dist/runtime/internal.js.map +2 -2
  192. package/dist/runtime/locale.d.ts +0 -2
  193. package/dist/runtime/locale.d.ts.map +1 -1
  194. package/dist/runtime/sixb.d.ts.map +1 -1
  195. package/dist/sandboxes/auth.d.ts +26 -4
  196. package/dist/sandboxes/auth.d.ts.map +1 -1
  197. package/dist/sandboxes/index.d.ts +3 -1
  198. package/dist/sandboxes/index.d.ts.map +1 -1
  199. package/dist/sandboxes/index.js +5 -5
  200. package/dist/security/view-conditions.d.ts.map +1 -1
  201. package/dist/shares/internal.js +16 -15
  202. package/dist/shares/internal.js.map +2 -2
  203. package/dist/storage/agents/in-memory.d.ts +18 -1
  204. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  205. package/dist/storage/agents/index.d.ts +1 -1
  206. package/dist/storage/agents/index.d.ts.map +1 -1
  207. package/dist/storage/agents/provider.d.ts +43 -9
  208. package/dist/storage/agents/provider.d.ts.map +1 -1
  209. package/dist/storage/agents/provider.js +18 -2
  210. package/dist/storage/agents/provider.js.map +1 -1
  211. package/dist/storage/agents/types.d.ts +136 -3
  212. package/dist/storage/agents/types.d.ts.map +1 -1
  213. package/dist/storage/ai-cost/analytics.d.ts +3 -2
  214. package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
  215. package/dist/storage/ai-cost/provider.js +4 -3
  216. package/dist/storage/ai-cost/provider.js.map +1 -1
  217. package/dist/storage/ai-cost/types.d.ts +5 -1
  218. package/dist/storage/ai-cost/types.d.ts.map +1 -1
  219. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  220. package/dist/storage/artifacts/record.d.ts +3 -1
  221. package/dist/storage/artifacts/record.d.ts.map +1 -1
  222. package/dist/storage/artifacts/types.d.ts +7 -0
  223. package/dist/storage/artifacts/types.d.ts.map +1 -1
  224. package/dist/storage/file-upload-sessions/provider.js +7 -7
  225. package/dist/storage/index.d.ts +2 -2
  226. package/dist/storage/index.d.ts.map +1 -1
  227. package/dist/storage/index.js +22 -21
  228. package/dist/storage/index.js.map +1 -1
  229. package/dist/storage/internal.js +8 -8
  230. package/dist/storage/operation-scope.d.ts.map +1 -1
  231. package/dist/storage/operation-scope.js +1 -1
  232. package/dist/storage/sync-runs/idempotency.d.ts.map +1 -1
  233. package/dist/storage/sync-runs/in-memory.d.ts +2 -1
  234. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
  235. package/dist/storage/sync-runs/index.d.ts +1 -1
  236. package/dist/storage/sync-runs/index.d.ts.map +1 -1
  237. package/dist/storage/sync-runs/types.d.ts +27 -2
  238. package/dist/storage/sync-runs/types.d.ts.map +1 -1
  239. package/dist/storage/workflow-runs/provider.js +7 -7
  240. package/dist/syncs/accounts.d.ts +36 -0
  241. package/dist/syncs/accounts.d.ts.map +1 -0
  242. package/dist/syncs/builders.d.ts.map +1 -1
  243. package/dist/syncs/connections.d.ts +36 -0
  244. package/dist/syncs/connections.d.ts.map +1 -0
  245. package/dist/syncs/execution.d.ts +14 -4
  246. package/dist/syncs/execution.d.ts.map +1 -1
  247. package/dist/syncs/index.d.ts +2 -1
  248. package/dist/syncs/index.d.ts.map +1 -1
  249. package/dist/syncs/index.js +22 -21
  250. package/dist/syncs/index.js.map +1 -1
  251. package/dist/syncs/request.d.ts +16 -2
  252. package/dist/syncs/request.d.ts.map +1 -1
  253. package/dist/syncs/run-dispatch.d.ts +14 -2
  254. package/dist/syncs/run-dispatch.d.ts.map +1 -1
  255. package/dist/testing/agent-approval-storage-contract.d.ts.map +1 -1
  256. package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -1
  257. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  258. package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
  259. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  260. package/dist/testing/index.js +1051 -58
  261. package/dist/testing/index.js.map +8 -8
  262. package/dist/testing/run-claim-storage-contract.d.ts.map +1 -1
  263. package/dist/webhooks/internal.js +17 -16
  264. package/dist/webhooks/internal.js.map +2 -2
  265. package/dist/workers/index.js +66 -13
  266. package/dist/workers/index.js.map +4 -4
  267. package/dist/workers/queue-worker.d.ts +5 -0
  268. package/dist/workers/queue-worker.d.ts.map +1 -1
  269. package/dist/workers/worker.d.ts +8 -0
  270. package/dist/workers/worker.d.ts.map +1 -1
  271. package/dist/workflows/index.js +42 -40
  272. package/dist/workflows/index.js.map +1 -1
  273. package/package.json +7 -1
  274. package/src/actions/validation.ts +3 -1
  275. package/src/agents/children.ts +6 -0
  276. package/src/agents/errors.ts +3 -0
  277. package/src/agents/execution.ts +170 -20
  278. package/src/agents/index.ts +4 -0
  279. package/src/agents/model-routing.ts +25 -9
  280. package/src/agents/request.ts +759 -40
  281. package/src/agents/run-events.ts +235 -38
  282. package/src/agents/run-session-children.ts +13 -2
  283. package/src/agents/run-turn.ts +140 -23
  284. package/src/agents/streams/index.ts +2 -0
  285. package/src/agents/streams/internal.ts +12 -0
  286. package/src/agents/streams/protocol.ts +69 -1
  287. package/src/agents/streams/steps.ts +131 -0
  288. package/src/agents/thread-access.ts +57 -2
  289. package/src/artifacts/publish/merge.ts +14 -3
  290. package/src/artifacts/run-query.ts +5 -2
  291. package/src/calendar.ts +195 -0
  292. package/src/connectors/connections/capability.ts +40 -0
  293. package/src/connectors/connections/internal.ts +3 -0
  294. package/src/connectors/connections/service.ts +74 -5
  295. package/src/connectors/execution.ts +5 -6
  296. package/src/connectors/service.ts +23 -0
  297. package/src/deploy/types.ts +4 -1
  298. package/src/events/execution.ts +42 -2
  299. package/src/events/types/syncs.ts +4 -0
  300. package/src/execution/authorized-object-reader.ts +33 -5
  301. package/src/execution/object-reader-ontology.ts +6 -0
  302. package/src/execution/request.ts +1 -0
  303. package/src/http/api-routes.ts +8 -0
  304. package/src/index.ts +18 -2
  305. package/src/models/audio/runtime.ts +57 -14
  306. package/src/models/audio/types.ts +20 -0
  307. package/src/models/index.ts +1 -0
  308. package/src/objects/query/executor.ts +4 -0
  309. package/src/objects/query/explain.ts +5 -0
  310. package/src/objects/query/index.ts +1 -0
  311. package/src/objects/query/link-query-clearance.ts +4 -1
  312. package/src/objects/query/links.ts +5 -1
  313. package/src/objects/query/validate.ts +33 -1
  314. package/src/objects/sdk/runtime-query-executor.ts +7 -3
  315. package/src/runtime/host.ts +13 -7
  316. package/src/runtime/locale.ts +0 -10
  317. package/src/runtime/sixb.ts +12 -2
  318. package/src/sandboxes/README.md +3 -1
  319. package/src/sandboxes/auth.ts +32 -4
  320. package/src/sandboxes/index.ts +15 -1
  321. package/src/security/view-conditions.ts +2 -1
  322. package/src/storage/agents/in-memory.ts +271 -6
  323. package/src/storage/agents/index.ts +10 -0
  324. package/src/storage/agents/provider.ts +170 -13
  325. package/src/storage/agents/types.ts +148 -3
  326. package/src/storage/ai-cost/analytics.ts +22 -43
  327. package/src/storage/ai-cost/types.ts +5 -1
  328. package/src/storage/artifacts/in-memory.ts +20 -5
  329. package/src/storage/artifacts/record.ts +8 -2
  330. package/src/storage/artifacts/types.ts +7 -0
  331. package/src/storage/index.ts +11 -0
  332. package/src/storage/operation-scope.ts +1 -0
  333. package/src/storage/sync-runs/idempotency.ts +1 -0
  334. package/src/storage/sync-runs/in-memory.ts +43 -1
  335. package/src/storage/sync-runs/index.ts +1 -0
  336. package/src/storage/sync-runs/types.ts +30 -1
  337. package/src/syncs/accounts.ts +85 -0
  338. package/src/syncs/builders.ts +18 -1
  339. package/src/syncs/connections.ts +123 -0
  340. package/src/syncs/execution.ts +64 -22
  341. package/src/syncs/index.ts +3 -0
  342. package/src/syncs/request.ts +81 -23
  343. package/src/syncs/run-dispatch.ts +69 -7
  344. package/src/testing/agent-approval-storage-contract.ts +123 -0
  345. package/src/testing/agent-inbox-storage-contract.ts +59 -0
  346. package/src/testing/agent-storage-contract.ts +767 -8
  347. package/src/testing/ai-cost-storage-contract.ts +80 -0
  348. package/src/testing/artifact-storage-contract.ts +129 -0
  349. package/src/testing/run-claim-storage-contract.ts +116 -0
  350. package/src/workers/README.md +4 -1
  351. package/src/workers/lost-runs.ts +1 -0
  352. package/src/workers/queue-worker.ts +16 -5
  353. package/src/workers/worker.ts +67 -7
  354. package/dist/chunk-5a4a52tq.js.map +0 -10
  355. package/dist/chunk-5t9gm5tt.js.map +0 -22
  356. package/dist/chunk-68hm50qh.js.map +0 -13
  357. package/dist/chunk-aw1z0gre.js +0 -234
  358. package/dist/chunk-aw1z0gre.js.map +0 -12
  359. package/dist/chunk-ey1p8w68.js.map +0 -13
  360. package/dist/chunk-k3jh8gsg.js.map +0 -10
  361. package/dist/chunk-qavwr628.js.map +0 -12
  362. package/dist/chunk-s1mqyqmm.js.map +0 -18
  363. package/dist/chunk-zeykm8my.js.map +0 -14
  364. /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
  365. /package/dist/{chunk-0mvjpgvm.js.map → chunk-425ydk65.js.map} +0 -0
  366. /package/dist/{chunk-s5pj68fa.js.map → chunk-5sswe5ej.js.map} +0 -0
  367. /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
  368. /package/dist/{chunk-naxjka9v.js.map → chunk-brhp9d97.js.map} +0 -0
  369. /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
  370. /package/dist/{chunk-vehcr9eb.js.map → chunk-cg7cygfj.js.map} +0 -0
  371. /package/dist/{chunk-r2psmn42.js.map → chunk-eg6xqef7.js.map} +0 -0
  372. /package/dist/{chunk-zxhym8tr.js.map → chunk-f05994as.js.map} +0 -0
  373. /package/dist/{chunk-1yh6jgtz.js.map → chunk-grt2j5vp.js.map} +0 -0
  374. /package/dist/{chunk-rtdrm592.js.map → chunk-htdzx40w.js.map} +0 -0
  375. /package/dist/{chunk-bc3y6gff.js.map → chunk-jka26v8c.js.map} +0 -0
  376. /package/dist/{chunk-pqvvqc65.js.map → chunk-pqj8vff9.js.map} +0 -0
  377. /package/dist/{chunk-wqe9shx2.js.map → chunk-qbd282aa.js.map} +0 -0
  378. /package/dist/{chunk-fzae1jpq.js.map → chunk-t19wjmnc.js.map} +0 -0
  379. /package/dist/{chunk-paxabbqd.js.map → chunk-tapdssb5.js.map} +0 -0
  380. /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
  381. /package/dist/{chunk-pc7kra3k.js.map → chunk-xavet0qs.js.map} +0 -0
  382. /package/dist/{chunk-0hkdtwqk.js.map → chunk-xf76csps.js.map} +0 -0
  383. /package/dist/{chunk-m9ketb51.js.map → chunk-ygvay56w.js.map} +0 -0
  384. /package/dist/{chunk-b4escq4c.js.map → chunk-ykchk644.js.map} +0 -0
  385. /package/dist/{chunk-k29n4176.js.map → chunk-ym1bqd98.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  principalsEqual2
4
- } from "./chunk-xcrnrpfh.js";
4
+ } from "./chunk-394zjzjs.js";
5
5
  import {
6
6
  createFileUploadId2,
7
7
  isFileUploadSessionExpired,
@@ -0,0 +1,114 @@
1
+ // @bun
2
+ // src/runtime/locale.ts
3
+ var DEFAULT_PROJECT_LOCALE = "en";
4
+ var DEFAULT_PROJECT_TIME_ZONE = "UTC";
5
+ function canonicalLocale(value) {
6
+ if (typeof value !== "string")
7
+ return;
8
+ try {
9
+ const [locale] = Intl.getCanonicalLocales(value);
10
+ return locale;
11
+ } catch {
12
+ return;
13
+ }
14
+ }
15
+
16
+ // src/calendar.ts
17
+ var MAX_PERIODS = 1e4;
18
+ var hourMs = 60 * 60 * 1000;
19
+ var dayMs = 24 * hourMs;
20
+ function canonicalTimeZone2(value) {
21
+ if (typeof value !== "string" || value.trim() !== value || value === "")
22
+ return;
23
+ let timeZone;
24
+ try {
25
+ timeZone = new Intl.DateTimeFormat("en-US", { timeZone: value }).resolvedOptions().timeZone;
26
+ } catch {
27
+ return;
28
+ }
29
+ return /^[+-]/.test(timeZone) ? undefined : timeZone;
30
+ }
31
+ var formatters = new Map;
32
+ function formatterFor(timeZone) {
33
+ let formatter = formatters.get(timeZone);
34
+ if (!formatter) {
35
+ formatter = new Intl.DateTimeFormat("en-US", {
36
+ timeZone,
37
+ year: "numeric",
38
+ month: "numeric",
39
+ day: "numeric",
40
+ hour: "numeric",
41
+ minute: "numeric",
42
+ second: "numeric",
43
+ hourCycle: "h23"
44
+ });
45
+ formatters.set(timeZone, formatter);
46
+ }
47
+ return formatter;
48
+ }
49
+ function wallClockOf(at, timeZone) {
50
+ const parts = formatterFor(timeZone).formatToParts(at);
51
+ const field = (type) => {
52
+ const part = parts.find((candidate) => candidate.type === type);
53
+ if (!part)
54
+ throw new TypeError(`[Sixb] ${timeZone} did not read back a ${type}.`);
55
+ return Number(part.value);
56
+ };
57
+ return Date.UTC(field("year"), field("month") - 1, field("day"), field("hour"), field("minute"), field("second"));
58
+ }
59
+ function offsetOf(at, timeZone) {
60
+ return wallClockOf(at, timeZone) - Math.floor(at.getTime() / 1000) * 1000;
61
+ }
62
+ function instantOf(wallClock, timeZone) {
63
+ const before = offsetOf(new Date(wallClock - dayMs), timeZone);
64
+ const after = offsetOf(new Date(wallClock + dayMs), timeZone);
65
+ if (before === after)
66
+ return new Date(wallClock - before);
67
+ const candidates = [wallClock - before, wallClock - after].sort((left, right) => left - right);
68
+ const found = candidates.find((instant) => wallClockOf(new Date(instant), timeZone) >= wallClock);
69
+ return new Date(found ?? candidates[candidates.length - 1]);
70
+ }
71
+ function wallClockAt2(at, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
72
+ return new Date(wallClockOf(at, timeZone)).toISOString();
73
+ }
74
+ function wallClockInstant2(wallClock, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
75
+ const wall = Date.parse(wallClock);
76
+ if (Number.isNaN(wall)) {
77
+ throw new TypeError(`[Sixb] ${JSON.stringify(wallClock)} is not a wall clock time.`);
78
+ }
79
+ return instantOf(wall, timeZone);
80
+ }
81
+ function periodWallClock(wallClock, period) {
82
+ if (period === "hour")
83
+ return wallClock - wallClock % hourMs;
84
+ const midnight = wallClock - wallClock % dayMs;
85
+ if (period === "day")
86
+ return midnight;
87
+ const mondayOffset = (new Date(midnight).getUTCDay() + 6) % 7;
88
+ return midnight - mondayOffset * dayMs;
89
+ }
90
+ function calendarPeriodStart2(at, period, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
91
+ return instantOf(periodWallClock(wallClockOf(at, timeZone), period), timeZone);
92
+ }
93
+ function addCalendarPeriods2(at, period, count, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
94
+ const step = period === "hour" ? hourMs : period === "week" ? 7 * dayMs : dayMs;
95
+ const start = periodWallClock(wallClockOf(at, timeZone), period);
96
+ return instantOf(start + count * step, timeZone);
97
+ }
98
+ function calendarPeriods2(from, to, period, timeZone = DEFAULT_PROJECT_TIME_ZONE) {
99
+ const periods = [];
100
+ let start = calendarPeriodStart2(from, period, timeZone);
101
+ while (start.getTime() < to.getTime()) {
102
+ if (periods.length >= MAX_PERIODS) {
103
+ throw new RangeError(`[Sixb] The range holds more than ${MAX_PERIODS} ${period} periods.`);
104
+ }
105
+ const end = addCalendarPeriods2(start, period, 1, timeZone);
106
+ periods.push({ start, end });
107
+ start = end;
108
+ }
109
+ return periods;
110
+ }
111
+
112
+ export { DEFAULT_PROJECT_LOCALE, DEFAULT_PROJECT_TIME_ZONE, canonicalLocale, canonicalTimeZone2, wallClockAt2, wallClockInstant2, calendarPeriodStart2, addCalendarPeriods2, calendarPeriods2 };
113
+
114
+ //# debugId=B253CA3F513E540B64756E2164756E21
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/runtime/locale.ts", "../src/calendar.ts"],
4
+ "sourcesContent": [
5
+ "/** Language assumed when a project sets none. */\nexport const DEFAULT_PROJECT_LOCALE = \"en\"\n\n/** Time zone assumed when a project sets none; cron schedules have always used it. */\nexport const DEFAULT_PROJECT_TIME_ZONE = \"UTC\"\n\n/** The canonical form of a BCP 47 language tag (`fr-fr` → `fr-FR`), or `undefined` if invalid. */\nexport function canonicalLocale(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined\n try {\n const [locale] = Intl.getCanonicalLocales(value)\n return locale\n } catch {\n return undefined\n }\n}\n",
6
+ "/**\n * Calendar arithmetic in an IANA time zone.\n *\n * A period of a zone's calendar is not a fixed number of milliseconds: where a zone changes its\n * clocks a day lasts 23 or 25 hours, and a zone such as Asia/Kolkata starts its hours half past a\n * UTC hour. Usage buckets are whole periods of the reader's calendar, so the queried range, the\n * bars and the calls in them all go through these functions.\n *\n * It is `@sixb/core/calendar` rather than `internal/*` because `@sixb/app` draws the bars with it,\n * and the app installs core by a compatible range, which `internal/*` refuses. It is not part of\n * the documented API: export only what the app calls.\n */\n\nimport { DEFAULT_PROJECT_TIME_ZONE } from \"./runtime/locale\"\n\n/** An hour, a day, or a week starting Monday: the periods a usage chart is drawn in. */\nexport type CalendarPeriod = \"hour\" | \"day\" | \"week\"\n\n/** A period of the calendar: a start and the start of the one after it. */\nexport interface CalendarPeriodRange {\n readonly start: Date\n readonly end: Date\n}\n\n/** A period wider than this many is a caller's mistake, not a chart. */\nconst MAX_PERIODS = 10_000\n\nconst hourMs = 60 * 60 * 1000\nconst dayMs = 24 * hourMs\n\n/**\n * The canonical IANA name of a time zone (`europe/paris` → `Europe/Paris`), or `undefined`.\n *\n * A UTC offset such as `+05:30` is refused even where `Intl` takes it: it names no zone, and\n * PostgreSQL reads it the POSIX way, five and a half hours west of UTC.\n */\nexport function canonicalTimeZone(value: unknown): string | undefined {\n if (typeof value !== \"string\" || value.trim() !== value || value === \"\") return undefined\n let timeZone: string\n try {\n timeZone = new Intl.DateTimeFormat(\"en-US\", { timeZone: value }).resolvedOptions().timeZone\n } catch {\n return undefined\n }\n return /^[+-]/.test(timeZone) ? undefined : timeZone\n}\n\n// Buckets are formatted for every call and every period of a range, so one formatter per zone is\n// built once: constructing one costs more than reading several of them.\nconst formatters = new Map<string, Intl.DateTimeFormat>()\n\nfunction formatterFor(timeZone: string): Intl.DateTimeFormat {\n let formatter = formatters.get(timeZone)\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(\"en-US\", {\n timeZone,\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n hourCycle: \"h23\",\n })\n formatters.set(timeZone, formatter)\n }\n return formatter\n}\n\n/** The zone's wall clock at an instant, as the milliseconds `Date.UTC` gives for its fields. */\nfunction wallClockOf(at: Date, timeZone: string): number {\n const parts = formatterFor(timeZone).formatToParts(at)\n const field = (type: Intl.DateTimeFormatPartTypes) => {\n const part = parts.find((candidate) => candidate.type === type)\n if (!part) throw new TypeError(`[Sixb] ${timeZone} did not read back a ${type}.`)\n return Number(part.value)\n }\n return Date.UTC(\n field(\"year\"),\n field(\"month\") - 1,\n field(\"day\"),\n field(\"hour\"),\n field(\"minute\"),\n field(\"second\")\n )\n}\n\n/** How far the zone's wall clock runs ahead of UTC at an instant. */\nfunction offsetOf(at: Date, timeZone: string): number {\n return wallClockOf(at, timeZone) - Math.floor(at.getTime() / 1000) * 1000\n}\n\n/**\n * The instant a zone's wall clock reads `wallClock`.\n *\n * A wall clock the zone skips is met at the jump that skipped it, and one it reads twice starts the\n * period at its first reading, so periods stay in order and whole.\n */\nfunction instantOf(wallClock: number, timeZone: string): Date {\n const before = offsetOf(new Date(wallClock - dayMs), timeZone)\n const after = offsetOf(new Date(wallClock + dayMs), timeZone)\n if (before === after) return new Date(wallClock - before)\n const candidates = [wallClock - before, wallClock - after].sort((left, right) => left - right)\n const found = candidates.find((instant) => wallClockOf(new Date(instant), timeZone) >= wallClock)\n return new Date(found ?? candidates[candidates.length - 1]!)\n}\n\n/**\n * The zone's wall clock at an instant, spelled as `wallClockInstant` reads it back:\n * `2026-11-14T05:00:00.000Z` in America/New_York is `2026-11-14T00:00:00.000Z`.\n */\nexport function wallClockAt(at: Date, timeZone = DEFAULT_PROJECT_TIME_ZONE): string {\n return new Date(wallClockOf(at, timeZone)).toISOString()\n}\n\n/**\n * The instant a zone's wall clock names.\n *\n * `wallClock` is an ISO 8601 string whose `Z` marks the wall clock rather than UTC, as a provider\n * reads it out of a query without a time zone: `2026-11-14T00:00:00Z` is midnight in the zone.\n */\nexport function wallClockInstant(wallClock: string, timeZone = DEFAULT_PROJECT_TIME_ZONE): Date {\n const wall = Date.parse(wallClock)\n if (Number.isNaN(wall)) {\n throw new TypeError(`[Sixb] ${JSON.stringify(wallClock)} is not a wall clock time.`)\n }\n return instantOf(wall, timeZone)\n}\n\n/**\n * The wall clock a period of the calendar is named by: its hour, its midnight, or its Monday's.\n *\n * It is the name even where the zone skips it, so a period that began at the jump still steps to\n * the next midnight rather than to the next 1 am.\n */\nfunction periodWallClock(wallClock: number, period: CalendarPeriod): number {\n if (period === \"hour\") return wallClock - (wallClock % hourMs)\n const midnight = wallClock - (wallClock % dayMs)\n if (period === \"day\") return midnight\n\n // Weeks begin on Monday, which is what a date truncated to its week gives everywhere else.\n const mondayOffset = (new Date(midnight).getUTCDay() + 6) % 7\n return midnight - mondayOffset * dayMs\n}\n\n/** The start of the period an instant falls in, on the zone's calendar. */\nexport function calendarPeriodStart(\n at: Date,\n period: CalendarPeriod,\n timeZone = DEFAULT_PROJECT_TIME_ZONE\n): Date {\n return instantOf(periodWallClock(wallClockOf(at, timeZone), period), timeZone)\n}\n\n/**\n * The start of the period `count` periods away from the one `at` falls in.\n *\n * Stepping the zone's wall clock keeps every period whole across a change of clocks, where adding\n * milliseconds would land an hour off a boundary.\n */\nexport function addCalendarPeriods(\n at: Date,\n period: CalendarPeriod,\n count: number,\n timeZone = DEFAULT_PROJECT_TIME_ZONE\n): Date {\n const step = period === \"hour\" ? hourMs : period === \"week\" ? 7 * dayMs : dayMs\n const start = periodWallClock(wallClockOf(at, timeZone), period)\n return instantOf(start + count * step, timeZone)\n}\n\n/**\n * Every period of [from, to), starting with the one `from` falls in.\n *\n * A wall clock the zone skips begins its period where the clocks jump, which keeps the periods\n * contiguous through the hour the zone never had.\n */\nexport function calendarPeriods(\n from: Date,\n to: Date,\n period: CalendarPeriod,\n timeZone = DEFAULT_PROJECT_TIME_ZONE\n): readonly CalendarPeriodRange[] {\n const periods: CalendarPeriodRange[] = []\n let start = calendarPeriodStart(from, period, timeZone)\n while (start.getTime() < to.getTime()) {\n if (periods.length >= MAX_PERIODS) {\n throw new RangeError(`[Sixb] The range holds more than ${MAX_PERIODS} ${period} periods.`)\n }\n const end = addCalendarPeriods(start, period, 1, timeZone)\n periods.push({ start, end })\n start = end\n }\n return periods\n}\n"
7
+ ],
8
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}
@@ -3,7 +3,7 @@ import {
3
3
  SandboxError2,
4
4
  staticSandboxRecipe2,
5
5
  captureEnvironment
6
- } from "./chunk-rtdrm592.js";
6
+ } from "./chunk-htdzx40w.js";
7
7
 
8
8
  // src/sandboxes/config.ts
9
9
  function sandboxConfig2(options) {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  boardRenderKey
4
- } from "./chunk-m3qx2pns.js";
4
+ } from "./chunk-jt012fxq.js";
5
5
 
6
6
  // src/artifacts/live/presence.ts
7
7
  var ARTIFACT_LIVE_RETENTION = { maxAgeMs: 10 * 60000, maxRecords: 5000 };
@@ -9,7 +9,7 @@ import {
9
9
  assertAuthorized2,
10
10
  isRuntimeAllowed2,
11
11
  assertRuntimeAuthorizationBound2
12
- } from "./chunk-paxabbqd.js";
12
+ } from "./chunk-tapdssb5.js";
13
13
  import {
14
14
  isUserRef,
15
15
  isUserRefPropertySchema
@@ -22,21 +22,21 @@ import {
22
22
  normalizeSchemaValue2,
23
23
  uniqueValueKind,
24
24
  uniqueValueKey
25
- } from "./chunk-3zagkr6w.js";
25
+ } from "./chunk-7mhbs9yy.js";
26
26
  import {
27
27
  unreadableError,
28
28
  resolvePropertyClearance
29
- } from "./chunk-s5pj68fa.js";
29
+ } from "./chunk-5sswe5ej.js";
30
30
  import {
31
31
  composeObjectQueryAdmissions,
32
32
  validateObjectQuery2,
33
33
  validateObjectQueryWithAdmission,
34
34
  viewConditionReadCondition,
35
35
  toUserProfile
36
- } from "./chunk-xcrnrpfh.js";
36
+ } from "./chunk-394zjzjs.js";
37
37
  import {
38
38
  snapshotVectorProfiles
39
- } from "./chunk-dhkc9b23.js";
39
+ } from "./chunk-v8a1qjzp.js";
40
40
  import {
41
41
  userExpansionPlan,
42
42
  executeObjectQuery2,
@@ -46,7 +46,7 @@ import {
46
46
  validateObjectFacetRequests,
47
47
  preflightObjectQueryLinks,
48
48
  executeObjectQueryLinks2
49
- } from "./chunk-s1mqyqmm.js";
49
+ } from "./chunk-bs1sd0e0.js";
50
50
  import {
51
51
  ObjectQueryValidationError2,
52
52
  normalizeObjectQuery2
@@ -226,7 +226,7 @@ function assertLinkQueryReadable(input) {
226
226
  const { types, links } = clearance.unreadable();
227
227
  if (types.size === 0 && links.length === 0)
228
228
  return;
229
- const preflight = preflightObjectQueryLinks({ ...input.request, query: input.query }, { ontology });
229
+ const preflight = preflightObjectQueryLinks({ ...input.request, query: input.query }, { ontology, discovery: input.discovery });
230
230
  const selected = preflight.validated.result.objectTypeIds;
231
231
  const outgoing = preflight.direction !== "incoming";
232
232
  const incoming = preflight.direction !== "outgoing";
@@ -634,10 +634,14 @@ function unknownObjectType(objectTypeId) {
634
634
  // src/execution/object-reader-ontology.ts
635
635
  class ObjectReaderOntology {
636
636
  registry;
637
+ discovery;
637
638
  #security;
638
639
  #view;
639
640
  constructor(registry, security) {
640
641
  this.registry = registry;
642
+ this.discovery = {
643
+ getObjectTypeById: (objectTypeId) => this.view().getObjectTypeById(objectTypeId)
644
+ };
641
645
  this.#security = security;
642
646
  Object.freeze(this);
643
647
  }
@@ -1171,6 +1175,9 @@ class AuthorizedObjectReaderImpl {
1171
1175
  static ontologyView(reader) {
1172
1176
  return reader.#ontology.view();
1173
1177
  }
1178
+ static queryDiscovery(reader) {
1179
+ return reader.#ontology.discovery;
1180
+ }
1174
1181
  get projectId() {
1175
1182
  return this.#security.runtime.projectId;
1176
1183
  }
@@ -1338,8 +1345,12 @@ class AuthorizedObjectReaderImpl {
1338
1345
  let executionQuery = query;
1339
1346
  const admission = this.#security.delegation?.queryAdmission;
1340
1347
  if (admission) {
1341
- const preflight = preflightObjectQueryLinks({ query, ...request, projectId: this.#security.runtime.projectId }, { ontology: this.#ontology.registry });
1342
- const admitted = validateObjectQueryWithAdmission(preflight.validated.query, { ontology: this.#ontology.registry, normalize: false }, admission);
1348
+ const preflight = preflightObjectQueryLinks({ query, ...request, projectId: this.#security.runtime.projectId }, { ontology: this.#ontology.registry, discovery: this.#ontology.discovery });
1349
+ const admitted = validateObjectQueryWithAdmission(preflight.validated.query, {
1350
+ ontology: this.#ontology.registry,
1351
+ discovery: this.#ontology.discovery,
1352
+ normalize: false
1353
+ }, admission);
1343
1354
  admission.assertIncidentEdgeSelected({
1344
1355
  state: admitted.admissionState,
1345
1356
  ...preflight.linkId === undefined ? {} : { linkId: preflight.linkId },
@@ -1352,6 +1363,7 @@ class AuthorizedObjectReaderImpl {
1352
1363
  if (clearance) {
1353
1364
  assertLinkQueryReadable({
1354
1365
  ontology: this.#ontology.registry,
1366
+ discovery: this.#ontology.discovery,
1355
1367
  clearance,
1356
1368
  query,
1357
1369
  request: { ...request, projectId: this.#security.runtime.projectId },
@@ -1386,11 +1398,18 @@ class AuthorizedObjectReaderImpl {
1386
1398
  let executionFacets = facets;
1387
1399
  const admission = this.#security.delegation?.queryAdmission;
1388
1400
  if (admission) {
1389
- const validated = validateObjectQuery2(query, { ontology: this.#ontology.registry });
1401
+ const validated = validateObjectQuery2(query, {
1402
+ ontology: this.#ontology.registry,
1403
+ discovery: this.#ontology.discovery
1404
+ });
1390
1405
  const normalizedFacets = validateObjectFacetRequests(facets, validated.result.objectTypeIds, {
1391
1406
  ontology: this.#ontology.registry
1392
1407
  });
1393
- const admitted = validateObjectQueryWithAdmission(validated.query, { ontology: this.#ontology.registry, normalize: false }, admission);
1408
+ const admitted = validateObjectQueryWithAdmission(validated.query, {
1409
+ ontology: this.#ontology.registry,
1410
+ discovery: this.#ontology.discovery,
1411
+ normalize: false
1412
+ }, admission);
1394
1413
  normalizedFacets.forEach((facet, index) => {
1395
1414
  admission.assertPropertySelected({
1396
1415
  state: admitted.admissionState,
@@ -1451,6 +1470,7 @@ class AuthorizedObjectReaderImpl {
1451
1470
  if (this.#security.authority.type === "delegated") {
1452
1471
  return {
1453
1472
  ontology: this.#ontology.registry,
1473
+ discovery: this.#ontology.discovery,
1454
1474
  storage: this.#storage,
1455
1475
  embeddingModels: this.#models.embedding,
1456
1476
  rerankingModels: this.#models.reranking,
@@ -1460,6 +1480,7 @@ class AuthorizedObjectReaderImpl {
1460
1480
  }
1461
1481
  return {
1462
1482
  ontology: this.#ontology.registry,
1483
+ discovery: this.#ontology.discovery,
1463
1484
  embeddingModels: this.#models.embedding,
1464
1485
  rerankingModels: this.#models.reranking,
1465
1486
  storage: this.#storage,
@@ -1527,7 +1548,7 @@ class AuthorizedObjectReaderImpl {
1527
1548
  const admission = this.#security.delegation?.queryAdmission;
1528
1549
  if (!admission)
1529
1550
  return;
1530
- return validateObjectQueryWithAdmission(query, { ontology: this.#ontology.registry }, admission);
1551
+ return validateObjectQueryWithAdmission(query, { ontology: this.#ontology.registry, discovery: this.#ontology.discovery }, admission);
1531
1552
  }
1532
1553
  #resolveListObjectTypes(requested, clearance) {
1533
1554
  if (requested !== undefined) {
@@ -1580,6 +1601,9 @@ function objectReadersIn(reader) {
1580
1601
  function getAuthorizedOntologyView(reader) {
1581
1602
  return AuthorizedObjectReaderImpl.ontologyView(reader);
1582
1603
  }
1604
+ function getQueryDiscovery(reader) {
1605
+ return AuthorizedObjectReaderImpl.queryDiscovery(reader);
1606
+ }
1583
1607
  function readerClearance(reader) {
1584
1608
  return AuthorizedObjectReaderImpl.clearance(reader);
1585
1609
  }
@@ -1720,6 +1744,6 @@ function snapshotAuthoredQuery(query) {
1720
1744
  }
1721
1745
  }
1722
1746
 
1723
- export { redactDomainEvent, uniqueLookupKeyOf, createAuthorizedObjectReader, assertAuthorizedObjectReaderBinding, objectReadersIn, getAuthorizedOntologyView, readerClearance, readerEventClearance, readerViewConditions };
1747
+ export { redactDomainEvent, uniqueLookupKeyOf, createAuthorizedObjectReader, assertAuthorizedObjectReaderBinding, objectReadersIn, getAuthorizedOntologyView, getQueryDiscovery, readerClearance, readerEventClearance, readerViewConditions };
1724
1748
 
1725
- //# debugId=0E3DAEAC9E65D53164756E2164756E21
1749
+ //# debugId=F8085DFB6C57622C64756E2164756E21