@sixb/core 0.1.17 → 0.1.18

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 (454) hide show
  1. package/dist/actions/index.js +22 -19
  2. package/dist/actions/index.js.map +1 -1
  3. package/dist/actions/read-facade.d.ts +1 -1
  4. package/dist/actions/validation.d.ts.map +1 -1
  5. package/dist/actions/worker.js +6 -2
  6. package/dist/actions/worker.js.map +3 -3
  7. package/dist/agents/adapters.d.ts +7 -0
  8. package/dist/agents/adapters.d.ts.map +1 -1
  9. package/dist/agents/authority.d.ts +7 -0
  10. package/dist/agents/authority.d.ts.map +1 -1
  11. package/dist/agents/context/entries.d.ts +10 -1
  12. package/dist/agents/context/entries.d.ts.map +1 -1
  13. package/dist/agents/context/index.d.ts +1 -1
  14. package/dist/agents/context/index.d.ts.map +1 -1
  15. package/dist/agents/context/index.js +4 -2
  16. package/dist/agents/context/index.js.map +1 -1
  17. package/dist/agents/context-compaction.d.ts.map +1 -1
  18. package/dist/agents/errors.d.ts +1 -1
  19. package/dist/agents/errors.d.ts.map +1 -1
  20. package/dist/agents/index.d.ts +6 -4
  21. package/dist/agents/index.d.ts.map +1 -1
  22. package/dist/agents/index.js +44 -37
  23. package/dist/agents/index.js.map +1 -1
  24. package/dist/agents/message.d.ts +8 -1
  25. package/dist/agents/message.d.ts.map +1 -1
  26. package/dist/agents/request.d.ts +19 -5
  27. package/dist/agents/request.d.ts.map +1 -1
  28. package/dist/agents/skills.d.ts +41 -0
  29. package/dist/agents/skills.d.ts.map +1 -0
  30. package/dist/agents/streams/index.js +1 -1
  31. package/dist/agents/streams/internal.js +1 -1
  32. package/dist/agents/types.d.ts +33 -4
  33. package/dist/agents/types.d.ts.map +1 -1
  34. package/dist/auth/index.js +9 -6
  35. package/dist/auth/index.js.map +1 -1
  36. package/dist/auth/runtime.d.ts.map +1 -1
  37. package/dist/auth/types.d.ts +6 -0
  38. package/dist/auth/types.d.ts.map +1 -1
  39. package/dist/authorization/index.js +5 -3
  40. package/dist/authorization/index.js.map +1 -1
  41. package/dist/authorization/resolve.d.ts +1 -1
  42. package/dist/authorization/resolve.d.ts.map +1 -1
  43. package/dist/authorization/types.d.ts +7 -0
  44. package/dist/authorization/types.d.ts.map +1 -1
  45. package/dist/blob-storage/browser.js +1 -1
  46. package/dist/blob-storage/execution.d.ts.map +1 -1
  47. package/dist/blob-storage/file-content.d.ts +18 -0
  48. package/dist/blob-storage/file-content.d.ts.map +1 -0
  49. package/dist/blob-storage/index.d.ts +1 -1
  50. package/dist/blob-storage/index.d.ts.map +1 -1
  51. package/dist/blob-storage/index.js +2 -2
  52. package/dist/blob-storage/internal.d.ts +2 -0
  53. package/dist/blob-storage/internal.d.ts.map +1 -1
  54. package/dist/blob-storage/internal.js +16 -4
  55. package/dist/blob-storage/internal.js.map +1 -1
  56. package/dist/blob-storage/media-type.d.ts +8 -0
  57. package/dist/blob-storage/media-type.d.ts.map +1 -0
  58. package/dist/blob-storage/types.d.ts +12 -1
  59. package/dist/blob-storage/types.d.ts.map +1 -1
  60. package/dist/blob-storage/validation.d.ts +6 -0
  61. package/dist/blob-storage/validation.d.ts.map +1 -1
  62. package/dist/bootstrap/agent-context.d.ts +33 -0
  63. package/dist/bootstrap/agent-context.d.ts.map +1 -0
  64. package/dist/bootstrap/discovery.d.ts +23 -3
  65. package/dist/bootstrap/discovery.d.ts.map +1 -1
  66. package/dist/bootstrap/index.d.ts +2 -1
  67. package/dist/bootstrap/index.d.ts.map +1 -1
  68. package/dist/bootstrap/index.js +284 -73
  69. package/dist/bootstrap/index.js.map +4 -3
  70. package/dist/bootstrap/ontology-type-manifest.d.ts.map +1 -1
  71. package/dist/{chunk-gf7yht60.js → chunk-1b1f2d5f.js} +23 -6
  72. package/dist/chunk-1b1f2d5f.js.map +12 -0
  73. package/dist/{chunk-9vx5e9g1.js → chunk-1sr8ryzk.js} +3 -3
  74. package/dist/chunk-1sr8ryzk.js.map +11 -0
  75. package/dist/{chunk-4gmng3vf.js → chunk-22v5bpz3.js} +1 -1
  76. package/dist/{chunk-s7ftxrdr.js → chunk-29yx306f.js} +20 -3
  77. package/dist/{chunk-s7ftxrdr.js.map → chunk-29yx306f.js.map} +3 -3
  78. package/dist/{chunk-4ra628t7.js → chunk-3zxk45er.js} +70 -6
  79. package/dist/{chunk-4ra628t7.js.map → chunk-3zxk45er.js.map} +5 -4
  80. package/dist/{chunk-2am3db31.js → chunk-48e3cn2d.js} +2 -2
  81. package/dist/{chunk-91kcnbf0.js → chunk-6gmfggss.js} +22 -9
  82. package/dist/chunk-6gmfggss.js.map +10 -0
  83. package/dist/{chunk-svabwqdq.js → chunk-6h5m9xjx.js} +43 -415
  84. package/dist/{chunk-svabwqdq.js.map → chunk-6h5m9xjx.js.map} +7 -11
  85. package/dist/{chunk-f1xh7a32.js → chunk-7hpdd6r9.js} +2 -2
  86. package/dist/{chunk-xyvy73tj.js → chunk-bs7sqkre.js} +8 -3
  87. package/dist/chunk-bs7sqkre.js.map +12 -0
  88. package/dist/{chunk-rb143ggb.js → chunk-bwjcehza.js} +1 -1
  89. package/dist/{chunk-t9shqx3w.js → chunk-d0eb5yy6.js} +143 -7
  90. package/dist/chunk-d0eb5yy6.js.map +14 -0
  91. package/dist/{chunk-vp3z1ckh.js → chunk-de4z2bj6.js} +5 -5
  92. package/dist/{chunk-3rrezgyc.js → chunk-dnmadg9k.js} +2 -2
  93. package/dist/chunk-enpsx8k5.js +127 -0
  94. package/dist/chunk-enpsx8k5.js.map +10 -0
  95. package/dist/{chunk-a7er86jd.js → chunk-ex496vct.js} +1 -1
  96. package/dist/{chunk-jnfxmr3f.js → chunk-f1zxad2t.js} +1 -1
  97. package/dist/{chunk-6wbm6ymz.js → chunk-fe52eczz.js} +271 -83
  98. package/dist/chunk-fe52eczz.js.map +49 -0
  99. package/dist/{chunk-10styjgk.js → chunk-fx93hd2n.js} +71 -29
  100. package/dist/chunk-fx93hd2n.js.map +20 -0
  101. package/dist/{chunk-9se093qz.js → chunk-gc4ntf7d.js} +4 -4
  102. package/dist/{chunk-9se093qz.js.map → chunk-gc4ntf7d.js.map} +1 -1
  103. package/dist/{chunk-98cw09sw.js → chunk-hkc3jct7.js} +4 -2
  104. package/dist/chunk-hkc3jct7.js.map +10 -0
  105. package/dist/{chunk-pja9jfz6.js → chunk-htr6wjmv.js} +115 -53
  106. package/dist/chunk-htr6wjmv.js.map +19 -0
  107. package/dist/{chunk-h3v76ams.js → chunk-jhm3zsa7.js} +25 -2
  108. package/dist/chunk-jhm3zsa7.js.map +12 -0
  109. package/dist/{chunk-52c5zb0z.js → chunk-k6hrnf35.js} +5 -5
  110. package/dist/chunk-k6hrnf35.js.map +10 -0
  111. package/dist/{chunk-c2rga5cx.js → chunk-mfs23znk.js} +1 -1
  112. package/dist/{chunk-7ecp4v7a.js → chunk-ny3xyvcn.js} +8 -2
  113. package/dist/{chunk-7ecp4v7a.js.map → chunk-ny3xyvcn.js.map} +3 -3
  114. package/dist/{chunk-fggq3d9k.js → chunk-p0dqwj3n.js} +5 -5
  115. package/dist/{chunk-cnb5kv05.js → chunk-p844e0rn.js} +23 -8
  116. package/dist/chunk-p844e0rn.js.map +19 -0
  117. package/dist/{chunk-dmn70ztd.js → chunk-pfp1txq2.js} +25 -6
  118. package/dist/chunk-pfp1txq2.js.map +11 -0
  119. package/dist/chunk-pqajwytd.js.map +2 -2
  120. package/dist/{chunk-5be2ath4.js → chunk-qkbx3tf6.js} +17 -128
  121. package/dist/{chunk-5be2ath4.js.map → chunk-qkbx3tf6.js.map} +6 -7
  122. package/dist/{chunk-sk0hcjsz.js → chunk-qkvz64nd.js} +2 -2
  123. package/dist/{chunk-w9yycd3t.js → chunk-qmnnhde6.js} +4 -8
  124. package/dist/{chunk-w9yycd3t.js.map → chunk-qmnnhde6.js.map} +3 -3
  125. package/dist/{chunk-5yd8cchh.js → chunk-qq90g05n.js} +8 -8
  126. package/dist/{chunk-5yd8cchh.js.map → chunk-qq90g05n.js.map} +1 -1
  127. package/dist/{chunk-tjjgy3z4.js → chunk-qxvp5epv.js} +66 -14
  128. package/dist/{chunk-tjjgy3z4.js.map → chunk-qxvp5epv.js.map} +9 -8
  129. package/dist/chunk-rdghfsss.js.map +2 -2
  130. package/dist/{chunk-rx7h5fdx.js → chunk-rt9p8m9t.js} +1 -1
  131. package/dist/{chunk-cd234ba4.js → chunk-rz53yb4v.js} +10 -5
  132. package/dist/chunk-rz53yb4v.js.map +14 -0
  133. package/dist/{chunk-xcy5ddha.js → chunk-s4jhg8a3.js} +351 -296
  134. package/dist/chunk-s4jhg8a3.js.map +15 -0
  135. package/dist/{chunk-69266efg.js → chunk-s54c868q.js} +12 -4
  136. package/dist/chunk-s54c868q.js.map +12 -0
  137. package/dist/{chunk-9g6jz9kk.js → chunk-tffvfy6s.js} +6 -5
  138. package/dist/{chunk-9g6jz9kk.js.map → chunk-tffvfy6s.js.map} +3 -3
  139. package/dist/{chunk-e67ynxcr.js → chunk-v6xpd60t.js} +3 -3
  140. package/dist/{chunk-jjrn5v0p.js → chunk-vgk3hknm.js} +1 -1
  141. package/dist/{chunk-5thzcb8g.js → chunk-vx2yp45y.js} +2 -2
  142. package/dist/{chunk-dam456ve.js → chunk-vz3gc1tm.js} +394 -31
  143. package/dist/{chunk-dam456ve.js.map → chunk-vz3gc1tm.js.map} +10 -7
  144. package/dist/chunk-xt1zt7gv.js +471 -0
  145. package/dist/chunk-xt1zt7gv.js.map +13 -0
  146. package/dist/{chunk-rpxz486p.js → chunk-y05543x6.js} +21 -5
  147. package/dist/{chunk-rpxz486p.js.map → chunk-y05543x6.js.map} +3 -3
  148. package/dist/{chunk-aq39q04r.js → chunk-y9jmd7e5.js} +4 -4
  149. package/dist/{chunk-aq39q04r.js.map → chunk-y9jmd7e5.js.map} +1 -1
  150. package/dist/{chunk-k4g51s47.js → chunk-yv9czyfr.js} +3 -3
  151. package/dist/{chunk-z5rnrmz1.js → chunk-yw9pyg66.js} +5 -3
  152. package/dist/chunk-yw9pyg66.js.map +11 -0
  153. package/dist/{chunk-vre348sb.js → chunk-za5yd58j.js} +2 -2
  154. package/dist/{chunk-23xs4qp9.js → chunk-zb77kjth.js} +3 -3
  155. package/dist/{chunk-33saed7g.js → chunk-zxawp1n2.js} +1 -1
  156. package/dist/datasets/builders.d.ts +12 -1
  157. package/dist/datasets/builders.d.ts.map +1 -1
  158. package/dist/datasets/execution.d.ts +27 -1
  159. package/dist/datasets/execution.d.ts.map +1 -1
  160. package/dist/datasets/index.d.ts +1 -1
  161. package/dist/datasets/index.d.ts.map +1 -1
  162. package/dist/datasets/types.d.ts +2 -0
  163. package/dist/datasets/types.d.ts.map +1 -1
  164. package/dist/datasets/write.d.ts +5 -0
  165. package/dist/datasets/write.d.ts.map +1 -1
  166. package/dist/datasets/write.js +10 -5
  167. package/dist/datasets/write.js.map +1 -1
  168. package/dist/edits/properties.d.ts.map +1 -1
  169. package/dist/events/execution.d.ts +2 -1
  170. package/dist/events/execution.d.ts.map +1 -1
  171. package/dist/events/types/objects.d.ts +5 -0
  172. package/dist/events/types/objects.d.ts.map +1 -1
  173. package/dist/execution/agent.d.ts +10 -0
  174. package/dist/execution/agent.d.ts.map +1 -1
  175. package/dist/execution/agent.js +39 -34
  176. package/dist/execution/agent.js.map +1 -1
  177. package/dist/execution/authorized-object-reader.d.ts +6 -1
  178. package/dist/execution/authorized-object-reader.d.ts.map +1 -1
  179. package/dist/execution/primitive.js +37 -34
  180. package/dist/execution/primitive.js.map +2 -2
  181. package/dist/execution/request.js +38 -35
  182. package/dist/execution/request.js.map +2 -2
  183. package/dist/http/api-routes.d.ts.map +1 -1
  184. package/dist/http/index.js +1 -1
  185. package/dist/index.d.ts +9 -8
  186. package/dist/index.d.ts.map +1 -1
  187. package/dist/index.js +57 -52
  188. package/dist/index.js.map +1 -1
  189. package/dist/lake-storage/index.js +8 -5
  190. package/dist/lake-storage/index.js.map +1 -1
  191. package/dist/materializer/index.js +19 -16
  192. package/dist/materializer/index.js.map +1 -1
  193. package/dist/models/catalog.d.ts +1 -1
  194. package/dist/models/catalog.d.ts.map +1 -1
  195. package/dist/models/execution/binding.d.ts +6 -0
  196. package/dist/models/execution/binding.d.ts.map +1 -1
  197. package/dist/models/execution/index.js +19 -16
  198. package/dist/models/execution/index.js.map +1 -1
  199. package/dist/models/execution/model-call-recorder.d.ts +4 -0
  200. package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
  201. package/dist/models/execution.d.ts.map +1 -1
  202. package/dist/models/index.js +1 -1
  203. package/dist/models/language-model.d.ts +6 -0
  204. package/dist/models/language-model.d.ts.map +1 -1
  205. package/dist/objects/context/index.d.ts +1 -1
  206. package/dist/objects/context/index.d.ts.map +1 -1
  207. package/dist/objects/context/types.d.ts +6 -0
  208. package/dist/objects/context/types.d.ts.map +1 -1
  209. package/dist/objects/execution.d.ts +2 -1
  210. package/dist/objects/execution.d.ts.map +1 -1
  211. package/dist/objects/index.js +23 -19
  212. package/dist/objects/index.js.map +1 -1
  213. package/dist/objects/materializer-adapter.d.ts.map +1 -1
  214. package/dist/objects/object/upsert-batch.d.ts.map +1 -1
  215. package/dist/objects/object/upsert.d.ts.map +1 -1
  216. package/dist/objects/property-clearance.d.ts +41 -0
  217. package/dist/objects/property-clearance.d.ts.map +1 -0
  218. package/dist/objects/query/executor.d.ts +3 -0
  219. package/dist/objects/query/executor.d.ts.map +1 -1
  220. package/dist/objects/query/index.js +18 -15
  221. package/dist/objects/query/index.js.map +1 -1
  222. package/dist/objects/query/validate.d.ts +10 -1
  223. package/dist/objects/query/validate.d.ts.map +1 -1
  224. package/dist/objects/sdk/file-handle.d.ts +6 -0
  225. package/dist/objects/sdk/file-handle.d.ts.map +1 -0
  226. package/dist/objects/sdk/object-handle.d.ts +2 -2
  227. package/dist/objects/sdk/object-handle.d.ts.map +1 -1
  228. package/dist/objects/sdk/object-set.d.ts +2 -0
  229. package/dist/objects/sdk/object-set.d.ts.map +1 -1
  230. package/dist/ontology/builders.d.ts +12 -1
  231. package/dist/ontology/builders.d.ts.map +1 -1
  232. package/dist/ontology/docs-markdown.d.ts +35 -0
  233. package/dist/ontology/docs-markdown.d.ts.map +1 -0
  234. package/dist/ontology/docs.d.ts +50 -0
  235. package/dist/ontology/docs.d.ts.map +1 -0
  236. package/dist/ontology/index.js +7 -4
  237. package/dist/ontology/index.js.map +1 -1
  238. package/dist/ontology/inference/index.d.ts +19 -0
  239. package/dist/ontology/inference/index.d.ts.map +1 -1
  240. package/dist/ontology/internal.d.ts +3 -1
  241. package/dist/ontology/internal.d.ts.map +1 -1
  242. package/dist/ontology/internal.js +276 -3
  243. package/dist/ontology/internal.js.map +4 -3
  244. package/dist/ontology/tokens.d.ts +8 -1
  245. package/dist/ontology/tokens.d.ts.map +1 -1
  246. package/dist/ontology/types.d.ts +5 -0
  247. package/dist/ontology/types.d.ts.map +1 -1
  248. package/dist/ontology/validation/index.d.ts +1 -1
  249. package/dist/ontology/validation/index.d.ts.map +1 -1
  250. package/dist/ontology/validation/schema.d.ts +7 -0
  251. package/dist/ontology/validation/schema.d.ts.map +1 -1
  252. package/dist/pipelines/index.js +21 -18
  253. package/dist/pipelines/index.js.map +1 -1
  254. package/dist/projections/internal.js +19 -16
  255. package/dist/projections/internal.js.map +1 -1
  256. package/dist/runtime/create.d.ts +11 -2
  257. package/dist/runtime/create.d.ts.map +1 -1
  258. package/dist/runtime/definitions.d.ts +3 -1
  259. package/dist/runtime/definitions.d.ts.map +1 -1
  260. package/dist/runtime/host.d.ts +13 -2
  261. package/dist/runtime/host.d.ts.map +1 -1
  262. package/dist/runtime/index.d.ts +1 -1
  263. package/dist/runtime/index.d.ts.map +1 -1
  264. package/dist/runtime/internal.js +21 -18
  265. package/dist/runtime/internal.js.map +1 -1
  266. package/dist/runtime/locale.d.ts +9 -0
  267. package/dist/runtime/locale.d.ts.map +1 -0
  268. package/dist/runtime/resolve-definitions.d.ts +4 -2
  269. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  270. package/dist/runtime/types.d.ts +30 -3
  271. package/dist/runtime/types.d.ts.map +1 -1
  272. package/dist/sandboxes/index.js +7 -6
  273. package/dist/sandboxes/index.js.map +1 -1
  274. package/dist/scheduler/index.js +1 -1
  275. package/dist/scheduler/runtime.d.ts +3 -0
  276. package/dist/scheduler/runtime.d.ts.map +1 -1
  277. package/dist/security/builders.d.ts +11 -2
  278. package/dist/security/builders.d.ts.map +1 -1
  279. package/dist/security/index.d.ts +4 -4
  280. package/dist/security/index.d.ts.map +1 -1
  281. package/dist/security/markings.d.ts +19 -0
  282. package/dist/security/markings.d.ts.map +1 -0
  283. package/dist/security/redactions.d.ts +4 -0
  284. package/dist/security/redactions.d.ts.map +1 -0
  285. package/dist/security/registry.d.ts +7 -1
  286. package/dist/security/registry.d.ts.map +1 -1
  287. package/dist/security/types.d.ts +25 -0
  288. package/dist/security/types.d.ts.map +1 -1
  289. package/dist/security/validation.d.ts +4 -1
  290. package/dist/security/validation.d.ts.map +1 -1
  291. package/dist/shares/internal.js +18 -15
  292. package/dist/shares/internal.js.map +2 -2
  293. package/dist/storage/agents/provider.d.ts.map +1 -1
  294. package/dist/storage/agents/provider.js +5 -4
  295. package/dist/storage/agents/provider.js.map +1 -1
  296. package/dist/storage/agents/types.d.ts +15 -9
  297. package/dist/storage/agents/types.d.ts.map +1 -1
  298. package/dist/storage/file-upload-sessions/provider.js +10 -7
  299. package/dist/storage/file-upload-sessions/provider.js.map +1 -1
  300. package/dist/storage/index.d.ts +1 -0
  301. package/dist/storage/index.d.ts.map +1 -1
  302. package/dist/storage/index.js +18 -15
  303. package/dist/storage/index.js.map +1 -1
  304. package/dist/storage/internal.js +4 -3
  305. package/dist/storage/internal.js.map +1 -1
  306. package/dist/storage/objects/types.d.ts +7 -0
  307. package/dist/storage/objects/types.d.ts.map +1 -1
  308. package/dist/storage/workflow-runs/provider.js +10 -7
  309. package/dist/storage/workflow-runs/provider.js.map +1 -1
  310. package/dist/syncs/index.js +22 -19
  311. package/dist/syncs/index.js.map +1 -1
  312. package/dist/testing/index.js +55 -53
  313. package/dist/testing/index.js.map +2 -2
  314. package/dist/webhooks/internal.js +19 -16
  315. package/dist/webhooks/internal.js.map +2 -2
  316. package/dist/workflows/builders.d.ts.map +1 -1
  317. package/dist/workflows/index.js +41 -38
  318. package/dist/workflows/index.js.map +1 -1
  319. package/dist/workflows/request.d.ts.map +1 -1
  320. package/dist/workflows/types.d.ts +6 -3
  321. package/dist/workflows/types.d.ts.map +1 -1
  322. package/dist/workflows/validation.d.ts +2 -1
  323. package/dist/workflows/validation.d.ts.map +1 -1
  324. package/package.json +1 -1
  325. package/src/actions/read-facade.ts +2 -1
  326. package/src/actions/validation.ts +4 -1
  327. package/src/agents/adapters.ts +15 -0
  328. package/src/agents/authority.ts +15 -0
  329. package/src/agents/context/entries.ts +48 -4
  330. package/src/agents/context/index.ts +1 -0
  331. package/src/agents/context-compaction.ts +6 -0
  332. package/src/agents/errors.ts +3 -0
  333. package/src/agents/index.ts +13 -1
  334. package/src/agents/message.ts +9 -0
  335. package/src/agents/request.ts +178 -22
  336. package/src/agents/skills.ts +63 -0
  337. package/src/agents/types.ts +35 -5
  338. package/src/auth/runtime.ts +14 -0
  339. package/src/auth/types.ts +6 -0
  340. package/src/authorization/resolve.ts +6 -1
  341. package/src/authorization/types.ts +7 -0
  342. package/src/blob-storage/execution.ts +12 -0
  343. package/src/blob-storage/file-content.ts +106 -0
  344. package/src/blob-storage/index.ts +1 -0
  345. package/src/blob-storage/internal.ts +7 -0
  346. package/src/blob-storage/media-type.ts +29 -0
  347. package/src/blob-storage/types.ts +13 -1
  348. package/src/blob-storage/validation.ts +13 -0
  349. package/src/bootstrap/agent-context.ts +356 -0
  350. package/src/bootstrap/discovery.ts +100 -33
  351. package/src/bootstrap/index.ts +1 -1
  352. package/src/bootstrap/ontology-type-manifest.ts +3 -38
  353. package/src/datasets/builders.ts +17 -1
  354. package/src/datasets/execution.ts +110 -2
  355. package/src/datasets/index.ts +7 -1
  356. package/src/datasets/types.ts +2 -0
  357. package/src/datasets/write.ts +21 -2
  358. package/src/edits/properties.ts +3 -0
  359. package/src/events/execution.ts +15 -16
  360. package/src/events/types/objects.ts +5 -0
  361. package/src/execution/agent.ts +27 -0
  362. package/src/execution/authorization.ts +1 -0
  363. package/src/execution/authorized-object-reader.ts +96 -34
  364. package/src/execution/scopes.ts +2 -6
  365. package/src/http/api-routes.ts +4 -3
  366. package/src/index.ts +27 -2
  367. package/src/models/catalog.ts +26 -2
  368. package/src/models/execution/README.md +4 -3
  369. package/src/models/execution/binding.ts +6 -0
  370. package/src/models/execution/model-call-recorder.ts +10 -0
  371. package/src/models/execution/session.ts +2 -2
  372. package/src/models/execution.ts +6 -2
  373. package/src/models/language-model.ts +6 -0
  374. package/src/objects/context/index.ts +1 -0
  375. package/src/objects/context/types.ts +7 -0
  376. package/src/objects/execution.ts +4 -1
  377. package/src/objects/materializer-adapter.ts +3 -0
  378. package/src/objects/object/upsert-batch.ts +4 -1
  379. package/src/objects/object/upsert.ts +3 -1
  380. package/src/objects/property-clearance.ts +209 -0
  381. package/src/objects/query/executor.ts +43 -36
  382. package/src/objects/query/validate.ts +133 -14
  383. package/src/objects/sdk/file-handle.ts +77 -0
  384. package/src/objects/sdk/object-handle.ts +8 -4
  385. package/src/objects/sdk/object-set.ts +5 -2
  386. package/src/ontology/builders.ts +18 -2
  387. package/src/ontology/docs-markdown.ts +394 -0
  388. package/src/ontology/docs.ts +196 -0
  389. package/src/ontology/inference/index.ts +25 -0
  390. package/src/ontology/internal.ts +7 -0
  391. package/src/ontology/tokens.ts +13 -2
  392. package/src/ontology/types.ts +5 -0
  393. package/src/ontology/validation/index.ts +1 -0
  394. package/src/ontology/validation/schema.ts +26 -1
  395. package/src/runtime/create.ts +34 -4
  396. package/src/runtime/definitions.ts +3 -1
  397. package/src/runtime/host.ts +45 -1
  398. package/src/runtime/index.ts +3 -0
  399. package/src/runtime/locale.ts +26 -0
  400. package/src/runtime/resolve-definitions.ts +28 -1
  401. package/src/runtime/sixb.ts +1 -1
  402. package/src/runtime/types.ts +39 -3
  403. package/src/scheduler/runtime.ts +11 -2
  404. package/src/security/builders.ts +49 -5
  405. package/src/security/index.ts +6 -1
  406. package/src/security/markings.ts +313 -0
  407. package/src/security/redactions.ts +6 -0
  408. package/src/security/registry.ts +21 -1
  409. package/src/security/types.ts +26 -0
  410. package/src/security/validation.ts +59 -2
  411. package/src/storage/agents/provider.ts +11 -0
  412. package/src/storage/agents/types.ts +15 -7
  413. package/src/storage/index.ts +1 -0
  414. package/src/storage/objects/types.ts +7 -0
  415. package/src/workflows/builders.ts +24 -1
  416. package/src/workflows/request.ts +3 -0
  417. package/src/workflows/types.ts +6 -3
  418. package/src/workflows/validation.ts +32 -4
  419. package/dist/chunk-10styjgk.js.map +0 -20
  420. package/dist/chunk-52c5zb0z.js.map +0 -10
  421. package/dist/chunk-69266efg.js.map +0 -12
  422. package/dist/chunk-6wbm6ymz.js.map +0 -48
  423. package/dist/chunk-91kcnbf0.js.map +0 -10
  424. package/dist/chunk-98cw09sw.js.map +0 -10
  425. package/dist/chunk-9vx5e9g1.js.map +0 -11
  426. package/dist/chunk-cd234ba4.js.map +0 -14
  427. package/dist/chunk-cnb5kv05.js.map +0 -19
  428. package/dist/chunk-dmn70ztd.js.map +0 -11
  429. package/dist/chunk-gf7yht60.js.map +0 -12
  430. package/dist/chunk-h3v76ams.js.map +0 -11
  431. package/dist/chunk-pja9jfz6.js.map +0 -19
  432. package/dist/chunk-t9shqx3w.js.map +0 -12
  433. package/dist/chunk-xcy5ddha.js.map +0 -15
  434. package/dist/chunk-xyvy73tj.js.map +0 -12
  435. package/dist/chunk-z5rnrmz1.js.map +0 -11
  436. /package/dist/{chunk-4gmng3vf.js.map → chunk-22v5bpz3.js.map} +0 -0
  437. /package/dist/{chunk-2am3db31.js.map → chunk-48e3cn2d.js.map} +0 -0
  438. /package/dist/{chunk-f1xh7a32.js.map → chunk-7hpdd6r9.js.map} +0 -0
  439. /package/dist/{chunk-rb143ggb.js.map → chunk-bwjcehza.js.map} +0 -0
  440. /package/dist/{chunk-vp3z1ckh.js.map → chunk-de4z2bj6.js.map} +0 -0
  441. /package/dist/{chunk-3rrezgyc.js.map → chunk-dnmadg9k.js.map} +0 -0
  442. /package/dist/{chunk-a7er86jd.js.map → chunk-ex496vct.js.map} +0 -0
  443. /package/dist/{chunk-jnfxmr3f.js.map → chunk-f1zxad2t.js.map} +0 -0
  444. /package/dist/{chunk-c2rga5cx.js.map → chunk-mfs23znk.js.map} +0 -0
  445. /package/dist/{chunk-fggq3d9k.js.map → chunk-p0dqwj3n.js.map} +0 -0
  446. /package/dist/{chunk-sk0hcjsz.js.map → chunk-qkvz64nd.js.map} +0 -0
  447. /package/dist/{chunk-rx7h5fdx.js.map → chunk-rt9p8m9t.js.map} +0 -0
  448. /package/dist/{chunk-e67ynxcr.js.map → chunk-v6xpd60t.js.map} +0 -0
  449. /package/dist/{chunk-jjrn5v0p.js.map → chunk-vgk3hknm.js.map} +0 -0
  450. /package/dist/{chunk-5thzcb8g.js.map → chunk-vx2yp45y.js.map} +0 -0
  451. /package/dist/{chunk-k4g51s47.js.map → chunk-yv9czyfr.js.map} +0 -0
  452. /package/dist/{chunk-vre348sb.js.map → chunk-za5yd58j.js.map} +0 -0
  453. /package/dist/{chunk-23xs4qp9.js.map → chunk-zb77kjth.js.map} +0 -0
  454. /package/dist/{chunk-33saed7g.js.map → chunk-zxawp1n2.js.map} +0 -0
