@sixb/core 0.1.20 → 0.1.21
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/execution.d.ts.map +1 -1
- package/dist/actions/index.js +54 -47
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run-authorization.d.ts +9 -0
- package/dist/actions/run-authorization.d.ts.map +1 -1
- package/dist/activity/connection.d.ts +62 -0
- package/dist/activity/connection.d.ts.map +1 -0
- package/dist/activity/device.d.ts +8 -0
- package/dist/activity/device.d.ts.map +1 -0
- package/dist/activity/execution.d.ts +48 -0
- package/dist/activity/execution.d.ts.map +1 -0
- package/dist/activity/service.d.ts +79 -0
- package/dist/activity/service.d.ts.map +1 -0
- package/dist/activity/shares.d.ts +24 -0
- package/dist/activity/shares.d.ts.map +1 -0
- package/dist/activity/timeline.d.ts +96 -0
- package/dist/activity/timeline.d.ts.map +1 -0
- package/dist/agents/index.d.ts +2 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +63 -50
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/skills.d.ts.map +1 -1
- package/dist/agents/streams/index.js +3 -3
- package/dist/agents/streams/internal.js +3 -3
- package/dist/agents/types.d.ts +8 -8
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/artifacts/address.d.ts +48 -0
- package/dist/artifacts/address.d.ts.map +1 -0
- package/dist/artifacts/csv.d.ts +22 -0
- package/dist/artifacts/csv.d.ts.map +1 -0
- package/dist/artifacts/errors.d.ts +11 -0
- package/dist/artifacts/errors.d.ts.map +1 -0
- package/dist/artifacts/execution.d.ts +43 -0
- package/dist/artifacts/execution.d.ts.map +1 -0
- package/dist/artifacts/frames/assets.d.ts +28 -0
- package/dist/artifacts/frames/assets.d.ts.map +1 -0
- package/dist/artifacts/frames/grants.d.ts +37 -0
- package/dist/artifacts/frames/grants.d.ts.map +1 -0
- package/dist/artifacts/frames/index.d.ts +10 -0
- package/dist/artifacts/frames/index.d.ts.map +1 -0
- package/dist/artifacts/frames/index.js +892 -0
- package/dist/artifacts/frames/index.js.map +14 -0
- package/dist/artifacts/frames/kit.d.ts +66 -0
- package/dist/artifacts/frames/kit.d.ts.map +1 -0
- package/dist/artifacts/frames/probe.d.ts +41 -0
- package/dist/artifacts/frames/probe.d.ts.map +1 -0
- package/dist/artifacts/frames/protocol.d.ts +98 -0
- package/dist/artifacts/frames/protocol.d.ts.map +1 -0
- package/dist/artifacts/frames/runtime.d.ts +13 -0
- package/dist/artifacts/frames/runtime.d.ts.map +1 -0
- package/dist/artifacts/html.d.ts +6 -0
- package/dist/artifacts/html.d.ts.map +1 -0
- package/dist/artifacts/ids.d.ts +5 -0
- package/dist/artifacts/ids.d.ts.map +1 -0
- package/dist/artifacts/index.d.ts +16 -0
- package/dist/artifacts/index.d.ts.map +1 -0
- package/dist/artifacts/index.js +125 -0
- package/dist/artifacts/index.js.map +10 -0
- package/dist/artifacts/kinds.d.ts +5 -0
- package/dist/artifacts/kinds.d.ts.map +1 -0
- package/dist/artifacts/limits.d.ts +28 -0
- package/dist/artifacts/limits.d.ts.map +1 -0
- package/dist/artifacts/outline.d.ts +44 -0
- package/dist/artifacts/outline.d.ts.map +1 -0
- package/dist/artifacts/publish/files.d.ts +15 -0
- package/dist/artifacts/publish/files.d.ts.map +1 -0
- package/dist/artifacts/publish/index.d.ts +5 -0
- package/dist/artifacts/publish/index.d.ts.map +1 -0
- package/dist/artifacts/publish/index.js +36 -0
- package/dist/artifacts/publish/index.js.map +9 -0
- package/dist/artifacts/publish/publish.d.ts +52 -0
- package/dist/artifacts/publish/publish.d.ts.map +1 -0
- package/dist/artifacts/publish/references.d.ts +27 -0
- package/dist/artifacts/publish/references.d.ts.map +1 -0
- package/dist/artifacts/publish/validate/document.d.ts +17 -0
- package/dist/artifacts/publish/validate/document.d.ts.map +1 -0
- package/dist/artifacts/publish/validate/file.d.ts +8 -0
- package/dist/artifacts/publish/validate/file.d.ts.map +1 -0
- package/dist/artifacts/publish/validate/sheet.d.ts +15 -0
- package/dist/artifacts/publish/validate/sheet.d.ts.map +1 -0
- package/dist/artifacts/publish/validate/slides.d.ts +21 -0
- package/dist/artifacts/publish/validate/slides.d.ts.map +1 -0
- package/dist/artifacts/references.d.ts +12 -0
- package/dist/artifacts/references.d.ts.map +1 -0
- package/dist/artifacts/resolve.d.ts +41 -0
- package/dist/artifacts/resolve.d.ts.map +1 -0
- package/dist/artifacts/theme.d.ts +19 -0
- package/dist/artifacts/theme.d.ts.map +1 -0
- package/dist/artifacts/warnings.d.ts +11 -0
- package/dist/artifacts/warnings.d.ts.map +1 -0
- package/dist/artifacts/workbook.d.ts +64 -0
- package/dist/artifacts/workbook.d.ts.map +1 -0
- package/dist/auth/index.js +10 -10
- package/dist/authorization/decision.d.ts +2 -0
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/grant-kinds.d.ts +2 -2
- package/dist/authorization/grant-kinds.d.ts.map +1 -1
- package/dist/authorization/index.js +6 -6
- package/dist/blob-storage/browser.js +1 -1
- package/dist/blob-storage/index.js +2 -2
- package/dist/blob-storage/internal.d.ts +1 -1
- package/dist/blob-storage/internal.d.ts.map +1 -1
- package/dist/blob-storage/internal.js +11 -5
- package/dist/blob-storage/internal.js.map +1 -1
- package/dist/blob-storage/media-type.d.ts +12 -0
- package/dist/blob-storage/media-type.d.ts.map +1 -1
- package/dist/bootstrap/index.js +53 -47
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/{chunk-xfs8x8m9.js → chunk-0bphap9y.js} +5 -5
- package/dist/{chunk-1zq2p6g0.js → chunk-1cc1xaf3.js} +3 -3
- package/dist/chunk-3jms7je7.js +14 -0
- package/dist/chunk-3jms7je7.js.map +10 -0
- package/dist/{chunk-s54c868q.js → chunk-3qct2mdc.js} +3 -13
- package/dist/chunk-3qct2mdc.js.map +12 -0
- package/dist/{chunk-t7x8dmn0.js → chunk-431pyp2c.js} +3 -3
- package/dist/{chunk-c85m1hyj.js → chunk-447a5c0p.js} +2 -2
- package/dist/chunk-48qjhh6v.js +185 -0
- package/dist/chunk-48qjhh6v.js.map +13 -0
- package/dist/{chunk-ren4kg2j.js → chunk-561r0yc9.js} +8 -8
- package/dist/{chunk-5e43w60z.js → chunk-5948n82c.js} +2 -2
- package/dist/{chunk-yzwja0mj.js → chunk-5hx48dnn.js} +2 -2
- package/dist/{chunk-x6m907x7.js → chunk-5vems3nx.js} +5 -6
- package/dist/{chunk-x6m907x7.js.map → chunk-5vems3nx.js.map} +3 -3
- package/dist/{chunk-0rbyz4qy.js → chunk-61y5xs4p.js} +560 -164
- package/dist/{chunk-0rbyz4qy.js.map → chunk-61y5xs4p.js.map} +12 -9
- package/dist/chunk-65abf64x.js +13 -0
- package/dist/chunk-65abf64x.js.map +10 -0
- package/dist/{chunk-z3y5kg1x.js → chunk-6eqsgvxk.js} +3 -3
- package/dist/{chunk-z3y5kg1x.js.map → chunk-6eqsgvxk.js.map} +2 -2
- package/dist/chunk-6rqgmkde.js +2028 -0
- package/dist/chunk-6rqgmkde.js.map +29 -0
- package/dist/{chunk-d0bqz29d.js → chunk-6vb4st8k.js} +8 -4
- package/dist/{chunk-d0bqz29d.js.map → chunk-6vb4st8k.js.map} +3 -3
- package/dist/chunk-7q8t23v4.js +467 -0
- package/dist/chunk-7q8t23v4.js.map +14 -0
- package/dist/{chunk-5j58wjct.js → chunk-858emn8m.js} +6 -6
- package/dist/{chunk-hvsb78a1.js → chunk-8frc8a4j.js} +26 -26
- package/dist/{chunk-hvsb78a1.js.map → chunk-8frc8a4j.js.map} +2 -2
- package/dist/{chunk-3zxk45er.js → chunk-8ncg20rd.js} +3 -68
- package/dist/{chunk-3zxk45er.js.map → chunk-8ncg20rd.js.map} +4 -5
- package/dist/{chunk-n33z5bjw.js → chunk-918wwnaa.js} +490 -24
- package/dist/{chunk-n33z5bjw.js.map → chunk-918wwnaa.js.map} +13 -11
- package/dist/{chunk-rrzt8jdy.js → chunk-9j4jw7as.js} +103 -110
- package/dist/chunk-9j4jw7as.js.map +14 -0
- package/dist/chunk-9kgkfg6v.js +502 -0
- package/dist/chunk-9kgkfg6v.js.map +14 -0
- package/dist/chunk-a3faa34j.js +74 -0
- package/dist/chunk-a3faa34j.js.map +10 -0
- package/dist/{chunk-6c6sn0bh.js → chunk-akzryx9h.js} +335 -1167
- package/dist/{chunk-6c6sn0bh.js.map → chunk-akzryx9h.js.map} +18 -24
- package/dist/chunk-arns890k.js +10 -0
- package/dist/chunk-arns890k.js.map +10 -0
- package/dist/{chunk-hjzdd750.js → chunk-bk9svbcq.js} +11 -11
- package/dist/{chunk-hjzdd750.js.map → chunk-bk9svbcq.js.map} +2 -2
- package/dist/{chunk-hkc3jct7.js → chunk-c06hmxyy.js} +2 -10
- package/dist/chunk-c06hmxyy.js.map +10 -0
- package/dist/{chunk-6p49a5cq.js → chunk-c1rxbz5y.js} +3 -3
- package/dist/chunk-cfj9dfbb.js +288 -0
- package/dist/chunk-cfj9dfbb.js.map +12 -0
- package/dist/{chunk-bx9q3cwv.js → chunk-cn0fwwhy.js} +7 -7
- package/dist/{chunk-bx9q3cwv.js.map → chunk-cn0fwwhy.js.map} +1 -1
- package/dist/{chunk-gc4ntf7d.js → chunk-cwdzcv37.js} +1 -1
- package/dist/{chunk-fa02jy15.js → chunk-cy4mbddw.js} +1 -1
- package/dist/{chunk-9w055r5b.js → chunk-d09e3rax.js} +1 -1
- package/dist/chunk-d5rjr8c0.js +176 -0
- package/dist/chunk-d5rjr8c0.js.map +12 -0
- package/dist/{chunk-dk8tkk5f.js → chunk-d7dnxdep.js} +3 -3
- package/dist/{chunk-b38szspf.js → chunk-dhcv7yxc.js} +1 -1
- package/dist/{chunk-b38szspf.js.map → chunk-dhcv7yxc.js.map} +1 -1
- package/dist/{chunk-gsjm1wms.js → chunk-dhdha526.js} +8 -2
- package/dist/chunk-dhdha526.js.map +10 -0
- package/dist/{chunk-8mx7qw3y.js → chunk-dvd2fp9q.js} +2 -2
- package/dist/{chunk-8mx7qw3y.js.map → chunk-dvd2fp9q.js.map} +3 -3
- package/dist/{chunk-way52z4h.js → chunk-e17zdm62.js} +6 -12
- package/dist/{chunk-way52z4h.js.map → chunk-e17zdm62.js.map} +3 -4
- package/dist/{chunk-tpn40322.js → chunk-e6k4thh5.js} +11 -10
- package/dist/{chunk-tpn40322.js.map → chunk-e6k4thh5.js.map} +3 -3
- package/dist/{chunk-tw03bsmb.js → chunk-eptrvnby.js} +224 -3
- package/dist/chunk-eptrvnby.js.map +12 -0
- package/dist/{chunk-es1gxsbf.js → chunk-f4pamkt9.js} +8 -10
- package/dist/chunk-f4pamkt9.js.map +12 -0
- package/dist/chunk-ff5xkv0p.js +211 -0
- package/dist/chunk-ff5xkv0p.js.map +10 -0
- package/dist/{chunk-d09tj99x.js → chunk-g257jwnc.js} +10 -4
- package/dist/{chunk-d09tj99x.js.map → chunk-g257jwnc.js.map} +3 -3
- package/dist/chunk-g5bvzyyr.js +32 -0
- package/dist/chunk-g5bvzyyr.js.map +10 -0
- package/dist/chunk-hke9aeen.js +9 -0
- package/dist/chunk-hke9aeen.js.map +10 -0
- package/dist/{chunk-1sr8ryzk.js → chunk-hwksyjks.js} +122 -1
- package/dist/{chunk-1sr8ryzk.js.map → chunk-hwksyjks.js.map} +3 -3
- package/dist/chunk-jcfw4h7m.js +9 -0
- package/dist/chunk-jcfw4h7m.js.map +10 -0
- package/dist/{chunk-k6q3n2sc.js → chunk-k43ct2ke.js} +20 -11
- package/dist/chunk-k43ct2ke.js.map +12 -0
- package/dist/{chunk-3t2hgbgd.js → chunk-kge7k6ey.js} +40 -8
- package/dist/chunk-kge7k6ey.js.map +15 -0
- package/dist/{chunk-tg2cw67r.js → chunk-ky3j490c.js} +2 -2
- package/dist/chunk-mjddfa7k.js +129 -0
- package/dist/chunk-mjddfa7k.js.map +12 -0
- package/dist/{chunk-vpq4shxz.js → chunk-nn5xnx3s.js} +45 -10
- package/dist/{chunk-vpq4shxz.js.map → chunk-nn5xnx3s.js.map} +7 -6
- package/dist/{chunk-0yh890a4.js → chunk-q5e5tv4b.js} +35 -7
- package/dist/{chunk-0yh890a4.js.map → chunk-q5e5tv4b.js.map} +3 -3
- package/dist/{chunk-vyf9kfqf.js → chunk-q7gn29y3.js} +1 -1
- package/dist/{chunk-yevzdx4y.js → chunk-rmakanzx.js} +10 -12
- package/dist/{chunk-yevzdx4y.js.map → chunk-rmakanzx.js.map} +3 -4
- package/dist/{chunk-v9xd5wzd.js → chunk-s7jg7pmn.js} +1 -1
- package/dist/chunk-tbc1ngpd.js +642 -0
- package/dist/chunk-tbc1ngpd.js.map +18 -0
- package/dist/chunk-twe4dx8p.js +676 -0
- package/dist/chunk-twe4dx8p.js.map +15 -0
- package/dist/{chunk-9dmt152s.js → chunk-vf57cr4t.js} +2 -2
- package/dist/{chunk-9ybhtmg4.js → chunk-vvxtn22d.js} +1 -1
- package/dist/{chunk-jhm3zsa7.js → chunk-wkv3h3q7.js} +64 -2
- package/dist/{chunk-jhm3zsa7.js.map → chunk-wkv3h3q7.js.map} +3 -3
- package/dist/chunk-x0v3jd47.js +124 -0
- package/dist/chunk-x0v3jd47.js.map +10 -0
- package/dist/{chunk-7t429e3f.js → chunk-xvsc5m8n.js} +1 -1
- package/dist/{chunk-z4m0yz8c.js → chunk-y5tah2kf.js} +1 -1
- package/dist/{chunk-fkgc1wt8.js → chunk-z58tm0hm.js} +2 -2
- package/dist/datasets/builders.d.ts +15 -2
- package/dist/datasets/builders.d.ts.map +1 -1
- package/dist/datasets/column-index.d.ts +7 -0
- package/dist/datasets/column-index.d.ts.map +1 -0
- package/dist/datasets/execution.d.ts +3 -2
- package/dist/datasets/execution.d.ts.map +1 -1
- package/dist/datasets/write.js +8 -8
- package/dist/error-reporting/internal.js +4 -4
- package/dist/errors/internal.d.ts +1 -0
- package/dist/errors/internal.d.ts.map +1 -1
- package/dist/errors/internal.js +7 -4
- package/dist/errors/internal.js.map +1 -1
- package/dist/events/execution.d.ts +12 -2
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/index.js +4 -4
- package/dist/execution/agent.js +56 -49
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +52 -11
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/object-reader-clearance.d.ts +41 -0
- package/dist/execution/object-reader-clearance.d.ts.map +1 -0
- package/dist/execution/object-reader-ontology.d.ts +12 -0
- package/dist/execution/object-reader-ontology.d.ts.map +1 -0
- package/dist/execution/object-reader-security.d.ts +45 -0
- package/dist/execution/object-reader-security.d.ts.map +1 -0
- package/dist/execution/primitive.js +54 -47
- package/dist/execution/primitive.js.map +1 -1
- package/dist/execution/request.js +48 -41
- package/dist/execution/request.js.map +2 -2
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +20 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +112 -97
- package/dist/index.js.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 -3
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +21 -13
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/lineage.d.ts +94 -0
- package/dist/lake-storage/lineage.d.ts.map +1 -0
- package/dist/lake-storage/sql-transforms.d.ts +45 -0
- package/dist/lake-storage/sql-transforms.d.ts.map +1 -1
- package/dist/lake-storage/types.d.ts +55 -1
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/lake-storage/version-inputs.d.ts +14 -3
- package/dist/lake-storage/version-inputs.d.ts.map +1 -1
- package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
- package/dist/materializer/index.js +31 -30
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/execution/index.js +25 -24
- package/dist/models/execution/index.js.map +1 -1
- package/dist/objects/clearance-redaction.d.ts +27 -0
- package/dist/objects/clearance-redaction.d.ts.map +1 -0
- package/dist/objects/index.js +54 -47
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/link/authorization.d.ts +8 -5
- package/dist/objects/link/authorization.d.ts.map +1 -1
- package/dist/objects/link/upsert-batch.d.ts.map +1 -1
- package/dist/objects/object/delete.d.ts.map +1 -1
- package/dist/objects/object/upsert-batch.d.ts.map +1 -1
- package/dist/objects/object/upsert.d.ts.map +1 -1
- package/dist/objects/property-clearance.d.ts +47 -24
- package/dist/objects/property-clearance.d.ts.map +1 -1
- package/dist/objects/query/clearance-admission.d.ts +10 -0
- package/dist/objects/query/clearance-admission.d.ts.map +1 -0
- package/dist/objects/query/index.js +29 -28
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/link-query-clearance.d.ts +21 -0
- package/dist/objects/query/link-query-clearance.d.ts.map +1 -0
- package/dist/ontology/builders.d.ts.map +1 -1
- package/dist/ontology/docs-markdown.d.ts +1 -1
- package/dist/ontology/docs-markdown.d.ts.map +1 -1
- package/dist/ontology/index.js +7 -7
- package/dist/ontology/internal.js +4 -4
- package/dist/ontology/internal.js.map +1 -1
- package/dist/pipelines/index.d.ts +2 -0
- package/dist/pipelines/index.d.ts.map +1 -1
- package/dist/pipelines/index.js +47 -35
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/lineage.d.ts +17 -0
- package/dist/pipelines/lineage.d.ts.map +1 -0
- package/dist/projections/internal.d.ts +2 -2
- package/dist/projections/internal.js +30 -29
- package/dist/projections/internal.js.map +1 -1
- package/dist/runtime/create.d.ts +3 -0
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +6 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +2 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/internal.js +46 -42
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/ontology-mutations.d.ts +2 -0
- package/dist/runtime/ontology-mutations.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts +8 -0
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/sandboxes/auth.d.ts +16 -0
- package/dist/sandboxes/auth.d.ts.map +1 -1
- package/dist/sandboxes/config.d.ts.map +1 -1
- package/dist/sandboxes/configuration.d.ts +26 -0
- package/dist/sandboxes/configuration.d.ts.map +1 -1
- package/dist/sandboxes/index.d.ts +1 -1
- 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 +28 -5
- package/dist/sandboxes/sandbox.d.ts.map +1 -1
- package/dist/security/applied-markings-contribution.d.ts +58 -0
- package/dist/security/applied-markings-contribution.d.ts.map +1 -0
- package/dist/security/applied-markings-host.d.ts +10 -0
- package/dist/security/applied-markings-host.d.ts.map +1 -0
- package/dist/security/applied-markings-snapshot.d.ts +67 -0
- package/dist/security/applied-markings-snapshot.d.ts.map +1 -0
- package/dist/security/applied-markings.d.ts +73 -0
- package/dist/security/applied-markings.d.ts.map +1 -0
- package/dist/security/dataset-version-markings.d.ts +47 -0
- package/dist/security/dataset-version-markings.d.ts.map +1 -0
- package/dist/security/grants.d.ts +3 -2
- package/dist/security/grants.d.ts.map +1 -1
- package/dist/security/index.d.ts +2 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/internal.d.ts +15 -0
- package/dist/security/internal.d.ts.map +1 -0
- package/dist/security/internal.js +135 -0
- package/dist/security/internal.js.map +10 -0
- package/dist/security/marking-propagation.d.ts +62 -0
- package/dist/security/marking-propagation.d.ts.map +1 -0
- package/dist/security/marking-sets.d.ts +14 -0
- package/dist/security/marking-sets.d.ts.map +1 -0
- package/dist/security/markings.d.ts +6 -3
- package/dist/security/markings.d.ts.map +1 -1
- package/dist/security/pipeline-markings.d.ts +20 -0
- package/dist/security/pipeline-markings.d.ts.map +1 -0
- package/dist/security/project.d.ts +4 -0
- package/dist/security/project.d.ts.map +1 -0
- package/dist/security/projection-markings.d.ts +71 -0
- package/dist/security/projection-markings.d.ts.map +1 -0
- package/dist/security/public.js +2 -2
- package/dist/security/redactions.d.ts +4 -1
- package/dist/security/redactions.d.ts.map +1 -1
- package/dist/security/types.d.ts +22 -2
- package/dist/security/types.d.ts.map +1 -1
- package/dist/security/validation.d.ts.map +1 -1
- package/dist/shares/internal.js +24 -23
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/action-runs/failure.js +3 -3
- package/dist/storage/action-runs/in-memory.d.ts +4 -0
- package/dist/storage/action-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/action-runs/types.d.ts +8 -0
- package/dist/storage/action-runs/types.d.ts.map +1 -1
- package/dist/storage/activity/in-memory.d.ts +55 -0
- package/dist/storage/activity/in-memory.d.ts.map +1 -0
- package/dist/storage/activity/index.d.ts +3 -0
- package/dist/storage/activity/index.d.ts.map +1 -0
- package/dist/storage/activity/policy.d.ts +96 -0
- package/dist/storage/activity/policy.d.ts.map +1 -0
- package/dist/storage/activity/types.d.ts +191 -0
- package/dist/storage/activity/types.d.ts.map +1 -0
- package/dist/storage/agents/in-memory.d.ts +4 -0
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +2 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +9 -8
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-limits/enforcement.js +3 -3
- package/dist/storage/artifacts/errors.d.ts +8 -0
- package/dist/storage/artifacts/errors.d.ts.map +1 -0
- package/dist/storage/artifacts/in-memory.d.ts +34 -0
- package/dist/storage/artifacts/in-memory.d.ts.map +1 -0
- package/dist/storage/artifacts/index.d.ts +5 -0
- package/dist/storage/artifacts/index.d.ts.map +1 -0
- package/dist/storage/artifacts/record.d.ts +17 -0
- package/dist/storage/artifacts/record.d.ts.map +1 -0
- package/dist/storage/artifacts/types.d.ts +184 -0
- package/dist/storage/artifacts/types.d.ts.map +1 -0
- package/dist/storage/auth/in-memory/sessions.d.ts +2 -1
- package/dist/storage/auth/in-memory/sessions.d.ts.map +1 -1
- package/dist/storage/auth/index.d.ts +1 -1
- package/dist/storage/auth/index.d.ts.map +1 -1
- package/dist/storage/auth/types.d.ts +19 -0
- package/dist/storage/auth/types.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +2 -2
- package/dist/storage/executions/in-memory.d.ts +2 -1
- package/dist/storage/executions/in-memory.d.ts.map +1 -1
- package/dist/storage/executions/index.d.ts +1 -1
- package/dist/storage/executions/index.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +2 -0
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +9 -223
- package/dist/storage/executions/provider.js.map +3 -4
- package/dist/storage/executions/types.d.ts +31 -0
- package/dist/storage/executions/types.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +11 -11
- 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 +6 -4
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +54 -53
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +3 -0
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +66 -16
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/ontology/in-memory/sources.d.ts +2 -1
- package/dist/storage/ontology/in-memory/sources.d.ts.map +1 -1
- package/dist/storage/ontology/index.d.ts +1 -1
- package/dist/storage/ontology/index.d.ts.map +1 -1
- package/dist/storage/ontology/sources.d.ts +15 -0
- package/dist/storage/ontology/sources.d.ts.map +1 -1
- package/dist/storage/projection-runs/provider.js +3 -3
- package/dist/storage/share-grants/in-memory.d.ts +2 -1
- package/dist/storage/share-grants/in-memory.d.ts.map +1 -1
- package/dist/storage/share-grants/index.d.ts +1 -1
- package/dist/storage/share-grants/index.d.ts.map +1 -1
- package/dist/storage/share-grants/types.d.ts +6 -0
- package/dist/storage/share-grants/types.d.ts.map +1 -1
- package/dist/storage/types.d.ts +4 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/in-memory.d.ts +4 -0
- package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +13 -12
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/storage/workflow-runs/types.d.ts +5 -0
- package/dist/storage/workflow-runs/types.d.ts.map +1 -1
- package/dist/syncs/index.js +35 -34
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/action-run-storage-contract.d.ts.map +1 -1
- package/dist/testing/activity-storage-contract.d.ts +14 -0
- package/dist/testing/activity-storage-contract.d.ts.map +1 -0
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/artifact-storage-contract.d.ts +13 -0
- package/dist/testing/artifact-storage-contract.d.ts.map +1 -0
- package/dist/testing/auth-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +4488 -3137
- package/dist/testing/index.js.map +14 -12
- package/dist/testing/lake-merge-storage-contract.d.ts.map +1 -1
- package/dist/testing/lake-storage-contract.d.ts +2 -0
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/ontology-storage-contract.d.ts.map +1 -1
- package/dist/testing/share-grant-storage-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +27 -26
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workers/index.js +2 -2
- package/dist/workflows/builders.d.ts.map +1 -1
- package/dist/workflows/index.js +57 -51
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/types.d.ts +9 -0
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/validation.d.ts +7 -0
- package/dist/workflows/validation.d.ts.map +1 -1
- package/package.json +25 -1
- package/src/actions/execution.ts +18 -13
- package/src/actions/request.ts +18 -3
- package/src/actions/run-authorization.ts +23 -0
- package/src/activity/README.md +155 -0
- package/src/activity/connection.ts +217 -0
- package/src/activity/device.ts +41 -0
- package/src/activity/execution.ts +210 -0
- package/src/activity/service.ts +274 -0
- package/src/activity/shares.ts +62 -0
- package/src/activity/timeline.ts +424 -0
- package/src/agents/index.ts +8 -3
- package/src/agents/request.ts +5 -0
- package/src/agents/skills.ts +6 -0
- package/src/agents/types.ts +8 -8
- package/src/agents/validation.ts +2 -0
- package/src/artifacts/address.ts +132 -0
- package/src/artifacts/csv.ts +108 -0
- package/src/artifacts/errors.ts +21 -0
- package/src/artifacts/execution.ts +153 -0
- package/src/artifacts/frames/assets.ts +88 -0
- package/src/artifacts/frames/grants.ts +124 -0
- package/src/artifacts/frames/index.ts +15 -0
- package/src/artifacts/frames/kit.ts +392 -0
- package/src/artifacts/frames/probe.ts +309 -0
- package/src/artifacts/frames/protocol.ts +174 -0
- package/src/artifacts/frames/runtime.ts +213 -0
- package/src/artifacts/html.ts +25 -0
- package/src/artifacts/ids.ts +18 -0
- package/src/artifacts/index.ts +61 -0
- package/src/artifacts/kinds.ts +8 -0
- package/src/artifacts/limits.ts +27 -0
- package/src/artifacts/outline.ts +62 -0
- package/src/artifacts/publish/files.ts +87 -0
- package/src/artifacts/publish/index.ts +12 -0
- package/src/artifacts/publish/publish.ts +250 -0
- package/src/artifacts/publish/references.ts +130 -0
- package/src/artifacts/publish/validate/document.ts +114 -0
- package/src/artifacts/publish/validate/file.ts +19 -0
- package/src/artifacts/publish/validate/sheet.ts +251 -0
- package/src/artifacts/publish/validate/slides.ts +134 -0
- package/src/artifacts/references.ts +11 -0
- package/src/artifacts/resolve.ts +97 -0
- package/src/artifacts/theme.ts +116 -0
- package/src/artifacts/warnings.ts +10 -0
- package/src/artifacts/workbook.ts +315 -0
- package/src/authorization/decision.ts +5 -0
- package/src/authorization/grant-kinds.ts +14 -2
- package/src/blob-storage/internal.ts +1 -1
- package/src/blob-storage/media-type.ts +69 -0
- package/src/datasets/builders.ts +66 -2
- package/src/datasets/column-index.ts +19 -0
- package/src/datasets/execution.ts +23 -9
- package/src/errors/internal.ts +1 -0
- package/src/events/execution.ts +134 -21
- package/src/execution/authorized-object-reader.ts +270 -256
- package/src/execution/object-reader-clearance.ts +91 -0
- package/src/execution/object-reader-ontology.ts +63 -0
- package/src/execution/object-reader-security.ts +146 -0
- package/src/http/api-routes.ts +125 -0
- package/src/index.ts +71 -3
- package/src/lake-storage/in-memory.ts +26 -3
- package/src/lake-storage/index.ts +13 -1
- package/src/lake-storage/lineage.ts +385 -0
- package/src/lake-storage/sql-transforms.ts +45 -0
- package/src/lake-storage/types.ts +59 -1
- package/src/lake-storage/version-inputs.ts +35 -6
- package/src/maintenance/ontology-maintenance.ts +15 -0
- package/src/objects/clearance-redaction.ts +138 -0
- package/src/objects/link/authorization.ts +27 -7
- package/src/objects/link/remove.ts +2 -2
- package/src/objects/link/upsert-batch.ts +7 -5
- package/src/objects/link/upsert.ts +2 -2
- package/src/objects/object/delete.ts +2 -0
- package/src/objects/object/upsert-batch.ts +2 -4
- package/src/objects/object/upsert.ts +2 -3
- package/src/objects/property-clearance.ts +171 -152
- package/src/objects/query/clearance-admission.ts +112 -0
- package/src/objects/query/link-query-clearance.ts +73 -0
- package/src/ontology/builders.ts +12 -1
- package/src/ontology/docs-markdown.ts +1 -1
- package/src/pipelines/index.ts +2 -0
- package/src/pipelines/lineage.ts +45 -0
- package/src/projections/internal.ts +2 -2
- package/src/runtime/create.ts +4 -0
- package/src/runtime/host.ts +55 -0
- package/src/runtime/internal.ts +2 -0
- package/src/runtime/ontology-mutations.ts +19 -4
- package/src/runtime/resolve-definitions.ts +66 -3
- package/src/runtime/sixb.ts +18 -1
- package/src/sandboxes/README.md +29 -7
- package/src/sandboxes/auth.ts +16 -0
- package/src/sandboxes/config.ts +2 -7
- package/src/sandboxes/configuration.ts +61 -7
- package/src/sandboxes/index.ts +1 -0
- package/src/sandboxes/sandbox.ts +27 -5
- package/src/security/applied-markings-contribution.ts +277 -0
- package/src/security/applied-markings-host.ts +41 -0
- package/src/security/applied-markings-snapshot.ts +235 -0
- package/src/security/applied-markings.ts +405 -0
- package/src/security/dataset-version-markings.ts +163 -0
- package/src/security/grants.ts +39 -4
- package/src/security/index.ts +3 -0
- package/src/security/internal.ts +18 -0
- package/src/security/marking-propagation.ts +255 -0
- package/src/security/marking-sets.ts +42 -0
- package/src/security/markings.ts +29 -178
- package/src/security/pipeline-markings.ts +175 -0
- package/src/security/project.ts +8 -0
- package/src/security/projection-markings.ts +421 -0
- package/src/security/redactions.ts +7 -2
- package/src/security/types.ts +20 -2
- package/src/security/validation.ts +11 -4
- package/src/storage/action-runs/in-memory.ts +18 -0
- package/src/storage/action-runs/types.ts +8 -0
- package/src/storage/activity/in-memory.ts +374 -0
- package/src/storage/activity/index.ts +27 -0
- package/src/storage/activity/policy.ts +430 -0
- package/src/storage/activity/types.ts +211 -0
- package/src/storage/agents/in-memory.ts +10 -0
- package/src/storage/agents/provider.ts +2 -13
- package/src/storage/agents/types.ts +9 -16
- package/src/storage/artifacts/errors.ts +16 -0
- package/src/storage/artifacts/in-memory.ts +240 -0
- package/src/storage/artifacts/index.ts +30 -0
- package/src/storage/artifacts/record.ts +200 -0
- package/src/storage/artifacts/types.ts +209 -0
- package/src/storage/auth/in-memory/sessions.ts +21 -0
- package/src/storage/auth/index.ts +2 -0
- package/src/storage/auth/types.ts +18 -0
- package/src/storage/executions/in-memory.ts +61 -1
- package/src/storage/executions/index.ts +3 -0
- package/src/storage/executions/provider.ts +12 -0
- package/src/storage/executions/types.ts +30 -0
- package/src/storage/in-memory/index.ts +16 -0
- package/src/storage/index.ts +63 -0
- package/src/storage/internal.ts +30 -0
- package/src/storage/ontology/in-memory/sources.ts +23 -0
- package/src/storage/ontology/index.ts +2 -0
- package/src/storage/ontology/sources.ts +17 -0
- package/src/storage/share-grants/in-memory.ts +8 -0
- package/src/storage/share-grants/index.ts +1 -0
- package/src/storage/share-grants/types.ts +8 -0
- package/src/storage/types.ts +4 -0
- package/src/storage/workflow-runs/in-memory.ts +16 -0
- package/src/storage/workflow-runs/types.ts +5 -0
- package/src/testing/action-run-storage-contract.ts +25 -0
- package/src/testing/activity-storage-contract.ts +840 -0
- package/src/testing/agent-storage-contract.ts +22 -21
- package/src/testing/artifact-storage-contract.ts +517 -0
- package/src/testing/auth-storage-contract.ts +47 -0
- package/src/testing/execution-storage-contract.ts +147 -1
- package/src/testing/index.ts +9 -0
- package/src/testing/lake-merge-storage-contract.ts +38 -0
- package/src/testing/lake-storage-contract.ts +247 -2
- package/src/testing/materializer-storage-contract.ts +1 -0
- package/src/testing/ontology-storage-contract.ts +57 -2
- package/src/testing/share-grant-storage-contract.ts +15 -0
- package/src/workflows/builders.ts +14 -0
- package/src/workflows/types.ts +9 -0
- package/src/workflows/validation.ts +72 -0
- package/dist/chunk-1k89ecfr.js +0 -85
- package/dist/chunk-1k89ecfr.js.map +0 -10
- package/dist/chunk-3t2hgbgd.js.map +0 -15
- package/dist/chunk-4vyr1j8f.js +0 -128
- package/dist/chunk-4vyr1j8f.js.map +0 -11
- package/dist/chunk-9gyp8hg1.js +0 -363
- package/dist/chunk-9gyp8hg1.js.map +0 -14
- package/dist/chunk-es1gxsbf.js.map +0 -13
- package/dist/chunk-gsjm1wms.js.map +0 -10
- package/dist/chunk-hkc3jct7.js.map +0 -10
- package/dist/chunk-k6q3n2sc.js.map +0 -12
- package/dist/chunk-rrzt8jdy.js.map +0 -14
- package/dist/chunk-s16apyk9.js +0 -256
- package/dist/chunk-s16apyk9.js.map +0 -16
- package/dist/chunk-s54c868q.js.map +0 -12
- package/dist/chunk-tw03bsmb.js.map +0 -11
- /package/dist/{chunk-xfs8x8m9.js.map → chunk-0bphap9y.js.map} +0 -0
- /package/dist/{chunk-1zq2p6g0.js.map → chunk-1cc1xaf3.js.map} +0 -0
- /package/dist/{chunk-t7x8dmn0.js.map → chunk-431pyp2c.js.map} +0 -0
- /package/dist/{chunk-c85m1hyj.js.map → chunk-447a5c0p.js.map} +0 -0
- /package/dist/{chunk-ren4kg2j.js.map → chunk-561r0yc9.js.map} +0 -0
- /package/dist/{chunk-5e43w60z.js.map → chunk-5948n82c.js.map} +0 -0
- /package/dist/{chunk-yzwja0mj.js.map → chunk-5hx48dnn.js.map} +0 -0
- /package/dist/{chunk-5j58wjct.js.map → chunk-858emn8m.js.map} +0 -0
- /package/dist/{chunk-6p49a5cq.js.map → chunk-c1rxbz5y.js.map} +0 -0
- /package/dist/{chunk-gc4ntf7d.js.map → chunk-cwdzcv37.js.map} +0 -0
- /package/dist/{chunk-fa02jy15.js.map → chunk-cy4mbddw.js.map} +0 -0
- /package/dist/{chunk-9w055r5b.js.map → chunk-d09e3rax.js.map} +0 -0
- /package/dist/{chunk-dk8tkk5f.js.map → chunk-d7dnxdep.js.map} +0 -0
- /package/dist/{chunk-tg2cw67r.js.map → chunk-ky3j490c.js.map} +0 -0
- /package/dist/{chunk-vyf9kfqf.js.map → chunk-q7gn29y3.js.map} +0 -0
- /package/dist/{chunk-v9xd5wzd.js.map → chunk-s7jg7pmn.js.map} +0 -0
- /package/dist/{chunk-9dmt152s.js.map → chunk-vf57cr4t.js.map} +0 -0
- /package/dist/{chunk-9ybhtmg4.js.map → chunk-vvxtn22d.js.map} +0 -0
- /package/dist/{chunk-7t429e3f.js.map → chunk-xvsc5m8n.js.map} +0 -0
- /package/dist/{chunk-z4m0yz8c.js.map → chunk-y5tah2kf.js.map} +0 -0
- /package/dist/{chunk-fkgc1wt8.js.map → chunk-z58tm0hm.js.map} +0 -0
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolveObjectActionSubject,
|
|
13
13
|
SYSTEM_PRINCIPAL2,
|
|
14
14
|
principalsEqual2
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-nn5xnx3s.js";
|
|
16
16
|
import {
|
|
17
17
|
ActionValidationError2,
|
|
18
18
|
createSixbError2,
|
|
@@ -20,16 +20,14 @@ import {
|
|
|
20
20
|
isSixbError2,
|
|
21
21
|
toSixbFailure2,
|
|
22
22
|
summarizeErrorMessage2
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-dvd2fp9q.js";
|
|
24
24
|
import {
|
|
25
25
|
agentServiceAccountId2,
|
|
26
|
-
MAX_OBJECT_READ_FACETS2,
|
|
27
26
|
ObjectReadLimitExceededError2,
|
|
28
27
|
assertObjectReadOutputWithinLimit2,
|
|
29
28
|
createAgentRuntimeAuthorization,
|
|
30
29
|
resolveRuntimeAuthorizationForProject,
|
|
31
30
|
getAuthorizationRef,
|
|
32
|
-
captureExecutionScope,
|
|
33
31
|
resolveExecutionScopeAuthorization,
|
|
34
32
|
AuthorizationError2,
|
|
35
33
|
isAllowed2,
|
|
@@ -48,14 +46,14 @@ import {
|
|
|
48
46
|
canViewPipelineRun2,
|
|
49
47
|
canViewProjectionRun2,
|
|
50
48
|
canViewProjection2
|
|
51
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-6vb4st8k.js";
|
|
52
50
|
import {
|
|
53
51
|
canonicalMediaType2,
|
|
54
52
|
isFileRef2,
|
|
55
53
|
isValidFileRef,
|
|
56
54
|
supportsDirectUpload2,
|
|
57
55
|
supportsRangeRead2
|
|
58
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-wkv3h3q7.js";
|
|
59
57
|
import {
|
|
60
58
|
collectUserRefIds,
|
|
61
59
|
userReferenceProblem,
|
|
@@ -75,19 +73,15 @@ import {
|
|
|
75
73
|
normalizeLinkProperties2,
|
|
76
74
|
validateLinkProperties2,
|
|
77
75
|
assertTelemetryProperty2
|
|
78
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-8frc8a4j.js";
|
|
79
77
|
import {
|
|
80
78
|
isObjectRefSchema2,
|
|
81
79
|
validateSchemaOrRefValue2
|
|
82
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-s7jg7pmn.js";
|
|
83
81
|
import {
|
|
84
82
|
missingClearanceRedactions,
|
|
85
|
-
resolvePropertyClearance,
|
|
86
|
-
redactObjectRow,
|
|
87
|
-
redactDomainEvent,
|
|
88
|
-
createClearanceQueryAdmission,
|
|
89
83
|
WorkflowRunError2
|
|
90
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-9j4jw7as.js";
|
|
91
85
|
import {
|
|
92
86
|
objectRefKey2,
|
|
93
87
|
linkRefKey2,
|
|
@@ -101,11 +95,11 @@ import {
|
|
|
101
95
|
normalizeVector2,
|
|
102
96
|
objectBatchKey2,
|
|
103
97
|
WORKFLOW_RUN_FAILURE_CODES2
|
|
104
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-918wwnaa.js";
|
|
105
99
|
import {
|
|
106
100
|
ACTION_RUN_FAILURE_CODES2,
|
|
107
101
|
parseActionRunFailure2
|
|
108
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-dhcv7yxc.js";
|
|
109
103
|
import {
|
|
110
104
|
isModelReasoning2,
|
|
111
105
|
modelReasoningSupportIssue2
|
|
@@ -125,43 +119,48 @@ import {
|
|
|
125
119
|
import {
|
|
126
120
|
AgentStorageError2,
|
|
127
121
|
AGENT_REASONING_LEVELS2
|
|
128
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-3qct2mdc.js";
|
|
129
123
|
import {
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
actionRunRequestsEqual,
|
|
125
|
+
ObjectNotFoundError2
|
|
126
|
+
} from "./chunk-tbc1ngpd.js";
|
|
132
127
|
import {
|
|
133
|
-
|
|
134
|
-
} from "./chunk-
|
|
128
|
+
ExecutionStorageError2
|
|
129
|
+
} from "./chunk-eptrvnby.js";
|
|
135
130
|
import {
|
|
136
|
-
composeObjectQueryAdmissions,
|
|
137
131
|
validateObjectQuery2,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
countObjects2,
|
|
141
|
-
existsObjects2,
|
|
142
|
-
facetObjects2,
|
|
143
|
-
validateObjectFacetRequests,
|
|
144
|
-
explainObjectQuery2,
|
|
145
|
-
preflightObjectQueryLinks,
|
|
146
|
-
executeObjectQueryLinks2
|
|
147
|
-
} from "./chunk-bx9q3cwv.js";
|
|
148
|
-
import {
|
|
149
|
-
shareSixbErrorReporter2,
|
|
150
|
-
reportActionPhaseFailure2,
|
|
151
|
-
reportRunFailure2
|
|
152
|
-
} from "./chunk-fa02jy15.js";
|
|
132
|
+
explainObjectQuery2
|
|
133
|
+
} from "./chunk-cn0fwwhy.js";
|
|
153
134
|
import {
|
|
135
|
+
redactDomainEvent,
|
|
136
|
+
assertAuthorizedObjectReaderBinding,
|
|
137
|
+
getAuthorizedOntologyView,
|
|
138
|
+
readerClearance,
|
|
139
|
+
readerEventClearance,
|
|
154
140
|
getOntologyMutationRuntime2,
|
|
155
141
|
shareOntologyMutationRuntime2,
|
|
142
|
+
canReadActionRunSubject,
|
|
143
|
+
unreadableActionRunTypes,
|
|
144
|
+
canDelegationAccessActionRun,
|
|
145
|
+
actionRunBelongsToShareGrant,
|
|
146
|
+
resolveExecutionCosts,
|
|
147
|
+
createActivityRuntime,
|
|
148
|
+
createActivityCaptureRuntime,
|
|
149
|
+
registerActivityCaptureRuntime,
|
|
156
150
|
ModelExecutionSession
|
|
157
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-6rqgmkde.js";
|
|
152
|
+
import {
|
|
153
|
+
shareSixbErrorReporter2,
|
|
154
|
+
reportActionPhaseFailure2,
|
|
155
|
+
reportRunFailure2
|
|
156
|
+
} from "./chunk-cy4mbddw.js";
|
|
158
157
|
import {
|
|
159
158
|
resolveLoggingService2
|
|
160
159
|
} from "./chunk-3qms4nax.js";
|
|
161
160
|
import {
|
|
162
161
|
createLinkScopeFingerprint2,
|
|
163
162
|
normalizeJsonProperties2
|
|
164
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-bk9svbcq.js";
|
|
165
164
|
import {
|
|
166
165
|
EditBatchError2,
|
|
167
166
|
lowerEditBatch2
|
|
@@ -171,96 +170,98 @@ import {
|
|
|
171
170
|
applicableAiLimitPolicyStatuses2,
|
|
172
171
|
aiUsageLimitExceededError2,
|
|
173
172
|
aiUsageLimitUnavailableError2
|
|
174
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-q7gn29y3.js";
|
|
175
174
|
import {
|
|
176
175
|
AgentRequestError2,
|
|
177
176
|
normalizeAgentContextEntries2
|
|
178
177
|
} from "./chunk-pfp1txq2.js";
|
|
179
178
|
import {
|
|
180
179
|
publishAgentRunActivity2
|
|
181
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-5948n82c.js";
|
|
181
|
+
import {
|
|
182
|
+
ArtifactRequestError2
|
|
183
|
+
} from "./chunk-48qjhh6v.js";
|
|
182
184
|
import {
|
|
183
185
|
createFileDownloadUrl,
|
|
184
|
-
revokeFileDownloadUrl
|
|
185
|
-
|
|
186
|
-
openFileRef2,
|
|
187
|
-
jsonPointerSegment2
|
|
188
|
-
} from "./chunk-3zxk45er.js";
|
|
186
|
+
revokeFileDownloadUrl
|
|
187
|
+
} from "./chunk-8ncg20rd.js";
|
|
189
188
|
import {
|
|
190
189
|
registerConnectorConnectionsRuntime
|
|
191
190
|
} from "./chunk-5a4a52tq.js";
|
|
192
191
|
import {
|
|
193
192
|
createConnectorRuntime
|
|
194
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-ky3j490c.js";
|
|
195
194
|
import {
|
|
196
195
|
writeDataset2
|
|
197
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-431pyp2c.js";
|
|
198
197
|
import {
|
|
199
198
|
SyncValidationError2,
|
|
200
199
|
requestSyncRun2
|
|
201
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-0bphap9y.js";
|
|
201
|
+
import {
|
|
202
|
+
SandboxError2,
|
|
203
|
+
sandboxCredentialIssue2,
|
|
204
|
+
staticSandboxRecipe2
|
|
205
|
+
} from "./chunk-cfj9dfbb.js";
|
|
202
206
|
import {
|
|
203
207
|
compileShareAccessPlan
|
|
204
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-z58tm0hm.js";
|
|
209
|
+
import {
|
|
210
|
+
schemaRecordToJsonSchema2
|
|
211
|
+
} from "./chunk-6x0pqh32.js";
|
|
212
|
+
import {
|
|
213
|
+
requestPipelineRun2
|
|
214
|
+
} from "./chunk-rmakanzx.js";
|
|
215
|
+
import {
|
|
216
|
+
PipelineError2
|
|
217
|
+
} from "./chunk-hke9aeen.js";
|
|
205
218
|
import {
|
|
206
219
|
createObjectQueryBuilder2,
|
|
207
220
|
decorateObjectQueryExecutor
|
|
208
221
|
} from "./chunk-9k93ah50.js";
|
|
222
|
+
import {
|
|
223
|
+
executionRecordInputFromRuntime,
|
|
224
|
+
ensureExecutionRecord2,
|
|
225
|
+
createPrimitiveExecutionRecord,
|
|
226
|
+
restoreTrustedPrimitiveExecutionScope
|
|
227
|
+
} from "./chunk-vf57cr4t.js";
|
|
209
228
|
import {
|
|
210
229
|
resolveLanguageModel2
|
|
211
230
|
} from "./chunk-mfs23znk.js";
|
|
212
231
|
import {
|
|
213
232
|
AI_MODEL_CALL_OUTPUT_TOKEN_ALLOWANCE,
|
|
214
233
|
aiModelCallOutputTokenAllowance
|
|
215
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-1cc1xaf3.js";
|
|
216
235
|
import {
|
|
217
|
-
ObjectQueryValidationError2,
|
|
218
236
|
ObjectQueryPlanningError2
|
|
219
237
|
} from "./chunk-91mg3nj9.js";
|
|
220
|
-
import {
|
|
221
|
-
schemaRecordToJsonSchema2
|
|
222
|
-
} from "./chunk-6x0pqh32.js";
|
|
223
|
-
import {
|
|
224
|
-
PipelineError2,
|
|
225
|
-
requestPipelineRun2
|
|
226
|
-
} from "./chunk-yevzdx4y.js";
|
|
227
|
-
import {
|
|
228
|
-
executionRecordInputFromRuntime,
|
|
229
|
-
ensureExecutionRecord2,
|
|
230
|
-
createPrimitiveExecutionRecord,
|
|
231
|
-
restoreTrustedPrimitiveExecutionScope
|
|
232
|
-
} from "./chunk-9dmt152s.js";
|
|
233
238
|
import {
|
|
234
239
|
ShareGrantStorageError2
|
|
235
240
|
} from "./chunk-br3k6qbf.js";
|
|
236
|
-
import {
|
|
237
|
-
actionRunRequestsEqual,
|
|
238
|
-
ObjectNotFoundError2
|
|
239
|
-
} from "./chunk-s16apyk9.js";
|
|
240
241
|
import {
|
|
241
242
|
ActionRunError2
|
|
242
243
|
} from "./chunk-y0c4e6ex.js";
|
|
243
|
-
import {
|
|
244
|
-
findPrimitiveParentRequestExecution
|
|
245
|
-
} from "./chunk-ey1nk510.js";
|
|
246
|
-
import {
|
|
247
|
-
RuntimeError2
|
|
248
|
-
} from "./chunk-m4ehq95f.js";
|
|
249
|
-
import {
|
|
250
|
-
createPropertyTokenMap2,
|
|
251
|
-
createLinkTokenMap2
|
|
252
|
-
} from "./chunk-rdghfsss.js";
|
|
253
244
|
import {
|
|
254
245
|
MaterializationValidationError2,
|
|
255
246
|
MaterializationObjectNotFoundError2,
|
|
256
247
|
isMaterializationConflictError2
|
|
257
248
|
} from "./chunk-96yw3pwd.js";
|
|
249
|
+
import {
|
|
250
|
+
RuntimeError2
|
|
251
|
+
} from "./chunk-m4ehq95f.js";
|
|
258
252
|
import {
|
|
259
253
|
getDatasetPrimaryKeyColumns2
|
|
260
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-e17zdm62.js";
|
|
255
|
+
import {
|
|
256
|
+
publishArtifact2
|
|
257
|
+
} from "./chunk-9kgkfg6v.js";
|
|
261
258
|
import {
|
|
262
259
|
normalizeParams
|
|
263
|
-
} from "./chunk-
|
|
260
|
+
} from "./chunk-447a5c0p.js";
|
|
261
|
+
import {
|
|
262
|
+
OntologyValidationError2,
|
|
263
|
+
OntologyNotFoundError2
|
|
264
|
+
} from "./chunk-cqr3acm1.js";
|
|
264
265
|
import {
|
|
265
266
|
ModelProviderError2,
|
|
266
267
|
ModelStreamError2,
|
|
@@ -269,10 +270,10 @@ import {
|
|
|
269
270
|
sameEmbeddingModel
|
|
270
271
|
} from "./chunk-kyjcwqz6.js";
|
|
271
272
|
import {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
} from "./chunk-
|
|
273
|
+
resolveFileRefAtPath2,
|
|
274
|
+
openFileRef2,
|
|
275
|
+
jsonPointerSegment2
|
|
276
|
+
} from "./chunk-a3faa34j.js";
|
|
276
277
|
import {
|
|
277
278
|
isJsonValue2,
|
|
278
279
|
assertJsonValue2,
|
|
@@ -313,1003 +314,10 @@ function bindModelExecutionAttempt(models, input) {
|
|
|
313
314
|
bindings.delete(models);
|
|
314
315
|
}
|
|
315
316
|
|
|
316
|
-
// src/assert-never.ts
|
|
317
|
-
function assertNever(_value, message) {
|
|
318
|
-
throw new Error(message);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// src/objects/authorized-ontology-view.ts
|
|
322
|
-
function createAuthorizedOntologyView(input) {
|
|
323
|
-
const allObjectTypes = input.ontology.listObjectTypes();
|
|
324
|
-
const registeredObjectTypeIds = new Set(allObjectTypes.map((objectType) => objectType.id));
|
|
325
|
-
const requestedObjectTypeIds = selectedObjectTypeIds(input.selection, allObjectTypes);
|
|
326
|
-
const visibleObjectTypeIds = new Set([...requestedObjectTypeIds].filter((objectTypeId) => registeredObjectTypeIds.has(objectTypeId)));
|
|
327
|
-
const selectedSchema = input.selection.kind === "selected" ? collectSelectedSchema(input.selection.scope) : undefined;
|
|
328
|
-
const projectedObjectTypes = [];
|
|
329
|
-
for (const objectType of allObjectTypes) {
|
|
330
|
-
if (!visibleObjectTypeIds.has(objectType.id))
|
|
331
|
-
continue;
|
|
332
|
-
const propertyIds = selectedSchema?.propertyIdsByObjectType.get(objectType.id) ?? new Set(objectType.properties.map((property) => property.id));
|
|
333
|
-
const links = selectedSchema ? selectedSchema.linksBySourceType.get(objectType.id) ?? new Map : input.selection.kind === "all" ? allDeclaredLinks(objectType) : allVisibleLinks(input.ontology, objectType, visibleObjectTypeIds);
|
|
334
|
-
projectedObjectTypes.push(projectObjectType({
|
|
335
|
-
objectType,
|
|
336
|
-
propertyIds,
|
|
337
|
-
links,
|
|
338
|
-
visibleObjectTypeIds,
|
|
339
|
-
ontology: input.ontology,
|
|
340
|
-
targetMode: input.selection.kind === "all" ? "original" : input.selection.kind === "types" ? "principal" : "exact",
|
|
341
|
-
exposeContracts: input.selection.kind !== "selected"
|
|
342
|
-
}));
|
|
343
|
-
}
|
|
344
|
-
const objectTypes = projectedObjectTypes;
|
|
345
|
-
const objectTypesById = new Map(objectTypes.map((objectType) => [objectType.id, objectType]));
|
|
346
|
-
const valueTypesById = input.selection.kind === "selected" ? collectVisibleValueTypes(input.ontology.getValueTypesById(), objectTypes) : snapshotAllValueTypes(input.ontology.getValueTypesById());
|
|
347
|
-
const release = (value, budgetValue = value) => {
|
|
348
|
-
input.assertOutputWithinLimit?.(budgetValue);
|
|
349
|
-
return value;
|
|
350
|
-
};
|
|
351
|
-
const cloneObjectType = (objectType) => structuredClone(objectType);
|
|
352
|
-
const cloneValueTypes = () => new Map([...valueTypesById].map(([valueTypeId, valueType]) => [
|
|
353
|
-
valueTypeId,
|
|
354
|
-
structuredClone(valueType)
|
|
355
|
-
]));
|
|
356
|
-
return Object.freeze({
|
|
357
|
-
listObjectTypes: () => release(objectTypes.map(cloneObjectType)),
|
|
358
|
-
getObjectTypeById: (objectTypeId) => {
|
|
359
|
-
const objectType = objectTypesById.get(objectTypeId);
|
|
360
|
-
return release(objectType ? cloneObjectType(objectType) : null);
|
|
361
|
-
},
|
|
362
|
-
resolveObjectType: (objectTypeId) => {
|
|
363
|
-
const objectType = objectTypesById.get(objectTypeId);
|
|
364
|
-
return objectType ? release(cloneObjectType(objectType)) : unknownObjectType(objectTypeId);
|
|
365
|
-
},
|
|
366
|
-
getValueTypesById: () => {
|
|
367
|
-
const valueTypes = cloneValueTypes();
|
|
368
|
-
return release(valueTypes, [...valueTypes.entries()]);
|
|
369
|
-
},
|
|
370
|
-
getPrimaryPropertyId: (objectTypeId) => {
|
|
371
|
-
const objectType = objectTypesById.get(objectTypeId);
|
|
372
|
-
if (!objectType)
|
|
373
|
-
return unknownObjectType(objectTypeId);
|
|
374
|
-
const primary = objectType.properties.find((property) => property.primary);
|
|
375
|
-
if (!primary) {
|
|
376
|
-
throw new OntologyValidationError2(`[Sixb] Object type '${objectTypeId}' does not expose its primary property in this execution scope.`);
|
|
377
|
-
}
|
|
378
|
-
return release(primary.id);
|
|
379
|
-
},
|
|
380
|
-
listSubTypes: (objectTypeId) => {
|
|
381
|
-
const subTypes = visibleObjectTypeIds.has(objectTypeId) ? input.ontology.listSubTypes(objectTypeId).filter((subTypeId) => visibleObjectTypeIds.has(subTypeId)) : [];
|
|
382
|
-
return release(subTypes);
|
|
383
|
-
},
|
|
384
|
-
isValidLinkTarget: (expected, actual) => {
|
|
385
|
-
if (input.selection.kind === "all") {
|
|
386
|
-
return release(input.ontology.isValidLinkTarget(expected, actual));
|
|
387
|
-
}
|
|
388
|
-
if (!visibleObjectTypeIds.has(actual))
|
|
389
|
-
return release(false);
|
|
390
|
-
const expectedTypes = Array.isArray(expected) ? expected : [expected];
|
|
391
|
-
if (input.selection.kind === "selected") {
|
|
392
|
-
return release(expectedTypes.some((expectedType) => expectedType === "*" || expectedType === actual));
|
|
393
|
-
}
|
|
394
|
-
return release(expectedTypes.some((expectedType) => expectedType === "*" || visibleObjectTypeIds.has(expectedType) && input.ontology.isValidLinkTarget(expectedType, actual)));
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
function selectedObjectTypeIds(selection, allObjectTypes) {
|
|
399
|
-
switch (selection.kind) {
|
|
400
|
-
case "all":
|
|
401
|
-
return new Set(allObjectTypes.map((objectType) => objectType.id));
|
|
402
|
-
case "types":
|
|
403
|
-
return new Set(selection.objectTypeIds);
|
|
404
|
-
case "selected":
|
|
405
|
-
return new Set(selection.scope.objects.map((object) => object.objectTypeId));
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
function collectSelectedSchema(scope) {
|
|
409
|
-
const propertyIdsByObjectType = new Map;
|
|
410
|
-
for (const object of scope.objects) {
|
|
411
|
-
const properties = propertyIdsByObjectType.get(object.objectTypeId) ?? new Set;
|
|
412
|
-
for (const propertyId of object.propertyIds)
|
|
413
|
-
properties.add(propertyId);
|
|
414
|
-
propertyIdsByObjectType.set(object.objectTypeId, properties);
|
|
415
|
-
}
|
|
416
|
-
const linksBySourceType = new Map;
|
|
417
|
-
for (const step of scope.steps) {
|
|
418
|
-
const links = linksBySourceType.get(step.sourceObjectTypeId) ?? new Map;
|
|
419
|
-
const selected = links.get(step.linkId) ?? {
|
|
420
|
-
targetObjectTypeIds: new Set,
|
|
421
|
-
propertyIds: new Set
|
|
422
|
-
};
|
|
423
|
-
selected.targetObjectTypeIds.add(step.targetObjectTypeId);
|
|
424
|
-
for (const propertyId of step.propertyIds)
|
|
425
|
-
selected.propertyIds.add(propertyId);
|
|
426
|
-
links.set(step.linkId, selected);
|
|
427
|
-
linksBySourceType.set(step.sourceObjectTypeId, links);
|
|
428
|
-
}
|
|
429
|
-
return { propertyIdsByObjectType, linksBySourceType };
|
|
430
|
-
}
|
|
431
|
-
function allDeclaredLinks(objectType) {
|
|
432
|
-
return new Map(objectType.links.map((link) => [
|
|
433
|
-
link.id,
|
|
434
|
-
{
|
|
435
|
-
targetObjectTypeIds: new Set(typeof link.targetObjectTypeId === "string" ? [link.targetObjectTypeId] : link.targetObjectTypeId),
|
|
436
|
-
propertyIds: new Set(link.properties?.map((property) => property.id) ?? [])
|
|
437
|
-
}
|
|
438
|
-
]));
|
|
439
|
-
}
|
|
440
|
-
function allVisibleLinks(ontology, objectType, visibleObjectTypeIds) {
|
|
441
|
-
const links = new Map;
|
|
442
|
-
for (const link of objectType.links) {
|
|
443
|
-
const targetObjectTypeIds = new Set([...visibleObjectTypeIds].filter((targetObjectTypeId) => ontology.isValidLinkTarget(link.targetObjectTypeId, targetObjectTypeId)));
|
|
444
|
-
if (targetObjectTypeIds.size === 0)
|
|
445
|
-
continue;
|
|
446
|
-
links.set(link.id, {
|
|
447
|
-
targetObjectTypeIds,
|
|
448
|
-
propertyIds: new Set(link.properties?.map((property) => property.id) ?? [])
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
return links;
|
|
452
|
-
}
|
|
453
|
-
function projectObjectType(input) {
|
|
454
|
-
const properties = input.objectType.properties.filter((property) => input.propertyIds.has(property.id)).map(snapshotProperty);
|
|
455
|
-
const visiblePropertyIds = new Set(properties.map((property) => property.id));
|
|
456
|
-
const links = input.objectType.links.flatMap((link) => {
|
|
457
|
-
const selected = input.links.get(link.id);
|
|
458
|
-
if (!selected)
|
|
459
|
-
return [];
|
|
460
|
-
if (input.targetMode === "original") {
|
|
461
|
-
return [snapshotLink(link, snapshotLinkTarget(link.targetObjectTypeId), selected.propertyIds)];
|
|
462
|
-
}
|
|
463
|
-
const targetObjectTypeIds = new Set([...selected.targetObjectTypeIds].filter((targetObjectTypeId) => input.visibleObjectTypeIds.has(targetObjectTypeId) && input.ontology.isValidLinkTarget(link.targetObjectTypeId, targetObjectTypeId)));
|
|
464
|
-
if (targetObjectTypeIds.size === 0)
|
|
465
|
-
return [];
|
|
466
|
-
const target = input.targetMode === "principal" ? principalLinkTargets(link, targetObjectTypeIds, input.visibleObjectTypeIds) : exactLinkTargets(targetObjectTypeIds);
|
|
467
|
-
return [snapshotLink(link, target, selected.propertyIds, { omitEmptyProperties: true })];
|
|
468
|
-
});
|
|
469
|
-
const projected = {
|
|
470
|
-
id: input.objectType.id,
|
|
471
|
-
name: input.objectType.name,
|
|
472
|
-
description: input.objectType.description,
|
|
473
|
-
quantityKind: input.objectType.quantityKind,
|
|
474
|
-
seeAlso: input.objectType.seeAlso ? [...input.objectType.seeAlso] : undefined,
|
|
475
|
-
extends: input.objectType.extends && input.visibleObjectTypeIds.has(input.objectType.extends) ? input.objectType.extends : undefined,
|
|
476
|
-
parents: projectOptionalIds(input.objectType.parents, input.visibleObjectTypeIds, input.targetMode === "original"),
|
|
477
|
-
implements: input.exposeContracts && input.objectType.implements ? [...input.objectType.implements] : undefined,
|
|
478
|
-
properties,
|
|
479
|
-
links,
|
|
480
|
-
search: projectSearch(input.objectType.search, visiblePropertyIds, {
|
|
481
|
-
preserveEmpty: input.targetMode !== "exact"
|
|
482
|
-
})
|
|
483
|
-
};
|
|
484
|
-
const withTokens = {
|
|
485
|
-
...projected,
|
|
486
|
-
p: createPropertyTokenMap2(projected),
|
|
487
|
-
l: createLinkTokenMap2(projected)
|
|
488
|
-
};
|
|
489
|
-
return deepFreeze(withTokens);
|
|
490
|
-
}
|
|
491
|
-
function principalLinkTargets(link, allowedTargetObjectTypeIds, visibleObjectTypeIds) {
|
|
492
|
-
if (link.targetObjectTypeId === "*")
|
|
493
|
-
return exactLinkTargets(allowedTargetObjectTypeIds);
|
|
494
|
-
const declared = Array.isArray(link.targetObjectTypeId) ? link.targetObjectTypeId : [link.targetObjectTypeId];
|
|
495
|
-
if (declared.every((objectTypeId) => visibleObjectTypeIds.has(objectTypeId))) {
|
|
496
|
-
return snapshotLinkTarget(link.targetObjectTypeId);
|
|
497
|
-
}
|
|
498
|
-
return exactLinkTargets(allowedTargetObjectTypeIds);
|
|
499
|
-
}
|
|
500
|
-
function exactLinkTargets(targetObjectTypeIds) {
|
|
501
|
-
const targets = [...targetObjectTypeIds].sort();
|
|
502
|
-
return targets.length === 1 ? targets[0] : targets;
|
|
503
|
-
}
|
|
504
|
-
function projectOptionalIds(ids, visibleObjectTypeIds, preserveOriginal) {
|
|
505
|
-
if (!ids)
|
|
506
|
-
return;
|
|
507
|
-
if (preserveOriginal)
|
|
508
|
-
return [...ids];
|
|
509
|
-
const visible = ids.filter((id) => visibleObjectTypeIds.has(id));
|
|
510
|
-
return visible.length > 0 ? visible : undefined;
|
|
511
|
-
}
|
|
512
|
-
function snapshotLink(link, targetObjectTypeId, propertyIds, options = {}) {
|
|
513
|
-
const properties = link.properties?.filter((property) => propertyIds.has(property.id)).map(snapshotProperty);
|
|
514
|
-
return {
|
|
515
|
-
id: link.id,
|
|
516
|
-
name: link.name,
|
|
517
|
-
description: link.description,
|
|
518
|
-
targetObjectTypeId,
|
|
519
|
-
cardinality: link.cardinality,
|
|
520
|
-
properties: options.omitEmptyProperties && properties?.length === 0 ? undefined : properties
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
function snapshotLinkTarget(target) {
|
|
524
|
-
return typeof target === "string" ? target : [...target];
|
|
525
|
-
}
|
|
526
|
-
function snapshotProperty(property) {
|
|
527
|
-
return {
|
|
528
|
-
id: property.id,
|
|
529
|
-
name: property.name,
|
|
530
|
-
schema: snapshotSchema(property.schema),
|
|
531
|
-
description: property.description,
|
|
532
|
-
required: property.required,
|
|
533
|
-
nullable: property.nullable,
|
|
534
|
-
primary: property.primary,
|
|
535
|
-
mode: property.mode,
|
|
536
|
-
semanticType: property.semanticType,
|
|
537
|
-
query: snapshotPropertyQuery(property.query)
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
function snapshotPropertyQuery(query) {
|
|
541
|
-
if (!query)
|
|
542
|
-
return;
|
|
543
|
-
return {
|
|
544
|
-
searchable: query.searchable,
|
|
545
|
-
filterable: query.filterable,
|
|
546
|
-
sortable: query.sortable,
|
|
547
|
-
text: query.text,
|
|
548
|
-
exact: query.exact,
|
|
549
|
-
facet: query.facet,
|
|
550
|
-
weight: query.weight
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
function projectSearch(search, visiblePropertyIds, options) {
|
|
554
|
-
if (!search)
|
|
555
|
-
return;
|
|
556
|
-
const title = search.title && visiblePropertyIds.has(search.title) ? search.title : undefined;
|
|
557
|
-
const selectedDefaultText = search.defaultText?.filter((propertyId) => visiblePropertyIds.has(propertyId));
|
|
558
|
-
const selectedExact = search.exact?.filter((propertyId) => visiblePropertyIds.has(propertyId));
|
|
559
|
-
const defaultText = options.preserveEmpty || selectedDefaultText?.length ? selectedDefaultText : undefined;
|
|
560
|
-
const exact = options.preserveEmpty || selectedExact?.length ? selectedExact : undefined;
|
|
561
|
-
const vectors = search.vectors === undefined ? undefined : snapshotVectorProfiles(Object.fromEntries(Object.entries(search.vectors).filter(([, profile]) => profile.source.every((id) => visiblePropertyIds.has(id)))));
|
|
562
|
-
const projected = {
|
|
563
|
-
...vectors === undefined || Object.keys(vectors).length === 0 ? {} : { vectors },
|
|
564
|
-
...title === undefined ? {} : { title },
|
|
565
|
-
...defaultText === undefined ? {} : { defaultText },
|
|
566
|
-
...exact === undefined ? {} : { exact }
|
|
567
|
-
};
|
|
568
|
-
return Object.keys(projected).length > 0 || options.preserveEmpty ? projected : undefined;
|
|
569
|
-
}
|
|
570
|
-
function snapshotAllValueTypes(registered) {
|
|
571
|
-
return new Map([...registered.values()].map((valueType) => {
|
|
572
|
-
const snapshot = snapshotValueType(valueType);
|
|
573
|
-
return [snapshot.id, snapshot];
|
|
574
|
-
}));
|
|
575
|
-
}
|
|
576
|
-
function collectVisibleValueTypes(registered, objectTypes) {
|
|
577
|
-
const referencedIds = new Set;
|
|
578
|
-
const pendingSchemas = [];
|
|
579
|
-
const visitedSchemas = new Set;
|
|
580
|
-
for (const objectType of objectTypes) {
|
|
581
|
-
for (const property of objectType.properties)
|
|
582
|
-
pendingSchemas.push(property.schema);
|
|
583
|
-
for (const link of objectType.links) {
|
|
584
|
-
for (const property of link.properties ?? [])
|
|
585
|
-
pendingSchemas.push(property.schema);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
while (pendingSchemas.length > 0) {
|
|
589
|
-
const schema = pendingSchemas.pop();
|
|
590
|
-
if (typeof schema === "string" || visitedSchemas.has(schema))
|
|
591
|
-
continue;
|
|
592
|
-
visitedSchemas.add(schema);
|
|
593
|
-
if (schema.type === "valueTypeRef") {
|
|
594
|
-
if (!referencedIds.has(schema.valueTypeId)) {
|
|
595
|
-
referencedIds.add(schema.valueTypeId);
|
|
596
|
-
const valueType = registered.get(schema.valueTypeId);
|
|
597
|
-
if (valueType)
|
|
598
|
-
pendingSchemas.push(valueType.schema);
|
|
599
|
-
}
|
|
600
|
-
if (schema._resolved)
|
|
601
|
-
pendingSchemas.push(schema._resolved);
|
|
602
|
-
} else if (schema.type === "object") {
|
|
603
|
-
for (const field of Object.values(schema.properties))
|
|
604
|
-
pendingSchemas.push(field.schema);
|
|
605
|
-
} else if (schema.type === "array") {
|
|
606
|
-
pendingSchemas.push(schema.items);
|
|
607
|
-
} else if (schema.type === "map") {
|
|
608
|
-
pendingSchemas.push(schema.valueSchema);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
return new Map([...referencedIds].map((valueTypeId) => registered.get(valueTypeId)).filter((valueType) => valueType !== undefined).map((valueType) => {
|
|
612
|
-
const snapshot = snapshotValueType(valueType);
|
|
613
|
-
return [snapshot.id, snapshot];
|
|
614
|
-
}));
|
|
615
|
-
}
|
|
616
|
-
function snapshotValueType(valueType) {
|
|
617
|
-
return deepFreeze({
|
|
618
|
-
id: valueType.id,
|
|
619
|
-
name: valueType.name,
|
|
620
|
-
description: valueType.description,
|
|
621
|
-
schema: snapshotSchema(valueType.schema),
|
|
622
|
-
semanticType: valueType.semanticType
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
function snapshotSchema(schema) {
|
|
626
|
-
return deepFreeze(structuredClone(schema));
|
|
627
|
-
}
|
|
628
|
-
function deepFreeze(value, seen = new Set) {
|
|
629
|
-
if (typeof value !== "object" || value === null || seen.has(value))
|
|
630
|
-
return value;
|
|
631
|
-
seen.add(value);
|
|
632
|
-
for (const key of Reflect.ownKeys(value)) {
|
|
633
|
-
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
634
|
-
if (descriptor && "value" in descriptor)
|
|
635
|
-
deepFreeze(descriptor.value, seen);
|
|
636
|
-
}
|
|
637
|
-
return Object.freeze(value);
|
|
638
|
-
}
|
|
639
|
-
function unknownObjectType(objectTypeId) {
|
|
640
|
-
throw new OntologyNotFoundError2(formatUnknownObjectTypeMessage(objectTypeId));
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
// src/objects/query/selected-read-admission.ts
|
|
644
|
-
var selectedStateBrand = Symbol("sixb.selected-object-query-admission-state");
|
|
645
|
-
function createSelectedObjectQueryAdmission(scope) {
|
|
646
|
-
const selectionByKey = new Map;
|
|
647
|
-
const selectionsByType = new Map;
|
|
648
|
-
const propertiesBySelection = new Map;
|
|
649
|
-
for (const selection of scope.objects) {
|
|
650
|
-
const key = selectionKey(selection.nodeId, selection.objectTypeId);
|
|
651
|
-
selectionByKey.set(key, selection);
|
|
652
|
-
propertiesBySelection.set(key, new Set(selection.propertyIds));
|
|
653
|
-
const byType = selectionsByType.get(selection.objectTypeId) ?? [];
|
|
654
|
-
byType.push(selection);
|
|
655
|
-
selectionsByType.set(selection.objectTypeId, byType);
|
|
656
|
-
}
|
|
657
|
-
const outgoing = indexSteps(scope.steps, "outgoing", selectionByKey);
|
|
658
|
-
const incoming = indexSteps(scope.steps, "incoming", selectionByKey);
|
|
659
|
-
const emptyState = selectedState([]);
|
|
660
|
-
const admission = {
|
|
661
|
-
empty: () => emptyState,
|
|
662
|
-
source: (input) => {
|
|
663
|
-
const selections = input.result.objectTypeIds.flatMap((objectTypeId) => selectionsByType.get(objectTypeId) ?? []);
|
|
664
|
-
const state = selectedState(selections);
|
|
665
|
-
if (input.kind === "refs") {
|
|
666
|
-
const missingType = [...new Set(input.refs?.map((ref) => ref.objectTypeId) ?? [])].sort().find((objectTypeId) => !selectionsByType.has(objectTypeId));
|
|
667
|
-
if (missingType) {
|
|
668
|
-
return denied(state, new AuthorizationError2(`view:object:${missingType}`, `[Sixb] Delegated query cannot reference object type '${missingType}' at '${input.path}': the selected object scope does not contain that type.`));
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
if (state.selections.length > 0)
|
|
672
|
-
return { state };
|
|
673
|
-
const objectTypeId = input.objectTypeId ?? input.result.objectTypeIds[0] ?? "unknown";
|
|
674
|
-
return denied(state, new AuthorizationError2(`view:object:${objectTypeId}`, `[Sixb] Delegated query cannot start from object type '${objectTypeId}' at '${input.path}': the selected object scope does not contain that type.`));
|
|
675
|
-
},
|
|
676
|
-
property: (input) => propertyDenial(asSelectedState(input.state), input.propertyId, input.objectTypeId, input.use, input.path, propertiesBySelection),
|
|
677
|
-
edge: (input) => {
|
|
678
|
-
const state = asSelectedState(input.state);
|
|
679
|
-
const next = followEdge(state, input.linkId, input.direction, input.sourceObjectTypeId, outgoing, incoming, input.result.objectTypeIds);
|
|
680
|
-
if (next.selections.length > 0 || state.selections.length === 0)
|
|
681
|
-
return { state: next };
|
|
682
|
-
return denied(next, edgeDenial(state, input.linkId, input.direction, input.sourceObjectTypeId, input.use, input.path));
|
|
683
|
-
},
|
|
684
|
-
set: ({ op, states }) => {
|
|
685
|
-
if (op === "subtract")
|
|
686
|
-
return asSelectedState(states[0] ?? emptyState);
|
|
687
|
-
return selectedState(states.flatMap((state) => asSelectedState(state).selections));
|
|
688
|
-
},
|
|
689
|
-
assertPropertySelected: (input) => {
|
|
690
|
-
const denial = propertyDenial(asSelectedState(input.state), input.propertyId, input.objectTypeId, input.use, input.path, propertiesBySelection);
|
|
691
|
-
if (denial)
|
|
692
|
-
throw denial;
|
|
693
|
-
},
|
|
694
|
-
assertIncidentEdgeSelected: (input) => {
|
|
695
|
-
if (input.linkId === undefined)
|
|
696
|
-
return;
|
|
697
|
-
const state = asSelectedState(input.state);
|
|
698
|
-
const directions = input.direction === "both" ? ["outgoing", "incoming"] : [input.direction];
|
|
699
|
-
const next = selectedState(directions.flatMap((direction) => followEdge(state, input.linkId, direction, undefined, outgoing, incoming).selections));
|
|
700
|
-
if (next.selections.length > 0 || state.selections.length === 0)
|
|
701
|
-
return;
|
|
702
|
-
throw edgeDenial(state, input.linkId, input.direction, undefined, "queryLinks", input.path);
|
|
703
|
-
}
|
|
704
|
-
};
|
|
705
|
-
return Object.freeze(admission);
|
|
706
|
-
}
|
|
707
|
-
function indexSteps(steps, direction, selectionByKey) {
|
|
708
|
-
const index = new Map;
|
|
709
|
-
for (const step of steps) {
|
|
710
|
-
const fromKey = direction === "outgoing" ? selectionKey(step.parentNodeId, step.sourceObjectTypeId) : selectionKey(step.nodeId, step.targetObjectTypeId);
|
|
711
|
-
const toKey = direction === "outgoing" ? selectionKey(step.nodeId, step.targetObjectTypeId) : selectionKey(step.parentNodeId, step.sourceObjectTypeId);
|
|
712
|
-
const target = selectionByKey.get(toKey);
|
|
713
|
-
if (!selectionByKey.has(fromKey) || !target) {
|
|
714
|
-
throw new Error("[Sixb] Compiled selected object scope contains an invalid query path step.");
|
|
715
|
-
}
|
|
716
|
-
const key = edgeKey(direction === "outgoing" ? step.parentNodeId : step.nodeId, direction === "outgoing" ? step.sourceObjectTypeId : step.targetObjectTypeId, step.linkId);
|
|
717
|
-
const targets = index.get(key) ?? [];
|
|
718
|
-
targets.push(target);
|
|
719
|
-
index.set(key, targets);
|
|
720
|
-
}
|
|
721
|
-
return index;
|
|
722
|
-
}
|
|
723
|
-
function followEdge(state, linkId, direction, sourceObjectTypeId, outgoing, incoming, resultObjectTypeIds) {
|
|
724
|
-
const index = direction === "outgoing" ? outgoing : incoming;
|
|
725
|
-
const resultTypes = resultObjectTypeIds ? new Set(resultObjectTypeIds) : undefined;
|
|
726
|
-
const selections = state.selections.flatMap((selection) => {
|
|
727
|
-
const candidates = index.get(edgeKey(selection.nodeId, selection.objectTypeId, linkId)) ?? [];
|
|
728
|
-
return candidates.filter((candidate) => (resultTypes === undefined || resultTypes.has(candidate.objectTypeId)) && (direction === "outgoing" || sourceObjectTypeId === undefined || candidate.objectTypeId === sourceObjectTypeId));
|
|
729
|
-
});
|
|
730
|
-
return selectedState(selections);
|
|
731
|
-
}
|
|
732
|
-
function propertyDenial(state, propertyId, objectTypeId, use, path, propertiesBySelection) {
|
|
733
|
-
const candidates = objectTypeId ? state.selections.filter((selection) => selection.objectTypeId === objectTypeId) : state.selections;
|
|
734
|
-
if (candidates.length === 0)
|
|
735
|
-
return;
|
|
736
|
-
const missing = candidates.find((selection) => !propertiesBySelection.get(selectionKey(selection.nodeId, selection.objectTypeId))?.has(propertyId));
|
|
737
|
-
if (!missing)
|
|
738
|
-
return;
|
|
739
|
-
const objectTypeIds = [...new Set(candidates.map((selection) => selection.objectTypeId))].sort();
|
|
740
|
-
return new AuthorizationError2(`view:object:${objectTypeIds.join(",")}:property:${propertyId}`, `[Sixb] Delegated query cannot use property '${propertyId}' for ${use} at '${path}': it is not selected on every matching read-scope path (missing on ${formatSelection(missing)}).`);
|
|
741
|
-
}
|
|
742
|
-
function edgeDenial(state, linkId, direction, sourceObjectTypeId, use, path) {
|
|
743
|
-
const source = sourceObjectTypeId ? `:${sourceObjectTypeId}` : "";
|
|
744
|
-
return new AuthorizationError2(`view:link:${direction}${source}:${linkId}`, `[Sixb] Delegated query cannot use ${direction} link '${linkId}' for ${use} from ${formatState(state)} at '${path}': that exact read-scope path is not selected.`);
|
|
745
|
-
}
|
|
746
|
-
function formatState(state) {
|
|
747
|
-
if (state.selections.length === 0)
|
|
748
|
-
return "an empty read-scope provenance";
|
|
749
|
-
return `read-scope provenance ${state.selections.map(formatSelection).join(", ")}`;
|
|
750
|
-
}
|
|
751
|
-
function formatSelection(selection) {
|
|
752
|
-
return `'${selection.objectTypeId}'@node ${selection.nodeId}`;
|
|
753
|
-
}
|
|
754
|
-
function selectedState(selections) {
|
|
755
|
-
const unique = new Map;
|
|
756
|
-
for (const selection of selections) {
|
|
757
|
-
unique.set(selectionKey(selection.nodeId, selection.objectTypeId), selection);
|
|
758
|
-
}
|
|
759
|
-
return Object.freeze({
|
|
760
|
-
[selectedStateBrand]: true,
|
|
761
|
-
selections: Object.freeze([...unique.values()].sort((left, right) => left.nodeId - right.nodeId || left.objectTypeId.localeCompare(right.objectTypeId)))
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
function asSelectedState(state) {
|
|
765
|
-
if (state[selectedStateBrand] !== true) {
|
|
766
|
-
throw new Error("[Sixb] Object query admission state belongs to another semantic admission.");
|
|
767
|
-
}
|
|
768
|
-
return state;
|
|
769
|
-
}
|
|
770
|
-
function denied(state, denial) {
|
|
771
|
-
return { state, denial };
|
|
772
|
-
}
|
|
773
|
-
function selectionKey(nodeId, objectTypeId) {
|
|
774
|
-
return JSON.stringify([nodeId, objectTypeId]);
|
|
775
|
-
}
|
|
776
|
-
function edgeKey(nodeId, objectTypeId, linkId) {
|
|
777
|
-
return JSON.stringify([nodeId, objectTypeId, linkId]);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
// src/objects/telemetry/workload.ts
|
|
781
|
-
var MAX_DELEGATED_TELEMETRY_HISTORY_SERIES = 100;
|
|
782
|
-
var MAX_DELEGATED_TELEMETRY_HISTORY_POINTS = 1e4;
|
|
783
|
-
var DEFAULT_DELEGATED_TELEMETRY_HISTORY_LIMIT_PER_SERIES = 100;
|
|
784
|
-
|
|
785
|
-
class TelemetryHistoryWorkloadExceededError extends Error {
|
|
786
|
-
metric;
|
|
787
|
-
limit;
|
|
788
|
-
name = "TelemetryHistoryWorkloadExceededError";
|
|
789
|
-
code = "telemetry_history_workload_exceeded";
|
|
790
|
-
constructor(metric, limit) {
|
|
791
|
-
super(`[Sixb] Delegated telemetry history exceeded its ${metric} limit (${limit}).`);
|
|
792
|
-
this.metric = metric;
|
|
793
|
-
this.limit = limit;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
function admitTelemetryHistoryReadWorkload(input, delegated) {
|
|
797
|
-
const seriesCount = input.seriesCount;
|
|
798
|
-
const limitPerSeries = input.limitPerSeries;
|
|
799
|
-
if (!Number.isSafeInteger(seriesCount) || seriesCount < 0) {
|
|
800
|
-
throw new Error("[Sixb] Telemetry history series must have a non-negative safe integer length.");
|
|
801
|
-
}
|
|
802
|
-
if (limitPerSeries !== undefined && (!Number.isSafeInteger(limitPerSeries) || limitPerSeries < 0)) {
|
|
803
|
-
throw new Error("[Sixb] Telemetry history limit must be a non-negative safe integer.");
|
|
804
|
-
}
|
|
805
|
-
if (!delegated) {
|
|
806
|
-
const admission = limitPerSeries === undefined ? {} : { limitPerSeries };
|
|
807
|
-
return Object.freeze(admission);
|
|
808
|
-
}
|
|
809
|
-
if (seriesCount > MAX_DELEGATED_TELEMETRY_HISTORY_SERIES) {
|
|
810
|
-
throw new TelemetryHistoryWorkloadExceededError("series", MAX_DELEGATED_TELEMETRY_HISTORY_SERIES);
|
|
811
|
-
}
|
|
812
|
-
if (seriesCount === 0) {
|
|
813
|
-
return Object.freeze({
|
|
814
|
-
...limitPerSeries === undefined ? {} : { limitPerSeries },
|
|
815
|
-
maxPointOccurrences: MAX_DELEGATED_TELEMETRY_HISTORY_POINTS
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
|
-
const maxLimitPerSeries = Math.floor(MAX_DELEGATED_TELEMETRY_HISTORY_POINTS / seriesCount);
|
|
819
|
-
const effectiveLimitPerSeries = limitPerSeries ?? Math.min(DEFAULT_DELEGATED_TELEMETRY_HISTORY_LIMIT_PER_SERIES, maxLimitPerSeries);
|
|
820
|
-
if (effectiveLimitPerSeries > maxLimitPerSeries) {
|
|
821
|
-
throw new TelemetryHistoryWorkloadExceededError("points", MAX_DELEGATED_TELEMETRY_HISTORY_POINTS);
|
|
822
|
-
}
|
|
823
|
-
return Object.freeze({
|
|
824
|
-
limitPerSeries: effectiveLimitPerSeries,
|
|
825
|
-
maxPointOccurrences: MAX_DELEGATED_TELEMETRY_HISTORY_POINTS
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
// src/execution/authorized-object-reader.ts
|
|
830
|
-
var readerConstructionKey = Object.freeze({});
|
|
831
|
-
|
|
832
|
-
class AuthorizedObjectReaderImpl {
|
|
833
|
-
#authorization;
|
|
834
|
-
#authority;
|
|
835
|
-
#runtime;
|
|
836
|
-
#ontology;
|
|
837
|
-
#embeddingModels;
|
|
838
|
-
#rerankingModels;
|
|
839
|
-
#ontologyView;
|
|
840
|
-
#storage;
|
|
841
|
-
#delegatedObjectTypeIds;
|
|
842
|
-
#delegatedLinkDefinitions;
|
|
843
|
-
#delegatedQueryAdmission;
|
|
844
|
-
#clearance;
|
|
845
|
-
constructor(key, input) {
|
|
846
|
-
if (key !== readerConstructionKey) {
|
|
847
|
-
throw new Error("[Sixb] AuthorizedObjectReader can only be created by Core.");
|
|
848
|
-
}
|
|
849
|
-
this.#authorization = input.scope.authorization;
|
|
850
|
-
this.#authority = input.authority;
|
|
851
|
-
this.#ontology = input.ontology;
|
|
852
|
-
this.#embeddingModels = input.embeddingModels;
|
|
853
|
-
this.#rerankingModels = input.rerankingModels;
|
|
854
|
-
this.#storage = input.storage;
|
|
855
|
-
this.#delegatedObjectTypeIds = input.authority.type === "delegated" ? new Set(input.authority.objectRead.scope.objects.map((object) => object.objectTypeId)) : undefined;
|
|
856
|
-
this.#delegatedLinkDefinitions = input.authority.type === "delegated" ? new Set(input.authority.objectRead.scope.steps.map(delegatedLinkDefinitionKey)) : undefined;
|
|
857
|
-
this.#delegatedQueryAdmission = input.authority.type === "delegated" ? createSelectedObjectQueryAdmission(input.authority.objectRead.scope) : undefined;
|
|
858
|
-
this.#clearance = clearanceForAuthority(input.authority, input.ontology);
|
|
859
|
-
this.#runtime = Object.freeze({
|
|
860
|
-
projectId: input.scope.execution.projectId,
|
|
861
|
-
runtimeAuthorization: input.scope.authorization,
|
|
862
|
-
...input.authority.type === "principal" ? { authorization: input.authority.context } : {}
|
|
863
|
-
});
|
|
864
|
-
}
|
|
865
|
-
static assertBound(reader, scope) {
|
|
866
|
-
const capturedScope = captureExecutionScope(scope);
|
|
867
|
-
resolveExecutionScopeAuthorization(reader.#runtime.projectId, capturedScope);
|
|
868
|
-
if (capturedScope.authorization !== reader.#authorization) {
|
|
869
|
-
throw new Error("[Sixb] AuthorizedObjectReader is not bound to this exact execution authority.");
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
static ontologyView(reader) {
|
|
873
|
-
const authority = reader.#authority;
|
|
874
|
-
reader.#ontologyView ??= createAuthorizedOntologyView({
|
|
875
|
-
ontology: reader.#ontology,
|
|
876
|
-
selection: ontologySelectionForAuthority(authority, reader.#ontology),
|
|
877
|
-
...authority.type === "delegated" ? {
|
|
878
|
-
assertOutputWithinLimit: (value) => assertObjectReadOutputWithinLimit2(value, authority.objectRead.limits)
|
|
879
|
-
} : {}
|
|
880
|
-
});
|
|
881
|
-
return reader.#ontologyView;
|
|
882
|
-
}
|
|
883
|
-
get projectId() {
|
|
884
|
-
return this.#runtime.projectId;
|
|
885
|
-
}
|
|
886
|
-
async getByPrimaryId(input) {
|
|
887
|
-
const request = snapshotReadValue({
|
|
888
|
-
objectTypeId: input.objectTypeId,
|
|
889
|
-
primaryId: input.primaryId
|
|
890
|
-
});
|
|
891
|
-
this.#assertObjectTypesViewable([request.objectTypeId]);
|
|
892
|
-
const row = await this.#storage.getByPrimaryId({
|
|
893
|
-
...request,
|
|
894
|
-
projectId: this.#runtime.projectId
|
|
895
|
-
});
|
|
896
|
-
return detachReadResult(row && this.#redact(row));
|
|
897
|
-
}
|
|
898
|
-
async getByPrimaryIdBatch(input) {
|
|
899
|
-
const request = snapshotReadValue({
|
|
900
|
-
items: input.items.map((item) => ({
|
|
901
|
-
objectTypeId: item.objectTypeId,
|
|
902
|
-
primaryId: item.primaryId
|
|
903
|
-
}))
|
|
904
|
-
});
|
|
905
|
-
this.#assertObjectTypesViewable(request.items.map((item) => item.objectTypeId));
|
|
906
|
-
const rows = await this.#storage.getByPrimaryIdBatch({
|
|
907
|
-
...request,
|
|
908
|
-
projectId: this.#runtime.projectId
|
|
909
|
-
});
|
|
910
|
-
return detachReadResult(new Map([...rows].map(([key, row]) => [key, this.#redact(row)])));
|
|
911
|
-
}
|
|
912
|
-
async canReadObjectProperty(input) {
|
|
913
|
-
const request = snapshotReadValue({
|
|
914
|
-
objectTypeId: input.objectTypeId,
|
|
915
|
-
primaryId: input.primaryId,
|
|
916
|
-
propertyId: input.propertyId
|
|
917
|
-
});
|
|
918
|
-
this.#assertObjectTypesViewable([request.objectTypeId]);
|
|
919
|
-
if (this.#hidesProperty(request))
|
|
920
|
-
return false;
|
|
921
|
-
if (this.#authority.type !== "delegated")
|
|
922
|
-
return true;
|
|
923
|
-
const [readable] = await this.#storage.selectsObjectProperties({
|
|
924
|
-
projectId: this.#runtime.projectId,
|
|
925
|
-
items: [request]
|
|
926
|
-
});
|
|
927
|
-
return readable ?? false;
|
|
928
|
-
}
|
|
929
|
-
async canReadObjectPropertiesBatch(input) {
|
|
930
|
-
const request = snapshotReadValue({
|
|
931
|
-
items: input.items.map((item) => ({
|
|
932
|
-
objectTypeId: item.objectTypeId,
|
|
933
|
-
primaryId: item.primaryId,
|
|
934
|
-
propertyId: item.propertyId
|
|
935
|
-
}))
|
|
936
|
-
});
|
|
937
|
-
this.#assertObjectTypesViewable(request.items.map((item) => item.objectTypeId));
|
|
938
|
-
const selected = this.#authority.type === "delegated" ? await this.#storage.selectsObjectProperties({
|
|
939
|
-
...request,
|
|
940
|
-
projectId: this.#runtime.projectId
|
|
941
|
-
}) : request.items.map(() => true);
|
|
942
|
-
return request.items.map((item, index) => !this.#hidesProperty(item) && selected[index] === true);
|
|
943
|
-
}
|
|
944
|
-
async list(input) {
|
|
945
|
-
const request = snapshotReadValue({
|
|
946
|
-
objectTypeId: typeof input.objectTypeId === "string" ? input.objectTypeId : input.objectTypeId === undefined ? undefined : [...input.objectTypeId],
|
|
947
|
-
primaryIdPrefix: input.primaryIdPrefix,
|
|
948
|
-
primaryIdSuffix: input.primaryIdSuffix,
|
|
949
|
-
updatedAfter: input.updatedAfter,
|
|
950
|
-
updatedBefore: input.updatedBefore,
|
|
951
|
-
createdAfter: input.createdAfter,
|
|
952
|
-
createdBefore: input.createdBefore,
|
|
953
|
-
limit: input.limit,
|
|
954
|
-
offset: input.offset,
|
|
955
|
-
orderBy: input.orderBy,
|
|
956
|
-
order: input.order
|
|
957
|
-
});
|
|
958
|
-
const objectTypeId = this.#resolveListObjectTypes(request.objectTypeId);
|
|
959
|
-
if (Array.isArray(objectTypeId) && objectTypeId.length === 0) {
|
|
960
|
-
return { objects: [], hasMore: false, total: 0 };
|
|
961
|
-
}
|
|
962
|
-
const page = await this.#storage.list({
|
|
963
|
-
...request,
|
|
964
|
-
...objectTypeId === undefined ? {} : { objectTypeId },
|
|
965
|
-
projectId: this.#runtime.projectId
|
|
966
|
-
});
|
|
967
|
-
return detachReadResult({ ...page, objects: page.objects.map((row) => this.#redact(row)) });
|
|
968
|
-
}
|
|
969
|
-
async listLinks(input) {
|
|
970
|
-
const request = snapshotReadValue({
|
|
971
|
-
objectTypeId: input.objectTypeId,
|
|
972
|
-
objectId: input.objectId,
|
|
973
|
-
linkId: input.linkId,
|
|
974
|
-
direction: input.direction
|
|
975
|
-
});
|
|
976
|
-
this.#assertObjectTypesViewable([request.objectTypeId]);
|
|
977
|
-
const links = detachReadResult(await this.#storage.listLinks({
|
|
978
|
-
...request,
|
|
979
|
-
projectId: this.#runtime.projectId
|
|
980
|
-
}));
|
|
981
|
-
return links.filter((link) => this.#isLinkViewable(link));
|
|
982
|
-
}
|
|
983
|
-
async listLinksBatch(input) {
|
|
984
|
-
const request = snapshotReadValue({
|
|
985
|
-
direction: input.direction,
|
|
986
|
-
items: input.items.map((item) => ({
|
|
987
|
-
objectTypeId: item.objectTypeId,
|
|
988
|
-
objectId: item.objectId,
|
|
989
|
-
linkId: item.linkId
|
|
990
|
-
}))
|
|
991
|
-
});
|
|
992
|
-
this.#assertObjectTypesViewable(request.items.map((item) => item.objectTypeId));
|
|
993
|
-
const pages = detachReadResult(await this.#storage.listLinksBatch({
|
|
994
|
-
...request,
|
|
995
|
-
projectId: this.#runtime.projectId
|
|
996
|
-
}));
|
|
997
|
-
const filtered = new Map;
|
|
998
|
-
for (const [key, links] of pages) {
|
|
999
|
-
filtered.set(key, links.filter((link) => this.#isLinkViewable(link)));
|
|
1000
|
-
}
|
|
1001
|
-
return filtered;
|
|
1002
|
-
}
|
|
1003
|
-
async executeQuery(input) {
|
|
1004
|
-
const query = snapshotAuthoredQuery(input.query);
|
|
1005
|
-
const includeTotal = snapshotReadValue(input.includeTotal);
|
|
1006
|
-
const executionQuery = this.#admitDelegatedQuery(query)?.query ?? query;
|
|
1007
|
-
const result = await executeObjectQuery2({
|
|
1008
|
-
query: executionQuery,
|
|
1009
|
-
...includeTotal === undefined ? {} : { includeTotal },
|
|
1010
|
-
projectId: this.#runtime.projectId,
|
|
1011
|
-
signal: input.signal
|
|
1012
|
-
}, this.#queryExecutorOptions());
|
|
1013
|
-
return detachReadResult({ ...result, objects: result.objects.map((row) => this.#redact(row)) });
|
|
1014
|
-
}
|
|
1015
|
-
async queryLinks(input) {
|
|
1016
|
-
const query = snapshotAuthoredQuery(input.query);
|
|
1017
|
-
const request = snapshotReadValue({
|
|
1018
|
-
direction: input.direction,
|
|
1019
|
-
linkId: input.linkId,
|
|
1020
|
-
includeObjects: input.includeObjects,
|
|
1021
|
-
pageSize: input.pageSize,
|
|
1022
|
-
pageToken: input.pageToken
|
|
1023
|
-
});
|
|
1024
|
-
let executionQuery = query;
|
|
1025
|
-
const admission = this.#delegatedQueryAdmission;
|
|
1026
|
-
if (admission) {
|
|
1027
|
-
const preflight = preflightObjectQueryLinks({ query, ...request, projectId: this.#runtime.projectId }, { ontology: this.#ontology });
|
|
1028
|
-
const admitted = validateObjectQueryWithAdmission(preflight.validated.query, { ontology: this.#ontology, normalize: false }, admission);
|
|
1029
|
-
admission.assertIncidentEdgeSelected({
|
|
1030
|
-
state: admitted.admissionState,
|
|
1031
|
-
...preflight.linkId === undefined ? {} : { linkId: preflight.linkId },
|
|
1032
|
-
direction: preflight.direction,
|
|
1033
|
-
path: "$.linkId"
|
|
1034
|
-
});
|
|
1035
|
-
executionQuery = admitted.query;
|
|
1036
|
-
}
|
|
1037
|
-
const result = detachReadResult(await executeObjectQueryLinks2({ query: executionQuery, ...request, projectId: this.#runtime.projectId }, this.#queryExecutorOptions()));
|
|
1038
|
-
if (result.objects.some((row) => !this.#isObjectTypeViewable(row.objectTypeId)) || result.links.some((link) => !this.#isLinkViewable(link))) {
|
|
1039
|
-
throw new Error("[Sixb] Object storage returned a link page outside its authorized scope.");
|
|
1040
|
-
}
|
|
1041
|
-
return { ...result, objects: result.objects.map((row) => this.#redact(row)) };
|
|
1042
|
-
}
|
|
1043
|
-
async count(input) {
|
|
1044
|
-
const query = snapshotAuthoredQuery(input.query);
|
|
1045
|
-
const executionQuery = this.#admitDelegatedQuery(query)?.query ?? query;
|
|
1046
|
-
return detachReadResult(await countObjects2({ query: executionQuery, projectId: this.#runtime.projectId }, this.#queryExecutorOptions()));
|
|
1047
|
-
}
|
|
1048
|
-
async exists(input) {
|
|
1049
|
-
const query = snapshotAuthoredQuery(input.query);
|
|
1050
|
-
const executionQuery = this.#admitDelegatedQuery(query)?.query ?? query;
|
|
1051
|
-
return detachReadResult(await existsObjects2({ query: executionQuery, projectId: this.#runtime.projectId }, this.#queryExecutorOptions()));
|
|
1052
|
-
}
|
|
1053
|
-
async facet(input) {
|
|
1054
|
-
const query = snapshotAuthoredQuery(input.query);
|
|
1055
|
-
const facets = snapshotFacetRequests(input.facets);
|
|
1056
|
-
let executionQuery = query;
|
|
1057
|
-
let executionFacets = facets;
|
|
1058
|
-
const admission = this.#delegatedQueryAdmission;
|
|
1059
|
-
if (admission) {
|
|
1060
|
-
const validated = validateObjectQuery2(query, { ontology: this.#ontology });
|
|
1061
|
-
const normalizedFacets = validateObjectFacetRequests(facets, validated.result.objectTypeIds, {
|
|
1062
|
-
ontology: this.#ontology
|
|
1063
|
-
});
|
|
1064
|
-
const admitted = validateObjectQueryWithAdmission(validated.query, { ontology: this.#ontology, normalize: false }, admission);
|
|
1065
|
-
normalizedFacets.forEach((facet, index) => {
|
|
1066
|
-
admission.assertPropertySelected({
|
|
1067
|
-
state: admitted.admissionState,
|
|
1068
|
-
propertyId: facet.propertyId,
|
|
1069
|
-
use: "facet",
|
|
1070
|
-
path: `$.facets[${index}].propertyId`
|
|
1071
|
-
});
|
|
1072
|
-
});
|
|
1073
|
-
executionQuery = admitted.query;
|
|
1074
|
-
executionFacets = normalizedFacets;
|
|
1075
|
-
}
|
|
1076
|
-
return detachReadResult(await facetObjects2({
|
|
1077
|
-
query: executionQuery,
|
|
1078
|
-
facets: executionFacets,
|
|
1079
|
-
projectId: this.#runtime.projectId
|
|
1080
|
-
}, this.#queryExecutorOptions()));
|
|
1081
|
-
}
|
|
1082
|
-
redactWrittenRow(row) {
|
|
1083
|
-
return this.#redact(row);
|
|
1084
|
-
}
|
|
1085
|
-
assertVisibleOutputWithinLimit(value) {
|
|
1086
|
-
if (this.#authority.type !== "delegated")
|
|
1087
|
-
return;
|
|
1088
|
-
assertObjectReadOutputWithinLimit2(value, this.#authority.objectRead.limits);
|
|
1089
|
-
}
|
|
1090
|
-
admitTelemetryHistoryRead(input) {
|
|
1091
|
-
return admitTelemetryHistoryReadWorkload(input, this.#authority.type === "delegated");
|
|
1092
|
-
}
|
|
1093
|
-
#queryExecutorOptions() {
|
|
1094
|
-
const admission = this.#executorAdmission();
|
|
1095
|
-
if (this.#authority.type === "delegated") {
|
|
1096
|
-
return {
|
|
1097
|
-
ontology: this.#ontology,
|
|
1098
|
-
storage: this.#storage,
|
|
1099
|
-
embeddingModels: this.#embeddingModels,
|
|
1100
|
-
rerankingModels: this.#rerankingModels,
|
|
1101
|
-
...admission === undefined ? {} : { admission }
|
|
1102
|
-
};
|
|
1103
|
-
}
|
|
1104
|
-
return {
|
|
1105
|
-
ontology: this.#ontology,
|
|
1106
|
-
embeddingModels: this.#embeddingModels,
|
|
1107
|
-
rerankingModels: this.#rerankingModels,
|
|
1108
|
-
storage: this.#storage,
|
|
1109
|
-
runtimeAuthorization: this.#runtime.runtimeAuthorization,
|
|
1110
|
-
...this.#runtime.authorization === undefined ? {} : { authorization: this.#runtime.authorization },
|
|
1111
|
-
...admission === undefined ? {} : { admission }
|
|
1112
|
-
};
|
|
1113
|
-
}
|
|
1114
|
-
#executorAdmission() {
|
|
1115
|
-
const clearance = this.#clearance && createClearanceQueryAdmission(this.#clearance);
|
|
1116
|
-
const selected = this.#delegatedQueryAdmission;
|
|
1117
|
-
if (selected && clearance)
|
|
1118
|
-
return composeObjectQueryAdmissions(selected, clearance);
|
|
1119
|
-
return selected ?? clearance;
|
|
1120
|
-
}
|
|
1121
|
-
#redact(row) {
|
|
1122
|
-
return this.#clearance ? redactObjectRow(row, this.#clearance) : row;
|
|
1123
|
-
}
|
|
1124
|
-
#hidesProperty(item) {
|
|
1125
|
-
return this.#clearance?.hiddenPropertyIds(item.objectTypeId).has(item.propertyId) ?? false;
|
|
1126
|
-
}
|
|
1127
|
-
#admitDelegatedQuery(query) {
|
|
1128
|
-
if (!this.#delegatedQueryAdmission)
|
|
1129
|
-
return;
|
|
1130
|
-
return validateObjectQueryWithAdmission(query, { ontology: this.#ontology }, this.#delegatedQueryAdmission);
|
|
1131
|
-
}
|
|
1132
|
-
#assertObjectTypesViewable(objectTypeIds) {
|
|
1133
|
-
if (this.#authority.type === "delegated") {
|
|
1134
|
-
for (const objectTypeId of new Set(objectTypeIds)) {
|
|
1135
|
-
if (this.#delegatedObjectTypeIds?.has(objectTypeId))
|
|
1136
|
-
continue;
|
|
1137
|
-
throw new AuthorizationError2(`delegated:object.view:${objectTypeId}`, `[Sixb] Delegated authorization does not select object type '${objectTypeId}'.`);
|
|
1138
|
-
}
|
|
1139
|
-
return;
|
|
1140
|
-
}
|
|
1141
|
-
for (const objectTypeId of new Set(objectTypeIds)) {
|
|
1142
|
-
assertAuthorized2(this.#runtime, { kind: "object.view", objectTypeId });
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
#resolveListObjectTypes(requested) {
|
|
1146
|
-
if (requested !== undefined) {
|
|
1147
|
-
const objectTypeIds = typeof requested === "string" ? [requested] : [...new Set(requested)];
|
|
1148
|
-
for (const objectTypeId of objectTypeIds) {
|
|
1149
|
-
this.#ontology.resolveObjectType(objectTypeId);
|
|
1150
|
-
}
|
|
1151
|
-
this.#assertObjectTypesViewable(objectTypeIds);
|
|
1152
|
-
return typeof requested === "string" ? requested : objectTypeIds;
|
|
1153
|
-
}
|
|
1154
|
-
if (this.#authority.type === "unrestricted")
|
|
1155
|
-
return;
|
|
1156
|
-
return this.#ontology.listObjectTypes().map((objectType) => objectType.id).filter((objectTypeId) => this.#isObjectTypeViewable(objectTypeId));
|
|
1157
|
-
}
|
|
1158
|
-
#isObjectTypeViewable(objectTypeId) {
|
|
1159
|
-
if (this.#authority.type === "delegated") {
|
|
1160
|
-
return this.#delegatedObjectTypeIds?.has(objectTypeId) ?? false;
|
|
1161
|
-
}
|
|
1162
|
-
return isAllowed2(this.#runtime.authorization, { kind: "object.view", objectTypeId });
|
|
1163
|
-
}
|
|
1164
|
-
#isLinkViewable(link) {
|
|
1165
|
-
if (!this.#isObjectTypeViewable(link.sourceTypeId) || !this.#isObjectTypeViewable(link.targetTypeId)) {
|
|
1166
|
-
return false;
|
|
1167
|
-
}
|
|
1168
|
-
return this.#delegatedLinkDefinitions?.has(delegatedLinkDefinitionKey(link)) ?? this.#authority.type !== "delegated";
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
Object.freeze(AuthorizedObjectReaderImpl.prototype);
|
|
1172
|
-
Object.freeze(AuthorizedObjectReaderImpl);
|
|
1173
|
-
function createAuthorizedObjectReader(input) {
|
|
1174
|
-
const scope = captureExecutionScope(input.scope);
|
|
1175
|
-
const projectId = scope.execution.projectId;
|
|
1176
|
-
const authority = resolveExecutionScopeAuthorization(projectId, scope);
|
|
1177
|
-
const storage = objectStorageForAuthority(authority, input.objectStorage);
|
|
1178
|
-
const reader = new AuthorizedObjectReaderImpl(readerConstructionKey, {
|
|
1179
|
-
scope,
|
|
1180
|
-
ontology: input.ontology,
|
|
1181
|
-
embeddingModels: input.embeddingModels,
|
|
1182
|
-
rerankingModels: input.rerankingModels,
|
|
1183
|
-
storage,
|
|
1184
|
-
authority
|
|
1185
|
-
});
|
|
1186
|
-
Object.freeze(reader);
|
|
1187
|
-
return reader;
|
|
1188
|
-
}
|
|
1189
|
-
function assertAuthorizedObjectReaderBinding(input) {
|
|
1190
|
-
AuthorizedObjectReaderImpl.assertBound(input.reader, input.scope);
|
|
1191
|
-
}
|
|
1192
|
-
function getAuthorizedOntologyView(reader) {
|
|
1193
|
-
return AuthorizedObjectReaderImpl.ontologyView(reader);
|
|
1194
|
-
}
|
|
1195
|
-
function clearanceForAuthority(authority, ontology) {
|
|
1196
|
-
switch (authority.type) {
|
|
1197
|
-
case "unrestricted":
|
|
1198
|
-
return;
|
|
1199
|
-
case "principal":
|
|
1200
|
-
return resolvePropertyClearance(ontology, authority.context.clearances ?? new Set);
|
|
1201
|
-
case "delegated":
|
|
1202
|
-
return resolvePropertyClearance(ontology, new Set);
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
function objectStorageForAuthority(authority, objectStorage) {
|
|
1206
|
-
switch (authority.type) {
|
|
1207
|
-
case "principal":
|
|
1208
|
-
case "unrestricted":
|
|
1209
|
-
return objectStorage;
|
|
1210
|
-
case "delegated":
|
|
1211
|
-
return objectStorage.createSelectedReadScope({
|
|
1212
|
-
projectId: authority.projectId,
|
|
1213
|
-
scope: authority.objectRead.scope,
|
|
1214
|
-
limits: authority.objectRead.limits
|
|
1215
|
-
});
|
|
1216
|
-
default:
|
|
1217
|
-
return assertNever(authority, `[Sixb] Unsupported object reader authority '${String(authority.type)}'.`);
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
function ontologySelectionForAuthority(authority, ontology) {
|
|
1221
|
-
switch (authority.type) {
|
|
1222
|
-
case "unrestricted":
|
|
1223
|
-
return { kind: "all" };
|
|
1224
|
-
case "principal":
|
|
1225
|
-
return {
|
|
1226
|
-
kind: "types",
|
|
1227
|
-
objectTypeIds: ontology.listObjectTypes().filter((objectType) => isAllowed2(authority.context, {
|
|
1228
|
-
kind: "object.view",
|
|
1229
|
-
objectTypeId: objectType.id
|
|
1230
|
-
})).map((objectType) => objectType.id)
|
|
1231
|
-
};
|
|
1232
|
-
case "delegated":
|
|
1233
|
-
return { kind: "selected", scope: authority.objectRead.scope };
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
function delegatedLinkDefinitionKey(input) {
|
|
1237
|
-
return "sourceObjectTypeId" in input ? JSON.stringify([input.sourceObjectTypeId, input.linkId, input.targetObjectTypeId]) : JSON.stringify([input.sourceTypeId, input.linkId, input.targetTypeId]);
|
|
1238
|
-
}
|
|
1239
|
-
function detachReadResult(value) {
|
|
1240
|
-
return structuredClone(value);
|
|
1241
|
-
}
|
|
1242
|
-
function snapshotReadValue(value) {
|
|
1243
|
-
return structuredClone(value);
|
|
1244
|
-
}
|
|
1245
|
-
function snapshotFacetRequests(facets) {
|
|
1246
|
-
if (!Array.isArray(facets)) {
|
|
1247
|
-
throw new ObjectQueryValidationError2([
|
|
1248
|
-
{
|
|
1249
|
-
path: "$.facets",
|
|
1250
|
-
code: "invalid_facets",
|
|
1251
|
-
message: "facets must be an array"
|
|
1252
|
-
}
|
|
1253
|
-
]);
|
|
1254
|
-
}
|
|
1255
|
-
const length = facets.length;
|
|
1256
|
-
if (!Number.isSafeInteger(length) || length > MAX_OBJECT_READ_FACETS2) {
|
|
1257
|
-
throw new ObjectQueryValidationError2([
|
|
1258
|
-
{
|
|
1259
|
-
path: "$.facets",
|
|
1260
|
-
code: "too_many_facets",
|
|
1261
|
-
message: `facets must include at most ${MAX_OBJECT_READ_FACETS2} facet requests`
|
|
1262
|
-
}
|
|
1263
|
-
]);
|
|
1264
|
-
}
|
|
1265
|
-
const snapshot = [];
|
|
1266
|
-
for (let index = 0;index < length; index += 1) {
|
|
1267
|
-
const facet = facets[index];
|
|
1268
|
-
snapshot.push({ propertyId: facet.propertyId, limit: facet.limit });
|
|
1269
|
-
}
|
|
1270
|
-
return snapshot;
|
|
1271
|
-
}
|
|
1272
|
-
function snapshotAuthoredQuery(query) {
|
|
1273
|
-
try {
|
|
1274
|
-
const snapshot = structuredClone(query);
|
|
1275
|
-
const pending = [snapshot];
|
|
1276
|
-
const seen = new Set;
|
|
1277
|
-
for (const node of pending) {
|
|
1278
|
-
if (seen.has(node))
|
|
1279
|
-
continue;
|
|
1280
|
-
seen.add(node);
|
|
1281
|
-
if (node.kind === "vector" && (typeof node.vector !== "string" || typeof node.profile !== "string" || ("propertyId" in node))) {
|
|
1282
|
-
throw new ObjectQueryValidationError2([
|
|
1283
|
-
{
|
|
1284
|
-
path: "$",
|
|
1285
|
-
code: "invalid_vector_search_input",
|
|
1286
|
-
message: "Vector search requires a named profile and search text"
|
|
1287
|
-
}
|
|
1288
|
-
]);
|
|
1289
|
-
}
|
|
1290
|
-
if ("input" in node)
|
|
1291
|
-
pending.push(node.input);
|
|
1292
|
-
if (node.kind === "set")
|
|
1293
|
-
pending.push(...node.inputs);
|
|
1294
|
-
}
|
|
1295
|
-
return snapshot;
|
|
1296
|
-
} catch (error) {
|
|
1297
|
-
if (error instanceof ObjectQueryValidationError2)
|
|
1298
|
-
throw error;
|
|
1299
|
-
throw new ObjectQueryValidationError2([
|
|
1300
|
-
{
|
|
1301
|
-
path: "$",
|
|
1302
|
-
code: "query_not_cloneable",
|
|
1303
|
-
message: "Object query must contain only structured-cloneable data"
|
|
1304
|
-
}
|
|
1305
|
-
]);
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
317
|
// src/actions/descriptor.ts
|
|
1310
318
|
function snapshotActionDescriptor(action) {
|
|
1311
319
|
const params = Object.fromEntries(Object.entries(action.params).map(([id, config]) => [id, structuredClone(config)]));
|
|
1312
|
-
return
|
|
320
|
+
return deepFreeze({
|
|
1313
321
|
id: action.id,
|
|
1314
322
|
...action.description === undefined ? {} : { description: action.description },
|
|
1315
323
|
binding: action.binding.kind === "global" ? { kind: "global" } : { kind: "object", objectTypeId: action.binding.objectType.id },
|
|
@@ -1322,14 +330,14 @@ function snapshotActionDescriptor(action) {
|
|
|
1322
330
|
}
|
|
1323
331
|
});
|
|
1324
332
|
}
|
|
1325
|
-
function
|
|
333
|
+
function deepFreeze(value, seen = new Set) {
|
|
1326
334
|
if (typeof value !== "object" || value === null || seen.has(value))
|
|
1327
335
|
return value;
|
|
1328
336
|
seen.add(value);
|
|
1329
337
|
for (const key of Reflect.ownKeys(value)) {
|
|
1330
338
|
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
1331
339
|
if (descriptor && "value" in descriptor)
|
|
1332
|
-
|
|
340
|
+
deepFreeze(descriptor.value, seen);
|
|
1333
341
|
}
|
|
1334
342
|
return Object.freeze(value);
|
|
1335
343
|
}
|
|
@@ -1362,7 +370,7 @@ async function assertParamUsersActive(input) {
|
|
|
1362
370
|
function assertDelegatedActionTarget(input) {
|
|
1363
371
|
const { actionId, authorization, subject } = input;
|
|
1364
372
|
if (subject.kind !== "object" || !authorization.actionApply.some((target) => target.actionId === actionId && target.subject.objectTypeId === subject.objectTypeId && target.subject.primaryId === subject.primaryId)) {
|
|
1365
|
-
throw
|
|
373
|
+
throw denied(actionId, subject);
|
|
1366
374
|
}
|
|
1367
375
|
return subject;
|
|
1368
376
|
}
|
|
@@ -1370,7 +378,7 @@ async function admitDelegatedObjectAction(input) {
|
|
|
1370
378
|
const { action, authorization, execution, objectReader, runtimeAuthorization, subject } = input;
|
|
1371
379
|
assertDelegatedActionTarget({ authorization, actionId: action.id, subject });
|
|
1372
380
|
if (action.binding.kind !== "object" || action.binding.objectType.id !== subject.objectTypeId) {
|
|
1373
|
-
throw
|
|
381
|
+
throw denied(action.id, subject);
|
|
1374
382
|
}
|
|
1375
383
|
assertAuthorizedObjectReaderBinding({
|
|
1376
384
|
reader: objectReader,
|
|
@@ -1382,14 +390,14 @@ async function admitDelegatedObjectAction(input) {
|
|
|
1382
390
|
primaryId: subject.primaryId
|
|
1383
391
|
});
|
|
1384
392
|
if (!visible)
|
|
1385
|
-
throw
|
|
393
|
+
throw denied(action.id, subject);
|
|
1386
394
|
} catch (error) {
|
|
1387
395
|
if (error instanceof AuthorizationError2)
|
|
1388
|
-
throw
|
|
396
|
+
throw denied(action.id, subject);
|
|
1389
397
|
throw error;
|
|
1390
398
|
}
|
|
1391
399
|
}
|
|
1392
|
-
function
|
|
400
|
+
function denied(actionId, subject) {
|
|
1393
401
|
const target = subject.kind === "object" ? `${subject.objectTypeId}:${subject.primaryId}` : "global";
|
|
1394
402
|
return new AuthorizationError2(`apply:action:${actionId}:${target}`, `[Sixb] Delegated authority cannot apply Action '${actionId}' to '${target}'.`);
|
|
1395
403
|
}
|
|
@@ -2870,30 +1878,6 @@ async function settleWithin(promises, timeoutMs) {
|
|
|
2870
1878
|
}
|
|
2871
1879
|
}
|
|
2872
1880
|
|
|
2873
|
-
// src/actions/run-authorization.ts
|
|
2874
|
-
async function canDelegationAccessActionRun(input) {
|
|
2875
|
-
const subject = input.run.subject;
|
|
2876
|
-
if (!input.authority.delegation || subject.kind !== "object" || !input.authority.actionApply.some((target) => target.actionId === input.run.actionId && target.subject.objectTypeId === subject.objectTypeId && target.subject.primaryId === subject.primaryId)) {
|
|
2877
|
-
return false;
|
|
2878
|
-
}
|
|
2879
|
-
return actionRunBelongsToShareGrant({
|
|
2880
|
-
storage: input.storage,
|
|
2881
|
-
projectId: input.projectId,
|
|
2882
|
-
run: input.run,
|
|
2883
|
-
grantId: input.authority.delegation.grantId
|
|
2884
|
-
});
|
|
2885
|
-
}
|
|
2886
|
-
async function actionRunBelongsToShareGrant(input) {
|
|
2887
|
-
const parent = await findPrimitiveParentRequestExecution({
|
|
2888
|
-
executions: input.storage.executions,
|
|
2889
|
-
projectId: input.projectId,
|
|
2890
|
-
executionId: input.run.executionId,
|
|
2891
|
-
primitive: { kind: "action", id: input.run.actionId, runId: input.run.id }
|
|
2892
|
-
});
|
|
2893
|
-
const authorization = parent?.authorizationRef;
|
|
2894
|
-
return authorization?.type === "delegated" && authorization.delegation.kind === "share" && authorization.delegation.grantId === input.grantId;
|
|
2895
|
-
}
|
|
2896
|
-
|
|
2897
1881
|
// src/actions/request.ts
|
|
2898
1882
|
function getActionDefinition(runtime, actionId) {
|
|
2899
1883
|
const action = runtime.actionRegistry.getById(actionId);
|
|
@@ -2936,6 +1920,9 @@ async function requestAction3(runtime, execution, input) {
|
|
|
2936
1920
|
assertAuthorized2({ projectId, runtimeAuthorization }, { kind: "object.view", objectTypeId: action.binding.objectType.id });
|
|
2937
1921
|
}
|
|
2938
1922
|
validateActionSubject(action, subject);
|
|
1923
|
+
if (authorization.type !== "delegated" && subject.kind === "object") {
|
|
1924
|
+
await objectReader.assertReadable({ objectTypeIds: [subject.objectTypeId] });
|
|
1925
|
+
}
|
|
2939
1926
|
let pathPrefix = action.id;
|
|
2940
1927
|
let objectType = null;
|
|
2941
1928
|
if (isObjectActionDefinition2(action)) {
|
|
@@ -2951,7 +1938,13 @@ async function requestAction3(runtime, execution, input) {
|
|
|
2951
1938
|
const executor = getActionRunExecutor(runtime);
|
|
2952
1939
|
request.signal?.throwIfAborted();
|
|
2953
1940
|
const payload = { actionId, subject, params: actionParams };
|
|
2954
|
-
const assertCanReuse = (run) => assertCallerMayHaveRun({
|
|
1941
|
+
const assertCanReuse = (run) => assertCallerMayHaveRun({
|
|
1942
|
+
storage: runtime.storage,
|
|
1943
|
+
projectId,
|
|
1944
|
+
authorization,
|
|
1945
|
+
objectReader,
|
|
1946
|
+
run
|
|
1947
|
+
});
|
|
2955
1948
|
const persist = () => persistActionRun({
|
|
2956
1949
|
projectId,
|
|
2957
1950
|
storage: runtime.storage,
|
|
@@ -2996,7 +1989,7 @@ async function assertCallerMayHaveRun(input) {
|
|
|
2996
1989
|
projectId: input.projectId,
|
|
2997
1990
|
run,
|
|
2998
1991
|
grantId: authorization.delegation.grantId
|
|
2999
|
-
}) : authorization.type !== "principal" || canViewActionRun2(authorization.context, run);
|
|
1992
|
+
}) : authorization.type !== "principal" || canViewActionRun2(authorization.context, run) && await canReadActionRunSubject(input.objectReader, run);
|
|
3000
1993
|
if (!visible) {
|
|
3001
1994
|
throw new AuthorizationError2(`apply:action:${run.actionId}`, authorization.type === "delegated" ? "[Sixb] Delegated authority cannot reuse this Action run." : `[Sixb] Action run '${run.id}' is not visible to this principal.`);
|
|
3002
1995
|
}
|
|
@@ -3088,40 +2081,29 @@ function createActionsRuntime(runtime, execution) {
|
|
|
3088
2081
|
projectId,
|
|
3089
2082
|
authority: authorization,
|
|
3090
2083
|
run
|
|
3091
|
-
})) ? release(run) : null;
|
|
2084
|
+
})) && await canReadActionRunSubject(objectReader, run) ? release(run) : null;
|
|
3092
2085
|
},
|
|
3093
|
-
list: (input = {}) => {
|
|
2086
|
+
list: async (input = {}) => {
|
|
3094
2087
|
if (authorization.type === "denied" || authorization.type === "delegated") {
|
|
3095
|
-
return
|
|
2088
|
+
return { runs: [], hasMore: false, total: 0 };
|
|
3096
2089
|
}
|
|
3097
2090
|
const storage = runtime.storage.actionRuns;
|
|
3098
2091
|
if (!storage)
|
|
3099
|
-
return
|
|
2092
|
+
return { runs: [], hasMore: false, total: 0 };
|
|
2093
|
+
if (authorization.type === "unrestricted")
|
|
2094
|
+
return storage.list({ ...input, projectId });
|
|
2095
|
+
const unreadable = await unreadableActionRunTypes(objectReader);
|
|
3100
2096
|
return storage.list({
|
|
3101
2097
|
...input,
|
|
3102
2098
|
projectId,
|
|
3103
|
-
actionIds:
|
|
3104
|
-
objectTypeIds:
|
|
2099
|
+
actionIds: [...authorization.context.grants["apply:action"]],
|
|
2100
|
+
objectTypeIds: [...authorization.context.grants["view:object"]].filter((objectTypeId) => !unreadable.has(objectTypeId))
|
|
3105
2101
|
});
|
|
3106
2102
|
}
|
|
3107
2103
|
}
|
|
3108
2104
|
};
|
|
3109
2105
|
}
|
|
3110
2106
|
|
|
3111
|
-
// src/runtime/ai-cost.ts
|
|
3112
|
-
async function resolveExecutionCosts(input) {
|
|
3113
|
-
if (input.executionIds.length === 0)
|
|
3114
|
-
return [];
|
|
3115
|
-
if (!input.storage)
|
|
3116
|
-
return input.executionIds.map(() => {
|
|
3117
|
-
return;
|
|
3118
|
-
});
|
|
3119
|
-
return input.storage.summarizeExecutions({
|
|
3120
|
-
projectId: input.projectId,
|
|
3121
|
-
executionIds: input.executionIds
|
|
3122
|
-
});
|
|
3123
|
-
}
|
|
3124
|
-
|
|
3125
2107
|
// src/runtime/ai-usage.ts
|
|
3126
2108
|
async function resolveExecutionUsage(input) {
|
|
3127
2109
|
if (input.executionIds.length === 0)
|
|
@@ -3449,6 +2431,10 @@ async function retryAgentRun2(runtime, execution, models, failedRun) {
|
|
|
3449
2431
|
threadId: failedRun.threadId,
|
|
3450
2432
|
runId: failedRun.id
|
|
3451
2433
|
});
|
|
2434
|
+
await tx.artifacts?.deleteVersionsByOrigin({
|
|
2435
|
+
projectId: runtime.projectId,
|
|
2436
|
+
runId: failedRun.id
|
|
2437
|
+
});
|
|
3452
2438
|
await tx.executions.create(durableExecution);
|
|
3453
2439
|
return agents.runs.create({
|
|
3454
2440
|
id: runId,
|
|
@@ -3963,6 +2949,75 @@ function createAiUsageRuntime(runtime, security) {
|
|
|
3963
2949
|
}
|
|
3964
2950
|
};
|
|
3965
2951
|
}
|
|
2952
|
+
// src/artifacts/execution.ts
|
|
2953
|
+
function createArtifactsRuntime(runtime, blobStorage) {
|
|
2954
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
2955
|
+
const caller = authority.type === "principal" ? authority.context.principal : authority.type === "unrestricted" ? SYSTEM_PRINCIPAL2 : null;
|
|
2956
|
+
const ownerFilter = authority.type === "principal" ? caller : null;
|
|
2957
|
+
const requireStorage = () => {
|
|
2958
|
+
const storage = runtime.storage.artifacts;
|
|
2959
|
+
if (!storage) {
|
|
2960
|
+
throw new ArtifactRequestError2("storage_unavailable", "[Sixb] Artifacts need storage that supports them.");
|
|
2961
|
+
}
|
|
2962
|
+
return storage;
|
|
2963
|
+
};
|
|
2964
|
+
const requireCaller = () => {
|
|
2965
|
+
if (!caller) {
|
|
2966
|
+
throw new ArtifactRequestError2("not_allowed", "[Sixb] This caller cannot publish artifacts.");
|
|
2967
|
+
}
|
|
2968
|
+
return caller;
|
|
2969
|
+
};
|
|
2970
|
+
const visible = (artifact) => artifact && caller && (!ownerFilter || principalsEqual2(ownerFilter, artifact.owner)) ? artifact : null;
|
|
2971
|
+
const getVisible = async (artifactId) => caller ? visible(await requireStorage().get({ projectId: runtime.projectId, id: artifactId })) : null;
|
|
2972
|
+
return {
|
|
2973
|
+
async create(input) {
|
|
2974
|
+
return publishArtifact2({ projectId: runtime.projectId, storage: requireStorage(), blobStorage }, { ...input, author: requireCaller() });
|
|
2975
|
+
},
|
|
2976
|
+
async publish(artifactId, input) {
|
|
2977
|
+
const author = requireCaller();
|
|
2978
|
+
if (!await getVisible(artifactId))
|
|
2979
|
+
throw notFound(artifactId);
|
|
2980
|
+
return publishArtifact2({ projectId: runtime.projectId, storage: requireStorage(), blobStorage }, { ...input, artifactId, author });
|
|
2981
|
+
},
|
|
2982
|
+
get: getVisible,
|
|
2983
|
+
async list(input = {}) {
|
|
2984
|
+
if (!caller)
|
|
2985
|
+
return { artifacts: [], hasMore: false, total: 0 };
|
|
2986
|
+
return requireStorage().list({
|
|
2987
|
+
projectId: runtime.projectId,
|
|
2988
|
+
...ownerFilter ? { owner: ownerFilter } : {},
|
|
2989
|
+
...input.threadId === undefined ? {} : { originThreadId: input.threadId },
|
|
2990
|
+
...input.kind === undefined ? {} : { kind: input.kind },
|
|
2991
|
+
...input.limit === undefined ? {} : { limit: input.limit },
|
|
2992
|
+
...input.offset === undefined ? {} : { offset: input.offset }
|
|
2993
|
+
});
|
|
2994
|
+
},
|
|
2995
|
+
async getVersion(artifactId, version) {
|
|
2996
|
+
const artifact = await getVisible(artifactId);
|
|
2997
|
+
if (!artifact)
|
|
2998
|
+
return null;
|
|
2999
|
+
return requireStorage().getVersion({
|
|
3000
|
+
projectId: runtime.projectId,
|
|
3001
|
+
artifactId,
|
|
3002
|
+
version: version === "latest" ? artifact.latestVersion : version
|
|
3003
|
+
});
|
|
3004
|
+
},
|
|
3005
|
+
async listVersions(artifactId, input = {}) {
|
|
3006
|
+
if (!await getVisible(artifactId))
|
|
3007
|
+
return null;
|
|
3008
|
+
return requireStorage().listVersions({ projectId: runtime.projectId, artifactId, ...input });
|
|
3009
|
+
},
|
|
3010
|
+
async delete(artifactId) {
|
|
3011
|
+
if (!await getVisible(artifactId))
|
|
3012
|
+
return false;
|
|
3013
|
+
return requireStorage().delete({ projectId: runtime.projectId, id: artifactId });
|
|
3014
|
+
}
|
|
3015
|
+
};
|
|
3016
|
+
}
|
|
3017
|
+
function notFound(artifactId) {
|
|
3018
|
+
return new ArtifactRequestError2("artifact_not_found", `[Sixb] Artifact '${artifactId}' was not found.`);
|
|
3019
|
+
}
|
|
3020
|
+
|
|
3966
3021
|
// src/blob-storage/execution.ts
|
|
3967
3022
|
function createBlobsRuntime(runtime, execution, blobStorage, apiPublicOrigin) {
|
|
3968
3023
|
const assertAccess = () => assertProviderAccess2(runtime, execution, "blobs.access");
|
|
@@ -4071,7 +3126,7 @@ function commandContext(runtime, execution, connectorId) {
|
|
|
4071
3126
|
}
|
|
4072
3127
|
|
|
4073
3128
|
// src/datasets/execution.ts
|
|
4074
|
-
function createDatasetsRuntime(runtime, execution, source, lakeStorage, blobStorage) {
|
|
3129
|
+
function createDatasetsRuntime(runtime, execution, source, lakeStorage, blobStorage, versionMarkings) {
|
|
4075
3130
|
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
4076
3131
|
const allowed = (datasetId) => isRuntimeAllowed2(runtime, { kind: "dataset.view", datasetId });
|
|
4077
3132
|
return {
|
|
@@ -4090,7 +3145,7 @@ function createDatasetsRuntime(runtime, execution, source, lakeStorage, blobStor
|
|
|
4090
3145
|
const version = input.versionId === undefined ? await lakeStorage.getLatestVersion(registered.id) : await lakeStorage.getVersion(registered.id, input.versionId);
|
|
4091
3146
|
if (!version)
|
|
4092
3147
|
return null;
|
|
4093
|
-
const redacted = redactedColumns(
|
|
3148
|
+
const redacted = redactedColumns(version, versionMarkings, assertRuntimeAuthorizationBound2(runtime));
|
|
4094
3149
|
const selected = selectColumns(version, input.columns);
|
|
4095
3150
|
const columns = selected.filter((column) => !redacted.has(column));
|
|
4096
3151
|
const read = (readColumns) => lakeStorage.readRows({
|
|
@@ -4164,11 +3219,14 @@ function selectColumns(version, requested) {
|
|
|
4164
3219
|
}
|
|
4165
3220
|
return [...requested];
|
|
4166
3221
|
}
|
|
4167
|
-
function redactedColumns(
|
|
3222
|
+
function redactedColumns(version, versionMarkings, authority) {
|
|
4168
3223
|
if (authority.type === "unrestricted")
|
|
4169
3224
|
return new Set;
|
|
4170
3225
|
const clearances = authority.type === "principal" ? authority.context.clearances ?? new Set : new Set;
|
|
4171
|
-
|
|
3226
|
+
if ([...versionMarkings.everyMarking()].every((id) => clearances.has(id)))
|
|
3227
|
+
return new Set;
|
|
3228
|
+
const { columns } = versionMarkings.classify(version);
|
|
3229
|
+
return new Set([...columns].filter(([, columnMarkings]) => [...columnMarkings].some((id) => !clearances.has(id))).map(([column]) => column));
|
|
4172
3230
|
}
|
|
4173
3231
|
async function* emptyRows(rows) {
|
|
4174
3232
|
for await (const _row of rows)
|
|
@@ -4178,23 +3236,30 @@ async function* emptyRows(rows) {
|
|
|
4178
3236
|
// src/events/execution.ts
|
|
4179
3237
|
function createEventsRuntime(runtime) {
|
|
4180
3238
|
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
4181
|
-
const
|
|
4182
|
-
const readable = (event) => {
|
|
3239
|
+
const visible = async (events) => {
|
|
4183
3240
|
switch (authority.type) {
|
|
4184
3241
|
case "denied":
|
|
4185
3242
|
case "delegated":
|
|
4186
|
-
return;
|
|
4187
|
-
case "principal":
|
|
4188
|
-
if (!canViewEvent2(authority.context, event))
|
|
4189
|
-
return;
|
|
4190
|
-
return clearance ? redactDomainEvent(event, clearance) : event;
|
|
3243
|
+
return [];
|
|
4191
3244
|
case "unrestricted":
|
|
4192
|
-
return
|
|
3245
|
+
return events;
|
|
3246
|
+
case "principal": {
|
|
3247
|
+
const viewable = events.filter((event) => canViewEvent2(authority.context, event));
|
|
3248
|
+
if (viewable.length === 0)
|
|
3249
|
+
return viewable;
|
|
3250
|
+
const clearance = await readerClearance(runtime.objectReader);
|
|
3251
|
+
const clearanceFor = await eventClearances(runtime.objectReader, viewable, clearance);
|
|
3252
|
+
return viewable.flatMap((event) => {
|
|
3253
|
+
if (clearance && readsUnreadable(event, clearance))
|
|
3254
|
+
return [];
|
|
3255
|
+
const redacting = clearanceFor(event);
|
|
3256
|
+
return [redacting ? redactDomainEvent(event, redacting) : event];
|
|
3257
|
+
});
|
|
3258
|
+
}
|
|
4193
3259
|
}
|
|
4194
3260
|
};
|
|
4195
|
-
const visibleEvents = (events) => events.flatMap((event) => readable(event) ?? []);
|
|
4196
3261
|
return {
|
|
4197
|
-
|
|
3262
|
+
visible,
|
|
4198
3263
|
append: (input) => {
|
|
4199
3264
|
assertPrivileged2(runtime, "events.append");
|
|
4200
3265
|
return runtime.events.append(input);
|
|
@@ -4212,8 +3277,7 @@ function createEventsRuntime(runtime) {
|
|
|
4212
3277
|
case "unrestricted":
|
|
4213
3278
|
break;
|
|
4214
3279
|
}
|
|
4215
|
-
|
|
4216
|
-
return visibleEvents(events);
|
|
3280
|
+
return visible(await runtime.events.read(input));
|
|
4217
3281
|
},
|
|
4218
3282
|
latestCursor: () => {
|
|
4219
3283
|
switch (authority.type) {
|
|
@@ -4234,14 +3298,63 @@ function createEventsRuntime(runtime) {
|
|
|
4234
3298
|
case "unrestricted":
|
|
4235
3299
|
break;
|
|
4236
3300
|
}
|
|
4237
|
-
return runtime.events.subscribe(input, (events) => {
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
3301
|
+
return runtime.events.subscribe(input, async (events) => {
|
|
3302
|
+
let shown;
|
|
3303
|
+
try {
|
|
3304
|
+
shown = await visible(events);
|
|
3305
|
+
} catch (error) {
|
|
3306
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
3307
|
+
console.warn(`[Sixb] Dropped ${events.length} event(s) from cursor '${events[0]?.cursor}' of a subscription, whose markings could not be enforced: ${message}`);
|
|
3308
|
+
return;
|
|
3309
|
+
}
|
|
3310
|
+
if (shown.length > 0)
|
|
3311
|
+
return handler(shown);
|
|
4241
3312
|
});
|
|
4242
3313
|
}
|
|
4243
3314
|
};
|
|
4244
3315
|
}
|
|
3316
|
+
async function eventClearances(reader, events, clearance) {
|
|
3317
|
+
const kinds = new Map;
|
|
3318
|
+
for (const event of events) {
|
|
3319
|
+
const kind = eventSources(event);
|
|
3320
|
+
if (kind)
|
|
3321
|
+
kinds.set(kind.key, kind.sources);
|
|
3322
|
+
}
|
|
3323
|
+
const resolved = await Promise.all([...kinds].map(async ([key, sources]) => [key, await readerEventClearance(reader, sources)]));
|
|
3324
|
+
const byKind = new Map(resolved);
|
|
3325
|
+
return (event) => {
|
|
3326
|
+
const kind = eventSources(event);
|
|
3327
|
+
return kind ? byKind.get(kind.key) : clearance;
|
|
3328
|
+
};
|
|
3329
|
+
}
|
|
3330
|
+
function eventSources(event) {
|
|
3331
|
+
if (event.topic !== "objects")
|
|
3332
|
+
return;
|
|
3333
|
+
const objectTypeId = event.payload.objectTypeId;
|
|
3334
|
+
const earlier = event.type !== "object.created";
|
|
3335
|
+
if (event.origin?.kind !== "projection") {
|
|
3336
|
+
if (!earlier)
|
|
3337
|
+
return;
|
|
3338
|
+
return { key: JSON.stringify([objectTypeId]), sources: { objectTypeId, earlier } };
|
|
3339
|
+
}
|
|
3340
|
+
const { projectionId, datasetId, datasetVersionId } = event.origin;
|
|
3341
|
+
const origin = { projectionId, datasetId, datasetVersionId, objectTypeId };
|
|
3342
|
+
return {
|
|
3343
|
+
key: JSON.stringify([objectTypeId, projectionId, datasetId, datasetVersionId, earlier]),
|
|
3344
|
+
sources: { objectTypeId, origin, earlier }
|
|
3345
|
+
};
|
|
3346
|
+
}
|
|
3347
|
+
function readsUnreadable(event, clearance) {
|
|
3348
|
+
switch (event.topic) {
|
|
3349
|
+
case "objects":
|
|
3350
|
+
case "telemetry":
|
|
3351
|
+
return clearance.unreadableType(event.payload.objectTypeId) !== undefined;
|
|
3352
|
+
case "links":
|
|
3353
|
+
return clearance.unreadableType(event.payload.sourceTypeId) !== undefined || clearance.unreadableType(event.payload.targetTypeId) !== undefined || clearance.unreadableLink(event.payload.sourceTypeId, event.payload.linkId) !== undefined;
|
|
3354
|
+
default:
|
|
3355
|
+
return false;
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
4245
3358
|
|
|
4246
3359
|
// src/logging/execution.ts
|
|
4247
3360
|
function createLogsRuntime(runtime, source) {
|
|
@@ -5587,16 +4700,24 @@ function requireOutcome(outcomes, id) {
|
|
|
5587
4700
|
}
|
|
5588
4701
|
|
|
5589
4702
|
// src/objects/link/authorization.ts
|
|
5590
|
-
function
|
|
5591
|
-
|
|
5592
|
-
|
|
4703
|
+
async function assertCanWriteLinks(ctx, writes) {
|
|
4704
|
+
for (const write of writes) {
|
|
4705
|
+
assertCanEdit2(ctx, write.sourceTypeId);
|
|
4706
|
+
assertAuthorized2(ctx, { kind: "object.view", objectTypeId: write.targetTypeId });
|
|
4707
|
+
}
|
|
4708
|
+
await ctx.objectReader.assertReadable({
|
|
4709
|
+
objectTypeIds: [
|
|
4710
|
+
...new Set(writes.flatMap((write) => [write.sourceTypeId, write.targetTypeId]))
|
|
4711
|
+
],
|
|
4712
|
+
links: writes.map((write) => ({ objectTypeId: write.sourceTypeId, linkId: write.linkId }))
|
|
4713
|
+
});
|
|
5593
4714
|
}
|
|
5594
4715
|
|
|
5595
4716
|
// src/objects/link/remove.ts
|
|
5596
4717
|
async function removeLink2(ctx, params) {
|
|
5597
4718
|
const { objectType, linkDefinition, ontology } = ctx;
|
|
5598
4719
|
const { sourceId, linkId, targetTypeId, targetId } = params;
|
|
5599
|
-
|
|
4720
|
+
await assertCanWriteLinks(ctx, [{ sourceTypeId: objectType.id, linkId, targetTypeId }]);
|
|
5600
4721
|
assertLinkTargetType2(objectType.id, linkId, linkDefinition, targetTypeId, (expected, actual) => ontology.isValidLinkTarget(expected, actual));
|
|
5601
4722
|
await commitRuntimeOperations(ctx, [
|
|
5602
4723
|
linkDeleteOperation({
|
|
@@ -5652,7 +4773,7 @@ function endpointKey(objectTypeId, primaryId) {
|
|
|
5652
4773
|
async function upsertLink2(ctx, params) {
|
|
5653
4774
|
const { objectType, linkDefinition, ontology } = ctx;
|
|
5654
4775
|
const { sourceId, linkId, targetTypeId, targetId, properties } = params;
|
|
5655
|
-
|
|
4776
|
+
await assertCanWriteLinks(ctx, [{ sourceTypeId: objectType.id, linkId, targetTypeId }]);
|
|
5656
4777
|
const endpoints = { objectType, sourceId, targetTypeId, targetId };
|
|
5657
4778
|
requireEndpoints(endpoints, await loadEndpointExistence(ctx, collectEndpointLookups([endpoints])));
|
|
5658
4779
|
const normalizedProperties = normalizeRuntimeLink({
|
|
@@ -5728,12 +4849,11 @@ async function upsertLinkBatch2(ctx, items) {
|
|
|
5728
4849
|
const { ontology } = ctx;
|
|
5729
4850
|
if (items.length === 0)
|
|
5730
4851
|
return [];
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
}
|
|
4852
|
+
await assertCanWriteLinks(ctx, items.map((item) => ({
|
|
4853
|
+
sourceTypeId: item.objectType.id,
|
|
4854
|
+
linkId: item.linkId,
|
|
4855
|
+
targetTypeId: item.targetTypeId
|
|
4856
|
+
})));
|
|
5737
4857
|
const existing = await loadEndpointExistence(ctx, collectEndpointLookups(items));
|
|
5738
4858
|
const valueTypesById = ontology.getValueTypesById();
|
|
5739
4859
|
return runRuntimeItemBatch({
|
|
@@ -5777,6 +4897,7 @@ async function upsertLinkBatch2(ctx, items) {
|
|
|
5777
4897
|
// src/objects/object/delete.ts
|
|
5778
4898
|
async function deleteObject2(ctx, primaryId) {
|
|
5779
4899
|
assertCanEdit2(ctx, ctx.objectType.id);
|
|
4900
|
+
await ctx.objectReader.assertReadable({ objectTypeIds: [ctx.objectType.id] });
|
|
5780
4901
|
await commitRuntimeOperations(ctx, [
|
|
5781
4902
|
objectDeleteOperation({
|
|
5782
4903
|
id: runtimeOperationId(0),
|
|
@@ -5786,6 +4907,7 @@ async function deleteObject2(ctx, primaryId) {
|
|
|
5786
4907
|
}
|
|
5787
4908
|
async function restoreObject2(ctx, primaryId) {
|
|
5788
4909
|
assertCanEdit2(ctx, ctx.objectType.id);
|
|
4910
|
+
await ctx.objectReader.assertReadable({ objectTypeIds: [ctx.objectType.id] });
|
|
5789
4911
|
await commitRuntimeOperations(ctx, [
|
|
5790
4912
|
objectRestoreOperation({
|
|
5791
4913
|
id: runtimeOperationId(0),
|
|
@@ -5797,6 +4919,7 @@ async function restoreObject2(ctx, primaryId) {
|
|
|
5797
4919
|
async function upsertObject2(ctx, properties) {
|
|
5798
4920
|
assertCanEdit2(ctx, ctx.objectType.id);
|
|
5799
4921
|
const { objectType, primaryPropertyId, ontology } = ctx;
|
|
4922
|
+
const redact = await ctx.objectReader.writtenRowRedactor(objectType.id);
|
|
5800
4923
|
const normalized = normalizeRuntimeObject({
|
|
5801
4924
|
objectType,
|
|
5802
4925
|
primaryPropertyId,
|
|
@@ -5807,13 +4930,14 @@ async function upsertObject2(ctx, properties) {
|
|
|
5807
4930
|
const commit = await commitRuntimeOperations(ctx, [
|
|
5808
4931
|
objectUpsertOperation({ id: runtimeOperationId(0), ref, properties: normalized.properties })
|
|
5809
4932
|
]);
|
|
5810
|
-
return
|
|
4933
|
+
return redact(toObjectRow(ctx.projectId, requireEffectiveObject(commit.outcomes[0])));
|
|
5811
4934
|
}
|
|
5812
4935
|
// src/objects/object/upsert-batch.ts
|
|
5813
4936
|
async function upsertObjectBatch2(ctx, items) {
|
|
5814
4937
|
assertCanEdit2(ctx, ctx.objectType.id);
|
|
5815
4938
|
const { objectType, primaryPropertyId, ontology } = ctx;
|
|
5816
4939
|
const valueTypesById = ontology.getValueTypesById();
|
|
4940
|
+
const redact = await ctx.objectReader.writtenRowRedactor(objectType.id);
|
|
5817
4941
|
return runRuntimeItemBatch({
|
|
5818
4942
|
ctx,
|
|
5819
4943
|
items,
|
|
@@ -5838,7 +4962,7 @@ async function upsertObjectBatch2(ctx, items) {
|
|
|
5838
4962
|
]
|
|
5839
4963
|
};
|
|
5840
4964
|
},
|
|
5841
|
-
value: ([outcome]) =>
|
|
4965
|
+
value: ([outcome]) => redact(toObjectRow(ctx.projectId, requireEffectiveObject(outcome)))
|
|
5842
4966
|
});
|
|
5843
4967
|
}
|
|
5844
4968
|
// src/objects/vectors/handle.ts
|
|
@@ -7749,10 +6873,51 @@ function validateAgentNodeDefinition(workflowId, node) {
|
|
|
7749
6873
|
assertUniqueNonEmptyAgentStepValues(workflowId, node.id, "group", node.agentStep.groupIds);
|
|
7750
6874
|
assertUniqueNonEmptyAgentStepValues(workflowId, node.id, "tool", node.agentStep.toolNames);
|
|
7751
6875
|
assertUniqueNonEmptyAgentStepValues(workflowId, node.id, "skill", node.agentStep.skillNames);
|
|
6876
|
+
if (node.agentStep.sandbox !== undefined) {
|
|
6877
|
+
assertAgentStepSandbox(node.agentStep.sandbox, `Workflow "${workflowId}" agent step "${node.id}"`);
|
|
6878
|
+
}
|
|
7752
6879
|
if (node.mapper !== undefined && typeof node.mapper !== "function") {
|
|
7753
6880
|
throw new WorkflowDefinitionError2(`Workflow "${workflowId}" agent node "${node.id}" mapper must be a function.`);
|
|
7754
6881
|
}
|
|
7755
6882
|
}
|
|
6883
|
+
function assertAgentStepSandbox(value, step) {
|
|
6884
|
+
const fail = (issue, cause) => {
|
|
6885
|
+
throw new WorkflowDefinitionError2(`${step} sandbox ${issue}`, cause === undefined ? undefined : { cause });
|
|
6886
|
+
};
|
|
6887
|
+
if (!isRecord(value) || typeof value.create !== "function") {
|
|
6888
|
+
return fail("must be a sandbox factory with a create function.");
|
|
6889
|
+
}
|
|
6890
|
+
const { configuration } = value;
|
|
6891
|
+
if (configuration === undefined)
|
|
6892
|
+
return;
|
|
6893
|
+
if (!isRecord(configuration))
|
|
6894
|
+
return fail("configuration must be a sandbox recipe object.");
|
|
6895
|
+
if (configuration.params !== undefined || configuration.resolve !== undefined) {
|
|
6896
|
+
return fail("must use a static recipe: params and resolve are not supported in workflow steps.");
|
|
6897
|
+
}
|
|
6898
|
+
let recipe;
|
|
6899
|
+
try {
|
|
6900
|
+
recipe = staticSandboxRecipe2(configuration);
|
|
6901
|
+
} catch (error) {
|
|
6902
|
+
if (!(error instanceof SandboxError2))
|
|
6903
|
+
throw error;
|
|
6904
|
+
return fail(`recipe is invalid: ${error.message.replace(/^\[Sixb\] /, "")}`, error);
|
|
6905
|
+
}
|
|
6906
|
+
if (recipe.network?.mode === "none") {
|
|
6907
|
+
return fail('network mode "none" cannot run an agent: the agent needs the Sixb API. Use { mode: "restricted", allow: [...] } with the origins the project needs; Sixb adds its own.');
|
|
6908
|
+
}
|
|
6909
|
+
const { auth } = configuration;
|
|
6910
|
+
if (auth !== undefined && !(isRecord(auth) && typeof auth.authorize === "function")) {
|
|
6911
|
+
return fail("auth requires an authorize function.");
|
|
6912
|
+
}
|
|
6913
|
+
const credentialIssue = sandboxCredentialIssue2({
|
|
6914
|
+
supportsRequestCredentials: value.supportsRequestCredentials === true,
|
|
6915
|
+
auth,
|
|
6916
|
+
source: recipe.source
|
|
6917
|
+
});
|
|
6918
|
+
if (credentialIssue)
|
|
6919
|
+
fail(`is invalid: ${credentialIssue}`);
|
|
6920
|
+
}
|
|
7756
6921
|
function assertUniqueNonEmptyAgentStepValues(workflowId, stepId, kind, values) {
|
|
7757
6922
|
const seen = new Set;
|
|
7758
6923
|
for (const value of values) {
|
|
@@ -8656,6 +7821,7 @@ function createBoundSixb(runtime, dependencies, execution) {
|
|
|
8656
7821
|
...createExecutionFacades(runtime, execution, dependencies)
|
|
8657
7822
|
};
|
|
8658
7823
|
shareOntologyMutationRuntime2(runtime, sixb);
|
|
7824
|
+
registerActivityCaptureRuntime(sixb, createActivityCaptureRuntime(runtime, dependencies.activity));
|
|
8659
7825
|
if (dependencies.connectorConnections) {
|
|
8660
7826
|
registerConnectorConnectionsRuntime(sixb, createConnectorConnectionsRuntime(runtime, execution, dependencies.connectorConnections));
|
|
8661
7827
|
}
|
|
@@ -8669,17 +7835,19 @@ function createExecutionFacades(runtime, execution, dependencies) {
|
|
|
8669
7835
|
return {
|
|
8670
7836
|
objects: createObjectsRuntime(runtime, execution, dependencies.blobStorage),
|
|
8671
7837
|
actions: createActionsRuntime(runtime, execution),
|
|
8672
|
-
datasets: createDatasetsRuntime(runtime, execution, dependencies.definitions.datasets, dependencies.lakeStorage, dependencies.blobStorage),
|
|
7838
|
+
datasets: createDatasetsRuntime(runtime, execution, dependencies.definitions.datasets, dependencies.lakeStorage, dependencies.blobStorage, dependencies.datasetVersionMarkings),
|
|
8673
7839
|
workflows: createWorkflowsRuntime(runtime, execution, dependencies.definitions.workflows),
|
|
8674
7840
|
syncs: createSyncsRuntime(runtime, execution, dependencies.definitions.syncs),
|
|
8675
7841
|
pipelines: createPipelinesRuntime(runtime, execution, dependencies.definitions.pipelines),
|
|
8676
7842
|
projections: createProjectionsRuntime(runtime, dependencies.definitions.projections),
|
|
8677
7843
|
rules: createRulesRuntime(runtime, dependencies.definitions.rules),
|
|
8678
7844
|
agent: createAgentRuntime(runtime, execution, dependencies.definitions.models, dependencies.sandbox),
|
|
7845
|
+
artifacts: createArtifactsRuntime(runtime, dependencies.blobStorage),
|
|
8679
7846
|
models: createModelsRuntime(runtime, execution, dependencies.definitions.models, dependencies.blobStorage),
|
|
8680
7847
|
aiUsage: createAiUsageRuntime(runtime, dependencies.definitions.security),
|
|
8681
7848
|
events: createEventsRuntime(runtime),
|
|
8682
7849
|
logs: createLogsRuntime(runtime, dependencies.logging),
|
|
7850
|
+
activity: createActivityRuntime(runtime, dependencies.activity),
|
|
8683
7851
|
schedules: createSchedulesRuntime(runtime, dependencies.definitions.schedules),
|
|
8684
7852
|
shares: createSharesRuntime(runtime, execution, dependencies.definitions.shares),
|
|
8685
7853
|
connector: createConnectorRuntime(runtime, execution, dependencies.connectorService),
|
|
@@ -8807,6 +7975,6 @@ function invalidAgentExecution(executionId, runId) {
|
|
|
8807
7975
|
throw new ExecutionStorageError2("invalid_input", `[Sixb] Execution '${executionId}' does not authorize Agent run '${runId}'.`);
|
|
8808
7976
|
}
|
|
8809
7977
|
|
|
8810
|
-
export { defineAction2, param2, optional2, ActionRegistry2,
|
|
7978
|
+
export { defineAction2, param2, optional2, ActionRegistry2, bindModelExecutionAttempt, createAgentThreadId2, createAgentThreadSandboxName2, createAgentRunId2, createSubagentRunId2, createSubagentExecutionId2, createAgentMessageId2, agentContextCheckpointId2, createAgentRunExecutionToken2, canInheritAgentRequestAuthorization2, createAgentExecutionRecord2, createInheritedAgentExecutionRecord2, bindDurableAgentExecution2, bindAgentModelExecution2, restoreAgentExecutionScope2, assertAgentExecutionRecord2, DEFAULT_PROJECT_LOCALE, DEFAULT_PROJECT_TIME_ZONE, canonicalLocale, canonicalTimeZone, resolveAgentContextParts2, agentRunQueueJobId2, subagentRunQueueJobId2, workflowAgentNodeQueueJobId2, dispatchQueuedAgentRuns2, dispatchQueuedSubagentRuns2, assertNoAgentDefinitions, requestAgentRun2, isRetryableAgentRun2, retryAgentRun2, runModelLoop2, requestAction2, ObjectError2, removeLink2, upsertLink2, upsertLinkBatch2, deleteObject2, restoreObject2, upsertObject2, upsertObjectBatch2, writeTelemetryBatch2, appendTelemetryBatch2, getTelemetryHistoryBatch2, requireLinkDefinition2, resolveObjectContext2, resolveLinkContext2, createObjectSet2, exports_service, ShareError2, WorkflowDefinitionError2, WorkflowValidationError2, assertNonEmpty, isStepDefinition2, isAgentStepDefinition2, isInterventionDefinition2, isWorkflowDefinition2, validateWorkflowDefinition2, validateWorkflowsAtStartup2, validateWorkflowAgentStepGroupReferences2, validateWorkflowInput2, validateWorkflowStepInput2, validateWorkflowStepOutput2, validateWorkflowInterventionInput2, validateWorkflowInterventionResponse2, validateWorkflowInterventionDefaultResponse2, assertAgentStepSandbox, validateWorkflowAgentStepInput2, validateWorkflowAgentStepOutput2, snapshotWorkflowAgentStepInput2, snapshotWorkflowAgentStepOutput2, snapshotWorkflowInput2, snapshotWorkflowStepInput2, snapshotWorkflowStepOutput2, snapshotWorkflowInterventionInput2, snapshotWorkflowInterventionResponse2, snapshotWorkflowInterventionDefaultResponse2, snapshotWorkflowActionInput2, WorkflowRunDispatcher2, requestWorkflowRun2, createBoundSixb, isBoundSixb, bindDurablePrimitiveExecution2, ACTION_RUN_DRAIN_TIMEOUT_MS2, ActionRunExecutor, registerActionRunExecutor, drainActionRuns2, requestAction3 };
|
|
8811
7979
|
|
|
8812
|
-
//# debugId=
|
|
7980
|
+
//# debugId=BC1E3E649140D38B64756E2164756E21
|