@sixb/core 0.1.7 → 0.1.9
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.
- package/dist/actions/delegated-admission.d.ts +24 -0
- package/dist/actions/delegated-admission.d.ts.map +1 -0
- package/dist/actions/descriptor.d.ts +29 -0
- package/dist/actions/descriptor.d.ts.map +1 -0
- package/dist/actions/execution.d.ts +5 -5
- package/dist/actions/execution.d.ts.map +1 -1
- package/dist/actions/index.js +78 -84
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run-authorization.d.ts +20 -0
- package/dist/actions/run-authorization.d.ts.map +1 -0
- package/dist/actions/run-dispatch.d.ts +3 -1
- package/dist/actions/run-dispatch.d.ts.map +1 -1
- package/dist/actions/types/context.d.ts +2 -0
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/actions/validation.d.ts +1 -1
- package/dist/actions/validation.d.ts.map +1 -1
- package/dist/actions/worker.js +33 -37
- package/dist/actions/worker.js.map +2 -2
- package/dist/agents/adapters.d.ts +8 -125
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/authority.d.ts +1 -1
- package/dist/agents/authority.d.ts.map +1 -1
- package/dist/agents/{context.d.ts → context/entries.d.ts} +3 -3
- package/dist/agents/context/entries.d.ts.map +1 -0
- package/dist/agents/context/index.d.ts +4 -0
- package/dist/agents/context/index.d.ts.map +1 -0
- package/dist/agents/context/index.js +19 -0
- package/dist/agents/{streams.js.map → context/index.js.map} +1 -1
- package/dist/agents/context-model.d.ts +1 -1
- package/dist/agents/context-model.d.ts.map +1 -1
- package/dist/agents/context-resolution.d.ts +1 -1
- package/dist/agents/context-resolution.d.ts.map +1 -1
- package/dist/agents/errors.d.ts +0 -9
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/identity.d.ts +3 -0
- package/dist/agents/identity.d.ts.map +1 -0
- package/dist/agents/index.d.ts +7 -7
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +193 -205
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/message.d.ts +5 -6
- package/dist/agents/message.d.ts.map +1 -1
- package/dist/agents/model-loop.d.ts +4 -0
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/request.d.ts +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/streams/index.d.ts +4 -0
- package/dist/agents/streams/index.d.ts.map +1 -0
- package/dist/agents/streams/index.js +20 -0
- package/dist/{chunk-y64skrwp.js.map → agents/streams/index.js.map} +1 -1
- package/dist/agents/streams/internal.d.ts +3 -0
- package/dist/agents/streams/internal.d.ts.map +1 -0
- package/dist/agents/streams/internal.js +40 -0
- package/dist/agents/{context.js.map → streams/internal.js.map} +1 -1
- package/dist/agents/{streams.d.ts → streams/protocol.d.ts} +5 -5
- package/dist/agents/streams/protocol.d.ts.map +1 -0
- package/dist/agents/tool-definition.d.ts +0 -1
- package/dist/agents/tool-definition.d.ts.map +1 -1
- package/dist/agents/types.d.ts +1 -1
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +0 -4
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/ai-usage/execution.d.ts.map +1 -1
- package/dist/auth/index.d.ts +0 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +96 -105
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/strategy.js +8 -9
- package/dist/auth/strategy.js.map +1 -1
- package/dist/authorization/decision.d.ts +10 -2
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/grant-kinds.d.ts +2 -1
- package/dist/authorization/grant-kinds.d.ts.map +1 -1
- package/dist/authorization/index.d.ts +1 -1
- package/dist/authorization/index.d.ts.map +1 -1
- package/dist/authorization/index.js +51 -53
- package/dist/authorization/index.js.map +1 -1
- package/dist/blob-storage/browser.js +15 -17
- package/dist/blob-storage/browser.js.map +1 -1
- package/dist/blob-storage/index.js +36 -38
- package/dist/blob-storage/index.js.map +1 -1
- package/dist/bootstrap/discovery.d.ts +20 -1
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.d.ts +2 -2
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +79 -81
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/bootstrap/ontology-type-manifest.d.ts.map +1 -1
- package/dist/broker/index.js +8 -10
- package/dist/broker/index.js.map +1 -1
- package/dist/{chunk-k34z5rvh.js → chunk-0rdrecsb.js} +18 -18
- package/dist/{chunk-k34z5rvh.js.map → chunk-0rdrecsb.js.map} +2 -2
- package/dist/{chunk-3fqt22c4.js → chunk-0w35wavj.js} +360 -168
- package/dist/chunk-0w35wavj.js.map +14 -0
- package/dist/chunk-0y39rgsb.js +43 -0
- package/dist/{chunk-c15dr03f.js.map → chunk-0y39rgsb.js.map} +2 -2
- package/dist/{chunk-hdz94br2.js → chunk-17kfctj6.js} +23 -13
- package/dist/chunk-17kfctj6.js.map +10 -0
- package/dist/{chunk-e4rvtvpw.js → chunk-1enhpacz.js} +418 -233
- package/dist/chunk-1enhpacz.js.map +34 -0
- package/dist/{chunk-5gd7tpv6.js → chunk-2c4j899j.js} +4 -4
- package/dist/{chunk-5gd7tpv6.js.map → chunk-2c4j899j.js.map} +2 -2
- package/dist/{chunk-7ds9620f.js → chunk-38zv5rkr.js} +24 -8
- package/dist/chunk-38zv5rkr.js.map +10 -0
- package/dist/{chunk-w3e09qqk.js → chunk-39tqv9hz.js} +24 -24
- package/dist/{chunk-w3e09qqk.js.map → chunk-39tqv9hz.js.map} +2 -2
- package/dist/{chunk-04b07a9q.js → chunk-3bh94gbw.js} +13 -13
- package/dist/{chunk-04b07a9q.js.map → chunk-3bh94gbw.js.map} +2 -2
- package/dist/{chunk-8m5ejdpn.js → chunk-3f7veca0.js} +4 -4
- package/dist/{chunk-8m5ejdpn.js.map → chunk-3f7veca0.js.map} +2 -2
- package/dist/chunk-3frsnm7x.js +32 -0
- package/dist/chunk-3frsnm7x.js.map +11 -0
- package/dist/{chunk-n2w475r0.js → chunk-3tgwrcyh.js} +81 -81
- package/dist/{chunk-n2w475r0.js.map → chunk-3tgwrcyh.js.map} +2 -2
- package/dist/{chunk-qv38twt8.js → chunk-52hbv0ak.js} +192 -171
- package/dist/{chunk-qv38twt8.js.map → chunk-52hbv0ak.js.map} +6 -6
- package/dist/{chunk-nf4r78r4.js → chunk-5a4a52tq.js} +4 -4
- package/dist/{chunk-nf4r78r4.js.map → chunk-5a4a52tq.js.map} +2 -2
- package/dist/{chunk-rte5sm3z.js → chunk-5hz0fnca.js} +23 -23
- package/dist/{chunk-rte5sm3z.js.map → chunk-5hz0fnca.js.map} +2 -2
- package/dist/chunk-653vwrzr.js +39 -0
- package/dist/chunk-653vwrzr.js.map +10 -0
- package/dist/{chunk-qw9gvjv5.js → chunk-72w2pxk7.js} +13 -13
- package/dist/{chunk-qw9gvjv5.js.map → chunk-72w2pxk7.js.map} +2 -2
- package/dist/chunk-7apz6hg4.js +50 -0
- package/dist/{chunk-jq43kdvk.js.map → chunk-7apz6hg4.js.map} +2 -2
- package/dist/chunk-7bs40fe1.js +218 -0
- package/dist/{chunk-08twe8m6.js.map → chunk-7bs40fe1.js.map} +3 -3
- package/dist/chunk-7zgecwy1.js +113 -0
- package/dist/chunk-7zgecwy1.js.map +10 -0
- package/dist/{chunk-tn7xcs2n.js → chunk-860dwwy0.js} +93 -30
- package/dist/chunk-860dwwy0.js.map +14 -0
- package/dist/chunk-8vj0rjgs.js +165 -0
- package/dist/chunk-8vj0rjgs.js.map +15 -0
- package/dist/{chunk-7y0f6rf1.js → chunk-92vk7gta.js} +58 -58
- package/dist/chunk-92vk7gta.js.map +10 -0
- package/dist/{chunk-gbrpsx4m.js → chunk-93csa55g.js} +72 -16
- package/dist/chunk-93csa55g.js.map +11 -0
- package/dist/{chunk-d8qkxt2v.js → chunk-98cw09sw.js} +7 -7
- package/dist/chunk-98cw09sw.js.map +10 -0
- package/dist/chunk-9qsh3p5y.js +111 -0
- package/dist/chunk-9qsh3p5y.js.map +11 -0
- package/dist/{chunk-4a849fr1.js → chunk-9tc8dxmn.js} +1 -1
- package/dist/{chunk-z2sery1b.js → chunk-9vx5e9g1.js} +68 -28
- package/dist/chunk-9vx5e9g1.js.map +11 -0
- package/dist/{chunk-9aehf39w.js → chunk-an5tt9y0.js} +353 -353
- package/dist/{chunk-9aehf39w.js.map → chunk-an5tt9y0.js.map} +2 -2
- package/dist/{chunk-x0qhkqje.js → chunk-ap0g1g74.js} +37 -37
- package/dist/{chunk-x0qhkqje.js.map → chunk-ap0g1g74.js.map} +2 -2
- package/dist/chunk-awbhdqyc.js +252 -0
- package/dist/chunk-awbhdqyc.js.map +10 -0
- package/dist/{chunk-ka3a2ft3.js → chunk-b19g04jk.js} +12 -12
- package/dist/{chunk-ka3a2ft3.js.map → chunk-b19g04jk.js.map} +2 -2
- package/dist/chunk-br3k6qbf.js +436 -0
- package/dist/chunk-br3k6qbf.js.map +12 -0
- package/dist/{chunk-dbc80ad7.js → chunk-c5rkjrgp.js} +28 -28
- package/dist/{chunk-dbc80ad7.js.map → chunk-c5rkjrgp.js.map} +2 -2
- package/dist/{chunk-dktq02ne.js → chunk-cqr3acm1.js} +4 -4
- package/dist/{chunk-dktq02ne.js.map → chunk-cqr3acm1.js.map} +2 -2
- package/dist/chunk-d62kjtbg.js +7 -0
- package/dist/{chunk-zcnhxkvd.js.map → chunk-d62kjtbg.js.map} +2 -2
- package/dist/{chunk-74drx9gd.js → chunk-dfm066qg.js} +10 -10
- package/dist/{chunk-74drx9gd.js.map → chunk-dfm066qg.js.map} +2 -2
- package/dist/{chunk-atmkaf60.js → chunk-dmn70ztd.js} +30 -34
- package/dist/chunk-dmn70ztd.js.map +11 -0
- package/dist/chunk-dz5h08xv.js +1887 -0
- package/dist/chunk-dz5h08xv.js.map +25 -0
- package/dist/{chunk-p2vqaxkc.js → chunk-e0d1rzef.js} +27 -22
- package/dist/{chunk-p2vqaxkc.js.map → chunk-e0d1rzef.js.map} +3 -3
- package/dist/{chunk-5sz8ta9r.js → chunk-e1c18xjx.js} +52 -52
- package/dist/{chunk-5sz8ta9r.js.map → chunk-e1c18xjx.js.map} +2 -2
- package/dist/{chunk-ha58tjtt.js → chunk-emyyk7dx.js} +59 -55
- package/dist/{chunk-ha58tjtt.js.map → chunk-emyyk7dx.js.map} +3 -3
- package/dist/{chunk-3kv70xwp.js → chunk-ey1nk510.js} +18 -2
- package/dist/chunk-ey1nk510.js.map +10 -0
- package/dist/chunk-f0rwz2vh.js +152 -0
- package/dist/chunk-f0rwz2vh.js.map +11 -0
- package/dist/{chunk-2xns679x.js → chunk-f4w3yp4f.js} +171 -36
- package/dist/chunk-f4w3yp4f.js.map +12 -0
- package/dist/{chunk-979ww6b3.js → chunk-fb3feg1e.js} +29 -29
- package/dist/{chunk-979ww6b3.js.map → chunk-fb3feg1e.js.map} +2 -2
- package/dist/{chunk-rre42skh.js → chunk-g00bfdq6.js} +729 -296
- package/dist/{chunk-rre42skh.js.map → chunk-g00bfdq6.js.map} +11 -7
- package/dist/{chunk-p03r0h5s.js → chunk-g53f0e4j.js} +76 -202
- package/dist/chunk-g53f0e4j.js.map +15 -0
- package/dist/chunk-g6cke204.js +124 -0
- package/dist/chunk-g6cke204.js.map +10 -0
- package/dist/{chunk-51fjndv0.js → chunk-gfdh9kqa.js} +4 -4
- package/dist/{chunk-51fjndv0.js.map → chunk-gfdh9kqa.js.map} +2 -2
- package/dist/chunk-h1gfhhbh.js +602 -0
- package/dist/chunk-h1gfhhbh.js.map +18 -0
- package/dist/chunk-h3v76ams.js +32 -0
- package/dist/{chunk-08m3b6w8.js.map → chunk-h3v76ams.js.map} +2 -2
- package/dist/chunk-hpr1r6av.js +4006 -0
- package/dist/chunk-hpr1r6av.js.map +44 -0
- package/dist/{chunk-jecn6t54.js → chunk-jgwb25gc.js} +74 -74
- package/dist/{chunk-jecn6t54.js.map → chunk-jgwb25gc.js.map} +2 -2
- package/dist/{chunk-rp1mvzb4.js → chunk-jjy0fhrn.js} +40 -35
- package/dist/{chunk-rp1mvzb4.js.map → chunk-jjy0fhrn.js.map} +3 -3
- package/dist/{chunk-4nxeacx7.js → chunk-jmfet9r4.js} +6 -6
- package/dist/{chunk-4nxeacx7.js.map → chunk-jmfet9r4.js.map} +2 -2
- package/dist/{chunk-64sr682n.js → chunk-k3cqkkn2.js} +61 -55
- package/dist/chunk-k3cqkkn2.js.map +12 -0
- package/dist/{chunk-s5y30bc9.js → chunk-kxwa347f.js} +51 -49
- package/dist/{chunk-s5y30bc9.js.map → chunk-kxwa347f.js.map} +4 -4
- package/dist/{chunk-2ab72m2h.js → chunk-m2ca93my.js} +3 -3
- package/dist/{chunk-2ab72m2h.js.map → chunk-m2ca93my.js.map} +2 -2
- package/dist/{chunk-qjycjdj6.js → chunk-m3z3x9v0.js} +106 -65
- package/dist/{chunk-qjycjdj6.js.map → chunk-m3z3x9v0.js.map} +3 -3
- package/dist/{chunk-6ed5bwnd.js → chunk-mjbk2djy.js} +2092 -1714
- package/dist/chunk-mjbk2djy.js.map +57 -0
- package/dist/{chunk-5jcdmjam.js → chunk-mmagke4x.js} +6 -6
- package/dist/{chunk-5jcdmjam.js.map → chunk-mmagke4x.js.map} +2 -2
- package/dist/chunk-mrp7k0pw.js +147 -0
- package/dist/chunk-mrp7k0pw.js.map +10 -0
- package/dist/{chunk-d63tybny.js → chunk-ms2tmn1k.js} +139 -139
- package/dist/{chunk-d63tybny.js.map → chunk-ms2tmn1k.js.map} +2 -2
- package/dist/{chunk-xdpwpkha.js → chunk-ppytyr6w.js} +156 -179
- package/dist/{chunk-xdpwpkha.js.map → chunk-ppytyr6w.js.map} +3 -5
- package/dist/{chunk-trxxmgnf.js → chunk-pqajwytd.js} +10 -10
- package/dist/{chunk-trxxmgnf.js.map → chunk-pqajwytd.js.map} +3 -3
- package/dist/{chunk-qjzp9xyb.js → chunk-pr2h4bv4.js} +33 -35
- package/dist/chunk-pr2h4bv4.js.map +12 -0
- package/dist/{chunk-xwnf87e1.js → chunk-q5gz3g2j.js} +64 -64
- package/dist/{chunk-xwnf87e1.js.map → chunk-q5gz3g2j.js.map} +2 -2
- package/dist/{chunk-agsvg9ar.js → chunk-qf954wje.js} +6 -6
- package/dist/{chunk-agsvg9ar.js.map → chunk-qf954wje.js.map} +2 -2
- package/dist/{chunk-wjgm6jjt.js → chunk-qhcpj9wc.js} +166 -132
- package/dist/chunk-qhcpj9wc.js.map +14 -0
- package/dist/{chunk-tpnd31c1.js → chunk-r29fxdhn.js} +12 -12
- package/dist/{chunk-tpnd31c1.js.map → chunk-r29fxdhn.js.map} +2 -2
- package/dist/{chunk-b49dgvsj.js → chunk-r2y23egw.js} +3 -3
- package/dist/{chunk-b49dgvsj.js.map → chunk-r2y23egw.js.map} +2 -2
- package/dist/{chunk-2b5qtban.js → chunk-r4tfx1sf.js} +142 -89
- package/dist/chunk-r4tfx1sf.js.map +15 -0
- package/dist/{chunk-4rh2m6zg.js → chunk-rb1xx120.js} +13 -13
- package/dist/{chunk-4rh2m6zg.js.map → chunk-rb1xx120.js.map} +2 -2
- package/dist/chunk-s3csryxe.js +152 -0
- package/dist/chunk-s3csryxe.js.map +11 -0
- package/dist/chunk-s670k14v.js +60 -0
- package/dist/{chunk-407j3msh.js.map → chunk-s670k14v.js.map} +2 -2
- package/dist/chunk-skz0hst3.js +788 -0
- package/dist/chunk-skz0hst3.js.map +19 -0
- package/dist/chunk-v4jbb3rs.js +403 -0
- package/dist/chunk-v4jbb3rs.js.map +10 -0
- package/dist/{chunk-d2ndstdf.js → chunk-vf691g1r.js} +61 -59
- package/dist/{chunk-d2ndstdf.js.map → chunk-vf691g1r.js.map} +2 -2
- package/dist/{chunk-1kamz6j0.js → chunk-vsj3mdfj.js} +8 -8
- package/dist/{chunk-1kamz6j0.js.map → chunk-vsj3mdfj.js.map} +2 -2
- package/dist/{chunk-9dzba0f2.js → chunk-wjasrj67.js} +8 -8
- package/dist/{chunk-9dzba0f2.js.map → chunk-wjasrj67.js.map} +2 -2
- package/dist/{chunk-1evzqhks.js → chunk-wr8qp979.js} +6 -6
- package/dist/{chunk-1evzqhks.js.map → chunk-wr8qp979.js.map} +2 -2
- package/dist/{chunk-n6jxh8sw.js → chunk-wy0qdqfm.js} +18 -18
- package/dist/{chunk-n6jxh8sw.js.map → chunk-wy0qdqfm.js.map} +2 -2
- package/dist/{chunk-8tsf6dmc.js → chunk-x57ycxq0.js} +204 -204
- package/dist/{chunk-8tsf6dmc.js.map → chunk-x57ycxq0.js.map} +2 -2
- package/dist/chunk-x9v4cx1d.js +139 -0
- package/dist/chunk-x9v4cx1d.js.map +10 -0
- package/dist/{chunk-kt81c11h.js → chunk-xfbydgzy.js} +27 -27
- package/dist/{chunk-kt81c11h.js.map → chunk-xfbydgzy.js.map} +2 -2
- package/dist/{chunk-vjjv9mrb.js → chunk-xyr8kppc.js} +22 -22
- package/dist/{chunk-vjjv9mrb.js.map → chunk-xyr8kppc.js.map} +3 -3
- package/dist/chunk-ypbtykv6.js +1537 -0
- package/dist/chunk-ypbtykv6.js.map +19 -0
- package/dist/{chunk-ry24jbr1.js → chunk-yv79ncbv.js} +10 -10
- package/dist/{chunk-ry24jbr1.js.map → chunk-yv79ncbv.js.map} +2 -2
- package/dist/{chunk-xc7hq65b.js → chunk-z30bv4ga.js} +80 -33
- package/dist/chunk-z30bv4ga.js.map +11 -0
- package/dist/{chunk-8ydjhh27.js → chunk-z3y411fq.js} +11 -7
- package/dist/{chunk-8ydjhh27.js.map → chunk-z3y411fq.js.map} +3 -3
- package/dist/{chunk-9t8f5xfx.js → chunk-z5rnrmz1.js} +10 -10
- package/dist/{chunk-9t8f5xfx.js.map → chunk-z5rnrmz1.js.map} +2 -2
- package/dist/{chunk-96swp2wd.js → chunk-z667z3sg.js} +3 -3
- package/dist/{chunk-96swp2wd.js.map → chunk-z667z3sg.js.map} +2 -2
- package/dist/chunk-z8fx5cgb.js +159 -0
- package/dist/chunk-z8fx5cgb.js.map +11 -0
- package/dist/{chunk-xhy826cz.js → chunk-zcnq6105.js} +7 -7
- package/dist/{chunk-xhy826cz.js.map → chunk-zcnq6105.js.map} +2 -2
- package/dist/{chunk-yt8wphsx.js → chunk-zvx7h87b.js} +3 -3
- package/dist/{chunk-yt8wphsx.js.map → chunk-zvx7h87b.js.map} +2 -2
- package/dist/connectors/connections/internal.js +9 -10
- package/dist/connectors/connections/internal.js.map +1 -1
- package/dist/datasets/builders.d.ts +11 -2
- package/dist/datasets/builders.d.ts.map +1 -1
- package/dist/datasets/changes.d.ts +14 -4
- package/dist/datasets/changes.d.ts.map +1 -1
- package/dist/datasets/execution.d.ts +15 -1
- package/dist/datasets/execution.d.ts.map +1 -1
- package/dist/datasets/index.d.ts +1 -0
- package/dist/datasets/index.d.ts.map +1 -1
- package/dist/datasets/sequence.d.ts +7 -0
- package/dist/datasets/sequence.d.ts.map +1 -0
- package/dist/datasets/types.d.ts +1 -0
- package/dist/datasets/types.d.ts.map +1 -1
- package/dist/datasets/validation.d.ts.map +1 -1
- package/dist/datasets/write.d.ts +37 -0
- package/dist/datasets/write.d.ts.map +1 -0
- package/dist/datasets/write.js +13 -0
- package/dist/datasets/write.js.map +9 -0
- package/dist/edits/index.js +7 -8
- package/dist/edits/index.js.map +1 -1
- package/dist/error-reporting/internal.js +22 -24
- package/dist/error-reporting/internal.js.map +1 -1
- package/dist/errors/internal.d.ts +1 -1
- package/dist/errors/internal.d.ts.map +1 -1
- package/dist/errors/internal.js +22 -24
- package/dist/errors/internal.js.map +1 -1
- package/dist/errors/redaction.d.ts +8 -0
- package/dist/errors/redaction.d.ts.map +1 -0
- package/dist/errors/types.d.ts +4 -0
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/index.js +60 -63
- package/dist/events/index.js.map +1 -1
- package/dist/events/scope.js +4 -5
- package/dist/events/scope.js.map +1 -1
- package/dist/events/selectors/index.js +9 -10
- package/dist/events/selectors/index.js.map +1 -1
- package/dist/events/types/datasets.d.ts +2 -6
- package/dist/events/types/datasets.d.ts.map +1 -1
- package/dist/execution/agent.d.ts +3 -3
- package/dist/execution/agent.d.ts.map +1 -1
- package/dist/execution/agent.js +70 -75
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts +58 -20
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +69 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -0
- package/dist/execution/durable.d.ts +1 -0
- package/dist/execution/durable.d.ts.map +1 -1
- package/dist/execution/index.d.ts +1 -1
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/primitive.d.ts +2 -0
- package/dist/execution/primitive.d.ts.map +1 -1
- package/dist/execution/primitive.js +63 -64
- package/dist/execution/primitive.js.map +3 -3
- package/dist/execution/request.d.ts +12 -0
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +97 -71
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/scopes.d.ts +16 -0
- package/dist/execution/scopes.d.ts.map +1 -1
- package/dist/execution/types.d.ts +9 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts +2 -0
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +10 -11
- package/dist/http/index.js.map +1 -1
- package/dist/index.d.ts +21 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +455 -463
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/definition-updates.d.ts.map +1 -1
- package/dist/lake-storage/errors.d.ts +5 -1
- package/dist/lake-storage/errors.d.ts.map +1 -1
- package/dist/lake-storage/in-memory.d.ts +1 -0
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +6 -1
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +40 -27
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/merge-validation.d.ts.map +1 -1
- package/dist/lake-storage/merge.d.ts +13 -2
- package/dist/lake-storage/merge.d.ts.map +1 -1
- package/dist/lake-storage/source-ordering.d.ts +19 -0
- package/dist/lake-storage/source-ordering.d.ts.map +1 -0
- package/dist/lake-storage/sql-transforms.d.ts +2 -1
- package/dist/lake-storage/sql-transforms.d.ts.map +1 -1
- package/dist/lake-storage/types.d.ts +10 -5
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/lake-storage/version-inputs.d.ts +4 -0
- package/dist/lake-storage/version-inputs.d.ts.map +1 -0
- package/dist/logging/index.d.ts +3 -4
- package/dist/logging/index.d.ts.map +1 -1
- package/dist/logging/index.js +18 -40
- package/dist/logging/index.js.map +1 -1
- package/dist/logging/internal.d.ts +5 -0
- package/dist/logging/internal.d.ts.map +1 -0
- package/dist/logging/internal.js +43 -0
- package/dist/logging/internal.js.map +9 -0
- package/dist/materialization/index.js +46 -49
- package/dist/materialization/index.js.map +1 -1
- package/dist/materializer/index.js +137 -142
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/errors.d.ts +4 -0
- package/dist/models/errors.d.ts.map +1 -1
- package/dist/models/execution/binding.d.ts +9 -0
- package/dist/models/execution/binding.d.ts.map +1 -0
- package/dist/models/execution/errors.d.ts +9 -0
- package/dist/models/execution/errors.d.ts.map +1 -0
- package/dist/models/execution/index.d.ts +11 -0
- package/dist/models/execution/index.d.ts.map +1 -0
- package/dist/models/execution/index.js +55 -0
- package/dist/models/execution/index.js.map +9 -0
- package/dist/models/execution/model-call-accounting.d.ts +17 -0
- package/dist/models/execution/model-call-accounting.d.ts.map +1 -0
- package/dist/models/execution/model-call-admission.d.ts +47 -0
- package/dist/models/execution/model-call-admission.d.ts.map +1 -0
- package/dist/models/execution/model-call-limits.d.ts +15 -0
- package/dist/models/execution/model-call-limits.d.ts.map +1 -0
- package/dist/models/execution/model-call-recorder.d.ts +40 -0
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -0
- package/dist/models/execution/model-call-recovery.d.ts +12 -0
- package/dist/models/execution/model-call-recovery.d.ts.map +1 -0
- package/dist/models/execution/recovery-queue.d.ts +5 -0
- package/dist/models/execution/recovery-queue.d.ts.map +1 -0
- package/dist/models/execution/types.d.ts +44 -0
- package/dist/models/execution/types.d.ts.map +1 -0
- package/dist/models/execution/usage.d.ts +5 -0
- package/dist/models/execution/usage.d.ts.map +1 -0
- package/dist/models/execution.d.ts +6 -0
- package/dist/models/execution.d.ts.map +1 -0
- package/dist/models/generation-types.d.ts +40 -0
- package/dist/models/generation-types.d.ts.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +42 -43
- package/dist/models/index.js.map +1 -1
- package/dist/models/language-model.d.ts +3 -0
- package/dist/models/language-model.d.ts.map +1 -1
- package/dist/models/output.d.ts +5 -0
- package/dist/models/output.d.ts.map +1 -0
- package/dist/models/resolve.d.ts +4 -0
- package/dist/models/resolve.d.ts.map +1 -0
- package/dist/objects/authorized-ontology-view.d.ts +25 -0
- package/dist/objects/authorized-ontology-view.d.ts.map +1 -0
- package/dist/objects/execution.d.ts +1 -1
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +75 -84
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/link/authorization.d.ts +2 -7
- package/dist/objects/link/authorization.d.ts.map +1 -1
- package/dist/objects/query/executor.d.ts +4 -2
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/index.js +67 -73
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/links.d.ts +22 -1
- package/dist/objects/query/links.d.ts.map +1 -1
- package/dist/objects/query/selected-read-admission.d.ts +27 -0
- package/dist/objects/query/selected-read-admission.d.ts.map +1 -0
- package/dist/objects/query/validate.d.ts +60 -2
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/object-handle.d.ts.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts +2 -7
- package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
- package/dist/objects/sdk/telemetry-channel.d.ts.map +1 -1
- package/dist/objects/service/list-service.d.ts +2 -3
- package/dist/objects/service/list-service.d.ts.map +1 -1
- package/dist/objects/telemetry/history.d.ts +8 -6
- package/dist/objects/telemetry/history.d.ts.map +1 -1
- package/dist/objects/telemetry/index.d.ts +2 -2
- package/dist/objects/telemetry/index.d.ts.map +1 -1
- package/dist/objects/telemetry/workload.d.ts +11 -0
- package/dist/objects/telemetry/workload.d.ts.map +1 -0
- package/dist/ontology/index.d.ts +2 -2
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +61 -111
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/inference/index.d.ts +2 -1
- package/dist/ontology/inference/index.d.ts.map +1 -1
- package/dist/ontology/internal.d.ts +7 -1
- package/dist/ontology/internal.d.ts.map +1 -1
- package/dist/ontology/internal.js +65 -121
- package/dist/ontology/internal.js.map +3 -4
- package/dist/ontology/json-schema.d.ts +10 -6
- package/dist/ontology/json-schema.d.ts.map +1 -1
- package/dist/ontology/link-path-selection.d.ts +35 -0
- package/dist/ontology/link-path-selection.d.ts.map +1 -0
- package/dist/ontology/refs.d.ts +2 -0
- package/dist/ontology/refs.d.ts.map +1 -1
- package/dist/ontology/tokens.d.ts +2 -1
- package/dist/ontology/tokens.d.ts.map +1 -1
- package/dist/pipelines/execution.d.ts.map +1 -1
- package/dist/pipelines/index.js +57 -63
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/request.d.ts.map +1 -1
- package/dist/projections/execution.d.ts.map +1 -1
- package/dist/projections/internal.js +58 -64
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/run-dispatch.d.ts.map +1 -1
- package/dist/query.d.ts +0 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +11 -15
- package/dist/query.js.map +1 -1
- package/dist/queues/index.d.ts +2 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +6 -7
- package/dist/queues/index.js.map +1 -1
- package/dist/queues/types.d.ts +3 -20
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/rules/execution.d.ts.map +1 -1
- package/dist/rules/internal.js +4 -5
- package/dist/rules/internal.js.map +1 -1
- package/dist/runtime/create.d.ts +6 -2
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +2 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +4 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +1 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +13 -14
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +2 -0
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts +6 -0
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +3 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/sandboxes/errors.d.ts +4 -0
- package/dist/sandboxes/errors.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +2 -2
- package/dist/sandboxes/index.d.ts.map +1 -1
- package/dist/sandboxes/index.js +14 -13
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/sandboxes/sandbox.d.ts +35 -7
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/scheduler/index.js +9 -10
- package/dist/scheduler/index.js.map +1 -1
- package/dist/schedules/execution.d.ts +2 -1
- package/dist/schedules/execution.d.ts.map +1 -1
- package/dist/schedules/index.js +31 -33
- package/dist/schedules/index.js.map +1 -1
- package/dist/security/every.d.ts +4 -1
- package/dist/security/every.d.ts.map +1 -1
- package/dist/security/grants.d.ts +7 -2
- package/dist/security/grants.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/registry.d.ts +1 -0
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/types.d.ts +7 -1
- package/dist/security/types.d.ts.map +1 -1
- package/dist/security/validation.d.ts +2 -0
- package/dist/security/validation.d.ts.map +1 -1
- package/dist/shares/access-plan.d.ts +22 -0
- package/dist/shares/access-plan.d.ts.map +1 -0
- package/dist/shares/builders.d.ts +14 -0
- package/dist/shares/builders.d.ts.map +1 -0
- package/dist/shares/compiler.d.ts +14 -0
- package/dist/shares/compiler.d.ts.map +1 -0
- package/dist/shares/errors.d.ts +4 -0
- package/dist/shares/errors.d.ts.map +1 -0
- package/dist/shares/execution.d.ts +57 -0
- package/dist/shares/execution.d.ts.map +1 -0
- package/dist/shares/index.d.ts +10 -0
- package/dist/shares/index.d.ts.map +1 -0
- package/dist/shares/internal.d.ts +3 -0
- package/dist/shares/internal.d.ts.map +1 -0
- package/dist/shares/internal.js +231 -0
- package/dist/shares/internal.js.map +10 -0
- package/dist/shares/intersection.d.ts +9 -0
- package/dist/shares/intersection.d.ts.map +1 -0
- package/dist/shares/session-protocol.d.ts +41 -0
- package/dist/shares/session-protocol.d.ts.map +1 -0
- package/dist/shares/types.d.ts +51 -0
- package/dist/shares/types.d.ts.map +1 -0
- package/dist/shares/validation.d.ts +11 -0
- package/dist/shares/validation.d.ts.map +1 -0
- package/dist/storage/action-runs/failure.js +7 -9
- package/dist/storage/action-runs/failure.js.map +1 -1
- package/dist/storage/action-runs/provider.js +4 -8
- package/dist/storage/action-runs/provider.js.map +1 -1
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +26 -30
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +0 -3
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/attribution.d.ts +4 -0
- package/dist/storage/ai-cost/attribution.d.ts.map +1 -0
- package/dist/storage/ai-cost/groups.d.ts +3 -0
- package/dist/storage/ai-cost/groups.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.d.ts +1 -0
- package/dist/storage/ai-cost/provider.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +30 -143
- package/dist/storage/ai-cost/provider.js.map +3 -4
- package/dist/storage/ai-cost/types.d.ts +15 -0
- package/dist/storage/ai-cost/types.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +14 -16
- package/dist/storage/ai-limits/enforcement.js.map +1 -1
- package/dist/storage/ai-limits/provider.js +56 -57
- package/dist/storage/ai-limits/provider.js.map +1 -1
- package/dist/storage/auth/in-memory.d.ts +1 -1
- package/dist/storage/auth/in-memory.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +34 -36
- package/dist/storage/connector-connections/provider.js.map +2 -2
- package/dist/storage/executions/in-memory.d.ts +3 -0
- package/dist/storage/executions/in-memory.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +6 -2
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +35 -12
- package/dist/storage/executions/provider.js.map +3 -3
- package/dist/storage/executions/run-link.d.ts +7 -0
- package/dist/storage/executions/run-link.d.ts.map +1 -1
- package/dist/storage/executions/types.d.ts +6 -2
- package/dist/storage/executions/types.d.ts.map +1 -1
- package/dist/storage/executions/validation.d.ts +8 -0
- package/dist/storage/executions/validation.d.ts.map +1 -1
- package/dist/storage/in-memory/index.d.ts +8 -0
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +14 -9
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +221 -227
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +10 -0
- package/dist/storage/internal.d.ts.map +1 -0
- package/dist/storage/internal.js +47 -0
- package/dist/storage/internal.js.map +9 -0
- package/dist/storage/objects/execution-limits.d.ts +25 -0
- package/dist/storage/objects/execution-limits.d.ts.map +1 -0
- package/dist/storage/objects/guard.d.ts +16 -0
- package/dist/storage/objects/guard.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/index.d.ts +3 -0
- package/dist/storage/objects/in-memory/index.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/keys.d.ts +10 -0
- package/dist/storage/objects/in-memory/keys.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/query.d.ts +31 -0
- package/dist/storage/objects/in-memory/query.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/read-scope.d.ts +18 -0
- package/dist/storage/objects/in-memory/read-scope.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/read-source.d.ts +10 -0
- package/dist/storage/objects/in-memory/read-source.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/selected-reader.d.ts +9 -0
- package/dist/storage/objects/in-memory/selected-reader.d.ts.map +1 -0
- package/dist/storage/objects/{in-memory.d.ts → in-memory/storage.d.ts} +13 -10
- package/dist/storage/objects/in-memory/storage.d.ts.map +1 -0
- package/dist/storage/objects/index.d.ts +4 -1
- package/dist/storage/objects/index.d.ts.map +1 -1
- package/dist/storage/objects/keys.d.ts +1 -1
- package/dist/storage/objects/keys.d.ts.map +1 -1
- package/dist/storage/objects/read-scope.d.ts +25 -0
- package/dist/storage/objects/read-scope.d.ts.map +1 -0
- package/dist/storage/objects/types.d.ts +114 -22
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +105 -109
- package/dist/storage/ontology/provider.js.map +1 -1
- package/dist/storage/operation-scope.d.ts +3 -0
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +18 -17
- package/dist/storage/operation-scope.js.map +1 -1
- package/dist/storage/pipeline-runs/provider.js +4 -6
- package/dist/storage/pipeline-runs/provider.js.map +1 -1
- package/dist/storage/projection-runs/provider.js +66 -70
- package/dist/storage/projection-runs/provider.js.map +1 -1
- package/dist/storage/share-grants/errors.d.ts +8 -0
- package/dist/storage/share-grants/errors.d.ts.map +1 -0
- package/dist/storage/share-grants/in-memory.d.ts +11 -0
- package/dist/storage/share-grants/in-memory.d.ts.map +1 -0
- package/dist/storage/share-grants/index.d.ts +5 -0
- package/dist/storage/share-grants/index.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.d.ts +4 -0
- package/dist/storage/share-grants/provider.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.js +22 -0
- package/dist/storage/share-grants/provider.js.map +9 -0
- package/dist/storage/share-grants/record.d.ts +11 -0
- package/dist/storage/share-grants/record.d.ts.map +1 -0
- package/dist/storage/share-grants/types.d.ts +97 -0
- package/dist/storage/share-grants/types.d.ts.map +1 -0
- package/dist/storage/share-sessions/errors.d.ts +8 -0
- package/dist/storage/share-sessions/errors.d.ts.map +1 -0
- package/dist/storage/share-sessions/in-memory.d.ts +14 -0
- package/dist/storage/share-sessions/in-memory.d.ts.map +1 -0
- package/dist/storage/share-sessions/index.d.ts +5 -0
- package/dist/storage/share-sessions/index.d.ts.map +1 -0
- package/dist/storage/share-sessions/provider.d.ts +3 -0
- package/dist/storage/share-sessions/provider.d.ts.map +1 -0
- package/dist/storage/share-sessions/provider.js +19 -0
- package/dist/storage/share-sessions/provider.js.map +9 -0
- package/dist/storage/share-sessions/record.d.ts +8 -0
- package/dist/storage/share-sessions/record.d.ts.map +1 -0
- package/dist/storage/share-sessions/types.d.ts +50 -0
- package/dist/storage/share-sessions/types.d.ts.map +1 -0
- package/dist/storage/sync-runs/provider.js +4 -6
- package/dist/storage/sync-runs/provider.js.map +1 -1
- package/dist/storage/transaction.d.ts +2 -1
- package/dist/storage/transaction.d.ts.map +1 -1
- package/dist/storage/types.d.ts +8 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/webhook-runs/provider.js +4 -6
- package/dist/storage/webhook-runs/provider.js.map +1 -1
- package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +13 -18
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/storage/workflow-runs/types.d.ts +0 -3
- package/dist/storage/workflow-runs/types.d.ts.map +1 -1
- package/dist/syncs/execution.d.ts.map +1 -1
- package/dist/syncs/index.js +55 -62
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/request.d.ts.map +1 -1
- package/dist/testing/action-execution.d.ts +4 -1
- package/dist/testing/action-execution.d.ts.map +1 -1
- package/dist/testing/agent-execution.d.ts +1 -0
- package/dist/testing/agent-execution.d.ts.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
- package/dist/testing/dataset-sequence-contract.d.ts +4 -0
- package/dist/testing/dataset-sequence-contract.d.ts.map +1 -0
- package/dist/testing/effective-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts +4 -0
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution.d.ts +1 -0
- package/dist/testing/execution.d.ts.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3087 -1328
- package/dist/testing/index.js.map +17 -13
- package/dist/testing/lake-merge-storage-contract.d.ts +1 -0
- package/dist/testing/lake-merge-storage-contract.d.ts.map +1 -1
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/object-read-scope-contract.d.ts +22 -0
- package/dist/testing/object-read-scope-contract.d.ts.map +1 -0
- package/dist/testing/share-grant-storage-contract.d.ts +10 -0
- package/dist/testing/share-grant-storage-contract.d.ts.map +1 -0
- package/dist/testing/share-session-storage-contract.d.ts +9 -0
- package/dist/testing/share-session-storage-contract.d.ts.map +1 -0
- package/dist/testing/workflow-execution.d.ts +1 -0
- package/dist/testing/workflow-execution.d.ts.map +1 -1
- package/dist/webhooks/internal.js +51 -56
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +11 -13
- package/dist/workers/index.js.map +2 -2
- package/dist/workflows/execution.d.ts.map +1 -1
- package/dist/workflows/failure.d.ts +2 -0
- package/dist/workflows/failure.d.ts.map +1 -1
- package/dist/workflows/index.js +135 -140
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/request.d.ts.map +1 -1
- package/dist/workflows/run-dispatch.d.ts +0 -1
- package/dist/workflows/run-dispatch.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +2 -0
- package/dist/workflows/types.d.ts.map +1 -1
- package/package.json +72 -30
- package/src/actions/delegated-admission.ts +72 -0
- package/src/actions/descriptor.ts +58 -0
- package/src/actions/execution.ts +99 -24
- package/src/actions/request.ts +136 -19
- package/src/actions/run-authorization.ts +53 -0
- package/src/actions/run-dispatch.ts +10 -7
- package/src/actions/types/context.ts +2 -0
- package/src/actions/validation.ts +2 -1
- package/src/agents/adapters.ts +34 -429
- package/src/agents/authority.ts +3 -4
- package/src/agents/{context.ts → context/entries.ts} +4 -4
- package/src/agents/context/index.ts +15 -0
- package/src/agents/context-model.ts +1 -1
- package/src/agents/context-resolution.ts +2 -5
- package/src/agents/errors.ts +0 -10
- package/src/agents/execution.ts +13 -5
- package/src/agents/identity.ts +4 -0
- package/src/agents/index.ts +5 -24
- package/src/agents/message.ts +5 -6
- package/src/agents/model-loop.ts +62 -6
- package/src/agents/request.ts +27 -29
- package/src/agents/streams/index.ts +18 -0
- package/src/agents/streams/internal.ts +19 -0
- package/src/agents/{streams.ts → streams/protocol.ts} +5 -5
- package/src/agents/tool-definition.ts +0 -19
- package/src/agents/types.ts +1 -1
- package/src/agents/validation.ts +9 -72
- package/src/ai-usage/execution.ts +4 -11
- package/src/auth/index.ts +0 -1
- package/src/authorization/decision.ts +29 -14
- package/src/authorization/grant-kinds.ts +10 -0
- package/src/authorization/index.ts +1 -0
- package/src/bootstrap/discovery.ts +84 -24
- package/src/bootstrap/index.ts +8 -1
- package/src/bootstrap/ontology-type-manifest.ts +12 -6
- package/src/datasets/builders.ts +23 -2
- package/src/datasets/changes.ts +16 -4
- package/src/datasets/execution.ts +76 -5
- package/src/datasets/index.ts +1 -0
- package/src/datasets/sequence.ts +77 -0
- package/src/datasets/types.ts +1 -0
- package/src/datasets/validation.ts +26 -0
- package/src/datasets/write.ts +240 -0
- package/src/errors/internal.ts +90 -10
- package/src/errors/redaction.ts +98 -0
- package/src/errors/types.ts +4 -0
- package/src/events/execution.ts +57 -7
- package/src/events/types/datasets.ts +2 -6
- package/src/execution/agent.ts +6 -7
- package/src/execution/authorization.ts +470 -90
- package/src/execution/authorized-object-reader.ts +695 -0
- package/src/execution/durable.ts +21 -3
- package/src/execution/index.ts +1 -0
- package/src/execution/primitive.ts +5 -1
- package/src/execution/request.ts +66 -13
- package/src/execution/scopes.ts +36 -6
- package/src/execution/types.ts +8 -0
- package/src/http/api-routes.ts +45 -0
- package/src/index.ts +56 -33
- package/src/lake-storage/definition-updates.ts +9 -0
- package/src/lake-storage/errors.ts +6 -1
- package/src/lake-storage/in-memory.ts +53 -17
- package/src/lake-storage/index.ts +10 -1
- package/src/lake-storage/merge-validation.ts +12 -2
- package/src/lake-storage/merge.ts +40 -2
- package/src/lake-storage/source-ordering.ts +95 -0
- package/src/lake-storage/sql-transforms.ts +2 -1
- package/src/lake-storage/types.ts +10 -5
- package/src/lake-storage/version-inputs.ts +14 -0
- package/src/logging/index.ts +2 -33
- package/src/logging/internal.ts +43 -0
- package/src/models/errors.ts +12 -0
- package/src/models/execution/binding.ts +29 -0
- package/src/models/execution/errors.ts +18 -0
- package/src/models/execution/index.ts +26 -0
- package/src/models/execution/model-call-accounting.ts +211 -0
- package/src/models/execution/model-call-admission.ts +127 -0
- package/src/models/execution/model-call-limits.ts +135 -0
- package/src/models/execution/model-call-recorder.ts +235 -0
- package/src/models/execution/model-call-recovery.ts +125 -0
- package/src/models/execution/recovery-queue.ts +31 -0
- package/src/models/execution/types.ts +58 -0
- package/src/models/execution/usage.ts +23 -0
- package/src/models/execution.ts +207 -0
- package/src/models/generation-types.ts +50 -0
- package/src/models/index.ts +8 -0
- package/src/models/language-model.ts +3 -0
- package/src/models/output.ts +45 -0
- package/src/models/resolve.ts +27 -0
- package/src/objects/authorized-ontology-view.ts +512 -0
- package/src/objects/execution.ts +99 -144
- package/src/objects/link/authorization.ts +3 -2
- package/src/objects/query/executor.ts +45 -34
- package/src/objects/query/links.ts +84 -25
- package/src/objects/query/selected-read-admission.ts +310 -0
- package/src/objects/query/validate.ts +353 -36
- package/src/objects/sdk/object-handle.ts +2 -8
- package/src/objects/sdk/object-set.ts +10 -11
- package/src/objects/sdk/runtime-query-executor.ts +8 -28
- package/src/objects/sdk/telemetry-channel.ts +11 -7
- package/src/objects/service/list-service.ts +15 -29
- package/src/objects/telemetry/history.ts +297 -17
- package/src/objects/telemetry/index.ts +2 -2
- package/src/objects/telemetry/workload.ts +79 -0
- package/src/ontology/index.ts +7 -2
- package/src/ontology/inference/index.ts +4 -1
- package/src/ontology/internal.ts +35 -1
- package/src/ontology/json-schema.ts +13 -12
- package/src/ontology/link-path-selection.ts +193 -0
- package/src/ontology/refs.ts +19 -0
- package/src/ontology/tokens.ts +15 -8
- package/src/pipelines/execution.ts +30 -7
- package/src/pipelines/request.ts +5 -0
- package/src/projections/execution.ts +72 -11
- package/src/projections/run-dispatch.ts +7 -12
- package/src/query.ts +0 -1
- package/src/queues/index.ts +4 -2
- package/src/queues/types.ts +6 -25
- package/src/rules/execution.ts +20 -8
- package/src/runtime/create.ts +7 -2
- package/src/runtime/definitions.ts +2 -0
- package/src/runtime/host.ts +27 -7
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/resolve-definitions.ts +9 -0
- package/src/runtime/sixb.ts +27 -2
- package/src/runtime/types.ts +3 -0
- package/src/sandboxes/errors.ts +5 -0
- package/src/sandboxes/index.ts +3 -0
- package/src/sandboxes/sandbox.ts +35 -7
- package/src/schedules/execution.ts +24 -2
- package/src/security/every.ts +4 -0
- package/src/security/grants.ts +45 -3
- package/src/security/index.ts +1 -0
- package/src/security/registry.ts +3 -0
- package/src/security/types.ts +8 -0
- package/src/security/validation.ts +3 -0
- package/src/shares/access-plan.ts +225 -0
- package/src/shares/builders.ts +381 -0
- package/src/shares/compiler.ts +359 -0
- package/src/shares/errors.ts +3 -0
- package/src/shares/execution.ts +394 -0
- package/src/shares/index.ts +28 -0
- package/src/shares/internal.ts +9 -0
- package/src/shares/intersection.ts +178 -0
- package/src/shares/session-protocol.ts +258 -0
- package/src/shares/types.ts +76 -0
- package/src/shares/validation.ts +40 -0
- package/src/storage/agents/in-memory.ts +0 -3
- package/src/storage/agents/types.ts +0 -3
- package/src/storage/ai-cost/analytics.ts +1 -1
- package/src/storage/ai-cost/attribution.ts +15 -0
- package/src/storage/ai-cost/groups.ts +5 -1
- package/src/storage/ai-cost/provider.ts +1 -0
- package/src/storage/ai-cost/types.ts +7 -0
- package/src/storage/auth/in-memory.ts +1 -1
- package/src/storage/executions/in-memory.ts +13 -10
- package/src/storage/executions/provider.ts +34 -1
- package/src/storage/executions/run-link.ts +29 -0
- package/src/storage/executions/types.ts +6 -2
- package/src/storage/executions/validation.ts +78 -1
- package/src/storage/in-memory/index.ts +37 -3
- package/src/storage/index.ts +54 -29
- package/src/storage/internal.ts +20 -0
- package/src/storage/objects/execution-limits.ts +283 -0
- package/src/storage/objects/guard.ts +55 -0
- package/src/storage/objects/in-memory/index.ts +2 -0
- package/src/storage/objects/in-memory/keys.ts +46 -0
- package/src/storage/objects/in-memory/query.ts +754 -0
- package/src/storage/objects/in-memory/read-scope.ts +211 -0
- package/src/storage/objects/in-memory/read-source.ts +10 -0
- package/src/storage/objects/in-memory/selected-reader.ts +252 -0
- package/src/storage/objects/in-memory/storage.ts +589 -0
- package/src/storage/objects/index.ts +21 -0
- package/src/storage/objects/keys.ts +1 -1
- package/src/storage/objects/read-scope.ts +672 -0
- package/src/storage/objects/types.ts +123 -19
- package/src/storage/operation-scope.ts +16 -0
- package/src/storage/share-grants/errors.ts +14 -0
- package/src/storage/share-grants/in-memory.ts +107 -0
- package/src/storage/share-grants/index.ts +14 -0
- package/src/storage/share-grants/provider.ts +11 -0
- package/src/storage/share-grants/record.ts +347 -0
- package/src/storage/share-grants/types.ts +112 -0
- package/src/storage/share-sessions/errors.ts +14 -0
- package/src/storage/share-sessions/in-memory.ts +105 -0
- package/src/storage/share-sessions/index.ts +11 -0
- package/src/storage/share-sessions/provider.ts +9 -0
- package/src/storage/share-sessions/record.ts +176 -0
- package/src/storage/share-sessions/types.ts +57 -0
- package/src/storage/transaction.ts +14 -2
- package/src/storage/types.ts +27 -0
- package/src/storage/workflow-runs/in-memory.ts +0 -2
- package/src/storage/workflow-runs/types.ts +0 -3
- package/src/syncs/execution.ts +25 -5
- package/src/syncs/request.ts +5 -0
- package/src/testing/action-execution.ts +9 -2
- package/src/testing/agent-execution.ts +3 -0
- package/src/testing/agent-storage-contract.ts +0 -5
- package/src/testing/ai-model-call-groups-contract.ts +74 -2
- package/src/testing/dataset-sequence-contract.ts +373 -0
- package/src/testing/effective-storage-contract.ts +34 -0
- package/src/testing/execution-storage-contract.ts +138 -1
- package/src/testing/execution.ts +6 -0
- package/src/testing/index.ts +16 -0
- package/src/testing/lake-merge-storage-contract.ts +3 -0
- package/src/testing/lake-storage-contract.ts +58 -0
- package/src/testing/object-read-scope-contract.ts +939 -0
- package/src/testing/share-grant-storage-contract.ts +325 -0
- package/src/testing/share-session-storage-contract.ts +235 -0
- package/src/testing/workflow-execution.ts +4 -0
- package/src/workflows/execution.ts +53 -14
- package/src/workflows/failure.ts +62 -1
- package/src/workflows/request.ts +5 -9
- package/src/workflows/run-dispatch.ts +0 -3
- package/src/workflows/types.ts +2 -0
- package/src/workflows/validation.ts +1 -1
- package/dist/agents/context.d.ts.map +0 -1
- package/dist/agents/context.js +0 -23
- package/dist/agents/streams.d.ts.map +0 -1
- package/dist/agents/streams.js +0 -55
- package/dist/chunk-08m3b6w8.js +0 -32
- package/dist/chunk-08twe8m6.js +0 -218
- package/dist/chunk-2b5qtban.js.map +0 -14
- package/dist/chunk-2xns679x.js.map +0 -11
- package/dist/chunk-37wk412q.js +0 -1370
- package/dist/chunk-37wk412q.js.map +0 -23
- package/dist/chunk-3fqt22c4.js.map +0 -14
- package/dist/chunk-3kv70xwp.js.map +0 -10
- package/dist/chunk-407j3msh.js +0 -60
- package/dist/chunk-64sr682n.js.map +0 -12
- package/dist/chunk-6ed5bwnd.js.map +0 -57
- package/dist/chunk-7ds9620f.js.map +0 -10
- package/dist/chunk-7y0f6rf1.js.map +0 -10
- package/dist/chunk-atmkaf60.js.map +0 -11
- package/dist/chunk-c15dr03f.js +0 -43
- package/dist/chunk-d8qkxt2v.js.map +0 -10
- package/dist/chunk-dqn23610.js +0 -72
- package/dist/chunk-dqn23610.js.map +0 -11
- package/dist/chunk-e4rvtvpw.js.map +0 -34
- package/dist/chunk-gbrpsx4m.js.map +0 -11
- package/dist/chunk-h0knpbz5.js +0 -2486
- package/dist/chunk-h0knpbz5.js.map +0 -38
- package/dist/chunk-hdz94br2.js.map +0 -10
- package/dist/chunk-jq43kdvk.js +0 -50
- package/dist/chunk-n2arzn6e.js +0 -1745
- package/dist/chunk-n2arzn6e.js.map +0 -20
- package/dist/chunk-p03r0h5s.js.map +0 -16
- package/dist/chunk-qjzp9xyb.js.map +0 -12
- package/dist/chunk-tn7xcs2n.js.map +0 -13
- package/dist/chunk-wjgm6jjt.js.map +0 -13
- package/dist/chunk-xc7hq65b.js.map +0 -10
- package/dist/chunk-y35ma3mj.js +0 -551
- package/dist/chunk-y35ma3mj.js.map +0 -15
- package/dist/chunk-y64skrwp.js +0 -19
- package/dist/chunk-z2sery1b.js.map +0 -11
- package/dist/chunk-zcnhxkvd.js +0 -7
- package/dist/logging/types.js +0 -27
- package/dist/logging/types.js.map +0 -9
- package/dist/storage/objects/in-memory.d.ts.map +0 -1
- package/src/storage/objects/in-memory.ts +0 -1241
- /package/dist/{chunk-zqqz8052.js → chunk-7n30ybym.js} +0 -0
- /package/dist/{chunk-zqqz8052.js.map → chunk-7n30ybym.js.map} +0 -0
- /package/dist/{chunk-4a849fr1.js.map → chunk-9tc8dxmn.js.map} +0 -0
|
@@ -1,77 +1,91 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
resolveRuntimeAuthorizationForProject,
|
|
4
|
+
assertAuthorized2,
|
|
5
|
+
assertCanEdit2,
|
|
6
|
+
assertCanAppendTelemetry2
|
|
7
|
+
} from "./chunk-dz5h08xv.js";
|
|
5
8
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./chunk-xhy826cz.js";
|
|
9
|
+
createSixbError2
|
|
10
|
+
} from "./chunk-f4w3yp4f.js";
|
|
9
11
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
normalizeObjectProperties2,
|
|
13
|
+
assertPropertyTokenBelongsToObjectType2,
|
|
14
|
+
assertLinkTokenBelongsToObjectType2,
|
|
15
|
+
assertKnownProperties2,
|
|
16
|
+
validateObjectProperties2,
|
|
17
|
+
assertLinkTargetType2,
|
|
18
|
+
normalizeLinkProperties2,
|
|
19
|
+
validateLinkProperties2,
|
|
20
|
+
assertTelemetryProperty2
|
|
21
|
+
} from "./chunk-ms2tmn1k.js";
|
|
17
22
|
import {
|
|
18
|
-
|
|
19
|
-
} from "./chunk-
|
|
23
|
+
RuntimeError2
|
|
24
|
+
} from "./chunk-e0d1rzef.js";
|
|
20
25
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from "./chunk-y35ma3mj.js";
|
|
26
|
+
ObjectNotFoundError2
|
|
27
|
+
} from "./chunk-8vj0rjgs.js";
|
|
24
28
|
import {
|
|
25
|
-
|
|
26
|
-
} from "./chunk-
|
|
29
|
+
objectBatchKey2
|
|
30
|
+
} from "./chunk-mjbk2djy.js";
|
|
27
31
|
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
linkRefKey2,
|
|
33
|
+
telemetryPointKey2
|
|
34
|
+
} from "./chunk-c5rkjrgp.js";
|
|
31
35
|
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} from "./chunk-
|
|
36
|
+
validateObjectQuery2,
|
|
37
|
+
explainObjectQuery2
|
|
38
|
+
} from "./chunk-0w35wavj.js";
|
|
35
39
|
import {
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
assertAuthorizedObjectReaderBinding,
|
|
41
|
+
getAuthorizedOntologyView,
|
|
42
|
+
requestAction3,
|
|
43
|
+
requestActionAndWait2
|
|
44
|
+
} from "./chunk-ypbtykv6.js";
|
|
38
45
|
import {
|
|
39
|
-
|
|
40
|
-
} from "./chunk-
|
|
46
|
+
shareSixbErrorReporter2
|
|
47
|
+
} from "./chunk-7apz6hg4.js";
|
|
41
48
|
import {
|
|
42
|
-
|
|
43
|
-
} from "./chunk-
|
|
49
|
+
normalizeJsonProperties2
|
|
50
|
+
} from "./chunk-an5tt9y0.js";
|
|
44
51
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
assertPrivileged
|
|
49
|
-
} from "./chunk-37wk412q.js";
|
|
52
|
+
getOntologyMutationRuntime2,
|
|
53
|
+
shareOntologyMutationRuntime2
|
|
54
|
+
} from "./chunk-zcnq6105.js";
|
|
50
55
|
import {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
assertLinkTokenBelongsToObjectType,
|
|
54
|
-
assertPropertyTokenBelongsToObjectType,
|
|
55
|
-
assertTelemetryProperty,
|
|
56
|
-
normalizeLinkProperties,
|
|
57
|
-
normalizeObjectProperties,
|
|
58
|
-
validateLinkProperties,
|
|
59
|
-
validateObjectProperties
|
|
60
|
-
} from "./chunk-d63tybny.js";
|
|
56
|
+
createObjectQueryBuilder2
|
|
57
|
+
} from "./chunk-rb1xx120.js";
|
|
61
58
|
import {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} from "./chunk-dktq02ne.js";
|
|
59
|
+
ObjectQueryPlanningError2
|
|
60
|
+
} from "./chunk-5hz0fnca.js";
|
|
65
61
|
import {
|
|
66
|
-
|
|
67
|
-
} from "./chunk-
|
|
62
|
+
MaterializationObjectNotFoundError2
|
|
63
|
+
} from "./chunk-yv79ncbv.js";
|
|
68
64
|
import {
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
OntologyValidationError2,
|
|
66
|
+
OntologyNotFoundError2
|
|
67
|
+
} from "./chunk-cqr3acm1.js";
|
|
68
|
+
import {
|
|
69
|
+
stableJsonStringify2
|
|
70
|
+
} from "./chunk-wy0qdqfm.js";
|
|
71
|
+
var __defProp = Object.defineProperty;
|
|
72
|
+
var __returnValue = (v) => v;
|
|
73
|
+
function __exportSetter(name, newValue) {
|
|
74
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
75
|
+
}
|
|
76
|
+
var __export = (target, all) => {
|
|
77
|
+
for (var name in all)
|
|
78
|
+
__defProp(target, name, {
|
|
79
|
+
get: all[name],
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true,
|
|
82
|
+
set: __exportSetter.bind(all, name)
|
|
83
|
+
});
|
|
84
|
+
};
|
|
71
85
|
|
|
72
86
|
// src/objects/action/request.ts
|
|
73
87
|
async function requestAction2(ctx, params) {
|
|
74
|
-
return
|
|
88
|
+
return requestAction3(ctx, ctx.execution, {
|
|
75
89
|
actionId: params.actionId,
|
|
76
90
|
subject: {
|
|
77
91
|
kind: "object",
|
|
@@ -83,8 +97,8 @@ async function requestAction2(ctx, params) {
|
|
|
83
97
|
signal: params.options?.signal
|
|
84
98
|
});
|
|
85
99
|
}
|
|
86
|
-
async function
|
|
87
|
-
return
|
|
100
|
+
async function requestActionAndWait(ctx, params) {
|
|
101
|
+
return requestActionAndWait2(ctx, ctx.execution, {
|
|
88
102
|
actionId: params.actionId,
|
|
89
103
|
subject: {
|
|
90
104
|
kind: "object",
|
|
@@ -99,14 +113,14 @@ async function requestActionAndWait2(ctx, params) {
|
|
|
99
113
|
});
|
|
100
114
|
}
|
|
101
115
|
// src/objects/errors.ts
|
|
102
|
-
class
|
|
116
|
+
class ObjectError2 extends Error {
|
|
103
117
|
name = "ObjectError";
|
|
104
118
|
}
|
|
105
119
|
|
|
106
120
|
// src/objects/materializer-adapter.ts
|
|
107
121
|
import { randomUUID } from "crypto";
|
|
108
122
|
async function commitRuntimeOperations(ctx, operations) {
|
|
109
|
-
const mutations =
|
|
123
|
+
const mutations = getOntologyMutationRuntime2(ctx);
|
|
110
124
|
const commit = await mutations.commitEdits({
|
|
111
125
|
mode: "atomic",
|
|
112
126
|
source: { kind: "runtime", requestId: randomUUID() },
|
|
@@ -123,7 +137,7 @@ async function commitRuntimeBatch(ctx, groups) {
|
|
|
123
137
|
return { commit: null, outcomes: new Map };
|
|
124
138
|
}
|
|
125
139
|
const operationGroups = groups.filter((group) => group.operations.length > 1).map((group) => group.operations.map((operation) => operation.id));
|
|
126
|
-
const mutations =
|
|
140
|
+
const mutations = getOntologyMutationRuntime2(ctx);
|
|
127
141
|
const commit = await mutations.commitEdits({
|
|
128
142
|
mode: "continue",
|
|
129
143
|
source: { kind: "runtime", requestId: randomUUID() },
|
|
@@ -142,27 +156,27 @@ function runtimeOperationId(index, subOrdinal = 0) {
|
|
|
142
156
|
}
|
|
143
157
|
function normalizeRuntimeObject(input) {
|
|
144
158
|
const { objectType, primaryPropertyId, properties, valueTypesById } = input;
|
|
145
|
-
|
|
146
|
-
|
|
159
|
+
assertKnownProperties2(objectType, properties);
|
|
160
|
+
validateObjectProperties2(objectType, properties, valueTypesById);
|
|
147
161
|
const primaryValue = properties[primaryPropertyId];
|
|
148
162
|
if (primaryValue === undefined || primaryValue === null) {
|
|
149
|
-
throw new
|
|
163
|
+
throw new OntologyValidationError2(`[Sixb] Missing primary property '${primaryPropertyId}' in upsert for '${objectType.id}'`);
|
|
150
164
|
}
|
|
151
|
-
const normalized =
|
|
165
|
+
const normalized = normalizeObjectProperties2(objectType.properties, properties, valueTypesById, objectType.id);
|
|
152
166
|
const { [primaryPropertyId]: _identity, ...managed } = normalized;
|
|
153
167
|
return {
|
|
154
168
|
primaryId: String(primaryValue),
|
|
155
|
-
properties:
|
|
169
|
+
properties: normalizeJsonProperties2(managed, `${objectType.id} properties`)
|
|
156
170
|
};
|
|
157
171
|
}
|
|
158
172
|
function normalizeRuntimeLink(input) {
|
|
159
173
|
const { objectType, linkDefinition, linkId, targetTypeId, properties, valueTypesById } = input;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const normalized =
|
|
174
|
+
assertLinkTargetType2(objectType.id, linkId, linkDefinition, targetTypeId, input.isValidLinkTarget);
|
|
175
|
+
validateLinkProperties2(objectType, linkDefinition, properties, undefined, valueTypesById);
|
|
176
|
+
const normalized = normalizeLinkProperties2(objectType, linkDefinition, properties, valueTypesById);
|
|
163
177
|
if (normalized === undefined)
|
|
164
178
|
return;
|
|
165
|
-
return
|
|
179
|
+
return normalizeJsonProperties2(normalized, `${objectType.id}.${linkId} properties`);
|
|
166
180
|
}
|
|
167
181
|
function objectUpsertOperation(input) {
|
|
168
182
|
return { id: input.id, kind: "object.upsert", ref: input.ref, properties: input.properties };
|
|
@@ -187,13 +201,13 @@ function linkDeleteOperation(input) {
|
|
|
187
201
|
function requireItemOutcomes(commit, index) {
|
|
188
202
|
const outcomes = commit.outcomes.get(index);
|
|
189
203
|
if (!outcomes || outcomes.length === 0) {
|
|
190
|
-
throw new
|
|
204
|
+
throw new ObjectError2(`[Sixb] Materializer returned no outcome for batch item ${index}.`);
|
|
191
205
|
}
|
|
192
206
|
return outcomes;
|
|
193
207
|
}
|
|
194
208
|
function requireEffectiveObject(outcome) {
|
|
195
209
|
if (!outcome.ok || !outcome.object) {
|
|
196
|
-
throw new
|
|
210
|
+
throw new ObjectError2(`[Sixb] Materializer returned no effective object for '${outcome.id}'.`);
|
|
197
211
|
}
|
|
198
212
|
return outcome.object;
|
|
199
213
|
}
|
|
@@ -212,29 +226,29 @@ function toObjectRow(projectId, snapshot) {
|
|
|
212
226
|
function toItemError(error) {
|
|
213
227
|
switch (error.code) {
|
|
214
228
|
case "validation":
|
|
215
|
-
return new
|
|
229
|
+
return new OntologyValidationError2(error.message);
|
|
216
230
|
}
|
|
217
231
|
}
|
|
218
232
|
function requireOutcome(outcomes, id) {
|
|
219
233
|
const outcome = outcomes.get(id);
|
|
220
234
|
if (!outcome) {
|
|
221
|
-
throw new
|
|
235
|
+
throw new ObjectError2(`[Sixb] Materializer returned no outcome for '${id}'.`);
|
|
222
236
|
}
|
|
223
237
|
return outcome;
|
|
224
238
|
}
|
|
225
239
|
|
|
226
240
|
// src/objects/link/authorization.ts
|
|
227
241
|
function assertCanWriteLink(ctx, endpoints) {
|
|
228
|
-
|
|
229
|
-
|
|
242
|
+
assertCanEdit2(ctx, endpoints.sourceTypeId);
|
|
243
|
+
assertAuthorized2(ctx, { kind: "object.view", objectTypeId: endpoints.targetTypeId });
|
|
230
244
|
}
|
|
231
245
|
|
|
232
246
|
// src/objects/link/remove.ts
|
|
233
|
-
async function
|
|
247
|
+
async function removeLink2(ctx, params) {
|
|
234
248
|
const { objectType, linkDefinition, ontology } = ctx;
|
|
235
249
|
const { sourceId, linkId, targetTypeId, targetId } = params;
|
|
236
250
|
assertCanWriteLink(ctx, { sourceTypeId: objectType.id, targetTypeId });
|
|
237
|
-
|
|
251
|
+
assertLinkTargetType2(objectType.id, linkId, linkDefinition, targetTypeId, (expected, actual) => ontology.isValidLinkTarget(expected, actual));
|
|
238
252
|
await commitRuntimeOperations(ctx, [
|
|
239
253
|
linkDeleteOperation({
|
|
240
254
|
id: runtimeOperationId(0),
|
|
@@ -276,18 +290,18 @@ async function loadEndpointExistence(ctx, lookups) {
|
|
|
276
290
|
}
|
|
277
291
|
function requireEndpoints(item, existing) {
|
|
278
292
|
if (!existing.has(endpointKey(item.objectType.id, item.sourceId))) {
|
|
279
|
-
throw new
|
|
293
|
+
throw new ObjectNotFoundError2(item.objectType.id, item.sourceId, "Source object not found");
|
|
280
294
|
}
|
|
281
295
|
if (!existing.has(endpointKey(item.targetTypeId, item.targetId))) {
|
|
282
|
-
throw new
|
|
296
|
+
throw new ObjectNotFoundError2(item.targetTypeId, item.targetId, "Target object not found");
|
|
283
297
|
}
|
|
284
298
|
}
|
|
285
299
|
function endpointKey(objectTypeId, primaryId) {
|
|
286
|
-
return
|
|
300
|
+
return objectBatchKey2(objectTypeId, primaryId);
|
|
287
301
|
}
|
|
288
302
|
|
|
289
303
|
// src/objects/link/upsert.ts
|
|
290
|
-
async function
|
|
304
|
+
async function upsertLink2(ctx, params) {
|
|
291
305
|
const { objectType, linkDefinition, ontology } = ctx;
|
|
292
306
|
const { sourceId, linkId, targetTypeId, targetId, properties } = params;
|
|
293
307
|
assertCanWriteLink(ctx, { sourceTypeId: objectType.id, targetTypeId });
|
|
@@ -340,7 +354,7 @@ async function runRuntimeItemBatch(batch) {
|
|
|
340
354
|
if (claimed.fingerprint !== plan.fingerprint) {
|
|
341
355
|
results[index] = {
|
|
342
356
|
ok: false,
|
|
343
|
-
error: new
|
|
357
|
+
error: new OntologyValidationError2(`[Sixb] Conflicting duplicate ${plan.label} at batch positions ${claimed.index} and ${index}`)
|
|
344
358
|
};
|
|
345
359
|
continue;
|
|
346
360
|
}
|
|
@@ -363,7 +377,7 @@ async function runRuntimeItemBatch(batch) {
|
|
|
363
377
|
}
|
|
364
378
|
|
|
365
379
|
// src/objects/link/upsert-batch.ts
|
|
366
|
-
async function
|
|
380
|
+
async function upsertLinkBatch2(ctx, items) {
|
|
367
381
|
const { ontology } = ctx;
|
|
368
382
|
if (items.length === 0)
|
|
369
383
|
return [];
|
|
@@ -394,11 +408,11 @@ async function upsertLinkBatch(ctx, items) {
|
|
|
394
408
|
linkId: item.linkId,
|
|
395
409
|
target: { objectTypeId: item.targetTypeId, primaryId: item.targetId }
|
|
396
410
|
};
|
|
397
|
-
const edge =
|
|
411
|
+
const edge = linkRefKey2(ref);
|
|
398
412
|
return {
|
|
399
413
|
key: edge,
|
|
400
414
|
label: `link '${item.objectType.id}:${item.sourceId}.${item.linkId} -> ${item.targetTypeId}:${item.targetId}'`,
|
|
401
|
-
fingerprint:
|
|
415
|
+
fingerprint: stableJsonStringify2(properties ?? null),
|
|
402
416
|
operations: [
|
|
403
417
|
linkUpsertOperation({
|
|
404
418
|
id: runtimeOperationId(index),
|
|
@@ -414,8 +428,8 @@ async function upsertLinkBatch(ctx, items) {
|
|
|
414
428
|
});
|
|
415
429
|
}
|
|
416
430
|
// src/objects/object/delete.ts
|
|
417
|
-
async function
|
|
418
|
-
|
|
431
|
+
async function deleteObject2(ctx, primaryId) {
|
|
432
|
+
assertCanEdit2(ctx, ctx.objectType.id);
|
|
419
433
|
await commitRuntimeOperations(ctx, [
|
|
420
434
|
objectDeleteOperation({
|
|
421
435
|
id: runtimeOperationId(0),
|
|
@@ -423,8 +437,8 @@ async function deleteObject(ctx, primaryId) {
|
|
|
423
437
|
})
|
|
424
438
|
]);
|
|
425
439
|
}
|
|
426
|
-
async function
|
|
427
|
-
|
|
440
|
+
async function restoreObject2(ctx, primaryId) {
|
|
441
|
+
assertCanEdit2(ctx, ctx.objectType.id);
|
|
428
442
|
await commitRuntimeOperations(ctx, [
|
|
429
443
|
objectRestoreOperation({
|
|
430
444
|
id: runtimeOperationId(0),
|
|
@@ -434,8 +448,8 @@ async function restoreObject(ctx, primaryId) {
|
|
|
434
448
|
}
|
|
435
449
|
|
|
436
450
|
// src/objects/object/upsert.ts
|
|
437
|
-
async function
|
|
438
|
-
|
|
451
|
+
async function upsertObject2(ctx, properties) {
|
|
452
|
+
assertCanEdit2(ctx, ctx.objectType.id);
|
|
439
453
|
const { objectType, primaryPropertyId, ontology } = ctx;
|
|
440
454
|
const normalized = normalizeRuntimeObject({
|
|
441
455
|
objectType,
|
|
@@ -451,8 +465,8 @@ async function upsertObject(ctx, properties) {
|
|
|
451
465
|
}
|
|
452
466
|
|
|
453
467
|
// src/objects/object/upsert-batch.ts
|
|
454
|
-
async function
|
|
455
|
-
|
|
468
|
+
async function upsertObjectBatch2(ctx, items) {
|
|
469
|
+
assertCanEdit2(ctx, ctx.objectType.id);
|
|
456
470
|
const { objectType, primaryPropertyId, ontology } = ctx;
|
|
457
471
|
const valueTypesById = ontology.getValueTypesById();
|
|
458
472
|
return runRuntimeItemBatch({
|
|
@@ -469,7 +483,7 @@ async function upsertObjectBatch(ctx, items) {
|
|
|
469
483
|
return {
|
|
470
484
|
key: `${ref.objectTypeId}:${ref.primaryId}`,
|
|
471
485
|
label: `object '${ref.objectTypeId}:${ref.primaryId}'`,
|
|
472
|
-
fingerprint:
|
|
486
|
+
fingerprint: stableJsonStringify2(normalized.properties),
|
|
473
487
|
operations: [
|
|
474
488
|
objectUpsertOperation({
|
|
475
489
|
id: runtimeOperationId(index),
|
|
@@ -484,21 +498,21 @@ async function upsertObjectBatch(ctx, items) {
|
|
|
484
498
|
}
|
|
485
499
|
// src/objects/telemetry/write-batch.ts
|
|
486
500
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
487
|
-
async function
|
|
501
|
+
async function writeTelemetryBatch2(ctx, points) {
|
|
488
502
|
for (const objectTypeId of new Set(points.map((point) => point.series.object.objectTypeId))) {
|
|
489
|
-
|
|
503
|
+
assertCanAppendTelemetry2(ctx, objectTypeId);
|
|
490
504
|
}
|
|
491
505
|
if (points.length === 0)
|
|
492
506
|
return null;
|
|
493
507
|
let commit;
|
|
494
508
|
try {
|
|
495
|
-
commit = await
|
|
509
|
+
commit = await getOntologyMutationRuntime2(ctx).appendTelemetry({
|
|
496
510
|
source: { kind: "runtime", requestId: randomUUID2() },
|
|
497
511
|
points
|
|
498
512
|
});
|
|
499
513
|
} catch (error) {
|
|
500
|
-
if (error instanceof
|
|
501
|
-
throw new
|
|
514
|
+
if (error instanceof MaterializationObjectNotFoundError2) {
|
|
515
|
+
throw new ObjectNotFoundError2(error.objectTypeId, error.primaryId, "Object not found for telemetry append");
|
|
502
516
|
}
|
|
503
517
|
throw error;
|
|
504
518
|
}
|
|
@@ -513,8 +527,8 @@ function isUnitBearingValue(raw) {
|
|
|
513
527
|
const record = raw;
|
|
514
528
|
return "value" in record && typeof record.unit === "string" && Object.keys(record).length === 2;
|
|
515
529
|
}
|
|
516
|
-
async function
|
|
517
|
-
|
|
530
|
+
async function appendTelemetryBatch2(ctx, items) {
|
|
531
|
+
assertCanAppendTelemetry2(ctx, ctx.objectType.id);
|
|
518
532
|
const { objectType } = ctx;
|
|
519
533
|
const points = new Map;
|
|
520
534
|
for (const item of items) {
|
|
@@ -522,14 +536,14 @@ async function appendTelemetryBatch(ctx, items) {
|
|
|
522
536
|
for (const [propertyId, rawValue] of Object.entries(item.properties)) {
|
|
523
537
|
const propertyToken = objectType.p[propertyId];
|
|
524
538
|
if (!propertyToken) {
|
|
525
|
-
throw new
|
|
539
|
+
throw new OntologyValidationError2(`Unknown property '${objectType.id}.${propertyId}'`);
|
|
526
540
|
}
|
|
527
|
-
|
|
541
|
+
assertTelemetryProperty2(propertyToken.property);
|
|
528
542
|
const series = {
|
|
529
543
|
object: { objectTypeId: objectType.id, primaryId: item.id },
|
|
530
544
|
propertyId: propertyToken.id
|
|
531
545
|
};
|
|
532
|
-
points.set(
|
|
546
|
+
points.set(telemetryPointKey2(series, at), {
|
|
533
547
|
series,
|
|
534
548
|
value: isUnitBearingValue(rawValue) ? rawValue.value : rawValue,
|
|
535
549
|
...isUnitBearingValue(rawValue) ? { unit: rawValue.unit } : {},
|
|
@@ -537,48 +551,237 @@ async function appendTelemetryBatch(ctx, items) {
|
|
|
537
551
|
});
|
|
538
552
|
}
|
|
539
553
|
}
|
|
540
|
-
await
|
|
554
|
+
await writeTelemetryBatch2(ctx, [...points.values()]);
|
|
541
555
|
}
|
|
542
556
|
|
|
543
557
|
// src/objects/telemetry/history.ts
|
|
544
|
-
async function
|
|
545
|
-
|
|
546
|
-
|
|
558
|
+
async function getTelemetryHistoryBatch2(input, options) {
|
|
559
|
+
const objectReader = options.objectReader;
|
|
560
|
+
const storage = options.storage;
|
|
561
|
+
const projectId = objectReader.projectId;
|
|
562
|
+
const request = snapshotTelemetryHistoryInput(input, objectReader);
|
|
563
|
+
const uniqueSeries = deduplicateSeries(request.series);
|
|
564
|
+
const readableSeries = await selectReadableSeries(uniqueSeries, objectReader);
|
|
565
|
+
const resultsBySeries = await readAndValidateHistory({
|
|
566
|
+
storage,
|
|
567
|
+
projectId,
|
|
568
|
+
request,
|
|
569
|
+
series: readableSeries
|
|
570
|
+
});
|
|
571
|
+
const releasableSeries = readableSeries.length === 0 ? [] : await selectReadableSeries(readableSeries, objectReader);
|
|
572
|
+
const result = assembleHistoryResults({ request, resultsBySeries, releasableSeries });
|
|
573
|
+
objectReader.assertVisibleOutputWithinLimit(result);
|
|
574
|
+
return result;
|
|
575
|
+
}
|
|
576
|
+
async function getLatestTelemetryPoint(input, options) {
|
|
577
|
+
const objectReader = options.objectReader;
|
|
578
|
+
const storage = options.storage;
|
|
579
|
+
const projectId = objectReader.projectId;
|
|
580
|
+
const series = snapshotTelemetrySeries(input);
|
|
581
|
+
const readable = await objectReader.canReadObjectProperty(objectPropertySelection(series));
|
|
582
|
+
if (!readable)
|
|
583
|
+
return visibleLatestResult(null, objectReader);
|
|
584
|
+
const rawResult = await storage.getLatest({ projectId, ...series });
|
|
585
|
+
const result = rawResult === null ? null : snapshotProviderPoint(rawResult);
|
|
586
|
+
if (result)
|
|
587
|
+
assertTimeseriesPointMatchesSeries(projectId, series, result);
|
|
588
|
+
const releaseReadable = await objectReader.canReadObjectProperty(objectPropertySelection(series));
|
|
589
|
+
if (!releaseReadable)
|
|
590
|
+
return visibleLatestResult(null, objectReader);
|
|
591
|
+
return visibleLatestResult(result, objectReader);
|
|
592
|
+
}
|
|
593
|
+
function deduplicateSeries(series) {
|
|
594
|
+
const uniqueSeries = new Map;
|
|
595
|
+
for (const item of series) {
|
|
596
|
+
const key = seriesKey(item);
|
|
597
|
+
if (!uniqueSeries.has(key))
|
|
598
|
+
uniqueSeries.set(key, item);
|
|
599
|
+
}
|
|
600
|
+
return [...uniqueSeries.values()];
|
|
601
|
+
}
|
|
602
|
+
async function selectReadableSeries(series, objectReader) {
|
|
603
|
+
const readable = await objectReader.canReadObjectPropertiesBatch({
|
|
604
|
+
items: series.map(objectPropertySelection)
|
|
605
|
+
});
|
|
606
|
+
return series.filter((_, index) => readable[index] === true);
|
|
607
|
+
}
|
|
608
|
+
async function readAndValidateHistory(input) {
|
|
609
|
+
const { storage, projectId, request, series } = input;
|
|
610
|
+
const providerRequest = structuredClone({
|
|
611
|
+
projectId,
|
|
612
|
+
series,
|
|
613
|
+
...request.from === undefined ? {} : { from: request.from },
|
|
614
|
+
...request.to === undefined ? {} : { to: request.to },
|
|
615
|
+
...request.limitPerSeries === undefined ? {} : { limitPerSeries: request.limitPerSeries },
|
|
616
|
+
...request.order === undefined ? {} : { order: request.order }
|
|
617
|
+
});
|
|
618
|
+
const stored = series.length === 0 ? [] : await storage.getHistoryBatch(providerRequest);
|
|
619
|
+
if (!Array.isArray(stored))
|
|
620
|
+
throw invalidTimeseriesProviderResult();
|
|
621
|
+
const storedCount = stored.length;
|
|
622
|
+
if (!Number.isSafeInteger(storedCount) || storedCount > series.length) {
|
|
623
|
+
throw invalidTimeseriesProviderResult();
|
|
624
|
+
}
|
|
625
|
+
const seriesKeys = new Set(series.map(seriesKey));
|
|
626
|
+
const providerResultBySeries = new Map;
|
|
627
|
+
for (let index = 0;index < storedCount; index += 1) {
|
|
628
|
+
const providerResult = snapshotProviderResult(stored[index], request.limitPerSeries);
|
|
629
|
+
const key = seriesKey(providerResult);
|
|
630
|
+
if (providerResultBySeries.has(key) || !seriesKeys.has(key)) {
|
|
631
|
+
throw invalidTimeseriesProviderResult();
|
|
632
|
+
}
|
|
633
|
+
for (const point of providerResult.points) {
|
|
634
|
+
assertTimeseriesPointMatchesSeries(projectId, providerResult, point);
|
|
635
|
+
}
|
|
636
|
+
providerResultBySeries.set(key, providerResult);
|
|
637
|
+
}
|
|
638
|
+
return providerResultBySeries;
|
|
639
|
+
}
|
|
640
|
+
function assembleHistoryResults(input) {
|
|
641
|
+
const { request, resultsBySeries, releasableSeries } = input;
|
|
642
|
+
const releasableSeriesKeys = new Set(releasableSeries.map(seriesKey));
|
|
643
|
+
const releasedPoints = request.series.map((series) => releasableSeriesKeys.has(seriesKey(series)) ? resultsBySeries.get(seriesKey(series))?.points ?? [] : []);
|
|
644
|
+
const pointOccurrences = releasedPoints.reduce((total, points) => total + points.length, 0);
|
|
645
|
+
if (request.maxPointOccurrences !== undefined && pointOccurrences > request.maxPointOccurrences) {
|
|
646
|
+
throw invalidTimeseriesProviderResult();
|
|
647
|
+
}
|
|
648
|
+
return request.series.map((series, index) => ({
|
|
649
|
+
...series,
|
|
650
|
+
points: releasedPoints[index].map((point) => structuredClone(point))
|
|
651
|
+
}));
|
|
652
|
+
}
|
|
653
|
+
function snapshotTelemetrySeries(series) {
|
|
654
|
+
if (typeof series !== "object" || series === null || Array.isArray(series)) {
|
|
655
|
+
throw new Error("[Sixb] Telemetry history series must be an object.");
|
|
656
|
+
}
|
|
657
|
+
const objectTypeId = telemetryIdentifier(series.objectTypeId, "objectTypeId");
|
|
658
|
+
const objectId = telemetryIdentifier(series.objectId, "objectId");
|
|
659
|
+
const propertyId = telemetryIdentifier(series.propertyId, "propertyId");
|
|
660
|
+
return structuredClone({ objectTypeId, objectId, propertyId });
|
|
661
|
+
}
|
|
662
|
+
function assertTimeseriesPointMatchesSeries(projectId, series, point) {
|
|
663
|
+
if (typeof point !== "object" || point === null || point.projectId !== projectId || point.objectTypeId !== series.objectTypeId || point.objectId !== series.objectId || point.propertyId !== series.propertyId) {
|
|
664
|
+
throw invalidTimeseriesProviderResult();
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
function snapshotTelemetryHistoryInput(input, objectReader) {
|
|
668
|
+
const authoredSeries = input.series;
|
|
669
|
+
const from = input.from;
|
|
670
|
+
const to = input.to;
|
|
671
|
+
const limitPerSeries = input.limitPerSeries;
|
|
672
|
+
const order = input.order;
|
|
673
|
+
if (!Array.isArray(authoredSeries)) {
|
|
674
|
+
throw new Error("[Sixb] Telemetry history series must be an array.");
|
|
675
|
+
}
|
|
676
|
+
if (order !== undefined && order !== "asc" && order !== "desc") {
|
|
677
|
+
throw new Error("[Sixb] Telemetry history order must be 'asc' or 'desc'.");
|
|
678
|
+
}
|
|
679
|
+
const seriesCount = authoredSeries.length;
|
|
680
|
+
const admission = objectReader.admitTelemetryHistoryRead({
|
|
681
|
+
seriesCount,
|
|
682
|
+
...limitPerSeries === undefined ? {} : { limitPerSeries }
|
|
683
|
+
});
|
|
684
|
+
const series = [];
|
|
685
|
+
for (let index = 0;index < seriesCount; index += 1) {
|
|
686
|
+
series.push(snapshotTelemetrySeries(authoredSeries[index]));
|
|
687
|
+
}
|
|
688
|
+
return structuredClone({
|
|
689
|
+
series,
|
|
690
|
+
...from === undefined ? {} : { from },
|
|
691
|
+
...to === undefined ? {} : { to },
|
|
692
|
+
...admission.limitPerSeries === undefined ? {} : { limitPerSeries: admission.limitPerSeries },
|
|
693
|
+
...order === undefined ? {} : { order },
|
|
694
|
+
...admission.maxPointOccurrences === undefined ? {} : { maxPointOccurrences: admission.maxPointOccurrences }
|
|
695
|
+
});
|
|
547
696
|
}
|
|
548
|
-
function
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
697
|
+
function objectPropertySelection(series) {
|
|
698
|
+
return {
|
|
699
|
+
objectTypeId: series.objectTypeId,
|
|
700
|
+
primaryId: series.objectId,
|
|
701
|
+
propertyId: series.propertyId
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
function visibleLatestResult(result, objectReader) {
|
|
705
|
+
objectReader.assertVisibleOutputWithinLimit(result);
|
|
706
|
+
return result;
|
|
707
|
+
}
|
|
708
|
+
function snapshotProviderResult(result, maxPointsPerSeries) {
|
|
709
|
+
try {
|
|
710
|
+
if (typeof result !== "object" || result === null || Array.isArray(result)) {
|
|
711
|
+
throw invalidTimeseriesProviderResult();
|
|
712
|
+
}
|
|
713
|
+
const series = snapshotTelemetrySeries(result);
|
|
714
|
+
const authoredPoints = result.points;
|
|
715
|
+
if (!Array.isArray(authoredPoints))
|
|
716
|
+
throw invalidTimeseriesProviderResult();
|
|
717
|
+
const pointCount = authoredPoints.length;
|
|
718
|
+
if (!Number.isSafeInteger(pointCount) || maxPointsPerSeries !== undefined && pointCount > maxPointsPerSeries) {
|
|
719
|
+
throw invalidTimeseriesProviderResult();
|
|
720
|
+
}
|
|
721
|
+
const points = [];
|
|
722
|
+
for (let index = 0;index < pointCount; index += 1) {
|
|
723
|
+
points.push(snapshotProviderPoint(authoredPoints[index]));
|
|
724
|
+
}
|
|
725
|
+
return { ...series, points };
|
|
726
|
+
} catch (error) {
|
|
727
|
+
if (isInvalidTimeseriesProviderResult(error))
|
|
728
|
+
throw error;
|
|
729
|
+
throw invalidTimeseriesProviderResult(error);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
function snapshotProviderPoint(point) {
|
|
733
|
+
try {
|
|
734
|
+
const snapshot = structuredClone(point);
|
|
735
|
+
if (!snapshot || typeof snapshot !== "object")
|
|
736
|
+
throw invalidTimeseriesProviderResult();
|
|
737
|
+
return snapshot;
|
|
738
|
+
} catch (error) {
|
|
739
|
+
if (isInvalidTimeseriesProviderResult(error))
|
|
740
|
+
throw error;
|
|
741
|
+
throw invalidTimeseriesProviderResult(error);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
function invalidTimeseriesProviderResult(cause) {
|
|
745
|
+
return createSixbError2("internal.unexpected", "[Sixb] Timeseries storage returned data outside the requested series.", cause === undefined ? {} : { cause });
|
|
746
|
+
}
|
|
747
|
+
function isInvalidTimeseriesProviderResult(error) {
|
|
748
|
+
return error instanceof Error && "code" in error && error.code === "internal.unexpected" && error.message === "[Sixb] Timeseries storage returned data outside the requested series.";
|
|
749
|
+
}
|
|
750
|
+
function telemetryIdentifier(value, field) {
|
|
751
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
752
|
+
throw new Error(`[Sixb] Telemetry history ${field} must be a non-empty string.`);
|
|
554
753
|
}
|
|
754
|
+
return value;
|
|
755
|
+
}
|
|
756
|
+
function seriesKey(series) {
|
|
757
|
+
return JSON.stringify([series.objectTypeId, series.objectId, series.propertyId]);
|
|
555
758
|
}
|
|
556
759
|
// src/objects/context/resolve.ts
|
|
557
|
-
function
|
|
760
|
+
function requireLinkDefinition2(objectType, linkId) {
|
|
558
761
|
const def = objectType.links.find((l) => l.id === linkId);
|
|
559
762
|
if (!def)
|
|
560
|
-
throw new
|
|
763
|
+
throw new OntologyNotFoundError2(`Unknown link '${objectType.id}.${linkId}'`);
|
|
561
764
|
return def;
|
|
562
765
|
}
|
|
563
|
-
function
|
|
766
|
+
function resolveObjectContext2(runtime, objectTypeId) {
|
|
564
767
|
const objectType = runtime.ontology.resolveObjectType(objectTypeId);
|
|
565
768
|
const primaryPropertyId = runtime.ontology.getPrimaryPropertyId(objectTypeId);
|
|
566
769
|
return { ...runtime, objectType, primaryPropertyId };
|
|
567
770
|
}
|
|
568
|
-
function
|
|
569
|
-
const linkDefinition =
|
|
771
|
+
function resolveLinkContext2(objCtx, linkId) {
|
|
772
|
+
const linkDefinition = requireLinkDefinition2(objCtx.objectType, linkId);
|
|
570
773
|
return { ...objCtx, linkDefinition };
|
|
571
774
|
}
|
|
572
775
|
// src/objects/sdk/telemetry-channel.ts
|
|
573
776
|
function createTelemetryChannel(ctx, primaryId) {
|
|
574
777
|
return (property) => {
|
|
575
778
|
const { objectType } = ctx;
|
|
576
|
-
|
|
577
|
-
|
|
779
|
+
assertPropertyTokenBelongsToObjectType2(objectType, property);
|
|
780
|
+
assertTelemetryProperty2(property.property);
|
|
578
781
|
const series = { objectTypeId: objectType.id, objectId: primaryId, propertyId: property.id };
|
|
579
782
|
const channel = {
|
|
580
783
|
append: async (input) => {
|
|
581
|
-
await
|
|
784
|
+
await writeTelemetryBatch2(ctx, [
|
|
582
785
|
{
|
|
583
786
|
series: {
|
|
584
787
|
object: { objectTypeId: objectType.id, primaryId },
|
|
@@ -592,20 +795,23 @@ function createTelemetryChannel(ctx, primaryId) {
|
|
|
592
795
|
},
|
|
593
796
|
history: async (input = {}) => {
|
|
594
797
|
const timeseries = ctx.storage.timeseries;
|
|
798
|
+
const objectReader = ctx.objectReader;
|
|
595
799
|
if (!timeseries) {
|
|
596
|
-
throw new
|
|
800
|
+
throw new RuntimeError2("[Sixb] Reading telemetry requires storage.timeseries support.");
|
|
597
801
|
}
|
|
598
|
-
const
|
|
599
|
-
|
|
802
|
+
const from = input.from;
|
|
803
|
+
const to = input.to;
|
|
804
|
+
const limit = input.limit;
|
|
805
|
+
const order = input.order;
|
|
806
|
+
const [result] = await getTelemetryHistoryBatch2({
|
|
600
807
|
series: [series],
|
|
601
|
-
...
|
|
602
|
-
...
|
|
603
|
-
...
|
|
604
|
-
...
|
|
808
|
+
...from !== undefined ? { from } : {},
|
|
809
|
+
...to !== undefined ? { to } : {},
|
|
810
|
+
...limit !== undefined ? { limitPerSeries: limit } : {},
|
|
811
|
+
...order !== undefined ? { order } : {}
|
|
605
812
|
}, {
|
|
606
813
|
storage: timeseries,
|
|
607
|
-
|
|
608
|
-
authorization: ctx.authorization
|
|
814
|
+
objectReader
|
|
609
815
|
});
|
|
610
816
|
return (result?.points ?? []).map((point) => ({
|
|
611
817
|
value: point.value,
|
|
@@ -622,30 +828,26 @@ function createTelemetryChannel(ctx, primaryId) {
|
|
|
622
828
|
function createObjectByIdHandle(ctx, primaryId) {
|
|
623
829
|
const objectHandle = {
|
|
624
830
|
get: async () => {
|
|
625
|
-
|
|
626
|
-
const row = await ctx.storage.objects.getByPrimaryId({
|
|
627
|
-
projectId: ctx.projectId,
|
|
831
|
+
const row = await ctx.objectReader.getByPrimaryId({
|
|
628
832
|
objectTypeId: ctx.objectType.id,
|
|
629
833
|
primaryId
|
|
630
834
|
});
|
|
631
835
|
return row ? row : null;
|
|
632
836
|
},
|
|
633
837
|
listLinks: async (linkToken) => {
|
|
634
|
-
assertPrivileged(ctx, "listLinks");
|
|
635
838
|
if (linkToken) {
|
|
636
|
-
|
|
839
|
+
assertLinkTokenBelongsToObjectType2(ctx.objectType, linkToken);
|
|
637
840
|
}
|
|
638
|
-
return ctx.
|
|
639
|
-
projectId: ctx.projectId,
|
|
841
|
+
return ctx.objectReader.listLinks({
|
|
640
842
|
objectTypeId: ctx.objectType.id,
|
|
641
843
|
objectId: primaryId,
|
|
642
844
|
linkId: linkToken?.id
|
|
643
845
|
});
|
|
644
846
|
},
|
|
645
847
|
link: async (linkToken, target, options) => {
|
|
646
|
-
|
|
848
|
+
assertLinkTokenBelongsToObjectType2(ctx.objectType, linkToken);
|
|
647
849
|
const linkCtx = { ...ctx, linkDefinition: linkToken.link };
|
|
648
|
-
await
|
|
850
|
+
await upsertLink2(linkCtx, {
|
|
649
851
|
sourceId: primaryId,
|
|
650
852
|
linkId: linkToken.id,
|
|
651
853
|
targetTypeId: target.objectTypeId,
|
|
@@ -654,9 +856,9 @@ function createObjectByIdHandle(ctx, primaryId) {
|
|
|
654
856
|
});
|
|
655
857
|
},
|
|
656
858
|
unlink: async (linkToken, target) => {
|
|
657
|
-
|
|
859
|
+
assertLinkTokenBelongsToObjectType2(ctx.objectType, linkToken);
|
|
658
860
|
const linkCtx = { ...ctx, linkDefinition: linkToken.link };
|
|
659
|
-
await
|
|
861
|
+
await removeLink2(linkCtx, {
|
|
660
862
|
sourceId: primaryId,
|
|
661
863
|
linkId: linkToken.id,
|
|
662
864
|
targetTypeId: target.objectTypeId,
|
|
@@ -664,15 +866,15 @@ function createObjectByIdHandle(ctx, primaryId) {
|
|
|
664
866
|
});
|
|
665
867
|
},
|
|
666
868
|
delete: async () => {
|
|
667
|
-
await
|
|
869
|
+
await deleteObject2(ctx, primaryId);
|
|
668
870
|
},
|
|
669
871
|
restore: async () => {
|
|
670
|
-
await
|
|
872
|
+
await restoreObject2(ctx, primaryId);
|
|
671
873
|
},
|
|
672
874
|
requestAction: async (input) => {
|
|
673
875
|
const actionId = input.action?.id ?? input.actionId;
|
|
674
876
|
if (!actionId) {
|
|
675
|
-
throw new
|
|
877
|
+
throw new OntologyValidationError2("[Sixb] requestAction requires either 'action' or 'actionId'");
|
|
676
878
|
}
|
|
677
879
|
return requestAction2(ctx, {
|
|
678
880
|
primaryId,
|
|
@@ -684,9 +886,9 @@ function createObjectByIdHandle(ctx, primaryId) {
|
|
|
684
886
|
requestActionAndWait: async (input) => {
|
|
685
887
|
const actionId = input.action?.id ?? input.actionId;
|
|
686
888
|
if (!actionId) {
|
|
687
|
-
throw new
|
|
889
|
+
throw new OntologyValidationError2("[Sixb] requestActionAndWait requires either 'action' or 'actionId'");
|
|
688
890
|
}
|
|
689
|
-
return
|
|
891
|
+
return requestActionAndWait(ctx, {
|
|
690
892
|
primaryId,
|
|
691
893
|
actionId,
|
|
692
894
|
params: input.params,
|
|
@@ -703,62 +905,60 @@ function createObjectByIdHandle(ctx, primaryId) {
|
|
|
703
905
|
|
|
704
906
|
// src/objects/sdk/runtime-query-executor.ts
|
|
705
907
|
function createRuntimeQueryExecutor(params) {
|
|
706
|
-
const {
|
|
707
|
-
const executorOptions = {
|
|
708
|
-
ontology,
|
|
709
|
-
storage: storage.objects,
|
|
710
|
-
runtimeAuthorization,
|
|
711
|
-
authorization
|
|
712
|
-
};
|
|
908
|
+
const { ontology, objectReader } = params;
|
|
713
909
|
return {
|
|
714
910
|
async list(query, options) {
|
|
715
911
|
try {
|
|
716
|
-
return await
|
|
912
|
+
return await objectReader.executeQuery({ query, includeTotal: options?.includeTotal });
|
|
717
913
|
} catch (error) {
|
|
718
|
-
if (error instanceof
|
|
914
|
+
if (error instanceof ObjectQueryPlanningError2) {
|
|
719
915
|
throw addSdkPlanningHints(error);
|
|
720
916
|
}
|
|
721
917
|
throw error;
|
|
722
918
|
}
|
|
723
919
|
},
|
|
724
920
|
async count(query) {
|
|
725
|
-
const result = await
|
|
921
|
+
const result = await objectReader.count({ query });
|
|
726
922
|
return result.count;
|
|
727
923
|
},
|
|
728
924
|
async exists(query) {
|
|
729
|
-
const result = await
|
|
925
|
+
const result = await objectReader.exists({ query });
|
|
730
926
|
return result.exists;
|
|
731
927
|
},
|
|
732
928
|
async facets(query, facets) {
|
|
733
|
-
const result = await
|
|
929
|
+
const result = await objectReader.facet({ query, facets });
|
|
734
930
|
return result.facets.map((facet) => ({
|
|
735
931
|
propertyId: facet.propertyId,
|
|
736
932
|
buckets: [...facet.buckets]
|
|
737
933
|
}));
|
|
738
934
|
},
|
|
739
935
|
validate(query) {
|
|
740
|
-
return
|
|
936
|
+
return validateObjectQuery2(query, { ontology, normalize: false });
|
|
741
937
|
},
|
|
742
938
|
explain(query) {
|
|
743
|
-
return
|
|
939
|
+
return explainObjectQuery2(query, { ontology, normalize: false });
|
|
744
940
|
}
|
|
745
941
|
};
|
|
746
942
|
}
|
|
747
943
|
function addSdkPlanningHints(error) {
|
|
748
944
|
if (!error.issues.some((issue) => issue.code === "fallback_requires_bound"))
|
|
749
945
|
return error;
|
|
750
|
-
return new
|
|
946
|
+
return new ObjectQueryPlanningError2(error.issues.map((issue) => issue.code === "fallback_requires_bound" ? {
|
|
751
947
|
...issue,
|
|
752
948
|
message: "Object query fallback requires an explicit result bound. Add .limit(n) or .page({ pageSize: n }) before .list()."
|
|
753
949
|
} : issue));
|
|
754
950
|
}
|
|
755
951
|
|
|
756
952
|
// src/objects/sdk/object-set.ts
|
|
757
|
-
function
|
|
953
|
+
function createObjectSet2(params) {
|
|
954
|
+
assertAuthorizedObjectReaderBinding({
|
|
955
|
+
reader: params.objectReader,
|
|
956
|
+
scope: { execution: params.execution, authorization: params.runtimeAuthorization }
|
|
957
|
+
});
|
|
758
958
|
const { objectType } = params;
|
|
759
959
|
const primaryProp = objectType.properties.find((p) => p.primary);
|
|
760
960
|
if (!primaryProp) {
|
|
761
|
-
throw new
|
|
961
|
+
throw new OntologyValidationError2(`Object type '${objectType.id}' has no primary property`);
|
|
762
962
|
}
|
|
763
963
|
const primaryPropertyId = primaryProp.id;
|
|
764
964
|
const {
|
|
@@ -769,16 +969,14 @@ function createObjectSet(params) {
|
|
|
769
969
|
events,
|
|
770
970
|
storage,
|
|
771
971
|
queues,
|
|
972
|
+
objectReader,
|
|
772
973
|
runtimeAuthorization,
|
|
773
974
|
authorization,
|
|
774
975
|
execution
|
|
775
976
|
} = params;
|
|
776
977
|
const queryExecutor = createRuntimeQueryExecutor({
|
|
777
|
-
projectId,
|
|
778
978
|
ontology,
|
|
779
|
-
|
|
780
|
-
runtimeAuthorization,
|
|
781
|
-
authorization
|
|
979
|
+
objectReader
|
|
782
980
|
});
|
|
783
981
|
const resolvedCtx = {
|
|
784
982
|
projectId,
|
|
@@ -788,37 +986,34 @@ function createObjectSet(params) {
|
|
|
788
986
|
events,
|
|
789
987
|
storage,
|
|
790
988
|
queues,
|
|
989
|
+
objectReader,
|
|
791
990
|
runtimeAuthorization,
|
|
792
991
|
authorization,
|
|
793
992
|
execution,
|
|
794
993
|
objectType,
|
|
795
994
|
primaryPropertyId
|
|
796
995
|
};
|
|
797
|
-
|
|
798
|
-
|
|
996
|
+
shareOntologyMutationRuntime2(params, resolvedCtx);
|
|
997
|
+
shareSixbErrorReporter2(params, resolvedCtx);
|
|
799
998
|
const objectSet = {
|
|
800
999
|
get: async (id) => {
|
|
801
|
-
|
|
802
|
-
const row = await storage.objects.getByPrimaryId({
|
|
803
|
-
projectId,
|
|
1000
|
+
const row = await objectReader.getByPrimaryId({
|
|
804
1001
|
objectTypeId: objectType.id,
|
|
805
1002
|
primaryId: id
|
|
806
1003
|
});
|
|
807
1004
|
return row ? row : null;
|
|
808
1005
|
},
|
|
809
1006
|
upsert: async (input) => {
|
|
810
|
-
const row = await
|
|
1007
|
+
const row = await upsertObject2(resolvedCtx, input.properties);
|
|
811
1008
|
return row;
|
|
812
1009
|
},
|
|
813
|
-
query: () =>
|
|
1010
|
+
query: () => createObjectQueryBuilder2({
|
|
814
1011
|
query: { kind: "start", objectTypeId: objectType.id },
|
|
815
1012
|
executor: queryExecutor
|
|
816
1013
|
}),
|
|
817
1014
|
byId: (id) => createObjectByIdHandle(resolvedCtx, id),
|
|
818
1015
|
list: async (input) => {
|
|
819
|
-
|
|
820
|
-
const result = await storage.objects.list({
|
|
821
|
-
projectId,
|
|
1016
|
+
const result = await objectReader.list({
|
|
822
1017
|
objectTypeId: objectType.id,
|
|
823
1018
|
primaryIdPrefix: input?.idPrefix,
|
|
824
1019
|
primaryIdSuffix: input?.idSuffix,
|
|
@@ -838,12 +1033,12 @@ function createObjectSet(params) {
|
|
|
838
1033
|
};
|
|
839
1034
|
},
|
|
840
1035
|
appendTelemetryBatch: async (items) => {
|
|
841
|
-
await
|
|
1036
|
+
await appendTelemetryBatch2(resolvedCtx, items);
|
|
842
1037
|
},
|
|
843
1038
|
requestAction: async (input) => {
|
|
844
1039
|
const actionId = input.action?.id ?? input.actionId;
|
|
845
1040
|
if (!actionId) {
|
|
846
|
-
throw new
|
|
1041
|
+
throw new OntologyValidationError2("[Sixb] requestAction requires either 'action' or 'actionId'");
|
|
847
1042
|
}
|
|
848
1043
|
return requestAction2(resolvedCtx, {
|
|
849
1044
|
primaryId: input.id,
|
|
@@ -855,9 +1050,9 @@ function createObjectSet(params) {
|
|
|
855
1050
|
requestActionAndWait: async (input) => {
|
|
856
1051
|
const actionId = input.action?.id ?? input.actionId;
|
|
857
1052
|
if (!actionId) {
|
|
858
|
-
throw new
|
|
1053
|
+
throw new OntologyValidationError2("[Sixb] requestActionAndWait requires either 'action' or 'actionId'");
|
|
859
1054
|
}
|
|
860
|
-
return
|
|
1055
|
+
return requestActionAndWait(resolvedCtx, {
|
|
861
1056
|
primaryId: input.id,
|
|
862
1057
|
actionId,
|
|
863
1058
|
params: input.params,
|
|
@@ -868,9 +1063,9 @@ function createObjectSet(params) {
|
|
|
868
1063
|
});
|
|
869
1064
|
},
|
|
870
1065
|
upsertLink: async (input) => {
|
|
871
|
-
const linkDefinition =
|
|
1066
|
+
const linkDefinition = requireLinkDefinition2(objectType, input.linkId);
|
|
872
1067
|
const linkCtx = { ...resolvedCtx, linkDefinition };
|
|
873
|
-
await
|
|
1068
|
+
await upsertLink2(linkCtx, {
|
|
874
1069
|
sourceId: input.sourceId,
|
|
875
1070
|
linkId: input.linkId,
|
|
876
1071
|
targetTypeId: input.targetTypeId,
|
|
@@ -879,9 +1074,9 @@ function createObjectSet(params) {
|
|
|
879
1074
|
});
|
|
880
1075
|
},
|
|
881
1076
|
removeLink: async (input) => {
|
|
882
|
-
const linkDefinition =
|
|
1077
|
+
const linkDefinition = requireLinkDefinition2(objectType, input.linkId);
|
|
883
1078
|
const linkCtx = { ...resolvedCtx, linkDefinition };
|
|
884
|
-
await
|
|
1079
|
+
await removeLink2(linkCtx, {
|
|
885
1080
|
sourceId: input.sourceId,
|
|
886
1081
|
linkId: input.linkId,
|
|
887
1082
|
targetTypeId: input.targetTypeId,
|
|
@@ -894,31 +1089,31 @@ function createObjectSet(params) {
|
|
|
894
1089
|
// src/objects/service/index.ts
|
|
895
1090
|
var exports_service = {};
|
|
896
1091
|
__export(exports_service, {
|
|
897
|
-
|
|
898
|
-
upsertObject: () => upsertObject2,
|
|
899
|
-
upsertLinkBatch: () => upsertLinkBatch2,
|
|
900
|
-
upsertLink: () => upsertLink2,
|
|
901
|
-
requestActionAndWait: () => requestActionAndWait3,
|
|
902
|
-
requestAction: () => requestAction3,
|
|
903
|
-
removeLink: () => removeLink2,
|
|
1092
|
+
appendTelemetry: () => appendTelemetry,
|
|
904
1093
|
listObjects: () => listObjects,
|
|
905
|
-
|
|
1094
|
+
removeLink: () => removeLink3,
|
|
1095
|
+
requestAction: () => requestAction,
|
|
1096
|
+
requestActionAndWait: () => requestActionAndWait3,
|
|
1097
|
+
upsertLink: () => upsertLink3,
|
|
1098
|
+
upsertLinkBatch: () => upsertLinkBatch3,
|
|
1099
|
+
upsertObject: () => upsertObject3,
|
|
1100
|
+
upsertObjectBatch: () => upsertObjectBatch3
|
|
906
1101
|
});
|
|
907
1102
|
|
|
908
1103
|
// src/objects/service/action-service.ts
|
|
909
|
-
async function
|
|
910
|
-
const ctx = { ...
|
|
1104
|
+
async function requestAction(runtime, execution, objectTypeId, primaryId, actionId, params, options) {
|
|
1105
|
+
const ctx = { ...resolveObjectContext2(runtime, objectTypeId), execution };
|
|
911
1106
|
return requestAction2(ctx, { primaryId, actionId, params, options });
|
|
912
1107
|
}
|
|
913
1108
|
async function requestActionAndWait3(runtime, execution, objectTypeId, primaryId, actionId, params, options) {
|
|
914
|
-
const ctx = { ...
|
|
915
|
-
return
|
|
1109
|
+
const ctx = { ...resolveObjectContext2(runtime, objectTypeId), execution };
|
|
1110
|
+
return requestActionAndWait(ctx, { primaryId, actionId, params, options });
|
|
916
1111
|
}
|
|
917
1112
|
// src/objects/service/link-service.ts
|
|
918
|
-
async function
|
|
919
|
-
const ctx =
|
|
920
|
-
const linkCtx =
|
|
921
|
-
await
|
|
1113
|
+
async function upsertLink3(runtime, objectTypeId, sourceId, linkId, target) {
|
|
1114
|
+
const ctx = resolveObjectContext2(runtime, objectTypeId);
|
|
1115
|
+
const linkCtx = resolveLinkContext2(ctx, linkId);
|
|
1116
|
+
await upsertLink2(linkCtx, {
|
|
922
1117
|
sourceId,
|
|
923
1118
|
linkId,
|
|
924
1119
|
targetTypeId: target.targetTypeId,
|
|
@@ -926,10 +1121,10 @@ async function upsertLink2(runtime, objectTypeId, sourceId, linkId, target) {
|
|
|
926
1121
|
properties: target.properties
|
|
927
1122
|
});
|
|
928
1123
|
}
|
|
929
|
-
async function
|
|
1124
|
+
async function upsertLinkBatch3(runtime, items) {
|
|
930
1125
|
const resolvedItems = items.map((item) => {
|
|
931
1126
|
const objectType = runtime.ontology.resolveObjectType(item.objectTypeId);
|
|
932
|
-
const linkDefinition =
|
|
1127
|
+
const linkDefinition = requireLinkDefinition2(objectType, item.linkId);
|
|
933
1128
|
return {
|
|
934
1129
|
objectType,
|
|
935
1130
|
linkDefinition,
|
|
@@ -940,12 +1135,12 @@ async function upsertLinkBatch2(runtime, items) {
|
|
|
940
1135
|
properties: item.target.properties
|
|
941
1136
|
};
|
|
942
1137
|
});
|
|
943
|
-
return
|
|
1138
|
+
return upsertLinkBatch2(runtime, resolvedItems);
|
|
944
1139
|
}
|
|
945
|
-
async function
|
|
946
|
-
const ctx =
|
|
947
|
-
const linkCtx =
|
|
948
|
-
await
|
|
1140
|
+
async function removeLink3(runtime, objectTypeId, sourceId, linkId, target) {
|
|
1141
|
+
const ctx = resolveObjectContext2(runtime, objectTypeId);
|
|
1142
|
+
const linkCtx = resolveLinkContext2(ctx, linkId);
|
|
1143
|
+
await removeLink2(linkCtx, {
|
|
949
1144
|
sourceId,
|
|
950
1145
|
linkId,
|
|
951
1146
|
targetTypeId: target.targetTypeId,
|
|
@@ -954,12 +1149,11 @@ async function removeLink2(runtime, objectTypeId, sourceId, linkId, target) {
|
|
|
954
1149
|
}
|
|
955
1150
|
// src/objects/service/list-service.ts
|
|
956
1151
|
async function listObjects(runtime, params) {
|
|
957
|
-
const objectTypeIds =
|
|
958
|
-
if (
|
|
1152
|
+
const objectTypeIds = resolveTypeFilter(runtime, params.objectTypeIds);
|
|
1153
|
+
if (objectTypeIds !== undefined && objectTypeIds.length === 0) {
|
|
959
1154
|
return { objects: [], hasMore: false, total: 0 };
|
|
960
1155
|
}
|
|
961
|
-
const result = await runtime.
|
|
962
|
-
projectId: runtime.projectId,
|
|
1156
|
+
const result = await runtime.objectReader.list({
|
|
963
1157
|
objectTypeId: objectTypeIds?.length === 1 ? objectTypeIds[0] : objectTypeIds,
|
|
964
1158
|
primaryIdPrefix: params.idPrefix,
|
|
965
1159
|
primaryIdSuffix: params.idSuffix,
|
|
@@ -978,36 +1172,27 @@ async function listObjects(runtime, params) {
|
|
|
978
1172
|
total: result.total
|
|
979
1173
|
};
|
|
980
1174
|
}
|
|
981
|
-
function
|
|
1175
|
+
function resolveTypeFilter(runtime, requested) {
|
|
1176
|
+
const ontology = resolveRuntimeAuthorizationForProject(runtime).type === "delegated" ? getAuthorizedOntologyView(runtime.objectReader) : runtime.ontology;
|
|
982
1177
|
if (requested) {
|
|
983
1178
|
for (const objectTypeId of requested) {
|
|
984
|
-
|
|
1179
|
+
ontology.resolveObjectType(objectTypeId);
|
|
985
1180
|
}
|
|
986
1181
|
}
|
|
987
|
-
|
|
988
|
-
if (!runtime.authorization) {
|
|
989
|
-
return expanded;
|
|
990
|
-
}
|
|
991
|
-
if (!expanded) {
|
|
992
|
-
return [...runtime.authorization.grants["view:object"]];
|
|
993
|
-
}
|
|
994
|
-
for (const objectTypeId of expanded) {
|
|
995
|
-
assertAuthorized(runtime, { kind: "object.view", objectTypeId });
|
|
996
|
-
}
|
|
997
|
-
return expanded;
|
|
1182
|
+
return requested ? [...new Set(requested.flatMap((id) => [id, ...ontology.listSubTypes(id)]))] : undefined;
|
|
998
1183
|
}
|
|
999
1184
|
// src/objects/service/object-service.ts
|
|
1000
|
-
async function
|
|
1001
|
-
return
|
|
1185
|
+
async function upsertObject3(runtime, objectTypeId, properties) {
|
|
1186
|
+
return upsertObject2(resolveObjectContext2(runtime, objectTypeId), properties);
|
|
1002
1187
|
}
|
|
1003
|
-
async function
|
|
1004
|
-
return
|
|
1188
|
+
async function upsertObjectBatch3(runtime, objectTypeId, items) {
|
|
1189
|
+
return upsertObjectBatch2(resolveObjectContext2(runtime, objectTypeId), items);
|
|
1005
1190
|
}
|
|
1006
1191
|
// src/objects/service/telemetry-service.ts
|
|
1007
1192
|
async function appendTelemetry(runtime, objectTypeId, items) {
|
|
1008
|
-
const ctx =
|
|
1009
|
-
await
|
|
1193
|
+
const ctx = resolveObjectContext2(runtime, objectTypeId);
|
|
1194
|
+
await appendTelemetryBatch2(ctx, items);
|
|
1010
1195
|
}
|
|
1011
|
-
export { requestAction2
|
|
1196
|
+
export { requestAction2, ObjectError2, removeLink2, upsertLink2, upsertLinkBatch2, deleteObject2, restoreObject2, upsertObject2, upsertObjectBatch2, writeTelemetryBatch2, appendTelemetryBatch2, getTelemetryHistoryBatch2, getLatestTelemetryPoint, requireLinkDefinition2, resolveObjectContext2, resolveLinkContext2, createObjectSet2, upsertLink3, upsertLinkBatch3, removeLink3, listObjects, upsertObject3, upsertObjectBatch3, appendTelemetry, exports_service };
|
|
1012
1197
|
|
|
1013
|
-
//# debugId=
|
|
1198
|
+
//# debugId=0ED9DE016D18A46464756E2164756E21
|