@@ -38,11 +38,16 @@ class AgentRequestError2 extends Error {
38
38
  var MAX_AGENT_CONTEXT_ENTRIES2 = 12;
39
39
  var MAX_AGENT_APP_STATE_ENTRY_BYTES2 = 16 * 1024;
40
40
  var MAX_AGENT_APP_STATE_TOTAL_BYTES2 = 64 * 1024;
41
+ var MAX_AGENT_CONTEXT_LABEL_LENGTH2 = 200;
41
42
  var agentContext2 = {
42
- object(objectType, primaryId) {
43
+ object(objectType, primaryId, options = {}) {
44
+ const label = options.label === undefined ? undefined : objectContextLabel(options.label, "agentContext.object() label", (message) => {
45
+ throw new TypeError(`[Sixb] ${message}.`);
46
+ });
43
47
  return {
44
48
  kind: "object",
45
- ref: { objectTypeId: objectType.id, primaryId }
49
+ ref: { objectTypeId: objectType.id, primaryId },
50
+ ...label === undefined ? {} : { label }
46
51
  };
47
52
  },
48
53
  appState(id, input) {
@@ -69,7 +74,7 @@ function normalizeAgentContextEntries2(input) {
69
74
  for (const [index, rawEntry] of input.entries()) {
70
75
  const entry = normalizeEntry(rawEntry, index);
71
76
  const identity = agentContextIdentity2(entry.context);
72
- const serialized = stableJsonStringify2(entry);
77
+ const serialized = stableJsonStringify2(entry.context.kind === "object" ? { ...entry, context: { kind: "object", ref: entry.context.ref } } : entry);
73
78
  const existing = byIdentity.get(identity);
74
79
  if (existing !== undefined) {
75
80
  if (existing === serialized)
@@ -105,8 +110,13 @@ function normalizeEntry(rawEntry, index) {
105
110
  invalidContext(`context[${index}].context.ref must be an object`);
106
111
  const objectTypeId = requireNonEmptyString(context.ref.objectTypeId, `context[${index}].context.ref.objectTypeId`);
107
112
  const primaryId = requireNonEmptyString(context.ref.primaryId, `context[${index}].context.ref.primaryId`);
113
+ const label = context.label === undefined ? undefined : objectContextLabel(context.label, `context[${index}].context.label`, invalidContext);
108
114
  return {
109
- context: { kind: "object", ref: { objectTypeId, primaryId } },
115
+ context: {
116
+ kind: "object",
117
+ ref: { objectTypeId, primaryId },
118
+ ...label === undefined ? {} : { label }
119
+ },
110
120
  origin: rawEntry.origin
111
121
  };
112
122
  }
@@ -131,6 +141,15 @@ function normalizeEntry(rawEntry, index) {
131
141
  }
132
142
  invalidContext(`context[${index}].context.kind must be 'object' or 'app-state'`);
133
143
  }
144
+ function objectContextLabel(value, label, fail) {
145
+ const trimmed = typeof value === "string" ? value.trim() : "";
146
+ if (!trimmed)
147
+ fail(`${label} must be a non-empty string`);
148
+ if (trimmed.length > MAX_AGENT_CONTEXT_LABEL_LENGTH2) {
149
+ fail(`${label} must be at most ${MAX_AGENT_CONTEXT_LABEL_LENGTH2} characters`);
150
+ }
151
+ return trimmed;
152
+ }
134
153
  function requireNonEmptyString(value, label) {
135
154
  if (typeof value !== "string" || value.trim().length === 0) {
136
155
  invalidContext(`${label} must be a non-empty string`);
@@ -147,6 +166,6 @@ function invalidContext(message) {
147
166
  throw new AgentRequestError2("invalid_context", `[Sixb] Invalid agent context: ${message}.`);
148
167
  }
149
168
 
150
- export { AgentDefinitionError2, AgentToolPublicError2, AgentToolResultValidationError2, AgentRequestError2, MAX_AGENT_CONTEXT_ENTRIES2, MAX_AGENT_APP_STATE_ENTRY_BYTES2, MAX_AGENT_APP_STATE_TOTAL_BYTES2, agentContext2, agentContextIdentity2, agentContextFingerprint2, normalizeAgentContextEntries2 };
169
+ export { AgentDefinitionError2, AgentToolPublicError2, AgentToolResultValidationError2, AgentRequestError2, MAX_AGENT_CONTEXT_ENTRIES2, MAX_AGENT_APP_STATE_ENTRY_BYTES2, MAX_AGENT_APP_STATE_TOTAL_BYTES2, MAX_AGENT_CONTEXT_LABEL_LENGTH2, agentContext2, agentContextIdentity2, agentContextFingerprint2, normalizeAgentContextEntries2 };
151
170
 
152
- //# debugId=20BA4BBDB86CC4AA64756E2164756E21
171
+ //# debugId=D2B517DE0E9AFCDE64756E2164756E21
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/agents/errors.ts", "../src/agents/context/entries.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Base error for the agents module. Specific subclasses extend this so callers\n * can catch any agent-scoped failure with a single `instanceof AgentDefinitionError` check.\n */\nexport class AgentDefinitionError extends Error {\n readonly name: string = \"AgentDefinitionError\"\n}\n\n/**\n * An agent-tool failure whose message is intentionally safe to expose to the model and persist in\n * the durable trace. Tool authors must keep the message free of credentials and internal details;\n * unknown errors remain masked by the worker.\n */\nexport class AgentToolPublicError extends Error {\n readonly name: string = \"AgentToolPublicError\"\n}\n\n/** Raised when an agent tool result cannot cross the durable message boundary. */\nexport class AgentToolResultValidationError extends Error {\n readonly name = \"AgentToolResultValidationError\"\n\n constructor(\n readonly toolName: string,\n readonly reason: string,\n options?: ErrorOptions\n ) {\n super(`[Sixb] Agent tool '${toolName}' returned an invalid result; ${reason}.`, options)\n }\n}\n\nexport type AgentRequestErrorCode =\n | \"agent_selector_removed\"\n | \"agent_not_found\"\n | \"model_not_found\"\n | \"invalid_model_selection\"\n | \"invalid_locale\"\n | \"invalid_message\"\n | \"run_not_found\"\n | \"run_not_retryable\"\n | \"thread_not_found\"\n | \"active_run_exists\"\n | \"authority_not_inheritable\"\n | \"invalid_context\"\n | \"invalid_attachment\"\n | \"storage_unavailable\"\n | \"sandbox_not_configured\"\n | \"invalid_sandbox_params\"\n | \"sandbox_execution_unavailable\"\n\n/**\n * Raised by {@link requestAgentRun} (the trigger). Callers branch on `code` rather than message text\n * — e.g. the HTTP layer maps `active_run_exists` to 409 and `agent_not_found` to 404.\n */\nexport class AgentRequestError extends Error {\n readonly name = \"AgentRequestError\"\n\n constructor(\n readonly code: AgentRequestErrorCode,\n message: string\n ) {\n super(message)\n }\n}\n",
6
+ "import type { JsonValue } from \"../../json\"\nimport { cloneJsonValue, getInvalidJsonValueReason, stableJsonStringify } from \"../../json\"\nimport type { ObjectRef } from \"../../ontology/refs\"\nimport { AgentRequestError } from \"../errors\"\n\nexport type AgentContextInput =\n | {\n readonly kind: \"object\"\n readonly ref: ObjectRef\n /**\n * What the chat shows for this object instead of its title. Display only: it is not part of\n * the context's identity and is never sent to the model.\n */\n readonly label?: string\n }\n | {\n readonly kind: \"app-state\"\n readonly id: string\n readonly label: string\n readonly description: string\n readonly value: JsonValue\n }\n\nexport type AgentContextOrigin = \"ambient\" | \"explicit\"\n\nexport interface AgentContextEntryInput {\n readonly context: AgentContextInput\n readonly origin: AgentContextOrigin\n}\n\n/** Durable user-message part. Origin is display provenance, never an authorization grant. */\nexport interface AgentContextPart extends AgentContextEntryInput {\n readonly type: \"context\"\n}\n\nexport const MAX_AGENT_CONTEXT_ENTRIES = 12\nexport const MAX_AGENT_APP_STATE_ENTRY_BYTES = 16 * 1024\nexport const MAX_AGENT_APP_STATE_TOTAL_BYTES = 64 * 1024\nexport const MAX_AGENT_CONTEXT_LABEL_LENGTH = 200\n\n/** Typed constructors for context values shared by custom apps and agent clients. */\nexport const agentContext = {\n object<const TObjectTypeId extends string>(\n objectType: { readonly id: TObjectTypeId },\n primaryId: string,\n options: { readonly label?: string } = {}\n ) {\n const label =\n options.label === undefined\n ? undefined\n : objectContextLabel(options.label, \"agentContext.object() label\", (message) => {\n throw new TypeError(`[Sixb] ${message}.`)\n })\n return {\n kind: \"object\" as const,\n ref: { objectTypeId: objectType.id, primaryId },\n ...(label === undefined ? {} : { label }),\n }\n },\n\n appState<const TValue extends JsonValue>(\n id: string,\n input: {\n readonly label: string\n readonly description: string\n readonly value: TValue\n }\n ) {\n return { kind: \"app-state\" as const, id, ...input }\n },\n}\n\n/** Stable identity shared by core deduplication and context-aware clients. */\nexport function agentContextIdentity(context: AgentContextInput): string {\n return context.kind === \"object\"\n ? `object:${encodeURIComponent(context.ref.objectTypeId)}:${encodeURIComponent(context.ref.primaryId)}`\n : `app-state:${encodeURIComponent(context.id)}`\n}\n\n/** Stable semantic key for client-side comparisons. */\nexport function agentContextFingerprint(context: AgentContextInput): string {\n return stableJsonStringify(context)\n}\n\n/**\n * Validate transport-independent context rules and clone mutable app state before it can become\n * durable. Object existence and visibility are resolved separately because they require a runtime.\n */\nexport function normalizeAgentContextEntries(\n input: readonly AgentContextEntryInput[] | undefined\n): readonly AgentContextEntryInput[] {\n if (input === undefined) return []\n if (!Array.isArray(input)) invalidContext(\"context must be an array\")\n if (input.length > MAX_AGENT_CONTEXT_ENTRIES) {\n invalidContext(`context cannot contain more than ${MAX_AGENT_CONTEXT_ENTRIES} entries`)\n }\n\n const entries: AgentContextEntryInput[] = []\n const byIdentity = new Map<string, string>()\n let totalAppStateBytes = 0\n\n for (const [index, rawEntry] of input.entries()) {\n const entry = normalizeEntry(rawEntry, index)\n const identity = agentContextIdentity(entry.context)\n // A label is display only, so two entries that differ only by label are the same entry; the\n // first one's label is kept.\n const serialized = stableJsonStringify(\n entry.context.kind === \"object\"\n ? { ...entry, context: { kind: \"object\", ref: entry.context.ref } }\n : entry\n )\n const existing = byIdentity.get(identity)\n\n if (existing !== undefined) {\n if (existing === serialized) continue\n invalidContext(`context contains conflicting entries for '${identity}'`)\n }\n\n if (entry.context.kind === \"app-state\") {\n const bytes = utf8ByteLength(serialized)\n if (bytes > MAX_AGENT_APP_STATE_ENTRY_BYTES) {\n invalidContext(\n `context entry '${identity}' exceeds the ${MAX_AGENT_APP_STATE_ENTRY_BYTES}-byte limit`\n )\n }\n totalAppStateBytes += bytes\n if (totalAppStateBytes > MAX_AGENT_APP_STATE_TOTAL_BYTES) {\n invalidContext(\n `app-state context exceeds the ${MAX_AGENT_APP_STATE_TOTAL_BYTES}-byte message limit`\n )\n }\n }\n\n byIdentity.set(identity, serialized)\n entries.push(entry)\n }\n\n return entries\n}\n\nfunction normalizeEntry(rawEntry: unknown, index: number): AgentContextEntryInput {\n if (!isRecord(rawEntry)) invalidContext(`context[${index}] must be an object`)\n if (rawEntry.origin !== \"ambient\" && rawEntry.origin !== \"explicit\") {\n invalidContext(`context[${index}].origin must be 'ambient' or 'explicit'`)\n }\n if (!isRecord(rawEntry.context)) invalidContext(`context[${index}].context must be an object`)\n\n const context = rawEntry.context\n if (context.kind === \"object\") {\n if (!isRecord(context.ref)) invalidContext(`context[${index}].context.ref must be an object`)\n const objectTypeId = requireNonEmptyString(\n context.ref.objectTypeId,\n `context[${index}].context.ref.objectTypeId`\n )\n const primaryId = requireNonEmptyString(\n context.ref.primaryId,\n `context[${index}].context.ref.primaryId`\n )\n const label =\n context.label === undefined\n ? undefined\n : objectContextLabel(context.label, `context[${index}].context.label`, invalidContext)\n return {\n context: {\n kind: \"object\",\n ref: { objectTypeId, primaryId },\n ...(label === undefined ? {} : { label }),\n },\n origin: rawEntry.origin,\n }\n }\n\n if (context.kind === \"app-state\") {\n const id = requireNonEmptyString(context.id, `context[${index}].context.id`)\n const label = requireNonEmptyString(context.label, `context[${index}].context.label`)\n const description = requireNonEmptyString(\n context.description,\n `context[${index}].context.description`\n )\n const reason = getInvalidJsonValueReason(context.value, `context[${index}].context.value`)\n if (reason) {\n invalidContext(`context[${index}].context.value must be a JSON value; ${reason}`)\n }\n return {\n context: {\n kind: \"app-state\",\n id,\n label,\n description,\n value: cloneJsonValue(context.value as JsonValue),\n },\n origin: rawEntry.origin,\n }\n }\n\n invalidContext(`context[${index}].context.kind must be 'object' or 'app-state'`)\n}\n\nfunction objectContextLabel(\n value: unknown,\n label: string,\n fail: (message: string) => never\n): string {\n const trimmed = typeof value === \"string\" ? value.trim() : \"\"\n if (!trimmed) fail(`${label} must be a non-empty string`)\n if (trimmed.length > MAX_AGENT_CONTEXT_LABEL_LENGTH) {\n fail(`${label} must be at most ${MAX_AGENT_CONTEXT_LABEL_LENGTH} characters`)\n }\n return trimmed\n}\n\nfunction requireNonEmptyString(value: unknown, label: string): string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n invalidContext(`${label} must be a non-empty string`)\n }\n return value\n}\n\nfunction utf8ByteLength(value: string): number {\n return new TextEncoder().encode(value).byteLength\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n\nfunction invalidContext(message: string): never {\n throw new AgentRequestError(\"invalid_context\", `[Sixb] Invalid agent context: ${message}.`)\n}\n"
7
+ ],
8
+ "mappings": ";;;;;;;;AAIO,MAAM,8BAA6B,MAAM;AAAA,EACrC,OAAe;AAC1B;AAAA;AAOO,MAAM,8BAA6B,MAAM;AAAA,EACrC,OAAe;AAC1B;AAAA;AAGO,MAAM,wCAAuC,MAAM;AAAA,EAI7C;AAAA,EACA;AAAA,EAJF,OAAO;AAAA,EAEhB,WAAW,CACA,UACA,QACT,SACA;AAAA,IACA,MAAM,sBAAsB,yCAAyC,WAAW,OAAO;AAAA,IAJ9E;AAAA,IACA;AAAA;AAKb;AAAA;AA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AgC;AAAA,IACnD,KAAK,GAAG,yBAAyB,4CAA2C;AAAA,EAC9E;AAAA,EACA,OAAO;AAAA;AAGT,SAAS,qBAAqB,CAAC,OAAgB,OAAuB;AAAA,EACpE,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,EAAE,WAAW,GAAG;AAAA,IAC1D,eAAe,GAAG,kCAAkC;AAAA,EACtD;AAAA,EACA,OAAO;AAAA;AAGT,SAAS,cAAc,CAAC,OAAuB;AAAA,EAC7C,OAAO,IAAI,YAAY,EAAE,OAAO,KAAK,EAAE;AAAA;AAGzC,SAAS,QAAQ,CAAC,OAAkD;AAAA,EAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAAA;AAG5E,SAAS,cAAc,CAAC,SAAwB;AAAA,EAC9C,MAAM,IAAI,mBAAkB,mBAAmB,iCAAiC,UAAU;AAAA;",
9
+ "debugId": "D2B517DE0E9AFCDE64756E2164756E21",
10
+ "names": []
11
+ }
@@ -2,10 +2,10 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/models/language-model.ts", "../src/models/events.ts"],
4
4
  "sourcesContent": [
5
- "import type { JsonObject, ReadonlyJsonObject } from \"../json\"\nimport type { LanguageModelDefinitionCatalog, ModelDefinitionCatalog } from \"./catalog\"\nimport type { LanguageModelDefinition } from \"./definitions\"\nimport type { LanguageModelStreamEvent } from \"./events\"\nimport type { ModelMessage } from \"./messages\"\nimport type { ModelCostEstimator } from \"./pricing\"\n\nexport const MODEL_REASONING_EFFORTS = [\"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const\n\nexport type ModelReasoningEffort = (typeof MODEL_REASONING_EFFORTS)[number]\n\nexport const MODEL_REASONING_LEVELS = [\n \"provider-default\",\n \"none\",\n ...MODEL_REASONING_EFFORTS,\n] as const\n\nexport type ModelReasoningLevel = (typeof MODEL_REASONING_LEVELS)[number]\n\n/** Exact provider-native reasoning budget, expressed in tokens. */\nexport interface ModelReasoningBudget extends ReadonlyJsonObject {\n readonly budgetTokens: number\n}\n\n/** Provider-neutral reasoning preference accepted by every language-model runtime. */\nexport type ModelReasoning = ModelReasoningLevel | ModelReasoningBudget\n\nexport interface ModelReasoningBudgetCapabilities {\n readonly min?: number\n readonly max?: number\n}\n\n/** Controls exposed by one concrete model offering through one provider. */\nexport interface ModelReasoningCapabilities {\n readonly canDisable?: boolean\n readonly efforts?: readonly ModelReasoningEffort[]\n readonly budgetTokens?: ModelReasoningBudgetCapabilities\n}\n\nexport interface ModelCapabilities {\n readonly inputMediaTypes?: readonly string[] | \"any\"\n /** `undefined` is unknown, `false` is unsupported, and an object describes supported controls. */\n readonly reasoning?: false | ModelReasoningCapabilities\n readonly localTools?: boolean\n readonly parallelToolCalls?: boolean\n /** `undefined` is unknown, not an assertion that schema-constrained output is unsupported. */\n readonly nativeStructuredOutput?: boolean\n readonly providerExecutedTools?: boolean\n}\n\nexport interface ModelToolSpecification {\n readonly name: string\n readonly description: string\n readonly inputSchema: JsonObject\n}\n\nexport interface ModelResponseFormat {\n readonly type: \"json\"\n readonly name: string\n readonly description?: string\n readonly schema: JsonObject\n}\n\nexport interface LanguageModelRequest {\n readonly callId: string\n readonly messages: readonly ModelMessage[]\n readonly tools: readonly ModelToolSpecification[]\n readonly reasoning?: ModelReasoning\n /** Per-call output ceiling; providers must not exceed a stricter configured model limit. */\n readonly maxOutputTokens?: number\n /** Disable automatic prompt caching without overriding explicit provider configuration. */\n readonly caching?: \"auto\" | \"off\"\n readonly responseFormat?: ModelResponseFormat\n readonly signal: AbortSignal\n}\n\nexport interface LanguageModelStream {\n readonly events: AsyncIterable<LanguageModelStreamEvent>\n}\n\nexport interface LanguageModel {\n readonly providerId: string\n readonly modelId: string\n readonly definition: LanguageModelDefinition\n readonly costEstimator?: ModelCostEstimator\n /**\n * Return an executable model pinned to operational metadata, preserving model identity.\n * `offline` requires a local snapshot without catalog I/O. Workers retain this model\n * for generation and compaction; later catalog refreshes must not change its capabilities/limits.\n * Throw ModelCatalogUnavailableError for catalog transport/access failures to allow workers to\n * retry with an offline snapshot. Invalid definitions and other resolver errors remain fatal.\n */\n resolve?(options?: { readonly offline?: boolean }): Promise<LanguageModel>\n /** Validate known output constraints without inference. Success does not certify endpoint support. */\n validateResponseFormat?(format: ModelResponseFormat): void | Promise<void>\n stream(request: LanguageModelRequest): Promise<LanguageModelStream>\n}\n\n/** The common callable provider shape. Provider packages may accept additional model options. */\nexport interface ModelProvider<TCatalog extends ModelDefinitionCatalog = ModelDefinitionCatalog> {\n readonly providerId: string\n readonly catalog: TCatalog\n}\n\nexport interface LanguageModelProvider extends ModelProvider<LanguageModelDefinitionCatalog> {\n (modelId: string): LanguageModel\n}\n\nexport function isModelReasoning(value: unknown): value is ModelReasoning {\n if (typeof value === \"string\") {\n return (MODEL_REASONING_LEVELS as readonly string[]).includes(value)\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return false\n if (Object.keys(value).length !== 1) return false\n const budgetTokens = (value as { readonly budgetTokens?: unknown }).budgetTokens\n return typeof budgetTokens === \"number\" && Number.isSafeInteger(budgetTokens) && budgetTokens >= 0\n}\n\n/** Explain why a request cannot be represented by known model capabilities. Unknown is allowed. */\nexport function modelReasoningSupportIssue(\n capabilities: ModelCapabilities[\"reasoning\"],\n reasoning: unknown\n): string | undefined {\n if (reasoning === undefined) return undefined\n if (!isModelReasoning(reasoning)) return \"the reasoning preference is invalid\"\n if (reasoning === \"provider-default\") return undefined\n if (capabilities === undefined) return undefined\n if (capabilities === false) return \"reasoning is not supported\"\n if (reasoning === \"none\") {\n return capabilities.canDisable === true ? undefined : \"reasoning cannot be disabled\"\n }\n if (typeof reasoning === \"string\") {\n return capabilities.efforts?.includes(reasoning) === true\n ? undefined\n : `reasoning effort '${reasoning}' is not supported`\n }\n const budget = capabilities.budgetTokens\n if (budget === undefined) return \"reasoning token budgets are not supported\"\n if (budget.min !== undefined && reasoning.budgetTokens < budget.min) {\n return `reasoning token budget must be at least ${budget.min}`\n }\n if (budget.max !== undefined && reasoning.budgetTokens > budget.max) {\n return `reasoning token budget must not exceed ${budget.max}`\n }\n return undefined\n}\n",
5
+ "import type { JsonObject, ReadonlyJsonObject } from \"../json\"\nimport type { LanguageModelDefinitionCatalog, ModelDefinitionCatalog } from \"./catalog\"\nimport type { LanguageModelDefinition } from \"./definitions\"\nimport type { LanguageModelStreamEvent } from \"./events\"\nimport type { ModelMessage } from \"./messages\"\nimport type { ModelCostEstimator } from \"./pricing\"\n\nexport const MODEL_REASONING_EFFORTS = [\"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const\n\nexport type ModelReasoningEffort = (typeof MODEL_REASONING_EFFORTS)[number]\n\nexport const MODEL_REASONING_LEVELS = [\n \"provider-default\",\n \"none\",\n ...MODEL_REASONING_EFFORTS,\n] as const\n\nexport type ModelReasoningLevel = (typeof MODEL_REASONING_LEVELS)[number]\n\n/** Exact provider-native reasoning budget, expressed in tokens. */\nexport interface ModelReasoningBudget extends ReadonlyJsonObject {\n readonly budgetTokens: number\n}\n\n/** Provider-neutral reasoning preference accepted by every language-model runtime. */\nexport type ModelReasoning = ModelReasoningLevel | ModelReasoningBudget\n\nexport interface ModelReasoningBudgetCapabilities {\n readonly min?: number\n readonly max?: number\n}\n\n/** Controls exposed by one concrete model offering through one provider. */\nexport interface ModelReasoningCapabilities {\n readonly canDisable?: boolean\n readonly efforts?: readonly ModelReasoningEffort[]\n readonly budgetTokens?: ModelReasoningBudgetCapabilities\n}\n\nexport interface ModelCapabilities {\n readonly inputMediaTypes?: readonly string[] | \"any\"\n /** `undefined` is unknown, `false` is unsupported, and an object describes supported controls. */\n readonly reasoning?: false | ModelReasoningCapabilities\n readonly localTools?: boolean\n readonly parallelToolCalls?: boolean\n /** `undefined` is unknown, not an assertion that schema-constrained output is unsupported. */\n readonly nativeStructuredOutput?: boolean\n readonly providerExecutedTools?: boolean\n}\n\nexport interface ModelToolSpecification {\n readonly name: string\n readonly description: string\n readonly inputSchema: JsonObject\n}\n\nexport interface ModelResponseFormat {\n readonly type: \"json\"\n readonly name: string\n readonly description?: string\n readonly schema: JsonObject\n}\n\nexport interface LanguageModelRequest {\n readonly callId: string\n readonly messages: readonly ModelMessage[]\n readonly tools: readonly ModelToolSpecification[]\n readonly reasoning?: ModelReasoning\n /** Per-call output ceiling; providers must not exceed a stricter configured model limit. */\n readonly maxOutputTokens?: number\n /** Disable automatic prompt caching without overriding explicit provider configuration. */\n readonly caching?: \"auto\" | \"off\"\n readonly responseFormat?: ModelResponseFormat\n readonly signal: AbortSignal\n}\n\nexport interface LanguageModelStream {\n readonly events: AsyncIterable<LanguageModelStreamEvent>\n}\n\nexport interface LanguageModel {\n readonly providerId: string\n readonly modelId: string\n readonly definition: LanguageModelDefinition\n readonly costEstimator?: ModelCostEstimator\n /**\n * Reasoning Sixb applies whenever this model runs without an explicit choice: chat turns, AI\n * workflow steps, subagents, and direct generation. Providers set it from their model options;\n * Sixb checks it against `definition.capabilities` at startup.\n */\n readonly defaultReasoning?: ModelReasoningLevel\n /**\n * Return an executable model pinned to operational metadata, preserving model identity.\n * `offline` requires a local snapshot without catalog I/O. Workers retain this model\n * for generation and compaction; later catalog refreshes must not change its capabilities/limits.\n * Throw ModelCatalogUnavailableError for catalog transport/access failures to allow workers to\n * retry with an offline snapshot. Invalid definitions and other resolver errors remain fatal.\n */\n resolve?(options?: { readonly offline?: boolean }): Promise<LanguageModel>\n /** Validate known output constraints without inference. Success does not certify endpoint support. */\n validateResponseFormat?(format: ModelResponseFormat): void | Promise<void>\n stream(request: LanguageModelRequest): Promise<LanguageModelStream>\n}\n\n/** The common callable provider shape. Provider packages may accept additional model options. */\nexport interface ModelProvider<TCatalog extends ModelDefinitionCatalog = ModelDefinitionCatalog> {\n readonly providerId: string\n readonly catalog: TCatalog\n}\n\nexport interface LanguageModelProvider extends ModelProvider<LanguageModelDefinitionCatalog> {\n (modelId: string): LanguageModel\n}\n\nexport function isModelReasoning(value: unknown): value is ModelReasoning {\n if (typeof value === \"string\") {\n return (MODEL_REASONING_LEVELS as readonly string[]).includes(value)\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return false\n if (Object.keys(value).length !== 1) return false\n const budgetTokens = (value as { readonly budgetTokens?: unknown }).budgetTokens\n return typeof budgetTokens === \"number\" && Number.isSafeInteger(budgetTokens) && budgetTokens >= 0\n}\n\n/** Explain why a request cannot be represented by known model capabilities. Unknown is allowed. */\nexport function modelReasoningSupportIssue(\n capabilities: ModelCapabilities[\"reasoning\"],\n reasoning: unknown\n): string | undefined {\n if (reasoning === undefined) return undefined\n if (!isModelReasoning(reasoning)) return \"the reasoning preference is invalid\"\n if (reasoning === \"provider-default\") return undefined\n if (capabilities === undefined) return undefined\n if (capabilities === false) return \"reasoning is not supported\"\n if (reasoning === \"none\") {\n return capabilities.canDisable === true ? undefined : \"reasoning cannot be disabled\"\n }\n if (typeof reasoning === \"string\") {\n return capabilities.efforts?.includes(reasoning) === true\n ? undefined\n : `reasoning effort '${reasoning}' is not supported`\n }\n const budget = capabilities.budgetTokens\n if (budget === undefined) return \"reasoning token budgets are not supported\"\n if (budget.min !== undefined && reasoning.budgetTokens < budget.min) {\n return `reasoning token budget must be at least ${budget.min}`\n }\n if (budget.max !== undefined && reasoning.budgetTokens > budget.max) {\n return `reasoning token budget must not exceed ${budget.max}`\n }\n return undefined\n}\n",
6
6
  "import type { JsonObject, JsonValue } from \"../json\"\nimport type { ModelReasoning } from \"./language-model\"\nimport type {\n ModelAssistantPart,\n ModelToolCallPart,\n ModelToolResultPart,\n ProviderData,\n} from \"./messages\"\nimport type { ModelCallCost, ModelCostEstimate, ModelReportedCost } from \"./pricing\"\n\nexport interface ModelRoute {\n /** Provider selected by a routing gateway, when it differs from the provider being called. */\n readonly providerId?: string\n readonly modelId?: string\n}\n\n/** Only identifiers supplied by the provider. Internal call/response fallback IDs never belong here. */\nexport type ModelProviderIds = {\n readonly requestId?: string\n readonly responseId?: string\n readonly generationId?: string\n}\n\nexport function normalizeModelProviderIds(value: unknown): ModelProviderIds {\n if (typeof value !== \"object\" || value === null || Array.isArray(value))\n throw new TypeError(\"[Sixb] Provider identifiers must be an object.\")\n const result: { requestId?: string; responseId?: string; generationId?: string } = {}\n for (const [key, id] of Object.entries(value)) {\n if (key !== \"requestId\" && key !== \"responseId\" && key !== \"generationId\") continue\n if (id === undefined) continue\n if (typeof id !== \"string\" || !id.trim())\n throw new TypeError(`[Sixb] Provider ${key} must be nonblank.`)\n result[key] = id\n }\n return Object.freeze(result)\n}\n\nexport type ModelFinishReason =\n | \"stop\"\n | \"length\"\n | \"content-filter\"\n | \"tool-calls\"\n | \"pause\"\n | \"error\"\n | \"other\"\n | \"unknown\"\n\nexport interface ModelUsage {\n /** Audio content duration in milliseconds, rounded to the nearest millisecond. Not billed duration. */\n readonly audioDurationMs?: number\n readonly inputTokens?: number\n readonly outputTokens?: number\n readonly uncachedInputTokens?: number\n readonly cacheReadInputTokens?: number\n readonly cacheWriteInputTokens?: number\n readonly cacheWrite5mInputTokens?: number\n readonly cacheWrite1hInputTokens?: number\n readonly textOutputTokens?: number\n readonly reasoningOutputTokens?: number\n readonly raw?: JsonObject\n}\n\nexport type LanguageModelStreamEvent =\n | { readonly type: \"stream-start\" }\n | {\n readonly type: \"response-metadata\"\n readonly providerIds?: ModelProviderIds\n readonly id?: string\n readonly modelId?: string\n }\n | { readonly type: \"text-start\"; readonly id: string; readonly providerData?: ProviderData }\n | { readonly type: \"text-delta\"; readonly id: string; readonly delta: string }\n | { readonly type: \"text-end\"; readonly id: string; readonly providerData?: ProviderData }\n | {\n readonly type: \"reasoning-start\"\n readonly id: string\n readonly providerData?: ProviderData\n }\n | { readonly type: \"reasoning-delta\"; readonly id: string; readonly delta: string }\n | { readonly type: \"reasoning-end\"; readonly id: string; readonly providerData?: ProviderData }\n | {\n readonly type: \"tool-input-start\"\n readonly id: string\n readonly toolName: string\n readonly providerData?: ProviderData\n readonly providerExecuted?: boolean\n readonly dynamic?: boolean\n }\n | { readonly type: \"tool-input-delta\"; readonly id: string; readonly delta: string }\n | { readonly type: \"tool-input-end\"; readonly id: string; readonly providerData?: ProviderData }\n | {\n readonly type: \"tool-call\"\n readonly toolCallId: string\n readonly toolName: string\n readonly input: string\n readonly providerData?: ProviderData\n readonly providerExecuted?: boolean\n readonly dynamic?: boolean\n }\n | {\n readonly type: \"tool-result\"\n readonly toolCallId: string\n readonly toolName: string\n readonly output: JsonValue\n readonly isError?: boolean\n readonly providerData?: ProviderData\n readonly providerExecuted?: boolean\n readonly dynamic?: boolean\n }\n | {\n readonly type: \"provider-state\"\n readonly providerId: string\n readonly data: JsonValue\n }\n | {\n readonly type: \"finish\"\n readonly finishReason: ModelFinishReason\n readonly rawFinishReason?: string\n readonly usage: ModelUsage\n readonly providerData?: ProviderData\n readonly reportedCost?: ModelReportedCost\n readonly route?: ModelRoute\n }\n | { readonly type: \"error\"; readonly error: unknown }\n\nexport type ModelUiChunk =\n | { readonly type: \"start-step\" }\n | { readonly type: \"text-start\"; readonly id: string }\n | { readonly type: \"text-delta\"; readonly id: string; readonly delta: string }\n | { readonly type: \"text-end\"; readonly id: string }\n | { readonly type: \"reasoning-start\"; readonly id: string }\n | { readonly type: \"reasoning-delta\"; readonly id: string; readonly delta: string }\n | { readonly type: \"reasoning-end\"; readonly id: string }\n | {\n readonly type: \"tool-input-start\"\n readonly toolCallId: string\n readonly toolName: string\n }\n | {\n readonly type: \"tool-input-delta\"\n readonly toolCallId: string\n readonly toolName: string\n readonly inputTextDelta: string\n }\n | {\n readonly type: \"tool-input-available\"\n readonly toolCallId: string\n readonly toolName: string\n readonly input: JsonValue\n }\n | {\n readonly type: \"tool-input-error\"\n readonly toolCallId: string\n readonly toolName: string\n readonly input: JsonValue\n readonly errorText: string\n }\n | {\n readonly type: \"tool-output-available\"\n readonly toolCallId: string\n readonly toolName: string\n readonly output: JsonValue\n }\n | {\n readonly type: \"tool-output-error\"\n readonly toolCallId: string\n readonly toolName: string\n readonly errorText: string\n }\n | { readonly type: \"error\"; readonly errorText: string }\n\nexport interface ModelCallEndEvent {\n readonly modelKind?: import(\"./definitions\").ModelKind\n readonly providerIds?: ModelProviderIds\n /** Retained independently when the selected display cost is provider-reported. */\n readonly estimate?: ModelCostEstimate\n readonly callId: string\n readonly providerId: string\n readonly modelId: string\n readonly responseId: string\n readonly responseModelId?: string\n readonly usage: ModelUsage\n readonly cost: ModelCallCost\n readonly requestedReasoning?: ModelReasoning\n readonly route?: ModelRoute\n}\n\nexport interface ModelStep {\n readonly content: readonly (ModelAssistantPart | ModelToolResultPart)[]\n readonly finishReason: ModelFinishReason\n readonly rawFinishReason?: string\n readonly usage: ModelUsage\n readonly responseId: string\n readonly responseModelId?: string\n readonly cost: ModelCallCost\n readonly route?: ModelRoute\n}\n\nexport interface ModelLoopPartial {\n readonly content: readonly (ModelAssistantPart | ModelToolCallPart | ModelToolResultPart)[]\n}\n"
7
7
  ],
8
- "mappings": ";;AAOO,IAAM,2BAA0B,CAAC,WAAW,OAAO,UAAU,QAAQ,SAAS,KAAK;AAInF,IAAM,0BAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA,GAAG;AACL;AA6FO,SAAS,iBAAgB,CAAC,OAAyC;AAAA,EACxE,IAAI,OAAO,UAAU,UAAU;AAAA,IAC7B,OAAQ,wBAA6C,SAAS,KAAK;AAAA,EACrE;AAAA,EACA,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK;AAAA,IAAG,OAAO;AAAA,EAChF,IAAI,OAAO,KAAK,KAAK,EAAE,WAAW;AAAA,IAAG,OAAO;AAAA,EAC5C,MAAM,eAAgB,MAA8C;AAAA,EACpE,OAAO,OAAO,iBAAiB,YAAY,OAAO,cAAc,YAAY,KAAK,gBAAgB;AAAA;AAI5F,SAAS,2BAA0B,CACxC,cACA,WACoB;AAAA,EACpB,IAAI,cAAc;AAAA,IAAW;AAAA,EAC7B,IAAI,CAAC,kBAAiB,SAAS;AAAA,IAAG,OAAO;AAAA,EACzC,IAAI,c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OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK;AAAA,IACpE,MAAM,IAAI,UAAU,gDAAgD;AAAA,EACtE,MAAM,SAA6E,CAAC;AAAA,EACpF,YAAY,KAAK,OAAO,OAAO,QAAQ,KAAK,GAAG;AAAA,IAC7C,IAAI,QAAQ,eAAe,QAAQ,gBAAgB,QAAQ;AAAA,MAAgB;AAAA,IAC3E,IAAI,OAAO;AAAA,MAAW;AAAA,IACtB,IAAI,OAAO,OAAO,YAAY,CAAC,GAAG,KAAK;AAAA,MACrC,MAAM,IAAI,UAAU,mBAAmB,uBAAuB;AAAA,IAChE,OAAO,OAAO;AAAA,EAChB;AAAA,EACA,OAAO,OAAO,OAAO,MAAM;AAAA;",
9
9
  "debugId": "1D80C81FE1B8244564756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,4 +1,10 @@
1
1
  // @bun
2
+ import {
3
+ GRANT_KINDS,
4
+ TARGETED_GRANT_KIND_KEYS,
5
+ grantKindOf,
6
+ emptyGrantSets
7
+ } from "./chunk-enpsx8k5.js";
2
8
  import {
3
9
  createSixbError2
4
10
  } from "./chunk-6fsr7y93.js";
@@ -8,7 +14,7 @@ import {
8
14
  import {
9
15
  findPrimitiveSchema,
10
16
  resolveSemanticType2
11
- } from "./chunk-rpxz486p.js";
17
+ } from "./chunk-y05543x6.js";
12
18
  import {
13
19
  kernelOperationId,
14
20
  kernelOperationFromId
@@ -25,129 +31,6 @@ function agentServiceAccountId2(actorId) {
25
31
  return `svc_agent_${actorId}`;
26
32
  }
27
33
 
28
- // src/authorization/grant-kinds.ts
29
- var GRANT_KINDS = {
30
- "access:application": {
31
- universeKey: "applicationIds",
32
- subject: "application",
33
- fix: "Use an application exported from '@sixb/core'."
34
- },
35
- "view:object": {
36
- universeKey: "objectTypeIds",
37
- subject: "object type",
38
- fix: "Register it in 'ontology/' or pass it to createSixb({ ontologies }).",
39
- expandsSubtypes: true
40
- },
41
- "view:dataset": {
42
- universeKey: "datasetIds",
43
- subject: "dataset",
44
- fix: "Add it to 'datasets/' or pass it to createSixb({ datasets })."
45
- },
46
- "edit:object": {
47
- universeKey: "objectTypeIds",
48
- subject: "object type",
49
- fix: "Register it in 'ontology/' or pass it to createSixb({ ontologies })."
50
- },
51
- "append:telemetry": {
52
- universeKey: "objectTypeIds",
53
- subject: "object type",
54
- fix: "Register it in 'ontology/' or pass it to createSixb({ ontologies })."
55
- },
56
- "apply:action": {
57
- universeKey: "actionIds",
58
- subject: "action",
59
- fix: "Add it to 'actions/' or pass it to createSixb({ actions })."
60
- },
61
- "share:share": {
62
- universeKey: "shareIds",
63
- subject: "share",
64
- fix: "Add it to 'shares/' or pass it to createSixb({ shares })."
65
- },
66
- "run:workflow": {
67
- universeKey: "workflowIds",
68
- subject: "workflow",
69
- fix: "Add it to 'workflows/' or pass it to createSixb({ workflows })."
70
- },
71
- "run:sync": {
72
- universeKey: "syncIds",
73
- subject: "sync",
74
- fix: "Add it to 'syncs/' or pass it to createSixb({ syncs })."
75
- },
76
- "run:pipeline": {
77
- universeKey: "pipelineIds",
78
- subject: "pipeline",
79
- fix: "Add it to 'pipelines/' or pass it to createSixb({ pipelines })."
80
- },
81
- "run:agent": {
82
- singleton: true,
83
- subject: "agent",
84
- fix: "Configure models.language and use the exported agent reference in can.run(agent)."
85
- },
86
- "observe:logs": {
87
- universeKey: "observableIds",
88
- subject: "observability surface",
89
- fix: 'Use can.observe("logs").'
90
- },
91
- "observe:aiUsage": {
92
- universeKey: "observableIds",
93
- subject: "observability surface",
94
- fix: "Use can.observe(agent.usage)."
95
- },
96
- "manage:connector": {
97
- universeKey: "connectorIds",
98
- subject: "connector",
99
- fix: "Add it to 'connectors/' or pass it to createSixb({ connectors })."
100
- },
101
- "manage:aiUsage": {
102
- universeKey: "manageableIds",
103
- subject: "management surface",
104
- fix: "Use can.manage(agent.usage)."
105
- }
106
- };
107
- var GRANT_KIND_KEYS = Object.keys(GRANT_KINDS);
108
- var TARGETED_GRANT_KIND_KEYS = GRANT_KIND_KEYS.filter((kind) => kind !== "run:agent");
109
- function grantKindOf(grant) {
110
- switch (grant.capability) {
111
- case "access":
112
- return "access:application";
113
- case "view":
114
- return `view:${grant.target}`;
115
- case "edit":
116
- return "edit:object";
117
- case "append":
118
- return "append:telemetry";
119
- case "apply":
120
- return "apply:action";
121
- case "share":
122
- return "share:share";
123
- case "run":
124
- return `run:${grant.target}`;
125
- case "observe":
126
- return `observe:${grant.target}`;
127
- case "manage":
128
- return `manage:${grant.target}`;
129
- }
130
- }
131
- function emptyGrantSets() {
132
- return {
133
- "access:application": new Set,
134
- "view:object": new Set,
135
- "view:dataset": new Set,
136
- "edit:object": new Set,
137
- "append:telemetry": new Set,
138
- "apply:action": new Set,
139
- "share:share": new Set,
140
- "run:workflow": new Set,
141
- "run:sync": new Set,
142
- "run:pipeline": new Set,
143
- "run:agent": false,
144
- "observe:logs": new Set,
145
- "observe:aiUsage": new Set,
146
- "manage:connector": new Set,
147
- "manage:aiUsage": new Set
148
- };
149
- }
150
-
151
34
  // src/storage/objects/execution-limits.ts
152
35
  var MAX_OBJECT_READ_FACETS2 = 16;
153
36
  var MAX_OUTPUT_JSON_DEPTH = 64;
@@ -729,7 +612,8 @@ function snapshotAuthorizationContext(context) {
729
612
  ...context.sessionId === undefined ? {} : { sessionId: context.sessionId },
730
613
  groupIds: Object.freeze([...context.groupIds]),
731
614
  roleIds: Object.freeze([...context.roleIds]),
732
- grants: frozenGrants
615
+ grants: frozenGrants,
616
+ clearances: new ImmutableGrantSet(context.clearances ?? [])
733
617
  });
734
618
  }
735
619
 
@@ -1151,6 +1035,7 @@ function resolveAuthorizationContext2(input) {
1151
1035
  const memberGroupIds = new Set(input.groupIds);
1152
1036
  const roleIds = [];
1153
1037
  const grants = emptyGrantSets();
1038
+ const clearances = new Set;
1154
1039
  for (const role of input.roles) {
1155
1040
  if (!role.grantedToGroupIds.some((groupId) => memberGroupIds.has(groupId))) {
1156
1041
  continue;
@@ -1164,13 +1049,17 @@ function resolveAuthorizationContext2(input) {
1164
1049
  grants[kind].add(id);
1165
1050
  }
1166
1051
  }
1052
+ for (const markingId of role.clearances ?? []) {
1053
+ clearances.add(markingId);
1054
+ }
1167
1055
  }
1168
1056
  return {
1169
1057
  principal: input.principal,
1170
1058
  ...input.sessionId !== undefined ? { sessionId: input.sessionId } : {},
1171
1059
  groupIds: input.groupIds,
1172
1060
  roleIds,
1173
- grants
1061
+ grants,
1062
+ clearances
1174
1063
  };
1175
1064
  }
1176
1065
  // src/projections/errors.ts
@@ -1901,6 +1790,6 @@ function canViewProjection2(authorization, projection) {
1901
1790
  function emptyGrantIndex2() {
1902
1791
  return emptyGrantSets();
1903
1792
  }
1904
- export { ProjectionValidationError2, computeProjectionOwnership2, validateProjectionOwnership2, validateTelemetryProjectionFieldMapping2, validateProjectionsAtStartup, defineProjection2, fromForeignKey2, isObjectProjectionDefinition2, isLinkProjectionDefinition2, isTelemetryProjectionDefinition2, isProjectionDefinition2, projectionTargetOf2, agentServiceAccountId2, GRANT_KINDS, grantKindOf, MAX_OBJECT_READ_FACETS2, ObjectReadLimitExceededError2, snapshotObjectReadExecutionLimits2, assertObjectReadFacetCount2, assertObjectReadOutputWithinLimit2, createPrincipalRuntimeAuthorization, createAgentRuntimeAuthorization, createDisabledRuntimeAuthorization, createDelegatedRuntimeAuthorization, createTrustedPrimitiveRuntimeAuthorization, createKernelRuntimeAuthorization, resolveRuntimeAuthorizationForProject, getAuthorizationRef, captureExecutionScope, resolveExecutionScopeAuthorization, AuthorizationError2, evaluate2, isAllowed2, assertAuthorized2, isRuntimeAllowed2, assertRuntimeAuthorizationBound2, assertCanEdit2, assertCanAppendTelemetry2, assertCanManageConnector2, assertPrivileged2, assertProviderAccess2, isApplicationAccessControlled2, canAccessApplication2, canViewEvent2, resolveRoleGrants2, resolveAuthorizationContext2, canViewActionRun2, canViewWorkflowRun2, canViewWorkflowIntervention2, canViewPipelineRun2, canViewProjectionRun2, canViewProjection2, emptyGrantIndex2 };
1793
+ export { ProjectionValidationError2, computeProjectionOwnership2, validateProjectionOwnership2, validateTelemetryProjectionFieldMapping2, validateProjectionsAtStartup, defineProjection2, fromForeignKey2, isObjectProjectionDefinition2, isLinkProjectionDefinition2, isTelemetryProjectionDefinition2, isProjectionDefinition2, projectionTargetOf2, agentServiceAccountId2, MAX_OBJECT_READ_FACETS2, ObjectReadLimitExceededError2, snapshotObjectReadExecutionLimits2, assertObjectReadFacetCount2, assertObjectReadOutputWithinLimit2, createPrincipalRuntimeAuthorization, createAgentRuntimeAuthorization, createDisabledRuntimeAuthorization, createDelegatedRuntimeAuthorization, createTrustedPrimitiveRuntimeAuthorization, createKernelRuntimeAuthorization, resolveRuntimeAuthorizationForProject, getAuthorizationRef, captureExecutionScope, resolveExecutionScopeAuthorization, AuthorizationError2, evaluate2, isAllowed2, assertAuthorized2, isRuntimeAllowed2, assertRuntimeAuthorizationBound2, assertCanEdit2, assertCanAppendTelemetry2, assertCanManageConnector2, assertPrivileged2, assertProviderAccess2, isApplicationAccessControlled2, canAccessApplication2, canViewEvent2, resolveRoleGrants2, resolveAuthorizationContext2, canViewActionRun2, canViewWorkflowRun2, canViewWorkflowIntervention2, canViewPipelineRun2, canViewProjectionRun2, canViewProjection2, emptyGrantIndex2 };
1905
1794
 
1906
- //# debugId=0D4C4769683DF03564756E2164756E21
1795
+ //# debugId=EE4F623367B105A264756E2164756E21