@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
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/storage/agents/types.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { AgentMessage, AgentMessagePart, AgentMessageRole } from \"../../agents/message\"\nimport type { AgentReasoning } from \"../../agents/types\"\nimport type { Principal } from \"../../auth\"\nimport type { FileRef } from \"../../blob-storage\"\nimport type { SixbErrorCode, SixbFailure } from \"../../errors/types\"\nimport type { JsonValue } from \"../../json\"\nimport type { LanguageModelRef } from \"../../models\"\n\n// ── agent_threads — one conversation with an agent ──────────────────────────────────────────────\n\nexport type AgentThreadStatus = \"active\" | \"archived\"\n\n/** Immutable, non-secret application input. Never store resolved env or credentials here. */\nexport type AgentThreadSandboxParams = Readonly<Record<string, JsonValue>>\n\n/** Worker-owned state, independent from the immutable application binding. */\nexport interface AgentThreadSandboxState {\n /** Exact name passed to the provider. Replacements always receive a fresh name. */\n readonly name: string\n readonly status: \"new\" | \"busy\" | \"ready\" | \"blocked\" | \"unavailable\"\n readonly sourceFingerprint?: string\n readonly initialized: boolean\n /** Durable context boundary: local files from before this reset are no longer available. */\n readonly resetAt?: string\n /** Never expires automatically: a delayed provider operation must not reach a successor. */\n readonly owner?: { readonly runId: string; readonly executionToken: string }\n}\n\nexport type TransitionAgentThreadSandboxInput = {\n readonly projectId: string\n readonly id: string\n} & (\n | {\n readonly action: \"acquire\"\n readonly runId: string\n readonly executionToken: string\n readonly name: string\n readonly sourceFingerprint: string\n }\n | {\n readonly action: \"replace\"\n readonly runId: string\n readonly executionToken: string\n readonly name: string\n readonly nextName: string\n }\n | {\n readonly action: \"settle\"\n readonly runId: string\n readonly executionToken: string\n readonly name: string\n readonly status: \"ready\" | \"blocked\" | \"unavailable\"\n readonly initialized: boolean\n }\n | {\n readonly action: \"recreate\"\n readonly expectedSandboxName: string\n readonly name: string\n }\n)\n\nexport interface AgentThreadRecord {\n readonly id: string\n readonly projectId: string\n /** Who owns/opened the thread. Reuses the canonical auth principal (gains `agent` later for free). */\n readonly ownerPrincipal: Principal\n readonly title?: string\n readonly sandboxParams?: AgentThreadSandboxParams\n readonly sandboxState?: AgentThreadSandboxState\n readonly status: AgentThreadStatus\n /** Single-flight anchor: the id of the one run currently allowed to write, or `null` when idle. */\n readonly activeRunId: string | null\n readonly lastMessageAt?: Date\n readonly messageCount: number\n readonly createdAt: Date\n readonly updatedAt: Date\n}\n\nexport interface CreateAgentThreadInput {\n readonly id: string\n readonly projectId: string\n readonly ownerPrincipal: Principal\n readonly title?: string\n readonly sandboxParams?: AgentThreadSandboxParams\n readonly status?: AgentThreadStatus\n readonly createdAt?: Date\n readonly updatedAt?: Date\n}\n\nexport interface ListAgentThreadsInput {\n readonly projectId: string\n readonly statuses?: readonly AgentThreadStatus[]\n readonly ownerPrincipal?: Principal\n readonly limit?: number\n readonly offset?: number\n readonly order?: \"asc\" | \"desc\"\n}\n\nexport interface ListAgentThreadsResult {\n readonly threads: readonly AgentThreadRecord[]\n readonly hasMore: boolean\n readonly total: number\n}\n\n// ── agent_runs — one loop execution (the worker job; attribution + fencing) ───────────────────\n\n/** Lifecycle shared by every durable agent execution, conversational or workflow-owned. */\nexport type AgentExecutionStatus = \"queued\" | \"running\" | \"succeeded\" | \"failed\" | \"cancelled\"\n\nexport type AgentRunStatus = AgentExecutionStatus\nexport type AgentRunKind = \"conversation\" | \"subagent\"\n\n/** Error codes an agent execution can persist and expose through its public contract. */\nexport const AGENT_RUN_FAILURE_CODES = [\n \"internal.unexpected\",\n \"runtime.cancelled\",\n \"agent.execution_failed\",\n \"ai.usage_limit_exceeded\",\n \"ai.usage_limit_unavailable\",\n] as const satisfies readonly [SixbErrorCode, ...SixbErrorCode[]]\n\nexport type AgentRunFailureCode = (typeof AGENT_RUN_FAILURE_CODES)[number]\n\n/**\n * Why a run ended — Sixb's provider-independent vocabulary. It includes model-loop reasons plus\n * platform-level endings such as `timeout`, or `interrupted` for a turn whose worker died before\n * finishing it, so reads remain typed and exhaustive. `other` and `unknown` preserve terminal state\n * when a provider adds a new reason.\n */\nexport const AGENT_RUN_FINISH_REASONS = [\n \"stop\",\n \"length\",\n \"content-filter\",\n \"tool-calls\",\n \"timeout\",\n \"interrupted\",\n \"error\",\n \"other\",\n \"unknown\",\n] as const\n\nexport type AgentRunFinishReason = (typeof AGENT_RUN_FINISH_REASONS)[number]\n\n/**\n * Coerce an external finish-reason string — a DB column or an SDK value — to {@link\n * AgentRunFinishReason}. An unrecognised value becomes `\"unknown\"` rather than being dropped.\n */\nexport function coerceAgentRunFinishReason(\n value: string | null | undefined\n): AgentRunFinishReason | undefined {\n if (value === null || value === undefined) {\n return undefined\n }\n return (AGENT_RUN_FINISH_REASONS as readonly string[]).includes(value)\n ? (value as AgentRunFinishReason)\n : \"unknown\"\n}\n\n/** Stable, user-facing diagnostics emitted by the platform while executing a run. */\nexport const AGENT_RUN_DIAGNOSTIC_CODES = [\n \"output_file_limit_exceeded\",\n \"output_file_too_large\",\n \"output_budget_exhausted\",\n \"output_collection_failed\",\n \"output_file_changed\",\n \"output_storage_failed\",\n \"step_limit_reached\",\n] as const\n\n/**\n * Closed on purpose, and the wire is closed with it.\n *\n * Sixb writes these codes and the generated client is what reads them, so an open union would only\n * be honest if the HTTP schema were open too — and that costs the OpenAPI enum, the client's\n * autocompletion, and the app's exhaustive `switch`. Sixb owns both ends, so a new code is a minor\n * version bump: cheap here, and a broken `switch` is better than a 500 from `z.enum`.\n */\nexport type AgentRunDiagnosticCode = (typeof AGENT_RUN_DIAGNOSTIC_CODES)[number]\nexport type AgentRunDiagnosticSeverity = \"warning\" | \"error\"\n\nexport interface AgentRunDiagnostic {\n readonly code: AgentRunDiagnosticCode\n readonly severity: AgentRunDiagnosticSeverity\n /** `output` for published files, `run` for the turn as a whole. */\n readonly scope: \"output\" | \"run\"\n /** Relative path inside the run's published output directory, when one file is involved. */\n readonly path?: string\n /** Sanitized, stable copy suitable for display to an end user. */\n readonly message: string\n}\n\n/**\n * Authorization state for the current queue delivery.\n *\n * `queueLeaseExpiresAt` is a persisted projection of `ClaimedQueueJob.leaseExpiresAt`, not an\n * independently managed run lease. It may only be extended from a successful queue lease renewal.\n */\nexport interface AgentRunExecution {\n readonly token: string\n readonly queueLeaseExpiresAt: Date\n}\n\ninterface AgentRunRecordBase {\n readonly id: string\n readonly projectId: string\n readonly executionId: string\n readonly status: AgentRunStatus\n readonly modelId?: string\n /** Why the run ended (our own SDK-independent enum). */\n readonly finishReason?: AgentRunFinishReason\n /** Platform diagnostics are transcript annotations, never agent-authored message content. */\n readonly diagnostics?: readonly AgentRunDiagnostic[]\n /** Portable failure snapshot when the run did not succeed. */\n readonly error?: SixbFailure<AgentRunFailureCode>\n /** Execution attempts: `0` while queued, `1` on first start, incremented on redelivery. */\n readonly attempt: number\n readonly execution?: AgentRunExecution\n readonly createdAt: Date\n readonly startedAt?: Date\n readonly completedAt?: Date\n}\n\nexport interface ConversationAgentRunRecord extends AgentRunRecordBase {\n readonly kind: \"conversation\"\n readonly threadId: string\n readonly triggerMessageId: string\n /** Immutable model selection captured at admission. Absent only on runs predating this field. */\n readonly spec?: ConversationAgentRunSpec\n}\n\n/** Immutable, serialisable model selection and requester settings for one conversational turn. */\nexport interface ConversationAgentRunSpec {\n readonly model: LanguageModelRef\n readonly reasoning?: AgentReasoning\n /** Canonical IANA time zone of the requester. Absent uses the project time zone. */\n readonly timeZone?: string\n /** Canonical BCP 47 language of the requester. Absent uses the project locale. */\n readonly locale?: string\n}\n\n/** Immutable, serialisable child configuration captured before dispatch. */\nexport interface SubagentRunSpec {\n readonly model: LanguageModelRef\n readonly reasoning?: AgentReasoning\n /** Focused task supplied by the parent Agent. */\n readonly task: string\n /** Project tools available when the child was admitted. Runtime tools are injected separately. */\n readonly toolNames: readonly string[]\n readonly maxSteps: number\n}\n\n/** Durable child output returned to its parent by `wait_agent`. */\nexport interface SubagentRunResult {\n readonly text?: string\n readonly files?: readonly FileRef[]\n}\n\nexport interface SubagentRunRecord extends AgentRunRecordBase {\n readonly kind: \"subagent\"\n readonly parentRunId: string\n /** Stable parent-selected key that makes repeated tool execution idempotent. */\n readonly spawnKey: string\n readonly spec: SubagentRunSpec\n readonly result?: SubagentRunResult\n}\n\nexport type AgentRunRecord = ConversationAgentRunRecord | SubagentRunRecord\n\nexport interface CreateAgentRunInput {\n readonly id: string\n readonly projectId: string\n readonly executionId: string\n readonly threadId: string\n readonly triggerMessageId: string\n readonly spec: ConversationAgentRunSpec\n readonly createdAt?: Date\n}\n\nexport interface CreateSubagentRunInput {\n readonly id: string\n readonly projectId: string\n readonly executionId: string\n readonly parentRunId: string\n /** Current parent delivery token. New children are admitted only while that delivery owns it. */\n readonly parentExecutionToken: string\n readonly spawnKey: string\n readonly spec: SubagentRunSpec\n /** Internal safety bound enforced atomically across worker processes. */\n readonly maxActiveChildren: number\n readonly createdAt?: Date\n}\n\nexport interface StartAgentRunInput {\n readonly id: string\n readonly projectId: string\n readonly modelId?: string\n readonly execution: AgentRunExecution\n readonly startedAt?: Date\n}\n\nexport interface FinishQueuedAgentRunInput {\n readonly id: string\n readonly projectId: string\n readonly status: \"failed\" | \"cancelled\"\n readonly error?: SixbFailure<AgentRunFailureCode>\n readonly completedAt?: Date\n}\n\nexport interface ReclaimAgentRunInput {\n readonly id: string\n readonly projectId: string\n readonly execution: AgentRunExecution\n}\n\nexport interface ConfirmAgentRunExecutionOwnershipInput {\n readonly id: string\n readonly projectId: string\n readonly executionToken: string\n /** Exact expiration returned by the queue claim or its latest successful renewal. */\n readonly queueLeaseExpiresAt: Date\n}\n\nexport type FinishAgentRunInput =\n | {\n readonly id: string\n readonly projectId: string\n readonly executionToken: string\n readonly status: \"succeeded\"\n readonly modelId?: string\n readonly finishReason?: AgentRunFinishReason\n readonly diagnostics?: readonly AgentRunDiagnostic[]\n readonly result?: SubagentRunResult\n readonly completedAt?: Date\n }\n | {\n readonly id: string\n readonly projectId: string\n readonly executionToken: string\n readonly status: \"failed\" | \"cancelled\"\n readonly modelId?: string\n readonly finishReason?: AgentRunFinishReason\n readonly diagnostics?: readonly AgentRunDiagnostic[]\n readonly error?: SixbFailure<AgentRunFailureCode>\n readonly completedAt?: Date\n }\n\nexport interface ListAgentRunsInput {\n readonly projectId: string\n readonly kinds?: readonly AgentRunKind[]\n readonly threadId?: string\n readonly parentRunId?: string\n readonly statuses?: readonly AgentRunStatus[]\n /** Effective start time; runs that never started use `createdAt`. */\n readonly startedAfter?: Date\n /** Effective start time; runs that never started use `createdAt`. */\n readonly startedBefore?: Date\n readonly limit?: number\n readonly offset?: number\n readonly order?: \"asc\" | \"desc\"\n}\n\nexport interface ListAgentRunsResult {\n readonly runs: readonly AgentRunRecord[]\n readonly hasMore: boolean\n readonly total: number\n}\n\n// ── agent_messages — one message (assistant messages inserted only once finalized) ─────────────\n\nexport type { AgentMessageRole }\n\nexport interface AgentMessageRecord {\n readonly id: string\n readonly projectId: string\n readonly threadId: string\n /** The run that produced this message; `null` for user-authored messages. */\n readonly runId: string | null\n readonly role: AgentMessageRole\n /** Principal that authored this persisted message: caller for user messages, agent identity later for assistant messages. */\n readonly authorPrincipal?: Principal\n /** Monotonic per thread, assigned by the store. */\n readonly seq: number\n /** Structured message content — text / reasoning / step boundaries / tool calls. */\n readonly parts: readonly AgentMessagePart[]\n /** Message-level metadata (mirrors `UIMessage.metadata`). */\n readonly metadata?: JsonValue\n /** Versions the `parts` shape so it can be migrated; stamped from `AGENT_MESSAGE_CONTENT_VERSION`. */\n readonly contentVersion: number\n readonly createdAt: Date\n readonly completedAt?: Date\n}\n\n/** Append a message: a {@link AgentMessage} (role + parts + metadata) plus its storage identity. */\nexport interface AppendAgentMessageInput extends AgentMessage {\n readonly id: string\n readonly projectId: string\n readonly threadId: string\n readonly runId: string | null\n readonly authorPrincipal?: Principal\n readonly createdAt?: Date\n readonly completedAt?: Date\n}\n\nexport interface DeleteAgentMessagesByRunInput {\n readonly projectId: string\n readonly threadId: string\n readonly runId: string\n}\n\nexport interface ListAgentMessagesInput {\n readonly projectId: string\n readonly threadId: string\n /** Return only messages whose per-thread sequence is greater than this retained boundary. */\n readonly afterSeq?: number\n readonly roles?: readonly AgentMessageRole[]\n readonly limit?: number\n readonly offset?: number\n readonly order?: \"asc\" | \"desc\"\n}\n\nexport interface ListAgentMessagesResult {\n readonly messages: readonly AgentMessageRecord[]\n readonly hasMore: boolean\n readonly total: number\n}\n\n// ── agent_context_checkpoints — append-only model-context boundaries ──────────────────────────\n\nexport type AgentContextCheckpointReason = \"threshold\" | \"overflow\"\n\n/**\n * A durable summary boundary used only when projecting a thread into model context.\n *\n * Checkpoints never replace or mutate transcript messages. Normal thread reads remain authoritative\n * and complete; the worker reads the latest checkpoint and only the retained message tail.\n */\nexport interface AgentContextCheckpointRecord {\n readonly id: string\n readonly projectId: string\n readonly threadId: string\n readonly createdByRunId: string\n readonly previousCheckpointId?: string\n readonly reason: AgentContextCheckpointReason\n readonly summary: string\n readonly summaryFormatVersion: 1\n readonly summarizedThroughSeq: number\n readonly observedHeadSeq: number\n readonly estimatedInputTokensBefore: number\n readonly estimatedInputTokensAfter: number\n readonly summaryModelId: string\n readonly createdAt: Date\n}\n\nexport interface CreateAgentContextCheckpointInput {\n readonly id: string\n readonly projectId: string\n readonly threadId: string\n readonly createdByRunId: string\n /** Compare-and-swap anchor. `null` means the thread must not have a prior checkpoint. */\n readonly expectedPreviousCheckpointId: string | null\n /** Compare-and-swap anchor for the complete transcript observed by the summarizer. */\n readonly expectedHeadSeq: number\n /** Current delivery token for `createdByRunId`; stale redeliveries must not write. */\n readonly executionToken: string\n readonly reason: AgentContextCheckpointReason\n readonly summary: string\n readonly summaryFormatVersion: 1\n readonly summarizedThroughSeq: number\n readonly observedHeadSeq: number\n readonly estimatedInputTokensBefore: number\n readonly estimatedInputTokensAfter: number\n readonly summaryModelId: string\n readonly createdAt?: Date\n}\n\n// ── Store ───────────────────────────────────────────────────────────────────────────────────────\n\nexport interface AgentThreadStore {\n /** Atomic run-fenced transition, or explicit idle-thread recreation. */\n transitionSandbox(input: TransitionAgentThreadSandboxInput): Promise<AgentThreadSandboxState>\n create(input: CreateAgentThreadInput): Promise<AgentThreadRecord>\n getById(params: { projectId: string; id: string }): Promise<AgentThreadRecord | null>\n list(input: ListAgentThreadsInput): Promise<ListAgentThreadsResult>\n}\n\nexport interface AgentRunStore {\n /** Persist a queued run and atomically claim the thread's single-flight slot. */\n create(input: CreateAgentRunInput): Promise<ConversationAgentRunRecord>\n /** Persist or replay one idempotent child run while atomically enforcing parent fan-out. */\n createSubagent(input: CreateSubagentRunInput): Promise<SubagentRunRecord>\n /** Transition a queued run to running and install the first delivery's execution token. */\n start(input: StartAgentRunInput): Promise<AgentRunRecord>\n /** Finish a queued run before execution and release the thread's single-flight slot. */\n finishQueued(input: FinishQueuedAgentRunInput): Promise<AgentRunRecord>\n /** Rotate the execution token for a redelivered running job (`attempt++`). */\n reclaim(input: ReclaimAgentRunInput): Promise<AgentRunRecord>\n /**\n * Project the queue's latest confirmed ownership expiration onto the current execution.\n * Implementations must fence by token and must never move the expiration backwards.\n */\n confirmExecutionOwnership(input: ConfirmAgentRunExecutionOwnershipInput): Promise<AgentRunRecord>\n /** Finalize a run and release the thread's `activeRunId`. */\n finish(input: FinishAgentRunInput): Promise<AgentRunRecord>\n getById(params: { projectId: string; id: string }): Promise<AgentRunRecord | null>\n getByIds(params: {\n projectId: string\n ids: readonly string[]\n }): Promise<readonly AgentRunRecord[]>\n list(input: ListAgentRunsInput): Promise<ListAgentRunsResult>\n}\n\nexport interface AgentMessageStore {\n /** Insert a message (its `parts` are the canonical content) and bump thread stats. */\n append(input: AppendAgentMessageInput): Promise<AgentMessageRecord>\n /** Delete every message produced by one run and repair the thread's message stats. */\n deleteByRunId(input: DeleteAgentMessagesByRunInput): Promise<number>\n getById(params: { projectId: string; id: string }): Promise<AgentMessageRecord | null>\n list(input: ListAgentMessagesInput): Promise<ListAgentMessagesResult>\n}\n\nexport interface AgentContextCheckpointStore {\n /**\n * Append one checkpoint after atomically validating run ownership and both transcript anchors.\n * Repeating the same payload for the same creating run is idempotent.\n */\n create(input: CreateAgentContextCheckpointInput): Promise<AgentContextCheckpointRecord>\n /** Return checkpoints created by the requested runs, in first-occurrence input order. */\n getByRunIds(input: {\n readonly projectId: string\n readonly runIds: readonly string[]\n }): Promise<readonly AgentContextCheckpointRecord[]>\n getLatest(input: {\n readonly projectId: string\n readonly threadId: string\n }): Promise<AgentContextCheckpointRecord | null>\n}\n\nexport interface AgentStorage {\n readonly threads: AgentThreadStore\n readonly runs: AgentRunStore\n readonly messages: AgentMessageStore\n readonly checkpoints: AgentContextCheckpointStore\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;AAiHO,IAAM,2BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,IAAM,4BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQO,SAAS,2BAA0B,CACxC,OACkC;AAAA,EAClC,IAAI,UAAU,QAAQ,UAAU,WAAW;AAAA,IACzC;AAAA,EACF;AAAA,EACA,OAAQ,0BAA+C,SAAS,KAAK,IAChE,QACD;AAAA;AAIC,IAAM,8BAA6B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
8
|
-
"debugId": "DD020A3A47567D1D64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/workflows/agent-step-identity.ts", "../src/workflows/builders.ts", "../src/workflows/failure.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/** Stable internal actor id for one workflow Agent step. */\nexport function workflowAgentStepActorId(workflowId: string, stepId: string): string {\n return `workflow:${encodeURIComponent(workflowId)}:step:${encodeURIComponent(stepId)}`\n}\n",
|
|
6
|
-
"import type { ActionDefinition } from \"../actions\"\nimport { isActionDefinition } from \"../actions\"\nimport { AGENT_REASONING_LEVELS, isAgentToolDefinition } from \"../agents\"\nimport { isModelReasoning } from \"../models/language-model\"\nimport type { SchemaOrRef } from \"../ontology\"\nimport type { ScheduleDefinition, ScheduleDefinitionForEvent } from \"../schedules\"\nimport { isScheduleDefinition } from \"../schedules\"\nimport { isGroupDefinition } from \"../security\"\nimport { WorkflowDefinitionError } from \"./errors\"\nimport type {\n AgentStepBuilder,\n AgentStepDefinition,\n DefineAgentStepConfig,\n InterventionBuilder,\n InterventionDefaultsRuntimeHandler,\n InterventionDefinition,\n InterventionFieldConfig,\n StepBuilder,\n StepDefinition,\n StepHandler,\n WorkflowBuilder,\n WorkflowChainDefinition,\n WorkflowNodeDefinition,\n WorkflowScheduleMapper,\n WorkflowTriggerDefinition,\n} from \"./types\"\nimport {\n assertNonEmpty,\n isAgentStepDefinition,\n isInterventionDefinition,\n isStepDefinition,\n} from \"./validation\"\n\ntype InterventionOptions = {\n description?: string\n}\n\ntype RuntimeWorkflowInput = Record<string, SchemaOrRef>\ntype RuntimeWorkflowValueInput = Record<string, unknown>\ntype RuntimeWorkflowMapper = (...args: never[]) => unknown\ntype RuntimeWorkflowScheduleMapper = WorkflowScheduleMapper<unknown, RuntimeWorkflowValueInput>\ntype RuntimeWorkflowThenDefinition =\n | StepDefinition\n | InterventionDefinition\n | ActionDefinition\n | AgentStepDefinition\ntype RuntimeWorkflowThen = (\n nodeDefinition: RuntimeWorkflowThenDefinition,\n mapper?: RuntimeWorkflowMapper\n) => WorkflowChainDefinition\ntype RuntimeWorkflowDraftBuilder = {\n when(schedule: ScheduleDefinition): RuntimeWorkflowDraftBuilder\n when(\n schedule: ScheduleDefinitionForEvent,\n mapper: RuntimeWorkflowScheduleMapper\n ): RuntimeWorkflowDraftBuilder\n readonly then: RuntimeWorkflowThen\n}\n\n/**\n * See the action-param helper for why widened booleans are rejected. Optional\n * response fields must be an explicit literal decision so inference stays honest.\n */\ntype StrictBoolean<T extends boolean> = boolean extends T ? never : T\n\ntype InterventionFieldResult<TSchema extends SchemaOrRef, TRequired extends boolean> = {\n readonly schema: TSchema\n readonly required: TRequired\n readonly description?: string\n}\n\nexport function interventionField<const TSchema extends SchemaOrRef>(\n schema: TSchema\n): InterventionFieldResult<TSchema, true>\nexport function interventionField<\n const TSchema extends SchemaOrRef,\n const TRequired extends boolean = true,\n>(\n schema: TSchema,\n options: {\n required?: StrictBoolean<TRequired>\n description?: string\n }\n): InterventionFieldResult<TSchema, TRequired>\nexport function interventionField(\n schema: SchemaOrRef,\n options?: { required?: boolean; description?: string }\n): InterventionFieldConfig {\n return {\n schema,\n required: options?.required ?? true,\n ...(options?.description !== undefined ? { description: options.description } : {}),\n }\n}\n\nexport function defineWorkflowStep<const TId extends string>(id: TId): StepBuilder<TId> {\n assertNonEmpty(id, \"Step\", \"id\")\n\n return {\n input(input: RuntimeWorkflowInput): unknown {\n return {\n output(output: RuntimeWorkflowInput): unknown {\n return {\n run(handler: StepHandler<Record<string, unknown>, Record<string, unknown>>): unknown {\n return {\n kind: \"step\",\n id,\n input,\n output,\n handler,\n }\n },\n }\n },\n }\n },\n } as unknown as StepBuilder<TId>\n}\n\nexport function defineAgentStep<const TId extends string>(\n id: TId,\n config: DefineAgentStepConfig\n): AgentStepBuilder<TId> {\n assertNonEmpty(id, \"Agent step\", \"id\")\n if (!isRecord(config)) {\n throw new WorkflowDefinitionError(`Agent step \"${id}\" config must be an object.`)\n }\n if (typeof config.instructions !== \"string\" || !config.instructions.trim()) {\n throw new WorkflowDefinitionError(`Agent step \"${id}\" instructions must not be empty.`)\n }\n if (config.reasoning !== undefined && !isModelReasoning(config.reasoning)) {\n throw new WorkflowDefinitionError(\n `Agent step \"${id}\" reasoning must be one of: ${AGENT_REASONING_LEVELS.join(\", \")}, or a nonnegative budgetTokens object.`\n )\n }\n const { model, reasoning, instructions } = config\n const groupIds = groupIdsFromAgentStepConfig(id, config)\n const toolNames = toolNamesFromAgentStepConfig(id, config)\n const skillNames = skillNamesFromAgentStepConfig(id, config)\n\n return {\n input(input: RuntimeWorkflowInput): unknown {\n return {\n output(output: RuntimeWorkflowInput): unknown {\n return {\n prompt(prompt: unknown): unknown {\n if (typeof prompt !== \"function\") {\n throw new WorkflowDefinitionError(`Agent step \"${id}\" prompt must be a function.`)\n }\n return {\n kind: \"agentStep\",\n id,\n ...(model === undefined ? {} : { model }),\n ...(reasoning === undefined ? {} : { reasoning }),\n instructions,\n groupIds,\n toolNames,\n skillNames,\n input,\n output,\n prompt,\n }\n },\n }\n },\n }\n },\n } as unknown as AgentStepBuilder<TId>\n}\n\nfunction groupIdsFromAgentStepConfig(\n stepId: string,\n config: DefineAgentStepConfig\n): readonly string[] {\n if (config.groups !== undefined && !Array.isArray(config.groups)) {\n throw new WorkflowDefinitionError(\n `Agent step \"${stepId}\" groups must be an array of group definitions.`\n )\n }\n const groupIds = Array.from(config.groups ?? [], (group) => {\n if (!isGroupDefinition(group)) {\n throw new WorkflowDefinitionError(\n `Agent step \"${stepId}\" groups must contain only group definitions.`\n )\n }\n return group.id\n })\n assertUniqueAgentStepValues(stepId, \"group\", groupIds)\n return Object.freeze(groupIds)\n}\n\nfunction toolNamesFromAgentStepConfig(\n stepId: string,\n config: DefineAgentStepConfig\n): readonly string[] {\n if (config.tools !== undefined && !Array.isArray(config.tools)) {\n throw new WorkflowDefinitionError(\n `Agent step \"${stepId}\" tools must be an array of agent tool definitions.`\n )\n }\n const toolNames = Array.from(config.tools ?? [], (tool) => {\n if (!isAgentToolDefinition(tool)) {\n throw new WorkflowDefinitionError(\n `Agent step \"${stepId}\" tools must contain only agent tool definitions.`\n )\n }\n return tool.name\n })\n assertUniqueAgentStepValues(stepId, \"tool\", toolNames)\n return Object.freeze(toolNames)\n}\n\nfunction skillNamesFromAgentStepConfig(\n stepId: string,\n config: DefineAgentStepConfig\n): readonly string[] {\n if (config.skills !== undefined && !Array.isArray(config.skills)) {\n throw new WorkflowDefinitionError(\n `Agent step \"${stepId}\" skills must be an array of Agent Skill names.`\n )\n }\n const skillNames = Array.from(config.skills ?? [], (name) => {\n if (typeof name !== \"string\" || !name.trim()) {\n throw new WorkflowDefinitionError(\n `Agent step \"${stepId}\" skills must contain only non-empty Agent Skill names.`\n )\n }\n return name\n })\n assertUniqueAgentStepValues(stepId, \"skill\", skillNames)\n return Object.freeze(skillNames)\n}\n\nfunction assertUniqueAgentStepValues(\n stepId: string,\n kind: \"group\" | \"tool\" | \"skill\",\n values: readonly string[]\n): void {\n const seen = new Set<string>()\n for (const value of values) {\n if (seen.has(value)) {\n throw new WorkflowDefinitionError(\n `Agent step \"${stepId}\" ${kind}s contains duplicate ${kind} '${value}'.`\n )\n }\n seen.add(value)\n }\n}\n\nexport function defineIntervention<const TId extends string>(\n id: TId,\n options?: InterventionOptions\n): InterventionBuilder<TId> {\n assertNonEmpty(id, \"Intervention\", \"id\")\n\n return {\n input(input: RuntimeWorkflowInput): unknown {\n return {\n response(response: Record<string, unknown>): unknown {\n return createInterventionDefinition({\n id,\n input,\n response,\n description: options?.description,\n })\n },\n }\n },\n } as unknown as InterventionBuilder<TId>\n}\n\nexport function defineWorkflow<const TId extends string>(id: TId): WorkflowBuilder<TId> {\n assertNonEmpty(id, \"Workflow\", \"id\")\n\n return {\n input(input: RuntimeWorkflowInput): unknown {\n return createWorkflowDraftBuilder(id, input)\n },\n } as unknown as WorkflowBuilder<TId>\n}\n\nfunction createWorkflowDraftBuilder(\n id: string,\n input: RuntimeWorkflowInput\n): RuntimeWorkflowDraftBuilder {\n const triggers: WorkflowTriggerDefinition[] = []\n const nodes: WorkflowNodeDefinition[] = []\n let definition: WorkflowChainDefinition | null = null\n\n const appendNode = (\n nodeDefinition: unknown,\n mapper?: unknown,\n ...extraArgs: unknown[]\n ): WorkflowChainDefinition => {\n if (extraArgs.length > 0) {\n throw new WorkflowDefinitionError(`Invalid workflow \"${id}\" .then(...) call.`)\n }\n\n if (isStepDefinition(nodeDefinition)) {\n if (mapper !== undefined && !isRuntimeWorkflowMapper(mapper)) {\n throw new WorkflowDefinitionError(`Invalid workflow \"${id}\" .then(...) call.`)\n }\n\n nodes.push(createStepNode(id, nodes, nodeDefinition, mapper))\n definition ??= createWorkflowDefinition(id, input, triggers, nodes, appendNode)\n return definition\n }\n\n if (isAgentStepDefinition(nodeDefinition)) {\n if (mapper !== undefined && !isRuntimeWorkflowMapper(mapper)) {\n throw new WorkflowDefinitionError(`Invalid workflow \"${id}\" .then(...) call.`)\n }\n\n nodes.push(createAgentNode(id, nodes, nodeDefinition, mapper))\n definition ??= createWorkflowDefinition(id, input, triggers, nodes, appendNode)\n return definition\n }\n\n if (isInterventionDefinition(nodeDefinition)) {\n if (mapper !== undefined && !isRuntimeWorkflowMapper(mapper)) {\n throw new WorkflowDefinitionError(`Invalid workflow \"${id}\" .then(...) call.`)\n }\n\n nodes.push(createInterventionNode(id, nodes, nodeDefinition, mapper))\n definition ??= createWorkflowDefinition(id, input, triggers, nodes, appendNode)\n return definition\n }\n\n if (isActionDefinition(nodeDefinition)) {\n if (mapper !== undefined && !isRuntimeWorkflowMapper(mapper)) {\n throw new WorkflowDefinitionError(`Invalid workflow \"${id}\" .then(...) call.`)\n }\n\n nodes.push(createActionNode(id, nodes, nodeDefinition, mapper))\n definition ??= createWorkflowDefinition(id, input, triggers, nodes, appendNode)\n return definition\n }\n\n throw new WorkflowDefinitionError(`Invalid workflow \"${id}\" .then(...) call.`)\n }\n\n let draft: RuntimeWorkflowDraftBuilder\n\n function when(schedule: ScheduleDefinition): RuntimeWorkflowDraftBuilder\n function when(\n schedule: ScheduleDefinitionForEvent,\n mapper: RuntimeWorkflowScheduleMapper\n ): RuntimeWorkflowDraftBuilder\n function when(\n schedule: unknown,\n mapper?: unknown,\n ...extraArgs: unknown[]\n ): RuntimeWorkflowDraftBuilder {\n if (extraArgs.length > 0) {\n throw new WorkflowDefinitionError(`Invalid workflow \"${id}\" .when(...) call.`)\n }\n\n if (isScheduleDefinition(schedule)) {\n if (mapper !== undefined && schedule.trigger.type !== \"event\") {\n throw new WorkflowDefinitionError(`Workflow \"${id}\" cron schedules do not accept a mapper.`)\n }\n if (mapper !== undefined && !isRuntimeWorkflowScheduleMapper(mapper)) {\n throw new WorkflowDefinitionError(`Invalid workflow \"${id}\" .when(...) schedule mapper.`)\n }\n\n triggers.push({\n type: \"schedule\",\n scheduleId: schedule.id,\n ...(mapper !== undefined ? { mapper } : {}),\n })\n return draft\n }\n\n throw new WorkflowDefinitionError(`Workflow \"${id}\" .when(...) only accepts schedules.`)\n }\n\n draft = {\n when,\n // biome-ignore lint/suspicious/noThenProperty: Workflows intentionally expose a chainable .then(...) DSL.\n then: appendNode,\n }\n\n return draft\n}\n\nfunction createWorkflowDefinition(\n id: string,\n input: RuntimeWorkflowInput,\n triggers: readonly WorkflowTriggerDefinition[],\n nodes: readonly WorkflowNodeDefinition[],\n then: (\n nodeDefinition: unknown,\n mapper?: unknown,\n ...extraArgs: unknown[]\n ) => WorkflowChainDefinition\n): WorkflowChainDefinition {\n return {\n kind: \"workflow\",\n id,\n input,\n triggers,\n nodes,\n then,\n } as unknown as WorkflowChainDefinition\n}\n\nfunction createStepNode(\n workflowId: string,\n nodes: readonly WorkflowNodeDefinition[],\n step: StepDefinition,\n mapper: RuntimeWorkflowMapper | undefined\n): WorkflowNodeDefinition {\n const key = deriveWorkflowNodeKey(step.id)\n assertNodeKey(workflowId, step.id, key)\n assertUniqueNode(workflowId, nodes, step.id, key)\n\n return {\n type: \"step\",\n id: step.id,\n key,\n step,\n ...(mapper !== undefined ? { mapper } : {}),\n }\n}\n\nfunction createAgentNode(\n workflowId: string,\n nodes: readonly WorkflowNodeDefinition[],\n agentStep: AgentStepDefinition,\n mapper: RuntimeWorkflowMapper | undefined\n): WorkflowNodeDefinition {\n const key = deriveWorkflowNodeKey(agentStep.id)\n assertNodeKey(workflowId, agentStep.id, key)\n assertUniqueNode(workflowId, nodes, agentStep.id, key)\n\n return {\n type: \"agent\",\n id: agentStep.id,\n key,\n agentStep,\n ...(mapper !== undefined ? { mapper } : {}),\n }\n}\n\nfunction createInterventionDefinition(input: {\n readonly id: string\n readonly input: RuntimeWorkflowInput\n readonly response: Record<string, unknown>\n readonly description?: string\n}): unknown {\n const base = {\n kind: \"intervention\" as const,\n id: input.id,\n input: input.input,\n response: input.response,\n ...(input.description !== undefined ? { description: input.description } : {}),\n }\n\n const defaults = (handlerOrContext: unknown) => {\n if (typeof handlerOrContext === \"function\") {\n return {\n ...base,\n defaults: handlerOrContext as InterventionDefaultsRuntimeHandler,\n }\n }\n\n // A no-defaults intervention is still usable as a definition immediately after\n // `.response(...)`. Treating the builder method as an empty default handler keeps\n // future executor code simple if it calls `definition.defaults?.(ctx) ?? {}`.\n return {}\n }\n\n Object.defineProperty(base, \"defaults\", {\n value: defaults,\n enumerable: false,\n })\n\n return base\n}\n\nfunction createActionNode(\n workflowId: string,\n nodes: readonly WorkflowNodeDefinition[],\n action: ActionDefinition,\n mapper: RuntimeWorkflowMapper | undefined\n): WorkflowNodeDefinition {\n const key = deriveWorkflowNodeKey(action.id)\n assertNodeKey(workflowId, action.id, key)\n assertUniqueNode(workflowId, nodes, action.id, key)\n\n return {\n type: \"action\",\n id: action.id,\n key,\n action,\n ...(mapper !== undefined ? { mapper } : {}),\n }\n}\n\nfunction createInterventionNode(\n workflowId: string,\n nodes: readonly WorkflowNodeDefinition[],\n intervention: InterventionDefinition,\n mapper: RuntimeWorkflowMapper | undefined\n): WorkflowNodeDefinition {\n const key = deriveWorkflowNodeKey(intervention.id)\n assertNodeKey(workflowId, intervention.id, key)\n assertUniqueNode(workflowId, nodes, intervention.id, key)\n\n return {\n type: \"intervention\",\n id: intervention.id,\n key,\n intervention,\n ...(mapper !== undefined ? { mapper } : {}),\n } as WorkflowNodeDefinition\n}\n\nfunction assertNodeKey(workflowId: string, nodeId: string, key: string): void {\n if (key.length === 0) {\n throw new WorkflowDefinitionError(\n `Workflow \"${workflowId}\" node id \"${nodeId}\" must contain at least one letter or number.`\n )\n }\n}\n\nfunction assertUniqueNode(\n workflowId: string,\n nodes: readonly WorkflowNodeDefinition[],\n nodeId: string,\n key: string\n): void {\n const duplicateId = nodes.find((node) => node.id === nodeId)\n if (duplicateId) {\n throw new WorkflowDefinitionError(\n `Duplicate workflow node id \"${nodeId}\" in workflow \"${workflowId}\".`\n )\n }\n\n const duplicateKey = nodes.find((node) => node.key === key)\n if (duplicateKey) {\n throw new WorkflowDefinitionError(\n `Duplicate workflow node key \"${key}\" in workflow \"${workflowId}\". Node ids \"${duplicateKey.id}\" and \"${nodeId}\" derive the same key.`\n )\n }\n}\n\nfunction deriveWorkflowNodeKey(id: string): string {\n const segments = id\n .trim()\n .split(/[^A-Za-z0-9]+/)\n .filter((segment) => segment.length > 0)\n\n return segments\n .map((segment, index) => {\n const normalized = uncapitalize(segment)\n return index === 0 ? normalized : capitalize(normalized)\n })\n .join(\"\")\n}\n\nfunction uncapitalize(value: string): string {\n return value.length === 0 ? value : `${value[0].toLowerCase()}${value.slice(1)}`\n}\n\nfunction capitalize(value: string): string {\n return value.length === 0 ? value : `${value[0].toUpperCase()}${value.slice(1)}`\n}\n\nfunction isRuntimeWorkflowMapper(value: unknown): value is RuntimeWorkflowMapper {\n return typeof value === \"function\"\n}\n\nfunction isRuntimeWorkflowScheduleMapper(value: unknown): value is RuntimeWorkflowScheduleMapper {\n return typeof value === \"function\"\n}\n\nfunction isRecord(value: unknown): value is Readonly<Record<string, unknown>> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n",
|
|
7
|
-
"import { withFailureMessage } from \"../errors/failure-message\"\nimport { createSixbError, isSixbError, summarizeErrorMessage } from \"../errors/internal\"\nimport {\n ModelProviderError,\n StructuredOutputError,\n UnsupportedModelFeatureError,\n} from \"../models/errors\"\n\ninterface WorkflowNodeFailureIdentityBase {\n readonly workflowId: string\n readonly workflowRunId: string\n readonly nodeId: string\n readonly nodeRunId?: string\n readonly failurePhase?: \"output-preflight\" | \"agent-loop\" | \"structured-finalizer\"\n readonly modelId?: string\n}\n\nexport interface WorkflowNodeFailureIdentity extends WorkflowNodeFailureIdentityBase {\n readonly child:\n | { readonly type: \"step\"; readonly stepId: string }\n | {\n readonly type: \"action\"\n readonly actionId: string\n readonly actionRunId?: string\n }\n | { readonly type: \"agent\"; readonly agentStepId: string }\n | { readonly type: \"intervention\"; readonly interventionId: string }\n}\n\n/** Translate a node-local failure into the workflow primitive's durable vocabulary. */\nexport function createWorkflowNodeFailure(error: unknown, identity: WorkflowNodeFailureIdentity) {\n const modelDetails = safeModelFailureDetails(error)\n const failure = createSixbError(\n \"workflow.node_failed\",\n summarizeErrorMessage(error, \"Workflow node execution failed.\"),\n {\n cause: error,\n details: {\n ...workflowNodeFailureDetails(identity),\n ...modelDetails,\n },\n }\n )\n return modelDetails.modelFailure\n ? withFailureMessage(failure, modelDetails.modelFailure.message)\n : failure\n}\n\n/** Only controlled diagnostics cross the durable boundary; provider messages/output stay private. */\nfunction safeModelFailureDetails(error: unknown): {\n modelFailure?: { source: string; reason: string; message: string; status?: number }\n} {\n if (error instanceof UnsupportedModelFeatureError) {\n const reason = error.reason ?? \"unsupported-feature\"\n const messages = {\n \"unsupported-feature\":\n \"The adapter cannot support a requested model feature. Check provider configuration.\",\n \"unsupported-model\":\n \"The model is configured without structured-output support. Choose a supported model.\",\n \"unsupported-schema\":\n \"The output schema is incompatible with the adapter. Use valid JSON Schema types, require every property, and disallow additional properties.\",\n }\n return { modelFailure: { source: \"adapter\", reason, message: messages[reason] } }\n }\n if (error instanceof ModelProviderError) {\n // Interpret only known machine codes, never provider prose (which can echo private inputs).\n const schemaRejected = error.code === \"invalid_json_schema\" || error.code === \"invalid_schema\"\n const modelRejected = error.code === \"model_not_supported\" || error.code === \"unsupported_model\"\n return {\n modelFailure: {\n source: \"provider\",\n reason: schemaRejected\n ? \"unsupported-schema\"\n : modelRejected\n ? \"unsupported-model\"\n : \"provider-rejection\",\n message: schemaRejected\n ? \"The model endpoint rejected the supplied schema. Check the routed provider's supported JSON Schema subset.\"\n : modelRejected\n ? \"The model endpoint does not support the requested model configuration. Choose a supported model or route.\"\n : \"The model endpoint rejected the request or failed its response. Check provider diagnostics for model, schema, authentication, or availability errors.\",\n ...(error.status === undefined ? {} : { status: error.status }),\n },\n }\n }\n if (error instanceof StructuredOutputError) {\n return {\n modelFailure: {\n source: \"validation\",\n reason: \"invalid-output\",\n message:\n \"The model response did not complete with valid output matching the workflow schema.\",\n },\n }\n }\n return {}\n}\n\n/** Recover the native child error for direct callers and error-monitoring integrations. */\nexport function unwrapWorkflowNodeFailure(error: unknown): unknown {\n return isSixbError(error) && error.code === \"workflow.node_failed\" && error.cause !== undefined\n ? error.cause\n : error\n}\n\nfunction workflowNodeFailureDetails(identity: WorkflowNodeFailureIdentity) {\n const base = {\n workflowId: identity.workflowId,\n workflowRunId: identity.workflowRunId,\n nodeId: identity.nodeId,\n ...(identity.nodeRunId ? { nodeRunId: identity.nodeRunId } : {}),\n ...(identity.failurePhase ? { failurePhase: identity.failurePhase } : {}),\n ...(identity.modelId ? { modelId: identity.modelId } : {}),\n }\n\n switch (identity.child.type) {\n case \"step\":\n return { ...base, stepId: identity.child.stepId }\n case \"action\":\n return {\n ...base,\n actionId: identity.child.actionId,\n ...(identity.child.actionRunId ? { actionRunId: identity.child.actionRunId } : {}),\n }\n case \"agent\":\n return { ...base, agentStepId: identity.child.agentStepId }\n case \"intervention\":\n return { ...base, interventionId: identity.child.interventionId }\n }\n}\n"
|
|
8
|
-
],
|
|
9
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACO,SAAS,yBAAwB,CAAC,YAAoB,QAAwB;AAAA,EACnF,OAAO,YAAY,mBAAmB,UAAU,UAAU,mBAAmB,MAAM;AAAA;;ACkF9E,SAAS,kBAAiB,CAC/B,QACA,SACyB;AAAA,EACzB,OAAO;AAAA,IACL;AAAA,IACA,UAAU,SAAS,YAAY;AAAA,OAC3B,SAAS,gBAAgB,YAAY,EAAE,aAAa,QAAQ,YAAY,IAAI,CAAC;AAAA,EACnF;AAAA;AAGK,SAAS,mBAA4C,CAAC,IAA2B;AAAA,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O;AAAA,WACF;AAAA,QACH,UAAU,SAAS,MAAM;AAAA,WACrB,SAAS,MAAM,cAAc,EAAE,aAAa,SAAS,MAAM,YAAY,IAAI,CAAC;AAAA,MAClF;AAAA,SACG;AAAA,MACH,OAAO,KAAK,MAAM,aAAa,SAAS,MAAM,YAAY;AAAA,SACvD;AAAA,MACH,OAAO,KAAK,MAAM,gBAAgB,SAAS,MAAM,eAAe;AAAA;AAAA;",
|
|
10
|
-
"debugId": "D1CD60C678E35B5164756E2164756E21",
|
|
11
|
-
"names": []
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/security/redactions.ts", "../src/objects/property-clearance.ts", "../src/agents/authority.ts", "../src/storage/workflow-runs/errors.ts", "../src/storage/workflow-runs/provider.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { Redactions } from \"./types\"\n\n/** List the values hidden from a reader that lacks a clearance for their markings. */\nexport function missingClearanceRedactions(ids: Iterable<string>): Redactions {\n return Object.fromEntries([...ids].map((id) => [id, { reason: \"missing_clearance\" }] as const))\n}\n",
|
|
6
|
-
"import { AuthorizationError } from \"../authorization/errors\"\nimport type { StoredDomainEvent } from \"../events/types\"\nimport type { OntologyDefinitionCatalog } from \"../ontology/registry\"\nimport { missingClearanceRedactions } from \"../security/redactions\"\nimport type { ExpandedLinkValue, ExpandedObjectRow, ObjectRow } from \"../storage\"\nimport type {\n ObjectQueryAdmissionState,\n ObjectQueryPropertyUse,\n ObjectQuerySemanticAdmission,\n} from \"./query/validate\"\n\n/**\n * The marked properties one reader cannot read, resolved once from its clearances.\n *\n * A property is readable when the reader clears every one of its markings. Unreadable properties\n * are omitted from rows and cannot be used to select, order, or aggregate objects.\n */\nexport interface PropertyClearance {\n /** Marked properties of this object type the reader cannot read. */\n hiddenPropertyIds(objectTypeId: string): ReadonlySet<string>\n /** First marking on the property that the reader is not cleared for. */\n missingMarking(objectTypeId: string, propertyId: string): string | undefined\n}\n\nconst NO_PROPERTIES: ReadonlySet<string> = new Set()\n\n// Readers are built per execution, but few distinct clearance sets exist per ontology.\nconst clearancesByOntology = new WeakMap<\n OntologyDefinitionCatalog,\n Map<string, PropertyClearance | undefined>\n>()\n\n/**\n * Resolve what a reader with these clearances cannot read. Returns `undefined` when it can read\n * every property, so callers skip redaction entirely.\n */\nexport function resolvePropertyClearance(\n ontology: OntologyDefinitionCatalog,\n clearances: ReadonlySet<string>\n): PropertyClearance | undefined {\n let resolved = clearancesByOntology.get(ontology)\n if (!resolved) {\n resolved = new Map()\n clearancesByOntology.set(ontology, resolved)\n }\n const key = JSON.stringify([...clearances].sort())\n if (!resolved.has(key)) resolved.set(key, createPropertyClearance(ontology, clearances))\n return resolved.get(key)\n}\n\nfunction createPropertyClearance(\n ontology: OntologyDefinitionCatalog,\n clearances: ReadonlySet<string>\n): PropertyClearance | undefined {\n const missingByType = new Map<string, ReadonlyMap<string, string>>()\n for (const objectType of ontology.listObjectTypes()) {\n const missing = new Map<string, string>()\n for (const property of objectType.properties) {\n const marking = property.markings?.find((markingId) => !clearances.has(markingId))\n if (marking !== undefined) missing.set(property.id, marking)\n }\n if (missing.size > 0) missingByType.set(objectType.id, missing)\n }\n if (missingByType.size === 0) return undefined\n\n const hiddenByType = new Map(\n [...missingByType].map(([objectTypeId, missing]) => [objectTypeId, new Set(missing.keys())])\n )\n return Object.freeze({\n hiddenPropertyIds: (objectTypeId: string) => hiddenByType.get(objectTypeId) ?? NO_PROPERTIES,\n missingMarking: (objectTypeId: string, propertyId: string) =>\n missingByType.get(objectTypeId)?.get(propertyId),\n })\n}\n\n/**\n * Omit unreadable properties from a row and the objects expanded under it.\n *\n * Every hidden property of the type is listed in `redactions`, whether or not the row holds a\n * value: listing only present values would reveal which hidden properties are empty.\n */\nexport function redactObjectRow<TRow extends ObjectRow>(\n row: TRow,\n clearance: PropertyClearance\n): TRow {\n const hidden = clearance.hiddenPropertyIds(row.objectTypeId)\n const links = row.links\n if (hidden.size === 0 && links === undefined) return row\n\n const redacted: TRow = { ...row }\n if (hidden.size > 0) {\n redacted.properties = withoutKeys(row.properties, hidden)\n redacted.redactions = missingClearanceRedactions(hidden)\n }\n if (links !== undefined) {\n redacted.links = Object.fromEntries(\n Object.entries(links).map(([linkId, value]) => [linkId, redactLinkValue(value, clearance)])\n )\n }\n return redacted\n}\n\nfunction redactLinkValue(\n value: ExpandedLinkValue,\n clearance: PropertyClearance\n): ExpandedLinkValue {\n if (value === null) return null\n if (Array.isArray(value)) return value.map((row) => redactObjectRow(row, clearance))\n // Array.isArray does not narrow a readonly[] away, so assert the single-object case.\n return redactObjectRow(value as ExpandedObjectRow, clearance)\n}\n\n/**\n * Omit unreadable properties from an object event, under the same contract as rows. Other events\n * carry no markable value: link properties and telemetry properties cannot be marked.\n */\nexport function redactDomainEvent(\n event: StoredDomainEvent,\n clearance: PropertyClearance\n): StoredDomainEvent {\n if (event.topic !== \"objects\") return event\n const hidden = clearance.hiddenPropertyIds(event.payload.objectTypeId)\n if (hidden.size === 0) return event\n\n const payload = {\n ...event.payload,\n propertyChanges: withoutKeys(event.payload.propertyChanges, hidden),\n redactions: missingClearanceRedactions(hidden),\n }\n if (event.type === \"object.deleted\") return { ...event, payload }\n return {\n ...event,\n payload: { ...payload, properties: withoutKeys(event.payload.properties, hidden) },\n }\n}\n\nfunction withoutKeys<TValue>(\n record: Readonly<Record<string, TValue>>,\n hidden: ReadonlySet<string>\n): Record<string, TValue> {\n const kept: Record<string, TValue> = {}\n for (const [key, value] of Object.entries(record)) {\n if (!hidden.has(key)) kept[key] = value\n }\n return kept\n}\n\n/**\n * Reject every query use of a property the reader cannot read, except projection.\n *\n * Filtering, ordering, searching, or faceting by a hidden value would reveal it through which\n * objects match and in what order. Projection only shapes the output, which is redacted anyway.\n */\nexport function createClearanceQueryAdmission(\n clearance: PropertyClearance\n): ObjectQuerySemanticAdmission {\n // Each state stands for the object types a query has reached so far. A property without an\n // explicit type is checked against all of them.\n const reachedTypes = new WeakMap<ObjectQueryAdmissionState, readonly string[]>()\n const state = (objectTypeIds: readonly string[]): ObjectQueryAdmissionState => {\n const created = Object.freeze({})\n reachedTypes.set(created, Object.freeze([...objectTypeIds]))\n return created\n }\n const reached = (input: ObjectQueryAdmissionState): readonly string[] => {\n const objectTypeIds = reachedTypes.get(input)\n if (!objectTypeIds) {\n throw new Error(\"[Sixb] Clearance query admission received a state it did not create.\")\n }\n return objectTypeIds\n }\n const empty = state([])\n\n const admission: ObjectQuerySemanticAdmission = {\n empty: () => empty,\n source: (input) => ({ state: state(input.result.objectTypeIds) }),\n edge: (input) => ({ state: state(input.result.objectTypeIds) }),\n // A difference only returns objects of its first input.\n set: (input) =>\n input.op === \"subtract\"\n ? (input.states[0] ?? empty)\n : state([...new Set(input.states.flatMap(reached))]),\n property: (input) => {\n if (input.use === \"project\") return undefined\n const objectTypeIds =\n input.objectTypeId === undefined ? reached(input.state) : [input.objectTypeId]\n for (const objectTypeId of objectTypeIds) {\n const marking = clearance.missingMarking(objectTypeId, input.propertyId)\n if (marking === undefined) continue\n return new AuthorizationError(\n `clearance:marking:${marking}`,\n `[Sixb] Cannot ${PROPERTY_USE_VERBS[input.use]} '${objectTypeId}.${input.propertyId}' at '${input.path}': it requires clearance for marking '${marking}'.`\n )\n }\n return undefined\n },\n }\n return Object.freeze(admission)\n}\n\nconst PROPERTY_USE_VERBS: Readonly<Record<ObjectQueryPropertyUse, string>> = {\n filter: \"filter by\",\n text: \"search\",\n vector: \"run a vector search over\",\n sort: \"sort by\",\n project: \"project\",\n \"expand.orderBy\": \"order expanded objects by\",\n facet: \"facet by\",\n}\n",
|
|
7
|
-
"import { principalsEqual, SYSTEM_PRINCIPAL } from \"../auth\"\nimport type { AuthorizationContext } from \"../authorization\"\nimport { resolveAuthorizationContext } from \"../authorization\"\nimport { createSixbError } from \"../errors/internal\"\nimport type { AuthorizablePrincipal, AuthorizationRef } from \"../execution\"\nimport { type PropertyClearance, resolvePropertyClearance } from \"../objects/property-clearance\"\nimport type { OntologyDefinitionCatalog } from \"../ontology/registry\"\nimport type { SecurityDefinitionCatalog } from \"../security\"\nimport type {\n AccessTokenRecord,\n AuthStorage,\n ServiceAccountGroupMembershipRecord,\n ServiceAccountRecord,\n SessionRecord,\n UserRecord,\n} from \"../storage/auth\"\nimport { AuthStorageError } from \"../storage/auth\"\nimport { agentServiceAccountId } from \"./identity\"\n\nexport type AgentExecutionAuthorization =\n | { readonly type: \"principal\"; readonly context: AuthorizationContext }\n | { readonly type: \"disabled\" }\n\n/**\n * The marked properties an Agent execution cannot read, resolved exactly as its object reader\n * resolves them. Disabled authorization reads everything.\n */\nexport function resolveAgentPropertyClearance(\n ontology: OntologyDefinitionCatalog,\n authorization: AgentExecutionAuthorization\n): PropertyClearance | undefined {\n return authorization.type === \"principal\"\n ? resolvePropertyClearance(ontology, authorization.context.clearances ?? new Set())\n : undefined\n}\n\ntype UserCredentialRef = NonNullable<\n Extract<AuthorizationRef, { readonly type: \"principal\" }>[\"credential\"]\n>\n\ninterface CredentialedUserAuthorizationRef {\n readonly type: \"principal\"\n readonly principal: Extract<AuthorizablePrincipal, { readonly type: \"user\" }>\n readonly credential: UserCredentialRef\n}\n\nexport { agentServiceAccountId } from \"./identity\"\n\nexport interface AgentExecutionIdentity {\n readonly serviceAccount: ServiceAccountRecord\n readonly principal: Extract<AuthorizablePrincipal, { readonly type: \"serviceAccount\" }>\n readonly groupMemberships: readonly ServiceAccountGroupMembershipRecord[]\n}\n\n/** Ensure a framework-managed Agent actor exists with exactly its declared group memberships. */\nexport async function ensureManagedAgentExecutionIdentity(input: {\n readonly auth: AuthStorage | undefined\n readonly projectId: string\n readonly actorId: string\n readonly name: string\n readonly description: string\n readonly groupIds: readonly string[]\n}): Promise<AgentExecutionIdentity> {\n const auth = requireAuthStorage(input.auth)\n const id = agentServiceAccountId(input.actorId)\n const now = new Date()\n const loaded = await loadOrCreateAgentServiceAccount(auth, {\n id,\n projectId: input.projectId,\n name: input.name,\n description: input.description,\n updatedAt: now,\n })\n assertFrameworkManagedAgentServiceAccount(input.actorId, loaded)\n assertActiveAgentServiceAccount(input.actorId, loaded)\n const serviceAccount = await updateAgentServiceAccountMetadata(auth, {\n existing: loaded,\n name: input.name,\n description: input.description,\n updatedAt: now,\n })\n assertActiveAgentServiceAccount(input.actorId, serviceAccount)\n\n const groupMemberships = requireDefinitionOwnedGroupMemberships(\n input.actorId,\n await auth.serviceAccountGroupMemberships.reconcileForServiceAccount({\n projectId: input.projectId,\n serviceAccountId: id,\n groupIds: input.groupIds,\n source: \"agent\",\n updatedAt: now,\n })\n )\n\n return {\n serviceAccount,\n principal: { type: \"serviceAccount\", id },\n groupMemberships,\n }\n}\n\n/** Load the managed identity, recovering only the expected concurrent-create race. */\nasync function loadOrCreateAgentServiceAccount(\n auth: AuthStorage,\n input: {\n readonly id: string\n readonly projectId: string\n readonly name: string\n readonly description: string\n readonly updatedAt: Date\n }\n): Promise<ServiceAccountRecord> {\n const existing = await auth.serviceAccounts.getById({\n projectId: input.projectId,\n id: input.id,\n })\n if (existing) return existing\n\n try {\n return await auth.serviceAccounts.create({\n id: input.id,\n projectId: input.projectId,\n name: input.name,\n description: input.description,\n status: \"active\",\n createdByPrincipal: SYSTEM_PRINCIPAL,\n createdAt: input.updatedAt,\n updatedAt: input.updatedAt,\n })\n } catch (error) {\n if (!(error instanceof AuthStorageError) || error.code !== \"duplicate_service_account\") {\n throw error\n }\n const concurrent = await auth.serviceAccounts.getById({\n projectId: input.projectId,\n id: input.id,\n })\n if (!concurrent) throw error\n return concurrent\n }\n}\n\nfunction assertActiveAgentServiceAccount(\n actorId: string,\n serviceAccount: ServiceAccountRecord\n): void {\n if (serviceAccount.status === \"suspended\") {\n throw new Error(\n `[Sixb] Agent '${actorId}' service account '${serviceAccount.id}' is suspended.`\n )\n }\n}\n\nfunction assertFrameworkManagedAgentServiceAccount(\n actorId: string,\n serviceAccount: ServiceAccountRecord\n): void {\n if (\n serviceAccount.createdByPrincipal === undefined ||\n !principalsEqual(serviceAccount.createdByPrincipal, SYSTEM_PRINCIPAL)\n ) {\n throw createSixbError(\n \"agent.execution_failed\",\n `[Sixb] Agent '${actorId}' cannot use service account '${serviceAccount.id}' because it is not managed by Sixb.`,\n { details: { actorId, serviceAccountId: serviceAccount.id } }\n )\n }\n}\n\nfunction requireDefinitionOwnedGroupMemberships(\n actorId: string,\n memberships: readonly ServiceAccountGroupMembershipRecord[]\n): readonly ServiceAccountGroupMembershipRecord[] {\n const externalGroupIds = memberships\n .filter((membership) => membership.source !== \"agent\")\n .map((membership) => membership.groupId)\n if (externalGroupIds.length > 0) {\n throw createSixbError(\n \"agent.execution_failed\",\n `[Sixb] Agent '${actorId}' service account has group memberships not managed by its definition: ${externalGroupIds.join(\", \")}.`,\n { details: { actorId, externalGroupIds } }\n )\n }\n return memberships\n}\n\n/** Resolve current grants for the service account referenced by a durable Agent execution. */\nexport async function resolveAgentExecutionAuthorization(input: {\n readonly auth: AuthStorage | undefined\n readonly projectId: string\n readonly actorId: string\n readonly authorizationRef: AuthorizationRef\n readonly security: SecurityDefinitionCatalog\n}): Promise<{ readonly identity: AgentExecutionIdentity; readonly context: AuthorizationContext }> {\n const auth = requireAuthStorage(input.auth)\n const expectedId = agentServiceAccountId(input.actorId)\n const principal =\n input.authorizationRef.type === \"principal\" ? input.authorizationRef.principal : null\n if (principal?.type !== \"serviceAccount\" || principal.id !== expectedId) {\n throw new Error(\n `[Sixb] Agent '${input.actorId}' execution authority must reference service account '${expectedId}'.`\n )\n }\n\n const serviceAccount = await auth.serviceAccounts.getById({\n projectId: input.projectId,\n id: principal.id,\n })\n if (!serviceAccount || serviceAccount.status !== \"active\") {\n throw new Error(`[Sixb] Agent service account '${principal.id}' is not active.`)\n }\n assertFrameworkManagedAgentServiceAccount(input.actorId, serviceAccount)\n\n const groupMemberships = requireDefinitionOwnedGroupMemberships(\n input.actorId,\n await auth.serviceAccountGroupMemberships.listForServiceAccount({\n projectId: input.projectId,\n serviceAccountId: principal.id,\n })\n )\n const identity: AgentExecutionIdentity = {\n serviceAccount,\n principal: { type: \"serviceAccount\", id: principal.id },\n groupMemberships,\n }\n return {\n identity,\n context: resolveAuthorizationContext({\n principal: identity.principal,\n groupIds: groupMemberships.map((membership) => membership.groupId),\n roles: input.security.listResolvedRoles(),\n }),\n }\n}\n\n/** Revalidate the durable user authority inherited by a conversational or child Agent. */\nexport async function resolveInheritedAgentExecutionAuthorization(input: {\n readonly auth: AuthStorage | undefined\n readonly projectId: string\n readonly authorizationRef: AuthorizationRef\n readonly security: SecurityDefinitionCatalog\n readonly now?: Date\n}): Promise<AgentExecutionAuthorization> {\n if (input.authorizationRef.type === \"disabled\") return { type: \"disabled\" }\n\n const ref = requireCredentialedUserAuthority(input.authorizationRef)\n const auth = requireAuthStorage(input.auth)\n const now = input.now ?? new Date()\n const user = await requireActiveUser(auth, input.projectId, ref.principal.id)\n const memberships = await auth.groupMemberships.listForUser({\n projectId: input.projectId,\n userId: user.id,\n })\n const credential = await revalidateUserCredential({\n auth,\n projectId: input.projectId,\n userId: user.id,\n credential: ref.credential,\n currentGroupIds: memberships.map((membership) => membership.groupId),\n now,\n })\n\n return {\n type: \"principal\",\n context: resolveAuthorizationContext({\n principal: ref.principal,\n groupIds: credential.groupIds,\n roles: input.security.listResolvedRoles(),\n ...(credential.sessionId === undefined ? {} : { sessionId: credential.sessionId }),\n }),\n }\n}\n\nfunction requireCredentialedUserAuthority(ref: AuthorizationRef): CredentialedUserAuthorizationRef {\n if (ref.type !== \"principal\" || ref.principal.type !== \"user\" || ref.credential === undefined) {\n throw invalidInheritedAuthority(\"the durable reference is not a credentialed user\")\n }\n return {\n type: \"principal\",\n principal: { type: \"user\", id: ref.principal.id },\n credential: { type: ref.credential.type, id: ref.credential.id },\n }\n}\n\nasync function requireActiveUser(\n auth: AuthStorage,\n projectId: string,\n userId: string\n): Promise<UserRecord> {\n const user = await auth.users.getById({ projectId, id: userId })\n if (!user || user.status !== \"active\") {\n throw invalidInheritedAuthority(`user '${userId}' is not active`)\n }\n return user\n}\n\nasync function revalidateUserCredential(input: {\n readonly auth: AuthStorage\n readonly projectId: string\n readonly userId: string\n readonly credential: UserCredentialRef\n readonly currentGroupIds: readonly string[]\n readonly now: Date\n}): Promise<{ readonly groupIds: readonly string[]; readonly sessionId?: string }> {\n if (input.credential.type === \"session\") {\n const session = await input.auth.sessions.getById({\n projectId: input.projectId,\n id: input.credential.id,\n })\n if (!isUsableUserSession(session, input.userId, input.now)) {\n throw invalidInheritedAuthority(\"the inherited session is no longer valid\")\n }\n return { groupIds: input.currentGroupIds, sessionId: session.id }\n }\n\n const accessToken = await input.auth.accessTokens.getById({\n projectId: input.projectId,\n id: input.credential.id,\n })\n if (!isUsableUserAccessToken(accessToken, input.userId, input.now)) {\n throw invalidInheritedAuthority(\"the inherited access token is no longer valid\")\n }\n if (accessToken.groupIds === undefined) return { groupIds: input.currentGroupIds }\n\n const allowedGroupIds = new Set(accessToken.groupIds)\n return {\n groupIds: input.currentGroupIds.filter((groupId) => allowedGroupIds.has(groupId)),\n }\n}\n\nfunction isUsableUserSession(\n session: SessionRecord | null,\n userId: string,\n now: Date\n): session is SessionRecord {\n if (!session || session.userId !== userId || session.revokedAt !== undefined) return false\n if (session.expiresAt.getTime() <= now.getTime()) return false\n return (\n session.absoluteExpiresAt === undefined || session.absoluteExpiresAt.getTime() > now.getTime()\n )\n}\n\nfunction isUsableUserAccessToken(\n token: AccessTokenRecord | null,\n userId: string,\n now: Date\n): token is AccessTokenRecord {\n if (!token || !principalsEqual(token.subject, { type: \"user\", id: userId })) return false\n return token.revokedAt === undefined && token.expiresAt.getTime() > now.getTime()\n}\n\nfunction invalidInheritedAuthority(reason: string): Error {\n return createSixbError(\n \"agent.execution_failed\",\n `[Sixb] The Agent execution cannot restore its inherited authority: ${reason}.`\n )\n}\n\nfunction requireAuthStorage(auth: AuthStorage | undefined): AuthStorage {\n if (!auth) {\n throw new Error(\"[Sixb] Agent executions require auth storage.\")\n }\n return auth\n}\n\nasync function updateAgentServiceAccountMetadata(\n auth: AuthStorage,\n input: {\n readonly existing: ServiceAccountRecord\n readonly name: string\n readonly description: string\n readonly updatedAt: Date\n }\n): Promise<ServiceAccountRecord> {\n if (input.existing.name === input.name && input.existing.description === input.description) {\n return input.existing\n }\n return auth.serviceAccounts.update({\n projectId: input.existing.projectId,\n id: input.existing.id,\n name: input.name,\n description: input.description,\n updatedAt: input.updatedAt,\n })\n}\n",
|
|
8
|
-
"/**\n * Base error for workflow-run storage operations.\n */\nexport class WorkflowRunError extends Error {\n readonly name = \"WorkflowRunError\"\n}\n",
|
|
9
|
-
"import { agentServiceAccountId } from \"../../agents/authority\"\nimport type { ExecutionStorage } from \"../executions\"\nimport { findAgentRunExecution, findPrimitiveRunExecution } from \"../executions/run-link\"\nimport { WorkflowRunError } from \"./errors\"\n\n/** Validate the semantic link between a durable workflow run and its immutable execution. */\nexport async function assertWorkflowRunExecution(input: {\n readonly executions: ExecutionStorage\n readonly projectId: string\n readonly executionId: string\n readonly runId: string\n readonly workflowId: string\n}): Promise<void> {\n const execution = await findPrimitiveRunExecution({\n executions: input.executions,\n projectId: input.projectId,\n executionId: input.executionId,\n primitive: { kind: \"workflow\", id: input.workflowId, runId: input.runId },\n sourceTypes: [\"execution\", \"schedule\", \"event\"],\n })\n if (!execution) {\n invalidExecution(input.executionId, input.runId)\n }\n\n if (execution.source.type === \"schedule\" || execution.source.type === \"event\") {\n if (execution.requestedBy !== undefined) {\n invalidExecution(input.executionId, input.runId)\n }\n return\n }\n\n // ExecutionStorage already validates the immutable parent reference, correlation id, and\n // requested-by propagation. This boundary only owns the workflow-specific source restriction.\n if (execution.source.type !== \"execution\") {\n invalidExecution(input.executionId, input.runId)\n }\n}\n\n/** Validate the semantic link between a Workflow Agent-node run and its child execution. */\nexport async function assertWorkflowAgentNodeRunExecution(input: {\n readonly executions: ExecutionStorage\n readonly projectId: string\n readonly executionId: string\n readonly nodeRunId: string\n readonly actorId: string\n readonly workflowExecutionId: string\n}): Promise<void> {\n const execution = await findAgentRunExecution({\n executions: input.executions,\n projectId: input.projectId,\n executionId: input.executionId,\n runId: input.nodeRunId,\n authority: { type: \"managed\", serviceAccountId: agentServiceAccountId(input.actorId) },\n })\n if (\n !execution ||\n execution.source.type !== \"execution\" ||\n execution.source.executionId !== input.workflowExecutionId\n ) {\n throw new WorkflowRunError(\n `[Sixb] Execution '${input.executionId}' does not authorize Workflow Agent-node run '${input.nodeRunId}'.`\n )\n }\n}\n\nfunction invalidExecution(executionId: string, runId: string): never {\n throw new WorkflowRunError(\n `[Sixb] Execution '${executionId}' does not authorize workflow run '${runId}'.`\n )\n}\n"
|
|
10
|
-
],
|
|
11
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAGO,SAAS,0BAA0B,CAAC,KAAmC;AAAA,EAC5E,OAAO,OAAO,YAAY,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,oBAAoB,CAAC,CAAU,CAAC;AAAA;;;ACoBhG,IAAM,gBAAqC,IAAI;AAG/C,IAAM,uBAAuB,IAAI;AAS1B,SAAS,wBAAwB,CACtC,UACA,YAC+B;AAAA,EAC/B,IAAI,WAAW,qBAAqB,IAAI,QAAQ;AAAA,EAChD,IAAI,CAAC,UAAU;AAAA,IACb,WAAW,IAAI;AAAA,IACf,qBAAqB,IAAI,UAAU,QAAQ;AAAA,EAC7C;AAAA,EACA,MAAM,MAAM,KAAK,UAAU,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC;AAAA,EACjD,IAAI,CAAC,SAAS,IAAI,GAAG;AAAA,IAAG,SAAS,IAAI,KAAK,wBAAwB,UAAU,UAAU,CAAC;AAAA,EACvF,OAAO,SAAS,IAAI,GAAG;AAAA;AAGzB,SAAS,uBAAuB,CAC9B,UACA,YAC+B;AAAA,EAC/B,MAAM,gBAAgB,IAAI;AAAA,EAC1B,WAAW,cAAc,SAAS,gBAAgB,GAAG;AAAA,IACnD,MAAM,UAA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AAiB,MAAM,aAAa,MAAM,KAAK;AAAA,EACjD;AAAA,EAEA,IAAI,UAAU,OAAO,SAAS,cAAc,UAAU,OAAO,SAAS,SAAS;AAAA,IAC7E,IAAI,UAAU,gBAAgB,WAAW;AAAA,MACvC,iBAAiB,MAAM,aAAa,MAAM,KAAK;AAAA,IACjD;AAAA,IACA;AAAA,EACF;AAAA,EAIA,IAAI,UAAU,OAAO,SAAS,aAAa;AAAA,IACzC,iBAAiB,MAAM,aAAa,MAAM,KAAK;AAAA,EACjD;AAAA;AAIF,eAAsB,oCAAmC,CAAC,OAOxC;AAAA,EAChB,MAAM,YAAY,MAAM,sBAAsB;AAAA,IAC5C,YAAY,MAAM;AAAA,IAClB,WAAW,MAAM;AAAA,IACjB,aAAa,MAAM;AAAA,IACnB,OAAO,MAAM;AAAA,IACb,WAAW,EAAE,MAAM,WAAW,kBAAkB,uBAAsB,MAAM,OAAO,EAAE;AAAA,EACvF,CAAC;AAAA,EACD,IACE,CAAC,aACD,UAAU,OAAO,SAAS,eAC1B,UAAU,OAAO,gBAAgB,MAAM,qBACvC;AAAA,IACA,MAAM,IAAI,kBACR,qBAAqB,MAAM,4DAA4D,MAAM,aAC/F;AAAA,EACF;AAAA;AAGF,SAAS,gBAAgB,CAAC,aAAqB,OAAsB;AAAA,EACnE,MAAM,IAAI,kBACR,qBAAqB,iDAAiD,SACxE;AAAA;",
|
|
12
|
-
"debugId": "86420060B98AACE864756E2164756E21",
|
|
13
|
-
"names": []
|
|
14
|
-
}
|
package/dist/chunk-s16apyk9.js
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
ACTION_RUN_PHASES2,
|
|
4
|
-
parseActionRunFailure2
|
|
5
|
-
} from "./chunk-b38szspf.js";
|
|
6
|
-
import {
|
|
7
|
-
isFileRef2
|
|
8
|
-
} from "./chunk-jhm3zsa7.js";
|
|
9
|
-
import {
|
|
10
|
-
createObjectOperationScope2
|
|
11
|
-
} from "./chunk-qczk96d9.js";
|
|
12
|
-
import {
|
|
13
|
-
ActionRunError2
|
|
14
|
-
} from "./chunk-y0c4e6ex.js";
|
|
15
|
-
import {
|
|
16
|
-
assertJsonValue2,
|
|
17
|
-
cloneJsonValue2,
|
|
18
|
-
stableJsonStringify2
|
|
19
|
-
} from "./chunk-wy0qdqfm.js";
|
|
20
|
-
|
|
21
|
-
// src/storage/action-runs/idempotency.ts
|
|
22
|
-
function actionSubjectsEqual(left, right) {
|
|
23
|
-
if (left.kind !== right.kind)
|
|
24
|
-
return false;
|
|
25
|
-
if (left.kind === "none")
|
|
26
|
-
return true;
|
|
27
|
-
if (right.kind === "none")
|
|
28
|
-
return false;
|
|
29
|
-
return left.objectTypeId === right.objectTypeId && left.primaryId === right.primaryId;
|
|
30
|
-
}
|
|
31
|
-
function actionRunParamsEqual(left, right) {
|
|
32
|
-
return stableJsonStringify2(left) === stableJsonStringify2(right);
|
|
33
|
-
}
|
|
34
|
-
function actionRunRequestsEqual(left, right) {
|
|
35
|
-
return left.actionId === right.actionId && actionSubjectsEqual(left.subject, right.subject) && actionRunParamsEqual(left.params, right.params);
|
|
36
|
-
}
|
|
37
|
-
function actionRunPhaseRecordsEqual(left, right) {
|
|
38
|
-
return actionRunParamsEqual(stripPhaseRecordCompletedAt(left), stripPhaseRecordCompletedAt(right));
|
|
39
|
-
}
|
|
40
|
-
function stripPhaseRecordCompletedAt(record) {
|
|
41
|
-
const { completedAt: _completedAt, ...stableRecord } = record;
|
|
42
|
-
return stableRecord;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// src/storage/action-runs/record.ts
|
|
46
|
-
function normalizeRecordActionRunInput2(input) {
|
|
47
|
-
const label = `[Sixb] Action run '${input.id}'`;
|
|
48
|
-
for (const field of ["id", "projectId", "executionId", "actionId", "idempotencyKey"]) {
|
|
49
|
-
if (typeof input[field] !== "string" || input[field].trim().length === 0) {
|
|
50
|
-
throw new ActionRunError2(`${label} must have a nonblank ${field}.`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const status = input.status;
|
|
54
|
-
if (status !== "succeeded" && status !== "failed") {
|
|
55
|
-
throw new ActionRunError2(`${label} has unknown status '${status}'.`);
|
|
56
|
-
}
|
|
57
|
-
if (!ACTION_RUN_PHASES2.includes(input.phase)) {
|
|
58
|
-
throw new ActionRunError2(`${label} has unknown phase '${input.phase}'.`);
|
|
59
|
-
}
|
|
60
|
-
if (input.phase === "effects") {
|
|
61
|
-
throw new ActionRunError2(`${label} is recorded before its effects run.`);
|
|
62
|
-
}
|
|
63
|
-
const startedAt = requireDate(input.startedAt, `${label} startedAt`);
|
|
64
|
-
const finishedAt = requireDate(input.finishedAt, `${label} finishedAt`);
|
|
65
|
-
if (finishedAt < startedAt) {
|
|
66
|
-
throw new ActionRunError2(`${label} cannot finish before it started.`);
|
|
67
|
-
}
|
|
68
|
-
assertJsonValue2(input.params, `${label} params`);
|
|
69
|
-
const fields = {
|
|
70
|
-
id: input.id,
|
|
71
|
-
projectId: input.projectId,
|
|
72
|
-
executionId: input.executionId,
|
|
73
|
-
actionId: input.actionId,
|
|
74
|
-
subject: structuredClone(input.subject),
|
|
75
|
-
phase: input.phase,
|
|
76
|
-
startedAt,
|
|
77
|
-
finishedAt,
|
|
78
|
-
params: structuredClone(input.params),
|
|
79
|
-
idempotencyKey: input.idempotencyKey,
|
|
80
|
-
...input.writeback === undefined ? {} : { writeback: normalizeWriteback(input.writeback, label) }
|
|
81
|
-
};
|
|
82
|
-
if (input.status === "succeeded") {
|
|
83
|
-
if (input.error !== undefined) {
|
|
84
|
-
throw new ActionRunError2(`${label} succeeded, so it cannot record a failure.`);
|
|
85
|
-
}
|
|
86
|
-
return { ...fields, status: "succeeded" };
|
|
87
|
-
}
|
|
88
|
-
const error = parseActionRunFailure2(input.error, input.phase);
|
|
89
|
-
if (error.details.runId !== input.id || error.details.actionId !== input.actionId) {
|
|
90
|
-
throw new ActionRunError2(`${label} records the failure of another run.`);
|
|
91
|
-
}
|
|
92
|
-
return { ...fields, status: "failed", error };
|
|
93
|
-
}
|
|
94
|
-
function resolveActionRunEffects2(existing, input) {
|
|
95
|
-
const label = `[Sixb] Action run '${input.id}'`;
|
|
96
|
-
if (!existing) {
|
|
97
|
-
throw new ActionRunError2(`${label} not found for project '${input.projectId}'.`);
|
|
98
|
-
}
|
|
99
|
-
const completedAt = requireDate(input.completedAt ?? new Date, `${label} effects`);
|
|
100
|
-
const effects = input.status === "succeeded" ? { status: "succeeded", completedAt } : { status: "failed", completedAt, error: parseActionRunFailure2(input.error, "effects") };
|
|
101
|
-
if (existing.effects) {
|
|
102
|
-
if (actionRunPhaseRecordsEqual(existing.effects, effects))
|
|
103
|
-
return { run: existing, effects: null };
|
|
104
|
-
throw new ActionRunError2(`${label} already has a different effects record.`);
|
|
105
|
-
}
|
|
106
|
-
if (existing.status !== "succeeded" || existing.phase !== "commit") {
|
|
107
|
-
throw new ActionRunError2(`${label} cannot record effects: it ended '${existing.status}' in phase '${existing.phase}'.`);
|
|
108
|
-
}
|
|
109
|
-
return { run: existing, effects };
|
|
110
|
-
}
|
|
111
|
-
function normalizeWriteback(writeback, label) {
|
|
112
|
-
const completedAt = requireDate(writeback.completedAt, `${label} writeback`);
|
|
113
|
-
if (writeback.status === "succeeded") {
|
|
114
|
-
assertJsonValue2(writeback.result, `${label} writeback result`);
|
|
115
|
-
return { status: "succeeded", completedAt, result: cloneJsonValue2(writeback.result) };
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
status: "failed",
|
|
119
|
-
completedAt,
|
|
120
|
-
error: parseActionRunFailure2(writeback.error, "writeback")
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function requireDate(value, label) {
|
|
124
|
-
const date = value instanceof Date ? new Date(value) : new Date(Number.NaN);
|
|
125
|
-
if (!Number.isFinite(date.getTime())) {
|
|
126
|
-
throw new ActionRunError2(`${label} must be a valid date.`);
|
|
127
|
-
}
|
|
128
|
-
return date;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// src/storage/errors.ts
|
|
132
|
-
class ObjectNotFoundError2 extends Error {
|
|
133
|
-
objectTypeId;
|
|
134
|
-
primaryId;
|
|
135
|
-
context;
|
|
136
|
-
name = "ObjectNotFoundError";
|
|
137
|
-
constructor(objectTypeId, primaryId, context) {
|
|
138
|
-
super(`[Sixb] ${context}: ${objectTypeId}:${primaryId}`);
|
|
139
|
-
this.objectTypeId = objectTypeId;
|
|
140
|
-
this.primaryId = primaryId;
|
|
141
|
-
this.context = context;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
class ObjectStorageError2 extends Error {
|
|
146
|
-
name = "ObjectStorageError";
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
class StorageTransactionError2 extends Error {
|
|
150
|
-
name = "StorageTransactionError";
|
|
151
|
-
code;
|
|
152
|
-
cause;
|
|
153
|
-
constructor(message, options = {}) {
|
|
154
|
-
super(message);
|
|
155
|
-
this.code = options.code;
|
|
156
|
-
this.cause = options.cause;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function isStorageSerializationFailure2(error) {
|
|
160
|
-
return error instanceof StorageTransactionError2 && error.code === "serialization_failure";
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// src/storage/file-download-grants/record.ts
|
|
164
|
-
function parseFileDownloadGrantRow2(row) {
|
|
165
|
-
const id = text(row.id, "id", String(row.id));
|
|
166
|
-
const file = typeof row.file === "string" ? JSON.parse(row.file) : row.file;
|
|
167
|
-
if (!isFileRef2(file))
|
|
168
|
-
throw corrupt(id, "file is not a file reference");
|
|
169
|
-
return {
|
|
170
|
-
id,
|
|
171
|
-
projectId: text(row.projectId, "projectId", id),
|
|
172
|
-
tokenHash: text(row.tokenHash, "tokenHash", id),
|
|
173
|
-
file,
|
|
174
|
-
executionId: text(row.executionId, "executionId", id),
|
|
175
|
-
createdAt: date(row.createdAt, "createdAt", id),
|
|
176
|
-
expiresAt: date(row.expiresAt, "expiresAt", id),
|
|
177
|
-
...row.revokedAt == null ? {} : { revokedAt: date(row.revokedAt, "revokedAt", id) }
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
function cloneFileDownloadGrantRecord(record) {
|
|
181
|
-
return structuredClone(record);
|
|
182
|
-
}
|
|
183
|
-
function text(value, column, id) {
|
|
184
|
-
if (typeof value !== "string" || value.length === 0)
|
|
185
|
-
throw corrupt(id, `${column} is not text`);
|
|
186
|
-
return value;
|
|
187
|
-
}
|
|
188
|
-
function date(value, column, id) {
|
|
189
|
-
const parsed = value instanceof Date || typeof value === "string" ? new Date(value) : null;
|
|
190
|
-
if (!parsed || !Number.isFinite(parsed.getTime()))
|
|
191
|
-
throw corrupt(id, `${column} is not a date`);
|
|
192
|
-
return parsed;
|
|
193
|
-
}
|
|
194
|
-
function corrupt(id, reason) {
|
|
195
|
-
return new Error(`[Sixb] Stored file download grant '${id}' is invalid: ${reason}.`);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// src/storage/pipeline-runs/idempotency.ts
|
|
199
|
-
function canRequeuePipelineRunAfterEnqueueFailure2(existing, input) {
|
|
200
|
-
return existing.status === "failed" && existing.error?.code === "queue.enqueue_failed" && existing.error.retryable && existing.executionId === input.executionId && existing.pipelineId === input.pipelineId;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// src/storage/sync-runs/idempotency.ts
|
|
204
|
-
function canRequeueSyncRunAfterEnqueueFailure2(existing, input) {
|
|
205
|
-
return existing.status === "failed" && existing.error?.code === "queue.enqueue_failed" && existing.error.retryable && existing.executionId === input.executionId && existing.syncId === input.syncId && existing.datasetId === input.datasetId && existing.mode === input.mode && existing.expectedLatestVersionId === input.expectedLatestVersionId && existing.commitMessage === input.commitMessage;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// src/storage/transaction.ts
|
|
209
|
-
function createTransactionStorageProxy2(target, isActive) {
|
|
210
|
-
const proxies = new WeakMap;
|
|
211
|
-
const objectStorage = createObjectOperationScope2(target.objects, {
|
|
212
|
-
assertAvailable: () => assertTransactionActive2(isActive),
|
|
213
|
-
run: async (operation) => {
|
|
214
|
-
assertTransactionActive2(isActive);
|
|
215
|
-
return operation();
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
const wrap = (value) => {
|
|
219
|
-
const existing = proxies.get(value);
|
|
220
|
-
if (existing)
|
|
221
|
-
return existing;
|
|
222
|
-
const proxy = new Proxy(value, {
|
|
223
|
-
get(current, property, receiver) {
|
|
224
|
-
assertTransactionActive2(isActive);
|
|
225
|
-
const result = current === target && property === "objects" ? objectStorage : Reflect.get(current, property, receiver);
|
|
226
|
-
if (typeof result === "function") {
|
|
227
|
-
return (...args) => {
|
|
228
|
-
assertTransactionActive2(isActive);
|
|
229
|
-
return result.apply(current, args);
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
if (result && typeof result === "object") {
|
|
233
|
-
return wrap(result);
|
|
234
|
-
}
|
|
235
|
-
return result;
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
proxies.set(value, proxy);
|
|
239
|
-
return proxy;
|
|
240
|
-
};
|
|
241
|
-
return wrap(target);
|
|
242
|
-
}
|
|
243
|
-
function assertTransactionActive2(isActive) {
|
|
244
|
-
if (!isActive()) {
|
|
245
|
-
throw new StorageTransactionError2("[Sixb] Transaction storage cannot be used after transaction completion.", { code: "transaction_inactive" });
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
function throwNestedStorageTransaction2() {
|
|
249
|
-
throw new StorageTransactionError2("[Sixb] Nested storage transactions are not supported yet.", {
|
|
250
|
-
code: "nested_transaction"
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export { actionSubjectsEqual, actionRunRequestsEqual, normalizeRecordActionRunInput2, resolveActionRunEffects2, ObjectNotFoundError2, ObjectStorageError2, StorageTransactionError2, isStorageSerializationFailure2, parseFileDownloadGrantRow2, cloneFileDownloadGrantRecord, canRequeuePipelineRunAfterEnqueueFailure2, canRequeueSyncRunAfterEnqueueFailure2, createTransactionStorageProxy2, assertTransactionActive2, throwNestedStorageTransaction2 };
|
|
255
|
-
|
|
256
|
-
//# debugId=B710291DEE8F3A1864756E2164756E21
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/storage/action-runs/idempotency.ts", "../src/storage/action-runs/record.ts", "../src/storage/errors.ts", "../src/storage/file-download-grants/record.ts", "../src/storage/pipeline-runs/idempotency.ts", "../src/storage/sync-runs/idempotency.ts", "../src/storage/transaction.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { ActionSubject } from \"../../actions\"\nimport { stableJsonStringify } from \"../../json\"\nimport type { ActionRunEffectsRecord, ActionRunRecord, ActionRunWritebackRecord } from \"./types\"\n\nexport function actionSubjectsEqual(left: ActionSubject, right: ActionSubject): boolean {\n if (left.kind !== right.kind) return false\n if (left.kind === \"none\") return true\n if (right.kind === \"none\") return false\n return left.objectTypeId === right.objectTypeId && left.primaryId === right.primaryId\n}\n\nexport function actionRunParamsEqual(left: unknown, right: unknown): boolean {\n return stableJsonStringify(left) === stableJsonStringify(right)\n}\n\n/** Whether two runs carry the same request: the same Action, subject, and params. */\nexport function actionRunRequestsEqual(\n left: Pick<ActionRunRecord, \"actionId\" | \"subject\" | \"params\">,\n right: Pick<ActionRunRecord, \"actionId\" | \"subject\" | \"params\">\n): boolean {\n return (\n left.actionId === right.actionId &&\n actionSubjectsEqual(left.subject, right.subject) &&\n actionRunParamsEqual(left.params, right.params)\n )\n}\n\nexport type ActionRunPhaseRecord = ActionRunWritebackRecord | ActionRunEffectsRecord\n\nexport function actionRunPhaseRecordsEqual(\n left: ActionRunPhaseRecord,\n right: ActionRunPhaseRecord\n): boolean {\n return actionRunParamsEqual(stripPhaseRecordCompletedAt(left), stripPhaseRecordCompletedAt(right))\n}\n\nfunction stripPhaseRecordCompletedAt(\n record: ActionRunPhaseRecord\n): Omit<ActionRunPhaseRecord, \"completedAt\"> {\n const { completedAt: _completedAt, ...stableRecord } = record\n return stableRecord\n}\n",
|
|
6
|
-
"import { assertJsonValue, cloneJsonValue } from \"../../json\"\nimport { ActionRunError } from \"./errors\"\nimport { parseActionRunFailure } from \"./failure\"\nimport { actionRunPhaseRecordsEqual } from \"./idempotency\"\nimport type {\n ActionRunEffectsRecord,\n ActionRunRecord,\n ActionRunWritebackRecord,\n RecordActionEffectsInput,\n RecordActionRunInput,\n} from \"./types\"\nimport { ACTION_RUN_PHASES } from \"./types\"\n\n/**\n * Validate a terminal run record before a provider inserts it, and detach it from the caller.\n *\n * Every provider records through this, so a stored run always reads back as the record that was\n * written: a failed run carries the failure of the phase it ended in, and a succeeded one none. A\n * run is recorded before its effects run, so no record starts in the `effects` phase.\n */\nexport function normalizeRecordActionRunInput(input: RecordActionRunInput): RecordActionRunInput {\n const label = `[Sixb] Action run '${input.id}'`\n for (const field of [\"id\", \"projectId\", \"executionId\", \"actionId\", \"idempotencyKey\"] as const) {\n if (typeof input[field] !== \"string\" || input[field].trim().length === 0) {\n throw new ActionRunError(`${label} must have a nonblank ${field}.`)\n }\n }\n const status: string = input.status\n if (status !== \"succeeded\" && status !== \"failed\") {\n throw new ActionRunError(`${label} has unknown status '${status}'.`)\n }\n if (!(ACTION_RUN_PHASES as readonly string[]).includes(input.phase)) {\n throw new ActionRunError(`${label} has unknown phase '${input.phase}'.`)\n }\n if (input.phase === \"effects\") {\n throw new ActionRunError(`${label} is recorded before its effects run.`)\n }\n const startedAt = requireDate(input.startedAt, `${label} startedAt`)\n const finishedAt = requireDate(input.finishedAt, `${label} finishedAt`)\n if (finishedAt < startedAt) {\n throw new ActionRunError(`${label} cannot finish before it started.`)\n }\n assertJsonValue(input.params, `${label} params`)\n\n const fields = {\n id: input.id,\n projectId: input.projectId,\n executionId: input.executionId,\n actionId: input.actionId,\n subject: structuredClone(input.subject),\n phase: input.phase,\n startedAt,\n finishedAt,\n params: structuredClone(input.params),\n idempotencyKey: input.idempotencyKey,\n ...(input.writeback === undefined\n ? {}\n : { writeback: normalizeWriteback(input.writeback, label) }),\n }\n\n if (input.status === \"succeeded\") {\n if (input.error !== undefined) {\n throw new ActionRunError(`${label} succeeded, so it cannot record a failure.`)\n }\n return { ...fields, status: \"succeeded\" }\n }\n const error = parseActionRunFailure(input.error, input.phase)\n if (error.details.runId !== input.id || error.details.actionId !== input.actionId) {\n throw new ActionRunError(`${label} records the failure of another run.`)\n }\n return { ...fields, status: \"failed\", error }\n}\n\n/**\n * Resolve what recording effects does to the stored run: write `effects`, or nothing (`null`) when\n * an equal outcome is already recorded.\n *\n * Effects run only after a succeeded run committed its edits, and their outcome is recorded once.\n */\nexport function resolveActionRunEffects(\n existing: ActionRunRecord | null,\n input: RecordActionEffectsInput\n): { readonly run: ActionRunRecord; readonly effects: ActionRunEffectsRecord | null } {\n const label = `[Sixb] Action run '${input.id}'`\n if (!existing) {\n throw new ActionRunError(`${label} not found for project '${input.projectId}'.`)\n }\n const completedAt = requireDate(input.completedAt ?? new Date(), `${label} effects`)\n const effects: ActionRunEffectsRecord =\n input.status === \"succeeded\"\n ? { status: \"succeeded\", completedAt }\n : { status: \"failed\", completedAt, error: parseActionRunFailure(input.error, \"effects\") }\n\n if (existing.effects) {\n if (actionRunPhaseRecordsEqual(existing.effects, effects))\n return { run: existing, effects: null }\n throw new ActionRunError(`${label} already has a different effects record.`)\n }\n if (existing.status !== \"succeeded\" || existing.phase !== \"commit\") {\n throw new ActionRunError(\n `${label} cannot record effects: it ended '${existing.status}' in phase '${existing.phase}'.`\n )\n }\n return { run: existing, effects }\n}\n\nfunction normalizeWriteback(\n writeback: ActionRunWritebackRecord,\n label: string\n): ActionRunWritebackRecord {\n const completedAt = requireDate(writeback.completedAt, `${label} writeback`)\n if (writeback.status === \"succeeded\") {\n assertJsonValue(writeback.result, `${label} writeback result`)\n return { status: \"succeeded\", completedAt, result: cloneJsonValue(writeback.result) }\n }\n return {\n status: \"failed\",\n completedAt,\n error: parseActionRunFailure(writeback.error, \"writeback\"),\n }\n}\n\n/** A detached copy of `value`, which must be a valid date. */\nfunction requireDate(value: Date, label: string): Date {\n const date = value instanceof Date ? new Date(value) : new Date(Number.NaN)\n if (!Number.isFinite(date.getTime())) {\n throw new ActionRunError(`${label} must be a valid date.`)\n }\n return date\n}\n",
|
|
7
|
-
"/**\n * Thrown when a storage lookup by primary ID finds no matching object.\n * Carries structured context so callers can discriminate without string parsing.\n */\nexport class ObjectNotFoundError extends Error {\n readonly name = \"ObjectNotFoundError\"\n\n constructor(\n readonly objectTypeId: string,\n readonly primaryId: string,\n readonly context: string\n ) {\n super(`[Sixb] ${context}: ${objectTypeId}:${primaryId}`)\n }\n}\n\nexport class ObjectStorageError extends Error {\n readonly name = \"ObjectStorageError\"\n}\n\nexport type StorageTransactionErrorCode =\n | \"nested_transaction\"\n | \"serialization_failure\"\n | \"transaction_inactive\"\n\nexport interface StorageTransactionErrorOptions {\n readonly cause?: unknown\n readonly code?: StorageTransactionErrorCode\n}\n\nexport class StorageTransactionError extends Error {\n readonly name = \"StorageTransactionError\"\n readonly code?: StorageTransactionErrorCode\n override readonly cause?: unknown\n\n constructor(message: string, options: StorageTransactionErrorOptions = {}) {\n super(message)\n this.code = options.code\n this.cause = options.cause\n }\n}\n\nexport function isStorageSerializationFailure(error: unknown): boolean {\n return error instanceof StorageTransactionError && error.code === \"serialization_failure\"\n}\n",
|
|
8
|
-
"import { isFileRef } from \"../../blob-storage\"\nimport type { FileDownloadGrantRecord } from \"./types\"\n\n/**\n * Rebuilds a grant from a provider row with camelCase keys. `file` may arrive parsed (jsonb) or\n * as text (SQLite), and timestamps as `Date` or ISO text. Fails closed on corruption: a grant that\n * cannot be read must not serve a file.\n */\nexport function parseFileDownloadGrantRow(row: {\n readonly [column: string]: unknown\n}): FileDownloadGrantRecord {\n const id = text(row.id, \"id\", String(row.id))\n const file = typeof row.file === \"string\" ? JSON.parse(row.file) : row.file\n if (!isFileRef(file)) throw corrupt(id, \"file is not a file reference\")\n\n return {\n id,\n projectId: text(row.projectId, \"projectId\", id),\n tokenHash: text(row.tokenHash, \"tokenHash\", id),\n file,\n executionId: text(row.executionId, \"executionId\", id),\n createdAt: date(row.createdAt, \"createdAt\", id),\n expiresAt: date(row.expiresAt, \"expiresAt\", id),\n ...(row.revokedAt == null ? {} : { revokedAt: date(row.revokedAt, \"revokedAt\", id) }),\n }\n}\n\nexport function cloneFileDownloadGrantRecord(\n record: FileDownloadGrantRecord\n): FileDownloadGrantRecord {\n return structuredClone(record)\n}\n\nfunction text(value: unknown, column: string, id: string): string {\n if (typeof value !== \"string\" || value.length === 0) throw corrupt(id, `${column} is not text`)\n return value\n}\n\nfunction date(value: unknown, column: string, id: string): Date {\n const parsed = value instanceof Date || typeof value === \"string\" ? new Date(value) : null\n if (!parsed || !Number.isFinite(parsed.getTime())) throw corrupt(id, `${column} is not a date`)\n return parsed\n}\n\nfunction corrupt(id: string, reason: string): Error {\n return new Error(`[Sixb] Stored file download grant '${id}' is invalid: ${reason}.`)\n}\n",
|
|
9
|
-
"import type { PipelineRunRecord, QueuePipelineRunInput } from \"./types\"\n\nexport function canRequeuePipelineRunAfterEnqueueFailure(\n existing: PipelineRunRecord,\n input: QueuePipelineRunInput\n): boolean {\n return (\n existing.status === \"failed\" &&\n existing.error?.code === \"queue.enqueue_failed\" &&\n existing.error.retryable &&\n existing.executionId === input.executionId &&\n existing.pipelineId === input.pipelineId\n )\n}\n",
|
|
10
|
-
"import type { QueueSyncRunInput, SyncRunRecord } from \"./types\"\n\nexport function canRequeueSyncRunAfterEnqueueFailure(\n existing: SyncRunRecord,\n input: QueueSyncRunInput\n): boolean {\n return (\n existing.status === \"failed\" &&\n existing.error?.code === \"queue.enqueue_failed\" &&\n existing.error.retryable &&\n existing.executionId === input.executionId &&\n existing.syncId === input.syncId &&\n existing.datasetId === input.datasetId &&\n existing.mode === input.mode &&\n existing.expectedLatestVersionId === input.expectedLatestVersionId &&\n existing.commitMessage === input.commitMessage\n )\n}\n",
|
|
11
|
-
"import { StorageTransactionError } from \"./errors\"\nimport { createObjectOperationScope } from \"./operation-scope\"\nimport type { Storage } from \"./types\"\n\ntype ObjectLike = Record<PropertyKey, unknown>\n\nexport function createTransactionStorageProxy<T extends Storage>(\n target: T,\n isActive: () => boolean\n): T {\n const proxies = new WeakMap<object, object>()\n const objectStorage = createObjectOperationScope(target.objects, {\n assertAvailable: () => assertTransactionActive(isActive),\n run: async <TResult>(operation: () => Promise<TResult> | TResult): Promise<TResult> => {\n assertTransactionActive(isActive)\n return operation()\n },\n })\n\n const wrap = <TValue extends object>(value: TValue): TValue => {\n const existing = proxies.get(value)\n if (existing) return existing as TValue\n\n const proxy = new Proxy(value as ObjectLike, {\n // The guard runs on property access and on call. Its purpose is to fail fast when a\n // transaction handle (`tx`) leaks past the transaction's lifetime — using it afterward is a\n // bug, not a recoverable state. Overhead is bounded: only the storage namespaces reachable\n // from `tx` are wrapped (a handful), not the row/link data graph, and never per-record.\n get(current, property, receiver) {\n assertTransactionActive(isActive)\n const result =\n current === target && property === \"objects\"\n ? objectStorage\n : Reflect.get(current, property, receiver)\n if (typeof result === \"function\") {\n return (...args: unknown[]) => {\n assertTransactionActive(isActive)\n return result.apply(current, args)\n }\n }\n if (result && typeof result === \"object\") {\n return wrap(result)\n }\n return result\n },\n })\n\n proxies.set(value, proxy)\n return proxy as TValue\n }\n\n return wrap(target)\n}\n\nexport function assertTransactionActive(isActive: () => boolean): void {\n if (!isActive()) {\n throw new StorageTransactionError(\n \"[Sixb] Transaction storage cannot be used after transaction completion.\",\n { code: \"transaction_inactive\" }\n )\n }\n}\n\nexport function throwNestedStorageTransaction(): never {\n throw new StorageTransactionError(\"[Sixb] Nested storage transactions are not supported yet.\", {\n code: \"nested_transaction\",\n })\n}\n"
|
|
12
|
-
],
|
|
13
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,mBAAmB,CAAC,MAAqB,OAA+B;AAAA,EACtF,IAAI,KAAK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