@sixb/core 0.1.18 → 0.1.20
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/README.md +7 -6
- package/dist/actions/commit-edits.d.ts +7 -19
- package/dist/actions/commit-edits.d.ts.map +1 -1
- package/dist/actions/errors.d.ts +0 -3
- package/dist/actions/errors.d.ts.map +1 -1
- package/dist/actions/execution.d.ts +10 -3
- package/dist/actions/execution.d.ts.map +1 -1
- package/dist/actions/index.d.ts +6 -9
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +51 -50
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts +14 -25
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run/context.d.ts +40 -0
- package/dist/actions/run/context.d.ts.map +1 -0
- package/dist/actions/run/edits-commit.d.ts +31 -0
- package/dist/actions/run/edits-commit.d.ts.map +1 -0
- package/dist/actions/run/effects.d.ts +23 -0
- package/dist/actions/run/effects.d.ts.map +1 -0
- package/dist/actions/run/execute.d.ts +30 -0
- package/dist/actions/run/execute.d.ts.map +1 -0
- package/dist/actions/run/executor.d.ts +95 -0
- package/dist/actions/run/executor.d.ts.map +1 -0
- package/dist/actions/run/normalize.d.ts +36 -0
- package/dist/actions/run/normalize.d.ts.map +1 -0
- package/dist/actions/run/phase-types.d.ts +18 -0
- package/dist/actions/run/phase-types.d.ts.map +1 -0
- package/dist/actions/run/phases.d.ts +20 -0
- package/dist/actions/run/phases.d.ts.map +1 -0
- package/dist/actions/run/run-action.d.ts +25 -0
- package/dist/actions/run/run-action.d.ts.map +1 -0
- package/dist/actions/run/signals.d.ts +67 -0
- package/dist/actions/run/signals.d.ts.map +1 -0
- package/dist/actions/run/state.d.ts +47 -0
- package/dist/actions/run/state.d.ts.map +1 -0
- package/dist/actions/run/types.d.ts +54 -0
- package/dist/actions/run/types.d.ts.map +1 -0
- package/dist/actions/run/writeback.d.ts +17 -0
- package/dist/actions/run/writeback.d.ts.map +1 -0
- package/dist/actions/run-authorization.d.ts +1 -1
- package/dist/actions/run-authorization.d.ts.map +1 -1
- package/dist/actions/run-persistence.d.ts +53 -0
- package/dist/actions/run-persistence.d.ts.map +1 -0
- package/dist/actions/types/context.d.ts +10 -0
- package/dist/actions/types/context.d.ts.map +1 -1
- package/dist/agents/index.js +52 -55
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/streams/index.js +2 -2
- package/dist/agents/streams/internal.js +2 -2
- package/dist/auth/cookies.d.ts +2 -4
- package/dist/auth/cookies.d.ts.map +1 -1
- package/dist/auth/index.d.ts +0 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +15 -21
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/runtime.d.ts +8 -10
- package/dist/auth/runtime.d.ts.map +1 -1
- package/dist/auth/session-cache.d.ts +1 -5
- package/dist/auth/session-cache.d.ts.map +1 -1
- package/dist/auth/strategy.js +1 -1
- package/dist/auth/types.d.ts +4 -8
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/validation.d.ts +0 -1
- package/dist/auth/validation.d.ts.map +1 -1
- package/dist/authorization/decision.d.ts +0 -4
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/event-visibility.d.ts.map +1 -1
- package/dist/authorization/grant-kinds.d.ts +6 -8
- package/dist/authorization/grant-kinds.d.ts.map +1 -1
- package/dist/authorization/index.d.ts +0 -1
- package/dist/authorization/index.d.ts.map +1 -1
- package/dist/authorization/index.js +5 -9
- package/dist/authorization/index.js.map +1 -1
- package/dist/authorization/resolve.d.ts +1 -1
- package/dist/authorization/resolve.d.ts.map +1 -1
- package/dist/bootstrap/index.js +50 -53
- package/dist/bootstrap/index.js.map +2 -2
- package/dist/{chunk-vz3gc1tm.js → chunk-0rbyz4qy.js} +67 -69
- package/dist/{chunk-vz3gc1tm.js.map → chunk-0rbyz4qy.js.map} +4 -4
- package/dist/{chunk-rz53yb4v.js → chunk-0yh890a4.js} +1 -1
- package/dist/{chunk-vgk3hknm.js → chunk-1k89ecfr.js} +1 -1
- package/dist/{chunk-ny3xyvcn.js → chunk-1zq2p6g0.js} +3 -3
- package/dist/{chunk-dnmadg9k.js → chunk-3t2hgbgd.js} +2 -2
- package/dist/{chunk-k6hrnf35.js → chunk-4vyr1j8f.js} +51 -4
- package/dist/chunk-4vyr1j8f.js.map +11 -0
- package/dist/{chunk-22v5bpz3.js → chunk-5e43w60z.js} +1 -1
- package/dist/{chunk-de4z2bj6.js → chunk-5j58wjct.js} +17 -17
- package/dist/chunk-5j58wjct.js.map +18 -0
- package/dist/{chunk-fe52eczz.js → chunk-6c6sn0bh.js} +6352 -2127
- package/dist/chunk-6c6sn0bh.js.map +106 -0
- package/dist/{chunk-7hpdd6r9.js → chunk-6p49a5cq.js} +4 -4
- package/dist/{chunk-b9affek3.js → chunk-7n440zgt.js} +30 -30
- package/dist/{chunk-b9affek3.js.map → chunk-7n440zgt.js.map} +4 -4
- package/dist/{chunk-kkqwzy6h.js → chunk-7t429e3f.js} +1 -1
- package/dist/{chunk-6fsr7y93.js → chunk-8mx7qw3y.js} +14 -13
- package/dist/{chunk-6fsr7y93.js.map → chunk-8mx7qw3y.js.map} +4 -4
- package/dist/{chunk-kpx7jrmn.js → chunk-91mg3nj9.js} +59 -59
- package/dist/{chunk-kpx7jrmn.js.map → chunk-91mg3nj9.js.map} +5 -5
- package/dist/{chunk-ex496vct.js → chunk-9dmt152s.js} +1 -1
- package/dist/{chunk-48e3cn2d.js → chunk-9gyp8hg1.js} +2 -2
- package/dist/{chunk-ewqa58h9.js → chunk-9k93ah50.js} +4 -4
- package/dist/{chunk-ewqa58h9.js.map → chunk-9k93ah50.js.map} +1 -1
- package/dist/{chunk-zxawp1n2.js → chunk-9w055r5b.js} +1 -1
- package/dist/{chunk-4wn7bxxa.js → chunk-9ybhtmg4.js} +1 -1
- package/dist/{chunk-fc5zfxy1.js → chunk-a40ad1ft.js} +5 -13
- package/dist/chunk-a40ad1ft.js.map +10 -0
- package/dist/{chunk-y2aq6ag9.js → chunk-b38szspf.js} +5 -14
- package/dist/chunk-b38szspf.js.map +11 -0
- package/dist/{chunk-r2y23egw.js → chunk-bkpke1sg.js} +1 -10
- package/dist/chunk-bkpke1sg.js.map +10 -0
- package/dist/{chunk-htr6wjmv.js → chunk-bx9q3cwv.js} +22 -22
- package/dist/{chunk-htr6wjmv.js.map → chunk-bx9q3cwv.js.map} +1 -1
- package/dist/{chunk-vx2yp45y.js → chunk-c85m1hyj.js} +2 -2
- package/dist/{chunk-bs7sqkre.js → chunk-d09tj99x.js} +2 -2
- package/dist/{chunk-qkbx3tf6.js → chunk-d0bqz29d.js} +27 -47
- package/dist/chunk-d0bqz29d.js.map +23 -0
- package/dist/{chunk-zb77kjth.js → chunk-dk8tkk5f.js} +4 -4
- package/dist/{chunk-xt1zt7gv.js → chunk-es1gxsbf.js} +24 -15
- package/dist/chunk-es1gxsbf.js.map +13 -0
- package/dist/{chunk-vjcd8d27.js → chunk-fa02jy15.js} +1 -1
- package/dist/{chunk-za5yd58j.js → chunk-fkgc1wt8.js} +2 -2
- package/dist/{chunk-enpsx8k5.js → chunk-gsjm1wms.js} +16 -20
- package/dist/chunk-gsjm1wms.js.map +10 -0
- package/dist/{chunk-2jntasmh.js → chunk-hcbyfxbe.js} +25 -49
- package/dist/chunk-hcbyfxbe.js.map +12 -0
- package/dist/{chunk-p0dqwj3n.js → chunk-hjzdd750.js} +66 -47
- package/dist/{chunk-p0dqwj3n.js.map → chunk-hjzdd750.js.map} +4 -4
- package/dist/chunk-hkc3jct7.js.map +1 -1
- package/dist/{chunk-y05543x6.js → chunk-hvsb78a1.js} +4 -4
- package/dist/{chunk-y05543x6.js.map → chunk-hvsb78a1.js.map} +1 -1
- package/dist/{chunk-1b1f2d5f.js → chunk-k6q3n2sc.js} +9 -9
- package/dist/{chunk-1b1f2d5f.js.map → chunk-k6q3n2sc.js.map} +1 -1
- package/dist/{chunk-wr8qp979.js → chunk-m427qgq0.js} +9 -5
- package/dist/{chunk-wr8qp979.js.map → chunk-m427qgq0.js.map} +4 -3
- package/dist/{chunk-qq90g05n.js → chunk-n33z5bjw.js} +50 -240
- package/dist/{chunk-qq90g05n.js.map → chunk-n33z5bjw.js.map} +4 -4
- package/dist/{chunk-e1c18xjx.js → chunk-nq6gpjt7.js} +4 -45
- package/dist/{chunk-e1c18xjx.js.map → chunk-nq6gpjt7.js.map} +5 -5
- package/dist/{chunk-1hqwggsn.js → chunk-nzapm6p0.js} +1 -2
- package/dist/chunk-nzapm6p0.js.map +12 -0
- package/dist/{chunk-wt4szfec.js → chunk-pbcbn83d.js} +4 -4
- package/dist/{chunk-wt4szfec.js.map → chunk-pbcbn83d.js.map} +1 -1
- package/dist/{chunk-s4jhg8a3.js → chunk-ren4kg2j.js} +15 -15
- package/dist/{chunk-s4jhg8a3.js.map → chunk-ren4kg2j.js.map} +1 -1
- package/dist/{chunk-d0eb5yy6.js → chunk-rrzt8jdy.js} +5 -5
- package/dist/{chunk-d0eb5yy6.js.map → chunk-rrzt8jdy.js.map} +1 -1
- package/dist/{chunk-y9jmd7e5.js → chunk-s16apyk9.js} +102 -16
- package/dist/chunk-s16apyk9.js.map +16 -0
- package/dist/{chunk-6gmfggss.js → chunk-t7x8dmn0.js} +2 -2
- package/dist/{chunk-f1zxad2t.js → chunk-tg2cw67r.js} +6 -6
- package/dist/{chunk-f1zxad2t.js.map → chunk-tg2cw67r.js.map} +1 -1
- package/dist/{chunk-p844e0rn.js → chunk-tpn40322.js} +2 -2
- package/dist/{chunk-rt9p8m9t.js → chunk-v9xd5wzd.js} +1 -1
- package/dist/{chunk-6h5m9xjx.js → chunk-vpq4shxz.js} +49 -113
- package/dist/chunk-vpq4shxz.js.map +39 -0
- package/dist/{chunk-2vhg6ysa.js → chunk-vyf9kfqf.js} +1 -1
- package/dist/{chunk-bwjcehza.js → chunk-way52z4h.js} +1 -1
- package/dist/{chunk-qkvz64nd.js → chunk-x6m907x7.js} +3 -3
- package/dist/{chunk-yv9czyfr.js → chunk-xfs8x8m9.js} +5 -5
- package/dist/chunk-y0c4e6ex.js +16 -0
- package/dist/chunk-y0c4e6ex.js.map +10 -0
- package/dist/{chunk-v6xpd60t.js → chunk-yevzdx4y.js} +5 -5
- package/dist/{chunk-dfm066qg.js → chunk-yxd3nnqt.js} +2 -29
- package/dist/chunk-yxd3nnqt.js.map +11 -0
- package/dist/{chunk-70jmg2zx.js → chunk-yzwja0mj.js} +4 -19
- package/dist/{chunk-70jmg2zx.js.map → chunk-yzwja0mj.js.map} +3 -3
- package/dist/{chunk-qmnnhde6.js → chunk-z4m0yz8c.js} +1 -1
- package/dist/datasets/write.js +5 -5
- package/dist/deploy/index.d.ts +1 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/internal.js +13 -10
- package/dist/deploy/internal.js.map +4 -4
- package/dist/deploy/services.d.ts +1 -2
- package/dist/deploy/services.d.ts.map +1 -1
- package/dist/deploy/types.d.ts +7 -7
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/deploy/validation.d.ts.map +1 -1
- package/dist/edits/index.js +3 -5
- package/dist/edits/index.js.map +1 -1
- package/dist/error-reporting/internal.js +3 -3
- package/dist/error-reporting/types.d.ts +2 -9
- package/dist/error-reporting/types.d.ts.map +1 -1
- package/dist/errors/catalog.d.ts +12 -0
- package/dist/errors/catalog.d.ts.map +1 -1
- package/dist/errors/internal.js +1 -1
- package/dist/events/definitions.d.ts +0 -5
- package/dist/events/definitions.d.ts.map +1 -1
- package/dist/events/index.d.ts +3 -3
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +6 -8
- package/dist/events/index.js.map +1 -1
- package/dist/events/scope.d.ts +0 -1
- package/dist/events/scope.d.ts.map +1 -1
- package/dist/events/scope.js +1 -1
- package/dist/events/selectors/builder.d.ts +1 -8
- package/dist/events/selectors/builder.d.ts.map +1 -1
- package/dist/events/selectors/index.d.ts +2 -2
- package/dist/events/selectors/index.d.ts.map +1 -1
- package/dist/events/selectors/index.js +2 -2
- package/dist/events/selectors/predicate.d.ts.map +1 -1
- package/dist/events/selectors/types.d.ts +2 -33
- package/dist/events/selectors/types.d.ts.map +1 -1
- package/dist/events/types/index.d.ts +1 -12
- package/dist/events/types/index.d.ts.map +1 -1
- package/dist/execution/agent.js +41 -44
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/primitive.js +60 -91
- package/dist/execution/primitive.js.map +3 -4
- package/dist/execution/request.js +40 -43
- package/dist/execution/request.js.map +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +105 -127
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +5 -5
- package/dist/materialization/index.js +3 -3
- package/dist/materialization/index.js.map +1 -1
- package/dist/materialization/model.d.ts +19 -6
- package/dist/materialization/model.d.ts.map +1 -1
- package/dist/materializer/index.js +31 -31
- package/dist/materializer/index.js.map +1 -1
- package/dist/materializer/shared/normalize.d.ts.map +1 -1
- package/dist/models/execution/index.js +21 -21
- package/dist/objects/action/errors.d.ts +0 -9
- package/dist/objects/action/errors.d.ts.map +1 -1
- package/dist/objects/action/index.d.ts +3 -3
- package/dist/objects/action/index.d.ts.map +1 -1
- package/dist/objects/action/request.d.ts +2 -8
- package/dist/objects/action/request.d.ts.map +1 -1
- package/dist/objects/execution.d.ts +0 -2
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +44 -29
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/query/index.js +29 -29
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/sdk/object-handle.d.ts.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/objects/service/index.d.ts +0 -1
- package/dist/objects/service/index.d.ts.map +1 -1
- package/dist/objects/vectors/handle.d.ts.map +1 -1
- package/dist/objects/vectors/profile.d.ts +5 -0
- package/dist/objects/vectors/profile.d.ts.map +1 -1
- package/dist/ontology/index.js +6 -6
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/internal.js +2 -2
- package/dist/pipelines/index.js +28 -28
- package/dist/projections/internal.js +22 -22
- package/dist/projections/internal.js.map +1 -1
- package/dist/query.js +2 -2
- package/dist/queues/in-memory.d.ts +1 -2
- package/dist/queues/in-memory.d.ts.map +1 -1
- package/dist/queues/index.d.ts +1 -1
- package/dist/queues/index.d.ts.map +1 -1
- package/dist/queues/index.js +1 -1
- package/dist/queues/types.d.ts +0 -7
- package/dist/queues/types.d.ts.map +1 -1
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.js +27 -28
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +16 -36
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/sandboxes/index.js +5 -5
- package/dist/schedules/builders.d.ts.map +1 -1
- package/dist/schedules/index.js +3 -3
- package/dist/schedules/runtime.d.ts.map +1 -1
- package/dist/schedules/validation.d.ts +0 -1
- package/dist/schedules/validation.d.ts.map +1 -1
- package/dist/security/builders.d.ts.map +1 -1
- package/dist/security/every.d.ts +2 -5
- package/dist/security/every.d.ts.map +1 -1
- package/dist/security/grants.d.ts +2 -4
- package/dist/security/grants.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -2
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/membership-policies.d.ts.map +1 -1
- package/dist/security/public.d.ts +10 -0
- package/dist/security/public.d.ts.map +1 -0
- package/dist/security/public.js +10 -0
- package/dist/security/public.js.map +9 -0
- package/dist/security/registry.d.ts +0 -1
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/types.d.ts +13 -18
- package/dist/security/types.d.ts.map +1 -1
- package/dist/security/validation.d.ts +0 -6
- package/dist/security/validation.d.ts.map +1 -1
- package/dist/shares/internal.js +20 -20
- package/dist/storage/action-runs/failure.js +2 -2
- package/dist/storage/action-runs/idempotency.d.ts +3 -4
- package/dist/storage/action-runs/idempotency.d.ts.map +1 -1
- package/dist/storage/action-runs/in-memory.d.ts +2 -9
- package/dist/storage/action-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/action-runs/index.d.ts +1 -3
- package/dist/storage/action-runs/index.d.ts.map +1 -1
- package/dist/storage/action-runs/provider.js +1 -1
- package/dist/storage/action-runs/record.d.ts +20 -0
- package/dist/storage/action-runs/record.d.ts.map +1 -0
- package/dist/storage/action-runs/types.d.ts +39 -68
- package/dist/storage/action-runs/types.d.ts.map +1 -1
- package/dist/storage/agents/types.d.ts +1 -1
- package/dist/storage/ai-limits/enforcement.js +2 -2
- package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/magic-links.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/oidc-attempts.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/sessions.d.ts +0 -10
- package/dist/storage/auth/in-memory/sessions.d.ts.map +1 -1
- package/dist/storage/auth/in-memory/shared.d.ts +1 -2
- package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
- package/dist/storage/auth/types.d.ts +1 -17
- package/dist/storage/auth/types.d.ts.map +1 -1
- package/dist/storage/connector-connections/provider.js +1 -1
- package/dist/storage/file-upload-sessions/provider.js +10 -10
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +21 -22
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +1 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +9 -12
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/objects/execution-limits.d.ts +1 -1
- package/dist/storage/objects/execution-limits.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +2 -2
- package/dist/storage/projection-runs/provider.js +2 -2
- package/dist/storage/types.d.ts +1 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +10 -10
- package/dist/syncs/index.js +29 -29
- package/dist/testing/action-execution.d.ts +34 -4
- package/dist/testing/action-execution.d.ts.map +1 -1
- package/dist/testing/action-run-storage-contract.d.ts +11 -0
- package/dist/testing/action-run-storage-contract.d.ts.map +1 -0
- package/dist/testing/auth-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +2 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3205 -2946
- package/dist/testing/index.js.map +9 -8
- package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
- package/dist/testing/queues-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +26 -26
- package/dist/webhooks/internal.js.map +1 -1
- package/dist/workers/index.js +1 -1
- package/dist/workflows/index.js +48 -51
- package/dist/workflows/index.js.map +1 -1
- package/package.json +8 -8
- package/src/actions/commit-edits.ts +9 -37
- package/src/actions/errors.ts +0 -4
- package/src/actions/execution.ts +10 -10
- package/src/actions/index.ts +5 -24
- package/src/actions/request.ts +157 -295
- package/src/actions/run/context.ts +193 -0
- package/src/actions/run/edits-commit.ts +102 -0
- package/src/actions/run/effects.ts +105 -0
- package/src/actions/run/execute.ts +113 -0
- package/src/actions/run/executor.ts +314 -0
- package/src/actions/run/normalize.ts +142 -0
- package/src/actions/run/phase-types.ts +20 -0
- package/src/actions/run/phases.ts +150 -0
- package/src/actions/run/run-action.ts +170 -0
- package/src/actions/run/signals.ts +118 -0
- package/src/actions/run/state.ts +95 -0
- package/src/actions/run/types.ts +61 -0
- package/src/actions/run/writeback.ts +79 -0
- package/src/actions/run-authorization.ts +1 -1
- package/src/actions/run-persistence.ts +105 -0
- package/src/actions/types/context.ts +10 -0
- package/src/auth/cookies.ts +3 -20
- package/src/auth/index.ts +0 -6
- package/src/auth/runtime.ts +59 -76
- package/src/auth/session-cache.ts +2 -9
- package/src/auth/types.ts +4 -8
- package/src/auth/validation.ts +0 -2
- package/src/authorization/decision.ts +8 -23
- package/src/authorization/event-visibility.ts +0 -12
- package/src/authorization/grant-kinds.ts +20 -27
- package/src/authorization/index.ts +0 -1
- package/src/authorization/resolve.ts +10 -6
- package/src/deploy/index.ts +0 -1
- package/src/deploy/services.ts +2 -12
- package/src/deploy/types.ts +7 -8
- package/src/deploy/validation.ts +15 -7
- package/src/error-reporting/types.ts +2 -10
- package/src/errors/catalog.ts +13 -0
- package/src/events/definitions.ts +0 -17
- package/src/events/index.ts +0 -14
- package/src/events/scope.ts +0 -12
- package/src/events/selectors/builder.ts +0 -51
- package/src/events/selectors/index.ts +0 -6
- package/src/events/selectors/predicate.ts +0 -2
- package/src/events/selectors/types.ts +7 -65
- package/src/events/types/index.ts +0 -11
- package/src/execution/authorization.ts +11 -5
- package/src/index.ts +2 -33
- package/src/materialization/model.ts +26 -9
- package/src/materializer/README.md +6 -1
- package/src/materializer/edits/commit.ts +42 -32
- package/src/materializer/shared/normalize.ts +25 -14
- package/src/models/execution/embedding.ts +6 -6
- package/src/objects/action/errors.ts +0 -12
- package/src/objects/action/index.ts +3 -3
- package/src/objects/action/request.ts +2 -29
- package/src/objects/execution.ts +2 -2
- package/src/objects/sdk/object-handle.ts +3 -29
- package/src/objects/sdk/object-set.ts +5 -30
- package/src/objects/service/index.ts +0 -1
- package/src/objects/vectors/README.md +4 -0
- package/src/objects/vectors/handle.ts +11 -2
- package/src/objects/vectors/indexing-generate.ts +2 -2
- package/src/objects/vectors/profile.ts +5 -0
- package/src/queues/in-memory.ts +0 -6
- package/src/queues/index.ts +0 -2
- package/src/queues/types.ts +0 -11
- package/src/runtime/host.ts +5 -0
- package/src/runtime/resolve-definitions.ts +0 -1
- package/src/runtime/types.ts +16 -45
- package/src/schedules/builders.ts +1 -4
- package/src/schedules/runtime.ts +0 -41
- package/src/schedules/validation.ts +2 -16
- package/src/security/builders.ts +7 -2
- package/src/security/every.ts +1 -5
- package/src/security/grants.ts +5 -25
- package/src/security/index.ts +0 -3
- package/src/security/membership-policies.ts +3 -1
- package/src/security/public.ts +10 -0
- package/src/security/registry.ts +0 -8
- package/src/security/types.ts +19 -25
- package/src/security/validation.ts +19 -17
- package/src/storage/action-runs/idempotency.ts +13 -41
- package/src/storage/action-runs/in-memory.ts +20 -311
- package/src/storage/action-runs/index.ts +1 -16
- package/src/storage/action-runs/record.ts +130 -0
- package/src/storage/action-runs/types.ts +37 -92
- package/src/storage/agents/types.ts +1 -1
- package/src/storage/auth/in-memory/auth-storage.ts +0 -18
- package/src/storage/auth/in-memory/magic-links.ts +0 -3
- package/src/storage/auth/in-memory/oidc-attempts.ts +0 -3
- package/src/storage/auth/in-memory/sessions.ts +1 -25
- package/src/storage/auth/in-memory/shared.ts +1 -10
- package/src/storage/auth/types.ts +2 -18
- package/src/storage/index.ts +1 -9
- package/src/storage/internal.ts +1 -7
- package/src/storage/objects/execution-limits.ts +3 -2
- package/src/storage/types.ts +2 -4
- package/src/testing/action-execution.ts +73 -13
- package/src/testing/action-run-storage-contract.ts +335 -0
- package/src/testing/auth-storage-contract.ts +14 -107
- package/src/testing/execution-storage-contract.ts +0 -2
- package/src/testing/index.ts +8 -1
- package/src/testing/materializer-storage-contract.ts +174 -18
- package/src/testing/queues-contract.ts +0 -18
- package/dist/actions/run-dispatch.d.ts +0 -25
- package/dist/actions/run-dispatch.d.ts.map +0 -1
- package/dist/actions/worker.d.ts +0 -3
- package/dist/actions/worker.d.ts.map +0 -1
- package/dist/actions/worker.js +0 -325
- package/dist/actions/worker.js.map +0 -11
- package/dist/auth/audience.d.ts +0 -8
- package/dist/auth/audience.d.ts.map +0 -1
- package/dist/authorization/application-access.d.ts +0 -18
- package/dist/authorization/application-access.d.ts.map +0 -1
- package/dist/chunk-1hqwggsn.js.map +0 -12
- package/dist/chunk-2jntasmh.js.map +0 -13
- package/dist/chunk-6h5m9xjx.js.map +0 -40
- package/dist/chunk-85cd7e8c.js +0 -51
- package/dist/chunk-85cd7e8c.js.map +0 -10
- package/dist/chunk-de4z2bj6.js.map +0 -18
- package/dist/chunk-dfm066qg.js.map +0 -11
- package/dist/chunk-enpsx8k5.js.map +0 -10
- package/dist/chunk-fc5zfxy1.js.map +0 -11
- package/dist/chunk-fe52eczz.js.map +0 -49
- package/dist/chunk-fx93hd2n.js +0 -1614
- package/dist/chunk-fx93hd2n.js.map +0 -20
- package/dist/chunk-k6hrnf35.js.map +0 -10
- package/dist/chunk-qkbx3tf6.js.map +0 -24
- package/dist/chunk-qxvp5epv.js +0 -1329
- package/dist/chunk-qxvp5epv.js.map +0 -36
- package/dist/chunk-r2y23egw.js.map +0 -10
- package/dist/chunk-tffvfy6s.js +0 -593
- package/dist/chunk-tffvfy6s.js.map +0 -15
- package/dist/chunk-xt1zt7gv.js.map +0 -13
- package/dist/chunk-y2aq6ag9.js.map +0 -11
- package/dist/chunk-y9jmd7e5.js.map +0 -15
- package/dist/chunk-zvx7h87b.js +0 -12
- package/dist/chunk-zvx7h87b.js.map +0 -10
- package/dist/events/types/actions.d.ts +0 -39
- package/dist/events/types/actions.d.ts.map +0 -1
- package/dist/objects/service/action-service.d.ts +0 -13
- package/dist/objects/service/action-service.d.ts.map +0 -1
- package/dist/security/applications.d.ts +0 -15
- package/dist/security/applications.d.ts.map +0 -1
- package/src/actions/run-dispatch.ts +0 -282
- package/src/actions/worker.ts +0 -2
- package/src/auth/audience.ts +0 -28
- package/src/authorization/application-access.ts +0 -34
- package/src/events/types/actions.ts +0 -42
- package/src/objects/service/action-service.ts +0 -43
- package/src/security/applications.ts +0 -11
- /package/dist/{chunk-rz53yb4v.js.map → chunk-0yh890a4.js.map} +0 -0
- /package/dist/{chunk-vgk3hknm.js.map → chunk-1k89ecfr.js.map} +0 -0
- /package/dist/{chunk-ny3xyvcn.js.map → chunk-1zq2p6g0.js.map} +0 -0
- /package/dist/{chunk-dnmadg9k.js.map → chunk-3t2hgbgd.js.map} +0 -0
- /package/dist/{chunk-22v5bpz3.js.map → chunk-5e43w60z.js.map} +0 -0
- /package/dist/{chunk-7hpdd6r9.js.map → chunk-6p49a5cq.js.map} +0 -0
- /package/dist/{chunk-kkqwzy6h.js.map → chunk-7t429e3f.js.map} +0 -0
- /package/dist/{chunk-ex496vct.js.map → chunk-9dmt152s.js.map} +0 -0
- /package/dist/{chunk-48e3cn2d.js.map → chunk-9gyp8hg1.js.map} +0 -0
- /package/dist/{chunk-zxawp1n2.js.map → chunk-9w055r5b.js.map} +0 -0
- /package/dist/{chunk-4wn7bxxa.js.map → chunk-9ybhtmg4.js.map} +0 -0
- /package/dist/{chunk-vx2yp45y.js.map → chunk-c85m1hyj.js.map} +0 -0
- /package/dist/{chunk-bs7sqkre.js.map → chunk-d09tj99x.js.map} +0 -0
- /package/dist/{chunk-zb77kjth.js.map → chunk-dk8tkk5f.js.map} +0 -0
- /package/dist/{chunk-vjcd8d27.js.map → chunk-fa02jy15.js.map} +0 -0
- /package/dist/{chunk-za5yd58j.js.map → chunk-fkgc1wt8.js.map} +0 -0
- /package/dist/{chunk-6gmfggss.js.map → chunk-t7x8dmn0.js.map} +0 -0
- /package/dist/{chunk-p844e0rn.js.map → chunk-tpn40322.js.map} +0 -0
- /package/dist/{chunk-rt9p8m9t.js.map → chunk-v9xd5wzd.js.map} +0 -0
- /package/dist/{chunk-2vhg6ysa.js.map → chunk-vyf9kfqf.js.map} +0 -0
- /package/dist/{chunk-bwjcehza.js.map → chunk-way52z4h.js.map} +0 -0
- /package/dist/{chunk-qkvz64nd.js.map → chunk-x6m907x7.js.map} +0 -0
- /package/dist/{chunk-yv9czyfr.js.map → chunk-xfs8x8m9.js.map} +0 -0
- /package/dist/{chunk-v6xpd60t.js.map → chunk-yevzdx4y.js.map} +0 -0
- /package/dist/{chunk-qmnnhde6.js.map → chunk-z4m0yz8c.js.map} +0 -0
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ActionBinding,
|
|
3
|
-
ActionDefinition,
|
|
4
|
-
ActionParamsConfig,
|
|
5
|
-
InferActionParams,
|
|
6
|
-
} from "../../actions"
|
|
7
1
|
import type { LinkToken, ObjectRef, ObjectTypeWithTokens, Property } from "../../ontology"
|
|
8
2
|
import type { InferPropertyValue } from "../../ontology/inference"
|
|
9
3
|
import type { RuleDefinition } from "../../rules"
|
|
10
|
-
import type { ActionRunFailure } from "../../storage"
|
|
11
4
|
import type { PropertyChangeOperation } from "../property-changes"
|
|
12
5
|
import type {
|
|
13
6
|
DatasetVersionCommittedEvent,
|
|
@@ -45,33 +38,6 @@ export type RuleEventSelectorContext<
|
|
|
45
38
|
readonly operation: TOperation
|
|
46
39
|
}
|
|
47
40
|
|
|
48
|
-
export type ActionEventSelectorOperation = "requested" | "completed" | "failed"
|
|
49
|
-
|
|
50
|
-
export type ActionEventToken<
|
|
51
|
-
TId extends string = string,
|
|
52
|
-
TParams extends ActionParamsConfig = ActionParamsConfig,
|
|
53
|
-
TBinding extends ActionBinding = ActionBinding,
|
|
54
|
-
> = {
|
|
55
|
-
readonly id: TId
|
|
56
|
-
readonly params: TParams
|
|
57
|
-
readonly binding: TBinding
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type ActionEventTokenOf<TAction extends ActionDefinition> = ActionEventToken<
|
|
61
|
-
TAction["id"],
|
|
62
|
-
TAction["params"],
|
|
63
|
-
TAction["binding"]
|
|
64
|
-
>
|
|
65
|
-
|
|
66
|
-
export type ActionEventSelectorContext<
|
|
67
|
-
TAction extends ActionEventToken = ActionEventToken,
|
|
68
|
-
TOperation extends ActionEventSelectorOperation = ActionEventSelectorOperation,
|
|
69
|
-
> = {
|
|
70
|
-
readonly kind: "action"
|
|
71
|
-
readonly action: TAction
|
|
72
|
-
readonly operation: TOperation
|
|
73
|
-
}
|
|
74
|
-
|
|
75
41
|
export type DatasetEventToken<TId extends string = string> = {
|
|
76
42
|
readonly kind: "dataset"
|
|
77
43
|
readonly id: TId
|
|
@@ -116,7 +82,6 @@ export type EventSelectorContext =
|
|
|
116
82
|
| ObjectEventSelectorContext
|
|
117
83
|
| LinkEventSelectorContext
|
|
118
84
|
| RuleEventSelectorContext
|
|
119
|
-
| ActionEventSelectorContext
|
|
120
85
|
| DatasetEventSelectorContext
|
|
121
86
|
| SyncEventSelectorContext
|
|
122
87
|
| PipelineEventSelectorContext
|
|
@@ -138,15 +103,13 @@ export type EventSelectorEvent<TContext> =
|
|
|
138
103
|
? LinkEventSelectorEvent<TObjectType, TLink>
|
|
139
104
|
: TContext extends RuleEventSelectorContext<infer TRule, infer TOperation>
|
|
140
105
|
? RuleEventSelectorEvent<TRule, TOperation>
|
|
141
|
-
: TContext extends
|
|
142
|
-
?
|
|
143
|
-
: TContext extends
|
|
144
|
-
?
|
|
145
|
-
: TContext extends
|
|
146
|
-
?
|
|
147
|
-
:
|
|
148
|
-
? PipelineEventSelectorEvent<TPipeline, TOperation>
|
|
149
|
-
: never
|
|
106
|
+
: TContext extends DatasetEventSelectorContext<infer TDataset>
|
|
107
|
+
? DatasetEventSelectorEvent<TDataset>
|
|
108
|
+
: TContext extends SyncEventSelectorContext<infer TSync, infer TOperation>
|
|
109
|
+
? SyncEventSelectorEvent<TSync, TOperation>
|
|
110
|
+
: TContext extends PipelineEventSelectorContext<infer TPipeline, infer TOperation>
|
|
111
|
+
? PipelineEventSelectorEvent<TPipeline, TOperation>
|
|
112
|
+
: never
|
|
150
113
|
|
|
151
114
|
export interface ObjectEventSelectorEvent<TObjectType extends ObjectTypeWithTokens> {
|
|
152
115
|
readonly object: {
|
|
@@ -176,19 +139,6 @@ export type RuleEventSelectorEvent<
|
|
|
176
139
|
readonly subject: ObjectRef<RuleSubjectTypeId<TRule>>
|
|
177
140
|
}
|
|
178
141
|
|
|
179
|
-
export type ActionEventSelectorEvent<
|
|
180
|
-
TAction extends ActionEventToken = ActionEventToken,
|
|
181
|
-
TOperation extends ActionEventSelectorOperation = ActionEventSelectorOperation,
|
|
182
|
-
> = {
|
|
183
|
-
readonly actionId: TAction["id"]
|
|
184
|
-
readonly runId: string
|
|
185
|
-
} & ActionSubjectEvent<TAction> &
|
|
186
|
-
(TOperation extends "requested"
|
|
187
|
-
? { readonly params: InferActionParams<TAction["params"]> }
|
|
188
|
-
: TOperation extends "failed"
|
|
189
|
-
? { readonly error: ActionRunFailure }
|
|
190
|
-
: Record<never, never>)
|
|
191
|
-
|
|
192
142
|
export type DatasetEventSelectorEvent<TDataset extends DatasetEventToken = DatasetEventToken> =
|
|
193
143
|
Omit<DatasetVersionCommittedEvent["payload"], "datasetId"> & {
|
|
194
144
|
readonly datasetId: TDataset["id"]
|
|
@@ -220,7 +170,6 @@ export interface EventSelectorSpec<TContext = EventSelectorContext> {
|
|
|
220
170
|
readonly propertyOperation?: PropertyChangeOperation
|
|
221
171
|
readonly linkId?: string
|
|
222
172
|
readonly ruleId?: string
|
|
223
|
-
readonly actionId?: string
|
|
224
173
|
readonly datasetId?: string
|
|
225
174
|
readonly syncId?: string
|
|
226
175
|
readonly pipelineId?: string
|
|
@@ -249,10 +198,3 @@ type ResolveTargetTypeId<TTarget> = TTarget extends readonly string[]
|
|
|
249
198
|
|
|
250
199
|
type RuleSubjectTypeId<TRule extends RuleDefinition> =
|
|
251
200
|
TRule extends RuleDefinition<string, infer TObjectType> ? TObjectType["id"] : string
|
|
252
|
-
|
|
253
|
-
type ActionSubjectEvent<TAction extends ActionEventToken> = TAction["binding"] extends {
|
|
254
|
-
readonly kind: "object"
|
|
255
|
-
readonly objectType: infer TObjectType extends { readonly id: string }
|
|
256
|
-
}
|
|
257
|
-
? { readonly subject: ObjectRef<TObjectType["id"]> }
|
|
258
|
-
: Record<never, never>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { JsonValue } from "../../json"
|
|
2
2
|
import type { OntologyMaterializationEvent } from "../../materialization/events"
|
|
3
3
|
import type { EventOrigin } from "../envelope"
|
|
4
|
-
import type { ActionEvent } from "./actions"
|
|
5
4
|
import type { DatasetEvent } from "./datasets"
|
|
6
5
|
import type { LinkEvent } from "./links"
|
|
7
6
|
import type { ObjectEvent } from "./objects"
|
|
@@ -28,12 +27,6 @@ export type {
|
|
|
28
27
|
PropertyChangeMap,
|
|
29
28
|
PropertyChangeOperation,
|
|
30
29
|
} from "../property-changes"
|
|
31
|
-
export type {
|
|
32
|
-
ActionCompletedEvent,
|
|
33
|
-
ActionEvent,
|
|
34
|
-
ActionFailedEvent,
|
|
35
|
-
ActionRequestedEvent,
|
|
36
|
-
} from "./actions"
|
|
37
30
|
export type { DatasetEvent, DatasetVersionCommittedEvent } from "./datasets"
|
|
38
31
|
export type {
|
|
39
32
|
LinkCreatedEvent,
|
|
@@ -82,7 +75,6 @@ export type DomainEvent =
|
|
|
82
75
|
| ObjectEvent
|
|
83
76
|
| TelemetryEvent
|
|
84
77
|
| LinkEvent
|
|
85
|
-
| ActionEvent
|
|
86
78
|
| ScheduleEvent
|
|
87
79
|
| RuleEvent
|
|
88
80
|
| SyncEvent
|
|
@@ -129,9 +121,6 @@ export type StoredLinkCreatedEvent = StoredOntologyEventOf<"link.created">
|
|
|
129
121
|
export type StoredLinkUpdatedEvent = StoredOntologyEventOf<"link.updated">
|
|
130
122
|
export type StoredLinkMutationEvent = StoredLinkCreatedEvent | StoredLinkUpdatedEvent
|
|
131
123
|
export type StoredLinkDeletedEvent = StoredOntologyEventOf<"link.deleted">
|
|
132
|
-
export type StoredActionRequestedEvent = Extract<StoredDomainEvent, { type: "action.requested" }>
|
|
133
|
-
export type StoredActionCompletedEvent = Extract<StoredDomainEvent, { type: "action.completed" }>
|
|
134
|
-
export type StoredActionFailedEvent = Extract<StoredDomainEvent, { type: "action.failed" }>
|
|
135
124
|
export type StoredScheduleTriggeredEvent = Extract<
|
|
136
125
|
StoredDomainEvent,
|
|
137
126
|
{ type: "schedule.triggered" }
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { isDeepStrictEqual } from "node:util"
|
|
2
2
|
import { agentServiceAccountId } from "../agents/identity"
|
|
3
3
|
import type { Principal } from "../auth"
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
SINGLETON_GRANT_KIND_KEYS,
|
|
6
|
+
type SingletonGrantKind,
|
|
7
|
+
TARGETED_GRANT_KIND_KEYS,
|
|
8
|
+
type TargetedGrantKind,
|
|
9
|
+
} from "../authorization/grant-kinds"
|
|
5
10
|
import type { AuthorizationContext, GrantIndex } from "../authorization/types"
|
|
6
11
|
import { createSixbError } from "../errors/internal"
|
|
7
12
|
import type { ObjectRef } from "../ontology"
|
|
@@ -586,10 +591,11 @@ function snapshotAuthorizationContext(
|
|
|
586
591
|
for (const kind of TARGETED_GRANT_KIND_KEYS) {
|
|
587
592
|
grants[kind] = new ImmutableGrantSet(context.grants[kind])
|
|
588
593
|
}
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
594
|
+
const singletons = {} as Record<SingletonGrantKind, boolean>
|
|
595
|
+
for (const kind of SINGLETON_GRANT_KIND_KEYS) {
|
|
596
|
+
singletons[kind] = context.grants[kind]
|
|
597
|
+
}
|
|
598
|
+
const frozenGrants: GrantIndex = Object.freeze({ ...grants, ...singletons })
|
|
593
599
|
return Object.freeze({
|
|
594
600
|
principal,
|
|
595
601
|
...(context.sessionId === undefined ? {} : { sessionId: context.sessionId }),
|
package/src/index.ts
CHANGED
|
@@ -116,12 +116,8 @@ export type {
|
|
|
116
116
|
ObjectActionDefinition,
|
|
117
117
|
ObjectActionParamsBuilder,
|
|
118
118
|
ObjectActionPhaseBuilder,
|
|
119
|
-
RequestActionAndWaitInput,
|
|
120
|
-
RequestActionAndWaitOptions,
|
|
121
119
|
RequestActionInput,
|
|
122
120
|
RequestActionOptions,
|
|
123
|
-
RequestActionResult,
|
|
124
|
-
WaitForActionRunInput,
|
|
125
121
|
} from "./actions"
|
|
126
122
|
export {
|
|
127
123
|
ActionDefinitionError,
|
|
@@ -137,11 +133,7 @@ export {
|
|
|
137
133
|
* it to write `catch (error) { if (error instanceof EditBatchError) … }`.
|
|
138
134
|
*/
|
|
139
135
|
export { EditBatchError } from "./edits"
|
|
140
|
-
export {
|
|
141
|
-
ActionRunFailedError,
|
|
142
|
-
ActionRunTimeoutError,
|
|
143
|
-
ActionValidationError,
|
|
144
|
-
} from "./objects/action"
|
|
136
|
+
export { ActionRunFailedError, ActionValidationError } from "./objects/action"
|
|
145
137
|
|
|
146
138
|
// ── Datasets ────────────────────────────────────────────────
|
|
147
139
|
|
|
@@ -233,17 +225,7 @@ export type {
|
|
|
233
225
|
// ── Events ──────────────────────────────────────────────────
|
|
234
226
|
|
|
235
227
|
export type {
|
|
236
|
-
ActionCompletedEvent,
|
|
237
|
-
ActionEvent,
|
|
238
228
|
ActionEventOrigin,
|
|
239
|
-
ActionEventSelectorBuilder,
|
|
240
|
-
ActionEventSelectorContext,
|
|
241
|
-
ActionEventSelectorEvent,
|
|
242
|
-
ActionEventSelectorOperation,
|
|
243
|
-
ActionEventToken,
|
|
244
|
-
ActionEventTokenOf,
|
|
245
|
-
ActionFailedEvent,
|
|
246
|
-
ActionRequestedEvent,
|
|
247
229
|
DatasetEvent,
|
|
248
230
|
DatasetEventSelectorBuilder,
|
|
249
231
|
DatasetEventSelectorContext,
|
|
@@ -409,8 +391,6 @@ export {
|
|
|
409
391
|
|
|
410
392
|
export type {
|
|
411
393
|
AuthCookieOptions,
|
|
412
|
-
AuthSessionAudience,
|
|
413
|
-
AuthSessionAudienceOptions,
|
|
414
394
|
AuthSessionOptions,
|
|
415
395
|
AuthStrategy,
|
|
416
396
|
AuthStrategyKind,
|
|
@@ -419,22 +399,14 @@ export type {
|
|
|
419
399
|
Principal,
|
|
420
400
|
SixbAuthConfig,
|
|
421
401
|
} from "./auth"
|
|
422
|
-
export {
|
|
423
|
-
DEFAULT_AUTH_SESSION_AUDIENCE,
|
|
424
|
-
isValidAuthSessionAudience,
|
|
425
|
-
principalsEqual,
|
|
426
|
-
resolveAuthSessionAudience,
|
|
427
|
-
SYSTEM_PRINCIPAL,
|
|
428
|
-
} from "./auth"
|
|
402
|
+
export { principalsEqual, SYSTEM_PRINCIPAL } from "./auth"
|
|
429
403
|
|
|
430
404
|
// ── Authorization ──────────────────────────────────────────
|
|
431
405
|
|
|
432
406
|
export type { AuthorizationContext, GrantIndex, GrantKind } from "./authorization"
|
|
433
407
|
export {
|
|
434
408
|
AuthorizationError,
|
|
435
|
-
canAccessApplication,
|
|
436
409
|
isAllowed,
|
|
437
|
-
isApplicationAccessControlled,
|
|
438
410
|
resolveAuthorizationContext,
|
|
439
411
|
} from "./authorization"
|
|
440
412
|
|
|
@@ -458,10 +430,8 @@ export type {
|
|
|
458
430
|
// ── Security Definitions ───────────────────────────────────
|
|
459
431
|
|
|
460
432
|
export type {
|
|
461
|
-
AccessGrant,
|
|
462
433
|
AgentRunGrant,
|
|
463
434
|
AppendGrant,
|
|
464
|
-
ApplicationDefinition,
|
|
465
435
|
ApplyGrant,
|
|
466
436
|
BreadthSelector,
|
|
467
437
|
BreadthTarget,
|
|
@@ -494,7 +464,6 @@ export type {
|
|
|
494
464
|
ViewGrantTarget,
|
|
495
465
|
} from "./security"
|
|
496
466
|
export {
|
|
497
|
-
applications,
|
|
498
467
|
can,
|
|
499
468
|
defineGroup,
|
|
500
469
|
defineMarking,
|
|
@@ -3,6 +3,7 @@ import type { EventOrigin } from "../events/envelope"
|
|
|
3
3
|
import type { PropertyChange, PropertyChangeMap } from "../events/property-changes"
|
|
4
4
|
import type { JsonValue } from "../json"
|
|
5
5
|
import type { ProjectionProtocolIdentity, ProjectionRunFailureCode } from "../projections/types"
|
|
6
|
+
import type { RecordActionRunInput } from "../storage/action-runs/types"
|
|
6
7
|
import type { ObjectVectorWrite } from "./vectors"
|
|
7
8
|
|
|
8
9
|
export type { ProjectionProtocolIdentity } from "../projections/types"
|
|
@@ -120,16 +121,32 @@ interface BaseOntologyEditCommit {
|
|
|
120
121
|
readonly operations: readonly OntologyEditOperation[]
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
interface AtomicOntologyEditCommit extends BaseOntologyEditCommit {
|
|
125
|
+
readonly mode: "atomic"
|
|
126
|
+
readonly vectorWrites?: readonly ObjectVectorWrite[]
|
|
127
|
+
readonly expectedObjects: readonly ExpectedObjectRevision[]
|
|
128
|
+
readonly expectedLinks: readonly ExpectedLinkRevision[]
|
|
129
|
+
readonly expectedLinkScopes: readonly ExpectedLinkScopeRevision[]
|
|
130
|
+
}
|
|
131
|
+
|
|
123
132
|
export type OntologyEditCommit =
|
|
124
|
-
| (
|
|
125
|
-
readonly
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
| (AtomicOntologyEditCommit & {
|
|
134
|
+
readonly source: {
|
|
135
|
+
readonly kind: "action"
|
|
136
|
+
readonly actionId: string
|
|
137
|
+
readonly runId: string
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The run's terminal record, inserted in the commit's transaction so that its edits never
|
|
141
|
+
* land without the run that made them.
|
|
142
|
+
*
|
|
143
|
+
* It is not part of the commit's intent: replaying the commit returns the stored commit and
|
|
144
|
+
* inserts nothing, whatever record the replay carries.
|
|
145
|
+
*/
|
|
146
|
+
readonly run: RecordActionRunInput
|
|
147
|
+
})
|
|
148
|
+
| (AtomicOntologyEditCommit & {
|
|
149
|
+
readonly source: { readonly kind: "runtime"; readonly requestId: string }
|
|
133
150
|
})
|
|
134
151
|
| (BaseOntologyEditCommit & {
|
|
135
152
|
readonly mode: "continue"
|
|
@@ -158,7 +158,12 @@ its mutable overrides let operation N+1 observe operation N. In `continue` mode,
|
|
|
158
158
|
operation rolls back only its working override; provider and infrastructure failures abort the
|
|
159
159
|
whole transaction.
|
|
160
160
|
|
|
161
|
-
Action-backed edits
|
|
161
|
+
Action-backed edits carry the run's terminal record. The commit validates the trusted Action
|
|
162
|
+
execution and the record's `executionId`, then inserts the record in its own transaction before new
|
|
163
|
+
work, so edits never land without the run that made them and a run id commits once: a second insert
|
|
164
|
+
for it fails the commit. An exact replay returns the stored commit and inserts nothing; the carried
|
|
165
|
+
record is not part of the commit's intent. The edits' semantic result lives only in the ontology
|
|
166
|
+
commit, correlated by Action origin; the Action run is not a second commit ledger.
|
|
162
167
|
|
|
163
168
|
## Telemetry append
|
|
164
169
|
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
OntologyMaterializationOrigin,
|
|
10
10
|
OntologyOperationOutcome,
|
|
11
11
|
} from "../../materialization/model"
|
|
12
|
-
import type { Storage } from "../../storage"
|
|
12
|
+
import type { RecordActionRunInput, Storage } from "../../storage"
|
|
13
13
|
import type { MaterializationSession, OntologyCommitWrite } from "../../storage/ontology"
|
|
14
14
|
import type { MaterializerContext, MaterializerStorage } from "../context"
|
|
15
15
|
import { replayCommit, withSerializationRetry } from "../execution/commit-lifecycle"
|
|
@@ -67,7 +67,7 @@ async function prepareEditCommit(
|
|
|
67
67
|
const identity = createTimedCommitIdentity({
|
|
68
68
|
projectId: context.projectId,
|
|
69
69
|
idempotencyKey,
|
|
70
|
-
normalizedCallerIntent: input,
|
|
70
|
+
normalizedCallerIntent: editIntent(input),
|
|
71
71
|
now: context.clock(),
|
|
72
72
|
})
|
|
73
73
|
return {
|
|
@@ -86,24 +86,15 @@ function editIdempotencyKey(input: NormalizedEditCommit): string {
|
|
|
86
86
|
return createRuntimeIdempotencyKey(input.source.requestId)
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
):
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"Storage does not provide Action run capabilities required by this commit."
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
const run = await storage.actionRuns.lockForMaterialization({
|
|
102
|
-
projectId,
|
|
103
|
-
actionId: input.source.actionId,
|
|
104
|
-
runId: input.source.runId,
|
|
105
|
-
})
|
|
106
|
-
assertMaterializerRunExecution(execution, run.executionId, `Action run '${run.id}'`)
|
|
89
|
+
/**
|
|
90
|
+
* What a replay of the commit must repeat: its edits, without the run record an Action commit
|
|
91
|
+
* carries. That record is written by the commit that inserts it, and its timestamps differ on
|
|
92
|
+
* every attempt.
|
|
93
|
+
*/
|
|
94
|
+
function editIntent(input: NormalizedEditCommit): unknown {
|
|
95
|
+
if (!("run" in input)) return input
|
|
96
|
+
const { run: _run, ...intent } = input
|
|
97
|
+
return intent
|
|
107
98
|
}
|
|
108
99
|
|
|
109
100
|
async function validateMutationExecution(
|
|
@@ -122,24 +113,48 @@ async function validateMutationExecution(
|
|
|
122
113
|
id: input.source.actionId,
|
|
123
114
|
runId: input.source.runId,
|
|
124
115
|
})
|
|
125
|
-
|
|
116
|
+
const run = requireActionRun(input)
|
|
117
|
+
if (run.projectId !== projectId || run.id !== input.source.runId) {
|
|
126
118
|
throw new MaterializationValidationError(
|
|
127
|
-
|
|
119
|
+
`The record carried by Action run '${input.source.runId}' belongs to another run.`
|
|
128
120
|
)
|
|
129
121
|
}
|
|
130
|
-
const run = await storage.actionRuns.getById({ projectId, id: input.source.runId })
|
|
131
|
-
if (!run) {
|
|
132
|
-
throw new MaterializationValidationError(`Action run '${input.source.runId}' was not found.`)
|
|
133
|
-
}
|
|
134
122
|
if (run.actionId !== input.source.actionId) {
|
|
135
123
|
throw new MaterializationConflictError(
|
|
136
124
|
"run-correlation",
|
|
137
125
|
`Action run '${run.id}' does not belong to action '${input.source.actionId}'.`
|
|
138
126
|
)
|
|
139
127
|
}
|
|
128
|
+
if (run.status !== "succeeded" || run.phase !== "commit") {
|
|
129
|
+
throw new MaterializationValidationError(
|
|
130
|
+
`Action run '${run.id}' commits its edits only as a succeeded run in its commit phase.`
|
|
131
|
+
)
|
|
132
|
+
}
|
|
140
133
|
assertMaterializerRunExecution(execution, run.executionId, `Action run '${run.id}'`)
|
|
141
134
|
}
|
|
142
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Insert the run that made these edits, in the commit's transaction: the edits, their outbox facts,
|
|
138
|
+
* and the run record land together or not at all. A run already recorded fails the commit, since a
|
|
139
|
+
* run id is recorded once.
|
|
140
|
+
*/
|
|
141
|
+
async function recordActionRun(storage: Storage, input: NormalizedEditCommit): Promise<void> {
|
|
142
|
+
if (input.source.kind !== "action") return
|
|
143
|
+
if (!storage.actionRuns) {
|
|
144
|
+
throw new MaterializationValidationError(
|
|
145
|
+
"Storage does not provide Action run capabilities required by this commit."
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
await storage.actionRuns.record(requireActionRun(input))
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function requireActionRun(input: NormalizedEditCommit): RecordActionRunInput {
|
|
152
|
+
if (!("run" in input)) {
|
|
153
|
+
throw new MaterializationValidationError("An Action commit must carry its run's record.")
|
|
154
|
+
}
|
|
155
|
+
return input.run
|
|
156
|
+
}
|
|
157
|
+
|
|
143
158
|
async function executeEditCommit(
|
|
144
159
|
context: MaterializerContext,
|
|
145
160
|
command: PreparedEditCommit
|
|
@@ -167,12 +182,7 @@ async function executeEditTransaction(
|
|
|
167
182
|
)
|
|
168
183
|
if (replay) return replay
|
|
169
184
|
|
|
170
|
-
await
|
|
171
|
-
storage,
|
|
172
|
-
context.projectId,
|
|
173
|
-
command.input,
|
|
174
|
-
command.execution
|
|
175
|
-
)
|
|
185
|
+
await recordActionRun(storage, command.input)
|
|
176
186
|
|
|
177
187
|
const session = await beginEditMaterialization(context, storage, command)
|
|
178
188
|
const workingState = await loadEditWorkingState(
|
|
@@ -284,17 +284,6 @@ export function normalizeOntologyEditCommit(input: OntologyEditCommit): Ontology
|
|
|
284
284
|
})
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
const source =
|
|
288
|
-
input.source.kind === "action"
|
|
289
|
-
? Object.freeze({
|
|
290
|
-
kind: "action" as const,
|
|
291
|
-
actionId: normalizeNonblank(input.source.actionId, "Action id"),
|
|
292
|
-
runId: normalizeNonblank(input.source.runId, "Action run id"),
|
|
293
|
-
})
|
|
294
|
-
: Object.freeze({
|
|
295
|
-
kind: "runtime" as const,
|
|
296
|
-
requestId: normalizeNonblank(input.source.requestId, "Runtime request id"),
|
|
297
|
-
})
|
|
298
287
|
if (input.vectorWrites?.length && (operations.length || input.source.kind !== "runtime")) {
|
|
299
288
|
throw new MaterializationValidationError(
|
|
300
289
|
"Vector writes require a dedicated atomic runtime commit."
|
|
@@ -305,12 +294,11 @@ export function normalizeOntologyEditCommit(input: OntologyEditCommit): Ontology
|
|
|
305
294
|
const expectedLinks = input.expectedLinks.map(normalizeExpectedLink)
|
|
306
295
|
const expectedLinkScopes = input.expectedLinkScopes.map(normalizeExpectedLinkScope)
|
|
307
296
|
|
|
308
|
-
|
|
309
|
-
mode: "atomic",
|
|
297
|
+
const atomic = {
|
|
298
|
+
mode: "atomic" as const,
|
|
310
299
|
...(input.vectorWrites === undefined
|
|
311
300
|
? {}
|
|
312
301
|
: { vectorWrites: structuredClone(input.vectorWrites) }),
|
|
313
|
-
source,
|
|
314
302
|
operations: Object.freeze(operations),
|
|
315
303
|
expectedObjects: deduplicateExpectations(
|
|
316
304
|
expectedObjects,
|
|
@@ -327,6 +315,29 @@ export function normalizeOntologyEditCommit(input: OntologyEditCommit): Ontology
|
|
|
327
315
|
(value) => linkScopeKey(value.source, value.linkId),
|
|
328
316
|
"Expected link scopes"
|
|
329
317
|
),
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (input.source.kind === "action") {
|
|
321
|
+
if (!("run" in input) || input.run === undefined) {
|
|
322
|
+
throw new MaterializationValidationError("An Action commit must carry its run's record.")
|
|
323
|
+
}
|
|
324
|
+
return Object.freeze({
|
|
325
|
+
...atomic,
|
|
326
|
+
source: Object.freeze({
|
|
327
|
+
kind: "action" as const,
|
|
328
|
+
actionId: normalizeNonblank(input.source.actionId, "Action id"),
|
|
329
|
+
runId: normalizeNonblank(input.source.runId, "Action run id"),
|
|
330
|
+
}),
|
|
331
|
+
// Validated by the Action run storage when the commit inserts it.
|
|
332
|
+
run: structuredClone(input.run),
|
|
333
|
+
})
|
|
334
|
+
}
|
|
335
|
+
return Object.freeze({
|
|
336
|
+
...atomic,
|
|
337
|
+
source: Object.freeze({
|
|
338
|
+
kind: "runtime" as const,
|
|
339
|
+
requestId: normalizeNonblank(input.source.requestId, "Runtime request id"),
|
|
340
|
+
}),
|
|
330
341
|
})
|
|
331
342
|
}
|
|
332
343
|
|
|
@@ -58,9 +58,9 @@ async function executeEmbedding(
|
|
|
58
58
|
if (purpose !== undefined && purpose !== "document" && purpose !== "query") {
|
|
59
59
|
throw new TypeError("[SixbModels] Embedding purpose must be 'document' or 'query'.")
|
|
60
60
|
}
|
|
61
|
+
// The caller owns the deadline: only it knows whether anyone is waiting for the result.
|
|
61
62
|
const signal = session.signal(input.signal)
|
|
62
|
-
|
|
63
|
-
requestSignal.throwIfAborted()
|
|
63
|
+
signal.throwIfAborted()
|
|
64
64
|
if (!texts.length) return { vectors: [] }
|
|
65
65
|
|
|
66
66
|
const accounting = await session.accounting()
|
|
@@ -72,7 +72,7 @@ async function executeEmbedding(
|
|
|
72
72
|
"[SixbModels] Resolved embedding model identity does not match the selected model."
|
|
73
73
|
)
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
signal.throwIfAborted()
|
|
76
76
|
const callId = `call_${randomUUID()}`
|
|
77
77
|
const tokens = texts.reduce(
|
|
78
78
|
(sum, text) => sum + Math.ceil(new TextEncoder().encode(text).byteLength / 4),
|
|
@@ -92,8 +92,8 @@ async function executeEmbedding(
|
|
|
92
92
|
|
|
93
93
|
let result: EmbeddingModelResult
|
|
94
94
|
try {
|
|
95
|
-
|
|
96
|
-
result = await model.embed({ texts, purpose, signal
|
|
95
|
+
signal.throwIfAborted()
|
|
96
|
+
result = await model.embed({ texts, purpose, signal })
|
|
97
97
|
} catch (error) {
|
|
98
98
|
if (error instanceof EmbeddingModelResponseError) {
|
|
99
99
|
await recordEmbedding(accounting, model, callId, error.metadata)
|
|
@@ -105,7 +105,7 @@ async function executeEmbedding(
|
|
|
105
105
|
}
|
|
106
106
|
// Account before cancellation, vector validation or the materializer's optimistic write.
|
|
107
107
|
await recordEmbedding(accounting, model, callId, result ?? {})
|
|
108
|
-
|
|
108
|
+
signal.throwIfAborted()
|
|
109
109
|
return result
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -42,15 +42,3 @@ export class ActionRunFailedError extends Error {
|
|
|
42
42
|
this.finishedAt = payload.finishedAt
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
export class ActionRunTimeoutError extends Error {
|
|
47
|
-
readonly name = "ActionRunTimeoutError"
|
|
48
|
-
readonly runId: string
|
|
49
|
-
readonly timeoutMs: number
|
|
50
|
-
|
|
51
|
-
constructor(params: { runId: string; timeoutMs: number }) {
|
|
52
|
-
super(`Action run '${params.runId}' did not finish within ${params.timeoutMs}ms.`)
|
|
53
|
-
this.runId = params.runId
|
|
54
|
-
this.timeoutMs = params.timeoutMs
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ActionRunFailedError,
|
|
2
|
-
export type {
|
|
3
|
-
export { requestAction
|
|
1
|
+
export { ActionRunFailedError, ActionValidationError } from "./errors"
|
|
2
|
+
export type { RequestActionOptions } from "./request"
|
|
3
|
+
export { requestAction } from "./request"
|
|
@@ -5,16 +5,13 @@
|
|
|
5
5
|
* helpers delegate here by supplying an object subject.
|
|
6
6
|
*/
|
|
7
7
|
import {
|
|
8
|
-
type RequestActionAndWaitOptions,
|
|
9
8
|
type RequestActionOptions,
|
|
10
|
-
type RequestActionResult,
|
|
11
9
|
requestAction as requestRuntimeAction,
|
|
12
|
-
requestActionAndWait as requestRuntimeActionAndWait,
|
|
13
10
|
} from "../../actions/request"
|
|
14
11
|
import type { ActionRunRecord } from "../../storage"
|
|
15
12
|
import type { ExecutionObjectContext } from "../context"
|
|
16
13
|
|
|
17
|
-
export type {
|
|
14
|
+
export type { RequestActionOptions }
|
|
18
15
|
|
|
19
16
|
export async function requestAction(
|
|
20
17
|
ctx: ExecutionObjectContext,
|
|
@@ -24,30 +21,8 @@ export async function requestAction(
|
|
|
24
21
|
params?: Record<string, unknown>
|
|
25
22
|
options?: RequestActionOptions
|
|
26
23
|
}
|
|
27
|
-
): Promise<RequestActionResult> {
|
|
28
|
-
return requestRuntimeAction(ctx, ctx.execution, {
|
|
29
|
-
actionId: params.actionId,
|
|
30
|
-
subject: {
|
|
31
|
-
kind: "object",
|
|
32
|
-
objectTypeId: ctx.objectType.id,
|
|
33
|
-
primaryId: params.primaryId,
|
|
34
|
-
},
|
|
35
|
-
params: params.params,
|
|
36
|
-
runId: params.options?.runId,
|
|
37
|
-
signal: params.options?.signal,
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export async function requestActionAndWait(
|
|
42
|
-
ctx: ExecutionObjectContext,
|
|
43
|
-
params: {
|
|
44
|
-
primaryId: string
|
|
45
|
-
actionId: string
|
|
46
|
-
params?: Record<string, unknown>
|
|
47
|
-
options?: RequestActionAndWaitOptions
|
|
48
|
-
}
|
|
49
24
|
): Promise<ActionRunRecord> {
|
|
50
|
-
return
|
|
25
|
+
return requestRuntimeAction(ctx, ctx.execution, {
|
|
51
26
|
actionId: params.actionId,
|
|
52
27
|
subject: {
|
|
53
28
|
kind: "object",
|
|
@@ -56,8 +31,6 @@ export async function requestActionAndWait(
|
|
|
56
31
|
},
|
|
57
32
|
params: params.params,
|
|
58
33
|
runId: params.options?.runId,
|
|
59
|
-
timeoutMs: params.options?.timeoutMs,
|
|
60
34
|
signal: params.options?.signal,
|
|
61
|
-
onRequested: params.options?.onRequested,
|
|
62
35
|
})
|
|
63
36
|
}
|