@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
package/src/security/grants.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Grant builders for role definitions.
|
|
3
3
|
*
|
|
4
|
-
* Grants are plain data referencing
|
|
4
|
+
* Grants are plain data referencing runtime definitions
|
|
5
5
|
* by id. They carry no enforcement logic — the authorization engine expands
|
|
6
6
|
* each grant's selection into per-principal id sets at startup, so runtime
|
|
7
7
|
* checks stay simple `set.has(id)` lookups.
|
|
@@ -31,10 +31,8 @@ import {
|
|
|
31
31
|
isBreadthSelector,
|
|
32
32
|
} from "./every"
|
|
33
33
|
import type {
|
|
34
|
-
AccessGrant,
|
|
35
34
|
AgentRunGrant,
|
|
36
35
|
AppendGrant,
|
|
37
|
-
ApplicationDefinition,
|
|
38
36
|
ApplyGrant,
|
|
39
37
|
EditGrant,
|
|
40
38
|
ManageGrant,
|
|
@@ -54,7 +52,7 @@ const VIEW_TARGETS = ["object", "dataset"] as const
|
|
|
54
52
|
const RUN_TARGETS = ["workflow", "sync", "pipeline"] as const
|
|
55
53
|
|
|
56
54
|
/**
|
|
57
|
-
*
|
|
55
|
+
* Six of the eight targets carry a `kind` discriminant naming themselves. The other two — an
|
|
58
56
|
* `ObjectType` and an `ActionDefinition` — carry none, and each appears in exactly one builder that
|
|
59
57
|
* allows no other undiscriminated target, so the allowed set names them unambiguously.
|
|
60
58
|
*/
|
|
@@ -63,7 +61,6 @@ const TARGET_BY_DEFINITION_KIND: Readonly<Partial<Record<string, BreadthTarget>>
|
|
|
63
61
|
sync: "sync",
|
|
64
62
|
pipeline: "pipeline",
|
|
65
63
|
workflow: "workflow",
|
|
66
|
-
application: "application",
|
|
67
64
|
connector: "connector",
|
|
68
65
|
share: "share",
|
|
69
66
|
}
|
|
@@ -82,7 +79,7 @@ function targetOfDefinition<TTarget extends BreadthTarget>(
|
|
|
82
79
|
// `spec.universeKey` with a `TypeError` naming neither the role nor the definition.
|
|
83
80
|
if (discriminated) {
|
|
84
81
|
if (!isAllowedTarget(discriminated, allowedTargets)) {
|
|
85
|
-
// "one targeting x", not "a x definition":
|
|
82
|
+
// "one targeting x", not "a x definition": object and action start with a vowel, and
|
|
86
83
|
// this string ships in a release. Same reason the selector branch below writes no article.
|
|
87
84
|
throw new SecurityValidationError(
|
|
88
85
|
`[Sixb] ${label} accepts ${allowedTargets.join(" or ")} definitions, but received one targeting ${discriminated}.`
|
|
@@ -158,11 +155,6 @@ function resolveGrant<TDefinition extends { readonly id?: unknown }, TTarget ext
|
|
|
158
155
|
return { target, selection: { all: false, ids } }
|
|
159
156
|
}
|
|
160
157
|
|
|
161
|
-
function access(input: GrantInput<ApplicationDefinition, "application">): AccessGrant {
|
|
162
|
-
const { selection } = resolveGrant(input, "can.access", ["application"])
|
|
163
|
-
return { kind: "grant", capability: "access", target: "application", selection }
|
|
164
|
-
}
|
|
165
|
-
|
|
166
158
|
function view<const TObjectTypeId extends string>(
|
|
167
159
|
input: ShareTarget<TObjectTypeId>
|
|
168
160
|
): ShareViewGrantBuilder<TObjectTypeId>
|
|
@@ -270,13 +262,7 @@ function observe(input: "logs" | AgentUsageReference): ObserveGrant {
|
|
|
270
262
|
if (input !== "logs" && !isAgentUsageReference(input)) {
|
|
271
263
|
throw new SecurityValidationError('[Sixb] can.observe accepts "logs" or agent.usage.')
|
|
272
264
|
}
|
|
273
|
-
|
|
274
|
-
return {
|
|
275
|
-
kind: "grant",
|
|
276
|
-
capability: "observe",
|
|
277
|
-
target,
|
|
278
|
-
selection: { all: false, ids: [target] },
|
|
279
|
-
}
|
|
265
|
+
return { kind: "grant", capability: "observe", target: input === "logs" ? "logs" : "aiUsage" }
|
|
280
266
|
}
|
|
281
267
|
|
|
282
268
|
function manage(input: GrantInput<ConnectorDefinition, "connector">): ManageGrant<"connector">
|
|
@@ -285,12 +271,7 @@ function manage(
|
|
|
285
271
|
input: GrantInput<ConnectorDefinition, "connector"> | AgentUsageReference
|
|
286
272
|
): ManageGrant {
|
|
287
273
|
if (isAgentUsageReference(input)) {
|
|
288
|
-
return {
|
|
289
|
-
kind: "grant",
|
|
290
|
-
capability: "manage",
|
|
291
|
-
target: "aiUsage",
|
|
292
|
-
selection: { all: false, ids: ["aiUsage"] },
|
|
293
|
-
}
|
|
274
|
+
return { kind: "grant", capability: "manage", target: "aiUsage" }
|
|
294
275
|
}
|
|
295
276
|
return {
|
|
296
277
|
kind: "grant",
|
|
@@ -301,7 +282,6 @@ function manage(
|
|
|
301
282
|
}
|
|
302
283
|
|
|
303
284
|
export const can = {
|
|
304
|
-
access,
|
|
305
285
|
view,
|
|
306
286
|
edit,
|
|
307
287
|
append,
|
package/src/security/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { applications } from "./applications"
|
|
2
1
|
export type {
|
|
3
2
|
DefineGroupOptions,
|
|
4
3
|
DefineMarkingOptions,
|
|
@@ -20,10 +19,8 @@ export {
|
|
|
20
19
|
export type { SecurityDefinitionCatalog, SecurityRegistryOptions } from "./registry"
|
|
21
20
|
export { SecurityRegistry } from "./registry"
|
|
22
21
|
export type {
|
|
23
|
-
AccessGrant,
|
|
24
22
|
AgentRunGrant,
|
|
25
23
|
AppendGrant,
|
|
26
|
-
ApplicationDefinition,
|
|
27
24
|
ApplyGrant,
|
|
28
25
|
EditGrant,
|
|
29
26
|
GrantCapability,
|
|
@@ -10,7 +10,7 @@ export interface MembershipPolicyScope {
|
|
|
10
10
|
readonly operations: Readonly<Record<MembershipOperation, MembershipOperationScope>>
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const MEMBERSHIP_OPERATIONS = ["invite", "assignGroups", "suspend"] as const
|
|
13
|
+
const MEMBERSHIP_OPERATIONS = ["invite", "assignGroups", "suspend", "serviceAccounts"] as const
|
|
14
14
|
|
|
15
15
|
export function resolveMembershipPolicyScope(input: {
|
|
16
16
|
readonly membershipPolicies: readonly MembershipPolicyDefinition[]
|
|
@@ -40,6 +40,7 @@ export function resolveMembershipPolicyScope(input: {
|
|
|
40
40
|
invite: freezeOperationScope(operations.invite),
|
|
41
41
|
assignGroups: freezeOperationScope(operations.assignGroups),
|
|
42
42
|
suspend: freezeOperationScope(operations.suspend),
|
|
43
|
+
serviceAccounts: freezeOperationScope(operations.serviceAccounts),
|
|
43
44
|
},
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -83,6 +84,7 @@ function createEmptyOperationScopes(): Record<
|
|
|
83
84
|
invite: { policyIds: [], groupIds: new Set<string>() },
|
|
84
85
|
assignGroups: { policyIds: [], groupIds: new Set<string>() },
|
|
85
86
|
suspend: { policyIds: [], groupIds: new Set<string>() },
|
|
87
|
+
serviceAccounts: { policyIds: [], groupIds: new Set<string>() },
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe security entrypoint (`@sixb/core/security`).
|
|
3
|
+
*
|
|
4
|
+
* Group files import `defineGroup` from here, because an app layout imports groups to decide who
|
|
5
|
+
* sees which screens, and the browser cannot load the `@sixb/core` root.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type { DefineGroupOptions } from "./builders"
|
|
9
|
+
export { defineGroup } from "./builders"
|
|
10
|
+
export type { GroupDefinition } from "./types"
|
package/src/security/registry.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type ResolvedRole, resolveRoleGrants } from "../authorization"
|
|
2
|
-
import { APPLICATION_IDS } from "./applications"
|
|
3
2
|
import type {
|
|
4
3
|
GroupDefinition,
|
|
5
4
|
MarkingDefinition,
|
|
@@ -26,7 +25,6 @@ export interface SecurityRegistryOptions {
|
|
|
26
25
|
readonly groups?: readonly GroupDefinition[]
|
|
27
26
|
readonly roles?: readonly RoleDefinition[]
|
|
28
27
|
readonly membershipPolicies?: readonly MembershipPolicyDefinition[]
|
|
29
|
-
readonly applicationIds?: ReadonlySet<string>
|
|
30
28
|
readonly objectTypeIds?: ReadonlySet<string>
|
|
31
29
|
readonly datasetIds?: ReadonlySet<string>
|
|
32
30
|
readonly actionIds?: ReadonlySet<string>
|
|
@@ -52,7 +50,6 @@ export class SecurityRegistry implements SecurityDefinitionCatalog {
|
|
|
52
50
|
groups: input.groups ?? [],
|
|
53
51
|
roles: input.roles ?? [],
|
|
54
52
|
membershipPolicies: input.membershipPolicies ?? [],
|
|
55
|
-
applicationIds: input.applicationIds ?? APPLICATION_IDS,
|
|
56
53
|
objectTypeIds: input.objectTypeIds,
|
|
57
54
|
datasetIds: input.datasetIds,
|
|
58
55
|
actionIds: input.actionIds,
|
|
@@ -61,13 +58,10 @@ export class SecurityRegistry implements SecurityDefinitionCatalog {
|
|
|
61
58
|
pipelineIds: input.pipelineIds,
|
|
62
59
|
agentAvailable: input.agentAvailable,
|
|
63
60
|
connectorIds: input.connectorIds,
|
|
64
|
-
observableIds: new Set(["logs", "aiUsage"]),
|
|
65
|
-
manageableIds: new Set(["aiUsage"]),
|
|
66
61
|
shareIds: input.shareIds,
|
|
67
62
|
})
|
|
68
63
|
|
|
69
64
|
const universe = {
|
|
70
|
-
applicationIds: input.applicationIds ?? APPLICATION_IDS,
|
|
71
65
|
objectTypeIds: input.objectTypeIds ?? new Set<string>(),
|
|
72
66
|
datasetIds: input.datasetIds ?? new Set<string>(),
|
|
73
67
|
actionIds: input.actionIds ?? new Set<string>(),
|
|
@@ -75,8 +69,6 @@ export class SecurityRegistry implements SecurityDefinitionCatalog {
|
|
|
75
69
|
syncIds: input.syncIds ?? new Set<string>(),
|
|
76
70
|
pipelineIds: input.pipelineIds ?? new Set<string>(),
|
|
77
71
|
connectorIds: input.connectorIds ?? new Set<string>(),
|
|
78
|
-
observableIds: new Set(["logs", "aiUsage"]),
|
|
79
|
-
manageableIds: new Set(["aiUsage"]),
|
|
80
72
|
shareIds: input.shareIds ?? new Set<string>(),
|
|
81
73
|
getSubTypes: input.getSubTypes ?? (() => []),
|
|
82
74
|
}
|
package/src/security/types.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { AuthSessionAudience } from "../auth/audience"
|
|
2
|
-
|
|
3
1
|
export interface GroupDefinition<TId extends string = string> {
|
|
4
2
|
readonly kind: "group"
|
|
5
3
|
readonly id: TId
|
|
@@ -48,19 +46,6 @@ export type Selection =
|
|
|
48
46
|
| { readonly all: true; readonly except: readonly string[] }
|
|
49
47
|
| { readonly all: false; readonly ids: readonly string[] }
|
|
50
48
|
|
|
51
|
-
export interface ApplicationDefinition<TId extends AuthSessionAudience = AuthSessionAudience> {
|
|
52
|
-
readonly kind: "application"
|
|
53
|
-
readonly id: TId
|
|
54
|
-
readonly label: string
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface AccessGrant {
|
|
58
|
-
readonly kind: "grant"
|
|
59
|
-
readonly capability: "access"
|
|
60
|
-
readonly target: "application"
|
|
61
|
-
readonly selection: Selection
|
|
62
|
-
}
|
|
63
|
-
|
|
64
49
|
export type ViewGrantTarget = "object" | "dataset"
|
|
65
50
|
|
|
66
51
|
export interface ViewGrant<TTarget extends ViewGrantTarget = ViewGrantTarget> {
|
|
@@ -133,25 +118,34 @@ export interface AgentRunGrant {
|
|
|
133
118
|
|
|
134
119
|
export type ObserveGrantTarget = "logs" | "aiUsage"
|
|
135
120
|
|
|
121
|
+
/** Read the project's logs or its AI usage. Each is one surface, so there is nothing to select. */
|
|
136
122
|
export interface ObserveGrant {
|
|
137
123
|
readonly kind: "grant"
|
|
138
124
|
readonly capability: "observe"
|
|
139
125
|
readonly target: ObserveGrantTarget
|
|
140
|
-
readonly selection: Selection
|
|
141
126
|
}
|
|
142
127
|
|
|
143
128
|
export type ManageGrantTarget = "connector" | "aiUsage"
|
|
144
129
|
|
|
145
|
-
/**
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
130
|
+
/**
|
|
131
|
+
* Manage the selected connectors, or the project's AI usage-limit policies. AI usage is one
|
|
132
|
+
* surface, so its grant selects nothing.
|
|
133
|
+
*/
|
|
134
|
+
export type ManageGrant<TTarget extends ManageGrantTarget = ManageGrantTarget> =
|
|
135
|
+
TTarget extends "connector"
|
|
136
|
+
? {
|
|
137
|
+
readonly kind: "grant"
|
|
138
|
+
readonly capability: "manage"
|
|
139
|
+
readonly target: TTarget
|
|
140
|
+
readonly selection: Selection
|
|
141
|
+
}
|
|
142
|
+
: {
|
|
143
|
+
readonly kind: "grant"
|
|
144
|
+
readonly capability: "manage"
|
|
145
|
+
readonly target: TTarget
|
|
146
|
+
}
|
|
152
147
|
|
|
153
148
|
export type GrantDefinition =
|
|
154
|
-
| AccessGrant
|
|
155
149
|
| ViewGrant
|
|
156
150
|
| EditGrant
|
|
157
151
|
| AppendGrant
|
|
@@ -175,7 +169,7 @@ export interface RoleDefinition<TId extends string = string> {
|
|
|
175
169
|
readonly clearances?: readonly string[]
|
|
176
170
|
}
|
|
177
171
|
|
|
178
|
-
export type MembershipOperation = "invite" | "assignGroups" | "suspend"
|
|
172
|
+
export type MembershipOperation = "invite" | "assignGroups" | "suspend" | "serviceAccounts"
|
|
179
173
|
|
|
180
174
|
export interface MembershipPolicyDefinition<TId extends string = string> {
|
|
181
175
|
readonly kind: "membershipPolicy"
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
GRANT_KINDS,
|
|
3
|
+
type GrantUniverseKey,
|
|
4
|
+
grantKindOf,
|
|
5
|
+
isSingletonGrantKind,
|
|
6
|
+
} from "../authorization/grant-kinds"
|
|
2
7
|
import { SecurityValidationError } from "./errors"
|
|
3
8
|
import { isMembershipOperation } from "./membership-policies"
|
|
4
9
|
import type {
|
|
@@ -22,11 +27,10 @@ type RegisteredUniverses = Partial<Record<GrantUniverseKey, ReadonlySet<string>>
|
|
|
22
27
|
*
|
|
23
28
|
* Written as a total `Record<GrantCapability, true>` rather than a bare array so a capability added
|
|
24
29
|
* to `GrantDefinition` is a compile error here — the same discipline `GRANT_KINDS` uses. The
|
|
25
|
-
* hand-written `capability !== "
|
|
30
|
+
* hand-written `capability !== "view" && …` chain this replaces would have accepted the new
|
|
26
31
|
* capability at startup and then died on `GRANT_KINDS[kind].universeKey`.
|
|
27
32
|
*/
|
|
28
33
|
const GRANT_CAPABILITIES = Object.keys({
|
|
29
|
-
access: true,
|
|
30
34
|
view: true,
|
|
31
35
|
edit: true,
|
|
32
36
|
append: true,
|
|
@@ -102,7 +106,7 @@ function assertMembershipOperationArray(
|
|
|
102
106
|
for (const item of value) {
|
|
103
107
|
if (!isMembershipOperation(item)) {
|
|
104
108
|
throw createError(
|
|
105
|
-
`[Sixb] ${field} must contain only membership operations: invite, assignGroups, suspend.`
|
|
109
|
+
`[Sixb] ${field} must contain only membership operations: invite, assignGroups, suspend, serviceAccounts.`
|
|
106
110
|
)
|
|
107
111
|
}
|
|
108
112
|
}
|
|
@@ -231,10 +235,6 @@ export function assertGrantDefinition(
|
|
|
231
235
|
)
|
|
232
236
|
}
|
|
233
237
|
|
|
234
|
-
if (value.capability === "access" && value.target !== "application") {
|
|
235
|
-
throw createError(`[Sixb] ${field} access grant target must be 'application'.`)
|
|
236
|
-
}
|
|
237
|
-
|
|
238
238
|
if (value.capability === "view" && value.target !== "object" && value.target !== "dataset") {
|
|
239
239
|
throw createError(`[Sixb] ${field} view grant target must be 'object' or 'dataset'.`)
|
|
240
240
|
}
|
|
@@ -259,9 +259,13 @@ export function assertGrantDefinition(
|
|
|
259
259
|
throw createError(`[Sixb] ${field} manage grant target must be 'connector' or 'aiUsage'.`)
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
|
|
262
|
+
// The agent, logs and AI usage are one surface each, so their grants select nothing. The checks
|
|
263
|
+
// above settled the capability and target, so the kind is known.
|
|
264
|
+
if (isSingletonGrantKind(grantKindOf(value as unknown as GrantDefinition))) {
|
|
263
265
|
if (value.selection !== undefined) {
|
|
264
|
-
throw createError(
|
|
266
|
+
throw createError(
|
|
267
|
+
`[Sixb] ${field} ${value.capability} grant on '${value.target}' must not declare a selection.`
|
|
268
|
+
)
|
|
265
269
|
}
|
|
266
270
|
return
|
|
267
271
|
}
|
|
@@ -332,8 +336,6 @@ export function validateSecurityDefinitionsAtStartup(input: {
|
|
|
332
336
|
readonly groups: readonly GroupDefinition[]
|
|
333
337
|
readonly membershipPolicies: readonly MembershipPolicyDefinition[]
|
|
334
338
|
readonly roles?: readonly RoleDefinition[]
|
|
335
|
-
/** Registered browser application ids — when provided, access grants must reference them. */
|
|
336
|
-
readonly applicationIds?: ReadonlySet<string>
|
|
337
339
|
/** Registered object type ids — when provided, view grants must reference them. */
|
|
338
340
|
readonly objectTypeIds?: ReadonlySet<string>
|
|
339
341
|
/** Registered dataset ids — when provided, dataset view grants must reference them. */
|
|
@@ -348,10 +350,6 @@ export function validateSecurityDefinitionsAtStartup(input: {
|
|
|
348
350
|
readonly pipelineIds?: ReadonlySet<string>
|
|
349
351
|
/** Whether the project's single conversational Agent is configured. */
|
|
350
352
|
readonly agentAvailable?: boolean
|
|
351
|
-
/** Registered observability surfaces. */
|
|
352
|
-
readonly observableIds?: ReadonlySet<string>
|
|
353
|
-
/** Registered singleton management surfaces. */
|
|
354
|
-
readonly manageableIds?: ReadonlySet<string>
|
|
355
353
|
/** Registered connector ids — when provided, manage grants must reference them. */
|
|
356
354
|
readonly connectorIds?: ReadonlySet<string>
|
|
357
355
|
/** Registered Share ids — when provided, share grants must reference them. */
|
|
@@ -496,7 +494,11 @@ function assertGrantReferences(
|
|
|
496
494
|
}
|
|
497
495
|
return
|
|
498
496
|
}
|
|
499
|
-
|
|
497
|
+
// Logs and AI usage are always there; only targeted grants name ids to check.
|
|
498
|
+
if (!("selection" in grant)) return
|
|
499
|
+
const kind = grantKindOf(grant)
|
|
500
|
+
if (isSingletonGrantKind(kind)) return
|
|
501
|
+
const spec = GRANT_KINDS[kind]
|
|
500
502
|
const universe = registered[spec.universeKey]
|
|
501
503
|
|
|
502
504
|
if (!universe) {
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import type { ActionSubject } from "../../actions"
|
|
2
2
|
import { stableJsonStringify } from "../../json"
|
|
3
|
-
import type {
|
|
4
|
-
ActionRunEffectsRecord,
|
|
5
|
-
ActionRunPhase,
|
|
6
|
-
ActionRunRecord,
|
|
7
|
-
ActionRunWritebackRecord,
|
|
8
|
-
FinishActionRunInput,
|
|
9
|
-
QueueActionRunInput,
|
|
10
|
-
} from "./types"
|
|
3
|
+
import type { ActionRunEffectsRecord, ActionRunRecord, ActionRunWritebackRecord } from "./types"
|
|
11
4
|
|
|
12
5
|
export function actionSubjectsEqual(left: ActionSubject, right: ActionSubject): boolean {
|
|
13
6
|
if (left.kind !== right.kind) return false
|
|
@@ -20,6 +13,18 @@ export function actionRunParamsEqual(left: unknown, right: unknown): boolean {
|
|
|
20
13
|
return stableJsonStringify(left) === stableJsonStringify(right)
|
|
21
14
|
}
|
|
22
15
|
|
|
16
|
+
/** Whether two runs carry the same request: the same Action, subject, and params. */
|
|
17
|
+
export function actionRunRequestsEqual(
|
|
18
|
+
left: Pick<ActionRunRecord, "actionId" | "subject" | "params">,
|
|
19
|
+
right: Pick<ActionRunRecord, "actionId" | "subject" | "params">
|
|
20
|
+
): boolean {
|
|
21
|
+
return (
|
|
22
|
+
left.actionId === right.actionId &&
|
|
23
|
+
actionSubjectsEqual(left.subject, right.subject) &&
|
|
24
|
+
actionRunParamsEqual(left.params, right.params)
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
export type ActionRunPhaseRecord = ActionRunWritebackRecord | ActionRunEffectsRecord
|
|
24
29
|
|
|
25
30
|
export function actionRunPhaseRecordsEqual(
|
|
@@ -29,39 +34,6 @@ export function actionRunPhaseRecordsEqual(
|
|
|
29
34
|
return actionRunParamsEqual(stripPhaseRecordCompletedAt(left), stripPhaseRecordCompletedAt(right))
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
export function finishActionRunPhase(
|
|
33
|
-
input: FinishActionRunInput,
|
|
34
|
-
current: ActionRunPhase | null | undefined
|
|
35
|
-
): ActionRunPhase {
|
|
36
|
-
if (input.status === "succeeded") {
|
|
37
|
-
return input.phase ?? current ?? "validation"
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return input.error.details.phase
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function canRequeueActionRunAfterEnqueueFailure(
|
|
44
|
-
existing: ActionRunRecord,
|
|
45
|
-
input: QueueActionRunInput
|
|
46
|
-
): boolean {
|
|
47
|
-
return (
|
|
48
|
-
existing.status === "failed" &&
|
|
49
|
-
existing.phase === "enqueue" &&
|
|
50
|
-
existing.executionId === input.executionId &&
|
|
51
|
-
existing.error?.retryable === true &&
|
|
52
|
-
existing.actionId === input.actionId &&
|
|
53
|
-
existing.idempotencyKey === input.idempotencyKey &&
|
|
54
|
-
actionSubjectsEqual(existing.subject, input.subject) &&
|
|
55
|
-
actionRunParamsEqual(existing.params, input.params)
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function isTerminalActionRun(record: Pick<ActionRunRecord, "status">): boolean {
|
|
60
|
-
return (
|
|
61
|
-
record.status === "succeeded" || record.status === "failed" || record.status === "cancelled"
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
37
|
function stripPhaseRecordCompletedAt(
|
|
66
38
|
record: ActionRunPhaseRecord
|
|
67
39
|
): Omit<ActionRunPhaseRecord, "completedAt"> {
|