@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,54 +1,54 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
3
|
+
objectRefKey2,
|
|
4
|
+
linkRefKey2,
|
|
5
|
+
projectionEntityKey2,
|
|
6
|
+
telemetryPointKey2,
|
|
7
|
+
linkRefSortKey2,
|
|
8
|
+
linkScopeSortKey2
|
|
9
|
+
} from "./chunk-c5rkjrgp.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
11
|
+
MaterializationValidationError2,
|
|
12
|
+
MaterializationConflictError2
|
|
13
|
+
} from "./chunk-yv79ncbv.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./chunk-
|
|
15
|
+
assertJsonValue2,
|
|
16
|
+
stableJsonStringify2
|
|
17
|
+
} from "./chunk-wy0qdqfm.js";
|
|
18
18
|
|
|
19
19
|
// src/storage/ontology/provider.ts
|
|
20
20
|
import { createHash as createHash2, randomUUID } from "crypto";
|
|
21
21
|
|
|
22
22
|
// src/storage/ontology/provider-validation.ts
|
|
23
|
-
function
|
|
23
|
+
function assertNonblank2(value, label) {
|
|
24
24
|
if (typeof value !== "string" || value.trim().length === 0) {
|
|
25
|
-
throw new
|
|
25
|
+
throw new MaterializationValidationError2(`${label} must be nonblank.`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function assertPositiveInteger2(value, label) {
|
|
29
29
|
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
30
|
-
throw new
|
|
30
|
+
throw new MaterializationValidationError2(`${label} must be a positive safe integer.`);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function assertNonnegativeInteger2(value, label) {
|
|
34
34
|
if (!Number.isSafeInteger(value) || value < 0) {
|
|
35
|
-
throw new
|
|
35
|
+
throw new MaterializationValidationError2(`${label} must be a nonnegative safe integer.`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function assertTimestamp2(value, label, canonical = true) {
|
|
39
39
|
const milliseconds = Date.parse(value);
|
|
40
40
|
if (!Number.isFinite(milliseconds) || canonical && new Date(milliseconds).toISOString() !== value) {
|
|
41
|
-
throw new
|
|
41
|
+
throw new MaterializationValidationError2(`${label} must be ${canonical ? "a canonical UTC" : "a valid"} timestamp.`);
|
|
42
42
|
}
|
|
43
43
|
return milliseconds;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
throw new
|
|
45
|
+
function invalidCorrelation2(message) {
|
|
46
|
+
throw new MaterializationValidationError2(message);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// src/materialization/identity.ts
|
|
50
50
|
import { createHash } from "crypto";
|
|
51
|
-
var
|
|
51
|
+
var ONTOLOGY_MATERIALIZATION_EVENT_KIND_ORDER2 = Object.freeze([
|
|
52
52
|
"object.created",
|
|
53
53
|
"object.updated",
|
|
54
54
|
"object.deleted",
|
|
@@ -57,21 +57,21 @@ var ONTOLOGY_MATERIALIZATION_EVENT_KIND_ORDER = Object.freeze([
|
|
|
57
57
|
"link.deleted",
|
|
58
58
|
"telemetry.appended"
|
|
59
59
|
]);
|
|
60
|
-
function
|
|
61
|
-
return
|
|
60
|
+
function materializationEventKindOrdinal2(kind) {
|
|
61
|
+
return ONTOLOGY_MATERIALIZATION_EVENT_KIND_ORDER2.indexOf(kind);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
return createHash("sha256").update(
|
|
63
|
+
function sha256Canonical2(value) {
|
|
64
|
+
assertJsonValue2(value, "Canonical hash input");
|
|
65
|
+
return createHash("sha256").update(stableJsonStringify2(value)).digest("hex");
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
67
|
+
function createRequestHash2(normalizedCallerIntent) {
|
|
68
|
+
return sha256Canonical2(normalizedCallerIntent);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
70
|
+
function createCommitId2(projectId, idempotencyKey) {
|
|
71
|
+
return sha256Canonical2([projectId, idempotencyKey]);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
73
|
+
function createEventId2(projectId, commitId, ordinal) {
|
|
74
|
+
return sha256Canonical2([projectId, commitId, ordinal]);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
// src/storage/ontology/materializations.ts
|
|
@@ -98,14 +98,14 @@ function materializationApplyPhase(kind) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
// src/storage/ontology/provider-work.ts
|
|
101
|
-
function
|
|
101
|
+
function assertPageRows2(value) {
|
|
102
102
|
if (!Number.isSafeInteger(value) || value <= 0)
|
|
103
|
-
throw new
|
|
103
|
+
throw new MaterializationValidationError2("Materialization page size must be positive.");
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function materializationChunkRows2(chunk) {
|
|
106
106
|
return chunk.overrides.objects.upserts.length + chunk.overrides.objects.deletes.length + chunk.overrides.links.edges.upserts.length + chunk.overrides.links.edges.deletes.length + chunk.overrides.links.slots.upserts.length + chunk.overrides.links.slots.deletes.length + chunk.effective.objectUpserts.length + chunk.effective.objectDeletes.length + chunk.effective.linkUpserts.length + chunk.effective.linkDeletes.length + chunk.timeseries.pointUpserts.length + chunk.outbox.length;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function materializationPlanItems2(chunk) {
|
|
109
109
|
return [
|
|
110
110
|
...chunk.overrides.objects.upserts.map((value) => ({
|
|
111
111
|
kind: "object-override-upsert",
|
|
@@ -138,41 +138,41 @@ function materializationPlanItems(chunk) {
|
|
|
138
138
|
...chunk.timeseries.pointUpserts.map((value) => ({ kind: "point-upsert", value }))
|
|
139
139
|
];
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function assertWorkRecord2(record, header) {
|
|
142
142
|
if (record.recordKey.trim().length === 0) {
|
|
143
|
-
throw new
|
|
143
|
+
throw new MaterializationValidationError2("Materialization work key must be nonblank.");
|
|
144
144
|
}
|
|
145
145
|
if (record.kind === "plan") {
|
|
146
146
|
if (!/^[0-9a-f]+$/.test(record.sortKey) || !planPhaseMatches(record)) {
|
|
147
|
-
throw new
|
|
147
|
+
throw new MaterializationValidationError2("Materialization plan work has an invalid order.");
|
|
148
148
|
}
|
|
149
149
|
assertPlanItemCorrelation(record.item, header.commit);
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
152
|
if (record.kind === "event") {
|
|
153
|
-
if (!/^[0-9a-f]+$/.test(record.sortKey) || !Number.isSafeInteger(record.eventKindRank) || record.eventKindRank < 0 || record.eventKindRank !==
|
|
154
|
-
throw new
|
|
153
|
+
if (!/^[0-9a-f]+$/.test(record.sortKey) || !Number.isSafeInteger(record.eventKindRank) || record.eventKindRank < 0 || record.eventKindRank !== materializationEventKindOrdinal2(record.draft.type) || record.draft.projectId !== header.commit.projectId || record.draft.commitId !== header.commit.id || record.draft.occurredAt !== header.commit.committedAt || stableJsonStringify2(record.draft.origin) !== stableJsonStringify2(header.commit.origin) || stableJsonStringify2(record.draft.actor ?? null) !== stableJsonStringify2(header.commit.actor ?? null)) {
|
|
154
|
+
throw new MaterializationValidationError2("Materialization event work is invalid.");
|
|
155
155
|
}
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
if (record.kind === "cardinality") {
|
|
159
|
-
if (record.scopeSortKey !==
|
|
160
|
-
throw new
|
|
159
|
+
if (record.scopeSortKey !== linkScopeSortKey2(record.ref.source, record.ref.linkId) || record.linkSortKey !== linkRefSortKey2(record.ref)) {
|
|
160
|
+
throw new MaterializationValidationError2("Materialization cardinality work has an invalid identity or order.");
|
|
161
161
|
}
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
if (record.kind === "classification" && record.identityKey.trim().length === 0) {
|
|
165
|
-
throw new
|
|
165
|
+
throw new MaterializationValidationError2("Materialization classification identity is invalid.");
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function workUniquenessKey2(record) {
|
|
169
169
|
switch (record.kind) {
|
|
170
170
|
case "classification":
|
|
171
171
|
return `classification:${record.entityKind}:${record.identityKey}`;
|
|
172
172
|
case "object-existence":
|
|
173
|
-
return `object-existence:${
|
|
173
|
+
return `object-existence:${objectRefKey2(record.ref)}`;
|
|
174
174
|
case "incident-object":
|
|
175
|
-
return `incident-object:${
|
|
175
|
+
return `incident-object:${objectRefKey2(record.ref)}`;
|
|
176
176
|
case "cardinality":
|
|
177
177
|
return `cardinality:${record.view}:${record.scopeSortKey}:${record.linkSortKey}`;
|
|
178
178
|
case "plan":
|
|
@@ -181,7 +181,7 @@ function workUniquenessKey(record) {
|
|
|
181
181
|
return `event:${record.eventKindRank}:${record.sortKey}`;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function comparePlanWork2(left, right) {
|
|
185
185
|
return left.applyPhase - right.applyPhase || planKindOrder(left.item.kind) - planKindOrder(right.item.kind) || left.sortKey.localeCompare(right.sortKey) || left.recordKey.localeCompare(right.recordKey);
|
|
186
186
|
}
|
|
187
187
|
function planKindOrder(kind) {
|
|
@@ -210,20 +210,20 @@ function planKindOrder(kind) {
|
|
|
210
210
|
return 10;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function compareCardinalityWork2(left, right) {
|
|
214
214
|
return cardinalityViewOrder(left.view) - cardinalityViewOrder(right.view) || left.scopeSortKey.localeCompare(right.scopeSortKey) || left.linkSortKey.localeCompare(right.linkSortKey) || left.recordKey.localeCompare(right.recordKey);
|
|
215
215
|
}
|
|
216
216
|
function cardinalityViewOrder(view) {
|
|
217
217
|
return view === "effective" ? 0 : 1;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function compareEventWork2(left, right) {
|
|
220
220
|
return left.eventKindRank - right.eventKindRank || left.sortKey.localeCompare(right.sortKey) || left.recordKey.localeCompare(right.recordKey);
|
|
221
221
|
}
|
|
222
222
|
function planPhaseMatches(record) {
|
|
223
223
|
return record.applyPhase === materializationApplyPhase(record.item.kind);
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
for (const item of
|
|
225
|
+
function assertPlanChunkCorrelations2(chunk, commit) {
|
|
226
|
+
for (const item of materializationPlanItems2(chunk))
|
|
227
227
|
assertPlanItemCorrelation(item, commit);
|
|
228
228
|
for (const value of chunk.outbox)
|
|
229
229
|
assertOutboxCorrelation(value, commit);
|
|
@@ -260,38 +260,38 @@ function assertPlanItemCorrelation(item, commit) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
function assertPointWriteCorrelation(value, commit) {
|
|
263
|
-
if (
|
|
264
|
-
|
|
263
|
+
if (telemetryPointKey2(value.point.series, value.point.at) !== telemetryPointKey2(value.expected.series, value.expected.at)) {
|
|
264
|
+
invalidCorrelation2("Timeseries point write does not match its expected identity.");
|
|
265
265
|
}
|
|
266
|
-
|
|
266
|
+
assertTimestamp2(value.point.at, "Timeseries point timestamp");
|
|
267
267
|
if (value.point.lastCommitId !== commit.id) {
|
|
268
|
-
|
|
268
|
+
invalidCorrelation2("Timeseries point last commit id does not match its session commit.");
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
function assertOutboxCorrelation(value, commit) {
|
|
272
272
|
const { envelope } = value;
|
|
273
|
-
if (envelope.projectId !== commit.projectId || envelope.commitId !== commit.id || envelope.occurredAt !== commit.committedAt || value.availableAt !== commit.committedAt || value.createdAt !== commit.committedAt ||
|
|
274
|
-
|
|
273
|
+
if (envelope.projectId !== commit.projectId || envelope.commitId !== commit.id || envelope.occurredAt !== commit.committedAt || value.availableAt !== commit.committedAt || value.createdAt !== commit.committedAt || stableJsonStringify2(envelope.origin) !== stableJsonStringify2(commit.origin) || stableJsonStringify2(envelope.actor ?? null) !== stableJsonStringify2(commit.actor ?? null) || !Number.isSafeInteger(envelope.commitOrdinal) || envelope.commitOrdinal < 0 || envelope.id !== createEventId2(commit.projectId, commit.id, envelope.commitOrdinal)) {
|
|
274
|
+
invalidCorrelation2("Outbox event does not correlate with its materialization commit.");
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
function assertCommitWriteCorrelation(lastCommitId, updatedAt, commit, label) {
|
|
278
278
|
if (lastCommitId !== commit.id || updatedAt !== commit.committedAt) {
|
|
279
|
-
|
|
279
|
+
invalidCorrelation2(`${label} provenance does not match its session commit.`);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
function assertObjectRefEqual(left, right, label) {
|
|
283
|
-
if (
|
|
284
|
-
|
|
283
|
+
if (objectRefKey2(left) !== objectRefKey2(right)) {
|
|
284
|
+
invalidCorrelation2(`${label} row and expected references differ.`);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
function assertLinkRefEqual(left, right, label) {
|
|
288
|
-
if (
|
|
289
|
-
|
|
288
|
+
if (linkRefKey2(left) !== linkRefKey2(right)) {
|
|
289
|
+
invalidCorrelation2(`${label} row and expected references differ.`);
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
// src/storage/ontology/provider-header-validation.ts
|
|
294
|
-
function
|
|
294
|
+
function assertMaterializationHeader2({ commit }) {
|
|
295
295
|
assertCommitEnvelope(commit);
|
|
296
296
|
switch (commit.intent.kind) {
|
|
297
297
|
case "edit":
|
|
@@ -306,45 +306,45 @@ function assertMaterializationHeader({ commit }) {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
function assertCommitEnvelope(commit) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
309
|
+
assertNonblank2(commit.projectId, "Materialization project id");
|
|
310
|
+
assertNonblank2(commit.id, "Materialization commit id");
|
|
311
|
+
assertNonblank2(commit.idempotencyKey, "Materialization idempotency key");
|
|
312
|
+
assertNonblank2(commit.requestHash, "Materialization request hash");
|
|
313
|
+
assertNonblank2(commit.executionId, "Materialization execution id");
|
|
314
|
+
assertNonblank2(commit.ontologyRevision, "Materialization ontology revision");
|
|
315
|
+
assertTimestamp2(commit.committedAt, "Materialization commit time");
|
|
316
316
|
}
|
|
317
317
|
function assertEditCommit(commit, intent) {
|
|
318
|
-
|
|
318
|
+
assertNonnegativeInteger2(intent.operationCount, "Edit commit operation count");
|
|
319
319
|
switch (commit.origin.kind) {
|
|
320
320
|
case "action":
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
assertNonblank2(commit.origin.actionId, "Action origin action id");
|
|
322
|
+
assertNonblank2(commit.origin.runId, "Action origin run id");
|
|
323
323
|
return;
|
|
324
324
|
case "runtime":
|
|
325
|
-
|
|
325
|
+
assertNonblank2(commit.origin.requestId, "Runtime origin request id");
|
|
326
326
|
return;
|
|
327
327
|
default:
|
|
328
|
-
|
|
328
|
+
invalidCorrelation2("Edit commit origin does not correlate with its intent.");
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
function assertProjectionCommit(commit, intent) {
|
|
332
332
|
if (commit.origin.kind !== "projection") {
|
|
333
|
-
|
|
333
|
+
invalidCorrelation2("Projection commit origin does not correlate with its intent.");
|
|
334
334
|
}
|
|
335
335
|
assertProjectionSemanticMetadata(commit);
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
assertNonblank2(commit.origin.projectionRunId, "Projection run id");
|
|
337
|
+
assertTimestamp2(intent.datasetVersion.createdAt, "Projection dataset version createdAt");
|
|
338
338
|
if (commit.origin.projectionId !== intent.source.projectionId) {
|
|
339
|
-
|
|
339
|
+
invalidCorrelation2("Projection commit origin does not match its projection.");
|
|
340
340
|
}
|
|
341
341
|
if (commit.origin.datasetId !== intent.datasetVersion.datasetId || commit.origin.datasetVersionId !== intent.datasetVersion.versionId) {
|
|
342
|
-
|
|
342
|
+
invalidCorrelation2("Projection commit origin does not match its dataset version.");
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
function assertTelemetryCommit(commit, intent) {
|
|
346
346
|
if (commit.origin.kind !== "telemetry") {
|
|
347
|
-
|
|
347
|
+
invalidCorrelation2("Telemetry commit origin does not correlate with its intent.");
|
|
348
348
|
}
|
|
349
349
|
assertTelemetryPointCounts(intent);
|
|
350
350
|
if (intent.source.kind === "runtime") {
|
|
@@ -354,64 +354,64 @@ function assertTelemetryCommit(commit, intent) {
|
|
|
354
354
|
assertProjectionTelemetryCommit(commit, intent.source, intent.inputPointCount);
|
|
355
355
|
}
|
|
356
356
|
function assertTelemetryPointCounts(intent) {
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
assertNonnegativeInteger2(intent.pointCount, "Telemetry commit point count");
|
|
358
|
+
assertNonnegativeInteger2(intent.inputPointCount, "Telemetry commit input point count");
|
|
359
359
|
if (intent.inputPointCount < intent.pointCount) {
|
|
360
|
-
|
|
360
|
+
invalidCorrelation2("Telemetry input point count cannot be lower than its canonical point count.");
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
function assertRuntimeTelemetryCommit(commit) {
|
|
364
364
|
if (commit.origin.kind !== "telemetry" || commit.origin.source.kind !== "runtime") {
|
|
365
|
-
|
|
365
|
+
invalidCorrelation2("Runtime telemetry origin does not correlate with its intent.");
|
|
366
366
|
}
|
|
367
367
|
if (commit.projectionRevision !== undefined || commit.ownershipHash !== undefined) {
|
|
368
|
-
|
|
368
|
+
invalidCorrelation2("Runtime telemetry commit contains projection-only metadata.");
|
|
369
369
|
}
|
|
370
|
-
|
|
370
|
+
assertNonblank2(commit.origin.source.requestId, "Runtime telemetry request id");
|
|
371
371
|
}
|
|
372
372
|
function assertProjectionTelemetryCommit(commit, source, inputPointCount) {
|
|
373
373
|
if (commit.origin.kind !== "telemetry" || commit.origin.source.kind !== "projection") {
|
|
374
|
-
|
|
374
|
+
invalidCorrelation2("Projection telemetry origin does not correlate with its intent.");
|
|
375
375
|
}
|
|
376
376
|
const origin = commit.origin.source;
|
|
377
377
|
assertProjectionSemanticMetadata(commit);
|
|
378
|
-
|
|
379
|
-
|
|
378
|
+
assertNonblank2(origin.projectionRunId, "Telemetry projection run id");
|
|
379
|
+
assertTimestamp2(source.datasetVersion.createdAt, "Telemetry dataset version createdAt");
|
|
380
380
|
assertProjectionTelemetryBatch(source, inputPointCount);
|
|
381
381
|
if (origin.projectionId !== source.projection.projectionId) {
|
|
382
|
-
|
|
382
|
+
invalidCorrelation2("Projection telemetry origin does not match its projection.");
|
|
383
383
|
}
|
|
384
384
|
if (origin.datasetId !== source.datasetVersion.datasetId || origin.datasetVersionId !== source.datasetVersion.versionId) {
|
|
385
|
-
|
|
385
|
+
invalidCorrelation2("Projection telemetry origin does not match its dataset version.");
|
|
386
386
|
}
|
|
387
387
|
if (origin.batchOrdinal !== source.batchOrdinal) {
|
|
388
|
-
|
|
388
|
+
invalidCorrelation2("Projection telemetry origin does not match its batch ordinal.");
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
function assertProjectionTelemetryBatch(source, inputPointCount) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
392
|
+
assertNonnegativeInteger2(source.batchOrdinal, "Projection telemetry batch ordinal");
|
|
393
|
+
assertPositiveInteger2(source.sourceRowCount, "Projection telemetry source row count");
|
|
394
|
+
assertNonnegativeInteger2(source.sourceRowsSkipped, "Projection telemetry skipped row count");
|
|
395
395
|
if (source.sourceRowsSkipped > source.sourceRowCount) {
|
|
396
|
-
|
|
396
|
+
invalidCorrelation2("Projection telemetry skipped rows exceed its source row count.");
|
|
397
397
|
}
|
|
398
398
|
if (inputPointCount < source.sourceRowCount - source.sourceRowsSkipped) {
|
|
399
|
-
|
|
399
|
+
invalidCorrelation2("Projection telemetry input points do not account for every non-skipped source row.");
|
|
400
400
|
}
|
|
401
401
|
if (typeof source.inputExhausted !== "boolean") {
|
|
402
|
-
|
|
402
|
+
invalidCorrelation2("Projection telemetry input exhaustion marker is invalid.");
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
function assertProjectionSemanticMetadata(commit) {
|
|
406
406
|
if (commit.projectionRevision === undefined || commit.ownershipHash === undefined) {
|
|
407
|
-
|
|
407
|
+
invalidCorrelation2("Projection materialization is missing semantic identity metadata.");
|
|
408
408
|
}
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
assertNonblank2(commit.projectionRevision, "Projection revision");
|
|
410
|
+
assertNonblank2(commit.ownershipHash, "Projection ownership hash");
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
// src/storage/ontology/provider.ts
|
|
414
|
-
function
|
|
414
|
+
function startScopeAccumulator2(source, linkId) {
|
|
415
415
|
const hash = createHash2("sha256");
|
|
416
416
|
hash.update("[");
|
|
417
417
|
return {
|
|
@@ -421,17 +421,17 @@ function startScopeAccumulator(source, linkId) {
|
|
|
421
421
|
effectiveCount: 0
|
|
422
422
|
};
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function appendScopeSnapshot2(accumulator, snapshot) {
|
|
425
425
|
if (accumulator.effectiveCount > 0)
|
|
426
426
|
accumulator.hash.update(",");
|
|
427
|
-
accumulator.hash.update(
|
|
427
|
+
accumulator.hash.update(stableJsonStringify2({
|
|
428
428
|
ref: snapshot.ref,
|
|
429
429
|
properties: snapshot.properties ?? {},
|
|
430
430
|
lastCommitId: snapshot.lastCommitId
|
|
431
431
|
}));
|
|
432
432
|
accumulator.effectiveCount += 1;
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function finishScopeAccumulator2(accumulator) {
|
|
435
435
|
accumulator.hash.update("]");
|
|
436
436
|
return {
|
|
437
437
|
source: accumulator.source,
|
|
@@ -440,7 +440,7 @@ function finishScopeAccumulator(accumulator) {
|
|
|
440
440
|
fingerprint: accumulator.hash.digest("hex")
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function linkSlotOverrideValue2(value, scopeLabel) {
|
|
444
444
|
if (!isRecord(value) || typeof value.kind !== "string") {
|
|
445
445
|
throw invalidLinkSlotOverride(scopeLabel);
|
|
446
446
|
}
|
|
@@ -463,7 +463,7 @@ function linkSlotOverrideValue(value, scopeLabel) {
|
|
|
463
463
|
return { kind: "set", target, properties: structuredClone(value.properties) };
|
|
464
464
|
}
|
|
465
465
|
function invalidLinkSlotOverride(scopeLabel) {
|
|
466
|
-
return new
|
|
466
|
+
return new MaterializationConflictError2("effective-state", `Cardinality-one link slot ${scopeLabel} contains an invalid stored override.`);
|
|
467
467
|
}
|
|
468
468
|
function isRecord(value) {
|
|
469
469
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -481,7 +481,7 @@ function isJsonValue(value) {
|
|
|
481
481
|
return isRecord(value) && Object.values(value).every(isJsonValue);
|
|
482
482
|
}
|
|
483
483
|
|
|
484
|
-
class
|
|
484
|
+
class ProviderMaterializationSessionState2 {
|
|
485
485
|
header;
|
|
486
486
|
transactionId;
|
|
487
487
|
id = randomUUID();
|
|
@@ -505,12 +505,12 @@ class ProviderMaterializationSessionState {
|
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
|
|
508
|
-
class
|
|
508
|
+
class ProviderMaterializationTransactionLifecycle2 {
|
|
509
509
|
openSessions = new Set;
|
|
510
510
|
active = true;
|
|
511
511
|
register(sessionToken) {
|
|
512
512
|
if (!this.active) {
|
|
513
|
-
throw new
|
|
513
|
+
throw new MaterializationValidationError2("Cannot open a materialization session on an inactive storage transaction.");
|
|
514
514
|
}
|
|
515
515
|
this.openSessions.add(sessionToken);
|
|
516
516
|
}
|
|
@@ -520,39 +520,39 @@ class ProviderMaterializationTransactionLifecycle {
|
|
|
520
520
|
assertCommittable() {
|
|
521
521
|
if (this.openSessions.size === 0)
|
|
522
522
|
return;
|
|
523
|
-
throw new
|
|
523
|
+
throw new MaterializationValidationError2(`Storage transaction has ${this.openSessions.size} unfinished materialization session${this.openSessions.size === 1 ? "" : "s"}; every session returned by begin() must be finalized.`);
|
|
524
524
|
}
|
|
525
525
|
deactivate() {
|
|
526
526
|
this.active = false;
|
|
527
527
|
this.openSessions.clear();
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function prepareMaterializationWork2(state, input) {
|
|
531
531
|
if (state.workSealed) {
|
|
532
|
-
throw new
|
|
532
|
+
throw new MaterializationConflictError2("effective-state", "Materialization work cannot be staged after draining begins.");
|
|
533
533
|
}
|
|
534
534
|
const keys = new Set;
|
|
535
535
|
const uniqueKeys = new Set;
|
|
536
536
|
return input.records.map((record) => {
|
|
537
|
-
|
|
538
|
-
const uniqueKey =
|
|
537
|
+
assertWorkRecord2(record, state.header);
|
|
538
|
+
const uniqueKey = workUniquenessKey2(record);
|
|
539
539
|
if (keys.has(record.recordKey) || uniqueKeys.has(uniqueKey)) {
|
|
540
|
-
throw
|
|
540
|
+
throw duplicateMaterializationWork2(record.recordKey);
|
|
541
541
|
}
|
|
542
542
|
if (record.kind === "incident-object" && (!state.replacement || state.replacement.linkStreamStarted)) {
|
|
543
|
-
throw new
|
|
543
|
+
throw new MaterializationConflictError2("effective-state", "Incident replacement work must be staged before link state is streamed.");
|
|
544
544
|
}
|
|
545
545
|
keys.add(record.recordKey);
|
|
546
546
|
uniqueKeys.add(uniqueKey);
|
|
547
|
-
return { record, uniqueKey, columns:
|
|
547
|
+
return { record, uniqueKey, columns: materializationWorkColumns2(record) };
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function correlateMaterializationChunk2(state, chunk, actualItems, expectedItems, expectedEvents) {
|
|
551
551
|
if (actualItems.length > 0 && (!state.workStreams.apply.started || state.appliedPlanCount + actualItems.length > state.workStreams.apply.emittedCount)) {
|
|
552
552
|
invalidMaterializationCorrelation("Materialization plan items cannot be applied before they are streamed.");
|
|
553
553
|
}
|
|
554
554
|
for (let index = 0;index < actualItems.length; index += 1) {
|
|
555
|
-
if (
|
|
555
|
+
if (stableJsonStringify2(actualItems[index]) !== stableJsonStringify2(expectedItems[index])) {
|
|
556
556
|
invalidMaterializationCorrelation("Materialization plan items must be applied in exact streamed order.");
|
|
557
557
|
}
|
|
558
558
|
}
|
|
@@ -566,7 +566,7 @@ function correlateMaterializationChunk(state, chunk, actualItems, expectedItems,
|
|
|
566
566
|
invalidMaterializationCorrelation("Materialization outbox events must follow exact streamed order.");
|
|
567
567
|
}
|
|
568
568
|
const { id: _id, commitOrdinal, ...draft } = actual;
|
|
569
|
-
if (commitOrdinal !== state.appliedOutboxCount + index ||
|
|
569
|
+
if (commitOrdinal !== state.appliedOutboxCount + index || stableJsonStringify2(draft) !== stableJsonStringify2(expected.draft)) {
|
|
570
570
|
invalidMaterializationCorrelation("Materialization outbox events must follow exact streamed order.");
|
|
571
571
|
}
|
|
572
572
|
}
|
|
@@ -575,7 +575,7 @@ function correlateMaterializationChunk(state, chunk, actualItems, expectedItems,
|
|
|
575
575
|
appliedOutboxCount: state.appliedOutboxCount + chunk.outbox.length
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function assertMaterializationFinalizationCorrelation2(state, input) {
|
|
579
579
|
const { commit } = state.header;
|
|
580
580
|
const { result, sourceActivations } = input.finalization;
|
|
581
581
|
if (result.commitId !== commit.id || result.kind !== commit.intent.kind || result.committedAt !== commit.committedAt || result.created !== true || !Number.isSafeInteger(result.eventCount) || result.eventCount < 0 || result.eventCount !== state.appliedOutboxCount) {
|
|
@@ -596,7 +596,7 @@ function assertMaterializationFinalizationCorrelation(state, input) {
|
|
|
596
596
|
invalidMaterializationCorrelation("Telemetry result does not correlate with its point intent.");
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function assertMaterializationLaneCompletion2(state, counts) {
|
|
600
600
|
if (counts.apply > 0 && !state.workStreams.apply.completed) {
|
|
601
601
|
invalidMaterializationCorrelation("Materialization plan work was not fully streamed.");
|
|
602
602
|
}
|
|
@@ -613,9 +613,9 @@ function assertMaterializationLaneCompletion(state, counts) {
|
|
|
613
613
|
invalidMaterializationCorrelation("Materialization event work was not fully written to the outbox.");
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function assertSourceActivationCorrelation2(state, activation) {
|
|
617
617
|
const { commit } = state.header;
|
|
618
|
-
if (commit.intent.kind !== "projection" || commit.origin.kind !== "projection" || activation.source.projectionId !== commit.intent.source.projectionId || activation.source.projectionId !== commit.origin.projectionId || activation.execution.projectionRunId !== commit.origin.projectionRunId || activation.protocol !== "replacement" ||
|
|
618
|
+
if (commit.intent.kind !== "projection" || commit.origin.kind !== "projection" || activation.source.projectionId !== commit.intent.source.projectionId || activation.source.projectionId !== commit.origin.projectionId || activation.execution.projectionRunId !== commit.origin.projectionRunId || activation.protocol !== "replacement" || stableJsonStringify2(activation.datasetVersion) !== stableJsonStringify2(commit.intent.datasetVersion) || activation.projectionRevision !== commit.projectionRevision || activation.ownershipHash !== commit.ownershipHash || activation.ontologyRevision !== commit.ontologyRevision || activation.lastCommitId !== commit.id || activation.updatedAt !== commit.committedAt || !state.header.expected.sources.some((expected) => stableJsonStringify2(expected) === stableJsonStringify2(activation.expected))) {
|
|
619
619
|
invalidMaterializationCorrelation("Source activation does not correlate with its projection commit.");
|
|
620
620
|
}
|
|
621
621
|
const replacement = state.replacement;
|
|
@@ -624,19 +624,19 @@ function assertSourceActivationCorrelation(state, activation) {
|
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
function invalidMaterializationCorrelation(message) {
|
|
627
|
-
throw new
|
|
627
|
+
throw new MaterializationValidationError2(message);
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function uniqueSorted2(values, identity, sortKey) {
|
|
630
630
|
return [...new Map(values.map((value) => [identity(value), value])).values()].sort((left, right) => sortKey(left).localeCompare(sortKey(right)));
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function sameNonnegativeCounts2(actual, expected) {
|
|
633
633
|
const actualCounts = actual;
|
|
634
634
|
return Object.entries(expected).every(([key, value]) => typeof value === "number" && Number.isSafeInteger(actualCounts[key]) && actualCounts[key] === value && value >= 0);
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
return new
|
|
636
|
+
function effectiveConflict2(message) {
|
|
637
|
+
return new MaterializationConflictError2("effective-state", message);
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function materializationWorkColumns2(record) {
|
|
640
640
|
if (record.kind === "plan") {
|
|
641
641
|
return {
|
|
642
642
|
lane: "apply",
|
|
@@ -692,13 +692,13 @@ function materializationPlanKindRank(kind) {
|
|
|
692
692
|
return 10;
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
return new
|
|
695
|
+
function duplicateMaterializationWork2(key) {
|
|
696
|
+
return new MaterializationConflictError2("effective-state", key === undefined ? "Duplicate materialization work." : `Duplicate materialization work key '${key}'.`);
|
|
697
697
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
698
|
+
function canonicalJson2(value) {
|
|
699
|
+
return stableJsonStringify2(value);
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function originColumns2(origin) {
|
|
702
702
|
if (origin.kind === "action") {
|
|
703
703
|
return { kind: "action", runId: origin.runId, batchOrdinal: null };
|
|
704
704
|
}
|
|
@@ -714,7 +714,7 @@ function originColumns(origin) {
|
|
|
714
714
|
}
|
|
715
715
|
return { kind: origin.kind, runId: null, batchOrdinal: null };
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function originWhere2(origin) {
|
|
718
718
|
if (origin.kind === "action") {
|
|
719
719
|
return { kind: origin.kind, runId: origin.actionRunId, batchOrdinal: null };
|
|
720
720
|
}
|
|
@@ -727,33 +727,33 @@ function originWhere(origin) {
|
|
|
727
727
|
batchOrdinal: origin.batchOrdinal
|
|
728
728
|
};
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function objectRefFromColumns2(row) {
|
|
731
731
|
return { objectTypeId: row.object_type_id, primaryId: row.primary_id };
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function linkRefFromColumns2(row) {
|
|
734
734
|
return {
|
|
735
735
|
source: { objectTypeId: row.source_type_id, primaryId: row.source_id },
|
|
736
736
|
linkId: row.link_id,
|
|
737
737
|
target: { objectTypeId: row.target_type_id, primaryId: row.target_id }
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
return
|
|
740
|
+
function sourceEntityKey2(row) {
|
|
741
|
+
return projectionEntityKey2(row.assertion);
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function sourceStageRows2(projectionKind, rows) {
|
|
744
744
|
return rows.map((row) => {
|
|
745
|
-
|
|
746
|
-
return
|
|
745
|
+
assertSourceStagedRow2(projectionKind, row);
|
|
746
|
+
return sourceStageRow2(row);
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function sourceStageRow2(row) {
|
|
750
750
|
return {
|
|
751
751
|
row,
|
|
752
|
-
rootKey:
|
|
753
|
-
entityKey:
|
|
752
|
+
rootKey: projectionEntityKey2(row.root),
|
|
753
|
+
entityKey: sourceEntityKey2(row)
|
|
754
754
|
};
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function reconcileSourceStageRows2(rows, existingRows) {
|
|
757
757
|
const rootOrdinals = new Map(existingRows.map(({ rootKey, row }) => [rootKey, row.stagingOrdinal]));
|
|
758
758
|
const ordinalRoots = new Map(existingRows.map(({ rootKey, row }) => [row.stagingOrdinal, rootKey]));
|
|
759
759
|
const assertions = new Map(existingRows.map((row) => [row.entityKey, row.row]));
|
|
@@ -763,19 +763,19 @@ function reconcileSourceStageRows(rows, existingRows) {
|
|
|
763
763
|
const { entityKey, rootKey, row } = staged;
|
|
764
764
|
const rootOrdinal = rootOrdinals.get(rootKey);
|
|
765
765
|
if (rootOrdinal !== undefined && rootOrdinal !== row.stagingOrdinal) {
|
|
766
|
-
throw new
|
|
766
|
+
throw new MaterializationValidationError2(`Source materialization repeats root ${rootKey} at a different stream ordinal.`);
|
|
767
767
|
}
|
|
768
768
|
const ordinalRoot = ordinalRoots.get(row.stagingOrdinal);
|
|
769
769
|
if (ordinalRoot !== undefined && ordinalRoot !== rootKey) {
|
|
770
|
-
throw new
|
|
770
|
+
throw new MaterializationValidationError2(`Source materialization repeats stream ordinal ${row.stagingOrdinal} for another root.`);
|
|
771
771
|
}
|
|
772
772
|
const existing = assertions.get(entityKey) ?? pending.get(entityKey)?.row;
|
|
773
773
|
if (existing) {
|
|
774
|
-
if (
|
|
774
|
+
if (canonicalJson2(existing) === canonicalJson2(row)) {
|
|
775
775
|
unchanged += 1;
|
|
776
776
|
continue;
|
|
777
777
|
}
|
|
778
|
-
throw new
|
|
778
|
+
throw new MaterializationValidationError2(`Source materialization repeats asserted entity ${entityKey}.`);
|
|
779
779
|
}
|
|
780
780
|
rootOrdinals.set(rootKey, row.stagingOrdinal);
|
|
781
781
|
ordinalRoots.set(row.stagingOrdinal, rootKey);
|
|
@@ -783,7 +783,7 @@ function reconcileSourceStageRows(rows, existingRows) {
|
|
|
783
783
|
}
|
|
784
784
|
return { pending: [...pending.values()], unchanged };
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function sourceMaterializationIdentity2(input) {
|
|
787
787
|
return {
|
|
788
788
|
projectionKind: input.projectionKind,
|
|
789
789
|
protocol: input.protocol,
|
|
@@ -793,66 +793,66 @@ function sourceMaterializationIdentity(input) {
|
|
|
793
793
|
ontologyRevision: input.ontologyRevision
|
|
794
794
|
};
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
|
|
796
|
+
function assertSourceBeginInput2(input) {
|
|
797
|
+
assertSourceWriteIdentity2(input);
|
|
798
798
|
if (input.projectionKind !== "object" && input.projectionKind !== "link") {
|
|
799
|
-
throw new
|
|
799
|
+
throw new MaterializationValidationError2("Source projection kind must be 'object' or 'link'.");
|
|
800
800
|
}
|
|
801
801
|
if (input.protocol !== "replacement") {
|
|
802
|
-
throw new
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
}
|
|
812
|
-
function
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
}
|
|
817
|
-
function
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
}
|
|
821
|
-
function
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}
|
|
825
|
-
function
|
|
802
|
+
throw new MaterializationValidationError2("Source materialization protocol must be 'replacement'.");
|
|
803
|
+
}
|
|
804
|
+
assertNonblank2(input.projectionRevision, "Source projection revision");
|
|
805
|
+
assertNonblank2(input.ownershipHash, "Source ownership hash");
|
|
806
|
+
assertNonblank2(input.ontologyRevision, "Source ontology revision");
|
|
807
|
+
assertNonblank2(input.datasetVersion.datasetId, "Source dataset id");
|
|
808
|
+
assertNonblank2(input.datasetVersion.versionId, "Source dataset version id");
|
|
809
|
+
assertTimestamp2(input.datasetVersion.createdAt, "Source dataset version createdAt", true);
|
|
810
|
+
assertTimestamp2(input.createdAt, "Source createdAt", true);
|
|
811
|
+
}
|
|
812
|
+
function assertSourceWriteIdentity2(input) {
|
|
813
|
+
assertSourceProject2(input);
|
|
814
|
+
assertNonblank2(input.materializationId, "Source materialization id");
|
|
815
|
+
assertSourceExecutionIdentity2(input.execution.projectionRunId, input.execution.executionToken);
|
|
816
|
+
}
|
|
817
|
+
function assertSourceProject2(input) {
|
|
818
|
+
assertNonblank2(input.projectId, "Source project id");
|
|
819
|
+
assertNonblank2(input.source.projectionId, "Source projection id");
|
|
820
|
+
}
|
|
821
|
+
function assertSourceExecutionIdentity2(runId, token) {
|
|
822
|
+
assertNonblank2(runId, "Source projection run id");
|
|
823
|
+
assertNonblank2(token, "Source execution token");
|
|
824
|
+
}
|
|
825
|
+
function assertSourceCandidateOwner2(manifest, execution) {
|
|
826
826
|
if (manifest.projectionRunId !== execution.projectionRunId || manifest.executionToken !== execution.executionToken) {
|
|
827
|
-
throw
|
|
827
|
+
throw sourceConflict2(`Source materialization '${manifest.materializationId}' is owned by another execution.`);
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function assertSourceStagedRow2(projectionKind, row) {
|
|
831
831
|
if (!Number.isSafeInteger(row.stagingOrdinal) || row.stagingOrdinal < 0) {
|
|
832
|
-
throw new
|
|
832
|
+
throw new MaterializationValidationError2("Source staging ordinal must be a nonnegative safe integer.");
|
|
833
833
|
}
|
|
834
834
|
assertSourceEntity(row.root, "Source root");
|
|
835
835
|
assertSourceEntity(row.assertion, "Source assertion");
|
|
836
836
|
if (projectionKind === "object" && row.root.kind !== "object") {
|
|
837
|
-
throw new
|
|
837
|
+
throw new MaterializationValidationError2("Object projection source rows require an object root.");
|
|
838
838
|
}
|
|
839
839
|
if (projectionKind === "link" && (row.root.kind !== "link" || row.assertion.kind !== "link")) {
|
|
840
|
-
throw new
|
|
840
|
+
throw new MaterializationValidationError2("Link projection source rows require a link root and link assertion.");
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
843
|
function assertSourceEntity(entity, label) {
|
|
844
844
|
if (entity.kind === "object") {
|
|
845
|
-
|
|
846
|
-
|
|
845
|
+
assertNonblank2(entity.ref.objectTypeId, `${label} object type id`);
|
|
846
|
+
assertNonblank2(entity.ref.primaryId, `${label} primary id`);
|
|
847
847
|
return;
|
|
848
848
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
849
|
+
assertNonblank2(entity.ref.source.objectTypeId, `${label} source object type id`);
|
|
850
|
+
assertNonblank2(entity.ref.source.primaryId, `${label} source primary id`);
|
|
851
|
+
assertNonblank2(entity.ref.linkId, `${label} link id`);
|
|
852
|
+
assertNonblank2(entity.ref.target.objectTypeId, `${label} target object type id`);
|
|
853
|
+
assertNonblank2(entity.ref.target.primaryId, `${label} target primary id`);
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function sourceEntityColumns2(entity) {
|
|
856
856
|
if (entity.kind === "object") {
|
|
857
857
|
return {
|
|
858
858
|
objectTypeId: entity.ref.objectTypeId,
|
|
@@ -874,20 +874,20 @@ function sourceEntityColumns(entity) {
|
|
|
874
874
|
targetPrimaryId: entity.ref.target.primaryId
|
|
875
875
|
};
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function utf8SortKey2(canonicalKey) {
|
|
878
878
|
let key = "";
|
|
879
879
|
for (const byte of new TextEncoder().encode(canonicalKey)) {
|
|
880
880
|
key += byte.toString(16).padStart(2, "0");
|
|
881
881
|
}
|
|
882
882
|
return key;
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function isExactStagingManifest2(row, input) {
|
|
885
885
|
return row.status === "staging" && row.executionToken === input.execution.executionToken && row.projectionRunId === input.execution.projectionRunId && row.projectionKind === input.projectionKind && row.protocol === input.protocol && row.createdAt === input.createdAt && row.datasetVersion.datasetId === input.datasetVersion.datasetId && row.datasetVersion.versionId === input.datasetVersion.versionId && row.datasetVersion.createdAt === input.datasetVersion.createdAt && row.projectionRevision === input.projectionRevision && row.ownershipHash === input.ownershipHash && row.ontologyRevision === input.ontologyRevision;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
888
|
-
return new
|
|
887
|
+
function sourceConflict2(message) {
|
|
888
|
+
return new MaterializationConflictError2("source-materialization", message);
|
|
889
889
|
}
|
|
890
890
|
|
|
891
|
-
export {
|
|
891
|
+
export { ONTOLOGY_MATERIALIZATION_EVENT_KIND_ORDER2, materializationEventKindOrdinal2, sha256Canonical2, createRequestHash2, createCommitId2, createEventId2, assertNonblank2, assertPositiveInteger2, assertNonnegativeInteger2, assertTimestamp2, invalidCorrelation2, materializationApplyPhase, assertPageRows2, materializationChunkRows2, materializationPlanItems2, assertWorkRecord2, workUniquenessKey2, comparePlanWork2, compareCardinalityWork2, compareEventWork2, assertPlanChunkCorrelations2, assertMaterializationHeader2, startScopeAccumulator2, appendScopeSnapshot2, finishScopeAccumulator2, linkSlotOverrideValue2, ProviderMaterializationSessionState2, ProviderMaterializationTransactionLifecycle2, prepareMaterializationWork2, correlateMaterializationChunk2, assertMaterializationFinalizationCorrelation2, assertMaterializationLaneCompletion2, assertSourceActivationCorrelation2, uniqueSorted2, sameNonnegativeCounts2, effectiveConflict2, materializationWorkColumns2, duplicateMaterializationWork2, canonicalJson2, originColumns2, originWhere2, objectRefFromColumns2, linkRefFromColumns2, sourceEntityKey2, sourceStageRows2, sourceStageRow2, reconcileSourceStageRows2, sourceMaterializationIdentity2, assertSourceBeginInput2, assertSourceWriteIdentity2, assertSourceProject2, assertSourceExecutionIdentity2, assertSourceCandidateOwner2, assertSourceStagedRow2, sourceEntityColumns2, utf8SortKey2, isExactStagingManifest2, sourceConflict2 };
|
|
892
892
|
|
|
893
|
-
//# debugId=
|
|
893
|
+
//# debugId=5D27A31B16C81B1164756E2164756E21
|