@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
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/storage/objects/read-scope.ts
|
|
3
|
+
var OBJECT_READ_SCOPE_LIMITS = Object.freeze({
|
|
4
|
+
maxDepth: 32,
|
|
5
|
+
maxNodes: 512,
|
|
6
|
+
maxObjectSelections: 4096,
|
|
7
|
+
maxSteps: 2048,
|
|
8
|
+
maxPropertyOccurrences: 16384,
|
|
9
|
+
maxIdentifierCharacters: 1e6
|
|
10
|
+
});
|
|
11
|
+
function compileSelectedObjectReadScope(rawScope) {
|
|
12
|
+
const scope = captureSelectedObjectReadScope(rawScope);
|
|
13
|
+
if (!isRecord(scope) || scope.kind !== "selected" || !Array.isArray(scope.roots)) {
|
|
14
|
+
throw invalidScope("scope must be a selected scope with a roots array");
|
|
15
|
+
}
|
|
16
|
+
const roots = [];
|
|
17
|
+
const objects = [];
|
|
18
|
+
const steps = [];
|
|
19
|
+
const visiting = new Set;
|
|
20
|
+
let nextNodeId = 0;
|
|
21
|
+
let concreteStepCount = 0;
|
|
22
|
+
let objectSelectionCount = 0;
|
|
23
|
+
let propertyOccurrenceCount = 0;
|
|
24
|
+
let identifierCharacterCount = 0;
|
|
25
|
+
let compiledPropertyOccurrenceCount = 0;
|
|
26
|
+
let compiledIdentifierCharacterCount = 0;
|
|
27
|
+
const addIdentifier = (value, path) => {
|
|
28
|
+
const identifier = nonEmptyString(value, path);
|
|
29
|
+
identifierCharacterCount += identifier.length;
|
|
30
|
+
if (identifierCharacterCount > OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters) {
|
|
31
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters} identifier characters`);
|
|
32
|
+
}
|
|
33
|
+
return identifier;
|
|
34
|
+
};
|
|
35
|
+
const addPropertyOccurrences = (count) => {
|
|
36
|
+
propertyOccurrenceCount += count;
|
|
37
|
+
if (propertyOccurrenceCount > OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences) {
|
|
38
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences} selected property occurrences`);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const addCompiledPropertyOccurrences = (count) => {
|
|
42
|
+
compiledPropertyOccurrenceCount += count;
|
|
43
|
+
if (compiledPropertyOccurrenceCount > OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences) {
|
|
44
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences} selected property occurrences after compilation`);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const addCompiledIdentifierCharacters = (count) => {
|
|
48
|
+
compiledIdentifierCharacterCount += count;
|
|
49
|
+
if (compiledIdentifierCharacterCount > OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters) {
|
|
50
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters} identifier characters after compilation`);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const visitNode = (node, path, depth) => {
|
|
54
|
+
if (!isRecord(node) || !Array.isArray(node.objects) || !Array.isArray(node.links)) {
|
|
55
|
+
throw invalidScope(`${path} must contain object and link selections`);
|
|
56
|
+
}
|
|
57
|
+
if (depth > OBJECT_READ_SCOPE_LIMITS.maxDepth) {
|
|
58
|
+
throw invalidScope(`${path} exceeds the maximum link depth of ${OBJECT_READ_SCOPE_LIMITS.maxDepth}`);
|
|
59
|
+
}
|
|
60
|
+
if (nextNodeId >= OBJECT_READ_SCOPE_LIMITS.maxNodes) {
|
|
61
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxNodes} selection nodes`);
|
|
62
|
+
}
|
|
63
|
+
if (visiting.has(node))
|
|
64
|
+
throw invalidScope(`${path} contains a cyclic selection node`);
|
|
65
|
+
visiting.add(node);
|
|
66
|
+
const nodeId = nextNodeId++;
|
|
67
|
+
try {
|
|
68
|
+
objectSelectionCount += node.objects.length;
|
|
69
|
+
if (objectSelectionCount > OBJECT_READ_SCOPE_LIMITS.maxObjectSelections) {
|
|
70
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxObjectSelections} object selections`);
|
|
71
|
+
}
|
|
72
|
+
for (const [objectIndex, object] of node.objects.entries()) {
|
|
73
|
+
const objectPath = `${path}.objects[${objectIndex}]`;
|
|
74
|
+
if (!isRecord(object) || !Array.isArray(object.propertyIds)) {
|
|
75
|
+
throw invalidScope(`${objectPath} must contain an object type and property ids`);
|
|
76
|
+
}
|
|
77
|
+
addIdentifier(object.objectTypeId, `${objectPath}.objectTypeId`);
|
|
78
|
+
addPropertyOccurrences(object.propertyIds.length);
|
|
79
|
+
for (const [propertyIndex, propertyId] of object.propertyIds.entries()) {
|
|
80
|
+
addIdentifier(propertyId, `${objectPath}.propertyIds[${propertyIndex}]`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const normalizedObjects = normalizeObjects(node.objects, `${path}.objects`);
|
|
84
|
+
if (normalizedObjects.length === 0) {
|
|
85
|
+
throw invalidScope(`${path}.objects must contain at least one concrete object type`);
|
|
86
|
+
}
|
|
87
|
+
for (const object of normalizedObjects) {
|
|
88
|
+
addCompiledPropertyOccurrences(object.propertyIds.length);
|
|
89
|
+
addCompiledIdentifierCharacters(object.objectTypeId.length + identifierCharacters(object.propertyIds));
|
|
90
|
+
objects.push(Object.freeze({ nodeId, ...object }));
|
|
91
|
+
}
|
|
92
|
+
for (const [linkIndex, link] of node.links.entries()) {
|
|
93
|
+
const linkPath = `${path}.links[${linkIndex}]`;
|
|
94
|
+
if (!isRecord(link) || !Array.isArray(link.definitions) || !isRecord(link.target)) {
|
|
95
|
+
throw invalidScope(`${linkPath} must contain definitions and a target node`);
|
|
96
|
+
}
|
|
97
|
+
if (link.definitions.length === 0) {
|
|
98
|
+
throw invalidScope(`${linkPath}.definitions must not be empty`);
|
|
99
|
+
}
|
|
100
|
+
const definitions = normalizeConcreteDefinitions(link.definitions, `${linkPath}.definitions`, addIdentifier, addPropertyOccurrences, addCompiledPropertyOccurrences, addCompiledIdentifierCharacters, () => {
|
|
101
|
+
concreteStepCount += 1;
|
|
102
|
+
if (concreteStepCount > OBJECT_READ_SCOPE_LIMITS.maxSteps) {
|
|
103
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxSteps} concrete link steps`);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const parentTypes = new Set(normalizedObjects.map((object) => object.objectTypeId));
|
|
107
|
+
for (const definition of definitions) {
|
|
108
|
+
if (!parentTypes.has(definition.sourceObjectTypeId)) {
|
|
109
|
+
throw invalidScope(`${linkPath} selects source type '${definition.sourceObjectTypeId}' outside its parent node`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const childNodeId = visitNode(link.target, `${linkPath}.target`, depth + 1);
|
|
113
|
+
const childTypes = new Set(objects.filter((object) => object.nodeId === childNodeId).map((object) => object.objectTypeId));
|
|
114
|
+
const targetTypes = new Set(definitions.map((definition) => definition.targetObjectTypeId));
|
|
115
|
+
if (!setsEqual(childTypes, targetTypes)) {
|
|
116
|
+
throw invalidScope(`${linkPath}.target object types must exactly match its definition target types`);
|
|
117
|
+
}
|
|
118
|
+
for (const definition of definitions) {
|
|
119
|
+
steps.push(Object.freeze({
|
|
120
|
+
nodeId: childNodeId,
|
|
121
|
+
parentNodeId: nodeId,
|
|
122
|
+
...definition
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} finally {
|
|
127
|
+
visiting.delete(node);
|
|
128
|
+
}
|
|
129
|
+
return nodeId;
|
|
130
|
+
};
|
|
131
|
+
for (const [rootIndex, root] of scope.roots.entries()) {
|
|
132
|
+
const path = `roots[${rootIndex}]`;
|
|
133
|
+
if (!isRecord(root) || !isRecord(root.anchor) || !isRecord(root.node)) {
|
|
134
|
+
throw invalidScope(`${path} must contain an exact anchor and a selection node`);
|
|
135
|
+
}
|
|
136
|
+
const objectTypeId = addIdentifier(root.anchor.objectTypeId, `${path}.anchor.objectTypeId`);
|
|
137
|
+
const primaryId = addIdentifier(root.anchor.primaryId, `${path}.anchor.primaryId`);
|
|
138
|
+
addCompiledIdentifierCharacters(objectTypeId.length + primaryId.length);
|
|
139
|
+
const nodeId = visitNode(root.node, `${path}.node`, 0);
|
|
140
|
+
if (!objects.some((object) => object.nodeId === nodeId && object.objectTypeId === objectTypeId)) {
|
|
141
|
+
throw invalidScope(`${path}.anchor type '${objectTypeId}' is not selected by its root node`);
|
|
142
|
+
}
|
|
143
|
+
roots.push(Object.freeze({ nodeId, objectTypeId, primaryId }));
|
|
144
|
+
}
|
|
145
|
+
return Object.freeze({
|
|
146
|
+
kind: "selected",
|
|
147
|
+
roots: Object.freeze(roots),
|
|
148
|
+
objects: Object.freeze(objects),
|
|
149
|
+
steps: Object.freeze(steps)
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function captureSelectedObjectReadScope(value) {
|
|
153
|
+
if (!isRecord(value)) {
|
|
154
|
+
throw invalidScope("scope must be a selected scope with a roots array");
|
|
155
|
+
}
|
|
156
|
+
const kind = value.kind;
|
|
157
|
+
if (kind !== "selected") {
|
|
158
|
+
throw invalidScope("scope must be a selected scope with a roots array");
|
|
159
|
+
}
|
|
160
|
+
const rootsValue = value.roots;
|
|
161
|
+
const rootsSource = captureArray(rootsValue, "roots");
|
|
162
|
+
if (rootsSource.length > OBJECT_READ_SCOPE_LIMITS.maxNodes) {
|
|
163
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxNodes} selection nodes`);
|
|
164
|
+
}
|
|
165
|
+
const state = {
|
|
166
|
+
visiting: new Set,
|
|
167
|
+
nodeCount: 0,
|
|
168
|
+
objectSelectionCount: 0,
|
|
169
|
+
concreteStepCount: 0,
|
|
170
|
+
propertyOccurrenceCount: 0,
|
|
171
|
+
identifierCharacterCount: 0
|
|
172
|
+
};
|
|
173
|
+
const roots = [];
|
|
174
|
+
for (let rootIndex = 0;rootIndex < rootsSource.length; rootIndex += 1) {
|
|
175
|
+
const path = `roots[${rootIndex}]`;
|
|
176
|
+
const rootValue = rootsSource.value[rootIndex];
|
|
177
|
+
if (!isRecord(rootValue)) {
|
|
178
|
+
throw invalidScope(`${path} must contain an exact anchor and a selection node`);
|
|
179
|
+
}
|
|
180
|
+
const anchorValue = rootValue.anchor;
|
|
181
|
+
if (!isRecord(anchorValue)) {
|
|
182
|
+
throw invalidScope(`${path} must contain an exact anchor and a selection node`);
|
|
183
|
+
}
|
|
184
|
+
const objectTypeId = captureIdentifier(state, anchorValue.objectTypeId, `${path}.anchor.objectTypeId`);
|
|
185
|
+
const primaryId = captureIdentifier(state, anchorValue.primaryId, `${path}.anchor.primaryId`);
|
|
186
|
+
const anchor = Object.freeze({ objectTypeId, primaryId });
|
|
187
|
+
const nodeValue = rootValue.node;
|
|
188
|
+
if (!isRecord(nodeValue)) {
|
|
189
|
+
throw invalidScope(`${path} must contain an exact anchor and a selection node`);
|
|
190
|
+
}
|
|
191
|
+
const node = captureNode(state, nodeValue, `${path}.node`, 0);
|
|
192
|
+
roots.push(Object.freeze({ anchor, node }));
|
|
193
|
+
}
|
|
194
|
+
return Object.freeze({ kind, roots: Object.freeze(roots) });
|
|
195
|
+
}
|
|
196
|
+
function captureNode(state, value, path, depth) {
|
|
197
|
+
if (depth > OBJECT_READ_SCOPE_LIMITS.maxDepth) {
|
|
198
|
+
throw invalidScope(`${path} exceeds the maximum link depth of ${OBJECT_READ_SCOPE_LIMITS.maxDepth}`);
|
|
199
|
+
}
|
|
200
|
+
if (state.nodeCount >= OBJECT_READ_SCOPE_LIMITS.maxNodes) {
|
|
201
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxNodes} selection nodes`);
|
|
202
|
+
}
|
|
203
|
+
if (state.visiting.has(value)) {
|
|
204
|
+
throw invalidScope(`${path} contains a cyclic selection node`);
|
|
205
|
+
}
|
|
206
|
+
state.visiting.add(value);
|
|
207
|
+
state.nodeCount += 1;
|
|
208
|
+
try {
|
|
209
|
+
const objectsValue = value.objects;
|
|
210
|
+
const objectsSource = captureArray(objectsValue, `${path}.objects`);
|
|
211
|
+
state.objectSelectionCount = reserveCount(state.objectSelectionCount, objectsSource.length, OBJECT_READ_SCOPE_LIMITS.maxObjectSelections, `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxObjectSelections} object selections`);
|
|
212
|
+
const objects = [];
|
|
213
|
+
for (let objectIndex = 0;objectIndex < objectsSource.length; objectIndex += 1) {
|
|
214
|
+
const objectPath = `${path}.objects[${objectIndex}]`;
|
|
215
|
+
const objectValue = objectsSource.value[objectIndex];
|
|
216
|
+
if (!isRecord(objectValue)) {
|
|
217
|
+
throw invalidScope(`${objectPath} must contain an object type and property ids`);
|
|
218
|
+
}
|
|
219
|
+
const objectTypeId = captureIdentifier(state, objectValue.objectTypeId, `${objectPath}.objectTypeId`);
|
|
220
|
+
const propertyIdsValue = objectValue.propertyIds;
|
|
221
|
+
const propertyIds = capturePropertyIds(state, propertyIdsValue, `${objectPath}.propertyIds`);
|
|
222
|
+
objects.push(Object.freeze({ objectTypeId, propertyIds }));
|
|
223
|
+
}
|
|
224
|
+
const linksValue = value.links;
|
|
225
|
+
const linksSource = captureArray(linksValue, `${path}.links`);
|
|
226
|
+
if (linksSource.length > OBJECT_READ_SCOPE_LIMITS.maxNodes - state.nodeCount) {
|
|
227
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxNodes} selection nodes`);
|
|
228
|
+
}
|
|
229
|
+
const links = [];
|
|
230
|
+
for (let linkIndex = 0;linkIndex < linksSource.length; linkIndex += 1) {
|
|
231
|
+
const linkPath = `${path}.links[${linkIndex}]`;
|
|
232
|
+
const linkValue = linksSource.value[linkIndex];
|
|
233
|
+
if (!isRecord(linkValue)) {
|
|
234
|
+
throw invalidScope(`${linkPath} must contain definitions and a target node`);
|
|
235
|
+
}
|
|
236
|
+
const definitionsValue = linkValue.definitions;
|
|
237
|
+
const definitionsSource = captureArray(definitionsValue, `${linkPath}.definitions`);
|
|
238
|
+
if (definitionsSource.length === 0) {
|
|
239
|
+
throw invalidScope(`${linkPath}.definitions must not be empty`);
|
|
240
|
+
}
|
|
241
|
+
if (definitionsSource.length > OBJECT_READ_SCOPE_LIMITS.maxSteps - state.concreteStepCount) {
|
|
242
|
+
throw invalidScope(`scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxSteps} concrete link steps`);
|
|
243
|
+
}
|
|
244
|
+
const definitions = [];
|
|
245
|
+
for (let definitionIndex = 0;definitionIndex < definitionsSource.length; definitionIndex += 1) {
|
|
246
|
+
const definitionPath = `${linkPath}.definitions[${definitionIndex}]`;
|
|
247
|
+
const definitionValue = definitionsSource.value[definitionIndex];
|
|
248
|
+
definitions.push(captureDefinition(state, definitionValue, definitionPath));
|
|
249
|
+
}
|
|
250
|
+
const targetValue = linkValue.target;
|
|
251
|
+
if (!isRecord(targetValue)) {
|
|
252
|
+
throw invalidScope(`${linkPath} must contain definitions and a target node`);
|
|
253
|
+
}
|
|
254
|
+
const target = captureNode(state, targetValue, `${linkPath}.target`, depth + 1);
|
|
255
|
+
links.push(Object.freeze({ definitions: Object.freeze(definitions), target }));
|
|
256
|
+
}
|
|
257
|
+
return Object.freeze({ objects: Object.freeze(objects), links: Object.freeze(links) });
|
|
258
|
+
} finally {
|
|
259
|
+
state.visiting.delete(value);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function captureDefinition(state, value, path) {
|
|
263
|
+
if (!isRecord(value)) {
|
|
264
|
+
throw invalidScope(`${path} must contain a concrete link definition`);
|
|
265
|
+
}
|
|
266
|
+
const sourceObjectTypeId = captureIdentifier(state, value.sourceObjectTypeId, `${path}.sourceObjectTypeId`);
|
|
267
|
+
const linkId = captureIdentifier(state, value.linkId, `${path}.linkId`);
|
|
268
|
+
const targetObjectTypeIdsValue = value.targetObjectTypeIds;
|
|
269
|
+
const targetObjectTypeIdsSource = captureArray(targetObjectTypeIdsValue, `${path}.targetObjectTypeIds`);
|
|
270
|
+
if (targetObjectTypeIdsSource.length === 0) {
|
|
271
|
+
throw invalidScope(`${path}.targetObjectTypeIds must not be empty`);
|
|
272
|
+
}
|
|
273
|
+
state.concreteStepCount = reserveCount(state.concreteStepCount, targetObjectTypeIdsSource.length, OBJECT_READ_SCOPE_LIMITS.maxSteps, `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxSteps} concrete link steps`);
|
|
274
|
+
const targetObjectTypeIds = captureIdentifiers(state, targetObjectTypeIdsSource, `${path}.targetObjectTypeIds`);
|
|
275
|
+
const propertyIdsValue = value.propertyIds;
|
|
276
|
+
const propertyIds = capturePropertyIds(state, propertyIdsValue, `${path}.propertyIds`);
|
|
277
|
+
return Object.freeze({ sourceObjectTypeId, linkId, targetObjectTypeIds, propertyIds });
|
|
278
|
+
}
|
|
279
|
+
function capturePropertyIds(state, value, path) {
|
|
280
|
+
const source = captureArray(value, path);
|
|
281
|
+
state.propertyOccurrenceCount = reserveCount(state.propertyOccurrenceCount, source.length, OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences, `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences} selected property occurrences`);
|
|
282
|
+
return captureIdentifiers(state, source, path);
|
|
283
|
+
}
|
|
284
|
+
function captureIdentifiers(state, source, path) {
|
|
285
|
+
const identifiers = [];
|
|
286
|
+
for (let index = 0;index < source.length; index += 1) {
|
|
287
|
+
identifiers.push(captureIdentifier(state, source.value[index], `${path}[${index}]`));
|
|
288
|
+
}
|
|
289
|
+
return Object.freeze(identifiers);
|
|
290
|
+
}
|
|
291
|
+
function captureIdentifier(state, value, path) {
|
|
292
|
+
const identifier = nonEmptyString(value, path);
|
|
293
|
+
state.identifierCharacterCount = reserveCount(state.identifierCharacterCount, identifier.length, OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters, `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters} identifier characters`);
|
|
294
|
+
return identifier;
|
|
295
|
+
}
|
|
296
|
+
function captureArray(value, path) {
|
|
297
|
+
if (!Array.isArray(value)) {
|
|
298
|
+
throw invalidScope(`${path} must be an array`);
|
|
299
|
+
}
|
|
300
|
+
const array = value;
|
|
301
|
+
const length = array.length;
|
|
302
|
+
if (!Number.isSafeInteger(length) || length < 0) {
|
|
303
|
+
throw invalidScope(`${path}.length must be a non-negative safe integer`);
|
|
304
|
+
}
|
|
305
|
+
return { value: array, length };
|
|
306
|
+
}
|
|
307
|
+
function reserveCount(current, count, limit, message) {
|
|
308
|
+
if (count > limit - current)
|
|
309
|
+
throw invalidScope(message);
|
|
310
|
+
return current + count;
|
|
311
|
+
}
|
|
312
|
+
function assertObjectReaderProject(expectedProjectId, actualProjectId) {
|
|
313
|
+
if (actualProjectId !== expectedProjectId) {
|
|
314
|
+
throw new Error(`[Sixb] Object reader belongs to project '${expectedProjectId}', not '${actualProjectId}'.`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function normalizeConcreteDefinitions(definitions, path, addIdentifier, addPropertyOccurrences, addCompiledPropertyOccurrences, addCompiledIdentifierCharacters, addConcreteStep) {
|
|
318
|
+
const propertiesByDefinition = new Map;
|
|
319
|
+
for (const [index, definition] of definitions.entries()) {
|
|
320
|
+
const definitionPath = `${path}[${index}]`;
|
|
321
|
+
if (!isRecord(definition) || !Array.isArray(definition.targetObjectTypeIds) || !Array.isArray(definition.propertyIds)) {
|
|
322
|
+
throw invalidScope(`${definitionPath} must contain a concrete link definition`);
|
|
323
|
+
}
|
|
324
|
+
const sourceObjectTypeId = addIdentifier(definition.sourceObjectTypeId, `${definitionPath}.sourceObjectTypeId`);
|
|
325
|
+
const linkId = addIdentifier(definition.linkId, `${definitionPath}.linkId`);
|
|
326
|
+
if (definition.targetObjectTypeIds.length === 0) {
|
|
327
|
+
throw invalidScope(`${definitionPath}.targetObjectTypeIds must not be empty`);
|
|
328
|
+
}
|
|
329
|
+
addPropertyOccurrences(definition.propertyIds.length);
|
|
330
|
+
let propertyIdentifierCharacters = 0;
|
|
331
|
+
for (const [propertyIndex, propertyId] of definition.propertyIds.entries()) {
|
|
332
|
+
propertyIdentifierCharacters += addIdentifier(propertyId, `${definitionPath}.propertyIds[${propertyIndex}]`).length;
|
|
333
|
+
}
|
|
334
|
+
let targetIdentifierCharacters = 0;
|
|
335
|
+
for (const [targetIndex, value] of definition.targetObjectTypeIds.entries()) {
|
|
336
|
+
addConcreteStep();
|
|
337
|
+
targetIdentifierCharacters += addIdentifier(value, `${definitionPath}.targetObjectTypeIds[${targetIndex}]`).length;
|
|
338
|
+
}
|
|
339
|
+
addCompiledPropertyOccurrences(definition.propertyIds.length * definition.targetObjectTypeIds.length);
|
|
340
|
+
const repeatedIdentifierCharacters = sourceObjectTypeId.length + linkId.length + propertyIdentifierCharacters;
|
|
341
|
+
addCompiledIdentifierCharacters(repeatedIdentifierCharacters * definition.targetObjectTypeIds.length + targetIdentifierCharacters);
|
|
342
|
+
for (const [targetIndex, value] of definition.targetObjectTypeIds.entries()) {
|
|
343
|
+
const targetObjectTypeId = nonEmptyString(value, `${definitionPath}.targetObjectTypeIds[${targetIndex}]`);
|
|
344
|
+
const key = JSON.stringify([sourceObjectTypeId, linkId, targetObjectTypeId]);
|
|
345
|
+
const normalized = propertiesByDefinition.get(key) ?? {
|
|
346
|
+
sourceObjectTypeId,
|
|
347
|
+
linkId,
|
|
348
|
+
targetObjectTypeId,
|
|
349
|
+
properties: new Set
|
|
350
|
+
};
|
|
351
|
+
for (const [propertyIndex, propertyId] of definition.propertyIds.entries()) {
|
|
352
|
+
normalized.properties.add(nonEmptyString(propertyId, `${definitionPath}.propertyIds[${propertyIndex}]`));
|
|
353
|
+
}
|
|
354
|
+
propertiesByDefinition.set(key, normalized);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return [...propertiesByDefinition.values()].sort((left, right) => left.sourceObjectTypeId.localeCompare(right.sourceObjectTypeId) || left.linkId.localeCompare(right.linkId) || left.targetObjectTypeId.localeCompare(right.targetObjectTypeId)).map(({ properties, ...definition }) => Object.freeze({
|
|
358
|
+
...definition,
|
|
359
|
+
propertyIds: Object.freeze([...properties].sort())
|
|
360
|
+
}));
|
|
361
|
+
}
|
|
362
|
+
function identifierCharacters(values) {
|
|
363
|
+
return values.reduce((total, value) => total + value.length, 0);
|
|
364
|
+
}
|
|
365
|
+
function normalizeObjects(selections, path) {
|
|
366
|
+
const propertiesByType = new Map;
|
|
367
|
+
for (const [index, selection] of selections.entries()) {
|
|
368
|
+
if (!isRecord(selection) || !Array.isArray(selection.propertyIds)) {
|
|
369
|
+
throw invalidScope(`${path}[${index}] must contain an object type and property ids`);
|
|
370
|
+
}
|
|
371
|
+
const objectTypeId = nonEmptyString(selection.objectTypeId, `${path}[${index}].objectTypeId`);
|
|
372
|
+
const properties = propertiesByType.get(objectTypeId) ?? new Set;
|
|
373
|
+
for (const propertyId of normalizeIds(selection.propertyIds, `${path}[${index}].propertyIds`)) {
|
|
374
|
+
properties.add(propertyId);
|
|
375
|
+
}
|
|
376
|
+
propertiesByType.set(objectTypeId, properties);
|
|
377
|
+
}
|
|
378
|
+
return [...propertiesByType].sort(([left], [right]) => left.localeCompare(right)).map(([objectTypeId, properties]) => Object.freeze({ objectTypeId, propertyIds: Object.freeze([...properties].sort()) }));
|
|
379
|
+
}
|
|
380
|
+
function normalizeIds(values, path) {
|
|
381
|
+
return [
|
|
382
|
+
...new Set(values.map((value, index) => nonEmptyString(value, `${path}[${index}]`)))
|
|
383
|
+
].sort();
|
|
384
|
+
}
|
|
385
|
+
function nonEmptyString(value, path) {
|
|
386
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
387
|
+
throw invalidScope(`${path} must be a non-empty string`);
|
|
388
|
+
}
|
|
389
|
+
return value;
|
|
390
|
+
}
|
|
391
|
+
function setsEqual(left, right) {
|
|
392
|
+
return left.size === right.size && [...left].every((value) => right.has(value));
|
|
393
|
+
}
|
|
394
|
+
function isRecord(value) {
|
|
395
|
+
return typeof value === "object" && value !== null;
|
|
396
|
+
}
|
|
397
|
+
function invalidScope(message) {
|
|
398
|
+
return new Error(`[Sixb] Invalid object read scope: ${message}.`);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export { compileSelectedObjectReadScope, captureSelectedObjectReadScope, assertObjectReaderProject };
|
|
402
|
+
|
|
403
|
+
//# debugId=F3C89DAB3F2B853064756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/storage/objects/read-scope.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type {\n CompiledObjectReadObjectSelection,\n CompiledObjectReadRoot,\n CompiledObjectReadStep,\n CompiledSelectedObjectReadScope,\n ObjectReadLinkDefinitionSelection,\n ObjectReadLinkSelection,\n ObjectReadNode,\n ObjectReadObjectSelection,\n ObjectReadRoot,\n SelectedObjectReadScope,\n} from \"./types\"\n\n/** Admission bounds applied before a raw selection is normalized or allocated by a provider. */\nexport const OBJECT_READ_SCOPE_LIMITS = Object.freeze({\n maxDepth: 32,\n maxNodes: 512,\n maxObjectSelections: 4_096,\n maxSteps: 2_048,\n maxPropertyOccurrences: 16_384,\n maxIdentifierCharacters: 1_000_000,\n})\n\n/**\n * Validate, detach, normalize, and flatten a finite selection exactly once.\n *\n * Every path occurrence receives its own node id. Reusing only `(sourceType, linkId)` would lose\n * provenance and let an object reached through one branch borrow nested authority from another.\n */\nexport function compileSelectedObjectReadScope(\n rawScope: SelectedObjectReadScope\n): CompiledSelectedObjectReadScope {\n const scope = captureSelectedObjectReadScope(rawScope)\n if (!isRecord(scope) || scope.kind !== \"selected\" || !Array.isArray(scope.roots)) {\n throw invalidScope(\"scope must be a selected scope with a roots array\")\n }\n\n const roots: CompiledObjectReadRoot[] = []\n const objects: CompiledObjectReadObjectSelection[] = []\n const steps: CompiledObjectReadStep[] = []\n const visiting = new Set<object>()\n let nextNodeId = 0\n let concreteStepCount = 0\n let objectSelectionCount = 0\n let propertyOccurrenceCount = 0\n let identifierCharacterCount = 0\n let compiledPropertyOccurrenceCount = 0\n let compiledIdentifierCharacterCount = 0\n\n const addIdentifier = (value: unknown, path: string): string => {\n const identifier = nonEmptyString(value, path)\n identifierCharacterCount += identifier.length\n if (identifierCharacterCount > OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters} identifier characters`\n )\n }\n return identifier\n }\n\n const addPropertyOccurrences = (count: number): void => {\n propertyOccurrenceCount += count\n if (propertyOccurrenceCount > OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences} selected property occurrences`\n )\n }\n }\n\n const addCompiledPropertyOccurrences = (count: number): void => {\n compiledPropertyOccurrenceCount += count\n if (compiledPropertyOccurrenceCount > OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences} selected property occurrences after compilation`\n )\n }\n }\n\n const addCompiledIdentifierCharacters = (count: number): void => {\n compiledIdentifierCharacterCount += count\n if (compiledIdentifierCharacterCount > OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters} identifier characters after compilation`\n )\n }\n }\n\n const visitNode = (node: ObjectReadNode, path: string, depth: number): number => {\n if (!isRecord(node) || !Array.isArray(node.objects) || !Array.isArray(node.links)) {\n throw invalidScope(`${path} must contain object and link selections`)\n }\n if (depth > OBJECT_READ_SCOPE_LIMITS.maxDepth) {\n throw invalidScope(\n `${path} exceeds the maximum link depth of ${OBJECT_READ_SCOPE_LIMITS.maxDepth}`\n )\n }\n if (nextNodeId >= OBJECT_READ_SCOPE_LIMITS.maxNodes) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxNodes} selection nodes`\n )\n }\n if (visiting.has(node)) throw invalidScope(`${path} contains a cyclic selection node`)\n visiting.add(node)\n\n const nodeId = nextNodeId++\n try {\n objectSelectionCount += node.objects.length\n if (objectSelectionCount > OBJECT_READ_SCOPE_LIMITS.maxObjectSelections) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxObjectSelections} object selections`\n )\n }\n\n for (const [objectIndex, object] of node.objects.entries()) {\n const objectPath = `${path}.objects[${objectIndex}]`\n if (!isRecord(object) || !Array.isArray(object.propertyIds)) {\n throw invalidScope(`${objectPath} must contain an object type and property ids`)\n }\n addIdentifier(object.objectTypeId, `${objectPath}.objectTypeId`)\n addPropertyOccurrences(object.propertyIds.length)\n for (const [propertyIndex, propertyId] of object.propertyIds.entries()) {\n addIdentifier(propertyId, `${objectPath}.propertyIds[${propertyIndex}]`)\n }\n }\n\n const normalizedObjects = normalizeObjects(node.objects, `${path}.objects`)\n if (normalizedObjects.length === 0) {\n throw invalidScope(`${path}.objects must contain at least one concrete object type`)\n }\n for (const object of normalizedObjects) {\n addCompiledPropertyOccurrences(object.propertyIds.length)\n addCompiledIdentifierCharacters(\n object.objectTypeId.length + identifierCharacters(object.propertyIds)\n )\n objects.push(Object.freeze({ nodeId, ...object }))\n }\n\n for (const [linkIndex, link] of node.links.entries()) {\n const linkPath = `${path}.links[${linkIndex}]`\n if (!isRecord(link) || !Array.isArray(link.definitions) || !isRecord(link.target)) {\n throw invalidScope(`${linkPath} must contain definitions and a target node`)\n }\n if (link.definitions.length === 0) {\n throw invalidScope(`${linkPath}.definitions must not be empty`)\n }\n\n const definitions = normalizeConcreteDefinitions(\n link.definitions,\n `${linkPath}.definitions`,\n addIdentifier,\n addPropertyOccurrences,\n addCompiledPropertyOccurrences,\n addCompiledIdentifierCharacters,\n () => {\n concreteStepCount += 1\n if (concreteStepCount > OBJECT_READ_SCOPE_LIMITS.maxSteps) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxSteps} concrete link steps`\n )\n }\n }\n )\n const parentTypes = new Set(normalizedObjects.map((object) => object.objectTypeId))\n for (const definition of definitions) {\n if (!parentTypes.has(definition.sourceObjectTypeId)) {\n throw invalidScope(\n `${linkPath} selects source type '${definition.sourceObjectTypeId}' outside its parent node`\n )\n }\n }\n\n const childNodeId = visitNode(\n link.target as unknown as ObjectReadNode,\n `${linkPath}.target`,\n depth + 1\n )\n const childTypes = new Set(\n objects\n .filter((object) => object.nodeId === childNodeId)\n .map((object) => object.objectTypeId)\n )\n const targetTypes = new Set(definitions.map((definition) => definition.targetObjectTypeId))\n if (!setsEqual(childTypes, targetTypes)) {\n throw invalidScope(\n `${linkPath}.target object types must exactly match its definition target types`\n )\n }\n\n for (const definition of definitions) {\n steps.push(\n Object.freeze({\n nodeId: childNodeId,\n parentNodeId: nodeId,\n ...definition,\n })\n )\n }\n }\n } finally {\n visiting.delete(node)\n }\n\n return nodeId\n }\n\n for (const [rootIndex, root] of scope.roots.entries()) {\n const path = `roots[${rootIndex}]`\n if (!isRecord(root) || !isRecord(root.anchor) || !isRecord(root.node)) {\n throw invalidScope(`${path} must contain an exact anchor and a selection node`)\n }\n const objectTypeId = addIdentifier(root.anchor.objectTypeId, `${path}.anchor.objectTypeId`)\n const primaryId = addIdentifier(root.anchor.primaryId, `${path}.anchor.primaryId`)\n addCompiledIdentifierCharacters(objectTypeId.length + primaryId.length)\n const nodeId = visitNode(root.node as unknown as ObjectReadNode, `${path}.node`, 0)\n if (\n !objects.some((object) => object.nodeId === nodeId && object.objectTypeId === objectTypeId)\n ) {\n throw invalidScope(`${path}.anchor type '${objectTypeId}' is not selected by its root node`)\n }\n roots.push(Object.freeze({ nodeId, objectTypeId, primaryId }))\n }\n\n return Object.freeze({\n kind: \"selected\",\n roots: Object.freeze(roots),\n objects: Object.freeze(objects),\n steps: Object.freeze(steps),\n })\n}\n\ninterface ScopeCaptureState {\n readonly visiting: Set<object>\n nodeCount: number\n objectSelectionCount: number\n concreteStepCount: number\n propertyOccurrenceCount: number\n identifierCharacterCount: number\n}\n\ninterface CapturedArray {\n readonly value: readonly unknown[]\n readonly length: number\n}\n\n/**\n * Read every caller-controlled property once and detach it before another getter can mutate it.\n * The compiler only ever observes the resulting plain, deeply frozen snapshot.\n */\nexport function captureSelectedObjectReadScope(value: unknown): SelectedObjectReadScope {\n if (!isRecord(value)) {\n throw invalidScope(\"scope must be a selected scope with a roots array\")\n }\n\n const kind = value.kind\n if (kind !== \"selected\") {\n throw invalidScope(\"scope must be a selected scope with a roots array\")\n }\n\n const rootsValue = value.roots\n const rootsSource = captureArray(rootsValue, \"roots\")\n if (rootsSource.length > OBJECT_READ_SCOPE_LIMITS.maxNodes) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxNodes} selection nodes`\n )\n }\n\n const state: ScopeCaptureState = {\n visiting: new Set<object>(),\n nodeCount: 0,\n objectSelectionCount: 0,\n concreteStepCount: 0,\n propertyOccurrenceCount: 0,\n identifierCharacterCount: 0,\n }\n const roots: ObjectReadRoot[] = []\n for (let rootIndex = 0; rootIndex < rootsSource.length; rootIndex += 1) {\n const path = `roots[${rootIndex}]`\n const rootValue = rootsSource.value[rootIndex]\n if (!isRecord(rootValue)) {\n throw invalidScope(`${path} must contain an exact anchor and a selection node`)\n }\n\n const anchorValue = rootValue.anchor\n if (!isRecord(anchorValue)) {\n throw invalidScope(`${path} must contain an exact anchor and a selection node`)\n }\n const objectTypeId = captureIdentifier(\n state,\n anchorValue.objectTypeId,\n `${path}.anchor.objectTypeId`\n )\n const primaryId = captureIdentifier(state, anchorValue.primaryId, `${path}.anchor.primaryId`)\n const anchor = Object.freeze({ objectTypeId, primaryId })\n\n const nodeValue = rootValue.node\n if (!isRecord(nodeValue)) {\n throw invalidScope(`${path} must contain an exact anchor and a selection node`)\n }\n const node = captureNode(state, nodeValue, `${path}.node`, 0)\n roots.push(Object.freeze({ anchor, node }))\n }\n\n return Object.freeze({ kind, roots: Object.freeze(roots) })\n}\n\nfunction captureNode(\n state: ScopeCaptureState,\n value: Record<string, unknown>,\n path: string,\n depth: number\n): ObjectReadNode {\n if (depth > OBJECT_READ_SCOPE_LIMITS.maxDepth) {\n throw invalidScope(\n `${path} exceeds the maximum link depth of ${OBJECT_READ_SCOPE_LIMITS.maxDepth}`\n )\n }\n if (state.nodeCount >= OBJECT_READ_SCOPE_LIMITS.maxNodes) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxNodes} selection nodes`\n )\n }\n if (state.visiting.has(value)) {\n throw invalidScope(`${path} contains a cyclic selection node`)\n }\n state.visiting.add(value)\n state.nodeCount += 1\n\n try {\n const objectsValue = value.objects\n const objectsSource = captureArray(objectsValue, `${path}.objects`)\n state.objectSelectionCount = reserveCount(\n state.objectSelectionCount,\n objectsSource.length,\n OBJECT_READ_SCOPE_LIMITS.maxObjectSelections,\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxObjectSelections} object selections`\n )\n const objects: ObjectReadObjectSelection[] = []\n for (let objectIndex = 0; objectIndex < objectsSource.length; objectIndex += 1) {\n const objectPath = `${path}.objects[${objectIndex}]`\n const objectValue = objectsSource.value[objectIndex]\n if (!isRecord(objectValue)) {\n throw invalidScope(`${objectPath} must contain an object type and property ids`)\n }\n\n const objectTypeId = captureIdentifier(\n state,\n objectValue.objectTypeId,\n `${objectPath}.objectTypeId`\n )\n const propertyIdsValue = objectValue.propertyIds\n const propertyIds = capturePropertyIds(state, propertyIdsValue, `${objectPath}.propertyIds`)\n objects.push(Object.freeze({ objectTypeId, propertyIds }))\n }\n\n const linksValue = value.links\n const linksSource = captureArray(linksValue, `${path}.links`)\n if (linksSource.length > OBJECT_READ_SCOPE_LIMITS.maxNodes - state.nodeCount) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxNodes} selection nodes`\n )\n }\n const links: ObjectReadLinkSelection[] = []\n for (let linkIndex = 0; linkIndex < linksSource.length; linkIndex += 1) {\n const linkPath = `${path}.links[${linkIndex}]`\n const linkValue = linksSource.value[linkIndex]\n if (!isRecord(linkValue)) {\n throw invalidScope(`${linkPath} must contain definitions and a target node`)\n }\n\n const definitionsValue = linkValue.definitions\n const definitionsSource = captureArray(definitionsValue, `${linkPath}.definitions`)\n if (definitionsSource.length === 0) {\n throw invalidScope(`${linkPath}.definitions must not be empty`)\n }\n if (definitionsSource.length > OBJECT_READ_SCOPE_LIMITS.maxSteps - state.concreteStepCount) {\n throw invalidScope(\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxSteps} concrete link steps`\n )\n }\n const definitions: ObjectReadLinkDefinitionSelection[] = []\n for (\n let definitionIndex = 0;\n definitionIndex < definitionsSource.length;\n definitionIndex += 1\n ) {\n const definitionPath = `${linkPath}.definitions[${definitionIndex}]`\n const definitionValue = definitionsSource.value[definitionIndex]\n definitions.push(captureDefinition(state, definitionValue, definitionPath))\n }\n\n const targetValue = linkValue.target\n if (!isRecord(targetValue)) {\n throw invalidScope(`${linkPath} must contain definitions and a target node`)\n }\n const target = captureNode(state, targetValue, `${linkPath}.target`, depth + 1)\n links.push(Object.freeze({ definitions: Object.freeze(definitions), target }))\n }\n\n return Object.freeze({ objects: Object.freeze(objects), links: Object.freeze(links) })\n } finally {\n state.visiting.delete(value)\n }\n}\n\nfunction captureDefinition(\n state: ScopeCaptureState,\n value: unknown,\n path: string\n): ObjectReadLinkDefinitionSelection {\n if (!isRecord(value)) {\n throw invalidScope(`${path} must contain a concrete link definition`)\n }\n\n const sourceObjectTypeId = captureIdentifier(\n state,\n value.sourceObjectTypeId,\n `${path}.sourceObjectTypeId`\n )\n const linkId = captureIdentifier(state, value.linkId, `${path}.linkId`)\n\n const targetObjectTypeIdsValue = value.targetObjectTypeIds\n const targetObjectTypeIdsSource = captureArray(\n targetObjectTypeIdsValue,\n `${path}.targetObjectTypeIds`\n )\n if (targetObjectTypeIdsSource.length === 0) {\n throw invalidScope(`${path}.targetObjectTypeIds must not be empty`)\n }\n state.concreteStepCount = reserveCount(\n state.concreteStepCount,\n targetObjectTypeIdsSource.length,\n OBJECT_READ_SCOPE_LIMITS.maxSteps,\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxSteps} concrete link steps`\n )\n const targetObjectTypeIds = captureIdentifiers(\n state,\n targetObjectTypeIdsSource,\n `${path}.targetObjectTypeIds`\n )\n\n const propertyIdsValue = value.propertyIds\n const propertyIds = capturePropertyIds(state, propertyIdsValue, `${path}.propertyIds`)\n return Object.freeze({ sourceObjectTypeId, linkId, targetObjectTypeIds, propertyIds })\n}\n\nfunction capturePropertyIds(\n state: ScopeCaptureState,\n value: unknown,\n path: string\n): readonly string[] {\n const source = captureArray(value, path)\n state.propertyOccurrenceCount = reserveCount(\n state.propertyOccurrenceCount,\n source.length,\n OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences,\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxPropertyOccurrences} selected property occurrences`\n )\n return captureIdentifiers(state, source, path)\n}\n\nfunction captureIdentifiers(\n state: ScopeCaptureState,\n source: CapturedArray,\n path: string\n): readonly string[] {\n const identifiers: string[] = []\n for (let index = 0; index < source.length; index += 1) {\n identifiers.push(captureIdentifier(state, source.value[index], `${path}[${index}]`))\n }\n return Object.freeze(identifiers)\n}\n\nfunction captureIdentifier(state: ScopeCaptureState, value: unknown, path: string): string {\n const identifier = nonEmptyString(value, path)\n state.identifierCharacterCount = reserveCount(\n state.identifierCharacterCount,\n identifier.length,\n OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters,\n `scope exceeds the maximum of ${OBJECT_READ_SCOPE_LIMITS.maxIdentifierCharacters} identifier characters`\n )\n return identifier\n}\n\nfunction captureArray(value: unknown, path: string): CapturedArray {\n if (!Array.isArray(value)) {\n throw invalidScope(`${path} must be an array`)\n }\n const array = value as readonly unknown[]\n const length = array.length\n if (!Number.isSafeInteger(length) || length < 0) {\n throw invalidScope(`${path}.length must be a non-negative safe integer`)\n }\n return { value: array, length }\n}\n\nfunction reserveCount(current: number, count: number, limit: number, message: string): number {\n if (count > limit - current) throw invalidScope(message)\n return current + count\n}\n\n/** Fail closed when a project-bound selected reader is accidentally reused across projects. */\nexport function assertObjectReaderProject(\n expectedProjectId: string,\n actualProjectId: string\n): void {\n if (actualProjectId !== expectedProjectId) {\n throw new Error(\n `[Sixb] Object reader belongs to project '${expectedProjectId}', not '${actualProjectId}'.`\n )\n }\n}\n\ninterface ConcreteDefinition {\n readonly sourceObjectTypeId: string\n readonly linkId: string\n readonly targetObjectTypeId: string\n readonly propertyIds: readonly string[]\n}\n\nfunction normalizeConcreteDefinitions(\n definitions: readonly ObjectReadLinkDefinitionSelection[],\n path: string,\n addIdentifier: (value: unknown, path: string) => string,\n addPropertyOccurrences: (count: number) => void,\n addCompiledPropertyOccurrences: (count: number) => void,\n addCompiledIdentifierCharacters: (count: number) => void,\n addConcreteStep: () => void\n): readonly ConcreteDefinition[] {\n const propertiesByDefinition = new Map<\n string,\n {\n sourceObjectTypeId: string\n linkId: string\n targetObjectTypeId: string\n properties: Set<string>\n }\n >()\n\n for (const [index, definition] of definitions.entries()) {\n const definitionPath = `${path}[${index}]`\n if (\n !isRecord(definition) ||\n !Array.isArray(definition.targetObjectTypeIds) ||\n !Array.isArray(definition.propertyIds)\n ) {\n throw invalidScope(`${definitionPath} must contain a concrete link definition`)\n }\n const sourceObjectTypeId = addIdentifier(\n definition.sourceObjectTypeId,\n `${definitionPath}.sourceObjectTypeId`\n )\n const linkId = addIdentifier(definition.linkId, `${definitionPath}.linkId`)\n if (definition.targetObjectTypeIds.length === 0) {\n throw invalidScope(`${definitionPath}.targetObjectTypeIds must not be empty`)\n }\n addPropertyOccurrences(definition.propertyIds.length)\n let propertyIdentifierCharacters = 0\n for (const [propertyIndex, propertyId] of definition.propertyIds.entries()) {\n propertyIdentifierCharacters += addIdentifier(\n propertyId,\n `${definitionPath}.propertyIds[${propertyIndex}]`\n ).length\n }\n let targetIdentifierCharacters = 0\n for (const [targetIndex, value] of definition.targetObjectTypeIds.entries()) {\n addConcreteStep()\n targetIdentifierCharacters += addIdentifier(\n value,\n `${definitionPath}.targetObjectTypeIds[${targetIndex}]`\n ).length\n }\n\n // Reserve the complete concrete expansion before allocating collision-safe keys or copying\n // properties into per-target sets. One compact raw definition may otherwise amplify its\n // source/link/property identifiers once per target beyond the provider-neutral scope caps.\n addCompiledPropertyOccurrences(\n definition.propertyIds.length * definition.targetObjectTypeIds.length\n )\n const repeatedIdentifierCharacters =\n sourceObjectTypeId.length + linkId.length + propertyIdentifierCharacters\n addCompiledIdentifierCharacters(\n repeatedIdentifierCharacters * definition.targetObjectTypeIds.length +\n targetIdentifierCharacters\n )\n\n for (const [targetIndex, value] of definition.targetObjectTypeIds.entries()) {\n const targetObjectTypeId = nonEmptyString(\n value,\n `${definitionPath}.targetObjectTypeIds[${targetIndex}]`\n )\n const key = JSON.stringify([sourceObjectTypeId, linkId, targetObjectTypeId])\n const normalized = propertiesByDefinition.get(key) ?? {\n sourceObjectTypeId,\n linkId,\n targetObjectTypeId,\n properties: new Set<string>(),\n }\n for (const [propertyIndex, propertyId] of definition.propertyIds.entries()) {\n normalized.properties.add(\n nonEmptyString(propertyId, `${definitionPath}.propertyIds[${propertyIndex}]`)\n )\n }\n propertiesByDefinition.set(key, normalized)\n }\n }\n\n return [...propertiesByDefinition.values()]\n .sort(\n (left, right) =>\n left.sourceObjectTypeId.localeCompare(right.sourceObjectTypeId) ||\n left.linkId.localeCompare(right.linkId) ||\n left.targetObjectTypeId.localeCompare(right.targetObjectTypeId)\n )\n .map(({ properties, ...definition }) =>\n Object.freeze({\n ...definition,\n propertyIds: Object.freeze([...properties].sort()),\n })\n )\n}\n\nfunction identifierCharacters(values: readonly string[]): number {\n return values.reduce((total, value) => total + value.length, 0)\n}\n\nfunction normalizeObjects(\n selections: readonly ObjectReadObjectSelection[],\n path: string\n): readonly ObjectReadObjectSelection[] {\n const propertiesByType = new Map<string, Set<string>>()\n for (const [index, selection] of selections.entries()) {\n if (!isRecord(selection) || !Array.isArray(selection.propertyIds)) {\n throw invalidScope(`${path}[${index}] must contain an object type and property ids`)\n }\n const objectTypeId = nonEmptyString(selection.objectTypeId, `${path}[${index}].objectTypeId`)\n const properties = propertiesByType.get(objectTypeId) ?? new Set<string>()\n for (const propertyId of normalizeIds(selection.propertyIds, `${path}[${index}].propertyIds`)) {\n properties.add(propertyId)\n }\n propertiesByType.set(objectTypeId, properties)\n }\n return [...propertiesByType]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([objectTypeId, properties]) =>\n Object.freeze({ objectTypeId, propertyIds: Object.freeze([...properties].sort()) })\n )\n}\n\nfunction normalizeIds(values: readonly string[], path: string): string[] {\n return [\n ...new Set(values.map((value, index) => nonEmptyString(value, `${path}[${index}]`))),\n ].sort()\n}\n\nfunction nonEmptyString(value: unknown, path: string): string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw invalidScope(`${path} must be a non-empty string`)\n }\n return value\n}\n\nfunction setsEqual(left: ReadonlySet<string>, right: ReadonlySet<string>): boolean {\n return left.size === right.size && [...left].every((value) => right.has(value))\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null\n}\n\nfunction invalidScope(message: string): Error {\n return new Error(`[Sixb] Invalid object read scope: ${message}.`)\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAcO,IAAM,2BAA2B,OAAO,OAAO;AAAA,EACpD,UAAU;AAAA,EACV,UAAU;AAAA,EACV,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,wBAAwB;AAAA,EACxB,yBAAyB;AAC3B,CAAC;AAQM,SAAS,8BAA8B,CAC5C,UACiC;AAAA,EACjC,MAAM,QAAQ,+BAA+B,QAAQ;AAAA,EACrD,IAAI,CAAC,SAAS,KAAK,KAAK,MAAM,SAAS,cAAc,CAAC,MAAM,QAAQ,MAAM,KAAK,GAAG;AAAA,IAChF,MAAM,aAAa,mDAAmD;AAAA,EACxE;AAAA,EAEA,MAAM,QAAkC,CAAC;AAAA,EACzC,MAAM,UAA+C,CAAC;AAAA,EACtD,MAAM,QAAkC,CAAC;AAAA,EACzC,MAAM,WAAW,IAAI;AAAA,EACrB,IAAI,aAAa;AAAA,EACjB,IAAI,oBAAoB;AAAA,EACxB,IAAI,uBAAuB;AAAA,EAC3B,IAAI,0BAA0B;AAAA,EAC9B,IAAI,2BAA2B;AAAA,EAC/B,IAAI,kCAAkC;AAAA,EACtC,IAAI,mCAAmC;AAAA,EAEvC,MAAM,gBAAgB,CAAC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B,MAAwB;AAAA,EACvE,OAAO;AAAA,IACL,GAAG,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,UAAU,eAAe,OAAO,GAAG,QAAQ,QAAQ,CAAC,CAAC;AAAA,EACrF,EAAE,KAAK;AAAA;AAGT,SAAS,cAAc,CAAC,OAAgB,MAAsB;AAAA,EAC5D,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,EAAE,WAAW,GAAG;AAAA,IAC1D,MAAM,aAAa,GAAG,iCAAiC;AAAA,EACzD;AAAA,EACA,OAAO;AAAA;AAGT,SAAS,SAAS,CAAC,MAA2B,OAAqC;AAAA,EACjF,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,UAAU,MAAM,IAAI,KAAK,CAAC;AAAA;AAGhF,SAAS,QAAQ,CAAC,OAAkD;AAAA,EAClE,OAAO,OAAO,UAAU,YAAY,UAAU;AAAA;AAGhD,SAAS,YAAY,CAAC,SAAwB;AAAA,EAC5C,OAAO,IAAI,MAAM,qCAAqC,UAAU;AAAA;",
|
|
8
|
+
"debugId": "F3C89DAB3F2B853064756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -32,6 +32,9 @@ async function validateExecutionRecordReferences(record, lookup) {
|
|
|
32
32
|
await validatePrincipal(record.authorizationRef.principal, record.projectId, "Authority principal", lookup);
|
|
33
33
|
await validateCredential(record, lookup);
|
|
34
34
|
}
|
|
35
|
+
if (record.authorizationRef.type === "delegated") {
|
|
36
|
+
await validateDelegation(record, lookup);
|
|
37
|
+
}
|
|
35
38
|
await validateParent(record, lookup);
|
|
36
39
|
}
|
|
37
40
|
function cloneExecutionRecord(record) {
|
|
@@ -107,6 +110,13 @@ function assertAuthorizationRef(ref) {
|
|
|
107
110
|
assertNonBlank(ref.primitive.id, "Authority primitive id");
|
|
108
111
|
assertNonBlank(ref.primitive.runId, "Authority primitive run id");
|
|
109
112
|
return;
|
|
113
|
+
case "delegated":
|
|
114
|
+
if (ref.delegation.kind !== "share") {
|
|
115
|
+
invalid(`Unknown authority delegation kind '${String(ref.delegation.kind)}'.`);
|
|
116
|
+
}
|
|
117
|
+
assertNonBlank(ref.delegation.grantId, "Authority delegation grant id");
|
|
118
|
+
assertNonBlank(ref.delegation.sessionId, "Authority delegation session id");
|
|
119
|
+
return;
|
|
110
120
|
case "kernel":
|
|
111
121
|
assertKernelOperation(ref.operation, "Authority kernel operation");
|
|
112
122
|
return;
|
|
@@ -135,7 +145,13 @@ function assertExecutorAuthority(record) {
|
|
|
135
145
|
}
|
|
136
146
|
return;
|
|
137
147
|
}
|
|
138
|
-
|
|
148
|
+
if (authorizationRef.type === "delegated") {
|
|
149
|
+
if (requestedBy !== undefined) {
|
|
150
|
+
invalid("Delegated request executions cannot have a requested-by principal.");
|
|
151
|
+
}
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
invalid("Request executions require principal, delegated, or explicitly disabled authority.");
|
|
139
155
|
break;
|
|
140
156
|
}
|
|
141
157
|
case "primitive": {
|
|
@@ -209,6 +225,18 @@ async function validateCredential(record, lookup) {
|
|
|
209
225
|
throw new ExecutionStorageError("invalid_credential", `[Sixb] Authority access token '${credential.id}' does not belong to principal '${principal.id}'.`);
|
|
210
226
|
}
|
|
211
227
|
}
|
|
228
|
+
async function validateDelegation(record, lookup) {
|
|
229
|
+
if (record.authorizationRef.type !== "delegated")
|
|
230
|
+
return;
|
|
231
|
+
const { grantId, sessionId } = record.authorizationRef.delegation;
|
|
232
|
+
const session = await lookup.getShareSession({ projectId: record.projectId, id: sessionId });
|
|
233
|
+
if (!session) {
|
|
234
|
+
throw new ExecutionStorageError("missing_credential", `[Sixb] Authority shared session '${sessionId}' does not exist in project '${record.projectId}'.`);
|
|
235
|
+
}
|
|
236
|
+
if (session.grantId !== grantId) {
|
|
237
|
+
throw new ExecutionStorageError("invalid_credential", `[Sixb] Authority shared session '${sessionId}' does not belong to grant '${grantId}'.`);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
212
240
|
async function validateParent(record, lookup) {
|
|
213
241
|
if (record.source.type !== "execution")
|
|
214
242
|
return;
|
|
@@ -281,4 +309,4 @@ var TRUSTED_PRIMITIVE_KINDS = new Set([
|
|
|
281
309
|
|
|
282
310
|
export { ExecutionStorageError, normalizeExecutionRecord, validateExecutionRecordReferences, cloneExecutionRecord };
|
|
283
311
|
|
|
284
|
-
//# debugId=
|
|
312
|
+
//# debugId=CD48D807CD286EF564756E2164756E21
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/storage/executions/errors.ts", "../src/storage/executions/validation.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"export type ExecutionStorageErrorCode =\n | \"duplicate_execution\"\n | \"invalid_credential\"\n | \"invalid_input\"\n | \"invalid_parent_execution\"\n | \"missing_credential\"\n | \"missing_parent_execution\"\n | \"missing_principal\"\n\n/** Stable error raised when an execution record would violate ledger invariants. */\nexport class ExecutionStorageError extends Error {\n readonly name = \"ExecutionStorageError\"\n\n constructor(\n readonly code: ExecutionStorageErrorCode,\n message: string,\n options: ErrorOptions = {}\n ) {\n super(message, options)\n }\n}\n",
|
|
6
|
+
"import { isDeepStrictEqual } from \"node:util\"\nimport type {\n AuthorizablePrincipal,\n AuthorizationRef,\n KernelOperation,\n} from \"../../execution/types\"\nimport type { AuthStorage } from \"../auth\"\nimport { ExecutionStorageError } from \"./errors\"\nimport type {\n CreateExecutionInput,\n DurableExecutionExecutor,\n DurableExecutionSource,\n ExecutionRecord,\n} from \"./types\"\n\nexport interface ExecutionValidationLookup {\n readonly auth: AuthStorage\n getExecution(params: {\n readonly projectId: string\n readonly id: string\n }): Promise<ExecutionRecord | null>\n getShareSession(params: {\n readonly projectId: string\n readonly id: string\n }): Promise<{ readonly grantId: string } | null>\n}\n\nexport function normalizeExecutionRecord(\n input: CreateExecutionInput,\n createdAt: Date = new Date()\n): ExecutionRecord {\n const record: ExecutionRecord = {\n id: input.id,\n projectId: input.projectId,\n ...(input.requestedBy === undefined ? {} : { requestedBy: structuredClone(input.requestedBy) }),\n executor: structuredClone(input.executor),\n source: structuredClone(input.source),\n correlationId: input.correlationId,\n authorizationRef: structuredClone(input.authorizationRef),\n createdAt: new Date(createdAt),\n }\n\n assertRecordShape(record)\n assertExecutorAuthority(record)\n return record\n}\n\nexport async function validateExecutionRecordReferences(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n await validatePrincipal(record.requestedBy, record.projectId, \"Requested-by principal\", lookup)\n\n if (record.authorizationRef.type === \"principal\") {\n await validatePrincipal(\n record.authorizationRef.principal,\n record.projectId,\n \"Authority principal\",\n lookup\n )\n await validateCredential(record, lookup)\n }\n if (record.authorizationRef.type === \"delegated\") {\n await validateDelegation(record, lookup)\n }\n\n await validateParent(record, lookup)\n}\n\nexport function cloneExecutionRecord(record: ExecutionRecord): ExecutionRecord {\n return structuredClone(record)\n}\n\nfunction assertRecordShape(record: ExecutionRecord): void {\n assertNonBlank(record.id, \"Execution id\")\n assertNonBlank(record.projectId, \"Execution project id\")\n assertNonBlank(record.correlationId, \"Execution correlation id\")\n assertValidDate(record.createdAt, \"Execution createdAt\")\n\n if (record.requestedBy) {\n assertPrincipal(record.requestedBy, \"Requested-by principal\")\n }\n\n assertExecutor(record.executor)\n assertSource(record.source)\n assertAuthorizationRef(record.authorizationRef)\n}\n\nfunction assertExecutor(executor: DurableExecutionExecutor): void {\n switch (executor.type) {\n case \"request\":\n assertNonBlank(executor.requestId, \"Executor request id\")\n return\n case \"primitive\":\n assertTrustedPrimitiveKind(executor.kind, \"Executor primitive kind\")\n assertNonBlank(executor.runId, \"Executor primitive run id\")\n return\n case \"agent\":\n assertNonBlank(executor.runId, \"Executor agent run id\")\n return\n case \"kernel\":\n assertKernelOperation(executor.operation, \"Executor kernel operation\")\n return\n default:\n invalid(`Unknown execution executor type '${String((executor as { type?: unknown }).type)}'.`)\n }\n}\n\nfunction assertSource(source: DurableExecutionSource): void {\n switch (source.type) {\n case \"http\":\n assertNonBlank(source.requestId, \"Execution source request id\")\n return\n case \"webhook\":\n assertNonBlank(source.deliveryId, \"Execution source delivery id\")\n return\n case \"schedule\":\n case \"event\":\n assertNonBlank(source.eventId, \"Execution source event id\")\n return\n case \"datasetVersion\":\n assertNonBlank(source.datasetId, \"Execution source dataset id\")\n assertNonBlank(source.versionId, \"Execution source dataset version id\")\n return\n case \"execution\":\n assertNonBlank(source.executionId, \"Execution source execution id\")\n return\n default:\n invalid(\n `Execution source type '${String((source as { type?: unknown }).type)}' is not durable.`\n )\n }\n}\n\nfunction assertAuthorizationRef(ref: AuthorizationRef): void {\n switch (ref.type) {\n case \"principal\":\n assertPrincipal(ref.principal, \"Authority principal\")\n if (ref.credential) {\n if (ref.credential.type !== \"session\" && ref.credential.type !== \"accessToken\") {\n invalid(\n `Unknown authority credential type '${String(\n (ref.credential as { type?: unknown }).type\n )}'.`\n )\n }\n assertNonBlank(ref.credential.id, \"Authority credential id\")\n }\n return\n case \"trustedPrimitive\":\n assertTrustedPrimitiveKind(ref.primitive.kind, \"Authority primitive kind\")\n assertNonBlank(ref.primitive.id, \"Authority primitive id\")\n assertNonBlank(ref.primitive.runId, \"Authority primitive run id\")\n return\n case \"delegated\":\n if (ref.delegation.kind !== \"share\") {\n invalid(\n `Unknown authority delegation kind '${String(\n (ref.delegation as { kind?: unknown }).kind\n )}'.`\n )\n }\n assertNonBlank(ref.delegation.grantId, \"Authority delegation grant id\")\n assertNonBlank(ref.delegation.sessionId, \"Authority delegation session id\")\n return\n case \"kernel\":\n assertKernelOperation(ref.operation, \"Authority kernel operation\")\n return\n case \"disabled\":\n return\n default:\n invalid(`Unknown authorization reference type '${String((ref as { type?: unknown }).type)}'.`)\n }\n}\n\nfunction assertExecutorAuthority(record: ExecutionRecord): void {\n const { executor, authorizationRef, requestedBy, source } = record\n\n switch (executor.type) {\n case \"request\": {\n if (source.type !== \"http\" || source.requestId !== executor.requestId) {\n invalid(\"Request executions require a matching HTTP source request id.\")\n }\n if (authorizationRef.type === \"principal\") {\n if (!principalsEqual(requestedBy, authorizationRef.principal)) {\n invalid(\"Request authority must match its requested-by principal.\")\n }\n return\n }\n if (authorizationRef.type === \"disabled\") {\n if (requestedBy !== undefined) {\n invalid(\"Auth-disabled request executions cannot have a requested-by principal.\")\n }\n return\n }\n if (authorizationRef.type === \"delegated\") {\n if (requestedBy !== undefined) {\n invalid(\"Delegated request executions cannot have a requested-by principal.\")\n }\n return\n }\n invalid(\"Request executions require principal, delegated, or explicitly disabled authority.\")\n break\n }\n case \"primitive\": {\n if (authorizationRef.type !== \"trustedPrimitive\") {\n invalid(\"Primitive executions require trusted primitive authority.\")\n }\n if (\n authorizationRef.primitive.kind !== executor.kind ||\n authorizationRef.primitive.runId !== executor.runId\n ) {\n invalid(\"Trusted primitive authority must match the executor kind and run id.\")\n }\n return\n }\n case \"agent\": {\n if (source.type !== \"execution\") {\n invalid(\"Agent executions require a parent execution source.\")\n }\n if (\n authorizationRef.type === \"principal\" &&\n authorizationRef.principal.type === \"serviceAccount\" &&\n authorizationRef.credential === undefined\n ) {\n return\n }\n if (\n authorizationRef.type === \"principal\" &&\n authorizationRef.principal.type === \"user\" &&\n authorizationRef.credential !== undefined\n ) {\n return\n }\n if (authorizationRef.type === \"disabled\") return\n invalid(\n \"Agent executions require managed service-account, credentialed user, or explicitly disabled authority.\"\n )\n break\n }\n case \"kernel\": {\n if (\n authorizationRef.type !== \"kernel\" ||\n !kernelOperationsEqual(authorizationRef.operation, executor.operation)\n ) {\n invalid(\"Kernel authority must match the executor operation.\")\n }\n if (requestedBy !== undefined) {\n invalid(\"Kernel executions cannot have a requested-by principal.\")\n }\n return\n }\n }\n}\n\nasync function validatePrincipal(\n principal: AuthorizablePrincipal | undefined,\n projectId: string,\n label: string,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (!principal) return\n\n const record =\n principal.type === \"user\"\n ? await lookup.auth.users.getById({ projectId, id: principal.id })\n : await lookup.auth.serviceAccounts.getById({ projectId, id: principal.id })\n if (!record) {\n throw new ExecutionStorageError(\n \"missing_principal\",\n `[Sixb] ${label} '${principal.id}' does not exist in project '${projectId}'.`\n )\n }\n}\n\nasync function validateCredential(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.authorizationRef.type !== \"principal\" || !record.authorizationRef.credential) return\n\n const { principal, credential } = record.authorizationRef\n if (credential.type === \"session\") {\n const session = await lookup.auth.sessions.getById({\n projectId: record.projectId,\n id: credential.id,\n })\n if (!session) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority session '${credential.id}' does not exist in project '${record.projectId}'.`\n )\n }\n if (principal.type !== \"user\" || session.userId !== principal.id) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority session '${credential.id}' does not belong to principal '${principal.id}'.`\n )\n }\n return\n }\n\n const token = await lookup.auth.accessTokens.getById({\n projectId: record.projectId,\n id: credential.id,\n })\n if (!token) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority access token '${credential.id}' does not exist in project '${record.projectId}'.`\n )\n }\n if (token.subjectType !== principal.type || token.subjectId !== principal.id) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority access token '${credential.id}' does not belong to principal '${principal.id}'.`\n )\n }\n}\n\nasync function validateDelegation(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.authorizationRef.type !== \"delegated\") return\n const { grantId, sessionId } = record.authorizationRef.delegation\n const session = await lookup.getShareSession({ projectId: record.projectId, id: sessionId })\n if (!session) {\n throw new ExecutionStorageError(\n \"missing_credential\",\n `[Sixb] Authority shared session '${sessionId}' does not exist in project '${record.projectId}'.`\n )\n }\n if (session.grantId !== grantId) {\n throw new ExecutionStorageError(\n \"invalid_credential\",\n `[Sixb] Authority shared session '${sessionId}' does not belong to grant '${grantId}'.`\n )\n }\n}\n\nasync function validateParent(\n record: ExecutionRecord,\n lookup: ExecutionValidationLookup\n): Promise<void> {\n if (record.source.type !== \"execution\") return\n const parentExecutionId = record.source.executionId\n\n const parent = await lookup.getExecution({\n projectId: record.projectId,\n id: parentExecutionId,\n })\n if (!parent) {\n throw new ExecutionStorageError(\n \"missing_parent_execution\",\n `[Sixb] Parent execution '${parentExecutionId}' does not exist in project '${record.projectId}'.`\n )\n }\n if (parent.correlationId !== record.correlationId) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child execution '${record.id}' must preserve its parent correlation id.`\n )\n }\n if (!principalsEqual(parent.requestedBy, record.requestedBy)) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child execution '${record.id}' must preserve its parent requested-by principal.`\n )\n }\n if (\n record.executor.type === \"agent\" &&\n isInheritedAgentAuthority(record.authorizationRef) &&\n !isDeepStrictEqual(parent.authorizationRef, record.authorizationRef)\n ) {\n throw new ExecutionStorageError(\n \"invalid_parent_execution\",\n `[Sixb] Child Agent execution '${record.id}' must inherit its parent's authorization reference.`\n )\n }\n}\n\nfunction isInheritedAgentAuthority(ref: AuthorizationRef): boolean {\n return (\n ref.type === \"disabled\" ||\n (ref.type === \"principal\" && ref.principal.type === \"user\" && ref.credential !== undefined)\n )\n}\n\nfunction assertPrincipal(principal: AuthorizablePrincipal, label: string): void {\n if (principal.type !== \"user\" && principal.type !== \"serviceAccount\") {\n invalid(`${label} has unsupported type '${String((principal as { type?: unknown }).type)}'.`)\n }\n assertNonBlank(principal.id, `${label} id`)\n}\n\nfunction assertKernelOperation(operation: KernelOperation, label: string): void {\n if (operation.type !== \"ontology.recover\") {\n invalid(`${label} has unsupported type '${String((operation as { type?: unknown }).type)}'.`)\n }\n assertNonBlank(operation.recoveryId, `${label} recovery id`)\n}\n\nfunction assertTrustedPrimitiveKind(value: string, label: string): void {\n if (!TRUSTED_PRIMITIVE_KINDS.has(value)) {\n invalid(`${label} '${value}' is not supported.`)\n }\n}\n\nfunction assertNonBlank(value: string, label: string): void {\n if (typeof value !== \"string\" || !value.trim()) {\n invalid(`${label} must be a non-empty string.`)\n }\n}\n\nfunction assertValidDate(value: Date, label: string): void {\n if (!(value instanceof Date) || !Number.isFinite(value.getTime())) {\n invalid(`${label} must be a valid date.`)\n }\n}\n\nfunction principalsEqual(\n left: AuthorizablePrincipal | undefined,\n right: AuthorizablePrincipal | undefined\n): boolean {\n return left?.type === right?.type && left?.id === right?.id\n}\n\nfunction kernelOperationsEqual(left: KernelOperation, right: KernelOperation): boolean {\n return left.type === right.type && left.recoveryId === right.recoveryId\n}\n\nfunction invalid(message: string): never {\n throw new ExecutionStorageError(\"invalid_input\", `[Sixb] ${message}`)\n}\n\nconst TRUSTED_PRIMITIVE_KINDS = new Set([\n \"action\",\n \"pipeline\",\n \"projection\",\n \"rule\",\n \"sync\",\n \"webhook\",\n \"workflow\",\n])\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;AAUO,MAAM,8BAA8B,MAAM;AAAA,EAIpC;AAAA,EAHF,OAAO;AAAA,EAEhB,WAAW,CACA,MACT,SACA,UAAwB,CAAC,GACzB;AAAA,IACA,MAAM,SAAS,OAAO;AAAA,IAJb;AAAA;AAMb;;;ACpBA;AA2BO,SAAS,wBAAwB,CACtC,OACA,YAAkB,IAAI,MACL;AAAA,EACjB,MAAM,SAA0B;AAAA,IAC9B,IAAI,MAAM;AAAA,IACV,WAAW,MAAM;AAAA,OACb,MAAM,gBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,gBAAgB,MAAM,WAAW,EAAE;AAAA,IAC7F,UAAU,gBAAgB,MAAM,QAAQ;AAAA,IACxC,QAAQ,gBAAgB,MAAM,MAAM;AAAA,IACpC,eAAe,MAAM;AAAA,IACrB,kBAAkB,gBAAgB,MAAM,gBAAgB;AAAA,IACxD,WAAW,IAAI,KAAK,SAAS;AAAA,EAC/B;AAAA,EAEA,kBAAkB,MAAM;AAAA,EACxB,wBAAwB,MAAM;AAAA,EAC9B,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