@sixb/core 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/delegated-admission.d.ts +24 -0
- package/dist/actions/delegated-admission.d.ts.map +1 -0
- package/dist/actions/descriptor.d.ts +29 -0
- package/dist/actions/descriptor.d.ts.map +1 -0
- package/dist/actions/execution.d.ts +5 -5
- package/dist/actions/execution.d.ts.map +1 -1
- package/dist/actions/index.js +36 -30
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/request.d.ts.map +1 -1
- package/dist/actions/run-authorization.d.ts +20 -0
- package/dist/actions/run-authorization.d.ts.map +1 -0
- package/dist/actions/run-dispatch.d.ts +3 -1
- package/dist/actions/run-dispatch.d.ts.map +1 -1
- package/dist/actions/worker.js +3 -3
- package/dist/actions/worker.js.map +1 -1
- package/dist/agents/adapters.d.ts +5 -122
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/authority.d.ts +1 -1
- package/dist/agents/authority.d.ts.map +1 -1
- package/dist/agents/context-resolution.d.ts.map +1 -1
- package/dist/agents/context.js +1 -1
- package/dist/agents/errors.d.ts +0 -9
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/execution.d.ts.map +1 -1
- package/dist/agents/identity.d.ts +3 -0
- package/dist/agents/identity.d.ts.map +1 -0
- package/dist/agents/index.d.ts +3 -3
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +43 -43
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/message.d.ts +4 -5
- package/dist/agents/message.d.ts.map +1 -1
- package/dist/agents/model-loop.d.ts +2 -0
- package/dist/agents/model-loop.d.ts.map +1 -1
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/tool-definition.d.ts +0 -1
- package/dist/agents/tool-definition.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +0 -4
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/ai-usage/execution.d.ts.map +1 -1
- package/dist/auth/index.js +8 -5
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/decision.d.ts +10 -2
- package/dist/authorization/decision.d.ts.map +1 -1
- package/dist/authorization/grant-kinds.d.ts +2 -1
- package/dist/authorization/grant-kinds.d.ts.map +1 -1
- package/dist/authorization/index.d.ts +1 -1
- package/dist/authorization/index.d.ts.map +1 -1
- package/dist/authorization/index.js +7 -4
- package/dist/authorization/index.js.map +1 -1
- package/dist/bootstrap/discovery.d.ts +7 -1
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.js +46 -39
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/bootstrap/ontology-type-manifest.d.ts.map +1 -1
- package/dist/chunk-19jp6g9d.js +131 -0
- package/dist/chunk-19jp6g9d.js.map +11 -0
- package/dist/{chunk-x0qhkqje.js → chunk-2dw777qw.js} +50 -5
- package/dist/{chunk-x0qhkqje.js.map → chunk-2dw777qw.js.map} +4 -3
- package/dist/chunk-359jm1jw.js +147 -0
- package/dist/chunk-359jm1jw.js.map +10 -0
- package/dist/{chunk-2b5qtban.js → chunk-3xep5cjx.js} +56 -21
- package/dist/chunk-3xep5cjx.js.map +15 -0
- package/dist/{chunk-qjycjdj6.js → chunk-3z1qec12.js} +6 -8
- package/dist/{chunk-qjycjdj6.js.map → chunk-3z1qec12.js.map} +2 -2
- package/dist/{chunk-5jcdmjam.js → chunk-4jjp5k14.js} +1 -1
- package/dist/{chunk-n2arzn6e.js → chunk-4qfkag59.js} +44 -221
- package/dist/chunk-4qfkag59.js.map +20 -0
- package/dist/{chunk-rre42skh.js → chunk-4sm0aznx.js} +515 -80
- package/dist/{chunk-rre42skh.js.map → chunk-4sm0aznx.js.map} +11 -7
- package/dist/chunk-4yqmp43v.js +159 -0
- package/dist/chunk-4yqmp43v.js.map +11 -0
- package/dist/{chunk-atmkaf60.js → chunk-5e3pq99w.js} +2 -6
- package/dist/{chunk-atmkaf60.js.map → chunk-5e3pq99w.js.map} +3 -3
- package/dist/{chunk-agsvg9ar.js → chunk-5ntny1qx.js} +1 -1
- package/dist/{chunk-z2sery1b.js → chunk-9nbmsvn5.js} +60 -20
- package/dist/chunk-9nbmsvn5.js.map +11 -0
- package/dist/{chunk-e4rvtvpw.js → chunk-aa2pen2v.js} +250 -78
- package/dist/chunk-aa2pen2v.js.map +34 -0
- package/dist/{chunk-64sr682n.js → chunk-ajnan18g.js} +11 -8
- package/dist/chunk-ajnan18g.js.map +12 -0
- package/dist/{chunk-9aehf39w.js → chunk-f26bck4t.js} +4 -4
- package/dist/{chunk-7ds9620f.js → chunk-fvt9rjsa.js} +23 -7
- package/dist/chunk-fvt9rjsa.js.map +10 -0
- package/dist/{chunk-kt81c11h.js → chunk-gbejpkex.js} +5 -5
- package/dist/{chunk-kt81c11h.js.map → chunk-gbejpkex.js.map} +1 -1
- package/dist/{chunk-vjjv9mrb.js → chunk-gzasd5b6.js} +5 -5
- package/dist/{chunk-vjjv9mrb.js.map → chunk-gzasd5b6.js.map} +3 -3
- package/dist/{chunk-d63tybny.js → chunk-h0k55pc7.js} +4 -4
- package/dist/{chunk-d63tybny.js.map → chunk-h0k55pc7.js.map} +1 -1
- package/dist/chunk-h5vqbfmd.js +1537 -0
- package/dist/chunk-h5vqbfmd.js.map +19 -0
- package/dist/{chunk-3kv70xwp.js → chunk-j1sbhm7p.js} +18 -2
- package/dist/chunk-j1sbhm7p.js.map +10 -0
- package/dist/{chunk-hdz94br2.js → chunk-k522z7v6.js} +10 -5
- package/dist/chunk-k522z7v6.js.map +10 -0
- package/dist/{chunk-wjgm6jjt.js → chunk-mth82m8t.js} +128 -94
- package/dist/chunk-mth82m8t.js.map +14 -0
- package/dist/{chunk-qv38twt8.js → chunk-mwsxn98e.js} +46 -25
- package/dist/{chunk-qv38twt8.js.map → chunk-mwsxn98e.js.map} +6 -6
- package/dist/chunk-n4khvw9n.js +111 -0
- package/dist/chunk-n4khvw9n.js.map +11 -0
- package/dist/{chunk-qjzp9xyb.js → chunk-nn0tekr1.js} +6 -8
- package/dist/chunk-nn0tekr1.js.map +12 -0
- package/dist/chunk-nx7k8tpr.js +436 -0
- package/dist/chunk-nx7k8tpr.js.map +12 -0
- package/dist/{chunk-08twe8m6.js → chunk-p1rzczbt.js} +1 -1
- package/dist/{chunk-37wk412q.js → chunk-p1x242ad.js} +587 -70
- package/dist/chunk-p1x242ad.js.map +25 -0
- package/dist/{chunk-tn7xcs2n.js → chunk-pc7ys28c.js} +68 -5
- package/dist/chunk-pc7ys28c.js.map +14 -0
- package/dist/{chunk-3fqt22c4.js → chunk-q0k9nc5a.js} +280 -88
- package/dist/chunk-q0k9nc5a.js.map +14 -0
- package/dist/chunk-r8jrnexe.js +403 -0
- package/dist/chunk-r8jrnexe.js.map +10 -0
- package/dist/{chunk-gbrpsx4m.js → chunk-rafagrwr.js} +30 -2
- package/dist/chunk-rafagrwr.js.map +11 -0
- package/dist/{chunk-xdpwpkha.js → chunk-rv2hkwwa.js} +1 -1
- package/dist/{chunk-6ed5bwnd.js → chunk-sbzzr4kx.js} +1203 -691
- package/dist/{chunk-6ed5bwnd.js.map → chunk-sbzzr4kx.js.map} +15 -9
- package/dist/{chunk-d2ndstdf.js → chunk-v1xppd0y.js} +13 -11
- package/dist/{chunk-d2ndstdf.js.map → chunk-v1xppd0y.js.map} +2 -2
- package/dist/chunk-v4en4jc2.js +252 -0
- package/dist/chunk-v4en4jc2.js.map +10 -0
- package/dist/{chunk-1kamz6j0.js → chunk-w1tvjszy.js} +1 -1
- package/dist/{chunk-rp1mvzb4.js → chunk-w9tg6yyb.js} +11 -6
- package/dist/{chunk-rp1mvzb4.js.map → chunk-w9tg6yyb.js.map} +3 -3
- package/dist/{chunk-4nxeacx7.js → chunk-wdage1eb.js} +1 -1
- package/dist/{chunk-ha58tjtt.js → chunk-wtf06et8.js} +9 -5
- package/dist/{chunk-ha58tjtt.js.map → chunk-wtf06et8.js.map} +3 -3
- package/dist/{chunk-h0knpbz5.js → chunk-xajtptbw.js} +782 -211
- package/dist/chunk-xajtptbw.js.map +40 -0
- package/dist/{chunk-xc7hq65b.js → chunk-yp8ee62z.js} +49 -2
- package/dist/chunk-yp8ee62z.js.map +11 -0
- package/dist/chunk-z4ccwbkz.js +139 -0
- package/dist/chunk-z4ccwbkz.js.map +10 -0
- package/dist/datasets/builders.d.ts +11 -2
- package/dist/datasets/builders.d.ts.map +1 -1
- package/dist/datasets/changes.d.ts +14 -4
- package/dist/datasets/changes.d.ts.map +1 -1
- package/dist/datasets/execution.d.ts +15 -1
- package/dist/datasets/execution.d.ts.map +1 -1
- package/dist/datasets/index.d.ts +1 -0
- package/dist/datasets/index.d.ts.map +1 -1
- package/dist/datasets/sequence.d.ts +7 -0
- package/dist/datasets/sequence.d.ts.map +1 -0
- package/dist/datasets/types.d.ts +1 -0
- package/dist/datasets/types.d.ts.map +1 -1
- package/dist/datasets/validation.d.ts.map +1 -1
- package/dist/datasets/write.d.ts +37 -0
- package/dist/datasets/write.d.ts.map +1 -0
- package/dist/datasets/write.js +17 -0
- package/dist/datasets/write.js.map +9 -0
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/types/datasets.d.ts +2 -6
- package/dist/events/types/datasets.d.ts.map +1 -1
- package/dist/execution/agent.d.ts.map +1 -1
- package/dist/execution/agent.js +39 -32
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorization.d.ts +58 -20
- package/dist/execution/authorization.d.ts.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +69 -0
- package/dist/execution/authorized-object-reader.d.ts.map +1 -0
- package/dist/execution/durable.d.ts.map +1 -1
- package/dist/execution/index.d.ts +1 -1
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/primitive.js +39 -32
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.d.ts +11 -0
- package/dist/execution/request.d.ts.map +1 -1
- package/dist/execution/request.js +76 -40
- package/dist/execution/request.js.map +3 -3
- package/dist/execution/scopes.d.ts +16 -0
- package/dist/execution/scopes.d.ts.map +1 -1
- package/dist/execution/types.d.ts +9 -0
- package/dist/execution/types.d.ts.map +1 -1
- package/dist/http/api-routes.d.ts +2 -0
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +92 -78
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/definition-updates.d.ts.map +1 -1
- package/dist/lake-storage/errors.d.ts +5 -1
- package/dist/lake-storage/errors.d.ts.map +1 -1
- package/dist/lake-storage/in-memory.d.ts +1 -0
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +6 -1
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +24 -7
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/merge-validation.d.ts.map +1 -1
- package/dist/lake-storage/merge.d.ts +13 -2
- package/dist/lake-storage/merge.d.ts.map +1 -1
- package/dist/lake-storage/source-ordering.d.ts +19 -0
- package/dist/lake-storage/source-ordering.d.ts.map +1 -0
- package/dist/lake-storage/sql-transforms.d.ts +2 -1
- package/dist/lake-storage/sql-transforms.d.ts.map +1 -1
- package/dist/lake-storage/types.d.ts +10 -5
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/lake-storage/version-inputs.d.ts +4 -0
- package/dist/lake-storage/version-inputs.d.ts.map +1 -0
- package/dist/materializer/index.js +25 -22
- package/dist/materializer/index.js.map +1 -1
- package/dist/objects/authorized-ontology-view.d.ts +25 -0
- package/dist/objects/authorized-ontology-view.d.ts.map +1 -0
- package/dist/objects/execution.d.ts +1 -1
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +29 -26
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/link/authorization.d.ts +2 -7
- package/dist/objects/link/authorization.d.ts.map +1 -1
- package/dist/objects/query/executor.d.ts +4 -2
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/index.js +24 -21
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/links.d.ts +22 -1
- package/dist/objects/query/links.d.ts.map +1 -1
- package/dist/objects/query/selected-read-admission.d.ts +27 -0
- package/dist/objects/query/selected-read-admission.d.ts.map +1 -0
- package/dist/objects/query/validate.d.ts +60 -2
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/object-handle.d.ts.map +1 -1
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/objects/sdk/runtime-query-executor.d.ts +2 -7
- package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
- package/dist/objects/sdk/telemetry-channel.d.ts.map +1 -1
- package/dist/objects/service/list-service.d.ts +2 -3
- package/dist/objects/service/list-service.d.ts.map +1 -1
- package/dist/objects/telemetry/history.d.ts +8 -6
- package/dist/objects/telemetry/history.d.ts.map +1 -1
- package/dist/objects/telemetry/index.d.ts +2 -2
- package/dist/objects/telemetry/index.d.ts.map +1 -1
- package/dist/objects/telemetry/workload.d.ts +11 -0
- package/dist/objects/telemetry/workload.d.ts.map +1 -0
- package/dist/ontology/index.d.ts +2 -1
- package/dist/ontology/index.d.ts.map +1 -1
- package/dist/ontology/index.js +13 -12
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/inference/index.d.ts +2 -1
- package/dist/ontology/inference/index.d.ts.map +1 -1
- package/dist/ontology/internal.d.ts +0 -1
- package/dist/ontology/internal.d.ts.map +1 -1
- package/dist/ontology/internal.js +5 -10
- package/dist/ontology/internal.js.map +3 -3
- package/dist/ontology/json-schema.d.ts +10 -6
- package/dist/ontology/json-schema.d.ts.map +1 -1
- package/dist/ontology/link-path-selection.d.ts +35 -0
- package/dist/ontology/link-path-selection.d.ts.map +1 -0
- package/dist/ontology/refs.d.ts +2 -0
- package/dist/ontology/refs.d.ts.map +1 -1
- package/dist/ontology/tokens.d.ts +2 -1
- package/dist/ontology/tokens.d.ts.map +1 -1
- package/dist/pipelines/execution.d.ts.map +1 -1
- package/dist/pipelines/index.js +27 -24
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/request.d.ts.map +1 -1
- package/dist/projections/execution.d.ts.map +1 -1
- package/dist/projections/internal.js +25 -22
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/run-dispatch.d.ts.map +1 -1
- package/dist/rules/execution.d.ts.map +1 -1
- package/dist/runtime/create.d.ts +4 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +2 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +2 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/internal.d.ts +1 -0
- package/dist/runtime/internal.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +2 -0
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/sixb.d.ts +4 -0
- package/dist/runtime/sixb.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +3 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/schedules/execution.d.ts +2 -1
- package/dist/schedules/execution.d.ts.map +1 -1
- package/dist/security/every.d.ts +4 -1
- package/dist/security/every.d.ts.map +1 -1
- package/dist/security/grants.d.ts +7 -2
- package/dist/security/grants.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/registry.d.ts +1 -0
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/types.d.ts +7 -1
- package/dist/security/types.d.ts.map +1 -1
- package/dist/security/validation.d.ts +2 -0
- package/dist/security/validation.d.ts.map +1 -1
- package/dist/shares/access-plan.d.ts +22 -0
- package/dist/shares/access-plan.d.ts.map +1 -0
- package/dist/shares/builders.d.ts +14 -0
- package/dist/shares/builders.d.ts.map +1 -0
- package/dist/shares/compiler.d.ts +14 -0
- package/dist/shares/compiler.d.ts.map +1 -0
- package/dist/shares/errors.d.ts +4 -0
- package/dist/shares/errors.d.ts.map +1 -0
- package/dist/shares/execution.d.ts +57 -0
- package/dist/shares/execution.d.ts.map +1 -0
- package/dist/shares/index.d.ts +10 -0
- package/dist/shares/index.d.ts.map +1 -0
- package/dist/shares/internal.d.ts +3 -0
- package/dist/shares/internal.d.ts.map +1 -0
- package/dist/shares/internal.js +239 -0
- package/dist/shares/internal.js.map +10 -0
- package/dist/shares/intersection.d.ts +9 -0
- package/dist/shares/intersection.d.ts.map +1 -0
- package/dist/shares/session-protocol.d.ts +41 -0
- package/dist/shares/session-protocol.d.ts.map +1 -0
- package/dist/shares/types.d.ts +51 -0
- package/dist/shares/types.d.ts.map +1 -0
- package/dist/shares/validation.d.ts +11 -0
- package/dist/shares/validation.d.ts.map +1 -0
- package/dist/storage/action-runs/provider.js +2 -2
- package/dist/storage/agents/provider.js +2 -2
- package/dist/storage/executions/in-memory.d.ts +3 -0
- package/dist/storage/executions/in-memory.d.ts.map +1 -1
- package/dist/storage/executions/provider.d.ts +4 -1
- package/dist/storage/executions/provider.d.ts.map +1 -1
- package/dist/storage/executions/provider.js +23 -3
- package/dist/storage/executions/provider.js.map +3 -3
- package/dist/storage/executions/run-link.d.ts +7 -0
- package/dist/storage/executions/run-link.d.ts.map +1 -1
- package/dist/storage/executions/validation.d.ts +6 -0
- package/dist/storage/executions/validation.d.ts.map +1 -1
- package/dist/storage/in-memory/index.d.ts +8 -0
- package/dist/storage/in-memory/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +8 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +65 -36
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/objects/execution-limits.d.ts +25 -0
- package/dist/storage/objects/execution-limits.d.ts.map +1 -0
- package/dist/storage/objects/guard.d.ts +16 -0
- package/dist/storage/objects/guard.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/index.d.ts +3 -0
- package/dist/storage/objects/in-memory/index.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/keys.d.ts +10 -0
- package/dist/storage/objects/in-memory/keys.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/query.d.ts +31 -0
- package/dist/storage/objects/in-memory/query.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/read-scope.d.ts +18 -0
- package/dist/storage/objects/in-memory/read-scope.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/read-source.d.ts +10 -0
- package/dist/storage/objects/in-memory/read-source.d.ts.map +1 -0
- package/dist/storage/objects/in-memory/selected-reader.d.ts +9 -0
- package/dist/storage/objects/in-memory/selected-reader.d.ts.map +1 -0
- package/dist/storage/objects/{in-memory.d.ts → in-memory/storage.d.ts} +13 -10
- package/dist/storage/objects/in-memory/storage.d.ts.map +1 -0
- package/dist/storage/objects/index.d.ts +4 -1
- package/dist/storage/objects/index.d.ts.map +1 -1
- package/dist/storage/objects/keys.d.ts +1 -1
- package/dist/storage/objects/keys.d.ts.map +1 -1
- package/dist/storage/objects/read-scope.d.ts +25 -0
- package/dist/storage/objects/read-scope.d.ts.map +1 -0
- package/dist/storage/objects/types.d.ts +114 -22
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/operation-scope.d.ts +3 -0
- package/dist/storage/operation-scope.d.ts.map +1 -1
- package/dist/storage/operation-scope.js +4 -2
- package/dist/storage/operation-scope.js.map +1 -1
- package/dist/storage/pipeline-runs/provider.js +2 -2
- package/dist/storage/projection-runs/provider.js +2 -2
- package/dist/storage/share-grants/errors.d.ts +8 -0
- package/dist/storage/share-grants/errors.d.ts.map +1 -0
- package/dist/storage/share-grants/in-memory.d.ts +11 -0
- package/dist/storage/share-grants/in-memory.d.ts.map +1 -0
- package/dist/storage/share-grants/index.d.ts +5 -0
- package/dist/storage/share-grants/index.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.d.ts +4 -0
- package/dist/storage/share-grants/provider.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.js +24 -0
- package/dist/storage/share-grants/provider.js.map +9 -0
- package/dist/storage/share-grants/record.d.ts +11 -0
- package/dist/storage/share-grants/record.d.ts.map +1 -0
- package/dist/storage/share-grants/types.d.ts +97 -0
- package/dist/storage/share-grants/types.d.ts.map +1 -0
- package/dist/storage/share-sessions/errors.d.ts +8 -0
- package/dist/storage/share-sessions/errors.d.ts.map +1 -0
- package/dist/storage/share-sessions/in-memory.d.ts +14 -0
- package/dist/storage/share-sessions/in-memory.d.ts.map +1 -0
- package/dist/storage/share-sessions/index.d.ts +5 -0
- package/dist/storage/share-sessions/index.d.ts.map +1 -0
- package/dist/storage/share-sessions/provider.d.ts +3 -0
- package/dist/storage/share-sessions/provider.d.ts.map +1 -0
- package/dist/storage/share-sessions/provider.js +20 -0
- package/dist/storage/share-sessions/provider.js.map +9 -0
- package/dist/storage/share-sessions/record.d.ts +8 -0
- package/dist/storage/share-sessions/record.d.ts.map +1 -0
- package/dist/storage/share-sessions/types.d.ts +50 -0
- package/dist/storage/share-sessions/types.d.ts.map +1 -0
- package/dist/storage/sync-runs/provider.js +2 -2
- package/dist/storage/transaction.d.ts +2 -1
- package/dist/storage/transaction.d.ts.map +1 -1
- package/dist/storage/types.d.ts +8 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/webhook-runs/provider.js +2 -2
- package/dist/storage/workflow-runs/provider.js +10 -7
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/execution.d.ts.map +1 -1
- package/dist/syncs/index.js +27 -24
- package/dist/syncs/index.js.map +1 -1
- package/dist/syncs/request.d.ts.map +1 -1
- package/dist/testing/dataset-sequence-contract.d.ts +4 -0
- package/dist/testing/dataset-sequence-contract.d.ts.map +1 -0
- package/dist/testing/effective-storage-contract.d.ts.map +1 -1
- package/dist/testing/execution-storage-contract.d.ts +4 -0
- package/dist/testing/execution-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +2555 -908
- package/dist/testing/index.js.map +11 -7
- package/dist/testing/lake-merge-storage-contract.d.ts +1 -0
- package/dist/testing/lake-merge-storage-contract.d.ts.map +1 -1
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/object-read-scope-contract.d.ts +22 -0
- package/dist/testing/object-read-scope-contract.d.ts.map +1 -0
- package/dist/testing/share-grant-storage-contract.d.ts +10 -0
- package/dist/testing/share-grant-storage-contract.d.ts.map +1 -0
- package/dist/testing/share-session-storage-contract.d.ts +9 -0
- package/dist/testing/share-session-storage-contract.d.ts.map +1 -0
- package/dist/webhooks/internal.js +24 -21
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workflows/execution.d.ts.map +1 -1
- package/dist/workflows/index.js +42 -35
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/request.d.ts.map +1 -1
- package/package.json +25 -1
- package/src/actions/delegated-admission.ts +72 -0
- package/src/actions/descriptor.ts +58 -0
- package/src/actions/execution.ts +99 -24
- package/src/actions/request.ts +136 -19
- package/src/actions/run-authorization.ts +53 -0
- package/src/actions/run-dispatch.ts +8 -1
- package/src/agents/adapters.ts +30 -420
- package/src/agents/authority.ts +3 -4
- package/src/agents/context-resolution.ts +1 -4
- package/src/agents/errors.ts +0 -10
- package/src/agents/execution.ts +13 -5
- package/src/agents/identity.ts +4 -0
- package/src/agents/index.ts +1 -20
- package/src/agents/message.ts +4 -5
- package/src/agents/model-loop.ts +54 -6
- package/src/agents/request.ts +16 -3
- package/src/agents/tool-definition.ts +0 -19
- package/src/agents/validation.ts +6 -65
- package/src/ai-usage/execution.ts +4 -11
- package/src/authorization/decision.ts +29 -14
- package/src/authorization/grant-kinds.ts +10 -0
- package/src/authorization/index.ts +1 -0
- package/src/bootstrap/discovery.ts +3 -0
- package/src/bootstrap/ontology-type-manifest.ts +12 -6
- package/src/datasets/builders.ts +23 -2
- package/src/datasets/changes.ts +16 -4
- package/src/datasets/execution.ts +76 -5
- package/src/datasets/index.ts +1 -0
- package/src/datasets/sequence.ts +77 -0
- package/src/datasets/types.ts +1 -0
- package/src/datasets/validation.ts +26 -0
- package/src/datasets/write.ts +240 -0
- package/src/events/execution.ts +57 -7
- package/src/events/types/datasets.ts +2 -6
- package/src/execution/agent.ts +1 -4
- package/src/execution/authorization.ts +470 -90
- package/src/execution/authorized-object-reader.ts +695 -0
- package/src/execution/durable.ts +10 -2
- package/src/execution/index.ts +1 -0
- package/src/execution/request.ts +63 -13
- package/src/execution/scopes.ts +36 -6
- package/src/execution/types.ts +8 -0
- package/src/http/api-routes.ts +45 -0
- package/src/index.ts +36 -15
- package/src/lake-storage/definition-updates.ts +9 -0
- package/src/lake-storage/errors.ts +6 -1
- package/src/lake-storage/in-memory.ts +53 -17
- package/src/lake-storage/index.ts +10 -1
- package/src/lake-storage/merge-validation.ts +12 -2
- package/src/lake-storage/merge.ts +40 -2
- package/src/lake-storage/source-ordering.ts +95 -0
- package/src/lake-storage/sql-transforms.ts +2 -1
- package/src/lake-storage/types.ts +10 -5
- package/src/lake-storage/version-inputs.ts +14 -0
- package/src/objects/authorized-ontology-view.ts +512 -0
- package/src/objects/execution.ts +98 -143
- package/src/objects/link/authorization.ts +3 -2
- package/src/objects/query/executor.ts +45 -34
- package/src/objects/query/links.ts +84 -25
- package/src/objects/query/selected-read-admission.ts +310 -0
- package/src/objects/query/validate.ts +353 -36
- package/src/objects/sdk/object-handle.ts +2 -8
- package/src/objects/sdk/object-set.ts +10 -11
- package/src/objects/sdk/runtime-query-executor.ts +8 -28
- package/src/objects/sdk/telemetry-channel.ts +11 -7
- package/src/objects/service/list-service.ts +15 -29
- package/src/objects/telemetry/history.ts +297 -17
- package/src/objects/telemetry/index.ts +2 -2
- package/src/objects/telemetry/workload.ts +79 -0
- package/src/ontology/index.ts +7 -1
- package/src/ontology/inference/index.ts +4 -1
- package/src/ontology/internal.ts +0 -1
- package/src/ontology/json-schema.ts +13 -12
- package/src/ontology/link-path-selection.ts +193 -0
- package/src/ontology/refs.ts +19 -0
- package/src/ontology/tokens.ts +15 -8
- package/src/pipelines/execution.ts +30 -7
- package/src/pipelines/request.ts +5 -0
- package/src/projections/execution.ts +72 -11
- package/src/projections/run-dispatch.ts +6 -12
- package/src/rules/execution.ts +20 -8
- package/src/runtime/create.ts +5 -1
- package/src/runtime/definitions.ts +2 -0
- package/src/runtime/host.ts +25 -6
- package/src/runtime/internal.ts +1 -0
- package/src/runtime/resolve-definitions.ts +9 -0
- package/src/runtime/sixb.ts +23 -2
- package/src/runtime/types.ts +3 -0
- package/src/schedules/execution.ts +24 -2
- package/src/security/every.ts +4 -0
- package/src/security/grants.ts +45 -3
- package/src/security/index.ts +1 -0
- package/src/security/registry.ts +3 -0
- package/src/security/types.ts +8 -0
- package/src/security/validation.ts +3 -0
- package/src/shares/access-plan.ts +225 -0
- package/src/shares/builders.ts +381 -0
- package/src/shares/compiler.ts +359 -0
- package/src/shares/errors.ts +3 -0
- package/src/shares/execution.ts +394 -0
- package/src/shares/index.ts +28 -0
- package/src/shares/internal.ts +9 -0
- package/src/shares/intersection.ts +178 -0
- package/src/shares/session-protocol.ts +258 -0
- package/src/shares/types.ts +76 -0
- package/src/shares/validation.ts +40 -0
- package/src/storage/executions/in-memory.ts +9 -1
- package/src/storage/executions/provider.ts +30 -1
- package/src/storage/executions/run-link.ts +29 -0
- package/src/storage/executions/validation.ts +46 -1
- package/src/storage/in-memory/index.ts +21 -2
- package/src/storage/index.ts +51 -0
- package/src/storage/objects/execution-limits.ts +283 -0
- package/src/storage/objects/guard.ts +55 -0
- package/src/storage/objects/in-memory/index.ts +2 -0
- package/src/storage/objects/in-memory/keys.ts +46 -0
- package/src/storage/objects/in-memory/query.ts +754 -0
- package/src/storage/objects/in-memory/read-scope.ts +211 -0
- package/src/storage/objects/in-memory/read-source.ts +10 -0
- package/src/storage/objects/in-memory/selected-reader.ts +252 -0
- package/src/storage/objects/in-memory/storage.ts +589 -0
- package/src/storage/objects/index.ts +21 -0
- package/src/storage/objects/keys.ts +1 -1
- package/src/storage/objects/read-scope.ts +672 -0
- package/src/storage/objects/types.ts +123 -19
- package/src/storage/operation-scope.ts +16 -0
- package/src/storage/share-grants/errors.ts +14 -0
- package/src/storage/share-grants/in-memory.ts +107 -0
- package/src/storage/share-grants/index.ts +14 -0
- package/src/storage/share-grants/provider.ts +11 -0
- package/src/storage/share-grants/record.ts +347 -0
- package/src/storage/share-grants/types.ts +112 -0
- package/src/storage/share-sessions/errors.ts +14 -0
- package/src/storage/share-sessions/in-memory.ts +105 -0
- package/src/storage/share-sessions/index.ts +11 -0
- package/src/storage/share-sessions/provider.ts +9 -0
- package/src/storage/share-sessions/record.ts +176 -0
- package/src/storage/share-sessions/types.ts +57 -0
- package/src/storage/transaction.ts +14 -2
- package/src/storage/types.ts +27 -0
- package/src/syncs/execution.ts +25 -5
- package/src/syncs/request.ts +5 -0
- package/src/testing/dataset-sequence-contract.ts +373 -0
- package/src/testing/effective-storage-contract.ts +34 -0
- package/src/testing/execution-storage-contract.ts +79 -0
- package/src/testing/index.ts +16 -0
- package/src/testing/lake-merge-storage-contract.ts +3 -0
- package/src/testing/lake-storage-contract.ts +58 -0
- package/src/testing/object-read-scope-contract.ts +939 -0
- package/src/testing/share-grant-storage-contract.ts +325 -0
- package/src/testing/share-session-storage-contract.ts +235 -0
- package/src/workflows/execution.ts +53 -14
- package/src/workflows/request.ts +5 -0
- package/dist/chunk-2b5qtban.js.map +0 -14
- package/dist/chunk-37wk412q.js.map +0 -23
- package/dist/chunk-3fqt22c4.js.map +0 -14
- package/dist/chunk-3kv70xwp.js.map +0 -10
- package/dist/chunk-64sr682n.js.map +0 -12
- package/dist/chunk-7ds9620f.js.map +0 -10
- package/dist/chunk-dqn23610.js +0 -72
- package/dist/chunk-dqn23610.js.map +0 -11
- package/dist/chunk-e4rvtvpw.js.map +0 -34
- package/dist/chunk-gbrpsx4m.js.map +0 -11
- package/dist/chunk-h0knpbz5.js.map +0 -38
- package/dist/chunk-hdz94br2.js.map +0 -10
- package/dist/chunk-n2arzn6e.js.map +0 -20
- package/dist/chunk-qjzp9xyb.js.map +0 -12
- package/dist/chunk-tn7xcs2n.js.map +0 -13
- package/dist/chunk-wjgm6jjt.js.map +0 -13
- package/dist/chunk-xc7hq65b.js.map +0 -10
- package/dist/chunk-y35ma3mj.js +0 -551
- package/dist/chunk-y35ma3mj.js.map +0 -15
- package/dist/chunk-z2sery1b.js.map +0 -11
- package/dist/storage/objects/in-memory.d.ts.map +0 -1
- package/src/storage/objects/in-memory.ts +0 -1241
- /package/dist/{chunk-5jcdmjam.js.map → chunk-4jjp5k14.js.map} +0 -0
- /package/dist/{chunk-agsvg9ar.js.map → chunk-5ntny1qx.js.map} +0 -0
- /package/dist/{chunk-9aehf39w.js.map → chunk-f26bck4t.js.map} +0 -0
- /package/dist/{chunk-08twe8m6.js.map → chunk-p1rzczbt.js.map} +0 -0
- /package/dist/{chunk-xdpwpkha.js.map → chunk-rv2hkwwa.js.map} +0 -0
- /package/dist/{chunk-1kamz6j0.js.map → chunk-w1tvjszy.js.map} +0 -0
- /package/dist/{chunk-4nxeacx7.js.map → chunk-wdage1eb.js.map} +0 -0
|
@@ -3,20 +3,24 @@ import {
|
|
|
3
3
|
SyncValidationError,
|
|
4
4
|
createConnectorRuntime,
|
|
5
5
|
requestSyncRun
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-wtf06et8.js";
|
|
7
7
|
import {
|
|
8
8
|
aiLimitSubjectsFromAttribution,
|
|
9
9
|
aiUsageLimitExceededError,
|
|
10
10
|
aiUsageLimitUnavailableError,
|
|
11
11
|
applicableAiLimitPolicyStatuses
|
|
12
12
|
} from "./chunk-c15dr03f.js";
|
|
13
|
+
import {
|
|
14
|
+
compileShareAccessPlan
|
|
15
|
+
} from "./chunk-v4en4jc2.js";
|
|
13
16
|
import {
|
|
14
17
|
PipelineError,
|
|
15
18
|
requestPipelineRun
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-w9tg6yyb.js";
|
|
17
20
|
import {
|
|
18
21
|
appendTelemetry,
|
|
19
22
|
createObjectSet,
|
|
23
|
+
getLatestTelemetryPoint,
|
|
20
24
|
getTelemetryHistoryBatch,
|
|
21
25
|
listObjects,
|
|
22
26
|
removeLink1 as removeLink,
|
|
@@ -24,48 +28,48 @@ import {
|
|
|
24
28
|
upsertLinkBatch1 as upsertLinkBatch,
|
|
25
29
|
upsertObject1 as upsertObject,
|
|
26
30
|
upsertObjectBatch1 as upsertObjectBatch
|
|
27
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-aa2pen2v.js";
|
|
28
32
|
import {
|
|
29
33
|
shareOntologyMutationRuntime
|
|
30
34
|
} from "./chunk-xhy826cz.js";
|
|
31
|
-
import {
|
|
32
|
-
countObjects,
|
|
33
|
-
executeObjectQuery,
|
|
34
|
-
executeObjectQueryLinks,
|
|
35
|
-
existsObjects,
|
|
36
|
-
facetObjects
|
|
37
|
-
} from "./chunk-3fqt22c4.js";
|
|
38
35
|
import {
|
|
39
36
|
registerConnectorConnectionsRuntime
|
|
40
37
|
} from "./chunk-nf4r78r4.js";
|
|
41
38
|
import {
|
|
42
|
-
|
|
39
|
+
writeDataset
|
|
40
|
+
} from "./chunk-359jm1jw.js";
|
|
41
|
+
import {
|
|
42
|
+
getDatasetPrimaryKeyColumns
|
|
43
|
+
} from "./chunk-n4khvw9n.js";
|
|
44
|
+
import {
|
|
45
|
+
assertAuthorizedObjectReaderBinding,
|
|
46
|
+
canDelegationAccessActionRun,
|
|
47
|
+
getAuthorizedOntologyView,
|
|
43
48
|
requestAction,
|
|
44
49
|
requestActionAndWait
|
|
45
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-h5vqbfmd.js";
|
|
46
51
|
import {
|
|
47
52
|
createPrimitiveExecutionRecord,
|
|
48
53
|
ensureExecutionRecord,
|
|
49
54
|
executionRecordInputFromRuntime
|
|
50
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-k522z7v6.js";
|
|
51
56
|
import {
|
|
57
|
+
ObjectNotFoundError,
|
|
52
58
|
WORKFLOW_RUN_FAILURE_CODES
|
|
53
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-sbzzr4kx.js";
|
|
60
|
+
import {
|
|
61
|
+
ShareGrantStorageError
|
|
62
|
+
} from "./chunk-nx7k8tpr.js";
|
|
54
63
|
import {
|
|
55
|
-
WorkflowRunError
|
|
56
|
-
|
|
57
|
-
} from "./chunk-qjzp9xyb.js";
|
|
64
|
+
WorkflowRunError
|
|
65
|
+
} from "./chunk-nn0tekr1.js";
|
|
58
66
|
import {
|
|
59
67
|
ExecutionStorageError
|
|
60
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-rafagrwr.js";
|
|
61
69
|
import {
|
|
62
70
|
AGENT_REASONING_LEVELS,
|
|
63
71
|
AgentStorageError
|
|
64
|
-
} from "./chunk-
|
|
65
|
-
import {
|
|
66
|
-
isObjectRefSchema,
|
|
67
|
-
validateSchemaOrRefValue
|
|
68
|
-
} from "./chunk-dqn23610.js";
|
|
72
|
+
} from "./chunk-p1rzczbt.js";
|
|
69
73
|
import {
|
|
70
74
|
RuntimeError
|
|
71
75
|
} from "./chunk-p2vqaxkc.js";
|
|
@@ -73,29 +77,36 @@ import {
|
|
|
73
77
|
isModelReasoning
|
|
74
78
|
} from "./chunk-trxxmgnf.js";
|
|
75
79
|
import {
|
|
76
|
-
reportRunFailure
|
|
80
|
+
reportRunFailure,
|
|
81
|
+
shareSixbErrorReporter
|
|
77
82
|
} from "./chunk-jq43kdvk.js";
|
|
78
83
|
import {
|
|
79
84
|
AgentRequestError,
|
|
80
85
|
normalizeAgentContextEntries
|
|
81
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-5e3pq99w.js";
|
|
82
87
|
import {
|
|
83
88
|
publishAgentRunActivity
|
|
84
89
|
} from "./chunk-7y0f6rf1.js";
|
|
85
90
|
import {
|
|
86
91
|
SYSTEM_PRINCIPAL,
|
|
92
|
+
isActionDefinition,
|
|
87
93
|
principalsEqual
|
|
88
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-4sm0aznx.js";
|
|
89
95
|
import {
|
|
90
96
|
snapshotRequesterGroupIds
|
|
91
97
|
} from "./chunk-4a849fr1.js";
|
|
98
|
+
import {
|
|
99
|
+
isObjectRefSchema,
|
|
100
|
+
validateSchemaOrRefValue
|
|
101
|
+
} from "./chunk-2dw777qw.js";
|
|
92
102
|
import {
|
|
93
103
|
AuthorizationError,
|
|
104
|
+
agentServiceAccountId,
|
|
94
105
|
assertAuthorized,
|
|
95
106
|
assertCanManageConnector,
|
|
107
|
+
assertObjectReadOutputWithinLimit,
|
|
96
108
|
assertPrivileged,
|
|
97
109
|
assertProviderAccess,
|
|
98
|
-
assertRuntimeAuthorizationBound,
|
|
99
110
|
canViewActionRun,
|
|
100
111
|
canViewEvent,
|
|
101
112
|
canViewPipelineRun,
|
|
@@ -106,11 +117,13 @@ import {
|
|
|
106
117
|
createAgentRuntimeAuthorization,
|
|
107
118
|
getAuthorizationRef,
|
|
108
119
|
isAllowed,
|
|
109
|
-
|
|
110
|
-
|
|
120
|
+
isRuntimeAllowed,
|
|
121
|
+
resolveExecutionScopeAuthorization,
|
|
122
|
+
resolveRuntimeAuthorizationForProject
|
|
123
|
+
} from "./chunk-p1x242ad.js";
|
|
111
124
|
import {
|
|
112
125
|
assertObjectTypeRegistered
|
|
113
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-h0k55pc7.js";
|
|
114
127
|
import {
|
|
115
128
|
supportsDirectUpload,
|
|
116
129
|
supportsRangeRead
|
|
@@ -122,39 +135,105 @@ import {
|
|
|
122
135
|
isPlainRecord
|
|
123
136
|
} from "./chunk-n6jxh8sw.js";
|
|
124
137
|
|
|
138
|
+
// src/actions/descriptor.ts
|
|
139
|
+
function snapshotActionDescriptor(action) {
|
|
140
|
+
const params = Object.fromEntries(Object.entries(action.params).map(([id, config]) => [id, structuredClone(config)]));
|
|
141
|
+
return deepFreeze({
|
|
142
|
+
id: action.id,
|
|
143
|
+
...action.description === undefined ? {} : { description: action.description },
|
|
144
|
+
binding: action.binding.kind === "global" ? { kind: "global" } : { kind: "object", objectTypeId: action.binding.objectType.id },
|
|
145
|
+
params,
|
|
146
|
+
phases: {
|
|
147
|
+
validate: action.phases.validate.length > 0,
|
|
148
|
+
writeback: action.phases.writeback !== undefined,
|
|
149
|
+
edits: action.phases.edits !== undefined,
|
|
150
|
+
effects: action.phases.effects !== undefined
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function deepFreeze(value, seen = new Set) {
|
|
155
|
+
if (typeof value !== "object" || value === null || seen.has(value))
|
|
156
|
+
return value;
|
|
157
|
+
seen.add(value);
|
|
158
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
159
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
160
|
+
if (descriptor && "value" in descriptor)
|
|
161
|
+
deepFreeze(descriptor.value, seen);
|
|
162
|
+
}
|
|
163
|
+
return Object.freeze(value);
|
|
164
|
+
}
|
|
165
|
+
|
|
125
166
|
// src/actions/execution.ts
|
|
126
167
|
function createActionsRuntime(runtime, execution) {
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
168
|
+
const projectId = runtime.projectId;
|
|
169
|
+
const runtimeAuthorization = runtime.runtimeAuthorization;
|
|
170
|
+
const objectReader = runtime.objectReader;
|
|
171
|
+
assertAuthorizedObjectReaderBinding({
|
|
172
|
+
reader: objectReader,
|
|
173
|
+
scope: { execution, authorization: runtimeAuthorization }
|
|
174
|
+
});
|
|
175
|
+
const authorization = resolveRuntimeAuthorizationForProject({
|
|
176
|
+
projectId,
|
|
177
|
+
runtimeAuthorization
|
|
178
|
+
});
|
|
179
|
+
const canList = (action) => {
|
|
180
|
+
if (authorization.type === "denied")
|
|
181
|
+
return false;
|
|
182
|
+
if (authorization.type === "delegated") {
|
|
183
|
+
const binding = action.binding;
|
|
184
|
+
return binding.kind === "object" && authorization.actionApply.some((target) => target.actionId === action.id && target.subject.objectTypeId === binding.objectType.id) && getAuthorizedOntologyView(objectReader).getObjectTypeById(binding.objectType.id) !== null;
|
|
185
|
+
}
|
|
186
|
+
if (authorization.type === "unrestricted")
|
|
187
|
+
return true;
|
|
188
|
+
return isAllowed(authorization.context, { kind: "action.apply", actionId: action.id }) && (action.binding.kind === "global" || isAllowed(authorization.context, {
|
|
189
|
+
kind: "object.view",
|
|
190
|
+
objectTypeId: action.binding.objectType.id
|
|
191
|
+
}));
|
|
192
|
+
};
|
|
193
|
+
const release = (value) => {
|
|
194
|
+
if (authorization.type === "delegated") {
|
|
195
|
+
assertObjectReadOutputWithinLimit(value, authorization.objectRead.limits);
|
|
196
|
+
}
|
|
197
|
+
return value;
|
|
198
|
+
};
|
|
199
|
+
const describeAll = (actions) => release(actions.filter(canList).map(snapshotActionDescriptor));
|
|
131
200
|
return {
|
|
132
|
-
list: () => runtime.actionRegistry.list()
|
|
201
|
+
list: () => describeAll(runtime.actionRegistry.list()),
|
|
133
202
|
getById: (actionId) => {
|
|
134
203
|
const action = runtime.actionRegistry.getById(actionId);
|
|
135
|
-
return action && canList(action) ? action : null;
|
|
204
|
+
return release(action && canList(action) ? snapshotActionDescriptor(action) : null);
|
|
136
205
|
},
|
|
137
|
-
listGlobal: () => runtime.actionRegistry.listGlobal()
|
|
138
|
-
listForType: (objectType) => runtime.actionRegistry.listForType(objectType).filter(
|
|
206
|
+
listGlobal: () => describeAll(runtime.actionRegistry.listGlobal()),
|
|
207
|
+
listForType: (objectType) => describeAll(runtime.actionRegistry.listForType(objectType).filter((action) => authorization.type !== "delegated" || action.binding.kind === "object" && action.binding.objectType.id === objectType.id)),
|
|
139
208
|
request: (input) => requestAction(runtime, execution, input),
|
|
140
209
|
requestAndWait: (input) => requestActionAndWait(runtime, execution, input),
|
|
141
210
|
runs: {
|
|
142
211
|
getById: async (runId) => {
|
|
212
|
+
if (authorization.type === "denied" || authorization.type === "delegated" && (!authorization.delegation || authorization.actionApply.length === 0))
|
|
213
|
+
return null;
|
|
143
214
|
const run = await runtime.storage.actionRuns?.getById({
|
|
144
|
-
projectId
|
|
215
|
+
projectId,
|
|
145
216
|
id: runId
|
|
146
217
|
}) ?? null;
|
|
147
|
-
return run && canViewActionRun(
|
|
218
|
+
return run && (authorization.type === "unrestricted" || authorization.type === "principal" && canViewActionRun(authorization.context, run) || authorization.type === "delegated" && await canDelegationAccessActionRun({
|
|
219
|
+
storage: runtime.storage,
|
|
220
|
+
projectId,
|
|
221
|
+
authority: authorization,
|
|
222
|
+
run
|
|
223
|
+
})) ? release(run) : null;
|
|
148
224
|
},
|
|
149
225
|
list: (input = {}) => {
|
|
226
|
+
if (authorization.type === "denied" || authorization.type === "delegated") {
|
|
227
|
+
return Promise.resolve({ runs: [], hasMore: false, total: 0 });
|
|
228
|
+
}
|
|
150
229
|
const storage = runtime.storage.actionRuns;
|
|
151
230
|
if (!storage)
|
|
152
231
|
return Promise.resolve({ runs: [], hasMore: false, total: 0 });
|
|
153
232
|
return storage.list({
|
|
154
|
-
projectId: runtime.projectId,
|
|
155
233
|
...input,
|
|
156
|
-
|
|
157
|
-
|
|
234
|
+
projectId,
|
|
235
|
+
actionIds: authorization.type === "principal" ? [...authorization.context.grants["apply:action"]] : undefined,
|
|
236
|
+
objectTypeIds: authorization.type === "principal" ? [...authorization.context.grants["view:object"]] : undefined
|
|
158
237
|
});
|
|
159
238
|
}
|
|
160
239
|
}
|
|
@@ -230,9 +309,7 @@ async function resolveAgentContextParts(runtime, input) {
|
|
|
230
309
|
} catch {
|
|
231
310
|
invalidContext(`context references an unknown object type '${objectTypeId}'`);
|
|
232
311
|
}
|
|
233
|
-
|
|
234
|
-
const object = await runtime.storage.objects.getByPrimaryId({
|
|
235
|
-
projectId: runtime.projectId,
|
|
312
|
+
const object = await runtime.objectReader.getByPrimaryId({
|
|
236
313
|
objectTypeId,
|
|
237
314
|
primaryId
|
|
238
315
|
});
|
|
@@ -362,6 +439,10 @@ function assertNoAgentSelector(input) {
|
|
|
362
439
|
|
|
363
440
|
// src/agents/request.ts
|
|
364
441
|
async function requestAgentRun(runtime, execution, models, input) {
|
|
442
|
+
const authority = resolveExecutionScopeAuthorization(runtime.projectId, {
|
|
443
|
+
execution,
|
|
444
|
+
authorization: runtime.runtimeAuthorization
|
|
445
|
+
});
|
|
365
446
|
assertNoAgentSelector(input);
|
|
366
447
|
assertAuthorized(runtime, { kind: "agent.run" });
|
|
367
448
|
assertRequestAuthorityCanRunAgent(runtime);
|
|
@@ -369,7 +450,7 @@ async function requestAgentRun(runtime, execution, models, input) {
|
|
|
369
450
|
const contextParts = await resolveAgentContextParts(runtime, input.context);
|
|
370
451
|
const agents = requireAgentStorage(runtime);
|
|
371
452
|
const projectId = runtime.projectId;
|
|
372
|
-
const principal =
|
|
453
|
+
const principal = authority.type === "principal" ? authority.context.principal : input.principal ?? SYSTEM_PRINCIPAL;
|
|
373
454
|
const runId = createAgentRunId();
|
|
374
455
|
const durableExecution = await prepareDurableAgentExecution(runtime, execution, runId);
|
|
375
456
|
const requesterGroupIds = durableExecution.requestedBy ? await snapshotRequesterGroupIds({
|
|
@@ -434,6 +515,10 @@ async function requestAgentRun(runtime, execution, models, input) {
|
|
|
434
515
|
};
|
|
435
516
|
}
|
|
436
517
|
async function retryAgentRun(runtime, execution, models, failedRun) {
|
|
518
|
+
resolveExecutionScopeAuthorization(runtime.projectId, {
|
|
519
|
+
execution,
|
|
520
|
+
authorization: runtime.runtimeAuthorization
|
|
521
|
+
});
|
|
437
522
|
assertAuthorized(runtime, { kind: "agent.run" });
|
|
438
523
|
assertRequestAuthorityCanRunAgent(runtime);
|
|
439
524
|
if (failedRun.status !== "failed") {
|
|
@@ -591,18 +676,23 @@ function requireAgentStorage(runtime) {
|
|
|
591
676
|
|
|
592
677
|
// src/agents/execution.ts
|
|
593
678
|
function createAgentRuntime(runtime, execution, models) {
|
|
594
|
-
const
|
|
595
|
-
const
|
|
679
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
680
|
+
const principal = authority.type === "principal" ? authority.context.principal : SYSTEM_PRINCIPAL;
|
|
681
|
+
const allowed = () => isRuntimeAllowed(runtime, { kind: "agent.run" });
|
|
596
682
|
const getVisibleThreadRecord = async (threadId) => {
|
|
683
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
684
|
+
return null;
|
|
597
685
|
const thread = await runtime.storage.agents?.threads.getById({
|
|
598
686
|
projectId: runtime.projectId,
|
|
599
687
|
id: threadId
|
|
600
688
|
}) ?? null;
|
|
601
689
|
if (!thread || !allowed())
|
|
602
690
|
return null;
|
|
603
|
-
return
|
|
691
|
+
return authority.type === "principal" && !principalsEqual(principal, thread.ownerPrincipal) ? null : thread;
|
|
604
692
|
};
|
|
605
693
|
const getAgent = () => {
|
|
694
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
695
|
+
return null;
|
|
606
696
|
const model = models?.language.default;
|
|
607
697
|
if (!model || !allowed())
|
|
608
698
|
return null;
|
|
@@ -612,6 +702,8 @@ function createAgentRuntime(runtime, execution, models) {
|
|
|
612
702
|
};
|
|
613
703
|
};
|
|
614
704
|
const getVisibleRunRecord = async (runId) => {
|
|
705
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
706
|
+
return null;
|
|
615
707
|
const run = await runtime.storage.agents?.runs.getById({
|
|
616
708
|
projectId: runtime.projectId,
|
|
617
709
|
id: runId
|
|
@@ -648,13 +740,16 @@ function createAgentRuntime(runtime, execution, models) {
|
|
|
648
740
|
getById: getVisibleThreadRecord,
|
|
649
741
|
list: async (input = {}) => {
|
|
650
742
|
assertNoAgentSelector(input);
|
|
743
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
744
|
+
return { threads: [], hasMore: false, total: 0 };
|
|
745
|
+
}
|
|
651
746
|
const storage = runtime.storage.agents;
|
|
652
747
|
if (!storage || !allowed())
|
|
653
748
|
return { threads: [], hasMore: false, total: 0 };
|
|
654
749
|
return storage.threads.list({
|
|
655
750
|
...input,
|
|
656
751
|
projectId: runtime.projectId,
|
|
657
|
-
ownerPrincipal:
|
|
752
|
+
ownerPrincipal: authority.type === "principal" ? principal : undefined
|
|
658
753
|
});
|
|
659
754
|
}
|
|
660
755
|
},
|
|
@@ -752,8 +847,7 @@ function createAiUsageRuntime(runtime, security) {
|
|
|
752
847
|
const assertObservable = () => assertAuthorized(runtime, { kind: "aiUsage.observe" });
|
|
753
848
|
const assertManageable = () => assertAuthorized(runtime, { kind: "aiUsage.manage" });
|
|
754
849
|
const assertPolicyReadable = () => {
|
|
755
|
-
|
|
756
|
-
if (resolved.type === "principal" && !isAllowed(resolved.context, { kind: "aiUsage.observe" }) && !isAllowed(resolved.context, { kind: "aiUsage.manage" })) {
|
|
850
|
+
if (!isRuntimeAllowed(runtime, { kind: "aiUsage.observe" }) && !isRuntimeAllowed(runtime, { kind: "aiUsage.manage" })) {
|
|
757
851
|
assertObservable();
|
|
758
852
|
}
|
|
759
853
|
};
|
|
@@ -774,10 +868,7 @@ function createAiUsageRuntime(runtime, security) {
|
|
|
774
868
|
limitsConfigured: runtime.storage.aiLimits !== undefined,
|
|
775
869
|
assertObservable,
|
|
776
870
|
assertManageable,
|
|
777
|
-
canManageLimits: () => {
|
|
778
|
-
const resolved = assertRuntimeAuthorizationBound(runtime);
|
|
779
|
-
return resolved.type !== "principal" || isAllowed(resolved.context, { kind: "aiUsage.manage" });
|
|
780
|
-
},
|
|
871
|
+
canManageLimits: () => isRuntimeAllowed(runtime, { kind: "aiUsage.manage" }),
|
|
781
872
|
queryOverview: (input) => {
|
|
782
873
|
assertObservable();
|
|
783
874
|
return requireCosts().queryProjectOverview({ ...input, projectId: runtime.projectId });
|
|
@@ -934,21 +1025,88 @@ function commandContext(runtime, execution, connectorId) {
|
|
|
934
1025
|
}
|
|
935
1026
|
|
|
936
1027
|
// src/datasets/execution.ts
|
|
937
|
-
function createDatasetsRuntime(runtime, source) {
|
|
938
|
-
const
|
|
1028
|
+
function createDatasetsRuntime(runtime, execution, source, lakeStorage, blobStorage) {
|
|
1029
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
1030
|
+
const allowed = (datasetId) => isRuntimeAllowed(runtime, { kind: "dataset.view", datasetId });
|
|
939
1031
|
return {
|
|
940
|
-
list: () => source.list().filter((dataset) => allowed(dataset.id)),
|
|
1032
|
+
list: () => authority.type === "denied" || authority.type === "delegated" ? [] : source.list().filter((dataset) => allowed(dataset.id)),
|
|
941
1033
|
getById: (datasetId) => {
|
|
1034
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
1035
|
+
return null;
|
|
942
1036
|
const dataset = source.getById(datasetId);
|
|
943
1037
|
return dataset && allowed(datasetId) ? dataset : null;
|
|
1038
|
+
},
|
|
1039
|
+
async ingest(dataset, input) {
|
|
1040
|
+
assertPrivileged(runtime, "datasets.ingest");
|
|
1041
|
+
const registered = source.getById(dataset.id);
|
|
1042
|
+
if (!registered)
|
|
1043
|
+
throw new Error(`[Sixb] Dataset '${dataset.id}' is not registered.`);
|
|
1044
|
+
if (getDatasetPrimaryKeyColumns(registered) === null) {
|
|
1045
|
+
throw new Error(`[Sixb] Dataset '${dataset.id}' must define a primaryKey before ingestion.`);
|
|
1046
|
+
}
|
|
1047
|
+
if (typeof lakeStorage.beginMerge !== "function") {
|
|
1048
|
+
throw new Error("[Sixb] Dataset ingestion requires a lake provider with merge support.");
|
|
1049
|
+
}
|
|
1050
|
+
const producer = { kind: "ingest", id: execution.id };
|
|
1051
|
+
const result = await writeDataset({
|
|
1052
|
+
lakeStorage,
|
|
1053
|
+
blobStorage,
|
|
1054
|
+
dataset: registered,
|
|
1055
|
+
mode: "merge",
|
|
1056
|
+
signal: input.signal ?? new AbortController().signal,
|
|
1057
|
+
producer,
|
|
1058
|
+
readValues: async () => async function* () {
|
|
1059
|
+
for await (const value of input.changes)
|
|
1060
|
+
yield { value };
|
|
1061
|
+
}()
|
|
1062
|
+
});
|
|
1063
|
+
if (result.outcome === "created") {
|
|
1064
|
+
await runtime.events.emit({
|
|
1065
|
+
events: [
|
|
1066
|
+
{
|
|
1067
|
+
type: "dataset.version.committed",
|
|
1068
|
+
payload: {
|
|
1069
|
+
datasetId: registered.id,
|
|
1070
|
+
versionId: result.version.versionId,
|
|
1071
|
+
createdAt: result.version.createdAt.toISOString(),
|
|
1072
|
+
producer
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
],
|
|
1076
|
+
correlationId: execution.correlationId
|
|
1077
|
+
}, { source: "SixbDatasets" });
|
|
1078
|
+
}
|
|
1079
|
+
return result;
|
|
944
1080
|
}
|
|
945
1081
|
};
|
|
946
1082
|
}
|
|
947
1083
|
|
|
948
1084
|
// src/events/execution.ts
|
|
949
1085
|
function createEventsRuntime(runtime) {
|
|
1086
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
1087
|
+
const visibleEvents = (events) => {
|
|
1088
|
+
switch (authority.type) {
|
|
1089
|
+
case "denied":
|
|
1090
|
+
case "delegated":
|
|
1091
|
+
return [];
|
|
1092
|
+
case "principal":
|
|
1093
|
+
return events.filter((event) => canViewEvent(authority.context, event));
|
|
1094
|
+
case "unrestricted":
|
|
1095
|
+
return [...events];
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
950
1098
|
return {
|
|
951
|
-
canRead: (event) =>
|
|
1099
|
+
canRead: (event) => {
|
|
1100
|
+
switch (authority.type) {
|
|
1101
|
+
case "denied":
|
|
1102
|
+
case "delegated":
|
|
1103
|
+
return false;
|
|
1104
|
+
case "principal":
|
|
1105
|
+
return canViewEvent(authority.context, event);
|
|
1106
|
+
case "unrestricted":
|
|
1107
|
+
return true;
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
952
1110
|
append: (input) => {
|
|
953
1111
|
assertPrivileged(runtime, "events.append");
|
|
954
1112
|
return runtime.events.append(input);
|
|
@@ -958,15 +1116,42 @@ function createEventsRuntime(runtime) {
|
|
|
958
1116
|
return runtime.events.emit(input, options);
|
|
959
1117
|
},
|
|
960
1118
|
read: async (input) => {
|
|
1119
|
+
switch (authority.type) {
|
|
1120
|
+
case "denied":
|
|
1121
|
+
case "delegated":
|
|
1122
|
+
return [];
|
|
1123
|
+
case "principal":
|
|
1124
|
+
case "unrestricted":
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
961
1127
|
const events = await runtime.events.read(input);
|
|
962
|
-
return events
|
|
1128
|
+
return visibleEvents(events);
|
|
963
1129
|
},
|
|
964
|
-
latestCursor: () =>
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1130
|
+
latestCursor: () => {
|
|
1131
|
+
switch (authority.type) {
|
|
1132
|
+
case "denied":
|
|
1133
|
+
case "delegated":
|
|
1134
|
+
return Promise.resolve(undefined);
|
|
1135
|
+
case "principal":
|
|
1136
|
+
case "unrestricted":
|
|
1137
|
+
return runtime.events.latestCursor();
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1140
|
+
subscribe: (input, handler) => {
|
|
1141
|
+
switch (authority.type) {
|
|
1142
|
+
case "denied":
|
|
1143
|
+
case "delegated":
|
|
1144
|
+
return Promise.resolve(() => {});
|
|
1145
|
+
case "principal":
|
|
1146
|
+
case "unrestricted":
|
|
1147
|
+
break;
|
|
1148
|
+
}
|
|
1149
|
+
return runtime.events.subscribe(input, (events) => {
|
|
1150
|
+
const visible = visibleEvents(events);
|
|
1151
|
+
if (visible.length > 0)
|
|
1152
|
+
handler(visible);
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
970
1155
|
};
|
|
971
1156
|
}
|
|
972
1157
|
|
|
@@ -988,129 +1173,118 @@ function createLogsRuntime(runtime, source) {
|
|
|
988
1173
|
|
|
989
1174
|
// src/objects/execution.ts
|
|
990
1175
|
function createObjectsRuntime(runtime, execution) {
|
|
1176
|
+
const runtimeAuthorization = runtime.runtimeAuthorization;
|
|
1177
|
+
const objectReader = runtime.objectReader;
|
|
1178
|
+
assertAuthorizedObjectReaderBinding({
|
|
1179
|
+
reader: objectReader,
|
|
1180
|
+
scope: { execution, authorization: runtimeAuthorization }
|
|
1181
|
+
});
|
|
1182
|
+
const authorization = runtime.authorization;
|
|
1183
|
+
const capturedRuntime = {
|
|
1184
|
+
projectId: runtime.projectId,
|
|
1185
|
+
broker: runtime.broker,
|
|
1186
|
+
ontology: runtime.ontology,
|
|
1187
|
+
actionRegistry: runtime.actionRegistry,
|
|
1188
|
+
events: runtime.events,
|
|
1189
|
+
storage: runtime.storage,
|
|
1190
|
+
queues: runtime.queues,
|
|
1191
|
+
runtimeAuthorization,
|
|
1192
|
+
objectReader,
|
|
1193
|
+
...authorization === undefined ? {} : { authorization }
|
|
1194
|
+
};
|
|
1195
|
+
shareOntologyMutationRuntime(runtime, capturedRuntime);
|
|
1196
|
+
shareSixbErrorReporter(runtime, capturedRuntime);
|
|
1197
|
+
Object.freeze(capturedRuntime);
|
|
1198
|
+
const ontologyView = () => getAuthorizedOntologyView(objectReader);
|
|
991
1199
|
const objects = Object.assign((objectType) => {
|
|
992
|
-
assertObjectTypeRegistered(
|
|
993
|
-
return createObjectSet({ ...
|
|
1200
|
+
assertObjectTypeRegistered(capturedRuntime.ontology.getObjectTypesById(), objectType);
|
|
1201
|
+
return createObjectSet({ ...capturedRuntime, execution, objectType });
|
|
994
1202
|
}, {
|
|
995
|
-
listTypes: () =>
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
},
|
|
1007
|
-
getValueTypesById: () => runtime.ontology.getValueTypesById(),
|
|
1008
|
-
listSubTypes: (objectTypeId) => runtime.ontology.listSubTypes(objectTypeId),
|
|
1009
|
-
isValidLinkTarget: (expected, actual) => runtime.ontology.isValidLinkTarget(expected, actual),
|
|
1010
|
-
executeQuery: (input) => executeObjectQuery({ projectId: runtime.projectId, ...input }, {
|
|
1011
|
-
ontology: runtime.ontology,
|
|
1012
|
-
storage: runtime.storage.objects,
|
|
1013
|
-
runtimeAuthorization: runtime.runtimeAuthorization,
|
|
1014
|
-
authorization: runtime.authorization
|
|
1015
|
-
}),
|
|
1016
|
-
queryLinks: (input) => executeObjectQueryLinks({ projectId: runtime.projectId, ...input }, {
|
|
1017
|
-
ontology: runtime.ontology,
|
|
1018
|
-
storage: runtime.storage.objects,
|
|
1019
|
-
runtimeAuthorization: runtime.runtimeAuthorization,
|
|
1020
|
-
authorization: runtime.authorization
|
|
1021
|
-
}),
|
|
1022
|
-
count: (input) => countObjects({ projectId: runtime.projectId, ...input }, {
|
|
1023
|
-
ontology: runtime.ontology,
|
|
1024
|
-
storage: runtime.storage.objects,
|
|
1025
|
-
runtimeAuthorization: runtime.runtimeAuthorization,
|
|
1026
|
-
authorization: runtime.authorization
|
|
1027
|
-
}),
|
|
1028
|
-
exists: (input) => existsObjects({ projectId: runtime.projectId, ...input }, {
|
|
1029
|
-
ontology: runtime.ontology,
|
|
1030
|
-
storage: runtime.storage.objects,
|
|
1031
|
-
runtimeAuthorization: runtime.runtimeAuthorization,
|
|
1032
|
-
authorization: runtime.authorization
|
|
1033
|
-
}),
|
|
1034
|
-
facet: (input) => facetObjects({ projectId: runtime.projectId, ...input }, {
|
|
1035
|
-
ontology: runtime.ontology,
|
|
1036
|
-
storage: runtime.storage.objects,
|
|
1037
|
-
runtimeAuthorization: runtime.runtimeAuthorization,
|
|
1038
|
-
authorization: runtime.authorization
|
|
1039
|
-
}),
|
|
1203
|
+
listTypes: () => ontologyView().listObjectTypes(),
|
|
1204
|
+
getTypeById: (objectTypeId) => ontologyView().getObjectTypeById(objectTypeId),
|
|
1205
|
+
resolveType: (objectTypeId) => ontologyView().resolveObjectType(objectTypeId),
|
|
1206
|
+
getValueTypesById: () => ontologyView().getValueTypesById(),
|
|
1207
|
+
listSubTypes: (objectTypeId) => ontologyView().listSubTypes(objectTypeId),
|
|
1208
|
+
isValidLinkTarget: (expected, actual) => ontologyView().isValidLinkTarget(expected, actual),
|
|
1209
|
+
executeQuery: (input) => objectReader.executeQuery(input),
|
|
1210
|
+
queryLinks: (input) => objectReader.queryLinks(input),
|
|
1211
|
+
count: (input) => objectReader.count(input),
|
|
1212
|
+
exists: (input) => objectReader.exists(input),
|
|
1213
|
+
facet: (input) => objectReader.facet(input),
|
|
1040
1214
|
listLinks: async (input) => {
|
|
1041
|
-
|
|
1042
|
-
const links = await runtime.storage.objects.listLinks({
|
|
1043
|
-
projectId: runtime.projectId,
|
|
1044
|
-
...input
|
|
1045
|
-
});
|
|
1046
|
-
return links.filter((link) => isAllowed(runtime.authorization, {
|
|
1047
|
-
kind: "object.view",
|
|
1048
|
-
objectTypeId: link.sourceTypeId
|
|
1049
|
-
}) && isAllowed(runtime.authorization, {
|
|
1050
|
-
kind: "object.view",
|
|
1051
|
-
objectTypeId: link.targetTypeId
|
|
1052
|
-
}));
|
|
1215
|
+
return objectReader.listLinks(input);
|
|
1053
1216
|
},
|
|
1054
|
-
getTelemetryHistoryBatch: (input) =>
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
authorization: runtime.authorization
|
|
1058
|
-
}),
|
|
1059
|
-
getTelemetryHistory: (input) => {
|
|
1060
|
-
assertAuthorized(runtime, { kind: "object.view", objectTypeId: input.objectTypeId });
|
|
1061
|
-
return runtime.storage.timeseries.getHistory({
|
|
1062
|
-
projectId: runtime.projectId,
|
|
1063
|
-
...input
|
|
1064
|
-
});
|
|
1217
|
+
getTelemetryHistoryBatch: (input) => {
|
|
1218
|
+
const timeseries = capturedRuntime.storage.timeseries;
|
|
1219
|
+
return getTelemetryHistoryBatch(input, { storage: timeseries, objectReader });
|
|
1065
1220
|
},
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1221
|
+
getTelemetryHistory: async (input) => {
|
|
1222
|
+
const timeseries = capturedRuntime.storage.timeseries;
|
|
1223
|
+
const objectTypeId = input.objectTypeId;
|
|
1224
|
+
const objectId = input.objectId;
|
|
1225
|
+
const propertyId = input.propertyId;
|
|
1226
|
+
const from = input.from;
|
|
1227
|
+
const to = input.to;
|
|
1228
|
+
const limit = input.limit;
|
|
1229
|
+
const order = input.order;
|
|
1230
|
+
const [result] = await getTelemetryHistoryBatch({
|
|
1231
|
+
series: [{ objectTypeId, objectId, propertyId }],
|
|
1232
|
+
...from === undefined ? {} : { from },
|
|
1233
|
+
...to === undefined ? {} : { to },
|
|
1234
|
+
...limit === undefined ? {} : { limitPerSeries: limit },
|
|
1235
|
+
...order === undefined ? {} : { order }
|
|
1236
|
+
}, { storage: timeseries, objectReader });
|
|
1237
|
+
return result?.points ?? [];
|
|
1072
1238
|
},
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
primaryId
|
|
1080
|
-
});
|
|
1239
|
+
getLatestTelemetry: async (input) => {
|
|
1240
|
+
const timeseries = capturedRuntime.storage.timeseries;
|
|
1241
|
+
const objectTypeId = input.objectTypeId;
|
|
1242
|
+
const objectId = input.objectId;
|
|
1243
|
+
const propertyId = input.propertyId;
|
|
1244
|
+
return getLatestTelemetryPoint({ objectTypeId, objectId, propertyId }, { storage: timeseries, objectReader });
|
|
1081
1245
|
},
|
|
1246
|
+
list: (params) => listObjects(capturedRuntime, params),
|
|
1247
|
+
get: (objectTypeId, primaryId) => objectReader.getByPrimaryId({ objectTypeId, primaryId }),
|
|
1082
1248
|
getPrimaryPropertyId: (objectTypeId) => {
|
|
1083
|
-
|
|
1084
|
-
return runtime.ontology.getPrimaryPropertyId(objectTypeId);
|
|
1249
|
+
return ontologyView().getPrimaryPropertyId(objectTypeId);
|
|
1085
1250
|
},
|
|
1086
|
-
upsert: (objectTypeId, properties) => upsertObject(
|
|
1087
|
-
upsertBatch: (objectTypeId, items) => upsertObjectBatch(
|
|
1088
|
-
upsertLink: (objectTypeId, sourceId, linkId, target) => upsertLink(
|
|
1089
|
-
upsertLinkBatch: (items) => upsertLinkBatch(
|
|
1090
|
-
removeLink: (objectTypeId, sourceId, linkId, target) => removeLink(
|
|
1091
|
-
appendTelemetry: (objectTypeId, items) => appendTelemetry(
|
|
1251
|
+
upsert: (objectTypeId, properties) => upsertObject(capturedRuntime, objectTypeId, properties),
|
|
1252
|
+
upsertBatch: (objectTypeId, items) => upsertObjectBatch(capturedRuntime, objectTypeId, items),
|
|
1253
|
+
upsertLink: (objectTypeId, sourceId, linkId, target) => upsertLink(capturedRuntime, objectTypeId, sourceId, linkId, target),
|
|
1254
|
+
upsertLinkBatch: (items) => upsertLinkBatch(capturedRuntime, items),
|
|
1255
|
+
removeLink: (objectTypeId, sourceId, linkId, target) => removeLink(capturedRuntime, objectTypeId, sourceId, linkId, target),
|
|
1256
|
+
appendTelemetry: (objectTypeId, items) => appendTelemetry(capturedRuntime, objectTypeId, items)
|
|
1092
1257
|
});
|
|
1093
1258
|
return objects;
|
|
1094
1259
|
}
|
|
1095
1260
|
|
|
1096
1261
|
// src/pipelines/execution.ts
|
|
1097
1262
|
function createPipelinesRuntime(runtime, execution, source) {
|
|
1098
|
-
const
|
|
1263
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
1264
|
+
const allowed = (pipelineId) => isRuntimeAllowed(runtime, { kind: "pipeline.run", pipelineId });
|
|
1099
1265
|
const visibleIds = () => source.list().filter((pipeline) => allowed(pipeline.id)).map((pipeline) => pipeline.id);
|
|
1266
|
+
const historyFilterIds = () => authority.type === "unrestricted" ? undefined : authority.type === "principal" ? visibleIds() : [];
|
|
1100
1267
|
const getRun = async (runId) => {
|
|
1268
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
1269
|
+
return null;
|
|
1101
1270
|
const run = await runtime.storage.pipelineRuns?.getById({
|
|
1102
1271
|
projectId: runtime.projectId,
|
|
1103
1272
|
id: runId
|
|
1104
1273
|
}) ?? null;
|
|
1105
|
-
|
|
1274
|
+
if (!run)
|
|
1275
|
+
return null;
|
|
1276
|
+
return authority.type === "unrestricted" || canViewPipelineRun(authority.context, run) ? run : null;
|
|
1106
1277
|
};
|
|
1107
1278
|
return {
|
|
1108
|
-
list: () => source.list().filter((pipeline) => allowed(pipeline.id)),
|
|
1279
|
+
list: () => authority.type === "denied" || authority.type === "delegated" ? [] : source.list().filter((pipeline) => allowed(pipeline.id)),
|
|
1109
1280
|
getById: (pipelineId) => {
|
|
1281
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
1282
|
+
return null;
|
|
1110
1283
|
const pipeline = source.getById(pipelineId);
|
|
1111
1284
|
return pipeline && allowed(pipelineId) ? pipeline : null;
|
|
1112
1285
|
},
|
|
1113
1286
|
request: async (input) => {
|
|
1287
|
+
assertAuthorized(runtime, { kind: "pipeline.run", pipelineId: input.pipelineId });
|
|
1114
1288
|
const pipeline = source.getById(input.pipelineId);
|
|
1115
1289
|
if (!pipeline)
|
|
1116
1290
|
throw new PipelineError(`[Sixb] Unknown pipeline '${input.pipelineId}'`);
|
|
@@ -1119,16 +1293,22 @@ function createPipelinesRuntime(runtime, execution, source) {
|
|
|
1119
1293
|
runs: {
|
|
1120
1294
|
getById: getRun,
|
|
1121
1295
|
list: (input = {}) => {
|
|
1296
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
1297
|
+
return Promise.resolve({ runs: [], hasMore: false, total: 0 });
|
|
1298
|
+
}
|
|
1122
1299
|
const storage = runtime.storage.pipelineRuns;
|
|
1123
1300
|
if (!storage)
|
|
1124
1301
|
return Promise.resolve({ runs: [], hasMore: false, total: 0 });
|
|
1125
1302
|
return storage.list({
|
|
1126
|
-
projectId: runtime.projectId,
|
|
1127
1303
|
...input,
|
|
1128
|
-
pipelineIds:
|
|
1304
|
+
pipelineIds: historyFilterIds(),
|
|
1305
|
+
projectId: runtime.projectId
|
|
1129
1306
|
});
|
|
1130
1307
|
},
|
|
1131
1308
|
listLatest: (pipelineIds) => {
|
|
1309
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
1310
|
+
return Promise.resolve({ runs: [] });
|
|
1311
|
+
}
|
|
1132
1312
|
const storage = runtime.storage.pipelineRuns;
|
|
1133
1313
|
if (!storage || pipelineIds.length === 0)
|
|
1134
1314
|
return Promise.resolve({ runs: [] });
|
|
@@ -1143,9 +1323,9 @@ function createPipelinesRuntime(runtime, execution, source) {
|
|
|
1143
1323
|
if (!storage || !await getRun(runId))
|
|
1144
1324
|
return null;
|
|
1145
1325
|
return storage.listSteps({
|
|
1146
|
-
projectId: runtime.projectId,
|
|
1147
1326
|
...input,
|
|
1148
|
-
pipelineRunId: runId
|
|
1327
|
+
pipelineRunId: runId,
|
|
1328
|
+
projectId: runtime.projectId
|
|
1149
1329
|
});
|
|
1150
1330
|
}
|
|
1151
1331
|
}
|
|
@@ -1154,39 +1334,95 @@ function createPipelinesRuntime(runtime, execution, source) {
|
|
|
1154
1334
|
|
|
1155
1335
|
// src/projections/execution.ts
|
|
1156
1336
|
function createProjectionsRuntime(runtime, source) {
|
|
1157
|
-
const
|
|
1337
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
1338
|
+
const listVisible = (list) => {
|
|
1339
|
+
switch (authority.type) {
|
|
1340
|
+
case "denied":
|
|
1341
|
+
case "delegated":
|
|
1342
|
+
return [];
|
|
1343
|
+
case "principal":
|
|
1344
|
+
return list().filter((projection) => canViewProjection(authority.context, projection));
|
|
1345
|
+
case "unrestricted":
|
|
1346
|
+
return [...list()];
|
|
1347
|
+
}
|
|
1348
|
+
};
|
|
1349
|
+
const visible = (projection) => {
|
|
1350
|
+
switch (authority.type) {
|
|
1351
|
+
case "denied":
|
|
1352
|
+
case "delegated":
|
|
1353
|
+
return false;
|
|
1354
|
+
case "principal":
|
|
1355
|
+
return canViewProjection(authority.context, projection);
|
|
1356
|
+
case "unrestricted":
|
|
1357
|
+
return true;
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1158
1360
|
const visibleIds = (projectionIds) => projectionIds.filter((projectionId) => {
|
|
1159
1361
|
const projection = source.getById(projectionId);
|
|
1160
1362
|
return projection !== null && visible(projection);
|
|
1161
1363
|
});
|
|
1162
1364
|
return {
|
|
1163
|
-
list: () => source.list()
|
|
1164
|
-
listObjects: () => source.listObjects()
|
|
1165
|
-
listLinks: () => source.listLinks()
|
|
1166
|
-
listTelemetry: () => source.listTelemetry()
|
|
1365
|
+
list: () => listVisible(() => source.list()),
|
|
1366
|
+
listObjects: () => listVisible(() => source.listObjects()),
|
|
1367
|
+
listLinks: () => listVisible(() => source.listLinks()),
|
|
1368
|
+
listTelemetry: () => listVisible(() => source.listTelemetry()),
|
|
1167
1369
|
getById: (projectionId) => {
|
|
1370
|
+
switch (authority.type) {
|
|
1371
|
+
case "denied":
|
|
1372
|
+
case "delegated":
|
|
1373
|
+
return null;
|
|
1374
|
+
case "principal":
|
|
1375
|
+
case "unrestricted":
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1168
1378
|
const projection = source.getById(projectionId);
|
|
1169
1379
|
return projection && visible(projection) ? projection : null;
|
|
1170
1380
|
},
|
|
1171
1381
|
runs: {
|
|
1172
1382
|
getById: async (runId) => {
|
|
1383
|
+
switch (authority.type) {
|
|
1384
|
+
case "denied":
|
|
1385
|
+
case "delegated":
|
|
1386
|
+
return null;
|
|
1387
|
+
case "principal":
|
|
1388
|
+
case "unrestricted":
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1173
1391
|
const run = await runtime.storage.projectionRuns?.getById({
|
|
1174
1392
|
projectId: runtime.projectId,
|
|
1175
1393
|
id: runId
|
|
1176
1394
|
}) ?? null;
|
|
1177
|
-
|
|
1395
|
+
if (!run)
|
|
1396
|
+
return null;
|
|
1397
|
+
return authority.type === "unrestricted" || canViewProjectionRun(authority.context, run.target) ? run : null;
|
|
1178
1398
|
},
|
|
1179
1399
|
list: (input = {}) => {
|
|
1400
|
+
switch (authority.type) {
|
|
1401
|
+
case "denied":
|
|
1402
|
+
case "delegated":
|
|
1403
|
+
return Promise.resolve({ runs: [], hasMore: false, total: 0 });
|
|
1404
|
+
case "principal":
|
|
1405
|
+
case "unrestricted":
|
|
1406
|
+
break;
|
|
1407
|
+
}
|
|
1180
1408
|
const storage = runtime.storage.projectionRuns;
|
|
1181
1409
|
if (!storage)
|
|
1182
1410
|
return Promise.resolve({ runs: [], hasMore: false, total: 0 });
|
|
1183
1411
|
return storage.list({
|
|
1184
|
-
projectId: runtime.projectId,
|
|
1185
1412
|
...input,
|
|
1186
|
-
objectTypeIds:
|
|
1413
|
+
objectTypeIds: authority.type === "principal" ? [...authority.context.grants["view:object"]] : undefined,
|
|
1414
|
+
projectId: runtime.projectId
|
|
1187
1415
|
});
|
|
1188
1416
|
},
|
|
1189
1417
|
listLatest: (projectionIds) => {
|
|
1418
|
+
switch (authority.type) {
|
|
1419
|
+
case "denied":
|
|
1420
|
+
case "delegated":
|
|
1421
|
+
return Promise.resolve({ runs: [] });
|
|
1422
|
+
case "principal":
|
|
1423
|
+
case "unrestricted":
|
|
1424
|
+
break;
|
|
1425
|
+
}
|
|
1190
1426
|
const storage = runtime.storage.projectionRuns;
|
|
1191
1427
|
if (!storage || projectionIds.length === 0)
|
|
1192
1428
|
return Promise.resolve({ runs: [] });
|
|
@@ -1199,25 +1435,35 @@ function createProjectionsRuntime(runtime, source) {
|
|
|
1199
1435
|
|
|
1200
1436
|
// src/rules/execution.ts
|
|
1201
1437
|
function createRulesRuntime(runtime, source) {
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1438
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
1439
|
+
const visible = (rule) => {
|
|
1440
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
1441
|
+
return false;
|
|
1442
|
+
return isRuntimeAllowed(runtime, {
|
|
1443
|
+
kind: "object.view",
|
|
1444
|
+
objectTypeId: rule.subject.objectTypeId
|
|
1445
|
+
});
|
|
1446
|
+
};
|
|
1206
1447
|
return {
|
|
1207
|
-
list: () => source.list().filter(visible),
|
|
1448
|
+
list: () => authority.type === "denied" || authority.type === "delegated" ? [] : source.list().filter(visible),
|
|
1208
1449
|
getById: (ruleId) => {
|
|
1450
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
1451
|
+
return null;
|
|
1209
1452
|
const rule = source.getById(ruleId);
|
|
1210
1453
|
return rule && visible(rule) ? rule : null;
|
|
1211
1454
|
},
|
|
1212
1455
|
states: {
|
|
1213
1456
|
list: (input = {}) => {
|
|
1457
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
1458
|
+
return Promise.resolve({ states: [], hasMore: false, total: 0 });
|
|
1459
|
+
}
|
|
1214
1460
|
const storage = runtime.storage.rules;
|
|
1215
1461
|
if (!storage)
|
|
1216
1462
|
return Promise.resolve({ states: [], hasMore: false, total: 0 });
|
|
1217
1463
|
return storage.listActive({
|
|
1218
|
-
projectId: runtime.projectId,
|
|
1219
1464
|
...input,
|
|
1220
|
-
objectTypeIds:
|
|
1465
|
+
objectTypeIds: authority.type === "principal" ? [...authority.context.grants["view:object"]] : undefined,
|
|
1466
|
+
projectId: runtime.projectId
|
|
1221
1467
|
});
|
|
1222
1468
|
}
|
|
1223
1469
|
}
|
|
@@ -1225,24 +1471,299 @@ function createRulesRuntime(runtime, source) {
|
|
|
1225
1471
|
}
|
|
1226
1472
|
|
|
1227
1473
|
// src/schedules/execution.ts
|
|
1228
|
-
function createSchedulesRuntime(schedules) {
|
|
1474
|
+
function createSchedulesRuntime(runtime, schedules) {
|
|
1475
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
1229
1476
|
return {
|
|
1230
|
-
list: () =>
|
|
1231
|
-
|
|
1477
|
+
list: () => {
|
|
1478
|
+
switch (authority.type) {
|
|
1479
|
+
case "denied":
|
|
1480
|
+
case "delegated":
|
|
1481
|
+
return [];
|
|
1482
|
+
case "principal":
|
|
1483
|
+
case "unrestricted":
|
|
1484
|
+
return schedules.list();
|
|
1485
|
+
}
|
|
1486
|
+
},
|
|
1487
|
+
getById: (scheduleId) => {
|
|
1488
|
+
switch (authority.type) {
|
|
1489
|
+
case "denied":
|
|
1490
|
+
case "delegated":
|
|
1491
|
+
return null;
|
|
1492
|
+
case "principal":
|
|
1493
|
+
case "unrestricted":
|
|
1494
|
+
return schedules.getById(scheduleId);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1232
1497
|
};
|
|
1233
1498
|
}
|
|
1234
1499
|
|
|
1500
|
+
// src/shares/execution.ts
|
|
1501
|
+
import { createHash as createHash2, randomBytes, randomUUID as randomUUID4 } from "crypto";
|
|
1502
|
+
var MAX_CREATE_ATTEMPTS = 5;
|
|
1503
|
+
|
|
1504
|
+
class ShareError extends Error {
|
|
1505
|
+
reason;
|
|
1506
|
+
name = "ShareError";
|
|
1507
|
+
constructor(reason, message, options) {
|
|
1508
|
+
super(message, options);
|
|
1509
|
+
this.reason = reason;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
function createSharesRuntime(runtime, execution, definitions) {
|
|
1513
|
+
const managementPrincipal = () => {
|
|
1514
|
+
const authority = resolveExecutionScopeAuthorization(runtime.projectId, {
|
|
1515
|
+
execution,
|
|
1516
|
+
authorization: runtime.runtimeAuthorization
|
|
1517
|
+
});
|
|
1518
|
+
if (authority.type !== "principal" || authority.context.principal.type === "system") {
|
|
1519
|
+
throw new ShareError("unauthenticated", "[Sixb] Shared access grants require user or service-account authority.");
|
|
1520
|
+
}
|
|
1521
|
+
return {
|
|
1522
|
+
type: authority.context.principal.type,
|
|
1523
|
+
id: authority.context.principal.id
|
|
1524
|
+
};
|
|
1525
|
+
};
|
|
1526
|
+
const canManage = (shareId) => {
|
|
1527
|
+
try {
|
|
1528
|
+
managementPrincipal();
|
|
1529
|
+
return isRuntimeAllowed(runtime, { kind: "share.manage", shareId });
|
|
1530
|
+
} catch {
|
|
1531
|
+
return false;
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
const resolveManageableDefinition = (definitionId) => {
|
|
1535
|
+
const id = validDefinitionId(definitionId);
|
|
1536
|
+
managementPrincipal();
|
|
1537
|
+
assertCanManage(runtime, id);
|
|
1538
|
+
return resolveDefinition(definitions, id);
|
|
1539
|
+
};
|
|
1540
|
+
const issueByDefinition = async (definition, input) => {
|
|
1541
|
+
assertInputObject(input, "Shared access issue input");
|
|
1542
|
+
const issuer = managementPrincipal();
|
|
1543
|
+
assertCanManage(runtime, definition.id);
|
|
1544
|
+
const storage = requireShareStorage(runtime);
|
|
1545
|
+
const createdAt = new Date;
|
|
1546
|
+
const expiresAt = validFutureDate(input.expiresAt, createdAt);
|
|
1547
|
+
const target = exactTarget(definition, input.target);
|
|
1548
|
+
const object = await runtime.objectReader.getByPrimaryId({
|
|
1549
|
+
objectTypeId: target.objectTypeId,
|
|
1550
|
+
primaryId: target.primaryId
|
|
1551
|
+
});
|
|
1552
|
+
if (!object) {
|
|
1553
|
+
throw new ObjectNotFoundError(target.objectTypeId, target.primaryId, "Share target not found");
|
|
1554
|
+
}
|
|
1555
|
+
const authoritySnapshot = {
|
|
1556
|
+
version: 1,
|
|
1557
|
+
access: compileShareAccessPlan({
|
|
1558
|
+
share: definition,
|
|
1559
|
+
target,
|
|
1560
|
+
ontology: runtime.ontology,
|
|
1561
|
+
actions: runtime.actionRegistry
|
|
1562
|
+
})
|
|
1563
|
+
};
|
|
1564
|
+
for (let attempt = 0;attempt < MAX_CREATE_ATTEMPTS; attempt += 1) {
|
|
1565
|
+
const secret = randomBytes(32).toString("base64url");
|
|
1566
|
+
try {
|
|
1567
|
+
const grant = await storage.create({
|
|
1568
|
+
id: `shr_${randomUUID4()}`,
|
|
1569
|
+
projectId: runtime.projectId,
|
|
1570
|
+
definitionId: definition.id,
|
|
1571
|
+
target,
|
|
1572
|
+
issuedBy: issuer,
|
|
1573
|
+
authoritySnapshot,
|
|
1574
|
+
tokenHash: sha256(secret),
|
|
1575
|
+
destinationPath: input.destinationPath,
|
|
1576
|
+
createdAt,
|
|
1577
|
+
expiresAt
|
|
1578
|
+
});
|
|
1579
|
+
return { grant: publicGrant(grant), secret };
|
|
1580
|
+
} catch (error) {
|
|
1581
|
+
if (error instanceof ShareGrantStorageError && error.code === "invalid_input") {
|
|
1582
|
+
throw new ShareError("invalid_input", error.message, { cause: error });
|
|
1583
|
+
}
|
|
1584
|
+
if (!(error instanceof ShareGrantStorageError) || error.code !== "duplicate" || attempt === MAX_CREATE_ATTEMPTS - 1) {
|
|
1585
|
+
throw storageFailure("issue", error);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
throw storageFailure("issue");
|
|
1590
|
+
};
|
|
1591
|
+
const listByDefinition = async (definition, input = {}) => {
|
|
1592
|
+
assertInputObject(input, "Shared access list input");
|
|
1593
|
+
managementPrincipal();
|
|
1594
|
+
assertCanManage(runtime, definition.id);
|
|
1595
|
+
const storage = requireShareStorage(runtime);
|
|
1596
|
+
const target = input.target === undefined ? undefined : exactTarget(definition, input.target);
|
|
1597
|
+
try {
|
|
1598
|
+
const result = await storage.list({
|
|
1599
|
+
projectId: runtime.projectId,
|
|
1600
|
+
definitionId: definition.id,
|
|
1601
|
+
...target === undefined ? {} : { target },
|
|
1602
|
+
includeRevoked: input.includeRevoked,
|
|
1603
|
+
includeExpired: input.includeExpired,
|
|
1604
|
+
now: new Date,
|
|
1605
|
+
limit: input.limit,
|
|
1606
|
+
offset: input.offset
|
|
1607
|
+
});
|
|
1608
|
+
return { ...result, grants: result.grants.map(publicGrant) };
|
|
1609
|
+
} catch (error) {
|
|
1610
|
+
if (error instanceof ShareGrantStorageError && error.code === "invalid_input") {
|
|
1611
|
+
throw new ShareError("invalid_input", error.message, { cause: error });
|
|
1612
|
+
}
|
|
1613
|
+
throw storageFailure("list", error);
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
return {
|
|
1617
|
+
listDefinitions: () => definitions.list().filter((definition) => canManage(definition.id)),
|
|
1618
|
+
getDefinitionById: (definitionId) => {
|
|
1619
|
+
const definition = definitions.getById(definitionId);
|
|
1620
|
+
return definition && canManage(definition.id) ? definition : null;
|
|
1621
|
+
},
|
|
1622
|
+
async issue(definition, input) {
|
|
1623
|
+
return issueByDefinition(resolveManageableDefinition(definitionIdFromReference(definition)), input);
|
|
1624
|
+
},
|
|
1625
|
+
async issueById(input) {
|
|
1626
|
+
assertInputObject(input, "Shared access issue input");
|
|
1627
|
+
return issueByDefinition(resolveManageableDefinition(input.definitionId), input);
|
|
1628
|
+
},
|
|
1629
|
+
async list(definition, input) {
|
|
1630
|
+
return listByDefinition(resolveManageableDefinition(definitionIdFromReference(definition)), input);
|
|
1631
|
+
},
|
|
1632
|
+
async listById(input) {
|
|
1633
|
+
assertInputObject(input, "Shared access list input");
|
|
1634
|
+
const definition = resolveManageableDefinition(input.definitionId);
|
|
1635
|
+
const { primaryId, includeRevoked, includeExpired, limit, offset } = input;
|
|
1636
|
+
return listByDefinition(definition, {
|
|
1637
|
+
...primaryId === undefined ? {} : {
|
|
1638
|
+
target: {
|
|
1639
|
+
objectTypeId: definition.target.objectTypeId,
|
|
1640
|
+
primaryId
|
|
1641
|
+
}
|
|
1642
|
+
},
|
|
1643
|
+
includeRevoked,
|
|
1644
|
+
includeExpired,
|
|
1645
|
+
limit,
|
|
1646
|
+
offset
|
|
1647
|
+
});
|
|
1648
|
+
},
|
|
1649
|
+
revoke: async (grantId) => {
|
|
1650
|
+
const actor = managementPrincipal();
|
|
1651
|
+
const storage = requireShareStorage(runtime);
|
|
1652
|
+
if (typeof grantId !== "string" || !grantId.trim()) {
|
|
1653
|
+
throw new ShareError("invalid_input", "[Sixb] Shared access grant id must not be empty.");
|
|
1654
|
+
}
|
|
1655
|
+
let current;
|
|
1656
|
+
try {
|
|
1657
|
+
current = await storage.getById({ projectId: runtime.projectId, id: grantId });
|
|
1658
|
+
} catch (error) {
|
|
1659
|
+
throw storageFailure("load for revocation", error);
|
|
1660
|
+
}
|
|
1661
|
+
if (!current)
|
|
1662
|
+
return null;
|
|
1663
|
+
if (!definitions.getById(current.definitionId) || !canManage(current.definitionId)) {
|
|
1664
|
+
return null;
|
|
1665
|
+
}
|
|
1666
|
+
try {
|
|
1667
|
+
const revoked = await storage.revoke({
|
|
1668
|
+
projectId: runtime.projectId,
|
|
1669
|
+
id: grantId,
|
|
1670
|
+
revokedAt: new Date,
|
|
1671
|
+
revokedBy: actor
|
|
1672
|
+
});
|
|
1673
|
+
return revoked ? publicGrant(revoked) : null;
|
|
1674
|
+
} catch (error) {
|
|
1675
|
+
throw storageFailure("revoke", error);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
function definitionIdFromReference(value) {
|
|
1681
|
+
return typeof value === "object" && value !== null ? value.id : undefined;
|
|
1682
|
+
}
|
|
1683
|
+
function assertInputObject(value, label) {
|
|
1684
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
1685
|
+
throw new ShareError("invalid_input", `[Sixb] ${label} must be an object.`);
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
function resolveDefinition(definitions, definitionId) {
|
|
1689
|
+
const id = validDefinitionId(definitionId);
|
|
1690
|
+
const definition = definitions.getById(id);
|
|
1691
|
+
if (!definition) {
|
|
1692
|
+
throw new ShareError("not_found", `[Sixb] Unknown Share definition '${id}'.`);
|
|
1693
|
+
}
|
|
1694
|
+
return definition;
|
|
1695
|
+
}
|
|
1696
|
+
function validDefinitionId(value) {
|
|
1697
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
1698
|
+
throw new ShareError("invalid_input", "[Sixb] Share definition id must not be empty.");
|
|
1699
|
+
}
|
|
1700
|
+
return value;
|
|
1701
|
+
}
|
|
1702
|
+
function assertCanManage(runtime, shareId) {
|
|
1703
|
+
assertAuthorized(runtime, { kind: "share.manage", shareId });
|
|
1704
|
+
}
|
|
1705
|
+
function requireShareStorage(runtime) {
|
|
1706
|
+
const storage = runtime.storage.shareGrants;
|
|
1707
|
+
if (!storage) {
|
|
1708
|
+
throw new ShareError("storage_unavailable", "[Sixb] Share grant storage is not configured on this runtime.");
|
|
1709
|
+
}
|
|
1710
|
+
return storage;
|
|
1711
|
+
}
|
|
1712
|
+
function exactTarget(definition, value) {
|
|
1713
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
1714
|
+
throw new ShareError("invalid_input", "[Sixb] Share target must be an exact object reference.");
|
|
1715
|
+
}
|
|
1716
|
+
const objectTypeId = value.objectTypeId;
|
|
1717
|
+
const primaryId = value.primaryId;
|
|
1718
|
+
if (typeof objectTypeId !== "string" || typeof primaryId !== "string" || !primaryId.trim()) {
|
|
1719
|
+
throw new ShareError("invalid_input", "[Sixb] Share target must be an exact object reference.");
|
|
1720
|
+
}
|
|
1721
|
+
if (objectTypeId !== definition.target.objectTypeId) {
|
|
1722
|
+
throw new ShareError("invalid_input", `[Sixb] Share '${definition.id}' targets '${definition.target.objectTypeId}', not '${objectTypeId}'.`);
|
|
1723
|
+
}
|
|
1724
|
+
return Object.freeze({ objectTypeId, primaryId });
|
|
1725
|
+
}
|
|
1726
|
+
function validFutureDate(value, now) {
|
|
1727
|
+
if (!(value instanceof Date) || !Number.isFinite(value.getTime()) || value <= now) {
|
|
1728
|
+
throw new ShareError("invalid_input", "[Sixb] Shared access expiry must be a valid future date.");
|
|
1729
|
+
}
|
|
1730
|
+
return new Date(value);
|
|
1731
|
+
}
|
|
1732
|
+
function sha256(value) {
|
|
1733
|
+
return createHash2("sha256").update(value).digest("hex");
|
|
1734
|
+
}
|
|
1735
|
+
function publicGrant(record) {
|
|
1736
|
+
const {
|
|
1737
|
+
projectId: _projectId,
|
|
1738
|
+
authoritySnapshot: _authoritySnapshot,
|
|
1739
|
+
authorityDigest: _authorityDigest,
|
|
1740
|
+
tokenHash: _tokenHash,
|
|
1741
|
+
...grant
|
|
1742
|
+
} = record;
|
|
1743
|
+
return structuredClone(grant);
|
|
1744
|
+
}
|
|
1745
|
+
function storageFailure(operation, cause) {
|
|
1746
|
+
return new ShareError("storage_failure", `[Sixb] Share grant storage failed to ${operation}.`, {
|
|
1747
|
+
cause
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1235
1751
|
// src/syncs/execution.ts
|
|
1236
1752
|
function createSyncsRuntime(runtime, execution, source) {
|
|
1237
|
-
const
|
|
1753
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
1754
|
+
const allowed = (syncId) => isRuntimeAllowed(runtime, { kind: "sync.run", syncId });
|
|
1238
1755
|
const visibleIds = () => source.list().filter((sync) => allowed(sync.id)).map((sync) => sync.id);
|
|
1756
|
+
const historyFilterIds = () => authority.type === "unrestricted" ? undefined : authority.type === "principal" ? visibleIds() : [];
|
|
1239
1757
|
return {
|
|
1240
|
-
list: () => source.list().filter((sync) => allowed(sync.id)),
|
|
1758
|
+
list: () => authority.type === "denied" || authority.type === "delegated" ? [] : source.list().filter((sync) => allowed(sync.id)),
|
|
1241
1759
|
getById: (syncId) => {
|
|
1760
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
1761
|
+
return null;
|
|
1242
1762
|
const sync = source.getById(syncId);
|
|
1243
1763
|
return sync && allowed(syncId) ? sync : null;
|
|
1244
1764
|
},
|
|
1245
1765
|
request: async (input) => {
|
|
1766
|
+
assertAuthorized(runtime, { kind: "sync.run", syncId: input.syncId });
|
|
1246
1767
|
const sync = source.getById(input.syncId);
|
|
1247
1768
|
if (!sync)
|
|
1248
1769
|
throw new SyncValidationError(`[Sixb] Unknown sync '${input.syncId}'`);
|
|
@@ -1250,6 +1771,8 @@ function createSyncsRuntime(runtime, execution, source) {
|
|
|
1250
1771
|
},
|
|
1251
1772
|
runs: {
|
|
1252
1773
|
getById: async (runId) => {
|
|
1774
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
1775
|
+
return null;
|
|
1253
1776
|
const run = await runtime.storage.syncRuns?.getById({
|
|
1254
1777
|
projectId: runtime.projectId,
|
|
1255
1778
|
id: runId
|
|
@@ -1257,16 +1780,22 @@ function createSyncsRuntime(runtime, execution, source) {
|
|
|
1257
1780
|
return run && allowed(run.syncId) ? run : null;
|
|
1258
1781
|
},
|
|
1259
1782
|
list: (input = {}) => {
|
|
1783
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
1784
|
+
return Promise.resolve({ runs: [], hasMore: false, total: 0 });
|
|
1785
|
+
}
|
|
1260
1786
|
const storage = runtime.storage.syncRuns;
|
|
1261
1787
|
if (!storage)
|
|
1262
1788
|
return Promise.resolve({ runs: [], hasMore: false, total: 0 });
|
|
1263
1789
|
return storage.list({
|
|
1264
|
-
projectId: runtime.projectId,
|
|
1265
1790
|
...input,
|
|
1266
|
-
syncIds:
|
|
1791
|
+
syncIds: historyFilterIds(),
|
|
1792
|
+
projectId: runtime.projectId
|
|
1267
1793
|
});
|
|
1268
1794
|
},
|
|
1269
1795
|
listLatest: (syncIds) => {
|
|
1796
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
1797
|
+
return Promise.resolve({ runs: [] });
|
|
1798
|
+
}
|
|
1270
1799
|
const storage = runtime.storage.syncRuns;
|
|
1271
1800
|
if (!storage || syncIds.length === 0)
|
|
1272
1801
|
return Promise.resolve({ runs: [] });
|
|
@@ -1292,7 +1821,7 @@ class WorkflowValidationError extends Error {
|
|
|
1292
1821
|
}
|
|
1293
1822
|
|
|
1294
1823
|
// src/workflows/run-dispatch.ts
|
|
1295
|
-
import { randomUUID as
|
|
1824
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
1296
1825
|
import { isDeepStrictEqual } from "util";
|
|
1297
1826
|
|
|
1298
1827
|
// src/workflows/validation.ts
|
|
@@ -1981,7 +2510,7 @@ async function persistWorkflowRun(input, request) {
|
|
|
1981
2510
|
assertExistingWorkflowRun(existing, input.workflow.id, request.snapshot);
|
|
1982
2511
|
return { run: existing, created: false };
|
|
1983
2512
|
}
|
|
1984
|
-
const execution = await input.createExecution(`exec_${
|
|
2513
|
+
const execution = await input.createExecution(`exec_${randomUUID5()}`, request.runId);
|
|
1985
2514
|
const queuedAt = new Date;
|
|
1986
2515
|
try {
|
|
1987
2516
|
return await input.storage.transaction(async (tx) => {
|
|
@@ -2088,7 +2617,7 @@ async function failWorkflowRunPublication(input, run, error) {
|
|
|
2088
2617
|
}
|
|
2089
2618
|
function resolveWorkflowRunId(runId) {
|
|
2090
2619
|
if (runId === undefined)
|
|
2091
|
-
return `run_${
|
|
2620
|
+
return `run_${randomUUID5()}`;
|
|
2092
2621
|
if (!runId.trim()) {
|
|
2093
2622
|
throw new WorkflowValidationError("[Sixb] Workflow run id must not be empty");
|
|
2094
2623
|
}
|
|
@@ -2134,6 +2663,10 @@ function assertNonBlank(value, label) {
|
|
|
2134
2663
|
|
|
2135
2664
|
// src/workflows/request.ts
|
|
2136
2665
|
async function requestWorkflowRun(runtime, execution, workflow, options = {}) {
|
|
2666
|
+
resolveExecutionScopeAuthorization(runtime.projectId, {
|
|
2667
|
+
execution,
|
|
2668
|
+
authorization: runtime.runtimeAuthorization
|
|
2669
|
+
});
|
|
2137
2670
|
assertAuthorized(runtime, { kind: "workflow.run", workflowId: workflow.id });
|
|
2138
2671
|
const requesterGroupIds = execution.requestedBy ? await snapshotRequesterGroupIds({
|
|
2139
2672
|
auth: runtime.storage.auth,
|
|
@@ -2168,15 +2701,31 @@ async function requestWorkflowRun(runtime, execution, workflow, options = {}) {
|
|
|
2168
2701
|
|
|
2169
2702
|
// src/workflows/execution.ts
|
|
2170
2703
|
function createWorkflowsRuntime(runtime, execution, source) {
|
|
2171
|
-
const
|
|
2172
|
-
const
|
|
2704
|
+
const authority = resolveRuntimeAuthorizationForProject(runtime);
|
|
2705
|
+
const allowed = (workflowId) => isRuntimeAllowed(runtime, { kind: "workflow.run", workflowId });
|
|
2706
|
+
const canAccessHistory = (workflowId) => {
|
|
2707
|
+
switch (authority.type) {
|
|
2708
|
+
case "denied":
|
|
2709
|
+
case "delegated":
|
|
2710
|
+
return false;
|
|
2711
|
+
case "unrestricted":
|
|
2712
|
+
return true;
|
|
2713
|
+
case "principal":
|
|
2714
|
+
return allowed(workflowId) && source.getById(workflowId) !== null;
|
|
2715
|
+
}
|
|
2716
|
+
};
|
|
2173
2717
|
const visibleIds = () => source.list().filter((workflow) => allowed(workflow.id)).map((workflow) => workflow.id);
|
|
2718
|
+
const historyFilterIds = () => authority.type === "unrestricted" ? undefined : authority.type === "principal" ? visibleIds() : [];
|
|
2174
2719
|
const getVisibleRunRecord = async (runId) => {
|
|
2720
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
2721
|
+
return null;
|
|
2175
2722
|
const run = await runtime.storage.workflowRuns?.getById({
|
|
2176
2723
|
projectId: runtime.projectId,
|
|
2177
2724
|
id: runId
|
|
2178
2725
|
}) ?? null;
|
|
2179
|
-
|
|
2726
|
+
if (!run || !canAccessHistory(run.workflowId))
|
|
2727
|
+
return null;
|
|
2728
|
+
return authority.type === "unrestricted" || canViewWorkflowRun(authority.context, run) ? run : null;
|
|
2180
2729
|
};
|
|
2181
2730
|
const getRun = async (runId) => {
|
|
2182
2731
|
const run = await getVisibleRunRecord(runId);
|
|
@@ -2187,9 +2736,9 @@ function createWorkflowsRuntime(runtime, execution, source) {
|
|
|
2187
2736
|
if (!storage || !await getVisibleRunRecord(runId))
|
|
2188
2737
|
return null;
|
|
2189
2738
|
const result = await storage.nodes.list({
|
|
2190
|
-
projectId: runtime.projectId,
|
|
2191
2739
|
...input,
|
|
2192
|
-
workflowRunId: runId
|
|
2740
|
+
workflowRunId: runId,
|
|
2741
|
+
projectId: runtime.projectId
|
|
2193
2742
|
});
|
|
2194
2743
|
return {
|
|
2195
2744
|
...result,
|
|
@@ -2197,13 +2746,16 @@ function createWorkflowsRuntime(runtime, execution, source) {
|
|
|
2197
2746
|
};
|
|
2198
2747
|
};
|
|
2199
2748
|
return {
|
|
2200
|
-
list: () => source.list().filter((workflow) => allowed(workflow.id)),
|
|
2749
|
+
list: () => authority.type === "denied" || authority.type === "delegated" ? [] : source.list().filter((workflow) => allowed(workflow.id)),
|
|
2201
2750
|
getById: (workflowId) => {
|
|
2751
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
2752
|
+
return null;
|
|
2202
2753
|
const workflow = source.getById(workflowId);
|
|
2203
2754
|
return workflow && allowed(workflowId) ? workflow : null;
|
|
2204
2755
|
},
|
|
2205
2756
|
request: (workflow, options) => requestWorkflowRun(runtime, execution, workflow, options),
|
|
2206
2757
|
requestById: async (input) => {
|
|
2758
|
+
assertAuthorized(runtime, { kind: "workflow.run", workflowId: input.workflowId });
|
|
2207
2759
|
const workflow = source.getById(input.workflowId);
|
|
2208
2760
|
if (!workflow) {
|
|
2209
2761
|
throw new WorkflowValidationError(`[Sixb] Unknown workflow '${input.workflowId}'`);
|
|
@@ -2213,13 +2765,16 @@ function createWorkflowsRuntime(runtime, execution, source) {
|
|
|
2213
2765
|
runs: {
|
|
2214
2766
|
getById: getRun,
|
|
2215
2767
|
list: async (input = {}) => {
|
|
2768
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
2769
|
+
return { runs: [], hasMore: false, total: 0 };
|
|
2770
|
+
}
|
|
2216
2771
|
const storage = runtime.storage.workflowRuns;
|
|
2217
2772
|
if (!storage)
|
|
2218
2773
|
return { runs: [], hasMore: false, total: 0 };
|
|
2219
2774
|
const result = await storage.list({
|
|
2220
|
-
projectId: runtime.projectId,
|
|
2221
2775
|
...input,
|
|
2222
|
-
workflowIds:
|
|
2776
|
+
workflowIds: historyFilterIds(),
|
|
2777
|
+
projectId: runtime.projectId
|
|
2223
2778
|
});
|
|
2224
2779
|
return {
|
|
2225
2780
|
...result,
|
|
@@ -2227,6 +2782,9 @@ function createWorkflowsRuntime(runtime, execution, source) {
|
|
|
2227
2782
|
};
|
|
2228
2783
|
},
|
|
2229
2784
|
listLatest: async (workflowIds) => {
|
|
2785
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
2786
|
+
return { runs: [] };
|
|
2787
|
+
}
|
|
2230
2788
|
const storage = runtime.storage.workflowRuns;
|
|
2231
2789
|
if (!storage || workflowIds.length === 0)
|
|
2232
2790
|
return { runs: [] };
|
|
@@ -2245,20 +2803,27 @@ function createWorkflowsRuntime(runtime, execution, source) {
|
|
|
2245
2803
|
},
|
|
2246
2804
|
interventions: {
|
|
2247
2805
|
getById: async (interventionId) => {
|
|
2806
|
+
if (authority.type === "denied" || authority.type === "delegated")
|
|
2807
|
+
return null;
|
|
2248
2808
|
const intervention = await runtime.storage.workflowInterventions?.getById({
|
|
2249
2809
|
projectId: runtime.projectId,
|
|
2250
2810
|
id: interventionId
|
|
2251
2811
|
}) ?? null;
|
|
2252
|
-
|
|
2812
|
+
if (!intervention || !canAccessHistory(intervention.workflowId))
|
|
2813
|
+
return null;
|
|
2814
|
+
return authority.type === "unrestricted" || canViewWorkflowIntervention(authority.context, intervention) ? intervention : null;
|
|
2253
2815
|
},
|
|
2254
2816
|
list: (input = {}) => {
|
|
2817
|
+
if (authority.type === "denied" || authority.type === "delegated") {
|
|
2818
|
+
return Promise.resolve({ interventions: [], hasMore: false, total: 0 });
|
|
2819
|
+
}
|
|
2255
2820
|
const storage = runtime.storage.workflowInterventions;
|
|
2256
2821
|
if (!storage)
|
|
2257
2822
|
return Promise.resolve({ interventions: [], hasMore: false, total: 0 });
|
|
2258
2823
|
return storage.list({
|
|
2259
|
-
projectId: runtime.projectId,
|
|
2260
2824
|
...input,
|
|
2261
|
-
workflowIds:
|
|
2825
|
+
workflowIds: historyFilterIds(),
|
|
2826
|
+
projectId: runtime.projectId
|
|
2262
2827
|
});
|
|
2263
2828
|
}
|
|
2264
2829
|
}
|
|
@@ -2337,6 +2902,14 @@ async function attachRequestedBy(runtime, run) {
|
|
|
2337
2902
|
// src/runtime/sixb.ts
|
|
2338
2903
|
var boundSixbInstances = new WeakSet;
|
|
2339
2904
|
function createBoundSixb(runtime, dependencies, execution) {
|
|
2905
|
+
resolveExecutionScopeAuthorization(runtime.projectId, {
|
|
2906
|
+
execution,
|
|
2907
|
+
authorization: runtime.runtimeAuthorization
|
|
2908
|
+
});
|
|
2909
|
+
assertAuthorizedObjectReaderBinding({
|
|
2910
|
+
reader: runtime.objectReader,
|
|
2911
|
+
scope: { execution, authorization: runtime.runtimeAuthorization }
|
|
2912
|
+
});
|
|
2340
2913
|
const sixb = {
|
|
2341
2914
|
execution,
|
|
2342
2915
|
...createExecutionFacades(runtime, execution, dependencies)
|
|
@@ -2355,7 +2928,7 @@ function createExecutionFacades(runtime, execution, dependencies) {
|
|
|
2355
2928
|
return {
|
|
2356
2929
|
objects: createObjectsRuntime(runtime, execution),
|
|
2357
2930
|
actions: createActionsRuntime(runtime, execution),
|
|
2358
|
-
datasets: createDatasetsRuntime(runtime, dependencies.definitions.datasets),
|
|
2931
|
+
datasets: createDatasetsRuntime(runtime, execution, dependencies.definitions.datasets, dependencies.lakeStorage, dependencies.blobStorage),
|
|
2359
2932
|
workflows: createWorkflowsRuntime(runtime, execution, dependencies.definitions.workflows),
|
|
2360
2933
|
syncs: createSyncsRuntime(runtime, execution, dependencies.definitions.syncs),
|
|
2361
2934
|
pipelines: createPipelinesRuntime(runtime, execution, dependencies.definitions.pipelines),
|
|
@@ -2365,7 +2938,8 @@ function createExecutionFacades(runtime, execution, dependencies) {
|
|
|
2365
2938
|
aiUsage: createAiUsageRuntime(runtime, dependencies.definitions.security),
|
|
2366
2939
|
events: createEventsRuntime(runtime),
|
|
2367
2940
|
logs: createLogsRuntime(runtime, dependencies.logging),
|
|
2368
|
-
schedules: createSchedulesRuntime(dependencies.definitions.schedules),
|
|
2941
|
+
schedules: createSchedulesRuntime(runtime, dependencies.definitions.schedules),
|
|
2942
|
+
shares: createSharesRuntime(runtime, execution, dependencies.definitions.shares),
|
|
2369
2943
|
connector: createConnectorRuntime(runtime, execution, dependencies.connectorService),
|
|
2370
2944
|
blobs: createBlobsRuntime(runtime, execution, dependencies.blobStorage)
|
|
2371
2945
|
};
|
|
@@ -2430,10 +3004,7 @@ function restoreAgentExecutionScope(input) {
|
|
|
2430
3004
|
return Object.freeze({
|
|
2431
3005
|
execution: context,
|
|
2432
3006
|
authorization: createAgentRuntimeAuthorization({
|
|
2433
|
-
|
|
2434
|
-
executionId: input.execution.id,
|
|
2435
|
-
...input.actorId === undefined ? {} : { actorId: input.actorId },
|
|
2436
|
-
runId: input.runId,
|
|
3007
|
+
execution: context,
|
|
2437
3008
|
authority: input.authorization.type === "principal" ? {
|
|
2438
3009
|
type: "principal",
|
|
2439
3010
|
context: input.authorization.context,
|
|
@@ -2481,6 +3052,6 @@ function invalidAgentExecution(executionId, runId) {
|
|
|
2481
3052
|
throw new ExecutionStorageError("invalid_input", `[Sixb] Execution '${executionId}' does not authorize Agent run '${runId}'.`);
|
|
2482
3053
|
}
|
|
2483
3054
|
|
|
2484
|
-
export { resolveAgentContextParts, agentRunQueueJobId, subagentRunQueueJobId, workflowAgentNodeQueueJobId, dispatchQueuedAgentRuns, dispatchQueuedSubagentRuns, createAgentThreadId, createAgentRunId, createSubagentRunId, createSubagentExecutionId, createAgentMessageId, agentContextCheckpointId, createAgentRunExecutionToken, assertNoAgentDefinitions, WorkflowDefinitionError, WorkflowValidationError, assertNonEmpty, isStepDefinition, isAgentStepDefinition, isInterventionDefinition, isWorkflowDefinition, validateWorkflowDefinition, validateWorkflowsAtStartup, validateWorkflowAgentStepGroupReferences, validateWorkflowInput, validateWorkflowStepInput, validateWorkflowStepOutput, validateWorkflowInterventionInput, validateWorkflowInterventionResponse, validateWorkflowInterventionDefaultResponse, validateWorkflowAgentStepInput, validateWorkflowAgentStepOutput, snapshotWorkflowAgentStepInput, snapshotWorkflowAgentStepOutput, snapshotWorkflowInput, snapshotWorkflowStepInput, snapshotWorkflowStepOutput, snapshotWorkflowInterventionInput, snapshotWorkflowInterventionResponse, snapshotWorkflowInterventionDefaultResponse, snapshotWorkflowActionInput, WorkflowRunDispatcher, requestWorkflowRun, createBoundSixb, isBoundSixb, canInheritAgentRequestAuthorization, createAgentExecutionRecord, createInheritedAgentExecutionRecord, bindDurableAgentExecution, restoreAgentExecutionScope, assertAgentExecutionRecord, requestAgentRun, retryAgentRun };
|
|
3055
|
+
export { resolveAgentContextParts, agentRunQueueJobId, subagentRunQueueJobId, workflowAgentNodeQueueJobId, dispatchQueuedAgentRuns, dispatchQueuedSubagentRuns, createAgentThreadId, createAgentRunId, createSubagentRunId, createSubagentExecutionId, createAgentMessageId, agentContextCheckpointId, createAgentRunExecutionToken, assertNoAgentDefinitions, ShareError, WorkflowDefinitionError, WorkflowValidationError, assertNonEmpty, isStepDefinition, isAgentStepDefinition, isInterventionDefinition, isWorkflowDefinition, validateWorkflowDefinition, validateWorkflowsAtStartup, validateWorkflowAgentStepGroupReferences, validateWorkflowInput, validateWorkflowStepInput, validateWorkflowStepOutput, validateWorkflowInterventionInput, validateWorkflowInterventionResponse, validateWorkflowInterventionDefaultResponse, validateWorkflowAgentStepInput, validateWorkflowAgentStepOutput, snapshotWorkflowAgentStepInput, snapshotWorkflowAgentStepOutput, snapshotWorkflowInput, snapshotWorkflowStepInput, snapshotWorkflowStepOutput, snapshotWorkflowInterventionInput, snapshotWorkflowInterventionResponse, snapshotWorkflowInterventionDefaultResponse, snapshotWorkflowActionInput, WorkflowRunDispatcher, requestWorkflowRun, createBoundSixb, isBoundSixb, canInheritAgentRequestAuthorization, createAgentExecutionRecord, createInheritedAgentExecutionRecord, bindDurableAgentExecution, restoreAgentExecutionScope, assertAgentExecutionRecord, requestAgentRun, retryAgentRun };
|
|
2485
3056
|
|
|
2486
|
-
//# debugId=
|
|
3057
|
+
//# debugId=3C841C41C07F660564756E2164756E21
|