@sixb/core 0.1.17 → 0.1.18
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/index.js +22 -19
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/read-facade.d.ts +1 -1
- package/dist/actions/validation.d.ts.map +1 -1
- package/dist/actions/worker.js +6 -2
- package/dist/actions/worker.js.map +3 -3
- package/dist/agents/adapters.d.ts +7 -0
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/authority.d.ts +7 -0
- package/dist/agents/authority.d.ts.map +1 -1
- package/dist/agents/context/entries.d.ts +10 -1
- package/dist/agents/context/entries.d.ts.map +1 -1
- package/dist/agents/context/index.d.ts +1 -1
- package/dist/agents/context/index.d.ts.map +1 -1
- package/dist/agents/context/index.js +4 -2
- package/dist/agents/context/index.js.map +1 -1
- package/dist/agents/context-compaction.d.ts.map +1 -1
- package/dist/agents/errors.d.ts +1 -1
- package/dist/agents/errors.d.ts.map +1 -1
- package/dist/agents/index.d.ts +6 -4
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +44 -37
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/message.d.ts +8 -1
- package/dist/agents/message.d.ts.map +1 -1
- package/dist/agents/request.d.ts +19 -5
- package/dist/agents/request.d.ts.map +1 -1
- package/dist/agents/skills.d.ts +41 -0
- package/dist/agents/skills.d.ts.map +1 -0
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.js +1 -1
- package/dist/agents/types.d.ts +33 -4
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/auth/index.js +9 -6
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/runtime.d.ts.map +1 -1
- package/dist/auth/types.d.ts +6 -0
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/authorization/index.js +5 -3
- package/dist/authorization/index.js.map +1 -1
- package/dist/authorization/resolve.d.ts +1 -1
- package/dist/authorization/resolve.d.ts.map +1 -1
- package/dist/authorization/types.d.ts +7 -0
- package/dist/authorization/types.d.ts.map +1 -1
- package/dist/blob-storage/browser.js +1 -1
- package/dist/blob-storage/execution.d.ts.map +1 -1
- package/dist/blob-storage/file-content.d.ts +18 -0
- package/dist/blob-storage/file-content.d.ts.map +1 -0
- package/dist/blob-storage/index.d.ts +1 -1
- package/dist/blob-storage/index.d.ts.map +1 -1
- package/dist/blob-storage/index.js +2 -2
- package/dist/blob-storage/internal.d.ts +2 -0
- package/dist/blob-storage/internal.d.ts.map +1 -1
- package/dist/blob-storage/internal.js +16 -4
- package/dist/blob-storage/internal.js.map +1 -1
- package/dist/blob-storage/media-type.d.ts +8 -0
- package/dist/blob-storage/media-type.d.ts.map +1 -0
- package/dist/blob-storage/types.d.ts +12 -1
- package/dist/blob-storage/types.d.ts.map +1 -1
- package/dist/blob-storage/validation.d.ts +6 -0
- package/dist/blob-storage/validation.d.ts.map +1 -1
- package/dist/bootstrap/agent-context.d.ts +33 -0
- package/dist/bootstrap/agent-context.d.ts.map +1 -0
- package/dist/bootstrap/discovery.d.ts +23 -3
- package/dist/bootstrap/discovery.d.ts.map +1 -1
- package/dist/bootstrap/index.d.ts +2 -1
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +284 -73
- package/dist/bootstrap/index.js.map +4 -3
- package/dist/bootstrap/ontology-type-manifest.d.ts.map +1 -1
- package/dist/{chunk-gf7yht60.js → chunk-1b1f2d5f.js} +23 -6
- package/dist/chunk-1b1f2d5f.js.map +12 -0
- package/dist/{chunk-9vx5e9g1.js → chunk-1sr8ryzk.js} +3 -3
- package/dist/chunk-1sr8ryzk.js.map +11 -0
- package/dist/{chunk-4gmng3vf.js → chunk-22v5bpz3.js} +1 -1
- package/dist/{chunk-s7ftxrdr.js → chunk-29yx306f.js} +20 -3
- package/dist/{chunk-s7ftxrdr.js.map → chunk-29yx306f.js.map} +3 -3
- package/dist/{chunk-4ra628t7.js → chunk-3zxk45er.js} +70 -6
- package/dist/{chunk-4ra628t7.js.map → chunk-3zxk45er.js.map} +5 -4
- package/dist/{chunk-2am3db31.js → chunk-48e3cn2d.js} +2 -2
- package/dist/{chunk-91kcnbf0.js → chunk-6gmfggss.js} +22 -9
- package/dist/chunk-6gmfggss.js.map +10 -0
- package/dist/{chunk-svabwqdq.js → chunk-6h5m9xjx.js} +43 -415
- package/dist/{chunk-svabwqdq.js.map → chunk-6h5m9xjx.js.map} +7 -11
- package/dist/{chunk-f1xh7a32.js → chunk-7hpdd6r9.js} +2 -2
- package/dist/{chunk-xyvy73tj.js → chunk-bs7sqkre.js} +8 -3
- package/dist/chunk-bs7sqkre.js.map +12 -0
- package/dist/{chunk-rb143ggb.js → chunk-bwjcehza.js} +1 -1
- package/dist/{chunk-t9shqx3w.js → chunk-d0eb5yy6.js} +143 -7
- package/dist/chunk-d0eb5yy6.js.map +14 -0
- package/dist/{chunk-vp3z1ckh.js → chunk-de4z2bj6.js} +5 -5
- package/dist/{chunk-3rrezgyc.js → chunk-dnmadg9k.js} +2 -2
- package/dist/chunk-enpsx8k5.js +127 -0
- package/dist/chunk-enpsx8k5.js.map +10 -0
- package/dist/{chunk-a7er86jd.js → chunk-ex496vct.js} +1 -1
- package/dist/{chunk-jnfxmr3f.js → chunk-f1zxad2t.js} +1 -1
- package/dist/{chunk-6wbm6ymz.js → chunk-fe52eczz.js} +271 -83
- package/dist/chunk-fe52eczz.js.map +49 -0
- package/dist/{chunk-10styjgk.js → chunk-fx93hd2n.js} +71 -29
- package/dist/chunk-fx93hd2n.js.map +20 -0
- package/dist/{chunk-9se093qz.js → chunk-gc4ntf7d.js} +4 -4
- package/dist/{chunk-9se093qz.js.map → chunk-gc4ntf7d.js.map} +1 -1
- package/dist/{chunk-98cw09sw.js → chunk-hkc3jct7.js} +4 -2
- package/dist/chunk-hkc3jct7.js.map +10 -0
- package/dist/{chunk-pja9jfz6.js → chunk-htr6wjmv.js} +115 -53
- package/dist/chunk-htr6wjmv.js.map +19 -0
- package/dist/{chunk-h3v76ams.js → chunk-jhm3zsa7.js} +25 -2
- package/dist/chunk-jhm3zsa7.js.map +12 -0
- package/dist/{chunk-52c5zb0z.js → chunk-k6hrnf35.js} +5 -5
- package/dist/chunk-k6hrnf35.js.map +10 -0
- package/dist/{chunk-c2rga5cx.js → chunk-mfs23znk.js} +1 -1
- package/dist/{chunk-7ecp4v7a.js → chunk-ny3xyvcn.js} +8 -2
- package/dist/{chunk-7ecp4v7a.js.map → chunk-ny3xyvcn.js.map} +3 -3
- package/dist/{chunk-fggq3d9k.js → chunk-p0dqwj3n.js} +5 -5
- package/dist/{chunk-cnb5kv05.js → chunk-p844e0rn.js} +23 -8
- package/dist/chunk-p844e0rn.js.map +19 -0
- package/dist/{chunk-dmn70ztd.js → chunk-pfp1txq2.js} +25 -6
- package/dist/chunk-pfp1txq2.js.map +11 -0
- package/dist/chunk-pqajwytd.js.map +2 -2
- package/dist/{chunk-5be2ath4.js → chunk-qkbx3tf6.js} +17 -128
- package/dist/{chunk-5be2ath4.js.map → chunk-qkbx3tf6.js.map} +6 -7
- package/dist/{chunk-sk0hcjsz.js → chunk-qkvz64nd.js} +2 -2
- package/dist/{chunk-w9yycd3t.js → chunk-qmnnhde6.js} +4 -8
- package/dist/{chunk-w9yycd3t.js.map → chunk-qmnnhde6.js.map} +3 -3
- package/dist/{chunk-5yd8cchh.js → chunk-qq90g05n.js} +8 -8
- package/dist/{chunk-5yd8cchh.js.map → chunk-qq90g05n.js.map} +1 -1
- package/dist/{chunk-tjjgy3z4.js → chunk-qxvp5epv.js} +66 -14
- package/dist/{chunk-tjjgy3z4.js.map → chunk-qxvp5epv.js.map} +9 -8
- package/dist/chunk-rdghfsss.js.map +2 -2
- package/dist/{chunk-rx7h5fdx.js → chunk-rt9p8m9t.js} +1 -1
- package/dist/{chunk-cd234ba4.js → chunk-rz53yb4v.js} +10 -5
- package/dist/chunk-rz53yb4v.js.map +14 -0
- package/dist/{chunk-xcy5ddha.js → chunk-s4jhg8a3.js} +351 -296
- package/dist/chunk-s4jhg8a3.js.map +15 -0
- package/dist/{chunk-69266efg.js → chunk-s54c868q.js} +12 -4
- package/dist/chunk-s54c868q.js.map +12 -0
- package/dist/{chunk-9g6jz9kk.js → chunk-tffvfy6s.js} +6 -5
- package/dist/{chunk-9g6jz9kk.js.map → chunk-tffvfy6s.js.map} +3 -3
- package/dist/{chunk-e67ynxcr.js → chunk-v6xpd60t.js} +3 -3
- package/dist/{chunk-jjrn5v0p.js → chunk-vgk3hknm.js} +1 -1
- package/dist/{chunk-5thzcb8g.js → chunk-vx2yp45y.js} +2 -2
- package/dist/{chunk-dam456ve.js → chunk-vz3gc1tm.js} +394 -31
- package/dist/{chunk-dam456ve.js.map → chunk-vz3gc1tm.js.map} +10 -7
- package/dist/chunk-xt1zt7gv.js +471 -0
- package/dist/chunk-xt1zt7gv.js.map +13 -0
- package/dist/{chunk-rpxz486p.js → chunk-y05543x6.js} +21 -5
- package/dist/{chunk-rpxz486p.js.map → chunk-y05543x6.js.map} +3 -3
- package/dist/{chunk-aq39q04r.js → chunk-y9jmd7e5.js} +4 -4
- package/dist/{chunk-aq39q04r.js.map → chunk-y9jmd7e5.js.map} +1 -1
- package/dist/{chunk-k4g51s47.js → chunk-yv9czyfr.js} +3 -3
- package/dist/{chunk-z5rnrmz1.js → chunk-yw9pyg66.js} +5 -3
- package/dist/chunk-yw9pyg66.js.map +11 -0
- package/dist/{chunk-vre348sb.js → chunk-za5yd58j.js} +2 -2
- package/dist/{chunk-23xs4qp9.js → chunk-zb77kjth.js} +3 -3
- package/dist/{chunk-33saed7g.js → chunk-zxawp1n2.js} +1 -1
- package/dist/datasets/builders.d.ts +12 -1
- package/dist/datasets/builders.d.ts.map +1 -1
- package/dist/datasets/execution.d.ts +27 -1
- package/dist/datasets/execution.d.ts.map +1 -1
- package/dist/datasets/index.d.ts +1 -1
- package/dist/datasets/index.d.ts.map +1 -1
- package/dist/datasets/types.d.ts +2 -0
- package/dist/datasets/types.d.ts.map +1 -1
- package/dist/datasets/write.d.ts +5 -0
- package/dist/datasets/write.d.ts.map +1 -1
- package/dist/datasets/write.js +10 -5
- package/dist/datasets/write.js.map +1 -1
- package/dist/edits/properties.d.ts.map +1 -1
- package/dist/events/execution.d.ts +2 -1
- package/dist/events/execution.d.ts.map +1 -1
- package/dist/events/types/objects.d.ts +5 -0
- package/dist/events/types/objects.d.ts.map +1 -1
- package/dist/execution/agent.d.ts +10 -0
- package/dist/execution/agent.d.ts.map +1 -1
- package/dist/execution/agent.js +39 -34
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/authorized-object-reader.d.ts +6 -1
- package/dist/execution/authorized-object-reader.d.ts.map +1 -1
- package/dist/execution/primitive.js +37 -34
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.js +38 -35
- package/dist/execution/request.js.map +2 -2
- package/dist/http/api-routes.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -52
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/index.js +8 -5
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/materializer/index.js +19 -16
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/catalog.d.ts +1 -1
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/execution/binding.d.ts +6 -0
- package/dist/models/execution/binding.d.ts.map +1 -1
- package/dist/models/execution/index.js +19 -16
- package/dist/models/execution/index.js.map +1 -1
- package/dist/models/execution/model-call-recorder.d.ts +4 -0
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/language-model.d.ts +6 -0
- package/dist/models/language-model.d.ts.map +1 -1
- package/dist/objects/context/index.d.ts +1 -1
- package/dist/objects/context/index.d.ts.map +1 -1
- package/dist/objects/context/types.d.ts +6 -0
- package/dist/objects/context/types.d.ts.map +1 -1
- package/dist/objects/execution.d.ts +2 -1
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +23 -19
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/materializer-adapter.d.ts.map +1 -1
- package/dist/objects/object/upsert-batch.d.ts.map +1 -1
- package/dist/objects/object/upsert.d.ts.map +1 -1
- package/dist/objects/property-clearance.d.ts +41 -0
- package/dist/objects/property-clearance.d.ts.map +1 -0
- package/dist/objects/query/executor.d.ts +3 -0
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/index.js +18 -15
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/validate.d.ts +10 -1
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/objects/sdk/file-handle.d.ts +6 -0
- package/dist/objects/sdk/file-handle.d.ts.map +1 -0
- package/dist/objects/sdk/object-handle.d.ts +2 -2
- package/dist/objects/sdk/object-handle.d.ts.map +1 -1
- package/dist/objects/sdk/object-set.d.ts +2 -0
- package/dist/objects/sdk/object-set.d.ts.map +1 -1
- package/dist/ontology/builders.d.ts +12 -1
- package/dist/ontology/builders.d.ts.map +1 -1
- package/dist/ontology/docs-markdown.d.ts +35 -0
- package/dist/ontology/docs-markdown.d.ts.map +1 -0
- package/dist/ontology/docs.d.ts +50 -0
- package/dist/ontology/docs.d.ts.map +1 -0
- package/dist/ontology/index.js +7 -4
- package/dist/ontology/index.js.map +1 -1
- package/dist/ontology/inference/index.d.ts +19 -0
- package/dist/ontology/inference/index.d.ts.map +1 -1
- package/dist/ontology/internal.d.ts +3 -1
- package/dist/ontology/internal.d.ts.map +1 -1
- package/dist/ontology/internal.js +276 -3
- package/dist/ontology/internal.js.map +4 -3
- package/dist/ontology/tokens.d.ts +8 -1
- package/dist/ontology/tokens.d.ts.map +1 -1
- package/dist/ontology/types.d.ts +5 -0
- package/dist/ontology/types.d.ts.map +1 -1
- package/dist/ontology/validation/index.d.ts +1 -1
- package/dist/ontology/validation/index.d.ts.map +1 -1
- package/dist/ontology/validation/schema.d.ts +7 -0
- package/dist/ontology/validation/schema.d.ts.map +1 -1
- package/dist/pipelines/index.js +21 -18
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/internal.js +19 -16
- package/dist/projections/internal.js.map +1 -1
- package/dist/runtime/create.d.ts +11 -2
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +3 -1
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +13 -2
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/internal.js +21 -18
- package/dist/runtime/internal.js.map +1 -1
- package/dist/runtime/locale.d.ts +9 -0
- package/dist/runtime/locale.d.ts.map +1 -0
- package/dist/runtime/resolve-definitions.d.ts +4 -2
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +30 -3
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/sandboxes/index.js +7 -6
- package/dist/sandboxes/index.js.map +1 -1
- package/dist/scheduler/index.js +1 -1
- package/dist/scheduler/runtime.d.ts +3 -0
- package/dist/scheduler/runtime.d.ts.map +1 -1
- package/dist/security/builders.d.ts +11 -2
- package/dist/security/builders.d.ts.map +1 -1
- package/dist/security/index.d.ts +4 -4
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/markings.d.ts +19 -0
- package/dist/security/markings.d.ts.map +1 -0
- package/dist/security/redactions.d.ts +4 -0
- package/dist/security/redactions.d.ts.map +1 -0
- package/dist/security/registry.d.ts +7 -1
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/types.d.ts +25 -0
- package/dist/security/types.d.ts.map +1 -1
- package/dist/security/validation.d.ts +4 -1
- package/dist/security/validation.d.ts.map +1 -1
- package/dist/shares/internal.js +18 -15
- package/dist/shares/internal.js.map +2 -2
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +5 -4
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +15 -9
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/file-upload-sessions/provider.js +10 -7
- package/dist/storage/file-upload-sessions/provider.js.map +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +18 -15
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.js +4 -3
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/objects/types.d.ts +7 -0
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/workflow-runs/provider.js +10 -7
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +22 -19
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/index.js +55 -53
- package/dist/testing/index.js.map +2 -2
- package/dist/webhooks/internal.js +19 -16
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workflows/builders.d.ts.map +1 -1
- package/dist/workflows/index.js +41 -38
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/request.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +6 -3
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/validation.d.ts +2 -1
- package/dist/workflows/validation.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/actions/read-facade.ts +2 -1
- package/src/actions/validation.ts +4 -1
- package/src/agents/adapters.ts +15 -0
- package/src/agents/authority.ts +15 -0
- package/src/agents/context/entries.ts +48 -4
- package/src/agents/context/index.ts +1 -0
- package/src/agents/context-compaction.ts +6 -0
- package/src/agents/errors.ts +3 -0
- package/src/agents/index.ts +13 -1
- package/src/agents/message.ts +9 -0
- package/src/agents/request.ts +178 -22
- package/src/agents/skills.ts +63 -0
- package/src/agents/types.ts +35 -5
- package/src/auth/runtime.ts +14 -0
- package/src/auth/types.ts +6 -0
- package/src/authorization/resolve.ts +6 -1
- package/src/authorization/types.ts +7 -0
- package/src/blob-storage/execution.ts +12 -0
- package/src/blob-storage/file-content.ts +106 -0
- package/src/blob-storage/index.ts +1 -0
- package/src/blob-storage/internal.ts +7 -0
- package/src/blob-storage/media-type.ts +29 -0
- package/src/blob-storage/types.ts +13 -1
- package/src/blob-storage/validation.ts +13 -0
- package/src/bootstrap/agent-context.ts +356 -0
- package/src/bootstrap/discovery.ts +100 -33
- package/src/bootstrap/index.ts +1 -1
- package/src/bootstrap/ontology-type-manifest.ts +3 -38
- package/src/datasets/builders.ts +17 -1
- package/src/datasets/execution.ts +110 -2
- package/src/datasets/index.ts +7 -1
- package/src/datasets/types.ts +2 -0
- package/src/datasets/write.ts +21 -2
- package/src/edits/properties.ts +3 -0
- package/src/events/execution.ts +15 -16
- package/src/events/types/objects.ts +5 -0
- package/src/execution/agent.ts +27 -0
- package/src/execution/authorization.ts +1 -0
- package/src/execution/authorized-object-reader.ts +96 -34
- package/src/execution/scopes.ts +2 -6
- package/src/http/api-routes.ts +4 -3
- package/src/index.ts +27 -2
- package/src/models/catalog.ts +26 -2
- package/src/models/execution/README.md +4 -3
- package/src/models/execution/binding.ts +6 -0
- package/src/models/execution/model-call-recorder.ts +10 -0
- package/src/models/execution/session.ts +2 -2
- package/src/models/execution.ts +6 -2
- package/src/models/language-model.ts +6 -0
- package/src/objects/context/index.ts +1 -0
- package/src/objects/context/types.ts +7 -0
- package/src/objects/execution.ts +4 -1
- package/src/objects/materializer-adapter.ts +3 -0
- package/src/objects/object/upsert-batch.ts +4 -1
- package/src/objects/object/upsert.ts +3 -1
- package/src/objects/property-clearance.ts +209 -0
- package/src/objects/query/executor.ts +43 -36
- package/src/objects/query/validate.ts +133 -14
- package/src/objects/sdk/file-handle.ts +77 -0
- package/src/objects/sdk/object-handle.ts +8 -4
- package/src/objects/sdk/object-set.ts +5 -2
- package/src/ontology/builders.ts +18 -2
- package/src/ontology/docs-markdown.ts +394 -0
- package/src/ontology/docs.ts +196 -0
- package/src/ontology/inference/index.ts +25 -0
- package/src/ontology/internal.ts +7 -0
- package/src/ontology/tokens.ts +13 -2
- package/src/ontology/types.ts +5 -0
- package/src/ontology/validation/index.ts +1 -0
- package/src/ontology/validation/schema.ts +26 -1
- package/src/runtime/create.ts +34 -4
- package/src/runtime/definitions.ts +3 -1
- package/src/runtime/host.ts +45 -1
- package/src/runtime/index.ts +3 -0
- package/src/runtime/locale.ts +26 -0
- package/src/runtime/resolve-definitions.ts +28 -1
- package/src/runtime/sixb.ts +1 -1
- package/src/runtime/types.ts +39 -3
- package/src/scheduler/runtime.ts +11 -2
- package/src/security/builders.ts +49 -5
- package/src/security/index.ts +6 -1
- package/src/security/markings.ts +313 -0
- package/src/security/redactions.ts +6 -0
- package/src/security/registry.ts +21 -1
- package/src/security/types.ts +26 -0
- package/src/security/validation.ts +59 -2
- package/src/storage/agents/provider.ts +11 -0
- package/src/storage/agents/types.ts +15 -7
- package/src/storage/index.ts +1 -0
- package/src/storage/objects/types.ts +7 -0
- package/src/workflows/builders.ts +24 -1
- package/src/workflows/request.ts +3 -0
- package/src/workflows/types.ts +6 -3
- package/src/workflows/validation.ts +32 -4
- package/dist/chunk-10styjgk.js.map +0 -20
- package/dist/chunk-52c5zb0z.js.map +0 -10
- package/dist/chunk-69266efg.js.map +0 -12
- package/dist/chunk-6wbm6ymz.js.map +0 -48
- package/dist/chunk-91kcnbf0.js.map +0 -10
- package/dist/chunk-98cw09sw.js.map +0 -10
- package/dist/chunk-9vx5e9g1.js.map +0 -11
- package/dist/chunk-cd234ba4.js.map +0 -14
- package/dist/chunk-cnb5kv05.js.map +0 -19
- package/dist/chunk-dmn70ztd.js.map +0 -11
- package/dist/chunk-gf7yht60.js.map +0 -12
- package/dist/chunk-h3v76ams.js.map +0 -11
- package/dist/chunk-pja9jfz6.js.map +0 -19
- package/dist/chunk-t9shqx3w.js.map +0 -12
- package/dist/chunk-xcy5ddha.js.map +0 -15
- package/dist/chunk-xyvy73tj.js.map +0 -12
- package/dist/chunk-z5rnrmz1.js.map +0 -11
- /package/dist/{chunk-4gmng3vf.js.map → chunk-22v5bpz3.js.map} +0 -0
- /package/dist/{chunk-2am3db31.js.map → chunk-48e3cn2d.js.map} +0 -0
- /package/dist/{chunk-f1xh7a32.js.map → chunk-7hpdd6r9.js.map} +0 -0
- /package/dist/{chunk-rb143ggb.js.map → chunk-bwjcehza.js.map} +0 -0
- /package/dist/{chunk-vp3z1ckh.js.map → chunk-de4z2bj6.js.map} +0 -0
- /package/dist/{chunk-3rrezgyc.js.map → chunk-dnmadg9k.js.map} +0 -0
- /package/dist/{chunk-a7er86jd.js.map → chunk-ex496vct.js.map} +0 -0
- /package/dist/{chunk-jnfxmr3f.js.map → chunk-f1zxad2t.js.map} +0 -0
- /package/dist/{chunk-c2rga5cx.js.map → chunk-mfs23znk.js.map} +0 -0
- /package/dist/{chunk-fggq3d9k.js.map → chunk-p0dqwj3n.js.map} +0 -0
- /package/dist/{chunk-sk0hcjsz.js.map → chunk-qkvz64nd.js.map} +0 -0
- /package/dist/{chunk-rx7h5fdx.js.map → chunk-rt9p8m9t.js.map} +0 -0
- /package/dist/{chunk-e67ynxcr.js.map → chunk-v6xpd60t.js.map} +0 -0
- /package/dist/{chunk-jjrn5v0p.js.map → chunk-vgk3hknm.js.map} +0 -0
- /package/dist/{chunk-5thzcb8g.js.map → chunk-vx2yp45y.js.map} +0 -0
- /package/dist/{chunk-k4g51s47.js.map → chunk-yv9czyfr.js.map} +0 -0
- /package/dist/{chunk-vre348sb.js.map → chunk-za5yd58j.js.map} +0 -0
- /package/dist/{chunk-23xs4qp9.js.map → chunk-zb77kjth.js.map} +0 -0
- /package/dist/{chunk-33saed7g.js.map → chunk-zxawp1n2.js.map} +0 -0
package/src/security/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { applications } from "./applications"
|
|
2
2
|
export type {
|
|
3
3
|
DefineGroupOptions,
|
|
4
|
+
DefineMarkingOptions,
|
|
4
5
|
DefineMembershipPolicyOptions,
|
|
5
6
|
DefineRoleOptions,
|
|
6
7
|
} from "./builders"
|
|
7
|
-
export { defineGroup, defineMembershipPolicy, defineRole } from "./builders"
|
|
8
|
+
export { defineGroup, defineMarking, defineMembershipPolicy, defineRole } from "./builders"
|
|
8
9
|
export { SecurityValidationError } from "./errors"
|
|
9
10
|
export type { BreadthSelector, BreadthTarget } from "./every"
|
|
10
11
|
export { every } from "./every"
|
|
@@ -31,10 +32,13 @@ export type {
|
|
|
31
32
|
GroupReference,
|
|
32
33
|
ManageGrant,
|
|
33
34
|
ManageGrantTarget,
|
|
35
|
+
MarkingDefinition,
|
|
34
36
|
MembershipOperation,
|
|
35
37
|
MembershipPolicyDefinition,
|
|
36
38
|
ObserveGrant,
|
|
37
39
|
ObserveGrantTarget,
|
|
40
|
+
RedactionReason,
|
|
41
|
+
Redactions,
|
|
38
42
|
RegisteredSecurityDefinitions,
|
|
39
43
|
RoleDefinition,
|
|
40
44
|
RunGrant,
|
|
@@ -50,6 +54,7 @@ export {
|
|
|
50
54
|
assertMembershipPolicyDefinition,
|
|
51
55
|
assertRoleDefinition,
|
|
52
56
|
isGroupDefinition,
|
|
57
|
+
isMarkingDefinition,
|
|
53
58
|
isMembershipPolicyDefinition,
|
|
54
59
|
isRoleDefinition,
|
|
55
60
|
validateSecurityDefinitionsAtStartup,
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import type { DatasetDefinition } from "../datasets/types"
|
|
2
|
+
import type { OntologyDefinitionCatalog } from "../ontology/registry"
|
|
3
|
+
import type { ObjectType, Property } from "../ontology/types"
|
|
4
|
+
import type { PipelineDefinition } from "../pipelines/types"
|
|
5
|
+
import type { ProjectionDefinitionCatalog } from "../projections/registry"
|
|
6
|
+
import type { ObjectProjectionDefinition } from "../projections/types"
|
|
7
|
+
import { SecurityValidationError } from "./errors"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Check every marking once at startup.
|
|
11
|
+
*
|
|
12
|
+
* A marking is enforced at read time from the property or column definition alone, so each rule
|
|
13
|
+
* here closes a path that would otherwise return the value unredacted or make enforcement
|
|
14
|
+
* ambiguous.
|
|
15
|
+
*/
|
|
16
|
+
export function validateMarkingsAtStartup(input: {
|
|
17
|
+
readonly markingIds: ReadonlySet<string>
|
|
18
|
+
readonly ontology: OntologyDefinitionCatalog
|
|
19
|
+
readonly datasetsById: ReadonlyMap<string, DatasetDefinition>
|
|
20
|
+
readonly pipelines: readonly PipelineDefinition[]
|
|
21
|
+
readonly projections: ProjectionDefinitionCatalog
|
|
22
|
+
}): void {
|
|
23
|
+
validatePropertyMarkings(input.ontology, input.markingIds)
|
|
24
|
+
validateColumnMarkings(input.datasetsById, input.markingIds)
|
|
25
|
+
rejectPipelineStepsOverMarkedColumns(input.pipelines, input.datasetsById)
|
|
26
|
+
validateProjectionMarkings(input.projections, input.ontology, input.datasetsById)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ── Declarations ────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
function validatePropertyMarkings(
|
|
32
|
+
ontology: OntologyDefinitionCatalog,
|
|
33
|
+
markingIds: ReadonlySet<string>
|
|
34
|
+
): void {
|
|
35
|
+
for (const objectType of ontology.listObjectTypes()) {
|
|
36
|
+
for (const property of objectType.properties) {
|
|
37
|
+
validateProperty(objectType, property, markingIds)
|
|
38
|
+
}
|
|
39
|
+
for (const link of objectType.links) {
|
|
40
|
+
for (const property of link.properties ?? []) {
|
|
41
|
+
if (property.markings !== undefined) {
|
|
42
|
+
throw new SecurityValidationError(
|
|
43
|
+
`[Sixb] Link property '${objectType.id}.${link.id}.${property.id}' cannot carry markings. Mark object properties instead.`
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
assertSubtypeKeepsParentMarkings(objectType, ontology)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function validateProperty(
|
|
53
|
+
objectType: ObjectType,
|
|
54
|
+
property: Property,
|
|
55
|
+
markingIds: ReadonlySet<string>
|
|
56
|
+
): void {
|
|
57
|
+
if (property.markings === undefined) return
|
|
58
|
+
const path = `${objectType.id}.${property.id}`
|
|
59
|
+
assertMarkingList(property.markings, `Property '${path}'`, markingIds)
|
|
60
|
+
|
|
61
|
+
// The primary id identifies the object in every response, link, and event.
|
|
62
|
+
if (property.primary) {
|
|
63
|
+
throw new SecurityValidationError(
|
|
64
|
+
`[Sixb] Primary property '${path}' cannot carry markings: it identifies the object.`
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
// Telemetry values also flow through history reads and telemetry events, which do not
|
|
68
|
+
// enforce markings yet.
|
|
69
|
+
if (property.mode === "telemetry") {
|
|
70
|
+
throw new SecurityValidationError(
|
|
71
|
+
`[Sixb] Telemetry property '${path}' cannot carry markings yet.`
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A subtype inherits its parent's properties and may redefine them. Subtype rows are returned by
|
|
78
|
+
* parent-type reads, so a redefinition that dropped a marking would declassify the parent's data.
|
|
79
|
+
*/
|
|
80
|
+
function assertSubtypeKeepsParentMarkings(
|
|
81
|
+
objectType: ObjectType,
|
|
82
|
+
ontology: OntologyDefinitionCatalog
|
|
83
|
+
): void {
|
|
84
|
+
if (!objectType.extends) return
|
|
85
|
+
const parent = ontology.getObjectTypeById(objectType.extends)
|
|
86
|
+
if (!parent) return
|
|
87
|
+
|
|
88
|
+
for (const parentProperty of parent.properties) {
|
|
89
|
+
const property = objectType.properties.find((candidate) => candidate.id === parentProperty.id)
|
|
90
|
+
const missing = missingMarkings(parentProperty.markings, property?.markings)
|
|
91
|
+
if (missing.length > 0) {
|
|
92
|
+
throw new SecurityValidationError(
|
|
93
|
+
`[Sixb] Property '${objectType.id}.${parentProperty.id}' must keep the markings of '${parent.id}.${parentProperty.id}': add ${missing.map((markingId) => `'${markingId}'`).join(", ")}.`
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function validateColumnMarkings(
|
|
100
|
+
datasetsById: ReadonlyMap<string, DatasetDefinition>,
|
|
101
|
+
markingIds: ReadonlySet<string>
|
|
102
|
+
): void {
|
|
103
|
+
for (const dataset of datasetsById.values()) {
|
|
104
|
+
for (const column of dataset.schema.columns) {
|
|
105
|
+
if (column.markings === undefined) continue
|
|
106
|
+
assertMarkingList(
|
|
107
|
+
column.markings,
|
|
108
|
+
`Dataset column '${dataset.id}.${column.name}'`,
|
|
109
|
+
markingIds
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function assertMarkingList(
|
|
116
|
+
markings: unknown,
|
|
117
|
+
subject: string,
|
|
118
|
+
markingIds: ReadonlySet<string>
|
|
119
|
+
): void {
|
|
120
|
+
if (!Array.isArray(markings) || markings.length === 0) {
|
|
121
|
+
throw new SecurityValidationError(
|
|
122
|
+
`[Sixb] ${subject} markings must be a non-empty list of marking ids.`
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
if (new Set(markings).size !== markings.length) {
|
|
126
|
+
throw new SecurityValidationError(`[Sixb] ${subject} lists the same marking twice.`)
|
|
127
|
+
}
|
|
128
|
+
for (const markingId of markings) {
|
|
129
|
+
if (typeof markingId !== "string" || !markingIds.has(markingId)) {
|
|
130
|
+
throw new SecurityValidationError(
|
|
131
|
+
`[Sixb] ${subject} references unknown marking '${String(markingId)}'. Add it to 'security/markings/' or pass it to createSixb({ markings }).`
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ── Propagation ─────────────────────────────────────────────
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A step's output inherits nothing from its inputs until Sixb can derive each output column's
|
|
141
|
+
* markings from the transform. Until then, reading a marked column would declassify it.
|
|
142
|
+
*/
|
|
143
|
+
function rejectPipelineStepsOverMarkedColumns(
|
|
144
|
+
pipelines: readonly PipelineDefinition[],
|
|
145
|
+
datasetsById: ReadonlyMap<string, DatasetDefinition>
|
|
146
|
+
): void {
|
|
147
|
+
for (const pipeline of pipelines) {
|
|
148
|
+
for (const { step } of pipeline.graph.nodes) {
|
|
149
|
+
for (const input of Object.values(step.inputs)) {
|
|
150
|
+
const dataset = datasetsById.get(input.id)
|
|
151
|
+
const column = dataset?.schema.columns.find((candidate) => candidate.markings)
|
|
152
|
+
if (!dataset || !column) continue
|
|
153
|
+
throw new SecurityValidationError(
|
|
154
|
+
`[Sixb] Pipeline '${pipeline.id}' step '${step.id}' reads column '${dataset.id}.${column.name}', which carries ${markingList(column.markings)}. Pipeline steps cannot read marked columns yet.`
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Objects are read through the ontology, so each projected property declares the markings of its
|
|
163
|
+
* column: the ontology stays the reviewed contract of what each reader receives. Values that
|
|
164
|
+
* identify objects or key links are returned wherever the object or link is, and telemetry does
|
|
165
|
+
* not enforce markings yet, so those columns cannot carry markings.
|
|
166
|
+
*/
|
|
167
|
+
function validateProjectionMarkings(
|
|
168
|
+
projections: ProjectionDefinitionCatalog,
|
|
169
|
+
ontology: OntologyDefinitionCatalog,
|
|
170
|
+
datasetsById: ReadonlyMap<string, DatasetDefinition>
|
|
171
|
+
): void {
|
|
172
|
+
for (const projection of projections.listObjects()) {
|
|
173
|
+
const objectType = ontology.getObjectTypeById(projection.objectTypeId)
|
|
174
|
+
if (objectType) validateObjectProjection(projection, objectType, datasetsById)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
for (const projection of projections.listLinks()) {
|
|
178
|
+
const role = `keys link '${projection.sourceObjectTypeId}.${projection.linkId}'`
|
|
179
|
+
for (const columnName of [projection.sourceField, projection.targetField]) {
|
|
180
|
+
assertUnmarkedColumn(projection, sourceColumn(projection, columnName, datasetsById), role)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
for (const projection of projections.listTelemetry()) {
|
|
185
|
+
const columnNames = [
|
|
186
|
+
projection.objectIdField,
|
|
187
|
+
projection.atField,
|
|
188
|
+
...Object.values(projection.properties).flatMap((mapping) =>
|
|
189
|
+
mapping.unitField === undefined
|
|
190
|
+
? [mapping.valueField]
|
|
191
|
+
: [mapping.valueField, mapping.unitField]
|
|
192
|
+
),
|
|
193
|
+
]
|
|
194
|
+
for (const columnName of columnNames) {
|
|
195
|
+
const column = sourceColumn(projection, columnName, datasetsById)
|
|
196
|
+
if (!column.markings) continue
|
|
197
|
+
throw new SecurityValidationError(
|
|
198
|
+
`[Sixb] Projection '${projection.id}' reads column '${column.path}', which carries ${markingList(column.markings)}. Telemetry projections cannot read marked columns yet.`
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function validateObjectProjection(
|
|
205
|
+
projection: ObjectProjectionDefinition,
|
|
206
|
+
objectType: ObjectType,
|
|
207
|
+
datasetsById: ReadonlyMap<string, DatasetDefinition>
|
|
208
|
+
): void {
|
|
209
|
+
const keyRoles = objectProjectionKeyRoles(projection, objectType)
|
|
210
|
+
|
|
211
|
+
for (const [propertyId, columnName] of Object.entries(projection.properties)) {
|
|
212
|
+
const column = sourceColumn(projection, columnName, datasetsById)
|
|
213
|
+
const property = objectType.properties.find((candidate) => candidate.id === propertyId)
|
|
214
|
+
const path = `${objectType.id}.${propertyId}`
|
|
215
|
+
const keyRole = keyRoles.get(propertyId)
|
|
216
|
+
if (keyRole) {
|
|
217
|
+
assertUnmarkedColumn(projection, column, keyRole)
|
|
218
|
+
if (property?.markings) {
|
|
219
|
+
throw new SecurityValidationError(
|
|
220
|
+
`[Sixb] Projection '${projection.id}': property '${path}' ${keyRole} and cannot carry markings.`
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
continue
|
|
224
|
+
}
|
|
225
|
+
const missing = missingMarkings(column.markings, property?.markings)
|
|
226
|
+
if (missing.length > 0) {
|
|
227
|
+
throw new SecurityValidationError(
|
|
228
|
+
`[Sixb] Projection '${projection.id}': property '${path}' is projected from column '${column.path}', which carries ${markingList(column.markings)}. Add markings: ${markingList(missing)} to the property.`
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
for (const [linkId, link] of Object.entries(projection.links)) {
|
|
234
|
+
if (link.sourceField === undefined) continue
|
|
235
|
+
assertUnmarkedColumn(
|
|
236
|
+
projection,
|
|
237
|
+
sourceColumn(projection, link.sourceField, datasetsById),
|
|
238
|
+
`keys link '${objectType.id}.${linkId}'`
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// The timestamp decides whether the source value or an app edit wins, which reveals how they
|
|
243
|
+
// compare.
|
|
244
|
+
const conflictResolution = projection.conflictResolution
|
|
245
|
+
if (conflictResolution?.strategy === "mostRecent") {
|
|
246
|
+
assertUnmarkedColumn(
|
|
247
|
+
projection,
|
|
248
|
+
sourceColumn(projection, conflictResolution.sourceTimestamp, datasetsById),
|
|
249
|
+
"decides which value wins under 'mostRecent'"
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** Properties whose value becomes an object id or a link key, with the role they play. */
|
|
255
|
+
function objectProjectionKeyRoles(
|
|
256
|
+
projection: ObjectProjectionDefinition,
|
|
257
|
+
objectType: ObjectType
|
|
258
|
+
): ReadonlyMap<string, string> {
|
|
259
|
+
const roles = new Map<string, string>()
|
|
260
|
+
for (const property of objectType.properties) {
|
|
261
|
+
if (property.primary) roles.set(property.id, `becomes the id of '${objectType.id}'`)
|
|
262
|
+
}
|
|
263
|
+
for (const [linkId, link] of Object.entries(projection.links)) {
|
|
264
|
+
if (link.sourcePropertyId === undefined) continue
|
|
265
|
+
roles.set(link.sourcePropertyId, `keys link '${objectType.id}.${linkId}'`)
|
|
266
|
+
}
|
|
267
|
+
return roles
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
interface SourceColumn {
|
|
271
|
+
readonly path: string
|
|
272
|
+
readonly markings?: readonly string[]
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function sourceColumn(
|
|
276
|
+
projection: { readonly id: string; readonly datasetId: string },
|
|
277
|
+
columnName: string,
|
|
278
|
+
datasetsById: ReadonlyMap<string, DatasetDefinition>
|
|
279
|
+
): SourceColumn {
|
|
280
|
+
const column = datasetsById
|
|
281
|
+
.get(projection.datasetId)
|
|
282
|
+
?.schema.columns.find((candidate) => candidate.name === columnName)
|
|
283
|
+
// Projection validation runs first and resolves every mapped column.
|
|
284
|
+
if (!column) {
|
|
285
|
+
throw new Error(`[Sixb] Projection '${projection.id}' maps unknown column '${columnName}'.`)
|
|
286
|
+
}
|
|
287
|
+
return { path: `${projection.datasetId}.${columnName}`, markings: column.markings }
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function assertUnmarkedColumn(
|
|
291
|
+
projection: { readonly id: string },
|
|
292
|
+
column: SourceColumn,
|
|
293
|
+
role: string
|
|
294
|
+
): void {
|
|
295
|
+
if (!column.markings) return
|
|
296
|
+
throw new SecurityValidationError(
|
|
297
|
+
`[Sixb] Projection '${projection.id}': column '${column.path}' ${role} and cannot carry markings.`
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// ── Helpers ─────────────────────────────────────────────────
|
|
302
|
+
|
|
303
|
+
function missingMarkings(
|
|
304
|
+
required: readonly string[] | undefined,
|
|
305
|
+
declared: readonly string[] | undefined
|
|
306
|
+
): readonly string[] {
|
|
307
|
+
const present = new Set(declared ?? [])
|
|
308
|
+
return (required ?? []).filter((markingId) => !present.has(markingId))
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function markingList(markings: readonly string[] | undefined): string {
|
|
312
|
+
return `[${(markings ?? []).join(", ")}]`
|
|
313
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Redactions } from "./types"
|
|
2
|
+
|
|
3
|
+
/** List the values hidden from a reader that lacks a clearance for their markings. */
|
|
4
|
+
export function missingClearanceRedactions(ids: Iterable<string>): Redactions {
|
|
5
|
+
return Object.fromEntries([...ids].map((id) => [id, { reason: "missing_clearance" }] as const))
|
|
6
|
+
}
|
package/src/security/registry.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { type ResolvedRole, resolveRoleGrants } from "../authorization"
|
|
2
2
|
import { APPLICATION_IDS } from "./applications"
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
GroupDefinition,
|
|
5
|
+
MarkingDefinition,
|
|
6
|
+
MembershipPolicyDefinition,
|
|
7
|
+
RoleDefinition,
|
|
8
|
+
} from "./types"
|
|
4
9
|
import { validateSecurityDefinitionsAtStartup } from "./validation"
|
|
5
10
|
|
|
6
11
|
/** Read-only access to validated security definitions and resolved role grants. */
|
|
7
12
|
export interface SecurityDefinitionCatalog {
|
|
13
|
+
listMarkings(): readonly MarkingDefinition[]
|
|
14
|
+
getMarkingById(markingId: string): MarkingDefinition | null
|
|
8
15
|
listGroups(): readonly GroupDefinition[]
|
|
9
16
|
getGroupById(groupId: string): GroupDefinition | null
|
|
10
17
|
listRoles(): readonly RoleDefinition[]
|
|
@@ -15,6 +22,7 @@ export interface SecurityDefinitionCatalog {
|
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
export interface SecurityRegistryOptions {
|
|
25
|
+
readonly markings?: readonly MarkingDefinition[]
|
|
18
26
|
readonly groups?: readonly GroupDefinition[]
|
|
19
27
|
readonly roles?: readonly RoleDefinition[]
|
|
20
28
|
readonly membershipPolicies?: readonly MembershipPolicyDefinition[]
|
|
@@ -32,6 +40,7 @@ export interface SecurityRegistryOptions {
|
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
export class SecurityRegistry implements SecurityDefinitionCatalog {
|
|
43
|
+
private readonly markingsById: ReadonlyMap<string, MarkingDefinition>
|
|
35
44
|
private readonly groupsById: ReadonlyMap<string, GroupDefinition>
|
|
36
45
|
private readonly rolesById: ReadonlyMap<string, RoleDefinition>
|
|
37
46
|
private readonly membershipPoliciesById: ReadonlyMap<string, MembershipPolicyDefinition>
|
|
@@ -39,6 +48,7 @@ export class SecurityRegistry implements SecurityDefinitionCatalog {
|
|
|
39
48
|
|
|
40
49
|
constructor(input: SecurityRegistryOptions) {
|
|
41
50
|
const definitions = validateSecurityDefinitionsAtStartup({
|
|
51
|
+
markings: input.markings ?? [],
|
|
42
52
|
groups: input.groups ?? [],
|
|
43
53
|
roles: input.roles ?? [],
|
|
44
54
|
membershipPolicies: input.membershipPolicies ?? [],
|
|
@@ -71,6 +81,7 @@ export class SecurityRegistry implements SecurityDefinitionCatalog {
|
|
|
71
81
|
getSubTypes: input.getSubTypes ?? (() => []),
|
|
72
82
|
}
|
|
73
83
|
|
|
84
|
+
this.markingsById = definitions.markingsById
|
|
74
85
|
this.groupsById = definitions.groupsById
|
|
75
86
|
this.rolesById = definitions.rolesById
|
|
76
87
|
this.membershipPoliciesById = definitions.membershipPoliciesById
|
|
@@ -78,9 +89,18 @@ export class SecurityRegistry implements SecurityDefinitionCatalog {
|
|
|
78
89
|
id: role.id,
|
|
79
90
|
grantedToGroupIds: role.grantedToGroupIds,
|
|
80
91
|
grants: resolveRoleGrants(role, universe),
|
|
92
|
+
clearances: new Set(role.clearances ?? []),
|
|
81
93
|
}))
|
|
82
94
|
}
|
|
83
95
|
|
|
96
|
+
listMarkings(): readonly MarkingDefinition[] {
|
|
97
|
+
return [...this.markingsById.values()]
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
getMarkingById(markingId: string): MarkingDefinition | null {
|
|
101
|
+
return this.markingsById.get(markingId) ?? null
|
|
102
|
+
}
|
|
103
|
+
|
|
84
104
|
listGroups(): readonly GroupDefinition[] {
|
|
85
105
|
return [...this.groupsById.values()]
|
|
86
106
|
}
|
package/src/security/types.ts
CHANGED
|
@@ -7,6 +7,28 @@ export interface GroupDefinition<TId extends string = string> {
|
|
|
7
7
|
readonly description?: string
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* A classification carried by sensitive properties and dataset columns.
|
|
12
|
+
*
|
|
13
|
+
* A principal reads a marked value only when one of its roles lists the marking in `clearances`.
|
|
14
|
+
* No grant bypasses a marking.
|
|
15
|
+
*/
|
|
16
|
+
export interface MarkingDefinition<TId extends string = string> {
|
|
17
|
+
readonly kind: "marking"
|
|
18
|
+
readonly id: TId
|
|
19
|
+
readonly label?: string
|
|
20
|
+
readonly description?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Why a value was omitted from a read. */
|
|
24
|
+
export type RedactionReason = "missing_clearance"
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Values omitted from a read, keyed by property id or column name. A redacted value is absent,
|
|
28
|
+
* never `null`.
|
|
29
|
+
*/
|
|
30
|
+
export type Redactions = Readonly<Record<string, { readonly reason: RedactionReason }>>
|
|
31
|
+
|
|
10
32
|
/**
|
|
11
33
|
* A group named either by its definition or by its id.
|
|
12
34
|
*
|
|
@@ -149,6 +171,8 @@ export interface RoleDefinition<TId extends string = string> {
|
|
|
149
171
|
readonly description?: string
|
|
150
172
|
readonly grantedToGroupIds: readonly string[]
|
|
151
173
|
readonly grants: readonly GrantDefinition[]
|
|
174
|
+
/** Ids of the markings this role's members may read. Absent means none. */
|
|
175
|
+
readonly clearances?: readonly string[]
|
|
152
176
|
}
|
|
153
177
|
|
|
154
178
|
export type MembershipOperation = "invite" | "assignGroups" | "suspend"
|
|
@@ -162,6 +186,8 @@ export interface MembershipPolicyDefinition<TId extends string = string> {
|
|
|
162
186
|
}
|
|
163
187
|
|
|
164
188
|
export interface RegisteredSecurityDefinitions {
|
|
189
|
+
readonly markings: readonly MarkingDefinition[]
|
|
190
|
+
readonly markingsById: ReadonlyMap<string, MarkingDefinition>
|
|
165
191
|
readonly groups: readonly GroupDefinition[]
|
|
166
192
|
readonly groupsById: ReadonlyMap<string, GroupDefinition>
|
|
167
193
|
readonly roles: readonly RoleDefinition[]
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
GrantCapability,
|
|
6
6
|
GrantDefinition,
|
|
7
7
|
GroupDefinition,
|
|
8
|
+
MarkingDefinition,
|
|
8
9
|
MembershipPolicyDefinition,
|
|
9
10
|
RegisteredSecurityDefinitions,
|
|
10
11
|
RoleDefinition,
|
|
@@ -132,6 +133,32 @@ function assertNoDuplicateOperations(
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
|
|
136
|
+
export function assertMarkingDefinition(
|
|
137
|
+
value: unknown,
|
|
138
|
+
createError: CreateSecurityError = (message) => new SecurityValidationError(message)
|
|
139
|
+
): asserts value is MarkingDefinition {
|
|
140
|
+
if (!isRecord(value)) {
|
|
141
|
+
throw createError("[Sixb] Marking definition must be an object.")
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (value.kind !== "marking") {
|
|
145
|
+
throw createError("[Sixb] Marking definition kind must be 'marking'.")
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
assertNonEmptyString(value.id, "Marking id", createError)
|
|
149
|
+
assertOptionalString(value.label, `Marking '${value.id}' label`, createError)
|
|
150
|
+
assertOptionalString(value.description, `Marking '${value.id}' description`, createError)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function isMarkingDefinition(value: unknown): value is MarkingDefinition {
|
|
154
|
+
try {
|
|
155
|
+
assertMarkingDefinition(value, (message) => new Error(message))
|
|
156
|
+
return true
|
|
157
|
+
} catch {
|
|
158
|
+
return false
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
135
162
|
export function assertGroupDefinition(
|
|
136
163
|
value: unknown,
|
|
137
164
|
createError: CreateSecurityError = (message) => new SecurityValidationError(message)
|
|
@@ -285,6 +312,10 @@ export function assertRoleDefinition(
|
|
|
285
312
|
for (const grant of value.grants) {
|
|
286
313
|
assertGrantDefinition(grant, `Role '${value.id}' grants`, createError)
|
|
287
314
|
}
|
|
315
|
+
|
|
316
|
+
if (value.clearances !== undefined) {
|
|
317
|
+
assertStringArray(value.clearances, `Role '${value.id}' clearances`, createError)
|
|
318
|
+
}
|
|
288
319
|
}
|
|
289
320
|
|
|
290
321
|
export function isRoleDefinition(value: unknown): value is RoleDefinition {
|
|
@@ -297,6 +328,7 @@ export function isRoleDefinition(value: unknown): value is RoleDefinition {
|
|
|
297
328
|
}
|
|
298
329
|
|
|
299
330
|
export function validateSecurityDefinitionsAtStartup(input: {
|
|
331
|
+
readonly markings?: readonly MarkingDefinition[]
|
|
300
332
|
readonly groups: readonly GroupDefinition[]
|
|
301
333
|
readonly membershipPolicies: readonly MembershipPolicyDefinition[]
|
|
302
334
|
readonly roles?: readonly RoleDefinition[]
|
|
@@ -325,10 +357,21 @@ export function validateSecurityDefinitionsAtStartup(input: {
|
|
|
325
357
|
/** Registered Share ids — when provided, share grants must reference them. */
|
|
326
358
|
readonly shareIds?: ReadonlySet<string>
|
|
327
359
|
}): RegisteredSecurityDefinitions {
|
|
360
|
+
const markingsById = new Map<string, MarkingDefinition>()
|
|
328
361
|
const groupsById = new Map<string, GroupDefinition>()
|
|
329
362
|
const rolesById = new Map<string, RoleDefinition>()
|
|
330
363
|
const membershipPoliciesById = new Map<string, MembershipPolicyDefinition>()
|
|
331
364
|
|
|
365
|
+
for (const marking of input.markings ?? []) {
|
|
366
|
+
assertMarkingDefinition(marking)
|
|
367
|
+
|
|
368
|
+
if (markingsById.has(marking.id)) {
|
|
369
|
+
throw new SecurityValidationError(`[Sixb] Duplicate marking id: ${marking.id}`)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
markingsById.set(marking.id, marking)
|
|
373
|
+
}
|
|
374
|
+
|
|
332
375
|
for (const group of input.groups) {
|
|
333
376
|
assertGroupDefinition(group)
|
|
334
377
|
|
|
@@ -352,11 +395,23 @@ export function validateSecurityDefinitionsAtStartup(input: {
|
|
|
352
395
|
)
|
|
353
396
|
}
|
|
354
397
|
|
|
355
|
-
|
|
356
|
-
|
|
398
|
+
const clearances = role.clearances ?? []
|
|
399
|
+
if (role.grants.length === 0 && clearances.length === 0) {
|
|
400
|
+
throw new SecurityValidationError(
|
|
401
|
+
`[Sixb] Role '${role.id}' must declare at least one grant or clearance.`
|
|
402
|
+
)
|
|
357
403
|
}
|
|
358
404
|
|
|
359
405
|
assertNoDuplicateIds(role.grantedToGroupIds, `Role '${role.id}' grantedTo`)
|
|
406
|
+
assertNoDuplicateIds(clearances, `Role '${role.id}' clearances`)
|
|
407
|
+
|
|
408
|
+
for (const markingId of clearances) {
|
|
409
|
+
if (!markingsById.has(markingId)) {
|
|
410
|
+
throw new SecurityValidationError(
|
|
411
|
+
`[Sixb] Role '${role.id}' clearances reference unknown marking '${markingId}'. Add it to 'security/markings/' or pass it to createSixb({ markings }).`
|
|
412
|
+
)
|
|
413
|
+
}
|
|
414
|
+
}
|
|
360
415
|
|
|
361
416
|
for (const groupId of role.grantedToGroupIds) {
|
|
362
417
|
if (!groupsById.has(groupId)) {
|
|
@@ -416,6 +471,8 @@ export function validateSecurityDefinitionsAtStartup(input: {
|
|
|
416
471
|
}
|
|
417
472
|
|
|
418
473
|
return {
|
|
474
|
+
markings: [...markingsById.values()],
|
|
475
|
+
markingsById,
|
|
419
476
|
groups: [...groupsById.values()],
|
|
420
477
|
groupsById,
|
|
421
478
|
roles: [...rolesById.values()],
|
|
@@ -150,6 +150,17 @@ export function assertConversationAgentRunSpec(
|
|
|
150
150
|
`[${prefix}] Conversational Agent reasoning must be one of: ${AGENT_REASONING_LEVELS.join(", ")}, or a nonnegative budgetTokens object.`
|
|
151
151
|
)
|
|
152
152
|
}
|
|
153
|
+
for (const [name, value] of [
|
|
154
|
+
["timeZone", spec.timeZone],
|
|
155
|
+
["locale", spec.locale],
|
|
156
|
+
] as const) {
|
|
157
|
+
if (value !== undefined && (typeof value !== "string" || value.trim().length === 0)) {
|
|
158
|
+
throw new AgentStorageError(
|
|
159
|
+
"invalid_input",
|
|
160
|
+
`[${prefix}] Conversational Agent run '${name}' must be a non-empty string.`
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
153
164
|
}
|
|
154
165
|
|
|
155
166
|
function isRecord(value: unknown): value is Readonly<Record<string, unknown>> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentMessage, AgentMessagePart, AgentMessageRole } from "../../agents/message"
|
|
2
|
-
import type {
|
|
2
|
+
import type { AgentReasoning } from "../../agents/types"
|
|
3
3
|
import type { Principal } from "../../auth"
|
|
4
4
|
import type { FileRef } from "../../blob-storage"
|
|
5
5
|
import type { SixbErrorCode, SixbFailure } from "../../errors/types"
|
|
@@ -123,8 +123,9 @@ export type AgentRunFailureCode = (typeof AGENT_RUN_FAILURE_CODES)[number]
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Why a run ended — Sixb's provider-independent vocabulary. It includes model-loop reasons plus
|
|
126
|
-
* platform-level endings such as `timeout`,
|
|
127
|
-
*
|
|
126
|
+
* platform-level endings such as `timeout`, or `interrupted` for a turn whose worker died before
|
|
127
|
+
* finishing it, so reads remain typed and exhaustive. `other` and `unknown` preserve terminal state
|
|
128
|
+
* when a provider adds a new reason.
|
|
128
129
|
*/
|
|
129
130
|
export const AGENT_RUN_FINISH_REASONS = [
|
|
130
131
|
"stop",
|
|
@@ -132,6 +133,7 @@ export const AGENT_RUN_FINISH_REASONS = [
|
|
|
132
133
|
"content-filter",
|
|
133
134
|
"tool-calls",
|
|
134
135
|
"timeout",
|
|
136
|
+
"interrupted",
|
|
135
137
|
"error",
|
|
136
138
|
"other",
|
|
137
139
|
"unknown",
|
|
@@ -162,6 +164,7 @@ export const AGENT_RUN_DIAGNOSTIC_CODES = [
|
|
|
162
164
|
"output_collection_failed",
|
|
163
165
|
"output_file_changed",
|
|
164
166
|
"output_storage_failed",
|
|
167
|
+
"step_limit_reached",
|
|
165
168
|
] as const
|
|
166
169
|
|
|
167
170
|
/**
|
|
@@ -178,7 +181,8 @@ export type AgentRunDiagnosticSeverity = "warning" | "error"
|
|
|
178
181
|
export interface AgentRunDiagnostic {
|
|
179
182
|
readonly code: AgentRunDiagnosticCode
|
|
180
183
|
readonly severity: AgentRunDiagnosticSeverity
|
|
181
|
-
|
|
184
|
+
/** `output` for published files, `run` for the turn as a whole. */
|
|
185
|
+
readonly scope: "output" | "run"
|
|
182
186
|
/** Relative path inside the run's published output directory, when one file is involved. */
|
|
183
187
|
readonly path?: string
|
|
184
188
|
/** Sanitized, stable copy suitable for display to an end user. */
|
|
@@ -224,16 +228,20 @@ export interface ConversationAgentRunRecord extends AgentRunRecordBase {
|
|
|
224
228
|
readonly spec?: ConversationAgentRunSpec
|
|
225
229
|
}
|
|
226
230
|
|
|
227
|
-
/** Immutable, serialisable model selection for one conversational turn. */
|
|
231
|
+
/** Immutable, serialisable model selection and requester settings for one conversational turn. */
|
|
228
232
|
export interface ConversationAgentRunSpec {
|
|
229
233
|
readonly model: LanguageModelRef
|
|
230
|
-
readonly reasoning?:
|
|
234
|
+
readonly reasoning?: AgentReasoning
|
|
235
|
+
/** Canonical IANA time zone of the requester. Absent uses the project time zone. */
|
|
236
|
+
readonly timeZone?: string
|
|
237
|
+
/** Canonical BCP 47 language of the requester. Absent uses the project locale. */
|
|
238
|
+
readonly locale?: string
|
|
231
239
|
}
|
|
232
240
|
|
|
233
241
|
/** Immutable, serialisable child configuration captured before dispatch. */
|
|
234
242
|
export interface SubagentRunSpec {
|
|
235
243
|
readonly model: LanguageModelRef
|
|
236
|
-
readonly reasoning?:
|
|
244
|
+
readonly reasoning?: AgentReasoning
|
|
237
245
|
/** Focused task supplied by the parent Agent. */
|
|
238
246
|
readonly task: string
|
|
239
247
|
/** Project tools available when the child was admitted. Runtime tools are injected separately. */
|
package/src/storage/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type {
|
|
|
21
21
|
} from "../materialization/model"
|
|
22
22
|
export type { ModelProviderIds } from "../models/events"
|
|
23
23
|
export type { ObjectRef } from "../ontology"
|
|
24
|
+
export type { RedactionReason, Redactions } from "../security/types"
|
|
24
25
|
export type {
|
|
25
26
|
ShareAccessPlan,
|
|
26
27
|
ShareScopedActionGrant,
|